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,117 +0,0 @@
|
|
1
|
-
import { type Snippet } from "svelte";
|
2
|
-
import type { Autocomplete } from "./types.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 Input: $$__sveltets_2_IsomorphicComponent<{
|
14
|
-
/** alt attribute for the image type. Required for accessibility */
|
15
|
-
alt?: string;
|
16
|
-
/** Whether the input should be autofocused. */
|
17
|
-
autofocus?: boolean;
|
18
|
-
/** Whether the input should be autocapitalized. */
|
19
|
-
autocapitalize?: boolean | "off" | "none" | "on" | "sentences" | "words" | "characters";
|
20
|
-
/** Specifies whether autocomplete is enabled for the input. */
|
21
|
-
autocomplete?: Autocomplete;
|
22
|
-
/** Whether the input should be autocorrected. (Safari only) */
|
23
|
-
autocorrect?: boolean;
|
24
|
-
/** A hint to the browser for which capture method to use. */
|
25
|
-
capture?: "user" | "environment";
|
26
|
-
/** Whether the input should be checked. */
|
27
|
-
checked?: boolean;
|
28
|
-
/** Whether the input should be contained. */
|
29
|
-
contained?: boolean;
|
30
|
-
/** Whether the input should be copyable. */
|
31
|
-
copyable?: boolean;
|
32
|
-
/** The default value of the input element. */
|
33
|
-
defaultValue?: string;
|
34
|
-
/** Whether the input should be disabled. */
|
35
|
-
disabled?: boolean;
|
36
|
-
/** A hint to the browser for which enter key to display for the input. */
|
37
|
-
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
38
|
-
/** The height of the input element. Valid for image inputs. */
|
39
|
-
height?: number;
|
40
|
-
/** Help text to display below the input. */
|
41
|
-
help?: string | Snippet;
|
42
|
-
/** A random id is generated if not provided. */
|
43
|
-
id?: string;
|
44
|
-
/** Whether the input should be indeterminate. */
|
45
|
-
indeterminate?: boolean;
|
46
|
-
/** A hint to the browser for which keyboard to display. This is only used for type="text" inputs. Strongly consider using type="email" or type="url" etc. instead */
|
47
|
-
inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
|
48
|
-
/** The label for the input */
|
49
|
-
label?: string | Snippet;
|
50
|
-
/** Context tooltip for a label. Renders with a questionmark using ContextTip. */
|
51
|
-
labelTip?: string | Snippet;
|
52
|
-
/** The id of a datalist element that contains pre-defined options for the input element. */
|
53
|
-
list?: string;
|
54
|
-
/** The maximum number of characters (as UTF-16 code units) the user can enter into the input. Valid for text, search, url, tel, email, and password. */
|
55
|
-
maxlength?: number;
|
56
|
-
/** The minimum number of characters (as UTF-16 code units) the user can enter into the input. Valid for text, search, url, tel, email, and password. */
|
57
|
-
minlength?: number;
|
58
|
-
/** Allow multiple f
|
59
|
-
/** The maximum value of the input element. Valid for date, month, week, time, datetime-local, number, and range. */
|
60
|
-
max?: number;
|
61
|
-
/** The minimum value of the input element. Valid for date, month, week, time, datetime-local, number, and range. */
|
62
|
-
min?: number;
|
63
|
-
/** Whether the input should allow multiple values. Valid for email and file inputs. */
|
64
|
-
multiple?: boolean;
|
65
|
-
/** The name of the input element. */
|
66
|
-
name: string;
|
67
|
-
/** The onblur event handler */
|
68
|
-
onblur?: (e: FocusEvent) => void;
|
69
|
-
/** Onchange event handler */
|
70
|
-
onchange?: (e: Event) => void;
|
71
|
-
/** Onclick event handler */
|
72
|
-
onclick?: (e: MouseEvent) => void;
|
73
|
-
/** Onfocus event handler */
|
74
|
-
onfocus?: (e: FocusEvent) => void;
|
75
|
-
/** Keyup event handler */
|
76
|
-
onkeyup?: (e: KeyboardEvent) => void;
|
77
|
-
/** Keydown event handler */
|
78
|
-
onkeydown?: (e: KeyboardEvent) => void;
|
79
|
-
/** Keypress event handler */
|
80
|
-
onkeypress?: (e: KeyboardEvent) => void;
|
81
|
-
/** A regular expression that the input's value is checked against. Valid for text, search, url, tel, email, and password. */
|
82
|
-
pattern?: string;
|
83
|
-
/** Placeholder text to display when the input is empty. */
|
84
|
-
placeholder?: string;
|
85
|
-
/** Suffix content, to display after the input. */
|
86
|
-
suffix?: string | Snippet;
|
87
|
-
/** Prefix content, to display before the input. */
|
88
|
-
prefix?: string | Snippet;
|
89
|
-
/** Whether the input should be read-only. */
|
90
|
-
readonly?: boolean;
|
91
|
-
/** Whether the input should be required. */
|
92
|
-
required?: boolean;
|
93
|
-
/** The shape of the input element. */
|
94
|
-
shape?: "default" | "rounded" | "pill" | "circle";
|
95
|
-
/** The size of the input element. */
|
96
|
-
size?: number;
|
97
|
-
/** Source URL for the image type. */
|
98
|
-
src?: string;
|
99
|
-
/** A number that specifies the granularity that the value must adhere to. Valid for date, month, week, time, datetime-local, number, and range. */
|
100
|
-
step?: number;
|
101
|
-
/** A string that defines the title of the input element. */
|
102
|
-
title?: string;
|
103
|
-
/** The type of input to display. */
|
104
|
-
type?: "button" | "submit" | "checkbox" | "radio" | "hidden" | "text" | "password" | "file" | "image" | "email" | "number" | "tel" | "url" | "range" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color";
|
105
|
-
/** Unit of measurement for range inputs. */
|
106
|
-
unit?: string;
|
107
|
-
/** The value of the input element. */
|
108
|
-
value?: string | number | boolean | null;
|
109
|
-
/** Whether the input should be viewable. Valid for password inputs. */
|
110
|
-
viewable?: boolean;
|
111
|
-
/** Whether the input should only accept directory uploads. */
|
112
|
-
webkitdirectory?: boolean;
|
113
|
-
}, {
|
114
|
-
[evt: string]: CustomEvent<any>;
|
115
|
-
}, {}, {}, "value" | "id">;
|
116
|
-
type Input = InstanceType<typeof Input>;
|
117
|
-
export default Input;
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<script lang="ts">let {
|
2
|
-
value,
|
3
|
-
maxlength
|
4
|
-
} = $props();
|
5
|
-
</script>
|
6
|
-
|
7
|
-
{#if maxlength}
|
8
|
-
<div class="InputLength">
|
9
|
-
<div class="Length" class:warn={(value?.length || 0) > maxlength - 5}>
|
10
|
-
{value?.length || 0}/{maxlength}
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
{/if}
|
14
|
-
|
15
|
-
<style>
|
16
|
-
.InputLength {
|
17
|
-
display: flex;
|
18
|
-
justify-content: flex-end;
|
19
|
-
align-items: center;
|
20
|
-
font-size: 0.8rem;
|
21
|
-
font-weight: 500;
|
22
|
-
color: var(--text-subtle);
|
23
|
-
}
|
24
|
-
.InputLength .Length {
|
25
|
-
display: flex;
|
26
|
-
align-items: center;
|
27
|
-
gap: 0.25rem;
|
28
|
-
}
|
29
|
-
.InputLength .Length.warn {
|
30
|
-
color: var(--text-warn);
|
31
|
-
}
|
32
|
-
</style>
|
@@ -1,20 +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 InputLength: $$__sveltets_2_IsomorphicComponent<{
|
12
|
-
/** The value of the input. */
|
13
|
-
value: string;
|
14
|
-
/** The maximum length of the input. */
|
15
|
-
maxlength: number;
|
16
|
-
}, {
|
17
|
-
[evt: string]: CustomEvent<any>;
|
18
|
-
}, {}, {}, "">;
|
19
|
-
type InputLength = InstanceType<typeof InputLength>;
|
20
|
-
export default InputLength;
|
package/dist/form/Label.svelte
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
<script lang="ts">import ContextTip from "../display/ContextTip.svelte";
|
2
|
-
let {
|
3
|
-
id,
|
4
|
-
label,
|
5
|
-
tip,
|
6
|
-
required
|
7
|
-
} = $props();
|
8
|
-
</script>
|
9
|
-
|
10
|
-
{#if label}
|
11
|
-
<label for={id} class:hasTip={!!tip}>
|
12
|
-
{#if typeof label === 'string'}
|
13
|
-
<span>
|
14
|
-
{label} {#if required}<span aria-hidden="true">*</span>{/if}
|
15
|
-
</span>
|
16
|
-
{:else}
|
17
|
-
<span>
|
18
|
-
{@render label()}
|
19
|
-
</span>
|
20
|
-
{/if}
|
21
|
-
{#if tip}
|
22
|
-
<ContextTip {tip} />
|
23
|
-
{/if}
|
24
|
-
</label>
|
25
|
-
{/if}
|
26
|
-
|
27
|
-
<style>
|
28
|
-
label {
|
29
|
-
cursor: var(--cursor, default);
|
30
|
-
text-wrap: balance;
|
31
|
-
display: inline-grid;
|
32
|
-
grid-template-columns: 1fr;
|
33
|
-
gap: 0.5em;
|
34
|
-
align-items: center;
|
35
|
-
}
|
36
|
-
label.hasTip {
|
37
|
-
grid-template-columns: 1fr auto;
|
38
|
-
}
|
39
|
-
label > span > span {
|
40
|
-
font-weight: 600;
|
41
|
-
color: var(--text-warn);
|
42
|
-
padding-inline: 0.175em;
|
43
|
-
}
|
44
|
-
</style>
|
@@ -1,25 +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 Label: $$__sveltets_2_IsomorphicComponent<{
|
13
|
-
/** The id of the input element */
|
14
|
-
id?: string;
|
15
|
-
/** The label for the input */
|
16
|
-
label?: string | Snippet;
|
17
|
-
/** The help text for the input */
|
18
|
-
tip?: string | Snippet;
|
19
|
-
/** Whether the input is required */
|
20
|
-
required?: boolean;
|
21
|
-
}, {
|
22
|
-
[evt: string]: CustomEvent<any>;
|
23
|
-
}, {}, {}, "">;
|
24
|
-
type Label = InstanceType<typeof Label>;
|
25
|
-
export default Label;
|
@@ -1,100 +0,0 @@
|
|
1
|
-
<script lang="ts">import Theme from "../layout/Theme.svelte";
|
2
|
-
import H5 from "../typo/H5.svelte";
|
3
|
-
import ImageUpload from "./ImageUpload.svelte";
|
4
|
-
import StringOrSnippet from "../utils/StringOrSnippet.svelte";
|
5
|
-
let {
|
6
|
-
lightLogoInputName = "logo_light_url",
|
7
|
-
darkLogoInputName = "logo_dark_url",
|
8
|
-
lightLogoUploadUrl,
|
9
|
-
darkLogoUploadUrl,
|
10
|
-
buttonText = "Select",
|
11
|
-
lightLogoSrc,
|
12
|
-
darkLogoSrc,
|
13
|
-
lightHelp = "This logo will be used on a light theme background.",
|
14
|
-
darkHelp = "If not set, the light theme logo will be used instead.",
|
15
|
-
accept = "image/png,image/jpg",
|
16
|
-
maxSize = 1024 * 1024 * 4,
|
17
|
-
// 4MB
|
18
|
-
removable = true
|
19
|
-
} = $props();
|
20
|
-
</script>
|
21
|
-
|
22
|
-
<div class="LogoUpload">
|
23
|
-
<Theme theme="light">
|
24
|
-
<div class="Content">
|
25
|
-
<H5 hr>Light theme</H5>
|
26
|
-
<div class="Info">
|
27
|
-
<small><StringOrSnippet content={lightHelp} /></small>
|
28
|
-
<ImageUpload
|
29
|
-
compressMaxWidth={512}
|
30
|
-
compressSize={2}
|
31
|
-
{accept}
|
32
|
-
uploadUrl={lightLogoUploadUrl}
|
33
|
-
src={lightLogoSrc}
|
34
|
-
name={lightLogoInputName}
|
35
|
-
button={buttonText}
|
36
|
-
{removable}
|
37
|
-
{maxSize}
|
38
|
-
/>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
</Theme>
|
42
|
-
<Theme theme="dark">
|
43
|
-
<div class="Content">
|
44
|
-
<H5 hr>Dark theme</H5>
|
45
|
-
<div class="Info">
|
46
|
-
<small><StringOrSnippet content={darkHelp} /></small>
|
47
|
-
<ImageUpload
|
48
|
-
compressMaxWidth={512}
|
49
|
-
compressSize={2}
|
50
|
-
{accept}
|
51
|
-
uploadUrl={darkLogoUploadUrl}
|
52
|
-
src={darkLogoSrc}
|
53
|
-
name={darkLogoInputName}
|
54
|
-
button={buttonText}
|
55
|
-
{removable}
|
56
|
-
{maxSize}
|
57
|
-
/>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</Theme>
|
61
|
-
</div>
|
62
|
-
|
63
|
-
<style>
|
64
|
-
.LogoUpload {
|
65
|
-
border: var(--border);
|
66
|
-
overflow: hidden;
|
67
|
-
border-radius: var(--border-radius);
|
68
|
-
margin: 0;
|
69
|
-
padding: 0;
|
70
|
-
list-style: none;
|
71
|
-
display: grid;
|
72
|
-
grid-template-columns: 1fr;
|
73
|
-
container-type: inline-size;
|
74
|
-
}
|
75
|
-
.Content {
|
76
|
-
background: var(--bg-app);
|
77
|
-
}
|
78
|
-
.Info {
|
79
|
-
padding: 1rem 1.5rem;
|
80
|
-
display: grid;
|
81
|
-
grid-template-columns: 1fr;
|
82
|
-
gap: 1rem;
|
83
|
-
}
|
84
|
-
.Content :global(h5) {
|
85
|
-
margin-bottom: 0 !important;
|
86
|
-
padding: 1rem 1rem 1rem 1rem;
|
87
|
-
}
|
88
|
-
.Content :global(.Rows) {
|
89
|
-
padding: 0 1rem 1rem 1rem;
|
90
|
-
}
|
91
|
-
@container (min-width: 500px) {
|
92
|
-
.LogoUpload {
|
93
|
-
grid-template-columns: 1fr 1fr;
|
94
|
-
}
|
95
|
-
.Content :global(h5) {
|
96
|
-
margin-bottom: 0 !important;
|
97
|
-
padding: 1rem 1.5rem;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
</style>
|
@@ -1,29 +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 LogoUpload: $$__sveltets_2_IsomorphicComponent<{
|
13
|
-
lightLogoInputName?: string;
|
14
|
-
darkLogoInputName?: string;
|
15
|
-
lightLogoUploadUrl: string;
|
16
|
-
darkLogoUploadUrl: string;
|
17
|
-
buttonText?: string;
|
18
|
-
lightLogoSrc?: string | null;
|
19
|
-
darkLogoSrc?: string | null;
|
20
|
-
lightHelp?: string | Snippet;
|
21
|
-
darkHelp?: string | Snippet;
|
22
|
-
accept: string;
|
23
|
-
maxSize?: number;
|
24
|
-
removable?: boolean;
|
25
|
-
}, {
|
26
|
-
[evt: string]: CustomEvent<any>;
|
27
|
-
}, {}, {}, "">;
|
28
|
-
type LogoUpload = InstanceType<typeof LogoUpload>;
|
29
|
-
export default LogoUpload;
|
package/dist/form/Select.svelte
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
<script lang="ts">import { getContext, onMount } from "svelte";
|
2
|
-
import Label from "./Label.svelte";
|
3
|
-
import { createId } from "../utils/id.js";
|
4
|
-
import Copy from "../icons/IconCopy.svelte";
|
5
|
-
import Done from "../icons/IconDone.svelte";
|
6
|
-
import Show from "../icons/IconShow.svelte";
|
7
|
-
import Hide from "../icons/IconHide.svelte";
|
8
|
-
import Tooltip from "../display/Tooltip.svelte";
|
9
|
-
import IconButton from "../display/IconButton.svelte";
|
10
|
-
import { fieldChange, fieldKeydown, ignoreKeys } from "./client.svelte.js";
|
11
|
-
import FieldError from "./FieldError.svelte";
|
12
|
-
import { getFromObjWithStringPath } from "./form.js";
|
13
|
-
import { ZodType } from "zod";
|
14
|
-
import FieldContent from "./FieldContent.svelte";
|
15
|
-
let {
|
16
|
-
autofocus,
|
17
|
-
children,
|
18
|
-
disabled,
|
19
|
-
help,
|
20
|
-
id = $bindable(createId()),
|
21
|
-
label,
|
22
|
-
labelTip,
|
23
|
-
name,
|
24
|
-
onblur,
|
25
|
-
onchange,
|
26
|
-
onclick,
|
27
|
-
onfocus,
|
28
|
-
onkeydown,
|
29
|
-
onkeyup,
|
30
|
-
onkeypress,
|
31
|
-
options,
|
32
|
-
placeholder,
|
33
|
-
required,
|
34
|
-
results,
|
35
|
-
shape = "default",
|
36
|
-
tabindex,
|
37
|
-
value = $bindable()
|
38
|
-
} = $props();
|
39
|
-
let el = $state();
|
40
|
-
const form = getContext("form");
|
41
|
-
const field = $derived(form?.fields[name]);
|
42
|
-
const issue = $derived(form?.issues?.find((issue2) => issue2.name === name));
|
43
|
-
const validator = getContext("form.validators")?.[name];
|
44
|
-
const data = form?.data;
|
45
|
-
const originalData = form?.originalData;
|
46
|
-
if (!value) value = form ? getFromObjWithStringPath(Object.assign(originalData ?? {}, data ?? {}), name) || form?.fields?.[name]?.defaultValue : "";
|
47
|
-
onMount(() => {
|
48
|
-
if (value) fieldChange(form, name, () => el)({});
|
49
|
-
});
|
50
|
-
</script>
|
51
|
-
|
52
|
-
<FieldContent
|
53
|
-
{id}
|
54
|
-
{label}
|
55
|
-
{labelTip}
|
56
|
-
{help}
|
57
|
-
{field}
|
58
|
-
{issue}
|
59
|
-
{required}
|
60
|
-
contained
|
61
|
-
>
|
62
|
-
<div class="SelectContainer">
|
63
|
-
<select
|
64
|
-
bind:this={el}
|
65
|
-
{autofocus}
|
66
|
-
{disabled}
|
67
|
-
{id}
|
68
|
-
{name}
|
69
|
-
{onblur}
|
70
|
-
{onclick}
|
71
|
-
onchange={fieldChange(form, name, () => el, validator, onchange)}
|
72
|
-
{onfocus}
|
73
|
-
onkeydown={fieldKeydown(form, name, () => el, validator, onkeydown)}
|
74
|
-
{onkeyup}
|
75
|
-
{onkeypress}
|
76
|
-
{placeholder}
|
77
|
-
required={required || field?.required}
|
78
|
-
{results}
|
79
|
-
{tabindex}
|
80
|
-
bind:value={value}
|
81
|
-
>
|
82
|
-
{#if children}
|
83
|
-
{@render children()}
|
84
|
-
{:else if options}
|
85
|
-
{#each options as option}
|
86
|
-
{#if typeof option === 'string'}
|
87
|
-
<option value={option}>{option}</option>
|
88
|
-
{:else}
|
89
|
-
<option value={option.value}>{option.label}</option>
|
90
|
-
{/if}
|
91
|
-
{/each}
|
92
|
-
{/if}
|
93
|
-
</select>
|
94
|
-
<div class="Arrow">
|
95
|
-
<svg width="12px" height="8px" viewBox="0 0 12 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
96
|
-
<g transform="matrix(1,0,0,1,0,0.746639)">
|
97
|
-
<path d="M6,4.248L11.493,0L12,0.507L6,6.507L0,0.507L0.507,0L6,4.248Z" fill="currentColor" stroke="currentColor"/>
|
98
|
-
</g>
|
99
|
-
</svg>
|
100
|
-
</div>
|
101
|
-
</div>
|
102
|
-
</FieldContent>
|
103
|
-
|
104
|
-
<style>
|
105
|
-
.SelectContainer {
|
106
|
-
display: grid;
|
107
|
-
grid-template-columns: 1fr;
|
108
|
-
grid-template-areas: "select";
|
109
|
-
align-items: center;
|
110
|
-
width: 100%;
|
111
|
-
}
|
112
|
-
select {
|
113
|
-
padding-inline-end: calc(1.5em + 10px);
|
114
|
-
width: 100%;
|
115
|
-
appearance: none;
|
116
|
-
border: none !important;
|
117
|
-
border-radius: 0;
|
118
|
-
grid-area: select;
|
119
|
-
background: none;
|
120
|
-
}
|
121
|
-
.Arrow {
|
122
|
-
grid-area: select;
|
123
|
-
pointer-events: none;
|
124
|
-
display: flex;
|
125
|
-
align-items: center;
|
126
|
-
justify-content: end;
|
127
|
-
padding-inline-end: 0.75em;
|
128
|
-
}
|
129
|
-
svg {
|
130
|
-
display: block;
|
131
|
-
color: var(--field-text);
|
132
|
-
}
|
133
|
-
select:focus-visible {
|
134
|
-
outline: none;
|
135
|
-
}
|
136
|
-
</style>
|
@@ -1,70 +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 Select: $$__sveltets_2_IsomorphicComponent<{
|
13
|
-
/** Whether the input should be autofocused. */
|
14
|
-
autofocus?: boolean;
|
15
|
-
/** Options for the select element. */
|
16
|
-
children?: Snippet;
|
17
|
-
/** Whether the input should be disabled. */
|
18
|
-
disabled?: boolean;
|
19
|
-
/** Help text to display below the input. */
|
20
|
-
help?: string | Snippet;
|
21
|
-
/** A random id is generated if not provided. */
|
22
|
-
id?: string;
|
23
|
-
/** The label for the input */
|
24
|
-
label?: string | Snippet;
|
25
|
-
/** Context tooltip for a label. Renders with a questionmark using ContextTip. */
|
26
|
-
labelTip?: string | Snippet;
|
27
|
-
/** The name of the input element. */
|
28
|
-
name: string;
|
29
|
-
/** The onblur event handler */
|
30
|
-
onblur?: (e: FocusEvent) => void;
|
31
|
-
/** Onchange event handler */
|
32
|
-
onchange?: (e: Event) => void;
|
33
|
-
/** Onclick event handler */
|
34
|
-
onclick?: (e: MouseEvent) => void;
|
35
|
-
/** Onfocus event handler */
|
36
|
-
onfocus?: (e: FocusEvent) => void;
|
37
|
-
/** Keyup event handler */
|
38
|
-
onkeyup?: (e: KeyboardEvent) => void;
|
39
|
-
/** Keydown event handler */
|
40
|
-
onkeydown?: (e: KeyboardEvent) => void;
|
41
|
-
/** Keypress event handler */
|
42
|
-
onkeypress?: (e: KeyboardEvent) => void;
|
43
|
-
/** The options for the select element. */
|
44
|
-
options?: string[] | {
|
45
|
-
value: string;
|
46
|
-
label: string;
|
47
|
-
}[];
|
48
|
-
/** Placeholder text to display when the input is empty. */
|
49
|
-
placeholder?: string;
|
50
|
-
/** Suffix content, to display after the input. */
|
51
|
-
suffix?: string | Snippet;
|
52
|
-
/** Prefix content, to display before the input. */
|
53
|
-
prefix?: string | Snippet;
|
54
|
-
/** Whether the input should be required. */
|
55
|
-
required?: boolean;
|
56
|
-
/** The maximum number of items that should be displayed in the drop-down list of previous search queries. Safari only. */
|
57
|
-
results?: number;
|
58
|
-
/** The shape of the input element. */
|
59
|
-
shape?: "default" | "rounded" | "pill" | "circle";
|
60
|
-
/** Source URL for the image type. */
|
61
|
-
src?: string;
|
62
|
-
/** An integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation. */
|
63
|
-
tabindex?: number;
|
64
|
-
/** The value of the input element. */
|
65
|
-
value?: string | number | boolean | null;
|
66
|
-
}, {
|
67
|
-
[evt: string]: CustomEvent<any>;
|
68
|
-
}, {}, {}, "value" | "id">;
|
69
|
-
type Select = InstanceType<typeof Select>;
|
70
|
-
export default Select;
|