@zohodesk/components 1.0.0-temp-226 → 1.0.0-temp-225-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/.cli/propValidation_report.html +1 -1
- package/README.md +52 -21
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +5 -9
- package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +0 -5
- package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +0 -5
- package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +0 -5
- package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +0 -5
- package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +0 -5
- package/assets/Appearance/light/mode/Component_LightMode.module.css +5 -9
- package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +0 -5
- package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +0 -5
- package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +0 -5
- package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +0 -5
- package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +0 -5
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +5 -9
- package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +0 -5
- package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +0 -5
- package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +0 -5
- package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +0 -5
- package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +0 -5
- package/es/Button/Button.js +2 -0
- package/es/Button/__tests__/Button.spec.js +1 -134
- package/es/Button/css/Button.module.css +14 -50
- package/es/Button/css/cssJSLogic.js +1 -10
- package/es/DateTime/__tests__/YearView.spec.js +2 -1
- package/es/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +61 -0
- package/es/ListItem/ListItem.js +12 -3
- package/es/ListItem/ListItem.module.css +9 -0
- package/es/ListItem/props/propTypes.js +2 -1
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +1 -8
- package/es/Provider/IdProvider.js +1 -1
- package/es/Provider/LibraryContext.js +1 -3
- package/es/Select/__tests__/Select.spec.js +4 -1130
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -9621
- package/es/Tag/__tests__/Tag.spec.js +1 -8
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -40
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +1 -4
- package/lib/Button/Button.js +2 -0
- package/lib/Button/__tests__/Button.spec.js +0 -140
- package/lib/Button/css/Button.module.css +14 -50
- package/lib/Button/css/cssJSLogic.js +2 -15
- package/lib/DateTime/__tests__/YearView.spec.js +2 -1
- package/lib/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +61 -0
- package/lib/ListItem/ListItem.js +12 -3
- package/lib/ListItem/ListItem.module.css +9 -0
- package/lib/ListItem/props/propTypes.js +2 -1
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +0 -8
- package/lib/Provider/IdProvider.js +0 -1
- package/lib/Provider/LibraryContext.js +1 -3
- package/lib/Select/__tests__/Select.spec.js +3 -1364
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -9621
- package/lib/Tag/__tests__/Tag.spec.js +2 -10
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +26 -80
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +1 -4
- package/package.json +2 -2
- package/result.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
# DOT Style Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
In this Package, we Provide Some Basic Components to Build Web App
|
|
4
|
+
|
|
5
|
+
- Avatar
|
|
6
|
+
- AvatarTeam
|
|
7
|
+
- Accordion
|
|
8
|
+
- Animation
|
|
9
|
+
- Button
|
|
10
|
+
- Buttongroup
|
|
11
|
+
- Card
|
|
12
|
+
- CheckBox
|
|
13
|
+
- DateTime
|
|
14
|
+
- DropBox
|
|
15
|
+
- Icon
|
|
16
|
+
- Label
|
|
17
|
+
- Layout
|
|
18
|
+
- ListItem
|
|
19
|
+
- MultiSelect
|
|
20
|
+
- Popup
|
|
21
|
+
- Radio
|
|
22
|
+
- Responsive
|
|
23
|
+
- Ribbon
|
|
24
|
+
- Select
|
|
25
|
+
- GroupSelect
|
|
26
|
+
- Stencils
|
|
27
|
+
- Switch
|
|
28
|
+
- Tab
|
|
29
|
+
- Tag
|
|
30
|
+
- Textarea
|
|
31
|
+
- TextBox
|
|
32
|
+
- TextBoxIcon
|
|
33
|
+
- Tooltip
|
|
34
|
+
|
|
35
|
+
# 1.3.3
|
|
36
|
+
|
|
37
|
+
- **ListItem**
|
|
38
|
+
- Added `SecondaryValue` prop to supported.
|
|
4
39
|
|
|
5
40
|
# 1.3.2
|
|
6
41
|
|
|
7
42
|
- **Popup**
|
|
8
43
|
- Added `scrollDebounceTime` prop to support debounce control for fixed popup scroll behavior.
|
|
9
|
-
|
|
10
|
-
- `onEnterComplete` - Callback triggered after enter animation completes.
|
|
11
|
-
- `onExitComplete` - Callback triggered after exit animation completes.
|
|
12
|
-
- `postEnterStyles` - Inline styles applied to the element once the enter animation has finished.
|
|
13
|
-
|
|
44
|
+
|
|
14
45
|
# 1.3.1
|
|
15
46
|
|
|
16
47
|
- **dropDownUtils** - The isObjectContainsSearchString function logic has been updated to use some instead of filter, and additional conditions have been added to prevent potential runtime issues.
|
|
@@ -18,7 +49,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
18
49
|
# 1.3.0
|
|
19
50
|
|
|
20
51
|
- **AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar** - searchFields prop supported
|
|
21
|
-
-
|
|
52
|
+
- **AdvancedMultiSelect, MultiSelectWithAvatar** - secondaryField prop supported
|
|
22
53
|
- **ListContainer** - align prop supported
|
|
23
54
|
- **ListItemWithAvatar** - secondaryValue, lhsAlignContent prop supported
|
|
24
55
|
- **ListItemWithCheckBox, ListItemWithIcon, ListItemWithRadio** - secondaryValue, lhsAlignContent, lhsJustifyContent prop supported
|
|
@@ -36,11 +67,11 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
36
67
|
|
|
37
68
|
# 1.2.61
|
|
38
69
|
|
|
39
|
-
- **Textarea** -
|
|
70
|
+
- **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
|
|
40
71
|
|
|
41
72
|
# 1.2.60
|
|
42
73
|
|
|
43
|
-
- **Textarea** -
|
|
74
|
+
- **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
|
|
44
75
|
|
|
45
76
|
# 1.2.59
|
|
46
77
|
|
|
@@ -53,23 +84,25 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
53
84
|
# 1.2.57
|
|
54
85
|
|
|
55
86
|
- **Popup**
|
|
87
|
+
|
|
56
88
|
- Fixed popup scroll behavior is now supported using the `isOutsideScrollBlocked` flag. When set to `false` (default).
|
|
57
89
|
|
|
58
90
|
- **DropBoxElement**
|
|
59
91
|
- **Attributes Added**: The `data-box-direction` and `data-arrow-position` attributes have been added to facilitate the use of component-level CSS selectors.
|
|
60
92
|
- **CSS Selectors**: Added support for `arrow`, `paddingSpace`, `shadow`, and `boxdirection` to facilitate the behavior of the dropbox using CSS selectors.
|
|
61
|
-
|
|
93
|
+
|
|
62
94
|
# 1.2.56
|
|
63
95
|
|
|
64
|
-
- **CheckBox**
|
|
96
|
+
- **CheckBox**
|
|
65
97
|
- `data-selector-id` passing to Container component changed to `dataSelectorId`
|
|
66
98
|
|
|
67
99
|
# 1.2.55
|
|
68
100
|
|
|
69
|
-
- **ListItemWithAvatar**
|
|
101
|
+
- **ListItemWithAvatar**
|
|
102
|
+
|
|
70
103
|
- `AvatarTeamProps` and `AvatarProps` props has been added under the `customProps` group.
|
|
71
104
|
|
|
72
|
-
- **Tag**
|
|
105
|
+
- **Tag**
|
|
73
106
|
- `avatarProps` and `iconProps` prop has been added under the `customProps` group.
|
|
74
107
|
|
|
75
108
|
# 1.2.54
|
|
@@ -77,7 +110,6 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
77
110
|
- **Reverted 1.2.45 MultiSelect Fix**
|
|
78
111
|
- The issue with the non-scrollable API call trigger in multiselect, introduced in version `1.2.45`, has been `reverted` in this version.
|
|
79
112
|
|
|
80
|
-
|
|
81
113
|
# 1.2.53
|
|
82
114
|
|
|
83
115
|
- **CheckBox** - Disabled State CheckBox Color Fixed
|
|
@@ -103,7 +135,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
103
135
|
- **DateTime (v0&v1), CalendarView (v0&v1)**
|
|
104
136
|
|
|
105
137
|
- Week starting day customization support added with `weekStartDay` props and week holiday customization support with `holidays` prop
|
|
106
|
-
|
|
138
|
+
|
|
107
139
|
- **DateWidget (v0&v1)**
|
|
108
140
|
|
|
109
141
|
- Support has been added for `weekStartDay`, `holidays` props
|
|
@@ -112,7 +144,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
112
144
|
|
|
113
145
|
- `holidays` prop added for holiday column indication
|
|
114
146
|
|
|
115
|
-
# 1.2.49
|
|
147
|
+
# 1.2.49
|
|
116
148
|
|
|
117
149
|
- **Popup**
|
|
118
150
|
- `isOutsideScrollBlocked` prop supported - Scroll blocking behaviours supported
|
|
@@ -125,7 +157,6 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
125
157
|
- **ResizeObserver**
|
|
126
158
|
|
|
127
159
|
- The ResizeObserver PolyFill code has been removed, and a separate copy with the PolyFill included is saved under the filename ResizeObserverWithPolyfill.js
|
|
128
|
-
|
|
129
160
|
|
|
130
161
|
# 1.2.47
|
|
131
162
|
|
|
@@ -222,10 +253,10 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
222
253
|
|
|
223
254
|
- **MultiSelect**
|
|
224
255
|
- `dataId` support has been added for the ResponsiveDropBox Component.
|
|
225
|
-
- The `dataId` will be reflected as `dataId` with the suffix "_dropbox".
|
|
256
|
+
- The `dataId` will be reflected as `dataId` with the suffix "\_dropbox".
|
|
226
257
|
- **DateWidget**
|
|
227
258
|
- `dataId` support has been added for the datePicker icon.
|
|
228
|
-
- The `dataId` will be reflected as `dataId` with the suffix "_datePicker".
|
|
259
|
+
- The `dataId` will be reflected as `dataId` with the suffix "\_datePicker".
|
|
229
260
|
|
|
230
261
|
# 1.2.34
|
|
231
262
|
|
|
@@ -390,7 +421,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
390
421
|
|
|
391
422
|
# 1.1.1
|
|
392
423
|
|
|
393
|
-
- ComponentTheme file --
|
|
424
|
+
- ComponentTheme file --zdt\_ prefix missing changes
|
|
394
425
|
|
|
395
426
|
# 1.1.0
|
|
396
427
|
|
|
@@ -418,7 +449,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
418
449
|
|
|
419
450
|
# 1.0.0-alpha-275
|
|
420
451
|
|
|
421
|
-
- **DateTime** - millisecond and second should work only when customDateFormat is given issue fixed. this fix related to
|
|
452
|
+
- **DateTime** - millisecond and second should work only when customDateFormat is given issue fixed. this fix related to _1.0.0-alpha-272_
|
|
422
453
|
|
|
423
454
|
# 1.0.0-alpha-274
|
|
424
455
|
|
|
@@ -58,26 +58,22 @@
|
|
|
58
58
|
--zdt_button_primaryfill_bg: var(--zdt_cta_primary_bg);
|
|
59
59
|
--zdt_button_primaryfill_border: var(--dot_mirror);
|
|
60
60
|
--zdt_button_primaryfill_hover_bg: var(--zdt_cta_primary_hover_bg);
|
|
61
|
-
--zdt_button_secondaryfill_bg: var(--
|
|
61
|
+
--zdt_button_secondaryfill_bg: var(--zdtm_cta_grey_10_bg_default);
|
|
62
62
|
--zdt_button_dangerfill_bg: hsla(0, 100.00%, calc(70.98% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
63
63
|
--zdt_button_dangerfill_text: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
64
64
|
--zdt_button_dangerfill_hover_bg: hsla(1, 63.86%, calc(48.82% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
65
65
|
--zdt_button_successfill_border: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
66
|
-
--zdt_button_successfill_bg: hsla(133, 48.36%, calc(52.16% + var(--
|
|
66
|
+
--zdt_button_successfill_bg: hsla(133, 48.36%, calc(52.16% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
67
67
|
--zdt_button_successfill_hover_border: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
68
|
-
--zdt_button_successfill_hover_bg: hsla(134, 67.66%, calc(32.75% + var(--
|
|
69
|
-
--zdt_button_tertiaryfill_bg: hsla(217, 13.73%, calc(70.00% + var(--
|
|
70
|
-
--zdt_button_tertiaryfill_hover_bg: hsla(217, 7.76%, calc(54.51% + var(--
|
|
68
|
+
--zdt_button_successfill_hover_bg: hsla(134, 67.66%, calc(32.75% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
69
|
+
--zdt_button_tertiaryfill_bg: hsla(217, 13.73%, calc(70.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
70
|
+
--zdt_button_tertiaryfill_hover_bg: hsla(217, 7.76%, calc(54.51% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
71
71
|
--zdt_button_success_default_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
72
72
|
--zdt_button_tick_primary_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
73
73
|
--zdt_button_loading_default_bg: hsla(217, 23.08%, calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
74
74
|
--zdt_button_loading_linear_gradient: linear-gradient(0deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%) 0% 100%;
|
|
75
75
|
--zdt_button_loading_primary_linear_gradient: linear-gradient(0deg, rgba(71, 157, 255, 1) 50%, rgba(71, 157, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(71, 157, 255, 0.9) 0%, rgba(71, 157, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(71, 157, 255, 0.6) 0%, rgba(71, 157, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(71, 157, 255, 0.3) 0%, rgba(71, 157, 255, 0) 100%) 0% 100%;
|
|
76
76
|
--zdt_button_loading_danger_linear_gradient: linear-gradient(0deg, rgba(255, 107, 107, 1) 50%, rgba(255, 107, 107, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 107, 107, 0.9) 0%, rgba(255, 107, 107, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 107, 107, 0.6) 0%, rgba(255, 107, 107, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0) 100%) 0% 100%;
|
|
77
|
-
--zdt_button_dangerFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
78
|
-
--zdt_button_successFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
79
|
-
--zdt_button_danger_strike: hsla(0, 77.78%, calc(61.18% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
80
|
-
--zdt_button_tertiaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
81
77
|
|
|
82
78
|
/* button group */
|
|
83
79
|
--zdt_buttongroup_default_bg: hsla(217, 23.08%, calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(71,157,255);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(212, 100.00%, calc(63.92% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(216, 22.98%, calc(31.57% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(69,161,89);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(133, 40.00%, calc(45.10% + var(--zdc_default_inverse_low)), calc( 0.45 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(216, 22.98%, calc(31.57% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(255,128,31);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(26, 100.00%, calc(56.08% + var(--zdc_default_inverse_low)), calc( 0.33 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(216, 22.98%, calc(31.57% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(233,79,79);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(0, 77.78%, calc(61.18% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(216, 22.98%, calc(31.57% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(215,152,53);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(37, 66.94%, calc(52.55% + var(--zdc_default_inverse_low)), calc( 0.33 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(216, 22.98%, calc(31.57% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -58,26 +58,22 @@
|
|
|
58
58
|
--zdt_button_primaryfill_bg: var(--zdt_cta_primary_bg);
|
|
59
59
|
--zdt_button_primaryfill_border: var(--dot_mirror);
|
|
60
60
|
--zdt_button_primaryfill_hover_bg: var(--zdt_cta_primary_hover_bg);
|
|
61
|
-
--zdt_button_secondaryfill_bg: var(--
|
|
61
|
+
--zdt_button_secondaryfill_bg: var(--zdtm_cta_grey_10_bg_default);
|
|
62
62
|
--zdt_button_dangerfill_bg: hsla(0, 71.91%, calc(53.92% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
63
63
|
--zdt_button_dangerfill_text: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
64
64
|
--zdt_button_dangerfill_hover_bg: hsla(1, 75.38%, calc(38.24% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
65
65
|
--zdt_button_successfill_border: hsla(133, 63.29%, calc(40.59% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
66
|
-
--zdt_button_successfill_bg: hsla(133, 63.29%, calc(40.59% + var(--
|
|
66
|
+
--zdt_button_successfill_bg: hsla(133, 63.29%, calc(40.59% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
67
67
|
--zdt_button_successfill_hover_border: hsla(134, 78.63%, calc(25.69% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
68
|
-
--zdt_button_successfill_hover_bg: hsla(134, 78.63%, calc(25.69% + var(--
|
|
69
|
-
--zdt_button_tertiaryfill_bg: hsla(220, 10.45%, calc(39.41% + var(--
|
|
70
|
-
--zdt_button_tertiaryfill_hover_bg: hsla(218, 9.76%, calc(51.76% + var(--
|
|
68
|
+
--zdt_button_successfill_hover_bg: hsla(134, 78.63%, calc(25.69% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
69
|
+
--zdt_button_tertiaryfill_bg: hsla(220, 10.45%, calc(39.41% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
70
|
+
--zdt_button_tertiaryfill_hover_bg: hsla(218, 9.76%, calc(51.76% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
71
71
|
--zdt_button_success_default_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
72
72
|
--zdt_button_tick_primary_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
73
73
|
--zdt_button_loading_default_bg: hsla(0, 0.00%, calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
74
74
|
--zdt_button_loading_linear_gradient: linear-gradient(0deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%) 0% 100%;
|
|
75
75
|
--zdt_button_loading_primary_linear_gradient: linear-gradient(0deg, rgba(10, 115, 235, 1) 50%, rgba(10, 115, 235, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(10, 115, 235, 0.9) 0%, rgba(10, 115, 235, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(10, 115, 235, 0.6) 0%, rgba(10, 115, 235, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(10, 115, 235, 0.3) 0%, rgba(10, 115, 235, 0) 100%) 0% 100%;
|
|
76
76
|
--zdt_button_loading_danger_linear_gradient: linear-gradient(0deg, rgba(222, 53, 53, 1) 50%, rgba(222, 53, 53, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(222, 53, 53, 0.9) 0%, rgba(222, 53, 53, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(222, 53, 53, 0.6) 0%, rgba(222, 53, 53, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(222, 53, 53, 0.3) 0%, rgba(222, 53, 53, 0) 100%) 0% 100%;
|
|
77
|
-
--zdt_button_dangerFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
78
|
-
--zdt_button_successFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
79
|
-
--zdt_button_danger_strike: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc( 0.30 + var(--zdc_alpha_low)));
|
|
80
|
-
--zdt_button_tertiaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
81
77
|
|
|
82
78
|
/* button group */
|
|
83
79
|
--zdt_buttongroup_default_bg: hsla(0, 0.00%, calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(10,115,235);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(212, 91.84%, calc(48.04% + var(--zdc_default_inverse_low)), calc( 0.30 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(231, 22.22%, calc(82.35% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(38,169,66);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(133, 63.29%, calc(40.59% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(135, 7.41%, calc(78.82% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(229,119,23);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(28, 81.75%, calc(49.41% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.45 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(27, 10.68%, calc(79.80% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(222,53,53);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc( 0.30 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(343, 4.76%, calc(71.18% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(232,185,35);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(46, 92.59%, calc(37.06% + var(--zdc_default_inverse_low)), calc( 0.45 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(42, 75.56%, calc(17.65% + var(--zdc_default_inverse_low)), calc( 0.30 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(45, 28.17%, calc(72.16% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -58,26 +58,22 @@
|
|
|
58
58
|
--zdt_button_primaryfill_bg: var(--zdt_cta_primary_bg);
|
|
59
59
|
--zdt_button_primaryfill_border: var(--dot_mirror);
|
|
60
60
|
--zdt_button_primaryfill_hover_bg: var(--zdt_cta_primary_hover_bg);
|
|
61
|
-
--zdt_button_secondaryfill_bg: var(--
|
|
61
|
+
--zdt_button_secondaryfill_bg: var(--zdtm_cta_grey_10_bg_default);
|
|
62
62
|
--zdt_button_dangerfill_bg: hsla(0, 100.00%, calc(70.98% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
63
63
|
--zdt_button_dangerfill_text: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
64
64
|
--zdt_button_dangerfill_hover_bg: hsla(1, 63.86%, calc(48.82% + var(--zdc_darker_low)), calc(1 + var(--zdc_alpha_low)));
|
|
65
65
|
--zdt_button_successfill_border: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
|
|
66
|
-
--zdt_button_successfill_bg: hsla(133, 48.36%, calc(52.16% + var(--
|
|
66
|
+
--zdt_button_successfill_bg: hsla(133, 48.36%, calc(52.16% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
67
67
|
--zdt_button_successfill_hover_border: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
68
|
-
--zdt_button_successfill_hover_bg: hsla(134, 67.66%, calc(32.75% + var(--
|
|
69
|
-
--zdt_button_tertiaryfill_bg: hsla(0, 0.00%, calc(60.00% + var(--
|
|
70
|
-
--zdt_button_tertiaryfill_hover_bg: hsla(217, 7.76%, calc(54.51% + var(--
|
|
68
|
+
--zdt_button_successfill_hover_bg: hsla(134, 67.66%, calc(32.75% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
69
|
+
--zdt_button_tertiaryfill_bg: hsla(0, 0.00%, calc(60.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
70
|
+
--zdt_button_tertiaryfill_hover_bg: hsla(217, 7.76%, calc(54.51% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
71
71
|
--zdt_button_success_default_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
72
72
|
--zdt_button_tick_primary_border: hsla(0, 0.00%, calc(100.00% + var(--zdc_lighter)), calc(1 + var(--zdc_alpha_high)));
|
|
73
73
|
--zdt_button_loading_default_bg: hsla(0, 0.00%, calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
74
74
|
--zdt_button_loading_linear_gradient: linear-gradient(0deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%) 0% 100%;
|
|
75
75
|
--zdt_button_loading_primary_linear_gradient: linear-gradient(0deg, rgba(71, 157, 255, 1) 50%, rgba(71, 157, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(71, 157, 255, 0.9) 0%, rgba(71, 157, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(71, 157, 255, 0.6) 0%, rgba(71, 157, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(71, 157, 255, 0.3) 0%, rgba(71, 157, 255, 0) 100%) 0% 100%;
|
|
76
76
|
--zdt_button_loading_danger_linear_gradient: linear-gradient(0deg, rgba(255, 107, 107, 1) 50%, rgba(255, 107, 107, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 107, 107, 0.9) 0%, rgba(255, 107, 107, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 107, 107, 0.6) 0%, rgba(255, 107, 107, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0) 100%) 0% 100%;
|
|
77
|
-
--zdt_button_dangerFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
78
|
-
--zdt_button_successFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
79
|
-
--zdt_button_danger_strike: hsla(0, 77.78%, calc(61.18% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
80
|
-
--zdt_button_tertiaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
81
77
|
|
|
82
78
|
/* button group */
|
|
83
79
|
--zdt_buttongroup_default_bg: hsla(0, 0.00%, calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(71,157,255);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(212, 100.00%, calc(63.92% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(0, 0.00%, calc(34.51% + var(--zdc_darker_low)), calc( 0.7 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css
CHANGED
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(69,161,89);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(133, 40.00%, calc(45.10% + var(--zdc_default_inverse_low)), calc( 0.45 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(0, 0.00%, calc(34.51% + var(--zdc_darker_low)), calc( 0.7 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css
CHANGED
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(255,128,31);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(26, 100.00%, calc(56.08% + var(--zdc_default_inverse_low)), calc( 0.33 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(0, 0.00%, calc(34.51% + var(--zdc_darker_low)), calc( 0.7 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(233,79,79);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(0, 77.78%, calc(61.18% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.35 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(0, 0.00%, calc(34.51% + var(--zdc_darker_low)), calc( 0.7 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css
CHANGED
|
@@ -42,9 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
/* focusscope */
|
|
44
44
|
--zdt_a11y_focusScope_focus_border: rgb(215,152,53);
|
|
45
|
-
|
|
46
|
-
/* button */
|
|
47
|
-
--zdt_button_primary_strike: hsla(37, 66.94%, calc(52.55% + var(--zdc_default_inverse_low)), calc( 0.33 + var(--zdc_alpha_low)));
|
|
48
|
-
--zdt_button_primaryFilled_strike: hsla(0, 0.00%, calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.40 + var(--zdc_alpha_low)));
|
|
49
|
-
--zdt_button_secondaryFilled_strike: hsla(0, 0.00%, calc(34.51% + var(--zdc_darker_low)), calc( 0.7 + var(--zdc_alpha_low)));
|
|
50
45
|
}
|
package/es/Button/Button.js
CHANGED
|
@@ -10,6 +10,8 @@ use children for both cases
|
|
|
10
10
|
toLowerCase check needed?
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small','medium','large','xlarge','button_medium','button_small','primary','primaryfilled','danger','dangerfilled','plainprimary', 'plainsecondary', 'secondary', 'secondaryfilled', 'successFilled','tertiaryFilled'] }] */
|
|
14
|
+
|
|
13
15
|
export default function Button(props) {
|
|
14
16
|
let {
|
|
15
17
|
text,
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '../Button';
|
|
3
|
-
import { render
|
|
4
|
-
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import '@testing-library/jest-dom';
|
|
6
|
-
afterEach(() => {
|
|
7
|
-
cleanup();
|
|
8
|
-
});
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
9
4
|
describe('Button component', () => {
|
|
10
5
|
test('Should be render with the basic set of default props', () => {
|
|
11
6
|
const {
|
|
@@ -111,132 +106,4 @@ describe('Button component', () => {
|
|
|
111
106
|
// const { asFragment } = render(<Button customStyle={{$medium: "buttonMedium"}} />);
|
|
112
107
|
// expect(asFragment()).toMatchSnapshot();
|
|
113
108
|
// });
|
|
114
|
-
});
|
|
115
|
-
describe('Button - Unit Testing', () => {
|
|
116
|
-
test('Should render with text prop', () => {
|
|
117
|
-
const {
|
|
118
|
-
getByText
|
|
119
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
120
|
-
text: "Click Me"
|
|
121
|
-
}));
|
|
122
|
-
expect(getByText('Click Me')).toBeInTheDocument();
|
|
123
|
-
});
|
|
124
|
-
test('Should render with children prop', () => {
|
|
125
|
-
const {
|
|
126
|
-
getByText
|
|
127
|
-
} = render( /*#__PURE__*/React.createElement(Button, null, "Click Me"));
|
|
128
|
-
expect(getByText('Click Me')).toBeInTheDocument();
|
|
129
|
-
});
|
|
130
|
-
test('Should apply custom styles from customStyle prop', () => {
|
|
131
|
-
const {
|
|
132
|
-
getByRole
|
|
133
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
134
|
-
customStyle: {
|
|
135
|
-
bold: 'customBoldClass'
|
|
136
|
-
}
|
|
137
|
-
})); // expect(getByRole('button').getAttribute('class')).toContain('customBoldClass');
|
|
138
|
-
|
|
139
|
-
expect(getByRole('button')).toHaveClass('customBoldClass');
|
|
140
|
-
});
|
|
141
|
-
test('Should apply custom classes from customClass prop', () => {
|
|
142
|
-
const {
|
|
143
|
-
getByRole
|
|
144
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
145
|
-
customClass: {
|
|
146
|
-
customButton: 'customButtonClass'
|
|
147
|
-
}
|
|
148
|
-
}));
|
|
149
|
-
expect(getByRole('button')).toHaveClass('customButtonClass');
|
|
150
|
-
});
|
|
151
|
-
test('Should be disabled when disabled prop is true', () => {
|
|
152
|
-
const {
|
|
153
|
-
getByRole
|
|
154
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
155
|
-
disabled: true
|
|
156
|
-
}));
|
|
157
|
-
expect(getByRole('button')).toBeDisabled();
|
|
158
|
-
});
|
|
159
|
-
test('Should expose element with getRef prop', () => {
|
|
160
|
-
const getRef = jest.fn();
|
|
161
|
-
const {
|
|
162
|
-
getByRole
|
|
163
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
164
|
-
getRef: getRef
|
|
165
|
-
}));
|
|
166
|
-
expect(getRef).toHaveBeenCalledWith(getByRole('button'));
|
|
167
|
-
});
|
|
168
|
-
test('Should trigger onClick function', () => {
|
|
169
|
-
const onClick = jest.fn();
|
|
170
|
-
const {
|
|
171
|
-
getByRole
|
|
172
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
173
|
-
onClick: onClick
|
|
174
|
-
})); // fireEvent.click(getByRole('button'));
|
|
175
|
-
|
|
176
|
-
userEvent.click(getByRole('button'));
|
|
177
|
-
expect(onClick).toHaveBeenCalled();
|
|
178
|
-
});
|
|
179
|
-
test('Should not trigger onClick when disabled', () => {
|
|
180
|
-
const onClick = jest.fn();
|
|
181
|
-
const {
|
|
182
|
-
getByRole
|
|
183
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
184
|
-
disabled: true,
|
|
185
|
-
onClick: onClick
|
|
186
|
-
}));
|
|
187
|
-
userEvent.click(getByRole('button'));
|
|
188
|
-
expect(onClick).not.toHaveBeenCalled();
|
|
189
|
-
});
|
|
190
|
-
test('Should render with correct data-id attribute', () => {
|
|
191
|
-
const {
|
|
192
|
-
getByRole
|
|
193
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
194
|
-
dataId: "testButton"
|
|
195
|
-
}));
|
|
196
|
-
expect(getByRole('button')).toHaveAttribute('data-id', 'testButton');
|
|
197
|
-
});
|
|
198
|
-
test('Should render with correct data-selector-id attribute', () => {
|
|
199
|
-
const {
|
|
200
|
-
getByRole
|
|
201
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
202
|
-
dataSelectorId: "testSelector"
|
|
203
|
-
}));
|
|
204
|
-
expect(getByRole('button')).toHaveAttribute('data-selector-id', 'testSelector');
|
|
205
|
-
});
|
|
206
|
-
test('Should render with correct title attribute', () => {
|
|
207
|
-
const {
|
|
208
|
-
getByRole
|
|
209
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
210
|
-
title: "Test Title"
|
|
211
|
-
}));
|
|
212
|
-
expect(getByRole('button')).toHaveAttribute('data-title', 'Test Title');
|
|
213
|
-
});
|
|
214
|
-
test('Should render with correct id attribute', () => {
|
|
215
|
-
const {
|
|
216
|
-
getByRole
|
|
217
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
218
|
-
id: "buttonElement"
|
|
219
|
-
}));
|
|
220
|
-
expect(getByRole('button')).toHaveAttribute('id', 'buttonElement');
|
|
221
|
-
});
|
|
222
|
-
test('Should apply a11y props correctly', () => {
|
|
223
|
-
const {
|
|
224
|
-
getByRole
|
|
225
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
226
|
-
a11y: {
|
|
227
|
-
'aria-label': 'test'
|
|
228
|
-
}
|
|
229
|
-
}));
|
|
230
|
-
expect(getByRole('button')).toHaveAttribute('aria-label', 'test');
|
|
231
|
-
});
|
|
232
|
-
test('Should apply customProps correctly', () => {
|
|
233
|
-
const {
|
|
234
|
-
getByRole
|
|
235
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
236
|
-
customProps: {
|
|
237
|
-
'data-custom-attr': 'true'
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
expect(getByRole('button')).toHaveAttribute('data-custom-attr', 'true');
|
|
241
|
-
});
|
|
242
109
|
});
|