@wirecore/wirelayer-react 0.5.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/Button-Cd7lufvJ.js +60 -0
- package/dist/Checkbox-BMRax6m4.js +49 -0
- package/dist/ContextMenu-BD72S5n6.js +1452 -0
- package/dist/{Field-hc416yJx.js → Field-DkYxlVar.js} +5 -2
- package/dist/Highlight-43-H9459.js +302 -0
- package/dist/Input-C8T3WLd5.js +119 -0
- package/dist/{InputStatus-DS38XEkX.js → InputStatus-hVzkU_4q.js} +4 -1
- 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-eqv4DIQn.js → Tree-DVjwp6FG.js} +2 -2
- package/dist/chart/Chart.d.ts +11 -5
- package/dist/chart/Chart.d.ts.map +1 -1
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart.js +44 -37
- package/dist/code.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/Badge/Badge.d.ts +3 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +6 -1
- package/dist/components/Button/Button.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/ChipGroup/ChipGroup.d.ts +1 -1
- package/dist/components/ChipGroup/ChipGroup.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 +7 -2
- 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 +5 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +5 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- 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/Field/context.d.ts +3 -1
- package/dist/components/Field/context.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +9 -2
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +5 -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 +5 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +7 -2
- 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 +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 +3 -3
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +9 -2
- 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/Toast/Toaster.d.ts +10 -2
- package/dist/components/Toast/Toaster.d.ts.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +7 -1
- package/dist/components/ToggleButton/ToggleButton.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 +5 -1
- package/dist/components/YearPicker/YearPicker.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +28 -2
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table/FilterMenu.d.ts +7 -1
- package/dist/data-table/FilterMenu.d.ts.map +1 -1
- package/dist/data-table/ValueInput.d.ts +8 -1
- package/dist/data-table/ValueInput.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/types.d.ts +29 -1
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +1220 -1142
- package/dist/editor.js +2 -2
- package/dist/form/FormField.d.ts +5 -1
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form.js +9 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3516 -3407
- package/dist/label-for-DYgV5EwH.js +9 -0
- package/dist/pdf.js +5 -5
- 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 +215 -14
- package/llms.txt +4 -1
- package/package.json +7 -3
- package/theme.css +14 -0
- package/dist/Button-DFVVqBuY.js +0 -58
- package/dist/Checkbox-CZTyKWId.js +0 -44
- package/dist/ContextMenu-qh-bB9Lw.js +0 -1426
- package/dist/Highlight-DdTridk2.js +0 -291
- package/dist/Input-OPRvjIYt.js +0 -108
- package/dist/PasswordInput-B9k0GuSx.js +0 -420
- package/dist/Select-PbxrUYi1.js +0 -233
- package/dist/Slider-x-SsBc1d.js +0 -74
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
-
import { n } from "./InputStatus-
|
|
3
|
+
import { n } from "./InputStatus-hVzkU_4q.js";
|
|
4
4
|
import { field as r, toggletip as i } from "@wirecore/wirelayer-recipes";
|
|
5
5
|
import { CircleCheck as a, Info as o } from "lucide-react";
|
|
6
6
|
import { useEffect as s, useRef as c, useState as l } from "react";
|
|
@@ -63,7 +63,10 @@ function m({ classes: i, label: o, helperText: s, error: c, invalid: l = !1, suc
|
|
|
63
63
|
]
|
|
64
64
|
});
|
|
65
65
|
return /* @__PURE__ */ u(n.Provider, {
|
|
66
|
-
value: {
|
|
66
|
+
value: {
|
|
67
|
+
success: O,
|
|
68
|
+
labelled: !!o
|
|
69
|
+
},
|
|
67
70
|
children: /* @__PURE__ */ d(f.Root, {
|
|
68
71
|
...C,
|
|
69
72
|
className: E.base({ class: x }),
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { i as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
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
|
+
//#region src/utils/data-source.ts
|
|
10
|
+
var E = {
|
|
11
|
+
status: "idle",
|
|
12
|
+
items: [],
|
|
13
|
+
loadingMore: !1,
|
|
14
|
+
hasMore: !1,
|
|
15
|
+
search: "",
|
|
16
|
+
tooShort: !1
|
|
17
|
+
};
|
|
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
|
+
source: t,
|
|
21
|
+
pageSize: r,
|
|
22
|
+
minSearchLength: o,
|
|
23
|
+
debounce: s,
|
|
24
|
+
query: c
|
|
25
|
+
});
|
|
26
|
+
_(() => {
|
|
27
|
+
x.current = {
|
|
28
|
+
source: t,
|
|
29
|
+
pageSize: r,
|
|
30
|
+
minSearchLength: o,
|
|
31
|
+
debounce: s,
|
|
32
|
+
query: c
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
let S = JSON.stringify(c ?? {});
|
|
36
|
+
return _(() => {
|
|
37
|
+
t && (h.current?.configure({
|
|
38
|
+
source: t,
|
|
39
|
+
pageSize: r,
|
|
40
|
+
minSearchLength: o,
|
|
41
|
+
debounce: s,
|
|
42
|
+
query: x.current.query
|
|
43
|
+
}), g.current?.configure({ source: t }));
|
|
44
|
+
}, [
|
|
45
|
+
t,
|
|
46
|
+
r,
|
|
47
|
+
o,
|
|
48
|
+
s,
|
|
49
|
+
S
|
|
50
|
+
]), _(() => () => {
|
|
51
|
+
h.current?.dispose(), g.current?.dispose(), h.current = void 0, g.current = void 0;
|
|
52
|
+
}, []), v(() => {
|
|
53
|
+
let e = () => {
|
|
54
|
+
let { source: e, ...t } = x.current;
|
|
55
|
+
if (e) return h.current ??= i({
|
|
56
|
+
source: e,
|
|
57
|
+
...t,
|
|
58
|
+
onChange: f
|
|
59
|
+
}), g.current ??= new n({
|
|
60
|
+
source: e,
|
|
61
|
+
onChange: m
|
|
62
|
+
}), h.current;
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
active: !!t,
|
|
66
|
+
state: d,
|
|
67
|
+
resolved: p,
|
|
68
|
+
open: () => void e()?.open(),
|
|
69
|
+
search: (t, n = !0) => void e()?.search(t, { debounce: n }),
|
|
70
|
+
loadMore: () => void h.current?.loadMore(),
|
|
71
|
+
retry: () => void h.current?.retry(),
|
|
72
|
+
refresh: () => void e()?.refresh(),
|
|
73
|
+
resolveKeys: (t) => {
|
|
74
|
+
e() && t.length && g.current.resolve(t).catch(() => void 0);
|
|
75
|
+
},
|
|
76
|
+
announcement: t ? a(d, l, u, o ?? 0) : ""
|
|
77
|
+
};
|
|
78
|
+
}, [
|
|
79
|
+
t,
|
|
80
|
+
d,
|
|
81
|
+
p,
|
|
82
|
+
l,
|
|
83
|
+
u,
|
|
84
|
+
o
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
function O({ items: t, source: n, accessors: r, pageSize: i, minSearchLength: a }) {
|
|
88
|
+
let { translations: o } = e(), s = D({
|
|
89
|
+
source: n,
|
|
90
|
+
pageSize: i,
|
|
91
|
+
minSearchLength: a
|
|
92
|
+
}), { itemValue: c, itemLabel: l, itemDisabled: u, itemGroup: d, itemKeywords: f, valueKey: m } = r, h = v(() => p(s.resolved, {
|
|
93
|
+
itemValue: c,
|
|
94
|
+
itemLabel: l,
|
|
95
|
+
itemDisabled: u,
|
|
96
|
+
itemGroup: d,
|
|
97
|
+
itemKeywords: f,
|
|
98
|
+
valueKey: m
|
|
99
|
+
}), [
|
|
100
|
+
s.resolved,
|
|
101
|
+
c,
|
|
102
|
+
l,
|
|
103
|
+
u,
|
|
104
|
+
d,
|
|
105
|
+
f,
|
|
106
|
+
m
|
|
107
|
+
]), g = o.dataSource;
|
|
108
|
+
return {
|
|
109
|
+
...s,
|
|
110
|
+
items: s.active ? s.state.items : t,
|
|
111
|
+
resolvedOptions: h,
|
|
112
|
+
resolve(e, t) {
|
|
113
|
+
if (!s.active) return;
|
|
114
|
+
let n = new Set(t.map((e) => e.key));
|
|
115
|
+
s.resolveKeys(e.filter((e) => !n.has(e)));
|
|
116
|
+
},
|
|
117
|
+
loading: s.active && s.state.status === "loading",
|
|
118
|
+
hasMore: s.active && s.state.hasMore,
|
|
119
|
+
emptyText: s.active ? s.state.tooShort ? g.minSearch(a ?? 0) : s.state.status === "error" ? g.error : void 0 : void 0
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/Select/list.tsx
|
|
124
|
+
function k(e, t, n = "") {
|
|
125
|
+
let { contains: r } = x({
|
|
126
|
+
sensitivity: "base",
|
|
127
|
+
usage: "sort"
|
|
128
|
+
}), { itemValue: i, itemLabel: a, itemDisabled: c, itemGroup: l, itemKeywords: u, valueKey: d } = t, f = v(() => p(e, {
|
|
129
|
+
itemValue: i,
|
|
130
|
+
itemLabel: a,
|
|
131
|
+
itemDisabled: c,
|
|
132
|
+
itemGroup: l,
|
|
133
|
+
itemKeywords: u,
|
|
134
|
+
valueKey: d
|
|
135
|
+
}), [
|
|
136
|
+
e,
|
|
137
|
+
i,
|
|
138
|
+
a,
|
|
139
|
+
c,
|
|
140
|
+
l,
|
|
141
|
+
u,
|
|
142
|
+
d
|
|
143
|
+
]), m = v(() => o(f, n, r), [
|
|
144
|
+
f,
|
|
145
|
+
n,
|
|
146
|
+
r
|
|
147
|
+
]), h = v(() => s(m), [m]);
|
|
148
|
+
return {
|
|
149
|
+
options: f,
|
|
150
|
+
visible: m,
|
|
151
|
+
groups: h,
|
|
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
|
+
};
|
|
155
|
+
}
|
|
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);
|
|
167
|
+
let n = t.map((e) => e.value), r = e ? n : n[0] ?? null;
|
|
168
|
+
l(r), o?.(r);
|
|
169
|
+
}
|
|
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));
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
selected: g,
|
|
176
|
+
keys: v,
|
|
177
|
+
commit: x,
|
|
178
|
+
commitKeys: S
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function j({ active: e, count: t, onLoad: n, className: r }) {
|
|
182
|
+
let i = y(null), a = y(n);
|
|
183
|
+
return _(() => {
|
|
184
|
+
a.current = n;
|
|
185
|
+
}), _(() => {
|
|
186
|
+
let t = i.current;
|
|
187
|
+
if (!e || !t || typeof IntersectionObserver > "u") return;
|
|
188
|
+
let n = new IntersectionObserver((e) => {
|
|
189
|
+
e.some((e) => e.isIntersecting) && a.current();
|
|
190
|
+
});
|
|
191
|
+
return n.observe(t), () => n.disconnect();
|
|
192
|
+
}, [e, t]), /* @__PURE__ */ C("div", {
|
|
193
|
+
ref: i,
|
|
194
|
+
className: r,
|
|
195
|
+
"aria-hidden": "true"
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function M({ parts: e, option: t, classes: n, checkbox: r, renderItem: i, noIndicator: a, draggable: o }) {
|
|
199
|
+
let { Item: s, ItemText: c, ItemIndicator: l, ItemContext: u } = e, d = t.icon;
|
|
200
|
+
return /* @__PURE__ */ w(s, {
|
|
201
|
+
item: t,
|
|
202
|
+
className: n.item,
|
|
203
|
+
"data-description": t.description ? "" : void 0,
|
|
204
|
+
draggable: o && !t.disabled ? "true" : void 0,
|
|
205
|
+
children: [
|
|
206
|
+
r && /* @__PURE__ */ C(u, { children: (e) => /* @__PURE__ */ C("span", {
|
|
207
|
+
className: n.check,
|
|
208
|
+
"data-state": e.selected ? "checked" : "unchecked",
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
children: e.selected && /* @__PURE__ */ C(m, { className: n.checkIcon })
|
|
211
|
+
}) }),
|
|
212
|
+
i ? /* @__PURE__ */ C(u, { children: (e) => i(t.item, {
|
|
213
|
+
selected: e.selected,
|
|
214
|
+
highlighted: e.highlighted,
|
|
215
|
+
disabled: e.disabled
|
|
216
|
+
}) }) : /* @__PURE__ */ w(S, { children: [d && /* @__PURE__ */ C(d, {
|
|
217
|
+
className: n.icon,
|
|
218
|
+
"aria-hidden": "true"
|
|
219
|
+
}), t.description ? /* @__PURE__ */ w("span", {
|
|
220
|
+
className: n.itemBody,
|
|
221
|
+
children: [/* @__PURE__ */ C(c, {
|
|
222
|
+
className: n.itemText,
|
|
223
|
+
children: t.label
|
|
224
|
+
}), /* @__PURE__ */ C("span", {
|
|
225
|
+
className: n.itemDescription,
|
|
226
|
+
children: t.description
|
|
227
|
+
})]
|
|
228
|
+
}) : /* @__PURE__ */ C(c, {
|
|
229
|
+
className: n.itemText,
|
|
230
|
+
children: t.label
|
|
231
|
+
})] }),
|
|
232
|
+
!r && !a && /* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(m, {
|
|
233
|
+
className: n.itemIndicator,
|
|
234
|
+
"aria-hidden": "true"
|
|
235
|
+
}) })
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
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, {
|
|
241
|
+
parts: e,
|
|
242
|
+
option: t,
|
|
243
|
+
classes: n,
|
|
244
|
+
checkbox: r,
|
|
245
|
+
noIndicator: i,
|
|
246
|
+
draggable: a,
|
|
247
|
+
renderItem: d
|
|
248
|
+
}, t.key);
|
|
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, {
|
|
251
|
+
className: n.group,
|
|
252
|
+
children: [/* @__PURE__ */ C(p, {
|
|
253
|
+
className: n.groupLabel,
|
|
254
|
+
children: e.label
|
|
255
|
+
}), e.options.map(m)]
|
|
256
|
+
}, e.label)),
|
|
257
|
+
u !== void 0 && !o && !t.length && /* @__PURE__ */ C("div", {
|
|
258
|
+
role: "option",
|
|
259
|
+
"aria-disabled": "true",
|
|
260
|
+
className: n.empty,
|
|
261
|
+
children: u
|
|
262
|
+
}),
|
|
263
|
+
o && /* @__PURE__ */ w("div", {
|
|
264
|
+
className: n.loading,
|
|
265
|
+
children: [/* @__PURE__ */ C(h, {
|
|
266
|
+
className: n.loadingIcon,
|
|
267
|
+
"aria-hidden": "true"
|
|
268
|
+
}), s]
|
|
269
|
+
}),
|
|
270
|
+
c && /* @__PURE__ */ C(j, {
|
|
271
|
+
className: n.sentinel,
|
|
272
|
+
active: !o,
|
|
273
|
+
count: t.reduce((e, t) => e + t.options.length, 0),
|
|
274
|
+
onLoad: () => l?.()
|
|
275
|
+
})
|
|
276
|
+
] });
|
|
277
|
+
}
|
|
278
|
+
function P(e) {
|
|
279
|
+
e.target.closest("[draggable=\"true\"]") && e.stopPropagation();
|
|
280
|
+
}
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/components/Highlight/Highlight.tsx
|
|
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, {
|
|
286
|
+
text: n,
|
|
287
|
+
query: r,
|
|
288
|
+
ignoreCase: i,
|
|
289
|
+
matchAll: a,
|
|
290
|
+
className: d()
|
|
291
|
+
}) : /* @__PURE__ */ C(S, { children: l(n, r, {
|
|
292
|
+
ignoreCase: i,
|
|
293
|
+
matchAll: a,
|
|
294
|
+
wholeWord: o,
|
|
295
|
+
ignoreAccents: s
|
|
296
|
+
}).map((e, t) => e.match ? /* @__PURE__ */ C("mark", {
|
|
297
|
+
className: d({ color: u?.[e.term ?? 0] }),
|
|
298
|
+
children: e.text
|
|
299
|
+
}, t) : /* @__PURE__ */ C(g, { children: e.text }, t)) });
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
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 };
|
|
@@ -3,7 +3,10 @@ import { CircleAlert as e, CircleCheck as t, LoaderCircle as n, X as r } from "l
|
|
|
3
3
|
import { createContext as i, useContext as a } from "react";
|
|
4
4
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Field/context.ts
|
|
6
|
-
var l = i({
|
|
6
|
+
var l = i({
|
|
7
|
+
success: !1,
|
|
8
|
+
labelled: !1
|
|
9
|
+
}), u = () => a(l);
|
|
7
10
|
//#endregion
|
|
8
11
|
//#region src/components/Input/InputStatus.tsx
|
|
9
12
|
function d({ loading: i, clear: a, clearLabel: l, onClear: u, invalid: d, success: f, invalidIcon: p, classes: m }) {
|