diff --git a/.changeset/breezy-rivers-wink.md b/.changeset/breezy-rivers-wink.md
new file mode 100644
index 00000000000..8f4dccba2a4
--- /dev/null
+++ b/.changeset/breezy-rivers-wink.md
@@ -0,0 +1,5 @@
+---
+'@shopify/polaris': minor
+---
+
+Replaced usage of text components in component stories with `Text` component
diff --git a/polaris-react/src/components/AppProvider/AppProvider.stories.tsx b/polaris-react/src/components/AppProvider/AppProvider.stories.tsx
index 864690191b7..08c12f70a11 100644
--- a/polaris-react/src/components/AppProvider/AppProvider.stories.tsx
+++ b/polaris-react/src/components/AppProvider/AppProvider.stories.tsx
@@ -9,7 +9,7 @@ import {
Page,
ResourceList,
SettingToggle,
- TextStyle,
+ Text,
} from '@shopify/polaris';
export default {
@@ -63,7 +63,9 @@ export function Default() {
return (
- {name}
+
+ {name}
+
{location}
@@ -121,7 +123,9 @@ export function WithI18n() {
return (
- {name}
+
+ {name}
+
{location}
diff --git a/polaris-react/src/components/Combobox/Combobox.stories.tsx b/polaris-react/src/components/Combobox/Combobox.stories.tsx
index a984a4332ba..22d1e710871 100644
--- a/polaris-react/src/components/Combobox/Combobox.stories.tsx
+++ b/polaris-react/src/components/Combobox/Combobox.stories.tsx
@@ -8,7 +8,7 @@ import {
Stack,
Tag,
TextContainer,
- TextStyle,
+ Text,
} from '@shopify/polaris';
import {SearchMinor} from '@shopify/polaris-icons';
@@ -481,7 +481,9 @@ export function WithMultiSelectAndVerticalContent() {
return (
{start}
- {highlight}
+
+ {highlight}
+
{end}
);
diff --git a/polaris-react/src/components/DropZone/DropZone.stories.tsx b/polaris-react/src/components/DropZone/DropZone.stories.tsx
index 37426f79423..e4898b201ba 100644
--- a/polaris-react/src/components/DropZone/DropZone.stories.tsx
+++ b/polaris-react/src/components/DropZone/DropZone.stories.tsx
@@ -2,7 +2,7 @@ import React, {useCallback, useState} from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
Banner,
- Caption,
+ Text,
Card,
DropZone,
List,
@@ -44,7 +44,10 @@ export function Default() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -93,7 +96,10 @@ export function WithImageFileUpload() {
source={window.URL.createObjectURL(file)}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -151,7 +157,10 @@ export function WithSingleFileUpload() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
);
@@ -190,7 +199,10 @@ export function WithDropOnPage() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -245,7 +257,10 @@ export function AcceptsOnlySVGFiles() {
source={window.URL.createObjectURL(file)}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -309,7 +324,10 @@ export function Nested() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -378,7 +396,10 @@ export function WithCustomFileUploadText() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
@@ -424,7 +445,10 @@ export function WithCustomFileDialogTrigger() {
}
/>
- {file.name}
{file.size} bytes
+ {file.name}{' '}
+
+ {file.size} bytes
+
))}
diff --git a/polaris-react/src/components/Filters/Filters.stories.tsx b/polaris-react/src/components/Filters/Filters.stories.tsx
index 67a86e2e435..adf9766123d 100644
--- a/polaris-react/src/components/Filters/Filters.stories.tsx
+++ b/polaris-react/src/components/Filters/Filters.stories.tsx
@@ -10,7 +10,7 @@ import {
RangeSlider,
ResourceList,
TextField,
- TextStyle,
+ Text,
} from '@shopify/polaris';
export default {
@@ -187,9 +187,9 @@ export function WithAResourceList() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -498,9 +498,9 @@ export function WithChildrenContent() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -625,9 +625,9 @@ export function Disabled() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -771,9 +771,9 @@ export function SomeDisabled() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -899,9 +899,9 @@ export function WithoutClearButton() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -1092,9 +1092,9 @@ export function WithHelpText() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -1288,9 +1288,9 @@ export function WithQueryFieldHidden() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
@@ -1484,9 +1484,9 @@ export function WithQueryFieldDisabled() {
media={media}
accessibilityLabel={`View details for ${name}`}
>
-
- {name}
-
+
+ {name}
+
{location}
);
diff --git a/polaris-react/src/components/Frame/Frame.stories.tsx b/polaris-react/src/components/Frame/Frame.stories.tsx
index 40d5efe32d2..0e6d44d065e 100644
--- a/polaris-react/src/components/Frame/Frame.stories.tsx
+++ b/polaris-react/src/components/Frame/Frame.stories.tsx
@@ -19,7 +19,7 @@ import {
TextField,
Toast,
TopBar,
- VisuallyHidden,
+ Text,
} from '@shopify/polaris';
import {
ArrowLeftMinor,
@@ -218,7 +218,7 @@ export function InAnApplication() {
const loadingMarkup = isLoading ? : null;
const skipToContentTarget = (
-
+
Account details
-
+
);
const actualPageMarkup = (
@@ -557,7 +557,7 @@ export function WithAnOffset() {
const loadingMarkup = isLoading ? : null;
const skipToContentTarget = (
-
+
Account details
-
+
);
const actualPageMarkup = (
diff --git a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx
index 4708780d521..375aad5665b 100644
--- a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx
+++ b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx
@@ -9,7 +9,7 @@ import {
Link,
Select,
TextField,
- TextStyle,
+ Text,
useIndexResourceState,
} from '@shopify/polaris';
@@ -53,7 +53,9 @@ export function Default() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -120,7 +122,9 @@ export function Flush() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -188,7 +192,9 @@ export function SmallScreen() {
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -250,7 +256,9 @@ export function WithEmptyState() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -339,7 +347,9 @@ export function WithBulkActions() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -455,7 +465,9 @@ export function WithMultiplePromotedBulkActions() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -545,7 +557,9 @@ export function WithBulkActionsAndSelectionAcrossPages() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -615,7 +629,9 @@ export function WithLoadingState() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -731,7 +747,9 @@ export function WithFiltering() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -839,7 +857,9 @@ export function WithRowStatus() {
status={status}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -927,7 +947,9 @@ export function WithStickyLastColumn() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -1008,7 +1030,9 @@ export function WithRowNavigationLink() {
url={url}
onClick={() => console.log(`Clicked ${name}`)}
>
-
{name}
+
+ {name}
+
{location}
@@ -1081,7 +1105,9 @@ export function WithClickableButtonColumn() {
url={url}
onClick={() => console.log(`Clicked ${name}`)}
>
-
{name}
+
+ {name}
+
{location}
@@ -1141,7 +1167,9 @@ export function WithoutCheckboxes() {
({id, name, location, orders, amountSpent}, index) => (
- {name}
+
+ {name}
+
{location}
{orders}
@@ -1274,7 +1302,9 @@ export function WithAllOfItsElements() {
position={index}
>
- {name}
+
+ {name}
+
{location}
{orders}
@@ -1468,7 +1498,9 @@ export function WithSortableHeadings() {
position={index}
>
- {name}
+
+ {name}
+
{date}
{orders}
@@ -1619,7 +1651,9 @@ export function SmallScreenWithAllOfItsElements() {
>
- {name}
+
+ {name}
+
{location}
{orders}
diff --git a/polaris-react/src/components/Inline/Inline.stories.tsx b/polaris-react/src/components/Inline/Inline.stories.tsx
index fd56382c62e..da57cae59ac 100644
--- a/polaris-react/src/components/Inline/Inline.stories.tsx
+++ b/polaris-react/src/components/Inline/Inline.stories.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {Box, Badge, Heading, Icon, Inline, Thumbnail} from '@shopify/polaris';
+import {Box, Badge, Icon, Inline, Thumbnail} from '@shopify/polaris';
import {CapitalMajor, ImageMajor} from '@shopify/polaris-icons';
export default {
diff --git a/polaris-react/src/components/Layout/Layout.stories.tsx b/polaris-react/src/components/Layout/Layout.stories.tsx
index 932eb95b8bf..799d4bc5c92 100644
--- a/polaris-react/src/components/Layout/Layout.stories.tsx
+++ b/polaris-react/src/components/Layout/Layout.stories.tsx
@@ -4,13 +4,12 @@ import {
Banner,
Card,
FormLayout,
- Heading,
+ Text,
Layout,
Page,
ResourceList,
TextContainer,
TextField,
- TextStyle,
Thumbnail,
} from '@shopify/polaris';
@@ -63,7 +62,9 @@ export function TwoColumnsWithEqualWidth() {
- 455 units available
+
+ 455 units available
+
- {name}
+
+ {name}
+
SKU: {sku}
{quantity} available
@@ -121,7 +124,9 @@ export function TwoColumnsWithEqualWidth() {
- 301 units available
+
+ 301 units available
+
- {name}
+
+ {name}
+
SKU: {sku}
{quantity} available
@@ -188,7 +195,9 @@ export function ThreeColumnsWithEqualWidth() {
- 455 units available
+
+ 455 units available
+
- {name}
+
+ {name}
+
SKU: {sku}
{quantity} available
@@ -246,7 +257,9 @@ export function ThreeColumnsWithEqualWidth() {
- 301 units available
+
+ 301 units available
+
- {name}
+
+ {name}
+
SKU: {sku}
{quantity} available
@@ -304,7 +319,9 @@ export function ThreeColumnsWithEqualWidth() {
- 1931 units available
+
+ 1931 units available
+
- {name}
+
+ {name}
+
SKU: {sku}
{quantity} available
diff --git a/polaris-react/src/components/Navigation/Navigation.stories.tsx b/polaris-react/src/components/Navigation/Navigation.stories.tsx
index 9c7b0aaeedc..b464659139e 100644
--- a/polaris-react/src/components/Navigation/Navigation.stories.tsx
+++ b/polaris-react/src/components/Navigation/Navigation.stories.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {Frame, Navigation, VisuallyHidden} from '@shopify/polaris';
+import {Frame, Navigation, Text} from '@shopify/polaris';
import {
CirclePlusOutlineMinor,
CustomersMajor,
@@ -468,9 +468,9 @@ export function WithAriaLabelledby() {
return (
-
+
Hidden label
-
+
- {title}
+
+ {title}
+
{authorMarkup}
@@ -86,7 +82,9 @@ export function WithMedia() {
name={name}
>
- {name}
+
+ {name}
+
{location}
@@ -136,7 +134,9 @@ export function WithShortcutActions() {
name={name}
>
- {name}
+
+ {name}
+
{location}
@@ -182,7 +182,9 @@ export function WithVerticalAlignment() {
name={name}
>
- {name}
+
+ {name}
+
{location}
{lastOrder}
diff --git a/polaris-react/src/components/ResourceList/ResourceList.stories.tsx b/polaris-react/src/components/ResourceList/ResourceList.stories.tsx
index 0ceff5fc780..6b614ff7844 100644
--- a/polaris-react/src/components/ResourceList/ResourceList.stories.tsx
+++ b/polaris-react/src/components/ResourceList/ResourceList.stories.tsx
@@ -11,7 +11,7 @@ import {
ResourceItem,
ResourceList,
TextField,
- TextStyle,
+ Text,
} from '@shopify/polaris';
export default {
@@ -49,7 +49,9 @@ export function Default() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -155,7 +157,9 @@ export function WithSelectionAndNoBulkActions() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -234,7 +238,9 @@ export function WithBulkActions() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -314,7 +320,9 @@ export function WithLoadingState() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -353,7 +361,9 @@ export function WithTotalCount() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -420,7 +430,9 @@ export function WithSorting() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -472,7 +484,9 @@ export function WithAlternateTool() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -575,7 +589,9 @@ export function WithFiltering() {
return (
- {name}
+
+ {name}
+
{location}
@@ -686,7 +702,9 @@ export function WithACustomEmptySearchResultState() {
return (
- {name}
+
+ {name}
+
{location}
@@ -754,7 +772,9 @@ export function WithItemShortcutActions() {
shortcutActions={shortcutActions}
>
- {name}
+
+ {name}
+
{location}
@@ -809,7 +829,9 @@ export function WithPersistentItemShortcutActions() {
persistActions
>
- {name}
+
+ {name}
+
{location}
@@ -917,7 +939,9 @@ export function WithMultiselect() {
accessibilityLabel={`View details for ${name}`}
>
- {name}
+
+ {name}
+
{location}
@@ -1076,7 +1100,9 @@ export function WithAllOfItsElements() {
persistActions
>
- {name}
+
+ {name}
+
{location}
diff --git a/polaris-react/src/components/Select/Select.stories.tsx b/polaris-react/src/components/Select/Select.stories.tsx
index 69e58a80357..358cd6a6b62 100644
--- a/polaris-react/src/components/Select/Select.stories.tsx
+++ b/polaris-react/src/components/Select/Select.stories.tsx
@@ -9,7 +9,7 @@ import {
Select,
Stack,
TextField,
- TextStyle,
+ Text,
} from '@shopify/polaris';
import {CaretDownMinor, CaretUpMinor} from '@shopify/polaris-icons';
@@ -171,12 +171,12 @@ export function WithSeparateValidationError() {
return (
-
+
{`${weightError}${unitError} is required when weight based shipping rates are enabled. `}
Manage shipping
-
+
);
}
diff --git a/polaris-react/src/components/SettingToggle/SettingToggle.stories.tsx b/polaris-react/src/components/SettingToggle/SettingToggle.stories.tsx
index 52574ef4562..1694237e251 100644
--- a/polaris-react/src/components/SettingToggle/SettingToggle.stories.tsx
+++ b/polaris-react/src/components/SettingToggle/SettingToggle.stories.tsx
@@ -1,6 +1,6 @@
import React, {useCallback, useState} from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {SettingToggle, TextStyle} from '@shopify/polaris';
+import {SettingToggle, Text} from '@shopify/polaris';
export default {
component: SettingToggle,
@@ -22,7 +22,11 @@ export function Default() {
}}
enabled={active}
>
- This setting is {textStatus} .
+ This setting is{' '}
+
+ {textStatus}
+
+ .
);
}
diff --git a/polaris-react/src/components/Sheet/Sheet.stories.tsx b/polaris-react/src/components/Sheet/Sheet.stories.tsx
index 3b2559be066..7e621b434de 100644
--- a/polaris-react/src/components/Sheet/Sheet.stories.tsx
+++ b/polaris-react/src/components/Sheet/Sheet.stories.tsx
@@ -4,7 +4,7 @@ import {
Button,
Card,
ChoiceList,
- Heading,
+ Text,
List,
Page,
Scrollable,
@@ -13,8 +13,6 @@ import {
Listbox,
TextField,
TextContainer,
- TextStyle,
- Subheading,
Icon,
AutoSelection,
} from '@shopify/polaris';
@@ -119,7 +117,9 @@ export function Default() {
width: '100%',
}}
>
- Manage sales channels
+
+ Manage sales channels
+
-
- Action
-
+
+ Action
+
- Look up customer segmentation membership
-
+
+ Look up customer segmentation membership
+
+
Look up whether a customer is included in a segment.
-
+
-
+
Order
#1136
was paid
-
+
Paid
Fulfilled
@@ -56,7 +56,9 @@ export function VerticalCentering() {
export function FillAvailableSpaceProportionally() {
return (
- Order #1136
+
+ Order #1136
+
Paid
Fulfilled
@@ -66,7 +68,9 @@ export function FillAvailableSpaceProportionally() {
export function WhereItemsFillSpaceEvenly() {
return (
- Order #1136
+
+ Order #1136
+
Paid
Fulfilled
@@ -77,7 +81,9 @@ export function WhereASingleItemFillsTheRemainingSpace() {
return (
- Order #1136
+
+ Order #1136
+
Paid
diff --git a/polaris-react/src/components/TextContainer/TextContainer.stories.tsx b/polaris-react/src/components/TextContainer/TextContainer.stories.tsx
index 430f97a209c..5af854fb1f6 100644
--- a/polaris-react/src/components/TextContainer/TextContainer.stories.tsx
+++ b/polaris-react/src/components/TextContainer/TextContainer.stories.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {Heading, TextContainer} from '@shopify/polaris';
+import {Text, TextContainer} from '@shopify/polaris';
export default {
component: TextContainer,
@@ -9,7 +9,9 @@ export default {
export function Default() {
return (
- Install the Shopify POS App
+
+ Install the Shopify POS App
+
Shopify POS is the easiest way to sell your products in person.
Available for iPad, iPhone, and Android.
@@ -21,7 +23,9 @@ export function Default() {
export function Tight() {
return (
- Install the Shopify POS App
+
+ Install the Shopify POS App
+
Shopify POS is the easiest way to sell your products in person.
Available for iPad, iPhone, and Android.
diff --git a/polaris-react/src/components/Tooltip/Tooltip.stories.tsx b/polaris-react/src/components/Tooltip/Tooltip.stories.tsx
index 2c7ac612760..acbcdf7af71 100644
--- a/polaris-react/src/components/Tooltip/Tooltip.stories.tsx
+++ b/polaris-react/src/components/Tooltip/Tooltip.stories.tsx
@@ -1,12 +1,6 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {
- Button,
- ButtonGroup,
- TextField,
- TextStyle,
- Tooltip,
-} from '@shopify/polaris';
+import {Button, ButtonGroup, TextField, Text, Tooltip} from '@shopify/polaris';
export default {
component: Tooltip,
@@ -16,7 +10,9 @@ export function Default() {
return (
- Order #1001
+
+ Order #1001
+
);
diff --git a/polaris-react/src/components/TopBar/TopBar.stories.tsx b/polaris-react/src/components/TopBar/TopBar.stories.tsx
index a368809a111..9e6b897a11d 100644
--- a/polaris-react/src/components/TopBar/TopBar.stories.tsx
+++ b/polaris-react/src/components/TopBar/TopBar.stories.tsx
@@ -1,12 +1,6 @@
import React, {useCallback, useState} from 'react';
import type {ComponentMeta} from '@storybook/react';
-import {
- ActionList,
- Frame,
- Icon,
- TopBar,
- VisuallyHidden,
-} from '@shopify/polaris';
+import {ActionList, Frame, Icon, TopBar, Text} from '@shopify/polaris';
import {ArrowLeftMinor, QuestionMarkMajor} from '@shopify/polaris-icons';
export default {
@@ -89,7 +83,9 @@ export function Default() {
activatorContent={
- Secondary menu
+
+ Secondary menu
+
}
open={isSecondaryMenuOpen}