@websline/system-components 1.0.4 → 1.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.
- package/dist/components/atoms/icon/components/WebslineSupport.svelte +30 -0
- package/dist/components/atoms/icon/components/WebslineSupport.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/index.d.ts +18 -0
- package/dist/components/atoms/icon/index.js +2 -0
- package/dist/components/atoms/input/Input.svelte +5 -4
- package/dist/components/atoms/input/input.variants.d.ts +102 -9
- package/dist/components/atoms/input/input.variants.js +44 -5
- package/dist/components/atoms/radio/Radio.svelte +3 -2
- package/dist/components/atoms/select/Select.svelte +11 -10
- package/dist/components/atoms/select/select.variants.d.ts +34 -26
- package/dist/components/atoms/select/select.variants.js +12 -22
- package/dist/components/atoms/switch/Switch.svelte +3 -2
- package/dist/components/atoms/textarea/Textarea.svelte +5 -4
- package/dist/components/atoms/textarea/textarea.variants.d.ts +45 -21
- package/dist/components/atoms/textarea/textarea.variants.js +5 -7
- package/dist/components/atoms/utils/xScroll/XScroll.svelte +87 -0
- package/dist/components/atoms/utils/xScroll/XScroll.svelte.d.ts +25 -0
- package/dist/components/atoms/utils/xScroll/xScroll.variants.d.ts +39 -0
- package/dist/components/atoms/utils/xScroll/xScroll.variants.js +16 -0
- package/dist/components/molecules/formField/FormField.svelte +13 -8
- package/dist/components/molecules/formField/FormField.svelte.d.ts +14 -6
- package/dist/components/molecules/formField/formField.variants.d.ts +42 -6
- package/dist/components/molecules/formField/formField.variants.js +14 -2
- package/dist/components/molecules/selectorCard/SelectorCard.svelte +2 -2
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +9 -6
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.d.ts +49 -11
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.js +16 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +27 -27
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {string} [color=""] Icon color
|
|
5
|
+
* @property {number} [height=24] Icon height
|
|
6
|
+
* @property {number} [strokeWidth=1.5] Icon StrokeWidth
|
|
7
|
+
* @property {number} [width=24] Icon width
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { color, height = 24, width = 24, strokeWidth = 1.5, ...rest } = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svg
|
|
15
|
+
{height}
|
|
16
|
+
{width}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
{...rest}>
|
|
20
|
+
<path d="M12,14.31v-2c1.66,0,3-1.34,3-3s-1.34-3-3-3-3,1.34-3,3M12,22c2.76,0,5.26-1.12,7.07-2.93,1.81-1.81,2.93-4.31,2.93-7.07s-1.12-5.26-2.93-7.07c-1.81-1.81-4.31-2.93-7.07-2.93s-5.26,1.12-7.07,2.93c-1.81,1.81-2.93,4.31-2.93,7.07s1.12,5.26,2.93,7.07c1.81,1.81,4.31,2.93,7.07,2.93Z" fill="none" stroke={color}
|
|
21
|
+
stroke-width={strokeWidth}
|
|
22
|
+
stroke-linecap="round"
|
|
23
|
+
stroke-linejoin="round"
|
|
24
|
+
/>
|
|
25
|
+
<path d="M12.05,18.88c1.61,0,1.61-2.5,0-2.5s-1.61,2.5,0,2.5h0Z" fill={color}/>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default WebslineSupport;
|
|
2
|
+
type WebslineSupport = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const WebslineSupport: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -683,4 +683,22 @@ export const registry: {
|
|
|
683
683
|
*/
|
|
684
684
|
width?: number;
|
|
685
685
|
}, {}, "">;
|
|
686
|
+
webslineSupport: import("svelte").Component<{
|
|
687
|
+
/**
|
|
688
|
+
* Icon color
|
|
689
|
+
*/
|
|
690
|
+
color?: string;
|
|
691
|
+
/**
|
|
692
|
+
* Icon height
|
|
693
|
+
*/
|
|
694
|
+
height?: number;
|
|
695
|
+
/**
|
|
696
|
+
* Icon StrokeWidth
|
|
697
|
+
*/
|
|
698
|
+
strokeWidth?: number;
|
|
699
|
+
/**
|
|
700
|
+
* Icon width
|
|
701
|
+
*/
|
|
702
|
+
width?: number;
|
|
703
|
+
}, {}, "">;
|
|
686
704
|
};
|
|
@@ -36,6 +36,7 @@ import Trash from "./components/Trash.svelte";
|
|
|
36
36
|
import Underline from "./components/Underline.svelte";
|
|
37
37
|
import Undo from "./components/Undo.svelte";
|
|
38
38
|
import Unlink from "./components/Unlink.svelte";
|
|
39
|
+
import WebslineSupport from "./components/WebslineSupport.svelte";
|
|
39
40
|
|
|
40
41
|
export const registry = {
|
|
41
42
|
academy: Academy,
|
|
@@ -76,4 +77,5 @@ export const registry = {
|
|
|
76
77
|
underline: Underline,
|
|
77
78
|
undo: Undo,
|
|
78
79
|
unlink: Unlink,
|
|
80
|
+
webslineSupport: WebslineSupport,
|
|
79
81
|
};
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
|
-
|
|
44
|
+
disabled,
|
|
45
45
|
error,
|
|
46
|
+
id,
|
|
46
47
|
required,
|
|
47
48
|
};
|
|
48
49
|
});
|
|
@@ -51,10 +52,10 @@
|
|
|
51
52
|
<input
|
|
52
53
|
class={inputVariants({
|
|
53
54
|
class: className,
|
|
54
|
-
disabled,
|
|
55
|
+
disabled: localValues.disabled,
|
|
55
56
|
error: localValues.error,
|
|
56
|
-
})}
|
|
57
|
-
{disabled}
|
|
57
|
+
}).base()}
|
|
58
|
+
disabled={localValues.disabled}
|
|
58
59
|
id={localValues.id}
|
|
59
60
|
{name}
|
|
60
61
|
{placeholder}
|
|
@@ -1,22 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
3
|
+
*/
|
|
4
|
+
export const inputBaseVariant: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
disabled: {
|
|
6
|
+
true: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
error: {
|
|
11
|
+
true: {
|
|
12
|
+
base: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
base: string[];
|
|
17
|
+
}, undefined, {
|
|
18
|
+
disabled: {
|
|
19
|
+
true: {
|
|
20
|
+
base: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
error: {
|
|
24
|
+
true: {
|
|
25
|
+
base: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
base: string[];
|
|
30
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
31
|
+
disabled: {
|
|
32
|
+
true: {
|
|
33
|
+
base: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
error: {
|
|
37
|
+
true: {
|
|
38
|
+
base: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
base: string[];
|
|
43
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
1
44
|
export const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
45
|
+
[key: string]: {
|
|
46
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
47
|
+
base?: import("tailwind-variants").ClassValue;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
disabled: {
|
|
52
|
+
true: import("tailwind-variants").ClassValue | {
|
|
53
|
+
base?: import("tailwind-variants").ClassValue;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
error: {
|
|
57
|
+
true: import("tailwind-variants").ClassValue | {
|
|
58
|
+
base?: import("tailwind-variants").ClassValue;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
base: string;
|
|
63
|
+
}, undefined, {
|
|
64
|
+
disabled: {
|
|
65
|
+
true: {
|
|
66
|
+
base: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
error: {
|
|
70
|
+
true: {
|
|
71
|
+
base: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
base: string[];
|
|
76
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
2
77
|
disabled: {
|
|
3
|
-
true:
|
|
78
|
+
true: {
|
|
79
|
+
base: string;
|
|
80
|
+
};
|
|
4
81
|
};
|
|
5
82
|
error: {
|
|
6
|
-
true:
|
|
83
|
+
true: {
|
|
84
|
+
base: string;
|
|
85
|
+
};
|
|
7
86
|
};
|
|
8
|
-
},
|
|
87
|
+
}, {
|
|
88
|
+
base: string[];
|
|
89
|
+
}, undefined, {
|
|
9
90
|
disabled: {
|
|
10
|
-
true:
|
|
91
|
+
true: {
|
|
92
|
+
base: string;
|
|
93
|
+
};
|
|
11
94
|
};
|
|
12
95
|
error: {
|
|
13
|
-
true:
|
|
96
|
+
true: {
|
|
97
|
+
base: string;
|
|
98
|
+
};
|
|
14
99
|
};
|
|
15
|
-
},
|
|
100
|
+
}, {
|
|
101
|
+
base: string[];
|
|
102
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
16
103
|
disabled: {
|
|
17
|
-
true:
|
|
104
|
+
true: {
|
|
105
|
+
base: string;
|
|
106
|
+
};
|
|
18
107
|
};
|
|
19
108
|
error: {
|
|
20
|
-
true:
|
|
109
|
+
true: {
|
|
110
|
+
base: string;
|
|
111
|
+
};
|
|
21
112
|
};
|
|
22
|
-
},
|
|
113
|
+
}, {
|
|
114
|
+
base: string[];
|
|
115
|
+
}, undefined, unknown, unknown, undefined>>>;
|
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @property {boolean} [defaultValue] Use this variant if the element doesn't support the placeholder selector
|
|
5
|
+
*/
|
|
6
|
+
const inputBaseVariant = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
base: [
|
|
9
|
+
"w-full rounded bg-transparent px-4 body-default",
|
|
10
|
+
"text-neutral-900 placeholder-neutral-500 dark:text-neutral-200",
|
|
11
|
+
"outline-transparent transition-[border,color,outline] duration-300",
|
|
12
|
+
"border border-neutral-300 dark:border-neutral-700",
|
|
13
|
+
],
|
|
14
|
+
},
|
|
5
15
|
variants: {
|
|
6
16
|
disabled: {
|
|
7
|
-
true: "cursor-not-allowed opacity-
|
|
17
|
+
true: { base: "cursor-not-allowed opacity-40" },
|
|
8
18
|
},
|
|
9
19
|
error: {
|
|
10
|
-
true:
|
|
20
|
+
true: {
|
|
21
|
+
base: "border-current text-red-500 ring ring-current dark:border-current dark:text-red-500",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
disabled: false,
|
|
28
|
+
error: false,
|
|
29
|
+
class: {
|
|
30
|
+
base: [
|
|
31
|
+
"hover:ring-1 focus:ring-1",
|
|
32
|
+
"hover:border-blue-500 hover:ring-blue-500 focus:border-blue-500 focus:ring-blue-500",
|
|
33
|
+
"dark:hover:border-blue-400 dark:hover:ring-blue-400 dark:focus:border-blue-400 dark:focus:ring-blue-400",
|
|
34
|
+
],
|
|
35
|
+
},
|
|
11
36
|
},
|
|
37
|
+
{
|
|
38
|
+
defaultValue: true,
|
|
39
|
+
error: false,
|
|
40
|
+
class: {
|
|
41
|
+
base: "text-neutral-500 dark:text-neutral-500",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const inputVariants = tv({
|
|
48
|
+
extend: inputBaseVariant,
|
|
49
|
+
slots: {
|
|
50
|
+
base: "h-10",
|
|
12
51
|
},
|
|
13
52
|
});
|
|
14
53
|
|
|
15
|
-
export { inputVariants };
|
|
54
|
+
export { inputBaseVariant, inputVariants };
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return {
|
|
38
|
+
disabled,
|
|
38
39
|
id,
|
|
39
40
|
required,
|
|
40
41
|
};
|
|
@@ -47,9 +48,9 @@
|
|
|
47
48
|
class={radioVariants({
|
|
48
49
|
checked,
|
|
49
50
|
class: className,
|
|
50
|
-
disabled,
|
|
51
|
+
disabled: localValues.disabled,
|
|
51
52
|
})}
|
|
52
|
-
{disabled}
|
|
53
|
+
disabled={localValues.disabled}
|
|
53
54
|
id={localValues.id}
|
|
54
55
|
{name}
|
|
55
56
|
required={localValues.required}
|
|
@@ -37,22 +37,24 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return {
|
|
40
|
-
|
|
40
|
+
disabled,
|
|
41
41
|
error,
|
|
42
|
+
id,
|
|
42
43
|
required,
|
|
43
44
|
};
|
|
44
45
|
});
|
|
45
46
|
|
|
46
|
-
let styles = $derived(
|
|
47
|
+
let styles = $derived(
|
|
48
|
+
selectVariants({
|
|
49
|
+
defaultValue: value === "" || value == null,
|
|
50
|
+
error: localValues.error,
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
47
53
|
</script>
|
|
48
54
|
|
|
49
55
|
<select
|
|
50
|
-
class={styles.
|
|
51
|
-
|
|
52
|
-
disabled,
|
|
53
|
-
error: localValues.error,
|
|
54
|
-
})}
|
|
55
|
-
{disabled}
|
|
56
|
+
class={styles.base({ class: className, disabled: localValues.disabled })}
|
|
57
|
+
disabled={localValues.disabled}
|
|
56
58
|
id={localValues.id}
|
|
57
59
|
required={localValues.required}
|
|
58
60
|
bind:value
|
|
@@ -72,8 +74,7 @@
|
|
|
72
74
|
|
|
73
75
|
<style>
|
|
74
76
|
select {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
&,
|
|
77
78
|
&::picker(select) {
|
|
78
79
|
appearance: base-select;
|
|
79
80
|
}
|
|
@@ -1,58 +1,66 @@
|
|
|
1
1
|
export const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
disabled: {
|
|
3
|
-
|
|
3
|
+
false: {
|
|
4
|
+
base: string;
|
|
4
5
|
option: string;
|
|
5
|
-
select: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
true: {
|
|
8
8
|
option: string;
|
|
9
|
-
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
base: string[];
|
|
13
|
+
option: string[];
|
|
14
|
+
}, undefined, {
|
|
15
|
+
disabled: {
|
|
16
|
+
true: {
|
|
17
|
+
base: string;
|
|
10
18
|
};
|
|
11
19
|
};
|
|
12
20
|
error: {
|
|
13
21
|
true: {
|
|
14
|
-
|
|
22
|
+
base: string;
|
|
15
23
|
};
|
|
16
24
|
};
|
|
17
25
|
}, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, undefined, {
|
|
26
|
+
base: string[];
|
|
27
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
21
28
|
disabled: {
|
|
22
29
|
true: {
|
|
23
|
-
|
|
24
|
-
select: string;
|
|
30
|
+
base: string;
|
|
25
31
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
};
|
|
33
|
+
error: {
|
|
34
|
+
true: {
|
|
35
|
+
base: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
base: string[];
|
|
40
|
+
}, undefined, {
|
|
41
|
+
disabled: {
|
|
42
|
+
true: {
|
|
43
|
+
base: string;
|
|
29
44
|
};
|
|
30
45
|
};
|
|
31
46
|
error: {
|
|
32
47
|
true: {
|
|
33
|
-
|
|
48
|
+
base: string;
|
|
34
49
|
};
|
|
35
50
|
};
|
|
36
51
|
}, {
|
|
37
|
-
|
|
38
|
-
option: string[];
|
|
52
|
+
base: string[];
|
|
39
53
|
}, import("tailwind-variants").TVReturnType<{
|
|
40
54
|
disabled: {
|
|
41
55
|
true: {
|
|
42
|
-
|
|
43
|
-
select: string;
|
|
44
|
-
};
|
|
45
|
-
false: {
|
|
46
|
-
option: string;
|
|
47
|
-
select: string[];
|
|
56
|
+
base: string;
|
|
48
57
|
};
|
|
49
58
|
};
|
|
50
59
|
error: {
|
|
51
60
|
true: {
|
|
52
|
-
|
|
61
|
+
base: string;
|
|
53
62
|
};
|
|
54
63
|
};
|
|
55
64
|
}, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
65
|
+
base: string[];
|
|
66
|
+
}, undefined, unknown, unknown, undefined>>>;
|
|
@@ -1,46 +1,36 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
+
import { inputBaseVariant } from "../input/input.variants.js";
|
|
2
3
|
|
|
3
4
|
const selectVariants = tv({
|
|
5
|
+
extend: inputBaseVariant,
|
|
4
6
|
slots: {
|
|
5
|
-
|
|
6
|
-
"flex min-h-10
|
|
7
|
-
"text-neutral-900 dark:text-neutral-200",
|
|
8
|
-
"transition-[border, outline, color] outline-transparent duration-300",
|
|
9
|
-
"border border-neutral-500 bg-none",
|
|
7
|
+
base: [
|
|
8
|
+
"flex min-h-10 items-center bg-none pr-2",
|
|
10
9
|
"[&::picker(select)]:my-1 [&::picker(select)]:rounded [&::picker(select)]:border-0 [&::picker(select)]:p-1",
|
|
11
10
|
"[&::picker-icon]:hidden",
|
|
12
11
|
"[&::picker(select)]:bg-white [&::picker(select)]:shadow-sm dark:[&::picker(select)]:bg-neutral-800",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"[&:open
|
|
12
|
+
"after:bg-current after:bg-size-[100%] after:bg-center after:bg-no-repeat",
|
|
13
|
+
"after:ml-auto after:size-5 after:shrink-0",
|
|
14
|
+
"[&:open]:after:rotate-180",
|
|
16
15
|
],
|
|
17
16
|
option: [
|
|
18
17
|
"flex rounded p-2 body-small",
|
|
18
|
+
"bg-white dark:bg-neutral-800",
|
|
19
|
+
"bg-linear-to-r to-transparent",
|
|
19
20
|
"[&::checkmark]:order-1 [&::checkmark]:ml-auto [&::checkmark]:shrink-0",
|
|
20
21
|
"[&::checkmark]:bg-current [&::checkmark]:bg-size-[100%] [&::checkmark]:bg-center [&::checkmark]:bg-no-repeat",
|
|
21
22
|
"[&::checkmark]:size-4 [&::checkmark]:content-['']",
|
|
22
|
-
"bg-white text-neutral-900 dark:bg-neutral-800 dark:text-neutral-200",
|
|
23
|
-
"bg-linear-to-r to-transparent",
|
|
24
23
|
],
|
|
25
24
|
},
|
|
26
25
|
variants: {
|
|
27
26
|
disabled: {
|
|
28
|
-
true: {
|
|
29
|
-
option: "text-neutral-500 dark:text-neutral-500 [&::checkmark]:hidden",
|
|
30
|
-
select: "opacity-25",
|
|
31
|
-
},
|
|
32
27
|
false: {
|
|
28
|
+
base: "hover:text-blue-500 dark:hover:text-blue-400",
|
|
33
29
|
option:
|
|
34
|
-
"cursor-pointer hover:from-neutral-
|
|
35
|
-
select: [
|
|
36
|
-
"hover:border-current hover:ring-current focus:border-current focus:ring-current",
|
|
37
|
-
"hover:text-blue-500 hover:ring-1 focus:text-blue-500 focus:ring-1 dark:hover:text-blue-400 dark:focus:text-blue-400",
|
|
38
|
-
],
|
|
30
|
+
"cursor-pointer text-neutral-900 hover:from-black/15 dark:text-neutral-200 dark:hover:from-white/15",
|
|
39
31
|
},
|
|
40
|
-
},
|
|
41
|
-
error: {
|
|
42
32
|
true: {
|
|
43
|
-
|
|
33
|
+
option: "text-neutral-500 dark:text-neutral-500 [&::checkmark]:hidden",
|
|
44
34
|
},
|
|
45
35
|
},
|
|
46
36
|
},
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return {
|
|
38
|
+
disabled,
|
|
38
39
|
id,
|
|
39
40
|
required,
|
|
40
41
|
};
|
|
@@ -46,9 +47,9 @@
|
|
|
46
47
|
class={switchVariants({
|
|
47
48
|
checked,
|
|
48
49
|
class: className,
|
|
49
|
-
disabled,
|
|
50
|
+
disabled: localValues.disabled,
|
|
50
51
|
})}
|
|
51
|
-
{disabled}
|
|
52
|
+
disabled={localValues.disabled}
|
|
52
53
|
id={localValues.id}
|
|
53
54
|
{name}
|
|
54
55
|
required={localValues.required}
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
|
-
|
|
44
|
+
disabled,
|
|
45
45
|
error,
|
|
46
|
+
id,
|
|
46
47
|
required,
|
|
47
48
|
};
|
|
48
49
|
});
|
|
@@ -51,11 +52,11 @@
|
|
|
51
52
|
<textarea
|
|
52
53
|
class={textareaVariants({
|
|
53
54
|
class: className,
|
|
54
|
-
disabled,
|
|
55
|
+
disabled: localValues.disabled,
|
|
55
56
|
error: localValues.error,
|
|
56
57
|
size,
|
|
57
|
-
})}
|
|
58
|
-
{disabled}
|
|
58
|
+
}).base()}
|
|
59
|
+
disabled={localValues.disabled}
|
|
59
60
|
id={localValues.id}
|
|
60
61
|
{name}
|
|
61
62
|
{placeholder}
|
|
@@ -1,37 +1,61 @@
|
|
|
1
1
|
export const textareaVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
disabled: {
|
|
3
|
-
true: string;
|
|
4
|
-
};
|
|
5
|
-
error: {
|
|
6
|
-
true: string;
|
|
7
|
-
};
|
|
8
2
|
size: {
|
|
9
3
|
small: string;
|
|
10
4
|
medium: string;
|
|
11
5
|
large: string;
|
|
12
6
|
};
|
|
13
|
-
},
|
|
7
|
+
}, {
|
|
8
|
+
base: string;
|
|
9
|
+
}, undefined, {
|
|
14
10
|
disabled: {
|
|
15
|
-
true:
|
|
11
|
+
true: {
|
|
12
|
+
base: string;
|
|
13
|
+
};
|
|
16
14
|
};
|
|
17
15
|
error: {
|
|
18
|
-
true:
|
|
16
|
+
true: {
|
|
17
|
+
base: string;
|
|
18
|
+
};
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}, {
|
|
21
|
+
base: string[];
|
|
22
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
23
|
+
disabled: {
|
|
24
|
+
true: {
|
|
25
|
+
base: string;
|
|
26
|
+
};
|
|
24
27
|
};
|
|
25
|
-
|
|
28
|
+
error: {
|
|
29
|
+
true: {
|
|
30
|
+
base: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
base: string[];
|
|
35
|
+
}, undefined, {
|
|
26
36
|
disabled: {
|
|
27
|
-
true:
|
|
37
|
+
true: {
|
|
38
|
+
base: string;
|
|
39
|
+
};
|
|
28
40
|
};
|
|
29
41
|
error: {
|
|
30
|
-
true:
|
|
42
|
+
true: {
|
|
43
|
+
base: string;
|
|
44
|
+
};
|
|
31
45
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
}, {
|
|
47
|
+
base: string[];
|
|
48
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
49
|
+
disabled: {
|
|
50
|
+
true: {
|
|
51
|
+
base: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
error: {
|
|
55
|
+
true: {
|
|
56
|
+
base: string;
|
|
57
|
+
};
|
|
36
58
|
};
|
|
37
|
-
},
|
|
59
|
+
}, {
|
|
60
|
+
base: string[];
|
|
61
|
+
}, undefined, unknown, unknown, undefined>>>;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
+
import { inputBaseVariant } from "../input/input.variants.js";
|
|
2
3
|
|
|
3
4
|
const textareaVariants = tv({
|
|
4
|
-
|
|
5
|
+
extend: inputBaseVariant,
|
|
6
|
+
slots: {
|
|
7
|
+
base: "resize-none p-4",
|
|
8
|
+
},
|
|
5
9
|
variants: {
|
|
6
|
-
disabled: {
|
|
7
|
-
true: "cursor-not-allowed opacity-50",
|
|
8
|
-
},
|
|
9
|
-
error: {
|
|
10
|
-
true: "border border-red-500 text-red-500 outline outline-red-500 focus:border-red-500 focus:ring-red-500",
|
|
11
|
-
},
|
|
12
10
|
size: {
|
|
13
11
|
small: "h-30",
|
|
14
12
|
medium: "h-42",
|