@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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vinyasa/typography
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
13 typography primitives: Text, Heading, Paragraph, Label, Caption, Link, Code, Kbd, Blockquote, Mark, Highlight, List, MarkdownRenderer.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -39,7 +39,44 @@ The one real recipe every other component in this package builds on.
|
|
|
39
39
|
</Text>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`size`: `xs`/`sm`/`md`/`lg`/`xl`/`2xl`/`3xl`/`4xl`. `weight`: `regular`/`medium`/`semibold`/`bold`. `align`: `left`/`center`/`right`. `color`: `default`/`muted`/`primary`/`error`.
|
|
42
|
+
`size`: `xs`/`sm`/`md`/`lg`/`xl`/`2xl`/`3xl`/`4xl`. `weight`: `regular`/`medium`/`semibold`/`bold`. `align`: `left`/`center`/`right`. `color`: `default`/`muted`/`primary`/`info`/`success`/`warning`/`error`.
|
|
43
|
+
|
|
44
|
+
Other props: `italic` (boolean), `textTransform` (`uppercase`/`lowercase`/`capitalize`/`none`), `decoration` (`underline`/`line-through`/`none`), `letterSpacing`/`lineHeight` (`tight`/`normal`/`wide` and `tight`/`normal`/`loose` respectively, off the shared spacing tokens), `textWrap` (`wrap`/`balance`/`pretty`/`nowrap`), `lineClamp` (number of lines before an ellipsis), `inherit` (boolean — skip Text's own font-size/weight/color/line-height and pick up the closest styled ancestor's instead), and `variant="gradient"` + `gradient={{ from, to, deg? }}` for gradient text.
|
|
45
|
+
|
|
46
|
+
`truncate`: `boolean | 'start' | 'end'` — `true` is an alias for `'end'` (clips the end with an ellipsis); `'start'` clips the beginning instead, for cases like a long file path where the filename at the end matters most.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<Text truncate="start" style={{ width: '12rem' }}>
|
|
50
|
+
/Users/rohit/projects/vinyasa/report-final.pdf
|
|
51
|
+
</Text>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Showing the full text on hover when truncated
|
|
55
|
+
|
|
56
|
+
`truncate`/`lineClamp` only clip visually — they don't add any hover affordance on their own. Pair `Text` with `@vinyasa/typography`'s `useIsTruncated` hook and `@vinyasa/overlay`'s `Tooltip` to show the full content only when it's actually overflowing, not on every hover:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { Text, useIsTruncated } from '@vinyasa/typography';
|
|
60
|
+
import { Tooltip } from '@vinyasa/overlay';
|
|
61
|
+
import { useState } from 'react';
|
|
62
|
+
|
|
63
|
+
const TruncatedLabel = ({ text }: { text: string }) => {
|
|
64
|
+
const [ref, isTruncated] = useIsTruncated<HTMLSpanElement>([text]);
|
|
65
|
+
const [open, setOpen] = useState(false);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Tooltip label={text} open={isTruncated && open} onOpenChange={setOpen}>
|
|
69
|
+
<Text ref={ref} truncate="end" style={{ maxWidth: '12rem' }}>
|
|
70
|
+
{text}
|
|
71
|
+
</Text>
|
|
72
|
+
</Tooltip>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`useIsTruncated` returns a ref (attach it to the truncated element) and a boolean, re-checked on every resize of that element via `ResizeObserver`. Pass the truncated content itself as the hook's `deps` argument (as above) so a content change with no resize still re-checks. `@vinyasa/typography` itself stays free of any dependency on `@vinyasa/overlay` — the hook only measures overflow; wiring it to a `Tooltip` is left to the consumer, same as this example.
|
|
78
|
+
|
|
79
|
+
`Tooltip` stays mounted unconditionally, with `open` mirrored into local state via `onOpenChange` and forced closed whenever `isTruncated` is false — conditionally rendering the `Tooltip` wrapper only once truncated would remount `Text`'s DOM node (it moves one level deeper, under `Tooltip.Trigger`'s Slot), detaching `useIsTruncated`'s `ResizeObserver` from the live element in the process.
|
|
43
80
|
|
|
44
81
|
### Heading
|
|
45
82
|
|
|
@@ -90,6 +127,44 @@ Real anchor props (`href`, `target`, `rel`), plus `size`/`weight`/`truncate` fro
|
|
|
90
127
|
<Blockquote>Design is not just what it looks like. Design is how it works.</Blockquote>
|
|
91
128
|
```
|
|
92
129
|
|
|
130
|
+
### Mark
|
|
131
|
+
|
|
132
|
+
Native `<mark>`, styled off the existing `statusWarning` tokens (no new tokens needed).
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
<Text>
|
|
136
|
+
The quick brown fox <Mark>jumps over</Mark> the lazy dog.
|
|
137
|
+
</Text>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Highlight
|
|
141
|
+
|
|
142
|
+
Wraps every case-insensitive occurrence of `highlight` in `Mark`. `highlight` takes one term or a list. `children` must be a plain string — rich content can't be reliably split and re-wrapped.
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
<Highlight highlight={['React', 'vanilla-extract']}>
|
|
146
|
+
This design system is built with React and vanilla-extract
|
|
147
|
+
</Highlight>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### List
|
|
151
|
+
|
|
152
|
+
`List`/`List.Item` — no simple non-compound form, since composing `.Item` children _is_ the natural simple form for a list.
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
<List type="ordered" spacing={2}>
|
|
156
|
+
<List.Item>Write the contract</List.Item>
|
|
157
|
+
<List.Item>Stabilize tokens and layout</List.Item>
|
|
158
|
+
</List>
|
|
159
|
+
|
|
160
|
+
<List icon={<CheckIcon />} withPadding={false}>
|
|
161
|
+
<List.Item>Consistent spacing scale</List.Item>
|
|
162
|
+
<List.Item icon={<WarningIcon />}>One item with its own override icon</List.Item>
|
|
163
|
+
</List>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`type`: `unordered` (default, `<ul>`) / `ordered` (`<ol>`). `icon` on `List` sets every item's default icon; an item's own `icon` overrides it. `withPadding` (default `true`) keeps the browser's list indent — turn it off once every item has an `icon`, which already replaces the native marker.
|
|
167
|
+
|
|
93
168
|
### MarkdownRenderer
|
|
94
169
|
|
|
95
170
|
Wraps [`react-markdown`](https://github.com/remarkjs/react-markdown), mapping every markdown element to this package's own components (headings → `Heading`, paragraphs → `Paragraph`, links → `Link`, code → `Code`, blockquotes → `Blockquote`) so rendered markdown automatically picks up your theme.
|
package/dist/cjs/caption.cjs
CHANGED
|
@@ -227,7 +227,41 @@ var Text_css_text = createRuntimeFn({
|
|
|
227
227
|
error: '_4sie9wm'
|
|
228
228
|
},
|
|
229
229
|
truncate: {
|
|
230
|
-
|
|
230
|
+
end: '_4sie9wn',
|
|
231
|
+
start: '_4sie9wo'
|
|
232
|
+
},
|
|
233
|
+
italic: {
|
|
234
|
+
true: '_4sie9wp'
|
|
235
|
+
},
|
|
236
|
+
textTransform: {
|
|
237
|
+
uppercase: '_4sie9wq',
|
|
238
|
+
lowercase: '_4sie9wr',
|
|
239
|
+
capitalize: '_4sie9ws',
|
|
240
|
+
none: '_4sie9wt'
|
|
241
|
+
},
|
|
242
|
+
decoration: {
|
|
243
|
+
underline: '_4sie9wu',
|
|
244
|
+
'line-through': '_4sie9wv',
|
|
245
|
+
none: '_4sie9ww'
|
|
246
|
+
},
|
|
247
|
+
letterSpacing: {
|
|
248
|
+
tight: '_4sie9wx',
|
|
249
|
+
normal: '_4sie9wy',
|
|
250
|
+
wide: '_4sie9wz'
|
|
251
|
+
},
|
|
252
|
+
lineHeight: {
|
|
253
|
+
tight: '_4sie9w10',
|
|
254
|
+
normal: '_4sie9w11',
|
|
255
|
+
loose: '_4sie9w12'
|
|
256
|
+
},
|
|
257
|
+
textWrap: {
|
|
258
|
+
wrap: '_4sie9w13',
|
|
259
|
+
balance: '_4sie9w14',
|
|
260
|
+
pretty: '_4sie9w15',
|
|
261
|
+
nowrap: '_4sie9w16'
|
|
262
|
+
},
|
|
263
|
+
variant: {
|
|
264
|
+
gradient: '_4sie9w17'
|
|
231
265
|
}
|
|
232
266
|
},
|
|
233
267
|
defaultVariants: {
|
|
@@ -319,13 +353,23 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
319
353
|
let _ref = [
|
|
320
354
|
_0,
|
|
321
355
|
_1
|
|
322
|
-
], [_ref1, ..._rest] = _ref, { as: Component = 'span', size, weight, align, color, truncate, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style, children } = _ref1, rest = _object_without_properties(_ref1, [
|
|
356
|
+
], [_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 = _object_without_properties(_ref1, [
|
|
323
357
|
"as",
|
|
324
358
|
"size",
|
|
325
359
|
"weight",
|
|
326
360
|
"align",
|
|
327
361
|
"color",
|
|
328
362
|
"truncate",
|
|
363
|
+
"italic",
|
|
364
|
+
"textTransform",
|
|
365
|
+
"decoration",
|
|
366
|
+
"letterSpacing",
|
|
367
|
+
"lineHeight",
|
|
368
|
+
"textWrap",
|
|
369
|
+
"variant",
|
|
370
|
+
"lineClamp",
|
|
371
|
+
"inherit",
|
|
372
|
+
"gradient",
|
|
329
373
|
"m",
|
|
330
374
|
"mt",
|
|
331
375
|
"mr",
|
|
@@ -344,20 +388,24 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
344
388
|
"style",
|
|
345
389
|
"children"
|
|
346
390
|
]), [ref] = _rest;
|
|
391
|
+
var _gradient_deg;
|
|
347
392
|
const themedRef = (0, tokens_namespaceObject.useThemedRef)(ref);
|
|
348
|
-
const
|
|
393
|
+
const normalizedTruncate = true === truncate ? 'end' : false === truncate ? void 0 : truncate;
|
|
394
|
+
const variantArgs = {
|
|
349
395
|
size,
|
|
350
396
|
weight,
|
|
351
397
|
align,
|
|
352
398
|
color,
|
|
353
|
-
truncate
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
399
|
+
truncate: normalizedTruncate,
|
|
400
|
+
italic,
|
|
401
|
+
textTransform,
|
|
402
|
+
decoration,
|
|
403
|
+
letterSpacing,
|
|
404
|
+
lineHeight,
|
|
405
|
+
textWrap,
|
|
406
|
+
variant
|
|
407
|
+
};
|
|
408
|
+
const classes = className ? `${Text_css_text(variantArgs)} ${className}` : Text_css_text(variantArgs);
|
|
361
409
|
const spacingStyle = resolveSpacingStyle({
|
|
362
410
|
m,
|
|
363
411
|
mt,
|
|
@@ -374,10 +422,26 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
374
422
|
px,
|
|
375
423
|
py
|
|
376
424
|
});
|
|
425
|
+
const inheritStyle = inherit ? {
|
|
426
|
+
fontFamily: 'inherit',
|
|
427
|
+
fontSize: 'inherit',
|
|
428
|
+
fontWeight: 'inherit',
|
|
429
|
+
color: 'inherit',
|
|
430
|
+
lineHeight: 'inherit'
|
|
431
|
+
} : void 0;
|
|
432
|
+
const gradientStyle = 'gradient' === variant && gradient ? {
|
|
433
|
+
backgroundImage: `linear-gradient(${String(null != (_gradient_deg = gradient.deg) ? _gradient_deg : 45)}deg, ${gradient.from}, ${gradient.to})`
|
|
434
|
+
} : void 0;
|
|
435
|
+
const lineClampStyle = void 0 !== lineClamp ? {
|
|
436
|
+
display: '-webkit-box',
|
|
437
|
+
WebkitLineClamp: lineClamp,
|
|
438
|
+
WebkitBoxOrient: 'vertical',
|
|
439
|
+
overflow: 'hidden'
|
|
440
|
+
} : void 0;
|
|
377
441
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, _object_spread_props(_object_spread({
|
|
378
442
|
ref: themedRef,
|
|
379
443
|
className: classes,
|
|
380
|
-
style: _object_spread({}, spacingStyle, style)
|
|
444
|
+
style: _object_spread({}, spacingStyle, inheritStyle, gradientStyle, lineClampStyle, style)
|
|
381
445
|
}, rest), {
|
|
382
446
|
children: children
|
|
383
447
|
}));
|
package/dist/cjs/caption.css
CHANGED
|
@@ -94,6 +94,96 @@
|
|
|
94
94
|
._4sie9wn {
|
|
95
95
|
text-overflow: ellipsis;
|
|
96
96
|
white-space: nowrap;
|
|
97
|
+
max-width: 100%;
|
|
98
|
+
display: inline-block;
|
|
97
99
|
overflow: hidden;
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
._4sie9wo {
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
text-align: left;
|
|
106
|
+
direction: rtl;
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
display: inline-block;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
._4sie9wp {
|
|
113
|
+
font-style: italic;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
._4sie9wq {
|
|
117
|
+
text-transform: uppercase;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
._4sie9wr {
|
|
121
|
+
text-transform: lowercase;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
._4sie9ws {
|
|
125
|
+
text-transform: capitalize;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
._4sie9wt {
|
|
129
|
+
text-transform: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
._4sie9wu {
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
._4sie9wv {
|
|
137
|
+
text-decoration: line-through;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
._4sie9ww {
|
|
141
|
+
text-decoration: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
._4sie9wx {
|
|
145
|
+
letter-spacing: var(--vinyasa-letter-spacing-tight);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
._4sie9wy {
|
|
149
|
+
letter-spacing: var(--vinyasa-letter-spacing-normal);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
._4sie9wz {
|
|
153
|
+
letter-spacing: var(--vinyasa-letter-spacing-wide);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
._4sie9w10 {
|
|
157
|
+
line-height: var(--vinyasa-line-height-tight);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
._4sie9w11 {
|
|
161
|
+
line-height: var(--vinyasa-line-height-normal);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
._4sie9w12 {
|
|
165
|
+
line-height: var(--vinyasa-line-height-loose);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
._4sie9w13 {
|
|
169
|
+
text-wrap: wrap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
._4sie9w14 {
|
|
173
|
+
text-wrap: balance;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
._4sie9w15 {
|
|
177
|
+
text-wrap: pretty;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
._4sie9w16 {
|
|
181
|
+
text-wrap: nowrap;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
._4sie9w17 {
|
|
185
|
+
color: rgba(0, 0, 0, 0);
|
|
186
|
+
-webkit-background-clip: text;
|
|
187
|
+
background-clip: text;
|
|
188
|
+
}
|
|
189
|
+
|
package/dist/cjs/heading.cjs
CHANGED
|
@@ -227,7 +227,41 @@ var Text_css_text = createRuntimeFn({
|
|
|
227
227
|
error: '_4sie9wm'
|
|
228
228
|
},
|
|
229
229
|
truncate: {
|
|
230
|
-
|
|
230
|
+
end: '_4sie9wn',
|
|
231
|
+
start: '_4sie9wo'
|
|
232
|
+
},
|
|
233
|
+
italic: {
|
|
234
|
+
true: '_4sie9wp'
|
|
235
|
+
},
|
|
236
|
+
textTransform: {
|
|
237
|
+
uppercase: '_4sie9wq',
|
|
238
|
+
lowercase: '_4sie9wr',
|
|
239
|
+
capitalize: '_4sie9ws',
|
|
240
|
+
none: '_4sie9wt'
|
|
241
|
+
},
|
|
242
|
+
decoration: {
|
|
243
|
+
underline: '_4sie9wu',
|
|
244
|
+
'line-through': '_4sie9wv',
|
|
245
|
+
none: '_4sie9ww'
|
|
246
|
+
},
|
|
247
|
+
letterSpacing: {
|
|
248
|
+
tight: '_4sie9wx',
|
|
249
|
+
normal: '_4sie9wy',
|
|
250
|
+
wide: '_4sie9wz'
|
|
251
|
+
},
|
|
252
|
+
lineHeight: {
|
|
253
|
+
tight: '_4sie9w10',
|
|
254
|
+
normal: '_4sie9w11',
|
|
255
|
+
loose: '_4sie9w12'
|
|
256
|
+
},
|
|
257
|
+
textWrap: {
|
|
258
|
+
wrap: '_4sie9w13',
|
|
259
|
+
balance: '_4sie9w14',
|
|
260
|
+
pretty: '_4sie9w15',
|
|
261
|
+
nowrap: '_4sie9w16'
|
|
262
|
+
},
|
|
263
|
+
variant: {
|
|
264
|
+
gradient: '_4sie9w17'
|
|
231
265
|
}
|
|
232
266
|
},
|
|
233
267
|
defaultVariants: {
|
|
@@ -319,13 +353,23 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
319
353
|
let _ref = [
|
|
320
354
|
_0,
|
|
321
355
|
_1
|
|
322
|
-
], [_ref1, ..._rest] = _ref, { as: Component = 'span', size, weight, align, color, truncate, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style, children } = _ref1, rest = _object_without_properties(_ref1, [
|
|
356
|
+
], [_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 = _object_without_properties(_ref1, [
|
|
323
357
|
"as",
|
|
324
358
|
"size",
|
|
325
359
|
"weight",
|
|
326
360
|
"align",
|
|
327
361
|
"color",
|
|
328
362
|
"truncate",
|
|
363
|
+
"italic",
|
|
364
|
+
"textTransform",
|
|
365
|
+
"decoration",
|
|
366
|
+
"letterSpacing",
|
|
367
|
+
"lineHeight",
|
|
368
|
+
"textWrap",
|
|
369
|
+
"variant",
|
|
370
|
+
"lineClamp",
|
|
371
|
+
"inherit",
|
|
372
|
+
"gradient",
|
|
329
373
|
"m",
|
|
330
374
|
"mt",
|
|
331
375
|
"mr",
|
|
@@ -344,20 +388,24 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
344
388
|
"style",
|
|
345
389
|
"children"
|
|
346
390
|
]), [ref] = _rest;
|
|
391
|
+
var _gradient_deg;
|
|
347
392
|
const themedRef = (0, tokens_namespaceObject.useThemedRef)(ref);
|
|
348
|
-
const
|
|
393
|
+
const normalizedTruncate = true === truncate ? 'end' : false === truncate ? void 0 : truncate;
|
|
394
|
+
const variantArgs = {
|
|
349
395
|
size,
|
|
350
396
|
weight,
|
|
351
397
|
align,
|
|
352
398
|
color,
|
|
353
|
-
truncate
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
399
|
+
truncate: normalizedTruncate,
|
|
400
|
+
italic,
|
|
401
|
+
textTransform,
|
|
402
|
+
decoration,
|
|
403
|
+
letterSpacing,
|
|
404
|
+
lineHeight,
|
|
405
|
+
textWrap,
|
|
406
|
+
variant
|
|
407
|
+
};
|
|
408
|
+
const classes = className ? `${Text_css_text(variantArgs)} ${className}` : Text_css_text(variantArgs);
|
|
361
409
|
const spacingStyle = resolveSpacingStyle({
|
|
362
410
|
m,
|
|
363
411
|
mt,
|
|
@@ -374,10 +422,26 @@ const Text = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _
|
|
|
374
422
|
px,
|
|
375
423
|
py
|
|
376
424
|
});
|
|
425
|
+
const inheritStyle = inherit ? {
|
|
426
|
+
fontFamily: 'inherit',
|
|
427
|
+
fontSize: 'inherit',
|
|
428
|
+
fontWeight: 'inherit',
|
|
429
|
+
color: 'inherit',
|
|
430
|
+
lineHeight: 'inherit'
|
|
431
|
+
} : void 0;
|
|
432
|
+
const gradientStyle = 'gradient' === variant && gradient ? {
|
|
433
|
+
backgroundImage: `linear-gradient(${String(null != (_gradient_deg = gradient.deg) ? _gradient_deg : 45)}deg, ${gradient.from}, ${gradient.to})`
|
|
434
|
+
} : void 0;
|
|
435
|
+
const lineClampStyle = void 0 !== lineClamp ? {
|
|
436
|
+
display: '-webkit-box',
|
|
437
|
+
WebkitLineClamp: lineClamp,
|
|
438
|
+
WebkitBoxOrient: 'vertical',
|
|
439
|
+
overflow: 'hidden'
|
|
440
|
+
} : void 0;
|
|
377
441
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, _object_spread_props(_object_spread({
|
|
378
442
|
ref: themedRef,
|
|
379
443
|
className: classes,
|
|
380
|
-
style: _object_spread({}, spacingStyle, style)
|
|
444
|
+
style: _object_spread({}, spacingStyle, inheritStyle, gradientStyle, lineClampStyle, style)
|
|
381
445
|
}, rest), {
|
|
382
446
|
children: children
|
|
383
447
|
}));
|
package/dist/cjs/heading.css
CHANGED
|
@@ -94,6 +94,96 @@
|
|
|
94
94
|
._4sie9wn {
|
|
95
95
|
text-overflow: ellipsis;
|
|
96
96
|
white-space: nowrap;
|
|
97
|
+
max-width: 100%;
|
|
98
|
+
display: inline-block;
|
|
97
99
|
overflow: hidden;
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
._4sie9wo {
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
text-align: left;
|
|
106
|
+
direction: rtl;
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
display: inline-block;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
._4sie9wp {
|
|
113
|
+
font-style: italic;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
._4sie9wq {
|
|
117
|
+
text-transform: uppercase;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
._4sie9wr {
|
|
121
|
+
text-transform: lowercase;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
._4sie9ws {
|
|
125
|
+
text-transform: capitalize;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
._4sie9wt {
|
|
129
|
+
text-transform: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
._4sie9wu {
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
._4sie9wv {
|
|
137
|
+
text-decoration: line-through;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
._4sie9ww {
|
|
141
|
+
text-decoration: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
._4sie9wx {
|
|
145
|
+
letter-spacing: var(--vinyasa-letter-spacing-tight);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
._4sie9wy {
|
|
149
|
+
letter-spacing: var(--vinyasa-letter-spacing-normal);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
._4sie9wz {
|
|
153
|
+
letter-spacing: var(--vinyasa-letter-spacing-wide);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
._4sie9w10 {
|
|
157
|
+
line-height: var(--vinyasa-line-height-tight);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
._4sie9w11 {
|
|
161
|
+
line-height: var(--vinyasa-line-height-normal);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
._4sie9w12 {
|
|
165
|
+
line-height: var(--vinyasa-line-height-loose);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
._4sie9w13 {
|
|
169
|
+
text-wrap: wrap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
._4sie9w14 {
|
|
173
|
+
text-wrap: balance;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
._4sie9w15 {
|
|
177
|
+
text-wrap: pretty;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
._4sie9w16 {
|
|
181
|
+
text-wrap: nowrap;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
._4sie9w17 {
|
|
185
|
+
color: rgba(0, 0, 0, 0);
|
|
186
|
+
-webkit-background-clip: text;
|
|
187
|
+
background-clip: text;
|
|
188
|
+
}
|
|
189
|
+
|