@proj-airi/ui 0.9.0-alpha.31 → 0.9.0-alpha.33
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/package.json
CHANGED
|
@@ -19,6 +19,8 @@ const modelValue = defineModel<boolean>({ required: true })
|
|
|
19
19
|
'is-interacting',
|
|
20
20
|
'border-neutral-300 dark:border-neutral-700 data-[state=checked]:border-primary-200 data-[state=unchecked]:border-neutral-300 focus-within:border-neutral-800',
|
|
21
21
|
'data-[state=checked]:bg-primary-400 data-[state=unchecked]:bg-neutral-300 data-[state=checked]:dark:bg-primary-400/80 dark:data-[state=unchecked]:bg-neutral-800',
|
|
22
|
+
'data-[state=unchecked]:disabled:bg-neutral-400 data-[state=unchecked]:disabled:dark:bg-neutral-400/80',
|
|
23
|
+
'data-[state=checked]:disabled:bg-primary-400 data-[state=checked]:disabled:dark:bg-primary-400/80',
|
|
22
24
|
'relative h-7 w-12.5 rounded-full',
|
|
23
25
|
'shadow-sm focus-within:shadow-none',
|
|
24
26
|
props.disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer',
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Checkbox } from '../checkbox'
|
|
3
3
|
|
|
4
|
-
const props = defineProps<{
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
5
|
label?: string
|
|
6
6
|
description?: string
|
|
7
7
|
disabled?: boolean
|
|
8
|
-
|
|
8
|
+
/** Controls whether the switch is placed on the left or right side of the label. */
|
|
9
|
+
placement?: 'left' | 'right'
|
|
10
|
+
}>(), {
|
|
11
|
+
placement: 'right',
|
|
12
|
+
})
|
|
9
13
|
|
|
10
14
|
const modelValue = defineModel<boolean>({ required: true })
|
|
11
15
|
</script>
|
|
12
16
|
|
|
13
17
|
<template>
|
|
14
18
|
<label class="flex flex-col gap-4">
|
|
15
|
-
<div class="flex
|
|
19
|
+
<div :class="['flex items-center gap-2', props.placement === 'left' ? 'flex-row-reverse' : 'flex-row']">
|
|
16
20
|
<div class="flex-1">
|
|
17
21
|
<div class="flex items-center gap-1 text-sm font-medium">
|
|
18
22
|
<slot name="label">
|
|
@@ -21,13 +21,13 @@ const modelValue = defineModel<string>({ required: false })
|
|
|
21
21
|
<div
|
|
22
22
|
:class="[
|
|
23
23
|
'items-center',
|
|
24
|
-
props.layout === 'horizontal' ? 'grid grid-
|
|
24
|
+
props.layout === 'horizontal' ? 'grid grid-cols-4 gap-2' : 'grid grid-rows-2 gap-2',
|
|
25
25
|
]"
|
|
26
26
|
>
|
|
27
27
|
<div
|
|
28
28
|
:class="[
|
|
29
29
|
'w-full',
|
|
30
|
-
props.layout === 'horizontal' ? 'col-span-
|
|
30
|
+
props.layout === 'horizontal' ? 'col-span-3' : 'row-span-2',
|
|
31
31
|
]"
|
|
32
32
|
>
|
|
33
33
|
<div :class="['flex', 'items-center', 'gap-1', 'break-words', 'text-sm', 'font-medium', 'text-left']">
|