@jirawatpyk/aura-react 5.7.3 → 5.9.0
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/README.md +40 -0
- package/dist/aura.bundle.js +1751 -1208
- package/dist/cjs/index.cjs +1751 -1208
- package/dist/esm/Accordion.js +2 -1
- package/dist/esm/Alert.js +7 -19
- package/dist/esm/AppShell.js +2 -1
- package/dist/esm/Badge.js +2 -19
- package/dist/esm/Breadcrumb.js +2 -1
- package/dist/esm/Button.js +17 -17
- package/dist/esm/Card.js +2 -19
- package/dist/esm/Checkbox.js +2 -1
- package/dist/esm/Combobox.js +7 -6
- package/dist/esm/Command.js +3 -2
- package/dist/esm/DataTable.js +35 -13
- package/dist/esm/DatePicker.js +8 -7
- package/dist/esm/Dialog.js +38 -5
- package/dist/esm/EmptyState.js +2 -15
- package/dist/esm/Field.js +2 -1
- package/dist/esm/FileUpload.js +4 -3
- package/dist/esm/FilterBar.js +3 -2
- package/dist/esm/FormErrorSummary.js +2 -1
- package/dist/esm/Icon.js +50 -31
- package/dist/esm/Menu.js +2 -1
- package/dist/esm/NumberField.js +3 -2
- package/dist/esm/Pagination.js +3 -2
- package/dist/esm/PasswordField.js +2 -1
- package/dist/esm/Popover.js +2 -1
- package/dist/esm/RadioGroup.js +2 -1
- package/dist/esm/Select.js +4 -3
- package/dist/esm/SideNav.js +3 -2
- package/dist/esm/Stat.js +8 -1
- package/dist/esm/StatusPill.js +4 -14
- package/dist/esm/Stepper.js +2 -1
- package/dist/esm/Table.js +104 -11
- package/dist/esm/Tabs.js +79 -9
- package/dist/esm/Tag.js +3 -2
- package/dist/esm/TimePicker.js +5 -4
- package/dist/esm/Toaster.js +3 -2
- package/dist/esm/classes.js +33 -0
- package/dist/esm/colorScheme.js +8 -1
- package/dist/esm/display.js +155 -0
- package/dist/esm/iconSvg.js +53 -0
- package/dist/esm/icons.js +531 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/internal.js +1 -27
- package/dist/esm/locale.js +7 -0
- package/dist/esm/strings.js +4 -245
- package/dist/esm/strings.sv.js +127 -0
- package/dist/esm/strings.th.js +127 -0
- package/dist/icons/index.cjs +613 -0
- package/dist/icons/index.d.cts +106 -0
- package/dist/icons/index.d.ts +106 -0
- package/dist/index.d.cts +69 -6
- package/dist/index.d.ts +69 -6
- package/dist/locales/sv.cjs +149 -0
- package/dist/locales/sv.d.cts +96 -0
- package/dist/locales/sv.d.ts +96 -0
- package/dist/locales/th.cjs +149 -0
- package/dist/locales/th.d.cts +96 -0
- package/dist/locales/th.d.ts +96 -0
- package/dist/server/index.cjs +618 -275
- package/dist/server/index.d.cts +141 -0
- package/dist/server/index.d.ts +141 -0
- package/dist/server/index.js +608 -275
- package/dist/styles.css +35 -0
- package/dist/styles.layer.css +35 -0
- package/package.json +35 -3
- package/scripts/aura-icons-codemod.mjs +345 -0
package/dist/server/index.d.cts
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
|
|
3
|
+
/** Button look. */
|
|
4
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "creative" | "danger" | "danger-secondary";
|
|
5
|
+
/** `md` 44px (default) · `sm` 32px for toolbars, table rows and card footers (still a 44px hit area on touch screens). */
|
|
6
|
+
export type ButtonSize = "sm" | "md";
|
|
7
|
+
/** AURA pill button. Enterprise (`primary`, `secondary`) for product UI; `creative` for marketing moments only. */
|
|
8
|
+
export interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
/** Visual variant. Default `primary`. `ghost` has no fill or edge until hover (toolbars, rows, secondary actions beside a primary). `danger` (filled) and `danger-secondary` (outline) are for irreversible or destructive actions only — typically the confirm button of a `Dialog role="alertdialog"`. */
|
|
10
|
+
variant?: ButtonVariant | undefined;
|
|
11
|
+
/** Label text — short, Title Case English or Thai. */
|
|
12
|
+
children: React$1.ReactNode;
|
|
13
|
+
/** Leading icon name (see `IconName`). Hidden while loading. */
|
|
14
|
+
icon?: IconInput | undefined;
|
|
15
|
+
/** Trailing icon name, e.g. `arrow-right` for forward actions. */
|
|
16
|
+
iconRight?: IconInput | undefined;
|
|
17
|
+
/** Shows a spinner in place of the leading icon, sets aria-busy and swallows clicks. Keeps the label and width. */
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels. */
|
|
20
|
+
fullWidth?: boolean | undefined;
|
|
21
|
+
/** `sm` is 32px with tighter padding, for toolbars, table rows and card footers. Default `md` (44px). */
|
|
22
|
+
size?: ButtonSize | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** An AURA icon name, or any icon element (e.g. `<Building />` from lucide-react). AURA sizes it and hides it from screen readers. */
|
|
25
|
+
export type IconInput = IconName | React$1.ReactElement;
|
|
26
|
+
export type IconName = "check" | "x" | "plus" | "minus" | "search" | "chevron-down" | "chevron-up" | "chevron-left" | "chevron-right" | "arrow-right" | "arrow-up-right" | "arrow-up-down" | "loader-circle" | "circle-alert" | "circle-check" | "info" | "triangle-alert" | "settings" | "user" | "users" | "filter" | "ellipsis" | "external-link" | "copy" | "trash-2" | "pencil" | "download" | "upload" | "calendar" | "bell" | "menu" | "eye" | "log-out" | "circle" | "circle-dot-dashed" | "ban" | "arrow-up" | "arrow-down" | "inbox" | "pin" | "pin-off" | "eye-off" | "columns-3" | "arrow-left" | "rotate-ccw" | "house" | "layout-dashboard" | "folder" | "chart-column" | "file-text" | "mail" | "lock" | "clock" | "trending-up" | "trending-down" | "image" | "paperclip" | "cloud-upload" | "file" | "sun" | "moon" | "monitor" | "panel-left-close" | "panel-left-open" | "server" | "globe" | "activity" | "shield-alert" | "phone" | "wrench";
|
|
27
|
+
/** Lucide stroke icon drawn inline in currentColor. */
|
|
28
|
+
export interface IconProps {
|
|
29
|
+
/** A name from the set, or an icon element of your own (sized and styled the same way). */
|
|
30
|
+
name: IconInput;
|
|
31
|
+
/** `sm` 16 (default) · `md` 20 · `lg` 24, or a px number. */
|
|
32
|
+
size?: "sm" | "md" | "lg" | number | undefined;
|
|
33
|
+
/** Accessible name. Omit for decorative icons next to a text label (then aria-hidden). */
|
|
34
|
+
label?: string | undefined;
|
|
35
|
+
/** Default 2 (Lucide's). */
|
|
36
|
+
strokeWidth?: number | undefined;
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
}
|
|
3
39
|
/** `warning` (5.1): needs attention but still works — Warning, Problem, Degraded, At risk. */
|
|
4
40
|
export type StatusTone = "neutral" | "progress" | "ready" | "warning" | "blocked";
|
|
41
|
+
/** Status pill: tone fill + icon + the status word. Tone comes from the word unless given. */
|
|
42
|
+
export interface StatusPillProps extends Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
43
|
+
/** The status word shown, e.g. "In Progress". Other attributes (`id`, `data-*`, `aria-*`) go on the pill (5.8). */
|
|
44
|
+
children: React$1.ReactNode;
|
|
45
|
+
/** Force a tone. Default: matched from the word (Ready/Done → ready, In Progress/In Review → progress, Warning/Problem/Degraded/At risk → warning (5.1), Blocked/Failed → blocked, anything else → neutral). */
|
|
46
|
+
tone?: StatusTone | undefined;
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
export type FeedbackTone = "info" | "success" | "warning" | "danger";
|
|
50
|
+
export interface AlertProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title" | "role"> {
|
|
51
|
+
tone?: FeedbackTone | undefined;
|
|
52
|
+
/** Default: `alert` for warning and danger, `status` otherwise (5.8). Pass `status` for a standing notice in a
|
|
53
|
+
* warning or danger tone that shouldn't interrupt; `note` or `none` for one that isn't a live region. */
|
|
54
|
+
role?: "alert" | "status" | "note" | "none" | undefined;
|
|
55
|
+
/** Replaces the tone's icon (5.8): a name or your own element; always hidden from screen readers. */
|
|
56
|
+
icon?: IconInput | undefined;
|
|
57
|
+
title?: React$1.ReactNode | undefined;
|
|
58
|
+
children?: React$1.ReactNode | undefined;
|
|
59
|
+
/** Usually a secondary Button. */
|
|
60
|
+
action?: React$1.ReactNode | undefined;
|
|
61
|
+
/** Adds a close button. */
|
|
62
|
+
onDismiss?: (() => void) | undefined;
|
|
63
|
+
className?: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
/** Other attributes (`id`, `data-*`, `aria-*`) go on the card's root (5.8). */
|
|
66
|
+
export interface CardProps extends Omit<React$1.HTMLAttributes<HTMLElement>, "title"> {
|
|
67
|
+
title?: React$1.ReactNode | undefined;
|
|
68
|
+
description?: React$1.ReactNode | undefined;
|
|
69
|
+
/** Top-right, usually an IconButton. */
|
|
70
|
+
actions?: React$1.ReactNode | undefined;
|
|
71
|
+
footer?: React$1.ReactNode | undefined;
|
|
72
|
+
children?: React$1.ReactNode | undefined;
|
|
73
|
+
/** Default `enterprise`. `creative` is for marketing and onboarding only. */
|
|
74
|
+
variant?: "enterprise" | "creative" | undefined;
|
|
75
|
+
/** Heading level of the title. Default 3 — use 2 when cards sit directly under the page h1. */
|
|
76
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
77
|
+
/** Hover edge for clickable cards. */
|
|
78
|
+
interactive?: boolean | undefined;
|
|
79
|
+
as?: keyof React$1.JSX.IntrinsicElements | undefined;
|
|
80
|
+
className?: string | undefined;
|
|
81
|
+
/** id for the title element; the card is then labelled by it (aria-labelledby). */
|
|
82
|
+
titleId?: string | undefined;
|
|
83
|
+
}
|
|
5
84
|
/** ISO date string, `YYYY-MM-DD` (Gregorian — the era is display only). */
|
|
6
85
|
export type ISODate = string;
|
|
7
86
|
export interface DateDisplayOptions {
|
|
@@ -10,6 +89,24 @@ export interface DateDisplayOptions {
|
|
|
10
89
|
/** `buddhist` (พ.ศ.; default for th) or `gregory` (ค.ศ.; default for en and sv). */
|
|
11
90
|
calendar?: "buddhist" | "gregory" | undefined;
|
|
12
91
|
}
|
|
92
|
+
export type Tone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
93
|
+
export interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
94
|
+
tone?: Tone | undefined;
|
|
95
|
+
/** soft (default) · solid · outline */
|
|
96
|
+
variant?: "soft" | "solid" | "outline" | undefined;
|
|
97
|
+
icon?: IconInput | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface EmptyStateProps {
|
|
100
|
+
title: React$1.ReactNode;
|
|
101
|
+
description?: React$1.ReactNode | undefined;
|
|
102
|
+
icon?: IconInput | undefined;
|
|
103
|
+
/** One or two buttons. */
|
|
104
|
+
action?: React$1.ReactNode | undefined;
|
|
105
|
+
size?: "sm" | "md" | undefined;
|
|
106
|
+
bordered?: boolean | undefined;
|
|
107
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
108
|
+
className?: string | undefined;
|
|
109
|
+
}
|
|
13
110
|
export interface ThemeOptions {
|
|
14
111
|
/** The project's brand colour, #rgb or #rrggbb. Replaces AURA violet (links, focus ring, selection, info, progress, creative shadow in dark, mesh). */
|
|
15
112
|
brand: string;
|
|
@@ -142,6 +239,12 @@ export interface AuraStrings {
|
|
|
142
239
|
pageN: (p: number) => string;
|
|
143
240
|
accepts: (list?: string, max?: number | string) => string;
|
|
144
241
|
}
|
|
242
|
+
/** Built-in strings by locale. th and sv also ship as packs (`@jirawatpyk/aura-react/locales/th`, `/sv`, 5.9); in 6.0
|
|
243
|
+
* only en stays built in and a Thai or Swedish app passes its pack to AuraProvider `strings`. */
|
|
244
|
+
/** A whole language for AuraProvider `strings` (5.9): every built-in label, and assignable to the prop. */
|
|
245
|
+
export type AuraLocalePack = AuraStrings & {
|
|
246
|
+
[key: string]: string | ((...args: any[]) => string);
|
|
247
|
+
};
|
|
145
248
|
export declare const STRINGS: {
|
|
146
249
|
en: AuraStrings;
|
|
147
250
|
th: AuraStrings;
|
|
@@ -173,8 +276,46 @@ export declare const breakpoints: {
|
|
|
173
276
|
lg: 1024;
|
|
174
277
|
xl: 1280;
|
|
175
278
|
};
|
|
279
|
+
/** One SVG child: element name and its attributes. */
|
|
280
|
+
export type IconShape = [
|
|
281
|
+
string,
|
|
282
|
+
Record<string, string>
|
|
283
|
+
];
|
|
284
|
+
/** An AURA icon component from `@jirawatpyk/aura-react/icons` (5.9), e.g. `IconUsers`. */
|
|
285
|
+
export type AuraIcon = React$1.ForwardRefExoticComponent<Omit<IconProps, "name"> & React$1.RefAttributes<SVGSVGElement>> & {
|
|
286
|
+
/** The icon's path data. */
|
|
287
|
+
readonly auraShapes: IconShape[];
|
|
288
|
+
/** Its name in the set, e.g. `users`. */
|
|
289
|
+
readonly iconName: string;
|
|
290
|
+
};
|
|
291
|
+
/** The class list of a Button (5.8): put it on your own link or `<Link>` to make it look like one, e.g. in a Server
|
|
292
|
+
* Component — `<Link href="/renew" className={buttonClass({ variant: 'secondary' })}>Renew</Link>`. */
|
|
293
|
+
export declare function buttonClass(opts?: {
|
|
294
|
+
variant?: ButtonProps["variant"];
|
|
295
|
+
size?: ButtonProps["size"];
|
|
296
|
+
fullWidth?: boolean | undefined;
|
|
297
|
+
loading?: boolean | undefined;
|
|
298
|
+
className?: string | undefined;
|
|
299
|
+
}): string;
|
|
300
|
+
declare function ServerAlert(props: Omit<AlertProps, "onDismiss">): React$1.ReactElement;
|
|
301
|
+
declare function ServerCard(props: CardProps): React$1.ReactElement;
|
|
302
|
+
declare function ServerStatusPill(props: StatusPillProps): React$1.ReactElement;
|
|
303
|
+
declare function ServerBadge(props: BadgeProps): React$1.ReactElement;
|
|
304
|
+
declare function ServerEmptyState(props: EmptyStateProps): React$1.ReactElement;
|
|
305
|
+
/** Makes icon names as strings work: `registerIcons(allIcons)` once at startup, with `allIcons` from
|
|
306
|
+
* `@jirawatpyk/aura-react/icons`, or only the icons you use (`registerIcons([IconUsers, IconPlus])`). In 5.x every
|
|
307
|
+
* name already works and this only says you are ready for 6.0 (it silences the notice); in 6.0 it is required. Call it in the module
|
|
308
|
+
* graph that renders the names: a client module for the components, and also a server module if Server Components
|
|
309
|
+
* render names with `/server`'s Icon (the two entries keep separate registries). */
|
|
310
|
+
export declare function registerIcons(icons: readonly AuraIcon[]): void;
|
|
311
|
+
export declare const Icon: React$1.ForwardRefExoticComponent<IconProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
176
312
|
|
|
177
313
|
export {
|
|
314
|
+
ServerAlert as Alert,
|
|
315
|
+
ServerBadge as Badge,
|
|
316
|
+
ServerCard as Card,
|
|
317
|
+
ServerEmptyState as EmptyState,
|
|
318
|
+
ServerStatusPill as StatusPill,
|
|
178
319
|
scale as brandScale,
|
|
179
320
|
toneFor as statusTone,
|
|
180
321
|
};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
|
|
3
|
+
/** Button look. */
|
|
4
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "creative" | "danger" | "danger-secondary";
|
|
5
|
+
/** `md` 44px (default) · `sm` 32px for toolbars, table rows and card footers (still a 44px hit area on touch screens). */
|
|
6
|
+
export type ButtonSize = "sm" | "md";
|
|
7
|
+
/** AURA pill button. Enterprise (`primary`, `secondary`) for product UI; `creative` for marketing moments only. */
|
|
8
|
+
export interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
/** Visual variant. Default `primary`. `ghost` has no fill or edge until hover (toolbars, rows, secondary actions beside a primary). `danger` (filled) and `danger-secondary` (outline) are for irreversible or destructive actions only — typically the confirm button of a `Dialog role="alertdialog"`. */
|
|
10
|
+
variant?: ButtonVariant | undefined;
|
|
11
|
+
/** Label text — short, Title Case English or Thai. */
|
|
12
|
+
children: React$1.ReactNode;
|
|
13
|
+
/** Leading icon name (see `IconName`). Hidden while loading. */
|
|
14
|
+
icon?: IconInput | undefined;
|
|
15
|
+
/** Trailing icon name, e.g. `arrow-right` for forward actions. */
|
|
16
|
+
iconRight?: IconInput | undefined;
|
|
17
|
+
/** Shows a spinner in place of the leading icon, sets aria-busy and swallows clicks. Keeps the label and width. */
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
/** Fills its container and lets a long label wrap onto more lines (at least 44px tall) — phones, Thai and Swedish labels. */
|
|
20
|
+
fullWidth?: boolean | undefined;
|
|
21
|
+
/** `sm` is 32px with tighter padding, for toolbars, table rows and card footers. Default `md` (44px). */
|
|
22
|
+
size?: ButtonSize | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** An AURA icon name, or any icon element (e.g. `<Building />` from lucide-react). AURA sizes it and hides it from screen readers. */
|
|
25
|
+
export type IconInput = IconName | React$1.ReactElement;
|
|
26
|
+
export type IconName = "check" | "x" | "plus" | "minus" | "search" | "chevron-down" | "chevron-up" | "chevron-left" | "chevron-right" | "arrow-right" | "arrow-up-right" | "arrow-up-down" | "loader-circle" | "circle-alert" | "circle-check" | "info" | "triangle-alert" | "settings" | "user" | "users" | "filter" | "ellipsis" | "external-link" | "copy" | "trash-2" | "pencil" | "download" | "upload" | "calendar" | "bell" | "menu" | "eye" | "log-out" | "circle" | "circle-dot-dashed" | "ban" | "arrow-up" | "arrow-down" | "inbox" | "pin" | "pin-off" | "eye-off" | "columns-3" | "arrow-left" | "rotate-ccw" | "house" | "layout-dashboard" | "folder" | "chart-column" | "file-text" | "mail" | "lock" | "clock" | "trending-up" | "trending-down" | "image" | "paperclip" | "cloud-upload" | "file" | "sun" | "moon" | "monitor" | "panel-left-close" | "panel-left-open" | "server" | "globe" | "activity" | "shield-alert" | "phone" | "wrench";
|
|
27
|
+
/** Lucide stroke icon drawn inline in currentColor. */
|
|
28
|
+
export interface IconProps {
|
|
29
|
+
/** A name from the set, or an icon element of your own (sized and styled the same way). */
|
|
30
|
+
name: IconInput;
|
|
31
|
+
/** `sm` 16 (default) · `md` 20 · `lg` 24, or a px number. */
|
|
32
|
+
size?: "sm" | "md" | "lg" | number | undefined;
|
|
33
|
+
/** Accessible name. Omit for decorative icons next to a text label (then aria-hidden). */
|
|
34
|
+
label?: string | undefined;
|
|
35
|
+
/** Default 2 (Lucide's). */
|
|
36
|
+
strokeWidth?: number | undefined;
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
}
|
|
3
39
|
/** `warning` (5.1): needs attention but still works — Warning, Problem, Degraded, At risk. */
|
|
4
40
|
export type StatusTone = "neutral" | "progress" | "ready" | "warning" | "blocked";
|
|
41
|
+
/** Status pill: tone fill + icon + the status word. Tone comes from the word unless given. */
|
|
42
|
+
export interface StatusPillProps extends Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
43
|
+
/** The status word shown, e.g. "In Progress". Other attributes (`id`, `data-*`, `aria-*`) go on the pill (5.8). */
|
|
44
|
+
children: React$1.ReactNode;
|
|
45
|
+
/** Force a tone. Default: matched from the word (Ready/Done → ready, In Progress/In Review → progress, Warning/Problem/Degraded/At risk → warning (5.1), Blocked/Failed → blocked, anything else → neutral). */
|
|
46
|
+
tone?: StatusTone | undefined;
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
export type FeedbackTone = "info" | "success" | "warning" | "danger";
|
|
50
|
+
export interface AlertProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title" | "role"> {
|
|
51
|
+
tone?: FeedbackTone | undefined;
|
|
52
|
+
/** Default: `alert` for warning and danger, `status` otherwise (5.8). Pass `status` for a standing notice in a
|
|
53
|
+
* warning or danger tone that shouldn't interrupt; `note` or `none` for one that isn't a live region. */
|
|
54
|
+
role?: "alert" | "status" | "note" | "none" | undefined;
|
|
55
|
+
/** Replaces the tone's icon (5.8): a name or your own element; always hidden from screen readers. */
|
|
56
|
+
icon?: IconInput | undefined;
|
|
57
|
+
title?: React$1.ReactNode | undefined;
|
|
58
|
+
children?: React$1.ReactNode | undefined;
|
|
59
|
+
/** Usually a secondary Button. */
|
|
60
|
+
action?: React$1.ReactNode | undefined;
|
|
61
|
+
/** Adds a close button. */
|
|
62
|
+
onDismiss?: (() => void) | undefined;
|
|
63
|
+
className?: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
/** Other attributes (`id`, `data-*`, `aria-*`) go on the card's root (5.8). */
|
|
66
|
+
export interface CardProps extends Omit<React$1.HTMLAttributes<HTMLElement>, "title"> {
|
|
67
|
+
title?: React$1.ReactNode | undefined;
|
|
68
|
+
description?: React$1.ReactNode | undefined;
|
|
69
|
+
/** Top-right, usually an IconButton. */
|
|
70
|
+
actions?: React$1.ReactNode | undefined;
|
|
71
|
+
footer?: React$1.ReactNode | undefined;
|
|
72
|
+
children?: React$1.ReactNode | undefined;
|
|
73
|
+
/** Default `enterprise`. `creative` is for marketing and onboarding only. */
|
|
74
|
+
variant?: "enterprise" | "creative" | undefined;
|
|
75
|
+
/** Heading level of the title. Default 3 — use 2 when cards sit directly under the page h1. */
|
|
76
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
77
|
+
/** Hover edge for clickable cards. */
|
|
78
|
+
interactive?: boolean | undefined;
|
|
79
|
+
as?: keyof React$1.JSX.IntrinsicElements | undefined;
|
|
80
|
+
className?: string | undefined;
|
|
81
|
+
/** id for the title element; the card is then labelled by it (aria-labelledby). */
|
|
82
|
+
titleId?: string | undefined;
|
|
83
|
+
}
|
|
5
84
|
/** ISO date string, `YYYY-MM-DD` (Gregorian — the era is display only). */
|
|
6
85
|
export type ISODate = string;
|
|
7
86
|
export interface DateDisplayOptions {
|
|
@@ -10,6 +89,24 @@ export interface DateDisplayOptions {
|
|
|
10
89
|
/** `buddhist` (พ.ศ.; default for th) or `gregory` (ค.ศ.; default for en and sv). */
|
|
11
90
|
calendar?: "buddhist" | "gregory" | undefined;
|
|
12
91
|
}
|
|
92
|
+
export type Tone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
93
|
+
export interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
94
|
+
tone?: Tone | undefined;
|
|
95
|
+
/** soft (default) · solid · outline */
|
|
96
|
+
variant?: "soft" | "solid" | "outline" | undefined;
|
|
97
|
+
icon?: IconInput | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface EmptyStateProps {
|
|
100
|
+
title: React$1.ReactNode;
|
|
101
|
+
description?: React$1.ReactNode | undefined;
|
|
102
|
+
icon?: IconInput | undefined;
|
|
103
|
+
/** One or two buttons. */
|
|
104
|
+
action?: React$1.ReactNode | undefined;
|
|
105
|
+
size?: "sm" | "md" | undefined;
|
|
106
|
+
bordered?: boolean | undefined;
|
|
107
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
108
|
+
className?: string | undefined;
|
|
109
|
+
}
|
|
13
110
|
export interface ThemeOptions {
|
|
14
111
|
/** The project's brand colour, #rgb or #rrggbb. Replaces AURA violet (links, focus ring, selection, info, progress, creative shadow in dark, mesh). */
|
|
15
112
|
brand: string;
|
|
@@ -142,6 +239,12 @@ export interface AuraStrings {
|
|
|
142
239
|
pageN: (p: number) => string;
|
|
143
240
|
accepts: (list?: string, max?: number | string) => string;
|
|
144
241
|
}
|
|
242
|
+
/** Built-in strings by locale. th and sv also ship as packs (`@jirawatpyk/aura-react/locales/th`, `/sv`, 5.9); in 6.0
|
|
243
|
+
* only en stays built in and a Thai or Swedish app passes its pack to AuraProvider `strings`. */
|
|
244
|
+
/** A whole language for AuraProvider `strings` (5.9): every built-in label, and assignable to the prop. */
|
|
245
|
+
export type AuraLocalePack = AuraStrings & {
|
|
246
|
+
[key: string]: string | ((...args: any[]) => string);
|
|
247
|
+
};
|
|
145
248
|
export declare const STRINGS: {
|
|
146
249
|
en: AuraStrings;
|
|
147
250
|
th: AuraStrings;
|
|
@@ -173,8 +276,46 @@ export declare const breakpoints: {
|
|
|
173
276
|
lg: 1024;
|
|
174
277
|
xl: 1280;
|
|
175
278
|
};
|
|
279
|
+
/** One SVG child: element name and its attributes. */
|
|
280
|
+
export type IconShape = [
|
|
281
|
+
string,
|
|
282
|
+
Record<string, string>
|
|
283
|
+
];
|
|
284
|
+
/** An AURA icon component from `@jirawatpyk/aura-react/icons` (5.9), e.g. `IconUsers`. */
|
|
285
|
+
export type AuraIcon = React$1.ForwardRefExoticComponent<Omit<IconProps, "name"> & React$1.RefAttributes<SVGSVGElement>> & {
|
|
286
|
+
/** The icon's path data. */
|
|
287
|
+
readonly auraShapes: IconShape[];
|
|
288
|
+
/** Its name in the set, e.g. `users`. */
|
|
289
|
+
readonly iconName: string;
|
|
290
|
+
};
|
|
291
|
+
/** The class list of a Button (5.8): put it on your own link or `<Link>` to make it look like one, e.g. in a Server
|
|
292
|
+
* Component — `<Link href="/renew" className={buttonClass({ variant: 'secondary' })}>Renew</Link>`. */
|
|
293
|
+
export declare function buttonClass(opts?: {
|
|
294
|
+
variant?: ButtonProps["variant"];
|
|
295
|
+
size?: ButtonProps["size"];
|
|
296
|
+
fullWidth?: boolean | undefined;
|
|
297
|
+
loading?: boolean | undefined;
|
|
298
|
+
className?: string | undefined;
|
|
299
|
+
}): string;
|
|
300
|
+
declare function ServerAlert(props: Omit<AlertProps, "onDismiss">): React$1.ReactElement;
|
|
301
|
+
declare function ServerCard(props: CardProps): React$1.ReactElement;
|
|
302
|
+
declare function ServerStatusPill(props: StatusPillProps): React$1.ReactElement;
|
|
303
|
+
declare function ServerBadge(props: BadgeProps): React$1.ReactElement;
|
|
304
|
+
declare function ServerEmptyState(props: EmptyStateProps): React$1.ReactElement;
|
|
305
|
+
/** Makes icon names as strings work: `registerIcons(allIcons)` once at startup, with `allIcons` from
|
|
306
|
+
* `@jirawatpyk/aura-react/icons`, or only the icons you use (`registerIcons([IconUsers, IconPlus])`). In 5.x every
|
|
307
|
+
* name already works and this only says you are ready for 6.0 (it silences the notice); in 6.0 it is required. Call it in the module
|
|
308
|
+
* graph that renders the names: a client module for the components, and also a server module if Server Components
|
|
309
|
+
* render names with `/server`'s Icon (the two entries keep separate registries). */
|
|
310
|
+
export declare function registerIcons(icons: readonly AuraIcon[]): void;
|
|
311
|
+
export declare const Icon: React$1.ForwardRefExoticComponent<IconProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
176
312
|
|
|
177
313
|
export {
|
|
314
|
+
ServerAlert as Alert,
|
|
315
|
+
ServerBadge as Badge,
|
|
316
|
+
ServerCard as Card,
|
|
317
|
+
ServerEmptyState as EmptyState,
|
|
318
|
+
ServerStatusPill as StatusPill,
|
|
178
319
|
scale as brandScale,
|
|
179
320
|
toneFor as statusTone,
|
|
180
321
|
};
|