@soroush.tech/design-system 2.0.0-alpha.0 → 2.0.0-alpha.2
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.
- package/README.md +37 -34
- package/dist/AppBar.cjs +0 -4
- package/dist/AppBar.d.cts +3 -3
- package/dist/AppBar.d.mts +3 -3
- package/dist/AppBar.mjs +0 -4
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.d.cts +3 -3
- package/dist/Avatar.d.mts +3 -3
- package/dist/Avatar.mjs +1 -1
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Card.cjs +2 -2
- package/dist/Card.d.cts +3 -3
- package/dist/Card.d.mts +3 -3
- package/dist/Card.mjs +2 -2
- package/dist/Checkbox.d.cts +2 -2
- package/dist/Checkbox.d.mts +2 -2
- package/dist/CircularProgress.d.cts +3 -3
- package/dist/CircularProgress.d.mts +3 -3
- package/dist/Drawer.cjs +109 -17
- package/dist/Drawer.d.cts +43 -7
- package/dist/Drawer.d.mts +43 -7
- package/dist/Drawer.mjs +109 -18
- package/dist/Flex.cjs +6 -2
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Flex.mjs +6 -2
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/FormControl.cjs +1 -1
- package/dist/FormControl.d.cts +2 -2
- package/dist/FormControl.d.mts +2 -2
- package/dist/FormControl.mjs +1 -1
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.d.cts +1 -1
- package/dist/FormLabel.d.mts +1 -1
- package/dist/Grid.cjs +7 -2
- package/dist/Grid.d.cts +20 -1
- package/dist/Grid.d.mts +20 -1
- package/dist/Grid.mjs +7 -2
- package/dist/{Icon-CkQGOBmm.mjs → Icon-BGcd6yy0.mjs} +1 -1
- package/dist/{Icon-CKLBJ7CC.cjs → Icon-Cn6Zx8wb.cjs} +1 -1
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.mts +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.d.cts +2 -2
- package/dist/Image.d.mts +2 -2
- package/dist/LinearProgress.d.cts +3 -3
- package/dist/LinearProgress.d.mts +3 -3
- package/dist/Link.cjs +1 -1
- package/dist/Link.d.cts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/MenuItem.cjs +2 -2
- package/dist/MenuItem.d.cts +2 -2
- package/dist/MenuItem.d.mts +2 -2
- package/dist/MenuItem.mjs +2 -2
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NativeSelect.cjs +2 -2
- package/dist/NativeSelect.d.cts +3 -3
- package/dist/NativeSelect.d.mts +3 -3
- package/dist/NativeSelect.mjs +2 -2
- package/dist/Pagination/PaginationItem.cjs +1 -1
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +1 -1
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +1 -1
- package/dist/Paper.d.cts +1 -1
- package/dist/Paper.d.mts +1 -1
- package/dist/Paper.mjs +1 -1
- package/dist/{Popover-Dz6h3A_9.cjs → Popover-CrSABgRk.cjs} +2 -2
- package/dist/{Popover-DWOrf7sy.mjs → Popover-DlpXdcwt.mjs} +2 -2
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +4 -4
- package/dist/Popover.d.mts +4 -4
- package/dist/Popover.mjs +1 -1
- package/dist/Pressable.cjs +1 -1
- package/dist/Pressable.d.cts +1 -1
- package/dist/Pressable.d.mts +1 -1
- package/dist/Pressable.mjs +1 -1
- package/dist/Quote.d.cts +4 -4
- package/dist/Quote.d.mts +4 -4
- package/dist/Radio.d.cts +2 -2
- package/dist/Radio.d.mts +2 -2
- package/dist/Select.cjs +3 -3
- package/dist/Select.d.cts +3 -3
- package/dist/Select.d.mts +3 -3
- package/dist/Select.mjs +3 -3
- package/dist/Sidebar/Sidebar.cjs +6 -25
- package/dist/Sidebar/Sidebar.d.cts +2 -5
- package/dist/Sidebar/Sidebar.d.mts +2 -5
- package/dist/Sidebar/Sidebar.mjs +7 -26
- package/dist/Sidebar/SidebarItem.cjs +1 -2
- package/dist/Sidebar/SidebarItem.d.cts +4 -4
- package/dist/Sidebar/SidebarItem.d.mts +4 -4
- package/dist/Sidebar/SidebarItem.mjs +1 -2
- package/dist/Skeleton.d.cts +2 -2
- package/dist/Skeleton.d.mts +2 -2
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.d.cts +2 -2
- package/dist/Switch.d.mts +2 -2
- package/dist/Switch.mjs +1 -1
- package/dist/Table/Table.d.cts +3 -3
- package/dist/Table/Table.d.mts +3 -3
- package/dist/Table/TableBody.d.cts +2 -2
- package/dist/Table/TableBody.d.mts +2 -2
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +4 -4
- package/dist/Table/TableContainer.d.mts +4 -4
- package/dist/Table/TableControl.d.cts +1 -1
- package/dist/Table/TableControl.d.mts +1 -1
- package/dist/Table/TableFooter.d.cts +2 -2
- package/dist/Table/TableFooter.d.mts +2 -2
- package/dist/Table/TableHead.d.cts +2 -2
- package/dist/Table/TableHead.d.mts +2 -2
- package/dist/Table/TablePagination.d.cts +2 -2
- package/dist/Table/TablePagination.d.mts +2 -2
- package/dist/Table/TablePaginationActions.cjs +1 -1
- package/dist/Table/TablePaginationActions.d.cts +1 -1
- package/dist/Table/TablePaginationActions.d.mts +1 -1
- package/dist/Table/TablePaginationActions.mjs +1 -1
- package/dist/Table/TableRow.d.cts +2 -2
- package/dist/Table/TableRow.d.mts +2 -2
- package/dist/Table/TableSortLabel.cjs +1 -1
- package/dist/Table/TableSortLabel.d.cts +1 -1
- package/dist/Table/TableSortLabel.d.mts +1 -1
- package/dist/Table/TableSortLabel.mjs +1 -1
- package/dist/Table/hooks.d.cts +1 -1
- package/dist/Table/hooks.d.mts +1 -1
- package/dist/Table.d.cts +5 -5
- package/dist/Table.d.mts +5 -5
- package/dist/{TableContext-DRAhXvq3.d.cts → TableContext-BowhBZkZ.d.cts} +1 -1
- package/dist/{TableContext-DBOk01Xl.d.mts → TableContext-GmYLRYpc.d.mts} +1 -1
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.d.cts +2 -2
- package/dist/TextInput.d.mts +2 -2
- package/dist/TextInput.mjs +1 -1
- package/dist/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
- package/dist/Typography.cjs +1 -1
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/Typography.mjs +1 -1
- package/dist/View.cjs +2 -1
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/View.mjs +2 -1
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.mts +1 -1
- package/dist/{index-D4i9vrQM.d.mts → index-B2eLreA5.d.cts} +3 -3
- package/dist/{index-DPHwCZYf.d.cts → index-BBV7_p-W.d.mts} +2 -2
- package/dist/{index-CoHrw2p7.d.mts → index-BHyJ6P_D.d.mts} +1 -1
- package/dist/{index-BDD-L8uL.d.cts → index-BO-vkjtm.d.cts} +1 -1
- package/dist/{index-BNpkmtaM.d.mts → index-BT-mcuE6.d.mts} +3 -3
- package/dist/{index-qtKJ56yu.d.mts → index-BW4rc8cK.d.cts} +2 -2
- package/dist/{index-B8KscJic.d.cts → index-BbngAEDY.d.mts} +2 -2
- package/dist/{index-BSR9zrAA.d.mts → index-Bqk30r0W.d.mts} +3 -3
- package/dist/{index-DkJzi96w.d.cts → index-BsUsSWXP.d.cts} +1 -1
- package/dist/{index-EYR0z1Qv.d.cts → index-C-kvrbCi.d.cts} +2 -2
- package/dist/{index-CvWslVk6.d.cts → index-C0-SB0dL.d.mts} +4 -4
- package/dist/{index-DsKd9VW5.d.mts → index-C58AZZQ2.d.cts} +4 -4
- package/dist/{index-IEvuh6Cd.d.mts → index-C7bEBYuv.d.mts} +3 -3
- package/dist/{index-CohgpyUj.d.cts → index-CGCO5eo7.d.mts} +4 -4
- package/dist/{index-CzmA09Yf.d.mts → index-CMKzrxOO.d.mts} +2 -2
- package/dist/{index-DNNg9RoR.d.cts → index-CNzkJGNq.d.cts} +3 -3
- package/dist/{index-CtrxW81j.d.cts → index-CPNzQhUu.d.cts} +2 -2
- package/dist/{index-8mHoIUt5.d.mts → index-CmscFo1L.d.mts} +2 -2
- package/dist/{index-r2avCy1z.d.mts → index-CxDY_w-H.d.cts} +2 -2
- package/dist/{index-CCrocxBL.d.cts → index-D0XX9v0b.d.cts} +3 -3
- package/dist/{index-CVb5zbas.d.mts → index-D2yMhmE_.d.mts} +3 -3
- package/dist/{index-bN91IhZi.d.cts → index-D5Rj4uWe.d.cts} +2 -2
- package/dist/{index-DuefjNlC.d.mts → index-DJ8NTYR8.d.mts} +2 -2
- package/dist/{index-B6vxRNLt.d.cts → index-DTeurv8z.d.cts} +3 -3
- package/dist/{index-S3NZS-Qp.d.cts → index-DYtIEMr9.d.mts} +3 -3
- package/dist/{index-CEqa8xx8.d.mts → index-Dkqk_6g2.d.mts} +1 -1
- package/dist/index-EuWfYhf8.d.mts +21 -0
- package/dist/{index-BGD4OzzG.d.cts → index-H30eNjJf.d.cts} +3 -3
- package/dist/{index-tv-TGYSG.d.mts → index-JSOR69Iy.d.cts} +4 -4
- package/dist/{index-CLttbRhG.d.cts → index-VwsWkazt.d.cts} +2 -2
- package/dist/{index-Cjlax0-f.d.mts → index-di-L2lJ9.d.mts} +2 -2
- package/dist/index-ue1Ccvln.d.cts +21 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/style.cjs +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.mts +2 -2
- package/dist/style.mjs +1 -1
- package/dist/{theme-BQGlZoma.mjs → theme-C1o9qa2E.mjs} +75 -27
- package/dist/{theme-BmEAXmwh.cjs → theme-DfAqr7qo.cjs} +116 -26
- package/dist/theme.cjs +8 -1
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.mjs +2 -2
- package/dist/{themes-9YNnlVyY.d.mts → themes-C3RTORGO.d.mts} +63 -21
- package/dist/{themes-9YNnlVyY.d.cts → themes-Dswy4M6B.d.cts} +63 -21
- package/dist/{useTablePagination-RelVsdMR.d.mts → useTablePagination-BueH0_dG.d.cts} +1 -1
- package/dist/{useTablePagination-CLoac5oX.d.cts → useTablePagination-CxBh-gU8.d.mts} +1 -1
- package/package.json +2 -12
- package/dist/PageLayout/LayoutGrid.cjs +0 -21
- package/dist/PageLayout/LayoutGrid.d.cts +0 -22
- package/dist/PageLayout/LayoutGrid.d.mts +0 -22
- package/dist/PageLayout/LayoutGrid.mjs +0 -20
- package/dist/PageLayout/PageLayout.cjs +0 -148
- package/dist/PageLayout/PageLayout.d.cts +0 -31
- package/dist/PageLayout/PageLayout.d.mts +0 -31
- package/dist/PageLayout/PageLayout.mjs +0 -147
- package/dist/PageLayout.cjs +0 -7
- package/dist/PageLayout.d.cts +0 -19
- package/dist/PageLayout.d.mts +0 -19
- package/dist/PageLayout.mjs +0 -4
- package/dist/PageLayoutContext-DjJ1_7Xc.mjs +0 -5
- package/dist/PageLayoutContext-agXGhegE.cjs +0 -9
- package/dist/index-B41OXLX8.d.mts +0 -16
- package/dist/index-BJ5Tsf7u.d.cts +0 -16
- package/dist/index-BMJ3tyIw.d.cts +0 -16
- package/dist/index-BnFxdnEL.d.mts +0 -16
- package/dist/layoutStyles-B4Z1K6HZ.cjs +0 -67
- package/dist/layoutStyles-f0ISNjsC.mjs +0 -56
- package/dist/{Modal-CYNcPk-2.mjs → Modal-BcsyrrpH.mjs} +1 -1
- package/dist/{Modal-CApyh_V5.cjs → Modal-CM3osOqj.cjs} +1 -1
package/README.md
CHANGED
|
@@ -89,17 +89,16 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
89
89
|
|
|
90
90
|
### Layout & surfaces
|
|
91
91
|
|
|
92
|
-
| Component
|
|
93
|
-
|
|
|
94
|
-
| `View`
|
|
95
|
-
| `Flex`
|
|
96
|
-
| `Grid`
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `Drawer` | Slide-in side panel |
|
|
92
|
+
| Component | Purpose |
|
|
93
|
+
| --------- | ------------------------------------------------- |
|
|
94
|
+
| `View` | Styled `div` primitive - the base building block |
|
|
95
|
+
| `Flex` | `View` with flexbox defaults |
|
|
96
|
+
| `Grid` | CSS grid container |
|
|
97
|
+
| `Paper` | Elevated surface with background and shadow |
|
|
98
|
+
| `Card` | Content container built on `Paper` |
|
|
99
|
+
| `Quote` | Bordered quote / terminal-panel surface on `View` |
|
|
100
|
+
| `AppBar` | Top application bar |
|
|
101
|
+
| `Drawer` | Slide-in side panel |
|
|
103
102
|
|
|
104
103
|
### Content & data display
|
|
105
104
|
|
|
@@ -114,16 +113,16 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
114
113
|
|
|
115
114
|
### Inputs & forms
|
|
116
115
|
|
|
117
|
-
| Component | Purpose
|
|
118
|
-
| ---------------------------------------------------- |
|
|
119
|
-
| `Button`, `ButtonGroup`, `ToggleButton` | Actions and toggles
|
|
120
|
-
| `TextInput` | Text field
|
|
121
|
-
| `Checkbox`, `Radio`, `Switch` | Selection controls
|
|
122
|
-
| `NativeSelect` |
|
|
123
|
-
| `Select` |
|
|
124
|
-
| `MenuItem` | Option row for `Select`'s listbox
|
|
125
|
-
| `Form`, `FormControl`, `FormLabel`, `FormHelperText` | Form composition and labeling
|
|
126
|
-
| `Pagination` | Page navigation control
|
|
116
|
+
| Component | Purpose |
|
|
117
|
+
| ---------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
118
|
+
| `Button`, `ButtonGroup`, `ToggleButton` | Actions and toggles |
|
|
119
|
+
| `TextInput` | Text field |
|
|
120
|
+
| `Checkbox`, `Radio`, `Switch` | Selection controls |
|
|
121
|
+
| `NativeSelect` | Low-level platform `<select>` - not recommended; use `Select native` |
|
|
122
|
+
| `Select` | The select to use - custom listbox, or `native` for the platform picker |
|
|
123
|
+
| `MenuItem` | Option row for `Select`'s listbox |
|
|
124
|
+
| `Form`, `FormControl`, `FormLabel`, `FormHelperText` | Form composition and labeling |
|
|
125
|
+
| `Pagination` | Page navigation control |
|
|
127
126
|
|
|
128
127
|
### Feedback
|
|
129
128
|
|
|
@@ -149,14 +148,14 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
149
148
|
|
|
150
149
|
Components never hardcode colors or sizes - props resolve against scales on the `Theme` object:
|
|
151
150
|
|
|
152
|
-
| Group | Scales
|
|
153
|
-
| ------------------ |
|
|
154
|
-
| Color | `palette` (main/light/dark/contrastText per color) · `text` · `background` · `border` · `colorScheme`
|
|
155
|
-
| Typography | `typography` (variant map) · `fonts` · `fontSizes` · `fontWeights` · `lineHeights` · `letterSpacings`
|
|
156
|
-
| Space & shape | `space` · `sizes` · `radii` · `borderWidths` · `shadows`
|
|
157
|
-
| Layout | `breakpoints` (
|
|
158
|
-
| Component scales | `avatar` (size steps) · `skeleton` (wave highlight)
|
|
159
|
-
| Layering & effects | `zOrder` (appBar/drawer/modal) · `blur` · `logoFilter` · `portraitBlend` · `portraitOpacity`
|
|
151
|
+
| Group | Scales |
|
|
152
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------ |
|
|
153
|
+
| Color | `palette` (main/light/dark/contrastText per color) · `text` · `background` · `border` · `colorScheme` |
|
|
154
|
+
| Typography | `typography` (variant map) · `fonts` · `fontSizes` · `fontWeights` · `lineHeights` · `letterSpacings` |
|
|
155
|
+
| Space & shape | `space` · `sizes` · `radii` · `borderWidths` · `shadows` |
|
|
156
|
+
| Layout | `breakpoints` (xs/sm/md/lg/xl window classes) · `layout` (columns, margins, panels, top bar per class) |
|
|
157
|
+
| Component scales | `avatar` (size steps) · `skeleton` (wave highlight) |
|
|
158
|
+
| Layering & effects | `zOrder` (appBar/drawer/modal) · `blur` · `logoFilter` · `portraitBlend` · `portraitOpacity` |
|
|
160
159
|
|
|
161
160
|
Prop types are derived from the interface (`keyof Theme['text']`), so adding a token to `themes.ts` propagates everywhere automatically. See [`design-system.md`](./design-system.md) for the full scale table and the palette rules.
|
|
162
161
|
|
|
@@ -190,11 +189,15 @@ const [isDark, setIsDark] = useState(true)
|
|
|
190
189
|
|
|
191
190
|
### Breakpoints and layout
|
|
192
191
|
|
|
193
|
-
`theme.breakpoints`
|
|
194
|
-
`
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
`theme.breakpoints` are Material 3's window classes, each a range from its start until the next:
|
|
193
|
+
`xs` 0-599px (compact, the base), `sm` 600-839 (medium), `md` 840-1199 (expanded), `lg`
|
|
194
|
+
1200-1599 (large), `xl` 1600+ (extra-large). Responsive props use them by name or position -
|
|
195
|
+
`p={{ xs: 2, md: 4 }}`, `p={[2, 3, 4]}` - and `cqSm`-style keys write container queries;
|
|
196
|
+
`theme.breakpoints.up('md')` and its siblings write queries for hand-written styles. Everything is
|
|
197
|
+
CSS, so pages work with JavaScript off. `theme.layout` holds the layout tokens per class (columns,
|
|
198
|
+
margins, gutters, side panels, top bar); `Grid` and `Flex` apply the column grid with
|
|
199
|
+
`layout` / `layout={{ lg: { columns: 16 } }}`, and apps place `AppBar`, `Sidebar` and `Drawer`
|
|
200
|
+
themselves. The full guide is the
|
|
198
201
|
[Breakpoints and layout](./docs/theming.md#breakpoints-and-layout) section of the theming guide.
|
|
199
202
|
|
|
200
203
|
### Component defaults
|
package/dist/AppBar.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
3
|
const require_Flex = require("./Flex.cjs");
|
|
4
|
-
const require_PageLayoutContext = require("./PageLayoutContext-agXGhegE.cjs");
|
|
5
4
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
6
|
-
let react = require("react");
|
|
7
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
6
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
9
7
|
//#region src/AppBar/AppBar.tsx
|
|
@@ -62,12 +60,10 @@ const AppBarBase = require_src.styled(require_Flex.Flex, {
|
|
|
62
60
|
width: "100%"
|
|
63
61
|
}, elevationVariant, sizeVariants);
|
|
64
62
|
function AppBar({ elevation = 4, size, ...rest }) {
|
|
65
|
-
const isInBar = (0, react.useContext)(require_PageLayoutContext.PageLayoutContext)?.region === "bar";
|
|
66
63
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppBarBase, {
|
|
67
64
|
as: "header",
|
|
68
65
|
elevation,
|
|
69
66
|
size,
|
|
70
|
-
...isInBar && { height: "100%" },
|
|
71
67
|
...rest
|
|
72
68
|
});
|
|
73
69
|
}
|
package/dist/AppBar.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as FlexProps } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-Dswy4M6B.cjs";
|
|
2
|
+
import "./index-BsUsSWXP.cjs";
|
|
3
|
+
import { n as FlexProps } from "./index-ue1Ccvln.cjs";
|
|
4
4
|
//#region src/AppBar/AppBar.d.ts
|
|
5
5
|
/** Valid values for the color prop - derived from theme.background keys. */
|
|
6
6
|
type AppBarColor = keyof Theme['background'];
|
package/dist/AppBar.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as FlexProps } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-C3RTORGO.mjs";
|
|
2
|
+
import "./index-Dkqk_6g2.mjs";
|
|
3
|
+
import { n as FlexProps } from "./index-EuWfYhf8.mjs";
|
|
4
4
|
//#region src/AppBar/AppBar.d.ts
|
|
5
5
|
/** Valid values for the color prop - derived from theme.background keys. */
|
|
6
6
|
type AppBarColor = keyof Theme['background'];
|
package/dist/AppBar.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
|
|
2
2
|
import { Flex } from "./Flex.mjs";
|
|
3
|
-
import { t as PageLayoutContext } from "./PageLayoutContext-DjJ1_7Xc.mjs";
|
|
4
3
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
5
|
-
import { useContext } from "react";
|
|
6
4
|
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
//#region src/AppBar/AppBar.tsx
|
|
8
6
|
const shouldForwardProp = createShouldForwardProp([
|
|
@@ -60,12 +58,10 @@ const AppBarBase = styled(Flex, {
|
|
|
60
58
|
width: "100%"
|
|
61
59
|
}, elevationVariant, sizeVariants);
|
|
62
60
|
function AppBar({ elevation = 4, size, ...rest }) {
|
|
63
|
-
const isInBar = useContext(PageLayoutContext)?.region === "bar";
|
|
64
61
|
return /* @__PURE__ */ jsx(AppBarBase, {
|
|
65
62
|
as: "header",
|
|
66
63
|
elevation,
|
|
67
64
|
size,
|
|
68
|
-
...isInBar && { height: "100%" },
|
|
69
65
|
...rest
|
|
70
66
|
});
|
|
71
67
|
}
|
package/dist/Avatar.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
3
|
const require_Flex = require("./Flex.cjs");
|
|
4
4
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
5
|
-
const require_theme = require("./theme-
|
|
5
|
+
const require_theme = require("./theme-DfAqr7qo.cjs");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
package/dist/Avatar.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as FlexProps } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-Dswy4M6B.cjs";
|
|
2
|
+
import "./index-BsUsSWXP.cjs";
|
|
3
|
+
import { n as FlexProps } from "./index-ue1Ccvln.cjs";
|
|
4
4
|
//#region src/Avatar/Avatar.d.ts
|
|
5
5
|
type AvatarVariant = 'circular' | 'rounded' | 'square';
|
|
6
6
|
type AvatarSize = keyof Theme['avatar'];
|
package/dist/Avatar.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as FlexProps } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-C3RTORGO.mjs";
|
|
2
|
+
import "./index-Dkqk_6g2.mjs";
|
|
3
|
+
import { n as FlexProps } from "./index-EuWfYhf8.mjs";
|
|
4
4
|
//#region src/Avatar/Avatar.d.ts
|
|
5
5
|
type AvatarVariant = 'circular' | 'rounded' | 'square';
|
|
6
6
|
type AvatarSize = keyof Theme['avatar'];
|
package/dist/Avatar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
|
|
2
2
|
import { Flex } from "./Flex.mjs";
|
|
3
3
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
4
|
-
import { r as useTheme } from "./theme-
|
|
4
|
+
import { r as useTheme } from "./theme-C1o9qa2E.mjs";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/Avatar/Avatar.tsx
|
package/dist/Backdrop.d.cts
CHANGED
package/dist/Backdrop.d.mts
CHANGED
package/dist/Button.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
3
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
4
|
const require_utils = require("./utils.cjs");
|
|
5
|
-
const require_theme = require("./theme-
|
|
5
|
+
const require_theme = require("./theme-DfAqr7qo.cjs");
|
|
6
6
|
const require_CircularProgress = require("./CircularProgress.cjs");
|
|
7
7
|
const require_ButtonGroupContext = require("./ButtonGroupContext-NtkVeDVE.cjs");
|
|
8
8
|
let react = require("react");
|
package/dist/Button.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ButtonShape, c as GapToken, i as ButtonProps, n as ButtonColor, o as ButtonSize, r as ButtonLoadingPosition, s as ButtonVariant, t as Button } from "./index-
|
|
1
|
+
import { a as ButtonShape, c as GapToken, i as ButtonProps, n as ButtonColor, o as ButtonSize, r as ButtonLoadingPosition, s as ButtonVariant, t as Button } from "./index-B2eLreA5.cjs";
|
|
2
2
|
export { Button, ButtonColor, ButtonLoadingPosition, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, GapToken };
|
package/dist/Button.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ButtonShape, c as GapToken, i as ButtonProps, n as ButtonColor, o as ButtonSize, r as ButtonLoadingPosition, s as ButtonVariant, t as Button } from "./index-
|
|
1
|
+
import { a as ButtonShape, c as GapToken, i as ButtonProps, n as ButtonColor, o as ButtonSize, r as ButtonLoadingPosition, s as ButtonVariant, t as Button } from "./index-DYtIEMr9.mjs";
|
|
2
2
|
export { Button, ButtonColor, ButtonLoadingPosition, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, GapToken };
|
package/dist/Button.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
|
|
2
2
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
3
|
import { alpha } from "./utils.mjs";
|
|
4
|
-
import { n as useDefaultProps, r as useTheme } from "./theme-
|
|
4
|
+
import { n as useDefaultProps, r as useTheme } from "./theme-C1o9qa2E.mjs";
|
|
5
5
|
import { CircularProgress } from "./CircularProgress.mjs";
|
|
6
6
|
import { t as ButtonGroupContext } from "./ButtonGroupContext-DS-kl9lG.mjs";
|
|
7
7
|
import { useContext } from "react";
|
package/dist/ButtonGroup.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ButtonGroupProps, i as ButtonGroupOrientation, n as ButtonGroupContextValue, o as ButtonGroupRadius, r as ButtonGroup, t as ButtonGroupContext } from "./index-
|
|
1
|
+
import { a as ButtonGroupProps, i as ButtonGroupOrientation, n as ButtonGroupContextValue, o as ButtonGroupRadius, r as ButtonGroup, t as ButtonGroupContext } from "./index-D0XX9v0b.cjs";
|
|
2
2
|
export { ButtonGroup, ButtonGroupContext, ButtonGroupContextValue, ButtonGroupOrientation, ButtonGroupProps, ButtonGroupRadius };
|
package/dist/ButtonGroup.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ButtonGroupProps, i as ButtonGroupOrientation, n as ButtonGroupContextValue, o as ButtonGroupRadius, r as ButtonGroup, t as ButtonGroupContext } from "./index-
|
|
1
|
+
import { a as ButtonGroupProps, i as ButtonGroupOrientation, n as ButtonGroupContextValue, o as ButtonGroupRadius, r as ButtonGroup, t as ButtonGroupContext } from "./index-BT-mcuE6.mjs";
|
|
2
2
|
export { ButtonGroup, ButtonGroupContext, ButtonGroupContextValue, ButtonGroupOrientation, ButtonGroupProps, ButtonGroupRadius };
|
package/dist/Card.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
3
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
|
-
const require_theme = require("./theme-
|
|
4
|
+
const require_theme = require("./theme-DfAqr7qo.cjs");
|
|
5
5
|
const require_Paper = require("./Paper.cjs");
|
|
6
6
|
const require_Typography = require("./Typography.cjs");
|
|
7
|
-
const require_Icon = require("./Icon-
|
|
7
|
+
const require_Icon = require("./Icon-Cn6Zx8wb.cjs");
|
|
8
8
|
require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
//#region src/Card/Card.tsx
|
package/dist/Card.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as PaperProps } from "./index-
|
|
2
|
-
import { a as TypographyProps } from "./index-
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { r as PaperProps } from "./index-H30eNjJf.cjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-D5Rj4uWe.cjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-CxDY_w-H.cjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
//#region src/Card/Card.d.ts
|
|
6
6
|
type CardVariant = 'paper' | 'bracketBox' | 'interactive';
|
package/dist/Card.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as PaperProps } from "./index-
|
|
2
|
-
import { a as TypographyProps } from "./index-
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { r as PaperProps } from "./index-Bqk30r0W.mjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-DJ8NTYR8.mjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-BBV7_p-W.mjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
//#region src/Card/Card.d.ts
|
|
6
6
|
type CardVariant = 'paper' | 'bracketBox' | 'interactive';
|
package/dist/Card.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as styled } from "./src-DLGYOJMh.mjs";
|
|
2
2
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
|
-
import { n as useDefaultProps, r as useTheme } from "./theme-
|
|
3
|
+
import { n as useDefaultProps, r as useTheme } from "./theme-C1o9qa2E.mjs";
|
|
4
4
|
import { Paper } from "./Paper.mjs";
|
|
5
5
|
import { Typography } from "./Typography.mjs";
|
|
6
|
-
import { t as Icon } from "./Icon-
|
|
6
|
+
import { t as Icon } from "./Icon-BGcd6yy0.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/Card/Card.tsx
|
package/dist/Checkbox.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
1
|
+
import { T as Theme, x as PaletteColor } from "./themes-Dswy4M6B.cjs";
|
|
2
|
+
import "./index-BsUsSWXP.cjs";
|
|
3
3
|
import { ChangeEvent, ReactNode } from "react";
|
|
4
4
|
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
5
5
|
//#region src/Checkbox/Checkbox.d.ts
|
package/dist/Checkbox.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
1
|
+
import { T as Theme, x as PaletteColor } from "./themes-C3RTORGO.mjs";
|
|
2
|
+
import "./index-Dkqk_6g2.mjs";
|
|
3
3
|
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
4
4
|
import { ChangeEvent, ReactNode } from "react";
|
|
5
5
|
//#region src/Checkbox/Checkbox.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as ButtonColor } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-Dswy4M6B.cjs";
|
|
2
|
+
import "./index-BsUsSWXP.cjs";
|
|
3
|
+
import { n as ButtonColor } from "./index-B2eLreA5.cjs";
|
|
4
4
|
import { HTMLAttributes } from "react";
|
|
5
5
|
import { LayoutProps, PaddingProps, SpaceProps } from "@soroush.tech/styled-system";
|
|
6
6
|
//#region src/CircularProgress/CircularProgress.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as ButtonColor } from "./index-
|
|
1
|
+
import { T as Theme } from "./themes-C3RTORGO.mjs";
|
|
2
|
+
import "./index-Dkqk_6g2.mjs";
|
|
3
|
+
import { n as ButtonColor } from "./index-DYtIEMr9.mjs";
|
|
4
4
|
import { LayoutProps, PaddingProps, SpaceProps } from "@soroush.tech/styled-system";
|
|
5
5
|
import { HTMLAttributes } from "react";
|
|
6
6
|
//#region src/CircularProgress/CircularProgress.d.ts
|
package/dist/Drawer.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
|
+
const require_Button = require("./Button.cjs");
|
|
3
4
|
const require_Paper = require("./Paper.cjs");
|
|
4
|
-
const
|
|
5
|
-
require("react");
|
|
5
|
+
const require_FocusTrap = require("./FocusTrap.cjs");
|
|
6
|
+
let react = require("react");
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
let _emotion_react = require("@emotion/react");
|
|
8
9
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
@@ -39,32 +40,123 @@ const anchorPosition = {
|
|
|
39
40
|
width: "100%"
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
|
|
43
|
-
|
|
43
|
+
const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
|
|
44
|
+
"anchor",
|
|
45
|
+
"duration",
|
|
46
|
+
"hasBackdrop"
|
|
47
|
+
]);
|
|
48
|
+
const DrawerPanel = require_src.styled("div", {
|
|
44
49
|
name: "Drawer",
|
|
45
50
|
label: "Drawer",
|
|
46
51
|
shouldForwardProp
|
|
47
|
-
})(({ anchor, duration }) => ({
|
|
52
|
+
})(({ theme, anchor, duration, hasBackdrop }) => ({
|
|
48
53
|
position: "fixed",
|
|
54
|
+
inset: "auto",
|
|
55
|
+
margin: 0,
|
|
56
|
+
padding: 0,
|
|
57
|
+
border: "none",
|
|
58
|
+
background: "transparent",
|
|
59
|
+
color: "inherit",
|
|
60
|
+
maxWidth: "100%",
|
|
61
|
+
maxHeight: "100%",
|
|
62
|
+
overflow: "visible",
|
|
49
63
|
...anchorPosition[anchor],
|
|
50
|
-
animation: `${slideIn[anchor]} ${duration}ms ease-out
|
|
51
|
-
"
|
|
64
|
+
"&:popover-open": { animation: `${slideIn[anchor]} ${duration}ms ease-out` },
|
|
65
|
+
"&::backdrop": { backgroundColor: hasBackdrop ? theme.background.backdrop : "transparent" },
|
|
66
|
+
"@media (prefers-reduced-motion: reduce)": { "&:popover-open": { animation: "none" } }
|
|
52
67
|
}));
|
|
53
68
|
/**
|
|
54
|
-
* @description A panel that slides in from a screen edge
|
|
55
|
-
*
|
|
69
|
+
* @description A panel that slides in from a screen edge. It is an HTML `popover`: a
|
|
70
|
+
* `DrawerToggle` opens it, and Escape or a click outside closes it - all without JavaScript,
|
|
71
|
+
* so it works on a prerendered page with scripts off. With JavaScript it can be controlled with
|
|
72
|
+
* `isOpen` / `onClose`, and it moves focus in, traps Tab and locks scroll while open.
|
|
56
73
|
*/
|
|
57
|
-
function Drawer({ children, anchor = "left", elevation = 16, transitionDuration = 225,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
function Drawer({ id, children, isOpen, onClose, anchor = "left", elevation = 16, transitionDuration = 225, hasBackdrop = true, shouldLockScroll = true, shouldAutoFocus = true, shouldTrapFocus = true, shouldRestoreFocus = true }) {
|
|
75
|
+
const panelRef = (0, react.useRef)(null);
|
|
76
|
+
const [isShown, setIsShown] = (0, react.useState)(false);
|
|
77
|
+
const isShownRef = (0, react.useRef)(false);
|
|
78
|
+
const closingByProp = (0, react.useRef)(false);
|
|
79
|
+
const onCloseRef = (0, react.useRef)(onClose);
|
|
80
|
+
(0, react.useEffect)(() => {
|
|
81
|
+
onCloseRef.current = onClose;
|
|
82
|
+
}, [onClose]);
|
|
83
|
+
(0, react.useEffect)(() => {
|
|
84
|
+
const panel = panelRef.current;
|
|
85
|
+
let escaped = false;
|
|
86
|
+
const handleKeyDown = (event) => {
|
|
87
|
+
escaped = event.key === "Escape" && isShownRef.current;
|
|
88
|
+
};
|
|
89
|
+
const handleToggle = (event) => {
|
|
90
|
+
const open = event.newState === "open";
|
|
91
|
+
isShownRef.current = open;
|
|
92
|
+
setIsShown(open);
|
|
93
|
+
if (!open && !closingByProp.current) onCloseRef.current?.(event, escaped ? "escapeKey" : "dismiss");
|
|
94
|
+
closingByProp.current = false;
|
|
95
|
+
escaped = false;
|
|
96
|
+
};
|
|
97
|
+
const doc = panel.ownerDocument;
|
|
98
|
+
doc.addEventListener("keydown", handleKeyDown, true);
|
|
99
|
+
panel.addEventListener("toggle", handleToggle);
|
|
100
|
+
return () => {
|
|
101
|
+
doc.removeEventListener("keydown", handleKeyDown, true);
|
|
102
|
+
panel.removeEventListener("toggle", handleToggle);
|
|
103
|
+
};
|
|
104
|
+
}, []);
|
|
105
|
+
(0, react.useEffect)(() => {
|
|
106
|
+
if (isOpen === void 0 || isOpen === isShownRef.current) return;
|
|
107
|
+
const panel = panelRef.current;
|
|
108
|
+
isShownRef.current = isOpen;
|
|
109
|
+
if (isOpen) panel.showPopover();
|
|
110
|
+
else {
|
|
111
|
+
closingByProp.current = true;
|
|
112
|
+
panel.hidePopover();
|
|
113
|
+
}
|
|
114
|
+
}, [isOpen]);
|
|
115
|
+
(0, react.useEffect)(() => {
|
|
116
|
+
if (!isShown || !shouldLockScroll) return;
|
|
117
|
+
const { body } = panelRef.current.ownerDocument;
|
|
118
|
+
const previous = body.style.overflow;
|
|
119
|
+
body.style.overflow = "hidden";
|
|
120
|
+
return () => {
|
|
121
|
+
body.style.overflow = previous;
|
|
122
|
+
};
|
|
123
|
+
}, [isShown, shouldLockScroll]);
|
|
124
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerPanel, {
|
|
125
|
+
ref: panelRef,
|
|
126
|
+
id,
|
|
127
|
+
popover: "auto",
|
|
128
|
+
anchor,
|
|
129
|
+
duration: transitionDuration,
|
|
130
|
+
hasBackdrop,
|
|
131
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Paper.Paper, {
|
|
64
132
|
elevation,
|
|
65
|
-
|
|
133
|
+
width: "100%",
|
|
134
|
+
height: "100%",
|
|
135
|
+
overflow: "auto",
|
|
136
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FocusTrap.FocusTrap, {
|
|
137
|
+
isEnabled: isShown,
|
|
138
|
+
shouldAutoFocus,
|
|
139
|
+
shouldTrapFocus,
|
|
140
|
+
shouldEnforceFocus: false,
|
|
141
|
+
shouldRestoreFocus,
|
|
142
|
+
children
|
|
143
|
+
})
|
|
66
144
|
})
|
|
67
145
|
});
|
|
68
146
|
}
|
|
69
147
|
//#endregion
|
|
148
|
+
//#region src/Drawer/DrawerToggle.tsx
|
|
149
|
+
/**
|
|
150
|
+
* @description The button that opens and closes a `Drawer`, through the HTML
|
|
151
|
+
* `popovertarget` attribute - it works without JavaScript. Takes every `Button` prop.
|
|
152
|
+
*/
|
|
153
|
+
function DrawerToggle({ drawer, action = "toggle", ...rest }) {
|
|
154
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
155
|
+
popoverTarget: drawer,
|
|
156
|
+
popoverTargetAction: action,
|
|
157
|
+
...rest
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
70
161
|
exports.Drawer = Drawer;
|
|
162
|
+
exports.DrawerToggle = DrawerToggle;
|
package/dist/Drawer.d.cts
CHANGED
|
@@ -1,22 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as ButtonProps } from "./index-B2eLreA5.cjs";
|
|
2
|
+
import { n as PaperElevation } from "./index-H30eNjJf.cjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/Drawer/Drawer.d.ts
|
|
5
5
|
type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
|
|
6
|
-
|
|
6
|
+
/** Why the drawer closed: the Escape key, or any other dismissal (a click outside, its toggle). */
|
|
7
|
+
type DrawerCloseReason = 'escapeKey' | 'dismiss';
|
|
8
|
+
interface DrawerProps {
|
|
9
|
+
/** The element id a `DrawerToggle`'s `drawer` names. */
|
|
10
|
+
id: string;
|
|
7
11
|
/** The content of the drawer. */
|
|
8
12
|
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Open state, for controlled use with JavaScript. Leave it out and the drawer opens and
|
|
15
|
+
* closes from its `DrawerToggle` alone - which also works with JavaScript disabled.
|
|
16
|
+
*/
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
/** Fired when the drawer closes by itself: Escape, a click outside, or its toggle. */
|
|
19
|
+
onClose?: (event: Event, reason: DrawerCloseReason) => void;
|
|
9
20
|
/** Edge the drawer slides in from. Default: 'left'. */
|
|
10
21
|
anchor?: DrawerAnchor;
|
|
11
22
|
/** Shadow depth of the panel (0-24), forwarded to Paper. Default: 16. */
|
|
12
23
|
elevation?: PaperElevation;
|
|
13
24
|
/** Slide duration in milliseconds. Default: 225. */
|
|
14
25
|
transitionDuration?: number;
|
|
26
|
+
/** Dim the page behind the open drawer. Default: true. */
|
|
27
|
+
hasBackdrop?: boolean;
|
|
28
|
+
/** With JavaScript: lock body scroll while open. Default: true. */
|
|
29
|
+
shouldLockScroll?: boolean;
|
|
30
|
+
/** With JavaScript: move focus into the drawer when it opens. Default: true. */
|
|
31
|
+
shouldAutoFocus?: boolean;
|
|
32
|
+
/** With JavaScript: keep Tab cycling within the open drawer. Default: true. */
|
|
33
|
+
shouldTrapFocus?: boolean;
|
|
34
|
+
/** With JavaScript: return focus to where it was when the drawer closes. Default: true. */
|
|
35
|
+
shouldRestoreFocus?: boolean;
|
|
15
36
|
}
|
|
16
37
|
/**
|
|
17
|
-
* @description A panel that slides in from a screen edge
|
|
18
|
-
*
|
|
38
|
+
* @description A panel that slides in from a screen edge. It is an HTML `popover`: a
|
|
39
|
+
* `DrawerToggle` opens it, and Escape or a click outside closes it - all without JavaScript,
|
|
40
|
+
* so it works on a prerendered page with scripts off. With JavaScript it can be controlled with
|
|
41
|
+
* `isOpen` / `onClose`, and it moves focus in, traps Tab and locks scroll while open.
|
|
19
42
|
*/
|
|
20
|
-
declare function Drawer({ children, anchor, elevation, transitionDuration,
|
|
43
|
+
declare function Drawer({ id, children, isOpen, onClose, anchor, elevation, transitionDuration, hasBackdrop, shouldLockScroll, shouldAutoFocus, shouldTrapFocus, shouldRestoreFocus }: Readonly<DrawerProps>): import("react").JSX.Element;
|
|
21
44
|
//#endregion
|
|
22
|
-
|
|
45
|
+
//#region src/Drawer/DrawerToggle.d.ts
|
|
46
|
+
interface DrawerToggleProps extends Omit<ButtonProps, 'href'> {
|
|
47
|
+
/** The `id` of the `Drawer` this button opens and closes. */
|
|
48
|
+
drawer: string;
|
|
49
|
+
/** What a click does to the drawer. Default: 'toggle'. */
|
|
50
|
+
action?: 'toggle' | 'show' | 'hide';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @description The button that opens and closes a `Drawer`, through the HTML
|
|
54
|
+
* `popovertarget` attribute - it works without JavaScript. Takes every `Button` prop.
|
|
55
|
+
*/
|
|
56
|
+
declare function DrawerToggle({ drawer, action, ...rest }: Readonly<DrawerToggleProps>): import("react").JSX.Element;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Drawer, DrawerAnchor, DrawerCloseReason, DrawerProps, DrawerToggle, DrawerToggleProps };
|