srcdev-nuxt-forms 2.4.3 → 2.4.5
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/components/forms/input-range/InputRangeCore.vue +55 -6
- package/components/utils/colour-scheme-select/ColourSchemeSelect.vue +201 -0
- package/components/utils/colour-scheme-select/ColourSchemeSelectOld.vue +225 -0
- package/components/utils/dark-mode-switcher/DarkModeSwitcher.vue +2 -2
- package/composables/useZodValidation.ts +1 -2
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div class="input-range-container">
|
|
8
|
+
<slot v-if="hasMarkers" name="markers"></slot>
|
|
9
|
+
|
|
8
10
|
<input
|
|
9
11
|
type="range"
|
|
10
12
|
:id
|
|
@@ -14,14 +16,12 @@
|
|
|
14
16
|
:max
|
|
15
17
|
:step
|
|
16
18
|
:list="hasDataList ? name + '-datalist' : ''"
|
|
17
|
-
:class="['input-range-core', `input-range--${size}`, `input-range--${weight}`, styleClassPassthrough]"
|
|
19
|
+
:class="['input-range-core', `input-range--${size}`, `input-range--${weight}`, styleClassPassthrough, { 'has-markers': hasMarkers }]"
|
|
18
20
|
v-model="modelValue"
|
|
19
21
|
ref="inputRange"
|
|
20
22
|
/>
|
|
21
23
|
|
|
22
|
-
<
|
|
23
|
-
<slot name="datalist"></slot>
|
|
24
|
-
</template>
|
|
24
|
+
<slot v-if="hasDataList" name="datalist"></slot>
|
|
25
25
|
</div>
|
|
26
26
|
<div v-if="hasRightContent" class="slot right">
|
|
27
27
|
<slot name="right"></slot>
|
|
@@ -87,13 +87,14 @@ const props = defineProps({
|
|
|
87
87
|
default: false,
|
|
88
88
|
},
|
|
89
89
|
styleClassPassthrough: {
|
|
90
|
-
type:
|
|
91
|
-
default:
|
|
90
|
+
type: Array as PropType<string[]>,
|
|
91
|
+
default: () => [],
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
const slots = useSlots();
|
|
96
96
|
const hasDataList = computed(() => slots.datalist !== undefined);
|
|
97
|
+
const hasMarkers = computed(() => slots.markers !== undefined);
|
|
97
98
|
const hasLeftContent = computed(() => slots.left !== undefined);
|
|
98
99
|
const hasRightContent = computed(() => slots.right !== undefined);
|
|
99
100
|
|
|
@@ -134,7 +135,40 @@ const changeBackgroundColor = () => {
|
|
|
134
135
|
|
|
135
136
|
.input-range-container {
|
|
136
137
|
flex-grow: 1;
|
|
138
|
+
|
|
139
|
+
display: grid;
|
|
140
|
+
grid-template-areas: 'element-stack';
|
|
141
|
+
|
|
142
|
+
.input-range-markers {
|
|
143
|
+
grid-area: element-stack;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: space-between;
|
|
147
|
+
width: 100%;
|
|
148
|
+
z-index: 2;
|
|
149
|
+
|
|
150
|
+
.marker {
|
|
151
|
+
background-color: black;
|
|
152
|
+
padding: 0.5rem;
|
|
153
|
+
border-radius: 50%;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
outline: 1px solid gray;
|
|
156
|
+
|
|
157
|
+
&:hover {
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.marker-icon {
|
|
162
|
+
font-size: 2rem;
|
|
163
|
+
display: block;
|
|
164
|
+
color: var(--theme-form-range-accent-color);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
137
169
|
.input-range-core {
|
|
170
|
+
grid-area: element-stack;
|
|
171
|
+
|
|
138
172
|
accent-color: var(--theme-form-range-accent-color);
|
|
139
173
|
height: var(--_input-range-height);
|
|
140
174
|
margin: 0;
|
|
@@ -205,6 +239,21 @@ const changeBackgroundColor = () => {
|
|
|
205
239
|
&:focus-visible {
|
|
206
240
|
box-shadow: var(--form-focus-box-shadow);
|
|
207
241
|
}
|
|
242
|
+
|
|
243
|
+
&.has-markers {
|
|
244
|
+
accent-color: var(--theme-form-range-accent-color);
|
|
245
|
+
height: 2px;
|
|
246
|
+
z-index: 2;
|
|
247
|
+
translate: 0 13px;
|
|
248
|
+
|
|
249
|
+
&::-webkit-slider-thumb {
|
|
250
|
+
/* display: none; */
|
|
251
|
+
opacity: 0;
|
|
252
|
+
&:hover {
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
208
257
|
}
|
|
209
258
|
|
|
210
259
|
.input-range-datalist {
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="colour-scheme-select" :data-size="size" :data-form-theme="theme">
|
|
3
|
+
<p>Color Scheme select</p>
|
|
4
|
+
|
|
5
|
+
<form class="colour-scheme-select-form mbe-20">
|
|
6
|
+
<div class="select-scheme-marker-wrapper">
|
|
7
|
+
<div class="select-scheme-marker"></div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="select-scheme-group-wrapper">
|
|
10
|
+
<div class="select-scheme-group">
|
|
11
|
+
<LazyIcon name="material-symbols:night-sight-auto-sharp" class="scheme-icon" />
|
|
12
|
+
<input type="radio" id="auto" name="colour-scheme" class="scheme-input" v-model="colourScheme" value="auto" />
|
|
13
|
+
<label for="auto" class="sr-only">Auto</label>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="select-scheme-group">
|
|
16
|
+
<LazyIcon name="radix-icons:sun" class="scheme-icon" />
|
|
17
|
+
<input type="radio" id="light" name="colour-scheme" class="scheme-input" v-model="colourScheme" value="light" />
|
|
18
|
+
<label for="light" class="sr-only">Light</label>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="select-scheme-group">
|
|
21
|
+
<LazyIcon name="radix-icons:moon" class="scheme-icon" />
|
|
22
|
+
<input type="radio" id="dark" name="colour-scheme" class="scheme-input" v-model="colourScheme" value="dark" />
|
|
23
|
+
<label for="dark" class="sr-only">Dark</label>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</form>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import propValidators from '../../forms/c12/prop-validators';
|
|
32
|
+
|
|
33
|
+
defineProps({
|
|
34
|
+
name: {
|
|
35
|
+
type: String,
|
|
36
|
+
defaul: 'colour-scheme-select',
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
type: String as PropType<string>,
|
|
40
|
+
default: 'medium',
|
|
41
|
+
validator(value: string) {
|
|
42
|
+
return propValidators.size.includes(value);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
theme: {
|
|
46
|
+
type: String as PropType<string>,
|
|
47
|
+
default: 'primary',
|
|
48
|
+
validator(value: string) {
|
|
49
|
+
return propValidators.theme.includes(value);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
styleClassPassthrough: {
|
|
53
|
+
type: Array as PropType<string[]>,
|
|
54
|
+
default: () => [],
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const colourScheme = ref<'auto' | 'dark' | 'light'>('auto');
|
|
59
|
+
|
|
60
|
+
useColourScheme(colourScheme);
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="css">
|
|
64
|
+
.colour-scheme-select {
|
|
65
|
+
--_form-background-color: var(--theme-form-checkbox-bg);
|
|
66
|
+
--_form-border-width: 0.1rem;
|
|
67
|
+
--_form-border-colour: var(--theme-form-radio-border);
|
|
68
|
+
--_form-outline-width: 0.1rem;
|
|
69
|
+
|
|
70
|
+
--_form-outline-colour: var(--theme-form-radio-outline);
|
|
71
|
+
|
|
72
|
+
--_form-border-radius: calc(
|
|
73
|
+
(var(--_scheme-icon-font-size) / 2) + var(--_form-border-width) + var(--_form-outline-width) + var(--_form-padding) + var(--_select-scheme-group-padding) + var(--_select-scheme-group-border-width) +
|
|
74
|
+
var(--_select-scheme-group-outline-width)
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
--_form-items-gap: 1rem;
|
|
78
|
+
--_form-padding: 0.6rem;
|
|
79
|
+
|
|
80
|
+
--_select-scheme-marker-position: 1;
|
|
81
|
+
|
|
82
|
+
--_select-scheme-group-background-color: red;
|
|
83
|
+
--_select-scheme-group-padding: 0.5rem;
|
|
84
|
+
--_select-scheme-group-border-width: 0.1rem;
|
|
85
|
+
--_select-scheme-group-border-colour: var(--theme-form-radio-border);
|
|
86
|
+
--_select-scheme-group-outline-width: 0.1rem;
|
|
87
|
+
--_select-scheme-group-outline-colour: var(--theme-form-radio-outline);
|
|
88
|
+
--_select-scheme-group-width: calc(
|
|
89
|
+
var(--_scheme-icon-font-size) + (var(--_select-scheme-group-padding) * 2) + (var(--_select-scheme-group-border-width) * 2) + (var(--_select-scheme-group-outline-width) * 2)
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
--_scheme-icon-font-size: 2rem;
|
|
93
|
+
--_scheme-icon-colour: white;
|
|
94
|
+
|
|
95
|
+
.colour-scheme-select-form {
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-template-areas: 'select-stack';
|
|
98
|
+
width: fit-content;
|
|
99
|
+
|
|
100
|
+
background-color: var(--_form-background-color);
|
|
101
|
+
border: var(--_form-border-width) solid var(--_form-border-colour);
|
|
102
|
+
outline: var(--_form-outline-width) solid var(--_form-outline-colour);
|
|
103
|
+
border-radius: var(--_form-border-radius);
|
|
104
|
+
padding: var(--_form-padding);
|
|
105
|
+
|
|
106
|
+
.select-scheme-marker-wrapper {
|
|
107
|
+
grid-area: select-stack;
|
|
108
|
+
display: grid;
|
|
109
|
+
/* grid-template-columns: repeat(3, 1fr); */
|
|
110
|
+
grid-template-columns: repeat(3, 1fr);
|
|
111
|
+
z-index: 1;
|
|
112
|
+
grid-area: select-stack;
|
|
113
|
+
gap: var(--_form-items-gap);
|
|
114
|
+
transition: all 200ms;
|
|
115
|
+
transition-behavior: allow-discrete;
|
|
116
|
+
|
|
117
|
+
display: none;
|
|
118
|
+
|
|
119
|
+
.select-scheme-marker {
|
|
120
|
+
grid-column: var(--_select-scheme-marker-position);
|
|
121
|
+
aspect-ratio: 1;
|
|
122
|
+
/* width: calc(var(--_select-scheme-group-width) + (var(--_form-outline-width) * 2)); */
|
|
123
|
+
/* translate: -1px 0; */
|
|
124
|
+
width: var(--_select-scheme-group-width);
|
|
125
|
+
transition: all 200ms;
|
|
126
|
+
transition-behavior: allow-discrete;
|
|
127
|
+
background-color: purple;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.select-scheme-group-wrapper {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-area: select-stack;
|
|
134
|
+
grid-template-columns: repeat(3, 1fr);
|
|
135
|
+
align-items: center;
|
|
136
|
+
width: fit-content;
|
|
137
|
+
z-index: 2;
|
|
138
|
+
gap: var(--_form-items-gap);
|
|
139
|
+
|
|
140
|
+
.select-scheme-group {
|
|
141
|
+
aspect-ratio: 1;
|
|
142
|
+
display: grid;
|
|
143
|
+
grid-template-areas: 'icon-stack';
|
|
144
|
+
width: var(--_select-scheme-group-width);
|
|
145
|
+
place-content: center;
|
|
146
|
+
background-color: var(--_select-scheme-group-background-color);
|
|
147
|
+
border: var(--_select-scheme-group-border-width) solid var(--_select-scheme-group-border-colour);
|
|
148
|
+
outline: var(--_select-scheme-group-outline-width) solid var(--_select-scheme-group-outline-colour);
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
padding: var(--_select-scheme-group-padding);
|
|
151
|
+
|
|
152
|
+
.scheme-icon {
|
|
153
|
+
grid-area: icon-stack;
|
|
154
|
+
display: block;
|
|
155
|
+
color: var(--_scheme-icon-colour);
|
|
156
|
+
font-size: var(--_scheme-icon-font-size);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.scheme-input {
|
|
160
|
+
grid-area: icon-stack;
|
|
161
|
+
opacity: 0;
|
|
162
|
+
|
|
163
|
+
&:hover {
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:has(input[value='auto']) {
|
|
169
|
+
--_select-scheme-group-background-color: green;
|
|
170
|
+
|
|
171
|
+
&:has(input[value='auto']:checked) {
|
|
172
|
+
--_select-scheme-marker-position: 1;
|
|
173
|
+
--_select-scheme-group-border-colour: var(--theme-form-radio-border);
|
|
174
|
+
--_select-scheme-group-outline-colour: var(--theme-form-radio-outline);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:has(input[value='light']) {
|
|
179
|
+
--_select-scheme-group-background-color: orange;
|
|
180
|
+
|
|
181
|
+
&:has(input[value='light']:checked) {
|
|
182
|
+
--_select-scheme-marker-position: 2;
|
|
183
|
+
--_select-scheme-group-border-colour: var(--theme-form-radio-border);
|
|
184
|
+
--_select-scheme-group-outline-colour: var(--theme-form-radio-outline);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&:has(input[value='dark']) {
|
|
189
|
+
--_select-scheme-group-background-color: black;
|
|
190
|
+
|
|
191
|
+
&:has(input[value='dark']:checked) {
|
|
192
|
+
--_select-scheme-marker-position: 3;
|
|
193
|
+
--_select-scheme-group-border-colour: var(--theme-form-radio-border);
|
|
194
|
+
--_select-scheme-group-outline-colour: var(--theme-form-radio-outline);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</style>
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="colour-scheme-select" :data-size="size" :data-form-theme="theme">
|
|
3
|
+
<p>Color Scheme select</p>
|
|
4
|
+
|
|
5
|
+
<form class="colour-scheme-select-form mbe-20">
|
|
6
|
+
<div class="input-range-markers">
|
|
7
|
+
<div class="marker">
|
|
8
|
+
<LazyIcon name="material-symbols:night-sight-auto-sharp" class="marker-icon" />
|
|
9
|
+
</div>
|
|
10
|
+
<div class="marker">
|
|
11
|
+
<LazyIcon name="radix-icons:sun" class="marker-icon" />
|
|
12
|
+
</div>
|
|
13
|
+
<div class="marker" v>
|
|
14
|
+
<LazyIcon name="radix-icons:moon" class="marker-icon" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="scheme-marker-wrapper">
|
|
19
|
+
<div class="scheme-marker-indicator"></div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="form-elements">
|
|
23
|
+
<div class="form-input">
|
|
24
|
+
<input type="radio" id="auto" name="colour-scheme" v-model="colourScheme" value="auto" />
|
|
25
|
+
<label for="auto" class="sr-only">Auto</label>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-input">
|
|
28
|
+
<input type="radio" id="light" name="colour-scheme" v-model="colourScheme" value="light" />
|
|
29
|
+
<label for="light" class="sr-only">Light</label>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="form-input">
|
|
32
|
+
<input type="radio" id="dark" name="colour-scheme" v-model="colourScheme" value="dark" />
|
|
33
|
+
<label for="dark" class="sr-only">Dark</label>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</form>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import propValidators from '../../forms/c12/prop-validators';
|
|
42
|
+
|
|
43
|
+
defineProps({
|
|
44
|
+
name: {
|
|
45
|
+
type: String,
|
|
46
|
+
defaul: useId(),
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: String as PropType<string>,
|
|
50
|
+
default: 'medium',
|
|
51
|
+
validator(value: string) {
|
|
52
|
+
return propValidators.size.includes(value);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
theme: {
|
|
56
|
+
type: String as PropType<string>,
|
|
57
|
+
default: 'primary',
|
|
58
|
+
validator(value: string) {
|
|
59
|
+
return propValidators.theme.includes(value);
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
styleClassPassthrough: {
|
|
63
|
+
type: Array as PropType<string[]>,
|
|
64
|
+
default: () => [],
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const colourScheme = ref<'auto' | 'dark' | 'light'>('auto');
|
|
69
|
+
|
|
70
|
+
useColourScheme(colourScheme);
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style lang="css">
|
|
74
|
+
.colour-scheme-select {
|
|
75
|
+
--_outline-width: 0.1rem;
|
|
76
|
+
--_border-width: 0.1rem;
|
|
77
|
+
--_border-radius: 50%;
|
|
78
|
+
--_background-color: var(--theme-form-checkbox-bg);
|
|
79
|
+
--_box-shadow: none;
|
|
80
|
+
|
|
81
|
+
--_icon-size: var(--form-input-checkbox-radio-button-size);
|
|
82
|
+
|
|
83
|
+
--_background-color: var(--theme-form-radio-bg);
|
|
84
|
+
--_border-color: var(--theme-form-radio-border);
|
|
85
|
+
--_border-radius: 50%;
|
|
86
|
+
--_outline-color: var(--theme-form-radio-outline);
|
|
87
|
+
|
|
88
|
+
--_form-padding: 0.5rem;
|
|
89
|
+
--_form-input-outline-width: 0.2rem;
|
|
90
|
+
|
|
91
|
+
--_scheme-marker-position: start;
|
|
92
|
+
|
|
93
|
+
.colour-scheme-select-form {
|
|
94
|
+
display: grid;
|
|
95
|
+
grid-template-areas: 'element-stack';
|
|
96
|
+
align-items: center;
|
|
97
|
+
|
|
98
|
+
background-color: var(--theme-form-radio-bg);
|
|
99
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
100
|
+
|
|
101
|
+
border-radius: calc((var(--_icon-size) / 2) + var(--_form-padding) + var(--_border-width) + var(--_outline-width) + var(--_form-input-outline-width));
|
|
102
|
+
|
|
103
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
104
|
+
box-shadow: var(--_box-shadow);
|
|
105
|
+
|
|
106
|
+
/* height: calc(var(--_icon-size) + 4px); */
|
|
107
|
+
width: calc((var(--_icon-size) * 3) + (var(--_form-padding) * 17));
|
|
108
|
+
|
|
109
|
+
transition: all 0.2s ease-in-out;
|
|
110
|
+
|
|
111
|
+
.input-range-markers {
|
|
112
|
+
grid-area: element-stack;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
width: 100%;
|
|
117
|
+
padding: var(--_form-padding);
|
|
118
|
+
|
|
119
|
+
.marker {
|
|
120
|
+
background-color: black;
|
|
121
|
+
padding: var(--_form-padding);
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
/* outline: 1px solid gray; */
|
|
125
|
+
|
|
126
|
+
&:hover {
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.marker-icon {
|
|
131
|
+
/* font-size: 2rem; */
|
|
132
|
+
display: block;
|
|
133
|
+
color: white;
|
|
134
|
+
height: var(--_icon-size);
|
|
135
|
+
width: var(--_icon-size);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.scheme-marker-wrapper {
|
|
141
|
+
grid-area: element-stack;
|
|
142
|
+
display: grid;
|
|
143
|
+
gap: 1rem;
|
|
144
|
+
|
|
145
|
+
grid-template-columns: repeat(3, 1fr);
|
|
146
|
+
/* transition: grid-template-columns 0.2s; */
|
|
147
|
+
/* text-align: var(--_scheme-marker-position); */
|
|
148
|
+
padding: var(--_form-padding);
|
|
149
|
+
/* z-index: 9; */
|
|
150
|
+
|
|
151
|
+
.scheme-marker-indicator {
|
|
152
|
+
grid-column: 3;
|
|
153
|
+
aspect-ratio: 1;
|
|
154
|
+
background-color: var(--theme-form-radio-bg);
|
|
155
|
+
background-color: red;
|
|
156
|
+
border-radius: 50%;
|
|
157
|
+
height: calc(var(--_icon-size) + var(--_form-padding));
|
|
158
|
+
/* width: calc(var(--_icon-size) + var(--_form-padding)); */
|
|
159
|
+
padding: var(--_form-padding);
|
|
160
|
+
transition: grid-columns 0.2s;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.form-elements {
|
|
165
|
+
grid-area: element-stack;
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: space-between;
|
|
169
|
+
gap: 1rem;
|
|
170
|
+
padding: var(--_form-padding);
|
|
171
|
+
|
|
172
|
+
.form-input {
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
display: flex;
|
|
175
|
+
place-content: center;
|
|
176
|
+
padding: var(--_form-padding);
|
|
177
|
+
outline: var(--_form-input-outline-width) solid gray;
|
|
178
|
+
opacity: 0.75;
|
|
179
|
+
|
|
180
|
+
&:has(input[value='auto']) {
|
|
181
|
+
background-color: green;
|
|
182
|
+
|
|
183
|
+
&:has(input[value='auto']:checked) {
|
|
184
|
+
--_scheme-marker-position: start;
|
|
185
|
+
outline: var(--_form-input-outline-width) solid var(--_border-color);
|
|
186
|
+
opacity: 1;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&:has(input[value='light']) {
|
|
191
|
+
background-color: orange;
|
|
192
|
+
|
|
193
|
+
&:has(input[value='light']:checked) {
|
|
194
|
+
--_scheme-marker-position: center;
|
|
195
|
+
outline: var(--_form-input-outline-width) solid var(--_border-color);
|
|
196
|
+
opacity: 1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&:has(input[value='dark']) {
|
|
201
|
+
background-color: black;
|
|
202
|
+
|
|
203
|
+
&:has(input[value='dark']:checked) {
|
|
204
|
+
--_scheme-marker-position: end;
|
|
205
|
+
outline: var(--_form-input-outline-width) solid var(--_border-color);
|
|
206
|
+
opacity: 1;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
input[type='radio'] {
|
|
211
|
+
opacity: 0;
|
|
212
|
+
height: var(--_icon-size);
|
|
213
|
+
width: var(--_icon-size);
|
|
214
|
+
margin: 0;
|
|
215
|
+
padding: 0;
|
|
216
|
+
|
|
217
|
+
&:hover {
|
|
218
|
+
cursor: pointer;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ToggleSwitchWithLabelInline v-model="displayMode" :name :label labelWeight="normal" :size trueValue="dark" falseValue="light" :style-class-passthrough>
|
|
3
3
|
<template #iconOn>
|
|
4
|
-
<
|
|
4
|
+
<LazyIcon name="radix-icons:moon" class="icon" />
|
|
5
5
|
</template>
|
|
6
6
|
<template #iconOff>
|
|
7
|
-
<
|
|
7
|
+
<LazyIcon name="radix-icons:sun" class="icon" />
|
|
8
8
|
</template>
|
|
9
9
|
</ToggleSwitchWithLabelInline>
|
|
10
10
|
</template>
|
|
@@ -104,9 +104,8 @@ const useZodValidation = (formSchema: any, formRef: Ref<HTMLFormElement | null>)
|
|
|
104
104
|
const fieldMaxLength = (name: string) => {
|
|
105
105
|
const fieldSchema = formSchema.shape[name];
|
|
106
106
|
if (fieldSchema instanceof z.ZodString) {
|
|
107
|
-
return fieldSchema._def.checks.find((check) => check.kind === 'max')?.value
|
|
107
|
+
return fieldSchema._def.checks.find((check) => check.kind === 'max')?.value;
|
|
108
108
|
}
|
|
109
|
-
return null;
|
|
110
109
|
};
|
|
111
110
|
|
|
112
111
|
const scrollToFirstError = async () => {
|
package/package.json
CHANGED