@pathscale/ui 0.0.4 → 0.0.6

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 (39) hide show
  1. package/dist/{Checkbox-BjaweaOH.d.ts → Checkbox-CzeDsQLA.d.ts} +3 -11
  2. package/dist/{Input-BQbTzjIO.d.ts → Input-X4gwIB-F.d.ts} +9 -1
  3. package/dist/{Switch-3IXS_68H.d.ts → Switch-B6dN2G97.d.ts} +13 -9
  4. package/dist/chunk/{4TWLQ3IA.js → 5KABSQPM.js} +10 -2
  5. package/dist/chunk/{GLEAR2TS.jsx → 5R7S7TXL.jsx} +36 -17
  6. package/dist/chunk/{P2L6LFLS.js → 6B7HOWQD.js} +40 -19
  7. package/dist/chunk/DGI3XY32.jsx +157 -0
  8. package/dist/chunk/F33TSIEQ.jsx +181 -0
  9. package/dist/chunk/FNXIOJJY.js +156 -0
  10. package/dist/chunk/OMRJVDZV.js +173 -0
  11. package/dist/chunk/VLJEQN2A.js +130 -0
  12. package/dist/chunk/{DNTGSCVF.jsx → YM2NLFQE.jsx} +1 -1
  13. package/dist/chunk/Z5DP7GYE.jsx +155 -0
  14. package/dist/components/checkbox/index.d.ts +2 -2
  15. package/dist/components/checkbox/index.js +1 -1
  16. package/dist/components/checkbox/index.jsx +1 -1
  17. package/dist/components/input/index.d.ts +7 -5
  18. package/dist/components/input/index.js +1 -1
  19. package/dist/components/input/index.jsx +3 -1
  20. package/dist/components/select/index.js +1 -1
  21. package/dist/components/select/index.jsx +1 -1
  22. package/dist/components/switch/index.d.ts +2 -2
  23. package/dist/components/switch/index.js +1 -1
  24. package/dist/components/switch/index.jsx +1 -1
  25. package/dist/components/tooltip/index.js +1 -1
  26. package/dist/components/tooltip/index.jsx +1 -1
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +10 -10
  29. package/dist/index.jsx +25 -23
  30. package/package.json +1 -1
  31. package/dist/chunk/3IHANYRN.js +0 -98
  32. package/dist/chunk/6SBH3KSM.jsx +0 -96
  33. package/dist/chunk/FPUQ25SO.js +0 -137
  34. package/dist/chunk/MXG3MBEN.jsx +0 -148
  35. package/dist/chunk/N7BXP7EI.jsx +0 -102
  36. package/dist/chunk/T2DPPLBQ.js +0 -100
  37. /package/dist/components/{Progress → progress}/index.d.ts +0 -0
  38. /package/dist/components/{Progress → progress}/index.js +0 -0
  39. /package/dist/components/{Progress → progress}/index.jsx +0 -0
@@ -0,0 +1,155 @@
1
+ import {
2
+ cva
3
+ } from "./P7WPLZNA.jsx";
4
+
5
+ // src/components/checkbox/Checkbox.tsx
6
+ import {
7
+ splitProps,
8
+ createSignal,
9
+ Show,
10
+ untrack
11
+ } from "solid-js";
12
+
13
+ // src/components/checkbox/Checkbox.styles.ts
14
+ var checkboxVariants = cva(
15
+ [
16
+ "relative inline-flex items-center gap-2 select-none",
17
+ "cursor-pointer disabled:cursor-default peer-disabled:cursor-default",
18
+ "peer-disabled:opacity-50"
19
+ ],
20
+ {
21
+ variants: {
22
+ size: {
23
+ sm: "text-sm",
24
+ md: "text-base",
25
+ lg: "text-lg"
26
+ },
27
+ color: {
28
+ primary: "text-blue-600",
29
+ success: "text-green-600",
30
+ warning: "text-yellow-600",
31
+ danger: "text-red-600"
32
+ }
33
+ },
34
+ defaultVariants: {
35
+ size: "md",
36
+ color: "primary"
37
+ }
38
+ }
39
+ );
40
+ var checkboxMarkerVariants = cva([
41
+ "inline-flex items-center justify-center w-5 h-5 rounded-sm border",
42
+ "transition-colors duration-200",
43
+ "border-gray-400 text-gray-800 dark:text-gray-200",
44
+ "peer-disabled:opacity-50"
45
+ ]);
46
+ var checkboxInputClass = "peer absolute opacity-0 w-4 h-4";
47
+ var checkboxLabelClass = "ml-2 text-gray-800 dark:text-gray-200";
48
+
49
+ // src/components/checkbox/CheckIcon.tsx
50
+ import "solid-js";
51
+ var CheckIcon = () => <svg
52
+ viewBox="0 0 24 24"
53
+ fill="none"
54
+ stroke="currentColor"
55
+ stroke-width="3"
56
+ stroke-linecap="round"
57
+ stroke-linejoin="round"
58
+ class="w-3.5 h-3.5"
59
+ >
60
+ <polyline points="20 6 9 17 4 12" />
61
+ </svg>;
62
+ var CheckIcon_default = CheckIcon;
63
+
64
+ // src/components/checkbox/MinusIcon.tsx
65
+ import "solid-js";
66
+ var MinusIcon = () => <svg
67
+ viewBox="0 0 24 24"
68
+ fill="none"
69
+ stroke="currentColor"
70
+ stroke-width="3"
71
+ stroke-linecap="round"
72
+ stroke-linejoin="round"
73
+ class="w-3.5 h-3.5"
74
+ >
75
+ <line x1="5" y1="12" x2="19" y2="12" />
76
+ </svg>;
77
+ var MinusIcon_default = MinusIcon;
78
+
79
+ // src/components/checkbox/Checkbox.tsx
80
+ var Checkbox = (props) => {
81
+ const [localProps, variantProps, otherProps] = splitProps(
82
+ props,
83
+ [
84
+ "label",
85
+ "indeterminate",
86
+ "defaultChecked",
87
+ "checked",
88
+ "onChange",
89
+ "onFocus",
90
+ "onBlur",
91
+ "disabled"
92
+ ],
93
+ ["class", ...checkboxVariants.variantKeys]
94
+ );
95
+ let inputRef;
96
+ const [status, setStatus] = createSignal(
97
+ localProps.indeterminate ? "indeterminate" : localProps.defaultChecked ? "checked" : "unchecked"
98
+ );
99
+ const handleChange = (e) => {
100
+ const input = e.currentTarget;
101
+ if (input.indeterminate) {
102
+ input.indeterminate = false;
103
+ input.checked = true;
104
+ setStatus("checked");
105
+ } else {
106
+ setStatus(input.checked ? "checked" : "unchecked");
107
+ }
108
+ untrack(() => {
109
+ if (typeof localProps.onChange === "function") {
110
+ localProps.onChange(e);
111
+ }
112
+ });
113
+ };
114
+ return <label
115
+ class={checkboxVariants()}
116
+ role="checkbox"
117
+ aria-checked={status() === "indeterminate" ? "mixed" : status() === "checked"}
118
+ >
119
+ <input
120
+ ref={(el) => {
121
+ inputRef = el;
122
+ if (status() === "indeterminate") {
123
+ el.indeterminate = true;
124
+ }
125
+ }}
126
+ type="checkbox"
127
+ class={checkboxInputClass}
128
+ checked={status() === "checked"}
129
+ disabled={localProps.disabled}
130
+ aria-hidden="true"
131
+ {...otherProps}
132
+ onChange={handleChange}
133
+ onFocus={localProps.onFocus}
134
+ onBlur={localProps.onBlur}
135
+ />
136
+
137
+ <span class={checkboxMarkerVariants()}>
138
+ <Show when={status() !== "unchecked"}>
139
+ {status() === "indeterminate" ? <MinusIcon_default /> : <CheckIcon_default />}
140
+ </Show>
141
+ </span>
142
+
143
+ <Show when={localProps.label}>
144
+ <span class={checkboxLabelClass}>{localProps.label}</span>
145
+ </Show>
146
+ </label>;
147
+ };
148
+ var Checkbox_default = Checkbox;
149
+
150
+ // src/components/checkbox/index.ts
151
+ var checkbox_default = Checkbox_default;
152
+
153
+ export {
154
+ checkbox_default
155
+ };
@@ -1,5 +1,5 @@
1
- import { C as Checkbox } from '../../Checkbox-BjaweaOH.js';
2
- export { a as CheckboxProps } from '../../Checkbox-BjaweaOH.js';
1
+ import { C as Checkbox } from '../../Checkbox-CzeDsQLA.js';
2
+ export { a as CheckboxProps } from '../../Checkbox-CzeDsQLA.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1 +1 @@
1
- export { checkbox_default as default } from '../../chunk/FPUQ25SO.js';
1
+ export { checkbox_default as default } from '../../chunk/VLJEQN2A.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  checkbox_default
3
- } from "../../chunk/MXG3MBEN.jsx";
3
+ } from "../../chunk/Z5DP7GYE.jsx";
4
4
  import "../../chunk/P7WPLZNA.jsx";
5
5
  export {
6
6
  checkbox_default as default
@@ -1,8 +1,10 @@
1
- import { I as Input } from '../../Input-BQbTzjIO.js';
2
- export { a as InputProps } from '../../Input-BQbTzjIO.js';
3
- import 'solid-js';
1
+ import { I as Input } from '../../Input-X4gwIB-F.js';
2
+ export { a as InputProps } from '../../Input-X4gwIB-F.js';
3
+ import { Component } from 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
6
+ declare const EyeIcon: Component<{
7
+ invisible?: boolean;
8
+ }>;
6
9
 
7
-
8
- export { Input as default };
10
+ export { EyeIcon, Input as default };
@@ -1 +1 @@
1
- export { input_default as default } from '../../chunk/T2DPPLBQ.js';
1
+ export { EyeIcon_default as EyeIcon, input_default as default } from '../../chunk/FNXIOJJY.js';
@@ -1,7 +1,9 @@
1
1
  import {
2
+ EyeIcon_default,
2
3
  input_default
3
- } from "../../chunk/N7BXP7EI.jsx";
4
+ } from "../../chunk/DGI3XY32.jsx";
4
5
  import "../../chunk/P7WPLZNA.jsx";
5
6
  export {
7
+ EyeIcon_default as EyeIcon,
6
8
  input_default as default
7
9
  };
@@ -1 +1 @@
1
- export { select_default as default } from '../../chunk/3IHANYRN.js';
1
+ export { select_default as default } from '../../chunk/OMRJVDZV.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  select_default
3
- } from "../../chunk/6SBH3KSM.jsx";
3
+ } from "../../chunk/F33TSIEQ.jsx";
4
4
  import "../../chunk/P7WPLZNA.jsx";
5
5
  export {
6
6
  select_default as default
@@ -1,5 +1,5 @@
1
- import { S as Switch } from '../../Switch-3IXS_68H.js';
2
- export { a as SwitchProps } from '../../Switch-3IXS_68H.js';
1
+ import { S as Switch } from '../../Switch-B6dN2G97.js';
2
+ export { a as SwitchProps } from '../../Switch-B6dN2G97.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1 +1 @@
1
- export { switch_default as default } from '../../chunk/P2L6LFLS.js';
1
+ export { switch_default as default } from '../../chunk/6B7HOWQD.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  switch_default
3
- } from "../../chunk/GLEAR2TS.jsx";
3
+ } from "../../chunk/5R7S7TXL.jsx";
4
4
  import "../../chunk/P7WPLZNA.jsx";
5
5
  export {
6
6
  switch_default as default
@@ -1 +1 @@
1
- export { tooltip_default as default } from '../../chunk/4TWLQ3IA.js';
1
+ export { tooltip_default as default } from '../../chunk/5KABSQPM.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tooltip_default
3
- } from "../../chunk/DNTGSCVF.jsx";
3
+ } from "../../chunk/YM2NLFQE.jsx";
4
4
  import "../../chunk/P7WPLZNA.jsx";
5
5
  export {
6
6
  tooltip_default as default
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { A as Avatar } from './Avatar-CzIirpVq.js';
2
2
  export { B as Button } from './Button-B50OLXuV.js';
3
- export { I as Input } from './Input-BQbTzjIO.js';
3
+ export { I as Input } from './Input-X4gwIB-F.js';
4
4
  export { T as Textarea } from './Textarea-Cpdk7m6S.js';
5
5
  export { P as Progress } from './Progress-gN0xqhAF.js';
6
6
  export { U as Upload } from './Upload-CRljD5jf.js';
@@ -10,8 +10,8 @@ export { T as Tabs } from './Tabs-BNR3p92D.js';
10
10
  export { T as Tooltip } from './Tooltip-BfPongoz.js';
11
11
  export { T as Tag } from './Tag-BPrhn-Ne.js';
12
12
  export { S as Select } from './Select-CP-TUHJv.js';
13
- export { S as Switch } from './Switch-3IXS_68H.js';
14
- export { C as Checkbox } from './Checkbox-BjaweaOH.js';
13
+ export { S as Switch } from './Switch-B6dN2G97.js';
14
+ export { C as Checkbox } from './Checkbox-CzeDsQLA.js';
15
15
  export { Breadcrumb, BreadcrumbItem } from './components/breadcrumb/index.js';
16
16
  export { A as Autocomplete } from './Autocomplete-gLkjMHrc.js';
17
17
  export { Dropdown, DropdownItem, DropdownMenu } from './components/dropdown/index.js';
@@ -22,6 +22,6 @@ export { Polymorphic, PolymorphicButton } from './components/polymorphic/index.j
22
22
  export { S as Steps } from './Steps-1miUeyCD.js';
23
23
  export { T as Table } from './Table-CGa6Nop3.js';
24
24
  export { T as Timeline } from './Timeline-Bd4SxHMT.js';
25
- export { default as Toast } from './components/toast/index.js';
25
+ export { Toaster, default as toast } from './components/toast/index.js';
26
26
  import 'solid-js';
27
27
  import './classes-B_S9K-9I.js';
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- export { toast_default as Toast } from './chunk/JWRGKHDO.js';
1
+ export { tooltip_default as Tooltip } from './chunk/5KABSQPM.js';
2
+ export { Toaster_default as Toaster, toast_default as toast } from './chunk/JWRGKHDO.js';
2
3
  export { upload_default as Upload } from './chunk/YDEDUOFM.js';
3
- export { tooltip_default as Tooltip } from './chunk/4TWLQ3IA.js';
4
- export { select_default as Select } from './chunk/3IHANYRN.js';
5
- export { switch_default as Switch } from './chunk/P2L6LFLS.js';
6
- export { steps_default as Steps } from './chunk/TT2JYGLU.js';
4
+ export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
5
+ export { switch_default as Switch } from './chunk/6B7HOWQD.js';
7
6
  export { table_default as Table } from './chunk/QYEMOKUG.js';
8
7
  export { tabs_default as Tabs } from './chunk/WOT36Q7O.js';
9
8
  export { tag_default as Tag } from './chunk/CJZGTNJZ.js';
10
9
  export { textarea_default as Textarea } from './chunk/EB7KXR65.js';
10
+ export { select_default as Select } from './chunk/OMRJVDZV.js';
11
11
  export { timeline_default as Timeline } from './chunk/WUZETUQR.js';
12
12
  export { field_default as Field } from './chunk/MAX47D6F.js';
13
- export { input_default as Input } from './chunk/T2DPPLBQ.js';
14
- export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
13
+ export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
14
+ export { input_default as Input } from './chunk/FNXIOJJY.js';
15
15
  export { Navbar_default as Navbar, NavbarDropdown_default as NavbarDropdown, NavbarItem_default as NavbarItem } from './chunk/OSJ3P7PI.js';
16
16
  export { pagination_default as Pagination } from './chunk/DBQ7IOPU.js';
17
- export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
18
17
  export { progress_default as Progress } from './chunk/GMIXRYN3.js';
18
+ export { steps_default as Steps } from './chunk/TT2JYGLU.js';
19
19
  export { accordion_default as Accordion } from './chunk/NZKPDBTE.js';
20
- export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
21
20
  export { avatar_default as Avatar } from './chunk/MI773TMC.js';
21
+ export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
22
22
  export { Breadcrumb_default as Breadcrumb, BreadcrumbItem_default as BreadcrumbItem } from './chunk/V6Y5E7BL.js';
23
23
  export { button_default as Button } from './chunk/YMO6RPS6.js';
24
24
  export { Polymorphic_default as Polymorphic, PolymorphicButton_default as PolymorphicButton } from './chunk/G6RG4LR7.js';
25
- export { checkbox_default as Checkbox } from './chunk/FPUQ25SO.js';
25
+ export { checkbox_default as Checkbox } from './chunk/VLJEQN2A.js';
package/dist/index.jsx CHANGED
@@ -1,57 +1,58 @@
1
1
  import {
2
+ Toaster_default,
2
3
  toast_default
3
4
  } from "./chunk/FKSQPGOD.jsx";
4
5
  import {
5
6
  tooltip_default
6
- } from "./chunk/DNTGSCVF.jsx";
7
+ } from "./chunk/YM2NLFQE.jsx";
7
8
  import {
8
9
  upload_default
9
10
  } from "./chunk/QHJOIUYT.jsx";
11
+ import {
12
+ select_default
13
+ } from "./chunk/F33TSIEQ.jsx";
10
14
  import {
11
15
  steps_default
12
16
  } from "./chunk/LAQPAV5I.jsx";
13
17
  import {
14
18
  switch_default
15
- } from "./chunk/GLEAR2TS.jsx";
16
- import {
17
- select_default
18
- } from "./chunk/6SBH3KSM.jsx";
19
+ } from "./chunk/5R7S7TXL.jsx";
19
20
  import {
20
21
  table_default
21
22
  } from "./chunk/HWAGW5N4.jsx";
22
23
  import {
23
24
  tabs_default
24
25
  } from "./chunk/KV6LTJHI.jsx";
25
- import {
26
- textarea_default
27
- } from "./chunk/WB6NEEQV.jsx";
28
26
  import {
29
27
  tag_default
30
28
  } from "./chunk/LI3HCFL7.jsx";
29
+ import {
30
+ textarea_default
31
+ } from "./chunk/WB6NEEQV.jsx";
31
32
  import {
32
33
  timeline_default
33
34
  } from "./chunk/DSTUGZW6.jsx";
34
- import {
35
- field_default
36
- } from "./chunk/VN5BKHA2.jsx";
37
35
  import {
38
36
  DropdownItem_default,
39
37
  DropdownMenu_default,
40
38
  Dropdown_default
41
39
  } from "./chunk/D2BEL4SM.jsx";
42
40
  import {
43
- input_default
44
- } from "./chunk/N7BXP7EI.jsx";
41
+ field_default
42
+ } from "./chunk/VN5BKHA2.jsx";
45
43
  import {
46
- MenuItem_default,
47
- MenuList_default,
48
- Menu_default
49
- } from "./chunk/XD34JKSU.jsx";
44
+ input_default
45
+ } from "./chunk/DGI3XY32.jsx";
50
46
  import {
51
47
  NavbarDropdown_default,
52
48
  NavbarItem_default,
53
49
  Navbar_default
54
50
  } from "./chunk/BBDVIXAH.jsx";
51
+ import {
52
+ MenuItem_default,
53
+ MenuList_default,
54
+ Menu_default
55
+ } from "./chunk/XD34JKSU.jsx";
55
56
  import {
56
57
  pagination_default
57
58
  } from "./chunk/ELRAUORW.jsx";
@@ -61,12 +62,12 @@ import {
61
62
  import {
62
63
  accordion_default
63
64
  } from "./chunk/QONDPQ2I.jsx";
64
- import {
65
- avatar_default
66
- } from "./chunk/C4745OZS.jsx";
67
65
  import {
68
66
  autocomplete_default
69
67
  } from "./chunk/C4YO33NN.jsx";
68
+ import {
69
+ avatar_default
70
+ } from "./chunk/C4745OZS.jsx";
70
71
  import {
71
72
  BreadcrumbItem_default,
72
73
  Breadcrumb_default
@@ -81,7 +82,7 @@ import {
81
82
  } from "./chunk/KACNXPUM.jsx";
82
83
  import {
83
84
  checkbox_default
84
- } from "./chunk/MXG3MBEN.jsx";
85
+ } from "./chunk/Z5DP7GYE.jsx";
85
86
  import "./chunk/P7WPLZNA.jsx";
86
87
  export {
87
88
  accordion_default as Accordion,
@@ -114,7 +115,8 @@ export {
114
115
  tag_default as Tag,
115
116
  textarea_default as Textarea,
116
117
  timeline_default as Timeline,
117
- toast_default as Toast,
118
+ Toaster_default as Toaster,
118
119
  tooltip_default as Tooltip,
119
- upload_default as Upload
120
+ upload_default as Upload,
121
+ toast_default as toast
120
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,98 +0,0 @@
1
- import { cva, classes } from './HKS7ET6T.js';
2
- import { template, spread, mergeProps, insert, createComponent, memo } from 'solid-js/web';
3
- import { splitProps, createMemo, untrack, Show } from 'solid-js';
4
-
5
- // src/components/select/Select.styles.ts
6
- var selectVariants = cva(
7
- [
8
- "relative inline-flex items-center appearance-none",
9
- "border outline-none",
10
- "transition bg-white text-black",
11
- "disabled:opacity-50 disabled:cursor-not-allowed"
12
- ],
13
- {
14
- variants: {
15
- size: {
16
- sm: "text-sm px-2 py-1",
17
- md: "text-base px-3 py-2",
18
- lg: "text-lg px-4 py-2"
19
- },
20
- color: {
21
- primary: "border-gray-300 focus:border-primary",
22
- info: "border-blue-300 focus:border-blue-500",
23
- success: "border-green-300 focus:border-green-500",
24
- warning: "border-yellow-300 focus:border-yellow-500",
25
- danger: "border-red-300 focus:border-red-500"
26
- },
27
- loading: {
28
- true: "cursor-wait opacity-75",
29
- false: ""
30
- },
31
- expanded: {
32
- true: "w-full",
33
- false: "w-fit"
34
- },
35
- rounded: {
36
- true: "rounded",
37
- false: "rounded-none"
38
- }
39
- },
40
- defaultVariants: {
41
- size: "md",
42
- color: "primary",
43
- loading: false,
44
- expanded: false,
45
- rounded: false
46
- }
47
- }
48
- );
49
-
50
- // src/components/select/Select.tsx
51
- var _tmpl$ = /* @__PURE__ */ template(`<option value disabled hidden>`);
52
- var _tmpl$2 = /* @__PURE__ */ template(`<select>`);
53
- var Select = (props) => {
54
- const [localProps, variantProps, otherProps] = splitProps(props, ["placeholder", "value", "nativeSize", "onChange", "onBlur", "onFocus"], ["class", ...selectVariants.variantKeys]);
55
- const empty = createMemo(() => untrack(() => localProps.value === null || localProps.value === void 0));
56
- const selectClasses = createMemo(() => classes(selectVariants(variantProps), variantProps.class));
57
- return (() => {
58
- var _el$ = _tmpl$2();
59
- spread(_el$, mergeProps({
60
- get ["class"]() {
61
- return selectClasses();
62
- },
63
- get size() {
64
- return localProps.nativeSize;
65
- },
66
- get value() {
67
- return localProps.value;
68
- },
69
- get onChange() {
70
- return localProps.onChange;
71
- },
72
- get onFocus() {
73
- return localProps.onFocus;
74
- },
75
- get onBlur() {
76
- return localProps.onBlur;
77
- }
78
- }, otherProps), false, true);
79
- insert(_el$, createComponent(Show, {
80
- get when() {
81
- return memo(() => !!localProps.placeholder)() && empty();
82
- },
83
- get children() {
84
- var _el$2 = _tmpl$();
85
- insert(_el$2, () => localProps.placeholder);
86
- return _el$2;
87
- }
88
- }), null);
89
- insert(_el$, () => props.children, null);
90
- return _el$;
91
- })();
92
- };
93
- var Select_default = Select;
94
-
95
- // src/components/select/index.ts
96
- var select_default = Select_default;
97
-
98
- export { select_default };
@@ -1,96 +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
- "relative inline-flex items-center appearance-none",
18
- "border outline-none",
19
- "transition bg-white text-black",
20
- "disabled:opacity-50 disabled:cursor-not-allowed"
21
- ],
22
- {
23
- variants: {
24
- size: {
25
- sm: "text-sm px-2 py-1",
26
- md: "text-base px-3 py-2",
27
- lg: "text-lg px-4 py-2"
28
- },
29
- color: {
30
- primary: "border-gray-300 focus:border-primary",
31
- info: "border-blue-300 focus:border-blue-500",
32
- success: "border-green-300 focus:border-green-500",
33
- warning: "border-yellow-300 focus:border-yellow-500",
34
- danger: "border-red-300 focus:border-red-500"
35
- },
36
- loading: {
37
- true: "cursor-wait opacity-75",
38
- false: ""
39
- },
40
- expanded: {
41
- true: "w-full",
42
- false: "w-fit"
43
- },
44
- rounded: {
45
- true: "rounded",
46
- false: "rounded-none"
47
- }
48
- },
49
- defaultVariants: {
50
- size: "md",
51
- color: "primary",
52
- loading: false,
53
- expanded: false,
54
- rounded: false
55
- }
56
- }
57
- );
58
-
59
- // src/components/select/Select.tsx
60
- var Select = (props) => {
61
- const [localProps, variantProps, otherProps] = splitProps(
62
- props,
63
- ["placeholder", "value", "nativeSize", "onChange", "onBlur", "onFocus"],
64
- ["class", ...selectVariants.variantKeys]
65
- );
66
- const empty = createMemo(
67
- () => untrack(() => localProps.value === null || localProps.value === void 0)
68
- );
69
- const selectClasses = createMemo(
70
- () => classes(selectVariants(variantProps), variantProps.class)
71
- );
72
- return <select
73
- class={selectClasses()}
74
- size={localProps.nativeSize}
75
- value={localProps.value}
76
- onChange={localProps.onChange}
77
- onFocus={localProps.onFocus}
78
- onBlur={localProps.onBlur}
79
- {...otherProps}
80
- >
81
- <Show when={localProps.placeholder && empty()}>
82
- <option value="" disabled hidden>
83
- {localProps.placeholder}
84
- </option>
85
- </Show>
86
- {props.children}
87
- </select>;
88
- };
89
- var Select_default = Select;
90
-
91
- // src/components/select/index.ts
92
- var select_default = Select_default;
93
-
94
- export {
95
- select_default
96
- };