@hipay/hipay-material-ui 2.3.1-rc3 → 2.3.1-rc4
Sign up to get free protection for your applications and to get access to all the features.
- package/App.test.js +8 -0
- package/HiAlertModal/HiAlertModal.js +48 -77
- package/HiAlertModal/HiAlertModal.test.js +189 -0
- package/HiAlertModal/index.js +1 -15
- package/HiAppBar/HiAppBar.js +34 -63
- package/HiAppBar/index.js +1 -15
- package/HiBadge/HiBadge.js +10 -29
- package/HiBadge/HiBadge.test.js +49 -0
- package/HiBadge/index.js +1 -15
- package/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/HiBreadcrumb/HiStep.js +35 -57
- package/HiBreadcrumb/HiStep.test.js +47 -0
- package/HiBreadcrumb/HiStepConnector.js +32 -57
- package/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/HiBreadcrumb/HiStepContent.js +25 -46
- package/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/HiBreadcrumb/HiStepIcon.js +26 -46
- package/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/HiBreadcrumb/HiStepLabel.js +36 -61
- package/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/HiBreadcrumb/HiStepper.js +23 -45
- package/HiBreadcrumb/HiStepper.test.js +33 -0
- package/HiBreadcrumb/index.js +1 -15
- package/HiButton/HiButton.js +9 -27
- package/HiButton/index.js +2 -13
- package/HiCell/CellAddress.js +20 -40
- package/HiCell/CellAddress.test.js +75 -0
- package/HiCell/CellDate.js +26 -47
- package/HiCell/CellDate.test.js +173 -0
- package/HiCell/CellIcon.js +28 -49
- package/HiCell/CellIcon.test.js +57 -0
- package/HiCell/CellImage.js +23 -42
- package/HiCell/CellImage.test.js +49 -0
- package/HiCell/CellNumeric.js +25 -46
- package/HiCell/CellNumeric.test.js +46 -0
- package/HiCell/CellPinToAction.js +20 -41
- package/HiCell/CellRate.js +32 -55
- package/HiCell/CellRate.test.js +73 -0
- package/HiCell/CellSentinel.js +22 -42
- package/HiCell/CellSentinel.test.js +48 -0
- package/HiCell/CellSentinelScore.js +23 -44
- package/HiCell/CellText.js +37 -56
- package/HiCell/CellText.test.js +76 -0
- package/HiCell/CellTextStyled.js +8 -21
- package/HiCell/index.js +9 -79
- package/HiCheckbox/HiCheckbox.js +35 -60
- package/HiCheckbox/HiCheckbox.test.js +55 -0
- package/HiCheckbox/index.js +1 -15
- package/HiChip/HiChip.js +24 -44
- package/HiChip/HiChip.test.js +136 -0
- package/HiChip/HiChipSwitch.js +47 -70
- package/HiChip/HiChipSwitch.test.js +99 -0
- package/HiChip/index.js +2 -23
- package/HiColoredLabel/HiColoredLabel.js +28 -52
- package/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/HiColoredLabel/index.js +1 -15
- package/HiDatePicker/Caption.js +11 -28
- package/HiDatePicker/Caption.test.js +65 -0
- package/HiDatePicker/HiDatePicker.js +100 -115
- package/HiDatePicker/HiDatePicker.test.js +370 -0
- package/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/HiDatePicker/HiDateRangePicker.js +138 -149
- package/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/HiDatePicker/ListPicker.js +33 -55
- package/HiDatePicker/ListPicker.test.js +53 -0
- package/HiDatePicker/NavBar.js +18 -45
- package/HiDatePicker/NavBar.test.js +39 -0
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/HiDatePicker/Overlays/Overlay.js +18 -35
- package/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/HiDatePicker/Overlays/index.js +5 -47
- package/HiDatePicker/Weekday.js +3 -13
- package/HiDatePicker/hiLocaleUtils.js +1 -8
- package/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/HiDatePicker/index.js +1 -15
- package/HiDatePicker/stylesheet.js +9 -22
- package/HiDotsStepper/HiDot.js +30 -57
- package/HiDotsStepper/HiDot.test.js +55 -0
- package/HiDotsStepper/HiDotsStepper.js +29 -47
- package/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/HiDotsStepper/index.js +2 -23
- package/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/HiExpansionPanel/index.js +2 -13
- package/HiForm/HiAddressField.js +30 -47
- package/HiForm/HiAddressField.test.js +79 -0
- package/HiForm/HiEmailField.js +28 -46
- package/HiForm/HiEmailField.test.js +19 -0
- package/HiForm/HiFormControl.js +72 -100
- package/HiForm/HiFormControl.test.js +195 -0
- package/HiForm/HiFormLabel.js +29 -54
- package/HiForm/HiFormLabel.test.js +66 -0
- package/HiForm/HiInput.js +62 -86
- package/HiForm/HiInput.test.js +202 -0
- package/HiForm/HiPasswordField.js +29 -55
- package/HiForm/HiPasswordField.test.js +60 -0
- package/HiForm/HiSearchField.js +27 -44
- package/HiForm/HiSearchField.test.js +193 -0
- package/HiForm/HiSlider.js +42 -64
- package/HiForm/HiSlider.test.js +99 -0
- package/HiForm/HiTextField.js +29 -46
- package/HiForm/HiTextField.test.js +254 -0
- package/HiForm/HiUpload.js +54 -70
- package/HiForm/HiUpload.test.js +241 -0
- package/HiForm/HiUploadField.js +24 -41
- package/HiForm/HiUploadField.test.js +55 -0
- package/HiForm/HiUploadInput.js +56 -77
- package/HiForm/HiUploadInput.test.js +148 -0
- package/HiForm/index.js +11 -95
- package/HiIcon/HiIcon.js +22 -44
- package/HiIcon/index.js +1 -15
- package/HiIconButton/HiIconButton.js +18 -40
- package/HiIconButton/HiIconButton.test.js +69 -0
- package/HiIconButton/index.js +1 -15
- package/HiLoader/HiLoader.js +9 -24
- package/HiLoader/HiLoader.test.js +18 -0
- package/HiLoader/index.js +1 -15
- package/HiMap/HiMap.js +50 -77
- package/HiMap/HiMap.test.js +29 -0
- package/HiMap/HiMapExpand.js +39 -64
- package/HiMap/HiMapExpand.test.js +48 -0
- package/HiMap/index.js +2 -23
- package/HiNotice/HiKPI.js +33 -54
- package/HiNotice/HiKPI.test.js +171 -0
- package/HiNotice/HiKPINotice.js +7 -21
- package/HiNotice/HiKPINotice.test.js +88 -0
- package/HiNotice/index.js +2 -23
- package/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/HiPaymentMeans/index.js +1 -15
- package/HiPdfReader/HiPdfReader.js +51 -76
- package/HiPdfReader/index.js +1 -15
- package/HiPin/HiPin.js +9 -30
- package/HiPin/HiPin.test.js +61 -0
- package/HiPin/index.js +1 -15
- package/HiRadio/HiRadio.js +7 -24
- package/HiRadio/HiRadio.test.js +57 -0
- package/HiRadio/index.js +1 -15
- package/HiSelect/HiDynamicSelect.js +40 -56
- package/HiSelect/HiDynamicSelectField.js +22 -40
- package/HiSelect/HiNestedSelect.js +55 -84
- package/HiSelect/HiNestedSelectContent.js +46 -73
- package/HiSelect/HiNestedSelectField.js +22 -40
- package/HiSelect/HiSelect.js +123 -139
- package/HiSelect/HiSelect.test.js +1092 -0
- package/HiSelect/HiSelectContent.js +73 -95
- package/HiSelect/HiSelectField.js +22 -40
- package/HiSelect/HiSelectInput.js +63 -87
- package/HiSelect/HiSelectInput.test.js +21 -0
- package/HiSelect/HiSelectMobile.js +35 -54
- package/HiSelect/HiSuggestSelect.js +56 -78
- package/HiSelect/HiSuggestSelectField.js +22 -40
- package/HiSelect/index.js +8 -85
- package/HiSelectableList/HiSelectableList.js +49 -77
- package/HiSelectableList/HiSelectableList.test.js +173 -0
- package/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/HiSelectableList/HiSelectableListItem.js +66 -98
- package/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/HiSelectableList/index.js +3 -31
- package/HiSwitch/HiSwitch.js +20 -45
- package/HiSwitch/HiSwitch.test.js +41 -0
- package/HiSwitch/HiSwitchState.js +15 -36
- package/HiSwitch/HiSwitchState.test.js +76 -0
- package/HiSwitch/index.js +2 -23
- package/HiTable/HiCellBuilder.js +44 -72
- package/HiTable/HiTable.js +29 -47
- package/HiTable/HiTable.test.js +29 -0
- package/HiTable/HiTableBody.js +19 -34
- package/HiTable/HiTableHeader.js +30 -53
- package/HiTable/HiTableRow.js +29 -56
- package/HiTable/constants.js +43 -94
- package/HiTable/index.js +1 -15
- package/es/App.test.js +8 -0
- package/es/HiAlertModal/HiAlertModal.js +48 -77
- package/es/HiAlertModal/HiAlertModal.test.js +189 -0
- package/es/HiAlertModal/index.js +1 -15
- package/es/HiAppBar/HiAppBar.js +34 -63
- package/es/HiAppBar/index.js +1 -15
- package/es/HiBadge/HiBadge.js +10 -29
- package/es/HiBadge/HiBadge.test.js +49 -0
- package/es/HiBadge/index.js +1 -15
- package/es/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/es/HiBreadcrumb/HiStep.js +35 -57
- package/es/HiBreadcrumb/HiStep.test.js +47 -0
- package/es/HiBreadcrumb/HiStepConnector.js +32 -57
- package/es/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/es/HiBreadcrumb/HiStepContent.js +25 -46
- package/es/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/es/HiBreadcrumb/HiStepIcon.js +26 -46
- package/es/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/es/HiBreadcrumb/HiStepLabel.js +36 -61
- package/es/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/es/HiBreadcrumb/HiStepper.js +23 -45
- package/es/HiBreadcrumb/HiStepper.test.js +33 -0
- package/es/HiBreadcrumb/index.js +1 -15
- package/es/HiButton/HiButton.js +9 -27
- package/es/HiButton/index.js +2 -13
- package/es/HiCell/CellAddress.js +20 -40
- package/es/HiCell/CellAddress.test.js +75 -0
- package/es/HiCell/CellDate.js +26 -47
- package/es/HiCell/CellDate.test.js +173 -0
- package/es/HiCell/CellIcon.js +28 -49
- package/es/HiCell/CellIcon.test.js +57 -0
- package/es/HiCell/CellImage.js +23 -42
- package/es/HiCell/CellImage.test.js +49 -0
- package/es/HiCell/CellNumeric.js +25 -46
- package/es/HiCell/CellNumeric.test.js +46 -0
- package/es/HiCell/CellPinToAction.js +20 -41
- package/es/HiCell/CellRate.js +32 -55
- package/es/HiCell/CellRate.test.js +73 -0
- package/es/HiCell/CellSentinel.js +22 -42
- package/es/HiCell/CellSentinel.test.js +48 -0
- package/es/HiCell/CellSentinelScore.js +23 -44
- package/es/HiCell/CellText.js +37 -56
- package/es/HiCell/CellText.test.js +76 -0
- package/es/HiCell/CellTextStyled.js +8 -21
- package/es/HiCell/index.js +9 -79
- package/es/HiCheckbox/HiCheckbox.js +35 -60
- package/es/HiCheckbox/HiCheckbox.test.js +55 -0
- package/es/HiCheckbox/index.js +1 -15
- package/es/HiChip/HiChip.js +24 -44
- package/es/HiChip/HiChip.test.js +136 -0
- package/es/HiChip/HiChipSwitch.js +47 -70
- package/es/HiChip/HiChipSwitch.test.js +99 -0
- package/es/HiChip/index.js +2 -23
- package/es/HiColoredLabel/HiColoredLabel.js +28 -52
- package/es/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/es/HiColoredLabel/index.js +1 -15
- package/es/HiDatePicker/Caption.js +11 -28
- package/es/HiDatePicker/Caption.test.js +65 -0
- package/es/HiDatePicker/HiDatePicker.js +100 -115
- package/es/HiDatePicker/HiDatePicker.test.js +370 -0
- package/es/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/es/HiDatePicker/HiDateRangePicker.js +138 -149
- package/es/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/es/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/es/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/es/HiDatePicker/ListPicker.js +33 -55
- package/es/HiDatePicker/ListPicker.test.js +53 -0
- package/es/HiDatePicker/NavBar.js +18 -45
- package/es/HiDatePicker/NavBar.test.js +39 -0
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/es/HiDatePicker/Overlays/Overlay.js +18 -35
- package/es/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/es/HiDatePicker/Overlays/index.js +5 -47
- package/es/HiDatePicker/Weekday.js +3 -13
- package/es/HiDatePicker/hiLocaleUtils.js +1 -8
- package/es/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/es/HiDatePicker/index.js +1 -15
- package/es/HiDatePicker/stylesheet.js +9 -22
- package/es/HiDotsStepper/HiDot.js +30 -57
- package/es/HiDotsStepper/HiDot.test.js +55 -0
- package/es/HiDotsStepper/HiDotsStepper.js +29 -47
- package/es/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/es/HiDotsStepper/index.js +2 -23
- package/es/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/es/HiExpansionPanel/index.js +2 -13
- package/es/HiForm/HiAddressField.js +30 -47
- package/es/HiForm/HiAddressField.test.js +79 -0
- package/es/HiForm/HiEmailField.js +28 -46
- package/es/HiForm/HiEmailField.test.js +19 -0
- package/es/HiForm/HiFormControl.js +72 -100
- package/es/HiForm/HiFormControl.test.js +195 -0
- package/es/HiForm/HiFormLabel.js +29 -54
- package/es/HiForm/HiFormLabel.test.js +66 -0
- package/es/HiForm/HiInput.js +62 -86
- package/es/HiForm/HiInput.test.js +202 -0
- package/es/HiForm/HiPasswordField.js +29 -55
- package/es/HiForm/HiPasswordField.test.js +60 -0
- package/es/HiForm/HiSearchField.js +27 -44
- package/es/HiForm/HiSearchField.test.js +193 -0
- package/es/HiForm/HiSlider.js +42 -64
- package/es/HiForm/HiSlider.test.js +99 -0
- package/es/HiForm/HiTextField.js +29 -46
- package/es/HiForm/HiTextField.test.js +254 -0
- package/es/HiForm/HiUpload.js +54 -70
- package/es/HiForm/HiUpload.test.js +241 -0
- package/es/HiForm/HiUploadField.js +24 -41
- package/es/HiForm/HiUploadField.test.js +55 -0
- package/es/HiForm/HiUploadInput.js +56 -77
- package/es/HiForm/HiUploadInput.test.js +148 -0
- package/es/HiForm/index.js +11 -95
- package/es/HiIcon/HiIcon.js +22 -44
- package/es/HiIcon/index.js +1 -15
- package/es/HiIconButton/HiIconButton.js +18 -40
- package/es/HiIconButton/HiIconButton.test.js +69 -0
- package/es/HiIconButton/index.js +1 -15
- package/es/HiLoader/HiLoader.js +9 -24
- package/es/HiLoader/HiLoader.test.js +18 -0
- package/es/HiLoader/index.js +1 -15
- package/es/HiMap/HiMap.js +50 -77
- package/es/HiMap/HiMap.test.js +29 -0
- package/es/HiMap/HiMapExpand.js +39 -64
- package/es/HiMap/HiMapExpand.test.js +48 -0
- package/es/HiMap/index.js +2 -23
- package/es/HiNotice/HiKPI.js +33 -54
- package/es/HiNotice/HiKPI.test.js +171 -0
- package/es/HiNotice/HiKPINotice.js +7 -21
- package/es/HiNotice/HiKPINotice.test.js +88 -0
- package/es/HiNotice/index.js +2 -23
- package/es/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/es/HiPaymentMeans/index.js +1 -15
- package/es/HiPdfReader/HiPdfReader.js +51 -76
- package/es/HiPdfReader/index.js +1 -15
- package/es/HiPin/HiPin.js +9 -30
- package/es/HiPin/HiPin.test.js +61 -0
- package/es/HiPin/index.js +1 -15
- package/es/HiRadio/HiRadio.js +7 -24
- package/es/HiRadio/HiRadio.test.js +57 -0
- package/es/HiRadio/index.js +1 -15
- package/es/HiSelect/HiDynamicSelect.js +40 -56
- package/es/HiSelect/HiDynamicSelectField.js +22 -40
- package/es/HiSelect/HiNestedSelect.js +55 -84
- package/es/HiSelect/HiNestedSelectContent.js +46 -73
- package/es/HiSelect/HiNestedSelectField.js +22 -40
- package/es/HiSelect/HiSelect.js +123 -139
- package/es/HiSelect/HiSelect.test.js +1092 -0
- package/es/HiSelect/HiSelectContent.js +73 -95
- package/es/HiSelect/HiSelectField.js +22 -40
- package/es/HiSelect/HiSelectInput.js +63 -87
- package/es/HiSelect/HiSelectInput.test.js +21 -0
- package/es/HiSelect/HiSelectMobile.js +35 -54
- package/es/HiSelect/HiSuggestSelect.js +56 -78
- package/es/HiSelect/HiSuggestSelectField.js +22 -40
- package/es/HiSelect/index.js +8 -85
- package/es/HiSelectableList/HiSelectableList.js +49 -77
- package/es/HiSelectableList/HiSelectableList.test.js +173 -0
- package/es/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/es/HiSelectableList/HiSelectableListItem.js +66 -98
- package/es/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/es/HiSelectableList/index.js +3 -31
- package/es/HiSwitch/HiSwitch.js +20 -45
- package/es/HiSwitch/HiSwitch.test.js +41 -0
- package/es/HiSwitch/HiSwitchState.js +15 -36
- package/es/HiSwitch/HiSwitchState.test.js +76 -0
- package/es/HiSwitch/index.js +2 -23
- package/es/HiTable/HiCellBuilder.js +44 -72
- package/es/HiTable/HiTable.js +29 -47
- package/es/HiTable/HiTable.test.js +29 -0
- package/es/HiTable/HiTableBody.js +19 -34
- package/es/HiTable/HiTableHeader.js +30 -53
- package/es/HiTable/HiTableRow.js +29 -56
- package/es/HiTable/constants.js +43 -94
- package/es/HiTable/index.js +1 -15
- package/es/hi-svg-icons/HiAccount.js +18 -36
- package/es/hi-svg-icons/HiActivity.js +17 -35
- package/es/hi-svg-icons/HiAll.js +22 -42
- package/es/hi-svg-icons/HiBilling.js +18 -36
- package/es/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/es/hi-svg-icons/HiCatalog.js +18 -36
- package/es/hi-svg-icons/HiCustomer.js +18 -36
- package/es/hi-svg-icons/HiDownload.js +11 -25
- package/es/hi-svg-icons/HiFinance.js +18 -36
- package/es/hi-svg-icons/HiPermission.js +17 -35
- package/es/hi-svg-icons/HiRoute.js +18 -36
- package/es/hi-svg-icons/HiSettlement.js +18 -36
- package/es/hi-svg-icons/HiSizeLarge.js +12 -27
- package/es/hi-svg-icons/HiSizeMedium.js +11 -25
- package/es/hi-svg-icons/HiSizeSmall.js +11 -25
- package/es/hi-svg-icons/HiTransaction.js +18 -36
- package/es/hi-svg-icons/HiUser.js +18 -36
- package/es/hi-svg-icons/HiWidget.js +22 -42
- package/es/hi-svg-icons/index.js +18 -151
- package/es/hi-svg-icons/index.text.js +11 -21
- package/es/styleguide/Wrapper.js +19 -36
- package/es/styles/MuiThemeProvider.js +39 -59
- package/es/styles/colorManipulator.js +16 -44
- package/es/styles/colorManipulator.test.js +242 -0
- package/es/styles/createBreakpoints.js +6 -20
- package/es/styles/createBreakpoints.test.js +48 -0
- package/es/styles/createGenerateClassName.js +5 -15
- package/es/styles/createGenerateClassName.test.js +141 -0
- package/es/styles/createMixins.js +8 -19
- package/es/styles/createMixins.test.js +24 -0
- package/es/styles/createMuiTheme.js +34 -53
- package/es/styles/createMuiTheme.test.js +67 -0
- package/es/styles/createPalette.js +30 -50
- package/es/styles/createPalette.test.js +159 -0
- package/es/styles/createStyles.js +1 -8
- package/es/styles/createStyles.test.js +8 -0
- package/es/styles/createTypography.js +18 -30
- package/es/styles/createTypography.test.js +60 -0
- package/es/styles/getStylesCreator.js +11 -24
- package/es/styles/getStylesCreator.test.js +92 -0
- package/es/styles/getThemeProps.js +1 -9
- package/es/styles/getThemeProps.test.js +39 -0
- package/es/styles/index.js +5 -47
- package/es/styles/jssPreset.js +9 -25
- package/es/styles/mergeClasses.js +7 -19
- package/es/styles/shadows.js +1 -8
- package/es/styles/shape.js +1 -8
- package/es/styles/spacing.js +1 -9
- package/es/styles/themeListener.js +5 -18
- package/es/styles/themeListener.test.js +26 -0
- package/es/styles/transitions.js +18 -38
- package/es/styles/transitions.test.js +208 -0
- package/es/styles/zIndex.js +1 -8
- package/es/test-utils/createMount.js +11 -22
- package/es/test-utils/createRender.js +8 -19
- package/es/test-utils/createShallow.js +13 -23
- package/es/test-utils/getClasses.js +2 -11
- package/es/test-utils/index.js +5 -47
- package/es/test-utils/until.js +6 -16
- package/es/test-utils/until.test.js +157 -0
- package/es/test-utils/unwrap.js +1 -8
- package/es/theme/palette.js +2 -10
- package/es/theme/typography.js +2 -10
- package/es/theme.js +2 -11
- package/es/transitions/utils.js +2 -13
- package/es/utils/exactProp.js +5 -18
- package/es/utils/helpers.js +18 -55
- package/es/withMobileDialog/index.js +1 -15
- package/es/withMobileDialog/withMobileDialog.js +7 -22
- package/es/withMobileDialog/withMobileDialog.test.js +67 -0
- package/hi-svg-icons/HiAccount.js +18 -36
- package/hi-svg-icons/HiActivity.js +17 -35
- package/hi-svg-icons/HiAll.js +22 -42
- package/hi-svg-icons/HiBilling.js +18 -36
- package/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/hi-svg-icons/HiCatalog.js +18 -36
- package/hi-svg-icons/HiCustomer.js +18 -36
- package/hi-svg-icons/HiDownload.js +11 -25
- package/hi-svg-icons/HiFinance.js +18 -36
- package/hi-svg-icons/HiPermission.js +17 -35
- package/hi-svg-icons/HiRoute.js +18 -36
- package/hi-svg-icons/HiSettlement.js +18 -36
- package/hi-svg-icons/HiSizeLarge.js +12 -27
- package/hi-svg-icons/HiSizeMedium.js +11 -25
- package/hi-svg-icons/HiSizeSmall.js +11 -25
- package/hi-svg-icons/HiTransaction.js +18 -36
- package/hi-svg-icons/HiUser.js +18 -36
- package/hi-svg-icons/HiWidget.js +22 -42
- package/hi-svg-icons/index.js +18 -151
- package/hi-svg-icons/index.text.js +11 -21
- package/package.json +1 -1
- package/styleguide/Wrapper.js +19 -36
- package/styles/MuiThemeProvider.js +39 -59
- package/styles/colorManipulator.js +16 -44
- package/styles/colorManipulator.test.js +242 -0
- package/styles/createBreakpoints.js +6 -20
- package/styles/createBreakpoints.test.js +48 -0
- package/styles/createGenerateClassName.js +5 -15
- package/styles/createGenerateClassName.test.js +141 -0
- package/styles/createMixins.js +8 -19
- package/styles/createMixins.test.js +24 -0
- package/styles/createMuiTheme.js +34 -53
- package/styles/createMuiTheme.test.js +67 -0
- package/styles/createPalette.js +30 -50
- package/styles/createPalette.test.js +159 -0
- package/styles/createStyles.js +1 -8
- package/styles/createStyles.test.js +8 -0
- package/styles/createTypography.js +18 -30
- package/styles/createTypography.test.js +60 -0
- package/styles/getStylesCreator.js +11 -24
- package/styles/getStylesCreator.test.js +92 -0
- package/styles/getThemeProps.js +1 -9
- package/styles/getThemeProps.test.js +39 -0
- package/styles/index.js +5 -47
- package/styles/jssPreset.js +9 -25
- package/styles/mergeClasses.js +7 -19
- package/styles/shadows.js +1 -8
- package/styles/shape.js +1 -8
- package/styles/spacing.js +1 -9
- package/styles/themeListener.js +5 -18
- package/styles/themeListener.test.js +26 -0
- package/styles/transitions.js +18 -38
- package/styles/transitions.test.js +208 -0
- package/styles/zIndex.js +1 -8
- package/test-utils/createMount.js +11 -22
- package/test-utils/createRender.js +8 -19
- package/test-utils/createShallow.js +13 -23
- package/test-utils/getClasses.js +2 -11
- package/test-utils/index.js +5 -47
- package/test-utils/until.js +6 -16
- package/test-utils/until.test.js +157 -0
- package/test-utils/unwrap.js +1 -8
- package/theme/palette.js +2 -10
- package/theme/typography.js +2 -10
- package/theme.js +2 -11
- package/transitions/utils.js +2 -13
- package/utils/exactProp.js +5 -18
- package/utils/helpers.js +18 -55
- package/withMobileDialog/index.js +1 -15
- package/withMobileDialog/withMobileDialog.js +7 -22
- package/withMobileDialog/withMobileDialog.test.js +67 -0
@@ -0,0 +1,242 @@
|
|
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
|
+
});
|
@@ -1,24 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = createBreakpoints;
|
9
|
-
exports.keys = void 0;
|
10
|
-
|
11
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
12
|
-
|
13
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
14
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
15
3
|
// Sorted ASC by size. That's important.
|
16
4
|
// It can't be configured as it's used statically for propTypes.
|
17
|
-
var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.
|
18
|
-
|
19
|
-
exports.keys = keys;
|
5
|
+
export var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.
|
20
6
|
|
21
|
-
function createBreakpoints(breakpoints) {
|
7
|
+
export default function createBreakpoints(breakpoints) {
|
22
8
|
var _breakpoints$values = breakpoints.values,
|
23
9
|
values = _breakpoints$values === void 0 ? {
|
24
10
|
xs: 0,
|
@@ -31,7 +17,7 @@ function createBreakpoints(breakpoints) {
|
|
31
17
|
unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,
|
32
18
|
_breakpoints$step = breakpoints.step,
|
33
19
|
step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,
|
34
|
-
other = (
|
20
|
+
other = _objectWithoutProperties(breakpoints, ["values", "unit", "step"]);
|
35
21
|
|
36
22
|
function up(key) {
|
37
23
|
var value = typeof values[key] === 'number' ? values[key] : key;
|
@@ -69,7 +55,7 @@ function createBreakpoints(breakpoints) {
|
|
69
55
|
return values[key];
|
70
56
|
}
|
71
57
|
|
72
|
-
return (
|
58
|
+
return _objectSpread({
|
73
59
|
keys: keys,
|
74
60
|
values: values,
|
75
61
|
up: up,
|
@@ -0,0 +1,48 @@
|
|
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,23 +1,13 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = createGenerateClassName;
|
9
|
-
|
10
|
-
var _warning = _interopRequireDefault(require("warning"));
|
11
|
-
|
12
1
|
/* eslint-disable no-underscore-dangle */
|
13
|
-
// People might bundle this classname generator twice.
|
2
|
+
import warning from 'warning'; // People might bundle this classname generator twice.
|
14
3
|
// We need to use a global.
|
4
|
+
|
15
5
|
global.__MUI_GENERATOR_COUNTER__ = 0;
|
16
6
|
var escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g;
|
17
7
|
|
18
8
|
function safePrefix(classNamePrefix) {
|
19
9
|
var prefix = String(classNamePrefix);
|
20
|
-
|
10
|
+
warning(prefix.length < 256, "Material-UI: the class name prefix is too long: ".concat(prefix, ".")); // Sanitize the string as will be used to prefix the generated class name.
|
21
11
|
|
22
12
|
return prefix.replace(escapeRegex, '-');
|
23
13
|
} // Returns a function which generates unique class names based on counters.
|
@@ -28,7 +18,7 @@ function safePrefix(classNamePrefix) {
|
|
28
18
|
// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js
|
29
19
|
|
30
20
|
|
31
|
-
function createGenerateClassName() {
|
21
|
+
export default function createGenerateClassName() {
|
32
22
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33
23
|
var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,
|
34
24
|
dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,
|
@@ -50,7 +40,7 @@ function createGenerateClassName() {
|
|
50
40
|
|
51
41
|
return function (rule, styleSheet) {
|
52
42
|
ruleCounter += 1;
|
53
|
-
|
43
|
+
warning(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')); // Code branch the whole block at the expense of more code.
|
54
44
|
|
55
45
|
if (dangerouslyUseGlobalCSS) {
|
56
46
|
if (styleSheet) {
|
@@ -0,0 +1,141 @@
|
|
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
|
+
});
|
package/styles/createMixins.js
CHANGED
@@ -1,35 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = createMixins;
|
9
|
-
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
11
|
-
|
12
|
-
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
13
|
-
|
14
|
-
function createMixins(breakpoints, spacing, mixins) {
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
+
export default function createMixins(breakpoints, spacing, mixins) {
|
15
4
|
var _toolbar;
|
16
5
|
|
17
|
-
return (
|
6
|
+
return _objectSpread({
|
18
7
|
gutters: function gutters() {
|
19
8
|
var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
20
|
-
return (
|
9
|
+
return _objectSpread({
|
21
10
|
paddingLeft: spacing(4),
|
22
11
|
paddingRight: spacing(4)
|
23
|
-
}, styles, (
|
12
|
+
}, styles, _defineProperty({}, breakpoints.up('sm'), _objectSpread({
|
24
13
|
paddingLeft: spacing(6),
|
25
14
|
paddingRight: spacing(6)
|
26
15
|
}, styles[breakpoints.up('sm')])));
|
27
16
|
},
|
28
17
|
toolbar: (_toolbar = {
|
29
18
|
minHeight: 56
|
30
|
-
}, (
|
19
|
+
}, _defineProperty(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
|
31
20
|
minHeight: 48
|
32
|
-
}), (
|
21
|
+
}), _defineProperty(_toolbar, breakpoints.up('sm'), {
|
33
22
|
minHeight: 64
|
34
23
|
}), _toolbar)
|
35
24
|
}, mixins);
|
@@ -0,0 +1,24 @@
|
|
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
|
+
});
|