@toteat-eng/ds-react 2026.6.9 → 2026.6.10-2

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.
Files changed (31) hide show
  1. package/dist/components/Banner/Banner.d.ts +14 -0
  2. package/dist/components/Banner/__stories__/Banner.stories.d.ts +16 -0
  3. package/dist/components/Banner/index.d.ts +2 -0
  4. package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
  5. package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +14 -0
  6. package/dist/components/Breadcrumb/index.d.ts +2 -0
  7. package/dist/components/CloseButton/CloseButton.d.ts +18 -0
  8. package/dist/components/CloseButton/index.d.ts +2 -0
  9. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  10. package/dist/components/ExtrasDialog/index.d.ts +1 -1
  11. package/dist/components/PermissionGate/PermissionGate.d.ts +30 -0
  12. package/dist/components/PermissionGate/__stories__/PermissionGate.stories.d.ts +10 -0
  13. package/dist/components/PermissionGate/index.d.ts +2 -0
  14. package/dist/components/ProductTile/index.d.ts +1 -1
  15. package/dist/components/SearchInput/SearchInput.d.ts +21 -0
  16. package/dist/components/SearchInput/__stories__/SearchInput.stories.d.ts +11 -0
  17. package/dist/components/SearchInput/index.d.ts +2 -0
  18. package/dist/components/Stepper/Stepper.d.ts +18 -0
  19. package/dist/components/Stepper/__stories__/Stepper.stories.d.ts +11 -0
  20. package/dist/components/Stepper/index.d.ts +2 -0
  21. package/dist/components/TextInput/TextInput.d.ts +1 -1
  22. package/dist/hooks/useScrollLock.d.ts +19 -0
  23. package/dist/hooks/useToggle.d.ts +7 -0
  24. package/dist/index.d.ts +16 -1
  25. package/dist/index.es.js +1526 -1169
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.umd.js +10 -9
  28. package/dist/index.umd.js.map +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/utils/csv.d.ts +17 -0
  31. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ import type React from "react";
2
+ import type { IconNameType } from "../Icon";
3
+ export type BannerVariant = "info" | "success" | "warning" | "error" | "neutral";
4
+ export interface BannerProps {
5
+ variant?: BannerVariant;
6
+ icon?: IconNameType;
7
+ onDismiss?: () => void;
8
+ dismissLabel?: string;
9
+ action?: React.ReactNode;
10
+ children: React.ReactNode;
11
+ className?: string;
12
+ "data-testid"?: string;
13
+ }
14
+ export declare function Banner({ variant, icon, onDismiss, dismissLabel, action, children, className, "data-testid": testId, }: BannerProps): React.ReactElement;
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Banner } from "../Banner";
3
+ declare const meta: Meta<typeof Banner>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Banner>;
6
+ export declare const Info: Story;
7
+ export declare const Success: Story;
8
+ export declare const Warning: Story;
9
+ export declare const Error: Story;
10
+ export declare const Neutral: Story;
11
+ export declare const WithIcon: Story;
12
+ export declare const WithDismiss: Story;
13
+ export declare const WithAction: Story;
14
+ export declare const WithDismissAndAction: Story;
15
+ export declare const AllVariants: Story;
16
+ export declare const BothThemes: Story;
@@ -0,0 +1,2 @@
1
+ export type { BannerProps, BannerVariant } from "./Banner";
2
+ export { Banner } from "./Banner";
@@ -0,0 +1,14 @@
1
+ export interface BreadcrumbItem {
2
+ id: string;
3
+ label: string;
4
+ href?: string;
5
+ }
6
+ export interface BreadcrumbProps {
7
+ items: BreadcrumbItem[];
8
+ onBack?: () => void;
9
+ backLabel?: string;
10
+ label?: string;
11
+ className?: string;
12
+ "data-testid"?: string;
13
+ }
14
+ export declare function Breadcrumb({ items, onBack, backLabel, label, className, "data-testid": testId, }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Breadcrumb } from "../Breadcrumb";
3
+ declare const meta: Meta<typeof Breadcrumb>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Breadcrumb>;
6
+ export declare const SingleItem: Story;
7
+ export declare const MultipleItems: Story;
8
+ export declare const WithBackButton: Story;
9
+ export declare const WithoutBackButton: Story;
10
+ export declare const ItemsWithHref: Story;
11
+ export declare const ItemsWithHrefAndBack: Story;
12
+ export declare const ThemeToteatReactDs: Story;
13
+ export declare const ThemeAngularLegacy: Story;
14
+ export declare const BothThemes: Story;
@@ -0,0 +1,2 @@
1
+ export type { BreadcrumbItem, BreadcrumbProps } from "./Breadcrumb";
2
+ export { Breadcrumb } from "./Breadcrumb";
@@ -0,0 +1,18 @@
1
+ export interface CloseButtonProps {
2
+ onClick?: () => void;
3
+ /** Accessible name for the dismiss button. */
4
+ label?: string;
5
+ /** Icon size in px (also drives the rendered close glyph size). */
6
+ size?: number;
7
+ /** Consumer class applied alongside the zero-specificity baseline, so the
8
+ * host component's exact look is preserved. */
9
+ className?: string;
10
+ "data-testid"?: string;
11
+ }
12
+ /**
13
+ * Internal dismiss-button primitive. NOT part of the public API — used to
14
+ * de-duplicate the bespoke close buttons across Dialog, Toast, Banner and
15
+ * OverlayMessage. Renders a single native `<button>` containing the canonical
16
+ * `close-outline` icon.
17
+ */
18
+ export declare function CloseButton({ onClick, label, size, className, "data-testid": testId, }: CloseButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export type { CloseButtonProps } from "./CloseButton";
2
+ export { CloseButton } from "./CloseButton";
@@ -15,6 +15,6 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBo
15
15
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
16
16
  componentDidCatch(error: Error, info: ErrorInfo): void;
17
17
  handleRetry: () => void;
18
- render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
18
+ render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
19
19
  }
20
20
  export {};
@@ -1,2 +1,2 @@
1
- export type { ExtrasDialogProps } from "./ExtrasDialog";
1
+ export type { ExtrasCategoryType, ExtrasDialogProps, SelectedExtraType } from "./ExtrasDialog";
2
2
  export { ExtrasDialog } from "./ExtrasDialog";
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from "react";
2
+ export interface PermissionGateProps {
3
+ /** Permission decision resolved by the consumer app. When false, renders fallback. */
4
+ granted: boolean;
5
+ /** Rendered when granted is true. */
6
+ children: ReactNode;
7
+ /** Rendered when granted is false. @default null */
8
+ fallback?: ReactNode;
9
+ /**
10
+ * Accepted to satisfy the DS `data-testid` convention and to let consumers spread
11
+ * a testid coming from a parent without a TypeScript error. It is intentionally
12
+ * UNUSED: this component renders a React fragment with no DOM root to attach it to
13
+ * (identical to `React.Fragment`, which also ignores `data-testid`). If you need a
14
+ * testable DOM node, put it on the children you pass in.
15
+ */
16
+ "data-testid"?: string;
17
+ }
18
+ /**
19
+ * PermissionGate — a purely PRESENTATIONAL / STRUCTURAL primitive.
20
+ *
21
+ * It contains NO RBAC logic: no scopes, no bitwise actions, no hooks, no stores.
22
+ * Each consumer app computes the permission decision and passes it in as the
23
+ * `granted` boolean. When `granted` is true the `children` are rendered, otherwise
24
+ * the `fallback` (default `null`) is rendered.
25
+ *
26
+ * It renders a React fragment with NO DOM wrapper, so it never injects an anonymous
27
+ * layout node into a flex/grid container. There is no `.module.css` for this
28
+ * component because it has no visual surface of its own.
29
+ */
30
+ export declare function PermissionGate({ granted, children, fallback }: PermissionGateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { PermissionGate } from "../PermissionGate";
3
+ declare const meta: Meta<typeof PermissionGate>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PermissionGate>;
6
+ export declare const Granted: Story;
7
+ export declare const Denied_: Story;
8
+ export declare const DeniedNoFallback: Story;
9
+ export declare const DynamicToggle: Story;
10
+ export declare const BothThemes: Story;
@@ -0,0 +1,2 @@
1
+ export type { PermissionGateProps } from "./PermissionGate";
2
+ export { PermissionGate } from "./PermissionGate";
@@ -1,2 +1,2 @@
1
- export type { ProductTileProps } from "./ProductTile";
1
+ export type { ProductTileProps, ProductTileType, StockStatusType } from "./ProductTile";
2
2
  export { ProductTile } from "./ProductTile";
@@ -0,0 +1,21 @@
1
+ import { type InputHTMLAttributes } from "react";
2
+ export interface SearchInputProps {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ onClear?: () => void;
6
+ placeholder?: string;
7
+ label: string;
8
+ id?: string;
9
+ disabled?: boolean;
10
+ clearLabel?: string;
11
+ className?: string;
12
+ /**
13
+ * Native attributes/handlers forwarded to the underlying `<input type="search">`
14
+ * (e.g. `name`, `autoComplete`, `onBlur`, `onKeyDown`, `aria-describedby`).
15
+ * The component-controlled props (`value`, `onChange`, `id`, `type`, `disabled`,
16
+ * `placeholder`, `className`) remain the source of truth and cannot be overridden here.
17
+ */
18
+ inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "id" | "type" | "disabled" | "placeholder" | "className">;
19
+ "data-testid"?: string;
20
+ }
21
+ export declare function SearchInput({ value, onChange, onClear, placeholder, label, id: idProp, disabled, clearLabel, className, inputProps, "data-testid": testId, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { SearchInput } from "../SearchInput";
3
+ declare const meta: Meta<typeof SearchInput>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SearchInput>;
6
+ export declare const Empty: Story;
7
+ export declare const WithValue: Story;
8
+ export declare const Disabled: Story;
9
+ export declare const DisabledWithValue: Story;
10
+ export declare const CustomPlaceholder: Story;
11
+ export declare const BothThemes: Story;
@@ -0,0 +1,2 @@
1
+ export type { SearchInputProps } from "./SearchInput";
2
+ export { SearchInput } from "./SearchInput";
@@ -0,0 +1,18 @@
1
+ export interface StepperProps {
2
+ value: number;
3
+ onChange: (value: number) => void;
4
+ /** Lower bound (inclusive). Must be ≤ `max`. @default 0 */
5
+ min?: number;
6
+ /** Upper bound (inclusive). Must be ≥ `min`. @default Number.MAX_SAFE_INTEGER */
7
+ max?: number;
8
+ /** Increment size. Must be > 0. @default 1 */
9
+ step?: number;
10
+ disabled?: boolean;
11
+ /** Accessible name for the `role="group"` container. Required — an unnamed group is an a11y violation. */
12
+ "aria-label": string;
13
+ decrementLabel?: string;
14
+ incrementLabel?: string;
15
+ className?: string;
16
+ "data-testid"?: string;
17
+ }
18
+ export declare function Stepper({ value, onChange, min, max, step, disabled, "aria-label": ariaLabel, decrementLabel, incrementLabel, className, "data-testid": testId, }: StepperProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Stepper } from "../Stepper";
3
+ declare const meta: Meta<typeof Stepper>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Stepper>;
6
+ export declare const Default: Story;
7
+ export declare const AtMin: Story;
8
+ export declare const AtMax: Story;
9
+ export declare const FullyDisabled: Story;
10
+ export declare const CustomStep: Story;
11
+ export declare const BothThemes: Story;
@@ -0,0 +1,2 @@
1
+ export type { StepperProps } from "./Stepper";
2
+ export { Stepper } from "./Stepper";
@@ -1,5 +1,5 @@
1
1
  import { type InputHTMLAttributes } from "react";
2
- export type TextInputSize = "small" | "medium";
2
+ export type TextInputSize = "small" | "medium" | "large";
3
3
  export interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
4
4
  error?: boolean;
5
5
  showPasswordToggle?: boolean;
@@ -0,0 +1,19 @@
1
+ export interface UseScrollLockOptions {
2
+ /**
3
+ * Locking strategy.
4
+ * - `"fixed"` (default): pins `document.body` with `position: fixed` and
5
+ * restores the scroll position on release. This is Dialog's behavior —
6
+ * it prevents the page from jumping when the scrollbar disappears.
7
+ * - `"overflow"`: only sets `document.body.style.overflow = "hidden"`.
8
+ * This is Overlay's lighter behavior.
9
+ */
10
+ strategy?: "fixed" | "overflow";
11
+ }
12
+ /**
13
+ * Locks body scroll while `lock` is true and restores the previous state on
14
+ * cleanup (release / unmount). Internal hook — not part of the public API.
15
+ *
16
+ * Behavior is extracted verbatim from Dialog (`strategy: "fixed"`) and Overlay
17
+ * (`strategy: "overflow"`) so neither consumer changes visually or behaviorally.
18
+ */
19
+ export declare function useScrollLock(lock: boolean, options?: UseScrollLockOptions): void;
@@ -0,0 +1,7 @@
1
+ export type UseToggleReturn = [boolean, () => void, React.Dispatch<React.SetStateAction<boolean>>];
2
+ /**
3
+ * Minimal boolean toggle state. Returns `[state, toggle, setState]`.
4
+ * Internal hook — not part of the public API. Used to de-duplicate the
5
+ * open/close booleans in Accordion and SidebarNavSection.
6
+ */
7
+ export declare function useToggle(initial?: boolean): UseToggleReturn;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./tokens/base.css";
2
2
  import "./tokens/animations.css";
3
3
  import "./tokens/theme-angular.css";
4
- import "./tokens/theme-vue3.css";
4
+ import "./tokens/toteat-react-ds.css";
5
5
  export { Accordion } from "./components/Accordion";
6
6
  export type { AppleSignInButtonProps } from "./components/AppleSignInButton";
7
7
  export { AppleSignInButton } from "./components/AppleSignInButton";
@@ -9,6 +9,10 @@ export type { BackgroundWrapperProps } from "./components/BackgroundWrapper";
9
9
  export { BackgroundWrapper } from "./components/BackgroundWrapper";
10
10
  export type { BadgeProps, BadgeSize, BadgeVariant } from "./components/Badge";
11
11
  export { Badge } from "./components/Badge";
12
+ export type { BannerProps, BannerVariant } from "./components/Banner";
13
+ export { Banner } from "./components/Banner";
14
+ export type { BreadcrumbItem, BreadcrumbProps } from "./components/Breadcrumb";
15
+ export { Breadcrumb } from "./components/Breadcrumb";
12
16
  export type { ButtonProps, ButtonSize, ButtonVariant, } from "./components/Button";
13
17
  export { Button } from "./components/Button";
14
18
  export type { CardElevation, CardPadding, CardProps } from "./components/Card";
@@ -42,6 +46,8 @@ export type { EmptyStateProps } from "./components/EmptyState";
42
46
  export { EmptyState } from "./components/EmptyState";
43
47
  export type { ErrorBoundaryProps } from "./components/ErrorBoundary";
44
48
  export { ErrorBoundary } from "./components/ErrorBoundary";
49
+ export type { ExtrasCategoryType, ExtrasDialogProps, SelectedExtraType, } from "./components/ExtrasDialog";
50
+ export { ExtrasDialog } from "./components/ExtrasDialog";
45
51
  export type { FormFieldProps } from "./components/FormField";
46
52
  export { FormField } from "./components/FormField";
47
53
  export type { GoogleSignInButtonProps } from "./components/GoogleSignInButton";
@@ -68,10 +74,16 @@ export type { OverlayMessageProps, OverlayMessageStatus } from "./components/Ove
68
74
  export { OverlayMessage } from "./components/OverlayMessage";
69
75
  export type { PageLoadingOverlayProps } from "./components/PageLoadingOverlay";
70
76
  export { PageLoadingOverlay } from "./components/PageLoadingOverlay";
77
+ export type { PermissionGateProps } from "./components/PermissionGate";
78
+ export { PermissionGate } from "./components/PermissionGate";
71
79
  export type { PinLockOverlayProps } from "./components/PinLockOverlay";
72
80
  export { PinLockOverlay } from "./components/PinLockOverlay";
81
+ export type { ProductTileProps, ProductTileType, StockStatusType } from "./components/ProductTile";
82
+ export { ProductTile } from "./components/ProductTile";
73
83
  export type { RadioProps } from "./components/Radio";
74
84
  export { Radio } from "./components/Radio";
85
+ export type { SearchInputProps } from "./components/SearchInput";
86
+ export { SearchInput } from "./components/SearchInput";
75
87
  export type { SectionHeaderProps } from "./components/SectionHeader";
76
88
  export { SectionHeader } from "./components/SectionHeader";
77
89
  export type { SelectOption, SelectProps } from "./components/Select";
@@ -88,6 +100,8 @@ export type { SpinnerProps, SpinnerSize } from "./components/Spinner";
88
100
  export { Spinner } from "./components/Spinner";
89
101
  export type { StatusBadgeProps } from "./components/StatusBadge";
90
102
  export { StatusBadge } from "./components/StatusBadge";
103
+ export type { StepperProps } from "./components/Stepper";
104
+ export { Stepper } from "./components/Stepper";
91
105
  export type { TabBarProps, TabBarVariant } from "./components/TabBar";
92
106
  export { TabBar } from "./components/TabBar";
93
107
  export type { TabItem, TabsProps } from "./components/Tabs";
@@ -126,5 +140,6 @@ export { PageLayout } from "./layouts/PageLayout";
126
140
  export type { StackAlign, StackDirection, StackGap, StackJustify, StackProps, } from "./layouts/Stack";
127
141
  export { Stack } from "./layouts/Stack";
128
142
  export { cn } from "./utils/cn";
143
+ export { escapeCell, rowsToCsv } from "./utils/csv";
129
144
  export { useFocusTrap } from "./utils/focusTrap";
130
145
  export { portal } from "./utils/portal";