@studiolxd/brand 38.16.0 → 39.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.
package/dist/card.js CHANGED
@@ -24,8 +24,7 @@ var l = s(function({ href: r, render: s, external: l = !1, title: u, description
24
24
  }),
25
25
  d && (typeof d == "string" ? /* @__PURE__ */ a("p", { children: d }) : d),
26
26
  y,
27
- f !== void 0 && /* @__PURE__ */ a(e, { children: f }),
28
- /* @__PURE__ */ a(t, { size: "lg" })
27
+ f !== void 0 && /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, { children: f }), /* @__PURE__ */ a(t, { size: "lg" })] })
29
28
  ] }), w = h && /* @__PURE__ */ a("div", {
30
29
  className: "card__media",
31
30
  children: /* @__PURE__ */ a("img", {
@@ -1 +1 @@
1
- .chat-shell{background-color:var(--chat-shell-bg);flex-direction:column;block-size:100%;min-block-size:0;display:flex;position:relative}.chat-shell .chat-shell__drawer,.chat-shell .sheet__overlay{position:absolute}.chat-shell .chat-shell__drawer{--sheet-inline-size:100%}.chat-shell__list{inline-size:var(--chat-shell-list-width);flex-shrink:0;block-size:100%;overflow-y:auto}.chat-shell.chat-shell--with-list{gap:var(--chat-shell-gap);flex-direction:row}.chat-shell__main{flex-direction:column;flex:1;min-block-size:0;display:flex}.chat-shell__header{justify-content:space-between;align-items:center;gap:var(--chat-shell-header-gap);flex-shrink:0;display:flex}.chat-shell__list-trigger{flex-shrink:0}.chat-shell__header-content{justify-content:space-between;align-items:center;gap:var(--chat-shell-header-gap);flex:1;min-inline-size:0;display:flex}.chat-shell__thread{--conversation-thread-padding-inline:var(--chat-shell-thread-padding-inline);min-block-size:0;padding-block:var(--chat-shell-thread-padding-block);flex-direction:column;flex:1;display:flex;overflow-y:auto}.chat-shell__composer{flex-shrink:0}
1
+ .chat-shell{background-color:var(--chat-shell-bg);flex-direction:column;block-size:100%;min-block-size:0;display:flex;position:relative}.chat-shell .chat-shell__drawer,.chat-shell .sheet__overlay{position:absolute}.chat-shell .chat-shell__drawer{--sheet-inline-size:100%;--sheet-padding-block:0;--sheet-padding-inline:0;--sheet-gap:0;overflow:visible}.chat-shell__drawer .sheet__body{gap:var(--chat-shell-drawer-gap);flex-direction:column;min-block-size:0;display:flex}.chat-shell__drawer-list{flex:1;min-block-size:0;overflow-y:auto}.chat-shell__list{inline-size:var(--chat-shell-list-width);flex-shrink:0;block-size:100%;overflow-y:auto}.chat-shell.chat-shell--with-list{gap:var(--chat-shell-gap);flex-direction:row}.chat-shell__main{flex-direction:column;flex:1;min-block-size:0;display:flex}.chat-shell__header{justify-content:space-between;align-items:center;gap:var(--chat-shell-header-gap);flex-shrink:0;display:flex}.chat-shell__list-trigger{flex-shrink:0;align-self:flex-start}.chat-shell__header-content{justify-content:space-between;align-items:center;gap:var(--chat-shell-header-gap);flex:1;min-inline-size:0;display:flex}.chat-shell__thread{--conversation-thread-padding-inline:var(--chat-shell-thread-padding-inline);min-block-size:0;padding-block:var(--chat-shell-thread-padding-block);flex-direction:column;flex:1;display:flex;overflow-y:auto}.chat-shell__composer{flex-shrink:0}
@@ -75,19 +75,25 @@ var l = "(min-width: 1024px)", u = a(function({ list: a, header: u, children: d,
75
75
  container: w ?? void 0,
76
76
  hideClose: !0,
77
77
  className: "chat-shell__drawer",
78
- children: [/* @__PURE__ */ r(t, {
79
- variant: "ghost",
80
- size: "sm",
81
- iconOnly: !0,
82
- "aria-label": m,
83
- "aria-expanded": !0,
84
- className: "chat-shell__list-trigger",
85
- onClick: () => D(!1),
86
- children: /* @__PURE__ */ r(e, {
87
- name: "layout-sidebar",
88
- size: "sm"
78
+ children: [/* @__PURE__ */ r("header", {
79
+ className: "chat-shell__header",
80
+ children: /* @__PURE__ */ r(t, {
81
+ variant: "ghost",
82
+ size: "sm",
83
+ iconOnly: !0,
84
+ "aria-label": m,
85
+ "aria-expanded": !0,
86
+ className: "chat-shell__list-trigger",
87
+ onClick: () => D(!1),
88
+ children: /* @__PURE__ */ r(e, {
89
+ name: "layout-sidebar",
90
+ size: "sm"
91
+ })
89
92
  })
90
- }), a]
93
+ }), /* @__PURE__ */ r("div", {
94
+ className: "chat-shell__drawer-list",
95
+ children: a
96
+ })]
91
97
  })
92
98
  ]
93
99
  });
@@ -1 +1 @@
1
- .confirm-dialog__actions.modal__footer{margin-block-start:var(--confirm-dialog-actions-space-before)}
1
+ .confirm-dialog__actions.modal__footer{margin-block-start:var(--confirm-dialog-actions-space-before)}.confirm-dialog__phrase{margin-block-start:var(--confirm-dialog-phrase-space-before)}
@@ -2,63 +2,86 @@
2
2
  import './confirm-dialog.css';
3
3
  import { Button as e } from "./button.js";
4
4
  import { Modal as t } from "./modal.js";
5
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { useEffect as a, useRef as o, useState as s } from "react";
5
+ import { InputField as n } from "./input-field.js";
6
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
7
8
  //#region src/stories/molecules/ConfirmDialog/ConfirmDialog.tsx
8
- function c({ open: c, title: l, description: u, children: d, onConfirm: f, onCancel: p, onConfirmError: m, secondaryActionLabel: h, onSecondaryAction: g, destructive: _ = !1, confirmLabel: v = "Confirmar", cancelLabel: y = "Cancelar", pendingLabel: b = "Confirmando…", closeLabel: x = "Cerrar", container: S, className: C }) {
9
- let w = o(null), [T, E] = s(!1);
10
- a(() => {
11
- c || E(!1);
12
- }, [c]);
13
- let D = () => {
14
- T || p();
15
- }, O = async () => {
16
- if (T) return;
17
- let e = f();
9
+ function u({ open: u, title: d, description: f, children: p, onConfirm: m, onCancel: h, onConfirmError: g, secondaryActionLabel: _, onSecondaryAction: v, destructive: y = !1, confirmLabel: b = "Confirmar", cancelLabel: x = "Cancelar", pendingLabel: S = "Confirmando…", closeLabel: C = "Cerrar", confirmPhrase: w, confirmPhraseLabel: T, confirmPhraseMismatch: E, container: D, className: O }) {
10
+ let k = c(null), A = c(null), j = s(), [M, N] = l(!1), [P, F] = l(""), [I, L] = l(!1), R = w === void 0 || P.trim() === w, z = I && !R;
11
+ o(() => {
12
+ u || (N(!1), F(""), L(!1));
13
+ }, [u]);
14
+ let B = () => {
15
+ M || h();
16
+ }, V = async () => {
17
+ if (M || !R) return;
18
+ let e = m();
18
19
  if (e instanceof Promise) {
19
- E(!0);
20
+ N(!0);
20
21
  try {
21
22
  await e;
22
23
  } catch (e) {
23
- m?.(e);
24
+ g?.(e);
24
25
  } finally {
25
- E(!1);
26
+ N(!1);
26
27
  }
27
28
  }
28
29
  };
29
- return /* @__PURE__ */ r(t, {
30
- open: c,
31
- onClose: D,
32
- title: l,
33
- closeLabel: x,
34
- container: S,
35
- initialFocus: w,
36
- ...u == null ? {} : { description: u },
37
- footerClassName: ["confirm-dialog__actions", C].filter(Boolean).join(" "),
38
- footer: /* @__PURE__ */ i(n, { children: [
39
- /* @__PURE__ */ r(e, {
40
- ref: w,
30
+ return /* @__PURE__ */ a(t, {
31
+ open: u,
32
+ onClose: B,
33
+ title: d,
34
+ closeLabel: C,
35
+ container: D,
36
+ initialFocus: w === void 0 ? k : A,
37
+ ...f == null ? {} : { description: f },
38
+ footerClassName: ["confirm-dialog__actions", O].filter(Boolean).join(" "),
39
+ footer: /* @__PURE__ */ a(r, { children: [
40
+ /* @__PURE__ */ i(e, {
41
+ ref: k,
41
42
  variant: "outline",
42
- onClick: D,
43
- disabled: T,
44
- children: y
43
+ onClick: B,
44
+ disabled: M,
45
+ children: x
45
46
  }),
46
- h && g && /* @__PURE__ */ r(e, {
47
+ _ && v && /* @__PURE__ */ i(e, {
47
48
  variant: "outline",
48
- onClick: g,
49
- disabled: T,
50
- children: h
49
+ onClick: v,
50
+ disabled: M,
51
+ children: _
51
52
  }),
52
- /* @__PURE__ */ r(e, {
53
- variant: _ ? "outline" : "primary",
54
- destructive: _,
55
- onClick: O,
56
- disabled: T,
57
- children: T ? b : v
53
+ /* @__PURE__ */ i(e, {
54
+ variant: y ? "outline" : "primary",
55
+ destructive: y,
56
+ onClick: V,
57
+ disabled: M || !R,
58
+ children: M ? S : b
58
59
  })
59
60
  ] }),
60
- children: d
61
+ children: [p, w !== void 0 && /* @__PURE__ */ i(n, {
62
+ ref: A,
63
+ id: `${j}-confirm-phrase`,
64
+ className: "confirm-dialog__phrase",
65
+ label: T ?? "",
66
+ value: P,
67
+ disabled: M,
68
+ autoComplete: "off",
69
+ autoCorrect: "off",
70
+ autoCapitalize: "none",
71
+ spellCheck: !1,
72
+ error: z,
73
+ ...z ? { errorMessage: E } : {},
74
+ onChange: (e) => {
75
+ F(e.target.value), L(!1);
76
+ },
77
+ onBlur: () => {
78
+ P !== "" && L(!0);
79
+ },
80
+ onKeyDown: (e) => {
81
+ e.key === "Enter" && (e.preventDefault(), R ? V() : P !== "" && L(!0));
82
+ }
83
+ })]
61
84
  });
62
85
  }
63
86
  //#endregion
64
- export { c as ConfirmDialog };
87
+ export { u as ConfirmDialog };
@@ -1 +1 @@
1
- .star-rating{align-items:center;gap:var(--star-rating-gap);color:var(--star-rating-track-color);display:inline-flex}.star-rating__star{display:inline-flex;position:relative}.star-rating__glyph{--icon-size:var(--star-rating-star-size)}.star-rating__glyph--fill{color:var(--star-rating-fill-color);fill:var(--star-rating-fill-color);transition:color var(--star-rating-transition-duration) var(--star-rating-transition-easing);position:absolute;inset-block-start:0;inset-inline-start:0}.star-rating__glyph--half{clip-path:inset(0 50% 0 0)}[dir=rtl] .star-rating__glyph--half{clip-path:inset(0 0 0 50%)}.star-rating__option{cursor:var(--star-rating-cursor);display:inline-flex}.star-rating__input:focus-visible+.star-rating__star{outline:var(--star-rating-focus-ring-width) solid var(--star-rating-focus-ring-color);outline-offset:var(--star-rating-focus-ring-offset)}.star-rating__input:disabled+.star-rating__star{opacity:var(--star-rating-disabled-opacity)}.star-rating__option:has(.star-rating__input:disabled){cursor:var(--star-rating-disabled-cursor)}.star-rating.star-rating--sm{--star-rating-star-size:var(--star-rating-sm-star-size)}.star-rating.star-rating--lg{--star-rating-star-size:var(--star-rating-lg-star-size)}
1
+ .star-rating{align-items:center;gap:var(--star-rating-count-gap);color:var(--star-rating-track-color);display:inline-flex}.star-rating__stars{align-items:center;gap:var(--star-rating-gap);display:inline-flex}.star-rating__count{color:var(--star-rating-count-color)}.star-rating__empty{color:var(--star-rating-empty-color)}.star-rating__star{display:inline-flex;position:relative}.star-rating__glyph{--icon-size:var(--star-rating-star-size)}.star-rating__glyph--fill{color:var(--star-rating-fill-color);fill:var(--star-rating-fill-color);transition:color var(--star-rating-transition-duration) var(--star-rating-transition-easing);position:absolute;inset-block-start:0;inset-inline-start:0}.star-rating__glyph--half{clip-path:inset(0 50% 0 0)}[dir=rtl] .star-rating__glyph--half{clip-path:inset(0 0 0 50%)}.star-rating.star-rating--input{gap:var(--star-rating-gap)}.star-rating__option{cursor:var(--star-rating-cursor);display:inline-flex}.star-rating__input:focus-visible+.star-rating__star{outline:var(--star-rating-focus-ring-width) solid var(--star-rating-focus-ring-color);outline-offset:var(--star-rating-focus-ring-offset)}.star-rating__input:disabled+.star-rating__star{opacity:var(--star-rating-disabled-opacity)}.star-rating__option:has(.star-rating__input:disabled){cursor:var(--star-rating-disabled-cursor)}.star-rating.star-rating--sm{--star-rating-star-size:var(--star-rating-sm-star-size)}.star-rating.star-rating--lg{--star-rating-star-size:var(--star-rating-lg-star-size)}
@@ -23,54 +23,68 @@ function c({ fill: t }) {
23
23
  })]
24
24
  });
25
25
  }
26
- function l({ value: e, defaultValue: l, onValueChange: u, max: d = 5, readOnly: f = !0, disabled: p = !1, size: m = "md", name: h, locale: g = "es-ES", valueLabel: _ = (e, t) => `${e.toLocaleString(g)} de ${t} estrellas`, optionLabel: v = (e, t) => `${e.toLocaleString(g)} de ${t} estrellas`, groupLabel: y = "Valoración", className: b, ...x }) {
27
- let S = i(), [C, w] = a(l), [T, E] = a(void 0), D = e !== void 0, O = (D ? e : C) ?? 0, k = [
26
+ function l(e) {
27
+ let { value: l, defaultValue: u, onValueChange: d, max: f = 5, reviewCount: p, readOnly: m = !0, disabled: h = !1, size: g = "md", name: _, valueLabel: v, optionLabel: y, groupLabel: b, countLabel: x, emptyLabel: S, className: C, ...w } = e, T = i(), [E, D] = a(u), [O, k] = a(void 0), A = l !== void 0, j = (A ? l : E) ?? 0, M = [
28
28
  "star-rating",
29
- m === "md" ? "" : `star-rating--${m}`,
30
- f ? "" : "star-rating--input",
31
- b ?? ""
32
- ].filter(Boolean).join(" "), A = Array.from({ length: d }, (e, t) => t);
33
- if (f) {
34
- let e = o(O, d);
35
- return /* @__PURE__ */ n("div", {
36
- className: k,
29
+ g === "md" ? "" : `star-rating--${g}`,
30
+ m ? "" : "star-rating--input",
31
+ C ?? ""
32
+ ].filter(Boolean).join(" "), N = Array.from({ length: f }, (e, t) => t);
33
+ if (m) {
34
+ if (l === null) return /* @__PURE__ */ n("div", {
35
+ className: M,
36
+ ...w,
37
+ children: /* @__PURE__ */ n("span", {
38
+ className: "star-rating__empty",
39
+ children: S ?? ""
40
+ })
41
+ });
42
+ let e = o(j, f);
43
+ return /* @__PURE__ */ r("div", {
44
+ className: M,
37
45
  role: "img",
38
- "aria-label": _(e, d),
39
- ...x,
40
- children: A.map((t) => /* @__PURE__ */ n(c, { fill: s(t, e) }, t))
46
+ "aria-label": v?.(e, f, p) ?? "",
47
+ ...w,
48
+ children: [/* @__PURE__ */ n("span", {
49
+ className: "star-rating__stars",
50
+ children: N.map((t) => /* @__PURE__ */ n(c, { fill: s(t, e) }, t))
51
+ }), p !== void 0 && /* @__PURE__ */ n("span", {
52
+ className: "star-rating__count",
53
+ children: x?.(p) ?? ""
54
+ })]
41
55
  });
42
56
  }
43
- function j(e) {
44
- D || w(e), u?.(e);
57
+ function P(e) {
58
+ A || D(e), d?.(e);
45
59
  }
46
- let M = T ?? Math.round(O);
60
+ let F = O ?? Math.round(j);
47
61
  return /* @__PURE__ */ n("div", {
48
- className: k,
62
+ className: M,
49
63
  role: "radiogroup",
50
- "aria-label": y,
51
- onPointerLeave: () => E(void 0),
52
- ...x,
53
- children: A.map((e) => {
64
+ "aria-label": b ?? "",
65
+ onPointerLeave: () => k(void 0),
66
+ ...w,
67
+ children: N.map((e) => {
54
68
  let i = e + 1;
55
69
  return /* @__PURE__ */ r("label", {
56
70
  className: "star-rating__option",
57
71
  onPointerEnter: () => {
58
- p || E(i);
72
+ h || k(i);
59
73
  },
60
74
  children: [
61
75
  /* @__PURE__ */ n("input", {
62
76
  className: "star-rating__input visually-hidden",
63
77
  type: "radio",
64
- name: h ?? S,
78
+ name: _ ?? T,
65
79
  value: i,
66
- checked: Math.round(O) === i,
67
- disabled: p,
68
- onChange: () => j(i),
69
- onFocus: () => E(i),
70
- onBlur: () => E(void 0)
80
+ checked: Math.round(j) === i,
81
+ disabled: h,
82
+ onChange: () => P(i),
83
+ onFocus: () => k(i),
84
+ onBlur: () => k(void 0)
71
85
  }),
72
- /* @__PURE__ */ n(c, { fill: i <= M ? "full" : "empty" }),
73
- /* @__PURE__ */ n(t, { children: v(i, d) })
86
+ /* @__PURE__ */ n(c, { fill: i <= F ? "full" : "empty" }),
87
+ /* @__PURE__ */ n(t, { children: y?.(i, f) ?? "" })
74
88
  ]
75
89
  }, i);
76
90
  })