@tinybigui/react 0.18.0 → 0.19.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.
- package/README.md +9 -9
- package/dist/index.cjs +398 -556
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -55
- package/dist/index.d.ts +141 -55
- package/dist/index.js +398 -556
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -8845,6 +8845,26 @@ type SliderOrientation = "horizontal" | "vertical";
|
|
|
8845
8845
|
* @example ['Min price', 'Max price']
|
|
8846
8846
|
*/
|
|
8847
8847
|
type SliderRangeThumbLabels = [string, string];
|
|
8848
|
+
/**
|
|
8849
|
+
* Render state provided to `renderThumbContent` for each thumb slot.
|
|
8850
|
+
*
|
|
8851
|
+
* The styled layer (`Slider`) uses this to render the visual handle,
|
|
8852
|
+
* state layer, and value indicator inside the React Aria thumb element.
|
|
8853
|
+
*/
|
|
8854
|
+
interface SliderThumbRenderState {
|
|
8855
|
+
/** Zero-based index of this thumb (0 for single-thumb, 0 or 1 for range). */
|
|
8856
|
+
index: number;
|
|
8857
|
+
/** Current numeric value of this thumb (from React Stately state). */
|
|
8858
|
+
value: number;
|
|
8859
|
+
/** Whether this thumb is currently being dragged (pointer down). */
|
|
8860
|
+
isDragging: boolean;
|
|
8861
|
+
/** Whether keyboard focus ring is visible on this thumb. */
|
|
8862
|
+
isFocusVisible: boolean;
|
|
8863
|
+
/** Whether pointer is hovering over this thumb. */
|
|
8864
|
+
isHovered: boolean;
|
|
8865
|
+
/** Whether the slider is disabled. */
|
|
8866
|
+
isDisabled: boolean;
|
|
8867
|
+
}
|
|
8848
8868
|
/**
|
|
8849
8869
|
* Props for the headless `SliderHeadless` primitive (Layer 2).
|
|
8850
8870
|
*
|
|
@@ -8949,10 +8969,33 @@ interface SliderHeadlessProps {
|
|
|
8949
8969
|
*/
|
|
8950
8970
|
isDisabled?: boolean;
|
|
8951
8971
|
/**
|
|
8952
|
-
* Content (children) rendered inside the slider
|
|
8953
|
-
* Used by the styled layer to inject track
|
|
8972
|
+
* Content (children) rendered inside the slider track element.
|
|
8973
|
+
* Used by the styled layer to inject track layout.
|
|
8954
8974
|
*/
|
|
8955
8975
|
children?: React__default.ReactNode;
|
|
8976
|
+
/**
|
|
8977
|
+
* CSS classes applied to the `data-track` region element.
|
|
8978
|
+
* The styled layer uses this to carry the size-based height/width and
|
|
8979
|
+
* `touch-none` on the element React Aria measures for pointer math.
|
|
8980
|
+
* When omitted, the track region defaults to `relative w-full`.
|
|
8981
|
+
*/
|
|
8982
|
+
trackClassName?: string;
|
|
8983
|
+
/**
|
|
8984
|
+
* Render prop called for each thumb to produce visual thumb content
|
|
8985
|
+
* (handle, state layer, value indicator). Receives the thumb's current
|
|
8986
|
+
* render state. When provided, visual content is rendered inside the
|
|
8987
|
+
* React Aria thumb element (which is absolutely positioned at the value %).
|
|
8988
|
+
*
|
|
8989
|
+
* Used by the styled `Slider` layer; advanced users of `SliderHeadless`
|
|
8990
|
+
* may supply custom thumb visuals.
|
|
8991
|
+
*/
|
|
8992
|
+
renderThumbContent?: (state: SliderThumbRenderState) => React__default.ReactNode;
|
|
8993
|
+
/**
|
|
8994
|
+
* Called when any thumb's dragging state changes.
|
|
8995
|
+
* Receives the thumb index and a boolean indicating whether it is dragging.
|
|
8996
|
+
* Used by the styled layer to suppress track animation during pointer drag.
|
|
8997
|
+
*/
|
|
8998
|
+
onThumbDraggingChange?: (index: number, isDragging: boolean) => void;
|
|
8956
8999
|
/**
|
|
8957
9000
|
* Additional CSS classes applied to the slider root element.
|
|
8958
9001
|
*/
|
|
@@ -9046,7 +9089,7 @@ interface SliderThumbProps {
|
|
|
9046
9089
|
* />
|
|
9047
9090
|
* ```
|
|
9048
9091
|
*/
|
|
9049
|
-
interface SliderProps extends Omit<SliderHeadlessProps, "children"> {
|
|
9092
|
+
interface SliderProps extends Omit<SliderHeadlessProps, "children" | "renderThumbContent" | "onThumbDraggingChange"> {
|
|
9050
9093
|
/**
|
|
9051
9094
|
* MD3 Expressive size preset.
|
|
9052
9095
|
* Controls track height, handle height, corner radius, and icon size.
|
|
@@ -9077,7 +9120,11 @@ interface SliderProps extends Omit<SliderHeadlessProps, "children"> {
|
|
|
9077
9120
|
}
|
|
9078
9121
|
/**
|
|
9079
9122
|
* Interactive state of a slider thumb.
|
|
9080
|
-
*
|
|
9123
|
+
*
|
|
9124
|
+
* @deprecated The styled Slider now drives interaction states via React Aria
|
|
9125
|
+
* hooks + `data-*` attributes (group-data-[x]/slider-thumb selectors) instead
|
|
9126
|
+
* of a manual state machine. This type is retained only for backwards
|
|
9127
|
+
* compatibility with existing usages of `SliderHeadlessProps`.
|
|
9081
9128
|
*
|
|
9082
9129
|
* @internal
|
|
9083
9130
|
*/
|
|
@@ -9085,6 +9132,10 @@ type SliderThumbState = "enabled" | "hovered" | "pressed" | "disabled";
|
|
|
9085
9132
|
/**
|
|
9086
9133
|
* Render state passed to internal sub-components for conditional styling.
|
|
9087
9134
|
*
|
|
9135
|
+
* @deprecated The styled Slider now uses `SliderThumbRenderState` (per-thumb
|
|
9136
|
+
* render state) provided by the `renderThumbContent` render prop. This type
|
|
9137
|
+
* is retained only for backwards compatibility.
|
|
9138
|
+
*
|
|
9088
9139
|
* @internal
|
|
9089
9140
|
*/
|
|
9090
9141
|
interface SliderRenderState {
|
|
@@ -9103,15 +9154,31 @@ interface SliderRenderState {
|
|
|
9103
9154
|
/**
|
|
9104
9155
|
* Material Design 3 Slider Component (Layer 3: Styled)
|
|
9105
9156
|
*
|
|
9106
|
-
* Wraps SliderHeadless with CVA styling for all five MD3 Expressive sizes.
|
|
9107
|
-
* Renders the visual track layout (active
|
|
9108
|
-
*
|
|
9109
|
-
*
|
|
9157
|
+
* Wraps `SliderHeadless` with CVA styling for all five MD3 Expressive sizes.
|
|
9158
|
+
* Renders the visual track layout (active/inactive tracks) as children inside
|
|
9159
|
+
* the headless track element. The visual handle, state layer, and value indicator
|
|
9160
|
+
* are rendered as children of the React Aria thumb element via `renderThumbContent`,
|
|
9161
|
+
* which positions them exactly at the value percentage.
|
|
9162
|
+
*
|
|
9163
|
+
* **Architecture (Variants-vs-States)**
|
|
9164
|
+
* - Interaction states (hover, pressed/dragging, disabled, focus) are driven by
|
|
9165
|
+
* React Aria hooks → `getInteractionDataAttributes` → `data-*` on the RA thumb
|
|
9166
|
+
* (`group/slider-thumb`) → `group-data-[x]/slider-thumb:*` CSS selectors.
|
|
9167
|
+
* - No manual pointer state machine — React Aria's `isDragging`, `isHovered`,
|
|
9168
|
+
* and `isFocusVisible` are the single source of truth.
|
|
9169
|
+
* - Disabled track/stop colors use `group-data-[disabled]/slider:*` selectors
|
|
9170
|
+
* from the root `group/slider` scope.
|
|
9171
|
+
*
|
|
9172
|
+
* **Geometry (documented inline-style exception)**
|
|
9110
9173
|
* Track widths are driven by runtime values and use inline `flexBasis` styles —
|
|
9111
9174
|
* a documented exception for geometry that cannot be expressed as design tokens.
|
|
9112
9175
|
*
|
|
9113
|
-
* Motion
|
|
9114
|
-
*
|
|
9176
|
+
* **Motion**
|
|
9177
|
+
* - Track fill: spring-standard-fast-spatial (suppressed during drag + reduced motion)
|
|
9178
|
+
* - Handle width: spring-standard-fast-spatial (suppressed for reduced motion)
|
|
9179
|
+
* - State layer opacity: spring-standard-fast-effects (always present; CSS media
|
|
9180
|
+
* query handles `prefers-reduced-motion` for CSS-driven changes)
|
|
9181
|
+
* - Value indicator: spring-standard-fast-spatial (suppressed for reduced motion)
|
|
9115
9182
|
*
|
|
9116
9183
|
* @example
|
|
9117
9184
|
* ```tsx
|
|
@@ -9143,6 +9210,8 @@ declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & Rea
|
|
|
9143
9210
|
* - Discrete stepping support
|
|
9144
9211
|
* - Live value announcements via <output>
|
|
9145
9212
|
* - data-* attributes for styled layer targeting
|
|
9213
|
+
* - `group/slider-thumb` scope on each thumb for group-data CSS selectors
|
|
9214
|
+
* - `renderThumbContent` render prop for injecting visual content inside RA thumb
|
|
9146
9215
|
*
|
|
9147
9216
|
* @example
|
|
9148
9217
|
* ```tsx
|
|
@@ -9161,81 +9230,98 @@ declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & Rea
|
|
|
9161
9230
|
declare const SliderHeadless: React__default.ForwardRefExoticComponent<SliderHeadlessProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
9162
9231
|
|
|
9163
9232
|
/**
|
|
9164
|
-
*
|
|
9233
|
+
* Slider root container variants.
|
|
9165
9234
|
*
|
|
9166
|
-
*
|
|
9167
|
-
*
|
|
9168
|
-
*
|
|
9235
|
+
* The root element carries:
|
|
9236
|
+
* - `group/slider` — scope for track/stop disabled-state selectors
|
|
9237
|
+
* (`group-data-[disabled]/slider:*`)
|
|
9238
|
+
*
|
|
9239
|
+
* Horizontal layout: CSS grid with label (col 1) + output (col 2) in the first
|
|
9240
|
+
* row, and the full-width track region spanning both columns in the second row.
|
|
9241
|
+
* This matches the canonical React Aria / MD3 layout and prevents the track
|
|
9242
|
+
* from collapsing when label + output are inline siblings.
|
|
9243
|
+
*
|
|
9244
|
+
* Vertical layout: flex-col so label is above the track.
|
|
9245
|
+
* The size-based HEIGHT lives on the track region, not here (the container is
|
|
9246
|
+
* auto-height in horizontal so it wraps the grid rows naturally).
|
|
9169
9247
|
*/
|
|
9170
9248
|
declare const sliderContainerVariants: (props?: ({
|
|
9171
|
-
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9172
9249
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9173
|
-
|
|
9250
|
+
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9174
9251
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9175
9252
|
/**
|
|
9176
|
-
*
|
|
9253
|
+
* Absolute-fill container that holds the active and inactive track segments.
|
|
9254
|
+
*
|
|
9255
|
+
* Segments are `position: absolute` children sharing the same percentage
|
|
9256
|
+
* coordinate space as the React Aria thumbs, so fills always align with
|
|
9257
|
+
* handle positions regardless of value or orientation.
|
|
9258
|
+
*
|
|
9259
|
+
* The MD3 6dp thumb-track gap (`thumbTrackGapSize`) is applied as a symmetric
|
|
9260
|
+
* 3px offset on each side of the thumb in the parent's inline position styles.
|
|
9261
|
+
*
|
|
9262
|
+
* `pointer-events-none` lets React Aria's track click-to-seek events
|
|
9263
|
+
* reach the `data-track` region without interference.
|
|
9264
|
+
*/
|
|
9265
|
+
declare const sliderTrackLayoutVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9266
|
+
/**
|
|
9267
|
+
* The filled (active) portion of the slider track.
|
|
9177
9268
|
*
|
|
9178
|
-
*
|
|
9179
|
-
*
|
|
9180
|
-
*
|
|
9181
|
-
*
|
|
9269
|
+
* **Color**: `bg-primary`
|
|
9270
|
+
* **Disabled**: driven by `group-data-[disabled]/slider:*` — no CVA disabled variant.
|
|
9271
|
+
* **Transition**: `flex-basis` spring (spatial) when not dragging/reduced-motion.
|
|
9272
|
+
*
|
|
9273
|
+
* MD3 §6, §10.2: outer corner = size corner token, inner corner (near handle) = 2dp.
|
|
9274
|
+
* NOTE: measurement-derived corner values from MD3 spec §6; permitted exception.
|
|
9182
9275
|
*/
|
|
9183
9276
|
declare const sliderActiveTrackVariants: (props?: ({
|
|
9184
9277
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9185
9278
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9186
|
-
disabled?: boolean | null | undefined;
|
|
9187
9279
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9188
9280
|
/**
|
|
9189
|
-
*
|
|
9281
|
+
* The unfilled (inactive) portion of the slider track.
|
|
9282
|
+
*
|
|
9283
|
+
* **Color**: `bg-secondary-container`
|
|
9284
|
+
* **Disabled**: driven by `group-data-[disabled]/slider:*` — no CVA disabled variant.
|
|
9190
9285
|
*
|
|
9191
|
-
* MD3
|
|
9192
|
-
*
|
|
9193
|
-
* Disabled: `bg-on-surface` at 10% opacity via Tailwind alpha modifier.
|
|
9286
|
+
* MD3 §6, §10.2: inner corner (near handle) = 2dp, outer corner = size corner token.
|
|
9287
|
+
* NOTE: measurement-derived corner values from MD3 spec §6; permitted exception.
|
|
9194
9288
|
*/
|
|
9195
9289
|
declare const sliderInactiveTrackVariants: (props?: ({
|
|
9196
9290
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9197
9291
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9198
|
-
disabled?: boolean | null | undefined;
|
|
9199
9292
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9200
9293
|
/**
|
|
9201
|
-
*
|
|
9294
|
+
* Visual handle (thumb indicator) element inside the React Aria thumb container.
|
|
9295
|
+
*
|
|
9296
|
+
* **Architecture**: This element lives inside the `group/slider-thumb` scope (the
|
|
9297
|
+
* RA-positioned thumb div). All interaction states are driven by
|
|
9298
|
+
* `group-data-[x]/slider-thumb:*` selectors — no CVA interaction-state variants.
|
|
9202
9299
|
*
|
|
9203
|
-
*
|
|
9204
|
-
*
|
|
9205
|
-
*
|
|
9206
|
-
* Width narrows to 2dp on press (md3 spec §9.3).
|
|
9207
|
-
* Motion: transition-[width] with duration-short2 + ease-standard applied conditionally
|
|
9208
|
-
* in Slider.tsx based on useReducedMotion() guard (MD3 Appendix E).
|
|
9300
|
+
* **Pressed width**: `group-data-[pressed]/slider-thumb:w-[2px]` (4dp → 2dp, MD3 spec)
|
|
9301
|
+
* **Motion**: `transition-[width]` with spring-standard-fast-spatial tokens.
|
|
9302
|
+
* Applied conditionally in `Slider.tsx` (suppressed for `useReducedMotion()`).
|
|
9209
9303
|
*/
|
|
9210
9304
|
declare const sliderHandleVariants: (props?: ({
|
|
9211
9305
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9212
9306
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9213
|
-
pressed?: boolean | null | undefined;
|
|
9214
|
-
disabled?: boolean | null | undefined;
|
|
9215
9307
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9216
9308
|
/**
|
|
9217
|
-
*
|
|
9309
|
+
* State layer overlay on the handle (hover ripple).
|
|
9218
9310
|
*
|
|
9219
|
-
*
|
|
9220
|
-
* -
|
|
9221
|
-
*
|
|
9222
|
-
*
|
|
9223
|
-
*
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9228
|
-
/**
|
|
9229
|
-
* CVA for the track layout container (holds active track + handle + inactive track).
|
|
9311
|
+
* **Architecture**: Lives inside `group/slider-thumb`; opacity driven entirely
|
|
9312
|
+
* by `group-data-[x]/slider-thumb:opacity-*` selectors — no CVA state variant.
|
|
9313
|
+
*
|
|
9314
|
+
* State-layer opacities per MD3 spec:
|
|
9315
|
+
* - hover: 8% (`opacity-8`)
|
|
9316
|
+
* - focused: 10% (`opacity-10`)
|
|
9317
|
+
* - pressed: 10% (`opacity-10`)
|
|
9318
|
+
* - dragged: 16% (`opacity-16`) — note: drag = pressed in RA isDragging → data-pressed
|
|
9230
9319
|
*
|
|
9231
|
-
*
|
|
9232
|
-
*
|
|
9233
|
-
*
|
|
9234
|
-
* `relative` is required so the absolute stops overlay is positioned within.
|
|
9320
|
+
* **Motion**: `transition-opacity` with spring-standard-fast-effects tokens.
|
|
9321
|
+
* Always present; `@media prefers-reduced-motion` suppresses the transition at
|
|
9322
|
+
* the CSS level.
|
|
9235
9323
|
*/
|
|
9236
|
-
declare const
|
|
9237
|
-
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9238
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9324
|
+
declare const sliderHandleStateLayerVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9239
9325
|
|
|
9240
9326
|
/**
|
|
9241
9327
|
* Structural variant of the MD3 Bottom Sheet.
|
package/dist/index.d.ts
CHANGED
|
@@ -8845,6 +8845,26 @@ type SliderOrientation = "horizontal" | "vertical";
|
|
|
8845
8845
|
* @example ['Min price', 'Max price']
|
|
8846
8846
|
*/
|
|
8847
8847
|
type SliderRangeThumbLabels = [string, string];
|
|
8848
|
+
/**
|
|
8849
|
+
* Render state provided to `renderThumbContent` for each thumb slot.
|
|
8850
|
+
*
|
|
8851
|
+
* The styled layer (`Slider`) uses this to render the visual handle,
|
|
8852
|
+
* state layer, and value indicator inside the React Aria thumb element.
|
|
8853
|
+
*/
|
|
8854
|
+
interface SliderThumbRenderState {
|
|
8855
|
+
/** Zero-based index of this thumb (0 for single-thumb, 0 or 1 for range). */
|
|
8856
|
+
index: number;
|
|
8857
|
+
/** Current numeric value of this thumb (from React Stately state). */
|
|
8858
|
+
value: number;
|
|
8859
|
+
/** Whether this thumb is currently being dragged (pointer down). */
|
|
8860
|
+
isDragging: boolean;
|
|
8861
|
+
/** Whether keyboard focus ring is visible on this thumb. */
|
|
8862
|
+
isFocusVisible: boolean;
|
|
8863
|
+
/** Whether pointer is hovering over this thumb. */
|
|
8864
|
+
isHovered: boolean;
|
|
8865
|
+
/** Whether the slider is disabled. */
|
|
8866
|
+
isDisabled: boolean;
|
|
8867
|
+
}
|
|
8848
8868
|
/**
|
|
8849
8869
|
* Props for the headless `SliderHeadless` primitive (Layer 2).
|
|
8850
8870
|
*
|
|
@@ -8949,10 +8969,33 @@ interface SliderHeadlessProps {
|
|
|
8949
8969
|
*/
|
|
8950
8970
|
isDisabled?: boolean;
|
|
8951
8971
|
/**
|
|
8952
|
-
* Content (children) rendered inside the slider
|
|
8953
|
-
* Used by the styled layer to inject track
|
|
8972
|
+
* Content (children) rendered inside the slider track element.
|
|
8973
|
+
* Used by the styled layer to inject track layout.
|
|
8954
8974
|
*/
|
|
8955
8975
|
children?: React__default.ReactNode;
|
|
8976
|
+
/**
|
|
8977
|
+
* CSS classes applied to the `data-track` region element.
|
|
8978
|
+
* The styled layer uses this to carry the size-based height/width and
|
|
8979
|
+
* `touch-none` on the element React Aria measures for pointer math.
|
|
8980
|
+
* When omitted, the track region defaults to `relative w-full`.
|
|
8981
|
+
*/
|
|
8982
|
+
trackClassName?: string;
|
|
8983
|
+
/**
|
|
8984
|
+
* Render prop called for each thumb to produce visual thumb content
|
|
8985
|
+
* (handle, state layer, value indicator). Receives the thumb's current
|
|
8986
|
+
* render state. When provided, visual content is rendered inside the
|
|
8987
|
+
* React Aria thumb element (which is absolutely positioned at the value %).
|
|
8988
|
+
*
|
|
8989
|
+
* Used by the styled `Slider` layer; advanced users of `SliderHeadless`
|
|
8990
|
+
* may supply custom thumb visuals.
|
|
8991
|
+
*/
|
|
8992
|
+
renderThumbContent?: (state: SliderThumbRenderState) => React__default.ReactNode;
|
|
8993
|
+
/**
|
|
8994
|
+
* Called when any thumb's dragging state changes.
|
|
8995
|
+
* Receives the thumb index and a boolean indicating whether it is dragging.
|
|
8996
|
+
* Used by the styled layer to suppress track animation during pointer drag.
|
|
8997
|
+
*/
|
|
8998
|
+
onThumbDraggingChange?: (index: number, isDragging: boolean) => void;
|
|
8956
8999
|
/**
|
|
8957
9000
|
* Additional CSS classes applied to the slider root element.
|
|
8958
9001
|
*/
|
|
@@ -9046,7 +9089,7 @@ interface SliderThumbProps {
|
|
|
9046
9089
|
* />
|
|
9047
9090
|
* ```
|
|
9048
9091
|
*/
|
|
9049
|
-
interface SliderProps extends Omit<SliderHeadlessProps, "children"> {
|
|
9092
|
+
interface SliderProps extends Omit<SliderHeadlessProps, "children" | "renderThumbContent" | "onThumbDraggingChange"> {
|
|
9050
9093
|
/**
|
|
9051
9094
|
* MD3 Expressive size preset.
|
|
9052
9095
|
* Controls track height, handle height, corner radius, and icon size.
|
|
@@ -9077,7 +9120,11 @@ interface SliderProps extends Omit<SliderHeadlessProps, "children"> {
|
|
|
9077
9120
|
}
|
|
9078
9121
|
/**
|
|
9079
9122
|
* Interactive state of a slider thumb.
|
|
9080
|
-
*
|
|
9123
|
+
*
|
|
9124
|
+
* @deprecated The styled Slider now drives interaction states via React Aria
|
|
9125
|
+
* hooks + `data-*` attributes (group-data-[x]/slider-thumb selectors) instead
|
|
9126
|
+
* of a manual state machine. This type is retained only for backwards
|
|
9127
|
+
* compatibility with existing usages of `SliderHeadlessProps`.
|
|
9081
9128
|
*
|
|
9082
9129
|
* @internal
|
|
9083
9130
|
*/
|
|
@@ -9085,6 +9132,10 @@ type SliderThumbState = "enabled" | "hovered" | "pressed" | "disabled";
|
|
|
9085
9132
|
/**
|
|
9086
9133
|
* Render state passed to internal sub-components for conditional styling.
|
|
9087
9134
|
*
|
|
9135
|
+
* @deprecated The styled Slider now uses `SliderThumbRenderState` (per-thumb
|
|
9136
|
+
* render state) provided by the `renderThumbContent` render prop. This type
|
|
9137
|
+
* is retained only for backwards compatibility.
|
|
9138
|
+
*
|
|
9088
9139
|
* @internal
|
|
9089
9140
|
*/
|
|
9090
9141
|
interface SliderRenderState {
|
|
@@ -9103,15 +9154,31 @@ interface SliderRenderState {
|
|
|
9103
9154
|
/**
|
|
9104
9155
|
* Material Design 3 Slider Component (Layer 3: Styled)
|
|
9105
9156
|
*
|
|
9106
|
-
* Wraps SliderHeadless with CVA styling for all five MD3 Expressive sizes.
|
|
9107
|
-
* Renders the visual track layout (active
|
|
9108
|
-
*
|
|
9109
|
-
*
|
|
9157
|
+
* Wraps `SliderHeadless` with CVA styling for all five MD3 Expressive sizes.
|
|
9158
|
+
* Renders the visual track layout (active/inactive tracks) as children inside
|
|
9159
|
+
* the headless track element. The visual handle, state layer, and value indicator
|
|
9160
|
+
* are rendered as children of the React Aria thumb element via `renderThumbContent`,
|
|
9161
|
+
* which positions them exactly at the value percentage.
|
|
9162
|
+
*
|
|
9163
|
+
* **Architecture (Variants-vs-States)**
|
|
9164
|
+
* - Interaction states (hover, pressed/dragging, disabled, focus) are driven by
|
|
9165
|
+
* React Aria hooks → `getInteractionDataAttributes` → `data-*` on the RA thumb
|
|
9166
|
+
* (`group/slider-thumb`) → `group-data-[x]/slider-thumb:*` CSS selectors.
|
|
9167
|
+
* - No manual pointer state machine — React Aria's `isDragging`, `isHovered`,
|
|
9168
|
+
* and `isFocusVisible` are the single source of truth.
|
|
9169
|
+
* - Disabled track/stop colors use `group-data-[disabled]/slider:*` selectors
|
|
9170
|
+
* from the root `group/slider` scope.
|
|
9171
|
+
*
|
|
9172
|
+
* **Geometry (documented inline-style exception)**
|
|
9110
9173
|
* Track widths are driven by runtime values and use inline `flexBasis` styles —
|
|
9111
9174
|
* a documented exception for geometry that cannot be expressed as design tokens.
|
|
9112
9175
|
*
|
|
9113
|
-
* Motion
|
|
9114
|
-
*
|
|
9176
|
+
* **Motion**
|
|
9177
|
+
* - Track fill: spring-standard-fast-spatial (suppressed during drag + reduced motion)
|
|
9178
|
+
* - Handle width: spring-standard-fast-spatial (suppressed for reduced motion)
|
|
9179
|
+
* - State layer opacity: spring-standard-fast-effects (always present; CSS media
|
|
9180
|
+
* query handles `prefers-reduced-motion` for CSS-driven changes)
|
|
9181
|
+
* - Value indicator: spring-standard-fast-spatial (suppressed for reduced motion)
|
|
9115
9182
|
*
|
|
9116
9183
|
* @example
|
|
9117
9184
|
* ```tsx
|
|
@@ -9143,6 +9210,8 @@ declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & Rea
|
|
|
9143
9210
|
* - Discrete stepping support
|
|
9144
9211
|
* - Live value announcements via <output>
|
|
9145
9212
|
* - data-* attributes for styled layer targeting
|
|
9213
|
+
* - `group/slider-thumb` scope on each thumb for group-data CSS selectors
|
|
9214
|
+
* - `renderThumbContent` render prop for injecting visual content inside RA thumb
|
|
9146
9215
|
*
|
|
9147
9216
|
* @example
|
|
9148
9217
|
* ```tsx
|
|
@@ -9161,81 +9230,98 @@ declare const Slider: React__default.ForwardRefExoticComponent<SliderProps & Rea
|
|
|
9161
9230
|
declare const SliderHeadless: React__default.ForwardRefExoticComponent<SliderHeadlessProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
9162
9231
|
|
|
9163
9232
|
/**
|
|
9164
|
-
*
|
|
9233
|
+
* Slider root container variants.
|
|
9165
9234
|
*
|
|
9166
|
-
*
|
|
9167
|
-
*
|
|
9168
|
-
*
|
|
9235
|
+
* The root element carries:
|
|
9236
|
+
* - `group/slider` — scope for track/stop disabled-state selectors
|
|
9237
|
+
* (`group-data-[disabled]/slider:*`)
|
|
9238
|
+
*
|
|
9239
|
+
* Horizontal layout: CSS grid with label (col 1) + output (col 2) in the first
|
|
9240
|
+
* row, and the full-width track region spanning both columns in the second row.
|
|
9241
|
+
* This matches the canonical React Aria / MD3 layout and prevents the track
|
|
9242
|
+
* from collapsing when label + output are inline siblings.
|
|
9243
|
+
*
|
|
9244
|
+
* Vertical layout: flex-col so label is above the track.
|
|
9245
|
+
* The size-based HEIGHT lives on the track region, not here (the container is
|
|
9246
|
+
* auto-height in horizontal so it wraps the grid rows naturally).
|
|
9169
9247
|
*/
|
|
9170
9248
|
declare const sliderContainerVariants: (props?: ({
|
|
9171
|
-
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9172
9249
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9173
|
-
|
|
9250
|
+
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9174
9251
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9175
9252
|
/**
|
|
9176
|
-
*
|
|
9253
|
+
* Absolute-fill container that holds the active and inactive track segments.
|
|
9254
|
+
*
|
|
9255
|
+
* Segments are `position: absolute` children sharing the same percentage
|
|
9256
|
+
* coordinate space as the React Aria thumbs, so fills always align with
|
|
9257
|
+
* handle positions regardless of value or orientation.
|
|
9258
|
+
*
|
|
9259
|
+
* The MD3 6dp thumb-track gap (`thumbTrackGapSize`) is applied as a symmetric
|
|
9260
|
+
* 3px offset on each side of the thumb in the parent's inline position styles.
|
|
9261
|
+
*
|
|
9262
|
+
* `pointer-events-none` lets React Aria's track click-to-seek events
|
|
9263
|
+
* reach the `data-track` region without interference.
|
|
9264
|
+
*/
|
|
9265
|
+
declare const sliderTrackLayoutVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9266
|
+
/**
|
|
9267
|
+
* The filled (active) portion of the slider track.
|
|
9177
9268
|
*
|
|
9178
|
-
*
|
|
9179
|
-
*
|
|
9180
|
-
*
|
|
9181
|
-
*
|
|
9269
|
+
* **Color**: `bg-primary`
|
|
9270
|
+
* **Disabled**: driven by `group-data-[disabled]/slider:*` — no CVA disabled variant.
|
|
9271
|
+
* **Transition**: `flex-basis` spring (spatial) when not dragging/reduced-motion.
|
|
9272
|
+
*
|
|
9273
|
+
* MD3 §6, §10.2: outer corner = size corner token, inner corner (near handle) = 2dp.
|
|
9274
|
+
* NOTE: measurement-derived corner values from MD3 spec §6; permitted exception.
|
|
9182
9275
|
*/
|
|
9183
9276
|
declare const sliderActiveTrackVariants: (props?: ({
|
|
9184
9277
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9185
9278
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9186
|
-
disabled?: boolean | null | undefined;
|
|
9187
9279
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9188
9280
|
/**
|
|
9189
|
-
*
|
|
9281
|
+
* The unfilled (inactive) portion of the slider track.
|
|
9282
|
+
*
|
|
9283
|
+
* **Color**: `bg-secondary-container`
|
|
9284
|
+
* **Disabled**: driven by `group-data-[disabled]/slider:*` — no CVA disabled variant.
|
|
9190
9285
|
*
|
|
9191
|
-
* MD3
|
|
9192
|
-
*
|
|
9193
|
-
* Disabled: `bg-on-surface` at 10% opacity via Tailwind alpha modifier.
|
|
9286
|
+
* MD3 §6, §10.2: inner corner (near handle) = 2dp, outer corner = size corner token.
|
|
9287
|
+
* NOTE: measurement-derived corner values from MD3 spec §6; permitted exception.
|
|
9194
9288
|
*/
|
|
9195
9289
|
declare const sliderInactiveTrackVariants: (props?: ({
|
|
9196
9290
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9197
9291
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9198
|
-
disabled?: boolean | null | undefined;
|
|
9199
9292
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9200
9293
|
/**
|
|
9201
|
-
*
|
|
9294
|
+
* Visual handle (thumb indicator) element inside the React Aria thumb container.
|
|
9295
|
+
*
|
|
9296
|
+
* **Architecture**: This element lives inside the `group/slider-thumb` scope (the
|
|
9297
|
+
* RA-positioned thumb div). All interaction states are driven by
|
|
9298
|
+
* `group-data-[x]/slider-thumb:*` selectors — no CVA interaction-state variants.
|
|
9202
9299
|
*
|
|
9203
|
-
*
|
|
9204
|
-
*
|
|
9205
|
-
*
|
|
9206
|
-
* Width narrows to 2dp on press (md3 spec §9.3).
|
|
9207
|
-
* Motion: transition-[width] with duration-short2 + ease-standard applied conditionally
|
|
9208
|
-
* in Slider.tsx based on useReducedMotion() guard (MD3 Appendix E).
|
|
9300
|
+
* **Pressed width**: `group-data-[pressed]/slider-thumb:w-[2px]` (4dp → 2dp, MD3 spec)
|
|
9301
|
+
* **Motion**: `transition-[width]` with spring-standard-fast-spatial tokens.
|
|
9302
|
+
* Applied conditionally in `Slider.tsx` (suppressed for `useReducedMotion()`).
|
|
9209
9303
|
*/
|
|
9210
9304
|
declare const sliderHandleVariants: (props?: ({
|
|
9211
9305
|
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
9212
9306
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9213
|
-
pressed?: boolean | null | undefined;
|
|
9214
|
-
disabled?: boolean | null | undefined;
|
|
9215
9307
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9216
9308
|
/**
|
|
9217
|
-
*
|
|
9309
|
+
* State layer overlay on the handle (hover ripple).
|
|
9218
9310
|
*
|
|
9219
|
-
*
|
|
9220
|
-
* -
|
|
9221
|
-
*
|
|
9222
|
-
*
|
|
9223
|
-
*
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9228
|
-
/**
|
|
9229
|
-
* CVA for the track layout container (holds active track + handle + inactive track).
|
|
9311
|
+
* **Architecture**: Lives inside `group/slider-thumb`; opacity driven entirely
|
|
9312
|
+
* by `group-data-[x]/slider-thumb:opacity-*` selectors — no CVA state variant.
|
|
9313
|
+
*
|
|
9314
|
+
* State-layer opacities per MD3 spec:
|
|
9315
|
+
* - hover: 8% (`opacity-8`)
|
|
9316
|
+
* - focused: 10% (`opacity-10`)
|
|
9317
|
+
* - pressed: 10% (`opacity-10`)
|
|
9318
|
+
* - dragged: 16% (`opacity-16`) — note: drag = pressed in RA isDragging → data-pressed
|
|
9230
9319
|
*
|
|
9231
|
-
*
|
|
9232
|
-
*
|
|
9233
|
-
*
|
|
9234
|
-
* `relative` is required so the absolute stops overlay is positioned within.
|
|
9320
|
+
* **Motion**: `transition-opacity` with spring-standard-fast-effects tokens.
|
|
9321
|
+
* Always present; `@media prefers-reduced-motion` suppresses the transition at
|
|
9322
|
+
* the CSS level.
|
|
9235
9323
|
*/
|
|
9236
|
-
declare const
|
|
9237
|
-
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9238
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9324
|
+
declare const sliderHandleStateLayerVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9239
9325
|
|
|
9240
9326
|
/**
|
|
9241
9327
|
* Structural variant of the MD3 Bottom Sheet.
|