Skip to content

Commit

Permalink
chore(Slider): support vertical orientation (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankremlacek authored Oct 8, 2024
1 parent 603497e commit ff6d9d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/www/src/lib/registry/default/ui/slider/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
<template>
<SliderRoot
:class="cn(
'relative flex w-full touch-none select-none items-center',
'relative flex w-full touch-none select-none items-center data-[orientation=vertical]:flex-col data-[orientation=vertical]:w-2 data-[orientation=vertical]:h-full',
props.class,
)"
v-bind="forwarded"
>
<SliderTrack class="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
<SliderRange class="absolute h-full bg-primary" />
<SliderTrack class="relative h-2 w-full data-[orientation=vertical]:w-2 grow overflow-hidden rounded-full bg-secondary">
<SliderRange class="absolute h-full data-[orientation=vertical]:w-full bg-primary" />
</SliderTrack>
<SliderThumb
v-for="(_, key) in modelValue"
Expand Down
6 changes: 3 additions & 3 deletions apps/www/src/lib/registry/new-york/ui/slider/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
<template>
<SliderRoot
:class="cn(
'relative flex w-full touch-none select-none items-center',
'relative flex w-full touch-none select-none items-center data-[orientation=vertical]:flex-col data-[orientation=vertical]:w-1.5 data-[orientation=vertical]:h-full',
props.class,
)"
v-bind="forwarded"
>
<SliderTrack class="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20">
<SliderRange class="absolute h-full bg-primary" />
<SliderTrack class="relative h-1.5 w-full data-[orientation=vertical]:w-1.5 grow overflow-hidden rounded-full bg-primary/20">
<SliderRange class="absolute h-full data-[orientation=vertical]:w-full bg-primary" />
</SliderTrack>
<SliderThumb
v-for="(_, key) in modelValue"
Expand Down

0 comments on commit ff6d9d0

Please sign in to comment.