@vinyasa/typography 1.0.24 → 1.0.25
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/README.md +77 -2
- package/dist/cjs/caption.cjs +76 -12
- package/dist/cjs/caption.css +90 -0
- package/dist/cjs/heading.cjs +76 -12
- package/dist/cjs/heading.css +90 -0
- package/dist/cjs/highlight.cjs +700 -0
- package/dist/cjs/highlight.css +197 -0
- package/dist/cjs/index.cjs +583 -14
- package/dist/cjs/index.css +158 -0
- package/dist/cjs/label.cjs +76 -12
- package/dist/cjs/label.css +90 -0
- package/dist/cjs/link.cjs +76 -12
- package/dist/cjs/link.css +90 -0
- package/dist/cjs/list.cjs +431 -0
- package/dist/cjs/list.css +60 -0
- package/dist/cjs/mark.cjs +246 -0
- package/dist/cjs/mark.css +8 -0
- package/dist/cjs/markdown-renderer.cjs +76 -12
- package/dist/cjs/markdown-renderer.css +90 -0
- package/dist/cjs/paragraph.cjs +76 -12
- package/dist/cjs/paragraph.css +90 -0
- package/dist/cjs/text.cjs +76 -12
- package/dist/cjs/text.css +90 -0
- package/dist/esm/191.css +90 -0
- package/dist/esm/191.js +67 -11
- package/dist/esm/227.css +7 -0
- package/dist/esm/227.js +39 -0
- package/dist/esm/513.css +60 -0
- package/dist/esm/513.js +126 -0
- package/dist/esm/767.js +33 -0
- package/dist/esm/components/highlight/Highlight.d.ts +14 -0
- package/dist/esm/components/highlight/index.d.ts +1 -0
- package/dist/esm/components/list/List.css.d.ts +47 -0
- package/dist/esm/components/list/List.d.ts +52 -0
- package/dist/esm/components/list/index.d.ts +1 -0
- package/dist/esm/components/mark/Mark.css.d.ts +1 -0
- package/dist/esm/components/mark/Mark.d.ts +5 -0
- package/dist/esm/components/mark/index.d.ts +1 -0
- package/dist/esm/components/text/Text.css.d.ts +85 -1
- package/dist/esm/components/text/Text.d.ts +55 -9
- package/dist/esm/highlight.d.ts +2 -0
- package/dist/esm/highlight.js +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/list.d.ts +2 -0
- package/dist/esm/list.js +1 -0
- package/dist/esm/mark.d.ts +2 -0
- package/dist/esm/mark.js +1 -0
- package/dist/esm/useIsTruncated.d.ts +15 -0
- package/package.json +25 -5
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
default: ()=>highlight_Highlight
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const tokens_namespaceObject = require("@vinyasa/tokens");
|
|
36
|
+
const space = {
|
|
37
|
+
1: tokens_namespaceObject.themeContract.space1,
|
|
38
|
+
2: tokens_namespaceObject.themeContract.space2,
|
|
39
|
+
3: tokens_namespaceObject.themeContract.space3,
|
|
40
|
+
4: tokens_namespaceObject.themeContract.space4,
|
|
41
|
+
5: tokens_namespaceObject.themeContract.space5,
|
|
42
|
+
6: tokens_namespaceObject.themeContract.space6
|
|
43
|
+
};
|
|
44
|
+
const spacingPropertyMap = [
|
|
45
|
+
[
|
|
46
|
+
'm',
|
|
47
|
+
'margin'
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
'mx',
|
|
51
|
+
'marginInline'
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
'my',
|
|
55
|
+
'marginBlock'
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
'mt',
|
|
59
|
+
'marginTop'
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
'mr',
|
|
63
|
+
'marginRight'
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
'mb',
|
|
67
|
+
'marginBottom'
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
'ml',
|
|
71
|
+
'marginLeft'
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
'p',
|
|
75
|
+
'padding'
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
'px',
|
|
79
|
+
'paddingInline'
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
'py',
|
|
83
|
+
'paddingBlock'
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
'pt',
|
|
87
|
+
'paddingTop'
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
'pr',
|
|
91
|
+
'paddingRight'
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
'pb',
|
|
95
|
+
'paddingBottom'
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
'pl',
|
|
99
|
+
'paddingLeft'
|
|
100
|
+
]
|
|
101
|
+
];
|
|
102
|
+
const resolveSpacingStyle = (props)=>{
|
|
103
|
+
const style = {};
|
|
104
|
+
for (const [propKey, cssProperty] of spacingPropertyMap){
|
|
105
|
+
const value = props[propKey];
|
|
106
|
+
if (void 0 !== value) style[cssProperty] = space[value];
|
|
107
|
+
}
|
|
108
|
+
return style;
|
|
109
|
+
};
|
|
110
|
+
var mark = 'x8q83o0';
|
|
111
|
+
function _define_property(obj, key, value) {
|
|
112
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
113
|
+
value: value,
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true
|
|
117
|
+
});
|
|
118
|
+
else obj[key] = value;
|
|
119
|
+
return obj;
|
|
120
|
+
}
|
|
121
|
+
function _object_spread(target) {
|
|
122
|
+
for(var i = 1; i < arguments.length; i++){
|
|
123
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
124
|
+
var ownKeys = Object.keys(source);
|
|
125
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
126
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
127
|
+
}));
|
|
128
|
+
ownKeys.forEach(function(key) {
|
|
129
|
+
_define_property(target, key, source[key]);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return target;
|
|
133
|
+
}
|
|
134
|
+
function Mark_ownKeys(object, enumerableOnly) {
|
|
135
|
+
var keys = Object.keys(object);
|
|
136
|
+
if (Object.getOwnPropertySymbols) {
|
|
137
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
138
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
139
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
140
|
+
});
|
|
141
|
+
keys.push.apply(keys, symbols);
|
|
142
|
+
}
|
|
143
|
+
return keys;
|
|
144
|
+
}
|
|
145
|
+
function _object_spread_props(target, source) {
|
|
146
|
+
source = null != source ? source : {};
|
|
147
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
148
|
+
else Mark_ownKeys(Object(source)).forEach(function(key) {
|
|
149
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
150
|
+
});
|
|
151
|
+
return target;
|
|
152
|
+
}
|
|
153
|
+
function _object_without_properties(source, excluded) {
|
|
154
|
+
if (null == source) return {};
|
|
155
|
+
var target = {}, sourceKeys, key, i;
|
|
156
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
157
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
158
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
159
|
+
key = sourceKeys[i];
|
|
160
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
161
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return target;
|
|
165
|
+
}
|
|
166
|
+
target = _object_without_properties_loose(source, excluded);
|
|
167
|
+
if (Object.getOwnPropertySymbols) {
|
|
168
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
169
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
170
|
+
key = sourceKeys[i];
|
|
171
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
172
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return target;
|
|
177
|
+
}
|
|
178
|
+
function _object_without_properties_loose(source, excluded) {
|
|
179
|
+
if (null == source) return {};
|
|
180
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
181
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
182
|
+
key = sourceKeys[i];
|
|
183
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
184
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return target;
|
|
188
|
+
}
|
|
189
|
+
const Mark = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
|
|
190
|
+
let _ref = [
|
|
191
|
+
_0,
|
|
192
|
+
_1
|
|
193
|
+
], [_ref1, ..._rest] = _ref, { m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style, children } = _ref1, rest = _object_without_properties(_ref1, [
|
|
194
|
+
"m",
|
|
195
|
+
"mt",
|
|
196
|
+
"mr",
|
|
197
|
+
"mb",
|
|
198
|
+
"ml",
|
|
199
|
+
"mx",
|
|
200
|
+
"my",
|
|
201
|
+
"p",
|
|
202
|
+
"pt",
|
|
203
|
+
"pr",
|
|
204
|
+
"pb",
|
|
205
|
+
"pl",
|
|
206
|
+
"px",
|
|
207
|
+
"py",
|
|
208
|
+
"className",
|
|
209
|
+
"style",
|
|
210
|
+
"children"
|
|
211
|
+
]), [ref] = _rest;
|
|
212
|
+
const themedRef = (0, tokens_namespaceObject.useThemedRef)(ref);
|
|
213
|
+
const classes = className ? `${mark} ${className}` : mark;
|
|
214
|
+
const computedStyle = _object_spread({}, resolveSpacingStyle({
|
|
215
|
+
m,
|
|
216
|
+
mt,
|
|
217
|
+
mr,
|
|
218
|
+
mb,
|
|
219
|
+
ml,
|
|
220
|
+
mx,
|
|
221
|
+
my,
|
|
222
|
+
p,
|
|
223
|
+
pt,
|
|
224
|
+
pr,
|
|
225
|
+
pb,
|
|
226
|
+
pl,
|
|
227
|
+
px,
|
|
228
|
+
py
|
|
229
|
+
}), style);
|
|
230
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("mark", _object_spread_props(_object_spread({
|
|
231
|
+
ref: themedRef,
|
|
232
|
+
className: classes,
|
|
233
|
+
style: computedStyle
|
|
234
|
+
}, rest), {
|
|
235
|
+
children: children
|
|
236
|
+
}));
|
|
237
|
+
});
|
|
238
|
+
Mark.displayName = 'Mark';
|
|
239
|
+
const mark_Mark = Mark;
|
|
240
|
+
function toPrimitive(t, r) {
|
|
241
|
+
if ("object" != typeof t || !t) return t;
|
|
242
|
+
var e = t[Symbol.toPrimitive];
|
|
243
|
+
if (void 0 !== e) {
|
|
244
|
+
var i = e.call(t, r || "default");
|
|
245
|
+
if ("object" != typeof i) return i;
|
|
246
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
247
|
+
}
|
|
248
|
+
return ("string" === r ? String : Number)(t);
|
|
249
|
+
}
|
|
250
|
+
function toPropertyKey(t) {
|
|
251
|
+
var i = toPrimitive(t, "string");
|
|
252
|
+
return "symbol" == typeof i ? i : String(i);
|
|
253
|
+
}
|
|
254
|
+
function _defineProperty(obj, key, value) {
|
|
255
|
+
key = toPropertyKey(key);
|
|
256
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
257
|
+
value: value,
|
|
258
|
+
enumerable: true,
|
|
259
|
+
configurable: true,
|
|
260
|
+
writable: true
|
|
261
|
+
});
|
|
262
|
+
else obj[key] = value;
|
|
263
|
+
return obj;
|
|
264
|
+
}
|
|
265
|
+
function createRuntimeFn_62c9670f_esm_ownKeys(e, r) {
|
|
266
|
+
var t = Object.keys(e);
|
|
267
|
+
if (Object.getOwnPropertySymbols) {
|
|
268
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
269
|
+
r && (o = o.filter(function(r) {
|
|
270
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
271
|
+
})), t.push.apply(t, o);
|
|
272
|
+
}
|
|
273
|
+
return t;
|
|
274
|
+
}
|
|
275
|
+
function _objectSpread2(e) {
|
|
276
|
+
for(var r = 1; r < arguments.length; r++){
|
|
277
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
278
|
+
r % 2 ? createRuntimeFn_62c9670f_esm_ownKeys(Object(t), !0).forEach(function(r) {
|
|
279
|
+
_defineProperty(e, r, t[r]);
|
|
280
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : createRuntimeFn_62c9670f_esm_ownKeys(Object(t)).forEach(function(r) {
|
|
281
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return e;
|
|
285
|
+
}
|
|
286
|
+
function mapValues(input, fn) {
|
|
287
|
+
var result = {};
|
|
288
|
+
for(var _key in input)result[_key] = fn(input[_key], _key);
|
|
289
|
+
return result;
|
|
290
|
+
}
|
|
291
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants)=>{
|
|
292
|
+
for (var key of Object.keys(compoundCheck)){
|
|
293
|
+
var _selections$key;
|
|
294
|
+
if (compoundCheck[key] !== (null != (_selections$key = selections[key]) ? _selections$key : defaultVariants[key])) return false;
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
};
|
|
298
|
+
var createRuntimeFn = (config)=>{
|
|
299
|
+
var runtimeFn = (options)=>{
|
|
300
|
+
var className = config.defaultClassName;
|
|
301
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
302
|
+
for(var variantName in selections){
|
|
303
|
+
var _selections$variantNa;
|
|
304
|
+
var variantSelection = null != (_selections$variantNa = selections[variantName]) ? _selections$variantNa : config.defaultVariants[variantName];
|
|
305
|
+
if (null != variantSelection) {
|
|
306
|
+
var selection = variantSelection;
|
|
307
|
+
if ('boolean' == typeof selection) selection = true === selection ? 'true' : 'false';
|
|
308
|
+
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
309
|
+
if (selectionClassName) className += ' ' + selectionClassName;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants)if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += ' ' + compoundClassName;
|
|
313
|
+
return className;
|
|
314
|
+
};
|
|
315
|
+
runtimeFn.variants = ()=>Object.keys(config.variantClassNames);
|
|
316
|
+
runtimeFn.classNames = {
|
|
317
|
+
get base () {
|
|
318
|
+
return config.defaultClassName.split(' ')[0];
|
|
319
|
+
},
|
|
320
|
+
get variants () {
|
|
321
|
+
return mapValues(config.variantClassNames, (classNames)=>mapValues(classNames, (className)=>className.split(' ')[0]));
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
return runtimeFn;
|
|
325
|
+
};
|
|
326
|
+
var Text_css_text = createRuntimeFn({
|
|
327
|
+
defaultClassName: '_4sie9w0',
|
|
328
|
+
variantClassNames: {
|
|
329
|
+
size: {
|
|
330
|
+
xs: '_4sie9w1',
|
|
331
|
+
sm: '_4sie9w2',
|
|
332
|
+
md: '_4sie9w3',
|
|
333
|
+
lg: '_4sie9w4',
|
|
334
|
+
xl: '_4sie9w5',
|
|
335
|
+
'2xl': '_4sie9w6',
|
|
336
|
+
'3xl': '_4sie9w7',
|
|
337
|
+
'4xl': '_4sie9w8'
|
|
338
|
+
},
|
|
339
|
+
weight: {
|
|
340
|
+
regular: '_4sie9w9',
|
|
341
|
+
medium: '_4sie9wa',
|
|
342
|
+
semibold: '_4sie9wb',
|
|
343
|
+
bold: '_4sie9wc'
|
|
344
|
+
},
|
|
345
|
+
align: {
|
|
346
|
+
left: '_4sie9wd',
|
|
347
|
+
center: '_4sie9we',
|
|
348
|
+
right: '_4sie9wf'
|
|
349
|
+
},
|
|
350
|
+
color: {
|
|
351
|
+
default: '_4sie9wg',
|
|
352
|
+
muted: '_4sie9wh',
|
|
353
|
+
primary: '_4sie9wi',
|
|
354
|
+
info: '_4sie9wj',
|
|
355
|
+
success: '_4sie9wk',
|
|
356
|
+
warning: '_4sie9wl',
|
|
357
|
+
error: '_4sie9wm'
|
|
358
|
+
},
|
|
359
|
+
truncate: {
|
|
360
|
+
end: '_4sie9wn',
|
|
361
|
+
start: '_4sie9wo'
|
|
362
|
+
},
|
|
363
|
+
italic: {
|
|
364
|
+
true: '_4sie9wp'
|
|
365
|
+
},
|
|
366
|
+
textTransform: {
|
|
367
|
+
uppercase: '_4sie9wq',
|
|
368
|
+
lowercase: '_4sie9wr',
|
|
369
|
+
capitalize: '_4sie9ws',
|
|
370
|
+
none: '_4sie9wt'
|
|
371
|
+
},
|
|
372
|
+
decoration: {
|
|
373
|
+
underline: '_4sie9wu',
|
|
374
|
+
'line-through': '_4sie9wv',
|
|
375
|
+
none: '_4sie9ww'
|
|
376
|
+
},
|
|
377
|
+
letterSpacing: {
|
|
378
|
+
tight: '_4sie9wx',
|
|
379
|
+
normal: '_4sie9wy',
|
|
380
|
+
wide: '_4sie9wz'
|
|
381
|
+
},
|
|
382
|
+
lineHeight: {
|
|
383
|
+
tight: '_4sie9w10',
|
|
384
|
+
normal: '_4sie9w11',
|
|
385
|
+
loose: '_4sie9w12'
|
|
386
|
+
},
|
|
387
|
+
textWrap: {
|
|
388
|
+
wrap: '_4sie9w13',
|
|
389
|
+
balance: '_4sie9w14',
|
|
390
|
+
pretty: '_4sie9w15',
|
|
391
|
+
nowrap: '_4sie9w16'
|
|
392
|
+
},
|
|
393
|
+
variant: {
|
|
394
|
+
gradient: '_4sie9w17'
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
defaultVariants: {
|
|
398
|
+
size: 'md',
|
|
399
|
+
weight: 'regular',
|
|
400
|
+
color: 'default'
|
|
401
|
+
},
|
|
402
|
+
compoundVariants: []
|
|
403
|
+
});
|
|
404
|
+
function Text_define_property(obj, key, value) {
|
|
405
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
406
|
+
value: value,
|
|
407
|
+
enumerable: true,
|
|
408
|
+
configurable: true,
|
|
409
|
+
writable: true
|
|
410
|
+
});
|
|
411
|
+
else obj[key] = value;
|
|
412
|
+
return obj;
|
|
413
|
+
}
|
|
414
|
+
function Text_object_spread(target) {
|
|
415
|
+
for(var i = 1; i < arguments.length; i++){
|
|
416
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
417
|
+
var ownKeys = Object.keys(source);
|
|
418
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
419
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
420
|
+
}));
|
|
421
|
+
ownKeys.forEach(function(key) {
|
|
422
|
+
Text_define_property(target, key, source[key]);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
return target;
|
|
426
|
+
}
|
|
427
|
+
function Text_ownKeys(object, enumerableOnly) {
|
|
428
|
+
var keys = Object.keys(object);
|
|
429
|
+
if (Object.getOwnPropertySymbols) {
|
|
430
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
431
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
432
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
433
|
+
});
|
|
434
|
+
keys.push.apply(keys, symbols);
|
|
435
|
+
}
|
|
436
|
+
return keys;
|
|
437
|
+
}
|
|
438
|
+
function Text_object_spread_props(target, source) {
|
|
439
|
+
source = null != source ? source : {};
|
|
440
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
441
|
+
else Text_ownKeys(Object(source)).forEach(function(key) {
|
|
442
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
443
|
+
});
|
|
444
|
+
return target;
|
|
445
|
+
}
|
|
446
|
+
function Text_object_without_properties(source, excluded) {
|
|
447
|
+
if (null == source) return {};
|
|
448
|
+
var target = {}, sourceKeys, key, i;
|
|
449
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
450
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
451
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
452
|
+
key = sourceKeys[i];
|
|
453
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
454
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return target;
|
|
458
|
+
}
|
|
459
|
+
target = Text_object_without_properties_loose(source, excluded);
|
|
460
|
+
if (Object.getOwnPropertySymbols) {
|
|
461
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
462
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
463
|
+
key = sourceKeys[i];
|
|
464
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
465
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return target;
|
|
470
|
+
}
|
|
471
|
+
function Text_object_without_properties_loose(source, excluded) {
|
|
472
|
+
if (null == source) return {};
|
|
473
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
474
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
475
|
+
key = sourceKeys[i];
|
|
476
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
477
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return target;
|
|
481
|
+
}
|
|
482
|
+
const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
|
|
483
|
+
let _ref = [
|
|
484
|
+
_0,
|
|
485
|
+
_1
|
|
486
|
+
], [_ref1, ..._rest] = _ref, { as: Component = 'span', size, weight, align, color, truncate, italic, textTransform, decoration, letterSpacing, lineHeight, textWrap, variant, lineClamp, inherit, gradient, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style, children } = _ref1, rest = Text_object_without_properties(_ref1, [
|
|
487
|
+
"as",
|
|
488
|
+
"size",
|
|
489
|
+
"weight",
|
|
490
|
+
"align",
|
|
491
|
+
"color",
|
|
492
|
+
"truncate",
|
|
493
|
+
"italic",
|
|
494
|
+
"textTransform",
|
|
495
|
+
"decoration",
|
|
496
|
+
"letterSpacing",
|
|
497
|
+
"lineHeight",
|
|
498
|
+
"textWrap",
|
|
499
|
+
"variant",
|
|
500
|
+
"lineClamp",
|
|
501
|
+
"inherit",
|
|
502
|
+
"gradient",
|
|
503
|
+
"m",
|
|
504
|
+
"mt",
|
|
505
|
+
"mr",
|
|
506
|
+
"mb",
|
|
507
|
+
"ml",
|
|
508
|
+
"mx",
|
|
509
|
+
"my",
|
|
510
|
+
"p",
|
|
511
|
+
"pt",
|
|
512
|
+
"pr",
|
|
513
|
+
"pb",
|
|
514
|
+
"pl",
|
|
515
|
+
"px",
|
|
516
|
+
"py",
|
|
517
|
+
"className",
|
|
518
|
+
"style",
|
|
519
|
+
"children"
|
|
520
|
+
]), [ref] = _rest;
|
|
521
|
+
var _gradient_deg;
|
|
522
|
+
const themedRef = (0, tokens_namespaceObject.useThemedRef)(ref);
|
|
523
|
+
const normalizedTruncate = true === truncate ? 'end' : false === truncate ? void 0 : truncate;
|
|
524
|
+
const variantArgs = {
|
|
525
|
+
size,
|
|
526
|
+
weight,
|
|
527
|
+
align,
|
|
528
|
+
color,
|
|
529
|
+
truncate: normalizedTruncate,
|
|
530
|
+
italic,
|
|
531
|
+
textTransform,
|
|
532
|
+
decoration,
|
|
533
|
+
letterSpacing,
|
|
534
|
+
lineHeight,
|
|
535
|
+
textWrap,
|
|
536
|
+
variant
|
|
537
|
+
};
|
|
538
|
+
const classes = className ? `${Text_css_text(variantArgs)} ${className}` : Text_css_text(variantArgs);
|
|
539
|
+
const spacingStyle = resolveSpacingStyle({
|
|
540
|
+
m,
|
|
541
|
+
mt,
|
|
542
|
+
mr,
|
|
543
|
+
mb,
|
|
544
|
+
ml,
|
|
545
|
+
mx,
|
|
546
|
+
my,
|
|
547
|
+
p,
|
|
548
|
+
pt,
|
|
549
|
+
pr,
|
|
550
|
+
pb,
|
|
551
|
+
pl,
|
|
552
|
+
px,
|
|
553
|
+
py
|
|
554
|
+
});
|
|
555
|
+
const inheritStyle = inherit ? {
|
|
556
|
+
fontFamily: 'inherit',
|
|
557
|
+
fontSize: 'inherit',
|
|
558
|
+
fontWeight: 'inherit',
|
|
559
|
+
color: 'inherit',
|
|
560
|
+
lineHeight: 'inherit'
|
|
561
|
+
} : void 0;
|
|
562
|
+
const gradientStyle = 'gradient' === variant && gradient ? {
|
|
563
|
+
backgroundImage: `linear-gradient(${String(null != (_gradient_deg = gradient.deg) ? _gradient_deg : 45)}deg, ${gradient.from}, ${gradient.to})`
|
|
564
|
+
} : void 0;
|
|
565
|
+
const lineClampStyle = void 0 !== lineClamp ? {
|
|
566
|
+
display: '-webkit-box',
|
|
567
|
+
WebkitLineClamp: lineClamp,
|
|
568
|
+
WebkitBoxOrient: 'vertical',
|
|
569
|
+
overflow: 'hidden'
|
|
570
|
+
} : void 0;
|
|
571
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, Text_object_spread_props(Text_object_spread({
|
|
572
|
+
ref: themedRef,
|
|
573
|
+
className: classes,
|
|
574
|
+
style: Text_object_spread({}, spacingStyle, inheritStyle, gradientStyle, lineClampStyle, style)
|
|
575
|
+
}, rest), {
|
|
576
|
+
children: children
|
|
577
|
+
}));
|
|
578
|
+
});
|
|
579
|
+
Text.displayName = 'Text';
|
|
580
|
+
const text_Text = Text;
|
|
581
|
+
function Highlight_define_property(obj, key, value) {
|
|
582
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
583
|
+
value: value,
|
|
584
|
+
enumerable: true,
|
|
585
|
+
configurable: true,
|
|
586
|
+
writable: true
|
|
587
|
+
});
|
|
588
|
+
else obj[key] = value;
|
|
589
|
+
return obj;
|
|
590
|
+
}
|
|
591
|
+
function Highlight_object_spread(target) {
|
|
592
|
+
for(var i = 1; i < arguments.length; i++){
|
|
593
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
594
|
+
var ownKeys = Object.keys(source);
|
|
595
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
596
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
597
|
+
}));
|
|
598
|
+
ownKeys.forEach(function(key) {
|
|
599
|
+
Highlight_define_property(target, key, source[key]);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
return target;
|
|
603
|
+
}
|
|
604
|
+
function Highlight_ownKeys(object, enumerableOnly) {
|
|
605
|
+
var keys = Object.keys(object);
|
|
606
|
+
if (Object.getOwnPropertySymbols) {
|
|
607
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
608
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
609
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
610
|
+
});
|
|
611
|
+
keys.push.apply(keys, symbols);
|
|
612
|
+
}
|
|
613
|
+
return keys;
|
|
614
|
+
}
|
|
615
|
+
function Highlight_object_spread_props(target, source) {
|
|
616
|
+
source = null != source ? source : {};
|
|
617
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
618
|
+
else Highlight_ownKeys(Object(source)).forEach(function(key) {
|
|
619
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
620
|
+
});
|
|
621
|
+
return target;
|
|
622
|
+
}
|
|
623
|
+
function Highlight_object_without_properties(source, excluded) {
|
|
624
|
+
if (null == source) return {};
|
|
625
|
+
var target = {}, sourceKeys, key, i;
|
|
626
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
627
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
628
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
629
|
+
key = sourceKeys[i];
|
|
630
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
631
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return target;
|
|
635
|
+
}
|
|
636
|
+
target = Highlight_object_without_properties_loose(source, excluded);
|
|
637
|
+
if (Object.getOwnPropertySymbols) {
|
|
638
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
639
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
640
|
+
key = sourceKeys[i];
|
|
641
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
642
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return target;
|
|
647
|
+
}
|
|
648
|
+
function Highlight_object_without_properties_loose(source, excluded) {
|
|
649
|
+
if (null == source) return {};
|
|
650
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
651
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
652
|
+
key = sourceKeys[i];
|
|
653
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
654
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return target;
|
|
658
|
+
}
|
|
659
|
+
const escapeRegExp = (value)=>value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
660
|
+
const Highlight = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
|
|
661
|
+
let _ref = [
|
|
662
|
+
_0,
|
|
663
|
+
_1
|
|
664
|
+
], [_ref1, ..._rest] = _ref, { children, highlight } = _ref1, props = Highlight_object_without_properties(_ref1, [
|
|
665
|
+
"children",
|
|
666
|
+
"highlight"
|
|
667
|
+
]), [ref] = _rest;
|
|
668
|
+
const terms = (Array.isArray(highlight) ? highlight : [
|
|
669
|
+
highlight
|
|
670
|
+
]).filter(Boolean);
|
|
671
|
+
if (0 === terms.length) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(text_Text, Highlight_object_spread_props(Highlight_object_spread({
|
|
672
|
+
ref: ref
|
|
673
|
+
}, props), {
|
|
674
|
+
children: children
|
|
675
|
+
}));
|
|
676
|
+
const lowerTerms = new Set(terms.map((term)=>term.toLowerCase()));
|
|
677
|
+
const pattern = new RegExp(`(${terms.map(escapeRegExp).join('|')})`, 'gi');
|
|
678
|
+
const parts = children.split(pattern);
|
|
679
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(text_Text, Highlight_object_spread_props(Highlight_object_spread({
|
|
680
|
+
ref: ref
|
|
681
|
+
}, props), {
|
|
682
|
+
children: parts.map((part, index)=>{
|
|
683
|
+
const key = `${String(index)}-${part}`;
|
|
684
|
+
return lowerTerms.has(part.toLowerCase()) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(mark_Mark, {
|
|
685
|
+
children: part
|
|
686
|
+
}, key) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment, {
|
|
687
|
+
children: part
|
|
688
|
+
}, key);
|
|
689
|
+
})
|
|
690
|
+
}));
|
|
691
|
+
});
|
|
692
|
+
Highlight.displayName = 'Highlight';
|
|
693
|
+
const highlight_Highlight = Highlight;
|
|
694
|
+
exports["default"] = __webpack_exports__["default"];
|
|
695
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
696
|
+
"default"
|
|
697
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
698
|
+
Object.defineProperty(exports, '__esModule', {
|
|
699
|
+
value: true
|
|
700
|
+
});
|