@hemerson/design-system 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ import { type ReactNode } from "react";
2
+ export type ChartTone = "accent" | "secondary" | "success" | "warning" | "danger" | "neutral";
3
+ export interface ChartSeries {
4
+ name: string;
5
+ /** Default: accent, then secondary, warning and so on, in order. */
6
+ tone?: ChartTone;
7
+ }
8
+ export interface ChartDatum {
9
+ label: string;
10
+ /** One value per series, in the same order. */
11
+ values: number[];
12
+ }
13
+ export interface BarChartProps {
14
+ /** Names the chart: shown above it and used as the accessible name. */
15
+ title: ReactNode;
16
+ data: ChartDatum[];
17
+ /** One series by default; several stack in each bar, with a legend. */
18
+ series?: ChartSeries[];
19
+ /** `vertical`: bars rise from a baseline, for time. `horizontal`: one row per label, for rankings. Default `vertical`. */
20
+ orientation?: "vertical" | "horizontal";
21
+ /** How values read in labels and in the data table. Default: the number in pt-BR. */
22
+ formatValue?: (value: number) => string;
23
+ /** Shown instead of the bars when there is no data. Default "Nada para mostrar.". */
24
+ empty?: ReactNode;
25
+ /** Height of the bar area in vertical charts, in px. Default 200. */
26
+ height?: number;
27
+ className?: string;
28
+ }
29
+ /**
30
+ * Bars for comparing a few values: a vertical chart over time, or a horizontal ranking.
31
+ * Several series stack in each bar. The bars are drawn for sighted users and hidden from
32
+ * screen readers, which get the same numbers as a table.
33
+ */
34
+ export declare function BarChart({ title, data, series, orientation, formatValue, empty, height, className, }: BarChartProps): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,8 @@ export { Select } from "./components/Select/Select";
24
24
  export { DateInput } from "./components/DateInput/DateInput";
25
25
  export type { DateInputProps } from "./components/DateInput/DateInput";
26
26
  export { Typeahead } from "./components/Typeahead/Typeahead";
27
+ export { BarChart } from "./components/BarChart/BarChart";
28
+ export type { BarChartProps, ChartDatum, ChartSeries, ChartTone } from "./components/BarChart/BarChart";
27
29
  export type { TypeaheadProps } from "./components/Typeahead/Typeahead";
28
30
  export type { SelectOption, SelectProps } from "./components/Select/Select";
29
31
  export { Checkbox } from "./components/Checkbox/Checkbox";
package/dist/index.js CHANGED
@@ -723,7 +723,7 @@ function le({ label: e, value: t, defaultValue: n = "", onChange: r, min: i, max
723
723
  }).format(z), ve = _e.charAt(0).toLocaleUpperCase(c) + _e.slice(1), ye = new Intl.DateTimeFormat(c, { dateStyle: "full" }), be = oe(z, l)[0].map((e) => ({
724
724
  short: new Intl.DateTimeFormat(c, { weekday: "narrow" }).format(e),
725
725
  long: new Intl.DateTimeFormat(c, { weekday: "long" }).format(e)
726
- })), Q = K(z), xe = ce(), $ = `${j.id}-calendar-title`;
726
+ })), xe = K(z), Se = ce(), Q = `${j.id}-calendar-title`;
727
727
  return /* @__PURE__ */ x("div", {
728
728
  className: C("hds-field", k),
729
729
  children: [
@@ -787,7 +787,7 @@ function le({ label: e, value: t, defaultValue: n = "", onChange: r, min: i, max
787
787
  ref: H,
788
788
  role: "dialog",
789
789
  tone: "thick",
790
- "aria-labelledby": $,
790
+ "aria-labelledby": Q,
791
791
  className: "hds-date-panel",
792
792
  onKeyDown: ge,
793
793
  children: [/* @__PURE__ */ x("div", {
@@ -802,7 +802,7 @@ function le({ label: e, value: t, defaultValue: n = "", onChange: r, min: i, max
802
802
  onClick: () => B(X(z, -1))
803
803
  }),
804
804
  /* @__PURE__ */ b("h2", {
805
- id: $,
805
+ id: Q,
806
806
  className: "hds-date-title",
807
807
  "aria-live": "polite",
808
808
  children: ve
@@ -818,7 +818,7 @@ function le({ label: e, value: t, defaultValue: n = "", onChange: r, min: i, max
818
818
  ]
819
819
  }), /* @__PURE__ */ x("table", {
820
820
  role: "grid",
821
- "aria-labelledby": $,
821
+ "aria-labelledby": Q,
822
822
  className: "hds-date-grid",
823
823
  onKeyDown: he,
824
824
  children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: be.map((e) => /* @__PURE__ */ b("th", {
@@ -832,9 +832,9 @@ function le({ label: e, value: t, defaultValue: n = "", onChange: r, min: i, max
832
832
  "aria-selected": t === P,
833
833
  children: /* @__PURE__ */ b("button", {
834
834
  type: "button",
835
- tabIndex: t === Q ? 0 : -1,
835
+ tabIndex: t === xe ? 0 : -1,
836
836
  "aria-label": ye.format(e),
837
- "aria-current": t === xe ? "date" : void 0,
837
+ "aria-current": t === Se ? "date" : void 0,
838
838
  "aria-disabled": !n || void 0,
839
839
  className: C("hds-date-day", e.getMonth() !== z.getMonth() && "hds-date-day--outside", t === P && "hds-date-day--selected"),
840
840
  onClick: () => pe(e),
@@ -972,8 +972,115 @@ function fe({ label: e, value: t, defaultValue: n = "", onChange: r, suggestions
972
972
  });
973
973
  }
974
974
  //#endregion
975
+ //#region src/components/BarChart/BarChart.tsx
976
+ var pe = [
977
+ "accent",
978
+ "secondary",
979
+ "warning",
980
+ "success",
981
+ "danger",
982
+ "neutral"
983
+ ], me = (e) => e.toLocaleString("pt-BR");
984
+ function he({ title: e, data: t, series: n = [{ name: "Valor" }], orientation: r = "vertical", formatValue: i = me, empty: a = "Nada para mostrar.", height: o = 200, className: s }) {
985
+ let c = p(), l = n.map((e, t) => e.tone ?? pe[t % pe.length]), u = (e) => e.values.reduce((e, t) => e + Math.max(0, t), 0), d = Math.max(0, ...t.map(u)), f = (e) => d > 0 ? Math.max(0, e) / d * 100 : 0, m = n.length > 1;
986
+ return /* @__PURE__ */ x("figure", {
987
+ "aria-labelledby": c,
988
+ className: C("hds-chart", `hds-chart--${r}`, s),
989
+ children: [/* @__PURE__ */ b("figcaption", {
990
+ id: c,
991
+ className: "hds-chart-title",
992
+ children: e
993
+ }), t.length === 0 || d === 0 ? /* @__PURE__ */ b("p", {
994
+ className: "hds-chart-empty",
995
+ children: a
996
+ }) : /* @__PURE__ */ x(y, { children: [
997
+ m ? /* @__PURE__ */ b("ul", {
998
+ className: "hds-chart-legend",
999
+ "aria-hidden": "true",
1000
+ children: n.map((e, t) => /* @__PURE__ */ x("li", { children: [/* @__PURE__ */ b("span", { className: C("hds-chart-swatch", `hds-chart-tone--${l[t]}`) }), e.name] }, e.name))
1001
+ }) : null,
1002
+ r === "vertical" ? /* @__PURE__ */ b("div", {
1003
+ className: "hds-chart-columns",
1004
+ "aria-hidden": "true",
1005
+ style: { height: o },
1006
+ children: t.map((e) => /* @__PURE__ */ x("div", {
1007
+ className: "hds-chart-column",
1008
+ children: [/* @__PURE__ */ x("div", {
1009
+ className: "hds-chart-plot",
1010
+ children: [/* @__PURE__ */ b("span", {
1011
+ className: "hds-chart-value",
1012
+ children: i(u(e))
1013
+ }), /* @__PURE__ */ b("div", {
1014
+ className: "hds-chart-stack",
1015
+ style: { height: `${f(u(e))}%` },
1016
+ children: e.values.map((e, t) => e > 0 ? /* @__PURE__ */ b("span", {
1017
+ className: C("hds-chart-bar", `hds-chart-tone--${l[t]}`),
1018
+ style: { flexGrow: e }
1019
+ }, n[t]?.name ?? t) : null)
1020
+ })]
1021
+ }), /* @__PURE__ */ b("span", {
1022
+ className: "hds-chart-label",
1023
+ children: e.label
1024
+ })]
1025
+ }, e.label))
1026
+ }) : /* @__PURE__ */ b("div", {
1027
+ className: "hds-chart-rows",
1028
+ "aria-hidden": "true",
1029
+ children: t.map((e) => /* @__PURE__ */ x("div", {
1030
+ className: "hds-chart-row",
1031
+ children: [
1032
+ /* @__PURE__ */ b("span", {
1033
+ className: "hds-chart-label",
1034
+ children: e.label
1035
+ }),
1036
+ /* @__PURE__ */ b("div", {
1037
+ className: "hds-chart-track",
1038
+ children: /* @__PURE__ */ b("div", {
1039
+ className: "hds-chart-stack",
1040
+ style: { width: `${f(u(e))}%` },
1041
+ children: e.values.map((e, t) => e > 0 ? /* @__PURE__ */ b("span", {
1042
+ className: C("hds-chart-bar", `hds-chart-tone--${l[t]}`),
1043
+ style: { flexGrow: e }
1044
+ }, n[t]?.name ?? t) : null)
1045
+ })
1046
+ }),
1047
+ /* @__PURE__ */ b("span", {
1048
+ className: "hds-chart-value",
1049
+ children: i(u(e))
1050
+ })
1051
+ ]
1052
+ }, e.label))
1053
+ }),
1054
+ /* @__PURE__ */ x("table", {
1055
+ className: "hds-visually-hidden",
1056
+ children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", { children: [
1057
+ /* @__PURE__ */ b("th", {
1058
+ scope: "col",
1059
+ children: typeof e == "string" ? e : ""
1060
+ }),
1061
+ n.map((e) => /* @__PURE__ */ b("th", {
1062
+ scope: "col",
1063
+ children: e.name
1064
+ }, e.name)),
1065
+ m ? /* @__PURE__ */ b("th", {
1066
+ scope: "col",
1067
+ children: "Total"
1068
+ }) : null
1069
+ ] }) }), /* @__PURE__ */ b("tbody", { children: t.map((e) => /* @__PURE__ */ x("tr", { children: [
1070
+ /* @__PURE__ */ b("th", {
1071
+ scope: "row",
1072
+ children: e.label
1073
+ }),
1074
+ n.map((t, n) => /* @__PURE__ */ b("td", { children: i(e.values[n] ?? 0) }, t.name)),
1075
+ m ? /* @__PURE__ */ b("td", { children: i(u(e)) }) : null
1076
+ ] }, e.label)) })]
1077
+ })
1078
+ ] })]
1079
+ });
1080
+ }
1081
+ //#endregion
975
1082
  //#region src/components/Checkbox/Checkbox.tsx
976
- var pe = l(function({ label: e, hint: t, id: n, className: r, ...i }, a) {
1083
+ var ge = l(function({ label: e, hint: t, id: n, className: r, ...i }, a) {
977
1084
  let o = U(n);
978
1085
  return /* @__PURE__ */ x("label", {
979
1086
  className: C("hds-checkbox", r),
@@ -1003,7 +1110,7 @@ var pe = l(function({ label: e, hint: t, id: n, className: r, ...i }, a) {
1003
1110
  });
1004
1111
  //#endregion
1005
1112
  //#region src/components/Card/Card.tsx
1006
- function me({ as: e = "article", eyebrow: t, title: n, media: r, footer: i, interactive: a = !1, className: o, children: s, ...c }) {
1113
+ function _e({ as: e = "article", eyebrow: t, title: n, media: r, footer: i, interactive: a = !1, className: o, children: s, ...c }) {
1007
1114
  return /* @__PURE__ */ x(e, {
1008
1115
  ...c,
1009
1116
  className: C("hds-card", a && "hds-card--interactive", o),
@@ -1039,14 +1146,14 @@ function me({ as: e = "article", eyebrow: t, title: n, media: r, footer: i, inte
1039
1146
  }
1040
1147
  //#endregion
1041
1148
  //#region src/components/Badge/Badge.tsx
1042
- var he = {
1149
+ var ve = {
1043
1150
  accent: "info",
1044
1151
  success: "circle-check",
1045
1152
  warning: "triangle-alert",
1046
1153
  danger: "circle-x"
1047
1154
  };
1048
- function ge({ tone: e = "neutral", icon: t, children: n, className: r }) {
1049
- let i = he[e], a = t === !1 ? null : t ?? (i ? /* @__PURE__ */ b(D, { name: i }) : null);
1155
+ function ye({ tone: e = "neutral", icon: t, children: n, className: r }) {
1156
+ let i = ve[e], a = t === !1 ? null : t ?? (i ? /* @__PURE__ */ b(D, { name: i }) : null);
1050
1157
  return /* @__PURE__ */ x("span", {
1051
1158
  className: C("hds-badge", `hds-badge--${e}`, r),
1052
1159
  children: [a, n]
@@ -1054,10 +1161,10 @@ function ge({ tone: e = "neutral", icon: t, children: n, className: r }) {
1054
1161
  }
1055
1162
  //#endregion
1056
1163
  //#region src/components/Table/Table.tsx
1057
- function _e(e) {
1164
+ function be(e) {
1058
1165
  return e.numeric ? "hds-cell--numeric" : e.align === "center" ? "hds-cell--center" : void 0;
1059
1166
  }
1060
- function ve({ columns: e, rows: t, rowKey: n = "id", caption: r, hideCaption: i = !1, empty: a = "Nada para mostrar.", maxHeight: o, glass: s = !1, className: c }) {
1167
+ function xe({ columns: e, rows: t, rowKey: n = "id", caption: r, hideCaption: i = !1, empty: a = "Nada para mostrar.", maxHeight: o, glass: s = !1, className: c }) {
1061
1168
  return /* @__PURE__ */ b("div", {
1062
1169
  className: C("hds-table-wrap", "hds-scroll", s && "hds-glass hds-table-wrap--glass", c),
1063
1170
  role: "region",
@@ -1073,11 +1180,11 @@ function ve({ columns: e, rows: t, rowKey: n = "id", caption: r, hideCaption: i
1073
1180
  }) : null,
1074
1181
  /* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: e.map((e) => /* @__PURE__ */ b("th", {
1075
1182
  scope: "col",
1076
- className: _e(e),
1183
+ className: be(e),
1077
1184
  children: e.header
1078
1185
  }, e.key)) }) }),
1079
1186
  /* @__PURE__ */ b("tbody", { children: t.length ? t.map((t, r) => /* @__PURE__ */ b("tr", { children: e.map((e) => /* @__PURE__ */ b("td", {
1080
- className: _e(e),
1187
+ className: be(e),
1081
1188
  children: e.render ? e.render(t) : t[e.key]
1082
1189
  }, e.key)) }, String(t[n] ?? r))) : /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
1083
1190
  colSpan: e.length || 1,
@@ -1090,19 +1197,19 @@ function ve({ columns: e, rows: t, rowKey: n = "id", caption: r, hideCaption: i
1090
1197
  }
1091
1198
  //#endregion
1092
1199
  //#region src/appearance/useAppearance.ts
1093
- var ye = !1, be = {
1200
+ var Se = !1, Q = {
1094
1201
  theme: "dark",
1095
1202
  transparency: "full"
1096
- }, Q = be;
1097
- function xe() {
1203
+ }, $ = Q;
1204
+ function Ce() {
1098
1205
  let e = a();
1099
- return (e.theme !== Q.theme || e.transparency !== Q.transparency) && (Q = e), Q;
1206
+ return (e.theme !== $.theme || e.transparency !== $.transparency) && ($ = e), $;
1100
1207
  }
1101
- function $() {
1208
+ function we() {
1102
1209
  f(() => {
1103
- ye || (ye = !0, document.documentElement.hasAttribute("data-theme") || r());
1210
+ Se || (Se = !0, document.documentElement.hasAttribute("data-theme") || r());
1104
1211
  }, []);
1105
- let e = v(o, xe, () => be);
1212
+ let e = v(o, Ce, () => Q);
1106
1213
  return {
1107
1214
  ...e,
1108
1215
  setTheme: t,
@@ -1113,8 +1220,8 @@ function $() {
1113
1220
  }
1114
1221
  //#endregion
1115
1222
  //#region src/components/AppearanceToggles/AppearanceToggles.tsx
1116
- function Se({ lightLabel: e = "Mudar para o tema claro", darkLabel: t = "Mudar para o tema escuro", variant: n = "ghost", ...r }) {
1117
- let { theme: i, toggleTheme: a } = $(), o = i === "dark" ? e : t;
1223
+ function Te({ lightLabel: e = "Mudar para o tema claro", darkLabel: t = "Mudar para o tema escuro", variant: n = "ghost", ...r }) {
1224
+ let { theme: i, toggleTheme: a } = we(), o = i === "dark" ? e : t;
1118
1225
  return /* @__PURE__ */ b(O, {
1119
1226
  ...r,
1120
1227
  variant: n,
@@ -1125,8 +1232,8 @@ function Se({ lightLabel: e = "Mudar para o tema claro", darkLabel: t = "Mudar p
1125
1232
  onClick: a
1126
1233
  });
1127
1234
  }
1128
- function Ce({ label: e = "Reduzir transparência", variant: t = "ghost", ...n }) {
1129
- let { transparency: r, toggleTransparency: i } = $();
1235
+ function Ee({ label: e = "Reduzir transparência", variant: t = "ghost", ...n }) {
1236
+ let { transparency: r, toggleTransparency: i } = we();
1130
1237
  return /* @__PURE__ */ b(O, {
1131
1238
  ...n,
1132
1239
  variant: t,
@@ -1140,7 +1247,7 @@ function Ce({ label: e = "Reduzir transparência", variant: t = "ghost", ...n })
1140
1247
  }
1141
1248
  //#endregion
1142
1249
  //#region src/components/Container/Container.tsx
1143
- function we({ as: e = "section", withSidebar: t = !1, className: n, ...r }) {
1250
+ function De({ as: e = "section", withSidebar: t = !1, className: n, ...r }) {
1144
1251
  return /* @__PURE__ */ b(e, {
1145
1252
  ...r,
1146
1253
  className: C("hds-container", t && "hds-container--with-sidebar", n)
@@ -1148,7 +1255,7 @@ function we({ as: e = "section", withSidebar: t = !1, className: n, ...r }) {
1148
1255
  }
1149
1256
  //#endregion
1150
1257
  //#region src/components/SectionTitle/SectionTitle.tsx
1151
- function Te({ children: e, index: t, as: n = "h2", id: r, className: i }) {
1258
+ function Oe({ children: e, index: t, as: n = "h2", id: r, className: i }) {
1152
1259
  return /* @__PURE__ */ x(n, {
1153
1260
  id: r,
1154
1261
  className: C("hds-section-title", i),
@@ -1161,7 +1268,7 @@ function Te({ children: e, index: t, as: n = "h2", id: r, className: i }) {
1161
1268
  }
1162
1269
  //#endregion
1163
1270
  //#region src/components/Separator/Separator.tsx
1164
- function Ee({ orientation: e = "horizontal", decorative: t = !1, className: n }) {
1271
+ function ke({ orientation: e = "horizontal", decorative: t = !1, className: n }) {
1165
1272
  return /* @__PURE__ */ b("div", {
1166
1273
  role: t ? "none" : "separator",
1167
1274
  "aria-orientation": t ? void 0 : e,
@@ -1170,7 +1277,7 @@ function Ee({ orientation: e = "horizontal", decorative: t = !1, className: n })
1170
1277
  }
1171
1278
  //#endregion
1172
1279
  //#region src/components/ScrollArea/ScrollArea.tsx
1173
- function De({ label: e, maxHeight: t, className: n, style: r, ...i }) {
1280
+ function Ae({ label: e, maxHeight: t, className: n, style: r, ...i }) {
1174
1281
  return /* @__PURE__ */ b("div", {
1175
1282
  ...i,
1176
1283
  role: "region",
@@ -1185,7 +1292,7 @@ function De({ label: e, maxHeight: t, className: n, style: r, ...i }) {
1185
1292
  }
1186
1293
  //#endregion
1187
1294
  //#region src/components/Loading/Loading.tsx
1188
- function Oe({ size: e = "md", label: t = "Carregando…", showLabel: n = !1, className: r }) {
1295
+ function je({ size: e = "md", label: t = "Carregando…", showLabel: n = !1, className: r }) {
1189
1296
  return /* @__PURE__ */ x("span", {
1190
1297
  role: "status",
1191
1298
  className: C("hds-loading", `hds-loading--${e}`, r),
@@ -1197,7 +1304,7 @@ function Oe({ size: e = "md", label: t = "Carregando…", showLabel: n = !1, cla
1197
1304
  }
1198
1305
  //#endregion
1199
1306
  //#region src/components/GlowAvatar/GlowAvatar.tsx
1200
- function ke({ src: e, alt: t, size: n = 96, className: r }) {
1307
+ function Me({ src: e, alt: t, size: n = 96, className: r }) {
1201
1308
  return /* @__PURE__ */ x("span", {
1202
1309
  className: C("hds-avatar", r),
1203
1310
  style: {
@@ -1217,6 +1324,6 @@ function ke({ src: e, alt: t, size: n = 96, className: r }) {
1217
1324
  });
1218
1325
  }
1219
1326
  //#endregion
1220
- export { s as APPEARANCE_STORAGE_KEYS, ge as Badge, O as Button, me as Card, pe as Checkbox, we as Container, le as DateInput, L as Dialog, F as FloatingButton, w as GlassPanel, ke as GlowAvatar, G as Input, Oe as Loading, P as Menu, A as NavBar, De as ScrollArea, Te as SectionTitle, N as SegmentedControl, ie as Select, Ee as Separator, j as Sidebar, ve as Table, Se as ThemeToggle, B as Toast, ne as ToastProvider, Ce as TransparencyToggle, fe as Typeahead, r as applyStoredAppearance, e as enableGlassRefraction, a as getAppearance, n as readStoredAppearance, t as setTheme, i as setTransparency, o as subscribeToAppearance, $ as useAppearance, H as useToast };
1327
+ export { s as APPEARANCE_STORAGE_KEYS, ye as Badge, he as BarChart, O as Button, _e as Card, ge as Checkbox, De as Container, le as DateInput, L as Dialog, F as FloatingButton, w as GlassPanel, Me as GlowAvatar, G as Input, je as Loading, P as Menu, A as NavBar, Ae as ScrollArea, Oe as SectionTitle, N as SegmentedControl, ie as Select, ke as Separator, j as Sidebar, xe as Table, Te as ThemeToggle, B as Toast, ne as ToastProvider, Ee as TransparencyToggle, fe as Typeahead, r as applyStoredAppearance, e as enableGlassRefraction, a as getAppearance, n as readStoredAppearance, t as setTheme, i as setTransparency, o as subscribeToAppearance, we as useAppearance, H as useToast };
1221
1328
 
1222
1329
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Fragment","TONE_ICONS","_Fragment","_Fragment","enableGlassRefraction","setTheme","readStoredAppearance","applyStoredAppearance","setTransparency","getAppearance","subscribeToAppearance","APPEARANCE_STORAGE_KEYS","cx","classes","GlassPanel","forwardRef","Tag","rest","tone","className","RING","ICONS","Icon","shapes","name","shape","index","Button","iconOnly","disabled","loading","variant","size","icon","children","NavBarLink","active","NavBarRoot","title","navLabel","actions","NavBar","Sidebar","label","floating","items","shared","item","footer","STEPS","SegmentedControl","innerValue","setInnerValue","useState","defaultValue","options","current","value","buttons","useRef","thumb","selectedIndex","option","measure","button","select","next","onChange","onKeyDown","step","event","nextIndex","isSelected","node","placePanel","anchor","trigger","width","panel","height","viewportWidth","viewportHeight","fitsBelow","fitsAbove","top","preferredLeft","align","left","Menu","isOpen","setOpen","id","useId","menuItems","close","returnFocus","useLayoutEffect","place","useEffect","onPointerDown","target","list","triggerVariant","createPortal","header","Fragment","FloatingButton","position","FOCUSABLE","Dialog","titleId","descriptionId","onCloseRef","onClose","open","previous","previousOverflow","focusables","initialFocus","first","last","description","closeLabel","TONE_ICONS$1","ToastView","isPaused","setPaused","duration","timer","Toast","ToastContext","createContext","ToastProvider","toasts","setToasts","nextId","dismiss","useCallback","toast","show","max","api","useMemo","useToast","useContext","useFieldIds","generated","fieldId","describedBy","props","ids","FieldMessages","hint","error","Input","hideLabel","numeric","Select","placeholder","toIso","pad","date","fromIso","match","formatTyped","n","parseTyped","trimmed","text","parts","day","month","year","addDays","days","addMonths","months","lastDay","monthGrid","start","weekStartsOn","week","isWithin","min","today","DateInput","setText","focused","setFocused","field","moveFocus","shownValue","setShownValue","commit","onType","raw","parsed","pick","iso","moveTo","onGridKeyDown","onPanelKeyDown","monthName","locale","monthTitle","dayName","weekdays","focusedIso","todayIso","calendarLabel","previousMonthLabel","nextMonthLabel","weekday","allowed","fold","matchSuggestions","query","unique","suggestions","s","suggestion","at","a","b","Highlight","end","Typeahead","listId","labelId","setActive","input","matches","maxSuggestions","shown","change","Checkbox","Card","interactive","media","eyebrow","TONE_ICONS","Badge","defaultIcon","shownIcon","cellClass","column","Table","glass","caption","maxHeight","hideCaption","columns","rows","row","rowKey","empty","initialized","serverAppearance","lastSnapshot","snapshot","useAppearance","appearance","useSyncExternalStore","ThemeToggle","theme","lightLabel","darkLabel","toggleTheme","TransparencyToggle","transparency","toggleTransparency","Container","withSidebar","SectionTitle","Separator","decorative","orientation","ScrollArea","style","Loading","showLabel","GlowAvatar"],"sources":["../src/internal/cx.ts","../src/components/GlassPanel/GlassPanel.tsx","../src/internal/Icon.tsx","../src/components/Button/Button.tsx","../src/components/NavBar/NavBar.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/SegmentedControl/SegmentedControl.tsx","../src/internal/placement.ts","../src/components/Menu/Menu.tsx","../src/components/FloatingButton/FloatingButton.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Toast/ToastView.tsx","../src/components/Toast/Toast.tsx","../src/components/Toast/ToastProvider.tsx","../src/internal/field.tsx","../src/components/Input/Input.tsx","../src/components/Select/Select.tsx","../src/components/DateInput/dates.ts","../src/components/DateInput/DateInput.tsx","../src/components/Typeahead/Typeahead.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Card/Card.tsx","../src/components/Badge/Badge.tsx","../src/components/Table/Table.tsx","../src/appearance/useAppearance.ts","../src/components/AppearanceToggles/AppearanceToggles.tsx","../src/components/Container/Container.tsx","../src/components/SectionTitle/SectionTitle.tsx","../src/components/Separator/Separator.tsx","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Loading/Loading.tsx","../src/components/GlowAvatar/GlowAvatar.tsx"],"sourcesContent":["/** Joins the truthy class names. */\nexport function cx(...classes: Array<string | false | null | undefined>): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import { forwardRef, type ElementType, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport type GlassTone = \"regular\" | \"clear\" | \"thick\" | \"accent\";\n\nexport interface GlassPanelProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Default `div`. */\n as?: ElementType;\n /**\n * regular (default, the only tone for text) · clear (icon-only controls over the app's own surfaces)\n * · thick (dialogs and sheets) · accent (one prominent floating control per view).\n */\n tone?: GlassTone;\n}\n\n/** Liquid glass: the material of every surface that floats above the content. */\nexport const GlassPanel = forwardRef<HTMLElement, GlassPanelProps>(function GlassPanel(\n { as: Tag = \"div\", tone = \"regular\", className, ...rest },\n ref\n) {\n return <Tag {...rest} ref={ref} className={cx(\"hds-glass\", tone !== \"regular\" && `hds-glass--${tone}`, className)} />;\n});\n","import { cx } from \"./cx\";\n\ntype Shape = string | { cx: number; cy: number; r: number };\n\nconst RING = { cx: 12, cy: 12, r: 10 };\n\n// The few Lucide icons (ISC licence) the components draw themselves: a string is a path,\n// an object a circle. Projects pass any other icon from lucide-react.\nconst ICONS = {\n check: [\"M20 6 9 17l-5-5\"],\n x: [\"M18 6 6 18\", \"m6 6 12 12\"],\n \"chevron-down\": [\"m6 9 6 6 6-6\"],\n \"chevron-left\": [\"m15 18-6-6 6-6\"],\n \"chevron-right\": [\"m9 18 6-6-6-6\"],\n calendar: [\"M8 2v4\", \"M16 2v4\", \"M3 10h18\", \"M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z\"],\n \"circle-check\": [RING, \"m9 12 2 2 4-4\"],\n \"circle-x\": [RING, \"m15 9-6 6\", \"m9 9 6 6\"],\n \"triangle-alert\": [\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n \"M12 9v4\",\n \"M12 17h.01\",\n ],\n info: [RING, \"M12 16v-4\", \"M12 8h.01\"],\n loader: [\"M21 12a9 9 0 1 1-6.219-8.56\"],\n sun: [\n { cx: 12, cy: 12, r: 4 },\n \"M12 2v2\",\n \"M12 20v2\",\n \"m4.93 4.93 1.41 1.41\",\n \"m17.66 17.66 1.41 1.41\",\n \"M2 12h2\",\n \"M20 12h2\",\n \"m6.34 17.66-1.41 1.41\",\n \"m19.07 4.93-1.41 1.41\",\n ],\n moon: [\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"],\n blend: [\n { cx: 9, cy: 9, r: 7 },\n { cx: 15, cy: 15, r: 7 },\n ],\n} satisfies Record<string, Shape[]>;\n\nexport type IconName = keyof typeof ICONS;\n\ntype IconProps = {\n name: IconName;\n className?: string;\n};\n\nexport function Icon({ name, className }: IconProps) {\n const shapes: Shape[] = ICONS[name];\n return (\n <svg\n className={cx(\"hds-icon\", className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {shapes.map((shape, index) =>\n typeof shape === \"string\" ? <path key={index} d={shape} /> : <circle key={index} cx={shape.cx} cy={shape.cy} r={shape.r} />\n )}\n </svg>\n );\n}\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"glass\" | \"ghost\" | \"danger\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** primary (one per view) · secondary · glass (over content or in glass bars) · ghost · danger (destructive). */\n variant?: ButtonVariant;\n /** sm 32px · md 40px · lg 56px, as on the portfolio. */\n size?: ButtonSize;\n /** A Lucide icon, shown before the label. */\n icon?: ReactNode;\n /** Shows only the icon. Requires `aria-label`. */\n iconOnly?: boolean;\n /** Shows a spinner, disables the button and sets `aria-busy`. */\n loading?: boolean;\n}\n\n/** Triggers an action. Labels are set uppercase and bold, verb first. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"primary\",\n size = \"md\",\n icon,\n iconOnly = false,\n loading = false,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n) {\n if (iconOnly && !rest[\"aria-label\"] && !rest[\"aria-labelledby\"]) {\n console.warn(\"Button: an icon-only button needs an aria-label.\");\n }\n\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={cx(\n \"hds-btn\",\n `hds-btn--${variant}`,\n size !== \"md\" && `hds-btn--${size}`,\n iconOnly && \"hds-btn--icon\",\n variant === \"glass\" && \"hds-glass\",\n className\n )}\n >\n {loading ? <Icon name=\"loader\" className=\"hds-spin\" /> : icon}\n {iconOnly ? null : children}\n </button>\n );\n});\n","import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface NavBarProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** Product or page name on the left. */\n title?: ReactNode;\n /** Buttons on the right. */\n actions?: ReactNode;\n /** Name of the navigation landmark. Default \"Principal\". */\n navLabel?: string;\n}\n\nexport interface NavBarLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Marks the current page. */\n active?: boolean;\n}\n\nfunction NavBarLink({ active = false, className, ...rest }: NavBarLinkProps) {\n return <a {...rest} aria-current={active ? \"page\" : undefined} className={cx(\"hds-navbar-link\", className)} />;\n}\n\nfunction NavBarRoot({ title, actions, navLabel = \"Principal\", className, children, ...rest }: NavBarProps) {\n return (\n <GlassPanel {...rest} as=\"header\" className={cx(\"hds-navbar\", className)}>\n {title ? <p className=\"hds-navbar-title\">{title}</p> : null}\n {children ? (\n <nav className=\"hds-navbar-nav\" aria-label={navLabel}>\n {children}\n </nav>\n ) : null}\n {actions ? <div className=\"hds-navbar-actions\">{actions}</div> : null}\n </GlassPanel>\n );\n}\n\n/** The app's top bar: a floating glass capsule with the product name, the main sections and the global actions. */\nexport const NavBar = Object.assign(NavBarRoot, { Link: NavBarLink });\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface SidebarItem {\n /** Accessible name and tooltip. */\n label: string;\n icon: ReactNode;\n href?: string;\n onClick?: () => void;\n active?: boolean;\n}\n\nexport interface SidebarProps {\n items: SidebarItem[];\n /** Items pinned to the bottom, such as settings. */\n footer?: ReactNode;\n /** A free-floating capsule instead of a rail attached to the edge. */\n floating?: boolean;\n /** Name of the navigation landmark. Default \"Navegação\". */\n label?: string;\n className?: string;\n}\n\n/** A slim glass rail of icon buttons for the app's main sections. */\nexport function Sidebar({ items, footer, floating = false, label = \"Navegação\", className }: SidebarProps) {\n return (\n <GlassPanel as=\"nav\" aria-label={label} className={cx(\"hds-sidebar\", floating && \"hds-sidebar--floating\", className)}>\n <ul className=\"hds-sidebar-items\">\n {items.map((item) => {\n const shared = {\n \"aria-label\": item.label,\n title: item.label,\n \"aria-current\": item.active ? (\"page\" as const) : undefined,\n className: \"hds-sidebar-item\",\n };\n return (\n <li key={item.label}>\n {item.href ? (\n <a {...shared} href={item.href} onClick={item.onClick}>\n {item.icon}\n </a>\n ) : (\n <button {...shared} type=\"button\" onClick={item.onClick}>\n {item.icon}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n {footer ? <div className=\"hds-sidebar-footer\">{footer}</div> : null}\n </GlassPanel>\n );\n}\n","import { useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface SegmentedOption<T extends string | number = string> {\n value: T;\n label?: ReactNode;\n icon?: ReactNode;\n /** Accessible name when the label is only an icon or a flag. */\n ariaLabel?: string;\n}\n\nexport interface SegmentedControlProps<T extends string | number = string> {\n options: SegmentedOption<T>[];\n /** The selected value, for a controlled control. */\n value?: T;\n /** The initially selected value, for an uncontrolled control. */\n defaultValue?: T;\n onChange?: (value: T) => void;\n /** Name of the group. */\n label: string;\n className?: string;\n}\n\nconst STEPS: Record<string, number> = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };\n\n/** Switches between two to four exclusive options with a lit thumb that slides between them. */\nexport function SegmentedControl<T extends string | number = string>({\n options,\n value,\n defaultValue,\n onChange,\n label,\n className,\n}: SegmentedControlProps<T>) {\n const [innerValue, setInnerValue] = useState<T | undefined>(defaultValue ?? options[0]?.value);\n const current = value !== undefined ? value : innerValue;\n const buttons = useRef<Array<HTMLButtonElement | null>>([]);\n const thumb = useRef<HTMLSpanElement>(null);\n\n const selectedIndex = Math.max(\n 0,\n options.findIndex((option) => option.value === current)\n );\n\n // The thumb is positioned directly on the DOM node: it follows the selected option's size\n useLayoutEffect(() => {\n function measure() {\n const button = buttons.current[selectedIndex];\n if (!button || !thumb.current) return;\n thumb.current.style.width = `${button.offsetWidth}px`;\n thumb.current.style.transform = `translateX(${button.offsetLeft - 4}px)`;\n thumb.current.style.opacity = \"1\";\n }\n measure();\n window.addEventListener(\"resize\", measure);\n return () => window.removeEventListener(\"resize\", measure);\n }, [selectedIndex, options.length]);\n\n function select(next: T) {\n if (value === undefined) setInnerValue(next);\n onChange?.(next);\n }\n\n function onKeyDown(event: KeyboardEvent) {\n const step = STEPS[event.key];\n if (!step) return;\n event.preventDefault();\n const nextIndex = (selectedIndex + step + options.length) % options.length;\n select(options[nextIndex].value);\n buttons.current[nextIndex]?.focus();\n }\n\n return (\n <GlassPanel role=\"radiogroup\" aria-label={label} className={cx(\"hds-segmented\", className)} onKeyDown={onKeyDown}>\n <span ref={thumb} className=\"hds-segmented-thumb\" aria-hidden=\"true\" style={{ opacity: 0 }} />\n {options.map((option, index) => {\n const isSelected = index === selectedIndex;\n return (\n <button\n key={String(option.value)}\n ref={(node) => {\n buttons.current[index] = node;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={option.ariaLabel}\n tabIndex={isSelected ? 0 : -1}\n className=\"hds-segmented-option\"\n onClick={() => select(option.value)}\n >\n {option.icon}\n {option.label}\n </button>\n );\n })}\n </GlassPanel>\n );\n}\n","/** Space between the trigger and the panel, and the closest the panel gets to the window edge. */\nexport const GAP = 8;\n\n/**\n * Places a panel under its trigger, or above it when there is no room below. The panel lives\n * in <body> with fixed positioning, so scroll containers (a table, a dialog) never clip it.\n */\nexport function placePanel(trigger: HTMLElement, panel: HTMLElement, align: \"start\" | \"end\") {\n const anchor = trigger.getBoundingClientRect();\n const width = panel.offsetWidth;\n const height = panel.offsetHeight;\n const viewportWidth = document.documentElement.clientWidth || window.innerWidth;\n const viewportHeight = document.documentElement.clientHeight || window.innerHeight;\n\n const fitsBelow = anchor.bottom + GAP + height <= viewportHeight - GAP;\n const fitsAbove = anchor.top - GAP - height >= GAP;\n const top = fitsBelow || !fitsAbove ? anchor.bottom + GAP : anchor.top - GAP - height;\n\n const preferredLeft = align === \"end\" ? anchor.right - width : anchor.left;\n const left = Math.min(Math.max(GAP, preferredLeft), Math.max(GAP, viewportWidth - width - GAP));\n\n panel.style.top = `${Math.round(top)}px`;\n panel.style.left = `${Math.round(left)}px`;\n panel.dataset.side = fitsBelow || !fitsAbove ? \"bottom\" : \"top\";\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { Button, type ButtonVariant } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\nimport { placePanel } from \"../../internal/placement\";\n\nexport type MenuItem =\n | { label: string; icon?: ReactNode; onSelect?: () => void; danger?: boolean; separator?: never }\n | { separator: true };\n\nexport interface MenuProps {\n /** Trigger text, or its accessible name with `iconOnly`. */\n label: string;\n icon?: ReactNode;\n iconOnly?: boolean;\n items: MenuItem[];\n /** Which edge of the trigger the list lines up with. Default `end`. */\n align?: \"start\" | \"end\";\n /** Default `glass`. */\n triggerVariant?: ButtonVariant;\n /**\n * Context shown at the top of the list, such as the signed-in account. Not an action:\n * screen readers hear it as the list's description.\n */\n header?: ReactNode;\n className?: string;\n}\n\n/** A button that opens a glass list of actions. */\nexport function Menu({ label, icon, iconOnly = false, items, align = \"end\", triggerVariant = \"glass\", header, className }: MenuProps) {\n const [isOpen, setOpen] = useState(false);\n const trigger = useRef<HTMLButtonElement>(null);\n const panel = useRef<HTMLElement>(null);\n const id = useId();\n\n const menuItems = () => Array.from(panel.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n\n function close(returnFocus: boolean) {\n setOpen(false);\n if (returnFocus) trigger.current?.focus();\n }\n\n // Position before the first paint, then follow the trigger while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!isOpen || !trigger.current || !panel.current) return;\n const place = () => {\n if (trigger.current && panel.current) placePanel(trigger.current, panel.current, align);\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [isOpen, align]);\n\n useEffect(() => {\n if (!isOpen) return;\n menuItems()[0]?.focus();\n\n function onPointerDown(event: MouseEvent) {\n const target = event.target as Node;\n if (trigger.current?.contains(target) || panel.current?.contains(target)) return;\n setOpen(false);\n }\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n }, [isOpen]);\n\n function onKeyDown(event: KeyboardEvent) {\n const list = menuItems();\n const index = list.indexOf(document.activeElement as HTMLElement);\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\") {\n // The list sits at the end of <body>, so let focus return to the trigger's place\n event.preventDefault();\n close(true);\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n const step = event.key === \"ArrowDown\" ? 1 : -1;\n list[(index + step + list.length) % list.length]?.focus();\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n (event.key === \"Home\" ? list[0] : list[list.length - 1])?.focus();\n }\n }\n\n return (\n <div className={cx(\"hds-menu\", className)}>\n <Button\n ref={trigger}\n variant={triggerVariant}\n icon={icon}\n iconOnly={iconOnly}\n aria-label={iconOnly ? label : undefined}\n aria-haspopup=\"menu\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? id : undefined}\n onClick={() => setOpen(!isOpen)}\n >\n {label}\n </Button>\n\n {isOpen\n ? createPortal(\n <GlassPanel\n ref={panel}\n id={id}\n role=\"menu\"\n aria-label={label}\n aria-describedby={header ? `${id}-header` : undefined}\n className=\"hds-menu-panel\"\n onKeyDown={onKeyDown}\n >\n {header ? (\n <>\n <div id={`${id}-header`} role=\"none\" className=\"hds-menu-header\">\n {header}\n </div>\n <div role=\"separator\" className=\"hds-menu-separator\" />\n </>\n ) : null}\n {items.map((item, index) =>\n item.separator ? (\n <div key={`separator-${index}`} role=\"separator\" className=\"hds-menu-separator\" />\n ) : (\n <button\n key={item.label}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n className={cx(\"hds-menu-item\", item.danger && \"hds-menu-item--danger\")}\n onClick={() => {\n close(true);\n item.onSelect?.();\n }}\n >\n {item.icon}\n {item.label}\n </button>\n )\n )}\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import { forwardRef, type ButtonHTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport type FloatingButtonPosition = \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\";\n\nexport interface FloatingButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Accessible name and tooltip. */\n label: string;\n position?: FloatingButtonPosition;\n}\n\n/** A round glass button fixed to a corner of the viewport, for one persistent action. */\nexport const FloatingButton = forwardRef<HTMLButtonElement, FloatingButtonProps>(function FloatingButton(\n { label, position = \"bottom-right\", type = \"button\", className, ...rest },\n ref\n) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n aria-label={label}\n title={label}\n className={cx(\"hds-glass\", \"hds-fab\", `hds-fab--${position}`, className)}\n />\n );\n});\n","import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport interface DialogProps {\n open: boolean;\n /** Called on Escape, on the close button and on a click outside the panel. */\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n /** The buttons, main action last. */\n footer?: ReactNode;\n /** Accessible name of the close button. Default \"Fechar\". */\n closeLabel?: string;\n /** `panel` focuses the panel itself instead of its first control. */\n initialFocus?: \"first\" | \"panel\";\n /** md (default, 560px) for forms and confirmations · lg (880px) for wide content such as a print preview. */\n size?: \"md\" | \"lg\";\n className?: string;\n}\n\n/** A modal panel of thick glass for a focused task or a confirmation. */\nexport function Dialog({\n open,\n onClose,\n title,\n description,\n children,\n footer,\n closeLabel = \"Fechar\",\n initialFocus = \"first\",\n size = \"md\",\n className,\n}: DialogProps) {\n const panel = useRef<HTMLElement>(null);\n const titleId = useId();\n const descriptionId = useId();\n\n // Always call the latest onClose, even from listeners added when the dialog opened\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n if (!open) return;\n\n const previous = document.activeElement as HTMLElement | null;\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n\n const focusables = panel.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? [];\n const target = initialFocus === \"panel\" || focusables.length === 0 ? panel.current : focusables[0];\n target?.focus();\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === \"Escape\") {\n // A menu or calendar open inside the dialog closes first, on its own Escape\n if (event.defaultPrevented) return;\n event.preventDefault();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || !panel.current) return;\n\n const list = Array.from(panel.current.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (list.length === 0) return;\n const first = list[0];\n const last = list[list.length - 1];\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n\n document.addEventListener(\"keydown\", onKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = previousOverflow;\n previous?.focus();\n };\n }, [open, initialFocus]);\n\n if (!open) return null;\n\n return createPortal(\n <div\n className=\"hds-scrim\"\n onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose();\n }}\n >\n <GlassPanel\n ref={panel}\n tone=\"thick\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description ? descriptionId : undefined}\n tabIndex={-1}\n className={cx(\"hds-dialog\", size !== \"md\" && `hds-dialog--${size}`, className)}\n >\n <div className=\"hds-dialog-header\">\n <div>\n <h2 id={titleId} className=\"hds-dialog-title\">\n {title}\n </h2>\n {description ? (\n <p id={descriptionId} className=\"hds-dialog-description\">\n {description}\n </p>\n ) : null}\n </div>\n <Button variant=\"ghost\" size=\"sm\" iconOnly icon={<Icon name=\"x\" />} aria-label={closeLabel} onClick={onClose} />\n </div>\n {children}\n {footer ? <div className=\"hds-dialog-footer\">{footer}</div> : null}\n </GlassPanel>\n </div>,\n document.body\n );\n}\n","import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon, type IconName } from \"../../internal/Icon\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport type ToastTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICONS: Record<ToastTone, IconName> = {\n neutral: \"info\",\n success: \"circle-check\",\n warning: \"triangle-alert\",\n danger: \"circle-x\",\n};\n\nexport interface ToastViewProps {\n tone: ToastTone;\n title: ReactNode;\n description?: ReactNode;\n /** Milliseconds before it closes itself; 0 keeps it open. */\n duration: number;\n onClose?: () => void;\n closeLabel: string;\n className?: string;\n}\n\n/** One toast: the glass card, its icon and close button, and a timer that pauses on hover or focus. */\nexport function ToastView({ tone, title, description, duration, onClose, closeLabel, className }: ToastViewProps) {\n const [isPaused, setPaused] = useState(false);\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n if (!duration || isPaused) return;\n const timer = window.setTimeout(() => onCloseRef.current?.(), duration);\n return () => window.clearTimeout(timer);\n }, [duration, isPaused]);\n\n return (\n <GlassPanel\n role={tone === \"danger\" ? \"alert\" : \"status\"}\n className={cx(\"hds-toast\", `hds-toast--${tone}`, className)}\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={() => setPaused(false)}\n >\n <Icon name={TONE_ICONS[tone]} />\n <div className=\"hds-toast-body\">\n <p className=\"hds-toast-title\">{title}</p>\n {description ? <p className=\"hds-toast-description\">{description}</p> : null}\n </div>\n {onClose ? (\n <Button variant=\"ghost\" size=\"sm\" iconOnly icon={<Icon name=\"x\" />} aria-label={closeLabel} onClick={onClose} />\n ) : null}\n </GlassPanel>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ToastView, type ToastTone } from \"./ToastView\";\n\nexport type { ToastTone } from \"./ToastView\";\n\nexport interface ToastProps {\n open: boolean;\n onClose?: () => void;\n tone?: ToastTone;\n title: ReactNode;\n description?: ReactNode;\n /** Milliseconds before it closes itself; 0 keeps it open. Default 5000. */\n duration?: number;\n /** Accessible name of the close button. Default \"Fechar aviso\". */\n closeLabel?: string;\n className?: string;\n}\n\n/**\n * A short glass notice at the bottom of the screen that confirms an action or reports a problem.\n * To raise toasts from anywhere in an app, wrap it in ToastProvider and use `useToast()` instead.\n */\nexport function Toast({\n open,\n onClose,\n tone = \"neutral\",\n title,\n description,\n duration = 5000,\n closeLabel = \"Fechar aviso\",\n className,\n}: ToastProps) {\n if (!open) return null;\n\n return createPortal(\n <div className=\"hds-toast-region\">\n <ToastView\n tone={tone}\n title={title}\n description={description}\n duration={duration}\n onClose={onClose}\n closeLabel={closeLabel}\n className={className}\n />\n </div>,\n document.body\n );\n}\n","import { createContext, useCallback, useContext, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ToastView, type ToastTone } from \"./ToastView\";\n\nexport interface ToastOptions {\n title: ReactNode;\n description?: ReactNode;\n tone?: ToastTone;\n /** Milliseconds before it closes itself; 0 keeps it open until dismissed. Default 5000. */\n duration?: number;\n}\n\nexport interface ToastApi {\n /** Shows a toast and returns its id, for `dismiss`. */\n show: (options: ToastOptions) => string;\n success: (title: ReactNode, description?: ReactNode) => string;\n error: (title: ReactNode, description?: ReactNode) => string;\n warning: (title: ReactNode, description?: ReactNode) => string;\n info: (title: ReactNode, description?: ReactNode) => string;\n dismiss: (id: string) => void;\n}\n\ninterface QueuedToast extends Required<Pick<ToastOptions, \"tone\" | \"duration\">> {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n}\n\nexport interface ToastProviderProps {\n children?: ReactNode;\n /** Most toasts shown at once; the oldest goes first. Default 3. */\n max?: number;\n /** Accessible name of each close button. Default \"Fechar aviso\". */\n closeLabel?: string;\n}\n\nconst ToastContext = createContext<ToastApi | null>(null);\n\n/** Shows the toasts raised with `useToast()` anywhere inside it, stacked at the bottom of the screen. */\nexport function ToastProvider({ children, max = 3, closeLabel = \"Fechar aviso\" }: ToastProviderProps) {\n const [toasts, setToasts] = useState<QueuedToast[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const show = useCallback(\n ({ title, description, tone = \"neutral\", duration = 5000 }: ToastOptions) => {\n const id = `hds-toast-${++nextId.current}`;\n setToasts((current) => [...current, { id, title, description, tone, duration }].slice(-max));\n return id;\n },\n [max]\n );\n\n const api = useMemo<ToastApi>(\n () => ({\n show,\n dismiss,\n success: (title, description) => show({ title, description, tone: \"success\" }),\n error: (title, description) => show({ title, description, tone: \"danger\" }),\n warning: (title, description) => show({ title, description, tone: \"warning\" }),\n info: (title, description) => show({ title, description, tone: \"neutral\" }),\n }),\n [show, dismiss]\n );\n\n return (\n <ToastContext.Provider value={api}>\n {children}\n {toasts.length\n ? createPortal(\n <div className=\"hds-toast-region\">\n {toasts.map((toast) => (\n <ToastView\n key={toast.id}\n tone={toast.tone}\n title={toast.title}\n description={toast.description}\n duration={toast.duration}\n closeLabel={closeLabel}\n onClose={() => dismiss(toast.id)}\n />\n ))}\n </div>,\n document.body\n )\n : null}\n </ToastContext.Provider>\n );\n}\n\n/** Raises toasts from anywhere inside a ToastProvider: `toast.success(\"Boleto salvo\")`. */\nexport function useToast(): ToastApi {\n const api = useContext(ToastContext);\n if (!api) throw new Error(\"useToast must be used inside a ToastProvider.\");\n return api;\n}\n","import { useId, type ReactNode } from \"react\";\nimport { Icon } from \"./Icon\";\n\nexport interface FieldTextProps {\n hint?: ReactNode;\n error?: ReactNode;\n \"aria-describedby\"?: string;\n}\n\n/** Ids for a field and its hint and error, so they can be linked with aria-describedby. */\nexport function useFieldIds(id?: string) {\n const generated = useId();\n const fieldId = id ?? generated;\n return { id: fieldId, hint: `${fieldId}-hint`, error: `${fieldId}-error` };\n}\n\nexport function describedBy(props: FieldTextProps, ids: ReturnType<typeof useFieldIds>) {\n const list = [props.hint && ids.hint, props.error && ids.error, props[\"aria-describedby\"]].filter(Boolean);\n return list.length ? list.join(\" \") : undefined;\n}\n\nexport function FieldMessages({ hint, error, ids }: FieldTextProps & { ids: ReturnType<typeof useFieldIds> }) {\n return (\n <>\n {hint ? (\n <p id={ids.hint} className=\"hds-hint\">\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={ids.error} className=\"hds-error\">\n <Icon name=\"circle-x\" />\n {error}\n </p>\n ) : null}\n </>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n /** Always visible, written as a noun (\"Beneficiário\"). */\n label: ReactNode;\n hint?: ReactNode;\n /** Says how to fix the value; also marks the input invalid. */\n error?: ReactNode;\n /** Mono, tabular figures and a decimal keyboard, for amounts and codes. */\n numeric?: boolean;\n}\n\n/** A labelled text field on a solid, recessed well. */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, hint, error, numeric = false, hideLabel = false, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <input\n inputMode={numeric ? \"decimal\" : undefined}\n {...rest}\n ref={ref}\n id={ids.id}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className={cx(\"hds-input\", numeric && \"hds-input--numeric\")}\n />\n <FieldMessages hint={hint} error={error} ids={ids} />\n </div>\n );\n});\n","import { forwardRef, type ReactNode, type SelectHTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n label: ReactNode;\n options: SelectOption[];\n /** Shown as a disabled first option. */\n placeholder?: string;\n hint?: ReactNode;\n error?: ReactNode;\n}\n\n/** A labelled native dropdown, styled like Input, for choosing one option from a short list. */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, options, placeholder, hint, error, hideLabel = false, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <div className=\"hds-select-wrap\">\n <select\n {...rest}\n ref={ref}\n id={ids.id}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-select\"\n >\n {placeholder ? (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n ) : null}\n {options.map((option) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n ))}\n </select>\n <Icon name=\"chevron-down\" />\n </div>\n <FieldMessages hint={hint} error={error} ids={ids} />\n </div>\n );\n});\n","/** Calendar dates as \"yyyy-mm-dd\" strings, the value format of <input type=\"date\">, in local time. */\n\nexport function toIso(date: Date) {\n const pad = (value: number) => String(value).padStart(2, \"0\");\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\nexport function fromIso(value: string | undefined): Date | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value ?? \"\");\n if (!match) return null;\n const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n return toIso(date) === value ? date : null;\n}\n\n/** \"10/10/2026\" from \"2026-10-10\". */\nexport function formatTyped(value: string) {\n const date = fromIso(value);\n if (!date) return \"\";\n const pad = (n: number) => String(n).padStart(2, \"0\");\n return `${pad(date.getDate())}/${pad(date.getMonth() + 1)}/${date.getFullYear()}`;\n}\n\n/** \"2026-10-10\" from what was typed as day/month/year (\"10/10/2026\", \"1/2/2026\" or \"10102026\"), or null. */\nexport function parseTyped(text: string): string | null {\n const trimmed = text.trim();\n const parts = /^\\d{8}$/.test(trimmed)\n ? [trimmed.slice(0, 2), trimmed.slice(2, 4), trimmed.slice(4)]\n : /^(\\d{1,2})[/.-](\\d{1,2})[/.-](\\d{4})$/.exec(trimmed)?.slice(1);\n if (!parts) return null;\n const [day, month, year] = parts.map(Number);\n const date = new Date(year, month - 1, day);\n return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? toIso(date) : null;\n}\n\nexport function addDays(date: Date, days: number) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\n/** The same day in another month, or that month's last day when it is shorter. */\nexport function addMonths(date: Date, months: number) {\n const target = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));\n}\n\n/** Six weeks of days covering the month of `date`, each week starting on `weekStartsOn` (0 = Sunday). */\nexport function monthGrid(date: Date, weekStartsOn: number) {\n const first = new Date(date.getFullYear(), date.getMonth(), 1);\n const start = addDays(first, -((first.getDay() - weekStartsOn + 7) % 7));\n return Array.from({ length: 6 }, (_, week) => Array.from({ length: 7 }, (_, day) => addDays(start, week * 7 + day)));\n}\n\nexport function isWithin(value: string, min?: string, max?: string) {\n return (!min || value >= min) && (!max || value <= max);\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\nimport { placePanel } from \"../../internal/placement\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\nimport { addDays, addMonths, formatTyped, fromIso, isWithin, monthGrid, parseTyped, toIso } from \"./dates\";\n\nexport interface DateInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"value\" | \"defaultValue\" | \"onChange\" | \"min\" | \"max\"> {\n label: ReactNode;\n /** The date as \"yyyy-mm-dd\", or \"\" for none: the format of <input type=\"date\">. */\n value?: string;\n defaultValue?: string;\n /** Called with \"yyyy-mm-dd\" when a whole valid date is typed or picked, and with \"\" when the field is cleared. */\n onChange?: (value: string) => void;\n /** Earliest and latest dates that can be picked or typed, as \"yyyy-mm-dd\". */\n min?: string;\n max?: string;\n hint?: ReactNode;\n error?: ReactNode;\n /** Locale of the month and weekday names. Default \"pt-BR\". */\n locale?: string;\n /** First day of the week, 0 for Sunday. Default 0. */\n weekStartsOn?: number;\n /** Accessible names. Defaults in Brazilian Portuguese. */\n calendarLabel?: string;\n previousMonthLabel?: string;\n nextMonthLabel?: string;\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n}\n\nconst today = () => toIso(new Date());\n\n/**\n * A date field: type day/month/year, or pick from a glass calendar. The value is \"yyyy-mm-dd\",\n * and with `name` a hidden input carries it, so forms read it like a native date input.\n */\nexport function DateInput({\n label,\n value,\n defaultValue = \"\",\n onChange,\n min,\n max,\n hint,\n error,\n locale = \"pt-BR\",\n weekStartsOn = 0,\n calendarLabel = \"Abrir calendário\",\n previousMonthLabel = \"Mês anterior\",\n nextMonthLabel = \"Próximo mês\",\n hideLabel = false,\n name,\n id,\n disabled,\n required,\n placeholder = \"dd/mm/aaaa\",\n className,\n ...rest\n}: DateInputProps) {\n const ids = useFieldIds(id);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const current = value !== undefined ? value : innerValue;\n const [text, setText] = useState(() => formatTyped(current));\n const [isOpen, setOpen] = useState(false);\n const [focused, setFocused] = useState<Date>(() => fromIso(current) ?? new Date());\n const field = useRef<HTMLDivElement>(null);\n const button = useRef<HTMLButtonElement>(null);\n const panel = useRef<HTMLElement>(null);\n const moveFocus = useRef(false);\n\n // Follow a value set from outside, e.g. a form reset\n const [shownValue, setShownValue] = useState(current);\n if (shownValue !== current) {\n setShownValue(current);\n setText(formatTyped(current));\n }\n\n function commit(next: string) {\n if (value === undefined) setInnerValue(next);\n if (next !== current) onChange?.(next);\n }\n\n function onType(raw: string) {\n setText(raw);\n if (raw.trim() === \"\") {\n commit(\"\");\n return;\n }\n const parsed = parseTyped(raw);\n if (parsed && isWithin(parsed, min, max)) commit(parsed);\n }\n\n function open() {\n setFocused(fromIso(current) ?? fromIso(today()) ?? new Date());\n moveFocus.current = true;\n setOpen(true);\n }\n\n function close(returnFocus: boolean) {\n setOpen(false);\n if (returnFocus) button.current?.focus();\n }\n\n function pick(date: Date) {\n const iso = toIso(date);\n if (!isWithin(iso, min, max)) return;\n commit(iso);\n setText(formatTyped(iso));\n close(true);\n }\n\n // Position under the field, and follow it while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!isOpen || !field.current || !panel.current) return;\n const place = () => {\n if (field.current && panel.current) placePanel(field.current, panel.current, \"start\");\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [isOpen]);\n\n // Keyboard focus follows the focused day\n useEffect(() => {\n if (!isOpen || !moveFocus.current) return;\n moveFocus.current = false;\n panel.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus();\n });\n\n useEffect(() => {\n if (!isOpen) return;\n function onPointerDown(event: MouseEvent) {\n const target = event.target as Node;\n if (field.current?.contains(target) || panel.current?.contains(target)) return;\n setOpen(false);\n }\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n }, [isOpen]);\n\n function moveTo(date: Date) {\n moveFocus.current = true;\n setFocused(date);\n }\n\n function onGridKeyDown(event: KeyboardEvent) {\n const steps: Record<string, () => Date> = {\n ArrowLeft: () => addDays(focused, -1),\n ArrowRight: () => addDays(focused, 1),\n ArrowUp: () => addDays(focused, -7),\n ArrowDown: () => addDays(focused, 7),\n Home: () => addDays(focused, -((focused.getDay() - weekStartsOn + 7) % 7)),\n End: () => addDays(focused, 6 - ((focused.getDay() - weekStartsOn + 7) % 7)),\n PageUp: () => addMonths(focused, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(focused, event.shiftKey ? 12 : 1),\n };\n const step = steps[event.key];\n if (!step) return;\n event.preventDefault();\n moveTo(step());\n }\n\n function onPanelKeyDown(event: KeyboardEvent) {\n // Tab too: the calendar sits at the end of <body>, so focus goes back to the button's place\n if (event.key === \"Escape\" || event.key === \"Tab\") {\n event.preventDefault();\n close(true);\n }\n }\n\n // \"Outubro de 2026\": only the first letter, so words like \"de\" stay lowercase\n const monthName = new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(focused);\n const monthTitle = monthName.charAt(0).toLocaleUpperCase(locale) + monthName.slice(1);\n const dayName = new Intl.DateTimeFormat(locale, { dateStyle: \"full\" });\n const weekdays = monthGrid(focused, weekStartsOn)[0].map((day) => ({\n short: new Intl.DateTimeFormat(locale, { weekday: \"narrow\" }).format(day),\n long: new Intl.DateTimeFormat(locale, { weekday: \"long\" }).format(day),\n }));\n const focusedIso = toIso(focused);\n const todayIso = today();\n const titleId = `${ids.id}-calendar-title`;\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <div ref={field} className=\"hds-date-wrap\">\n <input\n {...rest}\n id={ids.id}\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n placeholder={placeholder}\n value={text}\n disabled={disabled}\n required={required}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-input hds-input--numeric hds-date-input\"\n onChange={(event) => onType(event.target.value)}\n onBlur={(event) => {\n rest.onBlur?.(event);\n // An incomplete or impossible date goes back to the last valid one\n if (text.trim() !== \"\" && parseTyped(text) !== current) setText(formatTyped(current));\n }}\n />\n <Button\n ref={button}\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"calendar\" />}\n aria-label={calendarLabel}\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n disabled={disabled}\n className=\"hds-date-button\"\n onClick={() => (isOpen ? close(false) : open())}\n />\n {name ? <input type=\"hidden\" name={name} value={current} /> : null}\n </div>\n <FieldMessages hint={hint} error={error} ids={ids} />\n\n {isOpen\n ? createPortal(\n <GlassPanel\n ref={panel}\n role=\"dialog\"\n tone=\"thick\"\n aria-labelledby={titleId}\n className=\"hds-date-panel\"\n onKeyDown={onPanelKeyDown}\n >\n <div className=\"hds-date-header\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"chevron-left\" />}\n aria-label={previousMonthLabel}\n onClick={() => setFocused(addMonths(focused, -1))}\n />\n <h2 id={titleId} className=\"hds-date-title\" aria-live=\"polite\">\n {monthTitle}\n </h2>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"chevron-right\" />}\n aria-label={nextMonthLabel}\n onClick={() => setFocused(addMonths(focused, 1))}\n />\n </div>\n <table role=\"grid\" aria-labelledby={titleId} className=\"hds-date-grid\" onKeyDown={onGridKeyDown}>\n <thead>\n <tr>\n {weekdays.map((weekday) => (\n <th key={weekday.long} scope=\"col\" abbr={weekday.long}>\n {weekday.short}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {monthGrid(focused, weekStartsOn).map((week) => (\n <tr key={toIso(week[0])}>\n {week.map((day) => {\n const iso = toIso(day);\n const allowed = isWithin(iso, min, max);\n return (\n <td key={iso} role=\"gridcell\" aria-selected={iso === current}>\n <button\n type=\"button\"\n tabIndex={iso === focusedIso ? 0 : -1}\n aria-label={dayName.format(day)}\n aria-current={iso === todayIso ? \"date\" : undefined}\n aria-disabled={allowed ? undefined : true}\n className={cx(\n \"hds-date-day\",\n day.getMonth() !== focused.getMonth() && \"hds-date-day--outside\",\n iso === current && \"hds-date-day--selected\"\n )}\n onClick={() => pick(day)}\n >\n {day.getDate()}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { placePanel } from \"../../internal/placement\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface TypeaheadProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"value\" | \"defaultValue\" | \"onChange\"> {\n label: ReactNode;\n value?: string;\n defaultValue?: string;\n /** Called with the text on every keystroke and when a suggestion is picked. */\n onChange?: (value: string) => void;\n /** Values to suggest; repeats are shown once. Any text is still accepted. */\n suggestions: string[];\n /** Most suggestions shown at once. Default 8. */\n maxSuggestions?: number;\n hint?: ReactNode;\n error?: ReactNode;\n /** Locale for matching without case. Default \"pt-BR\". */\n locale?: string;\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n}\n\n/** Lowercase and without accents, so \"sao\" finds \"São Paulo\". */\nfunction fold(text: string, locale: string) {\n return text.normalize(\"NFD\").replace(/\\p{Diacritic}/gu, \"\").toLocaleLowerCase(locale);\n}\n\n/** The suggestions that contain the text, those that start with it first. */\nexport function matchSuggestions(suggestions: string[], text: string, locale = \"pt-BR\", max = 8) {\n const query = fold(text.trim(), locale);\n const unique = [...new Map(suggestions.filter(Boolean).map((s) => [fold(s, locale), s])).values()];\n if (!query) return unique.slice(0, max);\n return unique\n .map((suggestion) => ({ suggestion, at: fold(suggestion, locale).indexOf(query) }))\n .filter(({ suggestion, at }) => at >= 0 && fold(suggestion, locale) !== query)\n .sort((a, b) => (a.at === 0 ? 0 : 1) - (b.at === 0 ? 0 : 1) || a.suggestion.localeCompare(b.suggestion, locale))\n .slice(0, max)\n .map(({ suggestion }) => suggestion);\n}\n\n/** The suggestion with the part that matches the text marked. Folding keeps lengths, so indexes line up. */\nfunction Highlight({ text, query, locale }: { text: string; query: string; locale: string }) {\n const at = query.trim() ? fold(text, locale).indexOf(fold(query.trim(), locale)) : -1;\n if (at < 0) return <>{text}</>;\n const end = at + query.trim().length;\n return (\n <>\n {text.slice(0, at)}\n <mark className=\"hds-typeahead-match\">{text.slice(at, end)}</mark>\n {text.slice(end)}\n </>\n );\n}\n\n/** A text field that suggests values as you type, in a glass list. Free text is still allowed. */\nexport function Typeahead({\n label,\n value,\n defaultValue = \"\",\n onChange,\n suggestions,\n maxSuggestions = 8,\n hint,\n error,\n locale = \"pt-BR\",\n hideLabel = false,\n id,\n className,\n disabled,\n ...rest\n}: TypeaheadProps) {\n const ids = useFieldIds(id);\n const listId = `${ids.id}-list`;\n const labelId = `${ids.id}-label`;\n const [innerValue, setInnerValue] = useState(defaultValue);\n const text = value !== undefined ? value : innerValue;\n const [isOpen, setOpen] = useState(false);\n const [active, setActive] = useState(-1);\n const input = useRef<HTMLInputElement>(null);\n const panel = useRef<HTMLElement>(null);\n\n const matches = matchSuggestions(suggestions, text, locale, maxSuggestions);\n const shown = isOpen && matches.length > 0;\n\n function change(next: string) {\n if (value === undefined) setInnerValue(next);\n onChange?.(next);\n }\n\n function pick(suggestion: string) {\n change(suggestion);\n setOpen(false);\n setActive(-1);\n }\n\n // Under the field and as wide as it, following it while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!shown || !input.current || !panel.current) return;\n const place = () => {\n if (!input.current || !panel.current) return;\n panel.current.style.width = `${input.current.offsetWidth}px`;\n placePanel(input.current, panel.current, \"start\");\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [shown, matches.length]);\n\n useEffect(() => {\n if (!shown || active < 0) return;\n document.getElementById(`${listId}-${active}`)?.scrollIntoView?.({ block: \"nearest\" });\n }, [shown, active, listId]);\n\n function onKeyDown(event: KeyboardEvent<HTMLInputElement>) {\n rest.onKeyDown?.(event);\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!shown) {\n setOpen(true);\n setActive(event.key === \"ArrowDown\" ? 0 : matches.length - 1);\n return;\n }\n // Wraps around at both ends\n setActive((current) =>\n event.key === \"ArrowDown\" ? (current + 1) % matches.length : current <= 0 ? matches.length - 1 : current - 1\n );\n } else if (event.key === \"Enter\" && shown && active >= 0) {\n event.preventDefault();\n pick(matches[active]);\n } else if (event.key === \"Escape\" && shown) {\n // Only the list closes; a dialog around the field stays open\n event.preventDefault();\n setOpen(false);\n setActive(-1);\n } else if (event.key === \"Tab\") {\n setOpen(false);\n }\n }\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label id={labelId} className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <input\n // Names and places, not prose: no red underlines (a spellCheck prop still wins)\n spellCheck={false}\n {...rest}\n ref={input}\n id={ids.id}\n type=\"text\"\n role=\"combobox\"\n autoComplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded={shown}\n aria-controls={shown ? listId : undefined}\n aria-activedescendant={shown && active >= 0 ? `${listId}-${active}` : undefined}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-input\"\n disabled={disabled}\n value={text}\n onChange={(event) => {\n change(event.target.value);\n setOpen(true);\n setActive(-1);\n }}\n onKeyDown={onKeyDown}\n onBlur={(event) => {\n rest.onBlur?.(event);\n setOpen(false);\n setActive(-1);\n }}\n />\n <FieldMessages hint={hint} error={error} ids={ids} />\n\n {shown\n ? createPortal(\n <GlassPanel ref={panel} id={listId} role=\"listbox\" aria-labelledby={labelId} className=\"hds-typeahead-panel\">\n {matches.map((suggestion, index) => (\n <div\n key={suggestion}\n id={`${listId}-${index}`}\n role=\"option\"\n aria-selected={index === active}\n className=\"hds-typeahead-option\"\n // Keep focus in the field, so the click doesn't blur it and close the list first\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => pick(suggestion)}\n onMouseMove={() => setActive(index)}\n >\n <Highlight text={suggestion} query={text} locale={locale} />\n </div>\n ))}\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n /** States the \"yes\" (\"Pago\"), never a negative. */\n label: ReactNode;\n hint?: ReactNode;\n}\n\n/** A checkbox whose whole label is clickable. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, hint, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <label className={cx(\"hds-checkbox\", className)} htmlFor={ids.id}>\n <span className=\"hds-checkbox-control\">\n <input\n {...rest}\n ref={ref}\n id={ids.id}\n type=\"checkbox\"\n className=\"hds-checkbox-input\"\n aria-describedby={hint ? ids.hint : rest[\"aria-describedby\"]}\n />\n <span className=\"hds-checkbox-box\">\n <Icon name=\"check\" />\n </span>\n </span>\n <span className=\"hds-checkbox-text\">\n {label}\n {hint ? (\n <span id={ids.hint} className=\"hds-hint\">\n {hint}\n </span>\n ) : null}\n </span>\n </label>\n );\n});\n","import type { ElementType, HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** The element to render. Default `article`; use `a` with `href` for a link card. */\n as?: ElementType;\n href?: string;\n /** An uppercase label above the title. */\n eyebrow?: ReactNode;\n title?: ReactNode;\n media?: { src: string; alt?: string };\n /** Actions or badges at the bottom. */\n footer?: ReactNode;\n /** The whole card is clickable; it scales up slightly on hover. */\n interactive?: boolean;\n}\n\n/** A solid raised block that groups one item's content. */\nexport function Card({\n as: Tag = \"article\",\n eyebrow,\n title,\n media,\n footer,\n interactive = false,\n className,\n children,\n ...rest\n}: CardProps) {\n return (\n <Tag {...rest} className={cx(\"hds-card\", interactive && \"hds-card--interactive\", className)}>\n {media ? <img className=\"hds-card-media\" src={media.src} alt={media.alt ?? \"\"} /> : null}\n <div className=\"hds-card-body\">\n {eyebrow ? <p className=\"hds-card-eyebrow\">{eyebrow}</p> : null}\n {title ? <h3 className=\"hds-card-title\">{title}</h3> : null}\n {children ? <div className=\"hds-card-text\">{children}</div> : null}\n </div>\n {footer ? <div className=\"hds-card-footer\">{footer}</div> : null}\n </Tag>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon, type IconName } from \"../../internal/Icon\";\n\nexport type BadgeTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICONS: Partial<Record<BadgeTone, IconName>> = {\n accent: \"info\",\n success: \"circle-check\",\n warning: \"triangle-alert\",\n danger: \"circle-x\",\n};\n\nexport interface BadgeProps {\n tone?: BadgeTone;\n /** A Lucide icon, or `false` for none. Status tones show their own icon by default. */\n icon?: ReactNode | false;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A small pill that states a status or a category in one or two words.\n * The word stays in ink; the tone shows in the icon and the tint, so color never carries the meaning alone.\n */\nexport function Badge({ tone = \"neutral\", icon, children, className }: BadgeProps) {\n const defaultIcon = TONE_ICONS[tone];\n const shownIcon = icon === false ? null : (icon ?? (defaultIcon ? <Icon name={defaultIcon} /> : null));\n\n return (\n <span className={cx(\"hds-badge\", `hds-badge--${tone}`, className)}>\n {shownIcon}\n {children}\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface TableColumn<Row> {\n key: string;\n header: ReactNode;\n /** Mono, tabular figures, right-aligned. */\n numeric?: boolean;\n align?: \"start\" | \"center\";\n /** Renders the cell from the row; by default the cell shows `row[key]`. */\n render?: (row: Row) => ReactNode;\n}\n\nexport interface TableProps<Row> {\n columns: TableColumn<Row>[];\n rows: Row[];\n /** Key of each row's unique id. Default `id`. */\n rowKey?: keyof Row & string;\n /** Names the table and its scroll region. */\n caption?: string;\n /** Keeps the caption for screen readers only. */\n hideCaption?: boolean;\n /** Shown when there are no rows. Default \"Nada para mostrar.\". */\n empty?: ReactNode;\n maxHeight?: number | string;\n /** Regular glass instead of a solid surface, for a table over the app's background rather than over other content. */\n glass?: boolean;\n className?: string;\n}\n\nfunction cellClass<Row>(column: TableColumn<Row>) {\n if (column.numeric) return \"hds-cell--numeric\";\n return column.align === \"center\" ? \"hds-cell--center\" : undefined;\n}\n\n/** A data table with a sticky header, roomy rows and aligned numbers, on a solid surface or on glass. */\nexport function Table<Row extends object>({\n columns,\n rows,\n rowKey = \"id\" as keyof Row & string,\n caption,\n hideCaption = false,\n empty = \"Nada para mostrar.\",\n maxHeight,\n glass = false,\n className,\n}: TableProps<Row>) {\n return (\n <div\n className={cx(\"hds-table-wrap\", \"hds-scroll\", glass && \"hds-glass hds-table-wrap--glass\", className)}\n role=\"region\"\n aria-label={caption}\n tabIndex={0}\n style={maxHeight !== undefined ? { maxHeight } : undefined}\n >\n <table className=\"hds-table\">\n {caption ? <caption className={hideCaption ? \"hds-visually-hidden\" : undefined}>{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th key={column.key} scope=\"col\" className={cellClass(column)}>\n {column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length ? (\n rows.map((row, index) => (\n <tr key={String(row[rowKey] ?? index)}>\n {columns.map((column) => (\n <td key={column.key} className={cellClass(column)}>\n {column.render ? column.render(row) : (row[column.key as keyof Row] as ReactNode)}\n </td>\n ))}\n </tr>\n ))\n ) : (\n <tr>\n <td colSpan={columns.length || 1} className=\"hds-table-empty\">\n {empty}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useEffect, useSyncExternalStore } from \"react\";\nimport {\n applyStoredAppearance,\n getAppearance,\n setTheme,\n setTransparency,\n subscribeToAppearance,\n type Appearance,\n type Theme,\n type Transparency,\n} from \"./appearance\";\n\nlet initialized = false;\n\nconst serverAppearance: Appearance = { theme: \"dark\", transparency: \"full\" };\nlet lastSnapshot: Appearance = serverAppearance;\n\n// useSyncExternalStore needs the same object back while nothing has changed\nfunction snapshot(): Appearance {\n const current = getAppearance();\n if (current.theme !== lastSnapshot.theme || current.transparency !== lastSnapshot.transparency) {\n lastSnapshot = current;\n }\n return lastSnapshot;\n}\n\nexport interface UseAppearance extends Appearance {\n setTheme: (theme: Theme) => void;\n setTransparency: (transparency: Transparency) => void;\n toggleTheme: () => void;\n toggleTransparency: () => void;\n}\n\n/**\n * The page's theme and transparency, kept in sync across every component that uses it.\n * The first use applies the saved choice (dark when nothing is saved), unless the app already\n * called applyStoredAppearance() at startup.\n */\nexport function useAppearance(): UseAppearance {\n useEffect(() => {\n if (initialized) return;\n initialized = true;\n if (!document.documentElement.hasAttribute(\"data-theme\")) applyStoredAppearance();\n }, []);\n\n const appearance = useSyncExternalStore(subscribeToAppearance, snapshot, () => serverAppearance);\n\n return {\n ...appearance,\n setTheme,\n setTransparency,\n toggleTheme: () => setTheme(appearance.theme === \"dark\" ? \"light\" : \"dark\"),\n toggleTransparency: () => setTransparency(appearance.transparency === \"full\" ? \"reduced\" : \"full\"),\n };\n}\n","import { useAppearance } from \"../../appearance/useAppearance\";\nimport { Icon } from \"../../internal/Icon\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\n\ntype ToggleProps = Omit<ButtonProps, \"onClick\" | \"children\" | \"icon\" | \"iconOnly\" | \"aria-label\" | \"aria-pressed\">;\n\nexport interface ThemeToggleProps extends ToggleProps {\n /** Accessible name while dark. Default \"Mudar para o tema claro\". */\n lightLabel?: string;\n /** Accessible name while light. Default \"Mudar para o tema escuro\". */\n darkLabel?: string;\n}\n\n/** Switches between the dark theme (the default) and the light one, and remembers the choice. */\nexport function ThemeToggle({\n lightLabel = \"Mudar para o tema claro\",\n darkLabel = \"Mudar para o tema escuro\",\n variant = \"ghost\",\n ...rest\n}: ThemeToggleProps) {\n const { theme, toggleTheme } = useAppearance();\n const label = theme === \"dark\" ? lightLabel : darkLabel;\n\n return (\n <Button\n {...rest}\n variant={variant}\n iconOnly\n icon={<Icon name={theme === \"dark\" ? \"sun\" : \"moon\"} />}\n aria-label={label}\n title={label}\n onClick={toggleTheme}\n />\n );\n}\n\nexport interface TransparencyToggleProps extends ToggleProps {\n /** Accessible name. Default \"Reduzir transparência\"; the pressed state says whether it is on. */\n label?: string;\n}\n\n/** Turns every glass surface solid, or back to glass, and remembers the choice. */\nexport function TransparencyToggle({ label = \"Reduzir transparência\", variant = \"ghost\", ...rest }: TransparencyToggleProps) {\n const { transparency, toggleTransparency } = useAppearance();\n\n return (\n <Button\n {...rest}\n variant={variant}\n iconOnly\n icon={<Icon name=\"blend\" />}\n aria-label={label}\n aria-pressed={transparency === \"reduced\"}\n title={label}\n onClick={toggleTransparency}\n />\n );\n}\n","import type { ElementType, HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface ContainerProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Default `section`. */\n as?: ElementType;\n /** Adds the sidebar's width as left padding from 768px up. */\n withSidebar?: boolean;\n}\n\n/** Centres page content at content-max, with a section's vertical rhythm and the side gutter. */\nexport function Container({ as: Tag = \"section\", withSidebar = false, className, ...rest }: ContainerProps) {\n return <Tag {...rest} className={cx(\"hds-container\", withSidebar && \"hds-container--with-sidebar\", className)} />;\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface SectionTitleProps {\n children: ReactNode;\n /** Shown zero-padded (3 → \"03\") before the heading, only when sections are a sequence. */\n index?: number;\n /** Heading level. Default `h2`. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n id?: string;\n className?: string;\n}\n\n/** A page-section heading led by a glowing mono index, the portfolio's signature heading. */\nexport function SectionTitle({ children, index, as: Tag = \"h2\", id, className }: SectionTitleProps) {\n return (\n <Tag id={id} className={cx(\"hds-section-title\", className)}>\n {index !== undefined ? (\n <span className=\"hds-section-index\" aria-hidden=\"true\">\n {String(index).padStart(2, \"0\")}\n </span>\n ) : null}\n {children}\n </Tag>\n );\n}\n","import { cx } from \"../../internal/cx\";\n\nexport interface SeparatorProps {\n orientation?: \"horizontal\" | \"vertical\";\n /** Hides the line from screen readers when it only decorates. */\n decorative?: boolean;\n className?: string;\n}\n\n/** A 1px line that divides groups of content. */\nexport function Separator({ orientation = \"horizontal\", decorative = false, className }: SeparatorProps) {\n return (\n <div\n role={decorative ? \"none\" : \"separator\"}\n aria-orientation={decorative ? undefined : orientation}\n className={cx(\"hds-separator\", `hds-separator--${orientation}`, className)}\n />\n );\n}\n","import type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {\n /** Accessible name of the region. */\n label: string;\n maxHeight?: number | string;\n}\n\n/** A focusable scrollable region with the brand's slim scrollbars. */\nexport function ScrollArea({ label, maxHeight, className, style, ...rest }: ScrollAreaProps) {\n return (\n <div\n {...rest}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n className={cx(\"hds-scroll\", className)}\n style={{ maxHeight, ...style }}\n />\n );\n}\n","import { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface LoadingProps {\n /** sm 16px · md 24px · lg 32px. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Announced to screen readers. Default \"Carregando…\". */\n label?: string;\n /** Shows the label beside the spinner. */\n showLabel?: boolean;\n className?: string;\n}\n\n/** A spinner that tells assistive technology something is loading. */\nexport function Loading({ size = \"md\", label = \"Carregando…\", showLabel = false, className }: LoadingProps) {\n return (\n <span role=\"status\" className={cx(\"hds-loading\", `hds-loading--${size}`, className)}>\n <Icon name=\"loader\" />\n <span className={showLabel ? undefined : \"hds-visually-hidden\"}>{label}</span>\n </span>\n );\n}\n","import { cx } from \"../../internal/cx\";\n\nexport interface GlowAvatarProps {\n src: string;\n /** The person's name. */\n alt: string;\n /** Diameter in px. Default 96. */\n size?: number;\n className?: string;\n}\n\n/** A round photo ringed in the accent with a soft glow behind it. One per view. */\nexport function GlowAvatar({ src, alt, size = 96, className }: GlowAvatarProps) {\n return (\n <span className={cx(\"hds-avatar\", className)} style={{ width: size, height: size }}>\n <span className=\"hds-avatar-glow\" aria-hidden=\"true\" />\n <img className=\"hds-avatar-image\" src={src} alt={alt} width={size} height={size} />\n </span>\n );\n}\n"],"mappings":";;;;;;AACA,SAAgBY,EAAG,GAAGC,GAA2D;CAC/E,OAAOA,EAAQ,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACzC;;;ACaA,IAAaC,IAAaC,EAAyC,SACjE,EAAE,IAAIC,IAAM,OAAO,UAAO,WAAW,cAAW,GAAGC,KACnD,GACA;CACA,OAAO,kBAACD,GAAD;EAAK,GAAIC;EAAW;EAAK,WAAWL,EAAG,aAAaM,MAAS,aAAa,cAAcA,KAAQC,CAAS;CAAI,CAAA;AACtH,CAAC,GCjBKC,IAAO;CAAE,IAAI;CAAI,IAAI;CAAI,GAAG;AAAG,GAI/BC,IAAQ;CACZ,OAAO,CAAC,iBAAiB;CACzB,GAAG,CAAC,cAAc,YAAY;CAC9B,gBAAgB,CAAC,cAAc;CAC/B,gBAAgB,CAAC,gBAAgB;CACjC,iBAAiB,CAAC,eAAe;CACjC,UAAU;EAAC;EAAU;EAAW;EAAY;CAAyE;CACrH,gBAAgB,CAACD,GAAM,eAAe;CACtC,YAAY;EAACA;EAAM;EAAa;CAAU;CAC1C,kBAAkB;EAChB;EACA;EACA;CACF;CACA,MAAM;EAACA;EAAM;EAAa;CAAW;CACrC,QAAQ,CAAC,6BAA6B;CACtC,KAAK;EACH;GAAE,IAAI;GAAI,IAAI;GAAI,GAAG;EAAE;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,oCAAoC;CAC3C,OAAO,CACL;EAAE,IAAI;EAAG,IAAI;EAAG,GAAG;CAAE,GACrB;EAAE,IAAI;EAAI,IAAI;EAAI,GAAG;CAAE,CACzB;AACF;AASA,SAAgBE,EAAK,EAAE,SAAM,gBAAwB;CACnD,IAAMC,IAAkBF,EAAMG;CAC9B,OACE,kBAAC,OAAD;EACE,WAAWZ,EAAG,YAAYO,CAAS;EACnC,SAAQ;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;AAEL;;;ACPA,SAAgBC,GAAQ,EAAE,UAAO,MAAM,WAAQ,eAAe,eAAY,IAAO,gBAA2B;CAC1G,OACE,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAW3Q,EAAG,eAAe,gBAAgBoB,KAAQb,CAAS;EAAlF,UAAA,CACE,kBAACG,GAAD,EAAM,MAAK,SAAU,CAAA,GACrB,kBAAC,QAAD;GAAM,WAAWkQ,IAAY,KAAA,IAAY;GAAwB,UAAA7O;EAAY,CAAA,CACzE;;AAEV;;;ACTA,SAAgB8O,GAAW,EAAE,QAAK,QAAK,UAAO,IAAI,gBAA8B;CAC9E,OACE,kBAAC,QAAD;EAAM,WAAW7Q,EAAG,cAAcO,CAAS;EAAG,OAAO;GAAE,OAAOa;GAAM,QAAQA;EAAK;EAAjF,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,OAAD;GAAK,WAAU;GAAwB;GAAU;GAAK,OAAOA;GAAM,QAAQA;EAAO,CAAA,CAC9E;;AAEV"}
1
+ {"version":3,"file":"index.js","names":["_Fragment","TONE_ICONS","_Fragment","_Fragment","_Fragment","enableGlassRefraction","setTheme","readStoredAppearance","applyStoredAppearance","setTransparency","getAppearance","subscribeToAppearance","APPEARANCE_STORAGE_KEYS","cx","classes","GlassPanel","forwardRef","Tag","rest","tone","className","RING","ICONS","Icon","shapes","name","shape","index","Button","iconOnly","disabled","loading","variant","size","icon","children","NavBarLink","active","NavBarRoot","title","navLabel","actions","NavBar","Sidebar","label","floating","items","shared","item","footer","STEPS","SegmentedControl","innerValue","setInnerValue","useState","defaultValue","options","current","value","buttons","useRef","thumb","selectedIndex","option","measure","button","select","next","onChange","onKeyDown","step","event","nextIndex","isSelected","node","placePanel","anchor","trigger","width","panel","height","viewportWidth","viewportHeight","fitsBelow","fitsAbove","top","preferredLeft","align","left","Menu","isOpen","setOpen","id","useId","menuItems","close","returnFocus","useLayoutEffect","place","useEffect","onPointerDown","target","list","triggerVariant","createPortal","header","Fragment","FloatingButton","position","FOCUSABLE","Dialog","titleId","descriptionId","onCloseRef","onClose","open","previous","previousOverflow","focusables","initialFocus","first","last","description","closeLabel","TONE_ICONS$1","ToastView","isPaused","setPaused","duration","timer","Toast","ToastContext","createContext","ToastProvider","toasts","setToasts","nextId","dismiss","useCallback","toast","show","max","api","useMemo","useToast","useContext","useFieldIds","generated","fieldId","describedBy","props","ids","FieldMessages","hint","error","Input","hideLabel","numeric","Select","placeholder","toIso","pad","date","fromIso","match","formatTyped","n","parseTyped","trimmed","text","parts","day","month","year","addDays","days","addMonths","months","lastDay","monthGrid","start","weekStartsOn","week","isWithin","min","today","DateInput","setText","focused","setFocused","field","moveFocus","shownValue","setShownValue","commit","onType","raw","parsed","pick","iso","moveTo","onGridKeyDown","onPanelKeyDown","monthName","locale","monthTitle","dayName","weekdays","focusedIso","todayIso","calendarLabel","previousMonthLabel","nextMonthLabel","weekday","allowed","fold","matchSuggestions","query","unique","suggestions","s","suggestion","at","a","b","Highlight","end","Typeahead","listId","labelId","setActive","input","matches","maxSuggestions","shown","change","TONES","defaultFormat","BarChart","tones","series","total","datum","sum","data","share","stacked","orientation","empty","formatValue","Checkbox","Card","interactive","media","eyebrow","TONE_ICONS","Badge","defaultIcon","shownIcon","cellClass","column","Table","glass","caption","maxHeight","hideCaption","columns","rows","row","rowKey","initialized","serverAppearance","lastSnapshot","snapshot","useAppearance","appearance","useSyncExternalStore","ThemeToggle","theme","lightLabel","darkLabel","toggleTheme","TransparencyToggle","transparency","toggleTransparency","Container","withSidebar","SectionTitle","Separator","decorative","ScrollArea","style","Loading","showLabel","GlowAvatar"],"sources":["../src/internal/cx.ts","../src/components/GlassPanel/GlassPanel.tsx","../src/internal/Icon.tsx","../src/components/Button/Button.tsx","../src/components/NavBar/NavBar.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/SegmentedControl/SegmentedControl.tsx","../src/internal/placement.ts","../src/components/Menu/Menu.tsx","../src/components/FloatingButton/FloatingButton.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Toast/ToastView.tsx","../src/components/Toast/Toast.tsx","../src/components/Toast/ToastProvider.tsx","../src/internal/field.tsx","../src/components/Input/Input.tsx","../src/components/Select/Select.tsx","../src/components/DateInput/dates.ts","../src/components/DateInput/DateInput.tsx","../src/components/Typeahead/Typeahead.tsx","../src/components/BarChart/BarChart.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Card/Card.tsx","../src/components/Badge/Badge.tsx","../src/components/Table/Table.tsx","../src/appearance/useAppearance.ts","../src/components/AppearanceToggles/AppearanceToggles.tsx","../src/components/Container/Container.tsx","../src/components/SectionTitle/SectionTitle.tsx","../src/components/Separator/Separator.tsx","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Loading/Loading.tsx","../src/components/GlowAvatar/GlowAvatar.tsx"],"sourcesContent":["/** Joins the truthy class names. */\nexport function cx(...classes: Array<string | false | null | undefined>): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import { forwardRef, type ElementType, type HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport type GlassTone = \"regular\" | \"clear\" | \"thick\" | \"accent\";\n\nexport interface GlassPanelProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Default `div`. */\n as?: ElementType;\n /**\n * regular (default, the only tone for text) · clear (icon-only controls over the app's own surfaces)\n * · thick (dialogs and sheets) · accent (one prominent floating control per view).\n */\n tone?: GlassTone;\n}\n\n/** Liquid glass: the material of every surface that floats above the content. */\nexport const GlassPanel = forwardRef<HTMLElement, GlassPanelProps>(function GlassPanel(\n { as: Tag = \"div\", tone = \"regular\", className, ...rest },\n ref\n) {\n return <Tag {...rest} ref={ref} className={cx(\"hds-glass\", tone !== \"regular\" && `hds-glass--${tone}`, className)} />;\n});\n","import { cx } from \"./cx\";\n\ntype Shape = string | { cx: number; cy: number; r: number };\n\nconst RING = { cx: 12, cy: 12, r: 10 };\n\n// The few Lucide icons (ISC licence) the components draw themselves: a string is a path,\n// an object a circle. Projects pass any other icon from lucide-react.\nconst ICONS = {\n check: [\"M20 6 9 17l-5-5\"],\n x: [\"M18 6 6 18\", \"m6 6 12 12\"],\n \"chevron-down\": [\"m6 9 6 6 6-6\"],\n \"chevron-left\": [\"m15 18-6-6 6-6\"],\n \"chevron-right\": [\"m9 18 6-6-6-6\"],\n calendar: [\"M8 2v4\", \"M16 2v4\", \"M3 10h18\", \"M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z\"],\n \"circle-check\": [RING, \"m9 12 2 2 4-4\"],\n \"circle-x\": [RING, \"m15 9-6 6\", \"m9 9 6 6\"],\n \"triangle-alert\": [\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n \"M12 9v4\",\n \"M12 17h.01\",\n ],\n info: [RING, \"M12 16v-4\", \"M12 8h.01\"],\n loader: [\"M21 12a9 9 0 1 1-6.219-8.56\"],\n sun: [\n { cx: 12, cy: 12, r: 4 },\n \"M12 2v2\",\n \"M12 20v2\",\n \"m4.93 4.93 1.41 1.41\",\n \"m17.66 17.66 1.41 1.41\",\n \"M2 12h2\",\n \"M20 12h2\",\n \"m6.34 17.66-1.41 1.41\",\n \"m19.07 4.93-1.41 1.41\",\n ],\n moon: [\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"],\n blend: [\n { cx: 9, cy: 9, r: 7 },\n { cx: 15, cy: 15, r: 7 },\n ],\n} satisfies Record<string, Shape[]>;\n\nexport type IconName = keyof typeof ICONS;\n\ntype IconProps = {\n name: IconName;\n className?: string;\n};\n\nexport function Icon({ name, className }: IconProps) {\n const shapes: Shape[] = ICONS[name];\n return (\n <svg\n className={cx(\"hds-icon\", className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {shapes.map((shape, index) =>\n typeof shape === \"string\" ? <path key={index} d={shape} /> : <circle key={index} cx={shape.cx} cy={shape.cy} r={shape.r} />\n )}\n </svg>\n );\n}\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"glass\" | \"ghost\" | \"danger\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** primary (one per view) · secondary · glass (over content or in glass bars) · ghost · danger (destructive). */\n variant?: ButtonVariant;\n /** sm 32px · md 40px · lg 56px, as on the portfolio. */\n size?: ButtonSize;\n /** A Lucide icon, shown before the label. */\n icon?: ReactNode;\n /** Shows only the icon. Requires `aria-label`. */\n iconOnly?: boolean;\n /** Shows a spinner, disables the button and sets `aria-busy`. */\n loading?: boolean;\n}\n\n/** Triggers an action. Labels are set uppercase and bold, verb first. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"primary\",\n size = \"md\",\n icon,\n iconOnly = false,\n loading = false,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n) {\n if (iconOnly && !rest[\"aria-label\"] && !rest[\"aria-labelledby\"]) {\n console.warn(\"Button: an icon-only button needs an aria-label.\");\n }\n\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={cx(\n \"hds-btn\",\n `hds-btn--${variant}`,\n size !== \"md\" && `hds-btn--${size}`,\n iconOnly && \"hds-btn--icon\",\n variant === \"glass\" && \"hds-glass\",\n className\n )}\n >\n {loading ? <Icon name=\"loader\" className=\"hds-spin\" /> : icon}\n {iconOnly ? null : children}\n </button>\n );\n});\n","import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface NavBarProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** Product or page name on the left. */\n title?: ReactNode;\n /** Buttons on the right. */\n actions?: ReactNode;\n /** Name of the navigation landmark. Default \"Principal\". */\n navLabel?: string;\n}\n\nexport interface NavBarLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Marks the current page. */\n active?: boolean;\n}\n\nfunction NavBarLink({ active = false, className, ...rest }: NavBarLinkProps) {\n return <a {...rest} aria-current={active ? \"page\" : undefined} className={cx(\"hds-navbar-link\", className)} />;\n}\n\nfunction NavBarRoot({ title, actions, navLabel = \"Principal\", className, children, ...rest }: NavBarProps) {\n return (\n <GlassPanel {...rest} as=\"header\" className={cx(\"hds-navbar\", className)}>\n {title ? <p className=\"hds-navbar-title\">{title}</p> : null}\n {children ? (\n <nav className=\"hds-navbar-nav\" aria-label={navLabel}>\n {children}\n </nav>\n ) : null}\n {actions ? <div className=\"hds-navbar-actions\">{actions}</div> : null}\n </GlassPanel>\n );\n}\n\n/** The app's top bar: a floating glass capsule with the product name, the main sections and the global actions. */\nexport const NavBar = Object.assign(NavBarRoot, { Link: NavBarLink });\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface SidebarItem {\n /** Accessible name and tooltip. */\n label: string;\n icon: ReactNode;\n href?: string;\n onClick?: () => void;\n active?: boolean;\n}\n\nexport interface SidebarProps {\n items: SidebarItem[];\n /** Items pinned to the bottom, such as settings. */\n footer?: ReactNode;\n /** A free-floating capsule instead of a rail attached to the edge. */\n floating?: boolean;\n /** Name of the navigation landmark. Default \"Navegação\". */\n label?: string;\n className?: string;\n}\n\n/** A slim glass rail of icon buttons for the app's main sections. */\nexport function Sidebar({ items, footer, floating = false, label = \"Navegação\", className }: SidebarProps) {\n return (\n <GlassPanel as=\"nav\" aria-label={label} className={cx(\"hds-sidebar\", floating && \"hds-sidebar--floating\", className)}>\n <ul className=\"hds-sidebar-items\">\n {items.map((item) => {\n const shared = {\n \"aria-label\": item.label,\n title: item.label,\n \"aria-current\": item.active ? (\"page\" as const) : undefined,\n className: \"hds-sidebar-item\",\n };\n return (\n <li key={item.label}>\n {item.href ? (\n <a {...shared} href={item.href} onClick={item.onClick}>\n {item.icon}\n </a>\n ) : (\n <button {...shared} type=\"button\" onClick={item.onClick}>\n {item.icon}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n {footer ? <div className=\"hds-sidebar-footer\">{footer}</div> : null}\n </GlassPanel>\n );\n}\n","import { useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface SegmentedOption<T extends string | number = string> {\n value: T;\n label?: ReactNode;\n icon?: ReactNode;\n /** Accessible name when the label is only an icon or a flag. */\n ariaLabel?: string;\n}\n\nexport interface SegmentedControlProps<T extends string | number = string> {\n options: SegmentedOption<T>[];\n /** The selected value, for a controlled control. */\n value?: T;\n /** The initially selected value, for an uncontrolled control. */\n defaultValue?: T;\n onChange?: (value: T) => void;\n /** Name of the group. */\n label: string;\n className?: string;\n}\n\nconst STEPS: Record<string, number> = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };\n\n/** Switches between two to four exclusive options with a lit thumb that slides between them. */\nexport function SegmentedControl<T extends string | number = string>({\n options,\n value,\n defaultValue,\n onChange,\n label,\n className,\n}: SegmentedControlProps<T>) {\n const [innerValue, setInnerValue] = useState<T | undefined>(defaultValue ?? options[0]?.value);\n const current = value !== undefined ? value : innerValue;\n const buttons = useRef<Array<HTMLButtonElement | null>>([]);\n const thumb = useRef<HTMLSpanElement>(null);\n\n const selectedIndex = Math.max(\n 0,\n options.findIndex((option) => option.value === current)\n );\n\n // The thumb is positioned directly on the DOM node: it follows the selected option's size\n useLayoutEffect(() => {\n function measure() {\n const button = buttons.current[selectedIndex];\n if (!button || !thumb.current) return;\n thumb.current.style.width = `${button.offsetWidth}px`;\n thumb.current.style.transform = `translateX(${button.offsetLeft - 4}px)`;\n thumb.current.style.opacity = \"1\";\n }\n measure();\n window.addEventListener(\"resize\", measure);\n return () => window.removeEventListener(\"resize\", measure);\n }, [selectedIndex, options.length]);\n\n function select(next: T) {\n if (value === undefined) setInnerValue(next);\n onChange?.(next);\n }\n\n function onKeyDown(event: KeyboardEvent) {\n const step = STEPS[event.key];\n if (!step) return;\n event.preventDefault();\n const nextIndex = (selectedIndex + step + options.length) % options.length;\n select(options[nextIndex].value);\n buttons.current[nextIndex]?.focus();\n }\n\n return (\n <GlassPanel role=\"radiogroup\" aria-label={label} className={cx(\"hds-segmented\", className)} onKeyDown={onKeyDown}>\n <span ref={thumb} className=\"hds-segmented-thumb\" aria-hidden=\"true\" style={{ opacity: 0 }} />\n {options.map((option, index) => {\n const isSelected = index === selectedIndex;\n return (\n <button\n key={String(option.value)}\n ref={(node) => {\n buttons.current[index] = node;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={option.ariaLabel}\n tabIndex={isSelected ? 0 : -1}\n className=\"hds-segmented-option\"\n onClick={() => select(option.value)}\n >\n {option.icon}\n {option.label}\n </button>\n );\n })}\n </GlassPanel>\n );\n}\n","/** Space between the trigger and the panel, and the closest the panel gets to the window edge. */\nexport const GAP = 8;\n\n/**\n * Places a panel under its trigger, or above it when there is no room below. The panel lives\n * in <body> with fixed positioning, so scroll containers (a table, a dialog) never clip it.\n */\nexport function placePanel(trigger: HTMLElement, panel: HTMLElement, align: \"start\" | \"end\") {\n const anchor = trigger.getBoundingClientRect();\n const width = panel.offsetWidth;\n const height = panel.offsetHeight;\n const viewportWidth = document.documentElement.clientWidth || window.innerWidth;\n const viewportHeight = document.documentElement.clientHeight || window.innerHeight;\n\n const fitsBelow = anchor.bottom + GAP + height <= viewportHeight - GAP;\n const fitsAbove = anchor.top - GAP - height >= GAP;\n const top = fitsBelow || !fitsAbove ? anchor.bottom + GAP : anchor.top - GAP - height;\n\n const preferredLeft = align === \"end\" ? anchor.right - width : anchor.left;\n const left = Math.min(Math.max(GAP, preferredLeft), Math.max(GAP, viewportWidth - width - GAP));\n\n panel.style.top = `${Math.round(top)}px`;\n panel.style.left = `${Math.round(left)}px`;\n panel.dataset.side = fitsBelow || !fitsAbove ? \"bottom\" : \"top\";\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { Button, type ButtonVariant } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\nimport { placePanel } from \"../../internal/placement\";\n\nexport type MenuItem =\n | { label: string; icon?: ReactNode; onSelect?: () => void; danger?: boolean; separator?: never }\n | { separator: true };\n\nexport interface MenuProps {\n /** Trigger text, or its accessible name with `iconOnly`. */\n label: string;\n icon?: ReactNode;\n iconOnly?: boolean;\n items: MenuItem[];\n /** Which edge of the trigger the list lines up with. Default `end`. */\n align?: \"start\" | \"end\";\n /** Default `glass`. */\n triggerVariant?: ButtonVariant;\n /**\n * Context shown at the top of the list, such as the signed-in account. Not an action:\n * screen readers hear it as the list's description.\n */\n header?: ReactNode;\n className?: string;\n}\n\n/** A button that opens a glass list of actions. */\nexport function Menu({ label, icon, iconOnly = false, items, align = \"end\", triggerVariant = \"glass\", header, className }: MenuProps) {\n const [isOpen, setOpen] = useState(false);\n const trigger = useRef<HTMLButtonElement>(null);\n const panel = useRef<HTMLElement>(null);\n const id = useId();\n\n const menuItems = () => Array.from(panel.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n\n function close(returnFocus: boolean) {\n setOpen(false);\n if (returnFocus) trigger.current?.focus();\n }\n\n // Position before the first paint, then follow the trigger while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!isOpen || !trigger.current || !panel.current) return;\n const place = () => {\n if (trigger.current && panel.current) placePanel(trigger.current, panel.current, align);\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [isOpen, align]);\n\n useEffect(() => {\n if (!isOpen) return;\n menuItems()[0]?.focus();\n\n function onPointerDown(event: MouseEvent) {\n const target = event.target as Node;\n if (trigger.current?.contains(target) || panel.current?.contains(target)) return;\n setOpen(false);\n }\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n }, [isOpen]);\n\n function onKeyDown(event: KeyboardEvent) {\n const list = menuItems();\n const index = list.indexOf(document.activeElement as HTMLElement);\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\") {\n // The list sits at the end of <body>, so let focus return to the trigger's place\n event.preventDefault();\n close(true);\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n const step = event.key === \"ArrowDown\" ? 1 : -1;\n list[(index + step + list.length) % list.length]?.focus();\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n (event.key === \"Home\" ? list[0] : list[list.length - 1])?.focus();\n }\n }\n\n return (\n <div className={cx(\"hds-menu\", className)}>\n <Button\n ref={trigger}\n variant={triggerVariant}\n icon={icon}\n iconOnly={iconOnly}\n aria-label={iconOnly ? label : undefined}\n aria-haspopup=\"menu\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? id : undefined}\n onClick={() => setOpen(!isOpen)}\n >\n {label}\n </Button>\n\n {isOpen\n ? createPortal(\n <GlassPanel\n ref={panel}\n id={id}\n role=\"menu\"\n aria-label={label}\n aria-describedby={header ? `${id}-header` : undefined}\n className=\"hds-menu-panel\"\n onKeyDown={onKeyDown}\n >\n {header ? (\n <>\n <div id={`${id}-header`} role=\"none\" className=\"hds-menu-header\">\n {header}\n </div>\n <div role=\"separator\" className=\"hds-menu-separator\" />\n </>\n ) : null}\n {items.map((item, index) =>\n item.separator ? (\n <div key={`separator-${index}`} role=\"separator\" className=\"hds-menu-separator\" />\n ) : (\n <button\n key={item.label}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n className={cx(\"hds-menu-item\", item.danger && \"hds-menu-item--danger\")}\n onClick={() => {\n close(true);\n item.onSelect?.();\n }}\n >\n {item.icon}\n {item.label}\n </button>\n )\n )}\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import { forwardRef, type ButtonHTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport type FloatingButtonPosition = \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\";\n\nexport interface FloatingButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Accessible name and tooltip. */\n label: string;\n position?: FloatingButtonPosition;\n}\n\n/** A round glass button fixed to a corner of the viewport, for one persistent action. */\nexport const FloatingButton = forwardRef<HTMLButtonElement, FloatingButtonProps>(function FloatingButton(\n { label, position = \"bottom-right\", type = \"button\", className, ...rest },\n ref\n) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n aria-label={label}\n title={label}\n className={cx(\"hds-glass\", \"hds-fab\", `hds-fab--${position}`, className)}\n />\n );\n});\n","import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport interface DialogProps {\n open: boolean;\n /** Called on Escape, on the close button and on a click outside the panel. */\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n children?: ReactNode;\n /** The buttons, main action last. */\n footer?: ReactNode;\n /** Accessible name of the close button. Default \"Fechar\". */\n closeLabel?: string;\n /** `panel` focuses the panel itself instead of its first control. */\n initialFocus?: \"first\" | \"panel\";\n /** md (default, 560px) for forms and confirmations · lg (880px) for wide content such as a print preview. */\n size?: \"md\" | \"lg\";\n className?: string;\n}\n\n/** A modal panel of thick glass for a focused task or a confirmation. */\nexport function Dialog({\n open,\n onClose,\n title,\n description,\n children,\n footer,\n closeLabel = \"Fechar\",\n initialFocus = \"first\",\n size = \"md\",\n className,\n}: DialogProps) {\n const panel = useRef<HTMLElement>(null);\n const titleId = useId();\n const descriptionId = useId();\n\n // Always call the latest onClose, even from listeners added when the dialog opened\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n if (!open) return;\n\n const previous = document.activeElement as HTMLElement | null;\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n\n const focusables = panel.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? [];\n const target = initialFocus === \"panel\" || focusables.length === 0 ? panel.current : focusables[0];\n target?.focus();\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === \"Escape\") {\n // A menu or calendar open inside the dialog closes first, on its own Escape\n if (event.defaultPrevented) return;\n event.preventDefault();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || !panel.current) return;\n\n const list = Array.from(panel.current.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (list.length === 0) return;\n const first = list[0];\n const last = list[list.length - 1];\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n\n document.addEventListener(\"keydown\", onKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = previousOverflow;\n previous?.focus();\n };\n }, [open, initialFocus]);\n\n if (!open) return null;\n\n return createPortal(\n <div\n className=\"hds-scrim\"\n onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose();\n }}\n >\n <GlassPanel\n ref={panel}\n tone=\"thick\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description ? descriptionId : undefined}\n tabIndex={-1}\n className={cx(\"hds-dialog\", size !== \"md\" && `hds-dialog--${size}`, className)}\n >\n <div className=\"hds-dialog-header\">\n <div>\n <h2 id={titleId} className=\"hds-dialog-title\">\n {title}\n </h2>\n {description ? (\n <p id={descriptionId} className=\"hds-dialog-description\">\n {description}\n </p>\n ) : null}\n </div>\n <Button variant=\"ghost\" size=\"sm\" iconOnly icon={<Icon name=\"x\" />} aria-label={closeLabel} onClick={onClose} />\n </div>\n {children}\n {footer ? <div className=\"hds-dialog-footer\">{footer}</div> : null}\n </GlassPanel>\n </div>,\n document.body\n );\n}\n","import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon, type IconName } from \"../../internal/Icon\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport type ToastTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICONS: Record<ToastTone, IconName> = {\n neutral: \"info\",\n success: \"circle-check\",\n warning: \"triangle-alert\",\n danger: \"circle-x\",\n};\n\nexport interface ToastViewProps {\n tone: ToastTone;\n title: ReactNode;\n description?: ReactNode;\n /** Milliseconds before it closes itself; 0 keeps it open. */\n duration: number;\n onClose?: () => void;\n closeLabel: string;\n className?: string;\n}\n\n/** One toast: the glass card, its icon and close button, and a timer that pauses on hover or focus. */\nexport function ToastView({ tone, title, description, duration, onClose, closeLabel, className }: ToastViewProps) {\n const [isPaused, setPaused] = useState(false);\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n if (!duration || isPaused) return;\n const timer = window.setTimeout(() => onCloseRef.current?.(), duration);\n return () => window.clearTimeout(timer);\n }, [duration, isPaused]);\n\n return (\n <GlassPanel\n role={tone === \"danger\" ? \"alert\" : \"status\"}\n className={cx(\"hds-toast\", `hds-toast--${tone}`, className)}\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={() => setPaused(false)}\n >\n <Icon name={TONE_ICONS[tone]} />\n <div className=\"hds-toast-body\">\n <p className=\"hds-toast-title\">{title}</p>\n {description ? <p className=\"hds-toast-description\">{description}</p> : null}\n </div>\n {onClose ? (\n <Button variant=\"ghost\" size=\"sm\" iconOnly icon={<Icon name=\"x\" />} aria-label={closeLabel} onClick={onClose} />\n ) : null}\n </GlassPanel>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ToastView, type ToastTone } from \"./ToastView\";\n\nexport type { ToastTone } from \"./ToastView\";\n\nexport interface ToastProps {\n open: boolean;\n onClose?: () => void;\n tone?: ToastTone;\n title: ReactNode;\n description?: ReactNode;\n /** Milliseconds before it closes itself; 0 keeps it open. Default 5000. */\n duration?: number;\n /** Accessible name of the close button. Default \"Fechar aviso\". */\n closeLabel?: string;\n className?: string;\n}\n\n/**\n * A short glass notice at the bottom of the screen that confirms an action or reports a problem.\n * To raise toasts from anywhere in an app, wrap it in ToastProvider and use `useToast()` instead.\n */\nexport function Toast({\n open,\n onClose,\n tone = \"neutral\",\n title,\n description,\n duration = 5000,\n closeLabel = \"Fechar aviso\",\n className,\n}: ToastProps) {\n if (!open) return null;\n\n return createPortal(\n <div className=\"hds-toast-region\">\n <ToastView\n tone={tone}\n title={title}\n description={description}\n duration={duration}\n onClose={onClose}\n closeLabel={closeLabel}\n className={className}\n />\n </div>,\n document.body\n );\n}\n","import { createContext, useCallback, useContext, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ToastView, type ToastTone } from \"./ToastView\";\n\nexport interface ToastOptions {\n title: ReactNode;\n description?: ReactNode;\n tone?: ToastTone;\n /** Milliseconds before it closes itself; 0 keeps it open until dismissed. Default 5000. */\n duration?: number;\n}\n\nexport interface ToastApi {\n /** Shows a toast and returns its id, for `dismiss`. */\n show: (options: ToastOptions) => string;\n success: (title: ReactNode, description?: ReactNode) => string;\n error: (title: ReactNode, description?: ReactNode) => string;\n warning: (title: ReactNode, description?: ReactNode) => string;\n info: (title: ReactNode, description?: ReactNode) => string;\n dismiss: (id: string) => void;\n}\n\ninterface QueuedToast extends Required<Pick<ToastOptions, \"tone\" | \"duration\">> {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n}\n\nexport interface ToastProviderProps {\n children?: ReactNode;\n /** Most toasts shown at once; the oldest goes first. Default 3. */\n max?: number;\n /** Accessible name of each close button. Default \"Fechar aviso\". */\n closeLabel?: string;\n}\n\nconst ToastContext = createContext<ToastApi | null>(null);\n\n/** Shows the toasts raised with `useToast()` anywhere inside it, stacked at the bottom of the screen. */\nexport function ToastProvider({ children, max = 3, closeLabel = \"Fechar aviso\" }: ToastProviderProps) {\n const [toasts, setToasts] = useState<QueuedToast[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const show = useCallback(\n ({ title, description, tone = \"neutral\", duration = 5000 }: ToastOptions) => {\n const id = `hds-toast-${++nextId.current}`;\n setToasts((current) => [...current, { id, title, description, tone, duration }].slice(-max));\n return id;\n },\n [max]\n );\n\n const api = useMemo<ToastApi>(\n () => ({\n show,\n dismiss,\n success: (title, description) => show({ title, description, tone: \"success\" }),\n error: (title, description) => show({ title, description, tone: \"danger\" }),\n warning: (title, description) => show({ title, description, tone: \"warning\" }),\n info: (title, description) => show({ title, description, tone: \"neutral\" }),\n }),\n [show, dismiss]\n );\n\n return (\n <ToastContext.Provider value={api}>\n {children}\n {toasts.length\n ? createPortal(\n <div className=\"hds-toast-region\">\n {toasts.map((toast) => (\n <ToastView\n key={toast.id}\n tone={toast.tone}\n title={toast.title}\n description={toast.description}\n duration={toast.duration}\n closeLabel={closeLabel}\n onClose={() => dismiss(toast.id)}\n />\n ))}\n </div>,\n document.body\n )\n : null}\n </ToastContext.Provider>\n );\n}\n\n/** Raises toasts from anywhere inside a ToastProvider: `toast.success(\"Boleto salvo\")`. */\nexport function useToast(): ToastApi {\n const api = useContext(ToastContext);\n if (!api) throw new Error(\"useToast must be used inside a ToastProvider.\");\n return api;\n}\n","import { useId, type ReactNode } from \"react\";\nimport { Icon } from \"./Icon\";\n\nexport interface FieldTextProps {\n hint?: ReactNode;\n error?: ReactNode;\n \"aria-describedby\"?: string;\n}\n\n/** Ids for a field and its hint and error, so they can be linked with aria-describedby. */\nexport function useFieldIds(id?: string) {\n const generated = useId();\n const fieldId = id ?? generated;\n return { id: fieldId, hint: `${fieldId}-hint`, error: `${fieldId}-error` };\n}\n\nexport function describedBy(props: FieldTextProps, ids: ReturnType<typeof useFieldIds>) {\n const list = [props.hint && ids.hint, props.error && ids.error, props[\"aria-describedby\"]].filter(Boolean);\n return list.length ? list.join(\" \") : undefined;\n}\n\nexport function FieldMessages({ hint, error, ids }: FieldTextProps & { ids: ReturnType<typeof useFieldIds> }) {\n return (\n <>\n {hint ? (\n <p id={ids.hint} className=\"hds-hint\">\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={ids.error} className=\"hds-error\">\n <Icon name=\"circle-x\" />\n {error}\n </p>\n ) : null}\n </>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n /** Always visible, written as a noun (\"Beneficiário\"). */\n label: ReactNode;\n hint?: ReactNode;\n /** Says how to fix the value; also marks the input invalid. */\n error?: ReactNode;\n /** Mono, tabular figures and a decimal keyboard, for amounts and codes. */\n numeric?: boolean;\n}\n\n/** A labelled text field on a solid, recessed well. */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, hint, error, numeric = false, hideLabel = false, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <input\n inputMode={numeric ? \"decimal\" : undefined}\n {...rest}\n ref={ref}\n id={ids.id}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className={cx(\"hds-input\", numeric && \"hds-input--numeric\")}\n />\n <FieldMessages hint={hint} error={error} ids={ids} />\n </div>\n );\n});\n","import { forwardRef, type ReactNode, type SelectHTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n label: ReactNode;\n options: SelectOption[];\n /** Shown as a disabled first option. */\n placeholder?: string;\n hint?: ReactNode;\n error?: ReactNode;\n}\n\n/** A labelled native dropdown, styled like Input, for choosing one option from a short list. */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, options, placeholder, hint, error, hideLabel = false, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <div className=\"hds-select-wrap\">\n <select\n {...rest}\n ref={ref}\n id={ids.id}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-select\"\n >\n {placeholder ? (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n ) : null}\n {options.map((option) => (\n <option key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </option>\n ))}\n </select>\n <Icon name=\"chevron-down\" />\n </div>\n <FieldMessages hint={hint} error={error} ids={ids} />\n </div>\n );\n});\n","/** Calendar dates as \"yyyy-mm-dd\" strings, the value format of <input type=\"date\">, in local time. */\n\nexport function toIso(date: Date) {\n const pad = (value: number) => String(value).padStart(2, \"0\");\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\nexport function fromIso(value: string | undefined): Date | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value ?? \"\");\n if (!match) return null;\n const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n return toIso(date) === value ? date : null;\n}\n\n/** \"10/10/2026\" from \"2026-10-10\". */\nexport function formatTyped(value: string) {\n const date = fromIso(value);\n if (!date) return \"\";\n const pad = (n: number) => String(n).padStart(2, \"0\");\n return `${pad(date.getDate())}/${pad(date.getMonth() + 1)}/${date.getFullYear()}`;\n}\n\n/** \"2026-10-10\" from what was typed as day/month/year (\"10/10/2026\", \"1/2/2026\" or \"10102026\"), or null. */\nexport function parseTyped(text: string): string | null {\n const trimmed = text.trim();\n const parts = /^\\d{8}$/.test(trimmed)\n ? [trimmed.slice(0, 2), trimmed.slice(2, 4), trimmed.slice(4)]\n : /^(\\d{1,2})[/.-](\\d{1,2})[/.-](\\d{4})$/.exec(trimmed)?.slice(1);\n if (!parts) return null;\n const [day, month, year] = parts.map(Number);\n const date = new Date(year, month - 1, day);\n return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? toIso(date) : null;\n}\n\nexport function addDays(date: Date, days: number) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\n/** The same day in another month, or that month's last day when it is shorter. */\nexport function addMonths(date: Date, months: number) {\n const target = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));\n}\n\n/** Six weeks of days covering the month of `date`, each week starting on `weekStartsOn` (0 = Sunday). */\nexport function monthGrid(date: Date, weekStartsOn: number) {\n const first = new Date(date.getFullYear(), date.getMonth(), 1);\n const start = addDays(first, -((first.getDay() - weekStartsOn + 7) % 7));\n return Array.from({ length: 6 }, (_, week) => Array.from({ length: 7 }, (_, day) => addDays(start, week * 7 + day)));\n}\n\nexport function isWithin(value: string, min?: string, max?: string) {\n return (!min || value >= min) && (!max || value <= max);\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\nimport { placePanel } from \"../../internal/placement\";\nimport { Button } from \"../Button/Button\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\nimport { addDays, addMonths, formatTyped, fromIso, isWithin, monthGrid, parseTyped, toIso } from \"./dates\";\n\nexport interface DateInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"value\" | \"defaultValue\" | \"onChange\" | \"min\" | \"max\"> {\n label: ReactNode;\n /** The date as \"yyyy-mm-dd\", or \"\" for none: the format of <input type=\"date\">. */\n value?: string;\n defaultValue?: string;\n /** Called with \"yyyy-mm-dd\" when a whole valid date is typed or picked, and with \"\" when the field is cleared. */\n onChange?: (value: string) => void;\n /** Earliest and latest dates that can be picked or typed, as \"yyyy-mm-dd\". */\n min?: string;\n max?: string;\n hint?: ReactNode;\n error?: ReactNode;\n /** Locale of the month and weekday names. Default \"pt-BR\". */\n locale?: string;\n /** First day of the week, 0 for Sunday. Default 0. */\n weekStartsOn?: number;\n /** Accessible names. Defaults in Brazilian Portuguese. */\n calendarLabel?: string;\n previousMonthLabel?: string;\n nextMonthLabel?: string;\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n}\n\nconst today = () => toIso(new Date());\n\n/**\n * A date field: type day/month/year, or pick from a glass calendar. The value is \"yyyy-mm-dd\",\n * and with `name` a hidden input carries it, so forms read it like a native date input.\n */\nexport function DateInput({\n label,\n value,\n defaultValue = \"\",\n onChange,\n min,\n max,\n hint,\n error,\n locale = \"pt-BR\",\n weekStartsOn = 0,\n calendarLabel = \"Abrir calendário\",\n previousMonthLabel = \"Mês anterior\",\n nextMonthLabel = \"Próximo mês\",\n hideLabel = false,\n name,\n id,\n disabled,\n required,\n placeholder = \"dd/mm/aaaa\",\n className,\n ...rest\n}: DateInputProps) {\n const ids = useFieldIds(id);\n const [innerValue, setInnerValue] = useState(defaultValue);\n const current = value !== undefined ? value : innerValue;\n const [text, setText] = useState(() => formatTyped(current));\n const [isOpen, setOpen] = useState(false);\n const [focused, setFocused] = useState<Date>(() => fromIso(current) ?? new Date());\n const field = useRef<HTMLDivElement>(null);\n const button = useRef<HTMLButtonElement>(null);\n const panel = useRef<HTMLElement>(null);\n const moveFocus = useRef(false);\n\n // Follow a value set from outside, e.g. a form reset\n const [shownValue, setShownValue] = useState(current);\n if (shownValue !== current) {\n setShownValue(current);\n setText(formatTyped(current));\n }\n\n function commit(next: string) {\n if (value === undefined) setInnerValue(next);\n if (next !== current) onChange?.(next);\n }\n\n function onType(raw: string) {\n setText(raw);\n if (raw.trim() === \"\") {\n commit(\"\");\n return;\n }\n const parsed = parseTyped(raw);\n if (parsed && isWithin(parsed, min, max)) commit(parsed);\n }\n\n function open() {\n setFocused(fromIso(current) ?? fromIso(today()) ?? new Date());\n moveFocus.current = true;\n setOpen(true);\n }\n\n function close(returnFocus: boolean) {\n setOpen(false);\n if (returnFocus) button.current?.focus();\n }\n\n function pick(date: Date) {\n const iso = toIso(date);\n if (!isWithin(iso, min, max)) return;\n commit(iso);\n setText(formatTyped(iso));\n close(true);\n }\n\n // Position under the field, and follow it while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!isOpen || !field.current || !panel.current) return;\n const place = () => {\n if (field.current && panel.current) placePanel(field.current, panel.current, \"start\");\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [isOpen]);\n\n // Keyboard focus follows the focused day\n useEffect(() => {\n if (!isOpen || !moveFocus.current) return;\n moveFocus.current = false;\n panel.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus();\n });\n\n useEffect(() => {\n if (!isOpen) return;\n function onPointerDown(event: MouseEvent) {\n const target = event.target as Node;\n if (field.current?.contains(target) || panel.current?.contains(target)) return;\n setOpen(false);\n }\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n }, [isOpen]);\n\n function moveTo(date: Date) {\n moveFocus.current = true;\n setFocused(date);\n }\n\n function onGridKeyDown(event: KeyboardEvent) {\n const steps: Record<string, () => Date> = {\n ArrowLeft: () => addDays(focused, -1),\n ArrowRight: () => addDays(focused, 1),\n ArrowUp: () => addDays(focused, -7),\n ArrowDown: () => addDays(focused, 7),\n Home: () => addDays(focused, -((focused.getDay() - weekStartsOn + 7) % 7)),\n End: () => addDays(focused, 6 - ((focused.getDay() - weekStartsOn + 7) % 7)),\n PageUp: () => addMonths(focused, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(focused, event.shiftKey ? 12 : 1),\n };\n const step = steps[event.key];\n if (!step) return;\n event.preventDefault();\n moveTo(step());\n }\n\n function onPanelKeyDown(event: KeyboardEvent) {\n // Tab too: the calendar sits at the end of <body>, so focus goes back to the button's place\n if (event.key === \"Escape\" || event.key === \"Tab\") {\n event.preventDefault();\n close(true);\n }\n }\n\n // \"Outubro de 2026\": only the first letter, so words like \"de\" stay lowercase\n const monthName = new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(focused);\n const monthTitle = monthName.charAt(0).toLocaleUpperCase(locale) + monthName.slice(1);\n const dayName = new Intl.DateTimeFormat(locale, { dateStyle: \"full\" });\n const weekdays = monthGrid(focused, weekStartsOn)[0].map((day) => ({\n short: new Intl.DateTimeFormat(locale, { weekday: \"narrow\" }).format(day),\n long: new Intl.DateTimeFormat(locale, { weekday: \"long\" }).format(day),\n }));\n const focusedIso = toIso(focused);\n const todayIso = today();\n const titleId = `${ids.id}-calendar-title`;\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <div ref={field} className=\"hds-date-wrap\">\n <input\n {...rest}\n id={ids.id}\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n placeholder={placeholder}\n value={text}\n disabled={disabled}\n required={required}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-input hds-input--numeric hds-date-input\"\n onChange={(event) => onType(event.target.value)}\n onBlur={(event) => {\n rest.onBlur?.(event);\n // An incomplete or impossible date goes back to the last valid one\n if (text.trim() !== \"\" && parseTyped(text) !== current) setText(formatTyped(current));\n }}\n />\n <Button\n ref={button}\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"calendar\" />}\n aria-label={calendarLabel}\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n disabled={disabled}\n className=\"hds-date-button\"\n onClick={() => (isOpen ? close(false) : open())}\n />\n {name ? <input type=\"hidden\" name={name} value={current} /> : null}\n </div>\n <FieldMessages hint={hint} error={error} ids={ids} />\n\n {isOpen\n ? createPortal(\n <GlassPanel\n ref={panel}\n role=\"dialog\"\n tone=\"thick\"\n aria-labelledby={titleId}\n className=\"hds-date-panel\"\n onKeyDown={onPanelKeyDown}\n >\n <div className=\"hds-date-header\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"chevron-left\" />}\n aria-label={previousMonthLabel}\n onClick={() => setFocused(addMonths(focused, -1))}\n />\n <h2 id={titleId} className=\"hds-date-title\" aria-live=\"polite\">\n {monthTitle}\n </h2>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<Icon name=\"chevron-right\" />}\n aria-label={nextMonthLabel}\n onClick={() => setFocused(addMonths(focused, 1))}\n />\n </div>\n <table role=\"grid\" aria-labelledby={titleId} className=\"hds-date-grid\" onKeyDown={onGridKeyDown}>\n <thead>\n <tr>\n {weekdays.map((weekday) => (\n <th key={weekday.long} scope=\"col\" abbr={weekday.long}>\n {weekday.short}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {monthGrid(focused, weekStartsOn).map((week) => (\n <tr key={toIso(week[0])}>\n {week.map((day) => {\n const iso = toIso(day);\n const allowed = isWithin(iso, min, max);\n return (\n <td key={iso} role=\"gridcell\" aria-selected={iso === current}>\n <button\n type=\"button\"\n tabIndex={iso === focusedIso ? 0 : -1}\n aria-label={dayName.format(day)}\n aria-current={iso === todayIso ? \"date\" : undefined}\n aria-disabled={allowed ? undefined : true}\n className={cx(\n \"hds-date-day\",\n day.getMonth() !== focused.getMonth() && \"hds-date-day--outside\",\n iso === current && \"hds-date-day--selected\"\n )}\n onClick={() => pick(day)}\n >\n {day.getDate()}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cx } from \"../../internal/cx\";\nimport { describedBy, FieldMessages, useFieldIds } from \"../../internal/field\";\nimport { placePanel } from \"../../internal/placement\";\nimport { GlassPanel } from \"../GlassPanel/GlassPanel\";\n\nexport interface TypeaheadProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"value\" | \"defaultValue\" | \"onChange\"> {\n label: ReactNode;\n value?: string;\n defaultValue?: string;\n /** Called with the text on every keystroke and when a suggestion is picked. */\n onChange?: (value: string) => void;\n /** Values to suggest; repeats are shown once. Any text is still accepted. */\n suggestions: string[];\n /** Most suggestions shown at once. Default 8. */\n maxSuggestions?: number;\n hint?: ReactNode;\n error?: ReactNode;\n /** Locale for matching without case. Default \"pt-BR\". */\n locale?: string;\n /** Keeps the label for screen readers only, e.g. for a field inside a table cell. */\n hideLabel?: boolean;\n}\n\n/** Lowercase and without accents, so \"sao\" finds \"São Paulo\". */\nfunction fold(text: string, locale: string) {\n return text.normalize(\"NFD\").replace(/\\p{Diacritic}/gu, \"\").toLocaleLowerCase(locale);\n}\n\n/** The suggestions that contain the text, those that start with it first. */\nexport function matchSuggestions(suggestions: string[], text: string, locale = \"pt-BR\", max = 8) {\n const query = fold(text.trim(), locale);\n const unique = [...new Map(suggestions.filter(Boolean).map((s) => [fold(s, locale), s])).values()];\n if (!query) return unique.slice(0, max);\n return unique\n .map((suggestion) => ({ suggestion, at: fold(suggestion, locale).indexOf(query) }))\n .filter(({ suggestion, at }) => at >= 0 && fold(suggestion, locale) !== query)\n .sort((a, b) => (a.at === 0 ? 0 : 1) - (b.at === 0 ? 0 : 1) || a.suggestion.localeCompare(b.suggestion, locale))\n .slice(0, max)\n .map(({ suggestion }) => suggestion);\n}\n\n/** The suggestion with the part that matches the text marked. Folding keeps lengths, so indexes line up. */\nfunction Highlight({ text, query, locale }: { text: string; query: string; locale: string }) {\n const at = query.trim() ? fold(text, locale).indexOf(fold(query.trim(), locale)) : -1;\n if (at < 0) return <>{text}</>;\n const end = at + query.trim().length;\n return (\n <>\n {text.slice(0, at)}\n <mark className=\"hds-typeahead-match\">{text.slice(at, end)}</mark>\n {text.slice(end)}\n </>\n );\n}\n\n/** A text field that suggests values as you type, in a glass list. Free text is still allowed. */\nexport function Typeahead({\n label,\n value,\n defaultValue = \"\",\n onChange,\n suggestions,\n maxSuggestions = 8,\n hint,\n error,\n locale = \"pt-BR\",\n hideLabel = false,\n id,\n className,\n disabled,\n ...rest\n}: TypeaheadProps) {\n const ids = useFieldIds(id);\n const listId = `${ids.id}-list`;\n const labelId = `${ids.id}-label`;\n const [innerValue, setInnerValue] = useState(defaultValue);\n const text = value !== undefined ? value : innerValue;\n const [isOpen, setOpen] = useState(false);\n const [active, setActive] = useState(-1);\n const input = useRef<HTMLInputElement>(null);\n const panel = useRef<HTMLElement>(null);\n\n const matches = matchSuggestions(suggestions, text, locale, maxSuggestions);\n const shown = isOpen && matches.length > 0;\n\n function change(next: string) {\n if (value === undefined) setInnerValue(next);\n onChange?.(next);\n }\n\n function pick(suggestion: string) {\n change(suggestion);\n setOpen(false);\n setActive(-1);\n }\n\n // Under the field and as wide as it, following it while the page scrolls or resizes\n useLayoutEffect(() => {\n if (!shown || !input.current || !panel.current) return;\n const place = () => {\n if (!input.current || !panel.current) return;\n panel.current.style.width = `${input.current.offsetWidth}px`;\n placePanel(input.current, panel.current, \"start\");\n };\n place();\n window.addEventListener(\"scroll\", place, true);\n window.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"scroll\", place, true);\n window.removeEventListener(\"resize\", place);\n };\n }, [shown, matches.length]);\n\n useEffect(() => {\n if (!shown || active < 0) return;\n document.getElementById(`${listId}-${active}`)?.scrollIntoView?.({ block: \"nearest\" });\n }, [shown, active, listId]);\n\n function onKeyDown(event: KeyboardEvent<HTMLInputElement>) {\n rest.onKeyDown?.(event);\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!shown) {\n setOpen(true);\n setActive(event.key === \"ArrowDown\" ? 0 : matches.length - 1);\n return;\n }\n // Wraps around at both ends\n setActive((current) =>\n event.key === \"ArrowDown\" ? (current + 1) % matches.length : current <= 0 ? matches.length - 1 : current - 1\n );\n } else if (event.key === \"Enter\" && shown && active >= 0) {\n event.preventDefault();\n pick(matches[active]);\n } else if (event.key === \"Escape\" && shown) {\n // Only the list closes; a dialog around the field stays open\n event.preventDefault();\n setOpen(false);\n setActive(-1);\n } else if (event.key === \"Tab\") {\n setOpen(false);\n }\n }\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label id={labelId} className={cx(\"hds-label\", hideLabel && \"hds-visually-hidden\")} htmlFor={ids.id}>\n {label}\n </label>\n <input\n // Names and places, not prose: no red underlines (a spellCheck prop still wins)\n spellCheck={false}\n {...rest}\n ref={input}\n id={ids.id}\n type=\"text\"\n role=\"combobox\"\n autoComplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded={shown}\n aria-controls={shown ? listId : undefined}\n aria-activedescendant={shown && active >= 0 ? `${listId}-${active}` : undefined}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy({ hint, error, \"aria-describedby\": rest[\"aria-describedby\"] }, ids)}\n className=\"hds-input\"\n disabled={disabled}\n value={text}\n onChange={(event) => {\n change(event.target.value);\n setOpen(true);\n setActive(-1);\n }}\n onKeyDown={onKeyDown}\n onBlur={(event) => {\n rest.onBlur?.(event);\n setOpen(false);\n setActive(-1);\n }}\n />\n <FieldMessages hint={hint} error={error} ids={ids} />\n\n {shown\n ? createPortal(\n <GlassPanel ref={panel} id={listId} role=\"listbox\" aria-labelledby={labelId} className=\"hds-typeahead-panel\">\n {matches.map((suggestion, index) => (\n <div\n key={suggestion}\n id={`${listId}-${index}`}\n role=\"option\"\n aria-selected={index === active}\n className=\"hds-typeahead-option\"\n // Keep focus in the field, so the click doesn't blur it and close the list first\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => pick(suggestion)}\n onMouseMove={() => setActive(index)}\n >\n <Highlight text={suggestion} query={text} locale={locale} />\n </div>\n ))}\n </GlassPanel>,\n document.body\n )\n : null}\n </div>\n );\n}\n","import { useId, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport type ChartTone = \"accent\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n\nexport interface ChartSeries {\n name: string;\n /** Default: accent, then secondary, warning and so on, in order. */\n tone?: ChartTone;\n}\n\nexport interface ChartDatum {\n label: string;\n /** One value per series, in the same order. */\n values: number[];\n}\n\nexport interface BarChartProps {\n /** Names the chart: shown above it and used as the accessible name. */\n title: ReactNode;\n data: ChartDatum[];\n /** One series by default; several stack in each bar, with a legend. */\n series?: ChartSeries[];\n /** `vertical`: bars rise from a baseline, for time. `horizontal`: one row per label, for rankings. Default `vertical`. */\n orientation?: \"vertical\" | \"horizontal\";\n /** How values read in labels and in the data table. Default: the number in pt-BR. */\n formatValue?: (value: number) => string;\n /** Shown instead of the bars when there is no data. Default \"Nada para mostrar.\". */\n empty?: ReactNode;\n /** Height of the bar area in vertical charts, in px. Default 200. */\n height?: number;\n className?: string;\n}\n\nconst TONES: ChartTone[] = [\"accent\", \"secondary\", \"warning\", \"success\", \"danger\", \"neutral\"];\nconst defaultFormat = (value: number) => value.toLocaleString(\"pt-BR\");\n\n/**\n * Bars for comparing a few values: a vertical chart over time, or a horizontal ranking.\n * Several series stack in each bar. The bars are drawn for sighted users and hidden from\n * screen readers, which get the same numbers as a table.\n */\nexport function BarChart({\n title,\n data,\n series = [{ name: \"Valor\" }],\n orientation = \"vertical\",\n formatValue = defaultFormat,\n empty = \"Nada para mostrar.\",\n height = 200,\n className,\n}: BarChartProps) {\n const titleId = useId();\n const tones = series.map((item, index) => item.tone ?? TONES[index % TONES.length]);\n const total = (datum: ChartDatum) => datum.values.reduce((sum, value) => sum + Math.max(0, value), 0);\n const max = Math.max(0, ...data.map(total));\n const share = (value: number) => (max > 0 ? (Math.max(0, value) / max) * 100 : 0);\n const stacked = series.length > 1;\n\n return (\n <figure aria-labelledby={titleId} className={cx(\"hds-chart\", `hds-chart--${orientation}`, className)}>\n <figcaption id={titleId} className=\"hds-chart-title\">\n {title}\n </figcaption>\n\n {data.length === 0 || max === 0 ? (\n <p className=\"hds-chart-empty\">{empty}</p>\n ) : (\n <>\n {stacked ? (\n <ul className=\"hds-chart-legend\" aria-hidden=\"true\">\n {series.map((item, index) => (\n <li key={item.name}>\n <span className={cx(\"hds-chart-swatch\", `hds-chart-tone--${tones[index]}`)} />\n {item.name}\n </li>\n ))}\n </ul>\n ) : null}\n\n {orientation === \"vertical\" ? (\n <div className=\"hds-chart-columns\" aria-hidden=\"true\" style={{ height }}>\n {data.map((datum) => (\n <div key={datum.label} className=\"hds-chart-column\">\n <div className=\"hds-chart-plot\">\n <span className=\"hds-chart-value\">{formatValue(total(datum))}</span>\n <div className=\"hds-chart-stack\" style={{ height: `${share(total(datum))}%` }}>\n {datum.values.map((value, index) =>\n value > 0 ? (\n <span\n key={series[index]?.name ?? index}\n className={cx(\"hds-chart-bar\", `hds-chart-tone--${tones[index]}`)}\n style={{ flexGrow: value }}\n />\n ) : null\n )}\n </div>\n </div>\n <span className=\"hds-chart-label\">{datum.label}</span>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"hds-chart-rows\" aria-hidden=\"true\">\n {data.map((datum) => (\n <div key={datum.label} className=\"hds-chart-row\">\n <span className=\"hds-chart-label\">{datum.label}</span>\n <div className=\"hds-chart-track\">\n <div className=\"hds-chart-stack\" style={{ width: `${share(total(datum))}%` }}>\n {datum.values.map((value, index) =>\n value > 0 ? (\n <span\n key={series[index]?.name ?? index}\n className={cx(\"hds-chart-bar\", `hds-chart-tone--${tones[index]}`)}\n style={{ flexGrow: value }}\n />\n ) : null\n )}\n </div>\n </div>\n <span className=\"hds-chart-value\">{formatValue(total(datum))}</span>\n </div>\n ))}\n </div>\n )}\n\n <table className=\"hds-visually-hidden\">\n <thead>\n <tr>\n <th scope=\"col\">{typeof title === \"string\" ? title : \"\"}</th>\n {series.map((item) => (\n <th key={item.name} scope=\"col\">\n {item.name}\n </th>\n ))}\n {stacked ? <th scope=\"col\">Total</th> : null}\n </tr>\n </thead>\n <tbody>\n {data.map((datum) => (\n <tr key={datum.label}>\n <th scope=\"row\">{datum.label}</th>\n {series.map((item, index) => (\n <td key={item.name}>{formatValue(datum.values[index] ?? 0)}</td>\n ))}\n {stacked ? <td>{formatValue(total(datum))}</td> : null}\n </tr>\n ))}\n </tbody>\n </table>\n </>\n )}\n </figure>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { useFieldIds } from \"../../internal/field\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n /** States the \"yes\" (\"Pago\"), never a negative. */\n label: ReactNode;\n hint?: ReactNode;\n}\n\n/** A checkbox whose whole label is clickable. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, hint, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <label className={cx(\"hds-checkbox\", className)} htmlFor={ids.id}>\n <span className=\"hds-checkbox-control\">\n <input\n {...rest}\n ref={ref}\n id={ids.id}\n type=\"checkbox\"\n className=\"hds-checkbox-input\"\n aria-describedby={hint ? ids.hint : rest[\"aria-describedby\"]}\n />\n <span className=\"hds-checkbox-box\">\n <Icon name=\"check\" />\n </span>\n </span>\n <span className=\"hds-checkbox-text\">\n {label}\n {hint ? (\n <span id={ids.hint} className=\"hds-hint\">\n {hint}\n </span>\n ) : null}\n </span>\n </label>\n );\n});\n","import type { ElementType, HTMLAttributes, ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n /** The element to render. Default `article`; use `a` with `href` for a link card. */\n as?: ElementType;\n href?: string;\n /** An uppercase label above the title. */\n eyebrow?: ReactNode;\n title?: ReactNode;\n media?: { src: string; alt?: string };\n /** Actions or badges at the bottom. */\n footer?: ReactNode;\n /** The whole card is clickable; it scales up slightly on hover. */\n interactive?: boolean;\n}\n\n/** A solid raised block that groups one item's content. */\nexport function Card({\n as: Tag = \"article\",\n eyebrow,\n title,\n media,\n footer,\n interactive = false,\n className,\n children,\n ...rest\n}: CardProps) {\n return (\n <Tag {...rest} className={cx(\"hds-card\", interactive && \"hds-card--interactive\", className)}>\n {media ? <img className=\"hds-card-media\" src={media.src} alt={media.alt ?? \"\"} /> : null}\n <div className=\"hds-card-body\">\n {eyebrow ? <p className=\"hds-card-eyebrow\">{eyebrow}</p> : null}\n {title ? <h3 className=\"hds-card-title\">{title}</h3> : null}\n {children ? <div className=\"hds-card-text\">{children}</div> : null}\n </div>\n {footer ? <div className=\"hds-card-footer\">{footer}</div> : null}\n </Tag>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\nimport { Icon, type IconName } from \"../../internal/Icon\";\n\nexport type BadgeTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICONS: Partial<Record<BadgeTone, IconName>> = {\n accent: \"info\",\n success: \"circle-check\",\n warning: \"triangle-alert\",\n danger: \"circle-x\",\n};\n\nexport interface BadgeProps {\n tone?: BadgeTone;\n /** A Lucide icon, or `false` for none. Status tones show their own icon by default. */\n icon?: ReactNode | false;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A small pill that states a status or a category in one or two words.\n * The word stays in ink; the tone shows in the icon and the tint, so color never carries the meaning alone.\n */\nexport function Badge({ tone = \"neutral\", icon, children, className }: BadgeProps) {\n const defaultIcon = TONE_ICONS[tone];\n const shownIcon = icon === false ? null : (icon ?? (defaultIcon ? <Icon name={defaultIcon} /> : null));\n\n return (\n <span className={cx(\"hds-badge\", `hds-badge--${tone}`, className)}>\n {shownIcon}\n {children}\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface TableColumn<Row> {\n key: string;\n header: ReactNode;\n /** Mono, tabular figures, right-aligned. */\n numeric?: boolean;\n align?: \"start\" | \"center\";\n /** Renders the cell from the row; by default the cell shows `row[key]`. */\n render?: (row: Row) => ReactNode;\n}\n\nexport interface TableProps<Row> {\n columns: TableColumn<Row>[];\n rows: Row[];\n /** Key of each row's unique id. Default `id`. */\n rowKey?: keyof Row & string;\n /** Names the table and its scroll region. */\n caption?: string;\n /** Keeps the caption for screen readers only. */\n hideCaption?: boolean;\n /** Shown when there are no rows. Default \"Nada para mostrar.\". */\n empty?: ReactNode;\n maxHeight?: number | string;\n /** Regular glass instead of a solid surface, for a table over the app's background rather than over other content. */\n glass?: boolean;\n className?: string;\n}\n\nfunction cellClass<Row>(column: TableColumn<Row>) {\n if (column.numeric) return \"hds-cell--numeric\";\n return column.align === \"center\" ? \"hds-cell--center\" : undefined;\n}\n\n/** A data table with a sticky header, roomy rows and aligned numbers, on a solid surface or on glass. */\nexport function Table<Row extends object>({\n columns,\n rows,\n rowKey = \"id\" as keyof Row & string,\n caption,\n hideCaption = false,\n empty = \"Nada para mostrar.\",\n maxHeight,\n glass = false,\n className,\n}: TableProps<Row>) {\n return (\n <div\n className={cx(\"hds-table-wrap\", \"hds-scroll\", glass && \"hds-glass hds-table-wrap--glass\", className)}\n role=\"region\"\n aria-label={caption}\n tabIndex={0}\n style={maxHeight !== undefined ? { maxHeight } : undefined}\n >\n <table className=\"hds-table\">\n {caption ? <caption className={hideCaption ? \"hds-visually-hidden\" : undefined}>{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th key={column.key} scope=\"col\" className={cellClass(column)}>\n {column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length ? (\n rows.map((row, index) => (\n <tr key={String(row[rowKey] ?? index)}>\n {columns.map((column) => (\n <td key={column.key} className={cellClass(column)}>\n {column.render ? column.render(row) : (row[column.key as keyof Row] as ReactNode)}\n </td>\n ))}\n </tr>\n ))\n ) : (\n <tr>\n <td colSpan={columns.length || 1} className=\"hds-table-empty\">\n {empty}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useEffect, useSyncExternalStore } from \"react\";\nimport {\n applyStoredAppearance,\n getAppearance,\n setTheme,\n setTransparency,\n subscribeToAppearance,\n type Appearance,\n type Theme,\n type Transparency,\n} from \"./appearance\";\n\nlet initialized = false;\n\nconst serverAppearance: Appearance = { theme: \"dark\", transparency: \"full\" };\nlet lastSnapshot: Appearance = serverAppearance;\n\n// useSyncExternalStore needs the same object back while nothing has changed\nfunction snapshot(): Appearance {\n const current = getAppearance();\n if (current.theme !== lastSnapshot.theme || current.transparency !== lastSnapshot.transparency) {\n lastSnapshot = current;\n }\n return lastSnapshot;\n}\n\nexport interface UseAppearance extends Appearance {\n setTheme: (theme: Theme) => void;\n setTransparency: (transparency: Transparency) => void;\n toggleTheme: () => void;\n toggleTransparency: () => void;\n}\n\n/**\n * The page's theme and transparency, kept in sync across every component that uses it.\n * The first use applies the saved choice (dark when nothing is saved), unless the app already\n * called applyStoredAppearance() at startup.\n */\nexport function useAppearance(): UseAppearance {\n useEffect(() => {\n if (initialized) return;\n initialized = true;\n if (!document.documentElement.hasAttribute(\"data-theme\")) applyStoredAppearance();\n }, []);\n\n const appearance = useSyncExternalStore(subscribeToAppearance, snapshot, () => serverAppearance);\n\n return {\n ...appearance,\n setTheme,\n setTransparency,\n toggleTheme: () => setTheme(appearance.theme === \"dark\" ? \"light\" : \"dark\"),\n toggleTransparency: () => setTransparency(appearance.transparency === \"full\" ? \"reduced\" : \"full\"),\n };\n}\n","import { useAppearance } from \"../../appearance/useAppearance\";\nimport { Icon } from \"../../internal/Icon\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\n\ntype ToggleProps = Omit<ButtonProps, \"onClick\" | \"children\" | \"icon\" | \"iconOnly\" | \"aria-label\" | \"aria-pressed\">;\n\nexport interface ThemeToggleProps extends ToggleProps {\n /** Accessible name while dark. Default \"Mudar para o tema claro\". */\n lightLabel?: string;\n /** Accessible name while light. Default \"Mudar para o tema escuro\". */\n darkLabel?: string;\n}\n\n/** Switches between the dark theme (the default) and the light one, and remembers the choice. */\nexport function ThemeToggle({\n lightLabel = \"Mudar para o tema claro\",\n darkLabel = \"Mudar para o tema escuro\",\n variant = \"ghost\",\n ...rest\n}: ThemeToggleProps) {\n const { theme, toggleTheme } = useAppearance();\n const label = theme === \"dark\" ? lightLabel : darkLabel;\n\n return (\n <Button\n {...rest}\n variant={variant}\n iconOnly\n icon={<Icon name={theme === \"dark\" ? \"sun\" : \"moon\"} />}\n aria-label={label}\n title={label}\n onClick={toggleTheme}\n />\n );\n}\n\nexport interface TransparencyToggleProps extends ToggleProps {\n /** Accessible name. Default \"Reduzir transparência\"; the pressed state says whether it is on. */\n label?: string;\n}\n\n/** Turns every glass surface solid, or back to glass, and remembers the choice. */\nexport function TransparencyToggle({ label = \"Reduzir transparência\", variant = \"ghost\", ...rest }: TransparencyToggleProps) {\n const { transparency, toggleTransparency } = useAppearance();\n\n return (\n <Button\n {...rest}\n variant={variant}\n iconOnly\n icon={<Icon name=\"blend\" />}\n aria-label={label}\n aria-pressed={transparency === \"reduced\"}\n title={label}\n onClick={toggleTransparency}\n />\n );\n}\n","import type { ElementType, HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface ContainerProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Default `section`. */\n as?: ElementType;\n /** Adds the sidebar's width as left padding from 768px up. */\n withSidebar?: boolean;\n}\n\n/** Centres page content at content-max, with a section's vertical rhythm and the side gutter. */\nexport function Container({ as: Tag = \"section\", withSidebar = false, className, ...rest }: ContainerProps) {\n return <Tag {...rest} className={cx(\"hds-container\", withSidebar && \"hds-container--with-sidebar\", className)} />;\n}\n","import type { ReactNode } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface SectionTitleProps {\n children: ReactNode;\n /** Shown zero-padded (3 → \"03\") before the heading, only when sections are a sequence. */\n index?: number;\n /** Heading level. Default `h2`. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n id?: string;\n className?: string;\n}\n\n/** A page-section heading led by a glowing mono index, the portfolio's signature heading. */\nexport function SectionTitle({ children, index, as: Tag = \"h2\", id, className }: SectionTitleProps) {\n return (\n <Tag id={id} className={cx(\"hds-section-title\", className)}>\n {index !== undefined ? (\n <span className=\"hds-section-index\" aria-hidden=\"true\">\n {String(index).padStart(2, \"0\")}\n </span>\n ) : null}\n {children}\n </Tag>\n );\n}\n","import { cx } from \"../../internal/cx\";\n\nexport interface SeparatorProps {\n orientation?: \"horizontal\" | \"vertical\";\n /** Hides the line from screen readers when it only decorates. */\n decorative?: boolean;\n className?: string;\n}\n\n/** A 1px line that divides groups of content. */\nexport function Separator({ orientation = \"horizontal\", decorative = false, className }: SeparatorProps) {\n return (\n <div\n role={decorative ? \"none\" : \"separator\"}\n aria-orientation={decorative ? undefined : orientation}\n className={cx(\"hds-separator\", `hds-separator--${orientation}`, className)}\n />\n );\n}\n","import type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../internal/cx\";\n\nexport interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {\n /** Accessible name of the region. */\n label: string;\n maxHeight?: number | string;\n}\n\n/** A focusable scrollable region with the brand's slim scrollbars. */\nexport function ScrollArea({ label, maxHeight, className, style, ...rest }: ScrollAreaProps) {\n return (\n <div\n {...rest}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n className={cx(\"hds-scroll\", className)}\n style={{ maxHeight, ...style }}\n />\n );\n}\n","import { cx } from \"../../internal/cx\";\nimport { Icon } from \"../../internal/Icon\";\n\nexport interface LoadingProps {\n /** sm 16px · md 24px · lg 32px. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Announced to screen readers. Default \"Carregando…\". */\n label?: string;\n /** Shows the label beside the spinner. */\n showLabel?: boolean;\n className?: string;\n}\n\n/** A spinner that tells assistive technology something is loading. */\nexport function Loading({ size = \"md\", label = \"Carregando…\", showLabel = false, className }: LoadingProps) {\n return (\n <span role=\"status\" className={cx(\"hds-loading\", `hds-loading--${size}`, className)}>\n <Icon name=\"loader\" />\n <span className={showLabel ? undefined : \"hds-visually-hidden\"}>{label}</span>\n </span>\n );\n}\n","import { cx } from \"../../internal/cx\";\n\nexport interface GlowAvatarProps {\n src: string;\n /** The person's name. */\n alt: string;\n /** Diameter in px. Default 96. */\n size?: number;\n className?: string;\n}\n\n/** A round photo ringed in the accent with a soft glow behind it. One per view. */\nexport function GlowAvatar({ src, alt, size = 96, className }: GlowAvatarProps) {\n return (\n <span className={cx(\"hds-avatar\", className)} style={{ width: size, height: size }}>\n <span className=\"hds-avatar-glow\" aria-hidden=\"true\" />\n <img className=\"hds-avatar-image\" src={src} alt={alt} width={size} height={size} />\n </span>\n );\n}\n"],"mappings":";;;;;;AACA,SAAgBa,EAAG,GAAGC,GAA2D;CAC/E,OAAOA,EAAQ,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACzC;;;ACaA,IAAaC,IAAaC,EAAyC,SACjE,EAAE,IAAIC,IAAM,OAAO,UAAO,WAAW,cAAW,GAAGC,KACnD,GACA;CACA,OAAO,kBAACD,GAAD;EAAK,GAAIC;EAAW;EAAK,WAAWL,EAAG,aAAaM,MAAS,aAAa,cAAcA,KAAQC,CAAS;CAAI,CAAA;AACtH,CAAC,GCjBKC,IAAO;CAAE,IAAI;CAAI,IAAI;CAAI,GAAG;AAAG,GAI/BC,IAAQ;CACZ,OAAO,CAAC,iBAAiB;CACzB,GAAG,CAAC,cAAc,YAAY;CAC9B,gBAAgB,CAAC,cAAc;CAC/B,gBAAgB,CAAC,gBAAgB;CACjC,iBAAiB,CAAC,eAAe;CACjC,UAAU;EAAC;EAAU;EAAW;EAAY;CAAyE;CACrH,gBAAgB,CAACD,GAAM,eAAe;CACtC,YAAY;EAACA;EAAM;EAAa;CAAU;CAC1C,kBAAkB;EAChB;EACA;EACA;CACF;CACA,MAAM;EAACA;EAAM;EAAa;CAAW;CACrC,QAAQ,CAAC,6BAA6B;CACtC,KAAK;EACH;GAAE,IAAI;GAAI,IAAI;GAAI,GAAG;EAAE;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,oCAAoC;CAC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AAE;GAAW,GAAG+Q;EAAM;CAC9B,CAAA;AAEL;;;ACPA,SAAgBC,GAAQ,EAAE,UAAO,MAAM,WAAQ,eAAe,eAAY,IAAO,gBAA2B;CAC1G,OACE,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAWvR,EAAG,eAAe,gBAAgBoB,KAAQb,CAAS;EAAlF,UAAA,CACE,kBAACG,GAAD,EAAM,MAAK,SAAU,CAAA,GACrB,kBAAC,QAAD;GAAM,WAAW8Q,IAAY,KAAA,IAAY;GAAwB,UAAAzP;EAAY,CAAA,CACzE;;AAEV;;;ACTA,SAAgB0P,GAAW,EAAE,QAAK,QAAK,UAAO,IAAI,gBAA8B;CAC9E,OACE,kBAAC,QAAD;EAAM,WAAWzR,EAAG,cAAcO,CAAS;EAAG,OAAO;GAAE,OAAOa;GAAM,QAAQA;EAAK;EAAjF,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,OAAD;GAAK,WAAU;GAAwB;GAAU;GAAK,OAAOA;GAAM,QAAQA;EAAO,CAAA,CAC9E;;AAEV"}
package/dist/styles.css CHANGED
@@ -1054,6 +1054,160 @@ html[data-transparency="reduced"] .hds-glass::before {
1054
1054
  }
1055
1055
  }
1056
1056
 
1057
+ /* ---------- BarChart ---------- */
1058
+ .hds-chart {
1059
+ display: flex;
1060
+ flex-direction: column;
1061
+ gap: var(--space-3);
1062
+ min-width: 0;
1063
+ margin: 0;
1064
+ color: var(--ink);
1065
+ font-family: var(--font-sans);
1066
+ }
1067
+
1068
+ .hds-chart-title {
1069
+ font-size: 15px;
1070
+ line-height: 20px;
1071
+ font-weight: 600;
1072
+ }
1073
+
1074
+ .hds-chart-empty {
1075
+ margin: 0;
1076
+ padding: var(--space-6) 0;
1077
+ color: var(--ink-muted);
1078
+ font-size: 14px;
1079
+ text-align: center;
1080
+ }
1081
+
1082
+ .hds-chart-legend {
1083
+ display: flex;
1084
+ flex-wrap: wrap;
1085
+ gap: var(--space-4);
1086
+ margin: 0;
1087
+ padding: 0;
1088
+ list-style: none;
1089
+ color: var(--ink-muted);
1090
+ font-size: 13px;
1091
+ }
1092
+
1093
+ .hds-chart-legend li {
1094
+ display: inline-flex;
1095
+ align-items: center;
1096
+ gap: var(--space-2);
1097
+ }
1098
+
1099
+ .hds-chart-swatch {
1100
+ width: 10px;
1101
+ height: 10px;
1102
+ border-radius: 3px;
1103
+ }
1104
+
1105
+ .hds-chart-tone--accent { background: var(--accent-fill); }
1106
+ .hds-chart-tone--secondary { background: var(--secondary-fill); }
1107
+ .hds-chart-tone--success { background: var(--success); }
1108
+ .hds-chart-tone--warning { background: var(--warning); }
1109
+ .hds-chart-tone--danger { background: var(--danger); }
1110
+ .hds-chart-tone--neutral { background: var(--ink-muted); }
1111
+
1112
+ .hds-chart-value,
1113
+ .hds-chart-label {
1114
+ font-size: 12px;
1115
+ line-height: 16px;
1116
+ white-space: nowrap;
1117
+ }
1118
+
1119
+ .hds-chart-value {
1120
+ font-family: var(--font-mono);
1121
+ font-variant-numeric: tabular-nums;
1122
+ }
1123
+
1124
+ .hds-chart-label {
1125
+ color: var(--ink-muted);
1126
+ }
1127
+
1128
+ .hds-chart-stack {
1129
+ display: flex;
1130
+ overflow: hidden;
1131
+ border-radius: var(--radius-sm);
1132
+ transition: height 300ms ease-out, width 300ms ease-out;
1133
+ }
1134
+
1135
+ .hds-chart-bar {
1136
+ flex-basis: 0;
1137
+ min-width: 2px;
1138
+ min-height: 2px;
1139
+ }
1140
+
1141
+ /* Vertical: one column per label, the stack grows from the baseline */
1142
+ .hds-chart-columns {
1143
+ display: flex;
1144
+ align-items: stretch;
1145
+ gap: var(--space-2);
1146
+ padding-bottom: var(--space-1);
1147
+ border-bottom: 1px solid var(--line);
1148
+ overflow-x: auto;
1149
+ }
1150
+
1151
+ .hds-chart-column {
1152
+ display: grid;
1153
+ flex: 1 0 44px;
1154
+ grid-template-rows: 1fr auto;
1155
+ justify-items: center;
1156
+ gap: var(--space-1);
1157
+ min-width: 44px;
1158
+ }
1159
+
1160
+ /* The bar area: the value sits right on top of its bar, with room kept for it above the tallest */
1161
+ .hds-chart-plot {
1162
+ display: flex;
1163
+ flex-direction: column;
1164
+ justify-content: flex-end;
1165
+ align-items: center;
1166
+ gap: var(--space-1);
1167
+ width: 100%;
1168
+ min-height: 0;
1169
+ padding-top: 20px;
1170
+ }
1171
+
1172
+ .hds-chart--vertical .hds-chart-stack {
1173
+ flex-direction: column-reverse;
1174
+ width: min(100%, 40px);
1175
+ }
1176
+
1177
+ /* Horizontal: one row per label */
1178
+ .hds-chart-rows {
1179
+ display: grid;
1180
+ grid-template-columns: minmax(0, max-content) 1fr auto;
1181
+ align-items: center;
1182
+ gap: var(--space-2) var(--space-3);
1183
+ }
1184
+
1185
+ .hds-chart-row {
1186
+ display: contents;
1187
+ }
1188
+
1189
+ .hds-chart-row .hds-chart-label {
1190
+ overflow: hidden;
1191
+ max-width: 220px;
1192
+ color: var(--ink);
1193
+ font-size: 13px;
1194
+ text-overflow: ellipsis;
1195
+ }
1196
+
1197
+ .hds-chart-track {
1198
+ min-width: 80px;
1199
+ }
1200
+
1201
+ .hds-chart--horizontal .hds-chart-stack {
1202
+ height: 14px;
1203
+ }
1204
+
1205
+ @media (prefers-reduced-motion: reduce) {
1206
+ .hds-chart-stack {
1207
+ transition: none;
1208
+ }
1209
+ }
1210
+
1057
1211
  /* ---------- Typeahead ---------- */
1058
1212
  .hds-typeahead-panel {
1059
1213
  position: fixed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hemerson/design-system",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Liquid-glass design system: tokens, styles and React components for Hemerson's projects.",
5
5
  "license": "MIT",
6
6
  "author": "Hemerson Oliveira",