@soroush.tech/design-system 2.0.0-rc.2 → 2.0.0-rc.4
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 +66 -40
- package/dist/Accordion/Accordion.cjs +100 -0
- package/dist/Accordion/Accordion.d.cts +41 -0
- package/dist/Accordion/Accordion.d.mts +41 -0
- package/dist/Accordion/Accordion.mjs +98 -0
- package/dist/Accordion/AccordionActions.cjs +29 -0
- package/dist/Accordion/AccordionActions.d.cts +12 -0
- package/dist/Accordion/AccordionActions.d.mts +12 -0
- package/dist/Accordion/AccordionActions.mjs +27 -0
- package/dist/Accordion/AccordionDetails.cjs +23 -0
- package/dist/Accordion/AccordionDetails.d.cts +12 -0
- package/dist/Accordion/AccordionDetails.d.mts +12 -0
- package/dist/Accordion/AccordionDetails.mjs +21 -0
- package/dist/Accordion/AccordionGroup.cjs +79 -0
- package/dist/Accordion/AccordionGroup.d.cts +24 -0
- package/dist/Accordion/AccordionGroup.d.mts +24 -0
- package/dist/Accordion/AccordionGroup.mjs +77 -0
- package/dist/Accordion/AccordionSummary.cjs +99 -0
- package/dist/Accordion/AccordionSummary.d.cts +21 -0
- package/dist/Accordion/AccordionSummary.d.mts +21 -0
- package/dist/Accordion/AccordionSummary.mjs +97 -0
- package/dist/Accordion.cjs +11 -0
- package/dist/Accordion.d.cts +6 -0
- package/dist/Accordion.d.mts +6 -0
- package/dist/Accordion.mjs +6 -0
- package/dist/AccordionContext-B2TCl9Os.cjs +44 -0
- package/dist/AccordionContext-DDk_i9Dx.mjs +15 -0
- package/dist/Alert/Alert.cjs +154 -0
- package/dist/Alert/Alert.d.cts +37 -0
- package/dist/Alert/Alert.d.mts +37 -0
- package/dist/Alert/Alert.mjs +152 -0
- package/dist/Alert/AlertTitle.cjs +21 -0
- package/dist/Alert/AlertTitle.d.cts +12 -0
- package/dist/Alert/AlertTitle.d.mts +12 -0
- package/dist/Alert/AlertTitle.mjs +20 -0
- package/dist/Alert.cjs +5 -0
- package/dist/Alert.d.cts +3 -0
- package/dist/Alert.d.mts +3 -0
- package/dist/Alert.mjs +3 -0
- package/dist/AppBar.cjs +1 -1
- package/dist/AppBar.d.cts +1 -1
- package/dist/AppBar.d.mts +1 -1
- package/dist/AppBar.mjs +1 -1
- package/dist/Autocomplete.cjs +666 -0
- package/dist/Autocomplete.d.cts +97 -0
- package/dist/Autocomplete.d.mts +97 -0
- package/dist/Autocomplete.mjs +664 -0
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.d.cts +1 -1
- package/dist/Avatar.d.mts +1 -1
- package/dist/Avatar.mjs +2 -2
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Badge.cjs +130 -0
- package/dist/Badge.d.cts +45 -0
- package/dist/Badge.d.mts +45 -0
- package/dist/Badge.mjs +128 -0
- package/dist/Breadcrumbs.cjs +2 -2
- package/dist/Breadcrumbs.d.cts +3 -3
- package/dist/Breadcrumbs.d.mts +3 -3
- package/dist/Breadcrumbs.mjs +2 -2
- package/dist/Button.cjs +6 -3
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +6 -3
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/ButtonGroup.mjs +1 -1
- package/dist/Card.cjs +2 -2
- package/dist/Card.d.cts +4 -4
- package/dist/Card.d.mts +4 -4
- package/dist/Card.mjs +2 -2
- package/dist/Checkbox.cjs +13 -3
- package/dist/Checkbox.d.cts +4 -2
- package/dist/Checkbox.d.mts +4 -2
- package/dist/Checkbox.mjs +13 -3
- package/dist/Chip.cjs +194 -0
- package/dist/Chip.d.cts +49 -0
- package/dist/Chip.d.mts +49 -0
- package/dist/Chip.mjs +192 -0
- package/dist/CircularProgress.cjs +1 -1
- package/dist/CircularProgress.d.cts +2 -2
- package/dist/CircularProgress.d.mts +2 -2
- package/dist/CircularProgress.mjs +1 -1
- package/dist/Collapse.cjs +126 -0
- package/dist/Collapse.d.cts +2 -0
- package/dist/Collapse.d.mts +2 -0
- package/dist/Collapse.mjs +124 -0
- package/dist/Drawer.d.cts +3 -3
- package/dist/Drawer.d.mts +3 -3
- package/dist/Fab.cjs +114 -0
- package/dist/Fab.d.cts +2 -0
- package/dist/Fab.d.mts +2 -0
- package/dist/Fab.mjs +113 -0
- package/dist/FabMenu/FabMenu.cjs +3 -0
- package/dist/FabMenu/FabMenu.d.cts +53 -0
- package/dist/FabMenu/FabMenu.d.mts +53 -0
- package/dist/FabMenu/FabMenu.mjs +2 -0
- package/dist/FabMenu/FabMenuItem.cjs +28 -0
- package/dist/FabMenu/FabMenuItem.d.cts +19 -0
- package/dist/FabMenu/FabMenuItem.d.mts +19 -0
- package/dist/FabMenu/FabMenuItem.mjs +27 -0
- package/dist/FabMenu-BDfkT_zt.mjs +273 -0
- package/dist/FabMenu-RiVtzrKe.cjs +279 -0
- package/dist/FabMenu.cjs +5 -0
- package/dist/FabMenu.d.cts +3 -0
- package/dist/FabMenu.d.mts +3 -0
- package/dist/FabMenu.mjs +3 -0
- package/dist/FabMenuContext-BZslb0lL.cjs +22 -0
- package/dist/FabMenuContext-D-XlDbLl.mjs +11 -0
- package/dist/Fade.cjs +17 -0
- package/dist/Fade.d.cts +11 -0
- package/dist/Fade.d.mts +11 -0
- package/dist/Fade.mjs +16 -0
- 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 +14 -4
- package/dist/FormControl.d.cts +9 -1
- package/dist/FormControl.d.mts +9 -1
- package/dist/FormControl.mjs +14 -4
- package/dist/FormHelperText.cjs +1 -1
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormHelperText.mjs +1 -1
- package/dist/FormLabel.cjs +13 -2
- package/dist/FormLabel.d.cts +2 -2
- package/dist/FormLabel.d.mts +2 -2
- package/dist/FormLabel.mjs +14 -3
- package/dist/Grid.d.cts +1 -1
- package/dist/Grid.d.mts +1 -1
- package/dist/Grow.cjs +21 -0
- package/dist/Grow.d.cts +11 -0
- package/dist/Grow.d.mts +11 -0
- package/dist/Grow.mjs +20 -0
- package/dist/{Icon-DlheCTJb.mjs → Icon-0hPpk-WZ.mjs} +71 -1
- package/dist/{Icon-Cvuhp9ek.cjs → Icon-BE7bRsqR.cjs} +71 -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 +1 -1
- package/dist/Image.d.mts +1 -1
- package/dist/LinearProgress.cjs +1 -1
- package/dist/LinearProgress.d.cts +2 -2
- package/dist/LinearProgress.d.mts +2 -2
- package/dist/LinearProgress.mjs +1 -1
- package/dist/Link.cjs +3 -3
- package/dist/Link.d.cts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/Link.mjs +3 -3
- package/dist/Menu/ContextMenu.cjs +6 -4
- package/dist/Menu/ContextMenu.d.cts +8 -6
- package/dist/Menu/ContextMenu.d.mts +8 -6
- package/dist/Menu/ContextMenu.mjs +6 -4
- package/dist/Menu/Menu.cjs +1 -1
- package/dist/Menu/Menu.d.cts +1 -1
- package/dist/Menu/Menu.d.mts +1 -1
- package/dist/Menu/Menu.mjs +1 -1
- package/dist/Menu/MenuItems.cjs +1 -1
- package/dist/Menu/MenuItems.d.cts +1 -1
- package/dist/Menu/MenuItems.d.mts +1 -1
- package/dist/Menu/MenuItems.mjs +1 -1
- package/dist/Menu/MenuList.cjs +1 -1
- package/dist/Menu/MenuList.d.cts +2 -2
- package/dist/Menu/MenuList.d.mts +2 -2
- package/dist/Menu/MenuList.mjs +1 -1
- package/dist/{Menu-tECbAEFj.mjs → Menu-CnG4ikZd.mjs} +7 -4
- package/dist/{Menu-BkKPTOfh.cjs → Menu-DXLjR9ga.cjs} +8 -5
- package/dist/Menu.cjs +2 -2
- package/dist/Menu.d.cts +3 -3
- package/dist/Menu.d.mts +3 -3
- package/dist/Menu.mjs +2 -2
- package/dist/{MenuItem-BR7ingQx.mjs → MenuItem-C21eR7d6.mjs} +42 -86
- package/dist/{MenuItem-CfdN4axw.cjs → MenuItem-EJ4u73f0.cjs} +42 -92
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.d.cts +1 -1
- package/dist/MenuItem.d.mts +1 -1
- package/dist/MenuItem.mjs +1 -1
- package/dist/{MenuList-D4imLXAa.cjs → MenuList-BBAYeUvD.cjs} +1 -1
- package/dist/{MenuList-B7msJ1IG.mjs → MenuList-Cz3cupC3.mjs} +1 -1
- package/dist/{MenuListContext-Dml16k0X.d.mts → MenuListContext-BWL5fM_L.d.mts} +2 -2
- package/dist/{MenuListContext-vujGcRk9.d.cts → MenuListContext-BrCKLgKZ.d.cts} +2 -2
- package/dist/{Modal-BcsyrrpH.mjs → Modal-CEHDej-v.mjs} +3 -22
- package/dist/{Modal-CM3osOqj.cjs → Modal-DBw4j0YA.cjs} +3 -22
- 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 +15 -18
- package/dist/NativeSelect.d.cts +3 -3
- package/dist/NativeSelect.d.mts +3 -3
- package/dist/NativeSelect.mjs +15 -18
- package/dist/NumberInput.cjs +502 -0
- package/dist/NumberInput.d.cts +79 -0
- package/dist/NumberInput.d.mts +79 -0
- package/dist/NumberInput.mjs +500 -0
- package/dist/Pagination/PaginationItem.cjs +2 -2
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +2 -2
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +2 -2
- package/dist/Paper.d.cts +2 -2
- package/dist/Paper.d.mts +2 -2
- package/dist/Paper.mjs +2 -2
- package/dist/{Popover-QjM5Z1CR.mjs → Popover-Neeqs_7l.mjs} +3 -3
- package/dist/{Popover-CiZfgiKE.cjs → Popover-xyJTSjZy.cjs} +3 -3
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +3 -3
- package/dist/Popover.d.mts +3 -3
- package/dist/Popover.mjs +1 -1
- package/dist/Portal.d.cts +1 -17
- package/dist/Portal.d.mts +1 -17
- package/dist/Pressable.cjs +17 -13
- package/dist/Pressable.d.cts +1 -1
- package/dist/Pressable.d.mts +1 -1
- package/dist/Pressable.mjs +17 -13
- package/dist/Quote.d.cts +2 -2
- package/dist/Quote.d.mts +2 -2
- package/dist/Radio.cjs +13 -3
- package/dist/Radio.d.cts +4 -2
- package/dist/Radio.d.mts +4 -2
- package/dist/Radio.mjs +13 -3
- package/dist/RangeInput.cjs +677 -0
- package/dist/RangeInput.d.cts +79 -0
- package/dist/RangeInput.d.mts +79 -0
- package/dist/RangeInput.mjs +675 -0
- 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/ScrollArea.cjs +268 -0
- package/dist/ScrollArea.d.cts +40 -0
- package/dist/ScrollArea.d.mts +40 -0
- package/dist/ScrollArea.mjs +266 -0
- package/dist/Select.cjs +11 -13
- package/dist/Select.d.cts +3 -3
- package/dist/Select.d.mts +3 -3
- package/dist/Select.mjs +13 -15
- package/dist/Sidebar/Sidebar.d.cts +1 -1
- package/dist/Sidebar/Sidebar.d.mts +1 -1
- package/dist/Sidebar/SidebarItem.cjs +2 -2
- package/dist/Sidebar/SidebarItem.d.cts +3 -3
- package/dist/Sidebar/SidebarItem.d.mts +3 -3
- package/dist/Sidebar/SidebarItem.mjs +4 -4
- package/dist/Skeleton.d.cts +1 -1
- package/dist/Skeleton.d.mts +1 -1
- package/dist/Slide.cjs +51 -0
- package/dist/Slide.d.cts +17 -0
- package/dist/Slide.d.mts +17 -0
- package/dist/Slide.mjs +50 -0
- package/dist/Snackbar.cjs +205 -0
- package/dist/Snackbar.d.cts +62 -0
- package/dist/Snackbar.d.mts +62 -0
- package/dist/Snackbar.mjs +203 -0
- package/dist/Switch.cjs +35 -18
- package/dist/Switch.d.cts +4 -2
- package/dist/Switch.d.mts +4 -2
- package/dist/Switch.mjs +37 -20
- package/dist/Table/Table.d.cts +2 -2
- package/dist/Table/Table.d.mts +2 -2
- package/dist/Table/TableBody.d.cts +1 -1
- package/dist/Table/TableBody.d.mts +1 -1
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +1 -1
- package/dist/Table/TableContainer.d.mts +1 -1
- 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 -1
- package/dist/Table/TableFooter.d.mts +1 -1
- package/dist/Table/TableHead.d.cts +1 -1
- package/dist/Table/TableHead.d.mts +1 -1
- package/dist/Table/TablePagination.cjs +1 -0
- package/dist/Table/TablePagination.d.cts +2 -2
- package/dist/Table/TablePagination.d.mts +2 -2
- package/dist/Table/TablePagination.mjs +1 -0
- 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 -1
- package/dist/Table/TableRow.d.mts +1 -1
- 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-6PgGpUzM.d.mts → TableContext-Be8tluYZ.d.cts} +1 -1
- package/dist/{TableContext-CBGk-Lh8.d.cts → TableContext-DUPqls5k.d.mts} +1 -1
- package/dist/Tabs/Tab.cjs +16 -7
- package/dist/Tabs/Tab.d.cts +2 -2
- package/dist/Tabs/Tab.d.mts +2 -2
- package/dist/Tabs/Tab.mjs +16 -7
- package/dist/Tabs/TabContext.d.cts +1 -1
- package/dist/Tabs/TabContext.d.mts +1 -1
- package/dist/Tabs/TabList.cjs +1 -1
- package/dist/Tabs/TabList.d.cts +1 -1
- package/dist/Tabs/TabList.d.mts +1 -1
- package/dist/Tabs/TabList.mjs +1 -1
- package/dist/Tabs/TabPanel.cjs +1 -1
- package/dist/Tabs/TabPanel.d.cts +2 -2
- package/dist/Tabs/TabPanel.d.mts +2 -2
- package/dist/Tabs/TabPanel.mjs +1 -1
- package/dist/Tabs/TabScrollButton.cjs +2 -2
- package/dist/Tabs/TabScrollButton.d.cts +1 -1
- package/dist/Tabs/TabScrollButton.d.mts +1 -1
- package/dist/Tabs/TabScrollButton.mjs +2 -2
- package/dist/Tabs/Tabs.cjs +1 -1
- package/dist/Tabs/Tabs.d.cts +2 -2
- package/dist/Tabs/Tabs.d.mts +2 -2
- package/dist/Tabs/Tabs.mjs +1 -1
- package/dist/{Tabs-D_wkX-Jb.cjs → Tabs-Croeq9s2.cjs} +15 -10
- package/dist/{Tabs-YfCUbkQV.mjs → Tabs-DMMP5aDj.mjs} +12 -7
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.d.cts +3 -3
- package/dist/Tabs.d.mts +3 -3
- package/dist/Tabs.mjs +1 -1
- package/dist/{TabsContext-C2agsLBN.d.cts → TabsContext-BYeGjSZK.d.cts} +1 -1
- package/dist/{TabsContext-DqyxdmGW.d.mts → TabsContext-D4YumTfD.d.mts} +1 -1
- package/dist/TextInput.cjs +14 -14
- package/dist/TextInput.d.cts +2 -2
- package/dist/TextInput.d.mts +2 -2
- package/dist/TextInput.mjs +14 -14
- package/dist/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +2 -2
- 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/Tooltip.cjs +270 -0
- package/dist/Tooltip.d.cts +78 -0
- package/dist/Tooltip.d.mts +78 -0
- package/dist/Tooltip.mjs +268 -0
- package/dist/TransferList.cjs +363 -0
- package/dist/TransferList.d.cts +69 -0
- package/dist/TransferList.d.mts +69 -0
- package/dist/TransferList.mjs +361 -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/Zoom.cjs +16 -0
- package/dist/Zoom.d.cts +10 -0
- package/dist/Zoom.d.mts +10 -0
- package/dist/Zoom.mjs +15 -0
- package/dist/catalog.cjs +1405 -45
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.mts +1 -1
- package/dist/catalog.mjs +1405 -45
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.mts +1 -1
- package/dist/getAnchorRel-CySI28HJ.mjs +8 -0
- package/dist/getAnchorRel-_vtAXC-4.cjs +13 -0
- package/dist/getShapeRadius-B9ytqDSk.d.cts +5 -0
- package/dist/getShapeRadius-B9ytqDSk.d.mts +5 -0
- package/dist/getShapeRadius-sY6-AGP4.mjs +12 -0
- package/dist/getShapeRadius-vXmXGV3f.cjs +17 -0
- package/dist/getSurfaceRadius-BTUV1E8H.cjs +11 -0
- package/dist/getSurfaceRadius-DTgqIzll.mjs +6 -0
- package/dist/getTooltipOrigins-B_7XXtQq.cjs +104 -0
- package/dist/getTooltipOrigins-CyyIMCF1.mjs +87 -0
- package/dist/{index-qlfNErNd.d.cts → index-05VGk0y_.d.cts} +30 -2
- package/dist/{index-CrIxI8Na.d.mts → index-2x01drCL.d.mts} +2 -2
- package/dist/{index-Cj5Rhh_9.d.mts → index-46mhlgP6.d.mts} +7 -3
- package/dist/{index-BiVvxOvj.d.cts → index-BCzI2Iqo.d.cts} +2 -2
- package/dist/{index-IdMqR82e.d.cts → index-BDqIc6Gx.d.cts} +1 -1
- package/dist/{index-BSA6SKao.d.mts → index-BPh60KDs.d.mts} +1 -1
- package/dist/{index-Bxd9NOWb.d.mts → index-BQge4W7L.d.cts} +3 -3
- package/dist/{index-DCmH5f9I.d.cts → index-BSGu9rPv.d.cts} +7 -3
- package/dist/{index-Bhdn4KTy.d.cts → index-BThHG5QU.d.mts} +3 -3
- package/dist/{index-DrVYWt-X.d.mts → index-BUeqNHjb.d.cts} +3 -3
- package/dist/{index-DIC7HKpP.d.mts → index-BeqpkGV-.d.mts} +1 -1
- package/dist/{index-DqjXDutI.d.mts → index-Bfyz3MDc.d.mts} +1 -1
- package/dist/{index-BlLH6rlE.d.cts → index-BgLqA52S.d.cts} +2 -2
- package/dist/{index-DDJuUfL5.d.cts → index-BhnLFsBv.d.cts} +1 -1
- package/dist/{index-gnh-Oe0n.d.cts → index-BitQk7Hx.d.cts} +1 -1
- package/dist/index-BvgX5eyV.d.mts +36 -0
- package/dist/index-CERyXFjz.d.cts +32 -0
- package/dist/index-CLvlNnjM.d.mts +32 -0
- package/dist/{index-C3KrFPCj.d.mts → index-CO-XxjiZ.d.cts} +2 -2
- package/dist/{index-DXhMkjQ6.d.cts → index-CR0akDlJ.d.cts} +2 -2
- package/dist/{index-CVNJEUwJ.d.mts → index-CRQ7XLri.d.mts} +234 -6
- package/dist/{index-DQcnJ5H4.d.cts → index-CRn4fWwA.d.mts} +2 -2
- package/dist/{index-BCnKYNlZ.d.cts → index-CWPvdEjP.d.mts} +3 -3
- package/dist/{index-DuVNRXP4.d.cts → index-CrQDxJ1D.d.cts} +1 -1
- package/dist/index-Ctx-DKV3.d.cts +18 -0
- package/dist/index-Ctx-DKV3.d.mts +18 -0
- package/dist/{index-BjPX49XA.d.mts → index-CyLhEXYB.d.mts} +1 -1
- package/dist/{index-DeDxYlSQ.d.mts → index-D05fSuF1.d.mts} +2 -2
- package/dist/{index-XxydXX8l.d.cts → index-DK3zgGPe.d.mts} +3 -3
- package/dist/{index-BqpS_Huq.d.mts → index-DNj5P2NH.d.mts} +30 -2
- package/dist/{index-BFruxTHv.d.cts → index-DOH1xY0L.d.cts} +1 -1
- package/dist/{index-B3LIhqHR.d.cts → index-D_-DAAE7.d.mts} +14 -6
- package/dist/{index-BbgFYfX_.d.mts → index-D_LT3QiH.d.mts} +2 -2
- package/dist/index-Db4L2hwa.d.cts +36 -0
- package/dist/{index-BjfPEP_5.d.cts → index-Dk4KuTPB.d.cts} +2 -2
- package/dist/{index-CoEqjFYn.d.mts → index-Ebjbrbsk.d.cts} +14 -6
- package/dist/{index-B8DNxyEw.d.mts → index-MWUGpG-Y.d.mts} +2 -2
- package/dist/{index-DmJ7yWWi.d.cts → index-XN4-ZqTB.d.cts} +236 -8
- package/dist/index-fPRELf0V.d.mts +1 -0
- package/dist/{index-CWnbCxgw.d.cts → index-fi-W3MOz.d.cts} +7 -5
- package/dist/{index-DJCpnTH3.d.mts → index-iTquH69S.d.cts} +3 -3
- package/dist/{index-DckSub2J.d.mts → index-lGpLM144.d.mts} +7 -5
- package/dist/{index-BVPrG1L0.d.mts → index-vBCN6iAz.d.mts} +1 -1
- package/dist/index-x3WC9ViD.d.cts +1 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/inputVariantStyles-BUK_62Ra.cjs +61 -0
- package/dist/inputVariantStyles-q_cZsCJg.mjs +44 -0
- 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/{theme-BxXuXRgQ.cjs → theme-DzfwuzMZ.cjs} +1 -1
- package/dist/{theme-Z9_QludW.mjs → theme-oBfFhJm9.mjs} +1 -1
- package/dist/theme.cjs +3 -2
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.mjs +3 -3
- package/dist/{themes-gd6tcmqS.cjs → themes--4eci3M1.cjs} +25 -2
- package/dist/{themes-L-dE7_ck.mjs → themes-BwEsdVox.mjs} +20 -3
- package/dist/useAnchoredPlacement-B1FyGoZV.cjs +111 -0
- package/dist/useAnchoredPlacement-Pe7sY41E.mjs +106 -0
- package/dist/useControlled-C666KpQ0.cjs +18 -0
- package/dist/useControlled-CBRLsO-H.mjs +13 -0
- package/dist/useMergedRefs-2zTDXgPO.cjs +27 -0
- package/dist/useMergedRefs-BfBckwRY.mjs +22 -0
- package/dist/{useTablePagination-C5VKtqDp.d.cts → useTablePagination-CFb_FYA9.d.cts} +1 -1
- package/dist/{useTablePagination-C6LSlt3w.d.mts → useTablePagination-_-bzuXJO.d.mts} +1 -1
- package/dist/useTransition-C1F7MuHO.d.mts +42 -0
- package/dist/useTransition-DAQd1PX3.cjs +83 -0
- package/dist/useTransition-DP1k0irI.mjs +78 -0
- package/dist/useTransition-l9dv83-Y.d.cts +42 -0
- package/dist/useTransitionChild-CikpU0Yh.cjs +54 -0
- package/dist/useTransitionChild-Dvg9hO-F.mjs +49 -0
- package/package.json +194 -4
- package/dist/index-DBteSahY.d.cts +0 -1
- package/dist/index-_G1osn09.d.mts +0 -1
- package/dist/inputVariantStyles-BBkkYQtE.cjs +0 -32
- package/dist/inputVariantStyles-CcqpGfuP.mjs +0 -28
package/README.md
CHANGED
|
@@ -91,22 +91,27 @@ import { catalog } from '@soroush.tech/design-system/catalog'
|
|
|
91
91
|
|
|
92
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.
|
|
93
93
|
|
|
94
|
+
Under a strict Content Security Policy, bring your own cache with the response's nonce - `createCache({ key: 'app', nonce })` from `@emotion/cache`, given to `CacheProvider` above `ThemeProvider` - and every style tag the engine inserts carries it. The shipped `styleCache` has no nonce.
|
|
95
|
+
|
|
96
|
+
The Emotion packages are regular dependencies of this package, not peers, on purpose: nothing of Emotion is on the public surface, so an app installs nothing extra and has no version to keep in step. An app that brings its own `@emotion/react` of another major gets two copies - the components keep working, as they style through their own copy and `ThemeProvider` - at the cost of the duplicate in the bundle and Emotion's one-time development warning.
|
|
97
|
+
|
|
94
98
|
---
|
|
95
99
|
|
|
96
100
|
## Component inventory
|
|
97
101
|
|
|
98
102
|
### Layout & surfaces
|
|
99
103
|
|
|
100
|
-
| Component
|
|
101
|
-
|
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
104
|
+
| Component | Purpose |
|
|
105
|
+
| ------------ | ----------------------------------------------------------------------- |
|
|
106
|
+
| `ScrollArea` | A scrolling area with scrollbars drawn over its content, shown on hover |
|
|
107
|
+
| `View` | Styled `div` primitive - the base building block |
|
|
108
|
+
| `Flex` | `View` with flexbox defaults |
|
|
109
|
+
| `Grid` | CSS grid container |
|
|
110
|
+
| `Paper` | Elevated surface with background and shadow |
|
|
111
|
+
| `Card` | Content container built on `Paper` |
|
|
112
|
+
| `Quote` | Bordered quote / terminal-panel surface on `View` |
|
|
113
|
+
| `AppBar` | Top application bar |
|
|
114
|
+
| `Drawer` | Slide-in side panel |
|
|
110
115
|
|
|
111
116
|
### Content & data display
|
|
112
117
|
|
|
@@ -118,19 +123,26 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
118
123
|
| `Image` | Image with styled-system props |
|
|
119
124
|
| `Avatar` | User/entity avatar |
|
|
120
125
|
| `Table` | Compound data table - exports `TableContainer`, `TableHead`, `TableBody`, `TableFooter`, `TableRow`, `TableCell`, `TablePagination`, `TablePaginationActions`, `TableSortLabel`, and `TableControl` from `@soroush.tech/design-system/Table` |
|
|
126
|
+
| `Accordion` | A heading that opens and closes a region - exports `AccordionSummary`, `AccordionDetails`, `AccordionActions` and `AccordionGroup` from `@soroush.tech/design-system/Accordion` |
|
|
121
127
|
|
|
122
128
|
### Inputs & forms
|
|
123
129
|
|
|
124
|
-
| Component | Purpose
|
|
125
|
-
| ---------------------------------------------------- |
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
130
|
+
| Component | Purpose |
|
|
131
|
+
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
132
|
+
| `Autocomplete` | A field whose text finds an option in a list - one, several as chips, or free text |
|
|
133
|
+
| `Fab` | A floating action button: the one main action of a page, circular or extended |
|
|
134
|
+
| `Button`, `ButtonGroup`, `ToggleButton` | Actions and toggles |
|
|
135
|
+
| `TextInput` | Text field |
|
|
136
|
+
| `Checkbox`, `Radio`, `Switch` | Selection controls |
|
|
137
|
+
| `RangeInput` | A slider - one value on a range, or two or more thumbs for a range of values |
|
|
138
|
+
| `TransferList` | Two lists and the buttons that move the checked items from one to the other |
|
|
139
|
+
| `NumberInput` | A field for a number - read in its locale, clamped to a range, stepped by keys or buttons |
|
|
140
|
+
| `Rating` | A row of icons the user sets as a rating, or a read-only display of one |
|
|
141
|
+
| `NativeSelect` | Low-level platform `<select>` - not recommended; use `Select native` |
|
|
142
|
+
| `Select` | The select to use - custom listbox, or `native` for the platform picker |
|
|
143
|
+
| `MenuItem` | Option row for `Select`'s listbox, and a menu row in a `MenuList` |
|
|
144
|
+
| `Form`, `FormControl`, `FormLabel`, `FormHelperText` | Form composition and labeling |
|
|
145
|
+
| `Pagination` | Page navigation control |
|
|
134
146
|
|
|
135
147
|
### Navigation & menus
|
|
136
148
|
|
|
@@ -142,21 +154,34 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
142
154
|
|
|
143
155
|
### Feedback
|
|
144
156
|
|
|
145
|
-
| Component | Purpose
|
|
146
|
-
| ------------------------------------ |
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
157
|
+
| Component | Purpose |
|
|
158
|
+
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
+
| `FabMenu` | A fab that opens a stack of actions from the corner of a page |
|
|
160
|
+
| `Snackbar` | A transient message in a corner of the window, with auto-hide and an action |
|
|
161
|
+
| `Alert` | An inline message with a severity, an icon, a title and an action - exports `AlertTitle` from `@soroush.tech/design-system/Alert` |
|
|
162
|
+
| `Badge` | A count or a dot anchored over another element |
|
|
163
|
+
| `Chip` | A compact tag: a label, an icon or avatar, a click and a delete |
|
|
164
|
+
| `CircularProgress`, `LinearProgress` | Determinate/indeterminate progress indicators |
|
|
165
|
+
| `Skeleton` | Loading placeholder with pulse/wave animations |
|
|
166
|
+
| `Backdrop` | Dimmed overlay behind modal surfaces |
|
|
167
|
+
|
|
168
|
+
### Transitions
|
|
169
|
+
|
|
170
|
+
| Component | Purpose |
|
|
171
|
+
| ------------------------------- | ------------------------------------------------------------------ |
|
|
172
|
+
| `Collapse` | Opens and closes its content by its height, or its width |
|
|
173
|
+
| `Fade`, `Grow`, `Slide`, `Zoom` | Show and hide one child by opacity, scale, an edge or from nothing |
|
|
150
174
|
|
|
151
175
|
### Overlay & behavior primitives
|
|
152
176
|
|
|
153
|
-
| Component | Purpose
|
|
154
|
-
| --------------- |
|
|
155
|
-
| `
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
177
|
+
| Component | Purpose |
|
|
178
|
+
| --------------- | ----------------------------------------------------------------------------------- |
|
|
179
|
+
| `Tooltip` | A short description of one element, shown on hover, keyboard focus and a long touch |
|
|
180
|
+
| `Portal` | Renders children into a DOM node outside the parent hierarchy |
|
|
181
|
+
| `FocusTrap` | Keeps focus inside a subtree |
|
|
182
|
+
| `Modal` | Dialog primitive composing `Portal`, `Backdrop`, and `FocusTrap` |
|
|
183
|
+
| `Popover` | Anchored floating surface built on `Modal` |
|
|
184
|
+
| `ThemeProvider` | Supplies the theme and global styles to the app |
|
|
160
185
|
|
|
161
186
|
---
|
|
162
187
|
|
|
@@ -164,14 +189,14 @@ SSR critical-CSS extraction (e.g. with `@emotion/server`) is a separate, opt-in
|
|
|
164
189
|
|
|
165
190
|
Components never hardcode colors or sizes - props resolve against scales on the `Theme` object:
|
|
166
191
|
|
|
167
|
-
| Group | Scales
|
|
168
|
-
| ------------------ |
|
|
169
|
-
| Color | `palette` (main/light/dark/contrastText per color) · `text` · `background` · `border` · `colorScheme`
|
|
170
|
-
| Typography | `typography` (variant map) · `fonts` · `fontSizes` · `fontWeights` · `lineHeights` · `letterSpacings`
|
|
171
|
-
| Space & shape | `space` · `sizes` · `radii` · `borderWidths` · `shadows`
|
|
172
|
-
| Layout | `breakpoints` (xs/sm/md/lg/xl window classes) · `layout` (columns, margins, panels, top bar per class)
|
|
173
|
-
| Component scales | `avatar` (size steps) · `skeleton` (wave highlight)
|
|
174
|
-
| Layering & effects | `zOrder` (appBar/drawer/modal) · `blur` · `logoFilter` · `portraitBlend` · `portraitOpacity`
|
|
192
|
+
| Group | Scales |
|
|
193
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
194
|
+
| Color | `palette` (main/light/dark/contrastText per color) · `text` · `background` · `border` · `colorScheme` |
|
|
195
|
+
| Typography | `typography` (variant map) · `fonts` · `fontSizes` · `fontWeights` · `lineHeights` · `letterSpacings` |
|
|
196
|
+
| Space & shape | `space` · `sizes` · `radii` · `borderWidths` · `shadows` |
|
|
197
|
+
| Layout | `breakpoints` (xs/sm/md/lg/xl window classes) · `layout` (columns, margins, panels, top bar per class) |
|
|
198
|
+
| Component scales | `avatar` (size steps) · `skeleton` (wave highlight) |
|
|
199
|
+
| Layering & effects | `zOrder` (appBar/drawer/modal/snackbar/tooltip) · `blur` · `logoFilter` · `portraitBlend` · `portraitOpacity` |
|
|
175
200
|
|
|
176
201
|
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.
|
|
177
202
|
|
|
@@ -229,6 +254,7 @@ Components carry visible literal fallbacks (`size = 'md'`, `variant = 'outside'`
|
|
|
229
254
|
| `borderRadius` / `surfaceRadius` | `'md'` / `'sq'` | grouped controls / surfaces |
|
|
230
255
|
| `avatarSize` / `borderColor` / `borderWidth` | `'md'` / `'primary'` / `'thin'` | avatars and rings |
|
|
231
256
|
| `iconSize` | `'lg'` | Icon default glyph size (`theme.icon`) |
|
|
257
|
+
| `inputMinWidth` | `'12rem'` | least width of an input not full width |
|
|
232
258
|
| `buttonVariant` / `switchVariant` | `'contained'` / `'outside'` | Button / Switch visual variants |
|
|
233
259
|
| `inputVariant` | `'default'` | TextInput, Select, NativeSelect frames |
|
|
234
260
|
| `avatarVariant` / `cardVariant` | `'circular'` / `'paper'` | Avatar shape / Card treatment |
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("../src-DU81aGy9.cjs");
|
|
3
|
+
const require_theme = require("../theme-DzfwuzMZ.cjs");
|
|
4
|
+
const require_themeDefault = require("../themeDefault-Cebi08Cv.cjs");
|
|
5
|
+
const require_getSurfaceRadius = require("../getSurfaceRadius-BTUV1E8H.cjs");
|
|
6
|
+
const require_Collapse = require("../Collapse.cjs");
|
|
7
|
+
const require_useControlled = require("../useControlled-C666KpQ0.cjs");
|
|
8
|
+
const require_AccordionContext = require("../AccordionContext-B2TCl9Os.cjs");
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
12
|
+
//#region src/Accordion/Accordion/Accordion.tsx
|
|
13
|
+
const AccordionRoot = require_src.styled("div", {
|
|
14
|
+
name: "Accordion",
|
|
15
|
+
label: "Accordion",
|
|
16
|
+
shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
|
|
17
|
+
..._soroush_tech_styled_system_should_forward_prop.props,
|
|
18
|
+
"borderRadius",
|
|
19
|
+
"bg",
|
|
20
|
+
"textColor"
|
|
21
|
+
]),
|
|
22
|
+
systemProps: [require_src.src_exports.space]
|
|
23
|
+
})(({ theme, borderRadius, bg, textColor }) => ({
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
backgroundColor: (0, require_src.src_exports.get)(theme, `background.${bg ?? require_themeDefault.themeDefault(theme, "surfaceBg", "paper")}`),
|
|
26
|
+
color: (0, require_src.src_exports.get)(theme, `text.${textColor ?? require_themeDefault.themeDefault(theme, "textColor", "initial")}`),
|
|
27
|
+
border: `${theme.borderWidths.thin} solid ${(0, require_src.src_exports.get)(theme, "border.default")}`,
|
|
28
|
+
borderRadius: require_getSurfaceRadius.getSurfaceRadius(theme, borderRadius)
|
|
29
|
+
}));
|
|
30
|
+
const AccordionRegion = require_src.styled("div", {
|
|
31
|
+
name: "Accordion",
|
|
32
|
+
slot: "region",
|
|
33
|
+
label: "AccordionRegion"
|
|
34
|
+
})({});
|
|
35
|
+
/**
|
|
36
|
+
* @description A heading that opens and closes a region. The first child is the
|
|
37
|
+
* `AccordionSummary`, a button in a heading; the rest is the region it opens - a
|
|
38
|
+
* `role="region"` named by the summary, which in turn `aria-expanded` and `aria-controls` it.
|
|
39
|
+
* Open or closed it owns, until `isExpanded` takes it over. In an `AccordionGroup` the arrows,
|
|
40
|
+
* Home and End move between the summaries, and the group may keep one open at a time.
|
|
41
|
+
*/
|
|
42
|
+
function Accordion({ children, isExpanded: isExpandedProp, defaultExpanded = false, onChange, disabled = false, hasGutters: hasGuttersProp, borderRadius: borderRadiusProp, bg: bgProp, textColor: textColorProp, transition: Transition = require_Collapse.Collapse, className, "data-testid": dataTestid, ...spaceProps }) {
|
|
43
|
+
const dp = require_theme.useDefaultProps("Accordion");
|
|
44
|
+
const hasGutters = hasGuttersProp ?? dp.hasGutters ?? true;
|
|
45
|
+
const borderRadius = borderRadiusProp ?? dp.borderRadius;
|
|
46
|
+
const bg = bgProp ?? dp.bg;
|
|
47
|
+
const textColor = textColorProp ?? dp.textColor;
|
|
48
|
+
const baseId = (0, react.useId)();
|
|
49
|
+
const group = (0, react.useContext)(require_AccordionContext.AccordionGroupContext);
|
|
50
|
+
const [ownExpanded, setOwnExpanded] = require_useControlled.useControlled({
|
|
51
|
+
controlled: isExpandedProp,
|
|
52
|
+
default: defaultExpanded
|
|
53
|
+
});
|
|
54
|
+
const isInGroup = group?.isExclusive && group.openId !== void 0;
|
|
55
|
+
const isExpanded = isExpandedProp ?? (isInGroup ? group.openId === baseId : ownExpanded);
|
|
56
|
+
const context = (0, react.useMemo)(() => ({
|
|
57
|
+
baseId,
|
|
58
|
+
isExpanded,
|
|
59
|
+
disabled,
|
|
60
|
+
hasGutters,
|
|
61
|
+
toggle: (event) => {
|
|
62
|
+
const next = !isExpanded;
|
|
63
|
+
setOwnExpanded(next);
|
|
64
|
+
group?.setOpenId(next ? baseId : null);
|
|
65
|
+
onChange?.(event, next);
|
|
66
|
+
}
|
|
67
|
+
}), [
|
|
68
|
+
baseId,
|
|
69
|
+
isExpanded,
|
|
70
|
+
disabled,
|
|
71
|
+
hasGutters,
|
|
72
|
+
setOwnExpanded,
|
|
73
|
+
group,
|
|
74
|
+
onChange
|
|
75
|
+
]);
|
|
76
|
+
const [summary, ...region] = react.Children.toArray(children);
|
|
77
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AccordionContext.AccordionContext.Provider, {
|
|
78
|
+
value: context,
|
|
79
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AccordionRoot, {
|
|
80
|
+
borderRadius,
|
|
81
|
+
bg,
|
|
82
|
+
textColor,
|
|
83
|
+
className,
|
|
84
|
+
"data-testid": dataTestid,
|
|
85
|
+
...spaceProps,
|
|
86
|
+
children: [summary, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Transition, {
|
|
87
|
+
isShown: isExpanded,
|
|
88
|
+
shouldAppear: false,
|
|
89
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionRegion, {
|
|
90
|
+
role: "region",
|
|
91
|
+
id: require_AccordionContext.getRegionId(baseId),
|
|
92
|
+
"aria-labelledby": require_AccordionContext.getSummaryId(baseId),
|
|
93
|
+
children: region
|
|
94
|
+
})
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
exports.Accordion = Accordion;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { nt as Theme } from "../index-XN4-ZqTB.cjs";
|
|
2
|
+
import { r as CollapseProps } from "../index-Db4L2hwa.cjs";
|
|
3
|
+
import { ComponentType, ReactNode, SyntheticEvent } from "react";
|
|
4
|
+
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
5
|
+
//#region src/Accordion/Accordion/Accordion.d.ts
|
|
6
|
+
/** What an `Accordion` hands the transition that opens and closes its region. */
|
|
7
|
+
type AccordionTransitionProps = Pick<CollapseProps, 'isShown' | 'children' | 'shouldAppear' | 'shouldMountOnEnter' | 'shouldUnmountOnExit' | 'timeout' | 'easing'>;
|
|
8
|
+
interface AccordionProps extends SpaceProps<Theme> {
|
|
9
|
+
/** An `AccordionSummary`, then what it opens - `AccordionDetails`, `AccordionActions`. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Whether it is open. Controlled with `onChange`. */
|
|
12
|
+
isExpanded?: boolean;
|
|
13
|
+
/** Whether it is open at first, when uncontrolled. Default: `false`. */
|
|
14
|
+
defaultExpanded?: boolean;
|
|
15
|
+
/** Fired when the summary is pressed, with the state it asks for. */
|
|
16
|
+
onChange?: (event: SyntheticEvent, isExpanded: boolean) => void;
|
|
17
|
+
/** Stays as it is, and its summary is off. Default: `false`. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Side padding on the summary, the details and the actions. Default: `true`. */
|
|
20
|
+
hasGutters?: boolean;
|
|
21
|
+
/** Corner radius, resolves against `theme.radii`. Default: `theme.defaults.surfaceRadius`, else square. */
|
|
22
|
+
borderRadius?: keyof Theme['radii'];
|
|
23
|
+
/** Background, resolves against `theme.background`. Default: `'paper'`. */
|
|
24
|
+
bg?: keyof Theme['background'];
|
|
25
|
+
/** Text color, resolves against `theme.text`. Default: `theme.defaults.textColor`, else `'initial'`. */
|
|
26
|
+
textColor?: keyof Theme['text'];
|
|
27
|
+
/** The transition that opens and closes the region. Default: `Collapse`. */
|
|
28
|
+
transition?: ComponentType<AccordionTransitionProps>;
|
|
29
|
+
className?: string;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @description A heading that opens and closes a region. The first child is the
|
|
34
|
+
* `AccordionSummary`, a button in a heading; the rest is the region it opens - a
|
|
35
|
+
* `role="region"` named by the summary, which in turn `aria-expanded` and `aria-controls` it.
|
|
36
|
+
* Open or closed it owns, until `isExpanded` takes it over. In an `AccordionGroup` the arrows,
|
|
37
|
+
* Home and End move between the summaries, and the group may keep one open at a time.
|
|
38
|
+
*/
|
|
39
|
+
declare function Accordion({ children, isExpanded: isExpandedProp, defaultExpanded, onChange, disabled, hasGutters: hasGuttersProp, borderRadius: borderRadiusProp, bg: bgProp, textColor: textColorProp, transition: Transition, className, 'data-testid': dataTestid, ...spaceProps }: Readonly<AccordionProps>): import("react").JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Accordion, AccordionProps, AccordionTransitionProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { nt as Theme } from "../index-CRQ7XLri.mjs";
|
|
2
|
+
import { r as CollapseProps } from "../index-BvgX5eyV.mjs";
|
|
3
|
+
import { SpaceProps } from "@soroush.tech/styled-system";
|
|
4
|
+
import { ComponentType, ReactNode, SyntheticEvent } from "react";
|
|
5
|
+
//#region src/Accordion/Accordion/Accordion.d.ts
|
|
6
|
+
/** What an `Accordion` hands the transition that opens and closes its region. */
|
|
7
|
+
type AccordionTransitionProps = Pick<CollapseProps, 'isShown' | 'children' | 'shouldAppear' | 'shouldMountOnEnter' | 'shouldUnmountOnExit' | 'timeout' | 'easing'>;
|
|
8
|
+
interface AccordionProps extends SpaceProps<Theme> {
|
|
9
|
+
/** An `AccordionSummary`, then what it opens - `AccordionDetails`, `AccordionActions`. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Whether it is open. Controlled with `onChange`. */
|
|
12
|
+
isExpanded?: boolean;
|
|
13
|
+
/** Whether it is open at first, when uncontrolled. Default: `false`. */
|
|
14
|
+
defaultExpanded?: boolean;
|
|
15
|
+
/** Fired when the summary is pressed, with the state it asks for. */
|
|
16
|
+
onChange?: (event: SyntheticEvent, isExpanded: boolean) => void;
|
|
17
|
+
/** Stays as it is, and its summary is off. Default: `false`. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Side padding on the summary, the details and the actions. Default: `true`. */
|
|
20
|
+
hasGutters?: boolean;
|
|
21
|
+
/** Corner radius, resolves against `theme.radii`. Default: `theme.defaults.surfaceRadius`, else square. */
|
|
22
|
+
borderRadius?: keyof Theme['radii'];
|
|
23
|
+
/** Background, resolves against `theme.background`. Default: `'paper'`. */
|
|
24
|
+
bg?: keyof Theme['background'];
|
|
25
|
+
/** Text color, resolves against `theme.text`. Default: `theme.defaults.textColor`, else `'initial'`. */
|
|
26
|
+
textColor?: keyof Theme['text'];
|
|
27
|
+
/** The transition that opens and closes the region. Default: `Collapse`. */
|
|
28
|
+
transition?: ComponentType<AccordionTransitionProps>;
|
|
29
|
+
className?: string;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @description A heading that opens and closes a region. The first child is the
|
|
34
|
+
* `AccordionSummary`, a button in a heading; the rest is the region it opens - a
|
|
35
|
+
* `role="region"` named by the summary, which in turn `aria-expanded` and `aria-controls` it.
|
|
36
|
+
* Open or closed it owns, until `isExpanded` takes it over. In an `AccordionGroup` the arrows,
|
|
37
|
+
* Home and End move between the summaries, and the group may keep one open at a time.
|
|
38
|
+
*/
|
|
39
|
+
declare function Accordion({ children, isExpanded: isExpandedProp, defaultExpanded, onChange, disabled, hasGutters: hasGuttersProp, borderRadius: borderRadiusProp, bg: bgProp, textColor: textColorProp, transition: Transition, className, 'data-testid': dataTestid, ...spaceProps }: Readonly<AccordionProps>): import("react").JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Accordion, AccordionProps, AccordionTransitionProps };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "../src-DLGYOJMh.mjs";
|
|
2
|
+
import { n as useDefaultProps } from "../theme-oBfFhJm9.mjs";
|
|
3
|
+
import { t as themeDefault } from "../themeDefault-Z3KmyIbm.mjs";
|
|
4
|
+
import { t as getSurfaceRadius } from "../getSurfaceRadius-DTgqIzll.mjs";
|
|
5
|
+
import { Collapse } from "../Collapse.mjs";
|
|
6
|
+
import { t as useControlled } from "../useControlled-CBRLsO-H.mjs";
|
|
7
|
+
import { i as getSummaryId, n as AccordionGroupContext, r as getRegionId, t as AccordionContext } from "../AccordionContext-DDk_i9Dx.mjs";
|
|
8
|
+
import { Children, useContext, useId, useMemo } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/Accordion/Accordion/Accordion.tsx
|
|
11
|
+
const AccordionRoot = styled("div", {
|
|
12
|
+
name: "Accordion",
|
|
13
|
+
label: "Accordion",
|
|
14
|
+
shouldForwardProp: createShouldForwardProp([
|
|
15
|
+
...props,
|
|
16
|
+
"borderRadius",
|
|
17
|
+
"bg",
|
|
18
|
+
"textColor"
|
|
19
|
+
]),
|
|
20
|
+
systemProps: [src_exports.space]
|
|
21
|
+
})(({ theme, borderRadius, bg, textColor }) => ({
|
|
22
|
+
overflow: "hidden",
|
|
23
|
+
backgroundColor: (0, src_exports.get)(theme, `background.${bg ?? themeDefault(theme, "surfaceBg", "paper")}`),
|
|
24
|
+
color: (0, src_exports.get)(theme, `text.${textColor ?? themeDefault(theme, "textColor", "initial")}`),
|
|
25
|
+
border: `${theme.borderWidths.thin} solid ${(0, src_exports.get)(theme, "border.default")}`,
|
|
26
|
+
borderRadius: getSurfaceRadius(theme, borderRadius)
|
|
27
|
+
}));
|
|
28
|
+
const AccordionRegion = styled("div", {
|
|
29
|
+
name: "Accordion",
|
|
30
|
+
slot: "region",
|
|
31
|
+
label: "AccordionRegion"
|
|
32
|
+
})({});
|
|
33
|
+
/**
|
|
34
|
+
* @description A heading that opens and closes a region. The first child is the
|
|
35
|
+
* `AccordionSummary`, a button in a heading; the rest is the region it opens - a
|
|
36
|
+
* `role="region"` named by the summary, which in turn `aria-expanded` and `aria-controls` it.
|
|
37
|
+
* Open or closed it owns, until `isExpanded` takes it over. In an `AccordionGroup` the arrows,
|
|
38
|
+
* Home and End move between the summaries, and the group may keep one open at a time.
|
|
39
|
+
*/
|
|
40
|
+
function Accordion({ children, isExpanded: isExpandedProp, defaultExpanded = false, onChange, disabled = false, hasGutters: hasGuttersProp, borderRadius: borderRadiusProp, bg: bgProp, textColor: textColorProp, transition: Transition = Collapse, className, "data-testid": dataTestid, ...spaceProps }) {
|
|
41
|
+
const dp = useDefaultProps("Accordion");
|
|
42
|
+
const hasGutters = hasGuttersProp ?? dp.hasGutters ?? true;
|
|
43
|
+
const borderRadius = borderRadiusProp ?? dp.borderRadius;
|
|
44
|
+
const bg = bgProp ?? dp.bg;
|
|
45
|
+
const textColor = textColorProp ?? dp.textColor;
|
|
46
|
+
const baseId = useId();
|
|
47
|
+
const group = useContext(AccordionGroupContext);
|
|
48
|
+
const [ownExpanded, setOwnExpanded] = useControlled({
|
|
49
|
+
controlled: isExpandedProp,
|
|
50
|
+
default: defaultExpanded
|
|
51
|
+
});
|
|
52
|
+
const isInGroup = group?.isExclusive && group.openId !== void 0;
|
|
53
|
+
const isExpanded = isExpandedProp ?? (isInGroup ? group.openId === baseId : ownExpanded);
|
|
54
|
+
const context = useMemo(() => ({
|
|
55
|
+
baseId,
|
|
56
|
+
isExpanded,
|
|
57
|
+
disabled,
|
|
58
|
+
hasGutters,
|
|
59
|
+
toggle: (event) => {
|
|
60
|
+
const next = !isExpanded;
|
|
61
|
+
setOwnExpanded(next);
|
|
62
|
+
group?.setOpenId(next ? baseId : null);
|
|
63
|
+
onChange?.(event, next);
|
|
64
|
+
}
|
|
65
|
+
}), [
|
|
66
|
+
baseId,
|
|
67
|
+
isExpanded,
|
|
68
|
+
disabled,
|
|
69
|
+
hasGutters,
|
|
70
|
+
setOwnExpanded,
|
|
71
|
+
group,
|
|
72
|
+
onChange
|
|
73
|
+
]);
|
|
74
|
+
const [summary, ...region] = Children.toArray(children);
|
|
75
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, {
|
|
76
|
+
value: context,
|
|
77
|
+
children: /* @__PURE__ */ jsxs(AccordionRoot, {
|
|
78
|
+
borderRadius,
|
|
79
|
+
bg,
|
|
80
|
+
textColor,
|
|
81
|
+
className,
|
|
82
|
+
"data-testid": dataTestid,
|
|
83
|
+
...spaceProps,
|
|
84
|
+
children: [summary, /* @__PURE__ */ jsx(Transition, {
|
|
85
|
+
isShown: isExpanded,
|
|
86
|
+
shouldAppear: false,
|
|
87
|
+
children: /* @__PURE__ */ jsx(AccordionRegion, {
|
|
88
|
+
role: "region",
|
|
89
|
+
id: getRegionId(baseId),
|
|
90
|
+
"aria-labelledby": getSummaryId(baseId),
|
|
91
|
+
children: region
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { Accordion };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("../src-DU81aGy9.cjs");
|
|
3
|
+
const require_AccordionContext = require("../AccordionContext-B2TCl9Os.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
6
|
+
//#region src/Accordion/AccordionActions/AccordionActions.tsx
|
|
7
|
+
const ActionsRoot = require_src.styled("div", {
|
|
8
|
+
name: "AccordionActions",
|
|
9
|
+
label: "AccordionActions",
|
|
10
|
+
shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)(["hasGutters"])
|
|
11
|
+
})(({ theme, hasGutters }) => ({
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "flex-end",
|
|
15
|
+
gap: theme.space[1],
|
|
16
|
+
padding: `${theme.space[1]} ${hasGutters ? theme.space[2] : "0"}`
|
|
17
|
+
}));
|
|
18
|
+
/** @description The foot of an `Accordion` region: its buttons, at the end of a row. */
|
|
19
|
+
function AccordionActions({ children, className, "data-testid": dataTestid }) {
|
|
20
|
+
const { hasGutters } = require_AccordionContext.useAccordion("AccordionActions");
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionsRoot, {
|
|
22
|
+
hasGutters,
|
|
23
|
+
className,
|
|
24
|
+
"data-testid": dataTestid,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.AccordionActions = AccordionActions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Accordion/AccordionActions/AccordionActions.d.ts
|
|
3
|
+
interface AccordionActionsProps {
|
|
4
|
+
/** The buttons at the foot of the region. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
}
|
|
9
|
+
/** @description The foot of an `Accordion` region: its buttons, at the end of a row. */
|
|
10
|
+
declare function AccordionActions({ children, className, 'data-testid': dataTestid }: Readonly<AccordionActionsProps>): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AccordionActions, AccordionActionsProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Accordion/AccordionActions/AccordionActions.d.ts
|
|
3
|
+
interface AccordionActionsProps {
|
|
4
|
+
/** The buttons at the foot of the region. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
}
|
|
9
|
+
/** @description The foot of an `Accordion` region: its buttons, at the end of a row. */
|
|
10
|
+
declare function AccordionActions({ children, className, 'data-testid': dataTestid }: Readonly<AccordionActionsProps>): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AccordionActions, AccordionActionsProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { o as styled, t as createShouldForwardProp } from "../src-DLGYOJMh.mjs";
|
|
2
|
+
import { a as useAccordion } from "../AccordionContext-DDk_i9Dx.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/Accordion/AccordionActions/AccordionActions.tsx
|
|
5
|
+
const ActionsRoot = styled("div", {
|
|
6
|
+
name: "AccordionActions",
|
|
7
|
+
label: "AccordionActions",
|
|
8
|
+
shouldForwardProp: createShouldForwardProp(["hasGutters"])
|
|
9
|
+
})(({ theme, hasGutters }) => ({
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "flex-end",
|
|
13
|
+
gap: theme.space[1],
|
|
14
|
+
padding: `${theme.space[1]} ${hasGutters ? theme.space[2] : "0"}`
|
|
15
|
+
}));
|
|
16
|
+
/** @description The foot of an `Accordion` region: its buttons, at the end of a row. */
|
|
17
|
+
function AccordionActions({ children, className, "data-testid": dataTestid }) {
|
|
18
|
+
const { hasGutters } = useAccordion("AccordionActions");
|
|
19
|
+
return /* @__PURE__ */ jsx(ActionsRoot, {
|
|
20
|
+
hasGutters,
|
|
21
|
+
className,
|
|
22
|
+
"data-testid": dataTestid,
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AccordionActions };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("../src-DU81aGy9.cjs");
|
|
3
|
+
const require_AccordionContext = require("../AccordionContext-B2TCl9Os.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
6
|
+
//#region src/Accordion/AccordionDetails/AccordionDetails.tsx
|
|
7
|
+
const DetailsRoot = require_src.styled("div", {
|
|
8
|
+
name: "AccordionDetails",
|
|
9
|
+
label: "AccordionDetails",
|
|
10
|
+
shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)(["hasGutters"])
|
|
11
|
+
})(({ theme, hasGutters }) => ({ padding: `${theme.space[1]} ${hasGutters ? theme.space[2] : "0"} ${theme.space[2]}` }));
|
|
12
|
+
/** @description What an `Accordion` opens: the padded body of its region. */
|
|
13
|
+
function AccordionDetails({ children, className, "data-testid": dataTestid }) {
|
|
14
|
+
const { hasGutters } = require_AccordionContext.useAccordion("AccordionDetails");
|
|
15
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailsRoot, {
|
|
16
|
+
hasGutters,
|
|
17
|
+
className,
|
|
18
|
+
"data-testid": dataTestid,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.AccordionDetails = AccordionDetails;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Accordion/AccordionDetails/AccordionDetails.d.ts
|
|
3
|
+
interface AccordionDetailsProps {
|
|
4
|
+
/** What the accordion opens. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
}
|
|
9
|
+
/** @description What an `Accordion` opens: the padded body of its region. */
|
|
10
|
+
declare function AccordionDetails({ children, className, 'data-testid': dataTestid }: Readonly<AccordionDetailsProps>): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AccordionDetails, AccordionDetailsProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Accordion/AccordionDetails/AccordionDetails.d.ts
|
|
3
|
+
interface AccordionDetailsProps {
|
|
4
|
+
/** What the accordion opens. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
}
|
|
9
|
+
/** @description What an `Accordion` opens: the padded body of its region. */
|
|
10
|
+
declare function AccordionDetails({ children, className, 'data-testid': dataTestid }: Readonly<AccordionDetailsProps>): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AccordionDetails, AccordionDetailsProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { o as styled, t as createShouldForwardProp } from "../src-DLGYOJMh.mjs";
|
|
2
|
+
import { a as useAccordion } from "../AccordionContext-DDk_i9Dx.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/Accordion/AccordionDetails/AccordionDetails.tsx
|
|
5
|
+
const DetailsRoot = styled("div", {
|
|
6
|
+
name: "AccordionDetails",
|
|
7
|
+
label: "AccordionDetails",
|
|
8
|
+
shouldForwardProp: createShouldForwardProp(["hasGutters"])
|
|
9
|
+
})(({ theme, hasGutters }) => ({ padding: `${theme.space[1]} ${hasGutters ? theme.space[2] : "0"} ${theme.space[2]}` }));
|
|
10
|
+
/** @description What an `Accordion` opens: the padded body of its region. */
|
|
11
|
+
function AccordionDetails({ children, className, "data-testid": dataTestid }) {
|
|
12
|
+
const { hasGutters } = useAccordion("AccordionDetails");
|
|
13
|
+
return /* @__PURE__ */ jsx(DetailsRoot, {
|
|
14
|
+
hasGutters,
|
|
15
|
+
className,
|
|
16
|
+
"data-testid": dataTestid,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AccordionDetails };
|