@studiolxd/brand 49.18.0 → 49.19.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/list.css CHANGED
@@ -1 +1 @@
1
- .list{font-family:var(--text-list-font-family);font-size:var(--text-list-font-size);font-weight:var(--text-list-font-weight);line-height:var(--text-list-line-height);color:var(--text-list-color);letter-spacing:var(--text-list-letter-spacing);margin-block:0;margin-inline:0;padding-inline-start:var(--text-list-padding-inline-start)}.list>li+li,.list>.list__item+.list__item{margin-block-start:var(--text-list-gap)}.list.list--unordered{list-style-type:disc}.list.list--ordered{list-style-type:decimal}.list.list--plain{padding-inline-start:0;list-style-type:none}
1
+ .list{font-family:var(--text-list-font-family);font-size:var(--text-list-font-size);font-weight:var(--text-list-font-weight);line-height:var(--text-list-line-height);color:var(--text-list-color);letter-spacing:var(--text-list-letter-spacing);margin-block:0;margin-inline:0;padding-inline-start:var(--text-list-padding-inline-start)}.list>li+li,.list>.list__item+.list__item{margin-block-start:var(--text-list-gap)}.list.list--unordered{list-style-type:disc}.list.list--ordered{list-style-type:decimal}.list.list--plain{padding-inline-start:0;list-style-type:none}.list.list--separated>li+li,.list.list--separated>.list__item+.list__item{border-block-start:var(--text-list-separator-thickness) solid var(--text-list-separator-color);margin-block-start:var(--text-list-separator-spacing);padding-block-start:var(--text-list-separator-spacing)}.list__item-row{align-items:center;column-gap:var(--text-list-item-gap);display:flex}.list__item-main{flex:auto;min-inline-size:0}.list__item-secondary{font-size:var(--text-list-secondary-font-size);line-height:var(--text-list-secondary-line-height);color:var(--text-list-secondary-color)}.list__item-leading,.list__item-trailing{flex:none;align-items:center;display:flex}
package/dist/list.js CHANGED
@@ -1,25 +1,51 @@
1
1
  import './list.css';
2
2
  import { forwardRef as e } from "react";
3
- import { jsx as t } from "react/jsx-runtime";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  //#region src/stories/atoms/List/List.tsx
5
- var n = e(function({ type: e = "unordered", className: n, children: r, ...i }, a) {
5
+ var r = e(function({ type: e = "unordered", showSeparators: n = !1, className: r, children: i, ...a }, o) {
6
6
  return /* @__PURE__ */ t(e === "ordered" ? "ol" : "ul", {
7
- ref: a,
7
+ ref: o,
8
8
  className: [
9
9
  "list",
10
10
  `list--${e}`,
11
- n ?? ""
11
+ n ? "list--separated" : "",
12
+ r ?? ""
12
13
  ].filter(Boolean).join(" "),
13
- ...i,
14
- children: r
14
+ ...a,
15
+ children: i
15
16
  });
16
- }), r = e(function({ as: e = "li", className: n, children: r, ...i }, a) {
17
- return /* @__PURE__ */ t(e, {
18
- ref: a,
19
- className: ["list__item", n ?? ""].filter(Boolean).join(" "),
20
- ...i,
21
- children: r
17
+ }), i = e(function({ as: e = "li", leading: r, secondary: i, trailing: a, className: o, children: s, ...c }, l) {
18
+ let u = ["list__item", o ?? ""].filter(Boolean).join(" "), d = i != null && i !== !1, f = r != null && r !== !1, p = a != null && a !== !1;
19
+ return !d && !p && !f ? /* @__PURE__ */ t(e, {
20
+ ref: l,
21
+ className: u,
22
+ ...c,
23
+ children: s
24
+ }) : /* @__PURE__ */ t(e, {
25
+ ref: l,
26
+ className: u,
27
+ ...c,
28
+ children: /* @__PURE__ */ n("div", {
29
+ className: "list__item-row",
30
+ children: [
31
+ f && /* @__PURE__ */ t("div", {
32
+ className: "list__item-leading",
33
+ children: r
34
+ }),
35
+ /* @__PURE__ */ n("div", {
36
+ className: "list__item-main",
37
+ children: [s, d && /* @__PURE__ */ t("div", {
38
+ className: "list__item-secondary",
39
+ children: i
40
+ })]
41
+ }),
42
+ p && /* @__PURE__ */ t("div", {
43
+ className: "list__item-trailing",
44
+ children: a
45
+ })
46
+ ]
47
+ })
22
48
  });
23
49
  });
24
50
  //#endregion
25
- export { n as List, r as ListItem };
51
+ export { r as List, i as ListItem };
@@ -8,21 +8,21 @@ import { n as i } from "./_shared/field-labels.js";
8
8
  import { forwardRef as a, useId as o } from "react";
9
9
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
10
  //#region src/stories/molecules/NumberInputField/NumberInputField.tsx
11
- var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f, min: p, max: m, step: h = 1, decimal: g, disabled: _, readOnly: v, size: y, error: b = !1, errorMessage: x, helperText: S, className: C, onChange: w, ...T }, E) {
12
- let D = i(u), O = e(y), k = o(), A = a ?? k, j = x ? `${A}-error` : void 0, M = S ? `${A}-helper` : void 0, N = [j, M].filter(Boolean).join(" ") || void 0, P = b || !!x;
11
+ var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f, min: p, max: m, step: h = 1, decimal: g, disabled: _, readOnly: v, size: y, error: b = !1, errorMessage: x, helperText: S, className: C, onChange: w, onEmpty: T, ...E }, D) {
12
+ let O = i(u), k = e(y), A = o(), j = a ?? A, M = x ? `${j}-error` : void 0, N = S ? `${j}-helper` : void 0, P = [M, N].filter(Boolean).join(" ") || void 0, F = b || !!x;
13
13
  return /* @__PURE__ */ c("div", {
14
14
  className: ["number-input-field", C].filter(Boolean).join(" "),
15
15
  children: [
16
16
  /* @__PURE__ */ s(n, {
17
- htmlFor: A,
18
- hidden: D,
19
- size: O,
17
+ htmlFor: j,
18
+ hidden: O,
19
+ size: k,
20
20
  children: l
21
21
  }),
22
22
  /* @__PURE__ */ s(r, {
23
- ref: E,
24
- ...T,
25
- id: A,
23
+ ref: D,
24
+ ...E,
25
+ id: j,
26
26
  value: d,
27
27
  defaultValue: f,
28
28
  min: p,
@@ -31,17 +31,18 @@ var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f,
31
31
  decimal: g,
32
32
  disabled: _,
33
33
  readOnly: v,
34
- size: O,
35
- error: P,
36
- "aria-describedby": N,
37
- onChange: w
34
+ size: k,
35
+ error: F,
36
+ "aria-describedby": P,
37
+ onChange: w,
38
+ onEmpty: T
38
39
  }),
39
40
  x && /* @__PURE__ */ s(t, {
40
- id: j,
41
+ id: M,
41
42
  children: x
42
43
  }),
43
44
  S && /* @__PURE__ */ s("span", {
44
- id: M,
45
+ id: N,
45
46
  className: "number-input-field__helper",
46
47
  children: S
47
48
  })
@@ -5,47 +5,47 @@ import { Icon as t } from "./icon.js";
5
5
  import { forwardRef as n, useCallback as r, useState as i } from "react";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  //#region src/stories/atoms/NumberInput/NumberInput.tsx
8
- var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1, decimal: d = !1, disabled: f = !1, readOnly: p = !1, size: m = "md", error: h = !1, id: g, name: _, describedBy: v, ariaLabel: y, decrementLabel: b, incrementLabel: x, className: S, onChange: C, onBlur: w, onFocus: T, ...E }, D) {
9
- let O = e("numberInput"), k = n !== void 0, [A, j] = i(s), [M, N] = i(!1), [P, F] = i(null), I = k ? n : A, L = P === null ? String(I) : P, R = r((e) => {
8
+ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1, decimal: d = !1, disabled: f = !1, readOnly: p = !1, size: m = "md", error: h = !1, id: g, name: _, describedBy: v, ariaLabel: y, decrementLabel: b, incrementLabel: x, className: S, onChange: C, onEmpty: w, onBlur: T, onFocus: E, ...D }, O) {
9
+ let k = e("numberInput"), A = n !== void 0, [j, M] = i(s), [N, P] = i(!1), [F, I] = i(null), L = A ? n : j, R = F === null ? L === null ? "" : String(L) : F, z = L ?? 0, B = r((e) => {
10
10
  let t = e;
11
11
  return c !== void 0 && (t = Math.max(c, t)), l !== void 0 && (t = Math.min(l, t)), t;
12
- }, [c, l]), z = r((e) => {
13
- let t = R(e);
14
- k || j(t), C?.(t);
12
+ }, [c, l]), V = r((e) => {
13
+ let t = B(e);
14
+ A || M(t), C?.(t);
15
15
  }, [
16
- R,
17
- k,
16
+ B,
17
+ A,
18
18
  C
19
- ]), B = () => {
20
- f || p || (F(null), z(I - u));
21
- }, V = () => {
22
- f || p || (F(null), z(I + u));
23
- }, H = (e) => {
19
+ ]), H = () => {
20
+ f || p || (I(null), V(z - u));
21
+ }, U = () => {
22
+ f || p || (I(null), V(z + u));
23
+ }, W = (e) => {
24
24
  let t = e.target.value;
25
- F(t);
25
+ I(t);
26
26
  let n = d ? t.replace(",", ".") : t, r = parseFloat(n);
27
- isNaN(r) || z(r);
28
- }, U = (e) => {
29
- N(!0), T?.(e);
30
- }, W = (e) => {
31
- N(!1), F(null), w?.(e);
32
- }, G = [
27
+ isNaN(r) ? w && t.trim() === "" && (A || M(null), w()) : V(r);
28
+ }, G = (e) => {
29
+ P(!0), E?.(e);
30
+ }, K = (e) => {
31
+ P(!1), I(null), T?.(e);
32
+ }, q = [
33
33
  "number-input",
34
34
  m === "md" ? "" : `number-input--${m}`,
35
35
  h ? "number-input--error" : "",
36
36
  f ? "number-input--disabled" : "",
37
- M ? "number-input--focused" : "",
37
+ N ? "number-input--focused" : "",
38
38
  S ?? ""
39
- ].filter(Boolean).join(" "), K = f || p || c !== void 0 && I <= c, q = f || p || l !== void 0 && I >= l;
39
+ ].filter(Boolean).join(" "), J = f || p || L !== null && c !== void 0 && L <= c, Y = f || p || L !== null && l !== void 0 && L >= l;
40
40
  return /* @__PURE__ */ o("div", {
41
- className: G,
41
+ className: q,
42
42
  children: [
43
43
  /* @__PURE__ */ a("button", {
44
44
  className: "number-input__btn number-input__btn--decrement",
45
45
  type: "button",
46
- onClick: B,
47
- disabled: K,
48
- "aria-label": O("decrement", b),
46
+ onClick: H,
47
+ disabled: J,
48
+ "aria-label": k("decrement", b),
49
49
  tabIndex: -1,
50
50
  children: /* @__PURE__ */ a(t, {
51
51
  name: "minus",
@@ -53,7 +53,7 @@ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1,
53
53
  })
54
54
  }),
55
55
  /* @__PURE__ */ a("input", {
56
- ref: D,
56
+ ref: O,
57
57
  className: "number-input__field",
58
58
  type: "text",
59
59
  inputMode: d ? "decimal" : "numeric",
@@ -61,22 +61,22 @@ var s = n(function({ value: n, defaultValue: s = 0, min: c, max: l, step: u = 1,
61
61
  "aria-invalid": h || void 0,
62
62
  "aria-describedby": v,
63
63
  "aria-label": y,
64
- ...E,
64
+ ...D,
65
65
  id: g,
66
66
  name: _,
67
- value: L,
67
+ value: R,
68
68
  disabled: f,
69
69
  readOnly: p,
70
- onChange: H,
71
- onFocus: U,
72
- onBlur: W
70
+ onChange: W,
71
+ onFocus: G,
72
+ onBlur: K
73
73
  }),
74
74
  /* @__PURE__ */ a("button", {
75
75
  className: "number-input__btn number-input__btn--increment",
76
76
  type: "button",
77
- onClick: V,
78
- disabled: q,
79
- "aria-label": O("increment", x),
77
+ onClick: U,
78
+ disabled: Y,
79
+ "aria-label": k("increment", x),
80
80
  tabIndex: -1,
81
81
  children: /* @__PURE__ */ a(t, {
82
82
  name: "plus",
package/dist/toaster.js CHANGED
@@ -19,33 +19,36 @@ function h(e, t) {
19
19
  return [
20
20
  "alert",
21
21
  m[e ?? ""] ?? "",
22
- e === "warning" ? "" : "surface-dark",
22
+ e === "success" || e === "error" ? "surface-dark" : "",
23
23
  t ? "alert--dismissible" : "",
24
24
  "toast"
25
25
  ].filter(Boolean).join(" ");
26
26
  }
27
- function g({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p, gap: m, expand: g }) {
28
- let _ = e("toaster"), { toasts: v } = f.useToastManager(), [y, b] = a.split("-"), x = v.map((e) => e.id).join(",");
27
+ function g(e) {
28
+ return e === "success" || e === "error" ? "" : e === "warning" ? " surface-light" : " surface-invert";
29
+ }
30
+ function _({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p, gap: m, expand: _ }) {
31
+ let v = e("toaster"), { toasts: y } = f.useToastManager(), [b, x] = a.split("-"), S = y.map((e) => e.id).join(",");
29
32
  l(() => {
30
- s(x ? x.split(",") : []);
31
- }, [x]);
32
- let S = i({ "--toast-gap": `${m}px` }), C = t(void 0), w = [
33
+ s(S ? S.split(",") : []);
34
+ }, [S]);
35
+ let C = i({ "--toast-gap": `${m}px` }), w = t(void 0), T = [
33
36
  "toaster",
34
- y === "top" ? "toaster--top" : "",
35
- b === "right" ? "" : `toaster--${b}`,
36
- g ? "toaster--expanded" : ""
37
+ b === "top" ? "toaster--top" : "",
38
+ x === "right" ? "" : `toaster--${x}`,
39
+ _ ? "toaster--expanded" : ""
37
40
  ].filter(Boolean).join(" ");
38
41
  return /* @__PURE__ */ u(f.Portal, {
39
- container: C,
42
+ container: w,
40
43
  children: /* @__PURE__ */ u(f.Viewport, {
41
- ref: S,
42
- className: w,
43
- "aria-label": _("container", o),
44
- children: v.map((e) => /* @__PURE__ */ d(f.Root, {
44
+ ref: C,
45
+ className: T,
46
+ "aria-label": v("container", o),
47
+ children: y.map((e) => /* @__PURE__ */ d(f.Root, {
45
48
  toast: e,
46
49
  className: h(e.type, p),
47
50
  children: [/* @__PURE__ */ d("div", {
48
- className: "alert__content",
51
+ className: `alert__content${g(e.type)}`,
49
52
  children: [
50
53
  /* @__PURE__ */ u(f.Title, { className: "alert__title" }),
51
54
  /* @__PURE__ */ u(f.Description, { className: "alert__description" }),
@@ -58,20 +61,20 @@ function g({ position: a, containerAriaLabel: o, closeLabel: c, closeButton: p,
58
61
  })
59
62
  ]
60
63
  }), p && /* @__PURE__ */ u(f.Close, {
61
- className: "alert__close",
62
- render: /* @__PURE__ */ u(r, { label: _("close", c) })
64
+ className: `alert__close${g(e.type)}`,
65
+ render: /* @__PURE__ */ u(r, { label: v("close", c) })
63
66
  })]
64
67
  }, e.id))
65
68
  })
66
69
  });
67
70
  }
68
- function _({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n, closeButton: r = !0, duration: i = a, gap: s = p, visibleToasts: d = 3, expand: m = !1 }) {
71
+ function v({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n, closeButton: r = !0, duration: i = a, gap: s = p, visibleToasts: d = 3, expand: m = !1 }) {
69
72
  let h = Number.isFinite(i) ? i : 0;
70
73
  return l(() => o(h), [h]), /* @__PURE__ */ u(f.Provider, {
71
74
  toastManager: c,
72
75
  timeout: h,
73
76
  limit: d,
74
- children: /* @__PURE__ */ u(g, {
77
+ children: /* @__PURE__ */ u(_, {
75
78
  position: e,
76
79
  containerAriaLabel: t,
77
80
  closeLabel: n,
@@ -82,4 +85,4 @@ function _({ position: e = "bottom-right", containerAriaLabel: t, closeLabel: n,
82
85
  });
83
86
  }
84
87
  //#endregion
85
- export { _ as Toaster };
88
+ export { v as Toaster };