@functionalcms/svelte-components 4.36.10 → 5.0.0-beta2
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/css/functional.css +48 -1
- package/dist/auth/getMachineAccessToken.d.ts +1 -1
- package/dist/auth/getMachineAccessToken.js +1 -2
- package/dist/auth/machineAuthenticationProvider.d.ts +1 -1
- package/dist/auth/machineAuthenticationProvider.js +1 -2
- package/dist/auth/tokenRefresh.d.ts +1 -1
- package/dist/auth/tokenRefresh.js +4 -5
- package/dist/auth/types.js +4 -8
- package/dist/auth/userAuthenticationProvider.d.ts +1 -1
- package/dist/auth/userAuthenticationProvider.js +1 -2
- package/dist/components/Icon.svelte +16 -0
- package/dist/components/Icon.svelte.d.ts +9 -0
- package/dist/components/content/Markdown.svelte +2 -2
- package/dist/components/content/Markdown.svelte.d.ts +17 -4
- package/dist/components/form/Dropzone.svelte +2 -5
- package/dist/components/form/SmartForm.svelte +206 -60
- package/dist/components/form/SmartForm.svelte.d.ts +2 -2
- package/dist/components/form/form.d.ts +87 -17
- package/dist/components/form/form.js +86 -6
- package/dist/components/icons.d.ts +763 -0
- package/dist/components/icons.js +765 -0
- package/dist/components/integrations/EasyTools.svelte +1 -1
- package/dist/components/layouts/DefaultLayout.svelte +92 -41
- package/dist/components/layouts/DefaultLayout.svelte.d.ts +17 -8
- package/dist/components/layouts/FlexBox.svelte +73 -0
- package/dist/components/layouts/FlexBox.svelte.d.ts +17 -0
- package/dist/components/layouts/MenuLayout.svelte +39 -201
- package/dist/components/layouts/MenuLayout.svelte.d.ts +2 -10
- package/dist/components/layouts/StyleBox.svelte +17 -0
- package/dist/components/layouts/StyleBox.svelte.d.ts +7 -0
- package/dist/components/layouts/Well.svelte +8 -34
- package/dist/components/layouts/Well.svelte.d.ts +4 -8
- package/dist/components/layouts/menuItems.d.ts +29 -0
- package/dist/components/layouts/menuItems.js +28 -0
- package/dist/index-server.d.ts +2 -1
- package/dist/index-server.js +2 -1
- package/dist/index.d.ts +9 -47
- package/dist/index.js +8 -59
- package/dist/server-side/getServices.d.ts +8 -8
- package/dist/server-side/getServices.js +16 -27
- package/dist/server-side/handlers/paraglideHandler.d.ts +2 -0
- package/dist/server-side/handlers/paraglideHandler.js +13 -0
- package/dist/server-side/handlers/redirectPipelineHandler.d.ts +5 -0
- package/dist/server-side/{getRedirectPipeline.js → handlers/redirectPipelineHandler.js} +1 -2
- package/dist/utils/stringHash.d.ts +1 -0
- package/dist/utils/stringHash.js +7 -0
- package/package.json +28 -39
- package/css/functional.css.map +0 -1
- package/dist/components/MaterialIconSet.d.ts +0 -3819
- package/dist/components/MaterialIconSet.js +0 -3823
- package/dist/components/Styling.d.ts +0 -59
- package/dist/components/Styling.js +0 -66
- package/dist/components/blog/blog.d.ts +0 -20
- package/dist/components/blog/blog.js +0 -29
- package/dist/components/dynamic/CopyToClipboard.svelte +0 -16
- package/dist/components/dynamic/CopyToClipboard.svelte.d.ts +0 -36
- package/dist/components/dynamic/DynamicButton.d.ts +0 -1
- package/dist/components/dynamic/DynamicButton.js +0 -10
- package/dist/components/dynamic/DynamicButton.svelte +0 -33
- package/dist/components/dynamic/DynamicButton.svelte.d.ts +0 -9
- package/dist/components/form/Button.svelte +0 -389
- package/dist/components/form/Button.svelte.d.ts +0 -30
- package/dist/components/form/ChoiceInput.svelte +0 -375
- package/dist/components/form/ChoiceInput.svelte.d.ts +0 -3
- package/dist/components/form/Input.svelte +0 -461
- package/dist/components/form/Input.svelte.d.ts +0 -30
- package/dist/components/form/Select.svelte +0 -163
- package/dist/components/form/Select.svelte.d.ts +0 -21
- package/dist/components/form/Switch.svelte +0 -293
- package/dist/components/form/Switch.svelte.d.ts +0 -14
- package/dist/components/indicators/Loader.svelte +0 -114
- package/dist/components/indicators/Loader.svelte.d.ts +0 -30
- package/dist/components/indicators/Spinner.svelte +0 -109
- package/dist/components/indicators/Spinner.svelte.d.ts +0 -28
- package/dist/components/layouts/Banner.svelte +0 -26
- package/dist/components/layouts/Banner.svelte.d.ts +0 -8
- package/dist/components/layouts/FoldablePanel.svelte +0 -16
- package/dist/components/layouts/FoldablePanel.svelte.d.ts +0 -7
- package/dist/components/layouts/SimpleFooter.svelte +0 -23
- package/dist/components/layouts/SimpleFooter.svelte.d.ts +0 -8
- package/dist/components/layouts/Tabs.svelte +0 -362
- package/dist/components/layouts/Tabs.svelte.d.ts +0 -11
- package/dist/components/layouts/TwoColumnsLayout.svelte +0 -44
- package/dist/components/layouts/TwoColumnsLayout.svelte.d.ts +0 -13
- package/dist/components/layouts/menuLayout.d.ts +0 -12
- package/dist/components/layouts/menuLayout.js +0 -1
- package/dist/components/layouts/tabs.d.ts +0 -21
- package/dist/components/layouts/tabs.js +0 -13
- package/dist/components/menu/CollapsibleMenu.svelte +0 -66
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +0 -18
- package/dist/components/menu/DynamicMenu.svelte +0 -55
- package/dist/components/menu/DynamicMenu.svelte.d.ts +0 -13
- package/dist/components/menu/HamburgerMenu.svelte +0 -62
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +0 -14
- package/dist/components/menu/ListMenu.svelte +0 -61
- package/dist/components/menu/ListMenu.svelte.d.ts +0 -17
- package/dist/components/menu/NavigationDrawer.svelte +0 -53
- package/dist/components/menu/NavigationDrawer.svelte.d.ts +0 -18
- package/dist/components/menu/types.d.ts +0 -23
- package/dist/components/menu/types.js +0 -35
- package/dist/components/presentation/Accordion.svelte +0 -82
- package/dist/components/presentation/Accordion.svelte.d.ts +0 -11
- package/dist/components/presentation/Card.svelte +0 -147
- package/dist/components/presentation/Card.svelte.d.ts +0 -15
- package/dist/components/presentation/Carousel.d.ts +0 -5
- package/dist/components/presentation/Carousel.js +0 -1
- package/dist/components/presentation/Carousel.svelte +0 -119
- package/dist/components/presentation/Carousel.svelte.d.ts +0 -17
- package/dist/components/presentation/Dialog.svelte +0 -75
- package/dist/components/presentation/Dialog.svelte.d.ts +0 -22
- package/dist/components/presentation/Disclose.svelte +0 -116
- package/dist/components/presentation/Disclose.svelte.d.ts +0 -11
- package/dist/components/presentation/Drawer.svelte +0 -118
- package/dist/components/presentation/Drawer.svelte.d.ts +0 -13
- package/dist/components/presentation/EmptyState.svelte +0 -67
- package/dist/components/presentation/EmptyState.svelte.d.ts +0 -10
- package/dist/components/presentation/Gallery.svelte +0 -35
- package/dist/components/presentation/Gallery.svelte.d.ts +0 -14
- package/dist/components/presentation/Link.svelte +0 -362
- package/dist/components/presentation/Link.svelte.d.ts +0 -27
- package/dist/components/utils.d.ts +0 -3
- package/dist/components/utils.js +0 -1
- package/dist/index.server.d.ts +0 -11
- package/dist/index.server.js +0 -10
- package/dist/server-side/getRedirectPipeline.d.ts +0 -6
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -3
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.js';
|
|
3
|
-
import { NavigationDirection, TabSizes, type Tab } from './tabs.js';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
tabs: Array<Tab>; //` = [];
|
|
7
|
-
size?: TabSizes; //` = '';
|
|
8
|
-
isBorderless?: boolean; //` = false;
|
|
9
|
-
isVerticalOrientation?: boolean; //` = false;
|
|
10
|
-
isSkinned?: boolean; //` = true;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let {
|
|
14
|
-
tabs,
|
|
15
|
-
size = TabSizes.empty,
|
|
16
|
-
isBorderless,
|
|
17
|
-
isVerticalOrientation,
|
|
18
|
-
isSkinned,
|
|
19
|
-
}: Props = $props();
|
|
20
|
-
|
|
21
|
-
let dynamicComponentRefs = $state([]); //https://svelte.dev/tutorial/component-this
|
|
22
|
-
let tabButtonRefs: Array<HTMLButtonElement> = $state([]);
|
|
23
|
-
let activePanel = $state(null);
|
|
24
|
-
|
|
25
|
-
const baseStyles = () => `tabs ${isVerticalOrientation ? 'tabs-vertical' : ''}`;
|
|
26
|
-
|
|
27
|
-
const selectTab = (index: number) => {
|
|
28
|
-
tabs = tabs.map((tab, i) => {
|
|
29
|
-
tab.isActive = index === i ? true : false;
|
|
30
|
-
return tab;
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
let activeTabs = tabs.filter((tab) => tab.isActive);
|
|
34
|
-
if (activeTabs.length === 0) {
|
|
35
|
-
selectTab(0);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let tablistClasses = $derived(
|
|
39
|
-
cn(isSkinned ? 'tab-list' : 'tab-list-base', isBorderless ? `tab-borderless` : '')
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
let tabButtonClasses = $derived((tab: any) => {
|
|
43
|
-
const klasses = [
|
|
44
|
-
`tab-item`,
|
|
45
|
-
`tab-button`,
|
|
46
|
-
tab.isActive ? 'active' : '',
|
|
47
|
-
size === TabSizes.large ? 'tab-button-large' : '',
|
|
48
|
-
size === TabSizes.xlarge ? 'tab-button-xlarge' : ''
|
|
49
|
-
];
|
|
50
|
-
return klasses.filter((klass) => klass.length).join(' ');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const focusTab = (index: number, direction: NavigationDirection = NavigationDirection.asc) => {
|
|
54
|
-
// console.log("tabButtonRefs: ", tabButtonRefs);
|
|
55
|
-
// console.log("dynamicComponentRefs: ", dynamicComponentRefs);
|
|
56
|
-
/**
|
|
57
|
-
* direction is optional because we only need that when we're arrow navigating.
|
|
58
|
-
* If they've hit ENTER|SPACE we're focusing the current item. If HOME focus(0).
|
|
59
|
-
* If END focus(tabButtons.length - 1)...and so on.
|
|
60
|
-
*/
|
|
61
|
-
let i = index;
|
|
62
|
-
if (direction === NavigationDirection.asc) {
|
|
63
|
-
i += 1;
|
|
64
|
-
} else if (direction === NavigationDirection.desc) {
|
|
65
|
-
i -= 1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Circular navigation
|
|
69
|
-
//
|
|
70
|
-
// If we've went beyond "start" circle around to last
|
|
71
|
-
if (i < 0) {
|
|
72
|
-
i = tabs.length - 1;
|
|
73
|
-
} else if (i >= tabs.length) {
|
|
74
|
-
// We've went beyond "last" so circle around to first
|
|
75
|
-
i = 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Figure out at run-time whether this was build with dynamicComponentRefs (consumer
|
|
80
|
-
* used their own tabButtonComponent), or tabButtonRefs (we generated the buttons here)
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
let nextTab: any;
|
|
84
|
-
if (tabButtonRefs.length) {
|
|
85
|
-
nextTab = tabButtonRefs[i];
|
|
86
|
-
} else if (dynamicComponentRefs.length) {
|
|
87
|
-
// Same logic as above, but we're using the binding to component instance
|
|
88
|
-
nextTab = dynamicComponentRefs[i];
|
|
89
|
-
}
|
|
90
|
-
// Edge case: We hit a tab button that's been disabled. If so, we recurse, but
|
|
91
|
-
// only if we've been supplied a `direction`. Otherwise, nothing left to do.
|
|
92
|
-
if ((nextTab.isDisabled && nextTab.isDisabled()) || (nextTab.disabled && direction)) {
|
|
93
|
-
// Retry with new `i` index going in same direction
|
|
94
|
-
focusTab(i, direction);
|
|
95
|
-
} else {
|
|
96
|
-
// Nominal case is to just focs next tab :)
|
|
97
|
-
nextTab.focus();
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const handleKeyDown = (ev: any, index: number) => {
|
|
102
|
-
switch (ev.key) {
|
|
103
|
-
case 'Up': // These first cases are IEEdge :(
|
|
104
|
-
case 'ArrowUp':
|
|
105
|
-
if (isVerticalOrientation) {
|
|
106
|
-
focusTab(index, NavigationDirection.desc);
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
case 'Down':
|
|
110
|
-
case 'ArrowDown':
|
|
111
|
-
if (isVerticalOrientation) {
|
|
112
|
-
focusTab(index, NavigationDirection.asc);
|
|
113
|
-
}
|
|
114
|
-
break;
|
|
115
|
-
case 'Left':
|
|
116
|
-
case 'ArrowLeft':
|
|
117
|
-
if (!isVerticalOrientation) {
|
|
118
|
-
focusTab(index, NavigationDirection.desc);
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case 'Right':
|
|
122
|
-
case 'ArrowRight':
|
|
123
|
-
if (!isVerticalOrientation) {
|
|
124
|
-
focusTab(index, NavigationDirection.asc);
|
|
125
|
-
}
|
|
126
|
-
break;
|
|
127
|
-
case 'Home':
|
|
128
|
-
case 'ArrowHome':
|
|
129
|
-
focusTab(0);
|
|
130
|
-
break;
|
|
131
|
-
case 'End':
|
|
132
|
-
case 'ArrowEnd':
|
|
133
|
-
focusTab(tabs.length - 1);
|
|
134
|
-
break;
|
|
135
|
-
case 'Enter':
|
|
136
|
-
case 'Space':
|
|
137
|
-
focusTab(index);
|
|
138
|
-
selectTab(index);
|
|
139
|
-
break;
|
|
140
|
-
default:
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
ev.preventDefault();
|
|
144
|
-
};
|
|
145
|
-
</script>
|
|
146
|
-
|
|
147
|
-
<div class={baseStyles()}>
|
|
148
|
-
<div
|
|
149
|
-
class={tablistClasses}
|
|
150
|
-
role="tablist"
|
|
151
|
-
aria-orientation={isVerticalOrientation ? 'vertical' : 'horizontal'}
|
|
152
|
-
>
|
|
153
|
-
{#each tabs as tab, i}
|
|
154
|
-
<!-- {#if tab.tabButtonComponent}
|
|
155
|
-
<svelte:component
|
|
156
|
-
this={tab.tabButtonComponent}
|
|
157
|
-
bind:this={dynamicComponentRefs[i]}
|
|
158
|
-
on:click={() => selectTab(i)}
|
|
159
|
-
on:keydown={(e) => handleKeyDown(e, i)}
|
|
160
|
-
disabled={isDisabled || disabledOptions.includes(tab.title) || undefined}
|
|
161
|
-
classes={tabButtonClasses(tab)}
|
|
162
|
-
role="tab"
|
|
163
|
-
ariaControls={tab.ariaControls}
|
|
164
|
-
isActive={tab.isActive}
|
|
165
|
-
>
|
|
166
|
-
{tab.title}
|
|
167
|
-
</svelte:component>
|
|
168
|
-
{:else} -->
|
|
169
|
-
<button
|
|
170
|
-
bind:this={tabButtonRefs[i]}
|
|
171
|
-
on:click={() => selectTab(i)}
|
|
172
|
-
on:keydown={(e) => handleKeyDown(e, i)}
|
|
173
|
-
disabled={tab.isDisabled}
|
|
174
|
-
class={tabButtonClasses(tab)}
|
|
175
|
-
role="tab"
|
|
176
|
-
aria-controls={tab.ariaControls}
|
|
177
|
-
tabindex={tab.isActive ? 0 : -1}
|
|
178
|
-
aria-selected={tab.isActive}
|
|
179
|
-
>
|
|
180
|
-
{tab.title}
|
|
181
|
-
</button>
|
|
182
|
-
<!-- {/if} -->
|
|
183
|
-
{/each}
|
|
184
|
-
</div>
|
|
185
|
-
{#if activePanel}
|
|
186
|
-
{@render activePanel?.tabPanelComponent()}
|
|
187
|
-
{/if}
|
|
188
|
-
<!-- {#each tabs as panel}
|
|
189
|
-
{#if panel.isActive}
|
|
190
|
-
{@render panel?.tabPanelComponent()}
|
|
191
|
-
|
|
192
|
-
{/each} -->
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<style>
|
|
196
|
-
/* TODO -- should we use these for .nav? */
|
|
197
|
-
.tabs {
|
|
198
|
-
display: flex;
|
|
199
|
-
flex-direction: column;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.tabs-vertical {
|
|
203
|
-
flex-direction: row;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.tab-list,
|
|
207
|
-
.tab-list-base {
|
|
208
|
-
display: flex;
|
|
209
|
-
flex-flow: row wrap;
|
|
210
|
-
flex: 0 0 auto;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.tab-list,
|
|
214
|
-
.tab-skinned {
|
|
215
|
-
padding-inline-start: 0;
|
|
216
|
-
margin-block-end: 0;
|
|
217
|
-
border-bottom: var(--agnostic-tabs-border-size, 1px) solid
|
|
218
|
-
var(--agnostic-tabs-bgcolor, var(--agnostic-gray-light));
|
|
219
|
-
transition-property: all;
|
|
220
|
-
transition-duration: var(--agnostic-timing-medium);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/* In vertical orientation we want our tab buttons to stack */
|
|
224
|
-
.tabs-vertical .tab-list,
|
|
225
|
-
.tabs-vertical .tab-base {
|
|
226
|
-
flex-direction: column;
|
|
227
|
-
border: none;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/* We can ask for .tab-button which is base and skin combined, or, we can utilize .tab-button-base
|
|
231
|
-
if we'd like to only blank out buttons but otherwise skin ourselves. */
|
|
232
|
-
.tab-button,
|
|
233
|
-
.tab-button-base {
|
|
234
|
-
/* Blank out the button */
|
|
235
|
-
background-color: transparent;
|
|
236
|
-
border: 0;
|
|
237
|
-
border-radius: 0;
|
|
238
|
-
box-shadow: none;
|
|
239
|
-
|
|
240
|
-
/* This fixes issue where upon focus, the a11y focus ring's box shadow would get tucked beneat
|
|
241
|
-
adjacent tab buttons; relative creates new stacking context https://stackoverflow.com/a/31276836 */
|
|
242
|
-
position: relative;
|
|
243
|
-
|
|
244
|
-
/* Reset margins/padding; this will get added back if it's a "skinned" tab button. However, we have
|
|
245
|
-
a use case where a tab-button is wrapping a faux button. For that, we don't want margins/padding because
|
|
246
|
-
the faux button provides that. */
|
|
247
|
-
margin-inline-start: 0;
|
|
248
|
-
margin-inline-end: 0;
|
|
249
|
-
padding-block-start: 0;
|
|
250
|
-
padding-block-end: 0;
|
|
251
|
-
padding-inline-start: 0;
|
|
252
|
-
padding-inline-end: 0;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.tab-button,
|
|
256
|
-
.tab-button-skin {
|
|
257
|
-
display: block;
|
|
258
|
-
|
|
259
|
-
/* Since this is a "skinned tab button" we add our padding here to previously "reset" .tab-button-base */
|
|
260
|
-
padding-block-start: var(--agnostic-vertical-pad, 0.5rem);
|
|
261
|
-
padding-block-end: var(--agnostic-vertical-pad, 0.5rem);
|
|
262
|
-
padding-inline-start: var(--agnostic-side-padding, 0.75rem);
|
|
263
|
-
padding-inline-end: var(--agnostic-side-padding, 0.75rem);
|
|
264
|
-
font-family: var(--agnostic-btn-font-family, var(--agnostic-font-family-body));
|
|
265
|
-
font-weight: var(--agnostic-btn-font-weight, 400);
|
|
266
|
-
font-size: var(--agnostic-btn-font-size, 1rem);
|
|
267
|
-
|
|
268
|
-
/* this can be overriden, but it might mess with the balance of the button heights across variants */
|
|
269
|
-
line-height: var(--agnostic-line-height, var(--fluid-20, 1.25rem));
|
|
270
|
-
color: var(--agnostic-tabs-primary, var(--agnostic-primary));
|
|
271
|
-
text-decoration: none;
|
|
272
|
-
transition:
|
|
273
|
-
color var(--agnostic-timing-fast) ease-in-out,
|
|
274
|
-
background-color var(--agnostic-timing-fast) ease-in-out,
|
|
275
|
-
border-color var(--agnostic-timing-fast) ease-in-out;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/* We pull back the 2nd subsequent tabs to remove the double border */
|
|
279
|
-
.tab-button:not(:first-of-type),
|
|
280
|
-
.tab-button-base:not(:first-of-type) {
|
|
281
|
-
margin-inline-start: -1px;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.tab-borderless {
|
|
285
|
-
border: none !important;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.tab-button-large {
|
|
289
|
-
padding-block-start: calc(var(--agnostic-input-side-padding) * 1.25);
|
|
290
|
-
padding-block-end: calc(var(--agnostic-input-side-padding) * 1.25);
|
|
291
|
-
padding-inline-start: calc(var(--agnostic-input-side-padding) * 1.75);
|
|
292
|
-
padding-inline-end: calc(var(--agnostic-input-side-padding) * 1.75);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.tab-button-xlarge {
|
|
296
|
-
padding-block-start: calc(var(--agnostic-input-side-padding) * 2);
|
|
297
|
-
padding-block-end: calc(var(--agnostic-input-side-padding) * 2);
|
|
298
|
-
padding-inline-start: calc(var(--agnostic-input-side-padding) * 3);
|
|
299
|
-
padding-inline-end: calc(var(--agnostic-input-side-padding) * 3);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.tab-item.tab-button {
|
|
303
|
-
margin-block-end: -1px;
|
|
304
|
-
background: 0 0;
|
|
305
|
-
border: 1px solid transparent;
|
|
306
|
-
border-top-left-radius: var(--agnostic-tabs-radius, 0.25rem);
|
|
307
|
-
border-top-right-radius: var(--agnostic-tabs-radius, 0.25rem);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.tab-item.tab-button.active {
|
|
311
|
-
color: var(--agnostic-dark);
|
|
312
|
-
background-color: var(--agnostic-light);
|
|
313
|
-
border-color: var(--agnostic-gray-light) var(--agnostic-gray-light) var(--agnostic-light);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.tab-item:hover,
|
|
317
|
-
.tab-button:focus {
|
|
318
|
-
border-color: var(--agnostic-focus-ring-outline-width) var(--agnostic-focus-ring-outline-width)
|
|
319
|
-
var(--agnostic-gray-light);
|
|
320
|
-
isolation: isolate;
|
|
321
|
-
z-index: 1;
|
|
322
|
-
cursor: pointer;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.tabs-vertical .tab-button {
|
|
326
|
-
border: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.tab-button:disabled {
|
|
330
|
-
color: var(--agnostic-tabs-disabled-bg, var(--agnostic-gray-mid-dark));
|
|
331
|
-
background-color: transparent;
|
|
332
|
-
border-color: transparent;
|
|
333
|
-
opacity: 80%;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Elects to additively use the AgnosticUI custom focus ring alongside the border
|
|
338
|
-
* we already add above. It just makes things look more consistent across components.
|
|
339
|
-
* For example, when we tab into the panels and links within.
|
|
340
|
-
*/
|
|
341
|
-
.tab-button-base:focus,
|
|
342
|
-
.tab-panel:focus,
|
|
343
|
-
.tab-button:focus {
|
|
344
|
-
box-shadow: 0 0 0 var(--agnostic-focus-ring-outline-width) var(--agnostic-focus-ring-color);
|
|
345
|
-
|
|
346
|
-
/* Needed for High Contrast mode */
|
|
347
|
-
outline: var(--agnostic-focus-ring-outline-width) var(--agnostic-focus-ring-outline-style)
|
|
348
|
-
var(--agnostic-focus-ring-outline-color);
|
|
349
|
-
transition: box-shadow var(--agnostic-timing-fast) ease-out;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
@media (prefers-reduced-motion), (update: slow) {
|
|
353
|
-
.tab-button,
|
|
354
|
-
.tab-button-base:focus,
|
|
355
|
-
.tab-button:focus,
|
|
356
|
-
.tab-panel:focus,
|
|
357
|
-
.tab-list,
|
|
358
|
-
.tab-skinned {
|
|
359
|
-
transition-duration: 0.001ms !important;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
</style>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TabSizes, type Tab } from './tabs.js';
|
|
2
|
-
interface Props {
|
|
3
|
-
tabs: Array<Tab>;
|
|
4
|
-
size?: TabSizes;
|
|
5
|
-
isBorderless?: boolean;
|
|
6
|
-
isVerticalOrientation?: boolean;
|
|
7
|
-
isSkinned?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const Tabs: import("svelte").Component<Props, {}, "">;
|
|
10
|
-
type Tabs = ReturnType<typeof Tabs>;
|
|
11
|
-
export default Tabs;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Css {}
|
|
6
|
-
|
|
7
|
-
interface TwoColumnLayoutProps {
|
|
8
|
-
leftRender: Snippet;
|
|
9
|
-
rightRender: Snippet;
|
|
10
|
-
containerCss: string;
|
|
11
|
-
leftCss: string;
|
|
12
|
-
rightCss: string;
|
|
13
|
-
isFullWidth: boolean;
|
|
14
|
-
isFullHeight: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let {
|
|
18
|
-
leftRender,
|
|
19
|
-
rightRender,
|
|
20
|
-
isFullWidth = true,
|
|
21
|
-
isFullHeight = true,
|
|
22
|
-
containerCss = '',
|
|
23
|
-
leftCss = 'w50p',
|
|
24
|
-
rightCss = 'w50p'
|
|
25
|
-
}: TwoColumnLayoutProps = $props();
|
|
26
|
-
|
|
27
|
-
let containerCssEx = cn(
|
|
28
|
-
'flex flex-row-dynamic',
|
|
29
|
-
isFullWidth ? 'fw' : '',
|
|
30
|
-
isFullHeight ? 'fh' : '',
|
|
31
|
-
containerCss,
|
|
32
|
-
);
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<section class={containerCssEx}>
|
|
36
|
-
<div class="left {leftCss}">
|
|
37
|
-
{@render leftRender()}
|
|
38
|
-
</div>
|
|
39
|
-
<div class="right {rightCss}">
|
|
40
|
-
{@render rightRender()}
|
|
41
|
-
</div>
|
|
42
|
-
</section>
|
|
43
|
-
|
|
44
|
-
<style></style>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
interface TwoColumnLayoutProps {
|
|
3
|
-
leftRender: Snippet;
|
|
4
|
-
rightRender: Snippet;
|
|
5
|
-
containerCss: string;
|
|
6
|
-
leftCss: string;
|
|
7
|
-
rightCss: string;
|
|
8
|
-
isFullWidth: boolean;
|
|
9
|
-
isFullHeight: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const TwoColumnsLayout: import("svelte").Component<TwoColumnLayoutProps, {}, "">;
|
|
12
|
-
type TwoColumnsLayout = ReturnType<typeof TwoColumnsLayout>;
|
|
13
|
-
export default TwoColumnsLayout;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
export interface Tab {
|
|
3
|
-
title: string;
|
|
4
|
-
tabId?: string;
|
|
5
|
-
tabHref?: string;
|
|
6
|
-
tabPanelComponent?: Snippet;
|
|
7
|
-
tabButtonComponent?: Snippet;
|
|
8
|
-
isActive?: boolean;
|
|
9
|
-
ariaControls?: string;
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare enum TabSizes {
|
|
13
|
-
'small' = 0,
|
|
14
|
-
'large' = 1,
|
|
15
|
-
'xlarge' = 2,
|
|
16
|
-
empty = ""
|
|
17
|
-
}
|
|
18
|
-
export declare enum NavigationDirection {
|
|
19
|
-
'asc' = 0,
|
|
20
|
-
'desc' = 1
|
|
21
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
export var TabSizes;
|
|
3
|
-
(function (TabSizes) {
|
|
4
|
-
TabSizes[TabSizes["small"] = 0] = "small";
|
|
5
|
-
TabSizes[TabSizes["large"] = 1] = "large";
|
|
6
|
-
TabSizes[TabSizes["xlarge"] = 2] = "xlarge";
|
|
7
|
-
TabSizes["empty"] = "";
|
|
8
|
-
})(TabSizes || (TabSizes = {}));
|
|
9
|
-
export var NavigationDirection;
|
|
10
|
-
(function (NavigationDirection) {
|
|
11
|
-
NavigationDirection[NavigationDirection["asc"] = 0] = "asc";
|
|
12
|
-
NavigationDirection[NavigationDirection["desc"] = 1] = "desc";
|
|
13
|
-
})(NavigationDirection || (NavigationDirection = {}));
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { HeaderNavigationItem, defaultCss } from './types.js';
|
|
3
|
-
import { afterNavigate } from '$app/navigation';
|
|
4
|
-
import { cn } from '../../utils.js';
|
|
5
|
-
import { Placement } from '../Styling.js';
|
|
6
|
-
import Button from '../form/Button.svelte';
|
|
7
|
-
import Drawer from '../presentation/Drawer.svelte';
|
|
8
|
-
import ListMenu from './ListMenu.svelte';
|
|
9
|
-
import type { Snippet } from 'svelte';
|
|
10
|
-
|
|
11
|
-
interface Css {
|
|
12
|
-
buttonCss: string;
|
|
13
|
-
container: string;
|
|
14
|
-
link: string;
|
|
15
|
-
}
|
|
16
|
-
interface Props {
|
|
17
|
-
itemsDrawer: Snippet<[Array<HeaderNavigationItem>]>;
|
|
18
|
-
buttonText: Snippet;
|
|
19
|
-
isOpen: boolean;
|
|
20
|
-
css: Partial<Css>;
|
|
21
|
-
noBorder: boolean;
|
|
22
|
-
placement: Placement;
|
|
23
|
-
localPages: Array<HeaderNavigationItem>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let {
|
|
27
|
-
itemsDrawer,
|
|
28
|
-
buttonText,
|
|
29
|
-
isOpen = false,
|
|
30
|
-
localPages = [],
|
|
31
|
-
css = { buttonCss: '', container: '' }
|
|
32
|
-
}: Partial<Props> = $props();
|
|
33
|
-
|
|
34
|
-
let buttonCss = $derived(cn('hamburger-handle', css.buttonCss ?? ''));
|
|
35
|
-
|
|
36
|
-
function toggleDrawer() {
|
|
37
|
-
isOpen = !isOpen;
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<div class={css?.container}>
|
|
42
|
-
<Button type="button" isPrimary css={buttonCss} click={(event:any) => toggleDrawer()}>
|
|
43
|
-
{@render buttonText?.()}
|
|
44
|
-
</Button>
|
|
45
|
-
|
|
46
|
-
{#if isOpen && itemsDrawer}
|
|
47
|
-
{@render itemsDrawer(localPages)}
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<style>
|
|
52
|
-
:global(#hamburger-menu) {
|
|
53
|
-
z-index: 10001;
|
|
54
|
-
}
|
|
55
|
-
:global(.hamburger-handle) {
|
|
56
|
-
background: none !important;
|
|
57
|
-
border: none !important;
|
|
58
|
-
}
|
|
59
|
-
:global(.btn.close) {
|
|
60
|
-
position: fixed;
|
|
61
|
-
top: var(--hamburger-menu-margin, 25px);
|
|
62
|
-
right: var(--hamburger-menu-margin, 25px);
|
|
63
|
-
background: none !important;
|
|
64
|
-
border: none !important;
|
|
65
|
-
}
|
|
66
|
-
</style>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HeaderNavigationItem } from './types.js';
|
|
2
|
-
import { Placement } from '../Styling.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
declare const CollapsibleMenu: import("svelte").Component<Partial<{
|
|
5
|
-
itemsDrawer: Snippet<[Array<HeaderNavigationItem>]>;
|
|
6
|
-
buttonText: Snippet;
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
css: Partial<{
|
|
9
|
-
buttonCss: string;
|
|
10
|
-
container: string;
|
|
11
|
-
link: string;
|
|
12
|
-
}>;
|
|
13
|
-
noBorder: boolean;
|
|
14
|
-
placement: Placement;
|
|
15
|
-
localPages: Array<HeaderNavigationItem>;
|
|
16
|
-
}>, {}, "">;
|
|
17
|
-
type CollapsibleMenu = ReturnType<typeof CollapsibleMenu>;
|
|
18
|
-
export default CollapsibleMenu;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
import { HeaderNavigationItem, isAuthenticated, selectVisible } from './types.js';
|
|
5
|
-
import { page } from '$app/state';
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
mobile: Snippet<[Array<HeaderNavigationItem>]>;
|
|
9
|
-
desktop: Snippet<[Array<HeaderNavigationItem>]>;
|
|
10
|
-
localPages: Array<HeaderNavigationItem>;
|
|
11
|
-
css?: { container: string };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let {
|
|
15
|
-
mobile: mobile,
|
|
16
|
-
desktop: desktop,
|
|
17
|
-
css = { container: "" },
|
|
18
|
-
localPages = []
|
|
19
|
-
}: Props = $props();
|
|
20
|
-
|
|
21
|
-
let pagesVisiblity = $derived(isAuthenticated(page));
|
|
22
|
-
let visibleNavItems = $derived(selectVisible(localPages, pagesVisiblity));
|
|
23
|
-
|
|
24
|
-
let klasses = $derived(cn('flex', 'flex-dynamic-row', css.container));
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<nav class={klasses}>
|
|
28
|
-
<div class="mobile">
|
|
29
|
-
{#if mobile}
|
|
30
|
-
{@render mobile(visibleNavItems)}
|
|
31
|
-
{/if}
|
|
32
|
-
</div>
|
|
33
|
-
<div class="desktop">
|
|
34
|
-
{#if desktop}
|
|
35
|
-
{@render desktop(visibleNavItems)}
|
|
36
|
-
{/if}
|
|
37
|
-
</div>
|
|
38
|
-
</nav>
|
|
39
|
-
|
|
40
|
-
<style>.desktop {
|
|
41
|
-
display: none !important;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.mobile {
|
|
45
|
-
display: block !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@media (min-width: 960px) {
|
|
49
|
-
.desktop {
|
|
50
|
-
display: block !important;
|
|
51
|
-
}
|
|
52
|
-
.mobile {
|
|
53
|
-
display: none !important;
|
|
54
|
-
}
|
|
55
|
-
}</style>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import { HeaderNavigationItem } from './types.js';
|
|
3
|
-
interface Props {
|
|
4
|
-
mobile: Snippet<[Array<HeaderNavigationItem>]>;
|
|
5
|
-
desktop: Snippet<[Array<HeaderNavigationItem>]>;
|
|
6
|
-
localPages: Array<HeaderNavigationItem>;
|
|
7
|
-
css?: {
|
|
8
|
-
container: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
declare const DynamicMenu: import("svelte").Component<Props, {}, "">;
|
|
12
|
-
type DynamicMenu = ReturnType<typeof DynamicMenu>;
|
|
13
|
-
export default DynamicMenu;
|