welcome-ui 7.3.0 → 7.4.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/dist/Text.mjs +38 -27
- package/dist/types/components/Text/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/Text.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
const
|
|
2
|
+
import f from "react";
|
|
3
|
+
import b, { css as i, th as d, system as a } from "@xstyled/styled-components";
|
|
4
|
+
import { forwardRef as x } from "./System.mjs";
|
|
5
|
+
const g = {
|
|
6
6
|
h0: "h1",
|
|
7
7
|
h1: "h2",
|
|
8
8
|
h2: "h3",
|
|
@@ -10,7 +10,7 @@ const x = {
|
|
|
10
10
|
h4: "h5",
|
|
11
11
|
h5: "h6",
|
|
12
12
|
h6: "h6"
|
|
13
|
-
},
|
|
13
|
+
}, k = (e) => i`
|
|
14
14
|
/* stylelint-disable-next-line value-no-vendor-prefix */
|
|
15
15
|
display: -webkit-box;
|
|
16
16
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
@@ -20,17 +20,18 @@ const x = {
|
|
|
20
20
|
line-height: normal;
|
|
21
21
|
overflow: hidden;
|
|
22
22
|
word-break: ${e === 1 ? "break-all" : null};
|
|
23
|
-
`, y =
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
${
|
|
23
|
+
`, y = b.p(({ lines: e, theme: n, variant: t, withDash: s, wordBreak: l }) => {
|
|
24
|
+
const h = g[t], r = t == null ? void 0 : t.startsWith("h"), o = e && e !== 1 / 0 && t.startsWith("h") && n.fonts.headings.includes("welcome-font");
|
|
25
|
+
return i`
|
|
26
|
+
${d(`texts.${h || t}`)};
|
|
27
|
+
word-break: ${l};
|
|
27
28
|
|
|
28
29
|
/* Start fallback for non-webkit */
|
|
29
30
|
display: block;
|
|
30
|
-
${e && e !== 1 / 0 &&
|
|
31
|
+
${e && e !== 1 / 0 && k(e)};
|
|
31
32
|
/* End fallback for non-webkit */
|
|
32
33
|
|
|
33
|
-
${s &&
|
|
34
|
+
${s && r && i`
|
|
34
35
|
display: flex;
|
|
35
36
|
|
|
36
37
|
&:before {
|
|
@@ -46,19 +47,19 @@ const x = {
|
|
|
46
47
|
`}
|
|
47
48
|
|
|
48
49
|
@media (min-width: lg) {
|
|
49
|
-
${
|
|
50
|
-
${
|
|
50
|
+
${d(`texts.${t}`)};
|
|
51
|
+
${a};
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
${
|
|
54
|
+
${o && i`
|
|
54
55
|
& {
|
|
55
56
|
line-height: 1.4;
|
|
56
57
|
}
|
|
57
58
|
`}
|
|
58
59
|
|
|
59
|
-
${
|
|
60
|
+
${a};
|
|
60
61
|
`;
|
|
61
|
-
}),
|
|
62
|
+
}), w = {
|
|
62
63
|
h0: "h1",
|
|
63
64
|
h1: "h1",
|
|
64
65
|
h2: "h2",
|
|
@@ -72,26 +73,36 @@ const x = {
|
|
|
72
73
|
xs: "p",
|
|
73
74
|
"subtitle-md": "span",
|
|
74
75
|
"subtitle-sm": "span"
|
|
75
|
-
},
|
|
76
|
-
({
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
}, $ = x(
|
|
77
|
+
({
|
|
78
|
+
as: e,
|
|
79
|
+
children: n,
|
|
80
|
+
dataTestId: t,
|
|
81
|
+
lines: s,
|
|
82
|
+
variant: l = "md",
|
|
83
|
+
withDash: h,
|
|
84
|
+
wordBreak: r = "break-word",
|
|
85
|
+
...o
|
|
86
|
+
}, c) => {
|
|
87
|
+
const m = e || w[l], p = o.className || "";
|
|
88
|
+
return /* @__PURE__ */ f.createElement(
|
|
79
89
|
y,
|
|
80
90
|
{
|
|
81
|
-
as:
|
|
91
|
+
as: m,
|
|
82
92
|
"data-testid": t,
|
|
83
93
|
lines: s,
|
|
84
|
-
ref:
|
|
94
|
+
ref: c,
|
|
85
95
|
variant: l,
|
|
86
96
|
withDash: h,
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
wordBreak: r,
|
|
98
|
+
...o,
|
|
99
|
+
className: `${p} wui-text`
|
|
89
100
|
},
|
|
90
|
-
|
|
101
|
+
n
|
|
91
102
|
);
|
|
92
103
|
}
|
|
93
104
|
);
|
|
94
|
-
|
|
105
|
+
$.displayName = "Text";
|
|
95
106
|
export {
|
|
96
|
-
|
|
107
|
+
$ as Text
|
|
97
108
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
import { CreateWuiProps } from '../System';
|
|
2
3
|
declare const TAG_NAMES: {
|
|
3
4
|
h0: string;
|
|
@@ -19,6 +20,7 @@ export interface TextOptions {
|
|
|
19
20
|
lines?: number;
|
|
20
21
|
variant?: Variant;
|
|
21
22
|
withDash?: boolean;
|
|
23
|
+
wordBreak?: CSSProperties['wordBreak'];
|
|
22
24
|
}
|
|
23
25
|
export type TextProps = CreateWuiProps<'p', TextOptions>;
|
|
24
26
|
export declare const Text: import('../System').CreateWuiComponent<"p", TextProps>;
|