@x33025/sveltely 0.1.24 → 0.1.25
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/actions/LoaderOverlay.svelte +10 -3
- package/dist/components/Library/Accordion/Accordion.demo.svelte +21 -0
- package/dist/components/Library/Accordion/Accordion.demo.svelte.d.ts +9 -0
- package/dist/components/Library/Accordion/Accordion.svelte +78 -0
- package/dist/components/Library/Accordion/Accordion.svelte.d.ts +14 -0
- package/dist/components/Library/Accordion/Content.svelte +57 -0
- package/dist/components/Library/Accordion/Content.svelte.d.ts +8 -0
- package/dist/components/Library/Accordion/Header.svelte +98 -0
- package/dist/components/Library/Accordion/Header.svelte.d.ts +10 -0
- package/dist/components/Library/Accordion/context.d.ts +9 -0
- package/dist/components/Library/Accordion/context.js +6 -0
- package/dist/components/Library/Accordion/index.d.ts +9 -0
- package/dist/components/Library/Accordion/index.js +7 -0
- package/dist/components/Library/AnimatedNumber/AnimatedNumber.demo.svelte +1 -1
- package/dist/components/Library/ArticleEditor/ArticleEditor.svelte +1 -2
- package/dist/components/Library/ArticleEditor/Blocks/Table.svelte +1 -1
- package/dist/components/Library/ChipInput/ChipInput.demo.svelte +1 -1
- package/dist/components/Library/Dropdown/Dropdown.demo.svelte +5 -3
- package/dist/components/Library/Grid/Grid.demo.svelte +58 -0
- package/dist/components/Library/Grid/Grid.demo.svelte.d.ts +25 -0
- package/dist/components/Library/Grid/Grid.svelte +120 -26
- package/dist/components/Library/Grid/Grid.svelte.d.ts +38 -10
- package/dist/components/Library/Grid/GridItem.svelte +8 -13
- package/dist/components/Library/ImageMask/ImageMask.demo.svelte +1 -1
- package/dist/components/Library/Label/Label.demo.svelte +1 -1
- package/dist/components/Library/Label/Label.svelte +5 -13
- package/dist/components/Library/Notifications/Notifications.demo.svelte +63 -0
- package/dist/components/Library/Notifications/Notifications.demo.svelte.d.ts +9 -0
- package/dist/components/Library/Notifications/Notifications.svelte +155 -0
- package/dist/components/Library/Notifications/Notifications.svelte.d.ts +35 -0
- package/dist/components/Library/Notifications/index.d.ts +2 -0
- package/dist/components/Library/Notifications/index.js +1 -0
- package/dist/components/Library/Notifications/types.d.ts +8 -0
- package/dist/components/Library/Notifications/types.js +1 -0
- package/dist/components/Library/NumberField/NumberField.svelte +25 -19
- package/dist/components/Library/Pagination/Pagination.svelte +6 -18
- package/dist/components/Library/ScrollView/ScrollView.svelte +76 -4
- package/dist/components/Library/ScrollView/ScrollView.svelte.d.ts +9 -2
- package/dist/components/Library/ScrollView/index.d.ts +1 -1
- package/dist/components/Library/SearchField/SearchField.demo.svelte +1 -1
- package/dist/components/Library/SegmentedPicker/SegmentedPicker.demo.svelte +1 -1
- package/dist/components/Library/Slider/Slider.demo.svelte +1 -1
- package/dist/components/Library/Table/Table.demo.svelte +9 -1
- package/dist/components/Library/Table/Table.svelte +315 -112
- package/dist/components/Library/Table/Table.svelte.d.ts +7 -1
- package/dist/components/Library/TextField/TextField.svelte +20 -14
- package/dist/components/Library/TokenSearchField/TokenSearchField.demo.svelte +1 -1
- package/dist/components/Local/ColorStyleControls.svelte +25 -64
- package/dist/components/Local/ComponentGrid.svelte +103 -22
- package/dist/components/Local/ComponentGrid.svelte.d.ts +2 -1
- package/dist/components/Local/ComponentPage.svelte +74 -0
- package/dist/components/Local/ComponentPage.svelte.d.ts +13 -0
- package/dist/components/Local/HeroCard.svelte +10 -5
- package/dist/components/Local/LayoutStyleControls.svelte +6 -6
- package/dist/index.d.ts +8 -3
- package/dist/index.js +4 -1
- package/dist/style/index.css +1 -2
- package/dist/style/layout.d.ts +11 -26
- package/dist/style/layout.js +31 -53
- package/dist/style.css +4 -1
- package/dist/viewport/geometry.d.ts +8 -0
- package/dist/viewport/geometry.js +43 -0
- package/dist/viewport/index.d.ts +4 -0
- package/dist/viewport/index.js +4 -0
- package/dist/viewport/layout.d.ts +4 -0
- package/dist/viewport/layout.js +138 -0
- package/dist/viewport/placement.d.ts +4 -0
- package/dist/viewport/placement.js +14 -0
- package/dist/viewport/types.d.ts +81 -0
- package/dist/viewport/types.js +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Divider from '../Library/Divider';
|
|
3
3
|
import HStack from '../Library/HStack';
|
|
4
4
|
import Label from '../Library/Label';
|
|
5
|
+
import Spacer from '../Library/Spacer';
|
|
5
6
|
import VStack from '../Library/VStack';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
@@ -29,14 +30,9 @@
|
|
|
29
30
|
|
|
30
31
|
<VStack gap={5}>
|
|
31
32
|
<Label label="Text colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
|
|
32
|
-
<Label
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
width="100%"
|
|
36
|
-
align="center"
|
|
37
|
-
gap={5}
|
|
38
|
-
>
|
|
39
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
33
|
+
<Label label="Text primary" orientation="leading" width="100%" gap={5}>
|
|
34
|
+
<HStack width="100%" gap={5}>
|
|
35
|
+
<Spacer />
|
|
40
36
|
<span class="text-[var(--sveltely-text-secondary-color)]">{textPrimaryColor}</span>
|
|
41
37
|
<input
|
|
42
38
|
bind:value={textPrimaryColor}
|
|
@@ -46,14 +42,9 @@
|
|
|
46
42
|
/>
|
|
47
43
|
</HStack>
|
|
48
44
|
</Label>
|
|
49
|
-
<Label
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
width="100%"
|
|
53
|
-
align="center"
|
|
54
|
-
gap={5}
|
|
55
|
-
>
|
|
56
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
45
|
+
<Label label="Text secondary" orientation="leading" width="100%" gap={5}>
|
|
46
|
+
<HStack width="100%" gap={5}>
|
|
47
|
+
<Spacer />
|
|
57
48
|
<span class="text-[var(--sveltely-text-secondary-color)]">{textSecondaryColor}</span>
|
|
58
49
|
<input
|
|
59
50
|
bind:value={textSecondaryColor}
|
|
@@ -63,14 +54,9 @@
|
|
|
63
54
|
/>
|
|
64
55
|
</HStack>
|
|
65
56
|
</Label>
|
|
66
|
-
<Label
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
width="100%"
|
|
70
|
-
align="center"
|
|
71
|
-
gap={5}
|
|
72
|
-
>
|
|
73
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
57
|
+
<Label label="Text tertiary" orientation="leading" width="100%" gap={5}>
|
|
58
|
+
<HStack width="100%" gap={5}>
|
|
59
|
+
<Spacer />
|
|
74
60
|
<span class="text-[var(--sveltely-text-secondary-color)]">{textTertiaryColor}</span>
|
|
75
61
|
<input
|
|
76
62
|
bind:value={textTertiaryColor}
|
|
@@ -82,14 +68,9 @@
|
|
|
82
68
|
</Label>
|
|
83
69
|
<Divider />
|
|
84
70
|
<Label label="Surface colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
|
|
85
|
-
<Label
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
width="100%"
|
|
89
|
-
align="center"
|
|
90
|
-
gap={5}
|
|
91
|
-
>
|
|
92
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
71
|
+
<Label label="Background color" orientation="leading" width="100%" gap={5}>
|
|
72
|
+
<HStack width="100%" gap={5}>
|
|
73
|
+
<Spacer />
|
|
93
74
|
<span class="text-[var(--sveltely-text-secondary-color)]">{backgroundColor}</span>
|
|
94
75
|
<input
|
|
95
76
|
bind:value={backgroundColor}
|
|
@@ -99,28 +80,18 @@
|
|
|
99
80
|
/>
|
|
100
81
|
</HStack>
|
|
101
82
|
</Label>
|
|
102
|
-
<Label
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
width="100%"
|
|
106
|
-
align="center"
|
|
107
|
-
gap={5}
|
|
108
|
-
>
|
|
109
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
83
|
+
<Label label="Border color" orientation="leading" width="100%" gap={5}>
|
|
84
|
+
<HStack width="100%" gap={5}>
|
|
85
|
+
<Spacer />
|
|
110
86
|
<span class="text-[var(--sveltely-text-secondary-color)]">{borderColor}</span>
|
|
111
87
|
<input bind:value={borderColor} type="color" aria-label="Border color" class="color-input" />
|
|
112
88
|
</HStack>
|
|
113
89
|
</Label>
|
|
114
90
|
<Divider />
|
|
115
91
|
<Label label="Control colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
|
|
116
|
-
<Label
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
width="100%"
|
|
120
|
-
align="center"
|
|
121
|
-
gap={5}
|
|
122
|
-
>
|
|
123
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
92
|
+
<Label label="Control active" orientation="leading" width="100%" gap={5}>
|
|
93
|
+
<HStack width="100%" gap={5}>
|
|
94
|
+
<Spacer />
|
|
124
95
|
<span class="text-[var(--sveltely-text-secondary-color)]">{controlActiveColor}</span>
|
|
125
96
|
<input
|
|
126
97
|
bind:value={controlActiveColor}
|
|
@@ -130,14 +101,9 @@
|
|
|
130
101
|
/>
|
|
131
102
|
</HStack>
|
|
132
103
|
</Label>
|
|
133
|
-
<Label
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
width="100%"
|
|
137
|
-
align="center"
|
|
138
|
-
gap={5}
|
|
139
|
-
>
|
|
140
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
104
|
+
<Label label="Control background" orientation="leading" width="100%" gap={5}>
|
|
105
|
+
<HStack width="100%" gap={5}>
|
|
106
|
+
<Spacer />
|
|
141
107
|
<span class="text-[var(--sveltely-text-secondary-color)]">{controlBackgroundColor}</span>
|
|
142
108
|
<input
|
|
143
109
|
bind:value={controlBackgroundColor}
|
|
@@ -147,14 +113,9 @@
|
|
|
147
113
|
/>
|
|
148
114
|
</HStack>
|
|
149
115
|
</Label>
|
|
150
|
-
<Label
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
width="100%"
|
|
154
|
-
align="center"
|
|
155
|
-
gap={5}
|
|
156
|
-
>
|
|
157
|
-
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
116
|
+
<Label label="Control inactive" orientation="leading" width="100%" gap={5}>
|
|
117
|
+
<HStack width="100%" gap={5}>
|
|
118
|
+
<Spacer />
|
|
158
119
|
<span class="text-[var(--sveltely-text-secondary-color)]">{controlInactiveColor}</span>
|
|
159
120
|
<input
|
|
160
121
|
bind:value={controlInactiveColor}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { tick } from 'svelte';
|
|
2
3
|
import type { Component } from 'svelte';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import ScrollView, {
|
|
5
|
+
type ScrollGeometry,
|
|
6
|
+
type ScrollViewHandle
|
|
7
|
+
} from '../Library/ScrollView';
|
|
8
|
+
import ComponentPage, { type ComponentPageEntry } from './ComponentPage.svelte';
|
|
7
9
|
|
|
8
|
-
type DemoEntry = {
|
|
10
|
+
type DemoEntry = ComponentPageEntry & {
|
|
9
11
|
component: Component;
|
|
10
12
|
name: string;
|
|
11
13
|
description: string;
|
|
@@ -18,23 +20,102 @@
|
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
let { demos }: Props = $props();
|
|
23
|
+
|
|
24
|
+
let viewport = $state<ScrollViewHandle | null>(null);
|
|
25
|
+
let page = $state(1);
|
|
26
|
+
let pageHeight = $state(0);
|
|
27
|
+
let snapTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
28
|
+
let snapReleaseTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
29
|
+
let snapping = $state(false);
|
|
30
|
+
|
|
31
|
+
const totalPages = $derived(Math.max(1, demos.length));
|
|
32
|
+
const safePage = $derived(Math.min(Math.max(page, 1), totalPages));
|
|
33
|
+
const pagePeek = $derived(pageHeight <= 0 ? 0 : Math.min(72, Math.max(32, pageHeight * 0.08)));
|
|
34
|
+
const pageStep = $derived(Math.max(1, pageHeight - pagePeek * 2));
|
|
35
|
+
|
|
36
|
+
const clampPage = (nextPage: number) => Math.min(Math.max(nextPage, 1), totalPages);
|
|
37
|
+
|
|
38
|
+
const scrollToPage = async (nextPage: number) => {
|
|
39
|
+
const clamped = clampPage(nextPage);
|
|
40
|
+
if (snapTimeout) {
|
|
41
|
+
clearTimeout(snapTimeout);
|
|
42
|
+
snapTimeout = null;
|
|
43
|
+
}
|
|
44
|
+
page = clamped;
|
|
45
|
+
await tick();
|
|
46
|
+
const height = viewport?.clientHeight || pageHeight;
|
|
47
|
+
if (!viewport || height <= 0) return;
|
|
48
|
+
snapping = true;
|
|
49
|
+
viewport.scrollTo({ top: (clamped - 1) * pageStep, left: 0, behavior: 'smooth' });
|
|
50
|
+
if (snapReleaseTimeout) clearTimeout(snapReleaseTimeout);
|
|
51
|
+
snapReleaseTimeout = setTimeout(() => {
|
|
52
|
+
snapping = false;
|
|
53
|
+
snapReleaseTimeout = null;
|
|
54
|
+
}, 320);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const schedulePageSnap = (nextPage: number) => {
|
|
58
|
+
if (snapTimeout) clearTimeout(snapTimeout);
|
|
59
|
+
snapTimeout = setTimeout(() => {
|
|
60
|
+
snapTimeout = null;
|
|
61
|
+
void scrollToPage(nextPage);
|
|
62
|
+
}, 120);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleScroll = (geometry: ScrollGeometry) => {
|
|
66
|
+
pageHeight = geometry.viewport.height;
|
|
67
|
+
if (geometry.viewport.height <= 0) return;
|
|
68
|
+
const nextPage = clampPage(Math.round(geometry.offset.y / pageStep) + 1);
|
|
69
|
+
if (nextPage !== page) page = nextPage;
|
|
70
|
+
if (snapping) return;
|
|
71
|
+
const targetOffset = (nextPage - 1) * pageStep;
|
|
72
|
+
if (Math.abs(geometry.offset.y - targetOffset) > 1) {
|
|
73
|
+
schedulePageSnap(nextPage);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
$effect(() => {
|
|
78
|
+
if (page === safePage) return;
|
|
79
|
+
page = safePage;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
$effect(() => {
|
|
83
|
+
return () => {
|
|
84
|
+
if (snapTimeout) clearTimeout(snapTimeout);
|
|
85
|
+
if (snapReleaseTimeout) clearTimeout(snapReleaseTimeout);
|
|
86
|
+
};
|
|
87
|
+
});
|
|
21
88
|
</script>
|
|
22
89
|
|
|
23
|
-
<ScrollView
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
90
|
+
<ScrollView
|
|
91
|
+
bind:viewport
|
|
92
|
+
width="100%"
|
|
93
|
+
height="100%"
|
|
94
|
+
onScroll={handleScroll}
|
|
95
|
+
contentStyles={{
|
|
96
|
+
paddingX: 0,
|
|
97
|
+
paddingY: 0
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
{#each demos as entry, index (entry.name)}
|
|
101
|
+
<div
|
|
102
|
+
class="component-page-slot"
|
|
103
|
+
class:component-page-slot-active={index + 1 === page}
|
|
104
|
+
style:height={`${index === demos.length - 1 ? pageHeight : pageStep}px`}
|
|
105
|
+
>
|
|
106
|
+
<ComponentPage {entry} height={pageHeight} />
|
|
107
|
+
</div>
|
|
108
|
+
{/each}
|
|
40
109
|
</ScrollView>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
.component-page-slot {
|
|
113
|
+
position: relative;
|
|
114
|
+
z-index: 1;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.component-page-slot-active {
|
|
119
|
+
z-index: 2;
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export type ComponentPageEntry = {
|
|
5
|
+
component: Component;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
entry: ComponentPageEntry;
|
|
12
|
+
height?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let { entry, height }: Props = $props();
|
|
16
|
+
|
|
17
|
+
const DemoComponent = $derived(entry.component);
|
|
18
|
+
const pageStyle = $derived(height ? `height: ${height}px;` : '');
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<article class="component-page" style={pageStyle}>
|
|
22
|
+
<header class="component-page-header">
|
|
23
|
+
<h1>{entry.name}</h1>
|
|
24
|
+
{#if entry.description}
|
|
25
|
+
<p>{entry.description}</p>
|
|
26
|
+
{/if}
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
<section class="component-page-stage" aria-label={`${entry.name} demo`}>
|
|
30
|
+
<DemoComponent />
|
|
31
|
+
</section>
|
|
32
|
+
</article>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
.component-page {
|
|
36
|
+
display: flex;
|
|
37
|
+
min-height: min(42rem, calc(100svh - 8rem));
|
|
38
|
+
min-width: 0;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: var(--sveltely-gap);
|
|
41
|
+
padding: calc(var(--sveltely-padding-y) * 2) calc(var(--sveltely-padding-x) * 2);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.component-page-header {
|
|
45
|
+
display: grid;
|
|
46
|
+
gap: calc(var(--sveltely-gap) * 0.5);
|
|
47
|
+
min-width: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h1 {
|
|
51
|
+
color: var(--sveltely-text-primary-color);
|
|
52
|
+
font-size: calc(var(--sveltely-font-size) * 1.6);
|
|
53
|
+
font-weight: 650;
|
|
54
|
+
line-height: 1.1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
p {
|
|
58
|
+
max-width: 48rem;
|
|
59
|
+
color: var(--sveltely-text-secondary-color);
|
|
60
|
+
font-size: calc(var(--sveltely-font-size) * 0.95);
|
|
61
|
+
line-height: 1.45;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.component-page-stage {
|
|
65
|
+
display: grid;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
min-height: 0;
|
|
68
|
+
flex: 1 1 0;
|
|
69
|
+
place-items: center;
|
|
70
|
+
overflow: auto;
|
|
71
|
+
background: var(--sveltely-background-color);
|
|
72
|
+
padding: calc(var(--sveltely-padding-y) * 2) calc(var(--sveltely-padding-x) * 2);
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
export type ComponentPageEntry = {
|
|
3
|
+
component: Component;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
entry: ComponentPageEntry;
|
|
9
|
+
height?: number;
|
|
10
|
+
};
|
|
11
|
+
declare const ComponentPage: Component<Props, {}, "">;
|
|
12
|
+
type ComponentPage = ReturnType<typeof ComponentPage>;
|
|
13
|
+
export default ComponentPage;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import HStack from '../Library/HStack';
|
|
4
3
|
import VStack from '../Library/VStack';
|
|
5
4
|
|
|
6
5
|
type Props = {
|
|
@@ -13,9 +12,7 @@
|
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
<VStack
|
|
16
|
-
minHeight={14}
|
|
17
15
|
height="100%"
|
|
18
|
-
align="stretch"
|
|
19
16
|
gap={5}
|
|
20
17
|
border="1px solid var(--sveltely-border-color)"
|
|
21
18
|
borderRadius={7.5}
|
|
@@ -33,9 +30,9 @@
|
|
|
33
30
|
{/if}
|
|
34
31
|
<div class="hero-card-content">
|
|
35
32
|
{#if children}
|
|
36
|
-
<
|
|
33
|
+
<div class="hero-card-inner">
|
|
37
34
|
{@render children()}
|
|
38
|
-
</
|
|
35
|
+
</div>
|
|
39
36
|
{/if}
|
|
40
37
|
</div>
|
|
41
38
|
</VStack>
|
|
@@ -56,4 +53,12 @@
|
|
|
56
53
|
flex: 1 1 0;
|
|
57
54
|
overflow: hidden;
|
|
58
55
|
}
|
|
56
|
+
|
|
57
|
+
.hero-card-inner {
|
|
58
|
+
display: flex;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
}
|
|
59
64
|
</style>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<VStack width="100%" gap={5}>
|
|
27
27
|
<VStack width="100%" gap={5}>
|
|
28
|
-
<HStack width="100%"
|
|
28
|
+
<HStack width="100%" gap={7.5}>
|
|
29
29
|
<span class="font-medium">Font size</span>
|
|
30
30
|
<Spacer />
|
|
31
31
|
<span class="text-[var(--sveltely-text-secondary-color)]">{fontSize.toFixed(1)}</span>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<Slider bind:value={fontSize} min={5} max={20} step={0.5} />
|
|
34
34
|
</VStack>
|
|
35
35
|
<VStack width="100%" gap={5}>
|
|
36
|
-
<HStack width="100%"
|
|
36
|
+
<HStack width="100%" gap={7.5}>
|
|
37
37
|
<span class="font-medium">Border radius</span>
|
|
38
38
|
<Spacer />
|
|
39
39
|
<span class="text-[var(--sveltely-text-secondary-color)]">{borderRadius.toFixed(1)}</span>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<Slider bind:value={borderRadius} min={0} max={30} step={0.5} />
|
|
42
42
|
</VStack>
|
|
43
43
|
<VStack width="100%" gap={5}>
|
|
44
|
-
<HStack width="100%"
|
|
44
|
+
<HStack width="100%" gap={7.5}>
|
|
45
45
|
<span class="font-medium">Padding X</span>
|
|
46
46
|
<Spacer />
|
|
47
47
|
<span class="text-[var(--sveltely-text-secondary-color)]">{paddingX.toFixed(1)}</span>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<Slider bind:value={paddingX} min={0} max={20} step="any" />
|
|
50
50
|
</VStack>
|
|
51
51
|
<VStack width="100%" gap={5}>
|
|
52
|
-
<HStack width="100%"
|
|
52
|
+
<HStack width="100%" gap={7.5}>
|
|
53
53
|
<span class="font-medium">Padding Y</span>
|
|
54
54
|
<Spacer />
|
|
55
55
|
<span class="text-[var(--sveltely-text-secondary-color)]">{paddingY.toFixed(1)}</span>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<Slider bind:value={paddingY} min={0} max={20} step="any" />
|
|
58
58
|
</VStack>
|
|
59
59
|
<VStack width="100%" gap={5}>
|
|
60
|
-
<HStack width="100%"
|
|
60
|
+
<HStack width="100%" gap={7.5}>
|
|
61
61
|
<span class="font-medium">Gap</span>
|
|
62
62
|
<Spacer />
|
|
63
63
|
<span class="text-[var(--sveltely-text-secondary-color)]">{gap.toFixed(1)}</span>
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
<Slider bind:value={gap} min={0} max={20} step="any" />
|
|
66
66
|
</VStack>
|
|
67
67
|
<VStack width="100%" gap={5}>
|
|
68
|
-
<HStack width="100%"
|
|
68
|
+
<HStack width="100%" gap={7.5}>
|
|
69
69
|
<span class="font-medium">Inset</span>
|
|
70
70
|
<Spacer />
|
|
71
71
|
<span class="text-[var(--sveltely-text-secondary-color)]">{inset.toFixed(1)}</span>
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export type { TooltipOptions } from './actions/tooltip';
|
|
|
5
5
|
export { loader } from './actions/loader';
|
|
6
6
|
export type { LoaderOptions } from './actions/loader';
|
|
7
7
|
export type { LoaderProps } from './style/loader';
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
8
|
+
export { Axis, LayoutDimension } from './style/layout';
|
|
9
|
+
export type { AxisValue, LayoutAxis, LayoutAxisBehavior, LayoutDimensionValue, LayoutProps } from './style/layout';
|
|
10
10
|
export { LabelOrientation } from './style/label';
|
|
11
11
|
export type { LabelOrientationValue } from './style/label';
|
|
12
12
|
export { ImageFit, ImageLoading } from './style/media';
|
|
@@ -18,6 +18,9 @@ export type { TextAlignmentValue, TextAsValue, TextProps } from './style/text';
|
|
|
18
18
|
export { TextFieldType, TextInputMode } from './style/text-editor';
|
|
19
19
|
export type { TextEditorProps, TextFieldTypeValue, TextInputModeValue } from './style/text-editor';
|
|
20
20
|
export type { TooltipProps } from './style/tooltip';
|
|
21
|
+
export * from './viewport';
|
|
22
|
+
export { default as Accordion } from './components/Library/Accordion';
|
|
23
|
+
export type { AccordionState } from './components/Library/Accordion';
|
|
21
24
|
export { default as AnimatedNumber } from './components/Library/AnimatedNumber';
|
|
22
25
|
export * from './components/Library/ArticleEditor';
|
|
23
26
|
export { default as Button } from './components/Library/Button';
|
|
@@ -33,6 +36,8 @@ export type { ImageMaskValue } from './components/Library/ImageMask';
|
|
|
33
36
|
export { default as Label } from './components/Library/Label';
|
|
34
37
|
export { default as Link } from './components/Library/Link';
|
|
35
38
|
export { default as NavigationStack } from './components/Library/NavigationStack';
|
|
39
|
+
export { default as Notifications } from './components/Library/Notifications';
|
|
40
|
+
export type { NotificationItem, NotificationTone } from './components/Library/Notifications';
|
|
36
41
|
export { default as NumberField } from './components/Library/NumberField';
|
|
37
42
|
export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
|
|
38
43
|
export { default as Pagination } from './components/Library/Pagination';
|
|
@@ -59,6 +64,6 @@ export { default as Calendar } from './components/Library/Calendar';
|
|
|
59
64
|
export { default as AsyncButton } from './components/Library/AsyncButton';
|
|
60
65
|
export { default as SearchField } from './components/Library/SearchField';
|
|
61
66
|
export { default as ScrollView } from './components/Library/ScrollView';
|
|
62
|
-
export type { ScrollGeometry } from './components/Library/ScrollView';
|
|
67
|
+
export type { ScrollContentSize, ScrollGeometry, ScrollViewHandle, ScrollViewOverscrollBehavior } from './components/Library/ScrollView';
|
|
63
68
|
export { default as TokenSearchField } from './components/Library/TokenSearchField';
|
|
64
69
|
export { default as VStack } from './components/Library/VStack';
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,14 @@ export { motion, hover } from './actions/motion';
|
|
|
2
2
|
export { portalHost, portalContent } from './actions/portal';
|
|
3
3
|
export { tooltip } from './actions/tooltip';
|
|
4
4
|
export { loader } from './actions/loader';
|
|
5
|
-
export {
|
|
5
|
+
export { Axis, LayoutDimension } from './style/layout';
|
|
6
6
|
export { LabelOrientation } from './style/label';
|
|
7
7
|
export { ImageFit, ImageLoading } from './style/media';
|
|
8
8
|
export { ScrollAxis } from './style/scroll';
|
|
9
9
|
export { TextAlignment, TextAs } from './style/text';
|
|
10
10
|
export { TextFieldType, TextInputMode } from './style/text-editor';
|
|
11
|
+
export * from './viewport';
|
|
12
|
+
export { default as Accordion } from './components/Library/Accordion';
|
|
11
13
|
export { default as AnimatedNumber } from './components/Library/AnimatedNumber';
|
|
12
14
|
export * from './components/Library/ArticleEditor';
|
|
13
15
|
export { default as Button } from './components/Library/Button';
|
|
@@ -22,6 +24,7 @@ export { default as ImageMask } from './components/Library/ImageMask';
|
|
|
22
24
|
export { default as Label } from './components/Library/Label';
|
|
23
25
|
export { default as Link } from './components/Library/Link';
|
|
24
26
|
export { default as NavigationStack } from './components/Library/NavigationStack';
|
|
27
|
+
export { default as Notifications } from './components/Library/Notifications';
|
|
25
28
|
export { default as NumberField } from './components/Library/NumberField';
|
|
26
29
|
export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
|
|
27
30
|
export { default as Pagination } from './components/Library/Pagination';
|
package/dist/style/index.css
CHANGED
package/dist/style/layout.d.ts
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
type StringWithAutocomplete<T extends string> = T | (string & {});
|
|
2
|
+
export declare const Axis: {
|
|
3
|
+
readonly X: "x";
|
|
4
|
+
readonly Y: "y";
|
|
5
|
+
};
|
|
2
6
|
export declare const LayoutDimension: {
|
|
3
7
|
readonly infinity: "infinity";
|
|
4
8
|
};
|
|
5
|
-
export
|
|
6
|
-
readonly start: "start";
|
|
7
|
-
readonly center: "center";
|
|
8
|
-
readonly end: "end";
|
|
9
|
-
readonly stretch: "stretch";
|
|
10
|
-
readonly baseline: "baseline";
|
|
11
|
-
};
|
|
12
|
-
export declare const LayoutJustification: {
|
|
13
|
-
readonly start: "start";
|
|
14
|
-
readonly center: "center";
|
|
15
|
-
readonly end: "end";
|
|
16
|
-
};
|
|
9
|
+
export type AxisValue = (typeof Axis)[keyof typeof Axis];
|
|
17
10
|
export type LayoutDimensionValue = (typeof LayoutDimension)[keyof typeof LayoutDimension];
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
11
|
+
export type Axis = AxisValue;
|
|
12
|
+
export type LayoutAxis = Axis | Axis[];
|
|
13
|
+
export type LayoutAxisBehavior = boolean | LayoutAxis;
|
|
20
14
|
export type LayoutDimension = StringWithAutocomplete<LayoutDimensionValue> | number;
|
|
21
|
-
export type
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export type LayoutProps = {
|
|
16
|
+
grow?: LayoutAxisBehavior;
|
|
17
|
+
fit?: LayoutAxisBehavior;
|
|
24
18
|
width?: LayoutDimension;
|
|
25
19
|
height?: LayoutDimension;
|
|
26
|
-
minWidth?: LayoutDimension;
|
|
27
|
-
minHeight?: LayoutDimension;
|
|
28
|
-
maxWidth?: LayoutDimension;
|
|
29
|
-
maxHeight?: LayoutDimension;
|
|
30
|
-
};
|
|
31
|
-
export type StackProps = {
|
|
32
|
-
align?: LayoutAlignment;
|
|
33
|
-
justify?: LayoutJustification;
|
|
34
20
|
};
|
|
35
|
-
export type LayoutProps = FrameProps & StackProps;
|
|
36
21
|
export declare const extractLayoutProps: <T extends Record<string, unknown>>(props: T) => {
|
|
37
22
|
layoutProps: Partial<LayoutProps>;
|
|
38
23
|
restProps: Record<string, unknown>;
|