Skip to content

Commit

Permalink
chore: update slider styles to accomodate vertical sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Dec 15, 2024
1 parent e011b41 commit 9d6bf2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/comps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2270,13 +2270,13 @@ export default [
fileName: "Slider/Range.vue",
dirPath: "app/components/Ui",
fileContent:
'<template>\n <SliderRange :class="styles({ class: props.class })" v-bind="forwarded">\n <slot />\n </SliderRange>\n</template>\n\n<script lang="ts" setup>\n import { SliderRange } from "radix-vue";\n import type { SliderRangeProps } from "radix-vue";\n\n const props = defineProps<\n SliderRangeProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >();\n const forwarded = reactiveOmit(props, "class");\n const styles = tv({\n base: "absolute h-full bg-primary",\n });\n</script>\n',
'<template>\n <SliderRange :class="styles({ class: props.class })" v-bind="forwarded">\n <slot />\n </SliderRange>\n</template>\n\n<script lang="ts" setup>\n import { SliderRange } from "radix-vue";\n import type { SliderRangeProps } from "radix-vue";\n\n const props = defineProps<\n SliderRangeProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >();\n const forwarded = reactiveOmit(props, "class");\n const styles = tv({\n base: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",\n });\n</script>\n',
},
{
fileName: "Slider/Slider.vue",
dirPath: "app/components/Ui",
fileContent:
'<template>\n <SliderRoot v-bind="forwarded" :class="styles({ class: props.class })">\n <slot :props="props">\n <slot name="track" :props="props">\n <UiSliderTrack>\n <slot name="range" :props="props">\n <UiSliderRange />\n </slot>\n </UiSliderTrack>\n </slot>\n <slot name="thumb" :props="props">\n <UiSliderThumb v-for="(t, i) in modelValue.length" :key="i" />\n </slot>\n </slot>\n </SliderRoot>\n</template>\n\n<script lang="ts" setup>\n import { SliderRoot, useForwardPropsEmits } from "radix-vue";\n import type { SliderRootEmits, SliderRootProps } from "radix-vue";\n\n const props = withDefaults(\n defineProps<\n SliderRootProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >(),\n {\n orientation: "horizontal",\n min: 0,\n step: 1,\n max: 100,\n modelValue: () => [0],\n }\n );\n\n const emits = defineEmits<SliderRootEmits>();\n const forwarded = useForwardPropsEmits(reactiveOmit(props, "class"), emits);\n\n const styles = tv({\n base: "relative flex w-full touch-none select-none items-center",\n });\n</script>\n',
'<template>\n <SliderRoot v-bind="forwarded" :class="styles({ class: props.class })">\n <slot :props="props">\n <slot name="track" :props="props">\n <UiSliderTrack>\n <slot name="range" :props="props">\n <UiSliderRange />\n </slot>\n </UiSliderTrack>\n </slot>\n <slot name="thumb" :props="props">\n <UiSliderThumb v-for="(t, i) in modelValue.length" :key="i" />\n </slot>\n </slot>\n </SliderRoot>\n</template>\n\n<script lang="ts" setup>\n import { SliderRoot, useForwardPropsEmits } from "radix-vue";\n import type { SliderRootEmits, SliderRootProps } from "radix-vue";\n\n const props = withDefaults(\n defineProps<\n SliderRootProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >(),\n {\n orientation: "horizontal",\n min: 0,\n step: 1,\n max: 100,\n modelValue: () => [0],\n }\n );\n\n const emits = defineEmits<SliderRootEmits>();\n const forwarded = useForwardPropsEmits(reactiveOmit(props, "class"), emits);\n\n const styles = tv({\n base: "relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",\n });\n</script>\n',
},
{
fileName: "Slider/Thumb.vue",
Expand All @@ -2288,7 +2288,7 @@ export default [
fileName: "Slider/Track.vue",
dirPath: "app/components/Ui",
fileContent:
'<template>\n <SliderTrack :class="styles({ class: props.class })" v-bind="forwarded">\n <slot />\n </SliderTrack>\n</template>\n\n<script lang="ts" setup>\n import { SliderTrack } from "radix-vue";\n import type { SliderTrackProps } from "radix-vue";\n\n const props = defineProps<\n SliderTrackProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >();\n const forwarded = reactiveOmit(props, "class");\n const styles = tv({\n base: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",\n });\n</script>\n',
'<template>\n <SliderTrack :class="styles({ class: props.class })" v-bind="forwarded">\n <slot />\n </SliderTrack>\n</template>\n\n<script lang="ts" setup>\n import { SliderTrack } from "radix-vue";\n import type { SliderTrackProps } from "radix-vue";\n\n const props = defineProps<\n SliderTrackProps & {\n /** Custom class(es) to add to parent element */\n class?: any;\n }\n >();\n const forwarded = reactiveOmit(props, "class");\n const styles = tv({\n base: "relative grow overflow-hidden rounded-full bg-secondary data-[orientation=horizontal]:h-2 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-2",\n });\n</script>\n',
},
],
utils: [],
Expand Down

0 comments on commit 9d6bf2d

Please sign in to comment.