@studiolxd/brand 38.17.0 → 40.0.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 (141) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/dist/_shared/brandmessagescontext.js +15 -0
  3. package/dist/_shared/calendargrid.js +42 -42
  4. package/dist/_shared/datepicker.js +41 -41
  5. package/dist/_shared/imagecropdialog.js +54 -54
  6. package/dist/_shared/tokens.js +4 -0
  7. package/dist/_types/atoms/StarRating/StarRating.d.ts +87 -30
  8. package/dist/_types/messages/BrandMessages.d.ts +26 -0
  9. package/dist/_types/messages/BrandMessagesContext.d.ts +21 -0
  10. package/dist/_types/messages/BrandMessagesProvider.d.ts +46 -0
  11. package/dist/_types/messages/index.d.ts +5 -0
  12. package/dist/_types/molecules/Card/Card.d.ts +12 -1
  13. package/dist/_types/molecules/ConfirmDialog/ConfirmDialog.d.ts +42 -2
  14. package/dist/_types/molecules/Pagination/Pagination.d.ts +40 -23
  15. package/dist/_types/organisms/DataTable/DataTable.d.ts +3 -2
  16. package/dist/accordion.js +26 -26
  17. package/dist/alert.js +26 -26
  18. package/dist/annotation-thread.js +1 -1
  19. package/dist/app-header.js +8 -8
  20. package/dist/app-launcher.js +34 -34
  21. package/dist/app-shell.js +14 -14
  22. package/dist/assistant-message.js +8 -8
  23. package/dist/async-multi-select-field.js +9 -9
  24. package/dist/async-multi-select.js +40 -40
  25. package/dist/async-select-field.js +9 -9
  26. package/dist/async-select.js +64 -64
  27. package/dist/avatar-upload.js +40 -40
  28. package/dist/avatar.js +5 -5
  29. package/dist/banner.js +9 -9
  30. package/dist/brand.css +11 -2
  31. package/dist/button.js +7 -7
  32. package/dist/calendar-planner.js +16 -16
  33. package/dist/calendar.js +38 -38
  34. package/dist/card.js +28 -29
  35. package/dist/carousel.js +19 -19
  36. package/dist/chart.js +137 -137
  37. package/dist/chat-shell.js +23 -23
  38. package/dist/checkbox-field.js +11 -11
  39. package/dist/checkbox.js +7 -7
  40. package/dist/close-button.js +6 -6
  41. package/dist/code-block.js +15 -15
  42. package/dist/code.js +5 -5
  43. package/dist/collapsible.js +1 -1
  44. package/dist/columns.js +7 -7
  45. package/dist/command-palette.js +14 -14
  46. package/dist/confirm-dialog.css +1 -1
  47. package/dist/confirm-dialog.js +65 -42
  48. package/dist/connector-auth-shell.js +9 -9
  49. package/dist/consent.js +23 -23
  50. package/dist/container.js +6 -6
  51. package/dist/conversation-list.js +19 -19
  52. package/dist/conversation-thread.js +15 -15
  53. package/dist/copy-button.js +9 -9
  54. package/dist/copyable-value.js +17 -17
  55. package/dist/data-table.js +29 -29
  56. package/dist/date-picker-field.js +9 -9
  57. package/dist/date-time-field.js +12 -12
  58. package/dist/description-list.js +12 -12
  59. package/dist/docs-search.js +1 -1
  60. package/dist/dots-button.js +7 -7
  61. package/dist/dropdown-field.js +13 -13
  62. package/dist/email.js +44 -44
  63. package/dist/error-text.js +4 -4
  64. package/dist/field-row.js +20 -20
  65. package/dist/figure.js +8 -8
  66. package/dist/file-upload-field.js +9 -9
  67. package/dist/file-upload.js +29 -29
  68. package/dist/filter-bar.js +10 -10
  69. package/dist/floating-dock.js +17 -17
  70. package/dist/form-field.js +43 -43
  71. package/dist/form.js +14 -14
  72. package/dist/heading.js +5 -5
  73. package/dist/input-field.js +20 -20
  74. package/dist/input-phone-field.js +9 -9
  75. package/dist/input-phone.js +19 -19
  76. package/dist/input.js +5 -5
  77. package/dist/kbd.js +5 -5
  78. package/dist/label.js +5 -5
  79. package/dist/link.js +7 -7
  80. package/dist/list.js +7 -7
  81. package/dist/menu-button.js +7 -7
  82. package/dist/message-bubble.js +5 -5
  83. package/dist/message-composer.js +13 -13
  84. package/dist/messages.js +12 -0
  85. package/dist/multi-select-field.js +9 -9
  86. package/dist/multi-select.js +52 -52
  87. package/dist/notification-button.js +8 -8
  88. package/dist/notification-panel.js +25 -25
  89. package/dist/number-input-field.js +9 -9
  90. package/dist/number-input.js +11 -11
  91. package/dist/otp-field.js +9 -9
  92. package/dist/otp-input.js +48 -48
  93. package/dist/pagination.js +92 -89
  94. package/dist/paragraph.js +5 -5
  95. package/dist/password-field.js +15 -15
  96. package/dist/prose.js +4 -4
  97. package/dist/public-page-shell.js +11 -11
  98. package/dist/radio-field.js +11 -11
  99. package/dist/radio-group.js +5 -5
  100. package/dist/radio.js +5 -5
  101. package/dist/scroll-area.js +11 -11
  102. package/dist/search-form.js +8 -8
  103. package/dist/select-field.js +9 -9
  104. package/dist/select.js +85 -85
  105. package/dist/separator.js +6 -6
  106. package/dist/sidebar.js +16 -16
  107. package/dist/site-header.js +14 -14
  108. package/dist/site-shell.js +6 -6
  109. package/dist/sparkline.js +9 -9
  110. package/dist/star-rating.css +1 -1
  111. package/dist/star-rating.js +55 -41
  112. package/dist/stat-tile.js +12 -12
  113. package/dist/steps.js +32 -32
  114. package/dist/switcher-field.js +13 -13
  115. package/dist/switcher.js +8 -8
  116. package/dist/table-of-contents.js +14 -14
  117. package/dist/tag.js +5 -5
  118. package/dist/text.js +7 -7
  119. package/dist/textarea-field.js +11 -11
  120. package/dist/textarea.js +5 -5
  121. package/dist/time-field.js +9 -9
  122. package/dist/time-select.js +17 -17
  123. package/dist/toaster.js +16 -16
  124. package/dist/toggle-group.js +7 -7
  125. package/dist/toggle.js +5 -5
  126. package/dist/tokens.css +11 -2
  127. package/dist/tooltip.js +16 -16
  128. package/dist/tree-view.js +41 -41
  129. package/dist/uptime-bars.js +34 -34
  130. package/dist/user-message.js +8 -8
  131. package/dist/visually-hidden.js +5 -5
  132. package/package.json +5 -1
  133. package/src/tokens/components/description-list.css +1 -1
  134. package/src/tokens/components/star-rating.css +5 -0
  135. package/src/tokens/molecules/confirm-dialog.css +1 -0
  136. package/src/tokens/scss/components/_description-list.scss +1 -1
  137. package/src/tokens/scss/components/_star-rating.scss +3 -0
  138. package/src/tokens/scss/molecules/_confirm-dialog.scss +1 -0
  139. package/src/tokens/surface-invert.css +2 -0
  140. package/src/tokens/surface-public.css +1 -0
  141. package/src/tokens/tokens.json +4 -0
@@ -7,30 +7,30 @@ import { Button as r } from "./button.js";
7
7
  import { Avatar as i } from "./avatar.js";
8
8
  import { ErrorText as ee } from "./error-text.js";
9
9
  import { n as te, t as a } from "./_shared/validate.js";
10
- import { t as o } from "./_shared/env.js";
11
- import { t as ne } from "./_shared/imagecropdialog.js";
12
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
13
- import { useCallback as l, useEffect as u, useId as re, useRef as d, useState as f } from "react";
10
+ import { t as ne } from "./_shared/env.js";
11
+ import { t as re } from "./_shared/imagecropdialog.js";
12
+ import { useCallback as ie, useEffect as o, useId as s, useRef as c, useState as l } from "react";
13
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
14
14
  //#region src/stories/molecules/AvatarUpload/AvatarUpload.tsx
15
- var ie = {
15
+ var ae = {
16
16
  sm: "2xl",
17
17
  md: "3xl",
18
18
  lg: "4xl"
19
- }, p = {
19
+ }, f = {
20
20
  sm: "md",
21
21
  md: "lg",
22
22
  lg: "xl"
23
23
  };
24
- function m(e) {
24
+ function p(e) {
25
25
  return e.split(",").map((e) => e.trim()).filter(Boolean).map((e) => e.startsWith(".") ? e.slice(1) : e.split("/")[1] ?? e).map((e) => e.toUpperCase()).join(", ");
26
26
  }
27
- function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v = "image/jpeg,image/png,image/webp", maxSize: y, outputMimeType: b = "image/jpeg", outputSize: x, disabled: se = !1, busy: S = !1, errorMessage: ce, onChange: le, onSelect: C, onError: w, buttonLabel: T = "Subir", buttonAccessibleLabel: ue, hintLabel: de, formatsLabel: fe, maxSizeHint: pe = (e) => `máx. ${e}`, invalidTypeError: E = (e) => `Formato no admitido. Se aceptan ${e}.`, tooLargeError: D = (e) => `El archivo pesa demasiado. El máximo es ${e}.`, dropActiveMessage: me = "Suelta la imagen sobre el avatar para subirla", dropHintLabel: O = "…o arrastra la imagen hasta el avatar", cropTitle: he = "Recortar imagen", cropDescription: k, cropCancelLabel: A = "Cancelar", cropConfirmLabel: j = "Guardar", cropCloseLabel: M = "Cerrar", cropLoadingLabel: N, cropErrorMessage: P, className: F }) {
28
- let I = n(oe), L = d(null), R = d(null), [z, B] = f(null), [V, H] = f(!1), [ge, U] = f(!1), [_e, W] = f(null), G = re(), K = `${G}-hint`, q = `${G}-error`, J = fe ?? m(v), Y = de ?? [J, y === void 0 ? null : pe(a(y))].filter(Boolean).join(" · "), X = _e ?? ce, Z = se || S, Q = ue ?? T;
29
- o() && !Q.toLowerCase().includes(T.toLowerCase()) && console.warn(`[AvatarUpload] El nombre accesible del botón ("${Q}") no contiene su texto visible ("${T}"). WCAG 2.5.3 (Label in Name) lo exige: quien navega por voz dice lo que ve, y con estos textos no encontraría el control.`), u(() => {
27
+ function m({ src: m, name: oe, alt: h, shape: g = "circle", size: se, accept: _ = "image/jpeg,image/png,image/webp", maxSize: v, outputMimeType: y = "image/jpeg", outputSize: b, disabled: x = !1, busy: S = !1, errorMessage: ce, onChange: le, onSelect: C, onError: w, buttonLabel: T = "Subir", buttonAccessibleLabel: ue, hintLabel: de, formatsLabel: fe, maxSizeHint: pe = (e) => `máx. ${e}`, invalidTypeError: E = (e) => `Formato no admitido. Se aceptan ${e}.`, tooLargeError: D = (e) => `El archivo pesa demasiado. El máximo es ${e}.`, dropActiveMessage: me = "Suelta la imagen sobre el avatar para subirla", dropHintLabel: O = "…o arrastra la imagen hasta el avatar", cropTitle: he = "Recortar imagen", cropDescription: k, cropCancelLabel: A = "Cancelar", cropConfirmLabel: j = "Guardar", cropCloseLabel: M = "Cerrar", cropLoadingLabel: N, cropErrorMessage: P, className: F }) {
28
+ let I = n(se), L = c(null), R = c(null), [z, B] = l(null), [V, H] = l(!1), [ge, U] = l(!1), [_e, W] = l(null), G = s(), K = `${G}-hint`, q = `${G}-error`, J = fe ?? p(_), Y = de ?? [J, v === void 0 ? null : pe(a(v))].filter(Boolean).join(" · "), X = _e ?? ce, Z = x || S, Q = ue ?? T;
29
+ ne() && !Q.toLowerCase().includes(T.toLowerCase()) && console.warn(`[AvatarUpload] El nombre accesible del botón ("${Q}") no contiene su texto visible ("${T}"). WCAG 2.5.3 (Label in Name) lo exige: quien navega por voz dice lo que ve, y con estos textos no encontraría el control.`), o(() => {
30
30
  R.current = z;
31
- }, [z]), u(() => () => {
31
+ }, [z]), o(() => () => {
32
32
  R.current && URL.revokeObjectURL(R.current.url);
33
- }, []), u(() => {
33
+ }, []), o(() => {
34
34
  if (Z) return;
35
35
  let e = 0, t = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), n = (n) => {
36
36
  t(n) && (e += 1, H(!0));
@@ -43,8 +43,8 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
43
43
  window.removeEventListener("dragenter", n), window.removeEventListener("dragleave", r), window.removeEventListener("drop", i), window.removeEventListener("dragend", i), H(!1);
44
44
  };
45
45
  }, [Z]);
46
- let $ = l((e) => {
47
- let t = te(e, v, y, D, E(J));
46
+ let $ = ie((e) => {
47
+ let t = te(e, _, v, D, E(J));
48
48
  if (t) {
49
49
  W(t), w?.(t);
50
50
  return;
@@ -54,8 +54,8 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
54
54
  file: e
55
55
  });
56
56
  }, [
57
+ _,
57
58
  v,
58
- y,
59
59
  D,
60
60
  E,
61
61
  J,
@@ -66,17 +66,17 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
66
66
  }, ye = async (e) => {
67
67
  z && await le(e, z.file);
68
68
  };
69
- return /* @__PURE__ */ c("div", {
69
+ return /* @__PURE__ */ d("div", {
70
70
  className: [
71
71
  "avatar-upload",
72
- _ === "square" ? "avatar-upload--square" : "",
72
+ g === "square" ? "avatar-upload--square" : "",
73
73
  V ? "avatar-upload--armed" : "",
74
74
  ge ? "avatar-upload--over" : "",
75
75
  Z ? "avatar-upload--inert" : "",
76
76
  F ?? ""
77
77
  ].filter(Boolean).join(" "),
78
78
  children: [
79
- /* @__PURE__ */ c("div", {
79
+ /* @__PURE__ */ d("div", {
80
80
  className: "avatar-upload__target",
81
81
  onClick: () => {
82
82
  Z || L.current?.click();
@@ -95,29 +95,29 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
95
95
  let t = e.dataTransfer.files?.[0];
96
96
  t && $(t);
97
97
  },
98
- children: [/* @__PURE__ */ s(i, {
99
- src: h ?? void 0,
100
- name: ae,
101
- ...g === void 0 ? {} : { alt: g },
102
- shape: _,
103
- size: ie[I]
104
- }), /* @__PURE__ */ s("span", {
98
+ children: [/* @__PURE__ */ u(i, {
99
+ src: m ?? void 0,
100
+ name: oe,
101
+ ...h === void 0 ? {} : { alt: h },
102
+ shape: g,
103
+ size: ae[I]
104
+ }), /* @__PURE__ */ u("span", {
105
105
  className: "avatar-upload__overlay",
106
106
  "aria-hidden": "true",
107
- children: /* @__PURE__ */ s(e, {
107
+ children: /* @__PURE__ */ u(e, {
108
108
  name: "upload",
109
- size: p[I]
109
+ size: f[I]
110
110
  })
111
111
  })]
112
112
  }),
113
- /* @__PURE__ */ c("div", {
113
+ /* @__PURE__ */ d("div", {
114
114
  className: "avatar-upload__body",
115
115
  children: [
116
- /* @__PURE__ */ s("input", {
116
+ /* @__PURE__ */ u("input", {
117
117
  ref: L,
118
118
  type: "file",
119
119
  className: "avatar-upload__input",
120
- accept: v,
120
+ accept: _,
121
121
  tabIndex: -1,
122
122
  "aria-hidden": "true",
123
123
  disabled: Z,
@@ -126,7 +126,7 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
126
126
  t && $(t), e.target.value = "";
127
127
  }
128
128
  }),
129
- /* @__PURE__ */ s(r, {
129
+ /* @__PURE__ */ u(r, {
130
130
  variant: "outline",
131
131
  size: I,
132
132
  disabled: Z,
@@ -135,31 +135,31 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
135
135
  "aria-describedby": [Y ? K : null, X ? q : null].filter(Boolean).join(" ") || void 0,
136
136
  children: T
137
137
  }),
138
- Y && /* @__PURE__ */ s(t, {
138
+ Y && /* @__PURE__ */ u(t, {
139
139
  id: K,
140
140
  children: Y
141
141
  }),
142
- O && /* @__PURE__ */ s("span", {
142
+ O && /* @__PURE__ */ u("span", {
143
143
  className: "avatar-upload__hint",
144
144
  children: O
145
145
  }),
146
- X && /* @__PURE__ */ s(ee, {
146
+ X && /* @__PURE__ */ u(ee, {
147
147
  id: q,
148
148
  children: X
149
149
  })
150
150
  ]
151
151
  }),
152
- /* @__PURE__ */ s(t, {
152
+ /* @__PURE__ */ u(t, {
153
153
  role: "status",
154
154
  children: V ? me : ""
155
155
  }),
156
- /* @__PURE__ */ s(ne, {
156
+ /* @__PURE__ */ u(re, {
157
157
  sourceUrl: z?.url ?? null,
158
158
  title: he,
159
159
  description: k,
160
- circularCrop: _ === "circle",
161
- outputMimeType: b,
162
- ...x === void 0 ? {} : { outputSize: x },
160
+ circularCrop: g === "circle",
161
+ outputMimeType: y,
162
+ ...b === void 0 ? {} : { outputSize: b },
163
163
  busy: S,
164
164
  cancelLabel: A,
165
165
  confirmLabel: j,
@@ -173,4 +173,4 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
173
173
  });
174
174
  }
175
175
  //#endregion
176
- export { h as AvatarUpload };
176
+ export { m as AvatarUpload };
package/dist/avatar.js CHANGED
@@ -1,27 +1,27 @@
1
1
  'use client';
2
2
  import './avatar.css';
3
- import { jsx as e } from "react/jsx-runtime";
4
- import { useState as t } from "react";
3
+ import { useState as e } from "react";
4
+ import { jsx as t } from "react/jsx-runtime";
5
5
  //#region src/stories/atoms/Avatar/Avatar.tsx
6
6
  function n(e) {
7
7
  let t = e.trim().split(/\s+/);
8
8
  return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
9
9
  }
10
10
  function r({ src: r, alt: i, name: a, size: o = "md", shape: s = "circle", className: c }) {
11
- let [l, u] = t(!1), d = [
11
+ let [l, u] = e(!1), d = [
12
12
  "avatar",
13
13
  `avatar--${o}`,
14
14
  s === "square" ? "avatar--square" : "",
15
15
  c
16
16
  ].filter(Boolean).join(" ");
17
- if (r && !l) return /* @__PURE__ */ e("img", {
17
+ if (r && !l) return /* @__PURE__ */ t("img", {
18
18
  src: r,
19
19
  alt: i ?? a ?? "",
20
20
  className: d,
21
21
  onError: () => u(!0)
22
22
  });
23
23
  let f = i ?? a ?? "";
24
- return /* @__PURE__ */ e("span", {
24
+ return /* @__PURE__ */ t("span", {
25
25
  className: `${d} avatar--initials`,
26
26
  ...f ? {
27
27
  role: "img",
package/dist/banner.js CHANGED
@@ -1,33 +1,33 @@
1
1
  'use client';
2
2
  import './banner.css';
3
3
  import { CloseButton as e } from "./close-button.js";
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { forwardRef as r } from "react";
4
+ import { forwardRef as t } from "react";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  //#region src/stories/molecules/Banner/Banner.tsx
7
- var i = r(function({ variant: r = "info", children: i, actions: a, onDismiss: o, dismissLabel: s = "Descartar aviso", className: c, role: l, "aria-live": u, ...d }, f) {
7
+ var i = t(function({ variant: t = "info", children: i, actions: a, onDismiss: o, dismissLabel: s = "Descartar aviso", className: c, role: l, "aria-live": u, ...d }, f) {
8
8
  let p = [
9
9
  "banner",
10
- `banner--${r}`,
11
- r === "info" ? "surface-dark" : "",
10
+ `banner--${t}`,
11
+ t === "info" ? "surface-dark" : "",
12
12
  o ? "banner--dismissible" : "",
13
13
  c ?? ""
14
14
  ].filter(Boolean).join(" ");
15
- return /* @__PURE__ */ n("div", {
15
+ return /* @__PURE__ */ r("div", {
16
16
  ref: f,
17
17
  role: l ?? "status",
18
18
  "aria-live": u ?? "polite",
19
19
  className: p,
20
20
  ...d,
21
21
  children: [
22
- /* @__PURE__ */ t("div", {
22
+ /* @__PURE__ */ n("div", {
23
23
  className: "banner__content",
24
24
  children: i
25
25
  }),
26
- a && /* @__PURE__ */ t("div", {
26
+ a && /* @__PURE__ */ n("div", {
27
27
  className: "banner__actions",
28
28
  children: a
29
29
  }),
30
- o && /* @__PURE__ */ t(e, {
30
+ o && /* @__PURE__ */ n(e, {
31
31
  className: "banner__close",
32
32
  label: s,
33
33
  onClick: o