-
Notifications
You must be signed in to change notification settings - Fork 100
feat(empty-state): new SHINE styles and Svelte Component #2100
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
Open
mukunku
wants to merge
31
commits into
beta
Choose a base branch
from
sal/SPARK-120-2
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+344
−126
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
db2aee7
update stacks docs
mukunku d59b2fc
implement svelte component
mukunku 834a22a
fix link
mukunku 734a14c
lint
mukunku 79e61a8
update baseline
mukunku 85f6c3e
fix test
mukunku e4f6018
upgrade expanding input to svelte 5
mukunku 3d906e3
tweak tests
mukunku c24d2fb
lint
mukunku c24783d
simplify expanding input svelte code
mukunku fd216d9
Create lovely-hotels-arrive.md
mukunku 68cdb17
Revert "simplify expanding input svelte code"
mukunku c8dc038
fix lint
mukunku 7bb42fa
fix expanding-input
mukunku 0388f4a
Update lovely-hotels-arrive.md
mukunku 14c8cea
set width for textareas in docs
mukunku 21a57a6
add examples with links
mukunku 02bc4ee
better native color implementation
mukunku c7cc9b3
hack to fix visual tests
mukunku 3310b2b
update baseline
mukunku eda831c
pr feedback
mukunku b4fb2ae
make header tag dynamic
mukunku 09b1d00
optimize expanding input css class
mukunku 80f46d3
Merge branch 'beta' into sal/SPARK-120-2
mukunku 5f3229b
update baseline
mukunku 8749ceb
try fix timeout
mukunku 8f82547
switch back to ellipsis again
mukunku 759b9ac
lint
mukunku 306a2f3
prettier format
mukunku 58c81e5
Merge branch 'beta' into sal/SPARK-120-2
mukunku 6ca500c
Merge branch 'beta' into sal/SPARK-120-2
dancormier 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,7 @@ | ||
| --- | ||
| "@stackoverflow/stacks": patch | ||
| "@stackoverflow/stacks-svelte": minor | ||
| --- | ||
|
|
||
| feat(empty-state): new SHINE styles and Svelte Component | ||
| fix(expanding-input): expands correctly now after textarea update |
6 changes: 4 additions & 2 deletions
6
packages/stacks-classic/lib/components/empty-state/empty-state.a11y.test.ts
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
23 changes: 17 additions & 6 deletions
23
packages/stacks-classic/lib/components/empty-state/empty-state.less
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
8 changes: 6 additions & 2 deletions
8
packages/stacks-classic/lib/components/empty-state/empty-state.visual.test.ts
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
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...acks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...tacks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...cks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...acks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-highcontrast-light.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-empty-state-light.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...tacks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...stacks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...acks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...tacks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-highcontrast-light.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Firefox/baseline/s-empty-state-light.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...stacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-dark-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
.../stacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-dark-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-dark.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...tacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
...stacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-highcontrast-light.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-light-with-title.ico
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-light-withTitle.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Webkit/baseline/s-empty-state-light.ico
Git LFS file not shown
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
81 changes: 31 additions & 50 deletions
81
packages/stacks-docs/product/components/empty-states.html
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,95 +1,76 @@ | ||
| --- | ||
| layout: page | ||
| title: Empty states | ||
| svelte: https://beta.svelte.stackoverflow.design/?path=/docs/components-emptystate--docs | ||
| figma: https://www.figma.com/design/do4Ug0Yws8xCfRjHe9cJfZ/Project-SHINE---Product-UI?node-id=610-18807&p=f&m=dev | ||
| description: Empty states are used when there is no data to show. Ideally they orient the user by providing feedback based on the the user’s last interaction or communicate the benefits of a feature. When appropriate, they should explain the next steps the user should take and provide guidance with a clear call-to-action. | ||
| tags: components | ||
| --- | ||
| <section class="stacks-section"> | ||
| {% header "h2", "No data" %} | ||
| {% header "h2", "No data or results" %} | ||
| <p class="stacks-copy"> | ||
| Used when a user hasn’t interacted with a feature yet. | ||
| Typical use-case for an empty state is when a feature has no data or a search/filter operation yields no results. | ||
| </p> | ||
| {% header "h3", "No data actionable" %} | ||
| {% header "h3", "Actionable" %} | ||
| <p class="stacks-copy"> | ||
| If the user can take an action to fix the situation, it's best to draw attention to it, explain next steps, and provide a call-to-action. | ||
| If the user is able to address the situation resulting in an empty state, it is appropriate to include a button for them to do so. | ||
| </p> | ||
| <div class="stacks-preview"> | ||
| {% highlight html %} | ||
| <div class="s-empty-state wmx4 p48"> | ||
| @Svg.Spot.EmptyXL.With("mb24") | ||
| <p>Why is this blank? Explain it.</p> | ||
| <a class="s-btn s-btn__filled">Call to action</a> | ||
| @Svg.Spot.Empty.With("native") | ||
| <h4 class="s-empty-state--title">No questions match your result.</h4> | ||
| <p>Try refining your search term or trying something more general.</p> | ||
| <button class="s-btn s-btn__tonal">Clear filters</a> | ||
| </div> | ||
| {% endhighlight %} | ||
| <div class="stacks-preview--example"> | ||
| <div class="s-empty-state wmx4 p48"> | ||
| {% spot, "EmptyXL", "mb24" %} | ||
| <p>We haven’t received any data yet. Have you connected your Stack Overflow account?</p> | ||
| <a class="s-btn s-btn__filled">Connect my account</a> | ||
| {% spot, "Empty", "native" %} | ||
| <h4 class="s-empty-state--title">No questions match your result.</h4> | ||
| <p>Try refining your search term or trying something more general.</p> | ||
| <button class="s-btn s-btn__tonal">Clear filters</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% header "h3", "No data non-actionable" %} | ||
|
|
||
| {% header "h3", "Non-actionable" %} | ||
| <p class="stacks-copy"> | ||
| If the user can’t take an action to fix the situation, it’s more appropriate to set expectations. | ||
| If the user can’t take an action to fix the situation, it’s appropriate to set expectations. | ||
| </p> | ||
| <div class="stacks-preview"> | ||
| {% highlight html %} | ||
| <div class="s-empty-state wmx4 p48"> | ||
| @Svg.Spot.EmptyXL.With("mb24") | ||
| <p>Why is this blank? Explain it.</p> | ||
| @Svg.Spot.Empty.With("native") | ||
| <h4 class="s-empty-state--title">User trends not ready</h4> | ||
| <p>Please check back in a few days.</p> | ||
| </div> | ||
| {% endhighlight %} | ||
| <div class="stacks-preview--example"> | ||
| <div class="s-empty-state wmx4 p48"> | ||
| {% spot, "EmptyXL", "mb24" %} | ||
| <p>There’s no data associated with your account yet. Please check back tomorrow.</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| <section class="stacks-section"> | ||
| {% header "h2", "No results" %} | ||
| <p class="stacks-copy"> | ||
| When someone performs an action that returns nothing, a blank state can explain what happened and help get someone back on track. | ||
| </p> | ||
| {% header "h3", "No results actionable" %} | ||
| <p class="stacks-copy"> | ||
| If the user can take an action to fix the situation, it’s best to draw attention to it and provide a call-to-action. | ||
| </p> | ||
| <div class="stacks-preview"> | ||
| {% highlight html %} | ||
| <div class="s-empty-state wmx4 p48"> | ||
| @Svg.Spot.EmptyXL.With("mb24") | ||
| <p>Why is this blank? Explain it.</p> | ||
| <a class="s-btn s-btn__filled">Call to action</a> | ||
| </div> | ||
| {% endhighlight %} | ||
| <div class="stacks-preview--example bg-black-100"> | ||
| <div class="s-empty-state wmx4 p48"> | ||
| {% spot, "EmptyXL", "mb24" %} | ||
| <p>We couldn’t find any tags matching <span class="s-tag d-inline-block">stacks-1-0-0</span>. It might not exist yet. Would you like to create it?</p> | ||
| <a href="#" class="s-btn s-btn__filled">Create this tag</a> | ||
| {% spot, "Empty", "native" %} | ||
| <h4 class="s-empty-state--title">User trends not ready</h4> | ||
| <p>Please check back in a few days.</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {% header "h3", "No results non-actionable" %} | ||
| {% header "h3", "Minimal" %} | ||
| <p class="stacks-copy"> | ||
| If the user can’t take an action to fix the situation, it’s more appropriate to set expectations. | ||
| If desired, both the title and call-to-action may be omitted for a minimal look. | ||
| </p> | ||
| <div class="stacks-preview"> | ||
| {% highlight html %} | ||
| <div class="s-empty-state wmx4 p48"> | ||
| @Svg.Spot.EmptyXL.With("mb24") | ||
| <p>Why is this blank? Explain it.</p> | ||
| @Svg.Spot.Empty.With("native") | ||
| <p>There’s no data associated with <a href="#" class="s-link s-link__underlined">this account</a>.</p> | ||
| </div> | ||
| {% endhighlight %} | ||
| <div class="stacks-preview--example bg-black-100"> | ||
| <div class="stacks-preview--example"> | ||
| <div class="s-empty-state wmx4 p48"> | ||
| {% spot, "EmptyXL", "mb24" %} | ||
| <p>We couldn’t match users for <strong>Namey McUser</strong>. Try refining your search or trying something more general.</p> | ||
| {% spot, "Empty", "native" %} | ||
| <p>There’s no data associated with <a href="#" class="s-link s-link__underlined">this account</a>.</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </section> |
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.