Skip to content

Commit

Permalink
refactor: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Feb 12, 2024
1 parent 44bc27e commit 5cf843e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const meta = {
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
} satisfies Meta;

export default meta;
Expand Down
1 change: 0 additions & 1 deletion packages/components/link/src/link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Link from './link';
const meta = {
title: 'Components/Link',
component: Link,
tags: ['autodocs'],
} satisfies Meta<typeof Link>;

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import PageNavigator, { type TPageNavigatorProps } from './page-navigator';
const meta = {
title: 'Components/Pagination/PageNavigator',
component: PageNavigator,
tags: ['autodocs'],
} satisfies Meta<typeof PageNavigator>;

export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const getMinimumPageSizeFromRange = (selectedRange: TPageRangeSize) => {
const meta = {
title: 'Components/Pagination/PageSizeSelector',
component: PageSizeSelector,
tags: ['autodocs'],
parameters: {
docs: {
story: {
Expand Down
1 change: 0 additions & 1 deletion packages/components/pagination/src/pagination.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Pagination from './pagination';
const meta = {
title: 'Components/Pagination/Pagination',
component: Pagination,
tags: ['autodocs'],
parameters: {
docs: {
story: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { ComponentProps } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { BoxIcon, BrainIcon, FlameIcon } from '@commercetools-uikit/icons';
import { categorize } from '@/storybook-helpers';
import PrimaryActionDropdown from './primary-action-dropdown';
import Option from './option';

const OPTIONS_COUNT = 3;
const BASE_CATEGORY = 'Option';

type PrimaryActionDropdownPropsAndCustomArgs = ComponentProps<
typeof PrimaryActionDropdown
Expand All @@ -20,14 +21,21 @@ type PrimaryActionDropdownPropsAndCustomArgs = ComponentProps<
const meta = {
title: 'Components/PrimaryActionDropdown',
component: PrimaryActionDropdown,
tags: ['autodocs'],
parameters: {
docs: {
story: {
height: '280px',
},
},
},
argTypes: {
isDisabledOption1: categorize(BASE_CATEGORY, 1),
isDisabledOption2: categorize(BASE_CATEGORY, 2),
isDisabledOption3: categorize(BASE_CATEGORY, 3),
labelOption1: categorize(BASE_CATEGORY, 1),
labelOption2: categorize(BASE_CATEGORY, 2),
labelOption3: categorize(BASE_CATEGORY, 3),
},
} satisfies Meta<PrimaryActionDropdownPropsAndCustomArgs>;

export default meta;
Expand All @@ -42,27 +50,7 @@ export const Default: Story = {
labelOption2: 'Option 2',
labelOption3: 'Option 3',
},
argTypes: {
...[...Array(OPTIONS_COUNT).keys()].reduce((acc, index) => {
const i = index + 1;
const temp = {
...acc,
...{
[`isDisabledOption${i}`]: {
table: {
subcategory: `Option ${i}`,
},
},
[`labelOption${i}`]: {
table: {
subcategory: `Option ${i}`,
},
},
},
};
return temp;
}, {}),
},

render: (args) => {
return (
<PrimaryActionDropdown>
Expand Down
1 change: 0 additions & 1 deletion packages/components/stamp/src/stamp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const getRandomIndex = (min: number, max: number) =>
const meta = {
title: 'Components/Stamp',
component: Stamp,
tags: ['autodocs'],
} satisfies Meta<typeof Stamp>;

export default meta;
Expand Down

0 comments on commit 5cf843e

Please sign in to comment.