@zohodesk/components 1.0.0-temp-226 → 1.0.0-temp-220.9
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 +20 -0
- 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/Accordion/Accordion.js +2 -2
- package/es/Accordion/AccordionItem.js +4 -4
- package/es/Accordion/__tests__/Accordion.spec.js +1 -1
- package/es/Accordion/__tests__/AccordionItem.spec.js +1 -1
- package/es/Accordion/index.js +2 -2
- package/es/Animation/Animation.js +3 -3
- package/es/Animation/__tests__/Animation.spec.js +1 -1
- package/es/Animation/utils.js +1 -1
- package/es/AppContainer/AppContainer.js +9 -9
- package/es/AppContainer/__tests__/AppContainer.spec.js +1 -1
- package/es/Avatar/Avatar.js +5 -5
- package/es/Avatar/__tests__/Avatar.spec.js +1 -1
- package/es/AvatarTeam/AvatarTeam.js +4 -4
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -1
- package/es/AvatarTeam/props/propTypes.js +1 -1
- package/es/Button/Button.js +6 -4
- package/es/Button/__tests__/Button.spec.js +1 -1
- package/es/Button/css/Button.module.css +14 -50
- package/es/Button/css/cssJSLogic.js +1 -10
- package/es/Button/index.js +2 -2
- package/es/Button/props/defaultProps.js +1 -1
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/__tests__/Buttongroup.spec.js +1 -1
- package/es/Card/Card.js +5 -5
- package/es/Card/__tests__/Card.spec.js +1 -1
- package/es/Card/index.js +4 -4
- package/es/CheckBox/CheckBox.js +6 -6
- package/es/CheckBox/__tests__/CheckBox.spec.js +1 -1
- package/es/DateTime/CalendarView.js +6 -6
- package/es/DateTime/DateTime.js +15 -15
- package/es/DateTime/DateTimePopupFooter.js +5 -5
- package/es/DateTime/DateTimePopupHeader.js +4 -4
- package/es/DateTime/DateWidget.js +17 -17
- package/es/DateTime/DaysRow.js +3 -3
- package/es/DateTime/Time.js +5 -5
- package/es/DateTime/YearView.js +6 -6
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/es/DateTime/__tests__/DateTime.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupFooter.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupHeader.spec.js +1 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +1 -1
- package/es/DateTime/__tests__/DaysRow.spec.js +1 -1
- package/es/DateTime/__tests__/Time.spec.js +1 -1
- package/es/DateTime/__tests__/YearView.spec.js +1 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +4 -4
- package/es/DateTime/dateFormatUtils/dayChange.js +2 -2
- package/es/DateTime/dateFormatUtils/index.js +3 -3
- package/es/DateTime/dateFormatUtils/monthChange.js +2 -2
- package/es/DateTime/dateFormatUtils/timeChange.js +2 -2
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/props/propTypes.js +1 -1
- package/es/DateTime/validator.js +2 -2
- package/es/DropBox/DropBox.js +11 -11
- package/es/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/DropBox/DropBoxElement/__tests__/DropBoxElement.spec.js +1 -1
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +1 -1
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +1 -1
- package/es/DropBox/__tests__/DropBox.spec.js +1 -1
- package/es/DropBox/css/cssJSLogic.js +1 -1
- package/es/DropBox/props/defaultProps.js +1 -1
- package/es/DropBox/props/propTypes.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +1 -1
- package/es/DropDown/DropDown.js +4 -4
- package/es/DropDown/DropDownHeading.js +3 -3
- package/es/DropDown/DropDownItem.js +3 -3
- package/es/DropDown/DropDownSearch.js +4 -4
- package/es/DropDown/DropDownSeparator.js +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownHeading.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownItem.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSearch.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +1 -1
- package/es/DropDown/index.js +7 -7
- package/es/DropDown/props/propTypes.js +1 -1
- package/es/Heading/Heading.js +4 -4
- package/es/Heading/__tests__/Heading.spec.js +1 -1
- package/es/Label/Label.js +4 -4
- package/es/Label/__tests__/Label.spec.js +1 -1
- package/es/Layout/Box.js +4 -4
- package/es/Layout/Container.js +4 -4
- package/es/Layout/__tests__/Box.spec.js +1 -1
- package/es/Layout/__tests__/Container.spec.js +1 -1
- package/es/Layout/index.js +2 -2
- package/es/ListItem/ListContainer.js +6 -6
- package/es/ListItem/ListItem.js +5 -5
- package/es/ListItem/ListItemWithAvatar.js +7 -7
- package/es/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/ListItem/ListItemWithIcon.js +5 -5
- package/es/ListItem/ListItemWithRadio.js +6 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +1 -1
- package/es/ListItem/__tests__/ListItem.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +1 -1
- package/es/ListItem/index.js +6 -6
- package/es/ListItem/props/propTypes.js +2 -2
- package/es/Modal/Modal.js +38 -17
- package/es/Modal/Portal/Portal.js +31 -0
- package/es/Modal/Portal/props/defaultProps.js +3 -0
- package/es/Modal/Portal/props/propTypes.js +5 -0
- package/es/Modal/__tests__/Modal.spec.js +1 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/MultiSelect/EmptyState.js +3 -3
- package/es/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/MultiSelect/MobileHeader/__tests__/MobileHeader.spec.js +1 -1
- package/es/MultiSelect/MultiSelect.js +20 -20
- package/es/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/MultiSelect/SelectedOptions.js +5 -5
- package/es/MultiSelect/Suggestions.js +6 -6
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +2 -2
- package/es/MultiSelect/__tests__/EmptyState.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectHeader.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectWithAvatar.spec.js +1 -1
- package/es/MultiSelect/__tests__/SelectedOptions.spec.js +1 -1
- package/es/MultiSelect/__tests__/Suggestions.spec.js +1 -1
- package/es/MultiSelect/index.js +4 -4
- package/es/MultiSelect/props/defaultProps.js +1 -1
- package/es/PopOver/PopOver.js +6 -6
- package/es/PopOver/__tests__/PopOver.spec.js +1 -1
- package/es/PopOver/index.js +3 -3
- package/es/Popup/Popup.js +7 -7
- package/es/Popup/viewPort.js +15 -16
- package/es/Provider/AvatarSize.js +1 -1
- package/es/Provider/Config.js +4 -1
- package/es/Provider/CssProvider.js +1 -1
- package/es/Provider/IdProvider.js +2 -2
- package/es/Provider/LibraryContext.js +3 -5
- package/es/Provider/ZindexProvider.js +2 -2
- package/es/Provider/index.js +4 -4
- package/es/Radio/Radio.js +6 -6
- package/es/Radio/__tests__/Radio.spec.js +1 -1
- package/es/Responsive/CustomResponsive.js +7 -7
- package/es/Responsive/ResizeComponent.js +2 -2
- package/es/Responsive/Responsive.js +6 -6
- package/es/Responsive/index.js +3 -3
- package/es/Responsive/utils/index.js +1 -1
- package/es/Responsive/windowResizeObserver.js +1 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/ResponsiveDropBox/__tests__/ResponsiveDropBox.spec.js +1 -1
- package/es/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/Ribbon/Ribbon.js +3 -3
- package/es/Ribbon/__tests__/Ribbon.spec.js +1 -1
- package/es/RippleEffect/RippleEffect.js +4 -4
- package/es/RippleEffect/__tests__/RippleEffect.spec.js +1 -1
- package/es/Select/GroupSelect.js +16 -16
- package/es/Select/Select.js +15 -15
- package/es/Select/SelectWithAvatar.js +17 -17
- package/es/Select/SelectWithIcon.js +13 -13
- package/es/Select/__tests__/GroupSelect.spec.js +1 -1
- package/es/Select/__tests__/Select.spec.js +2 -2
- package/es/Select/__tests__/SelectWithAvatar.spec.js +1 -1
- package/es/Select/__tests__/SelectWithIcon.spec.js +1 -1
- package/es/Select/index.js +4 -4
- package/es/Select/props/defaultProps.js +1 -1
- package/es/Stencils/Stencils.js +8 -15
- package/es/Stencils/Stencils.module.css +11 -7
- package/es/Stencils/__tests__/Stencils.spec.js +10 -2
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +27 -11
- package/es/Stencils/props/defaultProps.js +2 -1
- package/es/Stencils/props/propTypes.js +3 -2
- package/es/Switch/Switch.js +5 -5
- package/es/Switch/__tests__/Switch.spec.js +1 -1
- package/es/Tab/Tab.js +7 -6
- package/es/Tab/TabContent.js +4 -4
- package/es/Tab/TabContentWrapper.js +3 -3
- package/es/Tab/TabWrapper.js +5 -4
- package/es/Tab/Tabs.js +23 -23
- package/es/Tab/__tests__/Tab.spec.js +1 -1
- package/es/Tab/__tests__/TabContent.spec.js +1 -1
- package/es/Tab/__tests__/TabContentWrapper.spec.js +1 -1
- package/es/Tab/__tests__/TabLayout.spec.js +34 -0
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -1
- package/es/Tab/__tests__/Tabs.spec.js +1 -1
- package/es/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +341 -0
- package/es/Tab/index.js +5 -5
- package/es/Tab/props/propTypes.js +2 -2
- package/es/Tab/utils/tabConfigs.js +18 -0
- package/es/Tag/Tag.js +7 -7
- package/es/Tag/__tests__/Tag.spec.js +2 -2
- package/es/Tag/props/propTypes.js +1 -1
- package/es/TextBox/TextBox.js +3 -3
- package/es/TextBox/__tests__/TextBox.spec.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +1 -1
- package/es/TextBoxIcon/props/propTypes.js +1 -1
- package/es/Textarea/Textarea.js +3 -3
- package/es/Textarea/__tests__/Textarea.spec.js +1 -1
- package/es/Tooltip/Tooltip.js +6 -6
- package/es/Typography/Typography.js +4 -4
- package/es/Typography/css/cssJSLogic.js +1 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/VelocityAnimation/VelocityAnimation/__tests__/VelocityAnimation.spec.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/__tests__/VelocityAnimationGroup.spec.js +1 -1
- package/es/VelocityAnimation/index.js +2 -2
- package/es/css.js +37 -37
- package/es/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/es/index.js +39 -39
- package/es/semantic/Button/Button.js +3 -3
- package/es/semantic/Button/__tests__/Button.spec.js +1 -1
- package/es/semantic/index.js +1 -1
- package/es/utils/Common.js +2 -2
- package/es/utils/ContextOptimizer.js +1 -1
- package/es/utils/cssUtils.js +1 -1
- package/es/utils/datetime/common.js +1 -1
- package/es/utils/dropDownUtils.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/v1/Accordion/Accordion.js +2 -2
- package/es/v1/Accordion/AccordionItem.js +4 -4
- package/es/v1/Accordion/index.js +2 -2
- package/es/v1/Animation/Animation.js +3 -3
- package/es/v1/Animation/utils.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +8 -8
- package/es/v1/Avatar/Avatar.js +5 -5
- package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/es/v1/Button/Button.js +4 -4
- package/es/v1/Button/props/defaultProps.js +1 -1
- package/es/v1/Buttongroup/Buttongroup.js +3 -3
- package/es/v1/Card/Card.js +5 -5
- package/es/v1/Card/index.js +4 -4
- package/es/v1/CheckBox/CheckBox.js +6 -6
- package/es/v1/DateTime/CalendarView.js +7 -7
- package/es/v1/DateTime/DateTime.js +15 -15
- package/es/v1/DateTime/DateTimePopupFooter.js +5 -5
- package/es/v1/DateTime/DateTimePopupHeader.js +4 -4
- package/es/v1/DateTime/DateWidget.js +17 -17
- package/es/v1/DateTime/DaysRow.js +3 -3
- package/es/v1/DateTime/Time.js +5 -5
- package/es/v1/DateTime/YearView.js +6 -6
- package/es/v1/DateTime/index.js +1 -1
- package/es/v1/DateTime/props/propTypes.js +1 -1
- package/es/v1/DropBox/DropBox.js +9 -9
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/v1/DropBox/props/defaultProps.js +1 -1
- package/es/v1/DropBox/props/propTypes.js +1 -1
- package/es/v1/DropBox/utils/isMobilePopover.js +1 -1
- package/es/v1/DropDown/DropDown.js +4 -4
- package/es/v1/DropDown/DropDownHeading.js +3 -3
- package/es/v1/DropDown/DropDownItem.js +3 -3
- package/es/v1/DropDown/DropDownSearch.js +4 -4
- package/es/v1/DropDown/DropDownSeparator.js +2 -2
- package/es/v1/DropDown/props/propTypes.js +1 -1
- package/es/v1/Heading/Heading.js +4 -4
- package/es/v1/Label/Label.js +4 -4
- package/es/v1/Layout/Box.js +4 -4
- package/es/v1/Layout/Container.js +4 -4
- package/es/v1/Layout/index.js +2 -2
- package/es/v1/ListItem/ListContainer.js +6 -6
- package/es/v1/ListItem/ListItem.js +5 -5
- package/es/v1/ListItem/ListItemWithAvatar.js +7 -7
- package/es/v1/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/v1/ListItem/ListItemWithIcon.js +5 -5
- package/es/v1/ListItem/ListItemWithRadio.js +6 -6
- package/es/v1/ListItem/index.js +6 -6
- package/es/v1/Modal/Modal.js +3 -3
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/v1/MultiSelect/EmptyState.js +3 -3
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/v1/MultiSelect/MultiSelect.js +19 -19
- package/es/v1/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/v1/MultiSelect/SelectedOptions.js +5 -5
- package/es/v1/MultiSelect/Suggestions.js +6 -6
- package/es/v1/MultiSelect/index.js +4 -4
- package/es/v1/MultiSelect/props/defaultProps.js +1 -1
- package/es/v1/PopOver/PopOver.js +6 -6
- package/es/v1/Popup/Popup.js +3 -3
- package/es/v1/Radio/Radio.js +5 -5
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/v1/Ribbon/Ribbon.js +3 -3
- package/es/v1/RippleEffect/RippleEffect.js +4 -4
- package/es/v1/Select/GroupSelect.js +16 -16
- package/es/v1/Select/Select.js +15 -15
- package/es/v1/Select/SelectWithAvatar.js +17 -17
- package/es/v1/Select/SelectWithIcon.js +13 -13
- package/es/v1/Select/index.js +4 -4
- package/es/v1/Select/props/defaultProps.js +1 -1
- package/es/v1/Stencils/Stencils.js +3 -3
- package/es/v1/Switch/Switch.js +5 -5
- package/es/v1/Tab/Tab.js +5 -5
- package/es/v1/Tab/TabContent.js +4 -4
- package/es/v1/Tab/TabContentWrapper.js +3 -3
- package/es/v1/Tab/TabWrapper.js +3 -3
- package/es/v1/Tab/Tabs.js +13 -13
- package/es/v1/Tab/index.js +5 -5
- package/es/v1/Tag/Tag.js +7 -7
- package/es/v1/TextBox/TextBox.js +3 -3
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -1
- package/es/v1/Textarea/Textarea.js +3 -3
- package/es/v1/Tooltip/Tooltip.js +6 -6
- package/es/v1/Typography/Typography.js +4 -4
- package/es/v1/Typography/css/cssJSLogic.js +1 -1
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/v1/semantic/Button/Button.js +3 -3
- package/es/v1/semantic/index.js +1 -1
- package/lib/Button/Button.js +2 -0
- package/lib/Button/css/Button.module.css +14 -50
- package/lib/Button/css/cssJSLogic.js +2 -15
- package/lib/DropBox/DropBox.js +3 -3
- package/lib/Modal/Modal.js +40 -16
- package/lib/Modal/Portal/Portal.js +44 -0
- package/lib/Modal/Portal/props/defaultProps.js +10 -0
- package/lib/Modal/Portal/props/propTypes.js +16 -0
- package/lib/Popup/viewPort.js +15 -16
- package/lib/Provider/Config.js +4 -1
- package/lib/Provider/LibraryContext.js +1 -3
- package/lib/Stencils/Stencils.js +5 -12
- package/lib/Stencils/Stencils.module.css +11 -7
- package/lib/Stencils/__tests__/Stencils.spec.js +11 -3
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +27 -11
- package/lib/Stencils/props/defaultProps.js +2 -1
- package/lib/Stencils/props/propTypes.js +3 -2
- package/lib/Tab/Tab.js +3 -1
- package/lib/Tab/TabWrapper.js +3 -1
- package/lib/Tab/Tabs.js +11 -10
- package/lib/Tab/__tests__/TabLayout.spec.js +41 -0
- package/lib/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +341 -0
- package/lib/Tab/props/propTypes.js +2 -2
- package/lib/Tab/utils/tabConfigs.js +27 -0
- package/lib/utils/Common.js +1 -1
- package/package.json +2 -2
- package/react-cli.config.js +2 -2
- package/result.json +1 -1
package/es/Stencils/Stencils.js
CHANGED
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { defaultProps } from
|
|
3
|
-
import { propTypes } from
|
|
2
|
+
import { defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { propTypes } from "./props/propTypes";
|
|
4
4
|
/* eslint css-modules/no-unused-class: [2, { markAsUsed: [primary, secondary, small, default, medium, large, clarge, cmedium, cdefault, csmall] }] */
|
|
5
5
|
|
|
6
|
-
import style from
|
|
6
|
+
import style from "./Stencils.module.css";
|
|
7
7
|
export default class Stencils extends React.PureComponent {
|
|
8
8
|
render() {
|
|
9
9
|
let {
|
|
10
10
|
shape,
|
|
11
11
|
size,
|
|
12
12
|
palette,
|
|
13
|
-
customClass
|
|
13
|
+
customClass,
|
|
14
|
+
isAnimated
|
|
14
15
|
} = this.props;
|
|
15
|
-
size = shape === 'rect' ? style[size] : style[`
|
|
16
|
-
shape = shape === 'rect' ? style.rectangular : style.circle;
|
|
16
|
+
size = shape === 'rect' ? style[size] : style[`size_${size}`];
|
|
17
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
-
className: `${style.container} ${shape} ${size} ${style[palette]} ${customClass}`
|
|
18
|
+
className: `${style.container} ${isAnimated ? style.animate : ''} ${style[shape]} ${size} ${style[palette]} ${customClass}`
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
}
|
|
23
23
|
Stencils.propTypes = propTypes;
|
|
24
|
-
Stencils.defaultProps = defaultProps;
|
|
25
|
-
// Stencils.docs = {
|
|
26
|
-
// componentGroup: 'Atom',
|
|
27
|
-
// folderName: 'Style Guide',
|
|
28
|
-
// description: ' ',
|
|
29
|
-
// external: true
|
|
30
|
-
// };
|
|
31
|
-
// }
|
|
24
|
+
Stencils.defaultProps = defaultProps;
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
.stencil {
|
|
14
14
|
background-size: 800px 1px;
|
|
15
15
|
}
|
|
16
|
-
[dir=ltr] .
|
|
16
|
+
[dir=ltr] .animate{
|
|
17
17
|
animation-name: placeHolderShimmer-ltr ;
|
|
18
18
|
animation-fill-mode: forwards;
|
|
19
19
|
animation-iteration-count: infinite;
|
|
20
20
|
animation-duration: var(--zd_transition10);
|
|
21
21
|
animation-timing-function: linear;
|
|
22
22
|
}
|
|
23
|
-
[dir=rtl] .
|
|
23
|
+
[dir=rtl] .animate{
|
|
24
24
|
animation-name: placeHolderShimmer-rtl ;
|
|
25
25
|
animation-fill-mode: forwards;
|
|
26
26
|
animation-iteration-count: infinite;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.rect {
|
|
50
50
|
composes: stencil;
|
|
51
51
|
--stencil_height: var(--zd_size9);
|
|
52
52
|
--stencil_border_radius: 5px;
|
|
@@ -81,16 +81,20 @@
|
|
|
81
81
|
composes: stencil;
|
|
82
82
|
--stencil_border_radius: 50%;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.square {
|
|
85
|
+
composes: stencil;
|
|
86
|
+
--stencil_border_radius: 4px;
|
|
87
|
+
}
|
|
88
|
+
.size_large {
|
|
85
89
|
--stencil_width: var(--zd_size42);
|
|
86
90
|
--stencil_height: var(--zd_size42);
|
|
87
91
|
}
|
|
88
|
-
.
|
|
89
|
-
.
|
|
92
|
+
.size_medium,
|
|
93
|
+
.size_default {
|
|
90
94
|
--stencil_width: var(--zd_size30);
|
|
91
95
|
--stencil_height: var(--zd_size30);
|
|
92
96
|
}
|
|
93
|
-
.
|
|
97
|
+
.size_small {
|
|
94
98
|
--stencil_width: var(--zd_size20);
|
|
95
99
|
--stencil_height: var(--zd_size20);
|
|
96
100
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import Stencils from
|
|
3
|
+
import Stencils from "../Stencils.js";
|
|
4
4
|
describe('Stencils', () => {
|
|
5
5
|
test('rendering the defult props', () => {
|
|
6
6
|
const {
|
|
@@ -17,7 +17,7 @@ describe('Stencils', () => {
|
|
|
17
17
|
}));
|
|
18
18
|
expect(asFragment()).toMatchSnapshot();
|
|
19
19
|
});
|
|
20
|
-
const shape = ['rect', 'circle'];
|
|
20
|
+
const shape = ['rect', 'circle', 'square'];
|
|
21
21
|
test.each(shape)('rendering the shape of- %s', shape => {
|
|
22
22
|
const {
|
|
23
23
|
asFragment
|
|
@@ -35,6 +35,14 @@ describe('Stencils', () => {
|
|
|
35
35
|
}));
|
|
36
36
|
expect(asFragment()).toMatchSnapshot();
|
|
37
37
|
});
|
|
38
|
+
test('rendering without animation', () => {
|
|
39
|
+
const {
|
|
40
|
+
asFragment
|
|
41
|
+
} = render( /*#__PURE__*/React.createElement(Stencils, {
|
|
42
|
+
isAnimated: false
|
|
43
|
+
}));
|
|
44
|
+
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
});
|
|
38
46
|
test('rendering the customClass', () => {
|
|
39
47
|
const {
|
|
40
48
|
asFragment
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Stencils rendering the customClass 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="container
|
|
6
|
+
class="container animate rect medium primary StencilsCustomClass"
|
|
7
7
|
/>
|
|
8
8
|
</DocumentFragment>
|
|
9
9
|
`;
|
|
@@ -11,7 +11,7 @@ exports[`Stencils rendering the customClass 1`] = `
|
|
|
11
11
|
exports[`Stencils rendering the defult props 1`] = `
|
|
12
12
|
<DocumentFragment>
|
|
13
13
|
<div
|
|
14
|
-
class="container
|
|
14
|
+
class="container animate rect medium primary "
|
|
15
15
|
/>
|
|
16
16
|
</DocumentFragment>
|
|
17
17
|
`;
|
|
@@ -19,7 +19,7 @@ exports[`Stencils rendering the defult props 1`] = `
|
|
|
19
19
|
exports[`Stencils rendering the palette of- dark 1`] = `
|
|
20
20
|
<DocumentFragment>
|
|
21
21
|
<div
|
|
22
|
-
class="container
|
|
22
|
+
class="container animate rect medium dark "
|
|
23
23
|
/>
|
|
24
24
|
</DocumentFragment>
|
|
25
25
|
`;
|
|
@@ -27,7 +27,7 @@ exports[`Stencils rendering the palette of- dark 1`] = `
|
|
|
27
27
|
exports[`Stencils rendering the palette of- primary 1`] = `
|
|
28
28
|
<DocumentFragment>
|
|
29
29
|
<div
|
|
30
|
-
class="container
|
|
30
|
+
class="container animate rect medium primary "
|
|
31
31
|
/>
|
|
32
32
|
</DocumentFragment>
|
|
33
33
|
`;
|
|
@@ -35,7 +35,7 @@ exports[`Stencils rendering the palette of- primary 1`] = `
|
|
|
35
35
|
exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
36
36
|
<DocumentFragment>
|
|
37
37
|
<div
|
|
38
|
-
class="container
|
|
38
|
+
class="container animate rect medium secondary "
|
|
39
39
|
/>
|
|
40
40
|
</DocumentFragment>
|
|
41
41
|
`;
|
|
@@ -43,7 +43,7 @@ exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
|
43
43
|
exports[`Stencils rendering the shape of- circle 1`] = `
|
|
44
44
|
<DocumentFragment>
|
|
45
45
|
<div
|
|
46
|
-
class="container circle
|
|
46
|
+
class="container animate circle size_medium primary "
|
|
47
47
|
/>
|
|
48
48
|
</DocumentFragment>
|
|
49
49
|
`;
|
|
@@ -51,7 +51,15 @@ exports[`Stencils rendering the shape of- circle 1`] = `
|
|
|
51
51
|
exports[`Stencils rendering the shape of- rect 1`] = `
|
|
52
52
|
<DocumentFragment>
|
|
53
53
|
<div
|
|
54
|
-
class="container
|
|
54
|
+
class="container animate rect medium primary "
|
|
55
|
+
/>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`Stencils rendering the shape of- square 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<div
|
|
62
|
+
class="container animate square size_medium primary "
|
|
55
63
|
/>
|
|
56
64
|
</DocumentFragment>
|
|
57
65
|
`;
|
|
@@ -59,7 +67,7 @@ exports[`Stencils rendering the shape of- rect 1`] = `
|
|
|
59
67
|
exports[`Stencils rendering the size of- default 1`] = `
|
|
60
68
|
<DocumentFragment>
|
|
61
69
|
<div
|
|
62
|
-
class="container
|
|
70
|
+
class="container animate rect default primary "
|
|
63
71
|
/>
|
|
64
72
|
</DocumentFragment>
|
|
65
73
|
`;
|
|
@@ -67,7 +75,7 @@ exports[`Stencils rendering the size of- default 1`] = `
|
|
|
67
75
|
exports[`Stencils rendering the size of- large 1`] = `
|
|
68
76
|
<DocumentFragment>
|
|
69
77
|
<div
|
|
70
|
-
class="container
|
|
78
|
+
class="container animate rect large primary "
|
|
71
79
|
/>
|
|
72
80
|
</DocumentFragment>
|
|
73
81
|
`;
|
|
@@ -75,7 +83,7 @@ exports[`Stencils rendering the size of- large 1`] = `
|
|
|
75
83
|
exports[`Stencils rendering the size of- medium 1`] = `
|
|
76
84
|
<DocumentFragment>
|
|
77
85
|
<div
|
|
78
|
-
class="container
|
|
86
|
+
class="container animate rect medium primary "
|
|
79
87
|
/>
|
|
80
88
|
</DocumentFragment>
|
|
81
89
|
`;
|
|
@@ -83,7 +91,15 @@ exports[`Stencils rendering the size of- medium 1`] = `
|
|
|
83
91
|
exports[`Stencils rendering the size of- small 1`] = `
|
|
84
92
|
<DocumentFragment>
|
|
85
93
|
<div
|
|
86
|
-
class="container
|
|
94
|
+
class="container animate rect small primary "
|
|
95
|
+
/>
|
|
96
|
+
</DocumentFragment>
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
exports[`Stencils rendering without animation 1`] = `
|
|
100
|
+
<DocumentFragment>
|
|
101
|
+
<div
|
|
102
|
+
class="container rect medium primary "
|
|
87
103
|
/>
|
|
88
104
|
</DocumentFragment>
|
|
89
105
|
`;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
export const propTypes = {
|
|
3
3
|
palette: PropTypes.oneOf(['primary', 'secondary', 'dark']),
|
|
4
|
-
shape: PropTypes.oneOf(['rect', 'circle']),
|
|
4
|
+
shape: PropTypes.oneOf(['rect', 'circle', 'square']),
|
|
5
5
|
size: PropTypes.oneOf(['small', 'medium', 'large', 'default']),
|
|
6
|
-
customClass: PropTypes.string
|
|
6
|
+
customClass: PropTypes.string,
|
|
7
|
+
isAnimated: PropTypes.bool
|
|
7
8
|
};
|
package/es/Switch/Switch.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { defaultProps } from
|
|
3
|
-
import { propTypes } from
|
|
4
|
-
import { Container, Box } from
|
|
5
|
-
import Label from
|
|
6
|
-
import style from
|
|
2
|
+
import { defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { propTypes } from "./props/propTypes";
|
|
4
|
+
import { Container, Box } from "../Layout";
|
|
5
|
+
import Label from "../Label/Label";
|
|
6
|
+
import style from "./Switch.module.css";
|
|
7
7
|
export default class Switch extends React.Component {
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
package/es/Tab/Tab.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint css-modules/no-unused-class: [2, { markAsUsed: ['text', 'tabAlpha', 'alphaActive', 'gammaActive', 'betaActive', 'deltaActive', 'tabGamma', 'tabBeta', 'tabDelta',', 'specialActive', 'tabSpecial', 'alphaActive_border', 'gammaActive_border', 'betaActive_border', 'deltaActive_border'] }] */
|
|
4
4
|
import React, { useMemo, useCallback } from 'react';
|
|
5
|
-
import { Tab_defaultProps } from
|
|
6
|
-
import { Tab_propTypes } from
|
|
7
|
-
import { Box, Container } from
|
|
8
|
-
import { cs } from
|
|
9
|
-
import
|
|
5
|
+
import { Tab_defaultProps } from "./props/defaultProps";
|
|
6
|
+
import { Tab_propTypes } from "./props/propTypes";
|
|
7
|
+
import { Box, Container } from "../Layout";
|
|
8
|
+
import { cs } from "../utils/Common";
|
|
9
|
+
import { TAB_DIRECTION_MAPPING } from "./utils/tabConfigs";
|
|
10
|
+
import styles from "./Tab.module.css";
|
|
10
11
|
const tabTypes = {
|
|
11
12
|
alpha: {
|
|
12
13
|
active: 'alphaActive',
|
|
@@ -67,7 +68,7 @@ export default function Tab(_ref) {
|
|
|
67
68
|
let activeWithAppearance = cs([styles[styleContent.active], needBorder && !isAnimate && styles[`${styleContent.active}_border`]]);
|
|
68
69
|
let activeClasses = cs([needAppearance && activeWithAppearance, activeClass]);
|
|
69
70
|
let inActiveClasses = needAppearance && cs([styles[styleContent.tab], tabTypes[type] && styles[`${`${type}Hover`}`]]);
|
|
70
|
-
let tabClass = cs([styles.tab, align === '
|
|
71
|
+
let tabClass = cs([styles.tab, TAB_DIRECTION_MAPPING[align] === 'column' ? styles.vertical : styles.horizontal, isDisabled && styles.disabled, needBorder && !isAnimate && needAppearance && styles.border, isActive ? activeClasses : inActiveClasses, className]);
|
|
71
72
|
return /*#__PURE__*/React.createElement(Box, {
|
|
72
73
|
tourId: tourId,
|
|
73
74
|
tagName: isLink ? 'a' : 'div',
|
package/es/Tab/TabContent.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TabContent_defaultProps } from
|
|
3
|
-
import { TabContent_propTypes } from
|
|
4
|
-
import { Container } from
|
|
5
|
-
import style from
|
|
2
|
+
import { TabContent_defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { TabContent_propTypes } from "./props/propTypes";
|
|
4
|
+
import { Container } from "../Layout";
|
|
5
|
+
import style from "./TabContent.module.css";
|
|
6
6
|
/* eslint-disable react/forbid-component-props */
|
|
7
7
|
|
|
8
8
|
const TabContent = _ref => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TabContentWrapper_defaultProps } from
|
|
3
|
-
import { TabContentWrapper_propTypes } from
|
|
4
|
-
import { Box } from
|
|
2
|
+
import { TabContentWrapper_defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { TabContentWrapper_propTypes } from "./props/propTypes";
|
|
4
|
+
import { Box } from "../Layout";
|
|
5
5
|
/* eslint-disable react/forbid-component-props */
|
|
6
6
|
|
|
7
7
|
const TabContentWrapper = _ref => {
|
package/es/Tab/TabWrapper.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import { TabWrapper_defaultProps } from
|
|
3
|
-
import { TabWrapper_propTypes } from
|
|
4
|
-
import { Container } from
|
|
2
|
+
import { TabWrapper_defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { TabWrapper_propTypes } from "./props/propTypes";
|
|
4
|
+
import { Container } from "../Layout";
|
|
5
|
+
import { TAB_ALIGN_MAPPING } from "./utils/tabConfigs";
|
|
5
6
|
|
|
6
7
|
function TabWrapper(_ref) {
|
|
7
8
|
let {
|
|
@@ -28,7 +29,7 @@ function TabWrapper(_ref) {
|
|
|
28
29
|
onSelect && onSelect(id);
|
|
29
30
|
}, [hookToDisableInternalState, onSelect]);
|
|
30
31
|
return /*#__PURE__*/React.createElement(Container, {
|
|
31
|
-
alignBox: align
|
|
32
|
+
alignBox: TAB_ALIGN_MAPPING[align],
|
|
32
33
|
dataId: dataId,
|
|
33
34
|
dataSelectorId: dataSelectorId
|
|
34
35
|
}, React.Children.map(children, child => {
|
package/es/Tab/Tabs.js
CHANGED
|
@@ -9,20 +9,21 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
12
|
-
import Tab from
|
|
13
|
-
import { Tabs_defaultProps } from
|
|
14
|
-
import { Tabs_propTypes } from
|
|
15
|
-
import { remConvert, getTotalDimension, cs, bind, throttle, cancelBubblingEffect } from
|
|
16
|
-
import { Box, Container } from
|
|
17
|
-
import ResizeObserver from
|
|
18
|
-
import ListItem from
|
|
12
|
+
import Tab from "./Tab";
|
|
13
|
+
import { Tabs_defaultProps } from "./props/defaultProps";
|
|
14
|
+
import { Tabs_propTypes } from "./props/propTypes";
|
|
15
|
+
import { remConvert, getTotalDimension, cs, bind, throttle, cancelBubblingEffect } from "../utils/Common";
|
|
16
|
+
import { Box, Container } from "../Layout";
|
|
17
|
+
import ResizeObserver from "../Responsive/ResizeObserver";
|
|
18
|
+
import ListItem from "../ListItem/ListItem";
|
|
19
19
|
import { Icon } from '@zohodesk/icons';
|
|
20
|
-
import tabsStyle from
|
|
21
|
-
import Popup from
|
|
22
|
-
import TextBoxIcon from
|
|
23
|
-
import ResponsiveDropBox from
|
|
24
|
-
import { ResponsiveReceiver } from
|
|
25
|
-
import
|
|
20
|
+
import tabsStyle from "./Tabs.module.css";
|
|
21
|
+
import Popup from "../Popup/Popup";
|
|
22
|
+
import TextBoxIcon from "../TextBoxIcon/TextBoxIcon";
|
|
23
|
+
import ResponsiveDropBox from "../ResponsiveDropBox/ResponsiveDropBox";
|
|
24
|
+
import { ResponsiveReceiver } from "../Responsive/CustomResponsive";
|
|
25
|
+
import { TAB_DIRECTION_MAPPING, TAB_POPUP_POSITION_MAPPING } from "./utils/tabConfigs";
|
|
26
|
+
import btnstyle from "../semantic/Button/semanticButton.module.css";
|
|
26
27
|
|
|
27
28
|
class Tabs extends React.Component {
|
|
28
29
|
constructor(props) {
|
|
@@ -118,7 +119,7 @@ class Tabs extends React.Component {
|
|
|
118
119
|
align
|
|
119
120
|
} = this.props;
|
|
120
121
|
let newDim = `${remConvert(totalDimension)}rem`;
|
|
121
|
-
align === '
|
|
122
|
+
TAB_DIRECTION_MAPPING[align] === 'column' ? this[selectedTab].style.maxWidth = newDim : this[selectedTab].style.maxHeight = newDim;
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -126,7 +127,7 @@ class Tabs extends React.Component {
|
|
|
126
127
|
let {
|
|
127
128
|
align
|
|
128
129
|
} = this.props;
|
|
129
|
-
return align === '
|
|
130
|
+
return TAB_DIRECTION_MAPPING[align] === 'column' ? this.highlight.offsetLeft : this.highlight.offsetTop;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
componentDidUpdate(prevProps) {
|
|
@@ -199,12 +200,12 @@ class Tabs extends React.Component {
|
|
|
199
200
|
if (tabActive) {
|
|
200
201
|
let position, dimension;
|
|
201
202
|
|
|
202
|
-
if (align === '
|
|
203
|
+
if (TAB_DIRECTION_MAPPING[align] === 'column') {
|
|
203
204
|
position = tabActive.offsetLeft;
|
|
204
205
|
dimension = tabActive.offsetWidth;
|
|
205
206
|
node.style.transform = `translateX(${remConvert(position - highlightInitialDimension)}rem)`;
|
|
206
207
|
node.style.width = `${remConvert(dimension)}rem`;
|
|
207
|
-
} else if (align === '
|
|
208
|
+
} else if (TAB_DIRECTION_MAPPING[align] === 'row') {
|
|
208
209
|
position = tabActive.offsetTop;
|
|
209
210
|
dimension = tabActive.offsetHeight;
|
|
210
211
|
node.style.transform = `translateY(${remConvert(position - highlightInitialDimension)}rem)`;
|
|
@@ -402,8 +403,7 @@ class Tabs extends React.Component {
|
|
|
402
403
|
removeClose
|
|
403
404
|
} = this.props;
|
|
404
405
|
removeClose && removeClose(e);
|
|
405
|
-
|
|
406
|
-
boxPosition = boxPosition ? boxPosition : popupPosition;
|
|
406
|
+
boxPosition = boxPosition ? boxPosition : TAB_POPUP_POSITION_MAPPING[align];
|
|
407
407
|
togglePopup(e, boxPosition);
|
|
408
408
|
}
|
|
409
409
|
|
|
@@ -527,7 +527,7 @@ class Tabs extends React.Component {
|
|
|
527
527
|
MoreButtonProps = {},
|
|
528
528
|
TextBoxIconProps = {}
|
|
529
529
|
} = customProps;
|
|
530
|
-
let popupClass = align === '
|
|
530
|
+
let popupClass = TAB_DIRECTION_MAPPING[align] === 'column' ? tabsStyle[position] ? tabsStyle[position] : '' : '';
|
|
531
531
|
const moreTabsListItems = this.handleFilterSuggestions({
|
|
532
532
|
moreTabs
|
|
533
533
|
});
|
|
@@ -695,17 +695,17 @@ class Tabs extends React.Component {
|
|
|
695
695
|
className: containerClass,
|
|
696
696
|
dataSelectorId: dataSelectorId
|
|
697
697
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
698
|
-
alignBox: align === '
|
|
698
|
+
alignBox: TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column',
|
|
699
699
|
className: tabsClass,
|
|
700
700
|
style: style
|
|
701
701
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
702
702
|
eleRef: this.getTabsRef,
|
|
703
703
|
flexible: true
|
|
704
704
|
}, renderVirtualTabs && /*#__PURE__*/React.createElement(Container, {
|
|
705
|
-
alignBox: align === '
|
|
705
|
+
alignBox: TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column',
|
|
706
706
|
className: tabsStyle.hidden
|
|
707
707
|
}, this.renderTabs(children, [], true)), /*#__PURE__*/React.createElement(Container, {
|
|
708
|
-
alignBox: align === '
|
|
708
|
+
alignBox: TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column'
|
|
709
709
|
}, this.renderTabs(mainTabs, moreTabs, false))), otherTabs.length ? /*#__PURE__*/React.createElement(Box, null, otherTabs) : null, isAnimate && needTabBorder && needAppearance && /*#__PURE__*/React.createElement("div", {
|
|
710
710
|
className: hlClass,
|
|
711
711
|
ref: this.getHighlightRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import TabContentWrapper from
|
|
3
|
+
import TabContentWrapper from "../TabContentWrapper";
|
|
4
4
|
describe('TabContentWrapper', () => {
|
|
5
5
|
test('rendering the defult props', () => {
|
|
6
6
|
const {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { TabWrapper, Tabs, Tab, TabContentWrapper, TabContent } from "../index";
|
|
4
|
+
describe('TabWrapper', () => {
|
|
5
|
+
const alignments = ['vertical', 'horizontal', 'vertical-reverse', 'horizontal-reverse'];
|
|
6
|
+
test.each(alignments)('rendering the align prop of - %s', alignments => {
|
|
7
|
+
const {
|
|
8
|
+
asFragment
|
|
9
|
+
} = render( /*#__PURE__*/React.createElement(TabWrapper, {
|
|
10
|
+
type: "alpha",
|
|
11
|
+
align: alignments,
|
|
12
|
+
defaultTab: "page1"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement(Tab, {
|
|
14
|
+
id: "page1",
|
|
15
|
+
text: "Page 1"
|
|
16
|
+
}), /*#__PURE__*/React.createElement(Tab, {
|
|
17
|
+
id: "page2",
|
|
18
|
+
text: "Page 2"
|
|
19
|
+
}), /*#__PURE__*/React.createElement(Tab, {
|
|
20
|
+
id: "page3",
|
|
21
|
+
text: "Page 3"
|
|
22
|
+
})), /*#__PURE__*/React.createElement(TabContentWrapper, null, /*#__PURE__*/React.createElement(TabContent, {
|
|
23
|
+
id: "page1",
|
|
24
|
+
text: "Page 1"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("div", null, "Page 1 Content")), /*#__PURE__*/React.createElement(TabContent, {
|
|
26
|
+
id: "page2",
|
|
27
|
+
text: "Page 2"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("div", null, "Page 2 Content")), /*#__PURE__*/React.createElement(TabContent, {
|
|
29
|
+
id: "page3",
|
|
30
|
+
text: "Page 3"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", null, "Page 3 Content")))));
|
|
32
|
+
expect(asFragment()).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
});
|