-
Notifications
You must be signed in to change notification settings - Fork 235
fix(picker): add loading state to the picker #3110
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
21 commits
Select commit
Hold shift + click to select a range
5cec825
feat(picker): add loading state to the picker
a64b197
Merge branch 'main' into razvancir96/add-picker-loading-state
6090359
chore(picker): implement the code review
c087d9d
Merge branch 'main' into razvancir96/add-picker-loading-state
0b9dd03
chore(picker): update circleci golden image hash
56e0274
chore(picker): tests + a11y
cf4047c
Merge branch 'main' into razvancir96/add-picker-loading-state
8beeed7
chore(picker): create pendingLabel property and update a bunch of sma…
70882c3
Update config.yml
Rocss 5e029ca
chore(picker): implement code review
ba4c1ba
chore(picker): remove unnecessary size on sp-progress-circle
94807ad
chore(picker): remove custom sizes for spinner
58d2e25
chore(picker): use aria-valuetext to bypass firefox issue
d01dc03
Merge branch 'main' into razvancir96/add-picker-loading-state
c6b7806
chore(picker): remove unnecessary old forgotten code
38b98d2
chore(picker): update golden image cache
b64abee
Merge branch 'main' into razvancir96/add-picker-loading-state
dfc9080
chore: implement feedback on PR
cad3ee4
Merge branch 'main' into razvancir96/add-picker-loading-state
3ac2a24
chore: add spinner to package.json
8ab40fa
chore: golden image cache
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
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,36 @@ | ||
| /* | ||
| Copyright 2023 Adobe. All rights reserved. | ||
| This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. You may obtain a copy | ||
| of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software distributed under | ||
| the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| OF ANY KIND, either express or implied. See the License for the specific language | ||
| governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| import { TemplateResult } from '@spectrum-web-components/base'; | ||
| import { argTypes } from './args'; | ||
| import { StoryArgs, Template } from './template'; | ||
|
|
||
| export default { | ||
| title: 'Picker/Pending', | ||
| component: 'sp-picker', | ||
| argTypes, | ||
| args: { | ||
| pending: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const S = (args: StoryArgs): TemplateResult => | ||
| Template({ ...args, size: 's' }); | ||
|
|
||
| export const M = (args: StoryArgs): TemplateResult => | ||
| Template({ ...args, size: 'm' }); | ||
|
|
||
| export const L = (args: StoryArgs): TemplateResult => | ||
| Template({ ...args, size: 'l' }); | ||
|
|
||
| export const XL = (args: StoryArgs): TemplateResult => | ||
| Template({ ...args, size: 'xl' }); |
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 |
|---|---|---|
|
|
@@ -22,21 +22,49 @@ export default { | |
| component: 'sp-picker', | ||
| argTypes: { | ||
| onChange: { action: 'change' }, | ||
| invalid: { | ||
| name: 'invalid', | ||
| type: { name: 'boolean', required: false }, | ||
| table: { | ||
| type: { summary: 'boolean' }, | ||
| defaultValue: { summary: false }, | ||
| }, | ||
| control: { | ||
| type: 'boolean', | ||
| }, | ||
| }, | ||
| pending: { | ||
| name: 'pending', | ||
| type: { name: 'boolean', required: false }, | ||
| table: { | ||
| type: { summary: 'boolean' }, | ||
| defaultValue: { summary: false }, | ||
| }, | ||
| control: { | ||
| type: 'boolean', | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| type StoryArgs = { | ||
| onChange: (val: string) => void; | ||
| invalid: boolean; | ||
Rocss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pending: boolean; | ||
|
Contributor
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. @TarunAdobe we broken Button into a while list of sized stories, particularly due to the custom sizing of the Progress Circle. Have you found value in that? Should we do it here, too? |
||
| open: false; | ||
| }; | ||
|
|
||
| const picker = ({ | ||
| onChange, | ||
| open, | ||
| size, | ||
| pending, | ||
| invalid, | ||
| }: { | ||
| onChange: (val: string) => void; | ||
| size: 's' | 'm' | 'l' | 'xl'; | ||
| pending: boolean; | ||
| invalid: boolean; | ||
| open: boolean; | ||
| }): TemplateResult => { | ||
| return html` | ||
|
|
@@ -51,6 +79,8 @@ const picker = ({ | |
| onChange(picker.value); | ||
| }}" | ||
| label="Select a Country with a very long label, too long, in fact" | ||
| ?pending="${pending}" | ||
| ?invalid="${invalid}" | ||
| ?open=${open} | ||
| > | ||
| <sp-menu-item>Deselect</sp-menu-item> | ||
|
|
||
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
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.
The pre-commit hook automatically does this, it's not me!
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.
I wonder if there's a loose config somewhere. Not germain to this PR, indeed.