moxule-components 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +1167 -2
- package/dist/THIRD_PARTY_NOTICES.txt +2637 -0
- package/dist/index.cjs +5176 -0
- package/dist/index.css +4955 -0
- package/dist/index.d.cts +899 -0
- package/dist/index.d.ts +899 -0
- package/dist/index.js +5100 -0
- package/package.json +68 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,899 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, InputHTMLAttributes, ReactNode, CSSProperties, FieldsetHTMLAttributes, AnchorHTMLAttributes, ImgHTMLAttributes, ReactElement, ButtonHTMLAttributes, FormHTMLAttributes, AriaAttributes, TextareaHTMLAttributes, DialogHTMLAttributes, RefObject, SelectHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface DrawingPoint {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
interface DrawingStroke {
|
|
9
|
+
tool: 'pencil' | 'eraser';
|
|
10
|
+
color: string;
|
|
11
|
+
size: number;
|
|
12
|
+
points: readonly DrawingPoint[];
|
|
13
|
+
}
|
|
14
|
+
interface DrawingValue {
|
|
15
|
+
background: string;
|
|
16
|
+
strokes: readonly DrawingStroke[];
|
|
17
|
+
imageCleared?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface DrawingHandle {
|
|
20
|
+
toBlob: () => Promise<Blob>;
|
|
21
|
+
}
|
|
22
|
+
interface DrawingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange' | 'defaultValue'> {
|
|
23
|
+
value?: DrawingValue;
|
|
24
|
+
defaultValue?: DrawingValue;
|
|
25
|
+
onChange?: (value: DrawingValue) => void;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Existing bitmap to draw over; remote sources must permit canvas use. */
|
|
30
|
+
image?: string;
|
|
31
|
+
}
|
|
32
|
+
declare const Drawing: react.ForwardRefExoticComponent<DrawingProps & react.RefAttributes<DrawingHandle>>;
|
|
33
|
+
|
|
34
|
+
type InputDataType = "text" | "integer" | "decimal" | "currency";
|
|
35
|
+
|
|
36
|
+
interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "value" | "defaultValue" | "prefix"> {
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
description?: ReactNode;
|
|
39
|
+
error?: ReactNode;
|
|
40
|
+
reserveErrorSpace?: boolean;
|
|
41
|
+
value?: string | number | null;
|
|
42
|
+
defaultValue?: string | number | null;
|
|
43
|
+
dataType?: InputDataType;
|
|
44
|
+
currency?: string;
|
|
45
|
+
locale?: string;
|
|
46
|
+
fractionDigits?: number;
|
|
47
|
+
onValueChange?: (value: number | null) => void;
|
|
48
|
+
passwordToggle?: boolean;
|
|
49
|
+
clearable?: boolean;
|
|
50
|
+
search?: boolean;
|
|
51
|
+
prefix?: ReactNode;
|
|
52
|
+
suffix?: ReactNode;
|
|
53
|
+
stepper?: boolean;
|
|
54
|
+
sx?: CSSProperties;
|
|
55
|
+
class?: string;
|
|
56
|
+
}
|
|
57
|
+
declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
58
|
+
|
|
59
|
+
interface ColorPickerProps extends Omit<TextInputProps, "type" | "value" | "defaultValue" | "onChange" | "dataType" | "currency" | "locale" | "fractionDigits" | "onValueChange" | "passwordToggle" | "clearable" | "search" | "prefix" | "suffix" | "stepper"> {
|
|
60
|
+
value?: string;
|
|
61
|
+
defaultValue?: string;
|
|
62
|
+
/** Hex drafts may be incomplete; normalizeHexColor validates before application. */
|
|
63
|
+
onChange?: (value: string) => void;
|
|
64
|
+
pickerLabel?: string;
|
|
65
|
+
showHexInput?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
68
|
+
|
|
69
|
+
interface DateTimeProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
70
|
+
value: string | number | Date | null | undefined;
|
|
71
|
+
timeZone?: string;
|
|
72
|
+
locale?: string;
|
|
73
|
+
format?: "datetime" | "date" | "time";
|
|
74
|
+
hour12?: boolean;
|
|
75
|
+
showYear?: boolean;
|
|
76
|
+
showTimeZone?: boolean;
|
|
77
|
+
assumeUTC?: boolean;
|
|
78
|
+
fallback?: ReactNode;
|
|
79
|
+
sx?: CSSProperties;
|
|
80
|
+
class?: string;
|
|
81
|
+
}
|
|
82
|
+
declare const DateTime: react.ForwardRefExoticComponent<DateTimeProps & react.RefAttributes<HTMLElement>>;
|
|
83
|
+
|
|
84
|
+
type ThemeMode = "light" | "dark";
|
|
85
|
+
type ThemeName = "primary" | "secondary" | "tertiary" | "blue" | "red" | "green" | "purple" | "pink";
|
|
86
|
+
interface ThemeTokens {
|
|
87
|
+
surface: string;
|
|
88
|
+
overlayShadow: string;
|
|
89
|
+
pageShellBg: string;
|
|
90
|
+
controlBg: string;
|
|
91
|
+
controlBgHover: string;
|
|
92
|
+
controlText: string;
|
|
93
|
+
text: string;
|
|
94
|
+
border: string;
|
|
95
|
+
chromeBg: string;
|
|
96
|
+
chromeText: string;
|
|
97
|
+
fontDisplay: string;
|
|
98
|
+
fontBody: string;
|
|
99
|
+
fontDisplayLetterSpacing: string;
|
|
100
|
+
buttonPrimaryBg: string;
|
|
101
|
+
buttonPrimaryBgHover: string;
|
|
102
|
+
buttonPrimaryText: string;
|
|
103
|
+
buttonSecondaryBg: string;
|
|
104
|
+
buttonSecondaryBgHover: string;
|
|
105
|
+
buttonSecondaryText: string;
|
|
106
|
+
buttonGhostText: string;
|
|
107
|
+
buttonGhostBorder: string;
|
|
108
|
+
buttonGhostBgHover: string;
|
|
109
|
+
successBg: string;
|
|
110
|
+
successBgHover: string;
|
|
111
|
+
successText: string;
|
|
112
|
+
successBorder: string;
|
|
113
|
+
warningBg: string;
|
|
114
|
+
warningBgHover: string;
|
|
115
|
+
warningText: string;
|
|
116
|
+
warningBorder: string;
|
|
117
|
+
errorBg: string;
|
|
118
|
+
errorBgHover: string;
|
|
119
|
+
errorText: string;
|
|
120
|
+
errorBorder: string;
|
|
121
|
+
neutralBg: string;
|
|
122
|
+
neutralBgHover: string;
|
|
123
|
+
neutralText: string;
|
|
124
|
+
neutralBorder: string;
|
|
125
|
+
}
|
|
126
|
+
declare function normalizeHexColor(value: string): string | undefined;
|
|
127
|
+
/** Generate a complete palette from a base hex color, preserving semantic status colors. */
|
|
128
|
+
declare function deriveThemeFromColor(color: string, mode: ThemeMode): ThemeTokens;
|
|
129
|
+
|
|
130
|
+
interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children" | "color"> {
|
|
131
|
+
children: ReactNode;
|
|
132
|
+
/** A theme palette name or a three/six-digit hex color. */
|
|
133
|
+
color?: ThemeName | string;
|
|
134
|
+
sx?: CSSProperties;
|
|
135
|
+
class?: string;
|
|
136
|
+
}
|
|
137
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
138
|
+
|
|
139
|
+
interface CalendarEvent {
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
/** Local calendar date, YYYY-MM-DD. The app converts external time zones. */
|
|
143
|
+
date: string;
|
|
144
|
+
time?: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
color?: BadgeProps["color"];
|
|
147
|
+
}
|
|
148
|
+
interface CalendarDaySummary {
|
|
149
|
+
label: string;
|
|
150
|
+
compactLabel?: ReactNode;
|
|
151
|
+
preview?: ReactNode;
|
|
152
|
+
}
|
|
153
|
+
interface CalendarProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "onChange" | "defaultValue"> {
|
|
154
|
+
events?: readonly CalendarEvent[];
|
|
155
|
+
/** Optional per-date context, such as a note total, independent of event counts. */
|
|
156
|
+
daySummaries?: Readonly<Record<string, string | CalendarDaySummary>>;
|
|
157
|
+
value?: string;
|
|
158
|
+
defaultValue?: string;
|
|
159
|
+
onChange?: (date: string) => void;
|
|
160
|
+
month?: string;
|
|
161
|
+
defaultMonth?: string;
|
|
162
|
+
onMonthChange?: (month: string) => void;
|
|
163
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
164
|
+
locale?: string;
|
|
165
|
+
weekStartsOn?: 0 | 1;
|
|
166
|
+
/** Subtly distinguish Saturday and Sunday cells. Defaults to true. */
|
|
167
|
+
highlightWeekends?: boolean;
|
|
168
|
+
disabled?: boolean;
|
|
169
|
+
showAgenda?: boolean;
|
|
170
|
+
/** Additional accessible controls beside month navigation. */
|
|
171
|
+
toolbarActions?: ReactNode;
|
|
172
|
+
/** Optional content between the month toolbar and day grid. */
|
|
173
|
+
headerContent?: ReactNode;
|
|
174
|
+
sx?: CSSProperties;
|
|
175
|
+
class?: string;
|
|
176
|
+
}
|
|
177
|
+
declare const Calendar: react.ForwardRefExoticComponent<CalendarProps & react.RefAttributes<HTMLElement>>;
|
|
178
|
+
|
|
179
|
+
interface ChecklistItem {
|
|
180
|
+
id: string;
|
|
181
|
+
label: ReactNode;
|
|
182
|
+
disabled?: boolean;
|
|
183
|
+
}
|
|
184
|
+
interface ChecklistProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange" | "defaultValue"> {
|
|
185
|
+
legend: ReactNode;
|
|
186
|
+
items: readonly ChecklistItem[];
|
|
187
|
+
value?: readonly string[];
|
|
188
|
+
defaultValue?: readonly string[];
|
|
189
|
+
onChange?: (completed: string[]) => void;
|
|
190
|
+
showProgress?: boolean;
|
|
191
|
+
sx?: CSSProperties;
|
|
192
|
+
class?: string;
|
|
193
|
+
}
|
|
194
|
+
declare const Checklist: react.ForwardRefExoticComponent<ChecklistProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
195
|
+
|
|
196
|
+
interface LinkPreviewProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "title"> {
|
|
197
|
+
href: string;
|
|
198
|
+
title?: string;
|
|
199
|
+
description?: string;
|
|
200
|
+
siteName?: string;
|
|
201
|
+
imageSrc?: string;
|
|
202
|
+
imageAlt?: string;
|
|
203
|
+
sx?: CSSProperties;
|
|
204
|
+
class?: string;
|
|
205
|
+
}
|
|
206
|
+
declare const LinkPreview: react.ForwardRefExoticComponent<LinkPreviewProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
207
|
+
|
|
208
|
+
type SizeScale = "xs" | "sm" | "md" | "lg" | "xl";
|
|
209
|
+
|
|
210
|
+
interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children" | "color"> {
|
|
211
|
+
name?: string;
|
|
212
|
+
src?: string;
|
|
213
|
+
initials?: string;
|
|
214
|
+
icon?: ReactNode;
|
|
215
|
+
size?: SizeScale;
|
|
216
|
+
color?: ThemeName;
|
|
217
|
+
decorative?: boolean;
|
|
218
|
+
imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt" | "children">;
|
|
219
|
+
sx?: CSSProperties;
|
|
220
|
+
class?: string;
|
|
221
|
+
}
|
|
222
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
|
|
223
|
+
|
|
224
|
+
interface AvatarGroupItem extends Omit<AvatarProps, "id" | "size" | "decorative" | "name"> {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
}
|
|
228
|
+
interface AvatarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "color"> {
|
|
229
|
+
items: readonly AvatarGroupItem[];
|
|
230
|
+
size?: SizeScale;
|
|
231
|
+
color?: ThemeName;
|
|
232
|
+
/** Number of people shown before the additional +N control. */
|
|
233
|
+
max?: number;
|
|
234
|
+
overlap?: boolean;
|
|
235
|
+
overflowLabel?: string;
|
|
236
|
+
sx?: CSSProperties;
|
|
237
|
+
class?: string;
|
|
238
|
+
}
|
|
239
|
+
declare const AvatarGroup: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
240
|
+
|
|
241
|
+
interface TabItem {
|
|
242
|
+
id: string;
|
|
243
|
+
label: ReactNode;
|
|
244
|
+
content: ReactNode;
|
|
245
|
+
disabled?: boolean;
|
|
246
|
+
}
|
|
247
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
248
|
+
label: string;
|
|
249
|
+
items: readonly TabItem[];
|
|
250
|
+
value?: string;
|
|
251
|
+
defaultValue?: string;
|
|
252
|
+
onValueChange?: (value: string) => void;
|
|
253
|
+
activation?: "automatic" | "manual";
|
|
254
|
+
}
|
|
255
|
+
declare function Tabs({ label, items, value, defaultValue, onValueChange, activation, className, ...props }: TabsProps): react.JSX.Element;
|
|
256
|
+
|
|
257
|
+
interface LoadingIndicatorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
258
|
+
label?: string;
|
|
259
|
+
size?: "sm" | "md" | "lg";
|
|
260
|
+
}
|
|
261
|
+
declare function LoadingIndicator({ label, size, className, ...props }: LoadingIndicatorProps): react.JSX.Element;
|
|
262
|
+
|
|
263
|
+
interface AnchoredPanelProps {
|
|
264
|
+
/** A button component that forwards native button props. */
|
|
265
|
+
trigger: ReactElement;
|
|
266
|
+
children: ReactNode;
|
|
267
|
+
open?: boolean;
|
|
268
|
+
defaultOpen?: boolean;
|
|
269
|
+
onOpenChange?: (open: boolean) => void;
|
|
270
|
+
align?: "start" | "end";
|
|
271
|
+
tail?: boolean;
|
|
272
|
+
className?: string;
|
|
273
|
+
style?: CSSProperties;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface PopoverProps extends AnchoredPanelProps {
|
|
277
|
+
/** Accessible name for this nonmodal dialog. */
|
|
278
|
+
label: string;
|
|
279
|
+
}
|
|
280
|
+
declare function Popover(props: PopoverProps): react.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface AccordionItem {
|
|
283
|
+
id: string;
|
|
284
|
+
title: ReactNode;
|
|
285
|
+
content: ReactNode;
|
|
286
|
+
disabled?: boolean;
|
|
287
|
+
}
|
|
288
|
+
interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
289
|
+
items: readonly AccordionItem[];
|
|
290
|
+
value?: readonly string[];
|
|
291
|
+
defaultValue?: readonly string[];
|
|
292
|
+
onValueChange?: (value: string[]) => void;
|
|
293
|
+
multiple?: boolean;
|
|
294
|
+
/** Arrange the heading/trigger inside a surrounding toolbar or header. */
|
|
295
|
+
renderHeader?: (header: ReactNode, item: AccordionItem) => ReactNode;
|
|
296
|
+
/** Arrange or portal the accessible panel into a related layout slot. */
|
|
297
|
+
renderPanel?: (panel: ReactNode, item: AccordionItem) => ReactNode;
|
|
298
|
+
headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
299
|
+
}
|
|
300
|
+
declare function Accordion({ items, value, defaultValue, onValueChange, multiple, headingLevel: Heading, renderHeader, renderPanel, className, ...props }: AccordionProps): react.JSX.Element;
|
|
301
|
+
|
|
302
|
+
interface DropdownMenuItem {
|
|
303
|
+
id: string;
|
|
304
|
+
label: string;
|
|
305
|
+
disabled?: boolean;
|
|
306
|
+
onSelect?: () => void;
|
|
307
|
+
icon?: ReactNode;
|
|
308
|
+
separatorBefore?: boolean;
|
|
309
|
+
}
|
|
310
|
+
interface DropdownMenuProps extends Omit<AnchoredPanelProps, "children"> {
|
|
311
|
+
label: string;
|
|
312
|
+
items: readonly DropdownMenuItem[];
|
|
313
|
+
onSelect?: (id: string) => void;
|
|
314
|
+
}
|
|
315
|
+
declare function DropdownMenu({ items, onSelect, open: controlled, defaultOpen, onOpenChange, ...props }: DropdownMenuProps): react.JSX.Element;
|
|
316
|
+
|
|
317
|
+
type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
318
|
+
type ButtonSize = SizeScale;
|
|
319
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
320
|
+
children: ReactNode;
|
|
321
|
+
icon?: ReactNode;
|
|
322
|
+
iconPosition?: "start" | "end";
|
|
323
|
+
variant?: ButtonVariant;
|
|
324
|
+
size?: ButtonSize;
|
|
325
|
+
color?: ThemeName;
|
|
326
|
+
loading?: boolean;
|
|
327
|
+
loadingLabel?: ReactNode;
|
|
328
|
+
sx?: React.CSSProperties;
|
|
329
|
+
class?: string;
|
|
330
|
+
}
|
|
331
|
+
declare function Button({ children, icon, iconPosition, variant, size, color, disabled, loading, loadingLabel, sx, class: classProp, className, style, ...props }: ButtonProps): react.JSX.Element;
|
|
332
|
+
|
|
333
|
+
type UserMenuItem = DropdownMenuItem;
|
|
334
|
+
interface UserMenuProps extends Omit<DropdownMenuProps, "trigger" | "label"> {
|
|
335
|
+
label?: string;
|
|
336
|
+
/** Decorative icon, avatar image, or initials. Avoid interactive content. */
|
|
337
|
+
icon?: ReactNode;
|
|
338
|
+
avatar?: Omit<AvatarProps, "size" | "decorative">;
|
|
339
|
+
triggerProps?: Omit<ButtonProps, "children" | "icon" | "iconPosition" | "variant" | "aria-label">;
|
|
340
|
+
}
|
|
341
|
+
declare function UserMenu({ label, icon, avatar, triggerProps, align, className, ...props }: UserMenuProps): react.JSX.Element;
|
|
342
|
+
|
|
343
|
+
type FieldErrorDisplay = "inline" | "tooltip";
|
|
344
|
+
|
|
345
|
+
interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
346
|
+
children: ReactNode;
|
|
347
|
+
/** Tighter field spacing with no empty reserved error rows. */
|
|
348
|
+
compact?: boolean;
|
|
349
|
+
errorDisplay?: FieldErrorDisplay;
|
|
350
|
+
sx?: CSSProperties;
|
|
351
|
+
class?: string;
|
|
352
|
+
}
|
|
353
|
+
declare const Form: react.ForwardRefExoticComponent<FormProps & react.RefAttributes<HTMLFormElement>>;
|
|
354
|
+
|
|
355
|
+
interface FormGridProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
356
|
+
children: ReactNode;
|
|
357
|
+
columns?: 1 | 2 | 3;
|
|
358
|
+
legend?: ReactNode;
|
|
359
|
+
sx?: CSSProperties;
|
|
360
|
+
class?: string;
|
|
361
|
+
}
|
|
362
|
+
declare const FormGrid: react.ForwardRefExoticComponent<FormGridProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
363
|
+
|
|
364
|
+
interface FormFieldControlProps {
|
|
365
|
+
id: string;
|
|
366
|
+
required?: boolean;
|
|
367
|
+
"aria-describedby"?: string;
|
|
368
|
+
"aria-invalid"?: AriaAttributes["aria-invalid"];
|
|
369
|
+
}
|
|
370
|
+
interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
371
|
+
label?: ReactNode;
|
|
372
|
+
description?: ReactNode;
|
|
373
|
+
error?: ReactNode;
|
|
374
|
+
required?: boolean;
|
|
375
|
+
reserveErrorSpace?: boolean;
|
|
376
|
+
describedBy?: string;
|
|
377
|
+
invalid?: AriaAttributes["aria-invalid"];
|
|
378
|
+
errorDisplay?: FieldErrorDisplay;
|
|
379
|
+
children: (control: FormFieldControlProps) => ReactNode;
|
|
380
|
+
sx?: CSSProperties;
|
|
381
|
+
class?: string;
|
|
382
|
+
}
|
|
383
|
+
declare const FormField: react.ForwardRefExoticComponent<FormFieldProps & react.RefAttributes<HTMLDivElement>>;
|
|
384
|
+
|
|
385
|
+
interface ComboboxOption {
|
|
386
|
+
value: string;
|
|
387
|
+
label: string;
|
|
388
|
+
disabled?: boolean;
|
|
389
|
+
}
|
|
390
|
+
interface ComboboxBaseProps {
|
|
391
|
+
label: ReactNode;
|
|
392
|
+
options: readonly ComboboxOption[];
|
|
393
|
+
description?: ReactNode;
|
|
394
|
+
error?: ReactNode;
|
|
395
|
+
reserveErrorSpace?: boolean;
|
|
396
|
+
id?: string;
|
|
397
|
+
name?: string;
|
|
398
|
+
form?: string;
|
|
399
|
+
required?: boolean;
|
|
400
|
+
disabled?: boolean;
|
|
401
|
+
readOnly?: boolean;
|
|
402
|
+
placeholder?: string;
|
|
403
|
+
emptyMessage?: string;
|
|
404
|
+
className?: string;
|
|
405
|
+
class?: string;
|
|
406
|
+
style?: CSSProperties;
|
|
407
|
+
sx?: CSSProperties;
|
|
408
|
+
"aria-describedby"?: string;
|
|
409
|
+
}
|
|
410
|
+
type ComboboxProps = ComboboxBaseProps & ({
|
|
411
|
+
multiple?: false;
|
|
412
|
+
value?: string;
|
|
413
|
+
defaultValue?: string;
|
|
414
|
+
onChange?: (value: string) => void;
|
|
415
|
+
} | {
|
|
416
|
+
multiple: true;
|
|
417
|
+
value?: readonly string[];
|
|
418
|
+
defaultValue?: readonly string[];
|
|
419
|
+
onChange?: (value: string[]) => void;
|
|
420
|
+
});
|
|
421
|
+
declare const Combobox: react.ForwardRefExoticComponent<ComboboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
422
|
+
|
|
423
|
+
interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "children"> {
|
|
424
|
+
label: ReactNode;
|
|
425
|
+
description?: ReactNode;
|
|
426
|
+
error?: ReactNode;
|
|
427
|
+
reserveErrorSpace?: boolean;
|
|
428
|
+
value?: number;
|
|
429
|
+
defaultValue?: number;
|
|
430
|
+
onChange?: (value: number) => void;
|
|
431
|
+
formatValue?: (value: number) => string;
|
|
432
|
+
fillColor?: string;
|
|
433
|
+
trackColor?: string;
|
|
434
|
+
thumbColor?: string;
|
|
435
|
+
sx?: CSSProperties;
|
|
436
|
+
class?: string;
|
|
437
|
+
}
|
|
438
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
|
|
439
|
+
|
|
440
|
+
interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "children"> {
|
|
441
|
+
label: ReactNode;
|
|
442
|
+
description?: ReactNode;
|
|
443
|
+
error?: ReactNode;
|
|
444
|
+
reserveErrorSpace?: boolean;
|
|
445
|
+
sx?: CSSProperties;
|
|
446
|
+
class?: string;
|
|
447
|
+
}
|
|
448
|
+
declare const TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
449
|
+
|
|
450
|
+
interface FileRejection {
|
|
451
|
+
file: File;
|
|
452
|
+
message: string;
|
|
453
|
+
}
|
|
454
|
+
interface FileUploadProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "children"> {
|
|
455
|
+
label: ReactNode;
|
|
456
|
+
description?: ReactNode;
|
|
457
|
+
error?: ReactNode;
|
|
458
|
+
reserveErrorSpace?: boolean;
|
|
459
|
+
onFilesChange?: (files: File[]) => void;
|
|
460
|
+
showFileList?: boolean;
|
|
461
|
+
maxFiles?: number;
|
|
462
|
+
maxFileSize?: number;
|
|
463
|
+
validateFile?: (file: File) => string | undefined;
|
|
464
|
+
onFilesReject?: (rejections: FileRejection[]) => void;
|
|
465
|
+
progress?: number;
|
|
466
|
+
sx?: CSSProperties;
|
|
467
|
+
class?: string;
|
|
468
|
+
}
|
|
469
|
+
declare const FileUpload: react.ForwardRefExoticComponent<FileUploadProps & react.RefAttributes<HTMLInputElement>>;
|
|
470
|
+
|
|
471
|
+
interface SitemapItem {
|
|
472
|
+
label: ReactNode;
|
|
473
|
+
href: string;
|
|
474
|
+
children?: readonly SitemapItem[];
|
|
475
|
+
}
|
|
476
|
+
interface SitemapProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
477
|
+
items: readonly SitemapItem[];
|
|
478
|
+
currentPath?: string;
|
|
479
|
+
renderLink?: (item: SitemapItem) => ReactElement;
|
|
480
|
+
sx?: CSSProperties;
|
|
481
|
+
class?: string;
|
|
482
|
+
}
|
|
483
|
+
declare const Sitemap: react.ForwardRefExoticComponent<SitemapProps & react.RefAttributes<HTMLElement>>;
|
|
484
|
+
|
|
485
|
+
interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children" | "content"> {
|
|
486
|
+
children: ReactElement;
|
|
487
|
+
content: ReactNode;
|
|
488
|
+
side?: "top" | "bottom";
|
|
489
|
+
delay?: number;
|
|
490
|
+
disabled?: boolean;
|
|
491
|
+
sx?: CSSProperties;
|
|
492
|
+
class?: string;
|
|
493
|
+
}
|
|
494
|
+
declare function Tooltip({ children, content, side, delay, disabled, sx, class: classProp, className, style, onMouseEnter, onMouseLeave, onFocusCapture, onBlurCapture, ...props }: TooltipProps): react.JSX.Element;
|
|
495
|
+
|
|
496
|
+
interface MarkdownImageProps {
|
|
497
|
+
src?: string;
|
|
498
|
+
alt?: string;
|
|
499
|
+
title?: string;
|
|
500
|
+
}
|
|
501
|
+
type ImageRenderer = (props: MarkdownImageProps) => ReactNode;
|
|
502
|
+
/** Supply authenticated or application-specific image rendering, including editor previews. */
|
|
503
|
+
declare function MarkdownImageProvider({ renderImage, children }: {
|
|
504
|
+
renderImage: ImageRenderer;
|
|
505
|
+
children: ReactNode;
|
|
506
|
+
}): react.JSX.Element;
|
|
507
|
+
interface MarkdownProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
508
|
+
children: string;
|
|
509
|
+
preserveLineBreaks?: boolean;
|
|
510
|
+
sx?: CSSProperties;
|
|
511
|
+
class?: string;
|
|
512
|
+
}
|
|
513
|
+
declare function Markdown({ children, preserveLineBreaks, sx, class: classProp, className, style, ...props }: MarkdownProps): react.JSX.Element;
|
|
514
|
+
|
|
515
|
+
interface MarkdownEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "defaultValue"> {
|
|
516
|
+
value?: string;
|
|
517
|
+
defaultValue?: string;
|
|
518
|
+
onChange?: (markdown: string) => void;
|
|
519
|
+
textAlign?: "left" | "center";
|
|
520
|
+
onTextAlignChange?: (alignment: "left" | "center") => void;
|
|
521
|
+
onSave?: (markdown: string) => void | Promise<void>;
|
|
522
|
+
label?: ReactNode;
|
|
523
|
+
description?: ReactNode;
|
|
524
|
+
name?: string;
|
|
525
|
+
placeholder?: string;
|
|
526
|
+
rows?: number;
|
|
527
|
+
disabled?: boolean;
|
|
528
|
+
readOnly?: boolean;
|
|
529
|
+
compact?: boolean;
|
|
530
|
+
textareaFirst?: boolean;
|
|
531
|
+
showStatus?: boolean;
|
|
532
|
+
showHint?: boolean;
|
|
533
|
+
saveLabel?: string;
|
|
534
|
+
downloadFileName?: string | false;
|
|
535
|
+
textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange" | "children" | "disabled" | "readOnly" | "name" | "rows" | "placeholder">;
|
|
536
|
+
sx?: CSSProperties;
|
|
537
|
+
class?: string;
|
|
538
|
+
}
|
|
539
|
+
declare function MarkdownEditor({ value, defaultValue, onChange, onSave, textAlign, onTextAlignChange, label, description, name, placeholder, rows, disabled, readOnly, compact, textareaFirst, showStatus, showHint, saveLabel, downloadFileName, textareaProps, sx, class: classProp, className, style, ...props }: MarkdownEditorProps): react.JSX.Element;
|
|
540
|
+
|
|
541
|
+
interface DialogSurfaceProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "open" | "title" | "children"> {
|
|
542
|
+
presentation: "drawer" | "modal";
|
|
543
|
+
open: boolean;
|
|
544
|
+
onOpenChange: (open: boolean) => void;
|
|
545
|
+
title: ReactNode;
|
|
546
|
+
description?: ReactNode;
|
|
547
|
+
children: ReactNode;
|
|
548
|
+
side?: "left" | "right";
|
|
549
|
+
footer?: ReactNode;
|
|
550
|
+
closeLabel?: string;
|
|
551
|
+
closeOnBackdrop?: boolean;
|
|
552
|
+
closeOnEscape?: boolean;
|
|
553
|
+
initialFocusRef?: RefObject<HTMLElement>;
|
|
554
|
+
onDismiss?: () => void;
|
|
555
|
+
sx?: CSSProperties;
|
|
556
|
+
class?: string;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
type ModalSize = "sm" | "md" | "lg";
|
|
560
|
+
interface ModalProps extends Omit<DialogSurfaceProps, "presentation" | "side"> {
|
|
561
|
+
size?: ModalSize;
|
|
562
|
+
}
|
|
563
|
+
declare function Modal({ size, ...props }: ModalProps): react.JSX.Element;
|
|
564
|
+
|
|
565
|
+
type DrawerSide = "left" | "right";
|
|
566
|
+
interface DrawerProps extends Omit<DialogSurfaceProps, "presentation" | "side"> {
|
|
567
|
+
side?: DrawerSide;
|
|
568
|
+
}
|
|
569
|
+
declare function Drawer(props: DrawerProps): react.JSX.Element;
|
|
570
|
+
|
|
571
|
+
interface MenuButtonProps extends Omit<ButtonProps, "children"> {
|
|
572
|
+
open?: boolean;
|
|
573
|
+
}
|
|
574
|
+
declare function MenuButton({ open, className, "aria-label": ariaLabel, ...props }: MenuButtonProps): react.JSX.Element;
|
|
575
|
+
|
|
576
|
+
type BannerVariant = "success" | "warning" | "error" | "neutral";
|
|
577
|
+
interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "color"> {
|
|
578
|
+
message: ReactNode;
|
|
579
|
+
variant?: BannerVariant;
|
|
580
|
+
color?: string;
|
|
581
|
+
dismissible?: boolean;
|
|
582
|
+
onDismiss?: () => void;
|
|
583
|
+
closeLabel?: string;
|
|
584
|
+
sx?: CSSProperties;
|
|
585
|
+
class?: string;
|
|
586
|
+
}
|
|
587
|
+
declare const Banner: react.ForwardRefExoticComponent<BannerProps & react.RefAttributes<HTMLDivElement>>;
|
|
588
|
+
|
|
589
|
+
interface NudgeProps extends Omit<BannerProps, "dismissible"> {
|
|
590
|
+
/** Milliseconds before dismissal; 0 keeps the nudge until closed. */
|
|
591
|
+
duration?: number;
|
|
592
|
+
open?: boolean;
|
|
593
|
+
}
|
|
594
|
+
declare function Nudge({ message, variant, color, duration, open, onDismiss, closeLabel, role, class: classProp, className, sx, style, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: NudgeProps): react.JSX.Element | null;
|
|
595
|
+
|
|
596
|
+
type NudgePosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
597
|
+
type NudgeOptions = Pick<NudgeProps, "message" | "variant" | "color" | "duration" | "closeLabel" | "onDismiss">;
|
|
598
|
+
interface NudgeProviderProps {
|
|
599
|
+
children: ReactNode;
|
|
600
|
+
position?: NudgePosition;
|
|
601
|
+
duration?: number;
|
|
602
|
+
label?: string;
|
|
603
|
+
}
|
|
604
|
+
interface NudgeContextValue {
|
|
605
|
+
nudge: (options: NudgeOptions | string) => string;
|
|
606
|
+
dismiss: (id: string) => void;
|
|
607
|
+
dismissAll: () => void;
|
|
608
|
+
}
|
|
609
|
+
declare function NudgeProvider({ children, position, duration, label }: NudgeProviderProps): react.JSX.Element;
|
|
610
|
+
declare function useNudges(): NudgeContextValue;
|
|
611
|
+
|
|
612
|
+
interface BreadcrumbItem {
|
|
613
|
+
label: ReactNode;
|
|
614
|
+
href?: string;
|
|
615
|
+
}
|
|
616
|
+
interface BreadcrumbsProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
617
|
+
items: readonly BreadcrumbItem[];
|
|
618
|
+
separator?: ReactNode;
|
|
619
|
+
renderLink?: (item: BreadcrumbItem, index: number) => ReactElement;
|
|
620
|
+
sx?: CSSProperties;
|
|
621
|
+
class?: string;
|
|
622
|
+
}
|
|
623
|
+
declare const Breadcrumbs: react.ForwardRefExoticComponent<BreadcrumbsProps & react.RefAttributes<HTMLElement>>;
|
|
624
|
+
|
|
625
|
+
interface LinkBaseProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "color"> {
|
|
626
|
+
color?: ThemeName | "inherit";
|
|
627
|
+
underline?: "hover" | "always";
|
|
628
|
+
sx?: CSSProperties;
|
|
629
|
+
class?: string;
|
|
630
|
+
}
|
|
631
|
+
type LinkProps = LinkBaseProps & ({
|
|
632
|
+
asChild?: false;
|
|
633
|
+
children: ReactNode;
|
|
634
|
+
} | {
|
|
635
|
+
asChild: true;
|
|
636
|
+
children: ReactElement;
|
|
637
|
+
});
|
|
638
|
+
declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
639
|
+
|
|
640
|
+
type CardAppearance = "solid" | "outline" | "none";
|
|
641
|
+
interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
642
|
+
children: ReactNode;
|
|
643
|
+
color?: ThemeName;
|
|
644
|
+
appearance?: CardAppearance;
|
|
645
|
+
gap?: number;
|
|
646
|
+
freestyle?: boolean;
|
|
647
|
+
/** Optional border colors, blended diagonally when more than one is supplied. */
|
|
648
|
+
borderColors?: readonly string[];
|
|
649
|
+
sx?: React.CSSProperties;
|
|
650
|
+
class?: string;
|
|
651
|
+
}
|
|
652
|
+
declare function Card({ children, color, appearance, gap, freestyle, borderColors, sx, class: classProp, className, style, ...props }: CardProps): react.JSX.Element;
|
|
653
|
+
|
|
654
|
+
interface ChoiceControlProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "children" | "size"> {
|
|
655
|
+
label: ReactNode;
|
|
656
|
+
sx?: CSSProperties;
|
|
657
|
+
class?: string;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
interface CheckboxProps extends ChoiceControlProps {
|
|
661
|
+
}
|
|
662
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
663
|
+
|
|
664
|
+
interface CheckboxOption {
|
|
665
|
+
label: ReactNode;
|
|
666
|
+
value: string;
|
|
667
|
+
disabled?: boolean;
|
|
668
|
+
required?: boolean;
|
|
669
|
+
}
|
|
670
|
+
interface CheckboxGroupProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange" | "defaultValue"> {
|
|
671
|
+
legend: ReactNode;
|
|
672
|
+
options: readonly CheckboxOption[];
|
|
673
|
+
description?: ReactNode;
|
|
674
|
+
error?: ReactNode;
|
|
675
|
+
reserveErrorSpace?: boolean;
|
|
676
|
+
value?: readonly string[];
|
|
677
|
+
defaultValue?: readonly string[];
|
|
678
|
+
onChange?: (value: string[]) => void;
|
|
679
|
+
sx?: CSSProperties;
|
|
680
|
+
class?: string;
|
|
681
|
+
}
|
|
682
|
+
declare const CheckboxGroup: react.ForwardRefExoticComponent<CheckboxGroupProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
683
|
+
|
|
684
|
+
interface RadioProps extends ChoiceControlProps {
|
|
685
|
+
}
|
|
686
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
687
|
+
|
|
688
|
+
interface RadioOption {
|
|
689
|
+
label: ReactNode;
|
|
690
|
+
value: string;
|
|
691
|
+
disabled?: boolean;
|
|
692
|
+
}
|
|
693
|
+
interface RadioGroupProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange" | "defaultValue"> {
|
|
694
|
+
legend: ReactNode;
|
|
695
|
+
options: readonly RadioOption[];
|
|
696
|
+
description?: ReactNode;
|
|
697
|
+
error?: ReactNode;
|
|
698
|
+
reserveErrorSpace?: boolean;
|
|
699
|
+
value?: string;
|
|
700
|
+
defaultValue?: string;
|
|
701
|
+
onChange?: (value: string) => void;
|
|
702
|
+
required?: boolean;
|
|
703
|
+
sx?: CSSProperties;
|
|
704
|
+
class?: string;
|
|
705
|
+
}
|
|
706
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
707
|
+
|
|
708
|
+
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
709
|
+
sx?: CSSProperties;
|
|
710
|
+
class?: string;
|
|
711
|
+
}
|
|
712
|
+
declare function Image(props: ImageProps): react.JSX.Element;
|
|
713
|
+
|
|
714
|
+
interface DropdownOption {
|
|
715
|
+
label: string;
|
|
716
|
+
value: string;
|
|
717
|
+
disabled?: boolean;
|
|
718
|
+
}
|
|
719
|
+
interface DropdownProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "children" | "onChange"> {
|
|
720
|
+
options: DropdownOption[];
|
|
721
|
+
value: string;
|
|
722
|
+
onChange: (value: string) => void;
|
|
723
|
+
label?: ReactNode;
|
|
724
|
+
description?: ReactNode;
|
|
725
|
+
error?: ReactNode;
|
|
726
|
+
reserveErrorSpace?: boolean;
|
|
727
|
+
sx?: CSSProperties;
|
|
728
|
+
class?: string;
|
|
729
|
+
}
|
|
730
|
+
declare const Dropdown: react.ForwardRefExoticComponent<DropdownProps & react.RefAttributes<HTMLSelectElement>>;
|
|
731
|
+
|
|
732
|
+
interface LayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
733
|
+
children: ReactNode;
|
|
734
|
+
margin?: SizeScale;
|
|
735
|
+
contentWidth?: SizeScale;
|
|
736
|
+
sx?: React.CSSProperties;
|
|
737
|
+
class?: string;
|
|
738
|
+
}
|
|
739
|
+
declare function Layout({ children, margin, contentWidth, sx, class: classProp, className, style, ...props }: LayoutProps): react.JSX.Element;
|
|
740
|
+
|
|
741
|
+
type HeaderVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
742
|
+
interface HeaderProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
743
|
+
children: ReactNode;
|
|
744
|
+
variant?: HeaderVariant;
|
|
745
|
+
theme?: ThemeName;
|
|
746
|
+
color?: ThemeName | string;
|
|
747
|
+
sx?: CSSProperties;
|
|
748
|
+
class?: string;
|
|
749
|
+
}
|
|
750
|
+
declare function Header({ children, variant, theme, color, sx, class: classProp, className, style, ...props }: HeaderProps): react.JSX.Element;
|
|
751
|
+
|
|
752
|
+
type TextAs = "p" | "span" | "div";
|
|
753
|
+
type TextVariant = "sm" | "md" | "lg";
|
|
754
|
+
interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
755
|
+
children: ReactNode;
|
|
756
|
+
as?: TextAs;
|
|
757
|
+
variant?: TextVariant;
|
|
758
|
+
theme?: ThemeName;
|
|
759
|
+
color?: ThemeName | string;
|
|
760
|
+
i?: boolean;
|
|
761
|
+
b?: boolean;
|
|
762
|
+
u?: boolean;
|
|
763
|
+
sx?: CSSProperties;
|
|
764
|
+
class?: string;
|
|
765
|
+
}
|
|
766
|
+
declare function Text({ children, as, variant, theme, color, i, b, u, sx, class: classProp, className, style, ...props }: TextProps): react.JSX.Element;
|
|
767
|
+
|
|
768
|
+
interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
769
|
+
title?: ReactNode;
|
|
770
|
+
description?: ReactNode;
|
|
771
|
+
headingLevel?: HeaderVariant;
|
|
772
|
+
headingProps?: Omit<HeaderProps, "children" | "variant">;
|
|
773
|
+
descriptionProps?: Omit<TextProps, "children">;
|
|
774
|
+
children?: ReactNode;
|
|
775
|
+
sx?: CSSProperties;
|
|
776
|
+
class?: string;
|
|
777
|
+
}
|
|
778
|
+
declare const Section: react.ForwardRefExoticComponent<SectionProps & react.RefAttributes<HTMLElement>>;
|
|
779
|
+
|
|
780
|
+
interface PageShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
781
|
+
children: ReactNode;
|
|
782
|
+
footerOffset?: SizeScale;
|
|
783
|
+
fullHeight?: boolean;
|
|
784
|
+
sx?: React.CSSProperties;
|
|
785
|
+
class?: string;
|
|
786
|
+
}
|
|
787
|
+
declare function PageShell({ children, footerOffset, fullHeight, sx, class: classProp, className, style, ...props }: PageShellProps): react.JSX.Element;
|
|
788
|
+
|
|
789
|
+
interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "children"> {
|
|
790
|
+
checked?: boolean;
|
|
791
|
+
defaultChecked?: boolean;
|
|
792
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
793
|
+
required?: boolean;
|
|
794
|
+
description?: ReactNode;
|
|
795
|
+
error?: ReactNode;
|
|
796
|
+
reserveErrorSpace?: boolean;
|
|
797
|
+
ariaLabel?: string;
|
|
798
|
+
label?: ReactNode;
|
|
799
|
+
labelPosition?: "left" | "right";
|
|
800
|
+
thumbOnIcon?: ReactNode;
|
|
801
|
+
thumbOffIcon?: ReactNode;
|
|
802
|
+
sx?: React.CSSProperties;
|
|
803
|
+
class?: string;
|
|
804
|
+
}
|
|
805
|
+
declare function Toggle({ checked: controlled, defaultChecked, required, description, error, reserveErrorSpace, onCheckedChange, ariaLabel, label, labelPosition, thumbOnIcon, thumbOffIcon, sx, class: classProp, className, style, disabled, id, onClick, name, value, form, "aria-describedby": describedBy, ...props }: ToggleProps): react.JSX.Element;
|
|
806
|
+
|
|
807
|
+
interface ThemeToggleProps extends Omit<ToggleProps, "checked" | "onCheckedChange" | "thumbOnIcon" | "thumbOffIcon"> {
|
|
808
|
+
mode?: ThemeMode;
|
|
809
|
+
onModeChange: (mode: ThemeMode) => void;
|
|
810
|
+
}
|
|
811
|
+
declare function ThemeToggle({ mode, onModeChange, ariaLabel, label, className, ...props }: ThemeToggleProps): react.JSX.Element;
|
|
812
|
+
|
|
813
|
+
type FooterLayout = "centered" | "split";
|
|
814
|
+
type FooterPosition = "static" | "natural";
|
|
815
|
+
interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
816
|
+
children?: ReactNode;
|
|
817
|
+
layout?: FooterLayout;
|
|
818
|
+
position?: FooterPosition;
|
|
819
|
+
sx?: React.CSSProperties;
|
|
820
|
+
class?: string;
|
|
821
|
+
}
|
|
822
|
+
declare function Footer({ children, layout, position, sx, class: classProp, className, style, ...props }: FooterProps): react.JSX.Element;
|
|
823
|
+
|
|
824
|
+
type NavbarPosition = "sticky" | "static";
|
|
825
|
+
interface NavbarProps extends HTMLAttributes<HTMLElement> {
|
|
826
|
+
left?: ReactNode;
|
|
827
|
+
right?: ReactNode;
|
|
828
|
+
logo?: ReactNode;
|
|
829
|
+
children?: ReactNode;
|
|
830
|
+
position?: NavbarPosition;
|
|
831
|
+
sx?: React.CSSProperties;
|
|
832
|
+
class?: string;
|
|
833
|
+
}
|
|
834
|
+
declare function Navbar({ left, right, logo, children, position, sx, class: classProp, className, style, ...props }: NavbarProps): react.JSX.Element;
|
|
835
|
+
|
|
836
|
+
interface AccentTokens {
|
|
837
|
+
text: string;
|
|
838
|
+
chromeText: string;
|
|
839
|
+
color: string;
|
|
840
|
+
softBg: string;
|
|
841
|
+
softText: string;
|
|
842
|
+
thumb: string;
|
|
843
|
+
thumbText: string;
|
|
844
|
+
checkedThumb: string;
|
|
845
|
+
checkedThumbText: string;
|
|
846
|
+
sunThumb: string;
|
|
847
|
+
sunThumbText: string;
|
|
848
|
+
moonThumb: string;
|
|
849
|
+
moonThumbText: string;
|
|
850
|
+
}
|
|
851
|
+
/** Retains the accent hue, adjusting shades only as necessary for contrast. */
|
|
852
|
+
declare function deriveAccentTokens(palette: ThemeTokens, components: ThemeTokens, mode: ThemeMode): AccentTokens;
|
|
853
|
+
|
|
854
|
+
declare const fontStyleNames: readonly ["clear", "playful", "stark", "bizarre"];
|
|
855
|
+
type FontStyleName = typeof fontStyleNames[number];
|
|
856
|
+
|
|
857
|
+
interface ThemeContextValue {
|
|
858
|
+
mode: ThemeMode;
|
|
859
|
+
theme: ThemeName;
|
|
860
|
+
tokens: ThemeTokens;
|
|
861
|
+
accents: AccentTokens;
|
|
862
|
+
}
|
|
863
|
+
interface ThemeProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
864
|
+
children: ReactNode;
|
|
865
|
+
mode?: ThemeMode;
|
|
866
|
+
theme?: ThemeName;
|
|
867
|
+
fontStyle?: FontStyleName;
|
|
868
|
+
customTokens?: Partial<ThemeTokens>;
|
|
869
|
+
primaryColor?: string;
|
|
870
|
+
/** Optional independent palette for the page backdrop, navbar and footer. */
|
|
871
|
+
backdropTheme?: ThemeName;
|
|
872
|
+
backdropColor?: string;
|
|
873
|
+
accentTheme?: ThemeName;
|
|
874
|
+
accentColor?: string;
|
|
875
|
+
}
|
|
876
|
+
declare function ThemeProvider({ children, mode, theme, fontStyle, customTokens, primaryColor, backdropTheme, backdropColor, accentTheme, accentColor, style, className, ...props }: ThemeProviderProps): react.JSX.Element;
|
|
877
|
+
declare function useTheme(): ThemeContextValue;
|
|
878
|
+
|
|
879
|
+
interface SpacerProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
880
|
+
/** Multiples of --mx-space-unit. Defaults to 1 for a vertical spacer. */
|
|
881
|
+
height?: number;
|
|
882
|
+
/** Multiples of --mx-space-unit. Setting width alone creates a horizontal spacer. */
|
|
883
|
+
width?: number;
|
|
884
|
+
/** Draw a thin divider through the center of the space. */
|
|
885
|
+
line?: boolean;
|
|
886
|
+
/** Optional CSS color override for the divider. */
|
|
887
|
+
lineColor?: string;
|
|
888
|
+
sx?: CSSProperties;
|
|
889
|
+
class?: string;
|
|
890
|
+
}
|
|
891
|
+
declare const Spacer: react.ForwardRefExoticComponent<SpacerProps & react.RefAttributes<HTMLSpanElement>>;
|
|
892
|
+
|
|
893
|
+
interface FieldErrorProps extends HTMLAttributes<HTMLDivElement> {
|
|
894
|
+
children: ReactNode;
|
|
895
|
+
}
|
|
896
|
+
/** Associate with a field using its aria-describedby. Prefer the field's error prop when available. */
|
|
897
|
+
declare function FieldError({ children, className, ...props }: FieldErrorProps): react.JSX.Element;
|
|
898
|
+
|
|
899
|
+
export { type AccentTokens, Accordion, type AccordionItem, type AccordionProps, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerVariant, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarDaySummary, type CalendarEvent, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, Checklist, type ChecklistItem, type ChecklistProps, ColorPicker, type ColorPickerProps, Combobox, type ComboboxOption, type ComboboxProps, DateTime, type DateTimeProps, Drawer, type DrawerProps, type DrawerSide, Drawing, type DrawingHandle, type DrawingPoint, type DrawingProps, type DrawingStroke, type DrawingValue, Dropdown, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, type DropdownOption, type DropdownProps, FieldError, type FieldErrorDisplay, type FieldErrorProps, type FileRejection, FileUpload, type FileUploadProps, type FontStyleName, Footer, type FooterLayout, type FooterPosition, type FooterProps, Form, FormField, type FormFieldControlProps, type FormFieldProps, FormGrid, type FormGridProps, type FormProps, Header, type HeaderProps, type HeaderVariant, Image, type ImageProps, type InputDataType, Layout, type LayoutProps, Link, LinkPreview, type LinkPreviewProps, type LinkProps, LoadingIndicator, type LoadingIndicatorProps, Markdown, MarkdownEditor, type MarkdownEditorProps, type MarkdownImageProps, MarkdownImageProvider, type MarkdownProps, MenuButton, type MenuButtonProps, Modal, type ModalProps, type ModalSize, Navbar, type NavbarPosition, type NavbarProps, Nudge, type NudgeOptions, type NudgePosition, type NudgeProps, NudgeProvider, type NudgeProviderProps, PageShell, type PageShellProps, Popover, type PopoverProps, Radio, RadioGroup, type RadioGroupProps, type RadioOption, type RadioProps, Section, type SectionProps, Sitemap, type SitemapItem, type SitemapProps, type SizeScale, Slider, type SliderProps, Spacer, type SpacerProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextAs, TextInput, type TextInputProps, type TextProps, type TextVariant, type ThemeMode, type ThemeName, ThemeProvider, type ThemeProviderProps, ThemeToggle, type ThemeToggleProps, type ThemeTokens, Toggle, type ToggleProps, Tooltip, type TooltipProps, UserMenu, type UserMenuItem, type UserMenuProps, deriveAccentTokens, deriveThemeFromColor, normalizeHexColor, useNudges, useTheme };
|