@duskmoon-dev/core 1.1.0 → 1.2.0
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/button.css +47 -46
- package/dist/components/checkbox.css +231 -0
- package/dist/components/datepicker.css +404 -10
- package/dist/components/form-group.css +308 -0
- package/dist/components/index.css +4077 -687
- package/dist/components/multi-select.css +491 -0
- package/dist/components/navigation.css +153 -2
- package/dist/components/otp-input.css +195 -0
- package/dist/components/pin-input.css +184 -0
- package/dist/components/radio.css +183 -0
- package/dist/components/segment-control.css +186 -0
- package/dist/components/select.css +205 -0
- package/dist/components/switch.css +150 -193
- package/dist/components/textarea.css +202 -0
- package/dist/components/time-input.css +252 -0
- package/dist/components/tree-select.css +439 -0
- package/dist/esm/components/button.js +47 -46
- package/dist/esm/components/checkbox.js +238 -0
- package/dist/esm/components/datepicker.js +404 -10
- package/dist/esm/components/form-group.js +315 -0
- package/dist/esm/components/multi-select.js +498 -0
- package/dist/esm/components/navigation.js +153 -2
- package/dist/esm/components/otp-input.js +202 -0
- package/dist/esm/components/pin-input.js +191 -0
- package/dist/esm/components/radio.js +190 -0
- package/dist/esm/components/segment-control.js +193 -0
- package/dist/esm/components/select.js +212 -0
- package/dist/esm/components/switch.js +150 -193
- package/dist/esm/components/textarea.js +209 -0
- package/dist/esm/components/time-input.js +259 -0
- package/dist/esm/components/tree-select.js +446 -0
- package/dist/index.css +4073 -683
- package/package.json +56 -1
|
@@ -1,278 +1,235 @@
|
|
|
1
1
|
// Auto-generated from switch.css
|
|
2
2
|
export const css = `/**
|
|
3
3
|
* Switch Component Styles
|
|
4
|
-
* DuskMoonUI - Material Design 3 inspired switch/toggle
|
|
4
|
+
* DuskMoonUI - Material Design 3 inspired switch/toggle
|
|
5
|
+
*
|
|
6
|
+
* Usage: <input type="checkbox" class="switch" />
|
|
7
|
+
* With label: <label class="switch-label"><input type="checkbox" class="switch" /><span>Label</span></label>
|
|
5
8
|
*/
|
|
6
9
|
|
|
7
10
|
@layer components {
|
|
8
|
-
/* Base Switch */
|
|
11
|
+
/* Base Switch - applied directly to input[type="checkbox"] */
|
|
9
12
|
.switch {
|
|
13
|
+
--switch-width: 3.25rem;
|
|
14
|
+
--switch-height: 2rem;
|
|
15
|
+
--switch-thumb-size: 1rem;
|
|
16
|
+
--switch-color: var(--color-primary);
|
|
17
|
+
--switch-track-color: var(--color-surface-container-highest);
|
|
18
|
+
--switch-border-color: var(--color-outline);
|
|
19
|
+
--switch-thumb-color: var(--color-outline);
|
|
20
|
+
|
|
10
21
|
position: relative;
|
|
11
|
-
display: inline-
|
|
22
|
+
display: inline-grid;
|
|
23
|
+
grid-template-columns: 0fr 1fr 1fr;
|
|
12
24
|
align-items: center;
|
|
13
|
-
|
|
25
|
+
width: var(--switch-width);
|
|
26
|
+
height: var(--switch-height);
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0.25rem;
|
|
14
29
|
cursor: pointer;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
width:
|
|
30
|
-
height:
|
|
31
|
-
background-color: var(--
|
|
32
|
-
border: 2px solid var(--color-outline);
|
|
33
|
-
border-radius: 9999px;
|
|
34
|
-
transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Switch Thumb */
|
|
38
|
-
.switch-thumb {
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 50%;
|
|
41
|
-
left: 0.25rem;
|
|
42
|
-
width: 1rem;
|
|
43
|
-
height: 1rem;
|
|
44
|
-
background-color: var(--color-outline);
|
|
30
|
+
appearance: none;
|
|
31
|
+
background-color: var(--switch-track-color);
|
|
32
|
+
border: 2px solid var(--switch-border-color);
|
|
33
|
+
border-radius: var(--switch-height);
|
|
34
|
+
/* Use !important to override global * { transition } rules from layers */
|
|
35
|
+
transition: background-color 200ms ease-in-out !important,
|
|
36
|
+
border-color 200ms ease-in-out !important,
|
|
37
|
+
grid-template-columns 200ms ease-in-out !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Thumb using ::before pseudo-element */
|
|
41
|
+
.switch::before {
|
|
42
|
+
content: "";
|
|
43
|
+
grid-column: 2;
|
|
44
|
+
width: var(--switch-thumb-size);
|
|
45
|
+
height: var(--switch-thumb-size);
|
|
46
|
+
background-color: var(--switch-thumb-color);
|
|
45
47
|
border-radius: 50%;
|
|
46
|
-
|
|
47
|
-
transition:
|
|
48
|
+
/* Use !important to override global * { transition } rules */
|
|
49
|
+
transition: background-color 200ms ease-in-out !important,
|
|
50
|
+
width 200ms ease-in-out !important,
|
|
51
|
+
margin 200ms ease-in-out !important;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
/* Checked State */
|
|
51
|
-
.switch
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
.switch:checked {
|
|
56
|
+
grid-template-columns: 1fr 1fr 0fr;
|
|
57
|
+
background-color: var(--switch-color);
|
|
58
|
+
border-color: var(--switch-color);
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
.switch
|
|
57
|
-
left: calc(100% - 1.5rem);
|
|
58
|
-
width: 1.5rem;
|
|
59
|
-
height: 1.5rem;
|
|
61
|
+
.switch:checked::before {
|
|
60
62
|
background-color: var(--color-primary-content);
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
/* Hover State */
|
|
64
|
-
.switch:hover
|
|
65
|
-
|
|
66
|
-
position: absolute;
|
|
67
|
-
top: 50%;
|
|
68
|
-
left: 0.125rem;
|
|
69
|
-
width: 2.5rem;
|
|
70
|
-
height: 2.5rem;
|
|
71
|
-
background-color: var(--color-on-surface);
|
|
72
|
-
border-radius: 50%;
|
|
73
|
-
transform: translate(-0.75rem, -50%);
|
|
74
|
-
opacity: 0.08;
|
|
75
|
-
transition: opacity 150ms ease-in-out;
|
|
65
|
+
/* Hover State (unchecked) */
|
|
66
|
+
.switch:hover:not(:disabled):not(:checked) {
|
|
67
|
+
background-color: var(--color-surface-container-high);
|
|
76
68
|
}
|
|
77
69
|
|
|
78
|
-
.switch:hover
|
|
79
|
-
|
|
80
|
-
right: 0.125rem;
|
|
81
|
-
transform: translate(0.75rem, -50%);
|
|
82
|
-
background-color: var(--color-primary);
|
|
70
|
+
.switch:hover:not(:disabled):not(:checked)::before {
|
|
71
|
+
background-color: var(--color-on-surface-variant);
|
|
83
72
|
}
|
|
84
73
|
|
|
85
|
-
/*
|
|
86
|
-
.switch
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
/* Hover State (checked) */
|
|
75
|
+
.switch:checked:hover:not(:disabled) {
|
|
76
|
+
background-color: color-mix(in oklch, var(--switch-color), black 10%);
|
|
77
|
+
border-color: color-mix(in oklch, var(--switch-color), black 10%);
|
|
89
78
|
}
|
|
90
79
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
opacity: 0.38;
|
|
94
|
-
cursor: not-allowed;
|
|
80
|
+
.switch:checked:hover:not(:disabled)::before {
|
|
81
|
+
background-color: var(--color-primary-container);
|
|
95
82
|
}
|
|
96
83
|
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
/* Focus State */
|
|
85
|
+
.switch:focus-visible {
|
|
86
|
+
outline: 2px solid var(--switch-color);
|
|
87
|
+
outline-offset: 2px;
|
|
99
88
|
}
|
|
100
89
|
|
|
101
|
-
/*
|
|
102
|
-
.switch
|
|
103
|
-
|
|
104
|
-
color: var(--color-on-surface);
|
|
90
|
+
/* Pressed/Active State - expand thumb slightly */
|
|
91
|
+
.switch:active:not(:disabled)::before {
|
|
92
|
+
width: calc(var(--switch-thumb-size) + 0.25rem);
|
|
105
93
|
}
|
|
106
94
|
|
|
107
|
-
.switch
|
|
108
|
-
|
|
95
|
+
.switch:checked:active:not(:disabled)::before {
|
|
96
|
+
margin-left: -0.25rem;
|
|
109
97
|
}
|
|
110
98
|
|
|
111
|
-
/*
|
|
112
|
-
.switch
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
/* Disabled State */
|
|
100
|
+
.switch:disabled {
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
opacity: 0.38;
|
|
115
103
|
}
|
|
116
104
|
|
|
117
|
-
.switch
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
.switch:disabled:not(:checked) {
|
|
106
|
+
background-color: color-mix(in oklch, var(--color-surface-container-highest) 12%, transparent);
|
|
107
|
+
border-color: color-mix(in oklch, var(--color-on-surface) 12%, transparent);
|
|
120
108
|
}
|
|
121
109
|
|
|
122
|
-
.switch
|
|
123
|
-
|
|
124
|
-
width: 1.125rem;
|
|
125
|
-
height: 1.125rem;
|
|
110
|
+
.switch:disabled:not(:checked)::before {
|
|
111
|
+
background-color: color-mix(in oklch, var(--color-on-surface) 38%, transparent);
|
|
126
112
|
}
|
|
127
113
|
|
|
128
|
-
.switch
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
.switch:disabled:checked {
|
|
115
|
+
background-color: color-mix(in oklch, var(--color-on-surface) 12%, transparent);
|
|
116
|
+
border-color: transparent;
|
|
131
117
|
}
|
|
132
118
|
|
|
133
|
-
.switch
|
|
134
|
-
|
|
135
|
-
height: 1.25rem;
|
|
136
|
-
left: 0.375rem;
|
|
119
|
+
.switch:disabled:checked::before {
|
|
120
|
+
background-color: var(--color-surface);
|
|
137
121
|
}
|
|
138
122
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
123
|
+
/* ========================================
|
|
124
|
+
* Size Variants
|
|
125
|
+
* Thumb size = height - 4px (border) - 8px (padding/gap)
|
|
126
|
+
* ======================================== */
|
|
144
127
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
background-color: var(--color-primary);
|
|
150
|
-
border-color: var(--color-primary);
|
|
128
|
+
.switch-xs {
|
|
129
|
+
--switch-width: 2rem;
|
|
130
|
+
--switch-height: 1.25rem;
|
|
131
|
+
--switch-thumb-size: 0.5rem;
|
|
151
132
|
}
|
|
152
133
|
|
|
153
|
-
.switch-
|
|
154
|
-
|
|
155
|
-
|
|
134
|
+
.switch-sm {
|
|
135
|
+
--switch-width: 2.5rem;
|
|
136
|
+
--switch-height: 1.5rem;
|
|
137
|
+
--switch-thumb-size: 0.75rem;
|
|
156
138
|
}
|
|
157
139
|
|
|
158
|
-
.switch-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
140
|
+
.switch-md {
|
|
141
|
+
--switch-width: 3.25rem;
|
|
142
|
+
--switch-height: 2rem;
|
|
143
|
+
--switch-thumb-size: 1rem;
|
|
162
144
|
}
|
|
163
145
|
|
|
164
|
-
.switch-
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
.switch-lg {
|
|
147
|
+
--switch-width: 4rem;
|
|
148
|
+
--switch-height: 2.5rem;
|
|
149
|
+
--switch-thumb-size: 1.25rem;
|
|
167
150
|
}
|
|
168
151
|
|
|
169
|
-
.switch-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
152
|
+
.switch-xl {
|
|
153
|
+
--switch-width: 4.75rem;
|
|
154
|
+
--switch-height: 3rem;
|
|
155
|
+
--switch-thumb-size: 1.5rem;
|
|
173
156
|
}
|
|
174
157
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
158
|
+
/* ========================================
|
|
159
|
+
* Color Variants
|
|
160
|
+
* ======================================== */
|
|
179
161
|
|
|
180
|
-
.switch-
|
|
181
|
-
|
|
182
|
-
background-color: var(--color-success);
|
|
183
|
-
border-color: var(--color-success);
|
|
162
|
+
.switch-primary {
|
|
163
|
+
--switch-color: var(--color-primary);
|
|
184
164
|
}
|
|
185
165
|
|
|
186
|
-
.switch-
|
|
187
|
-
|
|
188
|
-
background-color: var(--color-error);
|
|
189
|
-
border-color: var(--color-error);
|
|
166
|
+
.switch-secondary {
|
|
167
|
+
--switch-color: var(--color-secondary);
|
|
190
168
|
}
|
|
191
169
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
display: flex;
|
|
195
|
-
align-items: center;
|
|
196
|
-
justify-content: center;
|
|
197
|
-
font-size: 0.625rem;
|
|
170
|
+
.switch-tertiary {
|
|
171
|
+
--switch-color: var(--color-tertiary);
|
|
198
172
|
}
|
|
199
173
|
|
|
200
|
-
.switch-
|
|
201
|
-
|
|
174
|
+
.switch-success {
|
|
175
|
+
--switch-color: var(--color-success);
|
|
202
176
|
}
|
|
203
177
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
width: 4rem;
|
|
207
|
-
display: flex;
|
|
208
|
-
align-items: center;
|
|
209
|
-
justify-content: space-between;
|
|
210
|
-
padding: 0 0.5rem;
|
|
178
|
+
.switch-warning {
|
|
179
|
+
--switch-color: var(--color-warning);
|
|
211
180
|
}
|
|
212
181
|
|
|
213
|
-
.switch-
|
|
214
|
-
|
|
215
|
-
font-weight: 600;
|
|
216
|
-
color: var(--color-on-surface-variant);
|
|
217
|
-
text-transform: uppercase;
|
|
218
|
-
transition: opacity 150ms ease-in-out;
|
|
182
|
+
.switch-error {
|
|
183
|
+
--switch-color: var(--color-error);
|
|
219
184
|
}
|
|
220
185
|
|
|
221
|
-
.switch-
|
|
222
|
-
|
|
186
|
+
.switch-info {
|
|
187
|
+
--switch-color: var(--color-info);
|
|
223
188
|
}
|
|
224
189
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
190
|
+
/* ========================================
|
|
191
|
+
* Switch with Label
|
|
192
|
+
* ======================================== */
|
|
228
193
|
|
|
229
|
-
.switch-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
194
|
+
.switch-label {
|
|
195
|
+
display: inline-flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
gap: 0.75rem;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
user-select: none;
|
|
200
|
+
font-size: 0.875rem;
|
|
201
|
+
color: var(--color-on-surface);
|
|
236
202
|
}
|
|
237
203
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
position: absolute;
|
|
242
|
-
top: 50%;
|
|
243
|
-
left: 50%;
|
|
244
|
-
width: 0.75rem;
|
|
245
|
-
height: 0.75rem;
|
|
246
|
-
border: 2px solid transparent;
|
|
247
|
-
border-top-color: var(--color-on-surface);
|
|
248
|
-
border-radius: 50%;
|
|
249
|
-
transform: translate(-50%, -50%);
|
|
250
|
-
animation: switch-spin 600ms linear infinite;
|
|
204
|
+
.switch-label:has(.switch:disabled) {
|
|
205
|
+
cursor: not-allowed;
|
|
206
|
+
opacity: 0.38;
|
|
251
207
|
}
|
|
252
208
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
}
|
|
209
|
+
/* ========================================
|
|
210
|
+
* Switch Group
|
|
211
|
+
* ======================================== */
|
|
258
212
|
|
|
259
|
-
/* Group */
|
|
260
213
|
.switch-group {
|
|
261
214
|
display: flex;
|
|
262
215
|
flex-direction: column;
|
|
263
216
|
gap: 0.75rem;
|
|
264
217
|
}
|
|
265
218
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
219
|
+
.switch-group-horizontal {
|
|
220
|
+
flex-direction: row;
|
|
221
|
+
flex-wrap: wrap;
|
|
222
|
+
gap: 1.5rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* ========================================
|
|
226
|
+
* Reduce Motion
|
|
227
|
+
* ======================================== */
|
|
273
228
|
|
|
274
|
-
|
|
275
|
-
|
|
229
|
+
@media (prefers-reduced-motion: reduce) {
|
|
230
|
+
.switch,
|
|
231
|
+
.switch::before {
|
|
232
|
+
transition: none !important;
|
|
276
233
|
}
|
|
277
234
|
}
|
|
278
235
|
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// Auto-generated from textarea.css
|
|
2
|
+
export const css = `/**
|
|
3
|
+
* Textarea Component Styles
|
|
4
|
+
* DuskMoonUI - Material Design 3 inspired multi-line text input
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@layer components {
|
|
8
|
+
/* Base Textarea */
|
|
9
|
+
.textarea {
|
|
10
|
+
display: block;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-height: 6rem;
|
|
13
|
+
padding: 0.75rem 1rem;
|
|
14
|
+
font-size: 1rem;
|
|
15
|
+
line-height: 1.5rem;
|
|
16
|
+
font-family: inherit;
|
|
17
|
+
color: var(--color-on-surface);
|
|
18
|
+
background-color: var(--color-surface);
|
|
19
|
+
border: 1px solid var(--color-outline);
|
|
20
|
+
border-radius: 0.5rem;
|
|
21
|
+
outline: none;
|
|
22
|
+
resize: vertical;
|
|
23
|
+
transition: border-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.textarea::placeholder {
|
|
27
|
+
color: var(--color-on-surface-variant);
|
|
28
|
+
opacity: 0.7;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.textarea:hover:not(:disabled) {
|
|
32
|
+
border-color: var(--color-on-surface-variant);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.textarea:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.textarea:focus-visible {
|
|
40
|
+
border-color: var(--color-primary);
|
|
41
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.textarea:disabled {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
opacity: 0.5;
|
|
47
|
+
background-color: var(--color-surface-container);
|
|
48
|
+
resize: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.textarea[readonly] {
|
|
52
|
+
background-color: var(--color-surface-container);
|
|
53
|
+
cursor: default;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Filled Variant */
|
|
57
|
+
.textarea-filled {
|
|
58
|
+
background-color: var(--color-surface-container);
|
|
59
|
+
border: none;
|
|
60
|
+
border-bottom: 2px solid var(--color-outline);
|
|
61
|
+
border-radius: 0.5rem 0.5rem 0 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.textarea-filled:hover:not(:disabled) {
|
|
65
|
+
background-color: var(--color-surface-container-high);
|
|
66
|
+
border-bottom-color: var(--color-on-surface);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.textarea-filled:focus-visible {
|
|
70
|
+
border-bottom-color: var(--color-primary);
|
|
71
|
+
box-shadow: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Outlined Variant (default) */
|
|
75
|
+
.textarea-outlined {
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
border: 1px solid var(--color-outline);
|
|
78
|
+
border-radius: 0.5rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Ghost Variant */
|
|
82
|
+
.textarea-ghost {
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.textarea-ghost:hover:not(:disabled) {
|
|
88
|
+
background-color: var(--color-surface-container);
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.textarea-ghost:focus-visible {
|
|
93
|
+
background-color: var(--color-surface-container);
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
box-shadow: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Color Variants */
|
|
99
|
+
.textarea-primary:focus-visible {
|
|
100
|
+
border-color: var(--color-primary);
|
|
101
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.textarea-secondary:focus-visible {
|
|
105
|
+
border-color: var(--color-secondary);
|
|
106
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-secondary) 10%, transparent);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.textarea-tertiary:focus-visible {
|
|
110
|
+
border-color: var(--color-tertiary);
|
|
111
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-tertiary) 10%, transparent);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Semantic Colors */
|
|
115
|
+
.textarea-error {
|
|
116
|
+
border-color: var(--color-error);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.textarea-error:focus-visible {
|
|
120
|
+
border-color: var(--color-error);
|
|
121
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-error) 10%, transparent);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.textarea-success {
|
|
125
|
+
border-color: var(--color-success);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.textarea-success:focus-visible {
|
|
129
|
+
border-color: var(--color-success);
|
|
130
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 10%, transparent);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.textarea-warning {
|
|
134
|
+
border-color: var(--color-warning);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.textarea-warning:focus-visible {
|
|
138
|
+
border-color: var(--color-warning);
|
|
139
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-warning) 10%, transparent);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Size Variants */
|
|
143
|
+
.textarea-sm {
|
|
144
|
+
min-height: 4rem;
|
|
145
|
+
padding: 0.5rem 0.75rem;
|
|
146
|
+
font-size: 0.875rem;
|
|
147
|
+
line-height: 1.25rem;
|
|
148
|
+
border-radius: 0.375rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.textarea-lg {
|
|
152
|
+
min-height: 8rem;
|
|
153
|
+
padding: 1rem 1.25rem;
|
|
154
|
+
font-size: 1.125rem;
|
|
155
|
+
line-height: 1.75rem;
|
|
156
|
+
border-radius: 0.625rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Resize Options */
|
|
160
|
+
.textarea-resize-none {
|
|
161
|
+
resize: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.textarea-resize-horizontal {
|
|
165
|
+
resize: horizontal;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.textarea-resize-both {
|
|
169
|
+
resize: both;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Auto-resize (requires JS) */
|
|
173
|
+
.textarea-autosize {
|
|
174
|
+
resize: none;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Character Counter */
|
|
179
|
+
.textarea-wrapper {
|
|
180
|
+
position: relative;
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
gap: 0.25rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.textarea-counter {
|
|
187
|
+
font-size: 0.75rem;
|
|
188
|
+
line-height: 1rem;
|
|
189
|
+
color: var(--color-on-surface-variant);
|
|
190
|
+
text-align: right;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.textarea-counter-error {
|
|
194
|
+
color: var(--color-error);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Reduce Motion */
|
|
198
|
+
@media (prefers-reduced-motion: reduce) {
|
|
199
|
+
.textarea {
|
|
200
|
+
transition: none;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
205
|
+
|
|
206
|
+
const sheet = new CSSStyleSheet();
|
|
207
|
+
sheet.replaceSync(css);
|
|
208
|
+
export const styles = sheet;
|
|
209
|
+
export default sheet;
|