(), {
- modelValue: undefined,
- trueValue: true,
- falseValue: false,
+ modelValue: false,
disabled: false,
- inputId: undefined,
label: '',
description: '',
helperText: ''
@@ -50,59 +41,63 @@
() => (attrs['data-testid'] as string | undefined) ?? 'input-field-switch'
)
- const resolvedInputId = computed(() => props.inputId ?? generatedId)
-
const model = computed({
get: () => props.modelValue,
- set: (next) => emit('update:modelValue', next ?? props.falseValue)
+ set: (next) => emit('update:modelValue', next ?? false)
})
const sharedClasses =
'flex cursor-pointer items-start gap-[var(--spacing-sm)] data-[disabled]:cursor-not-allowed'
- const textsClasses =
- 'flex min-w-0 flex-1 flex-col gap-[var(--spacing-xxs)] data-[disabled]:opacity-50'
+ const contentClasses = 'flex min-w-0 flex-1 flex-col gap-[var(--spacing-xs)]'
+
+ const textsClasses = 'flex flex-col gap-[var(--spacing-xxs)] data-[disabled]:opacity-50'
const helperClasses =
- 'inline-flex items-center gap-[var(--spacing-xxs)] rounded-[var(--shape-button)] border border-[var(--border-default)] bg-[var(--bg-surface)] px-[var(--spacing-xs)] py-[var(--spacing-xxs)] text-body-xs text-[var(--text-muted)] w-fit'
+ 'inline-flex w-fit items-center gap-[var(--spacing-xxs)] rounded-[var(--shape-elements)] border border-[var(--border-default)] bg-[var(--bg-surface)] px-[var(--spacing-xs)] py-[var(--spacing-xxs)] text-body-xs text-[var(--text-muted)]'
const rootClasses = computed(() => cn(sharedClasses, attrs.class))