srcdev-nuxt-forms 2.4.17 → 2.4.19
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/assets/styles/forms/themes/_input-action-underlined.css +20 -0
- package/assets/styles/forms/themes/index.css +1 -0
- package/components/forms/form-errors/InputError.vue +21 -33
- package/components/forms/input-text/InputTextCore.vue +2 -3
- package/components/forms/input-text/variants/InputPasswordWithLabel.vue +5 -1
- package/components/forms/input-text/variants/InputTextWithLabel.vue +5 -4
- package/components/forms/input-textarea/InputTextareaCore.vue +85 -23
- package/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +161 -4
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
[data-btn-theme='input-action-underlined'] {
|
|
3
|
+
--theme-btn-bg: transparent;
|
|
4
|
+
--theme-btn-border: transparent;
|
|
5
|
+
--theme-btn-outline: transparent;
|
|
6
|
+
--theme-btn-text: var(--_input-text-core-color);
|
|
7
|
+
|
|
8
|
+
--theme-btn-bg-hover: var(--blue-8);
|
|
9
|
+
--theme-btn-border-hover: var(--blue-8);
|
|
10
|
+
--theme-btn-outline-hover: var(--blue-8);
|
|
11
|
+
--theme-btn-text-hover: var(--gray-00);
|
|
12
|
+
|
|
13
|
+
--theme-btn-bg-focus: var(--blue-8);
|
|
14
|
+
--theme-btn-border-focus: var(--blue-8);
|
|
15
|
+
--theme-btn-outline-focus: var(--blue-8);
|
|
16
|
+
--theme-btn-text-focus: var(--gray-00);
|
|
17
|
+
|
|
18
|
+
--theme-form-focus-box-shadow: transparent;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-error-message" :id :class="[elementClasses, { show: showError }, { detached: isDetached }, { hide: !showError }]" :data-Testid>
|
|
2
|
+
<div class="input-error-message" :id :class="[inputVariant, elementClasses, { show: showError }, { detached: isDetached }, { hide: !showError }]" :data-Testid>
|
|
3
3
|
<div class="inner" :class="[{ show: showError }]">
|
|
4
4
|
<div class="inner-content">
|
|
5
5
|
<div class="inner-icon">
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup lang="ts">
|
|
22
|
+
import propValidators from '../c12/prop-validators';
|
|
23
|
+
|
|
22
24
|
const props = defineProps({
|
|
23
25
|
dataTestid: {
|
|
24
26
|
type: String,
|
|
@@ -48,6 +50,13 @@ const props = defineProps({
|
|
|
48
50
|
type: Boolean,
|
|
49
51
|
required: true,
|
|
50
52
|
},
|
|
53
|
+
inputVariant: {
|
|
54
|
+
type: String as PropType<string>,
|
|
55
|
+
default: 'normal',
|
|
56
|
+
validator(value: string) {
|
|
57
|
+
return propValidators.inputVariant.includes(value);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
51
60
|
});
|
|
52
61
|
|
|
53
62
|
const isArray = computed(() => {
|
|
@@ -72,12 +81,14 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
|
|
|
72
81
|
--_gutter-inline: var(--_gutter);
|
|
73
82
|
--_transition-duration: 500ms;
|
|
74
83
|
--_transition-timing-function: linear;
|
|
75
|
-
--
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
--_padding-message: 1.2rem 1rem;
|
|
85
|
+
|
|
86
|
+
&.show {
|
|
87
|
+
--_grid-template-rows: 1fr;
|
|
88
|
+
--_opacity: var(--_opacity-show);
|
|
89
|
+
--_display: var(--_display-show);
|
|
90
|
+
--_gutter-block: var(--_gutter);
|
|
91
|
+
}
|
|
81
92
|
|
|
82
93
|
grid-row: 2;
|
|
83
94
|
grid-column: 1;
|
|
@@ -98,23 +109,10 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
|
|
|
98
109
|
margin-block-start: 2rem;
|
|
99
110
|
}
|
|
100
111
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
&.hide {
|
|
104
|
-
margin-block-start: 0;
|
|
105
|
-
}
|
|
106
|
-
&.show {
|
|
107
|
-
margin-block-start: 1.2rem;
|
|
108
|
-
}
|
|
109
|
-
} */
|
|
112
|
+
&.outlined {
|
|
113
|
+
}
|
|
110
114
|
|
|
111
|
-
&.
|
|
112
|
-
--_grid-template-rows: 1fr;
|
|
113
|
-
--_opacity: var(--_opacity-show);
|
|
114
|
-
--_display: var(--_display-show);
|
|
115
|
-
--_message-translate-y: var(--_message-translate-y-show);
|
|
116
|
-
--_gutter-block: var(--_gutter);
|
|
117
|
-
--_padding-message: var(--_padding-message-show);
|
|
115
|
+
&.underlined {
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
.inner {
|
|
@@ -123,11 +121,6 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
|
|
|
123
121
|
overflow: hidden;
|
|
124
122
|
transition: opacity var(--_transition-duration) var(--_transition-timing-function), display var(--_transition-duration) var(--_transition-timing-function) allow-discrete;
|
|
125
123
|
|
|
126
|
-
&.show {
|
|
127
|
-
display: var(--_display-show);
|
|
128
|
-
opacity: var(--_opacity-show);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
124
|
.inner-content {
|
|
132
125
|
display: flex;
|
|
133
126
|
align-items: center;
|
|
@@ -150,11 +143,6 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
|
|
|
150
143
|
font-weight: 500;
|
|
151
144
|
padding-block: var(--_padding-message);
|
|
152
145
|
padding-inline: var(--_gutter-inline);
|
|
153
|
-
transform: translateY(var(--_message-translate-y));
|
|
154
|
-
|
|
155
|
-
transition-property: transform, padding;
|
|
156
|
-
transition-duration: var(--_transition-duration);
|
|
157
|
-
transition-timing-function: linear;
|
|
158
146
|
|
|
159
147
|
.message-single {
|
|
160
148
|
color: white;
|
|
@@ -173,7 +173,6 @@ onMounted(() => {
|
|
|
173
173
|
|
|
174
174
|
&.underlined {
|
|
175
175
|
--_input-text-core-color: var(--theme-form-input-text-color-underlined);
|
|
176
|
-
/* --_input-text-wrapper-background-color: var(--theme-form-input-bg-underlined); */
|
|
177
176
|
--_input-text-wrapper-background-color: transparent;
|
|
178
177
|
--_input-text-wrapper-padding-block: 0.5rem;
|
|
179
178
|
}
|
|
@@ -324,9 +323,9 @@ input:-webkit-autofill-strong-password-viewable,
|
|
|
324
323
|
input:-webkit-autofill-and-obscured {
|
|
325
324
|
background-color: var(--theme-form-input-bg-normal) !important;
|
|
326
325
|
background-image: none !important;
|
|
327
|
-
color: var(--
|
|
326
|
+
color: var(--_input-text-core-color) !important;
|
|
328
327
|
-webkit-box-shadow: 0 0 0rem 1000px var(--theme-form-input-bg-normal) inset;
|
|
329
|
-
-webkit-text-fill-color: var(--
|
|
328
|
+
-webkit-text-fill-color: var(--_input-text-core-color);
|
|
330
329
|
transition: background-color 5000s ease-in-out 0s;
|
|
331
330
|
}
|
|
332
331
|
</style>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
@click.stop.prevent="toggleDisplayPassword"
|
|
22
22
|
:is-pending="false"
|
|
23
23
|
:buttonText
|
|
24
|
-
theme="
|
|
24
|
+
:theme="buttonTheme"
|
|
25
25
|
:size
|
|
26
26
|
@focusin="updateFocus(name, true)"
|
|
27
27
|
@focusout="updateFocus(name, false)"
|
|
@@ -102,6 +102,10 @@ const formTheme = computed(() => {
|
|
|
102
102
|
return props.fieldHasError ? 'error' : props.theme;
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
+
const buttonTheme = computed(() => {
|
|
106
|
+
return props.inputVariant === 'underlined' ? 'input-action-underlined' : 'input-action';
|
|
107
|
+
});
|
|
108
|
+
|
|
105
109
|
const modelValue = defineModel();
|
|
106
110
|
|
|
107
111
|
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
</InputTextCore>
|
|
37
37
|
|
|
38
|
-
<InputError :errorMessage
|
|
38
|
+
<InputError :errorMessage :showError="fieldHasError" :id="errorId" :isDetached="false" :inputVariant />
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
41
|
<div v-if="inputVariant !== 'normal' && hasDescriptionSlot" :id="`${id}-description`">
|
|
@@ -180,8 +180,7 @@ watch(
|
|
|
180
180
|
&.underlined {
|
|
181
181
|
--_label-text-color: var(--theme-form-input-text-label-color-underlined);
|
|
182
182
|
--_label-offset: 1rem 0;
|
|
183
|
-
|
|
184
|
-
--_input-text-with-label-background-color: rgba(255, 255, 255, 0.1);
|
|
183
|
+
--_input-text-with-label-background-color: color-mix(in srgb, currentColor 5%, transparent);
|
|
185
184
|
|
|
186
185
|
--_input-text-wrapper-underlined-border-radius-top-left: 0;
|
|
187
186
|
--_input-text-wrapper-underlined-border-radius-top-right: 0;
|
|
@@ -206,7 +205,7 @@ watch(
|
|
|
206
205
|
--_label-offset: 1rem 0;
|
|
207
206
|
--_input-text-with-label-background-color: var(--theme-form-input-bg-normal);
|
|
208
207
|
|
|
209
|
-
--_input-text-wrapper-padding-block: 0.4em;
|
|
208
|
+
--_input-text-wrapper-padding-block: 0.4em 0;
|
|
210
209
|
|
|
211
210
|
&:has(.input-text-wrapper.active),
|
|
212
211
|
&:has(.input-text-wrapper.dirty) {
|
|
@@ -241,6 +240,7 @@ watch(
|
|
|
241
240
|
|
|
242
241
|
background-color: var(--_input-text-with-label-background-color);
|
|
243
242
|
border-radius: var(--_input-text-wrapper-border-radius);
|
|
243
|
+
|
|
244
244
|
/* overflow: clip; */
|
|
245
245
|
|
|
246
246
|
&.underlined {
|
|
@@ -286,6 +286,7 @@ watch(
|
|
|
286
286
|
line-height: var(--_label-text-line-height);
|
|
287
287
|
translate: var(--_label-offset);
|
|
288
288
|
width: fit-content;
|
|
289
|
+
height: fit-content;
|
|
289
290
|
transition: font-size 0.2s ease-in-out, translate 0.2s ease-in-out;
|
|
290
291
|
|
|
291
292
|
&:not(.normal) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
class="input-textarea-wrapper"
|
|
4
4
|
:data-form-theme="formTheme"
|
|
5
5
|
:data-size="size"
|
|
6
|
-
:class="[{ dirty: isDirty }, { active: isActive }, { error: fieldHasError }, { 'has-left-slot': hasLeftSlot }, { 'has-right-slot': hasRightSlot }]"
|
|
6
|
+
:class="[inputVariant, { dirty: isDirty }, { active: isActive }, { error: fieldHasError }, { 'has-left-slot': hasLeftSlot }, { 'has-right-slot': hasRightSlot }]"
|
|
7
7
|
>
|
|
8
8
|
<span v-if="hasLeftSlot" class="slot left-slot">
|
|
9
9
|
<slot name="left"></slot>
|
|
@@ -75,6 +75,13 @@ const props = defineProps({
|
|
|
75
75
|
return propValidators.size.includes(value);
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
+
inputVariant: {
|
|
79
|
+
type: String as PropType<string>,
|
|
80
|
+
default: 'normal',
|
|
81
|
+
validator(value: string) {
|
|
82
|
+
return propValidators.inputVariant.includes(value);
|
|
83
|
+
},
|
|
84
|
+
},
|
|
78
85
|
});
|
|
79
86
|
|
|
80
87
|
const slots = useSlots();
|
|
@@ -100,36 +107,91 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
100
107
|
|
|
101
108
|
<style lang="css">
|
|
102
109
|
.input-textarea-wrapper {
|
|
103
|
-
--
|
|
104
|
-
--
|
|
105
|
-
--_outline-width: var(--form-element-border-width);
|
|
110
|
+
--_focus-box-shadow: var(--box-shadow-off);
|
|
111
|
+
--_input-textarea-core-color: var(--theme-form-input-text-color-normal);
|
|
106
112
|
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
--_input-textarea-wrapper-background-color: var(--theme-form-input-bg-normal);
|
|
114
|
+
|
|
115
|
+
--_input-textarea-wrapper-border: var(--form-element-border-width) solid var(--theme-form-input-border);
|
|
116
|
+
--_input-textarea-wrapper-border-radius: var(--form-input-border-radius);
|
|
109
117
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
--_input-textarea-wrapper-outline: var(--form-element-outline-width) solid var(--theme-form-input-outline);
|
|
119
|
+
--_input-textarea-wrapper-opacity: 1;
|
|
120
|
+
--_input-textarea-wrapper-box-shadow: var(--_focus-box-shadow);
|
|
121
|
+
--_input-textarea-wrapper-margin-inline: 0;
|
|
122
|
+
--_input-textarea-wrapper-padding-block: 0;
|
|
113
123
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
&.underlined {
|
|
125
|
+
--_input-textarea-core-color: var(--theme-form-input-text-color-underlined);
|
|
126
|
+
--_input-textarea-wrapper-background-color: transparent;
|
|
127
|
+
--_input-textarea-wrapper-padding-block: 0.5rem;
|
|
118
128
|
}
|
|
119
129
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
&.outlined {
|
|
131
|
+
--_input-textarea-wrapper-margin-inline: 1px;
|
|
132
|
+
--_input-textarea-wrapper-background-color: var(--theme-form-input-bg-outlined);
|
|
133
|
+
}
|
|
123
134
|
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
&.normal {
|
|
136
|
+
&:focus-within {
|
|
137
|
+
--_input-textarea-wrapper-box-shadow: var(--box-shadow-on);
|
|
138
|
+
--_input-textarea-wrapper-outline: var(--form-element-outline-width) solid hsl(from var(--theme-form-input-outline-focus) h s 90%);
|
|
126
139
|
}
|
|
127
140
|
}
|
|
128
141
|
|
|
142
|
+
&:not(.normal) {
|
|
143
|
+
--_input-textarea-wrapper-border: none;
|
|
144
|
+
--_input-textarea-wrapper-box-shadow: none;
|
|
145
|
+
--_input-textarea-wrapper-outline: none;
|
|
146
|
+
--_input-textarea-wrapper-opacity: 0;
|
|
147
|
+
|
|
148
|
+
&:focus {
|
|
149
|
+
--_input-textarea-wrapper-border: none;
|
|
150
|
+
--_input-textarea-wrapper-box-shadow: none;
|
|
151
|
+
--_input-textarea-wrapper-outline: none;
|
|
152
|
+
--_input-textarea-wrapper-background-color: transparent;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&:focus-within {
|
|
156
|
+
--_input-textarea-wrapper-border: none;
|
|
157
|
+
--_input-textarea-wrapper-box-shadow: none;
|
|
158
|
+
--_input-textarea-wrapper-outline: none;
|
|
159
|
+
--_input-textarea-wrapper-background-color: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.active,
|
|
163
|
+
&.dirty {
|
|
164
|
+
--_input-textarea-wrapper-border: none;
|
|
165
|
+
--_input-textarea-wrapper-box-shadow: none;
|
|
166
|
+
--_input-textarea-wrapper-outline: none;
|
|
167
|
+
--_input-textarea-wrapper-background-color: transparent;
|
|
168
|
+
|
|
169
|
+
--_input-textarea-wrapper-opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
|
|
176
|
+
background-color: var(--_input-textarea-wrapper-background-color);
|
|
177
|
+
border-radius: var(--_input-textarea-wrapper-border-radius);
|
|
178
|
+
border: var(--_input-textarea-wrapper-border);
|
|
179
|
+
outline: var(--_input-textarea-wrapper-outline);
|
|
180
|
+
box-shadow: var(--_input-textarea-wrapper-box-shadow);
|
|
181
|
+
opacity: var(--_input-textarea-wrapper-opacity);
|
|
182
|
+
|
|
183
|
+
margin-inline: var(--_input-textarea-wrapper-margin-inline);
|
|
184
|
+
padding-block: var(--_input-textarea-wrapper-padding-block);
|
|
185
|
+
|
|
186
|
+
&:not(.normal) {
|
|
187
|
+
transition: opacity 0.2s ease-in-out;
|
|
188
|
+
}
|
|
189
|
+
|
|
129
190
|
&.has-left-slot {
|
|
130
191
|
.left-slot {
|
|
131
192
|
display: flex;
|
|
132
193
|
align-items: center;
|
|
194
|
+
margin-inline-start: 1rem;
|
|
133
195
|
}
|
|
134
196
|
}
|
|
135
197
|
|
|
@@ -137,6 +199,7 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
137
199
|
.right-slot {
|
|
138
200
|
display: flex;
|
|
139
201
|
align-items: center;
|
|
202
|
+
margin-inline-end: 1rem;
|
|
140
203
|
}
|
|
141
204
|
}
|
|
142
205
|
|
|
@@ -147,7 +210,10 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
147
210
|
box-shadow: none;
|
|
148
211
|
flex-grow: 1;
|
|
149
212
|
|
|
150
|
-
|
|
213
|
+
min-height: 4lh;
|
|
214
|
+
field-sizing: content;
|
|
215
|
+
|
|
216
|
+
color: var(--_input-textarea-core-color);
|
|
151
217
|
font-family: var(--font-family);
|
|
152
218
|
font-size: var(--form-element-font-size);
|
|
153
219
|
line-height: var(--form-element-line-height);
|
|
@@ -156,10 +222,6 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
156
222
|
padding-block-start: var(--form-element-padding-block-start);
|
|
157
223
|
padding-block-end: var(--form-element-padding-block-end);
|
|
158
224
|
|
|
159
|
-
min-height: 5em;
|
|
160
|
-
|
|
161
|
-
field-sizing: content;
|
|
162
|
-
|
|
163
225
|
&::placeholder,
|
|
164
226
|
&::-webkit-input-placeholder {
|
|
165
227
|
font-family: var(--font-family);
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="input-textarea-with-label" :data-form-theme="formTheme" :class="[elementClasses, { dirty: isDirty }, { active: isActive }]">
|
|
2
|
+
<div class="input-textarea-with-label" :data-form-theme="formTheme" :class="[elementClasses, inputVariant, { dirty: isDirty }, { active: isActive }]">
|
|
3
3
|
<label :for="id" class="input-textarea-label body-normal-semibold">{{ label }}</label>
|
|
4
4
|
|
|
5
|
-
<InputTextareaCore
|
|
5
|
+
<InputTextareaCore
|
|
6
|
+
v-model="modelValue"
|
|
7
|
+
v-model:isDirty="isDirty"
|
|
8
|
+
v-model:isActive="isActive"
|
|
9
|
+
:maxlength
|
|
10
|
+
:id
|
|
11
|
+
:name
|
|
12
|
+
:placeholder
|
|
13
|
+
:label
|
|
14
|
+
:fieldHasError
|
|
15
|
+
:required
|
|
16
|
+
:styleClassPassthrough
|
|
17
|
+
:theme
|
|
18
|
+
:size
|
|
19
|
+
:inputVariant
|
|
20
|
+
>
|
|
6
21
|
<template v-if="hasLeftSlot" #left>
|
|
7
22
|
<slot name="left"></slot>
|
|
8
23
|
</template>
|
|
@@ -63,6 +78,13 @@ const props = defineProps({
|
|
|
63
78
|
return propValidators.size.includes(value);
|
|
64
79
|
},
|
|
65
80
|
},
|
|
81
|
+
inputVariant: {
|
|
82
|
+
type: String as PropType<string>,
|
|
83
|
+
default: 'normal',
|
|
84
|
+
validator(value: string) {
|
|
85
|
+
return propValidators.inputVariant.includes(value);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
66
88
|
});
|
|
67
89
|
|
|
68
90
|
const slots = useSlots();
|
|
@@ -102,9 +124,144 @@ watch(
|
|
|
102
124
|
|
|
103
125
|
<style lang="css">
|
|
104
126
|
.input-textarea-with-label {
|
|
127
|
+
--_input-textarea-with-label-margin-block-start: 0;
|
|
128
|
+
--_input-textarea-with-label-background-color: transparent;
|
|
129
|
+
|
|
130
|
+
--_input-textarea-wrapper-border: var(--form-element-border-width) solid var(--theme-form-input-border);
|
|
131
|
+
--_input-textarea-wrapper-border-radius: var(--form-input-border-radius);
|
|
132
|
+
--_input-textarea-wrapper-border-underlined: var(--form-element-border-width-underlined) solid var(--theme-form-input-border);
|
|
133
|
+
--_input-textarea-wrapper-outline: var(--form-element-outline-width) solid var(--theme-form-input-outline);
|
|
134
|
+
--_input-textarea-wrapper-box-shadow: var(--_focus-box-shadow);
|
|
135
|
+
--_input-textarea-wrapper-padding-block: 0;
|
|
136
|
+
|
|
137
|
+
--_focus-box-shadow: var(--box-shadow-off);
|
|
138
|
+
|
|
139
|
+
/* Label vars */
|
|
140
|
+
--_label-textarea-color: var(--theme-form-input-text-label-color-normal);
|
|
141
|
+
--_label-textarea-margin-block: 0.8rem;
|
|
142
|
+
--_label-textarea-size: var(--step-2);
|
|
143
|
+
--_label-textarea-weight: normal;
|
|
144
|
+
--_label-textarea-height: auto;
|
|
145
|
+
--_label-textarea-line-height: 1.5;
|
|
146
|
+
--_label-textarea-background-color: var(--_input-textarea-with-label-background-color);
|
|
147
|
+
|
|
148
|
+
&.underlined {
|
|
149
|
+
--_label-textarea-color: var(--theme-form-input-text-label-color-underlined);
|
|
150
|
+
--_label-offset: 1rem 0;
|
|
151
|
+
--_input-textarea-with-label-background-color: color-mix(in srgb, currentColor 5%, transparent);
|
|
152
|
+
|
|
153
|
+
--_input-textarea-wrapper-underlined-border-radius-top-left: 0;
|
|
154
|
+
--_input-textarea-wrapper-underlined-border-radius-top-right: 0;
|
|
155
|
+
--_input-textarea-wrapper-underlined-border-radius-bottom-left: 4px;
|
|
156
|
+
--_input-textarea-wrapper-underlined-border-radius-bottom-right: 4px;
|
|
157
|
+
|
|
158
|
+
--_label-textarea-background-color: transparent;
|
|
159
|
+
--_label-textarea-height: fit-content;
|
|
160
|
+
|
|
161
|
+
&:has(.input-textarea-wrapper.active),
|
|
162
|
+
&:has(.input-textarea-wrapper.dirty) {
|
|
163
|
+
--_label-offset: 0 -4.2rem;
|
|
164
|
+
--_label-textarea-weight: bolder;
|
|
165
|
+
--_label-textarea-size: var(--step-1);
|
|
166
|
+
/* line-height: 1.5; */
|
|
167
|
+
/* padding: 0.2rem 1.2rem; */
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&.outlined {
|
|
172
|
+
--_label-textarea-color: var(--theme-form-input-text-label-color-outlined);
|
|
173
|
+
|
|
174
|
+
--_label-offset: 1rem 0;
|
|
175
|
+
--_input-textarea-with-label-background-color: var(--theme-form-input-bg-normal);
|
|
176
|
+
|
|
177
|
+
--_input-textarea-wrapper-padding-block: 0.4em;
|
|
178
|
+
--_label-textarea-height: fit-content;
|
|
179
|
+
|
|
180
|
+
&:has(.input-textarea-wrapper.active),
|
|
181
|
+
&:has(.input-textarea-wrapper.dirty) {
|
|
182
|
+
--_label-offset: 1rem -2.8rem;
|
|
183
|
+
--_label-textarea-weight: normal;
|
|
184
|
+
/* --_label-textarea-size: var(--step-1); */
|
|
185
|
+
/* line-height: 1.5; */
|
|
186
|
+
/* padding: 0.2rem 1.2rem; */
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&:not(.normal) {
|
|
191
|
+
--_input-textarea-with-label-margin-block-start: 3em;
|
|
192
|
+
|
|
193
|
+
&:has(.input-textarea-wrapper.active),
|
|
194
|
+
&:has(.input-textarea-wrapper.dirty) {
|
|
195
|
+
/* --_label-offset: 1rem -2.8rem; */
|
|
196
|
+
/* font-size: var(--step-1); */
|
|
197
|
+
/* line-height: 1.5; */
|
|
198
|
+
/* padding: 0.2rem 1.2rem; */
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&:focus-within {
|
|
202
|
+
--_input-textarea-wrapper-box-shadow: var(--box-shadow-on);
|
|
203
|
+
--_input-textarea-wrapper-outline: var(--form-element-outline-width) solid hsl(from var(--theme-form-input-outline-focus) h s 90%);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
* Apply generic styles
|
|
209
|
+
**/
|
|
210
|
+
|
|
211
|
+
background-color: var(--_input-textarea-with-label-background-color);
|
|
212
|
+
border-radius: var(--_input-textarea-wrapper-border-radius);
|
|
213
|
+
/* overflow: clip; */
|
|
214
|
+
|
|
215
|
+
&.underlined {
|
|
216
|
+
border-bottom: var(--_input-textarea-wrapper-border-underlined);
|
|
217
|
+
border-top-left-radius: var(--_input-textarea-wrapper-underlined-border-radius-top-left);
|
|
218
|
+
border-top-right-radius: var(--_input-textarea-wrapper-underlined-border-radius-top-right);
|
|
219
|
+
border-bottom-left-radius: var(--_input-textarea-wrapper-underlined-border-radius-bottom-left);
|
|
220
|
+
border-bottom-right-radius: var(--_input-textarea-wrapper-underlined-border-radius-bottom-right);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&.outlined {
|
|
224
|
+
border: var(--_input-textarea-wrapper-border);
|
|
225
|
+
outline: var(--_input-textarea-wrapper-outline);
|
|
226
|
+
box-shadow: var(--_input-textarea-wrapper-box-shadow);
|
|
227
|
+
padding-block: var(--_input-textarea-wrapper-padding-block);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&:not(.normal) {
|
|
231
|
+
display: grid;
|
|
232
|
+
grid-template-columns: 1fr;
|
|
233
|
+
grid-template-rows: 1fr;
|
|
234
|
+
grid-template-areas: 'underlined-textarea-stack';
|
|
235
|
+
|
|
236
|
+
margin-block-start: var(--_input-textarea-with-label-margin-block-start);
|
|
237
|
+
|
|
238
|
+
.input-textarea-label {
|
|
239
|
+
grid-area: underlined-textarea-stack;
|
|
240
|
+
z-index: 2;
|
|
241
|
+
}
|
|
242
|
+
.input-textarea-wrapper {
|
|
243
|
+
grid-area: underlined-textarea-stack;
|
|
244
|
+
z-index: 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
105
248
|
.input-textarea-label {
|
|
106
|
-
display: block;
|
|
107
|
-
|
|
249
|
+
display: inline-block;
|
|
250
|
+
color: var(--_label-textarea-color);
|
|
251
|
+
background-color: var(--_label-textarea-background-color);
|
|
252
|
+
margin-block: var(--_label-textarea-margin-block);
|
|
253
|
+
font-size: var(--_label-textarea-size);
|
|
254
|
+
font-weight: var(--_label-textarea-weight);
|
|
255
|
+
line-height: var(--_label-textarea-line-height);
|
|
256
|
+
translate: var(--_label-offset);
|
|
257
|
+
width: fit-content;
|
|
258
|
+
height: var(--_label-textarea-height);
|
|
259
|
+
transition: font-size 0.2s ease-in-out, translate 0.2s ease-in-out;
|
|
260
|
+
|
|
261
|
+
&:not(.normal) {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
}
|
|
108
265
|
}
|
|
109
266
|
}
|
|
110
267
|
</style>
|
package/package.json
CHANGED