@hemerson/design-system 0.0.0-stage → 0.1.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.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -2
  3. package/dist/components/Badge/Badge.d.ts +14 -0
  4. package/dist/components/Button/Button.d.ts +17 -0
  5. package/dist/components/Button/index.d.ts +2 -0
  6. package/dist/components/Card/Card.d.ts +19 -0
  7. package/dist/components/Checkbox/Checkbox.d.ts +8 -0
  8. package/dist/components/Container/Container.d.ts +9 -0
  9. package/dist/components/Dialog/Dialog.d.ts +18 -0
  10. package/dist/components/FloatingButton/FloatingButton.d.ts +9 -0
  11. package/dist/components/GlassPanel/GlassPanel.d.ts +13 -0
  12. package/dist/components/GlowAvatar/GlowAvatar.d.ts +10 -0
  13. package/dist/components/Input/Input.d.ts +12 -0
  14. package/dist/components/Loading/Loading.d.ts +11 -0
  15. package/dist/components/Menu/Menu.d.ts +25 -0
  16. package/dist/components/NavBar/NavBar.d.ts +20 -0
  17. package/dist/components/ScrollArea/ScrollArea.d.ts +8 -0
  18. package/dist/components/SectionTitle/SectionTitle.d.ts +12 -0
  19. package/dist/components/SegmentedControl/SegmentedControl.d.ts +21 -0
  20. package/dist/components/Select/Select.d.ts +16 -0
  21. package/dist/components/Separator/Separator.d.ts +8 -0
  22. package/dist/components/Sidebar/Sidebar.d.ts +21 -0
  23. package/dist/components/Table/Table.d.ts +26 -0
  24. package/dist/components/Toast/Toast.d.ts +16 -0
  25. package/dist/glass/enableGlassRefraction.d.ts +9 -0
  26. package/dist/index.d.ts +42 -0
  27. package/dist/index.js +726 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/internal/Icon.d.ts +17 -0
  30. package/dist/internal/cx.d.ts +2 -0
  31. package/dist/internal/field.d.ts +16 -0
  32. package/dist/styles.css +1249 -0
  33. package/dist/tokens.css +184 -0
  34. package/dist/tokens.json +514 -0
  35. package/package.json +86 -4
package/dist/index.js ADDED
@@ -0,0 +1,726 @@
1
+ import { forwardRef as e, useEffect as t, useId as n, useLayoutEffect as r, useRef as i, useState as a } from "react";
2
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import { createPortal as l } from "react-dom";
4
+ //#region src/internal/cx.ts
5
+ function u(...e) {
6
+ return e.filter(Boolean).join(" ");
7
+ }
8
+ //#endregion
9
+ //#region src/components/GlassPanel/GlassPanel.tsx
10
+ var d = e(function({ as: e = "div", tone: t = "regular", className: n, ...r }, i) {
11
+ return /* @__PURE__ */ s(e, {
12
+ ...r,
13
+ ref: i,
14
+ className: u("hds-glass", t !== "regular" && `hds-glass--${t}`, n)
15
+ });
16
+ }), f = "http://www.w3.org/2000/svg";
17
+ function p() {
18
+ if (typeof document > "u") return !1;
19
+ let e = (navigator.userAgentData?.brands ?? []).some(({ brand: e }) => e.includes("Chromium")), t = window.matchMedia?.("(prefers-reduced-transparency: reduce)").matches ?? !1;
20
+ if (!e || t) return !1;
21
+ if (!document.getElementById("hds-glass-defs")) {
22
+ let e = document.createElementNS(f, "svg");
23
+ e.setAttribute("id", "hds-glass-defs"), e.setAttribute("width", "0"), e.setAttribute("height", "0"), e.setAttribute("aria-hidden", "true"), e.style.position = "absolute";
24
+ let t = document.createElementNS(f, "filter");
25
+ Object.entries({
26
+ id: "hds-glass-distortion",
27
+ x: "-20%",
28
+ y: "-20%",
29
+ width: "140%",
30
+ height: "140%",
31
+ filterUnits: "objectBoundingBox"
32
+ }).forEach(([e, n]) => t.setAttribute(e, n));
33
+ for (let [e, n] of [
34
+ ["feTurbulence", {
35
+ type: "fractalNoise",
36
+ baseFrequency: "0.012 0.012",
37
+ numOctaves: "2",
38
+ seed: "8",
39
+ result: "noise"
40
+ }],
41
+ ["feGaussianBlur", {
42
+ in: "noise",
43
+ stdDeviation: "3",
44
+ result: "blurredNoise"
45
+ }],
46
+ ["feDisplacementMap", {
47
+ in: "SourceGraphic",
48
+ in2: "blurredNoise",
49
+ scale: "40",
50
+ xChannelSelector: "R",
51
+ yChannelSelector: "G"
52
+ }]
53
+ ]) {
54
+ let r = document.createElementNS(f, e);
55
+ Object.entries(n).forEach(([e, t]) => r.setAttribute(e, t)), t.appendChild(r);
56
+ }
57
+ e.appendChild(t), document.body.appendChild(e);
58
+ }
59
+ return document.documentElement.setAttribute("data-glass-refraction", ""), !0;
60
+ }
61
+ //#endregion
62
+ //#region src/internal/Icon.tsx
63
+ var m = {
64
+ check: ["M20 6 9 17l-5-5"],
65
+ x: ["M18 6 6 18", "m6 6 12 12"],
66
+ "chevron-down": ["m6 9 6 6 6-6"],
67
+ "circle-check": ["circle", "m9 12 2 2 4-4"],
68
+ "circle-x": [
69
+ "circle",
70
+ "m15 9-6 6",
71
+ "m9 9 6 6"
72
+ ],
73
+ "triangle-alert": [
74
+ "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",
75
+ "M12 9v4",
76
+ "M12 17h.01"
77
+ ],
78
+ info: [
79
+ "circle",
80
+ "M12 16v-4",
81
+ "M12 8h.01"
82
+ ],
83
+ loader: ["M21 12a9 9 0 1 1-6.219-8.56"]
84
+ };
85
+ function h({ name: e, className: t }) {
86
+ return /* @__PURE__ */ s("svg", {
87
+ className: u("hds-icon", t),
88
+ viewBox: "0 0 24 24",
89
+ fill: "none",
90
+ stroke: "currentColor",
91
+ strokeWidth: 2,
92
+ strokeLinecap: "round",
93
+ strokeLinejoin: "round",
94
+ "aria-hidden": "true",
95
+ focusable: "false",
96
+ children: m[e].map((e) => e === "circle" ? /* @__PURE__ */ s("circle", {
97
+ cx: 12,
98
+ cy: 12,
99
+ r: 10
100
+ }, e) : /* @__PURE__ */ s("path", { d: e }, e))
101
+ });
102
+ }
103
+ //#endregion
104
+ //#region src/components/Button/Button.tsx
105
+ var g = e(function({ variant: e = "primary", size: t = "md", icon: n, iconOnly: r = !1, loading: i = !1, disabled: a, type: o = "button", className: l, children: d, ...f }, p) {
106
+ return r && !f["aria-label"] && !f["aria-labelledby"] && console.warn("Button: an icon-only button needs an aria-label."), /* @__PURE__ */ c("button", {
107
+ ...f,
108
+ ref: p,
109
+ type: o,
110
+ disabled: a || i,
111
+ "aria-busy": i || void 0,
112
+ className: u("hds-btn", `hds-btn--${e}`, t !== "md" && `hds-btn--${t}`, r && "hds-btn--icon", e === "glass" && "hds-glass", l),
113
+ children: [i ? /* @__PURE__ */ s(h, {
114
+ name: "loader",
115
+ className: "hds-spin"
116
+ }) : n, r ? null : d]
117
+ });
118
+ });
119
+ //#endregion
120
+ //#region src/components/NavBar/NavBar.tsx
121
+ function _({ active: e = !1, className: t, ...n }) {
122
+ return /* @__PURE__ */ s("a", {
123
+ ...n,
124
+ "aria-current": e ? "page" : void 0,
125
+ className: u("hds-navbar-link", t)
126
+ });
127
+ }
128
+ function v({ title: e, actions: t, navLabel: n = "Principal", className: r, children: i, ...a }) {
129
+ return /* @__PURE__ */ c(d, {
130
+ ...a,
131
+ as: "header",
132
+ className: u("hds-navbar", r),
133
+ children: [
134
+ e ? /* @__PURE__ */ s("p", {
135
+ className: "hds-navbar-title",
136
+ children: e
137
+ }) : null,
138
+ i ? /* @__PURE__ */ s("nav", {
139
+ className: "hds-navbar-nav",
140
+ "aria-label": n,
141
+ children: i
142
+ }) : null,
143
+ t ? /* @__PURE__ */ s("div", {
144
+ className: "hds-navbar-actions",
145
+ children: t
146
+ }) : null
147
+ ]
148
+ });
149
+ }
150
+ var y = Object.assign(v, { Link: _ });
151
+ //#endregion
152
+ //#region src/components/Sidebar/Sidebar.tsx
153
+ function b({ items: e, footer: t, floating: n = !1, label: r = "Navegação", className: i }) {
154
+ return /* @__PURE__ */ c(d, {
155
+ as: "nav",
156
+ "aria-label": r,
157
+ className: u("hds-sidebar", n && "hds-sidebar--floating", i),
158
+ children: [/* @__PURE__ */ s("ul", {
159
+ className: "hds-sidebar-items",
160
+ children: e.map((e) => {
161
+ let t = {
162
+ "aria-label": e.label,
163
+ title: e.label,
164
+ "aria-current": e.active ? "page" : void 0,
165
+ className: "hds-sidebar-item"
166
+ };
167
+ return /* @__PURE__ */ s("li", { children: e.href ? /* @__PURE__ */ s("a", {
168
+ ...t,
169
+ href: e.href,
170
+ onClick: e.onClick,
171
+ children: e.icon
172
+ }) : /* @__PURE__ */ s("button", {
173
+ ...t,
174
+ type: "button",
175
+ onClick: e.onClick,
176
+ children: e.icon
177
+ }) }, e.label);
178
+ })
179
+ }), t ? /* @__PURE__ */ s("div", {
180
+ className: "hds-sidebar-footer",
181
+ children: t
182
+ }) : null]
183
+ });
184
+ }
185
+ //#endregion
186
+ //#region src/components/SegmentedControl/SegmentedControl.tsx
187
+ var x = {
188
+ ArrowRight: 1,
189
+ ArrowDown: 1,
190
+ ArrowLeft: -1,
191
+ ArrowUp: -1
192
+ };
193
+ function S({ options: e, value: t, defaultValue: n, onChange: o, label: l, className: f }) {
194
+ let [p, m] = a(n ?? e[0]?.value), h = t === void 0 ? p : t, g = i([]), _ = i(null), v = Math.max(0, e.findIndex((e) => e.value === h));
195
+ r(() => {
196
+ function e() {
197
+ let e = g.current[v];
198
+ e && _.current && (_.current.style.width = `${e.offsetWidth}px`, _.current.style.transform = `translateX(${e.offsetLeft - 4}px)`, _.current.style.opacity = "1");
199
+ }
200
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
201
+ }, [v, e.length]);
202
+ function y(e) {
203
+ t === void 0 && m(e), o?.(e);
204
+ }
205
+ function b(t) {
206
+ let n = x[t.key];
207
+ if (!n) return;
208
+ t.preventDefault();
209
+ let r = (v + n + e.length) % e.length;
210
+ y(e[r].value), g.current[r]?.focus();
211
+ }
212
+ return /* @__PURE__ */ c(d, {
213
+ role: "radiogroup",
214
+ "aria-label": l,
215
+ className: u("hds-segmented", f),
216
+ onKeyDown: b,
217
+ children: [/* @__PURE__ */ s("span", {
218
+ ref: _,
219
+ className: "hds-segmented-thumb",
220
+ "aria-hidden": "true",
221
+ style: { opacity: 0 }
222
+ }), e.map((e, t) => {
223
+ let n = t === v;
224
+ return /* @__PURE__ */ c("button", {
225
+ ref: (e) => {
226
+ g.current[t] = e;
227
+ },
228
+ type: "button",
229
+ role: "radio",
230
+ "aria-checked": n,
231
+ "aria-label": e.ariaLabel,
232
+ tabIndex: n ? 0 : -1,
233
+ className: "hds-segmented-option",
234
+ onClick: () => y(e.value),
235
+ children: [e.icon, e.label]
236
+ }, String(e.value));
237
+ })]
238
+ });
239
+ }
240
+ //#endregion
241
+ //#region src/components/Menu/Menu.tsx
242
+ function C({ label: e, icon: r, iconOnly: o = !1, items: l, align: f = "end", triggerVariant: p = "glass", className: m }) {
243
+ let [h, _] = a(!1), v = i(null), y = i(null), b = i(null), x = n(), S = () => Array.from(b.current?.querySelectorAll("[role=\"menuitem\"]") ?? []);
244
+ function C(e) {
245
+ _(!1), e && y.current?.focus();
246
+ }
247
+ t(() => {
248
+ if (!h) return;
249
+ S()[0]?.focus();
250
+ function e(e) {
251
+ v.current && !v.current.contains(e.target) && _(!1);
252
+ }
253
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
254
+ }, [h]);
255
+ function w(e) {
256
+ let t = S(), n = t.indexOf(document.activeElement);
257
+ e.key === "Escape" ? (e.preventDefault(), C(!0)) : e.key === "Tab" ? C(!1) : 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());
258
+ }
259
+ return /* @__PURE__ */ c("div", {
260
+ ref: v,
261
+ className: u("hds-menu", m),
262
+ children: [/* @__PURE__ */ s(g, {
263
+ ref: y,
264
+ variant: p,
265
+ icon: r,
266
+ iconOnly: o,
267
+ "aria-label": o ? e : void 0,
268
+ "aria-haspopup": "menu",
269
+ "aria-expanded": h,
270
+ "aria-controls": h ? x : void 0,
271
+ onClick: () => _(!h),
272
+ children: e
273
+ }), h ? /* @__PURE__ */ s(d, {
274
+ ref: b,
275
+ id: x,
276
+ role: "menu",
277
+ "aria-label": e,
278
+ className: u("hds-menu-panel", `hds-menu-panel--${f}`),
279
+ onKeyDown: w,
280
+ children: l.map((e, t) => e.separator ? /* @__PURE__ */ s("div", {
281
+ role: "separator",
282
+ className: "hds-menu-separator"
283
+ }, `separator-${t}`) : /* @__PURE__ */ c("button", {
284
+ type: "button",
285
+ role: "menuitem",
286
+ tabIndex: -1,
287
+ className: u("hds-menu-item", e.danger && "hds-menu-item--danger"),
288
+ onClick: () => {
289
+ C(!0), e.onSelect?.();
290
+ },
291
+ children: [e.icon, e.label]
292
+ }, e.label))
293
+ }) : null]
294
+ });
295
+ }
296
+ //#endregion
297
+ //#region src/components/FloatingButton/FloatingButton.tsx
298
+ var w = e(function({ label: e, position: t = "bottom-right", type: n = "button", className: r, ...i }, a) {
299
+ return /* @__PURE__ */ s("button", {
300
+ ...i,
301
+ ref: a,
302
+ type: n,
303
+ "aria-label": e,
304
+ title: e,
305
+ className: u("hds-glass", "hds-fab", `hds-fab--${t}`, r)
306
+ });
307
+ }), T = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
308
+ function E({ open: e, onClose: r, title: a, description: o, children: f, footer: p, closeLabel: m = "Fechar", initialFocus: _ = "first", className: v }) {
309
+ let y = i(null), b = n(), x = n(), S = i(r);
310
+ return t(() => {
311
+ S.current = r;
312
+ }, [r]), t(() => {
313
+ if (!e) return;
314
+ let t = document.activeElement, n = document.body.style.overflow;
315
+ document.body.style.overflow = "hidden";
316
+ let r = y.current?.querySelectorAll(T) ?? [];
317
+ (_ === "panel" || r.length === 0 ? y.current : r[0])?.focus();
318
+ function i(e) {
319
+ if (e.key === "Escape") {
320
+ e.preventDefault(), S.current();
321
+ return;
322
+ }
323
+ if (e.key !== "Tab" || !y.current) return;
324
+ let t = Array.from(y.current.querySelectorAll(T));
325
+ if (t.length === 0) return;
326
+ let n = t[0], r = t[t.length - 1];
327
+ e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
328
+ }
329
+ return document.addEventListener("keydown", i), () => {
330
+ document.removeEventListener("keydown", i), document.body.style.overflow = n, t?.focus();
331
+ };
332
+ }, [e, _]), e ? l(/* @__PURE__ */ s("div", {
333
+ className: "hds-scrim",
334
+ onMouseDown: (e) => {
335
+ e.target === e.currentTarget && r();
336
+ },
337
+ children: /* @__PURE__ */ c(d, {
338
+ ref: y,
339
+ tone: "thick",
340
+ role: "dialog",
341
+ "aria-modal": "true",
342
+ "aria-labelledby": b,
343
+ "aria-describedby": o ? x : void 0,
344
+ tabIndex: -1,
345
+ className: u("hds-dialog", v),
346
+ children: [
347
+ /* @__PURE__ */ c("div", {
348
+ className: "hds-dialog-header",
349
+ children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
350
+ id: b,
351
+ className: "hds-dialog-title",
352
+ children: a
353
+ }), o ? /* @__PURE__ */ s("p", {
354
+ id: x,
355
+ className: "hds-dialog-description",
356
+ children: o
357
+ }) : null] }), /* @__PURE__ */ s(g, {
358
+ variant: "ghost",
359
+ size: "sm",
360
+ iconOnly: !0,
361
+ icon: /* @__PURE__ */ s(h, { name: "x" }),
362
+ "aria-label": m,
363
+ onClick: r
364
+ })]
365
+ }),
366
+ f,
367
+ p ? /* @__PURE__ */ s("div", {
368
+ className: "hds-dialog-footer",
369
+ children: p
370
+ }) : null
371
+ ]
372
+ })
373
+ }), document.body) : null;
374
+ }
375
+ //#endregion
376
+ //#region src/components/Toast/Toast.tsx
377
+ var D = {
378
+ neutral: "info",
379
+ success: "circle-check",
380
+ warning: "triangle-alert",
381
+ danger: "circle-x"
382
+ };
383
+ function O({ open: e, onClose: n, tone: r = "neutral", title: o, description: f, duration: p = 5e3, closeLabel: m = "Fechar aviso", className: _ }) {
384
+ let [v, y] = a(!1), b = i(n);
385
+ return t(() => {
386
+ b.current = n;
387
+ }, [n]), t(() => {
388
+ if (!e || !p || v) return;
389
+ let t = window.setTimeout(() => b.current?.(), p);
390
+ return () => window.clearTimeout(t);
391
+ }, [
392
+ e,
393
+ p,
394
+ v
395
+ ]), e ? l(/* @__PURE__ */ s("div", {
396
+ className: "hds-toast-region",
397
+ children: /* @__PURE__ */ c(d, {
398
+ role: r === "danger" ? "alert" : "status",
399
+ className: u("hds-toast", `hds-toast--${r}`, _),
400
+ onMouseEnter: () => y(!0),
401
+ onMouseLeave: () => y(!1),
402
+ onFocus: () => y(!0),
403
+ onBlur: () => y(!1),
404
+ children: [
405
+ /* @__PURE__ */ s(h, { name: D[r] }),
406
+ /* @__PURE__ */ c("div", {
407
+ className: "hds-toast-body",
408
+ children: [/* @__PURE__ */ s("p", {
409
+ className: "hds-toast-title",
410
+ children: o
411
+ }), f ? /* @__PURE__ */ s("p", {
412
+ className: "hds-toast-description",
413
+ children: f
414
+ }) : null]
415
+ }),
416
+ n ? /* @__PURE__ */ s(g, {
417
+ variant: "ghost",
418
+ size: "sm",
419
+ iconOnly: !0,
420
+ icon: /* @__PURE__ */ s(h, { name: "x" }),
421
+ "aria-label": m,
422
+ onClick: n
423
+ }) : null
424
+ ]
425
+ })
426
+ }), document.body) : null;
427
+ }
428
+ //#endregion
429
+ //#region src/internal/field.tsx
430
+ function k(e) {
431
+ let t = n(), r = e ?? t;
432
+ return {
433
+ id: r,
434
+ hint: `${r}-hint`,
435
+ error: `${r}-error`
436
+ };
437
+ }
438
+ function A(e, t) {
439
+ let n = [
440
+ e.hint && t.hint,
441
+ e.error && t.error,
442
+ e["aria-describedby"]
443
+ ].filter(Boolean);
444
+ return n.length ? n.join(" ") : void 0;
445
+ }
446
+ function j({ hint: e, error: t, ids: n }) {
447
+ return /* @__PURE__ */ c(o, { children: [e ? /* @__PURE__ */ s("p", {
448
+ id: n.hint,
449
+ className: "hds-hint",
450
+ children: e
451
+ }) : null, t ? /* @__PURE__ */ c("p", {
452
+ id: n.error,
453
+ className: "hds-error",
454
+ children: [/* @__PURE__ */ s(h, { name: "circle-x" }), t]
455
+ }) : null] });
456
+ }
457
+ //#endregion
458
+ //#region src/components/Input/Input.tsx
459
+ var M = e(function({ label: e, hint: t, error: n, numeric: r = !1, id: i, className: a, ...o }, l) {
460
+ let d = k(i);
461
+ return /* @__PURE__ */ c("div", {
462
+ className: u("hds-field", a),
463
+ children: [
464
+ /* @__PURE__ */ s("label", {
465
+ className: "hds-label",
466
+ htmlFor: d.id,
467
+ children: e
468
+ }),
469
+ /* @__PURE__ */ s("input", {
470
+ inputMode: r ? "decimal" : void 0,
471
+ ...o,
472
+ ref: l,
473
+ id: d.id,
474
+ "aria-invalid": n ? !0 : void 0,
475
+ "aria-describedby": A({
476
+ hint: t,
477
+ error: n,
478
+ "aria-describedby": o["aria-describedby"]
479
+ }, d),
480
+ className: u("hds-input", r && "hds-input--numeric")
481
+ }),
482
+ /* @__PURE__ */ s(j, {
483
+ hint: t,
484
+ error: n,
485
+ ids: d
486
+ })
487
+ ]
488
+ });
489
+ }), N = e(function({ label: e, options: t, placeholder: n, hint: r, error: i, id: a, className: o, ...l }, d) {
490
+ let f = k(a);
491
+ return /* @__PURE__ */ c("div", {
492
+ className: u("hds-field", o),
493
+ children: [
494
+ /* @__PURE__ */ s("label", {
495
+ className: "hds-label",
496
+ htmlFor: f.id,
497
+ children: e
498
+ }),
499
+ /* @__PURE__ */ c("div", {
500
+ className: "hds-select-wrap",
501
+ children: [/* @__PURE__ */ c("select", {
502
+ ...l,
503
+ ref: d,
504
+ id: f.id,
505
+ "aria-invalid": i ? !0 : void 0,
506
+ "aria-describedby": A({
507
+ hint: r,
508
+ error: i,
509
+ "aria-describedby": l["aria-describedby"]
510
+ }, f),
511
+ className: "hds-select",
512
+ children: [n ? /* @__PURE__ */ s("option", {
513
+ value: "",
514
+ disabled: !0,
515
+ children: n
516
+ }) : null, t.map((e) => /* @__PURE__ */ s("option", {
517
+ value: e.value,
518
+ disabled: e.disabled,
519
+ children: e.label
520
+ }, e.value))]
521
+ }), /* @__PURE__ */ s(h, { name: "chevron-down" })]
522
+ }),
523
+ /* @__PURE__ */ s(j, {
524
+ hint: r,
525
+ error: i,
526
+ ids: f
527
+ })
528
+ ]
529
+ });
530
+ }), P = e(function({ label: e, hint: t, id: n, className: r, ...i }, a) {
531
+ let o = k(n);
532
+ return /* @__PURE__ */ c("label", {
533
+ className: u("hds-checkbox", r),
534
+ htmlFor: o.id,
535
+ children: [/* @__PURE__ */ c("span", {
536
+ className: "hds-checkbox-control",
537
+ children: [/* @__PURE__ */ s("input", {
538
+ ...i,
539
+ ref: a,
540
+ id: o.id,
541
+ type: "checkbox",
542
+ className: "hds-checkbox-input",
543
+ "aria-describedby": t ? o.hint : i["aria-describedby"]
544
+ }), /* @__PURE__ */ s("span", {
545
+ className: "hds-checkbox-box",
546
+ children: /* @__PURE__ */ s(h, { name: "check" })
547
+ })]
548
+ }), /* @__PURE__ */ c("span", {
549
+ className: "hds-checkbox-text",
550
+ children: [e, t ? /* @__PURE__ */ s("span", {
551
+ id: o.hint,
552
+ className: "hds-hint",
553
+ children: t
554
+ }) : null]
555
+ })]
556
+ });
557
+ });
558
+ //#endregion
559
+ //#region src/components/Card/Card.tsx
560
+ function F({ as: e = "article", eyebrow: t, title: n, media: r, footer: i, interactive: a = !1, className: o, children: l, ...d }) {
561
+ return /* @__PURE__ */ c(e, {
562
+ ...d,
563
+ className: u("hds-card", a && "hds-card--interactive", o),
564
+ children: [
565
+ r ? /* @__PURE__ */ s("img", {
566
+ className: "hds-card-media",
567
+ src: r.src,
568
+ alt: r.alt ?? ""
569
+ }) : null,
570
+ /* @__PURE__ */ c("div", {
571
+ className: "hds-card-body",
572
+ children: [
573
+ t ? /* @__PURE__ */ s("p", {
574
+ className: "hds-card-eyebrow",
575
+ children: t
576
+ }) : null,
577
+ n ? /* @__PURE__ */ s("h3", {
578
+ className: "hds-card-title",
579
+ children: n
580
+ }) : null,
581
+ l ? /* @__PURE__ */ s("div", {
582
+ className: "hds-card-text",
583
+ children: l
584
+ }) : null
585
+ ]
586
+ }),
587
+ i ? /* @__PURE__ */ s("div", {
588
+ className: "hds-card-footer",
589
+ children: i
590
+ }) : null
591
+ ]
592
+ });
593
+ }
594
+ //#endregion
595
+ //#region src/components/Badge/Badge.tsx
596
+ var I = {
597
+ accent: "info",
598
+ success: "circle-check",
599
+ warning: "triangle-alert",
600
+ danger: "circle-x"
601
+ };
602
+ function L({ tone: e = "neutral", icon: t, children: n, className: r }) {
603
+ let i = I[e], a = t === !1 ? null : t ?? (i ? /* @__PURE__ */ s(h, { name: i }) : null);
604
+ return /* @__PURE__ */ c("span", {
605
+ className: u("hds-badge", `hds-badge--${e}`, r),
606
+ children: [a, n]
607
+ });
608
+ }
609
+ //#endregion
610
+ //#region src/components/Table/Table.tsx
611
+ function R(e) {
612
+ return e.numeric ? "hds-cell--numeric" : e.align === "center" ? "hds-cell--center" : void 0;
613
+ }
614
+ function z({ columns: e, rows: t, rowKey: n = "id", caption: r, hideCaption: i = !1, empty: a = "Nada para mostrar.", maxHeight: o, className: l }) {
615
+ return /* @__PURE__ */ s("div", {
616
+ className: u("hds-table-wrap", "hds-scroll", l),
617
+ role: "region",
618
+ "aria-label": r,
619
+ tabIndex: 0,
620
+ style: o === void 0 ? void 0 : { maxHeight: o },
621
+ children: /* @__PURE__ */ c("table", {
622
+ className: "hds-table",
623
+ children: [
624
+ r ? /* @__PURE__ */ s("caption", {
625
+ className: i ? "hds-visually-hidden" : void 0,
626
+ children: r
627
+ }) : null,
628
+ /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: e.map((e) => /* @__PURE__ */ s("th", {
629
+ scope: "col",
630
+ className: R(e),
631
+ children: e.header
632
+ }, e.key)) }) }),
633
+ /* @__PURE__ */ s("tbody", { children: t.length ? t.map((t, r) => /* @__PURE__ */ s("tr", { children: e.map((e) => /* @__PURE__ */ s("td", {
634
+ className: R(e),
635
+ children: e.render ? e.render(t) : t[e.key]
636
+ }, e.key)) }, String(t[n] ?? r))) : /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", {
637
+ colSpan: e.length || 1,
638
+ className: "hds-table-empty",
639
+ children: a
640
+ }) }) })
641
+ ]
642
+ })
643
+ });
644
+ }
645
+ //#endregion
646
+ //#region src/components/Container/Container.tsx
647
+ function B({ as: e = "section", withSidebar: t = !1, className: n, ...r }) {
648
+ return /* @__PURE__ */ s(e, {
649
+ ...r,
650
+ className: u("hds-container", t && "hds-container--with-sidebar", n)
651
+ });
652
+ }
653
+ //#endregion
654
+ //#region src/components/SectionTitle/SectionTitle.tsx
655
+ function V({ children: e, index: t, as: n = "h2", id: r, className: i }) {
656
+ return /* @__PURE__ */ c(n, {
657
+ id: r,
658
+ className: u("hds-section-title", i),
659
+ children: [t === void 0 ? null : /* @__PURE__ */ s("span", {
660
+ className: "hds-section-index",
661
+ "aria-hidden": "true",
662
+ children: String(t).padStart(2, "0")
663
+ }), e]
664
+ });
665
+ }
666
+ //#endregion
667
+ //#region src/components/Separator/Separator.tsx
668
+ function H({ orientation: e = "horizontal", decorative: t = !1, className: n }) {
669
+ return /* @__PURE__ */ s("div", {
670
+ role: t ? "none" : "separator",
671
+ "aria-orientation": t ? void 0 : e,
672
+ className: u("hds-separator", `hds-separator--${e}`, n)
673
+ });
674
+ }
675
+ //#endregion
676
+ //#region src/components/ScrollArea/ScrollArea.tsx
677
+ function U({ label: e, maxHeight: t, className: n, style: r, ...i }) {
678
+ return /* @__PURE__ */ s("div", {
679
+ ...i,
680
+ role: "region",
681
+ "aria-label": e,
682
+ tabIndex: 0,
683
+ className: u("hds-scroll", n),
684
+ style: {
685
+ maxHeight: t,
686
+ ...r
687
+ }
688
+ });
689
+ }
690
+ //#endregion
691
+ //#region src/components/Loading/Loading.tsx
692
+ function W({ size: e = "md", label: t = "Carregando…", showLabel: n = !1, className: r }) {
693
+ return /* @__PURE__ */ c("span", {
694
+ role: "status",
695
+ className: u("hds-loading", `hds-loading--${e}`, r),
696
+ children: [/* @__PURE__ */ s(h, { name: "loader" }), /* @__PURE__ */ s("span", {
697
+ className: n ? void 0 : "hds-visually-hidden",
698
+ children: t
699
+ })]
700
+ });
701
+ }
702
+ //#endregion
703
+ //#region src/components/GlowAvatar/GlowAvatar.tsx
704
+ function G({ src: e, alt: t, size: n = 96, className: r }) {
705
+ return /* @__PURE__ */ c("span", {
706
+ className: u("hds-avatar", r),
707
+ style: {
708
+ width: n,
709
+ height: n
710
+ },
711
+ children: [/* @__PURE__ */ s("span", {
712
+ className: "hds-avatar-glow",
713
+ "aria-hidden": "true"
714
+ }), /* @__PURE__ */ s("img", {
715
+ className: "hds-avatar-image",
716
+ src: e,
717
+ alt: t,
718
+ width: n,
719
+ height: n
720
+ })]
721
+ });
722
+ }
723
+ //#endregion
724
+ export { L as Badge, g as Button, F as Card, P as Checkbox, B as Container, E as Dialog, w as FloatingButton, d as GlassPanel, G as GlowAvatar, M as Input, W as Loading, C as Menu, y as NavBar, U as ScrollArea, V as SectionTitle, S as SegmentedControl, N as Select, H as Separator, b as Sidebar, z as Table, O as Toast, p as enableGlassRefraction };
725
+
726
+ //# sourceMappingURL=index.js.map