@veevarts/design-system 2.27.0 → 2.28.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.
@@ -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,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';
@@ -170,3 +172,5 @@ export { CellText, ChipStack } from './CellText';
170
172
  export type { CellTextProps, CellTextVariant, ChipStackProps } from './CellText';
171
173
  export { SessionExpiredCard } from './SessionExpiredCard';
172
174
  export type { SessionExpiredCardProps } from './SessionExpiredCard';
175
+ export { Notice } from './Notice';
176
+ export type { NoticeProps, NoticeTone, NoticeVariant } from './Notice';
@@ -14,6 +14,12 @@ interface HeroUIProviderProps {
14
14
  * buttons of overlays, date and number formatting. Without it HeroUI uses `"en-US"`.
15
15
  */
16
16
  locale?: string;
17
+ /**
18
+ * How framer-motion animations (overlays, toasts, tabs) treat the OS "reduce motion" setting.
19
+ * Defaults to `"user"`: follow the OS. HeroUI's own default is `"never"`, which animates regardless.
20
+ * `"always"` drops them everywhere, e.g. for an app-level reduce-motion preference.
21
+ */
22
+ reducedMotion?: 'user' | 'always' | 'never';
17
23
  }
18
- export declare function HeroUIProvider({ children, closeLabel, locale }: HeroUIProviderProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function HeroUIProvider({ children, closeLabel, locale, reducedMotion }: HeroUIProviderProps): import("react/jsx-runtime").JSX.Element;
19
25
  export {};
@@ -0,0 +1,16 @@
1
+ import { ToastProvider as BaseToastProvider } from '@heroui/react';
2
+ import { ComponentProps, JSX } from 'react';
3
+ export type ToastProviderProps = ComponentProps<typeof BaseToastProvider>;
4
+ /**
5
+ * Drop-in for HeroUI's `ToastProvider` (same props, same `addToast` queue).
6
+ *
7
+ * - Titles wrap instead of truncating. A `toastProps.classNames.title` you pass
8
+ * is merged after the default, so it can still restyle the title.
9
+ * - Animation is off when the OS or the POS asks for reduced motion, unless
10
+ * `disableAnimation` is passed.
11
+ *
12
+ * HeroUI merges an `addToast({ classNames })` over the provider's `classNames`
13
+ * as a whole object, so a per-toast `classNames` without a `title` key brings
14
+ * the truncation back for that toast.
15
+ */
16
+ export declare function ToastProvider({ toastProps, disableAnimation, ...props }: ToastProviderProps): JSX.Element;
@@ -1,4 +1,6 @@
1
1
  export { HeroUIProvider } from './HeroUIProvider';
2
+ export { ToastProvider } from './ToastProvider';
3
+ export type { ToastProviderProps } from './ToastProvider';
2
4
  export { DensityProvider } from './DensityProvider';
3
5
  export type { DensityProviderProps } from './DensityProvider';
4
6
  export { useDensity, useControlSize } from './density';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.27.0",
4
+ "version": "2.28.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",