@ims360/svelte-ivory 0.0.21 → 0.0.22

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.
@@ -5,5 +5,5 @@ export { default as Modal, type ModalProps } from './modal/Modal.svelte';
5
5
  export { default as Popover } from './popover/Popover.svelte';
6
6
  export { default as Portal, setConfig, type PortalConfig } from './portal/Portal.svelte';
7
7
  export { default as Tabs } from './tabs/index';
8
- export { default as Tooltip } from './tooltip/Tooltip.svelte';
8
+ export { default as Tooltip, type Props as TooltipProps } from './tooltip/Tooltip.svelte';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,KAAK,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" module>
2
+ import type { IvoryComponent } from '../../../types';
2
3
  import clsx from 'clsx';
3
4
  import type { Snippet } from 'svelte';
4
5
  import type { ClassValue } from 'svelte/elements';
@@ -6,16 +7,12 @@
6
7
  import Popover, { type PopoverPlacement } from '../popover/Popover.svelte';
7
8
  import Portal from '../portal/Portal.svelte';
8
9
 
9
- export interface Props {
10
+ export interface Props extends IvoryComponent<HTMLElement> {
10
11
  children?: Snippet;
11
12
  /** The content of the tooltip */
12
13
  tooltip: string | Snippet;
13
- /** The class of the element that triggers the tooltip */
14
- class?: ClassValue;
15
14
  /** The class of the tooltip itself */
16
15
  tooltipClass?: ClassValue;
17
- style?: string;
18
- onclick?: (e: Event) => void;
19
16
  /** If the href is set, the resulting element will be a link to the href */
20
17
  href?: string;
21
18
  /**
@@ -37,13 +34,11 @@
37
34
  let {
38
35
  children,
39
36
  tooltip,
40
- class: clazz,
41
- style,
42
- onclick,
43
37
  href,
44
38
  timeout = 500,
45
39
  tooltipClass,
46
- placement = 'top'
40
+ placement = 'top',
41
+ ...rest
47
42
  }: Props = $props();
48
43
 
49
44
  let target = $state<HTMLElement>();
@@ -77,14 +72,12 @@
77
72
  <!-- svelte-ignore a11y_no_static_element_interactions -->
78
73
  <svelte:element
79
74
  this={href ? 'a' : onclick ? 'button' : 'div'}
80
- {href}
81
75
  type={onclick ? 'button' : undefined}
82
- class={clazz}
76
+ {...rest}
77
+ {href}
83
78
  bind:this={target}
84
79
  {onmouseenter}
85
80
  {onmouseleave}
86
- {style}
87
- {onclick}
88
81
  >
89
82
  {@render children?.()}
90
83
  </svelte:element>
@@ -1,16 +1,13 @@
1
+ import type { IvoryComponent } from '../../../types';
1
2
  import type { Snippet } from 'svelte';
2
3
  import type { ClassValue } from 'svelte/elements';
3
4
  import { type PopoverPlacement } from '../popover/Popover.svelte';
4
- export interface Props {
5
+ export interface Props extends IvoryComponent<HTMLElement> {
5
6
  children?: Snippet;
6
7
  /** The content of the tooltip */
7
8
  tooltip: string | Snippet;
8
- /** The class of the element that triggers the tooltip */
9
- class?: ClassValue;
10
9
  /** The class of the tooltip itself */
11
10
  tooltipClass?: ClassValue;
12
- style?: string;
13
- onclick?: (e: Event) => void;
14
11
  /** If the href is set, the resulting element will be a link to the href */
15
12
  href?: string;
16
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tooltip/Tooltip.svelte.ts"],"names":[],"mappings":"AAII,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG3E,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,yDAAyD;IACzD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,sCAAsC;IACtC,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAkEL,kEAAkE;AAClE,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Tooltip.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tooltip/Tooltip.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG3E,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,WAAW,CAAC;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,sCAAsC;IACtC,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAgEL,kEAAkE;AAClE,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export { type IvoryComponent } from './types';
1
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
2
1
  // Reexport your entry components here
2
+ export {} from './types';
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ export interface IvoryComponent<RootElement extends EventTarget> extends HTMLAttributes<RootElement> {
3
+ }
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,MAAM,WAAW,cAAc,CAAC,WAAW,SAAS,WAAW,CAC3D,SAAQ,cAAc,CAAC,WAAW,CAAC;CAAG"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ims360/svelte-ivory",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],
@@ -5,4 +5,4 @@ export { default as Modal, type ModalProps } from './modal/Modal.svelte';
5
5
  export { default as Popover } from './popover/Popover.svelte';
6
6
  export { default as Portal, setConfig, type PortalConfig } from './portal/Portal.svelte';
7
7
  export { default as Tabs } from './tabs/index';
8
- export { default as Tooltip } from './tooltip/Tooltip.svelte';
8
+ export { default as Tooltip, type Props as TooltipProps } from './tooltip/Tooltip.svelte';
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" module>
2
+ import type { IvoryComponent } from '$lib/types';
2
3
  import clsx from 'clsx';
3
4
  import type { Snippet } from 'svelte';
4
5
  import type { ClassValue } from 'svelte/elements';
@@ -6,16 +7,12 @@
6
7
  import Popover, { type PopoverPlacement } from '../popover/Popover.svelte';
7
8
  import Portal from '../portal/Portal.svelte';
8
9
 
9
- export interface Props {
10
+ export interface Props extends IvoryComponent<HTMLElement> {
10
11
  children?: Snippet;
11
12
  /** The content of the tooltip */
12
13
  tooltip: string | Snippet;
13
- /** The class of the element that triggers the tooltip */
14
- class?: ClassValue;
15
14
  /** The class of the tooltip itself */
16
15
  tooltipClass?: ClassValue;
17
- style?: string;
18
- onclick?: (e: Event) => void;
19
16
  /** If the href is set, the resulting element will be a link to the href */
20
17
  href?: string;
21
18
  /**
@@ -37,13 +34,11 @@
37
34
  let {
38
35
  children,
39
36
  tooltip,
40
- class: clazz,
41
- style,
42
- onclick,
43
37
  href,
44
38
  timeout = 500,
45
39
  tooltipClass,
46
- placement = 'top'
40
+ placement = 'top',
41
+ ...rest
47
42
  }: Props = $props();
48
43
 
49
44
  let target = $state<HTMLElement>();
@@ -77,14 +72,12 @@
77
72
  <!-- svelte-ignore a11y_no_static_element_interactions -->
78
73
  <svelte:element
79
74
  this={href ? 'a' : onclick ? 'button' : 'div'}
80
- {href}
81
75
  type={onclick ? 'button' : undefined}
82
- class={clazz}
76
+ {...rest}
77
+ {href}
83
78
  bind:this={target}
84
79
  {onmouseenter}
85
80
  {onmouseleave}
86
- {style}
87
- {onclick}
88
81
  >
89
82
  {@render children?.()}
90
83
  </svelte:element>
package/src/lib/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  // Reexport your entry components here
2
+ export { type IvoryComponent } from './types';
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
4
+ export interface IvoryComponent<RootElement extends EventTarget>
5
+ extends HTMLAttributes<RootElement> {}