@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.
Files changed (281) hide show
  1. package/dist/.js +205 -152
  2. package/dist/Accordion.d.ts +37 -0
  3. package/dist/Accordion.js +474 -0
  4. package/dist/Alert/AlertBase.js +2 -2
  5. package/dist/Alert.js +21 -11
  6. package/dist/Avatar.js +1 -1
  7. package/dist/Badge.d.ts +12 -2
  8. package/dist/Badge.js +28 -4
  9. package/dist/Button.d.ts +3 -3
  10. package/dist/Button.js +35 -28
  11. package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
  12. package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
  13. package/dist/ButtonGroup.d.ts +29 -0
  14. package/dist/ButtonGroup.js +89 -0
  15. package/dist/ButtonIcon.js +11 -1
  16. package/dist/Card.d.ts +16 -0
  17. package/dist/Card.js +32 -0
  18. package/dist/Checkbox/CheckboxBase.js +1 -1
  19. package/dist/Checkbox.js +22 -14
  20. package/dist/Dialog/DialogBase.d.ts +6 -3
  21. package/dist/Dialog/DialogBase.js +113 -98
  22. package/dist/Dialog.d.ts +1 -1
  23. package/dist/Dialog.js +42 -36
  24. package/dist/Drawer.js +24 -1283
  25. package/dist/HoverCard.d.ts +29 -0
  26. package/dist/HoverCard.js +207 -0
  27. package/dist/Icons/AnalyzeIcon.d.ts +3 -0
  28. package/dist/Icons/AnalyzeIcon.js +73 -0
  29. package/dist/Icons/AnnotationsIcon.js +4 -4
  30. package/dist/Icons/ApprovedIcon.d.ts +3 -0
  31. package/dist/Icons/ApprovedIcon.js +43 -0
  32. package/dist/Icons/CalendarIcon.js +7 -7
  33. package/dist/Icons/CheckCircleIcon.js +14 -14
  34. package/dist/Icons/CheckSquareIcon.js +14 -14
  35. package/dist/Icons/CheckmarkIcon.js +9 -9
  36. package/dist/Icons/ChevronDownIcon.js +6 -6
  37. package/dist/Icons/ChevronUpIcon.js +7 -7
  38. package/dist/Icons/ClockIcon.js +10 -10
  39. package/dist/Icons/CloseCircleIcon.js +10 -10
  40. package/dist/Icons/CloseIcon.js +5 -5
  41. package/dist/Icons/DashboardIcon.js +4 -4
  42. package/dist/Icons/DatabaseIcon.d.ts +3 -0
  43. package/dist/Icons/DatabaseIcon.js +53 -0
  44. package/dist/Icons/DeleteIcon.js +24 -6
  45. package/dist/Icons/DurationIcon.js +7 -7
  46. package/dist/Icons/EmailIcon.js +4 -4
  47. package/dist/Icons/EraserIcon.js +20 -11
  48. package/dist/Icons/ErrorIcon.js +3 -3
  49. package/dist/Icons/EyeClosedIcon.js +2 -2
  50. package/dist/Icons/EyeClosedIcon2.js +18 -18
  51. package/dist/Icons/EyeOpenIcon.js +8 -8
  52. package/dist/Icons/GoToFirstIcon.js +1 -1
  53. package/dist/Icons/GoToLastIcon.js +3 -3
  54. package/dist/Icons/HarmonicCursorsIcon.js +4 -4
  55. package/dist/Icons/IconBase.d.ts +1 -1
  56. package/dist/Icons/IconBase.js +15 -17
  57. package/dist/Icons/InfoIcon.js +4 -4
  58. package/dist/Icons/LabelIcon.js +6 -6
  59. package/dist/Icons/LassoIcon.js +6 -6
  60. package/dist/Icons/LineToolIcon.js +22 -93
  61. package/dist/Icons/LineToolIcon2.d.ts +3 -0
  62. package/dist/Icons/LineToolIcon2.js +73 -0
  63. package/dist/Icons/LiveViewIcon.js +5 -5
  64. package/dist/Icons/LoaderIcon.js +5 -5
  65. package/dist/Icons/LocationIcon.js +5 -5
  66. package/dist/Icons/LogoutIcon.js +11 -11
  67. package/dist/Icons/MessagesIcon.d.ts +3 -0
  68. package/dist/Icons/MessagesIcon.js +34 -0
  69. package/dist/Icons/MetadataIcon.js +5 -5
  70. package/dist/Icons/MinusIcon.js +9 -9
  71. package/dist/Icons/OntologyIcon.js +74 -21
  72. package/dist/Icons/PanelIconClose.js +11 -11
  73. package/dist/Icons/PanelIconOpen.js +11 -11
  74. package/dist/Icons/PlayIcon.js +5 -5
  75. package/dist/Icons/PlusIcon.js +9 -8
  76. package/dist/Icons/ResetIcon.js +6 -6
  77. package/dist/Icons/ReviewedIcon.d.ts +3 -0
  78. package/dist/Icons/ReviewedIcon.js +44 -0
  79. package/dist/Icons/ScissorsIcon.js +9 -9
  80. package/dist/Icons/SettingsIcon.js +20 -22
  81. package/dist/Icons/SortAscendingIcon.d.ts +3 -0
  82. package/dist/Icons/SortAscendingIcon.js +73 -0
  83. package/dist/Icons/SortDescendingIcon.d.ts +3 -0
  84. package/dist/Icons/SortDescendingIcon.js +73 -0
  85. package/dist/Icons/StackIcon.d.ts +3 -0
  86. package/dist/Icons/StackIcon.js +43 -0
  87. package/dist/Icons/StarIcon.d.ts +3 -0
  88. package/dist/Icons/StarIcon.js +31 -0
  89. package/dist/Icons/TrashIcon.js +10 -10
  90. package/dist/Icons/UndoIcon.js +1 -1
  91. package/dist/Icons/UserIcon.js +1 -1
  92. package/dist/Icons/WarningIcon.js +9 -9
  93. package/dist/Icons/ZoomAllIcon.js +97 -57
  94. package/dist/Icons/ZoomXIcon.js +6 -6
  95. package/dist/Icons/ZoomYIcon.js +17 -8
  96. package/dist/Icons/index.d.ts +10 -0
  97. package/dist/Icons.js +114 -94
  98. package/dist/Input.d.ts +2 -0
  99. package/dist/Input.js +100 -82
  100. package/dist/InputGroup.d.ts +16 -0
  101. package/dist/InputGroup.js +129 -0
  102. package/dist/InputOTP.d.ts +0 -2
  103. package/dist/InputOTP.js +148 -143
  104. package/dist/Label.d.ts +3 -7
  105. package/dist/Label.js +11 -11
  106. package/dist/MultiSelect/MultiSelectBase.js +28 -28
  107. package/dist/Popover.d.ts +6 -7
  108. package/dist/Popover.js +60 -71
  109. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
  110. package/dist/RadioButtonGroup.js +1 -1
  111. package/dist/RadioGroup.d.ts +1 -1
  112. package/dist/RadioGroup.js +141 -134
  113. package/dist/Select.d.ts +12 -12
  114. package/dist/Select.js +106 -895
  115. package/dist/Separator.d.ts +12 -0
  116. package/dist/Separator.js +24 -0
  117. package/dist/Skeleton.js +3 -3
  118. package/dist/Slider.d.ts +15 -3
  119. package/dist/Slider.js +464 -40
  120. package/dist/Switch/SwitchBase.js +1 -1
  121. package/dist/Switch.js +2 -2
  122. package/dist/Tabs/TabsBase.js +1 -1
  123. package/dist/Tabs.js +16 -16
  124. package/dist/Textarea.js +58 -50
  125. package/dist/Toggle.js +2 -2
  126. package/dist/ToggleGroup.js +1 -1
  127. package/dist/Tooltip/TooltipBase.js +29 -29
  128. package/dist/Tooltip.js +15 -15
  129. package/dist/Tray/TrayStoriesData.d.ts +39 -0
  130. package/dist/Tray/TrayStoriesData.js +438 -0
  131. package/dist/Tray.d.ts +28 -0
  132. package/dist/Tray.js +236 -0
  133. package/dist/analyzer/network.webp +0 -0
  134. package/dist/analyzer/sunburst.webp +0 -0
  135. package/dist/analyzer/visual.webp +0 -0
  136. package/dist/clsx-OuTLNxxd.js +16 -0
  137. package/dist/components/Accordion/Accordion.d.ts +37 -0
  138. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  139. package/dist/components/Badge/Badge.d.ts +12 -2
  140. package/dist/components/Badge/Badge.d.ts.map +1 -1
  141. package/dist/components/Button/Button.d.ts +3 -3
  142. package/dist/components/Button/Button.d.ts.map +1 -1
  143. package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
  144. package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
  145. package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
  146. package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
  147. package/dist/components/Card/Card.d.ts +16 -0
  148. package/dist/components/Card/Card.d.ts.map +1 -0
  149. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  150. package/dist/components/Dialog/Dialog.d.ts +1 -1
  151. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  152. package/dist/components/Dialog/DialogBase.d.ts +6 -3
  153. package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
  154. package/dist/components/HoverCard/HoverCard.d.ts +29 -0
  155. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
  156. package/dist/components/Icons/AnalyzeIcon.d.ts +3 -0
  157. package/dist/components/Icons/AnalyzeIcon.d.ts.map +1 -0
  158. package/dist/components/Icons/ApprovedIcon.d.ts +3 -0
  159. package/dist/components/Icons/ApprovedIcon.d.ts.map +1 -0
  160. package/dist/components/Icons/DatabaseIcon.d.ts +3 -0
  161. package/dist/components/Icons/DatabaseIcon.d.ts.map +1 -0
  162. package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
  163. package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
  164. package/dist/components/Icons/IconBase.d.ts +1 -1
  165. package/dist/components/Icons/IconBase.d.ts.map +1 -1
  166. package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
  167. package/dist/components/Icons/LineToolIcon2.d.ts +3 -0
  168. package/dist/components/Icons/LineToolIcon2.d.ts.map +1 -0
  169. package/dist/components/Icons/MessagesIcon.d.ts +3 -0
  170. package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
  171. package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
  172. package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
  173. package/dist/components/Icons/ReviewedIcon.d.ts +3 -0
  174. package/dist/components/Icons/ReviewedIcon.d.ts.map +1 -0
  175. package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
  176. package/dist/components/Icons/SortAscendingIcon.d.ts +3 -0
  177. package/dist/components/Icons/SortAscendingIcon.d.ts.map +1 -0
  178. package/dist/components/Icons/SortDescendingIcon.d.ts +3 -0
  179. package/dist/components/Icons/SortDescendingIcon.d.ts.map +1 -0
  180. package/dist/components/Icons/StackIcon.d.ts +3 -0
  181. package/dist/components/Icons/StackIcon.d.ts.map +1 -0
  182. package/dist/components/Icons/StarIcon.d.ts +3 -0
  183. package/dist/components/Icons/StarIcon.d.ts.map +1 -0
  184. package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
  185. package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
  186. package/dist/components/Icons/index.d.ts +10 -0
  187. package/dist/components/Icons/index.d.ts.map +1 -1
  188. package/dist/components/Input/Input.d.ts +2 -0
  189. package/dist/components/Input/Input.d.ts.map +1 -1
  190. package/dist/components/InputGroup/InputGroup.d.ts +16 -0
  191. package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
  192. package/dist/components/InputOTP/InputOTP.d.ts +0 -2
  193. package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
  194. package/dist/components/Label/Label.d.ts +3 -7
  195. package/dist/components/Label/Label.d.ts.map +1 -1
  196. package/dist/components/Popover/Popover.d.ts +6 -7
  197. package/dist/components/Popover/Popover.d.ts.map +1 -1
  198. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  199. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  200. package/dist/components/Select/Select.d.ts +12 -12
  201. package/dist/components/Select/Select.d.ts.map +1 -1
  202. package/dist/components/Separator/Separator.d.ts +12 -0
  203. package/dist/components/Separator/Separator.d.ts.map +1 -0
  204. package/dist/components/Slider/Slider.d.ts +15 -3
  205. package/dist/components/Slider/Slider.d.ts.map +1 -1
  206. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  207. package/dist/components/Tray/Tray.d.ts +28 -0
  208. package/dist/components/Tray/Tray.d.ts.map +1 -0
  209. package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
  210. package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
  211. package/dist/{createLucideIcon-CI1yJrZf.js → createLucideIcon-B_8CJpcQ.js} +4 -4
  212. package/dist/features/AuthCard/ForgotPasswordEmailForm.js +13 -3
  213. package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
  214. package/dist/features/AuthCard/PasswordInput.js +87 -9
  215. package/dist/features/AuthCard/SignInForm.js +25 -15
  216. package/dist/features/AuthCard/SignUpForm.js +24 -14
  217. package/dist/features/AuthCard.js +2 -2
  218. package/dist/features/LabelingTools.js +16 -6
  219. package/dist/features/SensorMetadata.js +15 -5
  220. package/dist/features/SettingsPopover.js +22 -12
  221. package/dist/index-0ioNhtNM.js +10 -0
  222. package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
  223. package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
  224. package/dist/index-B2oBi8ng.js +142 -0
  225. package/dist/index-BIpuW_o8.js +146 -0
  226. package/dist/index-BZPx6jYI.js +8 -0
  227. package/dist/index-BhufZRa2.js +232 -0
  228. package/dist/index-CAKA12cC.js +1265 -0
  229. package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
  230. package/dist/index-CVSxKOPp.js +13 -0
  231. package/dist/index-CevVJ05e.js +822 -0
  232. package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
  233. package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
  234. package/dist/index-UEFPWH8U.js +54 -0
  235. package/dist/index-rKs9bXHr.js +6 -0
  236. package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
  237. package/dist/index.d.ts +11 -1
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/linear-cursor-small.png +0 -0
  240. package/dist/{loader-circle-CvdzOiQ_.js → loader-circle-CdRVlFhN.js} +2 -2
  241. package/dist/main.js +15630 -13510
  242. package/dist/message-alert-matte-glass-gradient.webp +0 -0
  243. package/dist/primitives/button.d.ts +10 -0
  244. package/dist/primitives/button.d.ts.map +1 -0
  245. package/dist/primitives/button.js +42 -0
  246. package/dist/primitives/input.d.ts +3 -0
  247. package/dist/primitives/input.d.ts.map +1 -0
  248. package/dist/primitives/input.js +18 -0
  249. package/dist/primitives/select.d.ts +16 -0
  250. package/dist/primitives/select.d.ts.map +1 -0
  251. package/dist/primitives/select.js +205 -0
  252. package/dist/primitives/slot.d.ts.map +1 -1
  253. package/dist/primitives/slot.js +21 -20
  254. package/dist/primitives/textarea.d.ts +3 -0
  255. package/dist/primitives/textarea.d.ts.map +1 -0
  256. package/dist/primitives/textarea.js +16 -0
  257. package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
  258. package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
  259. package/dist/styles/main.css +1 -1
  260. package/dist/utils/formFieldUtils.js +1 -1
  261. package/dist/utils/twUtils.js +2728 -2
  262. package/dist/{x-BBpi7a_7.js → x-Dl66o_vF.js} +2 -2
  263. package/package.json +28 -23
  264. package/dist/Accordion/AccordionBase.d.ts +0 -42
  265. package/dist/Accordion/AccordionBase.js +0 -225
  266. package/dist/Badge/BadgeBase.d.ts +0 -13
  267. package/dist/Badge/BadgeBase.js +0 -35
  268. package/dist/PasswordInput-ClY_hxuN.js +0 -261
  269. package/dist/components/Accordion/AccordionBase.d.ts +0 -42
  270. package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
  271. package/dist/components/Badge/BadgeBase.d.ts +0 -13
  272. package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
  273. package/dist/index-CA7haECj.js +0 -248
  274. package/dist/index-CbXx14YO.js +0 -59
  275. package/dist/index-VXXKXen4.js +0 -15
  276. package/dist/index-cCg4yNa8.js +0 -132
  277. package/dist/primitives/label.d.ts +0 -5
  278. package/dist/primitives/label.d.ts.map +0 -1
  279. package/dist/primitives/label.js +0 -27
  280. package/dist/twUtils-CRiPKpXj.js +0 -2743
  281. /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
+ };
@@ -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 P, jsxs as it } from "react/jsx-runtime";
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 $t } from "./utils/formFieldUtils.js";
52
- import { c as yt } from "./twUtils-CRiPKpXj.js";
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 Et, forwardRef as et, Fragment as Lt, useContext as Pt } from "react";
55
- var zt = Object.defineProperty, Vt = Object.defineProperties, qt = Object.getOwnPropertyDescriptors, tt = Object.getOwnPropertySymbols, St = Object.prototype.hasOwnProperty, xt = Object.prototype.propertyIsEnumerable, wt = (t, r, a) => r in t ? zt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, Zt = (t, r) => {
56
- for (var a in r || (r = {})) St.call(r, a) && wt(t, a, r[a]);
57
- if (tt) for (var a of tt(r)) xt.call(r, a) && wt(t, a, r[a]);
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
- }, Jt = (t, r) => Vt(t, qt(r)), Kt = (t, r) => {
69
+ }, Zt = (t, r) => $t(t, Vt(r)), Jt = (t, r) => {
60
70
  var a = {};
61
- for (var u in t) St.call(t, u) && r.indexOf(u) < 0 && (a[u] = t[u]);
62
- if (t != null && tt) for (var u of tt(t)) r.indexOf(u) < 0 && xt.call(t, u) && (a[u] = t[u]);
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 Qt(t) {
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 Ut(t) {
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 Xt = 18, Ct = 40, Yt = `${Ct}px`, te = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
76
- function ee({ containerRef: t, inputRef: r, pushPasswordManagerStrategy: a, isFocused: u }) {
77
- let [h, s] = n.useState(!1), [w, d] = n.useState(!1), [R, S] = n.useState(!1), D = n.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && h && w, [h, w, a]), T = n.useCallback(() => {
78
- let f = t.current, g = r.current;
79
- if (!f || !g || R || a === "none") return;
80
- let v = f, x = v.getBoundingClientRect().left + v.offsetWidth, O = v.getBoundingClientRect().top + v.offsetHeight / 2, l = x - Xt, W = O;
81
- document.querySelectorAll(te).length === 0 && document.elementFromPoint(l, W) === f || (s(!0), S(!0));
82
- }, [t, r, R, a]);
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 g() {
87
- let x = window.innerWidth - f.getBoundingClientRect().right;
88
- d(x >= Ct);
96
+ function x() {
97
+ let w = window.innerWidth - f.getBoundingClientRect().right;
98
+ d(w >= Et);
89
99
  }
90
- g();
91
- let v = setInterval(g, 1e3);
100
+ x();
101
+ let g = setInterval(x, 1e3);
92
102
  return () => {
93
- clearInterval(v);
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 g = setTimeout(T, 0), v = setTimeout(T, 2e3), x = setTimeout(T, 5e3), O = setTimeout(() => {
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(g), clearTimeout(v), clearTimeout(x), clearTimeout(O);
112
+ clearTimeout(x), clearTimeout(g), clearTimeout(w), clearTimeout(O);
103
113
  };
104
- }, [r, u, a, T]), { hasPWMBadge: h, willPushPWMBadge: D, PWM_BADGE_SPACE_WIDTH: Yt };
114
+ }, [r, u, a, R]), { hasPWMBadge: v, willPushPWMBadge: A, PWM_BADGE_SPACE_WIDTH: Xt };
105
115
  }
106
- var ne = n.createContext({}), Mt = n.forwardRef((t, r) => {
107
- var a = t, { value: u, onChange: h, maxLength: s, textAlign: w = "left", pattern: d, placeholder: R, inputMode: S = "numeric", onComplete: D, pushPasswordManagerStrategy: T = "increase-width", pasteTransformer: f, containerClassName: g, noScriptCSSFallback: v = re, render: x, children: O } = a, l = Kt(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), W, Q, U, B, I;
108
- let [z, It] = n.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), c = u ?? z, F = Ut(c), V = n.useCallback((e) => {
109
- h?.(e), It(e);
110
- }, [h]), M = n.useMemo(() => d ? typeof d == "string" ? new RegExp(d) : d : null, [d]), p = n.useRef(null), nt = n.useRef(null), rt = n.useRef({ value: c, onChange: V, isIOS: typeof window < "u" && ((Q = (W = window?.CSS) == null ? void 0 : W.supports) == null ? void 0 : Q.call(W, "-webkit-touch-callout", "none")) }), X = n.useRef({ prev: [(U = p.current) == null ? void 0 : U.selectionStart, (B = p.current) == null ? void 0 : B.selectionEnd, (I = p.current) == null ? void 0 : I.selectionDirection] });
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 = nt.current;
122
+ let e = p.current, o = U.current;
113
123
  if (!e || !o) return;
114
- rt.current.value !== e.value && rt.current.onChange(e.value), X.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
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
- Z(null), J(null);
127
+ $(null), V(null);
118
128
  return;
119
129
  }
120
- let i = e.selectionStart, b = e.selectionEnd, Y = e.selectionDirection, C = e.maxLength, _ = e.value, k = X.current.prev, A = -1, j = -1, H;
121
- if (_.length !== 0 && i !== null && b !== null) {
122
- let Bt = i === b, Ft = i === _.length && _.length < C;
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 G = i;
125
- if (G === 0) A = 0, j = 1, H = "forward";
126
- else if (G === C) A = G - 1, j = G, H = "backward";
127
- else if (C > 1 && _.length > 1) {
128
- let lt = 0;
129
- if (k[0] !== null && k[1] !== null) {
130
- H = G < k[1] ? "backward" : "forward";
131
- let Nt = k[0] === k[1] && k[0] < C;
132
- H === "backward" && !Nt && (lt = -1);
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
- A = lt + G, j = lt + G + 1;
144
+ j = et + _, D = et + _ + 1;
135
145
  }
136
146
  }
137
- A !== -1 && j !== -1 && A !== j && p.current.setSelectionRange(A, j, H);
147
+ j !== -1 && D !== -1 && j !== D && p.current.setSelectionRange(j, D, N);
138
148
  }
139
- let gt = A !== -1 ? A : i, bt = j !== -1 ? j : b, Wt = H ?? Y;
140
- Z(gt), J(bt), X.current.prev = [gt, bt, Wt];
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 && ot(!0), !document.getElementById("input-otp-style")) {
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 b = "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;";
146
- K(i.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), K(i.sheet, `[data-input-otp]:autofill { ${b} }`), K(i.sheet, `[data-input-otp]:-webkit-autofill { ${b} }`), K(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; } }"), K(i.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
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 [pt, dt] = n.useState(!1), [q, ot] = n.useState(!1), [N, Z] = n.useState(null), [$, J] = n.useState(null);
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
- Qt(() => {
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, b = (y = p.current) == null ? void 0 : y.selectionDirection;
164
- E !== null && i !== null && (Z(E), J(i), X.current.prev = [E, i, b]);
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, q]), n.useEffect(() => {
167
- F !== void 0 && c !== F && F.length < s && c.length === s && D?.(c);
168
- }, [s, D, F, c]);
169
- let L = ee({ containerRef: nt, inputRef: p, pushPasswordManagerStrategy: T, isFocused: q }), mt = n.useCallback((e) => {
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 && M && !M.test(o)) {
181
+ if (o.length > 0 && C && !C.test(o)) {
172
182
  e.preventDefault();
173
183
  return;
174
184
  }
175
- typeof F == "string" && o.length < F.length && document.dispatchEvent(new Event("selectionchange")), V(o);
176
- }, [s, V, F, M]), ft = n.useCallback(() => {
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), Z(o), J(m);
190
+ (e = p.current) == null || e.setSelectionRange(o, m), $(o), V(m);
181
191
  }
182
- ot(!0);
183
- }, [s]), vt = n.useCallback((e) => {
192
+ Y(!0);
193
+ }, [s]), ct = n.useCallback((e) => {
184
194
  var o, m;
185
195
  let y = p.current;
186
- if (!f && (!rt.current.isIOS || !e.clipboardData || !y)) return;
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 b = (o = p.current) == null ? void 0 : o.selectionStart, Y = (m = p.current) == null ? void 0 : m.selectionEnd, C = (b !== Y ? c.slice(0, b) + i + c.slice(Y) : c.slice(0, b) + i + c.slice(b)).slice(0, s);
190
- if (C.length > 0 && M && !M.test(C)) return;
191
- y.value = C, V(C);
192
- let _ = Math.min(C.length, s - 1), k = C.length;
193
- y.setSelectionRange(_, k), Z(_), J(k);
194
- }, [s, V, M, c]), At = n.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), ht = n.useMemo(() => ({ position: "absolute", inset: 0, width: L.willPushPWMBadge ? `calc(100% + ${L.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: L.willPushPWMBadge ? `inset(0 ${L.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: w, 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" }), [L.PWM_BADGE_SPACE_WIDTH, L.willPushPWMBadge, w]), jt = n.useMemo(() => n.createElement("input", Jt(Zt({ 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": N, "data-input-otp-mse": $, inputMode: S, pattern: M?.source, "aria-placeholder": R, style: ht, maxLength: s, value: c, ref: p, onPaste: (e) => {
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
- vt(e), (o = l.onPaste) == null || o.call(l, e);
197
- }, onChange: mt, onMouseOver: (e) => {
206
+ ct(e), (o = l.onPaste) == null || o.call(l, e);
207
+ }, onChange: ut, onMouseOver: (e) => {
198
208
  var o;
199
- dt(!0), (o = l.onMouseOver) == null || o.call(l, e);
209
+ it(!0), (o = l.onMouseOver) == null || o.call(l, e);
200
210
  }, onMouseLeave: (e) => {
201
211
  var o;
202
- dt(!1), (o = l.onMouseLeave) == null || o.call(l, e);
212
+ it(!1), (o = l.onMouseLeave) == null || o.call(l, e);
203
213
  }, onFocus: (e) => {
204
214
  var o;
205
- ft(), (o = l.onFocus) == null || o.call(l, e);
215
+ st(), (o = l.onFocus) == null || o.call(l, e);
206
216
  }, onBlur: (e) => {
207
217
  var o;
208
- ot(!1), (o = l.onBlur) == null || o.call(l, e);
209
- } })), [mt, ft, vt, S, ht, s, $, N, l, M?.source, c]), at = n.useMemo(() => ({ slots: Array.from({ length: s }).map((e, o) => {
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 = q && N !== null && $ !== null && (N === $ && o === N || o >= N && o < $), E = c[o] !== void 0 ? c[o] : null, i = c[0] !== void 0 ? null : (m = R?.[o]) != null ? m : null;
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: q, isHovering: !l.disabled && pt }), [q, pt, s, $, N, l.disabled, c]), Dt = n.useMemo(() => x ? x(at) : n.createElement(ne.Provider, { value: at }, O), [O, at, x]);
214
- return n.createElement(n.Fragment, null, v !== null && n.createElement("noscript", null, n.createElement("style", null, v)), n.createElement("div", { ref: nt, "data-input-otp-container": !0, style: At, className: g }, Dt, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, jt)));
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
- Mt.displayName = "Input";
217
- function K(t, r) {
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 re = `
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 kt = Et({}), Rt = Et(null), Tt = () => {
245
- const t = Pt(Rt);
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
- }, Ot = et(
259
+ }, Mt = Q(
250
260
  ({
251
261
  autoFocus: t = !1,
252
262
  children: r,
253
263
  className: a,
254
264
  errorMessage: u,
255
- hasError: h,
265
+ hasError: v,
256
266
  id: s,
257
- inputMode: w = "numeric",
267
+ inputMode: b = "numeric",
258
268
  maxLength: d,
259
- name: R,
269
+ name: T,
260
270
  onChange: S,
261
- onComplete: D,
262
- value: T,
271
+ onComplete: A,
272
+ value: R,
263
273
  variant: f = "outlined",
264
- groupSize: g,
265
- separatorPositions: v,
266
274
  ...x
267
- }, O) => {
268
- const l = Ht(s, R), W = (B) => {
269
- const I = B.clipboardData.getData("text/plain").trim();
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
- }, Q = v ?? (g ? Array.from({ length: Math.ceil(d / g) - 1 }, (B, I) => (I + 1) * g) : []), U = g !== void 0 || v !== void 0;
274
- return /* @__PURE__ */ P(kt.Provider, { value: { hasError: h }, children: /* @__PURE__ */ it("div", { className: "flex w-max flex-col gap-y-1", children: [
275
- /* @__PURE__ */ P(
276
- Mt,
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: yt(
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: l,
289
- inputMode: w,
296
+ id: w,
297
+ inputMode: b,
290
298
  maxLength: d,
291
299
  onChange: S,
292
- onComplete: D,
293
- onPaste: W,
300
+ onComplete: A,
301
+ onPaste: O,
294
302
  pushPasswordManagerStrategy: "none",
295
- ref: O,
303
+ ref: g,
296
304
  textAlign: "center",
297
- value: T,
305
+ value: R,
298
306
  ...x,
299
- render: ({ slots: B }) => /* @__PURE__ */ P(Rt.Provider, { value: { slots: B, variant: f }, children: U ? /* @__PURE__ */ P(ut, { children: [...Array(d)].map((I, z) => /* @__PURE__ */ it(Lt, { children: [
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
- h && u && /* @__PURE__ */ P(Gt, { id: $t(l), message: u })
310
+ v && u && /* @__PURE__ */ k(Gt, { id: Lt(w), message: u })
306
311
  ] }) });
307
312
  }
308
313
  );
309
- Ot.displayName = "InputOTP";
310
- const ut = et(({ ...t }, r) => /* @__PURE__ */ P(
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
- ut.displayName = "InputOTP.Group";
320
- const st = et(
324
+ kt.displayName = "InputOTP.Group";
325
+ const Tt = Q(
321
326
  ({ index: t, className: r, ...a }, u) => {
322
- const { variant: h = "outlined", slots: s = [] } = Tt(), { hasError: w } = Pt(kt), d = s[t] || { char: "", hasFakeCaret: !0, isActive: !1 };
323
- return /* @__PURE__ */ it(
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: yt(
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
- h === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
330
- !w && "border",
331
- w && "border-danger-400 focus-visible:outline-danger-400 border-2",
332
- d.isActive && !w && "outline-input-otp-border--focus z-10 outline-2 outline-offset-2",
333
- d.isActive && w && "outline-danger-400 outline-2 outline-offset-2",
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": h,
343
+ "data-variant": v,
339
344
  ...a,
340
345
  children: [
341
346
  d.char,
342
- d.hasFakeCaret && /* @__PURE__ */ P("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ P("div", { className: "bg-input-otp-caret h-8 w-px" }) })
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
- st.displayName = "InputOTP.Slot";
349
- const ct = et(({ ...t }, r) => {
350
- const { variant: a = "outlined" } = Tt();
351
- return /* @__PURE__ */ P("div", { ref: r, role: "separator", ...t, "data-testid": "input-otp-separator", "data-variant": a, children: /* @__PURE__ */ P(
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
- ct.displayName = "InputOTP.Separator";
360
- const en = Object.assign(Ot, {
361
- Group: ut,
362
- Slot: st,
363
- Separator: ct
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
- en as InputOTP
371
+ pn as InputOTP
367
372
  };