Skip to content

Commit d9df8ee

Browse files
committed
Apply migration to polaris-react stories with updated mapping
1 parent d7514e1 commit d9df8ee

File tree

10 files changed

+45
-45
lines changed

10 files changed

+45
-45
lines changed

polaris-react/src/components/ActionList/ActionList.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export function WithAPrefixAndASuffix() {
374374
},
375375
{
376376
content: 'Or there',
377-
prefix: <Avatar name="Farrah" size="small" />,
377+
prefix: <Avatar name="Farrah" size="sm" />,
378378
suffix: <Icon source={ChevronRightMinor} />,
379379
},
380380
]}

polaris-react/src/components/AppProvider/AppProvider.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function Default(_, context) {
5858
]}
5959
renderItem={(item) => {
6060
const {id, url, name, location} = item;
61-
const media = <Avatar size="medium" name={name} />;
61+
const media = <Avatar size="md" name={name} />;
6262

6363
return (
6464
<ResourceList.Item id={id} url={url} media={media}>
@@ -121,7 +121,7 @@ export function WithI18n(_, context) {
121121
]}
122122
renderItem={(item) => {
123123
const {id, url, name, location} = item;
124-
const media = <Avatar size="medium" name={name} />;
124+
const media = <Avatar size="md" name={name} />;
125125

126126
return (
127127
<ResourceList.Item id={id} url={url} media={media}>

polaris-react/src/components/Avatar/Avatar.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ export function ExtraSmallInContext() {
194194
items={[
195195
{
196196
content: 'Chet Baker',
197-
prefix: <Avatar size="xs" name="Chet Baker" />,
197+
prefix: <Avatar size=undefined name="Chet Baker" />,
198198
},
199199
{
200200
content: 'Farrah Fawcett',
201-
prefix: <Avatar size="xs" name="Farrah Fawcett" />,
201+
prefix: <Avatar size=undefined name="Farrah Fawcett" />,
202202
},
203203
]}
204204
/>

polaris-react/src/components/Filters/Filters.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export function WithAResourceList() {
184184
]}
185185
renderItem={(item) => {
186186
const {id, url, name, location} = item;
187-
const media = <Avatar size="medium" name={name} />;
187+
const media = <Avatar size="md" name={name} />;
188188

189189
return (
190190
<ResourceList.Item
@@ -500,7 +500,7 @@ export function WithChildrenContent() {
500500
]}
501501
renderItem={(item) => {
502502
const {id, url, name, location} = item;
503-
const media = <Avatar size="medium" name={name} />;
503+
const media = <Avatar size="md" name={name} />;
504504

505505
return (
506506
<ResourceList.Item
@@ -631,7 +631,7 @@ export function Disabled() {
631631
]}
632632
renderItem={(item) => {
633633
const {id, url, name, location} = item;
634-
const media = <Avatar size="medium" name={name} />;
634+
const media = <Avatar size="md" name={name} />;
635635

636636
return (
637637
<ResourceList.Item
@@ -781,7 +781,7 @@ export function SomeDisabled() {
781781
]}
782782
renderItem={(item) => {
783783
const {id, url, name, location} = item;
784-
const media = <Avatar size="medium" name={name} />;
784+
const media = <Avatar size="md" name={name} />;
785785

786786
return (
787787
<ResourceList.Item
@@ -983,7 +983,7 @@ export function WithQueryFieldHidden() {
983983
]}
984984
renderItem={(item) => {
985985
const {id, url, name, location} = item;
986-
const media = <Avatar size="medium" name={name} />;
986+
const media = <Avatar size="md" name={name} />;
987987

988988
return (
989989
<ResourceList.Item
@@ -1181,7 +1181,7 @@ export function WithQueryFieldDisabled() {
11811181
]}
11821182
renderItem={(item) => {
11831183
const {id, url, name, location} = item;
1184-
const media = <Avatar size="medium" name={name} />;
1184+
const media = <Avatar size="md" name={name} />;
11851185

11861186
return (
11871187
<ResourceList.Item
@@ -1405,7 +1405,7 @@ export function WithAdditionalFilterSections() {
14051405
]}
14061406
renderItem={(item) => {
14071407
const {id, url, name, location} = item;
1408-
const media = <Avatar size="medium" name={name} />;
1408+
const media = <Avatar size="md" name={name} />;
14091409

14101410
return (
14111411
<ResourceList.Item

polaris-react/src/components/LegacyFilters/LegacyFilters.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function WithAResourceList() {
179179
]}
180180
renderItem={(item) => {
181181
const {id, url, name, location} = item;
182-
const media = <Avatar size="medium" name={name} />;
182+
const media = <Avatar size="md" name={name} />;
183183

184184
return (
185185
<ResourceList.Item
@@ -493,7 +493,7 @@ export function WithChildrenContent() {
493493
]}
494494
renderItem={(item) => {
495495
const {id, url, name, location} = item;
496-
const media = <Avatar size="medium" name={name} />;
496+
const media = <Avatar size="md" name={name} />;
497497

498498
return (
499499
<ResourceList.Item
@@ -621,7 +621,7 @@ export function Disabled() {
621621
]}
622622
renderItem={(item) => {
623623
const {id, url, name, location} = item;
624-
const media = <Avatar size="medium" name={name} />;
624+
const media = <Avatar size="md" name={name} />;
625625

626626
return (
627627
<ResourceList.Item
@@ -768,7 +768,7 @@ export function SomeDisabled() {
768768
]}
769769
renderItem={(item) => {
770770
const {id, url, name, location} = item;
771-
const media = <Avatar size="medium" name={name} />;
771+
const media = <Avatar size="md" name={name} />;
772772

773773
return (
774774
<ResourceList.Item
@@ -897,7 +897,7 @@ export function WithoutClearButton() {
897897
]}
898898
renderItem={(item) => {
899899
const {id, url, name, location} = item;
900-
const media = <Avatar size="medium" name={name} />;
900+
const media = <Avatar size="md" name={name} />;
901901

902902
return (
903903
<ResourceList.Item
@@ -1090,7 +1090,7 @@ export function WithHelpText() {
10901090
]}
10911091
renderItem={(item) => {
10921092
const {id, url, name, location} = item;
1093-
const media = <Avatar size="medium" name={name} />;
1093+
const media = <Avatar size="md" name={name} />;
10941094

10951095
return (
10961096
<ResourceList.Item
@@ -1286,7 +1286,7 @@ export function WithQueryFieldHidden() {
12861286
]}
12871287
renderItem={(item) => {
12881288
const {id, url, name, location} = item;
1289-
const media = <Avatar size="medium" name={name} />;
1289+
const media = <Avatar size="md" name={name} />;
12901290

12911291
return (
12921292
<ResourceList.Item
@@ -1482,7 +1482,7 @@ export function WithQueryFieldDisabled() {
14821482
]}
14831483
renderItem={(item) => {
14841484
const {id, url, name, location} = item;
1485-
const media = <Avatar size="medium" name={name} />;
1485+
const media = <Avatar size="md" name={name} />;
14861486

14871487
return (
14881488
<ResourceList.Item

polaris-react/src/components/OptionList/OptionList.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ export function All() {
334334
{
335335
value: 'avatar_extra_small',
336336
label: 'Avatar extra small',
337-
media: <Avatar name="Hello World" size="xs" />,
337+
media: <Avatar name="Hello World" size=undefined />,
338338
},
339339
{
340340
value: 'avatar_small',
341341
label: 'Avatar small',
342-
media: <Avatar name="Hello World" size="small" />,
342+
media: <Avatar name="Hello World" size="sm" />,
343343
},
344344
],
345345
},

polaris-react/src/components/Popover/Popover.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export function WithLazyLoadedList() {
299299
return (
300300
<ResourceList.Item
301301
id={name}
302-
media={<Avatar size="xs" name={name} initials={initials} />}
302+
media={<Avatar size=undefined name={name} initials={initials} />}
303303
verticalAlignment="center"
304304
onClick={handleResourceListItemClick}
305305
>
@@ -407,7 +407,7 @@ export function WithScrollableLazyLoadedList() {
407407
return (
408408
<ResourceList.Item
409409
id={name}
410-
media={<Avatar size="xs" name={name} initials={initials} />}
410+
media={<Avatar size=undefined name={name} initials={initials} />}
411411
verticalAlignment="center"
412412
onClick={handleResourceListItemClick}
413413
>

polaris-react/src/components/ResourceItem/ResourceItem.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function SelectableWithMedia() {
102102
<ResourceItem
103103
id={id}
104104
url={url}
105-
media={<Avatar size="medium" name={name} source={avatarSource} />}
105+
media={<Avatar size="md" name={name} source={avatarSource} />}
106106
accessibilityLabel={`View details for ${name}`}
107107
name={name}
108108
>
@@ -142,7 +142,7 @@ export function WithMedia() {
142142
<ResourceItem
143143
id={id}
144144
url={url}
145-
media={<Avatar size="medium" name={name} source={avatarSource} />}
145+
media={<Avatar size="md" name={name} source={avatarSource} />}
146146
accessibilityLabel={`View details for ${name}`}
147147
name={name}
148148
>
@@ -183,7 +183,7 @@ export function WithShortcutActions() {
183183
<ResourceItem
184184
id={id}
185185
url={url}
186-
media={<Avatar size="medium" name={name} source={avatarSource} />}
186+
media={<Avatar size="md" name={name} source={avatarSource} />}
187187
shortcutActions={[
188188
{content: 'View latest order', url: latestOrderUrl},
189189
]}
@@ -230,7 +230,7 @@ export function WithPersistedShortcutActions() {
230230
<ResourceItem
231231
id={id}
232232
url={url}
233-
media={<Avatar size="medium" name={name} source={avatarSource} />}
233+
media={<Avatar size="md" name={name} source={avatarSource} />}
234234
persistActions
235235
shortcutActions={shortcutActions}
236236
accessibilityLabel={`View details for ${name}`}
@@ -273,7 +273,7 @@ export function WithVerticalAlignment() {
273273
verticalAlignment="center"
274274
id={id}
275275
url={url}
276-
media={<Avatar size="medium" name={name} source={avatarSource} />}
276+
media={<Avatar size="md" name={name} source={avatarSource} />}
277277
accessibilityLabel={`View details for ${name}`}
278278
name={name}
279279
>

polaris-react/src/components/ResourceList/ResourceList.stories.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function Default() {
3939
]}
4040
renderItem={(item) => {
4141
const {id, url, name, location} = item;
42-
const media = <Avatar size="medium" name={name} />;
42+
const media = <Avatar size="md" name={name} />;
4343

4444
return (
4545
<ResourceItem
@@ -147,7 +147,7 @@ export function WithSelectionAndNoBulkActions() {
147147

148148
function renderItem(item) {
149149
const {id, url, name, location} = item;
150-
const media = <Avatar size="medium" name={name} />;
150+
const media = <Avatar size="md" name={name} />;
151151

152152
return (
153153
<ResourceItem
@@ -228,7 +228,7 @@ export function WithBulkActions() {
228228

229229
function renderItem(item) {
230230
const {id, url, name, location} = item;
231-
const media = <Avatar size="medium" name={name} />;
231+
const media = <Avatar size="md" name={name} />;
232232

233233
return (
234234
<ResourceItem
@@ -305,7 +305,7 @@ export function WithBulkActionsAndManyItems() {
305305

306306
function renderItem(item) {
307307
const {id, url, name, location} = item;
308-
const media = <Avatar size="medium" name={name} />;
308+
const media = <Avatar size="md" name={name} />;
309309

310310
return (
311311
<ResourceItem
@@ -387,7 +387,7 @@ export function WithLoadingState() {
387387

388388
function renderItem(item) {
389389
const {id, url, name, location} = item;
390-
const media = <Avatar size="medium" name={name} />;
390+
const media = <Avatar size="md" name={name} />;
391391

392392
return (
393393
<ResourceItem
@@ -428,7 +428,7 @@ export function WithTotalCount() {
428428
]}
429429
renderItem={(item) => {
430430
const {id, url, name, location} = item;
431-
const media = <Avatar size="medium" name={name} />;
431+
const media = <Avatar size="md" name={name} />;
432432

433433
return (
434434
<ResourceItem
@@ -474,7 +474,7 @@ export function WithHeaderContent() {
474474
]}
475475
renderItem={(item) => {
476476
const {id, url, name, location} = item;
477-
const media = <Avatar size="medium" name={name} />;
477+
const media = <Avatar size="md" name={name} />;
478478

479479
return (
480480
<ResourceItem
@@ -542,7 +542,7 @@ export function WithSorting() {
542542

543543
function renderItem(item) {
544544
const {id, url, name, location} = item;
545-
const media = <Avatar size="medium" name={name} />;
545+
const media = <Avatar size="md" name={name} />;
546546

547547
return (
548548
<ResourceItem
@@ -596,7 +596,7 @@ export function WithAlternateTool() {
596596

597597
function renderItem(item) {
598598
const {id, url, name, location} = item;
599-
const media = <Avatar size="medium" name={name} />;
599+
const media = <Avatar size="md" name={name} />;
600600

601601
return (
602602
<ResourceItem
@@ -706,7 +706,7 @@ export function WithFiltering() {
706706

707707
function renderItem(item) {
708708
const {id, url, name, location} = item;
709-
const media = <Avatar size="medium" name={name} />;
709+
const media = <Avatar size="md" name={name} />;
710710

711711
return (
712712
<ResourceItem id={id} url={url} media={media}>
@@ -819,7 +819,7 @@ export function WithACustomEmptySearchResultState() {
819819

820820
function renderItem(item) {
821821
const {id, url, name, location} = item;
822-
const media = <Avatar size="medium" name={name} />;
822+
const media = <Avatar size="md" name={name} />;
823823

824824
return (
825825
<ResourceItem id={id} url={url} media={media}>
@@ -874,7 +874,7 @@ export function WithItemShortcutActions() {
874874
]}
875875
renderItem={(item) => {
876876
const {id, url, name, location, latestOrderUrl} = item;
877-
const media = <Avatar size="medium" name={name} />;
877+
const media = <Avatar size="md" name={name} />;
878878
const shortcutActions = latestOrderUrl
879879
? [
880880
{
@@ -930,7 +930,7 @@ export function WithPersistentItemShortcutActions() {
930930
]}
931931
renderItem={(item) => {
932932
const {id, url, name, location, latestOrderUrl} = item;
933-
const media = <Avatar size="medium" name={name} />;
933+
const media = <Avatar size="md" name={name} />;
934934
const shortcutActions = latestOrderUrl
935935
? [
936936
{
@@ -1050,7 +1050,7 @@ export function WithMultiselect() {
10501050

10511051
function renderItem(item, _, index) {
10521052
const {id, url, name, location} = item;
1053-
const media = <Avatar size="medium" name={name} />;
1053+
const media = <Avatar size="md" name={name} />;
10541054

10551055
return (
10561056
<ResourceItem
@@ -1208,7 +1208,7 @@ export function WithAllOfItsElements() {
12081208

12091209
function renderItem(item) {
12101210
const {id, url, name, location, latestOrderUrl} = item;
1211-
const media = <Avatar size="medium" name={name} />;
1211+
const media = <Avatar size="md" name={name} />;
12121212
const shortcutActions = latestOrderUrl
12131213
? [{content: 'View latest order', url: latestOrderUrl}]
12141214
: null;

polaris-react/src/components/TopBar/TopBar.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function WithCustomActivator() {
172172

173173
const customActivator = (
174174
<>
175-
<Avatar size="small" initials="XA" name="Xquenda Andreev" />
175+
<Avatar size="sm" initials="XA" name="Xquenda Andreev" />
176176
<span style={{marginLeft: '0.5rem'}}>
177177
<Text as="p" alignment="start" fontWeight="medium" truncate>
178178
Xquenda Andreev

0 commit comments

Comments
 (0)