@telefonica/mistica 13.5.0 → 13.6.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/css/mistica.css +1 -1
- package/dist/boxed.d.ts +6 -0
- package/dist/boxed.js +29 -18
- package/dist/card.css-mistica.js +12 -7
- package/dist/card.css.d.ts +5 -0
- package/dist/card.d.ts +40 -2
- package/dist/card.js +271 -79
- package/dist/highlighted-card.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/menu.css-mistica.js +6 -6
- package/dist/menu.css.d.ts +2 -2
- package/dist/menu.js +73 -69
- package/dist/package-version.js +1 -1
- package/dist/text.d.ts +3 -0
- package/dist/text.js +162 -119
- package/dist-es/boxed.js +30 -25
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +314 -124
- package/dist-es/highlighted-card.js +1 -1
- package/dist-es/index.js +1701 -1701
- package/dist-es/menu.css-mistica.js +5 -5
- package/dist-es/menu.js +82 -78
- package/dist-es/package-version.js +1 -1
- package/dist-es/style.css +1 -1
- package/dist-es/text.js +164 -121
- package/package.json +1 -1
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
|
|
81
|
-
import
|
|
82
|
-
import { assignInlineVars as
|
|
83
|
-
import { useIsInverseVariant as
|
|
84
|
-
import { pxToRem as
|
|
85
|
-
import { getPrefixedDataAttributes as
|
|
86
|
-
import { useTheme as
|
|
87
|
-
import { vars as
|
|
88
|
-
import { text as
|
|
89
|
-
import { jsx as
|
|
90
|
-
const
|
|
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
|
-
},
|
|
96
|
-
let { weight: e , color:
|
|
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
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
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 (!
|
|
104
|
-
const
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
}),
|
|
108
|
-
[a.mobileSize]:
|
|
109
|
-
[a.mobileLineHeight]:
|
|
110
|
-
[a.desktopSize]:
|
|
111
|
-
[a.desktopLineHeight]:
|
|
112
|
-
}),
|
|
113
|
-
[a.lineClamp]: String(
|
|
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__*/
|
|
116
|
-
className:
|
|
117
|
-
id:
|
|
118
|
-
role:
|
|
119
|
-
"aria-level":
|
|
120
|
-
},
|
|
121
|
-
style: _objectSpreadProps(_objectSpread({},
|
|
122
|
-
hyphens:
|
|
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 ?
|
|
125
|
-
textTransform:
|
|
126
|
-
textDecoration:
|
|
127
|
-
overflowWrap:
|
|
128
|
-
color:
|
|
129
|
-
textAlign:
|
|
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
|
-
}),
|
|
132
|
-
},
|
|
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
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
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:
|
|
141
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
159
|
+
desktopLineHeight: "72px"
|
|
160
|
+
})), {
|
|
161
|
+
weight: o.text10.weight,
|
|
147
162
|
dataAttributes: _objectSpread({
|
|
148
163
|
"component-name": "Text10"
|
|
149
164
|
}, e)
|
|
150
|
-
}, t));
|
|
151
|
-
},
|
|
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:
|
|
156
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
177
|
+
desktopLineHeight: "64px"
|
|
178
|
+
})), {
|
|
179
|
+
weight: o.text9.weight,
|
|
162
180
|
dataAttributes: _objectSpread({
|
|
163
181
|
"component-name": "Text9"
|
|
164
182
|
}, e)
|
|
165
|
-
}, t));
|
|
166
|
-
},
|
|
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:
|
|
171
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
195
|
+
desktopLineHeight: "56px"
|
|
196
|
+
})), {
|
|
197
|
+
weight: o.text8.weight,
|
|
177
198
|
dataAttributes: _objectSpread({
|
|
178
199
|
"component-name": "Text8"
|
|
179
200
|
}, e)
|
|
180
|
-
}, t));
|
|
181
|
-
},
|
|
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:
|
|
186
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
213
|
+
desktopLineHeight: "48px"
|
|
214
|
+
})), {
|
|
215
|
+
weight: o.text7.weight,
|
|
192
216
|
dataAttributes: _objectSpread({
|
|
193
217
|
"component-name": "Text7"
|
|
194
218
|
}, e)
|
|
195
|
-
}, t));
|
|
196
|
-
},
|
|
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:
|
|
201
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
231
|
+
desktopLineHeight: "40px"
|
|
232
|
+
})), {
|
|
233
|
+
weight: o.text6.weight,
|
|
207
234
|
dataAttributes: _objectSpread({
|
|
208
235
|
"component-name": "Text6"
|
|
209
236
|
}, e)
|
|
210
|
-
}, t));
|
|
211
|
-
},
|
|
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:
|
|
216
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
249
|
+
desktopLineHeight: "32px"
|
|
250
|
+
})), {
|
|
251
|
+
weight: o.text5.weight,
|
|
222
252
|
dataAttributes: _objectSpread({
|
|
223
253
|
"component-name": "Text5"
|
|
224
254
|
}, e)
|
|
225
|
-
}, t));
|
|
226
|
-
},
|
|
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
|
|
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
|
-
|
|
266
|
+
desktopLineHeight: "28px"
|
|
267
|
+
})), {
|
|
268
|
+
weight: l(t),
|
|
236
269
|
dataAttributes: _objectSpread({
|
|
237
270
|
"component-name": "Text4"
|
|
238
271
|
}, e)
|
|
239
|
-
}, t));
|
|
240
|
-
},
|
|
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
|
|
278
|
+
return n(r, _objectSpread(_objectSpreadProps(_objectSpread({}, s({
|
|
279
|
+
forceMobileSizes: i,
|
|
245
280
|
mobileSize: 16,
|
|
281
|
+
mobileLineHeight: "24px",
|
|
246
282
|
desktopSize: 18,
|
|
247
|
-
|
|
248
|
-
|
|
283
|
+
desktopLineHeight: "24px"
|
|
284
|
+
})), {
|
|
285
|
+
weight: l(t),
|
|
249
286
|
dataAttributes: _objectSpread({
|
|
250
287
|
"component-name": "Text3"
|
|
251
288
|
}, e)
|
|
252
|
-
}, t));
|
|
253
|
-
},
|
|
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
|
|
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
|
-
|
|
300
|
+
desktopLineHeight: "24px"
|
|
301
|
+
})), {
|
|
302
|
+
weight: l(t),
|
|
263
303
|
dataAttributes: _objectSpread({
|
|
264
304
|
"component-name": "Text2"
|
|
265
305
|
}, e)
|
|
266
|
-
}, t));
|
|
267
|
-
},
|
|
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
|
|
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
|
-
|
|
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 {
|
|
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 };
|