@toteat-eng/ds-react 2026.4.28-7
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/components/Accordion/Accordion.d.ts +13 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/AppleSignInButton/AppleSignInButton.d.ts +7 -0
- package/dist/components/AppleSignInButton/index.d.ts +2 -0
- package/dist/components/BackgroundWrapper/BackgroundWrapper.d.ts +5 -0
- package/dist/components/BackgroundWrapper/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +10 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +14 -0
- package/dist/components/Button/__stories__/Button.stories.d.ts +16 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +11 -0
- package/dist/components/Card/__stories__/Card.stories.d.ts +13 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Charts/Charts.d.ts +32 -0
- package/dist/components/Charts/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.d.ts +24 -0
- package/dist/components/DataTable/index.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.d.ts +7 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +14 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +11 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/DropZone/DropZone.d.ts +22 -0
- package/dist/components/DropZone/dropZoneConstants.d.ts +7 -0
- package/dist/components/DropZone/index.d.ts +3 -0
- package/dist/components/DropdownButton/DropdownButton.d.ts +18 -0
- package/dist/components/DropdownButton/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +15 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/DsProvider/DsProvider.d.ts +8 -0
- package/dist/components/EmptyState/EmptyState.d.ts +7 -0
- package/dist/components/EmptyState/__stories__/EmptyState.stories.d.ts +10 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +19 -0
- package/dist/components/ErrorBoundary/index.d.ts +2 -0
- package/dist/components/ExtrasDialog/ExtrasDialog.d.ts +30 -0
- package/dist/components/ExtrasDialog/index.d.ts +2 -0
- package/dist/components/FormField/FormField.d.ts +11 -0
- package/dist/components/FormField/index.d.ts +2 -0
- package/dist/components/GoogleSignInButton/GoogleSignInButton.d.ts +7 -0
- package/dist/components/GoogleSignInButton/index.d.ts +2 -0
- package/dist/components/GroupedButtons/GroupedButtons.d.ts +20 -0
- package/dist/components/GroupedButtons/index.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +10 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Icon/Icon.d.ts +11 -0
- package/dist/components/Icon/icons.d.ts +132 -0
- package/dist/components/Icon/index.d.ts +4 -0
- package/dist/components/ImagePreview/ImagePreview.d.ts +10 -0
- package/dist/components/ImagePreview/index.d.ts +2 -0
- package/dist/components/LanguageSelector/LanguageSelector.d.ts +10 -0
- package/dist/components/LanguageSelector/index.d.ts +2 -0
- package/dist/components/LogoToteat/LogoToteat.d.ts +11 -0
- package/dist/components/LogoToteat/index.d.ts +2 -0
- package/dist/components/Multiselect/Multiselect.d.ts +17 -0
- package/dist/components/Multiselect/index.d.ts +2 -0
- package/dist/components/NavBar/NavBar.d.ts +11 -0
- package/dist/components/NavBar/__stories__/NavBar.stories.d.ts +9 -0
- package/dist/components/NavBar/index.d.ts +2 -0
- package/dist/components/Overlay/Overlay.d.ts +19 -0
- package/dist/components/Overlay/index.d.ts +2 -0
- package/dist/components/OverlayMessage/OverlayMessage.d.ts +34 -0
- package/dist/components/OverlayMessage/index.d.ts +2 -0
- package/dist/components/PageLoadingOverlay/BreathingDotsCanvas.d.ts +5 -0
- package/dist/components/PageLoadingOverlay/PageLoadingOverlay.d.ts +17 -0
- package/dist/components/PageLoadingOverlay/ToteatLogo.d.ts +5 -0
- package/dist/components/PageLoadingOverlay/index.d.ts +2 -0
- package/dist/components/PinLockOverlay/PinLockOverlay.d.ts +6 -0
- package/dist/components/PinLockOverlay/__stories__/PinLockOverlay.stories.d.ts +7 -0
- package/dist/components/PinLockOverlay/index.d.ts +2 -0
- package/dist/components/ProductTile/ProductTile.d.ts +20 -0
- package/dist/components/ProductTile/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +6 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +19 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +9 -0
- package/dist/components/Sidebar/__stories__/Sidebar.stories.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/SidebarNavItem/SidebarNavItem.d.ts +10 -0
- package/dist/components/SidebarNavItem/index.d.ts +2 -0
- package/dist/components/SidebarNavSection/SidebarNavSection.d.ts +11 -0
- package/dist/components/SidebarNavSection/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +8 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +7 -0
- package/dist/components/Spinner/__stories__/Spinner.stories.d.ts +11 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/TabBar/TabBar.d.ts +7 -0
- package/dist/components/TabBar/__stories__/TabBar.stories.d.ts +9 -0
- package/dist/components/TabBar/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +17 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/TextInput/TextInput.d.ts +8 -0
- package/dist/components/TextInput/__stories__/TextInput.stories.d.ts +14 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +6 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/ThemeGate/ThemeGate.d.ts +8 -0
- package/dist/components/Toast/Toast.d.ts +15 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/useToast.d.ts +14 -0
- package/dist/components/Toggle/Toggle.d.ts +7 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/TreeItem/TreeItem.d.ts +41 -0
- package/dist/components/TreeItem/index.d.ts +3 -0
- package/dist/components/TreeItem/treeTypes.d.ts +7 -0
- package/dist/components/TreeList/TreeList.d.ts +27 -0
- package/dist/components/TreeList/index.d.ts +2 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.es.js +3178 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +67 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/layouts/AdminPageHeader/AdminPageHeader.d.ts +6 -0
- package/dist/layouts/AdminPageHeader/index.d.ts +2 -0
- package/dist/layouts/AppShell/AppShell.d.ts +15 -0
- package/dist/layouts/AppShell/__stories__/AppShell.stories.d.ts +11 -0
- package/dist/layouts/AppShell/index.d.ts +2 -0
- package/dist/layouts/Divider/Divider.d.ts +6 -0
- package/dist/layouts/Divider/index.d.ts +2 -0
- package/dist/layouts/Grid/Grid.d.ts +10 -0
- package/dist/layouts/Grid/index.d.ts +2 -0
- package/dist/layouts/LoginPageLayout/LoginPageLayout.d.ts +5 -0
- package/dist/layouts/LoginPageLayout/index.d.ts +2 -0
- package/dist/layouts/PageLayout/PageLayout.d.ts +9 -0
- package/dist/layouts/PageLayout/index.d.ts +2 -0
- package/dist/layouts/Stack/Stack.d.ts +17 -0
- package/dist/layouts/Stack/index.d.ts +2 -0
- package/dist/style.css +2 -0
- package/dist/test-setup.d.ts +1 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/focusTrap.d.ts +7 -0
- package/dist/utils/portal.d.ts +3 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
interface AccordionItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface AccordionProps {
|
|
9
|
+
items: AccordionItem[];
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function Accordion({ items, multiple }: AccordionProps): ReactElement;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion } from "./Accordion";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface AppleSignInButtonProps {
|
|
2
|
+
onSignIn: () => void;
|
|
3
|
+
isPending?: boolean;
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
error?: Error | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function AppleSignInButton({ onSignIn, isPending, isError, error, }: AppleSignInButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface BackgroundWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function BackgroundWrapper({ children, className, ...props }: BackgroundWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type BadgeVariant = "default" | "success" | "warning" | "error" | "info";
|
|
3
|
+
export type BadgeSize = "small" | "medium";
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
variant?: BadgeVariant;
|
|
6
|
+
size?: BadgeSize;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Badge({ variant, size, children, className, }: BadgeProps): React.ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "outline";
|
|
3
|
+
export type ButtonSize = "small" | "medium" | "large";
|
|
4
|
+
export type ButtonIconPosition = "left" | "right";
|
|
5
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
iconPosition?: ButtonIconPosition;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function Button({ variant, size, loading, fullWidth, icon, iconPosition, disabled, children, className, type, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Ghost: Story;
|
|
9
|
+
export declare const Outline: Story;
|
|
10
|
+
export declare const Loading: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
export declare const FullWidth: Story;
|
|
13
|
+
export declare const Small: Story;
|
|
14
|
+
export declare const Large: Story;
|
|
15
|
+
export declare const AllVariants: Story;
|
|
16
|
+
export declare const AllSizes: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type CardPadding = "none" | "small" | "medium" | "large";
|
|
3
|
+
export type CardElevation = "none" | "small" | "medium" | "large";
|
|
4
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
padding?: CardPadding;
|
|
6
|
+
elevation?: CardElevation;
|
|
7
|
+
hoverable?: boolean;
|
|
8
|
+
maxWidth?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function Card({ padding, elevation, hoverable, maxWidth, children, className, style, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Card } from "../Card";
|
|
3
|
+
declare const meta: Meta<typeof Card>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Card>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithElevationSmall: Story;
|
|
8
|
+
export declare const WithElevationMedium: Story;
|
|
9
|
+
export declare const WithElevationLarge: Story;
|
|
10
|
+
export declare const Hoverable: Story;
|
|
11
|
+
export declare const NoPadding: Story;
|
|
12
|
+
export declare const ConstrainedWidth: Story;
|
|
13
|
+
export declare const AllElevations: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
export interface ChartSeries {
|
|
3
|
+
dataKey: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BaseChartProps {
|
|
8
|
+
/** Data array — each object must have the keys referenced by series[].dataKey */
|
|
9
|
+
data: Record<string, unknown>[];
|
|
10
|
+
/** X-axis data key */
|
|
11
|
+
xKey: string;
|
|
12
|
+
series: ChartSeries[];
|
|
13
|
+
height?: number;
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Y-axis tick formatter */
|
|
16
|
+
formatY?: (value: number) => string;
|
|
17
|
+
/** Tooltip value formatter */
|
|
18
|
+
formatValue?: (value: number) => string;
|
|
19
|
+
/** Hide recharts legend */
|
|
20
|
+
hideLegend?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function LineChart({ data, xKey, series, height, title, formatY, formatValue, hideLegend, }: BaseChartProps): ReactElement;
|
|
23
|
+
export declare function BarChart({ data, xKey, series, height, title, formatY, formatValue, hideLegend, }: BaseChartProps): ReactElement;
|
|
24
|
+
export declare function AreaChart({ data, xKey, series, height, title, formatY, formatValue, hideLegend, }: BaseChartProps): ReactElement;
|
|
25
|
+
export interface KpiCardProps {
|
|
26
|
+
label: string;
|
|
27
|
+
value: string | number;
|
|
28
|
+
/** e.g. "+12.5%" or "-3.2%" */
|
|
29
|
+
change?: string;
|
|
30
|
+
trend?: "up" | "down" | "neutral";
|
|
31
|
+
}
|
|
32
|
+
export declare function KpiCard({ label, value, change, trend }: KpiCardProps): ReactElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from "react";
|
|
2
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare function Checkbox({ label, className, id, ref, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export interface DataTableProps<T> {
|
|
4
|
+
data: T[];
|
|
5
|
+
columns: ColumnDef<T, unknown>[];
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
loadingSlot?: ReactNode;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
paginated?: boolean;
|
|
12
|
+
emptyMessage?: ReactNode;
|
|
13
|
+
searchPlaceholder?: string;
|
|
14
|
+
previousLabel?: string;
|
|
15
|
+
nextLabel?: string;
|
|
16
|
+
onRowClick?: (row: T) => void;
|
|
17
|
+
selectable?: boolean;
|
|
18
|
+
onSelectionChange?: (rows: T[]) => void;
|
|
19
|
+
manualPagination?: boolean;
|
|
20
|
+
pageCount?: number;
|
|
21
|
+
/** Wrap with useCallback in the parent to avoid redundant fetches on re-render. */
|
|
22
|
+
onPageChange?: (pageIndex: number, pageSize: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function DataTable<T>({ data, columns, isLoading, loadingSlot, pageSize, searchable, sortable, paginated, emptyMessage, searchPlaceholder, previousLabel, nextLabel, onRowClick, selectable, onSelectionChange, manualPagination, pageCount, onPageChange, }: DataTableProps<T>): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, Ref } from "react";
|
|
2
|
+
export interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
error?: boolean;
|
|
4
|
+
label?: string;
|
|
5
|
+
ref?: Ref<HTMLInputElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function DatePicker({ error, label, className, id, ref, ...props }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DateRangePickerProps {
|
|
2
|
+
startDate?: string;
|
|
3
|
+
endDate?: string;
|
|
4
|
+
onStartChange?: (date: string) => void;
|
|
5
|
+
onEndChange?: (date: string) => void;
|
|
6
|
+
startLabel?: string;
|
|
7
|
+
endLabel?: string;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
minDate?: string;
|
|
11
|
+
maxDate?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function DateRangePicker({ startDate, endDate, onStartChange, onEndChange, startLabel, endLabel, error, disabled, minDate, maxDate, className, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type DialogSize = "small" | "medium" | "large";
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
title: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
size?: DialogSize;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Dialog({ open, onClose, title, children, size, className, }: DialogProps): import("react").ReactPortal | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AllowedFileTypes } from "./dropZoneConstants";
|
|
2
|
+
export interface FileWithPreview {
|
|
3
|
+
id: string;
|
|
4
|
+
file: File;
|
|
5
|
+
name: string;
|
|
6
|
+
preview: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DropZoneProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
allowedFileTypes?: AllowedFileTypes;
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
displayPreview?: boolean;
|
|
13
|
+
displayFileList?: boolean;
|
|
14
|
+
value?: FileWithPreview[] | null;
|
|
15
|
+
onDrop: (files: FileList) => void;
|
|
16
|
+
onDropError?: (message: string) => void;
|
|
17
|
+
onRemove?: (file: FileWithPreview) => void;
|
|
18
|
+
onChange?: (files: FileWithPreview[]) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
"data-testid"?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function DropZone({ label, allowedFileTypes, multiple, displayPreview, displayFileList, value, onDrop, onDropError, onRemove, onChange, className, "data-testid": dataTestId, }: DropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type AllowedFileTypes = "images" | "video" | "text" | "spreadsheet";
|
|
2
|
+
export declare const ALLOWED_TYPES_MAP: Record<AllowedFileTypes, {
|
|
3
|
+
types: string[];
|
|
4
|
+
mimeTypes: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function getAllowedMimeTypes(fileType: AllowedFileTypes): string;
|
|
7
|
+
export declare function validateFiles(files: FileList, allowedFileTypes: AllowedFileTypes): File[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IconNameType } from "../Icon/icons";
|
|
2
|
+
export interface DropdownMenuItemType {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: IconNameType;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DropdownButtonProps {
|
|
9
|
+
text: string;
|
|
10
|
+
menuItems: DropdownMenuItemType[];
|
|
11
|
+
size?: "tiny" | "small" | "medium" | "large";
|
|
12
|
+
variant?: "primary" | "ghost";
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onSelect?: (item: DropdownMenuItemType) => void;
|
|
15
|
+
onOpen?: () => void;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function DropdownButton({ text, menuItems, size, variant, disabled, onSelect, onOpen, onClose, }: DropdownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface DropdownMenuItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
danger?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DropdownMenuProps {
|
|
11
|
+
trigger: ReactNode;
|
|
12
|
+
items: DropdownMenuItem[];
|
|
13
|
+
align?: "left" | "right";
|
|
14
|
+
}
|
|
15
|
+
export declare function DropdownMenu({ trigger, items, align }: DropdownMenuProps): ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type DsTheme = "toteat-react-ds" | "angular-legacy";
|
|
3
|
+
export interface DsProviderProps {
|
|
4
|
+
theme: DsTheme;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function DsProvider({ theme, children, className }: DsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { EmptyState } from "../EmptyState";
|
|
3
|
+
declare const meta: Meta<typeof EmptyState>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof EmptyState>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithAction: Story;
|
|
8
|
+
export declare const WithSecondaryAction: Story;
|
|
9
|
+
export declare const LongMessage: Story;
|
|
10
|
+
export declare const LongMessageWithAction: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ErrorInfo, ReactNode } from "react";
|
|
2
|
+
import { Component } from "react";
|
|
3
|
+
export interface ErrorBoundaryProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
fallback?: ReactNode | ((error: Error, retry: () => void) => ReactNode);
|
|
6
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
7
|
+
}
|
|
8
|
+
interface ErrorBoundaryState {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
13
|
+
constructor(props: ErrorBoundaryProps);
|
|
14
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
15
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
16
|
+
handleRetry: () => void;
|
|
17
|
+
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
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ExtraProductType = {
|
|
2
|
+
productId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
price: number;
|
|
5
|
+
inStock: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type ExtrasCategoryType = {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
selectionType: "multi" | "single";
|
|
11
|
+
minSelections: number;
|
|
12
|
+
maxSelections: number;
|
|
13
|
+
products: ExtraProductType[];
|
|
14
|
+
};
|
|
15
|
+
export type SelectedExtraType = {
|
|
16
|
+
productId: string;
|
|
17
|
+
quantity: number;
|
|
18
|
+
categoryId: string;
|
|
19
|
+
};
|
|
20
|
+
export type ExtrasDialogProps = {
|
|
21
|
+
open: boolean;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
/** Called with all selections when user confirms.
|
|
24
|
+
* NOTE: maxSelections is enforced client-side (FIFO). The server must
|
|
25
|
+
* also validate extras counts to prevent tampered requests. */
|
|
26
|
+
onConfirm: (selections: SelectedExtraType[]) => void;
|
|
27
|
+
categories: ExtrasCategoryType[];
|
|
28
|
+
productName: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function ExtrasDialog({ open, onClose, onConfirm, categories, productName, }: ExtrasDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface FormFieldProps {
|
|
3
|
+
label: string;
|
|
4
|
+
htmlFor?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function FormField({ label, htmlFor, error, description, required, children, className, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface GoogleSignInButtonProps {
|
|
2
|
+
onSignIn: () => void;
|
|
3
|
+
isPending?: boolean;
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
error?: Error | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function GoogleSignInButton({ onSignIn, isPending, isError, error, }: GoogleSignInButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import type { IconName } from "../Icon";
|
|
3
|
+
export type GroupedButtonSize = "small" | "medium" | "large";
|
|
4
|
+
export type GroupPosition = "standalone" | "left" | "center" | "right";
|
|
5
|
+
export interface GroupedButtonOption {
|
|
6
|
+
value: string | number;
|
|
7
|
+
label: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
}
|
|
11
|
+
export interface GroupedButtonsProps extends Omit<HTMLAttributes<HTMLFieldSetElement>, "onChange"> {
|
|
12
|
+
label: string;
|
|
13
|
+
options: GroupedButtonOption[];
|
|
14
|
+
selectedButton?: string | number;
|
|
15
|
+
size?: GroupedButtonSize;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
onChange?: (value: string | number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function GroupedButtons({ label, options, selectedButton, size, fullWidth, disabled, onChange, className, ...props }: GroupedButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface HeaderItem {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HeaderProps extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
headers?: HeaderItem[];
|
|
8
|
+
spaceBetween?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function Header({ headers, spaceBetween, className, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconNameType } from "./icons";
|
|
2
|
+
export type { IconNameType };
|
|
3
|
+
export interface IconProps {
|
|
4
|
+
name: IconNameType;
|
|
5
|
+
size?: number | string;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
"aria-label"?: string;
|
|
9
|
+
"aria-hidden"?: boolean | "true" | "false";
|
|
10
|
+
}
|
|
11
|
+
export declare function Icon({ name, size, className, color, "aria-label": ariaLabel, "aria-hidden": ariaHidden, }: IconProps): import("react/jsx-runtime").JSX.Element;
|