flowbite-svelte 0.25.6 → 0.25.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.25.9](https://github.com/themesberg/flowbite-svelte/compare/v0.25.8...v0.25.9) (2022-08-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * docs for radio ([add38b2](https://github.com/themesberg/flowbite-svelte/commit/add38b26fd4669a591916b7fa42e107868cc90a1))
11
+ * move @floating-ui/dom, classnames, svelte-heros, @popperjs/core from devDpendencies to dependencies ([ee5d31a](https://github.com/themesberg/flowbite-svelte/commit/ee5d31af1b23e00e565c2a60b354b85f2beb54d1))
12
+ * popover html ([d49f808](https://github.com/themesberg/flowbite-svelte/commit/d49f808b8a05bd735a9f90c661710dddfd163cad))
13
+
14
+ ### [0.25.8](https://github.com/themesberg/flowbite-svelte/compare/v0.25.7...v0.25.8) (2022-08-21)
15
+
16
+
17
+ ### Features
18
+
19
+ * add H1, H2, A, P, Higlight components ([3f80473](https://github.com/themesberg/flowbite-svelte/commit/3f804731e6a093c1e34f8b3be6289f930c372a96))
20
+ * add Heading and removed H1 and H2 ([b2be994](https://github.com/themesberg/flowbite-svelte/commit/b2be9945c39bcbfe23a0df53348ce768c5958255))
21
+ * add Mark and TextGradient ([343e719](https://github.com/themesberg/flowbite-svelte/commit/343e719406bc146639882f97bbeafbc2de9514cb))
22
+
23
+ ### [0.25.7](https://github.com/themesberg/flowbite-svelte/compare/v0.25.6...v0.25.7) (2022-08-21)
24
+
25
+
26
+ ### Features
27
+
28
+ * dropdown as Popper + fixes ([67fdf78](https://github.com/themesberg/flowbite-svelte/commit/67fdf7837f36d63b3683e0b6f6e78fbf91f6bf23))
29
+
5
30
  ### [0.25.6](https://github.com/themesberg/flowbite-svelte/compare/v0.25.5...v0.25.6) (2022-08-20)
6
31
 
7
32
 
package/avatar/Dot.svelte CHANGED
@@ -23,7 +23,7 @@ $: dotClass = classNames('absolute rounded-full border-white dark:border-gray-80
23
23
  </script>
24
24
 
25
25
  {#if show}
26
- <div class="relative flex-shrink-0 h-full">
26
+ <div class="relative flex-shrink-0">
27
27
  <slot />
28
28
  <span class={dotClass} />
29
29
  </div>
@@ -6,6 +6,7 @@ export let href = undefined;
6
6
  export let rounded = false;
7
7
  export let index = false;
8
8
  export let dismissable = false;
9
+ export let baseClass = 'inline-flex items-center justify-center -mb-0.5';
9
10
  let hidden = false;
10
11
  const colors = {
11
12
  blue: 'bg-blue-100 text-blue-800 dark:bg-blue-200 dark:text-blue-800',
@@ -36,7 +37,7 @@ const hovers = {
36
37
  pink: 'hover:bg-pink-200 dark:hover:bg-pink-300'
37
38
  };
38
39
  let badgeClass;
39
- $: badgeClass = classNames('inline-flex items-center justify-center -mb-0.5', large ? 'text-sm font-medium' : 'text-xs font-semibold', colors[color], href && (hovers[color] ?? hovers.blue), rounded ? 'rounded-full p-1' : 'rounded px-2.5 py-0.5', index && 'absolute font-bold border-2 border-white dark:border-gray-900', index && (large ? 'w-7 h-7 -top-3 -right-3' : 'w-6 h-6 -top-2 -right-2'), $$props.class);
40
+ $: badgeClass = classNames(baseClass, large ? 'text-sm font-medium' : 'text-xs font-semibold', colors[color], href && (hovers[color] ?? hovers.blue), rounded ? 'rounded-full p-1' : 'rounded px-2.5 py-0.5', index && 'absolute font-bold border-2 border-white dark:border-gray-900', index && (large ? 'w-7 h-7 -top-3 -right-3' : 'w-6 h-6 -top-2 -right-2'), $$props.class);
40
41
  const handleHide = () => {
41
42
  hidden = !hidden;
42
43
  };
@@ -9,6 +9,7 @@ declare const __propDef: {
9
9
  rounded?: boolean;
10
10
  index?: boolean;
11
11
  dismissable?: boolean;
12
+ baseClass?: string;
12
13
  };
13
14
  events: {
14
15
  [evt: string]: CustomEvent<any>;
@@ -3,7 +3,7 @@ export let navClass = 'flex';
3
3
  export let olClass = 'inline-flex items-center space-x-1 md:space-x-3';
4
4
  </script>
5
5
 
6
- <nav aria-label="Breadcrumb" {...$$restProps} class={classNames(navClass, $$props.classNav)}>
6
+ <nav aria-label="Breadcrumb" {...$$restProps} class={classNames(navClass, $$props.class)}>
7
7
  <ol class={classNames(olClass, $$props.classOl)}>
8
8
  <slot />
9
9
  </ol>
@@ -1,11 +1,10 @@
1
1
  <script>import { setContext } from 'svelte';
2
- import Tooltip from '../tooltips/Tooltip.svelte';
3
2
  import Button from '../buttons/Button.svelte';
3
+ import Popper from '../utils/Popper.svelte';
4
4
  import classNames from 'classnames';
5
5
  import { ChevronUp, ChevronRight, ChevronDown, ChevronLeft } from 'svelte-heros';
6
6
  export let label = '';
7
7
  export let inline = false;
8
- export let tooltipArrow = false;
9
8
  export let arrowIcon = true;
10
9
  export let labelClass = 'flex items-center justify-between w-full py-2 pl-3 pr-4 font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent';
11
10
  export let placement = 'bottom';
@@ -19,18 +18,21 @@ const icons = {
19
18
  };
20
19
  // @ts-ignore
21
20
  $: icon = icons[placement.split('-')[0]];
21
+ let popoverClass;
22
+ $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800', 'text-gray-500 dark:text-gray-400', 'border border-gray-200 dark:border-gray-700', 'outline-none', $$props.class);
22
23
  </script>
23
24
 
24
- <Tooltip
25
- class={classNames('!rounded !p-0', $$props.class)}
26
- style="auto"
27
- animation="duration-100"
25
+ <Popper
26
+ activeContent={true}
27
+ arrow={false}
28
28
  {placement}
29
- arrow={tooltipArrow}
29
+ {...$$restProps}
30
+ class={popoverClass}
30
31
  trigger="click"
32
+ on:show
31
33
  bind:open
32
34
  >
33
- <slot name="trigger">
35
+ <slot name="trigger" slot="trigger">
34
36
  {#if inline}
35
37
  <button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
36
38
  <slot name="label">{label}</slot>
@@ -53,9 +55,9 @@ $: icon = icons[placement.split('-')[0]];
53
55
  </Button>
54
56
  {/if}
55
57
  </slot>
56
- <slot name="content" slot="content">
58
+ <slot name="content">
57
59
  <ul class="py-1">
58
60
  <slot />
59
61
  </ul>
60
62
  </slot>
61
- </Tooltip>
63
+ </Popper>
@@ -1,25 +1,26 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { Placement } from '@floating-ui/dom';
2
+ import type { Placement } from '@popperjs/core';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  label?: string;
7
7
  inline?: boolean;
8
- tooltipArrow?: boolean;
9
8
  arrowIcon?: boolean;
10
9
  labelClass?: string;
11
10
  placement?: 'auto' | Placement;
12
11
  open?: boolean;
13
12
  };
14
13
  events: {
14
+ show: CustomEvent<any>;
15
+ } & {
15
16
  [evt: string]: CustomEvent<any>;
16
17
  };
17
18
  slots: {
18
- trigger: {};
19
- label: {};
20
- content: {
19
+ trigger: {
21
20
  slot: string;
22
21
  };
22
+ label: {};
23
+ content: {};
23
24
  default: {};
24
25
  };
25
26
  };
package/index.d.ts CHANGED
@@ -111,4 +111,12 @@ export { default as TimelineItemHorizontal } from './timelines/TimelineItemHoriz
111
111
  export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte';
112
112
  export { default as Toast } from './toasts/Toast.svelte';
113
113
  export { default as Tooltip } from './tooltips/Tooltip.svelte';
114
+ export { default as A } from './typography/A.svelte';
115
+ export { default as Heading } from './typography/Heading.svelte';
116
+ export { default as Highlight } from './typography/Highlight.svelte';
117
+ export { default as Mark } from './typography/Mark.svelte';
118
+ export { default as P } from './typography/P.svelte';
119
+ export { default as Secondary } from './typography/Secondary.svelte';
120
+ export { default as TextGradient } from './typography/TextGradient.svelte';
121
+ export { default as Underline } from './typography/Underline.svelte';
114
122
  export { default as CloseButton } from './utils/CloseButton.svelte';
package/index.js CHANGED
@@ -143,5 +143,14 @@ export { default as TimelineItemVertical } from './timelines/TimelineItemVertica
143
143
  export { default as Toast } from './toasts/Toast.svelte';
144
144
  // Tooltips
145
145
  export { default as Tooltip } from './tooltips/Tooltip.svelte';
146
+ // Typography
147
+ export { default as A } from './typography/A.svelte';
148
+ export { default as Heading } from './typography/Heading.svelte';
149
+ export { default as Highlight } from './typography/Highlight.svelte';
150
+ export { default as Mark } from './typography/Mark.svelte';
151
+ export { default as P } from './typography/P.svelte';
152
+ export { default as Secondary } from './typography/Secondary.svelte';
153
+ export { default as TextGradient } from './typography/TextGradient.svelte';
154
+ export { default as Underline } from './typography/Underline.svelte';
146
155
  // utils
147
156
  export { default as CloseButton } from './utils/CloseButton.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.25.6",
3
+ "version": "0.25.9",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -12,16 +12,13 @@
12
12
  "homepage": "https://flowbite-svelte.com/",
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "@floating-ui/dom": "^1.0.1",
16
15
  "@playwright/test": "^1.25.0",
17
- "@popperjs/core": "^2.11.6",
18
16
  "@sveltejs/adapter-auto": "next",
19
17
  "@sveltejs/kit": "1.0.0-next.420",
20
18
  "@sveltejs/package": "1.0.0-next.1",
21
19
  "@typescript-eslint/eslint-plugin": "^5.33.0",
22
20
  "@typescript-eslint/parser": "^5.33.0",
23
21
  "autoprefixer": "^10.4.8",
24
- "classnames": "^2.3.1",
25
22
  "createprops": "^0.4.9",
26
23
  "eslint": "^8.21.0",
27
24
  "eslint-config-prettier": "^8.5.0",
@@ -35,7 +32,6 @@
35
32
  "svelte": "^3.49.0",
36
33
  "svelte-check": "^2.8.0",
37
34
  "svelte-flag-icons": "^0.1.1",
38
- "svelte-heros": "^2.3.3",
39
35
  "svelte-preprocess": "^4.10.7",
40
36
  "svelte-sidebar-menu": "^0.8.11",
41
37
  "svelte2tsx": "^0.5.13",
@@ -85,7 +81,11 @@
85
81
  "url": "https://github.com/themesberg/flowbite-svelte"
86
82
  },
87
83
  "dependencies": {
88
- "flowbite": "^1.5.2"
84
+ "@floating-ui/dom": "^1.0.1",
85
+ "@popperjs/core": "^2.11.6",
86
+ "classnames": "^2.3.1",
87
+ "flowbite": "^1.5.2",
88
+ "svelte-heros": "^2.3.3"
89
89
  },
90
90
  "engines": {
91
91
  "npm": ">=7.0.0",
@@ -222,6 +222,14 @@
222
222
  "./toasts/Toast.svelte": "./toasts/Toast.svelte",
223
223
  "./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
224
224
  "./types": "./types.js",
225
+ "./typography/A.svelte": "./typography/A.svelte",
226
+ "./typography/Heading.svelte": "./typography/Heading.svelte",
227
+ "./typography/Highlight.svelte": "./typography/Highlight.svelte",
228
+ "./typography/Mark.svelte": "./typography/Mark.svelte",
229
+ "./typography/P.svelte": "./typography/P.svelte",
230
+ "./typography/Secondary.svelte": "./typography/Secondary.svelte",
231
+ "./typography/TextGradient.svelte": "./typography/TextGradient.svelte",
232
+ "./typography/Underline.svelte": "./typography/Underline.svelte",
225
233
  "./utils/CloseButton.svelte": "./utils/CloseButton.svelte",
226
234
  "./utils/Popper.svelte": "./utils/Popper.svelte",
227
235
  "./utils/clickOutside": "./utils/clickOutside.js",
@@ -1,10 +1,22 @@
1
1
  <script>import Popper from '../utils/Popper.svelte';
2
2
  import classNames from 'classnames';
3
+ export let title = '';
3
4
  let popoverClass;
4
- $: popoverClass = classNames('border border-gray-200 rounded-lg dark:border-gray-700 bg-white dark:bg-gray-800', $$props.class);
5
+ $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800', 'text-gray-500 dark:text-gray-400', 'border border-gray-200 dark:border-gray-700', $$props.class);
5
6
  </script>
6
7
 
7
8
  <Popper activeContent={true} {...$$restProps} class={popoverClass} on:show>
8
9
  <slot name="trigger" slot="trigger" />
9
- <slot />
10
+ {#if $$slots.title || title}
11
+ <div
12
+ class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700"
13
+ >
14
+ <slot name="title">
15
+ <h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
16
+ </slot>
17
+ </div>
18
+ {/if}
19
+ <div class="py-2 px-3">
20
+ <slot />
21
+ </div>
10
22
  </Popper>
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
+ title?: string;
5
6
  };
6
7
  events: {
7
8
  show: CustomEvent<any>;
@@ -12,6 +13,7 @@ declare const __propDef: {
12
13
  trigger: {
13
14
  slot: string;
14
15
  };
16
+ title: {};
15
17
  default: {};
16
18
  };
17
19
  };
@@ -0,0 +1,9 @@
1
+ <script>import classNames from 'classnames';
2
+ export let href = '#';
3
+ export let textColor = 'text-blue-600 dark:text-blue-500';
4
+ export let aClass = 'inline-flex items-center text-lg hover:underline';
5
+ </script>
6
+
7
+ <a {href} class={classNames(aClass, textColor, $$props.class)}>
8
+ <slot />
9
+ </a>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ href?: string;
6
+ textColor?: string;
7
+ aClass?: string;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export declare type AProps = typeof __propDef.props;
17
+ export declare type AEvents = typeof __propDef.events;
18
+ export declare type ASlots = typeof __propDef.slots;
19
+ export default class A extends SvelteComponentTyped<AProps, AEvents, ASlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,20 @@
1
+ <script>import classNames from 'classnames';
2
+ export let tag = 'h1';
3
+ export let textColor = 'text-gray-900 dark:text-white';
4
+ export let customSize;
5
+ const textSizes = {
6
+ h1: 'text-5xl font-extrabold',
7
+ h2: 'text-4xl font-bold',
8
+ h3: 'text-3xl font-bold',
9
+ h4: 'text-2xl font-bold',
10
+ h5: 'text-xl font-bold',
11
+ h6: 'text-lg font-bold'
12
+ };
13
+ </script>
14
+
15
+ <svelte:element
16
+ this={tag}
17
+ class={classNames(customSize ? customSize : textSizes[tag], textColor, $$props.class)}
18
+ >
19
+ <slot />
20
+ </svelte:element>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
6
+ textColor?: string;
7
+ customSize: string;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export declare type HeadingProps = typeof __propDef.props;
17
+ export declare type HeadingEvents = typeof __propDef.events;
18
+ export declare type HeadingSlots = typeof __propDef.slots;
19
+ export default class Heading extends SvelteComponentTyped<HeadingProps, HeadingEvents, HeadingSlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import classNames from 'classnames';
2
+ export let textColor = 'text-blue-600 dark:text-blue-500';
3
+ </script>
4
+
5
+ <span class={classNames(textColor, $$props.class)}>
6
+ <slot />
7
+ </span>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ textColor?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type HighlightProps = typeof __propDef.props;
15
+ export declare type HighlightEvents = typeof __propDef.events;
16
+ export declare type HighlightSlots = typeof __propDef.slots;
17
+ export default class Highlight extends SvelteComponentTyped<HighlightProps, HighlightEvents, HighlightSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,9 @@
1
+ <script>import classNames from 'classnames';
2
+ export let textColor = 'text-white dark:bg-blue-500';
3
+ export let bgColor = 'bg-blue-600';
4
+ export let markClass = 'px-2 rounded';
5
+ </script>
6
+
7
+ <mark class={classNames(markClass, bgColor, textColor, $$props.class)}>
8
+ <slot />
9
+ </mark>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ textColor?: string;
6
+ bgColor?: string;
7
+ markClass?: string;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export declare type MarkProps = typeof __propDef.props;
17
+ export declare type MarkEvents = typeof __propDef.events;
18
+ export declare type MarkSlots = typeof __propDef.slots;
19
+ export default class Mark extends SvelteComponentTyped<MarkProps, MarkEvents, MarkSlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,9 @@
1
+ <script>import classNames from 'classnames';
2
+ export let textColor = 'text-gray-500 dark:text-gray-400';
3
+ export let size = 'text-lg';
4
+ export let pClass = 'font-normal';
5
+ </script>
6
+
7
+ <p class={classNames(pClass, size, textColor, $$props.class)}>
8
+ <slot />
9
+ </p>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ textColor?: string;
6
+ size?: string;
7
+ pClass?: string;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export declare type PProps = typeof __propDef.props;
17
+ export declare type PEvents = typeof __propDef.events;
18
+ export declare type PSlots = typeof __propDef.slots;
19
+ export default class P extends SvelteComponentTyped<PProps, PEvents, PSlots> {
20
+ }
21
+ export {};
@@ -0,0 +1,8 @@
1
+ <script>import classNames from 'classnames';
2
+ export let textColor = 'text-gray-500 dark:text-gray-400';
3
+ export let secondaryClass = 'font-semibold';
4
+ </script>
5
+
6
+ <small class={classNames(textColor, secondaryClass, $$props.class)}>
7
+ <slot />
8
+ </small>
@@ -0,0 +1,20 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ textColor?: string;
6
+ secondaryClass?: string;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {
12
+ default: {};
13
+ };
14
+ };
15
+ export declare type SecondaryProps = typeof __propDef.props;
16
+ export declare type SecondaryEvents = typeof __propDef.events;
17
+ export declare type SecondarySlots = typeof __propDef.slots;
18
+ export default class Secondary extends SvelteComponentTyped<SecondaryProps, SecondaryEvents, SecondarySlots> {
19
+ }
20
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import classNames from 'classnames';
2
+ export let gradientClass = 'text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400';
3
+ </script>
4
+
5
+ <span class={classNames(gradientClass, $$props.class)}>
6
+ <slot />
7
+ </span>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ gradientClass?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type TextGradientProps = typeof __propDef.props;
15
+ export declare type TextGradientEvents = typeof __propDef.events;
16
+ export declare type TextGradientSlots = typeof __propDef.slots;
17
+ export default class TextGradient extends SvelteComponentTyped<TextGradientProps, TextGradientEvents, TextGradientSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,7 @@
1
+ <script>import classNames from 'classnames';
2
+ export let underlineClass = 'underline underline-offset-3 decoration-8 decoration-blue-400 dark:decoration-blue-600';
3
+ </script>
4
+
5
+ <span class={classNames(underlineClass, $$props.class)}>
6
+ <slot />
7
+ </span>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ underlineClass?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type UnderlineProps = typeof __propDef.props;
15
+ export declare type UnderlineEvents = typeof __propDef.events;
16
+ export declare type UnderlineSlots = typeof __propDef.slots;
17
+ export default class Underline extends SvelteComponentTyped<UnderlineProps, UnderlineEvents, UnderlineSlots> {
18
+ }
19
+ export {};
@@ -21,7 +21,9 @@ const showHandler = (ev) => {
21
21
  };
22
22
  const hideHandler = (ev) => {
23
23
  if (activeContent)
24
- setTimeout(() => triggerEl.matches(':hover') || contentEl.matches(':hover') || (open = false), 100);
24
+ setTimeout(() => (!clickable && (triggerEl.matches(':hover') || contentEl.matches(':hover'))) ||
25
+ contentEl.contains(document.activeElement) ||
26
+ (open = false), 100);
25
27
  else
26
28
  open = false;
27
29
  };
@@ -55,7 +57,7 @@ let divClass;
55
57
  $: divClass = classNames('z-10', animation && `transition-opacity ${animation}`, open ? 'visible opacity-100' : 'invisible opacity-0', $$props.class);
56
58
  </script>
57
59
 
58
- <span
60
+ <div
59
61
  bind:this={triggerEl}
60
62
  on:focusin={showHandler}
61
63
  on:focusout={hideHandler}
@@ -65,14 +67,14 @@ $: divClass = classNames('z-10', animation && `transition-opacity ${animation}`,
65
67
  class="inline-block"
66
68
  >
67
69
  <slot name="trigger" />
68
- </span>
70
+ </div>
69
71
  <div
70
72
  bind:this={contentEl}
71
73
  role="tooltip"
72
74
  tabindex={activeContent ? -1 : undefined}
73
75
  class={divClass}
74
- on:focus={activeContent ? showHandler : undefined}
75
- on:blur={activeContent ? hideHandler : undefined}
76
+ on:focusin={activeContent ? showHandler : undefined}
77
+ on:focusout={activeContent ? hideHandler : undefined}
76
78
  on:mouseenter={activeContent && !clickable ? showHandler : undefined}
77
79
  on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
78
80
  >