injast-core 1.0.80 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,46 @@
1
1
  # Layout and Navigation
2
2
 
3
- ## Layout Primitives
3
+ ## App Shell
4
4
 
5
- Use `Box`, `Container`, and `Grid` for page structure.
5
+ Most generated Injast screens should be mobile-first and centered:
6
+
7
+ ```tsx
8
+ import { Box } from "injast-core";
9
+
10
+ <Box
11
+ sx={{
12
+ maxWidth: 550,
13
+ mx: "auto",
14
+ minHeight: "100dvh",
15
+ bgcolor: "neutral.50",
16
+ }}
17
+ >
18
+ {children}
19
+ </Box>
20
+ ```
21
+
22
+ Equivalent CSS:
23
+
24
+ ```css
25
+ max-width: 550px;
26
+ margin-inline: auto;
27
+ ```
28
+
29
+ Use this shell for authentication, onboarding, profile, checkout, settings, forms, and mobile operational flows.
30
+
31
+ Use a wider layout only for desktop-first dashboards, large tables, chart-heavy analytics, or split-pane workflows. Even then, keep forms and drawers constrained to readable widths.
32
+
33
+ ## Page Composition
34
+
35
+ - Use `Box`, `Container`, and `Grid` for structure.
36
+ - Use page padding inside the shell: `px: 4`, `py: 4` to `py: 6`.
37
+ - Use `display="grid"` or `display="flex"` with `gap`, not stacked arbitrary margins.
38
+ - Use `gap: 4` to `gap: 6` between major sections.
39
+ - Use `gap: 3` to `gap: 4` inside field groups and card content.
40
+ - Keep a hint of the next section visible on the first viewport when building long mobile flows.
41
+ - Do not create landing-page heroes for app/tool requests.
42
+
43
+ ## Layout Primitives
6
44
 
7
45
  ```tsx
8
46
  <Container maxWidth="lg">
@@ -14,23 +52,85 @@ Use `Box`, `Container`, and `Grid` for page structure.
14
52
 
15
53
  Rules:
16
54
 
17
- - Use `gap`, `p`, `px`, `py`, `m`, and `mx` from MUI spacing.
18
- - Use `Container` to constrain broad pages.
55
+ - Use `Container` to constrain broad desktop pages.
56
+ - Use `Box` for app shells, stacks, rows, and framed repeated items.
19
57
  - Use `Grid` for responsive multi-column layouts.
58
+ - Use MUI spacing props: `gap`, `p`, `px`, `py`, `m`, `mx`, `my`.
20
59
  - Avoid raw CSS layout unless component props are not enough.
21
60
 
61
+ ## Fixed Bottom Actions
62
+
63
+ For mobile forms with a clear final action, use a bottom action band:
64
+
65
+ - Shell width remains 550px max and centered.
66
+ - Use `position: "sticky"` or `position: "fixed"` only when the action must stay visible.
67
+ - Use `px: 4`, `py: 3`, neutral/white background, and a subtle top border.
68
+ - Use a full-width `Button buttonSize="M"` for the primary action.
69
+ - Ensure the scroll content has bottom padding so fields are not hidden behind the action band.
70
+
71
+ ## Sticky App Regions
72
+
73
+ For chat, assistant, or app-like flows, use a sticky header and sticky bottom input/action area inside the 550px shell.
74
+
75
+ Header rules:
76
+
77
+ - Height: 56px.
78
+ - Background: `neutral.100` or the page canvas color.
79
+ - Padding: `p: 4` (16px) unless the header is extremely dense.
80
+ - Use Iconsax 20px icons for back, home, menu, and disclosure controls.
81
+ - Use 32px to 40px icon button targets with 12px radius for compact header controls.
82
+ - Truncate long titles with `overflow: "hidden"`, `textOverflow: "ellipsis"`, and `whiteSpace: "nowrap"`.
83
+
84
+ Bottom input/action rules:
85
+
86
+ - Use `position: "sticky"` or a sticky `.input-area` at `bottom: 0`.
87
+ - Use `p: "10px 16px"`, `gap: "8px"`, and `bgcolor: "neutral.100"`.
88
+ - Keep the message/input field container at 12px radius.
89
+ - Use a 48px square submit/send `Button` when the input sits beside the action.
90
+ - Keep the scrollable content area as `flex: 1` with `overflowY: "auto"`.
91
+
92
+ Chat bubble rules:
93
+
94
+ - Use `gap: "8px"` and `mb: "8px"` between message rows.
95
+ - Message bubble max width should leave avatar/action space, for example `maxWidth: "calc(100% - 70px)"`.
96
+ - Bubble padding can use `p: "8px 18px"`.
97
+ - Bubble radius should be 12px, with one corner squared to show sender direction when useful.
98
+ - User messages can use `primary.main` with `primary.contrastText`; bot/system messages should use white or neutral surfaces with `neutral.700` text.
99
+
22
100
  ## Lists
23
101
 
24
102
  Use `List` and `ListItem` for vertical collections. Keep each row's main label, metadata, and action placement consistent.
25
103
 
104
+ Rules:
105
+
106
+ - Keep row actions on the trailing side in RTL.
107
+ - Use icons only when they speed recognition.
108
+ - Use stable row heights for repeated lists.
109
+
26
110
  ## Accordion
27
111
 
28
- Use `Accordion`, `AccordionSummary`, and `AccordionDetails` for optional details, filters, and FAQ-like disclosure. Do not hide primary required fields in an accordion.
112
+ Use `Accordion`, `AccordionSummary`, and `AccordionDetails` for optional details, filters, and FAQ-like disclosure.
113
+
114
+ Do not hide required primary fields or blocking errors inside an accordion.
29
115
 
30
116
  ## Tabs
31
117
 
32
118
  Use `Tab` when switching between closely related panels at the same hierarchy level. Do not use tabs as primary app navigation.
33
119
 
120
+ Tab rules:
121
+
122
+ - Pass `tabs` as `{ label, value }[]`.
123
+ - Use `activeTab` for a controlled initial/active value.
124
+ - `onChange` receives the selected tab value.
125
+ - Default `fontSize` is 14px; reduce only for dense segmented controls.
126
+ - Tab height is 48px with 12px radius and an active underline.
127
+
34
128
  ## Stepper
35
129
 
36
- Use `Stepper` and related step components for multi-step flows such as onboarding, checkout, or profile completion. Keep the active step clear and provide Back/Next actions with `Button`.
130
+ Use `Stepper` and related step components for multi-step flows such as onboarding, checkout, or profile completion.
131
+
132
+ Rules:
133
+
134
+ - Keep the active step clear.
135
+ - Provide Back/Next actions with `Button`.
136
+ - Keep step content width readable; 400px to 550px works well for form flows.
@@ -2,28 +2,46 @@
2
2
 
3
3
  Always prefer Injast Core components over raw HTML and direct Material UI primitives. Read the focused guideline file before using a component group.
4
4
 
5
+ ## Selection Rules
6
+
7
+ - Use root imports from `injast-core` for normal Make output.
8
+ - Use `iconsax-react` for all generated app icons.
9
+ - Use `Box`, `Container`, and `Grid` for layout instead of raw layout elements when possible.
10
+ - Use `Typography` for visible text that participates in hierarchy.
11
+ - Use `Button`, `IconButton`, and `Fab` for actions.
12
+ - Use Injast form components for all inputs.
13
+ - Use `Toast`, `Modal`, `Dialog`, `Loading`, and `Skeleton` for feedback.
14
+ - Use `DataGrid` for tables and operational records.
15
+ - Do not guess custom props. If a component is an MUI wrapper, use the matching Material UI props plus documented Injast-specific props.
16
+
5
17
  ## Actions
6
18
 
7
19
  | Component | Also known as | Purpose | Guidelines |
8
20
  |---|---|---|---|
9
21
  | `Button` | CTA, action button | Text actions, submit, navigation, commands | `buttons.md` |
10
- | `IconButton` | icon action | Compact icon-only actions | `buttons.md` |
22
+ | `IconButton` | icon action | Compact icon-only actions | `buttons.md`, `../foundations/icons.md` |
11
23
  | `Fab` | floating action | Prominent floating action | `buttons.md` |
24
+ | `SvgIcon` | masked SVG asset | Legacy/custom SVG mask rendering | `../foundations/icons.md` |
12
25
 
13
26
  ## Forms
14
27
 
15
28
  | Component | Also known as | Purpose | Guidelines |
16
29
  |---|---|---|---|
17
30
  | `TextField` | text input | General text entry | `forms.md` |
31
+ | `Autocomplete` | searchable select, combobox | Search and select from longer option sets | `forms.md` |
18
32
  | `NumberInput` | numeric input | Controlled formatted number entry | `forms.md` |
19
33
  | `CardNumberInput` | bank card input | Iranian bank card number entry | `forms.md` |
20
34
  | `OtpInput` | verification code | One-time password entry | `forms.md` |
35
+ | `IosHiddenOtpInput` | hidden iOS OTP helper | iOS one-time-code autofill bridge | `forms.md` |
21
36
  | `InputPhoneNumber` | phone input | Iranian phone number entry | `forms.md` |
37
+ | `FormControl`, `InputLabel`, `MenuItem`, `FormControlLabel` | form wrappers | MUI-compatible form composition helpers | `forms.md` |
22
38
  | `Select` | dropdown | Single selection | `forms.md` |
23
39
  | `MultiSelect` | tag select | Multiple selection with removable chips | `forms.md` |
24
40
  | `Checkbox` | boolean check | Independent yes/no selection | `forms.md` |
25
41
  | `Radio`, `RadioGroup` | radio buttons | One choice from a short list | `forms.md` |
26
42
  | `Toggle` | switch | On/off setting | `forms.md` |
43
+ | `Slider` | range input | Numeric range or stepped value selection | `forms.md` |
44
+ | `CounterBoxInput` | stepper number input | Quantity or amount with plus/minus controls | `forms.md` |
27
45
 
28
46
  ## Feedback
29
47
 
@@ -31,13 +49,14 @@ Always prefer Injast Core components over raw HTML and direct Material UI primit
31
49
  |---|---|---|---|
32
50
  | `Toast` | snackbar, alert | Brief status feedback | `feedback.md` |
33
51
  | `Modal`, `Dialog` | dialog, overlay | Focused task or confirmation | `feedback.md` |
52
+ | `Drawer` | bottom sheet, side drawer | Mobile picker, filters, navigation drawer | `feedback.md`, `layout.md` |
34
53
  | `Loading`, `LoadingModal`, `CircularProgress`, `Skeleton`, `ProgressBar` | progress | Loading and progress states | `feedback.md` |
35
54
 
36
55
  ## Layout and Navigation
37
56
 
38
57
  | Component | Also known as | Purpose | Guidelines |
39
58
  |---|---|---|---|
40
- | `Box`, `Container`, `Grid` | layout primitives | Spacing and page structure | `layout.md` |
59
+ | `Box`, `Container`, `Grid` | layout primitives | Spacing, shell, and page structure | `layout.md` |
41
60
  | `List`, `ListItem` | list | Vertical repeated items | `layout.md` |
42
61
  | `Accordion`, `AccordionSummary`, `AccordionDetails` | disclosure | Collapsible sections | `layout.md` |
43
62
  | `Tab` | tabs | Switch between related panels | `layout.md` |
@@ -48,8 +67,8 @@ Always prefer Injast Core components over raw HTML and direct Material UI primit
48
67
  | Component | Also known as | Purpose | Guidelines |
49
68
  |---|---|---|---|
50
69
  | `DataGrid` | table, grid | Tabular operational data | `data-display.md` |
51
- | `Typography` | text | Text hierarchy | `data-display.md` |
52
- | `Image` | image | Image rendering with fallback behavior | `data-display.md` |
70
+ | `Typography` | text | Text hierarchy | `data-display.md`, `../foundations/typography.md` |
71
+ | `Image` | image | Image rendering with object-fit behavior | `data-display.md` |
53
72
  | `Divider`, `Pagination` | separator, pager | Data and content structure | `data-display.md` |
54
73
 
55
74
  ## Date Inputs
@@ -1,37 +1,22 @@
1
1
  # Color
2
2
 
3
- ## Palette
3
+ ## Palette Source
4
4
 
5
- Use `defaultColors` from `injast-core/constants` or `injast-core` for semantic colors:
5
+ Use `defaultColors` from `injast-core` or `injast-core/constants` for semantic color decisions:
6
6
 
7
7
  ```tsx
8
8
  import { defaultColors } from "injast-core";
9
9
  ```
10
10
 
11
- Core palette groups:
11
+ The active Material UI theme combines `appColors` with `defaultColors`. Prefer theme palette references in `sx`:
12
12
 
13
- | Group | Use for |
14
- |---|---|
15
- | `neutral` | Text, borders, surfaces, low-emphasis UI |
16
- | `success` | Positive status and success feedback |
17
- | `danger` | Error and destructive status |
18
- | `warning` | Caution and warning status |
19
- | `info` | Informational status |
20
- | `teal` | Preferred Injast brand accent |
21
- | `blue`, `cyan`, `indigo`, `pink`, `orange`, `magenta`, `yellow`, `red` | Secondary accents and charts |
22
-
23
- ## Rules
24
-
25
- - Use `primary` for the main action or active state.
26
- - Use `secondary` for supporting actions and neutral controls.
27
- - Use `neutral.50` to `neutral.200` for quiet surfaces and separators.
28
- - Use `danger`, `warning`, `info`, and `success` only for their matching status.
29
- - Avoid large saturated backgrounds. Keep strong colors for small highlights, badges, icons, and buttons.
30
- - Prefer theme palette references in `sx` when possible, for example `color: "neutral.700"`.
13
+ ```tsx
14
+ <Box sx={{ bgcolor: "neutral.50", color: "neutral.900" }} />
15
+ ```
31
16
 
32
- ## App Colors
17
+ ## Required App Colors
33
18
 
34
- Every provider requires `appColors.primary` and `appColors.secondary`:
19
+ Every `ThemeProvider` and `SPAThemeProvider` requires `appColors.primary` and `appColors.secondary`.
35
20
 
36
21
  ```tsx
37
22
  const appColors = {
@@ -49,3 +34,41 @@ const appColors = {
49
34
  },
50
35
  };
51
36
  ```
37
+
38
+ Use `primary` for the main action, active states, selected dates, selected tabs, and focused highlights. Use `secondary` for supporting neutral actions only when the UI needs a formal secondary brand color.
39
+
40
+ ## Core Palette Groups
41
+
42
+ | Group | Key values | Use for |
43
+ |---|---|---|
44
+ | `neutral` | `50` to `900`, `main`, `light`, `dark` | Text, surfaces, borders, disabled UI, low-emphasis controls |
45
+ | `success` | `light`, `main`, `dark` | Successful completion, positive status, confirmation feedback |
46
+ | `danger` | `light`, `main`, `dark` | Errors, destructive actions, failed validation |
47
+ | `warning` | `light`, `main`, `dark` | Caution, pending risk, warning feedback |
48
+ | `info` | `light`, `main`, `dark` | Neutral information and helper status |
49
+ | `teal` | `100` to `400`, `transparent` | Preferred Injast accent and brand-adjacent highlights |
50
+ | `blue`, `cyan`, `indigo`, `pink`, `orange`, `magenta`, `yellow`, `red` | `100` to `400`, `transparent` | Charts, badges, secondary visual differentiation |
51
+
52
+ ## Surface Rules
53
+
54
+ - Use `neutral.50` for the page canvas in mobile app shells.
55
+ - Use white or `neutral.100` for contained sections and cards.
56
+ - Use `neutral.200` and `neutral.300` for separators, field borders, and low-emphasis dividers.
57
+ - Use `neutral.700` to `neutral.900` for primary text.
58
+ - Use `neutral.500` to `neutral.600` for secondary labels, helper text, and icon-only inactive states.
59
+ - Do not use `primary.main`, `danger.main`, `warning.main`, or other saturated colors as large page backgrounds.
60
+
61
+ ## Status Rules
62
+
63
+ - Success feedback: `success.light` background, `success.main` icon/text/border.
64
+ - Error feedback: `danger.light` background, `danger.main` icon/text/border.
65
+ - Warning feedback: `warning.light` background, `warning.main` icon/text/border.
66
+ - Info feedback: `info.light` background, `info.main` icon/text/border.
67
+ - Destructive actions should be explicit and should not look like the normal primary action.
68
+
69
+ ## Hard Rules
70
+
71
+ - Do not invent new semantic names such as `brand`, `accent`, or `surface` unless a local app defines them.
72
+ - Do not hardcode colors when a `defaultColors` or theme palette value exists.
73
+ - Do not create one-note pages dominated by teal, purple, blue, or orange. Keep most UI neutral and use color as signal.
74
+ - Keep icons and text color paired with their status. Example: warning copy uses `warning.main`, not `primary.main`.
@@ -0,0 +1,72 @@
1
+ # Icons
2
+
3
+ ## Icon Package
4
+
5
+ Use `iconsax-react` for all generated app icons:
6
+
7
+ ```tsx
8
+ import { Add, Calendar, CloseCircle, SearchNormal1, TickCircle } from "iconsax-react";
9
+ ```
10
+
11
+ Do not use Lucide, Heroicons, Font Awesome, inline SVGs, emoji icons, or `@mui/icons-material` in generated screens.
12
+
13
+ Brand marks, bot avatars, uploaded media, and product illustrations can use `Image` or project image assets. Functional UI icons such as close, send, search, calendar, menu, status, back, home, and add/remove should use `iconsax-react`.
14
+
15
+ Use `SvgIcon` only for existing custom SVG mask assets that must be recolored and do not exist in Iconsax. Prefer Iconsax first for app controls.
16
+
17
+ `SvgIcon` props:
18
+
19
+ - `src`: path to the SVG mask asset.
20
+ - `color`: mask color; default is black.
21
+ - `size`: square width/height; default is 24px.
22
+
23
+ ## Sizes
24
+
25
+ | Context | Size |
26
+ |---|---:|
27
+ | Input adornment | 20px |
28
+ | Compact chip/remove icon | 18px |
29
+ | Small inline action | 20px |
30
+ | Standard button/action icon | 24px |
31
+ | Toast/status icon | 28px |
32
+ | Large FAB icon | 28px |
33
+
34
+ ## Color
35
+
36
+ - Use `defaultColors.neutral.main` or `neutral.600` for inactive utility icons.
37
+ - Use `defaultColors.neutral.dark` or `neutral.800` for high-emphasis icons.
38
+ - Use `primary.main` for selected, focused, and primary action icons.
39
+ - Use matching status colors for status icons: `success.main`, `danger.main`, `warning.main`, and `info.main`.
40
+ - Disabled icons use `neutral.300` or `neutral.400`.
41
+
42
+ ## Variants
43
+
44
+ - Use the default Iconsax variant for normal UI controls.
45
+ - Use `variant="Bold"` for status icons in `Toast`-like feedback and high-certainty states.
46
+ - Do not mix icon styles inside one toolbar or button group.
47
+
48
+ ## RTL Placement
49
+
50
+ - Put leading icons in `startIcon` for actions that visually begin with an icon.
51
+ - Put trailing icons in `endIcon` for navigation, disclosure, and calendar/date affordances.
52
+ - Use logical spacing with `gap: 2`; do not use left/right margins unless an existing component requires it.
53
+ - Icons that imply direction should match RTL flow. In RTL, forward movement normally points left and back movement points right.
54
+
55
+ ## Examples
56
+
57
+ ```tsx
58
+ import { Calendar, SearchNormal1 } from "iconsax-react";
59
+ import { TextField, defaultColors } from "injast-core";
60
+
61
+ <TextField
62
+ label="جستجو"
63
+ height={48}
64
+ startAdornment={<SearchNormal1 size={20} color={defaultColors.neutral.main} />}
65
+ />
66
+
67
+ <TextField
68
+ label="تاریخ"
69
+ height={48}
70
+ endAdornment={<Calendar size={20} color={defaultColors.neutral.dark} />}
71
+ />
72
+ ```
@@ -2,33 +2,93 @@
2
2
 
3
3
  ## Base Spacing
4
4
 
5
- The theme sets Material UI spacing to 4px increments.
5
+ The theme sets Material UI spacing to 4px increments. Use numeric `sx` values so spacing stays on this scale.
6
6
 
7
- | Value | Pixel equivalent |
8
- |---:|---:|
9
- | `1` | 4px |
10
- | `2` | 8px |
11
- | `3` | 12px |
12
- | `4` | 16px |
13
- | `6` | 24px |
14
- | `8` | 32px |
7
+ | `sx` value | Pixel equivalent | Common use |
8
+ |---:|---:|---|
9
+ | `0.5` | 2px | Hairline label/icon nudge only |
10
+ | `1` | 4px | Tiny icon or table-cell gap |
11
+ | `1.5` | 6px | Compact chip vertical padding |
12
+ | `2` | 8px | Tight internal gap, button/icon spacing |
13
+ | `3` | 12px | Field group gap, chip horizontal padding |
14
+ | `3.5` | 14px | Mobile side padding used by drawers/toasts |
15
+ | `4` | 16px | Default section padding and content gap |
16
+ | `5` | 20px | Dense page block spacing |
17
+ | `6` | 24px | Major section gap and drawer vertical rhythm |
18
+ | `8` | 32px | Large page break only |
15
19
 
16
- Use `sx` spacing props such as `p`, `px`, `py`, `m`, `gap`, `rowGap`, and `columnGap`.
20
+ Use `p`, `px`, `py`, `m`, `mx`, `my`, `gap`, `rowGap`, and `columnGap` instead of arbitrary CSS margins.
21
+
22
+ ## App Shell
23
+
24
+ Use this for generated mobile-first app screens:
25
+
26
+ ```tsx
27
+ <Box
28
+ sx={{
29
+ maxWidth: 550,
30
+ mx: "auto",
31
+ minHeight: "100dvh",
32
+ bgcolor: "neutral.50",
33
+ }}
34
+ >
35
+ {children}
36
+ </Box>
37
+ ```
38
+
39
+ Equivalent CSS:
40
+
41
+ ```css
42
+ max-width: 550px;
43
+ margin-inline: auto;
44
+ ```
45
+
46
+ Rules:
47
+
48
+ - Center the shell with `mx: "auto"` or `margin-inline: auto`.
49
+ - Keep the shell full width below 550px.
50
+ - Use `minHeight: "100dvh"` for app-like screens.
51
+ - Apply page padding inside the shell, not on `body`.
52
+ - Use wider layouts only for data-heavy desktop dashboards, large tables, or split-pane workflows.
53
+
54
+ ## Page Padding and Gaps
55
+
56
+ | Context | Recommended spacing |
57
+ |---|---|
58
+ | Mobile page side padding | `px: 4` (16px) |
59
+ | Dense page side padding | `px: 3.5` (14px) |
60
+ | Page top/bottom padding | `py: 4` to `py: 6` (16px to 24px) |
61
+ | Major sections | `gap: 4` to `gap: 6` (16px to 24px) |
62
+ | Related form fields | `gap: 3` to `gap: 4` (12px to 16px) |
63
+ | Label/helper text to field | `gap: 1` to `gap: 2` (4px to 8px) |
64
+ | Inline icon to label | `gap: 2` (8px) |
65
+ | Toolbar actions | `gap: 2` to `gap: 3` (8px to 12px) |
66
+ | Modal content blocks | `gap: 4` (16px) |
67
+ | Drawer content | `px: 3.5`, `py: 6` (14px, 24px) |
17
68
 
18
69
  ## Component Sizing
19
70
 
20
- - Default form controls and medium buttons are 48px tall.
21
- - Large buttons are 56px tall.
22
- - Small buttons and dense controls are 40px tall.
23
- - Extra small buttons are 32px tall.
24
- - Standard field radius is 8px.
25
- - Button radius is 8px or 12px depending on size.
26
- - Modal paper radius is 12px.
27
-
28
- ## Layout Rules
29
-
30
- - Use `Box`, `Container`, and `Grid` for spacing and layout.
31
- - Use 16px to 24px gaps between major sections.
32
- - Use 8px to 12px gaps inside compact controls and field groups.
33
- - Keep repeated cards and table rows stable in height.
34
- - Avoid nested cards unless the inner card is a true repeated item or modal content.
71
+ | Component or pattern | Size |
72
+ |---|---:|
73
+ | Default text fields | 48px height |
74
+ | `Button` `L` | 56px height, 12px radius |
75
+ | `Button` `M` | 48px height, 12px radius |
76
+ | `Button` `S` | 40px height, 8px radius |
77
+ | `Button` `XS` | 32px height, 8px radius |
78
+ | Small IconButton target | 32px minimum |
79
+ | Standard icon action target | 40px to 48px |
80
+ | OTP input cell | 54px by 54px |
81
+ | Checkbox icon | 24px by default |
82
+ | Toggle small | 48px by 26px |
83
+ | Toggle medium | 59px by 32px |
84
+ | Progress bar default | 20px height |
85
+ | Modal paper radius | 12px |
86
+ | Text field radius | 8px |
87
+
88
+ ## Density Rules
89
+
90
+ - Keep default forms at 48px control height.
91
+ - Use 40px controls only in dense toolbars, tables, or secondary rows.
92
+ - Use 32px controls only for compact inline actions or modal footer secondary actions.
93
+ - Keep repeated rows stable in height; do not let hover states or labels shift layout.
94
+ - Avoid nested cards. Use spacing, headings, and dividers before adding another framed surface.
@@ -2,32 +2,55 @@
2
2
 
3
3
  ## Fonts
4
4
 
5
- Load `injast-core/fonts.css` once. The theme uses:
5
+ Load `injast-core/fonts.css` once. The package includes Persian-friendly fonts:
6
6
 
7
- - `IRANYekanX` for standard Persian UI text
8
- - `IRANYekanXFaNum` where Persian numerals are preferred
7
+ - `IRANYekanX` for standard Persian UI text.
8
+ - `IRANYekanXFaNum` where Persian numerals are preferred.
9
9
 
10
- ## Scale
10
+ `SPAThemeProvider` uses `IRANYekanXFaNum` by default. `ThemeProvider` uses `IRANYekanX` by default. Do not replace the font family in generated screens unless the user explicitly asks.
11
11
 
12
- Use the theme typography scale through components. Important roles:
12
+ ## Theme Scale
13
13
 
14
- | Role | Size | Weight | Use for |
14
+ Use `Typography` from `injast-core` and theme typography variants.
15
+
16
+ | Variant | Size | Weight | Use for |
15
17
  |---|---:|---:|---|
16
- | `display1` | 32px | 700 | Rare page-level display headings |
17
- | `display2` | 24px | 700 | Page headings |
18
- | `display3` | 20px | 700 | Section headings |
18
+ | `display1` | 32px | 700 | Rare top-level display heading |
19
+ | `display2` | 24px | 700 | Main page heading in roomy screens |
20
+ | `display3` | 20px | 700 | Section title or modal title |
19
21
  | `h1` | 18px | 500 | Dense page title |
20
- | `h2` | 16px | 500 | Panel heading |
21
- | `h3` | 14px | 500 | Small heading |
22
+ | `h2` | 16px | 500 | Panel, drawer, and modal heading |
23
+ | `h3` | 14px | 500 | Small section heading |
24
+ | `title1` | 16px | 500 | Card title or list group title |
25
+ | `title2` | 14px | 500 | Compact card/list title |
26
+ | `title3` | 12px | 500 | Small title or table metadata |
27
+ | `title4` | 10px | 500 | Very compact label title |
28
+ | `input1` | 16px | 500 | Large input text |
29
+ | `input2` | 14px | 500 | Default input text |
30
+ | `input3` | 12px | 500 | Compact input text |
31
+ | `button1` | 16px | 700 | Large and medium button text |
32
+ | `button2` | 14px | 700 | Small button text |
33
+ | `button3` | 12px | 700 | Extra small button text |
22
34
  | `body1` | 14px | 500 | Default body text |
23
- | `body2` | 12px | 500 | Secondary text |
24
- | `label1` | 12px | 400 | Captions and field metadata |
35
+ | `body2` | 12px | 500 | Secondary body text and metadata |
36
+ | `label1` | 12px | 400 | Captions, helper text, field metadata |
25
37
  | `label2` | 10px | 400 | Compact labels only |
26
38
 
27
- ## Rules
39
+ ## Usage Rules
28
40
 
29
- - Use `Typography` from `injast-core` for text hierarchy.
30
- - Do not use oversized hero text inside app screens.
31
- - Use concise labels in buttons and form controls.
32
- - Keep numeric content readable; use Persian number formatting utilities when appropriate.
41
+ - Use `display1`, `display2`, and `display3` sparingly. App screens should not look like landing pages.
42
+ - Use `h1` or `display3` for most mobile page titles.
43
+ - Use `h2` for drawer and modal titles.
44
+ - Use `body1` for readable content and form helper paragraphs.
45
+ - Use `body2`, `label1`, and `label2` only for secondary metadata.
46
+ - Use concise Persian labels for buttons and fields. Avoid long button text that wraps.
47
+ - Keep numeric content readable and use Persian number utilities when values are shown to users.
33
48
  - Do not set negative letter spacing.
49
+ - Do not scale font size with viewport width.
50
+ - Do not place hero-scale text inside cards, tables, drawers, or modals.
51
+
52
+ ## Alignment
53
+
54
+ - Persian and RTL text should be right-aligned by default.
55
+ - Numeric codes, OTP digits, card numbers, and Latin-only values can use `dir="ltr"` and centered or left alignment when needed.
56
+ - Keep table headers and body cells right-aligned unless the column is numeric, currency, or an action column.