@wirecore/wirelayer-react 0.6.0 → 0.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/Checkbox-BMRax6m4.js +49 -0
- package/dist/ContextMenu-C6ZaMtqf.js +1511 -0
- package/dist/{Highlight-CX30-nP7.js → Highlight-43-H9459.js} +93 -86
- package/dist/Input-CtYSQznO.js +120 -0
- package/dist/PasswordInput-dpeKVREo.js +425 -0
- package/dist/Select-C2CiPTCK.js +256 -0
- package/dist/Slider-Bfm_jjYE.js +80 -0
- package/dist/{Tree-BiPIkmwT.js → Tree-DVjwp6FG.js} +1 -1
- package/dist/chart.js +1 -1
- package/dist/components/Alert/Alert.d.ts +3 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/AngleSlider/AngleSlider.d.ts +3 -1
- package/dist/components/AngleSlider/AngleSlider.d.ts.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +3 -1
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/CascadeSelect/CascadeSelect.d.ts +3 -1
- package/dist/components/CascadeSelect/CascadeSelect.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +9 -5
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +10 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts +6 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/Confirm/confirm.d.ts +7 -0
- package/dist/components/Confirm/confirm.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +12 -3
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts +3 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +3 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/DurationInput/DurationInput.d.ts +3 -1
- package/dist/components/DurationInput/DurationInput.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +3 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +7 -2
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Knob/Knob.d.ts +3 -1
- package/dist/components/Knob/Knob.d.ts.map +1 -1
- package/dist/components/Listbox/Listbox.d.ts +3 -1
- package/dist/components/Listbox/Listbox.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts +27 -3
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts +3 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/NativeSelect/NativeSelect.d.ts +9 -6
- package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +2 -2
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PinInput/PinInput.d.ts +3 -1
- package/dist/components/PinInput/PinInput.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts +12 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/QuarterPicker/QuarterPicker.d.ts +3 -1
- package/dist/components/QuarterPicker/QuarterPicker.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +8 -6
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
- package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
- package/dist/components/RadioGroup/context.d.ts +3 -0
- package/dist/components/RadioGroup/context.d.ts.map +1 -0
- package/dist/components/Rating/Rating.d.ts +3 -1
- package/dist/components/Rating/Rating.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -5
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +10 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/list.d.ts +6 -1
- package/dist/components/Select/list.d.ts.map +1 -1
- package/dist/components/SelectionCard/SelectionCard.d.ts +1 -1
- package/dist/components/SelectionCard/SelectionCard.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +3 -1
- package/dist/components/TagsInput/TagsInput.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +3 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimeRangePicker/TimeRangePicker.d.ts +3 -1
- package/dist/components/TimeRangePicker/TimeRangePicker.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts +3 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts.map +1 -1
- package/dist/components/YearPicker/YearPicker.d.ts +3 -1
- package/dist/components/YearPicker/YearPicker.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +10 -2
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table.js +952 -949
- package/dist/editor.js +1 -1
- package/dist/form/FormField.d.ts +5 -1
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form.js +7 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3376 -3243
- package/dist/label-for-DYgV5EwH.js +9 -0
- package/dist/pdf.js +3 -3
- package/dist/sources/ActionBar.css +1 -0
- package/dist/sources/AppShell.css +1 -0
- package/dist/sources/ChatPrompt.css +1 -0
- package/dist/sources/Gallery.css +1 -0
- package/dist/sources/IconButton.css +1 -0
- package/dist/sources/Image.css +1 -0
- package/dist/sources/ImageCropper.css +1 -0
- package/dist/sources/InlineEdit.css +1 -0
- package/dist/sources/Marquee.css +1 -0
- package/dist/sources/MegaMenu.css +1 -0
- package/dist/sources/Menubar.css +1 -0
- package/dist/sources/OrderList.css +1 -0
- package/dist/sources/PickList.css +1 -0
- package/dist/sources/ScrollTop.css +1 -0
- package/dist/utils/label-for.d.ts +3 -0
- package/dist/utils/label-for.d.ts.map +1 -0
- package/dist/virtual/VirtualSelect.d.ts +1 -1
- package/dist/virtual/VirtualSelect.d.ts.map +1 -1
- package/dist/virtual.js +245 -236
- package/fonts.css +2 -0
- package/llms-full.txt +237 -25
- package/llms.txt +9 -5
- package/package.json +7 -3
- package/theme.css +14 -0
- package/dist/Checkbox-CZTyKWId.js +0 -44
- package/dist/ContextMenu-CjDI7Jy5.js +0 -1434
- package/dist/Input-D8U-Auys.js +0 -109
- package/dist/PasswordInput-DivSjtN8.js +0 -420
- package/dist/Select-Cx3KwSzU.js +0 -234
- package/dist/Slider-x-SsBc1d.js +0 -74
package/dist/Select-Cx3KwSzU.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
-
import { a as n, c as r, n as i, o as a } from "./Highlight-CX30-nP7.js";
|
|
4
|
-
import { select as o, spinner as s } from "@wirecore/wirelayer-recipes";
|
|
5
|
-
import { ChevronDown as c, LoaderCircle as l, X as u } from "lucide-react";
|
|
6
|
-
import { useEffect as d, useId as f, useMemo as p, useState as ee } from "react";
|
|
7
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
-
import { Portal as te } from "@ark-ui/react/portal";
|
|
9
|
-
import { createListCollection as ne } from "@ark-ui/react/collection";
|
|
10
|
-
import { Select as _ } from "@ark-ui/react/select";
|
|
11
|
-
//#region src/components/Spinner/Spinner.tsx
|
|
12
|
-
var v = 2 * Math.PI * 9;
|
|
13
|
-
function y({ classes: n, size: r, label: i, value: a, className: o, ...c }) {
|
|
14
|
-
let u = t("spinner", s, n), d = e(), f = u({ size: r });
|
|
15
|
-
if (a !== void 0) {
|
|
16
|
-
let e = Math.min(100, Math.max(0, a));
|
|
17
|
-
return /* @__PURE__ */ h("span", {
|
|
18
|
-
...c,
|
|
19
|
-
className: f.base({ class: o }),
|
|
20
|
-
role: "progressbar",
|
|
21
|
-
"aria-label": i ?? d.common.loading,
|
|
22
|
-
"aria-valuemin": 0,
|
|
23
|
-
"aria-valuemax": 100,
|
|
24
|
-
"aria-valuenow": e,
|
|
25
|
-
"aria-valuetext": `${Math.round(e)} %`,
|
|
26
|
-
children: /* @__PURE__ */ g("svg", {
|
|
27
|
-
className: f.ring(),
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
"aria-hidden": "true",
|
|
30
|
-
children: [/* @__PURE__ */ h("circle", {
|
|
31
|
-
className: f.ringTrack(),
|
|
32
|
-
cx: "12",
|
|
33
|
-
cy: "12",
|
|
34
|
-
r: "9",
|
|
35
|
-
strokeWidth: "3"
|
|
36
|
-
}), /* @__PURE__ */ h("circle", {
|
|
37
|
-
className: f.ringRange(),
|
|
38
|
-
cx: "12",
|
|
39
|
-
cy: "12",
|
|
40
|
-
r: "9",
|
|
41
|
-
strokeWidth: "3",
|
|
42
|
-
strokeLinecap: "round",
|
|
43
|
-
strokeDasharray: `${e / 100 * v} ${v}`
|
|
44
|
-
})]
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ g("span", {
|
|
49
|
-
...c,
|
|
50
|
-
className: f.base({ class: o }),
|
|
51
|
-
role: "status",
|
|
52
|
-
children: [/* @__PURE__ */ h(l, {
|
|
53
|
-
className: f.icon(),
|
|
54
|
-
"aria-hidden": "true"
|
|
55
|
-
}), /* @__PURE__ */ h("span", {
|
|
56
|
-
className: f.label(),
|
|
57
|
-
children: i ?? d.common.loading
|
|
58
|
-
})]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/components/Select/Select.tsx
|
|
63
|
-
function b({ classes: s, items: v, value: y, defaultValue: b, onValueChange: re, placeholder: x, disabled: ie, invalid: ae, required: oe, name: se, itemValue: ce, itemLabel: le, itemDisabled: S, itemGroup: ue, itemKeywords: de, valueKey: fe, clearable: C, loading: w, loadingText: pe, size: me, filter: T, manualFilter: E, onFilterChange: D, emptyText: he, hasMore: ge, onLoadMore: _e, dataSource: O, minSearchLength: ve, pageSize: ye, standalone: k, renderItem: A, renderValue: j, className: M, style: N, onKeyDown: P, ...F }) {
|
|
64
|
-
let I = t("select", o, s)({
|
|
65
|
-
size: me,
|
|
66
|
-
clearable: C
|
|
67
|
-
}), L = e(), R = L.select, z = {
|
|
68
|
-
itemValue: ce,
|
|
69
|
-
itemLabel: le,
|
|
70
|
-
itemDisabled: S,
|
|
71
|
-
itemGroup: ue,
|
|
72
|
-
itemKeywords: de,
|
|
73
|
-
valueKey: fe
|
|
74
|
-
}, [B, V] = ee(""), H = r({
|
|
75
|
-
items: v,
|
|
76
|
-
source: O,
|
|
77
|
-
accessors: z,
|
|
78
|
-
pageSize: ye,
|
|
79
|
-
minSearchLength: ve
|
|
80
|
-
}), { options: U, groups: be, ordered: W, firstFor: xe } = n(H.items, z, T && !E && !O ? B : ""), G = p(() => [...U, ...H.resolvedOptions], [U, H.resolvedOptions]), { selected: K, keys: q, commit: J, commitKeys: Se } = a({
|
|
81
|
-
multiple: !1,
|
|
82
|
-
value: y,
|
|
83
|
-
defaultValue: b,
|
|
84
|
-
accessors: z,
|
|
85
|
-
items: G,
|
|
86
|
-
onChange: re
|
|
87
|
-
}), Ce = q.join("\0");
|
|
88
|
-
d(() => {
|
|
89
|
-
H.resolve(q, G);
|
|
90
|
-
}, [Ce, O]);
|
|
91
|
-
let Y = w || H.loading, X = K[0], we = p(() => ne({
|
|
92
|
-
items: W,
|
|
93
|
-
itemToString: (e) => e.label,
|
|
94
|
-
itemToValue: (e) => e.key,
|
|
95
|
-
isItemDisabled: (e) => e.disabled
|
|
96
|
-
}), [W]), Z = f(), Q = X?.icon, Te = {
|
|
97
|
-
item: I.item(),
|
|
98
|
-
itemText: I.itemText(),
|
|
99
|
-
icon: I.icon(),
|
|
100
|
-
itemIndicator: I.itemIndicator(),
|
|
101
|
-
itemBody: I.itemBody(),
|
|
102
|
-
itemDescription: I.itemDescription(),
|
|
103
|
-
group: I.group(),
|
|
104
|
-
groupLabel: I.groupLabel(),
|
|
105
|
-
loading: I.loading(),
|
|
106
|
-
loadingIcon: I.loadingIcon(),
|
|
107
|
-
sentinel: I.sentinel(),
|
|
108
|
-
empty: I.empty()
|
|
109
|
-
}, $ = /* @__PURE__ */ h(i, {
|
|
110
|
-
parts: _,
|
|
111
|
-
groups: be,
|
|
112
|
-
classes: Te,
|
|
113
|
-
loading: Y,
|
|
114
|
-
loadingText: pe ?? L.common.loading,
|
|
115
|
-
hasMore: ge || H.hasMore,
|
|
116
|
-
onLoadMore: () => O ? H.loadMore() : _e?.(),
|
|
117
|
-
emptyText: he ?? H.emptyText ?? (B ? L.common.noResults : L.common.empty),
|
|
118
|
-
renderItem: A
|
|
119
|
-
});
|
|
120
|
-
function Ee(e) {
|
|
121
|
-
P?.(e), C && K.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), J([]));
|
|
122
|
-
}
|
|
123
|
-
function De(e, t) {
|
|
124
|
-
V(t), D?.(t), O && H.search(t);
|
|
125
|
-
let n = E || O ? void 0 : xe(t);
|
|
126
|
-
n && requestAnimationFrame(() => e.setHighlightValue(n.key));
|
|
127
|
-
}
|
|
128
|
-
return /* @__PURE__ */ g(_.Root, {
|
|
129
|
-
className: I.base({ class: M }),
|
|
130
|
-
style: N,
|
|
131
|
-
collection: we,
|
|
132
|
-
value: q,
|
|
133
|
-
onValueChange: (e) => Se(e.value, e.items),
|
|
134
|
-
onOpenChange: (e) => {
|
|
135
|
-
e.open && H.open(), !e.open && B && (V(""), D?.(""), O && H.search(""));
|
|
136
|
-
},
|
|
137
|
-
disabled: ie,
|
|
138
|
-
invalid: ae,
|
|
139
|
-
required: oe,
|
|
140
|
-
name: se,
|
|
141
|
-
...k ? { ids: {} } : {},
|
|
142
|
-
positioning: {
|
|
143
|
-
sameWidth: !0,
|
|
144
|
-
gutter: 4
|
|
145
|
-
},
|
|
146
|
-
composite: !T,
|
|
147
|
-
lazyMount: !0,
|
|
148
|
-
unmountOnExit: !0,
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ g(_.Control, {
|
|
151
|
-
...C ? { className: I.control() } : {},
|
|
152
|
-
children: [/* @__PURE__ */ g(_.Trigger, {
|
|
153
|
-
...F,
|
|
154
|
-
className: I.trigger(),
|
|
155
|
-
"aria-busy": w || void 0,
|
|
156
|
-
onKeyDown: Ee,
|
|
157
|
-
children: [/* @__PURE__ */ h("span", {
|
|
158
|
-
className: I.value(),
|
|
159
|
-
children: j && X ? j(X.item) : /* @__PURE__ */ g(m, { children: [Q && /* @__PURE__ */ h(Q, {
|
|
160
|
-
className: I.icon(),
|
|
161
|
-
"aria-hidden": "true"
|
|
162
|
-
}), /* @__PURE__ */ h(_.ValueText, {
|
|
163
|
-
placeholder: x ?? L.common.placeholder,
|
|
164
|
-
children: X?.label || void 0
|
|
165
|
-
})] })
|
|
166
|
-
}), /* @__PURE__ */ h(_.Indicator, {
|
|
167
|
-
className: I.indicator(),
|
|
168
|
-
children: w ? /* @__PURE__ */ h(l, {
|
|
169
|
-
className: I.spinner(),
|
|
170
|
-
"aria-hidden": "true"
|
|
171
|
-
}) : /* @__PURE__ */ h(c, {
|
|
172
|
-
className: I.indicatorIcon(),
|
|
173
|
-
"aria-hidden": "true"
|
|
174
|
-
})
|
|
175
|
-
})]
|
|
176
|
-
}), C && /* @__PURE__ */ h(_.Context, { children: (e) => X && !e.disabled && /* @__PURE__ */ h("button", {
|
|
177
|
-
type: "button",
|
|
178
|
-
tabIndex: -1,
|
|
179
|
-
className: I.clear(),
|
|
180
|
-
"aria-label": R.clear,
|
|
181
|
-
onClick: () => {
|
|
182
|
-
J([]), e.focus();
|
|
183
|
-
},
|
|
184
|
-
children: /* @__PURE__ */ h(u, {
|
|
185
|
-
className: I.clearIcon(),
|
|
186
|
-
"aria-hidden": "true"
|
|
187
|
-
})
|
|
188
|
-
}) })]
|
|
189
|
-
}),
|
|
190
|
-
/* @__PURE__ */ h(te, { children: /* @__PURE__ */ h(_.Positioner, { children: /* @__PURE__ */ h(_.Content, {
|
|
191
|
-
className: I.content(),
|
|
192
|
-
"aria-busy": Y || void 0,
|
|
193
|
-
"aria-label": T ? F["aria-label"] : void 0,
|
|
194
|
-
children: T ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
195
|
-
className: I.header(),
|
|
196
|
-
children: /* @__PURE__ */ h(_.Context, { children: (e) => /* @__PURE__ */ h("input", {
|
|
197
|
-
type: "text",
|
|
198
|
-
role: "combobox",
|
|
199
|
-
autoComplete: "off",
|
|
200
|
-
"aria-autocomplete": "list",
|
|
201
|
-
"aria-expanded": "true",
|
|
202
|
-
"data-autofocus": "",
|
|
203
|
-
"aria-controls": Z,
|
|
204
|
-
"aria-activedescendant": e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0,
|
|
205
|
-
"aria-label": R.filter,
|
|
206
|
-
placeholder: L.combobox.search,
|
|
207
|
-
value: B,
|
|
208
|
-
className: I.search(),
|
|
209
|
-
onChange: (t) => De(e, t.target.value),
|
|
210
|
-
onKeyDown: (e) => {
|
|
211
|
-
[
|
|
212
|
-
" ",
|
|
213
|
-
"Home",
|
|
214
|
-
"End"
|
|
215
|
-
].includes(e.key) && e.stopPropagation();
|
|
216
|
-
}
|
|
217
|
-
}) })
|
|
218
|
-
}), /* @__PURE__ */ h(_.List, {
|
|
219
|
-
id: Z,
|
|
220
|
-
className: I.list(),
|
|
221
|
-
children: $
|
|
222
|
-
})] }) : $
|
|
223
|
-
}) }) }),
|
|
224
|
-
/* @__PURE__ */ h(_.HiddenSelect, {}),
|
|
225
|
-
O && /* @__PURE__ */ h("span", {
|
|
226
|
-
role: "status",
|
|
227
|
-
className: I.status(),
|
|
228
|
-
children: H.announcement
|
|
229
|
-
})
|
|
230
|
-
]
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
//#endregion
|
|
234
|
-
export { y as n, b as t };
|
package/dist/Slider-x-SsBc1d.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
-
import { slider as n, snapToMarks as r } from "@wirecore/wirelayer-recipes";
|
|
4
|
-
import { useId as i, useState as a } from "react";
|
|
5
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
-
import { Slider as c } from "@ark-ui/react/slider";
|
|
7
|
-
//#region src/components/Slider/Slider.tsx
|
|
8
|
-
function l({ classes: l, value: u, defaultValue: d = [0], onValueChange: f, onValueChangeEnd: p, min: m = 0, max: h = 100, step: g = 1, label: _, thumbLabels: v, showValue: y = !0, formatValue: b = String, disabled: x, name: S, orientation: C, marks: w, restrictToMarks: T = !1, minRange: E, className: D, ...O }) {
|
|
9
|
-
let k = t("slider", n, l)({ withMarks: !!w?.length }), A = (w ?? []).map((e) => typeof e == "number" ? { value: e } : e), [j, M] = a(d), N = T && A.length > 0, P = N ? u ?? j : u, F = e(), I = i(), L = `${I}label`, R = (u ?? d).length;
|
|
10
|
-
return /* @__PURE__ */ s(c.Root, {
|
|
11
|
-
...O,
|
|
12
|
-
className: k.base({ class: D }),
|
|
13
|
-
ids: { label: L },
|
|
14
|
-
value: P,
|
|
15
|
-
defaultValue: d,
|
|
16
|
-
onValueChange: (e) => {
|
|
17
|
-
if (!N) return f?.(e.value);
|
|
18
|
-
let t = r(e.value, P ?? d, A.map((e) => e.value));
|
|
19
|
-
M(t), f?.(t);
|
|
20
|
-
},
|
|
21
|
-
onValueChangeEnd: (e) => p?.(e.value),
|
|
22
|
-
min: m,
|
|
23
|
-
max: h,
|
|
24
|
-
step: g,
|
|
25
|
-
disabled: x,
|
|
26
|
-
name: S,
|
|
27
|
-
orientation: C,
|
|
28
|
-
minStepsBetweenThumbs: E ? Math.ceil(E / g) : void 0,
|
|
29
|
-
getAriaValueText: (e) => b(e.value),
|
|
30
|
-
children: [/* @__PURE__ */ s("div", {
|
|
31
|
-
className: k.header(),
|
|
32
|
-
children: [/* @__PURE__ */ o(c.Label, {
|
|
33
|
-
id: L,
|
|
34
|
-
className: k.label(),
|
|
35
|
-
children: _
|
|
36
|
-
}), y && /* @__PURE__ */ o(c.Context, { children: (e) => /* @__PURE__ */ o("span", {
|
|
37
|
-
className: k.value(),
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
children: e.value.map(b).join(" – ")
|
|
40
|
-
}) })]
|
|
41
|
-
}), /* @__PURE__ */ s(c.Control, {
|
|
42
|
-
className: k.control(),
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */ o(c.Track, {
|
|
45
|
-
className: k.track(),
|
|
46
|
-
children: /* @__PURE__ */ o(c.Range, { className: k.range() })
|
|
47
|
-
}),
|
|
48
|
-
Array.from({ length: R }, (e, t) => /* @__PURE__ */ s(c.Thumb, {
|
|
49
|
-
index: t,
|
|
50
|
-
className: k.thumb(),
|
|
51
|
-
"aria-labelledby": R > 1 ? `${L} ${I}thumb${t}` : L,
|
|
52
|
-
children: [R > 1 && /* @__PURE__ */ o("span", {
|
|
53
|
-
id: `${I}thumb${t}`,
|
|
54
|
-
className: k.thumbLabel(),
|
|
55
|
-
children: (v ?? F.slider.thumbs)[t]
|
|
56
|
-
}), /* @__PURE__ */ o(c.HiddenInput, {})]
|
|
57
|
-
}, t)),
|
|
58
|
-
A.length > 0 && /* @__PURE__ */ o(c.MarkerGroup, {
|
|
59
|
-
className: k.markerGroup(),
|
|
60
|
-
children: A.map((e) => /* @__PURE__ */ s(c.Marker, {
|
|
61
|
-
value: e.value,
|
|
62
|
-
className: k.marker(),
|
|
63
|
-
children: [/* @__PURE__ */ o("span", {
|
|
64
|
-
className: k.markerTick(),
|
|
65
|
-
"data-orientation": C ?? "horizontal"
|
|
66
|
-
}), e.label]
|
|
67
|
-
}, e.value))
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
})]
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
export { l as t };
|