@spear-ai/spectral 1.3.62 → 1.3.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.js +205 -152
- package/dist/Accordion.d.ts +37 -0
- package/dist/Accordion.js +474 -0
- package/dist/Alert/AlertBase.js +2 -2
- package/dist/Alert.js +21 -11
- package/dist/Avatar.js +1 -1
- package/dist/Badge.d.ts +12 -2
- package/dist/Badge.js +28 -4
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +35 -28
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
- package/dist/ButtonGroup.d.ts +29 -0
- package/dist/ButtonGroup.js +89 -0
- package/dist/ButtonIcon.js +11 -1
- package/dist/Card.d.ts +16 -0
- package/dist/Card.js +32 -0
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.js +22 -14
- package/dist/Dialog/DialogBase.d.ts +6 -3
- package/dist/Dialog/DialogBase.js +113 -98
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.js +42 -36
- package/dist/Drawer.js +24 -1283
- package/dist/HoverCard.d.ts +29 -0
- package/dist/HoverCard.js +207 -0
- package/dist/Icons/AnalyzeIcon.d.ts +3 -0
- package/dist/Icons/AnalyzeIcon.js +73 -0
- package/dist/Icons/AnnotationsIcon.js +4 -4
- package/dist/Icons/ApprovedIcon.d.ts +3 -0
- package/dist/Icons/ApprovedIcon.js +43 -0
- package/dist/Icons/CalendarIcon.js +7 -7
- package/dist/Icons/CheckCircleIcon.js +14 -14
- package/dist/Icons/CheckSquareIcon.js +14 -14
- package/dist/Icons/CheckmarkIcon.js +9 -9
- package/dist/Icons/ChevronDownIcon.js +6 -6
- package/dist/Icons/ChevronUpIcon.js +7 -7
- package/dist/Icons/ClockIcon.js +10 -10
- package/dist/Icons/CloseCircleIcon.js +10 -10
- package/dist/Icons/CloseIcon.js +5 -5
- package/dist/Icons/DashboardIcon.js +4 -4
- package/dist/Icons/DatabaseIcon.d.ts +3 -0
- package/dist/Icons/DatabaseIcon.js +53 -0
- package/dist/Icons/DeleteIcon.js +24 -6
- package/dist/Icons/DurationIcon.js +7 -7
- package/dist/Icons/EmailIcon.js +4 -4
- package/dist/Icons/EraserIcon.js +20 -11
- package/dist/Icons/ErrorIcon.js +3 -3
- package/dist/Icons/EyeClosedIcon.js +2 -2
- package/dist/Icons/EyeClosedIcon2.js +18 -18
- package/dist/Icons/EyeOpenIcon.js +8 -8
- package/dist/Icons/GoToFirstIcon.js +1 -1
- package/dist/Icons/GoToLastIcon.js +3 -3
- package/dist/Icons/HarmonicCursorsIcon.js +4 -4
- package/dist/Icons/IconBase.d.ts +1 -1
- package/dist/Icons/IconBase.js +15 -17
- package/dist/Icons/InfoIcon.js +4 -4
- package/dist/Icons/LabelIcon.js +6 -6
- package/dist/Icons/LassoIcon.js +6 -6
- package/dist/Icons/LineToolIcon.js +22 -93
- package/dist/Icons/LineToolIcon2.d.ts +3 -0
- package/dist/Icons/LineToolIcon2.js +73 -0
- package/dist/Icons/LiveViewIcon.js +5 -5
- package/dist/Icons/LoaderIcon.js +5 -5
- package/dist/Icons/LocationIcon.js +5 -5
- package/dist/Icons/LogoutIcon.js +11 -11
- package/dist/Icons/MessagesIcon.d.ts +3 -0
- package/dist/Icons/MessagesIcon.js +34 -0
- package/dist/Icons/MetadataIcon.js +5 -5
- package/dist/Icons/MinusIcon.js +9 -9
- package/dist/Icons/OntologyIcon.js +74 -21
- package/dist/Icons/PanelIconClose.js +11 -11
- package/dist/Icons/PanelIconOpen.js +11 -11
- package/dist/Icons/PlayIcon.js +5 -5
- package/dist/Icons/PlusIcon.js +9 -8
- package/dist/Icons/ResetIcon.js +6 -6
- package/dist/Icons/ReviewedIcon.d.ts +3 -0
- package/dist/Icons/ReviewedIcon.js +44 -0
- package/dist/Icons/ScissorsIcon.js +9 -9
- package/dist/Icons/SettingsIcon.js +20 -22
- package/dist/Icons/SortAscendingIcon.d.ts +3 -0
- package/dist/Icons/SortAscendingIcon.js +73 -0
- package/dist/Icons/SortDescendingIcon.d.ts +3 -0
- package/dist/Icons/SortDescendingIcon.js +73 -0
- package/dist/Icons/StackIcon.d.ts +3 -0
- package/dist/Icons/StackIcon.js +43 -0
- package/dist/Icons/StarIcon.d.ts +3 -0
- package/dist/Icons/StarIcon.js +31 -0
- package/dist/Icons/TrashIcon.js +10 -10
- package/dist/Icons/UndoIcon.js +1 -1
- package/dist/Icons/UserIcon.js +1 -1
- package/dist/Icons/WarningIcon.js +9 -9
- package/dist/Icons/ZoomAllIcon.js +97 -57
- package/dist/Icons/ZoomXIcon.js +6 -6
- package/dist/Icons/ZoomYIcon.js +17 -8
- package/dist/Icons/index.d.ts +10 -0
- package/dist/Icons.js +114 -94
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +100 -82
- package/dist/InputGroup.d.ts +16 -0
- package/dist/InputGroup.js +129 -0
- package/dist/InputOTP.d.ts +0 -2
- package/dist/InputOTP.js +148 -143
- package/dist/Label.d.ts +3 -7
- package/dist/Label.js +11 -11
- package/dist/MultiSelect/MultiSelectBase.js +28 -28
- package/dist/Popover.d.ts +6 -7
- package/dist/Popover.js +60 -71
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +141 -134
- package/dist/Select.d.ts +12 -12
- package/dist/Select.js +106 -895
- package/dist/Separator.d.ts +12 -0
- package/dist/Separator.js +24 -0
- package/dist/Skeleton.js +3 -3
- package/dist/Slider.d.ts +15 -3
- package/dist/Slider.js +464 -40
- package/dist/Switch/SwitchBase.js +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Tabs/TabsBase.js +1 -1
- package/dist/Tabs.js +16 -16
- package/dist/Textarea.js +58 -50
- package/dist/Toggle.js +2 -2
- package/dist/ToggleGroup.js +1 -1
- package/dist/Tooltip/TooltipBase.js +29 -29
- package/dist/Tooltip.js +15 -15
- package/dist/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/Tray/TrayStoriesData.js +438 -0
- package/dist/Tray.d.ts +28 -0
- package/dist/Tray.js +236 -0
- package/dist/analyzer/network.webp +0 -0
- package/dist/analyzer/sunburst.webp +0 -0
- package/dist/analyzer/visual.webp +0 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/Accordion.d.ts +37 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
- package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +16 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +6 -3
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +29 -0
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Icons/AnalyzeIcon.d.ts +3 -0
- package/dist/components/Icons/AnalyzeIcon.d.ts.map +1 -0
- package/dist/components/Icons/ApprovedIcon.d.ts +3 -0
- package/dist/components/Icons/ApprovedIcon.d.ts.map +1 -0
- package/dist/components/Icons/DatabaseIcon.d.ts +3 -0
- package/dist/components/Icons/DatabaseIcon.d.ts.map +1 -0
- package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
- package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts +1 -1
- package/dist/components/Icons/IconBase.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
- package/dist/components/Icons/LineToolIcon2.d.ts +3 -0
- package/dist/components/Icons/LineToolIcon2.d.ts.map +1 -0
- package/dist/components/Icons/MessagesIcon.d.ts +3 -0
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
- package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
- package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
- package/dist/components/Icons/ReviewedIcon.d.ts +3 -0
- package/dist/components/Icons/ReviewedIcon.d.ts.map +1 -0
- package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
- package/dist/components/Icons/SortAscendingIcon.d.ts +3 -0
- package/dist/components/Icons/SortAscendingIcon.d.ts.map +1 -0
- package/dist/components/Icons/SortDescendingIcon.d.ts +3 -0
- package/dist/components/Icons/SortDescendingIcon.d.ts.map +1 -0
- package/dist/components/Icons/StackIcon.d.ts +3 -0
- package/dist/components/Icons/StackIcon.d.ts.map +1 -0
- package/dist/components/Icons/StarIcon.d.ts +3 -0
- package/dist/components/Icons/StarIcon.d.ts.map +1 -0
- package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
- package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
- package/dist/components/Icons/index.d.ts +10 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +16 -0
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/InputOTP/InputOTP.d.ts +0 -2
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/components/Label/Label.d.ts +3 -7
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +6 -7
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +12 -12
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Separator/Separator.d.ts +12 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +15 -3
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Tray/Tray.d.ts +28 -0
- package/dist/components/Tray/Tray.d.ts.map +1 -0
- package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
- package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
- package/dist/{createLucideIcon-CI1yJrZf.js → createLucideIcon-B_8CJpcQ.js} +4 -4
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +13 -3
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
- package/dist/features/AuthCard/PasswordInput.js +87 -9
- package/dist/features/AuthCard/SignInForm.js +25 -15
- package/dist/features/AuthCard/SignUpForm.js +24 -14
- package/dist/features/AuthCard.js +2 -2
- package/dist/features/LabelingTools.js +16 -6
- package/dist/features/SensorMetadata.js +15 -5
- package/dist/features/SettingsPopover.js +22 -12
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
- package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
- package/dist/index-B2oBi8ng.js +142 -0
- package/dist/index-BIpuW_o8.js +146 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BhufZRa2.js +232 -0
- package/dist/index-CAKA12cC.js +1265 -0
- package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
- package/dist/index-CVSxKOPp.js +13 -0
- package/dist/index-CevVJ05e.js +822 -0
- package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
- package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
- package/dist/index-UEFPWH8U.js +54 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/linear-cursor-small.png +0 -0
- package/dist/{loader-circle-CvdzOiQ_.js → loader-circle-CdRVlFhN.js} +2 -2
- package/dist/main.js +15630 -13510
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/primitives/button.d.ts +10 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +42 -0
- package/dist/primitives/input.d.ts +3 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +18 -0
- package/dist/primitives/select.d.ts +16 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +205 -0
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +21 -20
- package/dist/primitives/textarea.d.ts +3 -0
- package/dist/primitives/textarea.d.ts.map +1 -0
- package/dist/primitives/textarea.js +16 -0
- package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.js +1 -1
- package/dist/utils/twUtils.js +2728 -2
- package/dist/{x-BBpi7a_7.js → x-Dl66o_vF.js} +2 -2
- package/package.json +28 -23
- package/dist/Accordion/AccordionBase.d.ts +0 -42
- package/dist/Accordion/AccordionBase.js +0 -225
- package/dist/Badge/BadgeBase.d.ts +0 -13
- package/dist/Badge/BadgeBase.js +0 -35
- package/dist/PasswordInput-ClY_hxuN.js +0 -261
- package/dist/components/Accordion/AccordionBase.d.ts +0 -42
- package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
- package/dist/components/Badge/BadgeBase.d.ts +0 -13
- package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
- package/dist/index-CA7haECj.js +0 -248
- package/dist/index-CbXx14YO.js +0 -59
- package/dist/index-VXXKXen4.js +0 -15
- package/dist/index-cCg4yNa8.js +0 -132
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.d.ts.map +0 -1
- package/dist/primitives/label.js +0 -27
- package/dist/twUtils-CRiPKpXj.js +0 -2743
- /package/dist/{list.yml.webp → analyzer/list.yml.webp} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import "./styles/main.css";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { Button as u } from "./primitives/button.js";
|
|
4
|
+
import { Input as p } from "./primitives/input.js";
|
|
5
|
+
import { Textarea as l } from "./primitives/textarea.js";
|
|
6
|
+
import { cn as e } from "./utils/twUtils.js";
|
|
7
|
+
import { c as s } from "./index-D29mdTf5.js";
|
|
8
|
+
import "react";
|
|
9
|
+
const k = ({ className: r, ...t }) => /* @__PURE__ */ n(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "input-group",
|
|
13
|
+
role: "group",
|
|
14
|
+
className: e(
|
|
15
|
+
"group/input-group border-input-border relative flex w-full items-center rounded-[var(--radius,0.375rem)] border shadow-xs transition-[color,box-shadow] outline-none",
|
|
16
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
17
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
18
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
19
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
20
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
21
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-input-border has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
22
|
+
"has-[[data-slot][aria-invalid=true]]:ring-danger/20 has-[[data-slot][aria-invalid=true]]:border-danger",
|
|
23
|
+
r
|
|
24
|
+
),
|
|
25
|
+
...t
|
|
26
|
+
}
|
|
27
|
+
), d = s(
|
|
28
|
+
`text-text-secondary flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4
|
|
29
|
+
[&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50`,
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
align: {
|
|
33
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
34
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
35
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
36
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
align: "inline-start"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
), y = ({
|
|
44
|
+
className: r,
|
|
45
|
+
align: t = "inline-start",
|
|
46
|
+
...o
|
|
47
|
+
}) => /* @__PURE__ */ n(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
role: "group",
|
|
51
|
+
"data-slot": "input-group-addon",
|
|
52
|
+
"data-align": t,
|
|
53
|
+
className: e(d({ align: t }), r),
|
|
54
|
+
onClick: (a) => {
|
|
55
|
+
a.target.closest("button") || a.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
56
|
+
},
|
|
57
|
+
onKeyDown: (a) => {
|
|
58
|
+
if (a.key === "Enter" || a.key === " ") {
|
|
59
|
+
if (a.target.closest("button"))
|
|
60
|
+
return;
|
|
61
|
+
a.preventDefault(), a.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
...o
|
|
65
|
+
}
|
|
66
|
+
), c = s("text-sm shadow-none flex gap-2 items-center", {
|
|
67
|
+
variants: {
|
|
68
|
+
size: {
|
|
69
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
70
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-[var(--radius,0.375rem)] has-[>svg]:px-2.5",
|
|
71
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
72
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0 rounded-[var(--radius,0.375rem)]"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
defaultVariants: {
|
|
76
|
+
size: "xs"
|
|
77
|
+
}
|
|
78
|
+
}), z = ({
|
|
79
|
+
className: r,
|
|
80
|
+
type: t = "button",
|
|
81
|
+
variant: o = "ghost",
|
|
82
|
+
size: a = "xs",
|
|
83
|
+
...i
|
|
84
|
+
}) => /* @__PURE__ */ n(
|
|
85
|
+
u,
|
|
86
|
+
{
|
|
87
|
+
type: t,
|
|
88
|
+
"data-size": a,
|
|
89
|
+
variant: o,
|
|
90
|
+
className: e(c({ size: a }), r),
|
|
91
|
+
...i
|
|
92
|
+
}
|
|
93
|
+
), w = ({ className: r, ...t }) => /* @__PURE__ */ n(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
className: e(
|
|
97
|
+
"text-input-text flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
98
|
+
r
|
|
99
|
+
),
|
|
100
|
+
...t
|
|
101
|
+
}
|
|
102
|
+
), G = ({ className: r, ...t }) => /* @__PURE__ */ n(
|
|
103
|
+
p,
|
|
104
|
+
{
|
|
105
|
+
"data-slot": "input-group-control",
|
|
106
|
+
className: e("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0", r),
|
|
107
|
+
...t
|
|
108
|
+
}
|
|
109
|
+
), I = ({ className: r, ...t }) => /* @__PURE__ */ n(
|
|
110
|
+
l,
|
|
111
|
+
{
|
|
112
|
+
"data-slot": "input-group-control",
|
|
113
|
+
className: e(
|
|
114
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0",
|
|
115
|
+
r
|
|
116
|
+
),
|
|
117
|
+
...t
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
export {
|
|
121
|
+
k as InputGroup,
|
|
122
|
+
y as InputGroupAddon,
|
|
123
|
+
z as InputGroupButton,
|
|
124
|
+
G as InputGroupInput,
|
|
125
|
+
w as InputGroupText,
|
|
126
|
+
I as InputGroupTextarea,
|
|
127
|
+
d as inputGroupAddonVariants,
|
|
128
|
+
c as inputGroupButtonVariants
|
|
129
|
+
};
|
package/dist/InputOTP.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ type InputOTPRootProps = Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerS
|
|
|
5
5
|
className?: string;
|
|
6
6
|
separator?: boolean;
|
|
7
7
|
variant?: 'outlined' | 'filled';
|
|
8
|
-
groupSize?: number;
|
|
9
|
-
separatorPositions?: number[];
|
|
10
8
|
};
|
|
11
9
|
export type InputOTPProps = InputOTPRootProps & ({
|
|
12
10
|
value: number | string;
|
package/dist/InputOTP.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
3
|
+
import { jsx as k, jsxs as vt } from "react/jsx-runtime";
|
|
4
|
+
import "./Icons/AnalyzeIcon.js";
|
|
4
5
|
import "./Icons/AnnotationsIcon.js";
|
|
6
|
+
import "./Icons/ApprovedIcon.js";
|
|
5
7
|
import "./Icons/CalendarIcon.js";
|
|
6
8
|
import "./Icons/CheckCircleIcon.js";
|
|
7
9
|
import "./Icons/CheckSquareIcon.js";
|
|
@@ -12,6 +14,7 @@ import "./Icons/ClockIcon.js";
|
|
|
12
14
|
import "./Icons/CloseCircleIcon.js";
|
|
13
15
|
import "./Icons/CloseIcon.js";
|
|
14
16
|
import "./Icons/DashboardIcon.js";
|
|
17
|
+
import "./Icons/DatabaseIcon.js";
|
|
15
18
|
import "./Icons/DeleteIcon.js";
|
|
16
19
|
import "./Icons/DurationIcon.js";
|
|
17
20
|
import "./Icons/EmailIcon.js";
|
|
@@ -27,10 +30,12 @@ import "./Icons/InfoIcon.js";
|
|
|
27
30
|
import "./Icons/LabelIcon.js";
|
|
28
31
|
import "./Icons/LassoIcon.js";
|
|
29
32
|
import "./Icons/LineToolIcon.js";
|
|
33
|
+
import "./Icons/LineToolIcon2.js";
|
|
30
34
|
import "./Icons/LiveViewIcon.js";
|
|
31
35
|
import "./Icons/LoaderIcon.js";
|
|
32
36
|
import "./Icons/LocationIcon.js";
|
|
33
37
|
import "./Icons/LogoutIcon.js";
|
|
38
|
+
import "./Icons/MessagesIcon.js";
|
|
34
39
|
import "./Icons/MetadataIcon.js";
|
|
35
40
|
import { MinusIcon as _t } from "./Icons/MinusIcon.js";
|
|
36
41
|
import "./Icons/OntologyIcon.js";
|
|
@@ -39,8 +44,13 @@ import "./Icons/PanelIconOpen.js";
|
|
|
39
44
|
import "./Icons/PlayIcon.js";
|
|
40
45
|
import "./Icons/PlusIcon.js";
|
|
41
46
|
import "./Icons/ResetIcon.js";
|
|
47
|
+
import "./Icons/ReviewedIcon.js";
|
|
42
48
|
import "./Icons/ScissorsIcon.js";
|
|
43
49
|
import "./Icons/SettingsIcon.js";
|
|
50
|
+
import "./Icons/SortAscendingIcon.js";
|
|
51
|
+
import "./Icons/SortDescendingIcon.js";
|
|
52
|
+
import "./Icons/StackIcon.js";
|
|
53
|
+
import "./Icons/StarIcon.js";
|
|
44
54
|
import "./Icons/TrashIcon.js";
|
|
45
55
|
import "./Icons/UndoIcon.js";
|
|
46
56
|
import "./Icons/UserIcon.js";
|
|
@@ -48,102 +58,102 @@ import "./Icons/WarningIcon.js";
|
|
|
48
58
|
import "./Icons/ZoomAllIcon.js";
|
|
49
59
|
import "./Icons/ZoomXIcon.js";
|
|
50
60
|
import "./Icons/ZoomYIcon.js";
|
|
51
|
-
import { useFormFieldId as Ht, ErrorMessage as Gt, getErrorMessageId as
|
|
52
|
-
import {
|
|
61
|
+
import { useFormFieldId as Ht, ErrorMessage as Gt, getErrorMessageId as Lt } from "./utils/formFieldUtils.js";
|
|
62
|
+
import { cn as gt } from "./utils/twUtils.js";
|
|
53
63
|
import * as n from "react";
|
|
54
|
-
import { createContext as
|
|
55
|
-
var zt = Object.defineProperty,
|
|
56
|
-
for (var a in r || (r = {}))
|
|
57
|
-
if (
|
|
64
|
+
import { createContext as ht, forwardRef as Q, useContext as bt } from "react";
|
|
65
|
+
var zt = Object.defineProperty, $t = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, K = Object.getOwnPropertySymbols, wt = Object.prototype.hasOwnProperty, yt = Object.prototype.propertyIsEnumerable, ft = (t, r, a) => r in t ? zt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, qt = (t, r) => {
|
|
66
|
+
for (var a in r || (r = {})) wt.call(r, a) && ft(t, a, r[a]);
|
|
67
|
+
if (K) for (var a of K(r)) yt.call(r, a) && ft(t, a, r[a]);
|
|
58
68
|
return t;
|
|
59
|
-
},
|
|
69
|
+
}, Zt = (t, r) => $t(t, Vt(r)), Jt = (t, r) => {
|
|
60
70
|
var a = {};
|
|
61
|
-
for (var u in t)
|
|
62
|
-
if (t != null &&
|
|
71
|
+
for (var u in t) wt.call(t, u) && r.indexOf(u) < 0 && (a[u] = t[u]);
|
|
72
|
+
if (t != null && K) for (var u of K(t)) r.indexOf(u) < 0 && yt.call(t, u) && (a[u] = t[u]);
|
|
63
73
|
return a;
|
|
64
74
|
};
|
|
65
|
-
function
|
|
75
|
+
function Kt(t) {
|
|
66
76
|
let r = setTimeout(t, 0), a = setTimeout(t, 10), u = setTimeout(t, 50);
|
|
67
77
|
return [r, a, u];
|
|
68
78
|
}
|
|
69
|
-
function
|
|
79
|
+
function Qt(t) {
|
|
70
80
|
let r = n.useRef();
|
|
71
81
|
return n.useEffect(() => {
|
|
72
82
|
r.current = t;
|
|
73
83
|
}), r.current;
|
|
74
84
|
}
|
|
75
|
-
var
|
|
76
|
-
function
|
|
77
|
-
let [
|
|
78
|
-
let f = t.current,
|
|
79
|
-
if (!f || !
|
|
80
|
-
let
|
|
81
|
-
document.querySelectorAll(
|
|
82
|
-
}, [t, r,
|
|
85
|
+
var Ut = 18, Et = 40, Xt = `${Et}px`, Yt = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
86
|
+
function te({ containerRef: t, inputRef: r, pushPasswordManagerStrategy: a, isFocused: u }) {
|
|
87
|
+
let [v, s] = n.useState(!1), [b, d] = n.useState(!1), [T, S] = n.useState(!1), A = n.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && v && b, [v, b, a]), R = n.useCallback(() => {
|
|
88
|
+
let f = t.current, x = r.current;
|
|
89
|
+
if (!f || !x || T || a === "none") return;
|
|
90
|
+
let g = f, w = g.getBoundingClientRect().left + g.offsetWidth, O = g.getBoundingClientRect().top + g.offsetHeight / 2, l = w - Ut, I = O;
|
|
91
|
+
document.querySelectorAll(Yt).length === 0 && document.elementFromPoint(l, I) === f || (s(!0), S(!0));
|
|
92
|
+
}, [t, r, T, a]);
|
|
83
93
|
return n.useEffect(() => {
|
|
84
94
|
let f = t.current;
|
|
85
95
|
if (!f || a === "none") return;
|
|
86
|
-
function
|
|
87
|
-
let
|
|
88
|
-
d(
|
|
96
|
+
function x() {
|
|
97
|
+
let w = window.innerWidth - f.getBoundingClientRect().right;
|
|
98
|
+
d(w >= Et);
|
|
89
99
|
}
|
|
90
|
-
|
|
91
|
-
let
|
|
100
|
+
x();
|
|
101
|
+
let g = setInterval(x, 1e3);
|
|
92
102
|
return () => {
|
|
93
|
-
clearInterval(
|
|
103
|
+
clearInterval(g);
|
|
94
104
|
};
|
|
95
105
|
}, [t, a]), n.useEffect(() => {
|
|
96
106
|
let f = u || document.activeElement === r.current;
|
|
97
107
|
if (a === "none" || !f) return;
|
|
98
|
-
let
|
|
108
|
+
let x = setTimeout(R, 0), g = setTimeout(R, 2e3), w = setTimeout(R, 5e3), O = setTimeout(() => {
|
|
99
109
|
S(!0);
|
|
100
110
|
}, 6e3);
|
|
101
111
|
return () => {
|
|
102
|
-
clearTimeout(
|
|
112
|
+
clearTimeout(x), clearTimeout(g), clearTimeout(w), clearTimeout(O);
|
|
103
113
|
};
|
|
104
|
-
}, [r, u, a,
|
|
114
|
+
}, [r, u, a, R]), { hasPWMBadge: v, willPushPWMBadge: A, PWM_BADGE_SPACE_WIDTH: Xt };
|
|
105
115
|
}
|
|
106
|
-
var
|
|
107
|
-
var a = t, { value: u, onChange:
|
|
108
|
-
let [
|
|
109
|
-
|
|
110
|
-
}, [
|
|
116
|
+
var ee = n.createContext({}), St = n.forwardRef((t, r) => {
|
|
117
|
+
var a = t, { value: u, onChange: v, maxLength: s, textAlign: b = "left", pattern: d, placeholder: T, inputMode: S = "numeric", onComplete: A, pushPasswordManagerStrategy: R = "increase-width", pasteTransformer: f, containerClassName: x, noScriptCSSFallback: g = ne, render: w, children: O } = a, l = Jt(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), I, nt, rt, ot, at;
|
|
118
|
+
let [Ot, It] = n.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), c = u ?? Ot, W = Qt(c), L = n.useCallback((e) => {
|
|
119
|
+
v?.(e), It(e);
|
|
120
|
+
}, [v]), C = n.useMemo(() => d ? typeof d == "string" ? new RegExp(d) : d : null, [d]), p = n.useRef(null), U = n.useRef(null), X = n.useRef({ value: c, onChange: L, isIOS: typeof window < "u" && ((nt = (I = window?.CSS) == null ? void 0 : I.supports) == null ? void 0 : nt.call(I, "-webkit-touch-callout", "none")) }), Z = n.useRef({ prev: [(rt = p.current) == null ? void 0 : rt.selectionStart, (ot = p.current) == null ? void 0 : ot.selectionEnd, (at = p.current) == null ? void 0 : at.selectionDirection] });
|
|
111
121
|
n.useImperativeHandle(r, () => p.current, []), n.useEffect(() => {
|
|
112
|
-
let e = p.current, o =
|
|
122
|
+
let e = p.current, o = U.current;
|
|
113
123
|
if (!e || !o) return;
|
|
114
|
-
|
|
124
|
+
X.current.value !== e.value && X.current.onChange(e.value), Z.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
|
|
115
125
|
function m() {
|
|
116
126
|
if (document.activeElement !== e) {
|
|
117
|
-
|
|
127
|
+
$(null), V(null);
|
|
118
128
|
return;
|
|
119
129
|
}
|
|
120
|
-
let i = e.selectionStart,
|
|
121
|
-
if (
|
|
122
|
-
let Bt = i ===
|
|
130
|
+
let i = e.selectionStart, h = e.selectionEnd, J = e.selectionDirection, P = e.maxLength, F = e.value, M = Z.current.prev, j = -1, D = -1, N;
|
|
131
|
+
if (F.length !== 0 && i !== null && h !== null) {
|
|
132
|
+
let Bt = i === h, Ft = i === F.length && F.length < P;
|
|
123
133
|
if (Bt && !Ft) {
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
else if (
|
|
127
|
-
else if (
|
|
128
|
-
let
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
let Nt =
|
|
132
|
-
|
|
134
|
+
let _ = i;
|
|
135
|
+
if (_ === 0) j = 0, D = 1, N = "forward";
|
|
136
|
+
else if (_ === P) j = _ - 1, D = _, N = "backward";
|
|
137
|
+
else if (P > 1 && F.length > 1) {
|
|
138
|
+
let et = 0;
|
|
139
|
+
if (M[0] !== null && M[1] !== null) {
|
|
140
|
+
N = _ < M[1] ? "backward" : "forward";
|
|
141
|
+
let Nt = M[0] === M[1] && M[0] < P;
|
|
142
|
+
N === "backward" && !Nt && (et = -1);
|
|
133
143
|
}
|
|
134
|
-
|
|
144
|
+
j = et + _, D = et + _ + 1;
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
|
-
|
|
147
|
+
j !== -1 && D !== -1 && j !== D && p.current.setSelectionRange(j, D, N);
|
|
138
148
|
}
|
|
139
|
-
let
|
|
140
|
-
|
|
149
|
+
let dt = j !== -1 ? j : i, mt = D !== -1 ? D : h, Wt = N ?? J;
|
|
150
|
+
$(dt), V(mt), Z.current.prev = [dt, mt, Wt];
|
|
141
151
|
}
|
|
142
|
-
if (document.addEventListener("selectionchange", m, { capture: !0 }), m(), document.activeElement === e &&
|
|
152
|
+
if (document.addEventListener("selectionchange", m, { capture: !0 }), m(), document.activeElement === e && Y(!0), !document.getElementById("input-otp-style")) {
|
|
143
153
|
let i = document.createElement("style");
|
|
144
154
|
if (i.id = "input-otp-style", document.head.appendChild(i), i.sheet) {
|
|
145
|
-
let
|
|
146
|
-
|
|
155
|
+
let h = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
156
|
+
q(i.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), q(i.sheet, `[data-input-otp]:autofill { ${h} }`), q(i.sheet, `[data-input-otp]:-webkit-autofill { ${h} }`), q(i.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), q(i.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
159
|
let y = () => {
|
|
@@ -155,73 +165,73 @@ var ne = n.createContext({}), Mt = n.forwardRef((t, r) => {
|
|
|
155
165
|
document.removeEventListener("selectionchange", m, { capture: !0 }), E.disconnect();
|
|
156
166
|
};
|
|
157
167
|
}, []);
|
|
158
|
-
let [
|
|
168
|
+
let [lt, it] = n.useState(!1), [z, Y] = n.useState(!1), [B, $] = n.useState(null), [H, V] = n.useState(null);
|
|
159
169
|
n.useEffect(() => {
|
|
160
|
-
|
|
170
|
+
Kt(() => {
|
|
161
171
|
var e, o, m, y;
|
|
162
172
|
(e = p.current) == null || e.dispatchEvent(new Event("input"));
|
|
163
|
-
let E = (o = p.current) == null ? void 0 : o.selectionStart, i = (m = p.current) == null ? void 0 : m.selectionEnd,
|
|
164
|
-
E !== null && i !== null && (
|
|
173
|
+
let E = (o = p.current) == null ? void 0 : o.selectionStart, i = (m = p.current) == null ? void 0 : m.selectionEnd, h = (y = p.current) == null ? void 0 : y.selectionDirection;
|
|
174
|
+
E !== null && i !== null && ($(E), V(i), Z.current.prev = [E, i, h]);
|
|
165
175
|
});
|
|
166
|
-
}, [c,
|
|
167
|
-
|
|
168
|
-
}, [s,
|
|
169
|
-
let
|
|
176
|
+
}, [c, z]), n.useEffect(() => {
|
|
177
|
+
W !== void 0 && c !== W && W.length < s && c.length === s && A?.(c);
|
|
178
|
+
}, [s, A, W, c]);
|
|
179
|
+
let G = te({ containerRef: U, inputRef: p, pushPasswordManagerStrategy: R, isFocused: z }), ut = n.useCallback((e) => {
|
|
170
180
|
let o = e.currentTarget.value.slice(0, s);
|
|
171
|
-
if (o.length > 0 &&
|
|
181
|
+
if (o.length > 0 && C && !C.test(o)) {
|
|
172
182
|
e.preventDefault();
|
|
173
183
|
return;
|
|
174
184
|
}
|
|
175
|
-
typeof
|
|
176
|
-
}, [s,
|
|
185
|
+
typeof W == "string" && o.length < W.length && document.dispatchEvent(new Event("selectionchange")), L(o);
|
|
186
|
+
}, [s, L, W, C]), st = n.useCallback(() => {
|
|
177
187
|
var e;
|
|
178
188
|
if (p.current) {
|
|
179
189
|
let o = Math.min(p.current.value.length, s - 1), m = p.current.value.length;
|
|
180
|
-
(e = p.current) == null || e.setSelectionRange(o, m),
|
|
190
|
+
(e = p.current) == null || e.setSelectionRange(o, m), $(o), V(m);
|
|
181
191
|
}
|
|
182
|
-
|
|
183
|
-
}, [s]),
|
|
192
|
+
Y(!0);
|
|
193
|
+
}, [s]), ct = n.useCallback((e) => {
|
|
184
194
|
var o, m;
|
|
185
195
|
let y = p.current;
|
|
186
|
-
if (!f && (!
|
|
196
|
+
if (!f && (!X.current.isIOS || !e.clipboardData || !y)) return;
|
|
187
197
|
let E = e.clipboardData.getData("text/plain"), i = f ? f(E) : E;
|
|
188
198
|
e.preventDefault();
|
|
189
|
-
let
|
|
190
|
-
if (
|
|
191
|
-
y.value =
|
|
192
|
-
let
|
|
193
|
-
y.setSelectionRange(
|
|
194
|
-
}, [s,
|
|
199
|
+
let h = (o = p.current) == null ? void 0 : o.selectionStart, J = (m = p.current) == null ? void 0 : m.selectionEnd, P = (h !== J ? c.slice(0, h) + i + c.slice(J) : c.slice(0, h) + i + c.slice(h)).slice(0, s);
|
|
200
|
+
if (P.length > 0 && C && !C.test(P)) return;
|
|
201
|
+
y.value = P, L(P);
|
|
202
|
+
let F = Math.min(P.length, s - 1), M = P.length;
|
|
203
|
+
y.setSelectionRange(F, M), $(F), V(M);
|
|
204
|
+
}, [s, L, C, c]), jt = n.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), pt = n.useMemo(() => ({ position: "absolute", inset: 0, width: G.willPushPWMBadge ? `calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: G.willPushPWMBadge ? `inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: b, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [G.PWM_BADGE_SPACE_WIDTH, G.willPushPWMBadge, b]), Dt = n.useMemo(() => n.createElement("input", Zt(qt({ autoComplete: l.autoComplete || "one-time-code" }, l), { "data-input-otp": !0, "data-input-otp-placeholder-shown": c.length === 0 || void 0, "data-input-otp-mss": B, "data-input-otp-mse": H, inputMode: S, pattern: C?.source, "aria-placeholder": T, style: pt, maxLength: s, value: c, ref: p, onPaste: (e) => {
|
|
195
205
|
var o;
|
|
196
|
-
|
|
197
|
-
}, onChange:
|
|
206
|
+
ct(e), (o = l.onPaste) == null || o.call(l, e);
|
|
207
|
+
}, onChange: ut, onMouseOver: (e) => {
|
|
198
208
|
var o;
|
|
199
|
-
|
|
209
|
+
it(!0), (o = l.onMouseOver) == null || o.call(l, e);
|
|
200
210
|
}, onMouseLeave: (e) => {
|
|
201
211
|
var o;
|
|
202
|
-
|
|
212
|
+
it(!1), (o = l.onMouseLeave) == null || o.call(l, e);
|
|
203
213
|
}, onFocus: (e) => {
|
|
204
214
|
var o;
|
|
205
|
-
|
|
215
|
+
st(), (o = l.onFocus) == null || o.call(l, e);
|
|
206
216
|
}, onBlur: (e) => {
|
|
207
217
|
var o;
|
|
208
|
-
|
|
209
|
-
} })), [
|
|
218
|
+
Y(!1), (o = l.onBlur) == null || o.call(l, e);
|
|
219
|
+
} })), [ut, st, ct, S, pt, s, H, B, l, C?.source, c]), tt = n.useMemo(() => ({ slots: Array.from({ length: s }).map((e, o) => {
|
|
210
220
|
var m;
|
|
211
|
-
let y =
|
|
221
|
+
let y = z && B !== null && H !== null && (B === H && o === B || o >= B && o < H), E = c[o] !== void 0 ? c[o] : null, i = c[0] !== void 0 ? null : (m = T?.[o]) != null ? m : null;
|
|
212
222
|
return { char: E, placeholderChar: i, isActive: y, hasFakeCaret: y && E === null };
|
|
213
|
-
}), isFocused:
|
|
214
|
-
return n.createElement(n.Fragment, null,
|
|
223
|
+
}), isFocused: z, isHovering: !l.disabled && lt }), [z, lt, s, H, B, l.disabled, c]), At = n.useMemo(() => w ? w(tt) : n.createElement(ee.Provider, { value: tt }, O), [O, tt, w]);
|
|
224
|
+
return n.createElement(n.Fragment, null, g !== null && n.createElement("noscript", null, n.createElement("style", null, g)), n.createElement("div", { ref: U, "data-input-otp-container": !0, style: jt, className: x }, At, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
|
|
215
225
|
});
|
|
216
|
-
|
|
217
|
-
function
|
|
226
|
+
St.displayName = "Input";
|
|
227
|
+
function q(t, r) {
|
|
218
228
|
try {
|
|
219
229
|
t.insertRule(r);
|
|
220
230
|
} catch {
|
|
221
231
|
console.error("input-otp could not insert CSS rule:", r);
|
|
222
232
|
}
|
|
223
233
|
}
|
|
224
|
-
var
|
|
234
|
+
var ne = `
|
|
225
235
|
[data-input-otp] {
|
|
226
236
|
--nojs-bg: white !important;
|
|
227
237
|
--nojs-fg: black !important;
|
|
@@ -241,42 +251,40 @@ var re = `
|
|
|
241
251
|
--nojs-fg: white !important;
|
|
242
252
|
}
|
|
243
253
|
}`;
|
|
244
|
-
const
|
|
245
|
-
const t =
|
|
254
|
+
const Pt = ht({}), xt = ht(null), Ct = () => {
|
|
255
|
+
const t = bt(xt);
|
|
246
256
|
if (!t)
|
|
247
257
|
throw new Error("useRoot must be used within an InputOTP");
|
|
248
258
|
return t;
|
|
249
|
-
},
|
|
259
|
+
}, Mt = Q(
|
|
250
260
|
({
|
|
251
261
|
autoFocus: t = !1,
|
|
252
262
|
children: r,
|
|
253
263
|
className: a,
|
|
254
264
|
errorMessage: u,
|
|
255
|
-
hasError:
|
|
265
|
+
hasError: v,
|
|
256
266
|
id: s,
|
|
257
|
-
inputMode:
|
|
267
|
+
inputMode: b = "numeric",
|
|
258
268
|
maxLength: d,
|
|
259
|
-
name:
|
|
269
|
+
name: T,
|
|
260
270
|
onChange: S,
|
|
261
|
-
onComplete:
|
|
262
|
-
value:
|
|
271
|
+
onComplete: A,
|
|
272
|
+
value: R,
|
|
263
273
|
variant: f = "outlined",
|
|
264
|
-
groupSize: g,
|
|
265
|
-
separatorPositions: v,
|
|
266
274
|
...x
|
|
267
|
-
},
|
|
268
|
-
const
|
|
269
|
-
const I =
|
|
275
|
+
}, g) => {
|
|
276
|
+
const w = Ht(s, T), O = (l) => {
|
|
277
|
+
const I = l.clipboardData.getData("text/plain").trim();
|
|
270
278
|
I.length === d && typeof S == "function" && (S(""), setTimeout(() => {
|
|
271
279
|
typeof S == "function" && S(I);
|
|
272
280
|
}, 0));
|
|
273
|
-
}
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
|
|
281
|
+
};
|
|
282
|
+
return /* @__PURE__ */ k(Pt.Provider, { value: { hasError: v }, children: /* @__PURE__ */ vt("div", { className: "flex w-max flex-col gap-y-1", children: [
|
|
283
|
+
/* @__PURE__ */ k(
|
|
284
|
+
St,
|
|
277
285
|
{
|
|
278
286
|
autoFocus: t,
|
|
279
|
-
containerClassName:
|
|
287
|
+
containerClassName: gt(
|
|
280
288
|
"flex items-center gap-2 has-[:disabled]:opacity-50 disabled:cursor-not-allowed",
|
|
281
289
|
a
|
|
282
290
|
),
|
|
@@ -285,29 +293,26 @@ const kt = Et({}), Rt = Et(null), Tt = () => {
|
|
|
285
293
|
"data-lpignore": "true",
|
|
286
294
|
"data-protonpass-ignore": "true",
|
|
287
295
|
"data-testid": "input-otp",
|
|
288
|
-
id:
|
|
289
|
-
inputMode:
|
|
296
|
+
id: w,
|
|
297
|
+
inputMode: b,
|
|
290
298
|
maxLength: d,
|
|
291
299
|
onChange: S,
|
|
292
|
-
onComplete:
|
|
293
|
-
onPaste:
|
|
300
|
+
onComplete: A,
|
|
301
|
+
onPaste: O,
|
|
294
302
|
pushPasswordManagerStrategy: "none",
|
|
295
|
-
ref:
|
|
303
|
+
ref: g,
|
|
296
304
|
textAlign: "center",
|
|
297
|
-
value:
|
|
305
|
+
value: R,
|
|
298
306
|
...x,
|
|
299
|
-
render: ({ slots:
|
|
300
|
-
Q.includes(z) && /* @__PURE__ */ P(ct, {}),
|
|
301
|
-
/* @__PURE__ */ P(st, { index: z })
|
|
302
|
-
] }, z)) }) : r })
|
|
307
|
+
render: ({ slots: l }) => /* @__PURE__ */ k(xt.Provider, { value: { slots: l, variant: f }, children: r })
|
|
303
308
|
}
|
|
304
309
|
),
|
|
305
|
-
|
|
310
|
+
v && u && /* @__PURE__ */ k(Gt, { id: Lt(w), message: u })
|
|
306
311
|
] }) });
|
|
307
312
|
}
|
|
308
313
|
);
|
|
309
|
-
|
|
310
|
-
const
|
|
314
|
+
Mt.displayName = "InputOTP";
|
|
315
|
+
const kt = Q(({ ...t }, r) => /* @__PURE__ */ k(
|
|
311
316
|
"div",
|
|
312
317
|
{
|
|
313
318
|
ref: r,
|
|
@@ -316,39 +321,39 @@ const ut = et(({ ...t }, r) => /* @__PURE__ */ P(
|
|
|
316
321
|
"data-testid": "input-otp-group"
|
|
317
322
|
}
|
|
318
323
|
));
|
|
319
|
-
|
|
320
|
-
const
|
|
324
|
+
kt.displayName = "InputOTP.Group";
|
|
325
|
+
const Tt = Q(
|
|
321
326
|
({ index: t, className: r, ...a }, u) => {
|
|
322
|
-
const { variant:
|
|
323
|
-
return /* @__PURE__ */
|
|
327
|
+
const { variant: v = "outlined", slots: s = [] } = Ct(), { hasError: b } = bt(Pt), d = s[t] || { char: "", hasFakeCaret: !0, isActive: !1 };
|
|
328
|
+
return /* @__PURE__ */ vt(
|
|
324
329
|
"div",
|
|
325
330
|
{
|
|
326
331
|
ref: u,
|
|
327
|
-
className:
|
|
332
|
+
className: gt(
|
|
328
333
|
"relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border-1 transition duration-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
329
|
-
|
|
330
|
-
!
|
|
331
|
-
|
|
332
|
-
d.isActive && !
|
|
333
|
-
d.isActive &&
|
|
334
|
+
v === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
|
|
335
|
+
!b && "border",
|
|
336
|
+
b && "border-danger-400 focus-visible:outline-danger-400 border-2",
|
|
337
|
+
d.isActive && !b && "outline-input-otp-border--focus z-10 outline-2 outline-offset-2",
|
|
338
|
+
d.isActive && b && "outline-danger-400 outline-2 outline-offset-2",
|
|
334
339
|
r
|
|
335
340
|
),
|
|
336
341
|
"data-index": t,
|
|
337
342
|
"data-testid": "input-otp-slot",
|
|
338
|
-
"data-variant":
|
|
343
|
+
"data-variant": v,
|
|
339
344
|
...a,
|
|
340
345
|
children: [
|
|
341
346
|
d.char,
|
|
342
|
-
d.hasFakeCaret && /* @__PURE__ */
|
|
347
|
+
d.hasFakeCaret && /* @__PURE__ */ k("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ k("div", { className: "bg-input-otp-caret h-8 w-px" }) })
|
|
343
348
|
]
|
|
344
349
|
}
|
|
345
350
|
);
|
|
346
351
|
}
|
|
347
352
|
);
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
const { variant: a = "outlined" } =
|
|
351
|
-
return /* @__PURE__ */
|
|
353
|
+
Tt.displayName = "InputOTP.Slot";
|
|
354
|
+
const Rt = Q(({ ...t }, r) => {
|
|
355
|
+
const { variant: a = "outlined" } = Ct();
|
|
356
|
+
return /* @__PURE__ */ k("div", { ref: r, role: "separator", ...t, "data-testid": "input-otp-separator", "data-variant": a, children: /* @__PURE__ */ k(
|
|
352
357
|
_t,
|
|
353
358
|
{
|
|
354
359
|
size: 24,
|
|
@@ -356,12 +361,12 @@ const ct = et(({ ...t }, r) => {
|
|
|
356
361
|
}
|
|
357
362
|
) });
|
|
358
363
|
});
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
Group:
|
|
362
|
-
Slot:
|
|
363
|
-
Separator:
|
|
364
|
+
Rt.displayName = "InputOTP.Separator";
|
|
365
|
+
const pn = Object.assign(Mt, {
|
|
366
|
+
Group: kt,
|
|
367
|
+
Slot: Tt,
|
|
368
|
+
Separator: Rt
|
|
364
369
|
});
|
|
365
370
|
export {
|
|
366
|
-
|
|
371
|
+
pn as InputOTP
|
|
367
372
|
};
|