@studiolxd/brand 48.1.0 → 49.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 (31) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/dist/_shared/untrustedtext.js +27 -26
  3. package/dist/_types/atoms/TypingIndicator/TypingIndicator.d.ts +29 -2
  4. package/dist/_types/messages/BrandMessages.d.ts +25 -1
  5. package/dist/_types/messages/index.d.ts +1 -1
  6. package/dist/_types/molecules/AssistantMessage/AssistantMessage.d.ts +15 -1
  7. package/dist/_types/molecules/ConversationList/ConversationList.d.ts +42 -8
  8. package/dist/_types/molecules/MessageComposer/MessageComposer.d.ts +24 -1
  9. package/dist/_types/organisms/AnnotationThread/AnnotationThread.d.ts +52 -7
  10. package/dist/_types/organisms/ConversationThread/ConversationThread.d.ts +26 -3
  11. package/dist/_types/templates/ChatShell/ChatShell.d.ts +22 -4
  12. package/dist/_types/templates/ConnectorAuth/ConnectorAuthShell.d.ts +6 -1
  13. package/dist/_types/templates/ConnectorAuth/ConnectorConsentPage.d.ts +52 -18
  14. package/dist/_types/templates/ConnectorAuth/ConnectorExternalSignInPage.d.ts +57 -17
  15. package/dist/_types/templates/ConnectorAuth/ConnectorRejectionPage.d.ts +59 -15
  16. package/dist/_types/templates/ConnectorAuth/ConnectorRequestSummary.d.ts +43 -12
  17. package/dist/_types/templates/ConnectorAuth/ConnectorSignInPage.d.ts +46 -12
  18. package/dist/_types/templates/ConnectorAuth/UntrustedText.d.ts +31 -4
  19. package/dist/annotation-thread.js +49 -46
  20. package/dist/assistant-message.js +12 -9
  21. package/dist/chat-shell.js +50 -49
  22. package/dist/connector-consent-page.js +58 -68
  23. package/dist/connector-external-sign-in-page.js +22 -28
  24. package/dist/connector-rejection-page.js +31 -62
  25. package/dist/connector-request-summary.js +22 -20
  26. package/dist/connector-sign-in-page.js +21 -25
  27. package/dist/conversation-list.js +56 -55
  28. package/dist/conversation-thread.js +33 -31
  29. package/dist/message-composer.js +38 -37
  30. package/dist/typing-indicator.js +12 -9
  31. package/package.json +1 -1
@@ -1,75 +1,44 @@
1
1
  'use client';
2
- import { Button as e } from "./button.js";
3
- import { Stack as t } from "./stack.js";
4
- import { Code as n } from "./code.js";
5
- import { Paragraph as r } from "./paragraph.js";
6
- import { ConnectorAuthShell as i } from "./connector-auth-shell.js";
7
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { n as e } from "./_shared/brandmessagescontext.js";
3
+ import { Button as t } from "./button.js";
4
+ import { Stack as n } from "./stack.js";
5
+ import { Code as r } from "./code.js";
6
+ import { Paragraph as i } from "./paragraph.js";
7
+ import { ConnectorAuthShell as a } from "./connector-auth-shell.js";
8
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
9
  //#region src/stories/templates/ConnectorAuth/ConnectorRejectionPage.tsx
9
- var s = {
10
- "invalid-client": {
11
- title: "Esta herramienta no está registrada",
12
- description: "La aplicación que pide acceso no consta en este producto. No se ha concedido nada.",
13
- hint: "Vuelve a la herramienta y conéctala otra vez desde el principio. Si el error se repite, quien la mantiene tiene que registrarla de nuevo.",
14
- retryLabel: "Volver a la herramienta"
15
- },
16
- "invalid-redirect-uri": {
17
- title: "La dirección de retorno no está permitida",
18
- description: "La herramienta ha pedido que el acceso se envíe a una dirección distinta de la que tiene registrada. No se ha enviado nada a ninguna parte.",
19
- hint: "Es la comprobación que impide que un acceso legítimo acabe en manos de otro. Si la herramienta es tuya, revisa la dirección de retorno que tiene configurada; si no la reconoces, no vuelvas a intentarlo.",
20
- retryLabel: "Volver a la herramienta"
21
- },
22
- "invalid-request": {
23
- title: "La petición está incompleta",
24
- description: "Falta algo en lo que ha pedido la herramienta, o ha llegado alterado por el camino. No se ha concedido ningún acceso.",
25
- hint: "Vuelve a la herramienta y empieza la conexión de nuevo. Un enlace copiado a mano o reutilizado de otra vez suele acabar así.",
26
- retryLabel: "Volver a la herramienta"
27
- },
28
- "access-denied": {
29
- title: "No se ha dado acceso",
30
- description: "La conexión se ha cancelado. La herramienta no ha recibido ningún permiso sobre tus datos.",
31
- hint: "Puedes cerrar esta pantalla. Si ha sido sin querer, vuelve a la herramienta y pide la conexión otra vez.",
32
- retryLabel: "Volver a intentarlo"
33
- },
34
- "session-expired": {
35
- title: "La sesión ha caducado",
36
- description: "Ha pasado demasiado tiempo desde que se abrió esta pantalla, así que la decisión ya no vale.",
37
- hint: "Inicia sesión otra vez y repite la conexión desde la herramienta. Nada de lo anterior se ha concedido.",
38
- retryLabel: "Iniciar sesión"
39
- }
40
- };
41
- function c({ reason: c, title: l, description: u, hint: d, code: f, codeLabel: p = "Código", retryHref: m, onRetry: h, retryLabel: g, retryAction: _, aside: v, header: y, footer: b, preferences: x, preferencesLabel: S, id: C, shell: w }) {
42
- let T = s[c], E = g ?? T.retryLabel, D = _ ?? (m === void 0 ? h ? /* @__PURE__ */ a(e, {
43
- onClick: h,
44
- children: E
45
- }) : null : /* @__PURE__ */ a(e, {
46
- href: m,
47
- children: E
10
+ function c({ title: c, description: l, hint: u, code: d, codeLabel: f, retryHref: p, onRetry: m, retryLabel: h, retryAction: g, aside: _, header: v, footer: y, preferences: b, preferencesLabel: x, id: S, shell: C }) {
11
+ let w = e("connectorRejection"), T = g ?? (p === void 0 ? m ? /* @__PURE__ */ o(t, {
12
+ onClick: m,
13
+ children: h
14
+ }) : null : /* @__PURE__ */ o(t, {
15
+ href: p,
16
+ children: h
48
17
  }));
49
- return /* @__PURE__ */ a(i, {
50
- title: l ?? T.title,
51
- description: u ?? T.description,
52
- intro: f === void 0 ? void 0 : /* @__PURE__ */ o(r, {
18
+ return /* @__PURE__ */ o(a, {
19
+ title: c,
20
+ description: l,
21
+ intro: d === void 0 ? void 0 : /* @__PURE__ */ s(i, {
53
22
  size: "small",
54
23
  children: [
55
- p,
24
+ w("code", f),
56
25
  ": ",
57
- /* @__PURE__ */ a(n, { children: f })
26
+ /* @__PURE__ */ o(r, { children: d })
58
27
  ]
59
28
  }),
60
- aside: v,
61
- header: y,
62
- footer: b,
63
- preferences: x,
64
- preferencesLabel: S,
65
- id: C,
66
- shell: w,
67
- children: /* @__PURE__ */ o(t, {
29
+ aside: _,
30
+ header: v,
31
+ footer: y,
32
+ preferences: b,
33
+ preferencesLabel: x,
34
+ id: S,
35
+ shell: C,
36
+ children: /* @__PURE__ */ s(n, {
68
37
  align: "stretch",
69
- children: [/* @__PURE__ */ a(r, {
38
+ children: [/* @__PURE__ */ o(i, {
70
39
  size: "large",
71
- children: d ?? T.hint
72
- }), D]
40
+ children: u
41
+ }), T]
73
42
  })
74
43
  });
75
44
  }
@@ -1,36 +1,38 @@
1
+ 'use client';
1
2
  import './connector-request-summary.css';
2
- import { DescriptionDetails as e, DescriptionList as t, DescriptionTerm as n } from "./description-list.js";
3
- import { t as r } from "./_shared/untrustedtext.js";
4
- 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 { DescriptionDetails as t, DescriptionList as n, DescriptionTerm as r } from "./description-list.js";
5
+ import { t as i } from "./_shared/untrustedtext.js";
6
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
7
  //#region src/stories/templates/ConnectorAuth/ConnectorRequestSummary.tsx
6
- function s({ clientName: s, productName: c, accountEmail: l, scope: u, redirectHost: d, clientLabel: f = "Herramienta", productLabel: p = "Producto", accountLabel: m = "Cuenta", scopeLabel: h = "Permiso", redirectLabel: g = "Destino", scopeReadLabel: _ = "leer los datos de este producto", scopeWriteLabel: v = "leer y modificar los datos de este producto", expandLabel: y, collapseLabel: b, valueQuotes: x, className: S }) {
7
- let C = (e) => /* @__PURE__ */ a(r, {
8
+ function c({ clientName: c, productName: l, accountEmail: u, scope: d, redirectHost: f, clientLabel: p, productLabel: m, accountLabel: h, scopeLabel: g, redirectLabel: _, scopeReadLabel: v, scopeWriteLabel: y, expandLabel: b, collapseLabel: x, valueQuotes: S, className: C }) {
9
+ let w = e("connectorRequestSummary"), T = (e) => /* @__PURE__ */ o(i, {
8
10
  value: e,
9
11
  expandable: !0,
10
- expandLabel: y,
11
- collapseLabel: b,
12
- quotes: x
12
+ expandLabel: b,
13
+ collapseLabel: x,
14
+ quotes: S
13
15
  });
14
- return /* @__PURE__ */ o(t, {
15
- className: ["connector-request-summary", S].filter(Boolean).join(" "),
16
+ return /* @__PURE__ */ s(n, {
17
+ className: ["connector-request-summary", C].filter(Boolean).join(" "),
16
18
  children: [
17
- /* @__PURE__ */ a(n, { children: f }),
18
- /* @__PURE__ */ a(e, {
19
+ /* @__PURE__ */ o(r, { children: w("client", p) }),
20
+ /* @__PURE__ */ o(t, {
19
21
  className: "connector-request-summary__untrusted",
20
- children: C(s)
22
+ children: T(c)
21
23
  }),
22
- c !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, { children: p }), /* @__PURE__ */ a(e, { children: c })] }),
23
- l !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, { children: m }), /* @__PURE__ */ a(e, {
24
+ l !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(r, { children: w("product", m) }), /* @__PURE__ */ o(t, { children: l })] }),
25
+ u !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(r, { children: w("account", h) }), /* @__PURE__ */ o(t, {
24
26
  className: "connector-request-summary__untrusted",
25
- children: C(l)
27
+ children: T(u)
26
28
  })] }),
27
- u !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, { children: h }), /* @__PURE__ */ a(e, { children: u === "read" ? _ : v })] }),
28
- d !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, { children: g }), /* @__PURE__ */ a(e, {
29
+ d !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(r, { children: w("scope", g) }), /* @__PURE__ */ o(t, { children: d === "read" ? v : y })] }),
30
+ f !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(r, { children: w("redirect", _) }), /* @__PURE__ */ o(t, {
29
31
  className: "connector-request-summary__untrusted",
30
- children: C(d)
32
+ children: T(f)
31
33
  })] })
32
34
  ]
33
35
  });
34
36
  }
35
37
  //#endregion
36
- export { s as ConnectorRequestSummary };
38
+ export { c as ConnectorRequestSummary };
@@ -1,33 +1,29 @@
1
1
  'use client';
2
- import { Button as e } from "./button.js";
3
- import { Form as t } from "./form.js";
4
- import { ConnectorAuthShell as n } from "./connector-auth-shell.js";
5
- import { t as r } from "./_shared/untrustedtext.js";
6
- import { ConnectorRequestSummary as i } from "./connector-request-summary.js";
7
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { n as e } from "./_shared/brandmessagescontext.js";
3
+ import { Button as t } from "./button.js";
4
+ import { Form as n } from "./form.js";
5
+ import { ConnectorAuthShell as r } from "./connector-auth-shell.js";
6
+ import { t as i } from "./_shared/untrustedtext.js";
7
+ import { ConnectorRequestSummary as a } from "./connector-request-summary.js";
8
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
9
  //#region src/stories/templates/ConnectorAuth/ConnectorSignInPage.tsx
9
- function c({ clientName: c, productName: l, scope: u, redirectHost: d, signInHref: f, onSignIn: p, action: m, hiddenFields: h, title: g = "Inicia sesión para continuar", intro: _ = ({ client: e, product: t }) => /* @__PURE__ */ s(a, { children: [
10
- e,
11
- " quiere conectarse a ",
12
- t,
13
- ". Identifícate para decidir si le das acceso."
14
- ] }), fallbackProductName: v = "este producto", signInLabel: y = "Iniciar sesión", scopeReadLabel: b, scopeWriteLabel: x, expandLabel: S, collapseLabel: C, valueQuotes: w, summaryLabels: T, links: E, header: D, footer: O, preferences: k, preferencesLabel: A, id: j, shell: M }) {
15
- let N = m !== void 0, P = f === void 0 ? /* @__PURE__ */ o(e, {
16
- type: N ? "submit" : "button",
10
+ function c({ clientName: c, productName: l, scope: u, redirectHost: d, signInHref: f, onSignIn: p, action: m, hiddenFields: h, title: g, intro: _, fallbackProductName: v, signInLabel: y, scopeReadLabel: b, scopeWriteLabel: x, expandLabel: S, collapseLabel: C, valueQuotes: w, summaryLabels: T, links: E, header: D, footer: O, preferences: k, preferencesLabel: A, id: j, shell: M }) {
11
+ let N = e("connectorSignIn"), P = m !== void 0, F = f === void 0 ? /* @__PURE__ */ o(t, {
12
+ type: P ? "submit" : "button",
17
13
  onClick: p,
18
- children: y
19
- }) : /* @__PURE__ */ o(e, {
14
+ children: N("signIn", y)
15
+ }) : /* @__PURE__ */ o(t, {
20
16
  href: f,
21
- children: y
17
+ children: N("signIn", y)
22
18
  });
23
- return /* @__PURE__ */ o(n, {
24
- title: g,
19
+ return /* @__PURE__ */ o(r, {
20
+ title: g ?? N("title"),
25
21
  description: _({
26
- client: /* @__PURE__ */ o("strong", { children: /* @__PURE__ */ o(r, {
22
+ client: /* @__PURE__ */ o("strong", { children: /* @__PURE__ */ o(i, {
27
23
  value: c,
28
24
  quotes: w
29
25
  }) }),
30
- product: l ?? v
26
+ product: l ?? v ?? N("fallbackProduct")
31
27
  }),
32
28
  header: D,
33
29
  footer: O,
@@ -35,18 +31,18 @@ function c({ clientName: c, productName: l, scope: u, redirectHost: d, signInHre
35
31
  preferencesLabel: A,
36
32
  id: j,
37
33
  shell: M,
38
- children: /* @__PURE__ */ s(t, {
34
+ children: /* @__PURE__ */ s(n, {
39
35
  size: "lg",
40
36
  blockActions: !0,
41
- method: N ? "post" : void 0,
37
+ method: P ? "post" : void 0,
42
38
  action: m,
43
39
  links: E,
44
- actions: P,
40
+ actions: F,
45
41
  children: [h && Object.entries(h).map(([e, t]) => /* @__PURE__ */ o("input", {
46
42
  type: "hidden",
47
43
  name: e,
48
44
  value: t
49
- }, e)), /* @__PURE__ */ o(i, {
45
+ }, e)), /* @__PURE__ */ o(a, {
50
46
  clientName: c,
51
47
  productName: l,
52
48
  scope: u,
@@ -1,95 +1,96 @@
1
1
  'use client';
2
2
  import './conversation-list.css';
3
- import { Icon as e } from "./icon.js";
4
- import { Button as t } from "./button.js";
5
- import { Skeleton as n } from "./skeleton.js";
6
- import { Tooltip as r } from "./tooltip.js";
7
- import { Alert as i } from "./alert.js";
8
- import { EmptyState as a } from "./empty-state.js";
9
- import { forwardRef as o, useState as s } from "react";
10
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Icon as t } from "./icon.js";
5
+ import { Button as n } from "./button.js";
6
+ import { Skeleton as r } from "./skeleton.js";
7
+ import { Tooltip as i } from "./tooltip.js";
8
+ import { Alert as a } from "./alert.js";
9
+ import { EmptyState as o } from "./empty-state.js";
10
+ import { forwardRef as s, useState as c } from "react";
11
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
12
  //#region src/stories/molecules/ConversationList/ConversationList.tsx
12
- function u(e) {
13
+ function d(e) {
13
14
  return e.scrollWidth > e.clientWidth + 1;
14
15
  }
15
- var d = o(function({ conversations: o, activeId: d, onNew: f, onSelect: p, onDelete: m, newLabel: h = "Nueva conversación", navLabel: g = "Conversaciones", deleteLabel: _ = (e) => `Eliminar conversación "${e}"`, isLoading: v = !1, loadingCount: y = 4, error: b, emptyMessage: x = "Todavía no hay conversaciones", errorTitle: S = "No se pudieron cargar las conversaciones", className: C, ...w }, T) {
16
- let [E, D] = s(null), O = b === void 0 ? v ? "loading" : o.length === 0 ? "empty" : "list" : "error";
17
- return /* @__PURE__ */ l("div", {
18
- ref: T,
19
- className: `conversation-list${C ? ` ${C}` : ""}`,
20
- ...w,
21
- children: [/* @__PURE__ */ c("div", {
16
+ var f = s(function({ conversations: s, activeId: f, onNew: p, onSelect: m, onDelete: h, newLabel: g, navLabel: _, deleteLabel: v, isLoading: y = !1, loadingCount: b = 4, error: x, emptyMessage: S, errorTitle: C, className: w, ...T }, E) {
17
+ let [D, O] = c(null), k = e("conversationList"), A = x === void 0 ? y ? "loading" : s.length === 0 ? "empty" : "list" : "error";
18
+ return /* @__PURE__ */ u("div", {
19
+ ref: E,
20
+ className: `conversation-list${w ? ` ${w}` : ""}`,
21
+ ...T,
22
+ children: [/* @__PURE__ */ l("div", {
22
23
  className: "conversation-list__header",
23
- children: /* @__PURE__ */ c(t, {
24
+ children: /* @__PURE__ */ l(n, {
24
25
  variant: "outline",
25
26
  block: !0,
26
- onClick: f,
27
- children: h
27
+ onClick: p,
28
+ children: k("new", g)
28
29
  })
29
- }), /* @__PURE__ */ l("nav", {
30
- "aria-label": g,
30
+ }), /* @__PURE__ */ u("nav", {
31
+ "aria-label": k("nav", _),
31
32
  className: "conversation-list__nav",
32
- "aria-busy": v || void 0,
33
+ "aria-busy": y || void 0,
33
34
  children: [
34
- O === "error" && /* @__PURE__ */ c(i, {
35
+ A === "error" && /* @__PURE__ */ l(a, {
35
36
  variant: "error",
36
- title: S,
37
- description: b,
37
+ title: k("error", C),
38
+ description: x,
38
39
  className: "conversation-list__state"
39
40
  }),
40
- O === "loading" && /* @__PURE__ */ c("div", {
41
+ A === "loading" && /* @__PURE__ */ l("div", {
41
42
  className: "conversation-list__loading",
42
- children: Array.from({ length: y }, (e, t) => /* @__PURE__ */ c(n, {}, t))
43
+ children: Array.from({ length: b }, (e, t) => /* @__PURE__ */ l(r, {}, t))
43
44
  }),
44
- O === "empty" && /* @__PURE__ */ c(a, {
45
+ A === "empty" && /* @__PURE__ */ l(o, {
45
46
  size: "sm",
46
- title: x,
47
+ title: k("empty", S),
47
48
  className: "conversation-list__state"
48
49
  }),
49
- O === "list" && /* @__PURE__ */ c("ul", {
50
+ A === "list" && /* @__PURE__ */ l("ul", {
50
51
  className: "conversation-list__items",
51
52
  role: "list",
52
- children: o.map((n) => {
53
- let i = n.id === d;
54
- return /* @__PURE__ */ l("li", {
53
+ children: s.map((e) => {
54
+ let r = e.id === f;
55
+ return /* @__PURE__ */ u("li", {
55
56
  className: "conversation-list__item",
56
- children: [/* @__PURE__ */ c(r, {
57
- label: n.label,
57
+ children: [/* @__PURE__ */ l(i, {
58
+ label: e.label,
58
59
  describe: !1,
59
- open: E === n.id,
60
+ open: D === e.id,
60
61
  onOpenChange: (e) => {
61
- e || D(null);
62
+ e || O(null);
62
63
  },
63
- onPointerEnter: (e) => {
64
- u(e.currentTarget) && D(n.id);
64
+ onPointerEnter: (t) => {
65
+ d(t.currentTarget) && O(e.id);
65
66
  },
66
- onPointerLeave: () => D(null),
67
- onFocus: (e) => {
68
- u(e.currentTarget) && D(n.id);
67
+ onPointerLeave: () => O(null),
68
+ onFocus: (t) => {
69
+ d(t.currentTarget) && O(e.id);
69
70
  },
70
- onBlur: () => D(null),
71
- children: /* @__PURE__ */ c("button", {
71
+ onBlur: () => O(null),
72
+ children: /* @__PURE__ */ l("button", {
72
73
  type: "button",
73
- className: `conversation-list__label${i ? " conversation-list__label--active" : ""}`,
74
- "aria-current": i ? "page" : void 0,
75
- onClick: () => p(n.id),
76
- children: n.label
74
+ className: `conversation-list__label${r ? " conversation-list__label--active" : ""}`,
75
+ "aria-current": r ? "page" : void 0,
76
+ onClick: () => m(e.id),
77
+ children: e.label
77
78
  })
78
- }), /* @__PURE__ */ c(t, {
79
+ }), /* @__PURE__ */ l(n, {
79
80
  variant: "ghost",
80
81
  size: "sm",
81
82
  iconOnly: !0,
82
- "aria-label": _(n.label),
83
+ "aria-label": k("delete", v)(e.label),
83
84
  className: "conversation-list__delete",
84
- onClick: (e) => {
85
- e.stopPropagation(), m(n.id);
85
+ onClick: (t) => {
86
+ t.stopPropagation(), h(e.id);
86
87
  },
87
- children: /* @__PURE__ */ c(e, {
88
+ children: /* @__PURE__ */ l(t, {
88
89
  name: "close",
89
90
  size: "sm"
90
91
  })
91
92
  })]
92
- }, n.id);
93
+ }, e.id);
93
94
  })
94
95
  })
95
96
  ]
@@ -97,4 +98,4 @@ var d = o(function({ conversations: o, activeId: d, onNew: f, onSelect: p, onDel
97
98
  });
98
99
  });
99
100
  //#endregion
100
- export { d as ConversationList };
101
+ export { f as ConversationList };
@@ -1,42 +1,44 @@
1
1
  'use client';
2
2
  import './conversation-thread.css';
3
- import { UserMessage as e } from "./user-message.js";
4
- import { AssistantMessage as t } from "./assistant-message.js";
5
- import { forwardRef as n, useEffect as r, useRef as i } from "react";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { UserMessage as t } from "./user-message.js";
5
+ import { AssistantMessage as n } from "./assistant-message.js";
6
+ import { forwardRef as r, useEffect as i, useRef as a } from "react";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
8
  //#region src/stories/organisms/ConversationThread/ConversationThread.tsx
8
- function s() {
9
+ function c() {
9
10
  return typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
10
11
  }
11
- var c = n(function({ messages: n = [], children: c, streamingLabel: l, ariaLabel: u = "Conversación", locale: d, timestampFormat: f, className: p, ...m }, h) {
12
- let g = i(null);
13
- return r(() => {
14
- g.current?.scrollIntoView({ behavior: s() });
15
- }, [n, c]), /* @__PURE__ */ o("div", {
16
- ref: h,
17
- className: `conversation-thread${p ? ` ${p}` : ""}`,
12
+ var l = r(function({ messages: r = [], children: l, streamingName: u, streamingLabel: d, ariaLabel: f, locale: p, timestampFormat: m, className: h, ...g }, _) {
13
+ let v = a(null), y = e("conversationThread");
14
+ return i(() => {
15
+ v.current?.scrollIntoView({ behavior: c() });
16
+ }, [r, l]), /* @__PURE__ */ s("div", {
17
+ ref: _,
18
+ className: `conversation-thread${h ? ` ${h}` : ""}`,
18
19
  role: "log",
19
- "aria-label": u,
20
- "data-content": c == null ? "messages" : "children",
21
- ...m,
22
- children: [c ?? n.map((n) => n.role === "user" ? /* @__PURE__ */ a(e, {
23
- timestamp: n.timestamp,
24
- locale: d,
25
- timestampFormat: f,
26
- children: n.content
27
- }, n.id) : /* @__PURE__ */ a(t, {
28
- model: n.model,
29
- timestamp: n.timestamp,
30
- locale: d,
31
- timestampFormat: f,
32
- isStreaming: n.isStreaming,
33
- streamingLabel: l,
34
- children: n.content
35
- }, n.id)), /* @__PURE__ */ a("div", {
36
- ref: g,
20
+ "aria-label": y("label", f),
21
+ "data-content": l == null ? "messages" : "children",
22
+ ...g,
23
+ children: [l ?? r.map((e) => e.role === "user" ? /* @__PURE__ */ o(t, {
24
+ timestamp: e.timestamp,
25
+ locale: p,
26
+ timestampFormat: m,
27
+ children: e.content
28
+ }, e.id) : /* @__PURE__ */ o(n, {
29
+ model: e.model,
30
+ timestamp: e.timestamp,
31
+ locale: p,
32
+ timestampFormat: m,
33
+ isStreaming: e.isStreaming,
34
+ streamingName: u,
35
+ streamingLabel: d,
36
+ children: e.content
37
+ }, e.id)), /* @__PURE__ */ o("div", {
38
+ ref: v,
37
39
  "aria-hidden": "true"
38
40
  })]
39
41
  });
40
42
  });
41
43
  //#endregion
42
- export { c as ConversationThread };
44
+ export { l as ConversationThread };
@@ -1,57 +1,58 @@
1
1
  'use client';
2
2
  import './message-composer.css';
3
- import { Button as e } from "./button.js";
4
- import { Textarea as t } from "./textarea.js";
5
- import { forwardRef as n, useId as r } from "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ import { n as e } from "./_shared/brandmessagescontext.js";
4
+ import { Button as t } from "./button.js";
5
+ import { Textarea as n } from "./textarea.js";
6
+ import { forwardRef as r, useId as i } from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
8
  //#region src/stories/molecules/MessageComposer/MessageComposer.tsx
8
- var o = n(function({ value: n, onChange: o, onSend: s, placeholder: c = "Escribe un mensaje…", disabled: l, sendLabel: u = "Enviar", helperText: d, actions: f, inputId: p, inputLabel: m, inputLabelledBy: h, rows: g = 2, className: _, ...v }, y) {
9
- let b = `${r()}-helper`;
10
- function x() {
11
- n.trim() && s();
9
+ var s = r(function({ value: r, onChange: s, onSend: c, placeholder: l, disabled: u, sendLabel: d, helperText: f, actions: p, inputId: m, inputLabel: h, inputLabelledBy: g, rows: _ = 2, className: v, ...y }, b) {
10
+ let x = e("messageComposer"), S = `${i()}-helper`;
11
+ function C() {
12
+ r.trim() && c();
12
13
  }
13
- function S(e) {
14
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), x());
14
+ function w(e) {
15
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), C());
15
16
  }
16
- return /* @__PURE__ */ a("div", {
17
- ref: y,
17
+ return /* @__PURE__ */ o("div", {
18
+ ref: b,
18
19
  className: [
19
20
  "message-composer",
20
- l ? "message-composer--disabled" : "",
21
- _ ?? ""
21
+ u ? "message-composer--disabled" : "",
22
+ v ?? ""
22
23
  ].filter(Boolean).join(" "),
23
- ...v,
24
- children: [/* @__PURE__ */ a("div", {
24
+ ...y,
25
+ children: [/* @__PURE__ */ o("div", {
25
26
  className: "message-composer__box",
26
- children: [/* @__PURE__ */ i(t, {
27
+ children: [/* @__PURE__ */ a(n, {
27
28
  bare: !0,
28
29
  className: "message-composer__input",
29
- id: p,
30
- "aria-label": m,
31
- "aria-labelledby": h,
32
- "aria-describedby": d ? b : void 0,
33
- placeholder: c,
34
- value: n,
35
- disabled: l,
36
- rows: g,
37
- onChange: (e) => o(e.target.value),
38
- onKeyDown: S
39
- }), /* @__PURE__ */ a("div", {
30
+ id: m,
31
+ "aria-label": h,
32
+ "aria-labelledby": g,
33
+ "aria-describedby": f ? S : void 0,
34
+ placeholder: x("placeholder", l),
35
+ value: r,
36
+ disabled: u,
37
+ rows: _,
38
+ onChange: (e) => s(e.target.value),
39
+ onKeyDown: w
40
+ }), /* @__PURE__ */ o("div", {
40
41
  className: "message-composer__actions",
41
- children: [/* @__PURE__ */ i(e, {
42
+ children: [/* @__PURE__ */ a(t, {
42
43
  variant: "primary",
43
44
  size: "md",
44
- disabled: l || !n.trim(),
45
- onClick: x,
46
- children: u
47
- }), f]
45
+ disabled: u || !r.trim(),
46
+ onClick: C,
47
+ children: x("send", d)
48
+ }), p]
48
49
  })]
49
- }), d && /* @__PURE__ */ i("p", {
50
+ }), f && /* @__PURE__ */ a("p", {
50
51
  className: "message-composer__helper",
51
- id: b,
52
- children: d
52
+ id: S,
53
+ children: f
53
54
  })]
54
55
  });
55
56
  });
56
57
  //#endregion
57
- export { o as MessageComposer };
58
+ export { s as MessageComposer };
@@ -1,27 +1,30 @@
1
+ 'use client';
1
2
  import './typing-indicator.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/TypingIndicator/TypingIndicator.tsx
5
- function r({ label: r = "El asistente está escribiendo…" }) {
6
- return /* @__PURE__ */ n("span", {
7
+ function i({ name: i, label: a }) {
8
+ let o = e("typingIndicator");
9
+ return /* @__PURE__ */ r("span", {
7
10
  className: "typing-indicator",
8
11
  role: "status",
9
12
  children: [
10
- /* @__PURE__ */ t("span", {
13
+ /* @__PURE__ */ n("span", {
11
14
  className: "typing-indicator__dot",
12
15
  "aria-hidden": "true"
13
16
  }),
14
- /* @__PURE__ */ t("span", {
17
+ /* @__PURE__ */ n("span", {
15
18
  className: "typing-indicator__dot",
16
19
  "aria-hidden": "true"
17
20
  }),
18
- /* @__PURE__ */ t("span", {
21
+ /* @__PURE__ */ n("span", {
19
22
  className: "typing-indicator__dot",
20
23
  "aria-hidden": "true"
21
24
  }),
22
- /* @__PURE__ */ t(e, { children: r })
25
+ /* @__PURE__ */ n(t, { children: a ?? o("typing")(i) })
23
26
  ]
24
27
  });
25
28
  }
26
29
  //#endregion
27
- export { r as TypingIndicator };
30
+ export { i as TypingIndicator };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiolxd/brand",
3
- "version": "48.1.0",
3
+ "version": "49.0.0",
4
4
  "description": "El sistema de diseño de Studio LXD: componentes React, tokens y documentación de la suite SLXD.",
5
5
  "repository": {
6
6
  "type": "git",