@hipay/hipay-material-ui 2.3.1-rc3 → 2.3.1-rc4
Sign up to get free protection for your applications and to get access to all the features.
- package/App.test.js +8 -0
- package/HiAlertModal/HiAlertModal.js +48 -77
- package/HiAlertModal/HiAlertModal.test.js +189 -0
- package/HiAlertModal/index.js +1 -15
- package/HiAppBar/HiAppBar.js +34 -63
- package/HiAppBar/index.js +1 -15
- package/HiBadge/HiBadge.js +10 -29
- package/HiBadge/HiBadge.test.js +49 -0
- package/HiBadge/index.js +1 -15
- package/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/HiBreadcrumb/HiStep.js +35 -57
- package/HiBreadcrumb/HiStep.test.js +47 -0
- package/HiBreadcrumb/HiStepConnector.js +32 -57
- package/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/HiBreadcrumb/HiStepContent.js +25 -46
- package/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/HiBreadcrumb/HiStepIcon.js +26 -46
- package/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/HiBreadcrumb/HiStepLabel.js +36 -61
- package/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/HiBreadcrumb/HiStepper.js +23 -45
- package/HiBreadcrumb/HiStepper.test.js +33 -0
- package/HiBreadcrumb/index.js +1 -15
- package/HiButton/HiButton.js +9 -27
- package/HiButton/index.js +2 -13
- package/HiCell/CellAddress.js +20 -40
- package/HiCell/CellAddress.test.js +75 -0
- package/HiCell/CellDate.js +26 -47
- package/HiCell/CellDate.test.js +173 -0
- package/HiCell/CellIcon.js +28 -49
- package/HiCell/CellIcon.test.js +57 -0
- package/HiCell/CellImage.js +23 -42
- package/HiCell/CellImage.test.js +49 -0
- package/HiCell/CellNumeric.js +25 -46
- package/HiCell/CellNumeric.test.js +46 -0
- package/HiCell/CellPinToAction.js +20 -41
- package/HiCell/CellRate.js +32 -55
- package/HiCell/CellRate.test.js +73 -0
- package/HiCell/CellSentinel.js +22 -42
- package/HiCell/CellSentinel.test.js +48 -0
- package/HiCell/CellSentinelScore.js +23 -44
- package/HiCell/CellText.js +37 -56
- package/HiCell/CellText.test.js +76 -0
- package/HiCell/CellTextStyled.js +8 -21
- package/HiCell/index.js +9 -79
- package/HiCheckbox/HiCheckbox.js +35 -60
- package/HiCheckbox/HiCheckbox.test.js +55 -0
- package/HiCheckbox/index.js +1 -15
- package/HiChip/HiChip.js +24 -44
- package/HiChip/HiChip.test.js +136 -0
- package/HiChip/HiChipSwitch.js +47 -70
- package/HiChip/HiChipSwitch.test.js +99 -0
- package/HiChip/index.js +2 -23
- package/HiColoredLabel/HiColoredLabel.js +28 -52
- package/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/HiColoredLabel/index.js +1 -15
- package/HiDatePicker/Caption.js +11 -28
- package/HiDatePicker/Caption.test.js +65 -0
- package/HiDatePicker/HiDatePicker.js +100 -115
- package/HiDatePicker/HiDatePicker.test.js +370 -0
- package/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/HiDatePicker/HiDateRangePicker.js +138 -149
- package/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/HiDatePicker/ListPicker.js +33 -55
- package/HiDatePicker/ListPicker.test.js +53 -0
- package/HiDatePicker/NavBar.js +18 -45
- package/HiDatePicker/NavBar.test.js +39 -0
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/HiDatePicker/Overlays/Overlay.js +18 -35
- package/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/HiDatePicker/Overlays/index.js +5 -47
- package/HiDatePicker/Weekday.js +3 -13
- package/HiDatePicker/hiLocaleUtils.js +1 -8
- package/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/HiDatePicker/index.js +1 -15
- package/HiDatePicker/stylesheet.js +9 -22
- package/HiDotsStepper/HiDot.js +30 -57
- package/HiDotsStepper/HiDot.test.js +55 -0
- package/HiDotsStepper/HiDotsStepper.js +29 -47
- package/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/HiDotsStepper/index.js +2 -23
- package/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/HiExpansionPanel/index.js +2 -13
- package/HiForm/HiAddressField.js +30 -47
- package/HiForm/HiAddressField.test.js +79 -0
- package/HiForm/HiEmailField.js +28 -46
- package/HiForm/HiEmailField.test.js +19 -0
- package/HiForm/HiFormControl.js +72 -100
- package/HiForm/HiFormControl.test.js +195 -0
- package/HiForm/HiFormLabel.js +29 -54
- package/HiForm/HiFormLabel.test.js +66 -0
- package/HiForm/HiInput.js +62 -86
- package/HiForm/HiInput.test.js +202 -0
- package/HiForm/HiPasswordField.js +29 -55
- package/HiForm/HiPasswordField.test.js +60 -0
- package/HiForm/HiSearchField.js +27 -44
- package/HiForm/HiSearchField.test.js +193 -0
- package/HiForm/HiSlider.js +42 -64
- package/HiForm/HiSlider.test.js +99 -0
- package/HiForm/HiTextField.js +29 -46
- package/HiForm/HiTextField.test.js +254 -0
- package/HiForm/HiUpload.js +54 -70
- package/HiForm/HiUpload.test.js +241 -0
- package/HiForm/HiUploadField.js +24 -41
- package/HiForm/HiUploadField.test.js +55 -0
- package/HiForm/HiUploadInput.js +56 -77
- package/HiForm/HiUploadInput.test.js +148 -0
- package/HiForm/index.js +11 -95
- package/HiIcon/HiIcon.js +22 -44
- package/HiIcon/index.js +1 -15
- package/HiIconButton/HiIconButton.js +18 -40
- package/HiIconButton/HiIconButton.test.js +69 -0
- package/HiIconButton/index.js +1 -15
- package/HiLoader/HiLoader.js +9 -24
- package/HiLoader/HiLoader.test.js +18 -0
- package/HiLoader/index.js +1 -15
- package/HiMap/HiMap.js +50 -77
- package/HiMap/HiMap.test.js +29 -0
- package/HiMap/HiMapExpand.js +39 -64
- package/HiMap/HiMapExpand.test.js +48 -0
- package/HiMap/index.js +2 -23
- package/HiNotice/HiKPI.js +33 -54
- package/HiNotice/HiKPI.test.js +171 -0
- package/HiNotice/HiKPINotice.js +7 -21
- package/HiNotice/HiKPINotice.test.js +88 -0
- package/HiNotice/index.js +2 -23
- package/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/HiPaymentMeans/index.js +1 -15
- package/HiPdfReader/HiPdfReader.js +51 -76
- package/HiPdfReader/index.js +1 -15
- package/HiPin/HiPin.js +9 -30
- package/HiPin/HiPin.test.js +61 -0
- package/HiPin/index.js +1 -15
- package/HiRadio/HiRadio.js +7 -24
- package/HiRadio/HiRadio.test.js +57 -0
- package/HiRadio/index.js +1 -15
- package/HiSelect/HiDynamicSelect.js +40 -56
- package/HiSelect/HiDynamicSelectField.js +22 -40
- package/HiSelect/HiNestedSelect.js +55 -84
- package/HiSelect/HiNestedSelectContent.js +46 -73
- package/HiSelect/HiNestedSelectField.js +22 -40
- package/HiSelect/HiSelect.js +123 -139
- package/HiSelect/HiSelect.test.js +1092 -0
- package/HiSelect/HiSelectContent.js +73 -95
- package/HiSelect/HiSelectField.js +22 -40
- package/HiSelect/HiSelectInput.js +63 -87
- package/HiSelect/HiSelectInput.test.js +21 -0
- package/HiSelect/HiSelectMobile.js +35 -54
- package/HiSelect/HiSuggestSelect.js +56 -78
- package/HiSelect/HiSuggestSelectField.js +22 -40
- package/HiSelect/index.js +8 -85
- package/HiSelectableList/HiSelectableList.js +49 -77
- package/HiSelectableList/HiSelectableList.test.js +173 -0
- package/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/HiSelectableList/HiSelectableListItem.js +66 -98
- package/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/HiSelectableList/index.js +3 -31
- package/HiSwitch/HiSwitch.js +20 -45
- package/HiSwitch/HiSwitch.test.js +41 -0
- package/HiSwitch/HiSwitchState.js +15 -36
- package/HiSwitch/HiSwitchState.test.js +76 -0
- package/HiSwitch/index.js +2 -23
- package/HiTable/HiCellBuilder.js +44 -72
- package/HiTable/HiTable.js +29 -47
- package/HiTable/HiTable.test.js +29 -0
- package/HiTable/HiTableBody.js +19 -34
- package/HiTable/HiTableHeader.js +30 -53
- package/HiTable/HiTableRow.js +29 -56
- package/HiTable/constants.js +43 -94
- package/HiTable/index.js +1 -15
- package/es/App.test.js +8 -0
- package/es/HiAlertModal/HiAlertModal.js +48 -77
- package/es/HiAlertModal/HiAlertModal.test.js +189 -0
- package/es/HiAlertModal/index.js +1 -15
- package/es/HiAppBar/HiAppBar.js +34 -63
- package/es/HiAppBar/index.js +1 -15
- package/es/HiBadge/HiBadge.js +10 -29
- package/es/HiBadge/HiBadge.test.js +49 -0
- package/es/HiBadge/index.js +1 -15
- package/es/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/es/HiBreadcrumb/HiStep.js +35 -57
- package/es/HiBreadcrumb/HiStep.test.js +47 -0
- package/es/HiBreadcrumb/HiStepConnector.js +32 -57
- package/es/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/es/HiBreadcrumb/HiStepContent.js +25 -46
- package/es/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/es/HiBreadcrumb/HiStepIcon.js +26 -46
- package/es/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/es/HiBreadcrumb/HiStepLabel.js +36 -61
- package/es/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/es/HiBreadcrumb/HiStepper.js +23 -45
- package/es/HiBreadcrumb/HiStepper.test.js +33 -0
- package/es/HiBreadcrumb/index.js +1 -15
- package/es/HiButton/HiButton.js +9 -27
- package/es/HiButton/index.js +2 -13
- package/es/HiCell/CellAddress.js +20 -40
- package/es/HiCell/CellAddress.test.js +75 -0
- package/es/HiCell/CellDate.js +26 -47
- package/es/HiCell/CellDate.test.js +173 -0
- package/es/HiCell/CellIcon.js +28 -49
- package/es/HiCell/CellIcon.test.js +57 -0
- package/es/HiCell/CellImage.js +23 -42
- package/es/HiCell/CellImage.test.js +49 -0
- package/es/HiCell/CellNumeric.js +25 -46
- package/es/HiCell/CellNumeric.test.js +46 -0
- package/es/HiCell/CellPinToAction.js +20 -41
- package/es/HiCell/CellRate.js +32 -55
- package/es/HiCell/CellRate.test.js +73 -0
- package/es/HiCell/CellSentinel.js +22 -42
- package/es/HiCell/CellSentinel.test.js +48 -0
- package/es/HiCell/CellSentinelScore.js +23 -44
- package/es/HiCell/CellText.js +37 -56
- package/es/HiCell/CellText.test.js +76 -0
- package/es/HiCell/CellTextStyled.js +8 -21
- package/es/HiCell/index.js +9 -79
- package/es/HiCheckbox/HiCheckbox.js +35 -60
- package/es/HiCheckbox/HiCheckbox.test.js +55 -0
- package/es/HiCheckbox/index.js +1 -15
- package/es/HiChip/HiChip.js +24 -44
- package/es/HiChip/HiChip.test.js +136 -0
- package/es/HiChip/HiChipSwitch.js +47 -70
- package/es/HiChip/HiChipSwitch.test.js +99 -0
- package/es/HiChip/index.js +2 -23
- package/es/HiColoredLabel/HiColoredLabel.js +28 -52
- package/es/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/es/HiColoredLabel/index.js +1 -15
- package/es/HiDatePicker/Caption.js +11 -28
- package/es/HiDatePicker/Caption.test.js +65 -0
- package/es/HiDatePicker/HiDatePicker.js +100 -115
- package/es/HiDatePicker/HiDatePicker.test.js +370 -0
- package/es/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/es/HiDatePicker/HiDateRangePicker.js +138 -149
- package/es/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/es/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/es/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/es/HiDatePicker/ListPicker.js +33 -55
- package/es/HiDatePicker/ListPicker.test.js +53 -0
- package/es/HiDatePicker/NavBar.js +18 -45
- package/es/HiDatePicker/NavBar.test.js +39 -0
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/es/HiDatePicker/Overlays/Overlay.js +18 -35
- package/es/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/es/HiDatePicker/Overlays/index.js +5 -47
- package/es/HiDatePicker/Weekday.js +3 -13
- package/es/HiDatePicker/hiLocaleUtils.js +1 -8
- package/es/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/es/HiDatePicker/index.js +1 -15
- package/es/HiDatePicker/stylesheet.js +9 -22
- package/es/HiDotsStepper/HiDot.js +30 -57
- package/es/HiDotsStepper/HiDot.test.js +55 -0
- package/es/HiDotsStepper/HiDotsStepper.js +29 -47
- package/es/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/es/HiDotsStepper/index.js +2 -23
- package/es/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/es/HiExpansionPanel/index.js +2 -13
- package/es/HiForm/HiAddressField.js +30 -47
- package/es/HiForm/HiAddressField.test.js +79 -0
- package/es/HiForm/HiEmailField.js +28 -46
- package/es/HiForm/HiEmailField.test.js +19 -0
- package/es/HiForm/HiFormControl.js +72 -100
- package/es/HiForm/HiFormControl.test.js +195 -0
- package/es/HiForm/HiFormLabel.js +29 -54
- package/es/HiForm/HiFormLabel.test.js +66 -0
- package/es/HiForm/HiInput.js +62 -86
- package/es/HiForm/HiInput.test.js +202 -0
- package/es/HiForm/HiPasswordField.js +29 -55
- package/es/HiForm/HiPasswordField.test.js +60 -0
- package/es/HiForm/HiSearchField.js +27 -44
- package/es/HiForm/HiSearchField.test.js +193 -0
- package/es/HiForm/HiSlider.js +42 -64
- package/es/HiForm/HiSlider.test.js +99 -0
- package/es/HiForm/HiTextField.js +29 -46
- package/es/HiForm/HiTextField.test.js +254 -0
- package/es/HiForm/HiUpload.js +54 -70
- package/es/HiForm/HiUpload.test.js +241 -0
- package/es/HiForm/HiUploadField.js +24 -41
- package/es/HiForm/HiUploadField.test.js +55 -0
- package/es/HiForm/HiUploadInput.js +56 -77
- package/es/HiForm/HiUploadInput.test.js +148 -0
- package/es/HiForm/index.js +11 -95
- package/es/HiIcon/HiIcon.js +22 -44
- package/es/HiIcon/index.js +1 -15
- package/es/HiIconButton/HiIconButton.js +18 -40
- package/es/HiIconButton/HiIconButton.test.js +69 -0
- package/es/HiIconButton/index.js +1 -15
- package/es/HiLoader/HiLoader.js +9 -24
- package/es/HiLoader/HiLoader.test.js +18 -0
- package/es/HiLoader/index.js +1 -15
- package/es/HiMap/HiMap.js +50 -77
- package/es/HiMap/HiMap.test.js +29 -0
- package/es/HiMap/HiMapExpand.js +39 -64
- package/es/HiMap/HiMapExpand.test.js +48 -0
- package/es/HiMap/index.js +2 -23
- package/es/HiNotice/HiKPI.js +33 -54
- package/es/HiNotice/HiKPI.test.js +171 -0
- package/es/HiNotice/HiKPINotice.js +7 -21
- package/es/HiNotice/HiKPINotice.test.js +88 -0
- package/es/HiNotice/index.js +2 -23
- package/es/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/es/HiPaymentMeans/index.js +1 -15
- package/es/HiPdfReader/HiPdfReader.js +51 -76
- package/es/HiPdfReader/index.js +1 -15
- package/es/HiPin/HiPin.js +9 -30
- package/es/HiPin/HiPin.test.js +61 -0
- package/es/HiPin/index.js +1 -15
- package/es/HiRadio/HiRadio.js +7 -24
- package/es/HiRadio/HiRadio.test.js +57 -0
- package/es/HiRadio/index.js +1 -15
- package/es/HiSelect/HiDynamicSelect.js +40 -56
- package/es/HiSelect/HiDynamicSelectField.js +22 -40
- package/es/HiSelect/HiNestedSelect.js +55 -84
- package/es/HiSelect/HiNestedSelectContent.js +46 -73
- package/es/HiSelect/HiNestedSelectField.js +22 -40
- package/es/HiSelect/HiSelect.js +123 -139
- package/es/HiSelect/HiSelect.test.js +1092 -0
- package/es/HiSelect/HiSelectContent.js +73 -95
- package/es/HiSelect/HiSelectField.js +22 -40
- package/es/HiSelect/HiSelectInput.js +63 -87
- package/es/HiSelect/HiSelectInput.test.js +21 -0
- package/es/HiSelect/HiSelectMobile.js +35 -54
- package/es/HiSelect/HiSuggestSelect.js +56 -78
- package/es/HiSelect/HiSuggestSelectField.js +22 -40
- package/es/HiSelect/index.js +8 -85
- package/es/HiSelectableList/HiSelectableList.js +49 -77
- package/es/HiSelectableList/HiSelectableList.test.js +173 -0
- package/es/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/es/HiSelectableList/HiSelectableListItem.js +66 -98
- package/es/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/es/HiSelectableList/index.js +3 -31
- package/es/HiSwitch/HiSwitch.js +20 -45
- package/es/HiSwitch/HiSwitch.test.js +41 -0
- package/es/HiSwitch/HiSwitchState.js +15 -36
- package/es/HiSwitch/HiSwitchState.test.js +76 -0
- package/es/HiSwitch/index.js +2 -23
- package/es/HiTable/HiCellBuilder.js +44 -72
- package/es/HiTable/HiTable.js +29 -47
- package/es/HiTable/HiTable.test.js +29 -0
- package/es/HiTable/HiTableBody.js +19 -34
- package/es/HiTable/HiTableHeader.js +30 -53
- package/es/HiTable/HiTableRow.js +29 -56
- package/es/HiTable/constants.js +43 -94
- package/es/HiTable/index.js +1 -15
- package/es/hi-svg-icons/HiAccount.js +18 -36
- package/es/hi-svg-icons/HiActivity.js +17 -35
- package/es/hi-svg-icons/HiAll.js +22 -42
- package/es/hi-svg-icons/HiBilling.js +18 -36
- package/es/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/es/hi-svg-icons/HiCatalog.js +18 -36
- package/es/hi-svg-icons/HiCustomer.js +18 -36
- package/es/hi-svg-icons/HiDownload.js +11 -25
- package/es/hi-svg-icons/HiFinance.js +18 -36
- package/es/hi-svg-icons/HiPermission.js +17 -35
- package/es/hi-svg-icons/HiRoute.js +18 -36
- package/es/hi-svg-icons/HiSettlement.js +18 -36
- package/es/hi-svg-icons/HiSizeLarge.js +12 -27
- package/es/hi-svg-icons/HiSizeMedium.js +11 -25
- package/es/hi-svg-icons/HiSizeSmall.js +11 -25
- package/es/hi-svg-icons/HiTransaction.js +18 -36
- package/es/hi-svg-icons/HiUser.js +18 -36
- package/es/hi-svg-icons/HiWidget.js +22 -42
- package/es/hi-svg-icons/index.js +18 -151
- package/es/hi-svg-icons/index.text.js +11 -21
- package/es/styleguide/Wrapper.js +19 -36
- package/es/styles/MuiThemeProvider.js +39 -59
- package/es/styles/colorManipulator.js +16 -44
- package/es/styles/colorManipulator.test.js +242 -0
- package/es/styles/createBreakpoints.js +6 -20
- package/es/styles/createBreakpoints.test.js +48 -0
- package/es/styles/createGenerateClassName.js +5 -15
- package/es/styles/createGenerateClassName.test.js +141 -0
- package/es/styles/createMixins.js +8 -19
- package/es/styles/createMixins.test.js +24 -0
- package/es/styles/createMuiTheme.js +34 -53
- package/es/styles/createMuiTheme.test.js +67 -0
- package/es/styles/createPalette.js +30 -50
- package/es/styles/createPalette.test.js +159 -0
- package/es/styles/createStyles.js +1 -8
- package/es/styles/createStyles.test.js +8 -0
- package/es/styles/createTypography.js +18 -30
- package/es/styles/createTypography.test.js +60 -0
- package/es/styles/getStylesCreator.js +11 -24
- package/es/styles/getStylesCreator.test.js +92 -0
- package/es/styles/getThemeProps.js +1 -9
- package/es/styles/getThemeProps.test.js +39 -0
- package/es/styles/index.js +5 -47
- package/es/styles/jssPreset.js +9 -25
- package/es/styles/mergeClasses.js +7 -19
- package/es/styles/shadows.js +1 -8
- package/es/styles/shape.js +1 -8
- package/es/styles/spacing.js +1 -9
- package/es/styles/themeListener.js +5 -18
- package/es/styles/themeListener.test.js +26 -0
- package/es/styles/transitions.js +18 -38
- package/es/styles/transitions.test.js +208 -0
- package/es/styles/zIndex.js +1 -8
- package/es/test-utils/createMount.js +11 -22
- package/es/test-utils/createRender.js +8 -19
- package/es/test-utils/createShallow.js +13 -23
- package/es/test-utils/getClasses.js +2 -11
- package/es/test-utils/index.js +5 -47
- package/es/test-utils/until.js +6 -16
- package/es/test-utils/until.test.js +157 -0
- package/es/test-utils/unwrap.js +1 -8
- package/es/theme/palette.js +2 -10
- package/es/theme/typography.js +2 -10
- package/es/theme.js +2 -11
- package/es/transitions/utils.js +2 -13
- package/es/utils/exactProp.js +5 -18
- package/es/utils/helpers.js +18 -55
- package/es/withMobileDialog/index.js +1 -15
- package/es/withMobileDialog/withMobileDialog.js +7 -22
- package/es/withMobileDialog/withMobileDialog.test.js +67 -0
- package/hi-svg-icons/HiAccount.js +18 -36
- package/hi-svg-icons/HiActivity.js +17 -35
- package/hi-svg-icons/HiAll.js +22 -42
- package/hi-svg-icons/HiBilling.js +18 -36
- package/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/hi-svg-icons/HiCatalog.js +18 -36
- package/hi-svg-icons/HiCustomer.js +18 -36
- package/hi-svg-icons/HiDownload.js +11 -25
- package/hi-svg-icons/HiFinance.js +18 -36
- package/hi-svg-icons/HiPermission.js +17 -35
- package/hi-svg-icons/HiRoute.js +18 -36
- package/hi-svg-icons/HiSettlement.js +18 -36
- package/hi-svg-icons/HiSizeLarge.js +12 -27
- package/hi-svg-icons/HiSizeMedium.js +11 -25
- package/hi-svg-icons/HiSizeSmall.js +11 -25
- package/hi-svg-icons/HiTransaction.js +18 -36
- package/hi-svg-icons/HiUser.js +18 -36
- package/hi-svg-icons/HiWidget.js +22 -42
- package/hi-svg-icons/index.js +18 -151
- package/hi-svg-icons/index.text.js +11 -21
- package/package.json +1 -1
- package/styleguide/Wrapper.js +19 -36
- package/styles/MuiThemeProvider.js +39 -59
- package/styles/colorManipulator.js +16 -44
- package/styles/colorManipulator.test.js +242 -0
- package/styles/createBreakpoints.js +6 -20
- package/styles/createBreakpoints.test.js +48 -0
- package/styles/createGenerateClassName.js +5 -15
- package/styles/createGenerateClassName.test.js +141 -0
- package/styles/createMixins.js +8 -19
- package/styles/createMixins.test.js +24 -0
- package/styles/createMuiTheme.js +34 -53
- package/styles/createMuiTheme.test.js +67 -0
- package/styles/createPalette.js +30 -50
- package/styles/createPalette.test.js +159 -0
- package/styles/createStyles.js +1 -8
- package/styles/createStyles.test.js +8 -0
- package/styles/createTypography.js +18 -30
- package/styles/createTypography.test.js +60 -0
- package/styles/getStylesCreator.js +11 -24
- package/styles/getStylesCreator.test.js +92 -0
- package/styles/getThemeProps.js +1 -9
- package/styles/getThemeProps.test.js +39 -0
- package/styles/index.js +5 -47
- package/styles/jssPreset.js +9 -25
- package/styles/mergeClasses.js +7 -19
- package/styles/shadows.js +1 -8
- package/styles/shape.js +1 -8
- package/styles/spacing.js +1 -9
- package/styles/themeListener.js +5 -18
- package/styles/themeListener.test.js +26 -0
- package/styles/transitions.js +18 -38
- package/styles/transitions.test.js +208 -0
- package/styles/zIndex.js +1 -8
- package/test-utils/createMount.js +11 -22
- package/test-utils/createRender.js +8 -19
- package/test-utils/createShallow.js +13 -23
- package/test-utils/getClasses.js +2 -11
- package/test-utils/index.js +5 -47
- package/test-utils/until.js +6 -16
- package/test-utils/until.test.js +157 -0
- package/test-utils/unwrap.js +1 -8
- package/theme/palette.js +2 -10
- package/theme/typography.js +2 -10
- package/theme.js +2 -11
- package/transitions/utils.js +2 -13
- package/utils/exactProp.js +5 -18
- package/utils/helpers.js +18 -55
- package/withMobileDialog/index.js +1 -15
- package/withMobileDialog/withMobileDialog.js +7 -22
- package/withMobileDialog/withMobileDialog.test.js +67 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { assert } from 'chai';
|
3
|
+
import { spy } from 'sinon';
|
4
|
+
import { createMount } from '../test-utils';
|
5
|
+
import HiUploadInput from './HiUploadInput';
|
6
|
+
import HiIconButton from '../HiIconButton';
|
7
|
+
describe('<HiUploadInput />', function () {
|
8
|
+
var mount;
|
9
|
+
var fakePdf;
|
10
|
+
var seeFile;
|
11
|
+
before(function () {
|
12
|
+
fakePdf = {
|
13
|
+
name: 'fakefile.pdf',
|
14
|
+
size: 32,
|
15
|
+
type: 'application/pdf'
|
16
|
+
};
|
17
|
+
seeFile = true;
|
18
|
+
});
|
19
|
+
beforeEach(function () {
|
20
|
+
mount = createMount();
|
21
|
+
});
|
22
|
+
afterEach(function () {
|
23
|
+
mount.cleanUp();
|
24
|
+
});
|
25
|
+
it('should render an <input> with type file inside a <label> inside a <div>', function () {
|
26
|
+
var defaultPlaceholder = 'default placeholder';
|
27
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
28
|
+
placeholder: defaultPlaceholder
|
29
|
+
}));
|
30
|
+
var label = wrapper.find('label');
|
31
|
+
assert.strictEqual(label.name(), 'label', 'should render a label');
|
32
|
+
assert.strictEqual(label.text(), defaultPlaceholder, 'should be the placeholder passed in props');
|
33
|
+
var input = label.find('input');
|
34
|
+
assert.strictEqual(input.name(), 'input', 'should contain an input');
|
35
|
+
assert.strictEqual(input.prop('type'), 'file', 'should be a file input');
|
36
|
+
});
|
37
|
+
it('should not show the clear and see buttons when no value is given', function () {
|
38
|
+
var wrapper = mount(React.createElement(HiUploadInput, null));
|
39
|
+
assert.strictEqual(wrapper.find(HiIconButton).length, 0, 'should not have icons');
|
40
|
+
});
|
41
|
+
it('should show the clear and see buttons when a value is given', function () {
|
42
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
43
|
+
value: fakePdf,
|
44
|
+
seeFile: seeFile
|
45
|
+
}));
|
46
|
+
assert.strictEqual(wrapper.find(HiIconButton).length, 2, 'should have the clear and see icons');
|
47
|
+
});
|
48
|
+
it('should show the clear button when a value is given', function () {
|
49
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
50
|
+
value: fakePdf
|
51
|
+
}));
|
52
|
+
assert.strictEqual(wrapper.find(HiIconButton).length, 1, 'should have the clear icon');
|
53
|
+
});
|
54
|
+
it('should fire onChange event callbacks', function () {
|
55
|
+
var handleChange = spy();
|
56
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
57
|
+
onChange: handleChange,
|
58
|
+
index: 1
|
59
|
+
}));
|
60
|
+
wrapper.find('input').simulate('change', {
|
61
|
+
target: {
|
62
|
+
files: [fakePdf]
|
63
|
+
}
|
64
|
+
});
|
65
|
+
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
66
|
+
assert.strictEqual(handleChange.calledWith({
|
67
|
+
errorMessage: '',
|
68
|
+
error: false,
|
69
|
+
value: fakePdf
|
70
|
+
}, 1), true, 'should have been called with the fakePdf file.');
|
71
|
+
});
|
72
|
+
it('should fire onDeleteFile event callbacks', function () {
|
73
|
+
var handleDeleteFile = spy();
|
74
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
75
|
+
onDeleteFile: handleDeleteFile,
|
76
|
+
value: fakePdf,
|
77
|
+
index: 1
|
78
|
+
}));
|
79
|
+
wrapper.find(HiIconButton).at(0).simulate('click');
|
80
|
+
assert.strictEqual(handleDeleteFile.calledOnce, true, 'should have been called once.');
|
81
|
+
assert.strictEqual(handleDeleteFile.calledWith(1), true, 'should have been called with the index of this HiUploadInput.');
|
82
|
+
});
|
83
|
+
it('should fire onSee event callbacks', function () {
|
84
|
+
var handleSee = spy();
|
85
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
86
|
+
onSeeFile: handleSee,
|
87
|
+
value: fakePdf,
|
88
|
+
index: 1,
|
89
|
+
seeFile: seeFile
|
90
|
+
}));
|
91
|
+
wrapper.find(HiIconButton).at(0).simulate('click');
|
92
|
+
assert.strictEqual(handleSee.calledOnce, true, 'should have been called once.');
|
93
|
+
assert.strictEqual(handleSee.calledWith(fakePdf), true, 'should have been called with the file to see.');
|
94
|
+
});
|
95
|
+
it('should fire onChange event callbacks with a size error', function () {
|
96
|
+
var handleChange = spy();
|
97
|
+
var translations = {
|
98
|
+
errorSize: 'error size'
|
99
|
+
};
|
100
|
+
var fakeLargeFile = {
|
101
|
+
name: 'fakelargefile.pdf',
|
102
|
+
size: 4096,
|
103
|
+
type: 'application/pdf'
|
104
|
+
};
|
105
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
106
|
+
onChange: handleChange,
|
107
|
+
value: fakeLargeFile,
|
108
|
+
maxSize: 2048,
|
109
|
+
index: 1,
|
110
|
+
translations: translations
|
111
|
+
}));
|
112
|
+
wrapper.find('input').simulate('change', {
|
113
|
+
target: {
|
114
|
+
files: [fakeLargeFile]
|
115
|
+
}
|
116
|
+
});
|
117
|
+
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
118
|
+
assert.strictEqual(handleChange.calledWith({
|
119
|
+
errorMessage: translations.errorSize,
|
120
|
+
error: true,
|
121
|
+
value: fakeLargeFile
|
122
|
+
}, 1), true, 'should be on error with errorSize message');
|
123
|
+
});
|
124
|
+
it('should fire onChange event callbacks with a type error', function () {
|
125
|
+
var handleChange = spy();
|
126
|
+
var translations = {
|
127
|
+
errorType: 'error type'
|
128
|
+
};
|
129
|
+
var wrapper = mount(React.createElement(HiUploadInput, {
|
130
|
+
onChange: handleChange,
|
131
|
+
value: fakePdf,
|
132
|
+
acceptedTypes: ['image/jpeg', 'video/mp4'],
|
133
|
+
index: 1,
|
134
|
+
translations: translations
|
135
|
+
}));
|
136
|
+
wrapper.find('input').simulate('change', {
|
137
|
+
target: {
|
138
|
+
files: [fakePdf]
|
139
|
+
}
|
140
|
+
});
|
141
|
+
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
142
|
+
assert.strictEqual(handleChange.calledWith({
|
143
|
+
errorMessage: translations.errorType,
|
144
|
+
error: true,
|
145
|
+
value: fakePdf
|
146
|
+
}, 1), true, 'should be on error with errorType message');
|
147
|
+
});
|
148
|
+
});
|
package/es/HiForm/index.js
CHANGED
@@ -1,95 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "HiEmailField", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _HiEmailField.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
Object.defineProperty(exports, "HiFormControl", {
|
21
|
-
enumerable: true,
|
22
|
-
get: function get() {
|
23
|
-
return _HiFormControl.default;
|
24
|
-
}
|
25
|
-
});
|
26
|
-
Object.defineProperty(exports, "HiFormLabel", {
|
27
|
-
enumerable: true,
|
28
|
-
get: function get() {
|
29
|
-
return _HiFormLabel.default;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
Object.defineProperty(exports, "HiInput", {
|
33
|
-
enumerable: true,
|
34
|
-
get: function get() {
|
35
|
-
return _HiInput.default;
|
36
|
-
}
|
37
|
-
});
|
38
|
-
Object.defineProperty(exports, "HiPasswordField", {
|
39
|
-
enumerable: true,
|
40
|
-
get: function get() {
|
41
|
-
return _HiPasswordField.default;
|
42
|
-
}
|
43
|
-
});
|
44
|
-
Object.defineProperty(exports, "HiSearchField", {
|
45
|
-
enumerable: true,
|
46
|
-
get: function get() {
|
47
|
-
return _HiSearchField.default;
|
48
|
-
}
|
49
|
-
});
|
50
|
-
Object.defineProperty(exports, "HiSlider", {
|
51
|
-
enumerable: true,
|
52
|
-
get: function get() {
|
53
|
-
return _HiSlider.default;
|
54
|
-
}
|
55
|
-
});
|
56
|
-
Object.defineProperty(exports, "HiTextField", {
|
57
|
-
enumerable: true,
|
58
|
-
get: function get() {
|
59
|
-
return _HiTextField.default;
|
60
|
-
}
|
61
|
-
});
|
62
|
-
Object.defineProperty(exports, "HiUpload", {
|
63
|
-
enumerable: true,
|
64
|
-
get: function get() {
|
65
|
-
return _HiUpload.default;
|
66
|
-
}
|
67
|
-
});
|
68
|
-
Object.defineProperty(exports, "HiUploadField", {
|
69
|
-
enumerable: true,
|
70
|
-
get: function get() {
|
71
|
-
return _HiUploadField.default;
|
72
|
-
}
|
73
|
-
});
|
74
|
-
|
75
|
-
var _HiAddressField = _interopRequireDefault(require("./HiAddressField"));
|
76
|
-
|
77
|
-
var _HiEmailField = _interopRequireDefault(require("./HiEmailField"));
|
78
|
-
|
79
|
-
var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
|
80
|
-
|
81
|
-
var _HiFormLabel = _interopRequireDefault(require("./HiFormLabel"));
|
82
|
-
|
83
|
-
var _HiInput = _interopRequireDefault(require("./HiInput"));
|
84
|
-
|
85
|
-
var _HiPasswordField = _interopRequireDefault(require("./HiPasswordField"));
|
86
|
-
|
87
|
-
var _HiSearchField = _interopRequireDefault(require("./HiSearchField"));
|
88
|
-
|
89
|
-
var _HiSlider = _interopRequireDefault(require("./HiSlider"));
|
90
|
-
|
91
|
-
var _HiTextField = _interopRequireDefault(require("./HiTextField"));
|
92
|
-
|
93
|
-
var _HiUpload = _interopRequireDefault(require("./HiUpload"));
|
94
|
-
|
95
|
-
var _HiUploadField = _interopRequireDefault(require("./HiUploadField"));
|
1
|
+
export { default as HiAddressField } from './HiAddressField';
|
2
|
+
export { default as HiEmailField } from './HiEmailField';
|
3
|
+
export { default as HiFormControl } from './HiFormControl';
|
4
|
+
export { default as HiFormLabel } from './HiFormLabel';
|
5
|
+
export { default as HiInput } from './HiInput';
|
6
|
+
export { default as HiPasswordField } from './HiPasswordField';
|
7
|
+
export { default as HiSearchField } from './HiSearchField';
|
8
|
+
export { default as HiSlider } from './HiSlider';
|
9
|
+
export { default as HiTextField } from './HiTextField';
|
10
|
+
export { default as HiUpload } from './HiUpload';
|
11
|
+
export { default as HiUploadField } from './HiUploadField';
|
package/es/HiIcon/HiIcon.js
CHANGED
@@ -1,33 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
exports.default = exports.useStyles = void 0;
|
11
|
-
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
13
|
-
|
14
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
15
|
-
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
17
|
-
|
18
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
19
|
-
|
20
|
-
var _Icon = _interopRequireDefault(require("@material-ui/core/Icon"));
|
21
|
-
|
22
|
-
var _styles = require("@material-ui/core/styles");
|
23
|
-
|
24
|
-
var _helpers = require("../utils/helpers");
|
25
|
-
|
26
|
-
var hiSvgIcons = _interopRequireWildcard(require("../hi-svg-icons"));
|
27
|
-
|
28
|
-
var mdi = _interopRequireWildcard(require("mdi-material-ui"));
|
29
|
-
|
30
|
-
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
|
+
import React from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import Icon from '@material-ui/core/Icon';
|
5
|
+
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
6
|
+
import { camelize, capitalize } from '../utils/helpers';
|
7
|
+
import * as hiSvgIcons from '../hi-svg-icons';
|
8
|
+
import * as mdi from 'mdi-material-ui';
|
9
|
+
export var useStyles = makeStyles(function (theme) {
|
31
10
|
return {
|
32
11
|
/* Styles applied to the root element. */
|
33
12
|
root: {
|
@@ -44,7 +23,6 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
44
23
|
}
|
45
24
|
};
|
46
25
|
});
|
47
|
-
exports.useStyles = useStyles;
|
48
26
|
|
49
27
|
function HiIcon(props) {
|
50
28
|
var children = props.children,
|
@@ -52,15 +30,16 @@ function HiIcon(props) {
|
|
52
30
|
icon = props.icon,
|
53
31
|
size = props.size,
|
54
32
|
_color = props.color,
|
55
|
-
other = (
|
33
|
+
other = _objectWithoutProperties(props, ["children", "className", "icon", "size", "color"]);
|
34
|
+
|
56
35
|
var classes = useStyles(props);
|
57
36
|
var iconName = icon !== null ? icon : children;
|
58
|
-
var theme =
|
37
|
+
var theme = useTheme();
|
59
38
|
var color = ['primary', 'secondary', 'neutral', 'positive', 'middle', 'negative'].includes(_color) ? theme.palette[_color].main : _color; // Line Awesome icons
|
60
39
|
|
61
40
|
if (iconName && iconName.indexOf('fa-') === 0) {
|
62
|
-
return
|
63
|
-
className: (
|
41
|
+
return React.createElement("i", Object.assign({
|
42
|
+
className: classNames('fa', iconName, className, classes.root),
|
64
43
|
style: {
|
65
44
|
fontSize: size
|
66
45
|
}
|
@@ -69,9 +48,9 @@ function HiIcon(props) {
|
|
69
48
|
|
70
49
|
|
71
50
|
if (iconName && iconName.indexOf('hi_') === 0) {
|
72
|
-
var IconName = hiSvgIcons[
|
73
|
-
return
|
74
|
-
className: (
|
51
|
+
var IconName = hiSvgIcons[capitalize(camelize(iconName))];
|
52
|
+
return React.createElement(IconName, Object.assign({
|
53
|
+
className: classNames(classes.root, className),
|
75
54
|
color: color,
|
76
55
|
size: size
|
77
56
|
}, other));
|
@@ -85,8 +64,8 @@ function HiIcon(props) {
|
|
85
64
|
|
86
65
|
|
87
66
|
if (iconName && iconName.indexOf('mdi_') === 0) {
|
88
|
-
var _IconName = mdi[
|
89
|
-
return
|
67
|
+
var _IconName = mdi[capitalize(camelize(iconName.slice(4)))];
|
68
|
+
return React.createElement(_IconName, Object.assign({
|
90
69
|
color: color,
|
91
70
|
style: {
|
92
71
|
fontSize: size
|
@@ -95,8 +74,8 @@ function HiIcon(props) {
|
|
95
74
|
} // @material-ui/icons
|
96
75
|
|
97
76
|
|
98
|
-
return
|
99
|
-
className: (
|
77
|
+
return React.createElement(Icon, Object.assign({
|
78
|
+
className: classNames(classes.root, className),
|
100
79
|
color: color,
|
101
80
|
style: {
|
102
81
|
fontSize: size
|
@@ -109,5 +88,4 @@ HiIcon.defaultProps = {
|
|
109
88
|
icon: null,
|
110
89
|
size: 20
|
111
90
|
};
|
112
|
-
|
113
|
-
exports.default = _default;
|
91
|
+
export default HiIcon;
|
package/es/HiIcon/index.js
CHANGED
@@ -1,15 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _HiIcon.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
|
15
|
-
var _HiIcon = _interopRequireDefault(require("./HiIcon"));
|
1
|
+
export { default } from './HiIcon';
|
@@ -1,36 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = exports.styles = void 0;
|
9
|
-
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
11
|
-
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
13
|
-
|
14
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
15
|
-
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
17
|
-
|
18
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
19
|
-
|
20
|
-
var _styles = require("@material-ui/core/styles");
|
21
|
-
|
22
|
-
var _colorManipulator = require("@material-ui/core/styles/colorManipulator");
|
23
|
-
|
24
|
-
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
25
|
-
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
26
3
|
// @inheritedComponent IconButton
|
27
|
-
|
4
|
+
import React from 'react';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import { withStyles } from '@material-ui/core/styles';
|
7
|
+
import { fade } from '@material-ui/core/styles/colorManipulator';
|
8
|
+
import IconButton from '@material-ui/core/IconButton';
|
9
|
+
export var styles = function styles(theme) {
|
28
10
|
return {
|
29
11
|
label: {},
|
30
12
|
positive: {
|
31
13
|
color: theme.palette.positive.main,
|
32
14
|
'&:hover': {
|
33
|
-
backgroundColor:
|
15
|
+
backgroundColor: fade(theme.palette.positive.main, theme.palette.action.hoverOpacity),
|
34
16
|
// Reset on touch devices, it doesn't add specificity
|
35
17
|
'@media (hover: none)': {
|
36
18
|
backgroundColor: 'transparent'
|
@@ -40,7 +22,7 @@ var styles = function styles(theme) {
|
|
40
22
|
negative: {
|
41
23
|
color: theme.palette.negative.main,
|
42
24
|
'&:hover': {
|
43
|
-
backgroundColor:
|
25
|
+
backgroundColor: fade(theme.palette.negative.main, theme.palette.action.hoverOpacity),
|
44
26
|
// Reset on touch devices, it doesn't add specificity
|
45
27
|
'@media (hover: none)': {
|
46
28
|
backgroundColor: 'transparent'
|
@@ -50,7 +32,7 @@ var styles = function styles(theme) {
|
|
50
32
|
middle: {
|
51
33
|
color: theme.palette.middle.main,
|
52
34
|
'&:hover': {
|
53
|
-
backgroundColor:
|
35
|
+
backgroundColor: fade(theme.palette.middle.main, theme.palette.action.hoverOpacity),
|
54
36
|
// Reset on touch devices, it doesn't add specificity
|
55
37
|
'@media (hover: none)': {
|
56
38
|
backgroundColor: 'transparent'
|
@@ -60,7 +42,7 @@ var styles = function styles(theme) {
|
|
60
42
|
neutral: {
|
61
43
|
color: theme.palette.neutral.main,
|
62
44
|
'&:hover': {
|
63
|
-
backgroundColor:
|
45
|
+
backgroundColor: fade(theme.palette.neutral.main, theme.palette.action.hoverOpacity),
|
64
46
|
// Reset on touch devices, it doesn't add specificity
|
65
47
|
'@media (hover: none)': {
|
66
48
|
backgroundColor: 'transparent'
|
@@ -70,8 +52,6 @@ var styles = function styles(theme) {
|
|
70
52
|
};
|
71
53
|
};
|
72
54
|
|
73
|
-
exports.styles = styles;
|
74
|
-
|
75
55
|
function HiIconButton(props) {
|
76
56
|
var _classNames;
|
77
57
|
|
@@ -79,10 +59,11 @@ function HiIconButton(props) {
|
|
79
59
|
classes = props.classes,
|
80
60
|
className = props.className,
|
81
61
|
color = props.color,
|
82
|
-
other = (
|
62
|
+
other = _objectWithoutProperties(props, ["children", "classes", "className", "color"]);
|
63
|
+
|
83
64
|
var hcolor = ['positive', 'negative', 'middle', 'neutral'].includes(color) ? 'inherit' : color;
|
84
|
-
var buttonClassNames = (
|
85
|
-
return
|
65
|
+
var buttonClassNames = classNames((_classNames = {}, _defineProperty(_classNames, classes.positive, color === 'positive'), _defineProperty(_classNames, classes.negative, color === 'negative'), _defineProperty(_classNames, classes.middle, color === 'middle'), _defineProperty(_classNames, classes.neutral, color === 'neutral'), _classNames));
|
66
|
+
return React.createElement(IconButton, Object.assign({
|
86
67
|
className: className,
|
87
68
|
classes: {
|
88
69
|
root: buttonClassNames,
|
@@ -95,10 +76,7 @@ function HiIconButton(props) {
|
|
95
76
|
HiIconButton.defaultProps = {
|
96
77
|
color: 'default'
|
97
78
|
};
|
98
|
-
|
99
|
-
var _default = (0, _styles.withStyles)(styles, {
|
79
|
+
export default withStyles(styles, {
|
100
80
|
hiComponent: true,
|
101
81
|
name: 'HmuiHiIconButton'
|
102
|
-
})(HiIconButton);
|
103
|
-
|
104
|
-
exports.default = _default;
|
82
|
+
})(HiIconButton);
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { assert } from 'chai';
|
3
|
+
import { createShallow, createRender, getClasses } from '../test-utils';
|
4
|
+
import HiIconButton from './HiIconButton';
|
5
|
+
import IconButton from '@material-ui/core/IconButton';
|
6
|
+
import classNames from 'classnames';
|
7
|
+
describe('<HiIconButton />', function () {
|
8
|
+
var shallow;
|
9
|
+
var render;
|
10
|
+
var classes;
|
11
|
+
var buttonClasses = getClasses(React.createElement(IconButton, null, "Hello World"));
|
12
|
+
before(function () {
|
13
|
+
shallow = createShallow({
|
14
|
+
dive: true
|
15
|
+
});
|
16
|
+
render = createRender();
|
17
|
+
classes = getClasses(React.createElement(HiIconButton, null, "Hello World"));
|
18
|
+
});
|
19
|
+
it('should render a <IconButton> element', function () {
|
20
|
+
var wrapper = shallow(React.createElement(HiIconButton, null, "Hello World"));
|
21
|
+
assert.strictEqual(wrapper.find(IconButton).length, 1);
|
22
|
+
});
|
23
|
+
it('should render forward primary color prop to <IconButton> component', function () {
|
24
|
+
var wrapper = shallow(React.createElement(HiIconButton, {
|
25
|
+
color: "primary"
|
26
|
+
}, "Hello World"));
|
27
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'primary', 'should render with the button color inherit');
|
28
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root));
|
29
|
+
});
|
30
|
+
it('should render with the positive classes and set color to inherit', function () {
|
31
|
+
var wrapper = shallow(React.createElement(HiIconButton, {
|
32
|
+
color: "positive"
|
33
|
+
}, "Hello World"));
|
34
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
35
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.positive));
|
36
|
+
});
|
37
|
+
it('should render with the negative classes and set color to inherit', function () {
|
38
|
+
var wrapper = shallow(React.createElement(HiIconButton, {
|
39
|
+
color: "negative"
|
40
|
+
}, "Hello World"));
|
41
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
42
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.negative));
|
43
|
+
});
|
44
|
+
it('should render with the middle classes and set color to inherit', function () {
|
45
|
+
var wrapper = shallow(React.createElement(HiIconButton, {
|
46
|
+
color: "middle"
|
47
|
+
}, "Hello World"));
|
48
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
49
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.middle));
|
50
|
+
});
|
51
|
+
it('should render with the neutral classes and set color to inherit', function () {
|
52
|
+
var wrapper = shallow(React.createElement(HiIconButton, {
|
53
|
+
color: "neutral"
|
54
|
+
}, "Hello World"));
|
55
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
56
|
+
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.neutral));
|
57
|
+
});
|
58
|
+
describe('server side', function () {
|
59
|
+
// Only run the test on node.
|
60
|
+
if (!/jsdom/.test(window.navigator.userAgent)) {
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
64
|
+
it('should server side render', function () {
|
65
|
+
var markup = render(React.createElement(HiIconButton, null, "Hello World"));
|
66
|
+
assert.strictEqual(markup.text(), 'Hello World');
|
67
|
+
});
|
68
|
+
});
|
69
|
+
});
|
package/es/HiIconButton/index.js
CHANGED
@@ -1,15 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _HiIconButton.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
|
15
|
-
var _HiIconButton = _interopRequireDefault(require("./HiIconButton"));
|
1
|
+
export { default } from './HiIconButton';
|
package/es/HiLoader/HiLoader.js
CHANGED
@@ -1,19 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = void 0;
|
9
|
-
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
11
|
-
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
13
|
-
|
14
|
-
var _PropagateLoader = _interopRequireDefault(require("react-spinners/PropagateLoader"));
|
15
|
-
|
16
|
-
var _styles = require("@material-ui/core/styles");
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import React from 'react';
|
3
|
+
import PropagateLoader from 'react-spinners/PropagateLoader';
|
4
|
+
import { withStyles } from '@material-ui/core/styles';
|
17
5
|
|
18
6
|
function HiLoader(props) {
|
19
7
|
var className = props.className,
|
@@ -21,15 +9,15 @@ function HiLoader(props) {
|
|
21
9
|
size = props.size,
|
22
10
|
theme = props.theme,
|
23
11
|
style = props.style;
|
24
|
-
return
|
12
|
+
return React.createElement("div", {
|
25
13
|
id: "hi-loader",
|
26
14
|
className: className,
|
27
|
-
style: (
|
15
|
+
style: _objectSpread({}, style, {
|
28
16
|
display: 'block',
|
29
17
|
width: 1,
|
30
18
|
height: 12
|
31
19
|
})
|
32
|
-
},
|
20
|
+
}, React.createElement(PropagateLoader, {
|
33
21
|
size: size,
|
34
22
|
color: theme.palette[color].main
|
35
23
|
}));
|
@@ -39,11 +27,8 @@ HiLoader.defaultProps = {
|
|
39
27
|
size: 12,
|
40
28
|
color: 'primary'
|
41
29
|
};
|
42
|
-
|
43
|
-
var _default = (0, _styles.withStyles)({}, {
|
30
|
+
export default withStyles({}, {
|
44
31
|
hiComponent: true,
|
45
32
|
withTheme: true,
|
46
33
|
name: 'HmuiHiLoader'
|
47
|
-
})(HiLoader);
|
48
|
-
|
49
|
-
exports.default = _default;
|
34
|
+
})(HiLoader);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { assert } from 'chai';
|
3
|
+
import { createShallow } from '../test-utils';
|
4
|
+
import HiLoader from './HiLoader';
|
5
|
+
describe('<HiLoader />', function () {
|
6
|
+
var shallow;
|
7
|
+
before(function () {
|
8
|
+
shallow = createShallow({
|
9
|
+
dive: true
|
10
|
+
});
|
11
|
+
});
|
12
|
+
it('renders a functional hour & minute ListPicker', function () {
|
13
|
+
var wrapper = shallow(React.createElement(HiLoader, {
|
14
|
+
loading: true
|
15
|
+
}));
|
16
|
+
assert.strictEqual(wrapper.name(), 'div', 'should render a div');
|
17
|
+
});
|
18
|
+
});
|
package/es/HiLoader/index.js
CHANGED
@@ -1,15 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _HiLoader.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
|
15
|
-
var _HiLoader = _interopRequireDefault(require("./HiLoader"));
|
1
|
+
export { default } from './HiLoader';
|