@uni-design-system/uni-react 8.3.1 → 9.0.0
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/CHANGELOG.md +79 -0
- package/README.md +26 -2
- package/dist/cjs/index.cjs +323 -33
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +324 -34
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/layout/box/box.component.d.ts +21 -0
- package/dist/types/components/layout/box/box.component.d.ts.map +1 -0
- package/dist/types/components/layout/box/box.stories.d.ts +11 -0
- package/dist/types/components/layout/box/box.stories.d.ts.map +1 -0
- package/dist/types/components/layout/box/box.styles.d.ts +77 -0
- package/dist/types/components/layout/box/box.styles.d.ts.map +1 -0
- package/dist/types/components/layout/box/index.d.ts +3 -0
- package/dist/types/components/layout/box/index.d.ts.map +1 -0
- package/dist/types/components/layout/center/center.component.d.ts +7 -0
- package/dist/types/components/layout/center/center.component.d.ts.map +1 -0
- package/dist/types/components/layout/center/center.stories.d.ts +7 -0
- package/dist/types/components/layout/center/center.stories.d.ts.map +1 -0
- package/dist/types/components/layout/center/index.d.ts +2 -0
- package/dist/types/components/layout/center/index.d.ts.map +1 -0
- package/dist/types/components/layout/grid/grid-area/grid-area.component.d.ts +11 -0
- package/dist/types/components/layout/grid/grid-area/grid-area.component.d.ts.map +1 -0
- package/dist/types/components/layout/grid/grid-area/index.d.ts +2 -0
- package/dist/types/components/layout/grid/grid-area/index.d.ts.map +1 -0
- package/dist/types/components/layout/grid/grid.component.d.ts +24 -0
- package/dist/types/components/layout/grid/grid.component.d.ts.map +1 -0
- package/dist/types/components/layout/grid/grid.stories.d.ts +7 -0
- package/dist/types/components/layout/grid/grid.stories.d.ts.map +1 -0
- package/dist/types/components/layout/grid/index.d.ts +3 -0
- package/dist/types/components/layout/grid/index.d.ts.map +1 -0
- package/dist/types/components/layout/index.d.ts +7 -0
- package/dist/types/components/layout/index.d.ts.map +1 -0
- package/dist/types/components/layout/layout.spec.d.ts +2 -0
- package/dist/types/components/layout/layout.spec.d.ts.map +1 -0
- package/dist/types/components/layout/row/index.d.ts +2 -0
- package/dist/types/components/layout/row/index.d.ts.map +1 -0
- package/dist/types/components/layout/row/row.component.d.ts +13 -0
- package/dist/types/components/layout/row/row.component.d.ts.map +1 -0
- package/dist/types/components/layout/row/row.stories.d.ts +7 -0
- package/dist/types/components/layout/row/row.stories.d.ts.map +1 -0
- package/dist/types/components/layout/stack/index.d.ts +2 -0
- package/dist/types/components/layout/stack/index.d.ts.map +1 -0
- package/dist/types/components/layout/stack/stack.component.d.ts +13 -0
- package/dist/types/components/layout/stack/stack.component.d.ts.map +1 -0
- package/dist/types/components/layout/stack/stack.stories.d.ts +7 -0
- package/dist/types/components/layout/stack/stack.stories.d.ts.map +1 -0
- package/dist/types/components/layout/wrap/index.d.ts +2 -0
- package/dist/types/components/layout/wrap/index.d.ts.map +1 -0
- package/dist/types/components/layout/wrap/wrap.component.d.ts +7 -0
- package/dist/types/components/layout/wrap/wrap.component.d.ts.map +1 -0
- package/dist/types/components/layout/wrap/wrap.stories.d.ts +7 -0
- package/dist/types/components/layout/wrap/wrap.stories.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/polymorphic/index.d.ts +2 -0
- package/dist/types/core/polymorphic/index.d.ts.map +1 -0
- package/dist/types/core/polymorphic/polymorphic.types.d.ts +27 -0
- package/dist/types/core/polymorphic/polymorphic.types.d.ts.map +1 -0
- package/dist/types/core/theme/index.d.ts +1 -0
- package/dist/types/core/theme/index.d.ts.map +1 -1
- package/dist/types/core/theme/theme.styles.d.ts +52 -0
- package/dist/types/core/theme/theme.styles.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/number.helper.d.ts +2 -0
- package/dist/types/utils/number.helper.d.ts.map +1 -0
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
# @uni-design-system/uni-react
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`8250162`](https://github.com/uni-design-system/uni/commit/8250162c35e418f976080904df4c20783feeb6e2) Thanks [@gaenglish](https://github.com/gaenglish)! - Every deprecated API is removed. The library now carries no `@deprecated`
|
|
8
|
+
symbols at all.
|
|
9
|
+
|
|
10
|
+
**Per-component duration options → the `motion` scale.** Six components carried
|
|
11
|
+
their own duration knob that predated the motion scale and _won over_ it:
|
|
12
|
+
`expand.transitionSpeed`, `callout.transitionMs`, `radio.transitionSpeed`,
|
|
13
|
+
`menuItem.transitionSpeed`, `alert.transitionSpeed` and
|
|
14
|
+
`snackbar.transitionDelay`. All are gone, along with the precedence branch each
|
|
15
|
+
one required — timing now comes from the token, full stop.
|
|
16
|
+
|
|
17
|
+
Retime the token instead; one edit covers every component pointing at it. To
|
|
18
|
+
retime a single component, define a token of your own and point that
|
|
19
|
+
component's `motion` option at it:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
createTheme({
|
|
23
|
+
…,
|
|
24
|
+
motion: { productive: { duration: 110, easing: 'ease' } },
|
|
25
|
+
components: { menuItem: { options: { motion: 'productive' } } },
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A `duration: 0` token is how a theme opts out of motion — that is what
|
|
30
|
+
`transitionSpeed: 0` used to mean. Both showcase themes are migrated this way
|
|
31
|
+
(Carbon to a 110ms `productive` token, Wellsourced to an `instant` one).
|
|
32
|
+
|
|
33
|
+
**Options that never did anything.** `card.transitionSpeed` and
|
|
34
|
+
`inputBox.transitionSpeed` were read by nothing and never had been. Delete them
|
|
35
|
+
from your theme; nothing replaces them.
|
|
36
|
+
|
|
37
|
+
**Renames and obsolete APIs**
|
|
38
|
+
- `inputBox.typeFace` → `typeface` (the casing every other component uses).
|
|
39
|
+
- `uni-tooltip`'s `appendToBody` input — inert since the tooltip moved to the
|
|
40
|
+
native top layer, which escapes any overflow context by itself.
|
|
41
|
+
- Box's `elevation` input → `shadow`, in both the Angular and React packages.
|
|
42
|
+
It was a second name for the same thing.
|
|
43
|
+
- The Angular `icons` re-export → import `BaseIcons` from
|
|
44
|
+
`@uni-design-system/uni-core`. The default set ships with every theme.
|
|
45
|
+
|
|
46
|
+
**The HSL color legacy is gone from uni-core.** `uniColor`, `randomRangeValue`,
|
|
47
|
+
`CategorySaturation` and `CategoryLightness` are removed, superseded by the
|
|
48
|
+
deterministic OKLCH engine (`generateThemes` / `generatePalette`) — same input,
|
|
49
|
+
same theme, WCAG-checked. `RoleHues` and the `UniColor` type go with them: they
|
|
50
|
+
were reachable only through `uniColor`, and `RoleHues` had gone stale enough to
|
|
51
|
+
hold saturation values in a table of hues.
|
|
52
|
+
|
|
53
|
+
**Deferred output renames.** Three outputs were held back because renaming is
|
|
54
|
+
breaking; this is that release. Each also drops an eslint escape it needed for
|
|
55
|
+
shadowing a native event name or using an `on` prefix.
|
|
56
|
+
|
|
57
|
+
| Component | Before | After |
|
|
58
|
+
| -------------------- | ----------------- | ---------------- |
|
|
59
|
+
| `uni-debounce-input` | `(change)` | `(valueChange)` |
|
|
60
|
+
| `uni-search-input` | `(change)` | `(searchChange)` |
|
|
61
|
+
| `uni-search-input` | `(search)` | `(searchSubmit)` |
|
|
62
|
+
| `dragAndDrop` | `(onFileDropped)` | `(fileDropped)` |
|
|
63
|
+
|
|
64
|
+
**`uni-dropdown`'s `color` input → `containerColor`,** completing the rule the
|
|
65
|
+
layout directives set: every container-pair input in the library is now
|
|
66
|
+
`containerColor`, and plain `color` always means the CSS property.
|
|
67
|
+
|
|
68
|
+
**`ThemeService.getSpacing('none')` now returns `0`, not the string `'none'`.**
|
|
69
|
+
`'none'` is not a valid length, so it was silently dropped wherever it landed —
|
|
70
|
+
`uni-menu` carried a comment working around exactly that, which is now deleted.
|
|
71
|
+
|
|
72
|
+
## 8.4.0
|
|
73
|
+
|
|
74
|
+
### Minor Changes
|
|
75
|
+
|
|
76
|
+
- [`82d1341`](https://github.com/uni-design-system/uni/commit/82d134169997abc2a0f6261e248548e5b3240dcb) Thanks [@gaenglish](https://github.com/gaenglish)! - React layout primitives, at parity with Angular: `Box`, `Stack`, `Row`, `Center`, `Wrap`, `Grid` and `GridArea`. Angular applies layout as an attribute so the element's semantics stay the author's (`<main box-layout>`); React's equivalent is the polymorphic `as` prop — `<Box as="main" padding="md">` — with refs and DOM props forwarded to whatever element it renders.
|
|
77
|
+
|
|
78
|
+
Props, defaults and resolution order are ported one-for-one from `UniBoxComponent`, so the same tokens produce the same CSS in both frameworks: token-driven color pairs, padding, radius, border, shadow, gap and z-index; a number is px and a string is a CSS length for every sizing prop; `dashBorder` draws the SVG dashed outline; `ignoreDir` (default on) still flips flex direction under `dir="rtl"`. `Stack` keeps its `minHeight: fit-content` guard and `Row` its `minWidth: fit-content` — set `minHeight={0}` / `minWidth={0}` to shrink inside a constrained flex parent.
|
|
79
|
+
|
|
80
|
+
Supporting this: `createThemeStyles`/`useThemeStyles` — the React port of the Angular `ThemeService` token → CSS resolvers, method-for-method — and `@emotion/css` (new peer dependency, matching the Angular package) so pseudo-selectors like `:dir(rtl)` resolve in a real class rather than an inline style. A Box that paints a container color now also provides that token to its descendants, so `Text` inside it picks up the matching on-color.
|
|
81
|
+
|
|
3
82
|
## 8.3.1
|
|
4
83
|
|
|
5
84
|
## 8.3.0
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ The official **React** implementation of the Uni Design System. This library fea
|
|
|
19
19
|
## 📦 Installation
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install @uni-design-system/uni-react @uni-design-system/uni-core
|
|
22
|
+
npm install @uni-design-system/uni-react @uni-design-system/uni-core @emotion/css
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## 🏁 Getting Started
|
|
@@ -39,11 +39,35 @@ export const MyComponent = () => {
|
|
|
39
39
|
};
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
## 🧱 Layout
|
|
43
|
+
|
|
44
|
+
Layout is composed from one primitive. `Box` renders any element you name, so the
|
|
45
|
+
semantics stay yours, and `Stack`, `Row`, `Center`, `Wrap` and `Grid` are the same
|
|
46
|
+
Box with presets. Spacing, radius, border, shadow and color props take theme
|
|
47
|
+
tokens; sizing props take a number (px) or a CSS length string.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Grid, GridArea, Row, Stack } from '@uni-design-system/uni-react';
|
|
51
|
+
|
|
52
|
+
<Stack as="main" gap="lg" padding="lg">
|
|
53
|
+
<Row gap="md" justifyContent="space-between">
|
|
54
|
+
<Text role="headline-large">Projects</Text>
|
|
55
|
+
<Button text="New project" />
|
|
56
|
+
</Row>
|
|
57
|
+
|
|
58
|
+
<Grid templateColumns="repeat(3, 1fr)" gap="md">
|
|
59
|
+
<GridArea area="summary" color="surface-variant" padding="md" borderRadius="md">
|
|
60
|
+
<Text>Summary</Text>
|
|
61
|
+
</GridArea>
|
|
62
|
+
</Grid>
|
|
63
|
+
</Stack>;
|
|
64
|
+
```
|
|
65
|
+
|
|
42
66
|
## 🛠️ Architecture Profile
|
|
43
67
|
|
|
44
68
|
- **Framework Support:** React `>=18`
|
|
45
69
|
- **Pre-bundled Internals:** Complex third-party layout engines (like `@dnd-kit` and `framer-motion`) are completely compiled _inside_ this package to simplify your build trees.
|
|
46
|
-
- **Peer Dependencies:** React
|
|
70
|
+
- **Peer Dependencies:** React, `@uni-design-system/uni-core` and `@emotion/css` are kept external to maintain minimal, lightweight bundle weights.
|
|
47
71
|
|
|
48
72
|
```
|
|
49
73
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const require$$0 = require("react");
|
|
4
4
|
const uniCore = require("@uni-design-system/uni-core");
|
|
5
5
|
const reactDom = require("react-dom");
|
|
6
|
+
const css = require("@emotion/css");
|
|
6
7
|
function _interopNamespaceDefault(e) {
|
|
7
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
9
|
if (e) {
|
|
@@ -6429,6 +6430,105 @@ function withTheme(Component) {
|
|
|
6429
6430
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...props, theme });
|
|
6430
6431
|
};
|
|
6431
6432
|
}
|
|
6433
|
+
const createLocalStorageManager = (key2) => ({
|
|
6434
|
+
type: "localStorage",
|
|
6435
|
+
get(init) {
|
|
6436
|
+
if (!globalThis?.document) return init;
|
|
6437
|
+
let value;
|
|
6438
|
+
try {
|
|
6439
|
+
value = localStorage.getItem(key2) || init;
|
|
6440
|
+
} catch {
|
|
6441
|
+
}
|
|
6442
|
+
return JSON.parse(value) || init;
|
|
6443
|
+
},
|
|
6444
|
+
set(value) {
|
|
6445
|
+
try {
|
|
6446
|
+
localStorage.setItem(key2, JSON.stringify(value));
|
|
6447
|
+
} catch {
|
|
6448
|
+
}
|
|
6449
|
+
}
|
|
6450
|
+
});
|
|
6451
|
+
const parseCookie = (cookie, key2) => {
|
|
6452
|
+
const match = cookie.match(new RegExp(`(^| )${key2}=([^;]+)`));
|
|
6453
|
+
return match?.[2];
|
|
6454
|
+
};
|
|
6455
|
+
const createCookieStorageManager = (key2, cookie) => ({
|
|
6456
|
+
type: "cookie",
|
|
6457
|
+
get(init) {
|
|
6458
|
+
if (cookie) return parseCookie(cookie, key2);
|
|
6459
|
+
if (!globalThis?.document) return init;
|
|
6460
|
+
return parseCookie(document.cookie, key2) || init;
|
|
6461
|
+
},
|
|
6462
|
+
set(value) {
|
|
6463
|
+
document.cookie = `${key2}=${value}; max-age=31536000; path=/`;
|
|
6464
|
+
}
|
|
6465
|
+
});
|
|
6466
|
+
const safeParseInt = (n) => typeof n === "number" ? n : parseInt(n);
|
|
6467
|
+
function createThemeStyles(theme) {
|
|
6468
|
+
const colors = theme.colors;
|
|
6469
|
+
const spacing = theme.spacing;
|
|
6470
|
+
const radii = theme.radii;
|
|
6471
|
+
const borders = theme.borders;
|
|
6472
|
+
const shadows = theme.shadows;
|
|
6473
|
+
const thicknesses = theme.thicknesses;
|
|
6474
|
+
const getContentColor = (token, useVariant) => useVariant ? colors[`on-${token}-variant`] : colors[`on-${token}`];
|
|
6475
|
+
return {
|
|
6476
|
+
theme,
|
|
6477
|
+
colors,
|
|
6478
|
+
colorPalette: () => colors,
|
|
6479
|
+
getSpacing: (size) => size === "none" ? "none" : spacing[size],
|
|
6480
|
+
getThickness: (thickness) => thicknesses[thickness],
|
|
6481
|
+
getContentColor,
|
|
6482
|
+
/** Background + matching on-color for a container token, as one pair. */
|
|
6483
|
+
colorPair: (token, colorVariant) => {
|
|
6484
|
+
if (!token) return void 0;
|
|
6485
|
+
return { color: getContentColor(token, colorVariant), backgroundColor: colors[token] };
|
|
6486
|
+
},
|
|
6487
|
+
color: (color2) => !color2 ? void 0 : { color: colors[color2] },
|
|
6488
|
+
backgroundColor: (token) => !token ? void 0 : { backgroundColor: colors[token] },
|
|
6489
|
+
backgroundImage: (url) => !url ? void 0 : { backgroundImage: `url(${url})` },
|
|
6490
|
+
borderColor: (borderColor) => ({
|
|
6491
|
+
borderColor: colors[borderColor]
|
|
6492
|
+
}),
|
|
6493
|
+
/** An SVG-drawn dashed outline — CSS `dashed` cannot control dash length. */
|
|
6494
|
+
getDashedBorder: (color2, radius) => {
|
|
6495
|
+
if (!color2) return void 0;
|
|
6496
|
+
const r = radius && radii[radius];
|
|
6497
|
+
const borderRadius = r ? safeParseInt(r) : 0;
|
|
6498
|
+
const strokeColor = colors[color2]?.replace("#", "%23");
|
|
6499
|
+
return {
|
|
6500
|
+
backgroundImage: `url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='${borderRadius}' ry='${borderRadius}' stroke='${strokeColor}' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e")`,
|
|
6501
|
+
borderRadius
|
|
6502
|
+
};
|
|
6503
|
+
},
|
|
6504
|
+
radius: (size) => !size ? void 0 : { borderRadius: radii[size] },
|
|
6505
|
+
getRadiusLeft: (size) => !size ? void 0 : { borderBottomLeftRadius: radii[size], borderTopLeftRadius: radii[size] },
|
|
6506
|
+
getRadiusRight: (size) => !size ? void 0 : { borderBottomRightRadius: radii[size], borderTopRightRadius: radii[size] },
|
|
6507
|
+
getRadiusTop: (size) => !size ? void 0 : { borderTopLeftRadius: radii[size], borderTopRightRadius: radii[size] },
|
|
6508
|
+
getRadiusBottom: (size) => !size ? void 0 : { borderBottomLeftRadius: radii[size], borderBottomRightRadius: radii[size] },
|
|
6509
|
+
padding: (size) => !size ? void 0 : { padding: spacing[size] },
|
|
6510
|
+
horizontalPadding: (size) => !size ? void 0 : { paddingInline: spacing[size] },
|
|
6511
|
+
verticalPadding: (size) => !size ? void 0 : { paddingBlock: spacing[size] },
|
|
6512
|
+
paddingLeft: (size) => !size ? void 0 : { paddingLeft: spacing[size] },
|
|
6513
|
+
paddingRight: (size) => !size ? void 0 : { paddingRight: spacing[size] },
|
|
6514
|
+
paddingTop: (size) => !size ? void 0 : { paddingTop: spacing[size] },
|
|
6515
|
+
paddingBottom: (size) => !size ? void 0 : { paddingBottom: spacing[size] },
|
|
6516
|
+
border: (border) => !border ? void 0 : { border: borders[border] },
|
|
6517
|
+
borderTop: (border) => !border ? void 0 : { borderTop: borders[border] },
|
|
6518
|
+
borderBottom: (border) => !border ? void 0 : { borderBottom: borders[border] },
|
|
6519
|
+
borderLeft: (border) => !border ? void 0 : { borderLeft: borders[border] },
|
|
6520
|
+
borderRight: (border) => !border ? void 0 : { borderRight: borders[border] },
|
|
6521
|
+
boxShadow: (shadow) => !shadow ? void 0 : { boxShadow: shadows[shadow] },
|
|
6522
|
+
gap: (gap) => !gap || gap === "none" ? void 0 : { gap: spacing[gap] },
|
|
6523
|
+
zIndex: (element) => !element ? void 0 : { zIndex: uniCore.Z_INDEX[element] },
|
|
6524
|
+
/** One property, dropped when the value is absent (or falsy, as in Angular). */
|
|
6525
|
+
style: (prop, value) => !value ? void 0 : { [prop]: value }
|
|
6526
|
+
};
|
|
6527
|
+
}
|
|
6528
|
+
function useThemeStyles() {
|
|
6529
|
+
const theme = useTheme();
|
|
6530
|
+
return require$$0.useMemo(() => createThemeStyles(theme), [theme]);
|
|
6531
|
+
}
|
|
6432
6532
|
function Icon({ name, color: color2 = "on-surface", height = 24, width = 24 }) {
|
|
6433
6533
|
if (!name) return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
6434
6534
|
const { colors } = useTheme();
|
|
@@ -19611,6 +19711,215 @@ const SortableList = ({
|
|
|
19611
19711
|
const TextInput = ({ value, onChange }) => {
|
|
19612
19712
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "text", value, onChange }) });
|
|
19613
19713
|
};
|
|
19714
|
+
const BOX_STYLE_PROP_KEYS = [
|
|
19715
|
+
"color",
|
|
19716
|
+
"backgroundColor",
|
|
19717
|
+
"borderRadius",
|
|
19718
|
+
"borderRadiusLeft",
|
|
19719
|
+
"borderRadiusRight",
|
|
19720
|
+
"borderRadiusTop",
|
|
19721
|
+
"borderRadiusBottom",
|
|
19722
|
+
"padding",
|
|
19723
|
+
"paddingHorizontal",
|
|
19724
|
+
"paddingVertical",
|
|
19725
|
+
"paddingLeft",
|
|
19726
|
+
"paddingRight",
|
|
19727
|
+
"paddingTop",
|
|
19728
|
+
"paddingBottom",
|
|
19729
|
+
"border",
|
|
19730
|
+
"borderTop",
|
|
19731
|
+
"borderBottom",
|
|
19732
|
+
"borderLeft",
|
|
19733
|
+
"borderRight",
|
|
19734
|
+
"dashBorder",
|
|
19735
|
+
"alignSelf",
|
|
19736
|
+
"alignItems",
|
|
19737
|
+
"alignContent",
|
|
19738
|
+
"justifyContent",
|
|
19739
|
+
"grow",
|
|
19740
|
+
"display",
|
|
19741
|
+
"position",
|
|
19742
|
+
"inset",
|
|
19743
|
+
"height",
|
|
19744
|
+
"minHeight",
|
|
19745
|
+
"maxHeight",
|
|
19746
|
+
"width",
|
|
19747
|
+
"minWidth",
|
|
19748
|
+
"maxWidth",
|
|
19749
|
+
"ignoreDir",
|
|
19750
|
+
"gridArea",
|
|
19751
|
+
"gridColumn",
|
|
19752
|
+
"gridRow",
|
|
19753
|
+
"overflow",
|
|
19754
|
+
"shadow",
|
|
19755
|
+
"gap",
|
|
19756
|
+
"fullWidth",
|
|
19757
|
+
"fullHeight",
|
|
19758
|
+
"flexDirection",
|
|
19759
|
+
"textAlign",
|
|
19760
|
+
"wrapItems",
|
|
19761
|
+
"zIndex"
|
|
19762
|
+
];
|
|
19763
|
+
const STYLE_PROP_SET = new Set(BOX_STYLE_PROP_KEYS);
|
|
19764
|
+
function splitBoxProps(props) {
|
|
19765
|
+
const styleProps = {};
|
|
19766
|
+
const rest = {};
|
|
19767
|
+
for (const key2 of Object.keys(props)) {
|
|
19768
|
+
const target = STYLE_PROP_SET.has(key2) ? styleProps : rest;
|
|
19769
|
+
target[key2] = props[key2];
|
|
19770
|
+
}
|
|
19771
|
+
return [styleProps, rest];
|
|
19772
|
+
}
|
|
19773
|
+
function boxClassName(props, styles) {
|
|
19774
|
+
const { border, dashBorder = false, ignoreDir = true, flexDirection } = props;
|
|
19775
|
+
return css.css([
|
|
19776
|
+
{
|
|
19777
|
+
...styles.colorPair(props.color),
|
|
19778
|
+
...styles.backgroundColor(props.backgroundColor),
|
|
19779
|
+
display: props.alignSelf ? "flex" : "block",
|
|
19780
|
+
position: props.position,
|
|
19781
|
+
inset: props.inset,
|
|
19782
|
+
boxSizing: "border-box",
|
|
19783
|
+
height: props.height,
|
|
19784
|
+
minHeight: props.minHeight,
|
|
19785
|
+
maxHeight: props.maxHeight,
|
|
19786
|
+
width: props.width,
|
|
19787
|
+
minWidth: props.minWidth,
|
|
19788
|
+
maxWidth: props.maxWidth,
|
|
19789
|
+
flexWrap: props.wrapItems,
|
|
19790
|
+
overflow: props.overflow,
|
|
19791
|
+
...styles.padding(props.padding),
|
|
19792
|
+
...styles.horizontalPadding(props.paddingHorizontal),
|
|
19793
|
+
...styles.verticalPadding(props.paddingVertical),
|
|
19794
|
+
...styles.paddingLeft(props.paddingLeft),
|
|
19795
|
+
...styles.paddingRight(props.paddingRight),
|
|
19796
|
+
...styles.paddingTop(props.paddingTop),
|
|
19797
|
+
...styles.paddingBottom(props.paddingBottom),
|
|
19798
|
+
...styles.boxShadow(props.shadow),
|
|
19799
|
+
...styles.radius(props.borderRadius),
|
|
19800
|
+
...styles.getRadiusLeft(props.borderRadiusLeft),
|
|
19801
|
+
...styles.getRadiusRight(props.borderRadiusRight),
|
|
19802
|
+
...styles.getRadiusTop(props.borderRadiusTop),
|
|
19803
|
+
...styles.getRadiusBottom(props.borderRadiusBottom),
|
|
19804
|
+
...styles.borderTop(props.borderTop),
|
|
19805
|
+
...styles.borderBottom(props.borderBottom),
|
|
19806
|
+
...styles.borderLeft(props.borderLeft),
|
|
19807
|
+
...styles.borderRight(props.borderRight),
|
|
19808
|
+
...styles.gap(props.gap),
|
|
19809
|
+
...styles.style("display", props.display),
|
|
19810
|
+
...styles.style("alignSelf", props.alignSelf),
|
|
19811
|
+
...styles.style("alignItems", props.alignItems),
|
|
19812
|
+
...styles.style("justifyContent", props.justifyContent),
|
|
19813
|
+
...styles.style("alignContent", props.alignContent),
|
|
19814
|
+
...styles.style("flexGrow", props.grow),
|
|
19815
|
+
...styles.style("flexDirection", props.flexDirection),
|
|
19816
|
+
...styles.style("gridArea", props.gridArea),
|
|
19817
|
+
...styles.style("gridColumn", props.gridColumn),
|
|
19818
|
+
...styles.style("gridRow", props.gridRow),
|
|
19819
|
+
...styles.style("textAlign", props.textAlign),
|
|
19820
|
+
...styles.zIndex(props.zIndex)
|
|
19821
|
+
},
|
|
19822
|
+
border && !dashBorder && { ...styles.border(border) },
|
|
19823
|
+
border && dashBorder && { ...styles.getDashedBorder(border, props.borderRadius) },
|
|
19824
|
+
props.fullWidth && { width: "100%" },
|
|
19825
|
+
props.fullHeight && { height: "100%" },
|
|
19826
|
+
ignoreDir && (flexDirection ?? "row") === "row" && {
|
|
19827
|
+
"&:dir(rtl)": { flexDirection: "row-reverse" }
|
|
19828
|
+
},
|
|
19829
|
+
ignoreDir && (flexDirection ?? "row") === "row-reverse" && {
|
|
19830
|
+
"&:dir(rtl)": { flexDirection: "row" }
|
|
19831
|
+
}
|
|
19832
|
+
]);
|
|
19833
|
+
}
|
|
19834
|
+
function useBoxClassName(props) {
|
|
19835
|
+
const styles = useThemeStyles();
|
|
19836
|
+
return boxClassName(props, styles);
|
|
19837
|
+
}
|
|
19838
|
+
const Box = require$$0.forwardRef(function Box2({ as, className: className2, children, ...props }, ref) {
|
|
19839
|
+
const Component = as || "div";
|
|
19840
|
+
const [styleProps, rest] = splitBoxProps(props);
|
|
19841
|
+
const boxClass = useBoxClassName(styleProps);
|
|
19842
|
+
const element = /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ref, className: css.cx(boxClass, className2), ...rest, children });
|
|
19843
|
+
return styleProps.color ? /* @__PURE__ */ jsxRuntimeExports.jsx(ContainerContext.Provider, { value: { colorToken: styleProps.color }, children: element }) : element;
|
|
19844
|
+
});
|
|
19845
|
+
Box.displayName = "Box";
|
|
19846
|
+
const Center = require$$0.forwardRef(function Center2(props, ref) {
|
|
19847
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19848
|
+
Box,
|
|
19849
|
+
{
|
|
19850
|
+
display: "flex",
|
|
19851
|
+
justifyContent: "center",
|
|
19852
|
+
alignItems: "center",
|
|
19853
|
+
...props,
|
|
19854
|
+
ref
|
|
19855
|
+
}
|
|
19856
|
+
);
|
|
19857
|
+
});
|
|
19858
|
+
Center.displayName = "Center";
|
|
19859
|
+
const Grid = require$$0.forwardRef(function Grid2(props, ref) {
|
|
19860
|
+
const {
|
|
19861
|
+
templateAreas,
|
|
19862
|
+
templateColumns,
|
|
19863
|
+
templateRows,
|
|
19864
|
+
outline,
|
|
19865
|
+
outlineColor,
|
|
19866
|
+
className: className2,
|
|
19867
|
+
...boxProps
|
|
19868
|
+
} = props;
|
|
19869
|
+
const styles = useThemeStyles();
|
|
19870
|
+
const gridClass = css.css([
|
|
19871
|
+
templateAreas && { gridTemplateAreas: templateAreas },
|
|
19872
|
+
templateColumns && { gridTemplateColumns: templateColumns },
|
|
19873
|
+
templateRows && { gridTemplateRows: templateRows },
|
|
19874
|
+
outline && { gap: styles.getThickness(outline) },
|
|
19875
|
+
outlineColor && { backgroundColor: styles.colorPalette()[outlineColor] }
|
|
19876
|
+
]);
|
|
19877
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19878
|
+
Box,
|
|
19879
|
+
{
|
|
19880
|
+
display: "grid",
|
|
19881
|
+
...boxProps,
|
|
19882
|
+
className: css.cx(gridClass, className2),
|
|
19883
|
+
ref
|
|
19884
|
+
}
|
|
19885
|
+
);
|
|
19886
|
+
});
|
|
19887
|
+
Grid.displayName = "Grid";
|
|
19888
|
+
const GridArea = require$$0.forwardRef(function GridArea2(props, ref) {
|
|
19889
|
+
const { area, ...boxProps } = props;
|
|
19890
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { gridArea: area, ...boxProps, ref });
|
|
19891
|
+
});
|
|
19892
|
+
GridArea.displayName = "GridArea";
|
|
19893
|
+
const Row = require$$0.forwardRef(function Row2(props, ref) {
|
|
19894
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19895
|
+
Box,
|
|
19896
|
+
{
|
|
19897
|
+
display: "flex",
|
|
19898
|
+
flexDirection: "row",
|
|
19899
|
+
minWidth: "fit-content",
|
|
19900
|
+
...props,
|
|
19901
|
+
ref
|
|
19902
|
+
}
|
|
19903
|
+
);
|
|
19904
|
+
});
|
|
19905
|
+
Row.displayName = "Row";
|
|
19906
|
+
const Stack = require$$0.forwardRef(function Stack2(props, ref) {
|
|
19907
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19908
|
+
Box,
|
|
19909
|
+
{
|
|
19910
|
+
display: "flex",
|
|
19911
|
+
flexDirection: "column",
|
|
19912
|
+
minHeight: "fit-content",
|
|
19913
|
+
...props,
|
|
19914
|
+
ref
|
|
19915
|
+
}
|
|
19916
|
+
);
|
|
19917
|
+
});
|
|
19918
|
+
Stack.displayName = "Stack";
|
|
19919
|
+
const Wrap = require$$0.forwardRef(function Wrap2(props, ref) {
|
|
19920
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { display: "flex", wrapItems: "wrap", ...props, ref });
|
|
19921
|
+
});
|
|
19922
|
+
Wrap.displayName = "Wrap";
|
|
19614
19923
|
const ModalSizes = {
|
|
19615
19924
|
sm: 260,
|
|
19616
19925
|
md: 320,
|
|
@@ -19696,44 +20005,14 @@ const Switch = ({ size = "sm", on = false, onChange }) => {
|
|
|
19696
20005
|
};
|
|
19697
20006
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: switchStyle, className: "switch", "data-isOn": isOn, onClick: toggleSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, { style: handleStyle, className: "handle", layout: true, transition: spring2 }) });
|
|
19698
20007
|
};
|
|
19699
|
-
|
|
19700
|
-
type: "localStorage",
|
|
19701
|
-
get(init) {
|
|
19702
|
-
if (!globalThis?.document) return init;
|
|
19703
|
-
let value;
|
|
19704
|
-
try {
|
|
19705
|
-
value = localStorage.getItem(key2) || init;
|
|
19706
|
-
} catch {
|
|
19707
|
-
}
|
|
19708
|
-
return JSON.parse(value) || init;
|
|
19709
|
-
},
|
|
19710
|
-
set(value) {
|
|
19711
|
-
try {
|
|
19712
|
-
localStorage.setItem(key2, JSON.stringify(value));
|
|
19713
|
-
} catch {
|
|
19714
|
-
}
|
|
19715
|
-
}
|
|
19716
|
-
});
|
|
19717
|
-
const parseCookie = (cookie, key2) => {
|
|
19718
|
-
const match = cookie.match(new RegExp(`(^| )${key2}=([^;]+)`));
|
|
19719
|
-
return match?.[2];
|
|
19720
|
-
};
|
|
19721
|
-
const createCookieStorageManager = (key2, cookie) => ({
|
|
19722
|
-
type: "cookie",
|
|
19723
|
-
get(init) {
|
|
19724
|
-
if (cookie) return parseCookie(cookie, key2);
|
|
19725
|
-
if (!globalThis?.document) return init;
|
|
19726
|
-
return parseCookie(document.cookie, key2) || init;
|
|
19727
|
-
},
|
|
19728
|
-
set(value) {
|
|
19729
|
-
document.cookie = `${key2}=${value}; max-age=31536000; path=/`;
|
|
19730
|
-
}
|
|
19731
|
-
});
|
|
20008
|
+
exports.BOX_STYLE_PROP_KEYS = BOX_STYLE_PROP_KEYS;
|
|
19732
20009
|
exports.Background = Background;
|
|
19733
20010
|
exports.BorderStyle = BorderStyle;
|
|
20011
|
+
exports.Box = Box;
|
|
19734
20012
|
exports.BoxShadow = BoxShadow;
|
|
19735
20013
|
exports.Button = Button;
|
|
19736
20014
|
exports.Card = Card;
|
|
20015
|
+
exports.Center = Center;
|
|
19737
20016
|
exports.Collapse = Collapse;
|
|
19738
20017
|
exports.ContainerContext = ContainerContext;
|
|
19739
20018
|
exports.DragHandle = DragHandle;
|
|
@@ -19741,6 +20020,8 @@ exports.Fade = Fade;
|
|
|
19741
20020
|
exports.Flex = Flex;
|
|
19742
20021
|
exports.FlexHorizontalAlignments = FlexHorizontalAlignments;
|
|
19743
20022
|
exports.FlexVerticalAlignments = FlexVerticalAlignments;
|
|
20023
|
+
exports.Grid = Grid;
|
|
20024
|
+
exports.GridArea = GridArea;
|
|
19744
20025
|
exports.Icon = Icon;
|
|
19745
20026
|
exports.IconDictionary = srcExports.IconDictionary;
|
|
19746
20027
|
exports.IconKeys = srcExports.IconKeys;
|
|
@@ -19750,20 +20031,25 @@ exports.LayoutProvider = LayoutProvider;
|
|
|
19750
20031
|
exports.Modal = Modal;
|
|
19751
20032
|
exports.Overlay = Overlay;
|
|
19752
20033
|
exports.Padding = Padding;
|
|
20034
|
+
exports.Row = Row;
|
|
19753
20035
|
exports.Slide = Slide;
|
|
19754
20036
|
exports.SortableItem = SortableItem;
|
|
19755
20037
|
exports.SortableList = SortableList;
|
|
19756
20038
|
exports.SortableOverlay = SortableOverlay;
|
|
20039
|
+
exports.Stack = Stack;
|
|
19757
20040
|
exports.Switch = Switch;
|
|
19758
20041
|
exports.Text = Text;
|
|
19759
20042
|
exports.TextInput = TextInput;
|
|
19760
20043
|
exports.ThemeProvider = ThemeProvider;
|
|
20044
|
+
exports.Wrap = Wrap;
|
|
19761
20045
|
exports.alignBottom = alignBottom;
|
|
19762
20046
|
exports.alignCenter = alignCenter;
|
|
19763
20047
|
exports.alignTop = alignTop;
|
|
20048
|
+
exports.boxClassName = boxClassName;
|
|
19764
20049
|
exports.column = column;
|
|
19765
20050
|
exports.createCookieStorageManager = createCookieStorageManager;
|
|
19766
20051
|
exports.createLocalStorageManager = createLocalStorageManager;
|
|
20052
|
+
exports.createThemeStyles = createThemeStyles;
|
|
19767
20053
|
exports.expand = expand;
|
|
19768
20054
|
exports.fadeConfig = fadeConfig;
|
|
19769
20055
|
exports.fix = fix;
|
|
@@ -19783,11 +20069,15 @@ exports.justifyRight = justifyRight;
|
|
|
19783
20069
|
exports.row = row;
|
|
19784
20070
|
exports.rowFixedItem = rowFixedItem;
|
|
19785
20071
|
exports.rowFlexItem = rowFlexItem;
|
|
20072
|
+
exports.safeParseInt = safeParseInt;
|
|
19786
20073
|
exports.spaceBetween = spaceBetween;
|
|
19787
20074
|
exports.spaceEvenly = spaceEvenly;
|
|
20075
|
+
exports.splitBoxProps = splitBoxProps;
|
|
20076
|
+
exports.useBoxClassName = useBoxClassName;
|
|
19788
20077
|
exports.useLayout = useLayout;
|
|
19789
20078
|
exports.useMedia = useMedia;
|
|
19790
20079
|
exports.useTheme = useTheme;
|
|
20080
|
+
exports.useThemeStyles = useThemeStyles;
|
|
19791
20081
|
exports.useToggle = useToggle;
|
|
19792
20082
|
exports.withTheme = withTheme;
|
|
19793
20083
|
//# sourceMappingURL=index.cjs.map
|