@bl33dz/fa814698dcde12f86a37ac31dd3aedf9 1.0.11 → 1.0.12
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/dist/perisai-ui.es.js +1220 -1146
- package/dist/perisai-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/ui/slider.vue +4 -0
- package/src/ui/switch.vue +45 -28
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { default as SelectContent } from './ui/SelectContent.vue';
|
|
|
20
20
|
export { default as SelectSeparator } from './ui/SelectSeparator.vue';
|
|
21
21
|
export { default as SelectTrigger } from './ui/SelectTrigger.vue';
|
|
22
22
|
export { default as SelectValue } from './ui/SelectValue.vue';
|
|
23
|
+
export { default as SelectItem } from './ui/SelectItem.vue';
|
|
23
24
|
export { default as SheetContent } from './ui/SheetContent.vue';
|
|
24
25
|
export { default as SheetDescription } from './ui/SheetDescription.vue';
|
|
25
26
|
export { default as SheetHeader } from './ui/SheetHeader.vue';
|
package/src/ui/slider.vue
CHANGED
package/src/ui/switch.vue
CHANGED
|
@@ -1,33 +1,50 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup>
|
|
8
|
-
import { defineProps, defineEmits, useAttrs } from 'vue';
|
|
9
|
-
import { cn } from './utils';
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { SwitchRoot, SwitchThumb } from 'reka-ui'
|
|
3
|
+
import { defineProps, defineEmits, useAttrs, computed } from 'vue'
|
|
4
|
+
import { cn } from './utils'
|
|
10
5
|
|
|
11
6
|
const props = defineProps({
|
|
12
|
-
modelValue:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: false,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
const emit = defineEmits(['update:modelValue']);
|
|
22
|
-
const $attrs = useAttrs();
|
|
7
|
+
modelValue: Boolean,
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
class: String,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits(['update:modelValue'])
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
14
|
+
const attrs = useAttrs()
|
|
15
|
+
|
|
16
|
+
const rootAttrs = computed(() => {
|
|
17
|
+
const { checked, modelValue, disabled, ...rest } = attrs
|
|
18
|
+
return rest
|
|
19
|
+
})
|
|
29
20
|
</script>
|
|
30
21
|
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
<template>
|
|
23
|
+
<SwitchRoot
|
|
24
|
+
v-bind="rootAttrs"
|
|
25
|
+
:checked="modelValue"
|
|
26
|
+
:disabled="disabled"
|
|
27
|
+
@update:checked="v => emit('update:modelValue', v)"
|
|
28
|
+
:class="cn(
|
|
29
|
+
'relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors',
|
|
30
|
+
'bg-muted data-[state=checked]:bg-primary',
|
|
31
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
|
|
32
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
33
|
+
props.class
|
|
34
|
+
)"
|
|
35
|
+
>
|
|
36
|
+
<SwitchThumb
|
|
37
|
+
class="
|
|
38
|
+
pointer-events-none
|
|
39
|
+
block
|
|
40
|
+
h-5 w-5
|
|
41
|
+
rounded-full
|
|
42
|
+
bg-background
|
|
43
|
+
shadow-lg
|
|
44
|
+
transition-transform
|
|
45
|
+
translate-x-1
|
|
46
|
+
data-[state=checked]:translate-x-5
|
|
47
|
+
"
|
|
48
|
+
/>
|
|
49
|
+
</SwitchRoot>
|
|
50
|
+
</template>
|