lutra 0.1.69 → 0.1.73
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/Callout.svelte +85 -0
- package/dist/components/Callout.svelte.d.ts +14 -0
- package/dist/components/DataList.svelte +111 -0
- package/dist/components/DataList.svelte.d.ts +10 -0
- package/dist/components/DataListTypes.d.ts +14 -0
- package/dist/components/DataListTypes.js +1 -0
- package/dist/components/IconButton.svelte +12 -4
- package/dist/components/IconButton.svelte.d.ts +2 -0
- package/dist/components/Layout.svelte +1 -1
- package/dist/components/Popover.svelte +4 -1
- package/dist/components/Tabs.svelte +13 -1
- package/dist/components/Tabs.svelte.d.ts +2 -0
- package/dist/components/Tag.svelte +11 -3
- package/dist/components/Tag.svelte.d.ts +2 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/css/1-props.css +157 -136
- package/dist/css/2-init.css +39 -23
- package/dist/css/themes/DefaultTheme.css +10 -0
- package/dist/form/Button.svelte +4 -4
- package/dist/form/Button.svelte.d.ts +1 -1
- package/dist/form/FieldContent.svelte +11 -3
- package/dist/form/FieldContent.svelte.d.ts +2 -0
- package/dist/form/FieldGroup.svelte +84 -0
- package/dist/form/FieldGroup.svelte.d.ts +20 -0
- package/dist/form/Input.svelte +4 -0
- package/dist/form/Input.svelte.d.ts +2 -0
- package/dist/form/SegmentedControl.svelte +273 -0
- package/dist/form/SegmentedControl.svelte.d.ts +33 -0
- package/dist/form/SegmentedControlTypes.d.ts +8 -0
- package/dist/form/SegmentedControlTypes.js +1 -0
- package/dist/form/Select.svelte +4 -0
- package/dist/form/Select.svelte.d.ts +2 -0
- package/dist/form/Textarea.svelte +4 -0
- package/dist/form/Textarea.svelte.d.ts +2 -0
- package/dist/form/Toggle.svelte +166 -0
- package/dist/form/Toggle.svelte.d.ts +33 -17
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component, Snippet } from "svelte";
|
|
3
|
+
import Icon from "./Icon.svelte";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* A styled callout/banner for inline notices and announcements.
|
|
8
|
+
* Renders children as content with an optional leading icon.
|
|
9
|
+
* Visual appearance is customisable via CSS custom properties.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop --callout-background - Background color of the callout. (Default: var(--theme-surface-subtle))
|
|
12
|
+
* @cssprop --callout-text-color - Text color inside the callout. (Default: var(--text-color-p))
|
|
13
|
+
* @cssprop --callout-link-color - Color of links inside the callout. (Default: var(--link-color))
|
|
14
|
+
* @cssprop --callout-border-radius - Border radius of the callout. Overridden by the shape prop. (Default: var(--border-radius-sm))
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Callout icon={InfoIcon}>
|
|
18
|
+
* Please <a href="/upgrade">upgrade</a> to the new version.
|
|
19
|
+
* </Callout>
|
|
20
|
+
*/
|
|
21
|
+
let {
|
|
22
|
+
icon,
|
|
23
|
+
shape = "rounded",
|
|
24
|
+
scale = "md",
|
|
25
|
+
children,
|
|
26
|
+
}: {
|
|
27
|
+
/** Icon component or string to render before the content. */
|
|
28
|
+
icon?: string | Component;
|
|
29
|
+
/** The shape of the callout. */
|
|
30
|
+
shape?: "rounded" | "pill" | "rectangle";
|
|
31
|
+
/** Size variant controlling font-size. Padding and gap scale accordingly. */
|
|
32
|
+
scale?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
33
|
+
/** Callout content. */
|
|
34
|
+
children: Snippet;
|
|
35
|
+
} = $props();
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div class="Callout {shape} {scale}" role="note">
|
|
39
|
+
{#if icon}
|
|
40
|
+
<Icon {icon} />
|
|
41
|
+
{/if}
|
|
42
|
+
<div class="Content">
|
|
43
|
+
{@render children()}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.Callout {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--space-sm);
|
|
52
|
+
padding-block: var(--space-sm);
|
|
53
|
+
padding-inline: var(--space-md);
|
|
54
|
+
border-radius: var(--callout-border-radius, var(--border-radius-sm));
|
|
55
|
+
background: var(--callout-background, var(--theme-surface-subtle));
|
|
56
|
+
color: var(--callout-text-color, var(--text-color-p));
|
|
57
|
+
line-height: var(--font-line-height);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.Callout.pill {
|
|
61
|
+
border-radius: calc(infinity * 1px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.Callout.rectangle {
|
|
65
|
+
border-radius: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Callout :global(a) {
|
|
69
|
+
color: var(--callout-link-color, var(--link-color));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.Callout :global(a:hover) {
|
|
73
|
+
color: var(--callout-link-color, var(--link-color-hover));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.Content {
|
|
77
|
+
flex: 1;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.Callout.xs { font-size: var(--font-size-xs); padding: var(--space-xxs) var(--space-xs); gap: var(--space-xxs); }
|
|
82
|
+
.Callout.sm { font-size: var(--font-size-sm); padding: var(--space-xs) var(--space-sm); gap: var(--space-xs); }
|
|
83
|
+
.Callout.lg { font-size: var(--font-size-h5); padding: var(--space-md) var(--space-lg); gap: var(--space-md); }
|
|
84
|
+
.Callout.xl { font-size: var(--font-size-h4); padding: var(--space-lg) var(--space-xl); gap: var(--space-md); }
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Component, Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/** Icon component or string to render before the content. */
|
|
4
|
+
icon?: string | Component;
|
|
5
|
+
/** The shape of the callout. */
|
|
6
|
+
shape?: "rounded" | "pill" | "rectangle";
|
|
7
|
+
/** Size variant controlling font-size. Padding and gap scale accordingly. */
|
|
8
|
+
scale?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
9
|
+
/** Callout content. */
|
|
10
|
+
children: Snippet;
|
|
11
|
+
};
|
|
12
|
+
declare const Callout: Component<$$ComponentProps, {}, "">;
|
|
13
|
+
type Callout = ReturnType<typeof Callout>;
|
|
14
|
+
export default Callout;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { DataListItem } from "./DataListTypes.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Renders an array of label/value pairs as a semantic description list (`<dl>`).
|
|
7
|
+
* Supports horizontal (side-by-side), vertical (stacked), or auto (container-query
|
|
8
|
+
* responsive) layouts. Values can be plain strings, snippets, render functions,
|
|
9
|
+
* or components.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop --data-list-gap -- Gap between items in the list.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <DataList items={[
|
|
15
|
+
* { label: 'Name', value: 'Alice' },
|
|
16
|
+
* { label: 'Email', value: 'alice@example.com' },
|
|
17
|
+
* ]} />
|
|
18
|
+
*/
|
|
19
|
+
let {
|
|
20
|
+
items,
|
|
21
|
+
direction = 'auto',
|
|
22
|
+
}: {
|
|
23
|
+
/** The data items to display. */
|
|
24
|
+
items: DataListItem[];
|
|
25
|
+
/** Layout direction. 'auto' switches from horizontal to vertical based on container width. */
|
|
26
|
+
direction?: 'horizontal' | 'vertical' | 'auto';
|
|
27
|
+
} = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<div class="DataList">
|
|
31
|
+
<dl class={direction}>
|
|
32
|
+
{#each items as item}
|
|
33
|
+
<div>
|
|
34
|
+
<dt>{item.label}</dt>
|
|
35
|
+
<dd>
|
|
36
|
+
{#if item.snippet}
|
|
37
|
+
{@render item.snippet()}
|
|
38
|
+
{:else if item.render}
|
|
39
|
+
{@render item.render()}
|
|
40
|
+
{:else if item.component}
|
|
41
|
+
<item.component />
|
|
42
|
+
{:else if item.value}
|
|
43
|
+
{item.value}
|
|
44
|
+
{/if}
|
|
45
|
+
</dd>
|
|
46
|
+
</div>
|
|
47
|
+
{/each}
|
|
48
|
+
</dl>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.DataList {
|
|
53
|
+
container-type: inline-size;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dl {
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
dt {
|
|
62
|
+
color: var(--text-color-p-subtle);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
dd {
|
|
66
|
+
margin: 0;
|
|
67
|
+
color: var(--text-color-p);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Horizontal layout: two-column grid with subgrid for aligned labels
|
|
72
|
+
*/
|
|
73
|
+
dl.horizontal,
|
|
74
|
+
dl.auto {
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns: auto 1fr;
|
|
77
|
+
gap: var(--data-list-gap);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
dl.horizontal > div,
|
|
81
|
+
dl.auto > div {
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-column: 1 / -1;
|
|
84
|
+
grid-template-columns: subgrid;
|
|
85
|
+
align-items: baseline;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Vertical layout: stacked label over value
|
|
90
|
+
*/
|
|
91
|
+
dl.vertical {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
gap: var(--data-list-gap);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Auto: switch to vertical when the container is narrow
|
|
99
|
+
*/
|
|
100
|
+
@container (max-width: 300px) {
|
|
101
|
+
dl.auto {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
dl.auto > div {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataListItem } from "./DataListTypes.js";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
/** The data items to display. */
|
|
4
|
+
items: DataListItem[];
|
|
5
|
+
/** Layout direction. 'auto' switches from horizontal to vertical based on container width. */
|
|
6
|
+
direction?: 'horizontal' | 'vertical' | 'auto';
|
|
7
|
+
};
|
|
8
|
+
declare const DataList: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type DataList = ReturnType<typeof DataList>;
|
|
10
|
+
export default DataList;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Component, Snippet } from "svelte";
|
|
2
|
+
import type { RenderFn } from "../types.js";
|
|
3
|
+
export type DataListItem = {
|
|
4
|
+
/** Text label for the item (e.g. "Status", "Email") */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Text value to display */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Snippet to render as the value */
|
|
9
|
+
snippet?: Snippet;
|
|
10
|
+
/** Render function for the value (works in object literals) */
|
|
11
|
+
render?: RenderFn;
|
|
12
|
+
/** Component to render as the value */
|
|
13
|
+
component?: Component;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
disabled,
|
|
24
24
|
children,
|
|
25
25
|
onclick,
|
|
26
|
-
mask = true
|
|
26
|
+
mask = true,
|
|
27
|
+
scale = 'md'
|
|
27
28
|
}: {
|
|
28
29
|
/** The icon to display. */
|
|
29
30
|
icon: string | Component;
|
|
@@ -34,7 +35,9 @@
|
|
|
34
35
|
/** Whether the button is disabled. */
|
|
35
36
|
disabled?: boolean,
|
|
36
37
|
/** Whether to mask the content. */
|
|
37
|
-
mask?: boolean
|
|
38
|
+
mask?: boolean,
|
|
39
|
+
/** Size variant controlling font-size. Icon and padding scale automatically. */
|
|
40
|
+
scale?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
38
41
|
} = $props();
|
|
39
42
|
|
|
40
43
|
</script>
|
|
@@ -55,11 +58,11 @@
|
|
|
55
58
|
{/snippet}
|
|
56
59
|
|
|
57
60
|
{#if onclick}
|
|
58
|
-
<button type="button" {disabled} class="IconButton" {onclick}>
|
|
61
|
+
<button type="button" {disabled} class="IconButton {scale}" {onclick}>
|
|
59
62
|
{@render inside()}
|
|
60
63
|
</button>
|
|
61
64
|
{:else}
|
|
62
|
-
<span class="IconButton">
|
|
65
|
+
<span class="IconButton {scale}">
|
|
63
66
|
{@render inside()}
|
|
64
67
|
</span>
|
|
65
68
|
{/if}
|
|
@@ -105,4 +108,9 @@
|
|
|
105
108
|
gap: var(--space-xs);
|
|
106
109
|
align-items: center;
|
|
107
110
|
}
|
|
111
|
+
|
|
112
|
+
.IconButton.xs { font-size: var(--font-size-xs); }
|
|
113
|
+
.IconButton.sm { font-size: var(--font-size-sm); }
|
|
114
|
+
.IconButton.lg { font-size: var(--font-size-h5); }
|
|
115
|
+
.IconButton.xl { font-size: var(--font-size-h4); }
|
|
108
116
|
</style>
|
|
@@ -10,6 +10,8 @@ type $$ComponentProps = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
/** Whether to mask the content. */
|
|
12
12
|
mask?: boolean;
|
|
13
|
+
/** Size variant controlling font-size. Icon and padding scale automatically. */
|
|
14
|
+
scale?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
15
|
};
|
|
14
16
|
declare const IconButton: Component<$$ComponentProps, {}, "">;
|
|
15
17
|
type IconButton = ReturnType<typeof IconButton>;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Includes ToastContainer for toast notifications.
|
|
13
13
|
*/
|
|
14
14
|
let {
|
|
15
|
-
theme = lutra()?.[LutraContext.Theme]?.() ??
|
|
15
|
+
theme = lutra ? (lutra()?.[LutraContext.Theme]?.() ?? undefined) : undefined,
|
|
16
16
|
children,
|
|
17
17
|
}: {
|
|
18
18
|
/** The theme to use. Leave empty for auto-detection. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
3
|
import { BROWSER } from "esm-env";
|
|
4
|
+
import UIContent from "./UIContent.svelte";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @description
|
|
@@ -207,7 +208,9 @@
|
|
|
207
208
|
class:unstyled
|
|
208
209
|
style={popoverStyle}
|
|
209
210
|
>
|
|
210
|
-
|
|
211
|
+
<UIContent>
|
|
212
|
+
{@render children()}
|
|
213
|
+
</UIContent>
|
|
211
214
|
</div>
|
|
212
215
|
|
|
213
216
|
<style>
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
underline,
|
|
43
43
|
contained,
|
|
44
44
|
rounded,
|
|
45
|
+
scale = 'md',
|
|
45
46
|
selected = $bindable<{ label: string, href?: string, index: number } | null>(null)
|
|
46
47
|
}: {
|
|
47
48
|
/** Tab items to display. */
|
|
@@ -52,6 +53,8 @@
|
|
|
52
53
|
contained?: boolean;
|
|
53
54
|
/** Round the corners of the element if contained. */
|
|
54
55
|
rounded?: boolean;
|
|
56
|
+
/** Size variant controlling font-size and padding. */
|
|
57
|
+
scale?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
55
58
|
/** The index of the selected tab (bindable). */
|
|
56
59
|
selected?: { label: string, href?: string, index: number } | null;
|
|
57
60
|
} = $props();
|
|
@@ -111,7 +114,7 @@
|
|
|
111
114
|
|
|
112
115
|
<svelte:window onresize={() => { loaded = false; loaded = true; }} />
|
|
113
116
|
|
|
114
|
-
<nav class="Tabs" {id} class:contained class:rounded>
|
|
117
|
+
<nav class="Tabs {scale}" {id} class:contained class:rounded>
|
|
115
118
|
<menu>
|
|
116
119
|
{#each items as item, index}
|
|
117
120
|
<li data-index={index} aria-current={item.active || activeIndex === index ? 'page' : undefined}>
|
|
@@ -221,4 +224,13 @@
|
|
|
221
224
|
transition: all var(--transition-duration-fast) ease-out;
|
|
222
225
|
opacity: 0;
|
|
223
226
|
}
|
|
227
|
+
|
|
228
|
+
.Tabs.xs { font-size: var(--font-size-xs); }
|
|
229
|
+
.Tabs.xs :is(a, button) { padding: var(--space-xxs) var(--space-xxs); }
|
|
230
|
+
.Tabs.sm { font-size: var(--font-size-sm); }
|
|
231
|
+
.Tabs.sm :is(a, button) { padding: var(--space-xs) var(--space-xs); }
|
|
232
|
+
.Tabs.lg { font-size: 1em; }
|
|
233
|
+
.Tabs.lg :is(a, button) { padding: var(--space-md) var(--space-sm); }
|
|
234
|
+
.Tabs.xl { font-size: var(--font-size-h5); }
|
|
235
|
+
.Tabs.xl :is(a, button) { padding: var(--space-md) var(--space-md); }
|
|
224
236
|
</style>
|
|
@@ -8,6 +8,8 @@ type $$ComponentProps = {
|
|
|
8
8
|
contained?: boolean;
|
|
9
9
|
/** Round the corners of the element if contained. */
|
|
10
10
|
rounded?: boolean;
|
|
11
|
+
/** Size variant controlling font-size and padding. */
|
|
12
|
+
scale?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
11
13
|
/** The index of the selected tab (bindable). */
|
|
12
14
|
selected?: {
|
|
13
15
|
label: string;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
code,
|
|
25
25
|
color = "default",
|
|
26
26
|
shape = "pill",
|
|
27
|
+
scale = "md",
|
|
27
28
|
onclick,
|
|
28
29
|
href,
|
|
29
30
|
target,
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
color?: StatusColorOrString;
|
|
38
39
|
/** The shape of the tag. */
|
|
39
40
|
shape?: "rounded" | "pill" | "rectangle";
|
|
41
|
+
/** Size variant controlling font-size. Padding scales automatically via em units. */
|
|
42
|
+
scale?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
40
43
|
/** A function to run when the tag is clicked. */
|
|
41
44
|
onclick?: (event: MouseEvent) => void;
|
|
42
45
|
/** A URL to link to. */
|
|
@@ -84,19 +87,19 @@
|
|
|
84
87
|
{/snippet}
|
|
85
88
|
|
|
86
89
|
{#if href}
|
|
87
|
-
<a {href} {target} class:code class="Tag Link {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};" onclick={onclick}>
|
|
90
|
+
<a {href} {target} class:code class="Tag Link {shape} {scale}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};" onclick={onclick}>
|
|
88
91
|
{@render _prefix()}
|
|
89
92
|
{@render content()}
|
|
90
93
|
{@render _suffix()}
|
|
91
94
|
</a>
|
|
92
95
|
{:else if onclick}
|
|
93
|
-
<button type="button" class:code class="Tag {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};" onclick={onclick}>
|
|
96
|
+
<button type="button" class:code class="Tag {shape} {scale}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};" onclick={onclick}>
|
|
94
97
|
{@render _prefix()}
|
|
95
98
|
{@render content()}
|
|
96
99
|
{@render _suffix()}
|
|
97
100
|
</button>
|
|
98
101
|
{:else}
|
|
99
|
-
<span class:code class="Tag {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};">
|
|
102
|
+
<span class:code class="Tag {shape} {scale}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+'-background)'}; --textColor: {!isSet ? color : 'var(--status-'+color+'-color)'};">
|
|
100
103
|
{@render _prefix()}
|
|
101
104
|
{@render content()}
|
|
102
105
|
{@render _suffix()}
|
|
@@ -157,4 +160,9 @@
|
|
|
157
160
|
opacity: 0.65;
|
|
158
161
|
}
|
|
159
162
|
}
|
|
163
|
+
|
|
164
|
+
.Tag.xs { font-size: var(--font-size, 0.65em); }
|
|
165
|
+
.Tag.sm { font-size: var(--font-size, 0.75em); }
|
|
166
|
+
.Tag.lg { font-size: var(--font-size, 1em); }
|
|
167
|
+
.Tag.xl { font-size: var(--font-size, 1.15em); }
|
|
160
168
|
</style>
|
|
@@ -7,6 +7,8 @@ type $$ComponentProps = {
|
|
|
7
7
|
color?: StatusColorOrString;
|
|
8
8
|
/** The shape of the tag. */
|
|
9
9
|
shape?: "rounded" | "pill" | "rectangle";
|
|
10
|
+
/** Size variant controlling font-size. Padding scales automatically via em units. */
|
|
11
|
+
scale?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
10
12
|
/** A function to run when the tag is clicked. */
|
|
11
13
|
onclick?: (event: MouseEvent) => void;
|
|
12
14
|
/** A URL to link to. */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as AspectRatio } from './AspectRatio.svelte';
|
|
2
2
|
export { default as Avatar } from './Avatar.svelte';
|
|
3
|
+
export { default as Callout } from './Callout.svelte';
|
|
3
4
|
export { default as Close } from './Close.svelte';
|
|
4
5
|
export { default as ContextTip } from './ContextTip.svelte';
|
|
6
|
+
export { default as DataList } from './DataList.svelte';
|
|
5
7
|
export { default as Dialog } from './Dialog.svelte';
|
|
6
8
|
export { default as Icon } from './Icon.svelte';
|
|
7
9
|
export { default as IconButton } from './IconButton.svelte';
|
|
@@ -22,6 +24,7 @@ export { default as Toast } from './Toast.svelte';
|
|
|
22
24
|
export { default as ToastContainer } from './ToastContainer.svelte';
|
|
23
25
|
export { default as Tooltip } from './Tooltip.svelte';
|
|
24
26
|
export { default as UIContent } from './UIContent.svelte';
|
|
27
|
+
export * from './DataListTypes.js';
|
|
25
28
|
export * from './MenuTypes.js';
|
|
26
29
|
export * from './ModalTypes.js';
|
|
27
30
|
export * from './toasts.svelte.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as AspectRatio } from './AspectRatio.svelte';
|
|
2
2
|
export { default as Avatar } from './Avatar.svelte';
|
|
3
|
+
export { default as Callout } from './Callout.svelte';
|
|
3
4
|
export { default as Close } from './Close.svelte';
|
|
4
5
|
export { default as ContextTip } from './ContextTip.svelte';
|
|
6
|
+
export { default as DataList } from './DataList.svelte';
|
|
5
7
|
export { default as Dialog } from './Dialog.svelte';
|
|
6
8
|
export { default as Icon } from './Icon.svelte';
|
|
7
9
|
export { default as IconButton } from './IconButton.svelte';
|
|
@@ -23,6 +25,7 @@ export { default as ToastContainer } from './ToastContainer.svelte';
|
|
|
23
25
|
export { default as Tooltip } from './Tooltip.svelte';
|
|
24
26
|
export { default as UIContent } from './UIContent.svelte';
|
|
25
27
|
// Types and APIs
|
|
28
|
+
export * from './DataListTypes.js';
|
|
26
29
|
export * from './MenuTypes.js';
|
|
27
30
|
export * from './ModalTypes.js';
|
|
28
31
|
export * from './toasts.svelte.js';
|