@veevarts/design-system 2.2.2 → 2.4.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.cjs +6 -6
- package/dist/index.js +3533 -3365
- package/dist/patterns/TileSelect/TileSelect.d.ts +65 -1
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -11,9 +11,47 @@ export interface TileSelectOption {
|
|
|
11
11
|
icon: string | React.ReactNode;
|
|
12
12
|
/** Disable the tile (greyed out, no click). */
|
|
13
13
|
isDisabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* One line of supporting copy. Rendered only by `variant="compact"`,
|
|
16
|
+
* for an option that ended up in the "More" menu, where the label
|
|
17
|
+
* alone ("Other") rarely says enough.
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* `variant="compact"` only: keep this option in the "More" menu at
|
|
22
|
+
* every width, however much room the track has. For an action that is
|
|
23
|
+
* secondary by decision rather than by measurement — a payments picker
|
|
24
|
+
* that wants "Other" one click away so the methods people actually
|
|
25
|
+
* reach for own the row.
|
|
26
|
+
*
|
|
27
|
+
* The menu is rendered whenever an option asks for it, so this also
|
|
28
|
+
* overrides the rule that suppresses a menu holding a single option.
|
|
29
|
+
*/
|
|
30
|
+
alwaysInMenu?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* `variant="compact"` only: what this option is worth keeping on the
|
|
33
|
+
* track. When the pill runs out of room the LOWEST priority folds into
|
|
34
|
+
* the menu first; equal priorities fold from the end of the list.
|
|
35
|
+
* Default `0`.
|
|
36
|
+
*
|
|
37
|
+
* Display order is untouched — this decides what survives a squeeze,
|
|
38
|
+
* not where anything sits. A payments picker can list "Other" before
|
|
39
|
+
* "Split payment" and still lose "Other" first, because splitting a
|
|
40
|
+
* payment is the rarer, weightier thing to reach for.
|
|
41
|
+
*/
|
|
42
|
+
priority?: number;
|
|
14
43
|
/** Override per-tile test id; defaults to `${dataTestId}-${key}`. */
|
|
15
44
|
'data-testid'?: string;
|
|
16
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* `'tiles'` — the icon-over-label grid, with a `<Select>` dropdown under
|
|
48
|
+
* `md`. The picker is the subject of the step.
|
|
49
|
+
*
|
|
50
|
+
* `'compact'` — a segmented pill of label-only toggles at every width,
|
|
51
|
+
* keeping every option the track can hold and folding the rest into a
|
|
52
|
+
* "More" menu rather than scrolling. The picker is a control among others.
|
|
53
|
+
*/
|
|
54
|
+
export type TileSelectVariant = 'tiles' | 'compact';
|
|
17
55
|
export interface TileSelectProps {
|
|
18
56
|
/** Options to render in order. */
|
|
19
57
|
options: readonly TileSelectOption[];
|
|
@@ -30,7 +68,33 @@ export interface TileSelectProps {
|
|
|
30
68
|
* heading element.
|
|
31
69
|
*/
|
|
32
70
|
ariaLabel?: string;
|
|
33
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* How the options render. Default `'tiles'`.
|
|
73
|
+
* See {@link TileSelectVariant}.
|
|
74
|
+
*/
|
|
75
|
+
variant?: TileSelectVariant;
|
|
76
|
+
/**
|
|
77
|
+
* `variant="compact"` only: a CAP on how many options stay on the pill.
|
|
78
|
+
* Unset by default, and normally best left that way — the pill already
|
|
79
|
+
* measures the track and keeps every option that fits, folding only
|
|
80
|
+
* what is left over. Set it when a surface wants a shorter row than
|
|
81
|
+
* its width allows.
|
|
82
|
+
*
|
|
83
|
+
* The cap gives way in one case: when honouring it would leave a single
|
|
84
|
+
* option in the menu that the track had room for. A "More" button is
|
|
85
|
+
* wider than most labels, so that fold costs space and buys a click.
|
|
86
|
+
*/
|
|
87
|
+
maxVisible?: number;
|
|
88
|
+
/**
|
|
89
|
+
* `variant="compact"` only: label for the overflow trigger. Shown
|
|
90
|
+
* until an option inside the menu is selected, after which the
|
|
91
|
+
* trigger carries that option's label. Translatable. Default `'More'`.
|
|
92
|
+
*/
|
|
93
|
+
moreLabel?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Grid columns on >= sm. Default `3`. Mobile collapses to 2.
|
|
96
|
+
* Ignored by `variant="compact"`, which is a single strip.
|
|
97
|
+
*/
|
|
34
98
|
columnsDesktop?: 2 | 3 | 4;
|
|
35
99
|
columnsMobile?: 1 | 2;
|
|
36
100
|
className?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { TileSelect } from './TileSelect';
|
|
2
|
-
export type { TileSelectProps, TileSelectOption } from './TileSelect';
|
|
2
|
+
export type { TileSelectProps, TileSelectOption, TileSelectVariant } from './TileSelect';
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export type { SplitPaymentSummaryProps, SplitPaymentSummaryLabels, TenderRow, Te
|
|
|
82
82
|
export { ModalShell, ModalShellHeader, ModalShellFooter } from './ModalShell';
|
|
83
83
|
export type { ModalShellProps, ModalShellHeaderProps, ModalShellFooterProps } from './ModalShell';
|
|
84
84
|
export { TileSelect } from './TileSelect';
|
|
85
|
-
export type { TileSelectProps, TileSelectOption } from './TileSelect';
|
|
85
|
+
export type { TileSelectProps, TileSelectOption, TileSelectVariant } from './TileSelect';
|
|
86
86
|
export { PaymentTotalBanner } from './PaymentTotalBanner';
|
|
87
87
|
export type { PaymentTotalBannerProps } from './PaymentTotalBanner';
|
|
88
88
|
export { LoadingOverlay } from './LoadingOverlay';
|