@rojaostudio/ds 2.0.0-next.3 → 2.0.0-next.30
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 +42 -2
- package/THIRD_PARTY_NOTICES.md +66 -0
- package/dist/components/avatar.d.ts +20 -12
- package/dist/components/avatar.js +8 -6
- package/dist/components/badge.d.ts +7 -6
- package/dist/components/badge.js +2 -1
- package/dist/components/breadcrumb.d.ts +4 -4
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/bubble.d.ts +26 -11
- package/dist/components/bubble.js +3 -3
- package/dist/components/button.d.ts +1 -1
- package/dist/components/card.d.ts +28 -12
- package/dist/components/card.js +4 -2
- package/dist/components/chart.d.ts +18 -8
- package/dist/components/chart.js +89 -25
- package/dist/components/choice-carousel.d.ts +1 -1
- package/dist/components/choice-carousel.js +2 -4
- package/dist/components/choice-list.d.ts +40 -0
- package/dist/components/choice-list.js +122 -0
- package/dist/components/choice-preview-card.d.ts +1 -7
- package/dist/components/color-input.d.ts +1 -1
- package/dist/components/context-menu.d.ts +5 -2
- package/dist/components/currency-input.d.ts +0 -2
- package/dist/components/data-table-header.d.ts +55 -18
- package/dist/components/data-table-header.js +148 -101
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/dialog.d.ts +6 -3
- package/dist/components/dialog.js +2 -2
- package/dist/components/dropdown-menu.d.ts +5 -2
- package/dist/components/dropzone.d.ts +2 -2
- package/dist/components/dropzone.js +1 -1
- package/dist/components/file-input.d.ts +13 -8
- package/dist/components/file-input.js +24 -21
- package/dist/components/filter-chip.d.ts +11 -5
- package/dist/components/filter-chip.js +15 -6
- package/dist/components/floating-stepper.d.ts +11 -28
- package/dist/components/floating-stepper.js +2 -30
- package/dist/components/form-actions.d.ts +37 -15
- package/dist/components/form-actions.js +5 -14
- package/dist/components/heading.d.ts +42 -0
- package/dist/components/heading.js +25 -0
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/image-crop-dialog.d.ts +60 -0
- package/dist/components/image-crop-dialog.js +240 -0
- package/dist/components/image-crop-modal.d.ts +12 -55
- package/dist/components/image-crop-modal.js +2 -249
- package/dist/components/image-upload.d.ts +8 -17
- package/dist/components/image-upload.js +3 -3
- package/dist/components/index.d.ts +15 -10
- package/dist/components/index.js +10 -0
- package/dist/components/internal/bottom-bar.d.ts +30 -0
- package/dist/components/internal/bottom-bar.js +25 -0
- package/dist/components/internal/button.d.ts +1 -1
- package/dist/components/internal/icons.d.ts +9 -1
- package/dist/components/internal/icons.js +16 -0
- package/dist/components/internal/menu.d.ts +3 -2
- package/dist/components/internal/menu.js +1 -1
- package/dist/components/internal/modal.js +9 -0
- package/dist/components/internal/toggle.d.ts +1 -1
- package/dist/components/internal/use-on-screen-keyboard.d.ts +12 -0
- package/dist/components/internal/use-on-screen-keyboard.js +49 -0
- package/dist/components/item.d.ts +14 -7
- package/dist/components/item.js +5 -2
- package/dist/components/loading-overlay.d.ts +43 -0
- package/dist/components/loading-overlay.js +81 -0
- package/dist/components/marker.d.ts +11 -3
- package/dist/components/marker.js +4 -3
- package/dist/components/number-input.d.ts +1 -1
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +2 -2
- package/dist/components/row-actions.d.ts +3 -0
- package/dist/components/row-actions.js +8 -4
- package/dist/components/saving-bar.d.ts +36 -10
- package/dist/components/saving-bar.js +14 -6
- package/dist/components/section-header.d.ts +4 -3
- package/dist/components/selectable-card.d.ts +2 -10
- package/dist/components/sidebar.d.ts +8 -11
- package/dist/components/sidebar.js +4 -5
- package/dist/components/spinner.d.ts +9 -6
- package/dist/components/spinner.js +3 -3
- package/dist/components/star-rating.d.ts +3 -3
- package/dist/components/star-rating.js +2 -2
- package/dist/components/stat.d.ts +18 -6
- package/dist/components/stat.js +9 -3
- package/dist/components/status.d.ts +4 -4
- package/dist/components/status.js +2 -2
- package/dist/components/stepper.d.ts +33 -0
- package/dist/components/stepper.js +36 -0
- package/dist/components/summary-bar.d.ts +3 -2
- package/dist/components/summary-bar.js +10 -1
- package/dist/components/tile.d.ts +5 -5
- package/dist/components/tile.js +2 -2
- package/dist/components/time-picker.d.ts +1 -1
- package/dist/components/toast.d.ts +17 -6
- package/dist/components/toast.js +5 -3
- package/dist/components/toggle-card-compact.d.ts +6 -25
- package/dist/components/toggle-card-compact.js +8 -35
- package/dist/components/toggle-card.d.ts +23 -9
- package/dist/components/toggle-card.js +38 -2
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/typing-indicator.d.ts +2 -2
- package/dist/components/typing-indicator.js +1 -1
- package/package.json +4 -4
- package/styles/base.css +13 -1
- package/styles/rds/components-styles.css +767 -281
- package/styles/rds/components.css +56 -31
- package/styles/rds/foundation.css +1 -1
- package/styles/rds/theme.css +40 -29
- package/styles/rds.css +1 -1
|
@@ -6,50 +6,58 @@ import {
|
|
|
6
6
|
} from "../chunk-ORMEWXMH.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Button } from "./button.js";
|
|
9
|
-
import {
|
|
9
|
+
import { BottomBar } from "./internal/bottom-bar.js";
|
|
10
10
|
import { AlertIcon } from "./internal/icons.js";
|
|
11
11
|
function SavingBar(_a) {
|
|
12
12
|
var _b = _a, {
|
|
13
13
|
status = "unsaved",
|
|
14
14
|
message = "Altera\xE7\xF5es n\xE3o salvas",
|
|
15
15
|
savingMessage = "Salvando\u2026",
|
|
16
|
+
savingLabel = "Salvando\u2026",
|
|
16
17
|
errorMessage = "N\xE3o salvou. Tente de novo.",
|
|
17
18
|
onSave,
|
|
18
19
|
onDiscard,
|
|
19
20
|
saveLabel = "Salvar",
|
|
20
21
|
retryLabel = "Tentar de novo",
|
|
21
22
|
discardLabel = "Descartar",
|
|
23
|
+
placement = "docked",
|
|
24
|
+
leading,
|
|
22
25
|
className
|
|
23
26
|
} = _b, rest = __objRest(_b, [
|
|
24
27
|
"status",
|
|
25
28
|
"message",
|
|
26
29
|
"savingMessage",
|
|
30
|
+
"savingLabel",
|
|
27
31
|
"errorMessage",
|
|
28
32
|
"onSave",
|
|
29
33
|
"onDiscard",
|
|
30
34
|
"saveLabel",
|
|
31
35
|
"retryLabel",
|
|
32
36
|
"discardLabel",
|
|
37
|
+
"placement",
|
|
38
|
+
"leading",
|
|
33
39
|
"className"
|
|
34
40
|
]);
|
|
35
41
|
const saving = status === "saving";
|
|
36
42
|
const error = status === "error";
|
|
43
|
+
const text = saving ? savingMessage : error ? errorMessage : message;
|
|
37
44
|
return /* @__PURE__ */ jsxs(
|
|
38
|
-
|
|
45
|
+
BottomBar,
|
|
39
46
|
__spreadProps(__spreadValues({
|
|
40
47
|
role: "region",
|
|
41
48
|
"aria-label": "Salvar altera\xE7\xF5es"
|
|
42
49
|
}, rest), {
|
|
50
|
+
placement,
|
|
51
|
+
leading,
|
|
43
52
|
className: ["rds-savingbar", className].filter(Boolean).join(" "),
|
|
44
53
|
children: [
|
|
45
54
|
/* @__PURE__ */ jsxs("p", { className: "rds-savingbar__message", role: "status", children: [
|
|
46
|
-
saving && /* @__PURE__ */ jsx("span", { className: "rds-savingbar__icon rds-savingbar__loader", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Loader, {}) }),
|
|
47
55
|
error && /* @__PURE__ */ jsx("span", { className: "rds-savingbar__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(AlertIcon, {}) }),
|
|
48
|
-
/* @__PURE__ */ jsx("span", {
|
|
56
|
+
/* @__PURE__ */ jsx("span", { className: "rds-savingbar__text", children: text })
|
|
49
57
|
] }),
|
|
50
58
|
/* @__PURE__ */ jsxs("div", { className: "rds-savingbar__actions", children: [
|
|
51
|
-
onDiscard && /* @__PURE__ */ jsx(Button, { tone: "
|
|
52
|
-
/* @__PURE__ */ jsx(Button, { tone: "
|
|
59
|
+
onDiscard && /* @__PURE__ */ jsx(Button, { className: "rds-savingbar__discard", tone: "neutral", variant: "ghost", disabled: saving, onClick: onDiscard, children: discardLabel }),
|
|
60
|
+
/* @__PURE__ */ jsx(Button, { tone: "action", variant: "fill", loading: saving, loadingLabel: savingLabel, onClick: onSave, children: saving ? savingLabel : error ? retryLabel : saveLabel })
|
|
53
61
|
] })
|
|
54
62
|
]
|
|
55
63
|
})
|
|
@@ -6,12 +6,13 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
* title, kept because SettingsList composes it and the products still use it. New code uses
|
|
7
7
|
* `<PageHeader titleAs="h2" title description actions />`.
|
|
8
8
|
*
|
|
9
|
-
* action → actions. eyebrow and number (not in the Figma) still render as a line above the
|
|
9
|
+
* action → actions. eyebrow and number are deprecated (not in the Figma); they still render as a line above the
|
|
10
|
+
* title. Styles: section-header.css.
|
|
10
11
|
*/
|
|
11
12
|
interface SectionHeaderProps {
|
|
12
|
-
/**
|
|
13
|
+
/** @deprecated Not in the Figma [RDS] (the SectionHeader pattern): a small uppercase line above the title. */
|
|
13
14
|
eyebrow?: string;
|
|
14
|
-
/**
|
|
15
|
+
/** @deprecated Not in the Figma [RDS]: the section or step number, before the eyebrow ("02 · CONTEÚDO"). */
|
|
15
16
|
number?: string;
|
|
16
17
|
title: string;
|
|
17
18
|
description?: string;
|
|
@@ -5,22 +5,14 @@ import { ReactNode } from 'react';
|
|
|
5
5
|
interface SelectableCardProps {
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
onClick?: () => void;
|
|
8
|
-
/** Ignored: the card is a radio now, never a link. */
|
|
9
|
-
as?: 'button' | 'a';
|
|
10
|
-
/** Ignored: the card is a radio now, never a link. */
|
|
11
|
-
href?: string;
|
|
12
|
-
/** Ignored: the ChoiceCard row always shows its radio. */
|
|
13
|
-
indicator?: 'radio' | 'check' | 'chevron' | 'none';
|
|
14
|
-
/** Ignored: the ChoiceCard has no ribbon. */
|
|
15
|
-
ribbon?: ReactNode;
|
|
16
8
|
disabled?: boolean;
|
|
17
9
|
className?: string;
|
|
18
10
|
children: ReactNode;
|
|
19
11
|
}
|
|
20
12
|
/**
|
|
21
13
|
* @deprecated Use ChoiceCard (Figma [RDS] Content/ChoiceCard, layout="row"). A thin wrapper over it: `children`
|
|
22
|
-
* is the label, `onClick` is `onSelect`. It is a native radio now, not a button
|
|
23
|
-
* `ribbon`
|
|
14
|
+
* is the label, `onClick` is `onSelect`. It is a native radio now, not a button (`as`, `href`, `indicator` and
|
|
15
|
+
* `ribbon` left in 2.0), and a chosen card cannot be un-chosen by clicking it again.
|
|
24
16
|
*/
|
|
25
17
|
declare function SelectableCard({ selected, onClick, disabled, className, children }: SelectableCardProps): react.JSX.Element;
|
|
26
18
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, MouseEventHandler } from 'react';
|
|
3
3
|
|
|
4
|
-
type SidebarTone = 'light' | 'dark';
|
|
5
4
|
type SidebarHeader = 'mark' | 'logo';
|
|
6
5
|
interface SidebarProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
7
6
|
/**
|
|
@@ -19,11 +18,6 @@ interface SidebarProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
|
19
18
|
user?: ReactNode;
|
|
20
19
|
/** 64 wide with only the icons, for a tablet; each entry keeps its name and shows it in a Tooltip. */
|
|
21
20
|
collapsed?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* light (default) or dark (colors/primary; the active entry stays the light pill). dark is deprecated in the
|
|
24
|
-
* Figma since 27/09/2026: for the brand colour, put the Sidebar in a brand-mode scope and keep light.
|
|
25
|
-
*/
|
|
26
|
-
tone?: SidebarTone;
|
|
27
21
|
/** The entries (Figma: the `items` slot): SidebarItem, SidebarSection, SidebarSeparator. */
|
|
28
22
|
children: ReactNode;
|
|
29
23
|
/** The foot, under the user: usually the "Sair" SidebarItem. */
|
|
@@ -32,9 +26,10 @@ interface SidebarProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
|
32
26
|
/**
|
|
33
27
|
* Sidebar — Figma [RDS] Navigation/Sidebar. The product's main navigation, fixed on the left: a <nav> named
|
|
34
28
|
* "Navegação principal" (override with aria-label) with a list; the current entry has aria-current="page".
|
|
35
|
-
*
|
|
29
|
+
* The theme is not a prop: the Sidebar follows its container. For the brand-coloured bar (the old `tone="dark"`),
|
|
30
|
+
* put it inside a `.ds-plate` (the brand mode); for the dark theme, inside `.dark`. Styles: sidebar.css.
|
|
36
31
|
*/
|
|
37
|
-
declare function Sidebar({ header, logo, mark, module, user, collapsed,
|
|
32
|
+
declare function Sidebar({ header, logo, mark, module, user, collapsed, children, footer, className, ...rest }: SidebarProps): react.JSX.Element;
|
|
38
33
|
interface SidebarItemProps {
|
|
39
34
|
/**
|
|
40
35
|
* The entry's name (Figma: `label`). Collapsed, it stays as the accessible name and shows in a Tooltip. With
|
|
@@ -46,7 +41,9 @@ interface SidebarItemProps {
|
|
|
46
41
|
/** A link: where the entry leads. Without `href` nor `asChild`, the entry is a button (Sair). */
|
|
47
42
|
href?: string;
|
|
48
43
|
onClick?: MouseEventHandler<HTMLElement>;
|
|
49
|
-
/** The current page (Figma: `
|
|
44
|
+
/** The current page (Figma: `current`): aria-current="page". Only one at a time. */
|
|
45
|
+
current?: boolean;
|
|
46
|
+
/** @deprecated Use `current` (2.0.0-next). */
|
|
50
47
|
active?: boolean;
|
|
51
48
|
/** A number on the right, such as pending items (Figma: `showCount` + `count`). Hidden when collapsed. */
|
|
52
49
|
count?: number | string;
|
|
@@ -54,7 +51,7 @@ interface SidebarItemProps {
|
|
|
54
51
|
asChild?: boolean;
|
|
55
52
|
}
|
|
56
53
|
/** One entry (Figma: .sidebar/item): 44 tall, icon of 20. */
|
|
57
|
-
declare function SidebarItem({ children, icon, href, onClick, active, count, asChild }: SidebarItemProps): react.JSX.Element;
|
|
54
|
+
declare function SidebarItem({ children, icon, href, onClick, current, active, count, asChild }: SidebarItemProps): react.JSX.Element;
|
|
58
55
|
interface SidebarSectionProps {
|
|
59
56
|
/** The group's name ("Atendimento") (Figma: .sidebar/section `label`). */
|
|
60
57
|
label: string;
|
|
@@ -76,4 +73,4 @@ declare function SidebarSection({ label, children, count, open: openProp, defaul
|
|
|
76
73
|
/** The line between groups of entries. */
|
|
77
74
|
declare function SidebarSeparator(): react.JSX.Element;
|
|
78
75
|
|
|
79
|
-
export { Sidebar, type SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarSeparator
|
|
76
|
+
export { Sidebar, type SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarSeparator };
|
|
@@ -26,7 +26,6 @@ function Sidebar(_a) {
|
|
|
26
26
|
module,
|
|
27
27
|
user,
|
|
28
28
|
collapsed = false,
|
|
29
|
-
tone = "light",
|
|
30
29
|
children,
|
|
31
30
|
footer,
|
|
32
31
|
className
|
|
@@ -37,7 +36,6 @@ function Sidebar(_a) {
|
|
|
37
36
|
"module",
|
|
38
37
|
"user",
|
|
39
38
|
"collapsed",
|
|
40
|
-
"tone",
|
|
41
39
|
"children",
|
|
42
40
|
"footer",
|
|
43
41
|
"className"
|
|
@@ -48,7 +46,7 @@ function Sidebar(_a) {
|
|
|
48
46
|
__spreadProps(__spreadValues({
|
|
49
47
|
"aria-label": "Navega\xE7\xE3o principal"
|
|
50
48
|
}, rest), {
|
|
51
|
-
className: ["rds-sidebar",
|
|
49
|
+
className: ["rds-sidebar", collapsed && "rds-sidebar--collapsed", className].filter(Boolean).join(" "),
|
|
52
50
|
children: [
|
|
53
51
|
/* @__PURE__ */ jsx("div", { className: "rds-sidebar__header", children: header === "logo" ? /* @__PURE__ */ jsx("span", { className: "rds-sidebar__logo", children: logo }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
52
|
/* @__PURE__ */ jsx("span", { className: "rds-sidebar__mark", "aria-hidden": "true", children: mark != null ? mark : /* @__PURE__ */ jsx(Avatar, { type: "brand", size: "sm", fallbackText: module == null ? void 0 : module.charAt(0).toUpperCase() }) }),
|
|
@@ -63,7 +61,8 @@ function Sidebar(_a) {
|
|
|
63
61
|
})
|
|
64
62
|
) });
|
|
65
63
|
}
|
|
66
|
-
function SidebarItem({ children, icon, href, onClick, active, count, asChild }) {
|
|
64
|
+
function SidebarItem({ children, icon, href, onClick, current, active, count, asChild }) {
|
|
65
|
+
const isCurrent = current != null ? current : active;
|
|
67
66
|
const { collapsed } = useContext(SidebarContext);
|
|
68
67
|
const link = asChild && isValidElement(children) ? children : null;
|
|
69
68
|
const label = link ? link.props.children : children;
|
|
@@ -72,7 +71,7 @@ function SidebarItem({ children, icon, href, onClick, active, count, asChild })
|
|
|
72
71
|
/* @__PURE__ */ jsx("span", { className: collapsed ? "rds-visually-hidden" : "rds-sidebar__label", children: label }),
|
|
73
72
|
count !== void 0 && !collapsed && /* @__PURE__ */ jsx("span", { className: "rds-sidebar__count", children: count })
|
|
74
73
|
] });
|
|
75
|
-
const common = { "aria-current":
|
|
74
|
+
const common = { "aria-current": isCurrent ? "page" : void 0, onClick };
|
|
76
75
|
const entry = link ? cloneElement(link, __spreadProps(__spreadValues({}, common), {
|
|
77
76
|
className: ["rds-sidebar__item", link.props.className].filter(Boolean).join(" "),
|
|
78
77
|
children: content
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
type SpinnerSize = 'sm' | '
|
|
5
|
-
type SpinnerTone = '
|
|
4
|
+
type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
type SpinnerTone = 'neutral' | 'inverse';
|
|
6
6
|
interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
7
|
-
/** sm 16 (inside a button or field),
|
|
8
|
-
size?: SpinnerSize;
|
|
9
|
-
/**
|
|
10
|
-
|
|
7
|
+
/** sm 16 (inside a button or field), md 24 (next to text, the default), lg 32 (alone in an empty area). `'default'` is deprecated (2.0.0-next): it is `'md'`. */
|
|
8
|
+
size?: SpinnerSize | 'default';
|
|
9
|
+
/**
|
|
10
|
+
* neutral (default) on light surfaces; inverse on the dark brand band or a dark veil (Figma: `tone`). `'default'`
|
|
11
|
+
* is deprecated (2.0.0-next): it is `'neutral'`.
|
|
12
|
+
*/
|
|
13
|
+
tone?: SpinnerTone | 'default';
|
|
11
14
|
/** What is happening (Figma: `label`). Always the accessible name; shown next to the ring with `showLabel`. */
|
|
12
15
|
label?: string;
|
|
13
16
|
/** Show the label next to the ring (Figma: `showLabel`). */
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
function Spinner(_a) {
|
|
8
8
|
var _b = _a, {
|
|
9
|
-
size = "
|
|
10
|
-
tone = "
|
|
9
|
+
size = "md",
|
|
10
|
+
tone = "neutral",
|
|
11
11
|
label = "Carregando\u2026",
|
|
12
12
|
showLabel = false,
|
|
13
13
|
className
|
|
@@ -23,7 +23,7 @@ function Spinner(_a) {
|
|
|
23
23
|
__spreadProps(__spreadValues({}, rest), {
|
|
24
24
|
role: "status",
|
|
25
25
|
"aria-label": showLabel ? void 0 : label,
|
|
26
|
-
className: ["rds-spinner", `rds-spinner--${size}`, `rds-spinner--${tone}`, className].filter(Boolean).join(" "),
|
|
26
|
+
className: ["rds-spinner", `rds-spinner--${size === "default" ? "md" : size}`, `rds-spinner--${tone === "default" ? "neutral" : tone}`, className].filter(Boolean).join(" "),
|
|
27
27
|
children: [
|
|
28
28
|
/* @__PURE__ */ jsxs("svg", { className: "rds-spinner__ring", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
29
29
|
/* @__PURE__ */ jsx("circle", { className: "rds-spinner__track", cx: "12", cy: "12", r: "10.5", fill: "none", strokeWidth: "3" }),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type StarRatingSize = 'sm' | '
|
|
4
|
+
type StarRatingSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
interface StarRatingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
6
6
|
/** 0 to 5, rounded to the nearest half (Figma: `value`). */
|
|
7
7
|
value: number;
|
|
8
|
-
/** sm: 16 stars and 12 text; default: 20 and 14; lg: 24 and 14 (Figma: `size`). */
|
|
9
|
-
size?: StarRatingSize;
|
|
8
|
+
/** sm: 16 stars and 12 text; md (default): 20 and 14; lg: 24 and 14 (Figma: `size`). `'default'` is deprecated (2.0.0-next): it is `'md'`. */
|
|
9
|
+
size?: StarRatingSize | 'default';
|
|
10
10
|
/**
|
|
11
11
|
* The written grade, such as the value and how many reviews (Figma: `showLabel` + `label`): "4,5 (128
|
|
12
12
|
* avaliações)". Show it: the yellow star alone has too little contrast to be the only cue.
|
|
@@ -7,9 +7,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { StarFilledIcon, StarIcon } from "./internal/icons.js";
|
|
8
8
|
const format = (n) => n.toLocaleString("pt-BR", { maximumFractionDigits: 1 });
|
|
9
9
|
function StarRating(_a) {
|
|
10
|
-
var _b = _a, { value, size = "
|
|
10
|
+
var _b = _a, { value, size = "md", label, className } = _b, rest = __objRest(_b, ["value", "size", "label", "className"]);
|
|
11
11
|
const rounded = Math.round(Math.min(Math.max(value, 0), 5) * 2) / 2;
|
|
12
|
-
return /* @__PURE__ */ jsxs("span", __spreadProps(__spreadValues({}, rest), { className: ["rds-rating", `rds-rating--${size}`, className].filter(Boolean).join(" "), children: [
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", __spreadProps(__spreadValues({}, rest), { className: ["rds-rating", `rds-rating--${size === "default" ? "md" : size}`, className].filter(Boolean).join(" "), children: [
|
|
13
13
|
/* @__PURE__ */ jsx("span", { className: "rds-rating__stars", role: "img", "aria-label": `Nota ${format(rounded)} de 5`, children: [1, 2, 3, 4, 5].map((i) => {
|
|
14
14
|
const fill = rounded >= i ? "full" : rounded >= i - 0.5 ? "half" : "empty";
|
|
15
15
|
return /* @__PURE__ */ jsxs("span", { className: `rds-rating__star rds-rating__star--${fill}`, "aria-hidden": "true", children: [
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* What the number means (Figma: `tone`): neutral (default), money in (success), a loss or a lack (danger), a counter
|
|
6
|
+
* that asks for attention (warning).
|
|
7
|
+
*/
|
|
8
|
+
type StatTone = 'neutral' | 'success' | 'danger' | 'warning';
|
|
9
|
+
/** 2.0.0-next names, deprecated: default → neutral, positive → success, negative → danger. */
|
|
10
|
+
type LegacyStatTone = 'default' | 'positive' | 'negative';
|
|
11
|
+
/** The tone with the deprecated names mapped. */
|
|
12
|
+
declare function statTone(tone: StatTone | LegacyStatTone): StatTone;
|
|
6
13
|
interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
14
|
/** What is counted (Figma: `label`): "Pedidos no mês". */
|
|
8
15
|
label: ReactNode;
|
|
9
16
|
/** The number, already formatted by the caller (Figma: `value`): "1.284", "R$ 48.320". */
|
|
10
17
|
value: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Paints the number (Figma: `tone`). `'default'`, `'positive'` and `'negative'` are deprecated (2.0.0-next): they
|
|
20
|
+
* are neutral, success and danger.
|
|
21
|
+
*/
|
|
22
|
+
tone?: StatTone | LegacyStatTone;
|
|
23
|
+
/** A zero, nothing to see: the number in the muted colour (Figma: `muted`), over the neutral tone. */
|
|
24
|
+
muted?: boolean;
|
|
13
25
|
/** A line under the number (Figma: `showCaption` + `caption`): "vs. 1.142 em agosto". */
|
|
14
26
|
caption?: ReactNode;
|
|
15
27
|
/** The change, a Delta beside the number (Figma: `showDelta` + the exposed Delta). */
|
|
@@ -28,6 +40,6 @@ declare const StatFramedDefault: react.Context<boolean>;
|
|
|
28
40
|
* Stat — Figma [RDS] Content/Stat. A number that matters, with its label, the change (Delta) and, when it helps,
|
|
29
41
|
* the trend (Sparkline). Alone it is a card; in a SummaryBar it is a cell. Styles: stat.css.
|
|
30
42
|
*/
|
|
31
|
-
declare function Stat({ label, value, tone, caption, delta, sparkline, framed, className, ...rest }: StatProps): react.JSX.Element;
|
|
43
|
+
declare function Stat({ label, value, tone, muted, caption, delta, sparkline, framed, className, ...rest }: StatProps): react.JSX.Element;
|
|
32
44
|
|
|
33
|
-
export { Stat, StatFramedDefault, type StatProps, type StatTone };
|
|
45
|
+
export { type LegacyStatTone, Stat, StatFramedDefault, type StatProps, type StatTone, statTone };
|
package/dist/components/stat.js
CHANGED
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
} from "../chunk-ORMEWXMH.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { createContext, useContext } from "react";
|
|
9
|
+
const LEGACY_TONE = { default: "neutral", positive: "success", negative: "danger" };
|
|
10
|
+
function statTone(tone) {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = LEGACY_TONE[tone]) != null ? _a : tone;
|
|
13
|
+
}
|
|
9
14
|
const StatFramedDefault = createContext(true);
|
|
10
15
|
function Stat(_a) {
|
|
11
|
-
var _b = _a, { label, value, tone = "
|
|
16
|
+
var _b = _a, { label, value, tone = "neutral", muted = false, caption, delta, sparkline, framed, className } = _b, rest = __objRest(_b, ["label", "value", "tone", "muted", "caption", "delta", "sparkline", "framed", "className"]);
|
|
12
17
|
const framedDefault = useContext(StatFramedDefault);
|
|
13
18
|
const isFramed = framed != null ? framed : framedDefault;
|
|
14
|
-
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-stat", `rds-stat--${tone}`, isFramed && "rds-stat--framed", className].filter(Boolean).join(" "), children: [
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-stat", `rds-stat--${statTone(tone)}`, muted && "rds-stat--muted", isFramed && "rds-stat--framed", className].filter(Boolean).join(" "), children: [
|
|
15
20
|
/* @__PURE__ */ jsxs("div", { className: "rds-stat__pair", children: [
|
|
16
21
|
/* @__PURE__ */ jsx("span", { className: "rds-stat__label", children: label }),
|
|
17
22
|
/* @__PURE__ */ jsxs("span", { className: "rds-stat__row", children: [
|
|
@@ -25,5 +30,6 @@ function Stat(_a) {
|
|
|
25
30
|
}
|
|
26
31
|
export {
|
|
27
32
|
Stat,
|
|
28
|
-
StatFramedDefault
|
|
33
|
+
StatFramedDefault,
|
|
34
|
+
statTone
|
|
29
35
|
};
|
|
@@ -3,19 +3,19 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
type StatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The emphasis (Figma: `variant`): outline (white pill with a hairline, for coloured bands), soft (light plate
|
|
7
7
|
* with the tone's dark text, for dark backgrounds), fill (the tone's plate, for neutral backgrounds).
|
|
8
8
|
*/
|
|
9
9
|
type StatusVariant = 'outline' | 'soft' | 'fill';
|
|
10
|
-
type StatusSize = '
|
|
10
|
+
type StatusSize = 'md' | 'sm';
|
|
11
11
|
interface StatusProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
12
12
|
/** The state, in one or two words (Figma: `label`). The text says the state; the dot only adds colour. */
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/** neutral (a record: draft, closed), info (in progress), success (done), warning (pending), danger (failed). */
|
|
15
15
|
tone?: StatusTone;
|
|
16
16
|
variant?: StatusVariant;
|
|
17
|
-
/**
|
|
18
|
-
size?: StatusSize;
|
|
17
|
+
/** md 32 tall (default); sm 24 (dot 6), for narrow cards and table rows. `'default'` is deprecated (2.0.0-next): it is `'md'`. */
|
|
18
|
+
size?: StatusSize | 'default';
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Status — Figma [RDS] Indicators/Status. A state that changes over time ("Em análise", "Concluído"): a pill with a
|
|
@@ -8,7 +8,7 @@ function Status(_a) {
|
|
|
8
8
|
var _b = _a, {
|
|
9
9
|
tone = "neutral",
|
|
10
10
|
variant = "outline",
|
|
11
|
-
size = "
|
|
11
|
+
size = "md",
|
|
12
12
|
children,
|
|
13
13
|
className
|
|
14
14
|
} = _b, rest = __objRest(_b, [
|
|
@@ -21,7 +21,7 @@ function Status(_a) {
|
|
|
21
21
|
return /* @__PURE__ */ jsxs(
|
|
22
22
|
"span",
|
|
23
23
|
__spreadProps(__spreadValues({}, rest), {
|
|
24
|
-
className: ["rds-status", `rds-status--${tone}-${variant}`, `rds-status--${size}`, className].filter(Boolean).join(" "),
|
|
24
|
+
className: ["rds-status", `rds-status--${tone}-${variant}`, `rds-status--${size === "default" ? "md" : size}`, className].filter(Boolean).join(" "),
|
|
25
25
|
children: [
|
|
26
26
|
/* @__PURE__ */ jsx("span", { className: "rds-status__dot", "aria-hidden": "true" }),
|
|
27
27
|
children
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Stepper — a composition of the Card (as a pill) and Buttons (Figma [RDS] Actions/Button, neutral): the
|
|
6
|
+
* floating steps of a flow (point of sale, checkout). The current step is the filled Button (aria-current="step");
|
|
7
|
+
* earlier steps go back, later ones are disabled; `canNavigate` changes the rule. `action` is a last Button after
|
|
8
|
+
* a vertical Separator (Reset). Where it floats is the caller's (className or a wrapper). Styles: stepper.css.
|
|
9
|
+
*/
|
|
10
|
+
type StepperStep = {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
interface StepperProps {
|
|
15
|
+
steps: StepperStep[];
|
|
16
|
+
/** key da etapa atual */
|
|
17
|
+
current: string;
|
|
18
|
+
onNavigate?: (key: string) => void;
|
|
19
|
+
/** Regra de navegação por etapa. Default: só etapas anteriores à atual. */
|
|
20
|
+
canNavigate?: (key: string, index: number, currentIndex: number) => boolean;
|
|
21
|
+
/** Ação à direita, separada por divisor (ex.: Reset). */
|
|
22
|
+
action?: {
|
|
23
|
+
label: string;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
};
|
|
27
|
+
className?: string;
|
|
28
|
+
/** The navigation's name. Default "Etapas". */
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function Stepper({ steps, current, onNavigate, canNavigate, action, className, 'aria-label': ariaLabel }: StepperProps): react.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { Stepper, type StepperProps, type StepperStep };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Card } from "./card.js";
|
|
6
|
+
import { Separator } from "./separator.js";
|
|
7
|
+
function Stepper({ steps, current, onNavigate, canNavigate, action, className, "aria-label": ariaLabel = "Etapas" }) {
|
|
8
|
+
const currentIdx = steps.findIndex((s) => s.key === current);
|
|
9
|
+
return /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", role: "navigation", "aria-label": ariaLabel, className: ["rds-stepper", className].filter(Boolean).join(" "), children: [
|
|
10
|
+
steps.map((s, idx) => {
|
|
11
|
+
const isCurrent = idx === currentIdx;
|
|
12
|
+
const canGo = canNavigate ? canNavigate(s.key, idx, currentIdx) : idx < currentIdx;
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Button,
|
|
15
|
+
{
|
|
16
|
+
tone: "neutral",
|
|
17
|
+
variant: isCurrent ? "fill" : "ghost",
|
|
18
|
+
disabled: !canGo && !isCurrent,
|
|
19
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
20
|
+
onClick: () => {
|
|
21
|
+
if (canGo && !isCurrent) onNavigate == null ? void 0 : onNavigate(s.key);
|
|
22
|
+
},
|
|
23
|
+
children: s.label
|
|
24
|
+
},
|
|
25
|
+
s.key
|
|
26
|
+
);
|
|
27
|
+
}),
|
|
28
|
+
action && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "rds-stepper__divider" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Button, { tone: "neutral", variant: "ghost", icon: action.icon, onClick: action.onClick, children: action.label })
|
|
31
|
+
] })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
Stepper
|
|
36
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { StatTone } from './stat.js';
|
|
3
|
+
import { StatTone, LegacyStatTone } from './stat.js';
|
|
4
4
|
|
|
5
5
|
/** @deprecated Use StatTone. */
|
|
6
6
|
type SummaryBarTone = StatTone;
|
|
@@ -8,7 +8,8 @@ type SummaryBarTone = StatTone;
|
|
|
8
8
|
interface SummaryBarItem {
|
|
9
9
|
label: string;
|
|
10
10
|
value: string;
|
|
11
|
-
tone
|
|
11
|
+
/** `'muted'` (the 2.0.0-next tone) is the Stat's `muted`. */
|
|
12
|
+
tone?: StatTone | LegacyStatTone | 'muted';
|
|
12
13
|
/** Ignored: the Stat has no icon in the Figma [RDS]. */
|
|
13
14
|
icon?: ReactNode;
|
|
14
15
|
}
|
|
@@ -9,7 +9,16 @@ import { Children } from "react";
|
|
|
9
9
|
import { Stat, StatFramedDefault } from "./stat.js";
|
|
10
10
|
function SummaryBar(_a) {
|
|
11
11
|
var _b = _a, { children, layout = "row", items, className } = _b, rest = __objRest(_b, ["children", "layout", "items", "className"]);
|
|
12
|
-
const cells = items ? items.map((item, i) => /* @__PURE__ */ jsx(
|
|
12
|
+
const cells = items ? items.map((item, i) => /* @__PURE__ */ jsx(
|
|
13
|
+
Stat,
|
|
14
|
+
{
|
|
15
|
+
label: item.label,
|
|
16
|
+
value: item.value,
|
|
17
|
+
tone: item.tone === "muted" ? void 0 : item.tone,
|
|
18
|
+
muted: item.tone === "muted"
|
|
19
|
+
},
|
|
20
|
+
i
|
|
21
|
+
)) : Children.toArray(children);
|
|
13
22
|
return /* @__PURE__ */ jsx(StatFramedDefault.Provider, { value: false, children: /* @__PURE__ */ jsx("ul", __spreadProps(__spreadValues({}, rest), { className: ["rds-summary-bar", `rds-summary-bar--${layout}`, className].filter(Boolean).join(" "), children: cells.map((cell, i) => /* @__PURE__ */ jsx("li", { className: "rds-summary-bar__cell", children: cell }, i)) })) });
|
|
14
23
|
}
|
|
15
24
|
export {
|
|
@@ -2,18 +2,18 @@ import * as react from 'react';
|
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type TileTone = 'action' | 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
|
-
/**
|
|
5
|
+
/** The emphasis (Figma: `variant`). */
|
|
6
6
|
type TileVariant = 'fill' | 'soft';
|
|
7
|
-
type TileSize = 'sm' | '
|
|
7
|
+
type TileSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
interface TileProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
9
9
|
/** The icon (Figma: `icon`), an inline SVG. The Tile sizes it: 16, 24 or 32. */
|
|
10
10
|
icon: ReactNode;
|
|
11
11
|
/** action is the brand; the others follow feedback: success only for what went right, danger for what went wrong. */
|
|
12
12
|
tone?: TileTone;
|
|
13
|
-
/** fill is strong; soft is light, with the icon in the tone's colour (Figma: `
|
|
13
|
+
/** fill is strong; soft is light, with the icon in the tone's colour (Figma: `variant`). Same variant across a list. */
|
|
14
14
|
variant?: TileVariant;
|
|
15
|
-
/** sm 32,
|
|
16
|
-
size?: TileSize;
|
|
15
|
+
/** sm 32, md 48 (default), lg 64 (Figma: `size`). `'default'` is deprecated (2.0.0-next): it is `'md'`. */
|
|
16
|
+
size?: TileSize | 'default';
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Tile — Figma [RDS] Content/Tile. An icon with weight, in a circle: a benefit in a list, a card's header, the top
|
package/dist/components/tile.js
CHANGED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
function Tile(_a) {
|
|
8
|
-
var _b = _a, { icon, tone = "action", variant = "fill", size = "
|
|
8
|
+
var _b = _a, { icon, tone = "action", variant = "fill", size = "md", className } = _b, rest = __objRest(_b, ["icon", "tone", "variant", "size", "className"]);
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
10
10
|
"span",
|
|
11
11
|
__spreadProps(__spreadValues({
|
|
12
12
|
"aria-hidden": "true"
|
|
13
13
|
}, rest), {
|
|
14
|
-
className: ["rds-tile", `rds-tile--${tone}-${variant}`, `rds-tile--${size}`, className].filter(Boolean).join(" "),
|
|
14
|
+
className: ["rds-tile", `rds-tile--${tone}-${variant}`, `rds-tile--${size === "default" ? "md" : size}`, className].filter(Boolean).join(" "),
|
|
15
15
|
children: icon
|
|
16
16
|
})
|
|
17
17
|
);
|
|
@@ -38,7 +38,7 @@ declare function parseTime(text: string): string | null;
|
|
|
38
38
|
declare function formatTime(time: string, format?: TimeFormat): string;
|
|
39
39
|
/**
|
|
40
40
|
* TimePicker — Figma [RDS] Forms/TimePicker. A time field that takes typing (HH:mm, the colon comes by itself) and
|
|
41
|
-
* opens the list of times in the chosen step (Figma:
|
|
41
|
+
* opens the list of times in the chosen step (Figma: open=true). It is the Input with the clock at the end and the
|
|
42
42
|
* Listbox under it (ARIA combobox), as the DatePicker is the Input with the Calendar: the focus stays in the field,
|
|
43
43
|
* the arrows walk the list, Enter chooses and Escape closes without changing. No tokens of its own (--input-*,
|
|
44
44
|
* --listbox-*). A date is the DatePicker; a duration, the NumberInput. Styles: time-picker.css,
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type ToastTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
|
-
/**
|
|
5
|
+
/** The emphasis (Figma: `variant`): outline (white with a border, the default), soft (light plate), fill (full plate). */
|
|
6
6
|
type ToastVariant = 'outline' | 'soft' | 'fill';
|
|
7
7
|
interface ToastOptions {
|
|
8
8
|
/** What happened, in a few words (Figma: `title`). */
|
|
@@ -14,12 +14,18 @@ interface ToastOptions {
|
|
|
14
14
|
variant?: ToastVariant;
|
|
15
15
|
/** The tone's icon (Figma: `showIcon`). Decorative. */
|
|
16
16
|
showIcon?: boolean;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* One action (Figma: `showAction`): "Desfazer", "Ver". A toast with an action does not close by itself (WCAG 2.2.1,
|
|
19
|
+
* Timing Adjustable): it stays until the person uses the action or the ×. Choosing the action also closes it.
|
|
20
|
+
*/
|
|
18
21
|
action?: {
|
|
19
22
|
label: string;
|
|
20
23
|
onClick: () => void;
|
|
21
24
|
};
|
|
22
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* ms on screen. Default 5 s; `Infinity` (until closed) with an action. It pauses while the mouse or the focus is on
|
|
27
|
+
* it. A number given here wins, also with an action: give one only when the action can be reached some other way.
|
|
28
|
+
*/
|
|
23
29
|
duration?: number;
|
|
24
30
|
/** Give the same id to replace a toast that is on screen instead of stacking another one. */
|
|
25
31
|
id?: string;
|
|
@@ -50,14 +56,19 @@ declare function useToast(): ToastFn;
|
|
|
50
56
|
interface ToasterProps {
|
|
51
57
|
/** The region's name, said with the F8 shortcut that takes the focus to it. */
|
|
52
58
|
label?: string;
|
|
59
|
+
/** The ×'s accessible name (and its Tooltip), on every toast. Default "Fechar". */
|
|
60
|
+
closeLabel?: string;
|
|
53
61
|
/** The app, when the Toaster wraps it. It can also be mounted alone, once, anywhere on the page. */
|
|
54
62
|
children?: ReactNode;
|
|
55
63
|
}
|
|
64
|
+
/** @internal How long a toast stays: 5 s, or until closed when it has an action (WCAG 2.2.1). */
|
|
65
|
+
declare const toastDuration: (duration: number | undefined, hasAction: boolean) => number;
|
|
56
66
|
/**
|
|
57
67
|
* Toaster — the region where the toasts of the Figma [RDS] Feedback/Toast appear (Radix Toast): the bottom-right
|
|
58
68
|
* corner, up to three at a time (a fourth pushes the oldest out), each one announced in a live region (danger
|
|
59
|
-
* assertively, the others politely). F8 takes the focus to the region; swiping right dismisses.
|
|
69
|
+
* assertively, the others politely). F8 takes the focus to the region; swiping right dismisses. A toast closes by
|
|
70
|
+
* itself after 5 s; one with an action stays until the action or the × (WCAG 2.2.1). Styles: toast.css.
|
|
60
71
|
*/
|
|
61
|
-
declare function Toaster({ label, children }: ToasterProps): react.JSX.Element;
|
|
72
|
+
declare function Toaster({ label, closeLabel, children }: ToasterProps): react.JSX.Element;
|
|
62
73
|
|
|
63
|
-
export { type ToastFn, type ToastOptions, type ToastTone, type ToastVariant, ToastView, type ToastViewProps, Toaster, type ToasterProps, toast, toastClassName, useToast };
|
|
74
|
+
export { type ToastFn, type ToastOptions, type ToastTone, type ToastVariant, ToastView, type ToastViewProps, Toaster, type ToasterProps, toast, toastClassName, toastDuration, useToast };
|