@kanso-labs/kanso-ui 0.2.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 (112) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +83 -0
  3. package/dist/assets/stylex.css +1623 -0
  4. package/dist/cjs/assets/stylex.css +1623 -0
  5. package/dist/cjs/components/avatar/index.cjs +89 -0
  6. package/dist/cjs/components/avatar/index.cjs.map +1 -0
  7. package/dist/cjs/components/avatar/index.d.cts +29 -0
  8. package/dist/cjs/components/badge/index.cjs +93 -0
  9. package/dist/cjs/components/badge/index.cjs.map +1 -0
  10. package/dist/cjs/components/badge/index.d.cts +27 -0
  11. package/dist/cjs/components/button/index.cjs +101 -0
  12. package/dist/cjs/components/button/index.cjs.map +1 -0
  13. package/dist/cjs/components/button/index.d.cts +22 -0
  14. package/dist/cjs/components/card/index.cjs +84 -0
  15. package/dist/cjs/components/card/index.cjs.map +1 -0
  16. package/dist/cjs/components/card/index.d.cts +29 -0
  17. package/dist/cjs/components/chip/index.cjs +53 -0
  18. package/dist/cjs/components/chip/index.cjs.map +1 -0
  19. package/dist/cjs/components/chip/index.d.cts +13 -0
  20. package/dist/cjs/components/currency/index.cjs +56 -0
  21. package/dist/cjs/components/currency/index.cjs.map +1 -0
  22. package/dist/cjs/components/currency/index.d.cts +36 -0
  23. package/dist/cjs/components/icon-button/index.cjs +80 -0
  24. package/dist/cjs/components/icon-button/index.cjs.map +1 -0
  25. package/dist/cjs/components/icon-button/index.d.cts +32 -0
  26. package/dist/cjs/components/index.d.cts +15 -0
  27. package/dist/cjs/components/link/index.cjs +61 -0
  28. package/dist/cjs/components/link/index.cjs.map +1 -0
  29. package/dist/cjs/components/link/index.d.cts +30 -0
  30. package/dist/cjs/components/list-item/index.cjs +42 -0
  31. package/dist/cjs/components/list-item/index.cjs.map +1 -0
  32. package/dist/cjs/components/list-item/index.d.cts +22 -0
  33. package/dist/cjs/components/separator/index.cjs +34 -0
  34. package/dist/cjs/components/separator/index.cjs.map +1 -0
  35. package/dist/cjs/components/separator/index.d.cts +14 -0
  36. package/dist/cjs/components/sheet/index.cjs +266 -0
  37. package/dist/cjs/components/sheet/index.cjs.map +1 -0
  38. package/dist/cjs/components/sheet/index.d.cts +73 -0
  39. package/dist/cjs/components/tabs/index.cjs +77 -0
  40. package/dist/cjs/components/tabs/index.cjs.map +1 -0
  41. package/dist/cjs/components/tabs/index.d.cts +24 -0
  42. package/dist/cjs/components/text/index.cjs +173 -0
  43. package/dist/cjs/components/text/index.cjs.map +1 -0
  44. package/dist/cjs/components/text/index.d.cts +19 -0
  45. package/dist/cjs/components/text-field/index.cjs +53 -0
  46. package/dist/cjs/components/text-field/index.cjs.map +1 -0
  47. package/dist/cjs/components/text-field/index.d.cts +30 -0
  48. package/dist/cjs/hooks/useRipple.cjs +391 -0
  49. package/dist/cjs/hooks/useRipple.cjs.map +1 -0
  50. package/dist/cjs/index.cjs +29 -0
  51. package/dist/cjs/index.d.cts +16 -0
  52. package/dist/cjs/node_modules/@stylexjs/stylex/lib/es/stylex.cjs +121 -0
  53. package/dist/cjs/node_modules/@stylexjs/stylex/lib/es/stylex.cjs.map +1 -0
  54. package/dist/cjs/styles/ripple.cjs +33 -0
  55. package/dist/cjs/styles/ripple.cjs.map +1 -0
  56. package/dist/cjs/tokens/values.cjs +36 -0
  57. package/dist/cjs/tokens/values.cjs.map +1 -0
  58. package/dist/components/avatar/index.d.ts +29 -0
  59. package/dist/components/avatar/index.js +89 -0
  60. package/dist/components/avatar/index.js.map +1 -0
  61. package/dist/components/badge/index.d.ts +27 -0
  62. package/dist/components/badge/index.js +93 -0
  63. package/dist/components/badge/index.js.map +1 -0
  64. package/dist/components/button/index.d.ts +22 -0
  65. package/dist/components/button/index.js +101 -0
  66. package/dist/components/button/index.js.map +1 -0
  67. package/dist/components/card/index.d.ts +29 -0
  68. package/dist/components/card/index.js +84 -0
  69. package/dist/components/card/index.js.map +1 -0
  70. package/dist/components/chip/index.d.ts +13 -0
  71. package/dist/components/chip/index.js +53 -0
  72. package/dist/components/chip/index.js.map +1 -0
  73. package/dist/components/currency/index.d.ts +36 -0
  74. package/dist/components/currency/index.js +56 -0
  75. package/dist/components/currency/index.js.map +1 -0
  76. package/dist/components/icon-button/index.d.ts +32 -0
  77. package/dist/components/icon-button/index.js +80 -0
  78. package/dist/components/icon-button/index.js.map +1 -0
  79. package/dist/components/index.d.ts +15 -0
  80. package/dist/components/link/index.d.ts +30 -0
  81. package/dist/components/link/index.js +61 -0
  82. package/dist/components/link/index.js.map +1 -0
  83. package/dist/components/list-item/index.d.ts +22 -0
  84. package/dist/components/list-item/index.js +42 -0
  85. package/dist/components/list-item/index.js.map +1 -0
  86. package/dist/components/separator/index.d.ts +14 -0
  87. package/dist/components/separator/index.js +34 -0
  88. package/dist/components/separator/index.js.map +1 -0
  89. package/dist/components/sheet/index.d.ts +73 -0
  90. package/dist/components/sheet/index.js +266 -0
  91. package/dist/components/sheet/index.js.map +1 -0
  92. package/dist/components/tabs/index.d.ts +24 -0
  93. package/dist/components/tabs/index.js +77 -0
  94. package/dist/components/tabs/index.js.map +1 -0
  95. package/dist/components/text/index.d.ts +19 -0
  96. package/dist/components/text/index.js +173 -0
  97. package/dist/components/text/index.js.map +1 -0
  98. package/dist/components/text-field/index.d.ts +30 -0
  99. package/dist/components/text-field/index.js +53 -0
  100. package/dist/components/text-field/index.js.map +1 -0
  101. package/dist/hooks/useRipple.js +391 -0
  102. package/dist/hooks/useRipple.js.map +1 -0
  103. package/dist/index.d.ts +16 -0
  104. package/dist/index.js +15 -0
  105. package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js +121 -0
  106. package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js.map +1 -0
  107. package/dist/styles/ripple.js +33 -0
  108. package/dist/styles/ripple.js.map +1 -0
  109. package/dist/tokens/values.js +34 -0
  110. package/dist/tokens/values.js.map +1 -0
  111. package/dist/tokens.css +282 -0
  112. package/package.json +109 -0
@@ -0,0 +1,14 @@
1
+ import { SeparatorProps } from "@base-ui/react/separator";
2
+ //#region src/components/separator/index.d.ts
3
+ type SeparatorProps$1 = Omit<SeparatorProps, 'orientation'> & {
4
+ /**
5
+ * Which way the rule runs. A vertical separator takes its length from a
6
+ * flex or grid parent and has none of its own.
7
+ * @default 'horizontal'
8
+ */
9
+ orientation?: 'horizontal' | 'vertical';
10
+ };
11
+ declare function Separator$1({ orientation, ...props }: SeparatorProps$1): import("react").JSX.Element;
12
+ //#endregion
13
+ export { type SeparatorProps$1 as SeparatorProps, Separator$1 as default };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,34 @@
1
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Separator } from "@base-ui/react/separator";
4
+ //#region src/components/separator/index.tsx
5
+ const styles = {
6
+ base: {
7
+ kWkggS: "x1l12bh",
8
+ kMzoRj: "xc342km",
9
+ kmuXW: "x2lah0s",
10
+ kogj98: "x1ghz6dp",
11
+ $$css: true
12
+ },
13
+ horizontal: {
14
+ kZKoxP: "xjm9jq1",
15
+ kzqmXN: "xh8yej3",
16
+ $$css: true
17
+ },
18
+ vertical: {
19
+ kSGwAc: "xkh2ocl",
20
+ kzqmXN: "x1i1rx1s",
21
+ $$css: true
22
+ }
23
+ };
24
+ function Separator$1({ orientation = "horizontal", ...props$1 }) {
25
+ return /* @__PURE__ */ jsx(Separator, {
26
+ orientation,
27
+ ...props$1,
28
+ ...props(styles.base, styles[orientation])
29
+ });
30
+ }
31
+ //#endregion
32
+ export { Separator$1 as default };
33
+
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/separator/index.tsx"],"sourcesContent":["import type { SeparatorProps as BaseUISeparatorProps } from '@base-ui/react/separator';\nimport { Separator as BaseUISeparator } from '@base-ui/react/separator';\nimport * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors } from '../../tokens/design.tokens.stylex';\n\n// A divider is the same colour as a border, so it draws from outlineVariant\n// rather than a role of its own — the design system treats the two as one\n// decision, and a separator that drifted from the borders around it would\n// read as a mistake.\n//\n// Drawn as a background on a 1px box rather than as a border, so the rule is\n// the element itself. A border would leave the element's own box at zero\n// size, which makes it invisible to flex `gap` and to anything measuring it.\n//\n// Vertical has no length of its own. `alignSelf: stretch` takes it from the\n// flex or grid parent, since a divider between two rows should match\n// whatever they turn out to be rather than being told a height at the call\n// site. In a plain block parent there is nothing to stretch to and it will\n// have no height — that is the documented cost of the prop.\nconst styles = {\n base: {\n kWkggS: \"x1l12bh\",\n kMzoRj: \"xc342km\",\n kmuXW: \"x2lah0s\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n horizontal: {\n kZKoxP: \"xjm9jq1\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n vertical: {\n kSGwAc: \"xkh2ocl\",\n kzqmXN: \"x1i1rx1s\",\n $$css: true\n }\n};\ntype SeparatorProps = Omit<BaseUISeparatorProps, 'orientation'> & {\n /**\n * Which way the rule runs. A vertical separator takes its length from a\n * flex or grid parent and has none of its own.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n};\nfunction Separator({\n orientation = 'horizontal',\n ...props\n}: SeparatorProps) {\n return <BaseUISeparator orientation={orientation} {...props} {...stylex.props(styles.base, styles[orientation])} />;\n}\nexport type { SeparatorProps };\nexport default Separator;"],"mappings":";;;;AAoBA,MAAM,SAAS;CACb,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AASA,SAAS,YAAU,EACjB,cAAc,cACd,GAAG,WACc;CACjB,OAAO,oBAAC,WAAD;EAA8B;EAAa,GAAI;EAAO,GAAI,MAAa,OAAO,MAAM,OAAO,YAAY;CAAE,CAAA;AAClH"}
@@ -0,0 +1,73 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import { DialogCloseProps, DialogPopupProps, DialogPortalProps, DialogRootProps, DialogTitleProps, DialogTriggerProps } from "@base-ui/react/dialog";
3
+ //#region src/components/sheet/index.d.ts
4
+ type SheetSize = 'md' | 'sm';
5
+ type SheetProps = Omit<DialogRootProps, 'children'> & {
6
+ children?: ReactNode;
7
+ /**
8
+ * Panel width on the side-sheet presentation: `sm` 320px, `md` 400px.
9
+ * Ignored below the medium breakpoint, where the sheet is full width.
10
+ * @default 'md'
11
+ */
12
+ size?: SheetSize;
13
+ };
14
+ /**
15
+ * A modal panel that arrives from the edge of the screen — a side sheet on a
16
+ * wide viewport, a bottom sheet on a narrow one. Open state is Base UI's:
17
+ * pass `open` with `onOpenChange` to control it, or `defaultOpen` to let it
18
+ * keep its own.
19
+ *
20
+ * Composed rather than configured by props, because a sheet's header, body,
21
+ * and footer all take arbitrary content — the parts are `Sheet.Trigger`,
22
+ * `Sheet.Content`, `Sheet.Header`, `Sheet.Title`, `Sheet.Body`,
23
+ * `Sheet.Footer`, and `Sheet.Close`.
24
+ */
25
+ declare function Sheet({ children, size, ...props }: SheetProps): import("react").JSX.Element;
26
+ declare namespace Sheet {
27
+ var Body: typeof SheetBody;
28
+ var Close: typeof SheetClose;
29
+ var Content: typeof SheetContent;
30
+ var Footer: typeof SheetFooter;
31
+ var Header: typeof SheetHeader;
32
+ var Title: typeof SheetTitle;
33
+ var Trigger: typeof SheetTrigger;
34
+ }
35
+ declare function SheetBody(props: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
36
+ /**
37
+ * Closes the sheet when pressed. Carries no styling of its own, so give it
38
+ * the control it should be through `render` — an `IconButton` in the header,
39
+ * a `Button` in the footer.
40
+ */
41
+ declare function SheetClose(props: DialogCloseProps): import("react").JSX.Element;
42
+ /**
43
+ * The panel itself, and the scrim behind it. Everything the sheet shows goes
44
+ * in here; `Sheet.Trigger` stays outside it, since the trigger lives in the
45
+ * page while this is portalled out to the end of the body.
46
+ */
47
+ declare function SheetContent({ children, container, ...props }: SheetContentProps): import("react").JSX.Element;
48
+ declare function SheetFooter(props: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
49
+ declare function SheetHeader(props: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
50
+ /**
51
+ * Names the sheet. Rendered through Base UI's title part, which is what
52
+ * points the dialog's `aria-labelledby` at it — a sheet without one announces
53
+ * itself as an unnamed dialog.
54
+ */
55
+ declare function SheetTitle(props: DialogTitleProps): import("react").JSX.Element;
56
+ /**
57
+ * Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the
58
+ * control through `render`.
59
+ */
60
+ declare function SheetTrigger(props: DialogTriggerProps): import("react").JSX.Element;
61
+ type SheetContentProps = DialogPopupProps & {
62
+ /**
63
+ * Where to portal the panel and scrim. Defaults to the end of `<body>`,
64
+ * which is right for an app that sets its StyleX theme on `:root`. An app
65
+ * that scopes the theme to a subtree has to point this at an element inside
66
+ * it, or the sheet renders outside the theme and falls back to the tokens'
67
+ * `prefers-color-scheme` default.
68
+ */
69
+ container?: DialogPortalProps['container'];
70
+ };
71
+ //#endregion
72
+ export { type SheetContentProps, type SheetProps, type SheetSize, Sheet as default };
73
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,266 @@
1
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { c } from "react/compiler-runtime";
4
+ import { createContext, useContext } from "react";
5
+ import { Dialog } from "@base-ui/react/dialog";
6
+ //#region src/components/sheet/index.tsx
7
+ const styles = {
8
+ backdrop: {
9
+ k44tkh: "x1vhuh8u",
10
+ kKVMdj: "xqcmdr3",
11
+ kyAemX: "x1yujl0p",
12
+ kWkggS: "x1iqbvzf",
13
+ kpwlN0: "x10a8y8t",
14
+ kVAEAm: "xixxii4",
15
+ $$css: true
16
+ },
17
+ body: {
18
+ k1xSpc: "x78zum5",
19
+ kXwgrk: "xdt5ytf",
20
+ kzQI83: "x1iyjqo2",
21
+ kOIVth: "xxj4525",
22
+ kORKVm: "x1odjw0f",
23
+ kmVPX3: "xgc26li",
24
+ $$css: true
25
+ },
26
+ content: {
27
+ k44tkh: "x1n1nwrg",
28
+ kKVMdj: "xu2fq7p x18ihq2d",
29
+ kyAemX: "x16dv9tl",
30
+ kWkggS: "x1vnz5z6",
31
+ kT0f0o: "xkducg2",
32
+ kVL7Gh: "xrzall9 xb0nsol",
33
+ kfmiAY: "x1a37zkv xys6ro8",
34
+ krdFHd: "x6xk272 x9t1vth",
35
+ kGVxlE: "x19efjv6",
36
+ kMwMTN: "x139gbkf",
37
+ k1xSpc: "x78zum5",
38
+ kXwgrk: "xdt5ytf",
39
+ krVfgx: "x1ey2m1c",
40
+ k87sOh: "x13vifvy xmpip4z",
41
+ kt4wiu: "xtijo5x",
42
+ kLqNvP: "xhi6v0a x1upgybz",
43
+ kskxy: "x7ab17h x1dexy1j",
44
+ kVQacm: "xb3r6kr",
45
+ kVAEAm: "xixxii4",
46
+ $$css: true
47
+ },
48
+ footer: {
49
+ kLZC3w: "x12smttz",
50
+ kPef9Z: "x13fuv20",
51
+ kEafiO: "x178xt8z",
52
+ k1xSpc: "x78zum5",
53
+ kmuXW: "x2lah0s",
54
+ kOIVth: "x126z3so",
55
+ kjj79g: "x13a6bvl",
56
+ k8WAf4: "x1uvvd8r",
57
+ kg3NbH: "x790zyz",
58
+ $$css: true
59
+ },
60
+ header: {
61
+ kGNEyG: "x6s0dn4",
62
+ kL6WhQ: "x1j6faob",
63
+ kfdmCh: "x1q0q8m5",
64
+ kt9PQ7: "xso031l",
65
+ k1xSpc: "x78zum5",
66
+ kmuXW: "x2lah0s",
67
+ kOIVth: "x1gka490",
68
+ kjj79g: "x1qughib",
69
+ k8WAf4: "x1cmllll",
70
+ kg3NbH: "x790zyz",
71
+ $$css: true
72
+ },
73
+ md: {
74
+ kzqmXN: "x1l2rt3b xwvxfow",
75
+ $$css: true
76
+ },
77
+ sm: {
78
+ kzqmXN: "x1m258z3 xwvxfow",
79
+ $$css: true
80
+ },
81
+ title: {
82
+ kMwMTN: "x139gbkf",
83
+ kMv6JI: "xdy5w5q",
84
+ kGuDYH: "xete2z3",
85
+ k63SB2: "x14ijtet",
86
+ kb6lSQ: "xug9e1u",
87
+ kLWn49: "x2divse",
88
+ kogj98: "x1ghz6dp",
89
+ $$css: true
90
+ }
91
+ };
92
+ const SheetSizeContext = createContext("md");
93
+ /**
94
+ * A modal panel that arrives from the edge of the screen — a side sheet on a
95
+ * wide viewport, a bottom sheet on a narrow one. Open state is Base UI's:
96
+ * pass `open` with `onOpenChange` to control it, or `defaultOpen` to let it
97
+ * keep its own.
98
+ *
99
+ * Composed rather than configured by props, because a sheet's header, body,
100
+ * and footer all take arbitrary content — the parts are `Sheet.Trigger`,
101
+ * `Sheet.Content`, `Sheet.Header`, `Sheet.Title`, `Sheet.Body`,
102
+ * `Sheet.Footer`, and `Sheet.Close`.
103
+ */
104
+ function Sheet({ children, size = "md", ...props }) {
105
+ return /* @__PURE__ */ jsx(Dialog.Root, {
106
+ ...props,
107
+ children: /* @__PURE__ */ jsx(SheetSizeContext, {
108
+ value: size,
109
+ children
110
+ })
111
+ });
112
+ }
113
+ function SheetBody(props) {
114
+ const $ = c(2);
115
+ let t0;
116
+ if ($[0] !== props) {
117
+ t0 = /* @__PURE__ */ jsx("div", {
118
+ ...props,
119
+ className: "x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li"
120
+ });
121
+ $[0] = props;
122
+ $[1] = t0;
123
+ } else t0 = $[1];
124
+ return t0;
125
+ }
126
+ /**
127
+ * Closes the sheet when pressed. Carries no styling of its own, so give it
128
+ * the control it should be through `render` — an `IconButton` in the header,
129
+ * a `Button` in the footer.
130
+ */
131
+ function SheetClose(props) {
132
+ const $ = c(2);
133
+ let t0;
134
+ if ($[0] !== props) {
135
+ t0 = /* @__PURE__ */ jsx(Dialog.Close, { ...props });
136
+ $[0] = props;
137
+ $[1] = t0;
138
+ } else t0 = $[1];
139
+ return t0;
140
+ }
141
+ /**
142
+ * The panel itself, and the scrim behind it. Everything the sheet shows goes
143
+ * in here; `Sheet.Trigger` stays outside it, since the trigger lives in the
144
+ * page while this is portalled out to the end of the body.
145
+ */
146
+ function SheetContent(t0) {
147
+ const $ = c(14);
148
+ let children;
149
+ let container;
150
+ let props$1;
151
+ if ($[0] !== t0) {
152
+ ({children, container, ...props$1} = t0);
153
+ $[0] = t0;
154
+ $[1] = children;
155
+ $[2] = container;
156
+ $[3] = props$1;
157
+ } else {
158
+ children = $[1];
159
+ container = $[2];
160
+ props$1 = $[3];
161
+ }
162
+ const size = useContext(SheetSizeContext);
163
+ let t1;
164
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
165
+ t1 = /* @__PURE__ */ jsx(Dialog.Backdrop, { className: "x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4" });
166
+ $[4] = t1;
167
+ } else t1 = $[4];
168
+ let t2;
169
+ if ($[5] !== size) {
170
+ t2 = props(styles.content, styles[size]);
171
+ $[5] = size;
172
+ $[6] = t2;
173
+ } else t2 = $[6];
174
+ let t3;
175
+ if ($[7] !== children || $[8] !== props$1 || $[9] !== t2) {
176
+ t3 = /* @__PURE__ */ jsx(Dialog.Popup, {
177
+ ...props$1,
178
+ ...t2,
179
+ children
180
+ });
181
+ $[7] = children;
182
+ $[8] = props$1;
183
+ $[9] = t2;
184
+ $[10] = t3;
185
+ } else t3 = $[10];
186
+ let t4;
187
+ if ($[11] !== container || $[12] !== t3) {
188
+ t4 = /* @__PURE__ */ jsxs(Dialog.Portal, {
189
+ container,
190
+ children: [t1, t3]
191
+ });
192
+ $[11] = container;
193
+ $[12] = t3;
194
+ $[13] = t4;
195
+ } else t4 = $[13];
196
+ return t4;
197
+ }
198
+ function SheetFooter(props) {
199
+ const $ = c(2);
200
+ let t0;
201
+ if ($[0] !== props) {
202
+ t0 = /* @__PURE__ */ jsx("div", {
203
+ ...props,
204
+ className: "x12smttz x13fuv20 x178xt8z x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz"
205
+ });
206
+ $[0] = props;
207
+ $[1] = t0;
208
+ } else t0 = $[1];
209
+ return t0;
210
+ }
211
+ function SheetHeader(props) {
212
+ const $ = c(2);
213
+ let t0;
214
+ if ($[0] !== props) {
215
+ t0 = /* @__PURE__ */ jsx("div", {
216
+ ...props,
217
+ className: "x6s0dn4 x1j6faob x1q0q8m5 xso031l x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz"
218
+ });
219
+ $[0] = props;
220
+ $[1] = t0;
221
+ } else t0 = $[1];
222
+ return t0;
223
+ }
224
+ /**
225
+ * Names the sheet. Rendered through Base UI's title part, which is what
226
+ * points the dialog's `aria-labelledby` at it — a sheet without one announces
227
+ * itself as an unnamed dialog.
228
+ */
229
+ function SheetTitle(props) {
230
+ const $ = c(2);
231
+ let t0;
232
+ if ($[0] !== props) {
233
+ t0 = /* @__PURE__ */ jsx(Dialog.Title, {
234
+ ...props,
235
+ className: "x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp"
236
+ });
237
+ $[0] = props;
238
+ $[1] = t0;
239
+ } else t0 = $[1];
240
+ return t0;
241
+ }
242
+ /**
243
+ * Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the
244
+ * control through `render`.
245
+ */
246
+ function SheetTrigger(props) {
247
+ const $ = c(2);
248
+ let t0;
249
+ if ($[0] !== props) {
250
+ t0 = /* @__PURE__ */ jsx(Dialog.Trigger, { ...props });
251
+ $[0] = props;
252
+ $[1] = t0;
253
+ } else t0 = $[1];
254
+ return t0;
255
+ }
256
+ Sheet.Body = SheetBody;
257
+ Sheet.Close = SheetClose;
258
+ Sheet.Content = SheetContent;
259
+ Sheet.Footer = SheetFooter;
260
+ Sheet.Header = SheetHeader;
261
+ Sheet.Title = SheetTitle;
262
+ Sheet.Trigger = SheetTrigger;
263
+ //#endregion
264
+ export { Sheet as default };
265
+
266
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["children","container"],"sources":["../../../src/components/sheet/index.tsx"],"sourcesContent":["import type { DialogCloseProps as BaseUIDialogCloseProps, DialogPopupProps as BaseUIDialogPopupProps, DialogPortalProps as BaseUIDialogPortalProps, DialogRootProps as BaseUIDialogRootProps, DialogTitleProps as BaseUIDialogTitleProps, DialogTriggerProps as BaseUIDialogTriggerProps } from '@base-ui/react/dialog';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Dialog as BaseUIDialog } from '@base-ui/react/dialog';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// One component, two presentations. Above the medium breakpoint it is a side\n// sheet pinned to the inline end of the viewport; below it, the same panel\n// becomes a bottom sheet. That is M3's own pairing rather than two components,\n// and it is why nothing here takes a `side` prop — a sheet that stayed on the\n// right at 375px would be a drawer covering the whole screen.\n//\n// The two differ in three things and no more: which edges they are pinned to,\n// which two corners are rounded, and which axis they arrive along.\nconst slideInFromEnd = \"x17cjob-B\";\nconst slideInFromBottom = \"x15b941j-B\";\nconst fadeIn = \"x18re5ia-B\";\n\n// Entry only, so there is no exit animation to wait for and closing is\n// immediate. See the comment on `SheetContent` for why that is a design call\n// rather than a limit of StyleX.\nconst styles = {\n backdrop: {\n k44tkh: \"x1vhuh8u\",\n kKVMdj: \"xqcmdr3\",\n kyAemX: \"x1yujl0p\",\n kWkggS: \"x1iqbvzf\",\n kpwlN0: \"x10a8y8t\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n body: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xxj4525\",\n kORKVm: \"x1odjw0f\",\n kmVPX3: \"xgc26li\",\n $$css: true\n },\n content: {\n k44tkh: \"x1n1nwrg\",\n kKVMdj: \"xu2fq7p x18ihq2d\",\n kyAemX: \"x16dv9tl\",\n kWkggS: \"x1vnz5z6\",\n kT0f0o: \"xkducg2\",\n kVL7Gh: \"xrzall9 xb0nsol\",\n kfmiAY: \"x1a37zkv xys6ro8\",\n krdFHd: \"x6xk272 x9t1vth\",\n kGVxlE: \"x19efjv6\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n krVfgx: \"x1ey2m1c\",\n k87sOh: \"x13vifvy xmpip4z\",\n kt4wiu: \"xtijo5x\",\n kLqNvP: \"xhi6v0a x1upgybz\",\n kskxy: \"x7ab17h x1dexy1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n footer: {\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x13a6bvl\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n kL6WhQ: \"x1j6faob\",\n kfdmCh: \"x1q0q8m5\",\n kt9PQ7: \"xso031l\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x1gka490\",\n kjj79g: \"x1qughib\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n md: {\n kzqmXN: \"x1l2rt3b xwvxfow\",\n $$css: true\n },\n sm: {\n kzqmXN: \"x1m258z3 xwvxfow\",\n $$css: true\n },\n title: {\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\ntype SheetSize = 'md' | 'sm';\n\n// `size` is declared on the root, where a reader expects to set the shape of\n// the whole sheet, but it is `Sheet.Content` that has to apply it. One string\n// through context rather than making the call site repeat it on both.\nconst SheetSizeContext = createContext<SheetSize>('md');\n\n// `children` is narrowed to nodes. Base UI also accepts a function there, to\n// hand the sheet a payload passed by whichever trigger opened it, and that\n// form cannot be wrapped in a context provider without calling it first —\n// which would be doing Base UI's job with none of its state. Nothing in this\n// component needs the payload, so the narrower type says so rather than\n// leaving a signature that type-checks and then fails to render.\ntype SheetProps = Omit<BaseUIDialogRootProps, 'children'> & {\n children?: ReactNode;\n /**\n * Panel width on the side-sheet presentation: `sm` 320px, `md` 400px.\n * Ignored below the medium breakpoint, where the sheet is full width.\n * @default 'md'\n */\n size?: SheetSize;\n};\n\n/**\n * A modal panel that arrives from the edge of the screen — a side sheet on a\n * wide viewport, a bottom sheet on a narrow one. Open state is Base UI's:\n * pass `open` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Composed rather than configured by props, because a sheet's header, body,\n * and footer all take arbitrary content — the parts are `Sheet.Trigger`,\n * `Sheet.Content`, `Sheet.Header`, `Sheet.Title`, `Sheet.Body`,\n * `Sheet.Footer`, and `Sheet.Close`.\n */\nfunction Sheet({\n children,\n size = 'md',\n ...props\n}: SheetProps) {\n return <BaseUIDialog.Root {...props}>\n <SheetSizeContext value={size}>{children}</SheetSizeContext>\n </BaseUIDialog.Root>;\n}\nfunction SheetBody(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li\" />;\n}\n\n/**\n * Closes the sheet when pressed. Carries no styling of its own, so give it\n * the control it should be through `render` — an `IconButton` in the header,\n * a `Button` in the footer.\n */\nfunction SheetClose(props: BaseUIDialogCloseProps) {\n return <BaseUIDialog.Close {...props} />;\n}\n\n/**\n * The panel itself, and the scrim behind it. Everything the sheet shows goes\n * in here; `Sheet.Trigger` stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n */\nfunction SheetContent({\n children,\n container,\n ...props\n}: SheetContentProps) {\n const size = useContext(SheetSizeContext);\n return <BaseUIDialog.Portal container={container}>\n <BaseUIDialog.Backdrop className=\"x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4\" />\n <BaseUIDialog.Popup {...props} {...stylex.props(styles.content, styles[size])}>\n {children}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>;\n}\nfunction SheetFooter(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x12smttz x13fuv20 x178xt8z x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz\" />;\n}\nfunction SheetHeader(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x6s0dn4 x1j6faob x1q0q8m5 xso031l x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz\" />;\n}\n\n/**\n * Names the sheet. Rendered through Base UI's title part, which is what\n * points the dialog's `aria-labelledby` at it — a sheet without one announces\n * itself as an unnamed dialog.\n */\nfunction SheetTitle(props: BaseUIDialogTitleProps) {\n return <BaseUIDialog.Title {...props} className=\"x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp\" />;\n}\n\n/**\n * Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the\n * control through `render`.\n */\nfunction SheetTrigger(props: BaseUIDialogTriggerProps) {\n return <BaseUIDialog.Trigger {...props} />;\n}\nSheet.Body = SheetBody;\nSheet.Close = SheetClose;\nSheet.Content = SheetContent;\nSheet.Footer = SheetFooter;\nSheet.Header = SheetHeader;\nSheet.Title = SheetTitle;\nSheet.Trigger = SheetTrigger;\ntype SheetCloseProps = BaseUIDialogCloseProps;\ntype SheetContentProps = BaseUIDialogPopupProps & {\n /**\n * Where to portal the panel and scrim. Defaults to the end of `<body>`,\n * which is right for an app that sets its StyleX theme on `:root`. An app\n * that scopes the theme to a subtree has to point this at an element inside\n * it, or the sheet renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: BaseUIDialogPortalProps['container'];\n};\ntype SheetTitleProps = BaseUIDialogTitleProps;\ntype SheetTriggerProps = BaseUIDialogTriggerProps;\nexport type { SheetCloseProps, SheetContentProps, SheetProps, SheetSize, SheetTitleProps, SheetTriggerProps };\nexport default Sheet;"],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ import { TabsListProps, TabsPanelProps, TabsRootProps, TabsTabProps } from "@base-ui/react/tabs";
2
+ //#region src/components/tabs/index.d.ts
3
+ /**
4
+ * A tab strip and its panels. Selection is Base UI's `value`: pass `value`
5
+ * with `onValueChange` to control it, or `defaultValue` to let it keep its
6
+ * own.
7
+ *
8
+ * Composed rather than configured by props, because the number of tabs and
9
+ * what each panel holds are the call site's to decide — the parts are
10
+ * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.
11
+ */
12
+ declare function Tabs$1(props: TabsRootProps): import("react").JSX.Element;
13
+ declare namespace Tabs$1 {
14
+ var List: typeof TabsList;
15
+ var Panel: typeof TabsPanel;
16
+ var Tab: typeof TabsTab;
17
+ }
18
+ declare function TabsList(props: TabsListProps): import("react").JSX.Element;
19
+ declare function TabsPanel(props: TabsPanelProps): import("react").JSX.Element;
20
+ declare function TabsTab(props: TabsTabProps): import("react").JSX.Element;
21
+ type TabsProps = TabsRootProps;
22
+ //#endregion
23
+ export { type TabsProps, Tabs$1 as default };
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,77 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Tabs } from "@base-ui/react/tabs";
4
+ //#region src/components/tabs/index.tsx
5
+ function tabClassName(state) {
6
+ return {
7
+ 0: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1p2om7n xjbqb8w x1w5n3ug" },
8
+ 2: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1hei0q8 xp89om9 xscdzaa" },
9
+ 1: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" },
10
+ 3: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" }
11
+ }[!!state.active << 1 | !!state.disabled << 0].className;
12
+ }
13
+ /**
14
+ * A tab strip and its panels. Selection is Base UI's `value`: pass `value`
15
+ * with `onValueChange` to control it, or `defaultValue` to let it keep its
16
+ * own.
17
+ *
18
+ * Composed rather than configured by props, because the number of tabs and
19
+ * what each panel holds are the call site's to decide — the parts are
20
+ * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.
21
+ */
22
+ function Tabs$1(props) {
23
+ const $ = c(2);
24
+ let t0;
25
+ if ($[0] !== props) {
26
+ t0 = /* @__PURE__ */ jsx(Tabs.Root, { ...props });
27
+ $[0] = props;
28
+ $[1] = t0;
29
+ } else t0 = $[1];
30
+ return t0;
31
+ }
32
+ function TabsList(props) {
33
+ const $ = c(2);
34
+ let t0;
35
+ if ($[0] !== props) {
36
+ t0 = /* @__PURE__ */ jsx(Tabs.List, {
37
+ ...props,
38
+ className: "x78zum5 x14qo01y"
39
+ });
40
+ $[0] = props;
41
+ $[1] = t0;
42
+ } else t0 = $[1];
43
+ return t0;
44
+ }
45
+ function TabsPanel(props) {
46
+ const $ = c(2);
47
+ let t0;
48
+ if ($[0] !== props) {
49
+ t0 = /* @__PURE__ */ jsx(Tabs.Panel, {
50
+ ...props,
51
+ className: "xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn"
52
+ });
53
+ $[0] = props;
54
+ $[1] = t0;
55
+ } else t0 = $[1];
56
+ return t0;
57
+ }
58
+ function TabsTab(props) {
59
+ const $ = c(2);
60
+ let t0;
61
+ if ($[0] !== props) {
62
+ t0 = /* @__PURE__ */ jsx(Tabs.Tab, {
63
+ ...props,
64
+ className: tabClassName
65
+ });
66
+ $[0] = props;
67
+ $[1] = t0;
68
+ } else t0 = $[1];
69
+ return t0;
70
+ }
71
+ Tabs$1.List = TabsList;
72
+ Tabs$1.Panel = TabsPanel;
73
+ Tabs$1.Tab = TabsTab;
74
+ //#endregion
75
+ export { Tabs$1 as default };
76
+
77
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["tabClassName"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["import type { TabsListProps as BaseUITabsListProps, TabsPanelProps as BaseUITabsPanelProps, TabsRootProps as BaseUITabsRootProps, TabsTabProps as BaseUITabsTabProps, TabsTabState as BaseUITabsTabState } from '@base-ui/react/tabs';\nimport { Tabs as BaseUITabs } from '@base-ui/react/tabs';\nimport * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// A tinted pill marks the active tab, not the underline Material draws. That\n// is what the source design uses, and the two are different controls wearing\n// the same name: an underline belongs to a full-width tab bar, while a row of\n// pills reads as a segmented control sitting inside a section.\n//\n// The pill takes the same height, radius, and type as Chip. Both are\n// pill-shaped selection controls, and a row of tabs above a row of chips\n// looks wrong the moment the two disagree about either.\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active pill cannot be chosen in CSS. Base UI's answer is a className that is\n// a function of the tab's own state, the same mechanism Chip uses — declared\n// at module scope so it is one stable reference rather than a fresh closure\n// per render.\nfunction tabClassName(state: BaseUITabsTabState) {\n return {\n 0: {\n className: \"x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1p2om7n xjbqb8w x1w5n3ug\"\n },\n 2: {\n className: \"x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1hei0q8 xp89om9 xscdzaa\"\n },\n 1: {\n className: \"x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc\"\n }\n }[!!state.active << 1 | !!state.disabled << 0].className;\n}\n\n/**\n * A tab strip and its panels. Selection is Base UI's `value`: pass `value`\n * with `onValueChange` to control it, or `defaultValue` to let it keep its\n * own.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs(props: BaseUITabsRootProps) {\n return <BaseUITabs.Root {...props} />;\n}\nfunction TabsList(props: BaseUITabsListProps) {\n return <BaseUITabs.List {...props} className=\"x78zum5 x14qo01y\" />;\n}\nfunction TabsPanel(props: BaseUITabsPanelProps) {\n return <BaseUITabs.Panel {...props} className=\"xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn\" />;\n}\nfunction TabsTab(props: BaseUITabsTabProps) {\n return <BaseUITabs.Tab {...props} className={tabClassName} />;\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Tab = TabsTab;\ntype TabsListProps = BaseUITabsListProps;\ntype TabsPanelProps = BaseUITabsPanelProps;\ntype TabsProps = BaseUITabsRootProps;\ntype TabsTabProps = BaseUITabsTabProps;\nexport type { TabsListProps, TabsPanelProps, TabsProps, TabsTabProps };\nexport default Tabs;"],"mappings":";;;;AAoBA,SAAS,aAAa,OAA2B;CAC/C,OAAO;EACL,GAAG,EACD,WAAW,gOACb;EACA,GAAG,EACD,WAAW,+NACb;EACA,GAAG,EACD,WAAW,uNACb;EACA,GAAG,EACD,WAAW,uNACb;CACF,EAAE,CAAC,CAAC,MAAM,UAAU,IAAI,CAAC,CAAC,MAAM,YAAY,EAAE,CAAC;AACjD;;;;;;;;;;AAWA,SAAA,OAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,KAAA,MAAA,EAAA,GAAqB,MAAK,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA9B;AAA8B;AAEvC,SAAA,SAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,KAAA,MAAA;GAAA,GAAqB;GAAiB,WAAA;EAAkB,CAAA;EAAG,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA3D;AAA2D;AAEpE,SAAA,UAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,KAAA,OAAA;GAAA,GAAsB;GAAiB,WAAA;EAA4C,CAAA;EAAG,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAtF;AAAsF;AAE/F,SAAA,QAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,KAAA,KAAA;GAAA,GAAoB;GAAkBA,WAAA;EAAY,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAtD;AAAsD;AAE/D,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,MAAM"}
@@ -0,0 +1,19 @@
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ //#region src/components/text/index.d.ts
3
+ type TextProps = useRender.ComponentProps<'span'> & {
4
+ /**
5
+ * The color role to render in. `inherit` takes the color of the nearest
6
+ * colored ancestor instead of setting one.
7
+ * @default 'default'
8
+ */
9
+ tone?: 'default' | 'error' | 'inherit' | 'muted' | 'negative' | 'positive' | 'primary';
10
+ /**
11
+ * Which style of the type scale to render.
12
+ * @default 'bodyMedium'
13
+ */
14
+ variant?: 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall';
15
+ };
16
+ declare function Text({ render, tone, variant, ...props }: TextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
17
+ //#endregion
18
+ export { type TextProps, Text as default };
19
+ //# sourceMappingURL=index.d.ts.map