@f0rbit/ui 0.1.2
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 +149 -0
- package/dist/components.css +1054 -0
- package/dist/index.d.ts +217 -0
- package/dist/index.js +1137 -0
- package/dist/index.jsx +752 -0
- package/dist/reset.css +93 -0
- package/dist/server.js +794 -0
- package/dist/server.jsx +752 -0
- package/dist/styles.css +1582 -0
- package/dist/tokens.css +121 -0
- package/dist/utilities.css +298 -0
- package/package.json +84 -0
- package/src/components/Badge.tsx +38 -0
- package/src/components/Button.tsx +55 -0
- package/src/components/Card.tsx +82 -0
- package/src/components/Checkbox.tsx +50 -0
- package/src/components/Chevron.tsx +36 -0
- package/src/components/Clamp.tsx +51 -0
- package/src/components/Collapsible.tsx +39 -0
- package/src/components/Dropdown.tsx +114 -0
- package/src/components/Empty.tsx +22 -0
- package/src/components/FormField.tsx +33 -0
- package/src/components/Input.tsx +35 -0
- package/src/components/Modal.tsx +106 -0
- package/src/components/Spinner.tsx +31 -0
- package/src/components/Stat.tsx +18 -0
- package/src/components/Status.tsx +43 -0
- package/src/components/Stepper.tsx +139 -0
- package/src/components/Tabs.tsx +120 -0
- package/src/components/Timeline.tsx +66 -0
- package/src/components/Toggle.tsx +29 -0
- package/src/index.tsx +65 -0
- package/src/styles/components.css +1054 -0
- package/src/styles/reset.css +93 -0
- package/src/styles/tokens.css +121 -0
- package/src/styles/utilities.css +298 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1137 @@
|
|
|
1
|
+
import { delegateEvents, template, spread, mergeProps, memo, insert, isServer, createComponent, Portal, addEventListener, use, effect, className, style, setAttribute } from 'solid-js/web';
|
|
2
|
+
import { createContext, splitProps, onMount, onCleanup, Show, useContext, createSignal, createEffect, For } from 'solid-js';
|
|
3
|
+
|
|
4
|
+
// src/components/Button.tsx
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<button>`);
|
|
6
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span class="spinner spinner-sm">`);
|
|
7
|
+
var variantClasses = {
|
|
8
|
+
primary: "",
|
|
9
|
+
secondary: "btn-secondary",
|
|
10
|
+
ghost: "btn-ghost",
|
|
11
|
+
danger: "btn-danger"
|
|
12
|
+
};
|
|
13
|
+
var sizeClasses = {
|
|
14
|
+
sm: "btn-sm",
|
|
15
|
+
md: "",
|
|
16
|
+
lg: "btn-lg"
|
|
17
|
+
};
|
|
18
|
+
function Button(props) {
|
|
19
|
+
const [local, rest] = splitProps(props, ["variant", "size", "icon", "label", "loading", "class", "disabled", "children"]);
|
|
20
|
+
const classes = () => {
|
|
21
|
+
const parts = ["btn"];
|
|
22
|
+
parts.push(variantClasses[local.variant ?? "primary"]);
|
|
23
|
+
if (local.size && local.size !== "md") {
|
|
24
|
+
parts.push(sizeClasses[local.size]);
|
|
25
|
+
}
|
|
26
|
+
if (local.icon) {
|
|
27
|
+
parts.push("btn-icon");
|
|
28
|
+
}
|
|
29
|
+
if (local.class) {
|
|
30
|
+
parts.push(local.class);
|
|
31
|
+
}
|
|
32
|
+
return parts.join(" ");
|
|
33
|
+
};
|
|
34
|
+
return (() => {
|
|
35
|
+
var _el$ = _tmpl$();
|
|
36
|
+
spread(_el$, mergeProps({
|
|
37
|
+
get ["class"]() {
|
|
38
|
+
return classes();
|
|
39
|
+
},
|
|
40
|
+
get ["aria-label"]() {
|
|
41
|
+
return memo(() => !!local.icon)() ? local.label : void 0;
|
|
42
|
+
},
|
|
43
|
+
get disabled() {
|
|
44
|
+
return local.disabled || local.loading;
|
|
45
|
+
}
|
|
46
|
+
}, rest), false, true);
|
|
47
|
+
insert(_el$, (() => {
|
|
48
|
+
var _c$ = memo(() => !!local.loading);
|
|
49
|
+
return () => _c$() ? _tmpl$2() : local.children;
|
|
50
|
+
})());
|
|
51
|
+
return _el$;
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
54
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
55
|
+
var variantClasses2 = {
|
|
56
|
+
default: "",
|
|
57
|
+
success: "badge-success",
|
|
58
|
+
error: "badge-error",
|
|
59
|
+
warning: "badge-warning",
|
|
60
|
+
info: "badge-info",
|
|
61
|
+
accent: "badge-accent"
|
|
62
|
+
};
|
|
63
|
+
function Badge(props) {
|
|
64
|
+
const [local, rest] = splitProps(props, ["variant", "class", "children"]);
|
|
65
|
+
const classes = () => {
|
|
66
|
+
const parts = ["badge"];
|
|
67
|
+
const variant = local.variant ?? "default";
|
|
68
|
+
if (variant !== "default") {
|
|
69
|
+
parts.push(variantClasses2[variant]);
|
|
70
|
+
}
|
|
71
|
+
if (local.class) {
|
|
72
|
+
parts.push(local.class);
|
|
73
|
+
}
|
|
74
|
+
return parts.join(" ");
|
|
75
|
+
};
|
|
76
|
+
return (() => {
|
|
77
|
+
var _el$ = _tmpl$3();
|
|
78
|
+
spread(_el$, mergeProps({
|
|
79
|
+
get ["class"]() {
|
|
80
|
+
return classes();
|
|
81
|
+
}
|
|
82
|
+
}, rest), false, true);
|
|
83
|
+
insert(_el$, () => local.children);
|
|
84
|
+
return _el$;
|
|
85
|
+
})();
|
|
86
|
+
}
|
|
87
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div>`);
|
|
88
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<h3>`);
|
|
89
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<p>`);
|
|
90
|
+
function Card(props) {
|
|
91
|
+
const [local, rest] = splitProps(props, ["interactive", "class", "children"]);
|
|
92
|
+
const classes = () => {
|
|
93
|
+
const parts = ["card"];
|
|
94
|
+
if (local.interactive) {
|
|
95
|
+
parts.push("card-interactive");
|
|
96
|
+
}
|
|
97
|
+
if (local.class) {
|
|
98
|
+
parts.push(local.class);
|
|
99
|
+
}
|
|
100
|
+
return parts.join(" ");
|
|
101
|
+
};
|
|
102
|
+
return (() => {
|
|
103
|
+
var _el$ = _tmpl$4();
|
|
104
|
+
spread(_el$, mergeProps({
|
|
105
|
+
get ["class"]() {
|
|
106
|
+
return classes();
|
|
107
|
+
}
|
|
108
|
+
}, rest), false, true);
|
|
109
|
+
insert(_el$, () => local.children);
|
|
110
|
+
return _el$;
|
|
111
|
+
})();
|
|
112
|
+
}
|
|
113
|
+
function CardHeader(props) {
|
|
114
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
115
|
+
return (() => {
|
|
116
|
+
var _el$2 = _tmpl$4();
|
|
117
|
+
spread(_el$2, mergeProps({
|
|
118
|
+
get ["class"]() {
|
|
119
|
+
return `card-header ${local.class ?? ""}`.trim();
|
|
120
|
+
}
|
|
121
|
+
}, rest), false, true);
|
|
122
|
+
insert(_el$2, () => local.children);
|
|
123
|
+
return _el$2;
|
|
124
|
+
})();
|
|
125
|
+
}
|
|
126
|
+
function CardTitle(props) {
|
|
127
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
128
|
+
return (() => {
|
|
129
|
+
var _el$3 = _tmpl$22();
|
|
130
|
+
spread(_el$3, mergeProps({
|
|
131
|
+
get ["class"]() {
|
|
132
|
+
return `card-title ${local.class ?? ""}`.trim();
|
|
133
|
+
}
|
|
134
|
+
}, rest), false, true);
|
|
135
|
+
insert(_el$3, () => local.children);
|
|
136
|
+
return _el$3;
|
|
137
|
+
})();
|
|
138
|
+
}
|
|
139
|
+
function CardDescription(props) {
|
|
140
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
141
|
+
return (() => {
|
|
142
|
+
var _el$4 = _tmpl$32();
|
|
143
|
+
spread(_el$4, mergeProps({
|
|
144
|
+
get ["class"]() {
|
|
145
|
+
return `card-description ${local.class ?? ""}`.trim();
|
|
146
|
+
}
|
|
147
|
+
}, rest), false, true);
|
|
148
|
+
insert(_el$4, () => local.children);
|
|
149
|
+
return _el$4;
|
|
150
|
+
})();
|
|
151
|
+
}
|
|
152
|
+
function CardContent(props) {
|
|
153
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
154
|
+
return (() => {
|
|
155
|
+
var _el$5 = _tmpl$4();
|
|
156
|
+
spread(_el$5, mergeProps({
|
|
157
|
+
get ["class"]() {
|
|
158
|
+
return `card-content ${local.class ?? ""}`.trim();
|
|
159
|
+
}
|
|
160
|
+
}, rest), false, true);
|
|
161
|
+
insert(_el$5, () => local.children);
|
|
162
|
+
return _el$5;
|
|
163
|
+
})();
|
|
164
|
+
}
|
|
165
|
+
function CardFooter(props) {
|
|
166
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
167
|
+
return (() => {
|
|
168
|
+
var _el$6 = _tmpl$4();
|
|
169
|
+
spread(_el$6, mergeProps({
|
|
170
|
+
get ["class"]() {
|
|
171
|
+
return `card-footer ${local.class ?? ""}`.trim();
|
|
172
|
+
}
|
|
173
|
+
}, rest), false, true);
|
|
174
|
+
insert(_el$6, () => local.children);
|
|
175
|
+
return _el$6;
|
|
176
|
+
})();
|
|
177
|
+
}
|
|
178
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<input>`);
|
|
179
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<textarea>`);
|
|
180
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<select>`);
|
|
181
|
+
function Input(props) {
|
|
182
|
+
const [local, rest] = splitProps(props, ["error", "class", "disabled"]);
|
|
183
|
+
const classes = () => `input ${local.error ? "input-error" : ""} ${local.class ?? ""}`.trim();
|
|
184
|
+
return (() => {
|
|
185
|
+
var _el$ = _tmpl$5();
|
|
186
|
+
spread(_el$, mergeProps({
|
|
187
|
+
get ["class"]() {
|
|
188
|
+
return classes();
|
|
189
|
+
},
|
|
190
|
+
get disabled() {
|
|
191
|
+
return local.disabled;
|
|
192
|
+
}
|
|
193
|
+
}, rest), false, false);
|
|
194
|
+
return _el$;
|
|
195
|
+
})();
|
|
196
|
+
}
|
|
197
|
+
function Textarea(props) {
|
|
198
|
+
const [local, rest] = splitProps(props, ["error", "class", "disabled"]);
|
|
199
|
+
const classes = () => `textarea ${local.error ? "input-error" : ""} ${local.class ?? ""}`.trim();
|
|
200
|
+
return (() => {
|
|
201
|
+
var _el$2 = _tmpl$23();
|
|
202
|
+
spread(_el$2, mergeProps({
|
|
203
|
+
get ["class"]() {
|
|
204
|
+
return classes();
|
|
205
|
+
},
|
|
206
|
+
get disabled() {
|
|
207
|
+
return local.disabled;
|
|
208
|
+
}
|
|
209
|
+
}, rest), false, false);
|
|
210
|
+
return _el$2;
|
|
211
|
+
})();
|
|
212
|
+
}
|
|
213
|
+
function Select(props) {
|
|
214
|
+
const [local, rest] = splitProps(props, ["error", "class", "disabled", "children"]);
|
|
215
|
+
const classes = () => `select ${local.error ? "input-error" : ""} ${local.class ?? ""}`.trim();
|
|
216
|
+
return (() => {
|
|
217
|
+
var _el$3 = _tmpl$33();
|
|
218
|
+
spread(_el$3, mergeProps({
|
|
219
|
+
get ["class"]() {
|
|
220
|
+
return classes();
|
|
221
|
+
},
|
|
222
|
+
get disabled() {
|
|
223
|
+
return local.disabled;
|
|
224
|
+
}
|
|
225
|
+
}, rest), false, true);
|
|
226
|
+
insert(_el$3, () => local.children);
|
|
227
|
+
return _el$3;
|
|
228
|
+
})();
|
|
229
|
+
}
|
|
230
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<span><span class=status-dot></span><span>`);
|
|
231
|
+
var stateClasses = {
|
|
232
|
+
active: "status-active",
|
|
233
|
+
inactive: "status-inactive",
|
|
234
|
+
error: "status-error",
|
|
235
|
+
pending: "status-pending"
|
|
236
|
+
};
|
|
237
|
+
var defaultLabels = {
|
|
238
|
+
active: "Active",
|
|
239
|
+
inactive: "Inactive",
|
|
240
|
+
error: "Error",
|
|
241
|
+
pending: "Pending"
|
|
242
|
+
};
|
|
243
|
+
function Status(props) {
|
|
244
|
+
const [local, rest] = splitProps(props, ["state", "label", "class"]);
|
|
245
|
+
const classes = () => {
|
|
246
|
+
const parts = ["status", stateClasses[local.state]];
|
|
247
|
+
if (local.class) {
|
|
248
|
+
parts.push(local.class);
|
|
249
|
+
}
|
|
250
|
+
return parts.join(" ");
|
|
251
|
+
};
|
|
252
|
+
const displayLabel = () => local.label ?? defaultLabels[local.state];
|
|
253
|
+
return (() => {
|
|
254
|
+
var _el$ = _tmpl$6(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
255
|
+
spread(_el$, mergeProps({
|
|
256
|
+
get ["class"]() {
|
|
257
|
+
return classes();
|
|
258
|
+
}
|
|
259
|
+
}, rest), false, true);
|
|
260
|
+
insert(_el$3, displayLabel);
|
|
261
|
+
return _el$;
|
|
262
|
+
})();
|
|
263
|
+
}
|
|
264
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div><span class=stat-value></span><span class=stat-label>`);
|
|
265
|
+
function Stat(props) {
|
|
266
|
+
const [local, rest] = splitProps(props, ["value", "label", "class"]);
|
|
267
|
+
return (() => {
|
|
268
|
+
var _el$ = _tmpl$7(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
269
|
+
spread(_el$, mergeProps({
|
|
270
|
+
get ["class"]() {
|
|
271
|
+
return memo(() => !!local.class)() ? `stat ${local.class}` : "stat";
|
|
272
|
+
}
|
|
273
|
+
}, rest), false, true);
|
|
274
|
+
insert(_el$2, () => local.value);
|
|
275
|
+
insert(_el$3, () => local.label);
|
|
276
|
+
return _el$;
|
|
277
|
+
})();
|
|
278
|
+
}
|
|
279
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<span>`);
|
|
280
|
+
var sizeClasses2 = {
|
|
281
|
+
sm: "spinner-sm",
|
|
282
|
+
md: "",
|
|
283
|
+
lg: "spinner-lg"
|
|
284
|
+
};
|
|
285
|
+
function Spinner(props) {
|
|
286
|
+
const [local, rest] = splitProps(props, ["size", "class"]);
|
|
287
|
+
const classes = () => {
|
|
288
|
+
const parts = ["spinner"];
|
|
289
|
+
const size = local.size ?? "md";
|
|
290
|
+
if (size !== "md") {
|
|
291
|
+
parts.push(sizeClasses2[size]);
|
|
292
|
+
}
|
|
293
|
+
if (local.class) {
|
|
294
|
+
parts.push(local.class);
|
|
295
|
+
}
|
|
296
|
+
return parts.join(" ");
|
|
297
|
+
};
|
|
298
|
+
return (() => {
|
|
299
|
+
var _el$ = _tmpl$8();
|
|
300
|
+
spread(_el$, mergeProps({
|
|
301
|
+
get ["class"]() {
|
|
302
|
+
return classes();
|
|
303
|
+
}
|
|
304
|
+
}, rest), false, false);
|
|
305
|
+
return _el$;
|
|
306
|
+
})();
|
|
307
|
+
}
|
|
308
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m9 18 6-6-6-6">`);
|
|
309
|
+
function Chevron(props) {
|
|
310
|
+
const [local, rest] = splitProps(props, ["expanded", "facing", "size", "class"]);
|
|
311
|
+
const classes = () => {
|
|
312
|
+
const parts = ["chevron"];
|
|
313
|
+
if (local.facing === "down") {
|
|
314
|
+
parts.push("chevron-down");
|
|
315
|
+
}
|
|
316
|
+
if (local.expanded) {
|
|
317
|
+
parts.push("active");
|
|
318
|
+
}
|
|
319
|
+
if (local.class) {
|
|
320
|
+
parts.push(local.class);
|
|
321
|
+
}
|
|
322
|
+
return parts.join(" ");
|
|
323
|
+
};
|
|
324
|
+
const size = () => local.size ?? "1em";
|
|
325
|
+
return (() => {
|
|
326
|
+
var _el$ = _tmpl$9();
|
|
327
|
+
spread(_el$, mergeProps({
|
|
328
|
+
get ["class"]() {
|
|
329
|
+
return classes();
|
|
330
|
+
},
|
|
331
|
+
get width() {
|
|
332
|
+
return size();
|
|
333
|
+
},
|
|
334
|
+
get height() {
|
|
335
|
+
return size();
|
|
336
|
+
}
|
|
337
|
+
}, rest), true, true);
|
|
338
|
+
return _el$;
|
|
339
|
+
})();
|
|
340
|
+
}
|
|
341
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=empty>`);
|
|
342
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<div class=empty-icon>`);
|
|
343
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<h3 class=empty-title>`);
|
|
344
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<p class=empty-description>`);
|
|
345
|
+
function Empty(props) {
|
|
346
|
+
const [local] = splitProps(props, ["icon", "title", "description", "children"]);
|
|
347
|
+
return (() => {
|
|
348
|
+
var _el$ = _tmpl$10();
|
|
349
|
+
insert(_el$, (() => {
|
|
350
|
+
var _c$ = memo(() => !!local.icon);
|
|
351
|
+
return () => _c$() && (() => {
|
|
352
|
+
var _el$2 = _tmpl$24();
|
|
353
|
+
insert(_el$2, () => local.icon);
|
|
354
|
+
return _el$2;
|
|
355
|
+
})();
|
|
356
|
+
})(), null);
|
|
357
|
+
insert(_el$, (() => {
|
|
358
|
+
var _c$2 = memo(() => !!local.title);
|
|
359
|
+
return () => _c$2() && (() => {
|
|
360
|
+
var _el$3 = _tmpl$34();
|
|
361
|
+
insert(_el$3, () => local.title);
|
|
362
|
+
return _el$3;
|
|
363
|
+
})();
|
|
364
|
+
})(), null);
|
|
365
|
+
insert(_el$, (() => {
|
|
366
|
+
var _c$3 = memo(() => !!local.description);
|
|
367
|
+
return () => _c$3() && (() => {
|
|
368
|
+
var _el$4 = _tmpl$42();
|
|
369
|
+
insert(_el$4, () => local.description);
|
|
370
|
+
return _el$4;
|
|
371
|
+
})();
|
|
372
|
+
})(), null);
|
|
373
|
+
insert(_el$, () => local.children, null);
|
|
374
|
+
return _el$;
|
|
375
|
+
})();
|
|
376
|
+
}
|
|
377
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class=overlay role=presentation><dialog open aria-modal=true>`);
|
|
378
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<button type=button class=modal-close aria-label=Close><svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>`);
|
|
379
|
+
var _tmpl$35 = /* @__PURE__ */ template(`<div>`);
|
|
380
|
+
var _tmpl$43 = /* @__PURE__ */ template(`<h2>`);
|
|
381
|
+
var ModalContext = createContext();
|
|
382
|
+
function Modal(props) {
|
|
383
|
+
const [local, rest] = splitProps(props, ["open", "onClose", "class", "children"]);
|
|
384
|
+
const handleKeyDown = (e) => {
|
|
385
|
+
if (e.key === "Escape" && local.open) {
|
|
386
|
+
local.onClose();
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
const handleOverlayClick = (e) => {
|
|
390
|
+
if (e.target === e.currentTarget) {
|
|
391
|
+
local.onClose();
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
onMount(() => {
|
|
395
|
+
if (isServer) return;
|
|
396
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
397
|
+
});
|
|
398
|
+
onCleanup(() => {
|
|
399
|
+
if (isServer) return;
|
|
400
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
401
|
+
});
|
|
402
|
+
const classes = () => `modal ${local.class ?? ""}`.trim();
|
|
403
|
+
return createComponent(Show, {
|
|
404
|
+
get when() {
|
|
405
|
+
return local.open;
|
|
406
|
+
},
|
|
407
|
+
get children() {
|
|
408
|
+
return createComponent(Portal, {
|
|
409
|
+
get children() {
|
|
410
|
+
return createComponent(ModalContext.Provider, {
|
|
411
|
+
get value() {
|
|
412
|
+
return {
|
|
413
|
+
onClose: local.onClose
|
|
414
|
+
};
|
|
415
|
+
},
|
|
416
|
+
get children() {
|
|
417
|
+
var _el$ = _tmpl$11(), _el$2 = _el$.firstChild;
|
|
418
|
+
_el$.$$keydown = (e) => e.key === "Escape" && local.onClose();
|
|
419
|
+
_el$.$$click = handleOverlayClick;
|
|
420
|
+
spread(_el$2, mergeProps({
|
|
421
|
+
get ["class"]() {
|
|
422
|
+
return classes();
|
|
423
|
+
}
|
|
424
|
+
}, rest), false, true);
|
|
425
|
+
insert(_el$2, () => local.children);
|
|
426
|
+
return _el$;
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
function ModalHeader(props) {
|
|
435
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
436
|
+
const ctx = useContext(ModalContext);
|
|
437
|
+
return (() => {
|
|
438
|
+
var _el$3 = _tmpl$35();
|
|
439
|
+
spread(_el$3, mergeProps({
|
|
440
|
+
get ["class"]() {
|
|
441
|
+
return `modal-header ${local.class ?? ""}`.trim();
|
|
442
|
+
}
|
|
443
|
+
}, rest), false, true);
|
|
444
|
+
insert(_el$3, () => local.children, null);
|
|
445
|
+
insert(_el$3, createComponent(Show, {
|
|
446
|
+
when: ctx,
|
|
447
|
+
get children() {
|
|
448
|
+
var _el$4 = _tmpl$25();
|
|
449
|
+
addEventListener(_el$4, "click", ctx?.onClose, true);
|
|
450
|
+
return _el$4;
|
|
451
|
+
}
|
|
452
|
+
}), null);
|
|
453
|
+
return _el$3;
|
|
454
|
+
})();
|
|
455
|
+
}
|
|
456
|
+
function ModalTitle(props) {
|
|
457
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
458
|
+
return (() => {
|
|
459
|
+
var _el$5 = _tmpl$43();
|
|
460
|
+
spread(_el$5, mergeProps({
|
|
461
|
+
get ["class"]() {
|
|
462
|
+
return `modal-title ${local.class ?? ""}`.trim();
|
|
463
|
+
}
|
|
464
|
+
}, rest), false, true);
|
|
465
|
+
insert(_el$5, () => local.children);
|
|
466
|
+
return _el$5;
|
|
467
|
+
})();
|
|
468
|
+
}
|
|
469
|
+
function ModalBody(props) {
|
|
470
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
471
|
+
return (() => {
|
|
472
|
+
var _el$6 = _tmpl$35();
|
|
473
|
+
spread(_el$6, mergeProps({
|
|
474
|
+
get ["class"]() {
|
|
475
|
+
return `modal-body ${local.class ?? ""}`.trim();
|
|
476
|
+
}
|
|
477
|
+
}, rest), false, true);
|
|
478
|
+
insert(_el$6, () => local.children);
|
|
479
|
+
return _el$6;
|
|
480
|
+
})();
|
|
481
|
+
}
|
|
482
|
+
function ModalFooter(props) {
|
|
483
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
484
|
+
return (() => {
|
|
485
|
+
var _el$7 = _tmpl$35();
|
|
486
|
+
spread(_el$7, mergeProps({
|
|
487
|
+
get ["class"]() {
|
|
488
|
+
return `modal-footer ${local.class ?? ""}`.trim();
|
|
489
|
+
}
|
|
490
|
+
}, rest), false, true);
|
|
491
|
+
insert(_el$7, () => local.children);
|
|
492
|
+
return _el$7;
|
|
493
|
+
})();
|
|
494
|
+
}
|
|
495
|
+
delegateEvents(["click", "keydown"]);
|
|
496
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class=dropdown>`);
|
|
497
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div class=dropdown-trigger>`);
|
|
498
|
+
var _tmpl$36 = /* @__PURE__ */ template(`<div class=dropdown-menu>`);
|
|
499
|
+
var _tmpl$44 = /* @__PURE__ */ template(`<button type=button>`);
|
|
500
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<div class=dropdown-divider>`);
|
|
501
|
+
var DropdownContext = createContext();
|
|
502
|
+
function Dropdown(props) {
|
|
503
|
+
const [open, setOpen] = createSignal(false);
|
|
504
|
+
let containerRef;
|
|
505
|
+
const close = () => setOpen(false);
|
|
506
|
+
const handleClickOutside = (e) => {
|
|
507
|
+
if (!containerRef?.contains(e.target)) {
|
|
508
|
+
close();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
const handleKeyDown = (e) => {
|
|
512
|
+
if (e.key === "Escape" && open()) {
|
|
513
|
+
close();
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
onMount(() => {
|
|
517
|
+
if (isServer) return;
|
|
518
|
+
document.addEventListener("click", handleClickOutside);
|
|
519
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
520
|
+
});
|
|
521
|
+
onCleanup(() => {
|
|
522
|
+
if (isServer) return;
|
|
523
|
+
document.removeEventListener("click", handleClickOutside);
|
|
524
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
525
|
+
});
|
|
526
|
+
return createComponent(DropdownContext.Provider, {
|
|
527
|
+
value: {
|
|
528
|
+
open,
|
|
529
|
+
setOpen,
|
|
530
|
+
close
|
|
531
|
+
},
|
|
532
|
+
get children() {
|
|
533
|
+
var _el$ = _tmpl$12();
|
|
534
|
+
use((el) => containerRef = el, _el$);
|
|
535
|
+
insert(_el$, () => props.children);
|
|
536
|
+
return _el$;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
function DropdownTrigger(props) {
|
|
541
|
+
const ctx = useContext(DropdownContext);
|
|
542
|
+
const handleClick = (e) => {
|
|
543
|
+
e.stopPropagation();
|
|
544
|
+
ctx?.setOpen(!ctx.open());
|
|
545
|
+
};
|
|
546
|
+
return (() => {
|
|
547
|
+
var _el$2 = _tmpl$26();
|
|
548
|
+
_el$2.$$click = handleClick;
|
|
549
|
+
insert(_el$2, () => props.children);
|
|
550
|
+
return _el$2;
|
|
551
|
+
})();
|
|
552
|
+
}
|
|
553
|
+
function DropdownMenu(props) {
|
|
554
|
+
const ctx = useContext(DropdownContext);
|
|
555
|
+
return createComponent(Show, {
|
|
556
|
+
get when() {
|
|
557
|
+
return ctx?.open();
|
|
558
|
+
},
|
|
559
|
+
get children() {
|
|
560
|
+
var _el$3 = _tmpl$36();
|
|
561
|
+
insert(_el$3, () => props.children);
|
|
562
|
+
return _el$3;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function DropdownItem(props) {
|
|
567
|
+
const [local, rest] = splitProps(props, ["onClick", "active", "children"]);
|
|
568
|
+
const ctx = useContext(DropdownContext);
|
|
569
|
+
const handleClick = () => {
|
|
570
|
+
local.onClick?.();
|
|
571
|
+
ctx?.close();
|
|
572
|
+
};
|
|
573
|
+
const classes = () => `dropdown-item ${local.active ? "active" : ""}`.trim();
|
|
574
|
+
return (() => {
|
|
575
|
+
var _el$4 = _tmpl$44();
|
|
576
|
+
_el$4.$$click = handleClick;
|
|
577
|
+
spread(_el$4, mergeProps({
|
|
578
|
+
get ["class"]() {
|
|
579
|
+
return classes();
|
|
580
|
+
}
|
|
581
|
+
}, rest), false, true);
|
|
582
|
+
insert(_el$4, () => local.children);
|
|
583
|
+
return _el$4;
|
|
584
|
+
})();
|
|
585
|
+
}
|
|
586
|
+
function DropdownDivider() {
|
|
587
|
+
return _tmpl$52();
|
|
588
|
+
}
|
|
589
|
+
delegateEvents(["click"]);
|
|
590
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<button class=clamp-toggle>`);
|
|
591
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<div><div>`);
|
|
592
|
+
function Clamp(props) {
|
|
593
|
+
const [local, rest] = splitProps(props, ["lines", "showMoreText", "showLessText", "class", "children"]);
|
|
594
|
+
const lines = () => local.lines ?? 3;
|
|
595
|
+
const showMoreText = () => local.showMoreText ?? "show more";
|
|
596
|
+
const showLessText = () => local.showLessText ?? "show less";
|
|
597
|
+
const [expanded, setExpanded] = createSignal(false);
|
|
598
|
+
const [overflows, setOverflows] = createSignal(false);
|
|
599
|
+
let contentRef;
|
|
600
|
+
const checkOverflow = () => {
|
|
601
|
+
if (!contentRef) return;
|
|
602
|
+
setOverflows(contentRef.scrollHeight > contentRef.clientHeight);
|
|
603
|
+
};
|
|
604
|
+
const toggle = () => setExpanded((prev) => !prev);
|
|
605
|
+
const wrapperClasses = () => `clamp ${local.class ?? ""}`.trim();
|
|
606
|
+
const contentClasses = () => expanded() ? "clamp-content" : "clamp-content clamp-clamped";
|
|
607
|
+
return (() => {
|
|
608
|
+
var _el$ = _tmpl$27(), _el$2 = _el$.firstChild;
|
|
609
|
+
spread(_el$, mergeProps({
|
|
610
|
+
get ["class"]() {
|
|
611
|
+
return wrapperClasses();
|
|
612
|
+
}
|
|
613
|
+
}, rest), false, true);
|
|
614
|
+
use((el) => {
|
|
615
|
+
contentRef = el;
|
|
616
|
+
requestAnimationFrame(checkOverflow);
|
|
617
|
+
}, _el$2);
|
|
618
|
+
insert(_el$2, () => local.children);
|
|
619
|
+
insert(_el$, createComponent(Show, {
|
|
620
|
+
get when() {
|
|
621
|
+
return overflows() || expanded();
|
|
622
|
+
},
|
|
623
|
+
get children() {
|
|
624
|
+
var _el$3 = _tmpl$13();
|
|
625
|
+
_el$3.$$click = toggle;
|
|
626
|
+
insert(_el$3, (() => {
|
|
627
|
+
var _c$ = memo(() => !!expanded());
|
|
628
|
+
return () => _c$() ? showLessText() : showMoreText();
|
|
629
|
+
})());
|
|
630
|
+
return _el$3;
|
|
631
|
+
}
|
|
632
|
+
}), null);
|
|
633
|
+
effect((_p$) => {
|
|
634
|
+
var _v$ = contentClasses(), _v$2 = `--clamp-lines: ${lines()}`;
|
|
635
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
636
|
+
_p$.t = style(_el$2, _v$2, _p$.t);
|
|
637
|
+
return _p$;
|
|
638
|
+
}, {
|
|
639
|
+
e: void 0,
|
|
640
|
+
t: void 0
|
|
641
|
+
});
|
|
642
|
+
return _el$;
|
|
643
|
+
})();
|
|
644
|
+
}
|
|
645
|
+
delegateEvents(["click"]);
|
|
646
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<div class=collapsible-content>`);
|
|
647
|
+
var _tmpl$28 = /* @__PURE__ */ template(`<div class=collapsible><button class=collapsible-trigger>`);
|
|
648
|
+
function Collapsible(props) {
|
|
649
|
+
const [local, rest] = splitProps(props, ["defaultOpen", "open", "onOpenChange", "children", "trigger"]);
|
|
650
|
+
const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);
|
|
651
|
+
const isControlled = () => local.open !== void 0;
|
|
652
|
+
const isOpen = () => isControlled() ? local.open : internalOpen();
|
|
653
|
+
const toggle = () => {
|
|
654
|
+
const next = !isOpen();
|
|
655
|
+
if (!isControlled()) {
|
|
656
|
+
setInternalOpen(next);
|
|
657
|
+
}
|
|
658
|
+
local.onOpenChange?.(next);
|
|
659
|
+
};
|
|
660
|
+
return (() => {
|
|
661
|
+
var _el$ = _tmpl$28(), _el$2 = _el$.firstChild;
|
|
662
|
+
_el$2.$$click = toggle;
|
|
663
|
+
insert(_el$2, () => local.trigger, null);
|
|
664
|
+
insert(_el$2, createComponent(Chevron, {
|
|
665
|
+
"class": "collapsible-chevron",
|
|
666
|
+
get expanded() {
|
|
667
|
+
return isOpen();
|
|
668
|
+
}
|
|
669
|
+
}), null);
|
|
670
|
+
insert(_el$, createComponent(Show, {
|
|
671
|
+
get when() {
|
|
672
|
+
return isOpen();
|
|
673
|
+
},
|
|
674
|
+
get children() {
|
|
675
|
+
var _el$3 = _tmpl$14();
|
|
676
|
+
insert(_el$3, () => local.children);
|
|
677
|
+
return _el$3;
|
|
678
|
+
}
|
|
679
|
+
}), null);
|
|
680
|
+
return _el$;
|
|
681
|
+
})();
|
|
682
|
+
}
|
|
683
|
+
delegateEvents(["click"]);
|
|
684
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<svg width=16 height=16 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="13 4 6 12 3 9">`);
|
|
685
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div class=step-description>`);
|
|
686
|
+
var _tmpl$37 = /* @__PURE__ */ template(`<div><div></div><div><div class=step-title></div></div><div>`);
|
|
687
|
+
var _tmpl$45 = /* @__PURE__ */ template(`<div>`);
|
|
688
|
+
var StepperContext = createContext();
|
|
689
|
+
var statusClasses = {
|
|
690
|
+
completed: "step-completed",
|
|
691
|
+
current: "step-current",
|
|
692
|
+
upcoming: "step-upcoming"
|
|
693
|
+
};
|
|
694
|
+
function CheckIcon() {
|
|
695
|
+
return _tmpl$15();
|
|
696
|
+
}
|
|
697
|
+
var StepContext = createContext();
|
|
698
|
+
function Step(props) {
|
|
699
|
+
const [local, rest] = splitProps(props, ["title", "description", "icon", "status", "class"]);
|
|
700
|
+
const stepperCtx = useContext(StepperContext);
|
|
701
|
+
const stepCtx = useContext(StepContext);
|
|
702
|
+
const stepNumber = stepperCtx?.registerStep() ?? 1;
|
|
703
|
+
const orientation = () => stepCtx?.orientation() ?? "horizontal";
|
|
704
|
+
const status = () => local.status ?? "upcoming";
|
|
705
|
+
const isVertical = () => orientation() === "vertical";
|
|
706
|
+
const classes = () => {
|
|
707
|
+
const parts = ["step", statusClasses[status()]];
|
|
708
|
+
if (isVertical()) {
|
|
709
|
+
parts.push("vertical-connector-item");
|
|
710
|
+
}
|
|
711
|
+
if (local.class) {
|
|
712
|
+
parts.push(local.class);
|
|
713
|
+
}
|
|
714
|
+
return parts.join(" ");
|
|
715
|
+
};
|
|
716
|
+
const indicatorClasses = () => {
|
|
717
|
+
const parts = ["step-indicator"];
|
|
718
|
+
if (isVertical()) {
|
|
719
|
+
parts.push("vertical-indicator");
|
|
720
|
+
}
|
|
721
|
+
return parts.join(" ");
|
|
722
|
+
};
|
|
723
|
+
const contentClasses = () => {
|
|
724
|
+
const parts = ["step-content"];
|
|
725
|
+
if (isVertical()) {
|
|
726
|
+
parts.push("vertical-content");
|
|
727
|
+
}
|
|
728
|
+
return parts.join(" ");
|
|
729
|
+
};
|
|
730
|
+
const connectorClasses = () => {
|
|
731
|
+
const parts = ["step-connector"];
|
|
732
|
+
if (isVertical()) {
|
|
733
|
+
parts.push("vertical-connector");
|
|
734
|
+
}
|
|
735
|
+
return parts.join(" ");
|
|
736
|
+
};
|
|
737
|
+
const indicator = () => {
|
|
738
|
+
if (status() === "completed") {
|
|
739
|
+
return createComponent(CheckIcon, {});
|
|
740
|
+
}
|
|
741
|
+
if (local.icon) {
|
|
742
|
+
return local.icon;
|
|
743
|
+
}
|
|
744
|
+
return stepNumber;
|
|
745
|
+
};
|
|
746
|
+
return (() => {
|
|
747
|
+
var _el$2 = _tmpl$37(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$7 = _el$4.nextSibling;
|
|
748
|
+
spread(_el$2, mergeProps({
|
|
749
|
+
get ["class"]() {
|
|
750
|
+
return classes();
|
|
751
|
+
}
|
|
752
|
+
}, rest), false, true);
|
|
753
|
+
insert(_el$3, indicator);
|
|
754
|
+
insert(_el$5, () => local.title);
|
|
755
|
+
insert(_el$4, createComponent(Show, {
|
|
756
|
+
get when() {
|
|
757
|
+
return local.description;
|
|
758
|
+
},
|
|
759
|
+
get children() {
|
|
760
|
+
var _el$6 = _tmpl$29();
|
|
761
|
+
insert(_el$6, () => local.description);
|
|
762
|
+
return _el$6;
|
|
763
|
+
}
|
|
764
|
+
}), null);
|
|
765
|
+
effect((_p$) => {
|
|
766
|
+
var _v$ = indicatorClasses(), _v$2 = contentClasses(), _v$3 = connectorClasses();
|
|
767
|
+
_v$ !== _p$.e && className(_el$3, _p$.e = _v$);
|
|
768
|
+
_v$2 !== _p$.t && className(_el$4, _p$.t = _v$2);
|
|
769
|
+
_v$3 !== _p$.a && className(_el$7, _p$.a = _v$3);
|
|
770
|
+
return _p$;
|
|
771
|
+
}, {
|
|
772
|
+
e: void 0,
|
|
773
|
+
t: void 0,
|
|
774
|
+
a: void 0
|
|
775
|
+
});
|
|
776
|
+
return _el$2;
|
|
777
|
+
})();
|
|
778
|
+
}
|
|
779
|
+
function Stepper(props) {
|
|
780
|
+
const [local, rest] = splitProps(props, ["orientation", "class", "children"]);
|
|
781
|
+
let stepCounter = 0;
|
|
782
|
+
const registerStep = () => ++stepCounter;
|
|
783
|
+
const orientation = () => local.orientation ?? "horizontal";
|
|
784
|
+
const classes = () => {
|
|
785
|
+
const parts = ["stepper", orientation() === "horizontal" ? "stepper-horizontal" : "stepper-vertical"];
|
|
786
|
+
if (local.class) {
|
|
787
|
+
parts.push(local.class);
|
|
788
|
+
}
|
|
789
|
+
return parts.join(" ");
|
|
790
|
+
};
|
|
791
|
+
return createComponent(StepperContext.Provider, {
|
|
792
|
+
value: {
|
|
793
|
+
registerStep
|
|
794
|
+
},
|
|
795
|
+
get children() {
|
|
796
|
+
return createComponent(StepContext.Provider, {
|
|
797
|
+
value: {
|
|
798
|
+
orientation
|
|
799
|
+
},
|
|
800
|
+
get children() {
|
|
801
|
+
var _el$8 = _tmpl$45();
|
|
802
|
+
spread(_el$8, mergeProps({
|
|
803
|
+
get ["class"]() {
|
|
804
|
+
return classes();
|
|
805
|
+
}
|
|
806
|
+
}, rest), false, true);
|
|
807
|
+
insert(_el$8, () => local.children);
|
|
808
|
+
return _el$8;
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<div>`);
|
|
815
|
+
var _tmpl$210 = /* @__PURE__ */ template(`<div role=tablist>`);
|
|
816
|
+
var _tmpl$38 = /* @__PURE__ */ template(`<button type=button role=tab>`);
|
|
817
|
+
var _tmpl$46 = /* @__PURE__ */ template(`<div role=tabpanel>`);
|
|
818
|
+
var TabsContext = createContext();
|
|
819
|
+
function Tabs(props) {
|
|
820
|
+
const [local, rest] = splitProps(props, ["defaultValue", "value", "onValueChange", "children", "class"]);
|
|
821
|
+
const [internalValue, setInternalValue] = createSignal(local.defaultValue ?? "");
|
|
822
|
+
const isControlled = () => local.value !== void 0;
|
|
823
|
+
const activeTab = () => isControlled() ? local.value : internalValue();
|
|
824
|
+
const setActiveTab = (id) => {
|
|
825
|
+
if (!isControlled()) {
|
|
826
|
+
setInternalValue(id);
|
|
827
|
+
}
|
|
828
|
+
local.onValueChange?.(id);
|
|
829
|
+
};
|
|
830
|
+
const classes = () => `tabs ${local.class ?? ""}`.trim();
|
|
831
|
+
return createComponent(TabsContext.Provider, {
|
|
832
|
+
value: {
|
|
833
|
+
activeTab,
|
|
834
|
+
setActiveTab
|
|
835
|
+
},
|
|
836
|
+
get children() {
|
|
837
|
+
var _el$ = _tmpl$16();
|
|
838
|
+
spread(_el$, mergeProps({
|
|
839
|
+
get ["class"]() {
|
|
840
|
+
return classes();
|
|
841
|
+
}
|
|
842
|
+
}, rest), false, true);
|
|
843
|
+
insert(_el$, () => local.children);
|
|
844
|
+
return _el$;
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
function TabList(props) {
|
|
849
|
+
const [local, rest] = splitProps(props, ["children", "class"]);
|
|
850
|
+
const classes = () => `tab-list ${local.class ?? ""}`.trim();
|
|
851
|
+
return (() => {
|
|
852
|
+
var _el$2 = _tmpl$210();
|
|
853
|
+
spread(_el$2, mergeProps({
|
|
854
|
+
get ["class"]() {
|
|
855
|
+
return classes();
|
|
856
|
+
}
|
|
857
|
+
}, rest), false, true);
|
|
858
|
+
insert(_el$2, () => local.children);
|
|
859
|
+
return _el$2;
|
|
860
|
+
})();
|
|
861
|
+
}
|
|
862
|
+
function Tab(props) {
|
|
863
|
+
const [local, rest] = splitProps(props, ["value", "children", "class"]);
|
|
864
|
+
const ctx = useContext(TabsContext);
|
|
865
|
+
const isActive = () => ctx?.activeTab() === local.value;
|
|
866
|
+
const handleClick = () => {
|
|
867
|
+
ctx?.setActiveTab(local.value);
|
|
868
|
+
};
|
|
869
|
+
const classes = () => {
|
|
870
|
+
const parts = ["tab"];
|
|
871
|
+
if (isActive()) {
|
|
872
|
+
parts.push("active");
|
|
873
|
+
}
|
|
874
|
+
if (local.class) {
|
|
875
|
+
parts.push(local.class);
|
|
876
|
+
}
|
|
877
|
+
return parts.join(" ");
|
|
878
|
+
};
|
|
879
|
+
return (() => {
|
|
880
|
+
var _el$3 = _tmpl$38();
|
|
881
|
+
_el$3.$$click = handleClick;
|
|
882
|
+
spread(_el$3, mergeProps({
|
|
883
|
+
get ["aria-selected"]() {
|
|
884
|
+
return isActive();
|
|
885
|
+
},
|
|
886
|
+
get tabIndex() {
|
|
887
|
+
return isActive() ? 0 : -1;
|
|
888
|
+
},
|
|
889
|
+
get ["class"]() {
|
|
890
|
+
return classes();
|
|
891
|
+
}
|
|
892
|
+
}, rest), false, true);
|
|
893
|
+
insert(_el$3, () => local.children);
|
|
894
|
+
return _el$3;
|
|
895
|
+
})();
|
|
896
|
+
}
|
|
897
|
+
function TabPanel(props) {
|
|
898
|
+
const [local, rest] = splitProps(props, ["value", "children", "class"]);
|
|
899
|
+
const ctx = useContext(TabsContext);
|
|
900
|
+
const isActive = () => ctx?.activeTab() === local.value;
|
|
901
|
+
const classes = () => `tab-panel ${local.class ?? ""}`.trim();
|
|
902
|
+
return createComponent(Show, {
|
|
903
|
+
get when() {
|
|
904
|
+
return isActive();
|
|
905
|
+
},
|
|
906
|
+
get children() {
|
|
907
|
+
var _el$4 = _tmpl$46();
|
|
908
|
+
spread(_el$4, mergeProps({
|
|
909
|
+
get ["class"]() {
|
|
910
|
+
return classes();
|
|
911
|
+
}
|
|
912
|
+
}, rest), false, true);
|
|
913
|
+
insert(_el$4, () => local.children);
|
|
914
|
+
return _el$4;
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
delegateEvents(["click"]);
|
|
919
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<label><input type=checkbox class=checkbox-input><span class=checkbox-box aria-hidden=true><svg class=checkbox-check viewBox="0 0 12 12"fill=none><path d="M2 6L5 9L10 3"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path></svg><span class=checkbox-indeterminate>`);
|
|
920
|
+
var _tmpl$211 = /* @__PURE__ */ template(`<span class=checkbox-content>`);
|
|
921
|
+
var _tmpl$39 = /* @__PURE__ */ template(`<span class=checkbox-label>`);
|
|
922
|
+
var _tmpl$47 = /* @__PURE__ */ template(`<span class=checkbox-description>`);
|
|
923
|
+
function Checkbox(props) {
|
|
924
|
+
const [local, rest] = splitProps(props, ["label", "description", "indeterminate", "class", "disabled", "id"]);
|
|
925
|
+
let inputRef;
|
|
926
|
+
const setIndeterminate = () => {
|
|
927
|
+
if (inputRef) inputRef.indeterminate = local.indeterminate ?? false;
|
|
928
|
+
};
|
|
929
|
+
onMount(setIndeterminate);
|
|
930
|
+
createEffect(setIndeterminate);
|
|
931
|
+
const classes = () => `checkbox ${local.disabled ? "checkbox-disabled" : ""} ${local.class ?? ""}`.trim();
|
|
932
|
+
const inputId = () => local.id ?? (local.label ? `checkbox-${local.label.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
933
|
+
return (() => {
|
|
934
|
+
var _el$ = _tmpl$17(), _el$2 = _el$.firstChild; _el$2.nextSibling;
|
|
935
|
+
var _ref$ = inputRef;
|
|
936
|
+
typeof _ref$ === "function" ? use(_ref$, _el$2) : inputRef = _el$2;
|
|
937
|
+
spread(_el$2, mergeProps({
|
|
938
|
+
get id() {
|
|
939
|
+
return inputId();
|
|
940
|
+
},
|
|
941
|
+
get disabled() {
|
|
942
|
+
return local.disabled;
|
|
943
|
+
}
|
|
944
|
+
}, rest), false, false);
|
|
945
|
+
insert(_el$, (() => {
|
|
946
|
+
var _c$ = memo(() => !!(local.label || local.description));
|
|
947
|
+
return () => _c$() && (() => {
|
|
948
|
+
var _el$4 = _tmpl$211();
|
|
949
|
+
insert(_el$4, (() => {
|
|
950
|
+
var _c$2 = memo(() => !!local.label);
|
|
951
|
+
return () => _c$2() && (() => {
|
|
952
|
+
var _el$5 = _tmpl$39();
|
|
953
|
+
insert(_el$5, () => local.label);
|
|
954
|
+
return _el$5;
|
|
955
|
+
})();
|
|
956
|
+
})(), null);
|
|
957
|
+
insert(_el$4, (() => {
|
|
958
|
+
var _c$3 = memo(() => !!local.description);
|
|
959
|
+
return () => _c$3() && (() => {
|
|
960
|
+
var _el$6 = _tmpl$47();
|
|
961
|
+
insert(_el$6, () => local.description);
|
|
962
|
+
return _el$6;
|
|
963
|
+
})();
|
|
964
|
+
})(), null);
|
|
965
|
+
return _el$4;
|
|
966
|
+
})();
|
|
967
|
+
})(), null);
|
|
968
|
+
effect(() => className(_el$, classes()));
|
|
969
|
+
return _el$;
|
|
970
|
+
})();
|
|
971
|
+
}
|
|
972
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<label><input type=checkbox class=toggle-input role=switch><span class=toggle-track><span class=toggle-knob>`);
|
|
973
|
+
var _tmpl$212 = /* @__PURE__ */ template(`<span class=toggle-content>`);
|
|
974
|
+
var _tmpl$310 = /* @__PURE__ */ template(`<span class=toggle-label>`);
|
|
975
|
+
var _tmpl$48 = /* @__PURE__ */ template(`<span class=toggle-description>`);
|
|
976
|
+
function Toggle(props) {
|
|
977
|
+
const [local, rest] = splitProps(props, ["label", "description", "size", "class", "disabled"]);
|
|
978
|
+
const size = () => local.size ?? "md";
|
|
979
|
+
const classes = () => `toggle ${size() === "sm" ? "toggle-sm" : ""} ${local.disabled ? "toggle-disabled" : ""} ${local.class ?? ""}`.trim();
|
|
980
|
+
return (() => {
|
|
981
|
+
var _el$ = _tmpl$18(), _el$2 = _el$.firstChild; _el$2.nextSibling;
|
|
982
|
+
spread(_el$2, mergeProps({
|
|
983
|
+
get disabled() {
|
|
984
|
+
return local.disabled;
|
|
985
|
+
}
|
|
986
|
+
}, rest), false, false);
|
|
987
|
+
insert(_el$, (() => {
|
|
988
|
+
var _c$ = memo(() => !!(local.label || local.description));
|
|
989
|
+
return () => _c$() && (() => {
|
|
990
|
+
var _el$4 = _tmpl$212();
|
|
991
|
+
insert(_el$4, (() => {
|
|
992
|
+
var _c$2 = memo(() => !!local.label);
|
|
993
|
+
return () => _c$2() && (() => {
|
|
994
|
+
var _el$5 = _tmpl$310();
|
|
995
|
+
insert(_el$5, () => local.label);
|
|
996
|
+
return _el$5;
|
|
997
|
+
})();
|
|
998
|
+
})(), null);
|
|
999
|
+
insert(_el$4, (() => {
|
|
1000
|
+
var _c$3 = memo(() => !!local.description);
|
|
1001
|
+
return () => _c$3() && (() => {
|
|
1002
|
+
var _el$6 = _tmpl$48();
|
|
1003
|
+
insert(_el$6, () => local.description);
|
|
1004
|
+
return _el$6;
|
|
1005
|
+
})();
|
|
1006
|
+
})(), null);
|
|
1007
|
+
return _el$4;
|
|
1008
|
+
})();
|
|
1009
|
+
})(), null);
|
|
1010
|
+
effect(() => className(_el$, classes()));
|
|
1011
|
+
return _el$;
|
|
1012
|
+
})();
|
|
1013
|
+
}
|
|
1014
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<span class=form-field-required aria-hidden=true>*`);
|
|
1015
|
+
var _tmpl$213 = /* @__PURE__ */ template(`<span class=form-field-description>`);
|
|
1016
|
+
var _tmpl$311 = /* @__PURE__ */ template(`<span class=form-field-error role=alert>`);
|
|
1017
|
+
var _tmpl$49 = /* @__PURE__ */ template(`<div><label class=form-field-label>`);
|
|
1018
|
+
function FormField(props) {
|
|
1019
|
+
const [local, rest] = splitProps(props, ["label", "error", "description", "required", "children", "id", "class"]);
|
|
1020
|
+
const classes = () => `form-field ${local.error ? "form-field-has-error" : ""} ${local.class ?? ""}`.trim();
|
|
1021
|
+
return (() => {
|
|
1022
|
+
var _el$ = _tmpl$49(), _el$2 = _el$.firstChild;
|
|
1023
|
+
spread(_el$, mergeProps({
|
|
1024
|
+
get ["class"]() {
|
|
1025
|
+
return classes();
|
|
1026
|
+
}
|
|
1027
|
+
}, rest), false, true);
|
|
1028
|
+
insert(_el$2, () => local.label, null);
|
|
1029
|
+
insert(_el$2, createComponent(Show, {
|
|
1030
|
+
get when() {
|
|
1031
|
+
return local.required;
|
|
1032
|
+
},
|
|
1033
|
+
get children() {
|
|
1034
|
+
return _tmpl$19();
|
|
1035
|
+
}
|
|
1036
|
+
}), null);
|
|
1037
|
+
insert(_el$, createComponent(Show, {
|
|
1038
|
+
get when() {
|
|
1039
|
+
return local.description;
|
|
1040
|
+
},
|
|
1041
|
+
get children() {
|
|
1042
|
+
var _el$4 = _tmpl$213();
|
|
1043
|
+
insert(_el$4, () => local.description);
|
|
1044
|
+
return _el$4;
|
|
1045
|
+
}
|
|
1046
|
+
}), null);
|
|
1047
|
+
insert(_el$, () => local.children, null);
|
|
1048
|
+
insert(_el$, createComponent(Show, {
|
|
1049
|
+
get when() {
|
|
1050
|
+
return local.error;
|
|
1051
|
+
},
|
|
1052
|
+
get children() {
|
|
1053
|
+
var _el$5 = _tmpl$311();
|
|
1054
|
+
insert(_el$5, () => local.error);
|
|
1055
|
+
return _el$5;
|
|
1056
|
+
}
|
|
1057
|
+
}), null);
|
|
1058
|
+
effect(() => setAttribute(_el$2, "for", local.id));
|
|
1059
|
+
return _el$;
|
|
1060
|
+
})();
|
|
1061
|
+
}
|
|
1062
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<div class=timeline-dot>`);
|
|
1063
|
+
var _tmpl$214 = /* @__PURE__ */ template(`<div>`);
|
|
1064
|
+
var _tmpl$312 = /* @__PURE__ */ template(`<div class=timeline-description>`);
|
|
1065
|
+
var _tmpl$410 = /* @__PURE__ */ template(`<div class=timeline-timestamp>`);
|
|
1066
|
+
var _tmpl$53 = /* @__PURE__ */ template(`<div><div class="timeline-indicator vertical-indicator"></div><div class=vertical-connector></div><div class="timeline-content vertical-content"><div class=timeline-title>`);
|
|
1067
|
+
var variantClasses3 = {
|
|
1068
|
+
default: "",
|
|
1069
|
+
success: "timeline-item-success",
|
|
1070
|
+
error: "timeline-item-error",
|
|
1071
|
+
warning: "timeline-item-warning",
|
|
1072
|
+
info: "timeline-item-info"
|
|
1073
|
+
};
|
|
1074
|
+
function DefaultDot() {
|
|
1075
|
+
return _tmpl$20();
|
|
1076
|
+
}
|
|
1077
|
+
function Timeline(props) {
|
|
1078
|
+
const [local, rest] = splitProps(props, ["items", "class"]);
|
|
1079
|
+
const classes = () => {
|
|
1080
|
+
const parts = ["timeline"];
|
|
1081
|
+
if (local.class) parts.push(local.class);
|
|
1082
|
+
return parts.join(" ");
|
|
1083
|
+
};
|
|
1084
|
+
return (() => {
|
|
1085
|
+
var _el$2 = _tmpl$214();
|
|
1086
|
+
spread(_el$2, mergeProps({
|
|
1087
|
+
get ["class"]() {
|
|
1088
|
+
return classes();
|
|
1089
|
+
}
|
|
1090
|
+
}, rest), false, true);
|
|
1091
|
+
insert(_el$2, createComponent(For, {
|
|
1092
|
+
get each() {
|
|
1093
|
+
return local.items;
|
|
1094
|
+
},
|
|
1095
|
+
children: (item, index) => (() => {
|
|
1096
|
+
var _el$3 = _tmpl$53(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild;
|
|
1097
|
+
insert(_el$4, createComponent(Show, {
|
|
1098
|
+
get when() {
|
|
1099
|
+
return item.icon;
|
|
1100
|
+
},
|
|
1101
|
+
get fallback() {
|
|
1102
|
+
return createComponent(DefaultDot, {});
|
|
1103
|
+
},
|
|
1104
|
+
get children() {
|
|
1105
|
+
return item.icon;
|
|
1106
|
+
}
|
|
1107
|
+
}));
|
|
1108
|
+
insert(_el$7, () => item.title);
|
|
1109
|
+
insert(_el$6, createComponent(Show, {
|
|
1110
|
+
get when() {
|
|
1111
|
+
return item.description;
|
|
1112
|
+
},
|
|
1113
|
+
get children() {
|
|
1114
|
+
var _el$8 = _tmpl$312();
|
|
1115
|
+
insert(_el$8, () => item.description);
|
|
1116
|
+
return _el$8;
|
|
1117
|
+
}
|
|
1118
|
+
}), null);
|
|
1119
|
+
insert(_el$6, createComponent(Show, {
|
|
1120
|
+
get when() {
|
|
1121
|
+
return item.timestamp;
|
|
1122
|
+
},
|
|
1123
|
+
get children() {
|
|
1124
|
+
var _el$9 = _tmpl$410();
|
|
1125
|
+
insert(_el$9, () => item.timestamp);
|
|
1126
|
+
return _el$9;
|
|
1127
|
+
}
|
|
1128
|
+
}), null);
|
|
1129
|
+
effect(() => className(_el$3, `timeline-item vertical-connector-item ${variantClasses3[item.variant ?? "default"]}`));
|
|
1130
|
+
return _el$3;
|
|
1131
|
+
})()
|
|
1132
|
+
}));
|
|
1133
|
+
return _el$2;
|
|
1134
|
+
})();
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export { Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chevron, Clamp, Collapsible, Dropdown, DropdownDivider, DropdownItem, DropdownMenu, DropdownTrigger, Empty, FormField, Input, Modal, ModalBody, ModalFooter, ModalHeader, ModalTitle, Select, Spinner, Stat, Status, Step, Stepper, Tab, TabList, TabPanel, Tabs, Textarea, Timeline, Toggle };
|