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

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.
@@ -1,6 +1,6 @@
1
1
  import { JSX } from 'react';
2
2
  import { EmptyStateProps, ErrorStateProps, FeedbackStateProps, LoadingStateProps, SuccessStateProps } from './type';
3
- export declare function FeedbackState({ variant, surface, title, titleAs: TitleElement, description, icon, actions, role, ariaLive, iconSize, className, classNames, 'data-testid': dataTestId, }: FeedbackStateProps): JSX.Element;
3
+ export declare function FeedbackState(props: FeedbackStateProps): JSX.Element;
4
4
  export declare namespace FeedbackState {
5
5
  var displayName: string;
6
6
  }
@@ -20,6 +20,8 @@ export interface FeedbackStateClassNames {
20
20
  spinner?: string;
21
21
  title?: string;
22
22
  description?: string;
23
+ /** The `ErrorState` reference code line. */
24
+ referenceCode?: string;
23
25
  actions?: string;
24
26
  }
25
27
  export interface FeedbackStateProps {
@@ -50,6 +52,14 @@ export interface FeedbackStateProps {
50
52
  'data-testid'?: string;
51
53
  }
52
54
  export type EmptyStateProps = Omit<FeedbackStateProps, 'variant'>;
53
- export type ErrorStateProps = Omit<FeedbackStateProps, 'variant'>;
55
+ export interface ErrorStateProps extends Omit<FeedbackStateProps, 'variant'> {
56
+ /**
57
+ * Support code for this failure, e.g. `"FR-QE-900"`, shown on a small line under the description
58
+ * so a user can quote it from a screenshot. Nothing is rendered without it.
59
+ */
60
+ referenceCode?: string;
61
+ /** Text before the code. Defaults to `"Reference code:"`; the caller owns i18n. */
62
+ referenceCodeLabel?: string;
63
+ }
54
64
  export type LoadingStateProps = Omit<FeedbackStateProps, 'variant'>;
55
65
  export type SuccessStateProps = Omit<FeedbackStateProps, 'variant'>;
@@ -0,0 +1,16 @@
1
+ import { JSX } from 'react';
2
+ import { NoticeProps } from './type';
3
+ /**
4
+ * An inline message with a severity: the DS answer to HeroUI's
5
+ * `Alert variant="flat" isClosable={false}` repeated per call, and to the
6
+ * hand-rolled red lines and boxes of the POS.
7
+ *
8
+ * Danger and warning are `role="alert"` (assertive), info and success
9
+ * `role="status"` (polite). Copy comes in as props; the caller owns i18n.
10
+ * The only motion is the dismiss button's press feedback, which is dropped
11
+ * when the OS or the POS asks for reduced motion.
12
+ */
13
+ export declare function Notice({ tone, variant, title, description, actions, onDismiss, dismissLabel, role, className, 'data-testid': dataTestId, }: NoticeProps): JSX.Element;
14
+ export declare namespace Notice {
15
+ var displayName: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ export { Notice } from './Notice';
2
+ export type { NoticeProps, NoticeTone, NoticeVariant } from './type';
@@ -0,0 +1,35 @@
1
+ import { NoticeTone, NoticeVariant } from './type';
2
+ /**
3
+ * One glyph per tone, on every variant. Solar `bold` so the shape reads at
4
+ * callout size; the danger tone had four different glyphs across the apps
5
+ * before this (HeroUI's own, two Solar outlines and a gravity-ui fill).
6
+ */
7
+ export declare const NOTICE_ICON: Record<NoticeTone, string>;
8
+ export declare const NOTICE_DISMISS_ICON = "solar:close-circle-linear";
9
+ /**
10
+ * Every size is rem (or em off a rem font size), so the POS "Text size"
11
+ * setting, which scales the root font size, scales the notice with it. The
12
+ * values are the design hub's px at a 16px root.
13
+ */
14
+ export declare const noticeClass: Record<NoticeVariant, {
15
+ root: string;
16
+ iconWrapper: string;
17
+ iconSize: string;
18
+ text: string;
19
+ title: string;
20
+ description: string;
21
+ actions: string;
22
+ dismiss: string;
23
+ }>;
24
+ /**
25
+ * Tints. All `pos-*` tokens, the palette the Quick and POS surfaces style
26
+ * with; each text tone clears 4.5:1 on its fill (`pos-surface.test.ts`). The
27
+ * banner discs for danger and warning are the mockup's own tints; info and
28
+ * success have none in the mockup, so their disc is the tone at 15%.
29
+ */
30
+ export declare const noticeTone: Record<NoticeTone, {
31
+ callout: string;
32
+ banner: string;
33
+ disc: string;
34
+ title: string;
35
+ }>;
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ /** Severity. Picks the tint, the glyph and the default live-region role. */
3
+ export type NoticeTone = 'info' | 'success' | 'warning' | 'danger';
4
+ /**
5
+ * Which of the design hub's two notice shapes to draw.
6
+ *
7
+ * `callout` is the inline note of the Quick Donation and Quick Membership
8
+ * mockups (`.callout-info`, `.callout-warn`): a small tinted block, the glyph
9
+ * on the first line, the title run in bold ahead of the text.
10
+ *
11
+ * `banner` is the POS `.banner`: the glyph in a filled disc, the title in the
12
+ * tone on its own line, muted body copy and an action row under it.
13
+ */
14
+ export type NoticeVariant = 'callout' | 'banner';
15
+ export interface NoticeProps {
16
+ /** Severity. Defaults to `info`. */
17
+ tone?: NoticeTone;
18
+ /** `callout` (default) or `banner`. */
19
+ variant?: NoticeVariant;
20
+ /** Short lead: run in bold before the description on a callout, its own line on a banner. */
21
+ title?: ReactNode;
22
+ /** The message. Phrasing content (text, links, `strong`): it shares a line with a callout's title. */
23
+ description?: ReactNode;
24
+ /** Buttons or links, rendered under the text. */
25
+ actions?: ReactNode;
26
+ /** Shows a dismiss button that calls this. The notice does not hide itself: the caller stops rendering it. */
27
+ onDismiss?: () => void;
28
+ /** Accessible name of the dismiss button. Defaults to `"Dismiss"`. */
29
+ dismissLabel?: string;
30
+ /**
31
+ * Live-region role. Defaults to `alert` for `danger` and `warning`, `status`
32
+ * for `info` and `success`; the matching `aria-live` follows it.
33
+ */
34
+ role?: 'alert' | 'status';
35
+ /** Root className, for layout (margins, width). */
36
+ className?: string;
37
+ /** Root test id; the parts are suffixed (`-icon`, `-title`, `-description`, `-actions`, `-dismiss`). */
38
+ 'data-testid'?: string;
39
+ }
@@ -170,3 +170,5 @@ export { CellText, ChipStack } from './CellText';
170
170
  export type { CellTextProps, CellTextVariant, ChipStackProps } from './CellText';
171
171
  export { SessionExpiredCard } from './SessionExpiredCard';
172
172
  export type { SessionExpiredCardProps } from './SessionExpiredCard';
173
+ export { Notice } from './Notice';
174
+ 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.1.0-beta.18",
4
+ "version": "2.1.0-beta.20",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",