@tinybigui/react 0.8.1 → 0.9.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/dist/index.d.cts CHANGED
@@ -5690,21 +5690,22 @@ declare function SnackbarProvider({ children, maxVisible }: SnackbarProviderProp
5690
5690
  /**
5691
5691
  * The four MD3 chip types, each with distinct interaction semantics.
5692
5692
  *
5693
- * - `assist` – triggers an action (e.g. "Set alarm")
5694
- * - `filter` – toggles a filter on/off (`aria-pressed`)
5695
- * - `input` – represents a value the user entered; can be removed
5693
+ * - `assist` – triggers an action (e.g. "Set alarm")
5694
+ * - `filter` – toggles a filter on/off (`aria-pressed`)
5695
+ * - `input` – represents a value the user entered; can be removed
5696
5696
  * - `suggestion` – offers a contextual suggestion (acts like assist)
5697
5697
  */
5698
5698
  type ChipType = "assist" | "filter" | "input" | "suggestion";
5699
5699
  /**
5700
- * Surface style for Assist and Suggestion chips.
5700
+ * Surface style for chips.
5701
5701
  *
5702
- * - `tonal` uses secondary-container fill (default)
5703
- * - `elevated` – uses surface-container-low fill with elevation shadow
5702
+ * - `flat` transparent container with outline border (MD3 default)
5703
+ * - `elevated` – `surface-container-low` fill with elevation shadow; all four chip types support this
5704
+ * - `tonal` – @deprecated Use `flat` instead. Will be removed in a future minor version.
5704
5705
  *
5705
- * @default 'tonal'
5706
+ * @default 'flat'
5706
5707
  */
5707
- type ChipSurface = "tonal" | "elevated";
5708
+ type ChipSurface = "flat" | "elevated" | "tonal";
5708
5709
  /**
5709
5710
  * Material Design 3 Chip Component Props
5710
5711
  *
@@ -5736,8 +5737,13 @@ interface ChipProps {
5736
5737
  */
5737
5738
  label: string;
5738
5739
  /**
5739
- * Surface style (Assist and Suggestion chips only).
5740
- * @default 'tonal'
5740
+ * Surface style applied to the chip.
5741
+ *
5742
+ * - `flat` (default) — transparent container with outline border per MD3 spec.
5743
+ * - `elevated` — `surface-container-low` fill + elevation shadow; works with all chip types.
5744
+ * - `tonal` — @deprecated alias for `flat`; logs a console.warn in development.
5745
+ *
5746
+ * @default 'flat'
5741
5747
  */
5742
5748
  surface?: ChipSurface;
5743
5749
  /**
@@ -5762,6 +5768,11 @@ interface ChipProps {
5762
5768
  onRemove?: () => void;
5763
5769
  /**
5764
5770
  * Icon rendered before the label.
5771
+ * Color follows the MD3 spec per chip type:
5772
+ * - assist → `text-primary`
5773
+ * - filter (unselected) → `text-on-surface-variant`; (selected) → `text-on-secondary-container`
5774
+ * - input → `text-on-surface-variant`
5775
+ * - suggestion → `text-on-surface-variant`
5765
5776
  */
5766
5777
  leadingIcon?: React__default.ReactNode;
5767
5778
  /**
@@ -5778,6 +5789,53 @@ interface ChipProps {
5778
5789
  */
5779
5790
  className?: string;
5780
5791
  }
5792
+ /**
5793
+ * Props passed through to the chip body element (button) in ChipHeadless.
5794
+ * Allows the styled layer to inject data-* interaction attributes and
5795
+ * merged hover/focus event handlers.
5796
+ */
5797
+ interface ChipBodyPassthroughProps {
5798
+ /**
5799
+ * Merged hover/focus/press event handlers from the styled layer.
5800
+ * Spread onto the body <button>.
5801
+ */
5802
+ eventHandlers?: Record<string, unknown>;
5803
+ /**
5804
+ * data-* interaction attributes emitted by getInteractionDataAttributes.
5805
+ * Spread onto the body <button>.
5806
+ */
5807
+ dataAttributes?: Record<string, string | undefined>;
5808
+ /**
5809
+ * onPressStart forwarded into useButton/useToggleButton for isPressed tracking.
5810
+ */
5811
+ onPressStart?: () => void;
5812
+ /**
5813
+ * onPressEnd forwarded into useButton/useToggleButton for isPressed tracking.
5814
+ */
5815
+ onPressEnd?: () => void;
5816
+ }
5817
+ /**
5818
+ * Props passed through to the remove button element in InputChipImpl.
5819
+ */
5820
+ interface ChipRemovePassthroughProps {
5821
+ /**
5822
+ * data-* interaction attributes for the remove button.
5823
+ */
5824
+ dataAttributes?: Record<string, string | undefined>;
5825
+ /**
5826
+ * Merged hover/focus event handlers from useHover + useFocusRing.
5827
+ * Spread onto the remove <button> alongside React Aria's buttonProps.
5828
+ */
5829
+ eventHandlers?: Record<string, unknown>;
5830
+ /**
5831
+ * onPressStart for remove button isPressed tracking.
5832
+ */
5833
+ onPressStart?: () => void;
5834
+ /**
5835
+ * onPressEnd for remove button isPressed tracking.
5836
+ */
5837
+ onPressEnd?: () => void;
5838
+ }
5781
5839
  /**
5782
5840
  * Props for the headless ChipHeadless component (Layer 2).
5783
5841
  *
@@ -5827,7 +5885,7 @@ interface ChipHeadlessProps {
5827
5885
  */
5828
5886
  isDisabled?: boolean;
5829
5887
  /**
5830
- * Additional CSS classes (Tailwind).
5888
+ * Additional CSS classes applied to the chip body button.
5831
5889
  */
5832
5890
  className?: string;
5833
5891
  /**
@@ -5836,7 +5894,7 @@ interface ChipHeadlessProps {
5836
5894
  children?: React__default.ReactNode;
5837
5895
  /**
5838
5896
  * Icon rendered inside the remove button (Input chips only).
5839
- * Typically an ×/close SVG.
5897
+ * Typically an ×/close SVG wrapped in a fragment with a state layer span.
5840
5898
  */
5841
5899
  removeIcon?: React__default.ReactNode;
5842
5900
  /**
@@ -5848,6 +5906,16 @@ interface ChipHeadlessProps {
5848
5906
  * Used by the styled layer to trigger the ripple effect.
5849
5907
  */
5850
5908
  onMouseDown?: React__default.MouseEventHandler<HTMLButtonElement>;
5909
+ /**
5910
+ * Interaction data attributes + merged handlers from the styled layer.
5911
+ * Spread onto the body <button> to enable group-data-[x]/chip slot selectors.
5912
+ */
5913
+ bodyPassthrough?: ChipBodyPassthroughProps;
5914
+ /**
5915
+ * Interaction data attributes + handlers for the remove button (Input chips only).
5916
+ * Spread onto the remove <button>.
5917
+ */
5918
+ removePassthrough?: ChipRemovePassthroughProps;
5851
5919
  }
5852
5920
  /**
5853
5921
  * Props for the ChipSet container component.
@@ -5879,6 +5947,10 @@ interface ChipSetProps {
5879
5947
  * Unstyled chip primitive covering all four MD3 chip types. Delegates to the
5880
5948
  * correct React Aria hook per `type` — bring your own styles.
5881
5949
  *
5950
+ * The styled layer (Chip.tsx) passes `bodyPassthrough` to inject data-* interaction
5951
+ * attributes and merged hover/focus handlers onto the body button, enabling the
5952
+ * group-data-[x]/chip slot selectors defined in Chip.variants.ts.
5953
+ *
5882
5954
  * | type | Hook | Key behaviour |
5883
5955
  * |------------- |-----------------------------------------|----------------------------------|
5884
5956
  * | `assist` | `useButton` | Enter/Space → `onPress` |
@@ -5908,18 +5980,33 @@ declare const ChipHeadless: React$1.ForwardRefExoticComponent<ChipHeadlessProps
5908
5980
  *
5909
5981
  * Unified styled chip covering all four MD3 chip types.
5910
5982
  * Built on `ChipHeadless` for world-class accessibility via React Aria.
5911
- * Uses CVA for type-safe variant management.
5912
5983
  *
5913
- * | Type | Surface | Selection | Remove |
5914
- * |--------------|---------------|-----------|--------|
5915
- * | `assist` | tonal/elevated | | — |
5916
- * | `filter` | fixed tonal | ✅ | — |
5917
- * | `input` | fixed tonal | — | ✅ |
5918
- * | `suggestion` | tonal/elevated | — | — |
5984
+ * Implements the Variants-vs-States architecture: all interaction/selection
5985
+ * states are expressed as `data-*` attributes on the root and consumed by each
5986
+ * slot via `group-data-[x]/chip` Tailwind selectorsno state variants in CVA.
5987
+ *
5988
+ * Features:
5989
+ * - 4 MD3 chip types: assist, filter, input, suggestion
5990
+ * - ✅ 2 surfaces: flat (transparent + outline), elevated (shadow + fill)
5991
+ * - ✅ MD3-correct per-type icon colors (assist leading = primary, etc.)
5992
+ * - ✅ Filter chip checkmark with spring animation
5993
+ * - ✅ Input chip removal with animate-md-fade-out
5994
+ * - ✅ Proper MD3 state layer (hover 8%, focus 10%, pressed 10%)
5995
+ * - ✅ Spring motion tokens (no hardcoded durations)
5996
+ * - ✅ Dedicated focus ring slot (outside overflow-hidden)
5997
+ * - ✅ Full keyboard accessibility (via React Aria)
5998
+ * - ✅ Deprecated `surface="tonal"` — warns and maps to `flat`
5999
+ *
6000
+ * MD3 Specifications:
6001
+ * - Height: 32dp (h-8), corner-small 8dp (rounded-sm)
6002
+ * - Padding: 16dp base; 8dp leading side when icon present
6003
+ * - Icon size: 18px × 18px
6004
+ * - State layers: 8% hover, 10% focus/pressed
6005
+ * - Elevation: level-1 base → level-2 hover (elevated surface)
5919
6006
  *
5920
6007
  * @example
5921
6008
  * ```tsx
5922
- * // Assist chip
6009
+ * // Assist chip (default flat surface)
5923
6010
  * <Chip type="assist" label="Set alarm" onPress={handlePress} />
5924
6011
  *
5925
6012
  * // Elevated assist chip
@@ -5956,27 +6043,64 @@ declare const Chip: React__default.ForwardRefExoticComponent<ChipProps & React__
5956
6043
  declare const ChipSet: React$1.ForwardRefExoticComponent<ChipSetProps & React$1.RefAttributes<HTMLDivElement>>;
5957
6044
 
5958
6045
  /**
5959
- * Material Design 3 Chip Variants (CVA)
6046
+ * Material Design 3 Chip Variants (Slot-based "Variants vs States" architecture)
5960
6047
  *
5961
- * Covers all four chip types (assist, filter, input, suggestion) with
5962
- * surface, selection, disabled, and padding variants.
6048
+ * Architecture: Variants vs States
6049
+ * - CVA holds design-time structure only (chipType × surface).
6050
+ * - All interaction/selection states are driven by data-* attributes on the root
6051
+ * via group-data-[x]/chip Tailwind selectors in each slot's base classes.
6052
+ * - Content flags (data-with-leading, data-with-trailing) are set explicitly by
6053
+ * the component and consumed by the root slot for padding adjustments.
5963
6054
  *
5964
- * Padding resolution (via tailwind-merge in `cn()`):
5965
- * base `px-4` → hasLeadingIcon overrides with `pl-3 pr-4`
5966
- * → hasRemoveButton overrides with `pl-3 pr-3`
5967
- * Both can be combined and the last-applied wins through tailwind-merge.
6055
+ * Slot responsibilities:
6056
+ * chipVariants — root button/span; shape, color, elevation, padding
6057
+ * chipStateLayerVariants — hover/focus/press opacity overlay (absolute inset)
6058
+ * chipFocusRingVariants — keyboard focus outline, outside overflow-hidden
6059
+ * chipLeadingIconVariants — leading icon wrapper; color per type + selected/disabled
6060
+ * chipTrailingIconVariants — trailing icon wrapper; assist/suggestion only
6061
+ * chipCheckmarkVariants — filter chip checkmark container (width spring)
6062
+ * chipLabelVariants — label text slot
6063
+ * chipRemoveButtonVariants — input chip remove button wrapper
6064
+ * chipRemoveStateLayerVariants — state layer inside remove button circle
6065
+ *
6066
+ * MD3 Spec (Expressive):
6067
+ * Shape: corner-small (8dp) → rounded-sm
6068
+ * Height: 32dp → h-8
6069
+ * Padding: 16dp base; 8dp leading side with icon
6070
+ * Gap: 8dp → gap-2
6071
+ * Icon: 18px × 18px
6072
+ * State-layer opacities: hover 8% | focus 10% | pressed 10%
6073
+ * Disabled: container transparent, border 12% opacity, content 38% opacity
6074
+ *
6075
+ * Per-type color tokens (MD3 strict):
6076
+ * assist: bg=transparent border=outline label=on-surface leadingIcon=primary stateLayer=on-surface
6077
+ * filter: bg=transparent border=outline label=on-surface-variant stateLayer=on-surface-variant
6078
+ * filter sel: bg=secondary-container border=none label=on-secondary-container stateLayer=on-secondary-container
6079
+ * input: bg=transparent border=outline-variant label=on-surface-variant stateLayer=on-surface-variant
6080
+ * suggestion: bg=transparent border=outline label=on-surface-variant stateLayer=on-surface-variant
6081
+ *
6082
+ * Elevation per state (elevated surface):
6083
+ * base=1 → hover=2 → focus/pressed=1 (doubled pressed selector wins over hover)
6084
+ */
6085
+ /**
6086
+ * Root chip element.
6087
+ *
6088
+ * IMPORTANT — overflow is intentionally NOT on the root.
6089
+ * Clipping is delegated to the state-layer and ripple containers via
6090
+ * `overflow-hidden rounded-[inherit]` so the focus ring span (inset-[-3px])
6091
+ * can extend outside the chip boundary and remain fully visible.
6092
+ *
6093
+ * Padding is driven by content flags:
6094
+ * base px-4 (16dp)
6095
+ * data-[with-leading]: pl-2 pr-4 (8dp leading, 16dp trailing)
6096
+ * data-[with-trailing]: pl-4 pr-2
6097
+ * data-[with-leading][with-trailing]: pl-2 pr-2
6098
+ * These are self-targeting data-[x]: selectors (no group scope needed).
5968
6099
  */
5969
6100
  declare const chipVariants: (props?: ({
5970
6101
  chipType?: "filter" | "input" | "assist" | "suggestion" | null | undefined;
5971
- surface?: "tonal" | "elevated" | null | undefined;
5972
- selected?: boolean | null | undefined;
5973
- isDisabled?: boolean | null | undefined;
5974
- hasLeadingIcon?: boolean | null | undefined;
5975
- hasRemoveButton?: boolean | null | undefined;
6102
+ surface?: "tonal" | "elevated" | "flat" | null | undefined;
5976
6103
  } & class_variance_authority_types.ClassProp) | undefined) => string;
5977
- /**
5978
- * Extract variant prop types from CVA
5979
- */
5980
6104
  type ChipVariants = VariantProps<typeof chipVariants>;
5981
6105
 
5982
6106
  /**
package/dist/index.d.ts CHANGED
@@ -5690,21 +5690,22 @@ declare function SnackbarProvider({ children, maxVisible }: SnackbarProviderProp
5690
5690
  /**
5691
5691
  * The four MD3 chip types, each with distinct interaction semantics.
5692
5692
  *
5693
- * - `assist` – triggers an action (e.g. "Set alarm")
5694
- * - `filter` – toggles a filter on/off (`aria-pressed`)
5695
- * - `input` – represents a value the user entered; can be removed
5693
+ * - `assist` – triggers an action (e.g. "Set alarm")
5694
+ * - `filter` – toggles a filter on/off (`aria-pressed`)
5695
+ * - `input` – represents a value the user entered; can be removed
5696
5696
  * - `suggestion` – offers a contextual suggestion (acts like assist)
5697
5697
  */
5698
5698
  type ChipType = "assist" | "filter" | "input" | "suggestion";
5699
5699
  /**
5700
- * Surface style for Assist and Suggestion chips.
5700
+ * Surface style for chips.
5701
5701
  *
5702
- * - `tonal` uses secondary-container fill (default)
5703
- * - `elevated` – uses surface-container-low fill with elevation shadow
5702
+ * - `flat` transparent container with outline border (MD3 default)
5703
+ * - `elevated` – `surface-container-low` fill with elevation shadow; all four chip types support this
5704
+ * - `tonal` – @deprecated Use `flat` instead. Will be removed in a future minor version.
5704
5705
  *
5705
- * @default 'tonal'
5706
+ * @default 'flat'
5706
5707
  */
5707
- type ChipSurface = "tonal" | "elevated";
5708
+ type ChipSurface = "flat" | "elevated" | "tonal";
5708
5709
  /**
5709
5710
  * Material Design 3 Chip Component Props
5710
5711
  *
@@ -5736,8 +5737,13 @@ interface ChipProps {
5736
5737
  */
5737
5738
  label: string;
5738
5739
  /**
5739
- * Surface style (Assist and Suggestion chips only).
5740
- * @default 'tonal'
5740
+ * Surface style applied to the chip.
5741
+ *
5742
+ * - `flat` (default) — transparent container with outline border per MD3 spec.
5743
+ * - `elevated` — `surface-container-low` fill + elevation shadow; works with all chip types.
5744
+ * - `tonal` — @deprecated alias for `flat`; logs a console.warn in development.
5745
+ *
5746
+ * @default 'flat'
5741
5747
  */
5742
5748
  surface?: ChipSurface;
5743
5749
  /**
@@ -5762,6 +5768,11 @@ interface ChipProps {
5762
5768
  onRemove?: () => void;
5763
5769
  /**
5764
5770
  * Icon rendered before the label.
5771
+ * Color follows the MD3 spec per chip type:
5772
+ * - assist → `text-primary`
5773
+ * - filter (unselected) → `text-on-surface-variant`; (selected) → `text-on-secondary-container`
5774
+ * - input → `text-on-surface-variant`
5775
+ * - suggestion → `text-on-surface-variant`
5765
5776
  */
5766
5777
  leadingIcon?: React__default.ReactNode;
5767
5778
  /**
@@ -5778,6 +5789,53 @@ interface ChipProps {
5778
5789
  */
5779
5790
  className?: string;
5780
5791
  }
5792
+ /**
5793
+ * Props passed through to the chip body element (button) in ChipHeadless.
5794
+ * Allows the styled layer to inject data-* interaction attributes and
5795
+ * merged hover/focus event handlers.
5796
+ */
5797
+ interface ChipBodyPassthroughProps {
5798
+ /**
5799
+ * Merged hover/focus/press event handlers from the styled layer.
5800
+ * Spread onto the body <button>.
5801
+ */
5802
+ eventHandlers?: Record<string, unknown>;
5803
+ /**
5804
+ * data-* interaction attributes emitted by getInteractionDataAttributes.
5805
+ * Spread onto the body <button>.
5806
+ */
5807
+ dataAttributes?: Record<string, string | undefined>;
5808
+ /**
5809
+ * onPressStart forwarded into useButton/useToggleButton for isPressed tracking.
5810
+ */
5811
+ onPressStart?: () => void;
5812
+ /**
5813
+ * onPressEnd forwarded into useButton/useToggleButton for isPressed tracking.
5814
+ */
5815
+ onPressEnd?: () => void;
5816
+ }
5817
+ /**
5818
+ * Props passed through to the remove button element in InputChipImpl.
5819
+ */
5820
+ interface ChipRemovePassthroughProps {
5821
+ /**
5822
+ * data-* interaction attributes for the remove button.
5823
+ */
5824
+ dataAttributes?: Record<string, string | undefined>;
5825
+ /**
5826
+ * Merged hover/focus event handlers from useHover + useFocusRing.
5827
+ * Spread onto the remove <button> alongside React Aria's buttonProps.
5828
+ */
5829
+ eventHandlers?: Record<string, unknown>;
5830
+ /**
5831
+ * onPressStart for remove button isPressed tracking.
5832
+ */
5833
+ onPressStart?: () => void;
5834
+ /**
5835
+ * onPressEnd for remove button isPressed tracking.
5836
+ */
5837
+ onPressEnd?: () => void;
5838
+ }
5781
5839
  /**
5782
5840
  * Props for the headless ChipHeadless component (Layer 2).
5783
5841
  *
@@ -5827,7 +5885,7 @@ interface ChipHeadlessProps {
5827
5885
  */
5828
5886
  isDisabled?: boolean;
5829
5887
  /**
5830
- * Additional CSS classes (Tailwind).
5888
+ * Additional CSS classes applied to the chip body button.
5831
5889
  */
5832
5890
  className?: string;
5833
5891
  /**
@@ -5836,7 +5894,7 @@ interface ChipHeadlessProps {
5836
5894
  children?: React__default.ReactNode;
5837
5895
  /**
5838
5896
  * Icon rendered inside the remove button (Input chips only).
5839
- * Typically an ×/close SVG.
5897
+ * Typically an ×/close SVG wrapped in a fragment with a state layer span.
5840
5898
  */
5841
5899
  removeIcon?: React__default.ReactNode;
5842
5900
  /**
@@ -5848,6 +5906,16 @@ interface ChipHeadlessProps {
5848
5906
  * Used by the styled layer to trigger the ripple effect.
5849
5907
  */
5850
5908
  onMouseDown?: React__default.MouseEventHandler<HTMLButtonElement>;
5909
+ /**
5910
+ * Interaction data attributes + merged handlers from the styled layer.
5911
+ * Spread onto the body <button> to enable group-data-[x]/chip slot selectors.
5912
+ */
5913
+ bodyPassthrough?: ChipBodyPassthroughProps;
5914
+ /**
5915
+ * Interaction data attributes + handlers for the remove button (Input chips only).
5916
+ * Spread onto the remove <button>.
5917
+ */
5918
+ removePassthrough?: ChipRemovePassthroughProps;
5851
5919
  }
5852
5920
  /**
5853
5921
  * Props for the ChipSet container component.
@@ -5879,6 +5947,10 @@ interface ChipSetProps {
5879
5947
  * Unstyled chip primitive covering all four MD3 chip types. Delegates to the
5880
5948
  * correct React Aria hook per `type` — bring your own styles.
5881
5949
  *
5950
+ * The styled layer (Chip.tsx) passes `bodyPassthrough` to inject data-* interaction
5951
+ * attributes and merged hover/focus handlers onto the body button, enabling the
5952
+ * group-data-[x]/chip slot selectors defined in Chip.variants.ts.
5953
+ *
5882
5954
  * | type | Hook | Key behaviour |
5883
5955
  * |------------- |-----------------------------------------|----------------------------------|
5884
5956
  * | `assist` | `useButton` | Enter/Space → `onPress` |
@@ -5908,18 +5980,33 @@ declare const ChipHeadless: React$1.ForwardRefExoticComponent<ChipHeadlessProps
5908
5980
  *
5909
5981
  * Unified styled chip covering all four MD3 chip types.
5910
5982
  * Built on `ChipHeadless` for world-class accessibility via React Aria.
5911
- * Uses CVA for type-safe variant management.
5912
5983
  *
5913
- * | Type | Surface | Selection | Remove |
5914
- * |--------------|---------------|-----------|--------|
5915
- * | `assist` | tonal/elevated | | — |
5916
- * | `filter` | fixed tonal | ✅ | — |
5917
- * | `input` | fixed tonal | — | ✅ |
5918
- * | `suggestion` | tonal/elevated | — | — |
5984
+ * Implements the Variants-vs-States architecture: all interaction/selection
5985
+ * states are expressed as `data-*` attributes on the root and consumed by each
5986
+ * slot via `group-data-[x]/chip` Tailwind selectorsno state variants in CVA.
5987
+ *
5988
+ * Features:
5989
+ * - 4 MD3 chip types: assist, filter, input, suggestion
5990
+ * - ✅ 2 surfaces: flat (transparent + outline), elevated (shadow + fill)
5991
+ * - ✅ MD3-correct per-type icon colors (assist leading = primary, etc.)
5992
+ * - ✅ Filter chip checkmark with spring animation
5993
+ * - ✅ Input chip removal with animate-md-fade-out
5994
+ * - ✅ Proper MD3 state layer (hover 8%, focus 10%, pressed 10%)
5995
+ * - ✅ Spring motion tokens (no hardcoded durations)
5996
+ * - ✅ Dedicated focus ring slot (outside overflow-hidden)
5997
+ * - ✅ Full keyboard accessibility (via React Aria)
5998
+ * - ✅ Deprecated `surface="tonal"` — warns and maps to `flat`
5999
+ *
6000
+ * MD3 Specifications:
6001
+ * - Height: 32dp (h-8), corner-small 8dp (rounded-sm)
6002
+ * - Padding: 16dp base; 8dp leading side when icon present
6003
+ * - Icon size: 18px × 18px
6004
+ * - State layers: 8% hover, 10% focus/pressed
6005
+ * - Elevation: level-1 base → level-2 hover (elevated surface)
5919
6006
  *
5920
6007
  * @example
5921
6008
  * ```tsx
5922
- * // Assist chip
6009
+ * // Assist chip (default flat surface)
5923
6010
  * <Chip type="assist" label="Set alarm" onPress={handlePress} />
5924
6011
  *
5925
6012
  * // Elevated assist chip
@@ -5956,27 +6043,64 @@ declare const Chip: React__default.ForwardRefExoticComponent<ChipProps & React__
5956
6043
  declare const ChipSet: React$1.ForwardRefExoticComponent<ChipSetProps & React$1.RefAttributes<HTMLDivElement>>;
5957
6044
 
5958
6045
  /**
5959
- * Material Design 3 Chip Variants (CVA)
6046
+ * Material Design 3 Chip Variants (Slot-based "Variants vs States" architecture)
5960
6047
  *
5961
- * Covers all four chip types (assist, filter, input, suggestion) with
5962
- * surface, selection, disabled, and padding variants.
6048
+ * Architecture: Variants vs States
6049
+ * - CVA holds design-time structure only (chipType × surface).
6050
+ * - All interaction/selection states are driven by data-* attributes on the root
6051
+ * via group-data-[x]/chip Tailwind selectors in each slot's base classes.
6052
+ * - Content flags (data-with-leading, data-with-trailing) are set explicitly by
6053
+ * the component and consumed by the root slot for padding adjustments.
5963
6054
  *
5964
- * Padding resolution (via tailwind-merge in `cn()`):
5965
- * base `px-4` → hasLeadingIcon overrides with `pl-3 pr-4`
5966
- * → hasRemoveButton overrides with `pl-3 pr-3`
5967
- * Both can be combined and the last-applied wins through tailwind-merge.
6055
+ * Slot responsibilities:
6056
+ * chipVariants — root button/span; shape, color, elevation, padding
6057
+ * chipStateLayerVariants — hover/focus/press opacity overlay (absolute inset)
6058
+ * chipFocusRingVariants — keyboard focus outline, outside overflow-hidden
6059
+ * chipLeadingIconVariants — leading icon wrapper; color per type + selected/disabled
6060
+ * chipTrailingIconVariants — trailing icon wrapper; assist/suggestion only
6061
+ * chipCheckmarkVariants — filter chip checkmark container (width spring)
6062
+ * chipLabelVariants — label text slot
6063
+ * chipRemoveButtonVariants — input chip remove button wrapper
6064
+ * chipRemoveStateLayerVariants — state layer inside remove button circle
6065
+ *
6066
+ * MD3 Spec (Expressive):
6067
+ * Shape: corner-small (8dp) → rounded-sm
6068
+ * Height: 32dp → h-8
6069
+ * Padding: 16dp base; 8dp leading side with icon
6070
+ * Gap: 8dp → gap-2
6071
+ * Icon: 18px × 18px
6072
+ * State-layer opacities: hover 8% | focus 10% | pressed 10%
6073
+ * Disabled: container transparent, border 12% opacity, content 38% opacity
6074
+ *
6075
+ * Per-type color tokens (MD3 strict):
6076
+ * assist: bg=transparent border=outline label=on-surface leadingIcon=primary stateLayer=on-surface
6077
+ * filter: bg=transparent border=outline label=on-surface-variant stateLayer=on-surface-variant
6078
+ * filter sel: bg=secondary-container border=none label=on-secondary-container stateLayer=on-secondary-container
6079
+ * input: bg=transparent border=outline-variant label=on-surface-variant stateLayer=on-surface-variant
6080
+ * suggestion: bg=transparent border=outline label=on-surface-variant stateLayer=on-surface-variant
6081
+ *
6082
+ * Elevation per state (elevated surface):
6083
+ * base=1 → hover=2 → focus/pressed=1 (doubled pressed selector wins over hover)
6084
+ */
6085
+ /**
6086
+ * Root chip element.
6087
+ *
6088
+ * IMPORTANT — overflow is intentionally NOT on the root.
6089
+ * Clipping is delegated to the state-layer and ripple containers via
6090
+ * `overflow-hidden rounded-[inherit]` so the focus ring span (inset-[-3px])
6091
+ * can extend outside the chip boundary and remain fully visible.
6092
+ *
6093
+ * Padding is driven by content flags:
6094
+ * base px-4 (16dp)
6095
+ * data-[with-leading]: pl-2 pr-4 (8dp leading, 16dp trailing)
6096
+ * data-[with-trailing]: pl-4 pr-2
6097
+ * data-[with-leading][with-trailing]: pl-2 pr-2
6098
+ * These are self-targeting data-[x]: selectors (no group scope needed).
5968
6099
  */
5969
6100
  declare const chipVariants: (props?: ({
5970
6101
  chipType?: "filter" | "input" | "assist" | "suggestion" | null | undefined;
5971
- surface?: "tonal" | "elevated" | null | undefined;
5972
- selected?: boolean | null | undefined;
5973
- isDisabled?: boolean | null | undefined;
5974
- hasLeadingIcon?: boolean | null | undefined;
5975
- hasRemoveButton?: boolean | null | undefined;
6102
+ surface?: "tonal" | "elevated" | "flat" | null | undefined;
5976
6103
  } & class_variance_authority_types.ClassProp) | undefined) => string;
5977
- /**
5978
- * Extract variant prop types from CVA
5979
- */
5980
6104
  type ChipVariants = VariantProps<typeof chipVariants>;
5981
6105
 
5982
6106
  /**