@pathscale/ui 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +53 -0
  2. package/dist/{Autocomplete-BLKN_nG8.d.ts → Autocomplete-gLkjMHrc.d.ts} +1 -1
  3. package/dist/Avatar-Dkd_kPlV.d.ts +40 -0
  4. package/dist/CollapseTitle-BNxog3is.d.ts +12 -0
  5. package/dist/{Field-DfUn85_1.d.ts → Field-DI2PA30N.d.ts} +1 -1
  6. package/dist/Mask-CPb596Mg.d.ts +16 -0
  7. package/dist/Menu-DgO4SHmA.d.ts +45 -0
  8. package/dist/{Progress-gN0xqhAF.d.ts → Progress-ChF4ior8.d.ts} +2 -2
  9. package/dist/Steps-Dk-UPL6r.d.ts +38 -0
  10. package/dist/{Tabs-BNR3p92D.d.ts → Tabs-WiUU0xsM.d.ts} +1 -1
  11. package/dist/chunk/2OJYONJ3.js +40 -0
  12. package/dist/chunk/2VQ2762Z.js +80 -0
  13. package/dist/chunk/2XPPNBYK.js +164 -0
  14. package/dist/chunk/3I23P4TJ.js +33 -0
  15. package/dist/chunk/5HG7XWVC.jsx +2956 -0
  16. package/dist/chunk/5IJ7WEIF.js +43 -0
  17. package/dist/chunk/5O6WC3OB.jsx +67 -0
  18. package/dist/chunk/6P5JIKPF.jsx +51 -0
  19. package/dist/chunk/BHLLVOVR.js +46 -0
  20. package/dist/chunk/DJI5XKAV.js +31 -0
  21. package/dist/chunk/DN3P54J2.jsx +43 -0
  22. package/dist/chunk/DVFQAAZR.js +43 -0
  23. package/dist/chunk/EDDBK4J6.js +42 -0
  24. package/dist/chunk/FZRQDGPD.jsx +54 -0
  25. package/dist/chunk/G5UEZ2VC.js +49 -0
  26. package/dist/chunk/GL7JG772.js +114 -0
  27. package/dist/chunk/HEOKGP5U.js +55 -0
  28. package/dist/chunk/HUHXQCKK.js +16 -0
  29. package/dist/chunk/I36LHZUY.jsx +31 -0
  30. package/dist/chunk/IG323YKF.jsx +50 -0
  31. package/dist/chunk/JQ4HSRDP.js +142 -0
  32. package/dist/chunk/JSQBKK7L.jsx +50 -0
  33. package/dist/chunk/K3WO7SRD.js +1 -0
  34. package/dist/chunk/KQ3RAWCE.jsx +57 -0
  35. package/dist/chunk/KXJZKDJX.jsx +0 -0
  36. package/dist/chunk/L4A67X7S.js +7 -0
  37. package/dist/chunk/LGDDR242.jsx +159 -0
  38. package/dist/chunk/MM2DZQL3.js +46 -0
  39. package/dist/chunk/MZWBWFDD.js +151 -0
  40. package/dist/chunk/O7LDJCQS.jsx +18 -0
  41. package/dist/chunk/Q4442PU4.js +42 -0
  42. package/dist/chunk/R5G3PODL.jsx +11 -0
  43. package/dist/chunk/R6ZBT7CY.jsx +55 -0
  44. package/dist/chunk/RHEFVSMJ.jsx +52 -0
  45. package/dist/chunk/STFCLC5R.js +2954 -0
  46. package/dist/chunk/SVJIYMYJ.jsx +156 -0
  47. package/dist/chunk/SYWB4UN3.jsx +64 -0
  48. package/dist/chunk/UNKDNDT3.js +62 -0
  49. package/dist/chunk/XM3KF5LV.jsx +179 -0
  50. package/dist/chunk/XQCSYRVP.jsx +168 -0
  51. package/dist/chunk/YWIT2MRI.jsx +43 -0
  52. package/dist/chunk/ZYEP35R3.jsx +60 -0
  53. package/dist/components/Progress/index.d.ts +1 -1
  54. package/dist/components/accordion/index.d.ts +17 -5
  55. package/dist/components/accordion/index.js +1 -1
  56. package/dist/components/accordion/index.jsx +6 -4
  57. package/dist/components/autocomplete/index.d.ts +2 -2
  58. package/dist/components/avatar/index.d.ts +4 -4
  59. package/dist/components/avatar/index.js +1 -1
  60. package/dist/components/avatar/index.jsx +3 -2
  61. package/dist/components/badge/index.d.ts +17 -0
  62. package/dist/components/badge/index.js +1 -0
  63. package/dist/components/badge/index.jsx +8 -0
  64. package/dist/components/breadcrumbs/index.d.ts +9 -0
  65. package/dist/components/breadcrumbs/index.js +1 -0
  66. package/dist/components/breadcrumbs/index.jsx +7 -0
  67. package/dist/components/button/index.d.ts +28 -6
  68. package/dist/components/button/index.js +1 -1
  69. package/dist/components/button/index.jsx +5 -5
  70. package/dist/components/checkbox/index.d.ts +13 -5
  71. package/dist/components/checkbox/index.js +1 -1
  72. package/dist/components/checkbox/index.jsx +5 -4
  73. package/dist/components/collapse/index.d.ts +15 -0
  74. package/dist/components/collapse/index.js +1 -0
  75. package/dist/components/collapse/index.jsx +14 -0
  76. package/dist/components/field/index.d.ts +1 -1
  77. package/dist/components/fileinput/index.d.ts +16 -0
  78. package/dist/components/fileinput/index.js +1 -0
  79. package/dist/components/fileinput/index.jsx +8 -0
  80. package/dist/components/input/index.d.ts +13 -8
  81. package/dist/components/input/index.js +1 -1
  82. package/dist/components/input/index.jsx +5 -6
  83. package/dist/components/join/index.d.ts +11 -0
  84. package/dist/components/join/index.js +1 -0
  85. package/dist/components/join/index.jsx +9 -0
  86. package/dist/components/mask/index.d.ts +7 -0
  87. package/dist/components/mask/index.js +1 -0
  88. package/dist/components/mask/index.jsx +8 -0
  89. package/dist/components/menu/index.d.ts +6 -64
  90. package/dist/components/menu/index.js +1 -1
  91. package/dist/components/menu/index.jsx +4 -7
  92. package/dist/components/pagination/index.d.ts +6 -6
  93. package/dist/components/pagination/index.js +1 -1
  94. package/dist/components/pagination/index.jsx +6 -4
  95. package/dist/components/polymorphic/index.d.ts +1 -1
  96. package/dist/components/select/index.d.ts +12 -5
  97. package/dist/components/select/index.js +1 -1
  98. package/dist/components/select/index.jsx +5 -4
  99. package/dist/components/steps/index.d.ts +3 -4
  100. package/dist/components/steps/index.js +1 -1
  101. package/dist/components/steps/index.jsx +3 -2
  102. package/dist/components/tabs/index.d.ts +2 -2
  103. package/dist/components/textarea/index.d.ts +12 -5
  104. package/dist/components/textarea/index.js +1 -1
  105. package/dist/components/textarea/index.jsx +5 -4
  106. package/dist/components/toggle/index.d.ts +15 -0
  107. package/dist/components/toggle/index.js +1 -0
  108. package/dist/components/toggle/index.jsx +8 -0
  109. package/dist/components/tooltip/index.d.ts +14 -5
  110. package/dist/components/tooltip/index.js +1 -1
  111. package/dist/components/tooltip/index.jsx +5 -4
  112. package/dist/index.d.ts +24 -19
  113. package/dist/index.js +23 -20
  114. package/dist/index.jsx +81 -66
  115. package/dist/types-CUG9pToa.d.ts +15 -0
  116. package/package.json +4 -2
  117. package/dist/Accordion-nwuRbRRw.d.ts +0 -27
  118. package/dist/Avatar-CzIirpVq.d.ts +0 -33
  119. package/dist/Button-B50OLXuV.d.ts +0 -63
  120. package/dist/Checkbox-CzeDsQLA.d.ts +0 -32
  121. package/dist/Input-X4gwIB-F.d.ts +0 -42
  122. package/dist/Pagination-CJtlFMHy.d.ts +0 -43
  123. package/dist/Select-CP-TUHJv.d.ts +0 -44
  124. package/dist/Steps-1miUeyCD.d.ts +0 -34
  125. package/dist/Switch-CW6QtO1Y.d.ts +0 -76
  126. package/dist/Tag-BPrhn-Ne.d.ts +0 -42
  127. package/dist/Textarea-Cpdk7m6S.d.ts +0 -37
  128. package/dist/Tooltip-BfPongoz.d.ts +0 -53
  129. package/dist/Upload-CRljD5jf.d.ts +0 -39
  130. package/dist/chunk/3VOILEMN.js +0 -187
  131. package/dist/chunk/C4745OZS.jsx +0 -101
  132. package/dist/chunk/CJZGTNJZ.js +0 -115
  133. package/dist/chunk/DBQ7IOPU.js +0 -189
  134. package/dist/chunk/EB7KXR65.js +0 -102
  135. package/dist/chunk/EE4HXMKA.js +0 -165
  136. package/dist/chunk/ELRAUORW.jsx +0 -179
  137. package/dist/chunk/F33TSIEQ.jsx +0 -181
  138. package/dist/chunk/GWFGP2JQ.jsx +0 -179
  139. package/dist/chunk/LAQPAV5I.jsx +0 -187
  140. package/dist/chunk/LI3HCFL7.jsx +0 -132
  141. package/dist/chunk/LMPV5G35.jsx +0 -228
  142. package/dist/chunk/MI773TMC.js +0 -107
  143. package/dist/chunk/MMTAND25.jsx +0 -126
  144. package/dist/chunk/NZKPDBTE.js +0 -118
  145. package/dist/chunk/O2IMHWMY.js +0 -159
  146. package/dist/chunk/OMRJVDZV.js +0 -173
  147. package/dist/chunk/OYAKKETQ.js +0 -111
  148. package/dist/chunk/PF47YREI.js +0 -214
  149. package/dist/chunk/PNPC2OI3.jsx +0 -156
  150. package/dist/chunk/QHJOIUYT.jsx +0 -117
  151. package/dist/chunk/QONDPQ2I.jsx +0 -105
  152. package/dist/chunk/R6COBCN7.jsx +0 -100
  153. package/dist/chunk/T7IZ26YC.jsx +0 -194
  154. package/dist/chunk/TT2JYGLU.js +0 -218
  155. package/dist/chunk/V6Y5E7BL.js +0 -133
  156. package/dist/chunk/WB6NEEQV.jsx +0 -107
  157. package/dist/chunk/WYHYWDOM.js +0 -164
  158. package/dist/chunk/XD34JKSU.jsx +0 -201
  159. package/dist/chunk/YDEDUOFM.js +0 -102
  160. package/dist/components/breadcrumb/index.d.ts +0 -47
  161. package/dist/components/breadcrumb/index.js +0 -1
  162. package/dist/components/breadcrumb/index.jsx +0 -9
  163. package/dist/components/switch/index.d.ts +0 -8
  164. package/dist/components/switch/index.js +0 -1
  165. package/dist/components/switch/index.jsx +0 -7
  166. package/dist/components/tag/index.d.ts +0 -8
  167. package/dist/components/tag/index.js +0 -1
  168. package/dist/components/tag/index.jsx +0 -7
  169. package/dist/components/upload/index.d.ts +0 -8
  170. package/dist/components/upload/index.js +0 -1
  171. package/dist/components/upload/index.jsx +0 -7
@@ -1,101 +0,0 @@
1
- import {
2
- cva
3
- } from "./P7WPLZNA.jsx";
4
-
5
- // src/components/avatar/Avatar.tsx
6
- import {
7
- createSignal,
8
- createMemo,
9
- createEffect,
10
- mergeProps,
11
- splitProps,
12
- Show,
13
- untrack
14
- } from "solid-js";
15
-
16
- // src/components/avatar/Avatar.styles.ts
17
- var avatarVariants = cva(
18
- [
19
- "flex items-center justify-center mx-1",
20
- "font-medium outline-none select-none transition active:transition-none",
21
- "not-disabled:cursor-pointer",
22
- "disabled:cursor-not-allowed disabled:opacity-25",
23
- "aria-busy:cursor-wait"
24
- ],
25
- {
26
- variants: {
27
- size: {
28
- sm: "size-8 text-sm",
29
- md: "size-16 text-base",
30
- lg: "size-24 text-lg"
31
- },
32
- shape: {
33
- circle: "rounded-full overflow-hidden",
34
- rounded: "rounded-lg overflow-hidden"
35
- },
36
- variant: {
37
- filled: "bg-gray-200 text-gray-800",
38
- outlined: "border-2 border-gray-300 text-gray-800",
39
- ghost: "text-gray-800"
40
- }
41
- },
42
- defaultVariants: {
43
- size: "md",
44
- shape: "circle",
45
- variant: "filled"
46
- }
47
- }
48
- );
49
-
50
- // src/components/avatar/utils.ts
51
- function parseCaption(alt) {
52
- if (!alt) return "";
53
- const parts = alt.split(" ");
54
- if (parts.length >= 2 && parts[0] && parts[1]) {
55
- return `${parts[0][0] ?? ""}${parts[1][0] ?? ""}`;
56
- }
57
- return "";
58
- }
59
-
60
- // src/components/avatar/Avatar.tsx
61
- var Avatar = (rawProps) => {
62
- const props = mergeProps({ alt: "User Avatar" }, rawProps);
63
- const [variantProps, otherProps] = splitProps(props, [
64
- "class",
65
- ...avatarVariants.variantKeys
66
- ]);
67
- const [source, setSource] = createSignal(props.src || props.dataSrc);
68
- createEffect(() => {
69
- untrack(() => {
70
- if (import.meta.env.PROD && props.dataSrc) {
71
- setSource(props.dataSrc);
72
- }
73
- });
74
- });
75
- const styles = createMemo(() => ({
76
- background: untrack(() => source() ? "" : props.class ?? "bg-blue-500"),
77
- text: untrack(() => source() ? "" : props.text ?? "text-white")
78
- }));
79
- const caption = createMemo(() => parseCaption(props.alt));
80
- return <figure class={avatarVariants(variantProps)}>
81
- <Show
82
- when={source()}
83
- fallback={<figcaption class={styles().text}>{caption()}</figcaption>}
84
- >
85
- <img
86
- src={source()}
87
- data-src={props.dataSrc}
88
- class="size-full object-cover"
89
- {...otherProps}
90
- />
91
- </Show>
92
- </figure>;
93
- };
94
- var Avatar_default = Avatar;
95
-
96
- // src/components/avatar/index.ts
97
- var avatar_default = Avatar_default;
98
-
99
- export {
100
- avatar_default
101
- };
@@ -1,115 +0,0 @@
1
- import { cva, classes } from './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 };
@@ -1,189 +0,0 @@
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>&laquo;</button><button>&raquo;`);
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 };
@@ -1,102 +0,0 @@
1
- import { cva, classes } from './HKS7ET6T.js';
2
- import { template, spread, mergeProps, insert, createComponent, effect, className } from 'solid-js/web';
3
- import { splitProps, createSignal, createMemo, Show } from 'solid-js';
4
-
5
- // src/components/textarea/Textarea.styles.ts
6
- var textareaVariants = cva(
7
- [
8
- "block w-full rounded-md border bg-white px-3 py-2 text-sm",
9
- "text-gray-900 placeholder-gray-400",
10
- "focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent",
11
- "disabled:opacity-50 disabled:cursor-not-allowed"
12
- ],
13
- {
14
- variants: {
15
- size: {
16
- sm: "text-sm py-1.5",
17
- md: "text-base py-2",
18
- lg: "text-lg py-3"
19
- },
20
- color: {
21
- primary: "border-blue-500",
22
- info: "border-cyan-500",
23
- success: "border-green-500",
24
- warning: "border-yellow-500",
25
- danger: "border-red-500"
26
- },
27
- loading: {
28
- true: "opacity-50 cursor-wait",
29
- false: ""
30
- },
31
- resize: {
32
- none: "resize-none",
33
- both: "resize",
34
- x: "resize-x",
35
- y: "resize-y"
36
- }
37
- },
38
- defaultVariants: {
39
- size: "md",
40
- color: "primary",
41
- loading: false,
42
- resize: "y"
43
- }
44
- }
45
- );
46
-
47
- // src/components/textarea/Textarea.tsx
48
- var _tmpl$ = /* @__PURE__ */ template(`<small> / `);
49
- var _tmpl$2 = /* @__PURE__ */ template(`<div class="relative w-full"><textarea>`);
50
- var Textarea = (props) => {
51
- const [localProps, variantProps, otherProps] = splitProps(props, ["hasCounter", "value", "onInput", "onFocus", "onBlur", "maxLength"], ["class", ...textareaVariants.variantKeys]);
52
- const [isFocused, setFocused] = createSignal(false);
53
- const valueLength = createMemo(() => typeof localProps.value === "string" ? localProps.value.length : 0);
54
- const showCounter = createMemo(() => localProps.maxLength && localProps.hasCounter);
55
- return (() => {
56
- var _el$ = _tmpl$2(), _el$2 = _el$.firstChild;
57
- _el$2.addEventListener("blur", (e) => {
58
- setFocused(false);
59
- typeof localProps.onBlur === "function" && localProps.onBlur(e);
60
- });
61
- _el$2.addEventListener("focus", (e) => {
62
- setFocused(true);
63
- typeof localProps.onFocus === "function" && localProps.onFocus(e);
64
- });
65
- spread(_el$2, mergeProps({
66
- get ["class"]() {
67
- return textareaVariants(variantProps);
68
- },
69
- get value() {
70
- return localProps.value;
71
- },
72
- get maxLength() {
73
- return localProps.maxLength;
74
- },
75
- get onInput() {
76
- return localProps.onInput;
77
- },
78
- get ["aria-invalid"]() {
79
- return variantProps.color === "danger" ? "true" : void 0;
80
- }
81
- }, otherProps), false, false);
82
- insert(_el$, createComponent(Show, {
83
- get when() {
84
- return showCounter();
85
- },
86
- get children() {
87
- var _el$3 = _tmpl$(), _el$4 = _el$3.firstChild;
88
- insert(_el$3, valueLength, _el$4);
89
- insert(_el$3, () => localProps.maxLength, null);
90
- effect(() => className(_el$3, classes("absolute bottom-1 right-2 text-xs text-gray-500 transition-opacity", isFocused() ? "opacity-100" : "opacity-0")));
91
- return _el$3;
92
- }
93
- }), null);
94
- return _el$;
95
- })();
96
- };
97
- var Textarea_default = Textarea;
98
-
99
- // src/components/textarea/index.ts
100
- var textarea_default = Textarea_default;
101
-
102
- export { textarea_default };
@@ -1,165 +0,0 @@
1
- import { cva } from './HKS7ET6T.js';
2
- import { template, spread, mergeProps, insert, effect, className, setAttribute } from 'solid-js/web';
3
- import { splitProps, createSignal, createMemo, untrack } from 'solid-js';
4
-
5
- // src/components/switch/Switch.styles.ts
6
- var switchVariants = cva(
7
- "switch inline-flex items-center gap-2 select-none",
8
- {
9
- variants: {
10
- size: {
11
- sm: "text-sm",
12
- md: "text-base",
13
- lg: "text-lg"
14
- },
15
- disabled: {
16
- true: "opacity-50",
17
- false: ""
18
- },
19
- rounded: {
20
- true: "",
21
- false: ""
22
- },
23
- outlined: {
24
- true: "",
25
- false: ""
26
- }
27
- },
28
- defaultVariants: {
29
- size: "md",
30
- disabled: false,
31
- rounded: true,
32
- outlined: false
33
- }
34
- }
35
- );
36
- var checkVariants = cva(
37
- [
38
- "relative transition-colors duration-200",
39
- "after:content-[''] after:absolute after:bg-white after:transition-transform after:duration-700 after:ease-in-out after:shadow-sm"
40
- ].join(" "),
41
- {
42
- variants: {
43
- size: {
44
- sm: "w-8 h-4 after:w-3 after:h-3 after:left-0.5 after:top-0.5 peer-checked:after:translate-x-4",
45
- md: "w-10 h-6 after:w-4 after:h-4 after:left-1 after:top-1 peer-checked:after:translate-x-4",
46
- lg: "w-12 h-7 after:w-5 after:h-5 after:left-1 after:top-1 peer-checked:after:translate-x-5"
47
- },
48
- color: {
49
- primary: "peer-checked:bg-blue-500",
50
- success: "peer-checked:bg-green-500",
51
- danger: "peer-checked:bg-red-500",
52
- warning: "peer-checked:bg-yellow-400",
53
- gray: "peer-checked:bg-gray-400"
54
- },
55
- passiveColor: {
56
- primary: "bg-blue-200",
57
- success: "bg-green-200",
58
- danger: "bg-red-200",
59
- warning: "bg-yellow-200",
60
- gray: "bg-gray-200"
61
- },
62
- rounded: {
63
- true: "rounded-full after:rounded-full",
64
- false: "rounded-md after:rounded-sm"
65
- },
66
- outlined: {
67
- true: "bg-transparent ring border-current",
68
- false: ""
69
- },
70
- disabled: {
71
- true: "bg-gray-200 border border-gray-300 after:bg-gray-100",
72
- false: ""
73
- }
74
- },
75
- defaultVariants: {
76
- size: "md",
77
- color: "primary",
78
- passiveColor: "gray",
79
- rounded: true,
80
- outlined: false
81
- }
82
- }
83
- );
84
- var switchLabelClass = cva("control-label", {
85
- variants: {
86
- disabled: {
87
- true: "text-gray-400 dark:text-gray-500",
88
- false: "text-gray-800 dark:text-gray-200"
89
- }
90
- },
91
- defaultVariants: {
92
- disabled: false
93
- }
94
- });
95
-
96
- // src/components/switch/Switch.tsx
97
- var _tmpl$ = /* @__PURE__ */ template(`<label role=switch><input type=checkbox class="sr-only peer"aria-hidden=true><span></span><span>`);
98
- var Switch = (props) => {
99
- const [localProps, variantProps, otherProps] = splitProps(props, ["children", "checked", "defaultChecked", "onChange", "name", "required", "disabled", "aria-label", "aria-describedby"], ["size", "rounded", "outlined", "color", "passiveColor", "disabled"]);
100
- const isControlled = localProps.checked !== void 0;
101
- const [internalChecked, setInternalChecked] = createSignal(localProps.defaultChecked ?? false);
102
- const checkedValue = createMemo(() => untrack(() => isControlled ? localProps.checked : internalChecked()));
103
- const switchClasses = createMemo(() => switchVariants(variantProps));
104
- const checkClasses = createMemo(() => checkVariants({
105
- size: variantProps.size,
106
- color: variantProps.color,
107
- passiveColor: variantProps.passiveColor,
108
- rounded: variantProps.rounded,
109
- outlined: variantProps.outlined,
110
- disabled: localProps.disabled
111
- }));
112
- const handleChange = (e) => {
113
- if (localProps.disabled) return;
114
- const next = e.currentTarget.checked;
115
- untrack(() => {
116
- if (!isControlled) setInternalChecked(next);
117
- localProps.onChange?.(next);
118
- });
119
- };
120
- return (() => {
121
- var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling;
122
- _el$2.addEventListener("change", handleChange);
123
- spread(_el$2, mergeProps({
124
- get checked() {
125
- return checkedValue();
126
- },
127
- get name() {
128
- return localProps.name;
129
- },
130
- get required() {
131
- return localProps.required;
132
- },
133
- get disabled() {
134
- return localProps.disabled;
135
- }
136
- }, otherProps), false, false);
137
- insert(_el$4, () => localProps.children);
138
- effect((_p$) => {
139
- var _v$ = switchClasses(), _v$2 = checkedValue(), _v$3 = localProps["aria-label"], _v$4 = localProps["aria-describedby"], _v$5 = checkClasses(), _v$6 = switchLabelClass({
140
- disabled: localProps.disabled
141
- });
142
- _v$ !== _p$.e && className(_el$, _p$.e = _v$);
143
- _v$2 !== _p$.t && setAttribute(_el$, "aria-checked", _p$.t = _v$2);
144
- _v$3 !== _p$.a && setAttribute(_el$, "aria-label", _p$.a = _v$3);
145
- _v$4 !== _p$.o && setAttribute(_el$, "aria-describedby", _p$.o = _v$4);
146
- _v$5 !== _p$.i && className(_el$3, _p$.i = _v$5);
147
- _v$6 !== _p$.n && className(_el$4, _p$.n = _v$6);
148
- return _p$;
149
- }, {
150
- e: void 0,
151
- t: void 0,
152
- a: void 0,
153
- o: void 0,
154
- i: void 0,
155
- n: void 0
156
- });
157
- return _el$;
158
- })();
159
- };
160
- var Switch_default = Switch;
161
-
162
- // src/components/switch/index.ts
163
- var switch_default = Switch_default;
164
-
165
- export { switch_default };