@soroush.tech/design-system 2.0.0-rc.1 → 2.0.0-rc.3
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 +30 -10
- package/dist/AppBar.d.cts +1 -3
- package/dist/AppBar.d.mts +1 -3
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.d.cts +1 -3
- package/dist/Avatar.d.mts +1 -3
- package/dist/Avatar.mjs +1 -1
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Breadcrumbs.cjs +132 -0
- package/dist/Breadcrumbs.d.cts +40 -0
- package/dist/Breadcrumbs.d.mts +40 -0
- package/dist/Breadcrumbs.mjs +131 -0
- 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 +3 -3
- package/dist/Card.d.cts +4 -3
- package/dist/Card.d.mts +4 -3
- package/dist/Card.mjs +3 -3
- package/dist/Checkbox.d.cts +1 -2
- package/dist/Checkbox.d.mts +1 -2
- package/dist/CircularProgress.d.cts +2 -3
- package/dist/CircularProgress.d.mts +2 -3
- package/dist/Drawer.d.cts +3 -2
- package/dist/Drawer.d.mts +3 -2
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/FormControl.cjs +10 -2
- package/dist/FormControl.d.cts +9 -2
- package/dist/FormControl.d.mts +9 -2
- package/dist/FormControl.mjs +10 -2
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.cjs +9 -1
- package/dist/FormLabel.d.cts +2 -2
- package/dist/FormLabel.d.mts +2 -2
- package/dist/FormLabel.mjs +10 -2
- package/dist/Grid.d.cts +1 -3
- package/dist/Grid.d.mts +1 -3
- package/dist/{Icon-CH3asUJu.mjs → Icon-BihOAP4u.mjs} +52 -2
- package/dist/{Icon-CI6q2Eyi.cjs → Icon-D-EWsBVg.cjs} +52 -2
- 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 +1 -2
- package/dist/Image.d.mts +1 -2
- package/dist/InputRange.cjs +675 -0
- package/dist/InputRange.d.cts +79 -0
- package/dist/InputRange.d.mts +79 -0
- package/dist/InputRange.mjs +673 -0
- package/dist/LinearProgress.d.cts +2 -3
- package/dist/LinearProgress.d.mts +2 -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/Menu/ContextMenu.cjs +146 -0
- package/dist/Menu/ContextMenu.d.cts +52 -0
- package/dist/Menu/ContextMenu.d.mts +52 -0
- package/dist/Menu/ContextMenu.mjs +145 -0
- package/dist/Menu/Menu.cjs +3 -0
- package/dist/Menu/Menu.d.cts +2 -0
- package/dist/Menu/Menu.d.mts +2 -0
- package/dist/Menu/Menu.mjs +2 -0
- package/dist/Menu/MenuDivider.cjs +29 -0
- package/dist/Menu/MenuDivider.d.cts +12 -0
- package/dist/Menu/MenuDivider.d.mts +12 -0
- package/dist/Menu/MenuDivider.mjs +28 -0
- package/dist/Menu/MenuItems.cjs +29 -0
- package/dist/Menu/MenuItems.d.cts +2 -0
- package/dist/Menu/MenuItems.d.mts +2 -0
- package/dist/Menu/MenuItems.mjs +28 -0
- package/dist/Menu/MenuList.cjs +3 -0
- package/dist/Menu/MenuList.d.cts +38 -0
- package/dist/Menu/MenuList.d.mts +38 -0
- package/dist/Menu/MenuList.mjs +2 -0
- package/dist/Menu-Cgg-sX4W.cjs +173 -0
- package/dist/Menu-CrzHc_cn.mjs +168 -0
- package/dist/Menu.cjs +13 -0
- package/dist/Menu.d.cts +7 -0
- package/dist/Menu.d.mts +7 -0
- package/dist/Menu.mjs +6 -0
- package/dist/MenuItem-BTP7Ijwi.cjs +673 -0
- package/dist/MenuItem-DUn4IZKK.mjs +649 -0
- package/dist/MenuItem.cjs +2 -148
- package/dist/MenuItem.d.cts +2 -52
- package/dist/MenuItem.d.mts +2 -52
- package/dist/MenuItem.mjs +1 -147
- package/dist/MenuList-B7msJ1IG.mjs +187 -0
- package/dist/MenuList-D4imLXAa.cjs +223 -0
- package/dist/MenuListContext-DKUOhNyw.d.cts +21 -0
- package/dist/MenuListContext-x-7lH4CH.d.mts +21 -0
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/NativeSelect.cjs +9 -8
- package/dist/NativeSelect.d.cts +3 -4
- package/dist/NativeSelect.d.mts +3 -4
- package/dist/NativeSelect.mjs +9 -8
- package/dist/NumberField.cjs +476 -0
- package/dist/NumberField.d.cts +74 -0
- package/dist/NumberField.d.mts +74 -0
- package/dist/NumberField.mjs +474 -0
- 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 +2 -1
- package/dist/Paper.d.mts +2 -1
- package/dist/Paper.mjs +1 -1
- package/dist/{Popover-TpwRSORC.cjs → Popover-CiZfgiKE.cjs} +5 -125
- package/dist/Popover-QjM5Z1CR.mjs +133 -0
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +6 -7
- package/dist/Popover.d.mts +6 -7
- 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 +2 -3
- package/dist/Quote.d.mts +2 -3
- package/dist/Radio.d.cts +1 -2
- package/dist/Radio.d.mts +1 -2
- package/dist/Rating.cjs +373 -0
- package/dist/Rating.d.cts +57 -0
- package/dist/Rating.d.mts +57 -0
- package/dist/Rating.mjs +371 -0
- package/dist/Select.cjs +5 -4
- package/dist/Select.d.cts +3 -4
- package/dist/Select.d.mts +3 -4
- package/dist/Select.mjs +7 -6
- package/dist/Sidebar/Sidebar.d.cts +1 -1
- package/dist/Sidebar/Sidebar.d.mts +1 -1
- package/dist/Sidebar/SidebarItem.cjs +1 -1
- package/dist/Sidebar/SidebarItem.d.cts +3 -4
- package/dist/Sidebar/SidebarItem.d.mts +3 -4
- package/dist/Sidebar/SidebarItem.mjs +3 -3
- package/dist/Skeleton.d.cts +1 -2
- package/dist/Skeleton.d.mts +1 -2
- package/dist/Switch.cjs +23 -16
- package/dist/Switch.d.cts +2 -3
- package/dist/Switch.d.mts +2 -3
- package/dist/Switch.mjs +25 -18
- package/dist/Table/Table.d.cts +2 -3
- package/dist/Table/Table.d.mts +2 -3
- package/dist/Table/TableBody.d.cts +1 -2
- package/dist/Table/TableBody.d.mts +1 -2
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +1 -3
- package/dist/Table/TableContainer.d.mts +1 -3
- package/dist/Table/TableControl.d.cts +1 -1
- package/dist/Table/TableControl.d.mts +1 -1
- package/dist/Table/TableControl.mjs +2 -2
- package/dist/Table/TableFooter.d.cts +1 -2
- package/dist/Table/TableFooter.d.mts +1 -2
- package/dist/Table/TableHead.d.cts +1 -2
- package/dist/Table/TableHead.d.mts +1 -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 +1 -2
- package/dist/Table/TableRow.d.mts +1 -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-BeCxbtHH.d.cts → TableContext-DhuRf6Wy.d.mts} +1 -1
- package/dist/{TableContext-BiRiYkVZ.d.mts → TableContext-Duj1nVG7.d.cts} +1 -1
- package/dist/Tabs/Tab.cjs +306 -0
- package/dist/Tabs/Tab.d.cts +62 -0
- package/dist/Tabs/Tab.d.mts +62 -0
- package/dist/Tabs/Tab.mjs +305 -0
- package/dist/Tabs/TabContext.cjs +34 -0
- package/dist/Tabs/TabContext.d.cts +20 -0
- package/dist/Tabs/TabContext.d.mts +20 -0
- package/dist/Tabs/TabContext.mjs +33 -0
- package/dist/Tabs/TabList.cjs +31 -0
- package/dist/Tabs/TabList.d.cts +11 -0
- package/dist/Tabs/TabList.d.mts +11 -0
- package/dist/Tabs/TabList.mjs +30 -0
- package/dist/Tabs/TabPanel.cjs +40 -0
- package/dist/Tabs/TabPanel.d.cts +27 -0
- package/dist/Tabs/TabPanel.d.mts +27 -0
- package/dist/Tabs/TabPanel.mjs +38 -0
- package/dist/Tabs/TabScrollButton.cjs +93 -0
- package/dist/Tabs/TabScrollButton.d.cts +2 -0
- package/dist/Tabs/TabScrollButton.d.mts +2 -0
- package/dist/Tabs/TabScrollButton.mjs +91 -0
- package/dist/Tabs/Tabs.cjs +3 -0
- package/dist/Tabs/Tabs.d.cts +3 -0
- package/dist/Tabs/Tabs.d.mts +3 -0
- package/dist/Tabs/Tabs.mjs +2 -0
- package/dist/Tabs-BTNOJx5v.mjs +634 -0
- package/dist/Tabs-D4tWCq78.cjs +646 -0
- package/dist/Tabs.cjs +13 -0
- package/dist/Tabs.d.cts +8 -0
- package/dist/Tabs.d.mts +8 -0
- package/dist/Tabs.mjs +7 -0
- package/dist/TabsContext-B_XHbjcS.d.cts +6 -0
- package/dist/TabsContext-Dn2kqUwr.d.mts +6 -0
- package/dist/TabsValueContext-D40zGCpE.cjs +19 -0
- package/dist/TabsValueContext-DvL3inf7.mjs +8 -0
- package/dist/TextInput.cjs +4 -4
- package/dist/TextInput.d.cts +2 -3
- package/dist/TextInput.d.mts +2 -3
- package/dist/TextInput.mjs +4 -4
- 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/TransferList.cjs +356 -0
- package/dist/TransferList.d.cts +67 -0
- package/dist/TransferList.d.mts +67 -0
- package/dist/TransferList.mjs +354 -0
- 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.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/catalog.cjs +4568 -0
- package/dist/catalog.d.cts +90 -0
- package/dist/catalog.d.mts +90 -0
- package/dist/catalog.mjs +4567 -0
- package/dist/computePopoverPosition-BIprs_xo.mjs +123 -0
- package/dist/computePopoverPosition-DiyEOHnU.cjs +128 -0
- package/dist/dividerLine-BNljcGlv.cjs +66 -0
- package/dist/dividerLine-FahY-M6_.mjs +31 -0
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.mts +1 -1
- package/dist/index-B1RFybA_.d.mts +72 -0
- package/dist/index-B4TeaB7b.d.cts +72 -0
- package/dist/{index-BUoVTCqX.d.mts → index-BGbTuHP9.d.mts} +1 -2
- package/dist/{index-Celm-8iN.d.cts → index-BHKgEOZJ.d.cts} +2 -3
- package/dist/{index-Chg6pSrr.d.mts → index-BQWjh4rK.d.mts} +2 -3
- package/dist/{index-B78VkB0-.d.cts → index-BelFIizY.d.cts} +2 -3
- package/dist/index-BkzZxHVj.d.mts +35 -0
- package/dist/{index-DbEnSf2m.d.cts → index-BrgwkY6z.d.mts} +3 -4
- package/dist/{index-Wnv6jCR3.d.mts → index-Bx0-6yeX.d.mts} +1 -2
- package/dist/index-BxVTIMnB.d.cts +1 -0
- package/dist/{index-BfZuh9c2.d.mts → index-ByYxVl9O.d.mts} +2 -3
- package/dist/index-CE5JG1us.d.mts +34 -0
- package/dist/{index-BhibLnZ0.d.cts → index-CG_1uPrD.d.mts} +2 -3
- package/dist/{themes-RX2UX5gD.d.mts → index-CJhK7JND.d.mts} +265 -8
- package/dist/{index-BB-dLv5V.d.mts → index-CQfJZADG.d.cts} +3 -4
- package/dist/{index-CxUsrlg1.d.cts → index-CUz2h5xY.d.mts} +2 -3
- package/dist/{index-Bid71KeF.d.cts → index-CbFaWtjK.d.mts} +2 -2
- package/dist/{index-DdqdSOct.d.cts → index-ChXeKJCk.d.cts} +1 -2
- package/dist/index-CknoXDLQ.d.cts +35 -0
- package/dist/{index-BSqet8aO.d.cts → index-ClZyaZrR.d.mts} +2 -3
- package/dist/{index-DXvQ-JVZ.d.mts → index-DAwcmIjN.d.cts} +2 -3
- package/dist/index-DGnXJwLj.d.mts +72 -0
- package/dist/{themes-Kbk9h5cN.d.cts → index-DJ0f69wh.d.cts} +262 -5
- package/dist/index-DWjz5ZzG.d.cts +72 -0
- package/dist/{index-DNwF3DUX.d.cts → index-DYF8sRE-.d.cts} +2 -3
- package/dist/index-DaIIo5QU.d.mts +1 -0
- package/dist/{index-CrN4MSUF.d.cts → index-DchHf5cF.d.cts} +1 -1
- package/dist/{index-S-ClM6WM.d.mts → index-DtYjdBvO.d.cts} +2 -2
- package/dist/{index-Ctqajtac.d.cts → index-Dv_fk1_F.d.cts} +27 -3
- package/dist/{index-smqjMLAZ.d.mts → index-K5exjvnX.d.cts} +2 -3
- package/dist/index-KnXhlKMr.d.cts +34 -0
- package/dist/index-WHFhjfgy.d.cts +98 -0
- package/dist/{index-GpnmW6vu.d.mts → index-YKrfFC_I.d.cts} +2 -3
- package/dist/index-bpnLB_4K.d.mts +98 -0
- package/dist/{index-VOsBSWEu.d.mts → index-h4dYtVrp.d.mts} +1 -1
- package/dist/{index-DO9J-Fla.d.mts → index-ha1WjSZ5.d.mts} +27 -3
- package/dist/{index-Belxmt1X.d.cts → index-nqUA_6J_.d.cts} +1 -2
- package/dist/{index-nc4Sxiy9.d.mts → index-pTNq3iQn.d.mts} +2 -3
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/isRtl-BJDtm86G.mjs +7 -0
- package/dist/isRtl-DTkYHRPo.cjs +12 -0
- package/dist/precision-B1lhxnnO.mjs +25 -0
- package/dist/precision-B58cTPB2.cjs +48 -0
- 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/surfaceSystem-BGQBoXv_.cjs +38 -0
- package/dist/surfaceSystem-D8TbmKy3.mjs +21 -0
- package/dist/theme-BxXuXRgQ.cjs +137 -0
- package/dist/theme-Z9_QludW.mjs +102 -0
- package/dist/theme.cjs +25 -24
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.mjs +2 -1
- package/dist/{theme-CDVxig_g.mjs → themes-L-dE7_ck.mjs} +10 -110
- package/dist/{theme-BXlAP3xf.cjs → themes-gd6tcmqS.cjs} +0 -136
- package/dist/useControlled-C666KpQ0.cjs +18 -0
- package/dist/useControlled-CBRLsO-H.mjs +13 -0
- package/dist/{useTablePagination-COTiNH_8.d.mts → useTablePagination-C-u3ru4N.d.cts} +1 -1
- package/dist/{useTablePagination-WFkaUZu8.d.cts → useTablePagination-D-39ZmQh.d.mts} +1 -1
- package/package.json +83 -2
- package/dist/Popover-DwnSLpp1.mjs +0 -253
- package/dist/index-B_dKjEDR.d.mts +0 -23
- package/dist/index-C1WqEDtQ.d.mts +0 -69
- package/dist/index-CA7HnbtH.d.cts +0 -21
- package/dist/index-CKZaErxJ.d.mts +0 -21
- package/dist/index-DBUwu65Z.d.cts +0 -69
- package/dist/index-DzQJSYIh.d.cts +0 -23
- package/dist/index-cuv3o-L7.d.mts +0 -34
- package/dist/index-nB94D7UM.d.cts +0 -34
package/README.md
CHANGED
|
@@ -81,6 +81,14 @@ import { Global, globalStyles, CacheProvider, styleCache } from '@soroush.tech/d
|
|
|
81
81
|
|
|
82
82
|
`Global` (retyped against this package's `Theme`) applies app-wide CSS and should render inside `ThemeProvider` so it resolves against the active theme. `globalStyles(theme)` is the base reset this package owns - box-sizing, margin/table resets, and theme-driven body colors - compose it into your own `Global` styles array alongside your app's own concerns (font-family, webfont loading, and anything else app-specific stay entirely app policy).
|
|
83
83
|
|
|
84
|
+
The component catalog - every component as data, for tools that place and write components (a
|
|
85
|
+
design tool's palette, a source writer) - lives at its own subpath and loads in plain Node
|
|
86
|
+
([docs](./docs/catalog.md)):
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { catalog } from '@soroush.tech/design-system/catalog'
|
|
90
|
+
```
|
|
91
|
+
|
|
84
92
|
SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in concern most apps never need - that's what `CacheProvider` and its paired `styleCache` instance are for.
|
|
85
93
|
|
|
86
94
|
---
|
|
@@ -113,16 +121,28 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
113
121
|
|
|
114
122
|
### Inputs & forms
|
|
115
123
|
|
|
116
|
-
| Component | Purpose
|
|
117
|
-
| ---------------------------------------------------- |
|
|
118
|
-
| `Button`, `ButtonGroup`, `ToggleButton` | Actions and toggles
|
|
119
|
-
| `TextInput` | Text field
|
|
120
|
-
| `Checkbox`, `Radio`, `Switch` | Selection controls
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
124
|
+
| Component | Purpose |
|
|
125
|
+
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
126
|
+
| `Button`, `ButtonGroup`, `ToggleButton` | Actions and toggles |
|
|
127
|
+
| `TextInput` | Text field |
|
|
128
|
+
| `Checkbox`, `Radio`, `Switch` | Selection controls |
|
|
129
|
+
| `InputRange` | A slider - one value on a range, or two or more thumbs for a range of values |
|
|
130
|
+
| `TransferList` | Two lists and the buttons that move the checked items from one to the other |
|
|
131
|
+
| `NumberField` | A field for a number - read in its locale, clamped to a range, stepped by keys or buttons |
|
|
132
|
+
| `Rating` | A row of icons the user sets as a rating, or a read-only display of one |
|
|
133
|
+
| `NativeSelect` | Low-level platform `<select>` - not recommended; use `Select native` |
|
|
134
|
+
| `Select` | The select to use - custom listbox, or `native` for the platform picker |
|
|
135
|
+
| `MenuItem` | Option row for `Select`'s listbox, and a menu row in a `MenuList` |
|
|
136
|
+
| `Form`, `FormControl`, `FormLabel`, `FormHelperText` | Form composition and labeling |
|
|
137
|
+
| `Pagination` | Page navigation control |
|
|
138
|
+
|
|
139
|
+
### Navigation & menus
|
|
140
|
+
|
|
141
|
+
| Component | Purpose |
|
|
142
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
143
|
+
| `Breadcrumbs` | The trail of links from a site's root to the current page - a long one collapses behind a button that shows it all |
|
|
144
|
+
| `Menu` | A trigger and the list of commands it opens - exports `MenuList` (the `role="menu"` list that owns the keyboard), `MenuDivider`, `MenuItems` (rows from data) and `ContextMenu` (the same list, opened at the pointer by a right-click) from `@soroush.tech/design-system/Menu` |
|
|
145
|
+
| `Tabs` | A row of tabs - exports `Tab`, `TabContext` (holds the value for a `TabList` and its panels), `TabList` (the `Tabs` of a `TabContext`), `TabPanel` (the content a tab shows) and `TabScrollButton` from `@soroush.tech/design-system/Tabs` |
|
|
126
146
|
|
|
127
147
|
### Feedback
|
|
128
148
|
|
package/dist/AppBar.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-DBUwu65Z.cjs";
|
|
3
|
-
import { n as FlexProps } from "./index-CA7HnbtH.cjs";
|
|
1
|
+
import { Jt as FlexProps, W as Theme } from "./index-DJ0f69wh.cjs";
|
|
4
2
|
//#region src/AppBar/AppBar.d.ts
|
|
5
3
|
/** Valid values for the color prop - derived from theme.background keys. */
|
|
6
4
|
type AppBarColor = keyof Theme['background'];
|
package/dist/AppBar.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-C1WqEDtQ.mjs";
|
|
3
|
-
import { n as FlexProps } from "./index-CKZaErxJ.mjs";
|
|
1
|
+
import { Jt as FlexProps, W as Theme } from "./index-CJhK7JND.mjs";
|
|
4
2
|
//#region src/AppBar/AppBar.d.ts
|
|
5
3
|
/** Valid values for the color prop - derived from theme.background keys. */
|
|
6
4
|
type AppBarColor = keyof Theme['background'];
|
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-BxXuXRgQ.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,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-DBUwu65Z.cjs";
|
|
3
|
-
import { n as FlexProps } from "./index-CA7HnbtH.cjs";
|
|
1
|
+
import { Jt as FlexProps, W as Theme } from "./index-DJ0f69wh.cjs";
|
|
4
2
|
//#region src/Avatar/Avatar.d.ts
|
|
5
3
|
type AvatarVariant = 'circular' | 'rounded' | 'square';
|
|
6
4
|
type AvatarSize = keyof Theme['avatar'];
|
package/dist/Avatar.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-C1WqEDtQ.mjs";
|
|
3
|
-
import { n as FlexProps } from "./index-CKZaErxJ.mjs";
|
|
1
|
+
import { Jt as FlexProps, W as Theme } from "./index-CJhK7JND.mjs";
|
|
4
2
|
//#region src/Avatar/Avatar.d.ts
|
|
5
3
|
type AvatarVariant = 'circular' | 'rounded' | 'square';
|
|
6
4
|
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-Z9_QludW.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
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("./src-DU81aGy9.cjs");
|
|
3
|
+
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
4
|
+
const require_theme = require("./theme-BxXuXRgQ.cjs");
|
|
5
|
+
const require_Typography = require("./Typography.cjs");
|
|
6
|
+
const require_Icon = require("./Icon-D-EWsBVg.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
//#region src/Breadcrumbs/Breadcrumbs.tsx
|
|
10
|
+
const BreadcrumbsRoot = require_src.styled(require_Typography.Typography, {
|
|
11
|
+
name: "Breadcrumbs",
|
|
12
|
+
label: "Breadcrumbs"
|
|
13
|
+
})({});
|
|
14
|
+
const BreadcrumbsList = require_src.styled("ol", {
|
|
15
|
+
name: "Breadcrumbs",
|
|
16
|
+
slot: "list",
|
|
17
|
+
label: "BreadcrumbsList"
|
|
18
|
+
})({
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexWrap: "wrap",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
padding: 0,
|
|
23
|
+
margin: 0,
|
|
24
|
+
listStyle: "none"
|
|
25
|
+
});
|
|
26
|
+
const BreadcrumbsItem = require_src.styled("li", {
|
|
27
|
+
name: "Breadcrumbs",
|
|
28
|
+
slot: "item",
|
|
29
|
+
label: "BreadcrumbsItem"
|
|
30
|
+
})({
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
"& > *": { marginBlock: 0 }
|
|
34
|
+
});
|
|
35
|
+
const BreadcrumbsSeparator = require_src.styled("li", {
|
|
36
|
+
name: "Breadcrumbs",
|
|
37
|
+
slot: "separator",
|
|
38
|
+
label: "BreadcrumbsSeparator"
|
|
39
|
+
})(({ theme }) => ({
|
|
40
|
+
display: "flex",
|
|
41
|
+
userSelect: "none",
|
|
42
|
+
marginInline: theme.space[1],
|
|
43
|
+
"[dir=\"rtl\"] & svg": { transform: "scaleX(-1)" }
|
|
44
|
+
}));
|
|
45
|
+
const BreadcrumbsCollapsed = require_src.styled("button", {
|
|
46
|
+
name: "Breadcrumbs",
|
|
47
|
+
slot: "collapsed",
|
|
48
|
+
label: "BreadcrumbsCollapsed"
|
|
49
|
+
})(({ theme }) => {
|
|
50
|
+
const main = (0, require_src.src_exports.get)(theme, `palette.${require_themeDefault.themeDefault(theme, "color", "primary")}.main`);
|
|
51
|
+
return {
|
|
52
|
+
appearance: "none",
|
|
53
|
+
display: "flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
marginInline: theme.space[.5],
|
|
56
|
+
padding: `0 ${theme.space[.5]}`,
|
|
57
|
+
border: "none",
|
|
58
|
+
borderRadius: theme.radii.sm,
|
|
59
|
+
backgroundColor: (0, require_src.src_exports.get)(theme, "background.paper"),
|
|
60
|
+
color: "inherit",
|
|
61
|
+
cursor: "pointer",
|
|
62
|
+
outline: "none",
|
|
63
|
+
"&:hover": { backgroundColor: `${main}1F` },
|
|
64
|
+
"&:focus-visible": {
|
|
65
|
+
outline: `${theme.borderWidths.base} solid ${main}`,
|
|
66
|
+
outlineOffset: theme.borderWidths.thin
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
const BreadcrumbsCollapsedIcon = require_src.styled("span", {
|
|
71
|
+
name: "Breadcrumbs",
|
|
72
|
+
slot: "collapsedIcon",
|
|
73
|
+
label: "BreadcrumbsCollapsedIcon"
|
|
74
|
+
})({ display: "inline-flex" });
|
|
75
|
+
/**
|
|
76
|
+
* @description The trail of links from a site's root to the current page - a `nav` landmark named
|
|
77
|
+
* by `aria-label`, its crumbs an ordered list with a separator between two. Past `maxItems` the
|
|
78
|
+
* trail collapses to its first and last crumbs and a button that shows them all.
|
|
79
|
+
*/
|
|
80
|
+
function Breadcrumbs({ children, as = "nav", separator: separatorProp, maxItems: maxItemsProp, itemsBeforeCollapse: itemsBeforeCollapseProp, itemsAfterCollapse: itemsAfterCollapseProp, expandLabel: expandLabelProp, color: colorProp, typography, slots, slotProps, ...rest }) {
|
|
81
|
+
const dp = require_theme.useDefaultProps("Breadcrumbs");
|
|
82
|
+
const separator = separatorProp ?? dp.separator ?? "/";
|
|
83
|
+
const maxItems = maxItemsProp ?? dp.maxItems ?? 8;
|
|
84
|
+
const itemsBeforeCollapse = itemsBeforeCollapseProp ?? dp.itemsBeforeCollapse ?? 1;
|
|
85
|
+
const itemsAfterCollapse = itemsAfterCollapseProp ?? dp.itemsAfterCollapse ?? 1;
|
|
86
|
+
const expandLabel = expandLabelProp ?? dp.expandLabel;
|
|
87
|
+
const color = colorProp ?? dp.color ?? "secondary";
|
|
88
|
+
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
89
|
+
const listRef = (0, react.useRef)(null);
|
|
90
|
+
const shouldFocusRef = (0, react.useRef)(false);
|
|
91
|
+
(0, react.useLayoutEffect)(() => {
|
|
92
|
+
if (!shouldFocusRef.current) return;
|
|
93
|
+
shouldFocusRef.current = false;
|
|
94
|
+
listRef.current?.querySelector("a[href],button,[tabindex]")?.focus();
|
|
95
|
+
}, [isExpanded]);
|
|
96
|
+
const crumbs = react.Children.toArray(children).filter(react.isValidElement).map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsItem, { children: child }, child.key));
|
|
97
|
+
const isCollapsed = !isExpanded && crumbs.length > maxItems && itemsBeforeCollapse + itemsAfterCollapse < crumbs.length;
|
|
98
|
+
const CollapsedIcon = slots?.collapsedIcon;
|
|
99
|
+
const shown = isCollapsed ? [
|
|
100
|
+
...crumbs.slice(0, itemsBeforeCollapse),
|
|
101
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsCollapsed, {
|
|
102
|
+
type: "button",
|
|
103
|
+
"aria-label": expandLabel,
|
|
104
|
+
onClick: () => {
|
|
105
|
+
shouldFocusRef.current = true;
|
|
106
|
+
setIsExpanded(true);
|
|
107
|
+
},
|
|
108
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsCollapsedIcon, { children: CollapsedIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsedIcon, { ...slotProps?.collapsedIcon }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
109
|
+
name: "more_horiz",
|
|
110
|
+
size: "sm",
|
|
111
|
+
color: "inherit",
|
|
112
|
+
...slotProps?.collapsedIcon
|
|
113
|
+
}) })
|
|
114
|
+
}) }, "collapsed"),
|
|
115
|
+
...crumbs.slice(crumbs.length - itemsAfterCollapse)
|
|
116
|
+
] : crumbs;
|
|
117
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsRoot, {
|
|
118
|
+
as,
|
|
119
|
+
color,
|
|
120
|
+
variant: typography,
|
|
121
|
+
...rest,
|
|
122
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsList, {
|
|
123
|
+
ref: listRef,
|
|
124
|
+
children: shown.flatMap((crumb, index) => index === 0 ? [crumb] : [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbsSeparator, {
|
|
125
|
+
"aria-hidden": true,
|
|
126
|
+
children: separator
|
|
127
|
+
}, `separator-${crumb.key}`), crumb])
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ht as TypographyVariant } from "./index-DJ0f69wh.cjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-K5exjvnX.cjs";
|
|
3
|
+
import { n as IconProps } from "./index-Dv_fk1_F.cjs";
|
|
4
|
+
import { ElementType, ReactNode } from "react";
|
|
5
|
+
//#region src/Breadcrumbs/Breadcrumbs.d.ts
|
|
6
|
+
interface BreadcrumbsProps extends Omit<TypographyProps, 'children' | 'variant'> {
|
|
7
|
+
/** The crumbs - the app's `Link`s, and the current page as `Typography` or a `Link` with `aria-current="page"`. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** The trail's type - a `theme.typography` variant, given to its root `Typography`. Default: `'body1'`. */
|
|
10
|
+
typography?: TypographyVariant;
|
|
11
|
+
/** Between two crumbs. Default: `'/'`. */
|
|
12
|
+
separator?: ReactNode;
|
|
13
|
+
/** Past this many crumbs the trail collapses, a button standing for the ones between. Default: `8`. */
|
|
14
|
+
maxItems?: number;
|
|
15
|
+
/** Crumbs shown before the button when collapsed. Default: `1`. */
|
|
16
|
+
itemsBeforeCollapse?: number;
|
|
17
|
+
/** Crumbs shown after the button when collapsed. Default: `1`. */
|
|
18
|
+
itemsAfterCollapse?: number;
|
|
19
|
+
/** Names the button that shows the whole trail - no built-in text; a theme gives it through `defaultProps`. */
|
|
20
|
+
expandLabel?: string;
|
|
21
|
+
/** An icon of your own in the button, in place of `more_horiz`. */
|
|
22
|
+
slots?: {
|
|
23
|
+
collapsedIcon?: ElementType;
|
|
24
|
+
};
|
|
25
|
+
/** Props for the button's icon. */
|
|
26
|
+
slotProps?: {
|
|
27
|
+
collapsedIcon?: Partial<Omit<IconProps, 'name'>> & {
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @description The trail of links from a site's root to the current page - a `nav` landmark named
|
|
35
|
+
* by `aria-label`, its crumbs an ordered list with a separator between two. Past `maxItems` the
|
|
36
|
+
* trail collapses to its first and last crumbs and a button that shows them all.
|
|
37
|
+
*/
|
|
38
|
+
declare function Breadcrumbs({ children, as, separator: separatorProp, maxItems: maxItemsProp, itemsBeforeCollapse: itemsBeforeCollapseProp, itemsAfterCollapse: itemsAfterCollapseProp, expandLabel: expandLabelProp, color: colorProp, typography, slots, slotProps, ...rest }: Readonly<BreadcrumbsProps>): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Breadcrumbs, BreadcrumbsProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ht as TypographyVariant } from "./index-CJhK7JND.mjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-ClZyaZrR.mjs";
|
|
3
|
+
import { n as IconProps } from "./index-ha1WjSZ5.mjs";
|
|
4
|
+
import { ElementType, ReactNode } from "react";
|
|
5
|
+
//#region src/Breadcrumbs/Breadcrumbs.d.ts
|
|
6
|
+
interface BreadcrumbsProps extends Omit<TypographyProps, 'children' | 'variant'> {
|
|
7
|
+
/** The crumbs - the app's `Link`s, and the current page as `Typography` or a `Link` with `aria-current="page"`. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** The trail's type - a `theme.typography` variant, given to its root `Typography`. Default: `'body1'`. */
|
|
10
|
+
typography?: TypographyVariant;
|
|
11
|
+
/** Between two crumbs. Default: `'/'`. */
|
|
12
|
+
separator?: ReactNode;
|
|
13
|
+
/** Past this many crumbs the trail collapses, a button standing for the ones between. Default: `8`. */
|
|
14
|
+
maxItems?: number;
|
|
15
|
+
/** Crumbs shown before the button when collapsed. Default: `1`. */
|
|
16
|
+
itemsBeforeCollapse?: number;
|
|
17
|
+
/** Crumbs shown after the button when collapsed. Default: `1`. */
|
|
18
|
+
itemsAfterCollapse?: number;
|
|
19
|
+
/** Names the button that shows the whole trail - no built-in text; a theme gives it through `defaultProps`. */
|
|
20
|
+
expandLabel?: string;
|
|
21
|
+
/** An icon of your own in the button, in place of `more_horiz`. */
|
|
22
|
+
slots?: {
|
|
23
|
+
collapsedIcon?: ElementType;
|
|
24
|
+
};
|
|
25
|
+
/** Props for the button's icon. */
|
|
26
|
+
slotProps?: {
|
|
27
|
+
collapsedIcon?: Partial<Omit<IconProps, 'name'>> & {
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @description The trail of links from a site's root to the current page - a `nav` landmark named
|
|
35
|
+
* by `aria-label`, its crumbs an ordered list with a separator between two. Past `maxItems` the
|
|
36
|
+
* trail collapses to its first and last crumbs and a button that shows them all.
|
|
37
|
+
*/
|
|
38
|
+
declare function Breadcrumbs({ children, as, separator: separatorProp, maxItems: maxItemsProp, itemsBeforeCollapse: itemsBeforeCollapseProp, itemsAfterCollapse: itemsAfterCollapseProp, expandLabel: expandLabelProp, color: colorProp, typography, slots, slotProps, ...rest }: Readonly<BreadcrumbsProps>): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Breadcrumbs, BreadcrumbsProps };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { a as src_exports, o as styled } from "./src-DLGYOJMh.mjs";
|
|
2
|
+
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
3
|
+
import { n as useDefaultProps } from "./theme-Z9_QludW.mjs";
|
|
4
|
+
import { Typography } from "./Typography.mjs";
|
|
5
|
+
import { t as Icon } from "./Icon-BihOAP4u.mjs";
|
|
6
|
+
import { Children, isValidElement, useLayoutEffect, useRef, useState } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/Breadcrumbs/Breadcrumbs.tsx
|
|
9
|
+
const BreadcrumbsRoot = styled(Typography, {
|
|
10
|
+
name: "Breadcrumbs",
|
|
11
|
+
label: "Breadcrumbs"
|
|
12
|
+
})({});
|
|
13
|
+
const BreadcrumbsList = styled("ol", {
|
|
14
|
+
name: "Breadcrumbs",
|
|
15
|
+
slot: "list",
|
|
16
|
+
label: "BreadcrumbsList"
|
|
17
|
+
})({
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexWrap: "wrap",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
padding: 0,
|
|
22
|
+
margin: 0,
|
|
23
|
+
listStyle: "none"
|
|
24
|
+
});
|
|
25
|
+
const BreadcrumbsItem = styled("li", {
|
|
26
|
+
name: "Breadcrumbs",
|
|
27
|
+
slot: "item",
|
|
28
|
+
label: "BreadcrumbsItem"
|
|
29
|
+
})({
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
"& > *": { marginBlock: 0 }
|
|
33
|
+
});
|
|
34
|
+
const BreadcrumbsSeparator = styled("li", {
|
|
35
|
+
name: "Breadcrumbs",
|
|
36
|
+
slot: "separator",
|
|
37
|
+
label: "BreadcrumbsSeparator"
|
|
38
|
+
})(({ theme }) => ({
|
|
39
|
+
display: "flex",
|
|
40
|
+
userSelect: "none",
|
|
41
|
+
marginInline: theme.space[1],
|
|
42
|
+
"[dir=\"rtl\"] & svg": { transform: "scaleX(-1)" }
|
|
43
|
+
}));
|
|
44
|
+
const BreadcrumbsCollapsed = styled("button", {
|
|
45
|
+
name: "Breadcrumbs",
|
|
46
|
+
slot: "collapsed",
|
|
47
|
+
label: "BreadcrumbsCollapsed"
|
|
48
|
+
})(({ theme }) => {
|
|
49
|
+
const main = (0, src_exports.get)(theme, `palette.${themeDefault(theme, "color", "primary")}.main`);
|
|
50
|
+
return {
|
|
51
|
+
appearance: "none",
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
marginInline: theme.space[.5],
|
|
55
|
+
padding: `0 ${theme.space[.5]}`,
|
|
56
|
+
border: "none",
|
|
57
|
+
borderRadius: theme.radii.sm,
|
|
58
|
+
backgroundColor: (0, src_exports.get)(theme, "background.paper"),
|
|
59
|
+
color: "inherit",
|
|
60
|
+
cursor: "pointer",
|
|
61
|
+
outline: "none",
|
|
62
|
+
"&:hover": { backgroundColor: `${main}1F` },
|
|
63
|
+
"&:focus-visible": {
|
|
64
|
+
outline: `${theme.borderWidths.base} solid ${main}`,
|
|
65
|
+
outlineOffset: theme.borderWidths.thin
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
const BreadcrumbsCollapsedIcon = styled("span", {
|
|
70
|
+
name: "Breadcrumbs",
|
|
71
|
+
slot: "collapsedIcon",
|
|
72
|
+
label: "BreadcrumbsCollapsedIcon"
|
|
73
|
+
})({ display: "inline-flex" });
|
|
74
|
+
/**
|
|
75
|
+
* @description The trail of links from a site's root to the current page - a `nav` landmark named
|
|
76
|
+
* by `aria-label`, its crumbs an ordered list with a separator between two. Past `maxItems` the
|
|
77
|
+
* trail collapses to its first and last crumbs and a button that shows them all.
|
|
78
|
+
*/
|
|
79
|
+
function Breadcrumbs({ children, as = "nav", separator: separatorProp, maxItems: maxItemsProp, itemsBeforeCollapse: itemsBeforeCollapseProp, itemsAfterCollapse: itemsAfterCollapseProp, expandLabel: expandLabelProp, color: colorProp, typography, slots, slotProps, ...rest }) {
|
|
80
|
+
const dp = useDefaultProps("Breadcrumbs");
|
|
81
|
+
const separator = separatorProp ?? dp.separator ?? "/";
|
|
82
|
+
const maxItems = maxItemsProp ?? dp.maxItems ?? 8;
|
|
83
|
+
const itemsBeforeCollapse = itemsBeforeCollapseProp ?? dp.itemsBeforeCollapse ?? 1;
|
|
84
|
+
const itemsAfterCollapse = itemsAfterCollapseProp ?? dp.itemsAfterCollapse ?? 1;
|
|
85
|
+
const expandLabel = expandLabelProp ?? dp.expandLabel;
|
|
86
|
+
const color = colorProp ?? dp.color ?? "secondary";
|
|
87
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
88
|
+
const listRef = useRef(null);
|
|
89
|
+
const shouldFocusRef = useRef(false);
|
|
90
|
+
useLayoutEffect(() => {
|
|
91
|
+
if (!shouldFocusRef.current) return;
|
|
92
|
+
shouldFocusRef.current = false;
|
|
93
|
+
listRef.current?.querySelector("a[href],button,[tabindex]")?.focus();
|
|
94
|
+
}, [isExpanded]);
|
|
95
|
+
const crumbs = Children.toArray(children).filter(isValidElement).map((child) => /* @__PURE__ */ jsx(BreadcrumbsItem, { children: child }, child.key));
|
|
96
|
+
const isCollapsed = !isExpanded && crumbs.length > maxItems && itemsBeforeCollapse + itemsAfterCollapse < crumbs.length;
|
|
97
|
+
const CollapsedIcon = slots?.collapsedIcon;
|
|
98
|
+
const shown = isCollapsed ? [
|
|
99
|
+
...crumbs.slice(0, itemsBeforeCollapse),
|
|
100
|
+
/* @__PURE__ */ jsx(BreadcrumbsItem, { children: /* @__PURE__ */ jsx(BreadcrumbsCollapsed, {
|
|
101
|
+
type: "button",
|
|
102
|
+
"aria-label": expandLabel,
|
|
103
|
+
onClick: () => {
|
|
104
|
+
shouldFocusRef.current = true;
|
|
105
|
+
setIsExpanded(true);
|
|
106
|
+
},
|
|
107
|
+
children: /* @__PURE__ */ jsx(BreadcrumbsCollapsedIcon, { children: CollapsedIcon ? /* @__PURE__ */ jsx(CollapsedIcon, { ...slotProps?.collapsedIcon }) : /* @__PURE__ */ jsx(Icon, {
|
|
108
|
+
name: "more_horiz",
|
|
109
|
+
size: "sm",
|
|
110
|
+
color: "inherit",
|
|
111
|
+
...slotProps?.collapsedIcon
|
|
112
|
+
}) })
|
|
113
|
+
}) }, "collapsed"),
|
|
114
|
+
...crumbs.slice(crumbs.length - itemsAfterCollapse)
|
|
115
|
+
] : crumbs;
|
|
116
|
+
return /* @__PURE__ */ jsx(BreadcrumbsRoot, {
|
|
117
|
+
as,
|
|
118
|
+
color,
|
|
119
|
+
variant: typography,
|
|
120
|
+
...rest,
|
|
121
|
+
children: /* @__PURE__ */ jsx(BreadcrumbsList, {
|
|
122
|
+
ref: listRef,
|
|
123
|
+
children: shown.flatMap((crumb, index) => index === 0 ? [crumb] : [/* @__PURE__ */ jsx(BreadcrumbsSeparator, {
|
|
124
|
+
"aria-hidden": true,
|
|
125
|
+
children: separator
|
|
126
|
+
}, `separator-${crumb.key}`), crumb])
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Breadcrumbs };
|
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-BxXuXRgQ.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-DAwcmIjN.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-CG_1uPrD.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-Z9_QludW.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-CQfJZADG.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-BrgwkY6z.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-
|
|
5
|
-
const require_Paper = require("./Paper.cjs");
|
|
4
|
+
const require_theme = require("./theme-BxXuXRgQ.cjs");
|
|
6
5
|
const require_Typography = require("./Typography.cjs");
|
|
7
|
-
const require_Icon = require("./Icon-
|
|
6
|
+
const require_Icon = require("./Icon-D-EWsBVg.cjs");
|
|
7
|
+
const require_Paper = require("./Paper.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,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as TypographyProps } from "./index-
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { Kt as PaperProps } from "./index-DJ0f69wh.cjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-K5exjvnX.cjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-Dv_fk1_F.cjs";
|
|
4
|
+
import "./index-BxVTIMnB.cjs";
|
|
4
5
|
import { ReactNode } from "react";
|
|
5
6
|
//#region src/Card/Card.d.ts
|
|
6
7
|
type CardVariant = 'paper' | 'bracketBox' | 'interactive';
|
package/dist/Card.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as TypographyProps } from "./index-
|
|
3
|
-
import { n as IconProps, r as IconName } from "./index-
|
|
1
|
+
import { Kt as PaperProps } from "./index-CJhK7JND.mjs";
|
|
2
|
+
import { a as TypographyProps } from "./index-ClZyaZrR.mjs";
|
|
3
|
+
import { n as IconProps, r as IconName } from "./index-ha1WjSZ5.mjs";
|
|
4
|
+
import "./index-DaIIo5QU.mjs";
|
|
4
5
|
import { ReactNode } from "react";
|
|
5
6
|
//#region src/Card/Card.d.ts
|
|
6
7
|
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-
|
|
4
|
-
import { Paper } from "./Paper.mjs";
|
|
3
|
+
import { n as useDefaultProps, r as useTheme } from "./theme-Z9_QludW.mjs";
|
|
5
4
|
import { Typography } from "./Typography.mjs";
|
|
6
|
-
import { t as Icon } from "./Icon-
|
|
5
|
+
import { t as Icon } from "./Icon-BihOAP4u.mjs";
|
|
6
|
+
import { Paper } from "./Paper.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,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-DBUwu65Z.cjs";
|
|
1
|
+
import { P as PaletteColor, W as Theme } from "./index-DJ0f69wh.cjs";
|
|
3
2
|
import { ChangeEvent, ReactNode } from "react";
|
|
4
3
|
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
5
4
|
//#region src/Checkbox/Checkbox.d.ts
|
package/dist/Checkbox.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-C1WqEDtQ.mjs";
|
|
1
|
+
import { P as PaletteColor, W as Theme } from "./index-CJhK7JND.mjs";
|
|
3
2
|
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
4
3
|
import { ChangeEvent, ReactNode } from "react";
|
|
5
4
|
//#region src/Checkbox/Checkbox.d.ts
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as ButtonColor } from "./index-BhibLnZ0.cjs";
|
|
1
|
+
import { W as Theme } from "./index-DJ0f69wh.cjs";
|
|
2
|
+
import { n as ButtonColor } from "./index-DAwcmIjN.cjs";
|
|
4
3
|
import { HTMLAttributes } from "react";
|
|
5
4
|
import { LayoutProps, PaddingProps, SpaceProps } from "@soroush.tech/styled-system";
|
|
6
5
|
//#region src/CircularProgress/CircularProgress.d.ts
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { n as ButtonColor } from "./index-DXvQ-JVZ.mjs";
|
|
1
|
+
import { W as Theme } from "./index-CJhK7JND.mjs";
|
|
2
|
+
import { n as ButtonColor } from "./index-CG_1uPrD.mjs";
|
|
4
3
|
import { LayoutProps, PaddingProps, SpaceProps } from "@soroush.tech/styled-system";
|
|
5
4
|
import { HTMLAttributes } from "react";
|
|
6
5
|
//#region src/CircularProgress/CircularProgress.d.ts
|
package/dist/Drawer.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Gt as PaperElevation } from "./index-DJ0f69wh.cjs";
|
|
2
|
+
import { i as ButtonProps } from "./index-DAwcmIjN.cjs";
|
|
3
|
+
import "./index-BxVTIMnB.cjs";
|
|
3
4
|
import { ReactNode } from "react";
|
|
4
5
|
//#region src/Drawer/Drawer.d.ts
|
|
5
6
|
type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
|
package/dist/Drawer.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Gt as PaperElevation } from "./index-CJhK7JND.mjs";
|
|
2
|
+
import { i as ButtonProps } from "./index-CG_1uPrD.mjs";
|
|
3
|
+
import "./index-DaIIo5QU.mjs";
|
|
3
4
|
import { ReactNode } from "react";
|
|
4
5
|
//#region src/Drawer/Drawer.d.ts
|
|
5
6
|
type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
|
package/dist/Flex.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jt as FlexProps, Yt as GapToken, qt as Flex } from "./index-DJ0f69wh.cjs";
|
|
2
2
|
export { Flex, FlexProps, GapToken };
|