@zohodesk/components 1.0.0-temp-242.6 → 1.0.0-temp-252
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 +74 -14
- package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +68 -0
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +68 -0
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +68 -0
- package/es/Avatar/Avatar.module.css +8 -8
- package/es/AvatarTeam/AvatarTeam.module.css +30 -30
- package/es/Button/css/Button.module.css +19 -19
- package/es/Buttongroup/Buttongroup.module.css +13 -35
- package/es/Card/Card.module.css +6 -4
- package/es/CheckBox/CheckBox.module.css +3 -10
- package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +4 -2
- package/es/DateTime/DateTime.module.css +22 -35
- package/es/DateTime/DateWidget.module.css +1 -1
- package/es/DateTime/YearView.module.css +8 -10
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +5 -4
- package/es/DropDown/DropDown.module.css +2 -1
- package/es/DropDown/DropDownHeading.module.css +4 -4
- package/es/DropDown/DropDownItem.module.css +5 -12
- package/es/DropDown/DropDownSearch.module.css +3 -3
- package/es/DropDown/DropDownSeparator.module.css +2 -1
- package/es/Label/Label.module.css +5 -5
- package/es/ListItem/ListItem.js +6 -4
- package/es/ListItem/ListItem.module.css +62 -66
- package/es/ListItem/ListItemWithAvatar.js +7 -5
- package/es/ListItem/ListItemWithCheckBox.js +9 -5
- package/es/ListItem/ListItemWithIcon.js +10 -7
- package/es/ListItem/ListItemWithRadio.js +9 -6
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +4 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +131 -82
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +432 -390
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +141 -92
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +432 -390
- package/es/ListItem/props/defaultProps.js +2 -1
- package/es/ListItem/props/propTypes.js +4 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +14 -3
- package/es/MultiSelect/AdvancedMultiSelect.js +2 -0
- package/es/MultiSelect/EmptyState.js +16 -2
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +4 -3
- package/es/MultiSelect/MultiSelect.js +4 -2
- package/es/MultiSelect/MultiSelect.module.css +21 -34
- package/es/MultiSelect/MultiSelectWithAvatar.js +2 -0
- package/es/MultiSelect/SelectedOptions.module.css +6 -10
- package/es/MultiSelect/Suggestions.js +7 -2
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +10 -10
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -28
- package/es/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +20 -20
- package/es/MultiSelect/props/defaultProps.js +2 -0
- package/es/MultiSelect/props/propTypes.js +14 -3
- package/es/Popup/Popup.js +13 -12
- package/es/Radio/Radio.module.css +11 -12
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
- package/es/Ribbon/Ribbon.module.css +23 -29
- package/es/RippleEffect/RippleEffect.module.css +55 -17
- package/es/Select/GroupSelect.js +14 -4
- package/es/Select/Select.js +94 -72
- package/es/Select/Select.module.css +50 -17
- package/es/Select/SelectWithAvatar.js +14 -4
- package/es/Select/SelectWithIcon.js +14 -4
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +88 -88
- package/es/Select/props/defaultProps.js +10 -4
- package/es/Select/props/propTypes.js +30 -5
- package/es/Stencils/Stencils.module.css +30 -14
- package/es/Switch/Switch.module.css +1 -8
- package/es/Tab/Tab.module.css +8 -15
- package/es/Tab/Tabs.module.css +12 -22
- package/es/Tag/Tag.module.css +21 -21
- package/es/TextBox/TextBox.module.css +9 -9
- package/es/TextBoxIcon/TextBoxIcon.module.css +1 -1
- package/es/Textarea/Textarea.module.css +18 -18
- package/es/Tooltip/Tooltip.module.css +5 -4
- package/es/Typography/Typography.js +18 -8
- package/es/Typography/__tests__/Typography.spec.js +198 -6
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1235 -2
- package/es/Typography/css/Typography.module.css +4 -0
- package/es/Typography/css/cssJSLogic.js +53 -21
- package/es/Typography/props/defaultProps.js +4 -3
- package/es/Typography/props/propTypes.js +68 -26
- package/es/Typography/utils/textHighlighter.js +4 -2
- package/es/common/avatarsizes.module.css +16 -16
- package/es/common/common.module.css +1 -1
- package/es/shared/ArrowIcon/ArrowIcon.module.css +3 -2
- package/es/shared/InputFieldLine/InputFieldLine.module.css +2 -2
- package/es/v1/Button/Button.js +201 -0
- package/es/v1/Button/README.md +110 -0
- package/es/v1/Button/__tests__/Button.spec.js +272 -0
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +1160 -0
- package/es/v1/Button/_shared/Loader/Loader.js +33 -0
- package/es/v1/Button/_shared/Loader/Loader_v1.module.css +42 -0
- package/es/v1/Button/_shared/Loader/__tests__/Loader.spec.js +21 -0
- package/es/v1/Button/_shared/Loader/__tests__/__snapshots__/Loader.spec.js.snap +49 -0
- package/es/v1/Button/_shared/Loader/props/defaultProps.js +4 -0
- package/es/v1/Button/_shared/Loader/props/propTypes.js +7 -0
- package/es/v1/Button/_shared/SuccessTick/SuccessTick.js +25 -0
- package/es/v1/Button/_shared/SuccessTick/SuccessTick_v1.module.css +21 -0
- package/es/v1/Button/_shared/SuccessTick/__tests__/SuccessTick.spec.js +21 -0
- package/es/v1/Button/_shared/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +31 -0
- package/es/v1/Button/_shared/SuccessTick/props/defaultProps.js +4 -0
- package/es/v1/Button/_shared/SuccessTick/props/propTypes.js +7 -0
- package/es/v1/Button/constants/index.js +82 -0
- package/es/v1/Button/css/Button_v1.module.css +119 -0
- package/es/v1/Button/css/cssJSLogic.js +96 -0
- package/es/v1/Button/index.js +2 -0
- package/es/v1/Button/props/defaultProps.js +26 -0
- package/es/v1/Button/props/propTypes.js +43 -0
- package/es/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +40 -34
- package/es/v1/Switch/css/Switch_v1.module.css +28 -28
- package/es/v1/helpers/colorHelpers/background/backgroundColor.module.css +629 -0
- package/es/v1/helpers/colorHelpers/border/borderColor.module.css +489 -0
- package/es/v1/helpers/colorHelpers/colorHelper.js +176 -0
- package/es/v1/helpers/colorHelpers/constants/index.js +79 -0
- package/es/v1/helpers/colorHelpers/index.js +4 -0
- package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +415 -0
- package/es/v1/helpers/colorHelpers/text/textColor.module.css +368 -0
- package/lib/Avatar/Avatar.module.css +8 -8
- package/lib/AvatarTeam/AvatarTeam.module.css +30 -30
- package/lib/Button/css/Button.module.css +19 -19
- package/lib/Buttongroup/Buttongroup.module.css +13 -35
- package/lib/Card/Card.module.css +6 -4
- package/lib/CheckBox/CheckBox.module.css +3 -10
- package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +4 -2
- package/lib/DateTime/DateTime.module.css +22 -35
- package/lib/DateTime/DateWidget.module.css +1 -1
- package/lib/DateTime/YearView.module.css +8 -10
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +5 -4
- package/lib/DropDown/DropDown.module.css +2 -1
- package/lib/DropDown/DropDownHeading.module.css +4 -4
- package/lib/DropDown/DropDownItem.module.css +5 -12
- package/lib/DropDown/DropDownSearch.module.css +3 -3
- package/lib/DropDown/DropDownSeparator.module.css +2 -1
- package/lib/Label/Label.module.css +5 -5
- package/lib/ListItem/ListItem.js +7 -4
- package/lib/ListItem/ListItem.module.css +62 -66
- package/lib/ListItem/ListItemWithAvatar.js +7 -5
- package/lib/ListItem/ListItemWithCheckBox.js +9 -5
- package/lib/ListItem/ListItemWithIcon.js +10 -7
- package/lib/ListItem/ListItemWithRadio.js +9 -6
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +4 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +131 -82
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +432 -390
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +141 -92
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +432 -390
- package/lib/ListItem/props/defaultProps.js +2 -1
- package/lib/ListItem/props/propTypes.js +4 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +25 -16
- package/lib/MultiSelect/AdvancedMultiSelect.js +2 -0
- package/lib/MultiSelect/EmptyState.js +17 -2
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +4 -3
- package/lib/MultiSelect/MultiSelect.js +4 -2
- package/lib/MultiSelect/MultiSelect.module.css +21 -34
- package/lib/MultiSelect/MultiSelectWithAvatar.js +2 -0
- package/lib/MultiSelect/SelectedOptions.module.css +6 -10
- package/lib/MultiSelect/Suggestions.js +6 -2
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +10 -10
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -28
- package/lib/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +20 -20
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +16 -5
- package/lib/Popup/Popup.js +13 -15
- package/lib/Radio/Radio.module.css +11 -12
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
- package/lib/Ribbon/Ribbon.module.css +23 -29
- package/lib/RippleEffect/RippleEffect.module.css +55 -17
- package/lib/Select/GroupSelect.js +15 -4
- package/lib/Select/Select.js +94 -72
- package/lib/Select/Select.module.css +50 -17
- package/lib/Select/SelectWithAvatar.js +15 -4
- package/lib/Select/SelectWithIcon.js +15 -4
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +88 -88
- package/lib/Select/props/defaultProps.js +9 -6
- package/lib/Select/props/propTypes.js +30 -5
- package/lib/Stencils/Stencils.module.css +30 -14
- package/lib/Switch/Switch.module.css +1 -8
- package/lib/Tab/Tab.module.css +8 -15
- package/lib/Tab/Tabs.module.css +12 -22
- package/lib/Tag/Tag.module.css +21 -21
- package/lib/TextBox/TextBox.module.css +9 -9
- package/lib/TextBoxIcon/TextBoxIcon.module.css +1 -1
- package/lib/Textarea/Textarea.module.css +18 -18
- package/lib/Tooltip/Tooltip.module.css +5 -4
- package/lib/Typography/Typography.js +15 -5
- package/lib/Typography/__tests__/Typography.spec.js +284 -92
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1235 -2
- package/lib/Typography/css/Typography.module.css +4 -0
- package/lib/Typography/css/cssJSLogic.js +38 -6
- package/lib/Typography/props/defaultProps.js +6 -3
- package/lib/Typography/props/propTypes.js +67 -23
- package/lib/Typography/utils/textHighlighter.js +6 -3
- package/lib/common/avatarsizes.module.css +16 -16
- package/lib/common/common.module.css +1 -1
- package/lib/shared/ArrowIcon/ArrowIcon.module.css +3 -2
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +2 -2
- package/lib/v1/Button/Button.js +239 -0
- package/lib/v1/Button/README.md +110 -0
- package/lib/v1/Button/__tests__/Button.spec.js +293 -0
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +1160 -0
- package/lib/v1/Button/_shared/Loader/Loader.js +43 -0
- package/lib/v1/Button/_shared/Loader/Loader_v1.module.css +42 -0
- package/lib/v1/Button/_shared/Loader/__tests__/Loader.spec.js +28 -0
- package/lib/v1/Button/_shared/Loader/__tests__/__snapshots__/Loader.spec.js.snap +49 -0
- package/lib/v1/Button/_shared/Loader/props/defaultProps.js +11 -0
- package/lib/v1/Button/_shared/Loader/props/propTypes.js +18 -0
- package/lib/v1/Button/_shared/SuccessTick/SuccessTick.js +35 -0
- package/lib/v1/Button/_shared/SuccessTick/SuccessTick_v1.module.css +21 -0
- package/lib/v1/Button/_shared/SuccessTick/__tests__/SuccessTick.spec.js +28 -0
- package/lib/v1/Button/_shared/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +31 -0
- package/lib/v1/Button/_shared/SuccessTick/props/defaultProps.js +11 -0
- package/lib/v1/Button/_shared/SuccessTick/props/propTypes.js +18 -0
- package/lib/v1/Button/constants/index.js +114 -0
- package/lib/v1/Button/css/Button_v1.module.css +119 -0
- package/lib/v1/Button/css/cssJSLogic.js +88 -0
- package/lib/v1/Button/index.js +21 -0
- package/lib/v1/Button/props/defaultProps.js +36 -0
- package/lib/v1/Button/props/propTypes.js +56 -0
- package/lib/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +40 -34
- package/lib/v1/Switch/css/Switch_v1.module.css +28 -28
- package/lib/v1/helpers/colorHelpers/background/backgroundColor.module.css +629 -0
- package/lib/v1/helpers/colorHelpers/border/borderColor.module.css +489 -0
- package/lib/v1/helpers/colorHelpers/colorHelper.js +190 -0
- package/lib/v1/helpers/colorHelpers/constants/index.js +87 -0
- package/lib/v1/helpers/colorHelpers/index.js +57 -0
- package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +415 -0
- package/lib/v1/helpers/colorHelpers/text/textColor.module.css +368 -0
- package/package.json +27 -23
- package/_react-cli.config.js +0 -24
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +0 -467
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css +0 -36
- package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +0 -467
- package/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css +0 -36
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +0 -467
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css +0 -36
- package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +0 -467
- package/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css +0 -36
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +0 -467
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css +0 -36
- package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +0 -467
- package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +0 -36
- package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +0 -467
- package/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css +0 -36
- package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +0 -467
- package/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css +0 -36
- package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +0 -467
- package/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css +0 -36
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +0 -467
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css +0 -36
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +0 -467
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css +0 -36
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +0 -467
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css +0 -36
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +0 -467
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css +0 -36
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +0 -467
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css +0 -36
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +0 -467
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css +0 -36
- package/assets/Contrast/darkContrastLightness.module.css +0 -39
- package/assets/Contrast/lightContrastLightness.module.css +0 -39
- package/assets/Contrast/pureDarkContrastLightness.module.css +0 -39
|
@@ -15,7 +15,7 @@ describe('Typography', () => {
|
|
|
15
15
|
const ui_decoration = ['default', 'underline', 'strike', 'overline'];
|
|
16
16
|
const ui_wordBreak = ['breakAll', 'keepAll', 'breakWord'];
|
|
17
17
|
const ui_wordWrap = ['normal', 'break'];
|
|
18
|
-
const ui_whiteSpace = ['normal', 'noWrap', 'pre', 'preLine', 'preWrap'];
|
|
18
|
+
const ui_whiteSpace = ['normal', 'noWrap', 'pre', 'preLine', 'preWrap', 'breakSpaces'];
|
|
19
19
|
test('rendering the defult props', () => {
|
|
20
20
|
const {
|
|
21
21
|
asFragment
|
|
@@ -36,6 +36,14 @@ describe('Typography', () => {
|
|
|
36
36
|
}, "Heading 2 Test"));
|
|
37
37
|
expect(asFragment()).toMatchSnapshot();
|
|
38
38
|
});
|
|
39
|
+
test('rendering h2 tag name with using as', () => {
|
|
40
|
+
const {
|
|
41
|
+
asFragment
|
|
42
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
43
|
+
as: "h2"
|
|
44
|
+
}, "Heading 2 Test"));
|
|
45
|
+
expect(asFragment()).toMatchSnapshot();
|
|
46
|
+
});
|
|
39
47
|
test('rendering i18n_dataTitle', () => {
|
|
40
48
|
const {
|
|
41
49
|
asFragment
|
|
@@ -44,6 +52,14 @@ describe('Typography', () => {
|
|
|
44
52
|
}, "Heading 2 Test"));
|
|
45
53
|
expect(asFragment()).toMatchSnapshot();
|
|
46
54
|
});
|
|
55
|
+
test('rendering dataTitle', () => {
|
|
56
|
+
const {
|
|
57
|
+
asFragment
|
|
58
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
59
|
+
dataTitle: "typoDataTitle"
|
|
60
|
+
}, "Heading 2 Test"));
|
|
61
|
+
expect(asFragment()).toMatchSnapshot();
|
|
62
|
+
});
|
|
47
63
|
test('rendering testId', () => {
|
|
48
64
|
const {
|
|
49
65
|
asFragment
|
|
@@ -70,6 +86,16 @@ describe('Typography', () => {
|
|
|
70
86
|
}, "Heading 2 Test"));
|
|
71
87
|
expect(asFragment()).toMatchSnapshot();
|
|
72
88
|
});
|
|
89
|
+
test('rendering tagAttributes', () => {
|
|
90
|
+
const {
|
|
91
|
+
asFragment
|
|
92
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
93
|
+
tagAttributes: {
|
|
94
|
+
id: "TypoCustomId"
|
|
95
|
+
}
|
|
96
|
+
}, "Heading 2 Test"));
|
|
97
|
+
expect(asFragment()).toMatchSnapshot();
|
|
98
|
+
});
|
|
73
99
|
test('rendering a11yAttributes_text', () => {
|
|
74
100
|
const {
|
|
75
101
|
asFragment
|
|
@@ -82,6 +108,18 @@ describe('Typography', () => {
|
|
|
82
108
|
}, "Heading 2 Test"));
|
|
83
109
|
expect(asFragment()).toMatchSnapshot();
|
|
84
110
|
});
|
|
111
|
+
test('rendering a11yAttributes', () => {
|
|
112
|
+
const {
|
|
113
|
+
asFragment
|
|
114
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
115
|
+
a11yAttributes: {
|
|
116
|
+
'aria-haspopup': 'true',
|
|
117
|
+
'aria-expanded': true,
|
|
118
|
+
'aria-controls': 'uniqueId'
|
|
119
|
+
}
|
|
120
|
+
}, "Heading 2 Test"));
|
|
121
|
+
expect(asFragment()).toMatchSnapshot();
|
|
122
|
+
});
|
|
85
123
|
test('rendering flag_reset', () => {
|
|
86
124
|
const {
|
|
87
125
|
asFragment
|
|
@@ -90,6 +128,14 @@ describe('Typography', () => {
|
|
|
90
128
|
}, "Heading 2 Test"));
|
|
91
129
|
expect(asFragment()).toMatchSnapshot();
|
|
92
130
|
});
|
|
131
|
+
test('rendering shouldReset', () => {
|
|
132
|
+
const {
|
|
133
|
+
asFragment
|
|
134
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
135
|
+
shouldReset: true
|
|
136
|
+
}, "Heading 2 Test"));
|
|
137
|
+
expect(asFragment()).toMatchSnapshot();
|
|
138
|
+
});
|
|
93
139
|
test('rendering flag_dotted', () => {
|
|
94
140
|
const {
|
|
95
141
|
asFragment
|
|
@@ -98,6 +144,14 @@ describe('Typography', () => {
|
|
|
98
144
|
}, "Heading 2 Test"));
|
|
99
145
|
expect(asFragment()).toMatchSnapshot();
|
|
100
146
|
});
|
|
147
|
+
test('rendering isDotted', () => {
|
|
148
|
+
const {
|
|
149
|
+
asFragment
|
|
150
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
151
|
+
isDotted: true
|
|
152
|
+
}, "Heading 2 Test"));
|
|
153
|
+
expect(asFragment()).toMatchSnapshot();
|
|
154
|
+
});
|
|
101
155
|
test.each(ui_size)('Should render ui_size - %s', ui_size => {
|
|
102
156
|
const {
|
|
103
157
|
asFragment
|
|
@@ -107,6 +161,15 @@ describe('Typography', () => {
|
|
|
107
161
|
}, "Heading"));
|
|
108
162
|
expect(asFragment()).toMatchSnapshot();
|
|
109
163
|
});
|
|
164
|
+
test.each(ui_size)('Should render size - %s', size => {
|
|
165
|
+
const {
|
|
166
|
+
asFragment
|
|
167
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
168
|
+
isScrollAttribute: true,
|
|
169
|
+
size: size
|
|
170
|
+
}, "Heading"));
|
|
171
|
+
expect(asFragment()).toMatchSnapshot();
|
|
172
|
+
});
|
|
110
173
|
test.each(ui_lineClamp)('Should render ui_lineClamp - %s', ui_lineClamp => {
|
|
111
174
|
const {
|
|
112
175
|
asFragment
|
|
@@ -116,6 +179,15 @@ describe('Typography', () => {
|
|
|
116
179
|
}, "Heading"));
|
|
117
180
|
expect(asFragment()).toMatchSnapshot();
|
|
118
181
|
});
|
|
182
|
+
test.each(ui_lineClamp)('Should render lineClamp - %s', lineClamp => {
|
|
183
|
+
const {
|
|
184
|
+
asFragment
|
|
185
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
186
|
+
isScrollAttribute: true,
|
|
187
|
+
lineClamp: lineClamp
|
|
188
|
+
}, "Heading"));
|
|
189
|
+
expect(asFragment()).toMatchSnapshot();
|
|
190
|
+
});
|
|
119
191
|
test.each(ui_lineHeight)('Should render ui_lineHeight - %s', ui_lineHeight => {
|
|
120
192
|
const {
|
|
121
193
|
asFragment
|
|
@@ -125,6 +197,15 @@ describe('Typography', () => {
|
|
|
125
197
|
}, "Heading"));
|
|
126
198
|
expect(asFragment()).toMatchSnapshot();
|
|
127
199
|
});
|
|
200
|
+
test.each(ui_lineHeight)('Should render lineHeight - %s', lineHeight => {
|
|
201
|
+
const {
|
|
202
|
+
asFragment
|
|
203
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
204
|
+
isScrollAttribute: true,
|
|
205
|
+
lineHeight: lineHeight
|
|
206
|
+
}, "Heading"));
|
|
207
|
+
expect(asFragment()).toMatchSnapshot();
|
|
208
|
+
});
|
|
128
209
|
test.each(ui_display)('Should render ui_display - %s', ui_display => {
|
|
129
210
|
const {
|
|
130
211
|
asFragment
|
|
@@ -134,6 +215,15 @@ describe('Typography', () => {
|
|
|
134
215
|
}, "Heading"));
|
|
135
216
|
expect(asFragment()).toMatchSnapshot();
|
|
136
217
|
});
|
|
218
|
+
test.each(ui_display)('Should render display - %s', display => {
|
|
219
|
+
const {
|
|
220
|
+
asFragment
|
|
221
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
222
|
+
isScrollAttribute: true,
|
|
223
|
+
display: display
|
|
224
|
+
}, "Heading"));
|
|
225
|
+
expect(asFragment()).toMatchSnapshot();
|
|
226
|
+
});
|
|
137
227
|
test.each(ui_weight)('Should render ui_weight - %s', ui_weight => {
|
|
138
228
|
const {
|
|
139
229
|
asFragment
|
|
@@ -143,6 +233,15 @@ describe('Typography', () => {
|
|
|
143
233
|
}, "Heading"));
|
|
144
234
|
expect(asFragment()).toMatchSnapshot();
|
|
145
235
|
});
|
|
236
|
+
test.each(ui_weight)('Should render weight - %s', weight => {
|
|
237
|
+
const {
|
|
238
|
+
asFragment
|
|
239
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
240
|
+
isScrollAttribute: true,
|
|
241
|
+
weight: weight
|
|
242
|
+
}, "Heading"));
|
|
243
|
+
expect(asFragment()).toMatchSnapshot();
|
|
244
|
+
});
|
|
146
245
|
test.each(ui_typeFace)('Should render ui_typeFace - %s', ui_typeFace => {
|
|
147
246
|
const {
|
|
148
247
|
asFragment
|
|
@@ -152,6 +251,15 @@ describe('Typography', () => {
|
|
|
152
251
|
}, "Heading"));
|
|
153
252
|
expect(asFragment()).toMatchSnapshot();
|
|
154
253
|
});
|
|
254
|
+
test.each(ui_typeFace)('Should render typeFace - %s', typeFace => {
|
|
255
|
+
const {
|
|
256
|
+
asFragment
|
|
257
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
258
|
+
isScrollAttribute: true,
|
|
259
|
+
typeFace: typeFace
|
|
260
|
+
}, "Heading"));
|
|
261
|
+
expect(asFragment()).toMatchSnapshot();
|
|
262
|
+
});
|
|
155
263
|
test.each(ui_textAlign)('Should render ui_textAlign - %s', ui_textAlign => {
|
|
156
264
|
const {
|
|
157
265
|
asFragment
|
|
@@ -161,6 +269,15 @@ describe('Typography', () => {
|
|
|
161
269
|
}, "Heading"));
|
|
162
270
|
expect(asFragment()).toMatchSnapshot();
|
|
163
271
|
});
|
|
272
|
+
test.each(ui_textAlign)('Should render textAlign - %s', textAlign => {
|
|
273
|
+
const {
|
|
274
|
+
asFragment
|
|
275
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
276
|
+
isScrollAttribute: true,
|
|
277
|
+
textAlign: textAlign
|
|
278
|
+
}, "Heading"));
|
|
279
|
+
expect(asFragment()).toMatchSnapshot();
|
|
280
|
+
});
|
|
164
281
|
test.each(ui_letterSpacing)('Should render ui_letterSpacing - %s', ui_letterSpacing => {
|
|
165
282
|
const {
|
|
166
283
|
asFragment
|
|
@@ -170,6 +287,15 @@ describe('Typography', () => {
|
|
|
170
287
|
}, "Heading"));
|
|
171
288
|
expect(asFragment()).toMatchSnapshot();
|
|
172
289
|
});
|
|
290
|
+
test.each(ui_letterSpacing)('Should render letterSpacing - %s', letterSpacing => {
|
|
291
|
+
const {
|
|
292
|
+
asFragment
|
|
293
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
294
|
+
isScrollAttribute: true,
|
|
295
|
+
letterSpacing: letterSpacing
|
|
296
|
+
}, "Heading"));
|
|
297
|
+
expect(asFragment()).toMatchSnapshot();
|
|
298
|
+
});
|
|
173
299
|
test.each(ui_transform)('Should render ui_transform - %s', ui_transform => {
|
|
174
300
|
const {
|
|
175
301
|
asFragment
|
|
@@ -179,6 +305,15 @@ describe('Typography', () => {
|
|
|
179
305
|
}, "Heading"));
|
|
180
306
|
expect(asFragment()).toMatchSnapshot();
|
|
181
307
|
});
|
|
308
|
+
test.each(ui_transform)('Should render transform - %s', transform => {
|
|
309
|
+
const {
|
|
310
|
+
asFragment
|
|
311
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
312
|
+
isScrollAttribute: true,
|
|
313
|
+
transform: transform
|
|
314
|
+
}, "Heading"));
|
|
315
|
+
expect(asFragment()).toMatchSnapshot();
|
|
316
|
+
});
|
|
182
317
|
test.each(ui_decoration)('Should render ui_decoration - %s', ui_decoration => {
|
|
183
318
|
const {
|
|
184
319
|
asFragment
|
|
@@ -188,6 +323,15 @@ describe('Typography', () => {
|
|
|
188
323
|
}, "Heading"));
|
|
189
324
|
expect(asFragment()).toMatchSnapshot();
|
|
190
325
|
});
|
|
326
|
+
test.each(ui_decoration)('Should render decoration - %s', decoration => {
|
|
327
|
+
const {
|
|
328
|
+
asFragment
|
|
329
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
330
|
+
isScrollAttribute: true,
|
|
331
|
+
decoration: decoration
|
|
332
|
+
}, "Heading"));
|
|
333
|
+
expect(asFragment()).toMatchSnapshot();
|
|
334
|
+
});
|
|
191
335
|
test('rendering ui_className', () => {
|
|
192
336
|
const {
|
|
193
337
|
asFragment
|
|
@@ -196,6 +340,14 @@ describe('Typography', () => {
|
|
|
196
340
|
}, "Heading 2 Test"));
|
|
197
341
|
expect(asFragment()).toMatchSnapshot();
|
|
198
342
|
});
|
|
343
|
+
test('rendering customClass', () => {
|
|
344
|
+
const {
|
|
345
|
+
asFragment
|
|
346
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
347
|
+
customClass: "custom-class"
|
|
348
|
+
}, "Heading 2 Test"));
|
|
349
|
+
expect(asFragment()).toMatchSnapshot();
|
|
350
|
+
});
|
|
199
351
|
test.each(ui_wordBreak)('Should render ui_wordBreak - %s', ui_wordBreak => {
|
|
200
352
|
const {
|
|
201
353
|
asFragment
|
|
@@ -205,6 +357,15 @@ describe('Typography', () => {
|
|
|
205
357
|
}, "Heading"));
|
|
206
358
|
expect(asFragment()).toMatchSnapshot();
|
|
207
359
|
});
|
|
360
|
+
test.each(ui_wordBreak)('Should render wordBreak - %s', wordBreak => {
|
|
361
|
+
const {
|
|
362
|
+
asFragment
|
|
363
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
364
|
+
isScrollAttribute: true,
|
|
365
|
+
wordBreak: wordBreak
|
|
366
|
+
}, "Heading"));
|
|
367
|
+
expect(asFragment()).toMatchSnapshot();
|
|
368
|
+
});
|
|
208
369
|
test.each(ui_wordWrap)('Should render ui_wordWrap - %s', ui_wordWrap => {
|
|
209
370
|
const {
|
|
210
371
|
asFragment
|
|
@@ -214,6 +375,15 @@ describe('Typography', () => {
|
|
|
214
375
|
}, "Heading"));
|
|
215
376
|
expect(asFragment()).toMatchSnapshot();
|
|
216
377
|
});
|
|
378
|
+
test.each(ui_wordWrap)('Should render wordWrap - %s', wordWrap => {
|
|
379
|
+
const {
|
|
380
|
+
asFragment
|
|
381
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
382
|
+
isScrollAttribute: true,
|
|
383
|
+
wordWrap: wordWrap
|
|
384
|
+
}, "Heading"));
|
|
385
|
+
expect(asFragment()).toMatchSnapshot();
|
|
386
|
+
});
|
|
217
387
|
test.each(ui_whiteSpace)('Should render ui_whiteSpace - %s', ui_whiteSpace => {
|
|
218
388
|
const {
|
|
219
389
|
asFragment
|
|
@@ -223,6 +393,15 @@ describe('Typography', () => {
|
|
|
223
393
|
}, "Heading"));
|
|
224
394
|
expect(asFragment()).toMatchSnapshot();
|
|
225
395
|
});
|
|
396
|
+
test.each(ui_whiteSpace)('Should render whiteSpace - %s', whiteSpace => {
|
|
397
|
+
const {
|
|
398
|
+
asFragment
|
|
399
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
400
|
+
isScrollAttribute: true,
|
|
401
|
+
whiteSpace: whiteSpace
|
|
402
|
+
}, "Heading"));
|
|
403
|
+
expect(asFragment()).toMatchSnapshot();
|
|
404
|
+
});
|
|
226
405
|
});
|
|
227
406
|
describe('Typography with highlight', () => {
|
|
228
407
|
test('should render highlighted word', () => {
|
|
@@ -238,6 +417,19 @@ describe('Typography with highlight', () => {
|
|
|
238
417
|
}, "The sun was bright, the sun was warm, the sun was high in the sky."));
|
|
239
418
|
expect(asFragment()).toMatchSnapshot();
|
|
240
419
|
});
|
|
420
|
+
test('should render highlighted word with highlightConfig', () => {
|
|
421
|
+
const {
|
|
422
|
+
asFragment
|
|
423
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
424
|
+
highlightConfig: {
|
|
425
|
+
data: ['sun'],
|
|
426
|
+
styleConfiguration: {
|
|
427
|
+
$ui_weight: 'bold'
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, "The sun was bright, the sun was warm, the sun was high in the sky."));
|
|
431
|
+
expect(asFragment()).toMatchSnapshot();
|
|
432
|
+
});
|
|
241
433
|
test('should render highlight by Index', () => {
|
|
242
434
|
const {
|
|
243
435
|
asFragment
|
|
@@ -321,7 +513,7 @@ describe('Typography with highlight', () => {
|
|
|
321
513
|
}, "The sun was bright, the moon was bright, the sun and moon again."));
|
|
322
514
|
expect(asFragment()).toMatchSnapshot();
|
|
323
515
|
});
|
|
324
|
-
test('should render with global
|
|
516
|
+
test('should render with global tag name applied to all highlights', () => {
|
|
325
517
|
const {
|
|
326
518
|
asFragment
|
|
327
519
|
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -331,22 +523,22 @@ describe('Typography with highlight', () => {
|
|
|
331
523
|
}, {
|
|
332
524
|
text: 'moon'
|
|
333
525
|
}],
|
|
334
|
-
|
|
526
|
+
as: 'i'
|
|
335
527
|
}
|
|
336
528
|
}, "The sun and moon were bright."));
|
|
337
529
|
expect(asFragment()).toMatchSnapshot();
|
|
338
530
|
});
|
|
339
|
-
test('should render with separate
|
|
531
|
+
test('should render with separate tag name for each highlighted word', () => {
|
|
340
532
|
const {
|
|
341
533
|
asFragment
|
|
342
534
|
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
343
535
|
$ui_highlightConfig: {
|
|
344
536
|
data: [{
|
|
345
537
|
text: 'sun',
|
|
346
|
-
|
|
538
|
+
as: 'i'
|
|
347
539
|
}, {
|
|
348
540
|
text: 'moon',
|
|
349
|
-
|
|
541
|
+
as: 'u'
|
|
350
542
|
}]
|
|
351
543
|
}
|
|
352
544
|
}, "The sun and moon were bright."));
|