@veevarts/design-system 2.1.0-beta.20 → 2.1.0-beta.23

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.
@@ -5,6 +5,12 @@ export interface UnderlineTabsSlots {
5
5
  tab: string;
6
6
  tabContent: string;
7
7
  }
8
- export declare const underlineTabsSlots: Record<'md' | 'sm-primary' | 'sm-secondary', UnderlineTabsSlots>;
8
+ export declare const underlineTabsSlots: Record<'md' | 'lg' | 'sm-primary' | 'sm-secondary', UnderlineTabsSlots>;
9
+ /**
10
+ * Merged over any look by `showDivider={false}`: no hairline under the strip
11
+ * and no gap after it. `md` draws its hairline on the list, the other looks on
12
+ * `base`, so both slots drop theirs (and `-mb-px`, which only overlapped it).
13
+ */
14
+ export declare const underlineTabsNoDivider: Pick<UnderlineTabsSlots, 'base' | 'tabList'>;
9
15
  /** Added to the `md` cursor under reduced motion: it jumps instead of sliding. */
10
16
  export declare const stillCursorClass = "data-[animated=true]:transition-none";
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import { StepPagerProps } from './types';
3
+ export declare function StepPager({ steps, currentStep, onStepChange, progressLabel, nextLabel, previousLabel, finalActionLabel, onFinalAction, isFinalActionDisabled, className, 'data-testid': dataTestId, previousTestId, nextTestId, finalActionTestId, }: StepPagerProps): JSX.Element;
4
+ export declare namespace StepPager {
5
+ var displayName: string;
6
+ }
@@ -0,0 +1,15 @@
1
+ import { JSX } from 'react';
2
+ import { StepsReadinessProps } from './types';
3
+ /**
4
+ * The verdict that sits in `VerticalSteps`' `header`: ready to publish,
5
+ * N things to fix, or already live. Copy comes in as props.
6
+ *
7
+ * `role="status"` on every variant: the count changes while the user edits,
8
+ * and a polite announcement is the right weight for it. `data-ready` is
9
+ * `"true"` for `ready` and `live`, `"false"` for `fix`, so a test can wait on
10
+ * it without reading copy.
11
+ */
12
+ export declare function StepsReadiness({ variant, title, description, className, 'data-testid': dataTestId, }: StepsReadinessProps): JSX.Element;
13
+ export declare namespace StepsReadiness {
14
+ var displayName: string;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import { VerticalStepsProps } from './types';
3
+ export declare function VerticalSteps({ steps, currentStep: currentStepProp, defaultStep, onStepChange, isStepReachable, ariaLabel, statusLabels, header, maxHeight, className, style, 'data-testid': dataTestId, ...rest }: VerticalStepsProps): JSX.Element;
4
+ export declare namespace VerticalSteps {
5
+ var displayName: string;
6
+ }
@@ -0,0 +1,4 @@
1
+ export { VerticalSteps } from './VerticalSteps';
2
+ export { StepsReadiness } from './StepsReadiness';
3
+ export { StepPager } from './StepPager';
4
+ export type { VerticalStep, VerticalStepStatus, VerticalStepsProps, VerticalStepsStatusLabels, StepsReadinessProps, StepsReadinessVariant, StepPagerProps, } from './types';
@@ -0,0 +1,54 @@
1
+ import { StepsReadinessVariant, VerticalStepStatus } from './types';
2
+ /** One glyph per status, so the state reads by shape before color. */
3
+ export declare const STEP_STATUS_ICON: Record<VerticalStepStatus, string>;
4
+ /**
5
+ * `icon` paints the glyph; `meta` the line under the label.
6
+ *
7
+ * The optional ring is `--muted` (gray-400, 2.54:1): it is decorative, the
8
+ * visible word "Optional" carries the state. Every text tone is `--sub`
9
+ * (gray-500, 4.83:1) or darker; `--warn` is warning-700, 5.02:1 on white.
10
+ */
11
+ export declare const STEP_STATUS_TONE: Record<VerticalStepStatus, {
12
+ icon: string;
13
+ meta: string;
14
+ }>;
15
+ /** Label color for every row. */
16
+ export declare const STEP_LABEL_COLOR: string;
17
+ export declare const READINESS_ICON: Record<StepsReadinessVariant, string>;
18
+ /** Fill plus the one text tone on it. Both pairs are held to 4.5:1 in `admin-surface.test.ts`. */
19
+ export declare const READINESS_TONE: Record<StepsReadinessVariant, {
20
+ fill: string;
21
+ text: string;
22
+ }>;
23
+ export declare const verticalStepsClass: {
24
+ /** Scrolls inside once `maxHeight` (or the parent) caps it. */
25
+ readonly root: "flex min-h-0 flex-col gap-3 overflow-y-auto overscroll-contain";
26
+ readonly nav: "rounded-2xl border border-acct-border bg-acct-surface p-1.5";
27
+ readonly list: "m-0 flex list-none flex-col gap-0.5 p-0";
28
+ /**
29
+ * The DS Button supplies the hit target, the focus ring and press
30
+ * handling; its centered single-line box is undone so a row can wrap.
31
+ */
32
+ readonly row: string;
33
+ readonly rowCurrent: "bg-acct-hair data-[hover=true]:bg-acct-hair";
34
+ readonly icon: "mt-px size-5 shrink-0";
35
+ readonly text: "flex min-w-0 flex-1 flex-col gap-0.5";
36
+ readonly label: "text-sm leading-5";
37
+ readonly labelCurrent: "font-semibold";
38
+ readonly meta: "text-xs leading-4 [overflow-wrap:anywhere]";
39
+ };
40
+ export declare const stepsReadinessClass: {
41
+ readonly root: "flex items-start gap-2.5 rounded-2xl px-4 py-3";
42
+ readonly icon: "mt-0.5 size-5 shrink-0";
43
+ readonly text: "flex min-w-0 flex-col";
44
+ readonly title: "text-sm font-semibold leading-5";
45
+ readonly description: "text-xs leading-4";
46
+ };
47
+ export declare const stepPagerClass: {
48
+ readonly root: "flex flex-wrap items-center justify-between gap-3";
49
+ /** Keeps the progress text centered when one side has no button. */
50
+ readonly spacer: "min-w-0 flex-1 basis-0";
51
+ readonly progress: "shrink-0 text-xs text-acct-sub";
52
+ readonly endSlot: "flex min-w-0 flex-1 basis-0 justify-end";
53
+ readonly arrow: "size-4";
54
+ };
@@ -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
+ }
@@ -4,13 +4,15 @@ 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';
10
12
  export { RichTextArea, RICH_TEXT_PRESETS } from './RichText';
11
13
  export type { RichTextAreaProps } from './RichText';
12
14
  export { DonationAmounts } from './DonationAmounts';
13
- export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels, DonationAmountsVariant, } from './DonationAmounts';
15
+ export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels, DonationAmountsVariant, DonationAmountsCustomAmountPlacement, } from './DonationAmounts';
14
16
  export { ExpireCartTimer } from './ExpireCartTimer';
15
17
  export type { ExpireCartTimerProps } from './ExpireCartTimer';
16
18
  export { EventDetails } from './Programs/EventDetails';
@@ -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';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.1.0-beta.20",
4
+ "version": "2.1.0-beta.23",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",