@hemerson/design-system 0.5.0 → 0.6.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.
@@ -19,7 +19,12 @@ export interface MenuProps {
19
19
  align?: "start" | "end";
20
20
  /** Default `glass`. */
21
21
  triggerVariant?: ButtonVariant;
22
+ /**
23
+ * Context shown at the top of the list, such as the signed-in account. Not an action:
24
+ * screen readers hear it as the list's description.
25
+ */
26
+ header?: ReactNode;
22
27
  className?: string;
23
28
  }
24
29
  /** A button that opens a glass list of actions. */
25
- export declare function Menu({ label, icon, iconOnly, items, align, triggerVariant, className }: MenuProps): import("react").JSX.Element;
30
+ export declare function Menu({ label, icon, iconOnly, items, align, triggerVariant, header, className }: MenuProps): import("react").JSX.Element;
package/dist/index.js CHANGED
@@ -236,53 +236,62 @@ function ie(e, t, n) {
236
236
  }
237
237
  //#endregion
238
238
  //#region src/components/Menu/Menu.tsx
239
- function j({ label: e, icon: t, iconOnly: n = !1, items: r, align: i = "end", triggerVariant: a = "glass", className: o }) {
240
- let [s, c] = _(!1), l = g(null), u = g(null), d = p(), h = () => Array.from(u.current?.querySelectorAll("[role=\"menuitem\"]") ?? []);
241
- function v(e) {
242
- c(!1), e && l.current?.focus();
239
+ function j({ label: e, icon: t, iconOnly: n = !1, items: r, align: i = "end", triggerVariant: a = "glass", header: o, className: s }) {
240
+ let [c, l] = _(!1), u = g(null), d = g(null), h = p(), v = () => Array.from(d.current?.querySelectorAll("[role=\"menuitem\"]") ?? []);
241
+ function T(e) {
242
+ l(!1), e && u.current?.focus();
243
243
  }
244
244
  m(() => {
245
- if (!s || !l.current || !u.current) return;
245
+ if (!c || !u.current || !d.current) return;
246
246
  let e = () => {
247
- l.current && u.current && ie(l.current, u.current, i);
247
+ u.current && d.current && ie(u.current, d.current, i);
248
248
  };
249
249
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
250
250
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
251
251
  };
252
- }, [s, i]), f(() => {
253
- if (!s) return;
254
- h()[0]?.focus();
252
+ }, [c, i]), f(() => {
253
+ if (!c) return;
254
+ v()[0]?.focus();
255
255
  function e(e) {
256
256
  let t = e.target;
257
- l.current?.contains(t) || u.current?.contains(t) || c(!1);
257
+ u.current?.contains(t) || d.current?.contains(t) || l(!1);
258
258
  }
259
259
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
260
- }, [s]);
261
- function y(e) {
262
- let t = h(), n = t.indexOf(document.activeElement);
263
- e.key === "Escape" || e.key === "Tab" ? (e.preventDefault(), v(!0)) : e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), t[(n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus()) : (e.key === "Home" || e.key === "End") && (e.preventDefault(), (e.key === "Home" ? t[0] : t[t.length - 1])?.focus());
260
+ }, [c]);
261
+ function ee(e) {
262
+ let t = v(), n = t.indexOf(document.activeElement);
263
+ e.key === "Escape" || e.key === "Tab" ? (e.preventDefault(), T(!0)) : e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), t[(n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus()) : (e.key === "Home" || e.key === "End") && (e.preventDefault(), (e.key === "Home" ? t[0] : t[t.length - 1])?.focus());
264
264
  }
265
265
  return /* @__PURE__ */ x("div", {
266
- className: C("hds-menu", o),
266
+ className: C("hds-menu", s),
267
267
  children: [/* @__PURE__ */ b(D, {
268
- ref: l,
268
+ ref: u,
269
269
  variant: a,
270
270
  icon: t,
271
271
  iconOnly: n,
272
272
  "aria-label": n ? e : void 0,
273
273
  "aria-haspopup": "menu",
274
- "aria-expanded": s,
275
- "aria-controls": s ? d : void 0,
276
- onClick: () => c(!s),
274
+ "aria-expanded": c,
275
+ "aria-controls": c ? h : void 0,
276
+ onClick: () => l(!c),
277
277
  children: e
278
- }), s ? S(/* @__PURE__ */ b(w, {
279
- ref: u,
280
- id: d,
278
+ }), c ? S(/* @__PURE__ */ x(w, {
279
+ ref: d,
280
+ id: h,
281
281
  role: "menu",
282
282
  "aria-label": e,
283
+ "aria-describedby": o ? `${h}-header` : void 0,
283
284
  className: "hds-menu-panel",
284
- onKeyDown: y,
285
- children: r.map((e, t) => e.separator ? /* @__PURE__ */ b("div", {
285
+ onKeyDown: ee,
286
+ children: [o ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
287
+ id: `${h}-header`,
288
+ role: "none",
289
+ className: "hds-menu-header",
290
+ children: o
291
+ }), /* @__PURE__ */ b("div", {
292
+ role: "separator",
293
+ className: "hds-menu-separator"
294
+ })] }) : null, r.map((e, t) => e.separator ? /* @__PURE__ */ b("div", {
286
295
  role: "separator",
287
296
  className: "hds-menu-separator"
288
297
  }, `separator-${t}`) : /* @__PURE__ */ x("button", {
@@ -291,10 +300,10 @@ function j({ label: e, icon: t, iconOnly: n = !1, items: r, align: i = "end", tr
291
300
  tabIndex: -1,
292
301
  className: C("hds-menu-item", e.danger && "hds-menu-item--danger"),
293
302
  onClick: () => {
294
- v(!0), e.onSelect?.();
303
+ T(!0), e.onSelect?.();
295
304
  },
296
305
  children: [e.icon, e.label]
297
- }, e.label))
306
+ }, e.label))]
298
307
  }), document.body) : null]
299
308
  });
300
309
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["TONE_ICONS","_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","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","Fragment","hint","error","Input","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","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/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 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\", 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 className=\"hds-menu-panel\"\n onKeyDown={onKeyDown}\n >\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 /** 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, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className=\"hds-label\" 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 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, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className=\"hds-label\" 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}\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 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=\"hds-label\" 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 { 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,SAAgBU,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,KAAQ;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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WAAWjP,EAAG,iBAAiB,kBAAkBiP,KAAe1O,CAAS;CAC1E,CAAA;AAEL;;;ACRA,SAAgB2O,GAAW,EAAE,UAAO,cAAW,cAAW,UAAO,GAAG7O,KAAyB;CAC3F,OACE,kBAAC,OAAD;EACE,GAAIA;EACJ,MAAK;EACL,cAAY0B;EACZ,UAAU;EACV,WAAW/B,EAAG,cAAcO,CAAS;EACrC,OAAO;GAAE;GAAW,GAAG4O;EAAM;CAC9B,CAAA;AAEL;;;ACPA,SAAgBC,GAAQ,EAAE,UAAO,MAAM,WAAQ,eAAe,eAAY,IAAO,gBAA2B;CAC1G,OACE,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAWpP,EAAG,eAAe,gBAAgBoB,KAAQb,CAAS;EAAlF,UAAA,CACE,kBAACG,GAAD,EAAM,MAAK,SAAU,CAAA,GACrB,kBAAC,QAAD;GAAM,WAAW2O,IAAY,KAAA,IAAY;GAAwB,UAAAtN;EAAY,CAAA,CACzE;;AAEV;;;ACTA,SAAgBuN,GAAW,EAAE,QAAK,QAAK,UAAO,IAAI,gBAA8B;CAC9E,OACE,kBAAC,QAAD;EAAM,WAAWtP,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","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","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","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/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 /** 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, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className=\"hds-label\" 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 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, id, className, ...rest },\n ref\n) {\n const ids = useFieldIds(id);\n\n return (\n <div className={cx(\"hds-field\", className)}>\n <label className=\"hds-label\" 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}\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 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=\"hds-label\" 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 { 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,SAAgBW,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,WA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;ACTA,SAAgBwN,GAAW,EAAE,QAAK,QAAK,UAAO,IAAI,gBAA8B;CAC9E,OACE,kBAAC,QAAD;EAAM,WAAWvP,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
@@ -738,6 +738,24 @@ html[data-transparency="reduced"] .hds-glass::before {
738
738
  color: var(--danger);
739
739
  }
740
740
 
741
+ .hds-menu-header {
742
+ display: flex;
743
+ flex-direction: column;
744
+ gap: 2px;
745
+ padding: var(--space-2) var(--space-3);
746
+ color: var(--ink);
747
+ font-size: 14px;
748
+ line-height: 20px;
749
+ cursor: default;
750
+ }
751
+
752
+ /* A second line, such as an email */
753
+ .hds-menu-header small {
754
+ color: var(--ink-muted);
755
+ font-size: 13px;
756
+ line-height: 18px;
757
+ }
758
+
741
759
  .hds-menu-separator {
742
760
  height: 1px;
743
761
  margin: var(--space-1) var(--space-2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hemerson/design-system",
3
- "version": "0.5.0",
3
+ "version": "0.6.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",