@hipay/hipay-material-ui 2.3.1-rc4 → 2.3.1-rc5
Sign up to get free protection for your applications and to get access to all the features.
- package/HiAlertModal/HiAlertModal.js +77 -48
- package/HiAlertModal/index.js +15 -1
- package/HiAppBar/HiAppBar.js +63 -34
- package/HiAppBar/index.js +15 -1
- package/HiBadge/HiBadge.js +29 -10
- package/HiBadge/index.js +15 -1
- package/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/HiBreadcrumb/HiStep.js +58 -35
- package/HiBreadcrumb/HiStepConnector.js +58 -33
- package/HiBreadcrumb/HiStepContent.js +47 -26
- package/HiBreadcrumb/HiStepIcon.js +47 -27
- package/HiBreadcrumb/HiStepLabel.js +62 -37
- package/HiBreadcrumb/HiStepper.js +44 -24
- package/HiBreadcrumb/index.js +15 -1
- package/HiButton/HiButton.js +27 -9
- package/HiButton/index.js +13 -2
- package/HiCell/CellAddress.js +39 -21
- package/HiCell/CellDate.js +44 -27
- package/HiCell/CellIcon.js +48 -29
- package/HiCell/CellImage.js +41 -24
- package/HiCell/CellNumeric.js +45 -26
- package/HiCell/CellPinToAction.js +41 -20
- package/HiCell/CellRate.js +56 -33
- package/HiCell/CellSentinel.js +41 -23
- package/HiCell/CellSentinelScore.js +43 -24
- package/HiCell/CellText.js +54 -37
- package/HiCell/CellTextStyled.js +21 -8
- package/HiCell/index.js +79 -9
- package/HiCheckbox/HiCheckbox.js +61 -36
- package/HiCheckbox/index.js +15 -1
- package/HiChip/HiChip.js +44 -24
- package/HiChip/HiChipSwitch.js +73 -47
- package/HiChip/index.js +23 -2
- package/HiColoredLabel/HiColoredLabel.js +52 -28
- package/HiColoredLabel/index.js +15 -1
- package/HiDatePicker/Caption.js +28 -11
- package/HiDatePicker/HiDatePicker.js +131 -101
- package/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/HiDatePicker/HiDateRangePicker.js +168 -139
- package/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/HiDatePicker/ListPicker.js +54 -34
- package/HiDatePicker/NavBar.js +45 -18
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/Overlay.js +35 -18
- package/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/index.js +47 -5
- package/HiDatePicker/Weekday.js +13 -3
- package/HiDatePicker/hiLocaleUtils.js +8 -1
- package/HiDatePicker/index.js +15 -1
- package/HiDatePicker/stylesheet.js +22 -9
- package/HiDotsStepper/HiDot.js +56 -31
- package/HiDotsStepper/HiDotsStepper.js +47 -28
- package/HiDotsStepper/index.js +23 -2
- package/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/HiExpansionPanel/index.js +13 -2
- package/HiForm/HiAddressField.js +46 -29
- package/HiForm/HiEmailField.js +45 -27
- package/HiForm/HiFormControl.js +105 -72
- package/HiForm/HiFormLabel.js +53 -30
- package/HiForm/HiInput.js +89 -62
- package/HiForm/HiPasswordField.js +55 -29
- package/HiForm/HiSearchField.js +43 -28
- package/HiForm/HiSlider.js +64 -41
- package/HiForm/HiTextField.js +46 -29
- package/HiForm/HiUpload.js +76 -53
- package/HiForm/HiUploadField.js +40 -25
- package/HiForm/HiUploadInput.js +84 -56
- package/HiForm/index.js +95 -11
- package/HiIcon/HiIcon.js +44 -22
- package/HiIcon/index.js +15 -1
- package/HiIconButton/HiIconButton.js +40 -18
- package/HiIconButton/index.js +15 -1
- package/HiLoader/HiLoader.js +24 -9
- package/HiLoader/index.js +15 -1
- package/HiMap/HiMap.js +76 -51
- package/HiMap/HiMapExpand.js +64 -39
- package/HiMap/index.js +23 -2
- package/HiNotice/HiKPI.js +56 -33
- package/HiNotice/HiKPINotice.js +21 -7
- package/HiNotice/index.js +23 -2
- package/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/HiPaymentMeans/index.js +15 -1
- package/HiPdfReader/HiPdfReader.js +78 -52
- package/HiPdfReader/index.js +15 -1
- package/HiPin/HiPin.js +30 -9
- package/HiPin/index.js +15 -1
- package/HiRadio/HiRadio.js +24 -7
- package/HiRadio/index.js +15 -1
- package/HiSelect/HiDynamicSelect.js +58 -40
- package/HiSelect/HiDynamicSelectField.js +40 -22
- package/HiSelect/HiNestedSelect.js +85 -55
- package/HiSelect/HiNestedSelectContent.js +72 -46
- package/HiSelect/HiNestedSelectField.js +40 -22
- package/HiSelect/HiSelect.js +161 -123
- package/HiSelect/HiSelectContent.js +104 -73
- package/HiSelect/HiSelectField.js +40 -22
- package/HiSelect/HiSelectInput.js +94 -63
- package/HiSelect/HiSelectMobile.js +54 -35
- package/HiSelect/HiSuggestSelect.js +83 -56
- package/HiSelect/HiSuggestSelectField.js +40 -22
- package/HiSelect/index.js +85 -8
- package/HiSelectableList/HiSelectableList.js +80 -49
- package/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/HiSelectableList/HiSelectableListItem.js +101 -66
- package/HiSelectableList/index.js +31 -3
- package/HiSwitch/HiSwitch.js +45 -20
- package/HiSwitch/HiSwitchState.js +36 -15
- package/HiSwitch/index.js +23 -2
- package/HiTable/HiCellBuilder.js +69 -43
- package/HiTable/HiTable.js +46 -28
- package/HiTable/HiTableBody.js +34 -19
- package/HiTable/HiTableHeader.js +50 -29
- package/HiTable/HiTableRow.js +56 -29
- package/HiTable/constants.js +94 -43
- package/HiTable/index.js +15 -1
- package/es/HiAlertModal/HiAlertModal.js +77 -48
- package/es/HiAlertModal/index.js +15 -1
- package/es/HiAppBar/HiAppBar.js +63 -34
- package/es/HiAppBar/index.js +15 -1
- package/es/HiBadge/HiBadge.js +29 -10
- package/es/HiBadge/index.js +15 -1
- package/es/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/es/HiBreadcrumb/HiStep.js +58 -35
- package/es/HiBreadcrumb/HiStepConnector.js +58 -33
- package/es/HiBreadcrumb/HiStepContent.js +47 -26
- package/es/HiBreadcrumb/HiStepIcon.js +47 -27
- package/es/HiBreadcrumb/HiStepLabel.js +62 -37
- package/es/HiBreadcrumb/HiStepper.js +44 -24
- package/es/HiBreadcrumb/index.js +15 -1
- package/es/HiButton/HiButton.js +27 -9
- package/es/HiButton/index.js +13 -2
- package/es/HiCell/CellAddress.js +39 -21
- package/es/HiCell/CellDate.js +44 -27
- package/es/HiCell/CellIcon.js +48 -29
- package/es/HiCell/CellImage.js +41 -24
- package/es/HiCell/CellNumeric.js +45 -26
- package/es/HiCell/CellPinToAction.js +41 -20
- package/es/HiCell/CellRate.js +56 -33
- package/es/HiCell/CellSentinel.js +41 -23
- package/es/HiCell/CellSentinelScore.js +43 -24
- package/es/HiCell/CellText.js +54 -37
- package/es/HiCell/CellTextStyled.js +21 -8
- package/es/HiCell/index.js +79 -9
- package/es/HiCheckbox/HiCheckbox.js +61 -36
- package/es/HiCheckbox/index.js +15 -1
- package/es/HiChip/HiChip.js +44 -24
- package/es/HiChip/HiChipSwitch.js +73 -47
- package/es/HiChip/index.js +23 -2
- package/es/HiColoredLabel/HiColoredLabel.js +52 -28
- package/es/HiColoredLabel/index.js +15 -1
- package/es/HiDatePicker/Caption.js +28 -11
- package/es/HiDatePicker/HiDatePicker.js +131 -101
- package/es/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/es/HiDatePicker/HiDateRangePicker.js +168 -139
- package/es/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/es/HiDatePicker/ListPicker.js +54 -34
- package/es/HiDatePicker/NavBar.js +45 -18
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/Overlay.js +35 -18
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/index.js +47 -5
- package/es/HiDatePicker/Weekday.js +13 -3
- package/es/HiDatePicker/hiLocaleUtils.js +8 -1
- package/es/HiDatePicker/index.js +15 -1
- package/es/HiDatePicker/stylesheet.js +22 -9
- package/es/HiDotsStepper/HiDot.js +56 -31
- package/es/HiDotsStepper/HiDotsStepper.js +47 -28
- package/es/HiDotsStepper/index.js +23 -2
- package/es/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/es/HiExpansionPanel/index.js +13 -2
- package/es/HiForm/HiAddressField.js +46 -29
- package/es/HiForm/HiEmailField.js +45 -27
- package/es/HiForm/HiFormControl.js +105 -72
- package/es/HiForm/HiFormLabel.js +53 -30
- package/es/HiForm/HiInput.js +89 -62
- package/es/HiForm/HiPasswordField.js +55 -29
- package/es/HiForm/HiSearchField.js +43 -28
- package/es/HiForm/HiSlider.js +64 -41
- package/es/HiForm/HiTextField.js +46 -29
- package/es/HiForm/HiUpload.js +76 -53
- package/es/HiForm/HiUploadField.js +40 -25
- package/es/HiForm/HiUploadInput.js +84 -56
- package/es/HiForm/index.js +95 -11
- package/es/HiIcon/HiIcon.js +44 -22
- package/es/HiIcon/index.js +15 -1
- package/es/HiIconButton/HiIconButton.js +40 -18
- package/es/HiIconButton/index.js +15 -1
- package/es/HiLoader/HiLoader.js +24 -9
- package/es/HiLoader/index.js +15 -1
- package/es/HiMap/HiMap.js +76 -51
- package/es/HiMap/HiMapExpand.js +64 -39
- package/es/HiMap/index.js +23 -2
- package/es/HiNotice/HiKPI.js +56 -33
- package/es/HiNotice/HiKPINotice.js +21 -7
- package/es/HiNotice/index.js +23 -2
- package/es/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/es/HiPaymentMeans/index.js +15 -1
- package/es/HiPdfReader/HiPdfReader.js +78 -52
- package/es/HiPdfReader/index.js +15 -1
- package/es/HiPin/HiPin.js +30 -9
- package/es/HiPin/index.js +15 -1
- package/es/HiRadio/HiRadio.js +24 -7
- package/es/HiRadio/index.js +15 -1
- package/es/HiSelect/HiDynamicSelect.js +58 -40
- package/es/HiSelect/HiDynamicSelectField.js +40 -22
- package/es/HiSelect/HiNestedSelect.js +85 -55
- package/es/HiSelect/HiNestedSelectContent.js +72 -46
- package/es/HiSelect/HiNestedSelectField.js +40 -22
- package/es/HiSelect/HiSelect.js +161 -123
- package/es/HiSelect/HiSelectContent.js +104 -73
- package/es/HiSelect/HiSelectField.js +40 -22
- package/es/HiSelect/HiSelectInput.js +94 -63
- package/es/HiSelect/HiSelectMobile.js +54 -35
- package/es/HiSelect/HiSuggestSelect.js +83 -56
- package/es/HiSelect/HiSuggestSelectField.js +40 -22
- package/es/HiSelect/index.js +85 -8
- package/es/HiSelectableList/HiSelectableList.js +80 -49
- package/es/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/es/HiSelectableList/HiSelectableListItem.js +101 -66
- package/es/HiSelectableList/index.js +31 -3
- package/es/HiSwitch/HiSwitch.js +45 -20
- package/es/HiSwitch/HiSwitchState.js +36 -15
- package/es/HiSwitch/index.js +23 -2
- package/es/HiTable/HiCellBuilder.js +69 -43
- package/es/HiTable/HiTable.js +46 -28
- package/es/HiTable/HiTableBody.js +34 -19
- package/es/HiTable/HiTableHeader.js +50 -29
- package/es/HiTable/HiTableRow.js +56 -29
- package/es/HiTable/constants.js +94 -43
- package/es/HiTable/index.js +15 -1
- package/es/hi-svg-icons/HiAccount.js +36 -18
- package/es/hi-svg-icons/HiActivity.js +35 -17
- package/es/hi-svg-icons/HiAll.js +42 -22
- package/es/hi-svg-icons/HiBilling.js +36 -18
- package/es/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/es/hi-svg-icons/HiCatalog.js +36 -18
- package/es/hi-svg-icons/HiCustomer.js +36 -18
- package/es/hi-svg-icons/HiDownload.js +25 -11
- package/es/hi-svg-icons/HiFinance.js +36 -18
- package/es/hi-svg-icons/HiPermission.js +35 -17
- package/es/hi-svg-icons/HiRoute.js +36 -18
- package/es/hi-svg-icons/HiSettlement.js +36 -18
- package/es/hi-svg-icons/HiSizeLarge.js +27 -12
- package/es/hi-svg-icons/HiSizeMedium.js +25 -11
- package/es/hi-svg-icons/HiSizeSmall.js +25 -11
- package/es/hi-svg-icons/HiTransaction.js +36 -18
- package/es/hi-svg-icons/HiUser.js +36 -18
- package/es/hi-svg-icons/HiWidget.js +42 -22
- package/es/hi-svg-icons/index.js +151 -18
- package/es/hi-svg-icons/index.text.js +21 -11
- package/es/styleguide/Wrapper.js +36 -19
- package/es/styles/MuiThemeProvider.js +57 -39
- package/es/styles/colorManipulator.js +44 -16
- package/es/styles/createBreakpoints.js +20 -6
- package/es/styles/createGenerateClassName.js +15 -5
- package/es/styles/createMixins.js +19 -8
- package/es/styles/createMuiTheme.js +53 -34
- package/es/styles/createPalette.js +50 -30
- package/es/styles/createStyles.js +8 -1
- package/es/styles/createTypography.js +30 -18
- package/es/styles/getStylesCreator.js +24 -11
- package/es/styles/getThemeProps.js +9 -1
- package/es/styles/index.js +47 -5
- package/es/styles/jssPreset.js +25 -9
- package/es/styles/mergeClasses.js +19 -7
- package/es/styles/shadows.js +8 -1
- package/es/styles/shape.js +8 -1
- package/es/styles/spacing.js +9 -1
- package/es/styles/themeListener.js +18 -5
- package/es/styles/transitions.js +38 -18
- package/es/styles/zIndex.js +8 -1
- package/es/test-utils/createMount.js +22 -11
- package/es/test-utils/createRender.js +19 -8
- package/es/test-utils/createShallow.js +23 -13
- package/es/test-utils/getClasses.js +11 -2
- package/es/test-utils/index.js +47 -5
- package/es/test-utils/until.js +16 -6
- package/es/test-utils/unwrap.js +8 -1
- package/es/theme/palette.js +10 -2
- package/es/theme/typography.js +11 -3
- package/es/theme.js +13 -4
- package/es/transitions/utils.js +13 -2
- package/es/utils/exactProp.js +18 -5
- package/es/utils/helpers.js +55 -18
- package/es/withMobileDialog/index.js +15 -1
- package/es/withMobileDialog/withMobileDialog.js +22 -7
- package/hi-svg-icons/HiAccount.js +36 -18
- package/hi-svg-icons/HiActivity.js +35 -17
- package/hi-svg-icons/HiAll.js +42 -22
- package/hi-svg-icons/HiBilling.js +36 -18
- package/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/hi-svg-icons/HiCatalog.js +36 -18
- package/hi-svg-icons/HiCustomer.js +36 -18
- package/hi-svg-icons/HiDownload.js +25 -11
- package/hi-svg-icons/HiFinance.js +36 -18
- package/hi-svg-icons/HiPermission.js +35 -17
- package/hi-svg-icons/HiRoute.js +36 -18
- package/hi-svg-icons/HiSettlement.js +36 -18
- package/hi-svg-icons/HiSizeLarge.js +27 -12
- package/hi-svg-icons/HiSizeMedium.js +25 -11
- package/hi-svg-icons/HiSizeSmall.js +25 -11
- package/hi-svg-icons/HiTransaction.js +36 -18
- package/hi-svg-icons/HiUser.js +36 -18
- package/hi-svg-icons/HiWidget.js +42 -22
- package/hi-svg-icons/index.js +151 -18
- package/hi-svg-icons/index.text.js +21 -11
- package/package.json +2 -1
- package/styleguide/Wrapper.js +36 -19
- package/styles/MuiThemeProvider.js +57 -39
- package/styles/colorManipulator.js +44 -16
- package/styles/createBreakpoints.js +20 -6
- package/styles/createGenerateClassName.js +15 -5
- package/styles/createMixins.js +19 -8
- package/styles/createMuiTheme.js +53 -34
- package/styles/createPalette.js +50 -30
- package/styles/createStyles.js +8 -1
- package/styles/createTypography.js +30 -18
- package/styles/getStylesCreator.js +24 -11
- package/styles/getThemeProps.js +9 -1
- package/styles/index.js +47 -5
- package/styles/jssPreset.js +25 -9
- package/styles/mergeClasses.js +19 -7
- package/styles/shadows.js +8 -1
- package/styles/shape.js +8 -1
- package/styles/spacing.js +9 -1
- package/styles/themeListener.js +18 -5
- package/styles/transitions.js +38 -18
- package/styles/zIndex.js +8 -1
- package/test-utils/createMount.js +22 -11
- package/test-utils/createRender.js +19 -8
- package/test-utils/createShallow.js +23 -13
- package/test-utils/getClasses.js +11 -2
- package/test-utils/index.js +47 -5
- package/test-utils/until.js +16 -6
- package/test-utils/unwrap.js +8 -1
- package/theme/palette.js +10 -2
- package/theme/typography.js +11 -3
- package/theme.js +13 -4
- package/transitions/utils.js +13 -2
- package/utils/exactProp.js +18 -5
- package/utils/helpers.js +55 -18
- package/withMobileDialog/index.js +15 -1
- package/withMobileDialog/withMobileDialog.js +22 -7
- package/App.test.js +0 -8
- package/HiAlertModal/HiAlertModal.test.js +0 -189
- package/HiBadge/HiBadge.test.js +0 -49
- package/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/HiBreadcrumb/HiStep.test.js +0 -47
- package/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/HiBreadcrumb/HiStepper.test.js +0 -33
- package/HiCell/CellAddress.test.js +0 -75
- package/HiCell/CellDate.test.js +0 -173
- package/HiCell/CellIcon.test.js +0 -57
- package/HiCell/CellImage.test.js +0 -49
- package/HiCell/CellNumeric.test.js +0 -46
- package/HiCell/CellRate.test.js +0 -73
- package/HiCell/CellSentinel.test.js +0 -48
- package/HiCell/CellText.test.js +0 -76
- package/HiCheckbox/HiCheckbox.test.js +0 -55
- package/HiChip/HiChip.test.js +0 -136
- package/HiChip/HiChipSwitch.test.js +0 -99
- package/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/HiDatePicker/Caption.test.js +0 -65
- package/HiDatePicker/HiDatePicker.test.js +0 -370
- package/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/HiDatePicker/ListPicker.test.js +0 -53
- package/HiDatePicker/NavBar.test.js +0 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/HiDotsStepper/HiDot.test.js +0 -55
- package/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/HiForm/HiAddressField.test.js +0 -79
- package/HiForm/HiEmailField.test.js +0 -19
- package/HiForm/HiFormControl.test.js +0 -195
- package/HiForm/HiFormLabel.test.js +0 -66
- package/HiForm/HiInput.test.js +0 -202
- package/HiForm/HiPasswordField.test.js +0 -60
- package/HiForm/HiSearchField.test.js +0 -193
- package/HiForm/HiSlider.test.js +0 -99
- package/HiForm/HiTextField.test.js +0 -254
- package/HiForm/HiUpload.test.js +0 -241
- package/HiForm/HiUploadField.test.js +0 -55
- package/HiForm/HiUploadInput.test.js +0 -148
- package/HiIconButton/HiIconButton.test.js +0 -69
- package/HiLoader/HiLoader.test.js +0 -18
- package/HiMap/HiMap.test.js +0 -29
- package/HiMap/HiMapExpand.test.js +0 -48
- package/HiNotice/HiKPI.test.js +0 -171
- package/HiNotice/HiKPINotice.test.js +0 -88
- package/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/HiPin/HiPin.test.js +0 -61
- package/HiRadio/HiRadio.test.js +0 -57
- package/HiSelect/HiSelect.test.js +0 -1092
- package/HiSelect/HiSelectInput.test.js +0 -21
- package/HiSelectableList/HiSelectableList.test.js +0 -173
- package/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/HiSwitch/HiSwitch.test.js +0 -41
- package/HiSwitch/HiSwitchState.test.js +0 -76
- package/HiTable/HiTable.test.js +0 -29
- package/es/App.test.js +0 -8
- package/es/HiAlertModal/HiAlertModal.test.js +0 -189
- package/es/HiBadge/HiBadge.test.js +0 -49
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/es/HiBreadcrumb/HiStep.test.js +0 -47
- package/es/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/es/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/es/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/es/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/es/HiBreadcrumb/HiStepper.test.js +0 -33
- package/es/HiCell/CellAddress.test.js +0 -75
- package/es/HiCell/CellDate.test.js +0 -173
- package/es/HiCell/CellIcon.test.js +0 -57
- package/es/HiCell/CellImage.test.js +0 -49
- package/es/HiCell/CellNumeric.test.js +0 -46
- package/es/HiCell/CellRate.test.js +0 -73
- package/es/HiCell/CellSentinel.test.js +0 -48
- package/es/HiCell/CellText.test.js +0 -76
- package/es/HiCheckbox/HiCheckbox.test.js +0 -55
- package/es/HiChip/HiChip.test.js +0 -136
- package/es/HiChip/HiChipSwitch.test.js +0 -99
- package/es/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/es/HiDatePicker/Caption.test.js +0 -65
- package/es/HiDatePicker/HiDatePicker.test.js +0 -370
- package/es/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/es/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/es/HiDatePicker/ListPicker.test.js +0 -53
- package/es/HiDatePicker/NavBar.test.js +0 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/es/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/es/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/es/HiDotsStepper/HiDot.test.js +0 -55
- package/es/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/es/HiForm/HiAddressField.test.js +0 -79
- package/es/HiForm/HiEmailField.test.js +0 -19
- package/es/HiForm/HiFormControl.test.js +0 -195
- package/es/HiForm/HiFormLabel.test.js +0 -66
- package/es/HiForm/HiInput.test.js +0 -202
- package/es/HiForm/HiPasswordField.test.js +0 -60
- package/es/HiForm/HiSearchField.test.js +0 -193
- package/es/HiForm/HiSlider.test.js +0 -99
- package/es/HiForm/HiTextField.test.js +0 -254
- package/es/HiForm/HiUpload.test.js +0 -241
- package/es/HiForm/HiUploadField.test.js +0 -55
- package/es/HiForm/HiUploadInput.test.js +0 -148
- package/es/HiIconButton/HiIconButton.test.js +0 -69
- package/es/HiLoader/HiLoader.test.js +0 -18
- package/es/HiMap/HiMap.test.js +0 -29
- package/es/HiMap/HiMapExpand.test.js +0 -48
- package/es/HiNotice/HiKPI.test.js +0 -171
- package/es/HiNotice/HiKPINotice.test.js +0 -88
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/es/HiPin/HiPin.test.js +0 -61
- package/es/HiRadio/HiRadio.test.js +0 -57
- package/es/HiSelect/HiSelect.test.js +0 -1092
- package/es/HiSelect/HiSelectInput.test.js +0 -21
- package/es/HiSelectableList/HiSelectableList.test.js +0 -173
- package/es/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/es/HiSwitch/HiSwitch.test.js +0 -41
- package/es/HiSwitch/HiSwitchState.test.js +0 -76
- package/es/HiTable/HiTable.test.js +0 -29
- package/es/styles/colorManipulator.test.js +0 -242
- package/es/styles/createBreakpoints.test.js +0 -48
- package/es/styles/createGenerateClassName.test.js +0 -141
- package/es/styles/createMixins.test.js +0 -24
- package/es/styles/createMuiTheme.test.js +0 -67
- package/es/styles/createPalette.test.js +0 -159
- package/es/styles/createStyles.test.js +0 -8
- package/es/styles/createTypography.test.js +0 -60
- package/es/styles/getStylesCreator.test.js +0 -92
- package/es/styles/getThemeProps.test.js +0 -39
- package/es/styles/themeListener.test.js +0 -26
- package/es/styles/transitions.test.js +0 -208
- package/es/test-utils/until.test.js +0 -157
- package/es/withMobileDialog/withMobileDialog.test.js +0 -67
- package/styles/colorManipulator.test.js +0 -242
- package/styles/createBreakpoints.test.js +0 -48
- package/styles/createGenerateClassName.test.js +0 -141
- package/styles/createMixins.test.js +0 -24
- package/styles/createMuiTheme.test.js +0 -67
- package/styles/createPalette.test.js +0 -159
- package/styles/createStyles.test.js +0 -8
- package/styles/createTypography.test.js +0 -60
- package/styles/getStylesCreator.test.js +0 -92
- package/styles/getThemeProps.test.js +0 -39
- package/styles/themeListener.test.js +0 -26
- package/styles/transitions.test.js +0 -208
- package/test-utils/until.test.js +0 -157
- package/withMobileDialog/withMobileDialog.test.js +0 -67
@@ -1,21 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow } from '../test-utils';
|
4
|
-
import HiSelectInput from './HiSelectInput';
|
5
|
-
import ButtonBase from '@material-ui/core/ButtonBase';
|
6
|
-
import { spy } from 'sinon';
|
7
|
-
describe('<SelectInput />', function () {
|
8
|
-
var shallow;
|
9
|
-
it('should render a ButtonBase', function () {
|
10
|
-
var handler = spy();
|
11
|
-
shallow = createShallow();
|
12
|
-
var wrapper = shallow(React.createElement(HiSelectInput, {
|
13
|
-
value: "Zin\xE9dine Zidane",
|
14
|
-
open: false,
|
15
|
-
focused: false,
|
16
|
-
disabled: false,
|
17
|
-
onClick: handler
|
18
|
-
}));
|
19
|
-
assert.strictEqual(wrapper.dive().find(ButtonBase).length, 1, 'should be a ButtonBase');
|
20
|
-
});
|
21
|
-
});
|
@@ -1,173 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import List from '@material-ui/core/List';
|
5
|
-
import LazyLoad from 'react-lazyload';
|
6
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
7
|
-
import HiSelectableList from './HiSelectableList';
|
8
|
-
import HiSelectableListItem from './HiSelectableListItem';
|
9
|
-
describe('<HiSelectableList />', function () {
|
10
|
-
var shallow;
|
11
|
-
var classes;
|
12
|
-
var mount;
|
13
|
-
before(function () {
|
14
|
-
shallow = createShallow({
|
15
|
-
dive: true
|
16
|
-
});
|
17
|
-
classes = getClasses(React.createElement(HiSelectableList, {
|
18
|
-
itemList: [],
|
19
|
-
selectedIdList: [],
|
20
|
-
onSelect: function onSelect() {
|
21
|
-
return null;
|
22
|
-
},
|
23
|
-
lazy: false
|
24
|
-
}));
|
25
|
-
});
|
26
|
-
beforeEach(function () {
|
27
|
-
mount = createMount();
|
28
|
-
});
|
29
|
-
afterEach(function () {
|
30
|
-
mount.cleanUp();
|
31
|
-
});
|
32
|
-
it('should render a ul', function () {
|
33
|
-
var wrapper = mount(React.createElement(HiSelectableList, {
|
34
|
-
itemList: [],
|
35
|
-
selectedIdList: [],
|
36
|
-
onSelect: function onSelect() {
|
37
|
-
return null;
|
38
|
-
},
|
39
|
-
lazy: false
|
40
|
-
}));
|
41
|
-
assert.strictEqual(wrapper.find('ul').length, 1);
|
42
|
-
});
|
43
|
-
it('should render as many li as items', function () {
|
44
|
-
var itemList = [{
|
45
|
-
id: 'zz',
|
46
|
-
label: 'Zizou'
|
47
|
-
}, {
|
48
|
-
id: 'zze',
|
49
|
-
label: 'Zizou encore'
|
50
|
-
}, {
|
51
|
-
id: 'ep',
|
52
|
-
label: 'Emmanuel Petit'
|
53
|
-
}];
|
54
|
-
var selectedIdList = ['zz'];
|
55
|
-
var wrapper = mount(React.createElement(HiSelectableList, {
|
56
|
-
itemList: itemList,
|
57
|
-
selectedIdList: selectedIdList,
|
58
|
-
onSelect: function onSelect() {
|
59
|
-
return null;
|
60
|
-
},
|
61
|
-
lazy: false
|
62
|
-
}));
|
63
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).length, itemList.length);
|
64
|
-
});
|
65
|
-
it('should render with the root classes', function () {
|
66
|
-
var wrapper = shallow(React.createElement(HiSelectableList, {
|
67
|
-
itemList: [],
|
68
|
-
selectedIdList: [],
|
69
|
-
onSelect: function onSelect() {
|
70
|
-
return null;
|
71
|
-
},
|
72
|
-
lazy: false
|
73
|
-
}));
|
74
|
-
assert.strictEqual(wrapper.find(List).hasClass(classes.root), true);
|
75
|
-
});
|
76
|
-
it('should call onSelect with selectedItem', function () {
|
77
|
-
var itemList = [{
|
78
|
-
id: 'zz',
|
79
|
-
label: 'Zizou'
|
80
|
-
}, {
|
81
|
-
id: 'zze',
|
82
|
-
label: 'Zizou encore'
|
83
|
-
}, {
|
84
|
-
id: 'ep',
|
85
|
-
label: 'Emmanuel Petit'
|
86
|
-
}];
|
87
|
-
var handleOnSelect = spy();
|
88
|
-
var wrapper = mount(React.createElement(HiSelectableList, {
|
89
|
-
itemList: itemList,
|
90
|
-
selectedIdList: [],
|
91
|
-
onSelect: handleOnSelect,
|
92
|
-
lazy: false
|
93
|
-
}));
|
94
|
-
var firstCheckbox = wrapper.find("input[type='checkbox']").first();
|
95
|
-
firstCheckbox.simulate('click');
|
96
|
-
assert.strictEqual(handleOnSelect.calledOnce, true);
|
97
|
-
assert.strictEqual(handleOnSelect.args[0][1], itemList[0]);
|
98
|
-
});
|
99
|
-
it('should sort items', function () {
|
100
|
-
var itemList = [{
|
101
|
-
id: 'zz',
|
102
|
-
label: 'Zizou'
|
103
|
-
}, {
|
104
|
-
id: 'zze',
|
105
|
-
label: 'Zizou encore'
|
106
|
-
}, {
|
107
|
-
id: 'ep',
|
108
|
-
label: 'Emmanuel Petit'
|
109
|
-
}];
|
110
|
-
var handleOnSelect = spy();
|
111
|
-
var wrapper = mount(React.createElement(HiSelectableList, {
|
112
|
-
hideCheckbox: true,
|
113
|
-
itemList: itemList,
|
114
|
-
selectedIdList: [],
|
115
|
-
onSelect: handleOnSelect,
|
116
|
-
sort: true,
|
117
|
-
lazy: false
|
118
|
-
}));
|
119
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(0).text(), 'Emmanuel Petit');
|
120
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(1).text(), 'Zizou');
|
121
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(2).text(), 'Zizou encore');
|
122
|
-
});
|
123
|
-
it('should custom sort items', function () {
|
124
|
-
var itemList = [{
|
125
|
-
id: 'zz',
|
126
|
-
label: 'Zizou'
|
127
|
-
}, {
|
128
|
-
id: 'zze',
|
129
|
-
label: 'Zizou encore'
|
130
|
-
}, {
|
131
|
-
id: 'ep',
|
132
|
-
label: 'Emmanuel Petit'
|
133
|
-
}];
|
134
|
-
var handleOnSelect = spy();
|
135
|
-
|
136
|
-
var compareItemFunc = function compareItemFunc(a, b) {
|
137
|
-
return a.label.length > b.label.length ? 1 : -1;
|
138
|
-
};
|
139
|
-
|
140
|
-
var wrapper = mount(React.createElement(HiSelectableList, {
|
141
|
-
hideCheckbox: true,
|
142
|
-
itemList: itemList,
|
143
|
-
selectedIdList: [],
|
144
|
-
onSelect: handleOnSelect,
|
145
|
-
sort: true,
|
146
|
-
comparItemFunc: compareItemFunc,
|
147
|
-
lazy: false
|
148
|
-
}));
|
149
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(0).text(), 'Zizou');
|
150
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(1).text(), 'Zizou encore');
|
151
|
-
assert.strictEqual(wrapper.find(HiSelectableListItem).at(2).text(), 'Emmanuel Petit');
|
152
|
-
});
|
153
|
-
it('should render with lazyload', function () {
|
154
|
-
var itemList = [{
|
155
|
-
id: 'zz',
|
156
|
-
label: 'Zizou'
|
157
|
-
}, {
|
158
|
-
id: 'zze',
|
159
|
-
label: 'Zizou encore'
|
160
|
-
}, {
|
161
|
-
id: 'ep',
|
162
|
-
label: 'Emmanuel Petit'
|
163
|
-
}];
|
164
|
-
var wrapper = shallow(React.createElement(HiSelectableList, {
|
165
|
-
itemList: itemList,
|
166
|
-
selectedIdList: [],
|
167
|
-
onSelect: function onSelect() {
|
168
|
-
return null;
|
169
|
-
}
|
170
|
-
}));
|
171
|
-
assert.strictEqual(wrapper.find(LazyLoad).length, 3);
|
172
|
-
});
|
173
|
-
});
|
@@ -1,97 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import ListItem from '@material-ui/core/ListItem';
|
4
|
-
import HiCheckbox from '../HiCheckbox';
|
5
|
-
import { spy } from 'sinon';
|
6
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
7
|
-
import HiSelectableListItem from './HiSelectableListItem';
|
8
|
-
describe('<HiSelectableListItem />', function () {
|
9
|
-
var shallow;
|
10
|
-
var mount;
|
11
|
-
var classes;
|
12
|
-
before(function () {
|
13
|
-
shallow = createShallow({
|
14
|
-
dive: true
|
15
|
-
});
|
16
|
-
classes = getClasses(React.createElement(HiSelectableListItem, null));
|
17
|
-
});
|
18
|
-
beforeEach(function () {
|
19
|
-
mount = createMount();
|
20
|
-
});
|
21
|
-
afterEach(function () {
|
22
|
-
mount.cleanUp();
|
23
|
-
});
|
24
|
-
it('should render a unselected checkbox', function () {
|
25
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
26
|
-
selected: false,
|
27
|
-
checkbox: true,
|
28
|
-
onSelect: function onSelect() {
|
29
|
-
return null;
|
30
|
-
}
|
31
|
-
}));
|
32
|
-
assert.strictEqual(wrapper.find(HiCheckbox).props().checked, false);
|
33
|
-
});
|
34
|
-
it('should render an item without the class inline', function () {
|
35
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
36
|
-
secondaryInline: false
|
37
|
-
}));
|
38
|
-
assert.strictEqual(wrapper.find(ListItem).hasClass(classes.inline), false);
|
39
|
-
});
|
40
|
-
it('should render a selected checkbox', function () {
|
41
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
42
|
-
selected: true,
|
43
|
-
checkbox: true,
|
44
|
-
onSelect: function onSelect() {
|
45
|
-
return null;
|
46
|
-
}
|
47
|
-
}));
|
48
|
-
assert.strictEqual(wrapper.find(HiCheckbox).props().checked, true);
|
49
|
-
});
|
50
|
-
it('should update if props selected change', function () {
|
51
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
52
|
-
selected: false,
|
53
|
-
checkbox: true,
|
54
|
-
onSelect: function onSelect() {
|
55
|
-
return null;
|
56
|
-
}
|
57
|
-
}));
|
58
|
-
assert.strictEqual(wrapper.find(HiCheckbox).props().checked, false);
|
59
|
-
wrapper.setProps({
|
60
|
-
selected: true
|
61
|
-
});
|
62
|
-
wrapper.update();
|
63
|
-
assert.strictEqual(wrapper.find(HiCheckbox).props().checked, true);
|
64
|
-
});
|
65
|
-
it('should call onSelect on click event', function () {
|
66
|
-
var handleOnSelect = spy();
|
67
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
68
|
-
selected: false,
|
69
|
-
onSelect: handleOnSelect
|
70
|
-
}));
|
71
|
-
var listItem = wrapper.find(ListItem);
|
72
|
-
listItem.simulate('click');
|
73
|
-
assert.strictEqual(handleOnSelect.calledOnce, true);
|
74
|
-
});
|
75
|
-
it('should update state if element is hovered', function () {
|
76
|
-
var wrapper = shallow(React.createElement(HiSelectableListItem, {
|
77
|
-
selected: false,
|
78
|
-
onSelect: function onSelect() {
|
79
|
-
return null;
|
80
|
-
}
|
81
|
-
}));
|
82
|
-
var listItem = wrapper.dive().find(ListItem);
|
83
|
-
listItem.simulate('mouseenter');
|
84
|
-
assert.strictEqual(wrapper.state().hover, true);
|
85
|
-
listItem.simulate('mouseleave');
|
86
|
-
assert.strictEqual(wrapper.state().hover, false);
|
87
|
-
});
|
88
|
-
it('should handle hideCheckbox & disabled props', function () {
|
89
|
-
var wrapper = mount(React.createElement(HiSelectableListItem, {
|
90
|
-
selected: true,
|
91
|
-
hideCheckbox: true,
|
92
|
-
disabled: true
|
93
|
-
}));
|
94
|
-
assert.strictEqual(wrapper.find(HiCheckbox).length, 0);
|
95
|
-
assert.strictEqual(wrapper.find(ListItem).props().disabled, true);
|
96
|
-
});
|
97
|
-
});
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import Check from '@material-ui/icons/Check';
|
4
|
-
import SwitchBase from '@material-ui/core/internal/SwitchBase';
|
5
|
-
import { createShallow, getClasses } from '../test-utils';
|
6
|
-
import HiSwitch from './HiSwitch';
|
7
|
-
describe('<HiSwitch />', function () {
|
8
|
-
var shallow;
|
9
|
-
var classes;
|
10
|
-
before(function () {
|
11
|
-
shallow = createShallow({
|
12
|
-
untilSelector: 'div'
|
13
|
-
});
|
14
|
-
classes = getClasses(React.createElement(HiSwitch, null));
|
15
|
-
});
|
16
|
-
describe('default HiSwitch export', function () {
|
17
|
-
var wrapper;
|
18
|
-
beforeEach(function () {
|
19
|
-
wrapper = shallow(React.createElement(HiSwitch, {
|
20
|
-
className: "foo"
|
21
|
-
}));
|
22
|
-
});
|
23
|
-
it('should render a div with the root and user classes', function () {
|
24
|
-
assert.strictEqual(wrapper.name(), 'div');
|
25
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
26
|
-
assert.strictEqual(wrapper.hasClass('foo'), true);
|
27
|
-
assert.strictEqual(wrapper.find(SwitchBase).length, 1);
|
28
|
-
});
|
29
|
-
it('should render SwitchBase with a custom div icon with the icon class', function () {
|
30
|
-
var switchBase = wrapper.childAt(0);
|
31
|
-
assert.strictEqual(switchBase.name(), 'WithStyles(SwitchBase)');
|
32
|
-
assert.strictEqual(switchBase.props().icon.type, Check);
|
33
|
-
assert.strictEqual(switchBase.props().icon.props.className, classes.icon);
|
34
|
-
});
|
35
|
-
it('should render the bar as the 2nd child', function () {
|
36
|
-
var bar = wrapper.childAt(1);
|
37
|
-
assert.strictEqual(bar.is('div'), true);
|
38
|
-
assert.strictEqual(bar.hasClass(classes.bar), true);
|
39
|
-
});
|
40
|
-
});
|
41
|
-
});
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, getClasses } from '../test-utils';
|
5
|
-
import HiSwitchState from './HiSwitchState';
|
6
|
-
describe('<HiSwitchState />', function () {
|
7
|
-
var shallow;
|
8
|
-
var classes;
|
9
|
-
before(function () {
|
10
|
-
shallow = createShallow({
|
11
|
-
untilSelector: 'div'
|
12
|
-
});
|
13
|
-
classes = getClasses(React.createElement(HiSwitchState, null));
|
14
|
-
});
|
15
|
-
describe('default HiSwitch export', function () {
|
16
|
-
var wrapper;
|
17
|
-
var handler;
|
18
|
-
beforeEach(function () {
|
19
|
-
handler = spy();
|
20
|
-
wrapper = shallow(React.createElement(HiSwitchState, {
|
21
|
-
className: "foo",
|
22
|
-
checked: "zou",
|
23
|
-
onChange: handler,
|
24
|
-
leftLabel: "Zin\xE9dine",
|
25
|
-
leftValue: "zi",
|
26
|
-
rightLabel: "Zidane",
|
27
|
-
rightValue: "zou"
|
28
|
-
}));
|
29
|
-
});
|
30
|
-
it('should render a div with the root and user classes', function () {
|
31
|
-
assert.strictEqual(wrapper.name(), 'div');
|
32
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
33
|
-
assert.strictEqual(wrapper.hasClass('foo'), true);
|
34
|
-
});
|
35
|
-
it('should render 2 clickable buttons', function () {
|
36
|
-
var leftButton = wrapper.childAt(0).dive();
|
37
|
-
var rightButton = wrapper.childAt(1).dive();
|
38
|
-
assert.strictEqual(leftButton.name(), 'ForwardRef(HiButton)');
|
39
|
-
assert.strictEqual(leftButton.props().children, 'Zinédine');
|
40
|
-
assert.strictEqual(leftButton.hasClass(classes.checked), false);
|
41
|
-
assert.strictEqual(rightButton.name(), 'ForwardRef(HiButton)');
|
42
|
-
assert.strictEqual(rightButton.props().children, 'Zidane');
|
43
|
-
assert.strictEqual(rightButton.hasClass(classes.checked), true); // Simulate click and update props
|
44
|
-
|
45
|
-
leftButton.simulate('click');
|
46
|
-
assert.strictEqual(handler.calledOnce, true, 'should onChange callback be called once');
|
47
|
-
assert.strictEqual(handler.calledWith(undefined, 'zi'), true, 'should onChange callback be called with params');
|
48
|
-
rightButton.simulate('click');
|
49
|
-
assert.strictEqual(handler.calledTwice, true, 'should onChange callback be called twice');
|
50
|
-
assert.strictEqual(handler.calledWith(undefined, 'zou'), true, 'should onChange callback be called with params');
|
51
|
-
wrapper.setProps({
|
52
|
-
checked: 'zi'
|
53
|
-
});
|
54
|
-
wrapper.update();
|
55
|
-
leftButton = wrapper.childAt(0).dive();
|
56
|
-
rightButton = wrapper.childAt(1).dive();
|
57
|
-
assert.strictEqual(leftButton.hasClass(classes.checked), true);
|
58
|
-
assert.strictEqual(rightButton.hasClass(classes.checked), false);
|
59
|
-
});
|
60
|
-
});
|
61
|
-
it('should render disabled buttons', function () {
|
62
|
-
var wrapper = shallow(React.createElement(HiSwitchState, {
|
63
|
-
className: "foo",
|
64
|
-
checked: "zi",
|
65
|
-
leftLabel: "Zin\xE9dine",
|
66
|
-
leftValue: "zi",
|
67
|
-
rightLabel: "Zidane",
|
68
|
-
rightValue: "zou",
|
69
|
-
disabled: true
|
70
|
-
}));
|
71
|
-
var leftButton = wrapper.childAt(0).dive();
|
72
|
-
var rightButton = wrapper.childAt(1).dive();
|
73
|
-
assert.strictEqual(leftButton.hasClass(classes.disabled), true);
|
74
|
-
assert.strictEqual(rightButton.hasClass(classes.disabled), true);
|
75
|
-
});
|
76
|
-
});
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, getClasses } from '../test-utils';
|
4
|
-
import HiTable from './HiTable';
|
5
|
-
describe('<HiTable columns={columns} data={data}/>', function () {
|
6
|
-
var shallow;
|
7
|
-
var classes;
|
8
|
-
var columns = {};
|
9
|
-
var data = [];
|
10
|
-
before(function () {
|
11
|
-
shallow = createShallow({
|
12
|
-
untilSelector: 'table'
|
13
|
-
});
|
14
|
-
classes = getClasses(React.createElement(HiTable, {
|
15
|
-
columns: columns,
|
16
|
-
data: data
|
17
|
-
}));
|
18
|
-
});
|
19
|
-
describe('default HiTable export', function () {
|
20
|
-
it('should render a table with the root classes', function () {
|
21
|
-
var wrapper = shallow(React.createElement(HiTable, {
|
22
|
-
columns: columns,
|
23
|
-
data: data
|
24
|
-
}));
|
25
|
-
assert.strictEqual(wrapper.name(), 'table');
|
26
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
27
|
-
});
|
28
|
-
});
|
29
|
-
});
|
@@ -1,242 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import consoleErrorMock from 'test/utils/consoleErrorMock';
|
3
|
-
import { recomposeColor, convertHexToRGB, rgbToHex, darken, decomposeColor, emphasize, fade, getContrastRatio, getLuminance, lighten } from './colorManipulator';
|
4
|
-
describe('utils/colorManipulator', function () {
|
5
|
-
beforeEach(function () {
|
6
|
-
consoleErrorMock.spy();
|
7
|
-
});
|
8
|
-
afterEach(function () {
|
9
|
-
consoleErrorMock.reset();
|
10
|
-
});
|
11
|
-
describe('recomposeColor', function () {
|
12
|
-
it('converts a decomposed rgb color object to a string` ', function () {
|
13
|
-
assert.strictEqual(recomposeColor({
|
14
|
-
type: 'rgb',
|
15
|
-
values: [255, 255, 255]
|
16
|
-
}), 'rgb(255, 255, 255)');
|
17
|
-
});
|
18
|
-
it('converts a decomposed rgba color object to a string` ', function () {
|
19
|
-
assert.strictEqual(recomposeColor({
|
20
|
-
type: 'rgba',
|
21
|
-
values: [255, 255, 255, 0.5]
|
22
|
-
}), 'rgba(255, 255, 255, 0.5)');
|
23
|
-
});
|
24
|
-
it('converts a decomposed hsl color object to a string` ', function () {
|
25
|
-
assert.strictEqual(recomposeColor({
|
26
|
-
type: 'hsl',
|
27
|
-
values: [100, 50, 25]
|
28
|
-
}), 'hsl(100, 50%, 25%)');
|
29
|
-
});
|
30
|
-
it('converts a decomposed hsla color object to a string` ', function () {
|
31
|
-
assert.strictEqual(recomposeColor({
|
32
|
-
type: 'hsla',
|
33
|
-
values: [100, 50, 25, 0.5]
|
34
|
-
}), 'hsla(100, 50%, 25%, 0.5)');
|
35
|
-
});
|
36
|
-
});
|
37
|
-
describe('convertHexToRGB', function () {
|
38
|
-
it('converts a short hex color to an rgb color` ', function () {
|
39
|
-
assert.strictEqual(convertHexToRGB('#9f3'), 'rgb(153, 255, 51)');
|
40
|
-
});
|
41
|
-
it('converts a long hex color to an rgb color` ', function () {
|
42
|
-
assert.strictEqual(convertHexToRGB('#A94FD3'), 'rgb(169, 79, 211)');
|
43
|
-
});
|
44
|
-
});
|
45
|
-
describe('rgbToHex', function () {
|
46
|
-
it('converts an rgb color to a hex color` ', function () {
|
47
|
-
assert.strictEqual(rgbToHex('rgb(169, 79, 211)'), '#a94fd3');
|
48
|
-
});
|
49
|
-
it('passes a hex value through` ', function () {
|
50
|
-
assert.strictEqual(rgbToHex('#A94FD3'), '#A94FD3');
|
51
|
-
});
|
52
|
-
});
|
53
|
-
describe('decomposeColor', function () {
|
54
|
-
it('converts an rgb color string to an object with `type` and `value` keys', function () {
|
55
|
-
var _decomposeColor = decomposeColor('rgb(255, 255, 255)'),
|
56
|
-
type = _decomposeColor.type,
|
57
|
-
values = _decomposeColor.values;
|
58
|
-
|
59
|
-
assert.strictEqual(type, 'rgb');
|
60
|
-
assert.deepEqual(values, [255, 255, 255]);
|
61
|
-
});
|
62
|
-
it('converts an rgba color string to an object with `type` and `value` keys', function () {
|
63
|
-
var _decomposeColor2 = decomposeColor('rgba(255, 255, 255, 0.5)'),
|
64
|
-
type = _decomposeColor2.type,
|
65
|
-
values = _decomposeColor2.values;
|
66
|
-
|
67
|
-
assert.strictEqual(type, 'rgba');
|
68
|
-
assert.deepEqual(values, [255, 255, 255, 0.5]);
|
69
|
-
});
|
70
|
-
it('converts an hsl color string to an object with `type` and `value` keys', function () {
|
71
|
-
var _decomposeColor3 = decomposeColor('hsl(100, 50%, 25%)'),
|
72
|
-
type = _decomposeColor3.type,
|
73
|
-
values = _decomposeColor3.values;
|
74
|
-
|
75
|
-
assert.strictEqual(type, 'hsl');
|
76
|
-
assert.deepEqual(values, [100, 50, 25]);
|
77
|
-
});
|
78
|
-
it('converts an hsla color string to an object with `type` and `value` keys', function () {
|
79
|
-
var _decomposeColor4 = decomposeColor('hsla(100, 50%, 25%, 0.5)'),
|
80
|
-
type = _decomposeColor4.type,
|
81
|
-
values = _decomposeColor4.values;
|
82
|
-
|
83
|
-
assert.strictEqual(type, 'hsla');
|
84
|
-
assert.deepEqual(values, [100, 50, 25, 0.5]);
|
85
|
-
});
|
86
|
-
});
|
87
|
-
describe('getContrastRatio', function () {
|
88
|
-
it('returns a ratio for black : white', function () {
|
89
|
-
assert.strictEqual(getContrastRatio('#000', '#FFF'), 21);
|
90
|
-
});
|
91
|
-
it('returns a ratio for black : black', function () {
|
92
|
-
assert.strictEqual(getContrastRatio('#000', '#000'), 1);
|
93
|
-
});
|
94
|
-
it('returns a ratio for white : white', function () {
|
95
|
-
assert.strictEqual(getContrastRatio('#FFF', '#FFF'), 1);
|
96
|
-
});
|
97
|
-
it('returns a ratio for dark-grey : light-grey', function () {
|
98
|
-
assert.approximately(getContrastRatio('#707070', '#E5E5E5'), 3.93, 0.01);
|
99
|
-
});
|
100
|
-
it('returns a ratio for black : light-grey', function () {
|
101
|
-
assert.approximately(getContrastRatio('#000', '#888'), 5.92, 0.01);
|
102
|
-
});
|
103
|
-
});
|
104
|
-
describe('getLuminance', function () {
|
105
|
-
it('returns a valid luminance for rgb white', function () {
|
106
|
-
assert.strictEqual(getLuminance('rgba(0, 0, 0)'), 0);
|
107
|
-
assert.strictEqual(getLuminance('rgb(0, 0, 0)'), 0);
|
108
|
-
});
|
109
|
-
it('returns a valid luminance for rgb white', function () {
|
110
|
-
assert.strictEqual(getLuminance('rgba(255, 255, 255)'), 1);
|
111
|
-
assert.strictEqual(getLuminance('rgb(255, 255, 255)'), 1);
|
112
|
-
});
|
113
|
-
it('returns a valid luminance for rgb mid-grey', function () {
|
114
|
-
assert.strictEqual(getLuminance('rgba(127, 127, 127)'), 0.212);
|
115
|
-
assert.strictEqual(getLuminance('rgb(127, 127, 127)'), 0.212);
|
116
|
-
});
|
117
|
-
it('returns a valid luminance for an rgb color', function () {
|
118
|
-
assert.strictEqual(getLuminance('rgb(255, 127, 0)'), 0.364);
|
119
|
-
});
|
120
|
-
it('returns a valid luminance from an hsl color', function () {
|
121
|
-
assert.strictEqual(getLuminance('hsl(100, 100%, 50%)'), 0.5);
|
122
|
-
});
|
123
|
-
it('throw on invalid colors', function () {
|
124
|
-
assert.throw(function () {
|
125
|
-
getLuminance('black');
|
126
|
-
}, 'unsupported `black` color');
|
127
|
-
});
|
128
|
-
});
|
129
|
-
describe('emphasize', function () {
|
130
|
-
it('lightens a dark rgb color with the coefficient provided', function () {
|
131
|
-
assert.strictEqual(emphasize('rgb(1, 2, 3)', 0.4), lighten('rgb(1, 2, 3)', 0.4));
|
132
|
-
});
|
133
|
-
it('darkens a light rgb color with the coefficient provided', function () {
|
134
|
-
assert.strictEqual(emphasize('rgb(250, 240, 230)', 0.3), darken('rgb(250, 240, 230)', 0.3));
|
135
|
-
});
|
136
|
-
it('lightens a dark rgb color with the coefficient 0.15 by default', function () {
|
137
|
-
assert.strictEqual(emphasize('rgb(1, 2, 3)'), lighten('rgb(1, 2, 3)', 0.15));
|
138
|
-
});
|
139
|
-
it('darkens a light rgb color with the coefficient 0.15 by default', function () {
|
140
|
-
assert.strictEqual(emphasize('rgb(250, 240, 230)'), darken('rgb(250, 240, 230)', 0.15));
|
141
|
-
});
|
142
|
-
});
|
143
|
-
describe('fade', function () {
|
144
|
-
it('converts an rgb color to an rgba color with the value provided', function () {
|
145
|
-
assert.strictEqual(fade('rgb(1, 2, 3)', 0.4), 'rgba(1, 2, 3, 0.4)');
|
146
|
-
});
|
147
|
-
it('updates an rgba color with the alpha value provided', function () {
|
148
|
-
assert.strictEqual(fade('rgba(255, 0, 0, 0.2)', 0.5), 'rgba(255, 0, 0, 0.5)');
|
149
|
-
});
|
150
|
-
it('converts an hsl color to an hsla color with the value provided', function () {
|
151
|
-
assert.strictEqual(fade('hsl(0, 100%, 50%)', 0.1), 'hsla(0, 100%, 50%, 0.1)');
|
152
|
-
});
|
153
|
-
it('updates an hsla color with the alpha value provided', function () {
|
154
|
-
assert.strictEqual(fade('hsla(0, 100%, 50%, 0.2)', 0.5), 'hsla(0, 100%, 50%, 0.5)');
|
155
|
-
});
|
156
|
-
it('throw on invalid colors', function () {
|
157
|
-
assert.throw(function () {
|
158
|
-
fade('white', 0.4);
|
159
|
-
}, 'unsupported `white` color');
|
160
|
-
});
|
161
|
-
});
|
162
|
-
describe('darken', function () {
|
163
|
-
it("doesn't modify rgb black", function () {
|
164
|
-
assert.strictEqual(darken('rgb(0, 0, 0)', 0.1), 'rgb(0, 0, 0)');
|
165
|
-
});
|
166
|
-
it("doesn't overshoot if an above-range coefficient is supplied", function () {
|
167
|
-
assert.strictEqual(darken('rgb(0, 127, 255)', 1.5), 'rgb(0, 0, 0)');
|
168
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
169
|
-
});
|
170
|
-
it("doesn't overshoot if a below-range coefficient is supplied", function () {
|
171
|
-
assert.strictEqual(darken('rgb(0, 127, 255)', -0.1), 'rgb(0, 127, 255)');
|
172
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
173
|
-
});
|
174
|
-
it('darkens rgb white to black when coefficient is 1', function () {
|
175
|
-
assert.strictEqual(darken('rgb(255, 255, 255)', 1), 'rgb(0, 0, 0)');
|
176
|
-
});
|
177
|
-
it('retains the alpha value in an rgba color', function () {
|
178
|
-
assert.strictEqual(darken('rgb(0, 0, 0, 0.5)', 0.1), 'rgb(0, 0, 0, 0.5)');
|
179
|
-
});
|
180
|
-
it('darkens rgb white by 10% when coefficient is 0.1', function () {
|
181
|
-
assert.strictEqual(darken('rgb(255, 255, 255)', 0.1), 'rgb(229, 229, 229)');
|
182
|
-
});
|
183
|
-
it('darkens rgb red by 50% when coefficient is 0.5', function () {
|
184
|
-
assert.strictEqual(darken('rgb(255, 0, 0)', 0.5), 'rgb(127, 0, 0)');
|
185
|
-
});
|
186
|
-
it('darkens rgb grey by 50% when coefficient is 0.5', function () {
|
187
|
-
assert.strictEqual(darken('rgb(127, 127, 127)', 0.5), 'rgb(63, 63, 63)');
|
188
|
-
});
|
189
|
-
it("doesn't modify rgb colors when coefficient is 0", function () {
|
190
|
-
assert.strictEqual(darken('rgb(255, 255, 255)', 0), 'rgb(255, 255, 255)');
|
191
|
-
});
|
192
|
-
it('darkens hsl red by 50% when coefficient is 0.5', function () {
|
193
|
-
assert.strictEqual(darken('hsl(0, 100%, 50%)', 0.5), 'hsl(0, 100%, 25%)');
|
194
|
-
});
|
195
|
-
it("doesn't modify hsl colors when coefficient is 0", function () {
|
196
|
-
assert.strictEqual(darken('hsl(0, 100%, 50%)', 0), 'hsl(0, 100%, 50%)');
|
197
|
-
});
|
198
|
-
it("doesn't modify hsl colors when l is 0%", function () {
|
199
|
-
assert.strictEqual(darken('hsl(0, 50%, 0%)', 0.5), 'hsl(0, 50%, 0%)');
|
200
|
-
});
|
201
|
-
});
|
202
|
-
describe('lighten', function () {
|
203
|
-
it("doesn't modify rgb white", function () {
|
204
|
-
assert.strictEqual(lighten('rgb(255, 255, 255)', 0.1), 'rgb(255, 255, 255)');
|
205
|
-
});
|
206
|
-
it("doesn't overshoot if an above-range coefficient is supplied", function () {
|
207
|
-
assert.strictEqual(lighten('rgb(0, 127, 255)', 1.5), 'rgb(255, 255, 255)');
|
208
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
209
|
-
});
|
210
|
-
it("doesn't overshoot if a below-range coefficient is supplied", function () {
|
211
|
-
assert.strictEqual(lighten('rgb(0, 127, 255)', -0.1), 'rgb(0, 127, 255)');
|
212
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
213
|
-
});
|
214
|
-
it('lightens rgb black to white when coefficient is 1', function () {
|
215
|
-
assert.strictEqual(lighten('rgb(0, 0, 0)', 1), 'rgb(255, 255, 255)');
|
216
|
-
});
|
217
|
-
it('retains the alpha value in an rgba color', function () {
|
218
|
-
assert.strictEqual(lighten('rgb(255, 255, 255, 0.5)', 0.1), 'rgb(255, 255, 255, 0.5)');
|
219
|
-
});
|
220
|
-
it('lightens rgb black by 10% when coefficient is 0.1', function () {
|
221
|
-
assert.strictEqual(lighten('rgb(0, 0, 0)', 0.1), 'rgb(25, 25, 25)');
|
222
|
-
});
|
223
|
-
it('lightens rgb red by 50% when coefficient is 0.5', function () {
|
224
|
-
assert.strictEqual(lighten('rgb(255, 0, 0)', 0.5), 'rgb(255, 127, 127)');
|
225
|
-
});
|
226
|
-
it('lightens rgb grey by 50% when coefficient is 0.5', function () {
|
227
|
-
assert.strictEqual(lighten('rgb(127, 127, 127)', 0.5), 'rgb(191, 191, 191)');
|
228
|
-
});
|
229
|
-
it("doesn't modify rgb colors when coefficient is 0", function () {
|
230
|
-
assert.strictEqual(lighten('rgb(127, 127, 127)', 0), 'rgb(127, 127, 127)');
|
231
|
-
});
|
232
|
-
it('lightens hsl red by 50% when coefficient is 0.5', function () {
|
233
|
-
assert.strictEqual(lighten('hsl(0, 100%, 50%)', 0.5), 'hsl(0, 100%, 75%)');
|
234
|
-
});
|
235
|
-
it("doesn't modify hsl colors when coefficient is 0", function () {
|
236
|
-
assert.strictEqual(lighten('hsl(0, 100%, 50%)', 0), 'hsl(0, 100%, 50%)');
|
237
|
-
});
|
238
|
-
it("doesn't modify hsl colors when `l` is 100%", function () {
|
239
|
-
assert.strictEqual(lighten('hsl(0, 50%, 100%)', 0.5), 'hsl(0, 50%, 100%)');
|
240
|
-
});
|
241
|
-
});
|
242
|
-
});
|