@pathscale/ui 0.0.1
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/LICENSE +21 -0
- package/README.md +12 -0
- package/dist/Avatar-CzIirpVq.d.ts +33 -0
- package/dist/Button-B50OLXuV.d.ts +63 -0
- package/dist/Input-BQbTzjIO.d.ts +34 -0
- package/dist/Textarea-Cpdk7m6S.d.ts +37 -0
- package/dist/chunk/2JGZSAW5.js +107 -0
- package/dist/chunk/4RCWSX7S.jsx +101 -0
- package/dist/chunk/EB7KXR65.js +102 -0
- package/dist/chunk/G6RG4LR7.js +87 -0
- package/dist/chunk/GA2HCFRS.jsx +228 -0
- package/dist/chunk/HKS7ET6T.js +56 -0
- package/dist/chunk/KACNXPUM.jsx +103 -0
- package/dist/chunk/N7BXP7EI.jsx +102 -0
- package/dist/chunk/NZZRKP74.js +214 -0
- package/dist/chunk/P7WPLZNA.jsx +59 -0
- package/dist/chunk/T2DPPLBQ.js +100 -0
- package/dist/chunk/WB6NEEQV.jsx +107 -0
- package/dist/classes-B_S9K-9I.d.ts +13 -0
- package/dist/components/Progress/index.d.ts +42 -0
- package/dist/components/Progress/index.js +278 -0
- package/dist/components/Progress/index.jsx +202 -0
- package/dist/components/accordion/index.d.ts +27 -0
- package/dist/components/accordion/index.js +118 -0
- package/dist/components/accordion/index.jsx +104 -0
- package/dist/components/avatar/index.d.ts +8 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar/index.jsx +7 -0
- package/dist/components/breadcrumb/index.d.ts +47 -0
- package/dist/components/breadcrumb/index.js +133 -0
- package/dist/components/breadcrumb/index.jsx +125 -0
- package/dist/components/button/index.d.ts +9 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/index.jsx +8 -0
- package/dist/components/checkbox/index.d.ts +40 -0
- package/dist/components/checkbox/index.js +137 -0
- package/dist/components/checkbox/index.jsx +147 -0
- package/dist/components/input/index.d.ts +8 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/index.jsx +7 -0
- package/dist/components/pagination/index.d.ts +43 -0
- package/dist/components/pagination/index.js +189 -0
- package/dist/components/pagination/index.jsx +178 -0
- package/dist/components/polymorphic/index.d.ts +35 -0
- package/dist/components/polymorphic/index.js +1 -0
- package/dist/components/polymorphic/index.jsx +8 -0
- package/dist/components/select/index.d.ts +44 -0
- package/dist/components/select/index.js +98 -0
- package/dist/components/select/index.jsx +95 -0
- package/dist/components/switch/index.d.ts +72 -0
- package/dist/components/switch/index.js +144 -0
- package/dist/components/switch/index.jsx +159 -0
- package/dist/components/tabs/index.d.ts +42 -0
- package/dist/components/tabs/index.js +166 -0
- package/dist/components/tabs/index.jsx +174 -0
- package/dist/components/tag/index.d.ts +42 -0
- package/dist/components/tag/index.js +115 -0
- package/dist/components/tag/index.jsx +131 -0
- package/dist/components/textarea/index.d.ts +8 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/index.jsx +7 -0
- package/dist/components/tooltip/index.d.ts +53 -0
- package/dist/components/tooltip/index.js +103 -0
- package/dist/components/tooltip/index.jsx +99 -0
- package/dist/components/upload/index.d.ts +39 -0
- package/dist/components/upload/index.js +98 -0
- package/dist/components/upload/index.jsx +109 -0
- package/dist/index.css +73 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/index.jsx +20 -0
- package/package.json +67 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "../../chunk/P7WPLZNA.jsx";
|
|
4
|
+
|
|
5
|
+
// src/components/tabs/Tabs.tsx
|
|
6
|
+
import {
|
|
7
|
+
createSignal,
|
|
8
|
+
splitProps,
|
|
9
|
+
For,
|
|
10
|
+
Show,
|
|
11
|
+
createMemo
|
|
12
|
+
} from "solid-js";
|
|
13
|
+
|
|
14
|
+
// src/components/tabs/Tabs.styles.ts
|
|
15
|
+
var tabsNavVariants = cva(
|
|
16
|
+
"flex text-sm font-medium text-gray-600 dark:text-gray-300",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
type: {
|
|
20
|
+
basic: "",
|
|
21
|
+
boxed: "flex gap-2",
|
|
22
|
+
toggle: "inline-flex rounded-md p-1",
|
|
23
|
+
"toggle-rounded": "inline-flex rounded-full p-1"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
sm: "text-xs gap-1",
|
|
27
|
+
md: "text-sm gap-2",
|
|
28
|
+
lg: "text-base gap-3"
|
|
29
|
+
},
|
|
30
|
+
alignment: {
|
|
31
|
+
left: "justify-start",
|
|
32
|
+
center: "justify-center",
|
|
33
|
+
right: "justify-end"
|
|
34
|
+
},
|
|
35
|
+
expanded: {
|
|
36
|
+
true: "w-full",
|
|
37
|
+
false: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
type: "basic",
|
|
42
|
+
size: "md",
|
|
43
|
+
alignment: "left",
|
|
44
|
+
expanded: false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
var tabTriggerVariants = cva(
|
|
49
|
+
"inline-flex items-center justify-center whitespace-nowrap font-medium text-sm transition-colors",
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
size: {
|
|
53
|
+
sm: "text-xs px-2 py-1",
|
|
54
|
+
md: "text-sm px-3 py-2",
|
|
55
|
+
lg: "text-base px-4 py-3"
|
|
56
|
+
},
|
|
57
|
+
type: {
|
|
58
|
+
basic: "border-b-2 transition-colors hover:text-blue-600",
|
|
59
|
+
boxed: "rounded-t px-4 py-2 hover:text-blue-600",
|
|
60
|
+
toggle: "border -ml-px px-4 py-2 transition-colors first:ml-0 first:rounded-l-md last:rounded-r-md",
|
|
61
|
+
"toggle-rounded": "border -ml-px first:ml-0 first:rounded-l-full last:rounded-r-full transition-colors"
|
|
62
|
+
},
|
|
63
|
+
active: {
|
|
64
|
+
true: "",
|
|
65
|
+
false: ""
|
|
66
|
+
},
|
|
67
|
+
disabled: {
|
|
68
|
+
true: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
69
|
+
false: ""
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
compoundVariants: [
|
|
73
|
+
{
|
|
74
|
+
type: "basic",
|
|
75
|
+
active: true,
|
|
76
|
+
class: "border-blue-600 text-blue-600"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "basic",
|
|
80
|
+
active: false,
|
|
81
|
+
class: "border-transparent text-gray-500 dark:text-gray-400"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "boxed",
|
|
85
|
+
active: true,
|
|
86
|
+
class: "border-x border-t border-b-0 border-gray-400 dark:border-gray-600 text-blue-600"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "boxed",
|
|
90
|
+
active: false,
|
|
91
|
+
class: "border-b border-transparent text-gray-500 dark:text-gray-400 hover:text-blue-600"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "toggle",
|
|
95
|
+
active: true,
|
|
96
|
+
class: "bg-blue-600 text-white border-blue-600"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "toggle",
|
|
100
|
+
active: false,
|
|
101
|
+
class: "bg-transparent text-gray-600 dark:text-gray-300 border-gray-300 dark:border-gray-600"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "toggle-rounded",
|
|
105
|
+
active: true,
|
|
106
|
+
class: "bg-blue-600 text-white border-blue-600"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "toggle-rounded",
|
|
110
|
+
active: false,
|
|
111
|
+
class: "bg-transparent text-gray-600 dark:text-gray-300 border-gray-300 dark:border-gray-600"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
active: false,
|
|
116
|
+
disabled: false
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// src/components/tabs/Tabs.tsx
|
|
122
|
+
var Tabs = (props) => {
|
|
123
|
+
const [local, variantProps, otherProps] = splitProps(
|
|
124
|
+
props,
|
|
125
|
+
["items", "value", "onChange"],
|
|
126
|
+
["size", "type", "alignment", "expanded"]
|
|
127
|
+
);
|
|
128
|
+
const [internalActive, setInternalActive] = createSignal(local.value ?? 0);
|
|
129
|
+
const isControlled = () => local.value !== void 0;
|
|
130
|
+
const active = createMemo(
|
|
131
|
+
() => isControlled() ? local.value : internalActive()
|
|
132
|
+
);
|
|
133
|
+
const handleChange = (i) => {
|
|
134
|
+
const item = local.items[i];
|
|
135
|
+
if (!item || item.disabled) return;
|
|
136
|
+
if (!isControlled()) {
|
|
137
|
+
setInternalActive(i);
|
|
138
|
+
}
|
|
139
|
+
local.onChange?.(i);
|
|
140
|
+
};
|
|
141
|
+
return <div {...otherProps}>
|
|
142
|
+
<nav class={tabsNavVariants(variantProps)}>
|
|
143
|
+
<ul class="flex gap-0">
|
|
144
|
+
<For each={local.items}>
|
|
145
|
+
{(tab, i) => <li>
|
|
146
|
+
<button
|
|
147
|
+
class={tabTriggerVariants({
|
|
148
|
+
type: variantProps.type ?? "basic",
|
|
149
|
+
size: variantProps.size ?? "md",
|
|
150
|
+
active: i() === active(),
|
|
151
|
+
disabled: tab.disabled
|
|
152
|
+
})}
|
|
153
|
+
onClick={() => handleChange(i())}
|
|
154
|
+
>
|
|
155
|
+
{tab.label}
|
|
156
|
+
</button>
|
|
157
|
+
</li>}
|
|
158
|
+
</For>
|
|
159
|
+
</ul>
|
|
160
|
+
</nav>
|
|
161
|
+
<div class="pt-4">
|
|
162
|
+
<Show when={local.items[active()]}>
|
|
163
|
+
{local.items[active()]?.content}
|
|
164
|
+
</Show>
|
|
165
|
+
</div>
|
|
166
|
+
</div>;
|
|
167
|
+
};
|
|
168
|
+
var Tabs_default = Tabs;
|
|
169
|
+
|
|
170
|
+
// src/components/tabs/index.ts
|
|
171
|
+
var tabs_default = Tabs_default;
|
|
172
|
+
export {
|
|
173
|
+
tabs_default as default
|
|
174
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentProps, JSX, Component } from 'solid-js';
|
|
2
|
+
import { C as ConfigVariants, a as ClassProps, V as VariantProps } from '../../classes-B_S9K-9I.js';
|
|
3
|
+
|
|
4
|
+
declare const tagVariants: {
|
|
5
|
+
(props?: (ConfigVariants<{
|
|
6
|
+
size: {
|
|
7
|
+
normal: string;
|
|
8
|
+
medium: string;
|
|
9
|
+
large: string;
|
|
10
|
+
};
|
|
11
|
+
type: {
|
|
12
|
+
primary: string;
|
|
13
|
+
info: string;
|
|
14
|
+
success: string;
|
|
15
|
+
warning: string;
|
|
16
|
+
danger: string;
|
|
17
|
+
dark: string;
|
|
18
|
+
light: string;
|
|
19
|
+
};
|
|
20
|
+
rounded: {
|
|
21
|
+
true: string;
|
|
22
|
+
false: string;
|
|
23
|
+
};
|
|
24
|
+
closable: {
|
|
25
|
+
true: string;
|
|
26
|
+
false: string;
|
|
27
|
+
};
|
|
28
|
+
}> & ClassProps) | undefined): string;
|
|
29
|
+
variantKeys: ("size" | "type" | "rounded" | "closable")[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type TagProps = VariantProps<typeof tagVariants> & ClassProps & ComponentProps<"span"> & {
|
|
33
|
+
closable?: boolean;
|
|
34
|
+
attached?: boolean;
|
|
35
|
+
ariaCloseLabel?: string;
|
|
36
|
+
onClose?: (e: MouseEvent) => void;
|
|
37
|
+
closeIcon?: JSX.Element;
|
|
38
|
+
children?: JSX.Element;
|
|
39
|
+
};
|
|
40
|
+
declare const Tag: Component<TagProps>;
|
|
41
|
+
|
|
42
|
+
export { type TagProps, Tag as default };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { cva, classes } from '../../chunk/HKS7ET6T.js';
|
|
2
|
+
import { delegateEvents, template, spread, mergeProps, insert, createComponent, effect, setAttribute, className } from 'solid-js/web';
|
|
3
|
+
import { splitProps, createMemo, untrack, Show } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/tag/Tag.styles.ts
|
|
6
|
+
var tagVariants = cva(
|
|
7
|
+
[
|
|
8
|
+
"inline-flex items-center gap-2 px-3 py-1 text-sm rounded",
|
|
9
|
+
"transition select-none"
|
|
10
|
+
],
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
normal: "text-xs px-2 py-0.5",
|
|
15
|
+
medium: "text-sm px-3 py-1",
|
|
16
|
+
large: "text-base px-4 py-2"
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
primary: "bg-blue-500 text-white",
|
|
20
|
+
info: "bg-sky-500 text-white",
|
|
21
|
+
success: "bg-green-500 text-white",
|
|
22
|
+
warning: "bg-yellow-500 text-black",
|
|
23
|
+
danger: "bg-red-500 text-white",
|
|
24
|
+
dark: "bg-zinc-800 text-white",
|
|
25
|
+
light: "bg-gray-100 text-black"
|
|
26
|
+
},
|
|
27
|
+
rounded: {
|
|
28
|
+
true: "rounded-full",
|
|
29
|
+
false: ""
|
|
30
|
+
},
|
|
31
|
+
closable: {
|
|
32
|
+
true: "pr-1",
|
|
33
|
+
false: ""
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
size: "normal"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// src/components/tag/Tag.tsx
|
|
43
|
+
var _tmpl$ = /* @__PURE__ */ template(`<button type=button class="ml-2 text-xs text-white hover:opacity-80">`);
|
|
44
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<button type=button>`);
|
|
45
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div role=group><span role=status><span class=truncate>`);
|
|
46
|
+
var Tag = (props) => {
|
|
47
|
+
const [localProps, variantProps, otherProps] = splitProps(props, ["closable", "attached", "onClose", "ariaCloseLabel", "closeIcon", "children", "type"], ["class", ...tagVariants.variantKeys]);
|
|
48
|
+
const isAttachedClosable = createMemo(() => untrack(() => localProps.attached && localProps.closable));
|
|
49
|
+
const isClosable = createMemo(() => untrack(() => localProps.closable && !localProps.attached));
|
|
50
|
+
const tagClasses = createMemo(() => classes(tagVariants({
|
|
51
|
+
...variantProps,
|
|
52
|
+
closable: localProps.closable
|
|
53
|
+
}), variantProps.class));
|
|
54
|
+
const attachedButtonClasses = createMemo(() => tagVariants({
|
|
55
|
+
...variantProps,
|
|
56
|
+
class: "ml-1 text-xs hover:opacity-80"
|
|
57
|
+
}));
|
|
58
|
+
const handleClose = (e) => {
|
|
59
|
+
untrack(() => {
|
|
60
|
+
if (typeof localProps.onClose === "function") {
|
|
61
|
+
localProps.onClose(e);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
return (() => {
|
|
66
|
+
var _el$ = _tmpl$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
67
|
+
spread(_el$2, mergeProps({
|
|
68
|
+
get ["class"]() {
|
|
69
|
+
return tagClasses();
|
|
70
|
+
}
|
|
71
|
+
}, otherProps), false, true);
|
|
72
|
+
insert(_el$3, () => localProps.children);
|
|
73
|
+
insert(_el$2, createComponent(Show, {
|
|
74
|
+
get when() {
|
|
75
|
+
return isClosable();
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
var _el$4 = _tmpl$();
|
|
79
|
+
_el$4.$$click = handleClose;
|
|
80
|
+
insert(_el$4, () => localProps.closeIcon ?? "\xD7");
|
|
81
|
+
effect(() => setAttribute(_el$4, "aria-label", localProps.ariaCloseLabel ?? "Remove tag"));
|
|
82
|
+
return _el$4;
|
|
83
|
+
}
|
|
84
|
+
}), null);
|
|
85
|
+
insert(_el$, createComponent(Show, {
|
|
86
|
+
get when() {
|
|
87
|
+
return isAttachedClosable();
|
|
88
|
+
},
|
|
89
|
+
get children() {
|
|
90
|
+
var _el$5 = _tmpl$2();
|
|
91
|
+
_el$5.$$click = handleClose;
|
|
92
|
+
insert(_el$5, () => localProps.closeIcon ?? "\xD7");
|
|
93
|
+
effect((_p$) => {
|
|
94
|
+
var _v$ = localProps.ariaCloseLabel ?? "Remove tag", _v$2 = attachedButtonClasses();
|
|
95
|
+
_v$ !== _p$.e && setAttribute(_el$5, "aria-label", _p$.e = _v$);
|
|
96
|
+
_v$2 !== _p$.t && className(_el$5, _p$.t = _v$2);
|
|
97
|
+
return _p$;
|
|
98
|
+
}, {
|
|
99
|
+
e: void 0,
|
|
100
|
+
t: void 0
|
|
101
|
+
});
|
|
102
|
+
return _el$5;
|
|
103
|
+
}
|
|
104
|
+
}), null);
|
|
105
|
+
effect(() => className(_el$, isAttachedClosable() ? "tags has-addons" : void 0));
|
|
106
|
+
return _el$;
|
|
107
|
+
})();
|
|
108
|
+
};
|
|
109
|
+
var Tag_default = Tag;
|
|
110
|
+
delegateEvents(["click"]);
|
|
111
|
+
|
|
112
|
+
// src/components/tag/index.ts
|
|
113
|
+
var tag_default = Tag_default;
|
|
114
|
+
|
|
115
|
+
export { tag_default as default };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classes,
|
|
3
|
+
cva
|
|
4
|
+
} from "../../chunk/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
|
+
export {
|
|
130
|
+
tag_default as default
|
|
131
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { textarea_default as default } from '../../chunk/EB7KXR65.js';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { JSX, Component } from 'solid-js';
|
|
2
|
+
import { C as ConfigVariants, a as ClassProps, V as VariantProps } from '../../classes-B_S9K-9I.js';
|
|
3
|
+
|
|
4
|
+
declare const tooltipVariants: {
|
|
5
|
+
(props?: (ConfigVariants<{
|
|
6
|
+
type: {
|
|
7
|
+
info: string;
|
|
8
|
+
success: string;
|
|
9
|
+
warning: string;
|
|
10
|
+
danger: string;
|
|
11
|
+
primary: string;
|
|
12
|
+
gray: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
sm: string;
|
|
16
|
+
md: string;
|
|
17
|
+
lg: string;
|
|
18
|
+
};
|
|
19
|
+
rounded: {
|
|
20
|
+
true: string;
|
|
21
|
+
false: string;
|
|
22
|
+
};
|
|
23
|
+
dashed: {
|
|
24
|
+
true: string;
|
|
25
|
+
false: string;
|
|
26
|
+
};
|
|
27
|
+
multilined: {
|
|
28
|
+
true: string;
|
|
29
|
+
false: string;
|
|
30
|
+
};
|
|
31
|
+
animated: {
|
|
32
|
+
true: string;
|
|
33
|
+
false: string;
|
|
34
|
+
};
|
|
35
|
+
position: {
|
|
36
|
+
top: string;
|
|
37
|
+
bottom: string;
|
|
38
|
+
left: string;
|
|
39
|
+
right: string;
|
|
40
|
+
};
|
|
41
|
+
}> & ClassProps) | undefined): string;
|
|
42
|
+
variantKeys: ("type" | "size" | "rounded" | "dashed" | "multilined" | "animated" | "position")[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type TooltipProps = {
|
|
46
|
+
label: string;
|
|
47
|
+
delay?: number;
|
|
48
|
+
always?: boolean;
|
|
49
|
+
children?: JSX.Element;
|
|
50
|
+
} & VariantProps<typeof tooltipVariants> & JSX.HTMLAttributes<HTMLSpanElement>;
|
|
51
|
+
declare const Tooltip: Component<TooltipProps>;
|
|
52
|
+
|
|
53
|
+
export { type TooltipProps, Tooltip as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { cva } from '../../chunk/HKS7ET6T.js';
|
|
2
|
+
import { template, spread, insert, createComponent, effect, className } from 'solid-js/web';
|
|
3
|
+
import { splitProps, Show } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/tooltip/Tooltip.styles.ts
|
|
6
|
+
var tooltipVariants = cva(
|
|
7
|
+
[
|
|
8
|
+
"absolute z-10 px-3 py-1 text-white text-sm",
|
|
9
|
+
"opacity-0 group-hover:opacity-100",
|
|
10
|
+
"pointer-events-none transition-opacity duration-200",
|
|
11
|
+
"max-w-xs break-words",
|
|
12
|
+
"after:content-[''] after:absolute after:w-2 after:h-2 after:rotate-45 after:bg-inherit"
|
|
13
|
+
].join(" "),
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
type: {
|
|
17
|
+
info: "bg-blue-500",
|
|
18
|
+
success: "bg-green-500",
|
|
19
|
+
warning: "bg-yellow-500",
|
|
20
|
+
danger: "bg-red-500",
|
|
21
|
+
primary: "bg-indigo-500",
|
|
22
|
+
gray: "bg-gray-700"
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
sm: "text-xs",
|
|
26
|
+
md: "text-sm",
|
|
27
|
+
lg: "text-base"
|
|
28
|
+
},
|
|
29
|
+
rounded: {
|
|
30
|
+
true: "rounded",
|
|
31
|
+
false: "rounded-none"
|
|
32
|
+
},
|
|
33
|
+
dashed: {
|
|
34
|
+
true: "border border-white border-dashed",
|
|
35
|
+
false: ""
|
|
36
|
+
},
|
|
37
|
+
multilined: {
|
|
38
|
+
true: "whitespace-pre-wrap",
|
|
39
|
+
false: "whitespace-nowrap"
|
|
40
|
+
},
|
|
41
|
+
animated: {
|
|
42
|
+
true: "transition-opacity duration-300 ease-in-out",
|
|
43
|
+
false: ""
|
|
44
|
+
},
|
|
45
|
+
position: {
|
|
46
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-1 after:top-full after:left-1/2 after:-translate-x-1/2 after:-mt-1",
|
|
47
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-1 after:bottom-full after:left-1/2 after:-translate-x-1/2 after:-mb-1",
|
|
48
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-1 after:left-full after:top-1/2 after:-translate-y-1/2 after:-ml-1",
|
|
49
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-1 after:right-full after:top-1/2 after:-translate-y-1/2 after:-mr-1"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
type: "primary",
|
|
54
|
+
size: "md",
|
|
55
|
+
rounded: true,
|
|
56
|
+
dashed: false,
|
|
57
|
+
multilined: false,
|
|
58
|
+
animated: true,
|
|
59
|
+
position: "top"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// src/components/tooltip/Tooltip.tsx
|
|
65
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
66
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span class="relative inline-block group">`);
|
|
67
|
+
var Tooltip = (props) => {
|
|
68
|
+
const [local, variantProps, otherProps] = splitProps(props, ["label", "delay", "always", "children"], ["type", "size", "position", "rounded", "dashed", "multilined", "animated"]);
|
|
69
|
+
return (() => {
|
|
70
|
+
var _el$ = _tmpl$2();
|
|
71
|
+
spread(_el$, otherProps, false, true);
|
|
72
|
+
insert(_el$, () => local.children, null);
|
|
73
|
+
insert(_el$, createComponent(Show, {
|
|
74
|
+
get when() {
|
|
75
|
+
return local.label;
|
|
76
|
+
},
|
|
77
|
+
get children() {
|
|
78
|
+
var _el$2 = _tmpl$();
|
|
79
|
+
_el$2.style.setProperty("pointer-events", "none");
|
|
80
|
+
insert(_el$2, () => local.label);
|
|
81
|
+
effect((_p$) => {
|
|
82
|
+
var _v$ = tooltipVariants(variantProps), _v$2 = `${local.delay ?? 0}ms`, _v$3 = local.always ? 1 : void 0;
|
|
83
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
84
|
+
_v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$2.style.setProperty("transition-delay", _v$2) : _el$2.style.removeProperty("transition-delay"));
|
|
85
|
+
_v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$2.style.setProperty("opacity", _v$3) : _el$2.style.removeProperty("opacity"));
|
|
86
|
+
return _p$;
|
|
87
|
+
}, {
|
|
88
|
+
e: void 0,
|
|
89
|
+
t: void 0,
|
|
90
|
+
a: void 0
|
|
91
|
+
});
|
|
92
|
+
return _el$2;
|
|
93
|
+
}
|
|
94
|
+
}), null);
|
|
95
|
+
return _el$;
|
|
96
|
+
})();
|
|
97
|
+
};
|
|
98
|
+
var Tooltip_default = Tooltip;
|
|
99
|
+
|
|
100
|
+
// src/components/tooltip/index.ts
|
|
101
|
+
var tooltip_default = Tooltip_default;
|
|
102
|
+
|
|
103
|
+
export { tooltip_default as default };
|