@rojaostudio/ds 2.0.0-next.16 → 2.0.0-next.18
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/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 +18 -9
- package/dist/components/card.js +4 -2
- package/dist/components/color-input.d.ts +1 -1
- package/dist/components/context-menu.d.ts +5 -2
- package/dist/components/data-table-header.d.ts +10 -5
- package/dist/components/data-table-header.js +59 -4
- 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/heading.d.ts +9 -6
- package/dist/components/heading.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/image-upload.d.ts +2 -2
- package/dist/components/image-upload.js +1 -1
- package/dist/components/index.d.ts +6 -6
- package/dist/components/internal/button.d.ts +1 -1
- package/dist/components/internal/menu.d.ts +3 -2
- package/dist/components/internal/menu.js +1 -1
- package/dist/components/internal/toggle.d.ts +1 -1
- package/dist/components/item.d.ts +14 -7
- package/dist/components/item.js +5 -2
- package/dist/components/marker.d.ts +11 -3
- package/dist/components/marker.js +4 -3
- 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/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/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 +1 -1
- 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 +1 -1
- package/styles/rds/components-styles.css +84 -48
- package/styles/rds/components.css +0 -9
|
@@ -13,10 +13,14 @@ function RowActions({
|
|
|
13
13
|
items = [],
|
|
14
14
|
dangerSeparator
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
16
|
+
const isDanger = (i) => {
|
|
17
|
+
var _a;
|
|
18
|
+
return ((_a = i.tone) != null ? _a : i.variant) === "danger";
|
|
19
|
+
};
|
|
20
|
+
const hasDanger = items.some(isDanger);
|
|
17
21
|
const showSep = dangerSeparator != null ? dangerSeparator : hasDanger;
|
|
18
|
-
const normalItems = showSep ? items.filter((i) => i
|
|
19
|
-
const dangerItems = showSep ? items.filter(
|
|
22
|
+
const normalItems = showSep ? items.filter((i) => !isDanger(i)) : items;
|
|
23
|
+
const dangerItems = showSep ? items.filter(isDanger) : [];
|
|
20
24
|
return /* @__PURE__ */ jsxs("div", { className: "rds-row-actions", children: [
|
|
21
25
|
primaryHref ? /* @__PURE__ */ jsx(Button, { asChild: true, variant: "outline", tone: "neutral", children: /* @__PURE__ */ jsx("a", { href: primaryHref, onClick: (e) => e.stopPropagation(), children: primaryLabel }) }) : primaryOnClick ? /* @__PURE__ */ jsx(
|
|
22
26
|
Button,
|
|
@@ -48,7 +52,7 @@ function RowActions({
|
|
|
48
52
|
DropdownMenuItem,
|
|
49
53
|
{
|
|
50
54
|
icon: item.icon,
|
|
51
|
-
tone: item
|
|
55
|
+
tone: isDanger(item) ? "danger" : "neutral",
|
|
52
56
|
disabled: item.disabled,
|
|
53
57
|
onSelect: item.onClick,
|
|
54
58
|
children: item.label
|
|
@@ -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
|
|
@@ -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`). */
|
|
@@ -8,7 +8,7 @@ interface ToggleProps extends Omit<ComponentPropsWithRef<typeof TogglePrimitive.
|
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
/** Icon before the text (Figma: `showIcon` + `iconName`). Decorative, rendered with aria-hidden. */
|
|
10
10
|
icon?: ReactNode;
|
|
11
|
-
/** The emphasis (Figma: `
|
|
11
|
+
/** The emphasis (Figma: `variant`): ghost in a toolbar, outline when it stands alone. */
|
|
12
12
|
variant?: ToggleVariant;
|
|
13
13
|
/** Rendered as aria-disabled="true": stays in the tab order and takes focus, but does not toggle. */
|
|
14
14
|
disabled?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
|
-
/** @deprecated Use Bubble with
|
|
3
|
+
/** @deprecated Use Bubble with `typing`. */
|
|
4
4
|
interface TypingIndicatorProps {
|
|
5
5
|
/** What a screen reader hears. Default "Digitando". */
|
|
6
6
|
ariaLabel?: string;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* @deprecated Use `<Bubble
|
|
9
|
+
* @deprecated Use `<Bubble typing />` (Figma [RDS] Chat/Bubble, typing=true). A thin wrapper over it: the
|
|
10
10
|
* label becomes the bubble's announcement.
|
|
11
11
|
*/
|
|
12
12
|
declare function TypingIndicator({ ariaLabel }: TypingIndicatorProps): react.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import "../chunk-ORMEWXMH.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Bubble } from "./bubble.js";
|
|
4
4
|
function TypingIndicator({ ariaLabel = "Digitando" }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(Bubble, {
|
|
5
|
+
return /* @__PURE__ */ jsx(Bubble, { typing: true, align: "start", children: ariaLabel });
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
TypingIndicator
|
package/package.json
CHANGED