Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mui/material-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d4a3216cdd858899960f945d6e00b2d59bf1d5d1
Choose a base ref
...
head repository: mui/material-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7bd7c219e2670ff7791148e9b1a1d2387528fc0c
Choose a head ref

Commits on Oct 3, 2022

  1. Copy the full SHA
    16e6180 View commit details
  2. Copy the full SHA
    f8d3ab9 View commit details

Commits on Oct 4, 2022

  1. Copy the full SHA
    e72393b View commit details
  2. [docs] Explain the purpose of renderGroup prop (#34066)

    Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
    Co-authored-by: Marija Najdova <mnajdova@gmail.com>
    3 people authored Oct 4, 2022
    Copy the full SHA
    63d16e7 View commit details

Commits on Oct 5, 2022

  1. Copy the full SHA
    ac157e3 View commit details
  2. Copy the full SHA
    f235e8e View commit details
  3. Copy the full SHA
    1e09429 View commit details
  4. Copy the full SHA
    ef9f93b View commit details
  5. Copy the full SHA
    3137c48 View commit details

Commits on Oct 6, 2022

  1. Copy the full SHA
    0246ec2 View commit details
  2. Copy the full SHA
    7ce9be6 View commit details
  3. Copy the full SHA
    b7ddf7c View commit details

Commits on Oct 7, 2022

  1. Copy the full SHA
    d3010f1 View commit details

Commits on Oct 9, 2022

  1. [system] Fix typo in createCssVarsProvider (#34661)

    Signed-off-by: VelociRaptor <77036902+HexM7@users.noreply.github.com>
    zignis authored Oct 9, 2022
    Copy the full SHA
    5aeb965 View commit details

Commits on Oct 10, 2022

  1. [blog] Blog post for MUI X v6 alpha zero (#34424)

    Signed-off-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
    Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
    Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
    Co-authored-by: Flavien DELANGLE <flaviendelangle@gmail.com>
    4 people authored Oct 10, 2022
    1
    Copy the full SHA
    e4c5bff View commit details
  2. Bump yargs to ^17.6.0 (#34684)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    989b4f8 View commit details
  3. Bump typescript-eslint to ^5.39.0 (#34683)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    ce6c3e1 View commit details
  4. Bump theme-ui to ^0.15.1 (#34682)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    2c5945b View commit details
  5. Bump lerna to ^5.6.2 (#34681)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    999f0ac View commit details
  6. Bump eslint to ^8.25.0 (#34679)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    adc2984 View commit details
  7. Bump aws-sdk to ^2.1231.0 (#34678)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    cdd286b View commit details
  8. Bump react-router-dom to ^6.4.2 (#34675)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    99e456a View commit details
  9. Bump danger to ^11.1.4 (#34671)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    94fcb8f View commit details
  10. Bump @types/node to ^16.11.64 (#34669)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    40d6727 View commit details
  11. Bump @mdx-js/react to ^2.1.4 (#34668)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    4ac3622 View commit details
  12. Bump @chakra-ui/system to ^2.2.12 (#34667)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    bf8492c View commit details
  13. Bump MUI X (#34670)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    007af22 View commit details
  14. Bump @types/mocha to ^10.0.0 (#34685)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 10, 2022
    Copy the full SHA
    4d88354 View commit details
  15. Bump @testing-library/dom to ^8.19.0 (#34676)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Michał Dudak <michal@dudak.me>
    renovate[bot] and michaldudak authored Oct 10, 2022
    Copy the full SHA
    61f1227 View commit details
  16. Bump flexsearch to ^0.7.31 (#34673)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Michał Dudak <michal@dudak.me>
    renovate[bot] and michaldudak authored Oct 10, 2022
    Copy the full SHA
    13ff52c View commit details
  17. Copy the full SHA
    daed91d View commit details

Commits on Oct 11, 2022

  1. Copy the full SHA
    0c4b1f5 View commit details
  2. [docs] Revert #34541 (#34700)

    michaldudak authored Oct 11, 2022
    Copy the full SHA
    3b779c2 View commit details
  3. v5.10.9 (#34704)

    hbjORbj authored Oct 11, 2022
    Copy the full SHA
    7bd7c21 View commit details
Showing with 3,127 additions and 1,276 deletions.
  1. +1 −1 .circleci/config.yml
  2. +117 −0 CHANGELOG.md
  3. +6 −6 benchmark/package.json
  4. +175 −0 docs/data/base/components/select/UnstyledSelectForm.js
  5. +183 −0 docs/data/base/components/select/UnstyledSelectForm.tsx
  6. +1 −1 docs/data/base/components/select/UnstyledSelectRichOptions.js
  7. +1 −1 docs/data/base/components/select/UnstyledSelectRichOptions.tsx
  8. +5 −0 docs/data/base/components/select/UnstyledSelectSimple.tsx copy.preview
  9. +15 −1 docs/data/base/components/select/select.md
  10. +17 −0 docs/data/joy/components/button/ButtonLoading.js
  11. +17 −0 docs/data/joy/components/button/ButtonLoading.tsx
  12. +6 −0 docs/data/joy/components/button/ButtonLoading.tsx.preview
  13. +22 −0 docs/data/joy/components/button/ButtonLoadingPosition.js
  14. +22 −0 docs/data/joy/components/button/ButtonLoadingPosition.tsx
  15. +11 −0 docs/data/joy/components/button/ButtonLoadingPosition.tsx.preview
  16. +18 −0 docs/data/joy/components/button/button.md
  17. +167 −0 docs/data/joy/components/css-baseline/css-baseline.md
  18. +4 −2 docs/data/joy/getting-started/templates/email/components/EmailContent.tsx
  19. +5 −15 docs/data/joy/getting-started/tutorial/LoginFinal.js
  20. +13 −21 docs/data/joy/getting-started/tutorial/tutorial.md
  21. +5 −0 docs/data/joy/pages.ts
  22. +1 −1 docs/data/material/components/autocomplete/CountrySelect.js
  23. +1 −1 docs/data/material/components/autocomplete/CountrySelect.tsx
  24. +174 −0 docs/data/material/components/autocomplete/RenderGroup.js
  25. +174 −0 docs/data/material/components/autocomplete/RenderGroup.tsx
  26. +14 −0 docs/data/material/components/autocomplete/RenderGroup.tsx.preview
  27. +10 −0 docs/data/material/components/autocomplete/autocomplete.md
  28. +2 −2 docs/data/material/experimental-api/css-theme-variables/migration.md
  29. +16 −16 docs/package.json
  30. +1 −1 docs/packages/feedback/package.json
  31. +2 −2 docs/packages/markdown/loader.js
  32. +7 −0 docs/pages/blog/mui-x-v6-alpha-zero.js
  33. +104 −0 docs/pages/blog/mui-x-v6-alpha-zero.md
  34. +7 −0 docs/pages/joy-ui/react-css-baseline.js
  35. +1 −0 docs/public/_redirects
  36. +6 −11 docs/src/components/home/Hero.tsx
  37. +14 −1 docs/src/modules/components/Demo.js
  38. +1 −1 docs/src/modules/sandbox/Dependencies.ts
  39. +10 −10 package.json
  40. +1 −1 packages/eslint-plugin-material-ui/package.json
  41. +2 −2 packages/mui-base/package.json
  42. +1 −4 packages/mui-base/src/ButtonUnstyled/useButton.ts
  43. +1 −1 packages/mui-base/src/MultiSelectUnstyled/MultiSelectUnstyled.tsx
  44. +1 −1 packages/mui-base/src/SelectUnstyled/SelectUnstyled.tsx
  45. +1 −6 packages/mui-base/src/SelectUnstyled/useSelect.ts
  46. +2 −0 packages/mui-base/src/SliderUnstyled/SliderUnstyled.js
  47. +43 −0 packages/mui-base/src/SliderUnstyled/SliderUnstyled.test.js
  48. +2 −1 packages/mui-base/src/utils/useSlotProps.ts
  49. +2 −2 packages/mui-codemod/package.json
  50. +1 −1 packages/mui-core-downloads-tracker/package.json
  51. +2 −2 packages/mui-docs/package.json
  52. +2 −2 packages/mui-icons-material/package.json
  53. +5 −5 packages/mui-joy/package.json
  54. +13 −0 packages/mui-joy/src/Button/Button.spec.tsx
  55. +96 −0 packages/mui-joy/src/Button/Button.test.js
  56. +85 −6 packages/mui-joy/src/Button/Button.tsx
  57. +17 −0 packages/mui-joy/src/Button/ButtonProps.ts
  58. +6 −0 packages/mui-joy/src/Button/buttonClasses.ts
  59. +85 −0 packages/mui-joy/src/CssBaseline/CssBaseline.tsx
  60. +14 −0 packages/mui-joy/src/CssBaseline/CssBaselineProps.ts
  61. +2 −0 packages/mui-joy/src/CssBaseline/index.ts
  62. +1 −0 packages/mui-joy/src/GlobalStyles/index.ts
  63. +1 −1 packages/mui-joy/src/Option/OptionProps.ts
  64. +20 −0 packages/mui-joy/src/ScopedCssBaseline/ScopedCssBaseline.test.tsx
  65. +127 −0 packages/mui-joy/src/ScopedCssBaseline/ScopedCssBaseline.tsx
  66. +33 −0 packages/mui-joy/src/ScopedCssBaseline/ScopedCssBaselineProps.ts
  67. +3 −0 packages/mui-joy/src/ScopedCssBaseline/index.ts
  68. +16 −0 packages/mui-joy/src/ScopedCssBaseline/scopedCssBaselineClasses.ts
  69. +8 −0 packages/mui-joy/src/index.ts
  70. +1 −0 packages/mui-joy/src/styles/CssVarsProvider.tsx
  71. +9 −0 packages/mui-joy/src/styles/components.d.ts
  72. +1 −0 packages/mui-joy/src/styles/defaultTheme.test.js
  73. +1 −0 packages/mui-joy/src/styles/defaultTheme.ts
  74. +14 −0 packages/mui-joy/src/styles/extendTheme.spec.ts
  75. +2 −0 packages/mui-joy/src/styles/extendTheme.ts
  76. +1 −0 packages/mui-joy/src/styles/types/colorSystem.ts
  77. +4 −2 packages/mui-joy/src/styles/types/theme.ts
  78. +4 −4 packages/mui-lab/package.json
  79. +5 −5 packages/mui-material-next/package.json
  80. +5 −5 packages/mui-material/package.json
  81. +1 −2 packages/mui-material/src/ButtonBase/ButtonBase.js
  82. +11 −1 packages/mui-material/src/CssBaseline/CssBaseline.js
  83. +1 −2 packages/mui-material/src/Fade/Fade.js
  84. +1 −2 packages/mui-material/src/Grow/Grow.js
  85. +7 −3 packages/mui-material/src/InputBase/InputBase.js
  86. +1 −2 packages/mui-material/src/Rating/Rating.js
  87. +9 −0 packages/mui-material/src/ScopedCssBaseline/ScopedCssBaseline.js
  88. +1 −2 packages/mui-material/src/Slide/Slide.js
  89. +1 −3 packages/mui-material/src/Tooltip/Tooltip.js
  90. +1 −1 packages/mui-material/src/Unstable_TrapFocus/index.d.ts
  91. +1 −2 packages/mui-material/src/Zoom/Zoom.js
  92. +1 −1 packages/mui-material/src/styles/experimental_extendTheme.d.ts
  93. +0 −169 packages/mui-material/src/utils/index.test.js
  94. +29 −0 packages/mui-material/src/utils/isMuiElement.test.js
  95. +2 −2 packages/mui-private-theming/package.json
  96. +3 −3 packages/mui-styles/package.json
  97. +3 −3 packages/mui-system/package.json
  98. +2 −2 packages/mui-system/src/Unstable_Grid/createGrid.tsx
  99. +16 −0 packages/mui-system/src/Unstable_Grid/gridGenerator.test.js
  100. +15 −1 packages/mui-system/src/Unstable_Grid/gridGenerator.ts
  101. +0 −5 packages/mui-system/src/cssVars/createCssVarsProvider.d.ts
  102. +47 −47 packages/mui-system/src/cssVars/createCssVarsProvider.js
  103. +0 −109 packages/mui-system/src/cssVars/createCssVarsProvider.test.js
  104. +0 −9 packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx
  105. +1 −1 packages/mui-utils/package.json
  106. +38 −0 packages/mui-utils/src/setRef.test.ts
  107. +110 −0 packages/mui-utils/src/useForkRef.test.js
  108. +12 −10 packages/mui-utils/src/useForkRef.ts
  109. +1 −1 packages/typescript-to-proptypes/package.json
  110. +25 −0 test/regressions/fixtures/CssBaseline/JoyCssBaseline.js
  111. +32 −0 test/regressions/fixtures/CssBaseline/JoyScopedCssBaseline.js
  112. +25 −0 test/regressions/fixtures/CssBaseline/MaterialCssBaseline.js
  113. +41 −0 test/regressions/fixtures/CssBaseline/MaterialScopedCssBaseline.js
  114. +693 −748 yarn.lock
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ commands:
- v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
- run:
name: Install js dependencies
command: yarn install --verbose
command: yarn install
environment:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: <<# parameters.browsers >>0<</ parameters.browsers >><<^ parameters.browsers >>1<</ parameters.browsers >>
- save_cache:
117 changes: 117 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,122 @@
# [Versions](https://mui.com/versions/)

## 5.10.9

<!-- generated comparing v5.10.8..master -->

_Oct 10, 2022_

A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:

- 🚀 [Joy] Button loading functionality has been added by @kushagra010 (#34658)
- And more 🐛 bug fixes and 📚 documentation improvements.

### `@mui/material@5.10.9`

- &#8203;<!-- 16 -->[Grid v2][system] Handle direction object prop for responsive design (#34574) @vanyaxk
- &#8203;<!-- 03 -->[Slider] Fix unnecessary accessibility attribute in root element (#34610) @vanyaxk

### `@mui/system@5.10.9`

#### BREAKING CHANGE

- &#8203;<!-- 17 -->[system] Fix color-scheme implementation (#34639) @siriwatknp

The `enableColorScheme` prop has been removed from `CssVarsProvider` and `getInitColorScheme` (both Material UI and Joy UI).

Migration:

- **Material UI**: you can enable the CSS color scheme via `<CssBaseline enableColorScheme />`.
- **Joy UI**: it is enabled automatically if you use `<CssBaseline />`, [see the docs](https://mui.com/joy-ui/react-css-baseline/).

#### Changes

- &#8203;<!-- 02 -->[system] Fix typo in createCssVarsProvider (#34661) @HexM7

### `@mui/base@5.0.0-alpha.101`

- &#8203;<!-- 01 -->[TrapFocus] Restore the previously exported type from @mui/material (#34601) @michaldudak

### `@mui/joy@5.0.0-alpha.49`

- &#8203;<!-- 04 -->[Joy] Add button loading functionality (#34658) @kushagra010

### Docs

- &#8203;<!-- 18 -->[docs] Revert #34541 (#34700) @michaldudak
- &#8203;<!-- 15 -->[blog] Blog post for MUI X v6 alpha zero (#34424) @joserodolfofreitas
- &#8203;<!-- 09 -->[docs] Improve Joy UI tutorial demo (#34653) @oliviertassinari
- &#8203;<!-- 08 -->[docs] Explain how SelectUnstyled renders a hidden input (#34638) @michaldudak
- &#8203;<!-- 07 -->[docs] Fix Taiwan description (#34611) @oliviertassinari
- &#8203;<!-- 06 -->[docs] Fix codesandbox export with dayjs (#34619) @oliviertassinari
- &#8203;<!-- 05 -->[docs] Explain the purpose of renderGroup prop (#34066) @michaldudak

### Core

- &#8203;<!-- 14 -->[core] Make useForkRef variadic (#27939) @michaldudak
- &#8203;<!-- 13 -->[core] Speedup of yarn install in the CI (#34632) @oliviertassinari
- &#8203;<!-- 12 -->[core] Fix markdown loader on Windows (#34623) @michaldudak
- &#8203;<!-- 11 -->[core] Update changelog for version v5.10.8 (#34593) @mnajdova
- &#8203;<!-- 10 -->[core] Update root package.json version (#34592) @mnajdova

All contributors of this release in alphabetical order: @HexM7, @joserodolfofreitas, @kushagra010, @michaldudak, @mnajdova, @oliviertassinari, @vanyaxk

## 5.10.8

<!-- generated comparing v5.10.7..master -->

_Oct 3, 2022_

A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:

- 🚀 [SnackbarUnstyled](https://mui.com/base/react-snackbar/) component & headless hook are added to MUI Base (#33227) @ZeeshanTamboli
- 📚 [CSS variables documentation](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/) for Material UI has been added by @siriwatknp (#33958)
- And more 🐛 bug fixes and 📚 documentation improvements.

### `@mui/material@5.10.8`

- &#8203;<!-- 28 -->[Autocomplete] Skip filtering when list of options is loading (#33278) @ndebeiss
- &#8203;<!-- 13 -->[Fab] Add `disabled` class to FAB button (#34245) @meenarama
- &#8203;<!-- 09 -->[l10n] Add Arabic Saudi Arabia (ar-SA) locale (#33340) @rolule
- &#8203;<!-- 08 -->[l10n] zhTW refinement (#33391) @Aporim2051
- &#8203;<!-- 07 -->[Popover] Add `ownerState` on the paper slot (#34445) @kabernardes
- &#8203;<!-- 05 -->[Slider] Fixed incorrect marks displayed due to duplicate keys in range (#33526) @kskd1804
- &#8203;<!-- 03 -->[TextField] Fix typo in FormControlLabel declaration file (#34535) @hghmn

### `@mui/base@5.0.0-alpha.100`

- &#8203;<!-- 04 -->[SnackbarUnstyled] Create component and `useSnackbar` hook (#33227) @ZeeshanTamboli

### `@mui/joy@5.0.0-alpha.48`

- &#8203;<!-- 12 -->[Joy] Fix `variantPlain` classname missing in few components (#34534) @hbjORbj
- &#8203;<!-- 11 -->[Joy] Fix input decorator color and list padding (#34586) @siriwatknp
- &#8203;<!-- 10 -->[Joy] Miscellaneous fixes (#34492) @siriwatknp

### Docs

- &#8203;<!-- 27 -->[blog] Fix 404 link in base introduction @oliviertassinari
- &#8203;<!-- 21 -->[docs] Fix CI build (#34589) @mnajdova
- &#8203;<!-- 20 -->[docs] Temporary remove date picker from home page (#34541) @siriwatknp
- &#8203;<!-- 19 -->[docs] Revise and expand Joy UI "Tutorial" doc (#34569) @samuelsycamore
- &#8203;<!-- 18 -->[docs] Fix SEO issues (#34537) @oliviertassinari
- &#8203;<!-- 17 -->[docs] Add CSS variables documentation for Material UI (#33958) @siriwatknp
- &#8203;<!-- 16 -->[docs] Capitalize Material Design on the Breakpoints page (#34481) @Dustin-Digitar
- &#8203;<!-- 15 -->[docs] Able to load doc components inside markdown files (#34243) @flaviendelangle
- &#8203;<!-- 14 -->[docs] Use mouse pointer on esc button in the search modal (#34485) @minkyngkm
- &#8203;<!-- 02 -->[website] Fix typo in pricing FAQ @oliviertassinari
- &#8203;<!-- 01 -->[website] Move the React Engineer role from open to next (#34494) @mnajdova

### Core

- &#8203;<!-- 26 -->[core] Update root package.json version (#34592) @mnajdova
- &#8203;<!-- 25 -->[core] Remove useless comment in fixtures (#34581) @Garz4
- &#8203;<!-- 24 -->[core] Fix link to CODE_OF_CONDUCT.md (#34543) @peippo
- &#8203;<!-- 23 -->[core] Remove outdated docsearch.js dependency (#34421) @oliviertassinari
- &#8203;<!-- 22 -->[core] Add `newFeature` to the typing of MuiPage (#34511) @flaviendelangle

All contributors of this release in alphabetical order: @Aporim2051, @Dustin-Digitar, @flaviendelangle, @Garz4, @hbjORbj, @hghmn, @kabernardes, @kskd1804, @meenarama, @minkyngkm, @mnajdova, @ndebeiss, @oliviertassinari, @peippo, @rolule, @samuelsycamore, @siriwatknp, @ZeeshanTamboli

## 5.10.7

<!-- generated comparing v5.10.6..master -->
12 changes: 6 additions & 6 deletions benchmark/package.json
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@
"server:system": "cd ../ && cross-env NODE_ENV=production BABEL_ENV=benchmark babel-node benchmark/server/scenarios/system.js --inspect=0.0.0.0:9229 --extensions \".tsx,.ts,.js\""
},
"dependencies": {
"@chakra-ui/system": "^2.2.11",
"@chakra-ui/system": "^2.2.12",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mdx-js/react": "^2.1.3",
"@mui/material": "^5.10.8",
"@mui/styles": "^5.10.8",
"@mui/system": "^5.10.8",
"@mdx-js/react": "^2.1.4",
"@mui/material": "^5.10.9",
"@mui/styles": "^5.10.9",
"@mui/system": "^5.10.9",
"@styled-system/css": "^5.1.5",
"benchmark": "^2.1.4",
"playwright": "^1.26.1",
@@ -29,7 +29,7 @@
"redux": "^4.2.0",
"serve-handler": "^6.1.3",
"styled-components": "^5.3.6",
"theme-ui": "^0.14.7",
"theme-ui": "^0.15.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
175 changes: 175 additions & 0 deletions docs/data/base/components/select/UnstyledSelectForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import * as React from 'react';
import SelectUnstyled, { selectUnstyledClasses } from '@mui/base/SelectUnstyled';
import OptionUnstyled, { optionUnstyledClasses } from '@mui/base/OptionUnstyled';
import PopperUnstyled from '@mui/base/PopperUnstyled';
import { styled, Box } from '@mui/system';

const blue = {
100: '#DAECFF',
200: '#99CCF3',
400: '#3399FF',
500: '#007FFF',
600: '#0072E5',
900: '#003A75',
};

const grey = {
50: '#f6f8fa',
100: '#eaeef2',
200: '#d0d7de',
300: '#afb8c1',
400: '#8c959f',
500: '#6e7781',
600: '#57606a',
700: '#424a53',
800: '#32383f',
900: '#24292f',
};

const StyledButton = styled('button')(
({ theme }) => `
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
box-sizing: border-box;
min-height: calc(1.5em + 22px);
min-width: 320px;
padding: 12px;
border-radius: 12px;
text-align: left;
line-height: 1.5;
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
transition-property: all;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 120ms;
&:hover {
background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]};
border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]};
}
&.${selectUnstyledClasses.focusVisible} {
border-color: ${blue[400]};
outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}
&.${selectUnstyledClasses.expanded} {
&::after {
content: '▴';
}
}
&::after {
content: '▾';
float: right;
}
`,
);

const StyledListbox = styled('ul')(
({ theme }) => `
font-family: IBM Plex Sans, sans-serif;
font-size: 0.875rem;
box-sizing: border-box;
padding: 6px;
margin: 12px 0;
min-width: 320px;
border-radius: 12px;
overflow: auto;
outline: 0px;
background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'};
border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]};
`,
);

const StyledOption = styled(OptionUnstyled)(
({ theme }) => `
list-style: none;
padding: 8px;
border-radius: 8px;
cursor: default;
&:last-of-type {
border-bottom: none;
}
&.${optionUnstyledClasses.selected} {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
&.${optionUnstyledClasses.highlighted} {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}
&.${optionUnstyledClasses.highlighted}.${optionUnstyledClasses.selected} {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
&.${optionUnstyledClasses.disabled} {
color: ${theme.palette.mode === 'dark' ? grey[700] : grey[400]};
}
&:hover:not(.${optionUnstyledClasses.disabled}) {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}
`,
);

const StyledPopper = styled(PopperUnstyled)`
z-index: 1;
`;

const Label = styled('label')(
({ theme }) => `
font-family: IBM Plex Sans, sans-serif;
font-size: 0.85rem;
display: block;
margin-bottom: 4px;
font-weight: 400;
color: ${theme.palette.mode === 'dark' ? grey[400] : grey[700]};
`,
);

const CustomSelect = React.forwardRef(function CustomSelect(props, ref) {
const components = {
Root: StyledButton,
Listbox: StyledListbox,
Popper: StyledPopper,
...props.components,
};

return <SelectUnstyled {...props} ref={ref} components={components} />;
});

export default function UnstyledSelectForm() {
return (
<div>
<Box sx={{ mb: 2 }}>
<Label htmlFor="unnamed-select">Default</Label>
<CustomSelect defaultValue={10} id="unnamed-select">
<StyledOption value={10}>Ten</StyledOption>
<StyledOption value={20}>Twenty</StyledOption>
<StyledOption value={30}>Thirty</StyledOption>
</CustomSelect>
</Box>
<Box>
<Label htmlFor="named-select">
With the <code>name</code> prop
</Label>
<CustomSelect defaultValue={10} id="named-select" name="demo-select">
<StyledOption value={10}>Ten</StyledOption>
<StyledOption value={20}>Twenty</StyledOption>
<StyledOption value={30}>Thirty</StyledOption>
</CustomSelect>
</Box>
</div>
);
}
Loading