-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[Slider] Add sx prop in SliderStyled #23205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 87 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
c2d31cc
add emotion peer dependencies
mnajdova 5ae933f
fixed types & tests
mnajdova 18b0668
prettier
mnajdova f0ef95c
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova c7bebb8
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova 92b2d6e
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova 13da531
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova cf5d9a5
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova b8d1291
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova a9d8690
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova 74dc451
wip
mnajdova 688d13a
fixed typo
mnajdova 497830a
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova d50ea1e
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova a1da207
added cross-env
mnajdova 6ff31f9
yarn lock
mnajdova 9fd7f7b
version
mnajdova e561135
Merge branch 'feat/benchmark-window-fix' into feat/update-box-to-use-…
mnajdova 2a71a6e
fixes
mnajdova 77d6017
prettier
mnajdova a3beed3
removed cross-env dependency
mnajdova 0b2d503
removed unused theme
mnajdova eddfa14
reversed style fn
mnajdova 83e0ea2
sx wip
mnajdova ff2d4c3
Updated box filterProps
mnajdova f7a74e9
prettier
mnajdova bc55cdb
Merge remote-tracking branch 'origin/feat/update-box-to-use-emotion' …
mnajdova 72893a9
merge conflicts
mnajdova d596058
cleanup
mnajdova 94c905d
Update docs/src/pages/components/slider-styled/ContinuousSlider.js
mnajdova f179fb9
Update docs/src/pages/components/slider-styled/ContinuousSlider.tsx
mnajdova 0373182
updated scenarios to be in the correct benchmark
mnajdova 6021478
cleaned up benchmark scenarios
mnajdova 5a70cf2
Merge branch 'feat/box-sx-prop' of https://github.com/mnajdova/materi…
mnajdova 92847d7
Merge branch 'next' into feat/box-sx-prop
mnajdova d438191
fixed typings, updated box page
mnajdova 7bab4bd
moved styleFunction to Box
mnajdova d966402
Update docs/src/pages/components/box/box.md
mnajdova 76c0f7e
Update packages/material-ui-system/src/palette.js
mnajdova 448bc82
Update packages/material-ui/src/Box/Box.js
mnajdova a7b690d
Update docs/src/pages/components/box/box.md
mnajdova 59461b3
added support for functions for the values
mnajdova f6faf73
prettier
mnajdova c53c4bd
fixed sizing filterProps
mnajdova ed02098
support sx as function
mnajdova f1ae038
prettier
mnajdova d2756c7
implemented breakpoints, fixed types, removed theme function callback
mnajdova 0f64e53
added theme-ui benchmark + sx prop benchmark for the box
mnajdova b32dd5a
fixed custom breakpoints support
mnajdova 79af939
Update docs/src/pages/components/box/box.md
mnajdova 64174a6
added theme-ui div scenario benchmark
mnajdova 70c1d51
Merge branch 'feat/box-sx-prop' of https://github.com/mnajdova/materi…
mnajdova 502733e
improved examples, added chakra-ui box & added results in readme
mnajdova 49641ac
added tests, fixes
mnajdova 15b118b
breakpoints more tests and fixes
mnajdova b386b29
improved breakpoints checks
mnajdova e200326
added more examples
mnajdova e12c35f
Added Box examples
mnajdova d32da87
temporarly removed dependency
mnajdova 2d4c5c9
Merge branch 'next' into feat/box-sx-prop
mnajdova 80682d1
reverted yarn.lock changes
mnajdova 6533c27
reverted benchmark changes
mnajdova 5df2f8c
Merge branch 'next' into feat/box-sx-prop
mnajdova 3767add
Update benchmark/browser/README.md
mnajdova dce99bc
reverted some changes
mnajdova 9671da1
Merge branch 'feat/box-sx-prop' of https://github.com/mnajdova/materi…
mnajdova b0cc366
fixed lint & tests
mnajdova 0b1ecd5
Merge branch 'next' into feat/box-sx-prop
mnajdova 9e3ad18
fixed breakpoints merging
mnajdova 2e557d4
prettier
mnajdova f00fd05
lint
mnajdova 43b629d
Update benchmark/browser/scenarios/sx-prop-box-material-ui/index.js
mnajdova 0d57b2d
Update benchmark/browser/scripts/benchmark.js
mnajdova 861d4f6
removed render function code snippet in favor of example
mnajdova 85856bc
init
mnajdova 6791fa7
Merge branch 'next' into feat/slider-add-sx-prop
mnajdova 8457392
added tests, updated tests & prettier
mnajdova 5f8c013
lint
mnajdova 4881d08
Update packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.d.ts
mnajdova c382d44
refactored and added TODO
mnajdova cac4bc3
Merge branch 'feat/slider-add-sx-prop' of https://github.com/mnajdova…
mnajdova 3b36beb
Fixed tests
mnajdova 509fb99
fixed this undefined
mnajdova d7da88b
fixed test
mnajdova 99b994d
prettier
mnajdova 61ec4ec
Update packages/material-ui/src/styles/experimentalStyled.test.js
mnajdova ec116cd
reverted sx examples
mnajdova 3001e90
refactored tests to use container.firstChild
mnajdova af120ff
prettier
mnajdova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| import scStyled from 'styled-components'; | ||
|
|
||
| export default function styled(tag, options) { | ||
| let scStyledPrepared; | ||
|
|
||
| if (options) { | ||
| return scStyled(tag).withConfig({ | ||
| scStyledPrepared = scStyled(tag).withConfig({ | ||
| displayName: options.label, | ||
| shouldForwardProp: options.shouldForwardProp, | ||
| }); | ||
| } else { | ||
| scStyledPrepared = scStyled(tag); | ||
| } | ||
|
|
||
| return scStyled(tag); | ||
| // TODO: This should not be required once we solve the warning `You have illegal escape sequence in your template literal` | ||
| return (styles) => { | ||
| return scStyledPrepared(...styles); | ||
| }; | ||
| } | ||
|
|
||
| export { ThemeContext } from 'styled-components'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import styled from '@material-ui/styled-engine'; | ||
| import { propsToClassKey } from '@material-ui/styles'; | ||
| import { styleFunctionSx } from '../Box/styleFunction'; | ||
| import defaultTheme from './defaultTheme'; | ||
|
|
||
| function isEmpty(obj) { | ||
|
|
@@ -58,7 +59,7 @@ const variantsResolver = (props, styles, theme, name) => { | |
| return variantsStyles; | ||
| }; | ||
|
|
||
| const shouldForwardProp = (prop) => prop !== 'styleProps' && prop !== 'theme'; | ||
| const shouldForwardProp = (prop) => prop !== 'styleProps' && prop !== 'theme' && prop !== 'sx'; | ||
|
|
||
| const experimentalStyled = (tag, options, muiOptions = {}) => { | ||
| const name = muiOptions.muiName; | ||
|
|
@@ -85,7 +86,12 @@ const experimentalStyled = (tag, options, muiOptions = {}) => { | |
| }); | ||
| } | ||
|
|
||
| return defaultStyledResolver(...stylesWithDefaultTheme); | ||
| stylesWithDefaultTheme.push((props) => { | ||
| const theme = isEmpty(props.theme) ? defaultTheme : props.theme; | ||
| return styleFunctionSx(props.sx, theme); | ||
| }); | ||
|
|
||
| return defaultStyledResolver(stylesWithDefaultTheme); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Necessary for fixing |
||
| }; | ||
| return muiStyledResolver; | ||
| }; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.