@trimble-oss/moduswebcomponents
Version:
Modus Web Components is a modern, accessible UI library built with Stencil JS that provides reusable web components following Trimble's Modus design system. This updated version focuses on improved flexibility, enhanced theming options, comprehensive cust
62 lines (58 loc) • 1.89 kB
JavaScript
import { html } from "lit";
import { ifDefined } from "lit/directives/if-defined.js";
const meta = {
title: 'Components/Tooltip',
component: 'modus-wc-tooltip',
args: {
content: 'Tooltip content',
position: 'auto',
},
argTypes: {
position: {
control: { type: 'select' },
options: ['auto', 'top', 'right', 'left', 'bottom'],
},
},
};
export default meta;
const Template = {
render: (args) => {
// prettier-ignore
return html `
<modus-wc-tooltip
content=${ifDefined(args.content)}
custom-class="${ifDefined(args['custom-class'])}"
?disabled="${args.disabled}"
?force-open="${args['force-open']}"
tooltip-id="${ifDefined(args['tooltip-id'])}"
position=${ifDefined(args.position)}
>
<modus-wc-badge>Hover</modus-wc-badge>
</modus-wc-tooltip>
`;
},
};
export const Default = Object.assign({}, Template);
export const Migration = {
parameters: {
docs: {
description: {
story: `
#### Breaking Changes
- In 1.0 tooltip positioning was handled by Popper.js. In 2.0, positioning is handled using CSS.
- The \`text\` prop has been renamed to \`content\`.
#### Prop Mapping
| 1.0 Prop | 2.0 Prop | Notes |
|-------------|-------------|------------------------------------------|
| aria-label | aria-label | |
| disabled | disabled | |
| position | position | Added \`auto\` option as default value |
| text | content | |
`,
},
},
controls: { disable: true },
canvas: { disable: true },
},
render: () => html `<div></div>`,
};