@coyalabs/bts-style 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Base/BaseContainer.svelte +85 -0
- package/dist/{BaseContainer.svelte.d.ts → Base/BaseContainer.svelte.d.ts} +12 -2
- package/dist/Base/BaseIcon.svelte +42 -0
- package/dist/Base/BaseIcon.svelte.d.ts +30 -0
- package/dist/Base/BasePage.svelte +73 -0
- package/dist/Base/BasePage.svelte.d.ts +37 -0
- package/dist/{Text.svelte → Base/BaseText.svelte} +9 -11
- package/dist/{Text.svelte.d.ts → Base/BaseText.svelte.d.ts} +5 -3
- package/dist/Components/Button.svelte +151 -0
- package/dist/Components/Button.svelte.d.ts +65 -0
- package/dist/Components/Dropdown.svelte +191 -0
- package/dist/Components/Dropdown.svelte.d.ts +54 -0
- package/dist/Components/IconButton.svelte +44 -0
- package/dist/Components/IconButton.svelte.d.ts +34 -0
- package/dist/Components/InputBox.svelte +103 -0
- package/dist/Components/InputBox.svelte.d.ts +56 -0
- package/dist/Components/Popup/AlertPopup.svelte +27 -0
- package/dist/Components/Popup/AlertPopup.svelte.d.ts +28 -0
- package/dist/Components/Popup/ConfirmPopup.svelte +39 -0
- package/dist/Components/Popup/ConfirmPopup.svelte.d.ts +32 -0
- package/dist/Components/Popup/Popup.svelte +67 -0
- package/dist/{BasePage.svelte.d.ts → Components/Popup/Popup.svelte.d.ts} +15 -9
- package/dist/Components/Popup/PromptPopup.svelte +61 -0
- package/dist/Components/Popup/PromptPopup.svelte.d.ts +36 -0
- package/dist/Components/Separator.svelte +63 -0
- package/dist/Components/Separator.svelte.d.ts +30 -0
- package/dist/Components/Special/SpecialAction.svelte +46 -0
- package/dist/Components/Special/SpecialAction.svelte.d.ts +32 -0
- package/dist/Components/Special/SpecialParagraph.svelte +159 -0
- package/dist/Components/Special/SpecialParagraph.svelte.d.ts +52 -0
- package/dist/Components/TabBar.svelte +128 -0
- package/dist/Components/TabBar.svelte.d.ts +40 -0
- package/dist/Components/Toggle.svelte +59 -0
- package/dist/{Testing.svelte.d.ts → Components/Toggle.svelte.d.ts} +5 -9
- package/dist/Components/Tooltip.svelte +132 -0
- package/dist/Components/Tooltip.svelte.d.ts +28 -0
- package/dist/Components/TreeDirectory.svelte +148 -0
- package/dist/Components/TreeDirectory.svelte.d.ts +58 -0
- package/dist/Components/popupStore.d.ts +31 -0
- package/dist/Components/popupStore.js +99 -0
- package/dist/Structure/BG/AssetGear.d.ts +2 -0
- package/dist/Structure/BG/AssetGear.js +2 -0
- package/dist/Structure/BG/BGChain.svelte +188 -0
- package/dist/Structure/BG/BGChain.svelte.d.ts +36 -0
- package/dist/Structure/BG/BGDetails.svelte +130 -0
- package/dist/Structure/BG/BGDetails.svelte.d.ts +36 -0
- package/dist/Structure/BG/BGGears.svelte +188 -0
- package/dist/Structure/BG/BGGears.svelte.d.ts +38 -0
- package/dist/Structure/TextHeader.svelte +32 -0
- package/dist/Structure/TextHeader.svelte.d.ts +28 -0
- package/dist/icons.d.ts +11 -0
- package/dist/icons.js +11 -0
- package/dist/index.d.ts +25 -3
- package/dist/index.js +30 -3
- package/package.json +2 -1
- package/public/favicon.png +0 -0
- package/README.md +0 -35
- package/dist/BaseContainer.svelte +0 -43
- package/dist/BasePage.svelte +0 -30
- package/dist/Testing.svelte +0 -26
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
export default
|
|
2
|
-
type
|
|
3
|
-
[
|
|
1
|
+
export default Popup;
|
|
2
|
+
type Popup = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
4
|
}, {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
click: PointerEvent;
|
|
6
|
+
keydown: KeyboardEvent;
|
|
7
|
+
} & {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
}, {}> & {
|
|
7
10
|
$$bindings?: string | undefined;
|
|
8
11
|
};
|
|
9
|
-
declare const
|
|
10
|
-
[
|
|
12
|
+
declare const Popup: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
[x: string]: never;
|
|
11
14
|
}, {
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
click: PointerEvent;
|
|
16
|
+
keydown: KeyboardEvent;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
14
20
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
21
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
22
|
$$bindings?: Bindings;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Button from '../Button.svelte';
|
|
3
|
+
import InputBox from '../InputBox.svelte';
|
|
4
|
+
import BaseText from '../../Base/BaseText.svelte';
|
|
5
|
+
import { icons } from '../../icons.js';
|
|
6
|
+
import { popupStore } from '../popupStore.js';
|
|
7
|
+
|
|
8
|
+
/** @type {(value: string) => void} */
|
|
9
|
+
export let onSubmit = () => {};
|
|
10
|
+
|
|
11
|
+
/** @type {() => void} */
|
|
12
|
+
export let onCancel = () => {};
|
|
13
|
+
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
export let placeholder = 'Enter value...';
|
|
16
|
+
|
|
17
|
+
/** @type {string} */
|
|
18
|
+
export let submitText = 'Submit';
|
|
19
|
+
|
|
20
|
+
/** @type {string} */
|
|
21
|
+
export let cancelText = 'Cancel';
|
|
22
|
+
|
|
23
|
+
/** @type {string} */
|
|
24
|
+
export let label = '';
|
|
25
|
+
|
|
26
|
+
let value = '';
|
|
27
|
+
|
|
28
|
+
function handleSubmit() {
|
|
29
|
+
onSubmit(value);
|
|
30
|
+
popupStore.close();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function handleCancel() {
|
|
34
|
+
onCancel();
|
|
35
|
+
popupStore.close();
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<div class="prompt">
|
|
40
|
+
{#if label}
|
|
41
|
+
<BaseText variant="content">{label}</BaseText>
|
|
42
|
+
{/if}
|
|
43
|
+
<InputBox bind:value {placeholder} />
|
|
44
|
+
<div class="buttons">
|
|
45
|
+
<Button theme="primary" actionIcon={icons.check} on:click={handleSubmit}>{submitText}</Button>
|
|
46
|
+
<Button theme="secondary" actionIcon={icons.crossb} on:click={handleCancel}>{cancelText}</Button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<style>
|
|
51
|
+
.prompt {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: 1rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.buttons {
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 1rem;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default PromptPopup;
|
|
2
|
+
type PromptPopup = SvelteComponent<{
|
|
3
|
+
label?: string | undefined;
|
|
4
|
+
placeholder?: string | undefined;
|
|
5
|
+
onCancel?: (() => void) | undefined;
|
|
6
|
+
cancelText?: string | undefined;
|
|
7
|
+
onSubmit?: ((value: string) => void) | undefined;
|
|
8
|
+
submitText?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
}, {}> & {
|
|
12
|
+
$$bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const PromptPopup: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
placeholder?: string | undefined;
|
|
17
|
+
onCancel?: (() => void) | undefined;
|
|
18
|
+
cancelText?: string | undefined;
|
|
19
|
+
onSubmit?: ((value: string) => void) | undefined;
|
|
20
|
+
submitText?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
}, {}, {}, string>;
|
|
24
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
25
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
26
|
+
$$bindings?: Bindings;
|
|
27
|
+
} & Exports;
|
|
28
|
+
(internal: unknown, props: Props & {
|
|
29
|
+
$$events?: Events;
|
|
30
|
+
$$slots?: Slots;
|
|
31
|
+
}): Exports & {
|
|
32
|
+
$set?: any;
|
|
33
|
+
$on?: any;
|
|
34
|
+
};
|
|
35
|
+
z_$$bindings?: Bindings;
|
|
36
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
const svgSide = '<svg width="51" height="14" viewBox="0 0 51 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.34766 0.0117188C1.73943 0.0206734 2.04817 0.156895 2.21484 0.246094C2.40301 0.347061 2.5769 0.471392 2.71875 0.585938C3.0026 0.815356 3.30516 1.12112 3.62109 1.46484C4.13857 2.02792 4.71503 2.52735 5.34375 2.96484C6.12646 3.50981 6.96366 4.39169 7.88672 5.49609H8.48438C9.19157 5.39437 9.93448 5.3599 10.7109 5.44922C11.5804 5.54939 12.4548 5.65477 13.3242 5.75391C13.9681 5.8268 14.6202 5.75253 15.293 5.53125C16.3428 5.18618 17.4137 5.05727 18.4922 5.14453C19.3709 5.21564 20.2502 5.28987 21.1289 5.37891C22.0304 5.47028 22.9352 5.59238 23.8359 5.74219C24.6263 5.87367 25.416 5.93785 26.2031 5.94141C27.0095 5.94481 27.8211 5.89987 28.6289 5.80078C29.5372 5.68937 30.4503 5.61804 31.3594 5.57812C32.2056 5.5409 33.0559 5.47755 33.9023 5.40234C34.8753 5.3162 35.8484 5.3421 36.8203 5.46094C37.5779 5.5537 38.3368 5.55236 39.0938 5.47266C39.9604 5.3814 40.8287 5.2886 41.6953 5.19141C42.7294 5.0756 43.7635 5.12971 44.7891 5.35547C45.5064 5.51388 46.2252 5.55602 46.9336 5.48438C47.9079 5.38622 49.2439 5.3997 50.8945 5.49609H51V8.49609H50.8008C49.152 8.3975 47.9732 8.39714 47.2266 8.47266C46.1967 8.57625 45.1655 8.51061 44.1445 8.28516C43.434 8.12869 42.7253 8.10097 42.0234 8.17969C41.1525 8.27735 40.2811 8.36922 39.4102 8.46094C38.4271 8.56446 37.4395 8.5578 36.457 8.4375C35.6916 8.34387 34.9244 8.32272 34.1602 8.39062C33.2694 8.46972 32.3792 8.53898 31.4883 8.57812C30.6576 8.6146 29.8236 8.67535 28.9922 8.77734C28.0603 8.89161 27.1247 8.94535 26.1914 8.94141C25.2411 8.93721 24.2908 8.86458 23.3438 8.70703C22.5052 8.56754 21.662 8.4521 20.8242 8.36719C19.9661 8.28025 19.1041 8.20224 18.2461 8.13281C17.5864 8.07996 16.9187 8.16426 16.2305 8.39062C15.1658 8.74063 14.078 8.8547 12.9844 8.73047C12.1141 8.63124 11.2413 8.52605 10.3711 8.42578C9.62969 8.34036 9.03581 8.37464 8.57812 8.48438C8.2446 8.56426 7.92758 8.63057 7.66406 8.66016C6.72608 9.63803 5.8882 10.4341 5.09766 10.9102C4.50693 11.2662 4.00397 11.7139 3.58594 12.2695C3.30392 12.6446 3.03046 12.976 2.77734 13.2305C2.65105 13.3571 2.49298 13.4978 2.32031 13.6172C2.17514 13.7176 1.86759 13.9106 1.45312 13.957L1.26562 13.9805L1.06641 13.9453L0.84375 13.9219L1.04297 12.5508L0.996094 12.5039L0 11.3789L0.0820312 11.3086L0.609375 10.8516L0.84375 10.875C0.934721 10.7665 1.0544 10.6367 1.18359 10.4648C1.83258 9.60176 2.62756 8.88803 3.55078 8.33203C3.95922 8.08554 4.48198 7.62172 5.16797 6.9375C4.51681 6.19986 4.0219 5.69702 3.63281 5.42578C2.82398 4.86296 2.08428 4.21715 1.41797 3.49219C1.26913 3.33024 1.13246 3.21476 1.03125 3.11719L0.667969 3.21094L0.0820312 2.69531L0 2.625L0.996094 1.5L1.03125 1.45312L0.714844 0.105469L0.960938 0.046875L1.14844 0L1.34766 0.0117188Z" fill="#1D191F"/></svg>';
|
|
3
|
+
const svgStretch = '<svg width="50" height="4" viewBox="0 0 50 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.793 0.271071C20.7035 0.362386 21.6137 0.484728 22.5234 0.634352C23.3258 0.766294 24.1266 0.830205 24.9258 0.833571C25.7413 0.836979 26.5581 0.791831 27.375 0.692946C28.2931 0.581596 29.2218 0.498462 30.1406 0.458571C30.9959 0.421352 31.8515 0.369633 32.707 0.294509C33.691 0.208078 34.6773 0.222428 35.6602 0.341384C36.429 0.434456 37.2006 0.44479 37.9688 0.364821C38.8437 0.273727 39.7188 0.180578 40.5938 0.0835715C41.6386 -0.0322773 42.6862 0.021345 43.7227 0.247634C44.4507 0.406319 45.1712 0.448468 45.8906 0.37654C46.8918 0.276437 48.2776 0.286775 49.9922 0.388259H50.0039V3.38826H49.8164C48.1444 3.28929 46.9425 3.28894 46.1836 3.36482C45.1458 3.46797 44.1073 3.40201 43.0781 3.17732C42.3554 3.01977 41.6363 2.98092 40.9219 3.06013C40.0396 3.15795 39.1557 3.26125 38.2734 3.3531C37.2824 3.45608 36.2873 3.43784 35.2969 3.31794C34.5228 3.22447 33.7496 3.21526 32.9766 3.28279C32.0761 3.36188 31.1702 3.4194 30.2695 3.45857C29.4284 3.49508 28.5802 3.5674 27.7383 3.66951C26.7976 3.78349 25.8561 3.83749 24.9141 3.83357C23.9535 3.82955 22.9886 3.74493 22.0312 3.58747C21.1841 3.44827 20.3346 3.34416 19.4883 3.25935C18.6188 3.17223 17.7444 3.09453 16.875 3.02497C16.2036 2.97193 15.5232 3.044 14.8242 3.27107C13.7509 3.62006 12.656 3.74633 11.5547 3.62263C10.6741 3.52337 9.7868 3.41824 8.9062 3.31794C8.17514 3.23508 7.43857 3.26613 6.70312 3.39997C5.77106 3.56937 4.83678 3.67782 3.90234 3.73982C2.94429 3.80324 2.00452 3.78762 1.08984 3.69294C0.66932 3.6493 0.31018 3.61128 0.04688 3.56404L0 0.388259H3.86719L3.46875 0.763259C3.54583 0.759357 3.62544 0.756682 3.70312 0.75154C4.52477 0.697065 5.35175 0.596824 6.17578 0.446852C7.1966 0.261429 8.22096 0.22495 9.2461 0.341384C10.1237 0.441342 11.0053 0.535427 11.8828 0.634352C12.5405 0.708486 13.2127 0.646387 13.8984 0.423415C14.9568 0.0795105 16.0351 -0.0619009 17.1211 0.0249777C18.0107 0.0961552 18.9034 0.181928 19.793 0.271071Z" fill="#1D191F"/></svg>';
|
|
4
|
+
|
|
5
|
+
// Convert SVG to data URL
|
|
6
|
+
const sideDataUrl = 'data:image/svg+xml,' + encodeURIComponent(svgSide);
|
|
7
|
+
const stretchDataUrl = 'data:image/svg+xml,' + encodeURIComponent(svgStretch);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
export let height = '12px';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
export let width = '100%';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
export let margin = '2rem 0';
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class="separator" style="--height: {height}; --width: {width}; --margin: {margin};">
|
|
26
|
+
<img src={sideDataUrl} alt="" class="side left" />
|
|
27
|
+
<div class="middle" style="background-image: url('{stretchDataUrl}');"></div>
|
|
28
|
+
<img src={sideDataUrl} alt="" class="side right" />
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.separator {
|
|
33
|
+
width: var(--width);
|
|
34
|
+
height: var(--height);
|
|
35
|
+
margin: var(--margin);
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
user-select: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.separator img {
|
|
44
|
+
height: 100%;
|
|
45
|
+
display: block;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.side {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.side.right {
|
|
53
|
+
transform: scaleX(-1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.middle {
|
|
57
|
+
flex: 1;
|
|
58
|
+
height: 100%;
|
|
59
|
+
background-repeat: repeat-x;
|
|
60
|
+
background-size: auto 30%;
|
|
61
|
+
background-position: left center;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default Separator;
|
|
2
|
+
type Separator = SvelteComponent<{
|
|
3
|
+
height?: string | undefined;
|
|
4
|
+
width?: string | undefined;
|
|
5
|
+
margin?: string | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> & {
|
|
9
|
+
$$bindings?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
declare const Separator: $$__sveltets_2_IsomorphicComponent<{
|
|
12
|
+
height?: string | undefined;
|
|
13
|
+
width?: string | undefined;
|
|
14
|
+
margin?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
19
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
20
|
+
$$bindings?: Bindings;
|
|
21
|
+
} & Exports;
|
|
22
|
+
(internal: unknown, props: Props & {
|
|
23
|
+
$$events?: Events;
|
|
24
|
+
$$slots?: Slots;
|
|
25
|
+
}): Exports & {
|
|
26
|
+
$set?: any;
|
|
27
|
+
$on?: any;
|
|
28
|
+
};
|
|
29
|
+
z_$$bindings?: Bindings;
|
|
30
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Button from '../Button.svelte';
|
|
3
|
+
import Tooltip from '../Tooltip.svelte';
|
|
4
|
+
import { icons } from '../../icons.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @type {string}
|
|
8
|
+
*/
|
|
9
|
+
export let label = '';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
export let tooltipText = '';
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="special-action-wrapper">
|
|
18
|
+
<Button theme="special-filled"
|
|
19
|
+
icon={icons.any_ai}
|
|
20
|
+
iconToned={false}
|
|
21
|
+
actionIcon={null}
|
|
22
|
+
on:click
|
|
23
|
+
>
|
|
24
|
+
{label}
|
|
25
|
+
</Button>
|
|
26
|
+
{#if tooltipText}
|
|
27
|
+
<div class="tooltip-container">
|
|
28
|
+
<Tooltip text={tooltipText} iconSize="14px" />
|
|
29
|
+
</div>
|
|
30
|
+
{/if}
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.special-action-wrapper {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: block;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tooltip-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
right: 1rem;
|
|
43
|
+
top: 50%;
|
|
44
|
+
transform: translateY(-50%);
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default SpecialAction;
|
|
2
|
+
type SpecialAction = SvelteComponent<{
|
|
3
|
+
label?: string | undefined;
|
|
4
|
+
tooltipText?: string | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
click: PointerEvent;
|
|
7
|
+
} & {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
}, {}> & {
|
|
10
|
+
$$bindings?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
declare const SpecialAction: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
tooltipText?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
click: PointerEvent;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
21
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
22
|
+
$$bindings?: Bindings;
|
|
23
|
+
} & Exports;
|
|
24
|
+
(internal: unknown, props: Props & {
|
|
25
|
+
$$events?: Events;
|
|
26
|
+
$$slots?: Slots;
|
|
27
|
+
}): Exports & {
|
|
28
|
+
$set?: any;
|
|
29
|
+
$on?: any;
|
|
30
|
+
};
|
|
31
|
+
z_$$bindings?: Bindings;
|
|
32
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The text content to animate
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
export let text = '';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Delay between each word appearing (ms)
|
|
12
|
+
* @type {number}
|
|
13
|
+
*/
|
|
14
|
+
export let wordDelay = 50;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Initial delay before animation starts (ms)
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
export let startDelay = 0;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Animation duration for each word (ms)
|
|
24
|
+
* @type {number}
|
|
25
|
+
*/
|
|
26
|
+
export let animationDuration = 300;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Text variant styling
|
|
30
|
+
* @type {'title' | 'content' | 'button'}
|
|
31
|
+
*/
|
|
32
|
+
export let variant = 'content';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Font size modifier
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
export let textModifier = '0px';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether to start animation automatically on mount
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
*/
|
|
44
|
+
export let autoPlay = true;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @type {string[]}
|
|
48
|
+
*/
|
|
49
|
+
let words = [];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
let visibleCount = 0;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
*/
|
|
59
|
+
let animationComplete = false;
|
|
60
|
+
|
|
61
|
+
$: words = text.split(/(\s+)/).filter(w => w.length > 0);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Start the word-by-word animation
|
|
65
|
+
*/
|
|
66
|
+
export function play() {
|
|
67
|
+
visibleCount = 0;
|
|
68
|
+
animationComplete = false;
|
|
69
|
+
animateWords();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Reset animation to beginning
|
|
74
|
+
*/
|
|
75
|
+
export function reset() {
|
|
76
|
+
visibleCount = 0;
|
|
77
|
+
animationComplete = false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Show all words immediately
|
|
82
|
+
*/
|
|
83
|
+
export function showAll() {
|
|
84
|
+
visibleCount = words.length;
|
|
85
|
+
animationComplete = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function animateWords() {
|
|
89
|
+
if (visibleCount < words.length) {
|
|
90
|
+
visibleCount++;
|
|
91
|
+
setTimeout(animateWords, wordDelay);
|
|
92
|
+
} else {
|
|
93
|
+
animationComplete = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
onMount(() => {
|
|
98
|
+
if (autoPlay) {
|
|
99
|
+
setTimeout(play, startDelay);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<span class="special-paragraph" data-variant={variant} style="--text-modifier: {textModifier}; --animation-duration: {animationDuration}ms;">
|
|
105
|
+
{#each words as word, i}
|
|
106
|
+
<span
|
|
107
|
+
class="word"
|
|
108
|
+
class:visible={i < visibleCount}
|
|
109
|
+
class:space={/^\s+$/.test(word)}
|
|
110
|
+
>{word}</span>
|
|
111
|
+
{/each}
|
|
112
|
+
</span>
|
|
113
|
+
|
|
114
|
+
<style>
|
|
115
|
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@900&display=swap');
|
|
116
|
+
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap');
|
|
117
|
+
.special-paragraph {
|
|
118
|
+
display: inline;
|
|
119
|
+
}
|
|
120
|
+
.word {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
opacity: 0;
|
|
123
|
+
transform: translateY(8px);
|
|
124
|
+
filter: blur(4px);
|
|
125
|
+
transition:
|
|
126
|
+
opacity var(--animation-duration) ease,
|
|
127
|
+
transform var(--animation-duration) ease,
|
|
128
|
+
filter var(--animation-duration) ease;
|
|
129
|
+
}
|
|
130
|
+
.word.visible {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
transform: translateY(0);
|
|
133
|
+
filter: blur(0);
|
|
134
|
+
}
|
|
135
|
+
.word.space {
|
|
136
|
+
white-space: pre;
|
|
137
|
+
}
|
|
138
|
+
/* Title variant */
|
|
139
|
+
.special-paragraph[data-variant='title'] {
|
|
140
|
+
font-family: 'Noto Serif KR', serif;
|
|
141
|
+
font-weight: 900;
|
|
142
|
+
font-size: calc(30px + var(--text-modifier));
|
|
143
|
+
color: #E3D8D8;
|
|
144
|
+
}
|
|
145
|
+
/* Content variant */
|
|
146
|
+
.special-paragraph[data-variant='content'] {
|
|
147
|
+
font-family: 'Satoshi', sans-serif;
|
|
148
|
+
font-weight: 700;
|
|
149
|
+
font-size: calc(18px + var(--text-modifier));
|
|
150
|
+
color: #777073;
|
|
151
|
+
}
|
|
152
|
+
/* Button variant */
|
|
153
|
+
.special-paragraph[data-variant='button'] {
|
|
154
|
+
font-family: 'Noto Serif KR', serif;
|
|
155
|
+
font-weight: 900;
|
|
156
|
+
font-size: calc(17px + var(--text-modifier));
|
|
157
|
+
color: #E3D8D8;
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default SpecialParagraph;
|
|
2
|
+
type SpecialParagraph = SvelteComponent<{
|
|
3
|
+
text?: string | undefined;
|
|
4
|
+
variant?: "button" | "title" | "content" | undefined;
|
|
5
|
+
textModifier?: string | undefined;
|
|
6
|
+
play?: (() => void) | undefined;
|
|
7
|
+
reset?: (() => void) | undefined;
|
|
8
|
+
wordDelay?: number | undefined;
|
|
9
|
+
startDelay?: number | undefined;
|
|
10
|
+
animationDuration?: number | undefined;
|
|
11
|
+
autoPlay?: boolean | undefined;
|
|
12
|
+
showAll?: (() => void) | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {}> & {
|
|
16
|
+
$$bindings?: string | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
play: () => void;
|
|
19
|
+
reset: () => void;
|
|
20
|
+
showAll: () => void;
|
|
21
|
+
};
|
|
22
|
+
declare const SpecialParagraph: $$__sveltets_2_IsomorphicComponent<{
|
|
23
|
+
text?: string | undefined;
|
|
24
|
+
variant?: "button" | "title" | "content" | undefined;
|
|
25
|
+
textModifier?: string | undefined;
|
|
26
|
+
play?: (() => void) | undefined;
|
|
27
|
+
reset?: (() => void) | undefined;
|
|
28
|
+
wordDelay?: number | undefined;
|
|
29
|
+
startDelay?: number | undefined;
|
|
30
|
+
animationDuration?: number | undefined;
|
|
31
|
+
autoPlay?: boolean | undefined;
|
|
32
|
+
showAll?: (() => void) | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
}, {}, {
|
|
36
|
+
play: () => void;
|
|
37
|
+
reset: () => void;
|
|
38
|
+
showAll: () => void;
|
|
39
|
+
}, string>;
|
|
40
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
41
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
42
|
+
$$bindings?: Bindings;
|
|
43
|
+
} & Exports;
|
|
44
|
+
(internal: unknown, props: Props & {
|
|
45
|
+
$$events?: Events;
|
|
46
|
+
$$slots?: Slots;
|
|
47
|
+
}): Exports & {
|
|
48
|
+
$set?: any;
|
|
49
|
+
$on?: any;
|
|
50
|
+
};
|
|
51
|
+
z_$$bindings?: Bindings;
|
|
52
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Button from './Button.svelte';
|
|
3
|
+
import BaseText from '../Base/BaseText.svelte';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @type {Array<{id?: string, label: string, icon?: string, type?: 'tab' | 'separator'}>}
|
|
7
|
+
*/
|
|
8
|
+
export let tabs = [];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
export let activeTab = '';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @type {(tabId: string) => void}
|
|
17
|
+
*/
|
|
18
|
+
export let onTabChange = () => {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} tabId
|
|
22
|
+
*/
|
|
23
|
+
function selectTab(tabId) {
|
|
24
|
+
activeTab = tabId;
|
|
25
|
+
onTabChange(tabId);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {number} index - The index in the full tabs array
|
|
30
|
+
*/
|
|
31
|
+
function getCornerRadius(index) {
|
|
32
|
+
// Check if previous item is a separator or start of array
|
|
33
|
+
const prevItem = tabs[index - 1];
|
|
34
|
+
const isFirstInGroup = index === 0 || prevItem?.type === 'separator';
|
|
35
|
+
|
|
36
|
+
// Check if next item is a separator or end of array
|
|
37
|
+
const nextItem = tabs[index + 1];
|
|
38
|
+
const isLastInGroup = index === tabs.length - 1 || nextItem?.type === 'separator';
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
topLeft: isFirstInGroup ? '25px' : '18px',
|
|
42
|
+
topRight: isFirstInGroup ? '25px' : '18px',
|
|
43
|
+
bottomLeft: isLastInGroup ? '25px' : '18px',
|
|
44
|
+
bottomRight: isLastInGroup ? '25px' : '18px'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Group tabs into categories based on separators
|
|
50
|
+
* @typedef {{label: string | null, tabs: Array<{tab: {id?: string, label: string, icon?: string, type?: 'tab' | 'separator'}, originalIndex: number}>}} Category
|
|
51
|
+
* @type {Category[]}
|
|
52
|
+
*/
|
|
53
|
+
$: categories = tabs.reduce((/** @type {Category[]} */ acc, tab, index) => {
|
|
54
|
+
if (tab.type === 'separator') {
|
|
55
|
+
acc.push({ label: tab.label, tabs: [] });
|
|
56
|
+
} else {
|
|
57
|
+
if (acc.length === 0) {
|
|
58
|
+
acc.push({ label: null, tabs: [] });
|
|
59
|
+
}
|
|
60
|
+
acc[acc.length - 1].tabs.push({ tab, originalIndex: index });
|
|
61
|
+
}
|
|
62
|
+
return acc;
|
|
63
|
+
}, /** @type {Category[]} */ ([]));
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<div class="tab-bar">
|
|
67
|
+
{#each categories as category}
|
|
68
|
+
<div class="category">
|
|
69
|
+
{#if category.label}
|
|
70
|
+
<div class="separator">
|
|
71
|
+
<BaseText variant="content">{category.label}</BaseText>
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
<div class="category-buttons">
|
|
75
|
+
{#each category.tabs as {tab, originalIndex}}
|
|
76
|
+
{@const corners = getCornerRadius(originalIndex)}
|
|
77
|
+
<div class="tab-button">
|
|
78
|
+
<Button
|
|
79
|
+
theme={activeTab === tab.id ? 'primary' : 'secondary'}
|
|
80
|
+
icon={tab.icon}
|
|
81
|
+
actionIcon={null}
|
|
82
|
+
borderRadiusTopLeft={corners.topLeft}
|
|
83
|
+
borderRadiusTopRight={corners.topRight}
|
|
84
|
+
borderRadiusBottomLeft={corners.bottomLeft}
|
|
85
|
+
borderRadiusBottomRight={corners.bottomRight}
|
|
86
|
+
on:click={() => tab.id && selectTab(tab.id)}
|
|
87
|
+
>
|
|
88
|
+
{tab.label}
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
{/each}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
{/each}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<style>
|
|
98
|
+
.tab-bar {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
gap: 1rem;
|
|
102
|
+
width: 250px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.category {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.category-buttons {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 4px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.tab-button {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.separator {
|
|
121
|
+
opacity: 0.6;
|
|
122
|
+
padding-bottom: 1rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.tab-button :global(button) {
|
|
126
|
+
width: 100%;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default TabBar;
|
|
2
|
+
type TabBar = SvelteComponent<{
|
|
3
|
+
tabs?: {
|
|
4
|
+
id?: string | undefined;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string | undefined;
|
|
7
|
+
type?: "separator" | "tab" | undefined;
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
activeTab?: string | undefined;
|
|
10
|
+
onTabChange?: ((tabId: string) => void) | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> & {
|
|
14
|
+
$$bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
declare const TabBar: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
tabs?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
type?: "tab" | "separator";
|
|
22
|
+
}[] | undefined;
|
|
23
|
+
activeTab?: string | undefined;
|
|
24
|
+
onTabChange?: ((tabId: string) => void) | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {}, {}, string>;
|
|
28
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
29
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
30
|
+
$$bindings?: Bindings;
|
|
31
|
+
} & Exports;
|
|
32
|
+
(internal: unknown, props: Props & {
|
|
33
|
+
$$events?: Events;
|
|
34
|
+
$$slots?: Slots;
|
|
35
|
+
}): Exports & {
|
|
36
|
+
$set?: any;
|
|
37
|
+
$on?: any;
|
|
38
|
+
};
|
|
39
|
+
z_$$bindings?: Bindings;
|
|
40
|
+
}
|