prime-design-system 1.0.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 +110 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/prime-design-system.css +2 -0
- package/dist/prime-design-system.es.js +2729 -0
- package/dist/prime-design-system.umd.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,2729 @@
|
|
|
1
|
+
import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
2
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as u } from "react-dom";
|
|
4
|
+
//#region src/components/Accordion/Accordion.tsx
|
|
5
|
+
var d = e.forwardRef(({ className: e = "", items: t, allowMultiple: n = !1, ...r }, i) => {
|
|
6
|
+
let [a, s] = o(/* @__PURE__ */ new Set()), u = (e) => {
|
|
7
|
+
s((t) => {
|
|
8
|
+
let r = new Set(t);
|
|
9
|
+
return r.has(e) ? r.delete(e) : (n || r.clear(), r.add(e)), r;
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ c("div", {
|
|
13
|
+
className: `nd-accordion-wrapper ${e}`,
|
|
14
|
+
ref: i,
|
|
15
|
+
...r,
|
|
16
|
+
children: t.map((e) => {
|
|
17
|
+
let t = a.has(e.id);
|
|
18
|
+
return /* @__PURE__ */ l("div", {
|
|
19
|
+
className: "nd-accordion-item",
|
|
20
|
+
children: [/* @__PURE__ */ l("button", {
|
|
21
|
+
className: "nd-accordion-header",
|
|
22
|
+
onClick: () => u(e.id),
|
|
23
|
+
"aria-expanded": t,
|
|
24
|
+
children: [/* @__PURE__ */ c("span", { children: e.title }), /* @__PURE__ */ c("svg", {
|
|
25
|
+
className: `nd-accordion-icon ${t ? "nd-accordion-icon--expanded" : ""}`,
|
|
26
|
+
width: "20",
|
|
27
|
+
height: "20",
|
|
28
|
+
viewBox: "0 0 24 24",
|
|
29
|
+
fill: "none",
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
strokeWidth: "2",
|
|
32
|
+
strokeLinecap: "round",
|
|
33
|
+
strokeLinejoin: "round",
|
|
34
|
+
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
35
|
+
})]
|
|
36
|
+
}), /* @__PURE__ */ c("div", {
|
|
37
|
+
className: `nd-accordion-content ${t ? "nd-accordion-content--expanded" : ""}`,
|
|
38
|
+
children: e.content
|
|
39
|
+
})]
|
|
40
|
+
}, e.id);
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
d.displayName = "Accordion";
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/Alert/Alert.tsx
|
|
47
|
+
var f = {
|
|
48
|
+
info: /* @__PURE__ */ l("svg", {
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
strokeWidth: "2",
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ c("circle", {
|
|
59
|
+
cx: "12",
|
|
60
|
+
cy: "12",
|
|
61
|
+
r: "10"
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ c("line", {
|
|
64
|
+
x1: "12",
|
|
65
|
+
y1: "16",
|
|
66
|
+
x2: "12",
|
|
67
|
+
y2: "12"
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ c("line", {
|
|
70
|
+
x1: "12",
|
|
71
|
+
y1: "8",
|
|
72
|
+
x2: "12.01",
|
|
73
|
+
y2: "8"
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
success: /* @__PURE__ */ l("svg", {
|
|
78
|
+
width: "100%",
|
|
79
|
+
height: "100%",
|
|
80
|
+
viewBox: "0 0 24 24",
|
|
81
|
+
fill: "none",
|
|
82
|
+
stroke: "currentColor",
|
|
83
|
+
strokeWidth: "2",
|
|
84
|
+
strokeLinecap: "round",
|
|
85
|
+
strokeLinejoin: "round",
|
|
86
|
+
children: [/* @__PURE__ */ c("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ c("polyline", { points: "22 4 12 14.01 9 11.01" })]
|
|
87
|
+
}),
|
|
88
|
+
warning: /* @__PURE__ */ l("svg", {
|
|
89
|
+
width: "100%",
|
|
90
|
+
height: "100%",
|
|
91
|
+
viewBox: "0 0 24 24",
|
|
92
|
+
fill: "none",
|
|
93
|
+
stroke: "currentColor",
|
|
94
|
+
strokeWidth: "2",
|
|
95
|
+
strokeLinecap: "round",
|
|
96
|
+
strokeLinejoin: "round",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ c("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
99
|
+
/* @__PURE__ */ c("line", {
|
|
100
|
+
x1: "12",
|
|
101
|
+
y1: "9",
|
|
102
|
+
x2: "12",
|
|
103
|
+
y2: "13"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ c("line", {
|
|
106
|
+
x1: "12",
|
|
107
|
+
y1: "17",
|
|
108
|
+
x2: "12.01",
|
|
109
|
+
y2: "17"
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
error: /* @__PURE__ */ l("svg", {
|
|
114
|
+
width: "100%",
|
|
115
|
+
height: "100%",
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
fill: "none",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
strokeWidth: "2",
|
|
120
|
+
strokeLinecap: "round",
|
|
121
|
+
strokeLinejoin: "round",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ c("circle", {
|
|
124
|
+
cx: "12",
|
|
125
|
+
cy: "12",
|
|
126
|
+
r: "10"
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ c("line", {
|
|
129
|
+
x1: "15",
|
|
130
|
+
y1: "9",
|
|
131
|
+
x2: "9",
|
|
132
|
+
y2: "15"
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ c("line", {
|
|
135
|
+
x1: "9",
|
|
136
|
+
y1: "9",
|
|
137
|
+
x2: "15",
|
|
138
|
+
y2: "15"
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
})
|
|
142
|
+
}, p = e.forwardRef(({ className: e = "", title: t, description: n, variant: r = "info", icon: i, closable: a = !1, onClose: s, children: u, ...d }, p) => {
|
|
143
|
+
let [m, h] = o(!0), g = () => {
|
|
144
|
+
h(!1), s && s();
|
|
145
|
+
};
|
|
146
|
+
if (!m) return null;
|
|
147
|
+
let _ = i || f[r];
|
|
148
|
+
return /* @__PURE__ */ l("div", {
|
|
149
|
+
className: `nd-alert nd-alert--${r} ${e}`,
|
|
150
|
+
ref: p,
|
|
151
|
+
role: "alert",
|
|
152
|
+
...d,
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ c("div", {
|
|
155
|
+
className: "nd-alert-icon",
|
|
156
|
+
children: _
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ l("div", {
|
|
159
|
+
className: "nd-alert-content",
|
|
160
|
+
children: [
|
|
161
|
+
t && /* @__PURE__ */ c("h5", {
|
|
162
|
+
className: "nd-alert-title",
|
|
163
|
+
children: t
|
|
164
|
+
}),
|
|
165
|
+
n && /* @__PURE__ */ c("p", {
|
|
166
|
+
className: "nd-alert-description",
|
|
167
|
+
children: n
|
|
168
|
+
}),
|
|
169
|
+
u && /* @__PURE__ */ c("div", {
|
|
170
|
+
className: "nd-alert-description",
|
|
171
|
+
children: u
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
a && /* @__PURE__ */ c("button", {
|
|
176
|
+
className: "nd-alert-close",
|
|
177
|
+
onClick: g,
|
|
178
|
+
"aria-label": "Close alert",
|
|
179
|
+
children: /* @__PURE__ */ l("svg", {
|
|
180
|
+
width: "16",
|
|
181
|
+
height: "16",
|
|
182
|
+
viewBox: "0 0 24 24",
|
|
183
|
+
fill: "none",
|
|
184
|
+
stroke: "currentColor",
|
|
185
|
+
strokeWidth: "2",
|
|
186
|
+
strokeLinecap: "round",
|
|
187
|
+
strokeLinejoin: "round",
|
|
188
|
+
children: [/* @__PURE__ */ c("line", {
|
|
189
|
+
x1: "18",
|
|
190
|
+
y1: "6",
|
|
191
|
+
x2: "6",
|
|
192
|
+
y2: "18"
|
|
193
|
+
}), /* @__PURE__ */ c("line", {
|
|
194
|
+
x1: "6",
|
|
195
|
+
y1: "6",
|
|
196
|
+
x2: "18",
|
|
197
|
+
y2: "18"
|
|
198
|
+
})]
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
p.displayName = "Alert";
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/components/Avatar/Avatar.tsx
|
|
207
|
+
var m = e.forwardRef(({ className: e = "", src: t, alt: n = "Avatar", initials: r, size: i = "md", ...a }, o) => /* @__PURE__ */ c("div", {
|
|
208
|
+
ref: o,
|
|
209
|
+
className: [
|
|
210
|
+
"nd-avatar",
|
|
211
|
+
`nd-avatar--${i}`,
|
|
212
|
+
e
|
|
213
|
+
].filter(Boolean).join(" "),
|
|
214
|
+
...a,
|
|
215
|
+
children: t ? /* @__PURE__ */ c("img", {
|
|
216
|
+
src: t,
|
|
217
|
+
alt: n,
|
|
218
|
+
className: "nd-avatar-image"
|
|
219
|
+
}) : /* @__PURE__ */ c("span", {
|
|
220
|
+
className: "nd-avatar-initials",
|
|
221
|
+
children: r?.substring(0, 2)
|
|
222
|
+
})
|
|
223
|
+
}));
|
|
224
|
+
m.displayName = "Avatar";
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/components/Badge/Badge.tsx
|
|
227
|
+
var h = e.forwardRef(({ className: e = "", variant: t = "default", children: n, ...r }, i) => /* @__PURE__ */ c("span", {
|
|
228
|
+
ref: i,
|
|
229
|
+
className: [
|
|
230
|
+
"nd-badge",
|
|
231
|
+
t === "primary" ? "nd-badge--primary" : "",
|
|
232
|
+
e
|
|
233
|
+
].filter(Boolean).join(" "),
|
|
234
|
+
...r,
|
|
235
|
+
children: n
|
|
236
|
+
}));
|
|
237
|
+
h.displayName = "Badge";
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
240
|
+
var g = e.forwardRef(({ className: e = "", items: t, separator: n, ...r }, i) => {
|
|
241
|
+
let a = n || /* @__PURE__ */ c("svg", {
|
|
242
|
+
width: "16",
|
|
243
|
+
height: "16",
|
|
244
|
+
viewBox: "0 0 24 24",
|
|
245
|
+
fill: "none",
|
|
246
|
+
stroke: "currentColor",
|
|
247
|
+
strokeWidth: "2",
|
|
248
|
+
strokeLinecap: "round",
|
|
249
|
+
strokeLinejoin: "round",
|
|
250
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
251
|
+
});
|
|
252
|
+
return /* @__PURE__ */ c("nav", {
|
|
253
|
+
"aria-label": "Breadcrumb",
|
|
254
|
+
children: /* @__PURE__ */ c("ol", {
|
|
255
|
+
className: `nd-breadcrumbs ${e}`,
|
|
256
|
+
ref: i,
|
|
257
|
+
...r,
|
|
258
|
+
children: t.map((e, n) => {
|
|
259
|
+
let r = n === t.length - 1;
|
|
260
|
+
return /* @__PURE__ */ l("li", {
|
|
261
|
+
className: `nd-breadcrumbs-item ${r ? "nd-breadcrumbs-item--active" : ""}`,
|
|
262
|
+
"aria-current": r ? "page" : void 0,
|
|
263
|
+
children: [e.href && !r ? /* @__PURE__ */ c("a", {
|
|
264
|
+
href: e.href,
|
|
265
|
+
className: "nd-breadcrumbs-link",
|
|
266
|
+
children: e.label
|
|
267
|
+
}) : /* @__PURE__ */ c("span", {
|
|
268
|
+
className: "nd-breadcrumbs-link",
|
|
269
|
+
children: e.label
|
|
270
|
+
}), !r && /* @__PURE__ */ c("span", {
|
|
271
|
+
className: "nd-breadcrumbs-separator",
|
|
272
|
+
"aria-hidden": "true",
|
|
273
|
+
children: a
|
|
274
|
+
})]
|
|
275
|
+
}, n);
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
g.displayName = "Breadcrumbs";
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/components/Button/Button.tsx
|
|
283
|
+
var _ = e.forwardRef(({ className: e = "", variant: t = "default", isPressed: n = !1, children: r, ...i }, a) => /* @__PURE__ */ c("button", {
|
|
284
|
+
ref: a,
|
|
285
|
+
className: [
|
|
286
|
+
"nd-button",
|
|
287
|
+
t === "primary" ? "nd-button--primary" : "",
|
|
288
|
+
n ? "nd-button--pressed" : "",
|
|
289
|
+
e
|
|
290
|
+
].filter(Boolean).join(" "),
|
|
291
|
+
...i,
|
|
292
|
+
children: r
|
|
293
|
+
}));
|
|
294
|
+
_.displayName = "Button";
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/components/Calendar/Calendar.tsx
|
|
297
|
+
var v = ({ value: e, onChange: t, className: n = "" }) => {
|
|
298
|
+
let [r, i] = o(e || /* @__PURE__ */ new Date()), a = e, s = new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate(), u = new Date(r.getFullYear(), r.getMonth(), 1).getDay(), d = () => {
|
|
299
|
+
i(new Date(r.getFullYear(), r.getMonth() - 1, 1));
|
|
300
|
+
}, f = () => {
|
|
301
|
+
i(new Date(r.getFullYear(), r.getMonth() + 1, 1));
|
|
302
|
+
}, p = (e) => {
|
|
303
|
+
let n = new Date(r.getFullYear(), r.getMonth(), e);
|
|
304
|
+
t && t(n);
|
|
305
|
+
}, m = (e) => {
|
|
306
|
+
let t = /* @__PURE__ */ new Date();
|
|
307
|
+
return t.getDate() === e && t.getMonth() === r.getMonth() && t.getFullYear() === r.getFullYear();
|
|
308
|
+
}, h = (e) => a ? a.getDate() === e && a.getMonth() === r.getMonth() && a.getFullYear() === r.getFullYear() : !1;
|
|
309
|
+
return /* @__PURE__ */ l("div", {
|
|
310
|
+
className: `nd-calendar ${n}`,
|
|
311
|
+
children: [/* @__PURE__ */ l("div", {
|
|
312
|
+
className: "nd-calendar-header",
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ c("button", {
|
|
315
|
+
className: "nd-calendar-nav-btn",
|
|
316
|
+
onClick: d,
|
|
317
|
+
"aria-label": "Previous Month",
|
|
318
|
+
children: /* @__PURE__ */ c("svg", {
|
|
319
|
+
width: "16",
|
|
320
|
+
height: "16",
|
|
321
|
+
viewBox: "0 0 24 24",
|
|
322
|
+
fill: "none",
|
|
323
|
+
stroke: "currentColor",
|
|
324
|
+
strokeWidth: "2",
|
|
325
|
+
strokeLinecap: "round",
|
|
326
|
+
strokeLinejoin: "round",
|
|
327
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
328
|
+
})
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ l("h2", {
|
|
331
|
+
className: "nd-calendar-title",
|
|
332
|
+
children: [
|
|
333
|
+
[
|
|
334
|
+
"January",
|
|
335
|
+
"February",
|
|
336
|
+
"March",
|
|
337
|
+
"April",
|
|
338
|
+
"May",
|
|
339
|
+
"June",
|
|
340
|
+
"July",
|
|
341
|
+
"August",
|
|
342
|
+
"September",
|
|
343
|
+
"October",
|
|
344
|
+
"November",
|
|
345
|
+
"December"
|
|
346
|
+
][r.getMonth()],
|
|
347
|
+
" ",
|
|
348
|
+
r.getFullYear()
|
|
349
|
+
]
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ c("button", {
|
|
352
|
+
className: "nd-calendar-nav-btn",
|
|
353
|
+
onClick: f,
|
|
354
|
+
"aria-label": "Next Month",
|
|
355
|
+
children: /* @__PURE__ */ c("svg", {
|
|
356
|
+
width: "16",
|
|
357
|
+
height: "16",
|
|
358
|
+
viewBox: "0 0 24 24",
|
|
359
|
+
fill: "none",
|
|
360
|
+
stroke: "currentColor",
|
|
361
|
+
strokeWidth: "2",
|
|
362
|
+
strokeLinecap: "round",
|
|
363
|
+
strokeLinejoin: "round",
|
|
364
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
365
|
+
})
|
|
366
|
+
})
|
|
367
|
+
]
|
|
368
|
+
}), /* @__PURE__ */ l("div", {
|
|
369
|
+
className: "nd-calendar-grid",
|
|
370
|
+
children: [
|
|
371
|
+
[
|
|
372
|
+
"Su",
|
|
373
|
+
"Mo",
|
|
374
|
+
"Tu",
|
|
375
|
+
"We",
|
|
376
|
+
"Th",
|
|
377
|
+
"Fr",
|
|
378
|
+
"Sa"
|
|
379
|
+
].map((e) => /* @__PURE__ */ c("div", {
|
|
380
|
+
className: "nd-calendar-weekday",
|
|
381
|
+
children: e
|
|
382
|
+
}, e)),
|
|
383
|
+
Array.from({ length: u }).map((e, t) => /* @__PURE__ */ c("div", { className: "nd-calendar-day nd-calendar-day--outside" }, `empty-${t}`)),
|
|
384
|
+
Array.from({ length: s }).map((e, t) => {
|
|
385
|
+
let n = t + 1, r = m(n), i = h(n);
|
|
386
|
+
return /* @__PURE__ */ c("button", {
|
|
387
|
+
className: `nd-calendar-day ${r ? "nd-calendar-day--today" : ""} ${i ? "nd-calendar-day--selected" : ""}`,
|
|
388
|
+
onClick: () => p(n),
|
|
389
|
+
children: n
|
|
390
|
+
}, `day-${n}`);
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
})]
|
|
394
|
+
});
|
|
395
|
+
}, y = e.forwardRef(({ className: e = "", variant: t = "elevated", children: n, ...r }, i) => /* @__PURE__ */ c("div", {
|
|
396
|
+
ref: i,
|
|
397
|
+
className: [
|
|
398
|
+
"nd-card",
|
|
399
|
+
t === "elevated" ? "nd-card--elevated" : "nd-card--sunken",
|
|
400
|
+
e
|
|
401
|
+
].filter(Boolean).join(" "),
|
|
402
|
+
...r,
|
|
403
|
+
children: n
|
|
404
|
+
}));
|
|
405
|
+
y.displayName = "Card";
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/components/Carousel/Carousel.tsx
|
|
408
|
+
var b = e.forwardRef(({ className: t = "", children: r, autoPlay: a = !1, interval: s = 3e3, showIndicators: u = !0, showControls: d = !0, ...f }, p) => {
|
|
409
|
+
let [m, h] = o(0), g = e.Children.count(r), _ = n(() => {
|
|
410
|
+
h((e) => e === g - 1 ? 0 : e + 1);
|
|
411
|
+
}, [g]), v = () => {
|
|
412
|
+
h((e) => e === 0 ? g - 1 : e - 1);
|
|
413
|
+
};
|
|
414
|
+
return i(() => {
|
|
415
|
+
if (!a) return;
|
|
416
|
+
let e = setInterval(_, s);
|
|
417
|
+
return () => clearInterval(e);
|
|
418
|
+
}, [
|
|
419
|
+
a,
|
|
420
|
+
s,
|
|
421
|
+
_
|
|
422
|
+
]), /* @__PURE__ */ l("div", {
|
|
423
|
+
className: `nd-carousel ${t}`,
|
|
424
|
+
ref: p,
|
|
425
|
+
...f,
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ c("div", {
|
|
428
|
+
className: "nd-carousel-viewport",
|
|
429
|
+
children: /* @__PURE__ */ c("div", {
|
|
430
|
+
className: "nd-carousel-container",
|
|
431
|
+
style: { transform: `translateX(-${m * 100}%)` },
|
|
432
|
+
children: e.Children.map(r, (e, t) => /* @__PURE__ */ c("div", {
|
|
433
|
+
className: "nd-carousel-slide",
|
|
434
|
+
children: e
|
|
435
|
+
}, t))
|
|
436
|
+
})
|
|
437
|
+
}),
|
|
438
|
+
d && /* @__PURE__ */ l("div", {
|
|
439
|
+
className: "nd-carousel-controls",
|
|
440
|
+
children: [/* @__PURE__ */ c("button", {
|
|
441
|
+
className: "nd-carousel-button",
|
|
442
|
+
onClick: v,
|
|
443
|
+
"aria-label": "Previous slide",
|
|
444
|
+
children: /* @__PURE__ */ c("svg", {
|
|
445
|
+
width: "20",
|
|
446
|
+
height: "20",
|
|
447
|
+
viewBox: "0 0 24 24",
|
|
448
|
+
fill: "none",
|
|
449
|
+
stroke: "currentColor",
|
|
450
|
+
strokeWidth: "2",
|
|
451
|
+
strokeLinecap: "round",
|
|
452
|
+
strokeLinejoin: "round",
|
|
453
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
454
|
+
})
|
|
455
|
+
}), /* @__PURE__ */ c("button", {
|
|
456
|
+
className: "nd-carousel-button",
|
|
457
|
+
onClick: _,
|
|
458
|
+
"aria-label": "Next slide",
|
|
459
|
+
children: /* @__PURE__ */ c("svg", {
|
|
460
|
+
width: "20",
|
|
461
|
+
height: "20",
|
|
462
|
+
viewBox: "0 0 24 24",
|
|
463
|
+
fill: "none",
|
|
464
|
+
stroke: "currentColor",
|
|
465
|
+
strokeWidth: "2",
|
|
466
|
+
strokeLinecap: "round",
|
|
467
|
+
strokeLinejoin: "round",
|
|
468
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
469
|
+
})
|
|
470
|
+
})]
|
|
471
|
+
}),
|
|
472
|
+
u && /* @__PURE__ */ c("div", {
|
|
473
|
+
className: "nd-carousel-indicators",
|
|
474
|
+
children: e.Children.map(r, (e, t) => /* @__PURE__ */ c("button", {
|
|
475
|
+
className: `nd-carousel-indicator ${t === m ? "nd-carousel-indicator--active" : ""}`,
|
|
476
|
+
onClick: () => h(t),
|
|
477
|
+
"aria-label": `Go to slide ${t + 1}`
|
|
478
|
+
}, t))
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
b.displayName = "Carousel";
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/components/Checkbox/Checkbox.tsx
|
|
486
|
+
var x = e.forwardRef(({ className: e = "", label: t, disabled: n, checked: r, onChange: i, ...a }, o) => /* @__PURE__ */ l("label", {
|
|
487
|
+
className: [
|
|
488
|
+
"nd-checkbox-wrapper",
|
|
489
|
+
r ? "nd-checkbox-wrapper--checked" : "",
|
|
490
|
+
n ? "nd-checkbox-wrapper--disabled" : "",
|
|
491
|
+
e
|
|
492
|
+
].filter(Boolean).join(" "),
|
|
493
|
+
children: [/* @__PURE__ */ l("div", {
|
|
494
|
+
className: "nd-checkbox-box",
|
|
495
|
+
children: [/* @__PURE__ */ c("input", {
|
|
496
|
+
type: "checkbox",
|
|
497
|
+
className: "nd-checkbox-input",
|
|
498
|
+
ref: o,
|
|
499
|
+
checked: r,
|
|
500
|
+
onChange: i,
|
|
501
|
+
disabled: n,
|
|
502
|
+
...a
|
|
503
|
+
}), /* @__PURE__ */ c("svg", {
|
|
504
|
+
className: "nd-checkbox-icon",
|
|
505
|
+
viewBox: "0 0 24 24",
|
|
506
|
+
children: /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
|
|
507
|
+
})]
|
|
508
|
+
}), t && /* @__PURE__ */ c("span", { children: t })]
|
|
509
|
+
}));
|
|
510
|
+
x.displayName = "Checkbox";
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/components/ColorPicker/ColorPicker.tsx
|
|
513
|
+
var S = [
|
|
514
|
+
"#ef4444",
|
|
515
|
+
"#f97316",
|
|
516
|
+
"#f59e0b",
|
|
517
|
+
"#84cc16",
|
|
518
|
+
"#22c55e",
|
|
519
|
+
"#06b6d4",
|
|
520
|
+
"#3b82f6",
|
|
521
|
+
"#6366f1",
|
|
522
|
+
"#a855f7",
|
|
523
|
+
"#ec4899",
|
|
524
|
+
"#ffffff",
|
|
525
|
+
"#94a3b8",
|
|
526
|
+
"#475569",
|
|
527
|
+
"#1e293b",
|
|
528
|
+
"#000000"
|
|
529
|
+
], C = ({ label: e, value: t, onChange: n, presets: r = S, className: s = "" }) => {
|
|
530
|
+
let [u, d] = o("#3b82f6"), [f, p] = o(!1), m = a(null), h = t !== void 0, g = h ? t : u;
|
|
531
|
+
i(() => {
|
|
532
|
+
let e = (e) => {
|
|
533
|
+
m.current && !m.current.contains(e.target) && p(!1);
|
|
534
|
+
};
|
|
535
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
536
|
+
}, []);
|
|
537
|
+
let _ = (e) => {
|
|
538
|
+
h || d(e), n && n(e);
|
|
539
|
+
};
|
|
540
|
+
return /* @__PURE__ */ l("div", {
|
|
541
|
+
className: `nd-color-picker-wrapper ${s}`,
|
|
542
|
+
ref: m,
|
|
543
|
+
children: [
|
|
544
|
+
e && /* @__PURE__ */ c("label", {
|
|
545
|
+
className: "nd-input-label",
|
|
546
|
+
style: {
|
|
547
|
+
marginBottom: "0.5rem",
|
|
548
|
+
display: "block"
|
|
549
|
+
},
|
|
550
|
+
children: e
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ l("button", {
|
|
553
|
+
className: "nd-color-picker-trigger",
|
|
554
|
+
onClick: () => p(!f),
|
|
555
|
+
type: "button",
|
|
556
|
+
children: [/* @__PURE__ */ c("div", {
|
|
557
|
+
className: "nd-color-picker-swatch",
|
|
558
|
+
style: { backgroundColor: g }
|
|
559
|
+
}), /* @__PURE__ */ c("span", { children: g.toUpperCase() })]
|
|
560
|
+
}),
|
|
561
|
+
f && /* @__PURE__ */ l("div", {
|
|
562
|
+
className: "nd-color-picker-popover",
|
|
563
|
+
children: [/* @__PURE__ */ c("div", {
|
|
564
|
+
className: "nd-color-picker-presets",
|
|
565
|
+
children: r.map((e) => /* @__PURE__ */ c("button", {
|
|
566
|
+
className: `nd-color-picker-preset-btn ${e.toLowerCase() === g.toLowerCase() ? "nd-color-picker-preset-btn--active" : ""}`,
|
|
567
|
+
style: { backgroundColor: e },
|
|
568
|
+
onClick: () => _(e),
|
|
569
|
+
"aria-label": `Select color ${e}`
|
|
570
|
+
}, e))
|
|
571
|
+
}), /* @__PURE__ */ l("div", {
|
|
572
|
+
className: "nd-color-picker-input-container",
|
|
573
|
+
children: [/* @__PURE__ */ c("span", {
|
|
574
|
+
style: {
|
|
575
|
+
color: "var(--nd-color-text-secondary)",
|
|
576
|
+
fontSize: "0.875rem",
|
|
577
|
+
fontWeight: 600
|
|
578
|
+
},
|
|
579
|
+
children: "Hex"
|
|
580
|
+
}), /* @__PURE__ */ c("input", {
|
|
581
|
+
type: "text",
|
|
582
|
+
className: "nd-color-picker-hex-input",
|
|
583
|
+
value: g,
|
|
584
|
+
onChange: (e) => {
|
|
585
|
+
let t = e.target.value;
|
|
586
|
+
_(t);
|
|
587
|
+
}
|
|
588
|
+
})]
|
|
589
|
+
})]
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
});
|
|
593
|
+
}, w = ({ isOpen: t, onClose: n, items: r, placeholder: s = "Type a command or search..." }) => {
|
|
594
|
+
let [d, f] = o(""), p = a(null);
|
|
595
|
+
i(() => (t ? (document.body.style.overflow = "hidden", setTimeout(() => p.current?.focus(), 100)) : (document.body.style.overflow = "", f("")), () => {
|
|
596
|
+
document.body.style.overflow = "";
|
|
597
|
+
}), [t]), i(() => {
|
|
598
|
+
let e = (e) => {
|
|
599
|
+
(e.metaKey || e.ctrlKey) && e.key === "k" && e.preventDefault();
|
|
600
|
+
};
|
|
601
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
602
|
+
}, []);
|
|
603
|
+
let m = (e) => {
|
|
604
|
+
e.key === "Escape" && n();
|
|
605
|
+
}, h = r.filter((e) => e.label.toLowerCase().includes(d.toLowerCase())), g = h.reduce((e, t) => {
|
|
606
|
+
let n = t.group || "Suggestions";
|
|
607
|
+
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
608
|
+
}, {}), _ = /* @__PURE__ */ c("div", {
|
|
609
|
+
className: `nd-command-menu-overlay ${t ? "nd-command-menu-overlay--open" : ""}`,
|
|
610
|
+
onClick: n,
|
|
611
|
+
role: "dialog",
|
|
612
|
+
"aria-modal": "true",
|
|
613
|
+
onKeyDown: m,
|
|
614
|
+
children: /* @__PURE__ */ l("div", {
|
|
615
|
+
className: "nd-command-menu",
|
|
616
|
+
onClick: (e) => e.stopPropagation(),
|
|
617
|
+
children: [/* @__PURE__ */ l("div", {
|
|
618
|
+
className: "nd-command-menu-input-wrapper",
|
|
619
|
+
children: [/* @__PURE__ */ l("svg", {
|
|
620
|
+
className: "nd-command-menu-icon",
|
|
621
|
+
width: "20",
|
|
622
|
+
height: "20",
|
|
623
|
+
viewBox: "0 0 24 24",
|
|
624
|
+
fill: "none",
|
|
625
|
+
stroke: "currentColor",
|
|
626
|
+
strokeWidth: "2",
|
|
627
|
+
strokeLinecap: "round",
|
|
628
|
+
strokeLinejoin: "round",
|
|
629
|
+
children: [/* @__PURE__ */ c("circle", {
|
|
630
|
+
cx: "11",
|
|
631
|
+
cy: "11",
|
|
632
|
+
r: "8"
|
|
633
|
+
}), /* @__PURE__ */ c("line", {
|
|
634
|
+
x1: "21",
|
|
635
|
+
y1: "21",
|
|
636
|
+
x2: "16.65",
|
|
637
|
+
y2: "16.65"
|
|
638
|
+
})]
|
|
639
|
+
}), /* @__PURE__ */ c("input", {
|
|
640
|
+
ref: p,
|
|
641
|
+
className: "nd-command-menu-input",
|
|
642
|
+
placeholder: s,
|
|
643
|
+
value: d,
|
|
644
|
+
onChange: (e) => f(e.target.value)
|
|
645
|
+
})]
|
|
646
|
+
}), /* @__PURE__ */ l("div", {
|
|
647
|
+
className: "nd-command-menu-list",
|
|
648
|
+
children: [Object.entries(g).map(([t, r]) => /* @__PURE__ */ l(e.Fragment, { children: [/* @__PURE__ */ c("div", {
|
|
649
|
+
className: "nd-command-menu-group",
|
|
650
|
+
children: t
|
|
651
|
+
}), r.map((e) => /* @__PURE__ */ l("button", {
|
|
652
|
+
className: "nd-command-menu-item",
|
|
653
|
+
onClick: () => {
|
|
654
|
+
e.onSelect(), n();
|
|
655
|
+
},
|
|
656
|
+
children: [/* @__PURE__ */ l("div", {
|
|
657
|
+
className: "nd-command-menu-item-content",
|
|
658
|
+
children: [e.icon, /* @__PURE__ */ c("span", { children: e.label })]
|
|
659
|
+
}), e.shortcut && /* @__PURE__ */ c("div", {
|
|
660
|
+
className: "nd-command-menu-shortcut",
|
|
661
|
+
children: e.shortcut.map((e, t) => /* @__PURE__ */ c("span", { children: e }, t))
|
|
662
|
+
})]
|
|
663
|
+
}, e.id))] }, t)), h.length === 0 && /* @__PURE__ */ c("div", {
|
|
664
|
+
style: {
|
|
665
|
+
padding: "2rem",
|
|
666
|
+
textAlign: "center",
|
|
667
|
+
color: "var(--nd-color-text-disabled)"
|
|
668
|
+
},
|
|
669
|
+
children: "No results found."
|
|
670
|
+
})]
|
|
671
|
+
})]
|
|
672
|
+
})
|
|
673
|
+
});
|
|
674
|
+
return typeof window < "u" ? u(_, document.body) : null;
|
|
675
|
+
}, T = ({ children: e, items: t, className: n = "" }) => {
|
|
676
|
+
let [r, d] = o(!1), [f, p] = o({
|
|
677
|
+
x: 0,
|
|
678
|
+
y: 0
|
|
679
|
+
}), m = a(null), h = a(null), g = (e) => {
|
|
680
|
+
e.preventDefault();
|
|
681
|
+
let t = e.clientX, n = e.clientY;
|
|
682
|
+
p({
|
|
683
|
+
x: t,
|
|
684
|
+
y: n
|
|
685
|
+
}), d(!0);
|
|
686
|
+
};
|
|
687
|
+
i(() => {
|
|
688
|
+
if (!r) return;
|
|
689
|
+
let e = (e) => {
|
|
690
|
+
h.current && !h.current.contains(e.target) && d(!1);
|
|
691
|
+
}, t = (e) => {
|
|
692
|
+
e.key === "Escape" && d(!1);
|
|
693
|
+
}, n = () => d(!1);
|
|
694
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), window.addEventListener("scroll", n, !0), () => {
|
|
695
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t), window.removeEventListener("scroll", n, !0);
|
|
696
|
+
};
|
|
697
|
+
}, [r]), i(() => {
|
|
698
|
+
if (r && h.current) {
|
|
699
|
+
let e = h.current.getBoundingClientRect(), { innerWidth: t, innerHeight: n } = window, r = f.x, i = f.y;
|
|
700
|
+
f.x + e.width > t && (r = t - e.width - 10), f.y + e.height > n && (i = n - e.height - 10), (r !== f.x || i !== f.y) && p({
|
|
701
|
+
x: r,
|
|
702
|
+
y: i
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
}, [r, f]);
|
|
706
|
+
let _ = r ? /* @__PURE__ */ c("div", {
|
|
707
|
+
className: `nd-context-menu-portal ${n}`,
|
|
708
|
+
ref: h,
|
|
709
|
+
style: {
|
|
710
|
+
left: f.x,
|
|
711
|
+
top: f.y
|
|
712
|
+
},
|
|
713
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
714
|
+
children: t.map((e, t) => e.isDivider ? /* @__PURE__ */ c("div", { className: "nd-context-menu-divider" }, `divider-${t}`) : /* @__PURE__ */ l("button", {
|
|
715
|
+
className: "nd-context-menu-item",
|
|
716
|
+
style: e.danger ? { color: "#ef4444" } : void 0,
|
|
717
|
+
onClick: (t) => {
|
|
718
|
+
t.stopPropagation(), e.onClick && e.onClick(), d(!1);
|
|
719
|
+
},
|
|
720
|
+
children: [/* @__PURE__ */ l("div", {
|
|
721
|
+
className: "nd-context-menu-item-content",
|
|
722
|
+
children: [e.icon, /* @__PURE__ */ c("span", { children: e.label })]
|
|
723
|
+
}), e.shortcut && /* @__PURE__ */ c("span", {
|
|
724
|
+
className: "nd-context-menu-shortcut",
|
|
725
|
+
children: e.shortcut
|
|
726
|
+
})]
|
|
727
|
+
}, `item-${t}`))
|
|
728
|
+
}) : null;
|
|
729
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
730
|
+
ref: m,
|
|
731
|
+
className: "nd-context-menu-wrapper",
|
|
732
|
+
onContextMenu: g,
|
|
733
|
+
children: e
|
|
734
|
+
}), typeof window < "u" && u(_, document.body)] });
|
|
735
|
+
}, E = [
|
|
736
|
+
"Su",
|
|
737
|
+
"Mo",
|
|
738
|
+
"Tu",
|
|
739
|
+
"We",
|
|
740
|
+
"Th",
|
|
741
|
+
"Fr",
|
|
742
|
+
"Sa"
|
|
743
|
+
], ee = [
|
|
744
|
+
"January",
|
|
745
|
+
"February",
|
|
746
|
+
"March",
|
|
747
|
+
"April",
|
|
748
|
+
"May",
|
|
749
|
+
"June",
|
|
750
|
+
"July",
|
|
751
|
+
"August",
|
|
752
|
+
"September",
|
|
753
|
+
"October",
|
|
754
|
+
"November",
|
|
755
|
+
"December"
|
|
756
|
+
], te = ({ label: e, value: t, onChange: n, className: r = "" }) => {
|
|
757
|
+
let [s, u] = o(!1), [d, f] = o(t ? t.getMonth() : (/* @__PURE__ */ new Date()).getMonth()), [p, m] = o(t ? t.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear()), h = a(null);
|
|
758
|
+
i(() => {
|
|
759
|
+
let e = (e) => {
|
|
760
|
+
h.current && !h.current.contains(e.target) && u(!1);
|
|
761
|
+
};
|
|
762
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
763
|
+
}, []);
|
|
764
|
+
let g = (e, t) => new Date(t, e + 1, 0).getDate(), _ = (e, t) => new Date(t, e, 1).getDay(), v = () => {
|
|
765
|
+
d === 0 ? (f(11), m(p - 1)) : f(d - 1);
|
|
766
|
+
}, y = () => {
|
|
767
|
+
d === 11 ? (f(0), m(p + 1)) : f(d + 1);
|
|
768
|
+
}, b = (e) => {
|
|
769
|
+
let t = new Date(p, d, e);
|
|
770
|
+
n && n(t), u(!1);
|
|
771
|
+
}, x = () => {
|
|
772
|
+
let e = g(d, p), n = _(d, p), r = /* @__PURE__ */ new Date(), i = r.getMonth() === d && r.getFullYear() === p, a = [];
|
|
773
|
+
for (let e = 0; e < n; e++) a.push(/* @__PURE__ */ c("div", { className: "nd-datepicker-day nd-datepicker-day--empty" }, `empty-${e}`));
|
|
774
|
+
for (let n = 1; n <= e; n++) {
|
|
775
|
+
let e = t && t.getDate() === n && t.getMonth() === d && t.getFullYear() === p, o = i && r.getDate() === n, s = [
|
|
776
|
+
"nd-datepicker-day",
|
|
777
|
+
e ? "nd-datepicker-day--selected" : "",
|
|
778
|
+
o && !e ? "nd-datepicker-day--today" : ""
|
|
779
|
+
].filter(Boolean).join(" ");
|
|
780
|
+
a.push(/* @__PURE__ */ c("button", {
|
|
781
|
+
className: s,
|
|
782
|
+
onClick: () => b(n),
|
|
783
|
+
children: n
|
|
784
|
+
}, `day-${n}`));
|
|
785
|
+
}
|
|
786
|
+
return a;
|
|
787
|
+
}, S = t ? `${t.toLocaleDateString()}` : "Select date";
|
|
788
|
+
return /* @__PURE__ */ l("div", {
|
|
789
|
+
className: `nd-datepicker-wrapper ${r}`,
|
|
790
|
+
ref: h,
|
|
791
|
+
children: [
|
|
792
|
+
e && /* @__PURE__ */ c("label", {
|
|
793
|
+
className: "nd-input-label",
|
|
794
|
+
style: {
|
|
795
|
+
marginBottom: "0.5rem",
|
|
796
|
+
display: "block"
|
|
797
|
+
},
|
|
798
|
+
children: e
|
|
799
|
+
}),
|
|
800
|
+
/* @__PURE__ */ l("div", {
|
|
801
|
+
className: "nd-input",
|
|
802
|
+
onClick: () => u(!s),
|
|
803
|
+
style: {
|
|
804
|
+
cursor: "pointer",
|
|
805
|
+
display: "flex",
|
|
806
|
+
justifyContent: "space-between",
|
|
807
|
+
alignItems: "center"
|
|
808
|
+
},
|
|
809
|
+
children: [/* @__PURE__ */ c("span", { children: S }), /* @__PURE__ */ l("svg", {
|
|
810
|
+
width: "16",
|
|
811
|
+
height: "16",
|
|
812
|
+
viewBox: "0 0 24 24",
|
|
813
|
+
fill: "none",
|
|
814
|
+
stroke: "var(--nd-color-text-secondary)",
|
|
815
|
+
strokeWidth: "2",
|
|
816
|
+
strokeLinecap: "round",
|
|
817
|
+
strokeLinejoin: "round",
|
|
818
|
+
children: [
|
|
819
|
+
/* @__PURE__ */ c("rect", {
|
|
820
|
+
x: "3",
|
|
821
|
+
y: "4",
|
|
822
|
+
width: "18",
|
|
823
|
+
height: "18",
|
|
824
|
+
rx: "2",
|
|
825
|
+
ry: "2"
|
|
826
|
+
}),
|
|
827
|
+
/* @__PURE__ */ c("line", {
|
|
828
|
+
x1: "16",
|
|
829
|
+
y1: "2",
|
|
830
|
+
x2: "16",
|
|
831
|
+
y2: "6"
|
|
832
|
+
}),
|
|
833
|
+
/* @__PURE__ */ c("line", {
|
|
834
|
+
x1: "8",
|
|
835
|
+
y1: "2",
|
|
836
|
+
x2: "8",
|
|
837
|
+
y2: "6"
|
|
838
|
+
}),
|
|
839
|
+
/* @__PURE__ */ c("line", {
|
|
840
|
+
x1: "3",
|
|
841
|
+
y1: "10",
|
|
842
|
+
x2: "21",
|
|
843
|
+
y2: "10"
|
|
844
|
+
})
|
|
845
|
+
]
|
|
846
|
+
})]
|
|
847
|
+
}),
|
|
848
|
+
s && /* @__PURE__ */ l("div", {
|
|
849
|
+
className: "nd-datepicker-calendar",
|
|
850
|
+
children: [/* @__PURE__ */ l("div", {
|
|
851
|
+
className: "nd-datepicker-header",
|
|
852
|
+
children: [
|
|
853
|
+
/* @__PURE__ */ c("button", {
|
|
854
|
+
className: "nd-datepicker-nav-button",
|
|
855
|
+
onClick: v,
|
|
856
|
+
children: /* @__PURE__ */ c("svg", {
|
|
857
|
+
width: "16",
|
|
858
|
+
height: "16",
|
|
859
|
+
viewBox: "0 0 24 24",
|
|
860
|
+
fill: "none",
|
|
861
|
+
stroke: "currentColor",
|
|
862
|
+
strokeWidth: "2",
|
|
863
|
+
strokeLinecap: "round",
|
|
864
|
+
strokeLinejoin: "round",
|
|
865
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
866
|
+
})
|
|
867
|
+
}),
|
|
868
|
+
/* @__PURE__ */ l("span", {
|
|
869
|
+
className: "nd-datepicker-month-year",
|
|
870
|
+
children: [
|
|
871
|
+
ee[d],
|
|
872
|
+
" ",
|
|
873
|
+
p
|
|
874
|
+
]
|
|
875
|
+
}),
|
|
876
|
+
/* @__PURE__ */ c("button", {
|
|
877
|
+
className: "nd-datepicker-nav-button",
|
|
878
|
+
onClick: y,
|
|
879
|
+
children: /* @__PURE__ */ c("svg", {
|
|
880
|
+
width: "16",
|
|
881
|
+
height: "16",
|
|
882
|
+
viewBox: "0 0 24 24",
|
|
883
|
+
fill: "none",
|
|
884
|
+
stroke: "currentColor",
|
|
885
|
+
strokeWidth: "2",
|
|
886
|
+
strokeLinecap: "round",
|
|
887
|
+
strokeLinejoin: "round",
|
|
888
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
889
|
+
})
|
|
890
|
+
})
|
|
891
|
+
]
|
|
892
|
+
}), /* @__PURE__ */ l("div", {
|
|
893
|
+
className: "nd-datepicker-grid",
|
|
894
|
+
children: [E.map((e) => /* @__PURE__ */ c("div", {
|
|
895
|
+
className: "nd-datepicker-weekday",
|
|
896
|
+
children: e
|
|
897
|
+
}, e)), x()]
|
|
898
|
+
})]
|
|
899
|
+
})
|
|
900
|
+
]
|
|
901
|
+
});
|
|
902
|
+
}, D = e.forwardRef(({ className: e = "", orientation: t = "horizontal", variant: n = "inset", ...r }, i) => {
|
|
903
|
+
let a = [
|
|
904
|
+
"nd-divider",
|
|
905
|
+
`nd-divider--${t}`,
|
|
906
|
+
`nd-divider--${n}`,
|
|
907
|
+
e
|
|
908
|
+
].filter(Boolean).join(" ");
|
|
909
|
+
return t === "horizontal" ? /* @__PURE__ */ c("hr", {
|
|
910
|
+
className: a,
|
|
911
|
+
ref: i,
|
|
912
|
+
...r
|
|
913
|
+
}) : /* @__PURE__ */ c("div", {
|
|
914
|
+
className: a,
|
|
915
|
+
role: "separator",
|
|
916
|
+
"aria-orientation": "vertical",
|
|
917
|
+
ref: i,
|
|
918
|
+
...r
|
|
919
|
+
});
|
|
920
|
+
});
|
|
921
|
+
D.displayName = "Divider";
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region src/components/Drawer/Drawer.tsx
|
|
924
|
+
var ne = ({ isOpen: e, onClose: t, title: n, position: r = "right", children: a, footer: o, className: s = "" }) => {
|
|
925
|
+
i(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
926
|
+
document.body.style.overflow = "";
|
|
927
|
+
}), [e]);
|
|
928
|
+
let d = /* @__PURE__ */ c("div", {
|
|
929
|
+
className: `nd-drawer-overlay ${e ? "nd-drawer-overlay--open" : ""}`,
|
|
930
|
+
onClick: t,
|
|
931
|
+
role: "dialog",
|
|
932
|
+
"aria-modal": "true",
|
|
933
|
+
children: /* @__PURE__ */ l("div", {
|
|
934
|
+
className: `nd-drawer nd-drawer--${r} ${s}`,
|
|
935
|
+
onClick: (e) => e.stopPropagation(),
|
|
936
|
+
children: [
|
|
937
|
+
n && /* @__PURE__ */ l("div", {
|
|
938
|
+
className: "nd-drawer-header",
|
|
939
|
+
children: [/* @__PURE__ */ c("h2", {
|
|
940
|
+
className: "nd-drawer-title",
|
|
941
|
+
children: n
|
|
942
|
+
}), /* @__PURE__ */ c("button", {
|
|
943
|
+
className: "nd-drawer-close",
|
|
944
|
+
onClick: t,
|
|
945
|
+
"aria-label": "Close",
|
|
946
|
+
children: /* @__PURE__ */ l("svg", {
|
|
947
|
+
width: "20",
|
|
948
|
+
height: "20",
|
|
949
|
+
viewBox: "0 0 24 24",
|
|
950
|
+
fill: "none",
|
|
951
|
+
stroke: "currentColor",
|
|
952
|
+
strokeWidth: "2",
|
|
953
|
+
strokeLinecap: "round",
|
|
954
|
+
strokeLinejoin: "round",
|
|
955
|
+
children: [/* @__PURE__ */ c("line", {
|
|
956
|
+
x1: "18",
|
|
957
|
+
y1: "6",
|
|
958
|
+
x2: "6",
|
|
959
|
+
y2: "18"
|
|
960
|
+
}), /* @__PURE__ */ c("line", {
|
|
961
|
+
x1: "6",
|
|
962
|
+
y1: "6",
|
|
963
|
+
x2: "18",
|
|
964
|
+
y2: "18"
|
|
965
|
+
})]
|
|
966
|
+
})
|
|
967
|
+
})]
|
|
968
|
+
}),
|
|
969
|
+
!n && /* @__PURE__ */ c("button", {
|
|
970
|
+
className: "nd-drawer-close",
|
|
971
|
+
onClick: t,
|
|
972
|
+
"aria-label": "Close",
|
|
973
|
+
style: {
|
|
974
|
+
position: "absolute",
|
|
975
|
+
top: "1rem",
|
|
976
|
+
right: "1rem"
|
|
977
|
+
},
|
|
978
|
+
children: /* @__PURE__ */ l("svg", {
|
|
979
|
+
width: "20",
|
|
980
|
+
height: "20",
|
|
981
|
+
viewBox: "0 0 24 24",
|
|
982
|
+
fill: "none",
|
|
983
|
+
stroke: "currentColor",
|
|
984
|
+
strokeWidth: "2",
|
|
985
|
+
strokeLinecap: "round",
|
|
986
|
+
strokeLinejoin: "round",
|
|
987
|
+
children: [/* @__PURE__ */ c("line", {
|
|
988
|
+
x1: "18",
|
|
989
|
+
y1: "6",
|
|
990
|
+
x2: "6",
|
|
991
|
+
y2: "18"
|
|
992
|
+
}), /* @__PURE__ */ c("line", {
|
|
993
|
+
x1: "6",
|
|
994
|
+
y1: "6",
|
|
995
|
+
x2: "18",
|
|
996
|
+
y2: "18"
|
|
997
|
+
})]
|
|
998
|
+
})
|
|
999
|
+
}),
|
|
1000
|
+
/* @__PURE__ */ c("div", {
|
|
1001
|
+
className: "nd-drawer-body",
|
|
1002
|
+
children: a
|
|
1003
|
+
}),
|
|
1004
|
+
o && /* @__PURE__ */ c("div", {
|
|
1005
|
+
className: "nd-drawer-footer",
|
|
1006
|
+
children: o
|
|
1007
|
+
})
|
|
1008
|
+
]
|
|
1009
|
+
})
|
|
1010
|
+
});
|
|
1011
|
+
return typeof window < "u" ? u(d, document.body) : null;
|
|
1012
|
+
}, O = e.forwardRef(({ children: e, className: t = "", ...n }, r) => /* @__PURE__ */ c("button", {
|
|
1013
|
+
className: `nd-dropdown-item ${t}`,
|
|
1014
|
+
ref: r,
|
|
1015
|
+
role: "menuitem",
|
|
1016
|
+
...n,
|
|
1017
|
+
children: e
|
|
1018
|
+
}));
|
|
1019
|
+
O.displayName = "DropdownMenuItem";
|
|
1020
|
+
var re = () => /* @__PURE__ */ c("div", {
|
|
1021
|
+
className: "nd-dropdown-divider",
|
|
1022
|
+
role: "separator"
|
|
1023
|
+
}), ie = ({ trigger: t, children: n, align: r = "left", className: s = "" }) => {
|
|
1024
|
+
let [u, d] = o(!1), f = a(null);
|
|
1025
|
+
i(() => {
|
|
1026
|
+
let e = (e) => {
|
|
1027
|
+
f.current && !f.current.contains(e.target) && d(!1);
|
|
1028
|
+
};
|
|
1029
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1030
|
+
}, []);
|
|
1031
|
+
let p = (e) => {
|
|
1032
|
+
e.key === "Escape" && d(!1);
|
|
1033
|
+
}, m = [
|
|
1034
|
+
"nd-dropdown-menu",
|
|
1035
|
+
u ? "nd-dropdown-menu--open" : "",
|
|
1036
|
+
r === "right" ? "nd-dropdown-menu--right" : "",
|
|
1037
|
+
s
|
|
1038
|
+
].filter(Boolean).join(" ");
|
|
1039
|
+
return /* @__PURE__ */ l("div", {
|
|
1040
|
+
className: "nd-dropdown-wrapper",
|
|
1041
|
+
ref: f,
|
|
1042
|
+
onKeyDown: p,
|
|
1043
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1044
|
+
className: "nd-dropdown-trigger",
|
|
1045
|
+
onClick: () => d(!u),
|
|
1046
|
+
role: "button",
|
|
1047
|
+
"aria-haspopup": "menu",
|
|
1048
|
+
"aria-expanded": u,
|
|
1049
|
+
children: t
|
|
1050
|
+
}), /* @__PURE__ */ c("div", {
|
|
1051
|
+
className: m,
|
|
1052
|
+
role: "menu",
|
|
1053
|
+
children: e.Children.map(n, (t) => {
|
|
1054
|
+
if (e.isValidElement(t)) {
|
|
1055
|
+
let n = t, r = n.props;
|
|
1056
|
+
return e.cloneElement(n, { onClick: (e) => {
|
|
1057
|
+
r.onClick && r.onClick(e), d(!1);
|
|
1058
|
+
} });
|
|
1059
|
+
}
|
|
1060
|
+
return t;
|
|
1061
|
+
})
|
|
1062
|
+
})]
|
|
1063
|
+
});
|
|
1064
|
+
}, k = e.forwardRef(({ className: e = "", label: t, onDrop: n, disabled: r, ...i }, s) => {
|
|
1065
|
+
let u = a(null), [d, f] = o(!1), p = (e) => {
|
|
1066
|
+
e.preventDefault(), e.stopPropagation(), r || f(!0);
|
|
1067
|
+
}, m = (e) => {
|
|
1068
|
+
e.preventDefault(), e.stopPropagation(), f(!1);
|
|
1069
|
+
}, h = (e) => {
|
|
1070
|
+
e.preventDefault(), e.stopPropagation();
|
|
1071
|
+
}, g = (e) => {
|
|
1072
|
+
e.preventDefault(), e.stopPropagation(), f(!1), !r && n && e.dataTransfer.files && n(e.dataTransfer.files);
|
|
1073
|
+
}, _ = () => {
|
|
1074
|
+
r || u.current?.click();
|
|
1075
|
+
}, v = (e) => {
|
|
1076
|
+
!r && n && e.target.files && n(e.target.files);
|
|
1077
|
+
}, y = [
|
|
1078
|
+
"nd-dropzone",
|
|
1079
|
+
d ? "nd-dropzone--active" : "",
|
|
1080
|
+
r ? "nd-dropzone--disabled" : ""
|
|
1081
|
+
].filter(Boolean).join(" ");
|
|
1082
|
+
return /* @__PURE__ */ l("div", {
|
|
1083
|
+
className: ["nd-dropzone-wrapper", e].filter(Boolean).join(" "),
|
|
1084
|
+
ref: s,
|
|
1085
|
+
...i,
|
|
1086
|
+
children: [t && /* @__PURE__ */ c("label", {
|
|
1087
|
+
className: "nd-dropzone-label",
|
|
1088
|
+
children: t
|
|
1089
|
+
}), /* @__PURE__ */ l("div", {
|
|
1090
|
+
className: y,
|
|
1091
|
+
onDragEnter: p,
|
|
1092
|
+
onDragLeave: m,
|
|
1093
|
+
onDragOver: h,
|
|
1094
|
+
onDrop: g,
|
|
1095
|
+
onClick: _,
|
|
1096
|
+
role: "button",
|
|
1097
|
+
tabIndex: r ? -1 : 0,
|
|
1098
|
+
children: [
|
|
1099
|
+
/* @__PURE__ */ c("input", {
|
|
1100
|
+
type: "file",
|
|
1101
|
+
className: "nd-dropzone-input",
|
|
1102
|
+
ref: u,
|
|
1103
|
+
onChange: v,
|
|
1104
|
+
disabled: r,
|
|
1105
|
+
multiple: !0
|
|
1106
|
+
}),
|
|
1107
|
+
/* @__PURE__ */ l("svg", {
|
|
1108
|
+
className: "nd-dropzone-icon",
|
|
1109
|
+
width: "36",
|
|
1110
|
+
height: "36",
|
|
1111
|
+
viewBox: "0 0 24 24",
|
|
1112
|
+
fill: "none",
|
|
1113
|
+
stroke: "currentColor",
|
|
1114
|
+
strokeWidth: "2",
|
|
1115
|
+
strokeLinecap: "round",
|
|
1116
|
+
strokeLinejoin: "round",
|
|
1117
|
+
children: [
|
|
1118
|
+
/* @__PURE__ */ c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1119
|
+
/* @__PURE__ */ c("polyline", { points: "17 8 12 3 7 8" }),
|
|
1120
|
+
/* @__PURE__ */ c("line", {
|
|
1121
|
+
x1: "12",
|
|
1122
|
+
y1: "3",
|
|
1123
|
+
x2: "12",
|
|
1124
|
+
y2: "15"
|
|
1125
|
+
})
|
|
1126
|
+
]
|
|
1127
|
+
}),
|
|
1128
|
+
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("div", {
|
|
1129
|
+
className: "nd-dropzone-text",
|
|
1130
|
+
children: "Click or drag files here"
|
|
1131
|
+
}), /* @__PURE__ */ c("div", {
|
|
1132
|
+
className: "nd-dropzone-subtext",
|
|
1133
|
+
children: "SVG, PNG, JPG or GIF (max. 5MB)"
|
|
1134
|
+
})] })
|
|
1135
|
+
]
|
|
1136
|
+
})]
|
|
1137
|
+
});
|
|
1138
|
+
});
|
|
1139
|
+
k.displayName = "Dropzone";
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region src/components/HoverCard/HoverCard.tsx
|
|
1142
|
+
var ae = ({ trigger: e, children: t, openDelay: n = 300, closeDelay: r = 300, className: s = "" }) => {
|
|
1143
|
+
let [u, d] = o(!1), f = a(null), p = a(null), m = a(null);
|
|
1144
|
+
return i(() => () => {
|
|
1145
|
+
m.current && clearTimeout(m.current);
|
|
1146
|
+
}, []), /* @__PURE__ */ l("div", {
|
|
1147
|
+
className: `nd-hover-card-wrapper ${s}`,
|
|
1148
|
+
ref: f,
|
|
1149
|
+
onMouseEnter: () => {
|
|
1150
|
+
m.current && clearTimeout(m.current), m.current = window.setTimeout(() => d(!0), n);
|
|
1151
|
+
},
|
|
1152
|
+
onMouseLeave: () => {
|
|
1153
|
+
m.current && clearTimeout(m.current), m.current = window.setTimeout(() => d(!1), r);
|
|
1154
|
+
},
|
|
1155
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1156
|
+
className: "nd-hover-card-trigger",
|
|
1157
|
+
children: e
|
|
1158
|
+
}), u && /* @__PURE__ */ c("div", {
|
|
1159
|
+
className: "nd-hover-card-portal",
|
|
1160
|
+
ref: p,
|
|
1161
|
+
style: {
|
|
1162
|
+
top: "calc(100% + 10px)",
|
|
1163
|
+
left: "50%",
|
|
1164
|
+
transform: "translateX(-50%)"
|
|
1165
|
+
},
|
|
1166
|
+
children: t
|
|
1167
|
+
})]
|
|
1168
|
+
});
|
|
1169
|
+
}, A = e.forwardRef(({ className: e = "", shape: t = "circle", isPressed: n = !1, children: r, ...i }, a) => /* @__PURE__ */ c("button", {
|
|
1170
|
+
ref: a,
|
|
1171
|
+
className: [
|
|
1172
|
+
"nd-icon-button",
|
|
1173
|
+
t === "circle" ? "nd-icon-button--circle" : "nd-icon-button--rounded",
|
|
1174
|
+
n ? "nd-icon-button--pressed" : "",
|
|
1175
|
+
e
|
|
1176
|
+
].filter(Boolean).join(" "),
|
|
1177
|
+
...i,
|
|
1178
|
+
children: r
|
|
1179
|
+
}));
|
|
1180
|
+
A.displayName = "IconButton";
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region src/components/Input/Input.tsx
|
|
1183
|
+
var j = e.forwardRef(({ className: e = "", label: t, error: n, ...r }, i) => {
|
|
1184
|
+
let a = [
|
|
1185
|
+
"nd-input",
|
|
1186
|
+
n ? "nd-input--error" : "",
|
|
1187
|
+
e
|
|
1188
|
+
].filter(Boolean).join(" ");
|
|
1189
|
+
return /* @__PURE__ */ l("div", {
|
|
1190
|
+
className: "nd-input-wrapper",
|
|
1191
|
+
children: [
|
|
1192
|
+
t && /* @__PURE__ */ c("label", {
|
|
1193
|
+
className: "nd-input-label",
|
|
1194
|
+
children: t
|
|
1195
|
+
}),
|
|
1196
|
+
/* @__PURE__ */ c("input", {
|
|
1197
|
+
ref: i,
|
|
1198
|
+
className: a,
|
|
1199
|
+
...r
|
|
1200
|
+
}),
|
|
1201
|
+
n && /* @__PURE__ */ c("span", {
|
|
1202
|
+
className: "nd-input-error-message",
|
|
1203
|
+
children: n
|
|
1204
|
+
})
|
|
1205
|
+
]
|
|
1206
|
+
});
|
|
1207
|
+
});
|
|
1208
|
+
j.displayName = "Input";
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region src/components/Knob/Knob.tsx
|
|
1211
|
+
var oe = ({ value: e = 0, onChange: t }) => {
|
|
1212
|
+
let [n, r] = o(e), [s, u] = o(!1), d = a(null);
|
|
1213
|
+
i(() => {
|
|
1214
|
+
r(e);
|
|
1215
|
+
}, [e]);
|
|
1216
|
+
let f = (e, n) => {
|
|
1217
|
+
if (!d.current) return;
|
|
1218
|
+
let i = d.current.getBoundingClientRect(), a = i.left + i.width / 2, o = i.top + i.height / 2, s = e - a, c = n - o, l = 180 / Math.PI * Math.atan2(c, s) + 90;
|
|
1219
|
+
l < 0 && (l += 360);
|
|
1220
|
+
let u = Math.round(l / 360 * 100);
|
|
1221
|
+
r(u), t?.(u);
|
|
1222
|
+
}, p = (e) => {
|
|
1223
|
+
u(!0), f(e.clientX, e.clientY);
|
|
1224
|
+
};
|
|
1225
|
+
i(() => {
|
|
1226
|
+
let e = (e) => {
|
|
1227
|
+
s && f(e.clientX, e.clientY);
|
|
1228
|
+
}, t = () => {
|
|
1229
|
+
u(!1);
|
|
1230
|
+
};
|
|
1231
|
+
return s && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t)), () => {
|
|
1232
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
|
|
1233
|
+
};
|
|
1234
|
+
}, [s]);
|
|
1235
|
+
let m = n / 100 * 360;
|
|
1236
|
+
return /* @__PURE__ */ c("div", {
|
|
1237
|
+
className: "nd-knob-container",
|
|
1238
|
+
ref: d,
|
|
1239
|
+
children: /* @__PURE__ */ l("div", {
|
|
1240
|
+
className: "nd-knob-track",
|
|
1241
|
+
children: [/* @__PURE__ */ c("div", { className: "nd-knob-ring" }), /* @__PURE__ */ c("div", {
|
|
1242
|
+
className: "nd-knob-dial",
|
|
1243
|
+
onMouseDown: p,
|
|
1244
|
+
children: /* @__PURE__ */ c("div", {
|
|
1245
|
+
className: "nd-knob-indicator-container",
|
|
1246
|
+
style: { transform: `rotate(${m}deg)` },
|
|
1247
|
+
children: /* @__PURE__ */ c("div", { className: "nd-knob-indicator" })
|
|
1248
|
+
})
|
|
1249
|
+
})]
|
|
1250
|
+
})
|
|
1251
|
+
});
|
|
1252
|
+
}, M = e.forwardRef(({ className: e = "", options: t, value: n, onChange: r, multiple: i = !1, ...s }, u) => {
|
|
1253
|
+
let d = n !== void 0, [f, p] = o(i ? [] : null), m = d ? n : f, h = a(null), g = u || h, _ = (e) => i && Array.isArray(m) ? m.includes(e) : m === e, v = (e) => {
|
|
1254
|
+
let t;
|
|
1255
|
+
if (i) {
|
|
1256
|
+
let n = Array.isArray(m) ? [...m] : [];
|
|
1257
|
+
t = n.includes(e) ? n.filter((t) => t !== e) : [...n, e];
|
|
1258
|
+
} else t = e;
|
|
1259
|
+
d || p(t), r && r(t);
|
|
1260
|
+
}, y = (e, n) => {
|
|
1261
|
+
if (e.key === "Enter" || e.key === " ") e.preventDefault(), t[n].disabled || v(t[n].id);
|
|
1262
|
+
else if (e.key === "ArrowDown") {
|
|
1263
|
+
e.preventDefault();
|
|
1264
|
+
let r = (n + 1) % t.length, i = g.current?.querySelectorAll(".nd-listbox-item");
|
|
1265
|
+
i && i[r] && i[r].focus();
|
|
1266
|
+
} else if (e.key === "ArrowUp") {
|
|
1267
|
+
e.preventDefault();
|
|
1268
|
+
let r = (n - 1 + t.length) % t.length, i = g.current?.querySelectorAll(".nd-listbox-item");
|
|
1269
|
+
i && i[r] && i[r].focus();
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
return /* @__PURE__ */ c("ul", {
|
|
1273
|
+
className: `nd-listbox ${e}`,
|
|
1274
|
+
role: "listbox",
|
|
1275
|
+
"aria-multiselectable": i,
|
|
1276
|
+
ref: g,
|
|
1277
|
+
...s,
|
|
1278
|
+
children: t.map((e, t) => {
|
|
1279
|
+
let n = _(e.id);
|
|
1280
|
+
return /* @__PURE__ */ l("li", {
|
|
1281
|
+
className: `nd-listbox-item ${n ? "nd-listbox-item--selected" : ""} ${e.disabled ? "nd-listbox-item--disabled" : ""}`,
|
|
1282
|
+
role: "option",
|
|
1283
|
+
"aria-selected": n,
|
|
1284
|
+
"aria-disabled": e.disabled,
|
|
1285
|
+
tabIndex: e.disabled ? -1 : 0,
|
|
1286
|
+
onClick: () => !e.disabled && v(e.id),
|
|
1287
|
+
onKeyDown: (e) => y(e, t),
|
|
1288
|
+
children: [i && /* @__PURE__ */ c("input", {
|
|
1289
|
+
type: "checkbox",
|
|
1290
|
+
checked: n,
|
|
1291
|
+
readOnly: !0,
|
|
1292
|
+
tabIndex: -1,
|
|
1293
|
+
style: {
|
|
1294
|
+
appearance: "none",
|
|
1295
|
+
width: "1rem",
|
|
1296
|
+
height: "1rem",
|
|
1297
|
+
borderRadius: "4px",
|
|
1298
|
+
boxShadow: n ? "var(--nd-shadow-inset), var(--nd-glow-accent)" : "var(--nd-shadow-inset)",
|
|
1299
|
+
backgroundColor: "var(--nd-color-bg)"
|
|
1300
|
+
}
|
|
1301
|
+
}), e.label]
|
|
1302
|
+
}, e.id);
|
|
1303
|
+
})
|
|
1304
|
+
});
|
|
1305
|
+
});
|
|
1306
|
+
M.displayName = "Listbox";
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region src/components/Menubar/Menubar.tsx
|
|
1309
|
+
var N = t({
|
|
1310
|
+
activeMenu: null,
|
|
1311
|
+
setActiveMenu: () => {}
|
|
1312
|
+
}), se = ({ children: e, className: t = "" }) => {
|
|
1313
|
+
let [n, r] = o(null), s = a(null);
|
|
1314
|
+
return i(() => {
|
|
1315
|
+
let e = (e) => {
|
|
1316
|
+
s.current && !s.current.contains(e.target) && r(null);
|
|
1317
|
+
};
|
|
1318
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1319
|
+
}, []), /* @__PURE__ */ c(N.Provider, {
|
|
1320
|
+
value: {
|
|
1321
|
+
activeMenu: n,
|
|
1322
|
+
setActiveMenu: r
|
|
1323
|
+
},
|
|
1324
|
+
children: /* @__PURE__ */ c("div", {
|
|
1325
|
+
className: `nd-menubar ${t}`,
|
|
1326
|
+
ref: s,
|
|
1327
|
+
children: e
|
|
1328
|
+
})
|
|
1329
|
+
});
|
|
1330
|
+
}, ce = ({ id: e, label: t, children: n }) => {
|
|
1331
|
+
let { activeMenu: i, setActiveMenu: o } = r(N), s = i === e;
|
|
1332
|
+
return /* @__PURE__ */ l("div", {
|
|
1333
|
+
style: { position: "relative" },
|
|
1334
|
+
ref: a(null),
|
|
1335
|
+
children: [/* @__PURE__ */ c("button", {
|
|
1336
|
+
className: "nd-menubar-trigger",
|
|
1337
|
+
"data-state": s ? "open" : "closed",
|
|
1338
|
+
onMouseEnter: () => {
|
|
1339
|
+
i !== null && o(e);
|
|
1340
|
+
},
|
|
1341
|
+
onClick: () => {
|
|
1342
|
+
o(s ? null : e);
|
|
1343
|
+
},
|
|
1344
|
+
children: t
|
|
1345
|
+
}), s && /* @__PURE__ */ c("div", {
|
|
1346
|
+
className: "nd-menubar-content",
|
|
1347
|
+
children: n
|
|
1348
|
+
})]
|
|
1349
|
+
});
|
|
1350
|
+
}, le = ({ label: e, shortcut: t, onClick: n }) => {
|
|
1351
|
+
let { setActiveMenu: i } = r(N);
|
|
1352
|
+
return /* @__PURE__ */ l("button", {
|
|
1353
|
+
className: "nd-menubar-item",
|
|
1354
|
+
onClick: () => {
|
|
1355
|
+
n && n(), i(null);
|
|
1356
|
+
},
|
|
1357
|
+
children: [/* @__PURE__ */ c("span", { children: e }), t && /* @__PURE__ */ c("span", {
|
|
1358
|
+
style: {
|
|
1359
|
+
fontSize: "0.75rem",
|
|
1360
|
+
color: "var(--nd-color-text-disabled)"
|
|
1361
|
+
},
|
|
1362
|
+
children: t
|
|
1363
|
+
})]
|
|
1364
|
+
});
|
|
1365
|
+
}, ue = () => /* @__PURE__ */ c("div", { className: "nd-menubar-separator" }), de = ({ isOpen: e, onClose: t, title: n, children: r, footer: a }) => (i(() => {
|
|
1366
|
+
let n = (n) => {
|
|
1367
|
+
n.key === "Escape" && e && t();
|
|
1368
|
+
};
|
|
1369
|
+
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
1370
|
+
}, [e, t]), i(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
1371
|
+
document.body.style.overflow = "";
|
|
1372
|
+
}), [e]), typeof document < "u" ? u(/* @__PURE__ */ c("div", {
|
|
1373
|
+
className: `nd-modal-overlay ${e ? "nd-modal-overlay--open" : ""}`,
|
|
1374
|
+
onClick: t,
|
|
1375
|
+
children: /* @__PURE__ */ l("div", {
|
|
1376
|
+
className: "nd-modal",
|
|
1377
|
+
onClick: (e) => e.stopPropagation(),
|
|
1378
|
+
role: "dialog",
|
|
1379
|
+
"aria-modal": "true",
|
|
1380
|
+
children: [
|
|
1381
|
+
/* @__PURE__ */ l("div", {
|
|
1382
|
+
className: "nd-modal-header",
|
|
1383
|
+
children: [n && /* @__PURE__ */ c("h2", {
|
|
1384
|
+
className: "nd-modal-title",
|
|
1385
|
+
children: n
|
|
1386
|
+
}), /* @__PURE__ */ c("button", {
|
|
1387
|
+
className: "nd-modal-close",
|
|
1388
|
+
onClick: t,
|
|
1389
|
+
"aria-label": "Close",
|
|
1390
|
+
children: /* @__PURE__ */ l("svg", {
|
|
1391
|
+
width: "20",
|
|
1392
|
+
height: "20",
|
|
1393
|
+
viewBox: "0 0 24 24",
|
|
1394
|
+
fill: "none",
|
|
1395
|
+
stroke: "currentColor",
|
|
1396
|
+
strokeWidth: "2",
|
|
1397
|
+
strokeLinecap: "round",
|
|
1398
|
+
strokeLinejoin: "round",
|
|
1399
|
+
children: [/* @__PURE__ */ c("line", {
|
|
1400
|
+
x1: "18",
|
|
1401
|
+
y1: "6",
|
|
1402
|
+
x2: "6",
|
|
1403
|
+
y2: "18"
|
|
1404
|
+
}), /* @__PURE__ */ c("line", {
|
|
1405
|
+
x1: "6",
|
|
1406
|
+
y1: "6",
|
|
1407
|
+
x2: "18",
|
|
1408
|
+
y2: "18"
|
|
1409
|
+
})]
|
|
1410
|
+
})
|
|
1411
|
+
})]
|
|
1412
|
+
}),
|
|
1413
|
+
/* @__PURE__ */ c("div", {
|
|
1414
|
+
className: "nd-modal-content",
|
|
1415
|
+
children: r
|
|
1416
|
+
}),
|
|
1417
|
+
a && /* @__PURE__ */ c("div", {
|
|
1418
|
+
className: "nd-modal-footer",
|
|
1419
|
+
children: a
|
|
1420
|
+
})
|
|
1421
|
+
]
|
|
1422
|
+
})
|
|
1423
|
+
}), document.body) : null), P = (e, t) => {
|
|
1424
|
+
let n = t - e + 1;
|
|
1425
|
+
return Array.from({ length: n }, (t, n) => n + e);
|
|
1426
|
+
}, F = e.forwardRef(({ className: e = "", currentPage: t, totalPages: n, onChange: r, siblingCount: i = 1, ...a }, o) => {
|
|
1427
|
+
let s = (() => {
|
|
1428
|
+
if (i + 5 >= n) return P(1, n);
|
|
1429
|
+
let e = Math.max(t - i, 1), r = Math.min(t + i, n), a = e > 2, o = r < n - 2, s = n;
|
|
1430
|
+
return !a && o ? [
|
|
1431
|
+
...P(1, 3 + 2 * i),
|
|
1432
|
+
"...",
|
|
1433
|
+
n
|
|
1434
|
+
] : a && !o ? [
|
|
1435
|
+
1,
|
|
1436
|
+
"...",
|
|
1437
|
+
...P(n - (3 + 2 * i) + 1, n)
|
|
1438
|
+
] : a && o ? [
|
|
1439
|
+
1,
|
|
1440
|
+
"...",
|
|
1441
|
+
...P(e, r),
|
|
1442
|
+
"...",
|
|
1443
|
+
s
|
|
1444
|
+
] : [];
|
|
1445
|
+
})();
|
|
1446
|
+
return /* @__PURE__ */ l("ul", {
|
|
1447
|
+
className: `nd-pagination ${e}`,
|
|
1448
|
+
ref: o,
|
|
1449
|
+
...a,
|
|
1450
|
+
children: [
|
|
1451
|
+
/* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("button", {
|
|
1452
|
+
className: "nd-pagination-item",
|
|
1453
|
+
disabled: t === 1,
|
|
1454
|
+
onClick: () => r(t - 1),
|
|
1455
|
+
"aria-label": "Previous page",
|
|
1456
|
+
children: /* @__PURE__ */ c("svg", {
|
|
1457
|
+
width: "16",
|
|
1458
|
+
height: "16",
|
|
1459
|
+
viewBox: "0 0 24 24",
|
|
1460
|
+
fill: "none",
|
|
1461
|
+
stroke: "currentColor",
|
|
1462
|
+
strokeWidth: "2",
|
|
1463
|
+
strokeLinecap: "round",
|
|
1464
|
+
strokeLinejoin: "round",
|
|
1465
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
1466
|
+
})
|
|
1467
|
+
}) }),
|
|
1468
|
+
s.map((e, n) => e === "..." ? /* @__PURE__ */ c("li", {
|
|
1469
|
+
className: "nd-pagination-ellipsis",
|
|
1470
|
+
children: "…"
|
|
1471
|
+
}, `ellipsis-${n}`) : /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("button", {
|
|
1472
|
+
className: `nd-pagination-item ${e === t ? "nd-pagination-item--active" : ""}`,
|
|
1473
|
+
onClick: () => r(e),
|
|
1474
|
+
"aria-current": e === t ? "page" : void 0,
|
|
1475
|
+
children: e
|
|
1476
|
+
}) }, e)),
|
|
1477
|
+
/* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("button", {
|
|
1478
|
+
className: "nd-pagination-item",
|
|
1479
|
+
disabled: t === n,
|
|
1480
|
+
onClick: () => r(t + 1),
|
|
1481
|
+
"aria-label": "Next page",
|
|
1482
|
+
children: /* @__PURE__ */ c("svg", {
|
|
1483
|
+
width: "16",
|
|
1484
|
+
height: "16",
|
|
1485
|
+
viewBox: "0 0 24 24",
|
|
1486
|
+
fill: "none",
|
|
1487
|
+
stroke: "currentColor",
|
|
1488
|
+
strokeWidth: "2",
|
|
1489
|
+
strokeLinecap: "round",
|
|
1490
|
+
strokeLinejoin: "round",
|
|
1491
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
1492
|
+
})
|
|
1493
|
+
}) })
|
|
1494
|
+
]
|
|
1495
|
+
});
|
|
1496
|
+
});
|
|
1497
|
+
F.displayName = "Pagination";
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/components/Popover/Popover.tsx
|
|
1500
|
+
var fe = ({ trigger: e, content: t, header: n, placement: r = "bottom", className: s = "", showClose: u = !1 }) => {
|
|
1501
|
+
let [d, f] = o(!1), p = a(null);
|
|
1502
|
+
return i(() => {
|
|
1503
|
+
let e = (e) => {
|
|
1504
|
+
p.current && !p.current.contains(e.target) && f(!1);
|
|
1505
|
+
};
|
|
1506
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1507
|
+
}, []), /* @__PURE__ */ l("div", {
|
|
1508
|
+
className: `nd-popover-wrapper ${s}`,
|
|
1509
|
+
ref: p,
|
|
1510
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1511
|
+
onClick: () => f((e) => !e),
|
|
1512
|
+
style: { display: "inline-block" },
|
|
1513
|
+
children: e
|
|
1514
|
+
}), d && /* @__PURE__ */ l("div", {
|
|
1515
|
+
className: `nd-popover-content nd-popover-content--${r}`,
|
|
1516
|
+
children: [
|
|
1517
|
+
u && /* @__PURE__ */ c("button", {
|
|
1518
|
+
className: "nd-popover-close",
|
|
1519
|
+
onClick: () => f(!1),
|
|
1520
|
+
"aria-label": "Close popover",
|
|
1521
|
+
children: /* @__PURE__ */ l("svg", {
|
|
1522
|
+
width: "12",
|
|
1523
|
+
height: "12",
|
|
1524
|
+
viewBox: "0 0 24 24",
|
|
1525
|
+
fill: "none",
|
|
1526
|
+
stroke: "currentColor",
|
|
1527
|
+
strokeWidth: "2",
|
|
1528
|
+
strokeLinecap: "round",
|
|
1529
|
+
strokeLinejoin: "round",
|
|
1530
|
+
children: [/* @__PURE__ */ c("line", {
|
|
1531
|
+
x1: "18",
|
|
1532
|
+
y1: "6",
|
|
1533
|
+
x2: "6",
|
|
1534
|
+
y2: "18"
|
|
1535
|
+
}), /* @__PURE__ */ c("line", {
|
|
1536
|
+
x1: "6",
|
|
1537
|
+
y1: "6",
|
|
1538
|
+
x2: "18",
|
|
1539
|
+
y2: "18"
|
|
1540
|
+
})]
|
|
1541
|
+
})
|
|
1542
|
+
}),
|
|
1543
|
+
n && /* @__PURE__ */ c("div", {
|
|
1544
|
+
className: "nd-popover-header",
|
|
1545
|
+
children: n
|
|
1546
|
+
}),
|
|
1547
|
+
/* @__PURE__ */ c("div", {
|
|
1548
|
+
className: "nd-popover-body",
|
|
1549
|
+
children: t
|
|
1550
|
+
})
|
|
1551
|
+
]
|
|
1552
|
+
})]
|
|
1553
|
+
});
|
|
1554
|
+
}, pe = e.forwardRef(({ className: e = "", value: t = 0, max: n = 100, label: r, showValue: i = !0, ...a }, o) => {
|
|
1555
|
+
let s = Math.max(0, Number(t)), u = Math.max(1, Number(n)), d = Math.min(100, s / u * 100);
|
|
1556
|
+
return /* @__PURE__ */ l("div", {
|
|
1557
|
+
ref: o,
|
|
1558
|
+
className: ["nd-progress-wrapper", e].filter(Boolean).join(" "),
|
|
1559
|
+
...a,
|
|
1560
|
+
children: [(r || i) && /* @__PURE__ */ l("div", {
|
|
1561
|
+
className: "nd-progress-label",
|
|
1562
|
+
children: [r ? /* @__PURE__ */ c("span", { children: r }) : /* @__PURE__ */ c("span", {}), i && /* @__PURE__ */ l("span", {
|
|
1563
|
+
className: "nd-progress-value",
|
|
1564
|
+
children: [Math.round(d), "%"]
|
|
1565
|
+
})]
|
|
1566
|
+
}), /* @__PURE__ */ c("div", {
|
|
1567
|
+
className: "nd-progress-track",
|
|
1568
|
+
children: /* @__PURE__ */ c("div", {
|
|
1569
|
+
className: "nd-progress-fill",
|
|
1570
|
+
style: { width: `${d}%` }
|
|
1571
|
+
})
|
|
1572
|
+
})]
|
|
1573
|
+
});
|
|
1574
|
+
});
|
|
1575
|
+
pe.displayName = "ProgressBar";
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region src/components/Radio/Radio.tsx
|
|
1578
|
+
var I = e.forwardRef(({ className: e = "", label: t, disabled: n, checked: r, onChange: i, ...a }, o) => /* @__PURE__ */ l("label", {
|
|
1579
|
+
className: [
|
|
1580
|
+
"nd-radio-wrapper",
|
|
1581
|
+
r ? "nd-radio-wrapper--checked" : "",
|
|
1582
|
+
n ? "nd-radio-wrapper--disabled" : "",
|
|
1583
|
+
e
|
|
1584
|
+
].filter(Boolean).join(" "),
|
|
1585
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1586
|
+
className: "nd-radio-box",
|
|
1587
|
+
children: [/* @__PURE__ */ c("input", {
|
|
1588
|
+
type: "radio",
|
|
1589
|
+
className: "nd-radio-input",
|
|
1590
|
+
ref: o,
|
|
1591
|
+
checked: r,
|
|
1592
|
+
onChange: i,
|
|
1593
|
+
disabled: n,
|
|
1594
|
+
...a
|
|
1595
|
+
}), /* @__PURE__ */ c("div", { className: "nd-radio-dot" })]
|
|
1596
|
+
}), t && /* @__PURE__ */ c("span", { children: t })]
|
|
1597
|
+
}));
|
|
1598
|
+
I.displayName = "Radio";
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region src/components/RangeSlider/RangeSlider.tsx
|
|
1601
|
+
var me = ({ min: e = 0, max: t = 100, step: r = 1, defaultValue: s = [25, 75], value: u, onChange: d, className: f = "" }) => {
|
|
1602
|
+
let [p, m] = o(s), [h, g] = o(null), _ = a(null), v = u !== void 0, y = v ? u : p, b = (n) => (n - e) / (t - e) * 100, x = (e, t) => {
|
|
1603
|
+
t.preventDefault(), g(e), t.target instanceof HTMLElement && t.target.setPointerCapture(t.pointerId);
|
|
1604
|
+
}, S = n((n) => {
|
|
1605
|
+
if (h === null || !_.current) return;
|
|
1606
|
+
let i = _.current.getBoundingClientRect(), a = Math.min(Math.max((n.clientX - i.left) / i.width, 0), 1) * (t - e) + e;
|
|
1607
|
+
a = Math.round(a / r) * r;
|
|
1608
|
+
let o = [...y];
|
|
1609
|
+
h === 0 ? o[0] = Math.min(Math.max(a, e), y[1]) : o[1] = Math.max(Math.min(a, t), y[0]), v || m(o), d && d(o);
|
|
1610
|
+
}, [
|
|
1611
|
+
h,
|
|
1612
|
+
y,
|
|
1613
|
+
e,
|
|
1614
|
+
t,
|
|
1615
|
+
r,
|
|
1616
|
+
v,
|
|
1617
|
+
d
|
|
1618
|
+
]), C = n((e) => {
|
|
1619
|
+
if (g(null), e.target instanceof HTMLElement && e.pointerId) try {
|
|
1620
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
1621
|
+
} catch {}
|
|
1622
|
+
}, []);
|
|
1623
|
+
i(() => (h === null ? (document.removeEventListener("pointermove", S), document.removeEventListener("pointerup", C)) : (document.addEventListener("pointermove", S), document.addEventListener("pointerup", C)), () => {
|
|
1624
|
+
document.removeEventListener("pointermove", S), document.removeEventListener("pointerup", C);
|
|
1625
|
+
}), [
|
|
1626
|
+
h,
|
|
1627
|
+
S,
|
|
1628
|
+
C
|
|
1629
|
+
]);
|
|
1630
|
+
let w = b(y[0]), T = b(y[1]), E = T - w;
|
|
1631
|
+
return /* @__PURE__ */ c("div", {
|
|
1632
|
+
className: `nd-range-slider ${f}`,
|
|
1633
|
+
children: /* @__PURE__ */ l("div", {
|
|
1634
|
+
className: "nd-range-slider-track",
|
|
1635
|
+
ref: _,
|
|
1636
|
+
children: [
|
|
1637
|
+
/* @__PURE__ */ c("div", {
|
|
1638
|
+
className: "nd-range-slider-fill",
|
|
1639
|
+
style: {
|
|
1640
|
+
left: `${w}%`,
|
|
1641
|
+
width: `${E}%`
|
|
1642
|
+
}
|
|
1643
|
+
}),
|
|
1644
|
+
/* @__PURE__ */ c("div", {
|
|
1645
|
+
className: "nd-range-slider-thumb",
|
|
1646
|
+
style: { left: `${w}%` },
|
|
1647
|
+
onPointerDown: (e) => x(0, e),
|
|
1648
|
+
tabIndex: 0,
|
|
1649
|
+
role: "slider",
|
|
1650
|
+
"aria-valuemin": e,
|
|
1651
|
+
"aria-valuemax": y[1],
|
|
1652
|
+
"aria-valuenow": y[0]
|
|
1653
|
+
}),
|
|
1654
|
+
/* @__PURE__ */ c("div", {
|
|
1655
|
+
className: "nd-range-slider-thumb",
|
|
1656
|
+
style: { left: `${T}%` },
|
|
1657
|
+
onPointerDown: (e) => x(1, e),
|
|
1658
|
+
tabIndex: 0,
|
|
1659
|
+
role: "slider",
|
|
1660
|
+
"aria-valuemin": y[0],
|
|
1661
|
+
"aria-valuemax": t,
|
|
1662
|
+
"aria-valuenow": y[1]
|
|
1663
|
+
})
|
|
1664
|
+
]
|
|
1665
|
+
})
|
|
1666
|
+
});
|
|
1667
|
+
}, L = e.forwardRef(({ className: e = "", max: t = 5, value: n = 0, onChange: r, readOnly: i = !1, ...a }, s) => {
|
|
1668
|
+
let [l, u] = o(null), d = (e) => {
|
|
1669
|
+
i || u(e);
|
|
1670
|
+
}, f = () => {
|
|
1671
|
+
i || u(null);
|
|
1672
|
+
}, p = (e) => {
|
|
1673
|
+
!i && r && r(e);
|
|
1674
|
+
}, m = l === null ? n : l;
|
|
1675
|
+
return /* @__PURE__ */ c("div", {
|
|
1676
|
+
className: `nd-rating ${e}`,
|
|
1677
|
+
ref: s,
|
|
1678
|
+
onMouseLeave: f,
|
|
1679
|
+
role: "slider",
|
|
1680
|
+
"aria-valuemin": 0,
|
|
1681
|
+
"aria-valuemax": t,
|
|
1682
|
+
"aria-valuenow": n,
|
|
1683
|
+
...a,
|
|
1684
|
+
children: Array.from({ length: t }).map((e, t) => {
|
|
1685
|
+
let n = t + 1, r = n <= m;
|
|
1686
|
+
return /* @__PURE__ */ c("button", {
|
|
1687
|
+
className: `nd-rating-star ${r ? "nd-rating-star--filled" : "nd-rating-star--unfilled"}`,
|
|
1688
|
+
onMouseEnter: () => d(n),
|
|
1689
|
+
onClick: () => p(n),
|
|
1690
|
+
disabled: i,
|
|
1691
|
+
"aria-label": `Rate ${n} stars`,
|
|
1692
|
+
children: /* @__PURE__ */ c("svg", {
|
|
1693
|
+
width: "24",
|
|
1694
|
+
height: "24",
|
|
1695
|
+
viewBox: "0 0 24 24",
|
|
1696
|
+
fill: r ? "currentColor" : "none",
|
|
1697
|
+
stroke: "currentColor",
|
|
1698
|
+
strokeWidth: "2",
|
|
1699
|
+
strokeLinecap: "round",
|
|
1700
|
+
strokeLinejoin: "round",
|
|
1701
|
+
children: /* @__PURE__ */ c("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })
|
|
1702
|
+
})
|
|
1703
|
+
}, n);
|
|
1704
|
+
})
|
|
1705
|
+
});
|
|
1706
|
+
});
|
|
1707
|
+
L.displayName = "Rating";
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/components/Resizable/Resizable.tsx
|
|
1710
|
+
var he = ({ direction: e = "horizontal", initialRatio: t = .5, minRatio: r = .1, maxRatio: s = .9, panelA: u, panelB: d, className: f = "", style: p }) => {
|
|
1711
|
+
let [m, h] = o(t), [g, _] = o(!1), v = a(null), y = (e) => {
|
|
1712
|
+
e.preventDefault(), _(!0);
|
|
1713
|
+
}, b = n((t) => {
|
|
1714
|
+
if (!g || !v.current) return;
|
|
1715
|
+
let n = v.current.getBoundingClientRect(), i;
|
|
1716
|
+
i = e === "horizontal" ? (t.clientX - n.left) / n.width : (t.clientY - n.top) / n.height, i = Math.max(r, Math.min(s, i)), h(i);
|
|
1717
|
+
}, [
|
|
1718
|
+
g,
|
|
1719
|
+
e,
|
|
1720
|
+
r,
|
|
1721
|
+
s
|
|
1722
|
+
]), x = n(() => {
|
|
1723
|
+
_(!1);
|
|
1724
|
+
}, []);
|
|
1725
|
+
i(() => (g ? (document.addEventListener("mousemove", b), document.addEventListener("mouseup", x), document.body.style.userSelect = "none", document.body.style.cursor = e === "horizontal" ? "col-resize" : "row-resize") : (document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x), document.body.style.userSelect = "", document.body.style.cursor = ""), () => {
|
|
1726
|
+
document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x), document.body.style.userSelect = "", document.body.style.cursor = "";
|
|
1727
|
+
}), [
|
|
1728
|
+
g,
|
|
1729
|
+
b,
|
|
1730
|
+
x,
|
|
1731
|
+
e
|
|
1732
|
+
]);
|
|
1733
|
+
let S = `${m * 100}%`, C = `${(1 - m) * 100}%`;
|
|
1734
|
+
return /* @__PURE__ */ l("div", {
|
|
1735
|
+
className: `nd-resizable-container nd-resizable-container--${e} ${f}`,
|
|
1736
|
+
ref: v,
|
|
1737
|
+
style: p,
|
|
1738
|
+
children: [
|
|
1739
|
+
/* @__PURE__ */ c("div", {
|
|
1740
|
+
className: "nd-resizable-panel",
|
|
1741
|
+
style: {
|
|
1742
|
+
flexBasis: S,
|
|
1743
|
+
flexGrow: 0
|
|
1744
|
+
},
|
|
1745
|
+
children: u
|
|
1746
|
+
}),
|
|
1747
|
+
/* @__PURE__ */ c("div", {
|
|
1748
|
+
className: `nd-resizable-handle nd-resizable-handle--${e}`,
|
|
1749
|
+
onMouseDown: y,
|
|
1750
|
+
role: "separator",
|
|
1751
|
+
"aria-orientation": e,
|
|
1752
|
+
children: /* @__PURE__ */ c("div", { className: "nd-resizable-grip" })
|
|
1753
|
+
}),
|
|
1754
|
+
/* @__PURE__ */ c("div", {
|
|
1755
|
+
className: "nd-resizable-panel",
|
|
1756
|
+
style: {
|
|
1757
|
+
flexBasis: C,
|
|
1758
|
+
flexGrow: 1
|
|
1759
|
+
},
|
|
1760
|
+
children: d
|
|
1761
|
+
})
|
|
1762
|
+
]
|
|
1763
|
+
});
|
|
1764
|
+
}, R = e.forwardRef(({ className: e = "", height: t = "100%", width: n = "100%", style: r, children: i, ...a }, o) => /* @__PURE__ */ c("div", {
|
|
1765
|
+
className: `nd-scroll-area ${e}`,
|
|
1766
|
+
ref: o,
|
|
1767
|
+
style: {
|
|
1768
|
+
height: t,
|
|
1769
|
+
width: n,
|
|
1770
|
+
...r
|
|
1771
|
+
},
|
|
1772
|
+
...a,
|
|
1773
|
+
children: i
|
|
1774
|
+
}));
|
|
1775
|
+
R.displayName = "ScrollArea";
|
|
1776
|
+
//#endregion
|
|
1777
|
+
//#region src/components/Select/Select.tsx
|
|
1778
|
+
var z = e.forwardRef(({ className: e = "", label: t, error: n, options: r, value: s, onChange: u, disabled: d, ...f }, p) => {
|
|
1779
|
+
let [m, h] = o(!1), g = a(null), _ = r.find((e) => e.value === s);
|
|
1780
|
+
i(() => {
|
|
1781
|
+
let e = (e) => {
|
|
1782
|
+
g.current && !g.current.contains(e.target) && h(!1);
|
|
1783
|
+
};
|
|
1784
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1785
|
+
}, []);
|
|
1786
|
+
let v = (e) => {
|
|
1787
|
+
u && u(e), h(!1);
|
|
1788
|
+
}, y = ["nd-select-wrapper", e].filter(Boolean).join(" "), b = [
|
|
1789
|
+
"nd-select-trigger",
|
|
1790
|
+
n ? "nd-select-trigger--error" : "",
|
|
1791
|
+
d ? "nd-select-trigger--disabled" : "",
|
|
1792
|
+
m ? "nd-select-trigger--open" : ""
|
|
1793
|
+
].filter(Boolean).join(" ");
|
|
1794
|
+
return /* @__PURE__ */ l("div", {
|
|
1795
|
+
className: y,
|
|
1796
|
+
ref: g,
|
|
1797
|
+
...f,
|
|
1798
|
+
children: [
|
|
1799
|
+
t && /* @__PURE__ */ c("label", {
|
|
1800
|
+
className: "nd-select-label",
|
|
1801
|
+
children: t
|
|
1802
|
+
}),
|
|
1803
|
+
/* @__PURE__ */ l("div", {
|
|
1804
|
+
className: "nd-select-container",
|
|
1805
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1806
|
+
className: b,
|
|
1807
|
+
onClick: () => !d && h(!m),
|
|
1808
|
+
ref: p,
|
|
1809
|
+
role: "button",
|
|
1810
|
+
"aria-haspopup": "listbox",
|
|
1811
|
+
"aria-expanded": m,
|
|
1812
|
+
children: [/* @__PURE__ */ c("span", { children: _ ? _.label : "Select..." }), /* @__PURE__ */ c("svg", {
|
|
1813
|
+
className: `nd-select-icon ${m ? "nd-select-icon--open" : ""}`,
|
|
1814
|
+
width: "16",
|
|
1815
|
+
height: "16",
|
|
1816
|
+
viewBox: "0 0 24 24",
|
|
1817
|
+
fill: "none",
|
|
1818
|
+
stroke: "currentColor",
|
|
1819
|
+
strokeWidth: "2",
|
|
1820
|
+
strokeLinecap: "round",
|
|
1821
|
+
strokeLinejoin: "round",
|
|
1822
|
+
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
1823
|
+
})]
|
|
1824
|
+
}), m && !d && /* @__PURE__ */ c("div", {
|
|
1825
|
+
className: "nd-select-dropdown",
|
|
1826
|
+
role: "listbox",
|
|
1827
|
+
children: r.map((e) => /* @__PURE__ */ c("div", {
|
|
1828
|
+
role: "option",
|
|
1829
|
+
"aria-selected": e.value === _?.value,
|
|
1830
|
+
className: `nd-select-option ${e.value === _?.value ? "nd-select-option--selected" : ""}`,
|
|
1831
|
+
onClick: () => v(e.value),
|
|
1832
|
+
children: e.label
|
|
1833
|
+
}, e.value))
|
|
1834
|
+
})]
|
|
1835
|
+
}),
|
|
1836
|
+
n && /* @__PURE__ */ c("span", {
|
|
1837
|
+
className: "nd-select-error-text",
|
|
1838
|
+
children: n
|
|
1839
|
+
})
|
|
1840
|
+
]
|
|
1841
|
+
});
|
|
1842
|
+
});
|
|
1843
|
+
z.displayName = "Select";
|
|
1844
|
+
//#endregion
|
|
1845
|
+
//#region src/components/Skeleton/Skeleton.tsx
|
|
1846
|
+
var B = e.forwardRef(({ className: e = "", variant: t = "text", width: n, height: r, style: i, ...a }, o) => /* @__PURE__ */ c("div", {
|
|
1847
|
+
className: [
|
|
1848
|
+
"nd-skeleton",
|
|
1849
|
+
`nd-skeleton--${t}`,
|
|
1850
|
+
e
|
|
1851
|
+
].filter(Boolean).join(" "),
|
|
1852
|
+
style: {
|
|
1853
|
+
...i,
|
|
1854
|
+
...n && { width: n },
|
|
1855
|
+
...r && { height: r }
|
|
1856
|
+
},
|
|
1857
|
+
ref: o,
|
|
1858
|
+
"aria-hidden": "true",
|
|
1859
|
+
...a
|
|
1860
|
+
}));
|
|
1861
|
+
B.displayName = "Skeleton";
|
|
1862
|
+
//#endregion
|
|
1863
|
+
//#region src/components/Slider/Slider.tsx
|
|
1864
|
+
var V = e.forwardRef(({ className: e = "", label: t, value: n = 0, min: r = 0, max: i = 100, disabled: a, onChange: o, ...s }, u) => {
|
|
1865
|
+
let d = Number(n), f = Number(r), p = Number(i), m = Math.max(0, Math.min(100, (d - f) / (p - f) * 100));
|
|
1866
|
+
return /* @__PURE__ */ l("div", {
|
|
1867
|
+
className: [
|
|
1868
|
+
"nd-slider-wrapper",
|
|
1869
|
+
a ? "nd-slider-wrapper--disabled" : "",
|
|
1870
|
+
e
|
|
1871
|
+
].filter(Boolean).join(" "),
|
|
1872
|
+
children: [t && /* @__PURE__ */ l("div", {
|
|
1873
|
+
className: "nd-slider-label",
|
|
1874
|
+
children: [/* @__PURE__ */ c("span", { children: t }), /* @__PURE__ */ c("span", {
|
|
1875
|
+
className: "nd-slider-value",
|
|
1876
|
+
children: n
|
|
1877
|
+
})]
|
|
1878
|
+
}), /* @__PURE__ */ l("div", {
|
|
1879
|
+
className: "nd-slider-track-container",
|
|
1880
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1881
|
+
className: "nd-slider-track",
|
|
1882
|
+
children: /* @__PURE__ */ c("div", {
|
|
1883
|
+
className: "nd-slider-fill",
|
|
1884
|
+
style: { width: `${m}%` }
|
|
1885
|
+
})
|
|
1886
|
+
}), /* @__PURE__ */ c("input", {
|
|
1887
|
+
type: "range",
|
|
1888
|
+
className: "nd-slider-input",
|
|
1889
|
+
ref: u,
|
|
1890
|
+
value: n,
|
|
1891
|
+
min: r,
|
|
1892
|
+
max: i,
|
|
1893
|
+
disabled: a,
|
|
1894
|
+
onChange: o,
|
|
1895
|
+
...s
|
|
1896
|
+
})]
|
|
1897
|
+
})]
|
|
1898
|
+
});
|
|
1899
|
+
});
|
|
1900
|
+
V.displayName = "Slider";
|
|
1901
|
+
//#endregion
|
|
1902
|
+
//#region src/components/SpeedDial/SpeedDial.tsx
|
|
1903
|
+
var ge = ({ actions: e, icon: t, className: n = "" }) => {
|
|
1904
|
+
let [r, s] = o(!1), u = a(null);
|
|
1905
|
+
i(() => {
|
|
1906
|
+
let e = (e) => {
|
|
1907
|
+
u.current && !u.current.contains(e.target) && s(!1);
|
|
1908
|
+
};
|
|
1909
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1910
|
+
}, []);
|
|
1911
|
+
let d = /* @__PURE__ */ l("svg", {
|
|
1912
|
+
width: "24",
|
|
1913
|
+
height: "24",
|
|
1914
|
+
viewBox: "0 0 24 24",
|
|
1915
|
+
fill: "none",
|
|
1916
|
+
stroke: "currentColor",
|
|
1917
|
+
strokeWidth: "2",
|
|
1918
|
+
strokeLinecap: "round",
|
|
1919
|
+
strokeLinejoin: "round",
|
|
1920
|
+
children: [/* @__PURE__ */ c("line", {
|
|
1921
|
+
x1: "12",
|
|
1922
|
+
y1: "5",
|
|
1923
|
+
x2: "12",
|
|
1924
|
+
y2: "19"
|
|
1925
|
+
}), /* @__PURE__ */ c("line", {
|
|
1926
|
+
x1: "5",
|
|
1927
|
+
y1: "12",
|
|
1928
|
+
x2: "19",
|
|
1929
|
+
y2: "12"
|
|
1930
|
+
})]
|
|
1931
|
+
});
|
|
1932
|
+
return /* @__PURE__ */ l("div", {
|
|
1933
|
+
className: `nd-speed-dial ${r ? "nd-speed-dial--open" : ""} ${n}`,
|
|
1934
|
+
ref: u,
|
|
1935
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1936
|
+
className: "nd-speed-dial-actions",
|
|
1937
|
+
children: e.map((e, t) => /* @__PURE__ */ l("button", {
|
|
1938
|
+
className: "nd-speed-dial-action",
|
|
1939
|
+
onClick: () => {
|
|
1940
|
+
e.onClick && e.onClick(), s(!1);
|
|
1941
|
+
},
|
|
1942
|
+
"aria-label": e.label,
|
|
1943
|
+
children: [e.icon, /* @__PURE__ */ c("span", {
|
|
1944
|
+
className: "nd-speed-dial-tooltip",
|
|
1945
|
+
children: e.label
|
|
1946
|
+
})]
|
|
1947
|
+
}, t))
|
|
1948
|
+
}), /* @__PURE__ */ c("button", {
|
|
1949
|
+
className: "nd-speed-dial-trigger",
|
|
1950
|
+
onClick: () => s(!r),
|
|
1951
|
+
"aria-expanded": r,
|
|
1952
|
+
"aria-haspopup": "menu",
|
|
1953
|
+
"aria-label": "Toggle Speed Dial",
|
|
1954
|
+
children: /* @__PURE__ */ c("span", {
|
|
1955
|
+
className: "nd-speed-dial-trigger-icon",
|
|
1956
|
+
children: t || d
|
|
1957
|
+
})
|
|
1958
|
+
})]
|
|
1959
|
+
});
|
|
1960
|
+
}, H = e.forwardRef(({ className: e = "", size: t = "md", ...n }, r) => {
|
|
1961
|
+
let i = [
|
|
1962
|
+
"nd-spinner",
|
|
1963
|
+
`nd-spinner--${t}`,
|
|
1964
|
+
e
|
|
1965
|
+
].filter(Boolean).join(" ");
|
|
1966
|
+
return /* @__PURE__ */ c("div", {
|
|
1967
|
+
className: "nd-spinner-wrapper",
|
|
1968
|
+
ref: r,
|
|
1969
|
+
...n,
|
|
1970
|
+
children: /* @__PURE__ */ c("div", { className: i })
|
|
1971
|
+
});
|
|
1972
|
+
});
|
|
1973
|
+
H.displayName = "Spinner";
|
|
1974
|
+
//#endregion
|
|
1975
|
+
//#region src/components/SplitButton/SplitButton.tsx
|
|
1976
|
+
var _e = ({ label: e, onClick: t, options: n, className: r = "" }) => {
|
|
1977
|
+
let [s, u] = o(!1), d = a(null);
|
|
1978
|
+
return i(() => {
|
|
1979
|
+
let e = (e) => {
|
|
1980
|
+
d.current && !d.current.contains(e.target) && u(!1);
|
|
1981
|
+
};
|
|
1982
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1983
|
+
}, []), /* @__PURE__ */ l("div", {
|
|
1984
|
+
className: `nd-split-button-container ${r}`,
|
|
1985
|
+
ref: d,
|
|
1986
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1987
|
+
className: "nd-split-button-group",
|
|
1988
|
+
children: [
|
|
1989
|
+
/* @__PURE__ */ c("button", {
|
|
1990
|
+
className: "nd-split-button-main",
|
|
1991
|
+
onClick: () => {
|
|
1992
|
+
t && t(), u(!1);
|
|
1993
|
+
},
|
|
1994
|
+
children: e
|
|
1995
|
+
}),
|
|
1996
|
+
/* @__PURE__ */ c("div", { className: "nd-split-button-divider" }),
|
|
1997
|
+
/* @__PURE__ */ c("button", {
|
|
1998
|
+
className: "nd-split-button-dropdown-toggle",
|
|
1999
|
+
onClick: () => u(!s),
|
|
2000
|
+
"aria-expanded": s,
|
|
2001
|
+
"aria-haspopup": "menu",
|
|
2002
|
+
"aria-label": "Toggle drop-down",
|
|
2003
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2004
|
+
width: "16",
|
|
2005
|
+
height: "16",
|
|
2006
|
+
viewBox: "0 0 24 24",
|
|
2007
|
+
fill: "none",
|
|
2008
|
+
stroke: "currentColor",
|
|
2009
|
+
strokeWidth: "2",
|
|
2010
|
+
strokeLinecap: "round",
|
|
2011
|
+
strokeLinejoin: "round",
|
|
2012
|
+
style: {
|
|
2013
|
+
transform: s ? "rotate(180deg)" : "rotate(0deg)",
|
|
2014
|
+
transition: "transform 0.2s"
|
|
2015
|
+
},
|
|
2016
|
+
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
2017
|
+
})
|
|
2018
|
+
})
|
|
2019
|
+
]
|
|
2020
|
+
}), s && /* @__PURE__ */ c("div", {
|
|
2021
|
+
className: "nd-split-button-menu",
|
|
2022
|
+
role: "menu",
|
|
2023
|
+
children: n.map((e, t) => /* @__PURE__ */ c("button", {
|
|
2024
|
+
className: "nd-split-button-menu-item",
|
|
2025
|
+
role: "menuitem",
|
|
2026
|
+
onClick: () => {
|
|
2027
|
+
e.onClick(), u(!1);
|
|
2028
|
+
},
|
|
2029
|
+
children: e.label
|
|
2030
|
+
}, t))
|
|
2031
|
+
})]
|
|
2032
|
+
});
|
|
2033
|
+
}, U = e.forwardRef(({ className: e = "", steps: t, currentStep: n, ...r }, i) => /* @__PURE__ */ c("div", {
|
|
2034
|
+
className: `nd-stepper ${e}`,
|
|
2035
|
+
ref: i,
|
|
2036
|
+
...r,
|
|
2037
|
+
children: t.map((e, t) => {
|
|
2038
|
+
let r = t < n;
|
|
2039
|
+
return /* @__PURE__ */ l("div", {
|
|
2040
|
+
className: [
|
|
2041
|
+
"nd-stepper-item",
|
|
2042
|
+
t === n ? "nd-stepper-item--active" : "",
|
|
2043
|
+
r ? "nd-stepper-item--completed" : ""
|
|
2044
|
+
].filter(Boolean).join(" "),
|
|
2045
|
+
children: [
|
|
2046
|
+
/* @__PURE__ */ c("div", {
|
|
2047
|
+
className: "nd-stepper-indicator",
|
|
2048
|
+
children: r ? /* @__PURE__ */ c("svg", {
|
|
2049
|
+
width: "16",
|
|
2050
|
+
height: "16",
|
|
2051
|
+
viewBox: "0 0 24 24",
|
|
2052
|
+
fill: "none",
|
|
2053
|
+
stroke: "currentColor",
|
|
2054
|
+
strokeWidth: "3",
|
|
2055
|
+
strokeLinecap: "round",
|
|
2056
|
+
strokeLinejoin: "round",
|
|
2057
|
+
children: /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
|
|
2058
|
+
}) : /* @__PURE__ */ c("span", { children: t + 1 })
|
|
2059
|
+
}),
|
|
2060
|
+
/* @__PURE__ */ c("div", {
|
|
2061
|
+
className: "nd-stepper-label",
|
|
2062
|
+
children: e.label
|
|
2063
|
+
}),
|
|
2064
|
+
/* @__PURE__ */ c("div", { className: "nd-stepper-connector" })
|
|
2065
|
+
]
|
|
2066
|
+
}, t);
|
|
2067
|
+
})
|
|
2068
|
+
}));
|
|
2069
|
+
U.displayName = "Stepper";
|
|
2070
|
+
//#endregion
|
|
2071
|
+
//#region src/components/Switch/Switch.tsx
|
|
2072
|
+
var W = e.forwardRef(({ className: e = "", label: t, disabled: n, checked: r, onChange: i, ...a }, o) => /* @__PURE__ */ l("label", {
|
|
2073
|
+
className: [
|
|
2074
|
+
"nd-switch",
|
|
2075
|
+
r ? "nd-switch--checked" : "",
|
|
2076
|
+
n ? "nd-switch--disabled" : "",
|
|
2077
|
+
e
|
|
2078
|
+
].filter(Boolean).join(" "),
|
|
2079
|
+
children: [t && /* @__PURE__ */ c("span", { children: t }), /* @__PURE__ */ l("div", {
|
|
2080
|
+
className: "nd-switch-track",
|
|
2081
|
+
children: [/* @__PURE__ */ c("input", {
|
|
2082
|
+
type: "checkbox",
|
|
2083
|
+
className: "nd-switch-input",
|
|
2084
|
+
ref: o,
|
|
2085
|
+
checked: r,
|
|
2086
|
+
onChange: i,
|
|
2087
|
+
disabled: n,
|
|
2088
|
+
...a
|
|
2089
|
+
}), /* @__PURE__ */ c("div", { className: "nd-switch-thumb" })]
|
|
2090
|
+
})]
|
|
2091
|
+
}));
|
|
2092
|
+
W.displayName = "Switch";
|
|
2093
|
+
//#endregion
|
|
2094
|
+
//#region src/components/Table/Table.tsx
|
|
2095
|
+
function ve({ className: e = "", data: t, columns: n, keyExtractor: r, ...i }) {
|
|
2096
|
+
return /* @__PURE__ */ c("div", {
|
|
2097
|
+
className: "nd-table-container",
|
|
2098
|
+
children: /* @__PURE__ */ l("table", {
|
|
2099
|
+
className: `nd-table ${e}`,
|
|
2100
|
+
...i,
|
|
2101
|
+
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: n.map((e) => /* @__PURE__ */ c("th", {
|
|
2102
|
+
className: "nd-table-th",
|
|
2103
|
+
children: e.header
|
|
2104
|
+
}, e.key)) }) }), /* @__PURE__ */ l("tbody", { children: [t.map((e) => /* @__PURE__ */ c("tr", {
|
|
2105
|
+
className: "nd-table-tr",
|
|
2106
|
+
children: n.map((t) => /* @__PURE__ */ c("td", {
|
|
2107
|
+
className: "nd-table-td",
|
|
2108
|
+
children: t.render ? t.render(e) : e[t.key]
|
|
2109
|
+
}, t.key))
|
|
2110
|
+
}, r(e))), t.length === 0 && /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
|
|
2111
|
+
colSpan: n.length,
|
|
2112
|
+
className: "nd-table-td",
|
|
2113
|
+
style: {
|
|
2114
|
+
textAlign: "center",
|
|
2115
|
+
color: "var(--nd-color-text-secondary)"
|
|
2116
|
+
},
|
|
2117
|
+
children: "No data available"
|
|
2118
|
+
}) })] })]
|
|
2119
|
+
})
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
//#endregion
|
|
2123
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
2124
|
+
var G = e.forwardRef(({ className: e = "", items: t, defaultActiveId: n, onChange: r, ...i }, a) => {
|
|
2125
|
+
let [s, u] = o(n || t[0]?.id), d = (e) => {
|
|
2126
|
+
u(e), r && r(e);
|
|
2127
|
+
}, f = t.find((e) => e.id === s)?.content;
|
|
2128
|
+
return /* @__PURE__ */ l("div", {
|
|
2129
|
+
className: `nd-tabs-wrapper ${e}`,
|
|
2130
|
+
ref: a,
|
|
2131
|
+
...i,
|
|
2132
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2133
|
+
className: "nd-tabs-list",
|
|
2134
|
+
role: "tablist",
|
|
2135
|
+
children: t.map((e) => /* @__PURE__ */ c("button", {
|
|
2136
|
+
role: "tab",
|
|
2137
|
+
"aria-selected": s === e.id,
|
|
2138
|
+
className: `nd-tabs-tab ${s === e.id ? "nd-tabs-tab--active" : ""}`,
|
|
2139
|
+
onClick: () => d(e.id),
|
|
2140
|
+
children: e.label
|
|
2141
|
+
}, e.id))
|
|
2142
|
+
}), /* @__PURE__ */ c("div", {
|
|
2143
|
+
className: "nd-tabs-panel",
|
|
2144
|
+
role: "tabpanel",
|
|
2145
|
+
children: f
|
|
2146
|
+
})]
|
|
2147
|
+
});
|
|
2148
|
+
});
|
|
2149
|
+
G.displayName = "Tabs";
|
|
2150
|
+
//#endregion
|
|
2151
|
+
//#region src/components/TagsInput/TagsInput.tsx
|
|
2152
|
+
var K = e.forwardRef(({ className: e = "", label: t, tags: n, onChange: r, placeholder: i = "Add a tag...", disabled: a = !1, ...s }, u) => {
|
|
2153
|
+
let [d, f] = o([]), [p, m] = o(""), h = n !== void 0, g = h ? n : d, _ = (e) => {
|
|
2154
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
2155
|
+
e.preventDefault();
|
|
2156
|
+
let t = p.trim();
|
|
2157
|
+
if (t && !g.includes(t)) {
|
|
2158
|
+
let e = [...g, t];
|
|
2159
|
+
h || f(e), r && r(e), m("");
|
|
2160
|
+
}
|
|
2161
|
+
} else if (e.key === "Backspace" && !p && g.length > 0) {
|
|
2162
|
+
let e = g.slice(0, -1);
|
|
2163
|
+
h || f(e), r && r(e);
|
|
2164
|
+
}
|
|
2165
|
+
}, v = (e) => {
|
|
2166
|
+
let t = g.filter((t, n) => n !== e);
|
|
2167
|
+
h || f(t), r && r(t);
|
|
2168
|
+
};
|
|
2169
|
+
return /* @__PURE__ */ l("div", {
|
|
2170
|
+
className: `nd-tags-input-wrapper ${e}`,
|
|
2171
|
+
ref: u,
|
|
2172
|
+
...s,
|
|
2173
|
+
children: [t && /* @__PURE__ */ c("label", {
|
|
2174
|
+
className: "nd-input-label",
|
|
2175
|
+
children: t
|
|
2176
|
+
}), /* @__PURE__ */ l("div", {
|
|
2177
|
+
className: `nd-tags-input-container ${a ? "nd-tags-input-container--disabled" : ""}`,
|
|
2178
|
+
children: [g.map((e, t) => /* @__PURE__ */ l("span", {
|
|
2179
|
+
className: "nd-tags-input-tag",
|
|
2180
|
+
children: [e, /* @__PURE__ */ c("button", {
|
|
2181
|
+
type: "button",
|
|
2182
|
+
className: "nd-tags-input-tag-remove",
|
|
2183
|
+
onClick: () => v(t),
|
|
2184
|
+
"aria-label": `Remove ${e}`,
|
|
2185
|
+
disabled: a,
|
|
2186
|
+
children: /* @__PURE__ */ l("svg", {
|
|
2187
|
+
width: "14",
|
|
2188
|
+
height: "14",
|
|
2189
|
+
viewBox: "0 0 24 24",
|
|
2190
|
+
fill: "none",
|
|
2191
|
+
stroke: "currentColor",
|
|
2192
|
+
strokeWidth: "2",
|
|
2193
|
+
strokeLinecap: "round",
|
|
2194
|
+
strokeLinejoin: "round",
|
|
2195
|
+
children: [/* @__PURE__ */ c("line", {
|
|
2196
|
+
x1: "18",
|
|
2197
|
+
y1: "6",
|
|
2198
|
+
x2: "6",
|
|
2199
|
+
y2: "18"
|
|
2200
|
+
}), /* @__PURE__ */ c("line", {
|
|
2201
|
+
x1: "6",
|
|
2202
|
+
y1: "6",
|
|
2203
|
+
x2: "18",
|
|
2204
|
+
y2: "18"
|
|
2205
|
+
})]
|
|
2206
|
+
})
|
|
2207
|
+
})]
|
|
2208
|
+
}, t)), /* @__PURE__ */ c("input", {
|
|
2209
|
+
type: "text",
|
|
2210
|
+
className: "nd-tags-input-field",
|
|
2211
|
+
value: p,
|
|
2212
|
+
onChange: (e) => m(e.target.value),
|
|
2213
|
+
onKeyDown: _,
|
|
2214
|
+
placeholder: g.length === 0 ? i : "",
|
|
2215
|
+
disabled: a
|
|
2216
|
+
})]
|
|
2217
|
+
})]
|
|
2218
|
+
});
|
|
2219
|
+
});
|
|
2220
|
+
K.displayName = "TagsInput";
|
|
2221
|
+
//#endregion
|
|
2222
|
+
//#region src/components/Textarea/Textarea.tsx
|
|
2223
|
+
var q = e.forwardRef(({ className: e = "", label: t, error: n, ...r }, i) => {
|
|
2224
|
+
let a = ["nd-textarea-wrapper", e].filter(Boolean).join(" "), o = ["nd-textarea", n ? "nd-textarea--error" : ""].filter(Boolean).join(" ");
|
|
2225
|
+
return /* @__PURE__ */ l("div", {
|
|
2226
|
+
className: a,
|
|
2227
|
+
children: [
|
|
2228
|
+
t && /* @__PURE__ */ c("label", {
|
|
2229
|
+
className: "nd-textarea-label",
|
|
2230
|
+
children: t
|
|
2231
|
+
}),
|
|
2232
|
+
/* @__PURE__ */ c("textarea", {
|
|
2233
|
+
className: o,
|
|
2234
|
+
ref: i,
|
|
2235
|
+
...r
|
|
2236
|
+
}),
|
|
2237
|
+
n && /* @__PURE__ */ c("span", {
|
|
2238
|
+
className: "nd-textarea-error-text",
|
|
2239
|
+
children: n
|
|
2240
|
+
})
|
|
2241
|
+
]
|
|
2242
|
+
});
|
|
2243
|
+
});
|
|
2244
|
+
q.displayName = "Textarea";
|
|
2245
|
+
//#endregion
|
|
2246
|
+
//#region src/components/TimePicker/TimePicker.tsx
|
|
2247
|
+
var ye = ({ value: e = "12:00", onChange: t, is24Hour: n = !1, className: r = "" }) => {
|
|
2248
|
+
let a = (e) => {
|
|
2249
|
+
let [t, n] = e.split(":").map(Number);
|
|
2250
|
+
return {
|
|
2251
|
+
hours: isNaN(t) ? 12 : t,
|
|
2252
|
+
minutes: isNaN(n) ? 0 : n
|
|
2253
|
+
};
|
|
2254
|
+
}, s = a(e), [u, d] = o(s.hours), [f, p] = o(s.minutes), [m, h] = o(s.hours >= 12 ? "PM" : "AM");
|
|
2255
|
+
i(() => {
|
|
2256
|
+
if (e) {
|
|
2257
|
+
let t = a(e);
|
|
2258
|
+
d(t.hours), p(t.minutes), h(t.hours >= 12 ? "PM" : "AM");
|
|
2259
|
+
}
|
|
2260
|
+
}, [e]);
|
|
2261
|
+
let g = (e, r, i) => {
|
|
2262
|
+
if (!t) return;
|
|
2263
|
+
let a = e;
|
|
2264
|
+
n || (i === "PM" && e !== 12 && (a += 12), i === "AM" && e === 12 && (a = 0)), t(`${String(a).padStart(2, "0")}:${String(r).padStart(2, "0")}`);
|
|
2265
|
+
}, _ = (e) => {
|
|
2266
|
+
let t = u + e;
|
|
2267
|
+
n ? (t < 0 && (t = 23), t > 23 && (t = 0)) : (t < 1 && (t = 12), t > 12 && (t = 1)), d(t), g(t, f, m);
|
|
2268
|
+
}, v = (e) => {
|
|
2269
|
+
let t = f + e;
|
|
2270
|
+
if (t < 0) {
|
|
2271
|
+
t = 59, _(-1);
|
|
2272
|
+
return;
|
|
2273
|
+
}
|
|
2274
|
+
if (t > 59) {
|
|
2275
|
+
t = 0, _(1);
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
p(t), g(u, t, m);
|
|
2279
|
+
}, y = (e) => {
|
|
2280
|
+
h(e), g(u, f, e);
|
|
2281
|
+
}, b = n ? u : u > 12 ? u - 12 : u === 0 ? 12 : u;
|
|
2282
|
+
return /* @__PURE__ */ l("div", {
|
|
2283
|
+
className: `nd-timepicker ${r}`,
|
|
2284
|
+
children: [
|
|
2285
|
+
/* @__PURE__ */ l("div", {
|
|
2286
|
+
className: "nd-timepicker-segment",
|
|
2287
|
+
children: [
|
|
2288
|
+
/* @__PURE__ */ c("button", {
|
|
2289
|
+
className: "nd-timepicker-btn",
|
|
2290
|
+
onClick: () => _(1),
|
|
2291
|
+
"aria-label": "Increase hours",
|
|
2292
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2293
|
+
width: "12",
|
|
2294
|
+
height: "12",
|
|
2295
|
+
viewBox: "0 0 24 24",
|
|
2296
|
+
fill: "none",
|
|
2297
|
+
stroke: "currentColor",
|
|
2298
|
+
strokeWidth: "3",
|
|
2299
|
+
strokeLinecap: "round",
|
|
2300
|
+
strokeLinejoin: "round",
|
|
2301
|
+
children: /* @__PURE__ */ c("polyline", { points: "18 15 12 9 6 15" })
|
|
2302
|
+
})
|
|
2303
|
+
}),
|
|
2304
|
+
/* @__PURE__ */ c("input", {
|
|
2305
|
+
className: "nd-timepicker-input",
|
|
2306
|
+
value: String(b).padStart(2, "0"),
|
|
2307
|
+
readOnly: !0,
|
|
2308
|
+
"aria-label": "Hours"
|
|
2309
|
+
}),
|
|
2310
|
+
/* @__PURE__ */ c("button", {
|
|
2311
|
+
className: "nd-timepicker-btn",
|
|
2312
|
+
onClick: () => _(-1),
|
|
2313
|
+
"aria-label": "Decrease hours",
|
|
2314
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2315
|
+
width: "12",
|
|
2316
|
+
height: "12",
|
|
2317
|
+
viewBox: "0 0 24 24",
|
|
2318
|
+
fill: "none",
|
|
2319
|
+
stroke: "currentColor",
|
|
2320
|
+
strokeWidth: "3",
|
|
2321
|
+
strokeLinecap: "round",
|
|
2322
|
+
strokeLinejoin: "round",
|
|
2323
|
+
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
2324
|
+
})
|
|
2325
|
+
})
|
|
2326
|
+
]
|
|
2327
|
+
}),
|
|
2328
|
+
/* @__PURE__ */ c("span", {
|
|
2329
|
+
className: "nd-timepicker-separator",
|
|
2330
|
+
children: ":"
|
|
2331
|
+
}),
|
|
2332
|
+
/* @__PURE__ */ l("div", {
|
|
2333
|
+
className: "nd-timepicker-segment",
|
|
2334
|
+
children: [
|
|
2335
|
+
/* @__PURE__ */ c("button", {
|
|
2336
|
+
className: "nd-timepicker-btn",
|
|
2337
|
+
onClick: () => v(1),
|
|
2338
|
+
"aria-label": "Increase minutes",
|
|
2339
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2340
|
+
width: "12",
|
|
2341
|
+
height: "12",
|
|
2342
|
+
viewBox: "0 0 24 24",
|
|
2343
|
+
fill: "none",
|
|
2344
|
+
stroke: "currentColor",
|
|
2345
|
+
strokeWidth: "3",
|
|
2346
|
+
strokeLinecap: "round",
|
|
2347
|
+
strokeLinejoin: "round",
|
|
2348
|
+
children: /* @__PURE__ */ c("polyline", { points: "18 15 12 9 6 15" })
|
|
2349
|
+
})
|
|
2350
|
+
}),
|
|
2351
|
+
/* @__PURE__ */ c("input", {
|
|
2352
|
+
className: "nd-timepicker-input",
|
|
2353
|
+
value: String(f).padStart(2, "0"),
|
|
2354
|
+
readOnly: !0,
|
|
2355
|
+
"aria-label": "Minutes"
|
|
2356
|
+
}),
|
|
2357
|
+
/* @__PURE__ */ c("button", {
|
|
2358
|
+
className: "nd-timepicker-btn",
|
|
2359
|
+
onClick: () => v(-1),
|
|
2360
|
+
"aria-label": "Decrease minutes",
|
|
2361
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2362
|
+
width: "12",
|
|
2363
|
+
height: "12",
|
|
2364
|
+
viewBox: "0 0 24 24",
|
|
2365
|
+
fill: "none",
|
|
2366
|
+
stroke: "currentColor",
|
|
2367
|
+
strokeWidth: "3",
|
|
2368
|
+
strokeLinecap: "round",
|
|
2369
|
+
strokeLinejoin: "round",
|
|
2370
|
+
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
2371
|
+
})
|
|
2372
|
+
})
|
|
2373
|
+
]
|
|
2374
|
+
}),
|
|
2375
|
+
!n && /* @__PURE__ */ l("div", {
|
|
2376
|
+
className: "nd-timepicker-ampm",
|
|
2377
|
+
children: [/* @__PURE__ */ c("button", {
|
|
2378
|
+
className: `nd-timepicker-ampm-btn ${m === "AM" ? "nd-timepicker-ampm-btn--active" : ""}`,
|
|
2379
|
+
onClick: () => y("AM"),
|
|
2380
|
+
children: "AM"
|
|
2381
|
+
}), /* @__PURE__ */ c("button", {
|
|
2382
|
+
className: `nd-timepicker-ampm-btn ${m === "PM" ? "nd-timepicker-ampm-btn--active" : ""}`,
|
|
2383
|
+
onClick: () => y("PM"),
|
|
2384
|
+
children: "PM"
|
|
2385
|
+
})]
|
|
2386
|
+
})
|
|
2387
|
+
]
|
|
2388
|
+
});
|
|
2389
|
+
}, J = e.forwardRef(({ className: e = "", items: t, ...n }, r) => /* @__PURE__ */ c("ol", {
|
|
2390
|
+
className: `nd-timeline ${e}`,
|
|
2391
|
+
ref: r,
|
|
2392
|
+
...n,
|
|
2393
|
+
children: t.map((e, t) => /* @__PURE__ */ l("li", {
|
|
2394
|
+
className: `nd-timeline-item ${e.isActive ? "nd-timeline-item--active" : ""}`,
|
|
2395
|
+
children: [/* @__PURE__ */ c("div", {
|
|
2396
|
+
className: "nd-timeline-indicator",
|
|
2397
|
+
"aria-hidden": "true"
|
|
2398
|
+
}), /* @__PURE__ */ l("div", {
|
|
2399
|
+
className: "nd-timeline-content",
|
|
2400
|
+
children: [
|
|
2401
|
+
e.time && /* @__PURE__ */ c("time", {
|
|
2402
|
+
className: "nd-timeline-time",
|
|
2403
|
+
children: e.time
|
|
2404
|
+
}),
|
|
2405
|
+
/* @__PURE__ */ c("h4", {
|
|
2406
|
+
className: "nd-timeline-title",
|
|
2407
|
+
children: e.title
|
|
2408
|
+
}),
|
|
2409
|
+
e.description && /* @__PURE__ */ c("div", {
|
|
2410
|
+
className: "nd-timeline-description",
|
|
2411
|
+
children: e.description
|
|
2412
|
+
})
|
|
2413
|
+
]
|
|
2414
|
+
})]
|
|
2415
|
+
}, t))
|
|
2416
|
+
}));
|
|
2417
|
+
J.displayName = "Timeline";
|
|
2418
|
+
//#endregion
|
|
2419
|
+
//#region src/components/Toast/Toast.tsx
|
|
2420
|
+
var Y = e.forwardRef(({ className: e = "", title: t, description: n, variant: r = "default", onClose: i, ...a }, o) => /* @__PURE__ */ l("div", {
|
|
2421
|
+
ref: o,
|
|
2422
|
+
className: [
|
|
2423
|
+
"nd-toast",
|
|
2424
|
+
`nd-toast--${r}`,
|
|
2425
|
+
e
|
|
2426
|
+
].filter(Boolean).join(" "),
|
|
2427
|
+
role: "alert",
|
|
2428
|
+
...a,
|
|
2429
|
+
children: [/* @__PURE__ */ l("div", {
|
|
2430
|
+
className: "nd-toast-content",
|
|
2431
|
+
children: [/* @__PURE__ */ c("span", {
|
|
2432
|
+
className: "nd-toast-title",
|
|
2433
|
+
children: t
|
|
2434
|
+
}), n && /* @__PURE__ */ c("span", {
|
|
2435
|
+
className: "nd-toast-description",
|
|
2436
|
+
children: n
|
|
2437
|
+
})]
|
|
2438
|
+
}), i && /* @__PURE__ */ c("button", {
|
|
2439
|
+
className: "nd-toast-close",
|
|
2440
|
+
onClick: i,
|
|
2441
|
+
"aria-label": "Close",
|
|
2442
|
+
children: /* @__PURE__ */ l("svg", {
|
|
2443
|
+
width: "16",
|
|
2444
|
+
height: "16",
|
|
2445
|
+
viewBox: "0 0 24 24",
|
|
2446
|
+
fill: "none",
|
|
2447
|
+
stroke: "currentColor",
|
|
2448
|
+
strokeWidth: "2",
|
|
2449
|
+
strokeLinecap: "round",
|
|
2450
|
+
strokeLinejoin: "round",
|
|
2451
|
+
children: [/* @__PURE__ */ c("line", {
|
|
2452
|
+
x1: "18",
|
|
2453
|
+
y1: "6",
|
|
2454
|
+
x2: "6",
|
|
2455
|
+
y2: "18"
|
|
2456
|
+
}), /* @__PURE__ */ c("line", {
|
|
2457
|
+
x1: "6",
|
|
2458
|
+
y1: "6",
|
|
2459
|
+
x2: "18",
|
|
2460
|
+
y2: "18"
|
|
2461
|
+
})]
|
|
2462
|
+
})
|
|
2463
|
+
})]
|
|
2464
|
+
}));
|
|
2465
|
+
Y.displayName = "Toast";
|
|
2466
|
+
//#endregion
|
|
2467
|
+
//#region src/components/ToggleGroup/ToggleGroup.tsx
|
|
2468
|
+
var X = e.forwardRef(({ className: e = "", items: t, type: n = "single", defaultValue: r, onChange: i, ...a }, s) => {
|
|
2469
|
+
let [u, d] = o(() => r ? Array.isArray(r) ? r : [r] : []), f = (e) => {
|
|
2470
|
+
let t;
|
|
2471
|
+
t = n === "single" ? u.includes(e) ? [] : [e] : u.includes(e) ? u.filter((t) => t !== e) : [...u, e], d(t), i && i(n === "single" ? t[0] || "" : t);
|
|
2472
|
+
};
|
|
2473
|
+
return /* @__PURE__ */ c("div", {
|
|
2474
|
+
className: `nd-togglegroup ${e}`,
|
|
2475
|
+
ref: s,
|
|
2476
|
+
...a,
|
|
2477
|
+
children: t.map((e) => {
|
|
2478
|
+
let t = u.includes(e.value);
|
|
2479
|
+
return /* @__PURE__ */ l("button", {
|
|
2480
|
+
className: `nd-togglegroup-item ${t ? "nd-togglegroup-item--active" : ""}`,
|
|
2481
|
+
onClick: () => f(e.value),
|
|
2482
|
+
"aria-pressed": t,
|
|
2483
|
+
children: [e.icon && /* @__PURE__ */ c("span", {
|
|
2484
|
+
style: { marginRight: e.label ? "0.5rem" : "0" },
|
|
2485
|
+
children: e.icon
|
|
2486
|
+
}), e.label && /* @__PURE__ */ c("span", { children: e.label })]
|
|
2487
|
+
}, e.value);
|
|
2488
|
+
})
|
|
2489
|
+
});
|
|
2490
|
+
});
|
|
2491
|
+
X.displayName = "ToggleGroup";
|
|
2492
|
+
//#endregion
|
|
2493
|
+
//#region src/components/Tooltip/Tooltip.tsx
|
|
2494
|
+
var Z = e.forwardRef(({ className: e = "", content: t, placement: n = "top", children: r, ...i }, a) => /* @__PURE__ */ l("div", {
|
|
2495
|
+
className: `nd-tooltip-wrapper ${e}`,
|
|
2496
|
+
ref: a,
|
|
2497
|
+
...i,
|
|
2498
|
+
children: [r, /* @__PURE__ */ c("div", {
|
|
2499
|
+
className: `nd-tooltip nd-tooltip--${n}`,
|
|
2500
|
+
role: "tooltip",
|
|
2501
|
+
children: t
|
|
2502
|
+
})]
|
|
2503
|
+
}));
|
|
2504
|
+
Z.displayName = "Tooltip";
|
|
2505
|
+
//#endregion
|
|
2506
|
+
//#region src/components/TransferList/TransferList.tsx
|
|
2507
|
+
var be = ({ availableItems: e, selectedItems: t, onChange: n, availableTitle: r = "Available", selectedTitle: i = "Selected", className: a = "" }) => {
|
|
2508
|
+
let [s, u] = o(/* @__PURE__ */ new Set()), [d, f] = o(/* @__PURE__ */ new Set()), p = (e, t) => {
|
|
2509
|
+
if (t === "available") {
|
|
2510
|
+
let t = new Set(s);
|
|
2511
|
+
t.has(e) ? t.delete(e) : t.add(e), u(t);
|
|
2512
|
+
} else {
|
|
2513
|
+
let t = new Set(d);
|
|
2514
|
+
t.has(e) ? t.delete(e) : t.add(e), f(t);
|
|
2515
|
+
}
|
|
2516
|
+
};
|
|
2517
|
+
return /* @__PURE__ */ l("div", {
|
|
2518
|
+
className: `nd-transfer-list ${a}`,
|
|
2519
|
+
children: [
|
|
2520
|
+
/* @__PURE__ */ l("div", {
|
|
2521
|
+
className: "nd-transfer-list-box",
|
|
2522
|
+
children: [/* @__PURE__ */ c("h4", {
|
|
2523
|
+
className: "nd-transfer-list-title",
|
|
2524
|
+
children: r
|
|
2525
|
+
}), /* @__PURE__ */ c("ul", {
|
|
2526
|
+
className: "nd-transfer-list-items",
|
|
2527
|
+
children: e.map((e) => /* @__PURE__ */ l("li", {
|
|
2528
|
+
className: `nd-transfer-list-item ${s.has(e.id) ? "nd-transfer-list-item--selected" : ""}`,
|
|
2529
|
+
onClick: () => p(e.id, "available"),
|
|
2530
|
+
children: [/* @__PURE__ */ c("input", {
|
|
2531
|
+
type: "checkbox",
|
|
2532
|
+
checked: s.has(e.id),
|
|
2533
|
+
readOnly: !0,
|
|
2534
|
+
style: {
|
|
2535
|
+
appearance: "none",
|
|
2536
|
+
width: "1rem",
|
|
2537
|
+
height: "1rem",
|
|
2538
|
+
borderRadius: "4px",
|
|
2539
|
+
boxShadow: s.has(e.id) ? "var(--nd-shadow-inset), var(--nd-glow-accent)" : "var(--nd-shadow-inset)",
|
|
2540
|
+
backgroundColor: "var(--nd-color-bg)"
|
|
2541
|
+
}
|
|
2542
|
+
}), e.label]
|
|
2543
|
+
}, e.id))
|
|
2544
|
+
})]
|
|
2545
|
+
}),
|
|
2546
|
+
/* @__PURE__ */ l("div", {
|
|
2547
|
+
className: "nd-transfer-list-controls",
|
|
2548
|
+
children: [
|
|
2549
|
+
/* @__PURE__ */ c("button", {
|
|
2550
|
+
className: "nd-transfer-list-btn",
|
|
2551
|
+
onClick: () => {
|
|
2552
|
+
n([], [...t, ...e]), u(/* @__PURE__ */ new Set());
|
|
2553
|
+
},
|
|
2554
|
+
disabled: e.length === 0,
|
|
2555
|
+
"aria-label": "Move all right",
|
|
2556
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2557
|
+
width: "16",
|
|
2558
|
+
height: "16",
|
|
2559
|
+
viewBox: "0 0 24 24",
|
|
2560
|
+
fill: "none",
|
|
2561
|
+
stroke: "currentColor",
|
|
2562
|
+
strokeWidth: "2",
|
|
2563
|
+
strokeLinecap: "round",
|
|
2564
|
+
strokeLinejoin: "round",
|
|
2565
|
+
children: /* @__PURE__ */ c("path", { d: "M13 17l5-5-5-5M6 17l5-5-5-5" })
|
|
2566
|
+
})
|
|
2567
|
+
}),
|
|
2568
|
+
/* @__PURE__ */ c("button", {
|
|
2569
|
+
className: "nd-transfer-list-btn",
|
|
2570
|
+
onClick: () => {
|
|
2571
|
+
let r = e.filter((e) => s.has(e.id));
|
|
2572
|
+
n(e.filter((e) => !s.has(e.id)), [...t, ...r]), u(/* @__PURE__ */ new Set());
|
|
2573
|
+
},
|
|
2574
|
+
disabled: s.size === 0,
|
|
2575
|
+
"aria-label": "Move selected right",
|
|
2576
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2577
|
+
width: "16",
|
|
2578
|
+
height: "16",
|
|
2579
|
+
viewBox: "0 0 24 24",
|
|
2580
|
+
fill: "none",
|
|
2581
|
+
stroke: "currentColor",
|
|
2582
|
+
strokeWidth: "2",
|
|
2583
|
+
strokeLinecap: "round",
|
|
2584
|
+
strokeLinejoin: "round",
|
|
2585
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
2586
|
+
})
|
|
2587
|
+
}),
|
|
2588
|
+
/* @__PURE__ */ c("button", {
|
|
2589
|
+
className: "nd-transfer-list-btn",
|
|
2590
|
+
onClick: () => {
|
|
2591
|
+
let r = t.filter((e) => d.has(e.id)), i = t.filter((e) => !d.has(e.id));
|
|
2592
|
+
n([...e, ...r], i), f(/* @__PURE__ */ new Set());
|
|
2593
|
+
},
|
|
2594
|
+
disabled: d.size === 0,
|
|
2595
|
+
"aria-label": "Move selected left",
|
|
2596
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2597
|
+
width: "16",
|
|
2598
|
+
height: "16",
|
|
2599
|
+
viewBox: "0 0 24 24",
|
|
2600
|
+
fill: "none",
|
|
2601
|
+
stroke: "currentColor",
|
|
2602
|
+
strokeWidth: "2",
|
|
2603
|
+
strokeLinecap: "round",
|
|
2604
|
+
strokeLinejoin: "round",
|
|
2605
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
2606
|
+
})
|
|
2607
|
+
}),
|
|
2608
|
+
/* @__PURE__ */ c("button", {
|
|
2609
|
+
className: "nd-transfer-list-btn",
|
|
2610
|
+
onClick: () => {
|
|
2611
|
+
n([...e, ...t], []), f(/* @__PURE__ */ new Set());
|
|
2612
|
+
},
|
|
2613
|
+
disabled: t.length === 0,
|
|
2614
|
+
"aria-label": "Move all left",
|
|
2615
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2616
|
+
width: "16",
|
|
2617
|
+
height: "16",
|
|
2618
|
+
viewBox: "0 0 24 24",
|
|
2619
|
+
fill: "none",
|
|
2620
|
+
stroke: "currentColor",
|
|
2621
|
+
strokeWidth: "2",
|
|
2622
|
+
strokeLinecap: "round",
|
|
2623
|
+
strokeLinejoin: "round",
|
|
2624
|
+
children: /* @__PURE__ */ c("path", { d: "M11 17l-5-5 5-5M18 17l-5-5 5-5" })
|
|
2625
|
+
})
|
|
2626
|
+
})
|
|
2627
|
+
]
|
|
2628
|
+
}),
|
|
2629
|
+
/* @__PURE__ */ l("div", {
|
|
2630
|
+
className: "nd-transfer-list-box",
|
|
2631
|
+
children: [/* @__PURE__ */ c("h4", {
|
|
2632
|
+
className: "nd-transfer-list-title",
|
|
2633
|
+
children: i
|
|
2634
|
+
}), /* @__PURE__ */ c("ul", {
|
|
2635
|
+
className: "nd-transfer-list-items",
|
|
2636
|
+
children: t.map((e) => /* @__PURE__ */ l("li", {
|
|
2637
|
+
className: `nd-transfer-list-item ${d.has(e.id) ? "nd-transfer-list-item--selected" : ""}`,
|
|
2638
|
+
onClick: () => p(e.id, "selected"),
|
|
2639
|
+
children: [/* @__PURE__ */ c("input", {
|
|
2640
|
+
type: "checkbox",
|
|
2641
|
+
checked: d.has(e.id),
|
|
2642
|
+
readOnly: !0,
|
|
2643
|
+
style: {
|
|
2644
|
+
appearance: "none",
|
|
2645
|
+
width: "1rem",
|
|
2646
|
+
height: "1rem",
|
|
2647
|
+
borderRadius: "4px",
|
|
2648
|
+
boxShadow: d.has(e.id) ? "var(--nd-shadow-inset), var(--nd-glow-accent)" : "var(--nd-shadow-inset)",
|
|
2649
|
+
backgroundColor: "var(--nd-color-bg)"
|
|
2650
|
+
}
|
|
2651
|
+
}), e.label]
|
|
2652
|
+
}, e.id))
|
|
2653
|
+
})]
|
|
2654
|
+
})
|
|
2655
|
+
]
|
|
2656
|
+
});
|
|
2657
|
+
}, Q = ({ node: e, onSelect: t, selectedId: n, defaultExpandedIds: r = [] }) => {
|
|
2658
|
+
let [i, a] = o(r.includes(e.id)), s = e.children && e.children.length > 0;
|
|
2659
|
+
return /* @__PURE__ */ l("li", {
|
|
2660
|
+
className: "nd-tree-node",
|
|
2661
|
+
children: [/* @__PURE__ */ l("div", {
|
|
2662
|
+
className: `nd-tree-node-content ${n === e.id ? "nd-tree-node-content--selected" : ""}`,
|
|
2663
|
+
onClick: () => {
|
|
2664
|
+
t && t(e);
|
|
2665
|
+
},
|
|
2666
|
+
children: [
|
|
2667
|
+
/* @__PURE__ */ c("div", {
|
|
2668
|
+
style: {
|
|
2669
|
+
width: "1.5rem",
|
|
2670
|
+
display: "flex",
|
|
2671
|
+
alignItems: "center",
|
|
2672
|
+
justifyContent: "center"
|
|
2673
|
+
},
|
|
2674
|
+
children: s && /* @__PURE__ */ c("button", {
|
|
2675
|
+
className: "nd-tree-toggle",
|
|
2676
|
+
onClick: (e) => {
|
|
2677
|
+
e.stopPropagation(), a(!i);
|
|
2678
|
+
},
|
|
2679
|
+
"aria-label": i ? "Collapse" : "Expand",
|
|
2680
|
+
children: /* @__PURE__ */ c("svg", {
|
|
2681
|
+
width: "14",
|
|
2682
|
+
height: "14",
|
|
2683
|
+
viewBox: "0 0 24 24",
|
|
2684
|
+
fill: "none",
|
|
2685
|
+
stroke: "currentColor",
|
|
2686
|
+
strokeWidth: "2",
|
|
2687
|
+
strokeLinecap: "round",
|
|
2688
|
+
strokeLinejoin: "round",
|
|
2689
|
+
style: {
|
|
2690
|
+
transform: i ? "rotate(90deg)" : "rotate(0deg)",
|
|
2691
|
+
transition: "transform 0.2s"
|
|
2692
|
+
},
|
|
2693
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
2694
|
+
})
|
|
2695
|
+
})
|
|
2696
|
+
}),
|
|
2697
|
+
e.icon && /* @__PURE__ */ c("span", {
|
|
2698
|
+
className: "nd-tree-icon",
|
|
2699
|
+
children: e.icon
|
|
2700
|
+
}),
|
|
2701
|
+
/* @__PURE__ */ c("span", {
|
|
2702
|
+
className: "nd-tree-label",
|
|
2703
|
+
children: e.label
|
|
2704
|
+
})
|
|
2705
|
+
]
|
|
2706
|
+
}), s && i && /* @__PURE__ */ c("ul", {
|
|
2707
|
+
className: "nd-tree-children",
|
|
2708
|
+
children: e.children.map((e) => /* @__PURE__ */ c(Q, {
|
|
2709
|
+
node: e,
|
|
2710
|
+
onSelect: t,
|
|
2711
|
+
selectedId: n,
|
|
2712
|
+
defaultExpandedIds: r
|
|
2713
|
+
}, e.id))
|
|
2714
|
+
})]
|
|
2715
|
+
});
|
|
2716
|
+
}, $ = e.forwardRef(({ className: e = "", data: t, onSelect: n, selectedId: r, defaultExpandedIds: i, ...a }, o) => /* @__PURE__ */ c("ul", {
|
|
2717
|
+
className: `nd-tree ${e}`,
|
|
2718
|
+
ref: o,
|
|
2719
|
+
...a,
|
|
2720
|
+
children: t.map((e) => /* @__PURE__ */ c(Q, {
|
|
2721
|
+
node: e,
|
|
2722
|
+
onSelect: n,
|
|
2723
|
+
selectedId: r,
|
|
2724
|
+
defaultExpandedIds: i
|
|
2725
|
+
}, e.id))
|
|
2726
|
+
}));
|
|
2727
|
+
$.displayName = "Tree";
|
|
2728
|
+
//#endregion
|
|
2729
|
+
export { d as Accordion, p as Alert, m as Avatar, h as Badge, g as Breadcrumbs, _ as Button, v as Calendar, y as Card, b as Carousel, x as Checkbox, C as ColorPicker, w as CommandMenu, T as ContextMenu, te as DatePicker, D as Divider, ne as Drawer, ie as DropdownMenu, re as DropdownMenuDivider, O as DropdownMenuItem, k as Dropzone, ae as HoverCard, A as IconButton, j as Input, oe as Knob, M as Listbox, se as Menubar, le as MenubarItem, ce as MenubarMenu, ue as MenubarSeparator, de as Modal, F as Pagination, fe as Popover, pe as ProgressBar, I as Radio, me as RangeSlider, L as Rating, he as Resizable, R as ScrollArea, z as Select, B as Skeleton, V as Slider, ge as SpeedDial, H as Spinner, _e as SplitButton, U as Stepper, W as Switch, ve as Table, G as Tabs, K as TagsInput, q as Textarea, ye as TimePicker, J as Timeline, Y as Toast, X as ToggleGroup, Z as Tooltip, be as TransferList, $ as Tree };
|