@spear-ai/spectral 1.3.61 → 1.3.63
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 +181 -152
- package/dist/Accordion.d.ts +37 -0
- package/dist/Accordion.js +465 -0
- package/dist/Alert/AlertBase.js +2 -2
- package/dist/Alert.js +4 -3
- package/dist/Avatar.d.ts +12 -0
- package/dist/Avatar.js +88 -1
- package/dist/Badge.d.ts +12 -2
- package/dist/Badge.js +28 -4
- package/dist/Button.js +2 -2
- 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 +2 -1
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +21 -21
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +98 -0
- package/dist/Dialog/DialogBase.d.ts +1 -1
- package/dist/Dialog/DialogBase.js +2 -2
- package/dist/Dialog.js +4 -4
- package/dist/Drawer.js +24 -1283
- package/dist/HoverCard.d.ts +29 -0
- package/dist/HoverCard.js +207 -0
- package/dist/Icons/CheckmarkIcon.js +9 -9
- package/dist/Icons/MessagesIcon.d.ts +3 -0
- package/dist/Icons/MessagesIcon.js +31 -0
- package/dist/Icons/MinusIcon.js +13 -13
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +50 -48
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +98 -89
- package/dist/InputGroup.d.ts +16 -0
- package/dist/InputGroup.js +129 -0
- package/dist/InputOTP.d.ts +0 -2
- package/dist/InputOTP.js +138 -142
- package/dist/Label.d.ts +3 -7
- package/dist/Label.js +11 -11
- package/dist/MultiSelect/MultiSelectBase.js +22 -22
- 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.js +97 -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 +41 -42
- 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 +227 -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/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts +12 -2
- package/dist/components/Badge/Badge.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/Checkbox/Checkbox.d.ts +14 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/components/Checkbox/CheckboxBase.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +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/MessagesIcon.d.ts +3 -0
- package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
- package/dist/components/Icons/iconTypes.d.ts +1 -0
- package/dist/components/Icons/iconTypes.d.ts.map +1 -1
- package/dist/components/Icons/index.d.ts +1 -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/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/features/AuthCard/ForgotPasswordEmailForm.js +4 -3
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
- package/dist/features/AuthCard/PasswordInput.js +78 -9
- package/dist/features/AuthCard/SignInForm.js +8 -7
- package/dist/features/AuthCard/SignUpForm.js +8 -7
- package/dist/features/AuthCard.js +2 -2
- package/dist/features/LabelingTools.js +7 -6
- package/dist/features/SensorMetadata.js +3 -2
- package/dist/features/SettingsPopover.js +3 -2
- 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 +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/linear-cursor-small.png +0 -0
- package/dist/list.yml.webp +0 -0
- 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 +196 -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/package.json +13 -8
- 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/Input.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { usePasswordVisibility as
|
|
3
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { usePasswordVisibility as q, usePrefixWidth as tt, useClearOnFocus as et } from "./Input/InputUtils.js";
|
|
5
5
|
import "./Icons/AnnotationsIcon.js";
|
|
6
6
|
import "./Icons/CalendarIcon.js";
|
|
7
|
-
import { CheckCircleIcon as
|
|
7
|
+
import { CheckCircleIcon as rt } from "./Icons/CheckCircleIcon.js";
|
|
8
8
|
import "./Icons/CheckSquareIcon.js";
|
|
9
9
|
import "./Icons/CheckmarkIcon.js";
|
|
10
10
|
import "./Icons/ChevronDownIcon.js";
|
|
11
11
|
import "./Icons/ChevronUpIcon.js";
|
|
12
12
|
import "./Icons/ClockIcon.js";
|
|
13
|
-
import { CloseCircleIcon as
|
|
13
|
+
import { CloseCircleIcon as ot } from "./Icons/CloseCircleIcon.js";
|
|
14
14
|
import "./Icons/CloseIcon.js";
|
|
15
15
|
import "./Icons/DashboardIcon.js";
|
|
16
16
|
import "./Icons/DeleteIcon.js";
|
|
17
17
|
import "./Icons/DurationIcon.js";
|
|
18
18
|
import "./Icons/EmailIcon.js";
|
|
19
19
|
import "./Icons/EraserIcon.js";
|
|
20
|
-
import { ErrorIcon as
|
|
21
|
-
import { EyeClosedIcon as
|
|
20
|
+
import { ErrorIcon as it } from "./Icons/ErrorIcon.js";
|
|
21
|
+
import { EyeClosedIcon as st } from "./Icons/EyeClosedIcon.js";
|
|
22
22
|
import "./Icons/EyeClosedIcon2.js";
|
|
23
|
-
import { EyeOpenIcon as
|
|
23
|
+
import { EyeOpenIcon as at } from "./Icons/EyeOpenIcon.js";
|
|
24
24
|
import "./Icons/GoToFirstIcon.js";
|
|
25
25
|
import "./Icons/GoToLastIcon.js";
|
|
26
26
|
import "./Icons/HarmonicCursorsIcon.js";
|
|
@@ -29,9 +29,10 @@ import "./Icons/LabelIcon.js";
|
|
|
29
29
|
import "./Icons/LassoIcon.js";
|
|
30
30
|
import "./Icons/LineToolIcon.js";
|
|
31
31
|
import "./Icons/LiveViewIcon.js";
|
|
32
|
-
import { LoaderIcon as
|
|
32
|
+
import { LoaderIcon as nt } from "./Icons/LoaderIcon.js";
|
|
33
33
|
import "./Icons/LocationIcon.js";
|
|
34
34
|
import "./Icons/LogoutIcon.js";
|
|
35
|
+
import "./Icons/MessagesIcon.js";
|
|
35
36
|
import "./Icons/MetadataIcon.js";
|
|
36
37
|
import "./Icons/MinusIcon.js";
|
|
37
38
|
import "./Icons/OntologyIcon.js";
|
|
@@ -49,11 +50,11 @@ import "./Icons/WarningIcon.js";
|
|
|
49
50
|
import "./Icons/ZoomAllIcon.js";
|
|
50
51
|
import "./Icons/ZoomXIcon.js";
|
|
51
52
|
import "./Icons/ZoomYIcon.js";
|
|
52
|
-
import { Label as
|
|
53
|
-
import { useFormFieldId as
|
|
54
|
-
import {
|
|
55
|
-
import { forwardRef as
|
|
56
|
-
const
|
|
53
|
+
import { Label as pt } from "./Label.js";
|
|
54
|
+
import { useFormFieldId as lt, getAriaProps as ct, getInputClasses as mt, useFormFieldState as dt, getFormFieldCSSProperties as ut, ErrorMessage as ft } from "./utils/formFieldUtils.js";
|
|
55
|
+
import { cn as f } from "./utils/twUtils.js";
|
|
56
|
+
import { forwardRef as ht, useRef as bt, useCallback as c } from "react";
|
|
57
|
+
const xt = (m) => ({
|
|
57
58
|
email: "email",
|
|
58
59
|
password: "current-password",
|
|
59
60
|
tel: "tel",
|
|
@@ -62,133 +63,141 @@ const bt = (l) => ({
|
|
|
62
63
|
number: "off",
|
|
63
64
|
date: "off",
|
|
64
65
|
"datetime-local": "off"
|
|
65
|
-
})[
|
|
66
|
+
})[m] || "off", gt = ht(
|
|
66
67
|
({
|
|
67
|
-
className:
|
|
68
|
-
clearOnFocus:
|
|
68
|
+
className: m,
|
|
69
|
+
clearOnFocus: h = !1,
|
|
69
70
|
disabled: k,
|
|
70
|
-
errorMessage:
|
|
71
|
+
errorMessage: b,
|
|
71
72
|
id: P,
|
|
72
|
-
label:
|
|
73
|
-
name:
|
|
74
|
-
onBlur:
|
|
75
|
-
|
|
73
|
+
label: r,
|
|
74
|
+
name: x,
|
|
75
|
+
onBlur: g,
|
|
76
|
+
onValueChange: a,
|
|
76
77
|
onFocus: C,
|
|
77
78
|
placeholder: R,
|
|
78
|
-
prefix:
|
|
79
|
+
prefix: n,
|
|
79
80
|
showClearButton: S = !1,
|
|
80
81
|
suppressHydrationWarning: $ = !0,
|
|
81
|
-
state:
|
|
82
|
-
type:
|
|
83
|
-
value:
|
|
84
|
-
required:
|
|
85
|
-
startIcon:
|
|
82
|
+
state: o = "default",
|
|
83
|
+
type: p = "text",
|
|
84
|
+
value: v = "",
|
|
85
|
+
required: w,
|
|
86
|
+
startIcon: y,
|
|
86
87
|
endIcon: I,
|
|
87
|
-
"aria-label":
|
|
88
|
-
"aria-describedby":
|
|
89
|
-
...
|
|
90
|
-
},
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
"aria-label": L,
|
|
89
|
+
"aria-describedby": M,
|
|
90
|
+
...O
|
|
91
|
+
}, j) => {
|
|
92
|
+
const l = lt(P, x), N = `${l}-error`, { isDisabled: F, isLoading: A, isInvalid: B } = dt(k, o), H = ct(o, w, N, M), W = bt(null), i = j || W, { isVisible: d, toggleVisibility: D, inputType: T } = q(), { prefixWidth: V, prefixRef: G } = tt(n), { handleFocus: E } = et(
|
|
93
|
+
h,
|
|
94
|
+
a ? (e) => a(e.target.value) : void 0
|
|
95
|
+
), J = c(
|
|
96
|
+
(e) => {
|
|
97
|
+
g?.(e);
|
|
94
98
|
},
|
|
95
|
-
[
|
|
96
|
-
), K =
|
|
97
|
-
(
|
|
98
|
-
E(
|
|
99
|
+
[g]
|
|
100
|
+
), K = c(
|
|
101
|
+
(e) => {
|
|
102
|
+
E(e, C);
|
|
99
103
|
},
|
|
100
104
|
[E, C]
|
|
101
|
-
), Q =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
), Q = c(
|
|
106
|
+
(e) => {
|
|
107
|
+
a?.(e.target.value);
|
|
108
|
+
},
|
|
109
|
+
[a]
|
|
110
|
+
), U = c(() => {
|
|
111
|
+
i.current && (i.current.value = "", i.current.dispatchEvent(new Event("input", { bubbles: !0 })), i.current.focus());
|
|
112
|
+
}, [i]), z = S && v.length > 0, X = () => {
|
|
113
|
+
const e = "absolute right-4 top-1/2 -translate-y-1/2 text-input-icon hover:text-input-icon--hover focus:outline-none cursor-pointer", s = {
|
|
105
114
|
password: () => /* @__PURE__ */ t(
|
|
106
115
|
"button",
|
|
107
116
|
{
|
|
108
|
-
className:
|
|
117
|
+
className: e,
|
|
109
118
|
type: "button",
|
|
110
|
-
onClick:
|
|
111
|
-
"aria-label":
|
|
112
|
-
"aria-pressed":
|
|
113
|
-
"aria-controls":
|
|
119
|
+
onClick: D,
|
|
120
|
+
"aria-label": d ? `Hide ${r}` : `Show ${r}`,
|
|
121
|
+
"aria-pressed": d,
|
|
122
|
+
"aria-controls": l,
|
|
114
123
|
"data-testid": "input-password-toggle",
|
|
115
|
-
children:
|
|
124
|
+
children: d ? /* @__PURE__ */ t(st, { size: 22 }) : /* @__PURE__ */ t(at, { size: 22 })
|
|
116
125
|
}
|
|
117
126
|
),
|
|
118
127
|
clear: () => /* @__PURE__ */ t(
|
|
119
128
|
"button",
|
|
120
129
|
{
|
|
121
|
-
className:
|
|
130
|
+
className: e,
|
|
122
131
|
type: "button",
|
|
123
|
-
onClick:
|
|
124
|
-
"aria-label": `Clear ${
|
|
132
|
+
onClick: U,
|
|
133
|
+
"aria-label": `Clear ${r}`,
|
|
125
134
|
"data-testid": "input-clear-button",
|
|
126
|
-
children: /* @__PURE__ */ t(
|
|
135
|
+
children: /* @__PURE__ */ t(ot, { size: 24 })
|
|
127
136
|
}
|
|
128
137
|
),
|
|
129
|
-
loading: () => /* @__PURE__ */ t("div", { className: "absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-loading-icon", children: /* @__PURE__ */ t(
|
|
130
|
-
error: () => /* @__PURE__ */ t("div", { className: "text-danger-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-error-icon", children: /* @__PURE__ */ t(
|
|
131
|
-
success: () => /* @__PURE__ */ t("div", { className: "text-success-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-success-icon", children: /* @__PURE__ */ t(
|
|
138
|
+
loading: () => /* @__PURE__ */ t("div", { className: "absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-loading-icon", children: /* @__PURE__ */ t(nt, { size: 24 }) }),
|
|
139
|
+
error: () => /* @__PURE__ */ t("div", { className: "text-danger-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-error-icon", children: /* @__PURE__ */ t(it, { size: 24 }) }),
|
|
140
|
+
success: () => /* @__PURE__ */ t("div", { className: "text-success-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "input-success-icon", children: /* @__PURE__ */ t(rt, { size: 24 }) })
|
|
132
141
|
};
|
|
133
|
-
return I || (
|
|
134
|
-
},
|
|
135
|
-
|
|
142
|
+
return I || (p === "password" ? s.password() : z ? s.clear() : A ? s.loading() : o === "success" ? s.success() : o === "error" ? s.error() : null);
|
|
143
|
+
}, Y = () => y || null, Z = f(
|
|
144
|
+
mt(o, m),
|
|
136
145
|
"[text-indent:var(--prefix-width)]",
|
|
137
146
|
z && "pr-10"
|
|
138
|
-
),
|
|
147
|
+
), _ = f(
|
|
139
148
|
"pointer-events-none absolute inset-y-0 left-4 flex items-center text-base text-input-text-prefix opacity-100 peer-disabled:opacity-50"
|
|
140
149
|
);
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
return /* @__PURE__ */ u("div", { className: "w-full space-y-1.5", "data-testid": "input-root", children: [
|
|
151
|
+
r && /* @__PURE__ */ t(
|
|
152
|
+
pt,
|
|
144
153
|
{
|
|
145
|
-
htmlFor:
|
|
146
|
-
className:
|
|
154
|
+
htmlFor: l,
|
|
155
|
+
className: f(
|
|
147
156
|
"mb-2 block",
|
|
148
157
|
F && "text-input-text--disabled placeholder:text-input-text-placeholder cursor-not-allowed"
|
|
149
158
|
),
|
|
150
|
-
children:
|
|
159
|
+
children: r
|
|
151
160
|
}
|
|
152
161
|
),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
162
|
+
/* @__PURE__ */ u("div", { className: "relative", "data-testid": "input-wrapper", children: [
|
|
163
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
164
|
+
Y(),
|
|
165
|
+
n && /* @__PURE__ */ t("span", { ref: G, className: _, children: n }),
|
|
157
166
|
/* @__PURE__ */ t(
|
|
158
167
|
"input",
|
|
159
168
|
{
|
|
160
|
-
id:
|
|
161
|
-
name:
|
|
162
|
-
ref:
|
|
163
|
-
type:
|
|
164
|
-
value:
|
|
169
|
+
id: l,
|
|
170
|
+
name: x,
|
|
171
|
+
ref: i,
|
|
172
|
+
type: p === "password" ? T : p,
|
|
173
|
+
value: v,
|
|
165
174
|
disabled: F,
|
|
166
|
-
required:
|
|
167
|
-
autoComplete:
|
|
168
|
-
className:
|
|
169
|
-
onChange:
|
|
175
|
+
required: w,
|
|
176
|
+
autoComplete: xt(p),
|
|
177
|
+
className: Z,
|
|
178
|
+
onChange: Q,
|
|
170
179
|
onFocus: K,
|
|
171
180
|
onBlur: J,
|
|
172
|
-
placeholder: R ||
|
|
181
|
+
placeholder: R || r,
|
|
173
182
|
suppressHydrationWarning: $,
|
|
174
|
-
...
|
|
175
|
-
...
|
|
183
|
+
...H,
|
|
184
|
+
...O,
|
|
176
185
|
"data-testid": "input-input",
|
|
177
|
-
"data-state":
|
|
178
|
-
style:
|
|
179
|
-
"--prefix-width":
|
|
186
|
+
"data-state": o,
|
|
187
|
+
style: ut({
|
|
188
|
+
"--prefix-width": n ? `${V}px` : "0px"
|
|
180
189
|
}),
|
|
181
|
-
"aria-label":
|
|
190
|
+
"aria-label": L || r
|
|
182
191
|
}
|
|
183
192
|
),
|
|
184
|
-
|
|
193
|
+
X()
|
|
185
194
|
] }),
|
|
186
|
-
|
|
195
|
+
B && b && /* @__PURE__ */ t(ft, { id: N, message: b })
|
|
187
196
|
] })
|
|
188
197
|
] });
|
|
189
198
|
}
|
|
190
199
|
);
|
|
191
|
-
|
|
200
|
+
gt.displayName = "Input";
|
|
192
201
|
export {
|
|
193
|
-
|
|
202
|
+
gt as Input
|
|
194
203
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Button } from '../../primitives/button';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
export declare const InputGroup: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
+
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export declare const InputGroupAddon: ({ className, align, ...props }: ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
export declare const InputGroupButton: ({ className, type, variant, size, ...props }: Omit<ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const InputGroupText: ({ className, ...props }: ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const InputGroupInput: ({ className, ...props }: ComponentProps<"input">) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const InputGroupTextarea: ({ className, ...props }: ComponentProps<"textarea">) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=InputGroup.d.ts.map
|
|
@@ -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;
|