@tomny-dev/uzi 0.1.9-pr.2.1.1 → 0.1.9-pr.2.2.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/README.md +13 -3
- package/dist/index.cjs +272 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +164 -23
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +16 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.js +251 -124
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ type ModalOverlayProps = {
|
|
|
67
67
|
className?: string;
|
|
68
68
|
children: ReactNode;
|
|
69
69
|
};
|
|
70
|
-
declare function ModalOverlay({ open, onClose, className, children }: ModalOverlayProps): react_jsx_runtime.JSX.Element
|
|
70
|
+
declare function ModalOverlay({ open, onClose, className, children }: ModalOverlayProps): react_jsx_runtime.JSX.Element;
|
|
71
71
|
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
72
72
|
type ModalProps = {
|
|
73
73
|
open: boolean;
|
|
@@ -193,22 +193,27 @@ type SelectOption = {
|
|
|
193
193
|
value: string;
|
|
194
194
|
disabled?: boolean;
|
|
195
195
|
};
|
|
196
|
-
type SelectProps =
|
|
196
|
+
type SelectProps = {
|
|
197
197
|
options: SelectOption[];
|
|
198
198
|
value: string;
|
|
199
199
|
onChange: (value: string) => void;
|
|
200
200
|
placeholder?: string;
|
|
201
201
|
allowEmptyOption?: boolean;
|
|
202
202
|
fullWidth?: boolean;
|
|
203
|
+
className?: string;
|
|
204
|
+
id?: string;
|
|
205
|
+
name?: string;
|
|
206
|
+
disabled?: boolean;
|
|
207
|
+
required?: boolean;
|
|
208
|
+
autoComplete?: string;
|
|
209
|
+
form?: string;
|
|
210
|
+
title?: string;
|
|
211
|
+
"aria-label"?: string;
|
|
212
|
+
"aria-labelledby"?: string;
|
|
213
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement>;
|
|
214
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
|
|
203
215
|
};
|
|
204
|
-
declare const Select: React.ForwardRefExoticComponent<
|
|
205
|
-
options: SelectOption[];
|
|
206
|
-
value: string;
|
|
207
|
-
onChange: (value: string) => void;
|
|
208
|
-
placeholder?: string;
|
|
209
|
-
allowEmptyOption?: boolean;
|
|
210
|
-
fullWidth?: boolean;
|
|
211
|
-
} & React.RefAttributes<HTMLSelectElement>>;
|
|
216
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
212
217
|
|
|
213
218
|
interface DropdownOption extends SelectOption {
|
|
214
219
|
}
|
|
@@ -224,7 +229,7 @@ interface DropdownProps extends Omit<SelectProps, "allowEmptyOption" | "fullWidt
|
|
|
224
229
|
* @deprecated Use Select for value selection and DropdownMenu for action menus.
|
|
225
230
|
* Dropdown remains as a compatibility alias during migration.
|
|
226
231
|
*/
|
|
227
|
-
declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<
|
|
232
|
+
declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLButtonElement>>;
|
|
228
233
|
|
|
229
234
|
declare function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
230
235
|
declare function DropdownMenuTrigger(props: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -150,36 +150,20 @@ function Pill({
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// src/components/modal/Modal.tsx
|
|
153
|
-
import
|
|
153
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
154
154
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
155
155
|
function ModalOverlay({ open, onClose, className, children }) {
|
|
156
|
-
const mouseDownOnBackdrop = useRef(false);
|
|
157
|
-
useEffect(() => {
|
|
158
|
-
if (!open) return;
|
|
159
|
-
const handleKeyDown = (e) => {
|
|
160
|
-
if (e.key === "Escape") {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
onClose();
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
window.addEventListener("keydown", handleKeyDown, true);
|
|
166
|
-
return () => window.removeEventListener("keydown", handleKeyDown, true);
|
|
167
|
-
}, [open, onClose]);
|
|
168
|
-
if (!open) return null;
|
|
169
156
|
return /* @__PURE__ */ jsx5(
|
|
170
|
-
|
|
157
|
+
DialogPrimitive.Root,
|
|
171
158
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
onMouseDown: (e) => {
|
|
176
|
-
mouseDownOnBackdrop.current = e.target === e.currentTarget;
|
|
159
|
+
open,
|
|
160
|
+
onOpenChange: (nextOpen) => {
|
|
161
|
+
if (!nextOpen) onClose();
|
|
177
162
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
children
|
|
163
|
+
children: /* @__PURE__ */ jsx5(DialogPrimitive.Portal, { children: /* @__PURE__ */ jsxs2("div", { className: "portalLayer", children: [
|
|
164
|
+
/* @__PURE__ */ jsx5(DialogPrimitive.Overlay, { className: cx("backdrop", className) }),
|
|
165
|
+
/* @__PURE__ */ jsx5(DialogPrimitive.Content, { className: "overlayContent", children })
|
|
166
|
+
] }) })
|
|
183
167
|
}
|
|
184
168
|
);
|
|
185
169
|
}
|
|
@@ -187,13 +171,13 @@ function Modal({ open, onClose, title, subtitle, size = "md", children, footer }
|
|
|
187
171
|
return /* @__PURE__ */ jsx5(ModalOverlay, { open, onClose, children: /* @__PURE__ */ jsxs2("div", { className: cx("modal", `size-${size}`), children: [
|
|
188
172
|
/* @__PURE__ */ jsxs2("div", { className: "header", children: [
|
|
189
173
|
/* @__PURE__ */ jsxs2("div", { className: "titles", children: [
|
|
190
|
-
/* @__PURE__ */ jsx5(
|
|
191
|
-
subtitle
|
|
174
|
+
/* @__PURE__ */ jsx5(DialogPrimitive.Title, { className: "title", children: title }),
|
|
175
|
+
subtitle ? /* @__PURE__ */ jsx5(DialogPrimitive.Description, { className: "subtitle", children: subtitle }) : null
|
|
192
176
|
] }),
|
|
193
|
-
/* @__PURE__ */ jsx5("button", { className: "closeButton",
|
|
177
|
+
/* @__PURE__ */ jsx5(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx5("button", { className: "closeButton", "aria-label": "Close", children: /* @__PURE__ */ jsxs2("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
194
178
|
/* @__PURE__ */ jsx5("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
195
179
|
/* @__PURE__ */ jsx5("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
196
|
-
] }) })
|
|
180
|
+
] }) }) })
|
|
197
181
|
] }),
|
|
198
182
|
/* @__PURE__ */ jsx5("div", { className: "body", children }),
|
|
199
183
|
footer && /* @__PURE__ */ jsx5("div", { className: "footer", children: footer })
|
|
@@ -217,12 +201,13 @@ import {
|
|
|
217
201
|
createContext,
|
|
218
202
|
useCallback,
|
|
219
203
|
useContext,
|
|
220
|
-
useEffect
|
|
204
|
+
useEffect,
|
|
221
205
|
useMemo,
|
|
222
|
-
useRef
|
|
206
|
+
useRef,
|
|
223
207
|
useState
|
|
224
208
|
} from "react";
|
|
225
|
-
import
|
|
209
|
+
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
210
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
226
211
|
var DEFAULT_CONFIG = {
|
|
227
212
|
position: "top-right",
|
|
228
213
|
maxToasts: 5,
|
|
@@ -282,7 +267,7 @@ function ToastProvider({
|
|
|
282
267
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
283
268
|
}, []);
|
|
284
269
|
const dismissAll = useCallback(() => setToasts([]), []);
|
|
285
|
-
|
|
270
|
+
useEffect(() => {
|
|
286
271
|
if (!merged.pauseOnFocusLoss) return;
|
|
287
272
|
const handleVisibility = () => setIsPaused(document.visibilityState !== "visible");
|
|
288
273
|
document.addEventListener("visibilitychange", handleVisibility);
|
|
@@ -292,7 +277,7 @@ function ToastProvider({
|
|
|
292
277
|
() => ({ toasts, push, success, error, warning, info, dismiss, dismissAll }),
|
|
293
278
|
[toasts, push, success, error, warning, info, dismiss, dismissAll]
|
|
294
279
|
);
|
|
295
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsx7(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs3(ToastPrimitive.Provider, { swipeDirection: "right", children: [
|
|
296
281
|
children,
|
|
297
282
|
/* @__PURE__ */ jsx7(
|
|
298
283
|
ToastContainer,
|
|
@@ -305,7 +290,7 @@ function ToastProvider({
|
|
|
305
290
|
onPauseChange: setIsPaused
|
|
306
291
|
}
|
|
307
292
|
)
|
|
308
|
-
] });
|
|
293
|
+
] }) });
|
|
309
294
|
}
|
|
310
295
|
function useToast() {
|
|
311
296
|
const ctx = useContext(ToastContext);
|
|
@@ -337,26 +322,29 @@ function ToastContainer({
|
|
|
337
322
|
return "topRight";
|
|
338
323
|
}
|
|
339
324
|
})();
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
325
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
326
|
+
toasts.map((toast) => /* @__PURE__ */ jsx7(ToastItem, { toast, isPaused, onDismiss }, toast.id)),
|
|
327
|
+
/* @__PURE__ */ jsx7(
|
|
328
|
+
ToastPrimitive.Viewport,
|
|
329
|
+
{
|
|
330
|
+
className: cx("stack", posClass),
|
|
331
|
+
label: "Notifications",
|
|
332
|
+
onMouseEnter: () => pauseOnHover && onPauseChange(true),
|
|
333
|
+
onMouseLeave: () => pauseOnHover && onPauseChange(false)
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] });
|
|
350
337
|
}
|
|
351
338
|
function ToastItem({
|
|
352
339
|
toast,
|
|
353
340
|
isPaused,
|
|
354
341
|
onDismiss
|
|
355
342
|
}) {
|
|
356
|
-
const [
|
|
357
|
-
const timerRef =
|
|
358
|
-
const startRef =
|
|
359
|
-
const remainingRef =
|
|
343
|
+
const [open, setOpen] = useState(true);
|
|
344
|
+
const timerRef = useRef(null);
|
|
345
|
+
const startRef = useRef(0);
|
|
346
|
+
const remainingRef = useRef(toast.duration ?? 0);
|
|
347
|
+
const closingRef = useRef(false);
|
|
360
348
|
const palette = getPalette(toast.type);
|
|
361
349
|
const styleVars = {
|
|
362
350
|
["--toast-bg"]: palette.background,
|
|
@@ -374,7 +362,9 @@ function ToastItem({
|
|
|
374
362
|
}
|
|
375
363
|
};
|
|
376
364
|
const triggerDismiss = useCallback(() => {
|
|
377
|
-
|
|
365
|
+
if (closingRef.current) return;
|
|
366
|
+
closingRef.current = true;
|
|
367
|
+
setOpen(false);
|
|
378
368
|
stopTimer();
|
|
379
369
|
window.setTimeout(() => onDismiss(toast.id), 160);
|
|
380
370
|
}, [onDismiss, toast.id]);
|
|
@@ -390,12 +380,12 @@ function ToastItem({
|
|
|
390
380
|
},
|
|
391
381
|
[triggerDismiss]
|
|
392
382
|
);
|
|
393
|
-
|
|
383
|
+
useEffect(() => {
|
|
394
384
|
if (!toast.duration || toast.duration <= 0) return void 0;
|
|
395
385
|
schedule(toast.duration);
|
|
396
386
|
return stopTimer;
|
|
397
387
|
}, [schedule, toast.duration]);
|
|
398
|
-
|
|
388
|
+
useEffect(() => {
|
|
399
389
|
if (!toast.duration || toast.duration <= 0) return;
|
|
400
390
|
if (isPaused) {
|
|
401
391
|
const elapsed = performance.now() - startRef.current;
|
|
@@ -406,42 +396,60 @@ function ToastItem({
|
|
|
406
396
|
}
|
|
407
397
|
}, [isPaused, schedule, toast.duration]);
|
|
408
398
|
const icon = getIcon(toast.type);
|
|
409
|
-
return /* @__PURE__ */ jsxs3(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
children: toast.
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
399
|
+
return /* @__PURE__ */ jsxs3(
|
|
400
|
+
ToastPrimitive.Root,
|
|
401
|
+
{
|
|
402
|
+
open,
|
|
403
|
+
onOpenChange: (nextOpen) => {
|
|
404
|
+
if (!nextOpen) triggerDismiss();
|
|
405
|
+
},
|
|
406
|
+
duration: 2147483647,
|
|
407
|
+
className: "toast",
|
|
408
|
+
style: styleVars,
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ jsx7("span", { className: "icon", "aria-hidden": true, children: icon }),
|
|
411
|
+
/* @__PURE__ */ jsxs3("div", { className: "body", children: [
|
|
412
|
+
/* @__PURE__ */ jsx7(ToastPrimitive.Description, { className: "message", children: toast.message }),
|
|
413
|
+
toast.action && /* @__PURE__ */ jsx7("div", { className: "actions", children: /* @__PURE__ */ jsx7(
|
|
414
|
+
ToastPrimitive.Action,
|
|
415
|
+
{
|
|
416
|
+
asChild: true,
|
|
417
|
+
altText: toast.action.label,
|
|
418
|
+
children: /* @__PURE__ */ jsx7(
|
|
419
|
+
"button",
|
|
420
|
+
{
|
|
421
|
+
type: "button",
|
|
422
|
+
className: "actionButton",
|
|
423
|
+
onClick: () => {
|
|
424
|
+
toast.action?.onClick();
|
|
425
|
+
triggerDismiss();
|
|
426
|
+
},
|
|
427
|
+
children: toast.action.label
|
|
428
|
+
}
|
|
429
|
+
)
|
|
430
|
+
}
|
|
431
|
+
) })
|
|
432
|
+
] }),
|
|
433
|
+
toast.dismissible !== false && /* @__PURE__ */ jsx7(ToastPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx7(
|
|
434
|
+
"button",
|
|
435
435
|
{
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
436
|
+
type: "button",
|
|
437
|
+
className: "closeButton",
|
|
438
|
+
"aria-label": "Dismiss notification",
|
|
439
|
+
children: /* @__PURE__ */ jsx7("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx7(
|
|
440
|
+
"path",
|
|
441
|
+
{
|
|
442
|
+
d: "M11 3L3 11M3 3l8 8",
|
|
443
|
+
stroke: "currentColor",
|
|
444
|
+
strokeWidth: "1.5",
|
|
445
|
+
strokeLinecap: "round"
|
|
446
|
+
}
|
|
447
|
+
) })
|
|
440
448
|
}
|
|
441
449
|
) })
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
450
|
+
]
|
|
451
|
+
}
|
|
452
|
+
);
|
|
445
453
|
}
|
|
446
454
|
function getPalette(type) {
|
|
447
455
|
switch (type) {
|
|
@@ -549,7 +557,7 @@ Checkbox.displayName = "Checkbox";
|
|
|
549
557
|
// src/components/multi-select/MultiSelect.tsx
|
|
550
558
|
import * as React4 from "react";
|
|
551
559
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
552
|
-
import { Fragment, jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
560
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
553
561
|
var MultiSelect = React4.forwardRef(
|
|
554
562
|
({
|
|
555
563
|
options,
|
|
@@ -603,7 +611,7 @@ var MultiSelect = React4.forwardRef(
|
|
|
603
611
|
"aria-labelledby": ariaLabelledBy,
|
|
604
612
|
disabled,
|
|
605
613
|
children: [
|
|
606
|
-
/* @__PURE__ */ jsx11("span", { className: "value", children: selectedOptions.length === 0 ? /* @__PURE__ */ jsx11("span", { className: "placeholder", children: placeholder }) : /* @__PURE__ */ jsxs4(
|
|
614
|
+
/* @__PURE__ */ jsx11("span", { className: "value", children: selectedOptions.length === 0 ? /* @__PURE__ */ jsx11("span", { className: "placeholder", children: placeholder }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
607
615
|
visibleOptions.map((option) => /* @__PURE__ */ jsx11("span", { className: "chip", children: option.label }, option.value)),
|
|
608
616
|
overflowCount > 0 ? /* @__PURE__ */ jsxs4("span", { className: "chip chip-summary", children: [
|
|
609
617
|
"+",
|
|
@@ -706,7 +714,9 @@ import * as React6 from "react";
|
|
|
706
714
|
|
|
707
715
|
// src/components/select/Select.tsx
|
|
708
716
|
import * as React5 from "react";
|
|
717
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
709
718
|
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
719
|
+
var EMPTY_OPTION_VALUE = "__uzi_select_empty__";
|
|
710
720
|
var Select = React5.forwardRef(
|
|
711
721
|
({
|
|
712
722
|
options,
|
|
@@ -716,27 +726,144 @@ var Select = React5.forwardRef(
|
|
|
716
726
|
allowEmptyOption = false,
|
|
717
727
|
fullWidth = true,
|
|
718
728
|
className,
|
|
719
|
-
|
|
729
|
+
id,
|
|
730
|
+
name,
|
|
731
|
+
disabled,
|
|
732
|
+
required,
|
|
733
|
+
autoComplete,
|
|
734
|
+
form,
|
|
735
|
+
title,
|
|
736
|
+
"aria-label": ariaLabel,
|
|
737
|
+
"aria-labelledby": ariaLabelledBy,
|
|
738
|
+
onBlur,
|
|
739
|
+
onFocus
|
|
720
740
|
}, ref) => {
|
|
721
|
-
const
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
741
|
+
const internalValue = value === "" && allowEmptyOption ? EMPTY_OPTION_VALUE : value;
|
|
742
|
+
return /* @__PURE__ */ jsx12("div", { className: cx("wrapper", fullWidth && "wrapper-fullWidth", className), children: /* @__PURE__ */ jsxs5(
|
|
743
|
+
SelectPrimitive.Root,
|
|
744
|
+
{
|
|
745
|
+
value: internalValue,
|
|
746
|
+
onValueChange: (nextValue) => onChange(nextValue === EMPTY_OPTION_VALUE ? "" : nextValue),
|
|
747
|
+
name,
|
|
748
|
+
disabled,
|
|
749
|
+
required,
|
|
750
|
+
autoComplete,
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsxs5(
|
|
753
|
+
SelectPrimitive.Trigger,
|
|
754
|
+
{
|
|
755
|
+
ref,
|
|
756
|
+
id,
|
|
757
|
+
className: "select",
|
|
758
|
+
form,
|
|
759
|
+
title,
|
|
760
|
+
"aria-label": ariaLabel,
|
|
761
|
+
"aria-labelledby": ariaLabelledBy,
|
|
762
|
+
onBlur,
|
|
763
|
+
onFocus,
|
|
764
|
+
children: [
|
|
765
|
+
/* @__PURE__ */ jsx12(SelectPrimitive.Value, { placeholder }),
|
|
766
|
+
/* @__PURE__ */ jsx12(SelectPrimitive.Icon, { className: "chevron", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
|
|
767
|
+
"svg",
|
|
768
|
+
{
|
|
769
|
+
viewBox: "0 0 10 10",
|
|
770
|
+
fill: "none",
|
|
771
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
772
|
+
width: "10",
|
|
773
|
+
height: "10",
|
|
774
|
+
children: /* @__PURE__ */ jsx12(
|
|
775
|
+
"path",
|
|
776
|
+
{
|
|
777
|
+
d: "M2 3.5L5 6.5L8 3.5",
|
|
778
|
+
stroke: "currentColor",
|
|
779
|
+
strokeWidth: "1.5",
|
|
780
|
+
strokeLinecap: "round",
|
|
781
|
+
strokeLinejoin: "round"
|
|
782
|
+
}
|
|
783
|
+
)
|
|
784
|
+
}
|
|
785
|
+
) })
|
|
786
|
+
]
|
|
787
|
+
}
|
|
788
|
+
),
|
|
789
|
+
/* @__PURE__ */ jsx12(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx12(
|
|
790
|
+
SelectPrimitive.Content,
|
|
791
|
+
{
|
|
792
|
+
className: "content",
|
|
793
|
+
position: "popper",
|
|
794
|
+
sideOffset: 4,
|
|
795
|
+
align: "start",
|
|
796
|
+
children: /* @__PURE__ */ jsxs5(SelectPrimitive.Viewport, { className: "viewport", children: [
|
|
797
|
+
placeholder && allowEmptyOption ? /* @__PURE__ */ jsxs5(
|
|
798
|
+
SelectPrimitive.Item,
|
|
799
|
+
{
|
|
800
|
+
value: EMPTY_OPTION_VALUE,
|
|
801
|
+
className: "item",
|
|
802
|
+
children: [
|
|
803
|
+
/* @__PURE__ */ jsx12("span", { className: "indicator", children: /* @__PURE__ */ jsx12(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx12(
|
|
804
|
+
"svg",
|
|
805
|
+
{
|
|
806
|
+
viewBox: "0 0 16 16",
|
|
807
|
+
width: "16",
|
|
808
|
+
height: "16",
|
|
809
|
+
"aria-hidden": "true",
|
|
810
|
+
className: "indicatorIcon",
|
|
811
|
+
children: /* @__PURE__ */ jsx12(
|
|
812
|
+
"path",
|
|
813
|
+
{
|
|
814
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
815
|
+
fill: "none",
|
|
816
|
+
stroke: "currentColor",
|
|
817
|
+
strokeWidth: "1.8",
|
|
818
|
+
strokeLinecap: "round",
|
|
819
|
+
strokeLinejoin: "round"
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
}
|
|
823
|
+
) }) }),
|
|
824
|
+
/* @__PURE__ */ jsx12(SelectPrimitive.ItemText, { children: placeholder })
|
|
825
|
+
]
|
|
826
|
+
}
|
|
827
|
+
) : null,
|
|
828
|
+
options.map((opt) => /* @__PURE__ */ jsxs5(
|
|
829
|
+
SelectPrimitive.Item,
|
|
830
|
+
{
|
|
831
|
+
value: opt.value,
|
|
832
|
+
disabled: opt.disabled,
|
|
833
|
+
className: "item",
|
|
834
|
+
children: [
|
|
835
|
+
/* @__PURE__ */ jsx12("span", { className: "indicator", children: /* @__PURE__ */ jsx12(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx12(
|
|
836
|
+
"svg",
|
|
837
|
+
{
|
|
838
|
+
viewBox: "0 0 16 16",
|
|
839
|
+
width: "16",
|
|
840
|
+
height: "16",
|
|
841
|
+
"aria-hidden": "true",
|
|
842
|
+
className: "indicatorIcon",
|
|
843
|
+
children: /* @__PURE__ */ jsx12(
|
|
844
|
+
"path",
|
|
845
|
+
{
|
|
846
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
847
|
+
fill: "none",
|
|
848
|
+
stroke: "currentColor",
|
|
849
|
+
strokeWidth: "1.8",
|
|
850
|
+
strokeLinecap: "round",
|
|
851
|
+
strokeLinejoin: "round"
|
|
852
|
+
}
|
|
853
|
+
)
|
|
854
|
+
}
|
|
855
|
+
) }) }),
|
|
856
|
+
/* @__PURE__ */ jsx12(SelectPrimitive.ItemText, { children: opt.label })
|
|
857
|
+
]
|
|
858
|
+
},
|
|
859
|
+
opt.value
|
|
860
|
+
))
|
|
861
|
+
] })
|
|
862
|
+
}
|
|
863
|
+
) })
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
) });
|
|
740
867
|
}
|
|
741
868
|
);
|
|
742
869
|
Select.displayName = "Select";
|
|
@@ -957,9 +1084,9 @@ function DropdownMenuSubContent({
|
|
|
957
1084
|
|
|
958
1085
|
// src/components/app-shell/AppShell.tsx
|
|
959
1086
|
import {
|
|
960
|
-
useEffect as
|
|
1087
|
+
useEffect as useEffect3,
|
|
961
1088
|
useId,
|
|
962
|
-
useRef as
|
|
1089
|
+
useRef as useRef2,
|
|
963
1090
|
useState as useState3
|
|
964
1091
|
} from "react";
|
|
965
1092
|
|
|
@@ -968,7 +1095,7 @@ import {
|
|
|
968
1095
|
createContext as createContext2,
|
|
969
1096
|
useCallback as useCallback3,
|
|
970
1097
|
useContext as useContext2,
|
|
971
|
-
useEffect as
|
|
1098
|
+
useEffect as useEffect2,
|
|
972
1099
|
useMemo as useMemo3,
|
|
973
1100
|
useState as useState2
|
|
974
1101
|
} from "react";
|
|
@@ -1011,7 +1138,7 @@ function ThemeProvider({
|
|
|
1011
1138
|
const [internalTheme, setInternalTheme] = useState2(defaultTheme);
|
|
1012
1139
|
const [internalAccent, setInternalAccent] = useState2(defaultAccent);
|
|
1013
1140
|
const [systemTheme, setSystemTheme] = useState2("light");
|
|
1014
|
-
|
|
1141
|
+
useEffect2(() => {
|
|
1015
1142
|
setSystemTheme(getSystemTheme());
|
|
1016
1143
|
if (!disableStorage) {
|
|
1017
1144
|
const storedTheme = window.localStorage.getItem(storageKey);
|
|
@@ -1025,7 +1152,7 @@ function ThemeProvider({
|
|
|
1025
1152
|
const currentTheme = isThemeControlled ? theme : internalTheme;
|
|
1026
1153
|
const currentAccent = isAccentControlled ? accent : internalAccent;
|
|
1027
1154
|
const resolvedTheme = currentTheme === "system" ? systemTheme : currentTheme;
|
|
1028
|
-
|
|
1155
|
+
useEffect2(() => {
|
|
1029
1156
|
if (typeof window === "undefined") return;
|
|
1030
1157
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1031
1158
|
const handleChange = () => setSystemTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -1033,7 +1160,7 @@ function ThemeProvider({
|
|
|
1033
1160
|
mediaQuery.addEventListener("change", handleChange);
|
|
1034
1161
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
1035
1162
|
}, []);
|
|
1036
|
-
|
|
1163
|
+
useEffect2(() => {
|
|
1037
1164
|
if (typeof document === "undefined") return;
|
|
1038
1165
|
const root = document.documentElement;
|
|
1039
1166
|
root.setAttribute(THEME_ATTRIBUTE, resolvedTheme);
|
|
@@ -1217,13 +1344,13 @@ function AppShell({
|
|
|
1217
1344
|
const [isDesktop, setIsDesktop] = useState3(false);
|
|
1218
1345
|
const [sidebarOpen, setSidebarOpen] = useState3(false);
|
|
1219
1346
|
const [transitionsReady, setTransitionsReady] = useState3(false);
|
|
1220
|
-
const prevIsDesktopRef =
|
|
1221
|
-
const closeKeyRef =
|
|
1222
|
-
const sidebarRef =
|
|
1223
|
-
const hamburgerRef =
|
|
1224
|
-
const mainRef =
|
|
1347
|
+
const prevIsDesktopRef = useRef2(false);
|
|
1348
|
+
const closeKeyRef = useRef2(closeSidebarOnChangeKey);
|
|
1349
|
+
const sidebarRef = useRef2(null);
|
|
1350
|
+
const hamburgerRef = useRef2(null);
|
|
1351
|
+
const mainRef = useRef2(null);
|
|
1225
1352
|
const sidebarId = useId();
|
|
1226
|
-
|
|
1353
|
+
useEffect3(() => {
|
|
1227
1354
|
const desktop = getIsDesktop();
|
|
1228
1355
|
setIsDesktop(desktop);
|
|
1229
1356
|
setSidebarOpen(desktop);
|
|
@@ -1245,7 +1372,7 @@ function AppShell({
|
|
|
1245
1372
|
window.removeEventListener("resize", handleResize);
|
|
1246
1373
|
};
|
|
1247
1374
|
}, []);
|
|
1248
|
-
|
|
1375
|
+
useEffect3(() => {
|
|
1249
1376
|
if (isDesktop || !sidebarOpen) return;
|
|
1250
1377
|
const mainElement = mainRef.current;
|
|
1251
1378
|
const closeSidebar = () => setSidebarOpen(false);
|
|
@@ -1270,13 +1397,13 @@ function AppShell({
|
|
|
1270
1397
|
document.removeEventListener("touchmove", closeSidebar);
|
|
1271
1398
|
};
|
|
1272
1399
|
}, [sidebarOpen, isDesktop]);
|
|
1273
|
-
|
|
1400
|
+
useEffect3(() => {
|
|
1274
1401
|
if (!isDesktop && closeKeyRef.current !== closeSidebarOnChangeKey) {
|
|
1275
1402
|
setSidebarOpen(false);
|
|
1276
1403
|
}
|
|
1277
1404
|
closeKeyRef.current = closeSidebarOnChangeKey;
|
|
1278
1405
|
}, [closeSidebarOnChangeKey, isDesktop]);
|
|
1279
|
-
|
|
1406
|
+
useEffect3(() => {
|
|
1280
1407
|
onSidebarToggle?.(sidebarOpen);
|
|
1281
1408
|
}, [sidebarOpen, onSidebarToggle]);
|
|
1282
1409
|
const toggleSidebar = () => setSidebarOpen((open) => !open);
|
|
@@ -1333,7 +1460,7 @@ function AppShell({
|
|
|
1333
1460
|
}
|
|
1334
1461
|
|
|
1335
1462
|
// src/components/sidebar-nav/SidebarNav.tsx
|
|
1336
|
-
import { Fragment as
|
|
1463
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1337
1464
|
var defaultIsActive = (item, path) => {
|
|
1338
1465
|
if (item.active !== void 0) return item.active;
|
|
1339
1466
|
if (!item.href) return false;
|
|
@@ -1410,7 +1537,7 @@ function SidebarNavEntry({
|
|
|
1410
1537
|
item.disabled && "uziSidebarNavItemDisabled",
|
|
1411
1538
|
itemClassName
|
|
1412
1539
|
);
|
|
1413
|
-
const content = /* @__PURE__ */ jsxs10(
|
|
1540
|
+
const content = /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1414
1541
|
item.icon && /* @__PURE__ */ jsx19("span", { className: "uziSidebarNavIcon", children: item.icon }),
|
|
1415
1542
|
!collapsed ? /* @__PURE__ */ jsxs10("span", { className: "uziSidebarNavItemBody", children: [
|
|
1416
1543
|
/* @__PURE__ */ jsxs10("span", { className: "uziSidebarNavLabelRow", children: [
|