Skip to content

Commit

Permalink
chore(prettier): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
kennylam committed Jan 5, 2024
1 parent a9ac3b4 commit 06fbde0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ export const Playground = {
argTypes: controls,
};

export default meta;
export default meta;
80 changes: 39 additions & 41 deletions packages/carbon-web-components/src/components/icon/icon.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,56 @@ import Add32 from '@carbon/web-components/es/icons/add/32';

import storyDocs from './icon.mdx';


export const Default = {
render: () => html` ${Add16()} ${Add20()} ${Add24()} ${Add32()} `
}

render: () => html` ${Add16()} ${Add20()} ${Add24()} ${Add32()} `,
};

export const withCustomClass = {

Check warning on line 29 in packages/carbon-web-components/src/components/icon/icon.stories.ts

View workflow job for this annotation

GitHub Actions / check-packages

The story should use PascalCase notation: withCustomClass
name: 'With custom class',
render: () => html`
<style>
.test-class {
fill: #0062ff;
}
</style>
${Add16({ class: 'test-class' })} ${Add20({ class: 'test-class' })}
${Add24({ class: 'test-class' })} ${Add32({ class: 'test-class' })}
`
}
<style>
.test-class {
fill: #0062ff;
}
</style>
${Add16({ class: 'test-class' })} ${Add20({ class: 'test-class' })}
${Add24({ class: 'test-class' })} ${Add32({ class: 'test-class' })}
`,
};

export const withAriaLabel = {

Check warning on line 42 in packages/carbon-web-components/src/components/icon/icon.stories.ts

View workflow job for this annotation

GitHub Actions / check-packages

The story should use PascalCase notation: withAriaLabel
name: 'With aria label',
render: () => html`
${Add16({ 'aria-label': 'add' })} ${Add20({ 'aria-label': 'add' })}
${Add24({ 'aria-label': 'add' })} ${Add32({ 'aria-label': 'add' })}
`
}
${Add16({ 'aria-label': 'add' })} ${Add20({ 'aria-label': 'add' })}
${Add24({ 'aria-label': 'add' })} ${Add32({ 'aria-label': 'add' })}
`,
};

export const withTitle = {
export const withTitle = {

Check warning on line 50 in packages/carbon-web-components/src/components/icon/icon.stories.ts

View workflow job for this annotation

GitHub Actions / check-packages

The story should use PascalCase notation: withTitle
name: 'With title',
render: () => html`
${Add16({
'aria-describedby': 'id-title-1',
// @ts-ignore
children: svg`<title id="id-title-1">add</title>`,
})}
${Add20({
'aria-describedby': 'id-title-2',
// @ts-ignore
children: svg`<title id="id-title-2">add</title>`,
})}
${Add24({
'aria-describedby': 'id-title-3',
// @ts-ignore
children: svg`<title id="id-title-3">add</title>`,
})}
${Add32({
'aria-describedby': 'id-title-4',
// @ts-ignore
children: svg`<title id="id-title-4">add</title>`,
})}
`
}
${Add16({
'aria-describedby': 'id-title-1',
// @ts-ignore
children: svg`<title id="id-title-1">add</title>`,
})}
${Add20({
'aria-describedby': 'id-title-2',
// @ts-ignore
children: svg`<title id="id-title-2">add</title>`,
})}
${Add24({
'aria-describedby': 'id-title-3',
// @ts-ignore
children: svg`<title id="id-title-3">add</title>`,
})}
${Add32({
'aria-describedby': 'id-title-4',
// @ts-ignore
children: svg`<title id="id-title-4">add</title>`,
})}
`,
};

const meta = {
title: 'Components/Icon',
Expand All @@ -84,4 +82,4 @@ const meta = {
},
};

export default meta;
export default meta;
32 changes: 10 additions & 22 deletions packages/carbon-web-components/src/components/link/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const defaultArgs = {
inline: false,
size: LINK_SIZE.MEDIUM,
visited: false,
}
};

const controls = {
disabled: {
Expand All @@ -31,20 +31,20 @@ const controls = {
description: `Provide the href attribute for the <a> node`,
},
size: {
control: 'radio', options: [LINK_SIZE.SMALL, LINK_SIZE.MEDIUM, LINK_SIZE.LARGE],
description: `Specify the size of the Link. Currently supports either sm, 'md' (default) or 'lg' as an option.`
control: 'radio',
options: [LINK_SIZE.SMALL, LINK_SIZE.MEDIUM, LINK_SIZE.LARGE],
description: `Specify the size of the Link. Currently supports either sm, 'md' (default) or 'lg' as an option.`,
},
visited: {
control: 'boolean',
description: `Specify whether you want the link to receive visited styles after the link has been clicked`,
},
}
};

export const Default = {
render: () => html` <cds-link href="#"> Link </cds-link> `
render: () => html` <cds-link href="#"> Link </cds-link> `,
};


export const Inline = {
render: () => html`
<cds-link inline href="#"
Expand All @@ -64,20 +64,15 @@ export const Inline = {
Duis at tincidunt orci. Ut velit ipsum, lacinia at ex quis, aliquet
rhoncus purus. Praesent et scelerisque ligula.
</p>
`
`,
};

export const PairedWithIcon = {
args: defaultArgs,
parameters: {
controls: { exclude: /(.*?)/ },
},
render: ({
disabled,
href,
size,
onClick
}) => html`
render: ({ disabled, href, size, onClick }) => html`
<cds-link
?disabled="${disabled}"
href="${ifDefined(href)}"
Expand All @@ -91,14 +86,7 @@ export const PairedWithIcon = {
export const Playground = {
argTypes: controls,
args: defaultArgs,
render: ({
disabled,
href,
inline,
size,
visited,
onClick
}) => html`
render: ({ disabled, href, inline, size, visited, onClick }) => html`
<cds-link
?disabled="${disabled}"
href="${ifDefined(href)}"
Expand All @@ -120,4 +108,4 @@ const meta = {
},
};

export default meta;
export default meta;

0 comments on commit 06fbde0

Please sign in to comment.