Skip to content

Commit 4981cb9

Browse files
ismail-syedlemonmade
authored andcommitted
Shopify UNITE! (#264)
* Migrate ./styles changes * Migrate ./icons * Migrate ./embedded * Migrate ./components * Build svg icons changes * Fix relative path * Add back src/components/README.md
1 parent 5d28efe commit 4981cb9

File tree

16 files changed

+94
-51
lines changed

16 files changed

+94
-51
lines changed

src/components/AccountConnection/AccountConnection.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
.TermsOfService {
44
margin-top: spacing(loose);
55
}
6+
7+
.Content {
8+
> * + * {
9+
margin-top: spacing(tight);
10+
}
11+
}

src/components/AccountConnection/AccountConnection.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {buttonFrom} from '../Button';
66
import Card from '../Card';
77
import SettingAction from '../SettingAction';
88
import Stack from '../Stack';
9-
import TextContainer from '../TextContainer';
109
import TextStyle from '../TextStyle';
1110

1211
import * as styles from './AccountConnection.scss';
@@ -43,9 +42,12 @@ export default function AccountConnection({
4342
)
4443
: null;
4544

46-
const titleMarkup = title
47-
? <div>{title}</div>
48-
: <div>{accountName}</div>;
45+
let titleMarkup: React.ReactNode = null;
46+
if (title) {
47+
titleMarkup = <div>{title}</div>;
48+
} else if (accountName) {
49+
titleMarkup = <div>{accountName}</div>;
50+
}
4951

5052
const detailsMarkup = details
5153
? <div><TextStyle variation="subdued">{details}</TextStyle></div>
@@ -65,10 +67,10 @@ export default function AccountConnection({
6567
<Stack>
6668
{avatarMarkup}
6769
<Stack.Item fill>
68-
<TextContainer>
70+
<div className={styles.Content}>
6971
{titleMarkup}
7072
{detailsMarkup}
71-
</TextContainer>
73+
</div>
7274
</Stack.Item>
7375
</Stack>
7476
</SettingAction>

src/components/Banner/Banner.scss

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,23 @@ $ribbon-flex-basis: rem(32px);
1414
$secondary-action-vertical-padding: 0.5 * (control-height() - line-height(body));
1515
$secondary-action-horizontal-padding: 1.5 * spacing(tight);
1616

17+
@mixin banner-colors($highlight, $background) {
18+
background-color: $background;
19+
box-shadow:
20+
inset 0 $accent-height 0 0 $highlight,
21+
inset shadow(transparent),
22+
shadow();
23+
24+
&:focus {
25+
box-shadow:
26+
inset 0 $accent-height 0 0 $highlight,
27+
inset 0 0 0 $accent-height $highlight,
28+
shadow();
29+
}
30+
}
31+
1732
.Banner {
33+
@include banner-colors(color(ink, lighter), color(sky, light));
1834
position: relative;
1935
display: flex;
2036
padding: spacing();
@@ -34,30 +50,11 @@ $secondary-action-horizontal-padding: 1.5 * spacing(tight);
3450
padding-right: $dismiss-size + (2 * spacing());
3551
}
3652

37-
@mixin banner-colors($highlight, $background) {
38-
background-color: $background;
39-
box-shadow:
40-
inset 0 $accent-height 0 0 $highlight,
41-
inset shadow(transparent),
42-
shadow();
43-
44-
&:focus {
45-
box-shadow:
46-
inset 0 $accent-height 0 0 $highlight,
47-
inset 0 0 0 $accent-height $highlight,
48-
shadow();
49-
}
50-
}
51-
52-
.statusInfo {
53-
@include banner-colors(color(ink, lighter), color(sky, light));
54-
}
55-
5653
.statusSuccess {
5754
@include banner-colors(color(green), color(green, lighter));
5855
}
5956

60-
.statusAttention {
57+
.statusInfo {
6158
@include banner-colors(color(teal), color(teal, lighter));
6259
}
6360

src/components/Banner/Banner.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ import UnstyledLink from '../UnstyledLink';
99
import Icon, {Props as IconProps} from '../Icon';
1010

1111
import * as styles from './Banner.scss';
12-
import circleAlert from './icons/circle-alert.svg';
13-
import circleCheckMark from './icons/circle-check-mark.svg';
14-
import confetti from './icons/confetti.svg';
1512

16-
export type Status = 'success' | 'info' | 'attention' | 'warning' | 'critical';
13+
import successIcon from './icons/circle-check-mark.svg';
14+
import infoIcon from './icons/flag.svg';
15+
import warningIcon from './icons/circle-alert.svg';
16+
import criticalIcon from './icons/circle-barred.svg';
17+
import fallbackIcon from './icons/confetti.svg';
18+
19+
export type Status = 'success' | 'info' | 'warning' | 'critical';
1720

1821
export interface Props {
1922
icon?: IconProps['source'],
@@ -40,23 +43,23 @@ export default function Banner({
4043
switch (status) {
4144
case 'success':
4245
color = 'greenDark';
43-
defaultIcon = circleCheckMark;
46+
defaultIcon = successIcon;
4447
break;
45-
case 'attention' :
48+
case 'info' :
4649
color = 'tealDark';
47-
defaultIcon = confetti;
50+
defaultIcon = infoIcon;
4851
break;
4952
case 'warning':
5053
color = 'yellowDark';
51-
defaultIcon = circleAlert;
54+
defaultIcon = warningIcon;
5255
break;
5356
case 'critical':
5457
color = 'redDark';
55-
defaultIcon = circleAlert;
58+
defaultIcon = criticalIcon;
5659
break;
5760
default:
5861
color = 'ink';
59-
defaultIcon = circleCheckMark;
62+
defaultIcon = fallbackIcon;
6063
}
6164

6265
const className = classNames(
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/components/Page/Header.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,19 @@ export default function Header({
4646
: null;
4747

4848
const secondaryActionsMarkup = secondaryActions
49-
? <div>{secondaryActionsFrom(secondaryActions)}</div>
49+
? (
50+
<div className={styles.SecondaryActions}>
51+
{secondaryActionsFrom(secondaryActions)}
52+
</div>
53+
)
5054
: null;
5155

5256
const paginationMarkup = pagination
53-
? <Pagination {...pagination} plain />
57+
? (
58+
<div className={styles.Pagination}>
59+
<Pagination {...pagination} plain />
60+
</div>
61+
)
5462
: null;
5563

5664
const actionsMarkup = primaryActionMarkup || secondaryActionsMarkup

src/components/Page/Page.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ $stacking-order: (
6767
.Navigation {
6868
display: flex;
6969
justify-content: space-between;
70+
}
7071

71-
> *:last-child {
72-
margin-left: auto;
73-
}
72+
.Pagination {
73+
margin-left: auto;
7474
}
7575

7676
.Actions {
@@ -83,6 +83,10 @@ $stacking-order: (
8383
}
8484
}
8585

86+
.SecondaryActions {
87+
margin-right: auto;
88+
}
89+
8690
.PrimaryAction {
8791
display: flex;
8892
align-items: center;

0 commit comments

Comments
 (0)