@functionalcms/svelte-components 4.36.9 → 5.0.0-beta1

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 (127) hide show
  1. package/css/functional.css +48 -1
  2. package/dist/auth/getMachineAccessToken.d.ts +1 -1
  3. package/dist/auth/getMachineAccessToken.js +1 -2
  4. package/dist/auth/machineAuthenticationProvider.d.ts +1 -1
  5. package/dist/auth/machineAuthenticationProvider.js +1 -2
  6. package/dist/auth/tokenRefresh.d.ts +1 -1
  7. package/dist/auth/tokenRefresh.js +4 -5
  8. package/dist/auth/types.js +4 -8
  9. package/dist/auth/userAuthenticationProvider.d.ts +1 -1
  10. package/dist/auth/userAuthenticationProvider.js +1 -2
  11. package/dist/components/Icon.svelte +16 -0
  12. package/dist/components/Icon.svelte.d.ts +9 -0
  13. package/dist/components/content/Markdown.svelte +2 -2
  14. package/dist/components/content/Markdown.svelte.d.ts +17 -4
  15. package/dist/components/form/Dropzone.svelte +2 -5
  16. package/dist/components/form/SmartForm.svelte +206 -60
  17. package/dist/components/form/SmartForm.svelte.d.ts +2 -2
  18. package/dist/components/form/form.d.ts +87 -17
  19. package/dist/components/form/form.js +86 -6
  20. package/dist/components/icons.d.ts +763 -0
  21. package/dist/components/icons.js +765 -0
  22. package/dist/components/integrations/EasyTools.svelte +1 -1
  23. package/dist/components/layouts/DefaultLayout.svelte +92 -41
  24. package/dist/components/layouts/DefaultLayout.svelte.d.ts +17 -8
  25. package/dist/components/layouts/FlexBox.svelte +73 -0
  26. package/dist/components/layouts/FlexBox.svelte.d.ts +17 -0
  27. package/dist/components/layouts/MenuLayout.svelte +39 -201
  28. package/dist/components/layouts/MenuLayout.svelte.d.ts +2 -10
  29. package/dist/components/layouts/StyleBox.svelte +17 -0
  30. package/dist/components/layouts/StyleBox.svelte.d.ts +7 -0
  31. package/dist/components/layouts/Well.svelte +8 -34
  32. package/dist/components/layouts/Well.svelte.d.ts +4 -8
  33. package/dist/components/layouts/menuItems.d.ts +29 -0
  34. package/dist/components/layouts/menuItems.js +28 -0
  35. package/dist/index-server.d.ts +2 -1
  36. package/dist/index-server.js +2 -1
  37. package/dist/index.d.ts +9 -47
  38. package/dist/index.js +8 -59
  39. package/dist/server-side/getServices.d.ts +8 -8
  40. package/dist/server-side/getServices.js +16 -27
  41. package/dist/server-side/handlers/paraglideHandler.d.ts +2 -0
  42. package/dist/server-side/handlers/paraglideHandler.js +13 -0
  43. package/dist/server-side/handlers/redirectPipelineHandler.d.ts +5 -0
  44. package/dist/server-side/{getRedirectPipeline.js → handlers/redirectPipelineHandler.js} +1 -2
  45. package/dist/utils/stringHash.d.ts +1 -0
  46. package/dist/utils/stringHash.js +7 -0
  47. package/package.json +28 -39
  48. package/css/functional.css.map +0 -1
  49. package/dist/components/MaterialIconSet.d.ts +0 -3819
  50. package/dist/components/MaterialIconSet.js +0 -3823
  51. package/dist/components/Styling.d.ts +0 -59
  52. package/dist/components/Styling.js +0 -66
  53. package/dist/components/blog/blog.d.ts +0 -20
  54. package/dist/components/blog/blog.js +0 -29
  55. package/dist/components/dynamic/CopyToClipboard.svelte +0 -16
  56. package/dist/components/dynamic/CopyToClipboard.svelte.d.ts +0 -36
  57. package/dist/components/dynamic/DynamicButton.d.ts +0 -1
  58. package/dist/components/dynamic/DynamicButton.js +0 -10
  59. package/dist/components/dynamic/DynamicButton.svelte +0 -33
  60. package/dist/components/dynamic/DynamicButton.svelte.d.ts +0 -9
  61. package/dist/components/form/Button.svelte +0 -389
  62. package/dist/components/form/Button.svelte.d.ts +0 -30
  63. package/dist/components/form/ChoiceInput.svelte +0 -375
  64. package/dist/components/form/ChoiceInput.svelte.d.ts +0 -3
  65. package/dist/components/form/Input.svelte +0 -461
  66. package/dist/components/form/Input.svelte.d.ts +0 -30
  67. package/dist/components/form/Select.svelte +0 -163
  68. package/dist/components/form/Select.svelte.d.ts +0 -21
  69. package/dist/components/form/Switch.svelte +0 -293
  70. package/dist/components/form/Switch.svelte.d.ts +0 -14
  71. package/dist/components/indicators/Loader.svelte +0 -114
  72. package/dist/components/indicators/Loader.svelte.d.ts +0 -30
  73. package/dist/components/indicators/Spinner.svelte +0 -109
  74. package/dist/components/indicators/Spinner.svelte.d.ts +0 -28
  75. package/dist/components/layouts/Banner.svelte +0 -26
  76. package/dist/components/layouts/Banner.svelte.d.ts +0 -8
  77. package/dist/components/layouts/FoldablePanel.svelte +0 -16
  78. package/dist/components/layouts/FoldablePanel.svelte.d.ts +0 -7
  79. package/dist/components/layouts/SimpleFooter.svelte +0 -23
  80. package/dist/components/layouts/SimpleFooter.svelte.d.ts +0 -8
  81. package/dist/components/layouts/Tabs.svelte +0 -362
  82. package/dist/components/layouts/Tabs.svelte.d.ts +0 -11
  83. package/dist/components/layouts/TwoColumnsLayout.svelte +0 -44
  84. package/dist/components/layouts/TwoColumnsLayout.svelte.d.ts +0 -13
  85. package/dist/components/layouts/menuLayout.d.ts +0 -12
  86. package/dist/components/layouts/menuLayout.js +0 -1
  87. package/dist/components/layouts/tabs.d.ts +0 -21
  88. package/dist/components/layouts/tabs.js +0 -13
  89. package/dist/components/menu/CollapsibleMenu.svelte +0 -66
  90. package/dist/components/menu/CollapsibleMenu.svelte.d.ts +0 -18
  91. package/dist/components/menu/DynamicMenu.svelte +0 -55
  92. package/dist/components/menu/DynamicMenu.svelte.d.ts +0 -13
  93. package/dist/components/menu/HamburgerMenu.svelte +0 -62
  94. package/dist/components/menu/HamburgerMenu.svelte.d.ts +0 -14
  95. package/dist/components/menu/ListMenu.svelte +0 -61
  96. package/dist/components/menu/ListMenu.svelte.d.ts +0 -17
  97. package/dist/components/menu/NavigationDrawer.svelte +0 -53
  98. package/dist/components/menu/NavigationDrawer.svelte.d.ts +0 -18
  99. package/dist/components/menu/types.d.ts +0 -23
  100. package/dist/components/menu/types.js +0 -35
  101. package/dist/components/presentation/Accordion.svelte +0 -82
  102. package/dist/components/presentation/Accordion.svelte.d.ts +0 -11
  103. package/dist/components/presentation/Card.svelte +0 -147
  104. package/dist/components/presentation/Card.svelte.d.ts +0 -15
  105. package/dist/components/presentation/Carousel.d.ts +0 -5
  106. package/dist/components/presentation/Carousel.js +0 -1
  107. package/dist/components/presentation/Carousel.svelte +0 -119
  108. package/dist/components/presentation/Carousel.svelte.d.ts +0 -17
  109. package/dist/components/presentation/Dialog.svelte +0 -75
  110. package/dist/components/presentation/Dialog.svelte.d.ts +0 -22
  111. package/dist/components/presentation/Disclose.svelte +0 -116
  112. package/dist/components/presentation/Disclose.svelte.d.ts +0 -11
  113. package/dist/components/presentation/Drawer.svelte +0 -118
  114. package/dist/components/presentation/Drawer.svelte.d.ts +0 -13
  115. package/dist/components/presentation/EmptyState.svelte +0 -67
  116. package/dist/components/presentation/EmptyState.svelte.d.ts +0 -10
  117. package/dist/components/presentation/Gallery.svelte +0 -35
  118. package/dist/components/presentation/Gallery.svelte.d.ts +0 -14
  119. package/dist/components/presentation/Link.svelte +0 -362
  120. package/dist/components/presentation/Link.svelte.d.ts +0 -27
  121. package/dist/components/utils.d.ts +0 -3
  122. package/dist/components/utils.js +0 -1
  123. package/dist/index.server.d.ts +0 -11
  124. package/dist/index.server.js +0 -10
  125. package/dist/server-side/getRedirectPipeline.d.ts +0 -6
  126. package/dist/utils.d.ts +0 -1
  127. package/dist/utils.js +0 -3
@@ -1,75 +0,0 @@
1
- <script lang="ts">
2
- import Button from '../form/Button.svelte';
3
- import { cn } from '../../utils.js';
4
- import type { Snippet } from 'svelte';
5
- import type { EventHandler } from 'svelte/elements';
6
-
7
- interface Css {
8
- container: string;
9
- header: string;
10
- main: string;
11
- }
12
-
13
- interface Props {
14
- children: Snippet;
15
- css: Css;
16
- isOpen: boolean;
17
- onClose?: EventHandler<Event, HTMLDialogElement> | undefined;
18
- showHeader?: boolean;
19
- title?: string;
20
- showCloseButton?: boolean;
21
- }
22
-
23
- let {
24
- children,
25
- onClose,
26
- css = { container:'', header:'', main:'', },
27
- isOpen = false,
28
- showHeader = true,
29
- title = '',
30
- showCloseButton = true,
31
- }: Props = $props();
32
- let dialog: any;
33
-
34
- export function showModal() {
35
- dialog.showModal();
36
- }
37
- export function close() {
38
- dialog.close();
39
- }
40
-
41
- if (isOpen) {
42
- dialog.showModal();
43
- }
44
-
45
- const headerCss = cn(css.header, css.container);
46
- </script>
47
-
48
- <dialog bind:this={dialog} onclose={onClose} class={css.container}>
49
- {#if showHeader}
50
- <header class={headerCss}>
51
- <h2>{title}</h2>
52
- {#if showCloseButton}
53
- <Button css="closeModal" click={close}>X</Button>
54
- {/if}
55
- </header>
56
- {/if}
57
- <main class={css.main}>
58
- {@render children?.()}
59
- </main>
60
- </dialog>
61
-
62
- <style>
63
- h2 {
64
- margin: 0 30px 0px 0px;
65
- padding: 0;
66
- font-size: 1.5em;
67
- }
68
- :global(.closeModal){
69
- position: absolute;
70
- top: 5px;
71
- right: 5px;
72
- border: none !important;
73
- background: transparent !important;
74
- }
75
- </style>
@@ -1,22 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- import type { EventHandler } from 'svelte/elements';
3
- interface Css {
4
- container: string;
5
- header: string;
6
- main: string;
7
- }
8
- interface Props {
9
- children: Snippet;
10
- css: Css;
11
- isOpen: boolean;
12
- onClose?: EventHandler<Event, HTMLDialogElement> | undefined;
13
- showHeader?: boolean;
14
- title?: string;
15
- showCloseButton?: boolean;
16
- }
17
- declare const Dialog: import("svelte").Component<Props, {
18
- showModal: () => void;
19
- close: () => void;
20
- }, "">;
21
- type Dialog = ReturnType<typeof Dialog>;
22
- export default Dialog;
@@ -1,116 +0,0 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils.js';
3
- import type { Snippet } from 'svelte';
4
-
5
- interface Props {
6
- children: Snippet;
7
- title?: string;
8
- isOpen?: boolean;
9
- isBackground?: boolean;
10
- isBordered?: boolean;
11
- }
12
-
13
- let {
14
- children,
15
- title = '',
16
- isOpen = false,
17
- isBackground = false,
18
- isBordered = false
19
- }: Props = $props();
20
-
21
- const discloseClasses = cn(
22
- 'disclose',
23
- isBackground ? 'disclose-bg' : '',
24
- isBordered ? 'disclose-bordered' : ''
25
- );
26
- </script>
27
-
28
- <details class={discloseClasses} bind:open={isOpen}>
29
- <summary class="disclose-title">{title}</summary>
30
- <div class="disclose-panel">
31
- {@render children()}
32
- </div>
33
- </details>
34
-
35
- <style>
36
- .disclose {
37
- margin-block-end: var(--fluid-4);
38
-
39
- /* When this element is a direct child of a flex container with
40
- flex-direction: column it collapses similar to an inline element even though
41
- it's block. This helps prevent that. */
42
- width: 100%;
43
- }
44
-
45
- .disclose-title {
46
- display: block;
47
- cursor: pointer;
48
- font-weight: 600;
49
- padding: var(--fluid-8) var(--fluid-12);
50
-
51
- /* Required to position the icon absolutely */
52
- position: relative;
53
- color: inherit;
54
- transition: color var(--functional-timing-slow);
55
- }
56
-
57
- .disclose-panel {
58
- font-weight: 400;
59
- padding: var(--fluid-16);
60
- }
61
-
62
- .disclose-title,
63
- .disclose-panel {
64
- margin: 0;
65
- }
66
-
67
- /* stylelint-disable-next-line selector-pseudo-element-no-unknown */
68
- .disclose-title::webkit-details-marker {
69
- display: none;
70
- }
71
-
72
- .disclose-bordered .disclose-title {
73
- border: 1px solid var(--functional-gray-light);
74
- }
75
-
76
- .disclose-bg .disclose-title {
77
- background-color: var(--functional-gray-light);
78
- }
79
-
80
- .disclose-title:focus {
81
- box-shadow: 0 0 0 var(--functional-focus-ring-outline-width) var(--functional-focus-ring-color);
82
-
83
- /* Needed for High Contrast mode */
84
- outline: var(--functional-focus-ring-outline-width) var(--functional-focus-ring-outline-style)
85
- var(--functional-focus-ring-outline-color);
86
- transition: box-shadow var(--functional-timing-fast) ease-out;
87
- }
88
-
89
- .disclose-title::after {
90
- color: var(--functional-gray-dark);
91
- content: '\203A';
92
- position: absolute;
93
- right: var(--fluid-12);
94
- top: 0;
95
- bottom: 0;
96
-
97
- /* Chevron thinning :) */
98
- font-size: var(--fluid-32);
99
- line-height: 1;
100
- font-weight: 100;
101
- transition: transform var(--functional-timing-slow);
102
- transform: rotate(0);
103
- }
104
-
105
- @media (prefers-reduced-motion), (update: slow) {
106
- .disclose-title,
107
- .disclose-title:focus,
108
- .disclose-title::after {
109
- transition: none;
110
- }
111
- }
112
-
113
- .disclose[open] > .disclose-title::after {
114
- transform: rotate(90deg);
115
- }
116
- </style>
@@ -1,11 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
3
- children: Snippet;
4
- title?: string;
5
- isOpen?: boolean;
6
- isBackground?: boolean;
7
- isBordered?: boolean;
8
- }
9
- declare const Disclose: import("svelte").Component<Props, {}, "">;
10
- type Disclose = ReturnType<typeof Disclose>;
11
- export default Disclose;
@@ -1,118 +0,0 @@
1
- <script lang="ts">
2
- import { onMount, type Snippet } from 'svelte';
3
- import { Placement } from '../Styling.js';
4
-
5
- interface Props {
6
- open?: boolean;
7
- duration?: number;
8
- placement?: Placement;
9
- size?: number;
10
- clickAway: () => void;
11
- children: Snippet
12
- }
13
-
14
- let {
15
- open = false,
16
- duration = 0.2,
17
- placement = Placement.Start,
18
- size = undefined,
19
- clickAway,
20
- children,
21
- }: Props = $props();
22
-
23
- let style = $derived('--duration: ' + duration + 's; --size: ' + size + ';');
24
-
25
- function handleClickAway() {
26
- clickAway();
27
- }
28
- </script>
29
-
30
- <aside class="drawer" class:open {style}>
31
- <!-- svelte-ignore a11y_click_events_have_key_events -->
32
- <!-- svelte-ignore a11y_no_static_element_interactions -->
33
- <div class="overlay" onclick={handleClickAway}></div>
34
-
35
- <div class="panel {placement}" class:size>
36
- {@render children()}
37
- </div>
38
- </aside>
39
-
40
- <style>
41
- .drawer {
42
- position: fixed;
43
- top: 0;
44
- left: 0;
45
- height: 100vh;
46
- width: 100vw;
47
- z-index: -1;
48
- transition: z-index var(--duration) step-end;
49
- display: none;
50
- }
51
-
52
- .drawer.open {
53
- z-index: 99;
54
- display: block;
55
- transition: z-index var(--duration) step-start;
56
- }
57
-
58
- .overlay {
59
- position: fixed;
60
- top: 0;
61
- left: 0;
62
- height: 100vh;
63
- width: 100vw;
64
- background: rgba(100, 100, 100, 0.5);
65
- opacity: 0;
66
- z-index: 2;
67
- transition: opacity var(--duration) ease;
68
- }
69
-
70
- .drawer.open .overlay {
71
- opacity: 1;
72
- }
73
-
74
- .panel {
75
- position: fixed;
76
- width: 100%;
77
- height: 100%;
78
- background: white;
79
- z-index: 3;
80
- transition: transform var(--duration) ease;
81
- overflow: auto;
82
- padding: var(--hamburger-menu-margin, 25px);
83
- }
84
-
85
- .panel.left {
86
- left: 0;
87
- transform: translate(-100%, 0);
88
- }
89
-
90
- .panel.right {
91
- right: 0;
92
- transform: translate(100%, 0);
93
- }
94
-
95
- .panel.top {
96
- top: 0;
97
- transform: translate(0, -100%);
98
- }
99
-
100
- .panel.bottom {
101
- bottom: 0;
102
- transform: translate(0, 100%);
103
- }
104
-
105
- .panel.left.size,
106
- .panel.right.size {
107
- max-width: var(--size);
108
- }
109
-
110
- .panel.top.size,
111
- .panel.bottom.size {
112
- max-height: var(--size);
113
- }
114
-
115
- .drawer.open .panel {
116
- transform: translate(0, 0);
117
- }
118
- </style>
@@ -1,13 +0,0 @@
1
- import { type Snippet } from 'svelte';
2
- import { Placement } from '../Styling.js';
3
- interface Props {
4
- open?: boolean;
5
- duration?: number;
6
- placement?: Placement;
7
- size?: number;
8
- clickAway: () => void;
9
- children: Snippet;
10
- }
11
- declare const Drawer: import("svelte").Component<Props, {}, "">;
12
- type Drawer = ReturnType<typeof Drawer>;
13
- export default Drawer;
@@ -1,67 +0,0 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils.js';
3
- import type { Snippet } from 'svelte';
4
-
5
- interface Props {
6
- header: Snippet;
7
- footer: Snippet;
8
- children: Snippet;
9
- isRounded: boolean;
10
- isBordered: boolean;
11
- }
12
-
13
- let {
14
- header,
15
- footer,
16
- children,
17
- isRounded = false,
18
- isBordered = false
19
- }: Partial<Props> = $props();
20
-
21
- const emptyClasses: string = cn(
22
- 'empty',
23
- isRounded ? 'empty-rounded' : '',
24
- isBordered ? 'empty-bordered' : ''
25
- );
26
- </script>
27
-
28
- <div class={emptyClasses}>
29
- {#if header}
30
- {@render header()}
31
- {/if}
32
- {@render children?.()}
33
- <div class="empty-actions">
34
- {#if footer}
35
- {@render footer()}
36
- {/if}
37
- </div>
38
- </div>
39
-
40
- <style>
41
- .empty-base,
42
- .empty {
43
- display: flex;
44
- flex-flow: column wrap;
45
- align-items: center;
46
- text-align: center;
47
- width: 100%;
48
- }
49
-
50
- .empty {
51
- padding: calc(2 * var(--agnostic-side-padding));
52
- background: var(--agnostic-gray-extra-light);
53
- }
54
-
55
- .empty-bordered {
56
- background: transparent;
57
- border: 1px solid var(--agnostic-gray-light);
58
- }
59
-
60
- .empty-rounded {
61
- border-radius: var(--agnostic-radius);
62
- }
63
-
64
- .empty-actions {
65
- margin-block-start: var(--spacing-24);
66
- }
67
- </style>
@@ -1,10 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- declare const EmptyState: import("svelte").Component<Partial<{
3
- header: Snippet;
4
- footer: Snippet;
5
- children: Snippet;
6
- isRounded: boolean;
7
- isBordered: boolean;
8
- }>, {}, "">;
9
- type EmptyState = ReturnType<typeof EmptyState>;
10
- export default EmptyState;
@@ -1,35 +0,0 @@
1
- <script lang="ts">
2
- import Card from './Card.svelte';
3
- import type { ShowItem } from './ShowItem.ts';
4
- import { AlignItmes, Justify, Orientation } from '../Styling.js';
5
- import { cn } from '../../utils.js';
6
- import type { Snippet } from 'svelte';
7
-
8
- interface Props {
9
- items: Array<ShowItem>;
10
- renderItem: Snippet<[ShowItem]>;
11
- justify: Justify;
12
- alignItems: AlignItmes;
13
- orientation: Orientation;
14
- restProps: any;
15
- css: string;
16
- }
17
-
18
- let {
19
- items = [],
20
- renderItem,
21
- css = '',
22
- justify = Justify.Between,
23
- alignItems = AlignItmes.Center,
24
- orientation = Orientation.DynamicRow,
25
- ...restProps
26
- }: Partial<Props> = $props();
27
-
28
- let classes = cn('flex', css, `${orientation}`, `${justify}`, `${alignItems}`);
29
- </script>
30
-
31
- <Card css={classes} {...restProps}>
32
- {#each items as entry}
33
- {@render renderItem?.(entry)}
34
- {/each}
35
- </Card>
@@ -1,14 +0,0 @@
1
- import type { ShowItem } from './ShowItem.ts';
2
- import { AlignItmes, Justify, Orientation } from '../Styling.js';
3
- import type { Snippet } from 'svelte';
4
- declare const Gallery: import("svelte").Component<Partial<{
5
- items: Array<ShowItem>;
6
- renderItem: Snippet<[ShowItem]>;
7
- justify: Justify;
8
- alignItems: AlignItmes;
9
- orientation: Orientation;
10
- restProps: any;
11
- css: string;
12
- }>, {}, "">;
13
- type Gallery = ReturnType<typeof Gallery>;
14
- export default Gallery;