Skip to content

Commit

Permalink
Add threshold arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardasB committed May 30, 2024
1 parent e3bf053 commit a5ce3b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const meta = {
page: () => <Page />,
},
},
args: {
threshold: 2,
},
} satisfies Meta<typeof PreviewStory>;

export default meta;
Expand Down
8 changes: 7 additions & 1 deletion docs/storybook/src/preview/ControlWidgetVisibility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ function createProvider(): UiItemsProvider {
};
}

interface PreviewStoryProps {
/** Threshold of `widgetActionDropdown`. */
threshold: number;
}

/** `enableMaximizedFloatingWidget` and `enableMaximizedPanelWidget` preview features. When enabled the widget will have a "maximize" button. */
export function PreviewStory() {
export function PreviewStory({ threshold }: PreviewStoryProps) {
const provider = createProvider();
return (
<PreviewFeaturesProvider
features={{
controlWidgetVisibility: true,
widgetActionDropdown: { threshold },
}}
>
<AppUiStory
Expand Down
3 changes: 2 additions & 1 deletion docs/storybook/src/preview/WidgetActionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function createProvider(): UiItemsProvider {
},
},
}),
createWidget(1, {
createWidget(2, {
defaultState: WidgetState.Floating,
}),
];
Expand All @@ -46,6 +46,7 @@ export function PreviewStory(props: PreviewStoryProps) {
features={{
enableMaximizedFloatingWidget: true,
horizontalPanelAlignment: true,
controlWidgetVisibility: true,
widgetActionDropdown: { threshold: props.threshold },
}}
>
Expand Down

0 comments on commit a5ce3b3

Please sign in to comment.