@hipay/hipay-material-ui 4.0.1-beta3 → 4.0.1-beta5
Sign up to get free protection for your applications and to get access to all the features.
- package/HiAccordion/HiAccordion.js +26 -8
- package/HiAccordion/index.js +5 -1
- package/HiAccordionActions/HiAccordionActions.js +14 -1
- package/HiAccordionActions/index.js +5 -1
- package/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/HiAccordionSummary/index.js +5 -1
- package/HiAlertModal/HiAlertModal.js +22 -7
- package/HiAlertModal/index.js +5 -1
- package/HiAppBar/HiAppBar.js +47 -15
- package/HiAppBar/index.js +2 -0
- package/HiAvatar/HiAvatar.js +12 -3
- package/HiAvatar/index.js +2 -0
- package/HiBadge/HiBadge.js +24 -8
- package/HiBadge/index.js +2 -0
- package/HiBreadcrumb/HiBreadcrumb.js +35 -10
- package/HiBreadcrumb/HiStep.js +50 -17
- package/HiBreadcrumb/HiStepConnector.js +55 -18
- package/HiBreadcrumb/HiStepContent.js +35 -10
- package/HiBreadcrumb/HiStepIcon.js +40 -14
- package/HiBreadcrumb/HiStepLabel.js +49 -18
- package/HiBreadcrumb/HiStepper.js +35 -10
- package/HiBreadcrumb/index.js +2 -0
- package/HiButton/HiButton.js +33 -8
- package/HiButton/index.js +5 -1
- package/HiCell/CellAddress.js +38 -16
- package/HiCell/CellDate.js +41 -14
- package/HiCell/CellHiddenContent.js +30 -8
- package/HiCell/CellIcon.js +41 -16
- package/HiCell/CellImage.js +39 -16
- package/HiCell/CellNumeric.js +45 -17
- package/HiCell/CellPinToAction.js +38 -13
- package/HiCell/CellRate.js +52 -17
- package/HiCell/CellSentinel.js +38 -16
- package/HiCell/CellSentinelScore.js +36 -13
- package/HiCell/CellText.js +58 -21
- package/HiCell/CellTextStyled.js +24 -13
- package/HiCell/index.js +10 -0
- package/HiCheckbox/HiCheckbox.js +57 -19
- package/HiCheckbox/index.js +2 -0
- package/HiChip/HiChip.js +47 -24
- package/HiChip/HiChipSwitch.js +65 -21
- package/HiChip/index.js +3 -0
- package/HiColoredLabel/HiColoredLabel.js +49 -15
- package/HiColoredLabel/index.js +2 -0
- package/HiDatePicker/Caption.js +21 -9
- package/HiDatePicker/HiDatePicker.js +93 -20
- package/HiDatePicker/HiDatePickerMobile.js +48 -22
- package/HiDatePicker/HiDateRangePicker.js +139 -42
- package/HiDatePicker/HiDateRangeSelector.js +135 -53
- package/HiDatePicker/ListPicker.js +43 -12
- package/HiDatePicker/NavBar.js +31 -12
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +32 -9
- package/HiDatePicker/Overlays/Overlay.js +25 -8
- package/HiDatePicker/Overlays/TimePickerOverlay.js +45 -13
- package/HiDatePicker/Overlays/YearPickerOverlay.js +38 -13
- package/HiDatePicker/Overlays/index.js +6 -0
- package/HiDatePicker/Weekday.js +9 -4
- package/HiDatePicker/hiLocaleUtils.js +20 -8
- package/HiDatePicker/index.js +2 -0
- package/HiDatePicker/stylesheet.js +13 -6
- package/HiDialog/HiDialog.js +19 -7
- package/HiDialog/index.js +2 -0
- package/HiDotsStepper/HiDot.js +42 -12
- package/HiDotsStepper/HiDotsStepper.js +43 -15
- package/HiDotsStepper/index.js +3 -0
- package/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/HiExpansionPanel/index.js +5 -1
- package/HiForm/HiAddressField.js +41 -14
- package/HiForm/HiEmailField.js +34 -9
- package/HiForm/HiFormControl.js +79 -32
- package/HiForm/HiFormLabel.js +45 -18
- package/HiForm/HiInput.js +97 -37
- package/HiForm/HiPasswordField.js +43 -13
- package/HiForm/HiSearchField.js +40 -8
- package/HiForm/HiSlider.js +62 -26
- package/HiForm/HiTextField.js +52 -26
- package/HiForm/HiUpload.js +94 -33
- package/HiForm/HiUploadField.js +37 -14
- package/HiForm/HiUploadInput.js +81 -25
- package/HiForm/index.js +12 -0
- package/HiIcon/HiIcon.js +34 -9
- package/HiIcon/index.js +2 -0
- package/HiIconButton/HiIconButton.js +21 -6
- package/HiIconButton/index.js +2 -0
- package/HiListItemLink/HiListItemLink.js +19 -6
- package/HiListItemLink/index.js +2 -0
- package/HiLoader/HiLoader.js +16 -6
- package/HiLoader/index.js +2 -0
- package/HiNotice/HiKPI.js +53 -21
- package/HiNotice/HiKPINotice.js +16 -6
- package/HiNotice/index.js +3 -0
- package/HiPagination/HiPagination.js +11 -1
- package/HiPagination/index.js +2 -0
- package/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/HiPaymentMeans/index.js +2 -0
- package/HiPdfReader/HiPdfReader.js +61 -27
- package/HiPdfReader/index.js +2 -0
- package/HiPin/HiPin.js +19 -7
- package/HiPin/index.js +2 -0
- package/HiRadio/HiRadio.js +22 -11
- package/HiRadio/index.js +2 -0
- package/HiScrollStepper/HiScrollStepper.js +67 -29
- package/HiScrollStepper/index.js +2 -0
- package/HiSelect/HiDynamicSelect.js +47 -36
- package/HiSelect/HiDynamicSelectField.js +52 -27
- package/HiSelect/HiNestedSelect.js +116 -69
- package/HiSelect/HiNestedSelectContent.js +90 -63
- package/HiSelect/HiNestedSelectField.js +52 -27
- package/HiSelect/HiSelect.js +192 -93
- package/HiSelect/HiSelectContent.js +103 -67
- package/HiSelect/HiSelectField.js +53 -28
- package/HiSelect/HiSelectInput.js +81 -25
- package/HiSelect/HiSelectMobile.js +49 -11
- package/HiSelect/HiSuggestSelect.js +85 -28
- package/HiSelect/HiSuggestSelectField.js +43 -18
- package/HiSelect/index.js +14 -2
- package/HiSelectableList/HiSelectableList.js +95 -38
- package/HiSelectableList/HiSelectableListHierarchic.js +65 -38
- package/HiSelectableList/HiSelectableListItem.js +88 -45
- package/HiSelectableList/index.js +4 -0
- package/HiStepper/DefaultIndicator.js +10 -1
- package/HiStepper/HiStep.js +48 -18
- package/HiStepper/HiStepper.js +15 -2
- package/HiStepper/index.js +3 -0
- package/HiSwitch/HiSwitch.js +33 -9
- package/HiSwitch/HiSwitchState.js +32 -15
- package/HiSwitch/index.js +3 -0
- package/HiTable/HiCellBuilder.js +69 -13
- package/HiTable/HiTable.js +48 -20
- package/HiTable/HiTableBody.js +28 -10
- package/HiTable/HiTableHeader.js +55 -21
- package/HiTable/HiTableRow.js +51 -16
- package/HiTable/constants.js +98 -48
- package/HiTable/index.js +2 -0
- package/es/HiAccordion/HiAccordion.js +26 -8
- package/es/HiAccordion/index.js +5 -1
- package/es/HiAccordionActions/HiAccordionActions.js +14 -1
- package/es/HiAccordionActions/index.js +5 -1
- package/es/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/es/HiAccordionSummary/index.js +5 -1
- package/es/HiAlertModal/HiAlertModal.js +22 -7
- package/es/HiAlertModal/index.js +5 -1
- package/es/HiAppBar/HiAppBar.js +47 -15
- package/es/HiAppBar/index.js +2 -0
- package/es/HiAvatar/HiAvatar.js +12 -3
- package/es/HiAvatar/index.js +2 -0
- package/es/HiBadge/HiBadge.js +24 -8
- package/es/HiBadge/index.js +2 -0
- package/es/HiBreadcrumb/HiBreadcrumb.js +35 -10
- package/es/HiBreadcrumb/HiStep.js +50 -17
- package/es/HiBreadcrumb/HiStepConnector.js +55 -18
- package/es/HiBreadcrumb/HiStepContent.js +35 -10
- package/es/HiBreadcrumb/HiStepIcon.js +40 -14
- package/es/HiBreadcrumb/HiStepLabel.js +49 -18
- package/es/HiBreadcrumb/HiStepper.js +35 -10
- package/es/HiBreadcrumb/index.js +2 -0
- package/es/HiButton/HiButton.js +33 -8
- package/es/HiButton/index.js +5 -1
- package/es/HiCell/CellAddress.js +38 -16
- package/es/HiCell/CellDate.js +41 -14
- package/es/HiCell/CellHiddenContent.js +30 -8
- package/es/HiCell/CellIcon.js +41 -16
- package/es/HiCell/CellImage.js +39 -16
- package/es/HiCell/CellNumeric.js +45 -17
- package/es/HiCell/CellPinToAction.js +38 -13
- package/es/HiCell/CellRate.js +52 -17
- package/es/HiCell/CellSentinel.js +38 -16
- package/es/HiCell/CellSentinelScore.js +36 -13
- package/es/HiCell/CellText.js +58 -21
- package/es/HiCell/CellTextStyled.js +24 -13
- package/es/HiCell/index.js +10 -0
- package/es/HiCheckbox/HiCheckbox.js +57 -19
- package/es/HiCheckbox/index.js +2 -0
- package/es/HiChip/HiChip.js +47 -24
- package/es/HiChip/HiChipSwitch.js +65 -21
- package/es/HiChip/index.js +3 -0
- package/es/HiColoredLabel/HiColoredLabel.js +49 -15
- package/es/HiColoredLabel/index.js +2 -0
- package/es/HiDatePicker/Caption.js +21 -9
- package/es/HiDatePicker/HiDatePicker.js +93 -20
- package/es/HiDatePicker/HiDatePickerMobile.js +48 -22
- package/es/HiDatePicker/HiDateRangePicker.js +139 -42
- package/es/HiDatePicker/HiDateRangeSelector.js +135 -53
- package/es/HiDatePicker/ListPicker.js +43 -12
- package/es/HiDatePicker/NavBar.js +31 -12
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +32 -9
- package/es/HiDatePicker/Overlays/Overlay.js +25 -8
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +45 -13
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +38 -13
- package/es/HiDatePicker/Overlays/index.js +6 -0
- package/es/HiDatePicker/Weekday.js +9 -4
- package/es/HiDatePicker/hiLocaleUtils.js +20 -8
- package/es/HiDatePicker/index.js +2 -0
- package/es/HiDatePicker/stylesheet.js +13 -6
- package/es/HiDialog/HiDialog.js +19 -7
- package/es/HiDialog/index.js +2 -0
- package/es/HiDotsStepper/HiDot.js +42 -12
- package/es/HiDotsStepper/HiDotsStepper.js +43 -15
- package/es/HiDotsStepper/index.js +3 -0
- package/es/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/es/HiExpansionPanel/index.js +5 -1
- package/es/HiForm/HiAddressField.js +41 -14
- package/es/HiForm/HiEmailField.js +34 -9
- package/es/HiForm/HiFormControl.js +79 -32
- package/es/HiForm/HiFormLabel.js +45 -18
- package/es/HiForm/HiInput.js +97 -37
- package/es/HiForm/HiPasswordField.js +43 -13
- package/es/HiForm/HiSearchField.js +40 -8
- package/es/HiForm/HiSlider.js +62 -26
- package/es/HiForm/HiTextField.js +52 -26
- package/es/HiForm/HiUpload.js +94 -33
- package/es/HiForm/HiUploadField.js +37 -14
- package/es/HiForm/HiUploadInput.js +81 -25
- package/es/HiForm/index.js +12 -0
- package/es/HiIcon/HiIcon.js +34 -9
- package/es/HiIcon/index.js +2 -0
- package/es/HiIconButton/HiIconButton.js +21 -6
- package/es/HiIconButton/index.js +2 -0
- package/es/HiListItemLink/HiListItemLink.js +19 -6
- package/es/HiListItemLink/index.js +2 -0
- package/es/HiLoader/HiLoader.js +16 -6
- package/es/HiLoader/index.js +2 -0
- package/es/HiNotice/HiKPI.js +53 -21
- package/es/HiNotice/HiKPINotice.js +16 -6
- package/es/HiNotice/index.js +3 -0
- package/es/HiPagination/HiPagination.js +11 -1
- package/es/HiPagination/index.js +2 -0
- package/es/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/es/HiPaymentMeans/index.js +2 -0
- package/es/HiPdfReader/HiPdfReader.js +61 -27
- package/es/HiPdfReader/index.js +2 -0
- package/es/HiPin/HiPin.js +19 -7
- package/es/HiPin/index.js +2 -0
- package/es/HiRadio/HiRadio.js +22 -11
- package/es/HiRadio/index.js +2 -0
- package/es/HiScrollStepper/HiScrollStepper.js +67 -29
- package/es/HiScrollStepper/index.js +2 -0
- package/es/HiSelect/HiDynamicSelect.js +47 -36
- package/es/HiSelect/HiDynamicSelectField.js +52 -27
- package/es/HiSelect/HiNestedSelect.js +116 -69
- package/es/HiSelect/HiNestedSelectContent.js +90 -63
- package/es/HiSelect/HiNestedSelectField.js +52 -27
- package/es/HiSelect/HiSelect.js +192 -93
- package/es/HiSelect/HiSelectContent.js +103 -67
- package/es/HiSelect/HiSelectField.js +53 -28
- package/es/HiSelect/HiSelectInput.js +81 -25
- package/es/HiSelect/HiSelectMobile.js +49 -11
- package/es/HiSelect/HiSuggestSelect.js +85 -28
- package/es/HiSelect/HiSuggestSelectField.js +43 -18
- package/es/HiSelect/index.js +14 -2
- package/es/HiSelectableList/HiSelectableList.js +95 -38
- package/es/HiSelectableList/HiSelectableListHierarchic.js +65 -38
- package/es/HiSelectableList/HiSelectableListItem.js +88 -45
- package/es/HiSelectableList/index.js +4 -0
- package/es/HiStepper/DefaultIndicator.js +10 -1
- package/es/HiStepper/HiStep.js +48 -18
- package/es/HiStepper/HiStepper.js +15 -2
- package/es/HiStepper/index.js +3 -0
- package/es/HiSwitch/HiSwitch.js +33 -9
- package/es/HiSwitch/HiSwitchState.js +32 -15
- package/es/HiSwitch/index.js +3 -0
- package/es/HiTable/HiCellBuilder.js +69 -13
- package/es/HiTable/HiTable.js +48 -20
- package/es/HiTable/HiTableBody.js +28 -10
- package/es/HiTable/HiTableHeader.js +55 -21
- package/es/HiTable/HiTableRow.js +51 -16
- package/es/HiTable/constants.js +98 -48
- package/es/HiTable/index.js +2 -0
- package/es/hi-svg-icons/HiAccount.js +14 -4
- package/es/hi-svg-icons/HiActivity.js +14 -4
- package/es/hi-svg-icons/HiAll.js +18 -7
- package/es/hi-svg-icons/HiBilling.js +14 -4
- package/es/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/es/hi-svg-icons/HiBusiness.js +14 -4
- package/es/hi-svg-icons/HiCatalog.js +14 -4
- package/es/hi-svg-icons/HiCustomer.js +14 -4
- package/es/hi-svg-icons/HiDownload.js +14 -4
- package/es/hi-svg-icons/HiFinance.js +14 -4
- package/es/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/es/hi-svg-icons/HiIntegration.js +14 -4
- package/es/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/es/hi-svg-icons/HiIntelligence.js +14 -4
- package/es/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/es/hi-svg-icons/HiInvoice.js +14 -4
- package/es/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/es/hi-svg-icons/HiLogoRounded.js +17 -6
- package/es/hi-svg-icons/HiOrder.js +14 -4
- package/es/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/es/hi-svg-icons/HiPermission.js +14 -4
- package/es/hi-svg-icons/HiPriceGrid.js +14 -4
- package/es/hi-svg-icons/HiPrivate.js +14 -4
- package/es/hi-svg-icons/HiRoute.js +14 -4
- package/es/hi-svg-icons/HiRouteMenu.js +14 -4
- package/es/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/es/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/es/hi-svg-icons/HiSettlement.js +14 -4
- package/es/hi-svg-icons/HiSizeLarge.js +14 -4
- package/es/hi-svg-icons/HiSizeMedium.js +14 -4
- package/es/hi-svg-icons/HiSizeSmall.js +14 -4
- package/es/hi-svg-icons/HiStore.js +14 -4
- package/es/hi-svg-icons/HiStoreMenu.js +14 -4
- package/es/hi-svg-icons/HiTransaction.js +14 -4
- package/es/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/es/hi-svg-icons/HiUser.js +14 -4
- package/es/hi-svg-icons/HiVendor.js +14 -4
- package/es/hi-svg-icons/HiWidget.js +14 -4
- package/es/hi-svg-icons/index.js +41 -0
- package/es/hi-svg-images/HiLogo.js +12 -4
- package/es/hi-svg-images/HiLogoWhite.js +12 -4
- package/es/hi-svg-images/index.js +3 -0
- package/es/setupTest.js +13 -2
- package/es/styleguide/Wrapper.js +6 -0
- package/es/styles/MuiThemeProvider.js +53 -18
- package/es/styles/colorManipulator.js +50 -15
- package/es/styles/createBreakpoints.js +29 -14
- package/es/styles/createGenerateClassName.js +24 -14
- package/es/styles/createMixins.js +10 -4
- package/es/styles/createMuiTheme.js +28 -11
- package/es/styles/createPalette.js +89 -66
- package/es/styles/createStyles.js +1 -0
- package/es/styles/createTypography.js +24 -15
- package/es/styles/getStylesCreator.js +14 -2
- package/es/styles/getThemeProps.js +7 -2
- package/es/styles/index.js +6 -0
- package/es/styles/jssPreset.js +11 -1
- package/es/styles/makeStyles.js +9 -2
- package/es/styles/mergeClasses.js +16 -5
- package/es/styles/shadows.js +4 -1
- package/es/styles/shape.js +2 -1
- package/es/styles/spacing.js +4 -1
- package/es/styles/themeListener.js +10 -2
- package/es/styles/transitions.js +35 -20
- package/es/styles/withStyles.js +9 -2
- package/es/styles/zIndex.js +2 -1
- package/es/test-utils/createMount.js +12 -2
- package/es/test-utils/createRender.js +9 -2
- package/es/test-utils/createShallow.js +17 -6
- package/es/test-utils/getClasses.js +4 -1
- package/es/test-utils/index.js +6 -0
- package/es/test-utils/until.js +14 -3
- package/es/test-utils/unwrap.js +1 -0
- package/es/theme/palette.js +7 -2
- package/es/theme/typography.js +15 -7
- package/es/theme.js +8 -2
- package/es/transitions/utils.js +7 -3
- package/es/utils/exactProp.js +13 -3
- package/es/utils/helpers.js +58 -19
- package/es/withMobileDialog/index.js +2 -0
- package/es/withMobileDialog/withMobileDialog.js +12 -3
- package/hi-svg-icons/HiAccount.js +14 -4
- package/hi-svg-icons/HiActivity.js +14 -4
- package/hi-svg-icons/HiAll.js +18 -7
- package/hi-svg-icons/HiBilling.js +14 -4
- package/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/hi-svg-icons/HiBusiness.js +14 -4
- package/hi-svg-icons/HiCatalog.js +14 -4
- package/hi-svg-icons/HiCustomer.js +14 -4
- package/hi-svg-icons/HiDownload.js +14 -4
- package/hi-svg-icons/HiFinance.js +14 -4
- package/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/hi-svg-icons/HiIntegration.js +14 -4
- package/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/hi-svg-icons/HiIntelligence.js +14 -4
- package/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/hi-svg-icons/HiInvoice.js +14 -4
- package/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/hi-svg-icons/HiLogoRounded.js +17 -6
- package/hi-svg-icons/HiOrder.js +14 -4
- package/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/hi-svg-icons/HiPermission.js +14 -4
- package/hi-svg-icons/HiPriceGrid.js +14 -4
- package/hi-svg-icons/HiPrivate.js +14 -4
- package/hi-svg-icons/HiRoute.js +14 -4
- package/hi-svg-icons/HiRouteMenu.js +14 -4
- package/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/hi-svg-icons/HiSettlement.js +14 -4
- package/hi-svg-icons/HiSizeLarge.js +14 -4
- package/hi-svg-icons/HiSizeMedium.js +14 -4
- package/hi-svg-icons/HiSizeSmall.js +14 -4
- package/hi-svg-icons/HiStore.js +14 -4
- package/hi-svg-icons/HiStoreMenu.js +14 -4
- package/hi-svg-icons/HiTransaction.js +14 -4
- package/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/hi-svg-icons/HiUser.js +14 -4
- package/hi-svg-icons/HiVendor.js +14 -4
- package/hi-svg-icons/HiWidget.js +14 -4
- package/hi-svg-icons/index.js +41 -0
- package/hi-svg-images/HiLogo.js +12 -4
- package/hi-svg-images/HiLogoWhite.js +12 -4
- package/hi-svg-images/index.js +3 -0
- package/package.json +1 -1
- package/setupTest.js +13 -2
- package/styleguide/Wrapper.js +6 -0
- package/styles/MuiThemeProvider.js +53 -18
- package/styles/colorManipulator.js +50 -15
- package/styles/createBreakpoints.js +29 -14
- package/styles/createGenerateClassName.js +24 -14
- package/styles/createMixins.js +10 -4
- package/styles/createMuiTheme.js +28 -11
- package/styles/createPalette.js +89 -66
- package/styles/createStyles.js +1 -0
- package/styles/createTypography.js +24 -15
- package/styles/getStylesCreator.js +14 -2
- package/styles/getThemeProps.js +7 -2
- package/styles/index.js +6 -0
- package/styles/jssPreset.js +11 -1
- package/styles/makeStyles.js +9 -2
- package/styles/mergeClasses.js +16 -5
- package/styles/shadows.js +4 -1
- package/styles/shape.js +2 -1
- package/styles/spacing.js +4 -1
- package/styles/themeListener.js +10 -2
- package/styles/transitions.js +35 -20
- package/styles/withStyles.js +9 -2
- package/styles/zIndex.js +2 -1
- package/test-utils/createMount.js +12 -2
- package/test-utils/createRender.js +9 -2
- package/test-utils/createShallow.js +17 -6
- package/test-utils/getClasses.js +4 -1
- package/test-utils/index.js +6 -0
- package/test-utils/until.js +14 -3
- package/test-utils/unwrap.js +1 -0
- package/theme/palette.js +7 -2
- package/theme/typography.js +15 -7
- package/theme.js +8 -2
- package/transitions/utils.js +7 -3
- package/utils/exactProp.js +13 -3
- package/utils/helpers.js +58 -19
- package/withMobileDialog/index.js +2 -0
- package/withMobileDialog/withMobileDialog.js +12 -3
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
@@ -16,5 +17,7 @@ Object.defineProperty(exports, "HiLogoWhite", {
|
|
16
17
|
return _HiLogoWhite.default;
|
17
18
|
}
|
18
19
|
});
|
20
|
+
|
19
21
|
var _HiLogo = _interopRequireDefault(require("./HiLogo"));
|
22
|
+
|
20
23
|
var _HiLogoWhite = _interopRequireDefault(require("./HiLogoWhite"));
|
package/es/setupTest.js
CHANGED
@@ -1,33 +1,44 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
6
|
+
|
5
7
|
var _enzyme = _interopRequireDefault(require("enzyme"));
|
8
|
+
|
6
9
|
var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
|
10
|
+
|
7
11
|
_enzyme.default.configure({
|
8
12
|
adapter: new _enzymeAdapterReact.default()
|
9
13
|
});
|
10
|
-
|
11
14
|
/**
|
12
15
|
* SETUP JSDOM
|
13
16
|
* https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
|
14
17
|
*/
|
18
|
+
|
19
|
+
|
15
20
|
var _require = require('jsdom'),
|
16
|
-
|
21
|
+
JSDOM = _require.JSDOM;
|
22
|
+
|
17
23
|
var jsdom = new JSDOM('<!doctype html><html><body></body></html>');
|
18
24
|
var window = jsdom.window;
|
25
|
+
|
19
26
|
function copyProps(src, target) {
|
20
27
|
Object.defineProperties(target, (0, _objectSpread2.default)({}, Object.getOwnPropertyDescriptors(src), {}, Object.getOwnPropertyDescriptors(target)));
|
21
28
|
}
|
29
|
+
|
22
30
|
global.window = window;
|
23
31
|
global.document = window.document;
|
24
32
|
global.navigator = {
|
25
33
|
userAgent: 'node.js'
|
26
34
|
};
|
35
|
+
|
27
36
|
global.requestAnimationFrame = function (callback) {
|
28
37
|
return setTimeout(callback, 0);
|
29
38
|
};
|
39
|
+
|
30
40
|
global.cancelAnimationFrame = function (id) {
|
31
41
|
clearTimeout(id);
|
32
42
|
};
|
43
|
+
|
33
44
|
copyProps(window, global);
|
package/es/styleguide/Wrapper.js
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.default = Wrapper;
|
9
|
+
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
9
12
|
var _styles = require("@mui/material/styles");
|
13
|
+
|
10
14
|
var _theme = _interopRequireDefault(require("../theme"));
|
15
|
+
|
11
16
|
function Wrapper(_ref) {
|
12
17
|
var children = _ref.children;
|
13
18
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledEngineProvider, {
|
@@ -16,4 +21,5 @@ function Wrapper(_ref) {
|
|
16
21
|
theme: _theme.default
|
17
22
|
}, children));
|
18
23
|
}
|
24
|
+
|
19
25
|
;
|
@@ -1,28 +1,48 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
+
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
6
8
|
value: true
|
7
9
|
});
|
8
10
|
exports.default = void 0;
|
11
|
+
|
9
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
13
|
+
|
10
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
15
|
+
|
11
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
17
|
+
|
12
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
19
|
+
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
21
|
+
|
13
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
23
|
+
|
14
24
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
15
|
-
|
25
|
+
|
16
26
|
var _react = _interopRequireDefault(require("react"));
|
27
|
+
|
17
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
29
|
+
|
18
30
|
var _warning = _interopRequireDefault(require("warning"));
|
31
|
+
|
19
32
|
var _brcast = _interopRequireDefault(require("brcast"));
|
33
|
+
|
20
34
|
var _themeListener = _interopRequireWildcard(require("./themeListener"));
|
35
|
+
|
21
36
|
var _exactProp = _interopRequireDefault(require("../utils/exactProp"));
|
22
|
-
|
23
|
-
function
|
24
|
-
|
25
|
-
function
|
37
|
+
|
38
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
39
|
+
|
40
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
41
|
+
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
43
|
+
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
45
|
+
|
26
46
|
/**
|
27
47
|
* This component takes a `theme` property.
|
28
48
|
* It makes the `theme` available down the React tree thanks to React context.
|
@@ -30,43 +50,55 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
30
50
|
*/
|
31
51
|
var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
32
52
|
(0, _inherits2.default)(MuiThemeProvider, _React$Component);
|
53
|
+
|
54
|
+
var _super = _createSuper(MuiThemeProvider);
|
55
|
+
|
56
|
+
// We are not using the React state in order to avoid unnecessary rerender.
|
33
57
|
function MuiThemeProvider(props, context) {
|
34
58
|
var _this;
|
59
|
+
|
35
60
|
(0, _classCallCheck2.default)(this, MuiThemeProvider);
|
36
|
-
_this =
|
37
|
-
|
61
|
+
_this = _super.call(this); // Get the outer theme from the context, can be null
|
62
|
+
|
38
63
|
_this.broadcast = (0, _brcast.default)();
|
39
64
|
_this.unsubscribeId = null;
|
40
|
-
// We are not using the React state in order to avoid unnecessary rerender.
|
41
65
|
_this.outerTheme = null;
|
42
|
-
_this.outerTheme = _themeListener.default.initial(context);
|
43
|
-
|
66
|
+
_this.outerTheme = _themeListener.default.initial(context); // Propagate the theme so it can be accessed by the children
|
67
|
+
|
44
68
|
_this.broadcast.setState(_this.mergeOuterLocalTheme(props.theme));
|
69
|
+
|
45
70
|
return _this;
|
46
71
|
}
|
72
|
+
|
47
73
|
(0, _createClass2.default)(MuiThemeProvider, [{
|
48
74
|
key: "getChildContext",
|
49
75
|
value: function getChildContext() {
|
76
|
+
var _ref;
|
77
|
+
|
50
78
|
var _this$props = this.props,
|
51
|
-
|
52
|
-
|
79
|
+
sheetsManager = _this$props.sheetsManager,
|
80
|
+
disableStylesGeneration = _this$props.disableStylesGeneration;
|
53
81
|
var muiThemeProviderOptions = this.context.muiThemeProviderOptions || {};
|
82
|
+
|
54
83
|
if (sheetsManager !== undefined) {
|
55
84
|
muiThemeProviderOptions.sheetsManager = sheetsManager;
|
56
85
|
}
|
86
|
+
|
57
87
|
if (disableStylesGeneration !== undefined) {
|
58
88
|
muiThemeProviderOptions.disableStylesGeneration = disableStylesGeneration;
|
59
89
|
}
|
60
|
-
|
90
|
+
|
91
|
+
return _ref = {}, (0, _defineProperty2.default)(_ref, _themeListener.CHANNEL, this.broadcast), (0, _defineProperty2.default)(_ref, "muiThemeProviderOptions", muiThemeProviderOptions), _ref;
|
61
92
|
}
|
62
93
|
}, {
|
63
94
|
key: "componentDidMount",
|
64
95
|
value: function componentDidMount() {
|
65
96
|
var _this2 = this;
|
97
|
+
|
66
98
|
// Subscribe on the outer theme, if present
|
67
99
|
this.unsubscribeId = _themeListener.default.subscribe(this.context, function (outerTheme) {
|
68
|
-
_this2.outerTheme = outerTheme;
|
69
|
-
|
100
|
+
_this2.outerTheme = outerTheme; // Forward the parent theme update to the children
|
101
|
+
|
70
102
|
_this2.broadcast.setState(_this2.mergeOuterLocalTheme(_this2.props.theme));
|
71
103
|
});
|
72
104
|
}
|
@@ -84,9 +116,8 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
84
116
|
if (this.unsubscribeId !== null) {
|
85
117
|
_themeListener.default.unsubscribe(this.context, this.unsubscribeId);
|
86
118
|
}
|
87
|
-
}
|
119
|
+
} // Simple merge between the outer theme and the local theme
|
88
120
|
|
89
|
-
// Simple merge between the outer theme and the local theme
|
90
121
|
}, {
|
91
122
|
key: "mergeOuterLocalTheme",
|
92
123
|
value: function mergeOuterLocalTheme(localTheme) {
|
@@ -95,9 +126,11 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
95
126
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(this.outerTheme, ['Material-UI: you are providing a theme function property ' + 'to the MuiThemeProvider component:', '<MuiThemeProvider theme={outerTheme => outerTheme} />', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n')) : void 0;
|
96
127
|
return localTheme(this.outerTheme);
|
97
128
|
}
|
129
|
+
|
98
130
|
if (!this.outerTheme) {
|
99
131
|
return localTheme;
|
100
132
|
}
|
133
|
+
|
101
134
|
return (0, _objectSpread2.default)({}, this.outerTheme, {}, localTheme);
|
102
135
|
}
|
103
136
|
}, {
|
@@ -117,10 +150,12 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
117
150
|
}]);
|
118
151
|
return MuiThemeProvider;
|
119
152
|
}(_react.default.Component);
|
153
|
+
|
120
154
|
MuiThemeProvider.childContextTypes = (0, _objectSpread2.default)({}, _themeListener.default.contextTypes, {
|
121
155
|
muiThemeProviderOptions: _propTypes.default.object
|
122
156
|
});
|
123
157
|
MuiThemeProvider.contextTypes = (0, _objectSpread2.default)({}, _themeListener.default.contextTypes, {
|
124
158
|
muiThemeProviderOptions: _propTypes.default.object
|
125
159
|
});
|
126
|
-
var _default =
|
160
|
+
var _default = MuiThemeProvider;
|
161
|
+
exports.default = _default;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
@@ -14,7 +15,9 @@ exports.getLuminance = getLuminance;
|
|
14
15
|
exports.lighten = lighten;
|
15
16
|
exports.recomposeColor = recomposeColor;
|
16
17
|
exports.rgbToHex = rgbToHex;
|
18
|
+
|
17
19
|
var _warning = _interopRequireDefault(require("warning"));
|
20
|
+
|
18
21
|
/* eslint-disable no-use-before-define */
|
19
22
|
|
20
23
|
/**
|
@@ -29,58 +32,67 @@ function clamp(value) {
|
|
29
32
|
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
30
33
|
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
31
34
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(value >= min && value <= max, "Material-UI: the value provided ".concat(value, " is out of range [").concat(min, ", ").concat(max, "].")) : void 0;
|
35
|
+
|
32
36
|
if (value < min) {
|
33
37
|
return min;
|
34
38
|
}
|
39
|
+
|
35
40
|
if (value > max) {
|
36
41
|
return max;
|
37
42
|
}
|
43
|
+
|
38
44
|
return value;
|
39
45
|
}
|
40
|
-
|
41
46
|
/**
|
42
47
|
* Converts a color from CSS hex format to CSS rgb format.
|
43
48
|
*
|
44
49
|
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn
|
45
50
|
* @returns {string} A CSS rgb color string
|
46
51
|
*/
|
52
|
+
|
53
|
+
|
47
54
|
function convertHexToRGB(color) {
|
48
55
|
color = color.substr(1);
|
49
56
|
var re = new RegExp(".{1,".concat(color.length / 3, "}"), 'g');
|
50
57
|
var colors = color.match(re);
|
58
|
+
|
51
59
|
if (colors && colors[0].length === 1) {
|
52
60
|
colors = colors.map(function (n) {
|
53
61
|
return n + n;
|
54
62
|
});
|
55
63
|
}
|
64
|
+
|
56
65
|
return colors ? "rgb(".concat(colors.map(function (n) {
|
57
66
|
return parseInt(n, 16);
|
58
67
|
}).join(', '), ")") : '';
|
59
68
|
}
|
60
|
-
|
61
69
|
/**
|
62
70
|
* Converts a color from CSS rgb format to CSS hex format.
|
63
71
|
*
|
64
72
|
* @param {string} color - RGB color, i.e. rgb(n, n, n)
|
65
73
|
* @returns {string} A CSS rgb color string, i.e. #nnnnnn
|
66
74
|
*/
|
75
|
+
|
76
|
+
|
67
77
|
function rgbToHex(color) {
|
68
78
|
// Pass hex straight through
|
69
79
|
if (color.indexOf('#') === 0) {
|
70
80
|
return color;
|
71
81
|
}
|
82
|
+
|
72
83
|
function intToHex(c) {
|
73
84
|
var hex = c.toString(16);
|
74
85
|
return hex.length === 1 ? "0".concat(hex) : hex;
|
75
86
|
}
|
87
|
+
|
76
88
|
var _decomposeColor = decomposeColor(color),
|
77
|
-
|
89
|
+
values = _decomposeColor.values;
|
90
|
+
|
78
91
|
values = values.map(function (n) {
|
79
92
|
return intToHex(n);
|
80
93
|
});
|
81
94
|
return "#".concat(values.join(''));
|
82
95
|
}
|
83
|
-
|
84
96
|
/**
|
85
97
|
* Returns an object with the type and values of a color.
|
86
98
|
*
|
@@ -89,27 +101,31 @@ function rgbToHex(color) {
|
|
89
101
|
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
90
102
|
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
91
103
|
*/
|
104
|
+
|
105
|
+
|
92
106
|
function decomposeColor(color) {
|
93
107
|
if (color.charAt(0) === '#') {
|
94
108
|
return decomposeColor(convertHexToRGB(color));
|
95
109
|
}
|
110
|
+
|
96
111
|
var marker = color.indexOf('(');
|
97
112
|
var type = color.substring(0, marker);
|
98
113
|
var values = color.substring(marker + 1, color.length - 1).split(',');
|
99
114
|
values = values.map(function (value) {
|
100
115
|
return parseFloat(value);
|
101
116
|
});
|
117
|
+
|
102
118
|
if (process.env.NODE_ENV !== 'production') {
|
103
119
|
if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) {
|
104
120
|
throw new Error(["Material-UI: unsupported `".concat(color, "` color."), 'We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla().'].join('\n'));
|
105
121
|
}
|
106
122
|
}
|
123
|
+
|
107
124
|
return {
|
108
125
|
type: type,
|
109
126
|
values: values
|
110
127
|
};
|
111
128
|
}
|
112
|
-
|
113
129
|
/**
|
114
130
|
* Converts a color object with type and values to a string.
|
115
131
|
*
|
@@ -118,22 +134,26 @@ function decomposeColor(color) {
|
|
118
134
|
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
119
135
|
* @returns {string} A CSS color string
|
120
136
|
*/
|
137
|
+
|
138
|
+
|
121
139
|
function recomposeColor(color) {
|
122
140
|
var type = color.type;
|
123
141
|
var values = color.values;
|
142
|
+
|
124
143
|
if (type.indexOf('rgb') !== -1) {
|
125
144
|
// Only convert the first 3 values to int (i.e. not alpha)
|
126
145
|
values = values.map(function (n, i) {
|
127
146
|
return i < 3 ? parseInt(n, 10) : n;
|
128
147
|
});
|
129
148
|
}
|
149
|
+
|
130
150
|
if (type.indexOf('hsl') !== -1) {
|
131
151
|
values[1] = "".concat(values[1], "%");
|
132
152
|
values[2] = "".concat(values[2], "%");
|
133
153
|
}
|
154
|
+
|
134
155
|
return "".concat(color.type, "(").concat(values.join(', '), ")");
|
135
156
|
}
|
136
|
-
|
137
157
|
/**
|
138
158
|
* Calculates the contrast ratio between two colors.
|
139
159
|
*
|
@@ -143,12 +163,13 @@ function recomposeColor(color) {
|
|
143
163
|
* @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
144
164
|
* @returns {number} A contrast ratio value in the range 0 - 21.
|
145
165
|
*/
|
166
|
+
|
167
|
+
|
146
168
|
function getContrastRatio(foreground, background) {
|
147
169
|
var lumA = getLuminance(foreground);
|
148
170
|
var lumB = getLuminance(background);
|
149
171
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
150
172
|
}
|
151
|
-
|
152
173
|
/**
|
153
174
|
* The relative brightness of any point in a color space,
|
154
175
|
* normalized to 0 for darkest black and 1 for lightest white.
|
@@ -158,21 +179,24 @@ function getContrastRatio(foreground, background) {
|
|
158
179
|
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
159
180
|
* @returns {number} The relative brightness of the color in the range 0 - 1
|
160
181
|
*/
|
182
|
+
|
183
|
+
|
161
184
|
function getLuminance(color) {
|
162
185
|
var decomposedColor = decomposeColor(color);
|
186
|
+
|
163
187
|
if (decomposedColor.type.indexOf('rgb') !== -1) {
|
164
188
|
var rgb = decomposedColor.values.map(function (val) {
|
165
189
|
val /= 255; // normalized
|
190
|
+
|
166
191
|
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
167
|
-
});
|
168
|
-
|
192
|
+
}); // Truncate at 3 digits
|
193
|
+
|
169
194
|
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
170
|
-
}
|
195
|
+
} // else if (decomposedColor.type.indexOf('hsl') !== -1)
|
196
|
+
|
171
197
|
|
172
|
-
// else if (decomposedColor.type.indexOf('hsl') !== -1)
|
173
198
|
return decomposedColor.values[2] / 100;
|
174
199
|
}
|
175
|
-
|
176
200
|
/**
|
177
201
|
* Darken or lighten a colour, depending on its luminance.
|
178
202
|
* Light colors are darkened, dark colors are lightened.
|
@@ -181,11 +205,12 @@ function getLuminance(color) {
|
|
181
205
|
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1
|
182
206
|
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
183
207
|
*/
|
208
|
+
|
209
|
+
|
184
210
|
function emphasize(color) {
|
185
211
|
var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;
|
186
212
|
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
187
213
|
}
|
188
|
-
|
189
214
|
/**
|
190
215
|
* Set the absolute transparency of a color.
|
191
216
|
* Any existing alpha values are overwritten.
|
@@ -194,18 +219,21 @@ function emphasize(color) {
|
|
194
219
|
* @param {number} value - value to set the alpha channel to in the range 0 -1
|
195
220
|
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
196
221
|
*/
|
222
|
+
|
223
|
+
|
197
224
|
function fade(color, value) {
|
198
225
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(color, "Material-UI: missing color argument in fade(".concat(color, ", ").concat(value, ").")) : void 0;
|
199
226
|
if (!color) return color;
|
200
227
|
color = decomposeColor(color);
|
201
228
|
value = clamp(value);
|
229
|
+
|
202
230
|
if (color.type === 'rgb' || color.type === 'hsl') {
|
203
231
|
color.type += 'a';
|
204
232
|
}
|
233
|
+
|
205
234
|
color.values[3] = value;
|
206
235
|
return recomposeColor(color);
|
207
236
|
}
|
208
|
-
|
209
237
|
/**
|
210
238
|
* Darkens a color.
|
211
239
|
*
|
@@ -213,11 +241,14 @@ function fade(color, value) {
|
|
213
241
|
* @param {number} coefficient - multiplier in the range 0 - 1
|
214
242
|
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
215
243
|
*/
|
244
|
+
|
245
|
+
|
216
246
|
function darken(color, coefficient) {
|
217
247
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(color, "Material-UI: missing color argument in darken(".concat(color, ", ").concat(coefficient, ").")) : void 0;
|
218
248
|
if (!color) return color;
|
219
249
|
color = decomposeColor(color);
|
220
250
|
coefficient = clamp(coefficient);
|
251
|
+
|
221
252
|
if (color.type.indexOf('hsl') !== -1) {
|
222
253
|
color.values[2] *= 1 - coefficient;
|
223
254
|
} else if (color.type.indexOf('rgb') !== -1) {
|
@@ -225,9 +256,9 @@ function darken(color, coefficient) {
|
|
225
256
|
color.values[i] *= 1 - coefficient;
|
226
257
|
}
|
227
258
|
}
|
259
|
+
|
228
260
|
return recomposeColor(color);
|
229
261
|
}
|
230
|
-
|
231
262
|
/**
|
232
263
|
* Lightens a color.
|
233
264
|
*
|
@@ -235,11 +266,14 @@ function darken(color, coefficient) {
|
|
235
266
|
* @param {number} coefficient - multiplier in the range 0 - 1
|
236
267
|
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
237
268
|
*/
|
269
|
+
|
270
|
+
|
238
271
|
function lighten(color, coefficient) {
|
239
272
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(color, "Material-UI: missing color argument in lighten(".concat(color, ", ").concat(coefficient, ").")) : void 0;
|
240
273
|
if (!color) return color;
|
241
274
|
color = decomposeColor(color);
|
242
275
|
coefficient = clamp(coefficient);
|
276
|
+
|
243
277
|
if (color.type.indexOf('hsl') !== -1) {
|
244
278
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
245
279
|
} else if (color.type.indexOf('rgb') !== -1) {
|
@@ -247,5 +281,6 @@ function lighten(color, coefficient) {
|
|
247
281
|
color.values[i] += (255 - color.values[i]) * coefficient;
|
248
282
|
}
|
249
283
|
}
|
284
|
+
|
250
285
|
return recomposeColor(color);
|
251
286
|
}
|
@@ -1,59 +1,74 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.default = createBreakpoints;
|
8
9
|
exports.keys = void 0;
|
10
|
+
|
9
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
12
|
+
|
10
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
14
|
+
|
11
15
|
// Sorted ASC by size. That's important.
|
12
16
|
// It can't be configured as it's used statically for propTypes.
|
13
|
-
var keys =
|
17
|
+
var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.
|
18
|
+
|
19
|
+
exports.keys = keys;
|
14
20
|
|
15
|
-
// Keep in mind that @media is inclusive by the CSS specification.
|
16
21
|
function createBreakpoints(breakpoints) {
|
17
22
|
var _breakpoints$values = breakpoints.values,
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
values = _breakpoints$values === void 0 ? {
|
24
|
+
xs: 0,
|
25
|
+
sm: 600,
|
26
|
+
md: 960,
|
27
|
+
lg: 1280,
|
28
|
+
xl: 1920
|
29
|
+
} : _breakpoints$values,
|
30
|
+
_breakpoints$unit = breakpoints.unit,
|
31
|
+
unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,
|
32
|
+
_breakpoints$step = breakpoints.step,
|
33
|
+
step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,
|
34
|
+
other = (0, _objectWithoutProperties2.default)(breakpoints, ["values", "unit", "step"]);
|
35
|
+
|
30
36
|
function up(key) {
|
31
37
|
var value = typeof values[key] === 'number' ? values[key] : key;
|
32
38
|
return "@media (min-width:".concat(value).concat(unit, ")");
|
33
39
|
}
|
40
|
+
|
34
41
|
function down(key) {
|
35
42
|
var endIndex = keys.indexOf(key) + 1;
|
36
43
|
var upperbound = values[keys[endIndex]];
|
44
|
+
|
37
45
|
if (endIndex === keys.length) {
|
38
46
|
// xl down applies to all sizes
|
39
47
|
return up('xs');
|
40
48
|
}
|
49
|
+
|
41
50
|
var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;
|
42
51
|
return "@media (max-width:".concat(value - step / 100).concat(unit, ")");
|
43
52
|
}
|
53
|
+
|
44
54
|
function between(start, end) {
|
45
55
|
var endIndex = keys.indexOf(end) + 1;
|
56
|
+
|
46
57
|
if (endIndex === keys.length) {
|
47
58
|
return up(start);
|
48
59
|
}
|
60
|
+
|
49
61
|
return "@media (min-width:".concat(values[start]).concat(unit, ") and ") + "(max-width:".concat(values[keys[endIndex]] - step / 100).concat(unit, ")");
|
50
62
|
}
|
63
|
+
|
51
64
|
function only(key) {
|
52
65
|
return between(key, key);
|
53
66
|
}
|
67
|
+
|
54
68
|
function width(key) {
|
55
69
|
return values[key];
|
56
70
|
}
|
71
|
+
|
57
72
|
return (0, _objectSpread2.default)({
|
58
73
|
keys: keys,
|
59
74
|
values: values,
|