@pathscale/ui 0.0.11 → 0.0.12
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 +53 -0
- package/dist/{Autocomplete-BLKN_nG8.d.ts → Autocomplete-gLkjMHrc.d.ts} +1 -1
- package/dist/Avatar-Dkd_kPlV.d.ts +40 -0
- package/dist/CollapseTitle-BNxog3is.d.ts +12 -0
- package/dist/{Field-DfUn85_1.d.ts → Field-DI2PA30N.d.ts} +1 -1
- package/dist/Mask-CPb596Mg.d.ts +16 -0
- package/dist/Menu-DgO4SHmA.d.ts +45 -0
- package/dist/{Progress-gN0xqhAF.d.ts → Progress-ChF4ior8.d.ts} +2 -2
- package/dist/Steps-Dk-UPL6r.d.ts +38 -0
- package/dist/{Tabs-BNR3p92D.d.ts → Tabs-WiUU0xsM.d.ts} +1 -1
- package/dist/chunk/2OJYONJ3.js +40 -0
- package/dist/chunk/2VQ2762Z.js +80 -0
- package/dist/chunk/2XPPNBYK.js +164 -0
- package/dist/chunk/3I23P4TJ.js +33 -0
- package/dist/chunk/5HG7XWVC.jsx +2956 -0
- package/dist/chunk/5IJ7WEIF.js +43 -0
- package/dist/chunk/5O6WC3OB.jsx +67 -0
- package/dist/chunk/6P5JIKPF.jsx +51 -0
- package/dist/chunk/BHLLVOVR.js +46 -0
- package/dist/chunk/DJI5XKAV.js +31 -0
- package/dist/chunk/DN3P54J2.jsx +43 -0
- package/dist/chunk/DVFQAAZR.js +43 -0
- package/dist/chunk/EDDBK4J6.js +42 -0
- package/dist/chunk/FZRQDGPD.jsx +54 -0
- package/dist/chunk/G5UEZ2VC.js +49 -0
- package/dist/chunk/GL7JG772.js +114 -0
- package/dist/chunk/HEOKGP5U.js +55 -0
- package/dist/chunk/HUHXQCKK.js +16 -0
- package/dist/chunk/I36LHZUY.jsx +31 -0
- package/dist/chunk/IG323YKF.jsx +50 -0
- package/dist/chunk/JQ4HSRDP.js +142 -0
- package/dist/chunk/JSQBKK7L.jsx +50 -0
- package/dist/chunk/K3WO7SRD.js +1 -0
- package/dist/chunk/KQ3RAWCE.jsx +57 -0
- package/dist/chunk/KXJZKDJX.jsx +0 -0
- package/dist/chunk/L4A67X7S.js +7 -0
- package/dist/chunk/LGDDR242.jsx +159 -0
- package/dist/chunk/MM2DZQL3.js +46 -0
- package/dist/chunk/MZWBWFDD.js +151 -0
- package/dist/chunk/O7LDJCQS.jsx +18 -0
- package/dist/chunk/Q4442PU4.js +42 -0
- package/dist/chunk/R5G3PODL.jsx +11 -0
- package/dist/chunk/R6ZBT7CY.jsx +55 -0
- package/dist/chunk/RHEFVSMJ.jsx +52 -0
- package/dist/chunk/STFCLC5R.js +2954 -0
- package/dist/chunk/SVJIYMYJ.jsx +156 -0
- package/dist/chunk/SYWB4UN3.jsx +64 -0
- package/dist/chunk/UNKDNDT3.js +62 -0
- package/dist/chunk/XM3KF5LV.jsx +179 -0
- package/dist/chunk/XQCSYRVP.jsx +168 -0
- package/dist/chunk/YWIT2MRI.jsx +43 -0
- package/dist/chunk/ZYEP35R3.jsx +60 -0
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/accordion/index.d.ts +17 -5
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.jsx +6 -4
- package/dist/components/autocomplete/index.d.ts +2 -2
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.jsx +3 -2
- package/dist/components/badge/index.d.ts +17 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/index.jsx +8 -0
- package/dist/components/breadcrumbs/index.d.ts +9 -0
- package/dist/components/breadcrumbs/index.js +1 -0
- package/dist/components/breadcrumbs/index.jsx +7 -0
- package/dist/components/button/index.d.ts +28 -6
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.jsx +5 -5
- package/dist/components/checkbox/index.d.ts +13 -5
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +5 -4
- package/dist/components/collapse/index.d.ts +15 -0
- package/dist/components/collapse/index.js +1 -0
- package/dist/components/collapse/index.jsx +14 -0
- package/dist/components/field/index.d.ts +1 -1
- package/dist/components/fileinput/index.d.ts +16 -0
- package/dist/components/fileinput/index.js +1 -0
- package/dist/components/fileinput/index.jsx +8 -0
- package/dist/components/input/index.d.ts +13 -8
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.jsx +5 -6
- package/dist/components/join/index.d.ts +11 -0
- package/dist/components/join/index.js +1 -0
- package/dist/components/join/index.jsx +9 -0
- package/dist/components/mask/index.d.ts +7 -0
- package/dist/components/mask/index.js +1 -0
- package/dist/components/mask/index.jsx +8 -0
- package/dist/components/menu/index.d.ts +6 -64
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.jsx +4 -7
- package/dist/components/pagination/index.d.ts +6 -6
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/index.jsx +6 -4
- package/dist/components/polymorphic/index.d.ts +1 -1
- package/dist/components/select/index.d.ts +12 -5
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.jsx +5 -4
- package/dist/components/steps/index.d.ts +3 -4
- package/dist/components/steps/index.js +1 -1
- package/dist/components/steps/index.jsx +3 -2
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/textarea/index.d.ts +12 -5
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/textarea/index.jsx +5 -4
- package/dist/components/toggle/index.d.ts +15 -0
- package/dist/components/toggle/index.js +1 -0
- package/dist/components/toggle/index.jsx +8 -0
- package/dist/components/tooltip/index.d.ts +14 -5
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.jsx +5 -4
- package/dist/index.d.ts +24 -19
- package/dist/index.js +23 -20
- package/dist/index.jsx +81 -66
- package/dist/types-CUG9pToa.d.ts +15 -0
- package/package.json +4 -2
- package/dist/Accordion-nwuRbRRw.d.ts +0 -27
- package/dist/Avatar-CzIirpVq.d.ts +0 -33
- package/dist/Button-B50OLXuV.d.ts +0 -63
- package/dist/Checkbox-CzeDsQLA.d.ts +0 -32
- package/dist/Input-X4gwIB-F.d.ts +0 -42
- package/dist/Pagination-CJtlFMHy.d.ts +0 -43
- package/dist/Select-CP-TUHJv.d.ts +0 -44
- package/dist/Steps-1miUeyCD.d.ts +0 -34
- package/dist/Switch-CW6QtO1Y.d.ts +0 -76
- package/dist/Tag-BPrhn-Ne.d.ts +0 -42
- package/dist/Textarea-Cpdk7m6S.d.ts +0 -37
- package/dist/Tooltip-BfPongoz.d.ts +0 -53
- package/dist/Upload-CRljD5jf.d.ts +0 -39
- package/dist/chunk/3VOILEMN.js +0 -187
- package/dist/chunk/C4745OZS.jsx +0 -101
- package/dist/chunk/CJZGTNJZ.js +0 -115
- package/dist/chunk/DBQ7IOPU.js +0 -189
- package/dist/chunk/EB7KXR65.js +0 -102
- package/dist/chunk/EE4HXMKA.js +0 -165
- package/dist/chunk/ELRAUORW.jsx +0 -179
- package/dist/chunk/F33TSIEQ.jsx +0 -181
- package/dist/chunk/GWFGP2JQ.jsx +0 -179
- package/dist/chunk/LAQPAV5I.jsx +0 -187
- package/dist/chunk/LI3HCFL7.jsx +0 -132
- package/dist/chunk/LMPV5G35.jsx +0 -228
- package/dist/chunk/MI773TMC.js +0 -107
- package/dist/chunk/MMTAND25.jsx +0 -126
- package/dist/chunk/NZKPDBTE.js +0 -118
- package/dist/chunk/O2IMHWMY.js +0 -159
- package/dist/chunk/OMRJVDZV.js +0 -173
- package/dist/chunk/OYAKKETQ.js +0 -111
- package/dist/chunk/PF47YREI.js +0 -214
- package/dist/chunk/PNPC2OI3.jsx +0 -156
- package/dist/chunk/QHJOIUYT.jsx +0 -117
- package/dist/chunk/QONDPQ2I.jsx +0 -105
- package/dist/chunk/R6COBCN7.jsx +0 -100
- package/dist/chunk/T7IZ26YC.jsx +0 -194
- package/dist/chunk/TT2JYGLU.js +0 -218
- package/dist/chunk/V6Y5E7BL.js +0 -133
- package/dist/chunk/WB6NEEQV.jsx +0 -107
- package/dist/chunk/WYHYWDOM.js +0 -164
- package/dist/chunk/XD34JKSU.jsx +0 -201
- package/dist/chunk/YDEDUOFM.js +0 -102
- package/dist/components/breadcrumb/index.d.ts +0 -47
- package/dist/components/breadcrumb/index.js +0 -1
- package/dist/components/breadcrumb/index.jsx +0 -9
- package/dist/components/switch/index.d.ts +0 -8
- package/dist/components/switch/index.js +0 -1
- package/dist/components/switch/index.jsx +0 -7
- package/dist/components/tag/index.d.ts +0 -8
- package/dist/components/tag/index.js +0 -1
- package/dist/components/tag/index.jsx +0 -7
- package/dist/components/upload/index.d.ts +0 -8
- package/dist/components/upload/index.js +0 -1
- package/dist/components/upload/index.jsx +0 -7
package/dist/chunk/ELRAUORW.jsx
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cva
|
|
3
|
-
} from "./P7WPLZNA.jsx";
|
|
4
|
-
|
|
5
|
-
// src/components/pagination/Pagination.tsx
|
|
6
|
-
import {
|
|
7
|
-
splitProps,
|
|
8
|
-
createMemo,
|
|
9
|
-
Show,
|
|
10
|
-
For
|
|
11
|
-
} from "solid-js";
|
|
12
|
-
|
|
13
|
-
// src/components/pagination/Pagination.styles.ts
|
|
14
|
-
var paginationItemVariants = cva(
|
|
15
|
-
[
|
|
16
|
-
"inline-flex items-center justify-center font-medium transition-colors",
|
|
17
|
-
"select-none border border-transparent",
|
|
18
|
-
// border shown only when needed
|
|
19
|
-
"disabled:opacity-50 disabled:pointer-events-none"
|
|
20
|
-
],
|
|
21
|
-
{
|
|
22
|
-
variants: {
|
|
23
|
-
active: {
|
|
24
|
-
true: "bg-blue-500 text-white hover:bg-blue-600",
|
|
25
|
-
false: "bg-transparent text-gray-700 hover:bg-gray-200 dark:text-gray-200 dark:hover:bg-gray-700"
|
|
26
|
-
},
|
|
27
|
-
rounded: {
|
|
28
|
-
true: "rounded-full",
|
|
29
|
-
false: "rounded"
|
|
30
|
-
},
|
|
31
|
-
simple: {
|
|
32
|
-
true: "border-none bg-transparent hover:bg-transparent text-gray-700 dark:text-gray-300",
|
|
33
|
-
false: ""
|
|
34
|
-
},
|
|
35
|
-
size: {
|
|
36
|
-
sm: "text-xs px-2 py-1",
|
|
37
|
-
md: "text-sm px-3 py-1.5",
|
|
38
|
-
lg: "text-base px-4 py-2"
|
|
39
|
-
},
|
|
40
|
-
disabled: {
|
|
41
|
-
true: "opacity-50 pointer-events-none",
|
|
42
|
-
false: ""
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
defaultVariants: {
|
|
46
|
-
active: false,
|
|
47
|
-
rounded: false,
|
|
48
|
-
simple: false,
|
|
49
|
-
size: "md",
|
|
50
|
-
disabled: false
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
var paginationInfoVariants = cva(
|
|
55
|
-
"inline-block font-medium transition-colors",
|
|
56
|
-
{
|
|
57
|
-
variants: {
|
|
58
|
-
simple: {
|
|
59
|
-
true: "text-sm text-gray-600 dark:text-gray-300 px-2",
|
|
60
|
-
false: "text-sm text-gray-700 dark:text-gray-200 px-2"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
defaultVariants: {
|
|
64
|
-
simple: false
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
var paginationContainerVariants = cva(
|
|
69
|
-
"flex items-center gap-1 flex-wrap",
|
|
70
|
-
{
|
|
71
|
-
variants: {
|
|
72
|
-
align: {
|
|
73
|
-
start: "justify-start",
|
|
74
|
-
center: "justify-center",
|
|
75
|
-
end: "justify-end"
|
|
76
|
-
},
|
|
77
|
-
wrap: {
|
|
78
|
-
true: "flex-wrap",
|
|
79
|
-
false: "flex-nowrap"
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
defaultVariants: {
|
|
83
|
-
align: "start",
|
|
84
|
-
wrap: true
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
// src/components/pagination/Pagination.tsx
|
|
90
|
-
var Pagination = (props) => {
|
|
91
|
-
const [local, variantProps, otherProps] = splitProps(
|
|
92
|
-
props,
|
|
93
|
-
[
|
|
94
|
-
"total",
|
|
95
|
-
"perPage",
|
|
96
|
-
"current",
|
|
97
|
-
"onChange",
|
|
98
|
-
"rangeBefore",
|
|
99
|
-
"rangeAfter",
|
|
100
|
-
"simple",
|
|
101
|
-
"children"
|
|
102
|
-
],
|
|
103
|
-
["rounded", "size", "disabled", "active", "simple"]
|
|
104
|
-
);
|
|
105
|
-
const perPage = () => local.perPage ?? 20;
|
|
106
|
-
const pageCount = createMemo(() => Math.ceil(local.total / perPage()));
|
|
107
|
-
const hasPrev = createMemo(() => local.current > 1);
|
|
108
|
-
const hasNext = createMemo(() => local.current < pageCount());
|
|
109
|
-
const pagesInRange = createMemo(() => {
|
|
110
|
-
const before = local.rangeBefore ?? 1;
|
|
111
|
-
const after = local.rangeAfter ?? 1;
|
|
112
|
-
const start = Math.max(1, local.current - before);
|
|
113
|
-
const end = Math.min(local.current + after, pageCount());
|
|
114
|
-
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
115
|
-
});
|
|
116
|
-
const changePage = (page) => {
|
|
117
|
-
if (page >= 1 && page <= pageCount() && page !== local.current) {
|
|
118
|
-
local.onChange(page);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
return <nav
|
|
122
|
-
class={paginationContainerVariants({ align: "start", wrap: true })}
|
|
123
|
-
{...otherProps}
|
|
124
|
-
>
|
|
125
|
-
<button
|
|
126
|
-
class={paginationItemVariants({
|
|
127
|
-
...variantProps,
|
|
128
|
-
disabled: !hasPrev()
|
|
129
|
-
})}
|
|
130
|
-
onClick={() => changePage(local.current - 1)}
|
|
131
|
-
disabled={!hasPrev()}
|
|
132
|
-
>
|
|
133
|
-
«
|
|
134
|
-
</button>
|
|
135
|
-
|
|
136
|
-
<Show when={pageCount() > 1}>
|
|
137
|
-
<Show when={local.simple}>
|
|
138
|
-
<span class={paginationInfoVariants({ simple: true })}>
|
|
139
|
-
{perPage() === 1 ? `${(local.current - 1) * perPage() + 1} / ${local.total}` : `${(local.current - 1) * perPage() + 1}-${Math.min(
|
|
140
|
-
local.current * perPage(),
|
|
141
|
-
local.total
|
|
142
|
-
)} / ${local.total}`}
|
|
143
|
-
</span>
|
|
144
|
-
</Show>
|
|
145
|
-
|
|
146
|
-
<Show when={!local.simple}>
|
|
147
|
-
<For each={pagesInRange()}>
|
|
148
|
-
{(page) => <button
|
|
149
|
-
class={paginationItemVariants({
|
|
150
|
-
...variantProps,
|
|
151
|
-
active: page === local.current
|
|
152
|
-
})}
|
|
153
|
-
onClick={() => changePage(page)}
|
|
154
|
-
>
|
|
155
|
-
{page}
|
|
156
|
-
</button>}
|
|
157
|
-
</For>
|
|
158
|
-
</Show>
|
|
159
|
-
</Show>
|
|
160
|
-
<button
|
|
161
|
-
class={paginationItemVariants({
|
|
162
|
-
...variantProps,
|
|
163
|
-
disabled: !hasNext()
|
|
164
|
-
})}
|
|
165
|
-
onClick={() => changePage(local.current + 1)}
|
|
166
|
-
disabled={!hasNext()}
|
|
167
|
-
>
|
|
168
|
-
»
|
|
169
|
-
</button>
|
|
170
|
-
</nav>;
|
|
171
|
-
};
|
|
172
|
-
var Pagination_default = Pagination;
|
|
173
|
-
|
|
174
|
-
// src/components/pagination/index.ts
|
|
175
|
-
var pagination_default = Pagination_default;
|
|
176
|
-
|
|
177
|
-
export {
|
|
178
|
-
pagination_default
|
|
179
|
-
};
|
package/dist/chunk/F33TSIEQ.jsx
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
classes,
|
|
3
|
-
cva
|
|
4
|
-
} from "./P7WPLZNA.jsx";
|
|
5
|
-
|
|
6
|
-
// src/components/select/Select.tsx
|
|
7
|
-
import {
|
|
8
|
-
splitProps,
|
|
9
|
-
Show,
|
|
10
|
-
createMemo,
|
|
11
|
-
untrack
|
|
12
|
-
} from "solid-js";
|
|
13
|
-
|
|
14
|
-
// src/components/select/Select.styles.ts
|
|
15
|
-
var selectVariants = cva(
|
|
16
|
-
[
|
|
17
|
-
"flex items-center appearance-none",
|
|
18
|
-
"border outline-none",
|
|
19
|
-
"transition bg-white text-gray-700",
|
|
20
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
21
|
-
"pl-3"
|
|
22
|
-
// margen izquierdo por defecto
|
|
23
|
-
],
|
|
24
|
-
{
|
|
25
|
-
variants: {
|
|
26
|
-
size: {
|
|
27
|
-
sm: "text-sm py-1 px-2",
|
|
28
|
-
md: "text-base py-2 px-3",
|
|
29
|
-
lg: "text-lg py-2 px-4"
|
|
30
|
-
},
|
|
31
|
-
color: {
|
|
32
|
-
primary: "border border-gray-300 focus:border-primary",
|
|
33
|
-
info: "border border-blue-500 focus:border-blue-600",
|
|
34
|
-
success: "border border-green-500 focus:border-green-600",
|
|
35
|
-
warning: "border border-yellow-500 focus:border-yellow-600",
|
|
36
|
-
danger: "border border-red-500 focus:border-red-600"
|
|
37
|
-
},
|
|
38
|
-
loading: {
|
|
39
|
-
true: "cursor-wait opacity-75",
|
|
40
|
-
false: ""
|
|
41
|
-
},
|
|
42
|
-
expanded: {
|
|
43
|
-
true: "w-full",
|
|
44
|
-
false: "w-fit"
|
|
45
|
-
},
|
|
46
|
-
rounded: {
|
|
47
|
-
true: "rounded",
|
|
48
|
-
false: "rounded-none"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
defaultVariants: {
|
|
52
|
-
size: "md",
|
|
53
|
-
color: "primary",
|
|
54
|
-
loading: false,
|
|
55
|
-
expanded: false,
|
|
56
|
-
rounded: false
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
var wrapperClass = "relative w-full group cursor-pointer";
|
|
61
|
-
var selectPaddingClass = "w-full pr-8";
|
|
62
|
-
var caretIconBaseClass = "absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors";
|
|
63
|
-
var spinnerIconBaseClass = "absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 animate-spin pointer-events-none";
|
|
64
|
-
var getIconColor = (color) => {
|
|
65
|
-
switch (color) {
|
|
66
|
-
case "success":
|
|
67
|
-
return "text-green-500 group-hover:text-green-600";
|
|
68
|
-
case "danger":
|
|
69
|
-
return "text-red-500 group-hover:text-red-600";
|
|
70
|
-
case "warning":
|
|
71
|
-
return "text-yellow-500 group-hover:text-yellow-600";
|
|
72
|
-
case "info":
|
|
73
|
-
return "text-blue-500 group-hover:text-blue-600";
|
|
74
|
-
case "primary":
|
|
75
|
-
default:
|
|
76
|
-
return "text-gray-500 group-hover:text-gray-700";
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
var getSpinnerColor = (color) => {
|
|
80
|
-
switch (color) {
|
|
81
|
-
case "success":
|
|
82
|
-
return "text-green-500";
|
|
83
|
-
case "danger":
|
|
84
|
-
return "text-red-500";
|
|
85
|
-
case "warning":
|
|
86
|
-
return "text-yellow-500";
|
|
87
|
-
case "info":
|
|
88
|
-
return "text-blue-500";
|
|
89
|
-
case "primary":
|
|
90
|
-
default:
|
|
91
|
-
return "text-gray-500";
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// src/components/select/CaretDownIcon.tsx
|
|
96
|
-
var CaretDownIcon = (props) => <svg
|
|
97
|
-
class={`${caretIconBaseClass} ${props.class ?? ""}`}
|
|
98
|
-
fill="none"
|
|
99
|
-
stroke="currentColor"
|
|
100
|
-
stroke-width="2"
|
|
101
|
-
viewBox="0 0 24 24"
|
|
102
|
-
>
|
|
103
|
-
<path d="M6 9l6 6 6-6" />
|
|
104
|
-
</svg>;
|
|
105
|
-
var CaretDownIcon_default = CaretDownIcon;
|
|
106
|
-
|
|
107
|
-
// src/components/select/SpinnerIcon.tsx
|
|
108
|
-
var SpinnerIcon = (props) => <svg
|
|
109
|
-
class={`${spinnerIconBaseClass} ${props.class ?? ""}`}
|
|
110
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
111
|
-
fill="none"
|
|
112
|
-
viewBox="0 0 24 24"
|
|
113
|
-
stroke-width="2"
|
|
114
|
-
>
|
|
115
|
-
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" />
|
|
116
|
-
<path
|
|
117
|
-
class="opacity-75"
|
|
118
|
-
fill="currentColor"
|
|
119
|
-
d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
|
|
120
|
-
/>
|
|
121
|
-
</svg>;
|
|
122
|
-
var SpinnerIcon_default = SpinnerIcon;
|
|
123
|
-
|
|
124
|
-
// src/components/select/Select.tsx
|
|
125
|
-
var Select = (props) => {
|
|
126
|
-
const [localProps, variantProps, otherProps] = splitProps(
|
|
127
|
-
props,
|
|
128
|
-
["placeholder", "value", "nativeSize", "onChange", "onFocus", "onBlur"],
|
|
129
|
-
["class", ...selectVariants.variantKeys]
|
|
130
|
-
);
|
|
131
|
-
const empty = createMemo(
|
|
132
|
-
() => untrack(() => localProps.value === null || localProps.value === void 0)
|
|
133
|
-
);
|
|
134
|
-
const selectClass = createMemo(
|
|
135
|
-
() => classes(
|
|
136
|
-
selectVariants(variantProps),
|
|
137
|
-
variantProps.class,
|
|
138
|
-
selectPaddingClass
|
|
139
|
-
)
|
|
140
|
-
);
|
|
141
|
-
return <div class={wrapperClass}>
|
|
142
|
-
<select
|
|
143
|
-
class={selectClass()}
|
|
144
|
-
size={localProps.nativeSize}
|
|
145
|
-
value={localProps.value}
|
|
146
|
-
onChange={localProps.onChange}
|
|
147
|
-
onFocus={localProps.onFocus}
|
|
148
|
-
onBlur={localProps.onBlur}
|
|
149
|
-
{...otherProps}
|
|
150
|
-
>
|
|
151
|
-
<Show when={localProps.placeholder && empty()}>
|
|
152
|
-
<option value="" disabled hidden>
|
|
153
|
-
{localProps.placeholder}
|
|
154
|
-
</option>
|
|
155
|
-
</Show>
|
|
156
|
-
{props.children}
|
|
157
|
-
</select>
|
|
158
|
-
|
|
159
|
-
<Show when={variantProps.loading}>
|
|
160
|
-
<SpinnerIcon_default
|
|
161
|
-
class={`${spinnerIconBaseClass} ${getSpinnerColor(
|
|
162
|
-
variantProps.color
|
|
163
|
-
)}`}
|
|
164
|
-
/>
|
|
165
|
-
</Show>
|
|
166
|
-
|
|
167
|
-
<Show when={!variantProps.loading}>
|
|
168
|
-
<CaretDownIcon_default
|
|
169
|
-
class={`${caretIconBaseClass} ${getIconColor(variantProps.color)}`}
|
|
170
|
-
/>
|
|
171
|
-
</Show>
|
|
172
|
-
</div>;
|
|
173
|
-
};
|
|
174
|
-
var Select_default = Select;
|
|
175
|
-
|
|
176
|
-
// src/components/select/index.ts
|
|
177
|
-
var select_default = Select_default;
|
|
178
|
-
|
|
179
|
-
export {
|
|
180
|
-
select_default
|
|
181
|
-
};
|
package/dist/chunk/GWFGP2JQ.jsx
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cva
|
|
3
|
-
} from "./P7WPLZNA.jsx";
|
|
4
|
-
|
|
5
|
-
// src/components/switch/Switch.tsx
|
|
6
|
-
import {
|
|
7
|
-
createSignal,
|
|
8
|
-
splitProps,
|
|
9
|
-
createMemo,
|
|
10
|
-
untrack
|
|
11
|
-
} from "solid-js";
|
|
12
|
-
|
|
13
|
-
// src/components/switch/Switch.styles.ts
|
|
14
|
-
var switchVariants = cva(
|
|
15
|
-
"switch inline-flex items-center gap-2 select-none",
|
|
16
|
-
{
|
|
17
|
-
variants: {
|
|
18
|
-
size: {
|
|
19
|
-
sm: "text-sm",
|
|
20
|
-
md: "text-base",
|
|
21
|
-
lg: "text-lg"
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
true: "opacity-50",
|
|
25
|
-
false: ""
|
|
26
|
-
},
|
|
27
|
-
rounded: {
|
|
28
|
-
true: "",
|
|
29
|
-
false: ""
|
|
30
|
-
},
|
|
31
|
-
outlined: {
|
|
32
|
-
true: "",
|
|
33
|
-
false: ""
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
defaultVariants: {
|
|
37
|
-
size: "md",
|
|
38
|
-
disabled: false,
|
|
39
|
-
rounded: true,
|
|
40
|
-
outlined: false
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
var checkVariants = cva(
|
|
45
|
-
[
|
|
46
|
-
"relative transition-colors duration-200",
|
|
47
|
-
"after:content-[''] after:absolute after:bg-white after:transition-transform after:duration-700 after:ease-in-out after:shadow-sm"
|
|
48
|
-
].join(" "),
|
|
49
|
-
{
|
|
50
|
-
variants: {
|
|
51
|
-
size: {
|
|
52
|
-
sm: "w-8 h-4 after:w-3 after:h-3 after:left-0.5 after:top-0.5 peer-checked:after:translate-x-4",
|
|
53
|
-
md: "w-10 h-6 after:w-4 after:h-4 after:left-1 after:top-1 peer-checked:after:translate-x-4",
|
|
54
|
-
lg: "w-12 h-7 after:w-5 after:h-5 after:left-1 after:top-1 peer-checked:after:translate-x-5"
|
|
55
|
-
},
|
|
56
|
-
color: {
|
|
57
|
-
primary: "peer-checked:bg-blue-500",
|
|
58
|
-
success: "peer-checked:bg-green-500",
|
|
59
|
-
danger: "peer-checked:bg-red-500",
|
|
60
|
-
warning: "peer-checked:bg-yellow-400",
|
|
61
|
-
gray: "peer-checked:bg-gray-400"
|
|
62
|
-
},
|
|
63
|
-
passiveColor: {
|
|
64
|
-
primary: "bg-blue-200",
|
|
65
|
-
success: "bg-green-200",
|
|
66
|
-
danger: "bg-red-200",
|
|
67
|
-
warning: "bg-yellow-200",
|
|
68
|
-
gray: "bg-gray-200"
|
|
69
|
-
},
|
|
70
|
-
rounded: {
|
|
71
|
-
true: "rounded-full after:rounded-full",
|
|
72
|
-
false: "rounded-md after:rounded-sm"
|
|
73
|
-
},
|
|
74
|
-
outlined: {
|
|
75
|
-
true: "bg-transparent ring border-current",
|
|
76
|
-
false: ""
|
|
77
|
-
},
|
|
78
|
-
disabled: {
|
|
79
|
-
true: "bg-gray-200 border border-gray-300 after:bg-gray-100",
|
|
80
|
-
false: ""
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
defaultVariants: {
|
|
84
|
-
size: "md",
|
|
85
|
-
color: "primary",
|
|
86
|
-
passiveColor: "gray",
|
|
87
|
-
rounded: true,
|
|
88
|
-
outlined: false
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
var switchLabelClass = cva("control-label", {
|
|
93
|
-
variants: {
|
|
94
|
-
disabled: {
|
|
95
|
-
true: "text-gray-400 dark:text-gray-500",
|
|
96
|
-
false: "text-gray-800 dark:text-gray-200"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
defaultVariants: {
|
|
100
|
-
disabled: false
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// src/components/switch/Switch.tsx
|
|
105
|
-
var Switch = (props) => {
|
|
106
|
-
const [localProps, variantProps, otherProps] = splitProps(
|
|
107
|
-
props,
|
|
108
|
-
[
|
|
109
|
-
"children",
|
|
110
|
-
"checked",
|
|
111
|
-
"defaultChecked",
|
|
112
|
-
"onChange",
|
|
113
|
-
"name",
|
|
114
|
-
"required",
|
|
115
|
-
"disabled",
|
|
116
|
-
"aria-label",
|
|
117
|
-
"aria-describedby"
|
|
118
|
-
],
|
|
119
|
-
["size", "rounded", "outlined", "color", "passiveColor", "disabled"]
|
|
120
|
-
);
|
|
121
|
-
const isControlled = localProps.checked !== void 0;
|
|
122
|
-
const [internalChecked, setInternalChecked] = createSignal(
|
|
123
|
-
localProps.defaultChecked ?? false
|
|
124
|
-
);
|
|
125
|
-
const checkedValue = createMemo(
|
|
126
|
-
() => untrack(() => isControlled ? localProps.checked : internalChecked())
|
|
127
|
-
);
|
|
128
|
-
const switchClasses = createMemo(() => switchVariants(variantProps));
|
|
129
|
-
const checkClasses = createMemo(
|
|
130
|
-
() => checkVariants({
|
|
131
|
-
size: variantProps.size,
|
|
132
|
-
color: variantProps.color,
|
|
133
|
-
passiveColor: variantProps.passiveColor,
|
|
134
|
-
rounded: variantProps.rounded,
|
|
135
|
-
outlined: variantProps.outlined,
|
|
136
|
-
disabled: localProps.disabled
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
const handleChange = (e) => {
|
|
140
|
-
if (localProps.disabled) return;
|
|
141
|
-
const next = e.currentTarget.checked;
|
|
142
|
-
untrack(() => {
|
|
143
|
-
if (!isControlled) setInternalChecked(next);
|
|
144
|
-
localProps.onChange?.(next);
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
return <label
|
|
148
|
-
class={switchClasses()}
|
|
149
|
-
role="switch"
|
|
150
|
-
aria-checked={checkedValue()}
|
|
151
|
-
aria-label={localProps["aria-label"]}
|
|
152
|
-
aria-describedby={localProps["aria-describedby"]}
|
|
153
|
-
>
|
|
154
|
-
<input
|
|
155
|
-
type="checkbox"
|
|
156
|
-
class="sr-only peer"
|
|
157
|
-
checked={checkedValue()}
|
|
158
|
-
onChange={handleChange}
|
|
159
|
-
name={localProps.name}
|
|
160
|
-
required={localProps.required}
|
|
161
|
-
disabled={localProps.disabled}
|
|
162
|
-
aria-hidden="true"
|
|
163
|
-
{...otherProps}
|
|
164
|
-
/>
|
|
165
|
-
|
|
166
|
-
<span class={checkClasses()} />
|
|
167
|
-
<span class={switchLabelClass({ disabled: localProps.disabled })}>
|
|
168
|
-
{localProps.children}
|
|
169
|
-
</span>
|
|
170
|
-
</label>;
|
|
171
|
-
};
|
|
172
|
-
var Switch_default = Switch;
|
|
173
|
-
|
|
174
|
-
// src/components/switch/index.ts
|
|
175
|
-
var switch_default = Switch_default;
|
|
176
|
-
|
|
177
|
-
export {
|
|
178
|
-
switch_default
|
|
179
|
-
};
|