@facto-to/design-system 0.1.0-beta.5 → 0.1.0-beta.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/AI.md +5 -1
- package/README.md +44 -4
- package/dist/ai/SKILL.md +5 -1
- package/dist/ai/references/api.d.ts +304 -91
- package/dist/ai/references/catalog.json +27 -2
- package/dist/ai/references/component-adoption.json +4 -0
- package/dist/ai/references/components.md +26 -0
- package/dist/ai/references/design.md +4 -2
- package/dist/ai/references/integration.md +1 -1
- package/dist/ai/references/standard-target.json +5 -0
- package/dist/ai/references/standard-version.json +9 -0
- package/dist/ai/references/tokens.css +2 -0
- package/dist/ai/references/ui-standard-reference.md +498 -0
- package/dist/ai/references/ui-standard.md +195 -0
- package/dist/ai/references/version.json +12 -3
- package/dist/index.d.ts +304 -91
- package/dist/index.js +845 -437
- package/dist/styles.css +1 -1
- package/dist/tokens.css +2 -0
- package/package.json +8 -4
|
@@ -1,109 +1,292 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ImgHTMLAttributes, ReactNode, HTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, SVGProps, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import * as MenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
1
5
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
6
|
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
3
7
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
9
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
6
10
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
|
|
12
|
+
interface ListRowSlots {
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
value?: ReactNode;
|
|
17
|
+
status?: ReactNode;
|
|
18
|
+
trailing?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
type ListRowSharedProps = ListRowSlots & {
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
type ListRowStaticProps = ListRowSharedProps & Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
|
|
24
|
+
type ListRowLinkProps = ListRowSharedProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'title'> & {
|
|
25
|
+
href: string;
|
|
26
|
+
};
|
|
27
|
+
type ListRowButtonProps = ListRowSharedProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> & {
|
|
28
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
29
|
+
};
|
|
30
|
+
type ListRowProps = ListRowStaticProps | ListRowLinkProps | ListRowButtonProps;
|
|
31
|
+
/** A compact, responsive data row. Passing `href` renders a link; passing `onClick` renders a button. */
|
|
32
|
+
declare const ListRow: react.ForwardRefExoticComponent<ListRowProps & react.RefAttributes<HTMLElement>>;
|
|
33
|
+
interface ListGroupProps extends HTMLAttributes<HTMLElement> {
|
|
34
|
+
heading?: ReactNode;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** Groups related list rows under an optional visible heading. */
|
|
38
|
+
declare function ListGroup({ heading, children, className, ...props }: ListGroupProps): react.JSX.Element;
|
|
39
|
+
interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'size'> {
|
|
40
|
+
fallback?: ReactNode;
|
|
41
|
+
size?: 'sm' | 'md' | 'lg';
|
|
42
|
+
}
|
|
43
|
+
/** Image avatar with an accessible text or node fallback when the image is unavailable. */
|
|
44
|
+
declare function Avatar({ src, alt, fallback, size, className, onError, ...props }: AvatarProps): react.JSX.Element;
|
|
45
|
+
interface LogoStackItem {
|
|
46
|
+
src?: string;
|
|
47
|
+
alt?: string;
|
|
48
|
+
fallback?: ReactNode;
|
|
49
|
+
}
|
|
50
|
+
interface LogoStackProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
51
|
+
logos: readonly LogoStackItem[];
|
|
52
|
+
size?: 'sm' | 'md' | 'lg';
|
|
53
|
+
max?: number;
|
|
54
|
+
}
|
|
55
|
+
/** Overlapping generic image marks, including the same graceful fallback as Avatar. */
|
|
56
|
+
declare function LogoStack({ logos, size, max, className, ...props }: LogoStackProps): react.JSX.Element;
|
|
57
|
+
interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
58
|
+
title: ReactNode;
|
|
59
|
+
description?: ReactNode;
|
|
60
|
+
retryLabel?: string;
|
|
61
|
+
onRetry?: MouseEventHandler<HTMLButtonElement>;
|
|
62
|
+
}
|
|
63
|
+
/** Compact recoverable-error presentation. Request retry work remains with the consumer. */
|
|
64
|
+
declare function ErrorState({ title, description, retryLabel, onRetry, className, ...props }: ErrorStateProps): react.JSX.Element;
|
|
65
|
+
interface LoadingMoreProps extends HTMLAttributes<HTMLDivElement> {
|
|
66
|
+
label?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
/** Presentational loading indicator for the end of a growing list. */
|
|
69
|
+
declare function LoadingMore({ label, className, ...props }: LoadingMoreProps): react.JSX.Element;
|
|
70
|
+
type StepChecklistState = 'complete' | 'current' | 'upcoming';
|
|
71
|
+
interface StepChecklistItem {
|
|
72
|
+
label: ReactNode;
|
|
73
|
+
description?: ReactNode;
|
|
74
|
+
state?: StepChecklistState;
|
|
75
|
+
}
|
|
76
|
+
interface StepChecklistProps extends Omit<HTMLAttributes<HTMLOListElement>, 'children'> {
|
|
77
|
+
steps: readonly StepChecklistItem[];
|
|
78
|
+
}
|
|
79
|
+
/** Static progress checklist; consumers own navigation and completion state changes. */
|
|
80
|
+
declare function StepChecklist({ steps, className, ...props }: StepChecklistProps): react.JSX.Element;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A bordered field frame with an inset label and optional leading or trailing
|
|
84
|
+
* content. Set the contained input id to the required inputId for label association.
|
|
85
|
+
*/
|
|
86
|
+
interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
87
|
+
/** ID of the contained native input; associates it with the inset label. */
|
|
88
|
+
inputId: string;
|
|
89
|
+
label?: ReactNode;
|
|
90
|
+
leading?: ReactNode;
|
|
91
|
+
trailing?: ReactNode;
|
|
92
|
+
children: ReactNode;
|
|
93
|
+
invalid?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Generic field chrome for native inputs and input-like controls. */
|
|
96
|
+
declare function Field({ label, leading, trailing, children, invalid, inputId, className, ...props }: FieldProps): react.JSX.Element;
|
|
97
|
+
interface OtpInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'maxLength' | 'onChange' | 'size' | 'type' | 'value'> {
|
|
98
|
+
/** Controlled verification code. Non-digit characters are ignored. */
|
|
99
|
+
value: string;
|
|
100
|
+
/** Receives the normalized code after typing, pasting, or browser autofill. */
|
|
101
|
+
onValueChange: (value: string) => void;
|
|
102
|
+
/** Number of visual code cells and the maximum accepted code length. */
|
|
103
|
+
length?: number;
|
|
104
|
+
/** Called once for each distinct complete value, after the controlled value updates. */
|
|
105
|
+
onComplete?: (value: string) => void;
|
|
106
|
+
/** Delay before `onComplete`, allowing the final digit to render before navigation. */
|
|
107
|
+
completionDelay?: number;
|
|
108
|
+
/** Blocks editing while the application verifies the current code. */
|
|
109
|
+
pending?: boolean;
|
|
110
|
+
/** Announced and displayed while `pending` is true. */
|
|
111
|
+
pendingLabel?: ReactNode;
|
|
112
|
+
label?: ReactNode;
|
|
113
|
+
helperText?: ReactNode;
|
|
114
|
+
error?: ReactNode;
|
|
115
|
+
containerClassName?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Accessible segmented one-time-code input backed by one native input so paste
|
|
119
|
+
* and platform autofill work as expected. Authentication and verification stay
|
|
120
|
+
* in the consuming application.
|
|
121
|
+
*/
|
|
122
|
+
declare function OtpInput({ value, onValueChange, length, onComplete, completionDelay, pending, pendingLabel, label, helperText, error, id, className, containerClassName, disabled, readOnly, onPaste, onFocus, onBlur, ...props }: OtpInputProps): react.JSX.Element;
|
|
123
|
+
interface ResendCodeButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type'> {
|
|
124
|
+
/** UTC timestamp (milliseconds) or Date until another request may be sent. */
|
|
125
|
+
deadline?: number | Date | null;
|
|
126
|
+
/** Shows progress while the consuming application handles its request. */
|
|
127
|
+
pending?: boolean;
|
|
128
|
+
children?: ReactNode;
|
|
129
|
+
/** Optional rendering override for the remaining whole seconds. */
|
|
130
|
+
formatCountdown?: (remainingSeconds: number) => ReactNode;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A presentational resend action. Pass an externally owned `deadline`; this
|
|
134
|
+
* component does not issue requests or set cooldown policy.
|
|
135
|
+
*/
|
|
136
|
+
declare function ResendCodeButton({ deadline, pending, disabled, children, formatCountdown, className, onClick, ...props }: ResendCodeButtonProps): react.JSX.Element;
|
|
137
|
+
|
|
138
|
+
type ToastId = string;
|
|
139
|
+
type ToastTone = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
140
|
+
interface ToastActionOptions {
|
|
141
|
+
label: ReactNode;
|
|
142
|
+
/** Accessible description of the effect, required by Radix ToastAction. */
|
|
143
|
+
altText: string;
|
|
144
|
+
onClick: () => void;
|
|
145
|
+
}
|
|
146
|
+
interface ToastOptions {
|
|
147
|
+
/** Reusing an id updates the existing notification instead of adding another one. */
|
|
148
|
+
id?: ToastId;
|
|
149
|
+
description?: ReactNode;
|
|
150
|
+
action?: ToastActionOptions;
|
|
151
|
+
/** Lets Radix own this notification's dismissal timer. */
|
|
152
|
+
duration?: number;
|
|
153
|
+
}
|
|
154
|
+
interface ToastUpdate extends Omit<ToastOptions, 'id'> {
|
|
155
|
+
title?: ReactNode;
|
|
156
|
+
tone?: ToastTone;
|
|
157
|
+
}
|
|
158
|
+
interface ToastPromiseMessages<Value> {
|
|
159
|
+
loading: ReactNode;
|
|
160
|
+
success: ReactNode | ((value: Value) => ReactNode);
|
|
161
|
+
error: ReactNode | ((error: unknown) => ReactNode);
|
|
162
|
+
}
|
|
163
|
+
interface ToastApi {
|
|
164
|
+
success: (title: ReactNode, options?: ToastOptions) => ToastId;
|
|
165
|
+
error: (title: ReactNode, options?: ToastOptions) => ToastId;
|
|
166
|
+
warning: (title: ReactNode, options?: ToastOptions) => ToastId;
|
|
167
|
+
info: (title: ReactNode, options?: ToastOptions) => ToastId;
|
|
168
|
+
loading: (title: ReactNode, options?: ToastOptions) => ToastId;
|
|
169
|
+
update: (id: ToastId, update: ToastUpdate) => ToastId;
|
|
170
|
+
dismiss: (id?: ToastId) => void;
|
|
171
|
+
promise: <Value>(promise: PromiseLike<Value>, messages: ToastPromiseMessages<Value>, options?: ToastOptions) => Promise<Value>;
|
|
172
|
+
}
|
|
173
|
+
interface NotificationsProviderProps {
|
|
174
|
+
children: ReactNode;
|
|
175
|
+
/** Default Radix dismissal duration for non-loading notifications. */
|
|
176
|
+
duration?: number;
|
|
177
|
+
/** Maximum number of notifications kept visible by this provider. */
|
|
178
|
+
maxVisible?: number;
|
|
179
|
+
/** Accessible label announced by the Radix toast viewport. */
|
|
180
|
+
label?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Provider-scoped notification state backed by the SDK Toast primitives.
|
|
184
|
+
* Each provider has its own queue, ids and Radix-managed dismissal timers.
|
|
185
|
+
*/
|
|
186
|
+
declare function NotificationsProvider({ children, duration, maxVisible, label, }: NotificationsProviderProps): react.JSX.Element;
|
|
187
|
+
/** Returns the notification API for the nearest NotificationsProvider. */
|
|
188
|
+
declare function useToast(): ToastApi;
|
|
189
|
+
|
|
190
|
+
type FactoThemeTokens = Partial<Record<`--facto-${string}`, string | number>>;
|
|
10
191
|
type ThemeTokens = FactoThemeTokens;
|
|
11
|
-
|
|
192
|
+
interface FactoThemeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style'> {
|
|
12
193
|
/** Scoped overrides; unspecified tokens inherit the dashboard defaults or parent theme. */
|
|
13
194
|
tokens?: FactoThemeTokens;
|
|
14
195
|
/** Inline styles take precedence over the tokens prop. */
|
|
15
196
|
style?: CSSProperties & Partial<ThemeTokens>;
|
|
16
197
|
}
|
|
17
198
|
/** Scoped token container. Inline `--facto-*` values are forwarded to portalled overlays. */
|
|
18
|
-
|
|
199
|
+
declare function FactoTheme({ className, tokens, style, ...props }: FactoThemeProps): react.JSX.Element;
|
|
19
200
|
/** Shared decorative symbols; name the containing control, not the glyph. */
|
|
20
|
-
|
|
21
|
-
|
|
201
|
+
type IconName = 'close' | 'arrowLeft' | 'check' | 'chevronDown' | 'chevronRight' | 'info' | 'warning' | 'plus' | 'chevronLeft' | 'copy' | 'search';
|
|
202
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
22
203
|
name: IconName;
|
|
23
204
|
size?: number;
|
|
24
205
|
}
|
|
25
|
-
|
|
206
|
+
declare function Icon({ name, size, ...props }: IconProps): react.JSX.Element;
|
|
26
207
|
/** Layout only: use existing Dialog/Sheet title and close primitives inside. */
|
|
27
|
-
|
|
28
|
-
|
|
208
|
+
declare function ModalHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
209
|
+
declare function ModalFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
29
210
|
/** Button hierarchy based on the final Facto user application controls. */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
211
|
+
type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'text';
|
|
212
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
213
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
33
214
|
variant?: ButtonVariant;
|
|
34
215
|
size?: ButtonSize;
|
|
35
216
|
fullWidth?: boolean;
|
|
36
217
|
/** Shows a non-interactive progress indicator and disables the control. */
|
|
37
218
|
loading?: boolean;
|
|
219
|
+
leadingIcon?: ReactNode;
|
|
220
|
+
trailingIcon?: ReactNode;
|
|
38
221
|
}
|
|
39
|
-
|
|
222
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
40
223
|
/** Accessible icon-only action. `ariaLabel` is required because there is no visible text. */
|
|
41
|
-
|
|
224
|
+
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> {
|
|
42
225
|
ariaLabel: string;
|
|
43
226
|
size?: ButtonSize;
|
|
44
227
|
}
|
|
45
|
-
|
|
228
|
+
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
46
229
|
/** Neutral content container with a quiet border and no elevation. */
|
|
47
|
-
|
|
230
|
+
interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
231
|
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
49
232
|
}
|
|
50
|
-
|
|
233
|
+
declare function Surface({ padding, className, ...props }: SurfaceProps): react.JSX.Element;
|
|
51
234
|
/** Semantic alias for a card-shaped `Surface`. */
|
|
52
|
-
|
|
235
|
+
declare function Card(props: SurfaceProps): react.JSX.Element;
|
|
53
236
|
/** Compact overview widget preset (20px padding) from the Facto dashboard. */
|
|
54
|
-
|
|
237
|
+
interface WidgetProps extends Omit<SurfaceProps, 'padding'> {
|
|
55
238
|
span?: 1 | 2;
|
|
56
239
|
}
|
|
57
|
-
|
|
240
|
+
declare function Widget({ span, className, ...props }: WidgetProps): react.JSX.Element;
|
|
58
241
|
/** Responsive 194px dashboard widget grid with its own query container. */
|
|
59
|
-
|
|
60
|
-
|
|
242
|
+
declare function DashboardGrid({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
243
|
+
interface WidgetHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
61
244
|
withAction?: boolean;
|
|
62
245
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
246
|
+
declare function WidgetHeader({ withAction, className, ...props }: WidgetHeaderProps): react.JSX.Element;
|
|
247
|
+
declare function WidgetList({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
248
|
+
declare function WidgetKeyValue({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
249
|
+
declare function WidgetAmount({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
250
|
+
interface WidgetActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
68
251
|
dark?: boolean;
|
|
69
252
|
href?: never;
|
|
70
253
|
}
|
|
71
|
-
|
|
254
|
+
interface WidgetActionLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
72
255
|
dark?: boolean;
|
|
73
256
|
href: string;
|
|
74
257
|
}
|
|
75
|
-
|
|
258
|
+
type WidgetActionProps = WidgetActionButtonProps | WidgetActionLinkProps;
|
|
76
259
|
/** Use href for navigation; omit it for a button action. */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
260
|
+
declare function WidgetAction(props: WidgetActionProps): react.JSX.Element;
|
|
261
|
+
declare function WidgetRow({ className, type, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): react.JSX.Element;
|
|
262
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
80
263
|
label?: ReactNode;
|
|
81
264
|
helperText?: ReactNode;
|
|
82
265
|
error?: ReactNode;
|
|
83
266
|
containerClassName?: string;
|
|
84
267
|
}
|
|
85
268
|
/** Labelled text input with linked helper or error description. */
|
|
86
|
-
|
|
87
|
-
|
|
269
|
+
declare function TextField({ label, helperText, error, id, containerClassName, className, ...props }: TextFieldProps): react.JSX.Element;
|
|
270
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
88
271
|
label?: ReactNode;
|
|
89
272
|
helperText?: ReactNode;
|
|
90
273
|
error?: ReactNode;
|
|
91
274
|
containerClassName?: string;
|
|
92
275
|
}
|
|
93
276
|
/** Labelled multiline input with linked helper or error description. */
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
277
|
+
declare function Textarea({ label, helperText, error, id, containerClassName, className, ...props }: TextareaProps): react.JSX.Element;
|
|
278
|
+
type BadgeTone = 'success' | 'warning' | 'danger' | 'neutral';
|
|
279
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
97
280
|
tone?: BadgeTone;
|
|
98
281
|
}
|
|
99
282
|
/** Compact explicit status label. */
|
|
100
|
-
|
|
101
|
-
|
|
283
|
+
declare function Badge({ tone, className, ...props }: BadgeProps): react.JSX.Element;
|
|
284
|
+
interface SelectItem {
|
|
102
285
|
value: string;
|
|
103
286
|
label: ReactNode;
|
|
104
287
|
disabled?: boolean;
|
|
105
288
|
}
|
|
106
|
-
|
|
289
|
+
interface SelectProps {
|
|
107
290
|
options: readonly SelectItem[];
|
|
108
291
|
value?: string;
|
|
109
292
|
defaultValue?: string;
|
|
@@ -119,105 +302,135 @@ export interface SelectProps {
|
|
|
119
302
|
className?: string;
|
|
120
303
|
}
|
|
121
304
|
/** Controlled or uncontrolled Radix select. Use `options` for stable value/label pairs. */
|
|
122
|
-
|
|
123
|
-
|
|
305
|
+
declare function Select({ options, value, defaultValue, onValueChange, placeholder, label, error, disabled, name, id, ariaLabel, 'aria-describedby': ariaDescribedBy, className, }: SelectProps): react.JSX.Element;
|
|
306
|
+
interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'children'> {
|
|
124
307
|
label?: ReactNode;
|
|
125
308
|
description?: ReactNode;
|
|
126
309
|
}
|
|
127
310
|
/** Radix switch with optional visible label and description. */
|
|
128
|
-
|
|
129
|
-
|
|
311
|
+
declare function Switch({ label, description, className, id, ...props }: SwitchProps): react.JSX.Element;
|
|
312
|
+
interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'children'> {
|
|
130
313
|
label?: ReactNode;
|
|
131
314
|
description?: ReactNode;
|
|
132
315
|
}
|
|
133
316
|
/** Radix checkbox with optional visible label and description. */
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
317
|
+
declare function Checkbox({ label, description, className, id, ...props }: CheckboxProps): react.JSX.Element;
|
|
318
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsPrimitive.TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
319
|
+
declare function TabsList({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.List>): react.JSX.Element;
|
|
320
|
+
declare function TabsTrigger({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>): react.JSX.Element;
|
|
321
|
+
declare function TabsContent({ className, ...props }: ComponentPropsWithoutRef<typeof TabsPrimitive.Content>): react.JSX.Element;
|
|
322
|
+
declare const Dialog: react.FC<DialogPrimitive.DialogProps>;
|
|
323
|
+
declare const DialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
324
|
+
declare const DialogClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
325
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
326
|
+
declare const DialogDescription: typeof DialogPrimitive.Description;
|
|
327
|
+
/** auto: existing mobile entrance; bottom: enter/exit on all screens; none: static. */
|
|
328
|
+
type OverlayMotionVariant = 'auto' | 'bottom' | 'none';
|
|
329
|
+
interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
145
330
|
size?: 'sm' | 'md';
|
|
331
|
+
motionVariant?: OverlayMotionVariant;
|
|
146
332
|
}
|
|
147
333
|
/** Focus-managed modal content. Place title and description inside for accessible announcements. */
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
334
|
+
declare function DialogContent({ size, motionVariant, className, style, children, ...props }: DialogContentProps): react.JSX.Element;
|
|
335
|
+
declare const Sheet: react.FC<DialogPrimitive.DialogProps>;
|
|
336
|
+
declare const SheetTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
337
|
+
declare const SheetClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
338
|
+
declare const SheetTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
339
|
+
declare const SheetDescription: react.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
340
|
+
interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
155
341
|
side?: 'center' | 'right' | 'bottom';
|
|
342
|
+
motionVariant?: OverlayMotionVariant;
|
|
156
343
|
}
|
|
157
344
|
/** Focus-managed side or mobile-bottom sheet. */
|
|
158
|
-
|
|
159
|
-
|
|
345
|
+
declare function SheetContent({ side, motionVariant, className, style, children, ...props }: SheetContentProps): react.JSX.Element;
|
|
346
|
+
interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
160
347
|
width?: string | number;
|
|
161
348
|
height?: string | number;
|
|
162
349
|
circle?: boolean;
|
|
163
350
|
}
|
|
164
351
|
/** Decorative neutral loading placeholder. */
|
|
165
|
-
|
|
166
|
-
|
|
352
|
+
declare function Skeleton({ width, height, circle, className, style, ...props }: SkeletonProps): react.JSX.Element;
|
|
353
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
167
354
|
title: ReactNode;
|
|
168
355
|
description?: ReactNode;
|
|
169
356
|
action?: ReactNode;
|
|
170
357
|
icon?: ReactNode;
|
|
171
358
|
}
|
|
172
359
|
/** Centred zero-data state. */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
360
|
+
declare function EmptyState({ title, description, action, icon, className, ...props }: EmptyStateProps): react.JSX.Element;
|
|
361
|
+
type NoticeTone = 'info' | 'success' | 'warning' | 'danger';
|
|
362
|
+
interface NoticeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
176
363
|
tone?: NoticeTone;
|
|
177
364
|
title: ReactNode;
|
|
178
365
|
description?: ReactNode;
|
|
179
366
|
action?: ReactNode;
|
|
180
367
|
}
|
|
181
368
|
/** Inline contextual notice; use `danger` for blocking errors. */
|
|
182
|
-
|
|
183
|
-
|
|
369
|
+
declare function Notice({ tone, title, description, action, className, ...props }: NoticeProps): react.JSX.Element;
|
|
370
|
+
interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
184
371
|
gap?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
185
372
|
direction?: 'vertical' | 'horizontal';
|
|
186
373
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
187
374
|
justify?: 'start' | 'center' | 'end' | 'between';
|
|
188
375
|
}
|
|
189
376
|
/** Small flex layout primitive using Facto spacing tokens. */
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
377
|
+
declare function Stack({ gap, direction, align, justify, className, ...props }: StackProps): react.JSX.Element;
|
|
378
|
+
declare function TooltipProvider({ delayDuration, ...props }: ComponentPropsWithRef<typeof TooltipPrimitive.Provider>): react.JSX.Element;
|
|
379
|
+
declare const Tooltip: react.FC<TooltipPrimitive.TooltipProps>;
|
|
380
|
+
declare const TooltipTrigger: react.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
381
|
+
interface TooltipContentProps extends ComponentPropsWithRef<typeof TooltipPrimitive.Content> {
|
|
195
382
|
variant?: 'default' | 'content';
|
|
196
383
|
}
|
|
197
384
|
/** Supplemental plain text; interactive content belongs in a dialog or popover. */
|
|
198
|
-
|
|
385
|
+
declare function TooltipContent({ variant, className, style, sideOffset, collisionPadding, children, ...props }: TooltipContentProps): react.JSX.Element;
|
|
199
386
|
/** Dashboard notifications default to 2.6 seconds. */
|
|
200
|
-
|
|
201
|
-
|
|
387
|
+
declare function ToastProvider({ duration, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Provider>): react.JSX.Element;
|
|
388
|
+
interface ToastProps extends ComponentPropsWithRef<typeof ToastPrimitive.Root> {
|
|
389
|
+
icon?: ReactNode;
|
|
202
390
|
tone?: NoticeTone;
|
|
203
391
|
}
|
|
204
392
|
/** Controlled or uncontrolled notification. Render a ToastViewport inside the provider. */
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
393
|
+
declare function Toast({ tone, icon, className, style, children, ...props }: ToastProps): react.JSX.Element;
|
|
394
|
+
declare function ToastTitle({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Title>): react.JSX.Element;
|
|
395
|
+
declare function ToastDescription({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Description>): react.JSX.Element;
|
|
396
|
+
declare function ToastAction({ className, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Action>): react.JSX.Element;
|
|
397
|
+
declare function ToastClose({ className, children, 'aria-label': label, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Close>): react.JSX.Element;
|
|
398
|
+
declare function ToastViewport({ className, style, ...props }: ComponentPropsWithRef<typeof ToastPrimitive.Viewport>): react.ReactPortal | null;
|
|
399
|
+
interface EnhancedSearchFieldProps extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'type' | 'onChange'> {
|
|
212
400
|
value?: string;
|
|
213
401
|
defaultValue?: string;
|
|
214
402
|
onValueChange?: (value: string) => void;
|
|
215
403
|
clearLabel?: string;
|
|
216
404
|
}
|
|
217
405
|
/** Local input only; filtering and requests are owned by the consuming application. */
|
|
218
|
-
|
|
406
|
+
declare function EnhancedSearchField({ value, defaultValue, onValueChange, clearLabel, label, helperText, error, id, containerClassName, className, disabled, readOnly, ...props }: EnhancedSearchFieldProps): react.JSX.Element;
|
|
219
407
|
/** Dashboard list search: native input changes, no added icon or clear action. */
|
|
220
|
-
|
|
408
|
+
interface SearchFieldProps extends Omit<TextFieldProps, 'type'> {
|
|
409
|
+
}
|
|
410
|
+
declare function SearchField({ className, ...props }: SearchFieldProps): react.JSX.Element;
|
|
411
|
+
/** Non-modal contextual content with focus return and collision avoidance. */
|
|
412
|
+
declare const Popover: react.FC<PopoverPrimitive.PopoverProps>;
|
|
413
|
+
declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
414
|
+
declare const PopoverClose: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
415
|
+
declare function PopoverContent({ className, style, sideOffset, collisionPadding, ...props }: ComponentPropsWithRef<typeof PopoverPrimitive.Content>): react.JSX.Element;
|
|
416
|
+
/** Context menus are non-modal by default; keyboard focus still returns to the trigger. */
|
|
417
|
+
declare function DropdownMenu({ modal, ...props }: ComponentPropsWithRef<typeof MenuPrimitive.Root>): react.JSX.Element;
|
|
418
|
+
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
419
|
+
declare function DropdownMenuContent({ className, style, sideOffset, collisionPadding, ...props }: ComponentPropsWithRef<typeof MenuPrimitive.Content>): react.JSX.Element;
|
|
420
|
+
declare function DropdownMenuItem({ className, ...props }: ComponentPropsWithRef<typeof MenuPrimitive.Item>): react.JSX.Element;
|
|
421
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentPropsWithRef<typeof MenuPrimitive.Separator>): react.JSX.Element;
|
|
422
|
+
|
|
423
|
+
interface FilterChipProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
424
|
+
selected?: boolean;
|
|
425
|
+
}
|
|
426
|
+
/** Compact toggle for a caller-owned filter. */
|
|
427
|
+
declare function FilterChip({ selected, className, type, ...props }: FilterChipProps): react.JSX.Element;
|
|
428
|
+
interface ListSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
429
|
+
rows?: number;
|
|
430
|
+
label?: string;
|
|
221
431
|
}
|
|
222
|
-
|
|
223
|
-
|
|
432
|
+
/** Loading placeholder only: consumers own the query and loading state. */
|
|
433
|
+
declare function ListSkeleton({ rows, label, className, ...props }: ListSkeletonProps): react.JSX.Element;
|
|
434
|
+
|
|
435
|
+
export { Avatar, Badge, Button, Card, Checkbox, DashboardGrid, Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, EnhancedSearchField, ErrorState, FactoTheme, Field, FilterChip, Icon, IconButton, ListGroup, ListRow, ListSkeleton, LoadingMore, LogoStack, ModalFooter, ModalHeader, Notice, NotificationsProvider, OtpInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, ResendCodeButton, SearchField, Select, Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, Skeleton, Stack, StepChecklist, Surface, Switch, Tabs, TabsContent, TabsList, TabsTrigger, TextField, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Widget, WidgetAction, WidgetAmount, WidgetHeader, WidgetKeyValue, WidgetList, WidgetRow, useToast };
|
|
436
|
+
export type { AvatarProps, BadgeProps, BadgeTone, ButtonProps, ButtonSize, ButtonVariant, CheckboxProps, DialogContentProps, EmptyStateProps, EnhancedSearchFieldProps, ErrorStateProps, FactoThemeProps, FactoThemeTokens, FieldProps, FilterChipProps, IconButtonProps, IconName, IconProps, ListGroupProps, ListRowButtonProps, ListRowLinkProps, ListRowProps, ListRowSlots, ListRowStaticProps, ListSkeletonProps, LoadingMoreProps, LogoStackItem, LogoStackProps, NoticeProps, NoticeTone, NotificationsProviderProps, OtpInputProps, OverlayMotionVariant, ResendCodeButtonProps, SearchFieldProps, SelectItem, SelectProps, SheetContentProps, SkeletonProps, StackProps, StepChecklistItem, StepChecklistProps, StepChecklistState, SurfaceProps, SwitchProps, TextFieldProps, TextareaProps, ToastActionOptions, ToastApi, ToastId, ToastOptions, ToastPromiseMessages, ToastProps, ToastTone, ToastUpdate, TooltipContentProps, WidgetActionButtonProps, WidgetActionLinkProps, WidgetActionProps, WidgetHeaderProps, WidgetProps };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@facto-to/design-system",
|
|
4
|
-
"packageVersion": "0.1.0-beta.
|
|
4
|
+
"packageVersion": "0.1.0-beta.7",
|
|
5
5
|
"exports": [
|
|
6
|
+
"Avatar",
|
|
6
7
|
"Badge",
|
|
7
8
|
"Button",
|
|
8
9
|
"Card",
|
|
@@ -14,14 +15,34 @@
|
|
|
14
15
|
"DialogDescription",
|
|
15
16
|
"DialogTitle",
|
|
16
17
|
"DialogTrigger",
|
|
18
|
+
"DropdownMenu",
|
|
19
|
+
"DropdownMenuContent",
|
|
20
|
+
"DropdownMenuItem",
|
|
21
|
+
"DropdownMenuSeparator",
|
|
22
|
+
"DropdownMenuTrigger",
|
|
17
23
|
"EmptyState",
|
|
18
24
|
"EnhancedSearchField",
|
|
25
|
+
"ErrorState",
|
|
19
26
|
"FactoTheme",
|
|
27
|
+
"Field",
|
|
28
|
+
"FilterChip",
|
|
20
29
|
"Icon",
|
|
21
30
|
"IconButton",
|
|
31
|
+
"ListGroup",
|
|
32
|
+
"ListRow",
|
|
33
|
+
"ListSkeleton",
|
|
34
|
+
"LoadingMore",
|
|
35
|
+
"LogoStack",
|
|
22
36
|
"ModalFooter",
|
|
23
37
|
"ModalHeader",
|
|
24
38
|
"Notice",
|
|
39
|
+
"NotificationsProvider",
|
|
40
|
+
"OtpInput",
|
|
41
|
+
"Popover",
|
|
42
|
+
"PopoverClose",
|
|
43
|
+
"PopoverContent",
|
|
44
|
+
"PopoverTrigger",
|
|
45
|
+
"ResendCodeButton",
|
|
25
46
|
"SearchField",
|
|
26
47
|
"Select",
|
|
27
48
|
"Sheet",
|
|
@@ -32,6 +53,7 @@
|
|
|
32
53
|
"SheetTrigger",
|
|
33
54
|
"Skeleton",
|
|
34
55
|
"Stack",
|
|
56
|
+
"StepChecklist",
|
|
35
57
|
"Surface",
|
|
36
58
|
"Switch",
|
|
37
59
|
"Tabs",
|
|
@@ -57,7 +79,8 @@
|
|
|
57
79
|
"WidgetHeader",
|
|
58
80
|
"WidgetKeyValue",
|
|
59
81
|
"WidgetList",
|
|
60
|
-
"WidgetRow"
|
|
82
|
+
"WidgetRow",
|
|
83
|
+
"useToast"
|
|
61
84
|
],
|
|
62
85
|
"tokens": [
|
|
63
86
|
"--facto-accent",
|
|
@@ -131,6 +154,8 @@
|
|
|
131
154
|
"--facto-line-height-heading-sm",
|
|
132
155
|
"--facto-line-height-label",
|
|
133
156
|
"--facto-motion-overlay-backdrop-enter",
|
|
157
|
+
"--facto-motion-overlay-bottom-distance",
|
|
158
|
+
"--facto-motion-overlay-bottom-duration",
|
|
134
159
|
"--facto-motion-overlay-enter-easing",
|
|
135
160
|
"--facto-motion-overlay-mobile-enter",
|
|
136
161
|
"--facto-muted",
|