@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.
- package/dist/components/basic/checkbox/Checkbox.svelte +20 -18
- package/dist/components/basic/checkbox/Checkbox.svelte.d.ts +5 -4
- package/dist/components/basic/checkbox/Checkbox.svelte.d.ts.map +1 -1
- package/dist/components/basic/index.d.ts +2 -0
- package/dist/components/basic/index.d.ts.map +1 -1
- package/dist/components/basic/index.js +2 -0
- package/dist/components/basic/toggle/Toggle.svelte +11 -11
- package/dist/components/basic/toggle/Toggle.svelte.d.ts +4 -5
- package/dist/components/basic/toggle/Toggle.svelte.d.ts.map +1 -1
- package/dist/components/buttons/CopyToClipboardButton.svelte +6 -8
- package/dist/components/buttons/CopyToClipboardButton.svelte.d.ts +3 -2
- package/dist/components/buttons/CopyToClipboardButton.svelte.d.ts.map +1 -1
- package/dist/components/layout/drawer/Drawer.svelte +13 -8
- package/dist/components/layout/drawer/Drawer.svelte.d.ts +4 -3
- package/dist/components/layout/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/layout/heading/Heading.svelte +8 -6
- package/dist/components/layout/heading/Heading.svelte.d.ts +3 -4
- package/dist/components/layout/heading/Heading.svelte.d.ts.map +1 -1
- package/dist/components/layout/heading/index.d.ts +1 -1
- package/dist/components/layout/hiddenBackground/HiddenBackground.svelte +13 -7
- package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts +4 -5
- package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts.map +1 -1
- package/dist/components/layout/hiddenBackground/index.d.ts +1 -1
- package/dist/components/layout/index.d.ts +11 -6
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +9 -4
- package/dist/components/layout/modal/Modal.svelte +13 -17
- package/dist/components/layout/modal/Modal.svelte.d.ts +2 -4
- package/dist/components/layout/modal/Modal.svelte.d.ts.map +1 -1
- package/dist/components/layout/modal/ModalTest.svelte +3 -10
- package/dist/components/layout/modal/ModalTest.svelte.d.ts +4 -6
- package/dist/components/layout/modal/ModalTest.svelte.d.ts.map +1 -1
- package/dist/components/layout/popover/Popover.svelte +10 -12
- package/dist/components/layout/popover/Popover.svelte.d.ts +4 -8
- package/dist/components/layout/popover/Popover.svelte.d.ts.map +1 -1
- package/dist/components/layout/portal/Portal.svelte +10 -9
- package/dist/components/layout/portal/Portal.svelte.d.ts +7 -6
- package/dist/components/layout/portal/Portal.svelte.d.ts.map +1 -1
- package/dist/components/layout/tabs/Tab.svelte +7 -7
- package/dist/components/layout/tabs/Tab.svelte.d.ts +4 -4
- package/dist/components/layout/tabs/Tab.svelte.d.ts.map +1 -1
- package/dist/components/layout/tabs/TabPanel.svelte +6 -4
- package/dist/components/layout/tabs/TabPanel.svelte.d.ts +3 -3
- package/dist/components/layout/tabs/TabPanel.svelte.d.ts.map +1 -1
- package/dist/components/layout/tabs/Tabs.svelte +13 -16
- package/dist/components/layout/tabs/Tabs.svelte.d.ts +6 -9
- package/dist/components/layout/tabs/Tabs.svelte.d.ts.map +1 -1
- package/dist/components/layout/tabs/index.d.ts +6 -21
- package/dist/components/layout/tabs/index.d.ts.map +1 -1
- package/dist/components/layout/tabs/index.js +3 -0
- package/dist/components/layout/tooltip/Tooltip.svelte +0 -1
- package/dist/components/layout/tooltip/Tooltip.svelte.d.ts.map +1 -1
- package/dist/components/table/plugins/search.svelte.d.ts +1 -1
- package/dist/components/table/plugins/search.svelte.d.ts.map +1 -1
- package/dist/components/table/plugins/search.svelte.js +0 -1
- package/dist/components/toast/Toast.svelte +22 -15
- package/dist/components/toast/Toast.svelte.d.ts +6 -5
- package/dist/components/toast/Toast.svelte.d.ts.map +1 -1
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/toasts.svelte.d.ts +4 -4
- package/dist/components/toast/toasts.svelte.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/basic/checkbox/Checkbox.svelte +20 -18
- package/src/lib/components/basic/index.ts +2 -0
- package/src/lib/components/basic/toggle/Toggle.svelte +11 -11
- package/src/lib/components/buttons/CopyToClipboardButton.svelte +6 -8
- package/src/lib/components/layout/drawer/Drawer.svelte +13 -8
- package/src/lib/components/layout/heading/Heading.svelte +8 -6
- package/src/lib/components/layout/hiddenBackground/HiddenBackground.svelte +13 -7
- package/src/lib/components/layout/index.ts +17 -6
- package/src/lib/components/layout/modal/Modal.svelte +13 -17
- package/src/lib/components/layout/modal/ModalTest.svelte +3 -10
- package/src/lib/components/layout/popover/Popover.svelte +10 -12
- package/src/lib/components/layout/portal/Portal.svelte +10 -9
- package/src/lib/components/layout/tabs/Tab.svelte +7 -7
- package/src/lib/components/layout/tabs/TabPanel.svelte +6 -4
- package/src/lib/components/layout/tabs/Tabs.svelte +13 -16
- package/src/lib/components/layout/tabs/index.ts +3 -0
- package/src/lib/components/layout/tooltip/Tooltip.svelte +0 -1
- package/src/lib/components/table/plugins/search.svelte.ts +1 -3
- package/src/lib/components/toast/Toast.svelte +22 -15
- package/src/lib/components/toast/index.ts +2 -2
- package/src/lib/components/toast/toasts.svelte.ts +4 -4
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
It's a checkbox
|
|
4
|
-
-->
|
|
5
|
-
|
|
6
|
-
<script lang="ts">
|
|
7
|
-
import { type Icon as LucideIcon, Minus, icons } from '@lucide/svelte';
|
|
8
|
-
import clsx from 'clsx';
|
|
9
|
-
import type { ClassValue } from 'svelte/elements';
|
|
10
|
-
import { twMerge } from 'tailwind-merge';
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../../types';
|
|
11
3
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type Props = {
|
|
4
|
+
export interface CheckboxProps extends IvoryComponent<HTMLElement> {
|
|
15
5
|
class?: ClassValue;
|
|
16
6
|
/** `checked` has prioriy over `partial` */
|
|
17
7
|
checked?: boolean | null;
|
|
@@ -23,7 +13,19 @@
|
|
|
23
13
|
onclick?: () => void;
|
|
24
14
|
/** data-testid */
|
|
25
15
|
testId?: string;
|
|
26
|
-
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
@component
|
|
21
|
+
It's a checkbox
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { Check, type Icon as LucideIcon, Minus } from '@lucide/svelte';
|
|
26
|
+
import clsx from 'clsx';
|
|
27
|
+
import type { ClassValue } from 'svelte/elements';
|
|
28
|
+
import { twMerge } from 'tailwind-merge';
|
|
27
29
|
|
|
28
30
|
let {
|
|
29
31
|
class: clazz,
|
|
@@ -32,8 +34,8 @@
|
|
|
32
34
|
id,
|
|
33
35
|
disabled = false,
|
|
34
36
|
onclick,
|
|
35
|
-
|
|
36
|
-
}:
|
|
37
|
+
...rest
|
|
38
|
+
}: CheckboxProps = $props();
|
|
37
39
|
|
|
38
40
|
const {
|
|
39
41
|
icon: Icon,
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
{id}
|
|
63
65
|
{disabled}
|
|
64
66
|
{style}
|
|
67
|
+
{onclick}
|
|
65
68
|
class={twMerge(
|
|
66
69
|
clsx(
|
|
67
70
|
'box-border flex h-5 w-5 items-center justify-center overflow-hidden rounded border-2 transition-colors',
|
|
@@ -70,8 +73,7 @@
|
|
|
70
73
|
clazz
|
|
71
74
|
)
|
|
72
75
|
)}
|
|
73
|
-
{
|
|
74
|
-
data-testid={testId}
|
|
76
|
+
{...rest}
|
|
75
77
|
>
|
|
76
78
|
{#if Icon}
|
|
77
79
|
<Icon class="h-full w-full" size={16} strokeWidth={3} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
|
+
export interface CheckboxProps extends IvoryComponent<HTMLElement> {
|
|
3
3
|
class?: ClassValue;
|
|
4
4
|
/** `checked` has prioriy over `partial` */
|
|
5
5
|
checked?: boolean | null;
|
|
@@ -11,9 +11,10 @@ type Props = {
|
|
|
11
11
|
onclick?: () => void;
|
|
12
12
|
/** data-testid */
|
|
13
13
|
testId?: string;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
|
+
import type { ClassValue } from 'svelte/elements';
|
|
15
16
|
/** It's a checkbox */
|
|
16
|
-
declare const Checkbox: import("svelte").Component<
|
|
17
|
+
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "">;
|
|
17
18
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
18
19
|
export default Checkbox;
|
|
19
20
|
//# sourceMappingURL=Checkbox.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/basic/checkbox/Checkbox.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/basic/checkbox/Checkbox.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAKL,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA2DlD,sBAAsB;AACtB,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/basic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/basic/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
<script lang="ts">
|
|
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';
|
|
5
6
|
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
export interface ToggleProps extends IvoryComponent<HTMLElement> {
|
|
8
9
|
value?: boolean;
|
|
9
10
|
class?: ClassValue;
|
|
10
|
-
onclick?: () => void;
|
|
11
11
|
children?: Snippet;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
let { value, class: clazz, children, ...rest }: ToggleProps = $props();
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<svelte:element
|
|
19
|
-
this={onclick ? 'button' : 'div'}
|
|
20
|
+
this={rest.onclick ? 'button' : 'div'}
|
|
20
21
|
class={twMerge(
|
|
21
22
|
clsx(
|
|
22
23
|
'group relative flex h-5 w-9 flex-row items-center rounded-full p-0.5 transition-colors duration-100',
|
|
@@ -24,10 +25,9 @@
|
|
|
24
25
|
clazz
|
|
25
26
|
)
|
|
26
27
|
)}
|
|
27
|
-
type={onclick ? 'button' : undefined}
|
|
28
|
-
role={onclick ? 'button' : undefined}
|
|
29
|
-
{
|
|
30
|
-
data-testid={testId}
|
|
28
|
+
type={rest.onclick ? 'button' : undefined}
|
|
29
|
+
role={rest.onclick ? 'button' : undefined}
|
|
30
|
+
{...rest}
|
|
31
31
|
>
|
|
32
32
|
<div
|
|
33
33
|
class={[
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import type { IvoryComponent } from '../../../types';
|
|
1
2
|
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { ClassValue } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
+
export interface ToggleProps extends IvoryComponent<HTMLElement> {
|
|
4
5
|
value?: boolean;
|
|
5
6
|
class?: ClassValue;
|
|
6
|
-
onclick?: () => void;
|
|
7
7
|
children?: Snippet;
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
declare const Toggle: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
}
|
|
9
|
+
declare const Toggle: import("svelte").Component<ToggleProps, {}, "">;
|
|
11
10
|
type Toggle = ReturnType<typeof Toggle>;
|
|
12
11
|
export default Toggle;
|
|
13
12
|
//# sourceMappingURL=Toggle.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/basic/toggle/Toggle.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toggle.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/basic/toggle/Toggle.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;AAGlD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAgCL,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../types';
|
|
2
3
|
import { Copy } from '@lucide/svelte';
|
|
3
4
|
import type { ClassValue } from 'svelte/elements';
|
|
4
5
|
import { Toasts } from '../toast';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
interface Props {
|
|
7
|
+
export interface CopyToClipboardButtonProps extends IvoryComponent<HTMLButtonElement> {
|
|
11
8
|
text: string;
|
|
12
9
|
class?: ClassValue;
|
|
13
10
|
toastMessage?: string;
|
|
14
11
|
}
|
|
12
|
+
</script>
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
let { text, toastMessage, ...rest }: CopyToClipboardButtonProps = $props();
|
|
17
16
|
|
|
18
17
|
async function copyText() {
|
|
19
18
|
await navigator.clipboard.writeText(text);
|
|
20
|
-
lastCopied = text;
|
|
21
19
|
if (toastMessage) {
|
|
22
20
|
Toasts.trigger({
|
|
23
21
|
variant: 'success',
|
|
@@ -28,6 +26,6 @@
|
|
|
28
26
|
}
|
|
29
27
|
</script>
|
|
30
28
|
|
|
31
|
-
<button type="button" class={['text-surface-500 btn',
|
|
29
|
+
<button type="button" class={['text-surface-500 btn', rest.class]} onclick={copyText} {...rest}>
|
|
32
30
|
<Copy class={['h-5 w-5']} />
|
|
33
31
|
</button>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { IvoryComponent } from '../../types';
|
|
1
2
|
import type { ClassValue } from 'svelte/elements';
|
|
2
|
-
interface
|
|
3
|
+
export interface CopyToClipboardButtonProps extends IvoryComponent<HTMLButtonElement> {
|
|
3
4
|
text: string;
|
|
4
5
|
class?: ClassValue;
|
|
5
6
|
toastMessage?: string;
|
|
6
7
|
}
|
|
7
|
-
declare const CopyToClipboardButton: import("svelte").Component<
|
|
8
|
+
declare const CopyToClipboardButton: import("svelte").Component<CopyToClipboardButtonProps, {}, "">;
|
|
8
9
|
type CopyToClipboardButton = ReturnType<typeof CopyToClipboardButton>;
|
|
9
10
|
export default CopyToClipboardButton;
|
|
10
11
|
//# sourceMappingURL=CopyToClipboardButton.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyToClipboardButton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/buttons/CopyToClipboardButton.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopyToClipboardButton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/buttons/CopyToClipboardButton.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,0BAA2B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAyBL,QAAA,MAAM,qBAAqB,gEAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
3
|
import { X } from '@lucide/svelte';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import type { Snippet } from 'svelte';
|
|
@@ -7,31 +8,34 @@
|
|
|
7
8
|
import Heading from '../heading';
|
|
8
9
|
import HiddenBackground from '../hiddenBackground';
|
|
9
10
|
|
|
10
|
-
type DrawerPlacement = 'left' | 'right';
|
|
11
|
+
export type DrawerPlacement = 'left' | 'right';
|
|
11
12
|
|
|
12
|
-
interface
|
|
13
|
+
export interface DrawerProps extends IvoryComponent<HTMLDivElement> {
|
|
13
14
|
class?: string;
|
|
14
15
|
b_open: boolean;
|
|
15
16
|
title?: string;
|
|
16
17
|
children: Snippet;
|
|
17
18
|
placement?: DrawerPlacement;
|
|
18
19
|
}
|
|
20
|
+
</script>
|
|
19
21
|
|
|
22
|
+
<script lang="ts">
|
|
20
23
|
let {
|
|
21
24
|
class: clazz,
|
|
22
25
|
b_open = $bindable(false),
|
|
23
26
|
children,
|
|
24
27
|
title,
|
|
25
|
-
placement = 'right'
|
|
26
|
-
|
|
28
|
+
placement = 'right',
|
|
29
|
+
...rest
|
|
30
|
+
}: DrawerProps = $props();
|
|
27
31
|
|
|
28
|
-
const
|
|
32
|
+
const onclose = () => {
|
|
29
33
|
b_open = false;
|
|
30
34
|
};
|
|
31
35
|
</script>
|
|
32
36
|
|
|
33
37
|
{#if b_open}
|
|
34
|
-
<HiddenBackground onclose
|
|
38
|
+
<HiddenBackground {onclose}>
|
|
35
39
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
36
40
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
37
41
|
<div
|
|
@@ -45,12 +49,13 @@
|
|
|
45
49
|
)}
|
|
46
50
|
transition:fly={{ x: placement === 'right' ? '100%' : '-100%', duration: 200 }}
|
|
47
51
|
onclick={(e) => e.stopPropagation()}
|
|
52
|
+
{...rest}
|
|
48
53
|
>
|
|
49
54
|
<div class="flex flex-row items-center justify-between gap-8">
|
|
50
55
|
{#if title}
|
|
51
56
|
<Heading>{title}</Heading>
|
|
52
57
|
{/if}
|
|
53
|
-
<button class="group ml-auto flex justify-end" type="button" onclick={
|
|
58
|
+
<button class="group ml-auto flex justify-end" type="button" onclick={onclose}>
|
|
54
59
|
<X class="h-full w-auto transition-[stroke-width] group-hover:stroke-3" />
|
|
55
60
|
</button>
|
|
56
61
|
</div>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { IvoryComponent } from '../../../types';
|
|
1
2
|
import type { Snippet } from 'svelte';
|
|
2
|
-
type DrawerPlacement = 'left' | 'right';
|
|
3
|
-
interface
|
|
3
|
+
export type DrawerPlacement = 'left' | 'right';
|
|
4
|
+
export interface DrawerProps extends IvoryComponent<HTMLDivElement> {
|
|
4
5
|
class?: string;
|
|
5
6
|
b_open: boolean;
|
|
6
7
|
title?: string;
|
|
7
8
|
children: Snippet;
|
|
8
9
|
placement?: DrawerPlacement;
|
|
9
10
|
}
|
|
10
|
-
declare const Drawer: import("svelte").Component<
|
|
11
|
+
declare const Drawer: import("svelte").Component<DrawerProps, {}, "b_open">;
|
|
11
12
|
type Drawer = ReturnType<typeof Drawer>;
|
|
12
13
|
export default Drawer;
|
|
13
14
|
//# sourceMappingURL=Drawer.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAMtC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AA8CL,QAAA,MAAM,MAAM,uDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
|
|
7
|
-
export interface
|
|
8
|
-
children: Snippet;
|
|
7
|
+
export interface HeadingProps extends IvoryComponent<HTMLHeadingElement> {
|
|
9
8
|
class?: ClassValue;
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
18
|
<script lang="ts">
|
|
20
|
-
let { children, class: clazz }:
|
|
19
|
+
let { children, class: clazz, ...rest }: HeadingProps = $props();
|
|
21
20
|
</script>
|
|
22
21
|
|
|
23
22
|
<!--
|
|
@@ -28,6 +27,9 @@
|
|
|
28
27
|
If you set the `defaultClasses`, make sure to call it before using a component that uses the heading component (e.g. your root `+layout.svelte`).
|
|
29
28
|
-->
|
|
30
29
|
|
|
31
|
-
<h2
|
|
32
|
-
{
|
|
30
|
+
<h2
|
|
31
|
+
class={twMerge(clsx('shrink-0 truncate text-lg font-bold select-none', defaultClasses, clazz))}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{@render children?.()}
|
|
33
35
|
</h2>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
2
|
import type { ClassValue } from 'svelte/elements';
|
|
3
|
-
export interface
|
|
4
|
-
children: Snippet;
|
|
3
|
+
export interface HeadingProps extends IvoryComponent<HTMLHeadingElement> {
|
|
5
4
|
class?: ClassValue;
|
|
6
5
|
}
|
|
7
6
|
export declare function setClasses(c: ClassValue): void;
|
|
@@ -11,7 +10,7 @@ export declare function setClasses(c: ClassValue): void;
|
|
|
11
10
|
* including the ones used in other components of this lib, e.g. the `Modal`.
|
|
12
11
|
* If you set the `defaultClasses`, make sure to call it before using a component that uses the heading component (e.g. your root `+layout.svelte`).
|
|
13
12
|
*/
|
|
14
|
-
declare const Heading: import("svelte").Component<
|
|
13
|
+
declare const Heading: import("svelte").Component<HeadingProps, {}, "">;
|
|
15
14
|
type Heading = ReturnType<typeof Heading>;
|
|
16
15
|
export default Heading;
|
|
17
16
|
//# sourceMappingURL=Heading.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/heading/Heading.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Heading.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/heading/Heading.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IACpE,KAAK,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,QAEvC;AAkBL;;;;;GAKG;AACH,QAAA,MAAM,OAAO,kDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setClasses } from './Heading.svelte';
|
|
2
|
-
declare const Heading: import("svelte").Component<import("./Heading.svelte").
|
|
2
|
+
declare const Heading: import("svelte").Component<import("./Heading.svelte").HeadingProps, {}, ""> & {
|
|
3
3
|
setClasses: typeof setClasses;
|
|
4
4
|
};
|
|
5
5
|
export default Heading;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
import { fade } from 'svelte/transition';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -14,16 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
export const TEST_ID = 'background';
|
|
16
16
|
|
|
17
|
-
export interface
|
|
18
|
-
class?: ClassValue;
|
|
17
|
+
export interface HiddenBackgroundProps extends IvoryComponent<HTMLDialogElement> {
|
|
19
18
|
/** Gets called when the dialog is clicked */
|
|
20
19
|
onclose?: () => void;
|
|
21
|
-
|
|
20
|
+
duration?: number;
|
|
22
21
|
}
|
|
23
22
|
</script>
|
|
24
23
|
|
|
25
24
|
<script lang="ts">
|
|
26
|
-
let {
|
|
25
|
+
let {
|
|
26
|
+
class: clazz,
|
|
27
|
+
onclose,
|
|
28
|
+
children,
|
|
29
|
+
duration = 300,
|
|
30
|
+
...rest
|
|
31
|
+
}: HiddenBackgroundProps = $props();
|
|
27
32
|
</script>
|
|
28
33
|
|
|
29
34
|
<dialog
|
|
@@ -41,8 +46,9 @@
|
|
|
41
46
|
callback: onclose ?? (() => {})
|
|
42
47
|
}}
|
|
43
48
|
onclick={onclose}
|
|
44
|
-
transition:fade={{ duration
|
|
49
|
+
transition:fade={{ duration }}
|
|
45
50
|
data-testid={TEST_ID}
|
|
51
|
+
{...rest}
|
|
46
52
|
>
|
|
47
|
-
{@render children()}
|
|
53
|
+
{@render children?.()}
|
|
48
54
|
</dialog>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
2
|
import type { ClassValue } from 'svelte/elements';
|
|
3
3
|
export declare function setClasses(value: ClassValue): void;
|
|
4
4
|
export declare const TEST_ID = "background";
|
|
5
|
-
export interface
|
|
6
|
-
class?: ClassValue;
|
|
5
|
+
export interface HiddenBackgroundProps extends IvoryComponent<HTMLDialogElement> {
|
|
7
6
|
/** Gets called when the dialog is clicked */
|
|
8
7
|
onclose?: () => void;
|
|
9
|
-
|
|
8
|
+
duration?: number;
|
|
10
9
|
}
|
|
11
|
-
declare const HiddenBackground: import("svelte").Component<
|
|
10
|
+
declare const HiddenBackground: import("svelte").Component<HiddenBackgroundProps, {}, "">;
|
|
12
11
|
type HiddenBackground = ReturnType<typeof HiddenBackground>;
|
|
13
12
|
export default HiddenBackground;
|
|
14
13
|
//# sourceMappingURL=HiddenBackground.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenBackground.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/hiddenBackground/HiddenBackground.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HiddenBackground.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/hiddenBackground/HiddenBackground.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOlD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,QAE3C;AAED,eAAO,MAAM,OAAO,eAAe,CAAC;AAEpC,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC5E,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AA6BL,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setClasses } from './HiddenBackground.svelte';
|
|
2
|
-
declare const HiddenBackground: import("svelte").Component<import("./HiddenBackground.svelte").
|
|
2
|
+
declare const HiddenBackground: import("svelte").Component<import("./HiddenBackground.svelte").HiddenBackgroundProps, {}, ""> & {
|
|
3
3
|
setClasses: typeof setClasses;
|
|
4
4
|
TEST_ID: string;
|
|
5
5
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
2
|
-
export { default as Heading } from './heading
|
|
3
|
-
export
|
|
4
|
-
export { default as
|
|
2
|
+
export { default as Heading } from './heading';
|
|
3
|
+
export * from './hiddenBackground';
|
|
4
|
+
export { default as HiddenBackground } from './hiddenBackground';
|
|
5
|
+
export * from './modal/Modal.svelte';
|
|
6
|
+
export { default as Modal } from './modal/Modal.svelte';
|
|
5
7
|
export { default as Popover } from './popover/Popover.svelte';
|
|
6
|
-
export
|
|
7
|
-
export { default as
|
|
8
|
-
export
|
|
8
|
+
export * from './portal/Portal.svelte';
|
|
9
|
+
export { default as Portal } from './portal/Portal.svelte';
|
|
10
|
+
export * from './tabs';
|
|
11
|
+
export { default as Tabs } from './tabs';
|
|
12
|
+
export * from './tooltip/Tooltip.svelte';
|
|
13
|
+
export { default as Tooltip } from './tooltip/Tooltip.svelte';
|
|
9
14
|
//# 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,
|
|
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,WAAW,CAAC;AAE/C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9D,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE3D,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
2
|
-
export { default as Heading } from './heading
|
|
3
|
-
export
|
|
2
|
+
export { default as Heading } from './heading';
|
|
3
|
+
export * from './hiddenBackground';
|
|
4
|
+
export { default as HiddenBackground } from './hiddenBackground';
|
|
5
|
+
export * from './modal/Modal.svelte';
|
|
4
6
|
export { default as Modal } from './modal/Modal.svelte';
|
|
5
7
|
export { default as Popover } from './popover/Popover.svelte';
|
|
6
|
-
export
|
|
7
|
-
export { default as
|
|
8
|
+
export * from './portal/Portal.svelte';
|
|
9
|
+
export { default as Portal } from './portal/Portal.svelte';
|
|
10
|
+
export * from './tabs';
|
|
11
|
+
export { default as Tabs } from './tabs';
|
|
12
|
+
export * from './tooltip/Tooltip.svelte';
|
|
8
13
|
export { default as Tooltip } from './tooltip/Tooltip.svelte';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { IvoryComponent } from '../../../types';
|
|
2
3
|
import { X } from '@lucide/svelte';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import type { Snippet } from 'svelte';
|
|
5
|
-
import type { ClassValue } from 'svelte/elements';
|
|
6
|
+
import type { ClassValue, MouseEventHandler } from 'svelte/elements';
|
|
6
7
|
import { twMerge } from 'tailwind-merge';
|
|
7
8
|
import { Heading, HiddenBackground, Portal } from '..';
|
|
8
9
|
|
|
9
10
|
/** Props for the modal, expose if you overwrite the defaults in a custom component */
|
|
10
|
-
export interface ModalProps {
|
|
11
|
+
export interface ModalProps extends IvoryComponent<HTMLDivElement> {
|
|
11
12
|
/** Class of the modal itself, does not apply to the inner div */
|
|
12
13
|
class?: ClassValue;
|
|
13
14
|
/** Class of the div wrapping the children */
|
|
@@ -16,8 +17,6 @@
|
|
|
16
17
|
b_open: boolean;
|
|
17
18
|
/** Content of the modal */
|
|
18
19
|
children?: Snippet;
|
|
19
|
-
/** Style applied to the */
|
|
20
|
-
style?: string;
|
|
21
20
|
/** If `true` the modal will not close when clicking outside of it */
|
|
22
21
|
preventClosing?: boolean;
|
|
23
22
|
/** Variant of the modal, applies styling to the header */
|
|
@@ -32,12 +31,10 @@
|
|
|
32
31
|
interface Props extends ModalProps {
|
|
33
32
|
/** If you don't want the title and close button to be included you can overwrite the default modal */
|
|
34
33
|
modal?: Snippet;
|
|
35
|
-
testId?: string;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
let {
|
|
39
|
-
class: clazz = 'flex ',
|
|
40
|
-
style,
|
|
37
|
+
class: clazz = 'flex flex-col',
|
|
41
38
|
title,
|
|
42
39
|
b_open = $bindable(),
|
|
43
40
|
children,
|
|
@@ -45,13 +42,18 @@
|
|
|
45
42
|
preventClosing = false,
|
|
46
43
|
variant,
|
|
47
44
|
innerClass,
|
|
48
|
-
|
|
45
|
+
...rest
|
|
49
46
|
}: Props = $props();
|
|
50
47
|
|
|
51
48
|
function close() {
|
|
52
49
|
if (preventClosing) return;
|
|
53
50
|
b_open = false;
|
|
54
51
|
}
|
|
52
|
+
|
|
53
|
+
const onclick: MouseEventHandler<HTMLDivElement> = (e) => {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
rest.onclick?.(e);
|
|
56
|
+
};
|
|
55
57
|
</script>
|
|
56
58
|
|
|
57
59
|
<!--
|
|
@@ -67,12 +69,7 @@
|
|
|
67
69
|
{#if modal}
|
|
68
70
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
69
71
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
70
|
-
<div
|
|
71
|
-
class={clazz}
|
|
72
|
-
onclick={(e) => e.stopPropagation()}
|
|
73
|
-
data-testid={testId}
|
|
74
|
-
{style}
|
|
75
|
-
>
|
|
72
|
+
<div {...rest} {onclick}>
|
|
76
73
|
{@render modal()}
|
|
77
74
|
</div>
|
|
78
75
|
{:else}
|
|
@@ -85,9 +82,8 @@
|
|
|
85
82
|
clazz
|
|
86
83
|
])
|
|
87
84
|
)}
|
|
88
|
-
{
|
|
89
|
-
onclick
|
|
90
|
-
data-testid={testId}
|
|
85
|
+
{...rest}
|
|
86
|
+
{onclick}
|
|
91
87
|
>
|
|
92
88
|
<div
|
|
93
89
|
class={[
|