-
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.
Merge branch 'main' into 3162-datepicker-year-is-getting-cut
- Loading branch information
Showing
38 changed files
with
552 additions
and
230 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,5 +112,6 @@ | |
"es5-ext@>=0.10.0 <0.10.63": ">=0.10.63", | ||
"follow-redirects@<=1.15.5": ">=1.15.6" | ||
} | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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
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
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
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...ocumentation/.storybook/blocks/layout.tsx → ...ation/.storybook/blocks/layout/layout.tsx
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
134 changes: 134 additions & 0 deletions
134
packages/documentation/.storybook/styles/components/alert.scss
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,134 @@ | ||
@use 'sass:math'; | ||
@use 'sass:list'; | ||
@use 'sass:map'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
@use '../mixins'; | ||
|
||
$post-docs-alert-border-width: post.$size-line; | ||
$post-docs-alert-border-style: solid; | ||
$post-docs-alert-border-radius: post.$size-mini; | ||
$post-docs-alert-box-shadow: none; | ||
|
||
$post-docs-alert-padding-md: 1em 2em 1em 3.5em; | ||
$post-docs-alert-padding-sm: 0.25em 1em 0.25em 2.25em; | ||
|
||
$post-docs-alert-icon-size-md: 2em; | ||
$post-docs-alert-icon-size-sm: 1.4em; | ||
|
||
$post-docs-alert-line-height-md: 1.35; | ||
$post-docs-alert-line-height-sm: 1.25; | ||
|
||
$post-docs-alert-variants: ( | ||
info: ( | ||
background-color: '250, 249, 248', | ||
border-color: #1ea0d6, | ||
color: #0776a4, | ||
), | ||
warning: ( | ||
background-color: '250, 249, 248', | ||
border-color: #db8b12, | ||
color: #b16a00, | ||
), | ||
danger: ( | ||
background-color: '250, 249, 248', | ||
border-color: #d12e35, | ||
color: #a1050b, | ||
), | ||
); | ||
|
||
@include mixins.style-docs-only-guard('.alert') { | ||
border-width: $post-docs-alert-border-width; | ||
border-style: $post-docs-alert-border-style; | ||
border-radius: $post-docs-alert-border-radius; | ||
box-shadow: $post-docs-alert-box-shadow; | ||
font-size: 1rem; | ||
|
||
&:not(.alert-action) { | ||
> :only-child:not(code), | ||
> :first-child:not(code) + :last-child:not(code) { | ||
font-size: inherit; | ||
} | ||
} | ||
|
||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
&.alert-sm, | ||
&.alert-md { | ||
display: block; | ||
min-height: 0; | ||
font-family: inherit; | ||
|
||
a { | ||
font-size: inherit; | ||
font-weight: inherit; | ||
color: inherit; | ||
|
||
&:hover { | ||
color: black; | ||
} | ||
} | ||
} | ||
|
||
&.alert-sm { | ||
padding: $post-docs-alert-padding-sm; | ||
font-size: 0.75rem; | ||
font-weight: 400; | ||
line-height: $post-docs-alert-line-height-sm; | ||
|
||
&::before { | ||
top: list.nth($post-docs-alert-padding-sm, 1) + | ||
(($post-docs-alert-line-height-sm - $post-docs-alert-icon-size-sm) * 0.5); | ||
left: (list.nth($post-docs-alert-padding-sm, 4) - $post-docs-alert-icon-size-sm) * 0.5; | ||
width: $post-docs-alert-icon-size-sm; | ||
height: $post-docs-alert-icon-size-sm; | ||
} | ||
|
||
code { | ||
font-size: 0.833333em; | ||
} | ||
} | ||
|
||
&.alert-md { | ||
padding: $post-docs-alert-padding-md; | ||
font-size: 0.9rem; | ||
line-height: $post-docs-alert-line-height-md; | ||
|
||
&::before { | ||
top: list.nth($post-docs-alert-padding-md, 1) + | ||
(($post-docs-alert-line-height-md - $post-docs-alert-icon-size-md) * 0.5); | ||
left: (list.nth($post-docs-alert-padding-md, 4) - $post-docs-alert-icon-size-md) * 0.5; | ||
width: $post-docs-alert-icon-size-md; | ||
height: $post-docs-alert-icon-size-md; | ||
} | ||
} | ||
|
||
@each $name, $colorMap in $post-docs-alert-variants { | ||
&.alert-#{$name} { | ||
--post-bg-rgb: #{map.get($colorMap, 'background-color')}; | ||
--post-contrast-color: #{map.get($colorMap, 'color')}; | ||
|
||
border-color: map.get($colorMap, 'border-color'); | ||
} | ||
} | ||
} | ||
|
||
@include mixins.style-docs-only-guard('post-alert') { | ||
&::part(alert) { | ||
border-width: $post-docs-alert-border-width; | ||
border-style: $post-docs-alert-border-style; | ||
border-radius: $post-docs-alert-border-radius; | ||
box-shadow: $post-docs-alert-box-shadow; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
} | ||
|
||
@each $name, $colorMap in $post-docs-alert-variants { | ||
&::part(alert-#{$name}) { | ||
--post-bg-rgb: #{map.get($colorMap, 'background-color')}; | ||
--post-contrast-color: #{map.get($colorMap, 'color')}; | ||
border-color: map.get($colorMap, 'border-color'); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/documentation/.storybook/styles/components/blockquote.scss
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,13 @@ | ||
@use '@swisspost/design-system-styles/core' as post; | ||
@use '../mixins'; | ||
|
||
@include mixins.style-docs-only-guard('.blockquote') { | ||
padding: 0; | ||
border-left: 0 none; | ||
font-style: italic; | ||
} | ||
|
||
@include mixins.style-docs-only-guard('.blockquote-footer') { | ||
padding: 0; | ||
border-left: 0 none; | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/documentation/.storybook/styles/components/blocks.scss
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,49 @@ | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
#storybook-docs { | ||
.sbdocs-preview { | ||
border-color: post.$border-color; | ||
border-radius: post.$size-mini; | ||
box-shadow: none; | ||
} | ||
|
||
.docblock-argstable { | ||
border-radius: post.$size-mini; | ||
|
||
tbody { | ||
position: relative; | ||
-webkit-filter: none; | ||
filter: none; | ||
|
||
&:before { | ||
display: block; | ||
content: ''; | ||
position: absolute; | ||
inset: 0; | ||
border: post.$border-width solid post.$border-color; | ||
border-radius: post.$size-mini; | ||
z-index: -1; | ||
} | ||
|
||
> tr { | ||
> th, | ||
> td { | ||
background-color: transparent; | ||
border: 0 none; | ||
} | ||
|
||
&:not(:first-child) { | ||
> th, | ||
> td { | ||
border-top: post.$border-width solid post.$border-color; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.docblock-source { | ||
border-radius: post.$size-mini; | ||
box-shadow: none; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/documentation/.storybook/styles/components/fonts.scss
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,44 @@ | ||
// FiraCode WebFonts | ||
@font-face { | ||
font-family: 'FiraCode'; | ||
font-weight: 700; | ||
font-style: normal; | ||
src: url('/assets/fonts/firacode/firacode-bold.woff2') format('woff2'), | ||
url('/assets/fonts/firacode/firacode-bold.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'FiraCode'; | ||
font-weight: 400; | ||
font-style: normal; | ||
src: url('/assets/fonts/firacode/firacode-regular.woff2') format('woff2'), | ||
url('/assets/fonts/firacode/firacode-regular.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'FiraCode'; | ||
font-weight: 300; | ||
font-style: normal; | ||
src: url('/assets/fonts/firacode/firacode-light.woff2') format('woff2'), | ||
url('/assets/fonts/firacode/firacode-light.woff') format('woff'); | ||
} | ||
|
||
// Reddit Mono WebFonts | ||
@font-face { | ||
font-family: 'Reddit Mono'; | ||
font-weight: 700; | ||
src: local('Reddit Mono Bold'), url('/assets/fonts/reddit/reddit-mono-bold.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Reddit Mono'; | ||
font-weight: 400; | ||
src: local('Reddit Mono Regular'), | ||
url('/assets/fonts/reddit/reddit-mono-regular.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Reddit Mono'; | ||
font-weight: 300; | ||
src: local('Reddit Mono Light'), url('/assets/fonts/reddit/reddit-mono-light.woff') format('woff'); | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/documentation/.storybook/styles/components/index.scss
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,8 @@ | ||
@use './fonts.scss'; | ||
@use './typo.scss'; | ||
@use './blocks.scss'; | ||
|
||
// styles to apply only when components used in the docs, not in the iframe | ||
@use './alert.scss'; | ||
@use './tabs.scss'; | ||
@use './blockquote.scss'; |
Oops, something went wrong.