Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b1371fe
add summer editions 2023 feature flag to AppProvider FeaturesContext …
gwyneplaine May 18, 2023
e02ce9f
[v11.x.x] Fix Storybook AppProviderDecorator (#9233)
sophschneider May 18, 2023
88aa367
Add global class and scss helper (#9238)
kyledurand May 19, 2023
9936028
fix app provider stories (#9278)
gwyneplaine May 25, 2023
e22e484
Add experimental colors
gwyneplaine May 25, 2023
777e2ce
cards se23 (#9277)
gwyneplaine May 25, 2023
ec7cb96
fix: test runner (#9281)
gwyneplaine May 25, 2023
68ba6ee
fix appprovider stories (#9283)
gwyneplaine May 25, 2023
2bbc9f9
Add experimental border colors (#9285)
kyledurand May 25, 2023
08b0d24
Add experimental bg colors (#9286)
kyledurand May 25, 2023
3949648
Add experimental icon colors (#9284)
kyledurand May 25, 2023
e92f99f
Add experimental text colors (#9282)
kyledurand May 25, 2023
616cf96
Card updates (#9268)
kyledurand May 25, 2023
130db3c
Fix warning / caution mappings (#9288)
kyledurand May 25, 2023
2aa9591
fix: global selector to be less specific (#9291)
kyledurand May 25, 2023
52f150c
Update bg disabled tokens (#9297)
kyledurand May 26, 2023
f31df00
Add new transparency tokens (#9296)
kyledurand May 26, 2023
76c8d4e
update bg-strong tokens (#9310)
kyledurand May 26, 2023
5db8448
Add `experimental` to colour aliases (#9312)
sophschneider May 29, 2023
e18e6c6
Add bg success strong hover / active (#9315)
kyledurand May 29, 2023
43604af
[Banner] Updates to Banner (#9294)
sophschneider May 31, 2023
f483000
Add new font-size tokens (#9313)
kyledurand May 31, 2023
dcf9be2
Add new spacing / border tokens and aliases (#9322)
kyledurand May 31, 2023
a20fffb
chore: remove export on experimental font size scale (#9334)
kyledurand May 31, 2023
b51cfed
Add experimental shadow values (#9333)
aveline May 31, 2023
14ecb57
Tag updates (#9324)
kyledurand May 31, 2023
d52289b
`v11.x.x` updates to `Badge` (#9292)
May 31, 2023
bc4f8cd
Remove 1.5px border-width (#9335)
kyledurand May 31, 2023
28fa2c2
Revert Badge design review story
sophschneider May 31, 2023
5d5de92
Remove transition on focus (#9336)
kyledurand May 31, 2023
6f4579d
`v11.x.x` updates to `KeyboardKey` (#9267)
Jun 1, 2023
f91f8c8
Clean up feature branch
sophschneider Jun 1, 2023
7767b66
Remove :where selector for old ios safari (#9344)
kyledurand Jun 1, 2023
2895fb9
Move `experimental` prefix to suffix (#9349)
aaronccasanova Jun 1, 2023
07fb937
[Page, Layout] Update styles (#9317)
kyledurand Jun 1, 2023
1e7329e
Update font-size tokens (#9346)
aaronccasanova Jun 1, 2023
8ed44e3
[Navigation] Update styles for v11 (#9332)
mateus Jun 1, 2023
78e0326
Add line height token (#9347)
aaronccasanova Jun 1, 2023
d627fee
Update Spinner (#9345)
lgriffee Jun 1, 2023
bb1c47b
Update Tooltip (#9350)
lgriffee Jun 1, 2023
c1ddbee
Update Loading (#9351)
kyledurand Jun 1, 2023
11dea74
Add `All` stories for Badge, Banner, and KeyboardKey (#9352)
sophschneider Jun 1, 2023
ef446d0
`v11.x.x` Radio updates (#9258)
gwyneplaine Jun 2, 2023
79fad1c
Button updates (#9242)
aveline Jun 2, 2023
a0c8145
[Banner updates] Fix content horizontal stack (#9360)
sophschneider Jun 2, 2023
52f91c2
Temporarily add `UseFeatures` render prop (#9355)
aaronccasanova Jun 2, 2023
b7fa340
Update `Link` styles (#9359)
aveline Jun 2, 2023
2c85c3a
Update `body` font-size in `AppProvider` (#9363)
aaronccasanova Jun 2, 2023
5df3345
Update `Text` component styles (#9353)
aaronccasanova Jun 2, 2023
83f45ea
Unify experimental tokens configuration (#9365)
aaronccasanova Jun 2, 2023
6374255
Merge branch 'main' into v11.x.x
alex-page Jun 5, 2023
4a50af9
Merge branch 'main' into v11.x.x
alex-page Jun 5, 2023
f91385b
[Modal] Update styles
jesstelford Jun 1, 2023
fbbf346
Fix up changesets
alex-page Jun 5, 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/cool-hats-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed small screen horizontal overflow by changing `Banner` focus ring from `box-shadow` to `outline`
5 changes: 5 additions & 0 deletions .changeset/good-turtles-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Removed unused transition delay param from focus-ring mixin
5 changes: 5 additions & 0 deletions .changeset/khaki-eggs-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Add polarisSummerEditions2023 feature flag to AppProvider context.
5 changes: 5 additions & 0 deletions .changeset/tough-deers-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Add `primarySuccess` variant prop to `Button`
29 changes: 29 additions & 0 deletions polaris-react/.storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,23 @@ addons.register('polaris/global-controls', () => {
match: ({viewMode}) => viewMode === 'story',
render: ({active, key}) => <GridPanel active={active} key={key} />,
});
addons.add('provider/panel', {
type: types.PANEL,
title: 'Feature flags',
match: ({viewMode}) => viewMode === 'story',
render: ({active, key}) => <FeatureFlagPanel active={active} key={key} />,
});
});

export const featureFlagOptions = {
polarisSummerEditions2023: {
name: 'polarisSummerEditions2023',
description: 'Toggle the summer editions feature flag',
defaultValue: false,
control: {type: 'boolean'},
},
};

export const gridOptions = {
showGrid: {
name: 'Show grid overlay',
Expand Down Expand Up @@ -88,6 +103,20 @@ export const gridOptions = {
},
};

function FeatureFlagPanel(props) {
const [globals, updateGlobals] = useGlobals();
return (
<AddonPanel {...props}>
<ArgsTable
inAddonPanel
rows={featureFlagOptions}
args={globals}
updateArgs={updateGlobals}
/>
</AddonPanel>
);
}

function GridPanel(props) {
const [globals, updateGlobals] = useGlobals();

Expand Down
12 changes: 9 additions & 3 deletions polaris-react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {AppProvider} from '../src';
import enTranslations from '../locales/en.json';
import {GridOverlay} from './GridOverlay';
import {RenderPerformanceProfiler} from './RenderPerformanceProfiler';
import {gridOptions} from './manager';
import {gridOptions, featureFlagOptions} from './manager';
import {breakpoints} from '@shopify/polaris-tokens';

function StrictModeDecorator(Story, context) {
Expand All @@ -19,10 +19,15 @@ function StrictModeDecorator(Story, context) {
}

function AppProviderDecorator(Story, context) {
const {polarisSummerEditions2023} = context.globals;
if (context.args.omitAppProvider) return <Story {...context} />;

return (
<AppProvider i18n={enTranslations}>
<AppProvider
features={{
polarisSummerEditions2023,
}}
i18n={enTranslations}
>
<Story {...context} />
</AppProvider>
);
Expand Down Expand Up @@ -76,6 +81,7 @@ export const globalTypes = {
],
},
},
...featureFlagOptions,
...gridOptions,
};
const viewPorts = Object.entries({
Expand Down
37 changes: 24 additions & 13 deletions polaris-react/playground/DetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ import {
Thumbnail,
Toast,
TopBar,
FooterHelp,
Link,
} from '../src';
import type {DropZoneProps} from '../src';
import type {DropZoneProps, PageProps} from '../src';

import styles from './DetailsPage.scss';

Expand Down Expand Up @@ -480,7 +482,7 @@ export function DetailsPage() {
setPreviewValue(newValue);
}, []);

const actions1 = [
const actions1: PageProps['secondaryActions'] = [
{
content: 'Duplicate',
onAction: () => console.log('duplicate'),
Expand All @@ -490,17 +492,18 @@ export function DetailsPage() {
onAction: () => console.log('print'),
},
];
const actions2 = [
const actions2: PageProps['secondaryActions'] = [
{
content: 'Print',
onAction: () => console.log('print'),
},
];

const [actions, setActions] = useState(actions1);
const [actions, setActions] =
useState<PageProps['secondaryActions']>(actions1);

const toggleActions = () => {
if (actions.length === 2) {
if (Array.isArray(actions) && actions.length === 2) {
setActions(actions2);
} else {
setActions(actions1);
Expand Down Expand Up @@ -556,15 +559,17 @@ export function DetailsPage() {
onAction: () => console.log('save'),
}}
additionalMetadata="Created May 8, 2020 at 7:31 am from Developer Tools (via import)"
secondaryActions={[
...actions,
{
content: 'View',
onAction: () => {
console.log(previewValue);
secondaryActions={
Array.isArray(actions) && [
...actions,
{
content: 'View',
onAction: () => {
console.log(previewValue);
},
},
},
]}
]
}
actionGroups={[
{
title: 'Promote',
Expand Down Expand Up @@ -709,6 +714,12 @@ export function DetailsPage() {
{pageMarkup}
{toastMarkup}
{modalMarkup}
<FooterHelp>
Learn more about{' '}
<Link url="https://help.shopify.com/manual/orders/fulfill-orders">
fulfilling orders
</Link>
</FooterHelp>
</Frame>
);
}
Expand Down
1 change: 1 addition & 0 deletions polaris-react/playground/KitchenSink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function KitchenSink() {
'Sheet',
'Frame',
'Loading',
'AppProvider',
].includes(id.split(':')[0]),
)
.map(([id, Story]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {useI18n} from '../../../../utilities/i18n';
import {SecondaryAction} from '../SecondaryAction';
import {useEventListener} from '../../../../utilities/use-event-listener';
import {useIsomorphicLayoutEffect} from '../../../../utilities/use-isomorphic-layout-effect';
import {useFeatures} from '../../../../utilities/features';

import styles from './Actions.scss';

Expand Down Expand Up @@ -41,6 +42,7 @@ export function Actions({actions = [], groups = [], onActionRollup}: Props) {
const timesMeasured = useRef(0);
const actionWidthsRef = useRef<number[]>([]);
const rollupActiveRef = useRef<boolean | null>(null);
const {polarisSummerEditions2023} = useFeatures();
const [activeMenuGroup, setActiveMenuGroup] = useState<string | undefined>(
undefined,
);
Expand Down Expand Up @@ -311,7 +313,7 @@ export function Actions({actions = [], groups = [], onActionRollup}: Props) {
});

const groupedActionsMarkup = (
<ButtonGroup spacing="extraTight">
<ButtonGroup spacing={polarisSummerEditions2023 ? 'tight' : 'extraTight'}>
{rollUppableActionsMarkup}
{actionsMarkup}
{groupsMarkup}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../../styles/common';

.RollupActivator {
text-align: right;
// Override `.iconOnly` negative margins
Expand All @@ -11,5 +13,27 @@
&:focus {
border: var(--p-border-width-1) solid var(--p-color-border-strong);
}

#{$se23} & {
background: var(--p-color-bg-strong);
border-radius: var(--p-border-radius-2);
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:hover {
background: var(--p-color-bg-strong-hover);
}
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:focus {
/* stylelint-disable-next-line polaris/border/polaris/at-rule-disallowed-list -- se23 button overrides */
@include no-focus-ring;
outline: var(--p-border-width-2) solid
var(--p-color-border-interactive-focus);
outline-offset: var(--p-space-05);
background: var(--p-color-bg-strong-active);
}
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:active {
background: var(--p-color-bg-strong-active);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,54 @@
}
}
}

#{$se23} & {
// stylelint-disable-next-line selector-max-combinators -- se23
a,
button {
border: none;
min-height: 28px;
padding: var(--p-space-1) var(--p-space-3);
background-color: var(--p-color-bg-strong) !important;
border-radius: var(--p-border-radius-2) !important;
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:hover {
background-color: var(--p-color-bg-strong-hover) !important;
}
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:focus,
&:active {
background-color: var(--p-color-bg-strong-active) !important;
}
/* stylelint-disable-next-line selector-max-combinators -- se23 */
&:focus:not(:active) {
/* stylelint-disable-next-line polaris/border/polaris/at-rule-disallowed-list -- se23 */
@include no-focus-ring;
outline: var(--p-border-width-2) solid
var(--p-color-border-interactive-focus);
outline-offset: var(--p-space-05);
}
}

&.destructive {
/* stylelint-disable-next-line selector-max-combinators -- se23 */
a,
button {
color: var(--p-color-text-critical) !important;
/* stylelint-disable-next-line selector-max-combinators, max-nesting-depth -- se23 */
&:hover {
background-color: var(--p-color-bg-strong-hover) !important;
}
/* stylelint-disable-next-line selector-max-combinators, max-nesting-depth -- se23 */
&:focus,
&:active {
background-color: var(--p-color-bg-strong-active) !important;
}
/* stylelint-disable-next-line selector-max-combinators, max-nesting-depth, selector-max-compound-selectors -- se23 */
svg {
fill: var(--p-color-icon-critical-strong-experimental);
}
}
}
}
}
4 changes: 4 additions & 0 deletions polaris-react/src/components/AppProvider/AppProvider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ body {
color: var(--p-color-text);
}

#{$se23} body {
font-size: var(--p-font-size-80-experimental);
}

html,
body,
button {
Expand Down
Loading