-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
223afc0
commit e4fa0ef
Showing
3 changed files
with
62 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 52 additions & 60 deletions
112
packages/core/src/components/rich-tooltip/stories/rich-tooltip.vue.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,75 @@ | ||
import { AtomBadge } from '@juntossomosmais/atomium/vue' | ||
import { AtomButton, AtomRichTooltip } from '@juntossomosmais/atomium/vue' | ||
import { Meta, StoryObj } from '@storybook/vue3' | ||
|
||
import { BadgeStoryArgs } from './badge.args' | ||
import { | ||
RichTooltipComponentArgs, | ||
RichTooltipStoryArgs, | ||
} from './rich-tooltip.args' | ||
|
||
export default { | ||
title: 'Components/Badge', | ||
...BadgeStoryArgs, | ||
title: 'Components/Rich Tooltip', | ||
...RichTooltipStoryArgs, | ||
} as Meta | ||
|
||
const createBadge = (args) => ({ | ||
components: { AtomBadge }, | ||
const createTooltip = (args, buttonText = 'Hover') => ({ | ||
components: { AtomButton, AtomRichTooltip }, | ||
setup() { | ||
return { args } | ||
return { args, buttonText } | ||
}, | ||
template: ` | ||
<AtomBadge type="${args.type}">{{ args.label }}</AtomBadge> | ||
<div> | ||
<AtomButton | ||
fill="solid" | ||
size="large" | ||
:id="args.element" | ||
aria-describedby="atom-tooltip" | ||
> | ||
{{ buttonText }} | ||
</AtomButton> | ||
<AtomRichTooltip | ||
id="atom-tooltip" | ||
:placement="args.placement" | ||
:element="args.element" | ||
:title="args.title" | ||
:action="args.action" | ||
:actiontext="args.actiontext" | ||
:open="args.open" | ||
> | ||
{{ args.text }} | ||
</AtomRichTooltip> | ||
</div> | ||
`, | ||
}) | ||
|
||
export const Primary: StoryObj = { | ||
render: (args) => createBadge(args), | ||
args: { | ||
type: 'primary', | ||
label: 'Badge', | ||
}, | ||
} | ||
|
||
export const Secondary: StoryObj = { | ||
render: (args) => createBadge(args), | ||
args: { | ||
...Primary.args, | ||
type: 'secondary', | ||
}, | ||
} | ||
|
||
export const Success: StoryObj = { | ||
render: (args) => createBadge(args), | ||
args: { | ||
...Primary.args, | ||
type: 'success', | ||
}, | ||
} | ||
|
||
export const Warning: StoryObj = { | ||
render: (args) => createBadge(args), | ||
args: { | ||
...Primary.args, | ||
type: 'warning', | ||
}, | ||
} | ||
|
||
export const Danger: StoryObj = { | ||
render: (args) => createBadge(args), | ||
args: { | ||
...Primary.args, | ||
type: 'danger', | ||
}, | ||
} | ||
|
||
export const Neutral: StoryObj = { | ||
render: (args) => createBadge(args), | ||
export const Hover: StoryObj = { | ||
render: (args) => createTooltip(args, 'Hover'), | ||
args: { | ||
...Primary.args, | ||
type: 'neutral', | ||
...RichTooltipComponentArgs, | ||
element: 'hover', | ||
placement: 'top', | ||
open: false, | ||
}, | ||
} | ||
|
||
export const Dark: StoryObj = { | ||
render: (args) => createBadge(args), | ||
export const Click: StoryObj = { | ||
render: (args) => createTooltip(args, 'Click'), | ||
args: { | ||
...Primary.args, | ||
type: 'dark', | ||
...RichTooltipComponentArgs, | ||
element: 'click', | ||
placement: 'top', | ||
action: 'click', | ||
open: false, | ||
}, | ||
} | ||
|
||
export const Info: StoryObj = { | ||
render: (args) => createBadge(args), | ||
export const Opened: StoryObj = { | ||
render: (args) => createTooltip(args, 'Opened'), | ||
args: { | ||
...Primary.args, | ||
type: 'info', | ||
...RichTooltipComponentArgs, | ||
element: 'opened', | ||
placement: 'left', | ||
action: 'click', | ||
open: true, | ||
}, | ||
} |