Skip to content

Commit

Permalink
fix(*): edit storybook dropwdown
Browse files Browse the repository at this point in the history
  • Loading branch information
iljs committed Dec 23, 2024
1 parent a855d6e commit e01914e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export type DropdownProps<T extends DropdownItemOption = DropdownItemOption> = {
/**
* Стрелка у выпадающего списка.
* @default true
* @deprecated
*/
hasArrow?: boolean;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<StoryDropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -294,7 +297,7 @@ const StoryNormal = (args: StoryDropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<StoryDropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -294,7 +297,7 @@ const StoryNormal = (args: StoryDropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
7 changes: 5 additions & 2 deletions packages/sdds-cs/src/components/Dropdown/Dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ const meta: Meta<DropdownProps> = {
control: { type: 'boolean' },
if: { arg: 'alwaysOpened', truthy: false },
},
listWidth: {
control: { type: 'text' },
},
},
args: {
size: 'm',
variant: 'normal',
placement: 'bottom-start',
trigger: 'click',
offset: [0, 0],
listWidth: '',
listWidth: '300px',
hasArrow: true,
alwaysOpened: false,
closeOnOverlayClick: true,
Expand Down Expand Up @@ -312,7 +315,7 @@ const StoryNormal = (args: DropdownProps) => {
onItemSelect={action('onItemSelect')}
onItemClick={action('onItemClick')}
>
<Button text="Список стран" />
<Button text="Список стран" size={args.size} />
</Dropdown>
</>
);
Expand Down

0 comments on commit e01914e

Please sign in to comment.