@instruments/materia-ui 0.4.5 → 0.4.7
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/agent-docs.md +4 -0
- package/dist/components/accordion/accordion-variants.js +1 -0
- package/dist/components/alert/alert-root.js +1 -0
- package/dist/components/anchor/anchor-root.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio-root.d.ts +7 -3
- package/dist/components/aspect-ratio/aspect-ratio-root.js +5 -3
- package/dist/components/avatar/avatar-badge.d.ts +1 -1
- package/dist/components/avatar/avatar-fallback.d.ts +1 -1
- package/dist/components/avatar/avatar-root.d.ts +1 -1
- package/dist/components/avatar/avatar-status.d.ts +2 -1
- package/dist/components/badge/badge-button.d.ts +1 -0
- package/dist/components/badge/badge-button.js +1 -0
- package/dist/components/badge/badge-root.d.ts +4 -1
- package/dist/components/breadcrumb/breadcrumb-root.d.ts +1 -0
- package/dist/components/button/button-variants.js +7 -0
- package/dist/components/button-group/button-group-root.js +4 -0
- package/dist/components/card/card-root.d.ts +1 -0
- package/dist/components/card/card-root.js +1 -0
- package/dist/components/checkbox-card/checkbox-card-root.d.ts +1 -1
- package/dist/components/checkbox-field/checkbox-field-root.d.ts +4 -1
- package/dist/components/context-menu/context-menu-checkbox-item.d.ts +1 -1
- package/dist/components/context-menu/context-menu-content.d.ts +1 -1
- package/dist/components/context-menu/context-menu-item.d.ts +1 -1
- package/dist/components/context-menu/context-menu-radio-item.d.ts +1 -1
- package/dist/components/context-menu/context-menu-separator.d.ts +2 -2
- package/dist/components/context-menu/context-menu-separator.js +1 -1
- package/dist/components/context-menu/context-menu-sub-trigger.d.ts +1 -1
- package/dist/components/dot/dot-root.js +1 -0
- package/dist/components/drawer/drawer-root.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-separator.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
- package/dist/components/empty/empty-root.js +1 -0
- package/dist/components/expand-button/expand-button-root.js +1 -0
- package/dist/components/field/field-error.d.ts +1 -0
- package/dist/components/field/field-variants.js +1 -0
- package/dist/components/icon-box/icon-box-root.js +4 -0
- package/dist/components/identified-surface.d.ts +5 -0
- package/dist/components/input/input-variants.js +1 -0
- package/dist/components/input-card/input-card-root.d.ts +3 -0
- package/dist/components/input-group/input-group-button.d.ts +7 -3
- package/dist/components/item/item-group.js +1 -0
- package/dist/components/item/item-media.d.ts +8 -0
- package/dist/components/item/item-media.js +1 -0
- package/dist/components/item/item-root.d.ts +1 -0
- package/dist/components/item/item-root.js +1 -0
- package/dist/components/kbd/kbd-root.js +2 -0
- package/dist/components/media-frame/media-frame-root.d.ts +2 -0
- package/dist/components/media-frame/media-frame-root.js +2 -0
- package/dist/components/menu-item/menu-item-variants.js +5 -0
- package/dist/components/menu-parts-types.d.ts +82 -0
- package/dist/components/menu-parts-types.js +1 -0
- package/dist/components/menu-parts.d.ts +3 -66
- package/dist/components/menubar/menubar-checkbox-item.d.ts +1 -1
- package/dist/components/menubar/menubar-content.d.ts +1 -1
- package/dist/components/menubar/menubar-item.d.ts +1 -1
- package/dist/components/menubar/menubar-radio-item.d.ts +1 -1
- package/dist/components/menubar/menubar-separator.d.ts +2 -2
- package/dist/components/menubar/menubar-separator.js +1 -1
- package/dist/components/menubar/menubar-sub-trigger.d.ts +1 -1
- package/dist/components/phone-input/phone-input-root.js +2 -0
- package/dist/components/pill/pill-root.d.ts +1 -0
- package/dist/components/pill/pill-variants.js +3 -0
- package/dist/components/popover/popover-root.d.ts +2 -0
- package/dist/components/progress/progress-root.d.ts +2 -0
- package/dist/components/scroll-frame/scroll-frame-root.d.ts +8 -2
- package/dist/components/segmented-control/segmented-control-root.d.ts +8 -2
- package/dist/components/select/select-content.d.ts +1 -0
- package/dist/components/select/select-trigger.d.ts +9 -1
- package/dist/components/select/select-trigger.js +1 -1
- package/dist/components/sidepanel/sidepanel-header.d.ts +4 -0
- package/dist/components/sub-navigation/sub-navigation-link.d.ts +1 -0
- package/dist/components/swatch/swatch-root.d.ts +2 -0
- package/dist/components/swatch/swatch-root.js +2 -0
- package/dist/components/swatch/swatch-tile.d.ts +2 -1
- package/dist/components/swatch/swatch-tile.js +1 -1
- package/dist/components/tab-navigation/tab-navigation-link.d.ts +1 -0
- package/dist/components/tabs/tabs-panel.d.ts +4 -0
- package/dist/components/tabs/tabs-variants.js +4 -0
- package/dist/components/thinking-loader/thinking-loader-counter.d.ts +2 -0
- package/dist/components/thinking-loader/thinking-loader-icon.d.ts +2 -0
- package/dist/components/thinking-loader/thinking-loader-step.d.ts +2 -0
- package/dist/components/toggle/toggle-root.js +2 -0
- package/dist/components/voice/voice-error-popover.d.ts +2 -0
- package/dist/components/voice/voice-pill.d.ts +2 -0
- package/dist/compositions/attribute-card.d.ts +1 -0
- package/dist/compositions/card-grid/card-grid-rows.d.ts +13 -0
- package/dist/compositions/data-grid/data-grid-checkbox.d.ts +8 -0
- package/dist/compositions/data-grid/data-grid-expand.d.ts +1 -0
- package/dist/compositions/data-grid/data-grid-filterable-header.d.ts +1 -0
- package/dist/compositions/data-grid/data-grid-types.d.ts +6 -0
- package/dist/compositions/data-grid-column-header/data-grid-column-header-root.d.ts +5 -0
- package/dist/compositions/data-grid-table/data-grid-table-body.d.ts +13 -1
- package/dist/compositions/data-grid-table/data-grid-table-body.js +1 -1
- package/dist/compositions/data-grid-table/data-grid-table-header.d.ts +5 -0
- package/dist/compositions/document-list/document-list-icon.d.ts +1 -0
- package/dist/compositions/document-list/document-list-root.js +4 -0
- package/dist/compositions/editorial-card/editorial-card-content.d.ts +2 -0
- package/dist/compositions/file-upload/file-upload-dropzone.d.ts +3 -0
- package/dist/compositions/folder-tile/folder-tile-types.d.ts +2 -0
- package/dist/compositions/mobile-navigation/mobile-navigation-header.d.ts +5 -2
- package/dist/compositions/mobile-navigation/mobile-navigation-header.js +0 -1
- package/dist/compositions/mobile-navigation/mobile-navigation-item.d.ts +2 -0
- package/dist/compositions/mobile-navigation/mobile-navigation-profile.d.ts +1 -0
- package/dist/compositions/mobile-navigation/mobile-navigation-root.d.ts +1 -0
- package/dist/compositions/page-toolbar/page-toolbar-applied.d.ts +4 -1
- package/dist/compositions/page-toolbar/page-toolbar-sort.d.ts +3 -0
- package/dist/compositions/product-card/product-card-content.d.ts +1 -0
- package/dist/compositions/product-card/product-card-image-types.d.ts +8 -2
- package/dist/compositions/product-card/product-card-provider-types.d.ts +47 -2
- package/dist/compositions/product-card/product-card-root.d.ts +3 -0
- package/dist/compositions/product-card/product-card-root.js +2 -0
- package/dist/compositions/product-card/product-card-swatch.d.ts +2 -0
- package/dist/compositions/product-card/product-card-tools-types.d.ts +6 -0
- package/dist/compositions/product-specifications-selector/product-specifications-selector.d.ts +14 -0
- package/dist/compositions/sidebar/sidebar-group.d.ts +4 -0
- package/dist/compositions/sidebar/sidebar-menu-button.d.ts +11 -0
- package/dist/compositions/sidebar/sidebar-menu-sub.d.ts +4 -0
- package/dist/compositions/sidebar/sidebar-trigger.d.ts +2 -0
- package/dist/compositions/variant-selector/variant-selector-item.d.ts +1 -0
- package/dist/data/docs-manifest.js +580 -32
- package/dist/utils/with-test-id.d.ts +1 -0
- package/package.json +2 -1
|
@@ -30,10 +30,12 @@ export const tabsListVariants = cva("inline-flex h-auto w-fit items-center justi
|
|
|
30
30
|
variant: "pill",
|
|
31
31
|
},
|
|
32
32
|
variants: {
|
|
33
|
+
/** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the style for every part, so set `variant` there. */
|
|
33
34
|
variant: {
|
|
34
35
|
pill: SEGMENTED_SHELL_BASE,
|
|
35
36
|
line: "gap-6",
|
|
36
37
|
},
|
|
38
|
+
/** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the size for every part, so set `size` there. */
|
|
37
39
|
size: {
|
|
38
40
|
"2xs": "",
|
|
39
41
|
xs: "",
|
|
@@ -86,7 +88,9 @@ export const tabsTriggerVariants = cva(`transition-color-shadow-border inline-fl
|
|
|
86
88
|
variant: "pill",
|
|
87
89
|
},
|
|
88
90
|
variants: {
|
|
91
|
+
/** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the size for every part, so set `size` there. */
|
|
89
92
|
size: { ...SEGMENTED_TRIGGER_TEXT },
|
|
93
|
+
/** Ignored on its own: the parent `Tabs` or `TabNavigation` sets the style for every part, so set `variant` there. */
|
|
90
94
|
variant: {
|
|
91
95
|
line: cn("text-muted-foreground hover:text-foreground data-active:text-foreground dark:text-gray-500 dark:hover:text-gray-300 dark:data-active:text-gray-100", focusRing()),
|
|
92
96
|
pill: "text-muted-foreground data-active:text-foreground rounded-full dark:text-gray-500 dark:data-active:text-gray-100",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { LucideIcon } from "lucide-react";
|
|
2
2
|
interface ThinkingLoaderIconProps {
|
|
3
|
+
/** Icon to show. Renders nothing when `undefined`. */
|
|
3
4
|
icon: LucideIcon | undefined;
|
|
5
|
+
/** Id of the current step. A new id makes the previous icon crossfade into this one. */
|
|
4
6
|
stepId: string;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
@@ -18,9 +18,11 @@ interface ThinkingLoaderStepProps {
|
|
|
18
18
|
hideIcon?: boolean;
|
|
19
19
|
/** Inherit font size from a containing `ThinkingLoader`. */
|
|
20
20
|
inheritSize?: boolean;
|
|
21
|
+
/** Sweeps a highlight across the label; `false` renders it as plain text. @default true */
|
|
21
22
|
shimmer?: boolean;
|
|
22
23
|
/** Shimmer highlight direction. Defaults to `"dark"`. */
|
|
23
24
|
shimmerVariant?: ShimmerVariant;
|
|
25
|
+
/** The step to show: its `label` is the text, and its `icon` leads it unless `hideIcon` is set. */
|
|
24
26
|
step: ThinkingStep;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
@@ -45,6 +45,7 @@ const toggleVariants = cva(cn(focusRing(), "border-border text-foreground bg-bac
|
|
|
45
45
|
variant: "default",
|
|
46
46
|
},
|
|
47
47
|
variants: {
|
|
48
|
+
/** How a pressed toggle shows it is on: `default` greys the fill and border, `secondary` darkens the border only. Inside a `ToggleGroup` the group's value wins. @default "default" */
|
|
48
49
|
variant: {
|
|
49
50
|
default: "data-pressed:border-muted-foreground data-pressed:bg-muted",
|
|
50
51
|
secondary: "data-pressed:border-foreground data-pressed:bg-background",
|
|
@@ -53,6 +54,7 @@ const toggleVariants = cva(cn(focusRing(), "border-border text-foreground bg-bac
|
|
|
53
54
|
// Old `shape` values map onto the shared Radius vocabulary by their actual
|
|
54
55
|
// class: old `square` was `rounded-lg` → "rounded"; old `round` was
|
|
55
56
|
// `rounded-full` → "full". Appearance is preserved exactly.
|
|
57
|
+
/** Corner shape: `rounded` for soft corners, `full` for a pill. There is no sharp option. Inside a `ToggleGroup` the group's value wins. @default "rounded" */
|
|
56
58
|
radius: {
|
|
57
59
|
rounded: "rounded-lg",
|
|
58
60
|
full: "rounded-full",
|
|
@@ -6,7 +6,9 @@ export interface VoiceErrorPopoverProps {
|
|
|
6
6
|
message: string;
|
|
7
7
|
/** When set, renders an action button (e.g. `"Retry"`) that calls `onAction`. */
|
|
8
8
|
actionLabel?: string;
|
|
9
|
+
/** Called when the action button is clicked. The button only appears when `actionLabel` is set. */
|
|
9
10
|
onAction?: () => void;
|
|
11
|
+
/** Called when the dismiss button is clicked. The parent should then set `open` to `false`. */
|
|
10
12
|
onDismiss?: () => void;
|
|
11
13
|
/** Accessible label for the dismiss button. @default "Dismiss" */
|
|
12
14
|
dismissLabel?: string;
|
|
@@ -6,7 +6,9 @@ export interface VoicePillProps {
|
|
|
6
6
|
level?: number;
|
|
7
7
|
/** Elapsed capture time in ms, shown as an `mm:ss` timer while recording. @default 0 */
|
|
8
8
|
elapsedMs?: number;
|
|
9
|
+
/** Called when the pill is pressed. The parent decides what the press does in each `state`, such as starting or stopping capture. */
|
|
9
10
|
onClick?: () => void;
|
|
11
|
+
/** Block presses and dim the pill. @default false */
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
/** Accessible label. The parent chooses copy per state - never hardcoded here. */
|
|
12
14
|
label: string;
|
|
@@ -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",
|
|
@@ -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>
|
|
41
|
+
export declare const MobileNavigationHeaderAction: ({ children, className, emphasis, ...props }: React.ComponentProps<typeof Button> & {
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
/**
|
|
@@ -33,6 +34,8 @@ declare const ProductCardBase: ({ className, product, variantId, mode, width, ac
|
|
|
33
34
|
* `linkAs={Link}` - the defaults are a plain `<img>` and `<a>`.
|
|
34
35
|
* @bestPractice Cart UI renders only when a `renderAddToCart` slot is
|
|
35
36
|
* provided; keep `dragAdapter` referentially stable (module-level constant).
|
|
37
|
+
* @bestPractice Use ProductCard for a material in a grid or list; its image is square, which is how a material is always shown. Don't rebuild the card with a landscape image.
|
|
38
|
+
* @keywords material card, material tile, sample card, catalogue card, product tile
|
|
36
39
|
* @category catalogue
|
|
37
40
|
*/
|
|
38
41
|
export declare const ProductCard: import("react").MemoExoticComponent<typeof ProductCardBase>;
|
|
@@ -42,6 +42,8 @@ const ProductCardBase = ({ className, product, variantId, mode = "group", width,
|
|
|
42
42
|
* `linkAs={Link}` - the defaults are a plain `<img>` and `<a>`.
|
|
43
43
|
* @bestPractice Cart UI renders only when a `renderAddToCart` slot is
|
|
44
44
|
* provided; keep `dragAdapter` referentially stable (module-level constant).
|
|
45
|
+
* @bestPractice Use ProductCard for a material in a grid or list; its image is square, which is how a material is always shown. Don't rebuild the card with a landscape image.
|
|
46
|
+
* @keywords material card, material tile, sample card, catalogue card, product tile
|
|
45
47
|
* @category catalogue
|
|
46
48
|
*/
|
|
47
49
|
export const ProductCard = memo(ProductCardBase);
|
|
@@ -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
|
}
|