@frontify/fondue 12.0.0-beta.319 → 12.0.0-beta.320
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { merge as
|
|
3
|
-
import { decorationMap as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { merge as s } from "../../utilities/merge.es.js";
|
|
3
|
+
import { decorationMap as p, wordBreakMap as f, whitespaceMap as u, overflowMap as c, displayMap as g } from "../shared/records.es.js";
|
|
4
|
+
const b = {
|
|
5
5
|
default: "tw-font-regular",
|
|
6
6
|
strong: "tw-font-medium",
|
|
7
7
|
"x-strong": "tw-font-bold"
|
|
8
|
-
},
|
|
8
|
+
}, M = {
|
|
9
9
|
"x-small": "tw-text-body-x-small",
|
|
10
10
|
small: "tw-text-body-small",
|
|
11
11
|
medium: "tw-text-body-medium",
|
|
12
12
|
large: "tw-text-body-large"
|
|
13
|
-
},
|
|
13
|
+
}, v = {
|
|
14
14
|
default: "tw-text-text",
|
|
15
15
|
weak: "tw-text-text-weak",
|
|
16
16
|
"x-weak": "tw-text-text-x-weak",
|
|
@@ -19,7 +19,7 @@ const g = {
|
|
|
19
19
|
positive: "tw-text-text-positive",
|
|
20
20
|
warning: "tw-text-text-warning",
|
|
21
21
|
interactive: "tw-text-text-interactive"
|
|
22
|
-
},
|
|
22
|
+
}, y = ({
|
|
23
23
|
children: a,
|
|
24
24
|
as: o = "span",
|
|
25
25
|
weight: x = "default",
|
|
@@ -29,27 +29,29 @@ const g = {
|
|
|
29
29
|
wordBreak: n = "normal",
|
|
30
30
|
whitespace: r = "normal",
|
|
31
31
|
overflow: t = "visible",
|
|
32
|
-
display: e
|
|
33
|
-
|
|
32
|
+
display: e,
|
|
33
|
+
...d
|
|
34
|
+
}) => /* @__PURE__ */ m(
|
|
34
35
|
o,
|
|
35
36
|
{
|
|
36
37
|
"data-test-id": "text",
|
|
37
|
-
className:
|
|
38
|
+
className: s([
|
|
38
39
|
"tw-font-body tw-max-w-full",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
t !== "truncate" &&
|
|
45
|
-
|
|
46
|
-
e &&
|
|
40
|
+
b[x],
|
|
41
|
+
M[i],
|
|
42
|
+
v[w],
|
|
43
|
+
p[l],
|
|
44
|
+
f[n],
|
|
45
|
+
t !== "truncate" && u[r],
|
|
46
|
+
c[t],
|
|
47
|
+
e && g[e]
|
|
47
48
|
]),
|
|
49
|
+
...d,
|
|
48
50
|
children: a
|
|
49
51
|
}
|
|
50
52
|
);
|
|
51
|
-
|
|
53
|
+
y.displayName = "FondueText";
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
y as Text
|
|
54
56
|
};
|
|
55
57
|
//# sourceMappingURL=Text.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.es.js","sources":["../../../src/typography/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@utilities/merge';\nimport { ReactElement, ReactNode } from 'react';\nimport { decorationMap, displayMap, overflowMap, whitespaceMap, wordBreakMap } from '../shared/records';\nimport { SharedTypographyProps } from '../shared/types';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\n\nexport type TextProps = SharedTypographyProps & {\n
|
|
1
|
+
{"version":3,"file":"Text.es.js","sources":["../../../src/typography/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@utilities/merge';\nimport { AriaAttributes, ReactElement, ReactNode } from 'react';\nimport { decorationMap, displayMap, overflowMap, whitespaceMap, wordBreakMap } from '../shared/records';\nimport { SharedTypographyProps } from '../shared/types';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\n\nexport type TextProps = SharedTypographyProps &\n AriaAttributes & {\n size?: TextSize;\n weight?: TextWeight;\n as?: 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';\n color?: TextColor;\n children?: ReactNode;\n };\n\nconst weightMap: Record<TextWeight, string> = {\n default: 'tw-font-regular',\n strong: 'tw-font-medium',\n 'x-strong': 'tw-font-bold',\n};\n\nconst sizeMap: Record<TextSize, string> = {\n 'x-small': 'tw-text-body-x-small',\n small: 'tw-text-body-small',\n medium: 'tw-text-body-medium',\n large: 'tw-text-body-large',\n};\n\nconst colorMap: Record<TextColor, string> = {\n default: 'tw-text-text',\n weak: 'tw-text-text-weak',\n 'x-weak': 'tw-text-text-x-weak',\n disabled: 'tw-text-text-disabled',\n negative: 'tw-text-text-negative',\n positive: 'tw-text-text-positive',\n warning: 'tw-text-text-warning',\n interactive: 'tw-text-text-interactive',\n};\n\nexport const Text = ({\n children,\n as: Tag = 'span',\n weight = 'default',\n size = 'medium',\n color = 'default',\n decoration = 'none',\n wordBreak = 'normal',\n whitespace = 'normal',\n overflow = 'visible',\n display,\n ...props\n}: TextProps): ReactElement => (\n <Tag\n data-test-id=\"text\"\n className={merge([\n 'tw-font-body tw-max-w-full',\n weightMap[weight],\n sizeMap[size],\n colorMap[color],\n decorationMap[decoration],\n wordBreakMap[wordBreak],\n overflow !== 'truncate' && whitespaceMap[whitespace],\n overflowMap[overflow],\n display && displayMap[display],\n ])}\n {...props}\n >\n {children}\n </Tag>\n);\nText.displayName = 'FondueText';\n"],"names":["weightMap","sizeMap","colorMap","Text","children","Tag","weight","size","color","decoration","wordBreak","whitespace","overflow","display","props","jsx","merge","decorationMap","wordBreakMap","whitespaceMap","overflowMap","displayMap"],"mappings":";;;AAoBA,MAAMA,IAAwC;AAAA,EAC1C,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAChB,GAEMC,IAAoC;AAAA,EACtC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACX,GAEMC,IAAsC;AAAA,EACxC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AACjB,GAEaC,IAAO,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,IAAIC,IAAM;AAAA,EACV,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,YAAAC,IAAa;AAAA,EACb,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,GAAGC;AACP,MACI,gBAAAC;AAAA,EAACV;AAAA,EAAA;AAAA,IACG,gBAAa;AAAA,IACb,WAAWW,EAAM;AAAA,MACb;AAAA,MACAhB,EAAUM,CAAM;AAAA,MAChBL,EAAQM,CAAI;AAAA,MACZL,EAASM,CAAK;AAAA,MACdS,EAAcR,CAAU;AAAA,MACxBS,EAAaR,CAAS;AAAA,MACtBE,MAAa,cAAcO,EAAcR,CAAU;AAAA,MACnDS,EAAYR,CAAQ;AAAA,MACpBC,KAAWQ,EAAWR,CAAO;AAAA,IAAA,CAChC;AAAA,IACA,GAAGC;AAAA,IAEH,UAAAV;AAAA,EAAA;AACL;AAEJD,EAAK,cAAc;"}
|