@facto-to/design-system 0.1.0-beta.1

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,213 @@
1
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
+ import * as ToastPrimitive from '@radix-ui/react-toast';
3
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
5
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
6
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
7
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, HTMLAttributes, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
8
+ import './styles.css';
9
+ export type FactoThemeTokens = Partial<Record<`--facto-${string}`, string | number>>;
10
+ type ThemeTokens = FactoThemeTokens;
11
+ export interface FactoThemeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style'> {
12
+ /** Scoped overrides; unspecified tokens inherit the dashboard defaults or parent theme. */
13
+ tokens?: FactoThemeTokens;
14
+ /** Inline styles take precedence over the tokens prop. */
15
+ style?: CSSProperties & Partial<ThemeTokens>;
16
+ }
17
+ /** Scoped token container. Inline `--facto-*` values are forwarded to portalled overlays. */
18
+ export declare function FactoTheme({ className, tokens, style, ...props }: FactoThemeProps): import("react").JSX.Element;
19
+ /** Button hierarchy based on the final Facto user application controls. */
20
+ export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'text';
21
+ export type ButtonSize = 'sm' | 'md' | 'lg';
22
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
23
+ variant?: ButtonVariant;
24
+ size?: ButtonSize;
25
+ fullWidth?: boolean;
26
+ /** Shows a non-interactive progress indicator and disables the control. */
27
+ loading?: boolean;
28
+ }
29
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
30
+ /** Accessible icon-only action. `ariaLabel` is required because there is no visible text. */
31
+ export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> {
32
+ ariaLabel: string;
33
+ size?: ButtonSize;
34
+ }
35
+ export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
36
+ /** Elevated neutral content container. */
37
+ export interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {
38
+ padding?: 'none' | 'sm' | 'md' | 'lg';
39
+ }
40
+ export declare function Surface({ padding, className, ...props }: SurfaceProps): import("react").JSX.Element;
41
+ /** Semantic alias for a card-shaped `Surface`. */
42
+ export declare function Card(props: SurfaceProps): import("react").JSX.Element;
43
+ /** Compact overview widget preset (20px padding) from the Facto dashboard. */
44
+ export interface WidgetProps extends Omit<SurfaceProps, 'padding'> {
45
+ span?: 1 | 2;
46
+ }
47
+ export declare function Widget({ span, className, ...props }: WidgetProps): import("react").JSX.Element;
48
+ /** Responsive 194px dashboard widget grid with its own query container. */
49
+ export declare function DashboardGrid({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
50
+ export interface WidgetHeaderProps extends HTMLAttributes<HTMLDivElement> {
51
+ withAction?: boolean;
52
+ }
53
+ export declare function WidgetHeader({ withAction, className, ...props }: WidgetHeaderProps): import("react").JSX.Element;
54
+ export declare function WidgetList({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
55
+ export declare function WidgetKeyValue({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
56
+ export declare function WidgetAmount({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
57
+ export interface WidgetActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
58
+ dark?: boolean;
59
+ href?: never;
60
+ }
61
+ export interface WidgetActionLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
62
+ dark?: boolean;
63
+ href: string;
64
+ }
65
+ export type WidgetActionProps = WidgetActionButtonProps | WidgetActionLinkProps;
66
+ /** Use href for navigation; omit it for a button action. */
67
+ export declare function WidgetAction(props: WidgetActionProps): import("react").JSX.Element;
68
+ export declare function WidgetRow({ className, type, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
69
+ export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
70
+ label?: ReactNode;
71
+ helperText?: ReactNode;
72
+ error?: ReactNode;
73
+ containerClassName?: string;
74
+ }
75
+ /** Labelled text input with linked helper or error description. */
76
+ export declare function TextField({ label, helperText, error, id, containerClassName, className, ...props }: TextFieldProps): import("react").JSX.Element;
77
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
78
+ label?: ReactNode;
79
+ helperText?: ReactNode;
80
+ error?: ReactNode;
81
+ containerClassName?: string;
82
+ }
83
+ /** Labelled multiline input with linked helper or error description. */
84
+ export declare function Textarea({ label, helperText, error, id, containerClassName, className, ...props }: TextareaProps): import("react").JSX.Element;
85
+ export type BadgeTone = 'success' | 'warning' | 'danger' | 'neutral';
86
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
87
+ tone?: BadgeTone;
88
+ }
89
+ /** Compact explicit status label. */
90
+ export declare function Badge({ tone, className, ...props }: BadgeProps): import("react").JSX.Element;
91
+ export interface SelectItem {
92
+ value: string;
93
+ label: ReactNode;
94
+ disabled?: boolean;
95
+ }
96
+ export interface SelectProps {
97
+ options: readonly SelectItem[];
98
+ value?: string;
99
+ defaultValue?: string;
100
+ onValueChange?: (value: string) => void;
101
+ placeholder?: string;
102
+ label?: ReactNode;
103
+ error?: ReactNode;
104
+ disabled?: boolean;
105
+ name?: string;
106
+ id?: string;
107
+ ariaLabel?: string;
108
+ 'aria-describedby'?: string;
109
+ className?: string;
110
+ }
111
+ /** Controlled or uncontrolled Radix select. Use `options` for stable value/label pairs. */
112
+ export declare function Select({ options, value, defaultValue, onValueChange, placeholder, label, error, disabled, name, id, ariaLabel, 'aria-describedby': ariaDescribedBy, className, }: SelectProps): import("react").JSX.Element;
113
+ export interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'children'> {
114
+ label?: ReactNode;
115
+ description?: ReactNode;
116
+ }
117
+ /** Radix switch with optional visible label and description. */
118
+ export declare function Switch({ label, description, className, id, ...props }: SwitchProps): import("react").JSX.Element;
119
+ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'children'> {
120
+ label?: ReactNode;
121
+ description?: ReactNode;
122
+ }
123
+ /** Radix checkbox with optional visible label and description. */
124
+ export declare function Checkbox({ label, description, className, id, ...props }: CheckboxProps): import("react").JSX.Element;
125
+ export declare const Tabs: import("react").ForwardRefExoticComponent<TabsPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>>;
126
+ export declare function TabsList({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.List>): import("react").JSX.Element;
127
+ export declare function TabsTrigger({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>): import("react").JSX.Element;
128
+ export declare function TabsContent({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.Content>): import("react").JSX.Element;
129
+ export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
130
+ export declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
131
+ export declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
132
+ export declare const DialogTitle: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
133
+ export declare const DialogDescription: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
134
+ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
135
+ size?: 'sm' | 'md';
136
+ }
137
+ /** Focus-managed modal content. Place title and description inside for accessible announcements. */
138
+ export declare function DialogContent({ size, className, style, children, ...props }: DialogContentProps): import("react").JSX.Element;
139
+ export declare const Sheet: import("react").FC<DialogPrimitive.DialogProps>;
140
+ export declare const SheetTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
141
+ export declare const SheetClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
142
+ export declare const SheetTitle: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
143
+ export declare const SheetDescription: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
144
+ export interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
145
+ side?: 'center' | 'right' | 'bottom';
146
+ }
147
+ /** Focus-managed side or mobile-bottom sheet. */
148
+ export declare function SheetContent({ side, className, style, children, ...props }: SheetContentProps): import("react").JSX.Element;
149
+ export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
150
+ width?: string | number;
151
+ height?: string | number;
152
+ circle?: boolean;
153
+ }
154
+ /** Decorative neutral loading placeholder. */
155
+ export declare function Skeleton({ width, height, circle, className, style, ...props }: SkeletonProps): import("react").JSX.Element;
156
+ export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
157
+ title: ReactNode;
158
+ description?: ReactNode;
159
+ action?: ReactNode;
160
+ icon?: ReactNode;
161
+ }
162
+ /** Centred zero-data state. */
163
+ export declare function EmptyState({ title, description, action, icon, className, ...props }: EmptyStateProps): import("react").JSX.Element;
164
+ export type NoticeTone = 'info' | 'success' | 'warning' | 'danger';
165
+ export interface NoticeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
166
+ tone?: NoticeTone;
167
+ title: ReactNode;
168
+ description?: ReactNode;
169
+ action?: ReactNode;
170
+ }
171
+ /** Inline contextual notice; use `danger` for blocking errors. */
172
+ export declare function Notice({ tone, title, description, action, className, ...props }: NoticeProps): import("react").JSX.Element;
173
+ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
174
+ gap?: 1 | 2 | 3 | 4 | 5 | 6;
175
+ direction?: 'vertical' | 'horizontal';
176
+ align?: 'start' | 'center' | 'end' | 'stretch';
177
+ justify?: 'start' | 'center' | 'end' | 'between';
178
+ }
179
+ /** Small flex layout primitive using Facto spacing tokens. */
180
+ export declare function Stack({ gap, direction, align, justify, className, ...props }: StackProps): import("react").JSX.Element;
181
+ export declare function TooltipProvider({ delayDuration, ...props }: ComponentPropsWithRef<typeof TooltipPrimitive.Provider>): import("react").JSX.Element;
182
+ export declare const Tooltip: import("react").FC<TooltipPrimitive.TooltipProps>;
183
+ export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
184
+ export interface TooltipContentProps extends ComponentPropsWithRef<typeof TooltipPrimitive.Content> {
185
+ variant?: 'default' | 'content';
186
+ }
187
+ /** Supplemental plain text; interactive content belongs in a dialog or popover. */
188
+ export declare function TooltipContent({ variant, className, style, sideOffset, children, ...props }: TooltipContentProps): import("react").JSX.Element;
189
+ /** Dashboard notifications default to 2.6 seconds. */
190
+ export declare function ToastProvider({ duration, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Provider>): import("react").JSX.Element;
191
+ export interface ToastProps extends ComponentPropsWithRef<typeof ToastPrimitive.Root> {
192
+ tone?: NoticeTone;
193
+ }
194
+ /** Controlled or uncontrolled notification. Render a ToastViewport inside the provider. */
195
+ export declare function Toast({ tone, className, style, children, ...props }: ToastProps): import("react").JSX.Element;
196
+ export declare function ToastTitle({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Title>): import("react").JSX.Element;
197
+ export declare function ToastDescription({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Description>): import("react").JSX.Element;
198
+ export declare function ToastAction({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Action>): import("react").JSX.Element;
199
+ export declare function ToastClose({ className, children, 'aria-label': label, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Close>): import("react").JSX.Element;
200
+ export declare function ToastViewport({ className, style, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Viewport>): import("react").ReactPortal | null;
201
+ export interface EnhancedSearchFieldProps extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'type' | 'onChange'> {
202
+ value?: string;
203
+ defaultValue?: string;
204
+ onValueChange?: (value: string) => void;
205
+ clearLabel?: string;
206
+ }
207
+ /** Local input only; filtering and requests are owned by the consuming application. */
208
+ export declare function EnhancedSearchField({ value, defaultValue, onValueChange, clearLabel, label, helperText, error, id, containerClassName, className, disabled, readOnly, ...props }: EnhancedSearchFieldProps): import("react").JSX.Element;
209
+ /** Dashboard list search: native input changes, no added icon or clear action. */
210
+ export interface SearchFieldProps extends Omit<TextFieldProps, 'type'> {
211
+ }
212
+ export declare function SearchField({ className, ...props }: SearchFieldProps): import("react").JSX.Element;
213
+ export {};