@ims360/svelte-ivory 0.0.22 → 0.0.25

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.
Files changed (84) hide show
  1. package/dist/components/basic/checkbox/Checkbox.svelte +20 -18
  2. package/dist/components/basic/checkbox/Checkbox.svelte.d.ts +5 -4
  3. package/dist/components/basic/checkbox/Checkbox.svelte.d.ts.map +1 -1
  4. package/dist/components/basic/index.d.ts +2 -0
  5. package/dist/components/basic/index.d.ts.map +1 -1
  6. package/dist/components/basic/index.js +2 -0
  7. package/dist/components/basic/toggle/Toggle.svelte +11 -11
  8. package/dist/components/basic/toggle/Toggle.svelte.d.ts +4 -5
  9. package/dist/components/basic/toggle/Toggle.svelte.d.ts.map +1 -1
  10. package/dist/components/buttons/CopyToClipboardButton.svelte +6 -8
  11. package/dist/components/buttons/CopyToClipboardButton.svelte.d.ts +3 -2
  12. package/dist/components/buttons/CopyToClipboardButton.svelte.d.ts.map +1 -1
  13. package/dist/components/layout/drawer/Drawer.svelte +13 -8
  14. package/dist/components/layout/drawer/Drawer.svelte.d.ts +4 -3
  15. package/dist/components/layout/drawer/Drawer.svelte.d.ts.map +1 -1
  16. package/dist/components/layout/heading/Heading.svelte +8 -6
  17. package/dist/components/layout/heading/Heading.svelte.d.ts +3 -4
  18. package/dist/components/layout/heading/Heading.svelte.d.ts.map +1 -1
  19. package/dist/components/layout/heading/index.d.ts +1 -1
  20. package/dist/components/layout/hiddenBackground/HiddenBackground.svelte +13 -7
  21. package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts +4 -5
  22. package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts.map +1 -1
  23. package/dist/components/layout/hiddenBackground/index.d.ts +1 -1
  24. package/dist/components/layout/index.d.ts +11 -6
  25. package/dist/components/layout/index.d.ts.map +1 -1
  26. package/dist/components/layout/index.js +9 -4
  27. package/dist/components/layout/modal/Modal.svelte +13 -17
  28. package/dist/components/layout/modal/Modal.svelte.d.ts +2 -4
  29. package/dist/components/layout/modal/Modal.svelte.d.ts.map +1 -1
  30. package/dist/components/layout/modal/ModalTest.svelte +3 -10
  31. package/dist/components/layout/modal/ModalTest.svelte.d.ts +4 -6
  32. package/dist/components/layout/modal/ModalTest.svelte.d.ts.map +1 -1
  33. package/dist/components/layout/popover/Popover.svelte +10 -12
  34. package/dist/components/layout/popover/Popover.svelte.d.ts +4 -8
  35. package/dist/components/layout/popover/Popover.svelte.d.ts.map +1 -1
  36. package/dist/components/layout/portal/Portal.svelte +10 -9
  37. package/dist/components/layout/portal/Portal.svelte.d.ts +7 -6
  38. package/dist/components/layout/portal/Portal.svelte.d.ts.map +1 -1
  39. package/dist/components/layout/tabs/Tab.svelte +7 -7
  40. package/dist/components/layout/tabs/Tab.svelte.d.ts +4 -4
  41. package/dist/components/layout/tabs/Tab.svelte.d.ts.map +1 -1
  42. package/dist/components/layout/tabs/TabPanel.svelte +6 -4
  43. package/dist/components/layout/tabs/TabPanel.svelte.d.ts +3 -3
  44. package/dist/components/layout/tabs/TabPanel.svelte.d.ts.map +1 -1
  45. package/dist/components/layout/tabs/Tabs.svelte +13 -16
  46. package/dist/components/layout/tabs/Tabs.svelte.d.ts +6 -9
  47. package/dist/components/layout/tabs/Tabs.svelte.d.ts.map +1 -1
  48. package/dist/components/layout/tabs/index.d.ts +6 -21
  49. package/dist/components/layout/tabs/index.d.ts.map +1 -1
  50. package/dist/components/layout/tabs/index.js +3 -0
  51. package/dist/components/layout/tooltip/Tooltip.svelte +0 -1
  52. package/dist/components/layout/tooltip/Tooltip.svelte.d.ts.map +1 -1
  53. package/dist/components/table/plugins/search.svelte.d.ts +1 -1
  54. package/dist/components/table/plugins/search.svelte.d.ts.map +1 -1
  55. package/dist/components/table/plugins/search.svelte.js +0 -1
  56. package/dist/components/toast/Toast.svelte +22 -15
  57. package/dist/components/toast/Toast.svelte.d.ts +6 -5
  58. package/dist/components/toast/Toast.svelte.d.ts.map +1 -1
  59. package/dist/components/toast/index.d.ts +2 -2
  60. package/dist/components/toast/index.d.ts.map +1 -1
  61. package/dist/components/toast/toasts.svelte.d.ts +4 -4
  62. package/dist/components/toast/toasts.svelte.d.ts.map +1 -1
  63. package/package.json +1 -1
  64. package/src/lib/components/basic/checkbox/Checkbox.svelte +20 -18
  65. package/src/lib/components/basic/index.ts +2 -0
  66. package/src/lib/components/basic/toggle/Toggle.svelte +11 -11
  67. package/src/lib/components/buttons/CopyToClipboardButton.svelte +6 -8
  68. package/src/lib/components/layout/drawer/Drawer.svelte +13 -8
  69. package/src/lib/components/layout/heading/Heading.svelte +8 -6
  70. package/src/lib/components/layout/hiddenBackground/HiddenBackground.svelte +13 -7
  71. package/src/lib/components/layout/index.ts +17 -6
  72. package/src/lib/components/layout/modal/Modal.svelte +13 -17
  73. package/src/lib/components/layout/modal/ModalTest.svelte +3 -10
  74. package/src/lib/components/layout/popover/Popover.svelte +10 -12
  75. package/src/lib/components/layout/portal/Portal.svelte +10 -9
  76. package/src/lib/components/layout/tabs/Tab.svelte +7 -7
  77. package/src/lib/components/layout/tabs/TabPanel.svelte +6 -4
  78. package/src/lib/components/layout/tabs/Tabs.svelte +13 -16
  79. package/src/lib/components/layout/tabs/index.ts +3 -0
  80. package/src/lib/components/layout/tooltip/Tooltip.svelte +0 -1
  81. package/src/lib/components/table/plugins/search.svelte.ts +1 -3
  82. package/src/lib/components/toast/Toast.svelte +22 -15
  83. package/src/lib/components/toast/index.ts +2 -2
  84. package/src/lib/components/toast/toasts.svelte.ts +4 -4
@@ -1,7 +1,8 @@
1
+ import type { IvoryComponent } from '../../../types';
1
2
  import type { Snippet } from 'svelte';
2
3
  import type { ClassValue } from 'svelte/elements';
3
4
  /** Props for the modal, expose if you overwrite the defaults in a custom component */
4
- export interface ModalProps {
5
+ export interface ModalProps extends IvoryComponent<HTMLDivElement> {
5
6
  /** Class of the modal itself, does not apply to the inner div */
6
7
  class?: ClassValue;
7
8
  /** Class of the div wrapping the children */
@@ -10,8 +11,6 @@ export interface ModalProps {
10
11
  b_open: boolean;
11
12
  /** Content of the modal */
12
13
  children?: Snippet;
13
- /** Style applied to the */
14
- style?: string;
15
14
  /** If `true` the modal will not close when clicking outside of it */
16
15
  preventClosing?: boolean;
17
16
  /** Variant of the modal, applies styling to the header */
@@ -22,7 +21,6 @@ export type ModalVariant = 'success' | 'warning' | 'error' | 'info';
22
21
  interface Props extends ModalProps {
23
22
  /** If you don't want the title and close button to be included you can overwrite the default modal */
24
23
  modal?: Snippet;
25
- testId?: string;
26
24
  }
27
25
  /** A modal, comes with a title, close button and different variants per default. */
28
26
  declare const Modal: import("svelte").Component<Props, {}, "b_open">;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/Modal.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,sFAAsF;AACtF,MAAM,WAAW,UAAU;IACvB,iEAAiE;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,UAAU,KAAM,SAAQ,UAAU;IAC9B,sGAAsG;IACtG,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AA2EL,oFAAoF;AACpF,QAAA,MAAM,KAAK,iDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/Modal.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,iBAAiB,CAAC;AAIrE,sFAAsF;AACtF,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC9D,iEAAiE;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,UAAU,KAAM,SAAQ,UAAU;IAC9B,sGAAsG;IACtG,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AA+EL,oFAAoF;AACpF,QAAA,MAAM,KAAK,iDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -1,16 +1,9 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
- import Modal from './Modal.svelte';
2
+ import Modal, { type ModalProps } from './Modal.svelte';
4
3
 
5
- interface Props {
6
- open: boolean;
7
- testId: string;
8
- children: Snippet;
9
- }
10
-
11
- let { open, ...props }: Props = $props();
4
+ let { open, ...props }: ModalProps & { open: boolean } = $props();
12
5
 
13
6
  let b_open = $state(open);
14
7
  </script>
15
8
 
16
- <Modal bind:b_open {...props} />
9
+ <Modal {...props} bind:b_open />
@@ -1,10 +1,8 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
1
+ import { type ModalProps } from './Modal.svelte';
2
+ type $$ComponentProps = ModalProps & {
3
3
  open: boolean;
4
- testId: string;
5
- children: Snippet;
6
- }
7
- declare const ModalTest: import("svelte").Component<Props, {}, "">;
4
+ };
5
+ declare const ModalTest: import("svelte").Component<$$ComponentProps, {}, "">;
8
6
  type ModalTest = ReturnType<typeof ModalTest>;
9
7
  export default ModalTest;
10
8
  //# sourceMappingURL=ModalTest.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalTest.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/ModalTest.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIlC,UAAU,KAAK;IACX,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB;AAeL,QAAA,MAAM,SAAS,2CAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ModalTest.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/ModalTest.svelte.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,UAAU,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAazD,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" module>
2
2
  import { browser } from '$app/environment';
3
+ import type { IvoryComponent } from '../../../types';
3
4
  import {
4
5
  autoPlacement,
5
6
  autoUpdate,
@@ -9,21 +10,15 @@
9
10
  type ComputePositionConfig
10
11
  } from '@floating-ui/dom';
11
12
  import clsx from 'clsx';
12
- import type { Snippet } from 'svelte';
13
- import type { ClassValue } from 'svelte/elements';
14
13
  import { twMerge } from 'tailwind-merge';
15
14
  import { clickOutside } from '../../../utils/actions/clickOutside';
16
15
 
17
16
  /** Possible placements for the popover */
18
17
  export type PopoverPlacement = ComputePositionConfig['placement'];
19
- </script>
20
18
 
21
- <script lang="ts">
22
- type Props = {
23
- class?: ClassValue;
19
+ export interface PopoverProps extends IvoryComponent<HTMLDivElement> {
24
20
  /** Whether the popover is open or not */
25
21
  b_open: boolean;
26
- style?: string;
27
22
  /** The element the popover will be positioned relative to */
28
23
  target: Element | undefined;
29
24
  /**
@@ -38,15 +33,16 @@
38
33
  onClickOutside?: (e: MouseEvent) => void;
39
34
  /** If set to `true`, the nested component will not be unmounted when the popover is closed */
40
35
  keepMounted?: boolean;
41
- children: Snippet;
42
36
  /**
43
37
  * Whether to place the popover automatically
44
38
  *
45
39
  * [Further reading](https://floating-ui.com/docs/autoPlacement)
46
40
  */
47
41
  autoplacement?: boolean;
48
- };
42
+ }
43
+ </script>
49
44
 
45
+ <script lang="ts">
50
46
  let {
51
47
  class: clazz,
52
48
  b_open = $bindable(false),
@@ -58,8 +54,9 @@
58
54
  },
59
55
  keepMounted = false,
60
56
  children,
61
- autoplacement
62
- }: Props = $props();
57
+ autoplacement,
58
+ ...rest
59
+ }: PopoverProps = $props();
63
60
 
64
61
  let style: string = $state('');
65
62
  let popover: HTMLDivElement | undefined = $state();
@@ -102,7 +99,8 @@
102
99
  style={style + ' ' + externalStyle}
103
100
  bind:this={popover}
104
101
  use:clickOutside={{ callback: onClickOutside, target }}
102
+ {...rest}
105
103
  >
106
- {@render children()}
104
+ {@render children?.()}
107
105
  </div>
108
106
  {/if}
@@ -1,13 +1,10 @@
1
+ import type { IvoryComponent } from '../../../types';
1
2
  import { type ComputePositionConfig } from '@floating-ui/dom';
2
- import type { Snippet } from 'svelte';
3
- import type { ClassValue } from 'svelte/elements';
4
3
  /** Possible placements for the popover */
5
4
  export type PopoverPlacement = ComputePositionConfig['placement'];
6
- type Props = {
7
- class?: ClassValue;
5
+ export interface PopoverProps extends IvoryComponent<HTMLDivElement> {
8
6
  /** Whether the popover is open or not */
9
7
  b_open: boolean;
10
- style?: string;
11
8
  /** The element the popover will be positioned relative to */
12
9
  target: Element | undefined;
13
10
  /**
@@ -22,16 +19,15 @@ type Props = {
22
19
  onClickOutside?: (e: MouseEvent) => void;
23
20
  /** If set to `true`, the nested component will not be unmounted when the popover is closed */
24
21
  keepMounted?: boolean;
25
- children: Snippet;
26
22
  /**
27
23
  * Whether to place the popover automatically
28
24
  *
29
25
  * [Further reading](https://floating-ui.com/docs/autoPlacement)
30
26
  */
31
27
  autoplacement?: boolean;
32
- };
28
+ }
33
29
  /** A popover, positions itself relative to a target element. */
34
- declare const Popover: import("svelte").Component<Props, {}, "b_open">;
30
+ declare const Popover: import("svelte").Component<PopoverProps, {}, "b_open">;
35
31
  type Popover = ReturnType<typeof Popover>;
36
32
  export default Popover;
37
33
  //# sourceMappingURL=Popover.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/popover/Popover.svelte.ts"],"names":[],"mappings":"AAII,OAAO,EAMH,KAAK,qBAAqB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAElE,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,8FAA8F;IAC9F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AA4DN,gEAAgE;AAChE,QAAA,MAAM,OAAO,iDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Popover.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/popover/Popover.svelte.ts"],"names":[],"mappings":"AAII,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAMH,KAAK,qBAAqB,EAC7B,MAAM,kBAAkB,CAAC;AAK1B,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAElE,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,8FAA8F;IAC9F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AA4DL,gEAAgE;AAChE,QAAA,MAAM,OAAO,wDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -1,4 +1,13 @@
1
1
  <script lang="ts" module>
2
+ import type { IvoryComponent } from '../../../types';
3
+ import type { Snippet } from 'svelte';
4
+ import { portal } from '../../../utils/actions/index';
5
+
6
+ export interface PortalProps extends IvoryComponent<HTMLDivElement> {
7
+ children: Snippet;
8
+ target?: string | HTMLElement;
9
+ }
10
+
2
11
  export interface PortalConfig {
3
12
  defaultTarget: string;
4
13
  }
@@ -14,15 +23,7 @@
14
23
  </script>
15
24
 
16
25
  <script lang="ts">
17
- import type { Snippet } from 'svelte';
18
- import { portal } from '../../../utils/actions/index';
19
-
20
- interface Props {
21
- children: Snippet;
22
- target?: string | HTMLElement;
23
- }
24
-
25
- let { children, target }: Props = $props();
26
+ let { children, target }: PortalProps = $props();
26
27
  </script>
27
28
 
28
29
  <!--
@@ -1,12 +1,13 @@
1
- export interface PortalConfig {
2
- defaultTarget: string;
3
- }
4
- export declare function setConfig(newConfig: Partial<PortalConfig>): void;
1
+ import type { IvoryComponent } from '../../../types';
5
2
  import type { Snippet } from 'svelte';
6
- interface Props {
3
+ export interface PortalProps extends IvoryComponent<HTMLDivElement> {
7
4
  children: Snippet;
8
5
  target?: string | HTMLElement;
9
6
  }
7
+ export interface PortalConfig {
8
+ defaultTarget: string;
9
+ }
10
+ export declare function setConfig(newConfig: Partial<PortalConfig>): void;
10
11
  /**
11
12
  * A portal, renders its children in a different DOM element.
12
13
  *
@@ -14,7 +15,7 @@ interface Props {
14
15
  *
15
16
  * **Use sparingy as it can make the DOM structure confusing**
16
17
  */
17
- declare const Portal: import("svelte").Component<Props, {}, "">;
18
+ declare const Portal: import("svelte").Component<PortalProps, {}, "">;
18
19
  type Portal = ReturnType<typeof Portal>;
19
20
  export default Portal;
20
21
  //# sourceMappingURL=Portal.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/portal/Portal.svelte.ts"],"names":[],"mappings":"AAGI,MAAM,WAAW,YAAY;IACzB,aAAa,EAAE,MAAM,CAAC;CACzB;AAOD,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,QAEzD;AAGL,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIlC,UAAU,KAAK;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CACjC;AAkBL;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,2CAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Portal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/portal/Portal.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IACzB,aAAa,EAAE,MAAM,CAAC;CACzB;AAOD,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,QAEzD;AAeL;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -1,5 +1,6 @@
1
- <script lang="ts">
1
+ <script lang="ts" module>
2
2
  import { page } from '$app/state';
3
+ import type { IvoryComponent } from '../../../types';
3
4
  import { pseudoRandomId } from '../../../utils/functions/index';
4
5
  import clsx from 'clsx';
5
6
  import { onMount, type Snippet } from 'svelte';
@@ -7,7 +8,7 @@
7
8
  import { twMerge } from 'tailwind-merge';
8
9
  import { getTabContext } from './Tabs.svelte';
9
10
 
10
- type Props = {
11
+ export interface TabProps extends Omit<IvoryComponent<HTMLElement>, 'children'> {
11
12
  class?: ClassValue | ((selected: boolean) => ClassValue);
12
13
  id?: string | undefined;
13
14
  /**
@@ -17,19 +18,19 @@
17
18
  */
18
19
  href?: string | undefined;
19
20
  children: Snippet<[{ selected: boolean }]>;
20
- testId?: string;
21
21
  /** If `href` is set, this can be used to highlight an active tab */
22
22
  active?: boolean;
23
- };
23
+ }
24
+ </script>
24
25
 
26
+ <script lang="ts">
25
27
  let {
26
28
  class: clazz = (selected: boolean) => [selected && 'text-primary-500 underline'],
27
29
  id,
28
30
  href,
29
31
  children,
30
- testId,
31
32
  active
32
- }: Props = $props();
33
+ }: TabProps = $props();
33
34
 
34
35
  const tab = pseudoRandomId('tab-');
35
36
  const tabs = getTabContext();
@@ -69,7 +70,6 @@
69
70
  }}
70
71
  type={href ? undefined : 'button'}
71
72
  {href}
72
- data-testid={testId}
73
73
  role="tab"
74
74
  tabindex="0"
75
75
  aria-selected={selected}
@@ -1,6 +1,7 @@
1
+ import type { IvoryComponent } from '../../../types';
1
2
  import { type Snippet } from 'svelte';
2
3
  import type { ClassValue } from 'svelte/elements';
3
- type Props = {
4
+ export interface TabProps extends Omit<IvoryComponent<HTMLElement>, 'children'> {
4
5
  class?: ClassValue | ((selected: boolean) => ClassValue);
5
6
  id?: string | undefined;
6
7
  /**
@@ -12,11 +13,10 @@ type Props = {
12
13
  children: Snippet<[{
13
14
  selected: boolean;
14
15
  }]>;
15
- testId?: string;
16
16
  /** If `href` is set, this can be used to highlight an active tab */
17
17
  active?: boolean;
18
- };
19
- declare const Tab: import("svelte").Component<Props, {}, "">;
18
+ }
19
+ declare const Tab: import("svelte").Component<TabProps, {}, "">;
20
20
  type Tab = ReturnType<typeof Tab>;
21
21
  export default Tab;
22
22
  //# sourceMappingURL=Tab.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/Tab.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK9C,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,UAAU,CAAC,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA4DN,QAAA,MAAM,GAAG,2CAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"Tab.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/Tab.svelte.ts"],"names":[],"mappings":"AAII,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC3E,KAAK,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,UAAU,CAAC,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3C,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAqDL,QAAA,MAAM,GAAG,8CAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
@@ -1,14 +1,16 @@
1
- <script lang="ts">
1
+ <script lang="ts" module>
2
2
  import { pseudoRandomId } from '../../../utils/functions/index';
3
3
  import { type Snippet } from 'svelte';
4
4
  import { getTabContext } from './Tabs.svelte';
5
5
 
6
- type Props = {
6
+ export interface TabPanelProps {
7
7
  keepMounted?: boolean;
8
8
  children: Snippet<[{ visible: boolean }]>;
9
- };
9
+ }
10
+ </script>
10
11
 
11
- let { keepMounted = false, children }: Props = $props();
12
+ <script lang="ts">
13
+ let { keepMounted = false, children }: TabPanelProps = $props();
12
14
 
13
15
  const panel = pseudoRandomId('tab-panel-');
14
16
  const tabs = getTabContext();
@@ -1,11 +1,11 @@
1
1
  import { type Snippet } from 'svelte';
2
- type Props = {
2
+ export interface TabPanelProps {
3
3
  keepMounted?: boolean;
4
4
  children: Snippet<[{
5
5
  visible: boolean;
6
6
  }]>;
7
- };
8
- declare const TabPanel: import("svelte").Component<Props, {}, "">;
7
+ }
8
+ declare const TabPanel: import("svelte").Component<TabPanelProps, {}, "">;
9
9
  type TabPanel = ReturnType<typeof TabPanel>;
10
10
  export default TabPanel;
11
11
  //# sourceMappingURL=TabPanel.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/TabPanel.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIlC,KAAK,KAAK,GAAG;IACT,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CAC7C,CAAC;AAuBN,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TabPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/TabPanel.svelte.ts"],"names":[],"mappings":"AAII,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CAC7C;AAqBL,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -1,33 +1,30 @@
1
1
  <script lang="ts" module>
2
- import { getContext, onDestroy, setContext, type Snippet } from 'svelte';
3
- import type { ClassValue } from 'svelte/elements';
2
+ import type { IvoryComponent } from '../../../types';
3
+ import { getContext, onDestroy, setContext } from 'svelte';
4
4
 
5
- interface TabContext {
5
+ export interface TabsProps extends IvoryComponent<HTMLDivElement> {
6
+ b_index?: number;
7
+ }
8
+
9
+ export interface TabContext {
6
10
  registerTab: (tab: string) => void;
7
11
  registerPanel: (panel: string) => void;
8
12
  selectedTab: string | undefined;
9
13
  tabs: string[];
10
14
  selectedPanel: string | undefined;
11
15
  }
12
- const TABS = {};
13
16
 
17
+ const CONTEXT = {};
14
18
  function setTabContext(context: TabContext) {
15
- setContext<TabContext>(TABS, context);
19
+ setContext<TabContext>(CONTEXT, context);
16
20
  }
17
-
18
21
  export function getTabContext() {
19
- return getContext<TabContext>(TABS);
22
+ return getContext<TabContext>(CONTEXT);
20
23
  }
21
24
  </script>
22
25
 
23
26
  <script lang="ts">
24
- type Props = {
25
- class?: ClassValue;
26
- children: Snippet;
27
- b_index?: number;
28
- };
29
-
30
- let { class: clazz = '', children, b_index = $bindable(0) }: Props = $props();
27
+ let { children, b_index = $bindable(0), ...rest }: TabsProps = $props();
31
28
 
32
29
  let allTabs: string[] = $state([]);
33
30
  let panels: string[] = $state([]);
@@ -81,6 +78,6 @@
81
78
  });
82
79
  </script>
83
80
 
84
- <div class={[clazz]}>
85
- {@render children()}
81
+ <div {...rest}>
82
+ {@render children?.()}
86
83
  </div>
@@ -1,6 +1,8 @@
1
- import { type Snippet } from 'svelte';
2
- import type { ClassValue } from 'svelte/elements';
3
- interface TabContext {
1
+ import type { IvoryComponent } from '../../../types';
2
+ export interface TabsProps extends IvoryComponent<HTMLDivElement> {
3
+ b_index?: number;
4
+ }
5
+ export interface TabContext {
4
6
  registerTab: (tab: string) => void;
5
7
  registerPanel: (panel: string) => void;
6
8
  selectedTab: string | undefined;
@@ -8,12 +10,7 @@ interface TabContext {
8
10
  selectedPanel: string | undefined;
9
11
  }
10
12
  export declare function getTabContext(): TabContext;
11
- type Props = {
12
- class?: ClassValue;
13
- children: Snippet;
14
- b_index?: number;
15
- };
16
- declare const Tabs: import("svelte").Component<Props, {
13
+ declare const Tabs: import("svelte").Component<TabsProps, {
17
14
  forward: () => void;
18
15
  back: () => void;
19
16
  }, "b_index">;
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/Tabs.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,EAAqC,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,UAAU,UAAU;IAChB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAOD,wBAAgB,aAAa,eAE5B;AAED,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkEN,QAAA,MAAM,IAAI;;;aAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Tabs.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/Tabs.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACvB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAMD,wBAAgB,aAAa,eAE5B;AAiEL,QAAA,MAAM,IAAI;;;aAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -1,27 +1,12 @@
1
- declare const Tabs: import("svelte").Component<{
2
- class?: import("svelte/elements").ClassValue;
3
- children: import("svelte").Snippet;
4
- b_index?: number;
5
- }, {
1
+ declare const Tabs: import("svelte").Component<import("./Tabs.svelte").TabsProps, {
6
2
  forward: () => void;
7
3
  back: () => void;
8
4
  }, "b_index"> & {
9
- Tab: import("svelte").Component<{
10
- class?: import("svelte/elements").ClassValue | ((selected: boolean) => import("svelte/elements").ClassValue);
11
- id?: string | undefined;
12
- href?: string | undefined;
13
- children: import("svelte").Snippet<[{
14
- selected: boolean;
15
- }]>;
16
- testId?: string;
17
- active?: boolean;
18
- }, {}, "">;
19
- Panel: import("svelte").Component<{
20
- keepMounted?: boolean;
21
- children: import("svelte").Snippet<[{
22
- visible: boolean;
23
- }]>;
24
- }, {}, "">;
5
+ Tab: import("svelte").Component<import("./Tab.svelte").TabProps, {}, "">;
6
+ Panel: import("svelte").Component<import("./TabPanel.svelte").TabPanelProps, {}, "">;
25
7
  };
26
8
  export default Tabs;
9
+ export { type TabProps } from './Tab.svelte';
10
+ export { type TabPanelProps } from './TabPanel.svelte';
11
+ export { getTabContext, type TabContext, type TabsProps } from './Tabs.svelte';
27
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAGR,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;;;;;CAGR,CAAC;AAEH,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -6,3 +6,6 @@ const Tabs = Object.assign(TabsComponent, {
6
6
  Panel: TabPanel
7
7
  });
8
8
  export default Tabs;
9
+ export {} from './Tab.svelte';
10
+ export {} from './TabPanel.svelte';
11
+ export { getTabContext } from './Tabs.svelte';
@@ -67,7 +67,6 @@
67
67
  @component
68
68
  Shows additional information when hovering over an element.
69
69
  -->
70
-
71
70
  <!-- Ignoring this error is fine since it's a false positive -->
72
71
  <!-- svelte-ignore a11y_no_static_element_interactions -->
73
72
  <svelte:element
@@ -1 +1 @@
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"}
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;AA+DL,kEAAkE;AAClE,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { TablePlugin, TableRow } from '../table.svelte';
1
+ import type { TablePlugin, TableRow } from '../';
2
2
  interface SearchConfig<T extends TableRow<T>> {
3
3
  search: string;
4
4
  matches: (row: T) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"search.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/table/plugins/search.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CA+BzF;AAED,wFAAwF;AACxF,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EACxC,OAAO,CAAC,EAAE,EACV,cAAc,MAAM,EACpB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO;;;CA6B7C,CAAC"}
1
+ {"version":3,"file":"search.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/table/plugins/search.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEjD,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CA+BzF;AAED,wFAAwF;AACxF,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EACxC,OAAO,CAAC,EAAE,EACV,cAAc,MAAM,EACpB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO;;;CA2B7C,CAAC"}
@@ -36,7 +36,6 @@ export const search = (nodes, searchString, stringsMatch) => {
36
36
  const matches = stringsMatch(node, search);
37
37
  const intermediateNode = node.children?.some((c) => recursor(c, matches || childOfMatch)) ?? false;
38
38
  if (intermediateNode) {
39
- console.log('intermediateNode', node);
40
39
  expanded.add(node.id);
41
40
  }
42
41
  else if (!childOfMatch) {
@@ -1,3 +1,11 @@
1
+ <script lang="ts" module>
2
+ export interface Props {
3
+ class?: ClassValue;
4
+ children?: Snippet<[toast: ToastSettings & { close: () => void }]>;
5
+ duration?: number;
6
+ }
7
+ </script>
8
+
1
9
  <!--
2
10
  @component
3
11
  Renders the toasts that have been triggered by the `Toasts` store.
@@ -12,12 +20,7 @@
12
20
  import { fly, scale } from 'svelte/transition';
13
21
  import { Toasts, type ToastSettings } from './toasts.svelte';
14
22
 
15
- type Props = {
16
- class?: ClassValue;
17
- children?: Snippet<[toast: ToastSettings & { close: () => void }]>;
18
- };
19
-
20
- let { class: clazz = 'px-2 pb-2', children }: Props = $props();
23
+ let { class: clazz = 'px-2 pb-2', children, duration = 200 }: Props = $props();
21
24
 
22
25
  function getIcon(
23
26
  variant: 'info' | 'success' | 'warning' | 'error',
@@ -51,9 +54,9 @@
51
54
 
52
55
  <!-- svelte-ignore a11y_no_static_element_interactions -->
53
56
  <div
54
- in:fly={{ y: '-100%', duration: 300 }}
55
- out:scale={{ duration: 300 }}
56
- animate:flip={{ duration: 300 }}
57
+ in:fly={{ y: '-100%', duration }}
58
+ out:scale={{ duration }}
59
+ animate:flip={{ duration }}
57
60
  onpointerenter={() => {
58
61
  Toasts.freeze(toast.id);
59
62
  }}
@@ -71,10 +74,14 @@
71
74
  <div
72
75
  class={[
73
76
  'bg-opacity-85 flex flex-row items-center gap-4 rounded px-4 py-2 shadow-lg group-last:rounded-t-none',
74
- toast.variant === 'info' && 'preset-filled-primary-500',
75
- toast.variant === 'success' && 'preset-filled-success-500',
76
- toast.variant === 'warning' && 'preset-filled-warning-500',
77
- toast.variant === 'error' && 'preset-filled-error-500'
77
+ toast.variant === 'info' &&
78
+ 'bg-primary-200-800 text-primary-contrast-50-950',
79
+ toast.variant === 'success' &&
80
+ 'bg-success-200-800 text-success-contrast-50-950',
81
+ toast.variant === 'warning' &&
82
+ 'bg-warning-200-800 text-warning-contrast-50-950',
83
+ toast.variant === 'error' &&
84
+ 'bg-error-200-800 text-error-contrast-50-950'
78
85
  ]}
79
86
  >
80
87
  <VariantIcon />
@@ -87,9 +94,9 @@
87
94
  onclick={() => {
88
95
  Toasts.close(toast.id);
89
96
  }}
90
- class="transition-transform hover:rotate-90"
97
+ class="group"
91
98
  >
92
- <X />
99
+ <X size={20} class="stroke-1 transition-all group-hover:stroke-2" />
93
100
  </button>
94
101
  {/if}
95
102
  </div>