Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/beige-falcons-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Remove unused class in Page Header
5 changes: 5 additions & 0 deletions .changeset/fresh-boats-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Updated `Tabs` component to use layout primitives
5 changes: 5 additions & 0 deletions .changeset/lazy-crews-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Rebuilt Page Header with layout components
5 changes: 5 additions & 0 deletions .changeset/slimy-years-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Updated `OptionList` to use new layout primitives
5 changes: 5 additions & 0 deletions .changeset/thin-apricots-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Updated `Popover` to use new layout primitives
71 changes: 36 additions & 35 deletions polaris-react/src/components/DropZone/DropZone.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import {
DropZone,
List,
Page,
Stack,
AlphaStack,
Thumbnail,
Inline,
} from '@shopify/polaris';
import {NoteMinor} from '@shopify/polaris-icons';

Expand All @@ -30,9 +31,9 @@ export function Default() {
const fileUpload = !files.length && <DropZone.FileUpload />;
const uploadedFiles = files.length > 0 && (
<div style={{padding: '0'}}>
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -49,9 +50,9 @@ export function Default() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
</div>
);

Expand Down Expand Up @@ -86,9 +87,9 @@ export function WithImageFileUpload() {

const fileUpload = !files.length && <DropZone.FileUpload />;
const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -101,9 +102,9 @@ export function WithImageFileUpload() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

const errorMessage = hasError && (
Expand All @@ -122,13 +123,13 @@ export function WithImageFileUpload() {
);

return (
<Stack vertical>
<AlphaStack fullWidth>
{errorMessage}
<DropZone accept="image/*" type="image" onDrop={handleDrop}>
{uploadedFiles}
{fileUpload}
</DropZone>
</Stack>
</AlphaStack>
);
}

Expand All @@ -145,7 +146,7 @@ export function WithSingleFileUpload() {

const fileUpload = !file && <DropZone.FileUpload />;
const uploadedFile = file && (
<Stack>
<Inline>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -162,7 +163,7 @@ export function WithSingleFileUpload() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
);

return (
Expand All @@ -185,9 +186,9 @@ export function WithDropOnPage() {
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png'];

const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -204,9 +205,9 @@ export function WithDropOnPage() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

const uploadMessage = !uploadedFiles && <DropZone.FileUpload />;
Expand Down Expand Up @@ -247,9 +248,9 @@ export function AcceptsOnlySVGFiles() {
);

const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -262,9 +263,9 @@ export function AcceptsOnlySVGFiles() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

const errorMessage = hasError && (
Expand All @@ -283,7 +284,7 @@ export function AcceptsOnlySVGFiles() {
);

return (
<Stack vertical>
<AlphaStack fullWidth>
{errorMessage}
<DropZone
accept="image/svg+xml"
Expand All @@ -293,7 +294,7 @@ export function AcceptsOnlySVGFiles() {
>
{uploadedFiles}
</DropZone>
</Stack>
</AlphaStack>
);
}

Expand All @@ -310,9 +311,9 @@ export function Nested() {

const fileUpload = !files.length && <DropZone.FileUpload />;
const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -329,9 +330,9 @@ export function Nested() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

return (
Expand Down Expand Up @@ -382,9 +383,9 @@ export function WithCustomFileUploadText() {
);

const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -401,9 +402,9 @@ export function WithCustomFileUploadText() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

return (
Expand Down Expand Up @@ -431,9 +432,9 @@ export function WithCustomFileDialogTrigger() {
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png'];

const uploadedFiles = files.length > 0 && (
<Stack vertical>
<AlphaStack>
{files.map((file, index) => (
<Stack alignment="center" key={index}>
<Inline align="center" key={index}>
<Thumbnail
size="small"
alt={file.name}
Expand All @@ -450,9 +451,9 @@ export function WithCustomFileDialogTrigger() {
{file.size} bytes
</Text>
</div>
</Stack>
</Inline>
))}
</Stack>
</AlphaStack>
);

return (
Expand Down
6 changes: 3 additions & 3 deletions polaris-react/src/components/DropZone/DropZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {debounce} from '../../utilities/debounce';
import {classNames, variationName} from '../../utilities/css';
import {capitalize} from '../../utilities/capitalize';
import {Icon} from '../Icon';
import {Stack} from '../Stack';
import {Text} from '../Text';
import {Labelled, LabelledProps} from '../Labelled';
import {useI18n} from '../../utilities/i18n';
import {isServer} from '../../utilities/target';
import {useUniqueId} from '../../utilities/unique-id';
import {useComponentDidMount} from '../../utilities/use-component-did-mount';
import {useToggle} from '../../utilities/use-toggle';
import {AlphaStack} from '../AlphaStack';

import {FileUpload} from './components';
import {DropZoneContext} from './context';
Expand Down Expand Up @@ -419,14 +419,14 @@ export const DropZone: React.FunctionComponent<DropZoneProps> & {
) {
return (
<div className={styles.Overlay}>
<Stack vertical spacing="tight">
<AlphaStack gap="2" align="center">
{size === 'small' && <Icon source={icon} color={color} />}
{(size === 'medium' || size === 'large') && (
<Text variant="bodySm" as="p" fontWeight="bold">
{text}
</Text>
)}
</Stack>
</AlphaStack>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, {useContext} from 'react';

import {classNames} from '../../../../utilities/css';
import {capitalize} from '../../../../utilities/capitalize';
import {Stack} from '../../../Stack';
import {Text} from '../../../Text';
import {uploadArrow} from '../../images';
import {DropZoneContext} from '../../context';
import {useI18n} from '../../../../utilities/i18n';
import {createAllowMultipleKey} from '../../utils';
import {AlphaStack} from '../../../AlphaStack';

import styles from './FileUpload.scss';

Expand Down Expand Up @@ -55,18 +55,18 @@ export function FileUpload(props: FileUploadProps) {
switch (size) {
case 'large':
viewMarkup = (
<Stack vertical spacing="tight">
<AlphaStack align="center" gap="2">
{actionMarkup}
{actionHintMarkup}
</Stack>
</AlphaStack>
);
break;
case 'medium':
viewMarkup = (
<Stack vertical spacing="tight">
<AlphaStack align="center" gap="2">
{actionMarkup}
{actionHintMarkup}
</Stack>
</AlphaStack>
);
break;
case 'small':
Expand Down
15 changes: 0 additions & 15 deletions polaris-react/src/components/OptionList/OptionList.scss

This file was deleted.

Loading