Skip to content

Commit

Permalink
fix: review pt.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Jan 30, 2024
1 parent 22a1031 commit 389e5d6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/components/button/button-link/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The `sbb-button-link` component provides the same functionality as a native `<a>`,
despite it appears as a button enhanced with the SBB Design.
despite its appearance as a button enhanced with the SBB Design.

```html
<sbb-button-link href="https://www.sbb.ch">Button text</sbb-button-link>
Expand Down
48 changes: 24 additions & 24 deletions src/components/card/card/card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ const TemplateWithBadge = ({ size, color }: Args): TemplateResult => html`

const TemplateAction = ({ label, ...args }: Args): TemplateResult => {
if (args.href) {
delete args.type;
delete args.form;
delete args.value;
delete args.name;
['type', 'form', 'value', 'name'].forEach((k) => delete args[k]);
return html`<sbb-card-link ${sbbSpread(args)}>${label}</sbb-card-link>`;
} else {
delete args.href;
delete args.target;
delete args.rel;
delete args.download;
['href', 'target', 'rel', 'download'].forEach((k) => delete args[k]);
return html`<sbb-card-button ${sbbSpread(args)}>${label}</sbb-card-button>`;
}
};
Expand Down Expand Up @@ -228,20 +222,26 @@ const defaultArgTypes: ArgTypes = {
color,
};

const defaultArgTypesAction: ArgTypes = {
const defaultArgTypesButton: ArgTypes = {
...defaultArgTypes,
active,
label,
href,
download,
target,
rel,
name,
type,
form,
value,
};

const defaultArgTypesLink: ArgTypes = {
...defaultArgTypes,
active,
label,
href,
download,
target,
rel,
};

const defaultArgs: Args = {
size: 'm',
color: color.options[0],
Expand Down Expand Up @@ -418,25 +418,25 @@ export const SizeXXXLWithBadge: StoryObj = {

export const Link: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesLink,
args: { ...defaultArgsLink },
};

export const Button: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: { ...defaultArgsButton },
};

export const ButtonActive: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: { ...defaultArgsButton, active: true },
};

export const ButtonActiveMilk: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: {
...defaultArgsButton,
color: color.options[1],
Expand All @@ -446,7 +446,7 @@ export const ButtonActiveMilk: StoryObj = {

export const ButtonActiveTransparentBordered: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: {
...defaultArgsButton,
color: color.options[2],
Expand All @@ -456,7 +456,7 @@ export const ButtonActiveTransparentBordered: StoryObj = {

export const ButtonActiveTransparentBorderedDashed: StoryObj = {
render: TemplateCardAction,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: {
...defaultArgsButton,
color: color.options[3],
Expand All @@ -466,31 +466,31 @@ export const ButtonActiveTransparentBorderedDashed: StoryObj = {

export const ButtonWithSbbBadge: StoryObj = {
render: TemplateCardActionWithBadge,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: { ...defaultArgsButton },
};

export const LinkWithSbbBadge: StoryObj = {
render: TemplateCardActionWithBadge,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesLink,
args: { ...defaultArgsLink },
};

export const LinkActiveWithSbbBadge: StoryObj = {
render: TemplateCardActionWithBadge,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesLink,
args: { ...defaultArgsLink, active: true },
};

export const FixedHeight: StoryObj = {
render: TemplateCardActionFixedHeight,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesButton,
args: { ...defaultArgsButton },
};

export const Multiple: StoryObj = {
render: TemplateCardActionMultipleCards,
argTypes: defaultArgTypesAction,
argTypes: defaultArgTypesLink,
args: { ...defaultArgsLink },
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/link/link-button/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The `sbb-link-button` component provides the same functionality as a native `<button>`,
despite it appears as a link enhanced with the SBB Design.
despite its appearance as a link enhanced with the SBB Design.

## Slots

Expand Down

0 comments on commit 389e5d6

Please sign in to comment.