-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(empty-state): update to match the design system (#279)
- Loading branch information
Showing
5 changed files
with
141 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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 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,4 @@ | ||
export const Slots = { | ||
ICON: "icon", | ||
ACTION: "action", | ||
} as const; |
114 changes: 54 additions & 60 deletions
114
packages/web-components/src/empty-state/empty-state.style.ts
This file contains 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,88 +1,82 @@ | ||
import { css } from "lit"; | ||
|
||
export default css` | ||
:host { | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
} | ||
:host *, | ||
:host *::before, | ||
:host *::after { | ||
box-sizing: inherit; | ||
[hidden] { | ||
display: none !important; | ||
} | ||
.container { | ||
.root.auto { | ||
--empty-state-alignment: start; | ||
} | ||
.root.center { | ||
--empty-state-alignment: center; | ||
} | ||
.root { | ||
--empty-state-alignment: start; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-family: var(--tap-font-family, var(--tap-sys-font-family)), serif; | ||
font-family: var(--tap-sys-font-family); | ||
padding: var(--tap-sys-spacing-6) var(--tap-sys-spacing-8); | ||
} | ||
.icon { | ||
margin: var( | ||
--tap-empty-state-content-vertical-margin, | ||
var(--tap-sys-spacing-6) | ||
) | ||
var(--tap-empty-state-content-horizontal-margin, 0); | ||
color: var(--tap-sys-color-content-secondary); | ||
display: flex; | ||
align-items: center; | ||
justify-items: center; | ||
width: 4rem; | ||
height: 4rem; | ||
max-width: 4rem; | ||
max-height: 4rem; | ||
font-size: 4rem; | ||
} | ||
.icon ::slotted(svg) { | ||
width: 4rem; | ||
height: 4rem; | ||
max-width: 4rem; | ||
max-height: 4rem; | ||
} | ||
.content { | ||
text-align: center; | ||
padding: var( | ||
--tap-empty-state-content-vertical-padding, | ||
var(--tap-sys-spacing-4) | ||
) | ||
var( | ||
--tap-empty-state-content-horizontal-padding, | ||
var(--tap-sys-spacing-6) | ||
); | ||
text-align: var(--empty-state-alignment); | ||
margin-top: var(--tap-sys-spacing-8); | ||
margin-bottom: var(--tap-sys-spacing-8); | ||
} | ||
.title { | ||
font-size: var( | ||
--tap-empty-state-title-font-size, | ||
var(--tap-sys-typography-headline-sm-size) | ||
); | ||
font-weight: var( | ||
tap-empty-state-title-font-weight, | ||
var(--tap-sys-typography-headline-sm-weight) | ||
); | ||
line-height: var( | ||
--tap-empty-state-title-line-height, | ||
var(--tap-sys-typography-headline-sm-height) | ||
); | ||
color: var(--tap-sys-color-content-primary); | ||
font-size: var(--tap-sys-typography-headline-sm-size); | ||
font-weight: var(--tap-sys-typography-headline-sm-weight); | ||
line-height: var(--tap-sys-typography-headline-sm-height); | ||
} | ||
.description { | ||
margin: var( | ||
--tap-empty-state-description-top-margin, | ||
var(--tap-sys-spacing-4) | ||
) | ||
0 0 0; | ||
font-size: var( | ||
--tap-empty-state-description-font-size, | ||
var(--tap-sys-typography-body-md-size) | ||
); | ||
font-weight: var( | ||
--tap-empty-state-description-font-weight, | ||
var(--tap-sys-typography-body-md-weight) | ||
); | ||
line-height: var( | ||
--tap-empty-state-description-line-height, | ||
var(--tap-sys-typography-body-md-height) | ||
); | ||
color: var( | ||
--tap-empty-state-description-color, | ||
var(--tap-palette-gray-600) | ||
); | ||
margin-top: var(--tap-sys-spacing-4); | ||
color: var(--tap-sys-color-content-secondary); | ||
font-size: var(--tap-sys-typography-body-md-size); | ||
font-weight: var(--tap-sys-typography-body-md-weight); | ||
line-height: var(--tap-sys-typography-body-md-height); | ||
} | ||
.actions { | ||
margin: var( | ||
--tap-empty-state-content-vertical-margin, | ||
var(--tap-sys-spacing-6) | ||
) | ||
var(--tap-empty-state-content-horizontal-margin, 0); | ||
.title + .description { | ||
margin-top: var(--tap-sys-spacing-4); | ||
} | ||
`; |
This file contains 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 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