@pathscale/ui 0.0.2 → 0.0.4
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/Autocomplete-gLkjMHrc.d.ts +28 -0
- package/dist/Field-DfUn85_1.d.ts +49 -0
- package/dist/Progress-gN0xqhAF.d.ts +64 -0
- package/dist/Steps-1miUeyCD.d.ts +34 -0
- package/dist/Table-CGa6Nop3.d.ts +39 -0
- package/dist/Timeline-Bd4SxHMT.d.ts +14 -0
- package/dist/{Upload-BrFuZ4JA.d.ts → Upload-CRljD5jf.d.ts} +1 -1
- package/dist/chunk/3VOILEMN.js +187 -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/D2BEL4SM.jsx +169 -0
- package/dist/chunk/DSTUGZW6.jsx +81 -0
- package/dist/chunk/FKSQPGOD.jsx +170 -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/LAQPAV5I.jsx +187 -0
- package/dist/chunk/MAX47D6F.js +99 -0
- package/dist/chunk/{2JGZSAW5.js → MI773TMC.js} +6 -6
- package/dist/chunk/MYERRMTM.js +200 -0
- package/dist/chunk/OSJ3P7PI.js +189 -0
- package/dist/chunk/{QLESLIWS.jsx → QHJOIUYT.jsx} +14 -7
- package/dist/chunk/QYEMOKUG.js +125 -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/VN5BKHA2.jsx +97 -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/{S3ZDSQSV.js → YDEDUOFM.js} +8 -4
- package/dist/chunk/YMO6RPS6.js +26 -0
- package/dist/components/Progress/index.d.ts +4 -38
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Progress/index.jsx +3 -11
- 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/button/index.js +1 -1
- package/dist/components/button/index.jsx +2 -1
- 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/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/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/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/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/upload/index.d.ts +2 -2
- package/dist/components/upload/index.js +1 -1
- package/dist/components/upload/index.jsx +1 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.js +18 -8
- package/dist/index.jsx +71 -17
- package/package.json +1 -1
- package/dist/Progress-a616LgE0.d.ts +0 -5
- package/dist/chunk/QNOJ6PCD.js +0 -278
- package/dist/chunk/WCBMW2TP.jsx +0 -203
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/navbar/Navbar.tsx
|
|
7
|
+
import {
|
|
8
|
+
splitProps,
|
|
9
|
+
Show
|
|
10
|
+
} from "solid-js";
|
|
11
|
+
|
|
12
|
+
// src/components/navbar/Navbar.styles.ts
|
|
13
|
+
var navbarStyles = cva("flex items-center px-4", {
|
|
14
|
+
variants: {
|
|
15
|
+
color: {
|
|
16
|
+
info: "bg-blue-500 text-white",
|
|
17
|
+
primary: "bg-indigo-600 text-white",
|
|
18
|
+
success: "bg-green-500 text-white",
|
|
19
|
+
light: "bg-white text-gray-800"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
color: "info"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var navbarItemStyles = cva(
|
|
27
|
+
"px-3 py-2 rounded transition-colors",
|
|
28
|
+
{
|
|
29
|
+
variants: {
|
|
30
|
+
active: {
|
|
31
|
+
true: "font-semibold border-b-2 border-current",
|
|
32
|
+
false: "hover:bg-gray-200"
|
|
33
|
+
},
|
|
34
|
+
tag: {
|
|
35
|
+
div: "",
|
|
36
|
+
a: ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
active: false,
|
|
41
|
+
tag: "div"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var navbarDropdownStyles = cva("relative", {
|
|
46
|
+
variants: {
|
|
47
|
+
hoverable: {
|
|
48
|
+
true: "group",
|
|
49
|
+
false: ""
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
hoverable: false
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var dropdownMenuStyles = cva(
|
|
57
|
+
"absolute mt-2 bg-white text-gray-800 rounded shadow-lg hidden group-hover:block",
|
|
58
|
+
{
|
|
59
|
+
variants: {
|
|
60
|
+
align: {
|
|
61
|
+
left: "left-0",
|
|
62
|
+
right: "right-0"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
align: "left"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
var imageStyles = cva("", {
|
|
71
|
+
variants: {
|
|
72
|
+
rounded: {
|
|
73
|
+
true: "rounded-full",
|
|
74
|
+
false: ""
|
|
75
|
+
},
|
|
76
|
+
size: {
|
|
77
|
+
sm: "w-6 h-6",
|
|
78
|
+
md: "w-8 h-8",
|
|
79
|
+
lg: "w-12 h-12"
|
|
80
|
+
},
|
|
81
|
+
bordered: {
|
|
82
|
+
true: "border border-gray-200",
|
|
83
|
+
false: ""
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
defaultVariants: {
|
|
87
|
+
rounded: false,
|
|
88
|
+
size: "md",
|
|
89
|
+
bordered: false
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// src/components/navbar/Navbar.tsx
|
|
94
|
+
var Navbar = (props) => {
|
|
95
|
+
const [local, variantProps, other] = splitProps(
|
|
96
|
+
props,
|
|
97
|
+
["class", "className", "brand", "start", "end"],
|
|
98
|
+
Object.keys(navbarStyles.variantKeys ?? {})
|
|
99
|
+
);
|
|
100
|
+
return <nav
|
|
101
|
+
class={classes(
|
|
102
|
+
navbarStyles({ color: variantProps.color }),
|
|
103
|
+
local.class,
|
|
104
|
+
local.className
|
|
105
|
+
)}
|
|
106
|
+
{...other}
|
|
107
|
+
>
|
|
108
|
+
<Show when={local.brand}>
|
|
109
|
+
<div class="flex-shrink-0 mr-4">{local.brand}</div>
|
|
110
|
+
</Show>
|
|
111
|
+
|
|
112
|
+
<Show when={local.start}>
|
|
113
|
+
<div class="flex-1 flex items-center space-x-2">{local.start}</div>
|
|
114
|
+
</Show>
|
|
115
|
+
|
|
116
|
+
<Show when={local.end}>
|
|
117
|
+
<div class="flex-1 flex justify-end space-x-2">{local.end}</div>
|
|
118
|
+
</Show>
|
|
119
|
+
</nav>;
|
|
120
|
+
};
|
|
121
|
+
var Navbar_default = Navbar;
|
|
122
|
+
|
|
123
|
+
// src/components/navbar/NavbarItem.tsx
|
|
124
|
+
import {
|
|
125
|
+
splitProps as splitProps2
|
|
126
|
+
} from "solid-js";
|
|
127
|
+
import { Dynamic } from "solid-js/web";
|
|
128
|
+
var NavbarItem = (props) => {
|
|
129
|
+
const [local, variantProps, other] = splitProps2(
|
|
130
|
+
props,
|
|
131
|
+
[
|
|
132
|
+
"class",
|
|
133
|
+
"className",
|
|
134
|
+
"active",
|
|
135
|
+
"href",
|
|
136
|
+
"tag",
|
|
137
|
+
"to",
|
|
138
|
+
"children"
|
|
139
|
+
],
|
|
140
|
+
Object.keys(navbarItemStyles.variantKeys ?? {})
|
|
141
|
+
);
|
|
142
|
+
const Tag = local.tag === "a" || local.href || local.to ? "a" : "div";
|
|
143
|
+
return <Dynamic
|
|
144
|
+
component={Tag}
|
|
145
|
+
class={classes(
|
|
146
|
+
navbarItemStyles({
|
|
147
|
+
active: !!local.active,
|
|
148
|
+
tag: local.tag ?? (Tag === "a" ? "a" : "div")
|
|
149
|
+
}),
|
|
150
|
+
local.class,
|
|
151
|
+
local.className
|
|
152
|
+
)}
|
|
153
|
+
href={local.href ?? local.to}
|
|
154
|
+
{...other}
|
|
155
|
+
>
|
|
156
|
+
{local.children}
|
|
157
|
+
</Dynamic>;
|
|
158
|
+
};
|
|
159
|
+
var NavbarItem_default = NavbarItem;
|
|
160
|
+
|
|
161
|
+
// src/components/navbar/NavbarDropdown.tsx
|
|
162
|
+
import { splitProps as splitProps3, Show as Show2 } from "solid-js";
|
|
163
|
+
var NavbarDropdown = (props) => {
|
|
164
|
+
const [local, variantProps, other] = splitProps3(
|
|
165
|
+
props,
|
|
166
|
+
["class", "className", "label", "hoverable", "children"],
|
|
167
|
+
[
|
|
168
|
+
...Object.keys(navbarDropdownStyles.variantKeys ?? {}),
|
|
169
|
+
...Object.keys(dropdownMenuStyles.variantKeys ?? {})
|
|
170
|
+
]
|
|
171
|
+
);
|
|
172
|
+
return <div
|
|
173
|
+
class={classes(
|
|
174
|
+
navbarDropdownStyles({ hoverable: !!local.hoverable }),
|
|
175
|
+
local.class,
|
|
176
|
+
local.className
|
|
177
|
+
)}
|
|
178
|
+
{...other}
|
|
179
|
+
>
|
|
180
|
+
<div class="cursor-pointer">{local.label}</div>
|
|
181
|
+
<Show2 when={local.hoverable}>
|
|
182
|
+
<div class={dropdownMenuStyles({ align: variantProps.align })}>
|
|
183
|
+
{local.children}
|
|
184
|
+
</div>
|
|
185
|
+
</Show2>
|
|
186
|
+
</div>;
|
|
187
|
+
};
|
|
188
|
+
var NavbarDropdown_default = NavbarDropdown;
|
|
189
|
+
|
|
190
|
+
export {
|
|
191
|
+
Navbar_default,
|
|
192
|
+
NavbarItem_default,
|
|
193
|
+
NavbarDropdown_default
|
|
194
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
cva
|
|
3
3
|
} from "./P7WPLZNA.jsx";
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
5
|
+
// src/components/avatar/Avatar.tsx
|
|
6
6
|
import {
|
|
7
7
|
createSignal,
|
|
8
8
|
createMemo,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
untrack
|
|
14
14
|
} from "solid-js";
|
|
15
15
|
|
|
16
|
-
// src/components/
|
|
16
|
+
// src/components/avatar/Avatar.styles.ts
|
|
17
17
|
var avatarVariants = cva(
|
|
18
18
|
[
|
|
19
19
|
"flex items-center justify-center mx-1",
|
|
@@ -47,7 +47,7 @@ var avatarVariants = cva(
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
|
|
50
|
-
// src/components/
|
|
50
|
+
// src/components/avatar/utils.ts
|
|
51
51
|
function parseCaption(alt) {
|
|
52
52
|
if (!alt) return "";
|
|
53
53
|
const parts = alt.split(" ");
|
|
@@ -57,7 +57,7 @@ function parseCaption(alt) {
|
|
|
57
57
|
return "";
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// src/components/
|
|
60
|
+
// src/components/avatar/Avatar.tsx
|
|
61
61
|
var Avatar = (rawProps) => {
|
|
62
62
|
const props = mergeProps({ alt: "User Avatar" }, rawProps);
|
|
63
63
|
const [variantProps, otherProps] = splitProps(props, [
|
|
@@ -93,9 +93,9 @@ var Avatar = (rawProps) => {
|
|
|
93
93
|
};
|
|
94
94
|
var Avatar_default = Avatar;
|
|
95
95
|
|
|
96
|
-
// src/components/
|
|
97
|
-
var
|
|
96
|
+
// src/components/avatar/index.ts
|
|
97
|
+
var avatar_default = Avatar_default;
|
|
98
98
|
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
avatar_default
|
|
101
101
|
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "./P7WPLZNA.jsx";
|
|
4
|
+
|
|
5
|
+
// src/components/autocomplete/Autocomplete.tsx
|
|
6
|
+
import {
|
|
7
|
+
createSignal,
|
|
8
|
+
createEffect,
|
|
9
|
+
For,
|
|
10
|
+
Show,
|
|
11
|
+
onCleanup
|
|
12
|
+
} from "solid-js";
|
|
13
|
+
|
|
14
|
+
// src/components/autocomplete/Autocomplete.styles.ts
|
|
15
|
+
var autocompleteWrapperClass = "relative w-full";
|
|
16
|
+
var inputBoxClass = cva(
|
|
17
|
+
"w-full rounded-md border border-gray-300 px-4 py-2 text-sm outline-none transition-colors",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
state: {
|
|
21
|
+
default: "bg-white text-gray-800 hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",
|
|
22
|
+
disabled: "bg-gray-100 text-gray-400 cursor-not-allowed"
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
sm: "text-sm py-1 px-2",
|
|
26
|
+
md: "text-sm py-2 px-4",
|
|
27
|
+
lg: "text-base py-3 px-4"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
state: "default",
|
|
32
|
+
size: "md"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
var dropdownMenuClass = cva(
|
|
37
|
+
"absolute left-0 right-0 z-10 mt-1 rounded-md border border-gray-200 bg-white shadow-md max-h-60 overflow-auto text-sm",
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
isOpen: {
|
|
41
|
+
true: "block",
|
|
42
|
+
false: "hidden"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
isOpen: true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
var dropdownItemClass = cva(
|
|
51
|
+
"w-full text-left px-4 py-2 cursor-pointer transition-colors",
|
|
52
|
+
{
|
|
53
|
+
variants: {
|
|
54
|
+
active: {
|
|
55
|
+
true: "bg-blue-500 text-white",
|
|
56
|
+
false: "hover:bg-gray-100 text-gray-800"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
active: false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
var dropdownEmptyClass = "px-4 py-2 text-sm text-gray-500";
|
|
65
|
+
var labelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
66
|
+
|
|
67
|
+
// src/components/autocomplete/Autocomplete.tsx
|
|
68
|
+
var Autocomplete = (props) => {
|
|
69
|
+
const [search, setSearch] = createSignal(props.value?.toString() || "");
|
|
70
|
+
const [isOpen, setIsOpen] = createSignal(false);
|
|
71
|
+
const [filtered, setFiltered] = createSignal(
|
|
72
|
+
props.items
|
|
73
|
+
);
|
|
74
|
+
const [highlightIndex, setHighlightIndex] = createSignal(-1);
|
|
75
|
+
let wrapperRef;
|
|
76
|
+
const filterItems = (val) => {
|
|
77
|
+
const lower = val.toLowerCase();
|
|
78
|
+
setFiltered(
|
|
79
|
+
props.items.filter(
|
|
80
|
+
(item) => item.toString().toLowerCase().includes(lower)
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
const handleInput = (e) => {
|
|
85
|
+
const val = e.target.value;
|
|
86
|
+
setSearch(val);
|
|
87
|
+
filterItems(val);
|
|
88
|
+
setIsOpen(true);
|
|
89
|
+
setHighlightIndex(-1);
|
|
90
|
+
};
|
|
91
|
+
const handleKeyDown = (e) => {
|
|
92
|
+
if (!isOpen()) return;
|
|
93
|
+
if (e.key === "ArrowDown") {
|
|
94
|
+
setHighlightIndex((prev) => Math.min(prev + 1, filtered().length - 1));
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
}
|
|
97
|
+
if (e.key === "ArrowUp") {
|
|
98
|
+
setHighlightIndex((prev) => Math.max(prev - 1, 0));
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
}
|
|
101
|
+
if (e.key === "Enter" && filtered()[highlightIndex()]) {
|
|
102
|
+
const selected = filtered()[highlightIndex()];
|
|
103
|
+
setSearch(selected?.toString() ?? "");
|
|
104
|
+
props.onChange?.(selected);
|
|
105
|
+
setIsOpen(false);
|
|
106
|
+
}
|
|
107
|
+
if (e.key === "Escape") {
|
|
108
|
+
setIsOpen(false);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const handleSelect = (item) => {
|
|
112
|
+
setSearch(item.toString());
|
|
113
|
+
props.onChange?.(item);
|
|
114
|
+
setIsOpen(false);
|
|
115
|
+
};
|
|
116
|
+
const handleClickOutside = (e) => {
|
|
117
|
+
if (!wrapperRef?.contains(e.target)) {
|
|
118
|
+
setIsOpen(false);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
createEffect(() => {
|
|
122
|
+
if (props.value !== void 0) {
|
|
123
|
+
setSearch(props.value.toString());
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
createEffect(() => {
|
|
127
|
+
document.addEventListener("click", handleClickOutside);
|
|
128
|
+
onCleanup(() => {
|
|
129
|
+
document.removeEventListener("click", handleClickOutside);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
return <div class={autocompleteWrapperClass} ref={wrapperRef}>
|
|
133
|
+
<Show when={props.label}>
|
|
134
|
+
<label class={labelClass}>{props.label}</label>
|
|
135
|
+
</Show>
|
|
136
|
+
|
|
137
|
+
<input
|
|
138
|
+
type="text"
|
|
139
|
+
value={search()}
|
|
140
|
+
onInput={handleInput}
|
|
141
|
+
onKeyDown={handleKeyDown}
|
|
142
|
+
onFocus={() => setIsOpen(true)}
|
|
143
|
+
disabled={props.disabled}
|
|
144
|
+
autocomplete="off"
|
|
145
|
+
class={inputBoxClass({
|
|
146
|
+
size: props.size,
|
|
147
|
+
state: props.state ?? (props.disabled ? "disabled" : "default")
|
|
148
|
+
})}
|
|
149
|
+
/>
|
|
150
|
+
|
|
151
|
+
<Show when={isOpen()}>
|
|
152
|
+
<div class={dropdownMenuClass()}>
|
|
153
|
+
<Show
|
|
154
|
+
when={filtered().length > 0}
|
|
155
|
+
fallback={<div class={dropdownEmptyClass}>No data available</div>}
|
|
156
|
+
>
|
|
157
|
+
<For each={filtered()}>
|
|
158
|
+
{(item, i) => <div
|
|
159
|
+
class={dropdownItemClass({
|
|
160
|
+
active: i() === highlightIndex()
|
|
161
|
+
})}
|
|
162
|
+
onMouseDown={() => handleSelect(item)}
|
|
163
|
+
>
|
|
164
|
+
{item}
|
|
165
|
+
</div>}
|
|
166
|
+
</For>
|
|
167
|
+
</Show>
|
|
168
|
+
</div>
|
|
169
|
+
</Show>
|
|
170
|
+
</div>;
|
|
171
|
+
};
|
|
172
|
+
var Autocomplete_default = Autocomplete;
|
|
173
|
+
|
|
174
|
+
// src/components/autocomplete/index.ts
|
|
175
|
+
var autocomplete_default = Autocomplete_default;
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
autocomplete_default
|
|
179
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buttonVariants
|
|
3
|
+
} from "./YAQK2KFY.jsx";
|
|
4
|
+
import {
|
|
5
|
+
classes,
|
|
6
|
+
cva
|
|
7
|
+
} from "./P7WPLZNA.jsx";
|
|
8
|
+
|
|
9
|
+
// src/components/dropdown/Dropdown.tsx
|
|
10
|
+
import {
|
|
11
|
+
splitProps as splitProps2,
|
|
12
|
+
createMemo,
|
|
13
|
+
Show
|
|
14
|
+
} from "solid-js";
|
|
15
|
+
|
|
16
|
+
// src/components/dropdown/useDropdown.ts
|
|
17
|
+
import { createSignal, onMount, onCleanup } from "solid-js";
|
|
18
|
+
function useDropdown(trigger, disabled = false) {
|
|
19
|
+
const [open, setOpen] = createSignal(false);
|
|
20
|
+
let ref;
|
|
21
|
+
const toggle = () => {
|
|
22
|
+
if (!disabled && trigger === "click") {
|
|
23
|
+
setOpen((v) => !v);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const onEnter = () => {
|
|
27
|
+
if (!disabled && trigger === "hover") setOpen(true);
|
|
28
|
+
};
|
|
29
|
+
const onLeave = () => {
|
|
30
|
+
if (!disabled && trigger === "hover") setOpen(false);
|
|
31
|
+
};
|
|
32
|
+
const onClickOutside = (e) => {
|
|
33
|
+
if (trigger === "click" && ref && !ref.contains(e.target)) {
|
|
34
|
+
setOpen(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
onMount(() => {
|
|
38
|
+
document.addEventListener("click", onClickOutside);
|
|
39
|
+
onCleanup(() => document.removeEventListener("click", onClickOutside));
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
open,
|
|
43
|
+
ref: (el) => ref = el,
|
|
44
|
+
toggle,
|
|
45
|
+
onEnter,
|
|
46
|
+
onLeave
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/components/dropdown/DropdownMenu.tsx
|
|
51
|
+
import { splitProps } from "solid-js";
|
|
52
|
+
|
|
53
|
+
// src/components/dropdown/Dropdown.styles.ts
|
|
54
|
+
var dropdownVariants = cva(
|
|
55
|
+
[
|
|
56
|
+
"absolute mt-2 shadow-lg z-10",
|
|
57
|
+
"w-max rounded-md bg-white border border-gray-300",
|
|
58
|
+
"transition-all duration-150 ease-in-out",
|
|
59
|
+
"flex flex-col"
|
|
60
|
+
],
|
|
61
|
+
{
|
|
62
|
+
variants: {
|
|
63
|
+
position: {
|
|
64
|
+
"bottom-left": "left-0 top-full text-black",
|
|
65
|
+
"bottom-right": "right-0 top-full text-black",
|
|
66
|
+
"top-left": "left-0 bottom-full text-black",
|
|
67
|
+
"top-right": "right-0 bottom-full text-black"
|
|
68
|
+
},
|
|
69
|
+
open: {
|
|
70
|
+
true: "block",
|
|
71
|
+
false: "hidden"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
position: "bottom-left",
|
|
76
|
+
open: false
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
var dropdownItemVariants = cva(
|
|
81
|
+
"px-4 py-2 cursor-pointer transition-colors duration-150 ease-in-out hover:bg-gray-100",
|
|
82
|
+
{
|
|
83
|
+
variants: {
|
|
84
|
+
hasLink: { true: "p-0 text-blue-600 hover:underline", false: "" }
|
|
85
|
+
},
|
|
86
|
+
defaultVariants: { hasLink: false }
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// src/components/dropdown/DropdownMenu.tsx
|
|
91
|
+
var DropdownMenu = (props) => {
|
|
92
|
+
const [local, other] = splitProps(props, ["open", "position", "children"]);
|
|
93
|
+
return <div
|
|
94
|
+
class={dropdownVariants({ open: local.open, position: local.position })}
|
|
95
|
+
{...other}
|
|
96
|
+
id="dropdown-menu"
|
|
97
|
+
role="menu"
|
|
98
|
+
>
|
|
99
|
+
{local.children}
|
|
100
|
+
</div>;
|
|
101
|
+
};
|
|
102
|
+
var DropdownMenu_default = DropdownMenu;
|
|
103
|
+
|
|
104
|
+
// src/components/dropdown/Dropdown.tsx
|
|
105
|
+
var Dropdown = (props) => {
|
|
106
|
+
const [localProps, variantProps, restProps] = splitProps2(
|
|
107
|
+
props,
|
|
108
|
+
["label", "disabledLabel", "trigger", "children", "disabled", "color", "class", "className"],
|
|
109
|
+
Object.keys(dropdownVariants.variantKeys ?? {})
|
|
110
|
+
);
|
|
111
|
+
const { open, ref, toggle, onEnter, onLeave } = useDropdown(
|
|
112
|
+
localProps.trigger ?? "click",
|
|
113
|
+
!!localProps.disabled
|
|
114
|
+
);
|
|
115
|
+
const labelContent = createMemo(
|
|
116
|
+
() => localProps.disabled ? localProps.disabledLabel ?? localProps.label : localProps.label ?? "Toggle"
|
|
117
|
+
);
|
|
118
|
+
const containerClass = createMemo(
|
|
119
|
+
() => classes("relative inline-block", localProps.class, localProps.className)
|
|
120
|
+
);
|
|
121
|
+
const buttonClass = createMemo(
|
|
122
|
+
() => buttonVariants({
|
|
123
|
+
color: "primary"
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
return <div
|
|
127
|
+
ref={ref}
|
|
128
|
+
onMouseEnter={onEnter}
|
|
129
|
+
onMouseLeave={onLeave}
|
|
130
|
+
class={containerClass()}
|
|
131
|
+
{...restProps}
|
|
132
|
+
>
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
onClick={(e) => {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
if (localProps.trigger === "click") toggle();
|
|
138
|
+
}}
|
|
139
|
+
class={buttonClass()}
|
|
140
|
+
aria-disabled={localProps.disabled}
|
|
141
|
+
disabled={localProps.disabled}
|
|
142
|
+
aria-controls="dropdown-menu"
|
|
143
|
+
>
|
|
144
|
+
{labelContent()}
|
|
145
|
+
</button>
|
|
146
|
+
|
|
147
|
+
<Show when={open()}>
|
|
148
|
+
<DropdownMenu_default open {...variantProps}>
|
|
149
|
+
{localProps.children}
|
|
150
|
+
</DropdownMenu_default>
|
|
151
|
+
</Show>
|
|
152
|
+
</div>;
|
|
153
|
+
};
|
|
154
|
+
var Dropdown_default = Dropdown;
|
|
155
|
+
|
|
156
|
+
// src/components/dropdown/DropdownItem.tsx
|
|
157
|
+
import "solid-js";
|
|
158
|
+
var DropdownItem = ({ hasLink = false, children }) => {
|
|
159
|
+
return <div class={dropdownItemVariants({ hasLink })}>
|
|
160
|
+
{children}
|
|
161
|
+
</div>;
|
|
162
|
+
};
|
|
163
|
+
var DropdownItem_default = DropdownItem;
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
DropdownMenu_default,
|
|
167
|
+
Dropdown_default,
|
|
168
|
+
DropdownItem_default
|
|
169
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "./P7WPLZNA.jsx";
|
|
5
|
+
|
|
6
|
+
// src/components/timeline/Timeline.tsx
|
|
7
|
+
import { For } from "solid-js";
|
|
8
|
+
|
|
9
|
+
// src/components/timeline/Timeline.styles.ts
|
|
10
|
+
var timelineWrapperClass = "relative";
|
|
11
|
+
var timelineItemClass = cva(
|
|
12
|
+
"relative flex items-center gap-3 min-h-[48px]",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
state: {
|
|
16
|
+
default: "text-gray-500",
|
|
17
|
+
active: "text-green-500 font-medium",
|
|
18
|
+
error: "text-red-500 font-medium"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
state: "default"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
var timelineMarkerWrapperClass = "relative w-6 min-h-[48px] flex items-center justify-center";
|
|
27
|
+
var timelineLineClass = "absolute top-0 bottom-0 left-1/2 -translate-x-1/2 w-px bg-gray-300 dark:bg-gray-600";
|
|
28
|
+
var timelineMarkerClass = "absolute w-3 h-3 rounded-full border-2 border-white bg-gray-400 z-10";
|
|
29
|
+
var timelineNumberClass = cva(
|
|
30
|
+
"absolute -left-4 top-1/2 -translate-y-1/2 text-xs font-semibold",
|
|
31
|
+
{
|
|
32
|
+
variants: {
|
|
33
|
+
state: {
|
|
34
|
+
default: "text-gray-500",
|
|
35
|
+
active: "text-green-500",
|
|
36
|
+
error: "text-red-500"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
state: "default"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
var timelineContentClass = "pt-0.5 text-sm";
|
|
45
|
+
|
|
46
|
+
// src/components/timeline/Timeline.tsx
|
|
47
|
+
var Timeline = (props) => {
|
|
48
|
+
return <ol class={timelineWrapperClass}>
|
|
49
|
+
<For each={props.stages}>
|
|
50
|
+
{(stage, index) => {
|
|
51
|
+
const state = stage.error === true ? "error" : stage.active === true ? "active" : "default";
|
|
52
|
+
return <li class={timelineItemClass({ state })}>
|
|
53
|
+
<div class={timelineMarkerWrapperClass}>
|
|
54
|
+
<div class={timelineLineClass} />
|
|
55
|
+
<span
|
|
56
|
+
class={classes(
|
|
57
|
+
timelineMarkerClass,
|
|
58
|
+
state === "active" && "bg-green-500",
|
|
59
|
+
state === "error" && "bg-red-500"
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
62
|
+
<span class={timelineNumberClass({ state })}>
|
|
63
|
+
{index() + 1}.
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div class={timelineContentClass}>
|
|
67
|
+
{props.renderStage ? props.renderStage(stage, index()) : stage.title}
|
|
68
|
+
</div>
|
|
69
|
+
</li>;
|
|
70
|
+
}}
|
|
71
|
+
</For>
|
|
72
|
+
</ol>;
|
|
73
|
+
};
|
|
74
|
+
var Timeline_default = Timeline;
|
|
75
|
+
|
|
76
|
+
// src/components/timeline/index.ts
|
|
77
|
+
var timeline_default = Timeline_default;
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
timeline_default
|
|
81
|
+
};
|