@instruments/materia-ui 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/components/accordion/accordion-variants.js +1 -0
  2. package/dist/components/alert/alert-root.js +1 -0
  3. package/dist/components/anchor/anchor-root.js +1 -0
  4. package/dist/components/avatar/avatar-badge.d.ts +1 -1
  5. package/dist/components/avatar/avatar-fallback.d.ts +1 -1
  6. package/dist/components/avatar/avatar-root.d.ts +1 -1
  7. package/dist/components/avatar/avatar-status.d.ts +2 -1
  8. package/dist/components/badge/badge-button.d.ts +1 -0
  9. package/dist/components/badge/badge-button.js +1 -0
  10. package/dist/components/badge/badge-root.d.ts +4 -1
  11. package/dist/components/breadcrumb/breadcrumb-root.d.ts +1 -0
  12. package/dist/components/button/button-variants.js +7 -0
  13. package/dist/components/button-group/button-group-root.js +4 -0
  14. package/dist/components/card/card-root.d.ts +1 -0
  15. package/dist/components/card/card-root.js +1 -0
  16. package/dist/components/checkbox-card/checkbox-card-root.d.ts +1 -1
  17. package/dist/components/checkbox-field/checkbox-field-root.d.ts +4 -1
  18. package/dist/components/context-menu/context-menu-checkbox-item.d.ts +1 -1
  19. package/dist/components/context-menu/context-menu-content.d.ts +1 -1
  20. package/dist/components/context-menu/context-menu-item.d.ts +1 -1
  21. package/dist/components/context-menu/context-menu-radio-item.d.ts +1 -1
  22. package/dist/components/context-menu/context-menu-separator.d.ts +2 -2
  23. package/dist/components/context-menu/context-menu-separator.js +1 -1
  24. package/dist/components/context-menu/context-menu-sub-trigger.d.ts +1 -1
  25. package/dist/components/country-combobox/country-combobox-root.d.ts +1 -1
  26. package/dist/components/dot/dot-root.js +1 -0
  27. package/dist/components/drawer/drawer-root.d.ts +1 -0
  28. package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +1 -1
  29. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +1 -1
  30. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +1 -1
  31. package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +1 -1
  32. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -2
  33. package/dist/components/dropdown-menu/dropdown-menu-separator.js +1 -1
  34. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
  35. package/dist/components/empty/empty-root.js +1 -0
  36. package/dist/components/expand-button/expand-button-root.js +1 -0
  37. package/dist/components/field/field-error.d.ts +1 -0
  38. package/dist/components/field/field-variants.js +1 -0
  39. package/dist/components/icon-box/icon-box-root.js +4 -0
  40. package/dist/components/identified-surface.d.ts +5 -0
  41. package/dist/components/input/input-variants.js +1 -0
  42. package/dist/components/input-card/input-card-root.d.ts +3 -0
  43. package/dist/components/input-group/input-group-button.d.ts +9 -5
  44. package/dist/components/item/item-group.js +1 -0
  45. package/dist/components/item/item-media.d.ts +8 -0
  46. package/dist/components/item/item-media.js +1 -0
  47. package/dist/components/item/item-root.d.ts +1 -0
  48. package/dist/components/item/item-root.js +1 -0
  49. package/dist/components/kbd/kbd-root.js +2 -0
  50. package/dist/components/menu-item/menu-item-variants.js +5 -0
  51. package/dist/components/menu-parts-types.d.ts +82 -0
  52. package/dist/components/menu-parts-types.js +1 -0
  53. package/dist/components/menu-parts.d.ts +3 -66
  54. package/dist/components/menubar/menubar-checkbox-item.d.ts +1 -1
  55. package/dist/components/menubar/menubar-content.d.ts +1 -1
  56. package/dist/components/menubar/menubar-item.d.ts +1 -1
  57. package/dist/components/menubar/menubar-radio-item.d.ts +1 -1
  58. package/dist/components/menubar/menubar-separator.d.ts +2 -2
  59. package/dist/components/menubar/menubar-separator.js +1 -1
  60. package/dist/components/menubar/menubar-sub-trigger.d.ts +1 -1
  61. package/dist/components/phone-input/phone-input-root.js +2 -0
  62. package/dist/components/pill/pill-root.d.ts +1 -0
  63. package/dist/components/pill/pill-variants.js +3 -0
  64. package/dist/components/popover/popover-root.d.ts +2 -0
  65. package/dist/components/progress/progress-root.d.ts +2 -0
  66. package/dist/components/scroll-frame/scroll-frame-root.d.ts +8 -2
  67. package/dist/components/segmented-control/segmented-control-root.d.ts +8 -2
  68. package/dist/components/select/select-content.d.ts +1 -0
  69. package/dist/components/select/select-trigger.d.ts +10 -2
  70. package/dist/components/select/select-trigger.js +1 -1
  71. package/dist/components/sidepanel/sidepanel-header.d.ts +4 -0
  72. package/dist/components/sub-navigation/sub-navigation-link.d.ts +1 -0
  73. package/dist/components/swatch/swatch-tile.d.ts +2 -1
  74. package/dist/components/swatch/swatch-tile.js +1 -1
  75. package/dist/components/swatch-group/swatch-group-item.d.ts +1 -1
  76. package/dist/components/swatch-selector/swatch-selector-item.d.ts +1 -1
  77. package/dist/components/tab-navigation/tab-navigation-link.d.ts +1 -0
  78. package/dist/components/tabs/tabs-panel.d.ts +4 -0
  79. package/dist/components/tabs/tabs-variants.js +4 -0
  80. package/dist/components/thinking-loader/thinking-loader-counter.d.ts +2 -0
  81. package/dist/components/thinking-loader/thinking-loader-icon.d.ts +2 -0
  82. package/dist/components/thinking-loader/thinking-loader-step.d.ts +2 -0
  83. package/dist/components/toggle/toggle-root.js +2 -0
  84. package/dist/components/voice/voice-error-popover.d.ts +2 -0
  85. package/dist/components/voice/voice-pill.d.ts +2 -0
  86. package/dist/compositions/attribute-card.d.ts +1 -0
  87. package/dist/compositions/card-grid/card-grid-rows.d.ts +13 -0
  88. package/dist/compositions/data-grid/data-grid-checkbox.d.ts +8 -0
  89. package/dist/compositions/data-grid/data-grid-expand.d.ts +1 -0
  90. package/dist/compositions/data-grid/data-grid-filterable-header.d.ts +1 -0
  91. package/dist/compositions/data-grid/data-grid-types.d.ts +6 -0
  92. package/dist/compositions/data-grid-column-header/data-grid-column-header-root.d.ts +5 -0
  93. package/dist/compositions/data-grid-table/data-grid-table-body.d.ts +13 -1
  94. package/dist/compositions/data-grid-table/data-grid-table-body.js +1 -1
  95. package/dist/compositions/data-grid-table/data-grid-table-header.d.ts +5 -0
  96. package/dist/compositions/document-list/document-list-icon.d.ts +1 -0
  97. package/dist/compositions/document-list/document-list-root.js +4 -0
  98. package/dist/compositions/editorial-card/editorial-card-content.d.ts +2 -0
  99. package/dist/compositions/file-upload/file-upload-dropzone.d.ts +3 -0
  100. package/dist/compositions/folder-tile/folder-tile-types.d.ts +2 -0
  101. package/dist/compositions/mobile-navigation/mobile-navigation-header.d.ts +5 -2
  102. package/dist/compositions/mobile-navigation/mobile-navigation-header.js +0 -1
  103. package/dist/compositions/mobile-navigation/mobile-navigation-item.d.ts +2 -0
  104. package/dist/compositions/mobile-navigation/mobile-navigation-profile.d.ts +1 -0
  105. package/dist/compositions/mobile-navigation/mobile-navigation-root.d.ts +1 -0
  106. package/dist/compositions/page-toolbar/page-toolbar-applied.d.ts +4 -1
  107. package/dist/compositions/page-toolbar/page-toolbar-sort.d.ts +3 -0
  108. package/dist/compositions/product-card/product-card-content.d.ts +1 -0
  109. package/dist/compositions/product-card/product-card-image-types.d.ts +8 -2
  110. package/dist/compositions/product-card/product-card-provider-types.d.ts +47 -2
  111. package/dist/compositions/product-card/product-card-root.d.ts +1 -0
  112. package/dist/compositions/product-card/product-card-swatch.d.ts +2 -0
  113. package/dist/compositions/product-card/product-card-tools-types.d.ts +6 -0
  114. package/dist/compositions/product-specifications-selector/product-specifications-selector.d.ts +14 -0
  115. package/dist/compositions/quick-view/quick-view-body.d.ts +1 -1
  116. package/dist/compositions/sidebar/sidebar-group.d.ts +5 -1
  117. package/dist/compositions/sidebar/sidebar-menu-button.d.ts +11 -0
  118. package/dist/compositions/sidebar/sidebar-menu-sub.d.ts +5 -1
  119. package/dist/compositions/sidebar/sidebar-trigger.d.ts +3 -1
  120. package/dist/compositions/variant-selector/variant-selector-item.d.ts +1 -0
  121. package/dist/data/docs-manifest.js +727 -203
  122. package/dist/utils/with-test-id.d.ts +1 -0
  123. package/package.json +1 -1
@@ -5,6 +5,7 @@ interface AttributeCardProps {
5
5
  attributeLabel: string;
6
6
  /** CSS class name */
7
7
  className?: string;
8
+ /** Icon component (e.g. a Lucide icon), not a rendered element; shown small and muted at the top right. */
8
9
  icon?: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
9
10
  /** Current value */
10
11
  valueLabel: string;
@@ -5,20 +5,33 @@ export interface CardGridRowMetrics {
5
5
  rowWidth: number;
6
6
  }
7
7
  export interface CardGridRowsProps<T> extends Omit<ComponentProps<"div">, "children"> {
8
+ /** Stable unique key for an item, such as its id; never the array index. */
8
9
  getItemKey: (item: T) => string;
10
+ /** Stable key for a row. Defaults to `row-<rowIndex>`; supply one when rows can reorder or be re-chunked. */
9
11
  getRowKey?: (row: T[], rowIndex: number) => string;
12
+ /**
13
+ * Pixel `cardWidth` and `gap` the rows were chunked with (e.g. from
14
+ * `calculateColumns`). They only size `renderAfterRow`'s `rowWidth`; they do
15
+ * not lay the cards out.
16
+ */
10
17
  metrics: Omit<CardGridRowMetrics, "rowWidth">;
18
+ /**
19
+ * Content rendered beneath a row, such as an expanded detail panel. Receives
20
+ * `metrics` with `rowWidth`, the row's pixel width, so the panel can align to it.
21
+ */
11
22
  renderAfterRow?: (props: {
12
23
  metrics: CardGridRowMetrics;
13
24
  row: T[];
14
25
  rowIndex: number;
15
26
  }) => ReactNode;
27
+ /** Renders one item's card; each result is wrapped in a `CardGridItem`. `index` is the position within its row. */
16
28
  renderItem: (props: {
17
29
  index: number;
18
30
  item: T;
19
31
  row: T[];
20
32
  rowIndex: number;
21
33
  }) => ReactNode;
34
+ /** Items already chunked into rows, e.g. with `chunkIntoRows`; one `CardGrid` is rendered per row. */
22
35
  rows: T[][];
23
36
  }
24
37
  /**
@@ -4,18 +4,26 @@ import type { DataGridColumnDef as ColumnDef, DataGridRow as Row, DataGridCoreTa
4
4
  import type * as React from "react";
5
5
  type DataGridControlSize = Extract<ComponentSize, "xs" | "sm">;
6
6
  export type DataGridCheckboxProps = Omit<React.ComponentProps<typeof Checkbox>, "size"> & {
7
+ /**
8
+ * Checkbox size; the grid only uses the two compact steps.
9
+ * @default "xs"
10
+ */
7
11
  size?: DataGridControlSize;
8
12
  };
9
13
  /** Grid-tuned {@link Checkbox} (compact sizing, card background) for selection cells. */
10
14
  export declare const DataGridCheckbox: ({ size, className, ...props }: DataGridCheckboxProps) => React.JSX.Element;
11
15
  export interface DataGridRowSelectAllProps<TData extends object> {
16
+ /** Disable the checkbox, e.g. while loading or when the page has no rows. */
12
17
  disabled?: boolean;
18
+ /** The TanStack table whose current-page rows this checkbox selects. */
13
19
  table: Table<TData>;
14
20
  }
15
21
  /** Header checkbox that toggles selection of every row on the current page, with an indeterminate partial state. */
16
22
  export declare const DataGridRowSelectAll: <TData extends object>({ table, disabled, }: DataGridRowSelectAllProps<TData>) => React.JSX.Element;
17
23
  export interface DataGridRowSelectProps<TData extends object> {
24
+ /** Disable the checkbox; `createSelectionColumn` sets it when the row cannot be selected. */
18
25
  disabled?: boolean;
26
+ /** The TanStack row this checkbox selects. */
19
27
  row: Row<TData>;
20
28
  }
21
29
  /** Per-row selection checkbox; reflects sub-row partial selection as indeterminate when the row model supports it. */
@@ -7,6 +7,7 @@ export interface DataGridExpandToggleProps<TData extends object> {
7
7
  collapsedIcon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
8
8
  /** Expanded icon */
9
9
  expandedIcon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
10
+ /** The TanStack row to expand or collapse. The toggle renders nothing unless `row.getCanExpand()` is true. */
10
11
  row: Row<TData>;
11
12
  }
12
13
  /**
@@ -5,6 +5,7 @@ export type { FilterOption } from "./data-grid-types.js";
5
5
  interface DataGridFilterableHeaderProps<TData extends object, TValue> {
6
6
  children: ReactNode;
7
7
  className?: string;
8
+ /** The TanStack column this header sorts and filters. */
8
9
  column: Column<TData, TValue>;
9
10
  /** Filter options - enables the facets section */
10
11
  options?: FilterOption[];
@@ -90,7 +90,13 @@ export interface DataGridProps<TData extends object> {
90
90
  left?: string[];
91
91
  right?: string[];
92
92
  };
93
+ /**
94
+ * Set while the application fetches rows. The body shows placeholder rows or
95
+ * a spinner per `loadingMode`, and the select-all checkbox and
96
+ * `DataGridColumnHeader` buttons are disabled.
97
+ */
93
98
  loading?: boolean;
99
+ /** Text beside the spinner while loading; only shown when `loadingMode` is `"spinner"`. Defaults to "Loading...". */
94
100
  loadingMessage?: ReactNode | string;
95
101
  /**
96
102
  * How the loading state renders.
@@ -5,7 +5,12 @@ interface DataGridColumnHeaderProps<TData extends object, TValue> extends HTMLAt
5
5
  column: Column<TData, TValue>;
6
6
  /** Filter control rendered at the top of the header dropdown menu. */
7
7
  filter?: ReactNode;
8
+ /** Leading glyph shown before the title. */
8
9
  icon?: ReactNode;
10
+ /**
11
+ * Not read by the header. Pinning is controlled by `tableLayout.columnsPinnable`
12
+ * on `DataGrid` and the column's own `enablePinning`.
13
+ */
9
14
  pinnable?: boolean;
10
15
  /** Header label text. */
11
16
  title?: string;
@@ -16,25 +16,34 @@ declare const DataGridTableBodyRowSkeleton: ({ children, }: {
16
16
  /** Skeleton placeholder cell, sized to match the configured row height. */
17
17
  declare const DataGridTableBodyRowSkeletonCell: <TData extends object>({ children, column, }: {
18
18
  children: ReactNode;
19
+ /** The column this placeholder cell sits in; supplies pinning, edge and `meta.cellClassName` styling. */
19
20
  column: Column<TData>;
20
21
  }) => React.JSX.Element;
21
22
  /** Data `<tr>`; fires `props.onRowClick` and reflects selection via `data-state="selected"`. */
22
23
  declare const DataGridTableBodyRow: <TData extends object>({ children, row, dndRef, dndStyle, dataIndex, }: {
23
24
  children: ReactNode;
25
+ /** The TanStack row to render; its selection state sets `data-state="selected"` and its original data goes to `onRowClick`. */
24
26
  row: Row<TData>;
27
+ /** Ref attached to the `<tr>`; the virtualiser passes its row-measuring ref here, a drag library can pass its node ref. */
25
28
  dndRef?: React.Ref<HTMLTableRowElement>;
29
+ /** Inline style merged over the row height, e.g. a drag library's transform. */
26
30
  dndStyle?: CSSProperties;
31
+ /** Row position in the full row model, written to `data-index` so the virtualiser can find the row when measuring. */
27
32
  dataIndex?: number;
28
33
  }) => React.JSX.Element;
29
34
  /** Full-width expansion row that renders the column meta `expandedContent` for its row. */
30
35
  declare const DataGridTableBodyRowExpandded: <TData extends object>({ row, }: {
36
+ /** The expanded row; its `original` data is passed to the first column's `meta.expandedContent`. */
31
37
  row: Row<TData>;
32
38
  }) => React.JSX.Element;
33
39
  /** Data `<td>`; applies pinning styles and drops its bottom border while the row is expanded. */
34
40
  declare const DataGridTableBodyRowCell: <TData extends object>({ children, cell, dndRef, dndStyle, }: {
35
41
  children: ReactNode;
42
+ /** The TanStack cell to render; its column sets pinning, edge and `meta.cellClassName` styling. */
36
43
  cell: Cell<TData>;
44
+ /** Ref attached to the `<td>`, for a drag library's node ref. */
37
45
  dndRef?: React.Ref<HTMLTableCellElement>;
46
+ /** Inline style merged over the pinning styles, e.g. a drag library's transform. */
38
47
  dndStyle?: CSSProperties;
39
48
  }) => React.JSX.Element;
40
49
  /** Empty-state row; shows `props.emptyMessage` or "No data available". */
@@ -43,11 +52,14 @@ declare const DataGridTableEmpty: () => React.JSX.Element;
43
52
  declare const DataGridTableLoader: () => React.JSX.Element;
44
53
  /** Per-row selection checkbox with an active-row accent bar; supports the indeterminate state. */
45
54
  declare const DataGridTableRowSelect: <TData extends object>({ row, size, }: {
55
+ /** The TanStack row this checkbox selects. */
46
56
  row: Row<TData>;
57
+ /** Mirrors the table's size: `"2xs"` and `"xs"` (or omitted) give the `"xs"` checkbox, anything larger the `"sm"` one. */
47
58
  size?: ComponentSize;
48
59
  }) => React.JSX.Element;
49
60
  /** Header select-all checkbox for the current page; disabled while loading or when empty. */
50
- declare const DataGridTableRowSelectAll: ({ size }: {
61
+ declare const DataGridTableRowSelectAll: ({ size, }: {
62
+ /** Mirrors the table's size: `"2xs"` and `"xs"` (or omitted) give the `"xs"` checkbox, anything larger the `"sm"` one. */
51
63
  size?: ComponentSize;
52
64
  }) => React.JSX.Element;
53
65
  export { flexRender } from "@tanstack/react-table";
@@ -126,7 +126,7 @@ const DataGridTableRowSelect = ({ row, size, }) => {
126
126
  }, size: dataGridSize })] }));
127
127
  };
128
128
  /** Header select-all checkbox for the current page; disabled while loading or when empty. */
129
- const DataGridTableRowSelectAll = ({ size }) => {
129
+ const DataGridTableRowSelectAll = ({ size, }) => {
130
130
  const { table, recordCount, loading } = useDataGrid();
131
131
  const isSmOrLarger = size ? size !== "2xs" && size !== "xs" : false;
132
132
  const dataGridSize = isSmOrLarger ? "sm" : "xs";
@@ -13,17 +13,22 @@ declare const DataGridTableHead: ({ children }: {
13
13
  /** Header `<tr>` for a single header group. */
14
14
  declare const DataGridTableHeadRow: <TData extends object>({ children, headerGroup, }: {
15
15
  children: ReactNode;
16
+ /** The TanStack header group this row renders; it supplies the row's React key. */
16
17
  headerGroup: HeaderGroup<TData>;
17
18
  }) => React.JSX.Element;
18
19
  /** Header `<th>`; resolves column pinning position and sizing from context. */
19
20
  declare const DataGridTableHeadRowCell: <TData extends object>({ children, header, dndRef, dndStyle, }: {
20
21
  children: ReactNode;
22
+ /** The TanStack header this `<th>` renders; its column sets size, pinning and `meta.headerClassName`. */
21
23
  header: Header<TData>;
24
+ /** Ref attached to the `<th>`, for a drag library's node ref. */
22
25
  dndRef?: React.Ref<HTMLTableCellElement>;
26
+ /** Inline style merged over width and pinning styles, e.g. a drag library's transform. */
23
27
  dndStyle?: CSSProperties;
24
28
  }) => React.JSX.Element;
25
29
  /** Column-resize handle; drag to resize, double-click to reset the column width. */
26
30
  declare const DataGridTableHeadRowCellResize: <TData extends object>({ header, }: {
31
+ /** The header whose column this handle resizes. */
27
32
  header: Header<TData>;
28
33
  }) => React.JSX.Element;
29
34
  export { flexRender } from "@tanstack/react-table";
@@ -1,6 +1,7 @@
1
1
  import type { LucideIcon } from "lucide-react";
2
2
  import type React from "react";
3
3
  export interface DocumentListIconProps extends Omit<React.ComponentProps<"div">, "children"> {
4
+ /** Icon component (a Lucide icon), not a rendered element; sized from the list's `size`. */
4
5
  icon: LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>;
5
6
  }
6
7
  /**
@@ -8,6 +8,10 @@ const documentListVariants = cva("group/document-list flex flex-col", {
8
8
  variant: "grouped",
9
9
  },
10
10
  variants: {
11
+ /**
12
+ * Container treatment: `"grouped"` is one bordered, rounded card with the rows inside, `"divided"` separates rows with hairlines and no frame, `"separated"` leaves a gap between rows so each can carry its own surface.
13
+ * @default "grouped"
14
+ */
11
15
  variant: {
12
16
  divided: "divide-border divide-y",
13
17
  separated: "gap-3",
@@ -1,6 +1,8 @@
1
1
  export interface EditorialCardContentProps {
2
2
  className?: string;
3
+ /** Small muted line above the title, such as a category or date. Omitted when empty. */
3
4
  subtitle?: string;
5
+ /** Main line, shown larger and medium weight. */
4
6
  title: string;
5
7
  }
6
8
  /**
@@ -17,8 +17,11 @@ interface FileUploadDropzoneProps {
17
17
  onClick?: () => void;
18
18
  /** Drag event handlers from useFileUpload */
19
19
  onDragEnter?: (e: DragEvent<HTMLElement>) => void;
20
+ /** Fires when a drag leaves the zone; pass `handleDragLeave` to clear the drag state. */
20
21
  onDragLeave?: (e: DragEvent<HTMLElement>) => void;
22
+ /** Fires continuously while a drag is over the zone; pass `handleDragOver`, which cancels the default so the zone accepts a drop. */
21
23
  onDragOver?: (e: DragEvent<HTMLElement>) => void;
24
+ /** Fires when files are dropped; pass `handleDrop` to validate and add them. */
22
25
  onDrop?: (e: DragEvent<HTMLElement>) => void;
23
26
  /** Ref for the dropzone element */
24
27
  ref?: Ref<HTMLButtonElement>;
@@ -36,10 +36,12 @@ export interface FolderTileProps extends Omit<HTMLMotionProps<"button">, "childr
36
36
  openOnHover?: boolean;
37
37
  /** Custom image renderer for frameworks such as Next.js. */
38
38
  renderImage?: (props: FolderTileImageProps) => ReactNode;
39
+ /** Marks the folder as chosen: selected styling and `aria-pressed="true"`. Has no effect while `showSelectedState` is false. */
39
40
  selected?: boolean;
40
41
  /** Whether selected styling is rendered when `selected` is true. */
41
42
  showSelectedState?: boolean;
42
43
  /** Explicit visual state. When omitted, derived from material count. */
43
44
  state?: FolderTileState;
45
+ /** Rendered as `data-testid` on the outer wrapper (not the button), for Playwright targeting. */
44
46
  testId?: string;
45
47
  }
@@ -36,10 +36,12 @@ export declare const MobileNavigationHeaderSearchSlot: ({ className, ...props }:
36
36
  * Pass short `children` (a count, say) beside the `icon` and the pill widens
37
37
  * from its 56px minimum to fit them, keeping the same height.
38
38
  *
39
- * @param props.emphasis - Button emphasis. @default "soft"
40
39
  * @bestPractice Keep children to a few characters, such as a cart count, and give the action an `aria-label` that says what the number means.
41
40
  */
42
- export declare const MobileNavigationHeaderAction: ({ children, className, emphasis, ...props }: React.ComponentProps<typeof Button>) => React.JSX.Element;
41
+ export declare const MobileNavigationHeaderAction: ({ children, className, emphasis, ...props }: Omit<React.ComponentProps<typeof Button>, "emphasis"> & {
42
+ /** Visual weight, as on Button. @default "soft" */
43
+ emphasis?: React.ComponentProps<typeof Button>["emphasis"];
44
+ }) => React.JSX.Element;
43
45
  /** Header action showing the brand logo, typically used to open the navigation. */
44
46
  export declare const MobileNavigationBrandTrigger: ({ className, ...props }: Omit<React.ComponentProps<typeof Button>, "children" | "icon">) => React.JSX.Element;
45
47
  /** Brand logo plus stacked wordmark lockup for the drawer header. */
@@ -50,5 +52,6 @@ export declare const MobileNavigationBrandLockup: ({ className, ...props }: Reac
50
52
  * @param props.onClose - Invoked when the close button is pressed.
51
53
  */
52
54
  export declare const MobileNavigationHeader: ({ className, onClose, ...props }: Omit<React.ComponentProps<typeof Flex>, "children"> & {
55
+ /** Called when the close button is pressed; set your open state to false here. */
53
56
  onClose: () => void;
54
57
  }) => React.JSX.Element;
@@ -38,7 +38,6 @@ export const MobileNavigationHeaderSearchSlot = ({ className, ...props }) => (_j
38
38
  * Pass short `children` (a count, say) beside the `icon` and the pill widens
39
39
  * from its 56px minimum to fit them, keeping the same height.
40
40
  *
41
- * @param props.emphasis - Button emphasis. @default "soft"
42
41
  * @bestPractice Keep children to a few characters, such as a cart count, and give the action an `aria-label` that says what the number means.
43
42
  */
44
43
  export const MobileNavigationHeaderAction = ({ children, className, emphasis = "soft", ...props }) => (_jsx(Button, { className: cn("dark:bg-surface-2 h-10 min-w-14 bg-white", className), emphasis: emphasis, radius: "full", size: children === undefined ? "icon-lg" : "lg", ...props, children: children }));
@@ -35,9 +35,11 @@ export interface MobileNavigationProjectItemProps {
35
35
  active?: boolean;
36
36
  /** Dim the label to indicate an archived project. */
37
37
  archived?: boolean;
38
+ /** Project name; truncates to one line. */
38
39
  label: React.ReactNode;
39
40
  /** Invoked when the trailing action button is pressed. */
40
41
  onAction: () => void;
42
+ /** Icon for the trailing action button, such as an ellipsis for project options. */
41
43
  actionIcon: NavigationIcon;
42
44
  /** Accessible label for the trailing action button. */
43
45
  actionLabel: string;
@@ -16,6 +16,7 @@ export interface MobileNavigationProfileActionProps extends Omit<React.Component
16
16
  */
17
17
  export declare const MobileNavigationProfileAction: ({ avatarName, className, displayName, loading, userAvatarUrl, ...props }: MobileNavigationProfileActionProps) => React.JSX.Element;
18
18
  export interface MobileNavigationDrawerProfileProps {
19
+ /** The user's name, shown in medium weight; also the avatar image's alt text. */
19
20
  displayName: string;
20
21
  /** Secondary line under the name; hidden when absent. */
21
22
  email: string | undefined;
@@ -27,6 +27,7 @@ export type NavigationIcon = IconComponent;
27
27
  */
28
28
  export declare const MobileNavigationRoot: ({ "aria-label": ariaLabel, children, className, onClose, ...props }: Omit<HTMLMotionProps<"div">, "children"> & {
29
29
  children?: React.ReactNode;
30
+ /** Called when Escape is pressed. The overlay never unmounts itself, so set your open state to false here. */
30
31
  onClose?: () => void;
31
32
  }) => React.JSX.Element;
32
33
  /**
@@ -19,7 +19,10 @@ export interface PageToolbarAppliedProps extends ComponentProps<typeof Flex> {
19
19
  children?: ReactNode;
20
20
  /** Removes every applied filter. */
21
21
  onClear: () => void;
22
- /** @default "Clear all" */
22
+ /**
23
+ * Text of the button that calls `onClear`.
24
+ * @default "Clear all"
25
+ */
23
26
  clearLabel?: string;
24
27
  /**
25
28
  * Draw a short rule after the group, before the suggestions that follow.
@@ -12,8 +12,11 @@ export interface PageToolbarSortProps {
12
12
  direction?: PageToolbarSortDirection | undefined;
13
13
  /** Names the control for assistive technology. @default "Sort" */
14
14
  label?: string;
15
+ /** Called with `"asc"` or `"desc"` when the user picks a direction. The Ascending and Descending choices only appear when both this and `direction` are set. */
15
16
  onDirectionChange?: (direction: PageToolbarSortDirection) => void;
17
+ /** Called with the chosen option's `value` when the user picks an order. */
16
18
  onValueChange: (value: string) => void;
19
+ /** The orders to offer, each a `value` and a `label`; the label of the current one shows on the button. */
17
20
  options: readonly PageToolbarSortOption[];
18
21
  /** The current order's value; one matching no option reads as unsorted. */
19
22
  value: string;
@@ -1,6 +1,7 @@
1
1
  import type { ProductCardProps } from "./product-card-types.js";
2
2
  type ProductCardContentProps = Omit<ProductCardProps, "product" | "variantId" | "mode" | "active" | "addGlyph" | "availability" | "dragging" | "labels" | "menuOpen" | "onAdd" | "onFindSimilar" | "price" | "processing" | "showSwatches" | "maxSwatches" | "onVariantChange" | "productUrl" | "renderTools" | "renderImage" | "renderAddToCart" | "dragAdapter">;
3
3
  declare const ProductCardContentBase: ({ className, similarityScore, overrideImageUrl, onAddToCartSuccess, priority, ...props }: ProductCardContentProps & {
4
+ /** Called when the `renderAddToCart` slot reports a successful add, via the `onAdded` it receives. */
4
5
  onAddToCartSuccess?: (() => void) | undefined;
5
6
  }) => import("react").JSX.Element;
6
7
  export declare const ProductCardContent: import("react").MemoExoticComponent<typeof ProductCardContentBase>;
@@ -46,11 +46,17 @@ interface ProductCardDragAdapterProps {
46
46
  */
47
47
  type ProductCardDragAdapter = ComponentType<ProductCardDragAdapterProps>;
48
48
  interface ProductCardImageProps extends ComponentProps<"div"> {
49
- /** Override image URL - used for visual search to show the matched image */
49
+ /** Image URL shown in place of the variant's first image, e.g. the matched crop in a visual search. */
50
50
  overrideImageUrl?: string | undefined;
51
- /** Prioritise loading this image (sets loading="eager" and adds preload link) */
51
+ /** Load this image eagerly (`loading="eager"`, high fetch priority in the default renderer); forwarded to `renderImage`. */
52
52
  priority?: boolean | undefined;
53
+ /**
54
+ * Show the `similarityScore` pill. Needs `similarityScore` too, and is
55
+ * ignored outside `"single"` and `"inspiration"` modes.
56
+ * @default false
57
+ */
53
58
  showSimilarityScore?: boolean | undefined;
59
+ /** Match from `0` to `1`, shown as a rounded percentage (`0.87` reads `87%`). */
54
60
  similarityScore?: number | undefined;
55
61
  }
56
62
  /**
@@ -92,6 +92,12 @@ interface ProductCardProviderProps {
92
92
  */
93
93
  action?: ProductCardActionProps | undefined;
94
94
  children: ReactNode;
95
+ /**
96
+ * Which parts of the card show: brand, name, line clamps, swatches, add to
97
+ * cart. `ProductCard` takes the same switches as flat props (`showProductBrand`
98
+ * and so on) and builds this for you; pass `display` only when using
99
+ * `ProductCardProvider` directly. Each key falls back to its own default.
100
+ */
95
101
  display?: ProductCardDisplayOptions | undefined;
96
102
  /**
97
103
  * Component slot that wires drag behaviour (e.g. dnd-kit `useDraggable`)
@@ -206,6 +212,12 @@ interface ProductCardProviderProps {
206
212
  * that pass `renderAddToCart` and nothing else.
207
213
  */
208
214
  primaryAction?: ProductCardPrimaryAction | undefined;
215
+ /**
216
+ * The material to show. In `"group"` mode its `variants` become the colourway
217
+ * swatches (the card falls back to the product itself when there are none),
218
+ * and `images[0]` of the selected variant is the photograph. A product whose
219
+ * selected variant has no images renders a "no photography" placeholder.
220
+ */
209
221
  product: ProductCardProduct;
210
222
  /**
211
223
  * Builds the href of a product's page. Receives the selected variant.
@@ -251,15 +263,43 @@ interface ProductCardProviderProps {
251
263
  * Props for the main ProductCard component.
252
264
  */
253
265
  type ProductCardProps = ComponentProps<"div"> & Pick<ProductCardProviderProps, "action" | "addGlyph" | "availability" | "dragAdapter" | "dragging" | "active" | "labels" | "linkAs" | "linkPrefetch" | "maxSwatches" | "menuOpen" | "mode" | "onAdd" | "onCardClick" | "onFindSimilar" | "onQuickView" | "onVariantChange" | "price" | "primaryAction" | "processing" | "product" | "productUrl" | "renderAddToCart" | "renderImage" | "renderTools" | "showActivePointer" | "statusBadge" | "variantId" | "width"> & {
254
- /** Override image URL - used for visual search to show the matched image */
266
+ /**
267
+ * Image URL shown in place of the product's own first image, e.g. the
268
+ * matched crop in a visual search. Honoured in `"single"` and `"swatch"`
269
+ * modes only.
270
+ */
255
271
  overrideImageUrl?: string | undefined;
256
- /** Prioritise loading images (sets loading="eager" and adds preload link) */
272
+ /**
273
+ * Load the main image eagerly (`loading="eager"`, high fetch priority in the
274
+ * default renderer, and forwarded to `renderImage`). Set it on above-the-fold
275
+ * cards, not the whole grid.
276
+ */
257
277
  priority?: boolean | undefined;
258
278
  /** How many lines the brand may take before it clamps; see `ProductCardDisplayOptions.brandLines`. */
259
279
  productBrandLines?: 1 | 2 | undefined;
280
+ /**
281
+ * How many lines the product name may take before it clamps. Choose `2`
282
+ * where names differ only at the end; rows stay level because the clamp is
283
+ * a maximum, not a reserved height.
284
+ * @default 1
285
+ */
260
286
  productNameLines?: 1 | 2 | undefined;
287
+ /**
288
+ * Show the cart control. It only ever appears when `renderAddToCart` is also
289
+ * supplied, and `primaryAction` can replace it with another action.
290
+ * @default true
291
+ */
261
292
  showAddToCart?: boolean | undefined;
293
+ /**
294
+ * Show the brand name above the product name. Cards without a brand name
295
+ * omit the line either way.
296
+ * @default true
297
+ */
262
298
  showProductBrand?: boolean | undefined;
299
+ /**
300
+ * Show the product name.
301
+ * @default true
302
+ */
263
303
  showProductName?: boolean | undefined;
264
304
  /**
265
305
  * Show the row of colourway swatches. Single-colour products and `single`
@@ -267,6 +307,11 @@ type ProductCardProps = ComponentProps<"div"> & Pick<ProductCardProviderProps, "
267
307
  * @default true
268
308
  */
269
309
  showSwatches?: boolean | undefined;
310
+ /**
311
+ * Visual-search match from `0` to `1` (not a percentage), shown as a
312
+ * rounded percentage pill over the image: `0.87` reads `87%`. Only
313
+ * `"single"` and `"inspiration"` modes show it; omit it for no pill.
314
+ */
270
315
  similarityScore?: number | undefined;
271
316
  };
272
317
  export type { ProductCardContextValue, ProductCardProps, ProductCardProviderProps, };
@@ -1,5 +1,6 @@
1
1
  import type { ProductCardProps } from "./product-card-types.js";
2
2
  declare const ProductCardBase: ({ className, product, variantId, mode, width, active, dragging, availability, labels, showActivePointer, similarityScore, overrideImageUrl, priority, showSwatches, showAddToCart, productBrandLines, productNameLines, showProductBrand, showProductName, maxSwatches, menuOpen, onAdd, addGlyph, onFindSimilar, price, processing, onCardClick, onVariantChange, linkAs, productUrl, linkPrefetch, renderTools, renderImage, renderAddToCart, dragAdapter, action, primaryAction, statusBadge, onQuickView, onAddToCartSuccess, ...props }: ProductCardProps & {
3
+ /** Called when the `renderAddToCart` slot reports a successful add, via the `onAdded` it receives. */
3
4
  onAddToCartSuccess?: (() => void) | undefined;
4
5
  }) => import("react").JSX.Element;
5
6
  /**
@@ -1,5 +1,7 @@
1
1
  interface ProductCardSwatchProps {
2
+ /** Image URL shown in place of the variant's first image. */
2
3
  overrideImageUrl?: string | undefined;
4
+ /** Load the tile's image eagerly; forwarded to `renderImage`. */
3
5
  priority?: boolean | undefined;
4
6
  }
5
7
  /**
@@ -1,6 +1,12 @@
1
1
  import type { ButtonProps } from "@instruments/materia-ui/components/button";
2
2
  import type { ReactNode } from "react";
3
3
  interface ProductCardToolsProps {
4
+ /**
5
+ * Whether the `renderTools` buttons are mounted. `ProductCard` sets it while
6
+ * the pointer or keyboard focus is inside the card, so a large grid does not
7
+ * render every hidden action.
8
+ * @default true
9
+ */
4
10
  active?: boolean;
5
11
  className?: string;
6
12
  }
@@ -14,7 +14,16 @@ interface SiblingWithAttributes {
14
14
  variantAttributes: VariantAttributes | null;
15
15
  }
16
16
  export interface ProductSpecificationsSelectorProps {
17
+ /**
18
+ * The current selection, keyed by filter key (`"color"` for `colorName`, otherwise the
19
+ * dimension name such as `"finish"`) to the selected option's `value`, or `null` for none.
20
+ */
17
21
  filters: Record<string, string | null>;
22
+ /**
23
+ * Called when an option is picked, with the filter key and the option's `value`;
24
+ * picking the selected option again sends `null` to clear it. When `onSiblingSelect` and
25
+ * `siblingsWithAttributes` find a matching sibling, that fires instead.
26
+ */
18
27
  onFilterChange: (key: string, value: string | null) => void;
19
28
  /** Callback when a sibling is selected (fallback variant selection) */
20
29
  onSiblingSelect?: (siblingId: string) => void;
@@ -26,6 +35,11 @@ export interface ProductSpecificationsSelectorProps {
26
35
  siblings?: Sibling[];
27
36
  /** Full sibling data with variant attributes for computing compatible options on hover */
28
37
  siblingsWithAttributes?: SiblingWithAttributes[];
38
+ /**
39
+ * The options on offer per dimension (`colorName`, `pattern`, `finish`, `size`, `width`,
40
+ * `length`, `substrate`, `finishType`). Each present dimension becomes one field, ordered
41
+ * with colourways first; an option with `available: false` is shown as unavailable.
42
+ */
29
43
  variantOptions: VariantOptions;
30
44
  }
31
45
  /**
@@ -1,6 +1,6 @@
1
1
  import { ScrollArea } from "@instruments/materia-ui/components/scroll-area";
2
2
  import type { ComponentProps } from "react";
3
- export type QuickViewBodyProps = Omit<ComponentProps<typeof ScrollArea>, "as" | "orientation" | "render"> & {
3
+ export type QuickViewBodyProps = Omit<ComponentProps<typeof ScrollArea>, "aria-label" | "as" | "orientation" | "render"> & {
4
4
  /** Names the scrolling region for assistive tech, e.g. "Product details". */
5
5
  "aria-label": string;
6
6
  };
@@ -6,7 +6,11 @@ export declare const SidebarGroup: ({ className, ...props }: React.ComponentProp
6
6
  /** Heading for a {@link SidebarGroup}; fades out (keeping layout) when collapsed to an icon rail. Pass `render` to use a custom element. */
7
7
  export declare const SidebarGroupLabel: ({ className, render, ...props }: useRender.ComponentProps<"div">) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
8
8
  /** Icon button pinned to a group's top-right corner (defaults to a `+`); hidden when collapsed unless `showWhenCollapsed`. */
9
- export declare const SidebarGroupAction: ({ className, icon, size, radius, emphasis, showWhenCollapsed, ...props }: React.ComponentProps<typeof Button> & {
9
+ export declare const SidebarGroupAction: ({ className, icon, size, radius, emphasis, showWhenCollapsed, ...props }: Omit<React.ComponentProps<typeof Button>, "emphasis" | "size"> & {
10
+ /** Size token, as on Button. @default "icon-sm" */
11
+ size?: React.ComponentProps<typeof Button>["size"];
12
+ /** Visual weight, as on Button. @default "ghost" */
13
+ emphasis?: React.ComponentProps<typeof Button>["emphasis"];
10
14
  /** Show the action button even when sidebar is collapsed */
11
15
  showWhenCollapsed?: boolean;
12
16
  }) => React.JSX.Element;
@@ -10,16 +10,27 @@ type SidebarMenuButtonProps = Omit<useRender.ComponentProps<"button">, "children
10
10
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
11
11
  /** Control tooltip visibility. Use `false` to hide tooltip (e.g., when a dropdown is open). */
12
12
  tooltipOpen?: boolean;
13
+ /**
14
+ * Row height and text size. Use `"xl"` in an icon-collapsible sidebar so the collapsed square centres on the rail.
15
+ * @default "base"
16
+ */
13
17
  size?: ComponentSize;
18
+ /**
19
+ * Surface treatment: `"input"` uses the sidebar's accent fill on hover and when active, `"default"` the standard accent tint, `"outline"` adds a ring.
20
+ * @default "input"
21
+ */
14
22
  variant?: "default" | "input" | "outline";
23
+ /** Leading icon component. When the sidebar collapses to the rail it is the only thing shown, unless `collapsedIcon` or `collapsedContent` replaces it. */
15
24
  icon?: IconComponent;
16
25
  /** Icon to show when sidebar is collapsed (overrides icon) */
17
26
  collapsedIcon?: IconComponent;
18
27
  /** Custom content to show when sidebar is collapsed (e.g., Avatar). Takes precedence over collapsedIcon. */
19
28
  collapsedContent?: React.ReactNode;
29
+ /** Trailing icon component, such as a chevron for a submenu. Replaces the `kbd` hint when both are set, and hides when the sidebar collapses. */
20
30
  suffixIcon?: IconComponent;
21
31
  /** Keep label/suffix visible even when the sidebar provider is collapsed. */
22
32
  forceExpanded?: boolean;
33
+ /** Keyboard shortcut keys shown as keycaps at the end of the row, one string per key (e.g. `["⌘", "K"]`). Hidden when collapsed or when `suffixIcon` is set. */
23
34
  kbd?: string[];
24
35
  children?: React.ReactNode;
25
36
  };
@@ -19,13 +19,17 @@ export declare const SidebarMenuSubScrollArea: ({ children, className, fade, max
19
19
  type SidebarMenuSubItemProps = React.ComponentProps<"li">;
20
20
  /** The `<li>` wrapper for a single submenu row. */
21
21
  export declare const SidebarMenuSubItem: ({ className, ...props }: SidebarMenuSubItemProps) => React.JSX.Element;
22
- type SidebarMenuSubButtonProps = Omit<MenuItemProps, "icon" | "dot"> & {
22
+ type SidebarMenuSubButtonProps = Omit<MenuItemProps, "dot" | "icon" | "iconClassName" | "size" | "variant"> & {
23
23
  /** Dot indicator in the left column (takes precedence over icon): `true` for a neutral dot, or a {@link Tone} to tint it. */
24
24
  dot?: boolean | Tone;
25
25
  /** Icon to display in the left icon column */
26
26
  icon?: IconComponent;
27
27
  /** Additional className for the icon */
28
28
  iconClassName?: string;
29
+ /** Row size, as on MenuItem. @default "xl" */
30
+ size?: MenuItemProps["size"];
31
+ /** Row style, as on MenuItem. @default "input" */
32
+ variant?: MenuItemProps["variant"];
29
33
  };
30
34
  /**
31
35
  * SidebarMenuSubButton UI component.
@@ -1,9 +1,11 @@
1
1
  import { Button } from "@instruments/materia-ui/components/button";
2
2
  import type React from "react";
3
3
  import type { IconComponent } from "../../tokens/icon-component.js";
4
- type SidebarTriggerProps = Omit<React.ComponentProps<typeof Button>, "icon"> & {
4
+ type SidebarTriggerProps = Omit<React.ComponentProps<typeof Button>, "emphasis" | "icon"> & {
5
5
  /** Icon to display. Defaults to PanelLeftCloseIcon. */
6
6
  icon?: IconComponent;
7
+ /** Visual weight, as on Button. @default "ghost" */
8
+ emphasis?: React.ComponentProps<typeof Button>["emphasis"];
7
9
  };
8
10
  /** Icon button that toggles the sidebar open/collapsed via {@link useSidebar}; must render inside a {@link SidebarProvider}. Any `onClick` runs before the toggle. */
9
11
  export declare const SidebarTrigger: ({ className, emphasis, onClick, icon, ...props }: SidebarTriggerProps) => React.JSX.Element;
@@ -8,6 +8,7 @@ export interface VariantSelectorItemProps {
8
8
  disabled?: boolean;
9
9
  /** Whether this option is highlighted (compatible with a hovered unavailable option) */
10
10
  highlighted?: boolean;
11
+ /** Picture shown inside the tile, such as an `<img>` of the variant; omit it for a plain `color` tile. */
11
12
  image?: ReactNode;
12
13
  /** Label text */
13
14
  label: string;