@pathscale/ui 0.0.5 → 0.0.7

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 +3 -3
  28. package/dist/index.js +12 -12
  29. package/dist/index.jsx +15 -15
  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';
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
+ export { tooltip_default as Tooltip } from './chunk/5KABSQPM.js';
1
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 { steps_default as Steps } from './chunk/TT2JYGLU.js';
5
- export { select_default as Select } from './chunk/3IHANYRN.js';
6
- export { switch_default as Switch } from './chunk/P2L6LFLS.js';
7
- export { tabs_default as Tabs } from './chunk/WOT36Q7O.js';
8
- export { textarea_default as Textarea } from './chunk/EB7KXR65.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';
9
6
  export { table_default as Table } from './chunk/QYEMOKUG.js';
7
+ export { tabs_default as Tabs } from './chunk/WOT36Q7O.js';
10
8
  export { tag_default as Tag } from './chunk/CJZGTNJZ.js';
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
- export { checkbox_default as Checkbox } from './chunk/FPUQ25SO.js';
12
+ export { field_default as Field } from './chunk/MAX47D6F.js';
13
13
  export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
14
- export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
15
- export { pagination_default as Pagination } from './chunk/DBQ7IOPU.js';
16
- export { input_default as Input } from './chunk/T2DPPLBQ.js';
14
+ export { input_default as Input } from './chunk/FNXIOJJY.js';
17
15
  export { Navbar_default as Navbar, NavbarDropdown_default as NavbarDropdown, NavbarItem_default as NavbarItem } from './chunk/OSJ3P7PI.js';
16
+ export { pagination_default as Pagination } from './chunk/DBQ7IOPU.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
20
  export { avatar_default as Avatar } from './chunk/MI773TMC.js';
21
21
  export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
22
+ export { Breadcrumb_default as Breadcrumb, BreadcrumbItem_default as BreadcrumbItem } from './chunk/V6Y5E7BL.js';
22
23
  export { button_default as Button } from './chunk/YMO6RPS6.js';
23
24
  export { Polymorphic_default as Polymorphic, PolymorphicButton_default as PolymorphicButton } from './chunk/G6RG4LR7.js';
24
- export { field_default as Field } from './chunk/MAX47D6F.js';
25
- export { Breadcrumb_default as Breadcrumb, BreadcrumbItem_default as BreadcrumbItem } from './chunk/V6Y5E7BL.js';
25
+ export { checkbox_default as Checkbox } from './chunk/VLJEQN2A.js';
package/dist/index.jsx CHANGED
@@ -4,31 +4,31 @@ import {
4
4
  } from "./chunk/FKSQPGOD.jsx";
5
5
  import {
6
6
  tooltip_default
7
- } from "./chunk/DNTGSCVF.jsx";
7
+ } from "./chunk/YM2NLFQE.jsx";
8
8
  import {
9
9
  upload_default
10
10
  } from "./chunk/QHJOIUYT.jsx";
11
+ import {
12
+ select_default
13
+ } from "./chunk/F33TSIEQ.jsx";
11
14
  import {
12
15
  steps_default
13
16
  } from "./chunk/LAQPAV5I.jsx";
14
- import {
15
- select_default
16
- } from "./chunk/6SBH3KSM.jsx";
17
17
  import {
18
18
  switch_default
19
- } from "./chunk/GLEAR2TS.jsx";
19
+ } from "./chunk/5R7S7TXL.jsx";
20
20
  import {
21
21
  table_default
22
22
  } from "./chunk/HWAGW5N4.jsx";
23
+ import {
24
+ tabs_default
25
+ } from "./chunk/KV6LTJHI.jsx";
23
26
  import {
24
27
  tag_default
25
28
  } from "./chunk/LI3HCFL7.jsx";
26
29
  import {
27
30
  textarea_default
28
31
  } from "./chunk/WB6NEEQV.jsx";
29
- import {
30
- tabs_default
31
- } from "./chunk/KV6LTJHI.jsx";
32
32
  import {
33
33
  timeline_default
34
34
  } from "./chunk/DSTUGZW6.jsx";
@@ -42,17 +42,17 @@ import {
42
42
  } from "./chunk/VN5BKHA2.jsx";
43
43
  import {
44
44
  input_default
45
- } from "./chunk/N7BXP7EI.jsx";
46
- import {
47
- MenuItem_default,
48
- MenuList_default,
49
- Menu_default
50
- } from "./chunk/XD34JKSU.jsx";
45
+ } from "./chunk/DGI3XY32.jsx";
51
46
  import {
52
47
  NavbarDropdown_default,
53
48
  NavbarItem_default,
54
49
  Navbar_default
55
50
  } from "./chunk/BBDVIXAH.jsx";
51
+ import {
52
+ MenuItem_default,
53
+ MenuList_default,
54
+ Menu_default
55
+ } from "./chunk/XD34JKSU.jsx";
56
56
  import {
57
57
  pagination_default
58
58
  } from "./chunk/ELRAUORW.jsx";
@@ -82,7 +82,7 @@ import {
82
82
  } from "./chunk/KACNXPUM.jsx";
83
83
  import {
84
84
  checkbox_default
85
- } from "./chunk/MXG3MBEN.jsx";
85
+ } from "./chunk/Z5DP7GYE.jsx";
86
86
  import "./chunk/P7WPLZNA.jsx";
87
87
  export {
88
88
  accordion_default as Accordion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
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
- };