@bloomreach/react-banana-ui 1.35.1 → 1.37.0

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.
Files changed (46) hide show
  1. package/README.md +8 -0
  2. package/dist/bloomreach-react-banana-ui.es.js +10831 -9009
  3. package/dist/bloomreach-react-banana-ui.es.js.map +1 -1
  4. package/dist/bloomreach-react-banana-ui.umd.js +19 -19
  5. package/dist/bloomreach-react-banana-ui.umd.js.map +1 -1
  6. package/dist/components/date/date-time-range-picker/date-time-range-picker.stories.d.ts +2 -0
  7. package/dist/components/date/date-time-range-picker/date-time-range-picker.types.d.ts +30 -0
  8. package/dist/components/inputs/field-label/field-label.types.d.ts +2 -2
  9. package/dist/components/inputs/index.d.ts +1 -0
  10. package/dist/components/inputs/internal.d.ts +1 -0
  11. package/dist/components/inputs/slider/index.d.ts +4 -0
  12. package/dist/components/inputs/slider/internal/components/index.d.ts +4 -0
  13. package/dist/components/inputs/slider/internal/components/slider-mark-list.d.ts +20 -0
  14. package/dist/components/inputs/slider/internal/components/slider-number-input.d.ts +32 -0
  15. package/dist/components/inputs/slider/internal/components/slider-thumb.d.ts +31 -0
  16. package/dist/components/inputs/slider/internal/components/slider-tickmarks.d.ts +13 -0
  17. package/dist/components/inputs/slider/internal/hooks/index.d.ts +5 -0
  18. package/dist/components/inputs/slider/internal/hooks/use-slider-base.d.ts +18 -0
  19. package/dist/components/inputs/slider/internal/hooks/use-slider-hidden-input-props.d.ts +47 -0
  20. package/dist/components/inputs/slider/internal/hooks/use-slider-marks.d.ts +14 -0
  21. package/dist/components/inputs/slider/internal/hooks/use-slider-pointer-interaction.d.ts +47 -0
  22. package/dist/components/inputs/slider/internal/hooks/use-slider.d.ts +17 -0
  23. package/dist/components/inputs/slider/internal/index.d.ts +4 -0
  24. package/dist/components/inputs/slider/internal/types/index.d.ts +2 -0
  25. package/dist/components/inputs/slider/internal/types/slider.internal-types.d.ts +97 -0
  26. package/dist/components/inputs/slider/internal/utils/index.d.ts +2 -0
  27. package/dist/components/inputs/slider/internal/utils/slider.helpers.d.ts +227 -0
  28. package/dist/components/inputs/slider/internal/utils/slider.utils.d.ts +190 -0
  29. package/dist/components/inputs/slider/slider/index.d.ts +2 -0
  30. package/dist/components/inputs/slider/slider/slider.d.ts +17 -0
  31. package/dist/components/inputs/slider/slider/slider.qa.stories.d.ts +27 -0
  32. package/dist/components/inputs/slider/slider/slider.stories.d.ts +33 -0
  33. package/dist/components/inputs/slider/slider/slider.types.d.ts +229 -0
  34. package/dist/components/inputs/slider/slider-field/index.d.ts +2 -0
  35. package/dist/components/inputs/slider/slider-field/slider-field.d.ts +27 -0
  36. package/dist/components/inputs/slider/slider-field/slider-field.qa.stories.d.ts +18 -0
  37. package/dist/components/inputs/slider/slider-field/slider-field.stories.d.ts +15 -0
  38. package/dist/components/inputs/slider/slider-field/slider-field.types.d.ts +24 -0
  39. package/dist/react-banana-ui.css +1 -1
  40. package/dist/utils/dom.d.ts +7 -0
  41. package/dist/utils/hooks/index.d.ts +2 -0
  42. package/dist/utils/hooks/use-event-callback.d.ts +6 -0
  43. package/dist/utils/hooks/use-fork-refs.d.ts +7 -0
  44. package/dist/utils/index.d.ts +1 -0
  45. package/dist/utils/types/styles.types.d.ts +1 -1
  46. package/package.json +48 -45
@@ -0,0 +1,227 @@
1
+ import { Mark, SliderProps, SliderValue } from '../../slider/slider.types';
2
+ import type * as React from 'react';
3
+ /**
4
+ * Number of pointer-move events that must fire before a drag is considered intentional.
5
+ * Prevents accidental drags from triggering the dragging visual state on click.
6
+ */
7
+ export declare const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
8
+ /**
9
+ * CSS property mappings for each slider axis orientation.
10
+ * Each axis defines how to position an element (`offset`) and size the track (`leap`)
11
+ * using the appropriate CSS properties for that direction.
12
+ */
13
+ export declare const AXIS_PROPS: {
14
+ readonly horizontal: {
15
+ readonly leap: (percent: number) => {
16
+ width: string;
17
+ };
18
+ readonly offset: (percent: number) => {
19
+ left: string;
20
+ };
21
+ };
22
+ readonly 'horizontal-reverse': {
23
+ readonly leap: (percent: number) => {
24
+ width: string;
25
+ };
26
+ readonly offset: (percent: number) => {
27
+ right: string;
28
+ };
29
+ };
30
+ readonly vertical: {
31
+ readonly leap: (percent: number) => {
32
+ height: string;
33
+ };
34
+ readonly offset: (percent: number) => {
35
+ bottom: string;
36
+ };
37
+ };
38
+ };
39
+ /** Identity function used as the default `scale` transform. */
40
+ export declare const identity: (value: number) => number;
41
+ /**
42
+ * Clamps a value between a minimum and maximum bound.
43
+ *
44
+ * @param value - The value to clamp.
45
+ * @param min - Lower bound (defaults to `Number.MIN_SAFE_INTEGER`).
46
+ * @param max - Upper bound (defaults to `Number.MAX_SAFE_INTEGER`).
47
+ * @returns The clamped value.
48
+ */
49
+ export declare const clamp: (value: number, min?: number, max?: number) => number;
50
+ /** Comparator for sorting numbers in ascending order. */
51
+ export declare const asc: (a: number, b: number) => number;
52
+ /**
53
+ * Finds the index of the value closest to `currentValue` in a sorted array.
54
+ * When two values are equidistant, the later index wins (useful for range sliders
55
+ * so that the higher thumb is preferred when clicking exactly between two thumbs).
56
+ *
57
+ * @param values - Array of numeric values to search.
58
+ * @param currentValue - The target value to find the closest match for.
59
+ * @returns The index of the closest value.
60
+ */
61
+ export declare const findClosest: (values: number[], currentValue: number) => number;
62
+ /**
63
+ * Normalizes the `step` prop to a safe runtime value.
64
+ *
65
+ * - `step={null}` is only valid when an explicit non-empty `marks` array is provided.
66
+ * - Non-positive or non-finite values fall back to `1`.
67
+ */
68
+ export declare const normalizeStep: (step: null | number, marks: boolean | ReadonlyArray<Mark>) => null | number;
69
+ /**
70
+ * Normalizes `shiftStep` to a positive finite number.
71
+ */
72
+ export declare const normalizeShiftStep: (shiftStep: number) => number;
73
+ /**
74
+ * Normalizes `minDistance` to a non-negative finite number.
75
+ */
76
+ export declare const normalizeMinDistance: (minDistance: number) => number;
77
+ /**
78
+ * Normalizes `snapToMarks` to a safe runtime value.
79
+ */
80
+ export declare const normalizeSnapToMarks: (snapToMarks: SliderProps["snapToMarks"]) => SliderProps["snapToMarks"];
81
+ /**
82
+ * Resolves track variants that are not supported for the current slider shape.
83
+ * Center-origin track rendering only works for single-thumb sliders.
84
+ */
85
+ export declare const resolveTrackMode: (track: SliderProps["track"], range: boolean) => SliderProps["track"];
86
+ /**
87
+ * Extracts the (x, y) coordinates of a pointer from a mouse or touch event.
88
+ * For touch events, it matches the finger by `touchId` to support multi-touch correctly.
89
+ *
90
+ * @param event - The mouse or touch event.
91
+ * @param touchId - Ref holding the tracked touch identifier.
92
+ * @returns The finger coordinates, or `false` if the tracked touch was not found.
93
+ */
94
+ export declare const trackFinger: (event: MouseEvent | React.MouseEvent | TouchEvent, touchId: React.RefObject<number | undefined>) => false | {
95
+ x: number;
96
+ y: number;
97
+ };
98
+ /**
99
+ * Converts a percentage (0–1) back to an absolute value within the slider range.
100
+ *
101
+ * @param percent - A value between 0 and 1 representing position on the track.
102
+ * @param min - The slider minimum.
103
+ * @param max - The slider maximum.
104
+ * @returns The corresponding absolute value.
105
+ */
106
+ export declare const percentToValue: (percent: number, min: number, max: number) => number;
107
+ /**
108
+ * Determines the number of decimal digits needed to represent a number without
109
+ * floating-point rounding artifacts. Handles small numbers expressed in
110
+ * scientific notation (e.g. `0.001` → `1e-3` → 3 decimal places).
111
+ *
112
+ * @param num - The number to inspect.
113
+ * @returns The decimal precision (number of digits after the decimal point).
114
+ */
115
+ export declare const getDecimalPrecision: (num: number) => number;
116
+ /**
117
+ * Rounds a value to the nearest step increment relative to `min`.
118
+ * Uses `getDecimalPrecision` to avoid floating-point rounding errors
119
+ * (e.g. `0.1 + 0.2 !== 0.3`).
120
+ *
121
+ * @param value - The raw value to round.
122
+ * @param step - The step increment.
123
+ * @param min - The slider minimum (the step grid origin).
124
+ * @returns The value snapped to the nearest step.
125
+ */
126
+ export declare const roundValueToStep: (value: number, step: number, min: number) => number;
127
+ /**
128
+ * Returns a new sorted array with the value at `index` replaced by `newValue`.
129
+ * Used to update one thumb in a range slider while keeping the array sorted.
130
+ *
131
+ * @param values - The current thumb values.
132
+ * @param newValue - The new value for the thumb at `index`.
133
+ * @param index - The thumb index to update.
134
+ * @returns A new sorted array of thumb values.
135
+ */
136
+ export declare const setValueIndex: (values: number[], newValue: number, index: number) => number[];
137
+ /**
138
+ * Normalizes initial range values so they satisfy `minDistance` on first render.
139
+ * When the requested minimum gap cannot fit inside the slider range, the values
140
+ * are spread evenly across the available range.
141
+ */
142
+ export declare const normalizeInitialRangeValues: (values: number[], { max, min, minDistance, }: {
143
+ max?: number;
144
+ min?: number;
145
+ minDistance?: number;
146
+ }) => number[];
147
+ /**
148
+ * Normalizes the initial slider value so the component never mounts in an
149
+ * invalid state. Marks-only sliders snap to the nearest mark, range values are
150
+ * coerced to exactly two thumbs, and initial range values are adjusted to
151
+ * satisfy `minDistance`.
152
+ */
153
+ export declare const normalizeSliderValue: (value: SliderValue | undefined, { marks, max, min, minDistance, step, }: {
154
+ marks: Mark[];
155
+ max?: number;
156
+ min?: number;
157
+ minDistance?: number;
158
+ step?: null | number;
159
+ }) => SliderValue | undefined;
160
+ /**
161
+ * Logs a console warning in development if `min >= max`, which would produce
162
+ * a broken slider with zero or negative range.
163
+ */
164
+ export declare const validateSliderRange: (min: number, max: number) => void;
165
+ export declare const constrainRangeValue: (values: number[], newValue: number, index: number, { disableSwap, max, min, minDistance, }: {
166
+ disableSwap?: boolean;
167
+ max?: number;
168
+ min?: number;
169
+ minDistance?: number;
170
+ }) => {
171
+ activeIndex: number;
172
+ value: number[];
173
+ };
174
+ /**
175
+ * Produces a new slider value with one thumb updated. For single-value sliders
176
+ * it simply returns the new number; for range sliders it returns a new array.
177
+ *
178
+ * @param currentValue - The current slider value (number or number[]).
179
+ * @param thumbIndex - Index of the thumb to update.
180
+ * @param nextValue - The new value for the thumb.
181
+ * @returns The updated slider value.
182
+ */
183
+ export declare const updateThumbValue: (currentValue: SliderValue, thumbIndex: number, nextValue: number) => SliderValue;
184
+ export declare const focusThumb: ({ activeIndex, setActive, sliderRef, }: {
185
+ activeIndex: number;
186
+ setActive?: (index: number) => void;
187
+ sliderRef: React.RefObject<HTMLSpanElement | null>;
188
+ }) => void;
189
+ /**
190
+ * Shallow-compares two arrays element by element.
191
+ *
192
+ * @param array1 - First array.
193
+ * @param array2 - Second array.
194
+ * @param itemComparer - Optional comparator (defaults to strict equality).
195
+ * @returns `true` if both arrays have the same length and all elements match.
196
+ */
197
+ export declare const areArraysEqual: <Item>(array1: ReadonlyArray<Item>, array2: ReadonlyArray<Item>, itemComparer?: (a: Item, b: Item) => boolean) => boolean;
198
+ /**
199
+ * Compares two slider values for equality. Handles both single-value (number)
200
+ * and range (number[]) slider variants.
201
+ *
202
+ * @param newValue - The new slider value.
203
+ * @param oldValue - The previous slider value.
204
+ * @returns `true` if the values are semantically equal.
205
+ */
206
+ export declare const areValuesEqual: (newValue: number | number[], oldValue: number | ReadonlyArray<number>) => boolean;
207
+ /**
208
+ * Creates a cloned native Event with a synthetic `target` containing the slider's
209
+ * `name` and current `value`. This mimics the behavior of native `<input>` change
210
+ * events so that form libraries (e.g. Formik, React Hook Form) can read the value
211
+ * from `event.target.value`.
212
+ *
213
+ * @param event - The original browser or React event that triggered the change.
214
+ * @param value - The new slider value.
215
+ * @param name - The slider's `name` attribute.
216
+ * @returns A cloned Event with `target.value` and `target.name` set.
217
+ */
218
+ export declare const createChangeEvent: (event: Event | React.SyntheticEvent, value: number | number[], name?: string) => Event;
219
+ /**
220
+ * Detects whether the browser supports `touch-action: none`.
221
+ * The result is cached after the first call for performance.
222
+ *
223
+ * When supported, touch events can use `passive: true` listeners because
224
+ * `touch-action: none` on the element already prevents scrolling.
225
+ * When not supported, touch handlers must call `preventDefault()` manually.
226
+ */
227
+ export declare const doesSupportTouchActionNone: () => boolean;
@@ -0,0 +1,190 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { Mark, SliderProps, SliderValue } from '../../slider/slider.types';
3
+ import { Axis } from '../types';
4
+ /** Soft cap for decorative tickmarks to avoid rendering excessive DOM. */
5
+ export declare const MAX_DECORATIVE_TICKMARK_COUNT = 100;
6
+ /** A mark augmented with a stagger `level` for label collision avoidance. */
7
+ export interface MarkLevel {
8
+ label?: ReactNode;
9
+ /** The stagger row (0 = default row, 1+ = offset rows below). */
10
+ level: number;
11
+ value: number;
12
+ }
13
+ /** Metadata for a single tickmark dot rendered on the slider rail. */
14
+ export interface TickmarkMeta {
15
+ /** Whether this tick aligns with a user-defined mark (rendered larger). */
16
+ isMajor: boolean;
17
+ /** Position of the tick as a percentage (0–100) along the track. */
18
+ percent: number;
19
+ }
20
+ /** Computed CSS-ready metrics for the active track segment. */
21
+ export interface TrackMetrics {
22
+ /** Length of the active track as a percentage of the full range. */
23
+ leap: number;
24
+ /** Start position of the active track as a percentage of the full range. */
25
+ offset: number;
26
+ }
27
+ /** Default value label formatter — returns the numeric value as-is. */
28
+ export declare const defaultValueLabelFormat: (x: number) => number;
29
+ /**
30
+ * Resolves the public `marks` prop into a concrete array of mark objects.
31
+ *
32
+ * - `marks={true}` generates marks from `min` to `max` using `step`.
33
+ * - custom mark arrays are normalized into a stable ascending range order.
34
+ * - when the generated step grid does not land exactly on `max`, the endpoint
35
+ * is appended so the full range remains visibly represented.
36
+ */
37
+ export declare const buildMarks: (marksProp: boolean | ReadonlyArray<Mark>, min: number, max: number, step: null | number) => Mark[];
38
+ /**
39
+ * Converts an absolute slider value to a percentage (0–100) within the [min, max] range.
40
+ *
41
+ * @param value - The absolute value.
42
+ * @param min - The slider minimum.
43
+ * @param max - The slider maximum.
44
+ * @returns The percentage position, or 0 if range is zero/negative.
45
+ */
46
+ export declare const toPercent: (value: number, min: number, max: number) => number;
47
+ /**
48
+ * Computes staggered label levels to avoid overlapping mark labels.
49
+ * Returns marks augmented with a `level` property (0, 1, or 2).
50
+ */
51
+ export declare const computeMarkLevels: <MarkEntry extends {
52
+ label?: ReactNode;
53
+ value: number;
54
+ }>(marksList: MarkEntry[], min: number, max: number) => Array<MarkEntry & {
55
+ level: number;
56
+ }>;
57
+ /**
58
+ * Snaps a value to the nearest mark if within the threshold.
59
+ */
60
+ /**
61
+ * Snaps a single value to the nearest mark if the distance is within `threshold`.
62
+ * If no mark is close enough the original value is returned unchanged.
63
+ *
64
+ * @param rawValue - The raw (unsnapped) slider value.
65
+ * @param marksArr - The array of available marks.
66
+ * @param threshold - Maximum distance (in slider units) for a snap to occur.
67
+ * @returns The snapped value, or `rawValue` if no mark is close enough.
68
+ */
69
+ export declare const snapToNearestMark: (rawValue: number, marksArr: Mark[], threshold: number) => number;
70
+ /**
71
+ * Applies snap-to-mark behavior to a slider value. Works with both single values
72
+ * and arrays (range sliders), snapping each value independently.
73
+ *
74
+ * @param value - The current slider value (number or number[]).
75
+ * @param marksArr - The available marks.
76
+ * @param threshold - Snap distance threshold in slider units.
77
+ * @returns The snapped slider value.
78
+ */
79
+ export declare const applySnapToValue: (value: SliderValue, marksArr: Mark[], threshold: number) => SliderValue;
80
+ export declare const resolveKeyboardSnapValue: ({ currentValue, marks, max, min, nextValue, snapThreshold, }: {
81
+ currentValue: number;
82
+ marks: Mark[];
83
+ max: number;
84
+ min: number;
85
+ nextValue: number;
86
+ snapThreshold: number;
87
+ }) => number;
88
+ /**
89
+ * Calculates the snap threshold in absolute slider units from the percentage-based
90
+ * `snapToMarks` prop. When `snapToMarks` is `true`, uses the default 2%.
91
+ * When it's a number, uses that as the percentage.
92
+ *
93
+ * @param snapEnabled - Whether snapping is active.
94
+ * @param snapToMarks - The `snapToMarks` prop value (`true` or a custom percentage).
95
+ * @param min - Slider minimum.
96
+ * @param max - Slider maximum.
97
+ * @returns The snap threshold in slider units (0 when snapping is disabled).
98
+ */
99
+ export declare const getSnapThreshold: (snapEnabled: boolean, snapToMarks: SliderProps["snapToMarks"], min: number, max: number) => number;
100
+ export declare const normalizeVisibleInputValue: ({ marks, max, min, snapThreshold, snapToMarks, step, value, }: {
101
+ marks: Mark[];
102
+ max: number;
103
+ min: number;
104
+ snapThreshold?: number;
105
+ snapToMarks?: boolean;
106
+ step: null | number;
107
+ value: number;
108
+ }) => number;
109
+ /**
110
+ * Computes the CSS offset and length of the colored track segment.
111
+ * Supports all track modes: `normal`, `inverted`, `center`, and `false`.
112
+ *
113
+ * - **normal**: track runs from `min` (or the lower thumb) to the value.
114
+ * - **inverted**: the track colors the *remaining* portion instead.
115
+ * - **center**: track runs from the midpoint of the range to the current value.
116
+ * - **false**: no track rendered (returns zeros).
117
+ *
118
+ * @param values - The current thumb value(s).
119
+ * @param range - Whether the slider is a range slider.
120
+ * @param min - Slider minimum.
121
+ * @param max - Slider maximum.
122
+ * @param track - The track display mode.
123
+ * @returns `{ offset, leap }` as percentages (0–100).
124
+ */
125
+ export declare const getTrackMetrics: (values: number[], range: boolean, min: number, max: number, track?: SliderProps["track"]) => TrackMetrics;
126
+ /**
127
+ * Builds metadata for evenly-spaced tickmark dots along the slider rail.
128
+ * Each tickmark is either a normal dot or a "major" dot (when it aligns with a
129
+ * user-defined mark position within `MAJOR_TICK_THRESHOLD_PERCENT`).
130
+ *
131
+ * @param tickmarks - Total number of tickmarks to render.
132
+ * @param marksArray - User-defined marks (used to identify major ticks).
133
+ * @param min - Slider minimum.
134
+ * @param max - Slider maximum.
135
+ * @returns Array of `{ percent, isMajor }` for each tickmark.
136
+ */
137
+ export declare const buildTickmarkMeta: (tickmarks: number, marksArray: Mark[] | undefined, min: number, max: number) => TickmarkMeta[];
138
+ /**
139
+ * Determines whether a mark at a given percentage is within the active track region.
140
+ * Used to style marks differently when they fall inside vs. outside the colored track.
141
+ *
142
+ * @param percent - The mark's position as a percentage (0–100).
143
+ * @param range - Whether the slider is a range slider.
144
+ * @param track - The track display mode.
145
+ * @param trackOffset - The start of the active track (percentage).
146
+ * @param trackLeap - The length of the active track (percentage).
147
+ * @returns `true` if the mark is within the active track region.
148
+ */
149
+ export declare const isMarkActive: (percent: number, range: boolean, track: SliderProps["track"], trackOffset: number, trackLeap: number) => boolean;
150
+ /**
151
+ * Generates a CSS `clip-path: inset(...)` value that clips the "active" tickmark
152
+ * layer to only show ticks within the colored track region. The active layer is
153
+ * rendered on top of the inactive layer and uses a different color.
154
+ *
155
+ * @param orientation - The slider orientation, used to choose horizontal vs. vertical clipping.
156
+ * @param track - The track display mode.
157
+ * @param range - Whether the slider is a range slider.
158
+ * @param trackOffset - The start of the active track (percentage).
159
+ * @param trackLeap - The length of the active track (percentage).
160
+ * @returns One or more CSS `inset(...)` strings for the `clip-path` property.
161
+ */
162
+ export declare const getTickmarkClipPaths: (orientation: SliderProps["orientation"], track: SliderProps["track"], range: boolean, trackOffset: number, trackLeap: number) => string[];
163
+ /**
164
+ * Backwards-compatible helper returning the first clip-path segment.
165
+ * Prefer `getTickmarkClipPaths()` for new code.
166
+ */
167
+ export declare const getTickmarkClipPath: (track: SliderProps["track"], range: boolean, trackOffset: number, trackLeap: number) => string;
168
+ /**
169
+ * Returns inline styles for the slider root element. Applies `width` for horizontal
170
+ * sliders and `height` for vertical sliders when a length is explicitly provided.
171
+ *
172
+ * @param length - The desired length along the main axis (number for px, or a CSS string).
173
+ * @param orientation - The slider orientation.
174
+ * @returns CSS properties object, or `undefined` if no styles are needed.
175
+ */
176
+ export declare const getSliderStyle: (length: SliderProps["length"], orientation: SliderProps["orientation"]) => CSSProperties | undefined;
177
+ /**
178
+ * Returns a clamped CSS offset for a mark dot so that the full circle stays
179
+ * within the rail bounds. Without clamping, marks at 0% and 100% would have
180
+ * half the dot extending beyond the rail due to `translate(-50%)`.
181
+ *
182
+ * The position is clamped between `mark-size / 2` and `100% - mark-size / 2`
183
+ * using the `--rbui-slider-mark-size` CSS custom property, so the dot never
184
+ * overflows the rounded rail ends regardless of the component size variant.
185
+ *
186
+ * @param percent - The mark's position as a percentage (0–100) along the track.
187
+ * @param axis - The resolved axis direction (`horizontal`, `horizontal-reverse`, or `vertical`).
188
+ * @returns CSS properties with the clamped positional value for the appropriate axis.
189
+ */
190
+ export declare const getClampedMarkOffset: (percent: number, axis: Axis) => CSSProperties;
@@ -0,0 +1,2 @@
1
+ export { default } from './slider';
2
+ export type { Mark, SliderChangeCommittedHandler, SliderChangeHandler, SliderNumberInputAttributes, SliderProps, SliderValue, } from './slider.types';
@@ -0,0 +1,17 @@
1
+ import { SliderProps } from './slider.types';
2
+ /**
3
+ * Slider allows users to select a value or range from a continuous or discrete set of values
4
+ * by moving a thumb along a track.
5
+ *
6
+ * ### Usage
7
+ *
8
+ * ```tsx
9
+ * import { Slider } from '@bloomreach/react-banana-ui';
10
+ *
11
+ * export default function MySlider() {
12
+ * return <Slider defaultValue={50} />;
13
+ * }
14
+ * ```
15
+ */
16
+ declare const Slider: import('react').ForwardRefExoticComponent<SliderProps & import('react').RefAttributes<HTMLSpanElement>>;
17
+ export default Slider;
@@ -0,0 +1,27 @@
1
+ import { Meta } from '@storybook/react-vite';
2
+ import { Story } from './slider.stories';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const AllStates: Story;
6
+ export declare const TrackVariants: Story;
7
+ export declare const WithMarks: Story;
8
+ export declare const WithTickmarks: Story;
9
+ export declare const TickmarksWithMarks: Story;
10
+ export declare const StaggeredLabels: Story;
11
+ export declare const Vertical: Story;
12
+ export declare const VerticalTickmarks: Story;
13
+ export declare const WithValueLabelOn: Story;
14
+ export declare const RangeSlider: Story;
15
+ export declare const DisableSwap: Story;
16
+ export declare const MinDistanceRange: Story;
17
+ export declare const WithInput: Story;
18
+ export declare const RangeWithInput: Story;
19
+ export declare const KeyboardInteraction: Story;
20
+ export declare const RangeKeyboardInteraction: Story;
21
+ export declare const ValueLabelAutoInteraction: Story;
22
+ export declare const ControlledWithInput: Story;
23
+ export declare const RangeWithInputControlled: Story;
24
+ export declare const SnapToMarksInteraction: Story;
25
+ export declare const DisabledInteraction: Story;
26
+ export declare const ReadOnlyInteraction: Story;
27
+ export declare const ShiftStepInteraction: Story;
@@ -0,0 +1,33 @@
1
+ import { default as Slider } from '.';
2
+ import { Meta, StoryObj } from '@storybook/react-vite';
3
+ declare const meta: Meta<typeof Slider>;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof Slider>;
6
+ export declare const Basic: Story;
7
+ export declare const Controlled: Story;
8
+ export declare const ReadOnly: Story;
9
+ export declare const Disabled: Story;
10
+ export declare const Error: Story;
11
+ export declare const RangeSlider: Story;
12
+ export declare const WithValueLabel: Story;
13
+ export declare const CustomValueFormat: Story;
14
+ export declare const Steps: Story;
15
+ export declare const SmallSize: Story;
16
+ export declare const Vertical: Story;
17
+ export declare const CustomRange: Story;
18
+ export declare const CenteredTrack: Story;
19
+ export declare const TrackInverted: Story;
20
+ export declare const TrackFalse: Story;
21
+ export declare const LogarithmicScale: Story;
22
+ export declare const WithMarks: Story;
23
+ export declare const SnapToMarks: Story;
24
+ export declare const MagneticSnapToMarks: Story;
25
+ export declare const WithTickmarks: Story;
26
+ export declare const TickmarksWithMarks: Story;
27
+ export declare const StaggeredLabels: Story;
28
+ export declare const VerticalTickmarks: Story;
29
+ export declare const DisableSwap: Story;
30
+ export declare const MinDistance: Story;
31
+ export declare const WithInput: Story;
32
+ export declare const RangeWithInput: Story;
33
+ export declare const ShiftStep: Story;