@functionalcms/svelte-components 2.33.2 → 2.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Link.svelte +290 -290
- package/dist/components/agnostic/Alert/Alert.svelte +310 -0
- package/dist/components/agnostic/Alert/Alert.svelte.d.ts +31 -0
- package/dist/components/agnostic/Avatar/Avatar.svelte +123 -0
- package/dist/components/agnostic/Avatar/Avatar.svelte.d.ts +26 -0
- package/dist/components/agnostic/Avatar/AvatarGroup.svelte +106 -0
- package/dist/components/agnostic/Avatar/AvatarGroup.svelte.d.ts +29 -0
- package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte +56 -0
- package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte.d.ts +20 -0
- package/dist/components/agnostic/Breadcrumb/api.d.ts +4 -0
- package/dist/components/agnostic/Breadcrumb/api.js +1 -0
- package/dist/components/agnostic/Button/Button.svelte +345 -0
- package/dist/components/agnostic/Button/Button.svelte.d.ts +43 -0
- package/dist/components/agnostic/Button/ButtonGroup.svelte +20 -0
- package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +23 -0
- package/dist/components/agnostic/Button/button-base.css +12 -0
- package/dist/components/agnostic/Button/button-core.css +237 -0
- package/dist/components/agnostic/Button/button-empty.css +31 -0
- package/dist/components/agnostic/Button/button-group.css +8 -0
- package/dist/components/agnostic/Card/Card.svelte +133 -0
- package/dist/components/agnostic/Card/Card.svelte.d.ts +31 -0
- package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte +337 -0
- package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte.d.ts +37 -0
- package/dist/components/agnostic/ChoiceInput/api.d.ts +7 -0
- package/dist/components/agnostic/ChoiceInput/api.js +1 -0
- package/dist/components/agnostic/Close/Close.svelte +120 -0
- package/dist/components/agnostic/Close/Close.svelte.d.ts +23 -0
- package/dist/components/agnostic/Close/api.d.ts +1 -0
- package/dist/components/agnostic/Close/api.js +1 -0
- package/dist/components/agnostic/Dialog/Dialog.svelte +265 -0
- package/dist/components/agnostic/Dialog/Dialog.svelte.d.ts +39 -0
- package/dist/components/agnostic/Disclose/Disclose.svelte +102 -0
- package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +23 -0
- package/dist/components/agnostic/Divider/Divider.svelte +139 -0
- package/dist/components/agnostic/Divider/Divider.svelte.d.ts +25 -0
- package/dist/components/agnostic/Divider/api.d.ts +3 -0
- package/dist/components/agnostic/Divider/api.js +1 -0
- package/dist/components/agnostic/Drawer/Drawer.svelte +30 -0
- package/dist/components/agnostic/Drawer/Drawer.svelte.d.ts +28 -0
- package/dist/components/agnostic/Drawer/api.d.ts +1 -0
- package/dist/components/agnostic/Drawer/api.js +1 -0
- package/dist/components/agnostic/EmptyState/EmptyState.svelte +46 -0
- package/dist/components/agnostic/EmptyState/EmptyState.svelte.d.ts +23 -0
- package/dist/components/agnostic/Header/Header.svelte +104 -0
- package/dist/components/agnostic/Header/Header.svelte.d.ts +26 -0
- package/dist/components/agnostic/Header/HeaderNav.svelte +28 -0
- package/dist/components/agnostic/Header/HeaderNav.svelte.d.ts +20 -0
- package/dist/components/agnostic/Header/HeaderNavItem.svelte +30 -0
- package/dist/components/agnostic/Header/HeaderNavItem.svelte.d.ts +20 -0
- package/dist/components/agnostic/Icon/Icon.svelte +180 -0
- package/dist/components/agnostic/Icon/Icon.svelte.d.ts +23 -0
- package/dist/components/agnostic/Icon/api.d.ts +2 -0
- package/dist/components/agnostic/Icon/api.js +1 -0
- package/dist/components/agnostic/Input/Input.svelte +415 -0
- package/dist/components/agnostic/Input/Input.svelte.d.ts +45 -0
- package/dist/components/agnostic/Input/InputAddonItem.svelte +42 -0
- package/dist/components/agnostic/Input/InputAddonItem.svelte.d.ts +33 -0
- package/dist/components/agnostic/Loader/Loader.svelte +113 -0
- package/dist/components/agnostic/Loader/Loader.svelte.d.ts +20 -0
- package/dist/components/agnostic/Menu/Menu.svelte +466 -0
- package/dist/components/agnostic/Menu/Menu.svelte.d.ts +31 -0
- package/dist/components/agnostic/Menu/MenuItem.svelte +117 -0
- package/dist/components/agnostic/Menu/MenuItem.svelte.d.ts +29 -0
- package/dist/components/agnostic/Progress/Progress.svelte +50 -0
- package/dist/components/agnostic/Progress/Progress.svelte.d.ts +20 -0
- package/dist/components/agnostic/Select/Select.svelte +141 -0
- package/dist/components/agnostic/Select/Select.svelte.d.ts +32 -0
- package/dist/components/agnostic/Spinner/Spinner.svelte +105 -0
- package/dist/components/agnostic/Spinner/Spinner.svelte.d.ts +19 -0
- package/dist/components/agnostic/Switch/Switch.svelte +275 -0
- package/dist/components/agnostic/Switch/Switch.svelte.d.ts +45 -0
- package/dist/components/agnostic/Table/Table.svelte +508 -0
- package/dist/components/agnostic/Table/Table.svelte.d.ts +36 -0
- package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte +13 -0
- package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte.d.ts +25 -0
- package/dist/components/agnostic/Tabs/TabButtonCustom.svelte +65 -0
- package/dist/components/agnostic/Tabs/TabButtonCustom.svelte.d.ts +35 -0
- package/dist/components/agnostic/Tabs/Tabs.svelte +330 -0
- package/dist/components/agnostic/Tabs/Tabs.svelte.d.ts +34 -0
- package/dist/components/agnostic/Tabs/api.d.ts +10 -0
- package/dist/components/agnostic/Tabs/api.js +1 -0
- package/dist/components/agnostic/Tag/Tag.svelte +74 -0
- package/dist/components/agnostic/Tag/Tag.svelte.d.ts +23 -0
- package/dist/components/agnostic/Tag/TagSlots.svelte +51 -0
- package/dist/components/agnostic/Tag/TagSlots.svelte.d.ts +16 -0
- package/dist/components/agnostic/Toasts/Toasts.svelte +46 -0
- package/dist/components/agnostic/Toasts/Toasts.svelte.d.ts +22 -0
- package/dist/components/agnostic/Tooltip/Tooltip.svelte +103 -0
- package/dist/components/agnostic/Tooltip/Tooltip.svelte.d.ts +23 -0
- package/dist/components/agnostic/Tooltip/TooltipSlots.svelte +81 -0
- package/dist/components/agnostic/Tooltip/TooltipSlots.svelte.d.ts +16 -0
- package/dist/components/agnostic/Tooltip/api.d.ts +1 -0
- package/dist/components/agnostic/Tooltip/api.js +1 -0
- package/dist/components/agnostic/animation.css +37 -0
- package/dist/index.d.ts +30 -1
- package/dist/index.js +30 -1
- package/package.json +1 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
|
|
3
|
+
/* ---------- GLOBAL STYLES ---------- */
|
|
4
|
+
/* Note this component requires global styles and doesn't get copied over from copystyles.js
|
|
5
|
+
and is "locked down". Svelte no longer appears to support <style global> and CSS Modules support
|
|
6
|
+
isn't built in. So, not ideal, but this is what we'll have to do for this component. */
|
|
7
|
+
|
|
8
|
+
/* These are styles for the case where classNames.closeButton property was NOT
|
|
9
|
+
passed in and so we're generating the default close 'X' button on the upper right. */
|
|
10
|
+
:global(.dialog-close-button) {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
border: 0;
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
box-shadow: none;
|
|
18
|
+
width: var(--fluid-32);
|
|
19
|
+
height: var(--fluid-32);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:global(.dialog-close-button:hover,
|
|
23
|
+
.dialog-close-button:active,
|
|
24
|
+
.dialog-close-button:focus) {
|
|
25
|
+
background: none;
|
|
26
|
+
|
|
27
|
+
/* Needed for High Contrast mode */
|
|
28
|
+
outline: var(--functional-focus-ring-outline-width)
|
|
29
|
+
var(--functional-focus-ring-outline-style)
|
|
30
|
+
var(--functional-focus-ring-outline-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:global(.dialog-close-button:focus) {
|
|
34
|
+
box-shadow: 0 0 0 3px var(--functional-focus-ring-color);
|
|
35
|
+
transition: box-shadow var(--functional-timing-fast) ease-out;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-reduced-motion), (update: slow) {
|
|
39
|
+
:global(.dialog-close-button:focus) {
|
|
40
|
+
transition-duration: 0.001ms !important;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:global(.close-button-large > .close) {
|
|
45
|
+
width: var(--fluid-16);
|
|
46
|
+
height: var(--fluid-16);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:global(.dialog-close-button:hover .close) {
|
|
50
|
+
opacity: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
:global(.dialog),
|
|
55
|
+
:global(.dialog-overlay) {
|
|
56
|
+
position: fixed;
|
|
57
|
+
top: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:global(.dialog) {
|
|
64
|
+
z-index: 1001;
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:global(.dialog[aria-hidden="true"]) {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:global(.dialog-overlay) {
|
|
73
|
+
background-color: rgb(50 50 50 / 60%);
|
|
74
|
+
animation: fade-in var(--functional-timing-fast) both;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:global(.dialog-content) {
|
|
78
|
+
background-color: var(--functional-light);
|
|
79
|
+
margin: auto;
|
|
80
|
+
z-index: 1001;
|
|
81
|
+
position: relative;
|
|
82
|
+
padding: var(--fluid-16);
|
|
83
|
+
max-width: 90%;
|
|
84
|
+
width: 600px;
|
|
85
|
+
border-radius: var(--functional-radius);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:global(.dialog-fade-in) {
|
|
89
|
+
animation: fade-in var(--functional-timing-fast) both;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:global(.dialog-slide-up) {
|
|
93
|
+
animation: slide-up var(--functional-timing-slow) var(--functional-timing-fast) both;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Cannot use two separate CSS classes with animation: foo, bar
|
|
98
|
+
* as the later class will overwrite the first (so this combines)
|
|
99
|
+
*/
|
|
100
|
+
:global(.dialog-slide-up-fade-in) {
|
|
101
|
+
animation:
|
|
102
|
+
fade-in var(--functional-timing-fast) both,
|
|
103
|
+
slide-up var(--functional-timing-slow) var(--functional-timing-fast) both;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media screen and (min-width: 700px) {
|
|
107
|
+
:global(.dialog-content) {
|
|
108
|
+
padding: var(--fluid-32);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@keyframes -global-fade-in {
|
|
113
|
+
from {
|
|
114
|
+
opacity: 0%;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@keyframes -global-slide-up {
|
|
119
|
+
from {
|
|
120
|
+
transform: translateY(10%);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Shared with AgnosticUI close buton so only need positioning and transition */
|
|
125
|
+
:global(.dialog-close) {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: var(--fluid-8);
|
|
128
|
+
right: var(--fluid-8);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (prefers-reduced-motion), (update: slow) {
|
|
132
|
+
:global(.dialog-slide-up-fade-in, .dialog-fade-in, .dialog-slide-up, .dialog-content) {
|
|
133
|
+
transition-duration: 0.001ms !important;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media only screen and (min-width: 576px) {
|
|
138
|
+
:global(.dialog-close) {
|
|
139
|
+
top: var(--fluid-12);
|
|
140
|
+
right: var(--fluid-12);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media screen and (min-width: 768px) {
|
|
145
|
+
:global(.dialog-close) {
|
|
146
|
+
top: var(--fluid-16);
|
|
147
|
+
right: var(--fluid-16);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* We use div.drawer-* for specificity battle :( */
|
|
152
|
+
:global(div.drawer-start) {
|
|
153
|
+
right: initial;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:global(div.drawer-start[aria-hidden]) {
|
|
157
|
+
transform: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:global(div.drawer-end) {
|
|
161
|
+
left: initial;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:global(div.drawer-end[aria-hidden]) {
|
|
165
|
+
transform: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(div.drawer-top) {
|
|
169
|
+
bottom: initial;
|
|
170
|
+
transform: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:global(div.drawer-top[aria-hidden]) {
|
|
174
|
+
transform: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:global(div.drawer-bottom) {
|
|
178
|
+
top: initial;
|
|
179
|
+
transform: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:global(div.drawer-bottom[aria-hidden]) {
|
|
183
|
+
transform: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:global(div.drawer-content) {
|
|
187
|
+
margin: initial;
|
|
188
|
+
max-width: initial;
|
|
189
|
+
border-radius: initial;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:global(div.drawer-start div.drawer-content, div.drawer-end div.drawer-content) {
|
|
193
|
+
width: 25rem;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:global(div.drawer-top div.drawer-content, div.drawer-bottom div.drawer-content) {
|
|
197
|
+
height: 25vh;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
200
|
+
</style>
|
|
201
|
+
|
|
202
|
+
<script>import Close from "../Close/Close.svelte";
|
|
203
|
+
import SvelteA11yDialog from "svelte-a11y-dialog/SvelteA11yDialog.svelte";
|
|
204
|
+
import { createEventDispatcher } from "svelte";
|
|
205
|
+
const dispatch = createEventDispatcher();
|
|
206
|
+
export let id;
|
|
207
|
+
export let title;
|
|
208
|
+
export let dialogRoot;
|
|
209
|
+
export let role = "dialog";
|
|
210
|
+
export let titleId = "";
|
|
211
|
+
export let closeButtonLabel = "Close button";
|
|
212
|
+
export let closeButtonPosition = "first";
|
|
213
|
+
export let drawerPlacement = "";
|
|
214
|
+
export let isAnimationFadeIn = false;
|
|
215
|
+
export let isAnimationSlideUp = false;
|
|
216
|
+
let dialogInstance;
|
|
217
|
+
const assignDialogInstance = (ev) => {
|
|
218
|
+
dialogInstance = ev.detail.instance;
|
|
219
|
+
dispatch("instance", {
|
|
220
|
+
instance: dialogInstance
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
export let classNames = {};
|
|
224
|
+
const documentClasses = [
|
|
225
|
+
"dialog-content",
|
|
226
|
+
isAnimationFadeIn && isAnimationSlideUp ? "dialog-slide-up-fade-in" : "",
|
|
227
|
+
!isAnimationFadeIn && isAnimationSlideUp ? "dialog-slide-up" : "",
|
|
228
|
+
isAnimationFadeIn && !isAnimationSlideUp ? "dialog-fade-in" : "",
|
|
229
|
+
drawerPlacement.length ? "drawer-content" : ""
|
|
230
|
+
].filter((c) => c).join(" ");
|
|
231
|
+
const containerClasses = [
|
|
232
|
+
"dialog",
|
|
233
|
+
drawerPlacement ? `drawer-${drawerPlacement}` : ""
|
|
234
|
+
].filter((c) => c).join(" ");
|
|
235
|
+
const defaultClassNames = {
|
|
236
|
+
container: containerClasses,
|
|
237
|
+
document: documentClasses,
|
|
238
|
+
overlay: "dialog-overlay",
|
|
239
|
+
title: "h4 mbe16",
|
|
240
|
+
// Borrows .close-button (from close.css) as it gives us the transparent
|
|
241
|
+
// style plus the a11y focus ring we want applied to dialog's close button
|
|
242
|
+
closeButton: "dialog-close dialog-close-button"
|
|
243
|
+
};
|
|
244
|
+
$: getClassNames = () => {
|
|
245
|
+
return { ...defaultClassNames, ...classNames };
|
|
246
|
+
};
|
|
247
|
+
</script>
|
|
248
|
+
|
|
249
|
+
<SvelteA11yDialog
|
|
250
|
+
id={id}
|
|
251
|
+
dialogRoot={dialogRoot}
|
|
252
|
+
closeButtonLabel={closeButtonLabel}
|
|
253
|
+
closeButtonPosition={closeButtonPosition}
|
|
254
|
+
title={title}
|
|
255
|
+
titleId={titleId}
|
|
256
|
+
role={role}
|
|
257
|
+
classNames={getClassNames()}
|
|
258
|
+
on:instance={assignDialogInstance}
|
|
259
|
+
>
|
|
260
|
+
<slot name="closeButtonContent" slot="closeButtonContent">
|
|
261
|
+
<Close isFaux size="large" />
|
|
262
|
+
</slot>
|
|
263
|
+
<slot />
|
|
264
|
+
</SvelteA11yDialog>
|
|
265
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: any;
|
|
5
|
+
title: any;
|
|
6
|
+
dialogRoot: any;
|
|
7
|
+
role?: "dialog" | "alertdialog";
|
|
8
|
+
titleId?: string;
|
|
9
|
+
closeButtonLabel?: string;
|
|
10
|
+
closeButtonPosition?: "first" | "last" | "none";
|
|
11
|
+
drawerPlacement?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Animates the dialog content by fading in. Set to false to disable.
|
|
14
|
+
*/ isAnimationFadeIn?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Animates the dialog content by sliding up. Set to false to disable.
|
|
17
|
+
*/ isAnimationSlideUp?: boolean;
|
|
18
|
+
classNames?: {};
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
instance: CustomEvent<any>;
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {
|
|
26
|
+
closeButtonContent: {
|
|
27
|
+
slot: string;
|
|
28
|
+
};
|
|
29
|
+
default: {};
|
|
30
|
+
};
|
|
31
|
+
exports?: {} | undefined;
|
|
32
|
+
bindings?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
export type DialogProps = typeof __propDef.props;
|
|
35
|
+
export type DialogEvents = typeof __propDef.events;
|
|
36
|
+
export type DialogSlots = typeof __propDef.slots;
|
|
37
|
+
export default class Dialog extends SvelteComponent<DialogProps, DialogEvents, DialogSlots> {
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.disclose {
|
|
3
|
+
margin-block-end: var(--fluid-4);
|
|
4
|
+
|
|
5
|
+
/* When this element is a direct child of a flex container with
|
|
6
|
+
flex-direction: column it collapses similar to an inline element even though
|
|
7
|
+
it's block. This helps prevent that. */
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.disclose-title {
|
|
12
|
+
display: block;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
padding: var(--fluid-8) var(--fluid-12);
|
|
16
|
+
|
|
17
|
+
/* Required to position the icon absolutely */
|
|
18
|
+
position: relative;
|
|
19
|
+
color: inherit;
|
|
20
|
+
transition: color var(--functional-timing-slow);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.disclose-panel {
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
padding: var(--fluid-16);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.disclose-title,
|
|
29
|
+
.disclose-panel {
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
|
|
34
|
+
.disclose-title::webkit-details-marker {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.disclose-bordered .disclose-title {
|
|
39
|
+
border: 1px solid var(--functional-gray-light);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.disclose-bg .disclose-title {
|
|
43
|
+
background-color: var(--functional-gray-light);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.disclose-title:focus {
|
|
47
|
+
box-shadow: 0 0 0 var(--functional-focus-ring-outline-width) var(--functional-focus-ring-color);
|
|
48
|
+
|
|
49
|
+
/* Needed for High Contrast mode */
|
|
50
|
+
outline:
|
|
51
|
+
var(--functional-focus-ring-outline-width) var(--functional-focus-ring-outline-style)
|
|
52
|
+
var(--functional-focus-ring-outline-color);
|
|
53
|
+
transition: box-shadow var(--functional-timing-fast) ease-out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.disclose-title::after {
|
|
57
|
+
color: var(--functional-gray-dark);
|
|
58
|
+
content: "\203A";
|
|
59
|
+
position: absolute;
|
|
60
|
+
right: var(--fluid-12);
|
|
61
|
+
top: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
|
|
64
|
+
/* Chevron thinning :) */
|
|
65
|
+
font-size: var(--fluid-32);
|
|
66
|
+
line-height: 1;
|
|
67
|
+
font-weight: 100;
|
|
68
|
+
transition: transform var(--functional-timing-slow);
|
|
69
|
+
transform: rotate(0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-reduced-motion), (update: slow) {
|
|
73
|
+
.disclose-title,
|
|
74
|
+
.disclose-title:focus,
|
|
75
|
+
.disclose-title::after {
|
|
76
|
+
transition: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.disclose[open] > .disclose-title::after {
|
|
81
|
+
transform: rotate(90deg);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
</style>
|
|
85
|
+
|
|
86
|
+
<script>export let title = "";
|
|
87
|
+
export let isOpen = false;
|
|
88
|
+
export let isBackground = false;
|
|
89
|
+
export let isBordered = false;
|
|
90
|
+
const discloseClasses = [
|
|
91
|
+
"disclose",
|
|
92
|
+
isBackground ? "disclose-bg" : "",
|
|
93
|
+
isBordered ? "disclose-bordered" : ""
|
|
94
|
+
].filter((c) => c).join(" ");
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<details class={discloseClasses} bind:open={isOpen}>
|
|
98
|
+
<summary class="disclose-title">{title}</summary>
|
|
99
|
+
<div class="disclose-panel">
|
|
100
|
+
<slot />
|
|
101
|
+
</div>
|
|
102
|
+
</details>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
title?: string;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
isBackground?: boolean;
|
|
7
|
+
isBordered?: boolean;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
exports?: {} | undefined;
|
|
16
|
+
bindings?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type DiscloseProps = typeof __propDef.props;
|
|
19
|
+
export type DiscloseEvents = typeof __propDef.events;
|
|
20
|
+
export type DiscloseSlots = typeof __propDef.slots;
|
|
21
|
+
export default class Disclose extends SvelteComponent<DiscloseProps, DiscloseEvents, DiscloseSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<script>export let isVertical = false;
|
|
2
|
+
export let justify = "";
|
|
3
|
+
export let type = "";
|
|
4
|
+
export let size = "";
|
|
5
|
+
let slots = $$props.$$slots;
|
|
6
|
+
const dividerClasses = [
|
|
7
|
+
"divider",
|
|
8
|
+
isVertical ? "divider-vertical" : "",
|
|
9
|
+
justify ? `divider-justify-${justify}` : "",
|
|
10
|
+
size ? `divider-${size}` : "",
|
|
11
|
+
type ? `divider-${type}` : ""
|
|
12
|
+
].filter((cl) => cl.length).join(" ");
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class={dividerClasses}>
|
|
16
|
+
{#if slots && slots.dividerContent}
|
|
17
|
+
<div class="divider-content">
|
|
18
|
+
<slot name="dividerContent" />
|
|
19
|
+
</div>
|
|
20
|
+
{/if}
|
|
21
|
+
</div>
|
|
22
|
+
<style>
|
|
23
|
+
.divider {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.divider::before,
|
|
32
|
+
.divider::after {
|
|
33
|
+
content: "";
|
|
34
|
+
background-color: var(--functional-gray-mid);
|
|
35
|
+
height: var(--fluid-2);
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.divider-small::before,
|
|
40
|
+
.divider-small::after {
|
|
41
|
+
height: 1px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.divider-large::before,
|
|
45
|
+
.divider-large::after {
|
|
46
|
+
height: var(--fluid-4);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.divider-xlarge::before,
|
|
50
|
+
.divider-xlarge::after {
|
|
51
|
+
height: var(--fluid-6);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.divider-justify-end::after,
|
|
55
|
+
.divider-justify-start::before {
|
|
56
|
+
flex-grow: 0;
|
|
57
|
+
flex-basis: 3%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.divider-content {
|
|
61
|
+
padding-inline-start: var(--fluid-16);
|
|
62
|
+
padding-inline-end: var(--fluid-16);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.divider-vertical {
|
|
66
|
+
height: auto;
|
|
67
|
+
margin: 0 var(--fluid-16);
|
|
68
|
+
width: var(--fluid-16);
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-self: stretch;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.divider-vertical::before,
|
|
74
|
+
.divider-vertical::after {
|
|
75
|
+
width: var(--fluid-2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.divider-vertical.divider-small::before,
|
|
79
|
+
.divider-vertical.divider-small::after {
|
|
80
|
+
width: 1px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.divider-vertical.divider-large::before,
|
|
84
|
+
.divider-vertical.divider-large::after {
|
|
85
|
+
width: var(--fluid-4);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.divider-vertical.divider-xlarge::before,
|
|
89
|
+
.divider-vertical.divider-xlarge::after {
|
|
90
|
+
width: var(--fluid-6);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.divider-vertical .divider-content {
|
|
94
|
+
padding-inline-start: var(--fluid-24);
|
|
95
|
+
padding-inline-end: var(--fluid-24);
|
|
96
|
+
|
|
97
|
+
/* Since we're vertical we need space from line above/below */
|
|
98
|
+
padding-block-start: var(--fluid-6);
|
|
99
|
+
padding-block-end: var(--fluid-6);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.divider-warning::before,
|
|
103
|
+
.divider-warning::after {
|
|
104
|
+
background-color: var(--functional-warning-border);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.divider-warning .divider-content {
|
|
108
|
+
color: var(--functional-warning-border);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.divider-error::before,
|
|
112
|
+
.divider-error::after {
|
|
113
|
+
background-color: var(--functional-error);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.divider-error .divider-content {
|
|
117
|
+
color: var(--functional-error);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.divider-success::before,
|
|
121
|
+
.divider-success::after {
|
|
122
|
+
background-color: var(--functional-action);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.divider-success .divider-content {
|
|
126
|
+
color: var(--functional-action);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.divider-info::before,
|
|
130
|
+
.divider-info::after {
|
|
131
|
+
background-color: var(--functional-primary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.divider-info .divider-content {
|
|
135
|
+
color: var(--functional-primary);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
</style>
|
|
139
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { DividerJustify, DividerTypes, DividerSizes } from './api';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
isVertical?: boolean | undefined;
|
|
7
|
+
justify?: DividerJustify | undefined;
|
|
8
|
+
type?: DividerTypes | undefined;
|
|
9
|
+
size?: DividerSizes | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
dividerContent: {};
|
|
16
|
+
};
|
|
17
|
+
exports?: undefined;
|
|
18
|
+
bindings?: undefined;
|
|
19
|
+
};
|
|
20
|
+
export type DividerProps = typeof __propDef.props;
|
|
21
|
+
export type DividerEvents = typeof __propDef.events;
|
|
22
|
+
export type DividerSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Divider extends SvelteComponent<DividerProps, DividerEvents, DividerSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script>import Dialog from "../Dialog/Dialog.svelte";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
let drawerInstance;
|
|
5
|
+
const assignDrawerRef = (ev) => {
|
|
6
|
+
drawerInstance = ev.detail.instance;
|
|
7
|
+
dispatch("instance", {
|
|
8
|
+
instance: drawerInstance
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export let id;
|
|
12
|
+
export let drawerRoot;
|
|
13
|
+
export let placement;
|
|
14
|
+
export let title;
|
|
15
|
+
export let role = "dialog";
|
|
16
|
+
export let isAnimationFadeIn = true;
|
|
17
|
+
</script>
|
|
18
|
+
<Dialog
|
|
19
|
+
id={id}
|
|
20
|
+
dialogRoot={drawerRoot}
|
|
21
|
+
drawerPlacement={placement}
|
|
22
|
+
titleId="{`${title.replaceAll(' ', '-').toLowerCase()}-id`}"
|
|
23
|
+
role={role}
|
|
24
|
+
title={title}
|
|
25
|
+
on:instance={assignDrawerRef}
|
|
26
|
+
isAnimationFadeIn={isAnimationFadeIn}
|
|
27
|
+
closeButtonLabel="Close drawer"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</Dialog>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { DrawerRoles } from './api';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: any;
|
|
6
|
+
drawerRoot: any;
|
|
7
|
+
placement: any;
|
|
8
|
+
title: any;
|
|
9
|
+
role?: DrawerRoles;
|
|
10
|
+
isAnimationFadeIn?: boolean;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
instance: CustomEvent<any>;
|
|
14
|
+
} & {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
exports?: {} | undefined;
|
|
21
|
+
bindings?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type DrawerProps = typeof __propDef.props;
|
|
24
|
+
export type DrawerEvents = typeof __propDef.events;
|
|
25
|
+
export type DrawerSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Drawer extends SvelteComponent<DrawerProps, DrawerEvents, DrawerSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DrawerRoles = 'alertdialog' | 'dialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|