@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,48 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import createBreakpoints from './createBreakpoints';
|
3
|
-
describe('createBreakpoints', function () {
|
4
|
-
var breakpoints = createBreakpoints({});
|
5
|
-
describe('up', function () {
|
6
|
-
it('should work for xs', function () {
|
7
|
-
assert.strictEqual(breakpoints.up('xs'), '@media (min-width:0px)');
|
8
|
-
});
|
9
|
-
it('should work for md', function () {
|
10
|
-
assert.strictEqual(breakpoints.up('md'), '@media (min-width:960px)');
|
11
|
-
});
|
12
|
-
});
|
13
|
-
describe('down', function () {
|
14
|
-
it('should work', function () {
|
15
|
-
assert.strictEqual(breakpoints.down('sm'), '@media (max-width:959.95px)');
|
16
|
-
});
|
17
|
-
it('should work for md', function () {
|
18
|
-
assert.strictEqual(breakpoints.down('md'), '@media (max-width:1279.95px)');
|
19
|
-
});
|
20
|
-
it('should use the specified key if it is not a recognized breakpoint', function () {
|
21
|
-
assert.strictEqual(breakpoints.down(600), '@media (max-width:599.95px)');
|
22
|
-
});
|
23
|
-
it('should apply to all sizes for xl', function () {
|
24
|
-
assert.strictEqual(breakpoints.down('xl'), '@media (min-width:0px)');
|
25
|
-
});
|
26
|
-
});
|
27
|
-
describe('between', function () {
|
28
|
-
it('should work', function () {
|
29
|
-
assert.strictEqual(breakpoints.between('sm', 'md'), '@media (min-width:600px) and (max-width:1279.95px)');
|
30
|
-
});
|
31
|
-
it('on xl should call up', function () {
|
32
|
-
assert.strictEqual(breakpoints.between('lg', 'xl'), '@media (min-width:1280px)');
|
33
|
-
});
|
34
|
-
});
|
35
|
-
describe('only', function () {
|
36
|
-
it('should work', function () {
|
37
|
-
assert.strictEqual(breakpoints.only('md'), '@media (min-width:960px) and (max-width:1279.95px)');
|
38
|
-
});
|
39
|
-
it('on xl should call up', function () {
|
40
|
-
assert.strictEqual(breakpoints.only('xl'), '@media (min-width:1920px)');
|
41
|
-
});
|
42
|
-
});
|
43
|
-
describe('width', function () {
|
44
|
-
it('should work', function () {
|
45
|
-
assert.strictEqual(breakpoints.width('md'), 960);
|
46
|
-
});
|
47
|
-
});
|
48
|
-
});
|
@@ -1,141 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import consoleErrorMock from 'test/utils/consoleErrorMock';
|
3
|
-
import createGenerateClassName from './createGenerateClassName';
|
4
|
-
describe('createGenerateClassName', function () {
|
5
|
-
describe('counter', function () {
|
6
|
-
it('should increment a scoped counter', function () {
|
7
|
-
var rule = {
|
8
|
-
key: 'root'
|
9
|
-
};
|
10
|
-
var generateClassName1 = createGenerateClassName();
|
11
|
-
assert.strictEqual(generateClassName1(rule), 'root-1');
|
12
|
-
assert.strictEqual(generateClassName1(rule), 'root-2');
|
13
|
-
var generateClassName2 = createGenerateClassName();
|
14
|
-
assert.strictEqual(generateClassName2(rule), 'root-1');
|
15
|
-
});
|
16
|
-
});
|
17
|
-
it('should escape parenthesis', function () {
|
18
|
-
var generateClassName = createGenerateClassName();
|
19
|
-
assert.strictEqual(generateClassName({
|
20
|
-
key: 'root'
|
21
|
-
}, {
|
22
|
-
options: {
|
23
|
-
classNamePrefix: 'pure(MuiButton)',
|
24
|
-
jss: {}
|
25
|
-
}
|
26
|
-
}), 'pure-MuiButton--root-1');
|
27
|
-
});
|
28
|
-
it('should escape spaces', function () {
|
29
|
-
var generateClassName = createGenerateClassName();
|
30
|
-
assert.strictEqual(generateClassName({
|
31
|
-
key: 'root'
|
32
|
-
}, {
|
33
|
-
options: {
|
34
|
-
classNamePrefix: 'foo bar',
|
35
|
-
jss: {}
|
36
|
-
}
|
37
|
-
}), 'foo-bar-root-1');
|
38
|
-
});
|
39
|
-
describe('options: dangerouslyUseGlobalCSS', function () {
|
40
|
-
it('should use a global class name', function () {
|
41
|
-
var generateClassName = createGenerateClassName({
|
42
|
-
dangerouslyUseGlobalCSS: true
|
43
|
-
});
|
44
|
-
assert.strictEqual(generateClassName({
|
45
|
-
key: 'root'
|
46
|
-
}, {
|
47
|
-
options: {
|
48
|
-
name: 'Button',
|
49
|
-
classNamePrefix: 'Button2',
|
50
|
-
jss: {}
|
51
|
-
}
|
52
|
-
}), 'Button-root');
|
53
|
-
assert.strictEqual(generateClassName({
|
54
|
-
key: 'root'
|
55
|
-
}, {
|
56
|
-
options: {
|
57
|
-
classNamePrefix: 'Button',
|
58
|
-
jss: {}
|
59
|
-
}
|
60
|
-
}), 'Button-root-2');
|
61
|
-
});
|
62
|
-
it('should default to a non deterministic name', function () {
|
63
|
-
var generateClassName = createGenerateClassName({
|
64
|
-
dangerouslyUseGlobalCSS: true
|
65
|
-
});
|
66
|
-
assert.strictEqual(generateClassName({
|
67
|
-
key: 'root'
|
68
|
-
}), 'root-1');
|
69
|
-
});
|
70
|
-
});
|
71
|
-
describe('formatting', function () {
|
72
|
-
it('should take the sheet meta in development if available', function () {
|
73
|
-
var rule = {
|
74
|
-
key: 'root'
|
75
|
-
};
|
76
|
-
var styleSheet = {
|
77
|
-
options: {
|
78
|
-
classNamePrefix: 'Button'
|
79
|
-
}
|
80
|
-
};
|
81
|
-
var generateClassName = createGenerateClassName();
|
82
|
-
assert.strictEqual(generateClassName(rule, styleSheet), 'Button-root-1');
|
83
|
-
});
|
84
|
-
it('should use a base 10 representation', function () {
|
85
|
-
var rule = {
|
86
|
-
key: 'root'
|
87
|
-
};
|
88
|
-
var generateClassName = createGenerateClassName();
|
89
|
-
assert.strictEqual(generateClassName(rule), 'root-1');
|
90
|
-
assert.strictEqual(generateClassName(rule), 'root-2');
|
91
|
-
assert.strictEqual(generateClassName(rule), 'root-3');
|
92
|
-
assert.strictEqual(generateClassName(rule), 'root-4');
|
93
|
-
assert.strictEqual(generateClassName(rule), 'root-5');
|
94
|
-
assert.strictEqual(generateClassName(rule), 'root-6');
|
95
|
-
assert.strictEqual(generateClassName(rule), 'root-7');
|
96
|
-
assert.strictEqual(generateClassName(rule), 'root-8');
|
97
|
-
assert.strictEqual(generateClassName(rule), 'root-9');
|
98
|
-
assert.strictEqual(generateClassName(rule), 'root-10');
|
99
|
-
});
|
100
|
-
describe('production', function () {
|
101
|
-
// Only run the test on node.
|
102
|
-
if (!/jsdom/.test(window.navigator.userAgent)) {
|
103
|
-
return;
|
104
|
-
}
|
105
|
-
|
106
|
-
var nodeEnv;
|
107
|
-
var env = process.env;
|
108
|
-
before(function () {
|
109
|
-
nodeEnv = env.NODE_ENV;
|
110
|
-
env.NODE_ENV = 'production';
|
111
|
-
consoleErrorMock.spy();
|
112
|
-
});
|
113
|
-
after(function () {
|
114
|
-
env.NODE_ENV = nodeEnv;
|
115
|
-
consoleErrorMock.reset();
|
116
|
-
});
|
117
|
-
it('should output a short representation', function () {
|
118
|
-
var rule = {
|
119
|
-
key: 'root'
|
120
|
-
};
|
121
|
-
var generateClassName = createGenerateClassName();
|
122
|
-
assert.strictEqual(generateClassName(rule), 'jss1');
|
123
|
-
});
|
124
|
-
it('should work with global CSS', function () {
|
125
|
-
var rule = {
|
126
|
-
key: 'root'
|
127
|
-
};
|
128
|
-
var generateClassName = createGenerateClassName({
|
129
|
-
dangerouslyUseGlobalCSS: true
|
130
|
-
});
|
131
|
-
assert.strictEqual(generateClassName(rule), 'jss1');
|
132
|
-
});
|
133
|
-
it('should warn', function () {
|
134
|
-
createGenerateClassName();
|
135
|
-
createGenerateClassName();
|
136
|
-
assert.strictEqual(consoleErrorMock.callCount() > 0, true);
|
137
|
-
assert.match(consoleErrorMock.args()[0][0], /Material-UI: we have detected more than needed creation of the/);
|
138
|
-
});
|
139
|
-
});
|
140
|
-
});
|
141
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import createMixins from './createMixins';
|
4
|
-
import createMuiTheme from './createMuiTheme';
|
5
|
-
describe('createMixins', function () {
|
6
|
-
it('should be able to override the breakpoint', function () {
|
7
|
-
var theme = createMuiTheme();
|
8
|
-
var mixins = createMixins(theme.breakpoints, theme.spacing, {});
|
9
|
-
var mixin = mixins.gutters(_defineProperty({
|
10
|
-
display: 'flex'
|
11
|
-
}, theme.breakpoints.up('sm'), {
|
12
|
-
paddingLeft: 1
|
13
|
-
}));
|
14
|
-
assert.deepEqual(mixin, {
|
15
|
-
'@media (min-width:600px)': {
|
16
|
-
paddingLeft: 1,
|
17
|
-
paddingRight: 24
|
18
|
-
},
|
19
|
-
display: 'flex',
|
20
|
-
paddingLeft: 16,
|
21
|
-
paddingRight: 16
|
22
|
-
});
|
23
|
-
});
|
24
|
-
});
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import createMuiTheme from './createMuiTheme';
|
3
|
-
import { deepOrange, green } from '@material-ui/core/colors';
|
4
|
-
describe('createMuiTheme', function () {
|
5
|
-
it('should have a palette', function () {
|
6
|
-
var muiTheme = createMuiTheme();
|
7
|
-
assert.strictEqual(typeof createMuiTheme, 'function', 'should be a function');
|
8
|
-
assert.ok(muiTheme.palette, 'should have a palette');
|
9
|
-
});
|
10
|
-
it('should have the custom palette', function () {
|
11
|
-
var muiTheme = createMuiTheme({
|
12
|
-
palette: {
|
13
|
-
primary: {
|
14
|
-
main: deepOrange[500]
|
15
|
-
},
|
16
|
-
secondary: {
|
17
|
-
main: green.A400
|
18
|
-
}
|
19
|
-
}
|
20
|
-
});
|
21
|
-
assert.strictEqual(muiTheme.palette.primary.main, deepOrange[500], 'should have a palette');
|
22
|
-
assert.strictEqual(muiTheme.palette.secondary.main, green.A400, 'should have a palette');
|
23
|
-
});
|
24
|
-
it('should allow providing a partial structure', function () {
|
25
|
-
var muiTheme = createMuiTheme({
|
26
|
-
transitions: {
|
27
|
-
duration: {
|
28
|
-
shortest: 150
|
29
|
-
}
|
30
|
-
}
|
31
|
-
});
|
32
|
-
assert.notStrictEqual(muiTheme.transitions.duration.shorter, undefined);
|
33
|
-
});
|
34
|
-
describe('shadows', function () {
|
35
|
-
it('should provide the default array', function () {
|
36
|
-
var muiTheme = createMuiTheme();
|
37
|
-
assert.strictEqual(muiTheme.shadows[2], '0px 1px 5px 0px rgba(0, 0, 0, 0.2),' + '0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 3px 1px -2px rgba(0, 0, 0, 0.12)');
|
38
|
-
});
|
39
|
-
it('should override the array as expected', function () {
|
40
|
-
var shadows = ['none', 1, 1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11];
|
41
|
-
var muiTheme = createMuiTheme({
|
42
|
-
shadows: shadows
|
43
|
-
});
|
44
|
-
assert.strictEqual(muiTheme.shadows, shadows);
|
45
|
-
});
|
46
|
-
});
|
47
|
-
describe('props', function () {
|
48
|
-
it('should have the props as expected', function () {
|
49
|
-
var props = {
|
50
|
-
MuiDialog: {
|
51
|
-
fullScreen: true,
|
52
|
-
fullWidth: false
|
53
|
-
},
|
54
|
-
MuiButtonBase: {
|
55
|
-
disableRipple: true
|
56
|
-
},
|
57
|
-
MuiPopover: {
|
58
|
-
container: document.createElement('div')
|
59
|
-
}
|
60
|
-
};
|
61
|
-
var muiTheme = createMuiTheme({
|
62
|
-
props: props
|
63
|
-
});
|
64
|
-
assert.deepEqual(muiTheme.props, props);
|
65
|
-
});
|
66
|
-
});
|
67
|
-
});
|
@@ -1,159 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import consoleErrorMock from 'test/utils/consoleErrorMock';
|
3
|
-
import { pink, deepOrange, green, red } from '@material-ui/core/colors';
|
4
|
-
import { lighten, darken } from './colorManipulator';
|
5
|
-
import createPalette, { dark, light } from './createPalette';
|
6
|
-
describe('createPalette()', function () {
|
7
|
-
before(function () {
|
8
|
-
consoleErrorMock.spy();
|
9
|
-
});
|
10
|
-
after(function () {
|
11
|
-
consoleErrorMock.reset();
|
12
|
-
});
|
13
|
-
it('should create a material design palette according to spec', function () {
|
14
|
-
var palette = createPalette({});
|
15
|
-
assert.strictEqual(palette.primary.main, '#00ade9', 'should use blue hipay as the default primary main color');
|
16
|
-
assert.strictEqual(palette.primary.light, '#5bc8ef', 'should use light blue hipay as the default primary light color');
|
17
|
-
assert.strictEqual(palette.primary.dark, '#007ca9', 'should use dark blue hipay as the default primary dark color');
|
18
|
-
assert.strictEqual(palette.primary.contrastText, '#FFFFFF', 'should use white as the default primary contrastText color');
|
19
|
-
assert.strictEqual(palette.secondary.main, '#ffcf21', 'should use yellow hipay as the default secondary main color');
|
20
|
-
assert.strictEqual(palette.secondary.light, '#ffd94f', 'should use light yellow hipay as the default secondary light color');
|
21
|
-
assert.strictEqual(palette.secondary.dark, '#E9BE30', 'should use dark yellow hipay as the default secondary dark color');
|
22
|
-
assert.strictEqual(palette.secondary.contrastText, '#FFFFFF', 'should use white as the default secondary contrastText color');
|
23
|
-
assert.strictEqual(palette.error.main, red[500], 'should use red[500] as the default error main color');
|
24
|
-
assert.strictEqual(palette.error.light, red[300], 'should use red[300] as the default error light color');
|
25
|
-
assert.strictEqual(palette.error.dark, red[700], 'should use red[700] as the default error dark color');
|
26
|
-
assert.strictEqual(palette.text, light.text, 'should use light theme text for a light theme by default');
|
27
|
-
});
|
28
|
-
it('should create a palette with Material colors', function () {
|
29
|
-
var palette = createPalette({
|
30
|
-
primary: deepOrange,
|
31
|
-
secondary: green,
|
32
|
-
error: pink
|
33
|
-
});
|
34
|
-
assert.strictEqual(palette.primary.main, deepOrange[500], 'should use deepOrange[500] as the primary main color');
|
35
|
-
assert.strictEqual(palette.primary.light, deepOrange[300], 'should use deepOrange[300] as the primary light color');
|
36
|
-
assert.strictEqual(palette.primary.dark, deepOrange[700], 'should use deepOrange[700] as the primary dark color');
|
37
|
-
assert.strictEqual(palette.secondary.main, green.A400, 'should use green.A400 as the secondary main color');
|
38
|
-
assert.strictEqual(palette.secondary.light, green.A200, 'should use green.A200 as the secondary light color');
|
39
|
-
assert.strictEqual(palette.secondary.dark, green.A700, 'should use green.A700 as the secondary dark color');
|
40
|
-
assert.strictEqual(palette.error.main, pink[500], 'should use pink[500] as the error main color');
|
41
|
-
assert.strictEqual(palette.error.light, pink[300], 'should use pink[300] as the error light color');
|
42
|
-
assert.strictEqual(palette.error.dark, pink[700], 'should use pink[700] as the error dark color');
|
43
|
-
assert.strictEqual(palette.text, light.text, 'should use light theme text');
|
44
|
-
});
|
45
|
-
it('should create a palette with custom colors', function () {
|
46
|
-
var palette = createPalette({
|
47
|
-
primary: {
|
48
|
-
main: deepOrange[500],
|
49
|
-
light: deepOrange[300],
|
50
|
-
dark: deepOrange[700],
|
51
|
-
contrastText: '#ffffff'
|
52
|
-
},
|
53
|
-
secondary: {
|
54
|
-
main: green.A400,
|
55
|
-
light: green.A200,
|
56
|
-
dark: green.A700,
|
57
|
-
contrastText: '#000000'
|
58
|
-
},
|
59
|
-
error: {
|
60
|
-
main: pink[500],
|
61
|
-
light: pink[300],
|
62
|
-
dark: pink[700],
|
63
|
-
contrastText: '#00ff00'
|
64
|
-
}
|
65
|
-
});
|
66
|
-
assert.strictEqual(palette.primary.main, deepOrange[500], 'should use deepOrange[500] as the primary main color');
|
67
|
-
assert.strictEqual(palette.primary.light, deepOrange[300], 'should use deepOrange[300] as the primary light color');
|
68
|
-
assert.strictEqual(palette.primary.dark, deepOrange[700], 'should use deepOrange[700] as the primary dark color');
|
69
|
-
assert.strictEqual(palette.primary.contrastText, '#ffffff', 'should use #ffffff as the secondary contrastText color');
|
70
|
-
assert.strictEqual(palette.secondary.main, green.A400, 'should use green.A400 as the secondary main color');
|
71
|
-
assert.strictEqual(palette.secondary.light, green.A200, 'should use green.A200 as the secondary light color');
|
72
|
-
assert.strictEqual(palette.secondary.dark, green.A700, 'should use green.A700 as the secondary dark color');
|
73
|
-
assert.strictEqual(palette.secondary.contrastText, '#000000', 'should use #000000 as the secondary contrastText color');
|
74
|
-
assert.strictEqual(palette.error.main, pink[500], 'should use pink[500] as the error main color');
|
75
|
-
assert.strictEqual(palette.error.light, pink[300], 'should use pink[300] as the error light color');
|
76
|
-
assert.strictEqual(palette.error.dark, pink[700], 'should use pink[700] as the error dark color');
|
77
|
-
assert.strictEqual(palette.error.contrastText, '#00ff00', 'should use #00ff00 as the error contrastText color');
|
78
|
-
assert.strictEqual(palette.text, light.text, 'should use light theme text');
|
79
|
-
});
|
80
|
-
it('should calculate light and dark colors if not provided', function () {
|
81
|
-
var palette = createPalette({
|
82
|
-
primary: {
|
83
|
-
main: deepOrange[500]
|
84
|
-
},
|
85
|
-
secondary: {
|
86
|
-
main: green.A400
|
87
|
-
},
|
88
|
-
error: {
|
89
|
-
main: pink[500]
|
90
|
-
}
|
91
|
-
});
|
92
|
-
assert.strictEqual(palette.primary.main, deepOrange[500], 'should use deepOrange[500] as the primary main color');
|
93
|
-
assert.strictEqual(palette.primary.light, lighten(deepOrange[500], 0.2), 'should use lighten(deepOrange[500], 0.2) as the primary light color');
|
94
|
-
assert.strictEqual(palette.primary.dark, darken(deepOrange[500], 0.3), 'should use darken(deepOrange[500], 0.3) as the primary dark color');
|
95
|
-
assert.strictEqual(palette.secondary.main, green.A400, 'should use green.A400 as the secondary main color');
|
96
|
-
assert.strictEqual(palette.secondary.light, lighten(green.A400, 0.2), 'should use lighten(green.A400, 0.2) as the secondary light color');
|
97
|
-
assert.strictEqual(palette.secondary.dark, darken(green.A400, 0.3), 'should use darken(green.A400, 0.3) as the secondary dark color');
|
98
|
-
assert.strictEqual(palette.error.main, pink[500], 'should use pink[500] as the error main color');
|
99
|
-
assert.strictEqual(palette.error.light, lighten(pink[500], 0.2), 'should use lighten(pink[500], 0.2) as the error light color');
|
100
|
-
assert.strictEqual(palette.error.dark, darken(pink[500], 0.3), 'should use darken(pink[500], 0.3) as the error dark color');
|
101
|
-
});
|
102
|
-
it('should calculate light and dark colors using the provided tonalOffset', function () {
|
103
|
-
var palette = createPalette({
|
104
|
-
primary: {
|
105
|
-
main: deepOrange[500]
|
106
|
-
},
|
107
|
-
secondary: {
|
108
|
-
main: green.A400
|
109
|
-
},
|
110
|
-
error: {
|
111
|
-
main: red[500]
|
112
|
-
},
|
113
|
-
tonalOffset: 0.1
|
114
|
-
}); // primary
|
115
|
-
|
116
|
-
assert.strictEqual(palette.primary.main, deepOrange[500], 'should use deepOrange[500] as the primary main color');
|
117
|
-
assert.strictEqual(palette.primary.light, lighten(deepOrange[500], 0.1), 'should use lighten(deepOrange[500], 0.1) as the primary light color');
|
118
|
-
assert.strictEqual(palette.primary.dark, darken(deepOrange[500], 0.15), 'should use darken(deepOrange[500], 0.1) as the primary dark color'); // secondary
|
119
|
-
|
120
|
-
assert.strictEqual(palette.secondary.main, green.A400, 'should use green.A400 as the secondary main color');
|
121
|
-
assert.strictEqual(palette.secondary.light, lighten(green.A400, 0.1), 'should use lighten(green.A400, 0.1) as the secondary light color');
|
122
|
-
assert.strictEqual(palette.secondary.dark, darken(green.A400, 0.15), 'should use darken(green.A400, 0.1) as the secondary dark color'); // error
|
123
|
-
|
124
|
-
assert.strictEqual(palette.error.main, red[500], 'should use red[500] as the error main color');
|
125
|
-
assert.strictEqual(palette.error.light, lighten(red[500], 0.1), 'should use lighten(red[500], 0.1) as the error light color');
|
126
|
-
assert.strictEqual(palette.error.dark, darken(red[500], 0.15), 'should use darken(red[500], 0.1) as the error dark color');
|
127
|
-
});
|
128
|
-
it('should calculate contrastText using the provided contrastThreshold', function () {
|
129
|
-
var palette = createPalette({
|
130
|
-
contrastThreshold: 7
|
131
|
-
});
|
132
|
-
assert.strictEqual(palette.primary.contrastText, '#FFFFFF', 'should use white as the default primary contrastText color');
|
133
|
-
assert.strictEqual(palette.secondary.contrastText, '#FFFFFF', 'should use white as the default secondary contrastText color');
|
134
|
-
});
|
135
|
-
it('should create a dark palette', function () {
|
136
|
-
var palette = createPalette({
|
137
|
-
type: 'dark'
|
138
|
-
});
|
139
|
-
assert.strictEqual(palette.primary.main, '#00ade9', 'should use indigo as the default primary color');
|
140
|
-
assert.strictEqual(palette.secondary.main, '#ffcf21', 'should use pink as the default secondary color');
|
141
|
-
assert.strictEqual(palette.text, dark.text, 'should use dark theme text');
|
142
|
-
assert.strictEqual(consoleErrorMock.callCount(), 0);
|
143
|
-
});
|
144
|
-
it('should throw an exception when an invalid type is specified', function () {
|
145
|
-
createPalette({
|
146
|
-
type: 'foo'
|
147
|
-
});
|
148
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
149
|
-
assert.match(consoleErrorMock.args()[0][0], /Material-UI: the palette type `foo` is not supported/);
|
150
|
-
});
|
151
|
-
describe('augmentColor', function () {
|
152
|
-
it('should throw when the input is invalid', function () {
|
153
|
-
var palette = createPalette({});
|
154
|
-
assert.throws(function () {
|
155
|
-
palette.augmentColor({});
|
156
|
-
}, /The color object needs to have a/);
|
157
|
-
});
|
158
|
-
});
|
159
|
-
});
|
@@ -1,60 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import createPalette from './createPalette';
|
3
|
-
import createTypography from './createTypography';
|
4
|
-
describe('createTypography', function () {
|
5
|
-
var palette;
|
6
|
-
before(function () {
|
7
|
-
palette = createPalette({});
|
8
|
-
});
|
9
|
-
it('should create a material design typography according to spec', function () {
|
10
|
-
var typography = createTypography(palette, {});
|
11
|
-
assert.strictEqual(typography.fontSize, 14);
|
12
|
-
});
|
13
|
-
it('should create a typography with custom fontSize', function () {
|
14
|
-
var typography = createTypography(palette, {
|
15
|
-
fontSize: 15
|
16
|
-
});
|
17
|
-
assert.strictEqual(typography.fontSize, 15);
|
18
|
-
});
|
19
|
-
it('should accept a function', function () {
|
20
|
-
var typography = createTypography(palette, function (paletteCurrent) {
|
21
|
-
assert.strictEqual(palette, paletteCurrent);
|
22
|
-
return {
|
23
|
-
fontSize: 15
|
24
|
-
};
|
25
|
-
});
|
26
|
-
assert.strictEqual(typography.fontSize, 15);
|
27
|
-
});
|
28
|
-
it('should accept a custom font size', function () {
|
29
|
-
var typography = createTypography(palette, {
|
30
|
-
fontSize: 16
|
31
|
-
});
|
32
|
-
assert.strictEqual(typography.body1.fontSize, '1rem', 'should be 16px');
|
33
|
-
});
|
34
|
-
it('should create a typography with a custom baseFontSize', function () {
|
35
|
-
var typography = createTypography(palette, {
|
36
|
-
htmlFontSize: 10
|
37
|
-
});
|
38
|
-
assert.strictEqual(typography.display4.fontSize, '11.2rem');
|
39
|
-
});
|
40
|
-
it('should create a typography with custom display4', function () {
|
41
|
-
var customFontSize = '18px';
|
42
|
-
var typography = createTypography(palette, {
|
43
|
-
display4: {
|
44
|
-
fontSize: customFontSize
|
45
|
-
}
|
46
|
-
});
|
47
|
-
assert.strictEqual(typography.display4.fontSize, customFontSize);
|
48
|
-
});
|
49
|
-
it('should apply a CSS property to all the variants', function () {
|
50
|
-
var typography = createTypography(palette, {
|
51
|
-
allVariants: {
|
52
|
-
marginLeft: 0
|
53
|
-
}
|
54
|
-
});
|
55
|
-
var allVariants = ['display4', 'display3', 'display2', 'display1', 'headline', 'title', 'subheading', 'body2', 'body1', 'caption', 'button'];
|
56
|
-
allVariants.forEach(function (variant) {
|
57
|
-
assert.strictEqual(typography[variant].marginLeft, 0);
|
58
|
-
});
|
59
|
-
});
|
60
|
-
});
|
@@ -1,92 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import consoleErrorMock from 'test/utils/consoleErrorMock';
|
4
|
-
import getStylesCreator from './getStylesCreator';
|
5
|
-
describe('getStylesCreator', function () {
|
6
|
-
var name = 'name';
|
7
|
-
var stylesCreator = getStylesCreator({
|
8
|
-
root: {
|
9
|
-
color: 'black',
|
10
|
-
'&:hover': {
|
11
|
-
color: 'red',
|
12
|
-
borderRadius: 0
|
13
|
-
}
|
14
|
-
}
|
15
|
-
});
|
16
|
-
it('should be able to get the styles', function () {
|
17
|
-
var styles = stylesCreator.create({});
|
18
|
-
assert.deepEqual(styles, {
|
19
|
-
root: {
|
20
|
-
color: 'black',
|
21
|
-
'&:hover': {
|
22
|
-
color: 'red',
|
23
|
-
borderRadius: 0
|
24
|
-
}
|
25
|
-
}
|
26
|
-
});
|
27
|
-
});
|
28
|
-
describe('overrides', function () {
|
29
|
-
before(function () {
|
30
|
-
consoleErrorMock.spy();
|
31
|
-
});
|
32
|
-
after(function () {
|
33
|
-
consoleErrorMock.reset();
|
34
|
-
});
|
35
|
-
it('should be able to overrides some rules, deep', function () {
|
36
|
-
var theme = {
|
37
|
-
overrides: _defineProperty({}, name, {
|
38
|
-
root: {
|
39
|
-
color: 'white',
|
40
|
-
'&:hover': {
|
41
|
-
borderRadius: 2,
|
42
|
-
backgroundColor: 'black'
|
43
|
-
}
|
44
|
-
}
|
45
|
-
})
|
46
|
-
};
|
47
|
-
var styles = stylesCreator.create(theme, name);
|
48
|
-
assert.deepEqual(styles, {
|
49
|
-
root: {
|
50
|
-
color: 'white',
|
51
|
-
'&:hover': {
|
52
|
-
color: 'red',
|
53
|
-
borderRadius: 2,
|
54
|
-
backgroundColor: 'black'
|
55
|
-
}
|
56
|
-
}
|
57
|
-
});
|
58
|
-
});
|
59
|
-
it('should warn on wrong usage', function () {
|
60
|
-
var theme = {
|
61
|
-
overrides: _defineProperty({}, name, {
|
62
|
-
bubu: {
|
63
|
-
color: 'white'
|
64
|
-
}
|
65
|
-
})
|
66
|
-
};
|
67
|
-
stylesCreator.create(theme, name);
|
68
|
-
assert.strictEqual(consoleErrorMock.callCount(), 1);
|
69
|
-
assert.match(consoleErrorMock.args()[0][0], /Fix the `bubu` key of `theme\.overrides\.name`/);
|
70
|
-
});
|
71
|
-
it('should support jss-expand', function () {
|
72
|
-
var stylesCreator2 = getStylesCreator({
|
73
|
-
root: {
|
74
|
-
padding: [8, 16]
|
75
|
-
}
|
76
|
-
});
|
77
|
-
var theme = {
|
78
|
-
overrides: _defineProperty({}, name, {
|
79
|
-
root: {
|
80
|
-
padding: [20, 10]
|
81
|
-
}
|
82
|
-
})
|
83
|
-
};
|
84
|
-
var styles = stylesCreator2.create(theme, name);
|
85
|
-
assert.deepEqual(styles, {
|
86
|
-
root: {
|
87
|
-
padding: [20, 10]
|
88
|
-
}
|
89
|
-
});
|
90
|
-
});
|
91
|
-
});
|
92
|
-
});
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import { assert } from 'chai';
|
2
|
-
import getThemeProps from './getThemeProps';
|
3
|
-
describe('getThemeProps', function () {
|
4
|
-
it('should ignore empty theme', function () {
|
5
|
-
var props = getThemeProps({
|
6
|
-
theme: {},
|
7
|
-
name: 'MuiFoo'
|
8
|
-
});
|
9
|
-
assert.deepEqual(props, {});
|
10
|
-
});
|
11
|
-
it('should ignore different component', function () {
|
12
|
-
var props = getThemeProps({
|
13
|
-
theme: {
|
14
|
-
props: {
|
15
|
-
MuiBar: {
|
16
|
-
disableRipple: true
|
17
|
-
}
|
18
|
-
}
|
19
|
-
},
|
20
|
-
name: 'MuiFoo'
|
21
|
-
});
|
22
|
-
assert.deepEqual(props, {});
|
23
|
-
});
|
24
|
-
it('should return the properties', function () {
|
25
|
-
var props = getThemeProps({
|
26
|
-
theme: {
|
27
|
-
props: {
|
28
|
-
MuiFoo: {
|
29
|
-
disableRipple: true
|
30
|
-
}
|
31
|
-
}
|
32
|
-
},
|
33
|
-
name: 'MuiFoo'
|
34
|
-
});
|
35
|
-
assert.deepEqual(props, {
|
36
|
-
disableRipple: true
|
37
|
-
});
|
38
|
-
});
|
39
|
-
});
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import createBroadcast from 'brcast';
|
4
|
-
import themeListener, { CHANNEL } from './themeListener';
|
5
|
-
describe('themeListener', function () {
|
6
|
-
it('should be able to get the initial state', function () {
|
7
|
-
var broadcast = createBroadcast();
|
8
|
-
var initialState = {};
|
9
|
-
broadcast.setState(initialState);
|
10
|
-
assert.strictEqual(themeListener.initial(_defineProperty({}, CHANNEL, broadcast)), initialState);
|
11
|
-
});
|
12
|
-
it('should not complain if the context is not defined', function () {
|
13
|
-
assert.strictEqual(themeListener.initial({}), null);
|
14
|
-
});
|
15
|
-
it('should be able to subscribe to the event stream', function (done) {
|
16
|
-
var broadcast = createBroadcast();
|
17
|
-
var initialState = {};
|
18
|
-
var secondState = {};
|
19
|
-
broadcast.setState(initialState);
|
20
|
-
themeListener.subscribe(_defineProperty({}, CHANNEL, broadcast), function (state) {
|
21
|
-
assert.strictEqual(state, secondState);
|
22
|
-
done();
|
23
|
-
});
|
24
|
-
broadcast.setState(secondState);
|
25
|
-
});
|
26
|
-
});
|