@studiolxd/brand 47.1.0 → 48.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 (59) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/dist/_shared/progressbar.js +19 -18
  3. package/dist/_shared/tokens.js +0 -1
  4. package/dist/_types/atoms/CopyableValue/CopyableValue.d.ts +4 -4
  5. package/dist/_types/atoms/DescriptionList/DescriptionList.d.ts +5 -4
  6. package/dist/_types/atoms/DotsButton/DotsButton.d.ts +15 -0
  7. package/dist/_types/atoms/ProgressBar/ProgressBar.d.ts +12 -2
  8. package/dist/_types/atoms/Slider/Slider.d.ts +19 -2
  9. package/dist/_types/atoms/Spinner/Spinner.d.ts +15 -1
  10. package/dist/_types/constants/copy-to-clipboard.d.ts +22 -0
  11. package/dist/_types/messages/BrandMessages.d.ts +35 -1
  12. package/dist/_types/messages/index.d.ts +1 -1
  13. package/dist/_types/molecules/CalendarPlanner/CalendarPlanner.d.ts +13 -3
  14. package/dist/_types/molecules/CalendarRoster/CalendarRoster.d.ts +38 -5
  15. package/dist/_types/molecules/Carousel/Carousel.d.ts +65 -13
  16. package/dist/_types/molecules/CodeBlock/CodeBlock.d.ts +20 -6
  17. package/dist/_types/molecules/ContextMenu/ContextMenu.d.ts +5 -1
  18. package/dist/_types/molecules/CopyButton/CopyButton.d.ts +5 -6
  19. package/dist/_types/molecules/FilterBar/FilterBar.d.ts +4 -3
  20. package/dist/_types/molecules/LanguageSwitcher/LanguageSwitcher.d.ts +13 -1
  21. package/dist/_types/molecules/NotificationList/NotificationList.d.ts +33 -3
  22. package/dist/_types/molecules/Pagination/Pagination.d.ts +16 -2
  23. package/dist/_types/molecules/ProjectCard/ProjectCard.d.ts +14 -1
  24. package/dist/_types/molecules/Stepper/Stepper.d.ts +32 -7
  25. package/dist/_types/molecules/TreeView/TreeView.d.ts +11 -2
  26. package/dist/_types/molecules/UptimeBars/UptimeBars.d.ts +20 -2
  27. package/dist/_types/organisms/Chart/Chart.d.ts +46 -8
  28. package/dist/_types/sections/LegalFooter/LegalFooter.d.ts +13 -1
  29. package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +15 -1
  30. package/dist/brand.css +2 -4
  31. package/dist/calendar-planner.js +47 -47
  32. package/dist/calendar-roster.js +28 -25
  33. package/dist/carousel.js +69 -67
  34. package/dist/chart.js +250 -249
  35. package/dist/code-block.js +34 -34
  36. package/dist/context-menu.js +1 -1
  37. package/dist/copy-button.js +35 -34
  38. package/dist/copyable-value.js +43 -42
  39. package/dist/description-list.js +1 -1
  40. package/dist/dots-button.js +18 -17
  41. package/dist/filter-bar.css +1 -1
  42. package/dist/language-switcher.js +43 -41
  43. package/dist/legal-footer.js +21 -18
  44. package/dist/notification-list.js +40 -38
  45. package/dist/pagination.js +12 -12
  46. package/dist/progress-bar.js +1 -0
  47. package/dist/project-card.js +31 -30
  48. package/dist/public-page-shell.js +12 -11
  49. package/dist/slider.js +24 -23
  50. package/dist/spinner.js +19 -14
  51. package/dist/stepper.js +35 -38
  52. package/dist/tokens.css +2 -4
  53. package/dist/tree-view.js +86 -85
  54. package/dist/uptime-bars.js +54 -53
  55. package/package.json +1 -1
  56. package/src/tokens/molecules/filter-bar.css +1 -2
  57. package/src/tokens/scss/molecules/_filter-bar.scss +1 -2
  58. package/src/tokens/surface-public.css +0 -1
  59. package/src/tokens/tokens.json +0 -1
@@ -1,71 +1,73 @@
1
1
  'use client';
2
2
  import './notification-list.css';
3
- import { Icon as e } from "./icon.js";
4
- import { VisuallyHidden as t } from "./visually-hidden.js";
5
- import { Button as n } from "./button.js";
6
- import { Text as r } from "./text.js";
7
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { VisuallyHidden as n } from "./visually-hidden.js";
6
+ import { Button as r } from "./button.js";
7
+ import { Text as i } from "./text.js";
8
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
8
9
  //#region src/stories/molecules/NotificationList/NotificationList.tsx
9
- function s({ children: e, ...t }) {
10
- return /* @__PURE__ */ a("a", {
10
+ function c({ children: e, ...t }) {
11
+ return /* @__PURE__ */ o("a", {
11
12
  ...t,
12
13
  children: e
13
14
  });
14
15
  }
15
- function c({ items: c, renderLink: l = s, renderActions: u, onItemClick: d, onMarkRead: f, label: p = "Notificaciones", unreadLabel: m = "Sin leer", markReadLabel: h = "Marcar como leída", className: g }) {
16
- return c.length === 0 ? null : /* @__PURE__ */ a("ul", {
17
- className: ["notification-list", g].filter(Boolean).join(" "),
18
- "aria-label": p,
19
- children: c.map((s) => {
20
- let c = s.unread, p = u?.(s);
21
- return /* @__PURE__ */ o("li", {
16
+ function l({ items: l, renderLink: u = c, renderActions: d, onItemClick: f, onMarkRead: p, label: m, unreadLabel: h, markReadLabel: g, className: _ }) {
17
+ let v = e("notificationList");
18
+ return l.length === 0 ? null : /* @__PURE__ */ o("ul", {
19
+ className: ["notification-list", _].filter(Boolean).join(" "),
20
+ "aria-label": v("label", m),
21
+ children: l.map((e) => {
22
+ let c = e.unread, l = d?.(e);
23
+ return /* @__PURE__ */ s("li", {
22
24
  className: "notification-list__item",
23
25
  children: [
24
- /* @__PURE__ */ a("span", {
26
+ /* @__PURE__ */ o("span", {
25
27
  className: "notification-list__indicator",
26
- children: c && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, {
28
+ children: c && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(t, {
27
29
  name: "dot",
28
30
  size: "sm",
29
31
  className: "notification-list__dot"
30
- }), /* @__PURE__ */ a(t, { children: s.unreadLabel ?? m })] })
32
+ }), /* @__PURE__ */ o(n, { children: e.unreadLabel ?? v("unread", h) })] })
31
33
  }),
32
- /* @__PURE__ */ o("div", {
34
+ /* @__PURE__ */ s("div", {
33
35
  className: "notification-list__text",
34
- children: [s.href ? l({
35
- href: s.href,
36
+ children: [e.href ? u({
37
+ href: e.href,
36
38
  className: "notification-list__title",
37
- onClick: d ? () => d(s) : void 0,
38
- children: s.title
39
- }) : /* @__PURE__ */ a(r, {
39
+ onClick: f ? () => f(e) : void 0,
40
+ children: e.title
41
+ }) : /* @__PURE__ */ o(i, {
40
42
  className: "notification-list__title",
41
- children: s.title
42
- }), s.body && /* @__PURE__ */ a(r, {
43
+ children: e.title
44
+ }), e.body && /* @__PURE__ */ o(i, {
43
45
  tone: "muted",
44
46
  className: "notification-list__body",
45
- children: s.body
47
+ children: e.body
46
48
  })]
47
49
  }),
48
- (f || p) && /* @__PURE__ */ o("div", {
50
+ (p || l) && /* @__PURE__ */ s("div", {
49
51
  className: "notification-list__actions",
50
- children: [f && c && /* @__PURE__ */ a(n, {
52
+ children: [p && c && /* @__PURE__ */ o(r, {
51
53
  variant: "text",
52
54
  size: "sm",
53
- onClick: () => f(s.id),
54
- children: h
55
- }), p]
55
+ onClick: () => p(e.id),
56
+ children: v("markRead", g)
57
+ }), l]
56
58
  }),
57
- s.timeDateTime ? /* @__PURE__ */ a("time", {
59
+ e.timeDateTime ? /* @__PURE__ */ o("time", {
58
60
  className: "notification-list__time",
59
- dateTime: s.timeDateTime,
60
- children: s.time
61
- }) : /* @__PURE__ */ a("span", {
61
+ dateTime: e.timeDateTime,
62
+ children: e.time
63
+ }) : /* @__PURE__ */ o("span", {
62
64
  className: "notification-list__time",
63
- children: s.time
65
+ children: e.time
64
66
  })
65
67
  ]
66
- }, s.id);
68
+ }, e.id);
67
69
  })
68
70
  });
69
71
  }
70
72
  //#endregion
71
- export { c as NotificationList };
73
+ export { l as NotificationList };
@@ -48,7 +48,7 @@ function o(e, t) {
48
48
  "..."
49
49
  ];
50
50
  }
51
- function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSize: d = 10, hrefs: f, previousHref: p, nextHref: m, onPrevious: h, onNext: g, onPageChange: _, hrefBuilder: v, linkComponent: y, onPageSizeChange: b, pageSizeOptions: x, afterPageSize: S, showTotal: C = !1, size: w = "md", ariaLabel: T, pageLabel: E, previousLabel: D, nextLabel: O, pagesGroupLabel: k, pageSizeLabel: A, totalLabel: j, className: M }) {
51
+ function s({ mode: s = "pages", total: c, pageCount: l, page: u = 1, pageSize: d = 10, hrefs: f, previousHref: p, nextHref: m, onPrevious: h, onNext: g, onPageChange: _, hrefBuilder: v, linkComponent: y, onPageSizeChange: b, pageSizeOptions: x, afterPageSize: S, showTotal: C = !1, size: w = "md", ariaLabel: T, pageLabel: E, previousLabel: D, nextLabel: O, pagesGroupLabel: k, pageSizeLabel: A, totalLabel: j, className: M }) {
52
52
  let N = e("pagination"), P = v ?? (f ? (e) => f[e] : void 0), F = y ?? "a";
53
53
  if (s === "cursor") {
54
54
  let e = w === "sm" ? "xs" : w === "lg" ? "md" : "sm", n = (n) => {
@@ -86,9 +86,9 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
86
86
  })
87
87
  });
88
88
  }
89
- if (l === void 0 && c === 0 && !S) return null;
90
- let I = l ?? (d === "all" ? 1 : Math.ceil(c / d)), L = I > 1 ? o(u, I) : [];
91
- function R(e, t) {
89
+ if (c === 0 || l === 0 || c === void 0 && (l ?? 1) <= 1 && !S) return null;
90
+ let I = c ?? 0, L = l ?? (d === "all" ? 1 : Math.ceil(I / d)), R = L > 1 ? o(u, L) : [];
91
+ function z(e, t) {
92
92
  if (e === "...") return /* @__PURE__ */ r("span", {
93
93
  className: "pagination__ellipsis",
94
94
  "aria-hidden": "true",
@@ -112,7 +112,7 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
112
112
  children: e
113
113
  }, e);
114
114
  }
115
- function z(e, n, i) {
115
+ function B(e, n, i) {
116
116
  let a = n === "prev" ? N("previous", D) : N("next", O), o = /* @__PURE__ */ r(t, {
117
117
  name: "chevron",
118
118
  size: w === "sm" ? "xs" : w === "lg" ? "md" : "sm",
@@ -135,7 +135,7 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
135
135
  children: o
136
136
  });
137
137
  }
138
- let B = C || !!b || !!S;
138
+ let V = C || !!b || !!S;
139
139
  return /* @__PURE__ */ i("nav", {
140
140
  className: [
141
141
  "pagination",
@@ -143,12 +143,12 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
143
143
  M
144
144
  ].filter(Boolean).join(" "),
145
145
  "aria-label": N("label", T),
146
- children: [B && /* @__PURE__ */ i("div", {
146
+ children: [V && /* @__PURE__ */ i("div", {
147
147
  className: "pagination__meta",
148
148
  children: [
149
149
  C && /* @__PURE__ */ r("span", {
150
150
  className: "pagination__summary",
151
- children: N("total", j)(c)
151
+ children: N("total", j)(I)
152
152
  }),
153
153
  b && /* @__PURE__ */ r("div", {
154
154
  className: "pagination__size-selector",
@@ -165,14 +165,14 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
165
165
  children: S
166
166
  })
167
167
  ]
168
- }), I > 1 && /* @__PURE__ */ i("div", {
168
+ }), L > 1 && /* @__PURE__ */ i("div", {
169
169
  className: "pagination__controls",
170
170
  role: "group",
171
171
  "aria-label": N("pagesGroup", k),
172
172
  children: [
173
- z(u - 1, "prev", u <= 1),
174
- L.map((e, t) => R(e, t)),
175
- z(u + 1, "next", u >= I)
173
+ B(u - 1, "prev", u <= 1),
174
+ R.map((e, t) => z(e, t)),
175
+ B(u + 1, "next", u >= L)
176
176
  ]
177
177
  })]
178
178
  });
@@ -1,2 +1,3 @@
1
+ 'use client';
1
2
  import { t as e } from "./_shared/progressbar.js";
2
3
  export { e as ProgressBar };
@@ -1,55 +1,56 @@
1
1
  'use client';
2
2
  import './project-card.css';
3
- import { Heading as e } from "./heading.js";
4
- import { Paragraph as t } from "./paragraph.js";
5
- import { Tag as n } from "./tag.js";
6
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
7
- import { useRender as a } from "@base-ui/react/use-render";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Heading as t } from "./heading.js";
5
+ import { Paragraph as n } from "./paragraph.js";
6
+ import { Tag as r } from "./tag.js";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
+ import { useRender as o } from "@base-ui/react/use-render";
8
9
  //#region src/stories/molecules/ProjectCard/ProjectCard.tsx
9
- function o({ title: o, description: s, media: c, tags: l, href: u, render: d, headingLevel: f = 3, headingSize: p = 5, tagsLabel: m = "Categorías", className: h, id: g }) {
10
- let _ = a({
11
- render: d,
12
- enabled: d !== void 0,
10
+ function s({ title: s, description: c, media: l, tags: u, href: d, render: f, headingLevel: p = 3, headingSize: m = 5, tagsLabel: h, className: g, id: _ }) {
11
+ let v = e("projectCard"), y = o({
12
+ render: f,
13
+ enabled: f !== void 0,
13
14
  props: {
14
15
  className: "project-card__link",
15
- children: o
16
+ children: s
16
17
  }
17
- }) ?? (u === void 0 ? o : /* @__PURE__ */ r("a", {
18
- href: u,
18
+ }) ?? (d === void 0 ? s : /* @__PURE__ */ i("a", {
19
+ href: d,
19
20
  className: "project-card__link",
20
- children: o
21
+ children: s
21
22
  }));
22
- return /* @__PURE__ */ i("article", {
23
- id: g,
24
- className: ["project-card", h].filter(Boolean).join(" "),
23
+ return /* @__PURE__ */ a("article", {
24
+ id: _,
25
+ className: ["project-card", g].filter(Boolean).join(" "),
25
26
  children: [
26
- c && /* @__PURE__ */ r("div", {
27
+ l && /* @__PURE__ */ i("div", {
27
28
  className: "project-card__media",
28
- children: /* @__PURE__ */ r("img", {
29
- src: c.src,
30
- alt: c.alt
29
+ children: /* @__PURE__ */ i("img", {
30
+ src: l.src,
31
+ alt: l.alt
31
32
  })
32
33
  }),
33
- l && l.length > 0 && /* @__PURE__ */ r("ul", {
34
+ u && u.length > 0 && /* @__PURE__ */ i("ul", {
34
35
  className: "project-card__tags",
35
- "aria-label": m,
36
- children: l.map((e) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(n, {
36
+ "aria-label": v("tags", h),
37
+ children: u.map((e) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(r, {
37
38
  variant: e.variant ?? "neutral",
38
39
  children: e.label
39
40
  }) }, e.id ?? e.label))
40
41
  }),
41
- /* @__PURE__ */ r(e, {
42
- level: f,
43
- size: p,
42
+ /* @__PURE__ */ i(t, {
43
+ level: p,
44
+ size: m,
44
45
  className: "project-card__title",
45
- children: _
46
+ children: y
46
47
  }),
47
- s && /* @__PURE__ */ r(t, {
48
+ c && /* @__PURE__ */ i(n, {
48
49
  className: "project-card__description",
49
- children: s
50
+ children: c
50
51
  })
51
52
  ]
52
53
  });
53
54
  }
54
55
  //#endregion
55
- export { o as ProjectCard };
56
+ export { s as ProjectCard };
@@ -7,29 +7,30 @@ import { SiteShell as r } from "./site-shell.js";
7
7
  import { forwardRef as i } from "react";
8
8
  import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
9
9
  //#region src/stories/templates/PublicPageShell/PublicPageShell.tsx
10
- var c = i(function({ children: i, header: c, footer: l, preferences: u, preferencesLabel: d, mainWidth: f = "xl", mainSpace: p = "xl", mainFlush: m = !1, id: h = "main-content", shell: g = !0 }, _) {
11
- let v = e("publicPageShell");
12
- if (!g) return /* @__PURE__ */ o(a, { children: i });
13
- let y = u && /* @__PURE__ */ o(t, {
10
+ var c = i(function({ children: i, header: c, footer: l, preferences: u, preferencesLabel: d, preferencesWidth: f = "xl", mainWidth: p = "xl", mainSpace: m = "xl", mainFlush: h = !1, id: g = "main-content", shell: _ = !0 }, v) {
11
+ let y = e("publicPageShell");
12
+ if (!_) return /* @__PURE__ */ o(a, { children: i });
13
+ let b = u && /* @__PURE__ */ o(t, {
14
14
  as: "section",
15
+ width: f,
15
16
  className: "public-page-shell__preferences",
16
- "aria-label": v("preferences", d),
17
+ "aria-label": y("preferences", d),
17
18
  children: /* @__PURE__ */ o("div", {
18
19
  className: "public-page-shell__preferences-row",
19
20
  children: u
20
21
  })
21
22
  });
22
23
  return /* @__PURE__ */ o(r, {
23
- ref: _,
24
+ ref: v,
24
25
  header: c && /* @__PURE__ */ o(n, { children: c }),
25
- footer: (y || l) && /* @__PURE__ */ s(a, { children: [y && /* @__PURE__ */ o(n, { children: y }), l && /* @__PURE__ */ o(n, { children: l })] }),
26
+ footer: (b || l) && /* @__PURE__ */ s(a, { children: [b && /* @__PURE__ */ o(n, { children: b }), l && /* @__PURE__ */ o(n, { children: l })] }),
26
27
  children: /* @__PURE__ */ o(t, {
27
28
  as: "main",
28
- id: h,
29
+ id: g,
29
30
  tabIndex: -1,
30
- width: f,
31
- space: p,
32
- flush: m,
31
+ width: p,
32
+ space: m,
33
+ flush: h,
33
34
  children: i
34
35
  })
35
36
  });
package/dist/slider.js CHANGED
@@ -1,35 +1,36 @@
1
1
  'use client';
2
2
  import './slider.css';
3
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
4
- import { Slider as n } from "@base-ui/react/slider";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
+ import { Slider as r } from "@base-ui/react/slider";
5
6
  //#region src/stories/atoms/Slider/Slider.tsx
6
- function r({ value: r, defaultValue: i, onValueChange: a, onValueCommitted: o, label: s, thumbLabel: c, showValue: l = !1, orientation: u = "horizontal", className: d, ...f }) {
7
- let p = r ?? i ?? 0, m = Array.isArray(p) ? p.length : 1, h = c ?? ((e, t) => t === 1 ? s ?? "Valor" : t === 2 ? e === 0 ? "Mínimo" : "Máximo" : `Valor ${e + 1}`), g = [
7
+ function i({ value: i, defaultValue: a, onValueChange: o, onValueCommitted: s, label: c, thumbLabel: l, showValue: u = !1, orientation: d = "horizontal", className: f, ...p }) {
8
+ let m = e("slider"), h = i ?? a ?? 0, g = Array.isArray(h) ? h.length : 1, _ = l ?? ((e, t) => t === 1 ? m("value", c) : t === 2 ? m(e === 0 ? "min" : "max") : m("valueAt")(e + 1)), v = [
8
9
  "slider",
9
- u === "vertical" ? "slider--vertical" : "",
10
- d ?? ""
10
+ d === "vertical" ? "slider--vertical" : "",
11
+ f ?? ""
11
12
  ].filter(Boolean).join(" ");
12
- return /* @__PURE__ */ t(n.Root, {
13
- className: g,
14
- orientation: u,
15
- value: r,
16
- defaultValue: i,
17
- "aria-label": m === 1 ? void 0 : s,
18
- onValueChange: a ? (e) => a(e) : void 0,
19
- onValueCommitted: o ? (e) => o(e) : void 0,
20
- ...f,
21
- children: [/* @__PURE__ */ e(n.Control, {
13
+ return /* @__PURE__ */ n(r.Root, {
14
+ className: v,
15
+ orientation: d,
16
+ value: i,
17
+ defaultValue: a,
18
+ "aria-label": g === 1 ? void 0 : c,
19
+ onValueChange: o ? (e) => o(e) : void 0,
20
+ onValueCommitted: s ? (e) => s(e) : void 0,
21
+ ...p,
22
+ children: [/* @__PURE__ */ t(r.Control, {
22
23
  className: "slider__control",
23
- children: /* @__PURE__ */ t(n.Track, {
24
+ children: /* @__PURE__ */ n(r.Track, {
24
25
  className: "slider__track",
25
- children: [/* @__PURE__ */ e(n.Indicator, { className: "slider__indicator" }), Array.from({ length: m }, (t, r) => /* @__PURE__ */ e(n.Thumb, {
26
- index: r,
26
+ children: [/* @__PURE__ */ t(r.Indicator, { className: "slider__indicator" }), Array.from({ length: g }, (e, n) => /* @__PURE__ */ t(r.Thumb, {
27
+ index: n,
27
28
  className: "slider__thumb",
28
- getAriaLabel: () => h(r, m)
29
- }, r))]
29
+ getAriaLabel: () => _(n, g)
30
+ }, n))]
30
31
  })
31
- }), l && /* @__PURE__ */ e(n.Value, { className: "slider__value" })]
32
+ }), u && /* @__PURE__ */ t(r.Value, { className: "slider__value" })]
32
33
  });
33
34
  }
34
35
  //#endregion
35
- export { r as Slider };
36
+ export { i as Slider };
package/dist/spinner.js CHANGED
@@ -1,14 +1,16 @@
1
+ 'use client';
1
2
  import './spinner.css';
2
- import { VisuallyHidden as e } from "./visually-hidden.js";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { VisuallyHidden as t } from "./visually-hidden.js";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
6
  //#region src/stories/atoms/Spinner/Spinner.tsx
5
- function r() {
6
- return /* @__PURE__ */ t("svg", {
7
+ function i() {
8
+ return /* @__PURE__ */ n("svg", {
7
9
  className: "spinner__square",
8
10
  viewBox: "0 0 24 24",
9
11
  "aria-hidden": "true",
10
12
  focusable: "false",
11
- children: /* @__PURE__ */ t("rect", {
13
+ children: /* @__PURE__ */ n("rect", {
12
14
  className: "spinner__stroke",
13
15
  x: "2",
14
16
  y: "2",
@@ -18,17 +20,20 @@ function r() {
18
20
  })
19
21
  });
20
22
  }
21
- function i({ size: i = "md", label: a = "Cargando…", "aria-hidden": o }) {
22
- return o ? /* @__PURE__ */ t("span", {
23
- className: `spinner spinner--${i}`,
23
+ function a({ size: a = "md", label: o, "aria-hidden": s }) {
24
+ let c = e("spinner");
25
+ if (s) return /* @__PURE__ */ n("span", {
26
+ className: `spinner spinner--${a}`,
24
27
  "aria-hidden": "true",
25
- children: /* @__PURE__ */ t(r, {})
26
- }) : /* @__PURE__ */ n("span", {
27
- className: `spinner spinner--${i}`,
28
+ children: /* @__PURE__ */ n(i, {})
29
+ });
30
+ let l = c("label", o);
31
+ return /* @__PURE__ */ r("span", {
32
+ className: `spinner spinner--${a}`,
28
33
  role: "status",
29
- "aria-label": a,
30
- children: [/* @__PURE__ */ t(r, {}), /* @__PURE__ */ t(e, { children: a })]
34
+ "aria-label": l,
35
+ children: [/* @__PURE__ */ n(i, {}), /* @__PURE__ */ n(t, { children: l })]
31
36
  });
32
37
  }
33
38
  //#endregion
34
- export { i as Spinner };
39
+ export { a as Spinner };
package/dist/stepper.js CHANGED
@@ -1,67 +1,64 @@
1
1
  'use client';
2
2
  import './stepper.css';
3
- import { VisuallyHidden as e } from "./visually-hidden.js";
4
- import { StepMarker as t } from "./step-marker.js";
5
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { VisuallyHidden as t } from "./visually-hidden.js";
5
+ import { StepMarker as n } from "./step-marker.js";
6
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
7
  //#region src/stories/molecules/Stepper/Stepper.tsx
7
- function a({ steps: a, current: o, onStepSelect: s, label: c = "Progreso", compactLabel: l = (e, t) => `Paso ${e} de ${t}`, labels: u, className: d, id: f }) {
8
- if (a.length < 2) return null;
9
- let p = {
10
- completed: "Completado",
11
- current: "Paso actual",
12
- pending: "Pendiente",
13
- ...u
14
- }, m = a.length, h = Math.min(Math.max(o, 0), m - 1), g = a[h];
15
- return /* @__PURE__ */ i("div", {
16
- id: f,
17
- className: ["stepper", d].filter(Boolean).join(" "),
18
- children: [/* @__PURE__ */ i("p", {
8
+ function o({ steps: o, current: s, onStepSelect: c, label: l, compactLabel: u, labels: d, className: f, id: p }) {
9
+ let m = e("stepper");
10
+ if (o.length < 2) return null;
11
+ let h = (e) => m(e, d?.[e]), g = o.length, _ = Math.min(Math.max(s, 0), g - 1), v = o[_];
12
+ return /* @__PURE__ */ a("div", {
13
+ id: p,
14
+ className: ["stepper", f].filter(Boolean).join(" "),
15
+ children: [/* @__PURE__ */ a("p", {
19
16
  className: "stepper__compact",
20
- children: [/* @__PURE__ */ r("span", {
17
+ children: [/* @__PURE__ */ i("span", {
21
18
  className: "stepper__compact-count",
22
- children: l(h + 1, m)
23
- }), /* @__PURE__ */ r("span", {
19
+ children: m("compact", u)(_ + 1, g)
20
+ }), /* @__PURE__ */ i("span", {
24
21
  className: "stepper__compact-label",
25
- children: g.label
22
+ children: v.label
26
23
  })]
27
- }), /* @__PURE__ */ r("ol", {
24
+ }), /* @__PURE__ */ i("ol", {
28
25
  className: "stepper__list",
29
- "aria-label": c,
30
- children: a.map((a, o) => {
31
- let c = o < h ? "completed" : o === h ? "current" : "pending", l = s !== void 0 && c !== "current" && (a.reachable ?? c === "completed"), u = /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(t, {
32
- state: c === "completed" ? "done" : c === "current" ? "current" : "pending",
26
+ "aria-label": m("label", l),
27
+ children: o.map((e, o) => {
28
+ let s = o < _ ? "completed" : o === _ ? "current" : "pending", l = c !== void 0 && s !== "current" && (e.reachable ?? s === "completed"), u = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(n, {
29
+ state: s === "completed" ? "done" : s === "current" ? "current" : "pending",
33
30
  count: o + 1,
34
31
  className: "stepper__marker"
35
- }), /* @__PURE__ */ i("span", {
32
+ }), /* @__PURE__ */ a("span", {
36
33
  className: "stepper__text",
37
34
  children: [
38
- /* @__PURE__ */ i(e, { children: [p[c], ": "] }),
39
- /* @__PURE__ */ r("span", {
35
+ /* @__PURE__ */ a(t, { children: [h(s), ": "] }),
36
+ /* @__PURE__ */ i("span", {
40
37
  className: "stepper__label",
41
- children: a.label
38
+ children: e.label
42
39
  }),
43
- a.description && /* @__PURE__ */ r("span", {
40
+ e.description && /* @__PURE__ */ i("span", {
44
41
  className: "stepper__description",
45
- children: a.description
42
+ children: e.description
46
43
  })
47
44
  ]
48
45
  })] });
49
- return /* @__PURE__ */ r("li", {
50
- className: `stepper__step stepper__step--${c}`,
51
- children: l ? /* @__PURE__ */ r("button", {
46
+ return /* @__PURE__ */ i("li", {
47
+ className: `stepper__step stepper__step--${s}`,
48
+ children: l ? /* @__PURE__ */ i("button", {
52
49
  type: "button",
53
50
  className: "stepper__item stepper__item--action",
54
- onClick: () => s(o, a),
51
+ onClick: () => c(o, e),
55
52
  children: u
56
- }) : /* @__PURE__ */ r("span", {
53
+ }) : /* @__PURE__ */ i("span", {
57
54
  className: "stepper__item",
58
- "aria-current": c === "current" ? "step" : void 0,
55
+ "aria-current": s === "current" ? "step" : void 0,
59
56
  children: u
60
57
  })
61
- }, a.id ?? o);
58
+ }, e.id ?? o);
62
59
  })
63
60
  })]
64
61
  });
65
62
  }
66
63
  //#endregion
67
- export { a as Stepper };
64
+ export { o as Stepper };