Skip to content

Commit 24da2c3

Browse files
committed
Update enum Avatar component & minor fixes docs
1 parent 1963258 commit 24da2c3

8 files changed

Lines changed: 21 additions & 20 deletions

File tree

src/components/Avatar/Avatar.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ import { styleClass } from './utils';
3535
import { Image } from '../Image';
3636
import type { Size } from './utils';
3737
38-
enum Status {
39-
Pending = 'PENDING',
40-
Loaded = 'LOADED',
41-
Errored = 'ERRORED',
42-
}
38+
type Status = 'PENDING' | 'LOADED' | 'ERRORED';
4339
4440
interface Props {
4541
/**
@@ -70,15 +66,15 @@ const props = withDefaults(defineProps<Props>(),{
7066
7167
const emit = defineEmits<{ (event: 'error'): void }>();
7268
73-
const status = ref<Status>(Status.Pending);
69+
const status = ref<Status>('PENDING');
7470
7571
const svgPath = 'M8.28 27.5A14.95 14.95 0 0120 21.8c4.76 0 8.97 2.24 11.72 5.7a14.02 14.02 0 01-8.25 5.91 14.82 14.82 0 01-6.94 0 14.02 14.02 0 01-8.25-5.9zM13.99 12.78a6.02 6.02 0 1112.03 0 6.02 6.02 0 01-12.03 0z';
7672
7773
// Use `dominant-baseline: central` instead of `dy` when Edge supports it.
7874
const verticalOffset = '0.35em';
7975
8076
const hasImage = computed(() => {
81-
return props.source && status.value !== Status.Errored;
77+
return props.source && status.value !== 'ERRORED';
8278
});
8379
8480
const className = computed(() => {
@@ -90,7 +86,7 @@ const className = computed(() => {
9086
size && styles[size],
9187
!props.customer && styles[style],
9288
(hasImage.value || (props.initials && props.initials.length === 0))
93-
&& status.value !== Status.Loaded
89+
&& status.value !== 'LOADED'
9490
&& styles.hidden,
9591
hasImage.value && styles.hasImage,
9692
);
@@ -107,11 +103,11 @@ const label = computed(() => {
107103
});
108104
109105
const handleLoad = () => {
110-
status.value = Status.Loaded;
106+
status.value = 'LOADED';
111107
}
112108
113109
const handleError = () => {
114-
status.value = Status.Errored;
110+
status.value = 'ERRORED';
115111
emit('error');
116112
}
117113
</script>

src/components/Button/Button.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const listeners = computed(() => {
169169
return eventBindings;
170170
});
171171
172-
const hasChildren = !!slots.default
172+
const hasChildren = !!slots.default;
173173
174174
const disclosureActive = ref<boolean>(false);
175175
@@ -243,6 +243,7 @@ const buttonMarkupProps = computed(() => {
243243
const {
244244
removeUnderline, disclosure, loading, icon,
245245
} = props;
246+
246247
return {
247248
commonProps: commonProps.value,
248249
linkProps: linkProps.value,

src/components/Button/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface CommonButtonProps
3636
| 'ariaDescribedBy'
3737
| 'role'
3838
> {
39-
className: UnstyledButtonProps['className'];
39+
class: UnstyledButtonProps['className'];
4040
}
4141

4242
export type LinkButtonProps = Pick<ButtonProps, 'url' | 'external' | 'download'>;

src/components/MediaCard/README.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs'
33
import { MediaCard } from '@/polaris-vue';
44

55
<Meta
6-
title="Components / Structure"
6+
title="Components / Structure / Media card"
77
component={ MediaCard }
88
argTypes={{
99
title: {

src/components/Page/README.stories.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ export const Template = (args) => ({
9191
const handleClick = () => {
9292
console.log('click');
9393
};
94-
return { args, handleClick };
94+
const { breadcrumbs, primaryAction, secondaryActions, actionGroups, pagination, ...rest } = args;
95+
return { rest, handleClick };
9596
},
9697
template: `
9798
<Page
98-
v-bind="args"
99+
v-bind="rest"
99100
:breadcrumbs="[{content: 'Products', url: '/products'}]"
100101
:primaryAction="{ content: 'Save', disabled: true }"
101102
:secondaryActions="[{ content: 'Duplicate', onAction: handleClick }]"
@@ -147,6 +148,9 @@ Use pagination to let merchants move through an ordered collection of items that
147148
source: {
148149
code: dedent`
149150
<Page
151+
:fullWidth="true"
152+
title="3/4 inch Leather pet collar",
153+
subtitle="Perfect for any pet",
150154
:breadcrumbs="[{content: 'Products', url: '/products'}]"
151155
:primaryAction="{ content: 'Save', disabled: true }"
152156
:secondaryActions="[{ content: 'Duplicate', onAction: handleClick }]"

src/components/PageActions/README.stories.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
33
import { PageActions } from '@/polaris-vue';
44

55
<Meta
6-
title="Components / Structure / Page Actions"
6+
title="Components / Structure / Page actions"
77
component={ PageActions }
88
argTypes={{
99
secondaryActions: {
@@ -43,7 +43,7 @@ Page actions let merchants take key actions at the bottom of specific pages in t
4343

4444
<Canvas>
4545
<Story
46-
name="Page Actions"
46+
name="Page actions"
4747
height="100px"
4848
parameters={{
4949
docs: {
@@ -67,4 +67,4 @@ Page actions let merchants take key actions at the bottom of specific pages in t
6767
</Story>
6868
</Canvas>
6969

70-
<ArgsTable story="Page Actions" />
70+
<ArgsTable story="Page actions" />

src/components/SkeletonBodyText/README.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Meta, Story, Canvas, ArgsTable} from '@storybook/addon-docs'
33
import {SkeletonBodyText} from '@/polaris-vue';
44

55
<Meta
6-
title="Components / Feedback indicators"
6+
title="Components / Feedback indicators / Skeleton body text"
77
component={SkeletonBodyText}
88
/>
99

src/components/SkeletonDisplayText/README.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Meta, Story, Canvas, ArgsTable} from '@storybook/addon-docs';
33
import {SkeletonDisplayText} from '@/polaris-vue';
44

55
<Meta
6-
title="Components / Feedback indicators"
6+
title="Components / Feedback indicators / Skeleton display text"
77
component={ SkeletonDisplayText }
88
argTypes={{
99
size: {

0 commit comments

Comments
 (0)