@octavius2929-personal/design-system 0.1.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/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/index.cjs +2199 -0
- package/dist/index.css +1878 -0
- package/dist/index.d.cts +512 -0
- package/dist/index.d.ts +512 -0
- package/dist/index.js +2134 -0
- package/package.json +93 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Accordion: () => Accordion,
|
|
24
|
+
Alert: () => Alert,
|
|
25
|
+
AppBar: () => AppBar,
|
|
26
|
+
Avatar: () => Avatar,
|
|
27
|
+
Badge: () => Badge,
|
|
28
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
29
|
+
Button: () => Button,
|
|
30
|
+
Card: () => Card,
|
|
31
|
+
CheckIcon: () => CheckIcon,
|
|
32
|
+
Checkbox: () => Checkbox,
|
|
33
|
+
ChevronDownIcon: () => ChevronDownIcon,
|
|
34
|
+
ChevronLeftIcon: () => ChevronLeftIcon,
|
|
35
|
+
ChevronRightIcon: () => ChevronRightIcon,
|
|
36
|
+
ChevronUpIcon: () => ChevronUpIcon,
|
|
37
|
+
Chip: () => Chip,
|
|
38
|
+
CircleCheckIcon: () => CircleCheckIcon,
|
|
39
|
+
CircleXIcon: () => CircleXIcon,
|
|
40
|
+
Dialog: () => Dialog,
|
|
41
|
+
Divider: () => Divider,
|
|
42
|
+
EyeIcon: () => EyeIcon,
|
|
43
|
+
EyeOffIcon: () => EyeOffIcon,
|
|
44
|
+
IconButton: () => IconButton,
|
|
45
|
+
InfoIcon: () => InfoIcon,
|
|
46
|
+
ListItem: () => ListItem,
|
|
47
|
+
Menu: () => Menu,
|
|
48
|
+
MinusIcon: () => MinusIcon,
|
|
49
|
+
MoreHorizontalIcon: () => MoreHorizontalIcon,
|
|
50
|
+
Pagination: () => Pagination,
|
|
51
|
+
PlusIcon: () => PlusIcon,
|
|
52
|
+
Progress: () => Progress,
|
|
53
|
+
Radio: () => Radio,
|
|
54
|
+
SearchIcon: () => SearchIcon,
|
|
55
|
+
Select: () => Select,
|
|
56
|
+
Slider: () => Slider,
|
|
57
|
+
Snackbar: () => Snackbar,
|
|
58
|
+
Stepper: () => Stepper,
|
|
59
|
+
Switch: () => Switch,
|
|
60
|
+
Table: () => Table,
|
|
61
|
+
Tabs: () => Tabs,
|
|
62
|
+
TextField: () => TextField,
|
|
63
|
+
ThemeProvider: () => ThemeProvider,
|
|
64
|
+
Tooltip: () => Tooltip,
|
|
65
|
+
TriangleAlertIcon: () => TriangleAlertIcon,
|
|
66
|
+
XIcon: () => XIcon,
|
|
67
|
+
modeNames: () => modeNames,
|
|
68
|
+
schemaNames: () => schemaNames,
|
|
69
|
+
text: () => text,
|
|
70
|
+
theme: () => vars,
|
|
71
|
+
themes: () => themes,
|
|
72
|
+
useTheme: () => useTheme,
|
|
73
|
+
useToggle: () => useToggle
|
|
74
|
+
});
|
|
75
|
+
module.exports = __toCommonJS(index_exports);
|
|
76
|
+
|
|
77
|
+
// src/theme/theme.css.ts
|
|
78
|
+
var modeNames = ["light", "dark", "sepia", "contrast"];
|
|
79
|
+
var schemaNames = ["tinta"];
|
|
80
|
+
var themes = { tinta: { light: "theme_themes_tinta_light__e3grur2v", dark: "theme_themes_tinta_dark__e3grur2w", sepia: "theme_themes_tinta_sepia__e3grur2x", contrast: "theme_themes_tinta_contrast__e3grur2y" } };
|
|
81
|
+
var vars = { font: { display: "var(--font-display__e3grur0)", text: "var(--font-text__e3grur1)", mono: "var(--font-mono__e3grur2)", black: "var(--font-black__e3grur3)" }, text: { eyebrow: { size: "var(--text-eyebrow-size__e3grur4)", lineHeight: "var(--text-eyebrow-lineHeight__e3grur5)", weight: "var(--text-eyebrow-weight__e3grur6)", letterSpacing: "var(--text-eyebrow-letterSpacing__e3grur7)" }, display: { size: "var(--text-display-size__e3grur8)", lineHeight: "var(--text-display-lineHeight__e3grur9)", weight: "var(--text-display-weight__e3grura)", letterSpacing: "var(--text-display-letterSpacing__e3grurb)" }, h1: { size: "var(--text-h1-size__e3grurc)", lineHeight: "var(--text-h1-lineHeight__e3grurd)", weight: "var(--text-h1-weight__e3grure)", letterSpacing: "var(--text-h1-letterSpacing__e3grurf)" }, h2: { size: "var(--text-h2-size__e3grurg)", lineHeight: "var(--text-h2-lineHeight__e3grurh)", weight: "var(--text-h2-weight__e3gruri)", letterSpacing: "var(--text-h2-letterSpacing__e3grurj)" }, h3: { size: "var(--text-h3-size__e3grurk)", lineHeight: "var(--text-h3-lineHeight__e3grurl)", weight: "var(--text-h3-weight__e3grurm)", letterSpacing: "var(--text-h3-letterSpacing__e3grurn)" }, h4: { size: "var(--text-h4-size__e3gruro)", lineHeight: "var(--text-h4-lineHeight__e3grurp)", weight: "var(--text-h4-weight__e3grurq)", letterSpacing: "var(--text-h4-letterSpacing__e3grurr)" }, body: { size: "var(--text-body-size__e3grurs)", lineHeight: "var(--text-body-lineHeight__e3grurt)", weight: "var(--text-body-weight__e3gruru)", letterSpacing: "var(--text-body-letterSpacing__e3grurv)" }, lead: { size: "var(--text-lead-size__e3grurw)", lineHeight: "var(--text-lead-lineHeight__e3grurx)", weight: "var(--text-lead-weight__e3grury)", letterSpacing: "var(--text-lead-letterSpacing__e3grurz)" }, small: { size: "var(--text-small-size__e3grur10)", lineHeight: "var(--text-small-lineHeight__e3grur11)", weight: "var(--text-small-weight__e3grur12)", letterSpacing: "var(--text-small-letterSpacing__e3grur13)" }, caption: { size: "var(--text-caption-size__e3grur14)", lineHeight: "var(--text-caption-lineHeight__e3grur15)", weight: "var(--text-caption-weight__e3grur16)", letterSpacing: "var(--text-caption-letterSpacing__e3grur17)" } }, space: { none: "var(--space-none__e3grur18)", xs: "var(--space-xs__e3grur19)", sm: "var(--space-sm__e3grur1a)", md: "var(--space-md__e3grur1b)", lg: "var(--space-lg__e3grur1c)", xl: "var(--space-xl__e3grur1d)", "2xl": "var(--space-2xl__e3grur1e)", "3xl": "var(--space-3xl__e3grur1f)", "4xl": "var(--space-4xl__e3grur1g)", "5xl": "var(--space-5xl__e3grur1h)" }, radius: { none: "var(--radius-none__e3grur1i)", sm: "var(--radius-sm__e3grur1j)", md: "var(--radius-md__e3grur1k)", lg: "var(--radius-lg__e3grur1l)", base: "var(--radius-base__e3grur1m)", full: "var(--radius-full__e3grur1n)" }, border: { hair: "var(--border-hair__e3grur1o)", rule: "var(--border-rule__e3grur1p)", heavy: "var(--border-heavy__e3grur1q)" }, tracking: { tight: "var(--tracking-tight__e3grur1r)", normal: "var(--tracking-normal__e3grur1s)", wide: "var(--tracking-wide__e3grur1t)", wider: "var(--tracking-wider__e3grur1u)", widest: "var(--tracking-widest__e3grur1v)" }, leading: { tight: "var(--leading-tight__e3grur1w)", snug: "var(--leading-snug__e3grur1x)", normal: "var(--leading-normal__e3grur1y)", relaxed: "var(--leading-relaxed__e3grur1z)" }, weight: { light: "var(--weight-light__e3grur20)", regular: "var(--weight-regular__e3grur21)", medium: "var(--weight-medium__e3grur22)", semibold: "var(--weight-semibold__e3grur23)", bold: "var(--weight-bold__e3grur24)" }, dur: { fast: "var(--dur-fast__e3grur25)", base: "var(--dur-base__e3grur26)", slow: "var(--dur-slow__e3grur27)" }, ease: { ink: "var(--ease-ink__e3grur28)" }, shadow: { sm: "var(--shadow-sm__e3grur29)", md: "var(--shadow-md__e3grur2a)", lg: "var(--shadow-lg__e3grur2b)" }, color: { bg1: "var(--color-bg1__e3grur2c)", bg2: "var(--color-bg2__e3grur2d)", bg3: "var(--color-bg3__e3grur2e)", bgInset: "var(--color-bgInset__e3grur2f)", fg1: "var(--color-fg1__e3grur2g)", fg2: "var(--color-fg2__e3grur2h)", fg3: "var(--color-fg3__e3grur2i)", fgOnAccent: "var(--color-fgOnAccent__e3grur2j)", border1: "var(--color-border1__e3grur2k)", border2: "var(--color-border2__e3grur2l)", borderStrong: "var(--color-borderStrong__e3grur2m)", accent: "var(--color-accent__e3grur2n)", accentHover: "var(--color-accentHover__e3grur2o)", accentSoft: "var(--color-accentSoft__e3grur2p)", ok: "var(--color-ok__e3grur2q)", warn: "var(--color-warn__e3grur2r)", danger: "var(--color-danger__e3grur2s)", info: "var(--color-info__e3grur2t)", scrim: "var(--color-scrim__e3grur2u)" } };
|
|
82
|
+
|
|
83
|
+
// src/hooks/use-toggle/index.ts
|
|
84
|
+
var import_react = require("react");
|
|
85
|
+
function useToggle(initial = false) {
|
|
86
|
+
const [on, setOn] = (0, import_react.useState)(initial);
|
|
87
|
+
const toggle = (0, import_react.useCallback)(() => setOn((value) => !value), []);
|
|
88
|
+
return [on, toggle, setOn];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/components/button/use-styles.ts
|
|
92
|
+
var import_react3 = require("react");
|
|
93
|
+
|
|
94
|
+
// src/theme/context/theme-context.tsx
|
|
95
|
+
var import_react2 = require("react");
|
|
96
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
97
|
+
var noop = () => {
|
|
98
|
+
};
|
|
99
|
+
var DEFAULT_VALUE = {
|
|
100
|
+
schema: "tinta",
|
|
101
|
+
mode: "light",
|
|
102
|
+
themeClass: themes.tinta.light,
|
|
103
|
+
setSchema: noop,
|
|
104
|
+
setMode: noop,
|
|
105
|
+
toggleMode: noop
|
|
106
|
+
};
|
|
107
|
+
var ThemeContext = (0, import_react2.createContext)(null);
|
|
108
|
+
function ThemeProvider({
|
|
109
|
+
children,
|
|
110
|
+
defaultSchema = "tinta",
|
|
111
|
+
defaultMode = "light"
|
|
112
|
+
}) {
|
|
113
|
+
const [schema, setSchema] = (0, import_react2.useState)(defaultSchema);
|
|
114
|
+
const [mode, setMode] = (0, import_react2.useState)(defaultMode);
|
|
115
|
+
const value = (0, import_react2.useMemo)(
|
|
116
|
+
() => ({
|
|
117
|
+
schema,
|
|
118
|
+
mode,
|
|
119
|
+
themeClass: themes[schema][mode],
|
|
120
|
+
setSchema,
|
|
121
|
+
setMode,
|
|
122
|
+
toggleMode: () => setMode((current2) => current2 === "dark" ? "light" : "dark")
|
|
123
|
+
}),
|
|
124
|
+
[schema, mode]
|
|
125
|
+
);
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeContext.Provider, { value, children });
|
|
127
|
+
}
|
|
128
|
+
function useTheme() {
|
|
129
|
+
return (0, import_react2.useContext)(ThemeContext) ?? DEFAULT_VALUE;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/components/button/use-styles.css.ts
|
|
133
|
+
var full = "use-styles_full__1pbtill4";
|
|
134
|
+
var root = "use-styles_root__1pbtill0";
|
|
135
|
+
var size = { sm: "use-styles_size_sm__1pbtill1", md: "use-styles_size_md__1pbtill2", lg: "use-styles_size_lg__1pbtill3" };
|
|
136
|
+
var tone = { filledInk: "use-styles_tone_filledInk__1pbtill5", filledAccent: "use-styles_tone_filledAccent__1pbtill6", outlineInk: "use-styles_tone_outlineInk__1pbtill7", outlineAccent: "use-styles_tone_outlineAccent__1pbtill8", ghostInk: "use-styles_tone_ghostInk__1pbtill9", ghostAccent: "use-styles_tone_ghostAccent__1pbtilla" };
|
|
137
|
+
|
|
138
|
+
// src/components/button/use-styles.ts
|
|
139
|
+
function toneKey(variant2, tone4) {
|
|
140
|
+
return `${variant2}${tone4 === "ink" ? "Ink" : "Accent"}`;
|
|
141
|
+
}
|
|
142
|
+
function useStyles({
|
|
143
|
+
variant: variant2 = "filled",
|
|
144
|
+
tone: tone4 = "ink",
|
|
145
|
+
size: size3 = "md",
|
|
146
|
+
full: full2,
|
|
147
|
+
className
|
|
148
|
+
}) {
|
|
149
|
+
const { themeClass } = useTheme();
|
|
150
|
+
const container = (0, import_react3.useMemo)(
|
|
151
|
+
() => [
|
|
152
|
+
themeClass,
|
|
153
|
+
root,
|
|
154
|
+
size[size3],
|
|
155
|
+
tone[toneKey(variant2, tone4)],
|
|
156
|
+
full2 && full,
|
|
157
|
+
className
|
|
158
|
+
].filter(Boolean).join(" "),
|
|
159
|
+
[themeClass, variant2, tone4, size3, full2, className]
|
|
160
|
+
);
|
|
161
|
+
return { container };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// src/components/button/index.tsx
|
|
165
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
166
|
+
var ICON_SIZE = { sm: 14, md: 16, lg: 18 };
|
|
167
|
+
function Button({
|
|
168
|
+
variant: variant2,
|
|
169
|
+
tone: tone4,
|
|
170
|
+
size: size3 = "md",
|
|
171
|
+
startIcon: StartIcon,
|
|
172
|
+
endIcon: EndIcon,
|
|
173
|
+
full: full2,
|
|
174
|
+
className,
|
|
175
|
+
children,
|
|
176
|
+
...rest
|
|
177
|
+
}) {
|
|
178
|
+
const { container } = useStyles({ variant: variant2, tone: tone4, size: size3, full: full2, className });
|
|
179
|
+
const iconSize = ICON_SIZE[size3];
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { className: container, ...rest, children: [
|
|
181
|
+
StartIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StartIcon, { size: iconSize }),
|
|
182
|
+
children,
|
|
183
|
+
EndIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(EndIcon, { size: iconSize })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/components/divider/use-styles.ts
|
|
188
|
+
var import_react4 = require("react");
|
|
189
|
+
|
|
190
|
+
// src/components/divider/use-styles.css.ts
|
|
191
|
+
var horizontal = "use-styles_horizontal__1n7v7yj1";
|
|
192
|
+
var label = "use-styles_label__1n7v7yj5";
|
|
193
|
+
var labelled = "use-styles_labelled__1n7v7yj3";
|
|
194
|
+
var line = "use-styles_line__1n7v7yj4";
|
|
195
|
+
var root2 = "use-styles_root__1n7v7yj0";
|
|
196
|
+
var vertical = "use-styles_vertical__1n7v7yj2";
|
|
197
|
+
|
|
198
|
+
// src/components/divider/use-styles.ts
|
|
199
|
+
function useStyles2({ vertical: vertical2, hasLabel }) {
|
|
200
|
+
const { themeClass } = useTheme();
|
|
201
|
+
const root24 = (0, import_react4.useMemo)(
|
|
202
|
+
() => [
|
|
203
|
+
themeClass,
|
|
204
|
+
root2,
|
|
205
|
+
hasLabel ? labelled : vertical2 ? vertical : horizontal
|
|
206
|
+
].filter(Boolean).join(" "),
|
|
207
|
+
[themeClass, vertical2, hasLabel]
|
|
208
|
+
);
|
|
209
|
+
return { root: root24, line, label };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/components/divider/index.tsx
|
|
213
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
214
|
+
function Divider({ vertical: vertical2, label: label7, ...rest }) {
|
|
215
|
+
const hasLabel = label7 != null;
|
|
216
|
+
const { root: root24, line: line2, label: labelClass } = useStyles2({ vertical: vertical2, hasLabel });
|
|
217
|
+
if (hasLabel) {
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "separator", className: root24, ...rest, children: [
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: line2 }),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: labelClass, children: label7 }),
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: line2 })
|
|
222
|
+
] });
|
|
223
|
+
}
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "separator", className: root24, ...rest });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/components/avatar/use-styles.ts
|
|
228
|
+
var import_react5 = require("react");
|
|
229
|
+
|
|
230
|
+
// src/components/avatar/use-styles.css.ts
|
|
231
|
+
var root3 = "use-styles_root__1mn1rmu0";
|
|
232
|
+
var size2 = { sm: "use-styles_size_sm__1mn1rmu1", md: "use-styles_size_md__1mn1rmu2", lg: "use-styles_size_lg__1mn1rmu3" };
|
|
233
|
+
var variant = { "default": "use-styles_variant_default__1mn1rmu4", filled: "use-styles_variant_filled__1mn1rmu5" };
|
|
234
|
+
|
|
235
|
+
// src/components/avatar/use-styles.ts
|
|
236
|
+
function useStyles3({
|
|
237
|
+
size: size3 = "md",
|
|
238
|
+
filled,
|
|
239
|
+
className
|
|
240
|
+
}) {
|
|
241
|
+
const { themeClass } = useTheme();
|
|
242
|
+
const root24 = (0, import_react5.useMemo)(
|
|
243
|
+
() => [
|
|
244
|
+
themeClass,
|
|
245
|
+
root3,
|
|
246
|
+
size2[size3],
|
|
247
|
+
filled ? variant.filled : variant.default,
|
|
248
|
+
className
|
|
249
|
+
].filter(Boolean).join(" "),
|
|
250
|
+
[themeClass, size3, filled, className]
|
|
251
|
+
);
|
|
252
|
+
return { root: root24 };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/components/avatar/index.tsx
|
|
256
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
257
|
+
function Avatar({ size: size3, filled, className, children, ...rest }) {
|
|
258
|
+
const { root: root24 } = useStyles3({ size: size3, filled, className });
|
|
259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: root24, ...rest, children });
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/components/badge/use-styles.ts
|
|
263
|
+
var import_react6 = require("react");
|
|
264
|
+
|
|
265
|
+
// src/components/badge/use-styles.css.ts
|
|
266
|
+
var dot = "use-styles_dot__1wpei6p1";
|
|
267
|
+
var root4 = "use-styles_root__1wpei6p0";
|
|
268
|
+
var tone2 = { ink: "use-styles_tone_ink__1wpei6p2", accent: "use-styles_tone_accent__1wpei6p3" };
|
|
269
|
+
|
|
270
|
+
// src/components/badge/use-styles.ts
|
|
271
|
+
function useStyles4({ tone: tone4 = "ink", className }) {
|
|
272
|
+
const { themeClass } = useTheme();
|
|
273
|
+
const root24 = (0, import_react6.useMemo)(
|
|
274
|
+
() => [themeClass, root4, className].filter(Boolean).join(" "),
|
|
275
|
+
[themeClass, className]
|
|
276
|
+
);
|
|
277
|
+
const dot3 = (0, import_react6.useMemo)(() => [dot, tone2[tone4]].join(" "), [tone4]);
|
|
278
|
+
return { root: root24, dot: dot3 };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/components/badge/index.tsx
|
|
282
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
283
|
+
function Badge({ count, tone: tone4, className, children, ...rest }) {
|
|
284
|
+
const { root: root24, dot: dot3 } = useStyles4({ tone: tone4, className });
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: root24, ...rest, children: [
|
|
286
|
+
children,
|
|
287
|
+
count != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: dot3, children: count })
|
|
288
|
+
] });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/components/progress/use-styles.ts
|
|
292
|
+
var import_react7 = require("react");
|
|
293
|
+
|
|
294
|
+
// src/components/progress/use-styles.css.ts
|
|
295
|
+
var bar = "use-styles_bar__kbop7v3";
|
|
296
|
+
var indeterminate = "use-styles_indeterminate__kbop7v4";
|
|
297
|
+
var spinner = "use-styles_spinner__kbop7v5";
|
|
298
|
+
var track = "use-styles_track__kbop7v2";
|
|
299
|
+
|
|
300
|
+
// src/components/progress/use-styles.ts
|
|
301
|
+
function useStyles5({
|
|
302
|
+
variant: variant2 = "linear",
|
|
303
|
+
value,
|
|
304
|
+
className
|
|
305
|
+
}) {
|
|
306
|
+
const { themeClass } = useTheme();
|
|
307
|
+
const indeterminate2 = value === void 0;
|
|
308
|
+
return (0, import_react7.useMemo)(() => {
|
|
309
|
+
const root24 = (...classes) => [themeClass, ...classes, className].filter(Boolean).join(" ");
|
|
310
|
+
if (variant2 === "circular") {
|
|
311
|
+
return { track: "", bar: "", spinner: root24(spinner) };
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
track: root24(track),
|
|
315
|
+
bar: [bar, indeterminate2 && indeterminate].filter(Boolean).join(" "),
|
|
316
|
+
spinner: ""
|
|
317
|
+
};
|
|
318
|
+
}, [themeClass, variant2, indeterminate2, className]);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// src/components/progress/index.tsx
|
|
322
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
323
|
+
function Progress({
|
|
324
|
+
variant: variant2 = "linear",
|
|
325
|
+
value,
|
|
326
|
+
size: size3 = 20,
|
|
327
|
+
className,
|
|
328
|
+
...rest
|
|
329
|
+
}) {
|
|
330
|
+
const { track: track4, bar: bar2, spinner: spinner2 } = useStyles5({ variant: variant2, value, className });
|
|
331
|
+
const indeterminate2 = value === void 0;
|
|
332
|
+
if (variant2 === "circular") {
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
334
|
+
"span",
|
|
335
|
+
{
|
|
336
|
+
className: spinner2,
|
|
337
|
+
role: "progressbar",
|
|
338
|
+
"aria-valuenow": indeterminate2 ? void 0 : value,
|
|
339
|
+
"aria-valuemin": indeterminate2 ? void 0 : 0,
|
|
340
|
+
"aria-valuemax": indeterminate2 ? void 0 : 100,
|
|
341
|
+
style: { width: size3, height: size3 },
|
|
342
|
+
...rest
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
className: track4,
|
|
350
|
+
role: "progressbar",
|
|
351
|
+
"aria-valuenow": indeterminate2 ? void 0 : value,
|
|
352
|
+
"aria-valuemin": indeterminate2 ? void 0 : 0,
|
|
353
|
+
"aria-valuemax": indeterminate2 ? void 0 : 100,
|
|
354
|
+
...rest,
|
|
355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: bar2, style: indeterminate2 ? void 0 : { width: `${value}%` } })
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/components/icons/x/index.tsx
|
|
361
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
362
|
+
function XIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
364
|
+
"svg",
|
|
365
|
+
{
|
|
366
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
367
|
+
width: size3,
|
|
368
|
+
height: size3,
|
|
369
|
+
viewBox: "0 0 24 24",
|
|
370
|
+
fill: "none",
|
|
371
|
+
stroke: "currentColor",
|
|
372
|
+
strokeWidth,
|
|
373
|
+
strokeLinecap: "round",
|
|
374
|
+
strokeLinejoin: "round",
|
|
375
|
+
"aria-hidden": "true",
|
|
376
|
+
...rest,
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M18 6 6 18" }),
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "m6 6 12 12" })
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// src/components/chip/use-styles.ts
|
|
386
|
+
var import_react8 = require("react");
|
|
387
|
+
|
|
388
|
+
// src/components/chip/use-styles.css.ts
|
|
389
|
+
var clickable = "use-styles_clickable__1axilf44";
|
|
390
|
+
var deleteBtn = "use-styles_deleteBtn__1axilf45";
|
|
391
|
+
var root5 = "use-styles_root__1axilf40";
|
|
392
|
+
var selected = "use-styles_selected__1axilf43";
|
|
393
|
+
var tone3 = { ink: "use-styles_tone_ink__1axilf41", accent: "use-styles_tone_accent__1axilf42" };
|
|
394
|
+
|
|
395
|
+
// src/components/chip/use-styles.ts
|
|
396
|
+
function useStyles6({
|
|
397
|
+
selected: selected3,
|
|
398
|
+
tone: tone4 = "ink",
|
|
399
|
+
clickable: clickable2
|
|
400
|
+
}) {
|
|
401
|
+
const { themeClass } = useTheme();
|
|
402
|
+
const root24 = (0, import_react8.useMemo)(
|
|
403
|
+
() => [
|
|
404
|
+
themeClass,
|
|
405
|
+
root5,
|
|
406
|
+
selected3 ? selected : tone3[tone4],
|
|
407
|
+
clickable2 && clickable
|
|
408
|
+
].filter(Boolean).join(" "),
|
|
409
|
+
[themeClass, selected3, tone4, clickable2]
|
|
410
|
+
);
|
|
411
|
+
return { root: root24, deleteBtn };
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// src/components/chip/index.tsx
|
|
415
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
416
|
+
function Chip({ selected: selected3, tone: tone4, onDelete, onClick, children, ...rest }) {
|
|
417
|
+
const clickable2 = Boolean(onClick);
|
|
418
|
+
const { root: root24, deleteBtn: deleteBtn2 } = useStyles6({ selected: selected3, tone: tone4, clickable: clickable2 });
|
|
419
|
+
const handleDelete = (event) => {
|
|
420
|
+
event.stopPropagation();
|
|
421
|
+
onDelete?.();
|
|
422
|
+
};
|
|
423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: root24, onClick, ...rest, children: [
|
|
424
|
+
children,
|
|
425
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: deleteBtn2, "aria-label": "Remove", onClick: handleDelete, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(XIcon, { size: 13 }) })
|
|
426
|
+
] });
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// src/components/icons/check/index.tsx
|
|
430
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
431
|
+
function CheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
433
|
+
"svg",
|
|
434
|
+
{
|
|
435
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
436
|
+
width: size3,
|
|
437
|
+
height: size3,
|
|
438
|
+
viewBox: "0 0 24 24",
|
|
439
|
+
fill: "none",
|
|
440
|
+
stroke: "currentColor",
|
|
441
|
+
strokeWidth,
|
|
442
|
+
strokeLinecap: "round",
|
|
443
|
+
strokeLinejoin: "round",
|
|
444
|
+
"aria-hidden": "true",
|
|
445
|
+
...rest,
|
|
446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// src/components/checkbox/use-styles.ts
|
|
452
|
+
var import_react9 = require("react");
|
|
453
|
+
|
|
454
|
+
// src/components/checkbox/use-styles.css.ts
|
|
455
|
+
var box = "use-styles_box__9zoga92";
|
|
456
|
+
var boxChecked = "use-styles_boxChecked__9zoga93";
|
|
457
|
+
var check = "use-styles_check__9zoga94";
|
|
458
|
+
var disabled = "use-styles_disabled__9zoga95";
|
|
459
|
+
var input = "use-styles_input__9zoga91";
|
|
460
|
+
var root6 = "use-styles_root__9zoga90";
|
|
461
|
+
|
|
462
|
+
// src/components/checkbox/use-styles.ts
|
|
463
|
+
function useStyles7({ checked, disabled: disabled3 }) {
|
|
464
|
+
const { themeClass } = useTheme();
|
|
465
|
+
const root24 = (0, import_react9.useMemo)(
|
|
466
|
+
() => [themeClass, root6, disabled3 && disabled].filter(Boolean).join(" "),
|
|
467
|
+
[themeClass, disabled3]
|
|
468
|
+
);
|
|
469
|
+
const box2 = (0, import_react9.useMemo)(
|
|
470
|
+
() => [box, checked && boxChecked].filter(Boolean).join(" "),
|
|
471
|
+
[checked]
|
|
472
|
+
);
|
|
473
|
+
return { root: root24, input, box: box2, check };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// src/components/checkbox/index.tsx
|
|
477
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
478
|
+
function Checkbox({
|
|
479
|
+
checked = false,
|
|
480
|
+
onChange,
|
|
481
|
+
label: label7,
|
|
482
|
+
disabled: disabled3 = false,
|
|
483
|
+
id
|
|
484
|
+
}) {
|
|
485
|
+
const { root: root24, input: input6, box: box2, check: check2 } = useStyles7({ checked, disabled: disabled3 });
|
|
486
|
+
const handleChange = (e) => {
|
|
487
|
+
if (disabled3) return;
|
|
488
|
+
onChange?.(e.target.checked);
|
|
489
|
+
};
|
|
490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: root24, children: [
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
492
|
+
"input",
|
|
493
|
+
{
|
|
494
|
+
type: "checkbox",
|
|
495
|
+
className: input6,
|
|
496
|
+
id,
|
|
497
|
+
checked,
|
|
498
|
+
disabled: disabled3,
|
|
499
|
+
onChange: handleChange
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: box2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIcon, { size: 12, className: check2 }) }),
|
|
503
|
+
label7
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/components/radio/use-styles.ts
|
|
508
|
+
var import_react10 = require("react");
|
|
509
|
+
|
|
510
|
+
// src/components/radio/use-styles.css.ts
|
|
511
|
+
var circle = "use-styles_circle__vy61b43";
|
|
512
|
+
var disabled2 = "use-styles_disabled__vy61b41";
|
|
513
|
+
var dot2 = "use-styles_dot__vy61b44";
|
|
514
|
+
var input2 = "use-styles_input__vy61b42";
|
|
515
|
+
var label2 = "use-styles_label__vy61b45";
|
|
516
|
+
var root7 = "use-styles_root__vy61b40";
|
|
517
|
+
|
|
518
|
+
// src/components/radio/use-styles.ts
|
|
519
|
+
function useStyles8({
|
|
520
|
+
disabled: disabled3,
|
|
521
|
+
className
|
|
522
|
+
}) {
|
|
523
|
+
const { themeClass } = useTheme();
|
|
524
|
+
const root24 = (0, import_react10.useMemo)(
|
|
525
|
+
() => [themeClass, root7, disabled3 && disabled2, className].filter(Boolean).join(" "),
|
|
526
|
+
[themeClass, disabled3, className]
|
|
527
|
+
);
|
|
528
|
+
return {
|
|
529
|
+
root: root24,
|
|
530
|
+
input: input2,
|
|
531
|
+
circle,
|
|
532
|
+
dot: dot2,
|
|
533
|
+
label: label2
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// src/components/radio/index.tsx
|
|
538
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
539
|
+
function Radio({ checked, onChange, label: label7, name, value, disabled: disabled3 }) {
|
|
540
|
+
const { root: root24, input: input6, circle: circle2, dot: dot3, label: labelClass } = useStyles8({ disabled: disabled3 });
|
|
541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: root24, children: [
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
543
|
+
"input",
|
|
544
|
+
{
|
|
545
|
+
className: input6,
|
|
546
|
+
type: "radio",
|
|
547
|
+
name,
|
|
548
|
+
value,
|
|
549
|
+
checked,
|
|
550
|
+
disabled: disabled3,
|
|
551
|
+
onChange
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: circle2, children: checked && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: dot3 }) }),
|
|
555
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: labelClass, children: label7 })
|
|
556
|
+
] });
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// src/components/switch/use-styles.ts
|
|
560
|
+
var import_react11 = require("react");
|
|
561
|
+
|
|
562
|
+
// src/components/switch/use-styles.css.ts
|
|
563
|
+
var input3 = "use-styles_input__1r6kem71";
|
|
564
|
+
var knob = "use-styles_knob__1r6kem74";
|
|
565
|
+
var knobChecked = "use-styles_knobChecked__1r6kem75";
|
|
566
|
+
var label3 = "use-styles_label__1r6kem76";
|
|
567
|
+
var root8 = "use-styles_root__1r6kem70";
|
|
568
|
+
var track2 = "use-styles_track__1r6kem72";
|
|
569
|
+
var trackChecked = "use-styles_trackChecked__1r6kem73";
|
|
570
|
+
|
|
571
|
+
// src/components/switch/use-styles.ts
|
|
572
|
+
function useStyles9({ checked }) {
|
|
573
|
+
const { themeClass } = useTheme();
|
|
574
|
+
return (0, import_react11.useMemo)(
|
|
575
|
+
() => ({
|
|
576
|
+
root: [themeClass, root8].filter(Boolean).join(" "),
|
|
577
|
+
input: input3,
|
|
578
|
+
track: [track2, checked && trackChecked].filter(Boolean).join(" "),
|
|
579
|
+
knob: [knob, checked && knobChecked].filter(Boolean).join(" "),
|
|
580
|
+
label: label3
|
|
581
|
+
}),
|
|
582
|
+
[themeClass, checked]
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/components/switch/index.tsx
|
|
587
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
588
|
+
function Switch({ checked = false, onChange, label: label7, disabled: disabled3 }) {
|
|
589
|
+
const { root: root24, input: input6, track: track4, knob: knob2, label: labelClass } = useStyles9({ checked });
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: root24, children: [
|
|
591
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
592
|
+
"input",
|
|
593
|
+
{
|
|
594
|
+
type: "checkbox",
|
|
595
|
+
role: "switch",
|
|
596
|
+
"aria-checked": checked,
|
|
597
|
+
className: input6,
|
|
598
|
+
checked,
|
|
599
|
+
disabled: disabled3,
|
|
600
|
+
onChange: (event) => {
|
|
601
|
+
if (disabled3) return;
|
|
602
|
+
onChange?.(event.target.checked);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
),
|
|
606
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: track4, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: knob2 }) }),
|
|
607
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: labelClass, children: label7 })
|
|
608
|
+
] });
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// src/components/text-field/index.tsx
|
|
612
|
+
var import_react13 = require("react");
|
|
613
|
+
|
|
614
|
+
// src/components/icons/eye/index.tsx
|
|
615
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
616
|
+
function EyeIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
618
|
+
"svg",
|
|
619
|
+
{
|
|
620
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
621
|
+
width: size3,
|
|
622
|
+
height: size3,
|
|
623
|
+
viewBox: "0 0 24 24",
|
|
624
|
+
fill: "none",
|
|
625
|
+
stroke: "currentColor",
|
|
626
|
+
strokeWidth,
|
|
627
|
+
strokeLinecap: "round",
|
|
628
|
+
strokeLinejoin: "round",
|
|
629
|
+
"aria-hidden": "true",
|
|
630
|
+
...rest,
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// src/components/icons/eye-off/index.tsx
|
|
640
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
641
|
+
function EyeOffIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
643
|
+
"svg",
|
|
644
|
+
{
|
|
645
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
646
|
+
width: size3,
|
|
647
|
+
height: size3,
|
|
648
|
+
viewBox: "0 0 24 24",
|
|
649
|
+
fill: "none",
|
|
650
|
+
stroke: "currentColor",
|
|
651
|
+
strokeWidth,
|
|
652
|
+
strokeLinecap: "round",
|
|
653
|
+
strokeLinejoin: "round",
|
|
654
|
+
"aria-hidden": "true",
|
|
655
|
+
...rest,
|
|
656
|
+
children: [
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
658
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
659
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m2 2 20 20" })
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// src/components/text-field/use-styles.ts
|
|
667
|
+
var import_react12 = require("react");
|
|
668
|
+
|
|
669
|
+
// src/components/text-field/use-styles.css.ts
|
|
670
|
+
var field = "use-styles_field__vat8gv3";
|
|
671
|
+
var helpText = "use-styles_helpText__vat8gv8";
|
|
672
|
+
var helpTextError = "use-styles_helpTextError__vat8gv9";
|
|
673
|
+
var input4 = "use-styles_input__vat8gv4";
|
|
674
|
+
var inputError = "use-styles_inputError__vat8gv5";
|
|
675
|
+
var inputRevealPad = "use-styles_inputRevealPad__vat8gv7";
|
|
676
|
+
var inputStartPad = "use-styles_inputStartPad__vat8gv6";
|
|
677
|
+
var labelText = "use-styles_labelText__vat8gv1";
|
|
678
|
+
var labelTextError = "use-styles_labelTextError__vat8gv2";
|
|
679
|
+
var revealButton = "use-styles_revealButton__vat8gvb";
|
|
680
|
+
var root9 = "use-styles_root__vat8gv0";
|
|
681
|
+
var startIcon = "use-styles_startIcon__vat8gva";
|
|
682
|
+
|
|
683
|
+
// src/components/text-field/use-styles.ts
|
|
684
|
+
function useStyles10({ error, hasStartIcon, hasReveal, className }) {
|
|
685
|
+
const { themeClass } = useTheme();
|
|
686
|
+
return (0, import_react12.useMemo)(() => {
|
|
687
|
+
const root24 = [themeClass, root9].filter(Boolean).join(" ");
|
|
688
|
+
const labelText2 = [labelText, error && labelTextError].filter(Boolean).join(" ");
|
|
689
|
+
const input6 = [
|
|
690
|
+
input4,
|
|
691
|
+
error && inputError,
|
|
692
|
+
hasStartIcon && inputStartPad,
|
|
693
|
+
hasReveal && inputRevealPad,
|
|
694
|
+
className
|
|
695
|
+
].filter(Boolean).join(" ");
|
|
696
|
+
const helpText2 = [helpText, error && helpTextError].filter(Boolean).join(" ");
|
|
697
|
+
return {
|
|
698
|
+
root: root24,
|
|
699
|
+
labelText: labelText2,
|
|
700
|
+
field,
|
|
701
|
+
input: input6,
|
|
702
|
+
helpText: helpText2,
|
|
703
|
+
startIcon,
|
|
704
|
+
revealButton
|
|
705
|
+
};
|
|
706
|
+
}, [themeClass, error, hasStartIcon, hasReveal, className]);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// src/components/text-field/index.tsx
|
|
710
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
711
|
+
function TextField({
|
|
712
|
+
label: label7,
|
|
713
|
+
help,
|
|
714
|
+
error,
|
|
715
|
+
startIcon: StartIcon,
|
|
716
|
+
multiline,
|
|
717
|
+
rows,
|
|
718
|
+
type = "text",
|
|
719
|
+
onChange,
|
|
720
|
+
className,
|
|
721
|
+
id,
|
|
722
|
+
...rest
|
|
723
|
+
}) {
|
|
724
|
+
const [reveal, setReveal] = (0, import_react13.useState)(false);
|
|
725
|
+
const isPassword = type === "password";
|
|
726
|
+
const hasReveal = isPassword;
|
|
727
|
+
const effectiveType = isPassword ? reveal ? "text" : "password" : type;
|
|
728
|
+
const autoId = (0, import_react13.useId)();
|
|
729
|
+
const controlId = id ?? autoId;
|
|
730
|
+
const classes = useStyles10({
|
|
731
|
+
error,
|
|
732
|
+
hasStartIcon: Boolean(StartIcon),
|
|
733
|
+
hasReveal,
|
|
734
|
+
className
|
|
735
|
+
});
|
|
736
|
+
const handleInputChange = (e) => {
|
|
737
|
+
onChange?.(e.target.value);
|
|
738
|
+
};
|
|
739
|
+
const handleTextareaChange = (e) => {
|
|
740
|
+
onChange?.(e.target.value);
|
|
741
|
+
};
|
|
742
|
+
const handleToggleMouseDown = (e) => {
|
|
743
|
+
e.preventDefault();
|
|
744
|
+
};
|
|
745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: classes.root, children: [
|
|
746
|
+
label7 != null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: controlId, className: classes.labelText, children: label7 }),
|
|
747
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: classes.field, children: [
|
|
748
|
+
StartIcon != null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: classes.startIcon, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StartIcon, { size: 18 }) }),
|
|
749
|
+
multiline ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
750
|
+
"textarea",
|
|
751
|
+
{
|
|
752
|
+
id: controlId,
|
|
753
|
+
className: classes.input,
|
|
754
|
+
rows: rows ?? 4,
|
|
755
|
+
onChange: handleTextareaChange,
|
|
756
|
+
...rest
|
|
757
|
+
}
|
|
758
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
759
|
+
"input",
|
|
760
|
+
{
|
|
761
|
+
id: controlId,
|
|
762
|
+
className: classes.input,
|
|
763
|
+
type: effectiveType,
|
|
764
|
+
onChange: handleInputChange,
|
|
765
|
+
...rest
|
|
766
|
+
}
|
|
767
|
+
),
|
|
768
|
+
hasReveal && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
769
|
+
"button",
|
|
770
|
+
{
|
|
771
|
+
type: "button",
|
|
772
|
+
tabIndex: -1,
|
|
773
|
+
className: classes.revealButton,
|
|
774
|
+
"aria-label": reveal ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
775
|
+
onMouseDown: handleToggleMouseDown,
|
|
776
|
+
onClick: () => setReveal((r) => !r),
|
|
777
|
+
children: reveal ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeOffIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeIcon, { size: 18 })
|
|
778
|
+
}
|
|
779
|
+
)
|
|
780
|
+
] }),
|
|
781
|
+
help != null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: classes.helpText, children: help })
|
|
782
|
+
] });
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/components/icon-button/use-styles.ts
|
|
786
|
+
var import_react14 = require("react");
|
|
787
|
+
|
|
788
|
+
// src/components/icon-button/use-styles.css.ts
|
|
789
|
+
var accent = "use-styles_accent__18np0q02";
|
|
790
|
+
var active = "use-styles_active__18np0q01";
|
|
791
|
+
var root10 = "use-styles_root__18np0q00";
|
|
792
|
+
|
|
793
|
+
// src/components/icon-button/use-styles.ts
|
|
794
|
+
function useStyles11({
|
|
795
|
+
active: active2 = false,
|
|
796
|
+
tone: tone4 = "ink"
|
|
797
|
+
}) {
|
|
798
|
+
const { themeClass } = useTheme();
|
|
799
|
+
const root24 = (0, import_react14.useMemo)(
|
|
800
|
+
() => [themeClass, root10, tone4 === "accent" && accent, active2 && active].filter(Boolean).join(" "),
|
|
801
|
+
[themeClass, active2, tone4]
|
|
802
|
+
);
|
|
803
|
+
return { root: root24 };
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// src/components/icon-button/index.tsx
|
|
807
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
808
|
+
function IconButton({ icon: Icon, active: active2, tone: tone4, title, ...rest }) {
|
|
809
|
+
const { root: root24 } = useStyles11({ active: active2, tone: tone4 });
|
|
810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: root24, "aria-label": title, title, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { size: 18 }) });
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
// src/components/card/use-styles.ts
|
|
814
|
+
var import_react15 = require("react");
|
|
815
|
+
|
|
816
|
+
// src/components/card/use-styles.css.ts
|
|
817
|
+
var body = "use-styles_body__1fuvd022";
|
|
818
|
+
var footer = "use-styles_footer__1fuvd023";
|
|
819
|
+
var header = "use-styles_header__1fuvd021";
|
|
820
|
+
var root11 = "use-styles_root__1fuvd020";
|
|
821
|
+
|
|
822
|
+
// src/components/card/use-styles.ts
|
|
823
|
+
function useStyles12() {
|
|
824
|
+
const { themeClass } = useTheme();
|
|
825
|
+
const root24 = (0, import_react15.useMemo)(() => `${themeClass} ${root11}`, [themeClass]);
|
|
826
|
+
return { root: root24, header, body, footer };
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// src/components/card/index.tsx
|
|
830
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
831
|
+
function CardRoot({ children, ...rest }) {
|
|
832
|
+
const { root: root24 } = useStyles12();
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: root24, ...rest, children });
|
|
834
|
+
}
|
|
835
|
+
function CardHeader({ children, ...rest }) {
|
|
836
|
+
const { header: header3 } = useStyles12();
|
|
837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: header3, ...rest, children });
|
|
838
|
+
}
|
|
839
|
+
function CardBody({ children, ...rest }) {
|
|
840
|
+
const { body: body4 } = useStyles12();
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: body4, ...rest, children });
|
|
842
|
+
}
|
|
843
|
+
function CardFooter({ children, ...rest }) {
|
|
844
|
+
const { footer: footer2 } = useStyles12();
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: footer2, ...rest, children });
|
|
846
|
+
}
|
|
847
|
+
CardRoot.displayName = "Card";
|
|
848
|
+
CardHeader.displayName = "Card.Header";
|
|
849
|
+
CardBody.displayName = "Card.Body";
|
|
850
|
+
CardFooter.displayName = "Card.Footer";
|
|
851
|
+
var Card = Object.assign(CardRoot, {
|
|
852
|
+
Header: CardHeader,
|
|
853
|
+
Body: CardBody,
|
|
854
|
+
Footer: CardFooter
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
// src/components/icons/circle-check/index.tsx
|
|
858
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
859
|
+
function CircleCheckIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
861
|
+
"svg",
|
|
862
|
+
{
|
|
863
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
864
|
+
width: size3,
|
|
865
|
+
height: size3,
|
|
866
|
+
viewBox: "0 0 24 24",
|
|
867
|
+
fill: "none",
|
|
868
|
+
stroke: "currentColor",
|
|
869
|
+
strokeWidth,
|
|
870
|
+
strokeLinecap: "round",
|
|
871
|
+
strokeLinejoin: "round",
|
|
872
|
+
"aria-hidden": "true",
|
|
873
|
+
...rest,
|
|
874
|
+
children: [
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "m9 12 2 2 4-4" })
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// src/components/icons/circle-x/index.tsx
|
|
883
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
884
|
+
function CircleXIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
886
|
+
"svg",
|
|
887
|
+
{
|
|
888
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
889
|
+
width: size3,
|
|
890
|
+
height: size3,
|
|
891
|
+
viewBox: "0 0 24 24",
|
|
892
|
+
fill: "none",
|
|
893
|
+
stroke: "currentColor",
|
|
894
|
+
strokeWidth,
|
|
895
|
+
strokeLinecap: "round",
|
|
896
|
+
strokeLinejoin: "round",
|
|
897
|
+
"aria-hidden": "true",
|
|
898
|
+
...rest,
|
|
899
|
+
children: [
|
|
900
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "m15 9-6 6" }),
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "m9 9 6 6" })
|
|
903
|
+
]
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/components/icons/info/index.tsx
|
|
909
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
910
|
+
function InfoIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
912
|
+
"svg",
|
|
913
|
+
{
|
|
914
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
915
|
+
width: size3,
|
|
916
|
+
height: size3,
|
|
917
|
+
viewBox: "0 0 24 24",
|
|
918
|
+
fill: "none",
|
|
919
|
+
stroke: "currentColor",
|
|
920
|
+
strokeWidth,
|
|
921
|
+
strokeLinecap: "round",
|
|
922
|
+
strokeLinejoin: "round",
|
|
923
|
+
"aria-hidden": "true",
|
|
924
|
+
...rest,
|
|
925
|
+
children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { d: "M12 16v-4" }),
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { d: "M12 8h.01" })
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/components/icons/triangle-alert/index.tsx
|
|
935
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
936
|
+
function TriangleAlertIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
938
|
+
"svg",
|
|
939
|
+
{
|
|
940
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
941
|
+
width: size3,
|
|
942
|
+
height: size3,
|
|
943
|
+
viewBox: "0 0 24 24",
|
|
944
|
+
fill: "none",
|
|
945
|
+
stroke: "currentColor",
|
|
946
|
+
strokeWidth,
|
|
947
|
+
strokeLinecap: "round",
|
|
948
|
+
strokeLinejoin: "round",
|
|
949
|
+
"aria-hidden": "true",
|
|
950
|
+
...rest,
|
|
951
|
+
children: [
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M12 9v4" }),
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M12 17h.01" })
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// src/components/alert/use-styles.ts
|
|
961
|
+
var import_react16 = require("react");
|
|
962
|
+
|
|
963
|
+
// src/components/alert/use-styles.css.ts
|
|
964
|
+
var body2 = "use-styles_body__ivsh6u8";
|
|
965
|
+
var content = "use-styles_content__ivsh6u6";
|
|
966
|
+
var iconSlot = "use-styles_iconSlot__ivsh6u5";
|
|
967
|
+
var root12 = "use-styles_root__ivsh6u0";
|
|
968
|
+
var severity = { info: "use-styles_severity_info__ivsh6u1", ok: "use-styles_severity_ok__ivsh6u2", warn: "use-styles_severity_warn__ivsh6u3", danger: "use-styles_severity_danger__ivsh6u4" };
|
|
969
|
+
var titleText = "use-styles_titleText__ivsh6u7";
|
|
970
|
+
|
|
971
|
+
// src/components/alert/use-styles.ts
|
|
972
|
+
function useStyles13({
|
|
973
|
+
severity: severity2 = "info",
|
|
974
|
+
className
|
|
975
|
+
}) {
|
|
976
|
+
const { themeClass } = useTheme();
|
|
977
|
+
const root24 = (0, import_react16.useMemo)(
|
|
978
|
+
() => [themeClass, root12, severity[severity2], className].filter(Boolean).join(" "),
|
|
979
|
+
[themeClass, severity2, className]
|
|
980
|
+
);
|
|
981
|
+
return {
|
|
982
|
+
root: root24,
|
|
983
|
+
iconSlot,
|
|
984
|
+
content,
|
|
985
|
+
titleText,
|
|
986
|
+
body: body2
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// src/components/alert/index.tsx
|
|
991
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
992
|
+
var defaultIcons = {
|
|
993
|
+
info: InfoIcon,
|
|
994
|
+
ok: CircleCheckIcon,
|
|
995
|
+
warn: TriangleAlertIcon,
|
|
996
|
+
danger: CircleXIcon
|
|
997
|
+
};
|
|
998
|
+
function Alert({
|
|
999
|
+
severity: severity2 = "info",
|
|
1000
|
+
title,
|
|
1001
|
+
icon,
|
|
1002
|
+
className,
|
|
1003
|
+
children,
|
|
1004
|
+
...rest
|
|
1005
|
+
}) {
|
|
1006
|
+
const styles = useStyles13({ severity: severity2, className });
|
|
1007
|
+
const IconComponent = icon ?? defaultIcons[severity2];
|
|
1008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { role: "alert", className: styles.root, ...rest, children: [
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: styles.iconSlot, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconComponent, {}) }),
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: styles.content, children: [
|
|
1011
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: styles.titleText, children: title }),
|
|
1012
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: styles.body, children })
|
|
1013
|
+
] })
|
|
1014
|
+
] });
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// src/components/tooltip/index.tsx
|
|
1018
|
+
var import_react18 = require("react");
|
|
1019
|
+
|
|
1020
|
+
// src/components/tooltip/use-styles.ts
|
|
1021
|
+
var import_react17 = require("react");
|
|
1022
|
+
|
|
1023
|
+
// src/components/tooltip/use-styles.css.ts
|
|
1024
|
+
var bubble = "use-styles_bubble__h9kvh1";
|
|
1025
|
+
var placement = { top: "use-styles_placement_top__h9kvh2", bottom: "use-styles_placement_bottom__h9kvh3" };
|
|
1026
|
+
var wrapper = "use-styles_wrapper__h9kvh0";
|
|
1027
|
+
|
|
1028
|
+
// src/components/tooltip/use-styles.ts
|
|
1029
|
+
function useStyles14({ placement: placement2 = "top" }) {
|
|
1030
|
+
const { themeClass } = useTheme();
|
|
1031
|
+
const wrapper4 = (0, import_react17.useMemo)(
|
|
1032
|
+
() => [themeClass, wrapper].filter(Boolean).join(" "),
|
|
1033
|
+
[themeClass]
|
|
1034
|
+
);
|
|
1035
|
+
const bubble2 = (0, import_react17.useMemo)(
|
|
1036
|
+
() => [bubble, placement[placement2]].filter(Boolean).join(" "),
|
|
1037
|
+
[placement2]
|
|
1038
|
+
);
|
|
1039
|
+
return { wrapper: wrapper4, bubble: bubble2 };
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// src/components/tooltip/index.tsx
|
|
1043
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1044
|
+
function Tooltip({ label: label7, children, placement: placement2 }) {
|
|
1045
|
+
const [open, setOpen] = (0, import_react18.useState)(false);
|
|
1046
|
+
const tooltipId = (0, import_react18.useId)();
|
|
1047
|
+
const { wrapper: wrapper4, bubble: bubble2 } = useStyles14({ placement: placement2 });
|
|
1048
|
+
const show = () => setOpen(true);
|
|
1049
|
+
const hide = () => setOpen(false);
|
|
1050
|
+
const previousDescribedBy = children.props["aria-describedby"];
|
|
1051
|
+
const describedBy = open ? [previousDescribedBy, tooltipId].filter(Boolean).join(" ") : previousDescribedBy;
|
|
1052
|
+
const trigger2 = (0, import_react18.cloneElement)(children, { "aria-describedby": describedBy });
|
|
1053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: wrapper4, onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, children: [
|
|
1054
|
+
trigger2,
|
|
1055
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { id: tooltipId, role: "tooltip", className: bubble2, children: label7 })
|
|
1056
|
+
] });
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// src/components/select/index.tsx
|
|
1060
|
+
var import_react20 = require("react");
|
|
1061
|
+
|
|
1062
|
+
// src/components/icons/chevron-down/index.tsx
|
|
1063
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1064
|
+
function ChevronDownIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1066
|
+
"svg",
|
|
1067
|
+
{
|
|
1068
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1069
|
+
width: size3,
|
|
1070
|
+
height: size3,
|
|
1071
|
+
viewBox: "0 0 24 24",
|
|
1072
|
+
fill: "none",
|
|
1073
|
+
stroke: "currentColor",
|
|
1074
|
+
strokeWidth,
|
|
1075
|
+
strokeLinecap: "round",
|
|
1076
|
+
strokeLinejoin: "round",
|
|
1077
|
+
"aria-hidden": "true",
|
|
1078
|
+
...rest,
|
|
1079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1080
|
+
}
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
// src/components/select/use-styles.ts
|
|
1085
|
+
var import_react19 = require("react");
|
|
1086
|
+
|
|
1087
|
+
// src/components/select/use-styles.css.ts
|
|
1088
|
+
var chevron = "use-styles_chevron__1w1czpb4";
|
|
1089
|
+
var chevronOpen = "use-styles_chevronOpen__1w1czpb5";
|
|
1090
|
+
var label4 = "use-styles_label__1w1czpb1";
|
|
1091
|
+
var menu = "use-styles_menu__1w1czpb6";
|
|
1092
|
+
var option = "use-styles_option__1w1czpb7";
|
|
1093
|
+
var optionActive = "use-styles_optionActive__1w1czpb9";
|
|
1094
|
+
var optionSelected = "use-styles_optionSelected__1w1czpb8";
|
|
1095
|
+
var placeholder = "use-styles_placeholder__1w1czpb3";
|
|
1096
|
+
var root13 = "use-styles_root__1w1czpb0";
|
|
1097
|
+
var trigger = "use-styles_trigger__1w1czpb2";
|
|
1098
|
+
|
|
1099
|
+
// src/components/select/use-styles.ts
|
|
1100
|
+
function useStyles15({
|
|
1101
|
+
open = false
|
|
1102
|
+
}) {
|
|
1103
|
+
const { themeClass } = useTheme();
|
|
1104
|
+
return (0, import_react19.useMemo)(() => {
|
|
1105
|
+
const chevron3 = [chevron, open && chevronOpen].filter(Boolean).join(" ");
|
|
1106
|
+
return {
|
|
1107
|
+
root: [themeClass, root13].filter(Boolean).join(" "),
|
|
1108
|
+
label: label4,
|
|
1109
|
+
trigger,
|
|
1110
|
+
placeholder,
|
|
1111
|
+
chevron: chevron3,
|
|
1112
|
+
menu,
|
|
1113
|
+
optionClass: (selected3, active2) => [option, selected3 && optionSelected, active2 && optionActive].filter(Boolean).join(" ")
|
|
1114
|
+
};
|
|
1115
|
+
}, [themeClass, open]);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// src/components/select/index.tsx
|
|
1119
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1120
|
+
function Select({ options, value, onChange, placeholder: placeholder2, label: label7, disabled: disabled3 }) {
|
|
1121
|
+
const [open, setOpen] = (0, import_react20.useState)(false);
|
|
1122
|
+
const [activeIndex, setActiveIndex] = (0, import_react20.useState)(0);
|
|
1123
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
1124
|
+
const baseId = (0, import_react20.useId)();
|
|
1125
|
+
const labelId = `${baseId}-label`;
|
|
1126
|
+
const optionId = (index) => `${baseId}-option-${index}`;
|
|
1127
|
+
const {
|
|
1128
|
+
root: root24,
|
|
1129
|
+
label: labelClass,
|
|
1130
|
+
trigger: trigger2,
|
|
1131
|
+
placeholder: placeholderClass,
|
|
1132
|
+
chevron: chevron3,
|
|
1133
|
+
menu: menu2,
|
|
1134
|
+
optionClass
|
|
1135
|
+
} = useStyles15({ open });
|
|
1136
|
+
(0, import_react20.useEffect)(() => {
|
|
1137
|
+
if (!open) return;
|
|
1138
|
+
const onPointerDown = (event) => {
|
|
1139
|
+
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
1140
|
+
setOpen(false);
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
document.addEventListener("mousedown", onPointerDown);
|
|
1144
|
+
return () => document.removeEventListener("mousedown", onPointerDown);
|
|
1145
|
+
}, [open]);
|
|
1146
|
+
const selected3 = options.find((option2) => option2.value === value);
|
|
1147
|
+
const selectAt = (index) => {
|
|
1148
|
+
const option2 = options[index];
|
|
1149
|
+
if (option2) onChange?.(option2.value);
|
|
1150
|
+
setOpen(false);
|
|
1151
|
+
};
|
|
1152
|
+
const handleSelect = (optionValue) => {
|
|
1153
|
+
onChange?.(optionValue);
|
|
1154
|
+
setOpen(false);
|
|
1155
|
+
};
|
|
1156
|
+
const openMenu = () => {
|
|
1157
|
+
const current2 = options.findIndex((option2) => option2.value === value);
|
|
1158
|
+
setActiveIndex(current2 >= 0 ? current2 : 0);
|
|
1159
|
+
setOpen(true);
|
|
1160
|
+
};
|
|
1161
|
+
const handleKeyDown = (event) => {
|
|
1162
|
+
if (disabled3) return;
|
|
1163
|
+
switch (event.key) {
|
|
1164
|
+
case "Escape":
|
|
1165
|
+
setOpen(false);
|
|
1166
|
+
break;
|
|
1167
|
+
case "ArrowDown":
|
|
1168
|
+
event.preventDefault();
|
|
1169
|
+
if (!open) {
|
|
1170
|
+
openMenu();
|
|
1171
|
+
} else {
|
|
1172
|
+
setActiveIndex((index) => (index + 1) % options.length);
|
|
1173
|
+
}
|
|
1174
|
+
break;
|
|
1175
|
+
case "ArrowUp":
|
|
1176
|
+
event.preventDefault();
|
|
1177
|
+
if (!open) {
|
|
1178
|
+
openMenu();
|
|
1179
|
+
} else {
|
|
1180
|
+
setActiveIndex((index) => (index - 1 + options.length) % options.length);
|
|
1181
|
+
}
|
|
1182
|
+
break;
|
|
1183
|
+
case "Enter":
|
|
1184
|
+
case " ":
|
|
1185
|
+
event.preventDefault();
|
|
1186
|
+
if (!open) {
|
|
1187
|
+
openMenu();
|
|
1188
|
+
} else {
|
|
1189
|
+
selectAt(activeIndex);
|
|
1190
|
+
}
|
|
1191
|
+
break;
|
|
1192
|
+
default:
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref: rootRef, className: root24, children: [
|
|
1197
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { id: labelId, className: labelClass, children: label7 }),
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1199
|
+
"button",
|
|
1200
|
+
{
|
|
1201
|
+
type: "button",
|
|
1202
|
+
className: trigger2,
|
|
1203
|
+
disabled: disabled3,
|
|
1204
|
+
"aria-haspopup": "listbox",
|
|
1205
|
+
"aria-expanded": open,
|
|
1206
|
+
"aria-labelledby": label7 ? labelId : void 0,
|
|
1207
|
+
"aria-activedescendant": open ? optionId(activeIndex) : void 0,
|
|
1208
|
+
onClick: () => {
|
|
1209
|
+
if (disabled3) return;
|
|
1210
|
+
if (open) {
|
|
1211
|
+
setOpen(false);
|
|
1212
|
+
} else {
|
|
1213
|
+
openMenu();
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
onKeyDown: handleKeyDown,
|
|
1217
|
+
children: [
|
|
1218
|
+
selected3 ? selected3.label : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: placeholderClass, children: placeholder2 }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: chevron3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronDownIcon, { size: 18 }) })
|
|
1220
|
+
]
|
|
1221
|
+
}
|
|
1222
|
+
),
|
|
1223
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: menu2, role: "listbox", children: options.map((option2, index) => {
|
|
1224
|
+
const isSelected = option2.value === value;
|
|
1225
|
+
const isActive = index === activeIndex;
|
|
1226
|
+
return (
|
|
1227
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: keyboard nav lives on the trigger via aria-activedescendant; options are not focusable.
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1229
|
+
"div",
|
|
1230
|
+
{
|
|
1231
|
+
id: optionId(index),
|
|
1232
|
+
role: "option",
|
|
1233
|
+
tabIndex: -1,
|
|
1234
|
+
"aria-selected": isSelected,
|
|
1235
|
+
className: optionClass(isSelected, isActive),
|
|
1236
|
+
onClick: () => handleSelect(option2.value),
|
|
1237
|
+
children: option2.label
|
|
1238
|
+
},
|
|
1239
|
+
option2.value
|
|
1240
|
+
)
|
|
1241
|
+
);
|
|
1242
|
+
}) })
|
|
1243
|
+
] });
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// src/components/slider/use-styles.ts
|
|
1247
|
+
var import_react21 = require("react");
|
|
1248
|
+
|
|
1249
|
+
// src/components/slider/use-styles.css.ts
|
|
1250
|
+
var input5 = "use-styles_input__okw59n3";
|
|
1251
|
+
var label5 = "use-styles_label__okw59n5";
|
|
1252
|
+
var range = "use-styles_range__okw59n2";
|
|
1253
|
+
var root14 = "use-styles_root__okw59n0";
|
|
1254
|
+
var thumb = "use-styles_thumb__okw59n4";
|
|
1255
|
+
var track3 = "use-styles_track__okw59n1";
|
|
1256
|
+
var wrapper2 = "use-styles_wrapper__okw59n6";
|
|
1257
|
+
|
|
1258
|
+
// src/components/slider/use-styles.ts
|
|
1259
|
+
function useStyles16() {
|
|
1260
|
+
const { themeClass } = useTheme();
|
|
1261
|
+
return (0, import_react21.useMemo)(() => {
|
|
1262
|
+
const root24 = [themeClass, root14].filter(Boolean).join(" ");
|
|
1263
|
+
return {
|
|
1264
|
+
wrapper: wrapper2,
|
|
1265
|
+
label: label5,
|
|
1266
|
+
root: root24,
|
|
1267
|
+
track: track3,
|
|
1268
|
+
range,
|
|
1269
|
+
thumb,
|
|
1270
|
+
input: input5
|
|
1271
|
+
};
|
|
1272
|
+
}, [themeClass]);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
// src/components/slider/index.tsx
|
|
1276
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1277
|
+
function Slider({
|
|
1278
|
+
value = 0,
|
|
1279
|
+
onChange,
|
|
1280
|
+
min = 0,
|
|
1281
|
+
max = 100,
|
|
1282
|
+
step: step2 = 1,
|
|
1283
|
+
disabled: disabled3,
|
|
1284
|
+
label: label7
|
|
1285
|
+
}) {
|
|
1286
|
+
const { wrapper: wrapper4, label: labelClass, root: root24, track: track4, range: range2, thumb: thumb2, input: input6 } = useStyles16();
|
|
1287
|
+
const span = max - min;
|
|
1288
|
+
const percent = span > 0 ? (value - min) / span * 100 : 0;
|
|
1289
|
+
const clamped = Math.max(0, Math.min(100, percent));
|
|
1290
|
+
const handleChange = (e) => {
|
|
1291
|
+
onChange?.(Number(e.target.value));
|
|
1292
|
+
};
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: wrapper4, children: [
|
|
1294
|
+
label7 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: labelClass, children: label7 }) : null,
|
|
1295
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: root24, children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: track4 }),
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: range2, style: { width: `${clamped}%` } }),
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1299
|
+
"input",
|
|
1300
|
+
{
|
|
1301
|
+
className: input6,
|
|
1302
|
+
type: "range",
|
|
1303
|
+
min,
|
|
1304
|
+
max,
|
|
1305
|
+
step: step2,
|
|
1306
|
+
value,
|
|
1307
|
+
disabled: disabled3,
|
|
1308
|
+
onChange: handleChange
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: thumb2, style: { left: `${clamped}%` } })
|
|
1312
|
+
] })
|
|
1313
|
+
] });
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
// src/components/accordion/index.tsx
|
|
1317
|
+
var import_react23 = require("react");
|
|
1318
|
+
|
|
1319
|
+
// src/components/accordion/use-styles.ts
|
|
1320
|
+
var import_react22 = require("react");
|
|
1321
|
+
|
|
1322
|
+
// src/components/accordion/use-styles.css.ts
|
|
1323
|
+
var chevron2 = "use-styles_chevron__1cjrdh93";
|
|
1324
|
+
var chevronOpen2 = "use-styles_chevronOpen__1cjrdh94";
|
|
1325
|
+
var header2 = "use-styles_header__1cjrdh92";
|
|
1326
|
+
var item = "use-styles_item__1cjrdh91";
|
|
1327
|
+
var panel = "use-styles_panel__1cjrdh95";
|
|
1328
|
+
var root15 = "use-styles_root__1cjrdh90";
|
|
1329
|
+
|
|
1330
|
+
// src/components/accordion/use-styles.ts
|
|
1331
|
+
function useStyles17({ className }) {
|
|
1332
|
+
const { themeClass } = useTheme();
|
|
1333
|
+
return (0, import_react22.useMemo)(
|
|
1334
|
+
() => ({
|
|
1335
|
+
root: [themeClass, root15, className].filter(Boolean).join(" "),
|
|
1336
|
+
item,
|
|
1337
|
+
header: header2,
|
|
1338
|
+
chevronFor: (open) => [chevron2, open && chevronOpen2].filter(Boolean).join(" "),
|
|
1339
|
+
panel
|
|
1340
|
+
}),
|
|
1341
|
+
[themeClass, className]
|
|
1342
|
+
);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// src/components/accordion/index.tsx
|
|
1346
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1347
|
+
function Accordion({
|
|
1348
|
+
items,
|
|
1349
|
+
multiple = false,
|
|
1350
|
+
defaultOpen = [],
|
|
1351
|
+
className
|
|
1352
|
+
}) {
|
|
1353
|
+
const [open, setOpen] = (0, import_react23.useState)(defaultOpen);
|
|
1354
|
+
const { root: root24, item: item3, header: header3, chevronFor, panel: panel2 } = useStyles17({ className });
|
|
1355
|
+
const toggle = (id) => {
|
|
1356
|
+
setOpen((current2) => {
|
|
1357
|
+
const isOpen = current2.includes(id);
|
|
1358
|
+
if (isOpen) return current2.filter((x) => x !== id);
|
|
1359
|
+
return multiple ? [...current2, id] : [id];
|
|
1360
|
+
});
|
|
1361
|
+
};
|
|
1362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: root24, children: items.map((it) => {
|
|
1363
|
+
const isOpen = open.includes(it.id);
|
|
1364
|
+
const panelId = `accordion-panel-${it.id}`;
|
|
1365
|
+
const headerId = `accordion-header-${it.id}`;
|
|
1366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: item3, children: [
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1368
|
+
"button",
|
|
1369
|
+
{
|
|
1370
|
+
type: "button",
|
|
1371
|
+
id: headerId,
|
|
1372
|
+
className: header3,
|
|
1373
|
+
"aria-expanded": isOpen,
|
|
1374
|
+
"aria-controls": panelId,
|
|
1375
|
+
onClick: () => toggle(it.id),
|
|
1376
|
+
children: [
|
|
1377
|
+
it.title,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronDownIcon, { className: chevronFor(isOpen) })
|
|
1379
|
+
]
|
|
1380
|
+
}
|
|
1381
|
+
),
|
|
1382
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { id: panelId, className: panel2, role: "region", "aria-labelledby": headerId, children: it.content })
|
|
1383
|
+
] }, it.id);
|
|
1384
|
+
}) });
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// src/components/breadcrumbs/index.tsx
|
|
1388
|
+
var import_react25 = require("react");
|
|
1389
|
+
|
|
1390
|
+
// src/components/icons/chevron-right/index.tsx
|
|
1391
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1392
|
+
function ChevronRightIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1394
|
+
"svg",
|
|
1395
|
+
{
|
|
1396
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1397
|
+
width: size3,
|
|
1398
|
+
height: size3,
|
|
1399
|
+
viewBox: "0 0 24 24",
|
|
1400
|
+
fill: "none",
|
|
1401
|
+
stroke: "currentColor",
|
|
1402
|
+
strokeWidth,
|
|
1403
|
+
strokeLinecap: "round",
|
|
1404
|
+
strokeLinejoin: "round",
|
|
1405
|
+
"aria-hidden": "true",
|
|
1406
|
+
...rest,
|
|
1407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
// src/components/breadcrumbs/use-styles.ts
|
|
1413
|
+
var import_react24 = require("react");
|
|
1414
|
+
|
|
1415
|
+
// src/components/breadcrumbs/use-styles.css.ts
|
|
1416
|
+
var crumb = "use-styles_crumb__7u0du61";
|
|
1417
|
+
var current = "use-styles_current__7u0du62";
|
|
1418
|
+
var root16 = "use-styles_root__7u0du60";
|
|
1419
|
+
var separator = "use-styles_separator__7u0du63";
|
|
1420
|
+
|
|
1421
|
+
// src/components/breadcrumbs/use-styles.ts
|
|
1422
|
+
function useStyles18({ className }) {
|
|
1423
|
+
const { themeClass } = useTheme();
|
|
1424
|
+
const root24 = (0, import_react24.useMemo)(
|
|
1425
|
+
() => [themeClass, root16, className].filter(Boolean).join(" "),
|
|
1426
|
+
[themeClass, className]
|
|
1427
|
+
);
|
|
1428
|
+
return { root: root24, crumb, current, separator };
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
// src/components/breadcrumbs/index.tsx
|
|
1432
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1433
|
+
function Breadcrumbs({ items, className, ...rest }) {
|
|
1434
|
+
const { root: root24, crumb: crumb2, current: current2, separator: separator2 } = useStyles18({ className });
|
|
1435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("nav", { "aria-label": "Breadcrumb", className: root24, ...rest, children: items.map((item3, index) => {
|
|
1436
|
+
const isLast = index === items.length - 1;
|
|
1437
|
+
const key = index;
|
|
1438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react25.Fragment, { children: [
|
|
1439
|
+
isLast ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: current2, "aria-current": "page", children: item3.label }) : item3.href ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("a", { className: crumb2, href: item3.href, children: item3.label }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: crumb2, children: item3.label }),
|
|
1440
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: separator2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronRightIcon, { size: 14 }) })
|
|
1441
|
+
] }, key);
|
|
1442
|
+
}) });
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
// src/components/icons/chevron-left/index.tsx
|
|
1446
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1447
|
+
function ChevronLeftIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
1448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1449
|
+
"svg",
|
|
1450
|
+
{
|
|
1451
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1452
|
+
width: size3,
|
|
1453
|
+
height: size3,
|
|
1454
|
+
viewBox: "0 0 24 24",
|
|
1455
|
+
fill: "none",
|
|
1456
|
+
stroke: "currentColor",
|
|
1457
|
+
strokeWidth,
|
|
1458
|
+
strokeLinecap: "round",
|
|
1459
|
+
strokeLinejoin: "round",
|
|
1460
|
+
"aria-hidden": "true",
|
|
1461
|
+
...rest,
|
|
1462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
1463
|
+
}
|
|
1464
|
+
);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
// src/components/pagination/use-styles.ts
|
|
1468
|
+
var import_react26 = require("react");
|
|
1469
|
+
|
|
1470
|
+
// src/components/pagination/use-styles.css.ts
|
|
1471
|
+
var ellipsis = "use-styles_ellipsis__1azgzoh3";
|
|
1472
|
+
var nav = "use-styles_nav__1azgzoh4";
|
|
1473
|
+
var pageActive = "use-styles_pageActive__1azgzoh2";
|
|
1474
|
+
var pageBtn = "use-styles_pageBtn__1azgzoh1";
|
|
1475
|
+
var root17 = "use-styles_root__1azgzoh0";
|
|
1476
|
+
|
|
1477
|
+
// src/components/pagination/use-styles.ts
|
|
1478
|
+
function useStyles19() {
|
|
1479
|
+
const { themeClass } = useTheme();
|
|
1480
|
+
return (0, import_react26.useMemo)(
|
|
1481
|
+
() => ({
|
|
1482
|
+
root: [themeClass, root17].filter(Boolean).join(" "),
|
|
1483
|
+
pageBtnFor: (active2) => [pageBtn, active2 && pageActive].filter(Boolean).join(" "),
|
|
1484
|
+
ellipsis,
|
|
1485
|
+
nav: [pageBtn, nav].join(" ")
|
|
1486
|
+
}),
|
|
1487
|
+
[themeClass]
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
// src/components/pagination/index.tsx
|
|
1492
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1493
|
+
function buildItems(count, page, siblingCount) {
|
|
1494
|
+
const total = Math.max(1, count);
|
|
1495
|
+
const first = 1;
|
|
1496
|
+
const last = total;
|
|
1497
|
+
const start = Math.max(first + 1, page - siblingCount);
|
|
1498
|
+
const end = Math.min(last - 1, page + siblingCount);
|
|
1499
|
+
const items = [first];
|
|
1500
|
+
if (start > first + 1) items.push("ellipsis");
|
|
1501
|
+
for (let n = start; n <= end; n++) items.push(n);
|
|
1502
|
+
if (end < last - 1) items.push("ellipsis");
|
|
1503
|
+
if (last > first) items.push(last);
|
|
1504
|
+
return items;
|
|
1505
|
+
}
|
|
1506
|
+
function Pagination({ count, page = 1, onChange, siblingCount = 1 }) {
|
|
1507
|
+
const { root: root24, pageBtnFor, ellipsis: ellipsis2, nav: nav2 } = useStyles19();
|
|
1508
|
+
const total = Math.max(1, count);
|
|
1509
|
+
const current2 = Math.min(Math.max(1, page), total);
|
|
1510
|
+
const items = buildItems(total, current2, siblingCount);
|
|
1511
|
+
const go = (n) => onChange?.(Math.min(Math.max(1, n), total));
|
|
1512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: root24, "aria-label": "Pagination", children: [
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1514
|
+
"button",
|
|
1515
|
+
{
|
|
1516
|
+
type: "button",
|
|
1517
|
+
className: nav2,
|
|
1518
|
+
"aria-label": "Previous page",
|
|
1519
|
+
disabled: current2 <= 1,
|
|
1520
|
+
onClick: () => go(current2 - 1),
|
|
1521
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChevronLeftIcon, { size: 18 })
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
items.map(
|
|
1525
|
+
(item3, index) => item3 === "ellipsis" ? (
|
|
1526
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: ellipsis position is stable per render
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: ellipsis2, children: "\u2026" }, `ellipsis-${index}`)
|
|
1528
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1529
|
+
"button",
|
|
1530
|
+
{
|
|
1531
|
+
type: "button",
|
|
1532
|
+
className: pageBtnFor(item3 === current2),
|
|
1533
|
+
"aria-current": item3 === current2 ? "page" : void 0,
|
|
1534
|
+
onClick: () => go(item3),
|
|
1535
|
+
children: item3
|
|
1536
|
+
},
|
|
1537
|
+
item3
|
|
1538
|
+
)
|
|
1539
|
+
),
|
|
1540
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
type: "button",
|
|
1544
|
+
className: nav2,
|
|
1545
|
+
"aria-label": "Next page",
|
|
1546
|
+
disabled: current2 >= total,
|
|
1547
|
+
onClick: () => go(current2 + 1),
|
|
1548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChevronRightIcon, { size: 18 })
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
] });
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
// src/components/stepper/index.tsx
|
|
1555
|
+
var import_react28 = require("react");
|
|
1556
|
+
|
|
1557
|
+
// src/components/stepper/use-styles.ts
|
|
1558
|
+
var import_react27 = require("react");
|
|
1559
|
+
|
|
1560
|
+
// src/components/stepper/use-styles.css.ts
|
|
1561
|
+
var connector = "use-styles_connector__79pt4e7";
|
|
1562
|
+
var label6 = "use-styles_label__79pt4e5";
|
|
1563
|
+
var labelActive = "use-styles_labelActive__79pt4e6";
|
|
1564
|
+
var marker = "use-styles_marker__79pt4e2";
|
|
1565
|
+
var markerActive = "use-styles_markerActive__79pt4e3";
|
|
1566
|
+
var markerDone = "use-styles_markerDone__79pt4e4";
|
|
1567
|
+
var root18 = "use-styles_root__79pt4e0";
|
|
1568
|
+
var step = "use-styles_step__79pt4e1";
|
|
1569
|
+
|
|
1570
|
+
// src/components/stepper/use-styles.ts
|
|
1571
|
+
function useStyles20({ className }) {
|
|
1572
|
+
const { themeClass } = useTheme();
|
|
1573
|
+
return (0, import_react27.useMemo)(() => {
|
|
1574
|
+
const root24 = [themeClass, root18, className].filter(Boolean).join(" ");
|
|
1575
|
+
const markerFor = (state) => [
|
|
1576
|
+
marker,
|
|
1577
|
+
state === "active" && markerActive,
|
|
1578
|
+
state === "done" && markerDone
|
|
1579
|
+
].filter(Boolean).join(" ");
|
|
1580
|
+
const labelFor = (active2) => [label6, active2 && labelActive].filter(Boolean).join(" ");
|
|
1581
|
+
return { root: root24, step, connector, markerFor, labelFor };
|
|
1582
|
+
}, [themeClass, className]);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// src/components/stepper/index.tsx
|
|
1586
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1587
|
+
function Stepper({ steps, active: active2 = 0, className, ...rest }) {
|
|
1588
|
+
const { root: root24, step: step2, connector: connector2, markerFor, labelFor } = useStyles20({ className });
|
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: root24, ...rest, children: steps.map((s, index) => {
|
|
1590
|
+
const state = index < active2 ? "done" : index === active2 ? "active" : "upcoming";
|
|
1591
|
+
const isActive = state === "active";
|
|
1592
|
+
return (
|
|
1593
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: steps are a static, ordered list with no stable id.
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react28.Fragment, { children: [
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: step2, "aria-current": isActive ? "step" : void 0, children: [
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: markerFor(state), children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CheckIcon, { size: 14 }) : index + 1 }),
|
|
1597
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: labelFor(isActive), children: s.label })
|
|
1598
|
+
] }),
|
|
1599
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { "data-part": "connector", className: connector2 })
|
|
1600
|
+
] }, index)
|
|
1601
|
+
);
|
|
1602
|
+
}) });
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
// src/components/tabs/use-styles.ts
|
|
1606
|
+
var import_react29 = require("react");
|
|
1607
|
+
|
|
1608
|
+
// src/components/tabs/use-styles.css.ts
|
|
1609
|
+
var root19 = "use-styles_root__1l4m7t40";
|
|
1610
|
+
var tab = "use-styles_tab__1l4m7t41";
|
|
1611
|
+
var tabActive = "use-styles_tabActive__1l4m7t42";
|
|
1612
|
+
|
|
1613
|
+
// src/components/tabs/use-styles.ts
|
|
1614
|
+
function useStyles21() {
|
|
1615
|
+
const { themeClass } = useTheme();
|
|
1616
|
+
return (0, import_react29.useMemo)(() => {
|
|
1617
|
+
const root24 = [themeClass, root19].filter(Boolean).join(" ");
|
|
1618
|
+
const tabClass = (active2) => [tab, active2 && tabActive].filter(Boolean).join(" ");
|
|
1619
|
+
return { root: root24, tab, tabClass };
|
|
1620
|
+
}, [themeClass]);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
// src/components/tabs/index.tsx
|
|
1624
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1625
|
+
function Tabs({ items, value, onChange }) {
|
|
1626
|
+
const { root: root24, tabClass } = useStyles21();
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { role: "tablist", className: root24, children: items.map((item3) => {
|
|
1628
|
+
const active2 = item3.value === value;
|
|
1629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1630
|
+
"button",
|
|
1631
|
+
{
|
|
1632
|
+
type: "button",
|
|
1633
|
+
role: "tab",
|
|
1634
|
+
"aria-selected": active2,
|
|
1635
|
+
className: tabClass(active2),
|
|
1636
|
+
onClick: () => onChange?.(item3.value),
|
|
1637
|
+
children: item3.label
|
|
1638
|
+
},
|
|
1639
|
+
item3.value
|
|
1640
|
+
);
|
|
1641
|
+
}) });
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// src/components/menu/index.tsx
|
|
1645
|
+
var import_react31 = require("react");
|
|
1646
|
+
|
|
1647
|
+
// src/components/menu/use-styles.ts
|
|
1648
|
+
var import_react30 = require("react");
|
|
1649
|
+
|
|
1650
|
+
// src/components/menu/use-styles.css.ts
|
|
1651
|
+
var danger = "use-styles_danger__1uyxaj3";
|
|
1652
|
+
var item2 = "use-styles_item__1uyxaj2";
|
|
1653
|
+
var list = "use-styles_list__1uyxaj1";
|
|
1654
|
+
var wrapper3 = "use-styles_wrapper__1uyxaj0";
|
|
1655
|
+
|
|
1656
|
+
// src/components/menu/use-styles.ts
|
|
1657
|
+
function useStyles22() {
|
|
1658
|
+
const { themeClass } = useTheme();
|
|
1659
|
+
return (0, import_react30.useMemo)(
|
|
1660
|
+
() => ({
|
|
1661
|
+
wrapper: [themeClass, wrapper3].filter(Boolean).join(" "),
|
|
1662
|
+
list,
|
|
1663
|
+
item: item2,
|
|
1664
|
+
dangerItem: [item2, danger].join(" ")
|
|
1665
|
+
}),
|
|
1666
|
+
[themeClass]
|
|
1667
|
+
);
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
// src/components/menu/index.tsx
|
|
1671
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1672
|
+
function assignRef(ref, value) {
|
|
1673
|
+
if (typeof ref === "function") ref(value);
|
|
1674
|
+
else if (ref) ref.current = value;
|
|
1675
|
+
}
|
|
1676
|
+
function Menu({ trigger: trigger2, items }) {
|
|
1677
|
+
const { wrapper: wrapper4, list: list2, item: item3, dangerItem } = useStyles22();
|
|
1678
|
+
const [open, setOpen] = (0, import_react31.useState)(false);
|
|
1679
|
+
const rootRef = (0, import_react31.useRef)(null);
|
|
1680
|
+
const listRef = (0, import_react31.useRef)(null);
|
|
1681
|
+
const triggerRef = (0, import_react31.useRef)(null);
|
|
1682
|
+
const getMenuItems = () => Array.from(listRef.current?.querySelectorAll('[role="menuitem"]') ?? []);
|
|
1683
|
+
const focusItemAt = (index) => {
|
|
1684
|
+
const menuItems = getMenuItems();
|
|
1685
|
+
if (menuItems.length === 0) return;
|
|
1686
|
+
const wrapped = (index + menuItems.length) % menuItems.length;
|
|
1687
|
+
menuItems[wrapped]?.focus();
|
|
1688
|
+
};
|
|
1689
|
+
const closeAndRestoreFocus = () => {
|
|
1690
|
+
setOpen(false);
|
|
1691
|
+
triggerRef.current?.focus();
|
|
1692
|
+
};
|
|
1693
|
+
(0, import_react31.useEffect)(() => {
|
|
1694
|
+
if (!open) return;
|
|
1695
|
+
listRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
1696
|
+
const onDocMouseDown = (event) => {
|
|
1697
|
+
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
1698
|
+
setOpen(false);
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
const onKeyDown = (event) => {
|
|
1702
|
+
if (event.key === "Escape") {
|
|
1703
|
+
setOpen(false);
|
|
1704
|
+
triggerRef.current?.focus();
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
document.addEventListener("mousedown", onDocMouseDown);
|
|
1708
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1709
|
+
return () => {
|
|
1710
|
+
document.removeEventListener("mousedown", onDocMouseDown);
|
|
1711
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
1712
|
+
};
|
|
1713
|
+
}, [open]);
|
|
1714
|
+
const onMenuKeyDown = (event) => {
|
|
1715
|
+
const menuItems = getMenuItems();
|
|
1716
|
+
const current2 = menuItems.indexOf(document.activeElement);
|
|
1717
|
+
switch (event.key) {
|
|
1718
|
+
case "ArrowDown":
|
|
1719
|
+
event.preventDefault();
|
|
1720
|
+
focusItemAt(current2 + 1);
|
|
1721
|
+
break;
|
|
1722
|
+
case "ArrowUp":
|
|
1723
|
+
event.preventDefault();
|
|
1724
|
+
focusItemAt(current2 - 1);
|
|
1725
|
+
break;
|
|
1726
|
+
case "Home":
|
|
1727
|
+
event.preventDefault();
|
|
1728
|
+
focusItemAt(0);
|
|
1729
|
+
break;
|
|
1730
|
+
case "End":
|
|
1731
|
+
event.preventDefault();
|
|
1732
|
+
focusItemAt(menuItems.length - 1);
|
|
1733
|
+
break;
|
|
1734
|
+
case "Escape":
|
|
1735
|
+
event.preventDefault();
|
|
1736
|
+
closeAndRestoreFocus();
|
|
1737
|
+
break;
|
|
1738
|
+
case "Tab":
|
|
1739
|
+
setOpen(false);
|
|
1740
|
+
break;
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
const triggerProps = trigger2.props;
|
|
1744
|
+
const consumerRef = trigger2.ref;
|
|
1745
|
+
const mergedTriggerRef = (node) => {
|
|
1746
|
+
triggerRef.current = node;
|
|
1747
|
+
assignRef(consumerRef, node);
|
|
1748
|
+
};
|
|
1749
|
+
const clonedTrigger = (0, import_react31.cloneElement)(trigger2, {
|
|
1750
|
+
ref: mergedTriggerRef,
|
|
1751
|
+
"aria-haspopup": "menu",
|
|
1752
|
+
"aria-expanded": open,
|
|
1753
|
+
onClick: (event) => {
|
|
1754
|
+
triggerProps.onClick?.(event);
|
|
1755
|
+
setOpen((prev) => !prev);
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref: rootRef, className: wrapper4, children: [
|
|
1759
|
+
clonedTrigger,
|
|
1760
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: listRef, role: "menu", className: list2, onKeyDown: onMenuKeyDown, children: items.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1761
|
+
"button",
|
|
1762
|
+
{
|
|
1763
|
+
type: "button",
|
|
1764
|
+
role: "menuitem",
|
|
1765
|
+
tabIndex: -1,
|
|
1766
|
+
className: entry.danger ? dangerItem : item3,
|
|
1767
|
+
onClick: () => {
|
|
1768
|
+
entry.onClick?.();
|
|
1769
|
+
setOpen(false);
|
|
1770
|
+
},
|
|
1771
|
+
children: entry.label
|
|
1772
|
+
},
|
|
1773
|
+
index
|
|
1774
|
+
)) })
|
|
1775
|
+
] });
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
// src/components/dialog/index.tsx
|
|
1779
|
+
var import_react33 = require("react");
|
|
1780
|
+
|
|
1781
|
+
// src/components/dialog/use-styles.ts
|
|
1782
|
+
var import_react32 = require("react");
|
|
1783
|
+
|
|
1784
|
+
// src/components/dialog/use-styles.css.ts
|
|
1785
|
+
var actions = "use-styles_actions__5tstu84";
|
|
1786
|
+
var body3 = "use-styles_body__5tstu83";
|
|
1787
|
+
var overlay = "use-styles_overlay__5tstu80";
|
|
1788
|
+
var surface = "use-styles_surface__5tstu81";
|
|
1789
|
+
var titleText2 = "use-styles_titleText__5tstu82";
|
|
1790
|
+
|
|
1791
|
+
// src/components/dialog/use-styles.ts
|
|
1792
|
+
function useStyles23() {
|
|
1793
|
+
const { themeClass } = useTheme();
|
|
1794
|
+
return (0, import_react32.useMemo)(
|
|
1795
|
+
() => ({
|
|
1796
|
+
overlay: [themeClass, overlay].filter(Boolean).join(" "),
|
|
1797
|
+
surface,
|
|
1798
|
+
titleText: titleText2,
|
|
1799
|
+
body: body3,
|
|
1800
|
+
actions
|
|
1801
|
+
}),
|
|
1802
|
+
[themeClass]
|
|
1803
|
+
);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
// src/components/dialog/index.tsx
|
|
1807
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1808
|
+
var FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1809
|
+
function Dialog({ open, onClose, title, actions: actions3, children }) {
|
|
1810
|
+
const { overlay: overlay2, surface: surface2, titleText: titleText3, body: body4, actions: actionsClass } = useStyles23();
|
|
1811
|
+
const surfaceRef = (0, import_react33.useRef)(null);
|
|
1812
|
+
const previouslyFocused = (0, import_react33.useRef)(null);
|
|
1813
|
+
const generatedId = (0, import_react33.useId)();
|
|
1814
|
+
const titleId = title != null ? generatedId : void 0;
|
|
1815
|
+
(0, import_react33.useEffect)(() => {
|
|
1816
|
+
if (!open) return;
|
|
1817
|
+
const onKeyDown = (event) => {
|
|
1818
|
+
if (event.key === "Escape") onClose();
|
|
1819
|
+
};
|
|
1820
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1821
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1822
|
+
}, [open, onClose]);
|
|
1823
|
+
(0, import_react33.useEffect)(() => {
|
|
1824
|
+
if (!open) return;
|
|
1825
|
+
previouslyFocused.current = document.activeElement;
|
|
1826
|
+
surfaceRef.current?.focus();
|
|
1827
|
+
return () => previouslyFocused.current?.focus?.();
|
|
1828
|
+
}, [open]);
|
|
1829
|
+
(0, import_react33.useEffect)(() => {
|
|
1830
|
+
if (!open) return;
|
|
1831
|
+
const previousOverflow = document.body.style.overflow;
|
|
1832
|
+
document.body.style.overflow = "hidden";
|
|
1833
|
+
return () => {
|
|
1834
|
+
document.body.style.overflow = previousOverflow;
|
|
1835
|
+
};
|
|
1836
|
+
}, [open]);
|
|
1837
|
+
if (!open) return null;
|
|
1838
|
+
const stop = (event) => event.stopPropagation();
|
|
1839
|
+
const onSurfaceKeyDown = (event) => {
|
|
1840
|
+
if (event.key !== "Tab") return;
|
|
1841
|
+
const surfaceEl = surfaceRef.current;
|
|
1842
|
+
if (!surfaceEl) return;
|
|
1843
|
+
const focusable = Array.from(surfaceEl.querySelectorAll(FOCUSABLE)).filter(
|
|
1844
|
+
(el) => el.offsetParent !== null || el === surfaceEl
|
|
1845
|
+
);
|
|
1846
|
+
if (focusable.length === 0) {
|
|
1847
|
+
event.preventDefault();
|
|
1848
|
+
surfaceEl.focus();
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
const first = focusable[0];
|
|
1852
|
+
const last = focusable[focusable.length - 1];
|
|
1853
|
+
const active2 = document.activeElement;
|
|
1854
|
+
if (event.shiftKey) {
|
|
1855
|
+
if (active2 === first || active2 === surfaceEl) {
|
|
1856
|
+
event.preventDefault();
|
|
1857
|
+
last.focus();
|
|
1858
|
+
}
|
|
1859
|
+
} else if (active2 === last) {
|
|
1860
|
+
event.preventDefault();
|
|
1861
|
+
first.focus();
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
return (
|
|
1865
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: ESC handled by a document keydown listener.
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: overlay2, "data-testid": "dialog-overlay", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1867
|
+
"div",
|
|
1868
|
+
{
|
|
1869
|
+
ref: surfaceRef,
|
|
1870
|
+
className: surface2,
|
|
1871
|
+
role: "dialog",
|
|
1872
|
+
"aria-modal": "true",
|
|
1873
|
+
"aria-labelledby": titleId,
|
|
1874
|
+
tabIndex: -1,
|
|
1875
|
+
onClick: stop,
|
|
1876
|
+
onKeyDown: onSurfaceKeyDown,
|
|
1877
|
+
children: [
|
|
1878
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { id: titleId, className: titleText3, children: title }),
|
|
1879
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: body4, children }),
|
|
1880
|
+
actions3 != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: actionsClass, children: actions3 })
|
|
1881
|
+
]
|
|
1882
|
+
}
|
|
1883
|
+
) })
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
// src/components/snackbar/use-styles.ts
|
|
1888
|
+
var import_react34 = require("react");
|
|
1889
|
+
|
|
1890
|
+
// src/components/snackbar/use-styles.css.ts
|
|
1891
|
+
var closeBtn = "use-styles_closeBtn__ihzsep2";
|
|
1892
|
+
var message = "use-styles_message__ihzsep1";
|
|
1893
|
+
var root20 = "use-styles_root__ihzsep0";
|
|
1894
|
+
|
|
1895
|
+
// src/components/snackbar/use-styles.ts
|
|
1896
|
+
function useStyles24() {
|
|
1897
|
+
const { themeClass } = useTheme();
|
|
1898
|
+
return (0, import_react34.useMemo)(
|
|
1899
|
+
() => ({
|
|
1900
|
+
root: [themeClass, root20].filter(Boolean).join(" "),
|
|
1901
|
+
message,
|
|
1902
|
+
closeBtn
|
|
1903
|
+
}),
|
|
1904
|
+
[themeClass]
|
|
1905
|
+
);
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
// src/components/snackbar/index.tsx
|
|
1909
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1910
|
+
function Snackbar({ open, message: message2, action, onClose }) {
|
|
1911
|
+
const { root: root24, message: messageClass, closeBtn: closeBtn2 } = useStyles24();
|
|
1912
|
+
if (!open) return null;
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { role: "status", className: root24, children: [
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: messageClass, children: message2 }),
|
|
1915
|
+
action,
|
|
1916
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-label": "Close", className: closeBtn2, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(XIcon, { size: 18 }) })
|
|
1917
|
+
] });
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
// src/components/table/use-styles.ts
|
|
1921
|
+
var import_react35 = require("react");
|
|
1922
|
+
|
|
1923
|
+
// src/components/table/use-styles.css.ts
|
|
1924
|
+
var alignRight = "use-styles_alignRight__1n2cz6i3";
|
|
1925
|
+
var root21 = "use-styles_root__1n2cz6i0";
|
|
1926
|
+
var td = "use-styles_td__1n2cz6i2";
|
|
1927
|
+
var th = "use-styles_th__1n2cz6i1";
|
|
1928
|
+
|
|
1929
|
+
// src/components/table/use-styles.ts
|
|
1930
|
+
function useStyles25({ className }) {
|
|
1931
|
+
const { themeClass } = useTheme();
|
|
1932
|
+
const root24 = (0, import_react35.useMemo)(
|
|
1933
|
+
() => [themeClass, root21, className].filter(Boolean).join(" "),
|
|
1934
|
+
[themeClass, className]
|
|
1935
|
+
);
|
|
1936
|
+
return { root: root24, th, td, alignRight };
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
// src/components/table/index.tsx
|
|
1940
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1941
|
+
function Table({
|
|
1942
|
+
columns,
|
|
1943
|
+
rows,
|
|
1944
|
+
getRowKey,
|
|
1945
|
+
className,
|
|
1946
|
+
...rest
|
|
1947
|
+
}) {
|
|
1948
|
+
const { root: root24, th: th2, td: td2, alignRight: alignRight2 } = useStyles25({ className });
|
|
1949
|
+
const headClass = (column) => column.align === "right" ? `${th2} ${alignRight2}` : th2;
|
|
1950
|
+
const cellClass = (column) => column.align === "right" ? `${td2} ${alignRight2}` : td2;
|
|
1951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("table", { className: root24, ...rest, children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { className: headClass(column), children: column.header }, column.key)) }) }),
|
|
1953
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("tbody", { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("tr", { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("td", { className: cellClass(column), children: column.render ? column.render(row) : String(row[column.key]) }, column.key)) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
1954
|
+
] });
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// src/components/app-bar/use-styles.ts
|
|
1958
|
+
var import_react36 = require("react");
|
|
1959
|
+
|
|
1960
|
+
// src/components/app-bar/use-styles.css.ts
|
|
1961
|
+
var actions2 = "use-styles_actions__1h133nh2";
|
|
1962
|
+
var brand = "use-styles_brand__1h133nh1";
|
|
1963
|
+
var root22 = "use-styles_root__1h133nh0";
|
|
1964
|
+
|
|
1965
|
+
// src/components/app-bar/use-styles.ts
|
|
1966
|
+
function useStyles26({ className }) {
|
|
1967
|
+
const { themeClass } = useTheme();
|
|
1968
|
+
const root24 = (0, import_react36.useMemo)(
|
|
1969
|
+
() => [themeClass, root22, className].filter(Boolean).join(" "),
|
|
1970
|
+
[themeClass, className]
|
|
1971
|
+
);
|
|
1972
|
+
return { root: root24, brand, actions: actions2 };
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
// src/components/app-bar/index.tsx
|
|
1976
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1977
|
+
function AppBar({ brand: brand2, actions: actions3, className, children, ...rest }) {
|
|
1978
|
+
const styles = useStyles26({ className });
|
|
1979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: styles.root, ...rest, children: [
|
|
1980
|
+
brand2 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: styles.brand, children: brand2 }) : null,
|
|
1981
|
+
children,
|
|
1982
|
+
actions3 !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: styles.actions, children: actions3 }) : null
|
|
1983
|
+
] });
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
// src/components/list-item/use-styles.ts
|
|
1987
|
+
var import_react37 = require("react");
|
|
1988
|
+
|
|
1989
|
+
// src/components/list-item/use-styles.css.ts
|
|
1990
|
+
var content2 = "use-styles_content__kbreq13";
|
|
1991
|
+
var leading = "use-styles_leading__kbreq12";
|
|
1992
|
+
var root23 = "use-styles_root__kbreq10";
|
|
1993
|
+
var selected2 = "use-styles_selected__kbreq11";
|
|
1994
|
+
var trailing = "use-styles_trailing__kbreq14";
|
|
1995
|
+
|
|
1996
|
+
// src/components/list-item/use-styles.ts
|
|
1997
|
+
function useStyles27({ selected: selected3, className }) {
|
|
1998
|
+
const { themeClass } = useTheme();
|
|
1999
|
+
const root24 = (0, import_react37.useMemo)(
|
|
2000
|
+
() => [themeClass, root23, selected3 && selected2, className].filter(Boolean).join(" "),
|
|
2001
|
+
[themeClass, selected3, className]
|
|
2002
|
+
);
|
|
2003
|
+
return { root: root24, leading, content: content2, trailing };
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
// src/components/list-item/index.tsx
|
|
2007
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2008
|
+
function ListItem({
|
|
2009
|
+
leading: leading2,
|
|
2010
|
+
trailing: trailing2,
|
|
2011
|
+
selected: selected3,
|
|
2012
|
+
className,
|
|
2013
|
+
children,
|
|
2014
|
+
...rest
|
|
2015
|
+
}) {
|
|
2016
|
+
const styles = useStyles27({ selected: selected3, className });
|
|
2017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: styles.root, ...rest, children: [
|
|
2018
|
+
leading2 != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: styles.leading, children: leading2 }),
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: styles.content, children }),
|
|
2020
|
+
trailing2 != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: styles.trailing, children: trailing2 })
|
|
2021
|
+
] });
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
// src/components/icons/chevron-up/index.tsx
|
|
2025
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2026
|
+
function ChevronUpIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2028
|
+
"svg",
|
|
2029
|
+
{
|
|
2030
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2031
|
+
width: size3,
|
|
2032
|
+
height: size3,
|
|
2033
|
+
viewBox: "0 0 24 24",
|
|
2034
|
+
fill: "none",
|
|
2035
|
+
stroke: "currentColor",
|
|
2036
|
+
strokeWidth,
|
|
2037
|
+
strokeLinecap: "round",
|
|
2038
|
+
strokeLinejoin: "round",
|
|
2039
|
+
"aria-hidden": "true",
|
|
2040
|
+
...rest,
|
|
2041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", { d: "m18 15-6-6-6 6" })
|
|
2042
|
+
}
|
|
2043
|
+
);
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
// src/components/icons/search/index.tsx
|
|
2047
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2048
|
+
function SearchIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2050
|
+
"svg",
|
|
2051
|
+
{
|
|
2052
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2053
|
+
width: size3,
|
|
2054
|
+
height: size3,
|
|
2055
|
+
viewBox: "0 0 24 24",
|
|
2056
|
+
fill: "none",
|
|
2057
|
+
stroke: "currentColor",
|
|
2058
|
+
strokeWidth,
|
|
2059
|
+
strokeLinecap: "round",
|
|
2060
|
+
strokeLinejoin: "round",
|
|
2061
|
+
"aria-hidden": "true",
|
|
2062
|
+
...rest,
|
|
2063
|
+
children: [
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("path", { d: "m21 21-4.3-4.3" })
|
|
2066
|
+
]
|
|
2067
|
+
}
|
|
2068
|
+
);
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
// src/components/icons/plus/index.tsx
|
|
2072
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2073
|
+
function PlusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2075
|
+
"svg",
|
|
2076
|
+
{
|
|
2077
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2078
|
+
width: size3,
|
|
2079
|
+
height: size3,
|
|
2080
|
+
viewBox: "0 0 24 24",
|
|
2081
|
+
fill: "none",
|
|
2082
|
+
stroke: "currentColor",
|
|
2083
|
+
strokeWidth,
|
|
2084
|
+
strokeLinecap: "round",
|
|
2085
|
+
strokeLinejoin: "round",
|
|
2086
|
+
"aria-hidden": "true",
|
|
2087
|
+
...rest,
|
|
2088
|
+
children: [
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M5 12h14" }),
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M12 5v14" })
|
|
2091
|
+
]
|
|
2092
|
+
}
|
|
2093
|
+
);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
// src/components/icons/minus/index.tsx
|
|
2097
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2098
|
+
function MinusIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2100
|
+
"svg",
|
|
2101
|
+
{
|
|
2102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2103
|
+
width: size3,
|
|
2104
|
+
height: size3,
|
|
2105
|
+
viewBox: "0 0 24 24",
|
|
2106
|
+
fill: "none",
|
|
2107
|
+
stroke: "currentColor",
|
|
2108
|
+
strokeWidth,
|
|
2109
|
+
strokeLinecap: "round",
|
|
2110
|
+
strokeLinejoin: "round",
|
|
2111
|
+
"aria-hidden": "true",
|
|
2112
|
+
...rest,
|
|
2113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { d: "M5 12h14" })
|
|
2114
|
+
}
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
// src/components/icons/more-horizontal/index.tsx
|
|
2119
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2120
|
+
function MoreHorizontalIcon({ size: size3 = 20, strokeWidth = 1.75, ...rest }) {
|
|
2121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2122
|
+
"svg",
|
|
2123
|
+
{
|
|
2124
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2125
|
+
width: size3,
|
|
2126
|
+
height: size3,
|
|
2127
|
+
viewBox: "0 0 24 24",
|
|
2128
|
+
fill: "none",
|
|
2129
|
+
stroke: "currentColor",
|
|
2130
|
+
strokeWidth,
|
|
2131
|
+
strokeLinecap: "round",
|
|
2132
|
+
strokeLinejoin: "round",
|
|
2133
|
+
"aria-hidden": "true",
|
|
2134
|
+
...rest,
|
|
2135
|
+
children: [
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("circle", { cx: "5", cy: "12", r: "1" })
|
|
2139
|
+
]
|
|
2140
|
+
}
|
|
2141
|
+
);
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
// src/theme/typography.css.ts
|
|
2145
|
+
var text = { eyebrow: "typography_text_eyebrow__1wmlzy0", display: "typography_text_display__1wmlzy1", h1: "typography_text_h1__1wmlzy2", h2: "typography_text_h2__1wmlzy3", h3: "typography_text_h3__1wmlzy4", h4: "typography_text_h4__1wmlzy5", body: "typography_text_body__1wmlzy6", lead: "typography_text_lead__1wmlzy7", small: "typography_text_small__1wmlzy8", caption: "typography_text_caption__1wmlzy9", code: "typography_text_code__1wmlzya", blackletter: "typography_text_blackletter__1wmlzyb" };
|
|
2146
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2147
|
+
0 && (module.exports = {
|
|
2148
|
+
Accordion,
|
|
2149
|
+
Alert,
|
|
2150
|
+
AppBar,
|
|
2151
|
+
Avatar,
|
|
2152
|
+
Badge,
|
|
2153
|
+
Breadcrumbs,
|
|
2154
|
+
Button,
|
|
2155
|
+
Card,
|
|
2156
|
+
CheckIcon,
|
|
2157
|
+
Checkbox,
|
|
2158
|
+
ChevronDownIcon,
|
|
2159
|
+
ChevronLeftIcon,
|
|
2160
|
+
ChevronRightIcon,
|
|
2161
|
+
ChevronUpIcon,
|
|
2162
|
+
Chip,
|
|
2163
|
+
CircleCheckIcon,
|
|
2164
|
+
CircleXIcon,
|
|
2165
|
+
Dialog,
|
|
2166
|
+
Divider,
|
|
2167
|
+
EyeIcon,
|
|
2168
|
+
EyeOffIcon,
|
|
2169
|
+
IconButton,
|
|
2170
|
+
InfoIcon,
|
|
2171
|
+
ListItem,
|
|
2172
|
+
Menu,
|
|
2173
|
+
MinusIcon,
|
|
2174
|
+
MoreHorizontalIcon,
|
|
2175
|
+
Pagination,
|
|
2176
|
+
PlusIcon,
|
|
2177
|
+
Progress,
|
|
2178
|
+
Radio,
|
|
2179
|
+
SearchIcon,
|
|
2180
|
+
Select,
|
|
2181
|
+
Slider,
|
|
2182
|
+
Snackbar,
|
|
2183
|
+
Stepper,
|
|
2184
|
+
Switch,
|
|
2185
|
+
Table,
|
|
2186
|
+
Tabs,
|
|
2187
|
+
TextField,
|
|
2188
|
+
ThemeProvider,
|
|
2189
|
+
Tooltip,
|
|
2190
|
+
TriangleAlertIcon,
|
|
2191
|
+
XIcon,
|
|
2192
|
+
modeNames,
|
|
2193
|
+
schemaNames,
|
|
2194
|
+
text,
|
|
2195
|
+
theme,
|
|
2196
|
+
themes,
|
|
2197
|
+
useTheme,
|
|
2198
|
+
useToggle
|
|
2199
|
+
});
|