-
Notifications
You must be signed in to change notification settings - Fork 235
feat(picker): add loading state to the picker #3093
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,41 @@ governing permissions and limitations under the License. | |
| --spectrum-picker-width: var(--spectrum-global-dimension-size-2400); | ||
| } | ||
|
|
||
| :host([loading]) sp-progress-circle { | ||
| margin-inline-start: var( | ||
| --mod-picker-spacing-text-to-alert-icon-inline-start, | ||
| var(--spectrum-picker-spacing-text-to-alert-icon-inline-start) | ||
| ); | ||
| } | ||
|
|
||
| :host([size='s']) sp-progress-circle { | ||
| --spectrum-progress-circle-size: var(--spectrum-workflow-icon-size-75); | ||
| --spectrum-progress-circle-thickness: var( | ||
| --spectrum-progress-circle-thickness-small | ||
| ); | ||
| } | ||
|
Contributor
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. Should I pick some other variables? Or make my own ones? More context: the picker has 4 dimensions: s/m/l/xl and the loading spinner has 3 dimensions: s/m/l, and do not match together. So I had to adapt its dimensions. Also, should we validate with design those dimensions?
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. @pfulton is there any token support for these variation?
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. From a selector standpoint, we can use |
||
|
|
||
| :host([size='m']) sp-progress-circle { | ||
| --spectrum-progress-circle-size: var(--spectrum-workflow-icon-size-100); | ||
| --spectrum-progress-circle-thickness: var( | ||
| --spectrum-progress-circle-thickness-small | ||
| ); | ||
| } | ||
|
|
||
| :host([size='l']) sp-progress-circle { | ||
| --spectrum-progress-circle-size: var(--spectrum-workflow-icon-size-200); | ||
| --spectrum-progress-circle-thickness: var( | ||
| --spectrum-progress-circle-thickness-medium | ||
| ); | ||
| } | ||
|
|
||
| :host([size='xl']) sp-progress-circle { | ||
| --spectrum-progress-circle-size: var(--spectrum-workflow-icon-size-300); | ||
| --spectrum-progress-circle-thickness: var( | ||
| --spectrum-progress-circle-thickness-large | ||
| ); | ||
| } | ||
|
|
||
| #button { | ||
| width: 100%; | ||
| min-width: 100%; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,6 +286,13 @@ export function runPickerTests(): void { | |
| expect(el.invalid).to.be.true; | ||
| await expect(el).to.be.accessible(); | ||
| }); | ||
| it('renders loading accessibly', async () => { | ||
| el.loading = true; | ||
| await elementUpdated(el); | ||
|
|
||
| expect(el.loading).to.be.true; | ||
| await expect(el).to.be.accessible(); | ||
| }); | ||
|
Contributor
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. I copied the pattern from the invalid property, but I feel like some more tests should be added. Are there any guidelines about writing tests?
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. Two things we'll want to test for:
Contributor
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. Thanks! One additional question about testing: is there any command to run only the tests from one file? I tried some combinations, but failed 😅
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.
|
||
| it('renders selection accessibly', async () => { | ||
| el.value = 'option-2'; | ||
| await elementUpdated(el); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.