@spear-ai/spectral 1.13.0 → 1.13.1
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 +41 -40
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +46 -45
- package/dist/Checkbox.js +6 -5
- package/dist/{Combobox-DCCcIDgq.js → Combobox-DRQqx0os.js} +9 -8
- package/dist/Combobox.js +1 -1
- package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -1
- package/dist/ControlGroup/ControlGroupSelect.js +73 -67
- package/dist/ControlGroup.js +29 -24
- package/dist/DateTimePicker/TimePeriodSelect.js +1 -1
- package/dist/DateTimePicker.js +8 -7
- package/dist/{DropdownMenu-B8I8IRcu.js → DropdownMenu-BO_RPCVU.js} +204 -202
- package/dist/DropdownMenu.d.ts +3 -2
- package/dist/DropdownMenu.js +1 -1
- package/dist/FormFieldMessage.d.ts +11 -0
- package/dist/FormFieldMessage.js +55 -0
- package/dist/Input.d.ts +1 -0
- package/dist/Input.js +68 -67
- package/dist/InputNumeric.js +3 -14
- package/dist/{InputOTP-DyhesOLs.js → InputOTP-DLn7ja7J.js} +5 -4
- package/dist/InputOTP.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +105 -104
- package/dist/{RadioGroup-BsBK247l.js → RadioGroup-D-XjCU4Q.js} +33 -28
- package/dist/RadioGroup.js +1 -1
- package/dist/Select.js +21 -20
- package/dist/{Switch-Vep4hsq4.js → Switch-CSmXtkia.js} +26 -25
- package/dist/Switch.js +1 -1
- package/dist/Textarea/TextareaUtils.js +4 -8
- package/dist/Textarea.js +23 -22
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +10 -10
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +1 -1
- package/dist/ToggleGroup/ToggleGroupBase.js +19 -19
- package/dist/ToggleGroup/ToggleGroupItem.js +2 -2
- package/dist/ToggleGroup/ToggleGroupSplitMenuItem.d.ts +5 -2
- package/dist/ToggleGroup/ToggleGroupSplitMenuItem.js +91 -52
- package/dist/ToggleGroup.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/select.d.ts +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/textarea.js +1 -1
- package/dist/{select-oAOoVl5g.js → select-DFE8xm1L.js} +230 -259
- package/dist/styles/spectral.css +1 -1
- package/dist/utils/formFieldUtils.d.ts +1 -13
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +48 -69
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, KeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
export { ErrorMessage, WarningMessage, type FormFieldMessageValue } from '../components/FormFieldMessage/FormFieldMessage';
|
|
2
3
|
export type FormFieldState = 'default' | 'error' | 'warning' | 'disabled' | 'loading' | 'success';
|
|
3
4
|
export interface BaseFormFieldProps {
|
|
4
5
|
disabled?: boolean;
|
|
@@ -78,19 +79,6 @@ export declare const EmptyState: ({ className, message }: {
|
|
|
78
79
|
className?: string;
|
|
79
80
|
message?: ReactNode;
|
|
80
81
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
81
|
-
export declare const ErrorMessage: ({ className, id, dataTestId, message }: {
|
|
82
|
-
className?: string;
|
|
83
|
-
dataTestId?: string;
|
|
84
|
-
id: string;
|
|
85
|
-
message: string | string[] | Record<string, unknown> | null;
|
|
86
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
87
|
-
export declare const WarningMessage: ({ className, id, dataTestId, message }: {
|
|
88
|
-
className?: string;
|
|
89
|
-
dataTestId?: string;
|
|
90
|
-
id: string;
|
|
91
|
-
message: string | string[] | Record<string, unknown> | null;
|
|
92
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
93
82
|
export declare const getOptionClasses: (isDisabled: boolean | undefined, isFocused: boolean, isSelected: boolean) => string;
|
|
94
83
|
export declare const scrollIntoView: (element: HTMLElement | null) => void;
|
|
95
|
-
export {};
|
|
96
84
|
//# sourceMappingURL=formFieldUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formFieldUtils.d.ts","sourceRoot":"","sources":["../../src/utils/formFieldUtils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAmD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"formFieldUtils.d.ts","sourceRoot":"","sources":["../../src/utils/formFieldUtils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAmD,MAAM,OAAO,CAAA;AAC/H,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AAExH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAEjG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACjE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,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E,YAAY,OAAO,KAAG,MAOvG,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,GAAG,IAAI,SAIzD,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { t as e } from "../twUtils-BpqlKSeB.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ErrorMessage as t, WarningMessage as n } from "../FormFieldMessage.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
5
6
|
//#region src/utils/formFieldUtils.tsx
|
|
6
|
-
var
|
|
7
|
+
var l = ({ dropdownWidth: e, triggerStyleWidth: t, triggerWidth: n, viewportMaxWidth: r = "calc(100vw - 2rem)" }) => {
|
|
7
8
|
let i = e === "trigger" ? "trigger" : e === "content" ? "content" : "custom", a = e === "trigger" ? n : e === "content" ? "max-content" : e, o = {
|
|
8
9
|
maxWidth: r,
|
|
9
10
|
overflowX: "auto",
|
|
@@ -19,107 +20,107 @@ var s = ({ dropdownWidth: e, triggerStyleWidth: t, triggerWidth: n, viewportMaxW
|
|
|
19
20
|
},
|
|
20
21
|
resolvedDropdownWidth: a
|
|
21
22
|
};
|
|
22
|
-
},
|
|
23
|
+
}, u = (e) => ({
|
|
23
24
|
success: "border-success-400 hover:border-success-500 focus-visible:border-success-400 focus-visible:outline-success-400",
|
|
24
25
|
error: "border-danger-400 hover:border-danger-500 focus-visible:border-danger-400 focus-visible:outline-danger-400",
|
|
25
26
|
warning: "border-warning-400 hover:border-warning-400 focus-visible:border-warning-400 focus-visible:outline-warning-400",
|
|
26
27
|
loading: "cursor-wait border-input-border--disabled pointer-events-none",
|
|
27
28
|
disabled: "cursor-not-allowed opacity-50 border-input-border--disabled text-input-text--disabled",
|
|
28
29
|
default: ""
|
|
29
|
-
})[e],
|
|
30
|
+
})[e], d = (t = !1, n, r) => e("h-12 rounded-lg px-4 text-base flex w-full items-center justify-between border-2 border-input-border bg-input-bg", "text-input-text transition duration-200 hover:border-input-border--hover focus:border-input-border--focus focus:outline-none", "disabled:cursor-not-allowed disabled:border-input-border--disabled disabled:bg-input-bg--disabled disabled:opacity-50", t && "border-input-border--focus hover:border-input-border--focus", u(n), r), f = (t, n = "bottom") => {
|
|
30
31
|
let r = n === "bottom" ? "top-full mt-1 origin-top" : "bottom-full mb-1 origin-bottom", i = n === "bottom" ? t ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-1 pointer-events-none" : t ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 translate-y-1 pointer-events-none";
|
|
31
|
-
return e("left-0 right-0 absolute z-50",
|
|
32
|
-
},
|
|
33
|
-
let n =
|
|
32
|
+
return e("left-0 right-0 absolute z-50", p(), "transition-[opacity,transform] duration-150 motion-reduce:transform-none motion-reduce:transition-none", "will-change-[opacity,transform]", r, i);
|
|
33
|
+
}, p = () => "rounded-lg border border-input-border bg-input-bg shadow-md", m = (t, n) => e("peer h-12 rounded-md ps-3 pe-12 text-base flex w-full border-2 border-input-border bg-input-bg transition duration-200", "placeholder:text-input-text-placeholder hover:border-input-border--hover focus:border-input-border--focus focus:outline-none", "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-input-border--focus", "disabled:pointer-events-none disabled:border-input-border--disabled disabled:bg-input-bg--disabled disabled:text-input-text--disabled", u(t), n), h = (t, n) => e("peer h-24 rounded-md p-3 text-base flex w-full resize-none border-2 border-input-border bg-input-bg transition duration-200", "placeholder:text-input-text-placeholder hover:border-input-border--hover focus:border-input-border--focus focus:outline-none", "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-input-border--focus", "disabled:pointer-events-none disabled:border-input-border--disabled disabled:bg-input-bg--disabled disabled:text-input-text--disabled", u(t), n), g = (e, t) => {
|
|
34
|
+
let n = a();
|
|
34
35
|
if (e) return e;
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
},
|
|
36
|
+
let r = t?.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9\-_.:]/g, "");
|
|
37
|
+
return r ? `${r}-${n}` : n;
|
|
38
|
+
}, _ = (e) => `${e}-error`, v = (t, n, r, i) => ({
|
|
38
39
|
"aria-invalid": t === "error",
|
|
39
40
|
"aria-required": r,
|
|
40
41
|
"aria-describedby": e((t === "error" || t === "warning") && i, n) || void 0
|
|
41
|
-
}),
|
|
42
|
+
}), y = (e = {}) => ({
|
|
42
43
|
"--field-border-radius": "0.5rem",
|
|
43
44
|
"--field-height": "3rem",
|
|
44
45
|
"--field-padding": "1rem",
|
|
45
46
|
...e
|
|
46
|
-
}),
|
|
47
|
+
}), b = (e, t = "default") => ({
|
|
47
48
|
isDisabled: e ?? t === "disabled",
|
|
48
49
|
isLoading: t === "loading",
|
|
49
50
|
isInvalid: t === "error"
|
|
50
|
-
}),
|
|
51
|
-
let t =
|
|
52
|
-
return
|
|
51
|
+
}), x = (e) => {
|
|
52
|
+
let t = o(null);
|
|
53
|
+
return i(() => {
|
|
53
54
|
let n = (n) => {
|
|
54
55
|
t.current && !t.current.contains(n.target) && e();
|
|
55
56
|
};
|
|
56
57
|
return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
|
|
57
58
|
}, [e]), t;
|
|
58
|
-
},
|
|
59
|
-
let [l, u] =
|
|
60
|
-
|
|
61
|
-
if (e) if (
|
|
59
|
+
}, S = (e, t = !1, n, a, o, c) => {
|
|
60
|
+
let [l, u] = s(-1);
|
|
61
|
+
i(() => {
|
|
62
|
+
if (e) if (t) u(0);
|
|
62
63
|
else {
|
|
63
|
-
let e =
|
|
64
|
+
let e = o.findIndex((e) => e.value === c);
|
|
64
65
|
u(e >= 0 ? e : 0);
|
|
65
66
|
}
|
|
66
67
|
else u(-1);
|
|
67
68
|
}, [
|
|
68
69
|
e,
|
|
69
70
|
c,
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
o,
|
|
72
|
+
t
|
|
72
73
|
]);
|
|
73
|
-
let d =
|
|
74
|
+
let d = r((e, t) => {
|
|
74
75
|
let n = e + (t === "down" ? 1 : -1);
|
|
75
|
-
return n = t === "down" ? Math.min(n,
|
|
76
|
-
}, [
|
|
76
|
+
return n = t === "down" ? Math.min(n, o.length - 1) : Math.max(n, 0), o[n]?.disabled && n !== e ? d(n, t) : n;
|
|
77
|
+
}, [o]);
|
|
77
78
|
return {
|
|
78
79
|
focusedIndex: l,
|
|
79
80
|
setFocusedIndex: u,
|
|
80
|
-
handleKeyDown:
|
|
81
|
+
handleKeyDown: r((r) => {
|
|
81
82
|
if (!e) return [
|
|
82
83
|
"ArrowDown",
|
|
83
84
|
"ArrowUp",
|
|
84
85
|
" ",
|
|
85
86
|
"Enter"
|
|
86
|
-
].includes(
|
|
87
|
-
let
|
|
87
|
+
].includes(r.key) ? (r.preventDefault(), "open") : void 0;
|
|
88
|
+
let i = {
|
|
88
89
|
ArrowDown: () => {
|
|
89
|
-
|
|
90
|
+
r.preventDefault(), u((e) => d(e, "down"));
|
|
90
91
|
},
|
|
91
92
|
ArrowUp: () => {
|
|
92
|
-
|
|
93
|
+
r.preventDefault(), u((e) => d(e, "up"));
|
|
93
94
|
},
|
|
94
95
|
Enter: () => {
|
|
95
|
-
|
|
96
|
+
r.preventDefault(), l >= 0 && o[l] && !o[l].disabled && (a(o[l].value), t || n());
|
|
96
97
|
},
|
|
97
98
|
" ": () => {
|
|
98
|
-
|
|
99
|
+
r.preventDefault(), l >= 0 && o[l] && !o[l].disabled && (a(o[l].value), t || n());
|
|
99
100
|
},
|
|
100
101
|
Escape: () => {
|
|
101
|
-
|
|
102
|
+
r.preventDefault(), n();
|
|
102
103
|
},
|
|
103
104
|
Home: () => {
|
|
104
|
-
|
|
105
|
+
r.preventDefault(), u(0);
|
|
105
106
|
},
|
|
106
107
|
End: () => {
|
|
107
|
-
|
|
108
|
+
r.preventDefault(), u(o.length - 1);
|
|
108
109
|
}
|
|
109
|
-
}[
|
|
110
|
-
|
|
110
|
+
}[r.key];
|
|
111
|
+
i && i();
|
|
111
112
|
}, [
|
|
112
|
-
s,
|
|
113
|
-
l,
|
|
114
113
|
o,
|
|
115
|
-
|
|
114
|
+
l,
|
|
115
|
+
a,
|
|
116
|
+
n,
|
|
116
117
|
e,
|
|
117
|
-
|
|
118
|
+
t,
|
|
118
119
|
d
|
|
119
120
|
]),
|
|
120
121
|
isOpen: e
|
|
121
122
|
};
|
|
122
|
-
},
|
|
123
|
+
}, C = (e) => {
|
|
123
124
|
let t = {}, n = [];
|
|
124
125
|
return e.forEach((e) => {
|
|
125
126
|
e.group ? (t[e.group] || (t[e.group] = []), t[e.group].push(e)) : n.push(e);
|
|
@@ -128,42 +129,20 @@ var s = ({ dropdownWidth: e, triggerStyleWidth: t, triggerWidth: n, viewportMaxW
|
|
|
128
129
|
ungrouped: n,
|
|
129
130
|
hasGroups: Object.keys(t).length > 0
|
|
130
131
|
};
|
|
131
|
-
},
|
|
132
|
+
}, w = ({ className: t, message: n = "Loading…" }) => /* @__PURE__ */ c("div", {
|
|
132
133
|
"aria-live": "polite",
|
|
133
134
|
className: e("gap-2 py-6 text-base text-input-text-secondary flex items-center justify-center", t),
|
|
134
135
|
role: "status",
|
|
135
136
|
children: n
|
|
136
|
-
}),
|
|
137
|
+
}), T = ({ className: t, message: n = "No options found" }) => /* @__PURE__ */ c("div", {
|
|
137
138
|
className: e("py-6 text-base text-center text-text-secondary", t),
|
|
138
139
|
role: "status",
|
|
139
140
|
children: n
|
|
140
|
-
}),
|
|
141
|
-
let a = w(i);
|
|
142
|
-
return a ? /* @__PURE__ */ o("p", {
|
|
143
|
-
"aria-atomic": "true",
|
|
144
|
-
"aria-live": "assertive",
|
|
145
|
-
className: e("m-0! mt-1.5! text-base text-danger-400!", t),
|
|
146
|
-
"data-testid": r ?? "spectral-form-field-error-message",
|
|
147
|
-
id: n,
|
|
148
|
-
role: "alert",
|
|
149
|
-
children: a
|
|
150
|
-
}) : null;
|
|
151
|
-
}, E = ({ className: t, id: n, dataTestId: r, message: i }) => {
|
|
152
|
-
let a = w(i);
|
|
153
|
-
return a ? /* @__PURE__ */ o("p", {
|
|
154
|
-
"aria-atomic": "true",
|
|
155
|
-
"aria-live": "polite",
|
|
156
|
-
className: e("m-0! mt-1.5! text-base text-warning-400!", t),
|
|
157
|
-
"data-testid": r ?? "spectral-form-field-warning-message",
|
|
158
|
-
id: n,
|
|
159
|
-
role: "status",
|
|
160
|
-
children: a
|
|
161
|
-
}) : null;
|
|
162
|
-
}, D = (t = !1, n, r) => e("rounded-sm py-1.5 pl-2 pr-8 text-base relative flex w-full cursor-pointer items-center outline-none select-none hover:bg-input-bg--hover", n && "bg-input-bg--hover", r && "bg-input-bg--selected text-input-text", t && "pointer-events-none text-input-text--disabled"), O = (e) => {
|
|
141
|
+
}), E = (t = !1, n, r) => e("my-0.5 first:mt-0 last:mb-0 rounded-sm py-1.5 pl-2 pr-8 text-base relative flex w-full cursor-pointer items-center outline-none select-none hover:bg-input-bg--hover data-[highlighted]:bg-input-bg--hover data-[highlighted]:text-input-text", n && "bg-input-bg--hover", r && "bg-input-bg--selected text-input-text", t && "pointer-events-none text-input-text--disabled"), D = (e) => {
|
|
163
142
|
e && e.scrollIntoView({
|
|
164
143
|
block: "nearest",
|
|
165
144
|
behavior: "smooth"
|
|
166
145
|
});
|
|
167
146
|
};
|
|
168
147
|
//#endregion
|
|
169
|
-
export {
|
|
148
|
+
export { T as EmptyState, t as ErrorMessage, w as LoadingState, n as WarningMessage, v as getAriaProps, f as getDropdownClasses, p as getDropdownSurfaceClasses, l as getDropdownWidthStyles, _ as getErrorMessageId, y as getFormFieldCSSProperties, m as getInputClasses, E as getOptionClasses, u as getStateClasses, h as getTextareaClasses, d as getTriggerClasses, C as groupOptions, D as scrollIntoView, x as useClickOutside, g as useFormFieldId, b as useFormFieldState, S as useKeyboardNavigation };
|