Skip to content

Commit 85a8470

Browse files
hannahissnilloqlouismaximepitonMaxLardenoisvprothais
authored
feat(component): Add Tag component (#3062)
--------- Co-authored-by: Samuel Collin <samuel.collin@orange.com> Co-authored-by: Louis-Maxime Piton <louismaxime.piton@orange.com> Co-authored-by: Maxime Lardenois <maxime.lardenois@orange.com> Co-authored-by: Vincent Prothais <vincent.prothais@orange.com>
1 parent 602fa9e commit 85a8470

File tree

14 files changed

+908
-397
lines changed

14 files changed

+908
-397
lines changed

.bundlewatch.config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"files": [
33
{
44
"path": "./dist/css/ouds-web-bootstrap.css",
5-
"maxSize": "67.25 kB"
5+
"maxSize": "69 kB"
66
},
77
{
88
"path": "./dist/css/ouds-web-bootstrap.min.css",
9-
"maxSize": "63.75 kB"
9+
"maxSize": "65.5 kB"
1010
},
1111
{
1212
"path": "./dist/css/ouds-web-grid.css",
@@ -34,11 +34,11 @@
3434
},
3535
{
3636
"path": "./dist/css/ouds-web.css",
37-
"maxSize": "58.5 kB"
37+
"maxSize": "60.0 kB"
3838
},
3939
{
4040
"path": "./dist/css/ouds-web.min.css",
41-
"maxSize": "55.0 kB"
41+
"maxSize": "56.25 kB"
4242
},
4343
{
4444
"path": "./dist/js/ouds-web.bundle.js",

scss/_tags.scss

Lines changed: 194 additions & 114 deletions
Large diffs are not rendered by default.

scss/_variables.scss

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,44 +2244,6 @@ $footer-gap: $spacer * .75 !default;
22442244
$footer-gap-xl: $spacer * 1.7 !default;
22452245
// scss-docs-end footer
22462246

2247-
2248-
// Tags
2249-
2250-
// scss-docs-start tag-variables
2251-
$tag-color: var(--#{$prefix}body-color) !default;
2252-
$tag-bg: var(--#{$prefix}body-bg) !default;
2253-
2254-
$tag-gap: map-get($spacers, 1) !default;
2255-
$tag-font-shift: $spacer * .1 !default;
2256-
$tag-font-weight: $font-weight-bold !default;
2257-
$tag-border-width: var(--#{$prefix}border-width) !default;
2258-
$tag-border-radius: var(--#{$prefix}border-radius-pill) !default;
2259-
2260-
$tag-padding-x: $spacer * .65 !default;
2261-
$tag-padding-y: $spacer * .45 !default;
2262-
$tag-icon-size: $spacer * 1.2 !default;
2263-
$tag-icon-margin-start: -$spacer * .35 !default;
2264-
$tag-close-margin-end: -$spacer * .3 !default;
2265-
$tag-close-margin-start: $spacer * .2 !default;
2266-
$tag-font-size: $font-size-base !default;
2267-
2268-
$tag-active-color: var(--#{$prefix}highlight-color) !default;
2269-
$tag-disabled-color: var(--#{$prefix}color-content-disabled) !default;
2270-
$tag-border-color: var(--#{$prefix}color-border-default) !default;
2271-
$tag-active-decoration-color: var(--#{$prefix}highlight-bg) !default;
2272-
// scss-docs-end tag-variables
2273-
2274-
// scss-docs-start tag-sm-variables
2275-
$tag-padding-x-sm: $spacer * .4 !default;
2276-
$tag-padding-y-sm: $spacer * .25 !default;
2277-
$tag-icon-size-sm: $spacer !default;
2278-
$tag-icon-margin-start-sm: -$spacer * .1 !default;
2279-
$tag-close-margin-end-sm: -$spacer * .25 !default;
2280-
$tag-close-margin-start-sm: 0 !default;
2281-
$tag-font-size-sm: $font-size-sm !default;
2282-
// scss-docs-end tag-sm-variables
2283-
2284-
22852247
// Local navigation
22862248

22872249
// scss-docs-start local-nav-variables

site/data/sidebar.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
- title: Sticker
157157
draft: true
158158
- title: Tags
159-
draft: true
160159
- title: Title bars
161160
draft: true
162161
- title: Toasts

site/src/components/shortcodes/BootstrapCompatibility.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<details class="mt-md mb-2xl" data-sb-css-bootstrap="true">
66
<summary class="py-sm">
77
Bootstrap
8-
<span class="tag tag-sm float-end">
9-
<code class="text-default">$enable-bootstrap-compatibility: true</code>
8+
<span class="tag tag-sm text-bg-status-neutral-muted float-end">
9+
<code>$enable-bootstrap-compatibility: true</code>
1010
</span>
1111
</summary>
1212

site/src/components/shortcodes/Code.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if (filePath && fileMatch && codeToDisplay) {
137137

138138
<div class:list={[{ 'bd-code-snippet': !nestedInExample }, containerClass]}>
139139
{Astro.slots.has('bar') ? <slot name="bar" /> : null}
140-
<div class="highlight">
140+
<div class="highlight pe-md-4xl">
141141
{
142142
codeToDisplay && lang ? (
143143
<Prism code={codeToDisplay} lang={lang} />

site/src/components/shortcodes/Example.astro

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ interface Props {
3636
* @default true
3737
*/
3838
showPreview?: boolean
39+
/**
40+
* Defines if the toolbar with Stackblitz and copy buttons should be visible or not.
41+
* @default true
42+
*/
43+
showToolbar?: boolean
3944
}
4045
4146
const {
@@ -45,7 +50,8 @@ const {
4550
id,
4651
lang = 'html',
4752
showMarkup = true,
48-
showPreview = true
53+
showPreview = true,
54+
showToolbar = true
4955
} = Astro.props
5056
5157
let markup = Array.isArray(code) ? code.join('\n') : code
@@ -65,7 +71,7 @@ const simplifiedMarkup = markup
6571
<div class="bd-example-snippet bd-code-snippet">
6672
{
6773
showPreview && (
68-
<div id={id} class:list={['bd-example order-first m-none border-none', className]}>
74+
<div id={id} class:list={['bd-example order-first m-none border-none', className, showToolbar ? '' : 'border-default border-thin border-bottom']}>
6975
<Fragment set:html={markup} />
7076
</div>
7177
)
@@ -75,7 +81,7 @@ const simplifiedMarkup = markup
7581
showMarkup && (
7682
<>
7783
<Code code={simplifiedMarkup} lang={lang} nestedInExample={true} />
78-
{showPreview && (
84+
{showPreview && showToolbar && (
7985
<div class="d-flex order-first align-items-center highlight-toolbar ps-lg border-top border-bottom border-thin border-default">
8086
<small class="font-monospace text-muted text-uppercase my-sm">{lang}</small>
8187
<!-- OUDS mod: buttons are not displayed on small screens -->

0 commit comments

Comments
 (0)