@turnipxenon/pineapple 2.4.12 → 2.4.14
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/.idea/discord.xml +1 -1
- package/.idea/workspace.xml +139 -121
- package/.svelte-kit/__package__/app.postcss +28 -2
- package/.svelte-kit/__package__/assets/icons/close.svg +1 -0
- package/.svelte-kit/__package__/components/Card.svelte +28 -28
- package/.svelte-kit/__package__/components/CarouselElement.svelte +16 -16
- package/.svelte-kit/__package__/components/Chip.svelte +13 -12
- package/.svelte-kit/__package__/components/ElementVisbilityDetector.svelte +5 -5
- package/.svelte-kit/__package__/components/SocialSection.svelte +162 -159
- package/.svelte-kit/__package__/components/StickyElement.svelte +20 -20
- package/.svelte-kit/__package__/components/ToggleableContent.svelte +8 -8
- package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte +1 -8
- package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
- package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte +65 -20
- package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
- package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.js +1 -0
- package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
- package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.js +1 -0
- package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte +48 -0
- package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
- package/.svelte-kit/__package__/components/pineapple/toast/Toast.d.ts +27 -0
- package/.svelte-kit/__package__/components/pineapple/toast/Toast.js +37 -0
- package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte +89 -0
- package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte.d.ts +14 -0
- package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
- package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
- package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
- package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
- package/.svelte-kit/__package__/index.d.ts +1 -1
- package/.svelte-kit/__package__/index.js +1 -1
- package/.svelte-kit/__package__/postcss.d.ts +3 -3
- package/.svelte-kit/__package__/styles/global.css +1 -1
- package/.svelte-kit/__package__/theme.postcss +2 -1
- package/.svelte-kit/ambient.d.ts +4 -0
- package/.svelte-kit/generated/client/app.js +6 -5
- package/.svelte-kit/generated/client/nodes/2.js +1 -1
- package/.svelte-kit/generated/client/nodes/3.js +1 -1
- package/.svelte-kit/generated/client/nodes/4.js +1 -1
- package/.svelte-kit/generated/client/nodes/5.js +1 -1
- package/.svelte-kit/generated/client/nodes/6.js +1 -1
- package/.svelte-kit/generated/client/nodes/7.js +1 -0
- package/.svelte-kit/generated/server/internal.js +1 -1
- package/.svelte-kit/types/route_meta_data.json +6 -4
- package/.svelte-kit/types/src/routes/$types.d.ts +1 -4
- package/.svelte-kit/types/src/routes/{personal → (pineapple)}/$types.d.ts +2 -2
- package/.svelte-kit/types/src/routes/{portfolio/actual → (pineapple)/pineapple}/$types.d.ts +2 -2
- package/.svelte-kit/types/src/routes/(seaweed)/$types.d.ts +19 -0
- package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/$types.d.ts +3 -3
- package/.svelte-kit/types/src/routes/(seaweed)/portfolio/actual/$types.d.ts +17 -0
- package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/proxy+page.server.ts +1 -1
- package/README.md +8 -18
- package/dist/app.postcss +28 -2
- package/dist/assets/icons/close.svg +1 -0
- package/dist/components/Card.svelte +28 -28
- package/dist/components/CarouselElement.svelte +16 -16
- package/dist/components/Chip.svelte +13 -12
- package/dist/components/ElementVisbilityDetector.svelte +5 -5
- package/dist/components/SocialSection.svelte +162 -159
- package/dist/components/StickyElement.svelte +20 -20
- package/dist/components/ToggleableContent.svelte +8 -8
- package/dist/components/layouts/SeaweedBaseLayout.svelte +1 -8
- package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
- package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte +65 -20
- package/dist/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
- package/dist/components/pineapple/overlay_manager/OverlayManager.js +1 -0
- package/dist/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
- package/dist/components/pineapple/toast/DefaultToastBody.js +1 -0
- package/dist/components/pineapple/toast/DefaultToastBody.svelte +48 -0
- package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
- package/dist/components/pineapple/toast/Toast.d.ts +27 -0
- package/dist/components/pineapple/toast/Toast.js +37 -0
- package/dist/components/pineapple/toast/Toast.svelte +89 -0
- package/dist/components/pineapple/toast/Toast.svelte.d.ts +14 -0
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/postcss.d.ts +3 -3
- package/dist/styles/global.css +1 -1
- package/dist/theme.postcss +2 -1
- package/docs/OverlaySpec.md +23 -0
- package/docs/pull_request_template.md +34 -0
- package/package.json +1 -1
- package/src/lib/app.postcss +28 -2
- package/src/lib/assets/icons/close.svg +1 -0
- package/src/lib/components/Card.svelte +32 -32
- package/src/lib/components/CarouselElement.svelte +22 -22
- package/src/lib/components/Chip.svelte +13 -12
- package/src/lib/components/ElementVisbilityDetector.svelte +22 -22
- package/src/lib/components/OnElementVisbilityChanged.ts +1 -1
- package/src/lib/components/SocialSection.svelte +95 -92
- package/src/lib/components/StickyElement.svelte +39 -39
- package/src/lib/components/ToggleableContent.svelte +85 -85
- package/src/lib/components/ToggleableContentType.ts +4 -4
- package/src/lib/components/layouts/LayoutConstants.ts +1 -1
- package/src/lib/components/layouts/SeaweedBaseLayout.svelte +1 -8
- package/src/lib/components/pineapple/PineappleBaseLayout.svelte +207 -0
- package/src/lib/components/pineapple/overlay_manager/OverlayManager.ts +0 -0
- package/src/lib/components/pineapple/toast/DefaultToastBody.svelte +43 -0
- package/src/lib/components/pineapple/toast/DefaultToastBody.ts +10 -0
- package/src/lib/components/pineapple/toast/Toast.svelte +113 -0
- package/src/lib/components/pineapple/toast/Toast.ts +57 -0
- package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
- package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.ts +6 -0
- package/src/lib/consts.ts +2 -2
- package/src/lib/index.ts +1 -1
- package/src/lib/postcss.d.ts +3 -3
- package/src/lib/styles/global.css +1 -1
- package/src/lib/theme.postcss +2 -1
- package/src/lib/util/create_go_to_function.ts +5 -5
- package/src/routes/{personal → (pineapple)}/+layout.svelte +1 -1
- package/src/routes/(pineapple)/+page.svelte +36 -0
- package/src/routes/(pineapple)/pineapple/+page.svelte +44 -0
- package/src/routes/(seaweed)/+layout.svelte +10 -0
- package/src/routes/{portfolio → (seaweed)/portfolio}/+page.server.ts +1 -1
- package/src/routes/{portfolio → (seaweed)/portfolio}/+page.svelte +2 -2
- package/src/routes/{portfolio → (seaweed)/portfolio}/.gitignore +1 -1
- package/src/routes/{portfolio → (seaweed)/portfolio}/actual/+page.svelte +1 -1
- package/src/routes/+layout.svelte +0 -7
- package/static/robots.txt +5 -5
- package/src/lib/components/layouts/PineappleBaseLayout.svelte +0 -161
- package/src/routes/+page.svelte +0 -38
- package/src/routes/personal/+page.svelte +0 -37
- /package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
- /package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script>import CloseIcon from "../../../assets/icons/close.svg";
|
|
2
|
+
export let props;
|
|
3
|
+
export let dismissToastCallback;
|
|
4
|
+
export let shouldEnableButton = false;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="body-container">
|
|
8
|
+
<!-- todo: support markdown? -->
|
|
9
|
+
<button class="btn"
|
|
10
|
+
disabled={!shouldEnableButton}
|
|
11
|
+
on:click={dismissToastCallback}>
|
|
12
|
+
<img class="img-icon" src={CloseIcon} alt="close button">
|
|
13
|
+
</button>
|
|
14
|
+
<div class="text-container">
|
|
15
|
+
<span>{props.message}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.body-container {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.text-container {
|
|
26
|
+
margin-top: 0.25lh;
|
|
27
|
+
margin-right: 1em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.text-container:dir(rtl) {
|
|
31
|
+
margin-left: 1em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.btn {
|
|
35
|
+
--tw-bg-opacity: 1;
|
|
36
|
+
background-color: rgb(var(--color-surface-100) / var(--tw-bg-opacity));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:is(.dark .btn) {
|
|
40
|
+
--tw-bg-opacity: 1;
|
|
41
|
+
background-color: rgb(var(--color-surface-900) / var(--tw-bg-opacity));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.btn {
|
|
45
|
+
border-radius: 8px;
|
|
46
|
+
padding: 0.5em;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Props } from "./DefaultToastBody";
|
|
3
|
+
import type { DismissToastCallback } from "./Toast";
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
props: Props;
|
|
7
|
+
dismissToastCallback: DismissToastCallback | undefined;
|
|
8
|
+
shouldEnableButton?: boolean | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type DefaultToastBodyProps = typeof __propDef.props;
|
|
16
|
+
export type DefaultToastBodyEvents = typeof __propDef.events;
|
|
17
|
+
export type DefaultToastBodySlots = typeof __propDef.slots;
|
|
18
|
+
export default class DefaultToastBody extends SvelteComponent<DefaultToastBodyProps, DefaultToastBodyEvents, DefaultToastBodySlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import type { DefaultToastPair } from "./DefaultToastBody";
|
|
3
|
+
import type { TestCustomToastPair } from "./custom-toast/TestCustomToast";
|
|
4
|
+
/**
|
|
5
|
+
* Default toast duration is 5 seconds
|
|
6
|
+
*/
|
|
7
|
+
export declare const DefaultToastParamsDuration = 5000;
|
|
8
|
+
export type CustomToastPairs = DefaultToastPair | TestCustomToastPair;
|
|
9
|
+
export type DismissToastCallback = () => void;
|
|
10
|
+
export interface ToastParams {
|
|
11
|
+
componentAndProps: CustomToastPairs;
|
|
12
|
+
/**
|
|
13
|
+
* Time in millisecond. If undefined, defaults to DefaultToastParamsDuration
|
|
14
|
+
*/
|
|
15
|
+
duration?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* todo: do not call directly documentation
|
|
19
|
+
*/
|
|
20
|
+
export declare const activeToast: import("svelte/store").Writable<ToastParams | undefined>;
|
|
21
|
+
export declare const toastQueue: ToastParams[];
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param newToast
|
|
25
|
+
*/
|
|
26
|
+
export declare const showComponentInToast: (newToast: ToastParams) => void;
|
|
27
|
+
export declare const showTextInToast: (message: string) => void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import DefaultToastBody from "./DefaultToastBody.svelte";
|
|
3
|
+
/**
|
|
4
|
+
* Default toast duration is 5 seconds
|
|
5
|
+
*/
|
|
6
|
+
export const DefaultToastParamsDuration = 5000;
|
|
7
|
+
/**
|
|
8
|
+
* todo: do not call directly documentation
|
|
9
|
+
*/
|
|
10
|
+
export const activeToast = writable();
|
|
11
|
+
export const toastQueue = [];
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param newToast
|
|
15
|
+
*/
|
|
16
|
+
export const showComponentInToast = (newToast) => {
|
|
17
|
+
// todo: queue component
|
|
18
|
+
activeToast.update((currentToast) => {
|
|
19
|
+
if (currentToast !== undefined) {
|
|
20
|
+
toastQueue.push(newToast);
|
|
21
|
+
return currentToast;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return newToast;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export const showTextInToast = (message) => {
|
|
29
|
+
showComponentInToast({
|
|
30
|
+
componentAndProps: {
|
|
31
|
+
component: DefaultToastBody,
|
|
32
|
+
props: {
|
|
33
|
+
message
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script>import {
|
|
2
|
+
activeToast,
|
|
3
|
+
DefaultToastParamsDuration,
|
|
4
|
+
toastQueue
|
|
5
|
+
} from "./Toast";
|
|
6
|
+
import {} from "svelte";
|
|
7
|
+
import Card from "../../Card.svelte";
|
|
8
|
+
import { spring, tweened } from "svelte/motion";
|
|
9
|
+
let localComponent;
|
|
10
|
+
let localProps;
|
|
11
|
+
const HIDDEN_VALUE = -15;
|
|
12
|
+
const SHOWN_VALUE = 0;
|
|
13
|
+
const progress = tweened(0, { duration: DefaultToastParamsDuration });
|
|
14
|
+
const position = spring(HIDDEN_VALUE);
|
|
15
|
+
position.damping = 0.4;
|
|
16
|
+
let isDismissed = false;
|
|
17
|
+
let shouldEnableButton = false;
|
|
18
|
+
const onToastDisappear = () => {
|
|
19
|
+
localComponent = void 0;
|
|
20
|
+
activeToast.update(() => {
|
|
21
|
+
if (toastQueue.length === 0) {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
return toastQueue.shift();
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
activeToast.subscribe((params) => {
|
|
28
|
+
if (!params) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (params.componentAndProps?.component === localComponent) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
localComponent = params.componentAndProps.component;
|
|
35
|
+
localProps = params.componentAndProps.props;
|
|
36
|
+
progress.set(0, { duration: 0 }).then(() => {
|
|
37
|
+
position.set(SHOWN_VALUE).then(() => {
|
|
38
|
+
shouldEnableButton = true;
|
|
39
|
+
progress.set(100, { delay: 500, duration: params.duration ?? DefaultToastParamsDuration }).then(() => {
|
|
40
|
+
shouldEnableButton = false;
|
|
41
|
+
if (isDismissed) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
position.set(HIDDEN_VALUE).then(onToastDisappear);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
const dismissToast = () => {
|
|
50
|
+
shouldEnableButton = false;
|
|
51
|
+
isDismissed = true;
|
|
52
|
+
position.set(HIDDEN_VALUE).then(onToastDisappear);
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
{#if (localComponent !== undefined)}
|
|
57
|
+
<div class="toast-positioner" style={`bottom: ${$position}lh;`}>
|
|
58
|
+
<!-- todo: adjust shadow to be more dynamic or transparent -->
|
|
59
|
+
<Card marginBottom="1lh" overrideStyle="box-shadow: 3px 3px 3px var(--shadow-color);">
|
|
60
|
+
<div slot="content">
|
|
61
|
+
{#if (localProps !== undefined)}
|
|
62
|
+
<svelte:component this={localComponent}
|
|
63
|
+
props={localProps}
|
|
64
|
+
dismissToastCallback={dismissToast}
|
|
65
|
+
shouldEnableButton={shouldEnableButton} />
|
|
66
|
+
{:else }
|
|
67
|
+
<svelte:component this={localComponent} />
|
|
68
|
+
{/if}
|
|
69
|
+
<progress id="toast-progress" value={$progress/100}></progress>
|
|
70
|
+
</div>
|
|
71
|
+
</Card>
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
.toast-positioner {
|
|
77
|
+
position: fixed;
|
|
78
|
+
/* 12em = this component's margin (4em) + fab margin + width (8em) */
|
|
79
|
+
max-width: calc(100vw - 12em);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.toast-positioner:dir(ltr) {
|
|
83
|
+
left: 2em;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.toast-positioner:dir(rtl) {
|
|
87
|
+
right: 2em;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type ToastProps = typeof __propDef.props;
|
|
10
|
+
export type ToastEvents = typeof __propDef.events;
|
|
11
|
+
export type ToastSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Toast extends SvelteComponent<ToastProps, ToastEvents, ToastSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import TestCustomToast from "./TestCustomToast.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>Testing bad custom card</h1>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TestCustomToastProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TestCustomToastEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TestCustomToastSlots */
|
|
4
|
+
export default class TestCustomToast extends SvelteComponent<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type TestCustomToastProps = typeof __propDef.props;
|
|
11
|
+
export type TestCustomToastEvents = typeof __propDef.events;
|
|
12
|
+
export type TestCustomToastSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponent } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
[x: string]: never;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as PineappleLayoutBase } from "./components/
|
|
1
|
+
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
2
2
|
export { default as SeaweedTemplate } from "./template/SeaweedTemplate.svelte";
|
|
3
3
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
4
4
|
export * from "./components/dialog_manager/DialogManagerStore";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as PineappleLayoutBase } from "./components/
|
|
1
|
+
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
2
2
|
export { default as SeaweedTemplate } from "./template/SeaweedTemplate.svelte";
|
|
3
3
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
4
4
|
export * from "./components/dialog_manager/DialogManagerStore";
|
package/dist/postcss.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// from https://stackoverflow.com/a/63885623/17836168
|
|
2
|
-
declare module "./app.postcss";
|
|
3
|
-
declare module "./theme.postcss";
|
|
1
|
+
// from https://stackoverflow.com/a/63885623/17836168
|
|
2
|
+
declare module "./app.postcss";
|
|
3
|
+
declare module "./theme.postcss";
|
package/dist/styles/global.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/* todo: delete if unneeded */
|
|
1
|
+
/* todo: delete if unneeded */
|
package/dist/theme.postcss
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--theme-font-family-base: system-ui;
|
|
6
6
|
--theme-font-family-heading: system-ui;
|
|
7
7
|
--theme-font-color-base: var(--color-primary-900);
|
|
8
|
-
--theme-font-color-dark: var(--color-primary-
|
|
8
|
+
--theme-font-color-dark: var(--color-primary-50);
|
|
9
9
|
--theme-rounded-base: 24px;
|
|
10
10
|
--theme-rounded-container: 16px;
|
|
11
11
|
--theme-border-base: 2px;
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
--color-surface-800: 153 148 136; /* ⬅ #999488 */
|
|
100
100
|
--color-surface-900: 125 121 111; /* ⬅ #7d796f */
|
|
101
101
|
/* text color | #3f312f */
|
|
102
|
+
--color-text-25: 237 234 234; /* ⬅ #e2e0e0 */
|
|
102
103
|
--color-text-50: 226 224 224; /* ⬅ #e2e0e0 */
|
|
103
104
|
--color-text-100: 217 214 213; /* ⬅ #d9d6d5 */
|
|
104
105
|
--color-text-200: 207 204 203; /* ⬅ #cfcccb */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Overlay Spec
|
|
2
|
+
|
|
3
|
+
**What are the things that can appear on top of the normal content?**
|
|
4
|
+
|
|
5
|
+
- Toast
|
|
6
|
+
- Modal
|
|
7
|
+
- Dialog
|
|
8
|
+
- Choices
|
|
9
|
+
- Backstage
|
|
10
|
+
- Preferences
|
|
11
|
+
- Optional: Dialog??
|
|
12
|
+
|
|
13
|
+
**Which one appears on top?**
|
|
14
|
+
|
|
15
|
+
- Toast
|
|
16
|
+
- Modal
|
|
17
|
+
- blocks access on anything below
|
|
18
|
+
- Backstage
|
|
19
|
+
- blocks access on anything below
|
|
20
|
+
- Dialog: choices
|
|
21
|
+
- blocks access on anything below
|
|
22
|
+
- Dialog
|
|
23
|
+
- Everything else
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Which issues does this affect?
|
|
2
|
+
|
|
3
|
+
- Closes #*PR number*
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
*Insert brief description here*
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
*If there are more details or more things that needs to be talked about, put it here.*
|
|
12
|
+
|
|
13
|
+
## Checks
|
|
14
|
+
|
|
15
|
+
- [ ] If some of the checks below are deferred, link an issue for it under as a child
|
|
16
|
+
|
|
17
|
+
### Accessibility
|
|
18
|
+
|
|
19
|
+
- [ ] [Changes are keyboard accessible](https://accessibility.18f.gov/keyboard/)
|
|
20
|
+
- [ ] [All form inputs have explicit labels](https://accessibility.18f.gov/forms/)
|
|
21
|
+
- [ ] [Page content has a meaningful heading hierarchy](https://accessibility.18f.gov/headings/)
|
|
22
|
+
- [ ] [All relevant images use an img tag and have alt attributes](https://accessibility.18f.gov/images/)
|
|
23
|
+
- [ ] [Text has sufficient color contrast](https://accessibility.18f.gov/color/) (a contrast ratio of 4.5:1 with the
|
|
24
|
+
background)
|
|
25
|
+
- [ ] [No red flags when running WAVE on the page](http://wave.webaim.org/)
|
|
26
|
+
- [ ] The UI should also work in left-to-right direction
|
|
27
|
+
|
|
28
|
+
For the full list, see [18F's Accessibility Checklist](https://accessibility.18f.gov/checklist/).
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<!--
|
|
32
|
+
References:
|
|
33
|
+
- https://github.com/ministryofjustice/accessibility-checklist/blob/master/README.md
|
|
34
|
+
-->
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.14",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "npm run check-requirements && vite build && yarn package",
|
package/src/lib/app.postcss
CHANGED
|
@@ -41,11 +41,11 @@ html, body {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* todo: add some hues to the icon that should be in sync with primary and make them not pure darkness */
|
|
44
|
-
.turnip-button > img {
|
|
44
|
+
.turnip-button > img, .img-icon {
|
|
45
45
|
filter: grayscale(100%) brightness(0%) invert(25%);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.dark .turnip-button > img {
|
|
48
|
+
.dark .turnip-button > img, .dark .img-icon {
|
|
49
49
|
filter: grayscale(100%) brightness(0%) invert(100%);
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -164,4 +164,30 @@ a:active {
|
|
|
164
164
|
.accordion-item {
|
|
165
165
|
@apply variant-filled-primary rounded-md;
|
|
166
166
|
}
|
|
167
|
+
|
|
167
168
|
/* endregion Accordion css for handling missing styles in package */
|
|
169
|
+
|
|
170
|
+
:root {
|
|
171
|
+
--shadow-color: rgba(91, 79, 54, 0.5);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* todo: adjust shadow for each component + change depending on dark mode or not */
|
|
175
|
+
.fab, #shell-header {
|
|
176
|
+
box-shadow: 3px 3px 3px var(--shadow-color);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
#toast-progress {
|
|
180
|
+
position: relative;
|
|
181
|
+
top: 5px;
|
|
182
|
+
left: 6px;
|
|
183
|
+
width: calc(100% - 12px);
|
|
184
|
+
border-radius: 8px;
|
|
185
|
+
background: transparent;
|
|
186
|
+
height: 10px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#toast-progress::-moz-progress-bar {
|
|
190
|
+
/*background-color: red;*/
|
|
191
|
+
background: rgba(var(--color-secondary-500));
|
|
192
|
+
}
|
|
193
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
export let margin = "0";
|
|
3
|
-
export let marginBottom = "
|
|
4
|
-
export let overrideStyle = "";
|
|
5
|
-
export let includeDataNoSnippet = true;
|
|
6
|
-
|
|
7
|
-
// warning: don't forget the semi-colon when adding new style!
|
|
8
|
-
const style = `
|
|
9
|
-
--turnip-card-margin: ${margin};
|
|
10
|
-
--turnip-card-margin-bottom: ${marginBottom};
|
|
11
|
-
${overrideStyle};
|
|
12
|
-
`;
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
{#if (includeDataNoSnippet)}
|
|
16
|
-
<div class="card turnip-card" style={style} data-no-snippet>
|
|
17
|
-
<slot name="content" class="card" />
|
|
18
|
-
</div>
|
|
19
|
-
{:else }
|
|
20
|
-
<div class="card turnip-card" style={style}>
|
|
21
|
-
<slot name="content" class="card" />
|
|
22
|
-
</div>
|
|
23
|
-
{/if}
|
|
24
|
-
|
|
25
|
-
<style lang="postcss">
|
|
26
|
-
.turnip-card {
|
|
27
|
-
@apply bg-surface-100 dark:bg-surface-900;
|
|
28
|
-
margin: var(--turnip-card-margin);
|
|
29
|
-
margin-bottom: var(--turnip-card-margin-bottom);
|
|
30
|
-
border-radius: var(--theme-rounded-container);
|
|
31
|
-
}
|
|
32
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let margin = "0";
|
|
3
|
+
export let marginBottom = "2lh";
|
|
4
|
+
export let overrideStyle = "";
|
|
5
|
+
export let includeDataNoSnippet = true;
|
|
6
|
+
|
|
7
|
+
// warning: don't forget the semi-colon when adding new style!
|
|
8
|
+
const style = `
|
|
9
|
+
--turnip-card-margin: ${margin};
|
|
10
|
+
--turnip-card-margin-bottom: ${marginBottom};
|
|
11
|
+
${overrideStyle};
|
|
12
|
+
`;
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if (includeDataNoSnippet)}
|
|
16
|
+
<div class="card turnip-card" style={style} data-no-snippet>
|
|
17
|
+
<slot name="content" class="card" />
|
|
18
|
+
</div>
|
|
19
|
+
{:else }
|
|
20
|
+
<div class="card turnip-card" style={style}>
|
|
21
|
+
<slot name="content" class="card" />
|
|
22
|
+
</div>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
25
|
+
<style lang="postcss">
|
|
26
|
+
.turnip-card {
|
|
27
|
+
@apply bg-surface-100 dark:bg-surface-900;
|
|
28
|
+
margin: var(--turnip-card-margin);
|
|
29
|
+
margin-bottom: var(--turnip-card-margin-bottom);
|
|
30
|
+
border-radius: var(--theme-rounded-container);
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
export let activeGameIndex: number;
|
|
3
|
-
export let selfIndex: number;
|
|
4
|
-
|
|
5
|
-
import {fly, slide, scale} from "svelte/transition";
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
{#if (activeGameIndex === selfIndex)}
|
|
10
|
-
<!--todo: make section consistent size for all-->
|
|
11
|
-
<section class="game-showcase"
|
|
12
|
-
in:fly={{x: '100%'}} out:fly={{x: '-100%'}}>
|
|
13
|
-
<slot/>
|
|
14
|
-
</section>
|
|
15
|
-
{/if}
|
|
16
|
-
|
|
17
|
-
<style>
|
|
18
|
-
.game-showcase {
|
|
19
|
-
@apply snap-center rounded-container-token;
|
|
20
|
-
margin: auto;
|
|
21
|
-
width: 100%;
|
|
22
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let activeGameIndex: number;
|
|
3
|
+
export let selfIndex: number;
|
|
4
|
+
|
|
5
|
+
import {fly, slide, scale} from "svelte/transition";
|
|
6
|
+
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
{#if (activeGameIndex === selfIndex)}
|
|
10
|
+
<!--todo: make section consistent size for all-->
|
|
11
|
+
<section class="game-showcase"
|
|
12
|
+
in:fly={{x: '100%'}} out:fly={{x: '-100%'}}>
|
|
13
|
+
<slot/>
|
|
14
|
+
</section>
|
|
15
|
+
{/if}
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
.game-showcase {
|
|
19
|
+
@apply snap-center rounded-container-token;
|
|
20
|
+
margin: auto;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
23
|
</style>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
<span class="chip variant-filled-tertiary">
|
|
2
|
-
<slot />
|
|
3
|
-
</span>
|
|
4
|
-
|
|
5
|
-
<style lang="postcss">
|
|
6
|
-
.chip {
|
|
7
|
-
border-radius: 1em;
|
|
8
|
-
margin: 0.25em;
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<span class="chip variant-filled-tertiary">
|
|
2
|
+
<slot />
|
|
3
|
+
</span>
|
|
4
|
+
|
|
5
|
+
<style lang="postcss">
|
|
6
|
+
.chip {
|
|
7
|
+
border-radius: 1em;
|
|
8
|
+
margin: 0.25em;
|
|
9
|
+
font-weight: bold;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
background-color: rgb(var(--color-tertiary-500) / var(--tw-bg-opacity));
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {onMount} from "svelte";
|
|
3
|
-
|
|
4
|
-
export let isVisible = true;
|
|
5
|
-
|
|
6
|
-
let stickyElem: HTMLElement;
|
|
7
|
-
|
|
8
|
-
let observer: undefined | IntersectionObserver;
|
|
9
|
-
onMount(() => {
|
|
10
|
-
observer = new IntersectionObserver(
|
|
11
|
-
([e]) => {
|
|
12
|
-
isVisible = e.intersectionRatio >= 1;
|
|
13
|
-
},
|
|
14
|
-
{threshold: [1]}
|
|
15
|
-
);
|
|
16
|
-
observer.observe(stickyElem);
|
|
17
|
-
});
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<span bind:this={stickyElem}>
|
|
21
|
-
<slot/>
|
|
22
|
-
</span>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {onMount} from "svelte";
|
|
3
|
+
|
|
4
|
+
export let isVisible = true;
|
|
5
|
+
|
|
6
|
+
let stickyElem: HTMLElement;
|
|
7
|
+
|
|
8
|
+
let observer: undefined | IntersectionObserver;
|
|
9
|
+
onMount(() => {
|
|
10
|
+
observer = new IntersectionObserver(
|
|
11
|
+
([e]) => {
|
|
12
|
+
isVisible = e.intersectionRatio >= 1;
|
|
13
|
+
},
|
|
14
|
+
{threshold: [1]}
|
|
15
|
+
);
|
|
16
|
+
observer.observe(stickyElem);
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<span bind:this={stickyElem}>
|
|
21
|
+
<slot/>
|
|
22
|
+
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type OnElementVisibilityChanged = (isVisible: boolean) => void;
|
|
1
|
+
export type OnElementVisibilityChanged = (isVisible: boolean) => void;
|