@wirecore/wirelayer-react 0.7.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/ContextMenu-C6ZaMtqf.js +1511 -0
- package/dist/{Input-C8T3WLd5.js → Input-CtYSQznO.js} +41 -40
- package/dist/{PasswordInput-SjO66gZB.js → PasswordInput-dpeKVREo.js} +67 -64
- package/dist/Select-C2CiPTCK.js +256 -0
- package/dist/components/Alert/Alert.d.ts +3 -1
- package/dist/components/Alert/Alert.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/Combobox/Combobox.d.ts +10 -1
- package/dist/components/Combobox/Combobox.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/Dialog/Dialog.d.ts +6 -1
- package/dist/components/Dialog/Dialog.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/Menu/Menu.d.ts +27 -3
- package/dist/components/Menu/Menu.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 +1 -1
- 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/Progress/Progress.d.ts +12 -1
- package/dist/components/Progress/Progress.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/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/Textarea/Textarea.d.ts +7 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/form.js +1 -1
- package/dist/index.js +803 -751
- package/dist/pdf.js +2 -2
- package/llms-full.txt +57 -22
- package/llms.txt +5 -4
- package/package.json +2 -2
- package/dist/ContextMenu-BD72S5n6.js +0 -1452
- package/dist/Select-7rfeNmJb.js +0 -242
package/dist/Select-7rfeNmJb.js
DELETED
|
@@ -1,242 +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-43-H9459.js";
|
|
4
|
-
import { controlIds as o, select as s, spinner as c } from "@wirecore/wirelayer-recipes";
|
|
5
|
-
import { ChevronDown as l, LoaderCircle as u, X as d } from "lucide-react";
|
|
6
|
-
import { useEffect as f, useId as ee, useMemo as p, useState as te } from "react";
|
|
7
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
-
import { Portal as ne } from "@ark-ui/react/portal";
|
|
9
|
-
import { useFieldContext as _ } from "@ark-ui/react/field";
|
|
10
|
-
import { createListCollection as re } from "@ark-ui/react/collection";
|
|
11
|
-
import { Select as v } from "@ark-ui/react/select";
|
|
12
|
-
//#region src/components/Spinner/Spinner.tsx
|
|
13
|
-
var y = 2 * Math.PI * 9;
|
|
14
|
-
function b({ classes: n, size: r, label: i, value: a, className: o, ...s }) {
|
|
15
|
-
let l = t("spinner", c, n), d = e(), f = l({ size: r });
|
|
16
|
-
if (a !== void 0) {
|
|
17
|
-
let e = Math.min(100, Math.max(0, a));
|
|
18
|
-
return /* @__PURE__ */ h("span", {
|
|
19
|
-
...s,
|
|
20
|
-
className: f.base({ class: o }),
|
|
21
|
-
role: "progressbar",
|
|
22
|
-
"aria-label": i ?? d.common.loading,
|
|
23
|
-
"aria-valuemin": 0,
|
|
24
|
-
"aria-valuemax": 100,
|
|
25
|
-
"aria-valuenow": e,
|
|
26
|
-
"aria-valuetext": `${Math.round(e)} %`,
|
|
27
|
-
children: /* @__PURE__ */ g("svg", {
|
|
28
|
-
className: f.ring(),
|
|
29
|
-
viewBox: "0 0 24 24",
|
|
30
|
-
"aria-hidden": "true",
|
|
31
|
-
children: [/* @__PURE__ */ h("circle", {
|
|
32
|
-
className: f.ringTrack(),
|
|
33
|
-
cx: "12",
|
|
34
|
-
cy: "12",
|
|
35
|
-
r: "9",
|
|
36
|
-
strokeWidth: "3"
|
|
37
|
-
}), /* @__PURE__ */ h("circle", {
|
|
38
|
-
className: f.ringRange(),
|
|
39
|
-
cx: "12",
|
|
40
|
-
cy: "12",
|
|
41
|
-
r: "9",
|
|
42
|
-
strokeWidth: "3",
|
|
43
|
-
strokeLinecap: "round",
|
|
44
|
-
strokeDasharray: `${e / 100 * y} ${y}`
|
|
45
|
-
})]
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ g("span", {
|
|
50
|
-
...s,
|
|
51
|
-
className: f.base({ class: o }),
|
|
52
|
-
role: "status",
|
|
53
|
-
children: [/* @__PURE__ */ h(u, {
|
|
54
|
-
className: f.icon(),
|
|
55
|
-
"aria-hidden": "true"
|
|
56
|
-
}), /* @__PURE__ */ h("span", {
|
|
57
|
-
className: f.label(),
|
|
58
|
-
children: i ?? d.common.loading
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/components/Select/Select.tsx
|
|
64
|
-
function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: ie, placeholder: ae, disabled: oe, invalid: se, required: ce, name: S, itemValue: le, itemLabel: ue, itemDisabled: de, itemGroup: fe, itemKeywords: pe, valueKey: me, clearable: C, loading: w, loadingText: he, size: ge, filter: T, manualFilter: E, onFilterChange: D, emptyText: _e, hasMore: ve, onLoadMore: ye, dataSource: O, minSearchLength: be, pageSize: k, standalone: A, renderItem: j, renderValue: M, id: N, className: xe, style: Se, onKeyDown: Ce, ...P }) {
|
|
65
|
-
let F = t("select", s, c)({
|
|
66
|
-
size: ge,
|
|
67
|
-
clearable: C
|
|
68
|
-
}), I = _(), L = e(), R = L.select, z = {
|
|
69
|
-
itemValue: le,
|
|
70
|
-
itemLabel: ue,
|
|
71
|
-
itemDisabled: de,
|
|
72
|
-
itemGroup: fe,
|
|
73
|
-
itemKeywords: pe,
|
|
74
|
-
valueKey: me
|
|
75
|
-
}, [B, V] = te(""), H = r({
|
|
76
|
-
items: y,
|
|
77
|
-
source: O,
|
|
78
|
-
accessors: z,
|
|
79
|
-
pageSize: k,
|
|
80
|
-
minSearchLength: be
|
|
81
|
-
}), { options: U, groups: we, ordered: W, firstFor: Te } = n(H.items, z, T && !E && !O ? B : ""), G = p(() => [...U, ...H.resolvedOptions], [U, H.resolvedOptions]), { selected: K, keys: q, commit: J, commitKeys: Ee } = a({
|
|
82
|
-
multiple: !1,
|
|
83
|
-
value: b,
|
|
84
|
-
defaultValue: x,
|
|
85
|
-
accessors: z,
|
|
86
|
-
items: G,
|
|
87
|
-
onChange: ie,
|
|
88
|
-
check: {
|
|
89
|
-
component: "Select",
|
|
90
|
-
ready: !O && !w && y.length > 0
|
|
91
|
-
}
|
|
92
|
-
}), De = q.join("\0");
|
|
93
|
-
f(() => {
|
|
94
|
-
H.resolve(q, G);
|
|
95
|
-
}, [De, O]);
|
|
96
|
-
let Y = w || H.loading, X = K[0], Oe = p(() => re({
|
|
97
|
-
items: W,
|
|
98
|
-
itemToString: (e) => e.label,
|
|
99
|
-
itemToValue: (e) => e.key,
|
|
100
|
-
isItemDisabled: (e) => e.disabled
|
|
101
|
-
}), [W]), Z = ee(), Q = X?.icon, ke = {
|
|
102
|
-
item: F.item(),
|
|
103
|
-
itemText: F.itemText(),
|
|
104
|
-
icon: F.icon(),
|
|
105
|
-
itemIndicator: F.itemIndicator(),
|
|
106
|
-
itemBody: F.itemBody(),
|
|
107
|
-
itemDescription: F.itemDescription(),
|
|
108
|
-
group: F.group(),
|
|
109
|
-
groupLabel: F.groupLabel(),
|
|
110
|
-
loading: F.loading(),
|
|
111
|
-
loadingIcon: F.loadingIcon(),
|
|
112
|
-
sentinel: F.sentinel(),
|
|
113
|
-
empty: F.empty()
|
|
114
|
-
}, $ = /* @__PURE__ */ h(i, {
|
|
115
|
-
parts: v,
|
|
116
|
-
groups: we,
|
|
117
|
-
classes: ke,
|
|
118
|
-
loading: Y,
|
|
119
|
-
loadingText: he ?? L.common.loading,
|
|
120
|
-
hasMore: ve || H.hasMore,
|
|
121
|
-
onLoadMore: () => O ? H.loadMore() : ye?.(),
|
|
122
|
-
emptyText: _e ?? H.emptyText ?? (B ? L.common.noResults : L.common.empty),
|
|
123
|
-
renderItem: j
|
|
124
|
-
});
|
|
125
|
-
function Ae(e) {
|
|
126
|
-
Ce?.(e), C && K.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), J([]));
|
|
127
|
-
}
|
|
128
|
-
function je(e, t) {
|
|
129
|
-
V(t), D?.(t), O && H.search(t);
|
|
130
|
-
let n = E || O ? void 0 : Te(t);
|
|
131
|
-
n && requestAnimationFrame(() => e.setHighlightValue(n.key));
|
|
132
|
-
}
|
|
133
|
-
return /* @__PURE__ */ g(v.Root, {
|
|
134
|
-
className: F.base({ class: xe }),
|
|
135
|
-
style: Se,
|
|
136
|
-
collection: Oe,
|
|
137
|
-
value: q,
|
|
138
|
-
onValueChange: (e) => Ee(e.value, e.items),
|
|
139
|
-
onOpenChange: (e) => {
|
|
140
|
-
e.open && H.open(), !e.open && B && (V(""), D?.(""), O && H.search(""));
|
|
141
|
-
},
|
|
142
|
-
disabled: oe,
|
|
143
|
-
invalid: se,
|
|
144
|
-
required: ce,
|
|
145
|
-
name: S,
|
|
146
|
-
...o(N, "trigger", {
|
|
147
|
-
label: I?.ids.label,
|
|
148
|
-
hiddenSelect: I?.ids.control
|
|
149
|
-
}, A),
|
|
150
|
-
positioning: {
|
|
151
|
-
sameWidth: !0,
|
|
152
|
-
gutter: 4
|
|
153
|
-
},
|
|
154
|
-
composite: !T,
|
|
155
|
-
lazyMount: !0,
|
|
156
|
-
unmountOnExit: !0,
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ g(v.Control, {
|
|
159
|
-
...C ? { className: F.control() } : {},
|
|
160
|
-
children: [/* @__PURE__ */ g(v.Trigger, {
|
|
161
|
-
...P,
|
|
162
|
-
className: F.trigger(),
|
|
163
|
-
"aria-busy": w || void 0,
|
|
164
|
-
onKeyDown: Ae,
|
|
165
|
-
children: [/* @__PURE__ */ h("span", {
|
|
166
|
-
className: F.value(),
|
|
167
|
-
children: M && X ? M(X.item) : /* @__PURE__ */ g(m, { children: [Q && /* @__PURE__ */ h(Q, {
|
|
168
|
-
className: F.icon(),
|
|
169
|
-
"aria-hidden": "true"
|
|
170
|
-
}), /* @__PURE__ */ h(v.ValueText, {
|
|
171
|
-
placeholder: ae ?? L.common.placeholder,
|
|
172
|
-
children: X?.label || void 0
|
|
173
|
-
})] })
|
|
174
|
-
}), /* @__PURE__ */ h(v.Indicator, {
|
|
175
|
-
className: F.indicator(),
|
|
176
|
-
children: w ? /* @__PURE__ */ h(u, {
|
|
177
|
-
className: F.spinner(),
|
|
178
|
-
"aria-hidden": "true"
|
|
179
|
-
}) : /* @__PURE__ */ h(l, {
|
|
180
|
-
className: F.indicatorIcon(),
|
|
181
|
-
"aria-hidden": "true"
|
|
182
|
-
})
|
|
183
|
-
})]
|
|
184
|
-
}), C && /* @__PURE__ */ h(v.Context, { children: (e) => X && !e.disabled && /* @__PURE__ */ h("button", {
|
|
185
|
-
type: "button",
|
|
186
|
-
tabIndex: -1,
|
|
187
|
-
className: F.clear(),
|
|
188
|
-
"aria-label": R.clear,
|
|
189
|
-
onClick: () => {
|
|
190
|
-
J([]), e.focus();
|
|
191
|
-
},
|
|
192
|
-
children: /* @__PURE__ */ h(d, {
|
|
193
|
-
className: F.clearIcon(),
|
|
194
|
-
"aria-hidden": "true"
|
|
195
|
-
})
|
|
196
|
-
}) })]
|
|
197
|
-
}),
|
|
198
|
-
/* @__PURE__ */ h(ne, { children: /* @__PURE__ */ h(v.Positioner, { children: /* @__PURE__ */ h(v.Content, {
|
|
199
|
-
className: F.content(),
|
|
200
|
-
"aria-busy": Y || void 0,
|
|
201
|
-
"aria-label": T ? P["aria-label"] : void 0,
|
|
202
|
-
children: T ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
203
|
-
className: F.header(),
|
|
204
|
-
children: /* @__PURE__ */ h(v.Context, { children: (e) => /* @__PURE__ */ h("input", {
|
|
205
|
-
type: "text",
|
|
206
|
-
role: "combobox",
|
|
207
|
-
autoComplete: "off",
|
|
208
|
-
"aria-autocomplete": "list",
|
|
209
|
-
"aria-expanded": "true",
|
|
210
|
-
"data-autofocus": "",
|
|
211
|
-
"aria-controls": Z,
|
|
212
|
-
"aria-activedescendant": e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0,
|
|
213
|
-
"aria-label": R.filter,
|
|
214
|
-
placeholder: L.combobox.search,
|
|
215
|
-
value: B,
|
|
216
|
-
className: F.search(),
|
|
217
|
-
onChange: (t) => je(e, t.target.value),
|
|
218
|
-
onKeyDown: (e) => {
|
|
219
|
-
[
|
|
220
|
-
" ",
|
|
221
|
-
"Home",
|
|
222
|
-
"End"
|
|
223
|
-
].includes(e.key) && e.stopPropagation();
|
|
224
|
-
}
|
|
225
|
-
}) })
|
|
226
|
-
}), /* @__PURE__ */ h(v.List, {
|
|
227
|
-
id: Z,
|
|
228
|
-
className: F.list(),
|
|
229
|
-
children: $
|
|
230
|
-
})] }) : $
|
|
231
|
-
}) }) }),
|
|
232
|
-
/* @__PURE__ */ h(v.HiddenSelect, {}),
|
|
233
|
-
O && /* @__PURE__ */ h("span", {
|
|
234
|
-
role: "status",
|
|
235
|
-
className: F.status(),
|
|
236
|
-
children: H.announcement
|
|
237
|
-
})
|
|
238
|
-
]
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
//#endregion
|
|
242
|
-
export { b as n, x as t };
|