@spear-ai/spectral 1.6.17 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.js +201 -200
- package/dist/Accordion.d.ts +13 -15
- package/dist/Accordion.js +184 -179
- package/dist/Alert/AlertBase.d.ts +7 -7
- package/dist/Alert/AlertBase.js +21 -21
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +31 -31
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +30 -22
- package/dist/Badge.d.ts +1 -1
- package/dist/Badge.js +3 -2
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +108 -46
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
- package/dist/ButtonGroup.d.ts +5 -5
- package/dist/ButtonGroup.js +21 -21
- package/dist/ButtonIcon.d.ts +2 -2
- package/dist/ButtonIcon.js +30 -31
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +50 -57
- package/dist/Checkbox.js +15 -19
- package/dist/DataCard/Card.d.ts +1 -1
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.d.ts +4 -4
- package/dist/DateTimePicker/Calendar.js +3 -3
- package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
- package/dist/DateTimePicker/DateTimeInput.js +4 -4
- package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
- package/dist/DateTimePicker/DateTimeUtils.js +139 -197
- package/dist/DateTimePicker/TimePicker.d.ts +4 -4
- package/dist/DateTimePicker/TimePicker.js +3 -3
- package/dist/DateTimePicker.d.ts +5 -5
- package/dist/DateTimePicker.js +90 -70
- package/dist/Dialog.d.ts +13 -13
- package/dist/Dialog.js +57 -84
- package/dist/Drawer.d.ts +2 -2
- package/dist/Drawer.js +8 -8
- package/dist/HoverCard.d.ts +6 -5
- package/dist/HoverCard.js +64 -64
- package/dist/Icons/PolygonIcon.d.ts +5 -0
- package/dist/Icons/PolygonIcon.js +40 -0
- package/dist/Icons/index.d.ts +1 -1
- package/dist/Icons.js +34 -34
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/Input/InputUtils.d.ts +2 -2
- package/dist/Input/InputUtils.js +4 -4
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +19 -19
- package/dist/InputOTP.d.ts +10 -10
- package/dist/InputOTP.js +114 -114
- package/dist/Kbd.d.ts +8 -5
- package/dist/Kbd.js +85 -20
- package/dist/Label.d.ts +4 -2
- package/dist/Label.js +3 -3
- package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +278 -202
- package/dist/MultiSelect.d.ts +6 -6
- package/dist/MultiSelect.js +9 -9
- package/dist/Popover.js +22 -237
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioGroup.d.ts +15 -15
- package/dist/RadioGroup.js +253 -236
- package/dist/Select.d.ts +3 -1
- package/dist/Select.js +91 -88
- package/dist/Separator.js +4 -4
- package/dist/Skeleton.d.ts +1 -2
- package/dist/Skeleton.js +2 -4
- package/dist/Slider.d.ts +6 -6
- package/dist/Slider.js +78 -78
- package/dist/Switch/SwitchBase.d.ts +4 -4
- package/dist/Switch/SwitchBase.js +75 -111
- package/dist/Switch.d.ts +4 -4
- package/dist/Switch.js +122 -33
- package/dist/Tabs/TabsBase.js +39 -38
- package/dist/Tabs/tabsUtils.js +7 -7
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.js +62 -66
- package/dist/Textarea/TextareaUtils.d.ts +7 -7
- package/dist/Textarea/TextareaUtils.js +13 -13
- package/dist/Textarea.js +28 -18
- package/dist/Toast.d.ts +43 -0
- package/dist/Toast.js +883 -0
- package/dist/Toggle/ToggleBase.d.ts +4 -4
- package/dist/Toggle/ToggleBase.js +32 -33
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +7 -12
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
- package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +27 -30
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +97 -97
- package/dist/Tray.d.ts +9 -9
- package/dist/Tray.js +71 -70
- package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
- package/dist/hooks/useAccordionAutoScroll.js +42 -39
- package/dist/hooks/useControllableState.d.ts +2 -2
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +2 -2
- package/dist/index-C12FUuIW.js +13 -0
- package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
- package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
- package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
- package/dist/index-DEYs15GP.js +66 -0
- package/dist/index-DdFoGvON.js +146 -0
- package/dist/index-Q3N6lgwg.js +225 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +4 -4
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +8 -5
- package/dist/primitives/select.d.ts +12 -13
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +59 -88
- package/dist/primitives/slot.d.ts +5 -5
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +24 -33
- package/dist/primitives/textarea.d.ts.map +1 -1
- package/dist/primitives/textarea.js +4 -3
- package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
- package/dist/styles/base-colors.css +30 -30
- package/dist/styles/horizon/base-colors.css +30 -30
- package/dist/styles/horizon/colors.css +43 -13
- package/dist/styles/horizon/utilities.css +26 -3
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +2 -2
- package/dist/styles/theme.css +99 -46
- package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
- package/dist/utils/formFieldUtils.d.ts +2 -2
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +14 -11
- package/dist/utils/sharedUtils.d.ts +3 -3
- package/dist/utils/sharedUtils.d.ts.map +1 -1
- package/dist/utils/sharedUtils.js +1 -4
- package/dist/utils/twUtils.d.ts +1 -1
- package/dist/utils/twUtils.d.ts.map +1 -1
- package/dist/utils/twUtils.js +1 -4
- package/package.json +6 -1
- package/dist/Icons/LineToolIcon2.d.ts +0 -5
- package/dist/Icons/LineToolIcon2.js +0 -49
- package/dist/createLucideIcon-D4r5Phnh.js +0 -70
- package/dist/index-CeP1E2kK.js +0 -209
- package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/InputOTP.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormFieldState } from './utils/formFieldUtils';
|
|
2
2
|
import { OTPInput, OTPInputProps } from 'input-otp';
|
|
3
3
|
import { ComponentPropsWithoutRef, ComponentRef, Ref } from 'react';
|
|
4
|
-
|
|
4
|
+
export interface InputOTPBaseProps extends Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerStrategy' | 'pasteTransformer' | 'noScriptCSSFallback' | 'placeholder' | 'containerClassName' | 'render' | 'pattern'> {
|
|
5
5
|
onComplete?: (...args: unknown[]) => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
errorMessage?: string | undefined;
|
|
@@ -15,21 +15,21 @@ type InputOTPRootProps = Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerS
|
|
|
15
15
|
separator?: boolean;
|
|
16
16
|
state?: FormFieldState;
|
|
17
17
|
variant?: 'outlined' | 'filled';
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
type InputOTPProps = InputOTPBaseProps & ({
|
|
20
20
|
value: number | string;
|
|
21
21
|
onChange: (newValue: number | string) => void;
|
|
22
22
|
} | {
|
|
23
23
|
value?: never;
|
|
24
24
|
onChange?: never;
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
start?: number;
|
|
28
|
-
count?: number;
|
|
26
|
+
interface SlotsProps {
|
|
29
27
|
className?: string;
|
|
30
|
-
|
|
28
|
+
count?: number;
|
|
29
|
+
start?: number;
|
|
30
|
+
}
|
|
31
31
|
export declare const InputOTP: {
|
|
32
|
-
({
|
|
32
|
+
({ autoFocus, children, className, errorMessage, id, inputMode, maxLength, name, onChange, onComplete, pattern, ref, state, value, variant, ...props }: InputOTPProps & {
|
|
33
33
|
ref?: Ref<ComponentRef<typeof OTPInput>>;
|
|
34
34
|
}): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
displayName: string;
|
|
@@ -41,9 +41,9 @@ export declare const InputOTP: {
|
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
Slot: {
|
|
44
|
-
({
|
|
45
|
-
ref?: Ref<ComponentRef<"div">>;
|
|
44
|
+
({ className, index, ref, ...props }: ComponentPropsWithoutRef<"div"> & {
|
|
46
45
|
index: number;
|
|
46
|
+
ref?: Ref<ComponentRef<"div">>;
|
|
47
47
|
}): import("react/jsx-runtime").JSX.Element;
|
|
48
48
|
displayName: string;
|
|
49
49
|
};
|
package/dist/InputOTP.js
CHANGED
|
@@ -34,7 +34,6 @@ import "./Icons/KeyboardIcon.js";
|
|
|
34
34
|
import "./Icons/LabelIcon.js";
|
|
35
35
|
import "./Icons/LassoIcon.js";
|
|
36
36
|
import "./Icons/LineToolIcon.js";
|
|
37
|
-
import "./Icons/LineToolIcon2.js";
|
|
38
37
|
import "./Icons/LiveViewIcon.js";
|
|
39
38
|
import "./Icons/LoaderIcon.js";
|
|
40
39
|
import "./Icons/LocationIcon.js";
|
|
@@ -48,6 +47,7 @@ import "./Icons/PanelIconClose.js";
|
|
|
48
47
|
import "./Icons/PanelIconOpen.js";
|
|
49
48
|
import "./Icons/PlayIcon.js";
|
|
50
49
|
import "./Icons/PlusIcon.js";
|
|
50
|
+
import "./Icons/PolygonIcon.js";
|
|
51
51
|
import "./Icons/ResetIcon.js";
|
|
52
52
|
import "./Icons/ReviewedIcon.js";
|
|
53
53
|
import "./Icons/ScissorsIcon.js";
|
|
@@ -77,13 +77,13 @@ var Vt = Object.defineProperty, qt = Object.defineProperties, Kt = Object.getOwn
|
|
|
77
77
|
return t;
|
|
78
78
|
}, Jt = (t, e) => qt(t, Kt(e)), Qt = (t, e) => {
|
|
79
79
|
var o = {};
|
|
80
|
-
for (var
|
|
81
|
-
if (t != null && X) for (var
|
|
80
|
+
for (var l in t) Pt.call(t, l) && e.indexOf(l) < 0 && (o[l] = t[l]);
|
|
81
|
+
if (t != null && X) for (var l of X(t)) e.indexOf(l) < 0 && xt.call(t, l) && (o[l] = t[l]);
|
|
82
82
|
return o;
|
|
83
83
|
};
|
|
84
84
|
function Ut(t) {
|
|
85
|
-
let e = setTimeout(t, 0), o = setTimeout(t, 10),
|
|
86
|
-
return [e, o,
|
|
85
|
+
let e = setTimeout(t, 0), o = setTimeout(t, 10), l = setTimeout(t, 50);
|
|
86
|
+
return [e, o, l];
|
|
87
87
|
}
|
|
88
88
|
function Xt(t) {
|
|
89
89
|
let e = n.useRef();
|
|
@@ -92,77 +92,77 @@ function Xt(t) {
|
|
|
92
92
|
}), e.current;
|
|
93
93
|
}
|
|
94
94
|
var Yt = 18, Et = 40, te = `${Et}px`, ee = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
95
|
-
function re({ containerRef: t, inputRef: e, pushPasswordManagerStrategy: o, isFocused:
|
|
96
|
-
let [
|
|
97
|
-
let g = t.current,
|
|
98
|
-
if (!g || !
|
|
99
|
-
let h = g, P = h.getBoundingClientRect().left + h.offsetWidth,
|
|
100
|
-
document.querySelectorAll(ee).length === 0 && document.elementFromPoint(
|
|
101
|
-
}, [t, e,
|
|
95
|
+
function re({ containerRef: t, inputRef: e, pushPasswordManagerStrategy: o, isFocused: l }) {
|
|
96
|
+
let [v, i] = n.useState(!1), [d, m] = n.useState(!1), [E, D] = n.useState(!1), j = n.useMemo(() => o === "none" ? !1 : (o === "increase-width" || o === "experimental-no-flickering") && v && d, [v, d, o]), I = n.useCallback(() => {
|
|
97
|
+
let g = t.current, C = e.current;
|
|
98
|
+
if (!g || !C || E || o === "none") return;
|
|
99
|
+
let h = g, P = h.getBoundingClientRect().left + h.offsetWidth, T = h.getBoundingClientRect().top + h.offsetHeight / 2, s = P - Yt, F = T;
|
|
100
|
+
document.querySelectorAll(ee).length === 0 && document.elementFromPoint(s, F) === g || (i(!0), D(!0));
|
|
101
|
+
}, [t, e, E, o]);
|
|
102
102
|
return n.useEffect(() => {
|
|
103
103
|
let g = t.current;
|
|
104
104
|
if (!g || o === "none") return;
|
|
105
|
-
function
|
|
105
|
+
function C() {
|
|
106
106
|
let P = window.innerWidth - g.getBoundingClientRect().right;
|
|
107
107
|
m(P >= Et);
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
let h = setInterval(
|
|
109
|
+
C();
|
|
110
|
+
let h = setInterval(C, 1e3);
|
|
111
111
|
return () => {
|
|
112
112
|
clearInterval(h);
|
|
113
113
|
};
|
|
114
114
|
}, [t, o]), n.useEffect(() => {
|
|
115
|
-
let g =
|
|
115
|
+
let g = l || document.activeElement === e.current;
|
|
116
116
|
if (o === "none" || !g) return;
|
|
117
|
-
let
|
|
118
|
-
|
|
117
|
+
let C = setTimeout(I, 0), h = setTimeout(I, 2e3), P = setTimeout(I, 5e3), T = setTimeout(() => {
|
|
118
|
+
D(!0);
|
|
119
119
|
}, 6e3);
|
|
120
120
|
return () => {
|
|
121
|
-
clearTimeout(
|
|
121
|
+
clearTimeout(C), clearTimeout(h), clearTimeout(P), clearTimeout(T);
|
|
122
122
|
};
|
|
123
|
-
}, [e,
|
|
123
|
+
}, [e, l, o, I]), { hasPWMBadge: v, willPushPWMBadge: j, PWM_BADGE_SPACE_WIDTH: te };
|
|
124
124
|
}
|
|
125
125
|
var ne = n.createContext({}), Ct = n.forwardRef((t, e) => {
|
|
126
|
-
var o = t, { value:
|
|
127
|
-
let [Ot, Rt] = n.useState(typeof
|
|
128
|
-
|
|
129
|
-
}, [
|
|
126
|
+
var o = t, { value: l, onChange: v, maxLength: i, textAlign: d = "left", pattern: m, placeholder: E, inputMode: D = "numeric", onComplete: j, pushPasswordManagerStrategy: I = "increase-width", pasteTransformer: g, containerClassName: C, noScriptCSSFallback: h = oe, render: P, children: T } = o, s = Qt(o, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), F, J, O, W, st;
|
|
127
|
+
let [Ot, Rt] = n.useState(typeof s.defaultValue == "string" ? s.defaultValue : ""), p = l ?? Ot, B = Xt(p), z = n.useCallback((r) => {
|
|
128
|
+
v?.(r), Rt(r);
|
|
129
|
+
}, [v]), M = n.useMemo(() => m ? typeof m == "string" ? new RegExp(m) : m : null, [m]), c = n.useRef(null), Y = n.useRef(null), tt = n.useRef({ value: p, onChange: z, isIOS: typeof window < "u" && ((J = (F = window?.CSS) == null ? void 0 : F.supports) == null ? void 0 : J.call(F, "-webkit-touch-callout", "none")) }), Q = n.useRef({ prev: [(O = c.current) == null ? void 0 : O.selectionStart, (W = c.current) == null ? void 0 : W.selectionEnd, (st = c.current) == null ? void 0 : st.selectionDirection] });
|
|
130
130
|
n.useImperativeHandle(e, () => c.current, []), n.useEffect(() => {
|
|
131
131
|
let r = c.current, a = Y.current;
|
|
132
132
|
if (!r || !a) return;
|
|
133
133
|
tt.current.value !== r.value && tt.current.onChange(r.value), Q.current.prev = [r.selectionStart, r.selectionEnd, r.selectionDirection];
|
|
134
|
-
function
|
|
134
|
+
function f() {
|
|
135
135
|
if (document.activeElement !== r) {
|
|
136
136
|
q(null), K(null);
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
let
|
|
140
|
-
if (_.length !== 0 &&
|
|
141
|
-
let Wt =
|
|
139
|
+
let u = r.selectionStart, b = r.selectionEnd, U = r.selectionDirection, x = r.maxLength, _ = r.value, k = Q.current.prev, R = -1, A = -1, H;
|
|
140
|
+
if (_.length !== 0 && u !== null && b !== null) {
|
|
141
|
+
let Wt = u === b, Bt = u === _.length && _.length < x;
|
|
142
142
|
if (Wt && !Bt) {
|
|
143
|
-
let G =
|
|
144
|
-
if (G === 0)
|
|
145
|
-
else if (G === x)
|
|
143
|
+
let G = u;
|
|
144
|
+
if (G === 0) R = 0, A = 1, H = "forward";
|
|
145
|
+
else if (G === x) R = G - 1, A = G, H = "backward";
|
|
146
146
|
else if (x > 1 && _.length > 1) {
|
|
147
147
|
let nt = 0;
|
|
148
|
-
if (
|
|
149
|
-
H = G <
|
|
150
|
-
let Nt =
|
|
148
|
+
if (k[0] !== null && k[1] !== null) {
|
|
149
|
+
H = G < k[1] ? "backward" : "forward";
|
|
150
|
+
let Nt = k[0] === k[1] && k[0] < x;
|
|
151
151
|
H === "backward" && !Nt && (nt = -1);
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
R = nt + G, A = nt + G + 1;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
R !== -1 && A !== -1 && R !== A && c.current.setSelectionRange(R, A, H);
|
|
157
157
|
}
|
|
158
|
-
let vt =
|
|
158
|
+
let vt = R !== -1 ? R : u, gt = A !== -1 ? A : b, Ft = H ?? U;
|
|
159
159
|
q(vt), K(gt), Q.current.prev = [vt, gt, Ft];
|
|
160
160
|
}
|
|
161
|
-
if (document.addEventListener("selectionchange",
|
|
162
|
-
let
|
|
163
|
-
if (
|
|
161
|
+
if (document.addEventListener("selectionchange", f, { capture: !0 }), f(), document.activeElement === r && et(!0), !document.getElementById("input-otp-style")) {
|
|
162
|
+
let u = document.createElement("style");
|
|
163
|
+
if (u.id = "input-otp-style", document.head.appendChild(u), u.sheet) {
|
|
164
164
|
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;";
|
|
165
|
-
Z(
|
|
165
|
+
Z(u.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Z(u.sheet, `[data-input-otp]:autofill { ${b} }`), Z(u.sheet, `[data-input-otp]:-webkit-autofill { ${b} }`), Z(u.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; } }"), Z(u.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
let S = () => {
|
|
@@ -171,66 +171,66 @@ var ne = n.createContext({}), Ct = n.forwardRef((t, e) => {
|
|
|
171
171
|
S();
|
|
172
172
|
let y = new ResizeObserver(S);
|
|
173
173
|
return y.observe(r), () => {
|
|
174
|
-
document.removeEventListener("selectionchange",
|
|
174
|
+
document.removeEventListener("selectionchange", f, { capture: !0 }), y.disconnect();
|
|
175
175
|
};
|
|
176
176
|
}, []);
|
|
177
177
|
let [ut, pt] = n.useState(!1), [V, et] = n.useState(!1), [N, q] = n.useState(null), [L, K] = n.useState(null);
|
|
178
178
|
n.useEffect(() => {
|
|
179
179
|
Ut(() => {
|
|
180
|
-
var r, a,
|
|
180
|
+
var r, a, f, S;
|
|
181
181
|
(r = c.current) == null || r.dispatchEvent(new Event("input"));
|
|
182
|
-
let y = (a = c.current) == null ? void 0 : a.selectionStart,
|
|
183
|
-
y !== null &&
|
|
182
|
+
let y = (a = c.current) == null ? void 0 : a.selectionStart, u = (f = c.current) == null ? void 0 : f.selectionEnd, b = (S = c.current) == null ? void 0 : S.selectionDirection;
|
|
183
|
+
y !== null && u !== null && (q(y), K(u), Q.current.prev = [y, u, b]);
|
|
184
184
|
});
|
|
185
185
|
}, [p, V]), n.useEffect(() => {
|
|
186
|
-
B !== void 0 && p !== B && B.length <
|
|
187
|
-
}, [
|
|
188
|
-
let $ = re({ containerRef: Y, inputRef: c, pushPasswordManagerStrategy:
|
|
189
|
-
let a = r.currentTarget.value.slice(0,
|
|
190
|
-
if (a.length > 0 &&
|
|
186
|
+
B !== void 0 && p !== B && B.length < i && p.length === i && j?.(p);
|
|
187
|
+
}, [i, j, B, p]);
|
|
188
|
+
let $ = re({ containerRef: Y, inputRef: c, pushPasswordManagerStrategy: I, isFocused: V }), ct = n.useCallback((r) => {
|
|
189
|
+
let a = r.currentTarget.value.slice(0, i);
|
|
190
|
+
if (a.length > 0 && M && !M.test(a)) {
|
|
191
191
|
r.preventDefault();
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
typeof B == "string" && a.length < B.length && document.dispatchEvent(new Event("selectionchange")), z(a);
|
|
195
|
-
}, [
|
|
195
|
+
}, [i, z, B, M]), dt = n.useCallback(() => {
|
|
196
196
|
var r;
|
|
197
197
|
if (c.current) {
|
|
198
|
-
let a = Math.min(c.current.value.length,
|
|
199
|
-
(r = c.current) == null || r.setSelectionRange(a,
|
|
198
|
+
let a = Math.min(c.current.value.length, i - 1), f = c.current.value.length;
|
|
199
|
+
(r = c.current) == null || r.setSelectionRange(a, f), q(a), K(f);
|
|
200
200
|
}
|
|
201
201
|
et(!0);
|
|
202
|
-
}, [
|
|
203
|
-
var a,
|
|
202
|
+
}, [i]), mt = n.useCallback((r) => {
|
|
203
|
+
var a, f;
|
|
204
204
|
let S = c.current;
|
|
205
205
|
if (!g && (!tt.current.isIOS || !r.clipboardData || !S)) return;
|
|
206
|
-
let y = r.clipboardData.getData("text/plain"),
|
|
206
|
+
let y = r.clipboardData.getData("text/plain"), u = g ? g(y) : y;
|
|
207
207
|
r.preventDefault();
|
|
208
|
-
let b = (a = c.current) == null ? void 0 : a.selectionStart, U = (
|
|
209
|
-
if (x.length > 0 &&
|
|
208
|
+
let b = (a = c.current) == null ? void 0 : a.selectionStart, U = (f = c.current) == null ? void 0 : f.selectionEnd, x = (b !== U ? p.slice(0, b) + u + p.slice(U) : p.slice(0, b) + u + p.slice(b)).slice(0, i);
|
|
209
|
+
if (x.length > 0 && M && !M.test(x)) return;
|
|
210
210
|
S.value = x, z(x);
|
|
211
|
-
let _ = Math.min(x.length,
|
|
212
|
-
S.setSelectionRange(_,
|
|
213
|
-
}, [
|
|
211
|
+
let _ = Math.min(x.length, i - 1), k = x.length;
|
|
212
|
+
S.setSelectionRange(_, k), q(_), K(k);
|
|
213
|
+
}, [i, z, M, p]), At = n.useMemo(() => ({ position: "relative", cursor: s.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [s.disabled]), ft = n.useMemo(() => ({ position: "absolute", inset: 0, width: $.willPushPWMBadge ? `calc(100% + ${$.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: $.willPushPWMBadge ? `inset(0 ${$.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: d, 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" }), [$.PWM_BADGE_SPACE_WIDTH, $.willPushPWMBadge, d]), Dt = n.useMemo(() => n.createElement("input", Jt(Zt({ autoComplete: s.autoComplete || "one-time-code" }, s), { "data-input-otp": !0, "data-input-otp-placeholder-shown": p.length === 0 || void 0, "data-input-otp-mss": N, "data-input-otp-mse": L, inputMode: D, pattern: M?.source, "aria-placeholder": E, style: ft, maxLength: i, value: p, ref: c, onPaste: (r) => {
|
|
214
214
|
var a;
|
|
215
|
-
mt(r), (a =
|
|
215
|
+
mt(r), (a = s.onPaste) == null || a.call(s, r);
|
|
216
216
|
}, onChange: ct, onMouseOver: (r) => {
|
|
217
217
|
var a;
|
|
218
|
-
pt(!0), (a =
|
|
218
|
+
pt(!0), (a = s.onMouseOver) == null || a.call(s, r);
|
|
219
219
|
}, onMouseLeave: (r) => {
|
|
220
220
|
var a;
|
|
221
|
-
pt(!1), (a =
|
|
221
|
+
pt(!1), (a = s.onMouseLeave) == null || a.call(s, r);
|
|
222
222
|
}, onFocus: (r) => {
|
|
223
223
|
var a;
|
|
224
|
-
dt(), (a =
|
|
224
|
+
dt(), (a = s.onFocus) == null || a.call(s, r);
|
|
225
225
|
}, onBlur: (r) => {
|
|
226
226
|
var a;
|
|
227
|
-
et(!1), (a =
|
|
228
|
-
} })), [ct, dt, mt,
|
|
229
|
-
var
|
|
230
|
-
let S = V && N !== null && L !== null && (N === L && a === N || a >= N && a < L), y = p[a] !== void 0 ? p[a] : null,
|
|
231
|
-
return { char: y, placeholderChar:
|
|
232
|
-
}), isFocused: V, isHovering: !
|
|
233
|
-
return n.createElement(n.Fragment, null, h !== null && n.createElement("noscript", null, n.createElement("style", null, h)), n.createElement("div", { ref: Y, "data-input-otp-container": !0, style: At, className:
|
|
227
|
+
et(!1), (a = s.onBlur) == null || a.call(s, r);
|
|
228
|
+
} })), [ct, dt, mt, D, ft, i, L, N, s, M?.source, p]), rt = n.useMemo(() => ({ slots: Array.from({ length: i }).map((r, a) => {
|
|
229
|
+
var f;
|
|
230
|
+
let S = V && N !== null && L !== null && (N === L && a === N || a >= N && a < L), y = p[a] !== void 0 ? p[a] : null, u = p[0] !== void 0 ? null : (f = E?.[a]) != null ? f : null;
|
|
231
|
+
return { char: y, placeholderChar: u, isActive: S, hasFakeCaret: S && y === null };
|
|
232
|
+
}), isFocused: V, isHovering: !s.disabled && ut }), [V, ut, i, L, N, s.disabled, p]), jt = n.useMemo(() => P ? P(rt) : n.createElement(ne.Provider, { value: rt }, T), [T, rt, P]);
|
|
233
|
+
return n.createElement(n.Fragment, null, h !== null && n.createElement("noscript", null, n.createElement("style", null, h)), n.createElement("div", { ref: Y, "data-input-otp-container": !0, style: At, className: C }, jt, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
|
|
234
234
|
});
|
|
235
235
|
Ct.displayName = "Input";
|
|
236
236
|
function Z(t, e) {
|
|
@@ -266,56 +266,56 @@ const Mt = St({}), Tt = St(null), ot = () => {
|
|
|
266
266
|
throw new Error("useRoot must be used within an InputOTP");
|
|
267
267
|
return t;
|
|
268
268
|
}, kt = ({
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
269
|
+
autoFocus: t = !1,
|
|
270
|
+
children: e,
|
|
271
|
+
className: o,
|
|
272
|
+
errorMessage: l,
|
|
273
|
+
id: v,
|
|
274
|
+
inputMode: i = "numeric",
|
|
275
|
+
maxLength: d,
|
|
276
|
+
name: m,
|
|
277
|
+
onChange: E,
|
|
278
|
+
onComplete: D,
|
|
279
|
+
pattern: j,
|
|
280
|
+
ref: I,
|
|
281
281
|
state: g = "default",
|
|
282
|
-
value:
|
|
282
|
+
value: C,
|
|
283
283
|
variant: h = "outlined",
|
|
284
284
|
...P
|
|
285
285
|
}) => {
|
|
286
|
-
const
|
|
287
|
-
let W =
|
|
288
|
-
|
|
286
|
+
const T = Gt(v, m), { isInvalid: s } = Lt(!1, g), F = j ?? (i === "numeric" ? ae : void 0), J = (O) => {
|
|
287
|
+
let W = O.clipboardData.getData("text/plain").trim().replaceAll("-", "");
|
|
288
|
+
i === "numeric" && (W = W.replace(/\D/g, "")), W.length === d && typeof E == "function" && E(W);
|
|
289
289
|
};
|
|
290
|
-
return /* @__PURE__ */ w(Mt.Provider, { value: { isInvalid:
|
|
290
|
+
return /* @__PURE__ */ w(Mt.Provider, { value: { isInvalid: s }, children: /* @__PURE__ */ bt("div", { className: "flex w-max flex-col gap-y-1", children: [
|
|
291
291
|
/* @__PURE__ */ w(
|
|
292
292
|
Ct,
|
|
293
293
|
{
|
|
294
|
-
autoFocus:
|
|
295
|
-
containerClassName: wt("flex items-center gap-2 has-
|
|
294
|
+
autoFocus: t,
|
|
295
|
+
containerClassName: wt("flex items-center gap-2 has-disabled]:opacity-50 disabled:cursor-not-allowed", o),
|
|
296
296
|
"data-1p-ignore": "true",
|
|
297
297
|
"data-dashlane-disabled-on-field": "true",
|
|
298
298
|
"data-lpignore": "true",
|
|
299
299
|
"data-protonpass-ignore": "true",
|
|
300
300
|
"data-testid": "spectral-input-otp",
|
|
301
|
-
id:
|
|
302
|
-
inputMode:
|
|
303
|
-
maxLength:
|
|
304
|
-
onChange:
|
|
305
|
-
onComplete:
|
|
301
|
+
id: T,
|
|
302
|
+
inputMode: i,
|
|
303
|
+
maxLength: d,
|
|
304
|
+
onChange: E,
|
|
305
|
+
onComplete: D,
|
|
306
306
|
onPaste: J,
|
|
307
|
-
pasteTransformer: (
|
|
307
|
+
pasteTransformer: (O) => O.replaceAll("-", ""),
|
|
308
308
|
pattern: F,
|
|
309
309
|
pushPasswordManagerStrategy: "none",
|
|
310
|
-
ref:
|
|
310
|
+
ref: I,
|
|
311
311
|
role: "textbox",
|
|
312
312
|
textAlign: "center",
|
|
313
|
-
value:
|
|
313
|
+
value: C,
|
|
314
314
|
...P,
|
|
315
|
-
render: ({ slots:
|
|
315
|
+
render: ({ slots: O }) => /* @__PURE__ */ w(Tt.Provider, { value: { slots: O, variant: h, maxLength: d }, children: e ?? /* @__PURE__ */ w(at, { children: /* @__PURE__ */ w(it, {}) }) })
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
|
-
|
|
318
|
+
s && l && /* @__PURE__ */ w($t, { dataTestId: "spectral-input-otp-error-message", id: zt(T), message: l })
|
|
319
319
|
] }) });
|
|
320
320
|
};
|
|
321
321
|
kt.displayName = "InputOTP";
|
|
@@ -325,40 +325,40 @@ const at = ({
|
|
|
325
325
|
}) => /* @__PURE__ */ w("div", { className: "flex items-center justify-center gap-x-2", "data-testid": "spectral-input-otp-group", ref: t, ...e });
|
|
326
326
|
at.displayName = "InputOTP.Group";
|
|
327
327
|
const lt = ({
|
|
328
|
-
|
|
328
|
+
className: t,
|
|
329
329
|
index: e,
|
|
330
|
-
|
|
331
|
-
...
|
|
330
|
+
ref: o,
|
|
331
|
+
...l
|
|
332
332
|
}) => {
|
|
333
|
-
const { variant:
|
|
333
|
+
const { variant: v = "outlined", slots: i = [] } = ot(), { isInvalid: d } = yt(Mt), m = i[e] || { char: "", hasFakeCaret: !0, isActive: !1 };
|
|
334
334
|
return /* @__PURE__ */ bt(
|
|
335
335
|
"div",
|
|
336
336
|
{
|
|
337
337
|
className: wt(
|
|
338
|
-
"relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border
|
|
339
|
-
|
|
338
|
+
"relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border transition duration-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
339
|
+
v === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
|
|
340
340
|
!d && "border",
|
|
341
341
|
d && "border-danger-400 focus-visible:outline-danger-400 border-2",
|
|
342
342
|
m.isActive && !d && "outline-input-otp-border--focus z-10 outline-2 outline-offset-2",
|
|
343
343
|
m.isActive && d && "outline-danger-400 outline-2 outline-offset-2",
|
|
344
|
-
|
|
344
|
+
t
|
|
345
345
|
),
|
|
346
346
|
"data-index": e,
|
|
347
347
|
"data-testid": "spectral-input-otp-slot",
|
|
348
|
-
"data-variant":
|
|
349
|
-
ref:
|
|
350
|
-
...
|
|
348
|
+
"data-variant": v,
|
|
349
|
+
ref: o,
|
|
350
|
+
...l,
|
|
351
351
|
children: [
|
|
352
352
|
m.char,
|
|
353
|
-
m.hasFakeCaret && /* @__PURE__ */ w("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ w("div", { className: "bg-input-otp-caret h-8 w-px" }) })
|
|
353
|
+
m.hasFakeCaret && /* @__PURE__ */ w("div", { className: "motion-safe:animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ w("div", { className: "bg-input-otp-caret h-8 w-px" }) })
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
);
|
|
357
357
|
};
|
|
358
358
|
lt.displayName = "InputOTP.Slot";
|
|
359
359
|
const it = ({ start: t = 0, count: e, className: o }) => {
|
|
360
|
-
const { maxLength:
|
|
361
|
-
return /* @__PURE__ */ w(_t, { children:
|
|
360
|
+
const { maxLength: l = 0 } = ot(), v = e !== void 0 ? t + e : l, i = Array.from({ length: v - t }, (d, m) => t + m);
|
|
361
|
+
return /* @__PURE__ */ w(_t, { children: i.map((d) => /* @__PURE__ */ w(lt, { index: d, className: o }, d)) });
|
|
362
362
|
};
|
|
363
363
|
it.displayName = "InputOTP.Slots";
|
|
364
364
|
const It = ({
|
package/dist/Kbd.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type KbdSymbol = 'arrowLeft' | 'arrowRight' | 'arrowUp' | 'arrowDown' | 'command' | 'option' | 'shift' | 'control' | 'return' | 'delete';
|
|
3
|
+
export interface KbdProps {
|
|
3
4
|
className?: string;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
symbol?: KbdSymbol;
|
|
6
|
+
symbolPosition?: 'start' | 'end';
|
|
7
|
+
}
|
|
8
|
+
export interface KbdGroupProps {
|
|
6
9
|
className?: string;
|
|
7
|
-
}
|
|
10
|
+
}
|
|
8
11
|
export declare const Kbd: {
|
|
9
|
-
({ className, ...props }: KbdProps & ComponentProps<"kbd">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
({ className, symbol, symbolPosition, children, ...props }: KbdProps & ComponentProps<"kbd">): import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
displayName: string;
|
|
11
14
|
};
|
|
12
15
|
export declare const KbdGroup: {
|
package/dist/Kbd.js
CHANGED
|
@@ -1,23 +1,88 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
"
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { cn as d } from "./utils/twUtils.js";
|
|
4
|
+
const c = {
|
|
5
|
+
arrowLeft: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M10 5.75L3.75 12L10 18.25M4.5 12H20.25", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
6
|
+
arrowRight: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M14 5.75L20.25 12L14 18.25M19.5 12H3.75", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
7
|
+
arrowUp: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M5.75 10L12 3.75L18.25 10M12 20.25V4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
8
|
+
arrowDown: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M18 14L12 20L6 14M12 19V4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
9
|
+
command: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
10
|
+
"path",
|
|
11
|
+
{
|
|
12
|
+
d: "M9.25 9.25V6.5C9.25 4.98122 8.01878 3.75 6.5 3.75C4.98122 3.75 3.75 4.98122 3.75 6.5C3.75 8.01878 4.98122 9.25 6.5 9.25H9.25ZM9.25 9.25H14.75M9.25 9.25V14.75M14.75 9.25V6.5C14.75 4.98122 15.9812 3.75 17.5 3.75C19.0188 3.75 20.25 4.98122 20.25 6.5C20.25 8.01878 19.0188 9.25 17.5 9.25H14.75ZM14.75 9.25V14.75M14.75 14.75H9.25M14.75 14.75V17.5C14.75 19.0188 15.9812 20.25 17.5 20.25C19.0188 20.25 20.25 19.0188 20.25 17.5C20.25 15.9812 19.0188 14.75 17.5 14.75H14.75ZM9.25 14.75V17.5C9.25 19.0188 8.01878 20.25 6.5 20.25C4.98122 20.25 3.75 19.0188 3.75 17.5C3.75 15.9812 4.98122 14.75 6.5 14.75H9.25Z",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
strokeWidth: "1.5",
|
|
15
|
+
strokeLinecap: "square"
|
|
16
|
+
}
|
|
17
|
+
) }),
|
|
18
|
+
option: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M3.75 4.75H7.40962C7.77384 4.75 8.10925 4.94802 8.2852 5.26692L15.7148 18.7331C15.8907 19.052 16.2262 19.25 16.5904 19.25H20.25M15.75 4.75H20.25", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
19
|
+
shift: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
d: "M2.91032 11.5511L11.2848 2.98182C11.6771 2.5804 12.3229 2.5804 12.7152 2.98182L21.0897 11.5511C21.7085 12.1843 21.2599 13.25 20.3745 13.25H17.1316V19.25C17.1316 19.8023 16.6839 20.25 16.1316 20.25H7.86842C7.31614 20.25 6.86842 19.8023 6.86842 19.25V13.25H3.62551C2.74013 13.25 2.2915 12.1843 2.91032 11.5511Z",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "1.5",
|
|
25
|
+
strokeLinecap: "square",
|
|
26
|
+
strokeLinejoin: "round"
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
control: /* @__PURE__ */ t("svg", { className: "-translate-y-0.5", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M8 13.9999L11.6464 10.3535C11.8417 10.1582 12.1583 10.1582 12.3536 10.3535L16 13.9999", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
30
|
+
return: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
|
+
d: "M20.25 4C19.8358 4 19.5 4.33579 19.5 4.75V14.25C19.5 14.3881 19.3881 14.5 19.25 14.5H5.56066L8.28033 11.7803C8.57322 11.4874 8.57322 11.0126 8.28033 10.7197C7.98744 10.4268 7.51256 10.4268 7.21967 10.7197L3.21967 14.7197C2.92678 15.0126 2.92678 15.4874 3.21967 15.7803L7.21967 19.7803C7.51256 20.0732 7.98744 20.0732 8.28033 19.7803C8.57322 19.4874 8.57322 19.0126 8.28033 18.7197L5.56066 16H19.25C20.2165 16 21 15.2165 21 14.25V4.75C21 4.33579 20.6642 4 20.25 4Z",
|
|
36
|
+
fill: "currentColor"
|
|
37
|
+
}
|
|
38
|
+
) }),
|
|
39
|
+
delete: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
d: "M14.9988 9.75L12.7488 12M12.7488 12L10.4988 14.25M12.7488 12L10.4988 9.75M12.7488 12L14.9988 14.25M6.55509 4.75H20.2488C20.8011 4.75 21.2488 5.19772 21.2488 5.75V18.25C21.2488 18.8023 20.8011 19.25 20.2488 19.25H6.55509C6.2092 19.25 5.88786 19.0712 5.70545 18.7774L1.82614 12.5274C1.62566 12.2044 1.62566 11.7956 1.82614 11.4726L5.70545 5.22264C5.88786 4.92875 6.2092 4.75 6.55509 4.75Z",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
strokeWidth: "1.5",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
strokeLinejoin: "round"
|
|
47
|
+
}
|
|
48
|
+
) })
|
|
49
|
+
}, p = {
|
|
50
|
+
arrowLeft: "Left Arrow",
|
|
51
|
+
arrowRight: "Right Arrow",
|
|
52
|
+
arrowUp: "Up Arrow",
|
|
53
|
+
arrowDown: "Down Arrow",
|
|
54
|
+
command: "Command",
|
|
55
|
+
option: "Option",
|
|
56
|
+
shift: "Shift",
|
|
57
|
+
control: "Control",
|
|
58
|
+
return: "Return",
|
|
59
|
+
delete: "Delete"
|
|
60
|
+
}, g = ({ className: r, symbol: e, symbolPosition: n = "start", children: o, ...i }) => {
|
|
61
|
+
const l = o != null && o !== "", s = e && /* @__PURE__ */ t("span", { "aria-hidden": "true", children: c[e] }), a = !l && e ? p[e] : void 0, h = i["aria-label"] ?? a;
|
|
62
|
+
return /* @__PURE__ */ w(
|
|
63
|
+
"kbd",
|
|
64
|
+
{
|
|
65
|
+
className: d(
|
|
66
|
+
"bg-kbd-bg text-kbd-text pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-mono! text-xs font-medium select-none",
|
|
67
|
+
"in-data-[slot=tooltip-content]:bg-level-three [&_svg:not([class*='size-'])]:size-3",
|
|
68
|
+
r
|
|
69
|
+
),
|
|
70
|
+
"data-slot": "kbd",
|
|
71
|
+
"data-testid": "spectral-kbd",
|
|
72
|
+
...i,
|
|
73
|
+
"aria-label": h,
|
|
74
|
+
children: [
|
|
75
|
+
n === "start" && s,
|
|
76
|
+
o,
|
|
77
|
+
n === "end" && s
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
g.displayName = "Kbd";
|
|
83
|
+
const C = ({ className: r, ...e }) => /* @__PURE__ */ t("kbd", { className: d("inline-flex items-center gap-1", r), "data-slot": "kbd-group", "data-testid": "spectral-kbd-group", ...e });
|
|
84
|
+
C.displayName = "KbdGroup";
|
|
20
85
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
86
|
+
g as Kbd,
|
|
87
|
+
C as KbdGroup
|
|
23
88
|
};
|
package/dist/Label.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface LabelProps extends ComponentPropsWithoutRef<'label'> {
|
|
3
|
+
ref?: Ref<HTMLLabelElement>;
|
|
4
|
+
}
|
|
3
5
|
export declare const Label: {
|
|
4
|
-
({
|
|
6
|
+
({ className, ref, ...props }: LabelProps & {
|
|
5
7
|
ref?: Ref<HTMLLabelElement>;
|
|
6
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
displayName: string;
|
package/dist/Label.js
CHANGED
|
@@ -3,12 +3,12 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn as t } from "./utils/twUtils.js";
|
|
4
4
|
import "react";
|
|
5
5
|
const r = ({
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
className: e,
|
|
7
|
+
ref: a,
|
|
8
8
|
...l
|
|
9
9
|
}) => (
|
|
10
10
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
11
|
-
/* @__PURE__ */ o("label", {
|
|
11
|
+
/* @__PURE__ */ o("label", { className: t("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", e), "data-slot": "label", ref: a, ...l })
|
|
12
12
|
);
|
|
13
13
|
r.displayName = "Label";
|
|
14
14
|
export {
|