diff --git a/src/components/slider/doc/ADR.md b/src/components/slider/doc/ADR.md new file mode 100644 index 00000000..102ca2da --- /dev/null +++ b/src/components/slider/doc/ADR.md @@ -0,0 +1,103 @@ +## Figma Design Document + +The design specifications are available at: + +https://www.figma.com/design/lSvX6Qe0jc8b4CaIK7egXR/Baklava-Component-Library?node-id=16904-2220&p=f&t=ha2Q6ZmSpIAmUmUM-0 + +## Implementation + +Basic Usage + +```html + +``` +### Usage Examples + +With Label + +```html + +``` + +With Helper Text + +```html + +``` + +With Marks (Discrete Slider) + +```html + +``` + +With Tooltip + +```html + +``` + +With Custom Min/Max Values + +```html + +``` + +With Decimal Step + +```html + +``` + +With Event Handling + +```js +const handleSliderChange = (event) => { + console.log('Slider value changed:', event.detail.value); + // Update your state or perform actions with the new value +} + + +``` + +### Rules + +Some rules about how this component should behave and implemented + +* Slider has only one size and hence no size attribute has been provided +* When using both `marks` and `step` together, consider matching the step values with mark positions for consistent behavior +* The slider value is always constrained between the min and max values + +## API Reference: + +#### Attributes + +| Attribute | Description | Default Value | +|----------------------|-------------------------------------------------------------------------------------------|---------------| +| label (`string`) | Label for the slider | - | +| disabled (`boolean`) | Makes slider disabled | false | +| value (`string`) | Sets sliders value | - | +| helpText (`string`) | Sets help text for the slider | - | +| min (`string`) | Sets min value for the slider | '0' | +| max (`string`) | Sets max value for the slider | '100' | +| step (`string`) | Sets step increment for the slider | '1' | +| tooltip (`boolean`) | Shows value tooltip during slider interaction | false | +| marks (`string`) | JSON string of objects with `value` and `label` properties to display marks on the slider | - | + +#### Events + +| Event | Description | Payload | +|--------------------|--------------------------------------------------------------------------|-------------------| +| `bl-slider-change` | Will be triggered when the slider value changes through user interaction | `{value: number}` | + +#### CSS Custom Properties + +| Property | Description | Default | +|---------------------------|-----------------------------------|-------------------------------| +| `--bl-slider-color` | Color of the active track & thumb | `--bl-color-primary` | +| `--bl-slider-track-color` | Color of the inactive track | `--bl-color-neutral-lightest` |