-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ld-notice): add text notice component
- Loading branch information
1 parent
7e82ba6
commit b10ca2a
Showing
18 changed files
with
659 additions
and
9 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 16 additions & 6 deletions
22
src/liquid/components/ld-input-message/ld-input-message.css
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,66 @@ | ||
:host, | ||
.ld-notice { | ||
--ld-notice-error-text-col: var(--ld-thm-error); | ||
--ld-notice-info-text-col: var(--ld-thm-primary); | ||
--ld-notice-warning-text-col: var(--ld-thm-warning); | ||
|
||
align-items: baseline; | ||
border-radius: var(--ld-br-l); | ||
box-shadow: var(--ld-shadow-stacked); | ||
color: var(--ld-col-neutral-800); | ||
display: flex; | ||
flex-direction: column; | ||
font: var(--ld-typo-body-s); | ||
padding: var(--ld-sp-24); | ||
padding-left: calc(var(--ld-sp-24) + var(--ld-sp-40)); | ||
position: relative; | ||
} | ||
|
||
:host(.ld-notice--error), | ||
.ld-notice--error { | ||
background: var(--ld-thm-error-highlight); | ||
|
||
.ld-notice__icon, | ||
.ld-notice__headline { | ||
color: var(--ld-notice-error-text-col); | ||
} | ||
|
||
.ld-notice__icon { | ||
transform: rotate(180deg); | ||
} | ||
} | ||
|
||
:host(.ld-notice--info), | ||
.ld-notice--info { | ||
.ld-notice__icon { | ||
color: var(--ld-notice-info-text-col); | ||
} | ||
|
||
.ld-notice__headline { | ||
color: var(--ld-notice-info-text-col); | ||
} | ||
} | ||
|
||
:host(.ld-notice--warning), | ||
.ld-notice--warning { | ||
background: var(--ld-thm-warning-highlight); | ||
|
||
.ld-notice__icon { | ||
color: var(--ld-notice-warning-text-col); | ||
--ld-icon-secondary-col: var(--ld-col-neutral-900); | ||
} | ||
|
||
.ld-notice__headline { | ||
color: var(--ld-col-neutral-900); | ||
} | ||
} | ||
|
||
.ld-notice__headline { | ||
margin: 0 0 var(--ld-sp-12); | ||
} | ||
|
||
.ld-notice__icon { | ||
left: var(--ld-sp-24); | ||
position: absolute; | ||
top: var(--ld-sp-24); | ||
} |
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,36 @@ | ||
import '../../components' // type definitions for type checks and intelliSense | ||
import { Component, h, Prop, Host } from '@stencil/core' | ||
|
||
/** | ||
* @virtualProp ref - reference to component | ||
* @virtualProp {string | number} key - for tracking the node's identity when working with lists | ||
* @part headline - `ld-typo` element used for the headline | ||
* @part icon - Image tag used for the icon | ||
*/ | ||
@Component({ | ||
tag: 'ld-notice', | ||
styleUrl: 'ld-notice.css', | ||
shadow: true, | ||
}) | ||
export class LdNotice { | ||
/** Mode of the notice. */ | ||
@Prop() headline?: string | ||
|
||
/** Mode of the notice. */ | ||
@Prop() mode: 'error' | 'info' | 'warning' = 'info' | ||
|
||
render() { | ||
return ( | ||
<Host class={`ld-notice ld-notice--${this.mode}`}> | ||
<ld-icon | ||
class="ld-notice__icon" | ||
name="info" | ||
part="icon" | ||
size="lg" | ||
/> | ||
{this.headline && <ld-typo class="ld-notice__headline" variant="h4" tag="p" part="headline">{this.headline}</ld-typo>} | ||
<slot></slot> | ||
</Host> | ||
) | ||
} | ||
} |
Oops, something went wrong.