5
5
:required =" field.required"
6
6
/>
7
7
8
- <div class =" vsf-boolean__container " >
9
- <div class =" v-input__control vsf-boolean__control " >
8
+ <div class =" vsf-fancy-radio__container " >
9
+ <div class =" v-input__control vsf-fancy-radio__control " >
10
10
<template
11
11
v-for =" option in field ?.options "
12
12
:key =" option .value "
13
13
>
14
14
<div
15
- class =" vsf-boolean__field v-field"
15
+ class =" vsf-fancy-radio__field v-field"
16
16
:class =" {
17
17
...fieldClasses,
18
- [`vsf-boolean__field --variant-${fieldVariant}-focused`]: isFocused === option.value,
18
+ [`vsf-fancy-radio__field --variant-${fieldVariant}-focused`]: isFocused === option.value,
19
19
}"
20
20
:style =" fieldStyle"
21
21
>
22
22
<input
23
23
:id =" `vsf-radio-${field.name}-${option.value}`"
24
24
v-model =" modelValue"
25
- class =" vsf-boolean__input "
25
+ class =" vsf-fancy-radio__input "
26
26
:class =" {
27
- 'vsf-boolean__input_checked ': modelValue === option.value,
27
+ 'vsf-fancy-radio__input_checked ': modelValue === option.value,
28
28
}"
29
29
:name =" field.name"
30
30
type =" radio"
34
34
<label
35
35
:class =" {
36
36
...labelClasses,
37
- [`vsf-boolean__label --variant-${fieldVariant}-focused`]: isFocused === option.value,
37
+ [`vsf-fancy-radio__label --variant-${fieldVariant}-focused`]: isFocused === option.value,
38
38
}"
39
39
:for =" `vsf-radio-${field.name}-${option.value}`"
40
40
:style =" labelStyle"
47
47
<div
48
48
:class =" {
49
49
...fieldTextClasses,
50
- 'vsf-boolean__input_selected ': modelValue === option.value,
50
+ 'vsf-fancy-radio__input_selected ': modelValue === option.value,
51
51
'text-surface': modelValue === option.value && fieldColor === 'on-surface',
52
52
}"
53
53
v-html =" option.label"
63
63
64
64
<script lang="ts" setup>
65
65
import type {
66
- VSFBooleanProps ,
66
+ VSFFancyRadioProps ,
67
67
} from ' ./index' ;
68
68
import FieldLabel from ' @/plugin/components/shared/FieldLabel.vue' ;
69
69
70
70
71
71
const modelValue = defineModel <any >();
72
- const props = defineProps <VSFBooleanProps >();
72
+ const props = defineProps <VSFFancyRadioProps >();
73
73
74
74
const { field, settings } = toRefs (props );
75
75
76
76
77
- console .group (' VSFBoolean ' );
77
+ console .group (' VSFFancyRadio ' );
78
78
console .log (' field' , field );
79
79
console .log (' settings' , settings );
80
80
console .groupEnd ();
@@ -129,15 +129,15 @@ const labelStyle = computed<CSSProperties>(() => {
129
129
const fieldOverlayClasses = computed (() => {
130
130
return {
131
131
' v-field__overlay' : true ,
132
- ' vsf-boolean__overlay ' : true ,
132
+ ' vsf-fancy-radio__overlay ' : true ,
133
133
[` text-${fieldColor .value } ` ]: fieldColor .value ,
134
134
};
135
135
});
136
136
137
137
const fieldOutlineClasses = computed (() => {
138
138
return {
139
139
' v-field__outline' : true ,
140
- ' vsf-boolean__outline ' : true ,
140
+ ' vsf-fancy-radio__outline ' : true ,
141
141
[` text-${fieldColor .value } ` ]: fieldColor .value ,
142
142
};
143
143
});
@@ -146,25 +146,25 @@ const fieldTextClasses = computed(() => {
146
146
const oppositeColorVariation = fieldColor .value === ' on-surface' ? ' surface' : fieldColor .value ;
147
147
148
148
return {
149
- ' vsf-boolean__text ' : true ,
149
+ ' vsf-fancy-radio__text ' : true ,
150
150
[` text-${oppositeColorVariation } ` ]: fieldColor .value === ' on-surface' ,
151
151
};
152
152
});
153
153
154
154
const fieldClasses = computed (() => {
155
155
return {
156
156
[` v-field--variant-${fieldVariant .value } ` ]: true ,
157
- [` vsf-boolean__field --variant-${fieldVariant .value } ` ]: true ,
157
+ [` vsf-fancy-radio__field --variant-${fieldVariant .value } ` ]: true ,
158
158
};
159
159
});
160
160
161
161
const labelClasses = computed (() => {
162
162
return {
163
163
' pa-1' : field .value ?.density === ' compact' ,
164
164
' pa-4' : field .value ?.density !== ' compact' ,
165
- ' vsf-boolean__label ' : true ,
166
- [` vsf-boolean__label --variant-${fieldVariant .value } ` ]: true ,
167
- // [`vsf-boolean__label -variant-${variant}_${isFocused.value}`]: true,
165
+ ' vsf-fancy-radio__label ' : true ,
166
+ [` vsf-fancy-radio__label --variant-${fieldVariant .value } ` ]: true ,
167
+ // [`vsf-fancy-radio__label -variant-${variant}_${isFocused.value}`]: true,
168
168
};
169
169
});
170
170
@@ -185,7 +185,7 @@ function onFocus(value: any) {
185
185
</style >
186
186
187
187
<style lang="scss" scoped>
188
- .vsf-boolean {
188
+ .vsf-fancy-radio {
189
189
& __container {
190
190
align-items : center ;
191
191
display : flex ;
@@ -219,7 +219,7 @@ function onFocus(value: any) {
219
219
--vsf-field-border-opacity : calc ((0.04 + var (--v-focus-opacity )) * var (--v-theme-overlay-multiplier )) !important ;
220
220
}
221
221
222
- .vsf-boolean__overlay {
222
+ .vsf-fancy-radio__overlay {
223
223
opacity : var (--vsf-field-border-opacity );
224
224
transition : opacity 250ms cubic-bezier (0.4 , 0 , 0.2 , 1 );
225
225
}
@@ -244,7 +244,7 @@ function onFocus(value: any) {
244
244
width : 100% ;
245
245
}
246
246
247
- .vsf-boolean__overlay {
247
+ .vsf-fancy-radio__overlay {
248
248
background-color : rgb (var (--v-theme-surface ));
249
249
}
250
250
@@ -254,7 +254,7 @@ function onFocus(value: any) {
254
254
255
255
& _checked {
256
256
+ label {
257
- .vsf-boolean__overlay {
257
+ .vsf-fancy-radio__overlay {
258
258
background-color : currentcolor ;
259
259
opacity : 1 ;
260
260
}
@@ -275,7 +275,7 @@ function onFocus(value: any) {
275
275
276
276
// ? ------------------------- Underline scaling for variants //
277
277
@mixin underline-scale () {
278
- .vsf-boolean__outline {
278
+ .vsf-fancy-radio__outline {
279
279
& ::before {
280
280
border-width : 0 0 var (--v-field-border-width );
281
281
}
@@ -287,7 +287,7 @@ function onFocus(value: any) {
287
287
}
288
288
289
289
& -focused {
290
- .vsf-boolean__outline {
290
+ .vsf-fancy-radio__outline {
291
291
& ::after {
292
292
transform : scaleX (1 );
293
293
}
@@ -311,12 +311,12 @@ function onFocus(value: any) {
311
311
& :hover {
312
312
--v-field-border-width : 2px ;
313
313
314
- .vsf-boolean__overlay {
314
+ .vsf-fancy-radio__overlay {
315
315
opacity : 1 !important ;
316
316
}
317
317
}
318
318
319
- .vsf-boolean__overlay {
319
+ .vsf-fancy-radio__overlay {
320
320
border-radius : var (--vsf-field-border-radius ) !important ;
321
321
border-style : solid ;
322
322
border-width : var (--v-field-border-width );
0 commit comments