Skip to content

Commit d18e9f8

Browse files
authored
chore(fuselage-toastbar): Toastbar Elevation (#921)
* chore: remove border from elevation * fix: toastbar elevation * fix: review * chore: toastbar elevation fix
1 parent 0bb5c90 commit d18e9f8

File tree

5 files changed

+27
-17
lines changed

5 files changed

+27
-17
lines changed

packages/fuselage-toastbar/src/ToastBarZone.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export const ToastBarContainer = styled(
1919
position: fixed;
2020
display: flex;
2121
flex-direction: column;
22-
overflow: hidden;
2322
margin: 1rem;
24-
z-index: 1;
23+
z-index: 2;
2524
${(p) => (p.position ? positionProps[p.position] : '')}
2625
`;
2726

packages/fuselage/src/components/Box/props.stories.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,8 @@ The `is` prop allows `Box` to render any component capable of handling common DO
878878
<Box elevation='0' />
879879
<Box elevation='1' />
880880
<Box elevation='2' />
881+
<Box elevation='1nb' />
882+
<Box elevation='2nb' />
881883
</>
882884
</Story>
883885
</Canvas>

packages/fuselage/src/components/Box/stylingProps.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export type StylingProps = {
153153
textDecorationLine: CSSProperties['textDecorationLine'];
154154
wordBreak: CSSProperties['wordBreak'];
155155

156-
elevation: '0' | '1' | '2';
156+
elevation: '0' | '1' | '2' | '1nb' | '2nb';
157157
invisible: boolean;
158158
withTruncatedText: boolean;
159159
size: CSSProperties['blockSize'];
@@ -379,13 +379,26 @@ export const propDefs: Record<keyof StylingProps, PropDefinition> = {
379379
`;
380380
}
381381

382+
if (value === '1nb') {
383+
return css`
384+
box-shadow: 0px 0px 12px 0px ${Palette.shadow['shadow-elevation-1']};
385+
`;
386+
}
387+
382388
if (value === '2') {
383389
return css`
384390
box-shadow: 0px 0px 2px 0px ${Palette.shadow['shadow-elevation-2x']},
385391
0px 0px 12px 0px ${Palette.shadow['shadow-elevation-2y']};
386392
border: 1px solid ${Palette.shadow['shadow-elevation-border']};
387393
`;
388394
}
395+
396+
if (value === '2nb') {
397+
return css`
398+
box-shadow: 0px 0px 2px 0px ${Palette.shadow['shadow-elevation-2x']},
399+
0px 0px 12px 0px ${Palette.shadow['shadow-elevation-2y']};
400+
`;
401+
}
389402
},
390403
},
391404
invisible: {

packages/fuselage/src/components/ToastBar/ToastBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function ToastBar({
7070
>
7171
<Box
7272
className={`rcx-toastbar rcx-toastbar--${variant} ${className}`}
73-
elevation='1'
73+
elevation='2nb'
7474
>
7575
<div className='rcx-toastbar-inner'>
7676
<Icon size='x20' name={iconName} />
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
@use '../colors.scss';
22
@use '../../styles/functions.scss';
33

4-
@mixin elevation-level($level) {
4+
@mixin elevation-level($level, $border: true) {
55
@if $level == 1 {
6-
border: 1px
7-
solid
8-
functions.theme(
9-
'color-shadow-elevation-border',
10-
colors.elevation(border)
11-
);
126
box-shadow: 0
137
0
148
12px
159
0
1610
functions.theme('color-shadow-elevation-1', colors.elevation(1));
1711
}
1812
@if $level == 2 {
19-
border: 1px
20-
solid
21-
functions.theme(
22-
'color-shadow-elevation-border',
23-
colors.elevation(border)
24-
);
2513
box-shadow: 0
2614
0
2715
2px
@@ -33,4 +21,12 @@
3321
0
3422
functions.theme('color-shadow-elevation-2y', colors.elevation('2y'));
3523
}
24+
@if $border {
25+
border: 1px
26+
solid
27+
functions.theme(
28+
'color-shadow-elevation-border',
29+
colors.elevation(border)
30+
);
31+
}
3632
}

0 commit comments

Comments
 (0)