@hipay/hipay-material-ui 4.0.0 → 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 +42 -11
- 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 +30 -6
- package/HiBreadcrumb/HiStep.js +45 -13
- package/HiBreadcrumb/HiStepConnector.js +49 -14
- package/HiBreadcrumb/HiStepContent.js +30 -6
- package/HiBreadcrumb/HiStepIcon.js +35 -10
- package/HiBreadcrumb/HiStepLabel.js +44 -14
- package/HiBreadcrumb/HiStepper.js +30 -6
- package/HiBreadcrumb/index.js +2 -0
- package/HiButton/HiButton.js +33 -8
- package/HiButton/index.js +5 -1
- package/HiCell/CellAddress.js +33 -12
- package/HiCell/CellDate.js +36 -10
- package/HiCell/CellHiddenContent.js +30 -8
- package/HiCell/CellIcon.js +36 -12
- package/HiCell/CellImage.js +34 -12
- package/HiCell/CellNumeric.js +40 -13
- package/HiCell/CellPinToAction.js +33 -9
- package/HiCell/CellRate.js +47 -13
- package/HiCell/CellSentinel.js +33 -12
- package/HiCell/CellSentinelScore.js +31 -9
- package/HiCell/CellText.js +52 -16
- package/HiCell/CellTextStyled.js +24 -13
- package/HiCell/index.js +10 -0
- package/HiCheckbox/HiCheckbox.js +52 -15
- package/HiCheckbox/index.js +2 -0
- package/HiChip/HiChip.js +47 -24
- package/HiChip/HiChipSwitch.js +59 -16
- 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 +88 -16
- package/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/HiDatePicker/HiDateRangePicker.js +134 -38
- package/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/HiDatePicker/ListPicker.js +38 -8
- 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 +26 -4
- package/HiDatePicker/Overlays/Overlay.js +25 -8
- package/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- 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 -7
- package/HiDialog/HiDialog.js +19 -7
- package/HiDialog/index.js +2 -0
- package/HiDotsStepper/HiDot.js +37 -8
- package/HiDotsStepper/HiDotsStepper.js +37 -10
- package/HiDotsStepper/index.js +3 -0
- package/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/HiExpansionPanel/index.js +5 -1
- package/HiForm/HiAddressField.js +36 -10
- package/HiForm/HiEmailField.js +29 -5
- package/HiForm/HiFormControl.js +74 -28
- package/HiForm/HiFormLabel.js +41 -15
- package/HiForm/HiInput.js +91 -33
- package/HiForm/HiPasswordField.js +46 -9
- package/HiForm/HiSearchField.js +34 -3
- package/HiForm/HiSlider.js +57 -22
- package/HiForm/HiTextField.js +47 -22
- package/HiForm/HiUpload.js +89 -29
- package/HiForm/HiUploadField.js +32 -10
- package/HiForm/HiUploadInput.js +76 -23
- 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 -7
- package/HiListItemLink/index.js +2 -0
- package/HiLoader/HiLoader.js +16 -6
- package/HiLoader/index.js +2 -0
- package/HiNotice/HiKPI.js +47 -16
- 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 +57 -24
- 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 +42 -32
- package/HiSelect/HiDynamicSelectField.js +48 -24
- package/HiSelect/HiNestedSelect.js +111 -65
- package/HiSelect/HiNestedSelectContent.js +86 -60
- package/HiSelect/HiNestedSelectField.js +48 -24
- package/HiSelect/HiSelect.js +187 -89
- package/HiSelect/HiSelectContent.js +97 -62
- package/HiSelect/HiSelectField.js +49 -25
- package/HiSelect/HiSelectInput.js +76 -23
- package/HiSelect/HiSelectMobile.js +44 -7
- package/HiSelect/HiSuggestSelect.js +81 -25
- package/HiSelect/HiSuggestSelectField.js +39 -15
- package/HiSelect/index.js +14 -2
- package/HiSelectableList/HiSelectableList.js +90 -34
- package/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- 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 +65 -10
- package/HiTable/HiTable.js +48 -20
- package/HiTable/HiTableBody.js +24 -7
- package/HiTable/HiTableHeader.js +51 -18
- package/HiTable/HiTableRow.js +46 -12
- 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 +42 -11
- 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 +30 -6
- package/es/HiBreadcrumb/HiStep.js +45 -13
- package/es/HiBreadcrumb/HiStepConnector.js +49 -14
- package/es/HiBreadcrumb/HiStepContent.js +30 -6
- package/es/HiBreadcrumb/HiStepIcon.js +35 -10
- package/es/HiBreadcrumb/HiStepLabel.js +44 -14
- package/es/HiBreadcrumb/HiStepper.js +30 -6
- 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 +33 -12
- package/es/HiCell/CellDate.js +36 -10
- package/es/HiCell/CellHiddenContent.js +30 -8
- package/es/HiCell/CellIcon.js +36 -12
- package/es/HiCell/CellImage.js +34 -12
- package/es/HiCell/CellNumeric.js +40 -13
- package/es/HiCell/CellPinToAction.js +33 -9
- package/es/HiCell/CellRate.js +47 -13
- package/es/HiCell/CellSentinel.js +33 -12
- package/es/HiCell/CellSentinelScore.js +31 -9
- package/es/HiCell/CellText.js +52 -16
- package/es/HiCell/CellTextStyled.js +24 -13
- package/es/HiCell/index.js +10 -0
- package/es/HiCheckbox/HiCheckbox.js +52 -15
- package/es/HiCheckbox/index.js +2 -0
- package/es/HiChip/HiChip.js +47 -24
- package/es/HiChip/HiChipSwitch.js +59 -16
- 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 +88 -16
- package/es/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/es/HiDatePicker/HiDateRangePicker.js +134 -38
- package/es/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/es/HiDatePicker/ListPicker.js +38 -8
- 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 +26 -4
- package/es/HiDatePicker/Overlays/Overlay.js +25 -8
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- 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 -7
- package/es/HiDialog/HiDialog.js +19 -7
- package/es/HiDialog/index.js +2 -0
- package/es/HiDotsStepper/HiDot.js +37 -8
- package/es/HiDotsStepper/HiDotsStepper.js +37 -10
- 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 +36 -10
- package/es/HiForm/HiEmailField.js +29 -5
- package/es/HiForm/HiFormControl.js +74 -28
- package/es/HiForm/HiFormLabel.js +41 -15
- package/es/HiForm/HiInput.js +91 -33
- package/es/HiForm/HiPasswordField.js +46 -9
- package/es/HiForm/HiSearchField.js +34 -3
- package/es/HiForm/HiSlider.js +57 -22
- package/es/HiForm/HiTextField.js +47 -22
- package/es/HiForm/HiUpload.js +89 -29
- package/es/HiForm/HiUploadField.js +32 -10
- package/es/HiForm/HiUploadInput.js +76 -23
- 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 -7
- 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 +47 -16
- 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 +57 -24
- 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 +42 -32
- package/es/HiSelect/HiDynamicSelectField.js +48 -24
- package/es/HiSelect/HiNestedSelect.js +111 -65
- package/es/HiSelect/HiNestedSelectContent.js +86 -60
- package/es/HiSelect/HiNestedSelectField.js +48 -24
- package/es/HiSelect/HiSelect.js +187 -89
- package/es/HiSelect/HiSelectContent.js +97 -62
- package/es/HiSelect/HiSelectField.js +49 -25
- package/es/HiSelect/HiSelectInput.js +76 -23
- package/es/HiSelect/HiSelectMobile.js +44 -7
- package/es/HiSelect/HiSuggestSelect.js +81 -25
- package/es/HiSelect/HiSuggestSelectField.js +39 -15
- package/es/HiSelect/index.js +14 -2
- package/es/HiSelectableList/HiSelectableList.js +90 -34
- package/es/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- 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 +65 -10
- package/es/HiTable/HiTable.js +48 -20
- package/es/HiTable/HiTableBody.js +24 -7
- package/es/HiTable/HiTableHeader.js +51 -18
- package/es/HiTable/HiTableRow.js +46 -12
- 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 +49 -15
- 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 -67
- package/es/styles/createStyles.js +1 -0
- package/es/styles/createTypography.js +24 -15
- package/es/styles/getStylesCreator.js +14 -1
- 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 +2 -2
- package/setupTest.js +13 -2
- package/styleguide/Wrapper.js +6 -0
- package/styles/MuiThemeProvider.js +49 -15
- 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 -67
- package/styles/createStyles.js +1 -0
- package/styles/createTypography.js +24 -15
- package/styles/getStylesCreator.js +14 -1
- 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,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
|
+
|
13
20
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
21
|
+
|
14
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
23
|
+
|
15
24
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
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
|
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
|
+
|
24
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
|
+
|
25
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,44 +50,55 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
30
50
|
*/
|
31
51
|
var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
32
52
|
(0, _inherits2.default)(MuiThemeProvider, _React$Component);
|
53
|
+
|
33
54
|
var _super = _createSuper(MuiThemeProvider);
|
55
|
+
|
56
|
+
// We are not using the React state in order to avoid unnecessary rerender.
|
34
57
|
function MuiThemeProvider(props, context) {
|
35
58
|
var _this;
|
59
|
+
|
36
60
|
(0, _classCallCheck2.default)(this, MuiThemeProvider);
|
37
|
-
_this = _super.call(this);
|
38
|
-
|
61
|
+
_this = _super.call(this); // Get the outer theme from the context, can be null
|
62
|
+
|
39
63
|
_this.broadcast = (0, _brcast.default)();
|
40
64
|
_this.unsubscribeId = null;
|
41
|
-
// We are not using the React state in order to avoid unnecessary rerender.
|
42
65
|
_this.outerTheme = null;
|
43
|
-
_this.outerTheme = _themeListener.default.initial(context);
|
44
|
-
|
66
|
+
_this.outerTheme = _themeListener.default.initial(context); // Propagate the theme so it can be accessed by the children
|
67
|
+
|
45
68
|
_this.broadcast.setState(_this.mergeOuterLocalTheme(props.theme));
|
69
|
+
|
46
70
|
return _this;
|
47
71
|
}
|
72
|
+
|
48
73
|
(0, _createClass2.default)(MuiThemeProvider, [{
|
49
74
|
key: "getChildContext",
|
50
75
|
value: function getChildContext() {
|
76
|
+
var _ref;
|
77
|
+
|
51
78
|
var _this$props = this.props,
|
52
|
-
|
53
|
-
|
79
|
+
sheetsManager = _this$props.sheetsManager,
|
80
|
+
disableStylesGeneration = _this$props.disableStylesGeneration;
|
54
81
|
var muiThemeProviderOptions = this.context.muiThemeProviderOptions || {};
|
82
|
+
|
55
83
|
if (sheetsManager !== undefined) {
|
56
84
|
muiThemeProviderOptions.sheetsManager = sheetsManager;
|
57
85
|
}
|
86
|
+
|
58
87
|
if (disableStylesGeneration !== undefined) {
|
59
88
|
muiThemeProviderOptions.disableStylesGeneration = disableStylesGeneration;
|
60
89
|
}
|
61
|
-
|
90
|
+
|
91
|
+
return _ref = {}, (0, _defineProperty2.default)(_ref, _themeListener.CHANNEL, this.broadcast), (0, _defineProperty2.default)(_ref, "muiThemeProviderOptions", muiThemeProviderOptions), _ref;
|
62
92
|
}
|
63
93
|
}, {
|
64
94
|
key: "componentDidMount",
|
65
95
|
value: function componentDidMount() {
|
66
96
|
var _this2 = this;
|
97
|
+
|
67
98
|
// Subscribe on the outer theme, if present
|
68
99
|
this.unsubscribeId = _themeListener.default.subscribe(this.context, function (outerTheme) {
|
69
|
-
_this2.outerTheme = outerTheme;
|
70
|
-
|
100
|
+
_this2.outerTheme = outerTheme; // Forward the parent theme update to the children
|
101
|
+
|
71
102
|
_this2.broadcast.setState(_this2.mergeOuterLocalTheme(_this2.props.theme));
|
72
103
|
});
|
73
104
|
}
|
@@ -85,9 +116,8 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
85
116
|
if (this.unsubscribeId !== null) {
|
86
117
|
_themeListener.default.unsubscribe(this.context, this.unsubscribeId);
|
87
118
|
}
|
88
|
-
}
|
119
|
+
} // Simple merge between the outer theme and the local theme
|
89
120
|
|
90
|
-
// Simple merge between the outer theme and the local theme
|
91
121
|
}, {
|
92
122
|
key: "mergeOuterLocalTheme",
|
93
123
|
value: function mergeOuterLocalTheme(localTheme) {
|
@@ -96,9 +126,11 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
96
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;
|
97
127
|
return localTheme(this.outerTheme);
|
98
128
|
}
|
129
|
+
|
99
130
|
if (!this.outerTheme) {
|
100
131
|
return localTheme;
|
101
132
|
}
|
133
|
+
|
102
134
|
return (0, _objectSpread2.default)({}, this.outerTheme, {}, localTheme);
|
103
135
|
}
|
104
136
|
}, {
|
@@ -118,10 +150,12 @@ var MuiThemeProvider = /*#__PURE__*/function (_React$Component) {
|
|
118
150
|
}]);
|
119
151
|
return MuiThemeProvider;
|
120
152
|
}(_react.default.Component);
|
153
|
+
|
121
154
|
MuiThemeProvider.childContextTypes = (0, _objectSpread2.default)({}, _themeListener.default.contextTypes, {
|
122
155
|
muiThemeProviderOptions: _propTypes.default.object
|
123
156
|
});
|
124
157
|
MuiThemeProvider.contextTypes = (0, _objectSpread2.default)({}, _themeListener.default.contextTypes, {
|
125
158
|
muiThemeProviderOptions: _propTypes.default.object
|
126
159
|
});
|
127
|
-
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,
|
@@ -1,76 +1,86 @@
|
|
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 = createGenerateClassName;
|
9
|
+
|
8
10
|
var _warning = _interopRequireDefault(require("warning"));
|
9
|
-
/* eslint-disable no-underscore-dangle */
|
10
11
|
|
12
|
+
/* eslint-disable no-underscore-dangle */
|
11
13
|
// People might bundle this classname generator twice.
|
12
14
|
// We need to use a global.
|
13
15
|
global.__MUI_GENERATOR_COUNTER__ = 0;
|
14
16
|
var escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g;
|
17
|
+
|
15
18
|
function safePrefix(classNamePrefix) {
|
16
19
|
var prefix = String(classNamePrefix);
|
17
|
-
process.env.NODE_ENV !== "production" ? (0, _warning.default)(prefix.length < 256, "Material-UI: the class name prefix is too long: ".concat(prefix, ".")) : void 0;
|
18
|
-
// Sanitize the string as will be used to prefix the generated class name.
|
19
|
-
return prefix.replace(escapeRegex, '-');
|
20
|
-
}
|
20
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(prefix.length < 256, "Material-UI: the class name prefix is too long: ".concat(prefix, ".")) : void 0; // Sanitize the string as will be used to prefix the generated class name.
|
21
21
|
|
22
|
-
|
22
|
+
return prefix.replace(escapeRegex, '-');
|
23
|
+
} // Returns a function which generates unique class names based on counters.
|
23
24
|
// When new generator function is created, rule counter is reset.
|
24
25
|
// We need to reset the rule counter for SSR for each request.
|
25
26
|
//
|
26
27
|
// It's inspired by
|
27
28
|
// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js
|
29
|
+
|
30
|
+
|
28
31
|
function createGenerateClassName() {
|
29
32
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30
33
|
var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
var ruleCounter = 0;
|
35
|
-
|
36
|
-
// - HMR can lead to many class name generators being instantiated,
|
34
|
+
dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,
|
35
|
+
_options$productionPr = options.productionPrefix,
|
36
|
+
productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;
|
37
|
+
var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,
|
37
38
|
// so the warning is only triggered in production.
|
38
39
|
// - We expect a class name generator to be instantiated per new request on the server,
|
39
40
|
// so the warning is only triggered client side.
|
41
|
+
|
40
42
|
if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {
|
41
43
|
global.__MUI_GENERATOR_COUNTER__ += 1;
|
44
|
+
|
42
45
|
if (global.__MUI_GENERATOR_COUNTER__ > 2) {
|
43
46
|
// eslint-disable-next-line no-console
|
44
47
|
console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\n'));
|
45
48
|
}
|
46
49
|
}
|
50
|
+
|
47
51
|
return function (rule, styleSheet) {
|
48
52
|
ruleCounter += 1;
|
49
|
-
process.env.NODE_ENV !== "production" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;
|
53
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.
|
50
54
|
|
51
|
-
// Code branch the whole block at the expense of more code.
|
52
55
|
if (dangerouslyUseGlobalCSS) {
|
53
56
|
if (styleSheet) {
|
54
57
|
if (styleSheet.options.name) {
|
55
58
|
return "".concat(styleSheet.options.name, "-").concat(rule.key);
|
56
59
|
}
|
60
|
+
|
57
61
|
if (styleSheet.options.classNamePrefix && process.env.NODE_ENV !== 'production') {
|
58
62
|
var prefix = safePrefix(styleSheet.options.classNamePrefix);
|
59
63
|
return "".concat(prefix, "-").concat(rule.key, "-").concat(ruleCounter);
|
60
64
|
}
|
61
65
|
}
|
66
|
+
|
62
67
|
if (process.env.NODE_ENV === 'production') {
|
63
68
|
return "".concat(productionPrefix).concat(ruleCounter);
|
64
69
|
}
|
70
|
+
|
65
71
|
return "".concat(rule.key, "-").concat(ruleCounter);
|
66
72
|
}
|
73
|
+
|
67
74
|
if (process.env.NODE_ENV === 'production') {
|
68
75
|
return "".concat(productionPrefix).concat(ruleCounter);
|
69
76
|
}
|
77
|
+
|
70
78
|
if (styleSheet && styleSheet.options.classNamePrefix) {
|
71
79
|
var _prefix = safePrefix(styleSheet.options.classNamePrefix);
|
80
|
+
|
72
81
|
return "".concat(_prefix, "-").concat(rule.key, "-").concat(ruleCounter);
|
73
82
|
}
|
83
|
+
|
74
84
|
return "".concat(rule.key, "-").concat(ruleCounter);
|
75
85
|
};
|
76
86
|
}
|
package/styles/createMixins.js
CHANGED
@@ -1,13 +1,19 @@
|
|
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 = createMixins;
|
9
|
+
|
8
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
11
|
+
|
9
12
|
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
13
|
+
|
10
14
|
function createMixins(breakpoints, spacing, mixins) {
|
15
|
+
var _toolbar;
|
16
|
+
|
11
17
|
return (0, _objectSpread3.default)({
|
12
18
|
gutters: function gutters() {
|
13
19
|
var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -19,12 +25,12 @@ function createMixins(breakpoints, spacing, mixins) {
|
|
19
25
|
paddingRight: spacing(6)
|
20
26
|
}, styles[breakpoints.up('sm')])));
|
21
27
|
},
|
22
|
-
toolbar: (
|
28
|
+
toolbar: (_toolbar = {
|
23
29
|
minHeight: 56
|
24
|
-
}, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
|
30
|
+
}, (0, _defineProperty2.default)(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
|
25
31
|
minHeight: 48
|
26
|
-
}), breakpoints.up('sm'), {
|
32
|
+
}), (0, _defineProperty2.default)(_toolbar, breakpoints.up('sm'), {
|
27
33
|
minHeight: 64
|
28
|
-
})
|
34
|
+
}), _toolbar)
|
29
35
|
}, mixins);
|
30
36
|
}
|