@telefonica/mistica 13.5.0 → 13.6.1

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-es/text.js CHANGED
@@ -77,206 +77,249 @@ function _objectWithoutPropertiesLoose(source, excluded) {
77
77
  }
78
78
  return target;
79
79
  }
80
- import * as O from "react";
81
- import R from "classnames";
82
- import { assignInlineVars as k } from "@vanilla-extract/dynamic";
83
- import { useIsInverseVariant as j } from "./theme-variant-context.js";
84
- import { pxToRem as x } from "./utils/css.js";
85
- import { getPrefixedDataAttributes as B } from "./utils/dom.js";
86
- import { useTheme as m } from "./hooks.js";
87
- import { vars as r } from "./skins/skin-contract.css-mistica.js";
88
- import { text as E, withWordBreak as N, withoutWordBreak as $, truncateToOneLine as q, truncateToMoreThanOneLine as F, vars as a } from "./text.css-mistica.js";
89
- import { jsx as o } from "./_virtual/jsx-runtime.js";
90
- const G = {
80
+ import * as j from "react";
81
+ import B from "classnames";
82
+ import { assignInlineVars as f } from "@vanilla-extract/dynamic";
83
+ import { useIsInverseVariant as E } from "./theme-variant-context.js";
84
+ import { pxToRem as p } from "./utils/css.js";
85
+ import { getPrefixedDataAttributes as N } from "./utils/dom.js";
86
+ import { useTheme as x } from "./hooks.js";
87
+ import { vars as m } from "./skins/skin-contract.css-mistica.js";
88
+ import { text as $, withWordBreak as q, withoutWordBreak as F, truncateToOneLine as G, truncateToMoreThanOneLine as J, vars as a } from "./text.css-mistica.js";
89
+ import { jsx as n } from "./_virtual/jsx-runtime.js";
90
+ const K = {
91
91
  light: 300,
92
92
  regular: 400,
93
93
  medium: 500,
94
94
  bold: 700
95
- }, J = (e)=>e === !0 ? 1 : e || "initial", n = (param)=>{
96
- let { weight: e , color: t = r.colors.textPrimary , decoration: i , truncate: s , transform: L , wordBreak: g = !0 , hyphens: f , as: z = "span" , children: l , size: h , mobileSize: c = h , desktopSize: u = h , lineHeight: d , mobileLineHeight: b = d , desktopLineHeight: T = d , letterSpacing: w , textAlign: H , id: v , role: A , "aria-level": P , dataAttributes: y } = param;
95
+ }, Q = (e)=>e === !0 ? 1 : e || "initial", r = (param)=>{
96
+ let { weight: e , color: i = m.colors.textPrimary , decoration: t , truncate: o , transform: g , wordBreak: c = !0 , hyphens: z , as: H = "span" , children: h , size: u , mobileSize: d = u , desktopSize: b = u , lineHeight: T , mobileLineHeight: k = T , desktopLineHeight: L = T , letterSpacing: w , textAlign: v , textShadow: A , id: P , role: y , "aria-level": I , dataAttributes: W } = param;
97
97
  var S;
98
- const I = j(), W = J(s), V = {
99
- [r.colors.textPrimary]: r.colors.textPrimaryInverse,
100
- [r.colors.textSecondary]: r.colors.textSecondaryInverse,
101
- [r.colors.textLink]: r.colors.textLinkInverse
98
+ const V = E(), C = Q(o), D = {
99
+ [m.colors.textPrimary]: m.colors.textPrimaryInverse,
100
+ [m.colors.textSecondary]: m.colors.textSecondaryInverse,
101
+ [m.colors.textLink]: m.colors.textLinkInverse
102
102
  };
103
- if (!l && l !== 0) return null;
104
- const C = R(E, g ? N : $, {
105
- [q]: s === 1 || s === !0,
106
- [F]: s && s > 1
107
- }), D = k({
108
- [a.mobileSize]: c ? x(c) : "",
109
- [a.mobileLineHeight]: b ? x(b) : "",
110
- [a.desktopSize]: u ? x(u) : "",
111
- [a.desktopLineHeight]: T ? x(T) : ""
112
- }), M = s ? k({
113
- [a.lineClamp]: String(W)
103
+ if (!h && h !== 0) return null;
104
+ const M = B($, c ? q : F, {
105
+ [G]: o === 1 || o === !0,
106
+ [J]: o && o > 1
107
+ }), O = f({
108
+ [a.mobileSize]: d ? p(d) : "",
109
+ [a.mobileLineHeight]: k ? p(k) : "",
110
+ [a.desktopSize]: b ? p(b) : "",
111
+ [a.desktopLineHeight]: L ? p(L) : ""
112
+ }), R = o ? f({
113
+ [a.lineClamp]: String(C)
114
114
  }) : {};
115
- return /*#__PURE__*/ O.createElement(z, _objectSpreadProps(_objectSpread({
116
- className: C,
117
- id: v,
118
- role: A,
119
- "aria-level": P
120
- }, B(y)), {
121
- style: _objectSpreadProps(_objectSpread({}, D, M), {
122
- hyphens: f,
115
+ return /*#__PURE__*/ j.createElement(H, _objectSpreadProps(_objectSpread({
116
+ className: M,
117
+ id: P,
118
+ role: y,
119
+ "aria-level": I
120
+ }, N(W)), {
121
+ style: _objectSpreadProps(_objectSpread({}, O, R), {
122
+ hyphens: z,
123
123
  letterSpacing: w,
124
- fontWeight: e ? G[e] : "inherit",
125
- textTransform: L || "inherit",
126
- textDecoration: i != null ? i : "inherit",
127
- overflowWrap: g ? "anywhere" : "inherit",
128
- color: I && (S = V[t]) != null ? S : t,
129
- textAlign: H
124
+ fontWeight: e ? K[e] : "inherit",
125
+ textTransform: g || "inherit",
126
+ textDecoration: t != null ? t : "inherit",
127
+ overflowWrap: c ? "anywhere" : "inherit",
128
+ color: V && (S = D[i]) != null ? S : i,
129
+ textAlign: v,
130
+ textShadow: A
130
131
  })
131
- }), l);
132
- }, p = (e)=>{
132
+ }), h);
133
+ }, l = (e)=>{
133
134
  if (e.light) return "light";
134
135
  if (e.regular) return "regular";
135
136
  if (e.medium) return "medium";
136
- }, ie = (_param)=>{
137
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
138
- "dataAttributes"
137
+ }, s = (param)=>{
138
+ let { forceMobileSizes: e , mobileSize: i , mobileLineHeight: t , desktopSize: o , desktopLineHeight: g } = param;
139
+ return e ? {
140
+ size: i,
141
+ lineHeight: t
142
+ } : {
143
+ mobileSize: i,
144
+ mobileLineHeight: t,
145
+ desktopSize: o,
146
+ desktopLineHeight: g
147
+ };
148
+ }, ne = (_param)=>{
149
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
150
+ "dataAttributes",
151
+ "forceMobileSizes"
139
152
  ]);
140
- const { textPresets: i } = m();
141
- return /* @__PURE__ */ o(n, _objectSpread({
153
+ const { textPresets: o } = x();
154
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
155
+ forceMobileSizes: i,
142
156
  mobileSize: 48,
143
157
  mobileLineHeight: "56px",
144
158
  desktopSize: 64,
145
- desktopLineHeight: "72px",
146
- weight: i.text10.weight,
159
+ desktopLineHeight: "72px"
160
+ })), {
161
+ weight: o.text10.weight,
147
162
  dataAttributes: _objectSpread({
148
163
  "component-name": "Text10"
149
164
  }, e)
150
- }, t));
151
- }, oe = (_param)=>{
152
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
153
- "dataAttributes"
165
+ }), t));
166
+ }, re = (_param)=>{
167
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
168
+ "dataAttributes",
169
+ "forceMobileSizes"
154
170
  ]);
155
- const { textPresets: i } = m();
156
- return /* @__PURE__ */ o(n, _objectSpread({
171
+ const { textPresets: o } = x();
172
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
173
+ forceMobileSizes: i,
157
174
  mobileSize: 40,
158
175
  mobileLineHeight: "48px",
159
176
  desktopSize: 56,
160
- desktopLineHeight: "64px",
161
- weight: i.text9.weight,
177
+ desktopLineHeight: "64px"
178
+ })), {
179
+ weight: o.text9.weight,
162
180
  dataAttributes: _objectSpread({
163
181
  "component-name": "Text9"
164
182
  }, e)
165
- }, t));
166
- }, ne = (_param)=>{
167
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
168
- "dataAttributes"
183
+ }), t));
184
+ }, se = (_param)=>{
185
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
186
+ "dataAttributes",
187
+ "forceMobileSizes"
169
188
  ]);
170
- const { textPresets: i } = m();
171
- return /* @__PURE__ */ o(n, _objectSpread({
189
+ const { textPresets: o } = x();
190
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
191
+ forceMobileSizes: i,
172
192
  mobileSize: 32,
173
193
  mobileLineHeight: "40px",
174
194
  desktopSize: 48,
175
- desktopLineHeight: "56px",
176
- weight: i.text8.weight,
195
+ desktopLineHeight: "56px"
196
+ })), {
197
+ weight: o.text8.weight,
177
198
  dataAttributes: _objectSpread({
178
199
  "component-name": "Text8"
179
200
  }, e)
180
- }, t));
181
- }, re = (_param)=>{
182
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
183
- "dataAttributes"
201
+ }), t));
202
+ }, me = (_param)=>{
203
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
204
+ "dataAttributes",
205
+ "forceMobileSizes"
184
206
  ]);
185
- const { textPresets: i } = m();
186
- return /* @__PURE__ */ o(n, _objectSpread({
207
+ const { textPresets: o } = x();
208
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
209
+ forceMobileSizes: i,
187
210
  mobileSize: 28,
188
211
  mobileLineHeight: "32px",
189
212
  desktopSize: 40,
190
- desktopLineHeight: "48px",
191
- weight: i.text7.weight,
213
+ desktopLineHeight: "48px"
214
+ })), {
215
+ weight: o.text7.weight,
192
216
  dataAttributes: _objectSpread({
193
217
  "component-name": "Text7"
194
218
  }, e)
195
- }, t));
196
- }, se = (_param)=>{
197
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
198
- "dataAttributes"
219
+ }), t));
220
+ }, xe = (_param)=>{
221
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
222
+ "dataAttributes",
223
+ "forceMobileSizes"
199
224
  ]);
200
- const { textPresets: i } = m();
201
- return /* @__PURE__ */ o(n, _objectSpread({
225
+ const { textPresets: o } = x();
226
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
227
+ forceMobileSizes: i,
202
228
  mobileSize: 24,
203
229
  mobileLineHeight: "32px",
204
230
  desktopSize: 32,
205
- desktopLineHeight: "40px",
206
- weight: i.text6.weight,
231
+ desktopLineHeight: "40px"
232
+ })), {
233
+ weight: o.text6.weight,
207
234
  dataAttributes: _objectSpread({
208
235
  "component-name": "Text6"
209
236
  }, e)
210
- }, t));
211
- }, me = (_param)=>{
212
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
213
- "dataAttributes"
237
+ }), t));
238
+ }, ae = (_param)=>{
239
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
240
+ "dataAttributes",
241
+ "forceMobileSizes"
214
242
  ]);
215
- const { textPresets: i } = m();
216
- return /* @__PURE__ */ o(n, _objectSpread({
243
+ const { textPresets: o } = x();
244
+ return /* @__PURE__ */ n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
245
+ forceMobileSizes: i,
217
246
  mobileSize: 20,
218
247
  mobileLineHeight: "24px",
219
248
  desktopSize: 28,
220
- desktopLineHeight: "32px",
221
- weight: i.text5.weight,
249
+ desktopLineHeight: "32px"
250
+ })), {
251
+ weight: o.text5.weight,
222
252
  dataAttributes: _objectSpread({
223
253
  "component-name": "Text5"
224
254
  }, e)
225
- }, t));
226
- }, ae = (_param)=>/* @__PURE__ */ {
227
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
228
- "dataAttributes"
255
+ }), t));
256
+ }, pe = (_param)=>/* @__PURE__ */ {
257
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
258
+ "dataAttributes",
259
+ "forceMobileSizes"
229
260
  ]);
230
- return o(n, _objectSpread({
261
+ return n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
262
+ forceMobileSizes: i,
231
263
  mobileSize: 18,
232
264
  mobileLineHeight: "24px",
233
265
  desktopSize: 20,
234
- desktopLineHeight: "28px",
235
- weight: p(t),
266
+ desktopLineHeight: "28px"
267
+ })), {
268
+ weight: l(t),
236
269
  dataAttributes: _objectSpread({
237
270
  "component-name": "Text4"
238
271
  }, e)
239
- }, t));
240
- }, xe = (_param)=>/* @__PURE__ */ {
241
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
242
- "dataAttributes"
272
+ }), t));
273
+ }, le = (_param)=>/* @__PURE__ */ {
274
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
275
+ "dataAttributes",
276
+ "forceMobileSizes"
243
277
  ]);
244
- return o(n, _objectSpread({
278
+ return n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
279
+ forceMobileSizes: i,
245
280
  mobileSize: 16,
281
+ mobileLineHeight: "24px",
246
282
  desktopSize: 18,
247
- lineHeight: "24px",
248
- weight: p(t),
283
+ desktopLineHeight: "24px"
284
+ })), {
285
+ weight: l(t),
249
286
  dataAttributes: _objectSpread({
250
287
  "component-name": "Text3"
251
288
  }, e)
252
- }, t));
253
- }, pe = (_param)=>/* @__PURE__ */ {
254
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
255
- "dataAttributes"
289
+ }), t));
290
+ }, ge = (_param)=>/* @__PURE__ */ {
291
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
292
+ "dataAttributes",
293
+ "forceMobileSizes"
256
294
  ]);
257
- return o(n, _objectSpread({
295
+ return n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
296
+ forceMobileSizes: i,
258
297
  mobileSize: 14,
259
298
  mobileLineHeight: "20px",
260
299
  desktopSize: 16,
261
- desktopLineHeight: "24px",
262
- weight: p(t),
300
+ desktopLineHeight: "24px"
301
+ })), {
302
+ weight: l(t),
263
303
  dataAttributes: _objectSpread({
264
304
  "component-name": "Text2"
265
305
  }, e)
266
- }, t));
267
- }, le = (_param)=>/* @__PURE__ */ {
268
- var { dataAttributes: e } = _param, t = _objectWithoutProperties(_param, [
269
- "dataAttributes"
306
+ }), t));
307
+ }, he = (_param)=>/* @__PURE__ */ {
308
+ var { dataAttributes: e , forceMobileSizes: i } = _param, t = _objectWithoutProperties(_param, [
309
+ "dataAttributes",
310
+ "forceMobileSizes"
270
311
  ]);
271
- return o(n, _objectSpread({
312
+ return n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
313
+ forceMobileSizes: i,
272
314
  mobileSize: 12,
273
315
  mobileLineHeight: "16px",
274
316
  desktopSize: 14,
275
- desktopLineHeight: "20px",
276
- weight: p(t),
317
+ desktopLineHeight: "20px"
318
+ })), {
319
+ weight: l(t),
277
320
  dataAttributes: _objectSpread({
278
321
  "component-name": "Text1"
279
322
  }, e)
280
- }, t));
323
+ }), t));
281
324
  };
282
- export { n as Text, le as Text1, ie as Text10, pe as Text2, xe as Text3, ae as Text4, me as Text5, se as Text6, re as Text7, ne as Text8, oe as Text9, n as default };
325
+ export { r as Text, he as Text1, ne as Text10, ge as Text2, le as Text3, pe as Text4, ae as Text5, xe as Text6, me as Text7, se as Text8, re as Text9, r as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "13.5.0",
3
+ "version": "13.6.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",