@octavius2929-personal/design-system 0.9.0 → 0.10.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/dist/index.cjs +523 -335
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +19 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +324 -46
- package/dist/index.d.ts +324 -46
- package/dist/index.js +468 -271
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
Badge: () => Badge,
|
|
28
28
|
Breadcrumbs: () => Breadcrumbs,
|
|
29
29
|
Button: () => Button,
|
|
30
|
-
Card: () =>
|
|
30
|
+
Card: () => Card2,
|
|
31
31
|
CheckIcon: () => CheckIcon,
|
|
32
32
|
Checkbox: () => Checkbox,
|
|
33
33
|
ChevronDownIcon: () => ChevronDownIcon,
|
|
@@ -105,6 +105,9 @@ function useToggle(initial = false) {
|
|
|
105
105
|
return [on, toggle, setOn];
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
// src/components/container/index.tsx
|
|
109
|
+
var import_react3 = require("react");
|
|
110
|
+
|
|
108
111
|
// src/theme/styles/sprinkles/index.css.ts
|
|
109
112
|
var import_createRuntimeSprinkles = require("@vanilla-extract/sprinkles/createRuntimeSprinkles");
|
|
110
113
|
var sprinkles = (0, import_createRuntimeSprinkles.createSprinkles)({ conditions: void 0, styles: { p: { mappings: ["padding"] }, px: { mappings: ["paddingLeft", "paddingRight"] }, py: { mappings: ["paddingTop", "paddingBottom"] }, pt: { mappings: ["paddingTop"] }, pr: { mappings: ["paddingRight"] }, pb: { mappings: ["paddingBottom"] }, pl: { mappings: ["paddingLeft"] }, m: { mappings: ["marginTop", "marginRight", "marginBottom", "marginLeft"] }, mx: { mappings: ["marginLeft", "marginRight"] }, my: { mappings: ["marginTop", "marginBottom"] }, mt: { mappings: ["marginTop"] }, mr: { mappings: ["marginRight"] }, mb: { mappings: ["marginBottom"] }, ml: { mappings: ["marginLeft"] }, bg: { mappings: ["background"] }, radius: { mappings: ["borderRadius"] }, padding: { values: { s0: { defaultClass: "sprinkles_padding_s0__qhecrd0" }, s1: { defaultClass: "sprinkles_padding_s1__qhecrd1" }, s2: { defaultClass: "sprinkles_padding_s2__qhecrd2" }, s3: { defaultClass: "sprinkles_padding_s3__qhecrd3" }, s4: { defaultClass: "sprinkles_padding_s4__qhecrd4" }, s5: { defaultClass: "sprinkles_padding_s5__qhecrd5" }, s6: { defaultClass: "sprinkles_padding_s6__qhecrd6" }, s7: { defaultClass: "sprinkles_padding_s7__qhecrd7" }, s8: { defaultClass: "sprinkles_padding_s8__qhecrd8" }, s9: { defaultClass: "sprinkles_padding_s9__qhecrd9" } } }, paddingTop: { values: { s0: { defaultClass: "sprinkles_paddingTop_s0__qhecrda" }, s1: { defaultClass: "sprinkles_paddingTop_s1__qhecrdb" }, s2: { defaultClass: "sprinkles_paddingTop_s2__qhecrdc" }, s3: { defaultClass: "sprinkles_paddingTop_s3__qhecrdd" }, s4: { defaultClass: "sprinkles_paddingTop_s4__qhecrde" }, s5: { defaultClass: "sprinkles_paddingTop_s5__qhecrdf" }, s6: { defaultClass: "sprinkles_paddingTop_s6__qhecrdg" }, s7: { defaultClass: "sprinkles_paddingTop_s7__qhecrdh" }, s8: { defaultClass: "sprinkles_paddingTop_s8__qhecrdi" }, s9: { defaultClass: "sprinkles_paddingTop_s9__qhecrdj" } } }, paddingRight: { values: { s0: { defaultClass: "sprinkles_paddingRight_s0__qhecrdk" }, s1: { defaultClass: "sprinkles_paddingRight_s1__qhecrdl" }, s2: { defaultClass: "sprinkles_paddingRight_s2__qhecrdm" }, s3: { defaultClass: "sprinkles_paddingRight_s3__qhecrdn" }, s4: { defaultClass: "sprinkles_paddingRight_s4__qhecrdo" }, s5: { defaultClass: "sprinkles_paddingRight_s5__qhecrdp" }, s6: { defaultClass: "sprinkles_paddingRight_s6__qhecrdq" }, s7: { defaultClass: "sprinkles_paddingRight_s7__qhecrdr" }, s8: { defaultClass: "sprinkles_paddingRight_s8__qhecrds" }, s9: { defaultClass: "sprinkles_paddingRight_s9__qhecrdt" } } }, paddingBottom: { values: { s0: { defaultClass: "sprinkles_paddingBottom_s0__qhecrdu" }, s1: { defaultClass: "sprinkles_paddingBottom_s1__qhecrdv" }, s2: { defaultClass: "sprinkles_paddingBottom_s2__qhecrdw" }, s3: { defaultClass: "sprinkles_paddingBottom_s3__qhecrdx" }, s4: { defaultClass: "sprinkles_paddingBottom_s4__qhecrdy" }, s5: { defaultClass: "sprinkles_paddingBottom_s5__qhecrdz" }, s6: { defaultClass: "sprinkles_paddingBottom_s6__qhecrd10" }, s7: { defaultClass: "sprinkles_paddingBottom_s7__qhecrd11" }, s8: { defaultClass: "sprinkles_paddingBottom_s8__qhecrd12" }, s9: { defaultClass: "sprinkles_paddingBottom_s9__qhecrd13" } } }, paddingLeft: { values: { s0: { defaultClass: "sprinkles_paddingLeft_s0__qhecrd14" }, s1: { defaultClass: "sprinkles_paddingLeft_s1__qhecrd15" }, s2: { defaultClass: "sprinkles_paddingLeft_s2__qhecrd16" }, s3: { defaultClass: "sprinkles_paddingLeft_s3__qhecrd17" }, s4: { defaultClass: "sprinkles_paddingLeft_s4__qhecrd18" }, s5: { defaultClass: "sprinkles_paddingLeft_s5__qhecrd19" }, s6: { defaultClass: "sprinkles_paddingLeft_s6__qhecrd1a" }, s7: { defaultClass: "sprinkles_paddingLeft_s7__qhecrd1b" }, s8: { defaultClass: "sprinkles_paddingLeft_s8__qhecrd1c" }, s9: { defaultClass: "sprinkles_paddingLeft_s9__qhecrd1d" } } }, marginTop: { values: { s0: { defaultClass: "sprinkles_marginTop_s0__qhecrd1e" }, s1: { defaultClass: "sprinkles_marginTop_s1__qhecrd1f" }, s2: { defaultClass: "sprinkles_marginTop_s2__qhecrd1g" }, s3: { defaultClass: "sprinkles_marginTop_s3__qhecrd1h" }, s4: { defaultClass: "sprinkles_marginTop_s4__qhecrd1i" }, s5: { defaultClass: "sprinkles_marginTop_s5__qhecrd1j" }, s6: { defaultClass: "sprinkles_marginTop_s6__qhecrd1k" }, s7: { defaultClass: "sprinkles_marginTop_s7__qhecrd1l" }, s8: { defaultClass: "sprinkles_marginTop_s8__qhecrd1m" }, s9: { defaultClass: "sprinkles_marginTop_s9__qhecrd1n" } } }, marginRight: { values: { s0: { defaultClass: "sprinkles_marginRight_s0__qhecrd1o" }, s1: { defaultClass: "sprinkles_marginRight_s1__qhecrd1p" }, s2: { defaultClass: "sprinkles_marginRight_s2__qhecrd1q" }, s3: { defaultClass: "sprinkles_marginRight_s3__qhecrd1r" }, s4: { defaultClass: "sprinkles_marginRight_s4__qhecrd1s" }, s5: { defaultClass: "sprinkles_marginRight_s5__qhecrd1t" }, s6: { defaultClass: "sprinkles_marginRight_s6__qhecrd1u" }, s7: { defaultClass: "sprinkles_marginRight_s7__qhecrd1v" }, s8: { defaultClass: "sprinkles_marginRight_s8__qhecrd1w" }, s9: { defaultClass: "sprinkles_marginRight_s9__qhecrd1x" } } }, marginBottom: { values: { s0: { defaultClass: "sprinkles_marginBottom_s0__qhecrd1y" }, s1: { defaultClass: "sprinkles_marginBottom_s1__qhecrd1z" }, s2: { defaultClass: "sprinkles_marginBottom_s2__qhecrd20" }, s3: { defaultClass: "sprinkles_marginBottom_s3__qhecrd21" }, s4: { defaultClass: "sprinkles_marginBottom_s4__qhecrd22" }, s5: { defaultClass: "sprinkles_marginBottom_s5__qhecrd23" }, s6: { defaultClass: "sprinkles_marginBottom_s6__qhecrd24" }, s7: { defaultClass: "sprinkles_marginBottom_s7__qhecrd25" }, s8: { defaultClass: "sprinkles_marginBottom_s8__qhecrd26" }, s9: { defaultClass: "sprinkles_marginBottom_s9__qhecrd27" } } }, marginLeft: { values: { s0: { defaultClass: "sprinkles_marginLeft_s0__qhecrd28" }, s1: { defaultClass: "sprinkles_marginLeft_s1__qhecrd29" }, s2: { defaultClass: "sprinkles_marginLeft_s2__qhecrd2a" }, s3: { defaultClass: "sprinkles_marginLeft_s3__qhecrd2b" }, s4: { defaultClass: "sprinkles_marginLeft_s4__qhecrd2c" }, s5: { defaultClass: "sprinkles_marginLeft_s5__qhecrd2d" }, s6: { defaultClass: "sprinkles_marginLeft_s6__qhecrd2e" }, s7: { defaultClass: "sprinkles_marginLeft_s7__qhecrd2f" }, s8: { defaultClass: "sprinkles_marginLeft_s8__qhecrd2g" }, s9: { defaultClass: "sprinkles_marginLeft_s9__qhecrd2h" } } }, gap: { values: { s0: { defaultClass: "sprinkles_gap_s0__qhecrd2i" }, s1: { defaultClass: "sprinkles_gap_s1__qhecrd2j" }, s2: { defaultClass: "sprinkles_gap_s2__qhecrd2k" }, s3: { defaultClass: "sprinkles_gap_s3__qhecrd2l" }, s4: { defaultClass: "sprinkles_gap_s4__qhecrd2m" }, s5: { defaultClass: "sprinkles_gap_s5__qhecrd2n" }, s6: { defaultClass: "sprinkles_gap_s6__qhecrd2o" }, s7: { defaultClass: "sprinkles_gap_s7__qhecrd2p" }, s8: { defaultClass: "sprinkles_gap_s8__qhecrd2q" }, s9: { defaultClass: "sprinkles_gap_s9__qhecrd2r" } } }, rowGap: { values: { s0: { defaultClass: "sprinkles_rowGap_s0__qhecrd2s" }, s1: { defaultClass: "sprinkles_rowGap_s1__qhecrd2t" }, s2: { defaultClass: "sprinkles_rowGap_s2__qhecrd2u" }, s3: { defaultClass: "sprinkles_rowGap_s3__qhecrd2v" }, s4: { defaultClass: "sprinkles_rowGap_s4__qhecrd2w" }, s5: { defaultClass: "sprinkles_rowGap_s5__qhecrd2x" }, s6: { defaultClass: "sprinkles_rowGap_s6__qhecrd2y" }, s7: { defaultClass: "sprinkles_rowGap_s7__qhecrd2z" }, s8: { defaultClass: "sprinkles_rowGap_s8__qhecrd30" }, s9: { defaultClass: "sprinkles_rowGap_s9__qhecrd31" } } }, columnGap: { values: { s0: { defaultClass: "sprinkles_columnGap_s0__qhecrd32" }, s1: { defaultClass: "sprinkles_columnGap_s1__qhecrd33" }, s2: { defaultClass: "sprinkles_columnGap_s2__qhecrd34" }, s3: { defaultClass: "sprinkles_columnGap_s3__qhecrd35" }, s4: { defaultClass: "sprinkles_columnGap_s4__qhecrd36" }, s5: { defaultClass: "sprinkles_columnGap_s5__qhecrd37" }, s6: { defaultClass: "sprinkles_columnGap_s6__qhecrd38" }, s7: { defaultClass: "sprinkles_columnGap_s7__qhecrd39" }, s8: { defaultClass: "sprinkles_columnGap_s8__qhecrd3a" }, s9: { defaultClass: "sprinkles_columnGap_s9__qhecrd3b" } } }, background: { values: { bg1: { defaultClass: "sprinkles_background_bg1__qhecrd3c" }, bg2: { defaultClass: "sprinkles_background_bg2__qhecrd3d" }, bg3: { defaultClass: "sprinkles_background_bg3__qhecrd3e" }, bgInset: { defaultClass: "sprinkles_background_bgInset__qhecrd3f" }, fg1: { defaultClass: "sprinkles_background_fg1__qhecrd3g" }, fg2: { defaultClass: "sprinkles_background_fg2__qhecrd3h" }, fg3: { defaultClass: "sprinkles_background_fg3__qhecrd3i" }, fgOnAccent: { defaultClass: "sprinkles_background_fgOnAccent__qhecrd3j" }, border1: { defaultClass: "sprinkles_background_border1__qhecrd3k" }, border2: { defaultClass: "sprinkles_background_border2__qhecrd3l" }, borderStrong: { defaultClass: "sprinkles_background_borderStrong__qhecrd3m" }, accent: { defaultClass: "sprinkles_background_accent__qhecrd3n" }, accentHover: { defaultClass: "sprinkles_background_accentHover__qhecrd3o" }, accentSoft: { defaultClass: "sprinkles_background_accentSoft__qhecrd3p" }, ok: { defaultClass: "sprinkles_background_ok__qhecrd3q" }, warn: { defaultClass: "sprinkles_background_warn__qhecrd3r" }, danger: { defaultClass: "sprinkles_background_danger__qhecrd3s" }, info: { defaultClass: "sprinkles_background_info__qhecrd3t" }, focus: { defaultClass: "sprinkles_background_focus__qhecrd3u" }, scrim: { defaultClass: "sprinkles_background_scrim__qhecrd3v" } } }, color: { values: { bg1: { defaultClass: "sprinkles_color_bg1__qhecrd3w" }, bg2: { defaultClass: "sprinkles_color_bg2__qhecrd3x" }, bg3: { defaultClass: "sprinkles_color_bg3__qhecrd3y" }, bgInset: { defaultClass: "sprinkles_color_bgInset__qhecrd3z" }, fg1: { defaultClass: "sprinkles_color_fg1__qhecrd40" }, fg2: { defaultClass: "sprinkles_color_fg2__qhecrd41" }, fg3: { defaultClass: "sprinkles_color_fg3__qhecrd42" }, fgOnAccent: { defaultClass: "sprinkles_color_fgOnAccent__qhecrd43" }, border1: { defaultClass: "sprinkles_color_border1__qhecrd44" }, border2: { defaultClass: "sprinkles_color_border2__qhecrd45" }, borderStrong: { defaultClass: "sprinkles_color_borderStrong__qhecrd46" }, accent: { defaultClass: "sprinkles_color_accent__qhecrd47" }, accentHover: { defaultClass: "sprinkles_color_accentHover__qhecrd48" }, accentSoft: { defaultClass: "sprinkles_color_accentSoft__qhecrd49" }, ok: { defaultClass: "sprinkles_color_ok__qhecrd4a" }, warn: { defaultClass: "sprinkles_color_warn__qhecrd4b" }, danger: { defaultClass: "sprinkles_color_danger__qhecrd4c" }, info: { defaultClass: "sprinkles_color_info__qhecrd4d" }, focus: { defaultClass: "sprinkles_color_focus__qhecrd4e" }, scrim: { defaultClass: "sprinkles_color_scrim__qhecrd4f" } } }, borderRadius: { values: { none: { defaultClass: "sprinkles_borderRadius_none__qhecrd4g" }, sm: { defaultClass: "sprinkles_borderRadius_sm__qhecrd4h" }, md: { defaultClass: "sprinkles_borderRadius_md__qhecrd4i" }, lg: { defaultClass: "sprinkles_borderRadius_lg__qhecrd4j" }, base: { defaultClass: "sprinkles_borderRadius_base__qhecrd4k" }, full: { defaultClass: "sprinkles_borderRadius_full__qhecrd4l" } } }, display: { values: { block: { defaultClass: "sprinkles_display_block__qhecrd4m" }, "inline-block": { defaultClass: "sprinkles_display_inline-block__qhecrd4n" }, flex: { defaultClass: "sprinkles_display_flex__qhecrd4o" }, "inline-flex": { defaultClass: "sprinkles_display_inline-flex__qhecrd4p" }, grid: { defaultClass: "sprinkles_display_grid__qhecrd4q" }, none: { defaultClass: "sprinkles_display_none__qhecrd4r" } } }, flexDirection: { values: { row: { defaultClass: "sprinkles_flexDirection_row__qhecrd4s" }, column: { defaultClass: "sprinkles_flexDirection_column__qhecrd4t" }, "row-reverse": { defaultClass: "sprinkles_flexDirection_row-reverse__qhecrd4u" }, "column-reverse": { defaultClass: "sprinkles_flexDirection_column-reverse__qhecrd4v" } } }, alignItems: { values: { "flex-start": { defaultClass: "sprinkles_alignItems_flex-start__qhecrd4w" }, center: { defaultClass: "sprinkles_alignItems_center__qhecrd4x" }, "flex-end": { defaultClass: "sprinkles_alignItems_flex-end__qhecrd4y" }, stretch: { defaultClass: "sprinkles_alignItems_stretch__qhecrd4z" }, baseline: { defaultClass: "sprinkles_alignItems_baseline__qhecrd50" } } }, justifyContent: { values: { "flex-start": { defaultClass: "sprinkles_justifyContent_flex-start__qhecrd51" }, center: { defaultClass: "sprinkles_justifyContent_center__qhecrd52" }, "flex-end": { defaultClass: "sprinkles_justifyContent_flex-end__qhecrd53" }, "space-between": { defaultClass: "sprinkles_justifyContent_space-between__qhecrd54" }, "space-around": { defaultClass: "sprinkles_justifyContent_space-around__qhecrd55" }, "space-evenly": { defaultClass: "sprinkles_justifyContent_space-evenly__qhecrd56" } } }, flexWrap: { values: { nowrap: { defaultClass: "sprinkles_flexWrap_nowrap__qhecrd57" }, wrap: { defaultClass: "sprinkles_flexWrap_wrap__qhecrd58" } } } } });
|
|
@@ -126,17 +129,23 @@ function useStyles(props) {
|
|
|
126
129
|
|
|
127
130
|
// src/components/container/index.tsx
|
|
128
131
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
129
|
-
function
|
|
132
|
+
function ContainerImpl({ as, ...props }, ref) {
|
|
130
133
|
const Component = as ?? "div";
|
|
131
134
|
const { className, rest } = useStyles(props);
|
|
132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...rest, className });
|
|
135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...rest, className });
|
|
133
136
|
}
|
|
137
|
+
var ContainerForwarded = (0, import_react3.forwardRef)(ContainerImpl);
|
|
138
|
+
ContainerForwarded.displayName = "Container";
|
|
139
|
+
var Container = ContainerForwarded;
|
|
140
|
+
|
|
141
|
+
// src/components/typography/index.tsx
|
|
142
|
+
var import_react6 = require("react");
|
|
134
143
|
|
|
135
144
|
// src/components/typography/use-styles.ts
|
|
136
|
-
var
|
|
145
|
+
var import_react5 = require("react");
|
|
137
146
|
|
|
138
147
|
// src/theme/context/theme-context.tsx
|
|
139
|
-
var
|
|
148
|
+
var import_react4 = require("react");
|
|
140
149
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
141
150
|
var noop = () => {
|
|
142
151
|
};
|
|
@@ -150,7 +159,7 @@ var DEFAULT_VALUE = {
|
|
|
150
159
|
toggleMode: noop,
|
|
151
160
|
cycleMode: noop
|
|
152
161
|
};
|
|
153
|
-
var ThemeContext = (0,
|
|
162
|
+
var ThemeContext = (0, import_react4.createContext)(null);
|
|
154
163
|
function resolveSystemMode() {
|
|
155
164
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return "light";
|
|
156
165
|
if (window.matchMedia("(prefers-contrast: more)").matches) return "contrast";
|
|
@@ -180,14 +189,14 @@ function ThemeProvider({
|
|
|
180
189
|
storageKey = "ds-theme",
|
|
181
190
|
persist = true
|
|
182
191
|
}) {
|
|
183
|
-
const [schema, setSchema] = (0,
|
|
192
|
+
const [schema, setSchema] = (0, import_react4.useState)(
|
|
184
193
|
() => persist && readStored(storageKey)?.schema || defaultSchema
|
|
185
194
|
);
|
|
186
|
-
const [preference, setPreference] = (0,
|
|
195
|
+
const [preference, setPreference] = (0, import_react4.useState)(
|
|
187
196
|
() => (persist ? readStored(storageKey)?.preference : null) ?? defaultMode
|
|
188
197
|
);
|
|
189
|
-
const [systemMode, setSystemMode] = (0,
|
|
190
|
-
(0,
|
|
198
|
+
const [systemMode, setSystemMode] = (0, import_react4.useState)(resolveSystemMode);
|
|
199
|
+
(0, import_react4.useEffect)(() => {
|
|
191
200
|
if (preference !== "system") return;
|
|
192
201
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
193
202
|
const mqls = ["(prefers-contrast: more)", "(prefers-color-scheme: dark)"].map(
|
|
@@ -201,10 +210,10 @@ function ThemeProvider({
|
|
|
201
210
|
};
|
|
202
211
|
}, [preference]);
|
|
203
212
|
const mode = preference === "system" ? systemMode : preference;
|
|
204
|
-
(0,
|
|
213
|
+
(0, import_react4.useEffect)(() => {
|
|
205
214
|
if (persist) writeStored(storageKey, { schema, preference });
|
|
206
215
|
}, [schema, preference, persist, storageKey]);
|
|
207
|
-
const value = (0,
|
|
216
|
+
const value = (0, import_react4.useMemo)(
|
|
208
217
|
() => ({
|
|
209
218
|
schema,
|
|
210
219
|
mode,
|
|
@@ -223,7 +232,7 @@ function ThemeProvider({
|
|
|
223
232
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ThemeContext.Provider, { value, children });
|
|
224
233
|
}
|
|
225
234
|
function useTheme() {
|
|
226
|
-
return (0,
|
|
235
|
+
return (0, import_react4.useContext)(ThemeContext) ?? DEFAULT_VALUE;
|
|
227
236
|
}
|
|
228
237
|
|
|
229
238
|
// src/theme/typography.css.ts
|
|
@@ -241,7 +250,7 @@ function useStyles2({
|
|
|
241
250
|
align: align2
|
|
242
251
|
}) {
|
|
243
252
|
const { themeClass } = useTheme();
|
|
244
|
-
const className = (0,
|
|
253
|
+
const className = (0, import_react5.useMemo)(
|
|
245
254
|
() => [
|
|
246
255
|
themeClass,
|
|
247
256
|
base,
|
|
@@ -270,20 +279,22 @@ var defaultElement = {
|
|
|
270
279
|
code: "code",
|
|
271
280
|
blackletter: "span"
|
|
272
281
|
};
|
|
273
|
-
function
|
|
274
|
-
variant: variant2,
|
|
275
|
-
as,
|
|
276
|
-
color: color2,
|
|
277
|
-
align: align2,
|
|
278
|
-
...rest
|
|
279
|
-
}) {
|
|
282
|
+
function TypographyInner({ variant: variant2, as, color: color2, align: align2, ...rest }, ref) {
|
|
280
283
|
const Component = as ?? defaultElement[variant2];
|
|
281
284
|
const { text: text2 } = useStyles2({ variant: variant2, color: color2, align: align2 });
|
|
282
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, { ...rest, className: text2 });
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, { ref, ...rest, className: text2 });
|
|
283
286
|
}
|
|
287
|
+
var TypographyForwarded = (0, import_react6.forwardRef)(
|
|
288
|
+
TypographyInner
|
|
289
|
+
);
|
|
290
|
+
TypographyForwarded.displayName = "Typography";
|
|
291
|
+
var Typography = TypographyForwarded;
|
|
292
|
+
|
|
293
|
+
// src/components/button/index.tsx
|
|
294
|
+
var import_react8 = require("react");
|
|
284
295
|
|
|
285
296
|
// src/components/button/use-styles.ts
|
|
286
|
-
var
|
|
297
|
+
var import_react7 = require("react");
|
|
287
298
|
|
|
288
299
|
// src/components/button/use-styles.css.ts
|
|
289
300
|
var full = "use-styles_full__1pbtill4";
|
|
@@ -303,7 +314,7 @@ function useStyles3({
|
|
|
303
314
|
className
|
|
304
315
|
}) {
|
|
305
316
|
const { themeClass } = useTheme();
|
|
306
|
-
const container = (0,
|
|
317
|
+
const container = (0, import_react7.useMemo)(
|
|
307
318
|
() => [
|
|
308
319
|
themeClass,
|
|
309
320
|
root,
|
|
@@ -320,7 +331,7 @@ function useStyles3({
|
|
|
320
331
|
// src/components/button/index.tsx
|
|
321
332
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
322
333
|
var ICON_SIZE = { sm: 14, md: 16, lg: 18 };
|
|
323
|
-
|
|
334
|
+
var Button = (0, import_react8.forwardRef)(function Button2({
|
|
324
335
|
variant: variant2,
|
|
325
336
|
tone: tone4,
|
|
326
337
|
size: size3 = "md",
|
|
@@ -328,20 +339,24 @@ function Button({
|
|
|
328
339
|
endIcon: EndIcon,
|
|
329
340
|
full: full2,
|
|
330
341
|
className,
|
|
342
|
+
type = "button",
|
|
331
343
|
children,
|
|
332
344
|
...rest
|
|
333
|
-
}) {
|
|
345
|
+
}, ref) {
|
|
334
346
|
const { container } = useStyles3({ variant: variant2, tone: tone4, size: size3, full: full2, className });
|
|
335
347
|
const iconSize = ICON_SIZE[size3];
|
|
336
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { className: container, ...rest, children: [
|
|
348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { ref, type, className: container, ...rest, children: [
|
|
337
349
|
StartIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StartIcon, { size: iconSize }),
|
|
338
350
|
children,
|
|
339
351
|
EndIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EndIcon, { size: iconSize })
|
|
340
352
|
] });
|
|
341
|
-
}
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// src/components/divider/index.tsx
|
|
356
|
+
var import_react10 = require("react");
|
|
342
357
|
|
|
343
358
|
// src/components/divider/use-styles.ts
|
|
344
|
-
var
|
|
359
|
+
var import_react9 = require("react");
|
|
345
360
|
|
|
346
361
|
// src/components/divider/use-styles.css.ts
|
|
347
362
|
var horizontal = "use-styles_horizontal__1n7v7yj1";
|
|
@@ -354,7 +369,7 @@ var vertical = "use-styles_vertical__1n7v7yj2";
|
|
|
354
369
|
// src/components/divider/use-styles.ts
|
|
355
370
|
function useStyles4({ vertical: vertical2, hasLabel }) {
|
|
356
371
|
const { themeClass } = useTheme();
|
|
357
|
-
const root24 = (0,
|
|
372
|
+
const root24 = (0, import_react9.useMemo)(
|
|
358
373
|
() => [
|
|
359
374
|
themeClass,
|
|
360
375
|
root2,
|
|
@@ -367,21 +382,24 @@ function useStyles4({ vertical: vertical2, hasLabel }) {
|
|
|
367
382
|
|
|
368
383
|
// src/components/divider/index.tsx
|
|
369
384
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
370
|
-
|
|
385
|
+
var Divider = (0, import_react10.forwardRef)(function Divider2({ vertical: vertical2, label: label7, ...rest }, ref) {
|
|
371
386
|
const hasLabel = label7 != null;
|
|
372
387
|
const { root: root24, line: line2, label: labelClass } = useStyles4({ vertical: vertical2, hasLabel });
|
|
373
388
|
if (hasLabel) {
|
|
374
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { role: "separator", className: root24, ...rest, children: [
|
|
389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, role: "separator", className: root24, ...rest, children: [
|
|
375
390
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: line2 }),
|
|
376
391
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: labelClass, children: label7 }),
|
|
377
392
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: line2 })
|
|
378
393
|
] });
|
|
379
394
|
}
|
|
380
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "separator", className: root24, ...rest });
|
|
381
|
-
}
|
|
395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, role: "separator", className: root24, ...rest });
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
// src/components/avatar/index.tsx
|
|
399
|
+
var import_react12 = require("react");
|
|
382
400
|
|
|
383
401
|
// src/components/avatar/use-styles.ts
|
|
384
|
-
var
|
|
402
|
+
var import_react11 = require("react");
|
|
385
403
|
|
|
386
404
|
// src/components/avatar/use-styles.css.ts
|
|
387
405
|
var root3 = "use-styles_root__1mn1rmu0";
|
|
@@ -395,7 +413,7 @@ function useStyles5({
|
|
|
395
413
|
className
|
|
396
414
|
}) {
|
|
397
415
|
const { themeClass } = useTheme();
|
|
398
|
-
const root24 = (0,
|
|
416
|
+
const root24 = (0, import_react11.useMemo)(
|
|
399
417
|
() => [
|
|
400
418
|
themeClass,
|
|
401
419
|
root3,
|
|
@@ -410,13 +428,16 @@ function useStyles5({
|
|
|
410
428
|
|
|
411
429
|
// src/components/avatar/index.tsx
|
|
412
430
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
413
|
-
|
|
431
|
+
var Avatar = (0, import_react12.forwardRef)(function Avatar2({ size: size3, filled, className, children, ...rest }, ref) {
|
|
414
432
|
const { root: root24 } = useStyles5({ size: size3, filled, className });
|
|
415
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: root24, ...rest, children });
|
|
416
|
-
}
|
|
433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref, className: root24, ...rest, children });
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// src/components/badge/index.tsx
|
|
437
|
+
var import_react14 = require("react");
|
|
417
438
|
|
|
418
439
|
// src/components/badge/use-styles.ts
|
|
419
|
-
var
|
|
440
|
+
var import_react13 = require("react");
|
|
420
441
|
|
|
421
442
|
// src/components/badge/use-styles.css.ts
|
|
422
443
|
var dot = "use-styles_dot__1wpei6p1";
|
|
@@ -429,26 +450,29 @@ function useStyles6({
|
|
|
429
450
|
className
|
|
430
451
|
}) {
|
|
431
452
|
const { themeClass } = useTheme();
|
|
432
|
-
const root24 = (0,
|
|
453
|
+
const root24 = (0, import_react13.useMemo)(
|
|
433
454
|
() => [themeClass, root4, className].filter(Boolean).join(" "),
|
|
434
455
|
[themeClass, className]
|
|
435
456
|
);
|
|
436
|
-
const dot3 = (0,
|
|
457
|
+
const dot3 = (0, import_react13.useMemo)(() => [dot, tone2[tone4]].join(" "), [tone4]);
|
|
437
458
|
return { root: root24, dot: dot3 };
|
|
438
459
|
}
|
|
439
460
|
|
|
440
461
|
// src/components/badge/index.tsx
|
|
441
462
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
442
|
-
|
|
463
|
+
var Badge = (0, import_react14.forwardRef)(function Badge2({ count, tone: tone4, className, children, ...rest }, ref) {
|
|
443
464
|
const { root: root24, dot: dot3 } = useStyles6({ tone: tone4, className });
|
|
444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: root24, ...rest, children: [
|
|
465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { ref, className: root24, ...rest, children: [
|
|
445
466
|
children,
|
|
446
467
|
count != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: dot3, children: count })
|
|
447
468
|
] });
|
|
448
|
-
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// src/components/progress/index.tsx
|
|
472
|
+
var import_react16 = require("react");
|
|
449
473
|
|
|
450
474
|
// src/components/progress/use-styles.ts
|
|
451
|
-
var
|
|
475
|
+
var import_react15 = require("react");
|
|
452
476
|
|
|
453
477
|
// src/components/progress/use-styles.css.ts
|
|
454
478
|
var bar = "use-styles_bar__kbop7v3";
|
|
@@ -464,7 +488,7 @@ function useStyles7({
|
|
|
464
488
|
}) {
|
|
465
489
|
const { themeClass } = useTheme();
|
|
466
490
|
const indeterminate2 = value === void 0;
|
|
467
|
-
return (0,
|
|
491
|
+
return (0, import_react15.useMemo)(() => {
|
|
468
492
|
const root24 = (...classes) => [themeClass, ...classes, className].filter(Boolean).join(" ");
|
|
469
493
|
if (variant2 === "circular") {
|
|
470
494
|
return { track: "", bar: "", spinner: root24(spinner) };
|
|
@@ -479,19 +503,14 @@ function useStyles7({
|
|
|
479
503
|
|
|
480
504
|
// src/components/progress/index.tsx
|
|
481
505
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
482
|
-
|
|
483
|
-
variant: variant2 = "linear",
|
|
484
|
-
value,
|
|
485
|
-
size: size3 = 20,
|
|
486
|
-
className,
|
|
487
|
-
...rest
|
|
488
|
-
}) {
|
|
506
|
+
var Progress = (0, import_react16.forwardRef)(function Progress2({ variant: variant2 = "linear", value, size: size3 = 20, className, ...rest }, ref) {
|
|
489
507
|
const { track: track4, bar: bar2, spinner: spinner2 } = useStyles7({ variant: variant2, value, className });
|
|
490
508
|
const indeterminate2 = value === void 0;
|
|
491
509
|
if (variant2 === "circular") {
|
|
492
510
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
493
511
|
"span",
|
|
494
512
|
{
|
|
513
|
+
ref,
|
|
495
514
|
className: spinner2,
|
|
496
515
|
role: "progressbar",
|
|
497
516
|
"aria-valuenow": indeterminate2 ? void 0 : value,
|
|
@@ -505,6 +524,7 @@ function Progress({
|
|
|
505
524
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
506
525
|
"div",
|
|
507
526
|
{
|
|
527
|
+
ref,
|
|
508
528
|
className: track4,
|
|
509
529
|
role: "progressbar",
|
|
510
530
|
"aria-valuenow": indeterminate2 ? void 0 : value,
|
|
@@ -514,7 +534,10 @@ function Progress({
|
|
|
514
534
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: bar2, style: indeterminate2 ? void 0 : { width: `${value}%` } })
|
|
515
535
|
}
|
|
516
536
|
);
|
|
517
|
-
}
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
// src/components/chip/index.tsx
|
|
540
|
+
var import_react18 = require("react");
|
|
518
541
|
|
|
519
542
|
// src/components/icons/x/index.tsx
|
|
520
543
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
@@ -542,7 +565,7 @@ function XIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
542
565
|
}
|
|
543
566
|
|
|
544
567
|
// src/components/chip/use-styles.ts
|
|
545
|
-
var
|
|
568
|
+
var import_react17 = require("react");
|
|
546
569
|
|
|
547
570
|
// src/components/chip/use-styles.css.ts
|
|
548
571
|
var clickable = "use-styles_clickable__1axilf44";
|
|
@@ -558,7 +581,7 @@ function useStyles8({
|
|
|
558
581
|
clickable: clickable2
|
|
559
582
|
}) {
|
|
560
583
|
const { themeClass } = useTheme();
|
|
561
|
-
const root24 = (0,
|
|
584
|
+
const root24 = (0, import_react17.useMemo)(
|
|
562
585
|
() => [
|
|
563
586
|
themeClass,
|
|
564
587
|
root5,
|
|
@@ -572,18 +595,21 @@ function useStyles8({
|
|
|
572
595
|
|
|
573
596
|
// src/components/chip/index.tsx
|
|
574
597
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
575
|
-
|
|
598
|
+
var Chip = (0, import_react18.forwardRef)(function Chip2({ selected: selected3, tone: tone4, onDelete, onClick, children, ...rest }, ref) {
|
|
576
599
|
const clickable2 = Boolean(onClick);
|
|
577
600
|
const { root: root24, deleteBtn: deleteBtn2 } = useStyles8({ selected: selected3, tone: tone4, clickable: clickable2 });
|
|
578
601
|
const handleDelete = (event) => {
|
|
579
602
|
event.stopPropagation();
|
|
580
603
|
onDelete?.();
|
|
581
604
|
};
|
|
582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: root24, onClick, ...rest, children: [
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { ref, className: root24, onClick, ...rest, children: [
|
|
583
606
|
children,
|
|
584
607
|
onDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: deleteBtn2, "aria-label": "Remove", onClick: handleDelete, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(XIcon, { size: 13 }) })
|
|
585
608
|
] });
|
|
586
|
-
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// src/components/checkbox/index.tsx
|
|
612
|
+
var import_react20 = require("react");
|
|
587
613
|
|
|
588
614
|
// src/components/icons/check/index.tsx
|
|
589
615
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -608,7 +634,7 @@ function CheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
608
634
|
}
|
|
609
635
|
|
|
610
636
|
// src/components/checkbox/use-styles.ts
|
|
611
|
-
var
|
|
637
|
+
var import_react19 = require("react");
|
|
612
638
|
|
|
613
639
|
// src/components/checkbox/use-styles.css.ts
|
|
614
640
|
var box = "use-styles_box__9zoga91";
|
|
@@ -621,11 +647,11 @@ var root6 = "use-styles_root__9zoga90";
|
|
|
621
647
|
// src/components/checkbox/use-styles.ts
|
|
622
648
|
function useStyles9({ checked, disabled: disabled3 }) {
|
|
623
649
|
const { themeClass } = useTheme();
|
|
624
|
-
const root24 = (0,
|
|
650
|
+
const root24 = (0, import_react19.useMemo)(
|
|
625
651
|
() => [themeClass, root6, disabled3 && disabled].filter(Boolean).join(" "),
|
|
626
652
|
[themeClass, disabled3]
|
|
627
653
|
);
|
|
628
|
-
const box2 = (0,
|
|
654
|
+
const box2 = (0, import_react19.useMemo)(
|
|
629
655
|
() => [box, checked && boxChecked].filter(Boolean).join(" "),
|
|
630
656
|
[checked]
|
|
631
657
|
);
|
|
@@ -634,13 +660,7 @@ function useStyles9({ checked, disabled: disabled3 }) {
|
|
|
634
660
|
|
|
635
661
|
// src/components/checkbox/index.tsx
|
|
636
662
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
637
|
-
|
|
638
|
-
checked = false,
|
|
639
|
-
onChange,
|
|
640
|
-
label: label7,
|
|
641
|
-
disabled: disabled3 = false,
|
|
642
|
-
id
|
|
643
|
-
}) {
|
|
663
|
+
var Checkbox = (0, import_react20.forwardRef)(function Checkbox2({ checked = false, onChange, label: label7, disabled: disabled3 = false, id, ...rest }, ref) {
|
|
644
664
|
const { root: root24, input: input6, box: box2, check: check2 } = useStyles9({ checked, disabled: disabled3 });
|
|
645
665
|
const handleChange = (e) => {
|
|
646
666
|
if (disabled3) return;
|
|
@@ -650,21 +670,26 @@ function Checkbox({
|
|
|
650
670
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
651
671
|
"input",
|
|
652
672
|
{
|
|
673
|
+
ref,
|
|
653
674
|
type: "checkbox",
|
|
654
675
|
className: input6,
|
|
655
676
|
id,
|
|
656
677
|
checked,
|
|
657
678
|
disabled: disabled3,
|
|
658
|
-
onChange: handleChange
|
|
679
|
+
onChange: handleChange,
|
|
680
|
+
...rest
|
|
659
681
|
}
|
|
660
682
|
),
|
|
661
683
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: box2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CheckIcon, { size: 12, className: check2 }) }),
|
|
662
684
|
label7
|
|
663
685
|
] });
|
|
664
|
-
}
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// src/components/radio/index.tsx
|
|
689
|
+
var import_react22 = require("react");
|
|
665
690
|
|
|
666
691
|
// src/components/radio/use-styles.ts
|
|
667
|
-
var
|
|
692
|
+
var import_react21 = require("react");
|
|
668
693
|
|
|
669
694
|
// src/components/radio/use-styles.css.ts
|
|
670
695
|
var circle = "use-styles_circle__vy61b42";
|
|
@@ -680,7 +705,7 @@ function useStyles10({
|
|
|
680
705
|
className
|
|
681
706
|
}) {
|
|
682
707
|
const { themeClass } = useTheme();
|
|
683
|
-
const root24 = (0,
|
|
708
|
+
const root24 = (0, import_react21.useMemo)(
|
|
684
709
|
() => [themeClass, root7, disabled3 && disabled2, className].filter(Boolean).join(" "),
|
|
685
710
|
[themeClass, disabled3, className]
|
|
686
711
|
);
|
|
@@ -695,28 +720,33 @@ function useStyles10({
|
|
|
695
720
|
|
|
696
721
|
// src/components/radio/index.tsx
|
|
697
722
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
698
|
-
|
|
723
|
+
var Radio = (0, import_react22.forwardRef)(function Radio2({ checked, onChange, label: label7, name, value, disabled: disabled3, ...rest }, ref) {
|
|
699
724
|
const { root: root24, input: input6, circle: circle2, dot: dot3, label: labelClass } = useStyles10({ disabled: disabled3 });
|
|
700
725
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: root24, children: [
|
|
701
726
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
702
727
|
"input",
|
|
703
728
|
{
|
|
729
|
+
ref,
|
|
704
730
|
className: input6,
|
|
705
731
|
type: "radio",
|
|
706
732
|
name,
|
|
707
733
|
value,
|
|
708
734
|
checked,
|
|
709
735
|
disabled: disabled3,
|
|
710
|
-
onChange
|
|
736
|
+
onChange,
|
|
737
|
+
...rest
|
|
711
738
|
}
|
|
712
739
|
),
|
|
713
740
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: circle2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: dot3 }) }),
|
|
714
741
|
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: labelClass, children: label7 })
|
|
715
742
|
] });
|
|
716
|
-
}
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
// src/components/switch/index.tsx
|
|
746
|
+
var import_react24 = require("react");
|
|
717
747
|
|
|
718
748
|
// src/components/switch/use-styles.ts
|
|
719
|
-
var
|
|
749
|
+
var import_react23 = require("react");
|
|
720
750
|
|
|
721
751
|
// src/components/switch/use-styles.css.ts
|
|
722
752
|
var input3 = "surfaces_srOnly__1qa7atn0";
|
|
@@ -730,7 +760,7 @@ var trackChecked = "use-styles_trackChecked__1r6kem72";
|
|
|
730
760
|
// src/components/switch/use-styles.ts
|
|
731
761
|
function useStyles11({ checked }) {
|
|
732
762
|
const { themeClass } = useTheme();
|
|
733
|
-
return (0,
|
|
763
|
+
return (0, import_react23.useMemo)(
|
|
734
764
|
() => ({
|
|
735
765
|
root: [themeClass, root8].filter(Boolean).join(" "),
|
|
736
766
|
input: input3,
|
|
@@ -744,12 +774,13 @@ function useStyles11({ checked }) {
|
|
|
744
774
|
|
|
745
775
|
// src/components/switch/index.tsx
|
|
746
776
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
747
|
-
|
|
777
|
+
var Switch = (0, import_react24.forwardRef)(function Switch2({ checked = false, onChange, label: label7, disabled: disabled3, ...rest }, ref) {
|
|
748
778
|
const { root: root24, input: input6, track: track4, knob: knob2, label: labelClass } = useStyles11({ checked });
|
|
749
779
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: root24, children: [
|
|
750
780
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
751
781
|
"input",
|
|
752
782
|
{
|
|
783
|
+
ref,
|
|
753
784
|
type: "checkbox",
|
|
754
785
|
role: "switch",
|
|
755
786
|
"aria-checked": checked,
|
|
@@ -759,19 +790,23 @@ function Switch({ checked = false, onChange, label: label7, disabled: disabled3
|
|
|
759
790
|
onChange: (event) => {
|
|
760
791
|
if (disabled3) return;
|
|
761
792
|
onChange?.(event.target.checked);
|
|
762
|
-
}
|
|
793
|
+
},
|
|
794
|
+
...rest
|
|
763
795
|
}
|
|
764
796
|
),
|
|
765
797
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: track4, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: knob2 }) }),
|
|
766
798
|
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: labelClass, children: label7 })
|
|
767
799
|
] });
|
|
768
|
-
}
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
// src/components/text-field/index.tsx
|
|
803
|
+
var import_react27 = require("react");
|
|
769
804
|
|
|
770
805
|
// src/components/base-field/index.tsx
|
|
771
|
-
var
|
|
806
|
+
var import_react26 = require("react");
|
|
772
807
|
|
|
773
808
|
// src/components/base-field/use-styles.ts
|
|
774
|
-
var
|
|
809
|
+
var import_react25 = require("react");
|
|
775
810
|
|
|
776
811
|
// src/components/base-field/use-styles.css.ts
|
|
777
812
|
var field = "use-styles_field__1c3cgd3";
|
|
@@ -790,7 +825,7 @@ var trailingSlot = "use-styles_trailingSlot__1c3cgdb";
|
|
|
790
825
|
// src/components/base-field/use-styles.ts
|
|
791
826
|
function useStyles12({ error, hasStartIcon, hasTrailing, className }) {
|
|
792
827
|
const { themeClass } = useTheme();
|
|
793
|
-
return (0,
|
|
828
|
+
return (0, import_react25.useMemo)(() => {
|
|
794
829
|
const root24 = [themeClass, root9].filter(Boolean).join(" ");
|
|
795
830
|
const labelText2 = [labelText, error && labelTextError].filter(Boolean).join(" ");
|
|
796
831
|
const input6 = [
|
|
@@ -815,21 +850,15 @@ function useStyles12({ error, hasStartIcon, hasTrailing, className }) {
|
|
|
815
850
|
|
|
816
851
|
// src/components/base-field/index.tsx
|
|
817
852
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
help,
|
|
821
|
-
error,
|
|
822
|
-
startIcon: StartIcon,
|
|
823
|
-
trailing: trailing2,
|
|
824
|
-
id,
|
|
825
|
-
className,
|
|
826
|
-
children
|
|
827
|
-
}) {
|
|
828
|
-
const autoId = (0, import_react15.useId)();
|
|
853
|
+
var BaseField = (0, import_react26.forwardRef)(function BaseField2({ label: label7, help, error, startIcon: StartIcon, trailing: trailing2, id, className, children }, ref) {
|
|
854
|
+
const autoId = (0, import_react26.useId)();
|
|
829
855
|
const controlId = id ?? autoId;
|
|
830
|
-
const
|
|
856
|
+
const errorMessage = error != null && error !== false && error !== true && error !== "" ? error : null;
|
|
857
|
+
const hasError = error === true || errorMessage != null;
|
|
858
|
+
const message2 = errorMessage ?? help;
|
|
859
|
+
const messageId = message2 != null ? `${controlId}-msg` : void 0;
|
|
831
860
|
const classes = useStyles12({
|
|
832
|
-
error,
|
|
861
|
+
error: hasError,
|
|
833
862
|
hasStartIcon: StartIcon != null,
|
|
834
863
|
hasTrailing: trailing2 != null,
|
|
835
864
|
className
|
|
@@ -837,8 +866,9 @@ function BaseField({
|
|
|
837
866
|
const control = {
|
|
838
867
|
id: controlId,
|
|
839
868
|
className: classes.input,
|
|
840
|
-
|
|
841
|
-
"aria-
|
|
869
|
+
ref,
|
|
870
|
+
"aria-describedby": messageId,
|
|
871
|
+
"aria-invalid": hasError ? true : void 0
|
|
842
872
|
};
|
|
843
873
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: classes.root, children: [
|
|
844
874
|
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: controlId, className: classes.labelText, children: label7 }),
|
|
@@ -847,13 +877,26 @@ function BaseField({
|
|
|
847
877
|
children(control),
|
|
848
878
|
trailing2 != null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: classes.trailingSlot, children: trailing2 })
|
|
849
879
|
] }),
|
|
850
|
-
|
|
880
|
+
message2 != null && // `aria-live` solo cuando el mensaje es un error: anuncia la validación al aparecer.
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
882
|
+
"span",
|
|
883
|
+
{
|
|
884
|
+
id: messageId,
|
|
885
|
+
className: classes.helpText,
|
|
886
|
+
"aria-live": errorMessage ? "polite" : void 0,
|
|
887
|
+
children: message2
|
|
888
|
+
}
|
|
889
|
+
)
|
|
851
890
|
] });
|
|
852
|
-
}
|
|
891
|
+
});
|
|
853
892
|
|
|
854
893
|
// src/components/text-field/index.tsx
|
|
855
|
-
var import_jsx_runtime16 =
|
|
856
|
-
|
|
894
|
+
var import_jsx_runtime16 = (
|
|
895
|
+
// En multiline el control es un <textarea>: no reenviamos `controlRef` porque el
|
|
896
|
+
// tipo público de la ref es HTMLInputElement (la ref aplica solo a la rama <input>).
|
|
897
|
+
require("react/jsx-runtime")
|
|
898
|
+
);
|
|
899
|
+
var TextField = (0, import_react27.forwardRef)(function TextField2({
|
|
857
900
|
label: label7,
|
|
858
901
|
help,
|
|
859
902
|
error,
|
|
@@ -865,17 +908,18 @@ function TextField({
|
|
|
865
908
|
className,
|
|
866
909
|
id,
|
|
867
910
|
...rest
|
|
868
|
-
}) {
|
|
911
|
+
}, ref) {
|
|
869
912
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
870
913
|
BaseField,
|
|
871
914
|
{
|
|
915
|
+
ref,
|
|
872
916
|
label: label7,
|
|
873
917
|
help,
|
|
874
918
|
error,
|
|
875
919
|
startIcon,
|
|
876
920
|
id,
|
|
877
921
|
className,
|
|
878
|
-
children: (control) => multiline ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
922
|
+
children: ({ ref: controlRef, ...control }) => multiline ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
879
923
|
"textarea",
|
|
880
924
|
{
|
|
881
925
|
...rest,
|
|
@@ -888,16 +932,17 @@ function TextField({
|
|
|
888
932
|
{
|
|
889
933
|
...rest,
|
|
890
934
|
...control,
|
|
935
|
+
ref: controlRef,
|
|
891
936
|
type,
|
|
892
937
|
onChange: (e) => onChange?.(e.target.value)
|
|
893
938
|
}
|
|
894
939
|
)
|
|
895
940
|
}
|
|
896
941
|
);
|
|
897
|
-
}
|
|
942
|
+
});
|
|
898
943
|
|
|
899
944
|
// src/components/password-field/index.tsx
|
|
900
|
-
var
|
|
945
|
+
var import_react29 = require("react");
|
|
901
946
|
|
|
902
947
|
// src/components/icons/eye/index.tsx
|
|
903
948
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -952,65 +997,67 @@ function EyeOffIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
952
997
|
}
|
|
953
998
|
|
|
954
999
|
// src/components/password-field/use-styles.ts
|
|
955
|
-
var
|
|
1000
|
+
var import_react28 = require("react");
|
|
956
1001
|
|
|
957
1002
|
// src/components/password-field/use-styles.css.ts
|
|
958
1003
|
var revealButton = "use-styles_revealButton__rsu9d50";
|
|
959
1004
|
|
|
960
1005
|
// src/components/password-field/use-styles.ts
|
|
961
1006
|
function useStyles13() {
|
|
962
|
-
return (0,
|
|
1007
|
+
return (0, import_react28.useMemo)(() => ({ revealButton }), []);
|
|
963
1008
|
}
|
|
964
1009
|
|
|
965
1010
|
// src/components/password-field/index.tsx
|
|
966
1011
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
967
|
-
|
|
968
|
-
label: label7,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1012
|
+
var PasswordField = (0, import_react29.forwardRef)(
|
|
1013
|
+
function PasswordField2({ label: label7, help, error, startIcon, onChange, id, className, ...rest }, ref) {
|
|
1014
|
+
const [reveal, setReveal] = (0, import_react29.useState)(false);
|
|
1015
|
+
const classes = useStyles13();
|
|
1016
|
+
const handleChange = (e) => {
|
|
1017
|
+
onChange?.(e.target.value);
|
|
1018
|
+
};
|
|
1019
|
+
const handleToggleMouseDown = (e) => {
|
|
1020
|
+
e.preventDefault();
|
|
1021
|
+
};
|
|
1022
|
+
const toggleButton = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1023
|
+
"button",
|
|
1024
|
+
{
|
|
1025
|
+
type: "button",
|
|
1026
|
+
tabIndex: -1,
|
|
1027
|
+
className: classes.revealButton,
|
|
1028
|
+
"aria-label": reveal ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
1029
|
+
onMouseDown: handleToggleMouseDown,
|
|
1030
|
+
onClick: () => setReveal((r) => !r),
|
|
1031
|
+
children: reveal ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(EyeOffIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(EyeIcon, { size: 18 })
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1035
|
+
BaseField,
|
|
1036
|
+
{
|
|
1037
|
+
ref,
|
|
1038
|
+
label: label7,
|
|
1039
|
+
help,
|
|
1040
|
+
error,
|
|
1041
|
+
startIcon,
|
|
1042
|
+
trailing: toggleButton,
|
|
1043
|
+
id,
|
|
1044
|
+
className,
|
|
1045
|
+
children: (control) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1046
|
+
"input",
|
|
1047
|
+
{
|
|
1048
|
+
...rest,
|
|
1049
|
+
...control,
|
|
1050
|
+
type: reveal ? "text" : "password",
|
|
1051
|
+
onChange: handleChange
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
);
|
|
1011
1058
|
|
|
1012
1059
|
// src/components/money-field/index.tsx
|
|
1013
|
-
var
|
|
1060
|
+
var import_react30 = require("react");
|
|
1014
1061
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1015
1062
|
function parseAmount(raw) {
|
|
1016
1063
|
const cleaned = raw.replace(/[^0-9.-]/g, "");
|
|
@@ -1018,7 +1065,7 @@ function parseAmount(raw) {
|
|
|
1018
1065
|
const n = Number.parseFloat(cleaned);
|
|
1019
1066
|
return Number.isNaN(n) ? null : n;
|
|
1020
1067
|
}
|
|
1021
|
-
|
|
1068
|
+
var MoneyField = (0, import_react30.forwardRef)(function MoneyField2({
|
|
1022
1069
|
value,
|
|
1023
1070
|
onChange,
|
|
1024
1071
|
currency = "USD",
|
|
@@ -1032,10 +1079,10 @@ function MoneyField({
|
|
|
1032
1079
|
onFocus,
|
|
1033
1080
|
onBlur,
|
|
1034
1081
|
...rest
|
|
1035
|
-
}) {
|
|
1036
|
-
const [focused, setFocused] = (0,
|
|
1037
|
-
const [draft, setDraft] = (0,
|
|
1038
|
-
const formatter = (0,
|
|
1082
|
+
}, ref) {
|
|
1083
|
+
const [focused, setFocused] = (0, import_react30.useState)(false);
|
|
1084
|
+
const [draft, setDraft] = (0, import_react30.useState)("");
|
|
1085
|
+
const formatter = (0, import_react30.useMemo)(
|
|
1039
1086
|
() => new Intl.NumberFormat(locale, { style: "currency", currency }),
|
|
1040
1087
|
[locale, currency]
|
|
1041
1088
|
);
|
|
@@ -1054,6 +1101,7 @@ function MoneyField({
|
|
|
1054
1101
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1055
1102
|
BaseField,
|
|
1056
1103
|
{
|
|
1104
|
+
ref,
|
|
1057
1105
|
label: label7,
|
|
1058
1106
|
help,
|
|
1059
1107
|
error,
|
|
@@ -1074,10 +1122,13 @@ function MoneyField({
|
|
|
1074
1122
|
)
|
|
1075
1123
|
}
|
|
1076
1124
|
);
|
|
1077
|
-
}
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
// src/components/icon-button/index.tsx
|
|
1128
|
+
var import_react32 = require("react");
|
|
1078
1129
|
|
|
1079
1130
|
// src/components/icon-button/use-styles.ts
|
|
1080
|
-
var
|
|
1131
|
+
var import_react31 = require("react");
|
|
1081
1132
|
|
|
1082
1133
|
// src/components/icon-button/use-styles.css.ts
|
|
1083
1134
|
var accent = "use-styles_accent__18np0q02";
|
|
@@ -1090,7 +1141,7 @@ function useStyles14({
|
|
|
1090
1141
|
tone: tone4 = "ink"
|
|
1091
1142
|
}) {
|
|
1092
1143
|
const { themeClass } = useTheme();
|
|
1093
|
-
const root24 = (0,
|
|
1144
|
+
const root24 = (0, import_react31.useMemo)(
|
|
1094
1145
|
() => [themeClass, root10, tone4 === "accent" && accent, active2 && active].filter(Boolean).join(" "),
|
|
1095
1146
|
[themeClass, active2, tone4]
|
|
1096
1147
|
);
|
|
@@ -1099,13 +1150,23 @@ function useStyles14({
|
|
|
1099
1150
|
|
|
1100
1151
|
// src/components/icon-button/index.tsx
|
|
1101
1152
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1102
|
-
|
|
1153
|
+
var IconButton = (0, import_react32.forwardRef)(function IconButton2({ icon: Icon, active: active2, tone: tone4, title, type = "button", ...rest }, ref) {
|
|
1154
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
1155
|
+
const restProps = rest;
|
|
1156
|
+
const hasName = title.trim() !== "" || restProps["aria-label"] != null || restProps["aria-labelledby"] != null;
|
|
1157
|
+
if (!hasName) {
|
|
1158
|
+
console.warn("IconButton: falta un nombre accesible (`title` o `aria-label`).");
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1103
1161
|
const { root: root24 } = useStyles14({ active: active2, tone: tone4 });
|
|
1104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: root24, "aria-label": title, title, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 18 }) });
|
|
1105
|
-
}
|
|
1162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { ref, type, className: root24, "aria-label": title, title, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 18 }) });
|
|
1163
|
+
});
|
|
1164
|
+
|
|
1165
|
+
// src/components/card/index.tsx
|
|
1166
|
+
var import_react34 = require("react");
|
|
1106
1167
|
|
|
1107
1168
|
// src/components/card/use-styles.ts
|
|
1108
|
-
var
|
|
1169
|
+
var import_react33 = require("react");
|
|
1109
1170
|
|
|
1110
1171
|
// src/components/card/use-styles.css.ts
|
|
1111
1172
|
var body = "use-styles_body__1fuvd022";
|
|
@@ -1116,16 +1177,16 @@ var root11 = "use-styles_root__1fuvd020";
|
|
|
1116
1177
|
// src/components/card/use-styles.ts
|
|
1117
1178
|
function useStyles15() {
|
|
1118
1179
|
const { themeClass } = useTheme();
|
|
1119
|
-
const root24 = (0,
|
|
1180
|
+
const root24 = (0, import_react33.useMemo)(() => `${themeClass} ${root11}`, [themeClass]);
|
|
1120
1181
|
return { root: root24, header, body, footer };
|
|
1121
1182
|
}
|
|
1122
1183
|
|
|
1123
1184
|
// src/components/card/index.tsx
|
|
1124
1185
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1125
|
-
|
|
1186
|
+
var CardRoot = (0, import_react34.forwardRef)(function Card({ children, ...rest }, ref) {
|
|
1126
1187
|
const { root: root24 } = useStyles15();
|
|
1127
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: root24, ...rest, children });
|
|
1128
|
-
}
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: root24, ...rest, children });
|
|
1189
|
+
});
|
|
1129
1190
|
function CardHeader({ children, ...rest }) {
|
|
1130
1191
|
const { header: header3 } = useStyles15();
|
|
1131
1192
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: header3, ...rest, children });
|
|
@@ -1142,12 +1203,15 @@ CardRoot.displayName = "Card";
|
|
|
1142
1203
|
CardHeader.displayName = "Card.Header";
|
|
1143
1204
|
CardBody.displayName = "Card.Body";
|
|
1144
1205
|
CardFooter.displayName = "Card.Footer";
|
|
1145
|
-
var
|
|
1206
|
+
var Card2 = Object.assign(CardRoot, {
|
|
1146
1207
|
Header: CardHeader,
|
|
1147
1208
|
Body: CardBody,
|
|
1148
1209
|
Footer: CardFooter
|
|
1149
1210
|
});
|
|
1150
1211
|
|
|
1212
|
+
// src/components/alert/index.tsx
|
|
1213
|
+
var import_react36 = require("react");
|
|
1214
|
+
|
|
1151
1215
|
// src/components/icons/circle-check/index.tsx
|
|
1152
1216
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1153
1217
|
function CircleCheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
@@ -1252,7 +1316,7 @@ function TriangleAlertIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1252
1316
|
}
|
|
1253
1317
|
|
|
1254
1318
|
// src/components/alert/use-styles.ts
|
|
1255
|
-
var
|
|
1319
|
+
var import_react35 = require("react");
|
|
1256
1320
|
|
|
1257
1321
|
// src/components/alert/use-styles.css.ts
|
|
1258
1322
|
var content = "use-styles_content__ivsh6u6";
|
|
@@ -1266,7 +1330,7 @@ function useStyles16({
|
|
|
1266
1330
|
className
|
|
1267
1331
|
}) {
|
|
1268
1332
|
const { themeClass } = useTheme();
|
|
1269
|
-
const root24 = (0,
|
|
1333
|
+
const root24 = (0, import_react35.useMemo)(
|
|
1270
1334
|
() => [themeClass, root12, severity[severity2], className].filter(Boolean).join(" "),
|
|
1271
1335
|
[themeClass, severity2, className]
|
|
1272
1336
|
);
|
|
@@ -1285,30 +1349,23 @@ var defaultIcons = {
|
|
|
1285
1349
|
warn: TriangleAlertIcon,
|
|
1286
1350
|
danger: CircleXIcon
|
|
1287
1351
|
};
|
|
1288
|
-
|
|
1289
|
-
severity: severity2 = "info",
|
|
1290
|
-
title,
|
|
1291
|
-
icon,
|
|
1292
|
-
className,
|
|
1293
|
-
children,
|
|
1294
|
-
...rest
|
|
1295
|
-
}) {
|
|
1352
|
+
var Alert = (0, import_react36.forwardRef)(function Alert2({ severity: severity2 = "info", title, icon, className, children, ...rest }, ref) {
|
|
1296
1353
|
const styles = useStyles16({ severity: severity2, className });
|
|
1297
1354
|
const IconComponent = icon ?? defaultIcons[severity2];
|
|
1298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { role: "alert", className: styles.root, ...rest, children: [
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref, role: "alert", className: styles.root, ...rest, children: [
|
|
1299
1356
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: styles.iconSlot, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconComponent, {}) }),
|
|
1300
1357
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.content, children: [
|
|
1301
1358
|
title != null && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: "h4", children: title }),
|
|
1302
1359
|
children != null && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: "body", color: "fg2", children })
|
|
1303
1360
|
] })
|
|
1304
1361
|
] });
|
|
1305
|
-
}
|
|
1362
|
+
});
|
|
1306
1363
|
|
|
1307
1364
|
// src/components/tooltip/index.tsx
|
|
1308
|
-
var
|
|
1365
|
+
var import_react38 = require("react");
|
|
1309
1366
|
|
|
1310
1367
|
// src/components/tooltip/use-styles.ts
|
|
1311
|
-
var
|
|
1368
|
+
var import_react37 = require("react");
|
|
1312
1369
|
|
|
1313
1370
|
// src/components/tooltip/use-styles.css.ts
|
|
1314
1371
|
var bubble = "use-styles_bubble__h9kvh1 surfaces_inkySurface__1qa7atn2";
|
|
@@ -1320,11 +1377,11 @@ function useStyles17({
|
|
|
1320
1377
|
placement: placement2 = "top"
|
|
1321
1378
|
}) {
|
|
1322
1379
|
const { themeClass } = useTheme();
|
|
1323
|
-
const wrapper4 = (0,
|
|
1380
|
+
const wrapper4 = (0, import_react37.useMemo)(
|
|
1324
1381
|
() => [themeClass, wrapper].filter(Boolean).join(" "),
|
|
1325
1382
|
[themeClass]
|
|
1326
1383
|
);
|
|
1327
|
-
const bubble2 = (0,
|
|
1384
|
+
const bubble2 = (0, import_react37.useMemo)(
|
|
1328
1385
|
() => [bubble, placement[placement2]].filter(Boolean).join(" "),
|
|
1329
1386
|
[placement2]
|
|
1330
1387
|
);
|
|
@@ -1333,23 +1390,74 @@ function useStyles17({
|
|
|
1333
1390
|
|
|
1334
1391
|
// src/components/tooltip/index.tsx
|
|
1335
1392
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
const
|
|
1393
|
+
var HIDE_DELAY = 120;
|
|
1394
|
+
var Tooltip = (0, import_react38.forwardRef)(function Tooltip2({ label: label7, children, placement: placement2 }, ref) {
|
|
1395
|
+
const [open, setOpen] = (0, import_react38.useState)(false);
|
|
1396
|
+
const tooltipId = (0, import_react38.useId)();
|
|
1339
1397
|
const { wrapper: wrapper4, bubble: bubble2 } = useStyles17({ placement: placement2 });
|
|
1340
|
-
const
|
|
1341
|
-
const
|
|
1398
|
+
const hideTimer = (0, import_react38.useRef)(null);
|
|
1399
|
+
const clearHide = () => {
|
|
1400
|
+
if (hideTimer.current) {
|
|
1401
|
+
clearTimeout(hideTimer.current);
|
|
1402
|
+
hideTimer.current = null;
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
const show = () => {
|
|
1406
|
+
clearHide();
|
|
1407
|
+
setOpen(true);
|
|
1408
|
+
};
|
|
1409
|
+
const scheduleHide = () => {
|
|
1410
|
+
clearHide();
|
|
1411
|
+
hideTimer.current = setTimeout(() => setOpen(false), HIDE_DELAY);
|
|
1412
|
+
};
|
|
1413
|
+
const hideNow = () => {
|
|
1414
|
+
clearHide();
|
|
1415
|
+
setOpen(false);
|
|
1416
|
+
};
|
|
1417
|
+
(0, import_react38.useEffect)(() => {
|
|
1418
|
+
return () => {
|
|
1419
|
+
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
1420
|
+
};
|
|
1421
|
+
}, []);
|
|
1422
|
+
const handleKeyDown = (event) => {
|
|
1423
|
+
if (event.key === "Escape" && open) {
|
|
1424
|
+
event.stopPropagation();
|
|
1425
|
+
hideNow();
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1342
1428
|
const previousDescribedBy = children.props["aria-describedby"];
|
|
1343
1429
|
const describedBy = open ? [previousDescribedBy, tooltipId].filter(Boolean).join(" ") : previousDescribedBy;
|
|
1344
|
-
const trigger2 = (0,
|
|
1345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1430
|
+
const trigger2 = (0, import_react38.cloneElement)(children, { "aria-describedby": describedBy });
|
|
1431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1432
|
+
"span",
|
|
1433
|
+
{
|
|
1434
|
+
ref,
|
|
1435
|
+
className: wrapper4,
|
|
1436
|
+
onMouseEnter: show,
|
|
1437
|
+
onMouseLeave: scheduleHide,
|
|
1438
|
+
onFocus: show,
|
|
1439
|
+
onBlur: hideNow,
|
|
1440
|
+
onKeyDown: handleKeyDown,
|
|
1441
|
+
children: [
|
|
1442
|
+
trigger2,
|
|
1443
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1444
|
+
"span",
|
|
1445
|
+
{
|
|
1446
|
+
id: tooltipId,
|
|
1447
|
+
role: "tooltip",
|
|
1448
|
+
className: bubble2,
|
|
1449
|
+
onMouseEnter: show,
|
|
1450
|
+
onMouseLeave: scheduleHide,
|
|
1451
|
+
children: label7
|
|
1452
|
+
}
|
|
1453
|
+
)
|
|
1454
|
+
]
|
|
1455
|
+
}
|
|
1456
|
+
);
|
|
1457
|
+
});
|
|
1350
1458
|
|
|
1351
1459
|
// src/components/select/index.tsx
|
|
1352
|
-
var
|
|
1460
|
+
var import_react40 = require("react");
|
|
1353
1461
|
|
|
1354
1462
|
// src/components/icons/chevron-down/index.tsx
|
|
1355
1463
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -1374,7 +1482,7 @@ function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1374
1482
|
}
|
|
1375
1483
|
|
|
1376
1484
|
// src/components/select/use-styles.ts
|
|
1377
|
-
var
|
|
1485
|
+
var import_react39 = require("react");
|
|
1378
1486
|
|
|
1379
1487
|
// src/components/select/use-styles.css.ts
|
|
1380
1488
|
var chevron = "use-styles_chevron__1w1czpb4";
|
|
@@ -1393,7 +1501,7 @@ function useStyles18({
|
|
|
1393
1501
|
open = false
|
|
1394
1502
|
}) {
|
|
1395
1503
|
const { themeClass } = useTheme();
|
|
1396
|
-
return (0,
|
|
1504
|
+
return (0, import_react39.useMemo)(() => {
|
|
1397
1505
|
const chevron3 = [chevron, open && chevronOpen].filter(Boolean).join(" ");
|
|
1398
1506
|
return {
|
|
1399
1507
|
root: [themeClass, root13].filter(Boolean).join(" "),
|
|
@@ -1409,11 +1517,16 @@ function useStyles18({
|
|
|
1409
1517
|
|
|
1410
1518
|
// src/components/select/index.tsx
|
|
1411
1519
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1412
|
-
|
|
1413
|
-
const [open, setOpen] = (0,
|
|
1414
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1415
|
-
const rootRef = (0,
|
|
1416
|
-
const
|
|
1520
|
+
var Select = (0, import_react40.forwardRef)(function Select2({ options, value, onChange, placeholder: placeholder2, label: label7, disabled: disabled3, ...rest }, ref) {
|
|
1521
|
+
const [open, setOpen] = (0, import_react40.useState)(false);
|
|
1522
|
+
const [activeIndex, setActiveIndex] = (0, import_react40.useState)(0);
|
|
1523
|
+
const rootRef = (0, import_react40.useRef)(null);
|
|
1524
|
+
const setRootRef = (node) => {
|
|
1525
|
+
rootRef.current = node;
|
|
1526
|
+
if (typeof ref === "function") ref(node);
|
|
1527
|
+
else if (ref) ref.current = node;
|
|
1528
|
+
};
|
|
1529
|
+
const baseId = (0, import_react40.useId)();
|
|
1417
1530
|
const labelId = `${baseId}-label`;
|
|
1418
1531
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
1419
1532
|
const {
|
|
@@ -1425,7 +1538,7 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1425
1538
|
menu: menu2,
|
|
1426
1539
|
optionClass
|
|
1427
1540
|
} = useStyles18({ open });
|
|
1428
|
-
(0,
|
|
1541
|
+
(0, import_react40.useEffect)(() => {
|
|
1429
1542
|
if (!open) return;
|
|
1430
1543
|
const onPointerDown = (event) => {
|
|
1431
1544
|
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
@@ -1485,7 +1598,7 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1485
1598
|
break;
|
|
1486
1599
|
}
|
|
1487
1600
|
};
|
|
1488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ref:
|
|
1601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ref: setRootRef, className: root24, ...rest, children: [
|
|
1489
1602
|
label7 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { id: labelId, className: labelClass, children: label7 }),
|
|
1490
1603
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1491
1604
|
"button",
|
|
@@ -1533,10 +1646,13 @@ function Select({ options, value, onChange, placeholder: placeholder2, label: la
|
|
|
1533
1646
|
);
|
|
1534
1647
|
}) })
|
|
1535
1648
|
] });
|
|
1536
|
-
}
|
|
1649
|
+
});
|
|
1650
|
+
|
|
1651
|
+
// src/components/slider/index.tsx
|
|
1652
|
+
var import_react42 = require("react");
|
|
1537
1653
|
|
|
1538
1654
|
// src/components/slider/use-styles.ts
|
|
1539
|
-
var
|
|
1655
|
+
var import_react41 = require("react");
|
|
1540
1656
|
|
|
1541
1657
|
// src/components/slider/use-styles.css.ts
|
|
1542
1658
|
var input5 = "use-styles_input__okw59n3";
|
|
@@ -1550,7 +1666,7 @@ var wrapper2 = "use-styles_wrapper__okw59n6";
|
|
|
1550
1666
|
// src/components/slider/use-styles.ts
|
|
1551
1667
|
function useStyles19() {
|
|
1552
1668
|
const { themeClass } = useTheme();
|
|
1553
|
-
return (0,
|
|
1669
|
+
return (0, import_react41.useMemo)(() => {
|
|
1554
1670
|
const root24 = [themeClass, root14].filter(Boolean).join(" ");
|
|
1555
1671
|
return {
|
|
1556
1672
|
wrapper: wrapper2,
|
|
@@ -1566,15 +1682,7 @@ function useStyles19() {
|
|
|
1566
1682
|
|
|
1567
1683
|
// src/components/slider/index.tsx
|
|
1568
1684
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1569
|
-
|
|
1570
|
-
value = 0,
|
|
1571
|
-
onChange,
|
|
1572
|
-
min = 0,
|
|
1573
|
-
max = 100,
|
|
1574
|
-
step: step2 = 1,
|
|
1575
|
-
disabled: disabled3,
|
|
1576
|
-
label: label7
|
|
1577
|
-
}) {
|
|
1685
|
+
var Slider = (0, import_react42.forwardRef)(function Slider2({ value = 0, onChange, min = 0, max = 100, step: step2 = 1, disabled: disabled3, label: label7, ...rest }, ref) {
|
|
1578
1686
|
const { wrapper: wrapper4, label: labelClass, root: root24, track: track4, range: range2, thumb: thumb2, input: input6 } = useStyles19();
|
|
1579
1687
|
const span = max - min;
|
|
1580
1688
|
const percent = span > 0 ? (value - min) / span * 100 : 0;
|
|
@@ -1590,6 +1698,7 @@ function Slider({
|
|
|
1590
1698
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1591
1699
|
"input",
|
|
1592
1700
|
{
|
|
1701
|
+
ref,
|
|
1593
1702
|
className: input6,
|
|
1594
1703
|
type: "range",
|
|
1595
1704
|
min,
|
|
@@ -1597,19 +1706,20 @@ function Slider({
|
|
|
1597
1706
|
step: step2,
|
|
1598
1707
|
value,
|
|
1599
1708
|
disabled: disabled3,
|
|
1600
|
-
onChange: handleChange
|
|
1709
|
+
onChange: handleChange,
|
|
1710
|
+
...rest
|
|
1601
1711
|
}
|
|
1602
1712
|
),
|
|
1603
1713
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: thumb2, style: { left: `${clamped}%` } })
|
|
1604
1714
|
] })
|
|
1605
1715
|
] });
|
|
1606
|
-
}
|
|
1716
|
+
});
|
|
1607
1717
|
|
|
1608
1718
|
// src/components/accordion/index.tsx
|
|
1609
|
-
var
|
|
1719
|
+
var import_react44 = require("react");
|
|
1610
1720
|
|
|
1611
1721
|
// src/components/accordion/use-styles.ts
|
|
1612
|
-
var
|
|
1722
|
+
var import_react43 = require("react");
|
|
1613
1723
|
|
|
1614
1724
|
// src/components/accordion/use-styles.css.ts
|
|
1615
1725
|
var chevron2 = "use-styles_chevron__1cjrdh93";
|
|
@@ -1622,7 +1732,7 @@ var root15 = "use-styles_root__1cjrdh90";
|
|
|
1622
1732
|
// src/components/accordion/use-styles.ts
|
|
1623
1733
|
function useStyles20({ className }) {
|
|
1624
1734
|
const { themeClass } = useTheme();
|
|
1625
|
-
return (0,
|
|
1735
|
+
return (0, import_react43.useMemo)(
|
|
1626
1736
|
() => ({
|
|
1627
1737
|
root: [themeClass, root15, className].filter(Boolean).join(" "),
|
|
1628
1738
|
item,
|
|
@@ -1636,14 +1746,9 @@ function useStyles20({ className }) {
|
|
|
1636
1746
|
|
|
1637
1747
|
// src/components/accordion/index.tsx
|
|
1638
1748
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
defaultOpen = [],
|
|
1643
|
-
className
|
|
1644
|
-
}) {
|
|
1645
|
-
const [open, setOpen] = (0, import_react28.useState)(defaultOpen);
|
|
1646
|
-
const { root: root24, item: item3, header: header3, chevronFor, panel: panel2 } = useStyles20({ className });
|
|
1749
|
+
var Accordion = (0, import_react44.forwardRef)(function Accordion2({ items, multiple = false, defaultOpen = [], className }, ref) {
|
|
1750
|
+
const [open, setOpen] = (0, import_react44.useState)(defaultOpen);
|
|
1751
|
+
const { root: root24, item: item3, header: header3, chevronFor, panel: panel3 } = useStyles20({ className });
|
|
1647
1752
|
const toggle = (id) => {
|
|
1648
1753
|
setOpen((current2) => {
|
|
1649
1754
|
const isOpen = current2.includes(id);
|
|
@@ -1651,7 +1756,7 @@ function Accordion({
|
|
|
1651
1756
|
return multiple ? [...current2, id] : [id];
|
|
1652
1757
|
});
|
|
1653
1758
|
};
|
|
1654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: root24, children: items.map((it) => {
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: root24, children: items.map((it) => {
|
|
1655
1760
|
const isOpen = open.includes(it.id);
|
|
1656
1761
|
const panelId = `accordion-panel-${it.id}`;
|
|
1657
1762
|
const headerId = `accordion-header-${it.id}`;
|
|
@@ -1671,13 +1776,13 @@ function Accordion({
|
|
|
1671
1776
|
]
|
|
1672
1777
|
}
|
|
1673
1778
|
),
|
|
1674
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: panelId, className:
|
|
1779
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: panelId, className: panel3, role: "region", "aria-labelledby": headerId, children: it.content })
|
|
1675
1780
|
] }, it.id);
|
|
1676
1781
|
}) });
|
|
1677
|
-
}
|
|
1782
|
+
});
|
|
1678
1783
|
|
|
1679
1784
|
// src/components/breadcrumbs/index.tsx
|
|
1680
|
-
var
|
|
1785
|
+
var import_react46 = require("react");
|
|
1681
1786
|
|
|
1682
1787
|
// src/components/icons/chevron-right/index.tsx
|
|
1683
1788
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
@@ -1702,7 +1807,7 @@ function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1702
1807
|
}
|
|
1703
1808
|
|
|
1704
1809
|
// src/components/breadcrumbs/use-styles.ts
|
|
1705
|
-
var
|
|
1810
|
+
var import_react45 = require("react");
|
|
1706
1811
|
|
|
1707
1812
|
// src/components/breadcrumbs/use-styles.css.ts
|
|
1708
1813
|
var crumb = "use-styles_crumb__7u0du61";
|
|
@@ -1713,7 +1818,7 @@ var separator = "use-styles_separator__7u0du63";
|
|
|
1713
1818
|
// src/components/breadcrumbs/use-styles.ts
|
|
1714
1819
|
function useStyles21({ className }) {
|
|
1715
1820
|
const { themeClass } = useTheme();
|
|
1716
|
-
const root24 = (0,
|
|
1821
|
+
const root24 = (0, import_react45.useMemo)(
|
|
1717
1822
|
() => [themeClass, root16, className].filter(Boolean).join(" "),
|
|
1718
1823
|
[themeClass, className]
|
|
1719
1824
|
);
|
|
@@ -1722,17 +1827,20 @@ function useStyles21({ className }) {
|
|
|
1722
1827
|
|
|
1723
1828
|
// src/components/breadcrumbs/index.tsx
|
|
1724
1829
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1725
|
-
|
|
1830
|
+
var Breadcrumbs = (0, import_react46.forwardRef)(function Breadcrumbs2({ items, className, ...rest }, ref) {
|
|
1726
1831
|
const { root: root24, crumb: crumb2, current: current2, separator: separator2 } = useStyles21({ className });
|
|
1727
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { "aria-label": "Breadcrumb", className: root24, ...rest, children: items.map((item3, index) => {
|
|
1832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { ref, "aria-label": "Breadcrumb", className: root24, ...rest, children: items.map((item3, index) => {
|
|
1728
1833
|
const isLast = index === items.length - 1;
|
|
1729
1834
|
const key = index;
|
|
1730
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react46.Fragment, { children: [
|
|
1731
1836
|
isLast ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: current2, "aria-current": "page", children: item3.label }) : item3.href ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { className: crumb2, href: item3.href, children: item3.label }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: crumb2, children: item3.label }),
|
|
1732
1837
|
!isLast && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: separator2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRightIcon, { size: 14 }) })
|
|
1733
1838
|
] }, key);
|
|
1734
1839
|
}) });
|
|
1735
|
-
}
|
|
1840
|
+
});
|
|
1841
|
+
|
|
1842
|
+
// src/components/pagination/index.tsx
|
|
1843
|
+
var import_react48 = require("react");
|
|
1736
1844
|
|
|
1737
1845
|
// src/components/icons/chevron-left/index.tsx
|
|
1738
1846
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
@@ -1757,7 +1865,7 @@ function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
|
1757
1865
|
}
|
|
1758
1866
|
|
|
1759
1867
|
// src/components/pagination/use-styles.ts
|
|
1760
|
-
var
|
|
1868
|
+
var import_react47 = require("react");
|
|
1761
1869
|
|
|
1762
1870
|
// src/components/pagination/use-styles.css.ts
|
|
1763
1871
|
var ellipsis = "use-styles_ellipsis__1azgzoh3";
|
|
@@ -1769,7 +1877,7 @@ var root17 = "use-styles_root__1azgzoh0";
|
|
|
1769
1877
|
// src/components/pagination/use-styles.ts
|
|
1770
1878
|
function useStyles22() {
|
|
1771
1879
|
const { themeClass } = useTheme();
|
|
1772
|
-
return (0,
|
|
1880
|
+
return (0, import_react47.useMemo)(
|
|
1773
1881
|
() => ({
|
|
1774
1882
|
root: [themeClass, root17].filter(Boolean).join(" "),
|
|
1775
1883
|
pageBtnFor: (active2) => [pageBtn, active2 && pageActive].filter(Boolean).join(" "),
|
|
@@ -1795,13 +1903,13 @@ function buildItems(count, page, siblingCount) {
|
|
|
1795
1903
|
if (last > first) items.push(last);
|
|
1796
1904
|
return items;
|
|
1797
1905
|
}
|
|
1798
|
-
|
|
1906
|
+
var Pagination = (0, import_react48.forwardRef)(function Pagination2({ count, page = 1, onChange, siblingCount = 1, ...rest }, ref) {
|
|
1799
1907
|
const { root: root24, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } = useStyles22();
|
|
1800
1908
|
const total = Math.max(1, count);
|
|
1801
1909
|
const current2 = Math.min(Math.max(1, page), total);
|
|
1802
1910
|
const items = buildItems(total, current2, siblingCount);
|
|
1803
1911
|
const go = (n) => onChange?.(Math.min(Math.max(1, n), total));
|
|
1804
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("nav", { className: root24, "aria-label": "Pagination", children: [
|
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("nav", { ref, className: root24, "aria-label": "Pagination", ...rest, children: [
|
|
1805
1913
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1806
1914
|
"button",
|
|
1807
1915
|
{
|
|
@@ -1841,13 +1949,13 @@ function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
|
1841
1949
|
}
|
|
1842
1950
|
)
|
|
1843
1951
|
] });
|
|
1844
|
-
}
|
|
1952
|
+
});
|
|
1845
1953
|
|
|
1846
1954
|
// src/components/stepper/index.tsx
|
|
1847
|
-
var
|
|
1955
|
+
var import_react50 = require("react");
|
|
1848
1956
|
|
|
1849
1957
|
// src/components/stepper/use-styles.ts
|
|
1850
|
-
var
|
|
1958
|
+
var import_react49 = require("react");
|
|
1851
1959
|
|
|
1852
1960
|
// src/components/stepper/use-styles.css.ts
|
|
1853
1961
|
var connector = "use-styles_connector__79pt4e7";
|
|
@@ -1862,7 +1970,7 @@ var step = "use-styles_step__79pt4e1";
|
|
|
1862
1970
|
// src/components/stepper/use-styles.ts
|
|
1863
1971
|
function useStyles23({ className }) {
|
|
1864
1972
|
const { themeClass } = useTheme();
|
|
1865
|
-
return (0,
|
|
1973
|
+
return (0, import_react49.useMemo)(() => {
|
|
1866
1974
|
const root24 = [themeClass, root18, className].filter(Boolean).join(" ");
|
|
1867
1975
|
const markerFor = (state) => [
|
|
1868
1976
|
marker,
|
|
@@ -1876,14 +1984,14 @@ function useStyles23({ className }) {
|
|
|
1876
1984
|
|
|
1877
1985
|
// src/components/stepper/index.tsx
|
|
1878
1986
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1879
|
-
|
|
1987
|
+
var Stepper = (0, import_react50.forwardRef)(function Stepper2({ steps, active: active2 = 0, className, ...rest }, ref) {
|
|
1880
1988
|
const { root: root24, step: step2, connector: connector2, markerFor, labelFor } = useStyles23({ className });
|
|
1881
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: root24, ...rest, children: steps.map((s, index) => {
|
|
1989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref, className: root24, ...rest, children: steps.map((s, index) => {
|
|
1882
1990
|
const state = index < active2 ? "done" : index === active2 ? "active" : "upcoming";
|
|
1883
1991
|
const isActive = state === "active";
|
|
1884
1992
|
return (
|
|
1885
1993
|
// biome-ignore lint/suspicious/noArrayIndexKey: steps are a static, ordered list with no stable id.
|
|
1886
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react50.Fragment, { children: [
|
|
1887
1995
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: step2, "aria-current": isActive ? "step" : void 0, children: [
|
|
1888
1996
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: markerFor(state), children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CheckIcon, { size: 14 }) : index + 1 }),
|
|
1889
1997
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: labelFor(isActive), children: s.label })
|
|
@@ -1892,12 +2000,16 @@ function Stepper({ steps, active: active2 = 0, className, ...rest }) {
|
|
|
1892
2000
|
] }, index)
|
|
1893
2001
|
);
|
|
1894
2002
|
}) });
|
|
1895
|
-
}
|
|
2003
|
+
});
|
|
2004
|
+
|
|
2005
|
+
// src/components/tabs/index.tsx
|
|
2006
|
+
var import_react52 = require("react");
|
|
1896
2007
|
|
|
1897
2008
|
// src/components/tabs/use-styles.ts
|
|
1898
|
-
var
|
|
2009
|
+
var import_react51 = require("react");
|
|
1899
2010
|
|
|
1900
2011
|
// src/components/tabs/use-styles.css.ts
|
|
2012
|
+
var panel2 = "use-styles_panel__1l4m7t43";
|
|
1901
2013
|
var root19 = "use-styles_root__1l4m7t40";
|
|
1902
2014
|
var tab = "use-styles_tab__1l4m7t41";
|
|
1903
2015
|
var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
@@ -1905,39 +2017,95 @@ var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
|
1905
2017
|
// src/components/tabs/use-styles.ts
|
|
1906
2018
|
function useStyles24() {
|
|
1907
2019
|
const { themeClass } = useTheme();
|
|
1908
|
-
return (0,
|
|
2020
|
+
return (0, import_react51.useMemo)(() => {
|
|
1909
2021
|
const root24 = [themeClass, root19].filter(Boolean).join(" ");
|
|
1910
2022
|
const tabClass = (active2) => [tab, active2 && tabActive].filter(Boolean).join(" ");
|
|
1911
|
-
return { root: root24, tab, tabClass };
|
|
2023
|
+
return { root: root24, tab, tabClass, panel: panel2 };
|
|
1912
2024
|
}, [themeClass]);
|
|
1913
2025
|
}
|
|
1914
2026
|
|
|
1915
2027
|
// src/components/tabs/index.tsx
|
|
1916
2028
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1917
|
-
|
|
1918
|
-
const { root: root24, tabClass } = useStyles24();
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
2029
|
+
var Tabs = (0, import_react52.forwardRef)(function Tabs2({ items, value, onChange, ...rest }, ref) {
|
|
2030
|
+
const { root: root24, tabClass, panel: panel3 } = useStyles24();
|
|
2031
|
+
const baseId = (0, import_react52.useId)();
|
|
2032
|
+
const tabRefs = (0, import_react52.useRef)([]);
|
|
2033
|
+
const hasPanels = items.some((item3) => item3.content !== void 0);
|
|
2034
|
+
const activeIndex = items.findIndex((item3) => item3.value === value);
|
|
2035
|
+
const tabId = (v) => `${baseId}-tab-${v}`;
|
|
2036
|
+
const panelId = (v) => `${baseId}-panel-${v}`;
|
|
2037
|
+
const selectTab = (index) => {
|
|
2038
|
+
const item3 = items[index];
|
|
2039
|
+
if (!item3) return;
|
|
2040
|
+
onChange?.(item3.value);
|
|
2041
|
+
tabRefs.current[index]?.focus();
|
|
2042
|
+
};
|
|
2043
|
+
const onKeyDown = (event, index) => {
|
|
2044
|
+
const last = items.length - 1;
|
|
2045
|
+
switch (event.key) {
|
|
2046
|
+
case "ArrowRight":
|
|
2047
|
+
event.preventDefault();
|
|
2048
|
+
selectTab(index === last ? 0 : index + 1);
|
|
2049
|
+
break;
|
|
2050
|
+
case "ArrowLeft":
|
|
2051
|
+
event.preventDefault();
|
|
2052
|
+
selectTab(index === 0 ? last : index - 1);
|
|
2053
|
+
break;
|
|
2054
|
+
case "Home":
|
|
2055
|
+
event.preventDefault();
|
|
2056
|
+
selectTab(0);
|
|
2057
|
+
break;
|
|
2058
|
+
case "End":
|
|
2059
|
+
event.preventDefault();
|
|
2060
|
+
selectTab(last);
|
|
2061
|
+
break;
|
|
2062
|
+
}
|
|
2063
|
+
};
|
|
2064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref, role: "tablist", className: root24, ...rest, children: items.map((item3, index) => {
|
|
2066
|
+
const active2 = item3.value === value;
|
|
2067
|
+
const tabbable = active2 || activeIndex === -1 && index === 0;
|
|
2068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2069
|
+
"button",
|
|
2070
|
+
{
|
|
2071
|
+
ref: (el) => {
|
|
2072
|
+
tabRefs.current[index] = el;
|
|
2073
|
+
},
|
|
2074
|
+
type: "button",
|
|
2075
|
+
role: "tab",
|
|
2076
|
+
id: tabId(item3.value),
|
|
2077
|
+
"aria-selected": active2,
|
|
2078
|
+
"aria-controls": hasPanels ? panelId(item3.value) : void 0,
|
|
2079
|
+
tabIndex: tabbable ? 0 : -1,
|
|
2080
|
+
className: tabClass(active2),
|
|
2081
|
+
onClick: () => onChange?.(item3.value),
|
|
2082
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
2083
|
+
children: item3.label
|
|
2084
|
+
},
|
|
2085
|
+
item3.value
|
|
2086
|
+
);
|
|
2087
|
+
}) }),
|
|
2088
|
+
hasPanels && items.map((item3) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2089
|
+
"div",
|
|
1923
2090
|
{
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
"aria-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2091
|
+
role: "tabpanel",
|
|
2092
|
+
id: panelId(item3.value),
|
|
2093
|
+
"aria-labelledby": tabId(item3.value),
|
|
2094
|
+
hidden: item3.value !== value,
|
|
2095
|
+
tabIndex: 0,
|
|
2096
|
+
className: panel3,
|
|
2097
|
+
children: item3.content
|
|
1930
2098
|
},
|
|
1931
2099
|
item3.value
|
|
1932
|
-
)
|
|
1933
|
-
|
|
1934
|
-
}
|
|
2100
|
+
))
|
|
2101
|
+
] });
|
|
2102
|
+
});
|
|
1935
2103
|
|
|
1936
2104
|
// src/components/menu/index.tsx
|
|
1937
|
-
var
|
|
2105
|
+
var import_react54 = require("react");
|
|
1938
2106
|
|
|
1939
2107
|
// src/components/menu/use-styles.ts
|
|
1940
|
-
var
|
|
2108
|
+
var import_react53 = require("react");
|
|
1941
2109
|
|
|
1942
2110
|
// src/components/menu/use-styles.css.ts
|
|
1943
2111
|
var danger = "use-styles_danger__1uyxaj3";
|
|
@@ -1948,7 +2116,7 @@ var wrapper3 = "use-styles_wrapper__1uyxaj0";
|
|
|
1948
2116
|
// src/components/menu/use-styles.ts
|
|
1949
2117
|
function useStyles25() {
|
|
1950
2118
|
const { themeClass } = useTheme();
|
|
1951
|
-
return (0,
|
|
2119
|
+
return (0, import_react53.useMemo)(
|
|
1952
2120
|
() => ({
|
|
1953
2121
|
wrapper: [themeClass, wrapper3].filter(Boolean).join(" "),
|
|
1954
2122
|
list,
|
|
@@ -1965,13 +2133,17 @@ function assignRef(ref, value) {
|
|
|
1965
2133
|
if (typeof ref === "function") ref(value);
|
|
1966
2134
|
else if (ref) ref.current = value;
|
|
1967
2135
|
}
|
|
1968
|
-
|
|
2136
|
+
var Menu = (0, import_react54.forwardRef)(function Menu2({ trigger: trigger2, items }, ref) {
|
|
1969
2137
|
const { wrapper: wrapper4, list: list2, item: item3, dangerItem } = useStyles25();
|
|
1970
|
-
const [open, setOpen] = (0,
|
|
1971
|
-
const [alignEnd, setAlignEnd] = (0,
|
|
1972
|
-
const rootRef = (0,
|
|
1973
|
-
const
|
|
1974
|
-
|
|
2138
|
+
const [open, setOpen] = (0, import_react54.useState)(false);
|
|
2139
|
+
const [alignEnd, setAlignEnd] = (0, import_react54.useState)(false);
|
|
2140
|
+
const rootRef = (0, import_react54.useRef)(null);
|
|
2141
|
+
const setRootRef = (node) => {
|
|
2142
|
+
rootRef.current = node;
|
|
2143
|
+
assignRef(ref, node);
|
|
2144
|
+
};
|
|
2145
|
+
const listRef = (0, import_react54.useRef)(null);
|
|
2146
|
+
const triggerRef = (0, import_react54.useRef)(null);
|
|
1975
2147
|
const getMenuItems = () => Array.from(listRef.current?.querySelectorAll('[role="menuitem"]') ?? []);
|
|
1976
2148
|
const focusItemAt = (index) => {
|
|
1977
2149
|
const menuItems = getMenuItems();
|
|
@@ -1983,7 +2155,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1983
2155
|
setOpen(false);
|
|
1984
2156
|
triggerRef.current?.focus();
|
|
1985
2157
|
};
|
|
1986
|
-
(0,
|
|
2158
|
+
(0, import_react54.useLayoutEffect)(() => {
|
|
1987
2159
|
if (!open) {
|
|
1988
2160
|
setAlignEnd(false);
|
|
1989
2161
|
return;
|
|
@@ -1995,7 +2167,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
1995
2167
|
const viewport = document.documentElement.clientWidth;
|
|
1996
2168
|
setAlignEnd(rootLeft + listEl.offsetWidth > viewport);
|
|
1997
2169
|
}, [open]);
|
|
1998
|
-
(0,
|
|
2170
|
+
(0, import_react54.useEffect)(() => {
|
|
1999
2171
|
if (!open) return;
|
|
2000
2172
|
listRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
2001
2173
|
const onDocMouseDown = (event) => {
|
|
@@ -2051,7 +2223,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
2051
2223
|
triggerRef.current = node;
|
|
2052
2224
|
assignRef(consumerRef, node);
|
|
2053
2225
|
};
|
|
2054
|
-
const clonedTrigger = (0,
|
|
2226
|
+
const clonedTrigger = (0, import_react54.cloneElement)(trigger2, {
|
|
2055
2227
|
ref: mergedTriggerRef,
|
|
2056
2228
|
"aria-haspopup": "menu",
|
|
2057
2229
|
"aria-expanded": open,
|
|
@@ -2060,7 +2232,7 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
2060
2232
|
setOpen((prev) => !prev);
|
|
2061
2233
|
}
|
|
2062
2234
|
});
|
|
2063
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref:
|
|
2235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref: setRootRef, className: wrapper4, children: [
|
|
2064
2236
|
clonedTrigger,
|
|
2065
2237
|
open && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2066
2238
|
"div",
|
|
@@ -2088,14 +2260,14 @@ function Menu({ trigger: trigger2, items }) {
|
|
|
2088
2260
|
}
|
|
2089
2261
|
)
|
|
2090
2262
|
] });
|
|
2091
|
-
}
|
|
2263
|
+
});
|
|
2092
2264
|
|
|
2093
2265
|
// src/components/dialog/index.tsx
|
|
2094
|
-
var
|
|
2266
|
+
var import_react56 = require("react");
|
|
2095
2267
|
var import_react_dom = require("react-dom");
|
|
2096
2268
|
|
|
2097
2269
|
// src/components/dialog/use-styles.ts
|
|
2098
|
-
var
|
|
2270
|
+
var import_react55 = require("react");
|
|
2099
2271
|
|
|
2100
2272
|
// src/components/dialog/use-styles.css.ts
|
|
2101
2273
|
var actions = "use-styles_actions__5tstu83";
|
|
@@ -2106,7 +2278,7 @@ var surface = "use-styles_surface__5tstu81";
|
|
|
2106
2278
|
// src/components/dialog/use-styles.ts
|
|
2107
2279
|
function useStyles26() {
|
|
2108
2280
|
const { themeClass } = useTheme();
|
|
2109
|
-
return (0,
|
|
2281
|
+
return (0, import_react55.useMemo)(
|
|
2110
2282
|
() => ({
|
|
2111
2283
|
overlay: [themeClass, overlay].filter(Boolean).join(" "),
|
|
2112
2284
|
surface,
|
|
@@ -2120,13 +2292,21 @@ function useStyles26() {
|
|
|
2120
2292
|
// src/components/dialog/index.tsx
|
|
2121
2293
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2122
2294
|
var FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
2123
|
-
function
|
|
2295
|
+
function assignRef2(ref, value) {
|
|
2296
|
+
if (typeof ref === "function") ref(value);
|
|
2297
|
+
else if (ref) ref.current = value;
|
|
2298
|
+
}
|
|
2299
|
+
var Dialog = (0, import_react56.forwardRef)(function Dialog2({ open, onClose, title, actions: actions3, children }, ref) {
|
|
2124
2300
|
const { overlay: overlay2, surface: surface2, body: body3, actions: actionsClass } = useStyles26();
|
|
2125
|
-
const surfaceRef = (0,
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2301
|
+
const surfaceRef = (0, import_react56.useRef)(null);
|
|
2302
|
+
const setSurfaceRef = (node) => {
|
|
2303
|
+
surfaceRef.current = node;
|
|
2304
|
+
assignRef2(ref, node);
|
|
2305
|
+
};
|
|
2306
|
+
const previouslyFocused = (0, import_react56.useRef)(null);
|
|
2307
|
+
const generatedId = (0, import_react56.useId)();
|
|
2128
2308
|
const titleId = title != null ? generatedId : void 0;
|
|
2129
|
-
(0,
|
|
2309
|
+
(0, import_react56.useEffect)(() => {
|
|
2130
2310
|
if (!open) return;
|
|
2131
2311
|
const onKeyDown = (event) => {
|
|
2132
2312
|
if (event.key === "Escape") onClose();
|
|
@@ -2134,13 +2314,13 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
2134
2314
|
document.addEventListener("keydown", onKeyDown);
|
|
2135
2315
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
2136
2316
|
}, [open, onClose]);
|
|
2137
|
-
(0,
|
|
2317
|
+
(0, import_react56.useEffect)(() => {
|
|
2138
2318
|
if (!open) return;
|
|
2139
2319
|
previouslyFocused.current = document.activeElement;
|
|
2140
2320
|
surfaceRef.current?.focus();
|
|
2141
2321
|
return () => previouslyFocused.current?.focus?.();
|
|
2142
2322
|
}, [open]);
|
|
2143
|
-
(0,
|
|
2323
|
+
(0, import_react56.useEffect)(() => {
|
|
2144
2324
|
if (!open) return;
|
|
2145
2325
|
const previousOverflow = document.body.style.overflow;
|
|
2146
2326
|
document.body.style.overflow = "hidden";
|
|
@@ -2181,7 +2361,7 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
2181
2361
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: overlay2, "data-testid": "dialog-overlay", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2182
2362
|
"div",
|
|
2183
2363
|
{
|
|
2184
|
-
ref:
|
|
2364
|
+
ref: setSurfaceRef,
|
|
2185
2365
|
className: surface2,
|
|
2186
2366
|
role: "dialog",
|
|
2187
2367
|
"aria-modal": "true",
|
|
@@ -2198,13 +2378,14 @@ function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
|
2198
2378
|
) }),
|
|
2199
2379
|
document.body
|
|
2200
2380
|
);
|
|
2201
|
-
}
|
|
2381
|
+
});
|
|
2202
2382
|
|
|
2203
2383
|
// src/components/snackbar/index.tsx
|
|
2384
|
+
var import_react58 = require("react");
|
|
2204
2385
|
var import_react_dom2 = require("react-dom");
|
|
2205
2386
|
|
|
2206
2387
|
// src/components/snackbar/use-styles.ts
|
|
2207
|
-
var
|
|
2388
|
+
var import_react57 = require("react");
|
|
2208
2389
|
|
|
2209
2390
|
// src/components/snackbar/use-styles.css.ts
|
|
2210
2391
|
var closeBtn = "use-styles_closeBtn__ihzsep2";
|
|
@@ -2214,7 +2395,7 @@ var root20 = "use-styles_root__ihzsep0 surfaces_inkySurface__1qa7atn2";
|
|
|
2214
2395
|
// src/components/snackbar/use-styles.ts
|
|
2215
2396
|
function useStyles27() {
|
|
2216
2397
|
const { themeClass } = useTheme();
|
|
2217
|
-
return (0,
|
|
2398
|
+
return (0, import_react57.useMemo)(
|
|
2218
2399
|
() => ({
|
|
2219
2400
|
root: [themeClass, root20].filter(Boolean).join(" "),
|
|
2220
2401
|
message,
|
|
@@ -2226,24 +2407,28 @@ function useStyles27() {
|
|
|
2226
2407
|
|
|
2227
2408
|
// src/components/snackbar/index.tsx
|
|
2228
2409
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2229
|
-
|
|
2410
|
+
var Snackbar = (0, import_react58.forwardRef)(function Snackbar2({ open, message: message2, action, onClose }, ref) {
|
|
2230
2411
|
const { root: root24, message: messageClass, closeBtn: closeBtn2 } = useStyles27();
|
|
2231
2412
|
if (!open || typeof document === "undefined") return null;
|
|
2232
2413
|
return (0, import_react_dom2.createPortal)(
|
|
2233
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { role: "status", className: root24, children: [
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, role: "status", className: root24, children: [
|
|
2234
2415
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: messageClass, children: message2 }),
|
|
2235
2416
|
action,
|
|
2236
2417
|
onClose && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", "aria-label": "Close", className: closeBtn2, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(XIcon, { size: 18 }) })
|
|
2237
2418
|
] }),
|
|
2238
2419
|
document.body
|
|
2239
2420
|
);
|
|
2240
|
-
}
|
|
2421
|
+
});
|
|
2422
|
+
|
|
2423
|
+
// src/components/table/index.tsx
|
|
2424
|
+
var import_react60 = require("react");
|
|
2241
2425
|
|
|
2242
2426
|
// src/components/table/use-styles.ts
|
|
2243
|
-
var
|
|
2427
|
+
var import_react59 = require("react");
|
|
2244
2428
|
|
|
2245
2429
|
// src/components/table/use-styles.css.ts
|
|
2246
2430
|
var alignRight = "use-styles_alignRight__1n2cz6i3";
|
|
2431
|
+
var caption = "use-styles_caption__1n2cz6i4";
|
|
2247
2432
|
var root21 = "use-styles_root__1n2cz6i0";
|
|
2248
2433
|
var td = "use-styles_td__1n2cz6i2";
|
|
2249
2434
|
var th = "use-styles_th__1n2cz6i1";
|
|
@@ -2251,33 +2436,40 @@ var th = "use-styles_th__1n2cz6i1";
|
|
|
2251
2436
|
// src/components/table/use-styles.ts
|
|
2252
2437
|
function useStyles28({ className }) {
|
|
2253
2438
|
const { themeClass } = useTheme();
|
|
2254
|
-
const root24 = (0,
|
|
2439
|
+
const root24 = (0, import_react59.useMemo)(
|
|
2255
2440
|
() => [themeClass, root21, className].filter(Boolean).join(" "),
|
|
2256
2441
|
[themeClass, className]
|
|
2257
2442
|
);
|
|
2258
|
-
return {
|
|
2443
|
+
return {
|
|
2444
|
+
root: root24,
|
|
2445
|
+
th,
|
|
2446
|
+
td,
|
|
2447
|
+
alignRight,
|
|
2448
|
+
caption
|
|
2449
|
+
};
|
|
2259
2450
|
}
|
|
2260
2451
|
|
|
2261
2452
|
// src/components/table/index.tsx
|
|
2262
2453
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2263
|
-
function
|
|
2264
|
-
|
|
2265
|
-
rows,
|
|
2266
|
-
getRowKey,
|
|
2267
|
-
className,
|
|
2268
|
-
...rest
|
|
2269
|
-
}) {
|
|
2270
|
-
const { root: root24, th: th2, td: td2, alignRight: alignRight2 } = useStyles28({ className });
|
|
2454
|
+
function TableInner({ columns, rows, getRowKey, className, caption: caption2, ...rest }, ref) {
|
|
2455
|
+
const { root: root24, th: th2, td: td2, alignRight: alignRight2, caption: captionClass } = useStyles28({ className });
|
|
2271
2456
|
const headClass = (column) => column.align === "right" ? `${th2} ${alignRight2}` : th2;
|
|
2272
2457
|
const cellClass = (column) => column.align === "right" ? `${td2} ${alignRight2}` : td2;
|
|
2273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("table", { className: root24, ...rest, children: [
|
|
2274
|
-
|
|
2458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("table", { ref, className: root24, ...rest, children: [
|
|
2459
|
+
caption2 != null && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("caption", { className: captionClass, children: caption2 }),
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { scope: "col", className: headClass(column), children: column.header }, column.key)) }) }),
|
|
2275
2461
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: cellClass(column), children: column.render ? column.render(row) : String(row[column.key]) }, column.key)) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
2276
2462
|
] });
|
|
2277
2463
|
}
|
|
2464
|
+
var TableForwarded = (0, import_react60.forwardRef)(TableInner);
|
|
2465
|
+
TableForwarded.displayName = "Table";
|
|
2466
|
+
var Table = TableForwarded;
|
|
2467
|
+
|
|
2468
|
+
// src/components/app-bar/index.tsx
|
|
2469
|
+
var import_react62 = require("react");
|
|
2278
2470
|
|
|
2279
2471
|
// src/components/app-bar/use-styles.ts
|
|
2280
|
-
var
|
|
2472
|
+
var import_react61 = require("react");
|
|
2281
2473
|
|
|
2282
2474
|
// src/components/app-bar/use-styles.css.ts
|
|
2283
2475
|
var actions2 = "use-styles_actions__1h133nh2";
|
|
@@ -2287,7 +2479,7 @@ var root22 = "use-styles_root__1h133nh0";
|
|
|
2287
2479
|
// src/components/app-bar/use-styles.ts
|
|
2288
2480
|
function useStyles29({ className }) {
|
|
2289
2481
|
const { themeClass } = useTheme();
|
|
2290
|
-
const root24 = (0,
|
|
2482
|
+
const root24 = (0, import_react61.useMemo)(
|
|
2291
2483
|
() => [themeClass, root22, className].filter(Boolean).join(" "),
|
|
2292
2484
|
[themeClass, className]
|
|
2293
2485
|
);
|
|
@@ -2296,17 +2488,20 @@ function useStyles29({ className }) {
|
|
|
2296
2488
|
|
|
2297
2489
|
// src/components/app-bar/index.tsx
|
|
2298
2490
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2299
|
-
|
|
2491
|
+
var AppBar = (0, import_react62.forwardRef)(function AppBar2({ brand: brand2, actions: actions3, className, children, ...rest }, ref) {
|
|
2300
2492
|
const styles = useStyles29({ className });
|
|
2301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: styles.root, ...rest, children: [
|
|
2493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { ref, className: styles.root, ...rest, children: [
|
|
2302
2494
|
brand2 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: styles.brand, children: brand2 }) : null,
|
|
2303
2495
|
children,
|
|
2304
2496
|
actions3 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: styles.actions, children: actions3 }) : null
|
|
2305
2497
|
] });
|
|
2306
|
-
}
|
|
2498
|
+
});
|
|
2499
|
+
|
|
2500
|
+
// src/components/list-item/index.tsx
|
|
2501
|
+
var import_react64 = require("react");
|
|
2307
2502
|
|
|
2308
2503
|
// src/components/list-item/use-styles.ts
|
|
2309
|
-
var
|
|
2504
|
+
var import_react63 = require("react");
|
|
2310
2505
|
|
|
2311
2506
|
// src/components/list-item/use-styles.css.ts
|
|
2312
2507
|
var content2 = "use-styles_content__kbreq13";
|
|
@@ -2321,7 +2516,7 @@ function useStyles30({
|
|
|
2321
2516
|
className
|
|
2322
2517
|
}) {
|
|
2323
2518
|
const { themeClass } = useTheme();
|
|
2324
|
-
const root24 = (0,
|
|
2519
|
+
const root24 = (0, import_react63.useMemo)(
|
|
2325
2520
|
() => [themeClass, root23, selected3 && selected2, className].filter(Boolean).join(" "),
|
|
2326
2521
|
[themeClass, selected3, className]
|
|
2327
2522
|
);
|
|
@@ -2330,21 +2525,14 @@ function useStyles30({
|
|
|
2330
2525
|
|
|
2331
2526
|
// src/components/list-item/index.tsx
|
|
2332
2527
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2333
|
-
|
|
2334
|
-
leading: leading2,
|
|
2335
|
-
trailing: trailing2,
|
|
2336
|
-
selected: selected3,
|
|
2337
|
-
className,
|
|
2338
|
-
children,
|
|
2339
|
-
...rest
|
|
2340
|
-
}) {
|
|
2528
|
+
var ListItem = (0, import_react64.forwardRef)(function ListItem2({ leading: leading2, trailing: trailing2, selected: selected3, className, children, ...rest }, ref) {
|
|
2341
2529
|
const styles = useStyles30({ selected: selected3, className });
|
|
2342
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: styles.root, ...rest, children: [
|
|
2530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { ref, className: styles.root, ...rest, children: [
|
|
2343
2531
|
leading2 != null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: styles.leading, children: leading2 }),
|
|
2344
2532
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: styles.content, children }),
|
|
2345
2533
|
trailing2 != null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: styles.trailing, children: trailing2 })
|
|
2346
2534
|
] });
|
|
2347
|
-
}
|
|
2535
|
+
});
|
|
2348
2536
|
|
|
2349
2537
|
// src/components/icons/chevron-up/index.tsx
|
|
2350
2538
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|