Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
572482f
Consolidate booleans into `variant` prop
aveline Aug 15, 2023
6a1c083
Add `monochromePlain` variant
aveline Aug 16, 2023
a5f98d0
Update props on instances of `Button`
aveline Aug 16, 2023
39956dd
Update `plain` prop on instances of `Button`
aveline Aug 16, 2023
a649e82
Straggler prop update
aveline Aug 16, 2023
95f312a
Handle `monochromePlain` variant for connected disclosure
aveline Aug 16, 2023
f5a1569
Remove `outline` styles
aveline Aug 16, 2023
af81b19
Random fixes
aveline Aug 16, 2023
0426d88
Update button props
aveline Aug 16, 2023
aa6af7e
💚 fix tests
aveline Aug 16, 2023
1a04a48
Fix props
aveline Aug 16, 2023
310dd7f
Fix prop
aveline Aug 16, 2023
8f39c61
Merge branch 'next' into button-next
aveline Aug 16, 2023
2e9827c
Fix props
aveline Aug 16, 2023
46ebd39
Update styleguide `Button` examples
aveline Aug 16, 2023
4a33f52
Update styleguide `Button` props
aveline Aug 16, 2023
e318f4f
Update styleguide `Button` props
aveline Aug 16, 2023
c733b20
Update styleguide `Button` props
aveline Aug 17, 2023
5c6599a
💚 Fix tests
aveline Aug 17, 2023
32a3123
Merge branch 'next' into button-next
aveline Aug 17, 2023
3e91bed
Remove `tone` and `variant` default value
aveline Aug 17, 2023
8c34870
Fix `Button` props in stories
aveline Aug 17, 2023
c361a9a
💚 Fix tests
aveline Aug 18, 2023
1ec1bca
Merge branch 'next' into button-next
aveline Aug 18, 2023
45c293f
Update Filters.stories.tsx
aveline Aug 18, 2023
d6d2eb5
Update Button.tsx
aveline Aug 18, 2023
4435f8f
Clean up
aveline Aug 18, 2023
f4ca073
Create silent-brooms-confess.md
aveline Aug 18, 2023
2511c70
Update migrating-from-v11-to-v12.md
aveline Aug 18, 2023
bcd4152
Update silent-brooms-confess.md
aveline Aug 18, 2023
913f301
Rename `primaryPlain` variant to `tertiary`
aveline Aug 21, 2023
0f4cd53
Update `Filter` button variant to `tertiary`
aveline Aug 21, 2023
fe87909
Merge branch 'next' into button-next
aveline Aug 21, 2023
38d8da4
update `Button` usages from `primaryPlain` to `tertiary`
aveline Aug 21, 2023
81e813d
💚
aveline Aug 21, 2023
0b82818
Update `tertiary` prop on styleguide
aveline Aug 21, 2023
b13e72e
Update filters-with-children-content.tsx
aveline Aug 21, 2023
4252b5f
Fix regression from merge conflict
aveline Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silent-brooms-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

Consolidated boolean `Button` props into `variant` prop
3 changes: 3 additions & 0 deletions documentation/guides/migrating-from-v11-to-v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ Secondary, becomes oneThird:
**HorizontalGrid**

`npx @shopify/polaris-migrator react-rename-component <path> --renameFrom="HorizontalGrid" --renameTo="InlineGrid" --renamePropsFrom="HorizontalGridProps" --renamePropsTo="InlineGridProps"`

**Button**
// TODO
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function AccountConnection({
) : null;

const actionElement = action
? buttonFrom(action, {primary: !connected})
? buttonFrom(action, {variant: connected ? undefined : 'primary'})
: null;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('<AccountConnection />', () => {
expect(accountConnection).toContainReactComponent(Button, {
children: action.content,
onClick: action.onAction,
primary: true,
variant: 'primary',
});
});

Expand All @@ -78,7 +78,6 @@ describe('<AccountConnection />', () => {
expect(accountConnection).toContainReactComponent(Button, {
children: action.content,
onClick: action.onAction,
primary: false,
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function RollupActions({
const activatorMarkup = (
<div className={styles.RollupActivator}>
<Button
outline
icon={HorizontalDotsMinor}
accessibilityLabel={
accessibilityLabel ||
Expand Down
3 changes: 1 addition & 2 deletions polaris-react/src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ export function BannerLayout({
) : null,
dismissButton: onDismiss ? (
<Button
plain
primary
variant="tertiary"
icon={
<span
className={
Expand Down
157 changes: 2 additions & 155 deletions polaris-react/src/components/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@

.primary,
.destructive,
.primaryPlain {
.tertiary {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($border-width: 0);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down Expand Up @@ -470,7 +470,7 @@
}
}

.primaryPlain {
.tertiary {
// stylelint-disable -- Button custom properties
--pc-button-color: transparent;
--pc-button-text: var(--p-color-text);
Expand Down Expand Up @@ -584,91 +584,6 @@
}
}

.outline {
background: transparent;
border: var(--p-border-width-1) solid var(--p-color-border);
box-shadow: none;
color: var(--p-color-text);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($border-width: 1px);

&:hover {
border: var(--p-border-width-1) solid var(--p-color-border);
box-shadow: none;
background: var(--p-color-bg-hover);
}

&:focus-visible {
border: var(--p-border-width-1) solid var(--p-color-border);
box-shadow: none;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($style: 'focused');
}

&:active {
border: var(--p-border-width-1) solid var(--p-color-border);
box-shadow: none;
background: var(--p-color-bg-active);

&::after {
box-shadow: none;
}
}

&.pressed {
background: var(--p-color-bg-subdued-active);
border: var(--p-border-width-1) solid var(--p-color-border);
box-shadow: none;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
color: var(--pc-button-text);
}

&.disabled {
border: var(--p-border-width-1) solid var(--p-color-border-disabled);
color: var(--p-color-text-disabled);
}

&.destructive {
background: transparent;
border: var(--p-border-width-1) solid var(--p-color-border-critical);
box-shadow: none;
color: var(--p-color-text-critical);

svg {
fill: var(--p-color-icon-critical);
}

&:hover {
border: var(--p-border-width-1) solid var(--p-color-border-critical);
background: var(--p-color-bg-critical-subdued);
}

&:focus-visible {
border: var(--p-border-width-1) solid var(--p-color-border-critical);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($style: 'focused');
}

&:active {
border: var(--p-border-width-1) solid var(--p-color-border-critical);
background: var(--p-color-bg-critical-subdued);
}

// stylelint-disable-next-line selector-max-class -- too many classes
&.disabled {
border: var(--p-border-width-1) solid var(--p-color-border-disabled);
color: var(--p-color-text-disabled);
}

// stylelint-disable-next-line selector-max-class -- too many classes
&.pressed {
border: var(--p-border-width-1) solid var(--p-color-border-critical);
background: var(--p-color-bg-critical-subdued);
color: var(--p-color-text-critical);
}
}
}

.disabled {
cursor: default;
pointer-events: none;
Expand Down Expand Up @@ -1024,7 +939,6 @@
}

.monochrome {
&.outline,
&.plain {
color: currentColor;

Expand Down Expand Up @@ -1070,72 +984,11 @@
fill: currentColor;
}
}
}

&.plain {
.Text:not(.removeUnderline) {
text-decoration: underline;
}
}

&.outline {
position: relative;
border-color: currentColor;
box-shadow: 0 0 0 var(--p-border-width-1) currentColor;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($border-width: 2px);

&::before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: currentColor;
opacity: 0;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
z-index: 0;
}

&.pressed {
background: transparent;
box-shadow: none;
color: currentColor;

&::before {
opacity: 0.2;
}
}

&:hover,
&:focus,
&:active {
background-color: transparent;
border-color: currentColor;

&::before {
opacity: 0.07;
}
}

&:focus-visible {
box-shadow: 0 0 0 var(--p-border-width-1) currentColor;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
@include focus-ring($style: 'focused');
}

&:active::after {
box-shadow: none;
}

&:hover,
&:active {
&::before {
opacity: 0.05;
}
}
}
}
// stylelint-enable selector-max-specificity, selector-max-class

Expand All @@ -1160,12 +1013,6 @@
&.primary,
&.destructive {
margin-left: calc(var(--p-space-05) * -1);

// stylelint-disable-next-line selector-max-class -- generated by polaris-migrator DO NOT COPY
&.outline {
margin-left: 0;
border-left: 0;
}
}

&:active {
Expand Down
Loading