lutra 0.0.33 → 0.1.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.
- package/README.md +4 -24
- package/dist/components/AspectRatio.svelte +26 -0
- package/dist/components/AspectRatio.svelte.d.ts +8 -0
- package/dist/components/Dialog.svelte +78 -0
- package/dist/components/Dialog.svelte.d.ts +14 -0
- package/dist/components/Layout.svelte +32 -0
- package/dist/components/Layout.svelte.d.ts +11 -0
- package/dist/components/PageContent.svelte +108 -0
- package/dist/components/PageContent.svelte.d.ts +38 -0
- package/dist/components/Theme.svelte +87 -0
- package/dist/components/Theme.svelte.d.ts +17 -0
- package/dist/{display → components}/Tooltip.svelte +33 -8
- package/dist/components/Tooltip.svelte.d.ts +12 -0
- package/dist/config.d.ts +30 -0
- package/dist/config.js +18 -0
- package/dist/css/0-layers.css +1 -0
- package/dist/css/1-props.css +775 -0
- package/dist/css/2-base.css +209 -0
- package/dist/css/3-typo.css +65 -0
- package/dist/css/4-layout.css +5 -0
- package/dist/css/5-media.css +21 -0
- package/dist/css/lutra.css +6 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -2
- package/dist/types.d.ts +39 -0
- package/dist/types.js +25 -0
- package/package.json +29 -82
- package/dist/color.css +0 -0
- package/dist/display/Avatar.svelte +0 -61
- package/dist/display/Avatar.svelte.d.ts +0 -19
- package/dist/display/Badge.svelte +0 -91
- package/dist/display/Badge.svelte.d.ts +0 -30
- package/dist/display/Callout.svelte +0 -109
- package/dist/display/Callout.svelte.d.ts +0 -28
- package/dist/display/Close.svelte +0 -58
- package/dist/display/Close.svelte.d.ts +0 -18
- package/dist/display/Code.svelte +0 -190
- package/dist/display/Code.svelte.d.ts +0 -32
- package/dist/display/ContextTip.svelte +0 -23
- package/dist/display/ContextTip.svelte.d.ts +0 -18
- package/dist/display/DataList.svelte +0 -16
- package/dist/display/DataList.svelte.d.ts +0 -21
- package/dist/display/Details.svelte +0 -49
- package/dist/display/Details.svelte.d.ts +0 -27
- package/dist/display/Hero.svelte +0 -50
- package/dist/display/Hero.svelte.d.ts +0 -26
- package/dist/display/Icon.svelte +0 -39
- package/dist/display/Icon.svelte.d.ts +0 -19
- package/dist/display/IconButton.svelte +0 -91
- package/dist/display/IconButton.svelte.d.ts +0 -27
- package/dist/display/Image.svelte +0 -91
- package/dist/display/Image.svelte.d.ts +0 -26
- package/dist/display/Indicator.svelte +0 -352
- package/dist/display/Indicator.svelte.d.ts +0 -23
- package/dist/display/Inset.svelte +0 -18
- package/dist/display/Inset.svelte.d.ts +0 -18
- package/dist/display/LineChart.svelte +0 -385
- package/dist/display/LineChart.svelte.d.ts +0 -24
- package/dist/display/LoadingIndicator.svelte +0 -33
- package/dist/display/LoadingIndicator.svelte.d.ts +0 -15
- package/dist/display/Modal.svelte +0 -116
- package/dist/display/Modal.svelte.d.ts +0 -27
- package/dist/display/Notification.svelte +0 -104
- package/dist/display/Notification.svelte.d.ts +0 -23
- package/dist/display/Panel.svelte +0 -23
- package/dist/display/Panel.svelte.d.ts +0 -19
- package/dist/display/Popup.svelte +0 -111
- package/dist/display/Popup.svelte.d.ts +0 -25
- package/dist/display/Stat.svelte +0 -81
- package/dist/display/Stat.svelte.d.ts +0 -30
- package/dist/display/Table.svelte +0 -28
- package/dist/display/Table.svelte.d.ts +0 -24
- package/dist/display/TablePaginator.svelte +0 -51
- package/dist/display/TablePaginator.svelte.d.ts +0 -21
- package/dist/display/Tag.svelte +0 -90
- package/dist/display/Tag.svelte.d.ts +0 -32
- package/dist/display/Tooltip.svelte.d.ts +0 -23
- package/dist/display/chart.d.ts +0 -78
- package/dist/display/chart.js +0 -212
- package/dist/display/index.d.ts +0 -24
- package/dist/display/index.js +0 -24
- package/dist/display/notifications.svelte.d.ts +0 -21
- package/dist/display/notifications.svelte.js +0 -31
- package/dist/form/Button.svelte +0 -39
- package/dist/form/Button.svelte.d.ts +0 -26
- package/dist/form/FieldActions.svelte +0 -68
- package/dist/form/FieldActions.svelte.d.ts +0 -20
- package/dist/form/FieldContainer.svelte +0 -37
- package/dist/form/FieldContainer.svelte.d.ts +0 -19
- package/dist/form/FieldContent.svelte +0 -153
- package/dist/form/FieldContent.svelte.d.ts +0 -31
- package/dist/form/FieldError.svelte +0 -14
- package/dist/form/FieldError.svelte.d.ts +0 -18
- package/dist/form/FieldSection.svelte +0 -86
- package/dist/form/FieldSection.svelte.d.ts +0 -20
- package/dist/form/Fieldset.svelte +0 -68
- package/dist/form/Fieldset.svelte.d.ts +0 -31
- package/dist/form/Form.svelte +0 -136
- package/dist/form/Form.svelte.d.ts +0 -38
- package/dist/form/ImageUpload.svelte +0 -259
- package/dist/form/ImageUpload.svelte.d.ts +0 -31
- package/dist/form/Input.svelte +0 -326
- package/dist/form/Input.svelte.d.ts +0 -117
- package/dist/form/InputLength.svelte +0 -32
- package/dist/form/InputLength.svelte.d.ts +0 -20
- package/dist/form/Label.svelte +0 -44
- package/dist/form/Label.svelte.d.ts +0 -25
- package/dist/form/LogoUpload.svelte +0 -100
- package/dist/form/LogoUpload.svelte.d.ts +0 -29
- package/dist/form/Select.svelte +0 -136
- package/dist/form/Select.svelte.d.ts +0 -70
- package/dist/form/Textarea.svelte +0 -163
- package/dist/form/Textarea.svelte.d.ts +0 -108
- package/dist/form/Toggle.svelte +0 -2
- package/dist/form/Toggle.svelte.d.ts +0 -15
- package/dist/form/client.svelte.d.ts +0 -44
- package/dist/form/client.svelte.js +0 -98
- package/dist/form/form.d.ts +0 -54
- package/dist/form/form.js +0 -340
- package/dist/form/index.d.ts +0 -18
- package/dist/form/index.js +0 -18
- package/dist/form/types.d.ts +0 -62
- package/dist/form/types.js +0 -1
- package/dist/icons/IconAlert.svelte +0 -3
- package/dist/icons/IconAlert.svelte.d.ts +0 -23
- package/dist/icons/IconCopy.svelte +0 -3
- package/dist/icons/IconCopy.svelte.d.ts +0 -23
- package/dist/icons/IconDone.svelte +0 -3
- package/dist/icons/IconDone.svelte.d.ts +0 -23
- package/dist/icons/IconError.svelte +0 -3
- package/dist/icons/IconError.svelte.d.ts +0 -23
- package/dist/icons/IconHelp.svelte +0 -3
- package/dist/icons/IconHelp.svelte.d.ts +0 -23
- package/dist/icons/IconHide.svelte +0 -3
- package/dist/icons/IconHide.svelte.d.ts +0 -23
- package/dist/icons/IconInfo.svelte +0 -3
- package/dist/icons/IconInfo.svelte.d.ts +0 -23
- package/dist/icons/IconLink.svelte +0 -3
- package/dist/icons/IconLink.svelte.d.ts +0 -23
- package/dist/icons/IconMenuBurger.svelte +0 -3
- package/dist/icons/IconMenuBurger.svelte.d.ts +0 -23
- package/dist/icons/IconMenuDots.svelte +0 -3
- package/dist/icons/IconMenuDots.svelte.d.ts +0 -23
- package/dist/icons/IconSearch.svelte +0 -3
- package/dist/icons/IconSearch.svelte.d.ts +0 -23
- package/dist/icons/IconShow.svelte +0 -3
- package/dist/icons/IconShow.svelte.d.ts +0 -23
- package/dist/icons/IconSuccess.svelte +0 -3
- package/dist/icons/IconSuccess.svelte.d.ts +0 -23
- package/dist/icons/IconWarning.svelte +0 -3
- package/dist/icons/IconWarning.svelte.d.ts +0 -23
- package/dist/icons/index.d.ts +0 -14
- package/dist/icons/index.js +0 -14
- package/dist/layout/Layout.svelte +0 -47
- package/dist/layout/Layout.svelte.d.ts +0 -22
- package/dist/layout/LayoutFooter.svelte +0 -21
- package/dist/layout/LayoutFooter.svelte.d.ts +0 -18
- package/dist/layout/LayoutGrid.svelte +0 -51
- package/dist/layout/LayoutGrid.svelte.d.ts +0 -27
- package/dist/layout/LayoutHeader.svelte +0 -97
- package/dist/layout/LayoutHeader.svelte.d.ts +0 -34
- package/dist/layout/LayoutSideMenu.svelte +0 -55
- package/dist/layout/LayoutSideMenu.svelte.d.ts +0 -21
- package/dist/layout/LayoutTypes.d.ts +0 -15
- package/dist/layout/LayoutTypes.js +0 -9
- package/dist/layout/Overlay.svelte +0 -20
- package/dist/layout/Overlay.svelte.d.ts +0 -25
- package/dist/layout/OverlayContainer.svelte +0 -28
- package/dist/layout/OverlayContainer.svelte.d.ts +0 -15
- package/dist/layout/OverlayLayer.svelte +0 -140
- package/dist/layout/OverlayLayer.svelte.d.ts +0 -19
- package/dist/layout/PageContent.svelte +0 -82
- package/dist/layout/PageContent.svelte.d.ts +0 -25
- package/dist/layout/Theme.svelte +0 -243
- package/dist/layout/Theme.svelte.d.ts +0 -19
- package/dist/layout/UIContent.svelte +0 -15
- package/dist/layout/UIContent.svelte.d.ts +0 -18
- package/dist/layout/index.d.ts +0 -11
- package/dist/layout/index.js +0 -11
- package/dist/layout/overlays.svelte.d.ts +0 -34
- package/dist/layout/overlays.svelte.js +0 -44
- package/dist/nav/Breadcrumb.svelte +0 -82
- package/dist/nav/Breadcrumb.svelte.d.ts +0 -28
- package/dist/nav/Menu.svelte +0 -170
- package/dist/nav/Menu.svelte.d.ts +0 -27
- package/dist/nav/MenuItem.svelte +0 -147
- package/dist/nav/MenuItem.svelte.d.ts +0 -22
- package/dist/nav/MenuTypes.d.ts +0 -58
- package/dist/nav/MenuTypes.js +0 -1
- package/dist/nav/NavMenu.svelte +0 -181
- package/dist/nav/NavMenu.svelte.d.ts +0 -19
- package/dist/nav/TabbedContent.svelte +0 -43
- package/dist/nav/TabbedContent.svelte.d.ts +0 -23
- package/dist/nav/Tabs.svelte +0 -158
- package/dist/nav/Tabs.svelte.d.ts +0 -25
- package/dist/nav/index.d.ts +0 -7
- package/dist/nav/index.js +0 -6
- package/dist/style.css +0 -950
- package/dist/typo/Clamp.svelte +0 -25
- package/dist/typo/Clamp.svelte.d.ts +0 -24
- package/dist/typo/H.svelte +0 -52
- package/dist/typo/H.svelte.d.ts +0 -28
- package/dist/typo/H1.svelte +0 -14
- package/dist/typo/H1.svelte.d.ts +0 -26
- package/dist/typo/H2.svelte +0 -14
- package/dist/typo/H2.svelte.d.ts +0 -26
- package/dist/typo/H3.svelte +0 -14
- package/dist/typo/H3.svelte.d.ts +0 -26
- package/dist/typo/H4.svelte +0 -14
- package/dist/typo/H4.svelte.d.ts +0 -26
- package/dist/typo/H5.svelte +0 -14
- package/dist/typo/H5.svelte.d.ts +0 -26
- package/dist/typo/H6.svelte +0 -14
- package/dist/typo/H6.svelte.d.ts +0 -26
- package/dist/typo/P.svelte +0 -34
- package/dist/typo/P.svelte.d.ts +0 -26
- package/dist/typo/index.d.ts +0 -9
- package/dist/typo/index.js +0 -9
- package/dist/utils/StringOrComponent.svelte +0 -14
- package/dist/utils/StringOrComponent.svelte.d.ts +0 -19
- package/dist/utils/StringOrSnippet.svelte +0 -11
- package/dist/utils/StringOrSnippet.svelte.d.ts +0 -19
- package/dist/utils/attr.d.ts +0 -5
- package/dist/utils/attr.js +0 -21
- package/dist/utils/color.d.ts +0 -51
- package/dist/utils/color.js +0 -97
- package/dist/utils/defaults.d.ts +0 -4
- package/dist/utils/defaults.js +0 -1
- package/dist/utils/dom.d.ts +0 -15
- package/dist/utils/dom.js +0 -74
- package/dist/utils/hooks.server.d.ts +0 -2
- package/dist/utils/hooks.server.js +0 -16
- package/dist/utils/id.d.ts +0 -1
- package/dist/utils/id.js +0 -3
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.js +0 -6
- package/dist/utils/isSnippet.d.ts +0 -3
- package/dist/utils/isSnippet.js +0 -11
- package/dist/utils/keyboard.svelte.d.ts +0 -22
- package/dist/utils/keyboard.svelte.js +0 -161
- /package/dist/{utils → util}/transitions.d.ts +0 -0
- /package/dist/{utils → util}/transitions.js +0 -0
@@ -1,91 +0,0 @@
|
|
1
|
-
<script lang="ts">import { isStatusColor } from "../utils/color.js";
|
2
|
-
let {
|
3
|
-
count,
|
4
|
-
max = 99,
|
5
|
-
color = "alert",
|
6
|
-
glow = true,
|
7
|
-
outline = true,
|
8
|
-
children
|
9
|
-
} = $props();
|
10
|
-
let el = $state(null);
|
11
|
-
let isSet = $derived(isStatusColor(color));
|
12
|
-
let charCount = $derived.by(() => {
|
13
|
-
if (count === void 0) return 0;
|
14
|
-
if (max && count > max) return max.toString().length + 1;
|
15
|
-
return count.toString().length;
|
16
|
-
});
|
17
|
-
</script>
|
18
|
-
|
19
|
-
<div class="BadgeContainer">
|
20
|
-
<div class="BadgeContent">
|
21
|
-
{#if children}
|
22
|
-
{@render children()}
|
23
|
-
{/if}
|
24
|
-
</div>
|
25
|
-
<span class="Badge" class:outline class:glow class:empty={count === undefined} bind:this={el} style="--charCount: {charCount}ch; --bgColor: {!isSet ? color : 'var(--status-'+color+')'};">
|
26
|
-
{#if count && max}
|
27
|
-
<em>
|
28
|
-
{count > max ? `${max}+` : count}
|
29
|
-
</em>
|
30
|
-
{/if}
|
31
|
-
</span>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
|
35
|
-
<style>
|
36
|
-
.BadgeContainer {
|
37
|
-
position: relative;
|
38
|
-
display: inline-grid;
|
39
|
-
grid-template-columns: fit-content;
|
40
|
-
grid-template-areas: "content";
|
41
|
-
text-rendering: geometricPrecision;
|
42
|
-
}
|
43
|
-
.BadgeContent {
|
44
|
-
grid-area: content;
|
45
|
-
}
|
46
|
-
.Badge {
|
47
|
-
--internalSize: max(calc(var(--size, 0.75rem)), 14px);
|
48
|
-
display: grid;
|
49
|
-
place-items: center;
|
50
|
-
align-items: center;
|
51
|
-
justify-content: center;
|
52
|
-
position: absolute;
|
53
|
-
top: calc(1px + var(--top, 0%));
|
54
|
-
right: var(--right, 0%);
|
55
|
-
transform: translate(0.55rem, -50%);
|
56
|
-
background-color: var(--bgColor);
|
57
|
-
padding: 3px 5px 2px 5px;
|
58
|
-
border-radius: 9999px;
|
59
|
-
--h: max(calc(var(--internalSize) * 0.9), 9px);
|
60
|
-
font-size: var(--h);
|
61
|
-
line-height: var(--h);
|
62
|
-
z-index: 100;
|
63
|
-
font-weight: 600;
|
64
|
-
grid-area: content;
|
65
|
-
}
|
66
|
-
.Badge.outline {
|
67
|
-
outline: min(calc(var(--size, 0.75rem) * 0.25), 2px) solid var(--outline-color, var(--bg-app));
|
68
|
-
}
|
69
|
-
.Badge.empty {
|
70
|
-
width: max(0.5rem, 8px);
|
71
|
-
height: max(0.5rem, 8px);
|
72
|
-
min-width: auto;
|
73
|
-
aspect-ratio: 1/1;
|
74
|
-
transform: translate(50%, -50%);
|
75
|
-
padding: 0;
|
76
|
-
}
|
77
|
-
.Badge.glow {
|
78
|
-
filter: drop-shadow(0 0 0.25rem color-mix(in srgb, var(--bgColor) 30%, transparent 70%));
|
79
|
-
}
|
80
|
-
em {
|
81
|
-
opacity: 0.99;
|
82
|
-
font-style: normal;
|
83
|
-
color: var(--bgColor);
|
84
|
-
filter: invert(1) grayscale(1) brightness(1.3) contrast(9000%);
|
85
|
-
mix-blend-mode: luminosity;
|
86
|
-
left: 50%;
|
87
|
-
position: relative;
|
88
|
-
display: block;
|
89
|
-
transform: translateX(-50%);
|
90
|
-
}
|
91
|
-
</style>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import type { Snippet } from "svelte";
|
2
|
-
import type { StatusColorOrString } from "../utils/color.js";
|
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;
|
12
|
-
}
|
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,109 +0,0 @@
|
|
1
|
-
<script lang="ts">import Icon from "./Icon.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";
|
7
|
-
import Tooltip from "./Tooltip.svelte";
|
8
|
-
let {
|
9
|
-
icon,
|
10
|
-
type,
|
11
|
-
contained,
|
12
|
-
rounded,
|
13
|
-
dismissable,
|
14
|
-
children
|
15
|
-
} = $props();
|
16
|
-
if (!icon) {
|
17
|
-
switch (type) {
|
18
|
-
case "alert":
|
19
|
-
icon = Alert;
|
20
|
-
break;
|
21
|
-
case "info":
|
22
|
-
icon = Info;
|
23
|
-
break;
|
24
|
-
case "ok":
|
25
|
-
icon = Success;
|
26
|
-
break;
|
27
|
-
case "warn":
|
28
|
-
icon = Warning;
|
29
|
-
break;
|
30
|
-
case "task":
|
31
|
-
icon = Error;
|
32
|
-
break;
|
33
|
-
default:
|
34
|
-
icon = void 0;
|
35
|
-
break;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
</script>
|
39
|
-
|
40
|
-
<div class="Callout {type}" class:hasIcon={!!icon} class:contained class:rounded class:dismissable style="--margin-scale: 0.5;">
|
41
|
-
{#if icon}
|
42
|
-
<Icon {icon} --icon-width="1.5rem" --icon-height="1.5rem" />
|
43
|
-
{/if}
|
44
|
-
<div class="CalloutText">
|
45
|
-
{@render children()}
|
46
|
-
</div>
|
47
|
-
{#if dismissable}
|
48
|
-
<div class="Dismiss">
|
49
|
-
<Tooltip tip="Dismiss">
|
50
|
-
<button type="button" class="CalloutDismiss" aria-label="Dismiss callout">
|
51
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
52
|
-
<path d="M1 1L15 15" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
53
|
-
<path d="M1 15L15 1" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
54
|
-
</svg>
|
55
|
-
</button>
|
56
|
-
</Tooltip>
|
57
|
-
</div>
|
58
|
-
{/if}
|
59
|
-
</div>
|
60
|
-
|
61
|
-
<style>
|
62
|
-
.Callout {
|
63
|
-
background: var(--bg, var(--bg-subtle));
|
64
|
-
padding: var(--padding, 1rem);
|
65
|
-
display: grid;
|
66
|
-
gap: var(--gap, 1rem);
|
67
|
-
align-items: var(--align-items, start);
|
68
|
-
--text-heading: hsla(240, 10%, 98%);
|
69
|
-
--text: hsla(240, 10%, 95%);
|
70
|
-
--text-subtle: hsla(240, 10%, 90%);
|
71
|
-
color: var(--text-heading);
|
72
|
-
}
|
73
|
-
.Callout.contained {
|
74
|
-
border: var(--border);
|
75
|
-
}
|
76
|
-
.Callout.rounded {
|
77
|
-
border-radius: var(--border-radius);
|
78
|
-
}
|
79
|
-
.Callout.hasIcon {
|
80
|
-
grid-template-columns: auto 1fr;
|
81
|
-
}
|
82
|
-
.Callout.dismissable {
|
83
|
-
grid-template-columns: 1fr auto;
|
84
|
-
}
|
85
|
-
.Callout.dismissable.hasIcon {
|
86
|
-
grid-template-columns: auto 1fr auto;
|
87
|
-
}
|
88
|
-
.CalloutText {
|
89
|
-
font-size: var(--font-size, 1em);
|
90
|
-
line-height: 1.5;
|
91
|
-
}
|
92
|
-
.Callout.info {
|
93
|
-
--bg: var(--status-info);
|
94
|
-
}
|
95
|
-
.Callout.ok {
|
96
|
-
--bg: var(--status-ok);
|
97
|
-
}
|
98
|
-
.Dismiss {
|
99
|
-
margin: -0.75rem;
|
100
|
-
}
|
101
|
-
.CalloutDismiss {
|
102
|
-
background: transparent;
|
103
|
-
border: none;
|
104
|
-
padding: 0.75rem;
|
105
|
-
cursor: pointer;
|
106
|
-
}
|
107
|
-
.CalloutText {
|
108
|
-
}
|
109
|
-
</style>
|
@@ -1,28 +0,0 @@
|
|
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;
|
11
|
-
}
|
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,58 +0,0 @@
|
|
1
|
-
<script lang="ts">let {
|
2
|
-
onclick,
|
3
|
-
position
|
4
|
-
} = $props();
|
5
|
-
</script>
|
6
|
-
|
7
|
-
<button class="Close {position}" {onclick}>
|
8
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
9
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
10
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
11
|
-
</svg>
|
12
|
-
</button>
|
13
|
-
|
14
|
-
<style>
|
15
|
-
.Close {
|
16
|
-
cursor: pointer;
|
17
|
-
padding: var(--close-padding, 0.5rem);
|
18
|
-
border-radius: 50%;
|
19
|
-
color: var(--text);
|
20
|
-
cursor: pointer;
|
21
|
-
pointer-events: auto;
|
22
|
-
}
|
23
|
-
|
24
|
-
svg {
|
25
|
-
width: max(1.5rem, 16px);
|
26
|
-
height: max(1.5rem, 16px);
|
27
|
-
}
|
28
|
-
|
29
|
-
.Close:hover {
|
30
|
-
color: var(--text-subtle);
|
31
|
-
}
|
32
|
-
|
33
|
-
.Close.top {
|
34
|
-
position: absolute;
|
35
|
-
top: 0;
|
36
|
-
right: 0;
|
37
|
-
z-index: 100;
|
38
|
-
}
|
39
|
-
|
40
|
-
.Close.bottom {
|
41
|
-
position: absolute;
|
42
|
-
bottom: 0;
|
43
|
-
right: 0;
|
44
|
-
}
|
45
|
-
|
46
|
-
.Close.left {
|
47
|
-
position: absolute;
|
48
|
-
top: 0;
|
49
|
-
left: 0;
|
50
|
-
right: auto;
|
51
|
-
}
|
52
|
-
|
53
|
-
.Close.right {
|
54
|
-
position: absolute;
|
55
|
-
top: 0;
|
56
|
-
right: 0;
|
57
|
-
}
|
58
|
-
</style>
|
@@ -1,18 +0,0 @@
|
|
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;
|
10
|
-
}
|
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
DELETED
@@ -1,190 +0,0 @@
|
|
1
|
-
<script lang="ts">import Copy from "../icons/IconCopy.svelte";
|
2
|
-
import Done from "../icons/IconDone.svelte";
|
3
|
-
import IconButton from "./IconButton.svelte";
|
4
|
-
import Tooltip from "./Tooltip.svelte";
|
5
|
-
let {
|
6
|
-
code = $bindable(""),
|
7
|
-
highlight,
|
8
|
-
copyable,
|
9
|
-
contained,
|
10
|
-
rounded,
|
11
|
-
singleLine,
|
12
|
-
lineNumbers,
|
13
|
-
readonly
|
14
|
-
} = $props();
|
15
|
-
const numberOfLines = $derived(code.split("\n").length);
|
16
|
-
let title = $state("Copy");
|
17
|
-
let open = $state(false);
|
18
|
-
let btnIcon = $state(Copy);
|
19
|
-
let el = $state(null);
|
20
|
-
let scrollTop = $state(0);
|
21
|
-
let scrollLeft = $state(0);
|
22
|
-
function copy() {
|
23
|
-
if (!el) return;
|
24
|
-
if (navigator.clipboard) {
|
25
|
-
navigator.clipboard.writeText(code);
|
26
|
-
} else {
|
27
|
-
el.focus();
|
28
|
-
el.select();
|
29
|
-
document.execCommand("copy");
|
30
|
-
}
|
31
|
-
btnIcon = Done;
|
32
|
-
title = "Copied!";
|
33
|
-
open = true;
|
34
|
-
setTimeout(() => {
|
35
|
-
btnIcon = Copy;
|
36
|
-
title = "Copy";
|
37
|
-
open = false;
|
38
|
-
}, 1500);
|
39
|
-
}
|
40
|
-
function onscroll(e) {
|
41
|
-
console.log("scrolling");
|
42
|
-
scrollTop = e.target.scrollTop;
|
43
|
-
scrollLeft = e.target.scrollLeft;
|
44
|
-
}
|
45
|
-
let codeLines = $derived.by(() => {
|
46
|
-
return (highlight ? highlight(code) : code).split("\n") || [];
|
47
|
-
});
|
48
|
-
</script>
|
49
|
-
|
50
|
-
<div class="Code" class:lineNumbers class:singleLine class:rounded class:copyable class:contained class:hasOverlay={highlight}>
|
51
|
-
{#if singleLine}
|
52
|
-
<input class="CodeInput" spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off" {readonly} bind:this={el} bind:value={code} title={copyable ? code : undefined} {onscroll} />
|
53
|
-
{:else}
|
54
|
-
<textarea class="CodeInput" spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off" {readonly} bind:this={el} bind:value={code} {onscroll}></textarea>
|
55
|
-
{/if}
|
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}
|
67
|
-
</div>
|
68
|
-
</div>
|
69
|
-
{/each}
|
70
|
-
</div>
|
71
|
-
{/if}
|
72
|
-
{#if copyable}
|
73
|
-
<Tooltip tip={title} {open}>
|
74
|
-
<IconButton icon={btnIcon} onclick={copy} disabled={open} />
|
75
|
-
</Tooltip>
|
76
|
-
{/if}
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<style>
|
80
|
-
.Code {
|
81
|
-
display: grid;
|
82
|
-
align-items: start;
|
83
|
-
grid-template-columns: 1fr;
|
84
|
-
grid-template-areas: "content";
|
85
|
-
}
|
86
|
-
.Code.lineNumbers {
|
87
|
-
grid-template-columns: auto 1fr;
|
88
|
-
grid-template-areas: "lines content";
|
89
|
-
margin-inline-start: -2rem;
|
90
|
-
width: calc(100% + 2rem);
|
91
|
-
}
|
92
|
-
.CodeInput,
|
93
|
-
.Overlay {
|
94
|
-
font-family: var(--font-family-mono);
|
95
|
-
font-size: var(--font-size, 1em);
|
96
|
-
line-height: 1.5;
|
97
|
-
margin: 0;
|
98
|
-
border: 0;
|
99
|
-
grid-area: content;
|
100
|
-
background: var(--field-bg);
|
101
|
-
scrollbar-width: thin;
|
102
|
-
}
|
103
|
-
textarea {
|
104
|
-
width: 100%;
|
105
|
-
height: 100%;
|
106
|
-
white-space: pre-wrap;
|
107
|
-
word-break: normal;
|
108
|
-
overflow-wrap: anywhere;
|
109
|
-
direction: ltr;
|
110
|
-
writing-mode: lr;
|
111
|
-
resize: none;
|
112
|
-
z-index: -1;
|
113
|
-
scrollbar-width: thin;
|
114
|
-
}
|
115
|
-
.Code.lineNumbers textarea {
|
116
|
-
padding-inline-start: 2rem;
|
117
|
-
width: calc(100% - 2rem);
|
118
|
-
}
|
119
|
-
.Code.hasOverlay .CodeInput {
|
120
|
-
color: transparent;
|
121
|
-
caret-color: var(--text);
|
122
|
-
}
|
123
|
-
.Code.rounded,
|
124
|
-
.Code.rounded .CodeInput {
|
125
|
-
border-radius: var(--border-radius);
|
126
|
-
}
|
127
|
-
.Code.singleLine.copyable .CodeInput {
|
128
|
-
border-top-right-radius: 0;
|
129
|
-
border-bottom-right-radius: 0;
|
130
|
-
}
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Contained
|
134
|
-
*/
|
135
|
-
|
136
|
-
.Code.contained {
|
137
|
-
border: var(--border);
|
138
|
-
}
|
139
|
-
.Code.contained .CodeInput,
|
140
|
-
.Code.contained .Overlay {
|
141
|
-
height: auto;
|
142
|
-
min-height: auto;
|
143
|
-
padding: var(--padding, 0.5rem 1rem);
|
144
|
-
}
|
145
|
-
.Code.contained:focus-within {
|
146
|
-
outline: var(--focus-outline);
|
147
|
-
}
|
148
|
-
.Code.contained:focus-within .CodeInput {
|
149
|
-
outline: none;
|
150
|
-
}
|
151
|
-
.Code.contained:focus-within:has(:focus:not(.CodeInput)) {
|
152
|
-
outline: none;
|
153
|
-
}
|
154
|
-
|
155
|
-
/**
|
156
|
-
* Single line
|
157
|
-
*/
|
158
|
-
|
159
|
-
.Code.singleLine {
|
160
|
-
align-items: center;
|
161
|
-
overflow-inline: clip;
|
162
|
-
}
|
163
|
-
.Code.singleLine.copyable {
|
164
|
-
grid-template-columns: 1fr auto;
|
165
|
-
grid-template-areas: "content button";
|
166
|
-
}
|
167
|
-
.Code.singleLine.copyable .CodeInput,
|
168
|
-
.Code.singleLine.copyable .Overlay {
|
169
|
-
text-overflow: ellipsis;
|
170
|
-
white-space: nowrap;
|
171
|
-
padding: var(--padding, 0.35rem 0.75rem);
|
172
|
-
}
|
173
|
-
.Code.singleLine .CodeInput,
|
174
|
-
.Code.singleLine .Overlay {
|
175
|
-
resize: none;
|
176
|
-
line-height: 1;
|
177
|
-
}
|
178
|
-
|
179
|
-
.Line {
|
180
|
-
display: grid;
|
181
|
-
}
|
182
|
-
.Code.lineNumbers .Line {
|
183
|
-
display: grid;
|
184
|
-
grid-template-columns: 2rem 1fr;
|
185
|
-
}
|
186
|
-
.Line .Number {
|
187
|
-
text-align: end;
|
188
|
-
padding-inline-end: 0.5rem;
|
189
|
-
}
|
190
|
-
</style>
|
@@ -1,32 +0,0 @@
|
|
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;
|
10
|
-
}
|
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,23 +0,0 @@
|
|
1
|
-
<script lang="ts">import Tooltip from "./Tooltip.svelte";
|
2
|
-
import Help from "../icons/IconHelp.svelte";
|
3
|
-
import Icon from "./Icon.svelte";
|
4
|
-
let {
|
5
|
-
tip
|
6
|
-
} = $props();
|
7
|
-
</script>
|
8
|
-
|
9
|
-
<Tooltip {tip}>
|
10
|
-
<a href="#contexttip" onclick={(e) => { e.preventDefault(); e.stopPropagation(); }}>
|
11
|
-
<Icon icon={Help} --icon-width="16px" --icon-height="16px" --cursor="help" --vertical-align="baseline" />
|
12
|
-
</a>
|
13
|
-
</Tooltip>
|
14
|
-
|
15
|
-
<style>
|
16
|
-
a {
|
17
|
-
border-radius: 50%;
|
18
|
-
color: var(--text);
|
19
|
-
height: 16px;
|
20
|
-
width: 16px;
|
21
|
-
display: inline-block;
|
22
|
-
}
|
23
|
-
</style>
|
@@ -1,18 +0,0 @@
|
|
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 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;
|
@@ -1,16 +0,0 @@
|
|
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>
|
@@ -1,21 +0,0 @@
|
|
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,49 +0,0 @@
|
|
1
|
-
<script lang="ts">let {
|
2
|
-
summary,
|
3
|
-
contained,
|
4
|
-
rounded,
|
5
|
-
open,
|
6
|
-
children
|
7
|
-
} = $props();
|
8
|
-
</script>
|
9
|
-
|
10
|
-
<details class:contained class:rounded bind:open>
|
11
|
-
<summary>
|
12
|
-
{#if typeof summary === 'string'}
|
13
|
-
<span>{summary}</span>
|
14
|
-
{:else}
|
15
|
-
{@render summary()}
|
16
|
-
{/if}
|
17
|
-
</summary>
|
18
|
-
<section>
|
19
|
-
{@render children()}
|
20
|
-
</section>
|
21
|
-
</details>
|
22
|
-
|
23
|
-
<style>
|
24
|
-
summary {
|
25
|
-
font-weight: 600;
|
26
|
-
font-size: var(--font-size, 1em);
|
27
|
-
cursor: pointer;
|
28
|
-
padding-block-end: 0.5rem;
|
29
|
-
}
|
30
|
-
details.rounded {
|
31
|
-
border-radius: var(--border-radius);
|
32
|
-
}
|
33
|
-
details.contained {
|
34
|
-
border: var(--border);
|
35
|
-
overflow: hidden;
|
36
|
-
}
|
37
|
-
details.contained[open] summary {
|
38
|
-
border-block-end: var(--border);
|
39
|
-
}
|
40
|
-
details.contained summary {
|
41
|
-
padding: var(--padding, 0.5em 1em);
|
42
|
-
background-color: var(--summary-bg, var(--bg-subtle));
|
43
|
-
}
|
44
|
-
details.contained section {
|
45
|
-
font-size: var(--font-size, 1em);
|
46
|
-
padding: var(--padding, 0.5em 1em);
|
47
|
-
background-color: var(--content-bg, transparent);
|
48
|
-
}
|
49
|
-
</style>
|