-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: fix show hide event readability and make controls expanded as d… #2081
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Canvas, Meta } from "@storybook/blocks"; | ||
import { Meta } from "@storybook/blocks"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💪🏼 |
||
import { Link } from "vibe-storybook-components"; | ||
import { AttentionBox, AttentionBoxLink } from "../../../components"; | ||
import { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { | |
} from "../__tests__/DialogDataTestIds"; | ||
import useSwitch from "../../../hooks/useSwitch"; | ||
import "./Dialog.stories.scss"; | ||
import { HideShowEvent } from "../../../constants/dialog"; | ||
|
||
const metaSettings = createStoryMetaSettingsDecorator({ | ||
component: Dialog, | ||
|
@@ -19,14 +20,30 @@ const metaSettings = createStoryMetaSettingsDecorator({ | |
actionPropsArray: [] // List the component's actions here | ||
}); | ||
|
||
const showHideArgTypes = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW have you tried using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it is not doing anything that helps with the readability :( |
||
options: Object.values(HideShowEvent), | ||
control: { | ||
type: "multi-select" | ||
}, | ||
table: { | ||
type: { | ||
summary: Object.values(HideShowEvent).join(" | ") | ||
} | ||
} | ||
}; | ||
Comment on lines
+24
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. definitely should be (in a future enhancement, maybe create a task?) a common util, or as part of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll create a task for it in the backlog |
||
|
||
export default { | ||
title: "Popover/Dialog", | ||
component: Dialog, | ||
argTypes: metaSettings.argTypes, | ||
argTypes: { | ||
...metaSettings.argTypes, | ||
hideTrigger: showHideArgTypes, | ||
showTrigger: showHideArgTypes | ||
}, | ||
decorators: metaSettings.decorators | ||
}; | ||
|
||
const dialogTemplate = ({ shouldShowOnMount, position, ...dialogProps }) => { | ||
const dialogTemplate = ({ showTrigger, hideTrigger, shouldShowOnMount = true, position, ...dialogProps }) => { | ||
// for prevent dialog to move while scrolling | ||
const modifiers = [ | ||
{ | ||
|
@@ -40,10 +57,10 @@ const dialogTemplate = ({ shouldShowOnMount, position, ...dialogProps }) => { | |
<div className="monday-storybook-dialog--story-padding"> | ||
<Dialog | ||
modifiers={modifiers} | ||
shouldShowOnMount={shouldShowOnMount || true} | ||
shouldShowOnMount={shouldShowOnMount} | ||
{...dialogProps} | ||
showTrigger={[Dialog.hideShowTriggers.CLICK]} | ||
hideTrigger={[Dialog.hideShowTriggers.CLICK]} | ||
showTrigger={showTrigger || [Dialog.hideShowTriggers.CLICK]} | ||
hideTrigger={hideTrigger || [Dialog.hideShowTriggers.CLICK]} | ||
Comment on lines
+62
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can give these two also a default in the signature |
||
position={position || Dialog.positions.RIGHT} | ||
content={ | ||
<DialogContentContainer> | ||
|
@@ -59,16 +76,12 @@ const dialogTemplate = ({ shouldShowOnMount, position, ...dialogProps }) => { | |
|
||
export const Overview = { | ||
render: dialogTemplate.bind({}), | ||
|
||
name: "Overview", | ||
parameters: { | ||
docs: { | ||
source: { | ||
type: "code" | ||
} | ||
liveEdit: { isEnabled: false } | ||
} | ||
}, | ||
|
||
name: "Overview" | ||
} | ||
}; | ||
|
||
export const Positions = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉