mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Refactor `Tooltip` to use `Popover` component internally. **Breaking changes** - `direction` is replaced by additional `align` options. - `hideIcon` property is removed. **Limitations** - The reference implementaiton uses the trigger content instead of the tooltip content as primary slot. This is not considered in this refactoring since it would be too big of a change. - Instead of `TooltipFooter` a new `Toggletip` component would be required which is not included in this patch.
30 lines
617 B
TypeScript
30 lines
617 B
TypeScript
import type { SvelteComponentTyped } from "svelte";
|
|
import type { SvelteHTMLElements } from "svelte/elements";
|
|
|
|
type RestProps = SvelteHTMLElements["span"];
|
|
|
|
export interface PopoverContentProps extends RestProps {
|
|
/**
|
|
* @default null
|
|
*/
|
|
className?: undefined;
|
|
|
|
/**
|
|
* @default {}
|
|
*/
|
|
contentProps?: {};
|
|
|
|
/**
|
|
* Obtain a reference to the popover content HTML element
|
|
* @default null
|
|
*/
|
|
ref?: null | HTMLSpanElement;
|
|
|
|
[key: `data-${string}`]: any;
|
|
}
|
|
|
|
export default class PopoverContent extends SvelteComponentTyped<
|
|
PopoverContentProps,
|
|
Record<string, any>,
|
|
{ default: {} }
|
|
> {}
|