- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 32.7k
[Slider] Create unstyled version and migrate to emotion & styled-components #22435
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 all commits
      Commits
    
    
            Show all changes
          
          
            135 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      f966e23
              
                wip
              
              
                mnajdova 4c58672
              
                fix
              
              
                mnajdova 7fe38a0
              
                implementet theme default props, implemented rtl
              
              
                mnajdova 0f9b659
              
                wip overrides, needs refactor
              
              
                mnajdova 6adbc82
              
                converted CustomizedSlider to use components for overrides
              
              
                mnajdova 0c98292
              
                cleanups
              
              
                mnajdova 99499b6
              
                overrides fixed
              
              
                mnajdova d375e3d
              
                reverted changes in continious slider
              
              
                mnajdova 40f7019
              
                Merge branch 'next' into feat/slider-emotion
              
              
                mnajdova 4777a55
              
                reverted some changes
              
              
                mnajdova f891647
              
                implemented variants
              
              
                mnajdova 2c22ace
              
                fixed variants presendance over overrides
              
              
                mnajdova 5e7f826
              
                prettier + docs:formatted
              
              
                mnajdova 940f6d7
              
                renamed components
              
              
                mnajdova 3a80cda
              
                Update packages/material-ui/src/Slider/Slider.js
              
              
                mnajdova 27e7286
              
                components names fixed
              
              
                mnajdova 2946ee1
              
                fixed used cx in base
              
              
                mnajdova 03a64fa
              
                export *
              
              
                mnajdova b05a8e7
              
                reverted some changes
              
              
                mnajdova a21e199
              
                fixed disabled and active class selectors
              
              
                mnajdova ff8af15
              
                Update packages/material-ui/src/Slider/Slider.d.ts
              
              
                mnajdova fa0b76f
              
                try to style the unstyled component
              
              
                oliviertassinari 8f22840
              
                have the demo interactive
              
              
                oliviertassinari c448969
              
                fixed style, fixed classnames
              
              
                mnajdova 7564cc0
              
                Merge branch 'next' into feat/slider-emotion
              
              
                mnajdova 4333ed1
              
                merge conflicts
              
              
                mnajdova 79b8a26
              
                moved cache creation
              
              
                mnajdova 0780a15
              
                improved typings
              
              
                mnajdova 530b79f
              
                fixed overrides & extracted state
              
              
                mnajdova 49e50e4
              
                fixed ts
              
              
                mnajdova 9ec7c65
              
                wip
              
              
                mnajdova 6f87bc1
              
                extracted muiStyled wip
              
              
                mnajdova 4cdb02c
              
                removed dependency + cleanup
              
              
                mnajdova 551e2f9
              
                cleanups
              
              
                mnajdova bb0e959
              
                refactors
              
              
                mnajdova 0fbd75e
              
                refactors and comments addressed
              
              
                mnajdova 1da5ffe
              
                extracted muiStyled default params
              
              
                mnajdova 6152305
              
                Merge branch 'next' into feat/slider-emotion
              
              
                mnajdova d249d83
              
                prettier + fixes
              
              
                mnajdova 47911ac
              
                added @material-ui/styled
              
              
                mnajdova 4f71ad6
              
                renamed package
              
              
                mnajdova 95bb696
              
                Merge branch 'next' into feat/slider-emotion
              
              
                mnajdova 983f447
              
                merge conflicts
              
              
                mnajdova bd51f79
              
                fixed after merge
              
              
                mnajdova 5a42c9f
              
                cleanup
              
              
                mnajdova 396cee8
              
                implemented rtl on the docs
              
              
                mnajdova a5569b5
              
                fixed rtl usage
              
              
                mnajdova 61673cd
              
                updated ts example
              
              
                mnajdova 47c4105
              
                wip
              
              
                mnajdova dc7a03e
              
                added @material-ui/styled-engine as peerDependeny
              
              
                mnajdova e39ab3b
              
                fixed build
              
              
                mnajdova b02c56b
              
                added styled-engine-sc package
              
              
                mnajdova 1c9e41d
              
                fixed refresh issues with sc
              
              
                mnajdova 8f2fedd
              
                moved overrides & variants definition
              
              
                mnajdova dc4caee
              
                nextjs _document update
              
              
                mnajdova 0cf297b
              
                refactorings
              
              
                mnajdova 5c96a89
              
                removed plugin, fixed issue with dynamic styles
              
              
                mnajdova 47d46ef
              
                fixed sc issue with muiStyled
              
              
                mnajdova e6134a2
              
                fixed next.js + styled-components issues
              
              
                mnajdova 0eacc0d
              
                restructured components
              
              
                mnajdova 8fb4591
              
                docs:api fix
              
              
                mnajdova d4a6092
              
                fix various problems
              
              
                mnajdova cb9bb24
              
                fixed & disabled tests
              
              
                mnajdova f2fcb52
              
                run ci
              
              
                mnajdova 0048c13
              
                Merge branch 'next' into feat/slider-emotion
              
              
                mnajdova 9ba5d01
              
                reverted change
              
              
                mnajdova 90cec13
              
                typo
              
              
                mnajdova 9a0b87c
              
                run ci
              
              
                mnajdova 2479eaa
              
                prettier + enabled tests
              
              
                mnajdova 9ce3a13
              
                Fixed tests
              
              
                mnajdova 8fb98fd
              
                prettier
              
              
                mnajdova 2c4032e
              
                use emotion by default
              
              
                mnajdova 76171a8
              
                Update docs/src/modules/components/AppFrame.js
              
              
                mnajdova 858c4b7
              
                misc fixes
              
              
                mnajdova f4bba69
              
                framer build
              
              
                mnajdova ff85f47
              
                prettier
              
              
                mnajdova fffc2d7
              
                removed unused imports
              
              
                mnajdova 7411958
              
                removed slider from framer
              
              
                mnajdova aa414ff
              
                added conformance test for the Slider
              
              
                mnajdova 9ca5f62
              
                moved styled & unstyled slider to lab
              
              
                mnajdova 669ba1e
              
                reverted framer changes
              
              
                mnajdova fdce96d
              
                fixed issues
              
              
                mnajdova deb6e60
              
                Update packages/material-ui-styled-engine-sc/README.md
              
              
                mnajdova b804b36
              
                Update docs/src/modules/utils/helpers.js
              
              
                mnajdova 3d0e31e
              
                Update docs/src/pages/guides/right-to-left-v5/right-to-left-v5.md
              
              
                mnajdova 03cc79f
              
                addressing comments
              
              
                mnajdova 37a384f
              
                addressed comments
              
              
                mnajdova 645edee
              
                prettier & page fixed
              
              
                mnajdova 9849608
              
                Fixed lab imports
              
              
                mnajdova 4254cd3
              
                moved ContiniousSlider examples to tests, fixed imports
              
              
                mnajdova 2daf270
              
                prettier
              
              
                mnajdova 3533342
              
                Update docs/src/pages/components/slider-styled/CustomizedSlider.tsx
              
              
                mnajdova 3a3def4
              
                Update docs/src/pages/components/slider-styled/CustomizedSlider.tsx
              
              
                mnajdova 8897bb3
              
                Update docs/src/pages/components/slider-styled/CustomizedSlider.tsx
              
              
                mnajdova 81578de
              
                Update docs/src/pages/components/slider-styled/ContinuousSlider.tsx
              
              
                mnajdova 714b5ba
              
                Update docs/src/pages/components/slider-styled/ContinuousSlider.js
              
              
                mnajdova d681065
              
                improved muiStyled typings + fixes
              
              
                mnajdova ca825c7
              
                Merge branch 'feat/slider-emotion' of https://github.com/mnajdova/mat…
              
              
                mnajdova 2e86e9c
              
                Fix stylis right-to-left
              
              
                eps1lon 1999fb4
              
                Merge pull request #6 from eps1lon/fix/emotion-rtl-optout
              
              
                mnajdova 6cd4a5f
              
                fixed ts deprecation
              
              
                mnajdova c5bec5b
              
                Merge branch 'feat/slider-emotion' of https://github.com/mnajdova/mat…
              
              
                mnajdova 58cda5d
              
                Update docs/pages/components/slider-styled.js
              
              
                mnajdova 3d232e0
              
                Update packages/material-ui-styled-engine-sc/README.md
              
              
                mnajdova a362702
              
                Update packages/material-ui-styled-engine/README.md
              
              
                mnajdova c9ea84f
              
                improved muiStyled names
              
              
                mnajdova f053755
              
                Merge branch 'feat/slider-emotion' of https://github.com/mnajdova/mat…
              
              
                mnajdova 9e77509
              
                address comments, improvements
              
              
                mnajdova a8e1d46
              
                updated helpers
              
              
                mnajdova 0f8bfc9
              
                added @types/styled-components as optional
              
              
                mnajdova a37b64f
              
                updated styled-engine to be dependency of core
              
              
                mnajdova cbeb6e9
              
                proptypes
              
              
                mnajdova 2f224d6
              
                addressed comments
              
              
                mnajdova 37f37f1
              
                removed speedy
              
              
                mnajdova 1636fb8
              
                removed emotion-theming
              
              
                mnajdova 1d64929
              
                added babel plugin for styled-components
              
              
                mnajdova 7088108
              
                reverted sc as default engine
              
              
                mnajdova 9cff369
              
                renamed state to styleProps
              
              
                mnajdova ecda71a
              
                fixed interoperability guide
              
              
                mnajdova 27359e4
              
                fixed tests
              
              
                mnajdova 836f610
              
                hoist name resolution for performances
              
              
                oliviertassinari ea3730a
              
                add name for better debug experience in the class name
              
              
                oliviertassinari 2c80925
              
                export the bare minimum
              
              
                oliviertassinari 3c4701d
              
                adapt styled method
              
              
                oliviertassinari 5a697bb
              
                Merge pull request #8 from oliviertassinari/proposals
              
              
                mnajdova 1db5ee4
              
                improved next.js + emotion integration
              
              
                mnajdova 67ede91
              
                prettier
              
              
                mnajdova 34d19ab
              
                list fix
              
              
                mnajdova f8e347b
              
                updated material-ui peer dependencies
              
              
                mnajdova bb9fc68
              
                implemented stled & unstyled version of ValueLabel, small improvements
              
              
                mnajdova 95d8826
              
                fix lint errors
              
              
                mnajdova f4cd959
              
                prettier
              
              
                mnajdova c9993b7
              
                docs:api
              
              
                mnajdova 24d8ba8
              
                add performance pages
              
              
                oliviertassinari 8ee44f2
              
                udated ci.json packages
              
              
                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
    
  
  
    
              
  
    
      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 | 
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|  | ||
| const pageFilename = 'api/slider-styled'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /\/slider-styled\.md$/); | ||
|  | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|  | ||
| Page.getInitialProps = () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; | 
  
    
      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 | 
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| filename: /packages/material-ui-lab/src/SliderStyled/SliderStyled.js | ||
| --- | ||
|  | ||
| <!--- This documentation is automatically generated, do not try to edit it. --> | ||
|  | ||
| # SliderStyled API | ||
|  | ||
| <p class="description">The API documentation of the SliderStyled React component. Learn more about the props and the CSS customization points.</p> | ||
|  | ||
| ## Import | ||
|  | ||
| ```js | ||
| import SliderStyled from '@material-ui/lab/SliderStyled'; | ||
| // or | ||
| import { SliderStyled } from '@material-ui/lab'; | ||
| ``` | ||
|  | ||
| You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). | ||
|  | ||
|  | ||
|  | ||
|  | ||
|  | ||
| ## Props | ||
|  | ||
| | Name | Type | Default | Description | | ||
| |:-----|:-----|:--------|:------------| | ||
|  | ||
| The `ref` is forwarded to the root element. | ||
|  | ||
| Any other props supplied will be provided to the root element (native element). | ||
|  | 
  
    
      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 | 
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|  | ||
| const pageFilename = 'api/slider-unstyled'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /\/slider-unstyled\.md$/); | ||
|  | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|  | ||
| Page.getInitialProps = () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; | 
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for
styled-componentsfor next.js. There is still the warning:Warning: Prop className did not match., but the page work as expected..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with these statements especially for hydration. Even if you did take a screenshot before and after hydration there could still be styles that mismatch that only apply to UI revealed after interaction.
So this needs to be fixed before a stable release. Every warning we have that isn't actionable generates noise which is confusing to beginners and erodes trust in these warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we configure emotion too before moving forward? I guess we could also have it as a follow up task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will work tomorrow on both configuring emption and solving the styled components warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like emotion above 10 doesn't need any config for next.js🥳: https://emotion.sh/docs/ssr#nextjs

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the warning with styled-components, it still shows after you do the changes and refresh the page. I have tried everything I found on the matter and stamble apon this comment in the end - vercel/next.js#7322 (comment)
So I will ignore it for now, as it is anyway not our default build, it's just for local testing of styled-components.