@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,189 @@
|
|
|
1
|
+
import { cva } from './HKS7ET6T.js';
|
|
2
|
+
import { delegateEvents, template, spread, mergeProps, insert, createComponent, memo, effect, className } from 'solid-js/web';
|
|
3
|
+
import { splitProps, createMemo, Show, For } from 'solid-js';
|
|
4
|
+
|
|
5
|
+
// src/components/pagination/Pagination.styles.ts
|
|
6
|
+
var paginationItemVariants = cva(
|
|
7
|
+
[
|
|
8
|
+
"inline-flex items-center justify-center font-medium transition-colors",
|
|
9
|
+
"select-none border border-transparent",
|
|
10
|
+
// border shown only when needed
|
|
11
|
+
"disabled:opacity-50 disabled:pointer-events-none"
|
|
12
|
+
],
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
active: {
|
|
16
|
+
true: "bg-blue-500 text-white hover:bg-blue-600",
|
|
17
|
+
false: "bg-transparent text-gray-700 hover:bg-gray-200 dark:text-gray-200 dark:hover:bg-gray-700"
|
|
18
|
+
},
|
|
19
|
+
rounded: {
|
|
20
|
+
true: "rounded-full",
|
|
21
|
+
false: "rounded"
|
|
22
|
+
},
|
|
23
|
+
simple: {
|
|
24
|
+
true: "border-none bg-transparent hover:bg-transparent text-gray-700 dark:text-gray-300",
|
|
25
|
+
false: ""
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: "text-xs px-2 py-1",
|
|
29
|
+
md: "text-sm px-3 py-1.5",
|
|
30
|
+
lg: "text-base px-4 py-2"
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
true: "opacity-50 pointer-events-none",
|
|
34
|
+
false: ""
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
active: false,
|
|
39
|
+
rounded: false,
|
|
40
|
+
simple: false,
|
|
41
|
+
size: "md",
|
|
42
|
+
disabled: false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
var paginationInfoVariants = cva(
|
|
47
|
+
"inline-block font-medium transition-colors",
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
simple: {
|
|
51
|
+
true: "text-sm text-gray-600 dark:text-gray-300 px-2",
|
|
52
|
+
false: "text-sm text-gray-700 dark:text-gray-200 px-2"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
simple: false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
var paginationContainerVariants = cva(
|
|
61
|
+
"flex items-center gap-1 flex-wrap",
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
align: {
|
|
65
|
+
start: "justify-start",
|
|
66
|
+
center: "justify-center",
|
|
67
|
+
end: "justify-end"
|
|
68
|
+
},
|
|
69
|
+
wrap: {
|
|
70
|
+
true: "flex-wrap",
|
|
71
|
+
false: "flex-nowrap"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
align: "start",
|
|
76
|
+
wrap: true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
// src/components/pagination/Pagination.tsx
|
|
82
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
83
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<nav><button>«</button><button>»`);
|
|
84
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<button>`);
|
|
85
|
+
var Pagination = (props) => {
|
|
86
|
+
const [local, variantProps, otherProps] = splitProps(props, ["total", "perPage", "current", "onChange", "rangeBefore", "rangeAfter", "simple", "children"], ["rounded", "size", "disabled", "active", "simple"]);
|
|
87
|
+
const perPage = () => local.perPage ?? 20;
|
|
88
|
+
const pageCount = createMemo(() => Math.ceil(local.total / perPage()));
|
|
89
|
+
const hasPrev = createMemo(() => local.current > 1);
|
|
90
|
+
const hasNext = createMemo(() => local.current < pageCount());
|
|
91
|
+
const pagesInRange = createMemo(() => {
|
|
92
|
+
const before = local.rangeBefore ?? 1;
|
|
93
|
+
const after = local.rangeAfter ?? 1;
|
|
94
|
+
const start = Math.max(1, local.current - before);
|
|
95
|
+
const end = Math.min(local.current + after, pageCount());
|
|
96
|
+
return Array.from({
|
|
97
|
+
length: end - start + 1
|
|
98
|
+
}, (_, i) => start + i);
|
|
99
|
+
});
|
|
100
|
+
const changePage = (page) => {
|
|
101
|
+
if (page >= 1 && page <= pageCount() && page !== local.current) {
|
|
102
|
+
local.onChange(page);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return (() => {
|
|
106
|
+
var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
|
|
107
|
+
spread(_el$, mergeProps({
|
|
108
|
+
get ["class"]() {
|
|
109
|
+
return paginationContainerVariants({
|
|
110
|
+
align: "start",
|
|
111
|
+
wrap: true
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}, otherProps), false, true);
|
|
115
|
+
_el$2.$$click = () => changePage(local.current - 1);
|
|
116
|
+
insert(_el$, createComponent(Show, {
|
|
117
|
+
get when() {
|
|
118
|
+
return pageCount() > 1;
|
|
119
|
+
},
|
|
120
|
+
get children() {
|
|
121
|
+
return [createComponent(Show, {
|
|
122
|
+
get when() {
|
|
123
|
+
return local.simple;
|
|
124
|
+
},
|
|
125
|
+
get children() {
|
|
126
|
+
var _el$3 = _tmpl$();
|
|
127
|
+
insert(_el$3, (() => {
|
|
128
|
+
var _c$ = memo(() => perPage() === 1);
|
|
129
|
+
return () => _c$() ? `${(local.current - 1) * perPage() + 1} / ${local.total}` : `${(local.current - 1) * perPage() + 1}-${Math.min(local.current * perPage(), local.total)} / ${local.total}`;
|
|
130
|
+
})());
|
|
131
|
+
effect(() => className(_el$3, paginationInfoVariants({
|
|
132
|
+
simple: true
|
|
133
|
+
})));
|
|
134
|
+
return _el$3;
|
|
135
|
+
}
|
|
136
|
+
}), createComponent(Show, {
|
|
137
|
+
get when() {
|
|
138
|
+
return !local.simple;
|
|
139
|
+
},
|
|
140
|
+
get children() {
|
|
141
|
+
return createComponent(For, {
|
|
142
|
+
get each() {
|
|
143
|
+
return pagesInRange();
|
|
144
|
+
},
|
|
145
|
+
children: (page) => (() => {
|
|
146
|
+
var _el$5 = _tmpl$3();
|
|
147
|
+
_el$5.$$click = () => changePage(page);
|
|
148
|
+
insert(_el$5, page);
|
|
149
|
+
effect(() => className(_el$5, paginationItemVariants({
|
|
150
|
+
...variantProps,
|
|
151
|
+
active: page === local.current
|
|
152
|
+
})));
|
|
153
|
+
return _el$5;
|
|
154
|
+
})()
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
})];
|
|
158
|
+
}
|
|
159
|
+
}), _el$4);
|
|
160
|
+
_el$4.$$click = () => changePage(local.current + 1);
|
|
161
|
+
effect((_p$) => {
|
|
162
|
+
var _v$ = paginationItemVariants({
|
|
163
|
+
...variantProps,
|
|
164
|
+
disabled: !hasPrev()
|
|
165
|
+
}), _v$2 = !hasPrev(), _v$3 = paginationItemVariants({
|
|
166
|
+
...variantProps,
|
|
167
|
+
disabled: !hasNext()
|
|
168
|
+
}), _v$4 = !hasNext();
|
|
169
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
170
|
+
_v$2 !== _p$.t && (_el$2.disabled = _p$.t = _v$2);
|
|
171
|
+
_v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
|
|
172
|
+
_v$4 !== _p$.o && (_el$4.disabled = _p$.o = _v$4);
|
|
173
|
+
return _p$;
|
|
174
|
+
}, {
|
|
175
|
+
e: void 0,
|
|
176
|
+
t: void 0,
|
|
177
|
+
a: void 0,
|
|
178
|
+
o: void 0
|
|
179
|
+
});
|
|
180
|
+
return _el$;
|
|
181
|
+
})();
|
|
182
|
+
};
|
|
183
|
+
var Pagination_default = Pagination;
|
|
184
|
+
delegateEvents(["click"]);
|
|
185
|
+
|
|
186
|
+
// src/components/pagination/index.ts
|
|
187
|
+
var pagination_default = Pagination_default;
|
|
188
|
+
|
|
189
|
+
export { pagination_default };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "./P7WPLZNA.jsx";
|
|
4
|
+
|
|
5
|
+
// src/components/tooltip/Tooltip.tsx
|
|
6
|
+
import {
|
|
7
|
+
splitProps,
|
|
8
|
+
Show
|
|
9
|
+
} from "solid-js";
|
|
10
|
+
|
|
11
|
+
// src/components/tooltip/Tooltip.styles.ts
|
|
12
|
+
var tooltipVariants = cva(
|
|
13
|
+
[
|
|
14
|
+
"absolute z-10 px-3 py-1 text-white text-sm",
|
|
15
|
+
"opacity-0 group-hover:opacity-100",
|
|
16
|
+
"pointer-events-none transition-opacity duration-200",
|
|
17
|
+
"max-w-xs break-words",
|
|
18
|
+
"after:content-[''] after:absolute after:w-2 after:h-2 after:rotate-45 after:bg-inherit"
|
|
19
|
+
].join(" "),
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
type: {
|
|
23
|
+
info: "bg-blue-500",
|
|
24
|
+
success: "bg-green-500",
|
|
25
|
+
warning: "bg-yellow-500",
|
|
26
|
+
danger: "bg-red-500",
|
|
27
|
+
primary: "bg-indigo-500",
|
|
28
|
+
gray: "bg-gray-700"
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
sm: "text-xs",
|
|
32
|
+
md: "text-sm",
|
|
33
|
+
lg: "text-base"
|
|
34
|
+
},
|
|
35
|
+
rounded: {
|
|
36
|
+
true: "rounded",
|
|
37
|
+
false: "rounded-none"
|
|
38
|
+
},
|
|
39
|
+
dashed: {
|
|
40
|
+
true: "border border-white border-dashed",
|
|
41
|
+
false: ""
|
|
42
|
+
},
|
|
43
|
+
multilined: {
|
|
44
|
+
true: "whitespace-pre-wrap",
|
|
45
|
+
false: "whitespace-nowrap"
|
|
46
|
+
},
|
|
47
|
+
animated: {
|
|
48
|
+
true: "transition-opacity duration-300 ease-in-out",
|
|
49
|
+
false: ""
|
|
50
|
+
},
|
|
51
|
+
position: {
|
|
52
|
+
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",
|
|
53
|
+
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",
|
|
54
|
+
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",
|
|
55
|
+
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"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
type: "primary",
|
|
60
|
+
size: "md",
|
|
61
|
+
rounded: true,
|
|
62
|
+
dashed: false,
|
|
63
|
+
multilined: false,
|
|
64
|
+
animated: true,
|
|
65
|
+
position: "top"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// src/components/tooltip/Tooltip.tsx
|
|
71
|
+
var Tooltip = (props) => {
|
|
72
|
+
const [local, variantProps, otherProps] = splitProps(
|
|
73
|
+
props,
|
|
74
|
+
["label", "delay", "always", "children"],
|
|
75
|
+
["type", "size", "position", "rounded", "dashed", "multilined", "animated"]
|
|
76
|
+
);
|
|
77
|
+
return <span class="relative inline-block group" {...otherProps}>
|
|
78
|
+
{local.children}
|
|
79
|
+
<Show when={local.label}>
|
|
80
|
+
<span
|
|
81
|
+
class={tooltipVariants(variantProps)}
|
|
82
|
+
style={{
|
|
83
|
+
"transition-delay": `${local.delay ?? 0}ms`,
|
|
84
|
+
opacity: local.always ? 1 : void 0,
|
|
85
|
+
"pointer-events": "none"
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{local.label}
|
|
89
|
+
</span>
|
|
90
|
+
</Show>
|
|
91
|
+
</span>;
|
|
92
|
+
};
|
|
93
|
+
var Tooltip_default = Tooltip;
|
|
94
|
+
|
|
95
|
+
// src/components/tooltip/index.ts
|
|
96
|
+
var tooltip_default = Tooltip_default;
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
tooltip_default
|
|
100
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
};
|