@veevarts/design-system 2.1.0-beta.20 → 2.1.0-beta.22
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 +8 -8
- package/dist/index.js +4657 -4247
- package/dist/patterns/AdminTextField/AdminTextField.d.ts +4 -44
- package/dist/patterns/AdminTextField/index.d.ts +2 -2
- package/dist/patterns/AdminTextField/styles.d.ts +29 -0
- package/dist/patterns/AdminTextField/types.d.ts +78 -0
- package/dist/patterns/EntityRow/styles.d.ts +15 -0
- package/dist/patterns/EntityRow/types.d.ts +7 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +2 -115
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/TileSelect/styles.d.ts +42 -0
- package/dist/patterns/TileSelect/types.d.ts +140 -0
- package/dist/patterns/VerticalSteps/StepPager.d.ts +6 -0
- package/dist/patterns/VerticalSteps/StepsReadiness.d.ts +15 -0
- package/dist/patterns/VerticalSteps/VerticalSteps.d.ts +6 -0
- package/dist/patterns/VerticalSteps/index.d.ts +4 -0
- package/dist/patterns/VerticalSteps/styles.d.ts +54 -0
- package/dist/patterns/VerticalSteps/types.d.ts +100 -0
- package/dist/patterns/index.d.ts +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Where a step stands. `done` and `optional` need nothing; `needs-fix` is
|
|
4
|
+
* what stops the page from being ready, and carries a `reason`.
|
|
5
|
+
*/
|
|
6
|
+
export type VerticalStepStatus = 'done' | 'needs-fix' | 'optional';
|
|
7
|
+
/** One row of a {@link VerticalSteps} panel, and one page of a {@link StepPager}. */
|
|
8
|
+
export interface VerticalStep {
|
|
9
|
+
/** Stable id. Keys the row and its default test id. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Step name. The row prefixes its 1-based number; the pager shows it bare. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One line under the label: "3 tickets", "Nov 1 – Dec 31". */
|
|
14
|
+
summary?: ReactNode;
|
|
15
|
+
status: VerticalStepStatus;
|
|
16
|
+
/** What to fix ("Add the end date"). Shown instead of `summary` while `needs-fix`. */
|
|
17
|
+
reason?: ReactNode;
|
|
18
|
+
/** Override the row's test id; defaults to `${data-testid}-step-${key}`. */
|
|
19
|
+
testId?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The status words, translated by the host. `optional` is visible
|
|
23
|
+
* ("Optional · 2 rules"); `done` and `needsFix` are read out only, before the
|
|
24
|
+
* summary or the reason, so include the punctuation your language wants there
|
|
25
|
+
* (`'Done.'`, `'Needs a fix:'`).
|
|
26
|
+
*/
|
|
27
|
+
export interface VerticalStepsStatusLabels {
|
|
28
|
+
done: string;
|
|
29
|
+
needsFix: string;
|
|
30
|
+
optional: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Same position model as `HorizontalSteps`: an index, controlled or not,
|
|
34
|
+
* with `onStepChange` and an `isStepReachable` gate.
|
|
35
|
+
*/
|
|
36
|
+
export interface VerticalStepsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
37
|
+
steps: VerticalStep[];
|
|
38
|
+
/** Controlled index of the active step. Omit for uncontrolled mode. */
|
|
39
|
+
currentStep?: number;
|
|
40
|
+
/** Starting index in uncontrolled mode. */
|
|
41
|
+
defaultStep?: number;
|
|
42
|
+
onStepChange?: (stepIndex: number) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Steps for which this returns `false` render disabled and cannot be
|
|
45
|
+
* pressed. When omitted every step is reachable, which is the program
|
|
46
|
+
* page's case: no step is locked.
|
|
47
|
+
*/
|
|
48
|
+
isStepReachable?: (stepIndex: number) => boolean;
|
|
49
|
+
/** Accessible name of the `<nav>` that holds the rows ("Program steps"). */
|
|
50
|
+
ariaLabel: string;
|
|
51
|
+
statusLabels: VerticalStepsStatusLabels;
|
|
52
|
+
/** Above the rows: a {@link StepsReadiness}, or anything else. */
|
|
53
|
+
header?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Cap on the panel's height; past it the panel scrolls inside. Any CSS
|
|
56
|
+
* length (`'calc(100vh - 7rem)'`) or px number. The panel never sets
|
|
57
|
+
* `position: sticky` itself: the page that places it decides that.
|
|
58
|
+
*/
|
|
59
|
+
maxHeight?: string | number;
|
|
60
|
+
'data-testid'?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `ready` and `live` are the success tone and mark the panel ready
|
|
64
|
+
* (`data-ready="true"`); `fix` is the warning tone.
|
|
65
|
+
*/
|
|
66
|
+
export type StepsReadinessVariant = 'ready' | 'fix' | 'live';
|
|
67
|
+
export interface StepsReadinessProps {
|
|
68
|
+
variant: StepsReadinessVariant;
|
|
69
|
+
/** "Ready to publish", "2 things to fix", "Live — visitors can buy". */
|
|
70
|
+
title: ReactNode;
|
|
71
|
+
/** The sub-line: "Fix them before you can publish." */
|
|
72
|
+
description?: ReactNode;
|
|
73
|
+
className?: string;
|
|
74
|
+
'data-testid'?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface StepPagerProps {
|
|
77
|
+
steps: VerticalStep[];
|
|
78
|
+
/** Index of the step on screen; the same index `VerticalSteps` uses. */
|
|
79
|
+
currentStep: number;
|
|
80
|
+
onStepChange: (stepIndex: number) => void;
|
|
81
|
+
/** The middle text: `(n, total) => \`Step ${n} of ${total}\``. `n` is 1-based. */
|
|
82
|
+
progressLabel: (stepNumber: number, total: number) => ReactNode;
|
|
83
|
+
/** The forward button: `(step) => \`Next: ${step.label}\``. */
|
|
84
|
+
nextLabel: (step: VerticalStep) => ReactNode;
|
|
85
|
+
/** The back button. Defaults to the previous step's label. */
|
|
86
|
+
previousLabel?: (step: VerticalStep) => ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Shown in place of Next on the last step ("Review and publish"). Omit it,
|
|
89
|
+
* or `onFinalAction`, and the last step has no forward button.
|
|
90
|
+
*/
|
|
91
|
+
finalActionLabel?: ReactNode;
|
|
92
|
+
onFinalAction?: () => void;
|
|
93
|
+
isFinalActionDisabled?: boolean;
|
|
94
|
+
className?: string;
|
|
95
|
+
/** Root test id. The buttons' ids default to `${data-testid}-prev` / `-next` / `-final`. */
|
|
96
|
+
'data-testid'?: string;
|
|
97
|
+
previousTestId?: string;
|
|
98
|
+
nextTestId?: string;
|
|
99
|
+
finalActionTestId?: string;
|
|
100
|
+
}
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { Stepper } from './Stepper';
|
|
|
4
4
|
export type { StepperProps } from './Stepper';
|
|
5
5
|
export { HorizontalSteps } from './HorizontalSteps';
|
|
6
6
|
export type { HorizontalStepsProps, HorizontalStepProps } from './HorizontalSteps';
|
|
7
|
+
export { VerticalSteps, StepsReadiness, StepPager } from './VerticalSteps';
|
|
8
|
+
export type { VerticalStep, VerticalStepStatus, VerticalStepsProps, VerticalStepsStatusLabels, StepsReadinessProps, StepsReadinessVariant, StepPagerProps, } from './VerticalSteps';
|
|
7
9
|
export { Footer } from './Footer';
|
|
8
10
|
export { Multiselect } from './Multiselect';
|
|
9
11
|
export type { MultiselectProps } from './Multiselect';
|
|
@@ -63,8 +65,8 @@ export { ToolbarButton } from './ToolbarButton';
|
|
|
63
65
|
export type { ToolbarButtonProps } from './ToolbarButton';
|
|
64
66
|
export { UnderlineTabs } from './UnderlineTabs';
|
|
65
67
|
export type { UnderlineTabsProps, UnderlineTabItem, UnderlineTabsSize, UnderlineTabsLevel } from './UnderlineTabs';
|
|
66
|
-
export { AdminFieldLabel, AdminTextField, adminFieldErrorClass, adminFieldHintClass, adminFieldLabelClass, adminFieldLabelSuffixClass, adminInputClass, adminInputReadOnlyClass, adminInputWrapperClass, } from './AdminTextField';
|
|
67
|
-
export type { AdminTextFieldProps } from './AdminTextField';
|
|
68
|
+
export { AdminFieldLabel, AdminTextField, adminFieldErrorClass, adminFieldHelpButtonClass, adminFieldHelpContentClass, adminFieldHelpIconClass, adminFieldHintClass, adminFieldLabelClass, adminFieldLabelNoAutoMarkClass, adminFieldLabelRowClass, adminFieldLabelSuffixClass, adminFieldRequiredClass, adminInputClass, adminInputReadOnlyClass, adminInputWrapperClass, } from './AdminTextField';
|
|
69
|
+
export type { AdminTextFieldProps, AdminFieldLabelProps, AdminFieldRequiredProps, AdminFieldHelpProps, } from './AdminTextField';
|
|
68
70
|
export { RowActions } from './RowActions';
|
|
69
71
|
export type { RowActionsProps, RowAction } from './RowActions';
|
|
70
72
|
export { PickerRow } from './PickerRow';
|