|
| 1 | +import { ODS_TOOLTIP_POSITION, ODS_TOOLTIP_POSITIONS } from '@ovhcloud/ods-components'; |
| 2 | +import { defineCustomElement } from '@ovhcloud/ods-components/dist/components/ods-tooltip'; |
| 3 | +import { type Meta, StoryObj } from '@storybook/web-components'; |
| 4 | +// import { html } from 'lit-html'; |
| 5 | +// import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; |
| 6 | +import { CONTROL_CATEGORY, orderControls } from '../../control.ts'; |
| 7 | + |
| 8 | +defineCustomElement(); |
| 9 | + |
| 10 | +const meta: Meta = { |
| 11 | + title: 'ODS Components/User feedback/Tooltip', |
| 12 | + component: 'ods-tooltip', |
| 13 | + // decorators: [(story) => html`<div style="height: 300px; display: inline-flex">${story()}</div>`], |
| 14 | +}; |
| 15 | + |
| 16 | +export default meta; |
| 17 | + |
| 18 | +export const Demo: StoryObj = { |
| 19 | + // render: (args) => html` |
| 20 | + // <button id="trigger"> |
| 21 | + // Hover me |
| 22 | + // </button> |
| 23 | + // <ods-tooltip position="${args.position}" |
| 24 | + // trigger-id="trigger" |
| 25 | + // with-arrow="${args.withArrow}"> |
| 26 | + // ${unsafeHTML(args.content)} |
| 27 | + // </ods-tooltip> |
| 28 | + // `, |
| 29 | + argTypes: orderControls ({ |
| 30 | + content: { |
| 31 | + table: { |
| 32 | + category: CONTROL_CATEGORY.slot, |
| 33 | + defaultValue: { summary: 'ø' }, |
| 34 | + }, |
| 35 | + control: 'text', |
| 36 | + }, |
| 37 | + position: { |
| 38 | + table: { |
| 39 | + category: CONTROL_CATEGORY.general, |
| 40 | + defaultValue: { summary: ODS_TOOLTIP_POSITION.top }, |
| 41 | + type: { summary: ODS_TOOLTIP_POSITIONS }, |
| 42 | + }, |
| 43 | + control: { type: 'select' }, |
| 44 | + options: ODS_TOOLTIP_POSITIONS, |
| 45 | + }, |
| 46 | + withArrow: { |
| 47 | + table: { |
| 48 | + category: CONTROL_CATEGORY.design, |
| 49 | + defaultValue: { summary: false }, |
| 50 | + }, |
| 51 | + control: { type: 'boolean' }, |
| 52 | + } |
| 53 | + }), |
| 54 | + args: { |
| 55 | + content: 'Tooltip content', |
| 56 | + position: ODS_TOOLTIP_POSITION.top, |
| 57 | + withArrow: true, |
| 58 | + }, |
| 59 | +}; |
0 commit comments