@tinybigui/react 0.14.0 → 0.15.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
@@ -7093,9 +7093,9 @@ type RichTooltipVariants = VariantProps<typeof richTooltipVariants>;
7093
7093
  /**
7094
7094
  * Visual density based on content lines (MD3 List)
7095
7095
  *
7096
- * - `one-line`: headline only (48dp)
7097
- * - `two-line`: headline + supporting text (64dp)
7098
- * - `three-line`: overline + headline + supporting text (88dp)
7096
+ * - `one-line`: headline only (56dp min-height)
7097
+ * - `two-line`: headline + supporting text (72dp min-height)
7098
+ * - `three-line`: overline + headline + supporting text (88dp min-height)
7099
7099
  */
7100
7100
  type ListDensity = "one-line" | "two-line" | "three-line";
7101
7101
  /**
@@ -7201,8 +7201,6 @@ interface ListItemProps {
7201
7201
  insetDivider?: boolean;
7202
7202
  /** Additional CSS classes */
7203
7203
  className?: string;
7204
- /** Item-specific action callback */
7205
- onAction?: (value: string | number) => void;
7206
7204
  }
7207
7205
  /**
7208
7206
  * Props for the ListItem leading slot
@@ -7276,24 +7274,44 @@ declare const List: React__default.ForwardRefExoticComponent<ListProps & React__
7276
7274
  /**
7277
7275
  * Material Design 3 List Item (Layer 3: Styled)
7278
7276
  *
7279
- * Renders an accessible list item with MD3 visual treatment:
7280
- * state layer, ripple, density-driven height, and slot-based layout.
7277
+ * Architecture: Variants-vs-States
7278
+ * - Design-time variant: `density` (auto-derived from content).
7279
+ * - All interaction/selection states are expressed as data-* attributes on the root <li>
7280
+ * via `getInteractionDataAttributes`, consumed by each slot via group-data-[x]/list-item.
7281
+ * - Content flags (`data-with-leading`, `data-with-trailing`) describe structure, set explicitly.
7281
7282
  *
7282
- * - **Interactive mode** (inside a `List` with `selectionMode` or `onAction`):
7283
- * uses `useOption` for ARIA semantics, renders state layer + ripple.
7284
- * - **Static mode**: renders `<li role="listitem">` without interactive
7285
- * affordances.
7283
+ * Two operating modes:
7284
+ * - **Interactive** (inside a `List` with `selectionMode` or `onAction`):
7285
+ * uses `useOption` for ARIA semantics, renders state layer + focus ring + ripple.
7286
+ * - **Static**: renders `<li role="listitem">`, no interactive affordances.
7286
7287
  *
7287
7288
  * Density is auto-derived from content:
7288
- * - one-line (56dp) — headline only
7289
- * - two-line (72dp) — headline + supportingText
7289
+ * - one-line (56dp) — headline only
7290
+ * - two-line (72dp) — headline + supportingText
7290
7291
  * - three-line (88dp) — overline present
7292
+ *
7293
+ * @example
7294
+ * ```tsx
7295
+ * // Static
7296
+ * <List aria-label="Settings">
7297
+ * <ListItem value="wifi" headline="Wi-Fi" supportingText="Connected" leadingType="icon" leadingSlot={<IconWifi />} />
7298
+ * </List>
7299
+ *
7300
+ * // Interactive single-select
7301
+ * <List aria-label="Alignment" selectionMode="single">
7302
+ * <ListItem value="left" headline="Left" />
7303
+ * <ListItem value="center" headline="Center" />
7304
+ * </List>
7305
+ * ```
7291
7306
  */
7292
7307
  declare const ListItem: React__default.ForwardRefExoticComponent<ListItemProps & React__default.RefAttributes<HTMLLIElement>>;
7293
7308
 
7294
7309
  /**
7295
7310
  * MD3 ListItem leading slot.
7296
7311
  *
7312
+ * Uses `listItemLeadingVariants` CVA so icon/text colors automatically react to
7313
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7314
+ *
7297
7315
  * For `checkbox` and `radio` types the children are wrapped with
7298
7316
  * `aria-hidden="true"` and `tabIndex={-1}` because the parent
7299
7317
  * `ListItem`'s `useOption` already conveys selection state to
@@ -7304,6 +7322,9 @@ declare const ListItemLeading: React$1.ForwardRefExoticComponent<ListItemLeading
7304
7322
  /**
7305
7323
  * MD3 ListItem trailing slot.
7306
7324
  *
7325
+ * Uses `listItemTrailingVariants` CVA so icon/text colors automatically react to
7326
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7327
+ *
7307
7328
  * For `checkbox` and `radio` types the children are wrapped with
7308
7329
  * `aria-hidden="true"` and `tabIndex={-1}` — selection semantics
7309
7330
  * come from the parent `ListItem`'s `useOption`.
@@ -7313,6 +7334,9 @@ declare const ListItemTrailing: React$1.ForwardRefExoticComponent<ListItemTraili
7313
7334
  /**
7314
7335
  * MD3 ListItem text block — overline + headline + supporting text.
7315
7336
  *
7337
+ * Each text element uses its own slot CVA so colors automatically react to
7338
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7339
+ *
7316
7340
  * Uses `min-w-0` to allow text truncation inside flex containers.
7317
7341
  */
7318
7342
  declare const ListItemText: React$1.ForwardRefExoticComponent<ListItemTextProps & React$1.RefAttributes<HTMLDivElement>>;
@@ -7357,20 +7381,58 @@ declare const ListHeadless: React__default.ForwardRefExoticComponent<ListProps &
7357
7381
  declare const ListItemHeadless: React__default.ForwardRefExoticComponent<ListItemProps & React__default.RefAttributes<HTMLLIElement>>;
7358
7382
 
7359
7383
  /**
7360
- * MD3 List container CVA variants.
7384
+ * Material Design 3 List Variants
7385
+ *
7386
+ * Architecture: Variants vs States
7387
+ * - CVA holds design-time structure only (density, slot type).
7388
+ * - All interaction/selection states are driven by data-* attributes on the root <li>
7389
+ * via group-data-[x]/list-item Tailwind selectors in each slot's base classes.
7390
+ * - Content flags (data-with-leading, data-with-trailing) are set explicitly by ListItem.
7391
+ *
7392
+ * Slot responsibilities:
7393
+ * listVariants — container <ul>; bg-surface
7394
+ * listItemVariants — root <li>; group/list-item; density height; cursor; disabled
7395
+ * listItemStateLayerVariants — absolute inset overlay; hover/focus/pressed opacity ring
7396
+ * listItemFocusRingVariants — keyboard focus indicator outline
7397
+ * listItemLeadingVariants — leading slot wrapper; type-specific size/shape + color states
7398
+ * listItemTrailingVariants — trailing slot wrapper; type-specific size/shape + color states
7399
+ * listItemOverlineVariants — overline text; color reacts to selected/disabled
7400
+ * listItemHeadlineVariants — headline text; color reacts to selected/disabled
7401
+ * listItemSupportingTextVariants — supporting text; color reacts to selected/disabled
7402
+ *
7403
+ * MD3 Spec (lists/specs):
7404
+ * One-line: 56dp min-height
7405
+ * Two-line: 72dp min-height
7406
+ * Three-line: 88dp min-height (leading/trailing top-aligned)
7407
+ * Padding: 16dp horizontal, 8dp vertical
7408
+ * Leading icon: 24dp, text-on-surface-variant
7409
+ * Leading avatar: 40dp circle
7410
+ * State-layer opacities: hover 8% | focus 10% | pressed 10%
7411
+ * Disabled: content 38% opacity, pointer-events none
7412
+ * Selected: bg-secondary-container, text/icons on-secondary-container
7413
+ */
7414
+ /**
7415
+ * List container (<ul>).
7416
+ * MD3: Lists use `surface` color role for their container.
7361
7417
  */
7362
7418
  declare const listVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
7363
7419
  /**
7364
- * MD3 ListItem CVA variants.
7420
+ * Root <li> element — carries `group/list-item` and emits data-* interaction attributes.
7365
7421
  *
7366
- * Density is auto-derived from content (overline / supportingText), not a user prop.
7367
- * Three-line items use `items-start` so leading/trailing slots top-align.
7422
+ * Design-time variant: `density` only.
7423
+ * All interaction/selection states are driven via group-data-[x]/list-item selectors
7424
+ * in the slot CVAs below — NOT as CVA variant keys here.
7425
+ *
7426
+ * one-line: 56dp (min-h-14)
7427
+ * two-line: 72dp (min-h-18)
7428
+ * three-line: 88dp (min-h-22, items-start for top-aligned slots)
7429
+ *
7430
+ * Selected background: group-data-[selected]/list-item:bg-secondary-container
7431
+ * Interactive cursor: data-[interactive]:cursor-pointer
7432
+ * Disabled: self-targeting data-[disabled]: selectors (38% + no pointer)
7368
7433
  */
7369
7434
  declare const listItemVariants: (props?: ({
7370
7435
  density?: "one-line" | "two-line" | "three-line" | null | undefined;
7371
- isSelected?: boolean | null | undefined;
7372
- isDisabled?: boolean | null | undefined;
7373
- isInteractive?: boolean | null | undefined;
7374
7436
  } & class_variance_authority_types.ClassProp) | undefined) => string;
7375
7437
  type ListVariants = VariantProps<typeof listVariants>;
7376
7438
  type ListItemVariants = VariantProps<typeof listItemVariants>;
package/dist/index.d.ts CHANGED
@@ -7093,9 +7093,9 @@ type RichTooltipVariants = VariantProps<typeof richTooltipVariants>;
7093
7093
  /**
7094
7094
  * Visual density based on content lines (MD3 List)
7095
7095
  *
7096
- * - `one-line`: headline only (48dp)
7097
- * - `two-line`: headline + supporting text (64dp)
7098
- * - `three-line`: overline + headline + supporting text (88dp)
7096
+ * - `one-line`: headline only (56dp min-height)
7097
+ * - `two-line`: headline + supporting text (72dp min-height)
7098
+ * - `three-line`: overline + headline + supporting text (88dp min-height)
7099
7099
  */
7100
7100
  type ListDensity = "one-line" | "two-line" | "three-line";
7101
7101
  /**
@@ -7201,8 +7201,6 @@ interface ListItemProps {
7201
7201
  insetDivider?: boolean;
7202
7202
  /** Additional CSS classes */
7203
7203
  className?: string;
7204
- /** Item-specific action callback */
7205
- onAction?: (value: string | number) => void;
7206
7204
  }
7207
7205
  /**
7208
7206
  * Props for the ListItem leading slot
@@ -7276,24 +7274,44 @@ declare const List: React__default.ForwardRefExoticComponent<ListProps & React__
7276
7274
  /**
7277
7275
  * Material Design 3 List Item (Layer 3: Styled)
7278
7276
  *
7279
- * Renders an accessible list item with MD3 visual treatment:
7280
- * state layer, ripple, density-driven height, and slot-based layout.
7277
+ * Architecture: Variants-vs-States
7278
+ * - Design-time variant: `density` (auto-derived from content).
7279
+ * - All interaction/selection states are expressed as data-* attributes on the root <li>
7280
+ * via `getInteractionDataAttributes`, consumed by each slot via group-data-[x]/list-item.
7281
+ * - Content flags (`data-with-leading`, `data-with-trailing`) describe structure, set explicitly.
7281
7282
  *
7282
- * - **Interactive mode** (inside a `List` with `selectionMode` or `onAction`):
7283
- * uses `useOption` for ARIA semantics, renders state layer + ripple.
7284
- * - **Static mode**: renders `<li role="listitem">` without interactive
7285
- * affordances.
7283
+ * Two operating modes:
7284
+ * - **Interactive** (inside a `List` with `selectionMode` or `onAction`):
7285
+ * uses `useOption` for ARIA semantics, renders state layer + focus ring + ripple.
7286
+ * - **Static**: renders `<li role="listitem">`, no interactive affordances.
7286
7287
  *
7287
7288
  * Density is auto-derived from content:
7288
- * - one-line (56dp) — headline only
7289
- * - two-line (72dp) — headline + supportingText
7289
+ * - one-line (56dp) — headline only
7290
+ * - two-line (72dp) — headline + supportingText
7290
7291
  * - three-line (88dp) — overline present
7292
+ *
7293
+ * @example
7294
+ * ```tsx
7295
+ * // Static
7296
+ * <List aria-label="Settings">
7297
+ * <ListItem value="wifi" headline="Wi-Fi" supportingText="Connected" leadingType="icon" leadingSlot={<IconWifi />} />
7298
+ * </List>
7299
+ *
7300
+ * // Interactive single-select
7301
+ * <List aria-label="Alignment" selectionMode="single">
7302
+ * <ListItem value="left" headline="Left" />
7303
+ * <ListItem value="center" headline="Center" />
7304
+ * </List>
7305
+ * ```
7291
7306
  */
7292
7307
  declare const ListItem: React__default.ForwardRefExoticComponent<ListItemProps & React__default.RefAttributes<HTMLLIElement>>;
7293
7308
 
7294
7309
  /**
7295
7310
  * MD3 ListItem leading slot.
7296
7311
  *
7312
+ * Uses `listItemLeadingVariants` CVA so icon/text colors automatically react to
7313
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7314
+ *
7297
7315
  * For `checkbox` and `radio` types the children are wrapped with
7298
7316
  * `aria-hidden="true"` and `tabIndex={-1}` because the parent
7299
7317
  * `ListItem`'s `useOption` already conveys selection state to
@@ -7304,6 +7322,9 @@ declare const ListItemLeading: React$1.ForwardRefExoticComponent<ListItemLeading
7304
7322
  /**
7305
7323
  * MD3 ListItem trailing slot.
7306
7324
  *
7325
+ * Uses `listItemTrailingVariants` CVA so icon/text colors automatically react to
7326
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7327
+ *
7307
7328
  * For `checkbox` and `radio` types the children are wrapped with
7308
7329
  * `aria-hidden="true"` and `tabIndex={-1}` — selection semantics
7309
7330
  * come from the parent `ListItem`'s `useOption`.
@@ -7313,6 +7334,9 @@ declare const ListItemTrailing: React$1.ForwardRefExoticComponent<ListItemTraili
7313
7334
  /**
7314
7335
  * MD3 ListItem text block — overline + headline + supporting text.
7315
7336
  *
7337
+ * Each text element uses its own slot CVA so colors automatically react to
7338
+ * the parent `group/list-item` data-selected and data-disabled attributes.
7339
+ *
7316
7340
  * Uses `min-w-0` to allow text truncation inside flex containers.
7317
7341
  */
7318
7342
  declare const ListItemText: React$1.ForwardRefExoticComponent<ListItemTextProps & React$1.RefAttributes<HTMLDivElement>>;
@@ -7357,20 +7381,58 @@ declare const ListHeadless: React__default.ForwardRefExoticComponent<ListProps &
7357
7381
  declare const ListItemHeadless: React__default.ForwardRefExoticComponent<ListItemProps & React__default.RefAttributes<HTMLLIElement>>;
7358
7382
 
7359
7383
  /**
7360
- * MD3 List container CVA variants.
7384
+ * Material Design 3 List Variants
7385
+ *
7386
+ * Architecture: Variants vs States
7387
+ * - CVA holds design-time structure only (density, slot type).
7388
+ * - All interaction/selection states are driven by data-* attributes on the root <li>
7389
+ * via group-data-[x]/list-item Tailwind selectors in each slot's base classes.
7390
+ * - Content flags (data-with-leading, data-with-trailing) are set explicitly by ListItem.
7391
+ *
7392
+ * Slot responsibilities:
7393
+ * listVariants — container <ul>; bg-surface
7394
+ * listItemVariants — root <li>; group/list-item; density height; cursor; disabled
7395
+ * listItemStateLayerVariants — absolute inset overlay; hover/focus/pressed opacity ring
7396
+ * listItemFocusRingVariants — keyboard focus indicator outline
7397
+ * listItemLeadingVariants — leading slot wrapper; type-specific size/shape + color states
7398
+ * listItemTrailingVariants — trailing slot wrapper; type-specific size/shape + color states
7399
+ * listItemOverlineVariants — overline text; color reacts to selected/disabled
7400
+ * listItemHeadlineVariants — headline text; color reacts to selected/disabled
7401
+ * listItemSupportingTextVariants — supporting text; color reacts to selected/disabled
7402
+ *
7403
+ * MD3 Spec (lists/specs):
7404
+ * One-line: 56dp min-height
7405
+ * Two-line: 72dp min-height
7406
+ * Three-line: 88dp min-height (leading/trailing top-aligned)
7407
+ * Padding: 16dp horizontal, 8dp vertical
7408
+ * Leading icon: 24dp, text-on-surface-variant
7409
+ * Leading avatar: 40dp circle
7410
+ * State-layer opacities: hover 8% | focus 10% | pressed 10%
7411
+ * Disabled: content 38% opacity, pointer-events none
7412
+ * Selected: bg-secondary-container, text/icons on-secondary-container
7413
+ */
7414
+ /**
7415
+ * List container (<ul>).
7416
+ * MD3: Lists use `surface` color role for their container.
7361
7417
  */
7362
7418
  declare const listVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
7363
7419
  /**
7364
- * MD3 ListItem CVA variants.
7420
+ * Root <li> element — carries `group/list-item` and emits data-* interaction attributes.
7365
7421
  *
7366
- * Density is auto-derived from content (overline / supportingText), not a user prop.
7367
- * Three-line items use `items-start` so leading/trailing slots top-align.
7422
+ * Design-time variant: `density` only.
7423
+ * All interaction/selection states are driven via group-data-[x]/list-item selectors
7424
+ * in the slot CVAs below — NOT as CVA variant keys here.
7425
+ *
7426
+ * one-line: 56dp (min-h-14)
7427
+ * two-line: 72dp (min-h-18)
7428
+ * three-line: 88dp (min-h-22, items-start for top-aligned slots)
7429
+ *
7430
+ * Selected background: group-data-[selected]/list-item:bg-secondary-container
7431
+ * Interactive cursor: data-[interactive]:cursor-pointer
7432
+ * Disabled: self-targeting data-[disabled]: selectors (38% + no pointer)
7368
7433
  */
7369
7434
  declare const listItemVariants: (props?: ({
7370
7435
  density?: "one-line" | "two-line" | "three-line" | null | undefined;
7371
- isSelected?: boolean | null | undefined;
7372
- isDisabled?: boolean | null | undefined;
7373
- isInteractive?: boolean | null | undefined;
7374
7436
  } & class_variance_authority_types.ClassProp) | undefined) => string;
7375
7437
  type ListVariants = VariantProps<typeof listVariants>;
7376
7438
  type ListItemVariants = VariantProps<typeof listItemVariants>;