diff --git a/.changeset/cool-dolls-lie.md b/.changeset/cool-dolls-lie.md new file mode 100644 index 00000000000..58e4f9e15d7 --- /dev/null +++ b/.changeset/cool-dolls-lie.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': minor +--- + +Applied semantic type styles using the `Text` component diff --git a/.changeset/lazy-flies-relate.md b/.changeset/lazy-flies-relate.md new file mode 100644 index 00000000000..dfbc7504105 --- /dev/null +++ b/.changeset/lazy-flies-relate.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': minor +--- + +Added `base`,`inherit`, `disabled`, and `text-inverse` tone options for Text component diff --git a/.changeset/long-days-wonder.md b/.changeset/long-days-wonder.md new file mode 100644 index 00000000000..e4ae45d6121 --- /dev/null +++ b/.changeset/long-days-wonder.md @@ -0,0 +1,5 @@ +--- +'polaris.shopify.com': patch +--- + +Added page for `typography/property-disallow-list` Stylelint rule diff --git a/.changeset/nine-cameras-suffer.md b/.changeset/nine-cameras-suffer.md new file mode 100644 index 00000000000..29c7e7d6ab2 --- /dev/null +++ b/.changeset/nine-cameras-suffer.md @@ -0,0 +1,5 @@ +--- +'@shopify/stylelint-polaris': minor +--- + +Added warning for `font-size`, `line-height`, and `font-weight` properties. Use the `Text` component as a preferred option. diff --git a/.changeset/plenty-shoes-remain.md b/.changeset/plenty-shoes-remain.md new file mode 100644 index 00000000000..453259034be --- /dev/null +++ b/.changeset/plenty-shoes-remain.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': minor +--- + +Updated plain/monochrome Button text size to bodySm for micro diff --git a/polaris-react/postcss-mixins/text-style-input.css b/polaris-react/postcss-mixins/text-style-input.css index baf4dd31117..767fa7f1ca4 100644 --- a/polaris-react/postcss-mixins/text-style-input.css +++ b/polaris-react/postcss-mixins/text-style-input.css @@ -6,6 +6,7 @@ letter-spacing: initial; @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-350); + font-size: var(--p-font-size-325); + line-height: var(--p-font-line-height-500); } } diff --git a/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx b/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx index 49654bf3690..710fc297ca2 100644 --- a/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx +++ b/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx @@ -39,11 +39,11 @@ export function Default() { const details = connected ? 'Account connected' : 'No account connected'; const terms = connected ? null : ( -

+ By clicking Connect, you agree to accept Sample App’s{' '} terms and conditions. You’ll pay a commission rate of 15% on sales made through Sample App. -

+ ); return ( diff --git a/polaris-react/src/components/AccountConnection/AccountConnection.tsx b/polaris-react/src/components/AccountConnection/AccountConnection.tsx index da1b4c0f083..cd461602405 100644 --- a/polaris-react/src/components/AccountConnection/AccountConnection.tsx +++ b/polaris-react/src/components/AccountConnection/AccountConnection.tsx @@ -66,14 +66,16 @@ export function AccountConnection({ ); const detailsMarkup = details ? ( - + {details} ) : null; const termsOfServiceMarkup = termsOfService ? ( - {termsOfService} + + {termsOfService} + ) : null; diff --git a/polaris-react/src/components/ActionList/components/Item/Item.tsx b/polaris-react/src/components/ActionList/components/Item/Item.tsx index d3d3b4703d9..e72733b15b0 100644 --- a/polaris-react/src/components/ActionList/components/Item/Item.tsx +++ b/polaris-react/src/components/ActionList/components/Item/Item.tsx @@ -88,7 +88,13 @@ export function Item({ ) : ( - contentText + + {contentText} + ); const badgeMarkup = badge && ( @@ -103,7 +109,17 @@ export function Item({ ); - const textMarkup = {contentMarkup}; + const textMarkup = ( + + + {contentMarkup} + + + ); const contentElement = ( diff --git a/polaris-react/src/components/AppProvider/AppProvider.stories.tsx b/polaris-react/src/components/AppProvider/AppProvider.stories.tsx index a3b7226c32e..40ce18942b3 100644 --- a/polaris-react/src/components/AppProvider/AppProvider.stories.tsx +++ b/polaris-react/src/components/AppProvider/AppProvider.stories.tsx @@ -59,12 +59,12 @@ export function Default(_, context) { return ( -

- - {name} - -

-
{location}
+ + {name} + + + {location} +
); }} @@ -119,12 +119,12 @@ export function WithI18n() { return ( -

- - {name} - -

-
{location}
+ + {name} + + + {location} +
); }} @@ -156,7 +156,9 @@ export function WithLinkComponent(_, context) { title="Jar With Lock-Lid" primaryAction={{content: 'Save', disabled: true}} > -

Page content

+ + Page content + ); diff --git a/polaris-react/src/components/AppProvider/global.css b/polaris-react/src/components/AppProvider/global.css index 3afb9e3c7dd..63de16c5fe7 100644 --- a/polaris-react/src/components/AppProvider/global.css +++ b/polaris-react/src/components/AppProvider/global.css @@ -53,12 +53,17 @@ html, body { - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); + font-size: var(--p-font-size-400); + line-height: var(--p-font-line-height-600); font-weight: var(--p-font-weight-regular); font-feature-settings: 'calt' 0; letter-spacing: initial; color: var(--p-color-text); + + @media (--p-breakpoints-md-up) { + font-size: var(--p-font-size-325); + line-height: var(--p-font-line-height-500); + } } html, diff --git a/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.module.css b/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.module.css index 6d3c9b9527f..f1349e1787c 100644 --- a/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.module.css +++ b/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.module.css @@ -146,9 +146,4 @@ min-width: 0; max-width: 100%; flex: 1 1 auto; - - .ContentWrap { - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - @mixin text-breakword; - } } diff --git a/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.tsx b/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.tsx index 584beb2124f..d6fc84303b0 100644 --- a/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.tsx +++ b/polaris-react/src/components/Autocomplete/components/MappedAction/MappedAction.tsx @@ -37,8 +37,6 @@ export function MappedAction({ let prefixMarkup: React.ReactNode | null = null; - const contentOverflowStyle = wrapOverflow ? styles.ContentWrap : undefined; - if (prefix) { prefixMarkup =
{prefix}
; } else if (icon) { @@ -74,9 +72,11 @@ export function MappedAction({ const contentMarkup = (
-
{contentText}
+ + {contentText} + {helpText ? ( - + {helpText} ) : null} diff --git a/polaris-react/src/components/Banner/Banner.stories.tsx b/polaris-react/src/components/Banner/Banner.stories.tsx index ea3202e6ad3..1c9aebb9355 100644 --- a/polaris-react/src/components/Banner/Banner.stories.tsx +++ b/polaris-react/src/components/Banner/Banner.stories.tsx @@ -23,7 +23,9 @@ export default { export function Default() { return ( {}}> -

This order was archived on March 7, 2017 at 3:12pm EDT.

+ + This order was archived on March 7, 2017 at 3:12pm EDT. +
); } @@ -31,10 +33,10 @@ export function Default() { export function Dismissible() { return ( {}}> -

+ Use your finance report to get detailed information about your business.{' '} Let us know what you think -

+
); } @@ -48,10 +50,10 @@ export function WithFooterCallToAction() { secondaryAction={{content: 'Learn more', url: ''}} onDismiss={() => {}} > -

+ Add weights to show accurate rates at checkout and when buying shipping labels in Shopify. -

+ ); } @@ -65,7 +67,9 @@ export function Informational() { tone="info" onDismiss={() => {}} > -

Make sure you know how these changes affect your store.

+ + Make sure you know how these changes affect your store. + ); } @@ -105,11 +109,11 @@ export function Critical() { action={{content: 'Review risk analysis'}} tone="critical" > -

+ Before fulfilling this order or capturing payment, please{' '} review the Risk Analysis and determine if this order is fraudulent. -

+ ); } @@ -140,15 +144,15 @@ export function InAModal() { -

+ Connect your instagram account to your shop before proceeding. -

+
-

+ Use Instagram posts to share your products with millions of people. Let shoppers buy from your store without leaving Instagram. -

+
@@ -168,10 +172,10 @@ export function WithFocus() { tone="critical" ref={banner} > -

+ Before fulfilling this order or capturing payment, please review the fraud analysis and determine if this order is fraudulent -

+ ); } @@ -200,13 +204,15 @@ export function InALegacyCard() { {}}> -

+ Use your finance report to get detailed information about your business. Let us know what you think -

+
-

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. +
); @@ -224,7 +230,9 @@ export function WithEndJustifiedContent() { Logs -

This order was archived on March 7, 2017 at 3:12pm EDT.

+ + This order was archived on March 7, 2017 at 3:12pm EDT. + ); diff --git a/polaris-react/src/components/Banner/Banner.tsx b/polaris-react/src/components/Banner/Banner.tsx index cf41ebd4617..a46ab9e2b9c 100644 --- a/polaris-react/src/components/Banner/Banner.tsx +++ b/polaris-react/src/components/Banner/Banner.tsx @@ -164,21 +164,29 @@ export function BannerLayout({ ) : null, }; + const childrenMarkup = children ? ( + + {children} + + ) : null; + if (withinContentContainer) { return ( - {children} + {childrenMarkup} ); } if (isInlineIconBanner) { return ( - {children} + + {childrenMarkup} + ); } - return {children}; + return {childrenMarkup}; } export function DefaultBanner({ diff --git a/polaris-react/src/components/Bleed/Bleed.stories.tsx b/polaris-react/src/components/Bleed/Bleed.stories.tsx index 80889c08281..2611ee818cf 100644 --- a/polaris-react/src/components/Bleed/Bleed.stories.tsx +++ b/polaris-react/src/components/Bleed/Bleed.stories.tsx @@ -66,7 +66,9 @@ export function WithHorizontalDirection() { export function WithSpecificDirection() { return ( -

Block Start

+ + Block Start + -

Block End

+ + Block End + -

Inline Start

+ + Inline Start + -

Inline End

+ + Inline End + - {paginatedSelectAllAction.content} + + {paginatedSelectAllAction.content} + ) : null; const hasTextAndAction = paginatedSelectAllText && paginatedSelectAllAction; - const paginatedSelectAllMarkup = paginatedSelectAllActionMarkup ? ( -
- {paginatedSelectAllActionMarkup} -
- ) : null; - const ariaLive: AriaLive = hasTextAndAction ? 'polite' : undefined; const checkableButtonProps = { diff --git a/polaris-react/src/components/Button/Button.tsx b/polaris-react/src/components/Button/Button.tsx index 57dab4772e4..af3e2f52b20 100644 --- a/polaris-react/src/components/Button/Button.tsx +++ b/polaris-react/src/components/Button/Button.tsx @@ -176,10 +176,15 @@ export function Button({ textFontWeight = mdUp ? 'medium' : 'semibold'; } + let textVariant: TextProps['variant'] = 'bodySm'; + if (size === 'large' || (hasPlainText && size !== 'micro')) { + textVariant = 'bodyMd'; + } + const childMarkup = children ? ( -

Default

+ + Default +

-

With noWrap

+ + With noWrap +
-

Upload your store’s logo, change colors and fonts, and more.

+ + Upload your store’s logo, change colors and fonts, and more. + ); } @@ -30,7 +32,9 @@ export function WithSecondaryAction() { primaryAction={{content: 'Customize checkout'}} secondaryAction={{content: 'Learn more about customizing checkout'}} > -

Upload your store’s logo, change colors and fonts, and more.

+ + Upload your store’s logo, change colors and fonts, and more. + ); } @@ -43,7 +47,9 @@ export function Dismissable() { primaryAction={{content: 'Customize checkout'}} onDismiss={() => {}} > -

Upload your store’s logo, change colors and fonts, and more.

+ + Upload your store’s logo, change colors and fonts, and more. + ); } @@ -62,7 +68,9 @@ export function WithCustomTitle() { illustration="https://cdn.shopify.com/s/assets/admin/checkout/settings-customizecart-705f57c725ac05be5a34ec20c05b94298cb8afd10aac7bd9c7ad02030f48cfa0.svg" primaryAction={{content: 'Customize checkout'}} > -

Upload your store’s logo, change colors and fonts, and more.

+ + Upload your store’s logo, change colors and fonts, and more. + ); } @@ -82,7 +90,9 @@ export function WithIconableActions() { variant: 'secondary', }} > -

How do you like our app?

+ + How do you like our app? + ); } diff --git a/polaris-react/src/components/CalloutCard/CalloutCard.tsx b/polaris-react/src/components/CalloutCard/CalloutCard.tsx index c5d8dcf7926..ccac74b6f20 100644 --- a/polaris-react/src/components/CalloutCard/CalloutCard.tsx +++ b/polaris-react/src/components/CalloutCard/CalloutCard.tsx @@ -82,11 +82,13 @@ export function CalloutCard({
- + {title}
- {children} + + {children} +
{buttonMarkup}
diff --git a/polaris-react/src/components/Card/Card.stories.tsx b/polaris-react/src/components/Card/Card.stories.tsx index 3e9dfc8d72a..0afb1491a09 100644 --- a/polaris-react/src/components/Card/Card.stories.tsx +++ b/polaris-react/src/components/Card/Card.stories.tsx @@ -35,7 +35,9 @@ export function Default() { Online store dashboard -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. + ); @@ -48,7 +50,9 @@ export function WithResponsiveBorderRadius() { Online store dashboard -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. + ); @@ -61,7 +65,9 @@ export function WithResponsivePadding() { Online store dashboard -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. + ); @@ -74,7 +80,9 @@ export function WithSubdued() { Online store dashboard -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. + ); diff --git a/polaris-react/src/components/CheckableButton/CheckableButton.module.css b/polaris-react/src/components/CheckableButton/CheckableButton.module.css index 6b4260fadf1..05a51d40a66 100644 --- a/polaris-react/src/components/CheckableButton/CheckableButton.module.css +++ b/polaris-react/src/components/CheckableButton/CheckableButton.module.css @@ -1,9 +1,5 @@ .CheckableButton { color: var(--p-color-text); - font-size: var(--p-font-size-300); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-font-line-height-400); - letter-spacing: initial; display: flex; align-items: center; gap: calc(var(--p-space-300) + var(--p-space-025)); @@ -50,6 +46,8 @@ } .Label { + display: flex; + align-items: center; flex: 1; white-space: nowrap; overflow: hidden; @@ -58,6 +56,4 @@ /* padding to fix the bottom of letters being cutoff by overflow: hidden */ padding: var(--p-space-025) 0; - /* stylelint-disable-next-line polaris/typography/declaration-property-unit-disallowed-list -- custom label line height */ - line-height: 18px; } diff --git a/polaris-react/src/components/CheckableButton/CheckableButton.tsx b/polaris-react/src/components/CheckableButton/CheckableButton.tsx index c2080753af6..f2f46bb4fe0 100644 --- a/polaris-react/src/components/CheckableButton/CheckableButton.tsx +++ b/polaris-react/src/components/CheckableButton/CheckableButton.tsx @@ -1,8 +1,8 @@ import React, {useRef, useImperativeHandle, forwardRef} from 'react'; import type {CheckboxHandles} from '../../types'; -import {classNames} from '../../utilities/css'; import {Checkbox} from '../Checkbox'; +import {Text} from '../Text'; import styles from './CheckableButton.module.css'; @@ -38,10 +38,8 @@ export const CheckableButton = forwardRef(function CheckableButton( }; }); - const className = classNames(styles.CheckableButton); - return ( -
+
{label ? ( - {label} + + {label} + ) : null}
diff --git a/polaris-react/src/components/CheckableButton/tests/CheckableButton.test.tsx b/polaris-react/src/components/CheckableButton/tests/CheckableButton.test.tsx index b9b2f0bd393..9e25c41d765 100644 --- a/polaris-react/src/components/CheckableButton/tests/CheckableButton.test.tsx +++ b/polaris-react/src/components/CheckableButton/tests/CheckableButton.test.tsx @@ -32,10 +32,7 @@ describe('', () => { const element = mountWithApp( , ); - expect(element).toContainReactComponent('span', { - className: 'Label', - children: label, - }); + expect(element).toContainReactText(label); }); }); diff --git a/polaris-react/src/components/Choice/Choice.tsx b/polaris-react/src/components/Choice/Choice.tsx index 18dfab038d5..06be609782c 100644 --- a/polaris-react/src/components/Choice/Choice.tsx +++ b/polaris-react/src/components/Choice/Choice.tsx @@ -150,7 +150,9 @@ export function Choice({ > {children} - {label} + + {label} + ); diff --git a/polaris-react/src/components/ChoiceList/ChoiceList.tsx b/polaris-react/src/components/ChoiceList/ChoiceList.tsx index e0090c35c02..7b80777b952 100644 --- a/polaris-react/src/components/ChoiceList/ChoiceList.tsx +++ b/polaris-react/src/components/ChoiceList/ChoiceList.tsx @@ -7,6 +7,7 @@ import {InlineError, errorTextID} from '../InlineError'; import {BlockStack} from '../BlockStack'; import {Box} from '../Box'; import {Bleed} from '../Bleed'; +import {Text} from '../Text'; import styles from './ChoiceList.module.css'; @@ -71,12 +72,10 @@ export function ChoiceList({ const finalName = allowMultiple ? `${name}[]` : name; const titleMarkup = title ? ( - - {title} + + + {title} + ) : null; diff --git a/polaris-react/src/components/Collapsible/Collapsible.stories.tsx b/polaris-react/src/components/Collapsible/Collapsible.stories.tsx index 0473242b50a..d6785fe2cd6 100644 --- a/polaris-react/src/components/Collapsible/Collapsible.stories.tsx +++ b/polaris-react/src/components/Collapsible/Collapsible.stories.tsx @@ -7,6 +7,7 @@ import { Link, LegacyStack, TextContainer, + Text, } from '@shopify/polaris'; export default { @@ -39,11 +40,11 @@ export function Default() { expandOnPrint > -

+ Your mailing list lets you contact customers or visitors who have shown an interest in your store. Reach out to them with exclusive offers or updates about your products. -

+ Test link
diff --git a/polaris-react/src/components/Combobox/Combobox.stories.tsx b/polaris-react/src/components/Combobox/Combobox.stories.tsx index 4bbd0c0bb30..b885f50dab0 100644 --- a/polaris-react/src/components/Combobox/Combobox.stories.tsx +++ b/polaris-react/src/components/Combobox/Combobox.stories.tsx @@ -565,13 +565,13 @@ export function WithMultiSelectAndVerticalContent() { ); return ( -

+ {start} {highlight} {end} -

+ ); }, [value], diff --git a/polaris-react/src/components/DatePicker/DatePicker.module.css b/polaris-react/src/components/DatePicker/DatePicker.module.css index 5b83d3e5d75..4843591ad43 100644 --- a/polaris-react/src/components/DatePicker/DatePicker.module.css +++ b/polaris-react/src/components/DatePicker/DatePicker.module.css @@ -27,10 +27,6 @@ border-spacing: 0; } -.Month-current { - font-weight: var(--p-font-weight-bold); -} - .DayCell { width: calc(100% / 7); background: transparent; @@ -53,8 +49,6 @@ border: none; border-radius: var(--p-border-radius-200); outline: none; - font-size: var(--p-font-size-300); - text-align: center; color: var(--p-color-text); cursor: pointer; @@ -73,10 +67,6 @@ } } -.Day-today { - font-weight: var(--p-font-weight-bold); -} - .Day-inRange { background: var(--p-color-bg-surface-brand-selected); border-radius: 0; @@ -145,15 +135,6 @@ .Weekday { padding: var(--p-space-200); background: transparent; - font-size: var(--p-font-size-300); - font-weight: var(--p-font-weight-regular); - color: var(--p-color-text-secondary); - text-align: center; -} - -.Weekday-current { - font-weight: var(--p-font-weight-bold); - color: var(--p-color-text); } .Header { @@ -167,10 +148,6 @@ .Title { flex: 1 1 auto; padding-bottom: var(--p-space-100); - text-align: center; - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); - font-weight: var(--p-font-weight-medium); } .Day-firstInRange { diff --git a/polaris-react/src/components/DatePicker/components/Day/Day.tsx b/polaris-react/src/components/DatePicker/components/Day/Day.tsx index c4ea99f5398..baa9dd0f59e 100644 --- a/polaris-react/src/components/DatePicker/components/Day/Day.tsx +++ b/polaris-react/src/components/DatePicker/components/Day/Day.tsx @@ -1,5 +1,6 @@ import React, {useRef, useEffect, memo} from 'react'; +import {Text} from '../../../Text'; import {classNames} from '../../../../utilities/css'; import {isSameDay} from '../../../../utilities/dates'; import {useI18n} from '../../../../utilities/i18n'; @@ -78,7 +79,6 @@ export const Day = memo(function Day({ styles.Day, selected && styles['Day-selected'], disabled && styles['Day-disabled'], - today && styles['Day-today'], (inRange || inHoveringRange) && !disabled && styles['Day-inRange'], isLastSelectedDay && styles['Day-lastInRange'], isFirstSelectedDay && styles['Day-firstInRange'], @@ -117,7 +117,14 @@ export const Day = memo(function Day({ aria-disabled={disabled} aria-pressed={selected} > - {date} + + {date} + ); diff --git a/polaris-react/src/components/DatePicker/components/Month/Month.tsx b/polaris-react/src/components/DatePicker/components/Month/Month.tsx index 756f59ddcf7..3c5c31b77e7 100644 --- a/polaris-react/src/components/DatePicker/components/Month/Month.tsx +++ b/polaris-react/src/components/DatePicker/components/Month/Month.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useMemo} from 'react'; -import {classNames} from '../../../../utilities/css'; +import {Text} from '../../../Text'; import { isDateBefore, isDateAfter, @@ -57,10 +57,6 @@ export function Month({ const isInHoveringRange = allowRange ? hoveringDateIsInRange : () => false; const now = new Date(); const current = now.getMonth() === month && now.getFullYear() === year; - const className = classNames( - styles.Title, - current && styles['Month-current'], - ); const weeks = useMemo( () => getWeeksForMonth(month, year, weekStartsOn), [month, weekStartsOn, year], @@ -162,9 +158,16 @@ export function Month({ return (
- {weekdays} diff --git a/polaris-react/src/components/DatePicker/components/Weekday/Weekday.tsx b/polaris-react/src/components/DatePicker/components/Weekday/Weekday.tsx index 67e31e2bfeb..0d8d4df847e 100644 --- a/polaris-react/src/components/DatePicker/components/Weekday/Weekday.tsx +++ b/polaris-react/src/components/DatePicker/components/Weekday/Weekday.tsx @@ -1,6 +1,6 @@ import React, {memo} from 'react'; -import {classNames} from '../../../../utilities/css'; +import {Text} from '../../../Text'; import styles from '../../DatePicker.module.css'; export interface WeekdayProps { @@ -14,14 +14,17 @@ export const Weekday = memo(function Weekday({ title, current, }: WeekdayProps) { - const className = classNames( - styles.Weekday, - current && styles['Weekday-current'], - ); - return ( - ); }); diff --git a/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.module.css b/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.module.css index c70fa72c596..43bc74e4ebd 100755 --- a/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.module.css +++ b/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.module.css @@ -1,5 +1,5 @@ .FileUpload { - padding: var(--p-space-400); + padding: var(--p-space-300); text-align: center; display: flex; align-items: center; @@ -19,37 +19,6 @@ vertical-align: bottom; } -.Action { - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - @mixin focus-ring base, 0, base; - display: inline-flex; - flex: 0 0 auto; - border: none; - margin: 0; - text-decoration: none; - font-size: var(--p-font-size-300); - font-weight: var(--p-font-weight-semibold); - line-height: 1; - cursor: pointer; - text-align: center; - appearance: none; - color: var(--p-color-text); - background-color: var(--p-color-input-bg-surface); - padding: var(--p-space-150) var(--p-space-300); - box-shadow: var(--p-shadow-button); - border-radius: var(--p-border-radius-200); - - &.disabled { - color: var(--p-color-text-disabled); - background-color: var(--p-color-bg-fill-disabled); - - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - @mixin base-button-disabled; - cursor: not-allowed; - box-shadow: none; - } -} - .ActionTitle { color: var(--p-color-text-emphasis); text-decoration: none; diff --git a/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.tsx b/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.tsx index fdc4b76feaa..36e30777cf3 100755 --- a/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.tsx +++ b/polaris-react/src/components/DropZone/components/FileUpload/FileUpload.tsx @@ -4,6 +4,7 @@ import {UploadIcon} from '@shopify/polaris-icons'; import {Icon} from '../../../Icon'; import {classNames} from '../../../../utilities/css'; import {capitalize} from '../../../../utilities/capitalize'; +import {Button} from '../../../Button'; import {Text} from '../../../Text'; import {DropZoneContext} from '../../context'; import {useI18n} from '../../../../utilities/i18n'; @@ -32,12 +33,7 @@ export function FileUpload(props: FileUploadProps) { actionHint, } = props; - const actionClassNames = classNames( - styles.Action, - disabled && styles.disabled, - ); - - const actionMarkup =
{actionTitle}
; + const actionMarkup = ; const fileUploadClassName = classNames( styles.FileUpload, @@ -55,13 +51,6 @@ export function FileUpload(props: FileUploadProps) { let viewMarkup; switch (size) { case 'large': - viewMarkup = ( - - {actionMarkup} - {actionHintMarkup} - - ); - break; case 'medium': viewMarkup = ( diff --git a/polaris-react/src/components/DropZone/components/FileUpload/tests/FileUpload.test.tsx b/polaris-react/src/components/DropZone/components/FileUpload/tests/FileUpload.test.tsx index ccd9e9414b0..1e74ca6a1eb 100755 --- a/polaris-react/src/components/DropZone/components/FileUpload/tests/FileUpload.test.tsx +++ b/polaris-react/src/components/DropZone/components/FileUpload/tests/FileUpload.test.tsx @@ -2,7 +2,6 @@ import React from 'react'; import {mountWithApp} from 'tests/utilities'; import {UploadIcon} from '@shopify/polaris-icons'; -import {Text} from '../../../../Text'; import {DropZoneContext} from '../../../context'; import {FileUpload} from '../FileUpload'; import {Icon} from '../../../../Icon'; @@ -50,12 +49,7 @@ describe('', () => { expect(fileUpload).not.toContainReactComponent(Icon, { source: UploadIcon, }); - - expect(fileUpload).not.toContainReactComponent(Text); - - expect(fileUpload).toContainReactComponent('div', { - className: 'Action', - }); + expect(fileUpload).toContainReactText('Add file'); }); }); @@ -64,16 +58,12 @@ describe('', () => { - + , ); expect(fileUpload).not.toContainReactComponent(Icon, {source: UploadIcon}); - expect(fileUpload).not.toContainReactComponent(Text); - - expect(fileUpload).toContainReactComponent('div', { - className: 'Action', - }); + expect(fileUpload).toContainReactText('Add file'); }); it('renders small view', () => { @@ -81,7 +71,7 @@ describe('', () => { - + , ); @@ -111,7 +101,7 @@ describe('', () => { , ); - expect(fileUpload).toContainReactComponent(Text); + expect(fileUpload).toContainReactComponent('p'); expect(fileUpload).toContainReactText('Hint'); }); @@ -131,9 +121,7 @@ describe('', () => { , ); - expect(fileUpload).toContainReactComponent('div', { - children: expectedActionText, - }); + expect(fileUpload.find('span')).toContainReactText(expectedActionText); }, ); }); diff --git a/polaris-react/src/components/EmptyState/EmptyState.stories.tsx b/polaris-react/src/components/EmptyState/EmptyState.stories.tsx index 170c8d730d8..d31879b9981 100644 --- a/polaris-react/src/components/EmptyState/EmptyState.stories.tsx +++ b/polaris-react/src/components/EmptyState/EmptyState.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type {ComponentMeta} from '@storybook/react'; -import {LegacyCard, EmptyState, Link} from '@shopify/polaris'; +import {LegacyCard, EmptyState, Link, Text} from '@shopify/polaris'; export default { component: EmptyState, @@ -18,7 +18,9 @@ export function Default() { }} image="https://cdn.shopify.com/s/files/1/0262/4071/2726/files/emptystate-files.png" > -

Track and receive your incoming inventory from suppliers.

+ + Track and receive your incoming inventory from suppliers. + ); @@ -35,18 +37,20 @@ export function WithSubduedFooterContext() { url: 'https://help.shopify.com', }} footerContent={ -

+ If you don’t want to add a transfer, you can import your inventory from{' '} settings . -

+ } image="https://cdn.shopify.com/s/files/1/0262/4071/2726/files/emptystate-files.png" > -

Track and receive your incoming inventory from suppliers.

+ + Track and receive your incoming inventory from suppliers. + ); @@ -61,11 +65,11 @@ export function WithFullWidthLayout() { image="https://cdn.shopify.com/s/files/1/0262/4071/2726/files/emptystate-files.png" fullWidth > -

+ You can use the Files section to upload images, videos, and other documents. This example shows the content with a centered layout and full width. -

+ ); @@ -82,7 +86,9 @@ export function WithoutContentContainer() { }} image="https://cdn.shopify.com/s/files/1/0262/4071/2726/files/emptystate-files.png" > -

Track and receive your incoming inventory from suppliers.

+ + Track and receive your incoming inventory from suppliers. + ); } diff --git a/polaris-react/src/components/Filters/Filters.module.css b/polaris-react/src/components/Filters/Filters.module.css index 385e898798b..5b149b96482 100644 --- a/polaris-react/src/components/Filters/Filters.module.css +++ b/polaris-react/src/components/Filters/Filters.module.css @@ -73,7 +73,6 @@ padding: 0 var(--p-space-200) 0 var(--p-space-300); height: 28px; cursor: pointer; - color: var(--p-color-text); display: flex; align-items: center; justify-content: center; @@ -86,8 +85,6 @@ } @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-300); - line-height: var(--p-font-line-height-400); height: 24px; /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ padding: 0 0.375rem 0 var(--p-space-200); @@ -217,22 +214,12 @@ .ClearAll { margin-left: var(--p-space-200); - - span { - font-size: var(--p-font-size-300); - font-weight: var(--p-font-weight-medium); - } } @media (--p-breakpoints-md-down) { .ClearAll { margin-left: 0; padding-right: var(--p-space-400); - - span { - font-size: var(--p-font-size-350); - font-weight: var(--p-font-weight-medium); - } } .MultiplePinnedFilterClearAll { diff --git a/polaris-react/src/components/Filters/components/FilterPill/FilterPill.tsx b/polaris-react/src/components/Filters/components/FilterPill/FilterPill.tsx index 9ed58773003..a32ec3a482a 100644 --- a/polaris-react/src/components/Filters/components/FilterPill/FilterPill.tsx +++ b/polaris-react/src/components/Filters/components/FilterPill/FilterPill.tsx @@ -10,7 +10,6 @@ import {Icon} from '../../../Icon'; import {Text} from '../../../Text'; import {InlineStack} from '../../../InlineStack'; import {UnstyledButton} from '../../../UnstyledButton'; -import {useBreakpoints} from '../../../../utilities/breakpoints'; import {classNames} from '../../../../utilities/css'; import type {FilterInterface} from '../../../../types'; @@ -46,7 +45,6 @@ export function FilterPill({ onClick, }: FilterPillProps) { const i18n = useI18n(); - const {mdDown} = useBreakpoints(); const elementRef = useRef(null); const { @@ -113,11 +111,9 @@ export function FilterPill({ styles.ToggleButton, ); - const labelVariant = mdDown ? 'bodyLg' : 'bodySm'; - const wrappedLabel = (
- + {label}
diff --git a/polaris-react/src/components/Filters/components/FilterPill/tests/FilterPill.test.tsx b/polaris-react/src/components/Filters/components/FilterPill/tests/FilterPill.test.tsx index 2af2772779d..e5884a15251 100644 --- a/polaris-react/src/components/Filters/components/FilterPill/tests/FilterPill.test.tsx +++ b/polaris-react/src/components/Filters/components/FilterPill/tests/FilterPill.test.tsx @@ -5,7 +5,6 @@ import {ChevronDownIcon} from '@shopify/polaris-icons'; import {FilterPill} from '../FilterPill'; import type {FilterPillProps} from '../FilterPill'; import {Popover} from '../../../../Popover'; -import {Text} from '../../../../Text'; import {Icon} from '../../../../Icon'; import {Button} from '../../../../Button'; import {UnstyledButton} from '../../../../UnstyledButton'; @@ -48,23 +47,6 @@ describe('', () => { expect(wrapper).toContainReactText(defaultProps.label); }); - it('renders with bodyLg variant when on a small screen', () => { - mockUseBreakpoints(true); - const wrapper = mountWithApp(, {}); - expect(wrapper).toContainReactComponent(Text, { - variant: 'bodyLg', - children: defaultProps.label, - }); - }); - - it('renders with bodySm variant when on a larger screen', () => { - const wrapper = mountWithApp(); - expect(wrapper).toContainReactComponent(Text, { - variant: 'bodySm', - children: defaultProps.label, - }); - }); - it('will return null if disabled', () => { const wrapper = mountWithApp(); expect(wrapper!.domNode).toBeNull(); diff --git a/polaris-react/src/components/Filters/components/FiltersBar/FiltersBar.tsx b/polaris-react/src/components/Filters/components/FiltersBar/FiltersBar.tsx index 0ce83954564..bd3c1a8f048 100644 --- a/polaris-react/src/components/Filters/components/FiltersBar/FiltersBar.tsx +++ b/polaris-react/src/components/Filters/components/FiltersBar/FiltersBar.tsx @@ -10,7 +10,6 @@ import {ActionList} from '../../../ActionList'; import {Text} from '../../../Text'; import {UnstyledButton} from '../../../UnstyledButton'; import {classNames} from '../../../../utilities/css'; -import {useBreakpoints} from '../../../../utilities/breakpoints'; import type { ActionListItemDescriptor, AppliedFilterInterface, @@ -62,7 +61,6 @@ export function FiltersBar({ children, }: PropsWithChildren) { const i18n = useI18n(); - const {mdDown} = useBreakpoints(); const [popoverActive, setPopoverActive] = useState(false); const hasMounted = useRef(false); useEffect(() => { @@ -162,8 +160,6 @@ export function FiltersBar({ const hasOneOrMorePinnedFilters = pinnedFilters.length >= 1; - const labelVariant = mdDown ? 'bodyMd' : 'bodySm'; - const addFilterActivator = (
- + {i18n.translate('Polaris.Filters.addFilter')}{' '} @@ -258,7 +254,6 @@ export function FiltersBar({
); diff --git a/polaris-react/src/components/Frame/components/Toast/Toast.module.css b/polaris-react/src/components/Frame/components/Toast/Toast.module.css index 7eb0c518b78..ac83e7522be 100644 --- a/polaris-react/src/components/Frame/components/Toast/Toast.module.css +++ b/polaris-react/src/components/Frame/components/Toast/Toast.module.css @@ -76,8 +76,6 @@ .WithActionOnComponent { border: none; cursor: pointer; - line-height: var(--p-font-line-height-500); - font-size: var(--p-font-size-325); padding-right: var(--p-space-500); } diff --git a/polaris-react/src/components/Frame/components/Toast/Toast.tsx b/polaris-react/src/components/Frame/components/Toast/Toast.tsx index 063c6ea0010..ad09eba37be 100644 --- a/polaris-react/src/components/Frame/components/Toast/Toast.tsx +++ b/polaris-react/src/components/Frame/components/Toast/Toast.tsx @@ -131,6 +131,7 @@ export function Toast({ @@ -148,6 +149,7 @@ export function Toast({ diff --git a/polaris-react/src/components/Frame/tests/Frame.test.tsx b/polaris-react/src/components/Frame/tests/Frame.test.tsx index f417676188b..d1eeb829523 100644 --- a/polaris-react/src/components/Frame/tests/Frame.test.tsx +++ b/polaris-react/src/components/Frame/tests/Frame.test.tsx @@ -58,14 +58,14 @@ describe('', () => { it('renders a skip to content link with the proper text', () => { const skipToContentLinkText = mountWithApp(); - expect(skipToContentLinkText).toContainReactComponent('a', { - children: 'Skip to content', - }); + expect(skipToContentLinkText.find('a')).toContainReactText( + 'Skip to content', + ); }); it('targets the main container element by default', () => { const frame = mountWithApp(); - const skipLink = frame.find('a', {children: 'Skip to content'}); + const skipLink = frame.find('a'); expect(skipLink!.domNode!.getAttribute('href')).toBe( `#${frame!.find('main')!.domNode!.id}`, diff --git a/polaris-react/src/components/Grid/Grid.stories.tsx b/polaris-react/src/components/Grid/Grid.stories.tsx index de636985cbf..935ecb6bbf2 100644 --- a/polaris-react/src/components/Grid/Grid.stories.tsx +++ b/polaris-react/src/components/Grid/Grid.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type {ComponentMeta} from '@storybook/react'; -import {LegacyCard, Grid, Page} from '@shopify/polaris'; +import {LegacyCard, Grid, Page, Text} from '@shopify/polaris'; export default { component: Grid, @@ -12,12 +12,16 @@ export function TwoColumn() { -

View a summary of your online store’s sales.

+ + View a summary of your online store’s sales. +
-

View a summary of your online store’s orders.

+ + View a summary of your online store’s orders. +
@@ -31,12 +35,16 @@ export function TwoThirdsAndOneThirdColumn() { -

View a summary of your online store’s sales.

+ + View a summary of your online store’s sales. +
-

View a summary of your online store’s orders.

+ + View a summary of your online store’s orders. +
@@ -50,17 +58,23 @@ export function ThreeOneThirdColumn() { -

View a summary of your online store’s sales.

+ + View a summary of your online store’s sales. +
-

View a summary of your online store’s orders.

+ + View a summary of your online store’s orders. +
-

View a summary of your online store’s orders.

+ + View a summary of your online store’s orders. +
diff --git a/polaris-react/src/components/IndexFilters/IndexFilters.stories.tsx b/polaris-react/src/components/IndexFilters/IndexFilters.stories.tsx index 84d685a9f8f..bcd43e1f216 100644 --- a/polaris-react/src/components/IndexFilters/IndexFilters.stories.tsx +++ b/polaris-react/src/components/IndexFilters/IndexFilters.stories.tsx @@ -72,9 +72,21 @@ function Table() { {name}
- {location} - {orders} - {amountSpent} + + + {location} + + + + + {orders} + + + + + {amountSpent} + + ), ); @@ -2261,15 +2273,31 @@ export function WithNoFilters() { {order}
- {date} - {customer} + + + {date} + + + + + {customer} + + {total} - {paymentStatus} - {fulfillmentStatus} + + + {paymentStatus} + + + + + {fulfillmentStatus} + + ), ); @@ -2419,15 +2447,31 @@ export function WithOnlySearchAndSort() { {order} - {date} - {customer} + + + {date} + + + + + {customer} + + {total} - {paymentStatus} - {fulfillmentStatus} + + + {paymentStatus} + + + + + {fulfillmentStatus} + + ), ); diff --git a/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.module.css b/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.module.css index 0b61fddd520..4177f25645e 100644 --- a/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.module.css +++ b/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.module.css @@ -4,10 +4,10 @@ border-radius: var(--p-border-radius-200); padding: var(--p-space-100) var(--p-space-300) var(--p-space-100) var(--p-space-200); - font-size: var(--p-font-size-350); - display: flex; + display: grid; align-items: center; - justify-content: flex-start; + grid-template-columns: auto 1fr; + gap: var(--p-space-050); cursor: pointer; width: 100%; border: none; @@ -33,12 +33,3 @@ color: var(--p-color-text); background: var(--p-color-bg-fill-transparent-active); } - -.Label { - flex: 1; - color: var(--p-color-text); - margin-left: var(--p-space-050); - font-size: var(--p-font-size-300); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-font-line-height-400); -} diff --git a/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.tsx b/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.tsx index 4edeab8cf66..258f3fd1be6 100644 --- a/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.tsx +++ b/polaris-react/src/components/IndexFilters/components/SortButton/components/DirectionButton/DirectionButton.tsx @@ -5,6 +5,7 @@ import {ArrowDownIcon, ArrowUpIcon} from '@shopify/polaris-icons'; import {classNames} from '../../../../../../utilities/css'; import {UnstyledButton} from '../../../../../UnstyledButton'; import {Icon} from '../../../../../Icon'; +import {Text} from '../../../../../Text'; import styles from './DirectionButton.module.css'; @@ -38,7 +39,9 @@ export function DirectionButton({ source={direction === 'asc' ? ArrowUpIcon : ArrowDownIcon} tone="base" /> - {children} + + {children} + ); } diff --git a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx index bd657d0e859..27143feb8e5 100644 --- a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx +++ b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx @@ -100,18 +100,22 @@ export function Default() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -209,18 +213,22 @@ export function Condensed() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -319,18 +327,22 @@ export function Flush() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -434,7 +446,11 @@ export function SmallScreen() { {name} -

{location}

+ + + {location} + + {orders} @@ -542,7 +558,11 @@ export function SmallScreenLoading() { {name} -

{location}

+ + + {location} + + {orders} @@ -631,18 +651,22 @@ export function WithDisabledRows() { disabled={disabled} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -726,18 +750,22 @@ export function WithSubduedRows() { tone={index === 1 || index === 2 ? 'subdued' : undefined} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -803,18 +831,22 @@ export function WithEmptyState() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -937,18 +969,22 @@ export function WithBulkActions() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1049,18 +1085,22 @@ export function WithSelectionAndNoBulkActions() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1229,18 +1269,22 @@ export function WithMultiplePromotedBulkActions() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1389,18 +1433,22 @@ export function WithBulkActionsAndSelectionAcrossPages() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1502,18 +1550,22 @@ export function WithLoadingState() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1660,18 +1712,22 @@ export function WithFiltering() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1884,21 +1940,25 @@ export function WithRowStatus() { tone={status as IndexTableRowProps['tone']} > - + {name} {status} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -1917,21 +1977,25 @@ export function WithRowStatus() { rowType={index > 0 ? 'child' : 'subheader'} > - + {name} {status} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2069,18 +2133,22 @@ export function WithStickyLastColumn() { tone={status as IndexTableRowProps['tone']} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2191,19 +2259,23 @@ export function WithRowNavigationLink() { url={url} onClick={() => console.log(`Clicked ${name}`)} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2307,19 +2379,23 @@ export function WithClickableButtonColumn() { url={url} onClick={() => console.log(`Clicked ${name}`)} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2410,18 +2486,22 @@ export function WithoutCheckboxes() { ({id, name, location, orders, amountSpent}, index) => ( - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2519,18 +2599,22 @@ export function WithTonesWithoutCheckboxes() { tone={status as IndexTableRowProps['tone']} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2697,18 +2781,22 @@ export function WithAllOfItsElements() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -2936,22 +3024,26 @@ export function WithSortableHeadings() { position={index} > - + {name} {date} - + {orders} - + {amountSpent} - {location} + + + {location} + + {fulfillmentStatus} {paymentStatus} {notes} @@ -3123,22 +3215,26 @@ export function WithSortableCustomHeadings() { position={index} > - + {name} {date} - + {orders} - + {amountSpent} - {location} + + + {location} + + {fulfillmentStatus} {paymentStatus} {notes} @@ -3315,24 +3411,28 @@ export function WithHeadingWithPaddingBlockEnd() { position={index} > - + {name} {date} - + {orders} - + {amountSpent} - {location} + + + {location} + + {fulfillmentStatus} {paymentStatus} {notes} @@ -3448,18 +3548,22 @@ export function WithCustomTooltips() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -3566,18 +3670,22 @@ export function WithHeadingTooltips() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -3720,18 +3828,22 @@ export function WithZebraStriping() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -3748,18 +3860,22 @@ export function WithZebraStriping() { rowType={index > 0 ? 'child' : 'subheader'} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -3860,18 +3976,22 @@ export function WithZebraStripingCondensed() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -3950,18 +4070,22 @@ export function WithZebraStripingAndRowStatus() { tone={status as IndexTableRowProps['tone']} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4092,18 +4216,22 @@ export function WithZebraStripingAndStickyLastColumn() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4178,18 +4306,22 @@ export function WithZebraStripingAndWithoutCheckboxes() { ({id, name, location, orders, amountSpent}, index) => ( - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4360,7 +4492,11 @@ export function SmallScreenWithAllOfItsElements() { {name} -

{location}

+ + + {location} + + {orders} @@ -4643,14 +4779,18 @@ export function WithSubHeaders() { {name}
- {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4709,18 +4849,22 @@ export function WithPagination() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4809,18 +4953,22 @@ export function WithStickyScrollBar() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -4967,18 +5115,22 @@ export function WithPaginationAndBulkActions() { position={index} > - + {name} - {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -5206,14 +5358,18 @@ export function WithSubHeadersNonSelectable() { {name}
- {location} - + + {location} + + + + {orders} - + {amountSpent} @@ -5405,7 +5561,7 @@ export function WithNestedRows() { - + {quantity} @@ -5654,27 +5810,27 @@ export function WithNestedRowsStickyLastColumn() { - + {quantity} - + {vendor} - + {channel} - + {paymentStatus} - + {fulfillmentStatus} @@ -5868,7 +6024,7 @@ export function WithNestedRowsNonSelectable() { - + {quantity} @@ -6075,7 +6231,7 @@ export function WithNestedRowsWithThumbnails() { - + {quantity} @@ -6282,7 +6438,7 @@ export function WithNestedRowsWithThumbnailsNonSelectable() { - + {quantity} @@ -6491,7 +6647,7 @@ export function WithNestedRowsWithThumbnailsOneCellSelectable() { - + {quantity} @@ -6698,7 +6854,7 @@ export function WithNestedRowsWithThumbnailsOneCellNonSelectable() { - + {quantity} @@ -7053,7 +7209,7 @@ export function WithUnmountingTable() { {date} {customer} - + {total} diff --git a/polaris-react/src/components/IndexTable/IndexTable.tsx b/polaris-react/src/components/IndexTable/IndexTable.tsx index 11a32803337..0010a282b60 100644 --- a/polaris-react/src/components/IndexTable/IndexTable.tsx +++ b/polaris-react/src/components/IndexTable/IndexTable.tsx @@ -883,23 +883,28 @@ function IndexTableBase({ preferredPosition: 'above' as TooltipOverlayProps['preferredPosition'], }; + const headingTitle = ( + + {heading.title} + + ); + if (heading.new) { headingContent = ( - {heading.title} + {headingTitle} {i18n.translate('Polaris.IndexTable.onboardingBadgeText')} ); - } else if (heading.hidden) { - headingContent = ( - - {heading.title} - - ); } else { - headingContent = heading.title; + headingContent = headingTitle; } const style = { diff --git a/polaris-react/src/components/InlineError/InlineError.tsx b/polaris-react/src/components/InlineError/InlineError.tsx index 16e34ab88f1..8df22e24ce4 100644 --- a/polaris-react/src/components/InlineError/InlineError.tsx +++ b/polaris-react/src/components/InlineError/InlineError.tsx @@ -2,6 +2,7 @@ import React from 'react'; import {AlertCircleIcon} from '@shopify/polaris-icons'; import {Icon} from '../Icon'; +import {Text} from '../Text'; import type {Error} from '../../types'; import styles from './InlineError.module.css'; @@ -23,7 +24,9 @@ export function InlineError({message, fieldID}: InlineErrorProps) {
- {message} + + {message} + ); } diff --git a/polaris-react/src/components/Label/Label.tsx b/polaris-react/src/components/Label/Label.tsx index db2d0f93713..dcee1a1aa32 100644 --- a/polaris-react/src/components/Label/Label.tsx +++ b/polaris-react/src/components/Label/Label.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import {Text} from '../Text'; import {classNames} from '../../utilities/css'; import styles from './Label.module.css'; @@ -32,7 +33,9 @@ export function Label({children, id, hidden, requiredIndicator}: LabelProps) { requiredIndicator && styles.RequiredIndicator, )} > - {children} + + {children} + ); diff --git a/polaris-react/src/components/Labelled/Labelled.tsx b/polaris-react/src/components/Labelled/Labelled.tsx index ee87845505f..9c31ea4ea37 100644 --- a/polaris-react/src/components/Labelled/Labelled.tsx +++ b/polaris-react/src/components/Labelled/Labelled.tsx @@ -66,7 +66,7 @@ export function Labelled({ id={helpTextID(id)} aria-disabled={disabled} > - + {helpText} diff --git a/polaris-react/src/components/Layout/Layout.stories.tsx b/polaris-react/src/components/Layout/Layout.stories.tsx index 208cdb57af6..e064c3d1051 100644 --- a/polaris-react/src/components/Layout/Layout.stories.tsx +++ b/polaris-react/src/components/Layout/Layout.stories.tsx @@ -66,7 +66,9 @@ export function OneColumn() { -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. +
@@ -80,17 +82,19 @@ export function TwoColumnsWithPrimaryAndSecondaryWidths() { -

+ Use to follow a normal section with a secondary section to create a 2/3 + 1/3 layout on detail pages (such as individual product or order pages). Can also be used on any page that needs to structure a lot of content. This layout stacks the columns on small screens. -

+
-

Add tags to your order.

+ + Add tags to your order. +
@@ -462,7 +466,9 @@ export function AnnotatedWithBannerAtTheTop() { {}}> -

This order was archived on March 7, 2017 at 3:12pm EDT.

+ + This order was archived on March 7, 2017 at 3:12pm EDT. +
-

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. + ); } @@ -34,10 +36,10 @@ export function Default() { export function WithHeaderActions() { return ( -

+ Add variants if this product comes in multiple versions, like different sizes or colors. -

+
); } @@ -84,11 +86,11 @@ export function WithCustomFooterActions() { -

+ Two-step authentication adds an extra layer of security when logging in to your account. A special code will be required each time you log in, ensuring only you can access your account. -

+ @@ -124,14 +126,16 @@ export function WithMultipleSections() { return ( -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. +
-

+ View a summary of your online store’s performance, including sales, visitors, top products, and referrals. -

+
); @@ -141,14 +145,16 @@ export function WithMultipleTitledSections() { return ( -

View a summary of your online store’s performance.

+ + View a summary of your online store’s performance. +
-

+ View a summary of your online store’s performance, including sales, visitors, top products, and referrals. -

+
); @@ -158,13 +164,17 @@ export function WithSectionsAndActions() { return ( -

John Smith

+ + John Smith +
-

john.smith@example.com

+ + john.smith@example.com +
); @@ -174,7 +184,9 @@ export function WithSubsection() { return ( -

John Smith

+ + John Smith +
@@ -205,13 +217,17 @@ export function WithDestructiveAction() { return ( -

John Smith

+ + John Smith +
-

john.smith@example.com

+ + john.smith@example.com +
); @@ -458,7 +474,9 @@ export function All() { Section 1 content Section 2 content
-

Custom footer in a p

+ + Custom footer in a p +
diff --git a/polaris-react/src/components/LegacyTabs/LegacyTabs.module.css b/polaris-react/src/components/LegacyTabs/LegacyTabs.module.css index 717e96dc689..a76c4532d8a 100644 --- a/polaris-react/src/components/LegacyTabs/LegacyTabs.module.css +++ b/polaris-react/src/components/LegacyTabs/LegacyTabs.module.css @@ -52,7 +52,6 @@ text-decoration: none; .Title { - font-weight: var(--p-font-weight-semibold); color: var(--p-color-text-brand); background-color: transparent; @@ -76,7 +75,6 @@ &:focus-visible { .Title { - font-weight: var(--p-font-weight-semibold); color: var(--p-color-text-brand); } @@ -95,7 +93,6 @@ } .Tab-selected { - font-weight: var(--p-font-weight-semibold); color: var(--p-color-text-brand); &:focus .Title { @@ -124,7 +121,6 @@ padding: var(--p-space-150) var(--p-space-300); min-width: 50px; color: var(--p-color-text-brand); - font-weight: var(--p-font-weight-semibold); &::before { content: ''; diff --git a/polaris-react/src/components/LegacyTabs/LegacyTabs.stories.tsx b/polaris-react/src/components/LegacyTabs/LegacyTabs.stories.tsx index 7b47b582794..7f43f032455 100644 --- a/polaris-react/src/components/LegacyTabs/LegacyTabs.stories.tsx +++ b/polaris-react/src/components/LegacyTabs/LegacyTabs.stories.tsx @@ -88,7 +88,9 @@ export function Default() { return ( -

Tab {selected} selected

+ + Tab {selected} selected +
); @@ -133,7 +135,9 @@ export function WithUrlTabs() { return ( -

Tab {selected} selected

+ + Tab {selected} selected +
); @@ -170,7 +174,9 @@ export function Fitted() { fitted > -

Tab {selected} selected

+ + Tab {selected} selected +
@@ -216,7 +222,9 @@ export function WithBadgeContent() { fitted > -

Tab {selected} selected

+ + Tab {selected} selected +
@@ -264,7 +272,9 @@ export function WithCustomDisclosure() { disclosureText="More views" > -

Tab {selected} selected

+ + Tab {selected} selected +
diff --git a/polaris-react/src/components/LegacyTabs/components/Tab/Tab.tsx b/polaris-react/src/components/LegacyTabs/components/Tab/Tab.tsx index 0cb3256366f..52df91544e7 100644 --- a/polaris-react/src/components/LegacyTabs/components/Tab/Tab.tsx +++ b/polaris-react/src/components/LegacyTabs/components/Tab/Tab.tsx @@ -1,5 +1,6 @@ import React, {useEffect, useRef} from 'react'; +import {Text} from '../../../Text'; import {UnstyledLink} from '../../../UnstyledLink'; import {classNames} from '../../../../utilities/css'; import { @@ -99,7 +100,11 @@ export function Tab({ aria-label={accessibilityLabel} onMouseUp={handleMouseUpByBlurring} > - {children} + + + {children} + + ) : ( ); diff --git a/polaris-react/src/components/MediaCard/MediaCard.module.css b/polaris-react/src/components/MediaCard/MediaCard.module.css index add265c6cf0..b213eb80e06 100644 --- a/polaris-react/src/components/MediaCard/MediaCard.module.css +++ b/polaris-react/src/components/MediaCard/MediaCard.module.css @@ -59,8 +59,3 @@ padding-top: var(--p-space-200); } } - -.Description { - font-size: var(--p-font-size-300); - line-height: var(--p-font-line-height-400); -} diff --git a/polaris-react/src/components/MediaCard/MediaCard.tsx b/polaris-react/src/components/MediaCard/MediaCard.tsx index 53ee95f14b7..1b3f699ecec 100644 --- a/polaris-react/src/components/MediaCard/MediaCard.tsx +++ b/polaris-react/src/components/MediaCard/MediaCard.tsx @@ -171,7 +171,9 @@ export function MediaCard({ {headerMarkup} {popoverOrDismissMarkup}
-

{description}

+ + {description} + {actionMarkup}
diff --git a/polaris-react/src/components/Navigation/Navigation.module.css b/polaris-react/src/components/Navigation/Navigation.module.css index 8921cc5ea1e..a08d4d6ec59 100644 --- a/polaris-react/src/components/Navigation/Navigation.module.css +++ b/polaris-react/src/components/Navigation/Navigation.module.css @@ -131,10 +131,6 @@ .Item { /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ @mixin unstyled-button; - font-size: var(--p-font-size-400); - font-weight: var(--p-font-weight-semibold); - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - line-height: 36px; display: flex; flex-grow: 1; align-items: flex-start; @@ -171,12 +167,6 @@ @mixin no-focus-ring; } - @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-400); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-font-line-height-800); - } - &::-moz-focus-inner { border: 0; } @@ -312,8 +302,6 @@ .Text { color: var(--p-color-text); - /* stylelint-disable-next-line -- custom property */ - letter-spacing: var(--pc-navigation-letter-spacing-medium); } &:is(:hover, :focus-visible, :focus-within) { @@ -388,7 +376,6 @@ } .Item-selected { - font-weight: var(--p-font-weight-semibold); color: var(--p-color-text); outline: var(--p-border-width-025) solid transparent; @@ -404,10 +391,6 @@ border-bottom-right-radius: var(--p-border-radius-100); } - .Text { - font-weight: var(--p-font-weight-semibold); - } - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ @mixin focus-ring base, 0, base; @@ -428,17 +411,9 @@ color: var(--p-color-text-brand); background-color: var(--p-color-nav-bg-surface-active); } - - @media (--p-breakpoints-md-up) { - font-weight: var(--p-font-weight-medium); - } } .Item-child-active { - .Text { - font-weight: var(--p-font-weight-medium); - } - &::before { /* Currently open - nib */ /* stylelint-disable-next-line function-url-scheme-allowed-list -- active nav item content */ @@ -448,13 +423,14 @@ top: var(--p-space-200); left: var(--p-space-200); width: 21px; - height: 28px; + height: 32px; border-radius: 0; opacity: 1; transition: opacity var(--p-motion-duration-150) var(--p-motion-ease-out); @media (--p-breakpoints-md-up) { top: 0; + height: 28px; } } } @@ -595,15 +571,10 @@ .Text { flex: 1 1 auto; - font-size: var(--p-font-size-350); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-font-line-height-500); - margin-top: var(--p-space-200); - margin-bottom: var(--p-space-200); + margin-top: var(--p-space-150); + margin-bottom: var(--p-space-150); @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); margin-top: var(--p-space-100); margin-bottom: var(--p-space-100); } @@ -768,12 +739,6 @@ } .Item { - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - font-size: 15px; - font-weight: var(--p-font-weight-regular); - /* stylelint-disable-next-line -- Polaris component custom properties */ - line-height: var(--pc-navigation-item-line-height); - color: var(--p-color-text-secondary); position: relative; padding-left: calc(var(--p-space-800) + var(--p-space-100)); @@ -784,10 +749,14 @@ top: 0; left: var(--p-space-200); width: 21px; - height: 28px; + height: 32px; border-radius: 0; opacity: 0; transition: opacity var(--p-motion-duration-150) var(--p-motion-ease-out); + + @media (--p-breakpoints-md-up) { + height: 28px; + } } &:is(:hover, :focus-visible, :focus-within) { @@ -798,13 +767,6 @@ &:hover { color: var(--p-color-text); background: var(--p-color-nav-bg-surface-hover); - - /* stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity -- override Text styles */ - .Text { - font-weight: var(--p-font-weight-medium); - /* stylelint-disable-next-line -- custom property */ - letter-spacing: var(--pc-navigation-letter-spacing-medium); - } } &:focus-visible { @@ -823,18 +785,11 @@ &:active { color: var(--p-color-text-brand); } - - @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-350); - line-height: 1; - } } .Text { margin-top: var(--p-space-100); margin-bottom: var(--p-space-100); - font-weight: var(--p-font-weight-regular); - line-height: var(--p-space-500); } .Item-selected { @@ -843,12 +798,6 @@ /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ @mixin focus-ring base, 0, base; - /* stylelint-disable-next-line selector-max-class, selector-max-combinators -- override Text styles */ - .Text { - /* stylelint-disable-next-line declaration-no-important -- necessary to override the specificity of the Text class */ - font-weight: var(--p-font-weight-semibold) !important; - } - &:is(:hover, :focus-visible, :focus-within) { background: var(--p-color-nav-bg-surface-selected); color: var(--p-color-text-brand); @@ -879,7 +828,6 @@ } .Item-disabled { - font-weight: var(--p-font-weight-medium); color: var(--p-color-text-disabled); } @@ -890,7 +838,7 @@ opacity: 1; /* Gray line icon */ - content: url('data:image/svg+xml,%3Csvg%20width%3D%2221%22%20height%3D%2228%22%20viewBox%3D%220%200%2021%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%229%22%20width%3D%221.5%22%20height%3D%2228%22%20fill%3D%22%23B5B5B5%22%2F%3E%3C%2Fsvg%3E'); + background: url('data:image/svg+xml,%3Csvg%20width%3D%2221%22%20height%3D%2228%22%20viewBox%3D%220%200%2021%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%229%22%20width%3D%221.5%22%20height%3D%2228%22%20fill%3D%22%23B5B5B5%22%2F%3E%3C%2Fsvg%3E'); } } @@ -978,8 +926,6 @@ } .SectionHeading { - /* stylelint-disable-next-line -- Adding this intentionally to override the default subheading styling. */ - text-transform: none; display: flex; align-items: center; padding-left: var(--p-space-500); @@ -1001,11 +947,6 @@ margin-top: calc(var(--p-space-200) + var(--p-space-050)); margin-bottom: calc(var(--p-space-200) + var(--p-space-050)); - @media (--p-breakpoints-md-down) { - font-size: var(--p-font-size-350); - line-height: var(--p-font-line-height-500); - } - @media (--p-breakpoints-md-up) { margin-top: var(--p-space-100); margin-bottom: var(--p-space-100); @@ -1110,7 +1051,6 @@ } .RollupToggle { - font-weight: var(--p-font-weight-regular); color: var(--p-color-text); color: var(--p-color-text-secondary); diff --git a/polaris-react/src/components/Navigation/Navigation.stories.tsx b/polaris-react/src/components/Navigation/Navigation.stories.tsx index cab15ea2390..c9c8831ec89 100644 --- a/polaris-react/src/components/Navigation/Navigation.stories.tsx +++ b/polaris-react/src/components/Navigation/Navigation.stories.tsx @@ -1065,8 +1065,8 @@ export function WithAriaLabelledby() { return ( - -

Hidden label

+ + Hidden label {badgeMarkup} ); + const tone = + !showVerticalHoverPointer && !matches && level !== 0 + ? 'subdued' + : undefined; + let fontWeight: TextProps['fontWeight'] = 'regular'; + if ((matches || selected) && !childIsActive) { + fontWeight = 'semibold'; + } else if (level === 0 || showVerticalHoverPointer) { + fontWeight = 'medium'; + } + const itemLabelMarkup = ( - {label} + + {label} + {indicatorMarkup} ); diff --git a/polaris-react/src/components/Navigation/components/Item/components/SecondaryNavigation/SecondaryNavigation.tsx b/polaris-react/src/components/Navigation/components/Item/components/SecondaryNavigation/SecondaryNavigation.tsx index c04f896ec39..5cfa77872ed 100644 --- a/polaris-react/src/components/Navigation/components/Item/components/SecondaryNavigation/SecondaryNavigation.tsx +++ b/polaris-react/src/components/Navigation/components/Item/components/SecondaryNavigation/SecondaryNavigation.tsx @@ -73,6 +73,7 @@ export function SecondaryNavigation({ label={label} showVerticalLine={shouldShowVerticalLine} showVerticalHoverPointer={index === hoveredItemPosition} + level={1} onMouseEnter={ item.disabled ? undefined : () => setHoveredItem(item) } diff --git a/polaris-react/src/components/Navigation/types.ts b/polaris-react/src/components/Navigation/types.ts index 2d159cba73d..59a0ed709f5 100644 --- a/polaris-react/src/components/Navigation/types.ts +++ b/polaris-react/src/components/Navigation/types.ts @@ -30,6 +30,7 @@ export interface ItemProps extends ItemURLDetails { /** @deprecated Use secondaryActions instead. */ secondaryAction?: SecondaryAction; secondaryActions?: SecondaryActions; + level?: number; displayActionsOnHover?: boolean; onClick?(): void; onToggleExpandedState?(): void; diff --git a/polaris-react/src/components/Page/Page.stories.tsx b/polaris-react/src/components/Page/Page.stories.tsx index 36c94146493..6be3b21dcd0 100644 --- a/polaris-react/src/components/Page/Page.stories.tsx +++ b/polaris-react/src/components/Page/Page.stories.tsx @@ -15,6 +15,7 @@ import { LegacyStack, Page, PageActions, + Text, } from '@shopify/polaris'; export default { @@ -63,7 +64,9 @@ export function Default() { }} > -

Credit card information

+ + Credit card information +
); @@ -77,7 +80,9 @@ export function WithCustomPrimaryAction() { primaryAction={} > -

Credit card information

+ + Credit card information +
); @@ -101,7 +106,9 @@ export function WithoutPrimaryActionInHeader() { -

Buy postage and ship remaining 2 items

+ + Buy postage and ship remaining 2 items +
@@ -116,7 +123,9 @@ export function WithDestructiveSecondaryAction() { title="General" secondaryActions={[{content: 'Delete', tone: 'critical'}]} > -

Page content

+ + Page content + ); } @@ -124,7 +133,9 @@ export function WithDestructiveSecondaryAction() { export function WithCustomSecondaryAction() { return ( Save}> -

Page content

+ + Page content +
); } @@ -145,7 +156,9 @@ export function WithToolTipAction() { ]} > -

Product X information

+ + Product X information +
); @@ -164,7 +177,9 @@ export function WithBackActionOnAction() { title="General" > -

Credit card information

+ + Credit card information +
); @@ -179,7 +194,9 @@ export function WithSubtitle() { secondaryActions={[{content: 'Download', icon: ArrowDownIcon}]} > -

Credit card information

+ + Credit card information +
); @@ -195,7 +212,9 @@ export function WithSubtitleAndAdditionalMetadata() { secondaryActions={[{content: 'Download', icon: ArrowDownIcon}]} > -

Credit card information

+ + Credit card information +
); @@ -210,7 +229,9 @@ export function WithSubtitleAndAdditionalMetadataAndNoBackAction() { secondaryActions={[{content: 'Download', icon: ArrowDownIcon}]} > -

Credit card information

+ + Credit card information +
); @@ -231,7 +252,9 @@ export function WithExternalLink() { ]} > -

Credit card information

+ + Credit card information +
); @@ -245,7 +268,9 @@ export function WithoutPagination() { primaryAction={{content: 'Save'}} > -

Credit card information

+ + Credit card information +
); @@ -263,7 +288,9 @@ export function FullWidth() { }} > -

Credit card information

+ + Credit card information +
); @@ -278,7 +305,9 @@ export function NarrowWidth() { primaryAction={{content: 'Save', disabled: true}} > -

Credit card information

+ + Credit card information +
-

Credit card information

+ + Credit card information +
); @@ -378,7 +409,9 @@ export function WithActionGroupsAndActions() { ]} > -

Credit card information

+ + Credit card information +
); @@ -437,7 +470,9 @@ export function WithActionGroupsAndActionsAndLongTitle() { ]} > -

Credit card information

+ + Credit card information +
); @@ -460,7 +495,9 @@ export function WithContentAfterTitle() { }} > -

Credit card information

+ + Credit card information +
); @@ -488,7 +525,9 @@ export function WithContentAfterTitleAndSubtitle() { }} > -

Credit card information

+ + Credit card information +
); diff --git a/polaris-react/src/components/Page/components/Header/components/Title/Title.module.css b/polaris-react/src/components/Page/components/Header/components/Title/Title.module.css index 89686a54c27..7a26ff9e0f0 100644 --- a/polaris-react/src/components/Page/components/Header/components/Title/Title.module.css +++ b/polaris-react/src/components/Page/components/Header/components/Title/Title.module.css @@ -1,10 +1,4 @@ .Title { - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - @mixin text-breakword; - font-weight: var(--p-font-weight-bold); - font-size: var(--p-font-size-500); - line-height: var(--p-font-line-height-600); - &.TitleWithSubtitle { margin-top: 0; } @@ -30,7 +24,6 @@ .SubTitle { margin-top: var(--p-space-050); - color: var(--p-color-text-secondary); &.SubtitleCompact { margin-top: var(--p-space-050); diff --git a/polaris-react/src/components/Page/components/Header/components/Title/Title.tsx b/polaris-react/src/components/Page/components/Header/components/Title/Title.tsx index 9d399ee77c3..44cb0b2e56b 100644 --- a/polaris-react/src/components/Page/components/Header/components/Title/Title.tsx +++ b/polaris-react/src/components/Page/components/Header/components/Title/Title.tsx @@ -33,7 +33,13 @@ export function Title({ subtitle && styles.TitleWithSubtitle, ); - const titleMarkup = title ?

{title}

: null; + const titleMarkup = title ? ( +

+ + {title} + +

+ ) : null; const titleMetadataMarkup = titleMetadata ? ( {titleMetadata} @@ -54,7 +60,7 @@ export function Title({ hasSubtitleMaxWidth && styles.SubtitleMaxWidth, )} > - + {subtitle} diff --git a/polaris-react/src/components/Page/components/Header/components/Title/tests/Title.test.tsx b/polaris-react/src/components/Page/components/Header/components/Title/tests/Title.test.tsx index e31f25028fe..c2af2762ae2 100644 --- a/polaris-react/src/components/Page/components/Header/components/Title/tests/Title.test.tsx +++ b/polaris-react/src/components/Page/components/Header/components/Title/tests/Title.test.tsx @@ -13,9 +13,7 @@ describe('', () => { describe('title', () => { it('renders an h1 with the title', () => { const pageTitle = mountWithApp(<Title {...mockProps} />); - expect(pageTitle).toContainReactComponent('h1', { - children: mockProps.title, - }); + expect(pageTitle.find('h1')).toContainReactText(mockProps.title); }); it('does not render a title when not defined', () => { diff --git a/polaris-react/src/components/Popover/Popover.stories.tsx b/polaris-react/src/components/Popover/Popover.stories.tsx index a5b237a0697..ed22387f37c 100644 --- a/polaris-react/src/components/Popover/Popover.stories.tsx +++ b/polaris-react/src/components/Popover/Popover.stories.tsx @@ -786,11 +786,15 @@ export function WithLoadingSmallerContent() { > {loading ? ( <div style={{height: '200px'}}> - <p>Loading...</p> + <Text as="p" variant="bodyMd"> + Loading... + </Text> </div> ) : ( <div> - <p>Small content from the server</p> + <Text as="p" variant="bodyMd"> + Small content from the server + </Text> </div> )} </Popover> diff --git a/polaris-react/src/components/RangeSlider/RangeSlider.stories.tsx b/polaris-react/src/components/RangeSlider/RangeSlider.stories.tsx index 489e7a6569f..a55a76f7ffa 100644 --- a/polaris-react/src/components/RangeSlider/RangeSlider.stories.tsx +++ b/polaris-react/src/components/RangeSlider/RangeSlider.stories.tsx @@ -1,9 +1,11 @@ import React, {useCallback, useState} from 'react'; import type {ComponentMeta} from '@storybook/react'; import { + Box, LegacyCard, RangeSlider, LegacyStack, + Text, TextField, } from '@shopify/polaris'; @@ -84,11 +86,6 @@ export function WithPrefixAndSuffix() { [], ); - const suffixStyles = { - minWidth: '24px', - textAlign: 'right', - }; - return ( <LegacyCard sectioned title="Text color"> <RangeSlider @@ -98,8 +95,18 @@ export function WithPrefixAndSuffix() { max={360} value={rangeValue} onChange={handleRangeSliderChange} - prefix={<p>Hue</p>} - suffix={<p style={suffixStyles}>{rangeValue}</p>} + prefix={ + <Text as="p" variant="bodyMd"> + Hue + </Text> + } + suffix={ + <Box minWidth="24px"> + <Text as="span" variant="bodyMd"> + {rangeValue} + </Text> + </Box> + } /> </LegacyCard> ); diff --git a/polaris-react/src/components/ResourceList/ResourceList.stories.tsx b/polaris-react/src/components/ResourceList/ResourceList.stories.tsx index cb1e0645088..506e41d3f6b 100644 --- a/polaris-react/src/components/ResourceList/ResourceList.stories.tsx +++ b/polaris-react/src/components/ResourceList/ResourceList.stories.tsx @@ -90,10 +90,10 @@ export function WithEmptyState() { action={{content: 'Upload files'}} image="https://cdn.shopify.com/s/files/1/2376/3301/products/emptystate-files.png" > - <p> + <Text as="p" variant="bodyMd"> You can use the Files section to upload images, videos, and other documents - </p> + </Text> </EmptyState> ) : undefined; diff --git a/polaris-react/src/components/ResourceList/ResourceList.tsx b/polaris-react/src/components/ResourceList/ResourceList.tsx index 58d58e78ea1..f9dafbe7cb2 100644 --- a/polaris-react/src/components/ResourceList/ResourceList.tsx +++ b/polaris-react/src/components/ResourceList/ResourceList.tsx @@ -14,6 +14,7 @@ import {debounce} from '../../utilities/debounce'; import {classNames} from '../../utilities/css'; import {isElementOfType} from '../../utilities/components'; import {Button} from '../Button'; +import {Text} from '../Text'; import {Sticky} from '../Sticky'; import {Spinner} from '../Spinner'; import { @@ -614,7 +615,11 @@ export function ResourceList<TItemType extends ResourceListItemData>({ ) : null; const headerTitleMarkup = ( - <div className={styles.HeaderTitleWrapper}>{headerTitle()}</div> + <div className={styles.HeaderTitleWrapper}> + <Text as="span" variant="bodyMd"> + {headerTitle()} + </Text> + </div> ); const selectButtonMarkup = isSelectable ? ( diff --git a/polaris-react/src/components/Scrollable/Scrollable.stories.tsx b/polaris-react/src/components/Scrollable/Scrollable.stories.tsx index 2590448df69..891706076a1 100644 --- a/polaris-react/src/components/Scrollable/Scrollable.stories.tsx +++ b/polaris-react/src/components/Scrollable/Scrollable.stories.tsx @@ -21,7 +21,7 @@ export function Default() { return ( <LegacyCard title="Terms of service" sectioned> <Scrollable shadow style={{height: '200px'}} focusable> - <p> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -35,8 +35,8 @@ export function Default() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -50,8 +50,8 @@ export function Default() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -65,7 +65,7 @@ export function Default() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> + </Text> </Scrollable> </LegacyCard> ); @@ -79,16 +79,18 @@ export function WithHorizonalScrollPrevention() { horizontal={false} > <div> - <p>Last updated on: September 6, 2022</p> + <Text as="p" variant="bodyMd"> + Last updated on: September 6, 2022 + </Text> - <p> + <Text as="p" variant="bodyMd"> Welcome to Shopify! By signing up for a Shopify Account (as defined in Section 1) or by using any Shopify Services (as defined below), you are agreeing to be bound by the following terms and conditions (the “ <strong>Terms of Service</strong>”). - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> As used in these Terms of Service, “<strong>we</strong>”, “ <strong>us</strong>”, “<strong>our</strong>” and “ <strong>Shopify</strong>” means the applicable Shopify Contracting @@ -97,9 +99,9 @@ export function WithHorizonalScrollPrevention() { as an individual), or the business employing the Shopify User (if registering for or using a Shopify Service as a business) and any of its affiliates. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Shopify provides a complete commerce platform that enables merchants to unify their commerce activities. Among other features, this platform includes a range of tools for merchants to build and @@ -118,9 +120,9 @@ export function WithHorizonalScrollPrevention() { https://www.shopify.com/legal/terms </a> . - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained or expressly referenced in these Terms of Service, including Shopify’s @@ -147,9 +149,9 @@ export function WithHorizonalScrollPrevention() { Rules of Engagement for Sale of COVID-19 Related Products </a> . - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> <strong> Everyday language summaries are provided for convenience only and appear in bold near each section, but these summaries are not @@ -159,7 +161,7 @@ export function WithHorizonalScrollPrevention() { services, you are agreeing to these terms. Be sure to occasionally check back for updates. </strong> - </p> + </Text> </div> </Scrollable> ); @@ -175,16 +177,18 @@ export function WithGutterAndThinDragHandle() { scrollbarWidth="thin" > <div> - <p>Last updated on: September 6, 2022</p> + <Text as="p" variant="bodyMd"> + Last updated on: September 6, 2022 + </Text> - <p> + <Text as="p" variant="bodyMd"> Welcome to Shopify! By signing up for a Shopify Account (as defined in Section 1) or by using any Shopify Services (as defined below), you are agreeing to be bound by the following terms and conditions (the “ <strong>Terms of Service</strong>”). - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> As used in these Terms of Service, “<strong>we</strong>”, “ <strong>us</strong>”, “<strong>our</strong>” and “ <strong>Shopify</strong>” means the applicable Shopify Contracting @@ -193,9 +197,9 @@ export function WithGutterAndThinDragHandle() { as an individual), or the business employing the Shopify User (if registering for or using a Shopify Service as a business) and any of its affiliates. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Shopify provides a complete commerce platform that enables merchants to unify their commerce activities. Among other features, this platform includes a range of tools for merchants to build and @@ -214,9 +218,9 @@ export function WithGutterAndThinDragHandle() { https://www.shopify.com/legal/terms </a> . - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained or expressly referenced in these Terms of Service, including Shopify’s @@ -243,9 +247,9 @@ export function WithGutterAndThinDragHandle() { Rules of Engagement for Sale of COVID-19 Related Products </a> . - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> <strong> Everyday language summaries are provided for convenience only and appear in bold near each section, but these summaries are not @@ -255,7 +259,7 @@ export function WithGutterAndThinDragHandle() { services, you are agreeing to these terms. Be sure to occasionally check back for updates. </strong> - </p> + </Text> </div> </Scrollable> ); @@ -268,47 +272,51 @@ export function ScrollToChildComponent() { <ol> <li>Account Terms</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must be 18 years or older or at least the age of majority in the jurisdiction where you reside or from which you use this Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> To access and use the Services, you must register for a Shopify account (“Account”) by providing your full legal name, current address, phone number, a valid email address, and any other information indicated as required. Shopify may reject your application for an Account, or cancel an existing Account, for any reason, in our sole discretion. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that Shopify will use the email address you provide as the primary method for communication. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for keeping your password secure. Shopify cannot and will not be liable for any loss or damage from your failure to maintain the security of your Account and password. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for all activity and content such as photos, images, videos, graphics, written content, audio files, code, information, or data uploaded, collected, generated, stored, displayed, distributed, transmitted or exhibited on or in connection with your Account (“Materials”). - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> A breach or violation of any term in the Terms of Service, including the AUP, as determined in the sole discretion of Shopify will result in an immediate termination of your services. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> You are responsible for your Account and any Materials you upload to the Shopify Service. Remember that with any violation of these terms we will cancel your service. - </p> + </Text> - <p>If we need to reach you, we will send you an email.</p> + <Text as="p" variant="bodyMd"> + If we need to reach you, we will send you an email. + </Text> <ol> <li>Account Activation</li> @@ -317,29 +325,31 @@ export function ScrollToChildComponent() { <Scrollable.ScrollTo /> <strong>2.1 Shopify Account</strong> - <p> + <Text as="p" variant="bodyMd"> Subject to section 2.1.2, the person signing up for the Service will be the contracting party (“Account Owner”) for the purposes of our Terms of Service and will be the person who is authorized to use any corresponding account we may provide to the Account Owner in connection with the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you are signing up for the Service on behalf of your employer, your employer shall be the Account Owner. If you are signing up for the Service on behalf of your employer, then you represent and warrant that you have the authority to bind your employer to our Terms of Service. - </p> - <p>2.2 PayPal Express Checkout and Shopify Payments Accounts</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.2 PayPal Express Checkout and Shopify Payments Accounts + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create a PayPal Express Checkout account on your behalf, using your email address. Depending on your location, Shopify may also create a Shopify Payments account on your behalf. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that PayPal Express Checkout and/or Shopify Payments will be your default payments gateway(s) and that it is your sole responsibility as the Account Owner to activate and maintain these @@ -347,10 +357,12 @@ export function ScrollToChildComponent() { active, it is your responsibility to deactivate them. For the avoidance of doubt, PayPal Express Checkout is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p>2.3 Apple Pay for Safari Account</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.3 Apple Pay for Safari Account + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create an Apple Pay for Safari (“Apple Pay”) account on your behalf, using the URL(s) and business name associated with your Account. Depending on @@ -360,13 +372,13 @@ export function ScrollToChildComponent() { Apple Pay account active, it is your responsibility to deactivate it. For the avoidance of doubt, Apple Pay is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you use an Apple Pay supported payment gateway and your customers have enabled Apple Pay on their device, customers may purchase goods and services from your store using Apple Pay. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By using Apple Pay on your store, you are agreeing to be bound by the Apple Pay Platform Web Merchant Terms and Conditions, as they may be amended by Apple from time to time. If Apple amends the Apple Pay @@ -383,25 +395,27 @@ export function ScrollToChildComponent() { any changes to the Apple Pay Platform Web Merchant Terms, de-activate your Apple Pay account and do not continue to use Apple Pay on your store. - </p> - <p>2.4 Google Payment</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.4 Google Payment + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, if you have been enrolled in Shopify Payments, Shopify will also create a Google Payment account on your behalf. If you do not wish to keep your Google Payment account active, it is your responsibility to deactivate it. For the avoidance of doubt, Google Payment is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If you use a Google Payment supported payment gateway and your customers have enabled Google Payment, customers may purchase goods and services from your store using Google Payment. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> By using Google Payment on your store, you are agreeing to be bound by the Google Payment API Terms of Service, as they may be amended by Google from time to time. If Google amends the Google Payment API @@ -418,49 +432,53 @@ export function ScrollToChildComponent() { to any changes to the Google Payment API Terms of Service, de-activate your Google Payment account and do not continue to use Google Payment on your store. - </p> + </Text> - <p>2.5 Domain Names</p> + <Text as="p" variant="bodyMd"> + 2.5 Domain Names + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon purchasing a domain name through Shopify, domain registration will be preset to automatically renew each year so long as your Shopify Account remains active. You acknowledge that it is your sole responsibility to deactivate the auto-renewal function should you choose to do so. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The person signing up for the Shopify Service is responsible for the account and is bound by these Terms of Service. If you signup on behalf of your employer, your employer owns the account and is also bound by our Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> We automatically create accounts for you to accept payments. You are responsible for activating and deactivating these accounts. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Any domain you purchase through us will automatically renew unless you opt out. - </p> + </Text> <ol> <li>General Conditions</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained in these Terms of Service, including the AUP and the Privacy Policy before you may become a member of Shopify. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Technical support is only provided to paying Account holders and is only available via email. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service shall be governed by and interpreted in accordance with the laws of the Province of Ontario and the laws of Canada applicable therein, without regard to principles of conflicts @@ -470,8 +488,8 @@ export function ScrollToChildComponent() { the Terms of Service. The United Nations Convention on Contracts for the International Sale of Goods will not apply to these Terms of Service and is hereby expressly excluded. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that Shopify may amend these Terms of Service at any time by posting the relevant amended and restated Terms of Service on Shopify’s website, available at @@ -484,46 +502,46 @@ export function ScrollToChildComponent() { agreement to, and acceptance of, the amended Terms of Service. If you do not agree to any changes to the Terms of Service, do not continue to use the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You may not use the Shopify service for any illegal or unauthorized purpose nor may you, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright laws), the laws applicable to you in your customer’s jurisdiction, or the laws of Canada and the Province of Ontario. You will comply with all applicable laws, rules and regulations in your use of the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the Service, use of the Service, or access to the Service without the express written permission by Shopify. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You shall not purchase search engine or other pay per click keywords (such as Google AdWords), or domain names that use Shopify or Shopify trademarks and/or variations and misspellings thereof. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> Questions about the Terms of Service should be sent to <a href="mailto:support@shopify.com">support@shopify.com</a>. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You understand that your Materials (not including credit card information), may be transferred unencrypted and involve (a) transmissions over various networks; and (b) changes to conform and adapt to technical requirements of connecting networks or devices. Credit Card information is always encrypted during transfer over networks. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that your use of the Service, including information transmitted to or stored by Shopify, is governed by its privacy policy at <a href="https://www.shopify.com/legal/privacy"> https://www.shopify.com/legal/privacy </a> - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service may be available in languages other than English. To the extent of any inconsistencies or conflicts between these English Terms of Service and Shopify’s Terms of Service available in @@ -533,22 +551,24 @@ export function ScrollToChildComponent() { https://www.shopify.com/legal/terms </a> will prevail. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The Shopify service belongs to us. You are not allowed to rip it off or use it for any illegal or sketchy purpose. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If a dispute arises the issue will be dealt with in the Province of Ontario. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Your Materials may be transferred unencrypted and may be altered, but credit card information is always encrypted. - </p> + </Text> </Scrollable> </LegacyCard> ); @@ -558,7 +578,7 @@ export function WithScrollHint() { return ( <LegacyCard title="Terms of service" sectioned> <Scrollable hint shadow style={{height: '200px'}} focusable> - <p> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -572,8 +592,8 @@ export function WithScrollHint() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -587,8 +607,8 @@ export function WithScrollHint() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -602,7 +622,7 @@ export function WithScrollHint() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> + </Text> </Scrollable> </LegacyCard> ); @@ -616,7 +636,7 @@ export function OnScrolledToBottom() { style={{height: '200px'}} onScrolledToBottom={() => console.log('scrolled to bottom')} > - <p> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -630,8 +650,8 @@ export function OnScrolledToBottom() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -645,8 +665,8 @@ export function OnScrolledToBottom() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By signing up for the Shopify service (“Service”) or any of the services of Shopify Inc. (“Shopify”) you are agreeing to be bound by the following terms and conditions (“Terms of Service”). The Services @@ -660,7 +680,7 @@ export function OnScrolledToBottom() { update and change the Terms of Service by posting updates and changes to the Shopify website. You are advised to check the Terms of Service from time to time for any updates or changes that may impact you. - </p> + </Text> </Scrollable> </LegacyCard> ); @@ -679,47 +699,51 @@ export function UsingScrollToFromRef() { <ol> <li>Account Terms</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must be 18 years or older or at least the age of majority in the jurisdiction where you reside or from which you use this Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> To access and use the Services, you must register for a Shopify account (“Account”) by providing your full legal name, current address, phone number, a valid email address, and any other information indicated as required. Shopify may reject your application for an Account, or cancel an existing Account, for any reason, in our sole discretion. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that Shopify will use the email address you provide as the primary method for communication. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for keeping your password secure. Shopify cannot and will not be liable for any loss or damage from your failure to maintain the security of your Account and password. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for all activity and content such as photos, images, videos, graphics, written content, audio files, code, information, or data uploaded, collected, generated, stored, displayed, distributed, transmitted or exhibited on or in connection with your Account (“Materials”). - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> A breach or violation of any term in the Terms of Service, including the AUP, as determined in the sole discretion of Shopify will result in an immediate termination of your services. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> You are responsible for your Account and any Materials you upload to the Shopify Service. Remember that with any violation of these terms we will cancel your service. - </p> + </Text> - <p>If we need to reach you, we will send you an email.</p> + <Text as="p" variant="bodyMd"> + If we need to reach you, we will send you an email. + </Text> <ol> <li>Account Activation</li> @@ -727,29 +751,31 @@ export function UsingScrollToFromRef() { <strong>2.1 Shopify Account</strong> - <p> + <Text as="p" variant="bodyMd"> Subject to section 2.1.2, the person signing up for the Service will be the contracting party (“Account Owner”) for the purposes of our Terms of Service and will be the person who is authorized to use any corresponding account we may provide to the Account Owner in connection with the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you are signing up for the Service on behalf of your employer, your employer shall be the Account Owner. If you are signing up for the Service on behalf of your employer, then you represent and warrant that you have the authority to bind your employer to our Terms of Service. - </p> - <p>2.2 PayPal Express Checkout and Shopify Payments Accounts</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.2 PayPal Express Checkout and Shopify Payments Accounts + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create a PayPal Express Checkout account on your behalf, using your email address. Depending on your location, Shopify may also create a Shopify Payments account on your behalf. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that PayPal Express Checkout and/or Shopify Payments will be your default payments gateway(s) and that it is your sole responsibility as the Account Owner to activate and maintain these @@ -757,10 +783,12 @@ export function UsingScrollToFromRef() { active, it is your responsibility to deactivate them. For the avoidance of doubt, PayPal Express Checkout is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p>2.3 Apple Pay for Safari Account</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.3 Apple Pay for Safari Account + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create an Apple Pay for Safari (“Apple Pay”) account on your behalf, using the URL(s) and business name associated with your Account. Depending on @@ -770,13 +798,13 @@ export function UsingScrollToFromRef() { Apple Pay account active, it is your responsibility to deactivate it. For the avoidance of doubt, Apple Pay is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you use an Apple Pay supported payment gateway and your customers have enabled Apple Pay on their device, customers may purchase goods and services from your store using Apple Pay. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By using Apple Pay on your store, you are agreeing to be bound by the Apple Pay Platform Web Merchant Terms and Conditions, as they may be amended by Apple from time to time. If Apple amends the Apple Pay @@ -793,25 +821,27 @@ export function UsingScrollToFromRef() { any changes to the Apple Pay Platform Web Merchant Terms, de-activate your Apple Pay account and do not continue to use Apple Pay on your store. - </p> - <p>2.4 Google Payment</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.4 Google Payment + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, if you have been enrolled in Shopify Payments, Shopify will also create a Google Payment account on your behalf. If you do not wish to keep your Google Payment account active, it is your responsibility to deactivate it. For the avoidance of doubt, Google Payment is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If you use a Google Payment supported payment gateway and your customers have enabled Google Payment, customers may purchase goods and services from your store using Google Payment. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> By using Google Payment on your store, you are agreeing to be bound by the Google Payment API Terms of Service, as they may be amended by Google from time to time. If Google amends the Google Payment API @@ -828,49 +858,53 @@ export function UsingScrollToFromRef() { to any changes to the Google Payment API Terms of Service, de-activate your Google Payment account and do not continue to use Google Payment on your store. - </p> + </Text> - <p>2.5 Domain Names</p> + <Text as="p" variant="bodyMd"> + 2.5 Domain Names + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon purchasing a domain name through Shopify, domain registration will be preset to automatically renew each year so long as your Shopify Account remains active. You acknowledge that it is your sole responsibility to deactivate the auto-renewal function should you choose to do so. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The person signing up for the Shopify Service is responsible for the account and is bound by these Terms of Service. If you signup on behalf of your employer, your employer owns the account and is also bound by our Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> We automatically create accounts for you to accept payments. You are responsible for activating and deactivating these accounts. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Any domain you purchase through us will automatically renew unless you opt out. - </p> + </Text> <ol> <li>General Conditions</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained in these Terms of Service, including the AUP and the Privacy Policy before you may become a member of Shopify. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Technical support is only provided to paying Account holders and is only available via email. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service shall be governed by and interpreted in accordance with the laws of the Province of Ontario and the laws of Canada applicable therein, without regard to principles of conflicts @@ -880,8 +914,8 @@ export function UsingScrollToFromRef() { the Terms of Service. The United Nations Convention on Contracts for the International Sale of Goods will not apply to these Terms of Service and is hereby expressly excluded. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that Shopify may amend these Terms of Service at any time by posting the relevant amended and restated Terms of Service on Shopify’s website, available at @@ -894,46 +928,46 @@ export function UsingScrollToFromRef() { agreement to, and acceptance of, the amended Terms of Service. If you do not agree to any changes to the Terms of Service, do not continue to use the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You may not use the Shopify service for any illegal or unauthorized purpose nor may you, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright laws), the laws applicable to you in your customer’s jurisdiction, or the laws of Canada and the Province of Ontario. You will comply with all applicable laws, rules and regulations in your use of the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the Service, use of the Service, or access to the Service without the express written permission by Shopify. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You shall not purchase search engine or other pay per click keywords (such as Google AdWords), or domain names that use Shopify or Shopify trademarks and/or variations and misspellings thereof. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> Questions about the Terms of Service should be sent to <a href="mailto:support@shopify.com">support@shopify.com</a>. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You understand that your Materials (not including credit card information), may be transferred unencrypted and involve (a) transmissions over various networks; and (b) changes to conform and adapt to technical requirements of connecting networks or devices. Credit Card information is always encrypted during transfer over networks. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that your use of the Service, including information transmitted to or stored by Shopify, is governed by its privacy policy at <a href="https://www.shopify.com/legal/privacy"> https://www.shopify.com/legal/privacy </a> - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service may be available in languages other than English. To the extent of any inconsistencies or conflicts between these English Terms of Service and Shopify’s Terms of Service available in @@ -943,22 +977,24 @@ export function UsingScrollToFromRef() { https://www.shopify.com/legal/terms </a> will prevail. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The Shopify service belongs to us. You are not allowed to rip it off or use it for any illegal or sketchy purpose. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If a dispute arises the issue will be dealt with in the Province of Ontario. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Your Materials may be transferred unencrypted and may be altered, but credit card information is always encrypted. - </p> + </Text> <Button onClick={handleOnClick}>Scroll to top</Button> </Scrollable> </LegacyCard> @@ -978,47 +1014,51 @@ export function UsingInstantScrollToFromRef() { <ol> <li>Account Terms</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must be 18 years or older or at least the age of majority in the jurisdiction where you reside or from which you use this Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> To access and use the Services, you must register for a Shopify account (“Account”) by providing your full legal name, current address, phone number, a valid email address, and any other information indicated as required. Shopify may reject your application for an Account, or cancel an existing Account, for any reason, in our sole discretion. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that Shopify will use the email address you provide as the primary method for communication. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for keeping your password secure. Shopify cannot and will not be liable for any loss or damage from your failure to maintain the security of your Account and password. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You are responsible for all activity and content such as photos, images, videos, graphics, written content, audio files, code, information, or data uploaded, collected, generated, stored, displayed, distributed, transmitted or exhibited on or in connection with your Account (“Materials”). - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> A breach or violation of any term in the Terms of Service, including the AUP, as determined in the sole discretion of Shopify will result in an immediate termination of your services. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> You are responsible for your Account and any Materials you upload to the Shopify Service. Remember that with any violation of these terms we will cancel your service. - </p> + </Text> - <p>If we need to reach you, we will send you an email.</p> + <Text as="p" variant="bodyMd"> + If we need to reach you, we will send you an email. + </Text> <ol> <li>Account Activation</li> @@ -1026,29 +1066,31 @@ export function UsingInstantScrollToFromRef() { <strong>2.1 Shopify Account</strong> - <p> + <Text as="p" variant="bodyMd"> Subject to section 2.1.2, the person signing up for the Service will be the contracting party (“Account Owner”) for the purposes of our Terms of Service and will be the person who is authorized to use any corresponding account we may provide to the Account Owner in connection with the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you are signing up for the Service on behalf of your employer, your employer shall be the Account Owner. If you are signing up for the Service on behalf of your employer, then you represent and warrant that you have the authority to bind your employer to our Terms of Service. - </p> - <p>2.2 PayPal Express Checkout and Shopify Payments Accounts</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.2 PayPal Express Checkout and Shopify Payments Accounts + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create a PayPal Express Checkout account on your behalf, using your email address. Depending on your location, Shopify may also create a Shopify Payments account on your behalf. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge that PayPal Express Checkout and/or Shopify Payments will be your default payments gateway(s) and that it is your sole responsibility as the Account Owner to activate and maintain these @@ -1056,10 +1098,12 @@ export function UsingInstantScrollToFromRef() { active, it is your responsibility to deactivate them. For the avoidance of doubt, PayPal Express Checkout is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p>2.3 Apple Pay for Safari Account</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.3 Apple Pay for Safari Account + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, Shopify will create an Apple Pay for Safari (“Apple Pay”) account on your behalf, using the URL(s) and business name associated with your Account. Depending on @@ -1069,13 +1113,13 @@ export function UsingInstantScrollToFromRef() { Apple Pay account active, it is your responsibility to deactivate it. For the avoidance of doubt, Apple Pay is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> If you use an Apple Pay supported payment gateway and your customers have enabled Apple Pay on their device, customers may purchase goods and services from your store using Apple Pay. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> By using Apple Pay on your store, you are agreeing to be bound by the Apple Pay Platform Web Merchant Terms and Conditions, as they may be amended by Apple from time to time. If Apple amends the Apple Pay @@ -1092,25 +1136,27 @@ export function UsingInstantScrollToFromRef() { any changes to the Apple Pay Platform Web Merchant Terms, de-activate your Apple Pay account and do not continue to use Apple Pay on your store. - </p> - <p>2.4 Google Payment</p> + </Text> + <Text as="p" variant="bodyMd"> + 2.4 Google Payment + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon completion of sign up for the Service, if you have been enrolled in Shopify Payments, Shopify will also create a Google Payment account on your behalf. If you do not wish to keep your Google Payment account active, it is your responsibility to deactivate it. For the avoidance of doubt, Google Payment is a Third Party Service, as defined in Section 15 of these Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If you use a Google Payment supported payment gateway and your customers have enabled Google Payment, customers may purchase goods and services from your store using Google Payment. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> By using Google Payment on your store, you are agreeing to be bound by the Google Payment API Terms of Service, as they may be amended by Google from time to time. If Google amends the Google Payment API @@ -1127,49 +1173,53 @@ export function UsingInstantScrollToFromRef() { to any changes to the Google Payment API Terms of Service, de-activate your Google Payment account and do not continue to use Google Payment on your store. - </p> + </Text> - <p>2.5 Domain Names</p> + <Text as="p" variant="bodyMd"> + 2.5 Domain Names + </Text> - <p> + <Text as="p" variant="bodyMd"> Upon purchasing a domain name through Shopify, domain registration will be preset to automatically renew each year so long as your Shopify Account remains active. You acknowledge that it is your sole responsibility to deactivate the auto-renewal function should you choose to do so. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The person signing up for the Shopify Service is responsible for the account and is bound by these Terms of Service. If you signup on behalf of your employer, your employer owns the account and is also bound by our Terms of Service. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> We automatically create accounts for you to accept payments. You are responsible for activating and deactivating these accounts. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Any domain you purchase through us will automatically renew unless you opt out. - </p> + </Text> <ol> <li>General Conditions</li> </ol> - <p> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained in these Terms of Service, including the AUP and the Privacy Policy before you may become a member of Shopify. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Technical support is only provided to paying Account holders and is only available via email. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service shall be governed by and interpreted in accordance with the laws of the Province of Ontario and the laws of Canada applicable therein, without regard to principles of conflicts @@ -1179,8 +1229,8 @@ export function UsingInstantScrollToFromRef() { the Terms of Service. The United Nations Convention on Contracts for the International Sale of Goods will not apply to these Terms of Service and is hereby expressly excluded. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that Shopify may amend these Terms of Service at any time by posting the relevant amended and restated Terms of Service on Shopify’s website, available at @@ -1193,46 +1243,46 @@ export function UsingInstantScrollToFromRef() { agreement to, and acceptance of, the amended Terms of Service. If you do not agree to any changes to the Terms of Service, do not continue to use the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You may not use the Shopify service for any illegal or unauthorized purpose nor may you, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright laws), the laws applicable to you in your customer’s jurisdiction, or the laws of Canada and the Province of Ontario. You will comply with all applicable laws, rules and regulations in your use of the Service. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the Service, use of the Service, or access to the Service without the express written permission by Shopify. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You shall not purchase search engine or other pay per click keywords (such as Google AdWords), or domain names that use Shopify or Shopify trademarks and/or variations and misspellings thereof. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> Questions about the Terms of Service should be sent to <a href="mailto:support@shopify.com">support@shopify.com</a>. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You understand that your Materials (not including credit card information), may be transferred unencrypted and involve (a) transmissions over various networks; and (b) changes to conform and adapt to technical requirements of connecting networks or devices. Credit Card information is always encrypted during transfer over networks. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You acknowledge and agree that your use of the Service, including information transmitted to or stored by Shopify, is governed by its privacy policy at <a href="https://www.shopify.com/legal/privacy"> https://www.shopify.com/legal/privacy </a> - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> The Terms of Service may be available in languages other than English. To the extent of any inconsistencies or conflicts between these English Terms of Service and Shopify’s Terms of Service available in @@ -1242,22 +1292,24 @@ export function UsingInstantScrollToFromRef() { https://www.shopify.com/legal/terms </a> will prevail. - </p> - <p>Which means</p> - <p> + </Text> + <Text as="p" variant="bodyMd"> + Which means + </Text> + <Text as="p" variant="bodyMd"> The Shopify service belongs to us. You are not allowed to rip it off or use it for any illegal or sketchy purpose. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> If a dispute arises the issue will be dealt with in the Province of Ontario. - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> Your Materials may be transferred unencrypted and may be altered, but credit card information is always encrypted. - </p> + </Text> <Button onClick={handleOnClick}>Scroll to top</Button> </Scrollable> </LegacyCard> @@ -1286,16 +1338,18 @@ export function WithShadowOverComplexChildren() { > <Box padding="400"> <Banner title="Payment details"> - <p>Last updated on: September 6, 2022</p> + <Text as="p" variant="bodyMd"> + Last updated on: September 6, 2022 + </Text> - <p> + <Text as="p" variant="bodyMd"> Welcome to Shopify! By signing up for a Shopify Account (as defined in Section 1) or by using any Shopify Services (as defined below), you are agreeing to be bound by the following terms and conditions (the “<strong>Terms of Service</strong>”). - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> As used in these Terms of Service, “<strong>we</strong>”, “ <strong>us</strong>”, “<strong>our</strong>” and “ <strong>Shopify</strong>” means the applicable Shopify Contracting @@ -1304,7 +1358,7 @@ export function WithShadowOverComplexChildren() { Service as an individual), or the business employing the Shopify User (if registering for or using a Shopify Service as a business) and any of its affiliates. - </p> + </Text> </Banner> <FormLayout> @@ -1325,7 +1379,7 @@ export function WithShadowOverComplexChildren() { </FormLayout.Group> </FormLayout> - <p> + <Text as="p" variant="bodyMd"> Shopify provides a complete commerce platform that enables merchants to unify their commerce activities. Among other features, this platform includes a range of tools for merchants to build and @@ -1344,8 +1398,8 @@ export function WithShadowOverComplexChildren() { https://www.shopify.com/legal/terms </a> . - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> You must read, agree with and accept all of the terms and conditions contained or expressly referenced in these Terms of Service, including Shopify’s @@ -1374,9 +1428,9 @@ export function WithShadowOverComplexChildren() { Rules of Engagement for Sale of COVID-19 Related Products </a> . - </p> + </Text> - <p> + <Text as="p" variant="bodyMd"> <strong> Everyday language summaries are provided for convenience only and appear in bold near each section, but these summaries are not @@ -1386,7 +1440,7 @@ export function WithShadowOverComplexChildren() { Shopify services, you are agreeing to these terms. Be sure to occasionally check back for updates. </strong> - </p> + </Text> </Box> </Scrollable> </BlockStack> diff --git a/polaris-react/src/components/Select/Select.module.css b/polaris-react/src/components/Select/Select.module.css index e78e45571d6..d0dfd1ffe97 100644 --- a/polaris-react/src/components/Select/Select.module.css +++ b/polaris-react/src/components/Select/Select.module.css @@ -68,22 +68,6 @@ min-height: var(--pg-control-height); padding: var(--p-space-150) var(--p-space-200) var(--p-space-150) var(--p-space-300); - - font-size: var(--p-font-size-400); - line-height: var(--p-font-line-height-600); - - @media (--p-breakpoints-md-up) { - line-height: var(--p-font-line-height-500); - font-size: var(--p-font-size-325); - } - - @media (--p-breakpoints-md-down) { - /* stylelint-disable-next-line selector-max-combinators, selector-max-type -- generated by polaris-migrator DO NOT COPY */ - div > span { - font-size: var(--p-font-size-400); - line-height: var(--p-font-line-height-500); - } - } } .SelectedOption { @@ -105,10 +89,10 @@ /* Even though the input is invisible, text styles apply to the options menu */ font-size: var(--p-font-size-400); font-weight: var(--p-font-weight-regular); + line-height: var(--p-font-line-height-600); /* Safari requires the font-family to be added to the <select> element */ font-family: var(--p-font-family-sans); - line-height: var(--p-font-line-height-500); letter-spacing: initial; position: absolute; @@ -130,7 +114,7 @@ var(--p-space-300); @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-350); + font-size: var(--p-font-size-325); line-height: var(--p-font-line-height-500); } } diff --git a/polaris-react/src/components/Select/Select.stories.tsx b/polaris-react/src/components/Select/Select.stories.tsx index f6c9290a36b..00747dbb938 100644 --- a/polaris-react/src/components/Select/Select.stories.tsx +++ b/polaris-react/src/components/Select/Select.stories.tsx @@ -210,11 +210,9 @@ export function WithSeparateValidationError() { } return ( - <Text tone="critical" as="span"> - <p> - {`${weightError}${unitError} is required when weight based shipping rates are enabled. `} - <Link>Manage shipping</Link> - </p> + <Text as="p" tone="critical" variant="bodyMd"> + {`${weightError}${unitError} is required when weight based shipping rates are enabled. `} + <Link>Manage shipping</Link> </Text> ); } diff --git a/polaris-react/src/components/Select/Select.tsx b/polaris-react/src/components/Select/Select.tsx index dca19292518..a9e1e875273 100644 --- a/polaris-react/src/components/Select/Select.tsx +++ b/polaris-react/src/components/Select/Select.tsx @@ -161,6 +161,7 @@ export function Select({ <Box paddingInlineEnd="100"> <Text as="span" + variant="bodyMd" tone={ tone && tone === 'magic' && !focused ? 'magic-subdued' : 'subdued' } diff --git a/polaris-react/src/components/SelectAllActions/SelectAllActions.module.css b/polaris-react/src/components/SelectAllActions/SelectAllActions.module.css index e7a8676cce2..a1e2c0b32ea 100644 --- a/polaris-react/src/components/SelectAllActions/SelectAllActions.module.css +++ b/polaris-react/src/components/SelectAllActions/SelectAllActions.module.css @@ -38,16 +38,7 @@ transform: translateY(0); } -.PaginatedSelectAll { - font-size: var(--p-text-body-sm-font-size); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-text-body-sm-font-line-height); -} - .AllAction { - font-size: var(--p-text-body-sm-font-size); - font-weight: var(--p-font-weight-medium); - line-height: var(--p-text-body-sm-font-line-height); border: 0; background: none; padding: 0; diff --git a/polaris-react/src/components/SelectAllActions/SelectAllActions.tsx b/polaris-react/src/components/SelectAllActions/SelectAllActions.tsx index 4255684f88e..43668ca8b48 100644 --- a/polaris-react/src/components/SelectAllActions/SelectAllActions.tsx +++ b/polaris-react/src/components/SelectAllActions/SelectAllActions.tsx @@ -56,25 +56,21 @@ export const SelectAllActions = forwardRef(function SelectAllActions( ref, ) { const nodeRef = useRef<HTMLDivElement>(null); - const paginatedSelectAllActionMarkup = paginatedSelectAllAction ? ( + const paginatedSelectAllMarkup = paginatedSelectAllAction ? ( <UnstyledButton className={styles.AllAction} onClick={paginatedSelectAllAction.onAction} size="slim" disabled={disabled} > - {paginatedSelectAllAction.content} + <Text as="span" variant="bodySm" fontWeight="medium"> + {paginatedSelectAllAction.content} + </Text> </UnstyledButton> ) : null; const hasTextAndAction = paginatedSelectAllText && paginatedSelectAllAction; - const paginatedSelectAllMarkup = paginatedSelectAllActionMarkup ? ( - <div className={styles.PaginatedSelectAll}> - {paginatedSelectAllActionMarkup} - </div> - ) : null; - const ariaLive: AriaLive = hasTextAndAction ? 'polite' : undefined; const checkableButtonProps = { diff --git a/polaris-react/src/components/Sheet/Sheet.stories.tsx b/polaris-react/src/components/Sheet/Sheet.stories.tsx index de1e5bf1926..cff9c00926c 100644 --- a/polaris-react/src/components/Sheet/Sheet.stories.tsx +++ b/polaris-react/src/components/Sheet/Sheet.stories.tsx @@ -71,7 +71,9 @@ export function Default() { width: '100%', }} > - <p>No sales channels selected</p> + <Text as="p" variant="bodyMd"> + No sales channels selected + </Text> <Button onClick={toggleSheetActive}>Manage sales channels</Button> </div> ); diff --git a/polaris-react/src/components/SkeletonPage/SkeletonPage.module.css b/polaris-react/src/components/SkeletonPage/SkeletonPage.module.css index b6e7369a14c..2efba43d4a8 100644 --- a/polaris-react/src/components/SkeletonPage/SkeletonPage.module.css +++ b/polaris-react/src/components/SkeletonPage/SkeletonPage.module.css @@ -5,12 +5,6 @@ /* stylelint-enable */ } -.Title { - font-weight: var(--p-font-weight-bold); - font-size: var(--p-font-size-500); - line-height: var(--p-font-line-height-700); -} - .SkeletonTitle { @media screen and (-ms-high-contrast: active) { background-color: grayText; diff --git a/polaris-react/src/components/SkeletonPage/SkeletonPage.tsx b/polaris-react/src/components/SkeletonPage/SkeletonPage.tsx index 5478fa2bd59..2e981e40e1a 100644 --- a/polaris-react/src/components/SkeletonPage/SkeletonPage.tsx +++ b/polaris-react/src/components/SkeletonPage/SkeletonPage.tsx @@ -4,6 +4,7 @@ import {useI18n} from '../../utilities/i18n'; import {Box} from '../Box'; import {BlockStack} from '../BlockStack'; import {InlineStack} from '../InlineStack'; +import {Text} from '../Text'; import styles from './SkeletonPage.module.css'; @@ -33,7 +34,9 @@ export function SkeletonPage({ const i18n = useI18n(); const titleContent = title ? ( - <h1 className={styles.Title}>{title}</h1> + <Text as="h1" variant="headingLg" fontWeight="bold"> + {title} + </Text> ) : ( <div className={styles.SkeletonTitle}> <Box diff --git a/polaris-react/src/components/SkeletonPage/tests/SkeletonPage.test.tsx b/polaris-react/src/components/SkeletonPage/tests/SkeletonPage.test.tsx index e590e43a7ff..ed2cf694552 100644 --- a/polaris-react/src/components/SkeletonPage/tests/SkeletonPage.test.tsx +++ b/polaris-react/src/components/SkeletonPage/tests/SkeletonPage.test.tsx @@ -7,6 +7,7 @@ import {Layout} from '../../Layout'; import {SkeletonBodyText} from '../../SkeletonBodyText'; import {SkeletonPage} from '../SkeletonPage'; import {Box} from '../../Box'; +import {Text} from '../../Text'; describe('<SkeletonPage />', () => { it('renders its children', () => { @@ -34,10 +35,10 @@ describe('<SkeletonPage />', () => { }); describe('title', () => { - it('renders an h1 with the Title class when title is defined', () => { + it('renders a h1 when title is defined', () => { const skeletonPage = mountWithApp(<SkeletonPage title="Products" />); - expect(skeletonPage).toContainReactComponent('h1', {className: 'Title'}); + expect(skeletonPage).toContainReactComponent(Text, {as: 'h1'}); expect(skeletonPage).not.toContainReactComponent(Box, { background: 'bg-fill-tertiary', }); @@ -57,8 +58,8 @@ describe('<SkeletonPage />', () => { it('renders SkeletonTitle when title is an empty string', () => { const skeletonPage = mountWithApp(<SkeletonPage title="" />); - expect(skeletonPage).not.toContainReactComponent('h1', { - className: 'Title', + expect(skeletonPage).not.toContainReactComponent(Text, { + as: 'h1', }); expect(skeletonPage).toContainReactComponent(Box, { background: 'bg-fill-tertiary', diff --git a/polaris-react/src/components/SkeletonTabs/SkeletonTabs.stories.tsx b/polaris-react/src/components/SkeletonTabs/SkeletonTabs.stories.tsx index 0b04162b153..e6dbf80a8c8 100644 --- a/polaris-react/src/components/SkeletonTabs/SkeletonTabs.stories.tsx +++ b/polaris-react/src/components/SkeletonTabs/SkeletonTabs.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type {Meta} from '@storybook/react'; -import {BlockStack, LegacyCard, SkeletonTabs} from '@shopify/polaris'; +import {BlockStack, LegacyCard, SkeletonTabs, Text} from '@shopify/polaris'; export default { component: SkeletonTabs, @@ -31,7 +31,9 @@ export function InsideOfACard() { <div> <SkeletonTabs count={6} /> <LegacyCard.Section title="TabName"> - <p>Tab X selected</p> + <Text as="p" variant="bodyMd"> + Tab X selected + </Text> </LegacyCard.Section> </div> </LegacyCard> @@ -44,7 +46,9 @@ export function InsideOfACardFitted() { <div> <SkeletonTabs fitted /> <LegacyCard.Section title="TabName"> - <p>Tab X selected</p> + <Text as="p" variant="bodyMd"> + Tab X selected + </Text> </LegacyCard.Section> </div> </LegacyCard> diff --git a/polaris-react/src/components/Tabs/Tabs.module.css b/polaris-react/src/components/Tabs/Tabs.module.css index 80f4413c691..92478f243d9 100644 --- a/polaris-react/src/components/Tabs/Tabs.module.css +++ b/polaris-react/src/components/Tabs/Tabs.module.css @@ -62,8 +62,7 @@ display: inline-flex; justify-content: center; align-items: center; - height: 2rem; - padding: var(--p-space-150) var(--p-space-300); + padding: var(--p-space-100) var(--p-space-300); border: 0; border-radius: var(--p-border-radius-200); background-color: transparent; @@ -71,6 +70,7 @@ cursor: pointer; text-decoration: none; width: 100%; + height: var(--p-height-700); min-width: 100%; /* IE11 fix for overflowing flex items from parent container */ margin-top: var(--p-space-025); margin-bottom: calc(-1 * var(--p-space-025)); @@ -120,12 +120,6 @@ path { fill: currentColor; } - - @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-300); - line-height: var(--p-font-line-height-400); - height: 1.75rem; - } } .Tab-active { diff --git a/polaris-react/src/components/Tabs/Tabs.stories.tsx b/polaris-react/src/components/Tabs/Tabs.stories.tsx index 4430779f1cd..9af0168c5a4 100644 --- a/polaris-react/src/components/Tabs/Tabs.stories.tsx +++ b/polaris-react/src/components/Tabs/Tabs.stories.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useState} from 'react'; import type {ComponentMeta} from '@storybook/react'; -import {Tabs, BlockStack, LegacyCard} from '@shopify/polaris'; +import {Tabs, BlockStack, LegacyCard, Text} from '@shopify/polaris'; export default { component: Tabs, @@ -40,7 +40,9 @@ export function Default() { return ( <Tabs tabs={tabs} selected={selected} onSelect={handleTabChange}> <LegacyCard.Section title={tabs[selected].content}> - <p>Tab {selected} selected</p> + <Text as="p" variant="bodyMd"> + Tab {selected} selected + </Text> </LegacyCard.Section> </Tabs> ); @@ -68,7 +70,9 @@ export function InsideOfACard() { <LegacyCard> <Tabs tabs={tabs} selected={selected} onSelect={handleTabChange}> <LegacyCard.Section title={tabs[selected].content}> - <p>Tab {selected} selected</p> + <Text as="p" variant="bodyMd"> + Tab {selected} selected + </Text> </LegacyCard.Section> </Tabs> </LegacyCard> @@ -101,7 +105,9 @@ export function Fitted() { <LegacyCard> <Tabs tabs={tabs} selected={selected} onSelect={handleTabChange} fitted> <LegacyCard.Section title={tabs[selected].content}> - <p>Tab {selected} selected</p> + <Text as="p" variant="bodyMd"> + Tab {selected} selected + </Text> </LegacyCard.Section> </Tabs> </LegacyCard> @@ -215,7 +221,9 @@ export function WithBadgeContent() { <LegacyCard> <Tabs tabs={tabs} selected={selected} onSelect={handleTabChange} fitted> <LegacyCard.Section title={tabs[selected].content}> - <p>Tab {selected} selected</p> + <Text as="p" variant="bodyMd"> + Tab {selected} selected + </Text> </LegacyCard.Section> </Tabs> </LegacyCard> @@ -278,7 +286,9 @@ export function WithCustomDisclosure() { disclosureText="Extra views" > <LegacyCard.Section title={tabs[selected].content}> - <p>Tab {selected} selected</p> + <Text as="p" variant="bodyMd"> + Tab {selected} selected + </Text> </LegacyCard.Section> </Tabs> </LegacyCard> diff --git a/polaris-react/src/components/Tabs/components/Tab/Tab.tsx b/polaris-react/src/components/Tabs/components/Tab/Tab.tsx index ea05702cf39..ca4ea0421b3 100644 --- a/polaris-react/src/components/Tabs/components/Tab/Tab.tsx +++ b/polaris-react/src/components/Tabs/components/Tab/Tab.tsx @@ -26,7 +26,6 @@ import { focusFirstFocusableNode, handleMouseUpByBlurring, } from '../../../../utilities/focus'; -import {useBreakpoints} from '../../../../utilities/breakpoints'; import {UnstyledButton} from '../../../UnstyledButton'; import {UnstyledLink} from '../../../UnstyledLink'; import {Icon} from '../../../Icon'; @@ -72,8 +71,6 @@ export const Tab = forwardRef( const [activeModalType, setActiveModalType] = useState<TabAction | null>( null, ); - const {mdDown} = useBreakpoints(); - const wasSelected = useRef(selected); const panelFocused = useRef(false); const node = useRef<HTMLLIElement | null>(null); @@ -306,11 +303,7 @@ export const Tab = forwardRef( onKeyDown={handleKeyDown} > <InlineStack gap="200" align="center" blockAlign="center" wrap={false}> - <Text - as="span" - variant={mdDown ? 'bodyLg' : 'bodySm'} - fontWeight="medium" - > + <Text as="span" variant="bodySm" fontWeight="medium"> {icon ?? content} </Text> {badgeMarkup} diff --git a/polaris-react/src/components/Tag/Tag.module.css b/polaris-react/src/components/Tag/Tag.module.css index a5661379f24..d214e8a1ce0 100644 --- a/polaris-react/src/components/Tag/Tag.module.css +++ b/polaris-react/src/components/Tag/Tag.module.css @@ -1,13 +1,8 @@ .Tag { - /* stylelint-disable-next-line -- Polaris component custom properties */ - --pc-tag-height: 20px; position: relative; display: inline-flex; max-width: 100%; align-items: center; - /* stylelint-disable-next-line -- Polaris component custom properties */ - min-height: var(--pc-tag-height); - padding: 0; padding-inline: calc(var(--p-space-100) + var(--p-space-050)); background-color: var(--p-color-bg-fill-tertiary); border-radius: var(--p-border-radius-200); @@ -30,8 +25,6 @@ padding: 0 calc(var(--p-space-100) + var(--p-space-050)); background-color: var(--p-color-bg-fill-tertiary); outline: var(--p-border-width-025) solid transparent; - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-400); &:hover { background: var(--p-color-bg-fill-tertiary-hover); @@ -56,16 +49,9 @@ pointer-events: none; color: var(--p-color-text-disabled); } - - @media (--p-breakpoints-sm-up) { - font-size: var(--p-font-size-300); - } } &.linkable { - padding: 0; - padding-inline: calc(var(--p-space-100) + var(--p-space-050)); - &:hover { background: var(--p-color-bg-fill-tertiary-hover); } @@ -79,27 +65,6 @@ padding-right: 0; padding-inline-end: 0; } - - @media (--p-breakpoints-sm-up) { - /* stylelint-disable-next-line -- Polaris component custom properties */ - min-height: var(--pc-tag-height); - } -} - -.TagText { - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); - /* stylelint-disable-next-line -- Polaris component custom properties */ - min-height: var(--pc-tag-height); - padding: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; - - @media (--p-breakpoints-sm-up) { - font-size: var(--p-font-size-300); - } } .Button { @@ -158,20 +123,6 @@ outline: none; border-radius: var(--p-border-radius-200); text-decoration: none; - /* stylelint-disable-next-line -- Polaris component custom properties */ - min-height: var(--pc-tag-height); - padding: 0; - - .LinkText { - /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ - @mixin truncate; - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); - - @media (--p-breakpoints-sm-up) { - font-size: var(--p-font-size-300); - } - } /* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */ @mixin focus-ring wide; @@ -202,6 +153,10 @@ } } +.Text { + line-height: var(--p-font-line-height-500); +} + .linkable.removable:hover { background: var(--p-color-bg-fill-tertiary-hover); diff --git a/polaris-react/src/components/Tag/Tag.tsx b/polaris-react/src/components/Tag/Tag.tsx index 6454e505f7a..22e8d230e9f 100644 --- a/polaris-react/src/components/Tag/Tag.tsx +++ b/polaris-react/src/components/Tag/Tag.tsx @@ -4,6 +4,7 @@ import {XSmallIcon} from '@shopify/polaris-icons'; import {classNames, variationName} from '../../utilities/css'; import {useI18n} from '../../utilities/i18n'; import {Icon} from '../Icon'; +import {Text} from '../Text'; import {handleMouseUpByBlurring} from '../../utilities/focus'; import styles from './Tag.module.css'; @@ -53,6 +54,20 @@ export function Tag({ size && styles[variationName('size', size)], ); + let tagTitle = accessibilityLabel; + + if (!tagTitle) { + tagTitle = typeof children === 'string' ? children : undefined; + } + + const tagText = ( + <Text as="span" variant="bodySm" truncate> + <span title={tagTitle} className={styles.Text}> + {children} + </span> + </Text> + ); + if (onClick) { return ( <button @@ -61,17 +76,11 @@ export function Tag({ className={className} onClick={onClick} > - {children} + {tagText} </button> ); } - let tagTitle = accessibilityLabel; - - if (!tagTitle) { - tagTitle = typeof children === 'string' ? children : undefined; - } - const ariaLabel = i18n.translate('Polaris.Tag.ariaLabel', { children: tagTitle || '', }); @@ -95,14 +104,10 @@ export function Tag({ className={classNames(styles.Link, segmented && styles.segmented)} href={url} > - <span title={tagTitle} className={styles.LinkText}> - {children} - </span> + {tagText} </a> ) : ( - <span title={tagTitle} className={styles.TagText}> - {children} - </span> + tagText ); return ( diff --git a/polaris-react/src/components/Text/Text.module.css b/polaris-react/src/components/Text/Text.module.css index 327691d67e4..a7a5357c34c 100644 --- a/polaris-react/src/components/Text/Text.module.css +++ b/polaris-react/src/components/Text/Text.module.css @@ -34,6 +34,18 @@ text-align: justify; } +.base { + color: var(--p-color-text); +} + +.inherit { + color: inherit; +} + +.disabled { + color: var(--p-color-text-disabled); +} + .success { color: var(--p-color-text-success); } @@ -62,6 +74,10 @@ color: var(--p-color-text-inverse); } +.text-inverse-secondary { + color: var(--p-color-text-inverse-secondary); +} + .headingXs { font-size: var(--p-font-size-300); font-weight: var(--p-font-weight-semibold); diff --git a/polaris-react/src/components/Text/Text.tsx b/polaris-react/src/components/Text/Text.tsx index 5e1feddaac5..0843617a694 100644 --- a/polaris-react/src/components/Text/Text.tsx +++ b/polaris-react/src/components/Text/Text.tsx @@ -37,11 +37,15 @@ type Alignment = 'start' | 'center' | 'end' | 'justify'; type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold'; type Tone = + | 'base' + | 'disabled' + | 'inherit' | 'success' | 'critical' | 'caution' | 'subdued' | 'text-inverse' + | 'text-inverse-secondary' | 'magic' | 'magic-subdued'; diff --git a/polaris-react/src/components/TextContainer/TextContainer.stories.tsx b/polaris-react/src/components/TextContainer/TextContainer.stories.tsx index 5af854fb1f6..8cbd109740e 100644 --- a/polaris-react/src/components/TextContainer/TextContainer.stories.tsx +++ b/polaris-react/src/components/TextContainer/TextContainer.stories.tsx @@ -12,10 +12,10 @@ export function Default() { <Text variant="headingMd" as="h2"> Install the Shopify POS App </Text> - <p> + <Text as="p" variant="bodyMd"> Shopify POS is the easiest way to sell your products in person. Available for iPad, iPhone, and Android. - </p> + </Text> </TextContainer> ); } @@ -26,10 +26,10 @@ export function Tight() { <Text variant="headingMd" as="h2"> Install the Shopify POS App </Text> - <p> + <Text as="p" variant="bodyMd"> Shopify POS is the easiest way to sell your products in person. Available for iPad, iPhone, and Android. - </p> + </Text> </TextContainer> ); } @@ -37,15 +37,15 @@ export function Tight() { export function Loose() { return ( <TextContainer spacing="loose"> - <p> + <Text as="p" variant="bodyMd"> Manage your Shopify store on-the-go with real-time notifications, access to your dashboard, and order management, all from your smartphone. - </p> - <p> + </Text> + <Text as="p" variant="bodyMd"> Shopify POS is the fastest and easiest way to start accepting Visa, Mastercard, American Express, and Discover right from your smartphone or tablet. - </p> + </Text> </TextContainer> ); } diff --git a/polaris-react/src/components/TextField/TextField.module.css b/polaris-react/src/components/TextField/TextField.module.css index df8d0cde62b..99ed23ed5a9 100644 --- a/polaris-react/src/components/TextField/TextField.module.css +++ b/polaris-react/src/components/TextField/TextField.module.css @@ -403,11 +403,6 @@ flex: 0 0 auto; color: var(--p-color-text-secondary); user-select: none; - line-height: var(--p-font-line-height-600); - @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); - } } .Prefix { @@ -463,12 +458,6 @@ margin: 0 var(--p-space-300) 0 var(--p-space-100); pointer-events: none; text-align: right; - line-height: var(--p-font-line-height-600); - - @media (--p-breakpoints-md-up) { - font-size: var(--p-font-size-325); - line-height: var(--p-font-line-height-500); - } } .AlignFieldBottom { diff --git a/polaris-react/src/components/TextField/TextField.tsx b/polaris-react/src/components/TextField/TextField.tsx index ca316296c31..5d0533a4bf0 100644 --- a/polaris-react/src/components/TextField/TextField.tsx +++ b/polaris-react/src/components/TextField/TextField.tsx @@ -329,13 +329,17 @@ export function TextField({ id={`${id}-Prefix`} ref={prefixRef} > - {prefix} + <Text as="span" variant="bodyMd"> + {prefix} + </Text> </div> ) : null; const suffixMarkup = suffix ? ( <div className={styles.Suffix} id={`${id}-Suffix`} ref={suffixRef}> - {suffix} + <Text as="span" variant="bodyMd"> + {suffix} + </Text> </div> ) : null; @@ -375,7 +379,9 @@ export function TextField({ aria-atomic="true" onClick={handleClickChild} > - {characterCountText} + <Text as="span" variant="bodyMd"> + {characterCountText} + </Text> </div> ); } diff --git a/polaris-react/src/components/Tooltip/Tooltip.tsx b/polaris-react/src/components/Tooltip/Tooltip.tsx index 635e3977fed..ab64dae2618 100644 --- a/polaris-react/src/components/Tooltip/Tooltip.tsx +++ b/polaris-react/src/components/Tooltip/Tooltip.tsx @@ -5,6 +5,7 @@ import type { } from '@shopify/polaris-tokens'; import {Portal} from '../Portal'; +import {Text} from '../Text'; import {useEphemeralPresenceManager} from '../../utilities/ephemeral-presence-manager'; import {findFirstFocusableNode} from '../../utilities/focus'; import {useToggle} from '../../utilities/use-toggle'; @@ -189,7 +190,9 @@ export function Tooltip({ zIndexOverride={zIndexOverride} instant={!shouldAnimate} > - {content} + <Text as="span" variant="bodyMd"> + {content} + </Text> </TooltipOverlay> </Portal> ) : null; diff --git a/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.module.css b/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.module.css index 1844dc20d21..e36acef43ad 100644 --- a/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.module.css +++ b/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.module.css @@ -4,18 +4,7 @@ /* stylelint-disable-next-line polaris/space/declaration-property-unit-disallowed-list -- set padding */ padding: 0 var(--p-space-200) 0 10px; - > p { - font-size: var(--p-font-size-300); - line-height: var(--p-font-line-height-400); - } - @media (--p-breakpoints-md-down) { display: none; } } - -.Message > p { - color: var(--p-color-text-inverse-secondary); - font-size: var(--p-font-size-275); - line-height: var(--p-font-line-height-300); -} diff --git a/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.tsx b/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.tsx index 46de0065e0d..15215fd1a54 100644 --- a/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.tsx +++ b/polaris-react/src/components/TopBar/components/UserMenu/UserMenu.tsx @@ -55,15 +55,21 @@ export function UserMenu({ ) : ( <> <span className={styles.Details}> - <Text as="p" alignment="start" fontWeight="medium" truncate> + <Text + as="p" + variant="bodySm" + alignment="start" + fontWeight="medium" + truncate + > {name} </Text> <span className={styles.Message}> <Text as="p" - variant="bodySm" + variant="bodyXs" alignment="start" - tone="subdued" + tone="text-inverse-secondary" truncate > {detail} diff --git a/polaris.shopify.com/content/tools/stylelint-polaris/rules/typography-property-disallowed-list.mdx b/polaris.shopify.com/content/tools/stylelint-polaris/rules/typography-property-disallowed-list.mdx new file mode 100644 index 00000000000..2d85062a1d3 --- /dev/null +++ b/polaris.shopify.com/content/tools/stylelint-polaris/rules/typography-property-disallowed-list.mdx @@ -0,0 +1,29 @@ +--- +title: typography/property-disallowed-list +description: Disallows declarations of text style properties. +keywords: + - stylelint + - typography + - typography rules +--- + +import RulePreamble from '../_preamble.mdx'; +import RulePostamble from '../_postamble.mdx'; + +# {frontmatter.title} + +<Lede>{frontmatter.description}</Lede> + +<RulePreamble category="typography" /> + +```diff +// Do ++ <Text variant="headingXs" as="p" /> +// Don't +- font-size: var(--p-font-size-300); +- font-weight: var(--p-font-weight-semibold); +- line-height: var(--p-font-line-height-400); +- letter-spacing: var(--p-font-letter-spacing-normal); +``` + +<RulePostamble /> diff --git a/polaris.shopify.com/pages/[...slug].tsx b/polaris.shopify.com/pages/[...slug].tsx index 9a5e8d0b1eb..40bd8c348d4 100644 --- a/polaris.shopify.com/pages/[...slug].tsx +++ b/polaris.shopify.com/pages/[...slug].tsx @@ -78,8 +78,7 @@ function StylelintResourceLink({category}: {category: string}): JSX.Element { ), typography: ( <> - Polaris <Link href="/components/typography/text">text component</Link>{' '} - or <Link href="/tokens/font">font tokens</Link> + Polaris <Link href="/components/typography/text">text component</Link> </> ), }[category] ?? <Link href="/tokens">Polaris tokens</Link> diff --git a/stylelint-polaris/index.js b/stylelint-polaris/index.js index f3a2d8bfb1d..41c82b114c0 100644 --- a/stylelint-polaris/index.js +++ b/stylelint-polaris/index.js @@ -373,7 +373,16 @@ const stylelintPolarisCoverageOptions = { 'line-height': disallowedUnits, }, ], - 'property-disallowed-list': ['text-transform'], + 'property-disallowed-list': [ + [ + 'font-size', + 'font-weight', + 'line-height', + 'letter-spacing', + 'text-transform', + ], + {severity: 'warning'}, + ], 'function-disallowed-list': ['font-size', 'line-height'].map( matchNameRegExp, ), @@ -407,7 +416,7 @@ const stylelintPolarisCoverageOptions = { ], }, { - message: 'Please use a Polaris font token or typography component', + message: 'Please use the Polaris Text component', }, ], 'z-index': [
- {i18n.translate(`Polaris.DatePicker.months.${monthName(month)}`)}{' '} - {year} + + + {i18n.translate(`Polaris.DatePicker.months.${monthName(month)}`)}{' '} + {year} +
- {title} + + + {title} +