Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import type { Preview } from '@storybook/react';
import { withThemeByDataAttribute } from '@storybook/addon-themes';
import '../src/styles/index.css';
import '../src/experimental/styles.css';
import '../src/styles/global.css';

const preview: Preview = {
parameters: {
controls: {
expanded: true,
},
controls: { expanded: true },
options: {
storySort: {
order: [
'Introduction',
'Foundations',
'Components',
'Patterns',
],
order: ['Introduction', 'Foundations', 'Components', 'Experimental', 'Patterns'],
},
},
backgrounds: { disable: true },
},
decorators: [
(Story) => (
<div dir="rtl" lang="fa">
<Story />
</div>
),
withThemeByDataAttribute({
themes: { light: 'light', dark: 'dark' },
defaultTheme: 'light',
attributeName: 'data-theme',
}),
],
};

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"peerDependencies": {
"react": ">=18"
},
"dependencies": {},
"dependencies": {
"@fontsource-variable/handjet": "^5.2.8",
"@fontsource-variable/noto-sans": "^5.2.8",
"@fontsource-variable/noto-sans-arabic": "^5.2.8"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@storybook/addon-essentials": "^8.6.18",
Expand Down
39 changes: 39 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 3 additions & 18 deletions src/fonts/index.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
@font-face {
font-family: 'Noto Sans';
src: local('Noto Sans');
}

@font-face {
font-family: 'Noto Sans Arabic';
src: local('Noto Sans Arabic');
}

@font-face {
font-family: 'Handjet';
src: local('Handjet');
}

:root {
font-family: 'Noto Sans', 'Noto Sans Arabic', sans-serif;
}
@import '@fontsource-variable/noto-sans/wght.css';
@import '@fontsource-variable/noto-sans-arabic/wght.css';
@import '@fontsource-variable/handjet/wght.css';
16 changes: 12 additions & 4 deletions src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
:root {
font-family: "Noto Sans Arabic", "Noto Sans", system-ui, sans-serif;
direction: rtl;
html,
body {
margin: 0;
min-block-size: 100%;
background: var(--core-color-surface-page);
color: var(--core-color-text-primary);
font-family: var(--core-font-family);
}

body {
padding: var(--core-space-4);
}

* {
box-sizing: border-box;
}

.core-display {
font-family: "Handjet", sans-serif;
font-family: var(--core-display-font-family);
}
11 changes: 11 additions & 0 deletions src/tokens/semantic.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
:root {
--core-font-family-latin: 'Noto Sans Variable', system-ui, sans-serif;
--core-font-family-arabic: 'Noto Sans Arabic Variable', 'Noto Sans Variable', system-ui, sans-serif;
--core-font-family: var(--core-font-family-latin);
--core-display-font-family: 'Handjet Variable', var(--core-font-family-latin);
--core-color-action-primary: #0066ff;
--core-color-action-primary-hover: #0052cc;
--core-color-action-danger: #b42318;
Expand Down Expand Up @@ -37,6 +41,13 @@
--core-control-lg: 52px;
}

.core-root[lang='fa'],
.core-root[lang='ar'],
[lang='fa'] .core-root,
[lang='ar'] .core-root {
--core-font-family: var(--core-font-family-arabic);
}

[data-theme='dark'] {
--core-color-action-primary: #66a3ff;
--core-color-action-primary-hover: #8fbbff;
Expand Down
Loading