mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
feat: initial commit
This commit is contained in:
parent
bde7dd644f
commit
72dc38ea56
119 changed files with 14925 additions and 1 deletions
31
src/components/TooltipIcon/TooltipIcon.svelte
Normal file
31
src/components/TooltipIcon/TooltipIcon.svelte
Normal file
|
@ -0,0 +1,31 @@
|
|||
<script>
|
||||
let className = undefined;
|
||||
export { className as class };
|
||||
export let direction = 'bottom';
|
||||
export let align = 'center';
|
||||
export let id = Math.random();
|
||||
export let tooltipText = '';
|
||||
export let props = {};
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const _class = cx(
|
||||
'--tooltip__trigger',
|
||||
'--tooltip--a11y',
|
||||
`--tooltip--${direction}`,
|
||||
`--tooltip--align-${align}`,
|
||||
className
|
||||
);
|
||||
</script>
|
||||
|
||||
<button
|
||||
{...props}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
class={_class}
|
||||
aria-describedby={id}>
|
||||
<span class={cx('--assistive-text')} {id}>{tooltipText}</span>
|
||||
<slot />
|
||||
</button>
|
Loading…
Add table
Add a link
Reference in a new issue