@komensal/ui 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/index.d.ts +27 -7
- package/dist/index.js +486 -348
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +2 -1
- package/dist/locales/index.js.map +1 -1
- package/package.json +11 -13
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// src/components/
|
|
2
|
-
import
|
|
1
|
+
// src/components/add-tile.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
// src/utils/cn.ts
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -58,8 +58,36 @@ function emit(type, options) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// src/
|
|
61
|
+
// src/utils/z-index.ts
|
|
62
|
+
var zPopover = "z-50";
|
|
63
|
+
var zDialogOverlay = "z-60";
|
|
64
|
+
var zDialogContent = "z-70";
|
|
65
|
+
var zPopoverAboveDialog = "z-100";
|
|
66
|
+
var zToast = "z-4000";
|
|
67
|
+
|
|
68
|
+
// src/components/add-tile.tsx
|
|
62
69
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
70
|
+
var AddTile = React.forwardRef(({ className, icon, label, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
className: cn(
|
|
74
|
+
"border-border text-muted hover:border-primary hover:text-primary focus-visible:ring-ring flex min-h-48 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl border-2 border-dashed transition-colors focus-visible:ring-2 focus-visible:outline-none",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
ref,
|
|
78
|
+
type: "button",
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
icon,
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: label })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
));
|
|
86
|
+
AddTile.displayName = "AddTile";
|
|
87
|
+
|
|
88
|
+
// src/components/alert.tsx
|
|
89
|
+
import { CheckCircleIcon, InfoIcon, WarningCircleIcon, WarningIcon } from "@phosphor-icons/react";
|
|
90
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
63
91
|
var variantStyles = {
|
|
64
92
|
destructive: { container: "bg-destructive-subtle text-destructive", icon: "text-destructive" },
|
|
65
93
|
info: { container: "bg-info-subtle text-info", icon: "text-info" },
|
|
@@ -75,7 +103,7 @@ var variantIcons = {
|
|
|
75
103
|
var Alert = ({ children, className, variant = "destructive", ...props }) => {
|
|
76
104
|
const styles = variantStyles[variant];
|
|
77
105
|
const Icon = variantIcons[variant];
|
|
78
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ jsxs2(
|
|
79
107
|
"div",
|
|
80
108
|
{
|
|
81
109
|
"aria-live": "polite",
|
|
@@ -87,15 +115,15 @@ var Alert = ({ children, className, variant = "destructive", ...props }) => {
|
|
|
87
115
|
role: "alert",
|
|
88
116
|
...props,
|
|
89
117
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ jsx2(Icon, { className: cn("h-5 w-5 shrink-0", styles.icon) }),
|
|
119
|
+
/* @__PURE__ */ jsx2("span", { children })
|
|
92
120
|
]
|
|
93
121
|
}
|
|
94
122
|
);
|
|
95
123
|
};
|
|
96
124
|
|
|
97
125
|
// src/components/auth-header.tsx
|
|
98
|
-
import { Fragment, jsx as
|
|
126
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
99
127
|
var AuthHeader = ({
|
|
100
128
|
children,
|
|
101
129
|
desktopLogoSrc = "/logo_color.svg",
|
|
@@ -103,19 +131,19 @@ var AuthHeader = ({
|
|
|
103
131
|
mobileClassName,
|
|
104
132
|
mobileLogoSrc = "/logotipo_color.svg"
|
|
105
133
|
}) => {
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
135
|
+
/* @__PURE__ */ jsxs3("div", { className: cn("flex min-h-0 shrink flex-col lg:hidden", mobileClassName), children: [
|
|
136
|
+
/* @__PURE__ */ jsx3("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ jsx3("img", { alt: logoAlt, className: "h-11 md:h-12", src: mobileLogoSrc }) }),
|
|
109
137
|
children
|
|
110
138
|
] }),
|
|
111
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ jsx3("div", { className: "absolute hidden p-10 lg:flex", children: /* @__PURE__ */ jsx3("img", { alt: logoAlt, className: "h-12.5 w-12.5", src: desktopLogoSrc }) })
|
|
112
140
|
] });
|
|
113
141
|
};
|
|
114
142
|
|
|
115
143
|
// src/components/button.tsx
|
|
116
144
|
import { Slot } from "@radix-ui/react-slot";
|
|
117
145
|
import { cva } from "class-variance-authority";
|
|
118
|
-
import * as
|
|
146
|
+
import * as React3 from "react";
|
|
119
147
|
|
|
120
148
|
// src/components/spinner.tsx
|
|
121
149
|
import clsx2 from "clsx";
|
|
@@ -138,7 +166,8 @@ var ui_default = {
|
|
|
138
166
|
placeholder: "Selecciona...",
|
|
139
167
|
loading: "Cargando...",
|
|
140
168
|
search: "Buscar...",
|
|
141
|
-
noResults: "Sin resultados."
|
|
169
|
+
noResults: "Sin resultados.",
|
|
170
|
+
clear: "Limpiar selecci\xF3n"
|
|
142
171
|
},
|
|
143
172
|
passwordChecklist: {
|
|
144
173
|
minLength: "M\xEDnimo {{min}} caracteres",
|
|
@@ -165,7 +194,7 @@ var setUiLanguage = (lng) => uiI18n.changeLanguage(lng);
|
|
|
165
194
|
var useUiT = () => useTranslation("ui", { i18n: uiI18n }).t;
|
|
166
195
|
|
|
167
196
|
// src/components/spinner.tsx
|
|
168
|
-
import { Fragment as Fragment2, jsx as
|
|
197
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
169
198
|
var sizes = {
|
|
170
199
|
lg: "70",
|
|
171
200
|
md: "50",
|
|
@@ -180,8 +209,8 @@ var variants = {
|
|
|
180
209
|
};
|
|
181
210
|
var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary" }) => {
|
|
182
211
|
const t = useUiT();
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
213
|
+
/* @__PURE__ */ jsx4(
|
|
185
214
|
"svg",
|
|
186
215
|
{
|
|
187
216
|
fill: "currentColor",
|
|
@@ -190,9 +219,9 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
190
219
|
viewBox: "0 0 100 100",
|
|
191
220
|
width: sizes[size],
|
|
192
221
|
xmlns: "http://www.w3.org/2000/svg",
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ jsxs4("g", { className: clsx2("spinner_V8m1", className), children: [
|
|
223
|
+
/* @__PURE__ */ jsx4("circle", { cx: "50", cy: "50", fill: "none", opacity: "0.25", r: "35", stroke: "currentColor", strokeWidth: "10" }),
|
|
224
|
+
/* @__PURE__ */ jsx4(
|
|
196
225
|
"circle",
|
|
197
226
|
{
|
|
198
227
|
cx: "50",
|
|
@@ -202,7 +231,7 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
202
231
|
stroke: "currentColor",
|
|
203
232
|
strokeDasharray: "164.93361431346415 56.97787143782138",
|
|
204
233
|
strokeWidth: "10",
|
|
205
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ jsx4(
|
|
206
235
|
"animateTransform",
|
|
207
236
|
{
|
|
208
237
|
attributeName: "transform",
|
|
@@ -218,22 +247,22 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
218
247
|
] })
|
|
219
248
|
}
|
|
220
249
|
),
|
|
221
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: loadingLabel ?? t("spinner.loading") })
|
|
222
251
|
] });
|
|
223
252
|
};
|
|
224
253
|
|
|
225
254
|
// src/components/tooltip.tsx
|
|
226
255
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
227
|
-
import * as
|
|
228
|
-
import { jsx as
|
|
256
|
+
import * as React2 from "react";
|
|
257
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
229
258
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
230
259
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
231
260
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
232
|
-
var TooltipContent =
|
|
261
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx5(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx5(
|
|
233
262
|
TooltipPrimitive.Content,
|
|
234
263
|
{
|
|
235
264
|
className: cn(
|
|
236
|
-
|
|
265
|
+
`bg-tooltip text-tooltip-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ${zPopover} overflow-hidden rounded-md px-3 py-1.5 text-sm font-semibold shadow-sm`,
|
|
237
266
|
className
|
|
238
267
|
),
|
|
239
268
|
ref,
|
|
@@ -242,18 +271,18 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
242
271
|
}
|
|
243
272
|
) }));
|
|
244
273
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
245
|
-
var Tooltip =
|
|
274
|
+
var Tooltip = React2.forwardRef(
|
|
246
275
|
({ children, childrenClassName, className, message, sideTooltip = "top" }, ref) => {
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ jsx5(TooltipProvider, { children: /* @__PURE__ */ jsxs5(TooltipRoot, { children: [
|
|
277
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx5("div", { className: cn("", childrenClassName), ref, children }) }),
|
|
278
|
+
/* @__PURE__ */ jsx5(TooltipContent, { className: cn("", className), side: sideTooltip, children: /* @__PURE__ */ jsx5("p", { children: message }) })
|
|
250
279
|
] }) });
|
|
251
280
|
}
|
|
252
281
|
);
|
|
253
282
|
Tooltip.displayName = "Tooltip";
|
|
254
283
|
|
|
255
284
|
// src/components/button.tsx
|
|
256
|
-
import { jsx as
|
|
285
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
257
286
|
var buttonVariants = cva(
|
|
258
287
|
"w-full inline-flex items-center justify-center gap-[10px] whitespace-nowrap rounded-[12px] border border-transparent text-base font-semibold transition-all duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:bg-inactive disabled:text-inactive-text disabled:border-transparent cursor-pointer",
|
|
259
288
|
{
|
|
@@ -298,7 +327,7 @@ var buttonVariants = cva(
|
|
|
298
327
|
}
|
|
299
328
|
}
|
|
300
329
|
);
|
|
301
|
-
var Button =
|
|
330
|
+
var Button = React3.forwardRef(
|
|
302
331
|
({
|
|
303
332
|
asChild = false,
|
|
304
333
|
children,
|
|
@@ -317,7 +346,7 @@ var Button = React2.forwardRef(
|
|
|
317
346
|
...props
|
|
318
347
|
}, ref) => {
|
|
319
348
|
const Comp = asChild ? Slot : "button";
|
|
320
|
-
const buttonNode = /* @__PURE__ */
|
|
349
|
+
const buttonNode = /* @__PURE__ */ jsxs6(
|
|
321
350
|
Comp,
|
|
322
351
|
{
|
|
323
352
|
"aria-busy": isLoading || void 0,
|
|
@@ -328,36 +357,57 @@ var Button = React2.forwardRef(
|
|
|
328
357
|
children: [
|
|
329
358
|
iconLeft,
|
|
330
359
|
icon,
|
|
331
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ jsx6("span", { className: cn("flex w-full items-center justify-center gap-2", childrenClassName), children }),
|
|
332
361
|
iconRight,
|
|
333
|
-
isLoading && /* @__PURE__ */
|
|
362
|
+
isLoading && /* @__PURE__ */ jsx6("div", { className: "absolute inset-0 flex items-center justify-center bg-black/10 backdrop-blur-sm", children: /* @__PURE__ */ jsx6(Spinner, { size: "sm" }) })
|
|
334
363
|
]
|
|
335
364
|
}
|
|
336
365
|
);
|
|
337
|
-
return tooltip ? /* @__PURE__ */
|
|
366
|
+
return tooltip ? /* @__PURE__ */ jsx6(Tooltip, { childrenClassName: "flex items-center justify-center", message: tooltip, sideTooltip, children: buttonNode }) : buttonNode;
|
|
338
367
|
}
|
|
339
368
|
);
|
|
340
369
|
Button.displayName = "Button";
|
|
341
370
|
|
|
371
|
+
// src/components/chip.tsx
|
|
372
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
373
|
+
import * as React4 from "react";
|
|
374
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
375
|
+
var chipVariants = cva2(
|
|
376
|
+
"focus-visible:ring-ring inline-flex cursor-pointer items-center justify-center rounded-full px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:outline-none",
|
|
377
|
+
{
|
|
378
|
+
defaultVariants: {
|
|
379
|
+
active: false
|
|
380
|
+
},
|
|
381
|
+
variants: {
|
|
382
|
+
active: {
|
|
383
|
+
false: "bg-inactive text-inactive-text hover:bg-hover",
|
|
384
|
+
true: "bg-primary text-inverse"
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
var Chip = React4.forwardRef(({ active, className, ...props }, ref) => /* @__PURE__ */ jsx7("button", { className: cn(chipVariants({ active }), className), ref, type: "button", ...props }));
|
|
390
|
+
Chip.displayName = "Chip";
|
|
391
|
+
|
|
342
392
|
// src/components/command.tsx
|
|
343
|
-
import { MagnifyingGlassIcon } from "@
|
|
393
|
+
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
344
394
|
import { Command as CommandPrimitive } from "cmdk";
|
|
345
|
-
import * as
|
|
395
|
+
import * as React6 from "react";
|
|
346
396
|
|
|
347
397
|
// src/components/dialog.tsx
|
|
398
|
+
import { XIcon } from "@phosphor-icons/react";
|
|
348
399
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
349
|
-
import
|
|
350
|
-
import
|
|
351
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
400
|
+
import * as React5 from "react";
|
|
401
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
352
402
|
var Dialog = DialogPrimitive.Root;
|
|
353
403
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
354
404
|
var DialogPortal = DialogPrimitive.Portal;
|
|
355
405
|
var DialogClose = DialogPrimitive.Close;
|
|
356
|
-
var DialogOverlay =
|
|
406
|
+
var DialogOverlay = React5.forwardRef(({ className, isAbsolute = false, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
357
407
|
DialogPrimitive.Overlay,
|
|
358
408
|
{
|
|
359
409
|
className: cn(
|
|
360
|
-
|
|
410
|
+
`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-foreground/10 ${zDialogOverlay} backdrop-blur-xs`,
|
|
361
411
|
isAbsolute ? "absolute inset-0" : "fixed inset-0",
|
|
362
412
|
className
|
|
363
413
|
),
|
|
@@ -366,16 +416,16 @@ var DialogOverlay = React3.forwardRef(({ className, isAbsolute = false, ...props
|
|
|
366
416
|
}
|
|
367
417
|
));
|
|
368
418
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
369
|
-
var DialogContent =
|
|
419
|
+
var DialogContent = React5.forwardRef(
|
|
370
420
|
({ children, className, closeLabel, container, isAbsolute = false, isCloseIcon = false, overlayClassName, ...props }, ref) => {
|
|
371
421
|
const t = useUiT();
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsxs7(DialogPortal, { container, children: [
|
|
423
|
+
/* @__PURE__ */ jsx8(DialogOverlay, { className: overlayClassName, isAbsolute }),
|
|
424
|
+
/* @__PURE__ */ jsxs7(
|
|
375
425
|
DialogPrimitive.Content,
|
|
376
426
|
{
|
|
377
427
|
className: cn(
|
|
378
|
-
|
|
428
|
+
`bg-surface 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ${zDialogContent} grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl p-6 shadow-lg duration-200 outline-none`,
|
|
379
429
|
isAbsolute ? "absolute top-[50%] left-[50%]" : "fixed top-[50%] left-[50%]",
|
|
380
430
|
className
|
|
381
431
|
),
|
|
@@ -383,9 +433,9 @@ var DialogContent = React3.forwardRef(
|
|
|
383
433
|
...props,
|
|
384
434
|
children: [
|
|
385
435
|
children,
|
|
386
|
-
isCloseIcon && /* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
436
|
+
isCloseIcon && /* @__PURE__ */ jsxs7(DialogPrimitive.Close, { className: "data-[state=open]:text-muted ring-offset-surface focus:ring-ring data-[state=open]:bg-hover hover:bg-hover absolute top-5 right-5 flex h-8 w-8 min-w-8 cursor-pointer items-center justify-center rounded-full bg-transparent opacity-70 transition-all hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
|
|
437
|
+
/* @__PURE__ */ jsx8(XIcon, { className: "text-body h-4 w-4" }),
|
|
438
|
+
/* @__PURE__ */ jsx8("span", { className: "sr-only", children: closeLabel ?? t("dialog.close") })
|
|
389
439
|
] })
|
|
390
440
|
]
|
|
391
441
|
}
|
|
@@ -394,9 +444,9 @@ var DialogContent = React3.forwardRef(
|
|
|
394
444
|
}
|
|
395
445
|
);
|
|
396
446
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
397
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
447
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx8("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
398
448
|
DialogHeader.displayName = "DialogHeader";
|
|
399
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
449
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx8(
|
|
400
450
|
"div",
|
|
401
451
|
{
|
|
402
452
|
className: cn("flex flex-col-reverse justify-center gap-2 rounded-2xl sm:flex-row", className),
|
|
@@ -404,22 +454,22 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx6(
|
|
|
404
454
|
}
|
|
405
455
|
);
|
|
406
456
|
DialogFooter.displayName = "DialogFooter";
|
|
407
|
-
var DialogTitle =
|
|
457
|
+
var DialogTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
408
458
|
DialogPrimitive.Title,
|
|
409
459
|
{
|
|
410
460
|
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
411
461
|
ref,
|
|
412
462
|
...props,
|
|
413
|
-
children: /* @__PURE__ */
|
|
463
|
+
children: /* @__PURE__ */ jsx8("span", { children: props.children })
|
|
414
464
|
}
|
|
415
465
|
));
|
|
416
466
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
417
|
-
var DialogDescription =
|
|
467
|
+
var DialogDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(DialogPrimitive.Description, { className: cn("text-muted text-sm", className), ref, ...props, children: /* @__PURE__ */ jsx8("span", { children: props.children }) }));
|
|
418
468
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
419
469
|
|
|
420
470
|
// src/components/command.tsx
|
|
421
|
-
import { jsx as
|
|
422
|
-
var Command =
|
|
471
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
472
|
+
var Command = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
423
473
|
CommandPrimitive,
|
|
424
474
|
{
|
|
425
475
|
className: cn("bg-surface text-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
|
|
@@ -429,11 +479,11 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
429
479
|
));
|
|
430
480
|
Command.displayName = CommandPrimitive.displayName;
|
|
431
481
|
var CommandDialog = ({ children, ...props }) => {
|
|
432
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ jsx9(Dialog, { ...props, children: /* @__PURE__ */ jsx9(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsx9(Command, { className: "**:[[cmdk-group-heading]]:text-muted [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3", children }) }) });
|
|
433
483
|
};
|
|
434
|
-
var CommandInput =
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
484
|
+
var CommandInput = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
485
|
+
/* @__PURE__ */ jsx9(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
486
|
+
/* @__PURE__ */ jsx9(
|
|
437
487
|
CommandPrimitive.Input,
|
|
438
488
|
{
|
|
439
489
|
className: cn(
|
|
@@ -446,11 +496,11 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
446
496
|
)
|
|
447
497
|
] }));
|
|
448
498
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
449
|
-
var CommandList =
|
|
499
|
+
var CommandList = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(CommandPrimitive.List, { className: cn("max-h-75 overflow-x-hidden overflow-y-auto", className), ref, ...props }));
|
|
450
500
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
451
|
-
var CommandEmpty =
|
|
501
|
+
var CommandEmpty = React6.forwardRef((props, ref) => /* @__PURE__ */ jsx9(CommandPrimitive.Empty, { className: "py-6 text-center text-sm", ref, ...props }));
|
|
452
502
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
453
|
-
var CommandGroup =
|
|
503
|
+
var CommandGroup = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
454
504
|
CommandPrimitive.Group,
|
|
455
505
|
{
|
|
456
506
|
className: cn(
|
|
@@ -462,9 +512,9 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
462
512
|
}
|
|
463
513
|
));
|
|
464
514
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
465
|
-
var CommandSeparator =
|
|
515
|
+
var CommandSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(CommandPrimitive.Separator, { className: cn("bg-border -mx-1 h-px", className), ref, ...props }));
|
|
466
516
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
467
|
-
var CommandItem =
|
|
517
|
+
var CommandItem = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
468
518
|
CommandPrimitive.Item,
|
|
469
519
|
{
|
|
470
520
|
className: cn(
|
|
@@ -477,25 +527,25 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
477
527
|
));
|
|
478
528
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
479
529
|
var CommandShortcut = ({ className, ...props }) => {
|
|
480
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ jsx9("span", { className: cn("text-muted ml-auto text-xs tracking-widest", className), ...props });
|
|
481
531
|
};
|
|
482
532
|
CommandShortcut.displayName = "CommandShortcut";
|
|
483
533
|
|
|
484
534
|
// src/components/form.tsx
|
|
485
535
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
486
|
-
import * as
|
|
536
|
+
import * as React7 from "react";
|
|
487
537
|
import { Controller, FormProvider, useFormContext } from "react-hook-form";
|
|
488
|
-
import { jsx as
|
|
538
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
489
539
|
var Form = FormProvider;
|
|
490
|
-
var FormFieldContext =
|
|
540
|
+
var FormFieldContext = React7.createContext(null);
|
|
491
541
|
var FormField = ({
|
|
492
542
|
...props
|
|
493
543
|
}) => {
|
|
494
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ jsx10(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx10(Controller, { ...props }) });
|
|
495
545
|
};
|
|
496
546
|
var useFormField = () => {
|
|
497
|
-
const fieldContext =
|
|
498
|
-
const itemContext =
|
|
547
|
+
const fieldContext = React7.useContext(FormFieldContext);
|
|
548
|
+
const itemContext = React7.useContext(FormItemContext);
|
|
499
549
|
const { formState, getFieldState } = useFormContext();
|
|
500
550
|
if (!fieldContext) {
|
|
501
551
|
throw new Error("useFormField must be used within <FormField>");
|
|
@@ -514,18 +564,18 @@ var useFormField = () => {
|
|
|
514
564
|
...fieldState
|
|
515
565
|
};
|
|
516
566
|
};
|
|
517
|
-
var FormItemContext =
|
|
518
|
-
var FormItem =
|
|
567
|
+
var FormItemContext = React7.createContext(null);
|
|
568
|
+
var FormItem = React7.forwardRef(
|
|
519
569
|
({ className, ...props }, ref) => {
|
|
520
|
-
const id =
|
|
521
|
-
return /* @__PURE__ */
|
|
570
|
+
const id = React7.useId();
|
|
571
|
+
return /* @__PURE__ */ jsx10(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx10("div", { className: cn("space-y-1", className), ref, ...props }) });
|
|
522
572
|
}
|
|
523
573
|
);
|
|
524
574
|
FormItem.displayName = "FormItem";
|
|
525
|
-
var FormControl =
|
|
575
|
+
var FormControl = React7.forwardRef(
|
|
526
576
|
({ ...props }, ref) => {
|
|
527
577
|
const { error, formDescriptionId, formItemId, formMessageId } = useFormField();
|
|
528
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx10(
|
|
529
579
|
Slot2,
|
|
530
580
|
{
|
|
531
581
|
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
@@ -538,14 +588,14 @@ var FormControl = React5.forwardRef(
|
|
|
538
588
|
}
|
|
539
589
|
);
|
|
540
590
|
FormControl.displayName = "FormControl";
|
|
541
|
-
var FormMessage =
|
|
591
|
+
var FormMessage = React7.forwardRef(
|
|
542
592
|
({ children, className, ...props }, ref) => {
|
|
543
593
|
const { error, formMessageId } = useFormField();
|
|
544
594
|
const body = error?.message ? String(error.message) : children;
|
|
545
595
|
if (!body) {
|
|
546
596
|
return null;
|
|
547
597
|
}
|
|
548
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ jsx10(
|
|
549
599
|
"p",
|
|
550
600
|
{
|
|
551
601
|
className: cn("text-destructive text-[0.8rem] font-medium", className),
|
|
@@ -561,13 +611,13 @@ FormMessage.displayName = "FormMessage";
|
|
|
561
611
|
|
|
562
612
|
// src/components/form-fields/input-field.tsx
|
|
563
613
|
import { useState } from "react";
|
|
564
|
-
import { EyeIcon, EyeSlashIcon, XIcon } from "@phosphor-icons/react";
|
|
614
|
+
import { EyeIcon, EyeSlashIcon, XIcon as XIcon2 } from "@phosphor-icons/react";
|
|
565
615
|
|
|
566
616
|
// src/components/input.tsx
|
|
567
|
-
import * as
|
|
568
|
-
import { jsx as
|
|
569
|
-
var Input =
|
|
570
|
-
return /* @__PURE__ */
|
|
617
|
+
import * as React8 from "react";
|
|
618
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
619
|
+
var Input = React8.forwardRef(({ className, onKeyDown, type, ...props }, ref) => {
|
|
620
|
+
return /* @__PURE__ */ jsx11(
|
|
571
621
|
"input",
|
|
572
622
|
{
|
|
573
623
|
className: cn(
|
|
@@ -598,32 +648,56 @@ Input.displayName = "Input";
|
|
|
598
648
|
|
|
599
649
|
// src/components/label.tsx
|
|
600
650
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
601
|
-
import { cva as
|
|
602
|
-
import * as
|
|
603
|
-
import { jsx as
|
|
604
|
-
var labelVariants =
|
|
605
|
-
var Label =
|
|
651
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
652
|
+
import * as React9 from "react";
|
|
653
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
654
|
+
var labelVariants = cva3("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
655
|
+
var Label = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props }));
|
|
606
656
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
607
657
|
|
|
608
658
|
// src/components/form-fields/label-field.tsx
|
|
609
|
-
import { jsx as
|
|
659
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
610
660
|
var LabelField = ({ label, labelClassName, name, visualRequired }) => {
|
|
611
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsxs9(
|
|
612
662
|
Label,
|
|
613
663
|
{
|
|
614
664
|
className: cn("text-body mb-2 text-start text-sm leading-none font-normal tracking-normal", labelClassName),
|
|
615
665
|
htmlFor: name,
|
|
616
666
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ jsx13("span", { children: label }),
|
|
618
668
|
" ",
|
|
619
|
-
visualRequired && /* @__PURE__ */
|
|
669
|
+
visualRequired && /* @__PURE__ */ jsx13("span", { className: "text-destructive", children: " *" })
|
|
620
670
|
]
|
|
621
671
|
}
|
|
622
672
|
);
|
|
623
673
|
};
|
|
624
674
|
|
|
675
|
+
// src/components/form-fields/form-field-shell.tsx
|
|
676
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
677
|
+
var FormFieldShell = ({
|
|
678
|
+
children,
|
|
679
|
+
hasError,
|
|
680
|
+
label,
|
|
681
|
+
labelClassName,
|
|
682
|
+
mainClassName,
|
|
683
|
+
name,
|
|
684
|
+
visualRequired
|
|
685
|
+
}) => /* @__PURE__ */ jsxs10(FormItem, { className: cn("flex flex-col", mainClassName), children: [
|
|
686
|
+
/* @__PURE__ */ jsx14(
|
|
687
|
+
LabelField,
|
|
688
|
+
{
|
|
689
|
+
label,
|
|
690
|
+
labelClassName: cn(labelClassName, hasError && "text-destructive"),
|
|
691
|
+
name,
|
|
692
|
+
visualRequired
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
/* @__PURE__ */ jsx14(FormControl, { children }),
|
|
696
|
+
/* @__PURE__ */ jsx14(FormMessage, {})
|
|
697
|
+
] });
|
|
698
|
+
|
|
625
699
|
// src/components/form-fields/input-field.tsx
|
|
626
|
-
import { jsx as
|
|
700
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
627
701
|
var InputField = ({
|
|
628
702
|
clearLabel,
|
|
629
703
|
control,
|
|
@@ -648,67 +722,68 @@ var InputField = ({
|
|
|
648
722
|
};
|
|
649
723
|
const isPassword = type === "password";
|
|
650
724
|
const inputType = isPassword ? isPasswordVisible ? "text" : "password" : type;
|
|
651
|
-
return /* @__PURE__ */
|
|
725
|
+
return /* @__PURE__ */ jsx15(
|
|
652
726
|
FormField,
|
|
653
727
|
{
|
|
654
728
|
control,
|
|
655
729
|
name,
|
|
656
730
|
render: ({ field, fieldState }) => {
|
|
657
731
|
const hasError = !!fieldState.error;
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
Input,
|
|
671
|
-
{
|
|
672
|
-
...field,
|
|
673
|
-
autoComplete: isPassword ? "current-password" : void 0,
|
|
674
|
-
className: cn(
|
|
675
|
-
inputClassName,
|
|
676
|
-
hasError && "border-destructive",
|
|
677
|
-
isPassword && "pr-10 [&::-ms-reveal]:hidden"
|
|
678
|
-
),
|
|
679
|
-
"data-no-password-toggle": true,
|
|
680
|
-
disabled,
|
|
681
|
-
min: type === "number" ? 0 : void 0,
|
|
682
|
-
placeholder,
|
|
683
|
-
type: inputType,
|
|
684
|
-
value: field.value ?? ""
|
|
685
|
-
}
|
|
686
|
-
),
|
|
687
|
-
/* @__PURE__ */ jsxs9("div", { className: "absolute inset-y-0 right-0 flex items-center space-x-2 pr-2", children: [
|
|
688
|
-
field.value && isClearable && /* @__PURE__ */ jsx12(
|
|
689
|
-
"button",
|
|
732
|
+
return /* @__PURE__ */ jsx15(
|
|
733
|
+
FormFieldShell,
|
|
734
|
+
{
|
|
735
|
+
hasError,
|
|
736
|
+
label,
|
|
737
|
+
labelClassName,
|
|
738
|
+
mainClassName,
|
|
739
|
+
name,
|
|
740
|
+
visualRequired,
|
|
741
|
+
children: /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
742
|
+
/* @__PURE__ */ jsx15(
|
|
743
|
+
Input,
|
|
690
744
|
{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
745
|
+
...field,
|
|
746
|
+
autoComplete: isPassword ? "current-password" : void 0,
|
|
747
|
+
className: cn(
|
|
748
|
+
inputClassName,
|
|
749
|
+
hasError && "border-destructive",
|
|
750
|
+
isPassword && "pr-10 [&::-ms-reveal]:hidden"
|
|
751
|
+
),
|
|
752
|
+
"data-1p-ignore": isPassword || void 0,
|
|
753
|
+
"data-bwignore": isPassword || void 0,
|
|
754
|
+
"data-lpignore": isPassword || void 0,
|
|
755
|
+
disabled,
|
|
756
|
+
min: type === "number" ? 0 : void 0,
|
|
757
|
+
placeholder,
|
|
758
|
+
type: inputType,
|
|
759
|
+
value: field.value ?? ""
|
|
696
760
|
}
|
|
697
761
|
),
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
762
|
+
/* @__PURE__ */ jsxs11("div", { className: "absolute inset-y-0 right-0 flex items-center space-x-2 pr-2", children: [
|
|
763
|
+
field.value && isClearable && /* @__PURE__ */ jsx15(
|
|
764
|
+
"button",
|
|
765
|
+
{
|
|
766
|
+
className: "focus:outline-none",
|
|
767
|
+
onClick: onClear,
|
|
768
|
+
title: clearLabel ?? t("inputField.clear"),
|
|
769
|
+
type: "button",
|
|
770
|
+
children: /* @__PURE__ */ jsx15(XIcon2, { size: 18 })
|
|
771
|
+
}
|
|
772
|
+
),
|
|
773
|
+
type === "password" && /* @__PURE__ */ jsx15(
|
|
774
|
+
"button",
|
|
775
|
+
{
|
|
776
|
+
className: "focus:outline-none",
|
|
777
|
+
onClick: togglePasswordVisibility,
|
|
778
|
+
title: isPasswordVisible ? hidePasswordLabel ?? t("inputField.hidePassword") : showPasswordLabel ?? t("inputField.showPassword"),
|
|
779
|
+
type: "button",
|
|
780
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx15(EyeIcon, { size: 18 }) : /* @__PURE__ */ jsx15(EyeSlashIcon, { size: 20 })
|
|
781
|
+
}
|
|
782
|
+
)
|
|
783
|
+
] })
|
|
708
784
|
] })
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
] });
|
|
785
|
+
}
|
|
786
|
+
);
|
|
712
787
|
}
|
|
713
788
|
}
|
|
714
789
|
);
|
|
@@ -745,6 +820,7 @@ function useGoogleMapPicker({
|
|
|
745
820
|
locationZoom,
|
|
746
821
|
onAddressResolved,
|
|
747
822
|
onChange,
|
|
823
|
+
onError,
|
|
748
824
|
value
|
|
749
825
|
}) {
|
|
750
826
|
const placesLib = useMapsLibrary("places");
|
|
@@ -752,11 +828,13 @@ function useGoogleMapPicker({
|
|
|
752
828
|
const map = useMap(PICKER_MAP_ID);
|
|
753
829
|
const onChangeRef = useRef(onChange);
|
|
754
830
|
const onResolvedRef = useRef(onAddressResolved);
|
|
831
|
+
const onErrorRef = useRef(onError);
|
|
755
832
|
const geocoder = useMemo(
|
|
756
833
|
() => geocodingLib ? new geocodingLib.Geocoder() : null,
|
|
757
834
|
[geocodingLib]
|
|
758
835
|
);
|
|
759
836
|
const debounceRef = useRef(null);
|
|
837
|
+
const blurTimeoutRef = useRef(null);
|
|
760
838
|
const [inputValue, setInputValue] = useState2(value);
|
|
761
839
|
const [suggestions, setSuggestions] = useState2([]);
|
|
762
840
|
const [showDropdown, setShowDropdown] = useState2(false);
|
|
@@ -765,7 +843,15 @@ function useGoogleMapPicker({
|
|
|
765
843
|
useEffect(() => {
|
|
766
844
|
onChangeRef.current = onChange;
|
|
767
845
|
onResolvedRef.current = onAddressResolved;
|
|
846
|
+
onErrorRef.current = onError;
|
|
768
847
|
});
|
|
848
|
+
useEffect(
|
|
849
|
+
() => () => {
|
|
850
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
851
|
+
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
852
|
+
},
|
|
853
|
+
[]
|
|
854
|
+
);
|
|
769
855
|
useEffect(() => {
|
|
770
856
|
setInputValue(value);
|
|
771
857
|
}, [value]);
|
|
@@ -796,14 +882,17 @@ function useGoogleMapPicker({
|
|
|
796
882
|
const loc = results[0].geometry.location;
|
|
797
883
|
map.panTo({ lat: loc.lat(), lng: loc.lng() });
|
|
798
884
|
map.setZoom(locationZoom ?? CITY_ZOOM);
|
|
799
|
-
} catch {
|
|
800
|
-
|
|
885
|
+
} catch (error) {
|
|
886
|
+
if (!ctrl.cancelled) {
|
|
887
|
+
console.error("[GoogleMapPicker] geocode by query failed", error);
|
|
888
|
+
onErrorRef.current?.(error);
|
|
889
|
+
}
|
|
801
890
|
}
|
|
802
891
|
})();
|
|
803
892
|
return () => {
|
|
804
893
|
ctrl.cancelled = true;
|
|
805
894
|
};
|
|
806
|
-
}, [geocoder, locationQuery, locationZoom, map]);
|
|
895
|
+
}, [geocoder, locationQuery, locationZoom, map, position]);
|
|
807
896
|
const fetchSuggestions = useCallback(
|
|
808
897
|
async (input) => {
|
|
809
898
|
if (!placesLib || input.length < 2) {
|
|
@@ -818,7 +907,9 @@ function useGoogleMapPicker({
|
|
|
818
907
|
});
|
|
819
908
|
setSuggestions(result.suggestions);
|
|
820
909
|
setShowDropdown(true);
|
|
821
|
-
} catch {
|
|
910
|
+
} catch (error) {
|
|
911
|
+
console.error("[GoogleMapPicker] fetchAutocompleteSuggestions failed", error);
|
|
912
|
+
onErrorRef.current?.(error);
|
|
822
913
|
setSuggestions([]);
|
|
823
914
|
}
|
|
824
915
|
},
|
|
@@ -839,8 +930,9 @@ function useGoogleMapPicker({
|
|
|
839
930
|
);
|
|
840
931
|
onResolvedRef.current?.({ address, lat: latLng.lat, lng: latLng.lng, ...parts });
|
|
841
932
|
}
|
|
842
|
-
} catch {
|
|
843
|
-
|
|
933
|
+
} catch (error) {
|
|
934
|
+
console.error("[GoogleMapPicker] reverse geocode failed", error);
|
|
935
|
+
onErrorRef.current?.(error);
|
|
844
936
|
}
|
|
845
937
|
},
|
|
846
938
|
[geocoder]
|
|
@@ -874,7 +966,8 @@ function useGoogleMapPicker({
|
|
|
874
966
|
if (placesLib) setSessionToken(new placesLib.AutocompleteSessionToken());
|
|
875
967
|
};
|
|
876
968
|
const handleBlur = () => {
|
|
877
|
-
|
|
969
|
+
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
970
|
+
blurTimeoutRef.current = setTimeout(() => setShowDropdown(false), 150);
|
|
878
971
|
};
|
|
879
972
|
const handleMapClick = useCallback(
|
|
880
973
|
(e) => {
|
|
@@ -910,10 +1003,10 @@ function useGoogleMapPicker({
|
|
|
910
1003
|
}
|
|
911
1004
|
|
|
912
1005
|
// src/components/google-map-picker.tsx
|
|
913
|
-
import { jsx as
|
|
1006
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
914
1007
|
var DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
|
|
915
1008
|
var MapPickerContent = (props) => {
|
|
916
|
-
const { disabled, hasError, placeholder } = props;
|
|
1009
|
+
const { disabled, hasError, mapId, placeholder } = props;
|
|
917
1010
|
const {
|
|
918
1011
|
handleBlur,
|
|
919
1012
|
handleInputChange,
|
|
@@ -926,9 +1019,9 @@ var MapPickerContent = (props) => {
|
|
|
926
1019
|
showDropdown,
|
|
927
1020
|
suggestions
|
|
928
1021
|
} = useGoogleMapPicker(props);
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3", children: [
|
|
1023
|
+
/* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
1024
|
+
/* @__PURE__ */ jsx16(
|
|
932
1025
|
"input",
|
|
933
1026
|
{
|
|
934
1027
|
className: cn(inputBase, inputFocus, hasError && "border-destructive"),
|
|
@@ -941,7 +1034,7 @@ var MapPickerContent = (props) => {
|
|
|
941
1034
|
value: inputValue
|
|
942
1035
|
}
|
|
943
1036
|
),
|
|
944
|
-
showDropdown && suggestions.length > 0 && /* @__PURE__ */
|
|
1037
|
+
showDropdown && suggestions.length > 0 && /* @__PURE__ */ jsx16("ul", { className: cn("border-border bg-surface absolute mt-1 w-full overflow-hidden rounded-[10px] border shadow-md", zPopover), children: suggestions.map((suggestion) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(
|
|
945
1038
|
"button",
|
|
946
1039
|
{
|
|
947
1040
|
className: "text-foreground hover:bg-hover w-full px-4 py-3 text-left text-sm transition-colors",
|
|
@@ -951,7 +1044,7 @@ var MapPickerContent = (props) => {
|
|
|
951
1044
|
}
|
|
952
1045
|
) }, suggestion.placePrediction?.placeId ?? suggestion.placePrediction?.text.text)) })
|
|
953
1046
|
] }),
|
|
954
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ jsx16("div", { className: "border-border h-59 overflow-hidden rounded-[10px] border md:h-87.5", children: /* @__PURE__ */ jsx16(
|
|
955
1048
|
Map2,
|
|
956
1049
|
{
|
|
957
1050
|
defaultCenter: DEFAULT_CENTER,
|
|
@@ -959,18 +1052,26 @@ var MapPickerContent = (props) => {
|
|
|
959
1052
|
disableDefaultUI: true,
|
|
960
1053
|
gestureHandling: "cooperative",
|
|
961
1054
|
id: PICKER_MAP_ID,
|
|
962
|
-
mapId: import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
|
|
1055
|
+
mapId: mapId ?? import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
|
|
963
1056
|
onClick: handleMapClick,
|
|
964
1057
|
style: { height: "100%", width: "100%" },
|
|
965
|
-
children: position && /* @__PURE__ */
|
|
1058
|
+
children: position && /* @__PURE__ */ jsx16(AdvancedMarker, { draggable: !disabled, onDragEnd: handleMarkerDragEnd, position })
|
|
966
1059
|
}
|
|
967
1060
|
) })
|
|
968
1061
|
] });
|
|
969
1062
|
};
|
|
970
|
-
var GoogleMapPicker = (props) => /* @__PURE__ */
|
|
1063
|
+
var GoogleMapPicker = (props) => /* @__PURE__ */ jsx16(
|
|
1064
|
+
APIProvider,
|
|
1065
|
+
{
|
|
1066
|
+
apiKey: props.apiKey ?? import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? "",
|
|
1067
|
+
language: "es",
|
|
1068
|
+
region: "CO",
|
|
1069
|
+
children: /* @__PURE__ */ jsx16(MapPickerContent, { ...props })
|
|
1070
|
+
}
|
|
1071
|
+
);
|
|
971
1072
|
|
|
972
1073
|
// src/components/form-fields/map-picker-field.tsx
|
|
973
|
-
import { jsx as
|
|
1074
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
974
1075
|
var MapPickerField = ({
|
|
975
1076
|
control,
|
|
976
1077
|
label,
|
|
@@ -979,45 +1080,44 @@ var MapPickerField = ({
|
|
|
979
1080
|
name,
|
|
980
1081
|
visualRequired,
|
|
981
1082
|
...pickerProps
|
|
982
|
-
}) => /* @__PURE__ */
|
|
1083
|
+
}) => /* @__PURE__ */ jsx17(
|
|
983
1084
|
FormField,
|
|
984
1085
|
{
|
|
985
1086
|
control,
|
|
986
1087
|
name,
|
|
987
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
] })
|
|
1088
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx17(
|
|
1089
|
+
FormFieldShell,
|
|
1090
|
+
{
|
|
1091
|
+
hasError: !!fieldState.error,
|
|
1092
|
+
label,
|
|
1093
|
+
labelClassName,
|
|
1094
|
+
mainClassName,
|
|
1095
|
+
name,
|
|
1096
|
+
visualRequired,
|
|
1097
|
+
children: /* @__PURE__ */ jsx17(
|
|
1098
|
+
GoogleMapPicker,
|
|
1099
|
+
{
|
|
1100
|
+
...pickerProps,
|
|
1101
|
+
hasError: !!fieldState.error,
|
|
1102
|
+
onChange: field.onChange,
|
|
1103
|
+
value: field.value ?? ""
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1106
|
+
}
|
|
1107
|
+
)
|
|
1008
1108
|
}
|
|
1009
1109
|
);
|
|
1010
1110
|
|
|
1011
1111
|
// src/components/otp-input.tsx
|
|
1012
1112
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1013
|
-
import
|
|
1014
|
-
import { jsx as
|
|
1113
|
+
import React10 from "react";
|
|
1114
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1015
1115
|
function InputOTP({
|
|
1016
1116
|
className,
|
|
1017
1117
|
containerClassName,
|
|
1018
1118
|
...props
|
|
1019
1119
|
}) {
|
|
1020
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ jsx18(
|
|
1021
1121
|
OTPInput,
|
|
1022
1122
|
{
|
|
1023
1123
|
className: cn("disabled:cursor-not-allowed", className),
|
|
@@ -1028,16 +1128,16 @@ function InputOTP({
|
|
|
1028
1128
|
);
|
|
1029
1129
|
}
|
|
1030
1130
|
function InputOTPGroup({ className, ...props }) {
|
|
1031
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ jsx18("div", { className: cn("flex items-center gap-2", className), "data-slot": "input-otp-group", ...props });
|
|
1032
1132
|
}
|
|
1033
1133
|
function InputOTPSlot({
|
|
1034
1134
|
className,
|
|
1035
1135
|
index,
|
|
1036
1136
|
...props
|
|
1037
1137
|
}) {
|
|
1038
|
-
const inputOTPContext =
|
|
1138
|
+
const inputOTPContext = React10.useContext(OTPInputContext);
|
|
1039
1139
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {};
|
|
1040
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ jsxs13(
|
|
1041
1141
|
"div",
|
|
1042
1142
|
{
|
|
1043
1143
|
className: cn(
|
|
@@ -1052,14 +1152,14 @@ function InputOTPSlot({
|
|
|
1052
1152
|
...props,
|
|
1053
1153
|
children: [
|
|
1054
1154
|
char,
|
|
1055
|
-
hasFakeCaret && /* @__PURE__ */
|
|
1155
|
+
hasFakeCaret && /* @__PURE__ */ jsx18("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx18("div", { className: "animate-caret-blink bg-foreground h-6 w-px duration-1000" }) })
|
|
1056
1156
|
]
|
|
1057
1157
|
}
|
|
1058
1158
|
);
|
|
1059
1159
|
}
|
|
1060
1160
|
|
|
1061
1161
|
// src/components/form-fields/otp-field.tsx
|
|
1062
|
-
import { jsx as
|
|
1162
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1063
1163
|
function OTPField({
|
|
1064
1164
|
autoFocus,
|
|
1065
1165
|
className,
|
|
@@ -1069,16 +1169,25 @@ function OTPField({
|
|
|
1069
1169
|
label,
|
|
1070
1170
|
labelClassName,
|
|
1071
1171
|
name,
|
|
1072
|
-
otpLength = 6
|
|
1172
|
+
otpLength = 6,
|
|
1173
|
+
visualRequired
|
|
1073
1174
|
}) {
|
|
1074
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ jsx19(
|
|
1075
1176
|
FormField,
|
|
1076
1177
|
{
|
|
1077
1178
|
control,
|
|
1078
1179
|
name,
|
|
1079
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
1080
|
-
label ? /* @__PURE__ */
|
|
1081
|
-
|
|
1180
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs14(FormItem, { className: cn("flex flex-col", className), children: [
|
|
1181
|
+
label ? /* @__PURE__ */ jsx19(
|
|
1182
|
+
LabelField,
|
|
1183
|
+
{
|
|
1184
|
+
label,
|
|
1185
|
+
labelClassName: cn(labelClassName, fieldState.invalid && "text-destructive"),
|
|
1186
|
+
name,
|
|
1187
|
+
visualRequired
|
|
1188
|
+
}
|
|
1189
|
+
) : null,
|
|
1190
|
+
/* @__PURE__ */ jsx19(FormControl, { children: /* @__PURE__ */ jsx19(
|
|
1082
1191
|
InputOTP,
|
|
1083
1192
|
{
|
|
1084
1193
|
"aria-invalid": fieldState.invalid || void 0,
|
|
@@ -1093,31 +1202,31 @@ function OTPField({
|
|
|
1093
1202
|
onPaste: (e) => field.onChange(e.clipboardData.getData("text")),
|
|
1094
1203
|
pattern: "[0-9]*",
|
|
1095
1204
|
value: field.value ?? "",
|
|
1096
|
-
children: /* @__PURE__ */
|
|
1205
|
+
children: /* @__PURE__ */ jsx19(InputOTPGroup, { children: Array.from({ length: otpLength }).map((_, i) => /* @__PURE__ */ jsx19(InputOTPSlot, { "aria-invalid": fieldState.invalid || void 0, index: i }, i)) })
|
|
1097
1206
|
}
|
|
1098
1207
|
) }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ jsx19(FormMessage, {})
|
|
1100
1209
|
] })
|
|
1101
1210
|
}
|
|
1102
1211
|
);
|
|
1103
1212
|
}
|
|
1104
1213
|
|
|
1105
1214
|
// src/components/select-input.tsx
|
|
1106
|
-
import { CaretDownIcon, CaretUpIcon, ClockIcon, XIcon as
|
|
1107
|
-
import { cloneElement, useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1215
|
+
import { CaretDownIcon, CaretUpIcon, ClockIcon, XIcon as XIcon3 } from "@phosphor-icons/react";
|
|
1216
|
+
import { cloneElement, useCallback as useCallback2, useEffect as useEffect3, useId as useId2, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1108
1217
|
|
|
1109
1218
|
// src/components/popover.tsx
|
|
1110
1219
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1111
|
-
import * as
|
|
1112
|
-
import { jsx as
|
|
1220
|
+
import * as React11 from "react";
|
|
1221
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1113
1222
|
var Popover = PopoverPrimitive.Root;
|
|
1114
1223
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1115
|
-
var PopoverContent =
|
|
1224
|
+
var PopoverContent = React11.forwardRef(({ align = "center", className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx20(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx20(
|
|
1116
1225
|
PopoverPrimitive.Content,
|
|
1117
1226
|
{
|
|
1118
1227
|
align,
|
|
1119
1228
|
className: cn(
|
|
1120
|
-
|
|
1229
|
+
`text-foreground bg-surface 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ${zPopover} w-72 rounded-md border p-4 shadow-md outline-none`,
|
|
1121
1230
|
className
|
|
1122
1231
|
),
|
|
1123
1232
|
ref,
|
|
@@ -1163,7 +1272,7 @@ function usePopoverWidth() {
|
|
|
1163
1272
|
}
|
|
1164
1273
|
|
|
1165
1274
|
// src/components/select-input.tsx
|
|
1166
|
-
import { Fragment as Fragment3, jsx as
|
|
1275
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1167
1276
|
var SelectInput = (props) => {
|
|
1168
1277
|
const t = useUiT();
|
|
1169
1278
|
const {
|
|
@@ -1189,6 +1298,7 @@ var SelectInput = (props) => {
|
|
|
1189
1298
|
valueKey = "value"
|
|
1190
1299
|
} = props;
|
|
1191
1300
|
const resolvedPlaceholder = placeholder ?? t("selectInput.placeholder");
|
|
1301
|
+
const listboxId = useId2();
|
|
1192
1302
|
const [open, setOpen] = useState4(false);
|
|
1193
1303
|
const [valueItem, setValueItem] = useState4(value);
|
|
1194
1304
|
const { ref: divRef, width } = usePopoverWidth();
|
|
@@ -1225,95 +1335,102 @@ var SelectInput = (props) => {
|
|
|
1225
1335
|
useEffect3(() => {
|
|
1226
1336
|
setValueItem(value);
|
|
1227
1337
|
}, [value]);
|
|
1228
|
-
return /* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1338
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ jsxs15("div", { className: "relative flex flex-col justify-center", children: [
|
|
1339
|
+
/* @__PURE__ */ jsxs15(Popover, { onOpenChange: setOpen, open, children: [
|
|
1340
|
+
/* @__PURE__ */ jsx21(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
1341
|
+
Button,
|
|
1342
|
+
{
|
|
1343
|
+
"aria-controls": listboxId,
|
|
1344
|
+
"aria-expanded": open,
|
|
1345
|
+
"aria-haspopup": "listbox",
|
|
1346
|
+
className: buttonClassName,
|
|
1347
|
+
disabled,
|
|
1348
|
+
isLoading: loading,
|
|
1349
|
+
onBlur,
|
|
1350
|
+
ref: divRef,
|
|
1351
|
+
role: "combobox",
|
|
1352
|
+
variant: "primary",
|
|
1353
|
+
children: loading ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
1354
|
+
loadingLabel ?? t("selectInput.loading"),
|
|
1355
|
+
" ",
|
|
1356
|
+
/* @__PURE__ */ jsx21(Spinner, {})
|
|
1357
|
+
] }) : /* @__PURE__ */ jsxs15("div", { className: "relative flex h-5 w-full items-center", children: [
|
|
1358
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex w-full max-w-[90%] items-center truncate", children: [
|
|
1359
|
+
leftIcon && /* @__PURE__ */ jsx21("span", { className: "mr-2 shrink-0", children: cloneElement(leftIcon, { size: 20, strokeWidth: 1 }) }),
|
|
1360
|
+
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */ jsx21("span", { className: cn(inputPlaceholder, placeholderClassName), children: resolvedPlaceholder })
|
|
1361
|
+
] }),
|
|
1362
|
+
timeField ? /* @__PURE__ */ jsx21("div", { className: "absolute top-0.5 right-0", children: /* @__PURE__ */ jsx21(ClockIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }) }) : /* @__PURE__ */ jsxs15("div", { className: "absolute top-0.5 right-0 flex gap-2", children: [
|
|
1363
|
+
ableDeleteOption && /* @__PURE__ */ jsx21("div", { "aria-hidden": true, className: "h-4 w-4 shrink-0" }),
|
|
1364
|
+
!open ? /* @__PURE__ */ jsx21(CaretDownIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }) : /* @__PURE__ */ jsx21(CaretUpIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1365
|
+
] })
|
|
1366
|
+
] })
|
|
1367
|
+
}
|
|
1368
|
+
) }),
|
|
1369
|
+
/* @__PURE__ */ jsx21(
|
|
1370
|
+
PopoverContent,
|
|
1371
|
+
{
|
|
1372
|
+
className: cn("bg-surface border-border rounded-sm p-1", zPopoverAboveDialog),
|
|
1373
|
+
id: listboxId,
|
|
1374
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1375
|
+
style: { maxWidth: "auto", minWidth: `${width}px`, width: `${width}px` },
|
|
1376
|
+
children: /* @__PURE__ */ jsxs15(Command, { className: "flex w-full flex-col gap-2", children: [
|
|
1377
|
+
search && /* @__PURE__ */ jsx21(
|
|
1378
|
+
Input,
|
|
1252
1379
|
{
|
|
1253
|
-
className: "
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
onChange?.("");
|
|
1258
|
-
onValueChange("");
|
|
1259
|
-
setValueItem("");
|
|
1260
|
-
setQuery("");
|
|
1261
|
-
setOpen(false);
|
|
1262
|
-
}
|
|
1380
|
+
className: "mb-1 rounded-sm",
|
|
1381
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1382
|
+
placeholder: searchPlaceholder ?? t("selectInput.search"),
|
|
1383
|
+
value: query
|
|
1263
1384
|
}
|
|
1264
1385
|
),
|
|
1265
|
-
|
|
1386
|
+
/* @__PURE__ */ jsx21(CommandEmpty, { className: "text-center", children: noResultsLabel ?? t("selectInput.noResults") }),
|
|
1387
|
+
/* @__PURE__ */ jsx21(CommandList, { children: /* @__PURE__ */ jsx21(CommandGroup, { className: "p-0", children: filteredOptions.map((item) => {
|
|
1388
|
+
const labelValue = item[labelKey];
|
|
1389
|
+
const valueValue = item[valueKey];
|
|
1390
|
+
return /* @__PURE__ */ jsx21(
|
|
1391
|
+
CommandItem,
|
|
1392
|
+
{
|
|
1393
|
+
className: cn(
|
|
1394
|
+
"hover:bg-hover mt-0.5 mb-0.5 flex cursor-pointer items-center gap-2 rounded-sm py-2 pl-3",
|
|
1395
|
+
valueValue === value && "bg-inactive"
|
|
1396
|
+
),
|
|
1397
|
+
onSelect: (currentValue) => {
|
|
1398
|
+
onChange?.(currentValue);
|
|
1399
|
+
onValueChange(currentValue);
|
|
1400
|
+
setOpen(false);
|
|
1401
|
+
setTimeout(() => setQuery(""), 100);
|
|
1402
|
+
},
|
|
1403
|
+
value: valueValue,
|
|
1404
|
+
children: labelValue.trim()
|
|
1405
|
+
},
|
|
1406
|
+
valueValue
|
|
1407
|
+
);
|
|
1408
|
+
}) }) })
|
|
1266
1409
|
] })
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
|
|
1410
|
+
}
|
|
1411
|
+
)
|
|
1412
|
+
] }),
|
|
1413
|
+
ableDeleteOption && !loading && !timeField && /* @__PURE__ */ jsx21(
|
|
1414
|
+
"button",
|
|
1272
1415
|
{
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
),
|
|
1286
|
-
/* @__PURE__ */ jsx18(CommandEmpty, { className: "text-center", children: noResultsLabel ?? t("selectInput.noResults") }),
|
|
1287
|
-
/* @__PURE__ */ jsx18(CommandList, { children: /* @__PURE__ */ jsx18(CommandGroup, { className: "p-0", children: filteredOptions.map((item) => {
|
|
1288
|
-
const labelValue = item[labelKey];
|
|
1289
|
-
const valueValue = item[valueKey];
|
|
1290
|
-
return /* @__PURE__ */ jsx18(
|
|
1291
|
-
CommandItem,
|
|
1292
|
-
{
|
|
1293
|
-
className: cn(
|
|
1294
|
-
"hover:bg-hover mt-0.5 mb-0.5 flex cursor-pointer items-center gap-2 rounded-sm py-2 pl-3",
|
|
1295
|
-
valueValue === value && "bg-inactive"
|
|
1296
|
-
),
|
|
1297
|
-
onSelect: (currentValue) => {
|
|
1298
|
-
onChange?.(currentValue);
|
|
1299
|
-
onValueChange(currentValue);
|
|
1300
|
-
setOpen(false);
|
|
1301
|
-
setTimeout(() => setQuery(""), 100);
|
|
1302
|
-
},
|
|
1303
|
-
value: valueValue,
|
|
1304
|
-
children: labelValue.trim()
|
|
1305
|
-
},
|
|
1306
|
-
valueValue
|
|
1307
|
-
);
|
|
1308
|
-
}) }) })
|
|
1309
|
-
] })
|
|
1416
|
+
"aria-label": t("selectInput.clear"),
|
|
1417
|
+
className: "absolute top-1/2 right-9 z-10 flex h-4 w-4 -translate-y-1/2 items-center justify-center",
|
|
1418
|
+
onClick: () => {
|
|
1419
|
+
onChange?.("");
|
|
1420
|
+
onValueChange("");
|
|
1421
|
+
setValueItem("");
|
|
1422
|
+
setQuery("");
|
|
1423
|
+
setOpen(false);
|
|
1424
|
+
},
|
|
1425
|
+
type: "button",
|
|
1426
|
+
children: /* @__PURE__ */ jsx21(XIcon3, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1310
1427
|
}
|
|
1311
1428
|
)
|
|
1312
|
-
] }) })
|
|
1429
|
+
] }) });
|
|
1313
1430
|
};
|
|
1314
1431
|
|
|
1315
1432
|
// src/components/form-fields/select-field.tsx
|
|
1316
|
-
import { jsx as
|
|
1433
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1317
1434
|
var SelectField = ({
|
|
1318
1435
|
ableDeleteOption,
|
|
1319
1436
|
className,
|
|
@@ -1323,44 +1440,47 @@ var SelectField = ({
|
|
|
1323
1440
|
labelClassName,
|
|
1324
1441
|
mainClassName,
|
|
1325
1442
|
name,
|
|
1443
|
+
onChange,
|
|
1326
1444
|
options,
|
|
1327
1445
|
placeholder,
|
|
1328
1446
|
search,
|
|
1329
1447
|
visualRequired
|
|
1330
1448
|
}) => {
|
|
1331
|
-
return /* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ jsx22(
|
|
1332
1450
|
FormField,
|
|
1333
1451
|
{
|
|
1334
1452
|
control,
|
|
1335
1453
|
name,
|
|
1336
1454
|
render: ({ field, fieldState }) => {
|
|
1337
1455
|
const hasError = !!fieldState.error;
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1456
|
+
return /* @__PURE__ */ jsx22(
|
|
1457
|
+
FormFieldShell,
|
|
1458
|
+
{
|
|
1459
|
+
hasError,
|
|
1460
|
+
label,
|
|
1461
|
+
labelClassName,
|
|
1462
|
+
mainClassName,
|
|
1463
|
+
name,
|
|
1464
|
+
visualRequired,
|
|
1465
|
+
children: /* @__PURE__ */ jsx22(
|
|
1466
|
+
SelectInput,
|
|
1467
|
+
{
|
|
1468
|
+
ableDeleteOption,
|
|
1469
|
+
className,
|
|
1470
|
+
disabled,
|
|
1471
|
+
error: fieldState.error,
|
|
1472
|
+
items: options,
|
|
1473
|
+
onChange: (...args) => {
|
|
1474
|
+
field.onChange(...args);
|
|
1475
|
+
onChange?.(...args);
|
|
1476
|
+
},
|
|
1477
|
+
placeholder,
|
|
1478
|
+
search,
|
|
1479
|
+
value: typeof field.value === "number" ? `${field.value}` : field.value
|
|
1480
|
+
}
|
|
1481
|
+
)
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1364
1484
|
}
|
|
1365
1485
|
}
|
|
1366
1486
|
);
|
|
@@ -1368,10 +1488,10 @@ var SelectField = ({
|
|
|
1368
1488
|
|
|
1369
1489
|
// src/components/password-checklist.tsx
|
|
1370
1490
|
import { CheckCircleIcon as CheckCircleIcon2, XCircleIcon } from "@phosphor-icons/react";
|
|
1371
|
-
import { jsx as
|
|
1491
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1372
1492
|
var PasswordChecklist = ({ className, rules, value }) => {
|
|
1373
1493
|
if (rules.length === 0) return null;
|
|
1374
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ jsx23("ul", { className: cn("flex flex-col gap-1", className), children: rules.map((rule) => {
|
|
1375
1495
|
const isMet = rule.test(value);
|
|
1376
1496
|
const Icon = isMet ? CheckCircleIcon2 : XCircleIcon;
|
|
1377
1497
|
return /* @__PURE__ */ jsxs16(
|
|
@@ -1382,8 +1502,8 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1382
1502
|
isMet ? "text-success" : "text-inactive-text"
|
|
1383
1503
|
),
|
|
1384
1504
|
children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsx23(Icon, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }),
|
|
1506
|
+
/* @__PURE__ */ jsx23("span", { children: rule.label })
|
|
1387
1507
|
]
|
|
1388
1508
|
},
|
|
1389
1509
|
rule.key
|
|
@@ -1392,22 +1512,22 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1392
1512
|
};
|
|
1393
1513
|
|
|
1394
1514
|
// src/components/step-header.tsx
|
|
1395
|
-
import { jsx as
|
|
1515
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1396
1516
|
var StepHeader = ({ subtitle, subtitleClassName, title }) => /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1", children: [
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
subtitle !== void 0 && /* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ jsx24("h1", { className: "text-title text-2xl font-bold", children: title }),
|
|
1518
|
+
subtitle !== void 0 && /* @__PURE__ */ jsx24("p", { className: cn("text-subtitle text-sm", subtitleClassName), children: subtitle })
|
|
1399
1519
|
] });
|
|
1400
1520
|
|
|
1401
1521
|
// src/components/stepper.tsx
|
|
1402
1522
|
import { CheckIcon } from "@phosphor-icons/react";
|
|
1403
|
-
import { jsx as
|
|
1523
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1404
1524
|
var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
1405
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ jsx25("div", { className: cn("flex w-full items-start", className), children: steps.map((step, index) => {
|
|
1406
1526
|
const isCompleted = intermediate ? index <= activeIndex : index < activeIndex;
|
|
1407
1527
|
const isActive = !intermediate && index === activeIndex;
|
|
1408
1528
|
return /* @__PURE__ */ jsxs18("div", { className: "flex flex-1 flex-col items-center", children: [
|
|
1409
1529
|
/* @__PURE__ */ jsxs18("div", { className: "flex w-full items-center", children: [
|
|
1410
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx25(
|
|
1411
1531
|
"div",
|
|
1412
1532
|
{
|
|
1413
1533
|
className: cn(
|
|
@@ -1417,7 +1537,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1417
1537
|
)
|
|
1418
1538
|
}
|
|
1419
1539
|
),
|
|
1420
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsx25(
|
|
1421
1541
|
"div",
|
|
1422
1542
|
{
|
|
1423
1543
|
"aria-current": isActive ? "step" : void 0,
|
|
@@ -1427,10 +1547,10 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1427
1547
|
isActive && "bg-primary border-primary text-inverse",
|
|
1428
1548
|
!isCompleted && !isActive && "bg-inactive border-inactive text-surface"
|
|
1429
1549
|
),
|
|
1430
|
-
children: isCompleted ? /* @__PURE__ */
|
|
1550
|
+
children: isCompleted ? /* @__PURE__ */ jsx25(CheckIcon, { className: "h-4 w-4" }) : index + 1
|
|
1431
1551
|
}
|
|
1432
1552
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ jsx25(
|
|
1434
1554
|
"div",
|
|
1435
1555
|
{
|
|
1436
1556
|
className: cn(
|
|
@@ -1438,7 +1558,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1438
1558
|
isCompleted ? "bg-primary" : "bg-inactive",
|
|
1439
1559
|
index === steps.length - 1 && "rounded-r-full"
|
|
1440
1560
|
),
|
|
1441
|
-
children: index === 0 && /* @__PURE__ */
|
|
1561
|
+
children: index === 0 && /* @__PURE__ */ jsx25(
|
|
1442
1562
|
"div",
|
|
1443
1563
|
{
|
|
1444
1564
|
className: cn(
|
|
@@ -1450,18 +1570,36 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1450
1570
|
}
|
|
1451
1571
|
)
|
|
1452
1572
|
] }),
|
|
1453
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ jsx25("span", { className: cn("mt-1 text-xs font-normal", isCompleted || isActive ? "text-primary" : "text-muted"), children: step.label })
|
|
1454
1574
|
] }, step.label);
|
|
1455
1575
|
}) });
|
|
1456
1576
|
};
|
|
1457
1577
|
|
|
1578
|
+
// src/components/switch.tsx
|
|
1579
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
1580
|
+
import * as React12 from "react";
|
|
1581
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1582
|
+
var Switch = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1583
|
+
SwitchPrimitive.Root,
|
|
1584
|
+
{
|
|
1585
|
+
className: cn(
|
|
1586
|
+
"focus-visible:ring-ring relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-success data-[state=unchecked]:bg-inactive",
|
|
1587
|
+
className
|
|
1588
|
+
),
|
|
1589
|
+
ref,
|
|
1590
|
+
...props,
|
|
1591
|
+
children: /* @__PURE__ */ jsx26(SwitchPrimitive.Thumb, { className: "bg-surface pointer-events-none block h-5 w-5 translate-x-0.5 rounded-full shadow-lg transition-transform data-[state=checked]:translate-x-5" })
|
|
1592
|
+
}
|
|
1593
|
+
));
|
|
1594
|
+
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
1595
|
+
|
|
1458
1596
|
// src/components/toast/toast.tsx
|
|
1459
|
-
import { CheckIcon as CheckIcon2, FileLockIcon, InfoIcon as InfoIcon2, WarningIcon as WarningIcon2, XIcon as
|
|
1597
|
+
import { CheckIcon as CheckIcon2, FileLockIcon, InfoIcon as InfoIcon2, WarningIcon as WarningIcon2, XIcon as XIcon4 } from "@phosphor-icons/react";
|
|
1460
1598
|
import { useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
|
|
1461
|
-
import { jsx as
|
|
1599
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1462
1600
|
var EXIT_ANIMATION_MS = 200;
|
|
1463
1601
|
var typeIcons = {
|
|
1464
|
-
destructive:
|
|
1602
|
+
destructive: XIcon4,
|
|
1465
1603
|
info: InfoIcon2,
|
|
1466
1604
|
success: CheckIcon2,
|
|
1467
1605
|
wait: FileLockIcon,
|
|
@@ -1499,7 +1637,7 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1499
1637
|
"div",
|
|
1500
1638
|
{
|
|
1501
1639
|
"aria-live": "polite",
|
|
1502
|
-
className:
|
|
1640
|
+
className: cn(
|
|
1503
1641
|
"relative",
|
|
1504
1642
|
leaving ? "absolute top-0 right-0 left-0" : "",
|
|
1505
1643
|
"flex w-108.5 max-w-[calc(100vw-2rem)] items-center justify-between",
|
|
@@ -1510,20 +1648,16 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1510
1648
|
"transition-all duration-200 ease-out",
|
|
1511
1649
|
styles.border,
|
|
1512
1650
|
leaving ? "translate-y-2 opacity-0" : "translate-y-0 opacity-100"
|
|
1513
|
-
|
|
1651
|
+
),
|
|
1514
1652
|
role: "status",
|
|
1515
1653
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
subtitle ? /* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ jsx27("div", { className: "min-w-0 pr-4", children: /* @__PURE__ */ jsx27("h4", { className: cn("text-[16px] leading-normal font-semibold", "text-foreground", "line-clamp-2"), children: title }) }),
|
|
1655
|
+
subtitle ? /* @__PURE__ */ jsx27("div", { className: "shrink-0 pr-4 text-left", children: /* @__PURE__ */ jsx27("div", { className: cn("max-w-28 text-[14px] leading-[19.5px] font-normal", "text-body"), children: subtitle }) }) : null,
|
|
1656
|
+
/* @__PURE__ */ jsx27(
|
|
1519
1657
|
"div",
|
|
1520
1658
|
{
|
|
1521
|
-
className:
|
|
1522
|
-
|
|
1523
|
-
"flex h-8 w-8 min-w-8 items-center justify-center rounded-full border-2",
|
|
1524
|
-
styles.iconBorder
|
|
1525
|
-
].join(" "),
|
|
1526
|
-
children: /* @__PURE__ */ jsx23(Icon, { className: ["h-5 w-5", styles.icon].join(" ") })
|
|
1659
|
+
className: cn("shrink-0", "flex h-8 w-8 min-w-8 items-center justify-center rounded-full border-2", styles.iconBorder),
|
|
1660
|
+
children: /* @__PURE__ */ jsx27(Icon, { className: cn("h-5 w-5", styles.icon) })
|
|
1527
1661
|
}
|
|
1528
1662
|
)
|
|
1529
1663
|
]
|
|
@@ -1533,7 +1667,7 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1533
1667
|
|
|
1534
1668
|
// src/components/toast/toast-provider.tsx
|
|
1535
1669
|
import { useCallback as useCallback3, useEffect as useEffect5, useLayoutEffect, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
1536
|
-
import { Fragment as Fragment4, jsx as
|
|
1670
|
+
import { Fragment as Fragment4, jsx as jsx28 } from "react/jsx-runtime";
|
|
1537
1671
|
function ToastProvider() {
|
|
1538
1672
|
const [toasts, setToasts] = useState6([]);
|
|
1539
1673
|
const itemRefs = useRef4(/* @__PURE__ */ new Map());
|
|
@@ -1594,7 +1728,7 @@ function ToastProvider() {
|
|
|
1594
1728
|
itemRefs.current.set(id, el);
|
|
1595
1729
|
};
|
|
1596
1730
|
}, []);
|
|
1597
|
-
return /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ jsx28(Fragment4, { children: Object.entries(grouped).map(([position, list]) => /* @__PURE__ */ jsx28("div", { className: `fixed ${zToast} ${getPositionClass(position)}`, children: /* @__PURE__ */ jsx28("div", { className: "relative flex flex-col gap-3", children: list.map((toast2) => /* @__PURE__ */ jsx28("div", { ref: setItemRef(toast2.id), children: /* @__PURE__ */ jsx28(
|
|
1598
1732
|
Toast,
|
|
1599
1733
|
{
|
|
1600
1734
|
duration: toast2.duration,
|
|
@@ -1622,14 +1756,16 @@ function getPositionClass(position) {
|
|
|
1622
1756
|
}
|
|
1623
1757
|
|
|
1624
1758
|
// src/components/wrapper.tsx
|
|
1625
|
-
import { jsx as
|
|
1759
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1626
1760
|
var Wrapper = ({ children, className }) => {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ jsx29("div", { className: cn("mx-auto h-full w-full", className), children });
|
|
1628
1762
|
};
|
|
1629
1763
|
export {
|
|
1764
|
+
AddTile,
|
|
1630
1765
|
Alert,
|
|
1631
1766
|
AuthHeader,
|
|
1632
1767
|
Button,
|
|
1768
|
+
Chip,
|
|
1633
1769
|
Command,
|
|
1634
1770
|
CommandDialog,
|
|
1635
1771
|
CommandEmpty,
|
|
@@ -1673,11 +1809,13 @@ export {
|
|
|
1673
1809
|
Spinner,
|
|
1674
1810
|
StepHeader,
|
|
1675
1811
|
Stepper,
|
|
1812
|
+
Switch,
|
|
1676
1813
|
Toast,
|
|
1677
1814
|
ToastProvider,
|
|
1678
1815
|
Tooltip,
|
|
1679
1816
|
Wrapper,
|
|
1680
1817
|
buttonVariants,
|
|
1818
|
+
chipVariants,
|
|
1681
1819
|
cn,
|
|
1682
1820
|
inputBase,
|
|
1683
1821
|
inputCompact,
|