visits-style 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,1244 +1 @@
1
- 'use strict';
2
-
3
- var clsx8 = require('clsx');
4
- var react = require('react');
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react$1 = require('@floating-ui/react');
7
- var reactDom = require('react-dom');
8
-
9
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
-
11
- var clsx8__default = /*#__PURE__*/_interopDefault(clsx8);
12
-
13
- // src/index.ts
14
-
15
- // src/utils/merge.ts
16
- function merge(a, b) {
17
- if (!b) return a;
18
- return a + " " + b;
19
- }
20
- function FormLabel({ className, ...rest }) {
21
- const name = react.useMemo(() => clsx8__default.default("leading-none peer-disabled:opacity-70", className), [className]);
22
- return /* @__PURE__ */ jsxRuntime.jsx("label", { className: name, ...rest });
23
- }
24
- function Field({
25
- label,
26
- children,
27
- required,
28
- htmlFor,
29
- error,
30
- help,
31
- helpBefore,
32
- className,
33
- innerClass,
34
- ...rest
35
- }) {
36
- const labelName = react.useMemo(() => clsx8__default.default(
37
- "font-medium",
38
- required ? 'after:content-["*"] after:text-danger after:text-sm after:pl-0.5' : ""
39
- ), [required]);
40
- const wrapperName = react.useMemo(() => merge("flex flex-col space-y-2", className), [className]);
41
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperName, ...rest, children: [
42
- label ? /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { className: labelName, htmlFor, children: label }) : null,
43
- help && helpBefore ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted pb-2", children: help }) : null,
44
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: innerClass, children: cloneChildren(children, !!error) }),
45
- help && !helpBefore && !error ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: help }) : null,
46
- error ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-danger", children: error }) : null
47
- ] });
48
- }
49
- function cloneChildren(children, error) {
50
- const len = react.Children.count(children);
51
- if (!len) return null;
52
- if (len === 1) {
53
- return react.cloneElement(children, { error });
54
- }
55
- const arr = react.Children.toArray(children);
56
- arr[0] = react.cloneElement(arr[0], { error });
57
- return arr;
58
- }
59
- function InputField({ error, unstyled, className, ...rest }) {
60
- const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
61
- "flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
62
- "[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",
63
- error ? "border-danger hover:border-danger-fore" : "border-input"
64
- ), className), [className, error, unstyled]);
65
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: name, ...rest });
66
- }
67
- var Input = react.forwardRef(({
68
- className,
69
- type,
70
- error,
71
- unstyled,
72
- ...rest
73
- }, ref) => {
74
- const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
75
- "flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted",
76
- "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
77
- error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore",
78
- type === "file" ? "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground" : null
79
- ), className), [className, type, error, unstyled]);
80
- return /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type, className: name, ...rest });
81
- });
82
- Input.displayName = "Input";
83
- var Input_default = Input;
84
- var Textarea = react.forwardRef(({
85
- className,
86
- error,
87
- unstyled,
88
- ...rest
89
- }, ref) => {
90
- const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
91
- "flex rounded-md border bg-background px-3 py-2 w-full",
92
- "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
93
- error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
94
- ), className), [className, error, unstyled]);
95
- return /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref, className: name, ...rest });
96
- });
97
- Textarea.displayName = "Textarea";
98
- var Textarea_default = Textarea;
99
- function Check(props) {
100
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z", fill: "currentColor" }) });
101
- }
102
- function Indeterminate() {
103
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "20", height: "3", y: "13.5", x: "4.5", fill: "currentColor", stroke: "none", rx: "2" }) });
104
- }
105
- function Checkbox({
106
- checked,
107
- indeterminate,
108
- className,
109
- id,
110
- name,
111
- onChange,
112
- value,
113
- ...rest
114
- }) {
115
- const innerClass = react.useMemo(() => merge(clsx8__default.default(
116
- "inline-flex justify-center items-center border w-4.5 h-4.5 rounded",
117
- "cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
118
- checked || indeterminate ? "bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input" : "border-input not-disabled:hover:border-input-fore"
119
- ), className), [checked, indeterminate, className]);
120
- const handleChange = () => {
121
- if (rest.disabled) return;
122
- onChange?.(!checked);
123
- };
124
- return /* @__PURE__ */ jsxRuntime.jsxs(
125
- "button",
126
- {
127
- type: "button",
128
- role: "checkbox",
129
- id: id || name,
130
- className: innerClass,
131
- onClick: handleChange,
132
- "aria-checked": checked,
133
- ...rest,
134
- children: [
135
- checked ? /* @__PURE__ */ jsxRuntime.jsx(Check, {}) : null,
136
- indeterminate && !checked ? /* @__PURE__ */ jsxRuntime.jsx(Indeterminate, {}) : null,
137
- /* @__PURE__ */ jsxRuntime.jsx(
138
- "input",
139
- {
140
- type: "checkbox",
141
- "aria-hidden": "true",
142
- name,
143
- checked,
144
- value,
145
- onChange: handleChange,
146
- disabled: rest.disabled,
147
- style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
148
- }
149
- )
150
- ]
151
- }
152
- );
153
- }
154
-
155
- // src/utils/isClient.ts
156
- var isClient_default = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
157
-
158
- // src/hooks/useIsomorphicLayoutEffect.ts
159
- var useIsomorphicLayoutEffect_default = isClient_default ? react.useLayoutEffect : react.useEffect;
160
-
161
- // src/components/Portal/index.tsx
162
- function Portal({ children, container, disabled }) {
163
- const [mountNode, setMountNode] = react.useState(null);
164
- useIsomorphicLayoutEffect_default(() => {
165
- if (!container) {
166
- let dom = document.getElementById("visits-style-portals");
167
- if (!dom) {
168
- dom = document.createElement("div");
169
- dom.id = "visits-style-portals";
170
- document.body.appendChild(dom);
171
- }
172
- return setMountNode(dom);
173
- }
174
- setMountNode(container);
175
- }, [container]);
176
- if (disabled || !mountNode) return null;
177
- return reactDom.createPortal(children, mountNode);
178
- }
179
-
180
- // src/utils/stopPropagation.ts
181
- function stopPropagation(e) {
182
- if (!e) return;
183
- e.stopPropagation();
184
- e.preventDefault();
185
- }
186
- var defaultTimeout = { open: 150, close: 75 };
187
- var Popover = react.forwardRef(({
188
- position,
189
- label,
190
- children,
191
- color = "background",
192
- disabled,
193
- offset = { x: 0, y: 6 },
194
- onOpen,
195
- onClose,
196
- onManualClose,
197
- timeout = defaultTimeout,
198
- unstyled,
199
- zIndex = 9996,
200
- role,
201
- ...rest
202
- }, ref) => {
203
- const [open, setOpen] = react.useState(false);
204
- const nodeId = react$1.useId();
205
- const openRef = react.useRef(onOpen);
206
- const closeRef = react.useRef(onClose);
207
- const { refs, floatingStyles, context } = react$1.useFloating({
208
- nodeId,
209
- placement: position,
210
- middleware: [
211
- react$1.shift(),
212
- react$1.flip({ fallbackAxisSideDirection: "end" }),
213
- react$1.offset({ mainAxis: offset.y, crossAxis: offset.x })
214
- ],
215
- open,
216
- onOpenChange: (value) => {
217
- if (value) {
218
- openRef.current?.(refs.reference.current, refs.floating.current);
219
- } else {
220
- closeRef.current?.(refs.reference.current, refs.floating.current);
221
- }
222
- setOpen(value);
223
- },
224
- whileElementsMounted: react$1.autoUpdate
225
- });
226
- const { isMounted, styles } = react$1.useTransitionStyles(context, {
227
- duration: timeout,
228
- initial({ side }) {
229
- let transform = "";
230
- if (side === "top") {
231
- transform = "translateY(5%) scale(0.95)";
232
- } else if (side === "bottom") {
233
- transform = "translateY(-5%) scale(0.95)";
234
- } else if (side === "left") {
235
- transform = "translateX(5%) scale(0.95)";
236
- } else {
237
- transform = "translateX(-5%) scale(0.95)";
238
- }
239
- return { opacity: 0, transform };
240
- }
241
- });
242
- const handleBlur = react.useCallback((e) => {
243
- stopPropagation(e);
244
- if (onManualClose) return onManualClose();
245
- setOpen(false);
246
- closeRef.current?.(refs.reference.current, refs.floating.current);
247
- }, [onManualClose]);
248
- react.useEffect(() => {
249
- if (disabled && open) return setOpen(false);
250
- }, [disabled, open]);
251
- react.useImperativeHandle(ref, () => ({
252
- open: () => {
253
- setOpen(true);
254
- openRef.current?.(refs.reference.current, refs.floating.current);
255
- },
256
- close: () => {
257
- setOpen(false);
258
- closeRef.current?.(refs.reference.current, refs.floating.current);
259
- }
260
- // eslint-disable-next-line react-hooks/exhaustive-deps
261
- }), []);
262
- const { getFloatingProps, getReferenceProps } = react$1.useInteractions([
263
- react$1.useClick(context, { enabled: !disabled })
264
- ]);
265
- openRef.current = onOpen;
266
- closeRef.current = onClose;
267
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
268
- react.cloneElement(react.Children.only(label), getReferenceProps({
269
- ref: refs.setReference,
270
- tabIndex: 0,
271
- role: "button",
272
- "aria-expanded": open,
273
- disabled,
274
- onClick: stopPropagation
275
- })),
276
- /* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: disabled || !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.FloatingOverlay, { "data-testid": "vs-popover-shadow", onClick: handleBlur, style: { zIndex }, autoFocus: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: role || "region", ref: refs.setFloating, style: floatingStyles, children: /* @__PURE__ */ jsxRuntime.jsx(
277
- PopoverContent,
278
- {
279
- unstyled,
280
- styles,
281
- ...getFloatingProps({ ...rest, onClick: stopPropagation }),
282
- children
283
- }
284
- ) }) }) })
285
- ] });
286
- });
287
- Popover.displayName = "Popover";
288
- var Popover_default = Popover;
289
- var PopoverContent = react.forwardRef(({
290
- className,
291
- unstyled,
292
- styles,
293
- style = {},
294
- ...rest
295
- }, ref) => {
296
- const popoverName = react.useMemo(() => clsx8__default.default(
297
- "z-20 w-auto h-auto outline-none transition-transform ease-in-out",
298
- unstyled ? null : "border border-accent rounded-md shadow-lg p-1 bg-background",
299
- className
300
- ), [className, unstyled]);
301
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: popoverName, style: { ...styles, ...style }, ...rest });
302
- });
303
- PopoverContent.displayName = "PopoverContent";
304
- function ChevronDown(props) {
305
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
306
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.7 14.8 7 9.8a.5.5 0 0 1 0-.7c.2-.2.5-.2.7 0l4.5 5c.2.2.2.6 0 .8-.1.2-.4.2-.6 0Z", fill: "currentColor" }),
307
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z", fill: "currentColor" })
308
- ] });
309
- }
310
- function Close(props) {
311
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
312
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M26 26l-12.5-12.5L26 1" }),
313
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 26l12.5-12.5L1 1" })
314
- ] }) });
315
- }
316
- function Select({
317
- className,
318
- placeholder = "",
319
- options = [],
320
- error,
321
- unstyled,
322
- disabled,
323
- value,
324
- maxHeight = 408,
325
- arrow,
326
- onChange,
327
- onClear,
328
- renderItem,
329
- ...rest
330
- }) {
331
- const ref = react.useRef(null);
332
- const [width, setWidth] = react.useState(0);
333
- const btnName = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
334
- "flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer",
335
- "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
336
- error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
337
- ), className), [className, error, unstyled]);
338
- const isMultiple = react.useMemo(() => Array.isArray(value), []);
339
- const handleChange = react.useCallback((val) => {
340
- onChange?.(val);
341
- if (!isMultiple) ref.current?.close();
342
- }, [onChange, isMultiple]);
343
- const isSelected = react.useCallback((item) => {
344
- if (Array.isArray(value)) return value.indexOf(item) > -1;
345
- return value === item;
346
- }, [value]);
347
- const optionMap = react.useMemo(() => {
348
- const map = {};
349
- const items = options.filter((item) => typeof item !== "string");
350
- for (let i = 0, len = items.length; i < len; i += 1) {
351
- const item = items[i];
352
- map[`${item.value}`] = item.label;
353
- }
354
- return map;
355
- }, [options]);
356
- const selectedLabel = react.useMemo(() => {
357
- if (!value) return placeholder;
358
- if (Array.isArray(value)) {
359
- if (!value.length) return placeholder;
360
- const sorted = [...value].sort();
361
- const arr = [];
362
- for (let i = 0, len = sorted.length; i < len; i += 1) {
363
- arr[i] = optionMap[`${sorted[i]}`] || "";
364
- }
365
- return arr.filter(Boolean).join(",") || placeholder;
366
- }
367
- return optionMap[`${value}`] || placeholder;
368
- }, [placeholder, value, optionMap]);
369
- const isEmpty = selectedLabel === placeholder;
370
- const btnLabelClass = react.useMemo(() => clsx8__default.default(
371
- "overflow-hidden overflow-ellipsis whitespace-nowrap",
372
- isEmpty ? "text-muted" : "text-text"
373
- ), [isEmpty]);
374
- const Arrow = react.useMemo(() => {
375
- if (arrow) return arrow;
376
- return /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { className: "absolute right-0 text-muted size-5" });
377
- }, [arrow]);
378
- const handleRender = react.useCallback((item, index) => {
379
- if (renderItem) {
380
- if (typeof item === "string") {
381
- return renderItem(item, { index, selected: false, onChange: () => {
382
- } });
383
- }
384
- return renderItem(item, {
385
- index,
386
- selected: isSelected(item.value),
387
- onChange: () => handleChange(item.value)
388
- });
389
- }
390
- if (typeof item === "string") {
391
- return /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "font-medium py-1 px-2 text-muted", children: item }, `optionheader-${index}`);
392
- }
393
- return /* @__PURE__ */ jsxRuntime.jsx(
394
- SelectItem,
395
- {
396
- selected: isSelected(item.value),
397
- onChange: handleChange,
398
- ...item
399
- },
400
- item.label
401
- );
402
- }, [renderItem, handleChange, isSelected]);
403
- return /* @__PURE__ */ jsxRuntime.jsx(
404
- Popover_default,
405
- {
406
- label: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: btnName, disabled, ...rest, children: [
407
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: btnLabelClass, children: selectedLabel }),
408
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center pl-8 pr-3 space-x-2", children: [
409
- onClear && !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
410
- "div",
411
- {
412
- tabIndex: -1,
413
- role: "button",
414
- className: "size-6 p-1.5 rounded hover:bg-accent",
415
- "aria-label": "clear selected values",
416
- onKeyDown: (e) => {
417
- if (e.key !== "Enter" && e.key !== "Space") return;
418
- onClear();
419
- },
420
- onClick: (e) => {
421
- e.stopPropagation();
422
- onClear();
423
- },
424
- children: /* @__PURE__ */ jsxRuntime.jsx(Close, {})
425
- }
426
- ) : null,
427
- Arrow
428
- ] })
429
- ] }),
430
- ref,
431
- onOpen: (elem) => setWidth(elem?.getBoundingClientRect().width || 0),
432
- disabled,
433
- children: /* @__PURE__ */ jsxRuntime.jsx(
434
- "ul",
435
- {
436
- className: "overflow-y-auto flex flex-col",
437
- role: "listbox",
438
- style: { minWidth: width, maxWidth: "calc(100vw - 3rem)", maxHeight },
439
- children: options.map(handleRender)
440
- }
441
- )
442
- }
443
- );
444
- }
445
- function SelectItem({ className, value, label, selected, onChange }) {
446
- const name = react.useMemo(() => clsx8__default.default(
447
- "flex items-center w-full hover:bg-accent rounded p-1",
448
- className
449
- ), [className]);
450
- return /* @__PURE__ */ jsxRuntime.jsxs(
451
- "button",
452
- {
453
- type: "button",
454
- role: "option",
455
- className: name,
456
- "aria-selected": selected,
457
- onClick: () => onChange?.(value),
458
- children: [
459
- selected ? /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "w-5 h-5 mr-1" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5 h-1 mr-1" }),
460
- label
461
- ]
462
- }
463
- );
464
- }
465
- function Radio({ checked, className, id, name, onChange, value, ...rest }) {
466
- const innerClass = react.useMemo(() => clsx8__default.default(
467
- "relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full",
468
- "cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",
469
- checked ? "[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input" : "",
470
- className
471
- ), [className, checked]);
472
- const handleChange = () => {
473
- if (rest.disabled) return;
474
- onChange?.(!checked);
475
- };
476
- return /* @__PURE__ */ jsxRuntime.jsxs(
477
- "button",
478
- {
479
- type: "button",
480
- role: "radio",
481
- id: id || name,
482
- className: innerClass,
483
- onClick: handleChange,
484
- "aria-checked": checked,
485
- ...rest,
486
- children: [
487
- /* @__PURE__ */ jsxRuntime.jsx(
488
- "i",
489
- {
490
- className: "block w-2.5 h-2.5 rounded-full transition-transform",
491
- style: { transform: checked ? "" : "scale(0.8)", opacity: checked ? 1 : 0 }
492
- }
493
- ),
494
- /* @__PURE__ */ jsxRuntime.jsx(
495
- "input",
496
- {
497
- type: "radio",
498
- "aria-hidden": "true",
499
- name,
500
- checked,
501
- value,
502
- onChange: handleChange,
503
- disabled: rest.disabled,
504
- style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
505
- }
506
- )
507
- ]
508
- }
509
- );
510
- }
511
- var Switch = react.forwardRef(({
512
- className,
513
- checked,
514
- onChange,
515
- value,
516
- id,
517
- name,
518
- ...rest
519
- }, ref) => {
520
- const buttonName = react.useMemo(() => merge(clsx8__default.default(
521
- "inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
522
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
523
- "w-11",
524
- checked ? "bg-primary" : "bg-input"
525
- ), className), [className, checked]);
526
- const pointerName = react.useMemo(() => merge(
527
- "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
528
- className
529
- ), [className]);
530
- const handleChange = () => {
531
- if (rest.disabled) return;
532
- onChange?.(!checked);
533
- };
534
- return /* @__PURE__ */ jsxRuntime.jsxs(
535
- "button",
536
- {
537
- type: "button",
538
- role: "switch",
539
- id: id || name,
540
- className: buttonName,
541
- onClick: handleChange,
542
- "aria-checked": checked,
543
- ...rest,
544
- children: [
545
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: pointerName, style: { transform: checked ? "translateX(100%)" : "" } }),
546
- /* @__PURE__ */ jsxRuntime.jsx(
547
- "input",
548
- {
549
- ref,
550
- type: "checkbox",
551
- "aria-hidden": "true",
552
- name,
553
- checked,
554
- value,
555
- onChange: handleChange,
556
- disabled: rest.disabled,
557
- style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
558
- }
559
- )
560
- ]
561
- }
562
- );
563
- });
564
- Switch.displayName = "Switch";
565
- var Switch_default = Switch;
566
- function Accordion({ header, show, children, timeout = 300, ...rest }) {
567
- const ref = react.useRef(null);
568
- const prevHeight = react.useRef(0);
569
- const timeoutRef = react.useRef(0);
570
- const init = react.useRef(true);
571
- react.useEffect(() => {
572
- timeoutRef.current = timeout;
573
- }, [timeout]);
574
- useIsomorphicLayoutEffect_default(() => {
575
- if (!ref.current) return;
576
- ref.current.style.overflow = "hidden";
577
- ref.current.style.opacity = "1";
578
- if (init.current) {
579
- init.current = false;
580
- ref.current.style.height = show ? "auto" : "0px";
581
- if (show) {
582
- window.requestAnimationFrame(() => {
583
- if (!ref.current) return;
584
- prevHeight.current = ref.current.offsetHeight;
585
- });
586
- } else {
587
- window.requestAnimationFrame(() => {
588
- if (!ref.current) return;
589
- ref.current.style.height = "auto";
590
- prevHeight.current = ref.current.offsetHeight;
591
- ref.current.style.height = "0px";
592
- });
593
- ref.current.style.opacity = "0";
594
- }
595
- return;
596
- }
597
- if (!show) {
598
- ref.current.style.height = `${prevHeight.current}px`;
599
- }
600
- const frameIds = [];
601
- frameIds[0] = window.requestAnimationFrame(() => {
602
- frameIds[1] = window.requestAnimationFrame(() => {
603
- if (!ref.current) return;
604
- ref.current.style.height = `${show ? prevHeight.current : 0}px`;
605
- ref.current.style.opacity = show ? "1" : "0";
606
- });
607
- });
608
- let timeoutId;
609
- const timeoutCallback = () => {
610
- if (!ref.current) return;
611
- if (show) {
612
- ref.current.style.height = "auto";
613
- ref.current.style.overflow = "";
614
- ref.current.style.opacity = "";
615
- window.requestAnimationFrame(() => {
616
- if (ref.current) {
617
- prevHeight.current = ref.current.offsetHeight;
618
- }
619
- });
620
- } else {
621
- ref.current.style.height = "0px";
622
- }
623
- };
624
- if (timeoutRef.current === 0) {
625
- timeoutCallback();
626
- } else {
627
- timeoutId = window.setTimeout(timeoutCallback, timeoutRef.current);
628
- }
629
- return () => {
630
- frameIds.forEach(window.cancelAnimationFrame);
631
- if (timeoutId) window.clearTimeout(timeoutId);
632
- };
633
- }, [show]);
634
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...rest, children: [
635
- header,
636
- /* @__PURE__ */ jsxRuntime.jsx(
637
- "div",
638
- {
639
- className: "transition-all ease-in-out overflow-hidden",
640
- role: "region",
641
- "aria-hidden": !show,
642
- ref,
643
- style: { transitionDuration: `${timeout}ms` },
644
- children
645
- }
646
- )
647
- ] });
648
- }
649
- var Tooltip = react.forwardRef(({
650
- children,
651
- position = "bottom",
652
- label,
653
- className,
654
- timeout = 150,
655
- offset = { x: 0, y: 6 },
656
- clientPoint = false,
657
- disabled
658
- }, ref) => {
659
- const [open, setOpen] = react.useState(false);
660
- const nodeId = react$1.useId();
661
- const { refs, floatingStyles, context } = react$1.useFloating({
662
- nodeId,
663
- open,
664
- placement: position,
665
- middleware: [
666
- react$1.shift(),
667
- react$1.flip(),
668
- react$1.offset({ mainAxis: offset.y, crossAxis: offset.x })
669
- ],
670
- whileElementsMounted: disabled ? undefined : react$1.autoUpdate,
671
- onOpenChange: setOpen
672
- });
673
- const { getReferenceProps, getFloatingProps } = react$1.useInteractions([
674
- react$1.useHover(context, { enabled: !disabled }),
675
- react$1.useClientPoint(context, { enabled: clientPoint })
676
- ]);
677
- const { isMounted, styles } = react$1.useTransitionStyles(context, {
678
- duration: timeout,
679
- initial: { opacity: 0, transform: "scale(0.8)" }
680
- });
681
- react.useImperativeHandle(ref, () => ({
682
- floating: refs.floating,
683
- reference: refs.reference,
684
- open: () => setOpen(true),
685
- close: () => setOpen(false)
686
- }));
687
- const child = typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children;
688
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
689
- react.cloneElement(react.Children.only(child), {
690
- ref: refs.setReference,
691
- ...getReferenceProps()
692
- }),
693
- /* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: disabled || !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tooltip", className: "z-[9999]", ref: refs.setFloating, ...getFloatingProps({ style: floatingStyles }), children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { className, style: styles, children: label }) }) })
694
- ] });
695
- });
696
- var Tooltip_default = Tooltip;
697
- var TooltipContent = react.forwardRef(({
698
- className,
699
- custom,
700
- ...rest
701
- }, ref) => {
702
- const tooltipName = react.useMemo(() => clsx8__default.default(
703
- "relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",
704
- custom ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background",
705
- className
706
- ), [className, custom]);
707
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: tooltipName, ...rest });
708
- });
709
- function varientButton({ variant, size }) {
710
- return clsx8__default.default(
711
- "inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer",
712
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
713
- "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",
714
- {
715
- "bg-primary text-inverted hover:bg-primary-fore": !variant || variant === "primary",
716
- "bg-info text-inverted hover:bg-info-fore": variant === "info",
717
- "bg-warn text-inverted hover:bg-warn-fore": variant === "warn",
718
- "bg-danger text-inverted hover:bg-danger-fore": variant === "danger",
719
- "hover:bg-accent": variant === "ghost",
720
- "hover:underline": variant === "link",
721
- "border border-input hover:bg-accent": variant === "outline"
722
- },
723
- {
724
- "px-2 py-1": !size,
725
- "p-1.5": size === "icon"
726
- }
727
- );
728
- }
729
- function Button({ size, variant, className, ...rest }) {
730
- const buttonClass = react.useMemo(() => clsx8__default.default(varientButton({ size, variant }), className), [size, variant, className]);
731
- return /* @__PURE__ */ jsxRuntime.jsx("button", { className: buttonClass, type: "button", ...rest });
732
- }
733
- function Dialog({
734
- open,
735
- children,
736
- timeout = 150,
737
- padding = "0.85rem",
738
- verticalAlign = "center",
739
- closeOnOverlay,
740
- closeOnEsc,
741
- onExited,
742
- className,
743
- onOpenChange,
744
- size,
745
- ...rest
746
- }) {
747
- const exitRef = react.useRef(onExited);
748
- const isTransMountedRef = react.useRef(false);
749
- const nodeId = react$1.useId();
750
- const { refs, context } = react$1.useFloating({ open, onOpenChange, nodeId });
751
- const { getFloatingProps } = react$1.useInteractions([
752
- react$1.useDismiss(context, {
753
- enabled: closeOnEsc,
754
- escapeKey: closeOnEsc,
755
- outsidePress: false
756
- })
757
- ]);
758
- const { isMounted, styles } = react$1.useTransitionStyles(context, {
759
- duration: timeout,
760
- initial: { opacity: 0, transform: "scale(0.8)" }
761
- });
762
- react.useEffect(() => {
763
- if (isTransMountedRef.current === isMounted) return;
764
- isTransMountedRef.current = isMounted;
765
- if (isMounted) return;
766
- exitRef.current?.();
767
- }, [isMounted]);
768
- const handleOverlayClose = react.useCallback(() => {
769
- if (!closeOnOverlay) return;
770
- onOpenChange?.(false);
771
- }, [onOpenChange, closeOnOverlay]);
772
- exitRef.current = onExited;
773
- const overlayClass = react.useMemo(() => clsx8__default.default("grid bg-backdrop z-40 justify-items-center", {
774
- "place-items-start items-start": verticalAlign === "start",
775
- "place-items-end": verticalAlign === "end",
776
- "place-items-center": verticalAlign === "center" || !verticalAlign
777
- }), [verticalAlign]);
778
- const dialogClass = react.useMemo(() => merge("transition ease-in-out", className), [className]);
779
- return /* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx(
780
- react$1.FloatingOverlay,
781
- {
782
- className: overlayClass,
783
- "data-testid": "vs-dialog-overlay",
784
- onClick: handleOverlayClose,
785
- style: { padding, opacity: styles.opacity },
786
- lockScroll: true,
787
- children: /* @__PURE__ */ jsxRuntime.jsx(
788
- DialogContent,
789
- {
790
- ref: refs.setFloating,
791
- className: dialogClass,
792
- role: "dialog",
793
- size,
794
- ...getFloatingProps({ ...rest, style: styles, onClick: stopPropagation }),
795
- children
796
- }
797
- )
798
- }
799
- ) });
800
- }
801
- var DialogContent = react.forwardRef(({
802
- size,
803
- className,
804
- ...rest
805
- }, ref) => {
806
- const dialogClass = react.useMemo(() => clsx8__default.default(
807
- size ? "flex flex-col bg-background shadow-lg p-5 rounded" : null,
808
- {
809
- "w-full max-w-sm": size === "small",
810
- "w-full max-w-lg": size === "medium",
811
- "w-full max-w-2xl": size === "large"
812
- },
813
- className
814
- ), [size, className]);
815
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: dialogClass, ...rest });
816
- });
817
- DialogContent.displayName = "DialogContent";
818
- var defaultTimeout2 = { open: 300, close: 150 };
819
- function Sheet({ open, timeout = defaultTimeout2, onOpenChange, position = "right", overlay, ...rest }) {
820
- const nodeId = react$1.useId();
821
- const { refs, context } = react$1.useFloating({ open, onOpenChange, nodeId });
822
- const { isMounted, styles } = react$1.useTransitionStyles(context, {
823
- duration: timeout,
824
- initial() {
825
- let transform = "translateX(75%)";
826
- if (position === "left") {
827
- transform = "translateX(-75%)";
828
- } else if (position === "top") {
829
- transform = "translateY(-75%)";
830
- } else if (position === "bottom") {
831
- transform = "translateY(75%)";
832
- }
833
- return { opacity: 0, transform };
834
- }
835
- });
836
- const name = react.useMemo(() => clsx8__default.default(
837
- "fixed transition-transform z-30",
838
- {
839
- "top-0 right-0 h-full max-h-screen": position === "right",
840
- "top-0 left-0 h-full max-h-screen": position === "left",
841
- "top-0 left-0 right-0 w-full max-w-screen": position === "top",
842
- "bottom-0 left-0 right-0 w-full max-w-screen": position === "bottom"
843
- }
844
- ), [position]);
845
- return /* @__PURE__ */ jsxRuntime.jsxs(Portal, { disabled: !isMounted, children: [
846
- overlay ? /* @__PURE__ */ jsxRuntime.jsx(
847
- react$1.FloatingOverlay,
848
- {
849
- className: "bg-backdrop",
850
- style: { opacity: styles.opacity },
851
- onClick: () => onOpenChange?.(false)
852
- }
853
- ) : null,
854
- /* @__PURE__ */ jsxRuntime.jsx(
855
- "div",
856
- {
857
- ref: refs.setFloating,
858
- className: name,
859
- role: "dialog",
860
- style: styles,
861
- children: /* @__PURE__ */ jsxRuntime.jsx(SheetContent, { ...rest })
862
- }
863
- )
864
- ] });
865
- }
866
- function SheetContent({ className, unstyled, ...rest }) {
867
- const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
868
- "relative bg-background min-w-full min-h-full border border-input shadow-lg"
869
- ), className), [unstyled, className]);
870
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: name, ...rest });
871
- }
872
- function Approved(props) {
873
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
874
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z", fill: "none" }),
875
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z", fill: "currentColor" }),
876
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11.5 18.5-3.9-4L6 16l5.6 5.6L23.2 10l-1.7-1.6z", fill: "currentColor" })
877
- ] });
878
- }
879
- function Alert(props) {
880
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 32 32", ...props, children: [
881
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 0C7.16 0 0 7.16 0 16C0 24.84 7.16 32 16 32C24.84 32 32 24.84 32 16C32 7.16 24.84 0 16 0ZM16 31C7.73 31 1 24.27 1 16C1 7.73 7.73 1 16 1C24.27 1 31 7.73 31 16C31 24.27 24.27 31 16 31Z", fill: "currentColor" }),
882
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.5 19.55V8.54999C15.5 8.26999 15.72 8.04999 16 8.04999C16.28 8.04999 16.5 8.26999 16.5 8.54999V19.55C16.5 19.83 16.28 20.05 16 20.05C15.72 20.05 15.5 19.83 15.5 19.55Z", fill: "currentColor" }),
883
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z", fill: "currentColor" })
884
- ] });
885
- }
886
- function Caution(props) {
887
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 52 45", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z", fill: "currentColor" }) });
888
- }
889
- function Spinner({ size = 20, label = "Loading...", ...rest }) {
890
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", ...rest, children: [
891
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { "aria-hidden": "true", className: "text-accent animate-spin fill-primary", width: size, height: size, viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
892
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z", fill: "currentColor" }),
893
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z", fill: "currentFill" })
894
- ] }),
895
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label })
896
- ] });
897
- }
898
- function ToastItem({ type, label, message }) {
899
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2", children: [
900
- type ? /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "mr-2", children: [
901
- type === "success" ? /* @__PURE__ */ jsxRuntime.jsx(Approved, { className: "text-primary size-5" }) : null,
902
- type === "info" ? /* @__PURE__ */ jsxRuntime.jsx(Alert, { className: "text-info size-5" }) : null,
903
- type === "error" ? /* @__PURE__ */ jsxRuntime.jsx(Alert, { className: "text-danger size-5" }) : null,
904
- type === "warn" ? /* @__PURE__ */ jsxRuntime.jsx(Caution, { className: "text-warn size-5" }) : null,
905
- type === "loading" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 20 }) : null
906
- ] }) : null,
907
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
908
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium leading-none", children: label }),
909
- message ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: message }) : null
910
- ] })
911
- ] });
912
- }
913
-
914
- // src/components/Toast/observer.ts
915
- function noop() {
916
- }
917
- var ToastObserver = class {
918
- /** システムで1つしか存在しない前提とする */
919
- notify = noop;
920
- lastId = 0;
921
- /** internal use only */
922
- subscribe = (callback) => {
923
- this.notify = callback;
924
- return () => {
925
- this.notify = noop;
926
- };
927
- };
928
- add = (label, config = {}) => {
929
- this.lastId += 1;
930
- const id = `${this.lastId}`;
931
- this.notify({ id, type: "add", config: { id, label, ...config } });
932
- return id;
933
- };
934
- /** 表示中のtoastを修正します。promiseのロード状態を表示することなどに使います */
935
- update = (id, config) => {
936
- this.notify({ id, type: "update", config });
937
- };
938
- remove = (id) => {
939
- this.notify({ id, type: "remove" });
940
- };
941
- clear = () => {
942
- this.lastId = 0;
943
- };
944
- };
945
- var observer = new ToastObserver();
946
- var observer_default = observer;
947
- function ToastContainer({
948
- id,
949
- type,
950
- index,
951
- duration,
952
- className,
953
- children,
954
- inverted,
955
- timeout = 250,
956
- max = 3
957
- }) {
958
- const isPrevMountedRef = react.useRef(false);
959
- const [open, setOpen] = react.useState(false);
960
- const { context, refs } = react$1.useFloating({ open, onOpenChange: setOpen, nodeId: id });
961
- const { isMounted, styles } = react$1.useTransitionStyles(context, {
962
- duration: timeout,
963
- initial: { opacity: 0, transform: `translateY(${inverted ? "" : "-"}50%)` }
964
- });
965
- react.useLayoutEffect(() => {
966
- setOpen(index <= max);
967
- }, [index, max]);
968
- react.useEffect(() => {
969
- if (isPrevMountedRef.current === isMounted) return;
970
- if (!isMounted) {
971
- observer_default.remove(id);
972
- }
973
- isPrevMountedRef.current = isMounted;
974
- }, [isMounted, id]);
975
- react.useEffect(() => {
976
- if (!duration) return;
977
- const tId = window.setTimeout(() => setOpen(false), duration);
978
- return () => window.clearTimeout(tId);
979
- }, [duration, id]);
980
- const handleClose = react.useCallback(() => {
981
- if (type === "loading") return;
982
- setOpen(false);
983
- }, [type]);
984
- const name = react.useMemo(() => clsx8__default.default(
985
- "relative flex w-fit transition-transform ease-in-out cursor-pointer",
986
- className
987
- ), [className]);
988
- if (!isMounted) return null;
989
- return /* @__PURE__ */ jsxRuntime.jsx(
990
- "li",
991
- {
992
- role: "log",
993
- tabIndex: -1,
994
- ref: refs.setFloating,
995
- className: name,
996
- style: styles,
997
- onClick: handleClose,
998
- children
999
- }
1000
- );
1001
- }
1002
- function Toast({
1003
- className,
1004
- margin = 16,
1005
- position = "top-left",
1006
- max,
1007
- ListItem = ToastItem
1008
- }) {
1009
- const style = react.useMemo(() => {
1010
- const base = { position: "fixed" };
1011
- if (position.indexOf("top") > -1) {
1012
- base.top = margin;
1013
- } else if (position.indexOf("bottom") > -1) {
1014
- base.bottom = margin;
1015
- }
1016
- if (position.indexOf("left") > -1) {
1017
- base.left = margin;
1018
- base.alignItems = "flex-start";
1019
- } else if (position.indexOf("right") > -1) {
1020
- base.right = margin;
1021
- base.alignItems = "flex-end";
1022
- } else {
1023
- base.left = "50%";
1024
- base.alignItems = "center";
1025
- base.transform = "translateX(-50%)";
1026
- }
1027
- return base;
1028
- }, [margin, position]);
1029
- const name = react.useMemo(() => clsx8__default.default(
1030
- "flex flex-col z-40 overflow-hidden",
1031
- className
1032
- ), [className]);
1033
- const isInvertedOrder = react.useMemo(() => position?.startsWith("bottom") || false, [position]);
1034
- const data = react.useRef(/* @__PURE__ */ new Map());
1035
- const [order, setOrder] = react.useState([]);
1036
- const update = react.useState(0)[1];
1037
- useIsomorphicLayoutEffect_default(() => observer_default.subscribe((payload) => {
1038
- react.startTransition(() => {
1039
- if (payload.type === "add") {
1040
- data.current.set(payload.id, payload.config);
1041
- setOrder((prev) => [...prev, payload.id]);
1042
- } else if (payload.type === "remove") {
1043
- const isDeleted = data.current.delete(payload.id);
1044
- if (!isDeleted) return;
1045
- setOrder((prev) => {
1046
- const next = new Set(prev);
1047
- if (!next.has(payload.id)) return prev;
1048
- next.delete(payload.id);
1049
- return Array.from(next);
1050
- });
1051
- } else if (payload.type === "update") {
1052
- const d = data.current.get(payload.id);
1053
- if (!d) return;
1054
- data.current.set(payload.id, { ...d, ...payload.config });
1055
- update((prev) => prev + 1);
1056
- }
1057
- });
1058
- }), []);
1059
- const size = order.length;
1060
- return /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: name, style, "aria-live": "polite", children: order.map((id, i) => {
1061
- const item = data.current.get(id);
1062
- if (!item) return null;
1063
- const { className: innerClass, duration, ...props } = item;
1064
- return /* @__PURE__ */ jsxRuntime.jsx(
1065
- ToastContainer,
1066
- {
1067
- id,
1068
- index: size - i,
1069
- className: innerClass,
1070
- duration,
1071
- inverted: isInvertedOrder,
1072
- max,
1073
- children: react.createElement(ListItem, props)
1074
- },
1075
- id
1076
- );
1077
- }) }) });
1078
- }
1079
- function Skeleton({ className, ...props }) {
1080
- const name = react.useMemo(() => merge(
1081
- "inline-block animate-pulse rounded-md bg-accent",
1082
- className
1083
- ), [className]);
1084
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: name, ...props });
1085
- }
1086
- function ButtonGroup({ className, ...rest }) {
1087
- const name = react.useMemo(() => clsx8__default.default(
1088
- "flex items-center justify-center",
1089
- "[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr",
1090
- "[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",
1091
- className
1092
- ), [className]);
1093
- return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", className: name, ...rest });
1094
- }
1095
- function Progress({ value, max, className, ...rest }) {
1096
- const percent = react.useMemo(() => value ? Math.round(value / max * 100) : 0, [value, max]);
1097
- const name = react.useMemo(() => merge("relative overflow-hidden rounded-full bg-primary", className), [className]);
1098
- return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "progressbar", className: name, "aria-valuemax": max, "aria-valuemin": 0, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
1099
- "div",
1100
- {
1101
- className: "h-full w-full flex-1 bg-input transition-all origin-right",
1102
- style: { transform: `translateX(${percent > 100 ? 100 : percent}%)` }
1103
- }
1104
- ) });
1105
- }
1106
- function Divider({ className, orientation = "horizontal", ...props }) {
1107
- const name = react.useMemo(() => merge(clsx8__default.default(
1108
- "border-0 p-0 shrink-0 bg-input",
1109
- orientation === "horizontal" ? "h-[1px] w-full" : "w-[1px] h-full"
1110
- ), className), [className, orientation]);
1111
- return /* @__PURE__ */ jsxRuntime.jsx("hr", { className: name, role: "none", ...props });
1112
- }
1113
- function IconChevronRound(props) {
1114
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
1115
- /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
1116
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
1117
- /* @__PURE__ */ jsxRuntime.jsx(
1118
- "path",
1119
- {
1120
- d: "M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",
1121
- fill: "currentColor"
1122
- }
1123
- )
1124
- ] }),
1125
- /* @__PURE__ */ jsxRuntime.jsx(
1126
- "path",
1127
- {
1128
- d: "M18.066 8.5l-7.567 6.731 7.567 6.2",
1129
- fill: "none",
1130
- stroke: "currentColor",
1131
- strokeWidth: "2"
1132
- }
1133
- )
1134
- ] });
1135
- }
1136
- function FileRound(props) {
1137
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
1138
- /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
1139
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
1140
- /* @__PURE__ */ jsxRuntime.jsx(
1141
- "path",
1142
- {
1143
- d: "M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",
1144
- fill: "currentColor"
1145
- }
1146
- )
1147
- ] }),
1148
- /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(9 7)", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1149
- /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "12", height: "16", rx: "1", stroke: "none" }),
1150
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1h10v14H1z" })
1151
- ] }),
1152
- /* @__PURE__ */ jsxRuntime.jsx(
1153
- "path",
1154
- {
1155
- fill: "currentColor",
1156
- d: "M13 11h4v1.3h-4zM13 14h4v1.3h-4zM13 17h4v1.3h-4z"
1157
- }
1158
- )
1159
- ] });
1160
- }
1161
- function Pencil(props) {
1162
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17.796", height: "17.908", viewBox: "0 0 17.796 17.908", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
1163
- "path",
1164
- {
1165
- d: "M1.254 12.674L.5 17.408l4.726-.8L17.3 4.472 13.281.5zM1.375 12.766l3.851 3.838M10.949 2.959l3.836 3.801",
1166
- fill: "none",
1167
- stroke: "currentColor"
1168
- }
1169
- ) });
1170
- }
1171
- function User(props) {
1172
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
1173
- /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1174
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "15", r: "15", stroke: "none" }),
1175
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "15", r: "14" })
1176
- ] }),
1177
- /* @__PURE__ */ jsxRuntime.jsx(
1178
- "path",
1179
- {
1180
- d: "M8 23a6.018 6.018 0 016-6h2a6.018 6.018 0 016 6zm2.6-2h8.9a4.033 4.033 0 00-3.5-2h-1.9a4.035 4.035 0 00-3.5 2zm.4-9v-1a4.012 4.012 0 014-4 4.012 4.012 0 014 4v1a4.012 4.012 0 01-4 4 4.012 4.012 0 01-4-4zm2-1v1a2.006 2.006 0 002 2 2.006 2.006 0 002-2v-1a2.006 2.006 0 00-2-2 2.006 2.006 0 00-2 2z",
1181
- fill: "currentColor"
1182
- }
1183
- )
1184
- ] });
1185
- }
1186
- function Refresh(props) {
1187
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
1188
- "path",
1189
- {
1190
- d: "M15.065 0A15.069 15.069 0 00.142 13.105a1.256 1.256 0 102.478.406c0-.027.008-.055.01-.082a12.52 12.52 0 0121.3-7.226l-2.584 2.584 7.532 1.255-1.255-7.532-1.92 1.92A15 15 0 0015.065 0zm13.7 15.589A1.255 1.255 0 0027.5 16.7a12.512 12.512 0 01-21.893 6.569l1.927-1.927L0 20.086l1.255 7.532 2.572-2.572a15.02 15.02 0 0026.16-8.023 1.256 1.256 0 00-1.064-1.423 1.273 1.273 0 00-.16-.011z",
1191
- fill: "currentColor"
1192
- }
1193
- ) });
1194
- }
1195
- function Plus(props) {
1196
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "30", height: "30", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
1197
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "16.5", y: "9", width: "14", height: "1", rx: ".5", transform: "rotate(90 16.5 9)", fill: "currentColor" }),
1198
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "15.5", width: "14", height: "1", rx: ".5", fill: "currentColor" })
1199
- ] });
1200
- }
1201
-
1202
- Object.defineProperty(exports, "clsx", {
1203
- enumerable: true,
1204
- get: function () { return clsx8__default.default; }
1205
- });
1206
- exports.Accordion = Accordion;
1207
- exports.Button = Button;
1208
- exports.ButtonGroup = ButtonGroup;
1209
- exports.Checkbox = Checkbox;
1210
- exports.Dialog = Dialog;
1211
- exports.Divider = Divider;
1212
- exports.FormField = Field;
1213
- exports.FormLabel = FormLabel;
1214
- exports.IconAlert = Alert;
1215
- exports.IconApproved = Approved;
1216
- exports.IconArrowDown = ChevronDown;
1217
- exports.IconCaution = Caution;
1218
- exports.IconCheck = Check;
1219
- exports.IconChevronRound = IconChevronRound;
1220
- exports.IconClose = Close;
1221
- exports.IconFileRound = FileRound;
1222
- exports.IconPencil = Pencil;
1223
- exports.IconPlus = Plus;
1224
- exports.IconRefresh = Refresh;
1225
- exports.IconUser = User;
1226
- exports.Input = Input_default;
1227
- exports.InputField = InputField;
1228
- exports.Placeholder = Skeleton;
1229
- exports.Popover = Popover_default;
1230
- exports.Portal = Portal;
1231
- exports.Progress = Progress;
1232
- exports.Radio = Radio;
1233
- exports.Select = Select;
1234
- exports.Sheet = Sheet;
1235
- exports.Spinner = Spinner;
1236
- exports.Switch = Switch_default;
1237
- exports.Textarea = Textarea_default;
1238
- exports.Toast = Toast;
1239
- exports.ToastItem = ToastItem;
1240
- exports.Tooltip = Tooltip_default;
1241
- exports.merge = merge;
1242
- exports.toast = observer_default;
1243
- //# sourceMappingURL=index.cjs.js.map
1244
- //# sourceMappingURL=index.cjs.js.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("clsx"),t=require("react/jsx-runtime"),r=require("react"),f=require("@floating-ui/react"),ne=require("react-dom");function k(e,n){return n?e+" "+n:e}function H({className:e,...n}){const o=r.useMemo(()=>m("leading-none peer-disabled:opacity-70",e),[e]);return t.jsx("label",{className:o,...n})}function re({label:e,children:n,required:o,htmlFor:s,error:l,help:i,helpBefore:a,className:d,innerClass:u,...x}){const p=r.useMemo(()=>m("font-medium",o?'after:content-["*"] after:text-danger after:text-sm after:pl-0.5':""),[o]),g=r.useMemo(()=>k("flex flex-col space-y-2",d),[d]);return t.jsxs("div",{className:g,...x,children:[e?t.jsx(H,{className:p,htmlFor:s,children:e}):null,i&&a?t.jsx("p",{className:"text-xs text-muted pb-2",children:i}):null,t.jsx("div",{className:u,children:oe(n,!!l)}),i&&!a&&!l?t.jsx("p",{className:"text-xs text-muted",children:i}):null,l?t.jsx("p",{className:"text-xs text-danger",children:l}):null]})}function oe(e,n){const o=r.Children.count(e);if(!o)return null;if(o===1)return r.cloneElement(e,{error:n});const s=r.Children.toArray(e);return s[0]=r.cloneElement(s[0],{error:n}),s}function se({error:e,unstyled:n,className:o,...s}){const l=r.useMemo(()=>n?o:k(m("flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted","[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",e?"border-danger hover:border-danger-fore":"border-input"),o),[o,e,n]);return t.jsx("div",{className:l,...s})}const W=r.forwardRef(({className:e,type:n,error:o,unstyled:s,...l},i)=>{const a=r.useMemo(()=>s?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",o?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore",n==="file"?"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground":null),e),[e,n,o,s]);return t.jsx("input",{ref:i,type:n,className:a,...l})});W.displayName="Input";const X=r.forwardRef(({className:e,error:n,unstyled:o,...s},l)=>{const i=r.useMemo(()=>o?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",n?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,n,o]);return t.jsx("textarea",{ref:l,className:i,...s})});X.displayName="Textarea";function D(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z",fill:"currentColor"})})}function ie(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",children:t.jsx("rect",{width:"20",height:"3",y:"13.5",x:"4.5",fill:"currentColor",stroke:"none",rx:"2"})})}function le({checked:e,indeterminate:n,className:o,id:s,name:l,onChange:i,value:a,...d}){const u=r.useMemo(()=>k(m("inline-flex justify-center items-center border w-4.5 h-4.5 rounded","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",e||n?"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input":"border-input not-disabled:hover:border-input-fore"),o),[e,n,o]),x=()=>{d.disabled||i?.(!e)};return t.jsxs("button",{type:"button",role:"checkbox",id:s||l,className:u,onClick:x,"aria-checked":e,...d,children:[e?t.jsx(D,{}):null,n&&!e?t.jsx(ie,{}):null,t.jsx("input",{type:"checkbox","aria-hidden":"true",name:l,checked:e,value:a,onChange:x,disabled:d.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const ae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=ae?r.useLayoutEffect:r.useEffect;function z({children:e,container:n,disabled:o}){const[s,l]=r.useState(null);return _(()=>{if(!n){let i=document.getElementById("visits-style-portals");return i||(i=document.createElement("div"),i.id="visits-style-portals",document.body.appendChild(i)),l(i)}l(n)},[n]),o||!s?null:ne.createPortal(e,s)}function P(e){e&&(e.stopPropagation(),e.preventDefault())}const ce={open:150,close:75},O=r.forwardRef(({position:e,label:n,children:o,color:s="background",disabled:l,offset:i={x:0,y:6},onOpen:a,onClose:d,onManualClose:u,timeout:x=ce,unstyled:p,zIndex:g=9996,role:w,...c},b)=>{const[v,y]=r.useState(!1),I=f.useId(),j=r.useRef(a),A=r.useRef(d),{refs:M,floatingStyles:S,context:F}=f.useFloating({nodeId:I,placement:e,middleware:[f.shift(),f.flip({fallbackAxisSideDirection:"end"}),f.offset({mainAxis:i.y,crossAxis:i.x})],open:v,onOpenChange:C=>{C?j.current?.(M.reference.current,M.floating.current):A.current?.(M.reference.current,M.floating.current),y(C)},whileElementsMounted:f.autoUpdate}),{isMounted:T,styles:E}=f.useTransitionStyles(F,{duration:x,initial({side:C}){let R="";return C==="top"?R="translateY(5%) scale(0.95)":C==="bottom"?R="translateY(-5%) scale(0.95)":C==="left"?R="translateX(5%) scale(0.95)":R="translateX(-5%) scale(0.95)",{opacity:0,transform:R}}}),B=r.useCallback(C=>{if(P(C),u)return u();y(!1),A.current?.(M.reference.current,M.floating.current)},[u]);r.useEffect(()=>{if(l&&v)return y(!1)},[l,v]),r.useImperativeHandle(b,()=>({open:()=>{y(!0),j.current?.(M.reference.current,M.floating.current)},close:()=>{y(!1),A.current?.(M.reference.current,M.floating.current)}}),[]);const{getFloatingProps:h,getReferenceProps:N}=f.useInteractions([f.useClick(F,{enabled:!l})]);return j.current=a,A.current=d,t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(n),N({ref:M.setReference,tabIndex:0,role:"button","aria-expanded":v,disabled:l,onClick:P})),t.jsx(z,{disabled:l||!T,children:t.jsx(f.FloatingOverlay,{"data-testid":"vs-popover-shadow",onClick:B,style:{zIndex:g},autoFocus:!0,children:t.jsx("div",{role:w||"region",ref:M.setFloating,style:S,children:t.jsx(Y,{unstyled:p,styles:E,...h({...c,onClick:P}),children:o})})})})]})});O.displayName="Popover";const Y=r.forwardRef(({className:e,unstyled:n,styles:o,style:s={},...l},i)=>{const a=r.useMemo(()=>m("z-20 w-auto h-auto outline-none transition-transform ease-in-out",n?null:"border border-accent rounded-md shadow-lg p-1 bg-background",e),[e,n]);return t.jsx("div",{ref:i,className:a,style:{...o,...s},...l})});Y.displayName="PopoverContent";function U(e){return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("path",{d:"M11.7 14.8 7 9.8a.5.5 0 0 1 0-.7c.2-.2.5-.2.7 0l4.5 5c.2.2.2.6 0 .8-.1.2-.4.2-.6 0Z",fill:"currentColor"}),t.jsx("path",{d:"m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z",fill:"currentColor"})]})}function V(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",...e,children:t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[t.jsx("path",{d:"M26 26l-12.5-12.5L26 1"}),t.jsx("path",{d:"M1 26l12.5-12.5L1 1"})]})})}function ue({className:e,placeholder:n="",options:o=[],error:s,unstyled:l,disabled:i,value:a,maxHeight:d=408,arrow:u,onChange:x,onClear:p,renderItem:g,...w}){const c=r.useRef(null),[b,v]=r.useState(0),y=r.useMemo(()=>l?e:k(m("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",s?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,s,l]),I=r.useMemo(()=>Array.isArray(a),[]),j=r.useCallback(h=>{x?.(h),I||c.current?.close()},[x,I]),A=r.useCallback(h=>Array.isArray(a)?a.indexOf(h)>-1:a===h,[a]),M=r.useMemo(()=>{const h={},N=o.filter(C=>typeof C!="string");for(let C=0,R=N.length;C<R;C+=1){const $=N[C];h[`${$.value}`]=$.label}return h},[o]),S=r.useMemo(()=>{if(!a)return n;if(Array.isArray(a)){if(!a.length)return n;const h=[...a].sort(),N=[];for(let C=0,R=h.length;C<R;C+=1)N[C]=M[`${h[C]}`]||"";return N.filter(Boolean).join(",")||n}return M[`${a}`]||n},[n,a,M]),F=S===n,T=r.useMemo(()=>m("overflow-hidden overflow-ellipsis whitespace-nowrap",F?"text-muted":"text-text"),[F]),E=r.useMemo(()=>u||t.jsx(U,{className:"absolute right-0 text-muted size-5"}),[u]),B=r.useCallback((h,N)=>g?typeof h=="string"?g(h,{index:N,selected:!1,onChange:()=>{}}):g(h,{index:N,selected:A(h.value),onChange:()=>j(h.value)}):typeof h=="string"?t.jsx("h5",{className:"font-medium py-1 px-2 text-muted",children:h},`optionheader-${N}`):t.jsx(de,{selected:A(h.value),onChange:j,...h},h.label),[g,j,A]);return t.jsx(O,{label:t.jsxs("button",{type:"button",className:y,disabled:i,...w,children:[t.jsx("span",{className:T,children:S}),t.jsxs("div",{className:"relative flex items-center pl-8 pr-3 space-x-2",children:[p&&!F?t.jsx("div",{tabIndex:-1,role:"button",className:"size-6 p-1.5 rounded hover:bg-accent","aria-label":"clear selected values",onKeyDown:h=>{h.key!=="Enter"&&h.key!=="Space"||p()},onClick:h=>{h.stopPropagation(),p()},children:t.jsx(V,{})}):null,E]})]}),ref:c,onOpen:h=>v(h?.getBoundingClientRect().width||0),disabled:i,children:t.jsx("ul",{className:"overflow-y-auto flex flex-col",role:"listbox",style:{minWidth:b,maxWidth:"calc(100vw - 3rem)",maxHeight:d},children:o.map(B)})})}function de({className:e,value:n,label:o,selected:s,onChange:l}){const i=r.useMemo(()=>m("flex items-center w-full hover:bg-accent rounded p-1",e),[e]);return t.jsxs("button",{type:"button",role:"option",className:i,"aria-selected":s,onClick:()=>l?.(n),children:[s?t.jsx(D,{className:"w-5 h-5 mr-1"}):t.jsx("div",{className:"w-5 h-1 mr-1"}),o]})}function fe({checked:e,className:n,id:o,name:s,onChange:l,value:i,...a}){const d=r.useMemo(()=>m("relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",e?"[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input":"",n),[n,e]),u=()=>{a.disabled||l?.(!e)};return t.jsxs("button",{type:"button",role:"radio",id:o||s,className:d,onClick:u,"aria-checked":e,...a,children:[t.jsx("i",{className:"block w-2.5 h-2.5 rounded-full transition-transform",style:{transform:e?"":"scale(0.8)",opacity:e?1:0}}),t.jsx("input",{type:"radio","aria-hidden":"true",name:s,checked:e,value:i,onChange:u,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const G=r.forwardRef(({className:e,checked:n,onChange:o,value:s,id:l,name:i,...a},d)=>{const u=r.useMemo(()=>k(m("inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50","w-11",n?"bg-primary":"bg-input"),e),[e,n]),x=r.useMemo(()=>k("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",e),[e]),p=()=>{a.disabled||o?.(!n)};return t.jsxs("button",{type:"button",role:"switch",id:l||i,className:u,onClick:p,"aria-checked":n,...a,children:[t.jsx("span",{className:x,style:{transform:n?"translateX(100%)":""}}),t.jsx("input",{ref:d,type:"checkbox","aria-hidden":"true",name:i,checked:n,value:s,onChange:p,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})});G.displayName="Switch";function he({header:e,show:n,children:o,timeout:s=300,...l}){const i=r.useRef(null),a=r.useRef(0),d=r.useRef(0),u=r.useRef(!0);return r.useEffect(()=>{d.current=s},[s]),_(()=>{if(!i.current)return;if(i.current.style.overflow="hidden",i.current.style.opacity="1",u.current){u.current=!1,i.current.style.height=n?"auto":"0px",n?window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)}):(window.requestAnimationFrame(()=>{i.current&&(i.current.style.height="auto",a.current=i.current.offsetHeight,i.current.style.height="0px")}),i.current.style.opacity="0");return}n||(i.current.style.height=`${a.current}px`);const x=[];x[0]=window.requestAnimationFrame(()=>{x[1]=window.requestAnimationFrame(()=>{i.current&&(i.current.style.height=`${n?a.current:0}px`,i.current.style.opacity=n?"1":"0")})});let p;const g=()=>{i.current&&(n?(i.current.style.height="auto",i.current.style.overflow="",i.current.style.opacity="",window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)})):i.current.style.height="0px")};return d.current===0?g():p=window.setTimeout(g,d.current),()=>{x.forEach(window.cancelAnimationFrame),p&&window.clearTimeout(p)}},[n]),t.jsxs("div",{...l,children:[e,t.jsx("div",{className:"transition-all ease-in-out overflow-hidden",role:"region","aria-hidden":!n,ref:i,style:{transitionDuration:`${s}ms`},children:o})]})}const xe=r.forwardRef(({children:e,position:n="bottom",label:o,className:s,timeout:l=150,offset:i={x:0,y:6},clientPoint:a=!1,disabled:d},u)=>{const[x,p]=r.useState(!1),g=f.useId(),{refs:w,floatingStyles:c,context:b}=f.useFloating({nodeId:g,open:x,placement:n,middleware:[f.shift(),f.flip(),f.offset({mainAxis:i.y,crossAxis:i.x})],whileElementsMounted:d?void 0:f.autoUpdate,onOpenChange:p}),{getReferenceProps:v,getFloatingProps:y}=f.useInteractions([f.useHover(b,{enabled:!d}),f.useClientPoint(b,{enabled:a})]),{isMounted:I,styles:j}=f.useTransitionStyles(b,{duration:l,initial:{opacity:0,transform:"scale(0.8)"}});r.useImperativeHandle(u,()=>({floating:w.floating,reference:w.reference,open:()=>p(!0),close:()=>p(!1)}));const A=typeof e=="string"?t.jsx("span",{children:e}):e;return t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(A),{ref:w.setReference,...v()}),t.jsx(z,{disabled:d||!I,children:t.jsx("div",{role:"tooltip",className:"z-[9999]",ref:w.setFloating,...y({style:c}),children:t.jsx(pe,{className:s,style:j,children:o})})})]})}),pe=r.forwardRef(({className:e,custom:n,...o},s)=>{const l=r.useMemo(()=>m("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",n?null:"border border-accent rounded shadow-md px-3 py-1 bg-background",e),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});function ge({variant:e,size:n}){return m("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",{"bg-primary text-inverted hover:bg-primary-fore":!e||e==="primary","bg-info text-inverted hover:bg-info-fore":e==="info","bg-warn text-inverted hover:bg-warn-fore":e==="warn","bg-danger text-inverted hover:bg-danger-fore":e==="danger","hover:bg-accent":e==="ghost","hover:underline":e==="link","border border-input hover:bg-accent":e==="outline"},{"px-2 py-1":!n,"p-1.5":n==="icon"})}function me({size:e,variant:n,className:o,...s}){const l=r.useMemo(()=>m(ge({size:e,variant:n}),o),[e,n,o]);return t.jsx("button",{className:l,type:"button",...s})}function be({open:e,children:n,timeout:o=150,padding:s="0.85rem",verticalAlign:l="center",closeOnOverlay:i,closeOnEsc:a,onExited:d,className:u,onOpenChange:x,size:p,...g}){const w=r.useRef(d),c=r.useRef(!1),b=f.useId(),{refs:v,context:y}=f.useFloating({open:e,onOpenChange:x,nodeId:b}),{getFloatingProps:I}=f.useInteractions([f.useDismiss(y,{enabled:a,escapeKey:a,outsidePress:!1})]),{isMounted:j,styles:A}=f.useTransitionStyles(y,{duration:o,initial:{opacity:0,transform:"scale(0.8)"}});r.useEffect(()=>{c.current!==j&&(c.current=j,!j&&w.current?.())},[j]);const M=r.useCallback(()=>{i&&x?.(!1)},[x,i]);w.current=d;const S=r.useMemo(()=>m("grid bg-backdrop z-40 justify-items-center",{"place-items-start items-start":l==="start","place-items-end":l==="end","place-items-center":l==="center"||!l}),[l]),F=r.useMemo(()=>k("transition ease-in-out",u),[u]);return t.jsx(z,{disabled:!j,children:t.jsx(f.FloatingOverlay,{className:S,"data-testid":"vs-dialog-overlay",onClick:M,style:{padding:s,opacity:A.opacity},lockScroll:!0,children:t.jsx(K,{ref:v.setFloating,className:F,role:"dialog",size:p,...I({...g,style:A,onClick:P}),children:n})})})}const K=r.forwardRef(({size:e,className:n,...o},s)=>{const l=r.useMemo(()=>m(e?"flex flex-col bg-background shadow-lg p-5 rounded":null,{"w-full max-w-sm":e==="small","w-full max-w-lg":e==="medium","w-full max-w-2xl":e==="large"},n),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});K.displayName="DialogContent";const we={open:300,close:150};function ve({open:e,timeout:n=we,onOpenChange:o,position:s="right",overlay:l,...i}){const a=f.useId(),{refs:d,context:u}=f.useFloating({open:e,onOpenChange:o,nodeId:a}),{isMounted:x,styles:p}=f.useTransitionStyles(u,{duration:n,initial(){let w="translateX(75%)";return s==="left"?w="translateX(-75%)":s==="top"?w="translateY(-75%)":s==="bottom"&&(w="translateY(75%)"),{opacity:0,transform:w}}}),g=r.useMemo(()=>m("fixed transition-transform z-30",{"top-0 right-0 h-full max-h-screen":s==="right","top-0 left-0 h-full max-h-screen":s==="left","top-0 left-0 right-0 w-full max-w-screen":s==="top","bottom-0 left-0 right-0 w-full max-w-screen":s==="bottom"}),[s]);return t.jsxs(z,{disabled:!x,children:[l?t.jsx(f.FloatingOverlay,{className:"bg-backdrop",style:{opacity:p.opacity},onClick:()=>o?.(!1)}):null,t.jsx("div",{ref:d.setFloating,className:g,role:"dialog",style:p,children:t.jsx(ye,{...i})})]})}function ye({className:e,unstyled:n,...o}){const s=r.useMemo(()=>n?e:k(m("relative bg-background min-w-full min-h-full border border-input shadow-lg"),e),[n,e]);return t.jsx("div",{className:s,...o})}function J(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsx("path",{d:"M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z",fill:"none"}),t.jsx("path",{d:"M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z",fill:"currentColor"}),t.jsx("path",{d:"m11.5 18.5-3.9-4L6 16l5.6 5.6L23.2 10l-1.7-1.6z",fill:"currentColor"})]})}function L(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 32 32",...e,children:[t.jsx("path",{d:"M16 0C7.16 0 0 7.16 0 16C0 24.84 7.16 32 16 32C24.84 32 32 24.84 32 16C32 7.16 24.84 0 16 0ZM16 31C7.73 31 1 24.27 1 16C1 7.73 7.73 1 16 1C24.27 1 31 7.73 31 16C31 24.27 24.27 31 16 31Z",fill:"currentColor"}),t.jsx("path",{d:"M15.5 19.55V8.54999C15.5 8.26999 15.72 8.04999 16 8.04999C16.28 8.04999 16.5 8.26999 16.5 8.54999V19.55C16.5 19.83 16.28 20.05 16 20.05C15.72 20.05 15.5 19.83 15.5 19.55Z",fill:"currentColor"}),t.jsx("path",{d:"M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z",fill:"currentColor"})]})}function Q(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 52 45",...e,children:t.jsx("path",{d:"M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z",fill:"currentColor"})})}function ee({size:e=20,label:n="Loading...",...o}){return t.jsxs("div",{role:"status",...o,children:[t.jsxs("svg",{"aria-hidden":"true",className:"text-accent animate-spin fill-primary",width:e,height:e,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",fill:"currentColor"}),t.jsx("path",{d:"M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",fill:"currentFill"})]}),t.jsx("span",{className:"sr-only",children:n})]})}function te({type:e,label:n,message:o}){return t.jsxs("div",{className:"flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",children:[e?t.jsxs("figure",{className:"mr-2",children:[e==="success"?t.jsx(J,{className:"text-primary size-5"}):null,e==="info"?t.jsx(L,{className:"text-info size-5"}):null,e==="error"?t.jsx(L,{className:"text-danger size-5"}):null,e==="warn"?t.jsx(Q,{className:"text-warn size-5"}):null,e==="loading"?t.jsx(ee,{size:20}):null]}):null,t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium leading-none",children:n}),o?t.jsx("p",{children:o}):null]})]})}function q(){}class je{notify=q;lastId=0;subscribe=n=>(this.notify=n,()=>{this.notify=q});add=(n,o={})=>{this.lastId+=1;const s=`${this.lastId}`;return this.notify({id:s,type:"add",config:{id:s,label:n,...o}}),s};update=(n,o)=>{this.notify({id:n,type:"update",config:o})};remove=n=>{this.notify({id:n,type:"remove"})};clear=()=>{this.lastId=0}}const Z=new je;function Ce({id:e,type:n,index:o,duration:s,className:l,children:i,inverted:a,timeout:d=250,max:u=3}){const x=r.useRef(!1),[p,g]=r.useState(!1),{context:w,refs:c}=f.useFloating({open:p,onOpenChange:g,nodeId:e}),{isMounted:b,styles:v}=f.useTransitionStyles(w,{duration:d,initial:{opacity:0,transform:`translateY(${a?"":"-"}50%)`}});r.useLayoutEffect(()=>{g(o<=u)},[o,u]),r.useEffect(()=>{x.current!==b&&(b||Z.remove(e),x.current=b)},[b,e]),r.useEffect(()=>{if(!s)return;const j=window.setTimeout(()=>g(!1),s);return()=>window.clearTimeout(j)},[s,e]);const y=r.useCallback(()=>{n!=="loading"&&g(!1)},[n]),I=r.useMemo(()=>m("relative flex w-fit transition-transform ease-in-out cursor-pointer",l),[l]);return b?t.jsx("li",{role:"log",tabIndex:-1,ref:c.setFloating,className:I,style:v,onClick:y,children:i}):null}function Me({className:e,margin:n=16,position:o="top-left",max:s,ListItem:l=te}){const i=r.useMemo(()=>{const c={position:"fixed"};return o.indexOf("top")>-1?c.top=n:o.indexOf("bottom")>-1&&(c.bottom=n),o.indexOf("left")>-1?(c.left=n,c.alignItems="flex-start"):o.indexOf("right")>-1?(c.right=n,c.alignItems="flex-end"):(c.left="50%",c.alignItems="center",c.transform="translateX(-50%)"),c},[n,o]),a=r.useMemo(()=>m("flex flex-col z-40 overflow-hidden",e),[e]),d=r.useMemo(()=>o?.startsWith("bottom")||!1,[o]),u=r.useRef(new Map),[x,p]=r.useState([]),g=r.useState(0)[1];_(()=>Z.subscribe(c=>{r.startTransition(()=>{if(c.type==="add")u.current.set(c.id,c.config),p(b=>[...b,c.id]);else if(c.type==="remove"){if(!u.current.delete(c.id))return;p(v=>{const y=new Set(v);return y.has(c.id)?(y.delete(c.id),Array.from(y)):v})}else if(c.type==="update"){const b=u.current.get(c.id);if(!b)return;u.current.set(c.id,{...b,...c.config}),g(v=>v+1)}})}),[]);const w=x.length;return t.jsx(z,{children:t.jsx("ol",{className:a,style:i,"aria-live":"polite",children:x.map((c,b)=>{const v=u.current.get(c);if(!v)return null;const{className:y,duration:I,...j}=v;return t.jsx(Ce,{id:c,index:w-b,className:y,duration:I,inverted:d,max:s,children:r.createElement(l,j)},c)})})})}function ke({className:e,...n}){const o=r.useMemo(()=>k("inline-block animate-pulse rounded-md bg-accent",e),[e]);return t.jsx("span",{className:o,...n})}function Ae({className:e,...n}){const o=r.useMemo(()=>m("flex items-center justify-center","[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr","[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",e),[e]);return t.jsx("div",{role:"group",className:o,...n})}function Ie({value:e,max:n,className:o,...s}){const l=r.useMemo(()=>e?Math.round(e/n*100):0,[e,n]),i=r.useMemo(()=>k("relative overflow-hidden rounded-full bg-primary",o),[o]);return t.jsx("div",{role:"progressbar",className:i,"aria-valuemax":n,"aria-valuemin":0,...s,children:t.jsx("div",{className:"h-full w-full flex-1 bg-input transition-all origin-right",style:{transform:`translateX(${l>100?100:l}%)`}})})}function Ne({className:e,orientation:n="horizontal",...o}){const s=r.useMemo(()=>k(m("border-0 p-0 shrink-0 bg-input",n==="horizontal"?"h-[1px] w-full":"w-[1px] h-full"),e),[e,n]);return t.jsx("hr",{className:s,role:"none",...o})}function Re(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsx("path",{d:"M18.066 8.5l-7.567 6.731 7.567 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2"})]})}function Fe(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsxs("g",{transform:"translate(9 7)",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("rect",{width:"12",height:"16",rx:"1",stroke:"none"}),t.jsx("path",{d:"M1 1h10v14H1z"})]}),t.jsx("path",{fill:"currentColor",d:"M13 11h4v1.3h-4zM13 14h4v1.3h-4zM13 17h4v1.3h-4z"})]})}function Se(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17.796",height:"17.908",viewBox:"0 0 17.796 17.908",...e,children:t.jsx("path",{d:"M1.254 12.674L.5 17.408l4.726-.8L17.3 4.472 13.281.5zM1.375 12.766l3.851 3.838M10.949 2.959l3.836 3.801",fill:"none",stroke:"currentColor"})})}function ze(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"15",cy:"15",r:"15",stroke:"none"}),t.jsx("circle",{cx:"15",cy:"15",r:"14"})]}),t.jsx("path",{d:"M8 23a6.018 6.018 0 016-6h2a6.018 6.018 0 016 6zm2.6-2h8.9a4.033 4.033 0 00-3.5-2h-1.9a4.035 4.035 0 00-3.5 2zm.4-9v-1a4.012 4.012 0 014-4 4.012 4.012 0 014 4v1a4.012 4.012 0 01-4 4 4.012 4.012 0 01-4-4zm2-1v1a2.006 2.006 0 002 2 2.006 2.006 0 002-2v-1a2.006 2.006 0 00-2-2 2.006 2.006 0 00-2 2z",fill:"currentColor"})]})}function Pe(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M15.065 0A15.069 15.069 0 00.142 13.105a1.256 1.256 0 102.478.406c0-.027.008-.055.01-.082a12.52 12.52 0 0121.3-7.226l-2.584 2.584 7.532 1.255-1.255-7.532-1.92 1.92A15 15 0 0015.065 0zm13.7 15.589A1.255 1.255 0 0027.5 16.7a12.512 12.512 0 01-21.893 6.569l1.927-1.927L0 20.086l1.255 7.532 2.572-2.572a15.02 15.02 0 0026.16-8.023 1.256 1.256 0 00-1.064-1.423 1.273 1.273 0 00-.16-.011z",fill:"currentColor"})})}function Te(e){return t.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("rect",{x:"16.5",y:"9",width:"14",height:"1",rx:".5",transform:"rotate(90 16.5 9)",fill:"currentColor"}),t.jsx("rect",{x:"9",y:"15.5",width:"14",height:"1",rx:".5",fill:"currentColor"})]})}exports.clsx=m;exports.Accordion=he;exports.Button=me;exports.ButtonGroup=Ae;exports.Checkbox=le;exports.Dialog=be;exports.Divider=Ne;exports.FormField=re;exports.FormLabel=H;exports.IconAlert=L;exports.IconApproved=J;exports.IconArrowDown=U;exports.IconCaution=Q;exports.IconCheck=D;exports.IconChevronRound=Re;exports.IconClose=V;exports.IconFileRound=Fe;exports.IconPencil=Se;exports.IconPlus=Te;exports.IconRefresh=Pe;exports.IconUser=ze;exports.Input=W;exports.InputField=se;exports.Placeholder=ke;exports.Popover=O;exports.Portal=z;exports.Progress=Ie;exports.Radio=fe;exports.Select=ue;exports.Sheet=ve;exports.Spinner=ee;exports.Switch=G;exports.Textarea=X;exports.Toast=Me;exports.ToastItem=te;exports.Tooltip=xe;exports.merge=k;exports.toast=Z;