@spear-ai/spectral 1.6.16 → 1.7.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 +196 -191
- package/dist/Accordion.d.ts +13 -15
- package/dist/Accordion.js +172 -165
- package/dist/Alert/AlertBase.d.ts +7 -7
- package/dist/Alert/AlertBase.js +23 -21
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +32 -30
- 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 +31 -30
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +50 -57
- package/dist/Checkbox.js +16 -18
- 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 +4 -2
- 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 +96 -74
- 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/LineToolIcon.js +37 -10
- package/dist/Icons/MeasureIcon.d.ts +5 -0
- package/dist/Icons/MeasureIcon.js +26 -0
- package/dist/Icons/SearchIcon.d.ts +5 -0
- package/dist/Icons/SearchIcon.js +10 -0
- package/dist/Icons/index.d.ts +2 -0
- package/dist/Icons.js +76 -72
- 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 +31 -29
- package/dist/InputOTP.d.ts +10 -10
- package/dist/InputOTP.js +125 -123
- 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 -200
- 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 +92 -87
- 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 +68 -68
- package/dist/Switch.d.ts +3 -3
- package/dist/Switch.js +9 -9
- 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 +34 -22
- 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 +77 -74
- 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 +68 -95
- 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 +40 -11
- package/dist/styles/horizon/utilities.css +26 -3
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/styles/theme.css +96 -44
- 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 +5 -1
- package/dist/createLucideIcon-D4r5Phnh.js +0 -70
- package/dist/index-CeP1E2kK.js +0 -209
- package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Accordion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as i, jsxs as
|
|
3
|
+
import { jsx as i, jsxs as K } from "react/jsx-runtime";
|
|
4
4
|
import "./Icons/AnalyzeIcon.js";
|
|
5
5
|
import "./Icons/AnnotationsIcon.js";
|
|
6
6
|
import "./Icons/ApprovedIcon.js";
|
|
@@ -10,7 +10,7 @@ import "./Icons/CalendarIcon.js";
|
|
|
10
10
|
import "./Icons/CheckCircleIcon.js";
|
|
11
11
|
import "./Icons/CheckSquareIcon.js";
|
|
12
12
|
import "./Icons/CheckmarkIcon.js";
|
|
13
|
-
import { ChevronDownIcon as
|
|
13
|
+
import { ChevronDownIcon as ve } from "./Icons/ChevronDownIcon.js";
|
|
14
14
|
import "./Icons/ChevronUpIcon.js";
|
|
15
15
|
import "./Icons/ClockIcon.js";
|
|
16
16
|
import "./Icons/CloseCircleIcon.js";
|
|
@@ -39,6 +39,7 @@ import "./Icons/LiveViewIcon.js";
|
|
|
39
39
|
import "./Icons/LoaderIcon.js";
|
|
40
40
|
import "./Icons/LocationIcon.js";
|
|
41
41
|
import "./Icons/LogoutIcon.js";
|
|
42
|
+
import "./Icons/MeasureIcon.js";
|
|
42
43
|
import "./Icons/MessagesIcon.js";
|
|
43
44
|
import "./Icons/MetadataIcon.js";
|
|
44
45
|
import "./Icons/MinusIcon.js";
|
|
@@ -50,6 +51,7 @@ import "./Icons/PlusIcon.js";
|
|
|
50
51
|
import "./Icons/ResetIcon.js";
|
|
51
52
|
import "./Icons/ReviewedIcon.js";
|
|
52
53
|
import "./Icons/ScissorsIcon.js";
|
|
54
|
+
import "./Icons/SearchIcon.js";
|
|
53
55
|
import "./Icons/SettingsIcon.js";
|
|
54
56
|
import "./Icons/SortAscendingIcon.js";
|
|
55
57
|
import "./Icons/SortAtoZIcon.js";
|
|
@@ -65,44 +67,44 @@ import "./Icons/WarningIcon.js";
|
|
|
65
67
|
import "./Icons/ZoomAllIcon.js";
|
|
66
68
|
import "./Icons/ZoomXIcon.js";
|
|
67
69
|
import "./Icons/ZoomYIcon.js";
|
|
68
|
-
import { useAccordionAutoScroll as
|
|
70
|
+
import { useAccordionAutoScroll as Ce } from "./hooks/useAccordionAutoScroll.js";
|
|
69
71
|
import * as f from "react";
|
|
70
|
-
import u, { createContext as
|
|
71
|
-
import { c as F,
|
|
72
|
-
import { c as
|
|
73
|
-
import { P as
|
|
74
|
-
import { u as U } from "./index-
|
|
72
|
+
import u, { createContext as ge, Children as be, isValidElement as Ae, cloneElement as he, useRef as xe, useCallback as Ie, useContext as ye } from "react";
|
|
73
|
+
import { c as F, P as y, b as z, e as M, u as B, f as Re } from "./index-OnYbwQjk.js";
|
|
74
|
+
import { c as Ne, u as we } from "./index-DSXuB1g3.js";
|
|
75
|
+
import { P as _e } from "./index-D6HcSXrq.js";
|
|
76
|
+
import { u as U } from "./index-C12FUuIW.js";
|
|
75
77
|
import { cn as w } from "./utils/twUtils.js";
|
|
76
|
-
var _ = "Collapsible", [
|
|
77
|
-
(e,
|
|
78
|
+
var _ = "Collapsible", [Pe, q] = F(_), [Ee, V] = Pe(_), J = f.forwardRef(
|
|
79
|
+
(e, a) => {
|
|
78
80
|
const {
|
|
79
81
|
__scopeCollapsible: o,
|
|
80
82
|
open: t,
|
|
81
|
-
defaultOpen:
|
|
83
|
+
defaultOpen: n,
|
|
82
84
|
disabled: r,
|
|
83
85
|
onOpenChange: c,
|
|
84
|
-
...
|
|
85
|
-
} = e, [
|
|
86
|
+
...s
|
|
87
|
+
} = e, [l, p] = M({
|
|
86
88
|
prop: t,
|
|
87
|
-
defaultProp:
|
|
89
|
+
defaultProp: n ?? !1,
|
|
88
90
|
onChange: c,
|
|
89
91
|
caller: _
|
|
90
92
|
});
|
|
91
93
|
return /* @__PURE__ */ i(
|
|
92
|
-
|
|
94
|
+
Ee,
|
|
93
95
|
{
|
|
94
96
|
scope: o,
|
|
95
97
|
disabled: r,
|
|
96
98
|
contentId: U(),
|
|
97
|
-
open:
|
|
99
|
+
open: l,
|
|
98
100
|
onOpenToggle: f.useCallback(() => p((m) => !m), [p]),
|
|
99
101
|
children: /* @__PURE__ */ i(
|
|
100
|
-
|
|
102
|
+
y.div,
|
|
101
103
|
{
|
|
102
|
-
"data-state": H(
|
|
104
|
+
"data-state": H(l),
|
|
103
105
|
"data-disabled": r ? "" : void 0,
|
|
104
|
-
...
|
|
105
|
-
ref:
|
|
106
|
+
...s,
|
|
107
|
+
ref: a
|
|
106
108
|
}
|
|
107
109
|
)
|
|
108
110
|
}
|
|
@@ -111,49 +113,49 @@ var _ = "Collapsible", [Ne, q] = F(_), [Re, V] = Ne(_), J = f.forwardRef(
|
|
|
111
113
|
);
|
|
112
114
|
J.displayName = _;
|
|
113
115
|
var Y = "CollapsibleTrigger", Q = f.forwardRef(
|
|
114
|
-
(e,
|
|
115
|
-
const { __scopeCollapsible: o, ...t } = e,
|
|
116
|
+
(e, a) => {
|
|
117
|
+
const { __scopeCollapsible: o, ...t } = e, n = V(Y, o);
|
|
116
118
|
return /* @__PURE__ */ i(
|
|
117
|
-
|
|
119
|
+
y.button,
|
|
118
120
|
{
|
|
119
121
|
type: "button",
|
|
120
|
-
"aria-controls":
|
|
121
|
-
"aria-expanded":
|
|
122
|
-
"data-state": H(
|
|
123
|
-
"data-disabled":
|
|
124
|
-
disabled:
|
|
122
|
+
"aria-controls": n.contentId,
|
|
123
|
+
"aria-expanded": n.open || !1,
|
|
124
|
+
"data-state": H(n.open),
|
|
125
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
126
|
+
disabled: n.disabled,
|
|
125
127
|
...t,
|
|
126
|
-
ref:
|
|
127
|
-
onClick: z(e.onClick,
|
|
128
|
+
ref: a,
|
|
129
|
+
onClick: z(e.onClick, n.onOpenToggle)
|
|
128
130
|
}
|
|
129
131
|
);
|
|
130
132
|
}
|
|
131
133
|
);
|
|
132
134
|
Q.displayName = Y;
|
|
133
135
|
var $ = "CollapsibleContent", W = f.forwardRef(
|
|
134
|
-
(e,
|
|
135
|
-
const { forceMount: o, ...t } = e,
|
|
136
|
-
return /* @__PURE__ */ i(
|
|
136
|
+
(e, a) => {
|
|
137
|
+
const { forceMount: o, ...t } = e, n = V($, e.__scopeCollapsible);
|
|
138
|
+
return /* @__PURE__ */ i(_e, { present: o || n.open, children: ({ present: r }) => /* @__PURE__ */ i(Se, { ...t, ref: a, present: r }) });
|
|
137
139
|
}
|
|
138
140
|
);
|
|
139
141
|
W.displayName = $;
|
|
140
|
-
var
|
|
141
|
-
const { __scopeCollapsible: o, present: t, children:
|
|
142
|
+
var Se = f.forwardRef((e, a) => {
|
|
143
|
+
const { __scopeCollapsible: o, present: t, children: n, ...r } = e, c = V($, o), [s, l] = f.useState(t), p = f.useRef(null), m = B(a, p), v = f.useRef(0), x = v.current, g = f.useRef(0), R = g.current, b = c.open || s, A = f.useRef(b), h = f.useRef(void 0);
|
|
142
144
|
return f.useEffect(() => {
|
|
143
145
|
const d = requestAnimationFrame(() => A.current = !1);
|
|
144
146
|
return () => cancelAnimationFrame(d);
|
|
145
|
-
}, []),
|
|
147
|
+
}, []), Re(() => {
|
|
146
148
|
const d = p.current;
|
|
147
149
|
if (d) {
|
|
148
150
|
h.current = h.current || {
|
|
149
151
|
transitionDuration: d.style.transitionDuration,
|
|
150
152
|
animationName: d.style.animationName
|
|
151
153
|
}, d.style.transitionDuration = "0s", d.style.animationName = "none";
|
|
152
|
-
const
|
|
153
|
-
v.current =
|
|
154
|
+
const I = d.getBoundingClientRect();
|
|
155
|
+
v.current = I.height, g.current = I.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), l(t);
|
|
154
156
|
}
|
|
155
157
|
}, [c.open, t]), /* @__PURE__ */ i(
|
|
156
|
-
|
|
158
|
+
y.div,
|
|
157
159
|
{
|
|
158
160
|
"data-state": H(c.open),
|
|
159
161
|
"data-disabled": c.disabled ? "" : void 0,
|
|
@@ -163,100 +165,100 @@ var we = f.forwardRef((e, n) => {
|
|
|
163
165
|
ref: m,
|
|
164
166
|
style: {
|
|
165
167
|
"--radix-collapsible-content-height": x ? `${x}px` : void 0,
|
|
166
|
-
"--radix-collapsible-content-width":
|
|
168
|
+
"--radix-collapsible-content-width": R ? `${R}px` : void 0,
|
|
167
169
|
...e.style
|
|
168
170
|
},
|
|
169
|
-
children: b &&
|
|
171
|
+
children: b && n
|
|
170
172
|
}
|
|
171
173
|
);
|
|
172
174
|
});
|
|
173
175
|
function H(e) {
|
|
174
176
|
return e ? "open" : "closed";
|
|
175
177
|
}
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
+
var Oe = J, Te = Q, ke = W, C = "Accordion", De = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [L, Me, Ve] = Ne(C), [P] = F(C, [
|
|
179
|
+
Ve,
|
|
178
180
|
q
|
|
179
|
-
]),
|
|
180
|
-
(e,
|
|
181
|
-
const { type: o, ...t } = e,
|
|
182
|
-
return /* @__PURE__ */ i(L.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(
|
|
181
|
+
]), j = q(), X = u.forwardRef(
|
|
182
|
+
(e, a) => {
|
|
183
|
+
const { type: o, ...t } = e, n = t, r = t;
|
|
184
|
+
return /* @__PURE__ */ i(L.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(je, { ...r, ref: a }) : /* @__PURE__ */ i(Le, { ...n, ref: a }) });
|
|
183
185
|
}
|
|
184
186
|
);
|
|
185
187
|
X.displayName = C;
|
|
186
|
-
var [Z,
|
|
188
|
+
var [Z, $e] = P(C), [ee, He] = P(
|
|
187
189
|
C,
|
|
188
190
|
{ collapsible: !1 }
|
|
189
|
-
),
|
|
190
|
-
(e,
|
|
191
|
+
), Le = u.forwardRef(
|
|
192
|
+
(e, a) => {
|
|
191
193
|
const {
|
|
192
194
|
value: o,
|
|
193
195
|
defaultValue: t,
|
|
194
|
-
onValueChange:
|
|
196
|
+
onValueChange: n = () => {
|
|
195
197
|
},
|
|
196
198
|
collapsible: r = !1,
|
|
197
199
|
...c
|
|
198
|
-
} = e, [
|
|
200
|
+
} = e, [s, l] = M({
|
|
199
201
|
prop: o,
|
|
200
202
|
defaultProp: t ?? "",
|
|
201
|
-
onChange:
|
|
203
|
+
onChange: n,
|
|
202
204
|
caller: C
|
|
203
205
|
});
|
|
204
206
|
return /* @__PURE__ */ i(
|
|
205
207
|
Z,
|
|
206
208
|
{
|
|
207
209
|
scope: e.__scopeAccordion,
|
|
208
|
-
value: u.useMemo(() =>
|
|
209
|
-
onItemOpen:
|
|
210
|
-
onItemClose: u.useCallback(() => r &&
|
|
211
|
-
children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ i(oe, { ...c, ref:
|
|
210
|
+
value: u.useMemo(() => s ? [s] : [], [s]),
|
|
211
|
+
onItemOpen: l,
|
|
212
|
+
onItemClose: u.useCallback(() => r && l(""), [r, l]),
|
|
213
|
+
children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ i(oe, { ...c, ref: a }) })
|
|
212
214
|
}
|
|
213
215
|
);
|
|
214
216
|
}
|
|
215
|
-
),
|
|
217
|
+
), je = u.forwardRef((e, a) => {
|
|
216
218
|
const {
|
|
217
219
|
value: o,
|
|
218
220
|
defaultValue: t,
|
|
219
|
-
onValueChange:
|
|
221
|
+
onValueChange: n = () => {
|
|
220
222
|
},
|
|
221
223
|
...r
|
|
222
|
-
} = e, [c,
|
|
224
|
+
} = e, [c, s] = M({
|
|
223
225
|
prop: o,
|
|
224
226
|
defaultProp: t ?? [],
|
|
225
|
-
onChange:
|
|
227
|
+
onChange: n,
|
|
226
228
|
caller: C
|
|
227
|
-
}),
|
|
228
|
-
(m) =>
|
|
229
|
-
[
|
|
229
|
+
}), l = u.useCallback(
|
|
230
|
+
(m) => s((v = []) => [...v, m]),
|
|
231
|
+
[s]
|
|
230
232
|
), p = u.useCallback(
|
|
231
|
-
(m) =>
|
|
232
|
-
[
|
|
233
|
+
(m) => s((v = []) => v.filter((x) => x !== m)),
|
|
234
|
+
[s]
|
|
233
235
|
);
|
|
234
236
|
return /* @__PURE__ */ i(
|
|
235
237
|
Z,
|
|
236
238
|
{
|
|
237
239
|
scope: e.__scopeAccordion,
|
|
238
240
|
value: c,
|
|
239
|
-
onItemOpen:
|
|
241
|
+
onItemOpen: l,
|
|
240
242
|
onItemClose: p,
|
|
241
|
-
children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(oe, { ...r, ref:
|
|
243
|
+
children: /* @__PURE__ */ i(ee, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(oe, { ...r, ref: a }) })
|
|
242
244
|
}
|
|
243
245
|
);
|
|
244
|
-
}), [
|
|
245
|
-
(e,
|
|
246
|
-
const { __scopeAccordion: o, disabled: t, dir:
|
|
247
|
-
if (!
|
|
248
|
-
const
|
|
246
|
+
}), [Ge, E] = P(C), oe = u.forwardRef(
|
|
247
|
+
(e, a) => {
|
|
248
|
+
const { __scopeAccordion: o, disabled: t, dir: n, orientation: r = "vertical", ...c } = e, s = u.useRef(null), l = B(s, a), p = Me(o), v = we(n) === "ltr", x = z(e.onKeyDown, (g) => {
|
|
249
|
+
if (!De.includes(g.key)) return;
|
|
250
|
+
const R = g.target, b = p().filter((k) => !k.ref.current?.disabled), A = b.findIndex((k) => k.ref.current === R), h = b.length;
|
|
249
251
|
if (A === -1) return;
|
|
250
252
|
g.preventDefault();
|
|
251
253
|
let d = A;
|
|
252
|
-
const
|
|
253
|
-
d = A + 1, d > S && (d =
|
|
254
|
+
const I = 0, S = h - 1, O = () => {
|
|
255
|
+
d = A + 1, d > S && (d = I);
|
|
254
256
|
}, T = () => {
|
|
255
|
-
d = A - 1, d <
|
|
257
|
+
d = A - 1, d < I && (d = S);
|
|
256
258
|
};
|
|
257
259
|
switch (g.key) {
|
|
258
260
|
case "Home":
|
|
259
|
-
d =
|
|
261
|
+
d = I;
|
|
260
262
|
break;
|
|
261
263
|
case "End":
|
|
262
264
|
d = S;
|
|
@@ -274,46 +276,46 @@ var [Z, ke] = P(C), [ee, De] = P(
|
|
|
274
276
|
r === "vertical" && T();
|
|
275
277
|
break;
|
|
276
278
|
}
|
|
277
|
-
const
|
|
278
|
-
b[
|
|
279
|
+
const fe = d % h;
|
|
280
|
+
b[fe].ref.current?.focus();
|
|
279
281
|
});
|
|
280
282
|
return /* @__PURE__ */ i(
|
|
281
|
-
|
|
283
|
+
Ge,
|
|
282
284
|
{
|
|
283
285
|
scope: o,
|
|
284
286
|
disabled: t,
|
|
285
|
-
direction:
|
|
287
|
+
direction: n,
|
|
286
288
|
orientation: r,
|
|
287
289
|
children: /* @__PURE__ */ i(L.Slot, { scope: o, children: /* @__PURE__ */ i(
|
|
288
|
-
|
|
290
|
+
y.div,
|
|
289
291
|
{
|
|
290
292
|
...c,
|
|
291
293
|
"data-orientation": r,
|
|
292
|
-
ref:
|
|
294
|
+
ref: l,
|
|
293
295
|
onKeyDown: t ? void 0 : x
|
|
294
296
|
}
|
|
295
297
|
) })
|
|
296
298
|
}
|
|
297
299
|
);
|
|
298
300
|
}
|
|
299
|
-
),
|
|
300
|
-
(e,
|
|
301
|
-
const { __scopeAccordion: o, value: t, ...
|
|
301
|
+
), N = "AccordionItem", [Ke, G] = P(N), te = u.forwardRef(
|
|
302
|
+
(e, a) => {
|
|
303
|
+
const { __scopeAccordion: o, value: t, ...n } = e, r = E(N, o), c = $e(N, o), s = j(o), l = U(), p = t && c.value.includes(t) || !1, m = r.disabled || e.disabled;
|
|
302
304
|
return /* @__PURE__ */ i(
|
|
303
|
-
|
|
305
|
+
Ke,
|
|
304
306
|
{
|
|
305
307
|
scope: o,
|
|
306
308
|
open: p,
|
|
307
309
|
disabled: m,
|
|
308
|
-
triggerId:
|
|
310
|
+
triggerId: l,
|
|
309
311
|
children: /* @__PURE__ */ i(
|
|
310
|
-
|
|
312
|
+
Oe,
|
|
311
313
|
{
|
|
312
314
|
"data-orientation": r.orientation,
|
|
313
|
-
"data-state":
|
|
314
|
-
...
|
|
315
|
-
...
|
|
316
|
-
ref:
|
|
315
|
+
"data-state": se(p),
|
|
316
|
+
...s,
|
|
317
|
+
...n,
|
|
318
|
+
ref: a,
|
|
317
319
|
disabled: m,
|
|
318
320
|
open: p,
|
|
319
321
|
onOpenChange: (v) => {
|
|
@@ -325,52 +327,52 @@ var [Z, ke] = P(C), [ee, De] = P(
|
|
|
325
327
|
);
|
|
326
328
|
}
|
|
327
329
|
);
|
|
328
|
-
te.displayName =
|
|
330
|
+
te.displayName = N;
|
|
329
331
|
var re = "AccordionHeader", ne = u.forwardRef(
|
|
330
|
-
(e,
|
|
331
|
-
const { __scopeAccordion: o, ...t } = e,
|
|
332
|
+
(e, a) => {
|
|
333
|
+
const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(re, o);
|
|
332
334
|
return /* @__PURE__ */ i(
|
|
333
|
-
|
|
335
|
+
y.h3,
|
|
334
336
|
{
|
|
335
|
-
"data-orientation":
|
|
336
|
-
"data-state":
|
|
337
|
+
"data-orientation": n.orientation,
|
|
338
|
+
"data-state": se(r.open),
|
|
337
339
|
"data-disabled": r.disabled ? "" : void 0,
|
|
338
340
|
...t,
|
|
339
|
-
ref:
|
|
341
|
+
ref: a
|
|
340
342
|
}
|
|
341
343
|
);
|
|
342
344
|
}
|
|
343
345
|
);
|
|
344
346
|
ne.displayName = re;
|
|
345
|
-
var D = "AccordionTrigger",
|
|
346
|
-
(e,
|
|
347
|
-
const { __scopeAccordion: o, ...t } = e,
|
|
347
|
+
var D = "AccordionTrigger", ie = u.forwardRef(
|
|
348
|
+
(e, a) => {
|
|
349
|
+
const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(D, o), c = He(D, o), s = j(o);
|
|
348
350
|
return /* @__PURE__ */ i(L.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
349
|
-
|
|
351
|
+
Te,
|
|
350
352
|
{
|
|
351
353
|
"aria-disabled": r.open && !c.collapsible || void 0,
|
|
352
|
-
"data-orientation":
|
|
354
|
+
"data-orientation": n.orientation,
|
|
353
355
|
id: r.triggerId,
|
|
354
|
-
...
|
|
356
|
+
...s,
|
|
355
357
|
...t,
|
|
356
|
-
ref:
|
|
358
|
+
ref: a
|
|
357
359
|
}
|
|
358
360
|
) });
|
|
359
361
|
}
|
|
360
362
|
);
|
|
361
|
-
|
|
362
|
-
var
|
|
363
|
-
(e,
|
|
364
|
-
const { __scopeAccordion: o, ...t } = e,
|
|
363
|
+
ie.displayName = D;
|
|
364
|
+
var ae = "AccordionContent", ce = u.forwardRef(
|
|
365
|
+
(e, a) => {
|
|
366
|
+
const { __scopeAccordion: o, ...t } = e, n = E(C, o), r = G(ae, o), c = j(o);
|
|
365
367
|
return /* @__PURE__ */ i(
|
|
366
|
-
|
|
368
|
+
ke,
|
|
367
369
|
{
|
|
368
370
|
role: "region",
|
|
369
371
|
"aria-labelledby": r.triggerId,
|
|
370
|
-
"data-orientation":
|
|
372
|
+
"data-orientation": n.orientation,
|
|
371
373
|
...c,
|
|
372
374
|
...t,
|
|
373
|
-
ref:
|
|
375
|
+
ref: a,
|
|
374
376
|
style: {
|
|
375
377
|
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
376
378
|
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
@@ -380,110 +382,115 @@ var ie = "AccordionContent", ce = u.forwardRef(
|
|
|
380
382
|
);
|
|
381
383
|
}
|
|
382
384
|
);
|
|
383
|
-
ce.displayName =
|
|
384
|
-
function
|
|
385
|
+
ce.displayName = ae;
|
|
386
|
+
function se(e) {
|
|
385
387
|
return e ? "open" : "closed";
|
|
386
388
|
}
|
|
387
|
-
var
|
|
388
|
-
const
|
|
389
|
+
var Fe = X, ze = te, Be = ne, Ue = ie, qe = ce;
|
|
390
|
+
const Je = {
|
|
389
391
|
default: "shadow-none",
|
|
390
392
|
contained: "rounded-md border border-level-four",
|
|
391
393
|
separated: "rounded-none space-y-2"
|
|
392
|
-
},
|
|
394
|
+
}, Ye = {
|
|
393
395
|
default: "w-full py-4",
|
|
394
396
|
contained: "not-last:border-b border-level-four p-4",
|
|
395
397
|
separated: "border border-level-four rounded-md p-4"
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
}, le = ge({ variant: "default" }), de = ({
|
|
399
|
+
className: e,
|
|
400
|
+
ref: a,
|
|
401
|
+
variant: o = "default",
|
|
400
402
|
...t
|
|
401
403
|
}) => {
|
|
402
|
-
const { autoScroll:
|
|
403
|
-
autoScroll:
|
|
404
|
+
const { autoScroll: n = "never", scrollPadding: r = -20, children: c, ...s } = t, l = {
|
|
405
|
+
autoScroll: n,
|
|
404
406
|
scrollPadding: r
|
|
405
407
|
}, p = {
|
|
406
|
-
...
|
|
407
|
-
ref:
|
|
408
|
+
...s,
|
|
409
|
+
ref: a
|
|
408
410
|
};
|
|
409
|
-
return /* @__PURE__ */ i(
|
|
410
|
-
|
|
411
|
+
return /* @__PURE__ */ i(le.Provider, { value: { variant: o }, children: /* @__PURE__ */ i(
|
|
412
|
+
Fe,
|
|
411
413
|
{
|
|
412
414
|
...p,
|
|
415
|
+
className: w("accordion-wrapper flex flex-col", Je[o], e),
|
|
416
|
+
"data-auto-scroll": n,
|
|
417
|
+
"data-scroll-options": JSON.stringify(l),
|
|
418
|
+
"data-scroll-padding": r,
|
|
413
419
|
"data-slot": "accordion",
|
|
414
420
|
"data-testid": "spectral-accordion",
|
|
415
|
-
"data-scroll-options": JSON.stringify(s),
|
|
416
|
-
"data-auto-scroll": a,
|
|
417
|
-
"data-scroll-padding": r,
|
|
418
421
|
...t.type === "single" ? { collapsible: !0 } : {},
|
|
419
|
-
|
|
420
|
-
children: fe.map(c, (m) => ve(m) ? Ce(m, { variant: n }) : m)
|
|
422
|
+
children: be.map(c, (m) => Ae(m) ? he(m, { variant: o }) : m)
|
|
421
423
|
}
|
|
422
424
|
) });
|
|
423
425
|
};
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
426
|
+
de.displayName = "Accordion";
|
|
427
|
+
const pe = ({
|
|
428
|
+
className: e,
|
|
429
|
+
ref: a,
|
|
428
430
|
...o
|
|
429
431
|
}) => {
|
|
430
|
-
const { variant: t = "default" } =
|
|
431
|
-
return /* @__PURE__ */ i(
|
|
432
|
+
const { variant: t = "default" } = ye(le);
|
|
433
|
+
return /* @__PURE__ */ i(ze, { className: w("w-full", Ye[t], e), "data-slot": "accordion-item", "data-testid": "spectral-accordion-item", ref: a, ...o });
|
|
432
434
|
};
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
+
pe.displayName = "AccordionItem";
|
|
436
|
+
const me = ({
|
|
435
437
|
ref: e,
|
|
436
|
-
className:
|
|
438
|
+
className: a,
|
|
437
439
|
title: o,
|
|
438
440
|
subtitle: t,
|
|
439
|
-
...
|
|
441
|
+
...n
|
|
440
442
|
}) => {
|
|
441
|
-
const r =
|
|
442
|
-
(
|
|
443
|
-
typeof e == "function" ? e(
|
|
443
|
+
const r = xe(null), c = Ce(r), s = Ie(
|
|
444
|
+
(l) => {
|
|
445
|
+
typeof e == "function" ? e(l) : e && (e.current = l), r.current = l;
|
|
444
446
|
},
|
|
445
447
|
[e]
|
|
446
448
|
);
|
|
447
|
-
return /* @__PURE__ */ i(
|
|
448
|
-
|
|
449
|
+
return /* @__PURE__ */ i(Be, { className: "m-0 flex", children: /* @__PURE__ */ K(
|
|
450
|
+
Ue,
|
|
449
451
|
{
|
|
450
|
-
|
|
452
|
+
className: w("text-text-primary flex flex-1 items-center justify-between text-sm font-normal transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", a),
|
|
451
453
|
"data-slot": "accordion-trigger",
|
|
452
454
|
"data-testid": "spectral-accordion-trigger",
|
|
453
|
-
className: w("text-text-primary flex flex-1 items-center justify-between text-sm font-normal transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", n),
|
|
454
455
|
onClick: c,
|
|
455
|
-
|
|
456
|
+
ref: s,
|
|
457
|
+
...n,
|
|
456
458
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ K("div", { className: "flex w-full flex-col space-y-0.5 text-start", children: [
|
|
458
460
|
/* @__PURE__ */ i("div", { className: "text-text-primary text-base font-medium", children: o }),
|
|
459
461
|
t && /* @__PURE__ */ i("div", { className: "text-text-secondary text-sm font-normal", children: t })
|
|
460
462
|
] }),
|
|
461
|
-
/* @__PURE__ */ i(
|
|
463
|
+
/* @__PURE__ */ i(ve, { className: "shrink-0 transition-transform duration-200" })
|
|
462
464
|
]
|
|
463
465
|
}
|
|
464
466
|
) });
|
|
465
467
|
};
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
+
me.displayName = "AccordionTrigger";
|
|
469
|
+
const ue = ({
|
|
468
470
|
ref: e,
|
|
469
|
-
className:
|
|
471
|
+
className: a,
|
|
470
472
|
children: o,
|
|
471
473
|
...t
|
|
472
474
|
}) => /* @__PURE__ */ i(
|
|
473
|
-
|
|
475
|
+
qe,
|
|
474
476
|
{
|
|
475
|
-
|
|
477
|
+
className: w("motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden pt-4 text-sm", a),
|
|
476
478
|
"data-slot": "accordion-content",
|
|
477
479
|
"data-testid": "spectral-accordion-content",
|
|
478
|
-
|
|
480
|
+
ref: e,
|
|
479
481
|
...t,
|
|
480
482
|
children: /* @__PURE__ */ i("div", { className: "px-1 pt-0 pb-4", "data-slot": "accordion-content-inner", children: o })
|
|
481
483
|
}
|
|
482
484
|
);
|
|
483
|
-
|
|
485
|
+
ue.displayName = "AccordionContent";
|
|
486
|
+
const gt = Object.assign(de, {
|
|
487
|
+
Content: ue,
|
|
488
|
+
Item: pe,
|
|
489
|
+
Trigger: me
|
|
490
|
+
});
|
|
484
491
|
export {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
492
|
+
gt as Accordion,
|
|
493
|
+
ue as AccordionContent,
|
|
494
|
+
pe as AccordionItem,
|
|
495
|
+
me as AccordionTrigger
|
|
489
496
|
};
|
|
@@ -11,36 +11,36 @@ export declare const AlertBase: {
|
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const AlertHeader: {
|
|
14
|
-
({
|
|
14
|
+
({ className, ref, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const AlertTitle: {
|
|
20
|
-
({
|
|
20
|
+
({ className, ref, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
21
21
|
ref?: Ref<HTMLDivElement>;
|
|
22
22
|
variant: AlertVariant;
|
|
23
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
export declare const AlertDescription: {
|
|
27
|
-
({
|
|
27
|
+
({ className, ref, variant, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
28
28
|
ref?: Ref<HTMLDivElement>;
|
|
29
29
|
variant: AlertVariant;
|
|
30
30
|
}): import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
export declare const AlertCloseButton: {
|
|
34
|
-
({
|
|
34
|
+
({ className, ref, variant, ...props }: HTMLAttributes<SVGSVGElement> & {
|
|
35
35
|
ref?: Ref<SVGSVGElement>;
|
|
36
36
|
variant: AlertVariant;
|
|
37
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
displayName: string;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
interface AlertPortalProps {
|
|
41
41
|
children: ReactNode;
|
|
42
42
|
container?: Element | DocumentFragment;
|
|
43
|
-
}
|
|
44
|
-
export declare
|
|
43
|
+
}
|
|
44
|
+
export declare const AlertPortal: ({ children, container }: AlertPortalProps) => import('react').ReactPortal | null;
|
|
45
45
|
export {};
|
|
46
46
|
//# sourceMappingURL=AlertBase.d.ts.map
|