generated from react-component/footer  
 -   Notifications  
You must be signed in to change notification settings  - Fork 27
 
feat: basic implements #1
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  
 Changes from 18 commits
 Commits 
  Show all changes 
  25 commits   Select commit Hold shift + click to select a range 
 e4d8789  feat: basic implements 
  vagusX 5d24b25  feat: update demo 
  vagusX 253bdce  feat: rename title to label 
  vagusX 4bf0d0f  feat: support merged refs 
  vagusX e36f504  feat: support refs 
  vagusX e9a6049  feat: improve code 
  vagusX ddf022d  feat: use composeRef 
  vagusX 3743c85  feat: use input for onChange 
  vagusX 1e1b27d  feat: add test 
  vagusX d0b9426  docs: update readme 
  vagusX 8fad570  test: failed for motion 
  vagusX 8dd625e  fix: finish unit test 
  vagusX 7c9e4bc  feat: add controlled demo and test 
  vagusX 89cfd26  chore: update 
  vagusX 49d3fb4  chore: add preview yml 
  vagusX 4a2b226  fix: change publicPath to make preview works 
  vagusX 78bd2ed  docs: update readme 
  vagusX c1a0e79  docs: update readme 
  vagusX b473881  fix: update types 
  vagusX ee98599  docs: update readme 
  vagusX 05db68b  feat: useMemo for segmentedOptions 
  vagusX f8f1ea4  feat: extract SegmentedOption 
  vagusX a54c024  feat: support prop `motionName` 
  vagusX 5f06c45  chore: update 
  vagusX e7e0bd9  feat: handle value with undefined/null/`` 
  vagusX 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   
     | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: 🔂 Surge PR Preview | ||
|   |  ||
| on: [pull_request] | ||
|   |  ||
| jobs: | ||
| preview: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: afc163/surge-preview@v1 | ||
| id: preview_step | ||
| with: | ||
| surge_token: ${{ secrets.SURGE_TOKEN }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| dist: .doc | ||
| build: | | ||
| npm install | ||
| npm run docs:build | ||
| - name: Get the preview_url | ||
| run: echo "url => ${{ steps.preview_step.outputs.preview_url }}" | 
   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 | 
|---|---|---|
|      |  @@ -34,4 +34,7 @@ coverage/ | |
| .umi | ||
| .umi-production | ||
| .umi-test | ||
| .env.local | ||
| .env.local | ||
|   |  ||
| # vscode | ||
| .vscode | ||
This file was deleted.
  Oops, something went wrong.  
    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,141 +1,95 @@ | ||
| @segmented-prefix-cls: rc-segmented; | ||
|   |  ||
| .segmented-disabled-item() { | ||
| &, | ||
| &:hover, | ||
| &:focus { | ||
| color: fade(#000, 25%); | ||
| cursor: not-allowed; | ||
| } | ||
| } | ||
|   |  ||
| .segmented-item-selected() { | ||
| background-color: white; | ||
| } | ||
|   |  ||
| .@{segmented-prefix-cls} { | ||
| position: relative; | ||
| clear: both; | ||
| color: rgba(255, 255, 255, 0.4); | ||
| font-size: 14px; | ||
| line-height: 1.5; | ||
| background-color: #000; | ||
|   |  ||
| a { | ||
| color: rgba(255, 255, 255, 0.9); | ||
| text-decoration: none; | ||
| transition: all 0.3s; | ||
|   |  ||
| &:hover { | ||
| color: #40a9ff; | ||
| } | ||
| } | ||
|   |  ||
| &-container { | ||
| width: 100%; | ||
| max-width: 1200px; | ||
| margin: auto; | ||
| padding: 80px 0 20px; | ||
| } | ||
| display: inline-block; | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| padding: 2px; | ||
|   |  ||
| &-columns { | ||
| display: flex; | ||
| justify-content: space-around; | ||
| } | ||
| background-color: rgba(0, 0, 0, 0.04); | ||
|   |  ||
| &-column { | ||
| margin-bottom: 60px; | ||
| border-radius: 2px; | ||
|   |  ||
| h2 { | ||
| position: relative; | ||
| margin: 0 auto 24px; | ||
| color: #fff; | ||
| font-weight: 500; | ||
| font-size: 16px; | ||
| } | ||
| &-item { | ||
| // box-sizing: border-box; | ||
| position: relative; | ||
| display: inline-block; | ||
| height: 28px; | ||
| padding: 4px 10px; | ||
| color: fade(#000, 85%); | ||
| line-height: 28px; | ||
| text-align: center; | ||
|   |  ||
| cursor: pointer; | ||
|   |  ||
| &-icon { | ||
| position: relative; | ||
| top: -1px; | ||
| display: inline-block; | ||
| width: 22px; | ||
| margin-right: 0.5em; | ||
| text-align: center; | ||
| vertical-align: middle; | ||
|   |  ||
| > span, | ||
| > svg, | ||
| img { | ||
| display: block; | ||
| width: 100%; | ||
| } | ||
| &-selected { | ||
| .segmented-item-selected(); | ||
| color: #262626; | ||
| } | ||
| } | ||
|   |  ||
| &-item { | ||
| margin: 12px 0; | ||
|   |  ||
| &-icon { | ||
| position: relative; | ||
| top: -1px; | ||
| display: inline-block; | ||
| width: 16px; | ||
| margin-right: 0.4em; | ||
| text-align: center; | ||
| vertical-align: middle; | ||
|   |  ||
| > span, | ||
| > svg, | ||
| img { | ||
| display: block; | ||
| width: 100%; | ||
| } | ||
| &:hover, | ||
| &:focus { | ||
| color: #262626; | ||
| } | ||
|   |  ||
| &-separator { | ||
| margin: 0 0.3em; | ||
| &-disabled { | ||
| .segmented-disabled-item(); | ||
| } | ||
| } | ||
|   |  ||
| &-bottom { | ||
| &-container { | ||
| width: 100%; | ||
| max-width: 1200px; | ||
| margin: 0 auto; | ||
| padding: 16px 0; | ||
| font-size: 16px; | ||
| line-height: 32px; | ||
| text-align: center; | ||
| border-top: 1px solid rgba(255, 255, 255, 0.25); | ||
| &-label { | ||
| z-index: 2; | ||
| } | ||
| } | ||
|   |  ||
| &-light { | ||
| color: rgba(0, 0, 0, 0.85); | ||
| background-color: transparent; | ||
| &-input { | ||
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
|   |  ||
| h2, | ||
| a { | ||
| color: rgba(0, 0, 0, 0.85); | ||
| width: 0; | ||
| height: 0; | ||
| opacity: 0; | ||
| pointer-events: none; | ||
| } | ||
| } | ||
|   |  ||
| &-light &-bottom-container { | ||
| border-top-color: #e8e8e8; | ||
| // disabled styles | ||
| &-disabled &-item, | ||
| &-disabled &-item:hover, | ||
| &-disabled &-item:focus { | ||
| .segmented-disabled-item(); | ||
| } | ||
|   |  ||
| &-light &-item-separator, | ||
| &-light &-item-description { | ||
| color: rgba(0, 0, 0, 0.45); | ||
| } | ||
| } | ||
|   |  ||
| @media only screen and (max-width: 767.99px) { | ||
| .@{segmented-prefix-cls} { | ||
| text-align: center; | ||
|   |  ||
| &-container { | ||
| padding: 40px 0; | ||
| } | ||
|   |  ||
| &-columns { | ||
| display: block; | ||
| } | ||
|   |  ||
| &-column { | ||
| display: block; | ||
| margin-bottom: 40px; | ||
|   |  ||
| &:last-child { | ||
| margin-bottom: 0; | ||
| } | ||
| &-thumb { | ||
| .segmented-item-selected(); | ||
|   |  ||
| position: absolute; | ||
| top: 2px; | ||
| left: 0px; | ||
| width: 0; | ||
| height: 28px; | ||
| padding: 4px 0; | ||
|   |  ||
| // transition effect when `enter-active` | ||
| &-motion-enter-active { | ||
| transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), | ||
| width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); | ||
| will-change: transform, width; | ||
| } | ||
| } | ||
| } | 
   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,5 @@ | ||
| @import './index.less'; | ||
|   |  ||
| .wrapper { | ||
| margin-bottom: 10px; | ||
| } | 
   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,3 @@ | ||
| ## basic | ||
|   |  ||
| <code src="../examples/basic.tsx"> | 
   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,3 @@ | ||
| ## controlled | ||
|   |  ||
| <code src="../examples/controlled.tsx"> | 
   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,3 @@ | ||
| ## dynamic | ||
|   |  ||
| <code src="../examples/dynamic.tsx"> | 
   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,3 @@ | ||
| ## refs | ||
|   |  ||
| <code src="../examples/refs.tsx"> | ||
    vagusX marked this conversation as resolved.    Show resolved Hide resolved  |  ||
This file was deleted.
  Oops, something went wrong.  
   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.    
 
Uh oh!
There was an error while loading. Please reload this page.