/* eslint-disable react/no-unescaped-entities */
import ActionMenu from '@pluralsight/ps-design-system-actionmenu'
import Avatar from '@pluralsight/ps-design-system-avatar'
import { layout } from '@pluralsight/ps-design-system-core'
import Link from '@pluralsight/ps-design-system-link'
import { PlaceholderIcon } from '@pluralsight/ps-design-system-icon'
import { BelowLeft } from '@pluralsight/ps-design-system-position'
import { Heading, P } from '@pluralsight/ps-design-system-text'
import { action } from '@storybook/addon-actions'
import { DecoratorFn } from '@storybook/react'
import { Meta, Story } from '@storybook/react/types-6-0'
import React from 'react'
import Note from '../index'
const ConstrainWidthDecorator: DecoratorFn = storyFn => (
{storyFn()}
)
export default {
title: 'Components/Note',
component: Note,
decorators: [ConstrainWidthDecorator]
} as Meta
const defaultArgs = {
avatar: ,
heading: 'Bob Ross',
metadata: ['meta first', 'meta second'],
message: (
If these lines aren't straight, your water's going to run right out of
your painting and get your floor wet. At home you have unlimited time. See
there, told you that would be easy. Decide where your cloud lives. Maybe
he lives right in here.
),
onClick: action('on click')
}
const Template: Story> = args => (
)
export const Basic = Template.bind({})
Basic.args = { ...defaultArgs }
export const WithLinkedAvatar = Template.bind({})
WithLinkedAvatar.args = {
...defaultArgs,
avatar: (
)
}
export const WithLinkedHeading = Template.bind({})
WithLinkedHeading.args = {
...defaultArgs,
heading: (
Bob Ross
)
}
export const WithHeadingComponent = Template.bind({})
WithHeadingComponent.args = {
...defaultArgs,
heading: (
Bob Ross
)
}
export const WithH1Heading = Template.bind({})
WithH1Heading.args = {
...defaultArgs,
heading: Bob Ross
}
export const NoAuthor = Template.bind({})
NoAuthor.args = {
...defaultArgs,
avatar: undefined,
heading: undefined
}
export const LongMetadata = Template.bind({})
LongMetadata.args = {
...defaultArgs,
metadata: [
'It is impossible to count the grand contributions of this great author',
'Levels heretofore unknown in the battle for truth and knowledge',
'A length of such amazing lengthitude so-as to blow the mind'
]
}
export const LinkedMetadata = Template.bind({})
LinkedMetadata.args = {
...defaultArgs,
metadata: [
i'm a link
,
i'm a subtle link
]
}
export const ActionsVisibleOnHover = Template.bind({})
ActionsVisibleOnHover.args = {
...defaultArgs,
actionBar: [ } title="More" />],
actionBarVisible: false
}
export const SingleAction = Template.bind({})
SingleAction.args = {
...defaultArgs,
actionBar: [ } title="More" />],
actionBarVisible: true
}
export const TwoActions = Template.bind({})
TwoActions.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="More" />
],
actionBarVisible: true
}
export const ThreeActions = Template.bind({})
ThreeActions.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="Analytics" />,
} title="More" />
],
actionBarVisible: true
}
export const ActionsWithLongHeading = Template.bind({})
ActionsWithLongHeading.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="More" />
],
actionBarVisible: true,
heading: "This is probably the greatest thing that's ever happened in my life"
}
export const ActionsWithNoAuthor = Template.bind({})
ActionsWithNoAuthor.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="More" />
],
actionBarVisible: true,
avatar: undefined,
heading: undefined
}
export const ActionsWithNoAuthorLongMeta = Template.bind({})
ActionsWithNoAuthorLongMeta.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="More" />
],
actionBarVisible: true,
avatar: undefined,
heading: undefined,
metadata: [
'It is impossible to count the grand contributions of this great author',
'Levels heretofore unknown in the battle for truth and knowledge',
'A length of such amazing lengthitude so-as to blow the mind'
]
}
export const ActionsWithNoMeta = Template.bind({})
ActionsWithNoMeta.args = {
...defaultArgs,
actionBar: [
} title="Bookmark" />,
} title="More" />
],
actionBarVisible: true,
avatar: undefined,
heading: undefined,
metadata: []
}
export const WithActionMenu: Story> =
args => {
const [isOpen, setIsOpen] = React.useState(false)
return (
Edit
Delete
}
>
}
onClick={() => setIsOpen(!isOpen)}
title="More"
/>
]}
actionBarVisible
/>
)
}
WithActionMenu.args = { ...defaultArgs }
export const InAList: Story> = args => {
return (
)
}
InAList.args = { ...defaultArgs }