@pathscale/ui 0.0.11 → 0.0.13

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 (178) 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/64ESNXN4.js +1 -0
  19. package/dist/chunk/6P5JIKPF.jsx +51 -0
  20. package/dist/chunk/BHLLVOVR.js +46 -0
  21. package/dist/chunk/DJI5XKAV.js +31 -0
  22. package/dist/chunk/DN3P54J2.jsx +43 -0
  23. package/dist/chunk/DVFQAAZR.js +43 -0
  24. package/dist/chunk/EDDBK4J6.js +42 -0
  25. package/dist/chunk/FZRQDGPD.jsx +54 -0
  26. package/dist/chunk/G5UEZ2VC.js +49 -0
  27. package/dist/chunk/GL7JG772.js +114 -0
  28. package/dist/chunk/H2Q3L5KM.js +48 -0
  29. package/dist/chunk/HEOKGP5U.js +55 -0
  30. package/dist/chunk/HUHXQCKK.js +16 -0
  31. package/dist/chunk/I36LHZUY.jsx +31 -0
  32. package/dist/chunk/IG323YKF.jsx +50 -0
  33. package/dist/chunk/JQ4HSRDP.js +142 -0
  34. package/dist/chunk/JSQBKK7L.jsx +50 -0
  35. package/dist/chunk/K3WO7SRD.js +1 -0
  36. package/dist/chunk/KQ3RAWCE.jsx +57 -0
  37. package/dist/chunk/KXJZKDJX.jsx +0 -0
  38. package/dist/chunk/L4A67X7S.js +7 -0
  39. package/dist/chunk/LGDDR242.jsx +159 -0
  40. package/dist/chunk/MM2DZQL3.js +46 -0
  41. package/dist/chunk/O7LDJCQS.jsx +18 -0
  42. package/dist/chunk/PFB27MP3.jsx +0 -0
  43. package/dist/chunk/Q4442PU4.js +42 -0
  44. package/dist/chunk/R5G3PODL.jsx +11 -0
  45. package/dist/chunk/R6ZBT7CY.jsx +55 -0
  46. package/dist/chunk/RHEFVSMJ.jsx +52 -0
  47. package/dist/chunk/STFCLC5R.js +2954 -0
  48. package/dist/chunk/SVJIYMYJ.jsx +156 -0
  49. package/dist/chunk/SYWB4UN3.jsx +64 -0
  50. package/dist/chunk/T324HUIT.jsx +57 -0
  51. package/dist/chunk/T5LDPSFV.jsx +122 -0
  52. package/dist/chunk/UNKDNDT3.js +62 -0
  53. package/dist/chunk/XM3KF5LV.jsx +179 -0
  54. package/dist/chunk/YWIT2MRI.jsx +43 -0
  55. package/dist/chunk/ZH7DKMMN.js +109 -0
  56. package/dist/chunk/ZYEP35R3.jsx +60 -0
  57. package/dist/components/Progress/index.d.ts +1 -1
  58. package/dist/components/accordion/index.d.ts +17 -5
  59. package/dist/components/accordion/index.js +1 -1
  60. package/dist/components/accordion/index.jsx +6 -4
  61. package/dist/components/autocomplete/index.d.ts +2 -2
  62. package/dist/components/avatar/index.d.ts +4 -4
  63. package/dist/components/avatar/index.js +1 -1
  64. package/dist/components/avatar/index.jsx +3 -2
  65. package/dist/components/badge/index.d.ts +17 -0
  66. package/dist/components/badge/index.js +1 -0
  67. package/dist/components/badge/index.jsx +8 -0
  68. package/dist/components/breadcrumbs/index.d.ts +9 -0
  69. package/dist/components/breadcrumbs/index.js +1 -0
  70. package/dist/components/breadcrumbs/index.jsx +7 -0
  71. package/dist/components/button/index.d.ts +28 -6
  72. package/dist/components/button/index.js +1 -1
  73. package/dist/components/button/index.jsx +6 -5
  74. package/dist/components/checkbox/index.d.ts +13 -5
  75. package/dist/components/checkbox/index.js +1 -1
  76. package/dist/components/checkbox/index.jsx +5 -4
  77. package/dist/components/collapse/index.d.ts +15 -0
  78. package/dist/components/collapse/index.js +1 -0
  79. package/dist/components/collapse/index.jsx +14 -0
  80. package/dist/components/field/index.d.ts +1 -1
  81. package/dist/components/fileinput/index.d.ts +16 -0
  82. package/dist/components/fileinput/index.js +1 -0
  83. package/dist/components/fileinput/index.jsx +8 -0
  84. package/dist/components/input/index.d.ts +13 -8
  85. package/dist/components/input/index.js +1 -1
  86. package/dist/components/input/index.jsx +5 -6
  87. package/dist/components/join/index.d.ts +11 -0
  88. package/dist/components/join/index.js +1 -0
  89. package/dist/components/join/index.jsx +9 -0
  90. package/dist/components/loading/index.d.ts +11 -0
  91. package/dist/components/loading/index.js +1 -0
  92. package/dist/components/loading/index.jsx +9 -0
  93. package/dist/components/mask/index.d.ts +7 -0
  94. package/dist/components/mask/index.js +1 -0
  95. package/dist/components/mask/index.jsx +8 -0
  96. package/dist/components/menu/index.d.ts +6 -64
  97. package/dist/components/menu/index.js +1 -1
  98. package/dist/components/menu/index.jsx +4 -7
  99. package/dist/components/pagination/index.d.ts +6 -6
  100. package/dist/components/pagination/index.js +1 -1
  101. package/dist/components/pagination/index.jsx +6 -4
  102. package/dist/components/polymorphic/index.d.ts +1 -1
  103. package/dist/components/select/index.d.ts +12 -5
  104. package/dist/components/select/index.js +1 -1
  105. package/dist/components/select/index.jsx +5 -4
  106. package/dist/components/steps/index.d.ts +3 -4
  107. package/dist/components/steps/index.js +1 -1
  108. package/dist/components/steps/index.jsx +3 -2
  109. package/dist/components/tabs/index.d.ts +2 -2
  110. package/dist/components/textarea/index.d.ts +12 -5
  111. package/dist/components/textarea/index.js +1 -1
  112. package/dist/components/textarea/index.jsx +5 -4
  113. package/dist/components/toggle/index.d.ts +15 -0
  114. package/dist/components/toggle/index.js +1 -0
  115. package/dist/components/toggle/index.jsx +8 -0
  116. package/dist/components/tooltip/index.d.ts +14 -5
  117. package/dist/components/tooltip/index.js +1 -1
  118. package/dist/components/tooltip/index.jsx +5 -4
  119. package/dist/index.d.ts +25 -19
  120. package/dist/index.js +23 -19
  121. package/dist/index.jsx +87 -67
  122. package/dist/types-CUG9pToa.d.ts +15 -0
  123. package/package.json +4 -2
  124. package/dist/Accordion-nwuRbRRw.d.ts +0 -27
  125. package/dist/Avatar-CzIirpVq.d.ts +0 -33
  126. package/dist/Button-B50OLXuV.d.ts +0 -63
  127. package/dist/Checkbox-CzeDsQLA.d.ts +0 -32
  128. package/dist/Input-X4gwIB-F.d.ts +0 -42
  129. package/dist/Pagination-CJtlFMHy.d.ts +0 -43
  130. package/dist/Select-CP-TUHJv.d.ts +0 -44
  131. package/dist/Steps-1miUeyCD.d.ts +0 -34
  132. package/dist/Switch-CW6QtO1Y.d.ts +0 -76
  133. package/dist/Tag-BPrhn-Ne.d.ts +0 -42
  134. package/dist/Textarea-Cpdk7m6S.d.ts +0 -37
  135. package/dist/Tooltip-BfPongoz.d.ts +0 -53
  136. package/dist/Upload-CRljD5jf.d.ts +0 -39
  137. package/dist/chunk/3VOILEMN.js +0 -187
  138. package/dist/chunk/C4745OZS.jsx +0 -101
  139. package/dist/chunk/CJZGTNJZ.js +0 -115
  140. package/dist/chunk/DBQ7IOPU.js +0 -189
  141. package/dist/chunk/EB7KXR65.js +0 -102
  142. package/dist/chunk/EE4HXMKA.js +0 -165
  143. package/dist/chunk/ELRAUORW.jsx +0 -179
  144. package/dist/chunk/F33TSIEQ.jsx +0 -181
  145. package/dist/chunk/GWFGP2JQ.jsx +0 -179
  146. package/dist/chunk/LAQPAV5I.jsx +0 -187
  147. package/dist/chunk/LI3HCFL7.jsx +0 -132
  148. package/dist/chunk/LMPV5G35.jsx +0 -228
  149. package/dist/chunk/MI773TMC.js +0 -107
  150. package/dist/chunk/MMTAND25.jsx +0 -126
  151. package/dist/chunk/NZKPDBTE.js +0 -118
  152. package/dist/chunk/O2IMHWMY.js +0 -159
  153. package/dist/chunk/OMRJVDZV.js +0 -173
  154. package/dist/chunk/OYAKKETQ.js +0 -111
  155. package/dist/chunk/PF47YREI.js +0 -214
  156. package/dist/chunk/PNPC2OI3.jsx +0 -156
  157. package/dist/chunk/QHJOIUYT.jsx +0 -117
  158. package/dist/chunk/QONDPQ2I.jsx +0 -105
  159. package/dist/chunk/R6COBCN7.jsx +0 -100
  160. package/dist/chunk/T7IZ26YC.jsx +0 -194
  161. package/dist/chunk/TT2JYGLU.js +0 -218
  162. package/dist/chunk/V6Y5E7BL.js +0 -133
  163. package/dist/chunk/WB6NEEQV.jsx +0 -107
  164. package/dist/chunk/WYHYWDOM.js +0 -164
  165. package/dist/chunk/XD34JKSU.jsx +0 -201
  166. package/dist/chunk/YDEDUOFM.js +0 -102
  167. package/dist/components/breadcrumb/index.d.ts +0 -47
  168. package/dist/components/breadcrumb/index.js +0 -1
  169. package/dist/components/breadcrumb/index.jsx +0 -9
  170. package/dist/components/switch/index.d.ts +0 -8
  171. package/dist/components/switch/index.js +0 -1
  172. package/dist/components/switch/index.jsx +0 -7
  173. package/dist/components/tag/index.d.ts +0 -8
  174. package/dist/components/tag/index.js +0 -1
  175. package/dist/components/tag/index.jsx +0 -7
  176. package/dist/components/upload/index.d.ts +0 -8
  177. package/dist/components/upload/index.js +0 -1
  178. package/dist/components/upload/index.jsx +0 -7
@@ -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 };
@@ -1,179 +0,0 @@
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
- &laquo;
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
- &raquo;
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
- };
@@ -1,181 +0,0 @@
1
- import {
2
- classes,
3
- cva
4
- } from "./P7WPLZNA.jsx";
5
-
6
- // src/components/select/Select.tsx
7
- import {
8
- splitProps,
9
- Show,
10
- createMemo,
11
- untrack
12
- } from "solid-js";
13
-
14
- // src/components/select/Select.styles.ts
15
- var selectVariants = cva(
16
- [
17
- "flex items-center appearance-none",
18
- "border outline-none",
19
- "transition bg-white text-gray-700",
20
- "disabled:opacity-50 disabled:cursor-not-allowed",
21
- "pl-3"
22
- // margen izquierdo por defecto
23
- ],
24
- {
25
- variants: {
26
- size: {
27
- sm: "text-sm py-1 px-2",
28
- md: "text-base py-2 px-3",
29
- lg: "text-lg py-2 px-4"
30
- },
31
- color: {
32
- primary: "border border-gray-300 focus:border-primary",
33
- info: "border border-blue-500 focus:border-blue-600",
34
- success: "border border-green-500 focus:border-green-600",
35
- warning: "border border-yellow-500 focus:border-yellow-600",
36
- danger: "border border-red-500 focus:border-red-600"
37
- },
38
- loading: {
39
- true: "cursor-wait opacity-75",
40
- false: ""
41
- },
42
- expanded: {
43
- true: "w-full",
44
- false: "w-fit"
45
- },
46
- rounded: {
47
- true: "rounded",
48
- false: "rounded-none"
49
- }
50
- },
51
- defaultVariants: {
52
- size: "md",
53
- color: "primary",
54
- loading: false,
55
- expanded: false,
56
- rounded: false
57
- }
58
- }
59
- );
60
- var wrapperClass = "relative w-full group cursor-pointer";
61
- var selectPaddingClass = "w-full pr-8";
62
- var caretIconBaseClass = "absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors";
63
- var spinnerIconBaseClass = "absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 animate-spin pointer-events-none";
64
- var getIconColor = (color) => {
65
- switch (color) {
66
- case "success":
67
- return "text-green-500 group-hover:text-green-600";
68
- case "danger":
69
- return "text-red-500 group-hover:text-red-600";
70
- case "warning":
71
- return "text-yellow-500 group-hover:text-yellow-600";
72
- case "info":
73
- return "text-blue-500 group-hover:text-blue-600";
74
- case "primary":
75
- default:
76
- return "text-gray-500 group-hover:text-gray-700";
77
- }
78
- };
79
- var getSpinnerColor = (color) => {
80
- switch (color) {
81
- case "success":
82
- return "text-green-500";
83
- case "danger":
84
- return "text-red-500";
85
- case "warning":
86
- return "text-yellow-500";
87
- case "info":
88
- return "text-blue-500";
89
- case "primary":
90
- default:
91
- return "text-gray-500";
92
- }
93
- };
94
-
95
- // src/components/select/CaretDownIcon.tsx
96
- var CaretDownIcon = (props) => <svg
97
- class={`${caretIconBaseClass} ${props.class ?? ""}`}
98
- fill="none"
99
- stroke="currentColor"
100
- stroke-width="2"
101
- viewBox="0 0 24 24"
102
- >
103
- <path d="M6 9l6 6 6-6" />
104
- </svg>;
105
- var CaretDownIcon_default = CaretDownIcon;
106
-
107
- // src/components/select/SpinnerIcon.tsx
108
- var SpinnerIcon = (props) => <svg
109
- class={`${spinnerIconBaseClass} ${props.class ?? ""}`}
110
- xmlns="http://www.w3.org/2000/svg"
111
- fill="none"
112
- viewBox="0 0 24 24"
113
- stroke-width="2"
114
- >
115
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" />
116
- <path
117
- class="opacity-75"
118
- fill="currentColor"
119
- d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
120
- />
121
- </svg>;
122
- var SpinnerIcon_default = SpinnerIcon;
123
-
124
- // src/components/select/Select.tsx
125
- var Select = (props) => {
126
- const [localProps, variantProps, otherProps] = splitProps(
127
- props,
128
- ["placeholder", "value", "nativeSize", "onChange", "onFocus", "onBlur"],
129
- ["class", ...selectVariants.variantKeys]
130
- );
131
- const empty = createMemo(
132
- () => untrack(() => localProps.value === null || localProps.value === void 0)
133
- );
134
- const selectClass = createMemo(
135
- () => classes(
136
- selectVariants(variantProps),
137
- variantProps.class,
138
- selectPaddingClass
139
- )
140
- );
141
- return <div class={wrapperClass}>
142
- <select
143
- class={selectClass()}
144
- size={localProps.nativeSize}
145
- value={localProps.value}
146
- onChange={localProps.onChange}
147
- onFocus={localProps.onFocus}
148
- onBlur={localProps.onBlur}
149
- {...otherProps}
150
- >
151
- <Show when={localProps.placeholder && empty()}>
152
- <option value="" disabled hidden>
153
- {localProps.placeholder}
154
- </option>
155
- </Show>
156
- {props.children}
157
- </select>
158
-
159
- <Show when={variantProps.loading}>
160
- <SpinnerIcon_default
161
- class={`${spinnerIconBaseClass} ${getSpinnerColor(
162
- variantProps.color
163
- )}`}
164
- />
165
- </Show>
166
-
167
- <Show when={!variantProps.loading}>
168
- <CaretDownIcon_default
169
- class={`${caretIconBaseClass} ${getIconColor(variantProps.color)}`}
170
- />
171
- </Show>
172
- </div>;
173
- };
174
- var Select_default = Select;
175
-
176
- // src/components/select/index.ts
177
- var select_default = Select_default;
178
-
179
- export {
180
- select_default
181
- };
@@ -1,179 +0,0 @@
1
- import {
2
- cva
3
- } from "./P7WPLZNA.jsx";
4
-
5
- // src/components/switch/Switch.tsx
6
- import {
7
- createSignal,
8
- splitProps,
9
- createMemo,
10
- untrack
11
- } from "solid-js";
12
-
13
- // src/components/switch/Switch.styles.ts
14
- var switchVariants = cva(
15
- "switch inline-flex items-center gap-2 select-none",
16
- {
17
- variants: {
18
- size: {
19
- sm: "text-sm",
20
- md: "text-base",
21
- lg: "text-lg"
22
- },
23
- disabled: {
24
- true: "opacity-50",
25
- false: ""
26
- },
27
- rounded: {
28
- true: "",
29
- false: ""
30
- },
31
- outlined: {
32
- true: "",
33
- false: ""
34
- }
35
- },
36
- defaultVariants: {
37
- size: "md",
38
- disabled: false,
39
- rounded: true,
40
- outlined: false
41
- }
42
- }
43
- );
44
- var checkVariants = cva(
45
- [
46
- "relative transition-colors duration-200",
47
- "after:content-[''] after:absolute after:bg-white after:transition-transform after:duration-700 after:ease-in-out after:shadow-sm"
48
- ].join(" "),
49
- {
50
- variants: {
51
- size: {
52
- 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",
53
- md: "w-10 h-6 after:w-4 after:h-4 after:left-1 after:top-1 peer-checked:after:translate-x-4",
54
- lg: "w-12 h-7 after:w-5 after:h-5 after:left-1 after:top-1 peer-checked:after:translate-x-5"
55
- },
56
- color: {
57
- primary: "peer-checked:bg-blue-500",
58
- success: "peer-checked:bg-green-500",
59
- danger: "peer-checked:bg-red-500",
60
- warning: "peer-checked:bg-yellow-400",
61
- gray: "peer-checked:bg-gray-400"
62
- },
63
- passiveColor: {
64
- primary: "bg-blue-200",
65
- success: "bg-green-200",
66
- danger: "bg-red-200",
67
- warning: "bg-yellow-200",
68
- gray: "bg-gray-200"
69
- },
70
- rounded: {
71
- true: "rounded-full after:rounded-full",
72
- false: "rounded-md after:rounded-sm"
73
- },
74
- outlined: {
75
- true: "bg-transparent ring border-current",
76
- false: ""
77
- },
78
- disabled: {
79
- true: "bg-gray-200 border border-gray-300 after:bg-gray-100",
80
- false: ""
81
- }
82
- },
83
- defaultVariants: {
84
- size: "md",
85
- color: "primary",
86
- passiveColor: "gray",
87
- rounded: true,
88
- outlined: false
89
- }
90
- }
91
- );
92
- var switchLabelClass = cva("control-label", {
93
- variants: {
94
- disabled: {
95
- true: "text-gray-400 dark:text-gray-500",
96
- false: "text-gray-800 dark:text-gray-200"
97
- }
98
- },
99
- defaultVariants: {
100
- disabled: false
101
- }
102
- });
103
-
104
- // src/components/switch/Switch.tsx
105
- var Switch = (props) => {
106
- const [localProps, variantProps, otherProps] = splitProps(
107
- props,
108
- [
109
- "children",
110
- "checked",
111
- "defaultChecked",
112
- "onChange",
113
- "name",
114
- "required",
115
- "disabled",
116
- "aria-label",
117
- "aria-describedby"
118
- ],
119
- ["size", "rounded", "outlined", "color", "passiveColor", "disabled"]
120
- );
121
- const isControlled = localProps.checked !== void 0;
122
- const [internalChecked, setInternalChecked] = createSignal(
123
- localProps.defaultChecked ?? false
124
- );
125
- const checkedValue = createMemo(
126
- () => untrack(() => isControlled ? localProps.checked : internalChecked())
127
- );
128
- const switchClasses = createMemo(() => switchVariants(variantProps));
129
- const checkClasses = createMemo(
130
- () => checkVariants({
131
- size: variantProps.size,
132
- color: variantProps.color,
133
- passiveColor: variantProps.passiveColor,
134
- rounded: variantProps.rounded,
135
- outlined: variantProps.outlined,
136
- disabled: localProps.disabled
137
- })
138
- );
139
- const handleChange = (e) => {
140
- if (localProps.disabled) return;
141
- const next = e.currentTarget.checked;
142
- untrack(() => {
143
- if (!isControlled) setInternalChecked(next);
144
- localProps.onChange?.(next);
145
- });
146
- };
147
- return <label
148
- class={switchClasses()}
149
- role="switch"
150
- aria-checked={checkedValue()}
151
- aria-label={localProps["aria-label"]}
152
- aria-describedby={localProps["aria-describedby"]}
153
- >
154
- <input
155
- type="checkbox"
156
- class="sr-only peer"
157
- checked={checkedValue()}
158
- onChange={handleChange}
159
- name={localProps.name}
160
- required={localProps.required}
161
- disabled={localProps.disabled}
162
- aria-hidden="true"
163
- {...otherProps}
164
- />
165
-
166
- <span class={checkClasses()} />
167
- <span class={switchLabelClass({ disabled: localProps.disabled })}>
168
- {localProps.children}
169
- </span>
170
- </label>;
171
- };
172
- var Switch_default = Switch;
173
-
174
- // src/components/switch/index.ts
175
- var switch_default = Switch_default;
176
-
177
- export {
178
- switch_default
179
- };