@telefonica/mistica 15.7.0 → 15.9.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 (39) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.d.ts +4 -6
  3. package/dist/accordion.js +99 -92
  4. package/dist/community/blocks.js +1 -0
  5. package/dist/empty-state.js +7 -6
  6. package/dist/icon-button.d.ts +17 -16
  7. package/dist/icon-button.js +51 -49
  8. package/dist/icons/icon-chevron.css-mistica.js +25 -0
  9. package/dist/icons/icon-chevron.css.d.ts +5 -0
  10. package/dist/icons/icon-chevron.css.ts.vanilla.css-mistica.js +11 -0
  11. package/dist/icons/icon-chevron.js +27 -20
  12. package/dist/image.js +13 -12
  13. package/dist/list.css-mistica.js +11 -11
  14. package/dist/list.css.d.ts +1 -3
  15. package/dist/list.d.ts +8 -16
  16. package/dist/list.js +275 -383
  17. package/dist/package-version.js +1 -1
  18. package/dist/progress-bar.d.ts +2 -0
  19. package/dist/progress-bar.js +44 -35
  20. package/dist/stacking-group.js +7 -7
  21. package/dist/text-field-components.js +4 -4
  22. package/dist/utils/aspect-ratio-support.js +18 -18
  23. package/dist-es/accordion.js +131 -121
  24. package/dist-es/community/blocks.js +1 -0
  25. package/dist-es/empty-state.js +9 -8
  26. package/dist-es/icon-button.js +64 -62
  27. package/dist-es/icons/icon-chevron.css-mistica.js +5 -0
  28. package/dist-es/icons/icon-chevron.css.ts.vanilla.css-mistica.js +2 -0
  29. package/dist-es/icons/icon-chevron.js +26 -24
  30. package/dist-es/image.js +19 -18
  31. package/dist-es/list.css-mistica.js +2 -2
  32. package/dist-es/list.js +321 -429
  33. package/dist-es/package-version.js +1 -1
  34. package/dist-es/progress-bar.js +54 -45
  35. package/dist-es/stacking-group.js +14 -14
  36. package/dist-es/style.css +1 -1
  37. package/dist-es/text-field-components.js +11 -11
  38. package/dist-es/utils/aspect-ratio-support.js +22 -22
  39. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- const o = "15.7.0";
1
+ const o = "15.9.0";
2
2
  export { o as PACKAGE_VERSION };
@@ -51,79 +51,88 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsx as t } from "react/jsx-runtime";
54
+ import { jsx as o } from "react/jsx-runtime";
55
55
  import * as b from "react";
56
- import { useTheme as f } from "./hooks.js";
57
- import { vars as h } from "./skins/skin-contract.css-mistica.js";
58
- import { barBackground as B, bar as S, inverse as $, normal as x, progressBarSteppedContainer as N } from "./progress-bar.css-mistica.js";
56
+ import { useTheme as v } from "./hooks.js";
57
+ import { vars as B } from "./skins/skin-contract.css-mistica.js";
58
+ import { barBackground as S, bar as $, inverse as x, normal as y, progressBarSteppedContainer as N } from "./progress-bar.css-mistica.js";
59
59
  import { getPrefixedDataAttributes as C } from "./utils/dom.js";
60
- import k from "classnames";
61
- import P from "./inline.js";
62
- const E = (param)=>{
63
- let { progressPercent: r, color: o, "aria-label": d, "aria-labelledby": l, dataAttributes: i, reverse: n = !1 } = param;
64
- const { texts: c } = f(), a = Math.max(0, Math.min(100, r)), s = l ? void 0 : (()=>`${d || c.loading}, ${a}% ${c.progressBarCompletedLabel}`)();
65
- return /* @__PURE__ */ t("div", _object_spread_props(_object_spread({}, C(i, "ProgressBar")), {
66
- className: B,
60
+ import P from "classnames";
61
+ import w from "./inline.js";
62
+ const R = (param)=>{
63
+ let { progressPercent: e, color: s, "aria-label": p, "aria-labelledby": n, "aria-hidden": t, dataAttributes: c, reverse: l = !1 } = param;
64
+ const { texts: m } = v(), a = Math.max(0, Math.min(100, e)), i = t && t !== "false" ? {
65
+ "aria-hidden": t
66
+ } : {
67
67
  role: "progressbar",
68
68
  "aria-valuenow": a,
69
69
  "aria-valuemin": 0,
70
70
  "aria-valuemax": 100,
71
- "aria-label": s,
72
- "aria-labelledby": l,
73
- children: /* @__PURE__ */ t("div", {
74
- className: k(S, n ? $ : x),
71
+ "aria-label": n ? void 0 : (()=>`${p || m.loading}, ${a}% ${m.progressBarCompletedLabel}`)(),
72
+ "aria-labelledby": n
73
+ };
74
+ return /* @__PURE__ */ o("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, C(c, "ProgressBar")), {
75
+ className: S
76
+ }), i), {
77
+ children: /* @__PURE__ */ o("div", {
78
+ className: P($, l ? x : y),
75
79
  style: {
76
80
  maxWidth: `${a}%`,
77
- backgroundColor: o !== null && o !== void 0 ? o : h.colors.controlActivated
81
+ backgroundColor: s !== null && s !== void 0 ? s : B.colors.controlActivated
78
82
  }
79
83
  })
80
84
  }));
81
- }, R = (param)=>{
82
- let { steps: r, currentStep: o = 0, color: d, dataAttributes: l, "aria-label": i, "aria-labelledby": n } = param;
83
- const { texts: c } = f(), [a, p] = b.useState(Math.ceil(o)), [s, y] = b.useState(!1);
85
+ }, T = (param)=>{
86
+ let { steps: e, currentStep: s = 0, color: p, dataAttributes: n, "aria-label": t, "aria-labelledby": c, "aria-hidden": l } = param;
87
+ const { texts: m } = v(), [a, g] = b.useState(Math.ceil(s)), [i, k] = b.useState(!1);
84
88
  b.useEffect(()=>{
85
- const e = Math.ceil(o);
86
- a !== e && (y(e < a), p(e));
89
+ const r = Math.ceil(s);
90
+ a !== r && (k(r < a), g(r));
87
91
  }, [
88
- o,
89
- r,
92
+ s,
93
+ e,
90
94
  a
91
95
  ]);
92
- const A = n ? void 0 : (()=>{
93
- const e = c.progressBarStepLabel.replace("1$s", String(a)).replace("2$s", String(r));
94
- return i ? `${i}, ${e.toLowerCase()}` : e;
95
- })();
96
- return /* @__PURE__ */ t("div", _object_spread_props(_object_spread({}, C(l, "ProgressBarStepped")), {
96
+ const A = l && l !== "false" ? {
97
+ "aria-hidden": l
98
+ } : {
97
99
  role: "progressbar",
98
100
  "aria-valuenow": a,
99
101
  "aria-valuemin": 0,
100
- "aria-valuemax": r,
101
- "aria-label": A,
102
- "aria-labelledby": n,
102
+ "aria-valuemax": e,
103
+ "aria-label": c ? void 0 : (()=>{
104
+ const r = m.progressBarStepLabel.replace("1$s", String(a)).replace("2$s", String(e));
105
+ return t ? `${t}, ${r.toLowerCase()}` : r;
106
+ })(),
107
+ "aria-labelledby": c
108
+ };
109
+ return /* @__PURE__ */ o("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, C(n, "ProgressBarStepped")), {
110
+ role: "progressbar"
111
+ }), A), {
103
112
  className: N,
104
- children: /* @__PURE__ */ t(P, {
113
+ children: /* @__PURE__ */ o(w, {
105
114
  space: 8,
106
115
  fullWidth: !0,
107
116
  children: Array.from({
108
- length: r
109
- }, (e, m)=>{
110
- const g = m === a, u = m < a, v = m === a - 1;
111
- return /* @__PURE__ */ t("div", {
112
- className: B,
117
+ length: e
118
+ }, (r, d)=>{
119
+ const u = d === a, h = d < a, f = d === a - 1;
120
+ return /* @__PURE__ */ o("div", {
121
+ className: S,
113
122
  "aria-hidden": "true",
114
- children: (u || g) && /* @__PURE__ */ t("div", {
115
- className: k(S, {
116
- [x]: v && !s,
117
- [$]: g && s
123
+ children: (h || u) && /* @__PURE__ */ o("div", {
124
+ className: P($, {
125
+ [y]: f && !i,
126
+ [x]: u && i
118
127
  }),
119
128
  style: {
120
- backgroundColor: d !== null && d !== void 0 ? d : h.colors.controlActivated,
121
- maxWidth: u || v && !s ? "100%" : "0"
129
+ backgroundColor: p !== null && p !== void 0 ? p : B.colors.controlActivated,
130
+ maxWidth: h || f && !i ? "100%" : "0"
122
131
  }
123
132
  })
124
- }, m);
133
+ }, d);
125
134
  })
126
135
  })
127
136
  }));
128
137
  };
129
- export { E as ProgressBar, R as ProgressBarStepped };
138
+ export { R as ProgressBar, T as ProgressBarStepped };
@@ -1,41 +1,41 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as u } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
3
3
  import * as l from "react";
4
4
  import { useIsInverseVariant as f } from "./theme-variant-context.js";
5
5
  import { vars as r } from "./skins/skin-contract.css-mistica.js";
6
6
  import h from "./inline.js";
7
- import { Text4 as b } from "./text.js";
8
- import { moreItems as v } from "./stacking-group.css-mistica.js";
7
+ import { Text4 as v } from "./text.js";
8
+ import { moreItems as b } from "./stacking-group.css-mistica.js";
9
9
  import { vars as g } from "./image.css-mistica.js";
10
10
  import { applyCssVars as y } from "./utils/css.js";
11
11
  const C = (param)=>{
12
- let { moreItemsStyle: e, stacked: n = !0, maxItems: o = 1 / 0, children: t } = param;
13
- const c = f(), i = l.Children.count(t), m = i - o + 1, p = n ? -8 : 8, a = e.size, d = e.type === "circle" ? "50%" : r.borderRadii.mediaSmall;
14
- return /* @__PURE__ */ s("div", {
12
+ let { moreItemsStyle: s, stacked: t = !0, maxItems: o = 1 / 0, children: n } = param;
13
+ const c = f(), i = l.Children.count(n), m = i - o + 1, p = t ? -8 : 8, a = s.size, d = s.type === "circle" ? "50%" : r.borderRadii.mediaSmall;
14
+ return /* @__PURE__ */ e("div", {
15
15
  style: y({
16
16
  [g.mediaBorderRadius]: d
17
17
  }),
18
18
  children: /* @__PURE__ */ u(h, {
19
19
  space: p,
20
20
  children: [
21
- l.Children.toArray(t).slice(0, i > o ? o - 1 : o),
22
- i > o && /* @__PURE__ */ s("div", {
23
- className: v,
21
+ l.Children.toArray(n).slice(0, i > o ? o - 1 : o),
22
+ i > o && /* @__PURE__ */ e("div", {
23
+ className: b,
24
24
  style: {
25
25
  width: a,
26
26
  height: a,
27
27
  borderRadius: d,
28
28
  backgroundColor: c ? r.colors.brandHigh : r.colors.brandLow,
29
- border: n ? `1px solid ${r.colors.borderLow}` : "none"
29
+ border: t ? `1px solid ${r.colors.borderLow}` : "none"
30
30
  },
31
- children: /* @__PURE__ */ s(b, {
31
+ children: /* @__PURE__ */ e(v, {
32
32
  regular: !0,
33
- color: c ? r.colors.textPrimaryInverse : r.colors.brand,
33
+ color: c ? r.colors.textPrimaryInverse : r.colors.textBrand,
34
34
  children: "+" + m
35
35
  })
36
36
  })
37
37
  ]
38
38
  })
39
39
  });
40
- }, G = C;
41
- export { G as default };
40
+ }, B = C;
41
+ export { B as default };