@cfx-dev/ui-components 4.2.13 → 4.2.14
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/assets/css/Text.css +1 -1
- package/dist/components/Text/Text.js +49 -48
- package/package.json +1 -1
package/dist/assets/css/Text.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__Text__root__2fe11{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__Text__root__2fe11.cfxui__Text__centered__4d7bd{text-align:center}.cfxui__Text__root__2fe11.cfxui__Text__underlined__5860e{text-decoration:underline}.cfxui__Text__root__2fe11.
|
|
1
|
+
.cfxui__Text__root__2fe11{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__Text__root__2fe11.cfxui__Text__centered__4d7bd{text-align:center}.cfxui__Text__root__2fe11.cfxui__Text__underlined__5860e{text-decoration:underline}.cfxui__Text__root__2fe11.cfxui__Text__strikethrough__e3ee3{text-decoration:line-through}.cfxui__Text__root__2fe11.cfxui__Text__truncated__417f4{width:100%;line-height:1.1;white-space:nowrap;overflow:hidden;-webkit-mask:linear-gradient(90deg,red,red calc(100% - 2ch),transparent);mask:linear-gradient(90deg,red,red calc(100% - 2ch),transparent)}.cfxui__Text__root__2fe11.cfxui__Text__typographic__d8155{overflow-wrap:break-word}.cfxui__Text__root__2fe11.cfxui__Text__typographic__d8155 li{margin-left:var(--offset-large)}.cfxui__Text__root__2fe11:not(.cfxui__Text__typographic__d8155) a{color:inherit;text-decoration:none}.cfxui__Text__root__2fe11.cfxui__Text__block__cb1b6{max-width:100%}
|
|
@@ -1,86 +1,87 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
|
-
import { ui as t, TextSizeEnum as
|
|
3
|
+
import { ui as t, TextSizeEnum as _ } from "../ui.js";
|
|
4
4
|
import { clsx as w } from "../../utils/clsx.js";
|
|
5
5
|
import { getColor as A } from "../../utils/color.js";
|
|
6
|
-
const E = "cfxui__Text__root__2fe11", O = "cfxui__Text__centered__4d7bd", F = "cfxui__Text__underlined__5860e", H = "
|
|
6
|
+
const E = "cfxui__Text__root__2fe11", O = "cfxui__Text__centered__4d7bd", F = "cfxui__Text__underlined__5860e", H = "cfxui__Text__strikethrough__e3ee3", N = "cfxui__Text__truncated__417f4", $ = "cfxui__Text__typographic__d8155", B = "cfxui__Text__block__cb1b6", n = {
|
|
7
7
|
root: E,
|
|
8
8
|
centered: O,
|
|
9
9
|
underlined: F,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
strikethrough: H,
|
|
11
|
+
truncated: N,
|
|
12
|
+
typographic: $,
|
|
13
|
+
block: B
|
|
14
|
+
}, P = (e) => e in _ ? t.fontSize(e) : typeof e == "number" ? t.q(e) : e, q = (e) => e in _ ? t.lineHeight(e) : typeof e == "number" ? t.q(e) : e, D = {
|
|
14
15
|
0: 0,
|
|
15
16
|
25: "var(--text-opacity-25)",
|
|
16
17
|
50: "var(--text-opacity-50)",
|
|
17
18
|
75: "var(--text-opacity-75)",
|
|
18
19
|
100: 1
|
|
19
|
-
},
|
|
20
|
+
}, I = {
|
|
20
21
|
h1: "h1",
|
|
21
22
|
h2: "h2",
|
|
22
23
|
h3: "h3",
|
|
23
24
|
h4: "h4",
|
|
24
25
|
h5: "h5",
|
|
25
26
|
h6: "h6"
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
return typeof
|
|
29
|
-
},
|
|
27
|
+
}, L = (e, o = 1) => {
|
|
28
|
+
const r = typeof e == "string" && D[e];
|
|
29
|
+
return typeof r == "string" || typeof r == "number" ? r : o;
|
|
30
|
+
}, M = "primary", V = f.forwardRef(function(o, r) {
|
|
30
31
|
const {
|
|
31
32
|
family: c,
|
|
32
33
|
size: i = "normal",
|
|
33
|
-
weight:
|
|
34
|
-
letterSpacing:
|
|
34
|
+
weight: u = "normal",
|
|
35
|
+
letterSpacing: h = "normal",
|
|
35
36
|
as: s = "span",
|
|
36
|
-
centered:
|
|
37
|
+
centered: p = !1,
|
|
37
38
|
truncated: m = !1,
|
|
38
|
-
typographic:
|
|
39
|
-
uppercase:
|
|
40
|
-
userSelectable:
|
|
41
|
-
underlined:
|
|
39
|
+
typographic: g = !1,
|
|
40
|
+
uppercase: d = !1,
|
|
41
|
+
userSelectable: x = !1,
|
|
42
|
+
underlined: y = !1,
|
|
42
43
|
strikethrough: T = !1,
|
|
43
44
|
children: b,
|
|
44
|
-
className:
|
|
45
|
-
style:
|
|
46
|
-
} = o,
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
className: k,
|
|
46
|
+
style: R
|
|
47
|
+
} = o, S = s === "div", C = w(
|
|
48
|
+
n.root,
|
|
49
|
+
k,
|
|
49
50
|
t.getResponsiveClassnames("font-size", i),
|
|
50
51
|
t.getResponsiveClassnames("line-height", i),
|
|
51
52
|
{
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[t.cls.userSelectableText]:
|
|
53
|
+
[n.block]: S,
|
|
54
|
+
[n.centered]: p,
|
|
55
|
+
[n.truncated]: m,
|
|
56
|
+
[n.underlined]: y,
|
|
57
|
+
[n.strikethrough]: T,
|
|
58
|
+
[n.typographic]: g,
|
|
59
|
+
[t.cls.userSelectableText]: x
|
|
59
60
|
}
|
|
60
61
|
), v = A({
|
|
61
62
|
...o,
|
|
62
|
-
color: o.color ||
|
|
63
|
-
opacity:
|
|
64
|
-
}), z = typeof c == "string" ? c :
|
|
63
|
+
color: o.color || M,
|
|
64
|
+
opacity: L(o.opacity)
|
|
65
|
+
}), z = typeof c == "string" ? c : I[s] || "primary", a = {
|
|
65
66
|
color: v,
|
|
66
67
|
fontFamily: `var(--font-family-${z})`,
|
|
67
68
|
lineHeight: `var(--line-height-${i})`,
|
|
68
|
-
letterSpacing: `var(--letter-spacing-${
|
|
69
|
-
fontWeight: `var(--font-weight-${
|
|
70
|
-
...t.getResponsiveStyles("font-size", i,
|
|
71
|
-
...t.getResponsiveStyles("line-height", i,
|
|
72
|
-
...
|
|
69
|
+
letterSpacing: `var(--letter-spacing-${h})`,
|
|
70
|
+
fontWeight: `var(--font-weight-${u})`,
|
|
71
|
+
...t.getResponsiveStyles("font-size", i, P),
|
|
72
|
+
...t.getResponsiveStyles("line-height", i, q),
|
|
73
|
+
...R
|
|
73
74
|
};
|
|
74
|
-
return
|
|
75
|
-
}),
|
|
76
|
-
return /* @__PURE__ */ l(
|
|
75
|
+
return d && (a.textTransform = "uppercase"), /* @__PURE__ */ l(s, { ref: r, dir: "auto", className: C, style: a, children: b });
|
|
76
|
+
}), J = f.forwardRef(function(o, r) {
|
|
77
|
+
return /* @__PURE__ */ l(V, { ref: r, ...o, as: "div" });
|
|
77
78
|
});
|
|
78
79
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
M as DEFAULT_TEXT_COLOR,
|
|
81
|
+
D as TEXT_OPACITY_MAP,
|
|
82
|
+
V as Text,
|
|
83
|
+
J as TextBlock,
|
|
84
|
+
L as getTextOpacity,
|
|
85
|
+
q as lineHeightResponsiveValueFormatter,
|
|
86
|
+
P as textSizeResponsiveValueFormatter
|
|
86
87
|
};
|