@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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.11",
6
+ "version": "1.0.12",
7
7
  "main": "dist/perisai-ui.umd.js",
8
8
  "module": "dist/perisai-ui.es.js",
9
9
  "scripts": {
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
@@ -26,6 +26,10 @@ const props = defineProps({
26
26
  type: Boolean,
27
27
  default: false,
28
28
  },
29
+ customClass: {
30
+ type: [String, Array, Object],
31
+ default: '',
32
+ }
29
33
  });
30
34
 
31
35
  const $attrs = useAttrs();
package/src/ui/switch.vue CHANGED
@@ -1,33 +1,50 @@
1
- <template>
2
- <Switch>
3
- <slot />
4
- </Switch>
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
- type: Boolean,
14
- default: false,
15
- },
16
- disabled: {
17
- type: Boolean,
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
- function toggle() {
25
- if (!props.disabled) {
26
- emit('update:modelValue', !props.modelValue);
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
- <style scoped>
32
- /* All styles handled by Tailwind classes */
33
- </style>
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>