@soroush.tech/design-system 2.0.0-rc.0 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- 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 +1 -1
- package/dist/FormControl.d.cts +1 -2
- package/dist/FormControl.d.mts +1 -2
- package/dist/FormControl.mjs +1 -1
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.d.cts +1 -1
- package/dist/FormLabel.d.mts +1 -1
- package/dist/Grid.d.cts +1 -3
- package/dist/Grid.d.mts +1 -3
- package/dist/{Icon-CI6q2Eyi.cjs → Icon-Cvuhp9ek.cjs} +12 -2
- package/dist/{Icon-CH3asUJu.mjs → Icon-DlheCTJb.mjs} +12 -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/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-BkKPTOfh.cjs +172 -0
- package/dist/Menu-tECbAEFj.mjs +167 -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-BR7ingQx.mjs +654 -0
- package/dist/MenuItem-CfdN4axw.cjs +684 -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-Dml16k0X.d.mts +21 -0
- package/dist/MenuListContext-vujGcRk9.d.cts +21 -0
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/NativeSelect.cjs +2 -2
- package/dist/NativeSelect.d.cts +2 -3
- package/dist/NativeSelect.d.mts +2 -3
- package/dist/NativeSelect.mjs +2 -2
- package/dist/Pagination/PaginationItem.cjs +1 -1
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +1 -1
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +1 -1
- package/dist/Paper.d.cts +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/Select.cjs +3 -3
- package/dist/Select.d.cts +2 -3
- package/dist/Select.d.mts +2 -3
- package/dist/Select.mjs +3 -3
- 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 +1 -1
- package/dist/Skeleton.d.cts +1 -2
- package/dist/Skeleton.d.mts +1 -2
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.d.cts +1 -2
- package/dist/Switch.d.mts +1 -2
- package/dist/Switch.mjs +1 -1
- 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/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-6PgGpUzM.d.mts} +1 -1
- package/dist/{TableContext-BiRiYkVZ.d.mts → TableContext-CBGk-Lh8.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-D_wkX-Jb.cjs +645 -0
- package/dist/Tabs-YfCUbkQV.mjs +633 -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-C2agsLBN.d.cts +6 -0
- package/dist/TabsContext-DqyxdmGW.d.mts +6 -0
- package/dist/TabsValueContext-D40zGCpE.cjs +19 -0
- package/dist/TabsValueContext-DvL3inf7.mjs +8 -0
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.d.cts +1 -2
- package/dist/TextInput.d.mts +1 -2
- package/dist/TextInput.mjs +1 -1
- package/dist/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
- package/dist/Typography.cjs +1 -1
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/Typography.mjs +1 -1
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/catalog.cjs +4110 -0
- package/dist/catalog.d.cts +90 -0
- package/dist/catalog.d.mts +90 -0
- package/dist/catalog.mjs +4109 -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-B3LIhqHR.d.cts +98 -0
- package/dist/{index-DbEnSf2m.d.cts → index-B8DNxyEw.d.mts} +3 -4
- package/dist/{index-CxUsrlg1.d.cts → index-BCnKYNlZ.d.cts} +1 -2
- package/dist/{index-BUoVTCqX.d.mts → index-BFruxTHv.d.cts} +2 -3
- package/dist/{index-BSqet8aO.d.cts → index-BSA6SKao.d.mts} +2 -3
- package/dist/{index-CrN4MSUF.d.cts → index-BVPrG1L0.d.mts} +1 -1
- package/dist/{index-Celm-8iN.d.cts → index-BbgFYfX_.d.mts} +3 -4
- package/dist/{index-B78VkB0-.d.cts → index-Bhdn4KTy.d.cts} +2 -3
- package/dist/{index-Chg6pSrr.d.mts → index-BiVvxOvj.d.cts} +3 -4
- package/dist/index-BjPX49XA.d.mts +34 -0
- package/dist/{index-BB-dLv5V.d.mts → index-BjfPEP_5.d.cts} +3 -4
- package/dist/{index-Bid71KeF.d.cts → index-BlLH6rlE.d.cts} +2 -2
- package/dist/{index-Ctqajtac.d.cts → index-BqpS_Huq.d.mts} +12 -4
- package/dist/{index-BhibLnZ0.d.cts → index-Bxd9NOWb.d.mts} +2 -3
- package/dist/index-C3KrFPCj.d.mts +35 -0
- package/dist/{themes-RX2UX5gD.d.mts → index-CVNJEUwJ.d.mts} +217 -8
- package/dist/index-CWnbCxgw.d.cts +72 -0
- package/dist/index-Cj5Rhh_9.d.mts +72 -0
- package/dist/index-CoEqjFYn.d.mts +98 -0
- package/dist/{index-S-ClM6WM.d.mts → index-CrIxI8Na.d.mts} +2 -2
- package/dist/index-DBteSahY.d.cts +1 -0
- package/dist/index-DCmH5f9I.d.cts +72 -0
- package/dist/{index-VOsBSWEu.d.mts → index-DDJuUfL5.d.cts} +1 -1
- package/dist/{index-DdqdSOct.d.cts → index-DIC7HKpP.d.mts} +2 -3
- package/dist/{index-BfZuh9c2.d.mts → index-DJCpnTH3.d.mts} +2 -3
- package/dist/index-DQcnJ5H4.d.cts +35 -0
- package/dist/{index-DNwF3DUX.d.cts → index-DXhMkjQ6.d.cts} +2 -3
- package/dist/index-DckSub2J.d.mts +72 -0
- package/dist/{index-nc4Sxiy9.d.mts → index-DeDxYlSQ.d.mts} +2 -3
- package/dist/{themes-Kbk9h5cN.d.cts → index-DmJ7yWWi.d.cts} +214 -5
- package/dist/{index-Wnv6jCR3.d.mts → index-DqjXDutI.d.mts} +1 -2
- package/dist/{index-GpnmW6vu.d.mts → index-DrVYWt-X.d.mts} +1 -2
- package/dist/{index-Belxmt1X.d.cts → index-DuVNRXP4.d.cts} +1 -2
- package/dist/{index-smqjMLAZ.d.mts → index-IdMqR82e.d.cts} +2 -3
- package/dist/{index-DXvQ-JVZ.d.mts → index-XxydXX8l.d.cts} +2 -3
- package/dist/index-_G1osn09.d.mts +1 -0
- package/dist/index-gnh-Oe0n.d.cts +34 -0
- package/dist/{index-DO9J-Fla.d.mts → index-qlfNErNd.d.cts} +12 -4
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/style.cjs +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.mts +2 -2
- package/dist/style.mjs +1 -1
- package/dist/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/{useTablePagination-COTiNH_8.d.mts → useTablePagination-C5VKtqDp.d.cts} +1 -1
- package/dist/{useTablePagination-WFkaUZu8.d.cts → useTablePagination-C6LSlt3w.d.mts} +1 -1
- package/package.json +43 -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
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
const require_utils = require("./utils.cjs");
|
|
2
2
|
let _soroush_tech_styled_system = require("@soroush.tech/styled-system");
|
|
3
|
-
let react = require("react");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
let _emotion_react = require("@emotion/react");
|
|
6
3
|
//#region src/theme/utils/spacing.ts
|
|
7
4
|
const spacing = (units) => units === 0 ? "0px" : `${Math.max(1, Math.round(8 * units))}px`;
|
|
8
5
|
//#endregion
|
|
@@ -26,37 +23,6 @@ const withBreakpointHelpers = (scale) => {
|
|
|
26
23
|
return sizes;
|
|
27
24
|
};
|
|
28
25
|
//#endregion
|
|
29
|
-
//#region src/theme/utils/createTheme.ts
|
|
30
|
-
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31
|
-
const deepMerge = (base, overrides) => {
|
|
32
|
-
const merged = { ...base };
|
|
33
|
-
for (const [key, value] of Object.entries(overrides)) {
|
|
34
|
-
if (value === void 0) continue;
|
|
35
|
-
const baseValue = merged[key];
|
|
36
|
-
merged[key] = isPlainObject(baseValue) && isPlainObject(value) ? deepMerge(baseValue, value) : value;
|
|
37
|
-
}
|
|
38
|
-
return merged;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Builds a theme by deep-merging sparse `overrides` onto `base`.
|
|
42
|
-
*
|
|
43
|
-
* - Recurses only where both sides are plain objects; arrays (`shadows`,
|
|
44
|
-
* `fontSizes`) and functions replace wholesale.
|
|
45
|
-
* - `undefined` override values are ignored - a key can be added or replaced,
|
|
46
|
-
* never removed.
|
|
47
|
-
* - Neither argument is mutated; untouched branches keep referential identity.
|
|
48
|
-
* - `breakpoints` gets its query helpers back, built from the merged sizes.
|
|
49
|
-
*/
|
|
50
|
-
const createTheme = (base, overrides) => {
|
|
51
|
-
const theme = deepMerge(base, overrides);
|
|
52
|
-
return withHelpers(theme);
|
|
53
|
-
};
|
|
54
|
-
/** A theme whose `breakpoints` carry the query helpers - added when a hand-built theme lacks them. */
|
|
55
|
-
const withHelpers = (theme) => theme.breakpoints && !("up" in theme.breakpoints) ? {
|
|
56
|
-
...theme,
|
|
57
|
-
breakpoints: withBreakpointHelpers(theme.breakpoints)
|
|
58
|
-
} : theme;
|
|
59
|
-
//#endregion
|
|
60
26
|
//#region src/theme/themes.ts
|
|
61
27
|
const shadow = {
|
|
62
28
|
color: "#000000",
|
|
@@ -418,84 +384,6 @@ const baseTheme = {
|
|
|
418
384
|
*/
|
|
419
385
|
const { up, down, only, between, not, containerQueries } = breakpoints;
|
|
420
386
|
//#endregion
|
|
421
|
-
//#region src/theme/ThemeProvider.tsx
|
|
422
|
-
function ThemeProvider({ children, theme = baseTheme, defaults }) {
|
|
423
|
-
const value = (0, react.useMemo)(() => defaults ? createTheme(theme, { defaults }) : withHelpers(theme), [theme, defaults]);
|
|
424
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_emotion_react.ThemeProvider, {
|
|
425
|
-
theme: value,
|
|
426
|
-
children
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
//#endregion
|
|
430
|
-
//#region src/theme/LayoutProvider.tsx
|
|
431
|
-
const pageLayout = (theme, layout) => {
|
|
432
|
-
const page = layout;
|
|
433
|
-
let carried = {};
|
|
434
|
-
const merged = {};
|
|
435
|
-
for (const key of Object.keys(theme.breakpoints)) {
|
|
436
|
-
carried = deepMerge(carried, page[key] ?? {});
|
|
437
|
-
if (Object.keys(carried).length > 0) merged[key] = carried;
|
|
438
|
-
}
|
|
439
|
-
return merged;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* @description A page-level layout: everything inside sees `theme.layout` with the page's
|
|
443
|
-
* values merged on top - `View`, `Flex` and `Grid` with `layout`, and `useTheme().layout`. It
|
|
444
|
-
* derives the theme from the one around it and changes nothing else, so colours, light/dark
|
|
445
|
-
* switching and every other token stay the app theme's. Nested providers stack.
|
|
446
|
-
*/
|
|
447
|
-
function LayoutProvider({ layout, children }) {
|
|
448
|
-
const derive = (0, react.useCallback)((outer) => {
|
|
449
|
-
const theme = "breakpoints" in outer ? outer : baseTheme;
|
|
450
|
-
return createTheme(theme, { layout: pageLayout(theme, layout) });
|
|
451
|
-
}, [layout]);
|
|
452
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_emotion_react.ThemeProvider, {
|
|
453
|
-
theme: derive,
|
|
454
|
-
children
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
//#endregion
|
|
458
|
-
//#region src/theme/hooks/useTheme.ts
|
|
459
|
-
/**
|
|
460
|
-
* The active theme, typed as this package's own `Theme` - Emotion is an
|
|
461
|
-
* internal implementation detail, never part of the public type surface.
|
|
462
|
-
*/
|
|
463
|
-
const useTheme = () => (0, _emotion_react.useTheme)();
|
|
464
|
-
//#endregion
|
|
465
|
-
//#region src/theme/hooks/useDefaultProps.ts
|
|
466
|
-
/**
|
|
467
|
-
* The theme-contributed default prop values for a component
|
|
468
|
-
* (`theme.components[name].defaultProps`), or an empty object.
|
|
469
|
-
*
|
|
470
|
-
* Components apply it as one step of the default-resolution chain:
|
|
471
|
-
* explicit prop → group context → `useDefaultProps` → `theme.defaults.*` → literal fallback.
|
|
472
|
-
*/
|
|
473
|
-
function useDefaultProps(name) {
|
|
474
|
-
return useTheme().components?.[name]?.defaultProps ?? {};
|
|
475
|
-
}
|
|
476
|
-
//#endregion
|
|
477
|
-
//#region src/theme/hoc/withTheme.tsx
|
|
478
|
-
function withTheme(WrappedComponent) {
|
|
479
|
-
return function WithTheme(props) {
|
|
480
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_emotion_react.ThemeContext.Consumer, { children: (theme) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WrappedComponent, {
|
|
481
|
-
...props,
|
|
482
|
-
theme
|
|
483
|
-
}) });
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
//#endregion
|
|
487
|
-
Object.defineProperty(exports, "LayoutProvider", {
|
|
488
|
-
enumerable: true,
|
|
489
|
-
get: function() {
|
|
490
|
-
return LayoutProvider;
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
Object.defineProperty(exports, "ThemeProvider", {
|
|
494
|
-
enumerable: true,
|
|
495
|
-
get: function() {
|
|
496
|
-
return ThemeProvider;
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
387
|
Object.defineProperty(exports, "avatar", {
|
|
500
388
|
enumerable: true,
|
|
501
389
|
get: function() {
|
|
@@ -532,12 +420,6 @@ Object.defineProperty(exports, "containerQueries", {
|
|
|
532
420
|
return containerQueries;
|
|
533
421
|
}
|
|
534
422
|
});
|
|
535
|
-
Object.defineProperty(exports, "createTheme", {
|
|
536
|
-
enumerable: true,
|
|
537
|
-
get: function() {
|
|
538
|
-
return createTheme;
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
423
|
Object.defineProperty(exports, "down", {
|
|
542
424
|
enumerable: true,
|
|
543
425
|
get: function() {
|
|
@@ -628,30 +510,12 @@ Object.defineProperty(exports, "up", {
|
|
|
628
510
|
return up;
|
|
629
511
|
}
|
|
630
512
|
});
|
|
631
|
-
Object.defineProperty(exports, "useDefaultProps", {
|
|
632
|
-
enumerable: true,
|
|
633
|
-
get: function() {
|
|
634
|
-
return useDefaultProps;
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
Object.defineProperty(exports, "useTheme", {
|
|
638
|
-
enumerable: true,
|
|
639
|
-
get: function() {
|
|
640
|
-
return useTheme;
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
513
|
Object.defineProperty(exports, "withBreakpointHelpers", {
|
|
644
514
|
enumerable: true,
|
|
645
515
|
get: function() {
|
|
646
516
|
return withBreakpointHelpers;
|
|
647
517
|
}
|
|
648
518
|
});
|
|
649
|
-
Object.defineProperty(exports, "withTheme", {
|
|
650
|
-
enumerable: true,
|
|
651
|
-
get: function() {
|
|
652
|
-
return withTheme;
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
519
|
Object.defineProperty(exports, "zOrder", {
|
|
656
520
|
enumerable: true,
|
|
657
521
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TableSortLabelDirection } from "./index-
|
|
1
|
+
import { n as TableSortLabelDirection } from "./index-DXhMkjQ6.cjs";
|
|
2
2
|
//#region src/Table/hooks/useTableSort.d.ts
|
|
3
3
|
/** One column's sort state - spreads directly onto `TableSortLabel`. */
|
|
4
4
|
interface TableSortEntry {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TableSortLabelDirection } from "./index-
|
|
1
|
+
import { n as TableSortLabelDirection } from "./index-DeDxYlSQ.mjs";
|
|
2
2
|
//#region src/Table/hooks/useTableSort.d.ts
|
|
3
3
|
/** One column's sort state - spreads directly onto `TableSortLabel`. */
|
|
4
4
|
interface TableSortEntry {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soroush.tech/design-system",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"description": "Emotion + @soroush.tech/styled-system React component library - token-driven light/dark themes, layout primitives, forms, and overlays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -68,6 +68,16 @@
|
|
|
68
68
|
"default": "./dist/Backdrop.cjs"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
+
"./Breadcrumbs": {
|
|
72
|
+
"import": {
|
|
73
|
+
"types": "./dist/Breadcrumbs.d.mts",
|
|
74
|
+
"default": "./dist/Breadcrumbs.mjs"
|
|
75
|
+
},
|
|
76
|
+
"require": {
|
|
77
|
+
"types": "./dist/Breadcrumbs.d.cts",
|
|
78
|
+
"default": "./dist/Breadcrumbs.cjs"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
71
81
|
"./Button": {
|
|
72
82
|
"import": {
|
|
73
83
|
"types": "./dist/Button.d.mts",
|
|
@@ -238,6 +248,16 @@
|
|
|
238
248
|
"default": "./dist/Link.cjs"
|
|
239
249
|
}
|
|
240
250
|
},
|
|
251
|
+
"./Menu": {
|
|
252
|
+
"import": {
|
|
253
|
+
"types": "./dist/Menu.d.mts",
|
|
254
|
+
"default": "./dist/Menu.mjs"
|
|
255
|
+
},
|
|
256
|
+
"require": {
|
|
257
|
+
"types": "./dist/Menu.d.cts",
|
|
258
|
+
"default": "./dist/Menu.cjs"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
241
261
|
"./MenuItem": {
|
|
242
262
|
"import": {
|
|
243
263
|
"types": "./dist/MenuItem.d.mts",
|
|
@@ -388,6 +408,16 @@
|
|
|
388
408
|
"default": "./dist/Table.cjs"
|
|
389
409
|
}
|
|
390
410
|
},
|
|
411
|
+
"./Tabs": {
|
|
412
|
+
"import": {
|
|
413
|
+
"types": "./dist/Tabs.d.mts",
|
|
414
|
+
"default": "./dist/Tabs.mjs"
|
|
415
|
+
},
|
|
416
|
+
"require": {
|
|
417
|
+
"types": "./dist/Tabs.d.cts",
|
|
418
|
+
"default": "./dist/Tabs.cjs"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
391
421
|
"./TextInput": {
|
|
392
422
|
"import": {
|
|
393
423
|
"types": "./dist/TextInput.d.mts",
|
|
@@ -398,6 +428,16 @@
|
|
|
398
428
|
"default": "./dist/TextInput.cjs"
|
|
399
429
|
}
|
|
400
430
|
},
|
|
431
|
+
"./catalog": {
|
|
432
|
+
"import": {
|
|
433
|
+
"types": "./dist/catalog.d.mts",
|
|
434
|
+
"default": "./dist/catalog.mjs"
|
|
435
|
+
},
|
|
436
|
+
"require": {
|
|
437
|
+
"types": "./dist/catalog.d.cts",
|
|
438
|
+
"default": "./dist/catalog.cjs"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
401
441
|
"./theme": {
|
|
402
442
|
"import": {
|
|
403
443
|
"types": "./dist/theme.d.mts",
|
|
@@ -487,7 +527,7 @@
|
|
|
487
527
|
"@emotion/cache": "^11.14.0",
|
|
488
528
|
"@emotion/react": "^11.14.0",
|
|
489
529
|
"@emotion/styled": "^11.14.1",
|
|
490
|
-
"@soroush.tech/styled-system": "^6.0.0-rc.
|
|
530
|
+
"@soroush.tech/styled-system": "^6.0.0-rc.2"
|
|
491
531
|
},
|
|
492
532
|
"peerDependencies": {
|
|
493
533
|
"react": "^19.2.8",
|
|
@@ -516,6 +556,7 @@
|
|
|
516
556
|
"typescript": "~7.0.2",
|
|
517
557
|
"vitest": "^4.1.10",
|
|
518
558
|
"zod": "^4.4.3",
|
|
559
|
+
"@soroush.tech/docs-content": "0.1.0",
|
|
519
560
|
"@soroush.tech/eslint-config": "0.0.0"
|
|
520
561
|
},
|
|
521
562
|
"scripts": {
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
|
|
2
|
-
import { r as useTheme } from "./theme-CDVxig_g.mjs";
|
|
3
|
-
import { Paper } from "./Paper.mjs";
|
|
4
|
-
import { t as Modal } from "./Modal-BcsyrrpH.mjs";
|
|
5
|
-
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
//#region src/Popover/utils/resolveAnchorEl.ts
|
|
8
|
-
/** Resolves the `anchorEl` prop, which may be an element or a function returning one. */
|
|
9
|
-
function resolveAnchorEl(anchorEl) {
|
|
10
|
-
return (typeof anchorEl === "function" ? anchorEl() : anchorEl) ?? null;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/Popover/utils/getOffset.ts
|
|
14
|
-
/** Vertical offset within a rect for an anchor/transform origin keyword or explicit px. */
|
|
15
|
-
function getOffsetTop(rect, vertical) {
|
|
16
|
-
if (typeof vertical === "number") return vertical;
|
|
17
|
-
if (vertical === "center") return rect.height / 2;
|
|
18
|
-
if (vertical === "bottom") return rect.height;
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
/** Horizontal offset within a rect for an anchor/transform origin keyword or explicit px. */
|
|
22
|
-
function getOffsetLeft(rect, horizontal) {
|
|
23
|
-
if (typeof horizontal === "number") return horizontal;
|
|
24
|
-
if (horizontal === "center") return rect.width / 2;
|
|
25
|
-
if (horizontal === "right") return rect.width;
|
|
26
|
-
return 0;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/Popover/utils/getTransformOriginValue.ts
|
|
30
|
-
/** Serializes a resolved transform origin (in px) to a CSS `transform-origin` value. */
|
|
31
|
-
function getTransformOriginValue(origin) {
|
|
32
|
-
return `${origin.horizontal}px ${origin.vertical}px`;
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/Popover/utils/computePopoverPosition.ts
|
|
36
|
-
/** Mirrors a keyword origin to the opposite edge; numbers and `center` are unchanged. */
|
|
37
|
-
function flipVertical(origin) {
|
|
38
|
-
if (origin === "top") return "bottom";
|
|
39
|
-
if (origin === "bottom") return "top";
|
|
40
|
-
return origin;
|
|
41
|
-
}
|
|
42
|
-
function flipHorizontal(origin) {
|
|
43
|
-
if (origin === "left") return "right";
|
|
44
|
-
if (origin === "right") return "left";
|
|
45
|
-
return origin;
|
|
46
|
-
}
|
|
47
|
-
function resolveAxis({ anchorStart, anchorSize, anchorOrigin, transformOrigin, paperSize, viewportSize, margin, offset, flip }) {
|
|
48
|
-
const preferredTransform = offset(paperSize, transformOrigin);
|
|
49
|
-
const preferredPosition = anchorStart + offset(anchorSize, anchorOrigin) - preferredTransform;
|
|
50
|
-
let position = preferredPosition;
|
|
51
|
-
let transformOffset = preferredTransform;
|
|
52
|
-
if (margin != null) {
|
|
53
|
-
const fits = (candidate) => candidate >= margin && candidate + paperSize <= viewportSize - margin;
|
|
54
|
-
if (!fits(preferredPosition)) {
|
|
55
|
-
const flippedTransform = offset(paperSize, flip(transformOrigin));
|
|
56
|
-
const flippedPosition = anchorStart + offset(anchorSize, flip(anchorOrigin)) - flippedTransform;
|
|
57
|
-
if (fits(flippedPosition)) {
|
|
58
|
-
position = flippedPosition;
|
|
59
|
-
transformOffset = flippedTransform;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (position < margin) {
|
|
63
|
-
const diff = position - margin;
|
|
64
|
-
position -= diff;
|
|
65
|
-
transformOffset += diff;
|
|
66
|
-
} else if (position + paperSize > viewportSize - margin) {
|
|
67
|
-
const diff = position + paperSize - (viewportSize - margin);
|
|
68
|
-
position -= diff;
|
|
69
|
-
transformOffset += diff;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
position,
|
|
74
|
-
transformOffset
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Places the paper so its `transformOrigin` meets the anchor's `anchorOrigin`, flipping
|
|
79
|
-
* to the opposite side at a viewport edge and clamping as a fallback. Returns `null`
|
|
80
|
-
* coordinates for `anchorReference === 'none'`.
|
|
81
|
-
*/
|
|
82
|
-
function computePopoverPosition(params) {
|
|
83
|
-
const { anchorReference, anchorRect, anchorPosition, paperRect, anchorOrigin, transformOrigin, viewport, marginThreshold } = params;
|
|
84
|
-
if (anchorReference === "none") return {
|
|
85
|
-
top: null,
|
|
86
|
-
left: null,
|
|
87
|
-
transformOrigin: getTransformOriginValue({
|
|
88
|
-
vertical: getOffsetTop(paperRect, transformOrigin.vertical),
|
|
89
|
-
horizontal: getOffsetLeft(paperRect, transformOrigin.horizontal)
|
|
90
|
-
})
|
|
91
|
-
};
|
|
92
|
-
const rect = anchorReference === "anchorPosition" ? {
|
|
93
|
-
top: anchorPosition?.top ?? 0,
|
|
94
|
-
left: anchorPosition?.left ?? 0,
|
|
95
|
-
width: 0,
|
|
96
|
-
height: 0
|
|
97
|
-
} : anchorRect ?? {
|
|
98
|
-
top: 0,
|
|
99
|
-
left: 0,
|
|
100
|
-
width: 0,
|
|
101
|
-
height: 0
|
|
102
|
-
};
|
|
103
|
-
const vertical = resolveAxis({
|
|
104
|
-
anchorStart: rect.top,
|
|
105
|
-
anchorSize: rect.height,
|
|
106
|
-
anchorOrigin: anchorOrigin.vertical,
|
|
107
|
-
transformOrigin: transformOrigin.vertical,
|
|
108
|
-
paperSize: paperRect.height,
|
|
109
|
-
viewportSize: viewport.height,
|
|
110
|
-
margin: marginThreshold,
|
|
111
|
-
offset: (size, origin) => getOffsetTop({ height: size }, origin),
|
|
112
|
-
flip: (origin) => flipVertical(origin)
|
|
113
|
-
});
|
|
114
|
-
const horizontal = resolveAxis({
|
|
115
|
-
anchorStart: rect.left,
|
|
116
|
-
anchorSize: rect.width,
|
|
117
|
-
anchorOrigin: anchorOrigin.horizontal,
|
|
118
|
-
transformOrigin: transformOrigin.horizontal,
|
|
119
|
-
paperSize: paperRect.width,
|
|
120
|
-
viewportSize: viewport.width,
|
|
121
|
-
margin: marginThreshold,
|
|
122
|
-
offset: (size, origin) => getOffsetLeft({ width: size }, origin),
|
|
123
|
-
flip: (origin) => flipHorizontal(origin)
|
|
124
|
-
});
|
|
125
|
-
return {
|
|
126
|
-
top: Math.floor(vertical.position),
|
|
127
|
-
left: Math.floor(horizontal.position),
|
|
128
|
-
transformOrigin: getTransformOriginValue({
|
|
129
|
-
vertical: vertical.transformOffset,
|
|
130
|
-
horizontal: horizontal.transformOffset
|
|
131
|
-
})
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/Popover/Popover.tsx
|
|
136
|
-
const ANCHOR_ORIGIN_DEFAULT = {
|
|
137
|
-
vertical: "top",
|
|
138
|
-
horizontal: "left"
|
|
139
|
-
};
|
|
140
|
-
const Positioner = styled("div", {
|
|
141
|
-
name: "Popover",
|
|
142
|
-
slot: "positioner",
|
|
143
|
-
label: "PopoverPositioner",
|
|
144
|
-
shouldForwardProp: createShouldForwardProp(["isPositioned"])
|
|
145
|
-
})(({ isPositioned }) => ({
|
|
146
|
-
position: "absolute",
|
|
147
|
-
...isPositioned ? {} : { opacity: 0 }
|
|
148
|
-
}));
|
|
149
|
-
const Surface = styled(Paper, {
|
|
150
|
-
name: "Popover",
|
|
151
|
-
label: "Popover"
|
|
152
|
-
})({
|
|
153
|
-
overflowY: "auto",
|
|
154
|
-
overflowX: "hidden",
|
|
155
|
-
minWidth: 16,
|
|
156
|
-
minHeight: 16,
|
|
157
|
-
maxWidth: "calc(100vw - 32px)",
|
|
158
|
-
maxHeight: "calc(100vh - 32px)",
|
|
159
|
-
outline: 0
|
|
160
|
-
});
|
|
161
|
-
/**
|
|
162
|
-
* @description Positions its content next to an anchor, portaled above the page.
|
|
163
|
-
* Built on `Modal`, so it inherits the portal, optional backdrop, focus management,
|
|
164
|
-
* scroll lock, and Escape/click-away close - then adds anchor positioning
|
|
165
|
-
* (`anchorOrigin`/`transformOrigin`/`marginThreshold`).
|
|
166
|
-
*/
|
|
167
|
-
function Popover({ open, children, anchorEl = null, anchorReference = "anchorEl", anchorPosition, anchorOrigin = ANCHOR_ORIGIN_DEFAULT, transformOrigin = ANCHOR_ORIGIN_DEFAULT, onClose, elevation = 8, marginThreshold = 2, container, action, slotProps, hasBackdrop = false, disableScrollLock = false, disableAriaHidden = false, shouldAutoFocus = true, shouldTrapFocus = true, shouldEnforceFocus = true, shouldRestoreFocus = true, shouldKeepMounted = false, layer = "modal" }) {
|
|
168
|
-
const theme = useTheme();
|
|
169
|
-
const positionerRef = useRef(null);
|
|
170
|
-
const [isPositioned, setIsPositioned] = useState(false);
|
|
171
|
-
const anchorTop = anchorPosition?.top;
|
|
172
|
-
const anchorLeft = anchorPosition?.left;
|
|
173
|
-
const marginThresholdPx = marginThreshold == null ? null : Number.parseFloat(String(theme.space[marginThreshold]));
|
|
174
|
-
const setPositioningStyles = useCallback(() => {
|
|
175
|
-
const element = positionerRef.current;
|
|
176
|
-
if (!element) return;
|
|
177
|
-
const resolved = resolveAnchorEl(anchorEl);
|
|
178
|
-
const positioning = computePopoverPosition({
|
|
179
|
-
anchorReference,
|
|
180
|
-
anchorRect: anchorReference === "anchorEl" && resolved ? resolved.getBoundingClientRect() : null,
|
|
181
|
-
anchorPosition: anchorTop != null && anchorLeft != null ? {
|
|
182
|
-
top: anchorTop,
|
|
183
|
-
left: anchorLeft
|
|
184
|
-
} : void 0,
|
|
185
|
-
paperRect: {
|
|
186
|
-
width: element.offsetWidth,
|
|
187
|
-
height: element.offsetHeight
|
|
188
|
-
},
|
|
189
|
-
anchorOrigin,
|
|
190
|
-
transformOrigin,
|
|
191
|
-
viewport: {
|
|
192
|
-
width: window.innerWidth,
|
|
193
|
-
height: window.innerHeight
|
|
194
|
-
},
|
|
195
|
-
marginThreshold: marginThresholdPx
|
|
196
|
-
});
|
|
197
|
-
if (positioning.top !== null) element.style.top = `${positioning.top}px`;
|
|
198
|
-
if (positioning.left !== null) element.style.left = `${positioning.left}px`;
|
|
199
|
-
element.style.transformOrigin = positioning.transformOrigin;
|
|
200
|
-
setIsPositioned(true);
|
|
201
|
-
}, [
|
|
202
|
-
anchorEl,
|
|
203
|
-
anchorReference,
|
|
204
|
-
anchorTop,
|
|
205
|
-
anchorLeft,
|
|
206
|
-
anchorOrigin,
|
|
207
|
-
transformOrigin,
|
|
208
|
-
marginThresholdPx
|
|
209
|
-
]);
|
|
210
|
-
useLayoutEffect(() => {
|
|
211
|
-
if (open) setPositioningStyles();
|
|
212
|
-
});
|
|
213
|
-
useEffect(() => {
|
|
214
|
-
if (!open) return;
|
|
215
|
-
const handle = () => setPositioningStyles();
|
|
216
|
-
window.addEventListener("resize", handle);
|
|
217
|
-
if (disableScrollLock) window.addEventListener("scroll", handle, true);
|
|
218
|
-
return () => {
|
|
219
|
-
window.removeEventListener("resize", handle);
|
|
220
|
-
window.removeEventListener("scroll", handle, true);
|
|
221
|
-
};
|
|
222
|
-
}, [
|
|
223
|
-
open,
|
|
224
|
-
disableScrollLock,
|
|
225
|
-
setPositioningStyles
|
|
226
|
-
]);
|
|
227
|
-
useImperativeHandle(action, () => ({ updatePosition: setPositioningStyles }), [setPositioningStyles]);
|
|
228
|
-
return /* @__PURE__ */ jsx(Modal, {
|
|
229
|
-
isOpen: open,
|
|
230
|
-
onClose,
|
|
231
|
-
hasBackdrop,
|
|
232
|
-
shouldKeepMounted,
|
|
233
|
-
shouldLockScroll: !disableScrollLock,
|
|
234
|
-
disableAriaHidden,
|
|
235
|
-
shouldAutoFocus,
|
|
236
|
-
shouldTrapFocus,
|
|
237
|
-
shouldEnforceFocus,
|
|
238
|
-
shouldRestoreFocus,
|
|
239
|
-
portalContainer: container,
|
|
240
|
-
layer,
|
|
241
|
-
children: /* @__PURE__ */ jsx(Positioner, {
|
|
242
|
-
ref: positionerRef,
|
|
243
|
-
isPositioned,
|
|
244
|
-
children: /* @__PURE__ */ jsx(Surface, {
|
|
245
|
-
elevation,
|
|
246
|
-
...slotProps?.paper,
|
|
247
|
-
children
|
|
248
|
-
})
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
|
-
export { Popover as t };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { T as Theme } from "./themes-RX2UX5gD.mjs";
|
|
2
|
-
import "./index-C1WqEDtQ.mjs";
|
|
3
|
-
import { n as FlexProps } from "./index-CKZaErxJ.mjs";
|
|
4
|
-
import { CSSProperties, ElementType } from "react";
|
|
5
|
-
//#region src/Paper/Paper.d.ts
|
|
6
|
-
type PaperElevation = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
|
|
7
|
-
interface PaperProps extends FlexProps {
|
|
8
|
-
/** Shadow depth - 0 (flat) to 24 (highest). Resolves to theme.shadows[n]. Default: 1. */
|
|
9
|
-
elevation?: PaperElevation;
|
|
10
|
-
/** CSS transition for surface animations (e.g. hover elevation change). */
|
|
11
|
-
transition?: CSSProperties['transition'];
|
|
12
|
-
/** Resolves against theme.border - light · primary · dark */
|
|
13
|
-
borderColor?: keyof Theme['border'];
|
|
14
|
-
/** Resolves against theme.borderWidths - none · thin · base · thick */
|
|
15
|
-
borderWidth?: keyof Theme['borderWidths'];
|
|
16
|
-
/** CSS border-style value (e.g. 'solid', 'dashed'). */
|
|
17
|
-
borderStyle?: CSSProperties['borderStyle'];
|
|
18
|
-
/** Renders the surface as a different element (e.g. 'section'). */
|
|
19
|
-
as?: ElementType;
|
|
20
|
-
}
|
|
21
|
-
declare function Paper({ elevation, p, bg, borderRadius, ...rest }: Readonly<PaperProps>): import("react").JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { PaperElevation as n, PaperProps as r, Paper as t };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { T as Theme } from "./themes-RX2UX5gD.mjs";
|
|
2
|
-
import { CreateStyledComponent, FilteringStyledOptions, Interpolation, StyledOptions } from "@emotion/styled";
|
|
3
|
-
import { PropsOf, css as css$1, keyframes } from "@emotion/react";
|
|
4
|
-
import { createShouldForwardProp, props } from "@soroush.tech/styled-system/should-forward-prop";
|
|
5
|
-
import { ComponentClass, ComponentProps, ComponentType, JSX, Ref } from "react";
|
|
6
|
-
//#region src/style/styled.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Design-system additions to Emotion's styled options. A styled root that passes
|
|
9
|
-
* `name` becomes theme-customizable: `theme.components[name]` may contribute
|
|
10
|
-
* `styleOverrides` (per `slot`) and `variants`, appended after the component's
|
|
11
|
-
* own styles so the theme wins the cascade. Roots without `name` are plain
|
|
12
|
-
* Emotion - zero behavior change, zero cost.
|
|
13
|
-
*/
|
|
14
|
-
interface ThemeCustomizationOptions {
|
|
15
|
-
/** `theme.components` key enabling styleOverrides/variants for this root. */
|
|
16
|
-
name?: string;
|
|
17
|
-
/** The `styleOverrides` slot this root maps to. Default: `'root'`. */
|
|
18
|
-
slot?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Styled-system prop parsers (`space`, `layout`, ...) appended AFTER the theme
|
|
21
|
-
* override resolver, so per-instance props (`m`, `p`, `width`, ...) always beat
|
|
22
|
-
* theme `styleOverrides`.
|
|
23
|
-
*/
|
|
24
|
-
systemProps?: ReadonlyArray<Interpolation<never>>;
|
|
25
|
-
/**
|
|
26
|
-
* Custom mapping from render props to applied override styles - replaces the
|
|
27
|
-
* default `styleOverrides[slot]` lookup (for prop-keyed override keys).
|
|
28
|
-
*/
|
|
29
|
-
overridesResolver?: (props: Record<string, unknown>, styleOverrides: Record<string, unknown>) => unknown;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The `styled.div`, `styled.span`, ... tag shorthands - mirrors Emotion's own
|
|
33
|
-
* `StyledTags`, retyped against this package's `Theme` instead of Emotion's
|
|
34
|
-
* (otherwise-empty) one, so `${({ theme }) => theme.space[2]}` template
|
|
35
|
-
* interpolations resolve to the real theme shape.
|
|
36
|
-
*/
|
|
37
|
-
type StyledTags = { [Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<{
|
|
38
|
-
theme?: Theme;
|
|
39
|
-
as?: React.ElementType;
|
|
40
|
-
}, JSX.IntrinsicElements[Tag]>; };
|
|
41
|
-
/** Overloads mirroring Emotion's, with the theme-customization options added. */
|
|
42
|
-
interface CreateThemedStyled extends StyledTags {
|
|
43
|
-
<C extends ComponentClass<ComponentProps<C>>, ForwardedProps extends keyof ComponentProps<C> & string = keyof ComponentProps<C> & string>(component: C, options: FilteringStyledOptions<ComponentProps<C>, ForwardedProps> & ThemeCustomizationOptions): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
|
|
44
|
-
theme?: Theme;
|
|
45
|
-
}, {}, {
|
|
46
|
-
ref?: Ref<InstanceType<C>>;
|
|
47
|
-
}>;
|
|
48
|
-
<C extends ComponentType<ComponentProps<C>>, ForwardedProps extends keyof ComponentProps<C> & string = keyof ComponentProps<C> & string>(component: C, options: FilteringStyledOptions<ComponentProps<C>, ForwardedProps> & ThemeCustomizationOptions): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
|
|
49
|
-
theme?: Theme;
|
|
50
|
-
}>;
|
|
51
|
-
<C extends ComponentType<ComponentProps<C>>>(component: C, options?: StyledOptions<ComponentProps<C>> & ThemeCustomizationOptions): CreateStyledComponent<PropsOf<C> & {
|
|
52
|
-
theme?: Theme;
|
|
53
|
-
}>;
|
|
54
|
-
<Tag extends keyof JSX.IntrinsicElements, ForwardedProps extends keyof JSX.IntrinsicElements[Tag] & string = keyof JSX.IntrinsicElements[Tag] & string>(tag: Tag, options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps> & ThemeCustomizationOptions): CreateStyledComponent<{
|
|
55
|
-
theme?: Theme;
|
|
56
|
-
as?: React.ElementType;
|
|
57
|
-
}, Pick<JSX.IntrinsicElements[Tag], ForwardedProps>>;
|
|
58
|
-
<Tag extends keyof JSX.IntrinsicElements>(tag: Tag, options?: StyledOptions<JSX.IntrinsicElements[Tag]> & ThemeCustomizationOptions): CreateStyledComponent<{
|
|
59
|
-
theme?: Theme;
|
|
60
|
-
as?: React.ElementType;
|
|
61
|
-
}, JSX.IntrinsicElements[Tag]>;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The design system's `styled` - Emotion's styled plus theme-level component
|
|
65
|
-
* customization (`theme.components[name].styleOverrides` / `.variants`).
|
|
66
|
-
*/
|
|
67
|
-
declare const styled: CreateThemedStyled;
|
|
68
|
-
//#endregion
|
|
69
|
-
export { ThemeCustomizationOptions as a, props as i, css$1 as n, styled as o, keyframes as r, createShouldForwardProp as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { T as Theme } from "./themes-Kbk9h5cN.cjs";
|
|
2
|
-
import "./index-DBUwu65Z.cjs";
|
|
3
|
-
import { s as ViewProps } from "./index-nB94D7UM.cjs";
|
|
4
|
-
import { FlexboxProps } from "@soroush.tech/styled-system";
|
|
5
|
-
//#region src/Flex/Flex.d.ts
|
|
6
|
-
/** Valid values for the gap prop - derived from theme.space keys. */
|
|
7
|
-
type GapToken = keyof Theme['space'];
|
|
8
|
-
/**
|
|
9
|
-
* `layout` puts the flex container on the page frame, as on any View: the theme's margin and
|
|
10
|
-
* max width per breakpoint. The flexbox stays as set - a column by default, a row with
|
|
11
|
-
* `flexDirection="row"`. Columns are Grid's: content on the page columns uses `<Grid layout>`.
|
|
12
|
-
*/
|
|
13
|
-
interface FlexProps extends ViewProps, FlexboxProps<Theme> {}
|
|
14
|
-
declare const Flex: import("@emotion/styled").StyledComponent<{
|
|
15
|
-
theme?: Theme;
|
|
16
|
-
as?: React.ElementType;
|
|
17
|
-
} & ViewProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
18
|
-
theme?: Theme;
|
|
19
|
-
} & FlexProps, {}, {}>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { FlexProps as n, GapToken as r, Flex as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { T as Theme } from "./themes-RX2UX5gD.mjs";
|
|
2
|
-
import "./index-C1WqEDtQ.mjs";
|
|
3
|
-
import { s as ViewProps } from "./index-cuv3o-L7.mjs";
|
|
4
|
-
import { FlexboxProps } from "@soroush.tech/styled-system";
|
|
5
|
-
//#region src/Flex/Flex.d.ts
|
|
6
|
-
/** Valid values for the gap prop - derived from theme.space keys. */
|
|
7
|
-
type GapToken = keyof Theme['space'];
|
|
8
|
-
/**
|
|
9
|
-
* `layout` puts the flex container on the page frame, as on any View: the theme's margin and
|
|
10
|
-
* max width per breakpoint. The flexbox stays as set - a column by default, a row with
|
|
11
|
-
* `flexDirection="row"`. Columns are Grid's: content on the page columns uses `<Grid layout>`.
|
|
12
|
-
*/
|
|
13
|
-
interface FlexProps extends ViewProps, FlexboxProps<Theme> {}
|
|
14
|
-
declare const Flex: import("@emotion/styled").StyledComponent<{
|
|
15
|
-
theme?: Theme;
|
|
16
|
-
as?: React.ElementType;
|
|
17
|
-
} & ViewProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
18
|
-
theme?: Theme;
|
|
19
|
-
} & FlexProps, {}, {}>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { FlexProps as n, GapToken as r, Flex as t };
|