lutra 0.0.20 → 0.0.33
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/color.css +0 -0
- package/dist/display/Avatar.svelte +1 -1
- package/dist/display/Avatar.svelte.d.ts +18 -22
- package/dist/display/Badge.svelte +2 -4
- package/dist/display/Badge.svelte.d.ts +28 -32
- package/dist/display/Callout.svelte +8 -8
- package/dist/display/Callout.svelte.d.ts +27 -35
- package/dist/display/Close.svelte.d.ts +17 -20
- package/dist/display/Code.svelte +26 -31
- package/dist/display/Code.svelte.d.ts +31 -30
- package/dist/display/ContextTip.svelte +2 -5
- package/dist/display/ContextTip.svelte.d.ts +16 -20
- package/dist/display/DataList.svelte +16 -0
- package/dist/display/DataList.svelte.d.ts +21 -0
- package/dist/display/Details.svelte.d.ts +25 -30
- package/dist/display/Hero.svelte.d.ts +24 -28
- package/dist/display/Icon.svelte +3 -4
- package/dist/display/Icon.svelte.d.ts +18 -23
- package/dist/display/IconButton.svelte +12 -5
- package/dist/display/IconButton.svelte.d.ts +26 -29
- package/dist/display/Image.svelte.d.ts +25 -36
- package/dist/display/Indicator.svelte.d.ts +21 -22
- package/dist/display/Inset.svelte.d.ts +16 -20
- package/dist/display/LineChart.svelte +385 -0
- package/dist/display/LineChart.svelte.d.ts +24 -0
- package/dist/display/LoadingIndicator.svelte +33 -0
- package/dist/display/LoadingIndicator.svelte.d.ts +15 -0
- package/dist/display/Modal.svelte +116 -0
- package/dist/display/Modal.svelte.d.ts +27 -0
- package/dist/display/Notification.svelte.d.ts +22 -41
- package/dist/display/Panel.svelte +23 -0
- package/dist/display/Panel.svelte.d.ts +19 -0
- package/dist/display/Popup.svelte.d.ts +23 -28
- package/dist/{data → display}/Stat.svelte +9 -17
- package/dist/display/Stat.svelte.d.ts +30 -0
- package/dist/display/Table.svelte +14 -10
- package/dist/display/Table.svelte.d.ts +22 -32
- package/dist/display/TablePaginator.svelte +51 -0
- package/dist/display/TablePaginator.svelte.d.ts +21 -0
- package/dist/display/Tag.svelte.d.ts +29 -32
- package/dist/display/Tooltip.svelte +5 -4
- package/dist/display/Tooltip.svelte.d.ts +21 -26
- package/dist/display/chart.d.ts +78 -0
- package/dist/display/chart.js +212 -0
- package/dist/display/index.d.ts +11 -1
- package/dist/display/index.js +11 -1
- package/dist/display/notifications.svelte.d.ts +3 -3
- package/dist/display/notifications.svelte.js +2 -2
- package/dist/form/Button.svelte +7 -2
- package/dist/form/Button.svelte.d.ts +25 -35
- package/dist/form/FieldActions.svelte +25 -3
- package/dist/form/FieldActions.svelte.d.ts +18 -22
- package/dist/form/FieldContainer.svelte +1 -1
- package/dist/form/FieldContainer.svelte.d.ts +17 -22
- package/dist/form/FieldContent.svelte +52 -33
- package/dist/form/FieldContent.svelte.d.ts +28 -56
- package/dist/form/FieldError.svelte.d.ts +17 -20
- package/dist/form/FieldSection.svelte.d.ts +18 -32
- package/dist/form/Fieldset.svelte.d.ts +29 -40
- package/dist/form/Form.svelte +55 -17
- package/dist/form/Form.svelte.d.ts +36 -31
- package/dist/form/ImageUpload.svelte +259 -0
- package/dist/form/ImageUpload.svelte.d.ts +31 -0
- package/dist/form/Input.svelte +192 -153
- package/dist/form/Input.svelte.d.ts +115 -140
- package/dist/form/InputLength.svelte.d.ts +19 -20
- package/dist/form/Label.svelte +21 -4
- package/dist/form/Label.svelte.d.ts +24 -30
- package/dist/form/LogoUpload.svelte +100 -0
- package/dist/form/LogoUpload.svelte.d.ts +29 -0
- package/dist/form/Select.svelte +84 -36
- package/dist/form/Select.svelte.d.ts +69 -96
- package/dist/form/Textarea.svelte +163 -0
- package/dist/form/Textarea.svelte.d.ts +108 -0
- package/dist/form/Toggle.svelte +2 -0
- package/dist/form/Toggle.svelte.d.ts +15 -0
- package/dist/form/client.svelte.d.ts +8 -9
- package/dist/form/client.svelte.js +18 -10
- package/dist/form/form.d.ts +6 -4
- package/dist/form/form.js +23 -9
- package/dist/form/index.d.ts +6 -3
- package/dist/form/index.js +6 -3
- package/dist/form/types.d.ts +11 -1
- package/dist/icons/IconAlert.svelte.d.ts +23 -0
- package/dist/icons/{Copy.svelte → IconCopy.svelte} +1 -1
- package/dist/icons/IconCopy.svelte.d.ts +23 -0
- package/dist/icons/IconDone.svelte.d.ts +23 -0
- package/dist/icons/IconError.svelte.d.ts +23 -0
- package/dist/icons/IconHelp.svelte.d.ts +23 -0
- package/dist/icons/IconHide.svelte.d.ts +23 -0
- package/dist/icons/IconInfo.svelte.d.ts +23 -0
- package/dist/icons/IconLink.svelte.d.ts +23 -0
- package/dist/icons/IconMenuBurger.svelte.d.ts +23 -0
- package/dist/icons/IconMenuDots.svelte.d.ts +23 -0
- package/dist/icons/IconSearch.svelte +3 -0
- package/dist/icons/IconSearch.svelte.d.ts +23 -0
- package/dist/icons/IconShow.svelte.d.ts +23 -0
- package/dist/icons/IconSuccess.svelte.d.ts +23 -0
- package/dist/icons/IconWarning.svelte.d.ts +23 -0
- package/dist/icons/index.d.ts +14 -11
- package/dist/icons/index.js +14 -11
- package/dist/layout/Layout.svelte +7 -5
- package/dist/layout/Layout.svelte.d.ts +19 -22
- package/dist/layout/LayoutFooter.svelte.d.ts +17 -18
- package/dist/layout/LayoutGrid.svelte.d.ts +25 -36
- package/dist/layout/LayoutHeader.svelte +3 -0
- package/dist/layout/LayoutHeader.svelte.d.ts +33 -38
- package/dist/layout/LayoutSideMenu.svelte +18 -17
- package/dist/layout/LayoutSideMenu.svelte.d.ts +18 -22
- package/dist/layout/Overlay.svelte.d.ts +22 -32
- package/dist/layout/OverlayContainer.svelte.d.ts +14 -15
- package/dist/layout/OverlayLayer.svelte +6 -11
- package/dist/layout/OverlayLayer.svelte.d.ts +17 -20
- package/dist/layout/PageContent.svelte +9 -24
- package/dist/layout/PageContent.svelte.d.ts +23 -26
- package/dist/layout/Theme.svelte +19 -4
- package/dist/layout/Theme.svelte.d.ts +17 -22
- package/dist/layout/UIContent.svelte.d.ts +16 -20
- package/dist/layout/index.d.ts +5 -1
- package/dist/layout/index.js +5 -1
- package/dist/layout/overlays.svelte.d.ts +2 -2
- package/dist/nav/Breadcrumb.svelte +1 -1
- package/dist/nav/Breadcrumb.svelte.d.ts +26 -31
- package/dist/nav/Menu.svelte +6 -13
- package/dist/nav/Menu.svelte.d.ts +25 -31
- package/dist/nav/MenuItem.svelte +15 -8
- package/dist/nav/MenuItem.svelte.d.ts +20 -24
- package/dist/nav/MenuTypes.d.ts +7 -7
- package/dist/nav/NavMenu.svelte +7 -9
- package/dist/nav/NavMenu.svelte.d.ts +17 -18
- package/dist/nav/TabbedContent.svelte +1 -1
- package/dist/nav/TabbedContent.svelte.d.ts +21 -22
- package/dist/nav/Tabs.svelte +53 -13
- package/dist/nav/Tabs.svelte.d.ts +24 -25
- package/dist/nav/index.d.ts +2 -1
- package/dist/nav/index.js +2 -1
- package/dist/style.css +176 -79
- package/dist/typo/Clamp.svelte.d.ts +22 -26
- package/dist/typo/H.svelte.d.ts +26 -30
- package/dist/typo/H1.svelte.d.ts +24 -28
- package/dist/typo/H2.svelte.d.ts +24 -28
- package/dist/typo/H3.svelte.d.ts +24 -28
- package/dist/typo/H4.svelte.d.ts +24 -28
- package/dist/typo/H5.svelte.d.ts +24 -28
- package/dist/typo/H6.svelte.d.ts +24 -28
- package/dist/typo/P.svelte.d.ts +24 -28
- package/dist/utils/StringOrComponent.svelte +14 -0
- package/dist/utils/StringOrComponent.svelte.d.ts +19 -0
- package/dist/utils/StringOrSnippet.svelte +11 -0
- package/dist/utils/StringOrSnippet.svelte.d.ts +19 -0
- package/dist/utils/color.d.ts +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/isSnippet.d.ts +3 -5
- package/dist/utils/isSnippet.js +9 -4
- package/package.json +32 -25
- package/dist/data/Stat.svelte.d.ts +0 -39
- package/dist/data/index.d.ts +0 -1
- package/dist/data/index.js +0 -1
- package/dist/grid/Column.svelte +0 -11
- package/dist/grid/Column.svelte.d.ts +0 -22
- package/dist/grid/Grid.svelte +0 -19
- package/dist/grid/Grid.svelte.d.ts +0 -24
- package/dist/grid/Row.svelte +0 -44
- package/dist/grid/Row.svelte.d.ts +0 -24
- package/dist/icons/Alert.svelte.d.ts +0 -23
- package/dist/icons/Copy.svelte.d.ts +0 -23
- package/dist/icons/Done.svelte.d.ts +0 -23
- package/dist/icons/Error.svelte.d.ts +0 -23
- package/dist/icons/Help.svelte.d.ts +0 -23
- package/dist/icons/Hide.svelte.d.ts +0 -23
- package/dist/icons/Info.svelte.d.ts +0 -23
- package/dist/icons/Link.svelte.d.ts +0 -23
- package/dist/icons/MenuBurger.svelte.d.ts +0 -23
- package/dist/icons/MenuDots.svelte.d.ts +0 -23
- package/dist/icons/Show.svelte.d.ts +0 -23
- package/dist/icons/Success.svelte.d.ts +0 -23
- package/dist/icons/Warning.svelte.d.ts +0 -23
- package/dist/utils/StringOrComponentOrSnippet.svelte +0 -14
- package/dist/utils/StringOrComponentOrSnippet.svelte.d.ts +0 -24
- /package/dist/icons/{Alert.svelte → IconAlert.svelte} +0 -0
- /package/dist/icons/{Done.svelte → IconDone.svelte} +0 -0
- /package/dist/icons/{Error.svelte → IconError.svelte} +0 -0
- /package/dist/icons/{Help.svelte → IconHelp.svelte} +0 -0
- /package/dist/icons/{Hide.svelte → IconHide.svelte} +0 -0
- /package/dist/icons/{Info.svelte → IconInfo.svelte} +0 -0
- /package/dist/icons/{Link.svelte → IconLink.svelte} +0 -0
- /package/dist/icons/{MenuBurger.svelte → IconMenuBurger.svelte} +0 -0
- /package/dist/icons/{MenuDots.svelte → IconMenuDots.svelte} +0 -0
- /package/dist/icons/{Show.svelte → IconShow.svelte} +0 -0
- /package/dist/icons/{Success.svelte → IconSuccess.svelte} +0 -0
- /package/dist/icons/{Warning.svelte → IconWarning.svelte} +0 -0
package/dist/color.css
ADDED
File without changes
|
@@ -1,23 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
};
|
11
|
-
slots: {};
|
12
|
-
};
|
13
|
-
export type AvatarProps = typeof __propDef.props;
|
14
|
-
export type AvatarEvents = typeof __propDef.events;
|
15
|
-
export type AvatarSlots = typeof __propDef.slots;
|
16
|
-
export default class Avatar extends SvelteComponent<AvatarProps, AvatarEvents, AvatarSlots> {
|
17
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
18
|
-
src?: string | undefined;
|
19
|
-
name?: string | undefined;
|
20
|
-
shape?: "circle" | "square" | "rounded" | undefined;
|
21
|
-
}>);
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports;
|
9
|
+
z_$$bindings?: Bindings;
|
22
10
|
}
|
23
|
-
|
11
|
+
declare const Avatar: $$__sveltets_2_IsomorphicComponent<{
|
12
|
+
src?: string;
|
13
|
+
name?: string;
|
14
|
+
shape?: "circle" | "square" | "rounded";
|
15
|
+
}, {
|
16
|
+
[evt: string]: CustomEvent<any>;
|
17
|
+
}, {}, {}, "">;
|
18
|
+
type Avatar = InstanceType<typeof Avatar>;
|
19
|
+
export default Avatar;
|
@@ -10,10 +10,8 @@ let {
|
|
10
10
|
let el = $state(null);
|
11
11
|
let isSet = $derived(isStatusColor(color));
|
12
12
|
let charCount = $derived.by(() => {
|
13
|
-
if (count === void 0)
|
14
|
-
|
15
|
-
if (max && count > max)
|
16
|
-
return max.toString().length + 1;
|
13
|
+
if (count === void 0) return 0;
|
14
|
+
if (max && count > max) return max.toString().length + 1;
|
17
15
|
return count.toString().length;
|
18
16
|
});
|
19
17
|
</script>
|
@@ -1,34 +1,30 @@
|
|
1
|
-
import {
|
1
|
+
import type { Snippet } from "svelte";
|
2
2
|
import type { StatusColorOrString } from "../utils/color.js";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}) | undefined;
|
13
|
-
};
|
14
|
-
events: {
|
15
|
-
[evt: string]: CustomEvent<any>;
|
16
|
-
};
|
17
|
-
slots: {};
|
18
|
-
};
|
19
|
-
export type BadgeProps = typeof __propDef.props;
|
20
|
-
export type BadgeEvents = typeof __propDef.events;
|
21
|
-
export type BadgeSlots = typeof __propDef.slots;
|
22
|
-
export default class Badge extends SvelteComponent<BadgeProps, BadgeEvents, BadgeSlots> {
|
23
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
24
|
-
count?: number | undefined;
|
25
|
-
max?: number | undefined;
|
26
|
-
color?: StatusColorOrString | undefined;
|
27
|
-
glow?: boolean | undefined;
|
28
|
-
outline?: boolean | undefined;
|
29
|
-
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
30
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
31
|
-
}) | undefined;
|
32
|
-
}>);
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
5
|
+
$$bindings?: Bindings;
|
6
|
+
} & Exports;
|
7
|
+
(internal: unknown, props: Props & {
|
8
|
+
$$events?: Events;
|
9
|
+
$$slots?: Slots;
|
10
|
+
}): Exports;
|
11
|
+
z_$$bindings?: Bindings;
|
33
12
|
}
|
34
|
-
|
13
|
+
declare const Badge: $$__sveltets_2_IsomorphicComponent<{
|
14
|
+
/** Count to display in the badge. */
|
15
|
+
count?: number;
|
16
|
+
/** The maximum count to display. */
|
17
|
+
max?: number;
|
18
|
+
/** The color of the tag. */
|
19
|
+
color?: StatusColorOrString;
|
20
|
+
/** Whether to add a glow to the badge. */
|
21
|
+
glow?: boolean;
|
22
|
+
/** Whether to add an outline to the badge. */
|
23
|
+
outline?: boolean;
|
24
|
+
/** The content to display inside the badge. */
|
25
|
+
children?: Snippet;
|
26
|
+
}, {
|
27
|
+
[evt: string]: CustomEvent<any>;
|
28
|
+
}, {}, {}, "">;
|
29
|
+
type Badge = InstanceType<typeof Badge>;
|
30
|
+
export default Badge;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<script lang="ts">import Icon from "./Icon.svelte";
|
2
|
-
import Alert from "../icons/
|
3
|
-
import Info from "../icons/
|
4
|
-
import Success from "../icons/
|
5
|
-
import Warning from "../icons/
|
6
|
-
import Error from "../icons/
|
7
|
-
import PageContent from "../layout/PageContent.svelte";
|
2
|
+
import Alert from "../icons/IconAlert.svelte";
|
3
|
+
import Info from "../icons/IconInfo.svelte";
|
4
|
+
import Success from "../icons/IconSuccess.svelte";
|
5
|
+
import Warning from "../icons/IconWarning.svelte";
|
6
|
+
import Error from "../icons/IconError.svelte";
|
8
7
|
import Tooltip from "./Tooltip.svelte";
|
9
8
|
let {
|
10
9
|
icon,
|
11
10
|
type,
|
12
11
|
contained,
|
13
12
|
rounded,
|
14
|
-
dismissable
|
13
|
+
dismissable,
|
14
|
+
children
|
15
15
|
} = $props();
|
16
16
|
if (!icon) {
|
17
17
|
switch (type) {
|
@@ -42,7 +42,7 @@ if (!icon) {
|
|
42
42
|
<Icon {icon} --icon-width="1.5rem" --icon-height="1.5rem" />
|
43
43
|
{/if}
|
44
44
|
<div class="CalloutText">
|
45
|
-
|
45
|
+
{@render children()}
|
46
46
|
</div>
|
47
47
|
{#if dismissable}
|
48
48
|
<div class="Dismiss">
|
@@ -1,36 +1,28 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
dismissable?: boolean | undefined;
|
12
|
-
};
|
13
|
-
events: {
|
14
|
-
[evt: string]: CustomEvent<any>;
|
15
|
-
};
|
16
|
-
slots: {
|
17
|
-
default: {};
|
18
|
-
};
|
19
|
-
};
|
20
|
-
export type CalloutProps = typeof __propDef.props;
|
21
|
-
export type CalloutEvents = typeof __propDef.events;
|
22
|
-
export type CalloutSlots = typeof __propDef.slots;
|
23
|
-
export default class Callout extends SvelteComponent<CalloutProps, CalloutEvents, CalloutSlots> {
|
24
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<__sveltets_2_PropsWithChildren<{
|
25
|
-
icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
26
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
27
|
-
}) | ComponentType | undefined;
|
28
|
-
type?: "ok" | "alert" | "warn" | "info" | "task" | undefined;
|
29
|
-
contained?: boolean | undefined;
|
30
|
-
rounded?: boolean | undefined;
|
31
|
-
dismissable?: boolean | undefined;
|
32
|
-
}, {
|
33
|
-
default: {};
|
34
|
-
}>>);
|
1
|
+
import type { Component, Snippet } from "svelte";
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
4
|
+
$$bindings?: Bindings;
|
5
|
+
} & Exports;
|
6
|
+
(internal: unknown, props: Props & {
|
7
|
+
$$events?: Events;
|
8
|
+
$$slots?: Slots;
|
9
|
+
}): Exports;
|
10
|
+
z_$$bindings?: Bindings;
|
35
11
|
}
|
36
|
-
|
12
|
+
declare const Callout: $$__sveltets_2_IsomorphicComponent<{
|
13
|
+
/** The icon to display. If not specified, it will default to the type. */
|
14
|
+
icon?: string | Component;
|
15
|
+
/** The type of callout. If not specified and no icon is provided, no icon will be displayed. */
|
16
|
+
type?: "alert" | "info" | "ok" | "warn" | "task";
|
17
|
+
/** Whether to contain the element in a box. */
|
18
|
+
contained?: boolean;
|
19
|
+
/** Whether to round the corners of the element. */
|
20
|
+
rounded?: boolean;
|
21
|
+
/** Whether the callout is dismissable. */
|
22
|
+
dismissable?: boolean;
|
23
|
+
children: Snippet;
|
24
|
+
}, {
|
25
|
+
[evt: string]: CustomEvent<any>;
|
26
|
+
}, {}, {}, "">;
|
27
|
+
type Callout = InstanceType<typeof Callout>;
|
28
|
+
export default Callout;
|
@@ -1,21 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
slots: {};
|
11
|
-
};
|
12
|
-
export type CloseProps = typeof __propDef.props;
|
13
|
-
export type CloseEvents = typeof __propDef.events;
|
14
|
-
export type CloseSlots = typeof __propDef.slots;
|
15
|
-
export default class Close extends SvelteComponent<CloseProps, CloseEvents, CloseSlots> {
|
16
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
17
|
-
onclick?: ((e: MouseEvent) => void) | undefined;
|
18
|
-
position?: "top left" | "top right" | "bottom left" | "bottom right" | undefined;
|
19
|
-
}>);
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports;
|
9
|
+
z_$$bindings?: Bindings;
|
20
10
|
}
|
21
|
-
|
11
|
+
declare const Close: $$__sveltets_2_IsomorphicComponent<{
|
12
|
+
onclick?: (e: MouseEvent) => void;
|
13
|
+
position?: "top left" | "top right" | "bottom left" | "bottom right";
|
14
|
+
}, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Close = InstanceType<typeof Close>;
|
18
|
+
export default Close;
|
package/dist/display/Code.svelte
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
<script lang="ts">import Copy from "../icons/
|
2
|
-
import Done from "../icons/
|
1
|
+
<script lang="ts">import Copy from "../icons/IconCopy.svelte";
|
2
|
+
import Done from "../icons/IconDone.svelte";
|
3
3
|
import IconButton from "./IconButton.svelte";
|
4
4
|
import Tooltip from "./Tooltip.svelte";
|
5
5
|
let {
|
@@ -8,6 +8,7 @@ let {
|
|
8
8
|
copyable,
|
9
9
|
contained,
|
10
10
|
rounded,
|
11
|
+
singleLine,
|
11
12
|
lineNumbers,
|
12
13
|
readonly
|
13
14
|
} = $props();
|
@@ -19,8 +20,7 @@ let el = $state(null);
|
|
19
20
|
let scrollTop = $state(0);
|
20
21
|
let scrollLeft = $state(0);
|
21
22
|
function copy() {
|
22
|
-
if (!el)
|
23
|
-
return;
|
23
|
+
if (!el) return;
|
24
24
|
if (navigator.clipboard) {
|
25
25
|
navigator.clipboard.writeText(code);
|
26
26
|
} else {
|
@@ -38,6 +38,7 @@ function copy() {
|
|
38
38
|
}, 1500);
|
39
39
|
}
|
40
40
|
function onscroll(e) {
|
41
|
+
console.log("scrolling");
|
41
42
|
scrollTop = e.target.scrollTop;
|
42
43
|
scrollLeft = e.target.scrollLeft;
|
43
44
|
}
|
@@ -46,26 +47,28 @@ let codeLines = $derived.by(() => {
|
|
46
47
|
});
|
47
48
|
</script>
|
48
49
|
|
49
|
-
<div class="Code" class:lineNumbers class:singleLine
|
50
|
-
{#if
|
50
|
+
<div class="Code" class:lineNumbers class:singleLine class:rounded class:copyable class:contained class:hasOverlay={highlight}>
|
51
|
+
{#if singleLine}
|
51
52
|
<input class="CodeInput" spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off" {readonly} bind:this={el} bind:value={code} title={copyable ? code : undefined} {onscroll} />
|
52
53
|
{:else}
|
53
54
|
<textarea class="CodeInput" spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off" {readonly} bind:this={el} bind:value={code} {onscroll}></textarea>
|
54
55
|
{/if}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<
|
56
|
+
{#if highlight}
|
57
|
+
<div class="Overlay" tabindex="-1" aria-hidden="true" style="top: {-scrollTop}px; left: {-scrollLeft}px;">
|
58
|
+
{#each codeLines as line, index}
|
59
|
+
<div class="Line">
|
60
|
+
{#if lineNumbers}
|
61
|
+
<div class="Number">
|
62
|
+
<span>{index + 1}</span>
|
63
|
+
</div>
|
64
|
+
{/if}
|
65
|
+
<div class="Content">
|
66
|
+
{@html line}
|
61
67
|
</div>
|
62
|
-
{/if}
|
63
|
-
<div class="Content">
|
64
|
-
{@html line}
|
65
68
|
</div>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
{/each}
|
70
|
+
</div>
|
71
|
+
{/if}
|
69
72
|
{#if copyable}
|
70
73
|
<Tooltip tip={title} {open}>
|
71
74
|
<IconButton icon={btnIcon} onclick={copy} disabled={open} />
|
@@ -77,6 +80,7 @@ let codeLines = $derived.by(() => {
|
|
77
80
|
.Code {
|
78
81
|
display: grid;
|
79
82
|
align-items: start;
|
83
|
+
grid-template-columns: 1fr;
|
80
84
|
grid-template-areas: "content";
|
81
85
|
}
|
82
86
|
.Code.lineNumbers {
|
@@ -94,6 +98,7 @@ let codeLines = $derived.by(() => {
|
|
94
98
|
border: 0;
|
95
99
|
grid-area: content;
|
96
100
|
background: var(--field-bg);
|
101
|
+
scrollbar-width: thin;
|
97
102
|
}
|
98
103
|
textarea {
|
99
104
|
width: 100%;
|
@@ -105,6 +110,7 @@ let codeLines = $derived.by(() => {
|
|
105
110
|
writing-mode: lr;
|
106
111
|
resize: none;
|
107
112
|
z-index: -1;
|
113
|
+
scrollbar-width: thin;
|
108
114
|
}
|
109
115
|
.Code.lineNumbers textarea {
|
110
116
|
padding-inline-start: 2rem;
|
@@ -170,21 +176,10 @@ let codeLines = $derived.by(() => {
|
|
170
176
|
line-height: 1;
|
171
177
|
}
|
172
178
|
|
173
|
-
.
|
174
|
-
grid-area: lines;
|
179
|
+
.Line {
|
175
180
|
display: grid;
|
176
|
-
padding-right: 0.5rem;
|
177
|
-
width: 2rem;
|
178
|
-
font-size: var(--font-size, 1em);
|
179
|
-
line-height: 1.5;
|
180
|
-
text-align: end;
|
181
|
-
justify-content: end;
|
182
|
-
font-family: var(--font-family-mono);
|
183
|
-
font-size: var(--font-size, 1em);
|
184
|
-
color: var(--text-subtle);
|
185
|
-
opacity: 0.75;
|
186
181
|
}
|
187
|
-
.Line {
|
182
|
+
.Code.lineNumbers .Line {
|
188
183
|
display: grid;
|
189
184
|
grid-template-columns: 2rem 1fr;
|
190
185
|
}
|
@@ -1,31 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
readonly?: boolean | undefined;
|
11
|
-
};
|
12
|
-
events: {
|
13
|
-
[evt: string]: CustomEvent<any>;
|
14
|
-
};
|
15
|
-
slots: {};
|
16
|
-
};
|
17
|
-
export type CodeProps = typeof __propDef.props;
|
18
|
-
export type CodeEvents = typeof __propDef.events;
|
19
|
-
export type CodeSlots = typeof __propDef.slots;
|
20
|
-
export default class Code extends SvelteComponent<CodeProps, CodeEvents, CodeSlots> {
|
21
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
22
|
-
code: import("svelte").Bindable<string>;
|
23
|
-
highlight?: ((code: string) => string) | undefined;
|
24
|
-
copyable?: boolean | undefined;
|
25
|
-
contained?: boolean | undefined;
|
26
|
-
rounded?: boolean | undefined;
|
27
|
-
lineNumbers?: boolean | undefined;
|
28
|
-
readonly?: boolean | undefined;
|
29
|
-
}>);
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports;
|
9
|
+
z_$$bindings?: Bindings;
|
30
10
|
}
|
31
|
-
|
11
|
+
declare const Code: $$__sveltets_2_IsomorphicComponent<{
|
12
|
+
/** The code to display. */
|
13
|
+
code: string;
|
14
|
+
/** A function to highlight parts of the code. */
|
15
|
+
highlight?: (code: string) => string;
|
16
|
+
/** Whether the code is copyable. */
|
17
|
+
copyable?: boolean;
|
18
|
+
/** Whether to contain the element in a box. */
|
19
|
+
contained?: boolean;
|
20
|
+
/** Whether to round the corners of the element. */
|
21
|
+
rounded?: boolean;
|
22
|
+
/** Whether the code is a single line. */
|
23
|
+
singleLine?: boolean;
|
24
|
+
/** Whether to show line numbers. */
|
25
|
+
lineNumbers?: boolean;
|
26
|
+
/** Whether the code is readonly. */
|
27
|
+
readonly?: boolean;
|
28
|
+
}, {
|
29
|
+
[evt: string]: CustomEvent<any>;
|
30
|
+
}, {}, {}, "code">;
|
31
|
+
type Code = InstanceType<typeof Code>;
|
32
|
+
export default Code;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts">import Tooltip from "./Tooltip.svelte";
|
2
|
-
import Help from "../icons/
|
2
|
+
import Help from "../icons/IconHelp.svelte";
|
3
3
|
import Icon from "./Icon.svelte";
|
4
4
|
let {
|
5
5
|
tip
|
@@ -7,7 +7,7 @@ let {
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<Tooltip {tip}>
|
10
|
-
<a href="#
|
10
|
+
<a href="#contexttip" onclick={(e) => { e.preventDefault(); e.stopPropagation(); }}>
|
11
11
|
<Icon icon={Help} --icon-width="16px" --icon-height="16px" --cursor="help" --vertical-align="baseline" />
|
12
12
|
</a>
|
13
13
|
</Tooltip>
|
@@ -20,7 +20,4 @@ let {
|
|
20
20
|
width: 16px;
|
21
21
|
display: inline-block;
|
22
22
|
}
|
23
|
-
a:focus,
|
24
|
-
a:active {
|
25
|
-
}
|
26
23
|
</style>
|
@@ -1,22 +1,18 @@
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
2
1
|
import type { Snippet } from "svelte";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
};
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
export type ContextTipProps = typeof __propDef.props;
|
13
|
-
export type ContextTipEvents = typeof __propDef.events;
|
14
|
-
export type ContextTipSlots = typeof __propDef.slots;
|
15
|
-
export default class ContextTip extends SvelteComponent<ContextTipProps, ContextTipEvents, ContextTipSlots> {
|
16
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
17
|
-
tip: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
18
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
19
|
-
});
|
20
|
-
}>);
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
4
|
+
$$bindings?: Bindings;
|
5
|
+
} & Exports;
|
6
|
+
(internal: unknown, props: Props & {
|
7
|
+
$$events?: Events;
|
8
|
+
$$slots?: Slots;
|
9
|
+
}): Exports;
|
10
|
+
z_$$bindings?: Bindings;
|
21
11
|
}
|
22
|
-
|
12
|
+
declare const ContextTip: $$__sveltets_2_IsomorphicComponent<{
|
13
|
+
tip: string | Snippet;
|
14
|
+
}, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ContextTip = InstanceType<typeof ContextTip>;
|
18
|
+
export default ContextTip;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<script lang="ts">import StringOrSnippet from "../utils/StringOrSnippet.svelte";
|
2
|
+
let {
|
3
|
+
items
|
4
|
+
} = $props();
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<div class="data-list">
|
8
|
+
{#each items as { label, value }, i}
|
9
|
+
<div class="data-list-item">
|
10
|
+
<div class="data-list-item-label">{label}</div>
|
11
|
+
<div class="data-list-item-value">
|
12
|
+
<StringOrSnippet content={value} />
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
{/each}
|
16
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { Snippet } from "svelte";
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
4
|
+
$$bindings?: Bindings;
|
5
|
+
} & Exports;
|
6
|
+
(internal: unknown, props: Props & {
|
7
|
+
$$events?: Events;
|
8
|
+
$$slots?: Slots;
|
9
|
+
}): Exports;
|
10
|
+
z_$$bindings?: Bindings;
|
11
|
+
}
|
12
|
+
declare const DataList: $$__sveltets_2_IsomorphicComponent<{
|
13
|
+
items: {
|
14
|
+
label: string;
|
15
|
+
value: string | Snippet;
|
16
|
+
}[];
|
17
|
+
}, {
|
18
|
+
[evt: string]: CustomEvent<any>;
|
19
|
+
}, {}, {}, "">;
|
20
|
+
type DataList = InstanceType<typeof DataList>;
|
21
|
+
export default DataList;
|
@@ -1,32 +1,27 @@
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
2
1
|
import type { Snippet } from "svelte";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
};
|
11
|
-
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
};
|
14
|
-
slots: {};
|
15
|
-
};
|
16
|
-
export type DetailsProps = typeof __propDef.props;
|
17
|
-
export type DetailsEvents = typeof __propDef.events;
|
18
|
-
export type DetailsSlots = typeof __propDef.slots;
|
19
|
-
export default class Details extends SvelteComponent<DetailsProps, DetailsEvents, DetailsSlots> {
|
20
|
-
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
21
|
-
summary: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
22
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
23
|
-
});
|
24
|
-
contained?: boolean | undefined;
|
25
|
-
rounded?: boolean | undefined;
|
26
|
-
open?: boolean | undefined;
|
27
|
-
children: (this: void) => typeof import("svelte").SnippetReturn & {
|
28
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
29
|
-
};
|
30
|
-
}>);
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
4
|
+
$$bindings?: Bindings;
|
5
|
+
} & Exports;
|
6
|
+
(internal: unknown, props: Props & {
|
7
|
+
$$events?: Events;
|
8
|
+
$$slots?: Slots;
|
9
|
+
}): Exports;
|
10
|
+
z_$$bindings?: Bindings;
|
31
11
|
}
|
32
|
-
|
12
|
+
declare const Details: $$__sveltets_2_IsomorphicComponent<{
|
13
|
+
/** The summary of the element. Can be a string or a snippet. */
|
14
|
+
summary: string | Snippet;
|
15
|
+
/** Contain the element in a box. */
|
16
|
+
contained?: boolean;
|
17
|
+
/** Round the corners of the element if contained. */
|
18
|
+
rounded?: boolean;
|
19
|
+
/** Whether the details are open. */
|
20
|
+
open?: boolean;
|
21
|
+
/** The content of the element. */
|
22
|
+
children: Snippet;
|
23
|
+
}, {
|
24
|
+
[evt: string]: CustomEvent<any>;
|
25
|
+
}, {}, {}, "">;
|
26
|
+
type Details = InstanceType<typeof Details>;
|
27
|
+
export default Details;
|