@rojaostudio/ds 2.0.0-next.2 → 2.0.0-next.21

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.
Files changed (101) hide show
  1. package/README.md +42 -2
  2. package/THIRD_PARTY_NOTICES.md +66 -0
  3. package/dist/components/avatar.d.ts +20 -12
  4. package/dist/components/avatar.js +8 -6
  5. package/dist/components/badge.d.ts +7 -6
  6. package/dist/components/badge.js +2 -1
  7. package/dist/components/breadcrumb.d.ts +4 -4
  8. package/dist/components/breadcrumb.js +1 -1
  9. package/dist/components/bubble.d.ts +26 -11
  10. package/dist/components/bubble.js +3 -3
  11. package/dist/components/button.d.ts +1 -1
  12. package/dist/components/card.d.ts +28 -12
  13. package/dist/components/card.js +4 -2
  14. package/dist/components/chart.d.ts +17 -3
  15. package/dist/components/chart.js +70 -24
  16. package/dist/components/choice-carousel.d.ts +1 -1
  17. package/dist/components/choice-carousel.js +2 -4
  18. package/dist/components/choice-list.d.ts +40 -0
  19. package/dist/components/choice-list.js +122 -0
  20. package/dist/components/choice-preview-card.d.ts +1 -7
  21. package/dist/components/color-input.d.ts +1 -1
  22. package/dist/components/context-menu.d.ts +5 -2
  23. package/dist/components/currency-input.d.ts +0 -2
  24. package/dist/components/data-table-header.d.ts +34 -16
  25. package/dist/components/data-table-header.js +132 -67
  26. package/dist/components/date-picker.d.ts +1 -1
  27. package/dist/components/dialog.d.ts +6 -3
  28. package/dist/components/dialog.js +2 -2
  29. package/dist/components/dropdown-menu.d.ts +5 -2
  30. package/dist/components/dropzone.d.ts +2 -2
  31. package/dist/components/dropzone.js +1 -1
  32. package/dist/components/file-input.d.ts +13 -8
  33. package/dist/components/file-input.js +24 -21
  34. package/dist/components/filter-chip.d.ts +11 -5
  35. package/dist/components/filter-chip.js +15 -6
  36. package/dist/components/floating-stepper.d.ts +11 -28
  37. package/dist/components/floating-stepper.js +2 -30
  38. package/dist/components/heading.d.ts +42 -0
  39. package/dist/components/heading.js +25 -0
  40. package/dist/components/icon-button.d.ts +1 -1
  41. package/dist/components/image-crop-dialog.d.ts +60 -0
  42. package/dist/components/image-crop-dialog.js +240 -0
  43. package/dist/components/image-crop-modal.d.ts +12 -55
  44. package/dist/components/image-crop-modal.js +2 -249
  45. package/dist/components/image-upload.d.ts +8 -17
  46. package/dist/components/image-upload.js +3 -3
  47. package/dist/components/index.d.ts +11 -8
  48. package/dist/components/index.js +8 -0
  49. package/dist/components/internal/button.d.ts +1 -1
  50. package/dist/components/internal/icons.d.ts +11 -1
  51. package/dist/components/internal/icons.js +20 -0
  52. package/dist/components/internal/menu.d.ts +3 -2
  53. package/dist/components/internal/menu.js +1 -1
  54. package/dist/components/internal/modal.js +9 -0
  55. package/dist/components/internal/toggle.d.ts +1 -1
  56. package/dist/components/item.d.ts +14 -7
  57. package/dist/components/item.js +5 -2
  58. package/dist/components/marker.d.ts +11 -3
  59. package/dist/components/marker.js +4 -3
  60. package/dist/components/number-input.d.ts +1 -1
  61. package/dist/components/progress.d.ts +3 -3
  62. package/dist/components/progress.js +2 -2
  63. package/dist/components/row-actions.d.ts +3 -0
  64. package/dist/components/row-actions.js +8 -4
  65. package/dist/components/saving-bar.d.ts +16 -4
  66. package/dist/components/saving-bar.js +37 -9
  67. package/dist/components/section-header.d.ts +4 -3
  68. package/dist/components/selectable-card.d.ts +2 -10
  69. package/dist/components/sidebar.d.ts +8 -11
  70. package/dist/components/sidebar.js +4 -5
  71. package/dist/components/spinner.d.ts +9 -6
  72. package/dist/components/spinner.js +3 -3
  73. package/dist/components/star-rating.d.ts +3 -3
  74. package/dist/components/star-rating.js +2 -2
  75. package/dist/components/stat.d.ts +18 -6
  76. package/dist/components/stat.js +9 -3
  77. package/dist/components/status.d.ts +4 -4
  78. package/dist/components/status.js +2 -2
  79. package/dist/components/stepper.d.ts +33 -0
  80. package/dist/components/stepper.js +36 -0
  81. package/dist/components/summary-bar.d.ts +3 -2
  82. package/dist/components/summary-bar.js +10 -1
  83. package/dist/components/tile.d.ts +5 -5
  84. package/dist/components/tile.js +2 -2
  85. package/dist/components/time-picker.d.ts +1 -1
  86. package/dist/components/toast.d.ts +17 -6
  87. package/dist/components/toast.js +5 -3
  88. package/dist/components/toggle-card-compact.d.ts +6 -25
  89. package/dist/components/toggle-card-compact.js +8 -35
  90. package/dist/components/toggle-card.d.ts +23 -9
  91. package/dist/components/toggle-card.js +38 -2
  92. package/dist/components/toggle.d.ts +1 -1
  93. package/dist/components/typing-indicator.d.ts +2 -2
  94. package/dist/components/typing-indicator.js +1 -1
  95. package/package.json +4 -4
  96. package/styles/base.css +13 -1
  97. package/styles/rds/components-styles.css +611 -173
  98. package/styles/rds/components.css +40 -25
  99. package/styles/rds/foundation.css +1 -1
  100. package/styles/rds/theme.css +40 -29
  101. package/styles/rds.css +1 -1
@@ -1,8 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
- type ItemVariant = 'default' | 'outline' | 'muted';
5
- type ItemSize = 'default' | 'sm';
4
+ /** The emphasis (Figma: `variant`). */
5
+ type ItemVariant = 'ghost' | 'outline' | 'soft';
6
+ type ItemSize = 'md' | 'sm';
6
7
  interface ItemProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
7
8
  /** The thing's name (Figma: `title`). */
8
9
  title: ReactNode;
@@ -12,10 +13,16 @@ interface ItemProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
12
13
  media?: ReactNode;
13
14
  /** One action or control on the right (Figma: `showAction` + `action`): a ghost Button, an IconButton, a Switch. */
14
15
  action?: ReactNode;
15
- /** default: loose in the list, a line between rows; outline: each row a block; muted: a background, no border. */
16
- variant?: ItemVariant;
17
- /** sm for dense lists: 14 and 12 text, 8 12 padding. */
18
- size?: ItemSize;
16
+ /**
17
+ * ghost (default): loose in the list, a line between rows; outline: each row a block; soft: a background, no
18
+ * border (Figma: `variant`). `'default'` and `'muted'` are deprecated (2.0.0-next): they are ghost and soft.
19
+ */
20
+ variant?: ItemVariant | 'default' | 'muted';
21
+ /**
22
+ * md (default) or sm for dense lists: 14 and 12 text, 8 12 padding (Figma: `size`). `'default'` is deprecated
23
+ * (2.0.0-next): it is `'md'`.
24
+ */
25
+ size?: ItemSize | 'default';
19
26
  }
20
27
  /**
21
28
  * Item — Figma [RDS] Content/Item. One row of a list: media, title, description and one action. Inside an ItemGroup
@@ -26,7 +33,7 @@ interface ItemGroupProps extends HTMLAttributes<HTMLUListElement> {
26
33
  /** The Items. One variant for the whole list. */
27
34
  children: ReactNode;
28
35
  }
29
- /** The list the Items go in (<ul>). default rows get a line between them; outline and muted rows a gap of 8. */
36
+ /** The list the Items go in (<ul>). ghost rows get a line between them; outline and soft rows a gap of 8. */
30
37
  declare function ItemGroup({ className, children, ...rest }: ItemGroupProps): react.JSX.Element;
31
38
 
32
39
  export { Item, ItemGroup, type ItemGroupProps, type ItemProps, type ItemSize, type ItemVariant };
@@ -6,14 +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_VARIANT = { default: "ghost", muted: "soft" };
9
10
  const InGroup = createContext(false);
10
11
  function Item(_a) {
11
- var _b = _a, { title, description, media, action, variant = "default", size = "default", className } = _b, rest = __objRest(_b, ["title", "description", "media", "action", "variant", "size", "className"]);
12
+ var _b = _a, { title, description, media, action, variant = "ghost", size = "md", className } = _b, rest = __objRest(_b, ["title", "description", "media", "action", "variant", "size", "className"]);
13
+ var _a2;
12
14
  const Root = useContext(InGroup) ? "li" : "div";
15
+ const look = (_a2 = LEGACY_VARIANT[variant]) != null ? _a2 : variant;
13
16
  return /* @__PURE__ */ jsxs(
14
17
  Root,
15
18
  __spreadProps(__spreadValues({}, rest), {
16
- className: ["rds-item", `rds-item--${variant}`, size === "sm" && "rds-item--sm", className].filter(Boolean).join(" "),
19
+ className: ["rds-item", `rds-item--${look}`, size === "sm" && "rds-item--sm", className].filter(Boolean).join(" "),
17
20
  children: [
18
21
  media && /* @__PURE__ */ jsx("span", { className: "rds-item__media", children: media }),
19
22
  /* @__PURE__ */ jsxs("span", { className: "rds-item__content", children: [
@@ -1,9 +1,17 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
+ /** The marker's shape (Figma: `kind`): it is the form, not the emphasis, so it is not a `variant`. */
5
+ type MarkerKind = 'inline' | 'border' | 'separator';
6
+ /** @deprecated Use MarkerKind (2.0.0-next: `variant` is `kind`, and default is inline). */
4
7
  type MarkerVariant = 'default' | 'border' | 'separator';
5
8
  interface MarkerProps extends HTMLAttributes<HTMLDivElement> {
6
- /** default: icon and text; border: with a line under it, to split rows; separator: the text between two lines. */
9
+ /**
10
+ * inline (default): icon and text; border: with a line under it, to split rows; separator: the text between two
11
+ * lines (Figma: `kind`).
12
+ */
13
+ kind?: MarkerKind;
14
+ /** @deprecated Use `kind` (2.0.0-next): default → inline, border and separator stay. */
7
15
  variant?: MarkerVariant;
8
16
  /** The assistant's status, a system note or a date (Figma: `text`). */
9
17
  children: ReactNode;
@@ -19,6 +27,6 @@ interface MarkerProps extends HTMLAttributes<HTMLDivElement> {
19
27
  * Marker — Figma [RDS] Chat/Marker. A line inside the conversation that is not a message: the assistant's status
20
28
  * ("Buscando…"), a system note or a date between two lines. Styles: marker.css.
21
29
  */
22
- declare function Marker({ variant, children, icon, loading, className, ...rest }: MarkerProps): react.JSX.Element;
30
+ declare function Marker({ kind: kindProp, variant, children, icon, loading, className, ...rest }: MarkerProps): react.JSX.Element;
23
31
 
24
- export { Marker, type MarkerProps, type MarkerVariant };
32
+ export { Marker, type MarkerKind, type MarkerProps, type MarkerVariant };
@@ -7,10 +7,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { SparklesIcon } from "./internal/icons.js";
8
8
  import { Spinner } from "./spinner.js";
9
9
  function Marker(_a) {
10
- var _b = _a, { variant = "default", children, icon = /* @__PURE__ */ jsx(SparklesIcon, {}), loading, className } = _b, rest = __objRest(_b, ["variant", "children", "icon", "loading", "className"]);
11
- const classes = ["rds-marker", `rds-marker--${variant}`, className].filter(Boolean).join(" ");
10
+ var _b = _a, { kind: kindProp, variant, children, icon = /* @__PURE__ */ jsx(SparklesIcon, {}), loading, className } = _b, rest = __objRest(_b, ["kind", "variant", "children", "icon", "loading", "className"]);
11
+ const kind = kindProp != null ? kindProp : variant === "default" || variant === void 0 ? "inline" : variant;
12
+ const classes = ["rds-marker", `rds-marker--${kind}`, className].filter(Boolean).join(" ");
12
13
  const role = loading ? "status" : void 0;
13
- if (variant === "separator") {
14
+ if (kind === "separator") {
14
15
  return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ role }, rest), { className: classes, children: [
15
16
  /* @__PURE__ */ jsx("span", { className: "rds-marker__line", "aria-hidden": "true" }),
16
17
  /* @__PURE__ */ jsx("span", { className: "rds-marker__text", children }),
@@ -53,7 +53,7 @@ interface NumberInputProps extends Omit<FieldTextProps, 'labelPosition'> {
53
53
  * booking, instalments). The number in the middle is typed; the field is a spinbutton, so the arrows move it (Page
54
54
  * Up/Down by ten steps, Home/End to the limits) and − and + stay out of the Tab order. At a limit its button turns
55
55
  * off. A price, a CPF or a CEP is the Input; a continuous range, the Slider; the steps of a flow, the
56
- * FloatingStepper. Styles: number-input.css and internal/field.css.
56
+ * Stepper. Styles: number-input.css and internal/field.css.
57
57
  */
58
58
  declare function NumberInput({ label, hint, error, errorMessage, required, value, defaultValue, onChange, min, max, step, unit, steps, stepsLabel, debounce, decrementLabel, incrementLabel, name, placeholder, disabled, id, className, style, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: NumberInputProps): react.JSX.Element;
59
59
 
@@ -3,7 +3,7 @@ import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
4
  /** task: something moving to the end (upload, import). measure: a value inside a known range (quota used). */
5
5
  type ProgressKind = 'task' | 'measure';
6
- type ProgressSize = 'default' | 'sm';
6
+ type ProgressSize = 'md' | 'sm';
7
7
  interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
8
8
  /** 0 to `max` (Figma: `value`, 0 to 100 in steps of 5; the code takes any value). */
9
9
  value: number;
@@ -18,8 +18,8 @@ interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>
18
18
  valueText?: ReactNode;
19
19
  /** task → role="progressbar"; measure → role="meter". */
20
20
  kind?: ProgressKind;
21
- /** default: 8px bar; sm: 4px, for dense lists (Figma: `size`). */
22
- size?: ProgressSize;
21
+ /** md: 8px bar (default); sm: 4px, for dense lists (Figma: `size`). `'default'` is deprecated (2.0.0-next): it is `'md'`. */
22
+ size?: ProgressSize | 'default';
23
23
  }
24
24
  /**
25
25
  * Progress — Figma [RDS] Indicators/Progress. A bar with a value: the track is the brand tint, the fill the first
@@ -15,7 +15,7 @@ function Progress(_a) {
15
15
  showValue = true,
16
16
  valueText,
17
17
  kind = "task",
18
- size = "default",
18
+ size = "md",
19
19
  className
20
20
  } = _b, rest = __objRest(_b, [
21
21
  "value",
@@ -32,7 +32,7 @@ function Progress(_a) {
32
32
  const clamped = Math.min(Math.max(value, 0), max);
33
33
  const percent = max > 0 ? clamped / max * 100 : 0;
34
34
  const text = valueText != null ? valueText : `${Math.round(percent)}%`;
35
- return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-progress", `rds-progress--${size}`, className].filter(Boolean).join(" "), children: [
35
+ return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-progress", `rds-progress--${size === "default" ? "md" : size}`, className].filter(Boolean).join(" "), children: [
36
36
  (showLabel || showValue) && /* @__PURE__ */ jsxs("div", { className: "rds-progress__row", children: [
37
37
  showLabel && /* @__PURE__ */ jsx("span", { id: labelId, className: "rds-progress__label", children: label }),
38
38
  showValue && /* @__PURE__ */ jsx("span", { className: "rds-progress__value", "aria-hidden": "true", children: text })
@@ -4,6 +4,9 @@ import { ReactNode } from 'react';
4
4
  interface RowActionItem {
5
5
  label: string;
6
6
  icon?: ReactNode;
7
+ /** neutral (default) or danger: danger items go last, after a separator. */
8
+ tone?: 'neutral' | 'danger';
9
+ /** @deprecated Use `tone` (2.0.0-next): default → neutral, danger stays. */
7
10
  variant?: 'default' | 'danger';
8
11
  disabled?: boolean;
9
12
  onClick: () => void;
@@ -13,10 +13,14 @@ function RowActions({
13
13
  items = [],
14
14
  dangerSeparator
15
15
  }) {
16
- const hasDanger = items.some((i) => i.variant === "danger");
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.variant !== "danger") : items;
19
- const dangerItems = showSep ? items.filter((i) => i.variant === "danger") : [];
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.variant,
55
+ tone: isDanger(item) ? "danger" : "neutral",
52
56
  disabled: item.disabled,
53
57
  onSelect: item.onClick,
54
58
  children: item.label
@@ -21,13 +21,25 @@ interface SavingBarProps extends HTMLAttributes<HTMLDivElement> {
21
21
  saveLabel?: string;
22
22
  retryLabel?: string;
23
23
  discardLabel?: string;
24
+ /**
25
+ * Turns the unsaved message into a button that opens what is missing (a Drawer with the checklist), in the
26
+ * compact arrangement only; expanded, the message stays text (Figma: `showDetails`).
27
+ */
28
+ onDetails?: () => void;
29
+ /** Said after the message in the details button's accessible name, hidden on screen. */
30
+ detailsLabel?: string;
31
+ /** Whether the panel the details button opens is open (aria-expanded). */
32
+ detailsExpanded?: boolean;
33
+ /** The id of that panel (aria-controls). */
34
+ detailsControls?: string;
24
35
  }
25
36
  /**
26
37
  * SavingBar — Figma [RDS] Actions/SavingBar. Shows at the foot of the screen while a change is not
27
- * saved, and leaves once saved. Painted with colors/primary on purpose: a state that waits for a
28
- * decision, not a notice. It does not place itself: put it sticky or fixed at the bottom.
29
- * Its Buttons use the inverse tone, drawn for the colors/primary band in both modes. Styles: saving-bar.css.
38
+ * saved, and leaves once saved. It is the brand plate on purpose (.ds-plate on the bar, in every brand and in
39
+ * light or dark alike): a state that waits for a decision, not a notice. It does not place itself: put it
40
+ * sticky or fixed at the bottom. Its Buttons are Salvar in tone action and Descartar in tone neutral ghost, read
41
+ * inside the plate. Styles: saving-bar.css.
30
42
  */
31
- declare function SavingBar({ status, message, savingMessage, errorMessage, onSave, onDiscard, saveLabel, retryLabel, discardLabel, className, ...rest }: SavingBarProps): react.JSX.Element;
43
+ declare function SavingBar({ status, message, savingMessage, errorMessage, onSave, onDiscard, saveLabel, retryLabel, discardLabel, onDetails, detailsLabel, detailsExpanded, detailsControls, className, ...rest }: SavingBarProps): react.JSX.Element;
32
44
 
33
45
  export { SavingBar, type SavingBarProps, type SavingBarStatus };
@@ -7,7 +7,7 @@ import {
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { Button } from "./button.js";
9
9
  import { Loader } from "./internal/button.js";
10
- import { AlertIcon } from "./internal/icons.js";
10
+ import { AlertIcon, ChevronUpIcon } from "./internal/icons.js";
11
11
  function SavingBar(_a) {
12
12
  var _b = _a, {
13
13
  status = "unsaved",
@@ -19,6 +19,10 @@ function SavingBar(_a) {
19
19
  saveLabel = "Salvar",
20
20
  retryLabel = "Tentar de novo",
21
21
  discardLabel = "Descartar",
22
+ onDetails,
23
+ detailsLabel = "Ver o que falta",
24
+ detailsExpanded,
25
+ detailsControls,
22
26
  className
23
27
  } = _b, rest = __objRest(_b, [
24
28
  "status",
@@ -30,28 +34,52 @@ function SavingBar(_a) {
30
34
  "saveLabel",
31
35
  "retryLabel",
32
36
  "discardLabel",
37
+ "onDetails",
38
+ "detailsLabel",
39
+ "detailsExpanded",
40
+ "detailsControls",
33
41
  "className"
34
42
  ]);
35
43
  const saving = status === "saving";
36
44
  const error = status === "error";
37
- return /* @__PURE__ */ jsxs(
45
+ const text = saving ? savingMessage : error ? errorMessage : message;
46
+ const details = status === "unsaved" && onDetails !== void 0;
47
+ return /* @__PURE__ */ jsx(
38
48
  "div",
39
49
  __spreadProps(__spreadValues({
40
50
  role: "region",
41
51
  "aria-label": "Salvar altera\xE7\xF5es"
42
52
  }, rest), {
43
- className: ["rds-savingbar", className].filter(Boolean).join(" "),
44
- children: [
45
- /* @__PURE__ */ jsxs("p", { className: "rds-savingbar__message", role: "status", children: [
53
+ className: ["rds-savingbar", "ds-plate", className].filter(Boolean).join(" "),
54
+ children: /* @__PURE__ */ jsxs("div", { className: "rds-savingbar__row", children: [
55
+ /* @__PURE__ */ jsxs("p", { className: ["rds-savingbar__message", details && "rds-savingbar__message--details"].filter(Boolean).join(" "), role: "status", children: [
46
56
  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", { children: saving ? savingMessage : error ? errorMessage : message })
58
+ /* @__PURE__ */ jsx("span", { className: "rds-savingbar__text", children: text }),
59
+ details && /* @__PURE__ */ jsxs(
60
+ "button",
61
+ {
62
+ type: "button",
63
+ className: "rds-savingbar__details",
64
+ "aria-expanded": detailsExpanded != null ? detailsExpanded : false,
65
+ "aria-controls": detailsControls,
66
+ onClick: onDetails,
67
+ children: [
68
+ /* @__PURE__ */ jsx("span", { className: "rds-savingbar__text", children: text }),
69
+ /* @__PURE__ */ jsxs("span", { className: "rds-visually-hidden", children: [
70
+ ", ",
71
+ detailsLabel
72
+ ] }),
73
+ /* @__PURE__ */ jsx("span", { className: "rds-savingbar__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronUpIcon, {}) })
74
+ ]
75
+ }
76
+ )
49
77
  ] }),
50
78
  /* @__PURE__ */ jsxs("div", { className: "rds-savingbar__actions", children: [
51
- onDiscard && /* @__PURE__ */ jsx(Button, { tone: "inverse", variant: "ghost", disabled: saving, onClick: onDiscard, children: discardLabel }),
52
- /* @__PURE__ */ jsx(Button, { tone: "inverse", variant: "fill", disabled: saving, onClick: onSave, children: error ? retryLabel : saveLabel })
79
+ onDiscard && /* @__PURE__ */ jsx(Button, { tone: "neutral", variant: "ghost", disabled: saving, onClick: onDiscard, children: discardLabel }),
80
+ /* @__PURE__ */ jsx(Button, { tone: "action", variant: "fill", disabled: saving, onClick: onSave, children: error ? retryLabel : saveLabel })
53
81
  ] })
54
- ]
82
+ ] })
55
83
  })
56
84
  );
57
85
  }
@@ -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 title. Styles: section-header.css.
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
- /** Small uppercase line above the title (overline). */
13
+ /** @deprecated Not in the Figma [RDS] (the SectionHeader pattern): a small uppercase line above the title. */
13
14
  eyebrow?: string;
14
- /** Section or step number, before the eyebrow: "02 · CONTEÚDO". */
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: `as`, `href`, `indicator` and
23
- * `ribbon` are ignored, and a chosen card cannot be un-chosen by clicking it again.
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
- * Styles: sidebar.css.
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, tone, children, footer, className, ...rest }: SidebarProps): react.JSX.Element;
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: `state=active`): aria-current="page". Only one at a time. */
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, type SidebarTone };
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", tone === "dark" && "rds-sidebar--dark", collapsed && "rds-sidebar--collapsed", className].filter(Boolean).join(" "),
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": active ? "page" : void 0, onClick };
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' | 'default' | 'lg';
5
- type SpinnerTone = 'default' | 'inverse';
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), default 24 (next to text), lg 32 (alone in an empty area). */
8
- size?: SpinnerSize;
9
- /** default on light surfaces; inverse on the dark brand band or a dark veil. */
10
- tone?: SpinnerTone;
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 = "default",
10
- tone = "default",
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' | 'default' | 'lg';
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 = "default", label, className } = _b, rest = __objRest(_b, ["value", "size", "label", "className"]);
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
- /** What the number means: money in (positive), a loss or a lack (negative), a counter that asks for attention, zero. */
5
- type StatTone = 'default' | 'positive' | 'negative' | 'warning' | 'muted';
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
- /** Paints the number (Figma: `tone`). */
12
- tone?: StatTone;
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 };
@@ -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 = "default", caption, delta, sparkline, framed, className } = _b, rest = __objRest(_b, ["label", "value", "tone", "caption", "delta", "sparkline", "framed", "className"]);
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
  };