@tinybigui/react 0.10.0 → 0.11.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 +82 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -22
- package/dist/index.d.ts +76 -22
- package/dist/index.js +82 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -9192,6 +9192,22 @@ interface BottomSheetHandleProps {
|
|
|
9192
9192
|
*/
|
|
9193
9193
|
declare const BottomSheet: React$1.ForwardRefExoticComponent<BottomSheetProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
9194
9194
|
|
|
9195
|
+
/**
|
|
9196
|
+
* `BottomSheetHandle` — the draggable handle at the top of the Bottom Sheet.
|
|
9197
|
+
*
|
|
9198
|
+
* Implements the Variants-vs-States architecture used across TinyBigUI:
|
|
9199
|
+
* - Carries `group/handle` on its wrapper so child slots consume data-* selectors.
|
|
9200
|
+
* - Emits `getInteractionDataAttributes` for hover/focus/pressed states from React Aria.
|
|
9201
|
+
* - Emits `data-dragging` as a component-specific content flag (ternary encoding).
|
|
9202
|
+
* - Renders three slots inside the wrapper (stacked via absolute positioning):
|
|
9203
|
+
* 1. State layer — hover/focus/pressed/dragged opacity feedback (aria-hidden)
|
|
9204
|
+
* 2. Focus ring overlay — keyboard focus indicator (aria-hidden)
|
|
9205
|
+
* 3. Pill — the visible 32×4dp decoration (aria-hidden)
|
|
9206
|
+
*
|
|
9207
|
+
* Pointer and keyboard props are injected from `BottomSheetContext` (via `useBottomSheetDrag`).
|
|
9208
|
+
* React Aria `useHover` and `useFocusRing` are merged on top — they do not conflict with the
|
|
9209
|
+
* existing `onPointerDown`/`onPointerUp` drag handlers.
|
|
9210
|
+
*/
|
|
9195
9211
|
declare function BottomSheetHandle({ className, "aria-label": ariaLabelOverride, }: BottomSheetHandleProps): ReactElement;
|
|
9196
9212
|
declare namespace BottomSheetHandle {
|
|
9197
9213
|
var displayName: string;
|
|
@@ -9297,13 +9313,40 @@ interface UseBottomSheetDragReturn {
|
|
|
9297
9313
|
*/
|
|
9298
9314
|
declare function useBottomSheetDrag({ snapPoints, onSnapChange, onClose, }: UseBottomSheetDragOptions): UseBottomSheetDragReturn;
|
|
9299
9315
|
|
|
9316
|
+
/**
|
|
9317
|
+
* Material Design 3 Bottom Sheet Variants
|
|
9318
|
+
*
|
|
9319
|
+
* Architecture: Variants vs States
|
|
9320
|
+
* - CVA holds design-time structure only (no state variants, no state compoundVariants).
|
|
9321
|
+
* - The drag handle's interaction states are driven by data-* attributes on its wrapper
|
|
9322
|
+
* via group-data-[x]/handle Tailwind selectors in each slot's base classes.
|
|
9323
|
+
* - Content flags (data-dragging) are set explicitly by the component, not via helper.
|
|
9324
|
+
*
|
|
9325
|
+
* Slot responsibilities:
|
|
9326
|
+
* bottomSheetVariants — fixed container; surface, shape, elevation, snap spring
|
|
9327
|
+
* bottomSheetScrimVariants — modal scrim overlay; opacity fade (screen-level token)
|
|
9328
|
+
* bottomSheetAnimationVariants — enter/exit animation state machine classes
|
|
9329
|
+
* bottomSheetHandleWrapperVariants — 48dp touch target; carries `group/handle`; data-* host
|
|
9330
|
+
* bottomSheetHandleStateLayerVariants — hover/focus/pressed/dragged opacity ring around pill
|
|
9331
|
+
* bottomSheetHandleFocusRingVariants — keyboard focus outline overlay (opacity-driven)
|
|
9332
|
+
* bottomSheetHandlePillVariants — 32×4dp pill decoration; pointer-events-none
|
|
9333
|
+
*
|
|
9334
|
+
* MD3 Spec:
|
|
9335
|
+
* Container surface: surface-container-low, elevation level-1
|
|
9336
|
+
* Shape: extra-large top corners (28dp), square bottom (attached to screen edge)
|
|
9337
|
+
* Width: full width up to 640dp; centered at max-width 640dp on wider viewports
|
|
9338
|
+
* Top margin: 72dp default, 56dp when viewport > 640dp
|
|
9339
|
+
* Drag handle: 32dp × 4dp, on-surface-variant, centered, 22dp top/bottom padding → 48dp target
|
|
9340
|
+
* Scrim: bg-scrim, 32% opacity
|
|
9341
|
+
* State-layer opacities: hover 8% | focus 10% | pressed 10% | dragged 16%
|
|
9342
|
+
*/
|
|
9300
9343
|
/**
|
|
9301
9344
|
* CVA animation state variants for the Bottom Sheet panel.
|
|
9302
9345
|
*
|
|
9303
9346
|
* Motion decision rationale:
|
|
9304
9347
|
* - Bottom sheet is a standard-size component → `default` speed tier
|
|
9305
9348
|
* - Slides in/out of screen → composite `animate-md-*` utilities (not manual spring tokens)
|
|
9306
|
-
* - Scrim opacity is an effects property → `duration-short4 ease-standard` (legacy screen-level
|
|
9349
|
+
* - Scrim opacity is an effects property → `duration-short4 ease-standard` (legacy screen-level)
|
|
9307
9350
|
* - Snap spring is a spatial on-screen transition → `ease-spring-standard-default-spatial` +
|
|
9308
9351
|
* `duration-spring-standard-default-spatial` (applied in bottomSheetVariants base)
|
|
9309
9352
|
* - Standard personality (not expressive) — sheets are utility UI, not moments of delight
|
|
@@ -9313,53 +9356,64 @@ declare const bottomSheetAnimationVariants: (props?: ({
|
|
|
9313
9356
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9314
9357
|
type BottomSheetAnimationVariants = VariantProps<typeof bottomSheetAnimationVariants>;
|
|
9315
9358
|
/**
|
|
9316
|
-
*
|
|
9359
|
+
* Root container — the bottom sheet panel.
|
|
9317
9360
|
*
|
|
9318
9361
|
* MD3 tokens applied:
|
|
9319
9362
|
* - Surface: bg-surface-container-low
|
|
9320
9363
|
* - Elevation: shadow-elevation-1
|
|
9321
|
-
* - Shape: rounded-t-xl
|
|
9322
|
-
* - Width: full width up to 640dp
|
|
9323
|
-
*
|
|
9324
|
-
*
|
|
9325
|
-
*
|
|
9326
|
-
*
|
|
9327
|
-
*
|
|
9328
|
-
*
|
|
9364
|
+
* - Shape: extra-large top corners (28dp via rounded-t-xl), square bottom (attached to edge)
|
|
9365
|
+
* - Width: full width up to 640dp (mx-auto + w-[640px] max-w-full)
|
|
9366
|
+
* - Height: snap-point driven via inline style; constrained by max-height to enforce top margin
|
|
9367
|
+
* Default: 72dp top margin → max-h-[calc(100vh-72px)]
|
|
9368
|
+
* Wide (> 640dp): 56dp top margin → sm:max-h-[calc(100vh-56px)]
|
|
9369
|
+
* - Snap spring: spatial on-screen transition → spring-standard default spatial pair
|
|
9370
|
+
* data-[dragging]:transition-none suppresses spring during active drag (1:1 pointer tracking)
|
|
9371
|
+
*
|
|
9372
|
+
* NOTE: overflow-hidden clips content during height transitions. The handle's state layer and
|
|
9373
|
+
* focus-ring overlay are sized/positioned to fit within the wrapper, so they are not clipped.
|
|
9329
9374
|
*/
|
|
9330
9375
|
declare const bottomSheetVariants: (props?: ({
|
|
9331
9376
|
variant?: "standard" | "modal" | null | undefined;
|
|
9332
9377
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9333
9378
|
type BottomSheetVariants = VariantProps<typeof bottomSheetVariants>;
|
|
9334
9379
|
/**
|
|
9335
|
-
*
|
|
9380
|
+
* Scrim overlay (modal variant only).
|
|
9336
9381
|
*
|
|
9337
9382
|
* MD3 tokens applied:
|
|
9338
9383
|
* - bg-scrim: scrim surface role
|
|
9339
9384
|
* - opacity-32: 32% opacity per MD3 spec
|
|
9340
|
-
* - Transition: opacity fade (scrim is
|
|
9385
|
+
* - Transition: opacity fade (scrim is a screen-level effects property → legacy duration tokens)
|
|
9341
9386
|
*/
|
|
9342
9387
|
declare const bottomSheetScrimVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9343
9388
|
type BottomSheetScrimVariants = VariantProps<typeof bottomSheetScrimVariants>;
|
|
9344
9389
|
/**
|
|
9345
|
-
*
|
|
9390
|
+
* Drag handle wrapper — 48dp touch target area + group scope host.
|
|
9391
|
+
*
|
|
9392
|
+
* Carries `group/handle` so all handle child slots can consume data-* interaction
|
|
9393
|
+
* states via `group-data-[x]/handle:` Tailwind selectors without any CVA variant props.
|
|
9346
9394
|
*
|
|
9347
|
-
* MD3 spec:
|
|
9348
|
-
*
|
|
9395
|
+
* MD3 spec: 22dp top + 4dp handle + 22dp bottom = 48dp interaction zone.
|
|
9396
|
+
* NOTE: py-[22px] is a measurement-derived value from MD3 spec; permitted exception.
|
|
9397
|
+
*
|
|
9398
|
+
* `relative` provides positioning context for the state layer and focus ring overlays.
|
|
9399
|
+
* `focus-visible:outline-none` suppresses the browser default — the focus ring overlay
|
|
9400
|
+
* in `bottomSheetHandleFocusRingVariants` provides the MD3-spec visible indicator instead.
|
|
9349
9401
|
*/
|
|
9350
9402
|
declare const bottomSheetHandleWrapperVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9403
|
+
type BottomSheetHandleWrapperVariants = VariantProps<typeof bottomSheetHandleWrapperVariants>;
|
|
9351
9404
|
/**
|
|
9352
|
-
*
|
|
9405
|
+
* Drag handle pill — the visible 32×4dp decoration.
|
|
9353
9406
|
*
|
|
9354
9407
|
* MD3 tokens applied:
|
|
9355
|
-
* - bg-on-surface-variant: handle color
|
|
9356
|
-
* - w-8: 32dp
|
|
9357
|
-
* -
|
|
9358
|
-
*
|
|
9359
|
-
* -
|
|
9408
|
+
* - bg-on-surface-variant: handle color (muted, low-emphasis by role — no opacity override needed)
|
|
9409
|
+
* - w-8 / h-1: 32dp × 4dp per MD3 spec (measurement-derived; permitted exception)
|
|
9410
|
+
* - rounded-full: fully-rounded pill shape
|
|
9411
|
+
*
|
|
9412
|
+
* `pointer-events-none` — all interaction is handled by the wrapper.
|
|
9413
|
+
* `relative z-10` — renders above the state layer overlay.
|
|
9360
9414
|
*/
|
|
9361
9415
|
declare const bottomSheetHandlePillVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9362
|
-
type BottomSheetHandleVariants =
|
|
9416
|
+
type BottomSheetHandleVariants = BottomSheetHandleWrapperVariants;
|
|
9363
9417
|
|
|
9364
9418
|
/**
|
|
9365
9419
|
* Variant of the MD3 Time Picker.
|
package/dist/index.d.ts
CHANGED
|
@@ -9192,6 +9192,22 @@ interface BottomSheetHandleProps {
|
|
|
9192
9192
|
*/
|
|
9193
9193
|
declare const BottomSheet: React$1.ForwardRefExoticComponent<BottomSheetProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
9194
9194
|
|
|
9195
|
+
/**
|
|
9196
|
+
* `BottomSheetHandle` — the draggable handle at the top of the Bottom Sheet.
|
|
9197
|
+
*
|
|
9198
|
+
* Implements the Variants-vs-States architecture used across TinyBigUI:
|
|
9199
|
+
* - Carries `group/handle` on its wrapper so child slots consume data-* selectors.
|
|
9200
|
+
* - Emits `getInteractionDataAttributes` for hover/focus/pressed states from React Aria.
|
|
9201
|
+
* - Emits `data-dragging` as a component-specific content flag (ternary encoding).
|
|
9202
|
+
* - Renders three slots inside the wrapper (stacked via absolute positioning):
|
|
9203
|
+
* 1. State layer — hover/focus/pressed/dragged opacity feedback (aria-hidden)
|
|
9204
|
+
* 2. Focus ring overlay — keyboard focus indicator (aria-hidden)
|
|
9205
|
+
* 3. Pill — the visible 32×4dp decoration (aria-hidden)
|
|
9206
|
+
*
|
|
9207
|
+
* Pointer and keyboard props are injected from `BottomSheetContext` (via `useBottomSheetDrag`).
|
|
9208
|
+
* React Aria `useHover` and `useFocusRing` are merged on top — they do not conflict with the
|
|
9209
|
+
* existing `onPointerDown`/`onPointerUp` drag handlers.
|
|
9210
|
+
*/
|
|
9195
9211
|
declare function BottomSheetHandle({ className, "aria-label": ariaLabelOverride, }: BottomSheetHandleProps): ReactElement;
|
|
9196
9212
|
declare namespace BottomSheetHandle {
|
|
9197
9213
|
var displayName: string;
|
|
@@ -9297,13 +9313,40 @@ interface UseBottomSheetDragReturn {
|
|
|
9297
9313
|
*/
|
|
9298
9314
|
declare function useBottomSheetDrag({ snapPoints, onSnapChange, onClose, }: UseBottomSheetDragOptions): UseBottomSheetDragReturn;
|
|
9299
9315
|
|
|
9316
|
+
/**
|
|
9317
|
+
* Material Design 3 Bottom Sheet Variants
|
|
9318
|
+
*
|
|
9319
|
+
* Architecture: Variants vs States
|
|
9320
|
+
* - CVA holds design-time structure only (no state variants, no state compoundVariants).
|
|
9321
|
+
* - The drag handle's interaction states are driven by data-* attributes on its wrapper
|
|
9322
|
+
* via group-data-[x]/handle Tailwind selectors in each slot's base classes.
|
|
9323
|
+
* - Content flags (data-dragging) are set explicitly by the component, not via helper.
|
|
9324
|
+
*
|
|
9325
|
+
* Slot responsibilities:
|
|
9326
|
+
* bottomSheetVariants — fixed container; surface, shape, elevation, snap spring
|
|
9327
|
+
* bottomSheetScrimVariants — modal scrim overlay; opacity fade (screen-level token)
|
|
9328
|
+
* bottomSheetAnimationVariants — enter/exit animation state machine classes
|
|
9329
|
+
* bottomSheetHandleWrapperVariants — 48dp touch target; carries `group/handle`; data-* host
|
|
9330
|
+
* bottomSheetHandleStateLayerVariants — hover/focus/pressed/dragged opacity ring around pill
|
|
9331
|
+
* bottomSheetHandleFocusRingVariants — keyboard focus outline overlay (opacity-driven)
|
|
9332
|
+
* bottomSheetHandlePillVariants — 32×4dp pill decoration; pointer-events-none
|
|
9333
|
+
*
|
|
9334
|
+
* MD3 Spec:
|
|
9335
|
+
* Container surface: surface-container-low, elevation level-1
|
|
9336
|
+
* Shape: extra-large top corners (28dp), square bottom (attached to screen edge)
|
|
9337
|
+
* Width: full width up to 640dp; centered at max-width 640dp on wider viewports
|
|
9338
|
+
* Top margin: 72dp default, 56dp when viewport > 640dp
|
|
9339
|
+
* Drag handle: 32dp × 4dp, on-surface-variant, centered, 22dp top/bottom padding → 48dp target
|
|
9340
|
+
* Scrim: bg-scrim, 32% opacity
|
|
9341
|
+
* State-layer opacities: hover 8% | focus 10% | pressed 10% | dragged 16%
|
|
9342
|
+
*/
|
|
9300
9343
|
/**
|
|
9301
9344
|
* CVA animation state variants for the Bottom Sheet panel.
|
|
9302
9345
|
*
|
|
9303
9346
|
* Motion decision rationale:
|
|
9304
9347
|
* - Bottom sheet is a standard-size component → `default` speed tier
|
|
9305
9348
|
* - Slides in/out of screen → composite `animate-md-*` utilities (not manual spring tokens)
|
|
9306
|
-
* - Scrim opacity is an effects property → `duration-short4 ease-standard` (legacy screen-level
|
|
9349
|
+
* - Scrim opacity is an effects property → `duration-short4 ease-standard` (legacy screen-level)
|
|
9307
9350
|
* - Snap spring is a spatial on-screen transition → `ease-spring-standard-default-spatial` +
|
|
9308
9351
|
* `duration-spring-standard-default-spatial` (applied in bottomSheetVariants base)
|
|
9309
9352
|
* - Standard personality (not expressive) — sheets are utility UI, not moments of delight
|
|
@@ -9313,53 +9356,64 @@ declare const bottomSheetAnimationVariants: (props?: ({
|
|
|
9313
9356
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9314
9357
|
type BottomSheetAnimationVariants = VariantProps<typeof bottomSheetAnimationVariants>;
|
|
9315
9358
|
/**
|
|
9316
|
-
*
|
|
9359
|
+
* Root container — the bottom sheet panel.
|
|
9317
9360
|
*
|
|
9318
9361
|
* MD3 tokens applied:
|
|
9319
9362
|
* - Surface: bg-surface-container-low
|
|
9320
9363
|
* - Elevation: shadow-elevation-1
|
|
9321
|
-
* - Shape: rounded-t-xl
|
|
9322
|
-
* - Width: full width up to 640dp
|
|
9323
|
-
*
|
|
9324
|
-
*
|
|
9325
|
-
*
|
|
9326
|
-
*
|
|
9327
|
-
*
|
|
9328
|
-
*
|
|
9364
|
+
* - Shape: extra-large top corners (28dp via rounded-t-xl), square bottom (attached to edge)
|
|
9365
|
+
* - Width: full width up to 640dp (mx-auto + w-[640px] max-w-full)
|
|
9366
|
+
* - Height: snap-point driven via inline style; constrained by max-height to enforce top margin
|
|
9367
|
+
* Default: 72dp top margin → max-h-[calc(100vh-72px)]
|
|
9368
|
+
* Wide (> 640dp): 56dp top margin → sm:max-h-[calc(100vh-56px)]
|
|
9369
|
+
* - Snap spring: spatial on-screen transition → spring-standard default spatial pair
|
|
9370
|
+
* data-[dragging]:transition-none suppresses spring during active drag (1:1 pointer tracking)
|
|
9371
|
+
*
|
|
9372
|
+
* NOTE: overflow-hidden clips content during height transitions. The handle's state layer and
|
|
9373
|
+
* focus-ring overlay are sized/positioned to fit within the wrapper, so they are not clipped.
|
|
9329
9374
|
*/
|
|
9330
9375
|
declare const bottomSheetVariants: (props?: ({
|
|
9331
9376
|
variant?: "standard" | "modal" | null | undefined;
|
|
9332
9377
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9333
9378
|
type BottomSheetVariants = VariantProps<typeof bottomSheetVariants>;
|
|
9334
9379
|
/**
|
|
9335
|
-
*
|
|
9380
|
+
* Scrim overlay (modal variant only).
|
|
9336
9381
|
*
|
|
9337
9382
|
* MD3 tokens applied:
|
|
9338
9383
|
* - bg-scrim: scrim surface role
|
|
9339
9384
|
* - opacity-32: 32% opacity per MD3 spec
|
|
9340
|
-
* - Transition: opacity fade (scrim is
|
|
9385
|
+
* - Transition: opacity fade (scrim is a screen-level effects property → legacy duration tokens)
|
|
9341
9386
|
*/
|
|
9342
9387
|
declare const bottomSheetScrimVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9343
9388
|
type BottomSheetScrimVariants = VariantProps<typeof bottomSheetScrimVariants>;
|
|
9344
9389
|
/**
|
|
9345
|
-
*
|
|
9390
|
+
* Drag handle wrapper — 48dp touch target area + group scope host.
|
|
9391
|
+
*
|
|
9392
|
+
* Carries `group/handle` so all handle child slots can consume data-* interaction
|
|
9393
|
+
* states via `group-data-[x]/handle:` Tailwind selectors without any CVA variant props.
|
|
9346
9394
|
*
|
|
9347
|
-
* MD3 spec:
|
|
9348
|
-
*
|
|
9395
|
+
* MD3 spec: 22dp top + 4dp handle + 22dp bottom = 48dp interaction zone.
|
|
9396
|
+
* NOTE: py-[22px] is a measurement-derived value from MD3 spec; permitted exception.
|
|
9397
|
+
*
|
|
9398
|
+
* `relative` provides positioning context for the state layer and focus ring overlays.
|
|
9399
|
+
* `focus-visible:outline-none` suppresses the browser default — the focus ring overlay
|
|
9400
|
+
* in `bottomSheetHandleFocusRingVariants` provides the MD3-spec visible indicator instead.
|
|
9349
9401
|
*/
|
|
9350
9402
|
declare const bottomSheetHandleWrapperVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9403
|
+
type BottomSheetHandleWrapperVariants = VariantProps<typeof bottomSheetHandleWrapperVariants>;
|
|
9351
9404
|
/**
|
|
9352
|
-
*
|
|
9405
|
+
* Drag handle pill — the visible 32×4dp decoration.
|
|
9353
9406
|
*
|
|
9354
9407
|
* MD3 tokens applied:
|
|
9355
|
-
* - bg-on-surface-variant: handle color
|
|
9356
|
-
* - w-8: 32dp
|
|
9357
|
-
* -
|
|
9358
|
-
*
|
|
9359
|
-
* -
|
|
9408
|
+
* - bg-on-surface-variant: handle color (muted, low-emphasis by role — no opacity override needed)
|
|
9409
|
+
* - w-8 / h-1: 32dp × 4dp per MD3 spec (measurement-derived; permitted exception)
|
|
9410
|
+
* - rounded-full: fully-rounded pill shape
|
|
9411
|
+
*
|
|
9412
|
+
* `pointer-events-none` — all interaction is handled by the wrapper.
|
|
9413
|
+
* `relative z-10` — renders above the state layer overlay.
|
|
9360
9414
|
*/
|
|
9361
9415
|
declare const bottomSheetHandlePillVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
9362
|
-
type BottomSheetHandleVariants =
|
|
9416
|
+
type BottomSheetHandleVariants = BottomSheetHandleWrapperVariants;
|
|
9363
9417
|
|
|
9364
9418
|
/**
|
|
9365
9419
|
* Variant of the MD3 Time Picker.
|
package/dist/index.js
CHANGED
|
@@ -11155,7 +11155,7 @@ var BottomSheetModalPanel = ({
|
|
|
11155
11155
|
"aria-modal": "true",
|
|
11156
11156
|
className: cn(className, getAnimationClassName?.(animationState)),
|
|
11157
11157
|
"data-animation-state": animationState,
|
|
11158
|
-
"data-dragging": isDragging
|
|
11158
|
+
"data-dragging": isDragging ? "" : void 0,
|
|
11159
11159
|
style: panelStyle,
|
|
11160
11160
|
onTransitionEnd,
|
|
11161
11161
|
children
|
|
@@ -11292,7 +11292,7 @@ var BottomSheetHeadless = forwardRef(
|
|
|
11292
11292
|
ref,
|
|
11293
11293
|
className: cn(className, getAnimationClassName?.(animationState)),
|
|
11294
11294
|
"data-animation-state": animationState,
|
|
11295
|
-
"data-dragging": isDragging
|
|
11295
|
+
"data-dragging": isDragging ? "" : void 0,
|
|
11296
11296
|
style: panelStyle,
|
|
11297
11297
|
onTransitionEnd: handleTransitionEnd,
|
|
11298
11298
|
children
|
|
@@ -11307,7 +11307,6 @@ var bottomSheetAnimationVariants = cva("", {
|
|
|
11307
11307
|
variants: {
|
|
11308
11308
|
animationState: {
|
|
11309
11309
|
// entering: initial mount frame — sheet starts below viewport (translateY(100%))
|
|
11310
|
-
// The CSS is handled inside animate-md-slide-in-bottom keyframes
|
|
11311
11310
|
entering: ["opacity-0"],
|
|
11312
11311
|
// visible: entry animation active — animate-md-slide-in-bottom runs once
|
|
11313
11312
|
visible: ["animate-md-slide-in-bottom"],
|
|
@@ -11324,52 +11323,38 @@ var bottomSheetAnimationVariants = cva("", {
|
|
|
11324
11323
|
var bottomSheetVariants = cva(
|
|
11325
11324
|
[
|
|
11326
11325
|
// Position: fixed to bottom edge, full width
|
|
11327
|
-
"fixed",
|
|
11328
|
-
"bottom-0",
|
|
11329
|
-
"left-0",
|
|
11330
|
-
"right-0",
|
|
11326
|
+
"fixed bottom-0 left-0 right-0",
|
|
11331
11327
|
// Surface token
|
|
11332
11328
|
"bg-surface-container-low",
|
|
11333
11329
|
// Elevation level 1 per MD3 spec
|
|
11334
11330
|
"shadow-elevation-1",
|
|
11335
|
-
// Shape: extra-large top corners (28dp), bottom
|
|
11331
|
+
// Shape: extra-large top corners (28dp), square bottom (screen-attached)
|
|
11332
|
+
// NOTE: measurement-derived value from MD3 spec; permitted exception per component-variants rule
|
|
11336
11333
|
"rounded-t-xl",
|
|
11337
11334
|
// Layout
|
|
11338
|
-
"flex",
|
|
11339
|
-
|
|
11340
|
-
// Max width constraint (full width up to 640dp)
|
|
11335
|
+
"flex flex-col",
|
|
11336
|
+
// Width constraint (full width up to 640dp)
|
|
11341
11337
|
"mx-auto",
|
|
11342
11338
|
// NOTE: measurement-derived value from MD3 spec; permitted exception
|
|
11343
11339
|
"w-[640px] max-w-full",
|
|
11344
|
-
// Clip content during height transitions
|
|
11340
|
+
// Clip content during height transitions
|
|
11345
11341
|
"overflow-hidden",
|
|
11346
|
-
//
|
|
11347
|
-
// Standard personality, default speed tier, spatial: no overshoot.
|
|
11348
|
-
// During drag, data-[dragging=true]:transition-none suppresses this so the
|
|
11349
|
-
// sheet height follows the pointer 1:1 without transition lag.
|
|
11350
|
-
// After drag release, the spring transition animates height to the new snap position.
|
|
11342
|
+
// Snap spring: spatial property (height), standard personality, default tier
|
|
11351
11343
|
"transition-[height]",
|
|
11352
11344
|
"duration-spring-standard-default-spatial",
|
|
11353
11345
|
"ease-spring-standard-default-spatial",
|
|
11354
|
-
|
|
11346
|
+
// Suppress spring while dragging so the sheet follows the pointer 1:1
|
|
11347
|
+
"data-[dragging]:transition-none",
|
|
11355
11348
|
"will-change-[height]",
|
|
11356
|
-
// Responsive layout:
|
|
11357
|
-
// The sheet remains bottom-anchored at all sizes. Side centering is handled by
|
|
11358
|
-
// mx-auto + max-w-[640px] — at 752dp viewport this naturally produces 56dp side
|
|
11359
|
-
// margins on each side (exactly matching MD3 measurements).
|
|
11360
|
-
// Top margin is expressed as max-height so the sheet cannot overlap the top edge:
|
|
11361
|
-
// - Default: 72dp top margin (max-h-[calc(100vh-72px)])
|
|
11362
|
-
// - Wide viewport (> 640dp): 56dp top margin (sm:max-h-[calc(100vh-56px)])
|
|
11349
|
+
// Responsive layout: top margin expressed as max-height
|
|
11363
11350
|
// NOTE: measurement-derived values from MD3 spec; permitted exception
|
|
11364
11351
|
"max-h-[calc(100vh-72px)]",
|
|
11365
|
-
"sm:max-h-[calc(100vh-56px)]"
|
|
11366
|
-
// Top corners rounded at wide layout (sheet floats away from screen edge)
|
|
11367
|
-
"rounded-t-xl"
|
|
11352
|
+
"sm:max-h-[calc(100vh-56px)]"
|
|
11368
11353
|
],
|
|
11369
11354
|
{
|
|
11370
11355
|
variants: {
|
|
11371
11356
|
variant: {
|
|
11372
|
-
// Modal: above scrim (z-50)
|
|
11357
|
+
// Modal: rendered above the scrim (z-50)
|
|
11373
11358
|
modal: "z-50",
|
|
11374
11359
|
// Standard: sits above normal content but below overlays
|
|
11375
11360
|
standard: "z-10"
|
|
@@ -11381,62 +11366,96 @@ var bottomSheetVariants = cva(
|
|
|
11381
11366
|
}
|
|
11382
11367
|
);
|
|
11383
11368
|
var bottomSheetScrimVariants = cva([
|
|
11384
|
-
"fixed",
|
|
11385
|
-
"
|
|
11386
|
-
|
|
11387
|
-
"
|
|
11388
|
-
"opacity-32",
|
|
11389
|
-
"transition-opacity",
|
|
11390
|
-
"duration-short4",
|
|
11391
|
-
"ease-standard"
|
|
11369
|
+
"fixed inset-0 z-40",
|
|
11370
|
+
"bg-scrim opacity-32",
|
|
11371
|
+
// Screen-level effects transition (scrim enters/exits the screen, not an on-screen state change)
|
|
11372
|
+
"transition-opacity duration-short4 ease-standard"
|
|
11392
11373
|
]);
|
|
11393
11374
|
var bottomSheetHandleWrapperVariants = cva([
|
|
11394
|
-
// Center the
|
|
11395
|
-
"flex",
|
|
11396
|
-
|
|
11397
|
-
"justify-center",
|
|
11398
|
-
// Top/bottom padding creates the 48dp touch target area
|
|
11399
|
-
// 22dp top + 4dp handle + 22dp bottom ≈ 48dp interaction zone (per MD3 measurements)
|
|
11375
|
+
// Center the pill horizontally; provide positioning context for overlays
|
|
11376
|
+
"relative flex items-center justify-center w-full",
|
|
11377
|
+
// 48dp touch target (22dp top + 4dp pill + 22dp bottom)
|
|
11400
11378
|
// NOTE: measurement-derived value from MD3 spec; permitted exception
|
|
11401
11379
|
"py-[22px]",
|
|
11402
|
-
//
|
|
11403
|
-
"w-full",
|
|
11404
|
-
// Focus ring styling for keyboard/switch navigation
|
|
11405
|
-
// MD3 spec: focus indicator color = secondary, thickness = 3dp, offset = 2dp
|
|
11380
|
+
// Suppress browser default focus outline — the focus-ring overlay slot handles it
|
|
11406
11381
|
"focus-visible:outline-none",
|
|
11407
|
-
|
|
11408
|
-
"focus-visible:ring-secondary",
|
|
11409
|
-
"focus-visible:ring-offset-2",
|
|
11410
|
-
"focus-visible:rounded-sm",
|
|
11411
|
-
// Cursor affordance
|
|
11382
|
+
// Cursor affordance for drag interaction
|
|
11412
11383
|
"cursor-ns-resize"
|
|
11413
11384
|
]);
|
|
11385
|
+
var bottomSheetHandleStateLayerVariants = cva([
|
|
11386
|
+
// Overlay positioned centrally — sits behind the pill
|
|
11387
|
+
"absolute pointer-events-none",
|
|
11388
|
+
// Pill-shaped to complement the handle's form
|
|
11389
|
+
"rounded-full",
|
|
11390
|
+
// Sized wider than the pill to provide a visible state layer halo
|
|
11391
|
+
// 48dp wide × 16dp tall — centred by the flex wrapper
|
|
11392
|
+
"w-12 h-4",
|
|
11393
|
+
// State-layer color (same role as the pill)
|
|
11394
|
+
"bg-on-surface-variant",
|
|
11395
|
+
// Effects transition — opacity must NOT overshoot
|
|
11396
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
11397
|
+
// Opacity at rest
|
|
11398
|
+
"opacity-0",
|
|
11399
|
+
// Hover: 8%
|
|
11400
|
+
"group-data-[hovered]/handle:opacity-8",
|
|
11401
|
+
// Focus-visible: 10%
|
|
11402
|
+
"group-data-[focus-visible]/handle:opacity-10",
|
|
11403
|
+
// Pressed: 10% (doubled selector wins over hover at same cascade position)
|
|
11404
|
+
"group-data-[pressed]/handle:group-data-[pressed]/handle:opacity-10",
|
|
11405
|
+
// Dragging: 16% (MD3 dragged state — highest on-screen opacity)
|
|
11406
|
+
// Doubled selector wins over hover + pressed
|
|
11407
|
+
"group-data-[dragging]/handle:group-data-[dragging]/handle:opacity-16"
|
|
11408
|
+
]);
|
|
11409
|
+
var bottomSheetHandleFocusRingVariants = cva([
|
|
11410
|
+
"absolute pointer-events-none",
|
|
11411
|
+
"rounded-full",
|
|
11412
|
+
// Sized to sit around the state layer halo
|
|
11413
|
+
"w-14 h-5",
|
|
11414
|
+
// MD3 focus indicator: secondary color, 2dp weight
|
|
11415
|
+
"outline outline-2 outline-offset-0 outline-secondary",
|
|
11416
|
+
// Effects transition — opacity change must NOT overshoot
|
|
11417
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
11418
|
+
// Hidden at rest; shown on keyboard/programmatic focus
|
|
11419
|
+
"opacity-0",
|
|
11420
|
+
"group-data-[focus-visible]/handle:opacity-100"
|
|
11421
|
+
]);
|
|
11414
11422
|
var bottomSheetHandlePillVariants = cva([
|
|
11423
|
+
"relative z-10 pointer-events-none",
|
|
11415
11424
|
"bg-on-surface-variant",
|
|
11416
|
-
"opacity-40",
|
|
11417
11425
|
"rounded-full",
|
|
11418
11426
|
// Dimensions: 32dp × 4dp per MD3 spec (measurement-derived; permitted exception)
|
|
11419
11427
|
"w-8",
|
|
11420
|
-
// 32dp = 2rem
|
|
11421
|
-
"h-1"
|
|
11422
|
-
// 4dp
|
|
11423
|
-
// Pill itself is decorative; the wrapper handles interaction
|
|
11424
|
-
"pointer-events-none"
|
|
11428
|
+
// 32dp = 2rem
|
|
11429
|
+
"h-1"
|
|
11430
|
+
// 4dp = 0.25rem
|
|
11425
11431
|
]);
|
|
11426
11432
|
function BottomSheetHandle({
|
|
11427
11433
|
className,
|
|
11428
11434
|
"aria-label": ariaLabelOverride
|
|
11429
11435
|
}) {
|
|
11430
11436
|
const { handleProps, isDragging } = useBottomSheetContext();
|
|
11431
|
-
|
|
11437
|
+
const { isHovered, hoverProps } = useHover({});
|
|
11438
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
11439
|
+
const mergedHandleProps = mergeProps$1(handleProps, hoverProps, focusProps);
|
|
11440
|
+
return /* @__PURE__ */ jsxs(
|
|
11432
11441
|
"div",
|
|
11433
11442
|
{
|
|
11434
|
-
...
|
|
11443
|
+
...mergedHandleProps,
|
|
11435
11444
|
...ariaLabelOverride !== void 0 ? { "aria-label": ariaLabelOverride } : {},
|
|
11436
|
-
className: cn(bottomSheetHandleWrapperVariants(), className),
|
|
11445
|
+
className: cn(bottomSheetHandleWrapperVariants(), "group/handle", className),
|
|
11437
11446
|
"data-testid": "bottom-sheet-handle",
|
|
11438
|
-
|
|
11439
|
-
|
|
11447
|
+
...getInteractionDataAttributes({
|
|
11448
|
+
isHovered,
|
|
11449
|
+
isFocusVisible,
|
|
11450
|
+
// Treat active drag as pressed — drives the state layer to 10% opacity
|
|
11451
|
+
isPressed: isDragging
|
|
11452
|
+
}),
|
|
11453
|
+
"data-dragging": isDragging ? "" : void 0,
|
|
11454
|
+
children: [
|
|
11455
|
+
/* @__PURE__ */ jsx("span", { className: cn(bottomSheetHandleStateLayerVariants()), "aria-hidden": "true" }),
|
|
11456
|
+
/* @__PURE__ */ jsx("span", { className: cn(bottomSheetHandleFocusRingVariants()), "aria-hidden": "true" }),
|
|
11457
|
+
/* @__PURE__ */ jsx("span", { className: cn(bottomSheetHandlePillVariants()), "aria-hidden": "true" })
|
|
11458
|
+
]
|
|
11440
11459
|
}
|
|
11441
11460
|
);
|
|
11442
11461
|
}
|