@ims360/svelte-ivory 0.1.15 → 0.2.0

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 (176) hide show
  1. package/README.md +0 -5
  2. package/dist/components/ai/AiMessage.svelte +2 -3
  3. package/dist/components/ai/AiMessage.svelte.d.ts.map +1 -1
  4. package/dist/components/ai/Chat.svelte +2 -3
  5. package/dist/components/ai/Chat.svelte.d.ts.map +1 -1
  6. package/dist/components/ai/Markdown.svelte +4 -7
  7. package/dist/components/ai/Markdown.svelte.d.ts.map +1 -1
  8. package/dist/components/ai/UserMessage.svelte +2 -3
  9. package/dist/components/ai/UserMessage.svelte.d.ts.map +1 -1
  10. package/dist/components/basic/checkbox/Checkbox.svelte +13 -11
  11. package/dist/components/basic/checkbox/Checkbox.svelte.d.ts.map +1 -1
  12. package/dist/components/basic/toggle/Toggle.svelte +5 -8
  13. package/dist/components/basic/toggle/Toggle.svelte.d.ts.map +1 -1
  14. package/dist/components/inputs/CheckboxInput.svelte +39 -0
  15. package/dist/components/inputs/CheckboxInput.svelte.d.ts +12 -0
  16. package/dist/components/inputs/CheckboxInput.svelte.d.ts.map +1 -0
  17. package/dist/components/inputs/ColorInput.svelte +25 -0
  18. package/dist/components/inputs/ColorInput.svelte.d.ts +5 -0
  19. package/dist/components/inputs/ColorInput.svelte.d.ts.map +1 -0
  20. package/dist/components/inputs/DateInput.svelte +11 -0
  21. package/dist/components/inputs/DateInput.svelte.d.ts +5 -0
  22. package/dist/components/inputs/DateInput.svelte.d.ts.map +1 -0
  23. package/dist/components/inputs/EmailInput.svelte +16 -0
  24. package/dist/components/inputs/EmailInput.svelte.d.ts +5 -0
  25. package/dist/components/inputs/EmailInput.svelte.d.ts.map +1 -0
  26. package/dist/components/inputs/FileInput.svelte +131 -0
  27. package/dist/components/inputs/FileInput.svelte.d.ts +11 -0
  28. package/dist/components/inputs/FileInput.svelte.d.ts.map +1 -0
  29. package/dist/components/inputs/Input.svelte +101 -0
  30. package/dist/components/inputs/Input.svelte.d.ts +48 -0
  31. package/dist/components/inputs/Input.svelte.d.ts.map +1 -0
  32. package/dist/components/inputs/NumberInput.svelte +17 -0
  33. package/dist/components/inputs/NumberInput.svelte.d.ts +10 -0
  34. package/dist/components/inputs/NumberInput.svelte.d.ts.map +1 -0
  35. package/dist/components/inputs/PasswordCreateInput.svelte +60 -0
  36. package/dist/components/inputs/PasswordCreateInput.svelte.d.ts +12 -0
  37. package/dist/components/inputs/PasswordCreateInput.svelte.d.ts.map +1 -0
  38. package/dist/components/inputs/PasswordInput.svelte +27 -0
  39. package/dist/components/inputs/PasswordInput.svelte.d.ts +10 -0
  40. package/dist/components/inputs/PasswordInput.svelte.d.ts.map +1 -0
  41. package/dist/components/inputs/TextInput.svelte +16 -0
  42. package/dist/components/inputs/TextInput.svelte.d.ts +7 -0
  43. package/dist/components/inputs/TextInput.svelte.d.ts.map +1 -0
  44. package/dist/components/inputs/ToggleInput.svelte +24 -0
  45. package/dist/components/inputs/ToggleInput.svelte.d.ts +5 -0
  46. package/dist/components/inputs/ToggleInput.svelte.d.ts.map +1 -0
  47. package/dist/components/inputs/index.d.ts +13 -0
  48. package/dist/components/inputs/index.d.ts.map +1 -1
  49. package/dist/components/inputs/index.js +13 -0
  50. package/dist/components/inputs/issues/FormIssues.svelte +35 -0
  51. package/dist/components/inputs/issues/FormIssues.svelte.d.ts +10 -0
  52. package/dist/components/inputs/issues/FormIssues.svelte.d.ts.map +1 -0
  53. package/dist/components/inputs/select/Select.svelte +69 -0
  54. package/dist/components/inputs/select/Select.svelte.d.ts +15 -0
  55. package/dist/components/inputs/select/Select.svelte.d.ts.map +1 -0
  56. package/dist/components/inputs/select/SelectOption.svelte +34 -0
  57. package/dist/components/inputs/select/SelectOption.svelte.d.ts +11 -0
  58. package/dist/components/inputs/select/SelectOption.svelte.d.ts.map +1 -0
  59. package/dist/components/layout/Heading.svelte +5 -4
  60. package/dist/components/layout/Heading.svelte.d.ts.map +1 -1
  61. package/dist/components/layout/dialog/Dialog.svelte +5 -8
  62. package/dist/components/layout/dialog/Dialog.svelte.d.ts.map +1 -1
  63. package/dist/components/layout/drawer/Drawer.svelte +7 -10
  64. package/dist/components/layout/drawer/Drawer.svelte.d.ts.map +1 -1
  65. package/dist/components/layout/index.d.ts +1 -2
  66. package/dist/components/layout/index.d.ts.map +1 -1
  67. package/dist/components/layout/index.js +0 -1
  68. package/dist/components/layout/modal/Modal.svelte +10 -15
  69. package/dist/components/layout/modal/Modal.svelte.d.ts.map +1 -1
  70. package/dist/components/layout/popover/Popover.svelte +96 -79
  71. package/dist/components/layout/popover/Popover.svelte.d.ts +8 -22
  72. package/dist/components/layout/popover/Popover.svelte.d.ts.map +1 -1
  73. package/dist/components/layout/tabs/Tab.svelte +5 -8
  74. package/dist/components/layout/tabs/Tab.svelte.d.ts.map +1 -1
  75. package/dist/components/layout/tooltip/Tooltip.svelte +4 -7
  76. package/dist/components/layout/tooltip/Tooltip.svelte.d.ts.map +1 -1
  77. package/dist/components/table/Column.svelte +7 -10
  78. package/dist/components/table/Column.svelte.d.ts.map +1 -1
  79. package/dist/components/table/ColumnHead.svelte +2 -2
  80. package/dist/components/table/Table.svelte +5 -8
  81. package/dist/components/table/Table.svelte.d.ts.map +1 -1
  82. package/dist/components/table/VirtualList.svelte +3 -8
  83. package/dist/components/table/VirtualList.svelte.d.ts.map +1 -1
  84. package/dist/theme.svelte.d.ts +18 -0
  85. package/dist/theme.svelte.d.ts.map +1 -1
  86. package/dist/types.d.ts.map +1 -1
  87. package/dist/utils/{actions → attachments}/clickOutside.d.ts +2 -4
  88. package/dist/utils/attachments/clickOutside.d.ts.map +1 -0
  89. package/dist/utils/{actions → attachments}/clickOutside.js +4 -7
  90. package/dist/utils/attachments/focusTrap.d.ts +3 -0
  91. package/dist/utils/attachments/focusTrap.d.ts.map +1 -0
  92. package/dist/utils/{actions → attachments}/focusTrap.js +5 -14
  93. package/dist/utils/{actions → attachments}/index.d.ts +0 -1
  94. package/dist/utils/attachments/index.d.ts.map +1 -0
  95. package/dist/utils/{actions → attachments}/index.js +0 -1
  96. package/dist/utils/attachments/resize.d.ts +6 -0
  97. package/dist/utils/attachments/resize.d.ts.map +1 -0
  98. package/dist/utils/{actions → attachments}/resize.js +3 -5
  99. package/dist/utils/attachments/shortcut.svelte.d.ts.map +1 -0
  100. package/dist/utils/attachments/visible.d.ts +6 -0
  101. package/dist/utils/attachments/visible.d.ts.map +1 -0
  102. package/dist/utils/attachments/visible.js +12 -0
  103. package/dist/utils/merge.d.ts +4 -0
  104. package/dist/utils/merge.d.ts.map +1 -0
  105. package/dist/utils/merge.js +6 -0
  106. package/package.json +7 -5
  107. package/src/lib/components/ai/AiMessage.svelte +2 -3
  108. package/src/lib/components/ai/Chat.svelte +2 -3
  109. package/src/lib/components/ai/Markdown.svelte +4 -7
  110. package/src/lib/components/ai/UserMessage.svelte +2 -3
  111. package/src/lib/components/basic/checkbox/Checkbox.svelte +13 -11
  112. package/src/lib/components/basic/toggle/Toggle.svelte +5 -8
  113. package/src/lib/components/inputs/CheckboxInput.svelte +39 -0
  114. package/src/lib/components/inputs/ColorInput.svelte +25 -0
  115. package/src/lib/components/inputs/DateInput.svelte +11 -0
  116. package/src/lib/components/inputs/EmailInput.svelte +16 -0
  117. package/src/lib/components/inputs/FileInput.svelte +131 -0
  118. package/src/lib/components/inputs/Input.svelte +101 -0
  119. package/src/lib/components/inputs/NumberInput.svelte +17 -0
  120. package/src/lib/components/inputs/PasswordCreateInput.svelte +60 -0
  121. package/src/lib/components/inputs/PasswordInput.svelte +27 -0
  122. package/src/lib/components/inputs/TextInput.svelte +16 -0
  123. package/src/lib/components/inputs/ToggleInput.svelte +24 -0
  124. package/src/lib/components/inputs/index.ts +17 -0
  125. package/src/lib/components/inputs/issues/FormIssues.svelte +35 -0
  126. package/src/lib/components/inputs/select/Select.svelte +69 -0
  127. package/src/lib/components/inputs/select/SelectOption.svelte +34 -0
  128. package/src/lib/components/layout/Heading.svelte +5 -4
  129. package/src/lib/components/layout/dialog/Dialog.svelte +5 -8
  130. package/src/lib/components/layout/drawer/Drawer.svelte +7 -10
  131. package/src/lib/components/layout/index.ts +1 -5
  132. package/src/lib/components/layout/modal/Modal.svelte +10 -15
  133. package/src/lib/components/layout/popover/Popover.svelte +96 -79
  134. package/src/lib/components/layout/tabs/Tab.svelte +5 -8
  135. package/src/lib/components/layout/tooltip/Tooltip.svelte +4 -7
  136. package/src/lib/components/table/Column.svelte +7 -10
  137. package/src/lib/components/table/ColumnHead.svelte +2 -2
  138. package/src/lib/components/table/Table.svelte +5 -8
  139. package/src/lib/components/table/VirtualList.svelte +3 -8
  140. package/src/lib/theme.svelte.ts +18 -0
  141. package/src/lib/types.ts +3 -2
  142. package/src/lib/utils/attachments/clickOutside.ts +36 -0
  143. package/src/lib/utils/attachments/focusTrap.ts +67 -0
  144. package/src/lib/utils/{actions → attachments}/index.ts +0 -1
  145. package/src/lib/utils/attachments/resize.ts +38 -0
  146. package/src/lib/utils/attachments/visible.ts +22 -0
  147. package/src/lib/utils/merge.ts +7 -0
  148. package/dist/components/layout/portal/Portal.svelte +0 -39
  149. package/dist/components/layout/portal/Portal.svelte.d.ts +0 -21
  150. package/dist/components/layout/portal/Portal.svelte.d.ts.map +0 -1
  151. package/dist/components/layout/portal/index.d.ts +0 -6
  152. package/dist/components/layout/portal/index.d.ts.map +0 -1
  153. package/dist/components/layout/portal/index.js +0 -5
  154. package/dist/utils/actions/clickOutside.d.ts.map +0 -1
  155. package/dist/utils/actions/focusTrap.d.ts +0 -5
  156. package/dist/utils/actions/focusTrap.d.ts.map +0 -1
  157. package/dist/utils/actions/index.d.ts.map +0 -1
  158. package/dist/utils/actions/portal.d.ts +0 -10
  159. package/dist/utils/actions/portal.d.ts.map +0 -1
  160. package/dist/utils/actions/portal.js +0 -39
  161. package/dist/utils/actions/resize.d.ts +0 -6
  162. package/dist/utils/actions/resize.d.ts.map +0 -1
  163. package/dist/utils/actions/shortcut.svelte.d.ts.map +0 -1
  164. package/dist/utils/actions/visible.d.ts +0 -6
  165. package/dist/utils/actions/visible.d.ts.map +0 -1
  166. package/dist/utils/actions/visible.js +0 -14
  167. package/src/lib/components/layout/portal/Portal.svelte +0 -39
  168. package/src/lib/components/layout/portal/index.ts +0 -7
  169. package/src/lib/utils/actions/clickOutside.ts +0 -38
  170. package/src/lib/utils/actions/focusTrap.ts +0 -65
  171. package/src/lib/utils/actions/portal.ts +0 -43
  172. package/src/lib/utils/actions/resize.ts +0 -35
  173. package/src/lib/utils/actions/visible.ts +0 -28
  174. /package/dist/utils/{actions → attachments}/shortcut.svelte.d.ts +0 -0
  175. /package/dist/utils/{actions → attachments}/shortcut.svelte.js +0 -0
  176. /package/src/lib/utils/{actions → attachments}/shortcut.svelte.ts +0 -0
@@ -3,6 +3,5 @@ export { default as Heading } from './Heading.svelte';
3
3
  export { default as HiddenBackground } from './hiddenBackground/HiddenBackground.svelte';
4
4
  export { default as Modal } from './modal/Modal.svelte';
5
5
  export { default as Popover } from './popover/Popover.svelte';
6
- export { default as Portal } from './portal';
7
6
  export { getTabContext, Tab, TabPanel, Tabs } from './tabs';
8
7
  export { default as Tooltip } from './tooltip/Tooltip.svelte';
@@ -1,12 +1,11 @@
1
1
  <script lang="ts" module>
2
2
  import { theme } from '../../../theme.svelte';
3
3
  import type { TransitionProps } from '../../../types';
4
+ import { merge } from '../../../utils/merge';
4
5
  import { X } from '@lucide/svelte';
5
- import clsx from 'clsx';
6
6
  import { type Snippet } from 'svelte';
7
7
  import type { ClassValue, MouseEventHandler } from 'svelte/elements';
8
8
  import { fade } from 'svelte/transition';
9
- import { twMerge } from 'tailwind-merge';
10
9
  import { Heading, HiddenBackground } from '..';
11
10
 
12
11
  /** Props for the modal, expose if you overwrite the defaults in a custom component */
@@ -95,13 +94,11 @@
95
94
  </div>
96
95
  {:else}
97
96
  <div
98
- class={twMerge(
99
- clsx([
100
- 'bg-surface-50-950 relative flex max-h-full max-w-full flex-col overflow-hidden rounded',
101
- theme.current.modal?.class,
102
- clazz
103
- ])
104
- )}
97
+ class={merge([
98
+ 'bg-surface-50-950 flex max-h-full max-w-full flex-col overflow-hidden rounded',
99
+ theme.current.modal?.class,
100
+ clazz
101
+ ])}
105
102
  {...rest}
106
103
  {onclick}
107
104
  in:inTransition|global
@@ -131,12 +128,10 @@
131
128
  </button>
132
129
  </div>
133
130
  <div
134
- class={twMerge(
135
- clsx(
136
- 'flex grow flex-col gap-4 overflow-hidden bg-inherit p-4 pt-3',
137
- theme.current.modal?.innerClass,
138
- innerClass
139
- )
131
+ class={merge(
132
+ 'flex grow flex-col gap-4 overflow-hidden bg-inherit p-4 pt-3',
133
+ theme.current.modal?.innerClass,
134
+ innerClass
140
135
  )}
141
136
  >
142
137
  {@render children?.()}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/Modal.svelte.ts"],"names":[],"mappings":"AAII,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKrE,sFAAsF;AACtF,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG;IACvC,iEAAiE;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;SAIK;IACL,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,SAAS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AK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -1,113 +1,130 @@
1
1
  <script lang="ts" module>
2
- import { browser } from '$app/environment';
3
2
  import { theme } from '../../../theme.svelte';
4
3
  import type { IvoryComponent } from '../../../types';
5
- import {
6
- autoPlacement,
7
- autoUpdate,
8
- computePosition,
9
- flip,
10
- shift,
11
- type ComputePositionConfig
12
- } from '@floating-ui/dom';
13
- import clsx from 'clsx';
14
- import { twMerge } from 'tailwind-merge';
15
- import { clickOutside } from '../../../utils/actions/clickOutside';
16
- import { Dialog } from '../dialog';
17
-
18
- /** Possible placements for the popover */
4
+ import { pseudoRandomId } from '../../../utils/functions';
5
+ import { merge } from '../../../utils/merge';
6
+ import { type ComputePositionConfig } from '@floating-ui/dom';
7
+ import polyfill from '@oddbird/css-anchor-positioning/fn';
8
+
9
+ // ... (Your existing types remain unchanged)
10
+ type Alignment = 'start' | 'end';
11
+ type Side = 'top' | 'bottom' | 'left' | 'right';
12
+ type AlignedPlacement = `${Side}-${Alignment}` | Side;
19
13
  export type PopoverPlacement = ComputePositionConfig['placement'];
20
14
 
15
+ const ANCHOR_STYLES: Record<string, string> = {
16
+ // Bottom Placements
17
+ 'bottom-start': 'top: anchor(bottom); left: anchor(left);',
18
+ bottom: 'top: anchor(bottom); left: anchor(center); translate: -50% 0;',
19
+ 'bottom-end': 'top: anchor(bottom); right: anchor(right);',
20
+
21
+ // Top Placements
22
+ 'top-start': 'bottom: anchor(top); left: anchor(left);',
23
+ top: 'bottom: anchor(top); left: anchor(center); translate: -50% 0;',
24
+ 'top-end': 'bottom: anchor(top); right: anchor(right);',
25
+
26
+ // Left Placements
27
+ 'left-start': 'right: anchor(left); top: anchor(top);',
28
+ left: 'right: anchor(left); top: anchor(center); translate: 0 -50%;',
29
+ 'left-end': 'right: anchor(left); bottom: anchor(bottom);',
30
+
31
+ // Right Placements
32
+ 'right-start': 'left: anchor(right); top: anchor(top);',
33
+ right: 'left: anchor(right); top: anchor(center); translate: 0 -50%;',
34
+ 'right-end': 'left: anchor(right); bottom: anchor(bottom);'
35
+ };
36
+
21
37
  export interface PopoverProps extends IvoryComponent<HTMLDivElement> {
22
- /** The element the popover will be positioned relative to */
23
- target: Element | undefined;
24
- /**
25
- * Where the popover should be positioned relative to the target.
26
- *
27
- * default: `bottom-start`
28
- */
29
- placement?: PopoverPlacement;
30
- /**
31
- * Callback that is called when the user clicks outside the popover or the target element.
32
- */
33
- onClickOutside?: (e: MouseEvent) => void;
34
- /**
35
- * Whether to place the popover automatically
36
- *
37
- * [Further reading](https://floating-ui.com/docs/autoPlacement)
38
- */
38
+ target: HTMLElement | undefined;
39
+ placement?: AlignedPlacement;
39
40
  autoplacement?: boolean;
40
41
  }
41
42
  </script>
42
43
 
43
44
  <script lang="ts">
45
+ import { onMount, tick } from 'svelte';
46
+
44
47
  let {
45
48
  class: clazz,
46
49
  style: externalStyle,
47
50
  target,
48
51
  placement = 'bottom-start',
49
- onClickOutside = close,
50
52
  children,
51
- autoplacement,
53
+ popover = 'auto',
54
+ id = pseudoRandomId(),
52
55
  ...rest
53
56
  }: PopoverProps = $props();
54
57
 
55
- let style: string = $state('');
56
- let popover: HTMLDivElement | undefined = $state();
58
+ let popoverEl: HTMLDivElement | undefined = $state();
59
+ let currentlyOpen = $state(false);
57
60
 
58
- const postion = async (open: boolean) => {
59
- if (!open || !popover || !browser || !target) return;
60
- const { x, y } = await computePosition(target, popover, {
61
- middleware: [shift(), ...(autoplacement ? [autoPlacement()] : [flip()])],
62
- placement
63
- });
64
- style = `top: ${y}px; left: ${x}px;`;
65
- };
61
+ // 1. Load Polyfill
62
+ // We import the 'fn' version to manually control execution,
63
+ // ensuring it runs after the DOM is ready.
64
+ onMount(async () => {
65
+ if (!CSS.supports('position-anchor', '--foo')) {
66
+ await polyfill();
67
+ console.log('loaded polyfill');
68
+ }
69
+ });
66
70
 
67
- let currentlyOpen = $state(false);
71
+ const anchorName = $derived(`--anchor-${id}`);
72
+
73
+ // 2. Anchor Association
74
+ $effect(() => {
75
+ if (!target) return;
76
+ const currentStyle = target.getAttribute('style') || '';
77
+ if (!currentStyle.includes(anchorName)) {
78
+ target.setAttribute('style', `anchor-name: ${anchorName}; ${currentStyle}`);
79
+ }
80
+ tick().then(() => polyfill());
81
+ });
82
+
83
+ $effect(() => {
84
+ if (!popoverEl) return;
85
+
86
+ // Use the explicit coordinates instead of position-area
87
+ const coords = ANCHOR_STYLES[placement] ?? ANCHOR_STYLES['bottom-start'];
88
+
89
+ // Important: We ensure position-area is NOT present
90
+ const polyfillStyles = `
91
+ position-anchor: ${anchorName};
92
+ ${coords}
93
+ `;
68
94
 
69
- let cleanup: () => void = () => {};
70
- export function close() {
71
- currentlyOpen = false;
72
- cleanup();
95
+ const combinedStyle = `${externalStyle ? externalStyle + '; ' : ''}${polyfillStyles}`;
96
+ popoverEl.setAttribute('style', combinedStyle);
97
+
98
+ tick().then(() => polyfill());
99
+ });
100
+
101
+ export async function close() {
102
+ popoverEl?.hidePopover();
73
103
  }
74
104
 
75
- export function open() {
76
- currentlyOpen = true;
77
- if (!target || !popover) return;
78
- cleanup = autoUpdate(target, popover, () => postion(true));
105
+ export async function open() {
106
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
+ (popoverEl?.showPopover as any)();
79
108
  }
80
109
 
81
- export function toggle() {
82
- currentlyOpen = !currentlyOpen;
110
+ export async function toggle() {
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
+ (popoverEl?.togglePopover as any)();
83
113
  }
84
114
 
85
115
  export function isOpen() {
86
116
  return currentlyOpen;
87
117
  }
88
-
89
- // TODO: this is kinda hacky
90
- $effect(() => {
91
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
92
- [popover, target];
93
- postion(currentlyOpen);
94
- });
95
118
  </script>
96
119
 
97
- <!--
98
- @component
99
- A popover, positions itself relative to a target element.
100
- -->
101
- {#if currentlyOpen}
102
- <Dialog>
103
- <div
104
- class={twMerge(clsx('absolute', theme.current.popover?.class, clazz))}
105
- style={style + ' ' + externalStyle}
106
- bind:this={popover}
107
- use:clickOutside={{ callback: onClickOutside, target }}
108
- {...rest}
109
- >
110
- {@render children?.()}
111
- </div>
112
- </Dialog>
113
- {/if}
120
+ <div
121
+ {popover}
122
+ class={merge('absolute m-0', theme.current.popover?.class, clazz)}
123
+ bind:this={popoverEl}
124
+ ontoggle={(e) => {
125
+ currentlyOpen = e.newState === 'open';
126
+ }}
127
+ {...rest}
128
+ >
129
+ {@render children?.()}
130
+ </div>
@@ -1,32 +1,18 @@
1
1
  import type { IvoryComponent } from '../../../types';
2
2
  import { type ComputePositionConfig } from '@floating-ui/dom';
3
- /** Possible placements for the popover */
3
+ type Alignment = 'start' | 'end';
4
+ type Side = 'top' | 'bottom' | 'left' | 'right';
5
+ type AlignedPlacement = `${Side}-${Alignment}` | Side;
4
6
  export type PopoverPlacement = ComputePositionConfig['placement'];
5
7
  export interface PopoverProps extends IvoryComponent<HTMLDivElement> {
6
- /** The element the popover will be positioned relative to */
7
- target: Element | undefined;
8
- /**
9
- * Where the popover should be positioned relative to the target.
10
- *
11
- * default: `bottom-start`
12
- */
13
- placement?: PopoverPlacement;
14
- /**
15
- * Callback that is called when the user clicks outside the popover or the target element.
16
- */
17
- onClickOutside?: (e: MouseEvent) => void;
18
- /**
19
- * Whether to place the popover automatically
20
- *
21
- * [Further reading](https://floating-ui.com/docs/autoPlacement)
22
- */
8
+ target: HTMLElement | undefined;
9
+ placement?: AlignedPlacement;
23
10
  autoplacement?: boolean;
24
11
  }
25
- /** A popover, positions itself relative to a target element. */
26
12
  declare const Popover: import("svelte").Component<PopoverProps, {
27
- close: () => void;
28
- open: () => void;
29
- toggle: () => void;
13
+ close: () => Promise<void>;
14
+ open: () => Promise<void>;
15
+ toggle: () => Promise<void>;
30
16
  isOpen: () => boolean;
31
17
  }, "">;
32
18
  type Popover = ReturnType<typeof Popover>;
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/popover/Popover.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAMH,KAAK,qBAAqB,EAC7B,MAAM,kBAAkB,CAAC;AAM1B,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAElE,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,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;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAqEL,gEAAgE;AAChE,QAAA,MAAM,OAAO;;;;;MAAwC,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;AAGjD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,KAAK,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AACjC,KAAK,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAChD,KAAK,gBAAgB,GAAG,GAAG,IAAI,IAAI,SAAS,EAAE,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAwBlE,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AA2FL,QAAA,MAAM,OAAO;;;;;MAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -3,10 +3,9 @@
3
3
  import { theme } from '../../../theme.svelte';
4
4
  import type { IvoryComponent } from '../../../types';
5
5
  import { pseudoRandomId } from '../../../utils/functions/index';
6
- import clsx from 'clsx';
6
+ import { merge } from '../../../utils/merge';
7
7
  import { onMount, type Snippet } from 'svelte';
8
8
  import type { ClassValue } from 'svelte/elements';
9
- import { twMerge } from 'tailwind-merge';
10
9
  import { getTabContext } from './Tabs.svelte';
11
10
 
12
11
  export interface TabProps extends Omit<IvoryComponent<HTMLElement>, 'children'> {
@@ -52,12 +51,10 @@
52
51
 
53
52
  <svelte:element
54
53
  this={href ? 'a' : 'button'}
55
- class={twMerge(
56
- clsx(
57
- 'btn flex h-fit w-fit shrink-0 items-center justify-center px-0 text-xl font-bold select-none',
58
- theme.current.tabs?.tab?.class?.(selected),
59
- typeof clazz === 'function' ? clazz(selected) : clazz
60
- )
54
+ class={merge(
55
+ 'btn flex h-fit w-fit shrink-0 items-center justify-center px-0 text-xl font-bold select-none',
56
+ theme.current.tabs?.tab?.class?.(selected),
57
+ typeof clazz === 'function' ? clazz(selected) : clazz
61
58
  )}
62
59
  onclick={href
63
60
  ? undefined
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/tabs/Tab.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,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CAAC,CAAC,CAAC;IAC3C,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AA8CL,QAAA,MAAM,GAAG,8CAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" module>
2
- import clsx from 'clsx';
2
+ import { merge } from '../../../utils/merge';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { ClassValue, MouseEventHandler } from 'svelte/elements';
5
- import { twMerge } from 'tailwind-merge';
6
5
  import Popover, { type PopoverPlacement } from '../popover/Popover.svelte';
7
6
 
8
7
  export interface TooltipProps {
@@ -84,11 +83,9 @@
84
83
  bind:this={popover}
85
84
  {target}
86
85
  {placement}
87
- class={twMerge(
88
- clsx(
89
- 'bg-surface-50-950 max-w-96 -translate-y-0.5 rounded px-4 py-1 shadow-lg',
90
- tooltipClass
91
- )
86
+ class={merge(
87
+ 'bg-surface-50-950 max-w-96 -translate-y-0.5 rounded px-4 py-1 shadow-lg',
88
+ tooltipClass
92
89
  )}
93
90
  >
94
91
  {#if typeof tooltip === 'string'}
@@ -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,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC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AG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -1,9 +1,8 @@
1
1
  <script lang="ts" module>
2
2
  import { theme } from '../../theme.svelte';
3
- import clsx from 'clsx';
3
+ import { merge } from '../../utils/merge';
4
4
  import { type Snippet } from 'svelte';
5
5
  import type { ClassValue } from 'svelte/elements';
6
- import { twMerge } from 'tailwind-merge';
7
6
  import type { ColumnConfig } from './columnController.svelte';
8
7
  import { getRowContext } from './Row.svelte';
9
8
  import { getTableContext } from './Table.svelte';
@@ -67,14 +66,12 @@
67
66
  href={!allowClicking ? rowContext.href : undefined}
68
67
  type={allowClicking ? 'button' : undefined}
69
68
  style={ignoreWidth ? '' : `width: ${widthStyle}`}
70
- class={twMerge(
71
- clsx([
72
- 'box-border flex h-full shrink-0 flex-row items-center justify-start gap-1 truncate',
73
- column.width !== 0 && 'border-r-[calc(var(--spacing)*2)] border-transparent',
74
- theme.current.table?.column?.class,
75
- clazz
76
- ])
77
- )}
69
+ class={merge([
70
+ 'box-border flex h-full shrink-0 flex-row items-center justify-start gap-1 truncate',
71
+ column.width !== 0 && 'border-r-[calc(var(--spacing)*2)] border-transparent',
72
+ theme.current.table?.column?.class,
73
+ clazz
74
+ ])}
78
75
  >
79
76
  {@render children()}
80
77
  </svelte:element>
@@ -1 +1 @@
1
- {"version":3,"file":"Column.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Column.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AA2DL,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Column.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Column.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAyDL,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" module>
2
2
  import { getContext, setContext, type Snippet } from 'svelte';
3
- import { resize } from '../../utils/actions';
3
+ import { resize } from '../../utils/attachments';
4
4
  import type { ColumnController } from './columnController.svelte';
5
5
 
6
6
  const CONTEXT = {};
@@ -53,12 +53,12 @@
53
53
  {@render children?.()}
54
54
  {#if column.resizable}
55
55
  <button
56
+ {@attach resize({ resized: onResize, dragging: onDragging })}
56
57
  type="button"
57
58
  class={[
58
59
  'relative ml-auto h-full w-4 shrink-0 cursor-col-resize bg-inherit after:absolute after:top-0 after:right-2 after:h-full after:w-px',
59
60
  dragging ? 'after:bg-primary-400-600' : 'group-hover:after:bg-surface-300-700'
60
61
  ]}
61
- use:resize={{ resized: onResize, dragging: onDragging }}
62
62
  onmouseenter={onHoverStart}
63
63
  onmouseleave={onHoverEnd}
64
64
  onfocusin={onHoverStart}
@@ -1,10 +1,9 @@
1
1
  <script lang="ts" module>
2
+ import { merge } from '../../utils/merge';
2
3
  import { ChevronRight } from '@lucide/svelte';
3
- import clsx from 'clsx';
4
4
  import { getContext, setContext, untrack, type Snippet } from 'svelte';
5
5
  import type { ClassValue } from 'svelte/elements';
6
6
  import { SvelteSet } from 'svelte/reactivity';
7
- import { twMerge } from 'tailwind-merge';
8
7
  import ColumnComponent from './Column.svelte';
9
8
  import { ColumnController, type ColumnConfig } from './columnController.svelte';
10
9
  import ColumnHead from './ColumnHead.svelte';
@@ -200,17 +199,15 @@
200
199
  bind:this={list}
201
200
  bind:b_scrollTop
202
201
  data={results.entries}
203
- class={twMerge(clsx(['flex flex-col overflow-hidden border-transparent', clazz]))}
202
+ class={merge(['flex flex-col overflow-hidden border-transparent', clazz])}
204
203
  rowClass={['pl-2 pr-4', rowClass]}
205
204
  {rowHeight}
206
205
  >
207
206
  {#snippet header()}
208
207
  <div
209
- class={twMerge(
210
- clsx(
211
- 'flex w-fit min-w-full flex-row border-b border-inherit pr-4 pl-2',
212
- headerClass
213
- )
208
+ class={merge(
209
+ 'flex w-fit min-w-full flex-row border-b border-inherit pr-4 pl-2',
210
+ headerClass
214
211
  )}
215
212
  >
216
213
  {#if results.someHaveChildren}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Table.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAmC,KAAK,OA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C,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAChZ,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/I,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,KAAK,EAAE,qBAAmC,CAAC;AAC/B,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,eAAe,KAAK,CAAC"}
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" generics="T extends { id: string }">
2
- import clsx from 'clsx';
2
+ import { merge } from '../../utils/merge';
3
3
  import { onMount, tick, untrack, type Snippet } from 'svelte';
4
4
  import type { ClassValue } from 'svelte/elements';
5
- import { twMerge } from 'tailwind-merge';
6
5
 
7
6
  type Props<T> = {
8
7
  class?: ClassValue;
@@ -27,7 +26,7 @@
27
26
  }: Props<T> = $props();
28
27
 
29
28
  const finalRowClass = $derived(
30
- twMerge(clsx(['flex w-full shrink-0 grow flex-row items-center overflow-hidden', rowClass]))
29
+ merge(['flex w-full shrink-0 grow flex-row items-center overflow-hidden', rowClass])
31
30
  );
32
31
 
33
32
  let viewportReactivity = $state(0);
@@ -93,11 +92,7 @@
93
92
  });
94
93
  </script>
95
94
 
96
- <div
97
- class={twMerge(
98
- clsx(['scroll relative flex grow flex-col overflow-hidden border-inherit', clazz])
99
- )}
100
- >
95
+ <div class={merge(['scroll relative flex grow flex-col overflow-hidden border-inherit', clazz])}>
101
96
  {#if header}
102
97
  <div class="h-fit w-full border-inherit">
103
98
  <div
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualList.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/VirtualList.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI9C,KAAK,KAAK,CAAC,CAAC,IAAI;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,GAAG,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAAC,iBAAS,QAAQ,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;WAkHpB,KAAK,CAAC,CAAC,CAAC;aAAwB;QAAE,QAAQ,SApF1C,MAAM,SAAS,MAAM,UAoFsC;KAAE;;;;EAA0E;AACpK,cAAM,iBAAiB,CAAC,CAAC,SAAS;IAAE,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AG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,WAAW,EAAE,qBAAmC,CAAC;AACrC,KAAK,WAAW,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACnF,eAAe,WAAW,CAAC"}
@@ -1,5 +1,9 @@
1
+ import type { RemoteFormIssue } from '@sveltejs/kit';
1
2
  import type { ClassValue } from 'svelte/elements';
2
3
  export interface Theme {
4
+ checkbox?: {
5
+ class?: (checked: boolean, partial: boolean) => ClassValue;
6
+ };
3
7
  heading?: {
4
8
  class?: ClassValue;
5
9
  };
@@ -26,6 +30,20 @@ export interface Theme {
26
30
  popover?: {
27
31
  class?: ClassValue;
28
32
  };
33
+ input?: {
34
+ outerClass?: ClassValue;
35
+ class?: (value: boolean, issues?: boolean) => ClassValue;
36
+ label?: {
37
+ class?: (value: boolean, issues?: boolean) => ClassValue;
38
+ };
39
+ issues?: {
40
+ issue?: {
41
+ label?: (issue: RemoteFormIssue) => string;
42
+ class?: ClassValue;
43
+ };
44
+ class?: ClassValue;
45
+ };
46
+ };
29
47
  }
30
48
  export declare const theme: {
31
49
  setTheme(newTheme: Theme): void;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.svelte.d.ts","sourceRoot":"","sources":["../src/lib/theme.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,KAAK;IAClB,OAAO,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,UAAU,CAAC;KACtB,CAAC;IACF,gBAAgB,CAAC,EAAE;QACf,KAAK,CAAC,EAAE,UAAU,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,UAAU,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE;QACH,GAAG,CAAC,EAAE;Y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,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,WAAW,cAAc,CAC3B,WAAW,SAAS,WAAW,CACjC,SAAQ,cAAc,CAAC,WAAW,CAAC;CAAG;AAExC,MAAM,WAAW,eAAe;IAC5B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,gBAAgB,CAAC;IACnD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,gBAAgB,CAAC;CACvD"}
@@ -1,12 +1,10 @@
1
+ import type { Attachment } from 'svelte/attachments';
1
2
  interface ClickOutsideParams {
2
3
  /** Callback to be called when clicking outside of node */
3
4
  callback: (e: MouseEvent) => void;
4
5
  /** Callback is also not fired if the click target is inside this element */
5
6
  target?: Element;
6
7
  }
7
- /** Dispatch event on click outside of node */
8
- export declare function clickOutside(node: Element, params: ((e: MouseEvent) => void) | ClickOutsideParams): {
9
- destroy(): void;
10
- };
8
+ export declare const clickOutside: (params: ((e: MouseEvent) => void) | ClickOutsideParams) => Attachment;
11
9
  export {};
12
10
  //# sourceMappingURL=clickOutside.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clickOutside.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/attachments/clickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,UAAU,kBAAkB;IACxB,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,kBAAkB,KAAG,UAyBzD,CAAC"}