@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.
Files changed (69) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +26 -2
  3. package/dist/cjs/index.cjs +323 -33
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/esm/index.js +324 -34
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/types/components/index.d.ts +1 -0
  8. package/dist/types/components/index.d.ts.map +1 -1
  9. package/dist/types/components/layout/box/box.component.d.ts +21 -0
  10. package/dist/types/components/layout/box/box.component.d.ts.map +1 -0
  11. package/dist/types/components/layout/box/box.stories.d.ts +11 -0
  12. package/dist/types/components/layout/box/box.stories.d.ts.map +1 -0
  13. package/dist/types/components/layout/box/box.styles.d.ts +77 -0
  14. package/dist/types/components/layout/box/box.styles.d.ts.map +1 -0
  15. package/dist/types/components/layout/box/index.d.ts +3 -0
  16. package/dist/types/components/layout/box/index.d.ts.map +1 -0
  17. package/dist/types/components/layout/center/center.component.d.ts +7 -0
  18. package/dist/types/components/layout/center/center.component.d.ts.map +1 -0
  19. package/dist/types/components/layout/center/center.stories.d.ts +7 -0
  20. package/dist/types/components/layout/center/center.stories.d.ts.map +1 -0
  21. package/dist/types/components/layout/center/index.d.ts +2 -0
  22. package/dist/types/components/layout/center/index.d.ts.map +1 -0
  23. package/dist/types/components/layout/grid/grid-area/grid-area.component.d.ts +11 -0
  24. package/dist/types/components/layout/grid/grid-area/grid-area.component.d.ts.map +1 -0
  25. package/dist/types/components/layout/grid/grid-area/index.d.ts +2 -0
  26. package/dist/types/components/layout/grid/grid-area/index.d.ts.map +1 -0
  27. package/dist/types/components/layout/grid/grid.component.d.ts +24 -0
  28. package/dist/types/components/layout/grid/grid.component.d.ts.map +1 -0
  29. package/dist/types/components/layout/grid/grid.stories.d.ts +7 -0
  30. package/dist/types/components/layout/grid/grid.stories.d.ts.map +1 -0
  31. package/dist/types/components/layout/grid/index.d.ts +3 -0
  32. package/dist/types/components/layout/grid/index.d.ts.map +1 -0
  33. package/dist/types/components/layout/index.d.ts +7 -0
  34. package/dist/types/components/layout/index.d.ts.map +1 -0
  35. package/dist/types/components/layout/layout.spec.d.ts +2 -0
  36. package/dist/types/components/layout/layout.spec.d.ts.map +1 -0
  37. package/dist/types/components/layout/row/index.d.ts +2 -0
  38. package/dist/types/components/layout/row/index.d.ts.map +1 -0
  39. package/dist/types/components/layout/row/row.component.d.ts +13 -0
  40. package/dist/types/components/layout/row/row.component.d.ts.map +1 -0
  41. package/dist/types/components/layout/row/row.stories.d.ts +7 -0
  42. package/dist/types/components/layout/row/row.stories.d.ts.map +1 -0
  43. package/dist/types/components/layout/stack/index.d.ts +2 -0
  44. package/dist/types/components/layout/stack/index.d.ts.map +1 -0
  45. package/dist/types/components/layout/stack/stack.component.d.ts +13 -0
  46. package/dist/types/components/layout/stack/stack.component.d.ts.map +1 -0
  47. package/dist/types/components/layout/stack/stack.stories.d.ts +7 -0
  48. package/dist/types/components/layout/stack/stack.stories.d.ts.map +1 -0
  49. package/dist/types/components/layout/wrap/index.d.ts +2 -0
  50. package/dist/types/components/layout/wrap/index.d.ts.map +1 -0
  51. package/dist/types/components/layout/wrap/wrap.component.d.ts +7 -0
  52. package/dist/types/components/layout/wrap/wrap.component.d.ts.map +1 -0
  53. package/dist/types/components/layout/wrap/wrap.stories.d.ts +7 -0
  54. package/dist/types/components/layout/wrap/wrap.stories.d.ts.map +1 -0
  55. package/dist/types/core/index.d.ts +1 -0
  56. package/dist/types/core/index.d.ts.map +1 -1
  57. package/dist/types/core/polymorphic/index.d.ts +2 -0
  58. package/dist/types/core/polymorphic/index.d.ts.map +1 -0
  59. package/dist/types/core/polymorphic/polymorphic.types.d.ts +27 -0
  60. package/dist/types/core/polymorphic/polymorphic.types.d.ts.map +1 -0
  61. package/dist/types/core/theme/index.d.ts +1 -0
  62. package/dist/types/core/theme/index.d.ts.map +1 -1
  63. package/dist/types/core/theme/theme.styles.d.ts +52 -0
  64. package/dist/types/core/theme/theme.styles.d.ts.map +1 -0
  65. package/dist/types/utils/index.d.ts +1 -0
  66. package/dist/types/utils/index.d.ts.map +1 -1
  67. package/dist/types/utils/number.helper.d.ts +2 -0
  68. package/dist/types/utils/number.helper.d.ts.map +1 -0
  69. package/package.json +7 -3
@@ -3,6 +3,7 @@ export * from './card';
3
3
  export * from './draggable';
4
4
  export * from './forms';
5
5
  export * from './icon-text-row';
6
+ export * from './layout';
6
7
  export * from './modal';
7
8
  export * from './switch';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+ import { PolymorphicComponent, PolymorphicProps } from '../../../core/polymorphic';
3
+ import { BoxStyleProps } from './box.styles';
4
+ export interface BoxOwnProps extends BoxStyleProps {
5
+ /** The element to render. Defaults to `div`; use it to keep semantics: `as="main"`. */
6
+ as?: ElementType;
7
+ children?: ReactNode;
8
+ className?: string;
9
+ }
10
+ export type BoxProps<E extends ElementType = 'div'> = PolymorphicProps<E, BoxOwnProps>;
11
+ /**
12
+ * The base layout primitive. Every other layout component is a Box with
13
+ * presets, and Box itself renders whatever element you name so the semantics
14
+ * stay yours: `<Box as="main" grow={1} padding="md">`.
15
+ *
16
+ * Sizing convention (height/width/min/max/inset): a **number is px** —
17
+ * `height={420}`; a **string is a CSS length** — `height="50%"`.
18
+ * Spacing/radius/border/shadow/color props take theme tokens.
19
+ */
20
+ export declare const Box: PolymorphicComponent<BoxOwnProps>;
21
+ //# sourceMappingURL=box.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/box/box.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExF,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAElF,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,uFAAuF;IACvF,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AAEvF;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,EAuBV,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Box } from './box.component';
3
+ declare const meta: Meta<typeof Box>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Box>;
6
+ export declare const Primary: Story;
7
+ /** A flex container: three items spread along the main axis. */
8
+ export declare const FlexContainer: Story;
9
+ /** `as` keeps the semantics yours — this one renders a `<main>` element. */
10
+ export declare const SemanticElement: Story;
11
+ //# sourceMappingURL=box.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/box/box.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,GAAG,CAsG1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { ContainerColorToken, OptionalAlignContent, OptionalAlignItems, OptionalAlignSelf, OptionalBorder, OptionalColor, OptionalDisplay, OptionalFlexDirection, OptionalJustifyContent, OptionalOverflow, OptionalPosition, OptionalRadius, OptionalSize, OptionalTextAlign, OptionalWrap, Shadow, ZIndexableElements } from '@uni-design-system/uni-core';
2
+ import { ThemeStyles } from '../../../core/theme';
3
+ /**
4
+ * Every style prop the Box primitive understands. Spacing, radius, border,
5
+ * shadow and color props take **theme tokens**; sizing props (height/width/
6
+ * min/max/inset) take a **number (px) or a CSS length string**.
7
+ */
8
+ export interface BoxStyleProps {
9
+ /** Container color token — paints the background and its matching on-color. */
10
+ color?: ContainerColorToken;
11
+ backgroundColor?: OptionalColor;
12
+ borderRadius?: OptionalRadius;
13
+ borderRadiusLeft?: OptionalRadius;
14
+ borderRadiusRight?: OptionalRadius;
15
+ borderRadiusTop?: OptionalRadius;
16
+ borderRadiusBottom?: OptionalRadius;
17
+ padding?: OptionalSize;
18
+ paddingHorizontal?: OptionalSize;
19
+ paddingVertical?: OptionalSize;
20
+ paddingLeft?: OptionalSize;
21
+ paddingRight?: OptionalSize;
22
+ paddingTop?: OptionalSize;
23
+ paddingBottom?: OptionalSize;
24
+ border?: OptionalBorder;
25
+ borderTop?: OptionalBorder;
26
+ borderBottom?: OptionalBorder;
27
+ borderLeft?: OptionalBorder;
28
+ borderRight?: OptionalBorder;
29
+ /** Draws `border` as an SVG dashed outline instead of a solid one. */
30
+ dashBorder?: boolean;
31
+ alignSelf?: OptionalAlignSelf;
32
+ alignItems?: OptionalAlignItems;
33
+ alignContent?: OptionalAlignContent;
34
+ justifyContent?: OptionalJustifyContent;
35
+ grow?: number;
36
+ display?: OptionalDisplay;
37
+ position?: OptionalPosition;
38
+ inset?: number | string;
39
+ /** Number = px (`height={420}`); string = CSS length (`height="420px"`). */
40
+ height?: number | string;
41
+ minHeight?: number | string;
42
+ maxHeight?: number | string;
43
+ /** Number = px (`width={420}`); string = CSS length (`width="50%"`). */
44
+ width?: number | string;
45
+ minWidth?: number | string;
46
+ maxWidth?: number | string;
47
+ /** When true (default), flex direction flips under `dir="rtl"`. */
48
+ ignoreDir?: boolean;
49
+ gridArea?: string;
50
+ gridColumn?: string;
51
+ gridRow?: string;
52
+ overflow?: OptionalOverflow;
53
+ shadow?: Shadow;
54
+ gap?: OptionalSize;
55
+ fullWidth?: boolean;
56
+ fullHeight?: boolean;
57
+ flexDirection?: OptionalFlexDirection;
58
+ textAlign?: OptionalTextAlign;
59
+ wrapItems?: OptionalWrap;
60
+ zIndex?: ZIndexableElements;
61
+ }
62
+ /**
63
+ * The runtime key list used to split style props from the DOM props that pass
64
+ * through to the rendered element. Kept exhaustive by `assertExhaustive` below.
65
+ */
66
+ export declare const BOX_STYLE_PROP_KEYS: readonly ["color", "backgroundColor", "borderRadius", "borderRadiusLeft", "borderRadiusRight", "borderRadiusTop", "borderRadiusBottom", "padding", "paddingHorizontal", "paddingVertical", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "border", "borderTop", "borderBottom", "borderLeft", "borderRight", "dashBorder", "alignSelf", "alignItems", "alignContent", "justifyContent", "grow", "display", "position", "inset", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "ignoreDir", "gridArea", "gridColumn", "gridRow", "overflow", "shadow", "gap", "fullWidth", "fullHeight", "flexDirection", "textAlign", "wrapItems", "zIndex"];
67
+ /** Split a props bag into Box style props and the rest (DOM/element props). */
68
+ export declare function splitBoxProps<P extends BoxStyleProps>(props: P): [BoxStyleProps, Omit<P, keyof BoxStyleProps>];
69
+ /**
70
+ * The Box class name, resolved token-for-token the same way the Angular
71
+ * `UniBoxComponent` resolves it — including declaration order, so overlapping
72
+ * props (e.g. `display` after `alignSelf`) win identically in both frameworks.
73
+ */
74
+ export declare function boxClassName(props: BoxStyleProps, styles: ThemeStyles): string;
75
+ /** The Box class name for the active theme. */
76
+ export declare function useBoxClassName(props: BoxStyleProps): string;
77
+ //# sourceMappingURL=box.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/box/box.styles.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ export * from './box.component';
2
+ export * from './box.styles';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/box/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ElementType } from 'react';
2
+ import { PolymorphicComponent } from '../../../core/polymorphic';
3
+ import { BoxOwnProps, BoxProps } from '../box';
4
+ export type CenterProps<E extends ElementType = 'div'> = BoxProps<E>;
5
+ /** A Box that centers its content on both axes. */
6
+ export declare const Center: PolymorphicComponent<BoxOwnProps>;
7
+ //# sourceMappingURL=center.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/center/center.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;AAErE,mDAAmD;AACnD,eAAO,MAAM,MAAM,EAUb,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Center } from './center.component';
3
+ declare const meta: Meta<typeof Center>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Center>;
6
+ export declare const Primary: Story;
7
+ //# sourceMappingURL=center.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/center/center.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAa7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './center.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/center/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { ElementType } from 'react';
2
+ import { PolymorphicComponent } from '../../../../core/polymorphic';
3
+ import { BoxOwnProps, BoxProps } from '../../box';
4
+ export interface GridAreaOwnProps extends BoxOwnProps {
5
+ /** The named area of the parent Grid's `templateAreas` this fills. */
6
+ area: string;
7
+ }
8
+ export type GridAreaProps<E extends ElementType = 'div'> = Omit<BoxProps<E>, keyof GridAreaOwnProps> & GridAreaOwnProps;
9
+ /** Places its content in a named area of the surrounding {@link Grid}. */
10
+ export declare const GridArea: PolymorphicComponent<GridAreaOwnProps>;
11
+ //# sourceMappingURL=grid-area.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-area.component.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/grid/grid-area/grid-area.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,IAAI,CAC7D,QAAQ,CAAC,CAAC,CAAC,EACX,MAAM,gBAAgB,CACvB,GACC,gBAAgB,CAAC;AAEnB,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,EAIf,oBAAoB,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './grid-area.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layout/grid/grid-area/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { ElementType } from 'react';
2
+ import { Thickness, Variant } from '@uni-design-system/uni-core';
3
+ import { PolymorphicComponent } from '../../../core/polymorphic';
4
+ import { BoxOwnProps, BoxProps } from '../box';
5
+ export interface GridOwnProps extends BoxOwnProps {
6
+ /** `grid-template-areas`, e.g. `"'header header' 'nav main'"`. */
7
+ templateAreas?: string;
8
+ /** `grid-template-columns`, e.g. `"repeat(3, 1fr)"`. */
9
+ templateColumns?: string;
10
+ /** `grid-template-rows`, e.g. `"auto 1fr auto"`. */
11
+ templateRows?: string;
12
+ /** Draws grid lines: sets the gap to a theme thickness so the grid's own background shows through. */
13
+ outline?: Thickness;
14
+ /** The color those grid lines are drawn in — painted as the grid's background. */
15
+ outlineColor?: Variant;
16
+ }
17
+ export type GridProps<E extends ElementType = 'div'> = Omit<BoxProps<E>, keyof GridOwnProps> & GridOwnProps;
18
+ /**
19
+ * A Box laid out as a CSS grid. Beyond the Box props it takes the three
20
+ * `template*` tracks, plus `outline`/`outlineColor` — a themed gap that reads
21
+ * as grid rules rather than empty space.
22
+ */
23
+ export declare const Grid: PolymorphicComponent<GridOwnProps>;
24
+ //# sourceMappingURL=grid.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/grid/grid.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sGAAsG;IACtG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,GAC1F,YAAY,CAAC;AAEf;;;;GAIG;AACH,eAAO,MAAM,IAAI,EA4BX,oBAAoB,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Grid } from './grid.component';
3
+ declare const meta: Meta<typeof Grid>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Grid>;
6
+ export declare const SimpleGrid: Story;
7
+ //# sourceMappingURL=grid.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/grid/grid.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAqB3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAUnC,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './grid.component';
2
+ export * from './grid-area';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/grid/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './box';
2
+ export * from './center';
3
+ export * from './grid';
4
+ export * from './row';
5
+ export * from './stack';
6
+ export * from './wrap';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=layout.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.spec.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/layout.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './row.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/row/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ElementType } from 'react';
2
+ import { PolymorphicComponent } from '../../../core/polymorphic';
3
+ import { BoxOwnProps, BoxProps } from '../box';
4
+ export type RowProps<E extends ElementType = 'div'> = BoxProps<E>;
5
+ /**
6
+ * A horizontal Box: `display: flex` in a row.
7
+ *
8
+ * `minWidth` defaults to `fit-content` (guards content collapse). Set
9
+ * `minWidth={0}` when the row must shrink inside a constrained flex parent
10
+ * (scroll or text-truncation containment).
11
+ */
12
+ export declare const Row: PolymorphicComponent<BoxOwnProps>;
13
+ //# sourceMappingURL=row.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/row/row.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,EAUV,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Row } from './row.component';
3
+ declare const meta: Meta<typeof Row>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Row>;
6
+ export declare const ButtonRow: Story;
7
+ //# sourceMappingURL=row.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/row/row.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,GAAG,CAa1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;AAElC,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './stack.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/stack/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ElementType } from 'react';
2
+ import { PolymorphicComponent } from '../../../core/polymorphic';
3
+ import { BoxOwnProps, BoxProps } from '../box';
4
+ export type StackProps<E extends ElementType = 'div'> = BoxProps<E>;
5
+ /**
6
+ * A vertical Box: `display: flex` in a column.
7
+ *
8
+ * `minHeight` defaults to `fit-content` (guards content collapse). Set
9
+ * `minHeight={0}` when the stack must shrink inside a constrained flex parent
10
+ * (scroll containment).
11
+ */
12
+ export declare const Stack: PolymorphicComponent<BoxOwnProps>;
13
+ //# sourceMappingURL=stack.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/stack/stack.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAUZ,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Stack } from './stack.component';
3
+ declare const meta: Meta<typeof Stack>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Stack>;
6
+ export declare const StackedCards: Story;
7
+ //# sourceMappingURL=stack.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/stack/stack.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAa5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './wrap.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/wrap/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ElementType } from 'react';
2
+ import { PolymorphicComponent } from '../../../core/polymorphic';
3
+ import { BoxOwnProps, BoxProps } from '../box';
4
+ export type WrapProps<E extends ElementType = 'div'> = BoxProps<E>;
5
+ /** A flex Box whose items wrap onto as many lines as they need. */
6
+ export declare const Wrap: PolymorphicComponent<BoxOwnProps>;
7
+ //# sourceMappingURL=wrap.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/wrap/wrap.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAO,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;AAEnE,mEAAmE;AACnE,eAAO,MAAM,IAAI,EAEX,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Wrap } from './wrap.component';
3
+ declare const meta: Meta<typeof Wrap>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Wrap>;
6
+ export declare const Primary: Story;
7
+ //# sourceMappingURL=wrap.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/wrap/wrap.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAa3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC"}
@@ -8,6 +8,7 @@ export * from './image';
8
8
  export * from './layout';
9
9
  export * from './overlay';
10
10
  export * from './padding';
11
+ export * from './polymorphic';
11
12
  export * from './shadow';
12
13
  export * from './text';
13
14
  export * from './theme';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './polymorphic.types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/polymorphic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, ReactElement } from 'react';
2
+ /**
3
+ * The `as` prop every layout primitive accepts. Angular applies layout as an
4
+ * attribute (`<main box-layout>`) so the element's semantics stay the author's;
5
+ * React's equivalent is `as`: `<Box as="main">`.
6
+ */
7
+ export type AsProp<E extends ElementType> = {
8
+ as?: E;
9
+ };
10
+ type PropsToOmit<E extends ElementType, P> = keyof (AsProp<E> & P);
11
+ /** Own props + the rendered element's own props, minus anything we shadow. */
12
+ export type PolymorphicProps<E extends ElementType, P> = P & AsProp<E> & Omit<ComponentPropsWithoutRef<E>, PropsToOmit<E, P>>;
13
+ /** The ref type of whatever element `as` resolves to. */
14
+ export type PolymorphicRef<E extends ElementType> = ComponentPropsWithRef<E>['ref'];
15
+ export type PolymorphicPropsWithRef<E extends ElementType, P> = PolymorphicProps<E, P> & {
16
+ ref?: PolymorphicRef<E>;
17
+ };
18
+ /**
19
+ * The callable shape of a polymorphic, ref-forwarding component. `forwardRef`
20
+ * erases the generic, so components are cast to this after creation.
21
+ */
22
+ export interface PolymorphicComponent<P, D extends ElementType = 'div'> {
23
+ <E extends ElementType = D>(props: PolymorphicPropsWithRef<E, P>): ReactElement | null;
24
+ displayName?: string;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=polymorphic.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polymorphic.types.d.ts","sourceRoot":"","sources":["../../../../src/core/polymorphic/polymorphic.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACb,MAAM,OAAO,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,WAAW,IAAI;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAEvD,KAAK,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnE,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,IAAI,CAAC,GACxD,MAAM,CAAC,CAAC,CAAC,GACT,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvD,yDAAyD;AACzD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAEpF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IACvF,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,KAAK;IACpE,CAAC,CAAC,SAAS,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAAC;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1,2 +1,3 @@
1
1
  export { ThemeProvider, withTheme, useTheme } from './theming';
2
+ export { createThemeStyles, useThemeStyles, type ThemeStyles } from './theme.styles';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { Border, ColorKey, ColorToken, ContainerColorToken, NullableSize, NullableStyleExpression, OptionalSize, Radius, Shadow, Thickness, UniTheme, ZIndexableElements } from '@uni-design-system/uni-core';
2
+ /**
3
+ * Token → CSS resolvers for a single theme. This is the React port of the
4
+ * Angular `ThemeService` style methods: same names, same arguments, same
5
+ * output, so a layout primitive written against either framework resolves a
6
+ * token to identical CSS.
7
+ *
8
+ * Every resolver returns `undefined` for a missing token so callers can spread
9
+ * it unconditionally: `{ ...styles.padding(padding) }`.
10
+ */
11
+ export declare function createThemeStyles(theme: UniTheme): {
12
+ theme: UniTheme;
13
+ colors: Partial<Record<string, string>>;
14
+ colorPalette: () => Partial<Record<string, string>>;
15
+ getSpacing: (size: NullableSize) => string | number | undefined;
16
+ getThickness: (thickness: Thickness) => string | number | undefined;
17
+ getContentColor: (token: ContainerColorToken, useVariant?: boolean) => string | undefined;
18
+ /** Background + matching on-color for a container token, as one pair. */
19
+ colorPair: (token?: ContainerColorToken, colorVariant?: boolean) => NullableStyleExpression;
20
+ color: (color?: ColorKey) => NullableStyleExpression;
21
+ backgroundColor: (token?: ColorKey) => NullableStyleExpression;
22
+ backgroundImage: (url?: string) => NullableStyleExpression;
23
+ borderColor: (borderColor: ColorToken) => NullableStyleExpression;
24
+ /** An SVG-drawn dashed outline — CSS `dashed` cannot control dash length. */
25
+ getDashedBorder: (color?: ColorKey, radius?: Radius) => NullableStyleExpression;
26
+ radius: (size?: Radius) => NullableStyleExpression;
27
+ getRadiusLeft: (size?: Radius) => NullableStyleExpression;
28
+ getRadiusRight: (size?: Radius) => NullableStyleExpression;
29
+ getRadiusTop: (size?: Radius) => NullableStyleExpression;
30
+ getRadiusBottom: (size?: Radius) => NullableStyleExpression;
31
+ padding: (size: OptionalSize) => NullableStyleExpression;
32
+ horizontalPadding: (size: OptionalSize) => NullableStyleExpression;
33
+ verticalPadding: (size: OptionalSize) => NullableStyleExpression;
34
+ paddingLeft: (size: OptionalSize) => NullableStyleExpression;
35
+ paddingRight: (size: OptionalSize) => NullableStyleExpression;
36
+ paddingTop: (size: OptionalSize) => NullableStyleExpression;
37
+ paddingBottom: (size: OptionalSize) => NullableStyleExpression;
38
+ border: (border?: Border) => NullableStyleExpression;
39
+ borderTop: (border?: Border) => NullableStyleExpression;
40
+ borderBottom: (border?: Border) => NullableStyleExpression;
41
+ borderLeft: (border?: Border) => NullableStyleExpression;
42
+ borderRight: (border?: Border) => NullableStyleExpression;
43
+ boxShadow: (shadow?: Shadow) => NullableStyleExpression;
44
+ gap: (gap: OptionalSize) => NullableStyleExpression;
45
+ zIndex: (element?: ZIndexableElements) => NullableStyleExpression;
46
+ /** One property, dropped when the value is absent (or falsy, as in Angular). */
47
+ style: (prop: string, value?: string | number) => NullableStyleExpression;
48
+ };
49
+ export type ThemeStyles = ReturnType<typeof createThemeStyles>;
50
+ /** The active theme's token → CSS resolvers, recomputed only when the theme changes. */
51
+ export declare function useThemeStyles(): ThemeStyles;
52
+ //# sourceMappingURL=theme.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.styles.d.ts","sourceRoot":"","sources":["../../../../src/core/theme/theme.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAKrC;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ;;;;uBAgB1B,YAAY;8BACL,SAAS;6BATL,mBAAmB,eAAe,OAAO;IAavE,yEAAyE;wBACrD,mBAAmB,iBAAiB,OAAO,KAAG,uBAAuB;oBAKzE,QAAQ,KAAG,uBAAuB;8BAGxB,QAAQ,KAAG,uBAAuB;4BAGpC,MAAM,KAAG,uBAAuB;+BAG7B,UAAU,KAAG,uBAAuB;IAI/D,6EAA6E;8BACnD,QAAQ,WAAW,MAAM,KAAG,uBAAuB;oBAa7D,MAAM,KAAG,uBAAuB;2BAGzB,MAAM,KAAG,uBAAuB;4BAG/B,MAAM,KAAG,uBAAuB;0BAKlC,MAAM,KAAG,uBAAuB;6BAG7B,MAAM,KAAG,uBAAuB;oBAKzC,YAAY,KAAG,uBAAuB;8BAG5B,YAAY,KAAG,uBAAuB;4BAGxC,YAAY,KAAG,uBAAuB;wBAG1C,YAAY,KAAG,uBAAuB;yBAGrC,YAAY,KAAG,uBAAuB;uBAGxC,YAAY,KAAG,uBAAuB;0BAGnC,YAAY,KAAG,uBAAuB;sBAG1C,MAAM,KAAG,uBAAuB;yBAG7B,MAAM,KAAG,uBAAuB;4BAG7B,MAAM,KAAG,uBAAuB;0BAGlC,MAAM,KAAG,uBAAuB;2BAG/B,MAAM,KAAG,uBAAuB;yBAGlC,MAAM,KAAG,uBAAuB;eAG1C,YAAY,KAAG,uBAAuB;uBAG9B,kBAAkB,KAAG,uBAAuB;IAG/D,gFAAgF;kBAClE,MAAM,UAAU,MAAM,GAAG,MAAM,KAAG,uBAAuB;EAG1E;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,wFAAwF;AACxF,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
@@ -1,2 +1,3 @@
1
1
  export * from './storage-manager';
2
+ export * from './number.helper';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const safeParseInt: (n: string | number) => number;
2
+ //# sourceMappingURL=number.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.helper.d.ts","sourceRoot":"","sources":["../../../src/utils/number.helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,GAAG,MAAM,WAA8C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-react",
3
- "version": "8.3.1",
3
+ "version": "9.0.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,8 @@
29
29
  ],
30
30
  "peerDependencies": {
31
31
  "@uni-design-system/uni-core": ">=5.0.0",
32
- "react": ">=18"
32
+ "react": ">=18",
33
+ "@emotion/css": "^11.0.0"
33
34
  },
34
35
  "dependencies": {
35
36
  "@dnd-kit/core": "^6.3.1",
@@ -44,6 +45,7 @@
44
45
  },
45
46
  "devDependencies": {
46
47
  "@chromatic-com/storybook": "^5.2.1",
48
+ "@emotion/css": "^11.0.0",
47
49
  "@eslint/js": "^10.0.1",
48
50
  "@storybook/addon-a11y": "^10.4.0",
49
51
  "@storybook/addon-docs": "^10.4.0",
@@ -64,12 +66,14 @@
64
66
  "vite-plugin-dts": "^4.5.4",
65
67
  "vitest": "^4.1.5",
66
68
  "@uni-design-system/tsconfig": "0.1.0",
67
- "@uni-design-system/uni-core": "8.3.1"
69
+ "@uni-design-system/uni-core": "9.0.0"
68
70
  },
69
71
  "scripts": {
70
72
  "dev": "vite build --watch",
71
73
  "build": "vite build",
72
74
  "lint": "eslint src/",
75
+ "test": "vitest run --project=unit",
76
+ "test:watch": "vitest --project=unit",
73
77
  "storybook": "storybook dev -p 6006",
74
78
  "build-storybook": "storybook build"
75
79
  }