@telefonica/mistica 16.1.1 → 16.2.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 (142) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +12 -9
  3. package/dist/accordion.css.d.ts +1 -0
  4. package/dist/accordion.js +36 -39
  5. package/dist/align.css-mistica.js +12 -0
  6. package/dist/align.css.d.ts +1 -0
  7. package/dist/align.css.ts.vanilla.css-mistica.js +11 -0
  8. package/dist/align.d.ts +12 -0
  9. package/dist/align.js +79 -0
  10. package/dist/box.css-mistica.js +41 -0
  11. package/dist/box.css.d.ts +23 -0
  12. package/dist/box.css.ts.vanilla.css-mistica.js +11 -0
  13. package/dist/box.d.ts +4 -0
  14. package/dist/box.js +39 -31
  15. package/dist/boxed.css-mistica.js +10 -5
  16. package/dist/boxed.css.d.ts +3 -0
  17. package/dist/boxed.js +20 -24
  18. package/dist/callout.css-mistica.js +12 -4
  19. package/dist/callout.css.d.ts +1 -0
  20. package/dist/callout.js +14 -22
  21. package/dist/card.css-mistica.js +26 -23
  22. package/dist/card.css.d.ts +1 -0
  23. package/dist/card.js +17 -23
  24. package/dist/community/advanced-data-card.css-mistica.js +32 -23
  25. package/dist/community/advanced-data-card.css.d.ts +3 -0
  26. package/dist/community/advanced-data-card.js +46 -55
  27. package/dist/empty-state.css-mistica.js +11 -8
  28. package/dist/empty-state.css.d.ts +1 -0
  29. package/dist/empty-state.js +10 -13
  30. package/dist/form.css-mistica.js +12 -0
  31. package/dist/form.css.d.ts +1 -0
  32. package/dist/form.js +8 -10
  33. package/dist/grid.css-mistica.js +143 -126
  34. package/dist/grid.css.d.ts +13 -0
  35. package/dist/grid.js +35 -38
  36. package/dist/hero.css-mistica.js +14 -8
  37. package/dist/hero.css.d.ts +2 -0
  38. package/dist/hero.js +17 -25
  39. package/dist/image.js +23 -25
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +4 -0
  42. package/dist/inline.js +10 -11
  43. package/dist/list.css-mistica.js +12 -9
  44. package/dist/list.css.d.ts +1 -0
  45. package/dist/list.js +43 -46
  46. package/dist/loading-screen.js +16 -16
  47. package/dist/logo-blau.d.ts +1 -1
  48. package/dist/logo-blau.js +10 -10
  49. package/dist/logo-common.d.ts +1 -0
  50. package/dist/logo-movistar.d.ts +1 -1
  51. package/dist/logo-movistar.js +4 -4
  52. package/dist/logo-o2-new.d.ts +1 -1
  53. package/dist/logo-o2-new.js +5 -5
  54. package/dist/logo-o2.d.ts +1 -1
  55. package/dist/logo-o2.js +5 -5
  56. package/dist/logo-telefonica.d.ts +1 -1
  57. package/dist/logo-telefonica.js +4 -4
  58. package/dist/logo-tu.d.ts +1 -1
  59. package/dist/logo-tu.js +5 -5
  60. package/dist/logo-vivo.d.ts +1 -1
  61. package/dist/logo-vivo.js +7 -7
  62. package/dist/logo.d.ts +9 -8
  63. package/dist/logo.js +125 -102
  64. package/dist/navigation-bar.css-mistica.js +23 -20
  65. package/dist/navigation-bar.css.d.ts +1 -0
  66. package/dist/navigation-bar.js +30 -37
  67. package/dist/package-version.js +1 -1
  68. package/dist/popover.d.ts +1 -0
  69. package/dist/popover.js +9 -10
  70. package/dist/skeleton-base.js +10 -12
  71. package/dist/skeletons.css-mistica.js +11 -5
  72. package/dist/skeletons.css.d.ts +1 -0
  73. package/dist/snackbar.css-mistica.js +20 -14
  74. package/dist/snackbar.css.d.ts +3 -1
  75. package/dist/snackbar.js +65 -75
  76. package/dist/tag.css-mistica.js +15 -4
  77. package/dist/tag.css.d.ts +2 -0
  78. package/dist/tag.js +20 -24
  79. package/dist/text-field-components.css-mistica.js +16 -10
  80. package/dist/text-field-components.css.d.ts +1 -0
  81. package/dist/text-field-components.js +32 -35
  82. package/dist/timer.js +42 -43
  83. package/dist/tooltip.d.ts +3 -1
  84. package/dist/tooltip.js +106 -106
  85. package/dist/touchable.js +47 -42
  86. package/dist-es/accordion.css-mistica.js +3 -3
  87. package/dist-es/accordion.js +58 -61
  88. package/dist-es/align.css-mistica.js +3 -0
  89. package/dist-es/align.css.ts.vanilla.css-mistica.js +2 -0
  90. package/dist-es/align.js +70 -0
  91. package/dist-es/box.css-mistica.js +24 -0
  92. package/dist-es/box.css.ts.vanilla.css-mistica.js +2 -0
  93. package/dist-es/box.js +43 -35
  94. package/dist-es/boxed.css-mistica.js +5 -3
  95. package/dist-es/boxed.js +28 -32
  96. package/dist-es/callout.css-mistica.js +7 -2
  97. package/dist-es/callout.js +44 -52
  98. package/dist-es/card.css-mistica.js +4 -4
  99. package/dist-es/card.js +11 -17
  100. package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
  101. package/dist-es/community/advanced-data-card.js +90 -99
  102. package/dist-es/empty-state.css-mistica.js +3 -3
  103. package/dist-es/empty-state.js +19 -22
  104. package/dist-es/form.css-mistica.js +3 -0
  105. package/dist-es/form.js +12 -14
  106. package/dist-es/grid.css-mistica.js +123 -112
  107. package/dist-es/grid.js +38 -41
  108. package/dist-es/hero.css-mistica.js +2 -2
  109. package/dist-es/hero.js +36 -44
  110. package/dist-es/image.js +28 -30
  111. package/dist-es/index.js +1844 -1843
  112. package/dist-es/inline.js +19 -20
  113. package/dist-es/list.css-mistica.js +2 -2
  114. package/dist-es/list.js +75 -78
  115. package/dist-es/loading-screen.js +30 -30
  116. package/dist-es/logo-blau.js +11 -11
  117. package/dist-es/logo-movistar.js +5 -5
  118. package/dist-es/logo-o2-new.js +8 -8
  119. package/dist-es/logo-o2.js +8 -8
  120. package/dist-es/logo-telefonica.js +4 -4
  121. package/dist-es/logo-tu.js +8 -8
  122. package/dist-es/logo-vivo.js +16 -16
  123. package/dist-es/logo.js +132 -109
  124. package/dist-es/navigation-bar.css-mistica.js +11 -11
  125. package/dist-es/navigation-bar.js +80 -87
  126. package/dist-es/package-version.js +1 -1
  127. package/dist-es/popover.js +17 -18
  128. package/dist-es/skeleton-base.js +15 -17
  129. package/dist-es/skeletons.css-mistica.js +5 -2
  130. package/dist-es/snackbar.css-mistica.js +4 -4
  131. package/dist-es/snackbar.js +93 -103
  132. package/dist-es/style.css +1 -1
  133. package/dist-es/tag.css-mistica.js +2 -2
  134. package/dist-es/tag.js +34 -38
  135. package/dist-es/text-field-components.css-mistica.js +5 -2
  136. package/dist-es/text-field-components.js +48 -51
  137. package/dist-es/timer.js +80 -81
  138. package/dist-es/tooltip.js +148 -148
  139. package/dist-es/touchable.js +55 -50
  140. package/package.json +1 -1
  141. package/dist/sprinkles.css-mistica.js +0 -2494
  142. package/dist-es/sprinkles.css-mistica.js +0 -2485
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "PACKAGE_VERSION", {
8
8
  return o;
9
9
  }
10
10
  });
11
- const o = "16.1.1";
11
+ const o = "16.2.0";
package/dist/popover.d.ts CHANGED
@@ -4,6 +4,7 @@ type Position = 'top' | 'bottom' | 'left' | 'right';
4
4
  type Props = {
5
5
  description?: string;
6
6
  target: React.ReactNode;
7
+ targetStyle?: React.CSSProperties;
7
8
  title?: string;
8
9
  asset?: React.ReactNode;
9
10
  onClose?: () => void;
package/dist/popover.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return N;
9
+ return A;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -14,7 +14,6 @@ const _tooltip = require("./tooltip.js");
14
14
  const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
15
15
  const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
16
16
  const _text = require("./text.js");
17
- const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
18
17
  const _popovercssmistica = require("./popover.css-mistica.js");
19
18
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
20
19
  const _iconbuttoncssmistica = require("./icon-button.css-mistica.js");
@@ -78,8 +77,8 @@ function _object_without_properties_loose(source, excluded) {
78
77
  }
79
78
  return target;
80
79
  }
81
- const T = (_param)=>{
82
- var { open: a, extra: m, children: c, onClose: i = ()=>{}, closeButtonLabel: l, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, f = _object_without_properties(_param, [
80
+ const S = (_param)=>{
81
+ var { open: a, extra: c, children: i, onClose: l = ()=>{}, closeButtonLabel: m, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, d = _object_without_properties(_param, [
83
82
  "open",
84
83
  "extra",
85
84
  "children",
@@ -92,7 +91,7 @@ const T = (_param)=>{
92
91
  "asset"
93
92
  ]);
94
93
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_tooltip.BaseTooltip, _object_spread({
95
- content: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_box.default, {
94
+ content: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
96
95
  className: _popovercssmistica.content,
97
96
  children: [
98
97
  (o || e || n) && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
@@ -120,18 +119,18 @@ const T = (_param)=>{
120
119
  ]
121
120
  })
122
121
  }),
123
- m !== null && m !== void 0 ? m : c
122
+ c !== null && c !== void 0 ? c : i
124
123
  ]
125
124
  }),
126
125
  centerContent: !1,
127
126
  open: a,
128
127
  hasPointerInteractionOnly: !0,
129
128
  delay: !1,
130
- onClose: i,
131
- closeButtonLabel: l,
129
+ onClose: l,
130
+ closeButtonLabel: m,
132
131
  trackingEvent: s,
133
132
  dataAttributes: _object_spread({
134
133
  "component-name": "Popover"
135
134
  }, p)
136
- }, f));
137
- }, N = T;
135
+ }, d));
136
+ }, A = S;
@@ -6,31 +6,29 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return v;
9
+ return k;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
13
13
  const _themevariantcontext = require("./theme-variant-context.js");
14
14
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
15
- const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
15
+ const _skeletonscssmistica = require("./skeletons.css-mistica.js");
16
16
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
17
17
  function _interop_require_default(obj) {
18
18
  return obj && obj.__esModule ? obj : {
19
19
  default: obj
20
20
  };
21
21
  }
22
- const c = (param)=>{
23
- let { width: e = "100%", height: o = 8, radius: s = _skincontractcssmistica.vars.borderRadii.container, className: a, noBorderRadius: n = !1 } = param;
24
- const t = (0, _themevariantcontext.useIsInverseOrMediaVariant)();
22
+ const l = (param)=>{
23
+ let { width: r = "100%", height: s = 8, radius: a = _skincontractcssmistica.vars.borderRadii.container, className: o, noBorderRadius: t = !1 } = param;
24
+ const i = (0, _themevariantcontext.useIsInverseOrMediaVariant)();
25
25
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
26
- className: (0, _classnames.default)(a, (0, _sprinklescssmistica.sprinkles)({
27
- background: t ? _skincontractcssmistica.vars.colors.backgroundSkeletonInverse : _skincontractcssmistica.vars.colors.backgroundSkeleton
28
- })),
26
+ className: (0, _classnames.default)(o, i ? _skeletonscssmistica.background.inverse : _skeletonscssmistica.background.default),
29
27
  style: {
30
- borderRadius: n ? 0 : s,
31
- width: e,
32
- height: o
28
+ borderRadius: t ? 0 : a,
29
+ width: r,
30
+ height: s
33
31
  },
34
32
  "aria-hidden": !0
35
33
  });
36
- }, v = c;
34
+ }, k = l;
@@ -10,18 +10,24 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  animation: function() {
13
- return i;
13
+ return r;
14
+ },
15
+ background: function() {
16
+ return a;
14
17
  },
15
18
  circle: function() {
16
- return o;
19
+ return f;
17
20
  },
18
21
  line: function() {
19
- return r;
22
+ return i;
20
23
  },
21
24
  row: function() {
22
- return f;
25
+ return o;
23
26
  }
24
27
  });
25
28
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
26
29
  require("./skeletons.css.ts.vanilla.css-mistica.js");
27
- var i = "zopolw2 _1y2v1nfhm", o = "_1y2v1nfi2 _1y2v1nfi4", r = "zopolw6 _1y2v1nfi3", f = "_1y2v1nfhk _1y2v1nfhz _1y2v1nfht";
30
+ var r = "zopolw6 _1y2v1nfhm", a = {
31
+ default: "_1y2v1nf42",
32
+ inverse: "_1y2v1nf43"
33
+ }, f = "_1y2v1nfi2 _1y2v1nfi4", i = "zopolwa _1y2v1nfi3", o = "_1y2v1nfhk _1y2v1nfhz _1y2v1nfht";
@@ -1,3 +1,4 @@
1
+ export declare const background: Record<"inverse" | "default", string>;
1
2
  export declare const animation: string;
2
3
  export declare const row: string;
3
4
  export declare const circle: string;
@@ -13,45 +13,51 @@ _export(exports, {
13
13
  return f;
14
14
  },
15
15
  button: function() {
16
- return r;
17
- },
18
- content: function() {
19
16
  return _;
20
17
  },
21
- dismissButton: function() {
18
+ buttonTouchable: function() {
22
19
  return y;
23
20
  },
21
+ contentWithLongButton: function() {
22
+ return o;
23
+ },
24
+ contentWithoutLongButton: function() {
25
+ return r;
26
+ },
27
+ dismissButton: function() {
28
+ return t;
29
+ },
24
30
  dismissIcon: function() {
25
31
  return a;
26
32
  },
27
33
  longButton: function() {
28
- return o;
34
+ return h;
29
35
  },
30
36
  snackbar: function() {
31
37
  return b;
32
38
  },
33
39
  snackbarContainer: function() {
34
- return t;
40
+ return e;
35
41
  },
36
42
  snackbarOpen: function() {
37
- return h;
43
+ return i;
38
44
  },
39
45
  wrapper: function() {
40
- return e;
46
+ return p;
41
47
  },
42
48
  wrapperCritical: function() {
43
- return p;
49
+ return k;
44
50
  },
45
51
  wrapperInfo: function() {
46
- return i;
52
+ return c;
47
53
  },
48
54
  wrapperOpen: function() {
49
- return k;
55
+ return j;
50
56
  }
51
57
  });
52
58
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
53
59
  require("./snackbar.css.ts.vanilla.css-mistica.js");
54
- var f = 300, r = "o7bjb0c", _ = "_1y2v1nfhk _1y2v1nfhw", y = {
55
- centered: "o7bjb0g _1y2v1nfhk _1y2v1nfhf _1y2v1nfhz _1y2v1nfht _1y2v1nflo",
60
+ var f = 300, _ = "o7bjb0g", y = "_1y2v1nf7j _1y2v1nf8s _1y2v1nfa4 _1y2v1nfbd _1y2v1nfk2 _1y2v1nf7c", o = "_1y2v1nfhk _1y2v1nfhw _1y2v1nfhq", r = "_1y2v1nfhk _1y2v1nfhw _1y2v1nfhp _1y2v1nfhz", t = {
61
+ centered: "o7bjb0l _1y2v1nfhk _1y2v1nfhf _1y2v1nfhz _1y2v1nfht _1y2v1nflo",
56
62
  topRight: "_1y2v1nfhk _1y2v1nfhf _1y2v1nfhz _1y2v1nfht _1y2v1nflo _1y2v1nfku"
57
- }, a = "o7bjb0j _1y2v1nfih _1y2v1nfix _1y2v1nfhk _1y2v1nfhz _1y2v1nfht _1y2v1nfk3", o = "o7bjb0d", b = "o7bjb01 _1y2v1nfi7 _1y2v1nfhk _1y2v1nfht", t = "o7bjb03 _1y2v1nfhe", h = "o7bjb04", e = "o7bjb06 _1y2v1nfhg _1y2v1nfkd", p = "_1y2v1nf5e", i = "_1y2v1nf5f", k = "o7bjb09";
63
+ }, a = "o7bjb0o _1y2v1nfih _1y2v1nfix _1y2v1nfhk _1y2v1nfhz _1y2v1nfht _1y2v1nfk3", h = "o7bjb0h", b = "o7bjb01 _1y2v1nfi7 _1y2v1nfhk _1y2v1nfht", e = "o7bjb03 _1y2v1nfhe", i = "o7bjb04", p = "o7bjb06 _1y2v1nfhg _1y2v1nfkd", k = "_1y2v1nf5e", c = "_1y2v1nf5f", j = "o7bjb09";
@@ -6,9 +6,11 @@ export declare const wrapper: string;
6
6
  export declare const wrapperCritical: string;
7
7
  export declare const wrapperInfo: string;
8
8
  export declare const wrapperOpen: string;
9
- export declare const content: string;
9
+ export declare const contentWithLongButton: string;
10
+ export declare const contentWithoutLongButton: string;
10
11
  export declare const textContainer: string;
11
12
  export declare const button: string;
12
13
  export declare const longButton: string;
14
+ export declare const buttonTouchable: string;
13
15
  export declare const dismissButton: Record<"centered" | "topRight", string>;
14
16
  export declare const dismissIcon: string;
package/dist/snackbar.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return ge;
9
+ return Ee;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -17,7 +17,6 @@ const _webviewbridge = require("@tef-novum/webview-bridge");
17
17
  const _hooks = require("./hooks.js");
18
18
  const _text = require("./text.js");
19
19
  const _snackbarcssmistica = require("./snackbar.css-mistica.js");
20
- const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
21
20
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
22
21
  const _dom = require("./utils/dom.js");
23
22
  const _portal = require("./portal.js");
@@ -126,41 +125,41 @@ const ne = [
126
125
  "TIMEOUT",
127
126
  "CONSECUTIVE",
128
127
  "BUTTON"
129
- ], oe = 5e3, se = 1e4, ce = /*#__PURE__*/ _react.forwardRef((param, g)=>{
130
- let { message: m, buttonText: t, buttonAccessibilityLabel: f, closeButtonLabel: p, duration: n, onClose: o, type: c, withDismiss: d = !1, dataAttributes: O } = param;
131
- const { texts: T, t: a } = (0, _hooks.useTheme)(), [i, I] = _react.useState(!1), { width: s, ref: U } = (0, _hooks.useElementDimensions)(), { isDesktopOrBigger: C } = (0, _hooks.useScreenSize)(), l = s > (C ? 160 : 128), B = _react.useRef(null), E = n === "PERSISTENT" && !t || d, k = t ? se : oe, S = _react.useRef(o);
128
+ ], se = 5e3, ce = 1e4, ae = /*#__PURE__*/ _react.forwardRef((param, E)=>{
129
+ let { message: u, buttonText: r, buttonAccessibilityLabel: m, closeButtonLabel: I, duration: o, onClose: n, type: c, withDismiss: f = !1, dataAttributes: O } = param;
130
+ const { texts: d, t: a } = (0, _hooks.useTheme)(), [i, p] = _react.useState(!1), { width: s, ref: k } = (0, _hooks.useElementDimensions)(), { isDesktopOrBigger: C } = (0, _hooks.useScreenSize)(), T = s > (C ? 160 : 128), g = _react.useRef(null), v = o === "PERSISTENT" && !r || f, b = r ? ce : se, h = _react.useRef(n);
132
131
  _react.useEffect(()=>{
133
- S.current = o;
132
+ h.current = n;
134
133
  }, [
135
- o
134
+ n
136
135
  ]);
137
- const u = _react.useCallback((v)=>{
138
- I(!1), setTimeout(()=>{
139
- var h;
140
- (h = S.current) == null || h.call(S, v);
136
+ const l = _react.useCallback((B)=>{
137
+ p(!1), setTimeout(()=>{
138
+ var S;
139
+ (S = h.current) == null || S.call(h, B);
141
140
  }, process.env.NODE_ENV === "test" ? 0 : _snackbarcssmistica.TRANSITION_TIME_IN_MS);
142
141
  }, []);
143
- return _react.useImperativeHandle(g, ()=>_object_spread_props(_object_spread({}, B), {
144
- close: u
142
+ return _react.useImperativeHandle(E, ()=>_object_spread_props(_object_spread({}, g), {
143
+ close: l
145
144
  }), [
146
- u
145
+ l
147
146
  ]), _react.useEffect(()=>{
148
- const v = setTimeout(()=>{
149
- I(!0);
150
- }, 50), h = n !== "PERSISTENT" ? setTimeout(()=>u({
147
+ const B = setTimeout(()=>{
148
+ p(!0);
149
+ }, 50), S = o !== "PERSISTENT" ? setTimeout(()=>l({
151
150
  action: "TIMEOUT"
152
- }), k) : void 0;
151
+ }), b) : void 0;
153
152
  return ()=>{
154
- clearTimeout(v), clearTimeout(h);
153
+ clearTimeout(B), clearTimeout(S);
155
154
  };
156
155
  }, [
157
- u,
158
- n,
159
- k
156
+ l,
157
+ o,
158
+ b
160
159
  ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
161
160
  className: _snackbarcssmistica.snackbarContainer,
162
161
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
163
- ref: B,
162
+ ref: g,
164
163
  className: (0, _classnames.default)(_snackbarcssmistica.snackbar, {
165
164
  [_snackbarcssmistica.snackbarOpen]: i
166
165
  }),
@@ -172,62 +171,53 @@ const ne = [
172
171
  }, (0, _dom.getPrefixedDataAttributes)(O, "SnackBar")), {
173
172
  children: [
174
173
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
175
- className: (0, _classnames.default)(_snackbarcssmistica.content, (0, _sprinklescssmistica.sprinkles)({
176
- flexDirection: l ? "column" : "row",
177
- alignItems: l ? void 0 : "center"
178
- })),
179
- style: E && !l ? {
174
+ className: (0, _classnames.default)(T ? _snackbarcssmistica.contentWithLongButton : _snackbarcssmistica.contentWithoutLongButton),
175
+ style: v && !T ? {
180
176
  paddingRight: 32
181
177
  } : void 0,
182
178
  children: [
183
179
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
184
- style: E && l ? {
180
+ style: v && T ? {
185
181
  paddingRight: 32
186
182
  } : void 0,
187
183
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
188
184
  regular: !0,
189
185
  color: _skincontractcssmistica.vars.colors.textPrimaryInverse,
190
- children: m
186
+ children: u
191
187
  })
192
188
  }),
193
- t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
189
+ r && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
194
190
  className: (0, _classnames.default)(_snackbarcssmistica.button, {
195
- [_snackbarcssmistica.longButton]: l
191
+ [_snackbarcssmistica.longButton]: T
196
192
  }),
197
193
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
198
- className: (0, _sprinklescssmistica.sprinkles)({
199
- paddingY: 4,
200
- paddingX: 8,
201
- border: "none",
202
- padding: 0,
203
- background: "transparent"
204
- }),
205
- ref: U,
194
+ className: _snackbarcssmistica.buttonTouchable,
195
+ ref: k,
206
196
  onPress: ()=>{
207
- u({
197
+ l({
208
198
  action: "BUTTON"
209
199
  });
210
200
  },
211
- "aria-label": f,
201
+ "aria-label": m,
212
202
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
213
203
  medium: !0,
214
204
  forceMobileSizes: !0,
215
205
  truncate: !0,
216
206
  color: c === "CRITICAL" ? _skincontractcssmistica.vars.colors.textPrimaryInverse : _skincontractcssmistica.vars.colors.textLinkSnackbar,
217
- children: t
207
+ children: r
218
208
  })
219
209
  })
220
210
  })
221
211
  ]
222
212
  }),
223
- E ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
213
+ v ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
224
214
  onPress: ()=>{
225
- u({
215
+ l({
226
216
  action: "DISMISS"
227
217
  });
228
218
  },
229
- "aria-label": p || T.closeButtonLabel || a(_texttokens.closeButtonLabel),
230
- className: _snackbarcssmistica.dismissButton[l ? "topRight" : "centered"],
219
+ "aria-label": I || d.closeButtonLabel || a(_texttokens.closeButtonLabel),
220
+ className: _snackbarcssmistica.dismissButton[T ? "topRight" : "centered"],
231
221
  style: {
232
222
  display: "flex",
233
223
  width: 32,
@@ -245,23 +235,23 @@ const ne = [
245
235
  }))
246
236
  })
247
237
  });
248
- }), ae = /*#__PURE__*/ _react.forwardRef((param, g)=>{
249
- let { message: m, buttonText: t, buttonAccessibilityLabel: f, closeButtonLabel: p, duration: n, onClose: o = ()=>{}, type: c = "INFORMATIVE", withDismiss: d, dataAttributes: O } = param;
250
- const T = (0, _webviewbridge.isWebViewBridgeAvailable)(), a = _react.useRef(o), i = _react.useRef(!1);
238
+ }), ie = /*#__PURE__*/ _react.forwardRef((param, E)=>{
239
+ let { message: u, buttonText: r, buttonAccessibilityLabel: m, closeButtonLabel: I, duration: o, onClose: n = ()=>{}, type: c = "INFORMATIVE", withDismiss: f, dataAttributes: O } = param;
240
+ const d = (0, _webviewbridge.isWebViewBridgeAvailable)(), a = _react.useRef(n), i = _react.useRef(!1);
251
241
  return _react.useEffect(()=>{
252
- a.current = o;
242
+ a.current = n;
253
243
  }, [
254
- o
244
+ n
255
245
  ]), _react.useEffect(()=>{
256
- T && !i.current && (i.current = !0, (0, _webviewbridge.nativeMessage)({
257
- message: m,
258
- duration: n,
259
- buttonText: t,
260
- buttonAccessibilityLabel: f,
246
+ d && !i.current && (i.current = !0, (0, _webviewbridge.nativeMessage)({
247
+ message: u,
248
+ duration: o,
249
+ buttonText: r,
250
+ buttonAccessibilityLabel: m,
261
251
  type: c,
262
- withDismiss: d
263
- }).then((I)=>{
264
- const s = I;
252
+ withDismiss: f
253
+ }).then((p)=>{
254
+ const s = p;
265
255
  s != null && s.action && ne.includes(s.action) ? a.current({
266
256
  action: s.action
267
257
  }) : a.current({
@@ -271,24 +261,24 @@ const ne = [
271
261
  i.current = !1;
272
262
  }));
273
263
  }, [
274
- f,
275
- p,
276
- t,
277
- n,
278
264
  m,
279
- T,
265
+ I,
266
+ r,
267
+ o,
268
+ u,
269
+ d,
280
270
  c,
281
- d
282
- ]), T ? null : /* @__PURE__ */ (0, _jsxruntime.jsx)(ce, {
283
- ref: g,
284
- message: m,
285
- duration: n,
286
- buttonText: t,
287
- buttonAccessibilityLabel: f,
288
- closeButtonLabel: p,
271
+ f
272
+ ]), d ? null : /* @__PURE__ */ (0, _jsxruntime.jsx)(ae, {
273
+ ref: E,
274
+ message: u,
275
+ duration: o,
276
+ buttonText: r,
277
+ buttonAccessibilityLabel: m,
278
+ closeButtonLabel: I,
289
279
  type: c,
290
280
  onClose: a.current,
291
- withDismiss: d,
281
+ withDismiss: f,
292
282
  dataAttributes: O
293
283
  });
294
- }), ge = ae;
284
+ }), Ee = ie;
@@ -2,12 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "tag", {
6
- enumerable: true,
7
- get: function() {
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ badge: function() {
13
+ return y;
14
+ },
15
+ icon: function() {
8
16
  return _;
17
+ },
18
+ tag: function() {
19
+ return f;
9
20
  }
10
21
  });
11
22
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
12
23
  require("./tag.css.ts.vanilla.css-mistica.js");
13
- var _ = "_1wy08671 _1y2v1nf7j _1y2v1nf8s _1y2v1nfhl _1y2v1nfhp _1y2v1nfhz _1y2v1nfht _1y2v1nfjg";
24
+ var y = "_1y2v1nfhl", _ = "_1y2v1nfhm", f = "_1wy08671 _1y2v1nf7j _1y2v1nf8s _1y2v1nfhl _1y2v1nfhp _1y2v1nfhz _1y2v1nfht _1y2v1nfjg";
package/dist/tag.css.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export declare const tag: string;
2
+ export declare const icon: string;
3
+ export declare const badge: string;
package/dist/tag.js CHANGED
@@ -16,7 +16,6 @@ const _themevariantcontext = require("./theme-variant-context.js");
16
16
  const _css = require("./utils/css.js");
17
17
  const _dom = require("./utils/dom.js");
18
18
  const _tagcssmistica = require("./tag.css-mistica.js");
19
- const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
20
19
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
21
20
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
22
21
  const _hooks = require("./hooks.js");
@@ -78,10 +77,10 @@ function _object_spread_props(target, source) {
78
77
  }
79
78
  return target;
80
79
  }
81
- const { colors: t } = _skincontractcssmistica.vars, V = (param)=>{
82
- let { Icon: e, children: i, dataAttributes: m, type: l = "promo", badge: n } = param;
83
- const { textPresets: d } = (0, _hooks.useTheme)(), p = (0, _themevariantcontext.useThemeVariant)(), o = n === !0 ? void 0 : n || 0;
84
- if (!i) return null;
80
+ const { colors: t } = _skincontractcssmistica.vars, C = (param)=>{
81
+ let { Icon: e, children: o, dataAttributes: c, type: m = "promo", badge: i } = param;
82
+ const { textPresets: d } = (0, _hooks.useTheme)(), l = (0, _themevariantcontext.useThemeVariant)(), a = i === !0 ? void 0 : i || 0;
83
+ if (!o) return null;
85
84
  const u = {
86
85
  // [textColor, backgroundColor]
87
86
  promo: [
@@ -95,7 +94,7 @@ const { colors: t } = _skincontractcssmistica.vars, V = (param)=>{
95
94
  inactive: [
96
95
  t.tagTextInactive,
97
96
  // TODO: remove logic for alternative variant (https://jira.tid.es/browse/WEB-1803)
98
- p === "alternative" ? t.neutralLowAlternative : t.tagBackgroundInactive
97
+ l === "alternative" ? t.neutralLowAlternative : t.tagBackgroundInactive
99
98
  ],
100
99
  success: [
101
100
  t.tagTextSuccess,
@@ -109,46 +108,43 @@ const { colors: t } = _skincontractcssmistica.vars, V = (param)=>{
109
108
  t.tagTextError,
110
109
  t.tagBackgroundError
111
110
  ]
112
- }, [s, f] = u[l];
113
- return /* @__PURE__ */ (0, _jsxruntime.jsxs)("span", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(m, "Tag")), {
114
- className: (0, _classnames.default)(_tagcssmistica.tag, (0, _sprinklescssmistica.sprinkles)({
111
+ }, [n, p] = u[m];
112
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("span", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(c, "Tag")), {
113
+ className: (0, _classnames.default)(_tagcssmistica.tag),
114
+ style: {
115
115
  paddingLeft: e ? 8 : 12,
116
- paddingRight: o !== 0 ? 8 : 12,
117
- background: f
118
- })),
116
+ paddingRight: a !== 0 ? 8 : 12,
117
+ background: p
118
+ },
119
119
  children: [
120
120
  e && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
121
121
  paddingRight: 4,
122
122
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(e, {
123
- color: s,
123
+ color: n,
124
124
  size: (0, _css.pxToRem)(16),
125
- className: (0, _sprinklescssmistica.sprinkles)({
126
- display: "block"
127
- })
125
+ className: _tagcssmistica.icon
128
126
  })
129
127
  }),
130
128
  /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
131
129
  isInverse: !1,
132
130
  children: [
133
131
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text, {
134
- color: s,
132
+ color: n,
135
133
  size: 14,
136
134
  lineHeight: 20,
137
135
  weight: d.indicator.weight,
138
136
  truncate: !0,
139
- children: i
137
+ children: o
140
138
  }),
141
- o !== 0 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
139
+ a !== 0 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
142
140
  paddingLeft: 4,
143
- className: (0, _sprinklescssmistica.sprinkles)({
144
- display: "inline-flex"
145
- }),
141
+ className: _tagcssmistica.badge,
146
142
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_badge.default, {
147
- value: o
143
+ value: a
148
144
  })
149
145
  })
150
146
  ]
151
147
  })
152
148
  ]
153
149
  }));
154
- }, I = V;
150
+ }, I = C;