@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,132 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/tag/Tag.tsx
|
|
7
|
+
import {
|
|
8
|
+
splitProps,
|
|
9
|
+
createMemo,
|
|
10
|
+
Show,
|
|
11
|
+
untrack
|
|
12
|
+
} from "solid-js";
|
|
13
|
+
|
|
14
|
+
// src/components/tag/Tag.styles.ts
|
|
15
|
+
var tagVariants = cva(
|
|
16
|
+
[
|
|
17
|
+
"inline-flex items-center gap-2 px-3 py-1 text-sm rounded",
|
|
18
|
+
"transition select-none"
|
|
19
|
+
],
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
normal: "text-xs px-2 py-0.5",
|
|
24
|
+
medium: "text-sm px-3 py-1",
|
|
25
|
+
large: "text-base px-4 py-2"
|
|
26
|
+
},
|
|
27
|
+
type: {
|
|
28
|
+
primary: "bg-blue-500 text-white",
|
|
29
|
+
info: "bg-sky-500 text-white",
|
|
30
|
+
success: "bg-green-500 text-white",
|
|
31
|
+
warning: "bg-yellow-500 text-black",
|
|
32
|
+
danger: "bg-red-500 text-white",
|
|
33
|
+
dark: "bg-zinc-800 text-white",
|
|
34
|
+
light: "bg-gray-100 text-black"
|
|
35
|
+
},
|
|
36
|
+
rounded: {
|
|
37
|
+
true: "rounded-full",
|
|
38
|
+
false: ""
|
|
39
|
+
},
|
|
40
|
+
closable: {
|
|
41
|
+
true: "pr-1",
|
|
42
|
+
false: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
size: "normal"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// src/components/tag/Tag.tsx
|
|
52
|
+
var Tag = (props) => {
|
|
53
|
+
const [localProps, variantProps, otherProps] = splitProps(
|
|
54
|
+
props,
|
|
55
|
+
[
|
|
56
|
+
"closable",
|
|
57
|
+
"attached",
|
|
58
|
+
"onClose",
|
|
59
|
+
"ariaCloseLabel",
|
|
60
|
+
"closeIcon",
|
|
61
|
+
"children",
|
|
62
|
+
"type"
|
|
63
|
+
],
|
|
64
|
+
["class", ...tagVariants.variantKeys]
|
|
65
|
+
);
|
|
66
|
+
const isAttachedClosable = createMemo(
|
|
67
|
+
() => untrack(() => localProps.attached && localProps.closable)
|
|
68
|
+
);
|
|
69
|
+
const isClosable = createMemo(
|
|
70
|
+
() => untrack(() => localProps.closable && !localProps.attached)
|
|
71
|
+
);
|
|
72
|
+
const tagClasses = createMemo(
|
|
73
|
+
() => classes(
|
|
74
|
+
tagVariants({
|
|
75
|
+
...variantProps,
|
|
76
|
+
closable: localProps.closable
|
|
77
|
+
}),
|
|
78
|
+
variantProps.class
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
const attachedButtonClasses = createMemo(
|
|
82
|
+
() => tagVariants({
|
|
83
|
+
...variantProps,
|
|
84
|
+
class: "ml-1 text-xs hover:opacity-80"
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
const handleClose = (e) => {
|
|
88
|
+
untrack(() => {
|
|
89
|
+
if (typeof localProps.onClose === "function") {
|
|
90
|
+
localProps.onClose(e);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return <div
|
|
95
|
+
class={isAttachedClosable() ? "tags has-addons" : void 0}
|
|
96
|
+
role="group"
|
|
97
|
+
>
|
|
98
|
+
<span class={tagClasses()} role="status" {...otherProps}>
|
|
99
|
+
<span class="truncate">{localProps.children}</span>
|
|
100
|
+
|
|
101
|
+
<Show when={isClosable()}>
|
|
102
|
+
<button
|
|
103
|
+
type="button"
|
|
104
|
+
aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
|
|
105
|
+
onClick={handleClose}
|
|
106
|
+
class="ml-2 text-xs text-white hover:opacity-80"
|
|
107
|
+
>
|
|
108
|
+
{localProps.closeIcon ?? "\xD7"}
|
|
109
|
+
</button>
|
|
110
|
+
</Show>
|
|
111
|
+
</span>
|
|
112
|
+
|
|
113
|
+
<Show when={isAttachedClosable()}>
|
|
114
|
+
<button
|
|
115
|
+
type="button"
|
|
116
|
+
aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
|
|
117
|
+
onClick={handleClose}
|
|
118
|
+
class={attachedButtonClasses()}
|
|
119
|
+
>
|
|
120
|
+
{localProps.closeIcon ?? "\xD7"}
|
|
121
|
+
</button>
|
|
122
|
+
</Show>
|
|
123
|
+
</div>;
|
|
124
|
+
};
|
|
125
|
+
var Tag_default = Tag;
|
|
126
|
+
|
|
127
|
+
// src/components/tag/index.ts
|
|
128
|
+
var tag_default = Tag_default;
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
tag_default
|
|
132
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { cva, classes } from './HKS7ET6T.js';
|
|
2
|
+
import { template, spread, mergeProps, insert, memo, effect, className } from 'solid-js/web';
|
|
3
|
+
import { splitProps } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/field/Field.styles.ts
|
|
6
|
+
var fieldWrapper = cva(
|
|
7
|
+
"flex flex-col space-y-1",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
horizontal: {
|
|
11
|
+
true: "flex-row items-center space-x-2 space-y-0",
|
|
12
|
+
false: "flex-col"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: "text-sm",
|
|
16
|
+
md: "text-base",
|
|
17
|
+
lg: "text-lg"
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
default: "",
|
|
21
|
+
danger: "text-red-600"
|
|
22
|
+
},
|
|
23
|
+
grouped: {
|
|
24
|
+
true: "flex flex-wrap gap-2",
|
|
25
|
+
false: ""
|
|
26
|
+
},
|
|
27
|
+
groupMultiline: {
|
|
28
|
+
true: "flex-col",
|
|
29
|
+
false: "flex-row"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{ horizontal: true, grouped: true, class: "items-start" }
|
|
34
|
+
],
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
horizontal: false,
|
|
37
|
+
size: "md",
|
|
38
|
+
type: "default",
|
|
39
|
+
grouped: false,
|
|
40
|
+
groupMultiline: false
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
var labelStyles = cva("font-medium", {
|
|
45
|
+
variants: {
|
|
46
|
+
size: { sm: "text-sm", md: "text-base", lg: "text-lg" },
|
|
47
|
+
type: { default: "text-gray-800", danger: "text-red-600" }
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: { size: "md", type: "default" }
|
|
50
|
+
});
|
|
51
|
+
var messageStyles = cva("mt-1 text-sm", {
|
|
52
|
+
variants: {
|
|
53
|
+
type: { default: "text-gray-600", danger: "text-red-600" }
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: { type: "default" }
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// src/components/field/Field.tsx
|
|
59
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><div>`);
|
|
60
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<label>`);
|
|
61
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
62
|
+
var Field = (props) => {
|
|
63
|
+
const [local, variantProps, rest] = splitProps(props, ["label", "message", "className", "children"], ["horizontal", "size", "type", "grouped", "groupMultiline"]);
|
|
64
|
+
return (() => {
|
|
65
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
|
|
66
|
+
spread(_el$, mergeProps({
|
|
67
|
+
get ["class"]() {
|
|
68
|
+
return classes(fieldWrapper(variantProps), local.className);
|
|
69
|
+
}
|
|
70
|
+
}, rest), false, true);
|
|
71
|
+
insert(_el$, (() => {
|
|
72
|
+
var _c$ = memo(() => !!local.label);
|
|
73
|
+
return () => _c$() && (() => {
|
|
74
|
+
var _el$3 = _tmpl$2();
|
|
75
|
+
insert(_el$3, () => local.label);
|
|
76
|
+
effect(() => className(_el$3, labelStyles(variantProps)));
|
|
77
|
+
return _el$3;
|
|
78
|
+
})();
|
|
79
|
+
})(), _el$2);
|
|
80
|
+
insert(_el$2, () => local.children);
|
|
81
|
+
insert(_el$, (() => {
|
|
82
|
+
var _c$2 = memo(() => !!local.message);
|
|
83
|
+
return () => _c$2() && (() => {
|
|
84
|
+
var _el$4 = _tmpl$3();
|
|
85
|
+
insert(_el$4, () => local.message);
|
|
86
|
+
effect(() => className(_el$4, messageStyles(variantProps)));
|
|
87
|
+
return _el$4;
|
|
88
|
+
})();
|
|
89
|
+
})(), null);
|
|
90
|
+
effect(() => className(_el$2, classes(variantProps.horizontal ? "flex items-center gap-2" : "")));
|
|
91
|
+
return _el$;
|
|
92
|
+
})();
|
|
93
|
+
};
|
|
94
|
+
var Field_default = Field;
|
|
95
|
+
|
|
96
|
+
// src/components/field/index.ts
|
|
97
|
+
var field_default = Field_default;
|
|
98
|
+
|
|
99
|
+
export { field_default };
|
|
@@ -2,7 +2,7 @@ import { cva } from './HKS7ET6T.js';
|
|
|
2
2
|
import { template, insert, createComponent, spread, mergeProps as mergeProps$1, effect, className } from 'solid-js/web';
|
|
3
3
|
import { mergeProps, splitProps, createSignal, createEffect, untrack, createMemo, Show } from 'solid-js';
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
5
|
+
// src/components/avatar/Avatar.styles.ts
|
|
6
6
|
var avatarVariants = cva(
|
|
7
7
|
[
|
|
8
8
|
"flex items-center justify-center mx-1",
|
|
@@ -36,7 +36,7 @@ var avatarVariants = cva(
|
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
// src/components/
|
|
39
|
+
// src/components/avatar/utils.ts
|
|
40
40
|
function parseCaption(alt) {
|
|
41
41
|
if (!alt) return "";
|
|
42
42
|
const parts = alt.split(" ");
|
|
@@ -46,7 +46,7 @@ function parseCaption(alt) {
|
|
|
46
46
|
return "";
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// src/components/
|
|
49
|
+
// src/components/avatar/Avatar.tsx
|
|
50
50
|
var _tmpl$ = /* @__PURE__ */ template(`<img class="size-full object-cover">`);
|
|
51
51
|
var _tmpl$2 = /* @__PURE__ */ template(`<figure>`);
|
|
52
52
|
var _tmpl$3 = /* @__PURE__ */ template(`<figcaption>`);
|
|
@@ -101,7 +101,7 @@ var Avatar = (rawProps) => {
|
|
|
101
101
|
};
|
|
102
102
|
var Avatar_default = Avatar;
|
|
103
103
|
|
|
104
|
-
// src/components/
|
|
105
|
-
var
|
|
104
|
+
// src/components/avatar/index.ts
|
|
105
|
+
var avatar_default = Avatar_default;
|
|
106
106
|
|
|
107
|
-
export {
|
|
107
|
+
export { avatar_default };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "./P7WPLZNA.jsx";
|
|
4
|
+
|
|
5
|
+
// src/components/breadcrumb/Breadcrumb.tsx
|
|
6
|
+
import {
|
|
7
|
+
splitProps,
|
|
8
|
+
children,
|
|
9
|
+
createMemo,
|
|
10
|
+
untrack
|
|
11
|
+
} from "solid-js";
|
|
12
|
+
|
|
13
|
+
// src/components/breadcrumb/Breadcrumb.styles.ts
|
|
14
|
+
var breadcrumbContainerVariants = cva(
|
|
15
|
+
["flex", "items-center", "gap-2", "text-sm"],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
alignment: {
|
|
19
|
+
left: "justify-start",
|
|
20
|
+
center: "justify-center",
|
|
21
|
+
right: "justify-end"
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
sm: "text-xs gap-1",
|
|
25
|
+
md: "text-sm gap-2",
|
|
26
|
+
lg: "text-base gap-3"
|
|
27
|
+
},
|
|
28
|
+
separator: {
|
|
29
|
+
arrow: "breadcrumb-arrow",
|
|
30
|
+
dot: "breadcrumb-dot",
|
|
31
|
+
bullet: "breadcrumb-bullet",
|
|
32
|
+
succeeds: "breadcrumb-succeeds"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
alignment: "left",
|
|
37
|
+
size: "md"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
var breadcrumbItemVariants = cva(
|
|
42
|
+
["text-gray-600", "dark:text-gray-300"],
|
|
43
|
+
{
|
|
44
|
+
variants: {
|
|
45
|
+
active: {
|
|
46
|
+
true: "text-blue-600 font-semibold cursor-default",
|
|
47
|
+
false: "hover:underline"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
active: false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// src/components/breadcrumb/Breadcrumb.tsx
|
|
57
|
+
var separatorMap = {
|
|
58
|
+
arrow: "\u2192",
|
|
59
|
+
dot: "\xB7",
|
|
60
|
+
bullet: "\u2022",
|
|
61
|
+
succeeds: "\xBB"
|
|
62
|
+
};
|
|
63
|
+
var Breadcrumb = (props) => {
|
|
64
|
+
const [local, variantProps, otherProps] = splitProps(
|
|
65
|
+
props,
|
|
66
|
+
["children"],
|
|
67
|
+
["alignment", "size", "separator"]
|
|
68
|
+
);
|
|
69
|
+
const resolvedChildren = children(() => local.children);
|
|
70
|
+
const items = createMemo(() => resolvedChildren.toArray());
|
|
71
|
+
const separator = createMemo(
|
|
72
|
+
() => untrack(() => {
|
|
73
|
+
const sep = variantProps.separator;
|
|
74
|
+
return sep && separatorMap[sep] ? separatorMap[sep] : "/";
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
const containerClasses = createMemo(
|
|
78
|
+
() => breadcrumbContainerVariants(variantProps)
|
|
79
|
+
);
|
|
80
|
+
const renderItems = createMemo(() => {
|
|
81
|
+
return items().reduce((acc, item, idx) => {
|
|
82
|
+
if (idx > 0) {
|
|
83
|
+
acc.push(
|
|
84
|
+
<li class="text-gray-400 select-none" aria-hidden="true">
|
|
85
|
+
{separator()}
|
|
86
|
+
</li>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
acc.push(
|
|
90
|
+
<li>
|
|
91
|
+
<span aria-current={idx === items().length - 1 ? "page" : void 0}>
|
|
92
|
+
{item}
|
|
93
|
+
</span>
|
|
94
|
+
</li>
|
|
95
|
+
);
|
|
96
|
+
return acc;
|
|
97
|
+
}, []);
|
|
98
|
+
});
|
|
99
|
+
return <nav class={containerClasses()} aria-label="Breadcrumb" {...otherProps}>
|
|
100
|
+
<ol class="flex items-center flex-wrap gap-1">{renderItems()}</ol>
|
|
101
|
+
</nav>;
|
|
102
|
+
};
|
|
103
|
+
var Breadcrumb_default = Breadcrumb;
|
|
104
|
+
|
|
105
|
+
// src/components/breadcrumb/BreadcrumbItem.tsx
|
|
106
|
+
import { splitProps as splitProps2 } from "solid-js";
|
|
107
|
+
var BreadcrumbItem = (props) => {
|
|
108
|
+
const [local, variantProps] = splitProps2(
|
|
109
|
+
props,
|
|
110
|
+
["children", "href", "active"],
|
|
111
|
+
["active"]
|
|
112
|
+
);
|
|
113
|
+
return <li class="flex items-center gap-1">
|
|
114
|
+
{local.href && !local.active ? <a href={local.href} class={breadcrumbItemVariants(variantProps)}>
|
|
115
|
+
{local.children}
|
|
116
|
+
</a> : <span class={breadcrumbItemVariants({ active: true })}>
|
|
117
|
+
{local.children}
|
|
118
|
+
</span>}
|
|
119
|
+
</li>;
|
|
120
|
+
};
|
|
121
|
+
var BreadcrumbItem_default = BreadcrumbItem;
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
Breadcrumb_default,
|
|
125
|
+
BreadcrumbItem_default
|
|
126
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/checkbox/Checkbox.tsx
|
|
7
|
+
import {
|
|
8
|
+
splitProps,
|
|
9
|
+
Show,
|
|
10
|
+
createEffect,
|
|
11
|
+
createMemo,
|
|
12
|
+
untrack
|
|
13
|
+
} from "solid-js";
|
|
14
|
+
|
|
15
|
+
// src/components/checkbox/Checkbox.styles.ts
|
|
16
|
+
var checkboxVariants = cva(
|
|
17
|
+
[
|
|
18
|
+
"relative inline-flex items-center gap-2 cursor-pointer",
|
|
19
|
+
"select-none",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
21
|
+
],
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: "text-sm",
|
|
26
|
+
md: "text-base",
|
|
27
|
+
lg: "text-lg"
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
primary: "text-primary",
|
|
31
|
+
success: "text-green-600",
|
|
32
|
+
warning: "text-yellow-600",
|
|
33
|
+
danger: "text-red-600"
|
|
34
|
+
},
|
|
35
|
+
checked: {
|
|
36
|
+
true: "",
|
|
37
|
+
false: ""
|
|
38
|
+
},
|
|
39
|
+
indeterminate: {
|
|
40
|
+
true: "",
|
|
41
|
+
false: ""
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
size: "md",
|
|
46
|
+
color: "primary",
|
|
47
|
+
checked: false,
|
|
48
|
+
indeterminate: false
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// src/components/checkbox/Checkbox.tsx
|
|
54
|
+
var Checkbox = (props) => {
|
|
55
|
+
const [localProps, variantProps, otherProps] = splitProps(
|
|
56
|
+
props,
|
|
57
|
+
[
|
|
58
|
+
"label",
|
|
59
|
+
"indeterminate",
|
|
60
|
+
"type",
|
|
61
|
+
"onChange",
|
|
62
|
+
"onFocus",
|
|
63
|
+
"onBlur",
|
|
64
|
+
"checked",
|
|
65
|
+
"disabled",
|
|
66
|
+
"aria-label",
|
|
67
|
+
"aria-describedby"
|
|
68
|
+
],
|
|
69
|
+
["class", ...checkboxVariants.variantKeys]
|
|
70
|
+
);
|
|
71
|
+
let inputRef;
|
|
72
|
+
const checkboxClasses = createMemo(() => checkboxVariants(variantProps));
|
|
73
|
+
const markerClasses = createMemo(
|
|
74
|
+
() => classes(
|
|
75
|
+
"inline-block w-4 h-4 border border-gray-400 rounded-sm peer-checked:bg-current",
|
|
76
|
+
localProps.indeterminate ? "bg-gray-400 relative" : ""
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
const handleChange = (e) => {
|
|
80
|
+
untrack(() => {
|
|
81
|
+
if (typeof localProps.onChange === "function") {
|
|
82
|
+
localProps.onChange(e);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const handleFocus = (e) => {
|
|
87
|
+
untrack(() => {
|
|
88
|
+
if (typeof localProps.onFocus === "function") {
|
|
89
|
+
localProps.onFocus(e);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
const handleBlur = (e) => {
|
|
94
|
+
untrack(() => {
|
|
95
|
+
if (typeof localProps.onBlur === "function") {
|
|
96
|
+
localProps.onBlur(e);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
createEffect(() => {
|
|
101
|
+
if (inputRef) {
|
|
102
|
+
untrack(() => {
|
|
103
|
+
inputRef.indeterminate = !!localProps.indeterminate;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return <label
|
|
108
|
+
class={checkboxClasses()}
|
|
109
|
+
role="checkbox"
|
|
110
|
+
aria-checked={localProps.indeterminate ? "mixed" : localProps.checked}
|
|
111
|
+
aria-label={localProps["aria-label"]}
|
|
112
|
+
aria-describedby={localProps["aria-describedby"]}
|
|
113
|
+
>
|
|
114
|
+
<input
|
|
115
|
+
ref={inputRef}
|
|
116
|
+
type="checkbox"
|
|
117
|
+
class="peer absolute opacity-0 w-4 h-4"
|
|
118
|
+
checked={localProps.checked}
|
|
119
|
+
disabled={localProps.disabled}
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
{...otherProps}
|
|
122
|
+
onChange={handleChange}
|
|
123
|
+
onFocus={handleFocus}
|
|
124
|
+
onBlur={handleBlur}
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
<span class={markerClasses()}>
|
|
128
|
+
<Show when={localProps.indeterminate}>
|
|
129
|
+
<span
|
|
130
|
+
class="absolute top-1/2 left-1/2 w-2 h-0.5 bg-white -translate-x-1/2 -translate-y-1/2"
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
/>
|
|
133
|
+
</Show>
|
|
134
|
+
</span>
|
|
135
|
+
|
|
136
|
+
<Show when={localProps.label}>
|
|
137
|
+
<span class="ml-2">{localProps.label}</span>
|
|
138
|
+
</Show>
|
|
139
|
+
</label>;
|
|
140
|
+
};
|
|
141
|
+
var Checkbox_default = Checkbox;
|
|
142
|
+
|
|
143
|
+
// src/components/checkbox/index.ts
|
|
144
|
+
var checkbox_default = Checkbox_default;
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
checkbox_default
|
|
148
|
+
};
|