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