@mucsi96/react-ui 0.2.0 → 0.4.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/README.md +35 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/forms/select.d.ts +3 -2
- package/dist/index.js +395 -356
- package/dist/styles.css +1 -1
- package/dist/typography.css +29 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Button as e, Checkbox as t, ComboBox as n, Dialog as r, DialogTrigger as i, FieldError as a, Group as o, Heading as s, Input as c, Label as l, Link as u, ListBox as d, ListBoxItem as f, Menu as p, MenuItem as m, MenuTrigger as h, MenuTrigger as g, Modal as _, ModalOverlay as v, Popover as y, ProgressBar as b, Radio as x, RadioGroup as S, Select as C, SelectValue as w, Separator as T, SubmenuTrigger as E, Switch as D, Text as O, TextArea as ee, TextField as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { createPortal as
|
|
2
|
+
import { Button as e, Checkbox as t, ComboBox as n, Dialog as r, DialogTrigger as i, FieldError as a, Group as o, Heading as s, Input as c, Label as l, Link as u, ListBox as d, ListBoxItem as f, Menu as p, MenuItem as m, MenuTrigger as h, MenuTrigger as g, Modal as _, ModalOverlay as v, Popover as y, ProgressBar as b, Radio as x, RadioGroup as S, Select as C, SelectValue as w, Separator as T, SubmenuTrigger as E, Switch as D, Text as O, TextArea as ee, TextField as k, Tooltip as A, TooltipTrigger as te } from "react-aria-components";
|
|
3
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as ne, useCallback as P, useContext as re, useEffect as ie, useId as ae, useMemo as oe, useRef as F, useState as I } from "react";
|
|
5
|
+
import { createPortal as se } from "react-dom";
|
|
6
6
|
//#region src/internal/classes.ts
|
|
7
|
-
function
|
|
7
|
+
function L(...e) {
|
|
8
8
|
return e.filter(Boolean).join(" ");
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var R = { button: "_button_s6jxa_1" };
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/components/button/button.tsx
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
function z({ variant: t = "filled", tone: n = "primary", background: r, className: i, style: a, children: o, ref: s, ...c }) {
|
|
14
|
+
return /* @__PURE__ */ M(e, {
|
|
15
15
|
...c,
|
|
16
16
|
ref: s,
|
|
17
|
-
className:
|
|
17
|
+
className: L(R.button, i),
|
|
18
18
|
"data-variant": t,
|
|
19
19
|
"data-tone": n,
|
|
20
20
|
style: {
|
|
@@ -24,11 +24,11 @@ function R({ variant: t = "filled", tone: n = "primary", background: r, classNam
|
|
|
24
24
|
children: o
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
function ce({ variant: e = "filled", tone: t = "primary", background: n, className: r, style: i, children: a, ref: o, ...s }) {
|
|
28
|
+
return /* @__PURE__ */ M(u, {
|
|
29
29
|
...s,
|
|
30
30
|
ref: o,
|
|
31
|
-
className:
|
|
31
|
+
className: L(R.button, r),
|
|
32
32
|
"data-variant": e,
|
|
33
33
|
"data-tone": t,
|
|
34
34
|
style: {
|
|
@@ -38,59 +38,66 @@ function le({ variant: e = "filled", tone: t = "primary", background: n, classNa
|
|
|
38
38
|
children: a
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
var
|
|
42
|
-
field: "
|
|
43
|
-
label: "
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
var B = {
|
|
42
|
+
field: "_field_b8e40_1",
|
|
43
|
+
label: "_label_b8e40_10",
|
|
44
|
+
surface: "_surface_b8e40_14",
|
|
45
|
+
floatingLabel: "_floatingLabel_b8e40_23",
|
|
46
|
+
selectButton: "_selectButton_b8e40_24",
|
|
47
|
+
input: "_input_b8e40_25",
|
|
48
|
+
description: "_description_b8e40_94",
|
|
49
|
+
error: "_error_b8e40_100",
|
|
50
|
+
combo: "_combo_b8e40_122",
|
|
51
|
+
comboButton: "_comboButton_b8e40_128",
|
|
52
|
+
popover: "_popover_b8e40_146",
|
|
53
|
+
list: "_list_b8e40_156",
|
|
54
|
+
option: "_option_b8e40_163",
|
|
55
|
+
control: "_control_b8e40_181",
|
|
56
|
+
check: "_check_b8e40_195",
|
|
57
|
+
radio: "_radio_b8e40_196",
|
|
58
|
+
track: "_track_b8e40_232",
|
|
59
|
+
thumb: "_thumb_b8e40_243"
|
|
58
60
|
};
|
|
59
61
|
//#endregion
|
|
60
62
|
//#region src/components/forms/text-field.tsx
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
+
function le({ label: e, description: t, error: n, placeholder: r, multiline: i = !1, rows: o = 3, appearance: s = "filled", className: u, ref: d, ...f }) {
|
|
64
|
+
return /* @__PURE__ */ N(k, {
|
|
63
65
|
...f,
|
|
64
66
|
ref: d,
|
|
65
67
|
isInvalid: !!n || f.isInvalid,
|
|
66
|
-
className:
|
|
68
|
+
className: L(B.field, u),
|
|
67
69
|
"data-appearance": s,
|
|
68
70
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
className:
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
/* @__PURE__ */ N("div", {
|
|
72
|
+
className: B.surface,
|
|
73
|
+
children: [/* @__PURE__ */ N(l, {
|
|
74
|
+
className: B.floatingLabel,
|
|
75
|
+
children: [e, f.isRequired && /* @__PURE__ */ M("span", {
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: " *"
|
|
78
|
+
})]
|
|
79
|
+
}), i ? /* @__PURE__ */ M(ee, {
|
|
80
|
+
className: B.input,
|
|
81
|
+
placeholder: r,
|
|
82
|
+
rows: o
|
|
83
|
+
}) : /* @__PURE__ */ M(c, {
|
|
84
|
+
className: B.input,
|
|
85
|
+
placeholder: r
|
|
86
|
+
})]
|
|
80
87
|
}),
|
|
81
|
-
t && /* @__PURE__ */
|
|
88
|
+
t && /* @__PURE__ */ M(O, {
|
|
82
89
|
slot: "description",
|
|
83
|
-
className:
|
|
90
|
+
className: B.description,
|
|
84
91
|
children: t
|
|
85
92
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
className:
|
|
93
|
+
/* @__PURE__ */ M(a, {
|
|
94
|
+
className: B.error,
|
|
88
95
|
children: n
|
|
89
96
|
})
|
|
90
97
|
]
|
|
91
98
|
});
|
|
92
99
|
}
|
|
93
|
-
var
|
|
100
|
+
var ue = { icon: "_icon_1xold_1" }, de = {
|
|
94
101
|
"chevron-down": "m6 9 6 6 6-6",
|
|
95
102
|
"chevron-right": "m9 6 6 6-6 6",
|
|
96
103
|
"arrow-left": "m12 19-7-7 7-7M5 12h14",
|
|
@@ -100,8 +107,8 @@ var de = { icon: "_icon_1xold_1" }, fe = {
|
|
|
100
107
|
sort: "m8 3-4 4h8M8 3v18m8 0 4-4h-8m4-14v18",
|
|
101
108
|
close: "m6 6 12 12M6 18 18 6"
|
|
102
109
|
};
|
|
103
|
-
function
|
|
104
|
-
return /* @__PURE__ */
|
|
110
|
+
function V({ name: e, className: t, ...n }) {
|
|
111
|
+
return /* @__PURE__ */ M("svg", {
|
|
105
112
|
...n,
|
|
106
113
|
width: "16",
|
|
107
114
|
height: "16",
|
|
@@ -111,48 +118,54 @@ function B({ name: e, className: t, ...n }) {
|
|
|
111
118
|
strokeWidth: "2",
|
|
112
119
|
strokeLinecap: "round",
|
|
113
120
|
strokeLinejoin: "round",
|
|
114
|
-
className:
|
|
121
|
+
className: L(ue.icon, t),
|
|
115
122
|
"aria-hidden": "true",
|
|
116
123
|
focusable: "false",
|
|
117
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ M("path", { d: de[e] })
|
|
118
125
|
});
|
|
119
126
|
}
|
|
120
127
|
//#endregion
|
|
121
128
|
//#region src/components/forms/select.tsx
|
|
122
|
-
function
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
...
|
|
125
|
-
isInvalid: !!i ||
|
|
126
|
-
className:
|
|
129
|
+
function fe({ label: t, options: n, description: r, error: i, placeholder: o = "Select an option", appearance: s = "filled", className: c, ...u }) {
|
|
130
|
+
return /* @__PURE__ */ N(C, {
|
|
131
|
+
...u,
|
|
132
|
+
isInvalid: !!i || u.isInvalid,
|
|
133
|
+
className: L(B.field, c),
|
|
127
134
|
placeholder: o,
|
|
135
|
+
"data-appearance": s,
|
|
128
136
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
className:
|
|
131
|
-
children:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
/* @__PURE__ */ N("div", {
|
|
138
|
+
className: B.surface,
|
|
139
|
+
children: [/* @__PURE__ */ N(l, {
|
|
140
|
+
className: B.floatingLabel,
|
|
141
|
+
children: [t, u.isRequired && /* @__PURE__ */ M("span", {
|
|
142
|
+
"aria-hidden": "true",
|
|
143
|
+
children: " *"
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ N(e, {
|
|
146
|
+
className: B.selectButton,
|
|
147
|
+
children: [/* @__PURE__ */ M(w, {}), /* @__PURE__ */ M(V, { name: "chevron-down" })]
|
|
148
|
+
})]
|
|
136
149
|
}),
|
|
137
|
-
r && /* @__PURE__ */
|
|
150
|
+
r && /* @__PURE__ */ M(O, {
|
|
138
151
|
slot: "description",
|
|
139
|
-
className:
|
|
152
|
+
className: B.description,
|
|
140
153
|
children: r
|
|
141
154
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
className:
|
|
155
|
+
/* @__PURE__ */ M(a, {
|
|
156
|
+
className: B.error,
|
|
144
157
|
children: i
|
|
145
158
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
className:
|
|
148
|
-
children: /* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ M(y, {
|
|
160
|
+
className: B.popover,
|
|
161
|
+
children: /* @__PURE__ */ M(d, {
|
|
149
162
|
items: n,
|
|
150
|
-
className:
|
|
151
|
-
children: (e) => /* @__PURE__ */
|
|
163
|
+
className: B.list,
|
|
164
|
+
children: (e) => /* @__PURE__ */ M(f, {
|
|
152
165
|
id: e.id,
|
|
153
166
|
textValue: e.label,
|
|
154
167
|
isDisabled: e.isDisabled,
|
|
155
|
-
className:
|
|
168
|
+
className: B.option,
|
|
156
169
|
children: e.label
|
|
157
170
|
})
|
|
158
171
|
})
|
|
@@ -160,47 +173,53 @@ function pe({ label: t, options: n, description: r, error: i, placeholder: o = "
|
|
|
160
173
|
]
|
|
161
174
|
});
|
|
162
175
|
}
|
|
163
|
-
function
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
...
|
|
176
|
+
function pe({ label: t, options: r, description: i, error: s, placeholder: u = "Search…", appearance: p = "filled", className: m, ...h }) {
|
|
177
|
+
return /* @__PURE__ */ N(n, {
|
|
178
|
+
...h,
|
|
166
179
|
defaultItems: r,
|
|
167
|
-
isInvalid: !!s ||
|
|
168
|
-
className:
|
|
180
|
+
isInvalid: !!s || h.isInvalid,
|
|
181
|
+
className: L(B.field, m),
|
|
182
|
+
"data-appearance": p,
|
|
169
183
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
className:
|
|
172
|
-
children:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
/* @__PURE__ */ N("div", {
|
|
185
|
+
className: B.surface,
|
|
186
|
+
children: [/* @__PURE__ */ N(l, {
|
|
187
|
+
className: B.floatingLabel,
|
|
188
|
+
children: [t, h.isRequired && /* @__PURE__ */ M("span", {
|
|
189
|
+
"aria-hidden": "true",
|
|
190
|
+
children: " *"
|
|
191
|
+
})]
|
|
192
|
+
}), /* @__PURE__ */ N(o, {
|
|
193
|
+
className: B.combo,
|
|
194
|
+
children: [/* @__PURE__ */ M(c, {
|
|
195
|
+
className: B.input,
|
|
196
|
+
placeholder: u
|
|
197
|
+
}), /* @__PURE__ */ M(e, {
|
|
198
|
+
className: B.comboButton,
|
|
199
|
+
"aria-label": `Show ${t.toLowerCase()} options`,
|
|
200
|
+
children: /* @__PURE__ */ M(V, { name: "chevron-down" })
|
|
201
|
+
})]
|
|
183
202
|
})]
|
|
184
203
|
}),
|
|
185
|
-
i && /* @__PURE__ */
|
|
204
|
+
i && /* @__PURE__ */ M(O, {
|
|
186
205
|
slot: "description",
|
|
187
|
-
className:
|
|
206
|
+
className: B.description,
|
|
188
207
|
children: i
|
|
189
208
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
className:
|
|
209
|
+
/* @__PURE__ */ M(a, {
|
|
210
|
+
className: B.error,
|
|
192
211
|
children: s
|
|
193
212
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
className:
|
|
196
|
-
children: /* @__PURE__ */
|
|
197
|
-
className:
|
|
213
|
+
/* @__PURE__ */ M(y, {
|
|
214
|
+
className: B.popover,
|
|
215
|
+
children: /* @__PURE__ */ M(d, {
|
|
216
|
+
className: B.list,
|
|
198
217
|
renderEmptyState: () => "No results",
|
|
199
|
-
children: (e) => /* @__PURE__ */
|
|
218
|
+
children: (e) => /* @__PURE__ */ M(f, {
|
|
200
219
|
id: e.id,
|
|
201
220
|
textValue: e.label,
|
|
202
221
|
isDisabled: e.isDisabled,
|
|
203
|
-
className:
|
|
222
|
+
className: B.option,
|
|
204
223
|
children: e.label
|
|
205
224
|
})
|
|
206
225
|
})
|
|
@@ -210,97 +229,115 @@ function me({ label: t, options: r, description: i, error: s, placeholder: u = "
|
|
|
210
229
|
}
|
|
211
230
|
//#endregion
|
|
212
231
|
//#region src/components/forms/controls.tsx
|
|
213
|
-
function
|
|
214
|
-
return /* @__PURE__ */
|
|
232
|
+
function me({ children: e, className: n, ...r }) {
|
|
233
|
+
return /* @__PURE__ */ M(t, {
|
|
215
234
|
...r,
|
|
216
|
-
className:
|
|
217
|
-
children: ({ isSelected: t, isIndeterminate: n }) => /* @__PURE__ */ j
|
|
218
|
-
className:
|
|
235
|
+
className: L(B.control, n),
|
|
236
|
+
children: ({ isSelected: t, isIndeterminate: n }) => /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", {
|
|
237
|
+
className: B.check,
|
|
219
238
|
"aria-hidden": "true",
|
|
220
|
-
children: n
|
|
239
|
+
children: (t || n) && /* @__PURE__ */ M("svg", {
|
|
240
|
+
viewBox: "0 0 18 18",
|
|
241
|
+
fill: "none",
|
|
242
|
+
stroke: "currentColor",
|
|
243
|
+
strokeWidth: "2",
|
|
244
|
+
focusable: "false",
|
|
245
|
+
children: /* @__PURE__ */ M("path", { d: n ? "M3 9h12" : "M3 9l4 4 8-8" })
|
|
246
|
+
})
|
|
221
247
|
}), e] })
|
|
222
248
|
});
|
|
223
249
|
}
|
|
224
|
-
function
|
|
225
|
-
return /* @__PURE__ */
|
|
250
|
+
function he({ label: e, children: t, className: n, ...r }) {
|
|
251
|
+
return /* @__PURE__ */ N(S, {
|
|
226
252
|
...r,
|
|
227
|
-
className:
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
-
className:
|
|
253
|
+
className: L(B.field, n),
|
|
254
|
+
children: [/* @__PURE__ */ M(l, {
|
|
255
|
+
className: B.label,
|
|
230
256
|
children: e
|
|
231
257
|
}), t]
|
|
232
258
|
});
|
|
233
259
|
}
|
|
234
|
-
function
|
|
235
|
-
return /* @__PURE__ */
|
|
260
|
+
function ge({ children: e, className: t, ...n }) {
|
|
261
|
+
return /* @__PURE__ */ N(x, {
|
|
236
262
|
...n,
|
|
237
|
-
className:
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
-
className:
|
|
263
|
+
className: L(B.control, t),
|
|
264
|
+
children: [/* @__PURE__ */ M("span", {
|
|
265
|
+
className: B.radio,
|
|
240
266
|
"aria-hidden": "true"
|
|
241
267
|
}), e]
|
|
242
268
|
});
|
|
243
269
|
}
|
|
244
|
-
function
|
|
245
|
-
return /* @__PURE__ */
|
|
270
|
+
function _e({ children: e, className: t, ...n }) {
|
|
271
|
+
return /* @__PURE__ */ M(D, {
|
|
246
272
|
...n,
|
|
247
|
-
className:
|
|
248
|
-
children: [/* @__PURE__ */
|
|
249
|
-
className:
|
|
273
|
+
className: L(B.control, t),
|
|
274
|
+
children: ({ isSelected: t }) => /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", {
|
|
275
|
+
className: B.track,
|
|
250
276
|
"aria-hidden": "true",
|
|
251
|
-
children: /* @__PURE__ */
|
|
252
|
-
|
|
277
|
+
children: /* @__PURE__ */ M("span", {
|
|
278
|
+
className: B.thumb,
|
|
279
|
+
children: /* @__PURE__ */ M("svg", {
|
|
280
|
+
viewBox: "0 0 24 24",
|
|
281
|
+
fill: "none",
|
|
282
|
+
stroke: "currentColor",
|
|
283
|
+
strokeWidth: "2",
|
|
284
|
+
focusable: "false",
|
|
285
|
+
children: /* @__PURE__ */ M("path", { d: t ? "m5 12 4 4 10-10" : "m7 7 10 10M7 17 17 7" })
|
|
286
|
+
})
|
|
287
|
+
})
|
|
288
|
+
}), e] })
|
|
253
289
|
});
|
|
254
290
|
}
|
|
255
|
-
var
|
|
256
|
-
slider: "
|
|
257
|
-
svg: "
|
|
258
|
-
track: "
|
|
259
|
-
progress: "
|
|
260
|
-
handle: "
|
|
261
|
-
readout: "
|
|
262
|
-
label: "
|
|
263
|
-
value: "
|
|
264
|
-
unit: "
|
|
291
|
+
var H = {
|
|
292
|
+
slider: "_slider_17fzv_1",
|
|
293
|
+
svg: "_svg_17fzv_11",
|
|
294
|
+
track: "_track_17fzv_27",
|
|
295
|
+
progress: "_progress_17fzv_28",
|
|
296
|
+
handle: "_handle_17fzv_38",
|
|
297
|
+
readout: "_readout_17fzv_47",
|
|
298
|
+
label: "_label_17fzv_60",
|
|
299
|
+
value: "_value_17fzv_66",
|
|
300
|
+
unit: "_unit_17fzv_73"
|
|
265
301
|
};
|
|
266
302
|
//#endregion
|
|
267
303
|
//#region src/components/donut-slider/donut-slider.tsx
|
|
268
|
-
function
|
|
304
|
+
function U(e, t, n, r) {
|
|
269
305
|
let i = Number((Math.round(e / t) * t).toFixed(12));
|
|
270
306
|
return Math.min(r ?? Infinity, Math.max(n ?? -Infinity, i));
|
|
271
307
|
}
|
|
272
|
-
function
|
|
308
|
+
function W(e) {
|
|
273
309
|
let t = e.currentTarget.getBoundingClientRect();
|
|
274
310
|
return (Math.atan2(e.clientX - t.left - t.width / 2, -(e.clientY - t.top - t.height / 2)) * 180 / Math.PI + 360) % 360;
|
|
275
311
|
}
|
|
276
|
-
function
|
|
277
|
-
let [p, m] =
|
|
312
|
+
function ve({ label: e, value: t, defaultValue: n = 0, onChange: r, valuePerTurn: i = 100, step: a = 1, min: o, max: s, unit: c = "", size: l = 220, displayDecimals: u = 0, isDisabled: d = !1, className: f }) {
|
|
313
|
+
let [p, m] = I(n), [h, g] = I(!1), _ = F(null), v = F(null);
|
|
278
314
|
if (!Number.isFinite(i) || i <= 0 || !Number.isFinite(a) || a <= 0) throw RangeError("DonutSlider requires positive, finite step and valuePerTurn values.");
|
|
279
315
|
if (o !== void 0 && s !== void 0 && o > s) throw RangeError("DonutSlider min must not exceed max.");
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
316
|
+
if (!Number.isFinite(l) || l < 16) throw RangeError("DonutSlider requires a finite size of at least 16 pixels.");
|
|
317
|
+
let y = U(t ?? p, a, o, s), b = (y / i % 1 + 1) % 1, x = (b * 360 - 90) * Math.PI / 180, S = Math.round(l * .14), C = l / 2, w = C - S / 2 - 4, T = 2 * Math.PI * w, E = y.toFixed(Math.min(20, Math.max(0, Math.trunc(u))));
|
|
318
|
+
function D(e) {
|
|
319
|
+
let n = U(e, a, o, s);
|
|
283
320
|
n !== y && (t === void 0 && m(n), r?.(n));
|
|
284
321
|
}
|
|
285
|
-
function
|
|
322
|
+
function O(e) {
|
|
286
323
|
if (d || e.button !== 0 || _.current) return;
|
|
287
|
-
let t =
|
|
324
|
+
let t = W(e), n = Math.round(y / i - t / 360);
|
|
288
325
|
_.current = {
|
|
289
326
|
pointerId: e.pointerId,
|
|
290
327
|
lastAngle: t,
|
|
291
328
|
turn: n
|
|
292
|
-
}, e.currentTarget.setPointerCapture(e.pointerId), v.current?.focus(), g(!0),
|
|
329
|
+
}, e.currentTarget.setPointerCapture(e.pointerId), v.current?.focus(), g(!0), D((n + t / 360) * i), e.preventDefault();
|
|
293
330
|
}
|
|
294
|
-
function
|
|
331
|
+
function ee(e) {
|
|
295
332
|
let t = _.current;
|
|
296
333
|
if (d || !t || e.pointerId !== t.pointerId) return;
|
|
297
|
-
let n =
|
|
298
|
-
t.lastAngle > 270 && n < 90 ? t.turn += 1 : t.lastAngle < 90 && n > 270 && --t.turn, t.lastAngle = n,
|
|
334
|
+
let n = W(e);
|
|
335
|
+
t.lastAngle > 270 && n < 90 ? t.turn += 1 : t.lastAngle < 90 && n > 270 && --t.turn, t.lastAngle = n, D((t.turn + n / 360) * i), e.preventDefault();
|
|
299
336
|
}
|
|
300
|
-
function
|
|
337
|
+
function k(e) {
|
|
301
338
|
e.pointerId === _.current?.pointerId && (_.current = null, g(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
302
339
|
}
|
|
303
|
-
function
|
|
340
|
+
function A(e) {
|
|
304
341
|
if (d) return;
|
|
305
342
|
let t;
|
|
306
343
|
switch (e.key) {
|
|
@@ -328,9 +365,9 @@ function ye({ label: e, value: t, defaultValue: n = 0, onChange: r, valuePerTurn
|
|
|
328
365
|
break;
|
|
329
366
|
default: return;
|
|
330
367
|
}
|
|
331
|
-
e.preventDefault(),
|
|
368
|
+
e.preventDefault(), D(t);
|
|
332
369
|
}
|
|
333
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ N("div", {
|
|
334
371
|
ref: v,
|
|
335
372
|
role: "slider",
|
|
336
373
|
tabIndex: d ? -1 : 0,
|
|
@@ -338,165 +375,167 @@ function ye({ label: e, value: t, defaultValue: n = 0, onChange: r, valuePerTurn
|
|
|
338
375
|
"aria-valuenow": y,
|
|
339
376
|
"aria-valuemin": o,
|
|
340
377
|
"aria-valuemax": s,
|
|
341
|
-
"aria-valuetext": `${
|
|
378
|
+
"aria-valuetext": `${E}${c ? ` ${c}` : ""}`,
|
|
342
379
|
"aria-disabled": d || void 0,
|
|
343
|
-
className:
|
|
380
|
+
className: L(H.slider, f),
|
|
344
381
|
"data-dragging": h || void 0,
|
|
345
382
|
"data-disabled": d || void 0,
|
|
346
383
|
style: { "--dial-size": `${l}px` },
|
|
347
|
-
onKeyDown:
|
|
348
|
-
children: [/* @__PURE__ */
|
|
349
|
-
viewBox:
|
|
350
|
-
className:
|
|
384
|
+
onKeyDown: A,
|
|
385
|
+
children: [/* @__PURE__ */ N("svg", {
|
|
386
|
+
viewBox: `0 0 ${l} ${l}`,
|
|
387
|
+
className: H.svg,
|
|
351
388
|
"aria-hidden": "true",
|
|
352
|
-
onPointerDown:
|
|
353
|
-
onPointerMove:
|
|
354
|
-
onPointerUp:
|
|
355
|
-
onPointerCancel:
|
|
356
|
-
onLostPointerCapture:
|
|
389
|
+
onPointerDown: O,
|
|
390
|
+
onPointerMove: ee,
|
|
391
|
+
onPointerUp: k,
|
|
392
|
+
onPointerCancel: k,
|
|
393
|
+
onLostPointerCapture: k,
|
|
357
394
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
cx:
|
|
360
|
-
cy:
|
|
361
|
-
r:
|
|
362
|
-
|
|
395
|
+
/* @__PURE__ */ M("circle", {
|
|
396
|
+
cx: C,
|
|
397
|
+
cy: C,
|
|
398
|
+
r: w,
|
|
399
|
+
strokeWidth: S,
|
|
400
|
+
className: H.track
|
|
363
401
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
cx:
|
|
366
|
-
cy:
|
|
367
|
-
r:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
402
|
+
b * 360 > .5 && /* @__PURE__ */ M("circle", {
|
|
403
|
+
cx: C,
|
|
404
|
+
cy: C,
|
|
405
|
+
r: w,
|
|
406
|
+
strokeWidth: S,
|
|
407
|
+
className: H.progress,
|
|
408
|
+
strokeDasharray: `${b * T} ${T}`,
|
|
409
|
+
transform: `rotate(-90 ${C} ${C})`
|
|
371
410
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
cx:
|
|
374
|
-
cy:
|
|
375
|
-
r:
|
|
376
|
-
className:
|
|
411
|
+
/* @__PURE__ */ M("circle", {
|
|
412
|
+
cx: C + w * Math.cos(x),
|
|
413
|
+
cy: C + w * Math.sin(x),
|
|
414
|
+
r: S / 2 + 2,
|
|
415
|
+
className: H.handle
|
|
377
416
|
})
|
|
378
417
|
]
|
|
379
|
-
}), /* @__PURE__ */
|
|
380
|
-
className:
|
|
418
|
+
}), /* @__PURE__ */ N("div", {
|
|
419
|
+
className: H.readout,
|
|
381
420
|
"aria-hidden": "true",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
383
|
-
className:
|
|
421
|
+
children: [/* @__PURE__ */ M("span", {
|
|
422
|
+
className: H.label,
|
|
384
423
|
children: e
|
|
385
|
-
}), /* @__PURE__ */
|
|
386
|
-
className:
|
|
387
|
-
children: [
|
|
388
|
-
className:
|
|
424
|
+
}), /* @__PURE__ */ N("span", {
|
|
425
|
+
className: H.value,
|
|
426
|
+
children: [E, /* @__PURE__ */ M("span", {
|
|
427
|
+
className: H.unit,
|
|
389
428
|
children: c
|
|
390
429
|
})]
|
|
391
430
|
})]
|
|
392
431
|
})]
|
|
393
432
|
});
|
|
394
433
|
}
|
|
395
|
-
var
|
|
396
|
-
popover: "
|
|
397
|
-
menu: "
|
|
398
|
-
item: "
|
|
399
|
-
submenuIcon: "
|
|
400
|
-
separator: "
|
|
434
|
+
var G = {
|
|
435
|
+
popover: "_popover_3pd1a_1",
|
|
436
|
+
menu: "_menu_3pd1a_14",
|
|
437
|
+
item: "_item_3pd1a_22",
|
|
438
|
+
submenuIcon: "_submenuIcon_3pd1a_45",
|
|
439
|
+
separator: "_separator_3pd1a_48"
|
|
401
440
|
};
|
|
402
441
|
//#endregion
|
|
403
442
|
//#region src/components/menu/menu.tsx
|
|
404
|
-
function
|
|
405
|
-
return /* @__PURE__ */
|
|
443
|
+
function K({ className: e, ...t }) {
|
|
444
|
+
return /* @__PURE__ */ M(p, {
|
|
406
445
|
...t,
|
|
407
|
-
className:
|
|
446
|
+
className: L(G.menu, e)
|
|
408
447
|
});
|
|
409
448
|
}
|
|
410
|
-
function
|
|
411
|
-
return /* @__PURE__ */
|
|
449
|
+
function ye({ className: e, tone: t = "default", children: n, ...r }) {
|
|
450
|
+
return /* @__PURE__ */ M(m, {
|
|
412
451
|
...r,
|
|
413
452
|
textValue: r.textValue ?? (typeof n == "string" ? n : void 0),
|
|
414
|
-
className:
|
|
453
|
+
className: L(G.item, e),
|
|
415
454
|
"data-tone": t,
|
|
416
|
-
children: ({ hasSubmenu: e }) => /* @__PURE__ */ j
|
|
455
|
+
children: ({ hasSubmenu: e }) => /* @__PURE__ */ N(j, { children: [n, e && /* @__PURE__ */ M(V, {
|
|
417
456
|
name: "chevron-right",
|
|
418
|
-
className:
|
|
457
|
+
className: G.submenuIcon
|
|
419
458
|
})] })
|
|
420
459
|
});
|
|
421
460
|
}
|
|
422
|
-
function
|
|
423
|
-
return /* @__PURE__ */
|
|
461
|
+
function q({ className: e, ...t }) {
|
|
462
|
+
return /* @__PURE__ */ M(y, {
|
|
424
463
|
...t,
|
|
425
|
-
className:
|
|
464
|
+
className: L(G.popover, e)
|
|
426
465
|
});
|
|
427
466
|
}
|
|
428
|
-
function
|
|
429
|
-
return /* @__PURE__ */
|
|
467
|
+
function be() {
|
|
468
|
+
return /* @__PURE__ */ M(T, { className: G.separator });
|
|
430
469
|
}
|
|
431
|
-
var
|
|
432
|
-
group: "
|
|
433
|
-
primary: "
|
|
434
|
-
trigger: "
|
|
470
|
+
var J = {
|
|
471
|
+
group: "_group_zvomd_1",
|
|
472
|
+
primary: "_primary_zvomd_6",
|
|
473
|
+
trigger: "_trigger_zvomd_10"
|
|
435
474
|
};
|
|
436
475
|
//#endregion
|
|
437
476
|
//#region src/components/split-button/split-button.tsx
|
|
438
|
-
function
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
className:
|
|
441
|
-
children: [/* @__PURE__ */
|
|
477
|
+
function xe({ label: e, icon: t, menuLabel: n = "More actions", children: r, className: i, ...a }) {
|
|
478
|
+
return /* @__PURE__ */ N("div", {
|
|
479
|
+
className: L(J.group, i),
|
|
480
|
+
children: [/* @__PURE__ */ N(z, {
|
|
442
481
|
...a,
|
|
443
|
-
className:
|
|
482
|
+
className: J.primary,
|
|
444
483
|
children: [t, e]
|
|
445
|
-
}), /* @__PURE__ */
|
|
484
|
+
}), /* @__PURE__ */ N(g, { children: [/* @__PURE__ */ M(z, {
|
|
446
485
|
tone: a.tone,
|
|
447
486
|
background: a.background,
|
|
448
487
|
isDisabled: a.isDisabled,
|
|
449
|
-
className:
|
|
488
|
+
className: J.trigger,
|
|
450
489
|
"aria-label": n,
|
|
451
|
-
children: /* @__PURE__ */
|
|
452
|
-
}), /* @__PURE__ */
|
|
490
|
+
children: /* @__PURE__ */ M(V, { name: "chevron-down" })
|
|
491
|
+
}), /* @__PURE__ */ M(q, {
|
|
453
492
|
placement: "bottom end",
|
|
454
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ M(K, {
|
|
455
494
|
"aria-label": n,
|
|
456
495
|
children: r
|
|
457
496
|
})
|
|
458
497
|
})] })]
|
|
459
498
|
});
|
|
460
499
|
}
|
|
461
|
-
var
|
|
462
|
-
overlay: "
|
|
463
|
-
modal: "
|
|
464
|
-
dialog: "
|
|
465
|
-
header: "
|
|
466
|
-
title: "
|
|
467
|
-
description: "
|
|
500
|
+
var Y = {
|
|
501
|
+
overlay: "_overlay_18rq5_1",
|
|
502
|
+
modal: "_modal_18rq5_11",
|
|
503
|
+
dialog: "_dialog_18rq5_22",
|
|
504
|
+
header: "_header_18rq5_27",
|
|
505
|
+
title: "_title_18rq5_34",
|
|
506
|
+
description: "_description_18rq5_39"
|
|
468
507
|
};
|
|
469
508
|
//#endregion
|
|
470
509
|
//#region src/components/dialog/dialog.tsx
|
|
471
|
-
function
|
|
472
|
-
let l =
|
|
473
|
-
return /* @__PURE__ */
|
|
510
|
+
function Se({ title: e, description: t, children: n, role: i = "dialog", className: a, isDismissable: o = !0, ...c }) {
|
|
511
|
+
let l = ae();
|
|
512
|
+
return /* @__PURE__ */ M(v, {
|
|
474
513
|
...c,
|
|
475
514
|
isDismissable: o,
|
|
476
|
-
className:
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
-
className:
|
|
479
|
-
children: /* @__PURE__ */
|
|
515
|
+
className: Y.overlay,
|
|
516
|
+
children: /* @__PURE__ */ M(_, {
|
|
517
|
+
className: Y.modal,
|
|
518
|
+
children: /* @__PURE__ */ M(r, {
|
|
480
519
|
role: i,
|
|
481
520
|
"aria-describedby": t ? l : void 0,
|
|
482
|
-
className:
|
|
483
|
-
children: ({ close: r }) => /* @__PURE__ */ j
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
className:
|
|
486
|
-
children: [/* @__PURE__ */
|
|
521
|
+
className: L(Y.dialog, a),
|
|
522
|
+
children: ({ close: r }) => /* @__PURE__ */ N(j, { children: [
|
|
523
|
+
/* @__PURE__ */ N("header", {
|
|
524
|
+
className: Y.header,
|
|
525
|
+
children: [/* @__PURE__ */ M(s, {
|
|
487
526
|
slot: "title",
|
|
488
|
-
className:
|
|
527
|
+
className: Y.title,
|
|
489
528
|
children: e
|
|
490
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ M(z, {
|
|
491
530
|
variant: "icon",
|
|
492
531
|
"aria-label": "Close dialog",
|
|
493
532
|
onPress: r,
|
|
494
|
-
children: /* @__PURE__ */
|
|
533
|
+
children: /* @__PURE__ */ M(V, { name: "close" })
|
|
495
534
|
})]
|
|
496
535
|
}),
|
|
497
|
-
t && /* @__PURE__ */
|
|
536
|
+
t && /* @__PURE__ */ M("p", {
|
|
498
537
|
id: l,
|
|
499
|
-
className:
|
|
538
|
+
className: Y.description,
|
|
500
539
|
children: t
|
|
501
540
|
}),
|
|
502
541
|
typeof n == "function" ? n({ close: r }) : n
|
|
@@ -505,34 +544,34 @@ function Ce({ title: e, description: t, children: n, role: i = "dialog", classNa
|
|
|
505
544
|
})
|
|
506
545
|
});
|
|
507
546
|
}
|
|
508
|
-
var
|
|
547
|
+
var Ce = { tooltip: "_tooltip_trnx2_1" };
|
|
509
548
|
//#endregion
|
|
510
549
|
//#region src/components/tooltip/tooltip.tsx
|
|
511
|
-
function
|
|
512
|
-
return /* @__PURE__ */
|
|
550
|
+
function we({ children: e, content: t, placement: n = "top", delay: r = 500 }) {
|
|
551
|
+
return /* @__PURE__ */ N(te, {
|
|
513
552
|
delay: r,
|
|
514
|
-
children: [e, /* @__PURE__ */ A
|
|
515
|
-
className:
|
|
553
|
+
children: [e, /* @__PURE__ */ M(A, {
|
|
554
|
+
className: Ce.tooltip,
|
|
516
555
|
placement: n,
|
|
517
556
|
children: t
|
|
518
557
|
})]
|
|
519
558
|
});
|
|
520
559
|
}
|
|
521
|
-
var
|
|
522
|
-
container: "
|
|
523
|
-
scroll: "
|
|
524
|
-
table: "
|
|
525
|
-
caption: "
|
|
526
|
-
captionText: "
|
|
527
|
-
sort: "
|
|
528
|
-
pagination: "
|
|
529
|
-
empty: "
|
|
530
|
-
srOnly: "
|
|
560
|
+
var X = {
|
|
561
|
+
container: "_container_kj4bs_1",
|
|
562
|
+
scroll: "_scroll_kj4bs_12",
|
|
563
|
+
table: "_table_kj4bs_15",
|
|
564
|
+
caption: "_caption_kj4bs_20",
|
|
565
|
+
captionText: "_captionText_kj4bs_27",
|
|
566
|
+
sort: "_sort_kj4bs_61",
|
|
567
|
+
pagination: "_pagination_kj4bs_78",
|
|
568
|
+
empty: "_empty_kj4bs_88",
|
|
569
|
+
srOnly: "_srOnly_kj4bs_95"
|
|
531
570
|
};
|
|
532
571
|
//#endregion
|
|
533
572
|
//#region src/components/table/data-table.tsx
|
|
534
|
-
function
|
|
535
|
-
let [u, d] =
|
|
573
|
+
function Te({ caption: e, rows: t, columns: n, getRowKey: r, pageSize: i = 10, selectedKey: a = null, onSelectionChange: o, getRowLabel: s, emptyMessage: c = "No results found.", className: l }) {
|
|
574
|
+
let [u, d] = I(null), [f, p] = I(0), m = ae(), h = Math.max(1, Math.trunc(i)), g = Math.max(1, Math.ceil(t.length / h)), _ = Math.min(f, g - 1), v = n.find((e) => e.id === u?.column)?.compare, y = (v && u ? [...t].sort((e, t) => v(e, t) * (u.direction === "ascending" ? 1 : -1)) : t).slice(_ * h, (_ + 1) * h);
|
|
536
575
|
function b(e) {
|
|
537
576
|
d((t) => t?.column === e ? t.direction === "ascending" ? {
|
|
538
577
|
column: e,
|
|
@@ -542,49 +581,49 @@ function Ee({ caption: e, rows: t, columns: n, getRowKey: r, pageSize: i = 10, s
|
|
|
542
581
|
direction: "ascending"
|
|
543
582
|
}), p(0);
|
|
544
583
|
}
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
className:
|
|
584
|
+
return /* @__PURE__ */ N("div", {
|
|
585
|
+
className: L(X.container, l),
|
|
547
586
|
children: [
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
className:
|
|
550
|
-
children: /* @__PURE__ */
|
|
551
|
-
className:
|
|
587
|
+
/* @__PURE__ */ M("div", {
|
|
588
|
+
className: X.scroll,
|
|
589
|
+
children: /* @__PURE__ */ N("table", {
|
|
590
|
+
className: X.table,
|
|
552
591
|
"aria-describedby": y.length === 0 ? m : void 0,
|
|
553
592
|
children: [
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
className:
|
|
556
|
-
children: /* @__PURE__ */
|
|
557
|
-
className:
|
|
593
|
+
/* @__PURE__ */ M("caption", {
|
|
594
|
+
className: X.caption,
|
|
595
|
+
children: /* @__PURE__ */ M("span", {
|
|
596
|
+
className: X.captionText,
|
|
558
597
|
children: e
|
|
559
598
|
})
|
|
560
599
|
}),
|
|
561
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ M("thead", { children: /* @__PURE__ */ N("tr", { children: [o && /* @__PURE__ */ M("th", {
|
|
562
601
|
scope: "col",
|
|
563
|
-
children: /* @__PURE__ */
|
|
564
|
-
className:
|
|
602
|
+
children: /* @__PURE__ */ M("span", {
|
|
603
|
+
className: X.srOnly,
|
|
565
604
|
children: "Selection"
|
|
566
605
|
})
|
|
567
|
-
}), n.map((e) => /* @__PURE__ */
|
|
606
|
+
}), n.map((e) => /* @__PURE__ */ M("th", {
|
|
568
607
|
scope: "col",
|
|
569
608
|
"data-align": e.align,
|
|
570
609
|
"aria-sort": e.compare ? u?.column === e.id ? u.direction : "none" : void 0,
|
|
571
|
-
children: e.compare ? /* @__PURE__ */
|
|
572
|
-
className:
|
|
610
|
+
children: e.compare ? /* @__PURE__ */ N("button", {
|
|
611
|
+
className: X.sort,
|
|
573
612
|
onClick: () => b(e.id),
|
|
574
|
-
children: [e.label, /* @__PURE__ */
|
|
613
|
+
children: [e.label, /* @__PURE__ */ M(V, { name: u?.column === e.id ? u.direction === "ascending" ? "arrow-up" : "arrow-down" : "sort" })]
|
|
575
614
|
}) : e.label
|
|
576
615
|
}, e.id))] }) }),
|
|
577
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ M("tbody", { children: y.map((e) => {
|
|
578
617
|
let t = r(e);
|
|
579
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ N("tr", {
|
|
580
619
|
"data-selected": t === a || void 0,
|
|
581
|
-
children: [o && /* @__PURE__ */
|
|
620
|
+
children: [o && /* @__PURE__ */ M("td", { children: /* @__PURE__ */ M(z, {
|
|
582
621
|
variant: "icon",
|
|
583
622
|
"aria-label": `Select ${s?.(e) ?? String(t)}`,
|
|
584
623
|
"aria-pressed": a === t,
|
|
585
624
|
onPress: () => o(a === t ? null : t),
|
|
586
|
-
children: /* @__PURE__ */
|
|
587
|
-
}) }), n.map((t) => /* @__PURE__ */
|
|
625
|
+
children: /* @__PURE__ */ M(V, { name: "chevron-right" })
|
|
626
|
+
}) }), n.map((t) => /* @__PURE__ */ M("td", {
|
|
588
627
|
"data-align": t.align,
|
|
589
628
|
children: t.renderCell(e)
|
|
590
629
|
}, t.id))]
|
|
@@ -593,71 +632,71 @@ function Ee({ caption: e, rows: t, columns: n, getRowKey: r, pageSize: i = 10, s
|
|
|
593
632
|
]
|
|
594
633
|
})
|
|
595
634
|
}),
|
|
596
|
-
y.length === 0 && /* @__PURE__ */
|
|
635
|
+
y.length === 0 && /* @__PURE__ */ M("p", {
|
|
597
636
|
id: m,
|
|
598
|
-
className:
|
|
637
|
+
className: X.empty,
|
|
599
638
|
children: c
|
|
600
639
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ N("nav", {
|
|
602
641
|
"aria-label": `${e} pagination`,
|
|
603
|
-
className:
|
|
642
|
+
className: X.pagination,
|
|
604
643
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ N("span", { children: [
|
|
606
645
|
t.length === 0 ? 0 : _ * h + 1,
|
|
607
646
|
"–",
|
|
608
647
|
Math.min((_ + 1) * h, t.length),
|
|
609
648
|
" of ",
|
|
610
649
|
t.length
|
|
611
650
|
] }),
|
|
612
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ M(z, {
|
|
613
652
|
variant: "text",
|
|
614
653
|
"aria-label": "Previous page",
|
|
615
654
|
isDisabled: _ === 0,
|
|
616
655
|
onPress: () => p(_ - 1),
|
|
617
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ M(V, { name: "arrow-left" })
|
|
618
657
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ N("span", { children: [
|
|
620
659
|
"Page ",
|
|
621
660
|
_ + 1,
|
|
622
661
|
" of ",
|
|
623
662
|
g
|
|
624
663
|
] }),
|
|
625
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ M(z, {
|
|
626
665
|
variant: "text",
|
|
627
666
|
"aria-label": "Next page",
|
|
628
667
|
isDisabled: _ === g - 1,
|
|
629
668
|
onPress: () => p(_ + 1),
|
|
630
|
-
children: /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ M(V, { name: "arrow-right" })
|
|
631
670
|
})
|
|
632
671
|
]
|
|
633
672
|
})
|
|
634
673
|
]
|
|
635
674
|
});
|
|
636
675
|
}
|
|
637
|
-
var
|
|
638
|
-
alert: "
|
|
639
|
-
title: "
|
|
640
|
-
region: "
|
|
641
|
-
dismiss: "
|
|
676
|
+
var Z = {
|
|
677
|
+
alert: "_alert_1b9pw_1",
|
|
678
|
+
title: "_title_1b9pw_30",
|
|
679
|
+
region: "_region_1b9pw_34",
|
|
680
|
+
dismiss: "_dismiss_1b9pw_45"
|
|
642
681
|
};
|
|
643
682
|
//#endregion
|
|
644
683
|
//#region src/components/notifications/notifications.tsx
|
|
645
|
-
function
|
|
646
|
-
return /* @__PURE__ */
|
|
684
|
+
function Ee({ tone: e = "info", title: t, children: n, className: r, role: i, ...a }) {
|
|
685
|
+
return /* @__PURE__ */ M("div", {
|
|
647
686
|
...a,
|
|
648
687
|
role: i ?? (e === "error" ? "alert" : "status"),
|
|
649
|
-
className:
|
|
688
|
+
className: L(Z.alert, r),
|
|
650
689
|
"data-tone": e,
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
className:
|
|
690
|
+
children: /* @__PURE__ */ N("div", { children: [t && /* @__PURE__ */ M("strong", {
|
|
691
|
+
className: Z.title,
|
|
653
692
|
children: t
|
|
654
693
|
}), n] })
|
|
655
694
|
});
|
|
656
695
|
}
|
|
657
|
-
var
|
|
696
|
+
var De = ne(null);
|
|
658
697
|
function Oe({ notification: e, dismiss: t }) {
|
|
659
|
-
let [n, r] =
|
|
660
|
-
return
|
|
698
|
+
let [n, r] = I(!1), [i, a] = I(!1), o = F(e.duration);
|
|
699
|
+
return ie(() => {
|
|
661
700
|
if (n || i || e.duration <= 0) return;
|
|
662
701
|
let r = Date.now(), a = setTimeout(() => t(e.id), Math.max(0, o.current));
|
|
663
702
|
return () => {
|
|
@@ -669,8 +708,8 @@ function Oe({ notification: e, dismiss: t }) {
|
|
|
669
708
|
e.duration,
|
|
670
709
|
e.id,
|
|
671
710
|
t
|
|
672
|
-
]), /* @__PURE__ */
|
|
673
|
-
className:
|
|
711
|
+
]), /* @__PURE__ */ N("div", {
|
|
712
|
+
className: Z.alert,
|
|
674
713
|
"data-tone": e.tone,
|
|
675
714
|
role: e.tone === "error" ? "alert" : "status",
|
|
676
715
|
onMouseEnter: () => r(!0),
|
|
@@ -679,19 +718,19 @@ function Oe({ notification: e, dismiss: t }) {
|
|
|
679
718
|
onBlur: (e) => {
|
|
680
719
|
e.currentTarget.contains(e.relatedTarget) || a(!1);
|
|
681
720
|
},
|
|
682
|
-
children: [/* @__PURE__ */
|
|
683
|
-
className:
|
|
721
|
+
children: [/* @__PURE__ */ N("div", { children: [e.title && /* @__PURE__ */ M("strong", {
|
|
722
|
+
className: Z.title,
|
|
684
723
|
children: e.title
|
|
685
|
-
}), e.message] }), /* @__PURE__ */
|
|
686
|
-
className:
|
|
724
|
+
}), e.message] }), /* @__PURE__ */ M("button", {
|
|
725
|
+
className: Z.dismiss,
|
|
687
726
|
onClick: () => t(e.id),
|
|
688
727
|
"aria-label": "Dismiss notification",
|
|
689
|
-
children: /* @__PURE__ */
|
|
728
|
+
children: /* @__PURE__ */ M(V, { name: "close" })
|
|
690
729
|
})]
|
|
691
730
|
});
|
|
692
731
|
}
|
|
693
732
|
function ke({ children: e, defaultDuration: t = 4e3 }) {
|
|
694
|
-
let [n, r] =
|
|
733
|
+
let [n, r] = I([]), i = F(0), a = P((e) => r((t) => t.filter((t) => t.id !== e)), []), o = P(() => r([]), []), s = P((e, n, a = {}) => {
|
|
695
734
|
let o = ++i.current;
|
|
696
735
|
return r((r) => [...r, {
|
|
697
736
|
...a,
|
|
@@ -700,7 +739,7 @@ function ke({ children: e, defaultDuration: t = 4e3 }) {
|
|
|
700
739
|
message: n,
|
|
701
740
|
duration: a.duration ?? t
|
|
702
741
|
}]), o;
|
|
703
|
-
}, [t]), c =
|
|
742
|
+
}, [t]), c = oe(() => ({
|
|
704
743
|
info: (e, t) => s("info", e, t),
|
|
705
744
|
success: (e, t) => s("success", e, t),
|
|
706
745
|
warn: (e, t) => s("warn", e, t),
|
|
@@ -712,13 +751,13 @@ function ke({ children: e, defaultDuration: t = 4e3 }) {
|
|
|
712
751
|
a,
|
|
713
752
|
o
|
|
714
753
|
]);
|
|
715
|
-
return /* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ N(De, {
|
|
716
755
|
value: c,
|
|
717
|
-
children: [e, n.length > 0 && typeof document < "u" &&
|
|
718
|
-
className:
|
|
756
|
+
children: [e, n.length > 0 && typeof document < "u" && se(/* @__PURE__ */ M("section", {
|
|
757
|
+
className: Z.region,
|
|
719
758
|
"aria-label": "Notifications",
|
|
720
759
|
"data-react-aria-top-layer": !0,
|
|
721
|
-
children: n.map((e) => /* @__PURE__ */
|
|
760
|
+
children: n.map((e) => /* @__PURE__ */ M(Oe, {
|
|
722
761
|
notification: e,
|
|
723
762
|
dismiss: a
|
|
724
763
|
}, e.id))
|
|
@@ -726,28 +765,28 @@ function ke({ children: e, defaultDuration: t = 4e3 }) {
|
|
|
726
765
|
});
|
|
727
766
|
}
|
|
728
767
|
function Ae() {
|
|
729
|
-
let e =
|
|
768
|
+
let e = re(De);
|
|
730
769
|
if (!e) throw Error("useNotifications must be used within NotificationsProvider.");
|
|
731
770
|
return e;
|
|
732
771
|
}
|
|
733
772
|
var Q = {
|
|
734
|
-
bars: "
|
|
735
|
-
stretch: "
|
|
736
|
-
spinner: "
|
|
737
|
-
spin: "
|
|
738
|
-
progress: "
|
|
739
|
-
track: "
|
|
740
|
-
fill: "
|
|
741
|
-
travel: "
|
|
773
|
+
bars: "_bars_10i45_1",
|
|
774
|
+
stretch: "_stretch_10i45_1",
|
|
775
|
+
spinner: "_spinner_10i45_26",
|
|
776
|
+
spin: "_spin_10i45_26",
|
|
777
|
+
progress: "_progress_10i45_35",
|
|
778
|
+
track: "_track_10i45_42",
|
|
779
|
+
fill: "_fill_10i45_48",
|
|
780
|
+
travel: "_travel_10i45_1"
|
|
742
781
|
};
|
|
743
782
|
//#endregion
|
|
744
783
|
//#region src/components/loader/loader.tsx
|
|
745
784
|
function je({ label: e = "Loading", color: t, className: n }) {
|
|
746
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ M("div", {
|
|
747
786
|
role: "progressbar",
|
|
748
787
|
"aria-label": e,
|
|
749
788
|
"aria-busy": "true",
|
|
750
|
-
className:
|
|
789
|
+
className: L(Q.bars, n),
|
|
751
790
|
style: { "--bt-bar-loader-color": t },
|
|
752
791
|
children: [
|
|
753
792
|
0,
|
|
@@ -755,24 +794,24 @@ function je({ label: e = "Loading", color: t, className: n }) {
|
|
|
755
794
|
2,
|
|
756
795
|
3,
|
|
757
796
|
4
|
|
758
|
-
].map((e) => /* @__PURE__ */
|
|
797
|
+
].map((e) => /* @__PURE__ */ M("span", { "aria-hidden": "true" }, e))
|
|
759
798
|
});
|
|
760
799
|
}
|
|
761
800
|
function Me({ label: e = "Loading", className: t }) {
|
|
762
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ M("div", {
|
|
763
802
|
role: "progressbar",
|
|
764
803
|
"aria-label": e,
|
|
765
804
|
"aria-busy": "true",
|
|
766
|
-
className:
|
|
805
|
+
className: L(Q.spinner, t)
|
|
767
806
|
});
|
|
768
807
|
}
|
|
769
808
|
function Ne({ label: e, className: t, ...n }) {
|
|
770
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ M(b, {
|
|
771
810
|
...n,
|
|
772
|
-
className:
|
|
773
|
-
children: ({ percentage: t, isIndeterminate: n }) => /* @__PURE__ */ j
|
|
811
|
+
className: L(Q.progress, t),
|
|
812
|
+
children: ({ percentage: t, isIndeterminate: n }) => /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(l, { children: e }), /* @__PURE__ */ M("div", {
|
|
774
813
|
className: Q.track,
|
|
775
|
-
children: /* @__PURE__ */
|
|
814
|
+
children: /* @__PURE__ */ M("div", {
|
|
776
815
|
className: Q.fill,
|
|
777
816
|
"data-indeterminate": n || void 0,
|
|
778
817
|
style: { width: n ? "35%" : `${t}%` }
|
|
@@ -781,51 +820,51 @@ function Ne({ label: e, className: t, ...n }) {
|
|
|
781
820
|
});
|
|
782
821
|
}
|
|
783
822
|
var $ = {
|
|
784
|
-
card: "
|
|
785
|
-
badge: "
|
|
786
|
-
heading: "
|
|
787
|
-
text: "
|
|
788
|
-
muted: "
|
|
789
|
-
code: "
|
|
790
|
-
divider: "
|
|
823
|
+
card: "_card_n4hcj_1",
|
|
824
|
+
badge: "_badge_n4hcj_15",
|
|
825
|
+
heading: "_heading_n4hcj_49",
|
|
826
|
+
text: "_text_n4hcj_71",
|
|
827
|
+
muted: "_muted_n4hcj_76",
|
|
828
|
+
code: "_code_n4hcj_79",
|
|
829
|
+
divider: "_divider_n4hcj_89"
|
|
791
830
|
};
|
|
792
831
|
//#endregion
|
|
793
832
|
//#region src/components/surface/surface.tsx
|
|
794
833
|
function Pe({ variant: e = "outlined", className: t, ...n }) {
|
|
795
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ M("section", {
|
|
796
835
|
...n,
|
|
797
|
-
className:
|
|
836
|
+
className: L($.card, t),
|
|
798
837
|
"data-variant": e
|
|
799
838
|
});
|
|
800
839
|
}
|
|
801
840
|
function Fe({ tone: e = "neutral", className: t, ...n }) {
|
|
802
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ M("span", {
|
|
803
842
|
...n,
|
|
804
|
-
className:
|
|
843
|
+
className: L($.badge, t),
|
|
805
844
|
"data-tone": e
|
|
806
845
|
});
|
|
807
846
|
}
|
|
808
847
|
function Ie({ level: e = 2, className: t, ...n }) {
|
|
809
848
|
let r = `h${e}`;
|
|
810
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ M(r, {
|
|
811
850
|
...n,
|
|
812
|
-
className:
|
|
851
|
+
className: L($.heading, t)
|
|
813
852
|
});
|
|
814
853
|
}
|
|
815
854
|
function Le({ muted: e = !1, className: t, ...n }) {
|
|
816
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ M("p", {
|
|
817
856
|
...n,
|
|
818
|
-
className:
|
|
857
|
+
className: L($.text, e && $.muted, t)
|
|
819
858
|
});
|
|
820
859
|
}
|
|
821
860
|
function Re({ children: e }) {
|
|
822
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ M("code", {
|
|
823
862
|
className: $.code,
|
|
824
863
|
children: e
|
|
825
864
|
});
|
|
826
865
|
}
|
|
827
866
|
function ze() {
|
|
828
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ M("hr", { className: $.divider });
|
|
829
868
|
}
|
|
830
869
|
//#endregion
|
|
831
|
-
export {
|
|
870
|
+
export { Ee as Alert, Fe as Badge, je as BarLoader, z as Button, Pe as Card, me as Checkbox, Re as Code, pe as ComboBox, Te as DataTable, Se as Dialog, i as DialogTrigger, ze as Divider, ve as DonutSlider, Ie as Heading, ce as LinkButton, K as Menu, ye as MenuItem, q as MenuPopover, be as MenuSeparator, h as MenuTrigger, ke as NotificationsProvider, Ne as ProgressBar, ge as Radio, he as RadioGroup, fe as Select, Me as Spinner, xe as SplitButton, E as SubmenuTrigger, _e as Switch, Le as Text, le as TextField, we as Tooltip, Ae as useNotifications };
|