@pathscale/ui 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion-JZGWxBMK.d.ts +27 -0
- package/dist/Autocomplete-gLkjMHrc.d.ts +28 -0
- package/dist/Checkbox-BjaweaOH.d.ts +40 -0
- package/dist/Field-DfUn85_1.d.ts +49 -0
- package/dist/{Input-BQbTzjIO.d.ts → Input-C1bm4HGf.d.ts} +1 -1
- package/dist/Pagination-CJtlFMHy.d.ts +43 -0
- package/dist/Progress-gN0xqhAF.d.ts +64 -0
- package/dist/Select-CWCDBvec.d.ts +44 -0
- package/dist/Steps-1miUeyCD.d.ts +34 -0
- package/dist/Switch-BiKX7HZ2.d.ts +72 -0
- package/dist/Table-CGa6Nop3.d.ts +39 -0
- package/dist/Tabs-BEnRV6GG.d.ts +42 -0
- package/dist/Tag-BPrhn-Ne.d.ts +42 -0
- package/dist/Timeline-Bd4SxHMT.d.ts +14 -0
- package/dist/Tooltip-BfPongoz.d.ts +53 -0
- package/dist/Upload-BrFuZ4JA.d.ts +39 -0
- package/dist/chunk/3IHANYRN.js +98 -0
- package/dist/chunk/3VOILEMN.js +187 -0
- package/dist/chunk/4TWLQ3IA.js +103 -0
- package/dist/chunk/6SBH3KSM.jsx +96 -0
- package/dist/chunk/7ROVLN3J.js +175 -0
- package/dist/chunk/BBDVIXAH.jsx +194 -0
- package/dist/chunk/{4RCWSX7S.jsx → C4745OZS.jsx} +7 -7
- package/dist/chunk/C4YO33NN.jsx +179 -0
- package/dist/chunk/CJZGTNJZ.js +115 -0
- package/dist/chunk/D2BEL4SM.jsx +169 -0
- package/dist/chunk/DBQ7IOPU.js +189 -0
- package/dist/chunk/DNTGSCVF.jsx +100 -0
- package/dist/chunk/DSTUGZW6.jsx +81 -0
- package/dist/chunk/ELRAUORW.jsx +179 -0
- package/dist/chunk/FKSQPGOD.jsx +170 -0
- package/dist/chunk/FPUQ25SO.js +137 -0
- package/dist/chunk/GLEAR2TS.jsx +160 -0
- package/dist/chunk/GMIXRYN3.js +138 -0
- package/dist/chunk/HWAGW5N4.jsx +118 -0
- package/dist/chunk/JWRGKHDO.js +172 -0
- package/dist/chunk/KV6LTJHI.jsx +175 -0
- package/dist/chunk/LAQPAV5I.jsx +187 -0
- package/dist/chunk/LI3HCFL7.jsx +132 -0
- package/dist/chunk/MAX47D6F.js +99 -0
- package/dist/chunk/{2JGZSAW5.js → MI773TMC.js} +6 -6
- package/dist/chunk/MMTAND25.jsx +126 -0
- package/dist/chunk/MXG3MBEN.jsx +148 -0
- package/dist/chunk/MYERRMTM.js +200 -0
- package/dist/chunk/NZKPDBTE.js +118 -0
- package/dist/chunk/OSJ3P7PI.js +189 -0
- package/dist/chunk/P2L6LFLS.js +144 -0
- package/dist/chunk/QLESLIWS.jsx +110 -0
- package/dist/chunk/QONDPQ2I.jsx +105 -0
- package/dist/chunk/QYEMOKUG.js +125 -0
- package/dist/chunk/S3ZDSQSV.js +98 -0
- package/dist/chunk/SCJSBRV2.jsx +39 -0
- package/dist/chunk/STKRVQR6.jsx +130 -0
- package/dist/chunk/{NZZRKP74.js → TFLJI242.js} +1 -25
- package/dist/chunk/TT2JYGLU.js +218 -0
- package/dist/chunk/V6Y5E7BL.js +133 -0
- package/dist/chunk/VN5BKHA2.jsx +97 -0
- package/dist/chunk/WOT36Q7O.js +166 -0
- package/dist/chunk/WUZETUQR.js +92 -0
- package/dist/chunk/XD34JKSU.jsx +201 -0
- package/dist/chunk/{GA2HCFRS.jsx → YAQK2KFY.jsx} +1 -35
- package/dist/chunk/YMO6RPS6.js +26 -0
- package/dist/components/Progress/index.d.ts +4 -39
- package/dist/components/Progress/index.js +1 -278
- package/dist/components/Progress/index.jsx +4 -199
- package/dist/components/accordion/index.d.ts +5 -24
- package/dist/components/accordion/index.js +1 -118
- package/dist/components/accordion/index.jsx +3 -100
- package/dist/components/autocomplete/index.d.ts +8 -0
- package/dist/components/autocomplete/index.js +1 -0
- package/dist/components/autocomplete/index.jsx +7 -0
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.jsx +3 -3
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/index.js +1 -133
- package/dist/components/breadcrumb/index.jsx +4 -120
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.jsx +2 -1
- package/dist/components/checkbox/index.d.ts +5 -37
- package/dist/components/checkbox/index.js +1 -137
- package/dist/components/checkbox/index.jsx +3 -143
- package/dist/components/dropdown/index.d.ts +43 -0
- package/dist/components/dropdown/index.js +1 -0
- package/dist/components/dropdown/index.jsx +12 -0
- package/dist/components/field/index.d.ts +7 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field/index.jsx +7 -0
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/menu/index.d.ts +66 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/index.jsx +11 -0
- package/dist/components/navbar/index.d.ts +74 -0
- package/dist/components/navbar/index.js +1 -0
- package/dist/components/navbar/index.jsx +11 -0
- package/dist/components/pagination/index.d.ts +5 -40
- package/dist/components/pagination/index.js +1 -189
- package/dist/components/pagination/index.jsx +3 -174
- package/dist/components/select/index.d.ts +5 -41
- package/dist/components/select/index.js +1 -98
- package/dist/components/select/index.jsx +3 -91
- package/dist/components/steps/index.d.ts +8 -0
- package/dist/components/steps/index.js +1 -0
- package/dist/components/steps/index.jsx +7 -0
- package/dist/components/switch/index.d.ts +5 -69
- package/dist/components/switch/index.js +1 -144
- package/dist/components/switch/index.jsx +3 -155
- package/dist/components/table/index.d.ts +8 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/index.jsx +7 -0
- package/dist/components/tabs/index.d.ts +5 -39
- package/dist/components/tabs/index.js +1 -166
- package/dist/components/tabs/index.jsx +3 -170
- package/dist/components/tag/index.d.ts +5 -39
- package/dist/components/tag/index.js +1 -115
- package/dist/components/tag/index.jsx +3 -127
- package/dist/components/timeline/index.d.ts +7 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/timeline/index.jsx +7 -0
- package/dist/components/toast/index.d.ts +24 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/index.jsx +11 -0
- package/dist/components/tooltip/index.d.ts +5 -50
- package/dist/components/tooltip/index.js +1 -103
- package/dist/components/tooltip/index.jsx +3 -95
- package/dist/components/upload/index.d.ts +5 -36
- package/dist/components/upload/index.js +1 -98
- package/dist/components/upload/index.jsx +3 -105
- package/dist/index.d.ts +22 -2
- package/dist/index.js +23 -2
- package/dist/index.jsx +108 -8
- package/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/upload/Upload.tsx
|
|
7
|
+
import { splitProps, Show } from "solid-js";
|
|
8
|
+
|
|
9
|
+
// src/components/upload/Upload.styles.ts
|
|
10
|
+
var uploadWrapperVariants = cva("", {
|
|
11
|
+
variants: {
|
|
12
|
+
style: {
|
|
13
|
+
boxed: "flex flex-col items-center justify-center border border-gray-300 rounded-md p-4 bg-white dark:bg-gray-800 text-gray-700 hover:text-gray-900 text-center",
|
|
14
|
+
button: "px-4 py-2 rounded inline-flex items-center gap-2 text-white transition-colors"
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
primary: "bg-blue-500 hover:bg-blue-600",
|
|
18
|
+
success: "bg-green-500 hover:bg-green-600",
|
|
19
|
+
info: "bg-sky-500 hover:bg-sky-600",
|
|
20
|
+
warning: "bg-yellow-500 hover:bg-yellow-600",
|
|
21
|
+
danger: "bg-red-500 hover:bg-red-600",
|
|
22
|
+
gray: ""
|
|
23
|
+
// usado solo en style="boxed"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
sm: "text-sm",
|
|
27
|
+
md: "text-base",
|
|
28
|
+
lg: "text-lg"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
style: "boxed",
|
|
33
|
+
color: "gray",
|
|
34
|
+
size: "md"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var fileInputClass = "absolute inset-0 w-full h-full opacity-0 cursor-pointer";
|
|
38
|
+
var fileIconClass = "w-6 h-6";
|
|
39
|
+
var fileLabelClass = "font-medium";
|
|
40
|
+
|
|
41
|
+
// src/components/upload/Upload.tsx
|
|
42
|
+
var Upload = (props) => {
|
|
43
|
+
const [local, variantProps, otherProps] = splitProps(
|
|
44
|
+
props,
|
|
45
|
+
[
|
|
46
|
+
"icon",
|
|
47
|
+
"label",
|
|
48
|
+
"multiple",
|
|
49
|
+
"disabled",
|
|
50
|
+
"accept",
|
|
51
|
+
"dragDrop",
|
|
52
|
+
"name",
|
|
53
|
+
"onChange"
|
|
54
|
+
],
|
|
55
|
+
["style", "color", "size"]
|
|
56
|
+
);
|
|
57
|
+
const handleChange = (e) => {
|
|
58
|
+
const files = e.target.files;
|
|
59
|
+
if (!files || files.length === 0) return;
|
|
60
|
+
const result = local.multiple ? Array.from(files) : files[0];
|
|
61
|
+
if (result) {
|
|
62
|
+
local.onChange?.(result);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const handleDrop = (e) => {
|
|
66
|
+
if (!local.dragDrop) return;
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
const files = e.dataTransfer?.files;
|
|
69
|
+
if (!files || files.length === 0) return;
|
|
70
|
+
const result = local.multiple ? Array.from(files) : files[0];
|
|
71
|
+
if (result) {
|
|
72
|
+
local.onChange?.(result);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const handleDragOver = (e) => {
|
|
76
|
+
if (local.dragDrop) e.preventDefault();
|
|
77
|
+
};
|
|
78
|
+
return <div class={uploadWrapperVariants(variantProps)}>
|
|
79
|
+
<label class="cursor-pointer relative w-full h-full">
|
|
80
|
+
<input
|
|
81
|
+
type="file"
|
|
82
|
+
class={fileInputClass}
|
|
83
|
+
name={local.name}
|
|
84
|
+
multiple={local.multiple}
|
|
85
|
+
accept={local.accept}
|
|
86
|
+
disabled={local.disabled}
|
|
87
|
+
onChange={handleChange}
|
|
88
|
+
{...otherProps}
|
|
89
|
+
/>
|
|
90
|
+
<div
|
|
91
|
+
class={classes(
|
|
92
|
+
variantProps.style === "boxed" ? "flex flex-col items-center justify-center gap-2" : "flex flex-row items-center justify-center gap-2"
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
<Show when={local.icon}>
|
|
96
|
+
<span class={fileIconClass}>{local.icon}</span>
|
|
97
|
+
</Show>
|
|
98
|
+
<span class={fileLabelClass}>{local.label}</span>
|
|
99
|
+
</div>
|
|
100
|
+
</label>
|
|
101
|
+
</div>;
|
|
102
|
+
};
|
|
103
|
+
var Upload_default = Upload;
|
|
104
|
+
|
|
105
|
+
// src/components/upload/index.ts
|
|
106
|
+
var upload_default = Upload_default;
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
upload_default
|
|
110
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "./P7WPLZNA.jsx";
|
|
4
|
+
|
|
5
|
+
// src/components/accordion/Accordion.tsx
|
|
6
|
+
import {
|
|
7
|
+
createSignal,
|
|
8
|
+
splitProps,
|
|
9
|
+
Show
|
|
10
|
+
} from "solid-js";
|
|
11
|
+
|
|
12
|
+
// src/components/accordion/Accordion.styles.ts
|
|
13
|
+
var accordionContainerVariants = cva(
|
|
14
|
+
["w-full border rounded transition-colors", "bg-white dark:bg-gray-800"],
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
expanded: {
|
|
18
|
+
true: "border-blue-500",
|
|
19
|
+
false: "border-gray-300 dark:border-gray-600"
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
true: "opacity-50 cursor-not-allowed",
|
|
23
|
+
false: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
expanded: false,
|
|
28
|
+
disabled: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
var accordionHeaderVariants = cva(
|
|
33
|
+
[
|
|
34
|
+
"w-full text-left px-4 py-2 flex items-center justify-between cursor-pointer",
|
|
35
|
+
"transition-colors duration-200"
|
|
36
|
+
],
|
|
37
|
+
{
|
|
38
|
+
variants: {
|
|
39
|
+
headerIsTrigger: {
|
|
40
|
+
true: "hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
41
|
+
false: ""
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
headerIsTrigger: true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
var accordionContentVariants = cva(
|
|
50
|
+
"px-4 py-2 border-t border-gray-200 dark:border-gray-700"
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// src/components/accordion/Accordion.tsx
|
|
54
|
+
var Accordion = (props) => {
|
|
55
|
+
const [local, variantProps, otherProps] = splitProps(
|
|
56
|
+
props,
|
|
57
|
+
["expanded", "disabled", "headerIsTrigger", "header", "content"],
|
|
58
|
+
["expanded", "disabled"]
|
|
59
|
+
);
|
|
60
|
+
const [isOpen, setIsOpen] = createSignal(local.expanded ?? false);
|
|
61
|
+
const handleToggle = () => {
|
|
62
|
+
if (!local.disabled) setIsOpen((prev) => !prev);
|
|
63
|
+
};
|
|
64
|
+
const handleKeyDown = local.headerIsTrigger ? (e) => {
|
|
65
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
handleToggle();
|
|
68
|
+
}
|
|
69
|
+
} : void 0;
|
|
70
|
+
return <div
|
|
71
|
+
class={accordionContainerVariants({
|
|
72
|
+
...variantProps,
|
|
73
|
+
expanded: isOpen(),
|
|
74
|
+
disabled: local.disabled
|
|
75
|
+
})}
|
|
76
|
+
onKeyDown={handleKeyDown}
|
|
77
|
+
role={local.headerIsTrigger ? "button" : void 0}
|
|
78
|
+
tabindex={local.headerIsTrigger ? "0" : void 0}
|
|
79
|
+
aria-expanded={local.headerIsTrigger ? isOpen() : void 0}
|
|
80
|
+
aria-disabled={local.disabled}
|
|
81
|
+
{...otherProps}
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
class={accordionHeaderVariants({
|
|
85
|
+
headerIsTrigger: local.headerIsTrigger
|
|
86
|
+
})}
|
|
87
|
+
onClick={local.headerIsTrigger ? handleToggle : void 0}
|
|
88
|
+
role={local.headerIsTrigger ? "button" : void 0}
|
|
89
|
+
>
|
|
90
|
+
{local.header}
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<Show when={isOpen()}>
|
|
94
|
+
<div class={accordionContentVariants()}>{local.content}</div>
|
|
95
|
+
</Show>
|
|
96
|
+
</div>;
|
|
97
|
+
};
|
|
98
|
+
var Accordion_default = Accordion;
|
|
99
|
+
|
|
100
|
+
// src/components/accordion/index.ts
|
|
101
|
+
var accordion_default = Accordion_default;
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
accordion_default
|
|
105
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { cva, classes } from './HKS7ET6T.js';
|
|
2
|
+
import { delegateEvents, template, className, spread, mergeProps, insert, memo, effect, style, setAttribute, createComponent } from 'solid-js/web';
|
|
3
|
+
import { splitProps, createSignal, createMemo, For } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/table/Table.styles.ts
|
|
6
|
+
var tableWrapper = cva(
|
|
7
|
+
"overflow-x-auto rounded-lg border border-gray-200 shadow"
|
|
8
|
+
);
|
|
9
|
+
var tableVariants = cva(
|
|
10
|
+
[
|
|
11
|
+
"min-w-full",
|
|
12
|
+
"text-sm text-left",
|
|
13
|
+
"divide-y divide-gray-100"
|
|
14
|
+
],
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
header: {
|
|
18
|
+
default: "bg-gray-50 font-semibold text-gray-700"
|
|
19
|
+
},
|
|
20
|
+
row: {
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
cell: {
|
|
24
|
+
default: "px-4 py-2"
|
|
25
|
+
},
|
|
26
|
+
divider: {
|
|
27
|
+
on: "border-r border-gray-200 last:border-r-0",
|
|
28
|
+
off: ""
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
header: "default",
|
|
33
|
+
row: "default",
|
|
34
|
+
cell: "default",
|
|
35
|
+
divider: "on"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// src/components/table/Table.tsx
|
|
41
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><table><thead><tr></tr></thead><tbody>`);
|
|
42
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<th role=columnheader>`);
|
|
43
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<tr>`);
|
|
44
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<td>`);
|
|
45
|
+
var Table = (props) => {
|
|
46
|
+
const [localProps, variantProps, otherProps] = splitProps(props, ["columns", "rows", "onSort", "className", "rowKey"], Object.keys(tableVariants.variantKeys ?? {}));
|
|
47
|
+
const [sortKey, setSortKey] = createSignal(null);
|
|
48
|
+
const [sortDir, setSortDir] = createSignal("asc");
|
|
49
|
+
const data = createMemo(() => localProps.rows);
|
|
50
|
+
const baseVars = () => variantProps;
|
|
51
|
+
const wrapperClass = classes(tableWrapper(), localProps.className);
|
|
52
|
+
const tableClass = classes(tableVariants(baseVars()), localProps.className);
|
|
53
|
+
const handleHeaderClick = (colKey, isSortable) => {
|
|
54
|
+
if (!isSortable) return;
|
|
55
|
+
const newDir = sortKey() === colKey && sortDir() === "asc" ? "desc" : "asc";
|
|
56
|
+
setSortKey(() => colKey);
|
|
57
|
+
setSortDir(newDir);
|
|
58
|
+
props.onSort?.(colKey, newDir);
|
|
59
|
+
};
|
|
60
|
+
return (() => {
|
|
61
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling;
|
|
62
|
+
className(_el$, wrapperClass);
|
|
63
|
+
spread(_el$2, mergeProps(otherProps, {
|
|
64
|
+
"class": tableClass
|
|
65
|
+
}), false, true);
|
|
66
|
+
insert(_el$4, () => localProps.columns.map((col) => (() => {
|
|
67
|
+
var _el$6 = _tmpl$2();
|
|
68
|
+
_el$6.$$click = () => handleHeaderClick(col.key, col.sortable);
|
|
69
|
+
insert(_el$6, () => col.header, null);
|
|
70
|
+
insert(_el$6, (() => {
|
|
71
|
+
var _c$ = memo(() => sortKey() === col.key);
|
|
72
|
+
return () => _c$() && (sortDir() === "asc" ? " \u2191" : " \u2193");
|
|
73
|
+
})(), null);
|
|
74
|
+
effect((_p$) => {
|
|
75
|
+
var _v$ = tableVariants({
|
|
76
|
+
...baseVars(),
|
|
77
|
+
cell: variantProps.cell,
|
|
78
|
+
divider: "on"
|
|
79
|
+
}), _v$2 = col.sortable ? {
|
|
80
|
+
cursor: "pointer"
|
|
81
|
+
} : void 0, _v$3 = sortKey() === col.key ? sortDir() === "asc" ? "ascending" : "descending" : void 0;
|
|
82
|
+
_v$ !== _p$.e && className(_el$6, _p$.e = _v$);
|
|
83
|
+
_p$.t = style(_el$6, _v$2, _p$.t);
|
|
84
|
+
_v$3 !== _p$.a && setAttribute(_el$6, "aria-sort", _p$.a = _v$3);
|
|
85
|
+
return _p$;
|
|
86
|
+
}, {
|
|
87
|
+
e: void 0,
|
|
88
|
+
t: void 0,
|
|
89
|
+
a: void 0
|
|
90
|
+
});
|
|
91
|
+
return _el$6;
|
|
92
|
+
})()));
|
|
93
|
+
insert(_el$5, createComponent(For, {
|
|
94
|
+
get each() {
|
|
95
|
+
return data();
|
|
96
|
+
},
|
|
97
|
+
children: (row) => (() => {
|
|
98
|
+
var _el$7 = _tmpl$3();
|
|
99
|
+
insert(_el$7, () => localProps.columns.map((col, ci) => (() => {
|
|
100
|
+
var _el$8 = _tmpl$4();
|
|
101
|
+
insert(_el$8, () => String(row[col.key] ?? ""));
|
|
102
|
+
effect(() => className(_el$8, tableVariants({
|
|
103
|
+
...baseVars(),
|
|
104
|
+
cell: variantProps.cell,
|
|
105
|
+
divider: ci === localProps.columns.length - 1 ? "off" : "on"
|
|
106
|
+
})));
|
|
107
|
+
return _el$8;
|
|
108
|
+
})()));
|
|
109
|
+
effect(() => className(_el$7, tableVariants({
|
|
110
|
+
...baseVars(),
|
|
111
|
+
row: variantProps.row
|
|
112
|
+
})));
|
|
113
|
+
return _el$7;
|
|
114
|
+
})()
|
|
115
|
+
}));
|
|
116
|
+
return _el$;
|
|
117
|
+
})();
|
|
118
|
+
};
|
|
119
|
+
var Table_default = Table;
|
|
120
|
+
delegateEvents(["click"]);
|
|
121
|
+
|
|
122
|
+
// src/components/table/index.ts
|
|
123
|
+
var table_default = Table_default;
|
|
124
|
+
|
|
125
|
+
export { table_default };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { cva, classes } from './HKS7ET6T.js';
|
|
2
|
+
import { template, className, spread, mergeProps, insert, createComponent, effect } from 'solid-js/web';
|
|
3
|
+
import { splitProps, Show } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/upload/Upload.styles.ts
|
|
6
|
+
var uploadWrapperVariants = cva("", {
|
|
7
|
+
variants: {
|
|
8
|
+
style: {
|
|
9
|
+
boxed: "flex flex-col items-center justify-center border border-gray-300 rounded-md p-4 bg-white dark:bg-gray-800 text-gray-700 hover:text-gray-900 text-center",
|
|
10
|
+
button: "px-4 py-2 rounded inline-flex items-center gap-2 text-white transition-colors"
|
|
11
|
+
},
|
|
12
|
+
color: {
|
|
13
|
+
primary: "bg-blue-500 hover:bg-blue-600",
|
|
14
|
+
success: "bg-green-500 hover:bg-green-600",
|
|
15
|
+
info: "bg-sky-500 hover:bg-sky-600",
|
|
16
|
+
warning: "bg-yellow-500 hover:bg-yellow-600",
|
|
17
|
+
danger: "bg-red-500 hover:bg-red-600",
|
|
18
|
+
gray: ""
|
|
19
|
+
// usado solo en style="boxed"
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
sm: "text-sm",
|
|
23
|
+
md: "text-base",
|
|
24
|
+
lg: "text-lg"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
style: "boxed",
|
|
29
|
+
color: "gray",
|
|
30
|
+
size: "md"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var fileInputClass = "absolute inset-0 w-full h-full opacity-0 cursor-pointer";
|
|
34
|
+
var fileIconClass = "w-6 h-6";
|
|
35
|
+
var fileLabelClass = "font-medium";
|
|
36
|
+
|
|
37
|
+
// src/components/upload/Upload.tsx
|
|
38
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
39
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div><label class="cursor-pointer relative w-full h-full"><input type=file><div><span>`);
|
|
40
|
+
var Upload = (props) => {
|
|
41
|
+
const [local, variantProps, otherProps] = splitProps(props, ["icon", "label", "multiple", "disabled", "accept", "dragDrop", "name", "onChange"], ["style", "color", "size"]);
|
|
42
|
+
const handleChange = (e) => {
|
|
43
|
+
const files = e.target.files;
|
|
44
|
+
if (!files || files.length === 0) return;
|
|
45
|
+
const result = local.multiple ? Array.from(files) : files[0];
|
|
46
|
+
if (result) {
|
|
47
|
+
local.onChange?.(result);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (() => {
|
|
51
|
+
var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$6 = _el$4.firstChild;
|
|
52
|
+
_el$3.addEventListener("change", handleChange);
|
|
53
|
+
className(_el$3, fileInputClass);
|
|
54
|
+
spread(_el$3, mergeProps({
|
|
55
|
+
get name() {
|
|
56
|
+
return local.name;
|
|
57
|
+
},
|
|
58
|
+
get multiple() {
|
|
59
|
+
return local.multiple;
|
|
60
|
+
},
|
|
61
|
+
get accept() {
|
|
62
|
+
return local.accept;
|
|
63
|
+
},
|
|
64
|
+
get disabled() {
|
|
65
|
+
return local.disabled;
|
|
66
|
+
}
|
|
67
|
+
}, otherProps), false, false);
|
|
68
|
+
insert(_el$4, createComponent(Show, {
|
|
69
|
+
get when() {
|
|
70
|
+
return local.icon;
|
|
71
|
+
},
|
|
72
|
+
get children() {
|
|
73
|
+
var _el$5 = _tmpl$();
|
|
74
|
+
className(_el$5, fileIconClass);
|
|
75
|
+
insert(_el$5, () => local.icon);
|
|
76
|
+
return _el$5;
|
|
77
|
+
}
|
|
78
|
+
}), _el$6);
|
|
79
|
+
className(_el$6, fileLabelClass);
|
|
80
|
+
insert(_el$6, () => local.label);
|
|
81
|
+
effect((_p$) => {
|
|
82
|
+
var _v$ = uploadWrapperVariants(variantProps), _v$2 = classes(variantProps.style === "boxed" ? "flex flex-col items-center justify-center gap-2" : "flex flex-row items-center justify-center gap-2");
|
|
83
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
84
|
+
_v$2 !== _p$.t && className(_el$4, _p$.t = _v$2);
|
|
85
|
+
return _p$;
|
|
86
|
+
}, {
|
|
87
|
+
e: void 0,
|
|
88
|
+
t: void 0
|
|
89
|
+
});
|
|
90
|
+
return _el$;
|
|
91
|
+
})();
|
|
92
|
+
};
|
|
93
|
+
var Upload_default = Upload;
|
|
94
|
+
|
|
95
|
+
// src/components/upload/index.ts
|
|
96
|
+
var upload_default = Upload_default;
|
|
97
|
+
|
|
98
|
+
export { upload_default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buttonVariants
|
|
3
|
+
} from "./YAQK2KFY.jsx";
|
|
4
|
+
import {
|
|
5
|
+
PolymorphicButton_default
|
|
6
|
+
} from "./KACNXPUM.jsx";
|
|
7
|
+
|
|
8
|
+
// src/components/button/Button.tsx
|
|
9
|
+
import {
|
|
10
|
+
mergeProps,
|
|
11
|
+
splitProps,
|
|
12
|
+
createMemo
|
|
13
|
+
} from "solid-js";
|
|
14
|
+
var Button = (props) => {
|
|
15
|
+
const defaultedProps = mergeProps(
|
|
16
|
+
{
|
|
17
|
+
color: "primary"
|
|
18
|
+
},
|
|
19
|
+
props
|
|
20
|
+
);
|
|
21
|
+
const [variantProps, otherProps] = splitProps(defaultedProps, [
|
|
22
|
+
"class",
|
|
23
|
+
...buttonVariants.variantKeys
|
|
24
|
+
]);
|
|
25
|
+
const classes = createMemo(() => buttonVariants(variantProps));
|
|
26
|
+
return <PolymorphicButton_default
|
|
27
|
+
class={classes()}
|
|
28
|
+
aria-busy={variantProps.loading ? "true" : void 0}
|
|
29
|
+
{...otherProps}
|
|
30
|
+
/>;
|
|
31
|
+
};
|
|
32
|
+
var Button_default = Button;
|
|
33
|
+
|
|
34
|
+
// src/components/button/index.ts
|
|
35
|
+
var button_default = Button_default;
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
button_default
|
|
39
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/progress/Progress.tsx
|
|
7
|
+
import {
|
|
8
|
+
splitProps,
|
|
9
|
+
Show,
|
|
10
|
+
createMemo
|
|
11
|
+
} from "solid-js";
|
|
12
|
+
|
|
13
|
+
// src/components/progress/Progress.styles.ts
|
|
14
|
+
var progressContainer = cva(
|
|
15
|
+
"relative w-full max-w-md select-none",
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
sm: "",
|
|
20
|
+
md: "",
|
|
21
|
+
lg: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { size: "md" }
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
var progressWrapper = cva("overflow-hidden bg-gray-200", {
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
sm: "h-2",
|
|
31
|
+
md: "h-4",
|
|
32
|
+
lg: "h-6"
|
|
33
|
+
},
|
|
34
|
+
shape: {
|
|
35
|
+
rounded: "rounded-lg",
|
|
36
|
+
circle: "rounded-full"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
size: "md",
|
|
41
|
+
shape: "rounded"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var progressFill = cva("h-full transition-all duration-300", {
|
|
45
|
+
variants: {
|
|
46
|
+
color: {
|
|
47
|
+
default: "bg-gray-500",
|
|
48
|
+
danger: "bg-red-500",
|
|
49
|
+
success: "bg-green-500",
|
|
50
|
+
info: "bg-blue-500",
|
|
51
|
+
warning: "bg-yellow-500"
|
|
52
|
+
},
|
|
53
|
+
variant: {
|
|
54
|
+
filled: "",
|
|
55
|
+
outlined: "bg-opacity-0 ring-1 ring-gray-300",
|
|
56
|
+
ghost: "bg-opacity-50"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
color: "default",
|
|
61
|
+
variant: "filled"
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var progressLabel = cva(
|
|
65
|
+
"absolute top-0 right-0 h-full flex items-center pr-2 text-xs font-medium text-gray-700"
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
// src/components/progress/Progress.tsx
|
|
69
|
+
var Progress = (props) => {
|
|
70
|
+
const [local, rest] = splitProps(props, [
|
|
71
|
+
"value",
|
|
72
|
+
"size",
|
|
73
|
+
"shape",
|
|
74
|
+
"variant",
|
|
75
|
+
"color",
|
|
76
|
+
"showValue",
|
|
77
|
+
"format",
|
|
78
|
+
"className"
|
|
79
|
+
]);
|
|
80
|
+
const val = createMemo(
|
|
81
|
+
() => typeof local.value === "number" ? Math.max(0, Math.min(100, local.value)) : null
|
|
82
|
+
);
|
|
83
|
+
const isDeterminate = () => val() !== null;
|
|
84
|
+
const labelText = createMemo(() => {
|
|
85
|
+
if (!local.showValue || val() == null) return "";
|
|
86
|
+
return local.format === "percent" ? `${val()}%` : String(val());
|
|
87
|
+
});
|
|
88
|
+
return <div
|
|
89
|
+
{...rest}
|
|
90
|
+
class={classes(progressContainer({ size: local.size }), local.className)}
|
|
91
|
+
aria-busy={!isDeterminate()}
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
class={classes(
|
|
95
|
+
progressWrapper({ size: local.size, shape: local.shape })
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
<Show
|
|
99
|
+
when={isDeterminate()}
|
|
100
|
+
fallback={<div
|
|
101
|
+
class={classes(
|
|
102
|
+
progressFill({ color: local.color, variant: local.variant }),
|
|
103
|
+
"animate-pulse"
|
|
104
|
+
)}
|
|
105
|
+
style={{ width: "100%" }}
|
|
106
|
+
/>}
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
class={progressFill({
|
|
110
|
+
color: local.color,
|
|
111
|
+
variant: local.variant
|
|
112
|
+
})}
|
|
113
|
+
style={{ width: `${val()}%` }}
|
|
114
|
+
/>
|
|
115
|
+
</Show>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<Show when={local.showValue && labelText()}>
|
|
119
|
+
<div class={progressLabel()}>{labelText()}</div>
|
|
120
|
+
</Show>
|
|
121
|
+
</div>;
|
|
122
|
+
};
|
|
123
|
+
var Progress_default = Progress;
|
|
124
|
+
|
|
125
|
+
// src/components/progress/index.ts
|
|
126
|
+
var progress_default = Progress_default;
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
progress_default
|
|
130
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { PolymorphicButton_default } from './G6RG4LR7.js';
|
|
2
1
|
import { cva } from './HKS7ET6T.js';
|
|
3
|
-
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
4
|
-
import { mergeProps, splitProps, createMemo } from 'solid-js';
|
|
5
2
|
|
|
6
3
|
// src/components/button/Button.styles.ts
|
|
7
4
|
var buttonVariants = cva(
|
|
@@ -190,25 +187,4 @@ var buttonVariants = cva(
|
|
|
190
187
|
}
|
|
191
188
|
);
|
|
192
189
|
|
|
193
|
-
|
|
194
|
-
var Button = (props) => {
|
|
195
|
-
const defaultedProps = mergeProps({
|
|
196
|
-
color: "primary"
|
|
197
|
-
}, props);
|
|
198
|
-
const [variantProps, otherProps] = splitProps(defaultedProps, ["class", ...buttonVariants.variantKeys]);
|
|
199
|
-
const classes = createMemo(() => buttonVariants(variantProps));
|
|
200
|
-
return createComponent(PolymorphicButton_default, mergeProps$1({
|
|
201
|
-
get ["class"]() {
|
|
202
|
-
return classes();
|
|
203
|
-
},
|
|
204
|
-
get ["aria-busy"]() {
|
|
205
|
-
return variantProps.loading ? "true" : void 0;
|
|
206
|
-
}
|
|
207
|
-
}, otherProps));
|
|
208
|
-
};
|
|
209
|
-
var Button_default = Button;
|
|
210
|
-
|
|
211
|
-
// src/components/button/index.ts
|
|
212
|
-
var button_default = Button_default;
|
|
213
|
-
|
|
214
|
-
export { button_default };
|
|
190
|
+
export { buttonVariants };
|