@mui/codemod 6.0.0-dev.240424162023-9968b4889d → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1037 -294
- package/codemod.js +0 -2
- package/node/deprecations/accordion-props/test-cases/actual.js +6 -3
- package/node/deprecations/accordion-props/test-cases/expected.js +14 -10
- package/node/deprecations/accordion-props/test-cases/theme.expected.js +8 -7
- package/node/deprecations/alert-props/test-cases/expected.js +12 -4
- package/node/deprecations/alert-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/all/deprecations-all.js +38 -14
- package/node/deprecations/all/postcss.config.js +10 -1
- package/node/deprecations/autocomplete-props/autocomplete-props.js +22 -0
- package/node/deprecations/autocomplete-props/index.js +13 -0
- package/node/deprecations/autocomplete-props/test-cases/actual.js +75 -0
- package/node/deprecations/autocomplete-props/test-cases/expected.js +75 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +47 -0
- package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +47 -0
- package/node/deprecations/avatar-group-props/avatar-group-props.js +81 -0
- package/node/deprecations/avatar-group-props/index.js +13 -0
- package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
- package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
- package/node/deprecations/avatar-props/test-cases/expected.js +8 -6
- package/node/deprecations/avatar-props/test-cases/theme.expected.js +8 -7
- package/node/deprecations/backdrop-props/backdrop-props.js +3 -5
- package/node/deprecations/backdrop-props/test-cases/actual.js +30 -13
- package/node/deprecations/backdrop-props/test-cases/expected.js +23 -13
- package/node/deprecations/backdrop-props/test-cases/theme.actual.js +32 -6
- package/node/deprecations/backdrop-props/test-cases/theme.expected.js +27 -5
- package/node/deprecations/badge-props/test-cases/expected.js +12 -5
- package/node/deprecations/badge-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/circular-progress-classes/circular-progress-classes.js +77 -0
- package/node/deprecations/circular-progress-classes/index.js +13 -0
- package/node/deprecations/circular-progress-classes/postcss-plugin.js +33 -0
- package/node/deprecations/circular-progress-classes/postcss.config.js +8 -0
- package/node/deprecations/circular-progress-classes/test-cases/actual.js +7 -0
- package/node/deprecations/circular-progress-classes/test-cases/expected.js +7 -0
- package/node/deprecations/divider-props/divider-props.js +28 -15
- package/node/deprecations/divider-props/test-cases/actual.js +3 -0
- package/node/deprecations/divider-props/test-cases/expected.js +5 -8
- package/node/deprecations/divider-props/test-cases/theme.actual.js +28 -0
- package/node/deprecations/divider-props/test-cases/theme.expected.js +25 -0
- package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
- package/node/deprecations/filled-input-props/index.js +13 -0
- package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/form-control-label-props/form-control-label-props.js +22 -0
- package/node/deprecations/form-control-label-props/index.js +13 -0
- package/node/deprecations/form-control-label-props/test-cases/actual.js +21 -0
- package/node/deprecations/form-control-label-props/test-cases/expected.js +21 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.actual.js +23 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/grid-props/grid-props.js +51 -0
- package/node/deprecations/grid-props/index.js +13 -0
- package/node/deprecations/grid-props/test-cases/actual.js +25 -0
- package/node/deprecations/grid-props/test-cases/expected.js +23 -0
- package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
- package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/image-list-item-bar-classes/image-list-item-bar-classes.js +77 -0
- package/node/deprecations/image-list-item-bar-classes/index.js +13 -0
- package/node/deprecations/image-list-item-bar-classes/postcss-plugin.js +39 -0
- package/node/deprecations/image-list-item-bar-classes/postcss.config.js +8 -0
- package/node/deprecations/image-list-item-bar-classes/test-cases/actual.js +11 -0
- package/node/deprecations/image-list-item-bar-classes/test-cases/expected.js +11 -0
- package/node/deprecations/input-base-props/index.js +13 -0
- package/node/deprecations/input-base-props/input-base-props.js +22 -0
- package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/input-props/index.js +13 -0
- package/node/deprecations/input-props/input-props.js +22 -0
- package/node/deprecations/input-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/list-item-props/index.js +13 -0
- package/node/deprecations/list-item-props/list-item-props.js +22 -0
- package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
- package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
- package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/modal-props/index.js +13 -0
- package/node/deprecations/modal-props/modal-props.js +22 -0
- package/node/deprecations/modal-props/test-cases/actual.js +43 -0
- package/node/deprecations/modal-props/test-cases/expected.js +40 -0
- package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/outlined-input-props/index.js +13 -0
- package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
- package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/pagination-item-props/index.js +13 -0
- package/node/deprecations/pagination-item-props/pagination-item-props.js +22 -0
- package/node/deprecations/pagination-item-props/test-cases/actual.js +27 -0
- package/node/deprecations/pagination-item-props/test-cases/expected.js +21 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.actual.js +28 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.expected.js +26 -0
- package/node/deprecations/popper-props/index.js +13 -0
- package/node/deprecations/popper-props/popper-props.js +22 -0
- package/node/deprecations/popper-props/test-cases/actual.js +27 -0
- package/node/deprecations/popper-props/test-cases/expected.js +24 -0
- package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
- package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
- package/node/deprecations/slider-props/test-cases/expected.js +12 -4
- package/node/deprecations/slider-props/test-cases/theme.expected.js +12 -5
- package/node/deprecations/speed-dial-props/index.js +13 -0
- package/node/deprecations/speed-dial-props/speed-dial-props.js +31 -0
- package/node/deprecations/speed-dial-props/test-cases/actual.js +41 -0
- package/node/deprecations/speed-dial-props/test-cases/expected.js +54 -0
- package/node/deprecations/speed-dial-props/test-cases/theme.actual.js +33 -0
- package/node/deprecations/speed-dial-props/test-cases/theme.expected.js +40 -0
- package/node/deprecations/step-label-props/step-label-props.js +0 -14
- package/node/deprecations/step-label-props/test-cases/actual.js +0 -23
- package/node/deprecations/step-label-props/test-cases/expected.js +4 -26
- package/node/deprecations/step-label-props/test-cases/theme.actual.js +0 -22
- package/node/deprecations/step-label-props/test-cases/theme.expected.js +4 -28
- package/node/deprecations/tab-classes/index.js +13 -0
- package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
- package/node/deprecations/tab-classes/postcss.config.js +8 -0
- package/node/deprecations/tab-classes/tab-classes.js +53 -0
- package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
- package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
- package/node/deprecations/table-sort-label-classes/index.js +13 -0
- package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
- package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
- package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
- package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
- package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
- package/node/deprecations/text-field-props/index.js +13 -0
- package/node/deprecations/text-field-props/test-cases/actual.js +27 -0
- package/node/deprecations/text-field-props/test-cases/expected.js +31 -0
- package/node/deprecations/text-field-props/test-cases/theme.actual.js +13 -0
- package/node/deprecations/text-field-props/test-cases/theme.expected.js +15 -0
- package/node/deprecations/text-field-props/text-field-props.js +48 -0
- package/node/deprecations/tooltip-props/index.js +13 -0
- package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
- package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
- package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
- package/node/deprecations/typography-props/index.js +13 -0
- package/node/deprecations/typography-props/test-cases/actual.js +80 -0
- package/node/deprecations/typography-props/test-cases/expected.js +86 -0
- package/node/deprecations/typography-props/test-cases/theme.actual.js +85 -0
- package/node/deprecations/typography-props/test-cases/theme.expected.js +86 -0
- package/node/deprecations/typography-props/typography-props.js +81 -0
- package/node/deprecations/utils/movePropIntoSlotProps.js +4 -12
- package/node/deprecations/utils/movePropIntoSlots.js +4 -12
- package/node/deprecations/utils/replaceComponentsWithSlots.js +32 -25
- package/node/util/getReturnExpression.js +19 -0
- package/node/util/migrateToVariants.js +586 -0
- package/node/util/propsToObject.js +2 -6
- package/node/util/renameClassKey.js +1 -2
- package/node/v0.15.0/import-path.js +2 -2
- package/node/v5.0.0/avatar-circle-circular.js +2 -4
- package/node/v5.0.0/badge-overlap-value.js +4 -7
- package/node/v5.0.0/badge-overlap-value.test/actual.js +3 -4
- package/node/v5.0.0/badge-overlap-value.test/expected.js +3 -4
- package/node/v5.0.0/base-hook-imports.js +1 -2
- package/node/v5.0.0/base-remove-component-prop.test/actual.js +4 -4
- package/node/v5.0.0/base-remove-component-prop.test/expected.js +4 -4
- package/node/v5.0.0/base-remove-unstyled-suffix.js +1 -2
- package/node/v5.0.0/base-remove-unstyled-suffix.test/actual.js +5 -5
- package/node/v5.0.0/base-remove-unstyled-suffix.test/expected.js +4 -4
- package/node/v5.0.0/base-rename-components-to-slots.js +1 -1
- package/node/v5.0.0/base-use-named-exports.js +5 -8
- package/node/v5.0.0/box-sx-prop.js +1 -2
- package/node/v5.0.0/box-sx-prop.test/actual.js +4 -4
- package/node/v5.0.0/box-sx-prop.test/expected.js +3 -3
- package/node/v5.0.0/button-color-prop.js +1 -2
- package/node/v5.0.0/chip-variant-prop.js +1 -2
- package/node/v5.0.0/circularprogress-variant.js +2 -4
- package/node/v5.0.0/create-theme.test/custom-fn.actual.js +3 -4
- package/node/v5.0.0/create-theme.test/custom-fn.expected.js +3 -4
- package/node/v5.0.0/fab-variant.js +2 -4
- package/node/v5.0.0/grid-list-component.test/actual.js +1 -1
- package/node/v5.0.0/grid-list-component.test/expected.js +1 -1
- package/node/v5.0.0/joy-avatar-remove-imgProps.js +3 -7
- package/node/v5.0.0/joy-rename-components-to-slots.js +1 -1
- package/node/v5.0.0/joy-rename-row-prop.js +1 -2
- package/node/v5.0.0/joy-text-field-to-input.js +4 -7
- package/node/v5.0.0/jss-to-styled.test/first.actual.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/first.expected.js +11 -14
- package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +4 -4
- package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles1.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles2.expected.js +3 -4
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.actual.js +3 -3
- package/node/v5.0.0/jss-to-styled.test/withCreateStyles3.expected.js +3 -4
- package/node/v5.0.0/jss-to-tss-react.js +4 -6
- package/node/v5.0.0/jss-to-tss-react.test/actual-mixins-pattern.js +6 -5
- package/node/v5.0.0/jss-to-tss-react.test/actual-withStyles.js +4 -4
- package/node/v5.0.0/jss-to-tss-react.test/expected-mixins-pattern.js +6 -5
- package/node/v5.0.0/jss-to-tss-react.test/expected-withStyles.js +4 -4
- package/node/v5.0.0/link-underline-hover.js +1 -4
- package/node/v5.0.0/pagination-round-circular.js +3 -8
- package/node/v5.0.0/preset-safe.test/actual.js +6 -4
- package/node/v5.0.0/preset-safe.test/expected.js +9 -6
- package/node/v5.0.0/root-ref.test/expected.js +4 -4
- package/node/v5.0.0/skeleton-variant.js +3 -5
- package/node/v5.0.0/table-props.js +4 -9
- package/node/v5.0.0/table-props.test/actual.js +4 -5
- package/node/v5.0.0/table-props.test/expected.js +4 -5
- package/node/v5.0.0/tabs-scroll-buttons.js +4 -5
- package/node/v5.0.0/theme-spacing.test/large-actual.js +11 -11
- package/node/v5.0.0/theme-spacing.test/large-expected.js +11 -11
- package/node/v5.0.0/variant-prop.test/actual.js +12 -6
- package/node/v5.0.0/variant-prop.test/expected.js +15 -12
- package/node/v5.0.0/with-mobile-dialog.test/expected.js +6 -5
- package/node/v5.0.0/with-width.test/expected.js +6 -5
- package/node/v6.0.0/all/v6-all.js +4 -5
- package/node/v6.0.0/grid-v2-props/grid-v2-props.js +142 -0
- package/node/v6.0.0/grid-v2-props/index.js +13 -0
- package/node/v6.0.0/grid-v2-props/test-cases/actual.js +89 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.actual.js +18 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.expected.js +22 -0
- package/node/v6.0.0/grid-v2-props/test-cases/expected.js +101 -0
- package/node/v6.0.0/list-item-button-prop/index.js +13 -0
- package/node/v6.0.0/list-item-button-prop/list-item-button-prop.js +93 -0
- package/node/v6.0.0/list-item-button-prop/test-cases/actual.js +31 -0
- package/node/v6.0.0/list-item-button-prop/test-cases/expected.js +20 -0
- package/node/v6.0.0/list-item-button-prop/test-cases/theme.actual.js +20 -0
- package/node/v6.0.0/list-item-button-prop/test-cases/theme.expected.js +24 -0
- package/node/v6.0.0/styled/styled-v6.js +2 -415
- package/node/v6.0.0/styled/test-cases/BasicStyled.actual.js +55 -44
- package/node/v6.0.0/styled/test-cases/BasicStyled.expected.js +5 -6
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.actual.js +98 -61
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +54 -29
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
- package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
- package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
- package/node/v6.0.0/styled/test-cases/NestedSpread.actual.js +33 -28
- package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +20 -22
- package/node/v6.0.0/styled/test-cases/ThemePaletteMode.expected.js +28 -26
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.actual.js +6 -5
- package/node/v6.0.0/styled/test-cases/VariantAndModeStyled.expected.js +8 -8
- package/node/v6.0.0/sx-prop/index.js +13 -0
- package/node/v6.0.0/sx-prop/sx-v6.js +411 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-applyStyles.actual.js +89 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-applyStyles.expected.js +82 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-condition.actual.js +92 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-condition.expected.js +89 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +55 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +88 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +107 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +120 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-inheritance.actual.js +17 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-inheritance.expected.js +17 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
- package/node/v6.0.0/system-props/index.js +13 -0
- package/node/v6.0.0/system-props/removeSystemProps.js +233 -0
- package/node/v6.0.0/system-props/test-cases/system-props.actual.js +83 -0
- package/node/v6.0.0/system-props/test-cases/system-props.expected.js +98 -0
- package/node/v6.0.0/theme-v6/index.js +13 -0
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.actual.js +559 -0
- package/node/v6.0.0/theme-v6/test-cases/basicTheme.expected.js +644 -0
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.actual.js +65 -0
- package/node/v6.0.0/theme-v6/test-cases/themeVariants.expected.js +74 -0
- package/node/v6.0.0/theme-v6/theme-v6.js +86 -0
- package/package.json +11 -11
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = AppSearch;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var React = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _reactDom = require("react-dom");
|
|
11
10
|
var _helpers = require("docs/src/modules/utils/helpers");
|
|
@@ -25,7 +24,7 @@ var _GlobalStyles = _interopRequireDefault(require("@mui/material/GlobalStyles")
|
|
|
25
24
|
var _styles = require("@mui/material/styles");
|
|
26
25
|
var _config = require("docs/config");
|
|
27
26
|
var _Link = _interopRequireDefault(require("docs/src/modules/components/Link"));
|
|
28
|
-
var _i18n = require("docs/
|
|
27
|
+
var _i18n = require("@mui/docs/i18n");
|
|
29
28
|
var _useLazyCSS = _interopRequireDefault(require("docs/src/modules/utils/useLazyCSS"));
|
|
30
29
|
var _getUrlProduct = _interopRequireDefault(require("docs/src/modules/utils/getUrlProduct"));
|
|
31
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -351,11 +350,12 @@ function AppSearch() {
|
|
|
351
350
|
canonicalAs,
|
|
352
351
|
canonicalPathname
|
|
353
352
|
} = (0, _helpers.pathnameToLanguage)(`${parseUrl.pathname}${parseUrl.hash}`);
|
|
354
|
-
return
|
|
353
|
+
return {
|
|
354
|
+
...item,
|
|
355
355
|
pathname: canonicalPathname,
|
|
356
356
|
as: canonicalAs,
|
|
357
357
|
userLanguage
|
|
358
|
-
}
|
|
358
|
+
};
|
|
359
359
|
});
|
|
360
360
|
},
|
|
361
361
|
hitComponent: DocSearchHit,
|
|
@@ -433,16 +433,16 @@ function AppSearch() {
|
|
|
433
433
|
transition: 'margin 0.2s',
|
|
434
434
|
fontSize: theme.typography.pxToRem(16)
|
|
435
435
|
},
|
|
436
|
-
'& .DocSearch-Modal':
|
|
436
|
+
'& .DocSearch-Modal': {
|
|
437
437
|
maxWidth: '700px',
|
|
438
|
-
boxShadow: `0px 4px 20px ${theme.palette.mode === 'dark' ? (0, _styles.alpha)(theme.palette.background.paper, 0.7) : (0, _styles.alpha)(theme.palette.grey[700], 0.2)}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
boxShadow: `0px 4px 20px ${theme.palette.mode === 'dark' ? (0, _styles.alpha)(theme.palette.background.paper, 0.7) : (0, _styles.alpha)(theme.palette.grey[700], 0.2)}`,
|
|
439
|
+
...(theme.palette.mode === 'dark' && {
|
|
440
|
+
border: '1px solid',
|
|
441
|
+
borderColor: theme.palette.primaryDark[700]
|
|
442
|
+
}),
|
|
443
443
|
// docsearch.css: <= 750px will be full screen modal
|
|
444
444
|
borderRadius: `clamp(0px, (100vw - 750px) * 9999, ${theme.shape.borderRadius}px)`
|
|
445
|
-
}
|
|
445
|
+
},
|
|
446
446
|
'& .DocSearch-SearchBar': {
|
|
447
447
|
borderBottom: '1px solid',
|
|
448
448
|
borderColor: theme.palette.mode === 'dark' ? theme.palette.primaryDark[700] : theme.palette.grey[200],
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = AppSearch;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var React = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _reactDom = require("react-dom");
|
|
11
10
|
var _helpers = require("docs/src/modules/utils/helpers");
|
|
@@ -25,7 +24,7 @@ var _GlobalStyles = _interopRequireDefault(require("@mui/material/GlobalStyles")
|
|
|
25
24
|
var _styles = require("@mui/material/styles");
|
|
26
25
|
var _config = require("docs/config");
|
|
27
26
|
var _Link = _interopRequireDefault(require("docs/src/modules/components/Link"));
|
|
28
|
-
var _i18n = require("docs/
|
|
27
|
+
var _i18n = require("@mui/docs/i18n");
|
|
29
28
|
var _useLazyCSS = _interopRequireDefault(require("docs/src/modules/utils/useLazyCSS"));
|
|
30
29
|
var _getUrlProduct = _interopRequireDefault(require("docs/src/modules/utils/getUrlProduct"));
|
|
31
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -351,11 +350,12 @@ function AppSearch() {
|
|
|
351
350
|
canonicalAs,
|
|
352
351
|
canonicalPathname
|
|
353
352
|
} = (0, _helpers.pathnameToLanguage)(`${parseUrl.pathname}${parseUrl.hash}`);
|
|
354
|
-
return
|
|
353
|
+
return {
|
|
354
|
+
...item,
|
|
355
355
|
pathname: canonicalPathname,
|
|
356
356
|
as: canonicalAs,
|
|
357
357
|
userLanguage
|
|
358
|
-
}
|
|
358
|
+
};
|
|
359
359
|
});
|
|
360
360
|
},
|
|
361
361
|
hitComponent: DocSearchHit,
|
|
@@ -433,16 +433,16 @@ function AppSearch() {
|
|
|
433
433
|
transition: 'margin 0.2s',
|
|
434
434
|
fontSize: theme.typography.pxToRem(16)
|
|
435
435
|
},
|
|
436
|
-
'& .DocSearch-Modal':
|
|
436
|
+
'& .DocSearch-Modal': {
|
|
437
437
|
maxWidth: '700px',
|
|
438
|
-
boxShadow: `0px 4px 20px ${theme.palette.mode === 'dark' ? (0, _styles.alpha)(theme.palette.background.paper, 0.7) : (0, _styles.alpha)(theme.palette.grey[700], 0.2)}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
boxShadow: `0px 4px 20px ${theme.palette.mode === 'dark' ? (0, _styles.alpha)(theme.palette.background.paper, 0.7) : (0, _styles.alpha)(theme.palette.grey[700], 0.2)}`,
|
|
439
|
+
...(theme.palette.mode === 'dark' && {
|
|
440
|
+
border: '1px solid',
|
|
441
|
+
borderColor: theme.palette.primaryDark[700]
|
|
442
|
+
}),
|
|
443
443
|
// docsearch.css: <= 750px will be full screen modal
|
|
444
444
|
borderRadius: `clamp(0px, (100vw - 750px) * 9999, ${theme.shape.borderRadius}px)`
|
|
445
|
-
}
|
|
445
|
+
},
|
|
446
446
|
'& .DocSearch-SearchBar': {
|
|
447
447
|
borderBottom: '1px solid',
|
|
448
448
|
borderColor: theme.palette.mode === 'dark' ? theme.palette.primaryDark[700] : theme.palette.grey[200],
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = TextFieldComponent;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var React = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _TextField4 = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
11
10
|
var _Select5 = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
@@ -20,19 +19,25 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
20
19
|
const Select2 = () => _MuiSelect || (_MuiSelect = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select6.default, {}));
|
|
21
20
|
function TextFieldComponent(props) {
|
|
22
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
23
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default,
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
23
|
+
...props
|
|
24
|
+
}), _TextField || (_TextField = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
24
25
|
variant: "outlined"
|
|
25
26
|
})), _TextField2 || (_TextField2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
26
27
|
variant: "standard"
|
|
27
28
|
})), _TextField3 || (_TextField3 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
28
29
|
variant: "filled"
|
|
29
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default,
|
|
30
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
31
|
+
...props
|
|
32
|
+
}), _Select || (_Select = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
30
33
|
variant: "outlined"
|
|
31
34
|
})), _Select2 || (_Select2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
32
35
|
variant: "standard"
|
|
33
36
|
})), _Select3 || (_Select3 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
34
37
|
variant: "filled"
|
|
35
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default,
|
|
38
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
39
|
+
...props
|
|
40
|
+
}), _FormControl || (_FormControl = /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
36
41
|
variant: "outlined"
|
|
37
42
|
})), _FormControl2 || (_FormControl2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
38
43
|
variant: "standard"
|
|
@@ -41,10 +46,11 @@ function TextFieldComponent(props) {
|
|
|
41
46
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(Autocomplete, {
|
|
42
47
|
options: [],
|
|
43
48
|
getOptionLabel: option => option.title,
|
|
44
|
-
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default,
|
|
49
|
+
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
50
|
+
...params,
|
|
45
51
|
label: "Combo box",
|
|
46
52
|
variant: "outlined"
|
|
47
|
-
})
|
|
53
|
+
})
|
|
48
54
|
}), _CustomSelect || (_CustomSelect = /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomSelect, {})), _SelectedRoute || (_SelectedRoute = /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectedRoute, {})), _FromToSelect || (_FromToSelect = /*#__PURE__*/(0, _jsxRuntime.jsx)(FromToSelect, {})), _FromToSelectDrawer || (_FromToSelectDrawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(FromToSelectDrawer, {})), _MuiTextField || (_MuiTextField = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField5.default, {})), _Select4 || (_Select4 = /*#__PURE__*/(0, _jsxRuntime.jsx)(Select2, {})), _MuiFormControl || (_MuiFormControl = /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControl, {}))]
|
|
49
55
|
});
|
|
50
56
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = TextFieldComponent;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var React = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _TextField4 = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
11
10
|
var _Select5 = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
@@ -22,25 +21,28 @@ const Select2 = () => _MuiSelect || (_MuiSelect = /*#__PURE__*/(0, _jsxRuntime.j
|
|
|
22
21
|
}));
|
|
23
22
|
function TextFieldComponent(props) {
|
|
24
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
25
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default,
|
|
26
|
-
variant: "standard"
|
|
27
|
-
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
25
|
+
variant: "standard",
|
|
26
|
+
...props
|
|
27
|
+
}), _TextField || (_TextField = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
28
28
|
variant: "outlined"
|
|
29
29
|
})), _TextField2 || (_TextField2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
30
30
|
variant: "standard"
|
|
31
31
|
})), _TextField3 || (_TextField3 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
32
32
|
variant: "filled"
|
|
33
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default,
|
|
34
|
-
variant: "standard"
|
|
35
|
-
|
|
33
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
34
|
+
variant: "standard",
|
|
35
|
+
...props
|
|
36
|
+
}), _Select || (_Select = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
36
37
|
variant: "outlined"
|
|
37
38
|
})), _Select2 || (_Select2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
38
39
|
variant: "standard"
|
|
39
40
|
})), _Select3 || (_Select3 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select5.default, {
|
|
40
41
|
variant: "filled"
|
|
41
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default,
|
|
42
|
-
variant: "standard"
|
|
43
|
-
|
|
42
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
43
|
+
variant: "standard",
|
|
44
|
+
...props
|
|
45
|
+
}), _FormControl || (_FormControl = /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
44
46
|
variant: "outlined"
|
|
45
47
|
})), _FormControl2 || (_FormControl2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl4.default, {
|
|
46
48
|
variant: "standard"
|
|
@@ -49,10 +51,11 @@ function TextFieldComponent(props) {
|
|
|
49
51
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(Autocomplete, {
|
|
50
52
|
options: [],
|
|
51
53
|
getOptionLabel: option => option.title,
|
|
52
|
-
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default,
|
|
54
|
+
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField4.default, {
|
|
55
|
+
...params,
|
|
53
56
|
label: "Combo box",
|
|
54
57
|
variant: "outlined"
|
|
55
|
-
})
|
|
58
|
+
})
|
|
56
59
|
}), _CustomSelect || (_CustomSelect = /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomSelect, {})), _SelectedRoute || (_SelectedRoute = /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectedRoute, {})), _FromToSelect || (_FromToSelect = /*#__PURE__*/(0, _jsxRuntime.jsx)(FromToSelect, {})), _FromToSelectDrawer || (_FromToSelectDrawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(FromToSelectDrawer, {})), _MuiTextField || (_MuiTextField = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField5.default, {
|
|
57
60
|
variant: "standard"
|
|
58
61
|
})), _Select4 || (_Select4 = /*#__PURE__*/(0, _jsxRuntime.jsx)(Select2, {})), _MuiFormControl || (_MuiFormControl = /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControl, {
|
|
@@ -5,20 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
// FIXME checkout https://mui.com/components/use-media-query/#using-material-uis-breakpoint-helpers
|
|
12
|
-
const withMuiMobileDialog = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent,
|
|
11
|
+
const withMuiMobileDialog = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
|
|
12
|
+
...props,
|
|
13
13
|
width: "lg",
|
|
14
14
|
fullScreen: false
|
|
15
|
-
})
|
|
15
|
+
});
|
|
16
16
|
|
|
17
17
|
// FIXME checkout https://mui.com/components/use-media-query/#using-material-uis-breakpoint-helpers
|
|
18
|
-
const withMobileDialog = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent,
|
|
18
|
+
const withMobileDialog = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
|
|
19
|
+
...props,
|
|
19
20
|
width: "lg",
|
|
20
21
|
fullScreen: false
|
|
21
|
-
})
|
|
22
|
+
});
|
|
22
23
|
const A = withMobileDialog()(props => {
|
|
23
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
24
25
|
children: props.width
|
|
@@ -5,18 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
// FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
|
|
12
|
-
const withMuiWidth = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent,
|
|
11
|
+
const withMuiWidth = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
|
|
12
|
+
...props,
|
|
13
13
|
width: "xs"
|
|
14
|
-
})
|
|
14
|
+
});
|
|
15
15
|
|
|
16
16
|
// FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
|
|
17
|
-
const withWidth = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent,
|
|
17
|
+
const withWidth = () => WrappedComponent => props => /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
|
|
18
|
+
...props,
|
|
18
19
|
width: "xs"
|
|
19
|
-
})
|
|
20
|
+
});
|
|
20
21
|
const A = withWidth()(props => {
|
|
21
22
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
23
|
children: props.width
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = v6All;
|
|
8
|
+
var _listItemButtonProp = _interopRequireDefault(require("../list-item-button-prop/list-item-button-prop"));
|
|
7
9
|
/**
|
|
8
10
|
* @param {import('jscodeshift').FileInfo} file
|
|
9
11
|
* @param {import('jscodeshift').API} api
|
|
10
12
|
*/
|
|
11
|
-
function v6All(file) {
|
|
12
|
-
|
|
13
|
-
// - Read mui-codemod/CONTRIBUTING.md
|
|
14
|
-
// - Follow mui-codemod/src/deprecations/all/deprecations-all.js as a guide
|
|
15
|
-
// - Remove this comment
|
|
13
|
+
function v6All(file, api, options) {
|
|
14
|
+
file.source = (0, _listItemButtonProp.default)(file, api, options);
|
|
16
15
|
return file.source;
|
|
17
16
|
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = gridV2Props;
|
|
7
|
+
const possibleDefaultImports = ['@mui/material/Grid2', '@mui/system/Grid', '@mui/joy/Grid'];
|
|
8
|
+
const possibleNamedImports = {
|
|
9
|
+
'@mui/material': 'Grid2',
|
|
10
|
+
'@mui/system': 'Grid',
|
|
11
|
+
'@mui/joy': 'Grid'
|
|
12
|
+
};
|
|
13
|
+
const defaultBreakpoints = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
17
|
+
* @param {import('jscodeshift').API} api
|
|
18
|
+
*/
|
|
19
|
+
function gridV2Props(file, api, options) {
|
|
20
|
+
if (file.path?.endsWith('.json') || file.path?.endsWith('.d.ts')) {
|
|
21
|
+
return file.source;
|
|
22
|
+
}
|
|
23
|
+
const j = api.jscodeshift;
|
|
24
|
+
const root = j(file.source);
|
|
25
|
+
const breakpoints = options.muiBreakpoints?.split(',') || defaultBreakpoints;
|
|
26
|
+
const printOptions = options.printOptions;
|
|
27
|
+
const gridLocalNames = [];
|
|
28
|
+
root.find(j.ImportDeclaration, decl => possibleDefaultImports.includes(decl.source.value)).forEach(decl => {
|
|
29
|
+
decl.node.specifiers.forEach(spec => {
|
|
30
|
+
if (spec.type === 'ImportDefaultSpecifier') {
|
|
31
|
+
gridLocalNames.push(spec.local.name);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
root.find(j.ImportDeclaration, decl => Object.keys(possibleNamedImports).includes(decl.source.value)).forEach(decl => {
|
|
36
|
+
decl.node.specifiers.forEach(spec => {
|
|
37
|
+
if (spec.type === 'ImportSpecifier') {
|
|
38
|
+
if (possibleNamedImports[decl.node.source.value] === spec.imported.name) {
|
|
39
|
+
gridLocalNames.push(spec.local.name);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
root.find(j.JSXElement, {
|
|
45
|
+
openingElement: {
|
|
46
|
+
name: {
|
|
47
|
+
name: name => gridLocalNames.includes(name)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}).forEach(el => {
|
|
51
|
+
const size = j.objectExpression([]);
|
|
52
|
+
const spreadProps = [];
|
|
53
|
+
const attributesToPrune = [];
|
|
54
|
+
el.node.openingElement.attributes.forEach(attr => {
|
|
55
|
+
if (attr.type === 'JSXSpreadAttribute') {
|
|
56
|
+
spreadProps.push(attr);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const breakpointNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && breakpoints.includes(path.node.name.name));
|
|
60
|
+
breakpointNodes.nodes().forEach(node => {
|
|
61
|
+
const breakpoint = node.name.name;
|
|
62
|
+
const nodeValue = node.value;
|
|
63
|
+
let value;
|
|
64
|
+
if (nodeValue === null) {
|
|
65
|
+
value = j.stringLiteral('grow');
|
|
66
|
+
} else if (nodeValue.type === 'JSXExpressionContainer') {
|
|
67
|
+
if (nodeValue.expression.value === true) {
|
|
68
|
+
value = j.stringLiteral('grow');
|
|
69
|
+
} else {
|
|
70
|
+
value = nodeValue.expression;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
value = nodeValue;
|
|
74
|
+
}
|
|
75
|
+
size.properties.push(j.property('init', j.identifier(breakpoint), value));
|
|
76
|
+
});
|
|
77
|
+
spreadProps.forEach(spreadProp => {
|
|
78
|
+
const spreadPropArgument = spreadProp.argument;
|
|
79
|
+
if (spreadPropArgument.type === 'ObjectExpression') {
|
|
80
|
+
const propertiesToPrune = [];
|
|
81
|
+
spreadPropArgument.properties.forEach(property => {
|
|
82
|
+
if (breakpoints.includes(property.key.name)) {
|
|
83
|
+
size.properties.push(j.property('init', property.key, property.value));
|
|
84
|
+
propertiesToPrune.push(property.key.name);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
spreadPropArgument.properties = spreadPropArgument.properties.filter(prop => !propertiesToPrune.includes(prop.key.name));
|
|
88
|
+
if (spreadPropArgument.properties.length === 0) {
|
|
89
|
+
attributesToPrune.push(spreadProp);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (size.properties.length) {
|
|
94
|
+
let sizePropValue = size;
|
|
95
|
+
if (size.properties.length === 1 && size.properties[0].key.name === 'xs') {
|
|
96
|
+
sizePropValue = size.properties[0].value;
|
|
97
|
+
}
|
|
98
|
+
if (sizePropValue.type !== 'StringLiteral') {
|
|
99
|
+
sizePropValue = j.jsxExpressionContainer(sizePropValue);
|
|
100
|
+
}
|
|
101
|
+
el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('size'), sizePropValue));
|
|
102
|
+
}
|
|
103
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !breakpoints.includes(attr?.name?.name));
|
|
104
|
+
const offset = j.objectExpression([]);
|
|
105
|
+
const offsetNodes = j(el).find(j.JSXAttribute).filter(path => path.parent.parent.node === el.node && path.node.name.name.endsWith('Offset') && breakpoints.includes(path.node.name.name.replace('Offset', '')));
|
|
106
|
+
offsetNodes.nodes().forEach(node => {
|
|
107
|
+
const breakpoint = node.name.name.replace('Offset', '');
|
|
108
|
+
const value = node.value.type === 'JSXExpressionContainer' ? node.value.expression : node.value;
|
|
109
|
+
offset.properties.push(j.property('init', j.identifier(breakpoint), value));
|
|
110
|
+
});
|
|
111
|
+
spreadProps.forEach(spreadProp => {
|
|
112
|
+
const spreadPropArgument = spreadProp.argument;
|
|
113
|
+
if (spreadPropArgument.type === 'ObjectExpression') {
|
|
114
|
+
const propertiesToPrune = [];
|
|
115
|
+
spreadPropArgument.properties.forEach(property => {
|
|
116
|
+
const breakpoint = property.key.name.replace('Offset', '');
|
|
117
|
+
if (property.key.name.endsWith('Offset') && breakpoints.includes(breakpoint)) {
|
|
118
|
+
offset.properties.push(j.property('init', j.identifier(breakpoint), property.value));
|
|
119
|
+
propertiesToPrune.push(property.key.name);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
spreadPropArgument.properties = spreadPropArgument.properties.filter(prop => !propertiesToPrune.includes(prop.key.name));
|
|
123
|
+
if (spreadPropArgument.properties.length === 0) {
|
|
124
|
+
attributesToPrune.push(spreadProp);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
if (offset.properties.length) {
|
|
129
|
+
let offsetPropValue = offset;
|
|
130
|
+
if (offset.properties.length === 1 && offset.properties[0].key.name === 'xs') {
|
|
131
|
+
offsetPropValue = offset.properties[0].value;
|
|
132
|
+
}
|
|
133
|
+
if (offsetPropValue.type !== 'StringLiteral') {
|
|
134
|
+
offsetPropValue = j.jsxExpressionContainer(offsetPropValue);
|
|
135
|
+
}
|
|
136
|
+
el.node.openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('offset'), offsetPropValue));
|
|
137
|
+
}
|
|
138
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !breakpoints.includes(attr?.name?.name.replace('Offset', '')));
|
|
139
|
+
el.node.openingElement.attributes = el.node.openingElement.attributes.filter(attr => !attributesToPrune.includes(attr));
|
|
140
|
+
});
|
|
141
|
+
return root.toSource(printOptions);
|
|
142
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _gridV2Props.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _gridV2Props = _interopRequireDefault(require("./grid-v2-props"));
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid2"));
|
|
5
|
+
var _Grid2 = _interopRequireDefault(require("@mui/material/Grid"));
|
|
6
|
+
var _Grid3 = _interopRequireDefault(require("@mui/system/Grid"));
|
|
7
|
+
var _Grid4 = _interopRequireDefault(require("@mui/joy/Grid"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _system = require("@mui/system");
|
|
10
|
+
var _joy = require("@mui/joy");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
// Transforms on all the possible imports
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
14
|
+
xs: 2
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid3.default, {
|
|
17
|
+
xs: 2
|
|
18
|
+
});
|
|
19
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid4.default, {
|
|
20
|
+
xs: 2
|
|
21
|
+
});
|
|
22
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid2, {
|
|
23
|
+
xs: 2
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Grid, {
|
|
26
|
+
xs: 2
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_joy.Grid, {
|
|
29
|
+
xs: 2
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Transforms responsive sizes
|
|
33
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
34
|
+
xs: 2,
|
|
35
|
+
sm: 4,
|
|
36
|
+
md: 6,
|
|
37
|
+
lg: 8,
|
|
38
|
+
xl: 10
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Transforms all the possible size values
|
|
42
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
43
|
+
xs: true,
|
|
44
|
+
sm: "auto",
|
|
45
|
+
md: 2,
|
|
46
|
+
lg: true,
|
|
47
|
+
xl: false
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Doesn't add jsx object expression for single string values
|
|
51
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
52
|
+
xs: "auto"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Transforms offset
|
|
56
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
57
|
+
xsOffset: 2
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Transforms responsive offset
|
|
61
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
62
|
+
xsOffset: 2,
|
|
63
|
+
smOffset: 4,
|
|
64
|
+
mdOffset: 6,
|
|
65
|
+
lgOffset: 8,
|
|
66
|
+
xlOffset: 10
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Transforms all the possible offset values
|
|
70
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
71
|
+
xsOffset: 2,
|
|
72
|
+
smOffset: "auto"
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Transforms spread props
|
|
76
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
77
|
+
xs: 2,
|
|
78
|
+
sm: 4,
|
|
79
|
+
xsOffset: 0,
|
|
80
|
+
smOffset: 2
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Doesn't transform Grid v1
|
|
84
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid2.default, {
|
|
85
|
+
xs: 2
|
|
86
|
+
});
|
|
87
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
88
|
+
xs: 2
|
|
89
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid2"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
// Transforms custom breakpoints
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
8
|
+
customXs: 2,
|
|
9
|
+
customSm: 4,
|
|
10
|
+
customMd: 6
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// Transforms custom breakpoints offset
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
15
|
+
customXsOffset: 2,
|
|
16
|
+
customSmOffset: 4,
|
|
17
|
+
customMdOffset: 6
|
|
18
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid2"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
// Transforms custom breakpoints
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
8
|
+
size: {
|
|
9
|
+
customXs: 2,
|
|
10
|
+
customSm: 4,
|
|
11
|
+
customMd: 6
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Transforms custom breakpoints offset
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
17
|
+
offset: {
|
|
18
|
+
customXs: 2,
|
|
19
|
+
customSm: 4,
|
|
20
|
+
customMd: 6
|
|
21
|
+
}
|
|
22
|
+
});
|