@akira-io/ui 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +15 -10
  2. package/dist/blocks.d.ts +159 -6
  3. package/dist/blocks.js +1388 -29
  4. package/dist/blocks.js.map +1 -1
  5. package/dist/button-B6wQRe7p.d.ts +16 -0
  6. package/dist/chunk-5AJFQ6C4.js +35 -0
  7. package/dist/chunk-5AJFQ6C4.js.map +1 -0
  8. package/dist/chunk-6QM5BA7B.js +148 -0
  9. package/dist/chunk-6QM5BA7B.js.map +1 -0
  10. package/dist/chunk-6X4TKSF6.js +21 -0
  11. package/dist/chunk-6X4TKSF6.js.map +1 -0
  12. package/dist/chunk-DSD7MVLL.js +287 -0
  13. package/dist/chunk-DSD7MVLL.js.map +1 -0
  14. package/dist/chunk-IQMRJXEO.js +59 -0
  15. package/dist/chunk-IQMRJXEO.js.map +1 -0
  16. package/dist/chunk-JAHTUAQL.js +82 -0
  17. package/dist/chunk-JAHTUAQL.js.map +1 -0
  18. package/dist/{chunk-A2SIZOEA.js → chunk-KYWA5UYN.js} +125 -45
  19. package/dist/chunk-KYWA5UYN.js.map +1 -0
  20. package/dist/chunk-L2H5GIF7.js +22 -0
  21. package/dist/chunk-L2H5GIF7.js.map +1 -0
  22. package/dist/chunk-LKSM3WLK.js +44 -0
  23. package/dist/chunk-LKSM3WLK.js.map +1 -0
  24. package/dist/{chunk-5MQWJVM2.js → chunk-MNGNBEYN.js} +168 -200
  25. package/dist/chunk-MNGNBEYN.js.map +1 -0
  26. package/dist/chunk-SA5LM2GD.js +102 -0
  27. package/dist/chunk-SA5LM2GD.js.map +1 -0
  28. package/dist/chunk-UUEWFCKT.js +28 -0
  29. package/dist/chunk-UUEWFCKT.js.map +1 -0
  30. package/dist/{chunk-42BJBH56.js → chunk-UUTXPPRN.js} +521 -107
  31. package/dist/chunk-UUTXPPRN.js.map +1 -0
  32. package/dist/{chunk-UXL33CZ4.js → chunk-YOVY3KT6.js} +13 -11
  33. package/dist/chunk-YOVY3KT6.js.map +1 -0
  34. package/dist/code.d.ts +6 -0
  35. package/dist/code.js +651 -0
  36. package/dist/code.js.map +1 -0
  37. package/dist/context-VgHq4U98.d.ts +384 -0
  38. package/dist/editor.d.ts +126 -0
  39. package/dist/editor.js +436 -0
  40. package/dist/editor.js.map +1 -0
  41. package/dist/index.d.ts +93 -17
  42. package/dist/index.js +996 -472
  43. package/dist/index.js.map +1 -1
  44. package/dist/inertia.d.ts +47 -2
  45. package/dist/inertia.js +138 -7
  46. package/dist/inertia.js.map +1 -1
  47. package/dist/input-4uxAHW6y.d.ts +5 -0
  48. package/dist/json-viewer-BTHBACj9.d.ts +50 -0
  49. package/dist/{language-Bft6rBBt.d.ts → language-Dgjr9bm3.d.ts} +1 -1
  50. package/dist/locales/pt.d.ts +26 -4
  51. package/dist/locales/pt.js +127 -1
  52. package/dist/locales/pt.js.map +1 -1
  53. package/dist/password-input-r39y2pCT.d.ts +50 -0
  54. package/dist/shells.d.ts +45 -7
  55. package/dist/shells.js +95 -60
  56. package/dist/shells.js.map +1 -1
  57. package/dist/{sidebar-BDhG9SUU.d.ts → sidebar-BhOIlSjt.d.ts} +4 -12
  58. package/dist/{types-Cno1_Ijx.d.ts → types-B4QS3h5p.d.ts} +9 -1
  59. package/dist/types-CT0rBsFc.d.ts +110 -0
  60. package/package.json +170 -130
  61. package/theme.css +20 -0
  62. package/themes/nosferry.css +4 -0
  63. package/dist/chunk-42BJBH56.js.map +0 -1
  64. package/dist/chunk-5MQWJVM2.js.map +0 -1
  65. package/dist/chunk-A2SIZOEA.js.map +0 -1
  66. package/dist/chunk-POE7OYET.js +0 -96
  67. package/dist/chunk-POE7OYET.js.map +0 -1
  68. package/dist/chunk-UXL33CZ4.js.map +0 -1
  69. package/dist/date-range-filter-QEa8fhUM.d.ts +0 -149
  70. package/dist/types-cOieac8G.d.ts +0 -77
@@ -1,131 +1,187 @@
1
- import { cn, panelSurface, focusRing, elevatedSurface, nestedSurfaceReset, fieldSurface, modalSurface, buttonVariants, Button, menuSurface } from './chunk-POE7OYET.js';
2
- import { XIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, SearchIcon, SearchXIcon, CheckIcon, ChevronUpIcon } from 'lucide-react';
3
- import { Popover as Popover$1, Dialog as Dialog$1 } from 'radix-ui';
1
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Label, DialogFooter } from './chunk-6QM5BA7B.js';
2
+ import { useUiLabels } from './chunk-5AJFQ6C4.js';
3
+ import { Input } from './chunk-6X4TKSF6.js';
4
+ import { elevatedSurface, cn, panelSurface, glassControl, controlFill, focusRing, nestedSurfaceReset, fieldSurface, Button, buttonVariants, modalSurface, menuSurface } from './chunk-DSD7MVLL.js';
5
+ import { Minus, AlertCircle, ChevronRight, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, SearchIcon, SearchXIcon, CheckIcon, ChevronUpIcon, ArrowLeftIcon, XIcon } from 'lucide-react';
6
+ import * as React6 from 'react';
7
+ import { useId, useState, useEffect } from 'react';
4
8
  import { jsx, jsxs } from 'react/jsx-runtime';
5
- import * as React4 from 'react';
9
+ import { cva } from 'class-variance-authority';
6
10
  import { getDefaultClassNames, DayPicker } from 'react-day-picker';
7
11
  import { Command as Command$1 } from 'cmdk';
12
+ import { Popover as Popover$1 } from 'radix-ui';
8
13
  import * as SelectPrimitive from '@radix-ui/react-select';
9
- import * as LabelPrimitive from '@radix-ui/react-label';
14
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
15
+ import { createPortal } from 'react-dom';
16
+ import { OTPInput, OTPInputContext } from 'input-otp';
10
17
  import * as SwitchPrimitives from '@radix-ui/react-switch';
11
18
  import * as TabsPrimitive from '@radix-ui/react-tabs';
12
19
 
13
- function Dialog({
14
- ...props
15
- }) {
16
- return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
17
- }
18
- function DialogTrigger({
19
- ...props
20
- }) {
21
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "dialog-trigger", ...props });
22
- }
23
- function DialogPortal({
24
- ...props
25
- }) {
26
- return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "dialog-portal", ...props });
27
- }
28
- function DialogClose({
29
- ...props
20
+ var confirmDialogDefaultLabels = {
21
+ title: "Confirm Action",
22
+ description: "Are you sure you want to continue? This action cannot be undone.",
23
+ confirmText: "Confirm",
24
+ cancelText: "Cancel"
25
+ };
26
+ function ConfirmDialog({
27
+ open,
28
+ onOpenChange,
29
+ title,
30
+ description,
31
+ confirmText,
32
+ cancelText,
33
+ variant = "destructive",
34
+ processing = false,
35
+ requiredValue,
36
+ requiredValueLabel = "Type {{value}} to confirm",
37
+ onConfirm,
38
+ onCancel
30
39
  }) {
31
- return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", ...props });
32
- }
33
- function DialogOverlay({
34
- className,
35
- ...props
36
- }) {
37
- return /* @__PURE__ */ jsx(
38
- Dialog$1.Overlay,
39
- {
40
- "data-slot": "dialog-overlay",
41
- className: cn(
42
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 inset-0 bg-black/60 backdrop-blur-sm fixed z-50",
43
- className
44
- ),
45
- ...props
40
+ const labels = useUiLabels("confirmDialog", confirmDialogDefaultLabels, {
41
+ title,
42
+ confirmText,
43
+ cancelText
44
+ });
45
+ const resolvedDescription = description ?? labels.description;
46
+ const inputId = useId();
47
+ const [typedValue, setTypedValue] = useState("");
48
+ const unlocked = requiredValue === void 0 || typedValue === requiredValue;
49
+ useEffect(() => {
50
+ if (!open) {
51
+ setTypedValue("");
46
52
  }
47
- );
48
- }
49
- function DialogContent({
50
- className,
51
- children,
52
- hideCloseButton = false,
53
- ...props
54
- }) {
55
- return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
56
- /* @__PURE__ */ jsx(DialogOverlay, {}),
57
- /* @__PURE__ */ jsxs(
58
- Dialog$1.Content,
53
+ }, [open]);
54
+ const handleConfirm = () => {
55
+ if (processing || !unlocked) {
56
+ return;
57
+ }
58
+ onConfirm();
59
+ onOpenChange(false);
60
+ };
61
+ const handleCancel = () => {
62
+ if (processing) {
63
+ return;
64
+ }
65
+ onCancel?.();
66
+ onOpenChange(false);
67
+ };
68
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md p-0", "data-slot": "confirm-dialog", children: [
69
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-6 md:p-8", children: [
70
+ /* @__PURE__ */ jsx("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsx(
71
+ "div",
72
+ {
73
+ className: cn(
74
+ "size-16 rounded-3xl shadow-xl flex items-center justify-center",
75
+ variant === "destructive" ? "bg-destructive text-destructive-foreground shadow-destructive/20" : "bg-primary text-primary-foreground shadow-primary/20"
76
+ ),
77
+ children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8" })
78
+ }
79
+ ) }),
80
+ /* @__PURE__ */ jsx(DialogTitle, { children: labels.title }),
81
+ /* @__PURE__ */ jsx(DialogDescription, { children: resolvedDescription })
82
+ ] }),
83
+ requiredValue !== void 0 && /* @__PURE__ */ jsxs(
84
+ "div",
59
85
  {
60
- "data-slot": "dialog-content",
61
- className: cn(
62
- `${modalSurface} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 gap-6 p-6 sm:w-full sm:max-w-lg fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] overflow-hidden duration-200`,
63
- className
64
- ),
65
- ...props,
86
+ "data-slot": "confirm-dialog-gate",
87
+ className: "gap-2 px-6 md:px-8 flex flex-col",
66
88
  children: [
67
- children,
68
- !hideCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, { className: "top-6 right-6 h-10 w-10 shadow-xs absolute z-50 flex items-center justify-center rounded-full border border-border bg-muted text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", children: [
69
- /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5" }),
70
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
71
- ] })
89
+ /* @__PURE__ */ jsx(Label, { htmlFor: inputId, children: requiredValueLabel.replace(
90
+ "{{value}}",
91
+ requiredValue
92
+ ) }),
93
+ /* @__PURE__ */ jsx(
94
+ Input,
95
+ {
96
+ id: inputId,
97
+ value: typedValue,
98
+ autoComplete: "off",
99
+ disabled: processing,
100
+ onChange: (event) => setTypedValue(event.target.value)
101
+ }
102
+ )
72
103
  ]
73
104
  }
74
- )
75
- ] });
76
- }
77
- function DialogHeader({ className, ...props }) {
78
- return /* @__PURE__ */ jsx(
79
- "div",
80
- {
81
- "data-slot": "dialog-header",
82
- className: cn(
83
- "gap-2 p-6 md:p-8 flex flex-col text-center",
84
- className
105
+ ),
106
+ /* @__PURE__ */ jsx(DialogFooter, { className: "p-6 md:p-8", children: /* @__PURE__ */ jsxs("div", { className: "gap-4 sm:grid-cols-2 grid w-full", children: [
107
+ /* @__PURE__ */ jsx(
108
+ Button,
109
+ {
110
+ type: "button",
111
+ variant: "ghost",
112
+ disabled: processing,
113
+ onClick: handleCancel,
114
+ className: "text-muted-foreground",
115
+ children: labels.cancelText
116
+ }
85
117
  ),
86
- ...props
87
- }
88
- );
118
+ /* @__PURE__ */ jsxs(
119
+ Button,
120
+ {
121
+ variant,
122
+ disabled: processing || !unlocked,
123
+ onClick: handleConfirm,
124
+ children: [
125
+ labels.confirmText,
126
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-2 h-5 w-5" })
127
+ ]
128
+ }
129
+ )
130
+ ] }) })
131
+ ] }) });
89
132
  }
90
- function DialogFooter({ className, ...props }) {
133
+ var alertVariants = cva(
134
+ `${elevatedSurface} relative w-full px-5 py-4 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,
135
+ {
136
+ variants: {
137
+ variant: {
138
+ default: "bg-card/60 text-card-foreground",
139
+ destructive: "border-destructive/30 bg-destructive/10 text-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/80"
140
+ }
141
+ },
142
+ defaultVariants: {
143
+ variant: "default"
144
+ }
145
+ }
146
+ );
147
+ function Alert({
148
+ className,
149
+ variant,
150
+ ...props
151
+ }) {
91
152
  return /* @__PURE__ */ jsx(
92
153
  "div",
93
154
  {
94
- "data-slot": "dialog-footer",
95
- className: cn(
96
- "gap-3 p-6 md:p-8 sm:flex-row sm:justify-end flex flex-col-reverse border-t border-border",
97
- className
98
- ),
155
+ "data-slot": "alert",
156
+ role: "alert",
157
+ className: cn(alertVariants({ variant }), className),
99
158
  ...props
100
159
  }
101
160
  );
102
161
  }
103
- function DialogTitle({
104
- className,
105
- ...props
106
- }) {
162
+ function AlertTitle({ className, ...props }) {
107
163
  return /* @__PURE__ */ jsx(
108
- Dialog$1.Title,
164
+ "div",
109
165
  {
110
- "data-slot": "dialog-title",
166
+ "data-slot": "alert-title",
111
167
  className: cn(
112
- "text-2xl font-bold tracking-tight md:text-3xl text-foreground",
168
+ "min-h-4 font-medium tracking-tight col-start-2 line-clamp-1",
113
169
  className
114
170
  ),
115
171
  ...props
116
172
  }
117
173
  );
118
174
  }
119
- function DialogDescription({
175
+ function AlertDescription({
120
176
  className,
121
177
  ...props
122
178
  }) {
123
179
  return /* @__PURE__ */ jsx(
124
- Dialog$1.Description,
180
+ "div",
125
181
  {
126
- "data-slot": "dialog-description",
182
+ "data-slot": "alert-description",
127
183
  className: cn(
128
- "text-base font-medium leading-relaxed text-muted-foreground",
184
+ "gap-1 text-sm [&_p]:leading-relaxed col-start-2 grid justify-items-start text-muted-foreground",
129
185
  className
130
186
  ),
131
187
  ...props
@@ -311,8 +367,8 @@ function CalendarDayButton({
311
367
  ...props
312
368
  }) {
313
369
  const defaultClassNames = getDefaultClassNames();
314
- const ref = React4.useRef(null);
315
- React4.useEffect(() => {
370
+ const ref = React6.useRef(null);
371
+ React6.useEffect(() => {
316
372
  if (modifiers.focused) ref.current?.focus();
317
373
  }, [modifiers.focused]);
318
374
  return /* @__PURE__ */ jsx(
@@ -509,7 +565,7 @@ function CommandShortcut({
509
565
  var Popover = Popover$1.Root;
510
566
  var PopoverTrigger = Popover$1.Trigger;
511
567
  var PopoverAnchor = Popover$1.Anchor;
512
- var PopoverContent = React4.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
568
+ var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
513
569
  Popover$1.Content,
514
570
  {
515
571
  "data-slot": "popover-content",
@@ -681,23 +737,381 @@ function SelectScrollDownButton({
681
737
  }
682
738
  );
683
739
  }
684
- function Label2({
740
+ var FieldContext = React6.createContext(null);
741
+ function useOptionalField() {
742
+ return React6.useContext(FieldContext);
743
+ }
744
+ function useField() {
745
+ const field = useOptionalField();
746
+ if (!field) {
747
+ throw new Error("Field parts must be rendered inside a Field.");
748
+ }
749
+ return field;
750
+ }
751
+ function FieldError({ message, className, ...props }) {
752
+ const field = useOptionalField();
753
+ if (!message) {
754
+ return null;
755
+ }
756
+ return /* @__PURE__ */ jsx(
757
+ "p",
758
+ {
759
+ id: field?.errorId,
760
+ className: cn(
761
+ "ml-1 text-xs font-medium text-destructive group-data-[orientation=horizontal]/field:col-span-2 group-data-[orientation=horizontal]/field:row-start-3",
762
+ className
763
+ ),
764
+ "data-slot": "field-error",
765
+ ...props,
766
+ children: message
767
+ }
768
+ );
769
+ }
770
+ var floatingSheetDefaultLabels = {
771
+ backLabel: "Back",
772
+ closeLabel: "Close"
773
+ };
774
+ var FLOATING_SHEET_OFFSET_LIMIT = 3;
775
+ var FloatingSheetStackContext = React6.createContext(null);
776
+ function useFloatingSheetStack() {
777
+ const context = React6.useContext(FloatingSheetStackContext);
778
+ if (!context) {
779
+ throw new Error(
780
+ "FloatingSheet must be rendered inside a FloatingSheetStack."
781
+ );
782
+ }
783
+ return context;
784
+ }
785
+ function FloatingSheetStack({
786
+ children,
787
+ labels
788
+ }) {
789
+ const { backLabel, closeLabel } = useUiLabels(
790
+ "floatingSheet",
791
+ floatingSheetDefaultLabels,
792
+ labels
793
+ );
794
+ const [entries, setEntries] = React6.useState([]);
795
+ const [container, setContainer] = React6.useState(null);
796
+ const register = React6.useCallback((entry) => {
797
+ setEntries(
798
+ (current) => current.some((item) => item.id === entry.id) ? current.map((item) => item.id === entry.id ? entry : item) : [...current, entry]
799
+ );
800
+ }, []);
801
+ const unregister = React6.useCallback((id) => {
802
+ setEntries((current) => current.filter((item) => item.id !== id));
803
+ }, []);
804
+ const closeAll = React6.useCallback(() => {
805
+ for (const entry of [...entries].reverse()) {
806
+ entry.close();
807
+ }
808
+ }, [entries]);
809
+ const value = React6.useMemo(
810
+ () => ({
811
+ labels: { backLabel, closeLabel },
812
+ container,
813
+ entries,
814
+ register,
815
+ unregister,
816
+ closeAll
817
+ }),
818
+ [
819
+ backLabel,
820
+ closeLabel,
821
+ container,
822
+ entries,
823
+ register,
824
+ unregister,
825
+ closeAll
826
+ ]
827
+ );
828
+ const top = entries.at(-1);
829
+ return /* @__PURE__ */ jsxs(FloatingSheetStackContext.Provider, { value, children: [
830
+ children,
831
+ /* @__PURE__ */ jsx(
832
+ DialogPrimitive.Root,
833
+ {
834
+ open: entries.length > 0,
835
+ onOpenChange: (open) => {
836
+ if (!open) {
837
+ closeAll();
838
+ }
839
+ },
840
+ children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
841
+ /* @__PURE__ */ jsx(
842
+ DialogPrimitive.Overlay,
843
+ {
844
+ "data-slot": "floating-sheet-overlay",
845
+ className: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 inset-0 bg-black/60 backdrop-blur-sm fixed z-50"
846
+ }
847
+ ),
848
+ /* @__PURE__ */ jsxs(
849
+ DialogPrimitive.Content,
850
+ {
851
+ "data-slot": "floating-sheet-stack",
852
+ "aria-describedby": void 0,
853
+ onEscapeKeyDown: (event) => {
854
+ event.preventDefault();
855
+ if (!top?.persistent) {
856
+ top?.close();
857
+ }
858
+ },
859
+ onInteractOutside: (event) => {
860
+ if (top?.persistent) {
861
+ event.preventDefault();
862
+ }
863
+ },
864
+ onOpenAutoFocus: (event) => event.preventDefault(),
865
+ onCloseAutoFocus: (event) => event.preventDefault(),
866
+ className: "inset-y-0 right-0 sm:inset-y-4 sm:right-4 sm:w-[calc(100vw-2rem)] sm:max-w-lg fixed z-50 w-full outline-none",
867
+ children: [
868
+ /* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: top?.title }),
869
+ /* @__PURE__ */ jsx(
870
+ "div",
871
+ {
872
+ ref: setContainer,
873
+ "data-slot": "floating-sheet-panels",
874
+ className: "relative h-full w-full"
875
+ }
876
+ )
877
+ ]
878
+ }
879
+ )
880
+ ] })
881
+ }
882
+ )
883
+ ] });
884
+ }
885
+ function FloatingSheet({
886
+ open,
887
+ onOpenChange,
888
+ title,
889
+ description,
890
+ persistent = false,
891
+ className,
892
+ children,
893
+ ...props
894
+ }) {
895
+ const { labels, container, entries, register, unregister, closeAll } = useFloatingSheetStack();
896
+ const id = React6.useId();
897
+ const titleId = `${id}-title`;
898
+ const descriptionId = `${id}-description`;
899
+ const close = React6.useCallback(() => onOpenChange(false), [onOpenChange]);
900
+ const closeRef = React6.useRef(close);
901
+ const titleRef = React6.useRef(title);
902
+ const openerRef = React6.useRef(null);
903
+ const panelRef = React6.useRef(null);
904
+ const focusedRef = React6.useRef(false);
905
+ React6.useEffect(() => {
906
+ closeRef.current = close;
907
+ titleRef.current = title;
908
+ });
909
+ React6.useEffect(() => {
910
+ if (!open) {
911
+ return;
912
+ }
913
+ register({
914
+ id,
915
+ title: titleRef.current,
916
+ persistent,
917
+ close: () => closeRef.current()
918
+ });
919
+ }, [open, id, persistent, register]);
920
+ React6.useEffect(() => {
921
+ if (!open) {
922
+ return;
923
+ }
924
+ return () => unregister(id);
925
+ }, [open, id, unregister]);
926
+ const index = entries.findIndex((entry) => entry.id === id);
927
+ const depth = index === -1 ? 0 : entries.length - 1 - index;
928
+ const isTop = index !== -1 && depth === 0;
929
+ React6.useEffect(() => {
930
+ if (open) {
931
+ openerRef.current = document.activeElement;
932
+ return;
933
+ }
934
+ const opener = openerRef.current;
935
+ openerRef.current = null;
936
+ if (opener instanceof HTMLElement && document.contains(opener)) {
937
+ opener.focus();
938
+ }
939
+ }, [open]);
940
+ React6.useEffect(() => {
941
+ if (!open) {
942
+ focusedRef.current = false;
943
+ return;
944
+ }
945
+ if (!isTop || focusedRef.current) {
946
+ return;
947
+ }
948
+ focusedRef.current = true;
949
+ const frame = requestAnimationFrame(() => panelRef.current?.focus());
950
+ return () => cancelAnimationFrame(frame);
951
+ }, [open, isTop]);
952
+ if (!open || !container) {
953
+ return null;
954
+ }
955
+ const offset = Math.min(depth, FLOATING_SHEET_OFFSET_LIMIT);
956
+ return createPortal(
957
+ /* @__PURE__ */ jsxs(
958
+ "section",
959
+ {
960
+ ref: panelRef,
961
+ "data-slot": "floating-sheet",
962
+ "data-depth": depth,
963
+ role: "dialog",
964
+ "aria-labelledby": titleId,
965
+ "aria-describedby": description ? descriptionId : void 0,
966
+ tabIndex: -1,
967
+ inert: !isTop,
968
+ style: {
969
+ transform: `translateX(-${offset * 26}px) scale(${1 - offset * 0.035})`,
970
+ zIndex: index
971
+ },
972
+ className: cn(
973
+ `${modalSurface} inset-0 ease-out absolute flex flex-col overflow-hidden transition-transform duration-300 outline-none`,
974
+ depth > 0 && "max-sm:hidden pointer-events-none",
975
+ depth > FLOATING_SHEET_OFFSET_LIMIT && "hidden",
976
+ className
977
+ ),
978
+ ...props,
979
+ children: [
980
+ /* @__PURE__ */ jsxs(
981
+ "header",
982
+ {
983
+ "data-slot": "floating-sheet-header",
984
+ className: "gap-1 p-5 flex flex-col border-b border-border",
985
+ children: [
986
+ index > 0 ? /* @__PURE__ */ jsxs(
987
+ "button",
988
+ {
989
+ type: "button",
990
+ "data-slot": "floating-sheet-back",
991
+ onClick: close,
992
+ className: cn(
993
+ "gap-2 h-8 -ml-2 px-2 text-sm font-medium inline-flex w-fit items-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
994
+ focusRing
995
+ ),
996
+ children: [
997
+ /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-4" }),
998
+ labels.backLabel
999
+ ]
1000
+ }
1001
+ ) : null,
1002
+ /* @__PURE__ */ jsx(
1003
+ "h2",
1004
+ {
1005
+ id: titleId,
1006
+ "data-slot": "floating-sheet-title",
1007
+ className: "pr-10 text-lg font-semibold text-foreground",
1008
+ children: title
1009
+ }
1010
+ ),
1011
+ description ? /* @__PURE__ */ jsx(
1012
+ "p",
1013
+ {
1014
+ id: descriptionId,
1015
+ "data-slot": "floating-sheet-description",
1016
+ className: "text-sm text-muted-foreground",
1017
+ children: description
1018
+ }
1019
+ ) : null
1020
+ ]
1021
+ }
1022
+ ),
1023
+ children,
1024
+ /* @__PURE__ */ jsx(
1025
+ "button",
1026
+ {
1027
+ type: "button",
1028
+ "data-slot": "floating-sheet-close",
1029
+ "aria-label": labels.closeLabel,
1030
+ onClick: closeAll,
1031
+ className: cn(
1032
+ "top-4 right-4 size-9 shadow-xs absolute flex items-center justify-center rounded-full border border-border bg-muted text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none",
1033
+ focusRing
1034
+ ),
1035
+ children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" })
1036
+ }
1037
+ )
1038
+ ]
1039
+ }
1040
+ ),
1041
+ container
1042
+ );
1043
+ }
1044
+ function FloatingSheetBody({
685
1045
  className,
686
1046
  ...props
687
1047
  }) {
688
1048
  return /* @__PURE__ */ jsx(
689
- LabelPrimitive.Root,
1049
+ "div",
1050
+ {
1051
+ "data-slot": "floating-sheet-body",
1052
+ className: cn("p-5 flex-1 overflow-y-auto", className),
1053
+ ...props
1054
+ }
1055
+ );
1056
+ }
1057
+ function FloatingSheetFooter({
1058
+ className,
1059
+ ...props
1060
+ }) {
1061
+ return /* @__PURE__ */ jsx(
1062
+ "div",
690
1063
  {
691
- "data-slot": "label",
1064
+ "data-slot": "floating-sheet-footer",
692
1065
  className: cn(
693
- "text-sm font-medium text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
1066
+ "gap-2 p-5 mt-auto flex items-center justify-end border-t border-border",
694
1067
  className
695
1068
  ),
696
1069
  ...props
697
1070
  }
698
1071
  );
699
1072
  }
700
- var Switch = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1073
+ var InputOTP = React6.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
1074
+ OTPInput,
1075
+ {
1076
+ ref,
1077
+ containerClassName: cn(
1078
+ "gap-2 flex items-center has-[:disabled]:opacity-50",
1079
+ containerClassName
1080
+ ),
1081
+ className: cn("disabled:cursor-not-allowed", className),
1082
+ ...props
1083
+ }
1084
+ ));
1085
+ InputOTP.displayName = "InputOTP";
1086
+ var InputOTPGroup = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props }));
1087
+ InputOTPGroup.displayName = "InputOTPGroup";
1088
+ var InputOTPSlot = React6.forwardRef(({ index, className, ...props }, ref) => {
1089
+ const inputOTPContext = React6.useContext(OTPInputContext);
1090
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
1091
+ return /* @__PURE__ */ jsxs(
1092
+ "div",
1093
+ {
1094
+ ref,
1095
+ "data-slot": "input-otp-slot",
1096
+ className: cn(
1097
+ glassControl,
1098
+ controlFill,
1099
+ "size-11 text-sm font-medium first:rounded-l-2xl last:rounded-r-2xl relative flex items-center justify-center rounded-none transition-all",
1100
+ isActive && "z-10 ring-[3px] ring-ring/50",
1101
+ className
1102
+ ),
1103
+ ...props,
1104
+ children: [
1105
+ char,
1106
+ hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "inset-0 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 animate-caret-blink w-px bg-foreground duration-1000" }) })
1107
+ ]
1108
+ }
1109
+ );
1110
+ });
1111
+ InputOTPSlot.displayName = "InputOTPSlot";
1112
+ var InputOTPSeparator = React6.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, {}) }));
1113
+ InputOTPSeparator.displayName = "InputOTPSeparator";
1114
+ var Switch = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
701
1115
  SwitchPrimitives.Root,
702
1116
  {
703
1117
  "data-slot": "switch",
@@ -719,9 +1133,9 @@ var Switch = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
719
1133
  }
720
1134
  ));
721
1135
  Switch.displayName = SwitchPrimitives.Root.displayName;
722
- var Tabs = React4.forwardRef((props, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-slot": "tabs", ref, ...props }));
1136
+ var Tabs = React6.forwardRef((props, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-slot": "tabs", ref, ...props }));
723
1137
  Tabs.displayName = TabsPrimitive.Root.displayName;
724
- var TabsList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1138
+ var TabsList = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
725
1139
  TabsPrimitive.List,
726
1140
  {
727
1141
  "data-slot": "tabs-list",
@@ -734,7 +1148,7 @@ var TabsList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__
734
1148
  }
735
1149
  ));
736
1150
  TabsList.displayName = TabsPrimitive.List.displayName;
737
- var TabsTrigger = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1151
+ var TabsTrigger = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
738
1152
  TabsPrimitive.Trigger,
739
1153
  {
740
1154
  "data-slot": "tabs-trigger",
@@ -747,7 +1161,7 @@ var TabsTrigger = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
747
1161
  }
748
1162
  ));
749
1163
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
750
- var TabsContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1164
+ var TabsContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
751
1165
  TabsPrimitive.Content,
752
1166
  {
753
1167
  "data-slot": "tabs-content",
@@ -762,7 +1176,7 @@ var TabsContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
762
1176
  }
763
1177
  ));
764
1178
  TabsContent.displayName = TabsPrimitive.Content.displayName;
765
- var Textarea = React4.forwardRef(({ className, ...props }, ref) => {
1179
+ var Textarea = React6.forwardRef(({ className, ...props }, ref) => {
766
1180
  return /* @__PURE__ */ jsx(
767
1181
  "textarea",
768
1182
  {
@@ -781,6 +1195,6 @@ var Textarea = React4.forwardRef(({ className, ...props }, ref) => {
781
1195
  });
782
1196
  Textarea.displayName = "Textarea";
783
1197
 
784
- export { Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Label2 as Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea };
785
- //# sourceMappingURL=chunk-42BJBH56.js.map
786
- //# sourceMappingURL=chunk-42BJBH56.js.map
1198
+ export { Alert, AlertDescription, AlertTitle, Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, FieldContext, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetStack, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, confirmDialogDefaultLabels, floatingSheetDefaultLabels, useField };
1199
+ //# sourceMappingURL=chunk-UUTXPPRN.js.map
1200
+ //# sourceMappingURL=chunk-UUTXPPRN.js.map