2026-02-08 14:18:17 +03:00
|
|
|
<script module>
|
|
|
|
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
|
|
|
import Slider from './Slider.svelte';
|
|
|
|
|
|
|
|
|
|
const { Story } = defineMeta({
|
|
|
|
|
title: 'Shared/Slider',
|
|
|
|
|
component: Slider,
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
parameters: {
|
|
|
|
|
docs: {
|
|
|
|
|
description: {
|
|
|
|
|
component: 'Styled bits-ui slider component for selecting a value within a range.',
|
|
|
|
|
},
|
|
|
|
|
story: { inline: false }, // Render stories in iframe for state isolation
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
argTypes: {
|
|
|
|
|
value: {
|
|
|
|
|
control: 'number',
|
|
|
|
|
description: 'Current value (two-way bindable)',
|
|
|
|
|
},
|
|
|
|
|
min: {
|
|
|
|
|
control: 'number',
|
|
|
|
|
description: 'Minimum value',
|
|
|
|
|
},
|
|
|
|
|
max: {
|
|
|
|
|
control: 'number',
|
|
|
|
|
description: 'Maximum value',
|
|
|
|
|
},
|
|
|
|
|
step: {
|
|
|
|
|
control: 'number',
|
|
|
|
|
description: 'Step size for value increments',
|
|
|
|
|
},
|
2026-02-19 13:58:12 +03:00
|
|
|
label: {
|
|
|
|
|
control: 'text',
|
|
|
|
|
description: 'Optional label displayed inline on the track',
|
|
|
|
|
},
|
2026-02-08 14:18:17 +03:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
let value = $state(50);
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-02-19 13:58:12 +03:00
|
|
|
<Story name="Horizontal" args={{ orientation: 'horizontal', min: 0, max: 100, step: 1, value }}>
|
|
|
|
|
<Slider bind:value />
|
|
|
|
|
</Story>
|
|
|
|
|
|
|
|
|
|
<Story name="Vertical" args={{ orientation: 'vertical', min: 0, max: 100, step: 1, value }}>
|
|
|
|
|
<Slider bind:value />
|
2026-02-08 14:18:17 +03:00
|
|
|
</Story>
|
|
|
|
|
|
2026-02-19 13:58:12 +03:00
|
|
|
<Story name="With Label" args={{ orientation: 'horizontal', min: 0, max: 100, step: 1, value, label: 'SIZE' }}>
|
|
|
|
|
<Slider bind:value />
|
2026-02-08 14:18:17 +03:00
|
|
|
</Story>
|