@zohodesk/components 1.0.0-temp-256.1 → 1.0.0-temp-257.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/README.md +2 -19
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +0 -2
- package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +5 -20
- package/assets/Appearance/dark/themes/blue/blue_componentsCTA_DarkModifyCategory.module.css +0 -1
- package/assets/Appearance/dark/themes/green/green_componentsCTA_DarkModifyCategory.module.css +0 -1
- package/assets/Appearance/dark/themes/orange/orange_componentsCTA_DarkModifyCategory.module.css +0 -1
- package/assets/Appearance/dark/themes/red/red_componentsCTA_DarkModifyCategory.module.css +0 -1
- package/assets/Appearance/dark/themes/yellow/yellow_componentsCTA_DarkModifyCategory.module.css +0 -1
- package/assets/Appearance/light/mode/Component_LightMode.module.css +0 -2
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +5 -20
- package/assets/Appearance/light/themes/blue/blue_componentsCTA_LightModifyCategory.module.css +0 -1
- package/assets/Appearance/light/themes/green/green_componentsCTA_LightModifyCategory.module.css +0 -1
- package/assets/Appearance/light/themes/orange/orange_componentsCTA_LightModifyCategory.module.css +0 -1
- package/assets/Appearance/light/themes/red/red_componentsCTA_LightModifyCategory.module.css +0 -1
- package/assets/Appearance/light/themes/yellow/yellow_componentsCTA_LightModifyCategory.module.css +0 -1
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +0 -2
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +5 -20
- package/assets/Appearance/pureDark/themes/blue/blue_componentsCTA_PureDarkModifyCategory.module.css +0 -1
- package/assets/Appearance/pureDark/themes/green/green_componentsCTA_PureDarkModifyCategory.module.css +0 -1
- package/assets/Appearance/pureDark/themes/orange/orange_componentsCTA_PureDarkModifyCategory.module.css +0 -1
- package/assets/Appearance/pureDark/themes/red/red_componentsCTA_PureDarkModifyCategory.module.css +0 -1
- package/assets/Appearance/pureDark/themes/yellow/yellow_componentsCTA_PureDarkModifyCategory.module.css +0 -1
- package/es/ListItem/ListItem.js +1 -2
- package/es/ListItem/ListItemWithAvatar.js +3 -9
- package/es/ListItem/ListItemWithCheckBox.js +3 -9
- package/es/ListItem/ListItemWithIcon.js +2 -8
- package/es/ListItem/ListItemWithRadio.js +3 -9
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +0 -19
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +0 -19
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +0 -17
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +0 -19
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +0 -108
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +0 -212
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +0 -108
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +0 -210
- package/es/ListItem/props/defaultProps.js +0 -1
- package/es/ListItem/props/propTypes.js +3 -12
- package/es/Tab/Tab.js +13 -56
- package/es/Tab/Tab.module.css +4 -72
- package/es/Tab/TabWrapper.js +2 -6
- package/es/Tab/Tabs.js +14 -60
- package/es/Tab/Tabs.module.css +15 -84
- package/es/Tab/__tests__/Tab.spec.js +0 -87
- package/es/Tab/__tests__/Tabs.spec.js +0 -11
- package/es/Tab/__tests__/__snapshots__/Tab.spec.js.snap +0 -287
- package/es/Tab/__tests__/__snapshots__/Tabs.spec.js.snap +0 -32
- package/es/Tab/props/defaultProps.js +3 -10
- package/es/Tab/props/propTypes.js +4 -26
- package/es/Tab/utils/tabConfigs.js +0 -11
- package/es/v1/Button/Button.js +163 -106
- package/es/v1/Button/css/Button_v1.module.css +28 -16
- package/es/v1/Button/css/cssJSLogic.js +18 -3
- package/es/v1/Button/props/propTypes.js +14 -3
- package/es/v1/helpers/colorHelpers/background/backgroundColor.module.css +35 -35
- package/es/v1/helpers/colorHelpers/border/borderColor.module.css +20 -20
- package/es/v1/helpers/colorHelpers/text/textColor.module.css +35 -35
- package/lib/ListItem/ListItem.js +1 -3
- package/lib/ListItem/ListItemWithAvatar.js +3 -11
- package/lib/ListItem/ListItemWithCheckBox.js +3 -11
- package/lib/ListItem/ListItemWithIcon.js +2 -8
- package/lib/ListItem/ListItemWithRadio.js +3 -11
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +0 -23
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +0 -23
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +0 -21
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +0 -23
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +0 -108
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +0 -212
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +0 -108
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +0 -210
- package/lib/ListItem/props/defaultProps.js +0 -1
- package/lib/ListItem/props/propTypes.js +4 -12
- package/lib/Tab/Tab.js +11 -59
- package/lib/Tab/Tab.module.css +4 -72
- package/lib/Tab/TabWrapper.js +2 -6
- package/lib/Tab/Tabs.js +11 -57
- package/lib/Tab/Tabs.module.css +15 -84
- package/lib/Tab/__tests__/Tab.spec.js +0 -88
- package/lib/Tab/__tests__/Tabs.spec.js +0 -12
- package/lib/Tab/__tests__/__snapshots__/Tab.spec.js.snap +0 -287
- package/lib/Tab/__tests__/__snapshots__/Tabs.spec.js.snap +0 -32
- package/lib/Tab/props/defaultProps.js +3 -10
- package/lib/Tab/props/propTypes.js +4 -28
- package/lib/Tab/utils/tabConfigs.js +2 -15
- package/lib/v1/Button/Button.js +182 -118
- package/lib/v1/Button/css/Button_v1.module.css +28 -16
- package/lib/v1/Button/css/cssJSLogic.js +19 -7
- package/lib/v1/Button/props/propTypes.js +14 -3
- package/lib/v1/helpers/colorHelpers/background/backgroundColor.module.css +35 -35
- package/lib/v1/helpers/colorHelpers/border/borderColor.module.css +20 -20
- package/lib/v1/helpers/colorHelpers/text/textColor.module.css +35 -35
- package/package.json +7 -7
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import Tab from "../Tab";
|
|
4
|
-
|
|
5
|
-
const noop = () => {};
|
|
6
|
-
|
|
7
4
|
describe('Tab', () => {
|
|
8
5
|
test('rendering the defult props', () => {
|
|
9
6
|
const {
|
|
@@ -11,88 +8,4 @@ describe('Tab', () => {
|
|
|
11
8
|
} = render( /*#__PURE__*/React.createElement(Tab, null));
|
|
12
9
|
expect(asFragment()).toMatchSnapshot();
|
|
13
10
|
});
|
|
14
|
-
describe('variant-based label rendering', () => {
|
|
15
|
-
test('variant="text" renders text only', () => {
|
|
16
|
-
const {
|
|
17
|
-
asFragment
|
|
18
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
19
|
-
id: "t1",
|
|
20
|
-
text: "Home",
|
|
21
|
-
variant: "text",
|
|
22
|
-
onSelect: noop
|
|
23
|
-
}));
|
|
24
|
-
expect(asFragment()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
test('variant="icon" renders icon and suppresses text label', () => {
|
|
27
|
-
const {
|
|
28
|
-
asFragment
|
|
29
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
30
|
-
id: "t2",
|
|
31
|
-
text: "Home",
|
|
32
|
-
variant: "icon",
|
|
33
|
-
iconName: "ZD-TB-menu",
|
|
34
|
-
onSelect: noop
|
|
35
|
-
}));
|
|
36
|
-
expect(asFragment()).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
test('variant="iconWithText" renders icon followed by text', () => {
|
|
39
|
-
const {
|
|
40
|
-
asFragment
|
|
41
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
42
|
-
id: "t3",
|
|
43
|
-
text: "Home",
|
|
44
|
-
variant: "iconWithText",
|
|
45
|
-
iconName: "ZD-TB-menu",
|
|
46
|
-
onSelect: noop
|
|
47
|
-
}));
|
|
48
|
-
expect(asFragment()).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('renderBefore / renderAfter slots', () => {
|
|
52
|
-
test('renderBefore renders a node to the left of the label', () => {
|
|
53
|
-
const {
|
|
54
|
-
asFragment
|
|
55
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
56
|
-
id: "t6",
|
|
57
|
-
text: "Home",
|
|
58
|
-
renderBefore: /*#__PURE__*/React.createElement("span", null, "\u25C0"),
|
|
59
|
-
onSelect: noop
|
|
60
|
-
}));
|
|
61
|
-
expect(asFragment()).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
test('renderAfter renders a node to the right of the label', () => {
|
|
64
|
-
const {
|
|
65
|
-
asFragment
|
|
66
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
67
|
-
id: "t7",
|
|
68
|
-
text: "Home",
|
|
69
|
-
renderAfter: /*#__PURE__*/React.createElement("span", null, "3"),
|
|
70
|
-
onSelect: noop
|
|
71
|
-
}));
|
|
72
|
-
expect(asFragment()).toMatchSnapshot();
|
|
73
|
-
});
|
|
74
|
-
test('renderBefore and renderAfter both render around the label', () => {
|
|
75
|
-
const {
|
|
76
|
-
asFragment
|
|
77
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
78
|
-
id: "t8",
|
|
79
|
-
text: "Home",
|
|
80
|
-
renderBefore: /*#__PURE__*/React.createElement("span", null, "\u25C0"),
|
|
81
|
-
renderAfter: /*#__PURE__*/React.createElement("span", null, "\u25B6"),
|
|
82
|
-
onSelect: noop
|
|
83
|
-
}));
|
|
84
|
-
expect(asFragment()).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
test('renderBefore as function renders custom node', () => {
|
|
87
|
-
const {
|
|
88
|
-
asFragment
|
|
89
|
-
} = render( /*#__PURE__*/React.createElement(Tab, {
|
|
90
|
-
id: "t9",
|
|
91
|
-
text: "Home",
|
|
92
|
-
renderBefore: () => /*#__PURE__*/React.createElement("span", null, "\u25C0"),
|
|
93
|
-
onSelect: noop
|
|
94
|
-
}));
|
|
95
|
-
expect(asFragment()).toMatchSnapshot();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
11
|
});
|
|
@@ -8,15 +8,4 @@ describe('Tabs', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(Tabs, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
-
test('renders custom more-button icon via renderMoreTarget', () => {
|
|
12
|
-
const customIcon = /*#__PURE__*/React.createElement("span", {
|
|
13
|
-
"data-testid": "custom-more-icon"
|
|
14
|
-
}, "\u2022\u2022\u2022");
|
|
15
|
-
const {
|
|
16
|
-
asFragment
|
|
17
|
-
} = render( /*#__PURE__*/React.createElement(Tabs, {
|
|
18
|
-
renderMoreTarget: customIcon
|
|
19
|
-
}));
|
|
20
|
-
expect(asFragment()).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
11
|
});
|
|
@@ -1,187 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
-
exports[`Tab renderBefore / renderAfter slots renderAfter renders a node to the right of the label 1`] = `
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<div
|
|
6
|
-
aria-controls="t7"
|
|
7
|
-
aria-label="Home"
|
|
8
|
-
aria-selected="false"
|
|
9
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
10
|
-
data-id="tabMenu_Tab"
|
|
11
|
-
data-key="t7"
|
|
12
|
-
data-selector-id="tab"
|
|
13
|
-
data-test-id="tabMenu_Tab"
|
|
14
|
-
role="link"
|
|
15
|
-
tabindex="0"
|
|
16
|
-
>
|
|
17
|
-
<div
|
|
18
|
-
class="textContainer flex cover rowdir both"
|
|
19
|
-
data-id="containerComponent"
|
|
20
|
-
data-selector-id="container"
|
|
21
|
-
data-test-id="containerComponent"
|
|
22
|
-
>
|
|
23
|
-
<div
|
|
24
|
-
class="tabText grow basisAuto shrinkOff"
|
|
25
|
-
data-id="boxComponent"
|
|
26
|
-
data-selector-id="box"
|
|
27
|
-
data-test-id="boxComponent"
|
|
28
|
-
>
|
|
29
|
-
Home
|
|
30
|
-
</div>
|
|
31
|
-
<div
|
|
32
|
-
class="shrinkOn"
|
|
33
|
-
data-id="boxComponent"
|
|
34
|
-
data-selector-id="box"
|
|
35
|
-
data-test-id="boxComponent"
|
|
36
|
-
>
|
|
37
|
-
<span>
|
|
38
|
-
3
|
|
39
|
-
</span>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</DocumentFragment>
|
|
44
|
-
`;
|
|
45
|
-
|
|
46
|
-
exports[`Tab renderBefore / renderAfter slots renderBefore and renderAfter both render around the label 1`] = `
|
|
47
|
-
<DocumentFragment>
|
|
48
|
-
<div
|
|
49
|
-
aria-controls="t8"
|
|
50
|
-
aria-label="Home"
|
|
51
|
-
aria-selected="false"
|
|
52
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
53
|
-
data-id="tabMenu_Tab"
|
|
54
|
-
data-key="t8"
|
|
55
|
-
data-selector-id="tab"
|
|
56
|
-
data-test-id="tabMenu_Tab"
|
|
57
|
-
role="link"
|
|
58
|
-
tabindex="0"
|
|
59
|
-
>
|
|
60
|
-
<div
|
|
61
|
-
class="textContainer flex cover rowdir both"
|
|
62
|
-
data-id="containerComponent"
|
|
63
|
-
data-selector-id="container"
|
|
64
|
-
data-test-id="containerComponent"
|
|
65
|
-
>
|
|
66
|
-
<div
|
|
67
|
-
class="shrinkOn"
|
|
68
|
-
data-id="boxComponent"
|
|
69
|
-
data-selector-id="box"
|
|
70
|
-
data-test-id="boxComponent"
|
|
71
|
-
>
|
|
72
|
-
<span>
|
|
73
|
-
◀
|
|
74
|
-
</span>
|
|
75
|
-
</div>
|
|
76
|
-
<div
|
|
77
|
-
class="tabText grow basisAuto shrinkOff"
|
|
78
|
-
data-id="boxComponent"
|
|
79
|
-
data-selector-id="box"
|
|
80
|
-
data-test-id="boxComponent"
|
|
81
|
-
>
|
|
82
|
-
Home
|
|
83
|
-
</div>
|
|
84
|
-
<div
|
|
85
|
-
class="shrinkOn"
|
|
86
|
-
data-id="boxComponent"
|
|
87
|
-
data-selector-id="box"
|
|
88
|
-
data-test-id="boxComponent"
|
|
89
|
-
>
|
|
90
|
-
<span>
|
|
91
|
-
▶
|
|
92
|
-
</span>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</DocumentFragment>
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
exports[`Tab renderBefore / renderAfter slots renderBefore as function renders custom node 1`] = `
|
|
100
|
-
<DocumentFragment>
|
|
101
|
-
<div
|
|
102
|
-
aria-controls="t9"
|
|
103
|
-
aria-label="Home"
|
|
104
|
-
aria-selected="false"
|
|
105
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
106
|
-
data-id="tabMenu_Tab"
|
|
107
|
-
data-key="t9"
|
|
108
|
-
data-selector-id="tab"
|
|
109
|
-
data-test-id="tabMenu_Tab"
|
|
110
|
-
role="link"
|
|
111
|
-
tabindex="0"
|
|
112
|
-
>
|
|
113
|
-
<div
|
|
114
|
-
class="textContainer flex cover rowdir both"
|
|
115
|
-
data-id="containerComponent"
|
|
116
|
-
data-selector-id="container"
|
|
117
|
-
data-test-id="containerComponent"
|
|
118
|
-
>
|
|
119
|
-
<div
|
|
120
|
-
class="shrinkOn"
|
|
121
|
-
data-id="boxComponent"
|
|
122
|
-
data-selector-id="box"
|
|
123
|
-
data-test-id="boxComponent"
|
|
124
|
-
>
|
|
125
|
-
<span>
|
|
126
|
-
◀
|
|
127
|
-
</span>
|
|
128
|
-
</div>
|
|
129
|
-
<div
|
|
130
|
-
class="tabText grow basisAuto shrinkOff"
|
|
131
|
-
data-id="boxComponent"
|
|
132
|
-
data-selector-id="box"
|
|
133
|
-
data-test-id="boxComponent"
|
|
134
|
-
>
|
|
135
|
-
Home
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
</DocumentFragment>
|
|
140
|
-
`;
|
|
141
|
-
|
|
142
|
-
exports[`Tab renderBefore / renderAfter slots renderBefore renders a node to the left of the label 1`] = `
|
|
143
|
-
<DocumentFragment>
|
|
144
|
-
<div
|
|
145
|
-
aria-controls="t6"
|
|
146
|
-
aria-label="Home"
|
|
147
|
-
aria-selected="false"
|
|
148
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
149
|
-
data-id="tabMenu_Tab"
|
|
150
|
-
data-key="t6"
|
|
151
|
-
data-selector-id="tab"
|
|
152
|
-
data-test-id="tabMenu_Tab"
|
|
153
|
-
role="link"
|
|
154
|
-
tabindex="0"
|
|
155
|
-
>
|
|
156
|
-
<div
|
|
157
|
-
class="textContainer flex cover rowdir both"
|
|
158
|
-
data-id="containerComponent"
|
|
159
|
-
data-selector-id="container"
|
|
160
|
-
data-test-id="containerComponent"
|
|
161
|
-
>
|
|
162
|
-
<div
|
|
163
|
-
class="shrinkOn"
|
|
164
|
-
data-id="boxComponent"
|
|
165
|
-
data-selector-id="box"
|
|
166
|
-
data-test-id="boxComponent"
|
|
167
|
-
>
|
|
168
|
-
<span>
|
|
169
|
-
◀
|
|
170
|
-
</span>
|
|
171
|
-
</div>
|
|
172
|
-
<div
|
|
173
|
-
class="tabText grow basisAuto shrinkOff"
|
|
174
|
-
data-id="boxComponent"
|
|
175
|
-
data-selector-id="box"
|
|
176
|
-
data-test-id="boxComponent"
|
|
177
|
-
>
|
|
178
|
-
Home
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</DocumentFragment>
|
|
183
|
-
`;
|
|
184
|
-
|
|
185
3
|
exports[`Tab rendering the defult props 1`] = `
|
|
186
4
|
<DocumentFragment>
|
|
187
5
|
<div
|
|
@@ -202,108 +20,3 @@ exports[`Tab rendering the defult props 1`] = `
|
|
|
202
20
|
</div>
|
|
203
21
|
</DocumentFragment>
|
|
204
22
|
`;
|
|
205
|
-
|
|
206
|
-
exports[`Tab variant-based label rendering variant="icon" renders icon and suppresses text label 1`] = `
|
|
207
|
-
<DocumentFragment>
|
|
208
|
-
<div
|
|
209
|
-
aria-controls="t2"
|
|
210
|
-
aria-label="Home"
|
|
211
|
-
aria-selected="false"
|
|
212
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
213
|
-
data-id="tabMenu_Tab"
|
|
214
|
-
data-key="t2"
|
|
215
|
-
data-selector-id="tab"
|
|
216
|
-
data-test-id="tabMenu_Tab"
|
|
217
|
-
role="link"
|
|
218
|
-
tabindex="0"
|
|
219
|
-
>
|
|
220
|
-
<div
|
|
221
|
-
class="textContainer flex cover rowdir both"
|
|
222
|
-
data-id="containerComponent"
|
|
223
|
-
data-selector-id="container"
|
|
224
|
-
data-test-id="containerComponent"
|
|
225
|
-
>
|
|
226
|
-
<i
|
|
227
|
-
aria-hidden="true"
|
|
228
|
-
class="zd_font_icons basic icon-menu rtl "
|
|
229
|
-
data-id="fontIcon"
|
|
230
|
-
data-selector-id="fontIcon"
|
|
231
|
-
data-test-id="fontIcon"
|
|
232
|
-
/>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
</DocumentFragment>
|
|
236
|
-
`;
|
|
237
|
-
|
|
238
|
-
exports[`Tab variant-based label rendering variant="iconWithText" renders icon followed by text 1`] = `
|
|
239
|
-
<DocumentFragment>
|
|
240
|
-
<div
|
|
241
|
-
aria-controls="t3"
|
|
242
|
-
aria-label="Home"
|
|
243
|
-
aria-selected="false"
|
|
244
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
245
|
-
data-id="tabMenu_Tab"
|
|
246
|
-
data-key="t3"
|
|
247
|
-
data-selector-id="tab"
|
|
248
|
-
data-test-id="tabMenu_Tab"
|
|
249
|
-
role="link"
|
|
250
|
-
tabindex="0"
|
|
251
|
-
>
|
|
252
|
-
<div
|
|
253
|
-
class="textContainer flex cover rowdir both"
|
|
254
|
-
data-id="containerComponent"
|
|
255
|
-
data-selector-id="container"
|
|
256
|
-
data-test-id="containerComponent"
|
|
257
|
-
>
|
|
258
|
-
<i
|
|
259
|
-
aria-hidden="true"
|
|
260
|
-
class="zd_font_icons basic icon-menu rtl "
|
|
261
|
-
data-id="fontIcon"
|
|
262
|
-
data-selector-id="fontIcon"
|
|
263
|
-
data-test-id="fontIcon"
|
|
264
|
-
/>
|
|
265
|
-
<div
|
|
266
|
-
class="tabText grow basisAuto shrinkOff"
|
|
267
|
-
data-id="boxComponent"
|
|
268
|
-
data-selector-id="box"
|
|
269
|
-
data-test-id="boxComponent"
|
|
270
|
-
>
|
|
271
|
-
Home
|
|
272
|
-
</div>
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
</DocumentFragment>
|
|
276
|
-
`;
|
|
277
|
-
|
|
278
|
-
exports[`Tab variant-based label rendering variant="text" renders text only 1`] = `
|
|
279
|
-
<DocumentFragment>
|
|
280
|
-
<div
|
|
281
|
-
aria-controls="t1"
|
|
282
|
-
aria-label="Home"
|
|
283
|
-
aria-selected="false"
|
|
284
|
-
class="tab horizontal basisAuto shrinkOff"
|
|
285
|
-
data-id="tabMenu_Tab"
|
|
286
|
-
data-key="t1"
|
|
287
|
-
data-selector-id="tab"
|
|
288
|
-
data-test-id="tabMenu_Tab"
|
|
289
|
-
role="link"
|
|
290
|
-
tabindex="0"
|
|
291
|
-
>
|
|
292
|
-
<div
|
|
293
|
-
class="textContainer flex cover rowdir both"
|
|
294
|
-
data-id="containerComponent"
|
|
295
|
-
data-selector-id="container"
|
|
296
|
-
data-test-id="containerComponent"
|
|
297
|
-
>
|
|
298
|
-
<div
|
|
299
|
-
class="tabText grow basisAuto shrinkOff"
|
|
300
|
-
data-id="boxComponent"
|
|
301
|
-
data-selector-id="box"
|
|
302
|
-
data-test-id="boxComponent"
|
|
303
|
-
>
|
|
304
|
-
Home
|
|
305
|
-
</div>
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
</DocumentFragment>
|
|
309
|
-
`;
|
|
@@ -31,35 +31,3 @@ exports[`Tabs rendering the defult props 1`] = `
|
|
|
31
31
|
</div>
|
|
32
32
|
</DocumentFragment>
|
|
33
33
|
`;
|
|
34
|
-
|
|
35
|
-
exports[`Tabs renders custom more-button icon via renderMoreTarget 1`] = `
|
|
36
|
-
<DocumentFragment>
|
|
37
|
-
<div
|
|
38
|
-
class="noShrink"
|
|
39
|
-
data-id="boxComponent"
|
|
40
|
-
data-selector-id="tabs"
|
|
41
|
-
data-test-id="boxComponent"
|
|
42
|
-
>
|
|
43
|
-
<div
|
|
44
|
-
class="flex fullSize column tab"
|
|
45
|
-
data-id="containerComponent"
|
|
46
|
-
data-selector-id="container"
|
|
47
|
-
data-test-id="containerComponent"
|
|
48
|
-
>
|
|
49
|
-
<div
|
|
50
|
-
class="flexible basis_zero noShrink"
|
|
51
|
-
data-id="boxComponent"
|
|
52
|
-
data-selector-id="box"
|
|
53
|
-
data-test-id="boxComponent"
|
|
54
|
-
>
|
|
55
|
-
<div
|
|
56
|
-
class="flex fullSize column"
|
|
57
|
-
data-id="containerComponent"
|
|
58
|
-
data-selector-id="container"
|
|
59
|
-
data-test-id="containerComponent"
|
|
60
|
-
/>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</DocumentFragment>
|
|
65
|
-
`;
|
|
@@ -3,11 +3,7 @@ export const Tab_defaultProps = {
|
|
|
3
3
|
contentAlign: 'both',
|
|
4
4
|
contentAlignBox: 'row',
|
|
5
5
|
customProps: {},
|
|
6
|
-
|
|
7
|
-
dataSelectorId: 'tab',
|
|
8
|
-
variant: 'text',
|
|
9
|
-
needHover: true,
|
|
10
|
-
hoverOnActive: false
|
|
6
|
+
dataSelectorId: 'tab'
|
|
11
7
|
};
|
|
12
8
|
export const TabContent_defaultProps = {
|
|
13
9
|
dataId: 'tabContent',
|
|
@@ -19,7 +15,6 @@ export const TabContentWrapper_defaultProps = {
|
|
|
19
15
|
a11y: {}
|
|
20
16
|
};
|
|
21
17
|
export const Tabs_defaultProps = {
|
|
22
|
-
alignBorderPosition: false,
|
|
23
18
|
isAnimate: false,
|
|
24
19
|
isResponsive: true,
|
|
25
20
|
needTabBorder: false,
|
|
@@ -41,13 +36,11 @@ export const Tabs_defaultProps = {
|
|
|
41
36
|
searchBoxSize: 'small',
|
|
42
37
|
searchErrorText: 'No results',
|
|
43
38
|
placeHolderText: 'Search',
|
|
44
|
-
isAbsolutePositioningNeeded:
|
|
39
|
+
isAbsolutePositioningNeeded: true,
|
|
45
40
|
isRestrictScroll: false,
|
|
46
|
-
moreContainerClass: ''
|
|
47
|
-
renderMoreTarget: null
|
|
41
|
+
moreContainerClass: ''
|
|
48
42
|
};
|
|
49
43
|
export const TabWrapper_defaultProps = {
|
|
50
|
-
alignBorderPosition: false,
|
|
51
44
|
hookToDisableInternalState: false,
|
|
52
45
|
isAnimate: false,
|
|
53
46
|
needBorder: true,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { VARIANT } from "../utils/tabConfigs";
|
|
3
|
-
const renderSlotType = PropTypes.oneOfType([PropTypes.node, PropTypes.func]);
|
|
4
2
|
export const Tab_propTypes = {
|
|
5
3
|
activeClass: PropTypes.string,
|
|
6
4
|
align: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
7
|
-
borderPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
|
|
8
|
-
hoverOnActive: PropTypes.bool,
|
|
9
5
|
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
|
|
10
6
|
className: PropTypes.string,
|
|
11
7
|
dataId: PropTypes.string,
|
|
@@ -18,7 +14,6 @@ export const Tab_propTypes = {
|
|
|
18
14
|
isLink: PropTypes.bool,
|
|
19
15
|
needAppearance: PropTypes.bool,
|
|
20
16
|
needBorder: PropTypes.bool,
|
|
21
|
-
needHover: PropTypes.bool,
|
|
22
17
|
onClick: PropTypes.func,
|
|
23
18
|
onSelect: PropTypes.func,
|
|
24
19
|
style: PropTypes.object,
|
|
@@ -30,20 +25,8 @@ export const Tab_propTypes = {
|
|
|
30
25
|
contentAlign: PropTypes.oneOf(['both', 'left', 'right', 'vertical', 'horizontal', 'top', 'bottom', 'between', 'around', 'baseline']),
|
|
31
26
|
contentAlignBox: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
|
|
32
27
|
customProps: PropTypes.object,
|
|
33
|
-
customClass: PropTypes.shape({
|
|
34
|
-
customTextContainer: PropTypes.string,
|
|
35
|
-
customText: PropTypes.string,
|
|
36
|
-
customHover: PropTypes.string,
|
|
37
|
-
customIconContainer: PropTypes.string,
|
|
38
|
-
customIcon: PropTypes.string
|
|
39
|
-
}),
|
|
40
28
|
isVirtual: PropTypes.bool,
|
|
41
|
-
dataSelectorId: PropTypes.string
|
|
42
|
-
variant: PropTypes.oneOf(Object.values(VARIANT)),
|
|
43
|
-
iconName: PropTypes.string,
|
|
44
|
-
iconSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
45
|
-
renderBefore: renderSlotType,
|
|
46
|
-
renderAfter: renderSlotType
|
|
29
|
+
dataSelectorId: PropTypes.string
|
|
47
30
|
};
|
|
48
31
|
export const TabContent_propTypes = {
|
|
49
32
|
children: PropTypes.node,
|
|
@@ -65,8 +48,6 @@ export const TabContentWrapper_propTypes = {
|
|
|
65
48
|
};
|
|
66
49
|
export const Tabs_propTypes = {
|
|
67
50
|
align: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
68
|
-
alignBorderPosition: PropTypes.bool,
|
|
69
|
-
borderPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
|
|
70
51
|
boxPosition: PropTypes.string,
|
|
71
52
|
childType: PropTypes.elementType,
|
|
72
53
|
children: PropTypes.array,
|
|
@@ -101,7 +82,7 @@ export const Tabs_propTypes = {
|
|
|
101
82
|
showTitleInMoreOptions: PropTypes.bool,
|
|
102
83
|
style: PropTypes.object,
|
|
103
84
|
togglePopup: PropTypes.func,
|
|
104
|
-
type: PropTypes.oneOf(['alpha', 'beta', 'delta'
|
|
85
|
+
type: PropTypes.oneOf(['alpha', 'beta', 'delta']),
|
|
105
86
|
getTargetRef: PropTypes.func,
|
|
106
87
|
containerClass: PropTypes.string,
|
|
107
88
|
customProps: PropTypes.shape({
|
|
@@ -119,13 +100,10 @@ export const Tabs_propTypes = {
|
|
|
119
100
|
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
120
101
|
isRestrictScroll: PropTypes.bool,
|
|
121
102
|
positionsOffset: PropTypes.object,
|
|
122
|
-
targetOffset: PropTypes.object
|
|
123
|
-
renderMoreTarget: renderSlotType
|
|
103
|
+
targetOffset: PropTypes.object
|
|
124
104
|
};
|
|
125
105
|
export const TabWrapper_propTypes = {
|
|
126
106
|
align: PropTypes.oneOf(['vertical', 'horizontal', 'vertical-reverse', 'horizontal-reverse']),
|
|
127
|
-
alignBorderPosition: PropTypes.bool,
|
|
128
|
-
borderPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
|
|
129
107
|
children: PropTypes.node,
|
|
130
108
|
dataId: PropTypes.string,
|
|
131
109
|
defaultTab: PropTypes.string,
|
|
@@ -136,6 +114,6 @@ export const TabWrapper_propTypes = {
|
|
|
136
114
|
needPadding: PropTypes.bool,
|
|
137
115
|
needTabBorder: PropTypes.bool,
|
|
138
116
|
onSelect: PropTypes.func,
|
|
139
|
-
type: PropTypes.oneOf(['alpha', 'beta', 'delta'
|
|
117
|
+
type: PropTypes.oneOf(['alpha', 'beta', 'delta']),
|
|
140
118
|
dataSelectorId: PropTypes.string
|
|
141
119
|
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export const VARIANT = {
|
|
2
|
-
TEXT: 'text',
|
|
3
|
-
ICON: 'icon',
|
|
4
|
-
ICON_WITH_TEXT: 'iconWithText'
|
|
5
|
-
};
|
|
6
1
|
export const TAB_ALIGN_MAPPING = {
|
|
7
2
|
vertical: 'column',
|
|
8
3
|
horizontal: 'row',
|
|
@@ -20,10 +15,4 @@ export const TAB_POPUP_POSITION_MAPPING = {
|
|
|
20
15
|
horizontal: 'rightTop',
|
|
21
16
|
'vertical-reverse': 'topLeft',
|
|
22
17
|
'horizontal-reverse': 'leftTop'
|
|
23
|
-
};
|
|
24
|
-
export const BORDER_POSITION_BY_ALIGN = {
|
|
25
|
-
vertical: 'bottom',
|
|
26
|
-
'vertical-reverse': 'top',
|
|
27
|
-
horizontal: 'right',
|
|
28
|
-
'horizontal-reverse': 'left'
|
|
29
18
|
};
|