@rojaostudio/ds 2.0.0-next.3 → 2.0.0-next.31
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 +45 -15
- package/dist/components/form-actions.js +33 -12
- 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 +33 -0
- package/dist/components/internal/bottom-bar.js +64 -0
- package/dist/components/internal/button.d.ts +1 -1
- package/dist/components/internal/icons.d.ts +11 -1
- package/dist/components/internal/icons.js +23 -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 +38 -10
- package/dist/components/saving-bar.js +30 -7
- 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 +21 -8
- 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 +799 -266
- package/styles/rds/components.css +57 -31
- package/styles/rds/foundation.css +1 -1
- package/styles/rds/theme.css +40 -29
- package/styles/rds.css +1 -1
|
@@ -1,33 +1,61 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { BottomBarPlacement } from './internal/bottom-bar.js';
|
|
3
4
|
|
|
4
5
|
type SavingBarStatus = 'unsaved' | 'saving' | 'error';
|
|
6
|
+
type SavingBarPlacement = BottomBarPlacement;
|
|
5
7
|
interface SavingBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
8
|
/**
|
|
7
|
-
* unsaved: the message and the actions; saving:
|
|
8
|
-
* error: an alert, `errorMessage`, and Salvar
|
|
9
|
+
* unsaved: the message and the actions; saving: `savingMessage`, Salvar in loading (`savingLabel`, the only
|
|
10
|
+
* indicator, no loader in the message) and Descartar disabled; error: an alert, `errorMessage`, and Salvar
|
|
11
|
+
* becomes `retryLabel` (Figma: `status`).
|
|
9
12
|
*/
|
|
10
13
|
status?: SavingBarStatus;
|
|
11
|
-
/** The unsaved text (Figma: `message`). */
|
|
14
|
+
/** The unsaved text, at most 2 lines with an ellipsis (Figma: `message`). */
|
|
12
15
|
message?: ReactNode;
|
|
13
16
|
/** The text while saving. */
|
|
14
17
|
savingMessage?: ReactNode;
|
|
18
|
+
/** Salvar's label while saving, in loading (`<Button loading>`), also announced. */
|
|
19
|
+
savingLabel?: string;
|
|
15
20
|
/** The error text. */
|
|
16
21
|
errorMessage?: ReactNode;
|
|
17
22
|
/** Called by Salvar (and by Tentar de novo, on error). */
|
|
18
23
|
onSave: () => void;
|
|
19
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Shows Descartar and is called when it is pressed (Figma: `showDiscard`). Expanded, a Button (tone neutral,
|
|
26
|
+
* ghost); compact (the phone), an IconButton with the undo icon (undo-2), named `discardLabel`. Disabled while
|
|
27
|
+
* saving, in both.
|
|
28
|
+
*/
|
|
20
29
|
onDiscard?: () => void;
|
|
21
30
|
saveLabel?: string;
|
|
22
31
|
retryLabel?: string;
|
|
23
32
|
discardLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* docked (default: the container's width, against the foot) or floating (from 1024 up: in the bottom right corner,
|
|
35
|
+
* 24 off the foot and the right, hugging its content but at least 320 wide, rounded, the overlay shadow). Below 1024
|
|
36
|
+
* floating is docked (Figma: `placement`).
|
|
37
|
+
*/
|
|
38
|
+
placement?: SavingBarPlacement;
|
|
39
|
+
/**
|
|
40
|
+
* One ~44 control on the left of the message, never running text (Figma: slot `leading`, `showLeading`). Present,
|
|
41
|
+
* even `null` while its control is hidden, it reserves 44 so the message and the buttons do not jump. Whoever fills
|
|
42
|
+
* it says its own changes (its own aria-live); the bar does not repeat them.
|
|
43
|
+
*/
|
|
44
|
+
leading?: ReactNode;
|
|
24
45
|
}
|
|
25
46
|
/**
|
|
26
|
-
* SavingBar — Figma [RDS] Actions/SavingBar. Shows at the foot of the screen while a change is not
|
|
27
|
-
* saved
|
|
28
|
-
*
|
|
29
|
-
*
|
|
47
|
+
* SavingBar — Figma [RDS] Actions/SavingBar. Shows at the foot of the screen while a change is not saved, and leaves
|
|
48
|
+
* once saved (a Toast confirms). Built on the private BottomBar (.rds-bottom-bar), the FormActions' shell: the brand's
|
|
49
|
+
* primary colour (bottom-bar/background) in light, dark and every brand, 64 plus the safe area compact, 68 expanded,
|
|
50
|
+
* 24 at the sides, sticky at the bottom of the scrolling container. Its Buttons are Salvar in tone action fill and
|
|
51
|
+
* Descartar in tone neutral ghost, with the bar's colours (bottom-bar/button/*). Below 1024 (compact, the phone) it is
|
|
52
|
+
* one row: the message on the left, Descartar as an IconButton with the undo icon (aria-label `discardLabel`) and
|
|
53
|
+
* Salvar on the right. While
|
|
54
|
+
* saving, the indicator is Salvar in loading, alone (with the LoadingOverlay too). On the phone it leaves while the
|
|
55
|
+
* on-screen keyboard is open and comes back on blur, never taking the focus. The content needs room below as tall as
|
|
56
|
+
* the bar (`scroll-padding-bottom`, plus `env(safe-area-inset-bottom)`). Styles: saving-bar.css,
|
|
57
|
+
* internal/bottom-bar.css.
|
|
30
58
|
*/
|
|
31
|
-
declare function SavingBar({ status, message, savingMessage, errorMessage, onSave, onDiscard, saveLabel, retryLabel, discardLabel, className, ...rest }: SavingBarProps): react.JSX.Element;
|
|
59
|
+
declare function SavingBar({ status, message, savingMessage, savingLabel, errorMessage, onSave, onDiscard, saveLabel, retryLabel, discardLabel, placement, leading, className, ...rest }: SavingBarProps): react.JSX.Element;
|
|
32
60
|
|
|
33
|
-
export { SavingBar, type SavingBarProps, type SavingBarStatus };
|
|
61
|
+
export { SavingBar, type SavingBarPlacement, type SavingBarProps, type SavingBarStatus };
|
|
@@ -6,50 +6,73 @@ 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 {
|
|
10
|
-
import {
|
|
9
|
+
import { IconButton } from "./icon-button.js";
|
|
10
|
+
import { BottomBar } from "./internal/bottom-bar.js";
|
|
11
|
+
import { AlertIcon, Undo2Icon } from "./internal/icons.js";
|
|
12
|
+
import { Tooltip } from "./tooltip.js";
|
|
11
13
|
function SavingBar(_a) {
|
|
12
14
|
var _b = _a, {
|
|
13
15
|
status = "unsaved",
|
|
14
16
|
message = "Altera\xE7\xF5es n\xE3o salvas",
|
|
15
17
|
savingMessage = "Salvando\u2026",
|
|
18
|
+
savingLabel = "Salvando\u2026",
|
|
16
19
|
errorMessage = "N\xE3o salvou. Tente de novo.",
|
|
17
20
|
onSave,
|
|
18
21
|
onDiscard,
|
|
19
22
|
saveLabel = "Salvar",
|
|
20
23
|
retryLabel = "Tentar de novo",
|
|
21
24
|
discardLabel = "Descartar",
|
|
25
|
+
placement = "docked",
|
|
26
|
+
leading,
|
|
22
27
|
className
|
|
23
28
|
} = _b, rest = __objRest(_b, [
|
|
24
29
|
"status",
|
|
25
30
|
"message",
|
|
26
31
|
"savingMessage",
|
|
32
|
+
"savingLabel",
|
|
27
33
|
"errorMessage",
|
|
28
34
|
"onSave",
|
|
29
35
|
"onDiscard",
|
|
30
36
|
"saveLabel",
|
|
31
37
|
"retryLabel",
|
|
32
38
|
"discardLabel",
|
|
39
|
+
"placement",
|
|
40
|
+
"leading",
|
|
33
41
|
"className"
|
|
34
42
|
]);
|
|
35
43
|
const saving = status === "saving";
|
|
36
44
|
const error = status === "error";
|
|
45
|
+
const text = saving ? savingMessage : error ? errorMessage : message;
|
|
37
46
|
return /* @__PURE__ */ jsxs(
|
|
38
|
-
|
|
47
|
+
BottomBar,
|
|
39
48
|
__spreadProps(__spreadValues({
|
|
40
49
|
role: "region",
|
|
41
50
|
"aria-label": "Salvar altera\xE7\xF5es"
|
|
42
51
|
}, rest), {
|
|
52
|
+
placement,
|
|
53
|
+
leading,
|
|
43
54
|
className: ["rds-savingbar", className].filter(Boolean).join(" "),
|
|
44
55
|
children: [
|
|
45
56
|
/* @__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
57
|
error && /* @__PURE__ */ jsx("span", { className: "rds-savingbar__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(AlertIcon, {}) }),
|
|
48
|
-
/* @__PURE__ */ jsx("span", {
|
|
58
|
+
/* @__PURE__ */ jsx("span", { className: "rds-savingbar__text", children: text })
|
|
49
59
|
] }),
|
|
50
60
|
/* @__PURE__ */ jsxs("div", { className: "rds-savingbar__actions", children: [
|
|
51
|
-
onDiscard && /* @__PURE__ */ jsx(Button, { tone: "
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
61
|
+
onDiscard && /* @__PURE__ */ jsx(Button, { className: "rds-savingbar__discard", tone: "neutral", variant: "ghost", disabled: saving, onClick: onDiscard, children: discardLabel }),
|
|
62
|
+
onDiscard && /* @__PURE__ */ jsx(Tooltip, { text: discardLabel, children: /* @__PURE__ */ jsx(
|
|
63
|
+
IconButton,
|
|
64
|
+
{
|
|
65
|
+
className: "rds-savingbar__discard-icon",
|
|
66
|
+
icon: /* @__PURE__ */ jsx(Undo2Icon, {}),
|
|
67
|
+
label: discardLabel,
|
|
68
|
+
tone: "neutral",
|
|
69
|
+
variant: "ghost",
|
|
70
|
+
size: "md",
|
|
71
|
+
disabled: saving,
|
|
72
|
+
onClick: onDiscard
|
|
73
|
+
}
|
|
74
|
+
) }),
|
|
75
|
+
/* @__PURE__ */ jsx(Button, { tone: "action", variant: "fill", loading: saving, loadingLabel: savingLabel, onClick: onSave, children: saving ? savingLabel : error ? retryLabel : saveLabel })
|
|
53
76
|
] })
|
|
54
77
|
]
|
|
55
78
|
})
|
|
@@ -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
|