Skip to content

Commit f4b929a

Browse files
fix(with-layer): update stories (#19425)
* fix(with-layer): update stories * fix(theme-layer): stories * fix(tile): clickable layer feature * fix(with-layer): background icon
1 parent 7283d7c commit f4b929a

File tree

6 files changed

+33
-31
lines changed

6 files changed

+33
-31
lines changed

packages/react/.storybook/templates/Annotation/Annotation.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
@use '../prefix' as *;
1717

1818
$types: (
19+
'background': (
20+
border: colors.$magenta-50,
21+
background: tag.$tag-background-magenta,
22+
color: tag.$tag-color-magenta,
23+
),
1924
'deprecation-notice': (
2025
border: colors.$red-50,
2126
background: tag.$tag-background-red,
@@ -67,6 +72,11 @@ $types: (
6772
padding: spacing.$spacing-05;
6873
}
6974

75+
.#{$prefix}--annotation--background {
76+
margin: -42px;
77+
min-block-size: 100vh;
78+
}
79+
7080
@each $type, $colors in $types {
7181
$border: map.get($colors, 'border');
7282
$background: map.get($colors, 'background');

packages/react/.storybook/templates/Annotation/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import { WarningHex, Layers, Chemistry } from '@carbon/react/icons';
1515
import { prefix } from '../_prefix';
1616

1717
const types = {
18+
background: {
19+
icon: Layers,
20+
},
1821
'deprecation-notice': {
1922
icon: WarningHex,
2023
},

packages/react/.storybook/templates/WithLayer/WithLayer.scss

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/react/.storybook/templates/WithLayer/index.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import PropTypes from 'prop-types';
99
import React from 'react';
10-
import './WithLayer.scss';
1110

1211
import { Layer } from '../../../src';
1312

@@ -20,24 +19,18 @@ function WithLayer({ children }) {
2019
}
2120

2221
return (
23-
<Annotation type="layer" text="Layer 1" className={`${prefix}--with-layer`}>
22+
<Annotation type="background" text="$background">
2423
{renderChild(0)}
25-
26-
<Annotation
27-
type="layer"
28-
text="Layer 2"
29-
className={`${prefix}--with-layer`}>
30-
<Layer>
24+
<Layer withBackground>
25+
<Annotation type="layer" text="$layer-01">
3126
{renderChild(1)}
32-
33-
<Annotation
34-
type="layer"
35-
text="Layer 3"
36-
className={`${prefix}--with-layer`}>
37-
<Layer>{renderChild(2)}</Layer>
38-
</Annotation>
39-
</Layer>
40-
</Annotation>
27+
<Layer withBackground>
28+
<Annotation type="layer" text="$layer-02">
29+
{renderChild(2)}
30+
</Annotation>
31+
</Layer>
32+
</Annotation>
33+
</Layer>
4134
</Annotation>
4235
);
4336
}

packages/react/src/components/Theme/Theme-story.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@
2929
background: theme.$layer;
3030
color: theme.$text-primary;
3131
}
32+
33+
.carbon-storybook-template--annotation--background {
34+
margin: 0 !important; /* stylelint-disable-line declaration-no-important */
35+
min-block-size: 0 !important; /* stylelint-disable-line declaration-no-important */
36+
}

packages/react/src/components/Tile/tile-story.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@
1818
div .cds--tile--selectable:not(:last-child) {
1919
margin-block-end: 1rem;
2020
}
21+
22+
.carbon-storybook-template--annotation--background {
23+
margin: 0 !important; /* stylelint-disable-line declaration-no-important */
24+
min-block-size: 0 !important; /* stylelint-disable-line declaration-no-important */
25+
}

0 commit comments

Comments
 (0)