@veeqo/ui 14.1.0 → 14.1.1
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/components/Accordion/styled.d.ts +5 -1
- package/dist/components/Action/Action.d.ts +2 -2
- package/dist/components/Action/styles/button.module.scss.cjs +2 -2
- package/dist/components/Action/styles/button.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/button.module.scss.js +2 -2
- package/dist/components/Action/styles/button.module.scss.js.map +1 -1
- package/dist/components/Action/styles/link.module.scss.cjs +2 -2
- package/dist/components/Action/styles/link.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/link.module.scss.js +2 -2
- package/dist/components/Action/styles/link.module.scss.js.map +1 -1
- package/dist/components/Anchor/Anchor.module.scss.cjs +2 -2
- package/dist/components/Anchor/Anchor.module.scss.cjs.map +1 -1
- package/dist/components/Anchor/Anchor.module.scss.js +2 -2
- package/dist/components/Anchor/Anchor.module.scss.js.map +1 -1
- package/dist/components/Banner/styled.d.ts +5 -1
- package/dist/components/DimensionsInput/DimensionsInput.d.ts +22 -22
- package/dist/components/FilterTag/styled.d.ts +5 -1
- package/dist/components/LegacyDataTable/SpecificState/styled.d.ts +11 -2
- package/dist/components/Pagination/styled.d.ts +22 -22
- package/dist/components/PhoneInput/index.d.ts +22 -22
- package/dist/components/Search/Search.d.ts +22 -22
- package/dist/components/Search/styled.d.ts +22 -22
- package/dist/components/Stack/Stack.cjs +2 -4
- package/dist/components/Stack/Stack.cjs.map +1 -1
- package/dist/components/Stack/Stack.js +2 -4
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Text/Text.cjs +27 -27
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.d.ts +11 -2
- package/dist/components/Text/Text.js +25 -25
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/Text/Text.module.scss.cjs +9 -0
- package/dist/components/Text/Text.module.scss.cjs.map +1 -0
- package/dist/components/Text/Text.module.scss.js +7 -0
- package/dist/components/Text/Text.module.scss.js.map +1 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/textVariants.cjs +14 -0
- package/dist/components/Text/textVariants.cjs.map +1 -0
- package/dist/components/Text/textVariants.js +12 -0
- package/dist/components/Text/textVariants.js.map +1 -0
- package/dist/components/Text/types.d.ts +7 -8
- package/dist/components/Text/utils.cjs +2 -2
- package/dist/components/Text/utils.cjs.map +1 -1
- package/dist/components/Text/utils.d.ts +3 -2
- package/dist/components/Text/utils.js +2 -2
- package/dist/components/Text/utils.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +22 -22
- package/dist/components/TextField/index.d.ts +22 -22
- package/dist/components/ToastsLayout/components/styled.d.ts +6 -1
- package/dist/components/View/View.cjs +3 -3
- package/dist/components/View/View.cjs.map +1 -1
- package/dist/components/View/View.js +3 -3
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/styled.cjs +11 -11
- package/dist/components/View/styled.cjs.map +1 -1
- package/dist/components/View/styled.d.ts +27 -8
- package/dist/components/View/styled.js +11 -11
- package/dist/components/View/styled.js.map +1 -1
- package/dist/components/ViewTab/ViewTab.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/theme/scss/text.module.scss.cjs +9 -0
- package/dist/theme/scss/text.module.scss.cjs.map +1 -0
- package/dist/theme/scss/text.module.scss.js +7 -0
- package/dist/theme/scss/text.module.scss.js.map +1 -0
- package/package.json +3 -1
|
@@ -6,16 +6,18 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
6
6
|
style?: import("react").CSSProperties | undefined;
|
|
7
7
|
title?: string | undefined;
|
|
8
8
|
pattern?: string | undefined;
|
|
9
|
+
rel?: string | undefined;
|
|
9
10
|
placeholder?: string | undefined;
|
|
10
|
-
|
|
11
|
+
list?: string | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
children?: import("react").ReactNode;
|
|
11
14
|
defaultChecked?: boolean | undefined;
|
|
12
15
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
13
16
|
suppressContentEditableWarning?: boolean | undefined;
|
|
14
17
|
suppressHydrationWarning?: boolean | undefined;
|
|
15
18
|
accessKey?: string | undefined;
|
|
16
19
|
autoFocus?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
20
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
19
21
|
contextMenu?: string | undefined;
|
|
20
22
|
dir?: string | undefined;
|
|
21
23
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -25,7 +27,7 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
25
27
|
nonce?: string | undefined;
|
|
26
28
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
27
29
|
tabIndex?: number | undefined;
|
|
28
|
-
translate?: "
|
|
30
|
+
translate?: "yes" | "no" | undefined;
|
|
29
31
|
radioGroup?: string | undefined;
|
|
30
32
|
role?: import("react").AriaRole | undefined;
|
|
31
33
|
about?: string | undefined;
|
|
@@ -34,7 +36,6 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
34
36
|
inlist?: any;
|
|
35
37
|
prefix?: string | undefined;
|
|
36
38
|
property?: string | undefined;
|
|
37
|
-
rel?: string | undefined;
|
|
38
39
|
resource?: string | undefined;
|
|
39
40
|
rev?: string | undefined;
|
|
40
41
|
typeof?: string | undefined;
|
|
@@ -51,27 +52,27 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
51
52
|
results?: number | undefined;
|
|
52
53
|
security?: string | undefined;
|
|
53
54
|
unselectable?: "on" | "off" | undefined;
|
|
54
|
-
inputMode?: "text" | "none" | "search" | "
|
|
55
|
+
inputMode?: "text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
55
56
|
is?: string | undefined;
|
|
56
57
|
'aria-activedescendant'?: string | undefined;
|
|
57
58
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
58
|
-
'aria-autocomplete'?: "
|
|
59
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
59
60
|
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
60
61
|
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
61
62
|
'aria-colcount'?: number | undefined;
|
|
62
63
|
'aria-colindex'?: number | undefined;
|
|
63
64
|
'aria-colspan'?: number | undefined;
|
|
64
65
|
'aria-controls'?: string | undefined;
|
|
65
|
-
'aria-current'?: boolean | "time" | "
|
|
66
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "step" | "date" | "page" | "location" | undefined;
|
|
66
67
|
'aria-describedby'?: string | undefined;
|
|
67
68
|
'aria-details'?: string | undefined;
|
|
68
69
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
69
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
70
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
70
71
|
'aria-errormessage'?: string | undefined;
|
|
71
72
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
72
73
|
'aria-flowto'?: string | undefined;
|
|
73
74
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
74
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
75
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
75
76
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
76
77
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
77
78
|
'aria-keyshortcuts'?: string | undefined;
|
|
@@ -88,7 +89,7 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
88
89
|
'aria-posinset'?: number | undefined;
|
|
89
90
|
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
90
91
|
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
91
|
-
'aria-relevant'?: "text" | "
|
|
92
|
+
'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
92
93
|
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
93
94
|
'aria-roledescription'?: string | undefined;
|
|
94
95
|
'aria-rowcount'?: number | undefined;
|
|
@@ -96,12 +97,11 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
96
97
|
'aria-rowspan'?: number | undefined;
|
|
97
98
|
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
98
99
|
'aria-setsize'?: number | undefined;
|
|
99
|
-
'aria-sort'?: "
|
|
100
|
+
'aria-sort'?: "other" | "none" | "ascending" | "descending" | undefined;
|
|
100
101
|
'aria-valuemax'?: number | undefined;
|
|
101
102
|
'aria-valuemin'?: number | undefined;
|
|
102
103
|
'aria-valuenow'?: number | undefined;
|
|
103
104
|
'aria-valuetext'?: string | undefined;
|
|
104
|
-
children?: import("react").ReactNode;
|
|
105
105
|
dangerouslySetInnerHTML?: {
|
|
106
106
|
__html: string | TrustedHTML;
|
|
107
107
|
} | undefined;
|
|
@@ -264,12 +264,7 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
264
264
|
onAnimationIterationCapture?: (import("react").AnimationEventHandler<HTMLInputElement> & import("react").AnimationEventHandler<HTMLTextAreaElement>) | undefined;
|
|
265
265
|
onTransitionEnd?: (import("react").TransitionEventHandler<HTMLInputElement> & import("react").TransitionEventHandler<HTMLTextAreaElement>) | undefined;
|
|
266
266
|
onTransitionEndCapture?: (import("react").TransitionEventHandler<HTMLInputElement> & import("react").TransitionEventHandler<HTMLTextAreaElement>) | undefined;
|
|
267
|
-
height?: string | number | undefined;
|
|
268
|
-
max?: string | number | undefined;
|
|
269
|
-
min?: string | number | undefined;
|
|
270
|
-
width?: string | number | undefined;
|
|
271
267
|
alt?: string | undefined;
|
|
272
|
-
src?: string | undefined;
|
|
273
268
|
disabled?: boolean | undefined;
|
|
274
269
|
formAction?: string | undefined;
|
|
275
270
|
formEncType?: string | undefined;
|
|
@@ -281,15 +276,20 @@ declare const Input: import("styled-components").StyledComponent<import("react")
|
|
|
281
276
|
capture?: boolean | "user" | "environment" | undefined;
|
|
282
277
|
checked?: boolean | undefined;
|
|
283
278
|
enterKeyHint?: "search" | "previous" | "next" | "enter" | "done" | "go" | "send" | undefined;
|
|
284
|
-
|
|
279
|
+
multiple?: boolean | undefined;
|
|
280
|
+
cols?: number | undefined;
|
|
281
|
+
dirName?: string | undefined;
|
|
285
282
|
maxLength?: number | undefined;
|
|
286
283
|
minLength?: number | undefined;
|
|
287
|
-
|
|
284
|
+
src?: string | undefined;
|
|
285
|
+
name?: string | undefined;
|
|
286
|
+
height?: string | number | undefined;
|
|
287
|
+
max?: string | number | undefined;
|
|
288
|
+
min?: string | number | undefined;
|
|
289
|
+
width?: string | number | undefined;
|
|
288
290
|
readOnly?: boolean | undefined;
|
|
289
291
|
required?: boolean | undefined;
|
|
290
292
|
step?: string | number | undefined;
|
|
291
|
-
cols?: number | undefined;
|
|
292
|
-
dirName?: string | undefined;
|
|
293
293
|
rows?: number | undefined;
|
|
294
294
|
wrap?: string | undefined;
|
|
295
295
|
} & {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var styled = require('styled-components');
|
|
4
4
|
var Alignments = require('./Alignments.cjs');
|
|
5
5
|
var index = require('../../theme/index.cjs');
|
|
6
|
-
var Text = require('../Text/Text.cjs');
|
|
7
6
|
|
|
8
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
8
|
|
|
@@ -48,9 +47,8 @@ const Stack = styled__default.default.div.withConfig({ displayName: "vui--Stack"
|
|
|
48
47
|
flex: ${itemFlex};
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
&& > * + ${Text.Text} {
|
|
50
|
+
/* applies the margin-top/left to all components inside a stack except the first component */
|
|
51
|
+
&& > * + * {
|
|
54
52
|
margin-top: ${marginTop};
|
|
55
53
|
margin-left: ${marginLeft};
|
|
56
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.cjs","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Stack.cjs","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { Alignments } from './Alignments';\nimport { StackProps } from './types';\n\nimport { theme } from '../../theme';\n\n/**\n * @deprecated Replaced by {@link FlexCol} and {@link FlexRow}.\n * Layout component.\n */\nexport const Stack = styled.div<StackProps>`\n display: flex;\n\n ${(props) => {\n const { direction = 'vertical', alignX = 'start', alignY = 'start', spacing = 'base' } = props;\n\n let alignItems;\n let justifyContent;\n let flexDirection;\n let itemFlex;\n let marginTop = '';\n let marginLeft = '';\n\n if (direction === 'vertical') {\n alignItems = alignX && Alignments[alignX];\n justifyContent = alignY && Alignments[alignY];\n marginTop = theme.sizes[spacing];\n flexDirection = 'column';\n } else {\n alignItems = alignY && Alignments[alignY];\n justifyContent = alignX && Alignments[alignX];\n marginLeft = theme.sizes[spacing];\n flexDirection = 'row';\n }\n\n // These options result in 'justify-content: stretch' which doesn't exist,\n // so instead we set the flex of child elements\n if (\n (direction === 'vertical' && alignY === 'stretch') ||\n (direction === 'horizontal' && alignX === 'stretch')\n ) {\n itemFlex = 1;\n }\n\n return `\n align-items: ${alignItems};\n justify-content: ${justifyContent};\n flex-direction: ${flexDirection};\n\n & > * {\n flex: ${itemFlex};\n }\n\n /* applies the margin-top/left to all components inside a stack except the first component */\n && > * + * {\n margin-top: ${marginTop};\n margin-left: ${marginLeft};\n }\n `;\n }}\n`;\n\nStack.displayName = 'Stack';\n"],"names":["styled","Alignments","theme"],"mappings":";;;;;;;;;;AAOA;;;AAGG;AACI,MAAM,KAAK,GAAGA,uBAAM,CAAC,GAAG,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,aAAA,EAG3B,CAAC,KAAK,KAAI;AACV,IAAA,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK;AAE9F,IAAA,IAAI,UAAU;AACd,IAAA,IAAI,cAAc;AAClB,IAAA,IAAI,aAAa;AACjB,IAAA,IAAI,QAAQ;IACZ,IAAI,SAAS,GAAG,EAAE;IAClB,IAAI,UAAU,GAAG,EAAE;IAEnB,IAAI,SAAS,KAAK,UAAU,EAAE;AAC5B,QAAA,UAAU,GAAG,MAAM,IAAIC,qBAAU,CAAC,MAAM,CAAC;AACzC,QAAA,cAAc,GAAG,MAAM,IAAIA,qBAAU,CAAC,MAAM,CAAC;AAC7C,QAAA,SAAS,GAAGC,WAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAChC,aAAa,GAAG,QAAQ;AACzB,IAAA;AAAM,SAAA;AACL,QAAA,UAAU,GAAG,MAAM,IAAID,qBAAU,CAAC,MAAM,CAAC;AACzC,QAAA,cAAc,GAAG,MAAM,IAAIA,qBAAU,CAAC,MAAM,CAAC;AAC7C,QAAA,UAAU,GAAGC,WAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QACjC,aAAa,GAAG,KAAK;AACtB,IAAA;;;IAID,IACE,CAAC,SAAS,KAAK,UAAU,IAAI,MAAM,KAAK,SAAS;SAChD,SAAS,KAAK,YAAY,IAAI,MAAM,KAAK,SAAS,CAAC,EACpD;QACA,QAAQ,GAAG,CAAC;AACb,IAAA;IAED,OAAO;qBACU,UAAU,CAAA;yBACN,cAAc,CAAA;wBACf,aAAa,CAAA;;;gBAGrB,QAAQ,CAAA;;;;;sBAKF,SAAS,CAAA;uBACR,UAAU,CAAA;;KAE5B;AACH,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Alignments } from './Alignments.js';
|
|
3
3
|
import { theme } from '../../theme/index.js';
|
|
4
|
-
import { Text } from '../Text/Text.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @deprecated Replaced by {@link FlexCol} and {@link FlexRow}.
|
|
@@ -42,9 +41,8 @@ const Stack = styled.div.withConfig({ displayName: "vui--Stack", componentId: "v
|
|
|
42
41
|
flex: ${itemFlex};
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
&& > * + ${Text} {
|
|
44
|
+
/* applies the margin-top/left to all components inside a stack except the first component */
|
|
45
|
+
&& > * + * {
|
|
48
46
|
margin-top: ${marginTop};
|
|
49
47
|
margin-left: ${marginLeft};
|
|
50
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Stack.js","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { Alignments } from './Alignments';\nimport { StackProps } from './types';\n\nimport { theme } from '../../theme';\n\n/**\n * @deprecated Replaced by {@link FlexCol} and {@link FlexRow}.\n * Layout component.\n */\nexport const Stack = styled.div<StackProps>`\n display: flex;\n\n ${(props) => {\n const { direction = 'vertical', alignX = 'start', alignY = 'start', spacing = 'base' } = props;\n\n let alignItems;\n let justifyContent;\n let flexDirection;\n let itemFlex;\n let marginTop = '';\n let marginLeft = '';\n\n if (direction === 'vertical') {\n alignItems = alignX && Alignments[alignX];\n justifyContent = alignY && Alignments[alignY];\n marginTop = theme.sizes[spacing];\n flexDirection = 'column';\n } else {\n alignItems = alignY && Alignments[alignY];\n justifyContent = alignX && Alignments[alignX];\n marginLeft = theme.sizes[spacing];\n flexDirection = 'row';\n }\n\n // These options result in 'justify-content: stretch' which doesn't exist,\n // so instead we set the flex of child elements\n if (\n (direction === 'vertical' && alignY === 'stretch') ||\n (direction === 'horizontal' && alignX === 'stretch')\n ) {\n itemFlex = 1;\n }\n\n return `\n align-items: ${alignItems};\n justify-content: ${justifyContent};\n flex-direction: ${flexDirection};\n\n & > * {\n flex: ${itemFlex};\n }\n\n /* applies the margin-top/left to all components inside a stack except the first component */\n && > * + * {\n margin-top: ${marginTop};\n margin-left: ${marginLeft};\n }\n `;\n }}\n`;\n\nStack.displayName = 'Stack';\n"],"names":[],"mappings":";;;;AAOA;;;AAGG;AACI,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,aAAA,EAG3B,CAAC,KAAK,KAAI;AACV,IAAA,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK;AAE9F,IAAA,IAAI,UAAU;AACd,IAAA,IAAI,cAAc;AAClB,IAAA,IAAI,aAAa;AACjB,IAAA,IAAI,QAAQ;IACZ,IAAI,SAAS,GAAG,EAAE;IAClB,IAAI,UAAU,GAAG,EAAE;IAEnB,IAAI,SAAS,KAAK,UAAU,EAAE;AAC5B,QAAA,UAAU,GAAG,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;AACzC,QAAA,cAAc,GAAG,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;AAC7C,QAAA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAChC,aAAa,GAAG,QAAQ;AACzB,IAAA;AAAM,SAAA;AACL,QAAA,UAAU,GAAG,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;AACzC,QAAA,cAAc,GAAG,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;AAC7C,QAAA,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QACjC,aAAa,GAAG,KAAK;AACtB,IAAA;;;IAID,IACE,CAAC,SAAS,KAAK,UAAU,IAAI,MAAM,KAAK,SAAS;SAChD,SAAS,KAAK,YAAY,IAAI,MAAM,KAAK,SAAS,CAAC,EACpD;QACA,QAAQ,GAAG,CAAC;AACb,IAAA;IAED,OAAO;qBACU,UAAU,CAAA;yBACN,cAAc,CAAA;wBACf,aAAa,CAAA;;;gBAGrB,QAAQ,CAAA;;;;;sBAKF,SAAS,CAAA;uBACR,UAAU,CAAA;;KAE5B;AACH,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var text_module = require('../../theme/scss/text.module.scss.cjs');
|
|
5
|
+
var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
6
|
+
require('uid/secure');
|
|
7
|
+
var utils = require('../ThemeInjector/utils.cjs');
|
|
8
|
+
var Text_module = require('./Text.module.scss.cjs');
|
|
9
|
+
var textVariants = require('./textVariants.cjs');
|
|
10
|
+
var utils$1 = require('./utils.cjs');
|
|
6
11
|
|
|
7
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
13
|
|
|
9
|
-
var
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
color: ${color};
|
|
30
|
-
text-decoration: ${text[variant].textDecoration};
|
|
31
|
-
letter-spacing: ${text[variant].letterSpacing};
|
|
32
|
-
`;
|
|
33
|
-
}}`;
|
|
16
|
+
/**
|
|
17
|
+
* Text component for rendering semantic typography with predefined design system variants.
|
|
18
|
+
* Automatically maps heading variants to appropriate HTML elements for accessibility.
|
|
19
|
+
* Use the `as` prop to override the default HTML tag when needed.
|
|
20
|
+
*/
|
|
21
|
+
const Text = React.forwardRef(({ variant = 'body', as, muted, className, children, ...rest }, ref) => {
|
|
22
|
+
const Component = utils$1.getComponentOverride(as, variant);
|
|
23
|
+
const isInteractive = React.useMemo(() => textVariants.deprecatedTextVariants.includes(variant), [variant]);
|
|
24
|
+
const kebabCase = React.useMemo(() => utils.camelToKebab(variant), [variant]);
|
|
25
|
+
const classNames = buildClassnames.buildClassnames([
|
|
26
|
+
text_module[kebabCase],
|
|
27
|
+
muted && Text_module.muted,
|
|
28
|
+
isInteractive && Text_module.interactive,
|
|
29
|
+
Text_module.text,
|
|
30
|
+
className,
|
|
31
|
+
]);
|
|
32
|
+
return (React__default.default.createElement(Component, { className: classNames, ref: ref, ...rest }, children));
|
|
33
|
+
});
|
|
34
34
|
|
|
35
35
|
exports.Text = Text;
|
|
36
36
|
//# sourceMappingURL=Text.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sources":["../../../src/components/Text/Text.
|
|
1
|
+
{"version":3,"file":"Text.cjs","sources":["../../../src/components/Text/Text.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\nimport textStyles from '../../theme/scss/text.module.scss';\nimport { buildClassnames } from '../../utils';\nimport { camelToKebab } from '../ThemeInjector/utils';\nimport styles from './Text.module.scss';\nimport { deprecatedTextVariants } from './textVariants';\nimport { TextProps } from './types';\nimport { getComponentOverride } from './utils';\n\n/**\n * Text component for rendering semantic typography with predefined design system variants.\n * Automatically maps heading variants to appropriate HTML elements for accessibility.\n * Use the `as` prop to override the default HTML tag when needed.\n */\nexport const Text = forwardRef<HTMLElement, TextProps>(\n ({ variant = 'body', as, muted, className, children, ...rest }, ref) => {\n const Component = getComponentOverride(as, variant);\n const isInteractive = useMemo(\n () => (deprecatedTextVariants as readonly string[]).includes(variant),\n [variant],\n );\n const kebabCase = useMemo(() => camelToKebab(variant as string), [variant]);\n const classNames = buildClassnames([\n textStyles[kebabCase],\n muted && styles.muted,\n isInteractive && styles.interactive,\n styles.text,\n className,\n ]);\n return (\n <Component className={classNames} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\n"],"names":["forwardRef","getComponentOverride","useMemo","deprecatedTextVariants","camelToKebab","buildClassnames","textStyles","styles","React"],"mappings":";;;;;;;;;;;;;;;AASA;;;;AAIG;AACI,MAAM,IAAI,GAAGA,gBAAU,CAC5B,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IACrE,MAAM,SAAS,GAAGC,4BAAoB,CAAC,EAAE,EAAE,OAAO,CAAC;AACnD,IAAA,MAAM,aAAa,GAAGC,aAAO,CAC3B,MAAOC,mCAA4C,CAAC,QAAQ,CAAC,OAAO,CAAC,EACrE,CAAC,OAAO,CAAC,CACV;AACD,IAAA,MAAM,SAAS,GAAGD,aAAO,CAAC,MAAME,kBAAY,CAAC,OAAiB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAGC,+BAAe,CAAC;QACjCC,WAAU,CAAC,SAAS,CAAC;QACrB,KAAK,IAAIC,WAAM,CAAC,KAAK;QACrB,aAAa,IAAIA,WAAM,CAAC,WAAW;AACnC,QAAAA,WAAM,CAAC,IAAI;QACX,SAAS;AACV,KAAA,CAAC;AACF,IAAA,QACEC,sBAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAA,GAAM,IAAI,IACjD,QAAQ,CACC;AAEhB,CAAC;;;;"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Text component for rendering semantic typography with predefined design system variants.
|
|
4
|
+
* Automatically maps heading variants to appropriate HTML elements for accessibility.
|
|
5
|
+
* Use the `as` prop to override the default HTML tag when needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Text: React.ForwardRefExoticComponent<{
|
|
8
|
+
as?: import("./types").ValidTextTag | undefined;
|
|
9
|
+
muted?: boolean | undefined;
|
|
10
|
+
variant?: "body" | "button" | "link" | "headingXXL" | "headingXL" | "headingLarge" | "headingMedium" | "headingSmall" | "headingTable" | "subheadingLarge" | "subheadingMedium" | "subheadingSmall" | "subheadingSmallBold" | "bodySmall" | "bodyBold" | "bodyBoldDark" | "bodySmallBold" | "inputLabel" | "inputLabelSmall" | "hintText" | "placeholder" | "placeholderSmall" | "placeholderCode" | "placeholderCodeSmall" | "error" | "errorSmall" | "successSmall" | "buttonSmall" | "linkLarge" | "linkMedium" | "linkSmall" | undefined;
|
|
11
|
+
} & React.HTMLAttributes<HTMLElement> & React.LabelHTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { forwardRef, useMemo } from 'react';
|
|
2
|
+
import textStyles from '../../theme/scss/text.module.scss.js';
|
|
3
|
+
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
4
|
+
import 'uid/secure';
|
|
5
|
+
import { camelToKebab } from '../ThemeInjector/utils.js';
|
|
6
|
+
import styles from './Text.module.scss.js';
|
|
7
|
+
import { deprecatedTextVariants } from './textVariants.js';
|
|
2
8
|
import { getComponentOverride } from './utils.js';
|
|
3
|
-
import { theme } from '../../theme/index.js';
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: ${color};
|
|
24
|
-
text-decoration: ${text[variant].textDecoration};
|
|
25
|
-
letter-spacing: ${text[variant].letterSpacing};
|
|
26
|
-
`;
|
|
27
|
-
}}`;
|
|
10
|
+
/**
|
|
11
|
+
* Text component for rendering semantic typography with predefined design system variants.
|
|
12
|
+
* Automatically maps heading variants to appropriate HTML elements for accessibility.
|
|
13
|
+
* Use the `as` prop to override the default HTML tag when needed.
|
|
14
|
+
*/
|
|
15
|
+
const Text = forwardRef(({ variant = 'body', as, muted, className, children, ...rest }, ref) => {
|
|
16
|
+
const Component = getComponentOverride(as, variant);
|
|
17
|
+
const isInteractive = useMemo(() => deprecatedTextVariants.includes(variant), [variant]);
|
|
18
|
+
const kebabCase = useMemo(() => camelToKebab(variant), [variant]);
|
|
19
|
+
const classNames = buildClassnames([
|
|
20
|
+
textStyles[kebabCase],
|
|
21
|
+
muted && styles.muted,
|
|
22
|
+
isInteractive && styles.interactive,
|
|
23
|
+
styles.text,
|
|
24
|
+
className,
|
|
25
|
+
]);
|
|
26
|
+
return (React__default.createElement(Component, { className: classNames, ref: ref, ...rest }, children));
|
|
27
|
+
});
|
|
28
28
|
|
|
29
29
|
export { Text };
|
|
30
30
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../src/components/Text/Text.
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../src/components/Text/Text.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\nimport textStyles from '../../theme/scss/text.module.scss';\nimport { buildClassnames } from '../../utils';\nimport { camelToKebab } from '../ThemeInjector/utils';\nimport styles from './Text.module.scss';\nimport { deprecatedTextVariants } from './textVariants';\nimport { TextProps } from './types';\nimport { getComponentOverride } from './utils';\n\n/**\n * Text component for rendering semantic typography with predefined design system variants.\n * Automatically maps heading variants to appropriate HTML elements for accessibility.\n * Use the `as` prop to override the default HTML tag when needed.\n */\nexport const Text = forwardRef<HTMLElement, TextProps>(\n ({ variant = 'body', as, muted, className, children, ...rest }, ref) => {\n const Component = getComponentOverride(as, variant);\n const isInteractive = useMemo(\n () => (deprecatedTextVariants as readonly string[]).includes(variant),\n [variant],\n );\n const kebabCase = useMemo(() => camelToKebab(variant as string), [variant]);\n const classNames = buildClassnames([\n textStyles[kebabCase],\n muted && styles.muted,\n isInteractive && styles.interactive,\n styles.text,\n className,\n ]);\n return (\n <Component className={classNames} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;;;;;AASA;;;;AAIG;AACI,MAAM,IAAI,GAAG,UAAU,CAC5B,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IACrE,MAAM,SAAS,GAAG,oBAAoB,CAAC,EAAE,EAAE,OAAO,CAAC;AACnD,IAAA,MAAM,aAAa,GAAG,OAAO,CAC3B,MAAO,sBAA4C,CAAC,QAAQ,CAAC,OAAO,CAAC,EACrE,CAAC,OAAO,CAAC,CACV;AACD,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,YAAY,CAAC,OAAiB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,eAAe,CAAC;QACjC,UAAU,CAAC,SAAS,CAAC;QACrB,KAAK,IAAI,MAAM,CAAC,KAAK;QACrB,aAAa,IAAI,MAAM,CAAC,WAAW;AACnC,QAAA,MAAM,CAAC,IAAI;QACX,SAAS;AACV,KAAA,CAAC;AACF,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAA,GAAM,IAAI,IACjD,QAAQ,CACC;AAEhB,CAAC;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._text_1n3c9_1 {\n box-sizing: border-box;\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n._interactive_1n3c9_8 {\n cursor: pointer;\n background-color: transparent;\n border: 0;\n}\n\n._muted_1n3c9_14 {\n color: var(--colors-neutral-ink-lightest);\n}");
|
|
6
|
+
var styles = {"text":"_text_1n3c9_1","interactive":"_interactive_1n3c9_8","muted":"_muted_1n3c9_14"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=Text.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.module.scss.cjs","sources":["../../../src/components/Text/Text.module.scss"],"sourcesContent":[".text {\n box-sizing: border-box;\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n.interactive {\n cursor: pointer;\n background-color: transparent;\n border: 0;\n}\n\n.muted {\n color: var(--colors-neutral-ink-lightest);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,gRAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,aAAA,CAAA,sBAAA,CAAA,OAAA,CAAA,iBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._text_1n3c9_1 {\n box-sizing: border-box;\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n._interactive_1n3c9_8 {\n cursor: pointer;\n background-color: transparent;\n border: 0;\n}\n\n._muted_1n3c9_14 {\n color: var(--colors-neutral-ink-lightest);\n}");
|
|
4
|
+
var styles = {"text":"_text_1n3c9_1","interactive":"_interactive_1n3c9_8","muted":"_muted_1n3c9_14"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Text.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.module.scss.js","sources":["../../../src/components/Text/Text.module.scss"],"sourcesContent":[".text {\n box-sizing: border-box;\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n.interactive {\n cursor: pointer;\n background-color: transparent;\n border: 0;\n}\n\n.muted {\n color: var(--colors-neutral-ink-lightest);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,gRAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,aAAA,CAAA,sBAAA,CAAA,OAAA,CAAA,iBAAA;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/** @deprecated do not use me */
|
|
4
|
+
const deprecatedTextVariants = [
|
|
5
|
+
'button',
|
|
6
|
+
'buttonSmall',
|
|
7
|
+
'linkLarge',
|
|
8
|
+
'linkMedium',
|
|
9
|
+
'link',
|
|
10
|
+
'linkSmall',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
exports.deprecatedTextVariants = deprecatedTextVariants;
|
|
14
|
+
//# sourceMappingURL=textVariants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textVariants.cjs","sources":["../../../src/components/Text/textVariants.ts"],"sourcesContent":["export const headerVariants = [\n 'headingXXL',\n 'headingXL',\n 'headingLarge',\n 'headingMedium',\n 'headingSmall',\n] as const;\n\nexport const textVariants = [\n ...headerVariants,\n 'headingTable',\n 'subheadingLarge',\n 'subheadingMedium',\n 'subheadingSmall',\n 'subheadingSmallBold',\n 'body',\n 'bodySmall',\n 'bodyBold',\n 'bodyBoldDark',\n 'bodySmallBold',\n 'inputLabel',\n 'inputLabelSmall',\n 'hintText',\n 'placeholder',\n 'placeholderSmall',\n 'placeholderCode',\n 'placeholderCodeSmall',\n 'error',\n 'errorSmall',\n 'successSmall',\n] as const;\n\n/** @deprecated do not use me */\nexport const deprecatedTextVariants = [\n 'button',\n 'buttonSmall',\n 'linkLarge',\n 'linkMedium',\n 'link',\n 'linkSmall',\n] as const;\n"],"names":[],"mappings":";;AAgCA;AACO,MAAM,sBAAsB,GAAG;IACpC,QAAQ;IACR,aAAa;IACb,WAAW;IACX,YAAY;IACZ,MAAM;IACN,WAAW;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textVariants.js","sources":["../../../src/components/Text/textVariants.ts"],"sourcesContent":["export const headerVariants = [\n 'headingXXL',\n 'headingXL',\n 'headingLarge',\n 'headingMedium',\n 'headingSmall',\n] as const;\n\nexport const textVariants = [\n ...headerVariants,\n 'headingTable',\n 'subheadingLarge',\n 'subheadingMedium',\n 'subheadingSmall',\n 'subheadingSmallBold',\n 'body',\n 'bodySmall',\n 'bodyBold',\n 'bodyBoldDark',\n 'bodySmallBold',\n 'inputLabel',\n 'inputLabelSmall',\n 'hintText',\n 'placeholder',\n 'placeholderSmall',\n 'placeholderCode',\n 'placeholderCodeSmall',\n 'error',\n 'errorSmall',\n 'successSmall',\n] as const;\n\n/** @deprecated do not use me */\nexport const deprecatedTextVariants = [\n 'button',\n 'buttonSmall',\n 'linkLarge',\n 'linkMedium',\n 'link',\n 'linkSmall',\n] as const;\n"],"names":[],"mappings":"AAgCA;AACO,MAAM,sBAAsB,GAAG;IACpC,QAAQ;IACR,aAAa;IACb,WAAW;IACX,YAAY;IACZ,MAAM;IACN,WAAW;;;;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { HTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
|
+
import { deprecatedTextVariants, headerVariants, textVariants } from './textVariants';
|
|
2
3
|
export type HeaderVariant = (typeof headerVariants)[number];
|
|
3
4
|
export type TextVariant = (typeof textVariants)[number];
|
|
4
5
|
export type DeprecatedTextVariants = (typeof deprecatedTextVariants)[number];
|
|
5
6
|
export type ValidTextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label' | 'strong' | 'em' | 'mark' | 'small' | 'abbr' | 'time' | 'li' | 'ol' | 'ul' | 'dl' | 'dt' | 'dd' | 'blockquote' | 'code';
|
|
6
|
-
|
|
7
|
+
type BaseTextProps = {
|
|
7
8
|
as?: ValidTextTag;
|
|
8
9
|
muted?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
variant?: DeprecatedTextVariants;
|
|
14
|
-
});
|
|
10
|
+
variant?: TextVariant | DeprecatedTextVariants;
|
|
11
|
+
};
|
|
12
|
+
export type TextProps = BaseTextProps & HTMLAttributes<HTMLElement> & LabelHTMLAttributes<HTMLLabelElement>;
|
|
13
|
+
export {};
|
|
@@ -15,9 +15,9 @@ const componentMap = {
|
|
|
15
15
|
const getComponentOverride = (as, variant) => {
|
|
16
16
|
if (as)
|
|
17
17
|
return as;
|
|
18
|
-
if (variant)
|
|
18
|
+
if (variant && componentMap[variant])
|
|
19
19
|
return componentMap[variant];
|
|
20
|
-
return
|
|
20
|
+
return 'span';
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
exports.getComponentOverride = getComponentOverride;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../src/components/Text/utils.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../src/components/Text/utils.ts"],"sourcesContent":["import type { ElementType } from 'react';\nimport { DeprecatedTextVariants, TextVariant, ValidTextTag } from './types';\n\nconst componentMap: { [key in TextVariant | DeprecatedTextVariants]?: string } = {\n inputLabel: 'label',\n inputLabelSmall: 'label',\n headingSmall: 'h3',\n headingMedium: 'h3',\n headingLarge: 'h2',\n headingXL: 'h1',\n headingXXL: 'h1',\n // Deprecated, but quickfix for A11y.\n button: 'button',\n buttonSmall: 'button',\n};\n\nexport const getComponentOverride = (\n as?: ElementType,\n variant?: TextVariant | DeprecatedTextVariants,\n): ElementType => {\n if (as) return as;\n if (variant && componentMap[variant]) return componentMap[variant] as ValidTextTag;\n return 'span';\n};\n"],"names":[],"mappings":";;AAGA,MAAM,YAAY,GAA+D;AAC/E,IAAA,UAAU,EAAE,OAAO;AACnB,IAAA,eAAe,EAAE,OAAO;AACxB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,IAAI;;AAEhB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,WAAW,EAAE,QAAQ;CACtB;MAEY,oBAAoB,GAAG,CAClC,EAAgB,EAChB,OAA8C,KAC/B;AACf,IAAA,IAAI,EAAE;AAAE,QAAA,OAAO,EAAE;AACjB,IAAA,IAAI,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC;AAAE,QAAA,OAAO,YAAY,CAAC,OAAO,CAAiB;AAClF,IAAA,OAAO,MAAM;AACf;;;;"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import { DeprecatedTextVariants, TextVariant } from './types';
|
|
3
|
+
export declare const getComponentOverride: (as?: ElementType, variant?: TextVariant | DeprecatedTextVariants) => ElementType;
|
|
@@ -13,9 +13,9 @@ const componentMap = {
|
|
|
13
13
|
const getComponentOverride = (as, variant) => {
|
|
14
14
|
if (as)
|
|
15
15
|
return as;
|
|
16
|
-
if (variant)
|
|
16
|
+
if (variant && componentMap[variant])
|
|
17
17
|
return componentMap[variant];
|
|
18
|
-
return
|
|
18
|
+
return 'span';
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { getComponentOverride };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/Text/utils.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/Text/utils.ts"],"sourcesContent":["import type { ElementType } from 'react';\nimport { DeprecatedTextVariants, TextVariant, ValidTextTag } from './types';\n\nconst componentMap: { [key in TextVariant | DeprecatedTextVariants]?: string } = {\n inputLabel: 'label',\n inputLabelSmall: 'label',\n headingSmall: 'h3',\n headingMedium: 'h3',\n headingLarge: 'h2',\n headingXL: 'h1',\n headingXXL: 'h1',\n // Deprecated, but quickfix for A11y.\n button: 'button',\n buttonSmall: 'button',\n};\n\nexport const getComponentOverride = (\n as?: ElementType,\n variant?: TextVariant | DeprecatedTextVariants,\n): ElementType => {\n if (as) return as;\n if (variant && componentMap[variant]) return componentMap[variant] as ValidTextTag;\n return 'span';\n};\n"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAA+D;AAC/E,IAAA,UAAU,EAAE,OAAO;AACnB,IAAA,eAAe,EAAE,OAAO;AACxB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,IAAI;;AAEhB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,WAAW,EAAE,QAAQ;CACtB;MAEY,oBAAoB,GAAG,CAClC,EAAgB,EAChB,OAA8C,KAC/B;AACf,IAAA,IAAI,EAAE;AAAE,QAAA,OAAO,EAAE;AACjB,IAAA,IAAI,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC;AAAE,QAAA,OAAO,YAAY,CAAC,OAAO,CAAiB;AAClF,IAAA,OAAO,MAAM;AACf;;;;"}
|