@wirecore/wirelayer-react 0.6.0 → 0.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/Checkbox-BMRax6m4.js +49 -0
- package/dist/ContextMenu-BD72S5n6.js +1452 -0
- package/dist/{Highlight-CX30-nP7.js → Highlight-43-H9459.js} +93 -86
- package/dist/Input-C8T3WLd5.js +119 -0
- package/dist/PasswordInput-SjO66gZB.js +422 -0
- package/dist/Select-7rfeNmJb.js +242 -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/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 +1 -1
- 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 +1 -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/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 +3 -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/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/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/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- 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/QuarterPicker/QuarterPicker.d.ts +3 -1
- package/dist/components/QuarterPicker/QuarterPicker.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -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/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 +3231 -3150
- 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 +180 -3
- package/llms.txt +4 -1
- 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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { i as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
-
import { DataKeyResolver as n,
|
|
4
|
-
import { Check as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useFilter as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Highlight as
|
|
3
|
+
import { DataKeyResolver as n, checkListValues as r, createDataList as i, dataListAnnouncement as a, filterListOptions as o, groupListOptions as s, highlight as c, highlightChunks as l, indexListOptions as u, listOptionsForValues as d, listValues as f, toListOptions as p } from "@wirecore/wirelayer-recipes";
|
|
4
|
+
import { Check as m, LoaderCircle as h } from "lucide-react";
|
|
5
|
+
import { Fragment as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
6
|
+
import { useFilter as x } from "@ark-ui/react/locale";
|
|
7
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
8
|
+
import { Highlight as T } from "@ark-ui/react/highlight";
|
|
9
9
|
//#region src/utils/data-source.ts
|
|
10
|
-
var
|
|
10
|
+
var E = {
|
|
11
11
|
status: "idle",
|
|
12
12
|
items: [],
|
|
13
13
|
loadingMore: !1,
|
|
@@ -15,48 +15,48 @@ var T = {
|
|
|
15
15
|
search: "",
|
|
16
16
|
tooShort: !1
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
let { translations: l, locale: u } = e(), [d, f] =
|
|
18
|
+
function D({ source: t, pageSize: r, minSearchLength: o, debounce: s, query: c }) {
|
|
19
|
+
let { translations: l, locale: u } = e(), [d, f] = b(E), [p, m] = b([]), h = y(void 0), g = y(void 0), x = y({
|
|
20
20
|
source: t,
|
|
21
|
-
pageSize:
|
|
21
|
+
pageSize: r,
|
|
22
22
|
minSearchLength: o,
|
|
23
23
|
debounce: s,
|
|
24
24
|
query: c
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
_(() => {
|
|
27
27
|
x.current = {
|
|
28
28
|
source: t,
|
|
29
|
-
pageSize:
|
|
29
|
+
pageSize: r,
|
|
30
30
|
minSearchLength: o,
|
|
31
31
|
debounce: s,
|
|
32
32
|
query: c
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
35
|
let S = JSON.stringify(c ?? {});
|
|
36
|
-
return
|
|
36
|
+
return _(() => {
|
|
37
37
|
t && (h.current?.configure({
|
|
38
38
|
source: t,
|
|
39
|
-
pageSize:
|
|
39
|
+
pageSize: r,
|
|
40
40
|
minSearchLength: o,
|
|
41
41
|
debounce: s,
|
|
42
42
|
query: x.current.query
|
|
43
|
-
}),
|
|
43
|
+
}), g.current?.configure({ source: t }));
|
|
44
44
|
}, [
|
|
45
45
|
t,
|
|
46
|
-
|
|
46
|
+
r,
|
|
47
47
|
o,
|
|
48
48
|
s,
|
|
49
49
|
S
|
|
50
|
-
]),
|
|
51
|
-
h.current?.dispose(),
|
|
52
|
-
}, []),
|
|
50
|
+
]), _(() => () => {
|
|
51
|
+
h.current?.dispose(), g.current?.dispose(), h.current = void 0, g.current = void 0;
|
|
52
|
+
}, []), v(() => {
|
|
53
53
|
let e = () => {
|
|
54
54
|
let { source: e, ...t } = x.current;
|
|
55
|
-
if (e) return h.current ??=
|
|
55
|
+
if (e) return h.current ??= i({
|
|
56
56
|
source: e,
|
|
57
57
|
...t,
|
|
58
58
|
onChange: f
|
|
59
|
-
}),
|
|
59
|
+
}), g.current ??= new n({
|
|
60
60
|
source: e,
|
|
61
61
|
onChange: m
|
|
62
62
|
}), h.current;
|
|
@@ -71,9 +71,9 @@ function E({ source: t, pageSize: a, minSearchLength: o, debounce: s, query: c }
|
|
|
71
71
|
retry: () => void h.current?.retry(),
|
|
72
72
|
refresh: () => void e()?.refresh(),
|
|
73
73
|
resolveKeys: (t) => {
|
|
74
|
-
e() && t.length &&
|
|
74
|
+
e() && t.length && g.current.resolve(t).catch(() => void 0);
|
|
75
75
|
},
|
|
76
|
-
announcement: t ?
|
|
76
|
+
announcement: t ? a(d, l, u, o ?? 0) : ""
|
|
77
77
|
};
|
|
78
78
|
}, [
|
|
79
79
|
t,
|
|
@@ -84,17 +84,17 @@ function E({ source: t, pageSize: a, minSearchLength: o, debounce: s, query: c }
|
|
|
84
84
|
o
|
|
85
85
|
]);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
let { translations: o } = e(), s =
|
|
87
|
+
function O({ items: t, source: n, accessors: r, pageSize: i, minSearchLength: a }) {
|
|
88
|
+
let { translations: o } = e(), s = D({
|
|
89
89
|
source: n,
|
|
90
90
|
pageSize: i,
|
|
91
91
|
minSearchLength: a
|
|
92
|
-
}), { itemValue: c, itemLabel: l, itemDisabled: u, itemGroup: d, itemKeywords:
|
|
92
|
+
}), { itemValue: c, itemLabel: l, itemDisabled: u, itemGroup: d, itemKeywords: f, valueKey: m } = r, h = v(() => p(s.resolved, {
|
|
93
93
|
itemValue: c,
|
|
94
94
|
itemLabel: l,
|
|
95
95
|
itemDisabled: u,
|
|
96
96
|
itemGroup: d,
|
|
97
|
-
itemKeywords:
|
|
97
|
+
itemKeywords: f,
|
|
98
98
|
valueKey: m
|
|
99
99
|
}), [
|
|
100
100
|
s.resolved,
|
|
@@ -102,7 +102,7 @@ function D({ items: t, source: n, accessors: r, pageSize: i, minSearchLength: a
|
|
|
102
102
|
l,
|
|
103
103
|
u,
|
|
104
104
|
d,
|
|
105
|
-
|
|
105
|
+
f,
|
|
106
106
|
m
|
|
107
107
|
]), g = o.dataSource;
|
|
108
108
|
return {
|
|
@@ -121,13 +121,13 @@ function D({ items: t, source: n, accessors: r, pageSize: i, minSearchLength: a
|
|
|
121
121
|
}
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/components/Select/list.tsx
|
|
124
|
-
function
|
|
125
|
-
let { contains: r } =
|
|
124
|
+
function k(e, t, n = "") {
|
|
125
|
+
let { contains: r } = x({
|
|
126
126
|
sensitivity: "base",
|
|
127
127
|
usage: "sort"
|
|
128
|
-
}), { itemValue: i, itemLabel:
|
|
128
|
+
}), { itemValue: i, itemLabel: a, itemDisabled: c, itemGroup: l, itemKeywords: u, valueKey: d } = t, f = v(() => p(e, {
|
|
129
129
|
itemValue: i,
|
|
130
|
-
itemLabel:
|
|
130
|
+
itemLabel: a,
|
|
131
131
|
itemDisabled: c,
|
|
132
132
|
itemGroup: l,
|
|
133
133
|
itemKeywords: u,
|
|
@@ -135,102 +135,109 @@ function O(e, t, n = "") {
|
|
|
135
135
|
}), [
|
|
136
136
|
e,
|
|
137
137
|
i,
|
|
138
|
-
|
|
138
|
+
a,
|
|
139
139
|
c,
|
|
140
140
|
l,
|
|
141
141
|
u,
|
|
142
142
|
d
|
|
143
|
-
]), m =
|
|
144
|
-
|
|
143
|
+
]), m = v(() => o(f, n, r), [
|
|
144
|
+
f,
|
|
145
145
|
n,
|
|
146
146
|
r
|
|
147
|
-
]), h =
|
|
147
|
+
]), h = v(() => s(m), [m]);
|
|
148
148
|
return {
|
|
149
|
-
options:
|
|
149
|
+
options: f,
|
|
150
150
|
visible: m,
|
|
151
151
|
groups: h,
|
|
152
|
-
ordered:
|
|
153
|
-
firstFor: (e) => o(
|
|
152
|
+
ordered: v(() => h.flatMap((e) => e.options), [h]),
|
|
153
|
+
firstFor: (e) => s(o(f, e, r)).flatMap((e) => e.options).find((e) => !e.disabled)
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
let [
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
function A({ multiple: e, value: t, defaultValue: n, accessors: i, items: a, onChange: o, check: s }) {
|
|
157
|
+
let [c, l] = b(n ?? (e ? [] : null)), [p, m] = b([]), h = t === void 0 ? c : t, g = d(e ? h ?? [] : f(h, a), u(a, p), i), v = g.map((e) => e.key), y = g.filter((e) => e.unknown).map((e) => e.key).join();
|
|
158
|
+
_(() => {
|
|
159
|
+
s?.ready && y && r(s.component, g);
|
|
160
|
+
}, [
|
|
161
|
+
s?.ready,
|
|
162
|
+
s?.component,
|
|
163
|
+
y
|
|
164
|
+
]);
|
|
165
|
+
function x(t) {
|
|
166
|
+
m(t);
|
|
160
167
|
let n = t.map((e) => e.value), r = e ? n : n[0] ?? null;
|
|
161
|
-
|
|
168
|
+
l(r), o?.(r);
|
|
162
169
|
}
|
|
163
|
-
function
|
|
164
|
-
let n =
|
|
165
|
-
|
|
170
|
+
function S(e, t = []) {
|
|
171
|
+
let n = u(a, t, g);
|
|
172
|
+
x(e.map((e) => n.get(e)).filter((e) => e !== void 0));
|
|
166
173
|
}
|
|
167
174
|
return {
|
|
168
|
-
selected:
|
|
169
|
-
keys:
|
|
170
|
-
commit:
|
|
171
|
-
commitKeys:
|
|
175
|
+
selected: g,
|
|
176
|
+
keys: v,
|
|
177
|
+
commit: x,
|
|
178
|
+
commitKeys: S
|
|
172
179
|
};
|
|
173
180
|
}
|
|
174
|
-
function
|
|
175
|
-
let i =
|
|
176
|
-
return
|
|
181
|
+
function j({ active: e, count: t, onLoad: n, className: r }) {
|
|
182
|
+
let i = y(null), a = y(n);
|
|
183
|
+
return _(() => {
|
|
177
184
|
a.current = n;
|
|
178
|
-
}),
|
|
185
|
+
}), _(() => {
|
|
179
186
|
let t = i.current;
|
|
180
187
|
if (!e || !t || typeof IntersectionObserver > "u") return;
|
|
181
188
|
let n = new IntersectionObserver((e) => {
|
|
182
189
|
e.some((e) => e.isIntersecting) && a.current();
|
|
183
190
|
});
|
|
184
191
|
return n.observe(t), () => n.disconnect();
|
|
185
|
-
}, [e, t]), /* @__PURE__ */
|
|
192
|
+
}, [e, t]), /* @__PURE__ */ C("div", {
|
|
186
193
|
ref: i,
|
|
187
194
|
className: r,
|
|
188
195
|
"aria-hidden": "true"
|
|
189
196
|
});
|
|
190
197
|
}
|
|
191
|
-
function
|
|
198
|
+
function M({ parts: e, option: t, classes: n, checkbox: r, renderItem: i, noIndicator: a, draggable: o }) {
|
|
192
199
|
let { Item: s, ItemText: c, ItemIndicator: l, ItemContext: u } = e, d = t.icon;
|
|
193
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ w(s, {
|
|
194
201
|
item: t,
|
|
195
202
|
className: n.item,
|
|
196
203
|
"data-description": t.description ? "" : void 0,
|
|
197
204
|
draggable: o && !t.disabled ? "true" : void 0,
|
|
198
205
|
children: [
|
|
199
|
-
r && /* @__PURE__ */
|
|
206
|
+
r && /* @__PURE__ */ C(u, { children: (e) => /* @__PURE__ */ C("span", {
|
|
200
207
|
className: n.check,
|
|
201
208
|
"data-state": e.selected ? "checked" : "unchecked",
|
|
202
209
|
"aria-hidden": "true",
|
|
203
|
-
children: e.selected && /* @__PURE__ */
|
|
210
|
+
children: e.selected && /* @__PURE__ */ C(m, { className: n.checkIcon })
|
|
204
211
|
}) }),
|
|
205
|
-
i ? /* @__PURE__ */
|
|
212
|
+
i ? /* @__PURE__ */ C(u, { children: (e) => i(t.item, {
|
|
206
213
|
selected: e.selected,
|
|
207
214
|
highlighted: e.highlighted,
|
|
208
215
|
disabled: e.disabled
|
|
209
|
-
}) }) : /* @__PURE__ */
|
|
216
|
+
}) }) : /* @__PURE__ */ w(S, { children: [d && /* @__PURE__ */ C(d, {
|
|
210
217
|
className: n.icon,
|
|
211
218
|
"aria-hidden": "true"
|
|
212
|
-
}), t.description ? /* @__PURE__ */
|
|
219
|
+
}), t.description ? /* @__PURE__ */ w("span", {
|
|
213
220
|
className: n.itemBody,
|
|
214
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ C(c, {
|
|
215
222
|
className: n.itemText,
|
|
216
223
|
children: t.label
|
|
217
|
-
}), /* @__PURE__ */
|
|
224
|
+
}), /* @__PURE__ */ C("span", {
|
|
218
225
|
className: n.itemDescription,
|
|
219
226
|
children: t.description
|
|
220
227
|
})]
|
|
221
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ C(c, {
|
|
222
229
|
className: n.itemText,
|
|
223
230
|
children: t.label
|
|
224
231
|
})] }),
|
|
225
|
-
!r && !a && /* @__PURE__ */
|
|
232
|
+
!r && !a && /* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(m, {
|
|
226
233
|
className: n.itemIndicator,
|
|
227
234
|
"aria-hidden": "true"
|
|
228
235
|
}) })
|
|
229
236
|
]
|
|
230
237
|
});
|
|
231
238
|
}
|
|
232
|
-
function
|
|
233
|
-
let { ItemGroup: f, ItemGroupLabel: p } = e,
|
|
239
|
+
function N({ parts: e, groups: t, classes: n, checkbox: r, noIndicator: i, draggable: a, loading: o, loadingText: s, hasMore: c, onLoadMore: l, emptyText: u, renderItem: d }) {
|
|
240
|
+
let { ItemGroup: f, ItemGroupLabel: p } = e, m = (t) => /* @__PURE__ */ C(M, {
|
|
234
241
|
parts: e,
|
|
235
242
|
option: t,
|
|
236
243
|
classes: n,
|
|
@@ -239,28 +246,28 @@ function M({ parts: e, groups: t, classes: n, checkbox: r, noIndicator: i, dragg
|
|
|
239
246
|
draggable: a,
|
|
240
247
|
renderItem: d
|
|
241
248
|
}, t.key);
|
|
242
|
-
return /* @__PURE__ */
|
|
243
|
-
t.map((e, t) => e.label === void 0 ? /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
250
|
+
t.map((e, t) => e.label === void 0 ? /* @__PURE__ */ C(g, { children: e.options.map(m) }, `#${t}`) : /* @__PURE__ */ w(f, {
|
|
244
251
|
className: n.group,
|
|
245
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ C(p, {
|
|
246
253
|
className: n.groupLabel,
|
|
247
254
|
children: e.label
|
|
248
|
-
}), e.options.map(
|
|
255
|
+
}), e.options.map(m)]
|
|
249
256
|
}, e.label)),
|
|
250
|
-
u !== void 0 && !o && !t.length && /* @__PURE__ */
|
|
257
|
+
u !== void 0 && !o && !t.length && /* @__PURE__ */ C("div", {
|
|
251
258
|
role: "option",
|
|
252
259
|
"aria-disabled": "true",
|
|
253
260
|
className: n.empty,
|
|
254
261
|
children: u
|
|
255
262
|
}),
|
|
256
|
-
o && /* @__PURE__ */
|
|
263
|
+
o && /* @__PURE__ */ w("div", {
|
|
257
264
|
className: n.loading,
|
|
258
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ C(h, {
|
|
259
266
|
className: n.loadingIcon,
|
|
260
267
|
"aria-hidden": "true"
|
|
261
268
|
}), s]
|
|
262
269
|
}),
|
|
263
|
-
c && /* @__PURE__ */
|
|
270
|
+
c && /* @__PURE__ */ C(j, {
|
|
264
271
|
className: n.sentinel,
|
|
265
272
|
active: !o,
|
|
266
273
|
count: t.reduce((e, t) => e + t.options.length, 0),
|
|
@@ -268,28 +275,28 @@ function M({ parts: e, groups: t, classes: n, checkbox: r, noIndicator: i, dragg
|
|
|
268
275
|
})
|
|
269
276
|
] });
|
|
270
277
|
}
|
|
271
|
-
function
|
|
278
|
+
function P(e) {
|
|
272
279
|
e.target.closest("[draggable=\"true\"]") && e.stopPropagation();
|
|
273
280
|
}
|
|
274
281
|
//#endregion
|
|
275
282
|
//#region src/components/Highlight/Highlight.tsx
|
|
276
|
-
function
|
|
277
|
-
let d = t("highlight",
|
|
278
|
-
return !o && !
|
|
283
|
+
function F({ classes: e, text: n, query: r, ignoreCase: i = !0, matchAll: a = !0, wholeWord: o = !1, ignoreAccents: s = !1, colors: u }) {
|
|
284
|
+
let d = t("highlight", c, e);
|
|
285
|
+
return !o && !s && !u?.length ? /* @__PURE__ */ C(T, {
|
|
279
286
|
text: n,
|
|
280
287
|
query: r,
|
|
281
288
|
ignoreCase: i,
|
|
282
289
|
matchAll: a,
|
|
283
290
|
className: d()
|
|
284
|
-
}) : /* @__PURE__ */ S
|
|
291
|
+
}) : /* @__PURE__ */ C(S, { children: l(n, r, {
|
|
285
292
|
ignoreCase: i,
|
|
286
293
|
matchAll: a,
|
|
287
294
|
wholeWord: o,
|
|
288
|
-
ignoreAccents:
|
|
289
|
-
}).map((e, t) => e.match ? /* @__PURE__ */
|
|
295
|
+
ignoreAccents: s
|
|
296
|
+
}).map((e, t) => e.match ? /* @__PURE__ */ C("mark", {
|
|
290
297
|
className: d({ color: u?.[e.term ?? 0] }),
|
|
291
298
|
children: e.text
|
|
292
|
-
}, t) : /* @__PURE__ */
|
|
299
|
+
}, t) : /* @__PURE__ */ C(g, { children: e.text }, t)) });
|
|
293
300
|
}
|
|
294
301
|
//#endregion
|
|
295
|
-
export {
|
|
302
|
+
export { k as a, O as c, P as i, N as n, A as o, j as r, D as s, F as t };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
+
import { r as n, t as r } from "./InputStatus-hVzkU_4q.js";
|
|
4
|
+
import { buttonColorKey as i, formatCount as a, iconButton as o, input as s, setTextControlValue as c, spinner as l } from "@wirecore/wirelayer-recipes";
|
|
5
|
+
import { CircleAlert as u, LoaderCircle as d } from "lucide-react";
|
|
6
|
+
import { useId as f, useRef as p, useState as m } from "react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
import { Field as _, useFieldContext as v } from "@ark-ui/react/field";
|
|
9
|
+
//#region src/components/IconButton/IconButton.tsx
|
|
10
|
+
function y({ classes: e, icon: n, iconProps: r, label: s, variant: c, color: u, size: f, shape: p, disabled: m = !1, loading: _ = !1, type: v = "button", badge: y = !1, badgeLabel: b = (e) => e === null ? "new" : `${e} new`, className: x, onClick: S, ...C }) {
|
|
11
|
+
let w = t("iconButton", o, e), T = t("spinner", l), E = w({
|
|
12
|
+
variant: c,
|
|
13
|
+
color: i(u),
|
|
14
|
+
size: f,
|
|
15
|
+
shape: p
|
|
16
|
+
}), D = typeof y == "number" && y > 0 ? y : 0, O = D ? `${s}, ${b(a(D))}` : y === !0 ? `${s}, ${b(null)}` : s;
|
|
17
|
+
return /* @__PURE__ */ g("button", {
|
|
18
|
+
...C,
|
|
19
|
+
className: E.base({ class: x }),
|
|
20
|
+
type: v,
|
|
21
|
+
disabled: m,
|
|
22
|
+
"aria-label": O,
|
|
23
|
+
..._ ? {
|
|
24
|
+
"aria-disabled": !0,
|
|
25
|
+
"aria-busy": !0
|
|
26
|
+
} : {},
|
|
27
|
+
onClick: (e) => {
|
|
28
|
+
_ ? e.preventDefault() : S?.(e);
|
|
29
|
+
},
|
|
30
|
+
children: [_ ? /* @__PURE__ */ h(d, {
|
|
31
|
+
className: T().icon({ class: E.icon() }),
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}) : /* @__PURE__ */ h(n, {
|
|
34
|
+
...r,
|
|
35
|
+
className: E.icon(),
|
|
36
|
+
"aria-hidden": "true"
|
|
37
|
+
}), D ? /* @__PURE__ */ h("span", {
|
|
38
|
+
className: E.badge(),
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: a(D)
|
|
41
|
+
}) : y === !0 && /* @__PURE__ */ h("span", {
|
|
42
|
+
className: E.dot(),
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/Input/Input.tsx
|
|
49
|
+
function b({ classes: i, size: a, invalid: o = !1, success: l = !1, loading: d = !1, clearable: y = !1, clearLabel: b, disabled: x = !1, leadingIcon: S, prefix: C, suffix: w, className: T, style: E, onChange: D, ...O }) {
|
|
50
|
+
let k = t("input", s, i), A = e(), j = v(), M = n(), N = o || !!j?.invalid, P = !N && (l || M.success), F = x || !!j?.disabled, I = !!O.readOnly || !!j?.readOnly, L = k({
|
|
51
|
+
size: a,
|
|
52
|
+
invalid: N,
|
|
53
|
+
success: P,
|
|
54
|
+
disabled: F,
|
|
55
|
+
hasIcon: !!S,
|
|
56
|
+
hasStatusIcon: N || P || d || y
|
|
57
|
+
}), [R, z] = m(() => String(O.defaultValue ?? "") !== ""), B = O.value === void 0 ? R : String(O.value ?? "") !== "", V = p(null), H = () => {
|
|
58
|
+
let e = V.current?.querySelector("input");
|
|
59
|
+
e && (c(e), e.focus());
|
|
60
|
+
}, U = f(), W = f(), G = [
|
|
61
|
+
j?.ariaDescribedby,
|
|
62
|
+
C && U,
|
|
63
|
+
w && W,
|
|
64
|
+
O["aria-describedby"]
|
|
65
|
+
].filter(Boolean).join(" ") || void 0;
|
|
66
|
+
return /* @__PURE__ */ g("div", {
|
|
67
|
+
ref: V,
|
|
68
|
+
className: L.base({ class: T }),
|
|
69
|
+
style: E,
|
|
70
|
+
"data-invalid": N || void 0,
|
|
71
|
+
"data-disabled": F || void 0,
|
|
72
|
+
children: [
|
|
73
|
+
C && /* @__PURE__ */ h("span", {
|
|
74
|
+
id: U,
|
|
75
|
+
className: L.prefix(),
|
|
76
|
+
children: C
|
|
77
|
+
}),
|
|
78
|
+
S && /* @__PURE__ */ h(S, {
|
|
79
|
+
className: L.icon(),
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ h(_.Input, {
|
|
83
|
+
...O,
|
|
84
|
+
className: L.control(),
|
|
85
|
+
disabled: F || void 0,
|
|
86
|
+
"aria-invalid": N || void 0,
|
|
87
|
+
"aria-describedby": G,
|
|
88
|
+
"aria-busy": d || void 0,
|
|
89
|
+
onChange: (e) => {
|
|
90
|
+
z(e.currentTarget.value !== ""), D?.(e);
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
(d || y || P) && /* @__PURE__ */ h(r, {
|
|
94
|
+
loading: d,
|
|
95
|
+
clear: y && B && !F && !I,
|
|
96
|
+
clearLabel: b ?? A.field.clear,
|
|
97
|
+
onClear: H,
|
|
98
|
+
success: P,
|
|
99
|
+
classes: {
|
|
100
|
+
spinner: L.spinner(),
|
|
101
|
+
clear: L.clear(),
|
|
102
|
+
clearIcon: L.clearIcon(),
|
|
103
|
+
statusIcon: L.statusIcon()
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
N && /* @__PURE__ */ h(u, {
|
|
107
|
+
className: L.statusIcon(),
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}),
|
|
110
|
+
w && /* @__PURE__ */ h("span", {
|
|
111
|
+
id: W,
|
|
112
|
+
className: L.suffix(),
|
|
113
|
+
children: w
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { y as n, b as t };
|