@jirawatpyk/aura-react 4.7.2 → 4.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 +3 -3
- package/dist/aura.bundle.js +1075 -595
- package/dist/cjs/index.cjs +1074 -594
- package/dist/esm/Accordion.js +66 -0
- package/dist/esm/Alert.js +31 -0
- package/dist/esm/AppShell.js +55 -0
- package/dist/esm/Avatar.js +39 -0
- package/dist/esm/Badge.js +26 -0
- package/dist/esm/Breadcrumb.js +16 -0
- package/dist/esm/Card.js +26 -0
- package/dist/esm/Combobox.js +311 -236
- package/dist/esm/Container.js +18 -0
- package/dist/esm/DatePicker.js +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/EmptyState.js +22 -0
- package/dist/esm/Field.js +46 -0
- package/dist/esm/FileUpload.js +1 -1
- package/dist/esm/Grid.js +21 -0
- package/dist/esm/NumberField.js +175 -0
- package/dist/esm/Pagination.js +94 -0
- package/dist/esm/Popover.js +131 -0
- package/dist/esm/Progress.js +40 -0
- package/dist/esm/RadioGroup.js +46 -0
- package/dist/esm/SegmentedControl.js +104 -0
- package/dist/esm/Select.js +48 -0
- package/dist/esm/SideNav.js +36 -0
- package/dist/esm/Skeleton.js +29 -0
- package/dist/esm/Stack.js +20 -0
- package/dist/esm/Stepper.js +54 -0
- package/dist/esm/Switch.js +30 -0
- package/dist/esm/Tabs.js +89 -0
- package/dist/esm/Tag.js +42 -0
- package/dist/esm/TextField.js +39 -0
- package/dist/esm/Textarea.js +38 -0
- package/dist/esm/TimePicker.js +1 -1
- package/dist/esm/Toaster.js +124 -0
- package/dist/esm/Tooltip.js +80 -0
- package/dist/esm/index.js +33 -5
- package/dist/esm/internal.js +5 -0
- package/dist/esm/locale.js +12 -0
- package/dist/esm/responsive.js +50 -0
- package/dist/index.d.ts +109 -10
- package/dist/styles.css +107 -0
- package/package.json +1 -1
- package/dist/esm/extra.js +0 -412
- package/dist/esm/feedback.js +0 -220
- package/dist/esm/forms.js +0 -212
- package/dist/esm/layout.js +0 -183
- package/dist/esm/layout2.js +0 -138
- /package/dist/esm/{overlay.js → useModal.js} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -6,14 +6,29 @@ import { Menu } from "./Menu.js";
|
|
|
6
6
|
import { DropdownMenu } from "./DropdownMenu.js";
|
|
7
7
|
import { Checkbox } from "./Checkbox.js";
|
|
8
8
|
import { StatusPill, statusTone } from "./StatusPill.js";
|
|
9
|
-
import { Field
|
|
9
|
+
import { Field } from "./Field.js";
|
|
10
|
+
import { TextField } from "./TextField.js";
|
|
11
|
+
import { Textarea } from "./Textarea.js";
|
|
12
|
+
import { Select } from "./Select.js";
|
|
13
|
+
import { RadioGroup } from "./RadioGroup.js";
|
|
14
|
+
import { Switch } from "./Switch.js";
|
|
10
15
|
import { Combobox, defaultFilter } from "./Combobox.js";
|
|
11
16
|
import { DatePicker, DateRangePicker, Calendar, formatDate, parseDate } from "./DatePicker.js";
|
|
12
|
-
import { Alert
|
|
17
|
+
import { Alert } from "./Alert.js";
|
|
18
|
+
import { Toaster, toast } from "./Toaster.js";
|
|
19
|
+
import { Tooltip } from "./Tooltip.js";
|
|
13
20
|
import { Dialog, Drawer } from "./Dialog.js";
|
|
14
21
|
import { DataTable } from "./DataTable.js";
|
|
15
|
-
import { Card
|
|
16
|
-
import {
|
|
22
|
+
import { Card } from "./Card.js";
|
|
23
|
+
import { Tabs } from "./Tabs.js";
|
|
24
|
+
import { SideNav } from "./SideNav.js";
|
|
25
|
+
import { Breadcrumb } from "./Breadcrumb.js";
|
|
26
|
+
import { Avatar } from "./Avatar.js";
|
|
27
|
+
import { Stack } from "./Stack.js";
|
|
28
|
+
import { Grid } from "./Grid.js";
|
|
29
|
+
import { Container } from "./Container.js";
|
|
30
|
+
import { AppShell } from "./AppShell.js";
|
|
31
|
+
import { useBreakpoint, useResponsive, breakpoints } from "./responsive.js";
|
|
17
32
|
import { Surface } from "./Surface.js";
|
|
18
33
|
import { AuraProvider, useAuraLocale, STRINGS } from "./locale.js";
|
|
19
34
|
import { Stat } from "./Stat.js";
|
|
@@ -22,7 +37,17 @@ import { FileUpload, formatBytes } from "./FileUpload.js";
|
|
|
22
37
|
import { createTheme, contrast, scale } from "./theme.js";
|
|
23
38
|
import { ThemeStyle } from "./ThemeStyle.js";
|
|
24
39
|
import { ColorSchemeScript, ColorSchemeToggle, colorSchemeScript, useColorScheme } from "./colorScheme.js";
|
|
25
|
-
import { Badge
|
|
40
|
+
import { Badge } from "./Badge.js";
|
|
41
|
+
import { Tag } from "./Tag.js";
|
|
42
|
+
import { Progress } from "./Progress.js";
|
|
43
|
+
import { Skeleton } from "./Skeleton.js";
|
|
44
|
+
import { EmptyState } from "./EmptyState.js";
|
|
45
|
+
import { Pagination } from "./Pagination.js";
|
|
46
|
+
import { Accordion } from "./Accordion.js";
|
|
47
|
+
import { Popover } from "./Popover.js";
|
|
48
|
+
import { NumberField } from "./NumberField.js";
|
|
49
|
+
import { Stepper } from "./Stepper.js";
|
|
50
|
+
import { SegmentedControl } from "./SegmentedControl.js";
|
|
26
51
|
export {
|
|
27
52
|
Accordion,
|
|
28
53
|
Alert,
|
|
@@ -53,17 +78,20 @@ export {
|
|
|
53
78
|
Icon,
|
|
54
79
|
IconButton,
|
|
55
80
|
Menu,
|
|
81
|
+
NumberField,
|
|
56
82
|
Pagination,
|
|
57
83
|
Popover,
|
|
58
84
|
Progress,
|
|
59
85
|
RadioGroup,
|
|
60
86
|
STRINGS,
|
|
87
|
+
SegmentedControl,
|
|
61
88
|
Select,
|
|
62
89
|
SideNav,
|
|
63
90
|
Skeleton,
|
|
64
91
|
Stack,
|
|
65
92
|
Stat,
|
|
66
93
|
StatusPill,
|
|
94
|
+
Stepper,
|
|
67
95
|
Surface,
|
|
68
96
|
Switch,
|
|
69
97
|
Tabs,
|
package/dist/esm/internal.js
CHANGED
|
@@ -79,12 +79,17 @@ function useMergedRef(a, b) {
|
|
|
79
79
|
[a, b]
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
+
const TONES = ["neutral", "accent", "success", "warning", "danger"];
|
|
83
|
+
function tone(t) {
|
|
84
|
+
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
85
|
+
}
|
|
82
86
|
export {
|
|
83
87
|
FOCUSABLE,
|
|
84
88
|
collator,
|
|
85
89
|
compare,
|
|
86
90
|
cx,
|
|
87
91
|
omit,
|
|
92
|
+
tone,
|
|
88
93
|
trapTab,
|
|
89
94
|
uid,
|
|
90
95
|
useIsoLayoutEffect,
|
package/dist/esm/locale.js
CHANGED
|
@@ -83,6 +83,12 @@ const STRINGS = {
|
|
|
83
83
|
return "Up to " + n2 + " files";
|
|
84
84
|
},
|
|
85
85
|
colorScheme: "Colour scheme",
|
|
86
|
+
increase: "Increase",
|
|
87
|
+
decrease: "Decrease",
|
|
88
|
+
stepDone: "completed",
|
|
89
|
+
stepOf: function(i, total) {
|
|
90
|
+
return "Step " + i + " of " + total;
|
|
91
|
+
},
|
|
86
92
|
schemeLight: "Light",
|
|
87
93
|
schemeDark: "Dark",
|
|
88
94
|
schemeSystem: "System",
|
|
@@ -175,6 +181,12 @@ const STRINGS = {
|
|
|
175
181
|
return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
|
|
176
182
|
},
|
|
177
183
|
colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
|
|
184
|
+
increase: "\u0E40\u0E1E\u0E34\u0E48\u0E21",
|
|
185
|
+
decrease: "\u0E25\u0E14",
|
|
186
|
+
stepDone: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27",
|
|
187
|
+
stepOf: function(i, total) {
|
|
188
|
+
return "\u0E02\u0E31\u0E49\u0E19\u0E17\u0E35\u0E48 " + i + " \u0E08\u0E32\u0E01 " + total;
|
|
189
|
+
},
|
|
178
190
|
schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
|
|
179
191
|
schemeDark: "\u0E21\u0E37\u0E14",
|
|
180
192
|
schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4
|
+
const ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
5
|
+
function useBreakpoint() {
|
|
6
|
+
return React.useSyncExternalStore(subscribe, current, function() {
|
|
7
|
+
return "lg";
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function current() {
|
|
11
|
+
let w = window.innerWidth, bp = "base";
|
|
12
|
+
ORDER.slice(1).forEach(function(k) {
|
|
13
|
+
if (w >= breakpoints[k]) bp = k;
|
|
14
|
+
});
|
|
15
|
+
return bp;
|
|
16
|
+
}
|
|
17
|
+
function subscribe(cb) {
|
|
18
|
+
window.addEventListener("resize", cb);
|
|
19
|
+
return function() {
|
|
20
|
+
window.removeEventListener("resize", cb);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function useResponsive(value) {
|
|
24
|
+
const bp = useBreakpoint();
|
|
25
|
+
if (value == null || typeof value !== "object") return value;
|
|
26
|
+
const map = value;
|
|
27
|
+
for (let i = ORDER.indexOf(bp); i >= 0; i--) if (map[ORDER[i]] !== void 0) return map[ORDER[i]];
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
function respVars(prefix, value, map) {
|
|
31
|
+
const style = {};
|
|
32
|
+
if (value == null) return style;
|
|
33
|
+
if (typeof value !== "object") value = { base: value };
|
|
34
|
+
let byBp = value, cur;
|
|
35
|
+
ORDER.forEach(function(k) {
|
|
36
|
+
if (byBp[k] !== void 0) cur = map ? map(byBp[k]) : byBp[k];
|
|
37
|
+
if (cur !== void 0) style["--" + prefix + "-" + k] = cur;
|
|
38
|
+
});
|
|
39
|
+
return style;
|
|
40
|
+
}
|
|
41
|
+
const space = function(v) {
|
|
42
|
+
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
breakpoints,
|
|
46
|
+
respVars,
|
|
47
|
+
space,
|
|
48
|
+
useBreakpoint,
|
|
49
|
+
useResponsive
|
|
50
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -437,6 +437,18 @@ export interface ComboboxOption {
|
|
|
437
437
|
/** Leading icon in the list. */
|
|
438
438
|
icon?: IconName;
|
|
439
439
|
}
|
|
440
|
+
/** Combobox with `multiple`: pick any number; the picks show as removable chips in the field. */
|
|
441
|
+
export interface ComboboxMultipleProps extends Omit<ComboboxProps, "value" | "defaultValue" | "onChange" | "clearable"> {
|
|
442
|
+
multiple: true;
|
|
443
|
+
/** Selected option values, in the order they were picked (controlled). */
|
|
444
|
+
value?: string[];
|
|
445
|
+
defaultValue?: string[];
|
|
446
|
+
onChange?: (value: string[]) => void;
|
|
447
|
+
/** Clear-all button while anything is selected. Default true. */
|
|
448
|
+
clearable?: boolean;
|
|
449
|
+
/** Most picks allowed; further options are disabled. */
|
|
450
|
+
max?: number;
|
|
451
|
+
}
|
|
440
452
|
export interface ComboboxProps extends FieldProps {
|
|
441
453
|
options: Array<ComboboxOption | string>;
|
|
442
454
|
/** Selected option value (controlled). */
|
|
@@ -463,6 +475,77 @@ export interface ComboboxProps extends FieldProps {
|
|
|
463
475
|
filter?: (option: ComboboxOption, query: string) => boolean;
|
|
464
476
|
className?: string;
|
|
465
477
|
}
|
|
478
|
+
/** Number input: thousands separators, +/− buttons, arrow keys, min/max/step, prefix/suffix (฿, %). */
|
|
479
|
+
export interface NumberFieldProps extends FieldProps {
|
|
480
|
+
/** The number (controlled). `null` = empty. */
|
|
481
|
+
value?: number | null;
|
|
482
|
+
defaultValue?: number | null;
|
|
483
|
+
/** Called with the parsed number (or null when emptied) as the person types, and with the clamped value on blur. */
|
|
484
|
+
onChange?: (value: number | null) => void;
|
|
485
|
+
min?: number;
|
|
486
|
+
max?: number;
|
|
487
|
+
/** Arrow keys and buttons move by this. Default 1. PageUp/PageDown move 10×. */
|
|
488
|
+
step?: number;
|
|
489
|
+
/** Decimal places shown and kept. Default: 0 when step is whole, else step's decimals. */
|
|
490
|
+
decimals?: number;
|
|
491
|
+
/** Text before the number, e.g. `฿`. */
|
|
492
|
+
prefix?: React$1.ReactNode;
|
|
493
|
+
/** Text after the number, e.g. `%` or `ชิ้น`. */
|
|
494
|
+
suffix?: React$1.ReactNode;
|
|
495
|
+
/** +/− buttons beside the number. Default true. */
|
|
496
|
+
stepper?: boolean;
|
|
497
|
+
id?: string;
|
|
498
|
+
name?: string;
|
|
499
|
+
placeholder?: string;
|
|
500
|
+
disabled?: boolean;
|
|
501
|
+
readOnly?: boolean;
|
|
502
|
+
className?: string;
|
|
503
|
+
onBlur?: React$1.FocusEventHandler<HTMLInputElement>;
|
|
504
|
+
}
|
|
505
|
+
/** One step of a Stepper. */
|
|
506
|
+
export interface StepItem {
|
|
507
|
+
id: string;
|
|
508
|
+
label: React$1.ReactNode;
|
|
509
|
+
/** Short line under the label, e.g. what the step asks for. */
|
|
510
|
+
description?: React$1.ReactNode;
|
|
511
|
+
}
|
|
512
|
+
/** Progress through a multi-step flow (wizard, checkout, booking). */
|
|
513
|
+
export interface StepperProps {
|
|
514
|
+
steps: StepItem[];
|
|
515
|
+
/** id of the step the person is on. Steps before it are completed. */
|
|
516
|
+
current: string;
|
|
517
|
+
/** Accessible name of the list. Default: none (give one when the page has several). */
|
|
518
|
+
label?: string;
|
|
519
|
+
/** Makes completed steps buttons that go back to them. Upcoming steps never are. */
|
|
520
|
+
onStepClick?: (id: string) => void;
|
|
521
|
+
/** Default `horizontal`. Below `sm` a horizontal stepper shows only the current step ("Step 2 of 4"). */
|
|
522
|
+
orientation?: "horizontal" | "vertical";
|
|
523
|
+
className?: string;
|
|
524
|
+
}
|
|
525
|
+
export interface SegmentedOption {
|
|
526
|
+
value: string;
|
|
527
|
+
label: string;
|
|
528
|
+
icon?: IconName;
|
|
529
|
+
/** Show only the icon; `label` becomes its accessible name and tooltip. */
|
|
530
|
+
iconOnly?: boolean;
|
|
531
|
+
disabled?: boolean;
|
|
532
|
+
}
|
|
533
|
+
/** A row of 2–5 mutually exclusive choices that apply at once (view, period, unit). A radio group underneath. */
|
|
534
|
+
export interface SegmentedControlProps {
|
|
535
|
+
/** Accessible name of the group, e.g. "View". Required. */
|
|
536
|
+
label: string;
|
|
537
|
+
options: Array<SegmentedOption | string>;
|
|
538
|
+
value?: string;
|
|
539
|
+
defaultValue?: string;
|
|
540
|
+
onChange?: (value: string) => void;
|
|
541
|
+
/** `md` (default, 36px) or `sm` (28px) for toolbars. */
|
|
542
|
+
size?: "sm" | "md";
|
|
543
|
+
/** Stretch across the container, segments equal width. */
|
|
544
|
+
fullWidth?: boolean;
|
|
545
|
+
disabled?: boolean;
|
|
546
|
+
id?: string;
|
|
547
|
+
className?: string;
|
|
548
|
+
}
|
|
466
549
|
/** ISO date string, `YYYY-MM-DD` (Gregorian — the era is display only). */
|
|
467
550
|
export type ISODate = string;
|
|
468
551
|
export interface DateDisplayOptions {
|
|
@@ -832,10 +915,16 @@ export declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps &
|
|
|
832
915
|
export declare const Select: React$1.ForwardRefExoticComponent<SelectProps & React$1.RefAttributes<HTMLSelectElement>>;
|
|
833
916
|
export declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLFieldSetElement>>;
|
|
834
917
|
export declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
918
|
+
/** One value, or with `multiple` any number (chips). Two call signatures so value/onChange are typed for each. */
|
|
919
|
+
export interface ComboboxComponent {
|
|
920
|
+
(props: ComboboxMultipleProps & React$1.RefAttributes<HTMLInputElement>): React$1.ReactElement | null;
|
|
921
|
+
(props: ComboboxProps & React$1.RefAttributes<HTMLInputElement>): React$1.ReactElement | null;
|
|
922
|
+
displayName?: string;
|
|
923
|
+
}
|
|
835
924
|
/** The Thai-aware default filter: label, description and keywords contain the query. */
|
|
836
925
|
declare function defaultFilter(option: ComboboxOption, query: string): boolean;
|
|
837
|
-
/** Text field that filters a list as you type (ARIA 1.2 combobox). One value
|
|
838
|
-
export declare const Combobox:
|
|
926
|
+
/** Text field that filters a list as you type (ARIA 1.2 combobox). One value, or any number with `multiple`. */
|
|
927
|
+
export declare const Combobox: ComboboxComponent;
|
|
839
928
|
/** Options for formatDate: locale/calendar plus a preset or any Intl.DateTimeFormat options. */
|
|
840
929
|
export type FormatDateOptions = DateDisplayOptions & {
|
|
841
930
|
format?: "short" | "long" | "numeric" | Intl.DateTimeFormatOptions;
|
|
@@ -870,6 +959,10 @@ export declare const Tabs: React$1.ForwardRefExoticComponent<TabsProps & React$1
|
|
|
870
959
|
export declare const SideNav: React$1.ForwardRefExoticComponent<SideNavProps & React$1.RefAttributes<HTMLElement>>;
|
|
871
960
|
export declare const Breadcrumb: React$1.ForwardRefExoticComponent<BreadcrumbProps & React$1.RefAttributes<HTMLElement>>;
|
|
872
961
|
export declare const Avatar: React$1.ForwardRefExoticComponent<AvatarProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
962
|
+
/** Stack — one direction, even gaps. direction and gap may be responsive: { base: 'column', md: 'row' }. */
|
|
963
|
+
export declare const Stack: React$1.ForwardRefExoticComponent<StackProps & React$1.RefAttributes<HTMLElement>>;
|
|
964
|
+
/** Grid — equal columns. columns may be responsive ({ base: 1, md: 2, lg: 3 }), or use minItemWidth to fit as many as fit. */
|
|
965
|
+
export declare const Grid: React$1.ForwardRefExoticComponent<GridProps & React$1.RefAttributes<HTMLElement>>;
|
|
873
966
|
/** Centred page column. */
|
|
874
967
|
export interface ContainerProps {
|
|
875
968
|
/** `narrow` caps it at aura-container-narrow (720px). Default `default` (1280px). */
|
|
@@ -879,6 +972,10 @@ export interface ContainerProps {
|
|
|
879
972
|
style?: React$1.CSSProperties;
|
|
880
973
|
children?: React$1.ReactNode;
|
|
881
974
|
}
|
|
975
|
+
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
976
|
+
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
977
|
+
/** AppShell — side navigation + top bar + content. The nav is fixed from lg (1024px) up and a Drawer below it. */
|
|
978
|
+
export declare const AppShell: React$1.ForwardRefExoticComponent<AppShellProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
882
979
|
/** Min-width breakpoints in px, mirroring the aura-bp-* tokens. */
|
|
883
980
|
export declare const breakpoints: {
|
|
884
981
|
sm: 640;
|
|
@@ -890,14 +987,6 @@ export declare const breakpoints: {
|
|
|
890
987
|
export declare function useBreakpoint(): Breakpoint;
|
|
891
988
|
/** Pick a value for the current breakpoint from { base, sm, md, lg, xl } (falls back to the next smaller one). */
|
|
892
989
|
export declare function useResponsive<T>(value: Responsive<T>): T | undefined;
|
|
893
|
-
/** Stack — one direction, even gaps. direction and gap may be responsive: { base: 'column', md: 'row' }. */
|
|
894
|
-
export declare const Stack: React$1.ForwardRefExoticComponent<StackProps & React$1.RefAttributes<HTMLElement>>;
|
|
895
|
-
/** Grid — equal columns. columns may be responsive ({ base: 1, md: 2, lg: 3 }), or use minItemWidth to fit as many as fit. */
|
|
896
|
-
export declare const Grid: React$1.ForwardRefExoticComponent<GridProps & React$1.RefAttributes<HTMLElement>>;
|
|
897
|
-
/** Container — centres content up to aura-container-max (1280px) with responsive side padding. */
|
|
898
|
-
export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps & React$1.RefAttributes<HTMLElement>>;
|
|
899
|
-
/** AppShell — side navigation + top bar + content. The nav is fixed from lg (1024px) up and a Drawer below it. */
|
|
900
|
-
export declare const AppShell: React$1.ForwardRefExoticComponent<AppShellProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
901
990
|
export declare const Surface: React$1.ForwardRefExoticComponent<SurfaceProps & React$1.RefAttributes<HTMLElement>>;
|
|
902
991
|
/** Every built-in label. Function entries build the text from their arguments. */
|
|
903
992
|
export interface AuraStrings {
|
|
@@ -953,6 +1042,10 @@ export interface AuraStrings {
|
|
|
953
1042
|
fileWrongType: string;
|
|
954
1043
|
tooManyFiles: (n: number | string) => string;
|
|
955
1044
|
colorScheme: string;
|
|
1045
|
+
increase: string;
|
|
1046
|
+
decrease: string;
|
|
1047
|
+
stepDone: string;
|
|
1048
|
+
stepOf: (i: number, total: number) => string;
|
|
956
1049
|
schemeLight: string;
|
|
957
1050
|
schemeDark: string;
|
|
958
1051
|
schemeSystem: string;
|
|
@@ -1031,6 +1124,12 @@ export declare const EmptyState: React$1.ForwardRefExoticComponent<EmptyStatePro
|
|
|
1031
1124
|
export declare const Pagination: React$1.ForwardRefExoticComponent<PaginationProps & React$1.RefAttributes<HTMLElement>>;
|
|
1032
1125
|
export declare const Accordion: React$1.ForwardRefExoticComponent<AccordionProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1033
1126
|
export declare const Popover: React$1.ForwardRefExoticComponent<PopoverProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1127
|
+
/** Number input with thousands separators, +/− buttons and arrow keys (ARIA spinbutton). */
|
|
1128
|
+
export declare const NumberField: React$1.ForwardRefExoticComponent<NumberFieldProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1129
|
+
/** Progress through a multi-step flow. Completed steps can link back; the current one has aria-current="step". */
|
|
1130
|
+
export declare const Stepper: React$1.ForwardRefExoticComponent<StepperProps & React$1.RefAttributes<HTMLElement>>;
|
|
1131
|
+
/** A row of mutually exclusive choices that apply at once. A radio group: one Tab stop, arrow keys move and select. */
|
|
1132
|
+
export declare const SegmentedControl: React$1.ForwardRefExoticComponent<SegmentedControlProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1034
1133
|
|
|
1035
1134
|
export {
|
|
1036
1135
|
defaultFilter as comboboxFilter,
|
package/dist/styles.css
CHANGED
|
@@ -944,6 +944,107 @@ button.aura-stat { font: inherit; width: 100%; cursor: pointer; }
|
|
|
944
944
|
.aura-popover__head + .aura-popover__body { padding-top: var(--aura-space-2); }
|
|
945
945
|
@media (prefers-reduced-motion: reduce) { .aura-popover { animation: none; } }
|
|
946
946
|
|
|
947
|
+
/* ---------- Combobox, multiple: picks as chips in the field ---------- */
|
|
948
|
+
.aura-combo.is-multi { flex-wrap: wrap; align-items: center; gap: var(--aura-space-1); padding: 5px calc(var(--aura-space-2) + 2 * var(--aura-control-sm)) 5px calc(var(--aura-space-3) + var(--aura-icon-sm) + var(--aura-space-2)); }
|
|
949
|
+
.aura-combo.is-multi .aura-input__icon { top: calc(var(--aura-input-height) / 2 - var(--aura-icon-sm) / 2 - 1px); }
|
|
950
|
+
.aura-combo.is-multi .aura-input__control { flex: 1 0 4ch; height: 32px; padding: 0 var(--aura-space-1); }
|
|
951
|
+
/* Wrapped chips grow the field: keep the icon and buttons on the first line. */
|
|
952
|
+
.aura-combo.is-multi .aura-combo__clear, .aura-combo.is-multi .aura-combo__toggle { top: calc((var(--aura-input-height) - 2px - var(--aura-control-sm)) / 2); }
|
|
953
|
+
.aura-combo__chips { display: contents; }
|
|
954
|
+
.aura-combo__chip {
|
|
955
|
+
display: inline-flex; align-items: center; gap: 2px; max-width: 100%; height: 28px; box-sizing: border-box;
|
|
956
|
+
padding: 0 2px 0 var(--aura-space-2); border-radius: var(--aura-radius-full);
|
|
957
|
+
background: var(--aura-bg-selected); color: var(--aura-fg-primary); font-size: 13px; font-weight: 500;
|
|
958
|
+
}
|
|
959
|
+
.aura-combo__chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
|
|
960
|
+
.aura-combo__chip-remove {
|
|
961
|
+
display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
|
|
962
|
+
border: 0; border-radius: var(--aura-radius-full); background: transparent; color: var(--aura-fg-secondary); cursor: pointer;
|
|
963
|
+
}
|
|
964
|
+
.aura-combo__chip-remove:hover { background: var(--aura-bg-surface-hover); color: var(--aura-fg-primary); }
|
|
965
|
+
.aura-combo__chip-remove .aura-icon { width: 14px; height: 14px; }
|
|
966
|
+
|
|
967
|
+
/* ---------- NumberField ---------- */
|
|
968
|
+
.aura-number .aura-input__control { font-variant-numeric: tabular-nums; }
|
|
969
|
+
.aura-number__affix { padding-left: var(--aura-space-3); color: var(--aura-fg-secondary); font-size: 14px; white-space: nowrap; }
|
|
970
|
+
.aura-number__affix + .aura-input__control { padding-left: var(--aura-space-2); }
|
|
971
|
+
.aura-input__control + .aura-number__affix { padding: 0 var(--aura-space-2) 0 0; }
|
|
972
|
+
.aura-number__steps { display: flex; align-self: stretch; border-left: 1px solid var(--aura-border-default); }
|
|
973
|
+
.aura-number__step {
|
|
974
|
+
display: inline-flex; align-items: center; justify-content: center; width: 36px; padding: 0;
|
|
975
|
+
border: 0; background: transparent; color: var(--aura-fg-secondary); cursor: pointer;
|
|
976
|
+
transition: background-color var(--aura-duration-fast) var(--aura-ease), color var(--aura-duration-fast) var(--aura-ease);
|
|
977
|
+
}
|
|
978
|
+
.aura-number__step + .aura-number__step { border-left: 1px solid var(--aura-border-default); }
|
|
979
|
+
.aura-number__step:last-child { border-radius: 0 calc(var(--aura-radius-md) - 1px) calc(var(--aura-radius-md) - 1px) 0; }
|
|
980
|
+
.aura-number__step:hover:not(:disabled) { background: var(--aura-bg-surface-hover); color: var(--aura-fg-primary); }
|
|
981
|
+
.aura-number__step:disabled { opacity: var(--aura-disabled-opacity); cursor: default; }
|
|
982
|
+
|
|
983
|
+
/* ---------- Stepper ---------- */
|
|
984
|
+
.aura-stepper { font-family: var(--font-sans); }
|
|
985
|
+
.aura-stepper__list { display: flex; list-style: none; margin: 0; padding: 0; }
|
|
986
|
+
.aura-stepper--vertical .aura-stepper__list { flex-direction: column; }
|
|
987
|
+
.aura-stepper__item { position: relative; flex: 1 1 0; min-width: 0; }
|
|
988
|
+
.aura-stepper__step {
|
|
989
|
+
display: flex; align-items: flex-start; gap: var(--aura-space-3); width: 100%; box-sizing: border-box; padding: 0 var(--aura-space-3) 0 0;
|
|
990
|
+
border: 0; background: none; color: inherit; font: inherit; text-align: left; border-radius: var(--aura-radius-md);
|
|
991
|
+
}
|
|
992
|
+
button.aura-stepper__step { cursor: pointer; }
|
|
993
|
+
button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underline; }
|
|
994
|
+
.aura-stepper__marker {
|
|
995
|
+
position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; box-sizing: border-box;
|
|
996
|
+
border-radius: var(--aura-radius-full); border: 1px solid var(--aura-border-control); background: var(--aura-bg-surface);
|
|
997
|
+
color: var(--aura-fg-secondary); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
|
|
998
|
+
}
|
|
999
|
+
.aura-stepper__marker .aura-icon { width: 16px; height: 16px; }
|
|
1000
|
+
.aura-stepper__item.is-done .aura-stepper__marker { background: var(--aura-button-primary-bg); border-color: var(--aura-button-primary-bg); color: var(--aura-button-primary-fg); }
|
|
1001
|
+
.aura-stepper__item.is-current .aura-stepper__marker { border: 2px solid var(--aura-fg-accent); color: var(--aura-fg-accent); }
|
|
1002
|
+
.aura-stepper__text { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
|
|
1003
|
+
.aura-stepper__label { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--aura-fg-secondary); }
|
|
1004
|
+
.aura-stepper__item.is-current .aura-stepper__label, .aura-stepper__item.is-done .aura-stepper__label { color: var(--aura-fg-primary); }
|
|
1005
|
+
.aura-stepper__item.is-current .aura-stepper__label { font-weight: 600; }
|
|
1006
|
+
.aura-stepper__desc { font-size: 12px; line-height: 1.5; color: var(--aura-fg-secondary); }
|
|
1007
|
+
/* Connector: a line from each marker to the next (labels sit under the markers), or down the left when vertical. */
|
|
1008
|
+
.aura-stepper--horizontal .aura-stepper__item:not(:last-child)::after {
|
|
1009
|
+
content: ""; position: absolute; top: 14px; left: 36px; right: var(--aura-space-2); height: 1px; background: var(--aura-border-control); pointer-events: none;
|
|
1010
|
+
}
|
|
1011
|
+
.aura-stepper--horizontal .aura-stepper__step { flex-direction: column; gap: var(--aura-space-2); }
|
|
1012
|
+
.aura-stepper--horizontal .aura-stepper__text { padding-top: 0; }
|
|
1013
|
+
.aura-stepper--horizontal .aura-stepper__item.is-done::after { background: var(--aura-button-primary-bg); }
|
|
1014
|
+
.aura-stepper--vertical .aura-stepper__item { flex: none; padding-bottom: var(--aura-space-5); }
|
|
1015
|
+
.aura-stepper--vertical .aura-stepper__item:not(:last-child)::after {
|
|
1016
|
+
content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--aura-border-control);
|
|
1017
|
+
}
|
|
1018
|
+
.aura-stepper--vertical .aura-stepper__item.is-done::after { background: var(--aura-button-primary-bg); }
|
|
1019
|
+
.aura-stepper__compact { display: none; margin: var(--aura-space-2) 0 0; font-size: 13px; }
|
|
1020
|
+
.aura-stepper__count { color: var(--aura-fg-secondary); margin-right: var(--aura-space-2); }
|
|
1021
|
+
.aura-stepper__compact-label { font-weight: 600; }
|
|
1022
|
+
|
|
1023
|
+
/* ---------- SegmentedControl ---------- */
|
|
1024
|
+
.aura-segmented {
|
|
1025
|
+
display: inline-flex; gap: 2px; padding: 2px; box-sizing: border-box; max-width: 100%;
|
|
1026
|
+
border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-full); background: var(--aura-bg-surface-hover);
|
|
1027
|
+
font-family: var(--font-sans);
|
|
1028
|
+
}
|
|
1029
|
+
.aura-segmented:not(.is-full) { width: fit-content; justify-self: start; align-self: flex-start; }
|
|
1030
|
+
.aura-segmented.is-full { display: flex; width: 100%; }
|
|
1031
|
+
.aura-segmented__option {
|
|
1032
|
+
flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
1033
|
+
height: 32px; padding: 0 var(--aura-space-4); box-sizing: border-box;
|
|
1034
|
+
border: 0; border-radius: var(--aura-radius-full); background: transparent; color: var(--aura-fg-secondary);
|
|
1035
|
+
font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
|
|
1036
|
+
transition: background-color var(--aura-duration-fast) var(--aura-ease), color var(--aura-duration-fast) var(--aura-ease), box-shadow var(--aura-duration-fast) var(--aura-ease);
|
|
1037
|
+
}
|
|
1038
|
+
.aura-segmented.is-full .aura-segmented__option { flex: 1 1 0; min-width: 0; }
|
|
1039
|
+
.aura-segmented__option.is-icon { padding: 0; width: 36px; }
|
|
1040
|
+
.aura-segmented__option:hover:not(:disabled):not(.is-selected) { color: var(--aura-fg-primary); }
|
|
1041
|
+
.aura-segmented__option.is-selected { background: var(--aura-bg-surface); color: var(--aura-fg-primary); box-shadow: var(--aura-shadow-enterprise); }
|
|
1042
|
+
.aura-segmented__option:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: 1px; }
|
|
1043
|
+
.aura-segmented__option:disabled { opacity: var(--aura-disabled-opacity); cursor: default; }
|
|
1044
|
+
.aura-segmented--sm .aura-segmented__option { height: 24px; padding: 0 var(--aura-space-3); font-size: 12px; }
|
|
1045
|
+
.aura-segmented--sm .aura-segmented__option.is-icon { width: 28px; padding: 0; }
|
|
1046
|
+
.aura-segmented.is-disabled { opacity: var(--aura-disabled-opacity); }
|
|
1047
|
+
|
|
947
1048
|
/* A field inside a row Stack takes the remaining width (a search box beside its button). */
|
|
948
1049
|
.aura-stack > .aura-field { flex: 1 1 auto; min-width: 0; }
|
|
949
1050
|
|
|
@@ -951,10 +1052,16 @@ button.aura-stat { font: inherit; width: 100%; cursor: pointer; }
|
|
|
951
1052
|
@media (pointer: coarse) {
|
|
952
1053
|
.aura-cal { --aura-cal-cell: 40px; }
|
|
953
1054
|
.aura-combo__option { min-height: 44px; }
|
|
1055
|
+
.aura-segmented__option, .aura-segmented--sm .aura-segmented__option { height: 40px; }
|
|
1056
|
+
.aura-number__step { width: 44px; }
|
|
954
1057
|
}
|
|
955
1058
|
|
|
956
1059
|
/* ---------- Small screens (< 640px) ---------- */
|
|
957
1060
|
@media (max-width: 639.98px) {
|
|
1061
|
+
/* Horizontal stepper on phones: markers only (names kept for screen readers), the current step named underneath. */
|
|
1062
|
+
.aura-stepper--horizontal .aura-stepper__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
|
|
1063
|
+
.aura-stepper--horizontal .aura-stepper__item:not(:last-child)::after { right: 8px; }
|
|
1064
|
+
.aura-stepper--horizontal .aura-stepper__compact { display: block; }
|
|
958
1065
|
.aura-dialog-layer:not(.aura-drawer-layer) { align-items: flex-end; padding: 0; }
|
|
959
1066
|
.aura-dialog { max-width: none !important; max-height: 92vh; border-radius: var(--aura-radius-2xl) var(--aura-radius-2xl) 0 0; border-bottom: 0;
|
|
960
1067
|
padding-bottom: calc(var(--aura-space-6) + env(safe-area-inset-bottom)); animation-name: aura-sheet-in; }
|
package/package.json
CHANGED