lutra 0.0.20 → 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.
Files changed (223) hide show
  1. package/README.md +4 -24
  2. package/dist/components/AspectRatio.svelte +26 -0
  3. package/dist/components/AspectRatio.svelte.d.ts +8 -0
  4. package/dist/components/Dialog.svelte +78 -0
  5. package/dist/components/Dialog.svelte.d.ts +14 -0
  6. package/dist/components/Layout.svelte +32 -0
  7. package/dist/components/Layout.svelte.d.ts +11 -0
  8. package/dist/components/PageContent.svelte +108 -0
  9. package/dist/components/PageContent.svelte.d.ts +38 -0
  10. package/dist/components/Theme.svelte +87 -0
  11. package/dist/components/Theme.svelte.d.ts +17 -0
  12. package/dist/{display → components}/Tooltip.svelte +37 -11
  13. package/dist/components/Tooltip.svelte.d.ts +12 -0
  14. package/dist/config.d.ts +30 -0
  15. package/dist/config.js +18 -0
  16. package/dist/css/0-layers.css +1 -0
  17. package/dist/css/1-props.css +775 -0
  18. package/dist/css/2-base.css +209 -0
  19. package/dist/css/3-typo.css +65 -0
  20. package/dist/css/4-layout.css +5 -0
  21. package/dist/css/5-media.css +21 -0
  22. package/dist/css/lutra.css +6 -0
  23. package/dist/index.d.ts +5 -1
  24. package/dist/index.js +5 -2
  25. package/dist/types.d.ts +39 -0
  26. package/dist/types.js +25 -0
  27. package/package.json +29 -75
  28. package/dist/data/Stat.svelte +0 -89
  29. package/dist/data/Stat.svelte.d.ts +0 -39
  30. package/dist/data/index.d.ts +0 -1
  31. package/dist/data/index.js +0 -1
  32. package/dist/display/Avatar.svelte +0 -61
  33. package/dist/display/Avatar.svelte.d.ts +0 -23
  34. package/dist/display/Badge.svelte +0 -93
  35. package/dist/display/Badge.svelte.d.ts +0 -34
  36. package/dist/display/Callout.svelte +0 -109
  37. package/dist/display/Callout.svelte.d.ts +0 -36
  38. package/dist/display/Close.svelte +0 -58
  39. package/dist/display/Close.svelte.d.ts +0 -21
  40. package/dist/display/Code.svelte +0 -195
  41. package/dist/display/Code.svelte.d.ts +0 -31
  42. package/dist/display/ContextTip.svelte +0 -26
  43. package/dist/display/ContextTip.svelte.d.ts +0 -22
  44. package/dist/display/Details.svelte +0 -49
  45. package/dist/display/Details.svelte.d.ts +0 -32
  46. package/dist/display/Hero.svelte +0 -50
  47. package/dist/display/Hero.svelte.d.ts +0 -30
  48. package/dist/display/Icon.svelte +0 -40
  49. package/dist/display/Icon.svelte.d.ts +0 -24
  50. package/dist/display/IconButton.svelte +0 -84
  51. package/dist/display/IconButton.svelte.d.ts +0 -30
  52. package/dist/display/Image.svelte +0 -91
  53. package/dist/display/Image.svelte.d.ts +0 -37
  54. package/dist/display/Indicator.svelte +0 -352
  55. package/dist/display/Indicator.svelte.d.ts +0 -24
  56. package/dist/display/Inset.svelte +0 -18
  57. package/dist/display/Inset.svelte.d.ts +0 -22
  58. package/dist/display/Notification.svelte +0 -104
  59. package/dist/display/Notification.svelte.d.ts +0 -42
  60. package/dist/display/Popup.svelte +0 -111
  61. package/dist/display/Popup.svelte.d.ts +0 -30
  62. package/dist/display/Table.svelte +0 -24
  63. package/dist/display/Table.svelte.d.ts +0 -34
  64. package/dist/display/Tag.svelte +0 -90
  65. package/dist/display/Tag.svelte.d.ts +0 -35
  66. package/dist/display/Tooltip.svelte.d.ts +0 -28
  67. package/dist/display/index.d.ts +0 -14
  68. package/dist/display/index.js +0 -14
  69. package/dist/display/notifications.svelte.d.ts +0 -21
  70. package/dist/display/notifications.svelte.js +0 -31
  71. package/dist/form/Button.svelte +0 -34
  72. package/dist/form/Button.svelte.d.ts +0 -36
  73. package/dist/form/FieldActions.svelte +0 -46
  74. package/dist/form/FieldActions.svelte.d.ts +0 -24
  75. package/dist/form/FieldContainer.svelte +0 -37
  76. package/dist/form/FieldContainer.svelte.d.ts +0 -24
  77. package/dist/form/FieldContent.svelte +0 -134
  78. package/dist/form/FieldContent.svelte.d.ts +0 -59
  79. package/dist/form/FieldError.svelte +0 -14
  80. package/dist/form/FieldError.svelte.d.ts +0 -21
  81. package/dist/form/FieldSection.svelte +0 -86
  82. package/dist/form/FieldSection.svelte.d.ts +0 -34
  83. package/dist/form/Fieldset.svelte +0 -68
  84. package/dist/form/Fieldset.svelte.d.ts +0 -42
  85. package/dist/form/Form.svelte +0 -98
  86. package/dist/form/Form.svelte.d.ts +0 -33
  87. package/dist/form/Input.svelte +0 -287
  88. package/dist/form/Input.svelte.d.ts +0 -142
  89. package/dist/form/InputLength.svelte +0 -32
  90. package/dist/form/InputLength.svelte.d.ts +0 -21
  91. package/dist/form/Label.svelte +0 -27
  92. package/dist/form/Label.svelte.d.ts +0 -31
  93. package/dist/form/Select.svelte +0 -88
  94. package/dist/form/Select.svelte.d.ts +0 -97
  95. package/dist/form/client.svelte.d.ts +0 -45
  96. package/dist/form/client.svelte.js +0 -90
  97. package/dist/form/form.d.ts +0 -52
  98. package/dist/form/form.js +0 -326
  99. package/dist/form/index.d.ts +0 -15
  100. package/dist/form/index.js +0 -15
  101. package/dist/form/types.d.ts +0 -52
  102. package/dist/form/types.js +0 -1
  103. package/dist/grid/Column.svelte +0 -11
  104. package/dist/grid/Column.svelte.d.ts +0 -22
  105. package/dist/grid/Grid.svelte +0 -19
  106. package/dist/grid/Grid.svelte.d.ts +0 -24
  107. package/dist/grid/Row.svelte +0 -44
  108. package/dist/grid/Row.svelte.d.ts +0 -24
  109. package/dist/icons/Alert.svelte +0 -3
  110. package/dist/icons/Alert.svelte.d.ts +0 -23
  111. package/dist/icons/Copy.svelte +0 -3
  112. package/dist/icons/Copy.svelte.d.ts +0 -23
  113. package/dist/icons/Done.svelte +0 -3
  114. package/dist/icons/Done.svelte.d.ts +0 -23
  115. package/dist/icons/Error.svelte +0 -3
  116. package/dist/icons/Error.svelte.d.ts +0 -23
  117. package/dist/icons/Help.svelte +0 -3
  118. package/dist/icons/Help.svelte.d.ts +0 -23
  119. package/dist/icons/Hide.svelte +0 -3
  120. package/dist/icons/Hide.svelte.d.ts +0 -23
  121. package/dist/icons/Info.svelte +0 -3
  122. package/dist/icons/Info.svelte.d.ts +0 -23
  123. package/dist/icons/Link.svelte +0 -3
  124. package/dist/icons/Link.svelte.d.ts +0 -23
  125. package/dist/icons/MenuBurger.svelte +0 -3
  126. package/dist/icons/MenuBurger.svelte.d.ts +0 -23
  127. package/dist/icons/MenuDots.svelte +0 -3
  128. package/dist/icons/MenuDots.svelte.d.ts +0 -23
  129. package/dist/icons/Show.svelte +0 -3
  130. package/dist/icons/Show.svelte.d.ts +0 -23
  131. package/dist/icons/Success.svelte +0 -3
  132. package/dist/icons/Success.svelte.d.ts +0 -23
  133. package/dist/icons/Warning.svelte +0 -3
  134. package/dist/icons/Warning.svelte.d.ts +0 -23
  135. package/dist/icons/index.d.ts +0 -11
  136. package/dist/icons/index.js +0 -11
  137. package/dist/layout/Layout.svelte +0 -45
  138. package/dist/layout/Layout.svelte.d.ts +0 -25
  139. package/dist/layout/LayoutFooter.svelte +0 -21
  140. package/dist/layout/LayoutFooter.svelte.d.ts +0 -19
  141. package/dist/layout/LayoutGrid.svelte +0 -51
  142. package/dist/layout/LayoutGrid.svelte.d.ts +0 -38
  143. package/dist/layout/LayoutHeader.svelte +0 -94
  144. package/dist/layout/LayoutHeader.svelte.d.ts +0 -39
  145. package/dist/layout/LayoutSideMenu.svelte +0 -54
  146. package/dist/layout/LayoutSideMenu.svelte.d.ts +0 -25
  147. package/dist/layout/LayoutTypes.d.ts +0 -15
  148. package/dist/layout/LayoutTypes.js +0 -9
  149. package/dist/layout/Overlay.svelte +0 -20
  150. package/dist/layout/Overlay.svelte.d.ts +0 -35
  151. package/dist/layout/OverlayContainer.svelte +0 -28
  152. package/dist/layout/OverlayContainer.svelte.d.ts +0 -16
  153. package/dist/layout/OverlayLayer.svelte +0 -145
  154. package/dist/layout/OverlayLayer.svelte.d.ts +0 -22
  155. package/dist/layout/PageContent.svelte +0 -97
  156. package/dist/layout/PageContent.svelte.d.ts +0 -28
  157. package/dist/layout/Theme.svelte +0 -228
  158. package/dist/layout/Theme.svelte.d.ts +0 -24
  159. package/dist/layout/UIContent.svelte +0 -15
  160. package/dist/layout/UIContent.svelte.d.ts +0 -22
  161. package/dist/layout/index.d.ts +0 -7
  162. package/dist/layout/index.js +0 -7
  163. package/dist/layout/overlays.svelte.d.ts +0 -34
  164. package/dist/layout/overlays.svelte.js +0 -44
  165. package/dist/nav/Breadcrumb.svelte +0 -82
  166. package/dist/nav/Breadcrumb.svelte.d.ts +0 -33
  167. package/dist/nav/Menu.svelte +0 -177
  168. package/dist/nav/Menu.svelte.d.ts +0 -33
  169. package/dist/nav/MenuItem.svelte +0 -140
  170. package/dist/nav/MenuItem.svelte.d.ts +0 -26
  171. package/dist/nav/MenuTypes.d.ts +0 -58
  172. package/dist/nav/MenuTypes.js +0 -1
  173. package/dist/nav/NavMenu.svelte +0 -183
  174. package/dist/nav/NavMenu.svelte.d.ts +0 -20
  175. package/dist/nav/TabbedContent.svelte +0 -43
  176. package/dist/nav/TabbedContent.svelte.d.ts +0 -24
  177. package/dist/nav/Tabs.svelte +0 -118
  178. package/dist/nav/Tabs.svelte.d.ts +0 -26
  179. package/dist/nav/index.d.ts +0 -6
  180. package/dist/nav/index.js +0 -5
  181. package/dist/style.css +0 -853
  182. package/dist/typo/Clamp.svelte +0 -25
  183. package/dist/typo/Clamp.svelte.d.ts +0 -28
  184. package/dist/typo/H.svelte +0 -52
  185. package/dist/typo/H.svelte.d.ts +0 -32
  186. package/dist/typo/H1.svelte +0 -14
  187. package/dist/typo/H1.svelte.d.ts +0 -30
  188. package/dist/typo/H2.svelte +0 -14
  189. package/dist/typo/H2.svelte.d.ts +0 -30
  190. package/dist/typo/H3.svelte +0 -14
  191. package/dist/typo/H3.svelte.d.ts +0 -30
  192. package/dist/typo/H4.svelte +0 -14
  193. package/dist/typo/H4.svelte.d.ts +0 -30
  194. package/dist/typo/H5.svelte +0 -14
  195. package/dist/typo/H5.svelte.d.ts +0 -30
  196. package/dist/typo/H6.svelte +0 -14
  197. package/dist/typo/H6.svelte.d.ts +0 -30
  198. package/dist/typo/P.svelte +0 -34
  199. package/dist/typo/P.svelte.d.ts +0 -30
  200. package/dist/typo/index.d.ts +0 -9
  201. package/dist/typo/index.js +0 -9
  202. package/dist/utils/StringOrComponentOrSnippet.svelte +0 -14
  203. package/dist/utils/StringOrComponentOrSnippet.svelte.d.ts +0 -24
  204. package/dist/utils/attr.d.ts +0 -5
  205. package/dist/utils/attr.js +0 -21
  206. package/dist/utils/color.d.ts +0 -51
  207. package/dist/utils/color.js +0 -97
  208. package/dist/utils/defaults.d.ts +0 -4
  209. package/dist/utils/defaults.js +0 -1
  210. package/dist/utils/dom.d.ts +0 -15
  211. package/dist/utils/dom.js +0 -74
  212. package/dist/utils/hooks.server.d.ts +0 -2
  213. package/dist/utils/hooks.server.js +0 -16
  214. package/dist/utils/id.d.ts +0 -1
  215. package/dist/utils/id.js +0 -3
  216. package/dist/utils/index.d.ts +0 -8
  217. package/dist/utils/index.js +0 -5
  218. package/dist/utils/isSnippet.d.ts +0 -5
  219. package/dist/utils/isSnippet.js +0 -6
  220. package/dist/utils/keyboard.svelte.d.ts +0 -22
  221. package/dist/utils/keyboard.svelte.js +0 -161
  222. /package/dist/{utils → util}/transitions.d.ts +0 -0
  223. /package/dist/{utils → util}/transitions.js +0 -0
@@ -1,30 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- content: Snippet<[close: () => void]>;
6
- trigger: Snippet<[attrs: (node: Element) => void]>;
7
- hover?: boolean | undefined;
8
- shape?: "rounded" | "sharp" | undefined;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {};
14
- };
15
- export type PopupProps = typeof __propDef.props;
16
- export type PopupEvents = typeof __propDef.events;
17
- export type PopupSlots = typeof __propDef.slots;
18
- export default class Popup extends SvelteComponent<PopupProps, PopupEvents, PopupSlots> {
19
- constructor(options?: import("svelte").ComponentConstructorOptions<{
20
- content: (this: void, close: () => void) => typeof import("svelte").SnippetReturn & {
21
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
22
- };
23
- trigger: (this: void, attrs: (node: Element) => void) => typeof import("svelte").SnippetReturn & {
24
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
25
- };
26
- hover?: boolean | undefined;
27
- shape?: "rounded" | "sharp" | undefined;
28
- }>);
29
- }
30
- export {};
@@ -1,24 +0,0 @@
1
- <script lang="ts">let {
2
- colored,
3
- contained,
4
- rounded,
5
- hoverable,
6
- hang,
7
- fullWidth,
8
- children
9
- } = $props();
10
- </script>
11
-
12
- <table
13
- class:colored
14
- class:contained
15
- class:rounded
16
- class:hang
17
- class:fullWidth
18
- class:hoverable
19
- >
20
- {@render children()}
21
- </table>
22
-
23
- <style>
24
- </style>
@@ -1,34 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- colored?: boolean | undefined;
6
- contained?: boolean | undefined;
7
- rounded?: boolean | undefined;
8
- hang?: boolean | undefined;
9
- hoverable?: boolean | undefined;
10
- fullWidth?: boolean | undefined;
11
- children: Snippet;
12
- };
13
- events: {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {};
17
- };
18
- export type TableProps = typeof __propDef.props;
19
- export type TableEvents = typeof __propDef.events;
20
- export type TableSlots = typeof __propDef.slots;
21
- export default class Table extends SvelteComponent<TableProps, TableEvents, TableSlots> {
22
- constructor(options?: import("svelte").ComponentConstructorOptions<{
23
- colored?: boolean | undefined;
24
- contained?: boolean | undefined;
25
- rounded?: boolean | undefined;
26
- hang?: boolean | undefined;
27
- hoverable?: boolean | undefined;
28
- fullWidth?: 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
- };
32
- }>);
33
- }
34
- export {};
@@ -1,90 +0,0 @@
1
- <script lang="ts">import { isStatusColor } from "../utils/color.js";
2
- let {
3
- code,
4
- color = "default",
5
- shape = "pill",
6
- onclick,
7
- href,
8
- target,
9
- children
10
- } = $props();
11
- let isSet = $derived(color ? isStatusColor(color) : true);
12
- </script>
13
-
14
- {#snippet content()}
15
- <em>
16
- {@render children()}
17
- </em>
18
- {/snippet}
19
-
20
- {#if href}
21
- <a {href} {target} class:code class="Tag Link {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+')'};" onclick={onclick}>
22
- {@render content()}
23
- </a>
24
- {:else if onclick}
25
- <button type="button" class:code class="Tag {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+')'};" onclick={onclick}>
26
- {@render content()}
27
- </button>
28
- {:else}
29
- <span class:code class="Tag {shape}" style="--bgColor: {!isSet ? color : 'var(--status-'+color+')'};">
30
- {@render content()}
31
- </span>
32
- {/if}
33
-
34
- <style>
35
- .Tag {
36
- display: inline-flex;
37
- padding: var(--padding, 0.25em 0.65em);
38
- font-weight: var(--font-weight, 600);
39
- --bgColor2: var(--bgColor);
40
- background: var(--bgColor);
41
- border-radius: var(--border-radius);
42
- font-size: var(--font-size, 1em);
43
- vertical-align: var(--vertical-align, baseline);
44
- border: 1px solid color-mix(in srgb, var(--bgColor) 95%, var(--mix-target, black) 5%);
45
- }
46
- .Tag.rectangle {
47
- border-radius: 0;
48
- }
49
- .Tag.pill {
50
- border-radius: 99999px;
51
- }
52
- .Tag.code {
53
- font-family: var(--font-family-mono);
54
- padding: var(--padding, 0.15em 0.35em);
55
- font-size: 1em;
56
- line-height: 1em;
57
- background: var(--bg, var(--bg-subtle));
58
- color: var(--text);
59
- border: var(--border, var(--border-subtle));
60
- }
61
- em {
62
- opacity: 0.75;
63
- font-style: normal;
64
- color: var(--bgColor2);
65
- filter: url(#bwFilter);
66
- mix-blend-mode: luminosity;
67
- left: 50%;
68
- position: relative;
69
- display: block;
70
- transform: translateX(-50%);
71
- }
72
- a:hover, button:hover {
73
- --bgColor2: color-mix(in srgb, var(--bgColor) 87%, white 13%);
74
- background-color: var(--bgColor2);
75
- cursor: pointer;
76
- }
77
- @media (prefers-contrast: more) {
78
- .Tag {
79
- border: 1px solid color-mix(in srgb, var(--bgColor) 50%, var(--mix-target, black) 50%);
80
- }
81
- em {
82
- opacity: 0.99;
83
- }
84
- }
85
- @media (prefers-contrast: less) {
86
- em {
87
- opacity: 0.65;
88
- }
89
- }
90
- </style>
@@ -1,35 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- import type { StatusColorOrString } from '../utils/color.js';
4
- declare const __propDef: {
5
- props: {
6
- code?: boolean | undefined;
7
- color?: StatusColorOrString | undefined;
8
- shape?: "rounded" | "pill" | "rectangle" | undefined;
9
- onclick?: ((event: MouseEvent) => void) | undefined;
10
- href?: string | undefined;
11
- target?: string | undefined;
12
- children: Snippet;
13
- };
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export type TagProps = typeof __propDef.props;
20
- export type TagEvents = typeof __propDef.events;
21
- export type TagSlots = typeof __propDef.slots;
22
- export default class Tag extends SvelteComponent<TagProps, TagEvents, TagSlots> {
23
- constructor(options?: import("svelte").ComponentConstructorOptions<{
24
- code?: boolean | undefined;
25
- color?: StatusColorOrString | undefined;
26
- shape?: "rounded" | "pill" | "rectangle" | undefined;
27
- onclick?: ((event: MouseEvent) => void) | undefined;
28
- href?: string | undefined;
29
- target?: string | undefined;
30
- children: (this: void) => typeof import("svelte").SnippetReturn & {
31
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
32
- };
33
- }>);
34
- }
35
- export {};
@@ -1,28 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- children: Snippet;
6
- tip: string | Snippet;
7
- open?: boolean | undefined;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- };
14
- export type TooltipProps = typeof __propDef.props;
15
- export type TooltipEvents = typeof __propDef.events;
16
- export type TooltipSlots = typeof __propDef.slots;
17
- export default class Tooltip extends SvelteComponent<TooltipProps, TooltipEvents, TooltipSlots> {
18
- constructor(options?: import("svelte").ComponentConstructorOptions<{
19
- children: (this: void) => typeof import("svelte").SnippetReturn & {
20
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
21
- };
22
- tip: string | ((this: void) => typeof import("svelte").SnippetReturn & {
23
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
24
- });
25
- open?: boolean | undefined;
26
- }>);
27
- }
28
- export {};
@@ -1,14 +0,0 @@
1
- export { default as Avatar } from './Avatar.svelte';
2
- export { default as Badge } from './Badge.svelte';
3
- export { default as Callout } from './Callout.svelte';
4
- export { default as Code } from './Code.svelte';
5
- export { default as ContextTip } from './ContextTip.svelte';
6
- export { default as Details } from './Details.svelte';
7
- export { default as Hero } from './Hero.svelte';
8
- export { default as Icon } from './Icon.svelte';
9
- export { default as IconButton } from './IconButton.svelte';
10
- export { default as Indicator } from './Indicator.svelte';
11
- export { default as Popup } from './Popup.svelte';
12
- export { default as Tag } from './Tag.svelte';
13
- export { default as Table } from './Table.svelte';
14
- export { default as Tooltip } from './Tooltip.svelte';
@@ -1,14 +0,0 @@
1
- export { default as Avatar } from './Avatar.svelte';
2
- export { default as Badge } from './Badge.svelte';
3
- export { default as Callout } from './Callout.svelte';
4
- export { default as Code } from './Code.svelte';
5
- export { default as ContextTip } from './ContextTip.svelte';
6
- export { default as Details } from './Details.svelte';
7
- export { default as Hero } from './Hero.svelte';
8
- export { default as Icon } from './Icon.svelte';
9
- export { default as IconButton } from './IconButton.svelte';
10
- export { default as Indicator } from './Indicator.svelte';
11
- export { default as Popup } from './Popup.svelte';
12
- export { default as Tag } from './Tag.svelte';
13
- export { default as Table } from './Table.svelte';
14
- export { default as Tooltip } from './Tooltip.svelte';
@@ -1,21 +0,0 @@
1
- import { type OverlayPosition } from "../layout/overlays.svelte.js";
2
- import type { ComponentType, Snippet } from "svelte";
3
- /**
4
- * Add a notification to the screen.
5
- * @param {object} opts - The options for the notification.
6
- * @param {string} opts.content - The content of the notification.
7
- * @param {OverlayPosition} opts.position - The position of the notification.
8
- * @param {Snippet | ComponentType} opts.icon - The icon of the notification.
9
- * @param {string} opts.title - The title of the notification.
10
- * @param {string} opts.stack - Group notifications together by named stacks.
11
- * @param {number} opts.autoClose - The time in milliseconds before the notification closes.
12
- * @returns {void}
13
- */
14
- export declare function addNotification(opts: {
15
- content: string;
16
- position?: OverlayPosition;
17
- icon?: Snippet | ComponentType;
18
- title?: string;
19
- stack?: string;
20
- autoClose?: number;
21
- }): void;
@@ -1,31 +0,0 @@
1
- import { createId } from "../utils/id.js";
2
- import { addOverlay, removeOverlay } from "../layout/overlays.svelte.js";
3
- import NotificationSvelte from "./Notification.svelte";
4
- /**
5
- * Add a notification to the screen.
6
- * @param {object} opts - The options for the notification.
7
- * @param {string} opts.content - The content of the notification.
8
- * @param {OverlayPosition} opts.position - The position of the notification.
9
- * @param {Snippet | ComponentType} opts.icon - The icon of the notification.
10
- * @param {string} opts.title - The title of the notification.
11
- * @param {string} opts.stack - Group notifications together by named stacks.
12
- * @param {number} opts.autoClose - The time in milliseconds before the notification closes.
13
- * @returns {void}
14
- */
15
- export function addNotification(opts) {
16
- const id = createId();
17
- addOverlay({
18
- id,
19
- z: 100,
20
- content: NotificationSvelte,
21
- props: { id, ...opts },
22
- stack: opts.stack,
23
- position: opts.position || "top right",
24
- layer: "notifications",
25
- });
26
- if (opts.autoClose) {
27
- setTimeout(() => {
28
- removeOverlay(id);
29
- }, opts.autoClose);
30
- }
31
- }
@@ -1,34 +0,0 @@
1
- <script lang="ts">import Icon from "../display/Icon.svelte";
2
- let {
3
- href,
4
- type = "button",
5
- disabled = false,
6
- icon,
7
- onclick,
8
- children
9
- } = $props();
10
- </script>
11
-
12
- {#if href}
13
- <a class="Button Link button" {href} {onclick}>
14
- {#if icon}
15
- <Icon {icon} />
16
- {/if}
17
- {@render children()}
18
- </a>
19
- {:else}
20
- <button class="Button button" type={type} disabled={disabled} {onclick}>
21
- {#if icon}
22
- <Icon {icon} />
23
- {/if}
24
- {@render children()}
25
- </button>
26
- {/if}
27
-
28
- <style>
29
- .Button {
30
- display: inline-flex;
31
- align-items: center;
32
- justify-content: center;
33
- }
34
- </style>
@@ -1,36 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { ComponentType, Snippet } from 'svelte';
3
- declare const __propDef: {
4
- props: {
5
- href?: string | undefined;
6
- type?: "button" | "submit" | "reset" | undefined;
7
- disabled?: boolean | undefined;
8
- icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
9
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
10
- }) | ComponentType | undefined;
11
- onclick?: ((event: MouseEvent) => void) | undefined;
12
- children: Snippet;
13
- };
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export type ButtonProps = typeof __propDef.props;
20
- export type ButtonEvents = typeof __propDef.events;
21
- export type ButtonSlots = typeof __propDef.slots;
22
- export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
23
- constructor(options?: import("svelte").ComponentConstructorOptions<{
24
- href?: string | undefined;
25
- type?: "button" | "submit" | "reset" | undefined;
26
- disabled?: boolean | undefined;
27
- icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
28
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
29
- }) | ComponentType | undefined;
30
- onclick?: ((event: MouseEvent) => void) | undefined;
31
- children: (this: void) => typeof import("svelte").SnippetReturn & {
32
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
33
- };
34
- }>);
35
- }
36
- export {};
@@ -1,46 +0,0 @@
1
- <script lang="ts">let {
2
- align = "end",
3
- children
4
- } = $props();
5
- </script>
6
-
7
- <div class="FieldActions {align}">
8
- <div class="Actions">
9
- {@render children()}
10
- </div>
11
- </div>
12
-
13
- <style>
14
- .FieldActions {
15
- display: grid;
16
- background: color-mix(in srgb, var(--bg-subtle) calc(var(--fcc) * 100%), transparent);
17
- padding: calc(1.5em * var(--fcc)) calc(3em * var(--fcc));
18
- grid-column: 1 / -1;
19
- grid-template-columns: subgrid;
20
- }
21
- .Actions {
22
- display: flex;
23
- flex-direction: row;
24
- align-items: center;
25
- justify-content: space-between;
26
- gap: 1.35em;
27
- grid-column: 2 / -1;
28
- }
29
- .FieldActions.start .Actions {
30
- justify-content: start;
31
- grid-column: 1 / -1;
32
- }
33
- .FieldActions.middle .Actions {
34
- justify-content: center;
35
- grid-column: 1 / -1;
36
- }
37
- .FieldActions.end .Actions {
38
- justify-content: end;
39
- grid-column: 1 / -1;
40
- }
41
- @container (max-width: 480px) {
42
- .Actions {
43
- flex-direction: column;
44
- }
45
- }
46
- </style>
@@ -1,24 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- align?: "middle" | "justified" | "start" | "end" | undefined;
6
- children: Snippet;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type FieldActionsProps = typeof __propDef.props;
14
- export type FieldActionsEvents = typeof __propDef.events;
15
- export type FieldActionsSlots = typeof __propDef.slots;
16
- export default class FieldActions extends SvelteComponent<FieldActionsProps, FieldActionsEvents, FieldActionsSlots> {
17
- constructor(options?: import("svelte").ComponentConstructorOptions<{
18
- align?: "middle" | "justified" | "start" | "end" | undefined;
19
- children: (this: void) => typeof import("svelte").SnippetReturn & {
20
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
21
- };
22
- }>);
23
- }
24
- export {};
@@ -1,37 +0,0 @@
1
- <script lang="ts">let {
2
- children,
3
- contained
4
- } = $props();
5
- </script>
6
-
7
- <div class="FieldContainer" class:contained style="--fcc: {contained ? 1 : 0}">
8
- {@render children()}
9
- </div>
10
-
11
- <style>
12
- .FieldContainer {
13
- container-type: inline-size;
14
- display: grid;
15
- row-gap: 1.5em;
16
- column-gap: 3em;
17
- grid-template-columns: minmax(25ch, 35%) minmax(min-content, 1fr);
18
- border-radius: var(--border-radius);
19
- }
20
- .FieldContainer.contained {
21
- border: var(--border);
22
- gap: 0;
23
- overflow: clip;
24
- }
25
- .FieldContainer :global(.FieldSection:has(+ .FieldActions)) {
26
- margin-bottom: 0;
27
- border-bottom: 0;
28
- }
29
- .FieldContainer.contained :global(.FieldSection:has(+ .FieldActions)) {
30
- border-bottom: var(--border);
31
- }
32
- @container (max-width: 800px) {
33
- .FieldContainer {
34
- grid-template-columns: 1fr;
35
- }
36
- }
37
- </style>
@@ -1,24 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- contained?: boolean | undefined;
6
- children: Snippet;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type FieldContainerProps = typeof __propDef.props;
14
- export type FieldContainerEvents = typeof __propDef.events;
15
- export type FieldContainerSlots = typeof __propDef.slots;
16
- export default class FieldContainer extends SvelteComponent<FieldContainerProps, FieldContainerEvents, FieldContainerSlots> {
17
- constructor(options?: import("svelte").ComponentConstructorOptions<{
18
- contained?: boolean | undefined;
19
- children: (this: void) => typeof import("svelte").SnippetReturn & {
20
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
21
- };
22
- }>);
23
- }
24
- export {};
@@ -1,134 +0,0 @@
1
- <script lang="ts">import Label from "./Label.svelte";
2
- import FieldError from "./FieldError.svelte";
3
- let {
4
- id,
5
- contained,
6
- prefix,
7
- suffix,
8
- label,
9
- labelTip,
10
- type = "text",
11
- direction = "column",
12
- // 'row' | 'column'
13
- children,
14
- field,
15
- issue
16
- } = $props();
17
- </script>
18
-
19
- {#snippet _prefix()}
20
- <div class="Fix Prefix">
21
- {#if typeof prefix === 'string'}
22
- {prefix}
23
- {:else}
24
- {@render prefix()}
25
- {/if}
26
- </div>
27
- {/snippet}
28
-
29
- {#snippet _suffix()}
30
- <div class="Fix Suffix">
31
- {#if typeof suffix === 'string'}
32
- {suffix}
33
- {:else}
34
- {@render suffix()}
35
- {/if}
36
- </div>
37
- {/snippet}
38
-
39
- <div class="FieldContent {type} {direction}" class:contained>
40
- <Label {label} tip={labelTip} {id} />
41
- {#if contained}
42
- <div
43
- class="Field"
44
- class:hasPrefix={prefix}
45
- class:hasSuffix={suffix}
46
- class:invalid={field?.tainted && issue?.code}
47
- >
48
- {#if prefix}
49
- {@render _prefix()}
50
- {/if}
51
-
52
- {@render children()}
53
-
54
- {#if suffix}
55
- {@render _suffix()}
56
- {/if}
57
- </div>
58
- {:else}
59
- {#if prefix}
60
- {@render _prefix()}
61
- {/if}
62
-
63
- {@render children()}
64
-
65
- {#if suffix}
66
- {@render _suffix()}
67
- {/if}
68
- {/if}
69
-
70
- {#if field?.tainted && issue?.code}
71
- <FieldError code={issue.code} message={issue.message} />
72
- {/if}
73
- </div>
74
-
75
- <style>
76
- .FieldContent {
77
- display: flex;
78
- gap: 0.75em;
79
- flex-direction: column;
80
- font-size: var(--font-size, 1em);
81
- }
82
- .FieldContent.row {
83
- flex-direction: row-reverse;
84
- justify-content: start;
85
- align-items: center;
86
- flex-shrink: 0;
87
- }
88
- .Field {
89
- background-color: var(--field-bg);
90
- border: var(--field-border-size) var(--field-border-style) var(--field-border-color);
91
- border-radius: var(--field-radius);
92
- display: flex;
93
- }
94
- .Field:has(input:user-invalid),
95
- .Field.invalid {
96
- border-color: var(--field-border-color-error);
97
- }
98
- .Field > *:not(input) {
99
- flex-grow: 0;
100
- flex-shrink: 0;
101
- }
102
- .Fix {
103
- display: flex;
104
- align-items: center;
105
- padding-inline: 0.75em;
106
- font-size: 1em;
107
- line-height: 1.5;
108
- color: var(--text-subtle);
109
- }
110
- .Suffix {
111
- padding-inline-start: 0;
112
- }
113
- .Prefix {
114
- padding-inline-end: 0;
115
- }
116
- .Field:has(input:focus-visible) {
117
- outline: var(--focus-outline);
118
- }
119
- .Field:has(input:focus-visible:user-invalid),
120
- .Field.invalid:has(input:focus-visible) {
121
- outline-color: var(--focus-color-error);
122
- }
123
- .Field.hasPrefix :global(input) {
124
- padding-inline-start: 0.35em;
125
- }
126
- .Field :global(button) {
127
- margin-right: 2px;
128
- }
129
- .Field :global(button:focus-visible) {
130
- outline: var(--focus-outline);
131
- outline-offset: 3px;
132
- border-radius: calc(var(--field-radius) - 2px);
133
- }
134
- </style>