@soroush.tech/design-system 1.3.3 → 2.0.0-alpha.1
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 +45 -7
- package/dist/AppBar.d.cts +3 -3
- package/dist/AppBar.d.mts +3 -3
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.d.cts +3 -3
- package/dist/Avatar.d.mts +3 -3
- package/dist/Avatar.mjs +1 -1
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Card.cjs +2 -2
- package/dist/Card.d.cts +3 -3
- package/dist/Card.d.mts +3 -3
- package/dist/Card.mjs +2 -2
- package/dist/Checkbox.d.cts +2 -2
- package/dist/Checkbox.d.mts +2 -2
- package/dist/CircularProgress.d.cts +3 -3
- package/dist/CircularProgress.d.mts +3 -3
- package/dist/Drawer.cjs +109 -17
- package/dist/Drawer.d.cts +43 -7
- package/dist/Drawer.d.mts +43 -7
- package/dist/Drawer.mjs +109 -18
- package/dist/Flex.cjs +6 -2
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Flex.mjs +6 -2
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/FormControl.cjs +1 -1
- package/dist/FormControl.d.cts +2 -2
- package/dist/FormControl.d.mts +2 -2
- package/dist/FormControl.mjs +1 -1
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.d.cts +1 -1
- package/dist/FormLabel.d.mts +1 -1
- package/dist/Grid.cjs +7 -2
- package/dist/Grid.d.cts +9 -5
- package/dist/Grid.d.mts +9 -5
- package/dist/Grid.mjs +7 -2
- package/dist/{Icon-gSiGgU13.mjs → Icon-BGcd6yy0.mjs} +1 -1
- package/dist/{Icon-BAMpe9SO.cjs → Icon-Cn6Zx8wb.cjs} +1 -1
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.mts +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.d.cts +2 -2
- package/dist/Image.d.mts +2 -2
- package/dist/LinearProgress.d.cts +3 -3
- package/dist/LinearProgress.d.mts +3 -3
- package/dist/Link.cjs +1 -1
- package/dist/Link.d.cts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/MenuItem.cjs +2 -2
- package/dist/MenuItem.d.cts +2 -2
- package/dist/MenuItem.d.mts +2 -2
- package/dist/MenuItem.mjs +2 -2
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NativeSelect.cjs +2 -2
- package/dist/NativeSelect.d.cts +3 -3
- package/dist/NativeSelect.d.mts +3 -3
- package/dist/NativeSelect.mjs +2 -2
- package/dist/Pagination/PaginationItem.cjs +1 -1
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +1 -1
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +1 -1
- package/dist/Paper.d.cts +1 -1
- package/dist/Paper.d.mts +1 -1
- package/dist/Paper.mjs +1 -1
- package/dist/{Popover-gg44qzwo.cjs → Popover-CrSABgRk.cjs} +2 -2
- package/dist/{Popover-Bq31OTEl.mjs → Popover-DlpXdcwt.mjs} +2 -2
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +4 -4
- package/dist/Popover.d.mts +4 -4
- package/dist/Popover.mjs +1 -1
- package/dist/Pressable.cjs +1 -1
- package/dist/Pressable.d.cts +1 -1
- package/dist/Pressable.d.mts +1 -1
- package/dist/Pressable.mjs +1 -1
- package/dist/Quote.d.cts +4 -4
- package/dist/Quote.d.mts +4 -4
- package/dist/Radio.d.cts +2 -2
- package/dist/Radio.d.mts +2 -2
- package/dist/Select.cjs +3 -3
- package/dist/Select.d.cts +3 -3
- package/dist/Select.d.mts +3 -3
- package/dist/Select.mjs +3 -3
- package/dist/Sidebar/Sidebar.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 +4 -4
- package/dist/Sidebar/SidebarItem.d.mts +4 -4
- package/dist/Sidebar/SidebarItem.mjs +1 -1
- package/dist/Skeleton.d.cts +2 -2
- package/dist/Skeleton.d.mts +2 -2
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.d.cts +2 -2
- package/dist/Switch.d.mts +2 -2
- package/dist/Switch.mjs +1 -1
- package/dist/Table/Table.d.cts +3 -3
- package/dist/Table/Table.d.mts +3 -3
- package/dist/Table/TableBody.d.cts +2 -2
- package/dist/Table/TableBody.d.mts +2 -2
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +4 -4
- package/dist/Table/TableContainer.d.mts +4 -4
- package/dist/Table/TableControl.d.cts +1 -1
- package/dist/Table/TableControl.d.mts +1 -1
- package/dist/Table/TableFooter.d.cts +2 -2
- package/dist/Table/TableFooter.d.mts +2 -2
- package/dist/Table/TableHead.d.cts +2 -2
- package/dist/Table/TableHead.d.mts +2 -2
- package/dist/Table/TablePagination.d.cts +2 -2
- package/dist/Table/TablePagination.d.mts +2 -2
- package/dist/Table/TablePaginationActions.cjs +1 -1
- package/dist/Table/TablePaginationActions.d.cts +1 -1
- package/dist/Table/TablePaginationActions.d.mts +1 -1
- package/dist/Table/TablePaginationActions.mjs +1 -1
- package/dist/Table/TableRow.d.cts +2 -2
- package/dist/Table/TableRow.d.mts +2 -2
- package/dist/Table/TableSortLabel.cjs +1 -1
- package/dist/Table/TableSortLabel.d.cts +1 -1
- package/dist/Table/TableSortLabel.d.mts +1 -1
- package/dist/Table/TableSortLabel.mjs +1 -1
- package/dist/Table/hooks.d.cts +1 -1
- package/dist/Table/hooks.d.mts +1 -1
- package/dist/Table.d.cts +5 -5
- package/dist/Table.d.mts +5 -5
- package/dist/{TableContext-BrIREKe7.d.mts → TableContext-98M9MAm7.d.cts} +1 -1
- package/dist/{TableContext-DXzUQ4-a.d.cts → TableContext-BwK_fB9Q.d.mts} +1 -1
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.d.cts +2 -2
- package/dist/TextInput.d.mts +2 -2
- package/dist/TextInput.mjs +1 -1
- package/dist/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
- package/dist/Typography.cjs +1 -1
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/Typography.mjs +1 -1
- package/dist/View.cjs +2 -1
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/View.mjs +2 -1
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.mts +1 -1
- package/dist/{index-C-2VKPcp.d.mts → index-6BHvkjdp.d.cts} +3 -3
- package/dist/{index-DQ16ijxx.d.mts → index-AlVOmB-K.d.mts} +4 -4
- package/dist/{index-Btmdtbpb.d.cts → index-B2LR3Y5d.d.cts} +4 -4
- package/dist/{index-XZDPGJ_h.d.mts → index-BAKGyLEF.d.mts} +2 -2
- package/dist/{index-vuPAf55D.d.cts → index-BAb24XNa.d.cts} +3 -3
- package/dist/{index-BoIi-XoB.d.mts → index-BC98RYwO.d.mts} +3 -3
- package/dist/{index-DdBeSvit.d.mts → index-BS5dkngf.d.mts} +2 -2
- package/dist/{index-d6gR2x8j.d.cts → index-BfOZMmZA.d.cts} +2 -2
- package/dist/{index-CHRAYSwH.d.cts → index-BjMQ1Sfq.d.cts} +3 -3
- package/dist/{index-D9CwTcnr.d.cts → index-BvLNPm5C.d.cts} +2 -2
- package/dist/index-C-ACdUhw.d.mts +20 -0
- package/dist/{index-D3iQQ0L3.d.cts → index-C2e925FY.d.cts} +1 -1
- package/dist/{index-D-QRCHiS.d.cts → index-CHr4HUzH.d.mts} +2 -2
- package/dist/{index-C5-ZM7lt.d.cts → index-CJWXZFFZ.d.cts} +3 -3
- package/dist/{index-h36rcOy8.d.mts → index-COKAN6-s.d.mts} +3 -3
- package/dist/{index-Csp1Wzbz.d.cts → index-COYl2TN0.d.mts} +3 -3
- package/dist/{index-DhMAwR96.d.mts → index-CaCfFN31.d.mts} +3 -3
- package/dist/{index-jmy5eXpx.d.cts → index-CkYiijiE.d.cts} +1 -1
- package/dist/{index-Cf7w9Lod.d.cts → index-CorVAOY7.d.mts} +3 -3
- package/dist/{index-Br2gDSme.d.cts → index-D3kNrl9W.d.cts} +3 -3
- package/dist/{index-COYxtrc0.d.mts → index-D4M18wt_.d.mts} +2 -2
- package/dist/{index-DzuXwDCW.d.cts → index-D8jHpwh5.d.cts} +2 -2
- package/dist/{index-BWECJgSb.d.mts → index-DClEfecw.d.cts} +3 -3
- package/dist/{index-Oxx0z4dS.d.cts → index-DLtzp-Mg.d.mts} +3 -3
- package/dist/{index-v_otepCe.d.mts → index-DVG64KQ4.d.mts} +1 -1
- package/dist/index-Da9Sr6v7.d.cts +20 -0
- package/dist/{index-76XH-GEc.d.mts → index-Dyfu-Otn.d.mts} +1 -1
- package/dist/{index-CTVFwvju.d.mts → index-FTr8Mn3p.d.cts} +2 -2
- package/dist/{index-ggLhNdZV.d.mts → index-Fcf_SOl_.d.mts} +3 -3
- package/dist/{index-BCvkP5R1.d.mts → index-OWbQXOvw.d.cts} +3 -3
- package/dist/{index-NBVilQuP.d.mts → index-iHyGhLkM.d.mts} +1 -1
- package/dist/{index-DCu7qjpa.d.cts → index-wJbUPxSk.d.cts} +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/style.cjs +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.mts +2 -2
- package/dist/style.mjs +1 -1
- package/dist/{theme-BuqqFbsz.mjs → theme-C1o9qa2E.mjs} +99 -3
- package/dist/{theme-Bnc03K83.cjs → theme-DfAqr7qo.cjs} +152 -2
- package/dist/theme.cjs +10 -1
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.mjs +2 -2
- package/dist/{themes-kbuYiwCi.d.mts → themes-CCguU8uo.d.mts} +111 -1
- package/dist/{themes-kbuYiwCi.d.cts → themes-CtTQTVqe.d.cts} +111 -1
- package/dist/{useTablePagination-BpMOVLsR.d.cts → useTablePagination-BG93T2Od.d.cts} +1 -1
- package/dist/{useTablePagination-DebYZ6vN.d.mts → useTablePagination-jBWK8cmx.d.mts} +1 -1
- package/package.json +4 -4
- package/dist/index-DOLA1VFD.d.cts +0 -16
- package/dist/index-KZKeZDAF.d.mts +0 -16
- package/dist/{Modal-CYNcPk-2.mjs → Modal-BcsyrrpH.mjs} +1 -1
- package/dist/{Modal-CApyh_V5.cjs → Modal-CM3osOqj.cjs} +1 -1
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
const require_utils = require("./utils.cjs");
|
|
2
|
+
let _soroush_tech_styled_system = require("@soroush.tech/styled-system");
|
|
2
3
|
let react = require("react");
|
|
3
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
5
|
let _emotion_react = require("@emotion/react");
|
|
5
6
|
//#region src/theme/utils/spacing.ts
|
|
6
7
|
const spacing = (units) => `${8 * units}px`;
|
|
7
8
|
//#endregion
|
|
9
|
+
//#region src/theme/breakpoints.ts
|
|
10
|
+
/**
|
|
11
|
+
* The scale with its helpers attached as non-enumerable methods: the engine, the theme's JSON
|
|
12
|
+
* and a spread see only the sizes, while `theme.breakpoints.up('md')` works. `createTheme`
|
|
13
|
+
* and `ThemeProvider` re-attach them after a merge, so they always follow the theme's own
|
|
14
|
+
* breakpoints.
|
|
15
|
+
*/
|
|
16
|
+
const withBreakpointHelpers = (scale) => {
|
|
17
|
+
const sizes = { ...scale };
|
|
18
|
+
const helpers = {
|
|
19
|
+
...(0, _soroush_tech_styled_system.createMediaHelpers)(sizes),
|
|
20
|
+
containerQueries: (0, _soroush_tech_styled_system.createContainerQueries)(sizes)
|
|
21
|
+
};
|
|
22
|
+
for (const [name, helper] of Object.entries(helpers)) Object.defineProperty(sizes, name, {
|
|
23
|
+
value: helper,
|
|
24
|
+
enumerable: false
|
|
25
|
+
});
|
|
26
|
+
return sizes;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
8
29
|
//#region src/theme/utils/createTheme.ts
|
|
9
30
|
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
31
|
const deepMerge = (base, overrides) => {
|
|
@@ -24,8 +45,17 @@ const deepMerge = (base, overrides) => {
|
|
|
24
45
|
* - `undefined` override values are ignored - a key can be added or replaced,
|
|
25
46
|
* never removed.
|
|
26
47
|
* - Neither argument is mutated; untouched branches keep referential identity.
|
|
48
|
+
* - `breakpoints` gets its query helpers back, built from the merged sizes.
|
|
27
49
|
*/
|
|
28
|
-
const createTheme = (base, overrides) =>
|
|
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;
|
|
29
59
|
//#endregion
|
|
30
60
|
//#region src/theme/themes.ts
|
|
31
61
|
const shadow = {
|
|
@@ -141,6 +171,65 @@ const space = {
|
|
|
141
171
|
10: spacing(10),
|
|
142
172
|
auto: "auto"
|
|
143
173
|
};
|
|
174
|
+
const breakpoints = withBreakpointHelpers({
|
|
175
|
+
xs: "0px",
|
|
176
|
+
sm: "600px",
|
|
177
|
+
md: "840px",
|
|
178
|
+
lg: "1200px",
|
|
179
|
+
xl: "1600px"
|
|
180
|
+
});
|
|
181
|
+
const layout = {
|
|
182
|
+
xs: {
|
|
183
|
+
bars: { top: 8 },
|
|
184
|
+
panels: {
|
|
185
|
+
start: {
|
|
186
|
+
mode: "hidden",
|
|
187
|
+
width: "280px",
|
|
188
|
+
railWidth: 9
|
|
189
|
+
},
|
|
190
|
+
end: {
|
|
191
|
+
mode: "hidden",
|
|
192
|
+
width: "360px",
|
|
193
|
+
railWidth: 9
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
content: {
|
|
197
|
+
columns: 4,
|
|
198
|
+
margin: 2,
|
|
199
|
+
gutter: 2,
|
|
200
|
+
mode: "fluid"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
sm: {
|
|
204
|
+
panels: { start: { mode: "collapsed" } },
|
|
205
|
+
content: {
|
|
206
|
+
columns: 8,
|
|
207
|
+
margin: 4
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
md: {
|
|
211
|
+
panels: { end: { mode: "overlay" } },
|
|
212
|
+
content: {
|
|
213
|
+
columns: 12,
|
|
214
|
+
margin: 3,
|
|
215
|
+
gutter: 3
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
lg: {
|
|
219
|
+
panels: { end: { width: "412px" } },
|
|
220
|
+
content: {
|
|
221
|
+
mode: "fixed",
|
|
222
|
+
maxWidth: "1200px"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
xl: {
|
|
226
|
+
panels: {
|
|
227
|
+
start: { mode: "inline" },
|
|
228
|
+
end: { mode: "inline" }
|
|
229
|
+
},
|
|
230
|
+
content: { maxWidth: "1600px" }
|
|
231
|
+
}
|
|
232
|
+
};
|
|
144
233
|
const typography = {
|
|
145
234
|
h1: {
|
|
146
235
|
element: "h1",
|
|
@@ -232,6 +321,8 @@ const baseTheme = {
|
|
|
232
321
|
icon,
|
|
233
322
|
sizes,
|
|
234
323
|
space,
|
|
324
|
+
breakpoints,
|
|
325
|
+
layout,
|
|
235
326
|
zOrder,
|
|
236
327
|
blur: "12px",
|
|
237
328
|
colorScheme: "dark",
|
|
@@ -316,10 +407,15 @@ const baseTheme = {
|
|
|
316
407
|
shadow,
|
|
317
408
|
shadows
|
|
318
409
|
};
|
|
410
|
+
/**
|
|
411
|
+
* The query helpers for `baseTheme`'s breakpoints, as plain functions. A theme with its own
|
|
412
|
+
* breakpoints has the same helpers on `theme.breakpoints`.
|
|
413
|
+
*/
|
|
414
|
+
const { up, down, only, between, not, containerQueries } = breakpoints;
|
|
319
415
|
//#endregion
|
|
320
416
|
//#region src/theme/ThemeProvider.tsx
|
|
321
417
|
function ThemeProvider({ children, theme = baseTheme, defaults }) {
|
|
322
|
-
const value = (0, react.useMemo)(() => defaults ? createTheme(theme, { defaults }) : theme, [theme, defaults]);
|
|
418
|
+
const value = (0, react.useMemo)(() => defaults ? createTheme(theme, { defaults }) : withHelpers(theme), [theme, defaults]);
|
|
323
419
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_emotion_react.ThemeProvider, {
|
|
324
420
|
theme: value,
|
|
325
421
|
children
|
|
@@ -373,18 +469,42 @@ Object.defineProperty(exports, "baseTheme", {
|
|
|
373
469
|
return baseTheme;
|
|
374
470
|
}
|
|
375
471
|
});
|
|
472
|
+
Object.defineProperty(exports, "between", {
|
|
473
|
+
enumerable: true,
|
|
474
|
+
get: function() {
|
|
475
|
+
return between;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
376
478
|
Object.defineProperty(exports, "borderWidths", {
|
|
377
479
|
enumerable: true,
|
|
378
480
|
get: function() {
|
|
379
481
|
return borderWidths;
|
|
380
482
|
}
|
|
381
483
|
});
|
|
484
|
+
Object.defineProperty(exports, "breakpoints", {
|
|
485
|
+
enumerable: true,
|
|
486
|
+
get: function() {
|
|
487
|
+
return breakpoints;
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
Object.defineProperty(exports, "containerQueries", {
|
|
491
|
+
enumerable: true,
|
|
492
|
+
get: function() {
|
|
493
|
+
return containerQueries;
|
|
494
|
+
}
|
|
495
|
+
});
|
|
382
496
|
Object.defineProperty(exports, "createTheme", {
|
|
383
497
|
enumerable: true,
|
|
384
498
|
get: function() {
|
|
385
499
|
return createTheme;
|
|
386
500
|
}
|
|
387
501
|
});
|
|
502
|
+
Object.defineProperty(exports, "down", {
|
|
503
|
+
enumerable: true,
|
|
504
|
+
get: function() {
|
|
505
|
+
return down;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
388
508
|
Object.defineProperty(exports, "fontSizes", {
|
|
389
509
|
enumerable: true,
|
|
390
510
|
get: function() {
|
|
@@ -409,6 +529,12 @@ Object.defineProperty(exports, "icon", {
|
|
|
409
529
|
return icon;
|
|
410
530
|
}
|
|
411
531
|
});
|
|
532
|
+
Object.defineProperty(exports, "layout", {
|
|
533
|
+
enumerable: true,
|
|
534
|
+
get: function() {
|
|
535
|
+
return layout;
|
|
536
|
+
}
|
|
537
|
+
});
|
|
412
538
|
Object.defineProperty(exports, "letterSpacings", {
|
|
413
539
|
enumerable: true,
|
|
414
540
|
get: function() {
|
|
@@ -421,6 +547,18 @@ Object.defineProperty(exports, "lineHeights", {
|
|
|
421
547
|
return lineHeights;
|
|
422
548
|
}
|
|
423
549
|
});
|
|
550
|
+
Object.defineProperty(exports, "not", {
|
|
551
|
+
enumerable: true,
|
|
552
|
+
get: function() {
|
|
553
|
+
return not;
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
Object.defineProperty(exports, "only", {
|
|
557
|
+
enumerable: true,
|
|
558
|
+
get: function() {
|
|
559
|
+
return only;
|
|
560
|
+
}
|
|
561
|
+
});
|
|
424
562
|
Object.defineProperty(exports, "radii", {
|
|
425
563
|
enumerable: true,
|
|
426
564
|
get: function() {
|
|
@@ -445,6 +583,12 @@ Object.defineProperty(exports, "typography", {
|
|
|
445
583
|
return typography;
|
|
446
584
|
}
|
|
447
585
|
});
|
|
586
|
+
Object.defineProperty(exports, "up", {
|
|
587
|
+
enumerable: true,
|
|
588
|
+
get: function() {
|
|
589
|
+
return up;
|
|
590
|
+
}
|
|
591
|
+
});
|
|
448
592
|
Object.defineProperty(exports, "useDefaultProps", {
|
|
449
593
|
enumerable: true,
|
|
450
594
|
get: function() {
|
|
@@ -457,6 +601,12 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
457
601
|
return useTheme;
|
|
458
602
|
}
|
|
459
603
|
});
|
|
604
|
+
Object.defineProperty(exports, "withBreakpointHelpers", {
|
|
605
|
+
enumerable: true,
|
|
606
|
+
get: function() {
|
|
607
|
+
return withBreakpointHelpers;
|
|
608
|
+
}
|
|
609
|
+
});
|
|
460
610
|
Object.defineProperty(exports, "withTheme", {
|
|
461
611
|
enumerable: true,
|
|
462
612
|
get: function() {
|
package/dist/theme.cjs
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
|
|
3
|
-
const require_theme = require("./theme-
|
|
3
|
+
const require_theme = require("./theme-DfAqr7qo.cjs");
|
|
4
4
|
exports.ThemeProvider = require_theme.ThemeProvider;
|
|
5
5
|
exports.avatar = require_theme.avatar;
|
|
6
6
|
exports.baseTheme = require_theme.baseTheme;
|
|
7
|
+
exports.between = require_theme.between;
|
|
7
8
|
exports.borderWidths = require_theme.borderWidths;
|
|
9
|
+
exports.breakpoints = require_theme.breakpoints;
|
|
10
|
+
exports.containerQueries = require_theme.containerQueries;
|
|
8
11
|
exports.createTheme = require_theme.createTheme;
|
|
12
|
+
exports.down = require_theme.down;
|
|
9
13
|
exports.fontSizes = require_theme.fontSizes;
|
|
10
14
|
exports.fontWeights = require_theme.fontWeights;
|
|
11
15
|
exports.fonts = require_theme.fonts;
|
|
12
16
|
exports.icon = require_theme.icon;
|
|
17
|
+
exports.layout = require_theme.layout;
|
|
13
18
|
exports.letterSpacings = require_theme.letterSpacings;
|
|
14
19
|
exports.lineHeights = require_theme.lineHeights;
|
|
20
|
+
exports.not = require_theme.not;
|
|
21
|
+
exports.only = require_theme.only;
|
|
15
22
|
exports.radii = require_theme.radii;
|
|
16
23
|
exports.sizes = require_theme.sizes;
|
|
17
24
|
exports.space = require_theme.space;
|
|
18
25
|
exports.themeDefault = require_themeDefault.themeDefault;
|
|
19
26
|
exports.typography = require_theme.typography;
|
|
27
|
+
exports.up = require_theme.up;
|
|
20
28
|
exports.useDefaultProps = require_theme.useDefaultProps;
|
|
21
29
|
exports.useTheme = require_theme.useTheme;
|
|
30
|
+
exports.withBreakpointHelpers = require_theme.withBreakpointHelpers;
|
|
22
31
|
exports.withTheme = require_theme.withTheme;
|
|
23
32
|
exports.zOrder = require_theme.zOrder;
|
package/dist/theme.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as ThemeProvider, i as themeDefault, n as useDefaultProps, r as useTheme, t as withTheme } from "./index-
|
|
3
|
-
export { ButtonOwnerState, ButtonVariants, CSSObject, CardOwnerState, CardSlotIconProps, CardSlotTypographyProps, ComponentConfig, ComponentStyle, ComponentVariant, type DeepPartial, OpenScale, PaletteColor, PaletteEntry, PressableOwnerState, SizeEntry, Theme, ThemeAvatarSizes, ThemeBackground, ThemeBorder, ThemeBorderWidths, ThemeComponents, ThemeDefaults, ThemeFontWeights, ThemeFonts, ThemeIconSizes, ThemeLetterSpacings, ThemeLineHeights, type ThemeOverride, ThemePalette, ThemeProvider, ThemeRadii, ThemeShadow, ThemeSizes, ThemeSkeleton, ThemeSpace, ThemeSwitch, ThemeText, ThemeTypographyVariants, ThemeZOrder, TypographyVariant, TypographyVariantStyle, avatar, baseTheme, borderWidths, createTheme, fontSizes, fontWeights, fonts, icon, letterSpacings, lineHeights, radii, sizes, space, themeDefault, typography, useDefaultProps, useTheme, withTheme, zOrder };
|
|
1
|
+
import { $ as between, A as ThemeBreakpoints, B as ThemeRadii, C as PressableOwnerState, Ct as withBreakpointHelpers, D as ThemeBackground, E as ThemeAvatarSizes, F as ThemeIconSizes, G as ThemeSwitch, H as ThemeSizes, I as ThemeLayout, J as ThemeZOrder, K as ThemeText, L as ThemeLetterSpacings, M as ThemeDefaults, N as ThemeFontWeights, O as ThemeBorder, P as ThemeFonts, Q as baseTheme, R as ThemeLineHeights, S as PaletteEntry, St as BreakpointHelpers, T as Theme, U as ThemeSkeleton, V as ThemeShadow, W as ThemeSpace, X as TypographyVariantStyle, Y as TypographyVariant, Z as avatar, _ as LayoutPanel, _t as up, a as CSSObject, at as fontWeights, b as OpenScale, bt as ThemeOverride, c as CardSlotTypographyProps, ct as layout, d as ComponentVariant, dt as not, et as borderWidths, f as DefaultBreakpoints, ft as only, g as LayoutLength, gt as typography, h as LayoutEntry, ht as space, i as ButtonVariants, it as fontSizes, j as ThemeComponents, k as ThemeBorderWidths, l as ComponentConfig, lt as letterSpacings, m as LayoutContent, mt as sizes, n as BreakpointOverrides, nt as containerQueries, o as CardOwnerState, ot as fonts, p as LayoutBars, pt as radii, q as ThemeTypographyVariants, r as ButtonOwnerState, rt as down, s as CardSlotIconProps, st as icon, t as BreakpointKey, tt as breakpoints, u as ComponentStyle, ut as lineHeights, v as LayoutPanels, vt as zOrder, w as SizeEntry, x as PaletteColor, xt as createTheme, y as LayoutSpace, yt as DeepPartial, z as ThemePalette } from "./themes-CtTQTVqe.cjs";
|
|
2
|
+
import { a as ThemeProvider, i as themeDefault, n as useDefaultProps, r as useTheme, t as withTheme } from "./index-C2e925FY.cjs";
|
|
3
|
+
export { BreakpointHelpers, BreakpointKey, BreakpointOverrides, ButtonOwnerState, ButtonVariants, CSSObject, CardOwnerState, CardSlotIconProps, CardSlotTypographyProps, ComponentConfig, ComponentStyle, ComponentVariant, type DeepPartial, DefaultBreakpoints, LayoutBars, LayoutContent, LayoutEntry, LayoutLength, LayoutPanel, LayoutPanels, LayoutSpace, OpenScale, PaletteColor, PaletteEntry, PressableOwnerState, SizeEntry, Theme, ThemeAvatarSizes, ThemeBackground, ThemeBorder, ThemeBorderWidths, ThemeBreakpoints, ThemeComponents, ThemeDefaults, ThemeFontWeights, ThemeFonts, ThemeIconSizes, ThemeLayout, ThemeLetterSpacings, ThemeLineHeights, type ThemeOverride, ThemePalette, ThemeProvider, ThemeRadii, ThemeShadow, ThemeSizes, ThemeSkeleton, ThemeSpace, ThemeSwitch, ThemeText, ThemeTypographyVariants, ThemeZOrder, TypographyVariant, TypographyVariantStyle, avatar, baseTheme, between, borderWidths, breakpoints, containerQueries, createTheme, down, fontSizes, fontWeights, fonts, icon, layout, letterSpacings, lineHeights, not, only, radii, sizes, space, themeDefault, typography, up, useDefaultProps, useTheme, withBreakpointHelpers, withTheme, zOrder };
|
package/dist/theme.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as ThemeProvider, i as themeDefault, n as useDefaultProps, r as useTheme, t as withTheme } from "./index-
|
|
3
|
-
export { ButtonOwnerState, ButtonVariants, CSSObject, CardOwnerState, CardSlotIconProps, CardSlotTypographyProps, ComponentConfig, ComponentStyle, ComponentVariant, type DeepPartial, OpenScale, PaletteColor, PaletteEntry, PressableOwnerState, SizeEntry, Theme, ThemeAvatarSizes, ThemeBackground, ThemeBorder, ThemeBorderWidths, ThemeComponents, ThemeDefaults, ThemeFontWeights, ThemeFonts, ThemeIconSizes, ThemeLetterSpacings, ThemeLineHeights, type ThemeOverride, ThemePalette, ThemeProvider, ThemeRadii, ThemeShadow, ThemeSizes, ThemeSkeleton, ThemeSpace, ThemeSwitch, ThemeText, ThemeTypographyVariants, ThemeZOrder, TypographyVariant, TypographyVariantStyle, avatar, baseTheme, borderWidths, createTheme, fontSizes, fontWeights, fonts, icon, letterSpacings, lineHeights, radii, sizes, space, themeDefault, typography, useDefaultProps, useTheme, withTheme, zOrder };
|
|
1
|
+
import { $ as between, A as ThemeBreakpoints, B as ThemeRadii, C as PressableOwnerState, Ct as withBreakpointHelpers, D as ThemeBackground, E as ThemeAvatarSizes, F as ThemeIconSizes, G as ThemeSwitch, H as ThemeSizes, I as ThemeLayout, J as ThemeZOrder, K as ThemeText, L as ThemeLetterSpacings, M as ThemeDefaults, N as ThemeFontWeights, O as ThemeBorder, P as ThemeFonts, Q as baseTheme, R as ThemeLineHeights, S as PaletteEntry, St as BreakpointHelpers, T as Theme, U as ThemeSkeleton, V as ThemeShadow, W as ThemeSpace, X as TypographyVariantStyle, Y as TypographyVariant, Z as avatar, _ as LayoutPanel, _t as up, a as CSSObject, at as fontWeights, b as OpenScale, bt as ThemeOverride, c as CardSlotTypographyProps, ct as layout, d as ComponentVariant, dt as not, et as borderWidths, f as DefaultBreakpoints, ft as only, g as LayoutLength, gt as typography, h as LayoutEntry, ht as space, i as ButtonVariants, it as fontSizes, j as ThemeComponents, k as ThemeBorderWidths, l as ComponentConfig, lt as letterSpacings, m as LayoutContent, mt as sizes, n as BreakpointOverrides, nt as containerQueries, o as CardOwnerState, ot as fonts, p as LayoutBars, pt as radii, q as ThemeTypographyVariants, r as ButtonOwnerState, rt as down, s as CardSlotIconProps, st as icon, t as BreakpointKey, tt as breakpoints, u as ComponentStyle, ut as lineHeights, v as LayoutPanels, vt as zOrder, w as SizeEntry, x as PaletteColor, xt as createTheme, y as LayoutSpace, yt as DeepPartial, z as ThemePalette } from "./themes-CCguU8uo.mjs";
|
|
2
|
+
import { a as ThemeProvider, i as themeDefault, n as useDefaultProps, r as useTheme, t as withTheme } from "./index-iHyGhLkM.mjs";
|
|
3
|
+
export { BreakpointHelpers, BreakpointKey, BreakpointOverrides, ButtonOwnerState, ButtonVariants, CSSObject, CardOwnerState, CardSlotIconProps, CardSlotTypographyProps, ComponentConfig, ComponentStyle, ComponentVariant, type DeepPartial, DefaultBreakpoints, LayoutBars, LayoutContent, LayoutEntry, LayoutLength, LayoutPanel, LayoutPanels, LayoutSpace, OpenScale, PaletteColor, PaletteEntry, PressableOwnerState, SizeEntry, Theme, ThemeAvatarSizes, ThemeBackground, ThemeBorder, ThemeBorderWidths, ThemeBreakpoints, ThemeComponents, ThemeDefaults, ThemeFontWeights, ThemeFonts, ThemeIconSizes, ThemeLayout, ThemeLetterSpacings, ThemeLineHeights, type ThemeOverride, ThemePalette, ThemeProvider, ThemeRadii, ThemeShadow, ThemeSizes, ThemeSkeleton, ThemeSpace, ThemeSwitch, ThemeText, ThemeTypographyVariants, ThemeZOrder, TypographyVariant, TypographyVariantStyle, avatar, baseTheme, between, borderWidths, breakpoints, containerQueries, createTheme, down, fontSizes, fontWeights, fonts, icon, layout, letterSpacings, lineHeights, not, only, radii, sizes, space, themeDefault, typography, up, useDefaultProps, useTheme, withBreakpointHelpers, withTheme, zOrder };
|
package/dist/theme.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
|
|
2
|
-
import { _ as
|
|
3
|
-
export { ThemeProvider, avatar, baseTheme, borderWidths, createTheme, fontSizes, fontWeights, fonts, icon, letterSpacings, lineHeights, radii, sizes, space, themeDefault, typography, useDefaultProps, useTheme, withTheme, zOrder };
|
|
2
|
+
import { C as space, D as createTheme, E as zOrder, O as withBreakpointHelpers, S as sizes, T as up, _ as letterSpacings, a as avatar, b as only, c as borderWidths, d as down, f as fontSizes, g as layout, h as icon, i as ThemeProvider, l as breakpoints, m as fonts, n as useDefaultProps, o as baseTheme, p as fontWeights, r as useTheme, s as between, t as withTheme, u as containerQueries, v as lineHeights, w as typography, x as radii, y as not } from "./theme-C1o9qa2E.mjs";
|
|
3
|
+
export { ThemeProvider, avatar, baseTheme, between, borderWidths, breakpoints, containerQueries, createTheme, down, fontSizes, fontWeights, fonts, icon, layout, letterSpacings, lineHeights, not, only, radii, sizes, space, themeDefault, typography, up, useDefaultProps, useTheme, withBreakpointHelpers, withTheme, zOrder };
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { CSSObject } from "@emotion/react";
|
|
2
|
+
import { ContainerQueries, QueryHelpers } from "@soroush.tech/styled-system";
|
|
2
3
|
import { ElementType } from "react";
|
|
4
|
+
//#region src/theme/breakpoints.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The query helpers a theme's breakpoint scale carries: `up` / `down` / `only` / `between` /
|
|
7
|
+
* `not` as `@media` rules, and `containerQueries` for the same sizes as `@container` rules.
|
|
8
|
+
*/
|
|
9
|
+
interface BreakpointHelpers extends QueryHelpers {
|
|
10
|
+
containerQueries: ContainerQueries;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The scale with its helpers attached as non-enumerable methods: the engine, the theme's JSON
|
|
14
|
+
* and a spread see only the sizes, while `theme.breakpoints.up('md')` works. `createTheme`
|
|
15
|
+
* and `ThemeProvider` re-attach them after a merge, so they always follow the theme's own
|
|
16
|
+
* breakpoints.
|
|
17
|
+
*/
|
|
18
|
+
declare const withBreakpointHelpers: <Scale extends Record<string, string | number>>(scale: Scale) => Scale & BreakpointHelpers;
|
|
19
|
+
//#endregion
|
|
3
20
|
//#region src/theme/utils/createTheme.d.ts
|
|
4
21
|
/**
|
|
5
22
|
* Recursive partial of a theme shape. Plain objects recurse; arrays and
|
|
@@ -16,6 +33,7 @@ type ThemeOverride = DeepPartial<Theme>;
|
|
|
16
33
|
* - `undefined` override values are ignored - a key can be added or replaced,
|
|
17
34
|
* never removed.
|
|
18
35
|
* - Neither argument is mutated; untouched branches keep referential identity.
|
|
36
|
+
* - `breakpoints` gets its query helpers back, built from the merged sizes.
|
|
19
37
|
*/
|
|
20
38
|
declare const createTheme: (base: Theme, overrides: ThemeOverride) => Theme;
|
|
21
39
|
//#endregion
|
|
@@ -187,6 +205,89 @@ interface ThemeSizes {
|
|
|
187
205
|
* forces the matching icon size to be supplied.
|
|
188
206
|
*/
|
|
189
207
|
type ThemeIconSizes = { [K in keyof ThemeSizes]: string; };
|
|
208
|
+
/** The default breakpoint names - Material 3's window classes. */
|
|
209
|
+
interface DefaultBreakpoints {
|
|
210
|
+
/** compact: 0-599px - the base, applies everywhere until `sm` overrides it. */
|
|
211
|
+
xs: true;
|
|
212
|
+
/** medium: 600-839px. */
|
|
213
|
+
sm: true;
|
|
214
|
+
/** expanded: 840-1199px. */
|
|
215
|
+
md: true;
|
|
216
|
+
/** large: 1200-1599px. */
|
|
217
|
+
lg: true;
|
|
218
|
+
/** extra-large: 1600px and up. */
|
|
219
|
+
xl: true;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Add, rename or remove breakpoints by augmenting this interface: `true` adds a name, `false`
|
|
223
|
+
* removes a default one.
|
|
224
|
+
*
|
|
225
|
+
* declare module '@soroush.tech/design-system/theme' {
|
|
226
|
+
* interface BreakpointOverrides { mobile: true; tablet: true; xs: false; sm: false }
|
|
227
|
+
* }
|
|
228
|
+
*/
|
|
229
|
+
interface BreakpointOverrides {}
|
|
230
|
+
/** The theme's breakpoint names: the defaults, plus every override set to `true`, minus every one set to `false`. */
|
|
231
|
+
type BreakpointKey = Exclude<keyof DefaultBreakpoints | keyof BreakpointOverrides, { [K in keyof BreakpointOverrides]: BreakpointOverrides[K] extends false ? K : never; }[keyof BreakpointOverrides]>;
|
|
232
|
+
/**
|
|
233
|
+
* `theme.breakpoints`: where each window class starts, ascending, in declared order. A key holds
|
|
234
|
+
* from its value until the next key, so `xs: '0px'` applies everywhere until `sm` overrides it;
|
|
235
|
+
* media queries are min-width, which is why the theme writes the start of each range. Responsive
|
|
236
|
+
* props map onto the keys by name, or by position for an array. A value is a CSS length; a
|
|
237
|
+
* media condition or a full `@media` rule is passed through, without the range helpers.
|
|
238
|
+
* `createTheme` appends a breakpoint you add after the existing ones, so it must be larger.
|
|
239
|
+
*/
|
|
240
|
+
type ThemeBreakpoints = { [K in BreakpointKey]: string; };
|
|
241
|
+
/** A `theme.space` key - layout margins and gutters step on the spacing scale. */
|
|
242
|
+
type LayoutSpace = Exclude<keyof ThemeSpace, 'auto'>;
|
|
243
|
+
/** A `theme.space` key or a CSS length (a 280px panel is a size, not a spacing step). */
|
|
244
|
+
type LayoutLength = LayoutSpace | string;
|
|
245
|
+
/** Bar heights at the top and bottom of the page; `0` removes an inherited bar. */
|
|
246
|
+
interface LayoutBars {
|
|
247
|
+
top?: LayoutLength;
|
|
248
|
+
bottom?: LayoutLength;
|
|
249
|
+
}
|
|
250
|
+
/** A side panel: a track (`inline`), over the content (`overlay`), its rail (`collapsed`) or absent (`hidden`). */
|
|
251
|
+
interface LayoutPanel {
|
|
252
|
+
mode: 'inline' | 'overlay' | 'collapsed' | 'hidden';
|
|
253
|
+
/** Open width. */
|
|
254
|
+
width: LayoutLength;
|
|
255
|
+
/** Collapsed width. */
|
|
256
|
+
railWidth: LayoutLength;
|
|
257
|
+
}
|
|
258
|
+
/** Side panels by logical side - `start` and `end` flip in RTL. */
|
|
259
|
+
interface LayoutPanels {
|
|
260
|
+
start?: LayoutPanel;
|
|
261
|
+
end?: LayoutPanel;
|
|
262
|
+
}
|
|
263
|
+
/** The content columns, measured in the space the bars and inline panels leave. */
|
|
264
|
+
interface LayoutContent {
|
|
265
|
+
columns: number;
|
|
266
|
+
/** Inline padding of the content. */
|
|
267
|
+
margin: LayoutSpace;
|
|
268
|
+
/** Gap between columns. */
|
|
269
|
+
gutter: LayoutSpace;
|
|
270
|
+
/** `fluid` spans the space; `fixed` is a container centred at `maxWidth`. */
|
|
271
|
+
mode: 'fluid' | 'fixed';
|
|
272
|
+
maxWidth?: LayoutLength;
|
|
273
|
+
}
|
|
274
|
+
/** The page layout at one breakpoint. */
|
|
275
|
+
interface LayoutEntry {
|
|
276
|
+
bars: LayoutBars;
|
|
277
|
+
panels: LayoutPanels;
|
|
278
|
+
content: LayoutContent;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* `theme.layout`: layout tokens per breakpoint, merged mobile-first in breakpoint order. The
|
|
282
|
+
* first breakpoint's entry (`xs`) is complete; every later one lists only what changes. A panel
|
|
283
|
+
* first declared at a later breakpoint needs its `mode`, `width` and `railWidth` there. These
|
|
284
|
+
* are tokens: apps (and the studio) read them; nothing in the design system lays a page out.
|
|
285
|
+
*/
|
|
286
|
+
type ThemeLayout = { [K in BreakpointKey]?: {
|
|
287
|
+
bars?: LayoutBars;
|
|
288
|
+
panels?: { [P in keyof LayoutPanels]?: Partial<LayoutPanel>; };
|
|
289
|
+
content?: Partial<LayoutContent>;
|
|
290
|
+
}; };
|
|
190
291
|
/** Style of one typography variant. */
|
|
191
292
|
interface TypographyVariantStyle {
|
|
192
293
|
element: ElementType;
|
|
@@ -402,6 +503,8 @@ interface Theme {
|
|
|
402
503
|
/** Optional per-component customization - see `ThemeComponents`. */
|
|
403
504
|
components?: OpenScale<ThemeComponents>;
|
|
404
505
|
space: OpenScale<ThemeSpace>;
|
|
506
|
+
breakpoints: OpenScale<ThemeBreakpoints & BreakpointHelpers>;
|
|
507
|
+
layout: ThemeLayout;
|
|
405
508
|
border: OpenScale<ThemeBorder>;
|
|
406
509
|
text: OpenScale<ThemeText>;
|
|
407
510
|
background: OpenScale<ThemeBackground>;
|
|
@@ -493,11 +596,18 @@ declare const avatar: {
|
|
|
493
596
|
declare const icon: ThemeIconSizes;
|
|
494
597
|
declare const sizes: ThemeSizes;
|
|
495
598
|
declare const space: ThemeSpace;
|
|
599
|
+
declare const breakpoints: ThemeBreakpoints & BreakpointHelpers;
|
|
600
|
+
declare const layout: ThemeLayout;
|
|
496
601
|
declare const typography: ThemeTypographyVariants;
|
|
497
602
|
/**
|
|
498
603
|
* The package's complete default theme (dark-schemed). Raw hex only - palettes
|
|
499
604
|
* belong to the consumer, who builds brand themes with `createTheme(baseTheme, ...)`.
|
|
500
605
|
*/
|
|
501
606
|
declare const baseTheme: Theme;
|
|
607
|
+
/**
|
|
608
|
+
* The query helpers for `baseTheme`'s breakpoints, as plain functions. A theme with its own
|
|
609
|
+
* breakpoints has the same helpers on `theme.breakpoints`.
|
|
610
|
+
*/
|
|
611
|
+
declare const up: (from: import("@soroush.tech/styled-system").BreakpointInput) => string, down: (to: import("@soroush.tech/styled-system").BreakpointInput) => string, only: (key: string) => string, between: (from: import("@soroush.tech/styled-system").BreakpointInput, to: import("@soroush.tech/styled-system").BreakpointInput) => string, not: (key: string) => string, containerQueries: import("@soroush.tech/styled-system").ContainerQueries;
|
|
502
612
|
//#endregion
|
|
503
|
-
export {
|
|
613
|
+
export { between as $, ThemeBreakpoints as A, ThemeRadii as B, PressableOwnerState as C, withBreakpointHelpers as Ct, ThemeBackground as D, ThemeAvatarSizes as E, ThemeIconSizes as F, ThemeSwitch as G, ThemeSizes as H, ThemeLayout as I, ThemeZOrder as J, ThemeText as K, ThemeLetterSpacings as L, ThemeDefaults as M, ThemeFontWeights as N, ThemeBorder as O, ThemeFonts as P, baseTheme as Q, ThemeLineHeights as R, PaletteEntry as S, BreakpointHelpers as St, Theme as T, ThemeSkeleton as U, ThemeShadow as V, ThemeSpace as W, TypographyVariantStyle as X, TypographyVariant as Y, avatar as Z, LayoutPanel as _, up as _t, CSSObject$1 as a, fontWeights as at, OpenScale as b, ThemeOverride as bt, CardSlotTypographyProps as c, layout as ct, ComponentVariant as d, not as dt, borderWidths as et, DefaultBreakpoints as f, only as ft, LayoutLength as g, typography as gt, LayoutEntry as h, space as ht, ButtonVariants as i, fontSizes as it, ThemeComponents as j, ThemeBorderWidths as k, ComponentConfig as l, letterSpacings as lt, LayoutContent as m, sizes as mt, BreakpointOverrides as n, containerQueries as nt, CardOwnerState as o, fonts as ot, LayoutBars as p, radii as pt, ThemeTypographyVariants as q, ButtonOwnerState as r, down as rt, CardSlotIconProps as s, icon as st, BreakpointKey as t, breakpoints as tt, ComponentStyle as u, lineHeights as ut, LayoutPanels as v, zOrder as vt, SizeEntry as w, PaletteColor as x, createTheme as xt, LayoutSpace as y, DeepPartial as yt, ThemePalette as z };
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { CSSObject } from "@emotion/react";
|
|
2
2
|
import { ElementType } from "react";
|
|
3
|
+
import { ContainerQueries, QueryHelpers } from "@soroush.tech/styled-system";
|
|
4
|
+
//#region src/theme/breakpoints.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The query helpers a theme's breakpoint scale carries: `up` / `down` / `only` / `between` /
|
|
7
|
+
* `not` as `@media` rules, and `containerQueries` for the same sizes as `@container` rules.
|
|
8
|
+
*/
|
|
9
|
+
interface BreakpointHelpers extends QueryHelpers {
|
|
10
|
+
containerQueries: ContainerQueries;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The scale with its helpers attached as non-enumerable methods: the engine, the theme's JSON
|
|
14
|
+
* and a spread see only the sizes, while `theme.breakpoints.up('md')` works. `createTheme`
|
|
15
|
+
* and `ThemeProvider` re-attach them after a merge, so they always follow the theme's own
|
|
16
|
+
* breakpoints.
|
|
17
|
+
*/
|
|
18
|
+
declare const withBreakpointHelpers: <Scale extends Record<string, string | number>>(scale: Scale) => Scale & BreakpointHelpers;
|
|
19
|
+
//#endregion
|
|
3
20
|
//#region src/theme/utils/createTheme.d.ts
|
|
4
21
|
/**
|
|
5
22
|
* Recursive partial of a theme shape. Plain objects recurse; arrays and
|
|
@@ -16,6 +33,7 @@ type ThemeOverride = DeepPartial<Theme>;
|
|
|
16
33
|
* - `undefined` override values are ignored - a key can be added or replaced,
|
|
17
34
|
* never removed.
|
|
18
35
|
* - Neither argument is mutated; untouched branches keep referential identity.
|
|
36
|
+
* - `breakpoints` gets its query helpers back, built from the merged sizes.
|
|
19
37
|
*/
|
|
20
38
|
declare const createTheme: (base: Theme, overrides: ThemeOverride) => Theme;
|
|
21
39
|
//#endregion
|
|
@@ -187,6 +205,89 @@ interface ThemeSizes {
|
|
|
187
205
|
* forces the matching icon size to be supplied.
|
|
188
206
|
*/
|
|
189
207
|
type ThemeIconSizes = { [K in keyof ThemeSizes]: string; };
|
|
208
|
+
/** The default breakpoint names - Material 3's window classes. */
|
|
209
|
+
interface DefaultBreakpoints {
|
|
210
|
+
/** compact: 0-599px - the base, applies everywhere until `sm` overrides it. */
|
|
211
|
+
xs: true;
|
|
212
|
+
/** medium: 600-839px. */
|
|
213
|
+
sm: true;
|
|
214
|
+
/** expanded: 840-1199px. */
|
|
215
|
+
md: true;
|
|
216
|
+
/** large: 1200-1599px. */
|
|
217
|
+
lg: true;
|
|
218
|
+
/** extra-large: 1600px and up. */
|
|
219
|
+
xl: true;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Add, rename or remove breakpoints by augmenting this interface: `true` adds a name, `false`
|
|
223
|
+
* removes a default one.
|
|
224
|
+
*
|
|
225
|
+
* declare module '@soroush.tech/design-system/theme' {
|
|
226
|
+
* interface BreakpointOverrides { mobile: true; tablet: true; xs: false; sm: false }
|
|
227
|
+
* }
|
|
228
|
+
*/
|
|
229
|
+
interface BreakpointOverrides {}
|
|
230
|
+
/** The theme's breakpoint names: the defaults, plus every override set to `true`, minus every one set to `false`. */
|
|
231
|
+
type BreakpointKey = Exclude<keyof DefaultBreakpoints | keyof BreakpointOverrides, { [K in keyof BreakpointOverrides]: BreakpointOverrides[K] extends false ? K : never; }[keyof BreakpointOverrides]>;
|
|
232
|
+
/**
|
|
233
|
+
* `theme.breakpoints`: where each window class starts, ascending, in declared order. A key holds
|
|
234
|
+
* from its value until the next key, so `xs: '0px'` applies everywhere until `sm` overrides it;
|
|
235
|
+
* media queries are min-width, which is why the theme writes the start of each range. Responsive
|
|
236
|
+
* props map onto the keys by name, or by position for an array. A value is a CSS length; a
|
|
237
|
+
* media condition or a full `@media` rule is passed through, without the range helpers.
|
|
238
|
+
* `createTheme` appends a breakpoint you add after the existing ones, so it must be larger.
|
|
239
|
+
*/
|
|
240
|
+
type ThemeBreakpoints = { [K in BreakpointKey]: string; };
|
|
241
|
+
/** A `theme.space` key - layout margins and gutters step on the spacing scale. */
|
|
242
|
+
type LayoutSpace = Exclude<keyof ThemeSpace, 'auto'>;
|
|
243
|
+
/** A `theme.space` key or a CSS length (a 280px panel is a size, not a spacing step). */
|
|
244
|
+
type LayoutLength = LayoutSpace | string;
|
|
245
|
+
/** Bar heights at the top and bottom of the page; `0` removes an inherited bar. */
|
|
246
|
+
interface LayoutBars {
|
|
247
|
+
top?: LayoutLength;
|
|
248
|
+
bottom?: LayoutLength;
|
|
249
|
+
}
|
|
250
|
+
/** A side panel: a track (`inline`), over the content (`overlay`), its rail (`collapsed`) or absent (`hidden`). */
|
|
251
|
+
interface LayoutPanel {
|
|
252
|
+
mode: 'inline' | 'overlay' | 'collapsed' | 'hidden';
|
|
253
|
+
/** Open width. */
|
|
254
|
+
width: LayoutLength;
|
|
255
|
+
/** Collapsed width. */
|
|
256
|
+
railWidth: LayoutLength;
|
|
257
|
+
}
|
|
258
|
+
/** Side panels by logical side - `start` and `end` flip in RTL. */
|
|
259
|
+
interface LayoutPanels {
|
|
260
|
+
start?: LayoutPanel;
|
|
261
|
+
end?: LayoutPanel;
|
|
262
|
+
}
|
|
263
|
+
/** The content columns, measured in the space the bars and inline panels leave. */
|
|
264
|
+
interface LayoutContent {
|
|
265
|
+
columns: number;
|
|
266
|
+
/** Inline padding of the content. */
|
|
267
|
+
margin: LayoutSpace;
|
|
268
|
+
/** Gap between columns. */
|
|
269
|
+
gutter: LayoutSpace;
|
|
270
|
+
/** `fluid` spans the space; `fixed` is a container centred at `maxWidth`. */
|
|
271
|
+
mode: 'fluid' | 'fixed';
|
|
272
|
+
maxWidth?: LayoutLength;
|
|
273
|
+
}
|
|
274
|
+
/** The page layout at one breakpoint. */
|
|
275
|
+
interface LayoutEntry {
|
|
276
|
+
bars: LayoutBars;
|
|
277
|
+
panels: LayoutPanels;
|
|
278
|
+
content: LayoutContent;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* `theme.layout`: layout tokens per breakpoint, merged mobile-first in breakpoint order. The
|
|
282
|
+
* first breakpoint's entry (`xs`) is complete; every later one lists only what changes. A panel
|
|
283
|
+
* first declared at a later breakpoint needs its `mode`, `width` and `railWidth` there. These
|
|
284
|
+
* are tokens: apps (and the studio) read them; nothing in the design system lays a page out.
|
|
285
|
+
*/
|
|
286
|
+
type ThemeLayout = { [K in BreakpointKey]?: {
|
|
287
|
+
bars?: LayoutBars;
|
|
288
|
+
panels?: { [P in keyof LayoutPanels]?: Partial<LayoutPanel>; };
|
|
289
|
+
content?: Partial<LayoutContent>;
|
|
290
|
+
}; };
|
|
190
291
|
/** Style of one typography variant. */
|
|
191
292
|
interface TypographyVariantStyle {
|
|
192
293
|
element: ElementType;
|
|
@@ -402,6 +503,8 @@ interface Theme {
|
|
|
402
503
|
/** Optional per-component customization - see `ThemeComponents`. */
|
|
403
504
|
components?: OpenScale<ThemeComponents>;
|
|
404
505
|
space: OpenScale<ThemeSpace>;
|
|
506
|
+
breakpoints: OpenScale<ThemeBreakpoints & BreakpointHelpers>;
|
|
507
|
+
layout: ThemeLayout;
|
|
405
508
|
border: OpenScale<ThemeBorder>;
|
|
406
509
|
text: OpenScale<ThemeText>;
|
|
407
510
|
background: OpenScale<ThemeBackground>;
|
|
@@ -493,11 +596,18 @@ declare const avatar: {
|
|
|
493
596
|
declare const icon: ThemeIconSizes;
|
|
494
597
|
declare const sizes: ThemeSizes;
|
|
495
598
|
declare const space: ThemeSpace;
|
|
599
|
+
declare const breakpoints: ThemeBreakpoints & BreakpointHelpers;
|
|
600
|
+
declare const layout: ThemeLayout;
|
|
496
601
|
declare const typography: ThemeTypographyVariants;
|
|
497
602
|
/**
|
|
498
603
|
* The package's complete default theme (dark-schemed). Raw hex only - palettes
|
|
499
604
|
* belong to the consumer, who builds brand themes with `createTheme(baseTheme, ...)`.
|
|
500
605
|
*/
|
|
501
606
|
declare const baseTheme: Theme;
|
|
607
|
+
/**
|
|
608
|
+
* The query helpers for `baseTheme`'s breakpoints, as plain functions. A theme with its own
|
|
609
|
+
* breakpoints has the same helpers on `theme.breakpoints`.
|
|
610
|
+
*/
|
|
611
|
+
declare const up: (from: import("@soroush.tech/styled-system").BreakpointInput) => string, down: (to: import("@soroush.tech/styled-system").BreakpointInput) => string, only: (key: string) => string, between: (from: import("@soroush.tech/styled-system").BreakpointInput, to: import("@soroush.tech/styled-system").BreakpointInput) => string, not: (key: string) => string, containerQueries: import("@soroush.tech/styled-system").ContainerQueries;
|
|
502
612
|
//#endregion
|
|
503
|
-
export {
|
|
613
|
+
export { between as $, ThemeBreakpoints as A, ThemeRadii as B, PressableOwnerState as C, withBreakpointHelpers as Ct, ThemeBackground as D, ThemeAvatarSizes as E, ThemeIconSizes as F, ThemeSwitch as G, ThemeSizes as H, ThemeLayout as I, ThemeZOrder as J, ThemeText as K, ThemeLetterSpacings as L, ThemeDefaults as M, ThemeFontWeights as N, ThemeBorder as O, ThemeFonts as P, baseTheme as Q, ThemeLineHeights as R, PaletteEntry as S, BreakpointHelpers as St, Theme as T, ThemeSkeleton as U, ThemeShadow as V, ThemeSpace as W, TypographyVariantStyle as X, TypographyVariant as Y, avatar as Z, LayoutPanel as _, up as _t, CSSObject$1 as a, fontWeights as at, OpenScale as b, ThemeOverride as bt, CardSlotTypographyProps as c, layout as ct, ComponentVariant as d, not as dt, borderWidths as et, DefaultBreakpoints as f, only as ft, LayoutLength as g, typography as gt, LayoutEntry as h, space as ht, ButtonVariants as i, fontSizes as it, ThemeComponents as j, ThemeBorderWidths as k, ComponentConfig as l, letterSpacings as lt, LayoutContent as m, sizes as mt, BreakpointOverrides as n, containerQueries as nt, CardOwnerState as o, fonts as ot, LayoutBars as p, radii as pt, ThemeTypographyVariants as q, ButtonOwnerState as r, down as rt, CardSlotIconProps as s, icon as st, BreakpointKey as t, breakpoints as tt, ComponentStyle as u, lineHeights as ut, LayoutPanels as v, zOrder as vt, SizeEntry as w, PaletteColor as x, createTheme as xt, LayoutSpace as y, DeepPartial as yt, ThemePalette as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TableSortLabelDirection } from "./index-
|
|
1
|
+
import { n as TableSortLabelDirection } from "./index-BAb24XNa.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-Fcf_SOl_.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 {
|