Skip to content

Commit

Permalink
chore: add shouldBlockScroll stories (#4351)
Browse files Browse the repository at this point in the history
* chore: add `shouldBlockScroll` stories

* chore: add shouldBlockScroll for argtypes

* chore: add shouldBlockScroll story for navbar

* chore: remove unnecessary props
  • Loading branch information
ryo-manba authored Dec 19, 2024
1 parent e753317 commit d152b36
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/components/dropdown/stories/dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ export default {
disable: true,
},
},
shouldBlockScroll: {
control: {
type: "boolean",
},
},
},
decorators: [
(Story) => (
Expand Down Expand Up @@ -815,3 +820,18 @@ export const WithFallbackPlacements = {
</div>
),
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
</div>
);
},

args: {
...defaultProps,
},
};
21 changes: 21 additions & 0 deletions packages/components/modal/stories/modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable jsx-a11y/no-autofocus */
import React from "react";
import {Meta} from "@storybook/react";
import {modal} from "@nextui-org/theme";
import {Button} from "@nextui-org/button";
Expand Down Expand Up @@ -63,6 +64,11 @@ export default {
disable: true,
},
},
shouldBlockScroll: {
control: {
type: "boolean",
},
},
},
decorators: [
(Story) => (
Expand Down Expand Up @@ -348,3 +354,18 @@ export const DraggableOverflow = {
...defaultProps,
},
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
</div>
);
},

args: {
...defaultProps,
},
};
20 changes: 20 additions & 0 deletions packages/components/navbar/stories/navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export default {
type: "boolean",
},
},
shouldBlockScroll: {
control: {
type: "boolean",
},
},
},
decorators: [
(Story) => (
Expand Down Expand Up @@ -615,3 +620,18 @@ export const WithSearchInput = {
...defaultProps,
},
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8 w-[1024px]">
<WithMenuTemplate {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<WithMenuTemplate {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
</div>
);
},

args: {
...defaultProps,
},
};
20 changes: 20 additions & 0 deletions packages/components/popover/stories/popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export default {
disable: true,
},
},
shouldBlockScroll: {
control: {
type: "boolean",
},
},
},
decorators: [
(Story) => (
Expand Down Expand Up @@ -575,3 +580,18 @@ export const CustomMotion = {
},
},
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
</div>
);
},

args: {
...defaultProps,
},
};

0 comments on commit d152b36

Please sign in to comment.