@x33025/sveltely 0.1.14 → 0.1.15
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 +1 -1
- package/dist/components/Library/ArticleEditor/ArticleEditor.svelte +4 -4
- package/dist/components/Library/ArticleEditor/ArticleEditorBody.svelte +1 -1
- package/dist/components/Library/ArticleEditor/ArticleEditorHeader.svelte +1 -1
- package/dist/components/Library/Button/Button.demo.svelte +1 -1
- package/dist/components/Library/Dropdown/Dropdown.demo.svelte +1 -1
- package/dist/components/Library/Label/Label.demo.svelte +1 -1
- package/dist/components/Library/Loader/Loader.demo.svelte +1 -1
- package/dist/components/Library/NavigationLink/NavigationLink.svelte +83 -0
- package/dist/components/Library/NavigationLink/NavigationLink.svelte.d.ts +13 -0
- package/dist/components/Library/NavigationLink/index.d.ts +1 -0
- package/dist/components/Library/NavigationLink/index.js +1 -0
- package/dist/components/Library/NavigationStack/NavigationStack.svelte +14 -4
- package/dist/components/Local/ComponentGrid.svelte +3 -3
- package/dist/components/Local/HeroCard.svelte +4 -4
- package/dist/components/Local/StyleControls.svelte +18 -18
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/style/index.css +11 -0
- package/dist/style/surface.d.ts +6 -6
- package/dist/style/surface.js +1 -1
- package/dist/style.css +11 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<div class="sveltely-loader-overlay" role="status" aria-live="polite" aria-label={text}>
|
|
13
|
-
<VStack align="center" justify="center" gap=
|
|
13
|
+
<VStack align="center" justify="center" gap={5}>
|
|
14
14
|
<Spinner />
|
|
15
15
|
<span class="sveltely-loader-text">{text}</span>
|
|
16
16
|
</VStack>
|
|
@@ -117,9 +117,9 @@
|
|
|
117
117
|
<VStack
|
|
118
118
|
width="100%"
|
|
119
119
|
maxWidth="860px"
|
|
120
|
-
gap=
|
|
121
|
-
paddingX=
|
|
122
|
-
paddingY=
|
|
120
|
+
gap={25}
|
|
121
|
+
paddingX={35}
|
|
122
|
+
paddingY={25}
|
|
123
123
|
background="var(--sveltely-background-color)"
|
|
124
124
|
>
|
|
125
125
|
<ArticleEditorHeader
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
|
|
160
160
|
{#if faqBlocks.length > 0}
|
|
161
161
|
<section class="article-editor-faq-section">
|
|
162
|
-
<VStack gap=
|
|
162
|
+
<VStack gap={12.5}>
|
|
163
163
|
{#each faqBlocks as block (block.id)}
|
|
164
164
|
<TextEditor
|
|
165
165
|
autosize
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
});
|
|
238
238
|
</script>
|
|
239
239
|
|
|
240
|
-
<VStack gap=
|
|
240
|
+
<VStack gap={5} paddingX={0} paddingY={0}>
|
|
241
241
|
{#each articleBlocks as block (block.id)}
|
|
242
242
|
{@const dropPlacement = dropPlacementFor(block.id)}
|
|
243
243
|
{@const textFormat = blockTextFormat(block)}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<ScrollView
|
|
31
31
|
background="color-mix(in oklab, var(--sveltely-background-color) 94%, var(--sveltely-primary-color))"
|
|
32
|
-
borderRadius=
|
|
32
|
+
borderRadius={7.5}
|
|
33
33
|
scrollGradient={false}
|
|
34
34
|
loader={{ text: 'Loading preview...', promise: pending }}
|
|
35
35
|
>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
4
|
+
import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
label?: string;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
} & StyleProps &
|
|
11
|
+
Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'> & {
|
|
12
|
+
class?: HTMLAnchorAttributes['class'];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let { children, label, active = false, class: className = '', ...restProps }: Props = $props();
|
|
16
|
+
|
|
17
|
+
const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
|
|
18
|
+
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
19
|
+
const props = $derived(extractedStyleProps.restProps);
|
|
20
|
+
const rootStyle = $derived.by(() => surfaceStyle(styleProps, 'navigation-link'));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<a
|
|
24
|
+
class="navigation-link {className}"
|
|
25
|
+
class:navigation-link-active={active}
|
|
26
|
+
style={rootStyle}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{#if children}
|
|
30
|
+
{@render children()}
|
|
31
|
+
{:else if label}
|
|
32
|
+
<span>{label}</span>
|
|
33
|
+
{/if}
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
<style>
|
|
37
|
+
.navigation-link {
|
|
38
|
+
--navigation-link-font-size: calc(var(--sveltely-font-size) * 0.875);
|
|
39
|
+
--navigation-link-scale: calc(var(--navigation-link-font-size) / 0.875rem);
|
|
40
|
+
--navigation-link-icon-size: calc(var(--navigation-link-font-size) * 1.143);
|
|
41
|
+
display: flex;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
align-items: center;
|
|
44
|
+
border-radius: var(--navigation-link-border-radius, var(--sveltely-border-radius));
|
|
45
|
+
color: var(--navigation-link-color, var(--sveltely-primary-color));
|
|
46
|
+
gap: var(--navigation-link-gap, var(--sveltely-gap));
|
|
47
|
+
font-size: var(--navigation-link-font-size);
|
|
48
|
+
line-height: 1.25;
|
|
49
|
+
padding: var(
|
|
50
|
+
--navigation-link-padding-y,
|
|
51
|
+
calc(var(--sveltely-padding-y) * 0.67 * var(--navigation-link-scale))
|
|
52
|
+
)
|
|
53
|
+
var(
|
|
54
|
+
--navigation-link-padding-x,
|
|
55
|
+
calc(var(--sveltely-padding-x) * var(--navigation-link-scale))
|
|
56
|
+
);
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
transition:
|
|
59
|
+
color 150ms,
|
|
60
|
+
background-color 150ms;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.navigation-link:hover,
|
|
64
|
+
.navigation-link-active {
|
|
65
|
+
background: var(--navigation-link-active-background, var(--sveltely-hover-color));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.navigation-link :global(svg) {
|
|
69
|
+
width: var(--navigation-link-icon-size);
|
|
70
|
+
height: var(--navigation-link-icon-size);
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.navigation-link :global(span) {
|
|
75
|
+
min-width: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.navigation-link > span {
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
|
+
import { type StyleProps } from '../../../style/surface';
|
|
4
|
+
type Props = {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
label?: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
} & StyleProps & Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'> & {
|
|
9
|
+
class?: HTMLAnchorAttributes['class'];
|
|
10
|
+
};
|
|
11
|
+
declare const NavigationLink: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type NavigationLink = ReturnType<typeof NavigationLink>;
|
|
13
|
+
export default NavigationLink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NavigationLink.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NavigationLink.svelte';
|
|
@@ -57,8 +57,10 @@
|
|
|
57
57
|
|
|
58
58
|
const shellStyle = $derived.by(() => {
|
|
59
59
|
const declarations = [
|
|
60
|
-
`--navigation-stack-left-width: ${left
|
|
61
|
-
`--navigation-stack-right-width: ${right
|
|
60
|
+
`--navigation-stack-left-width: ${left || leftHeader ? 'var(--navigation-stack-sidebar-width)' : '0px'};`,
|
|
61
|
+
`--navigation-stack-right-width: ${right || rightHeader ? 'var(--navigation-stack-sidebar-width)' : '0px'};`,
|
|
62
|
+
`--navigation-stack-center-margin-left: ${left && leftOpen ? 'var(--navigation-stack-left-width)' : '0px'};`,
|
|
63
|
+
`--navigation-stack-center-margin-right: ${right && rightOpen ? 'var(--navigation-stack-right-width)' : '0px'};`
|
|
62
64
|
];
|
|
63
65
|
const stylePropDeclarations = surfaceStyle(styleProps, 'navigation-stack');
|
|
64
66
|
if (stylePropDeclarations) declarations.push(stylePropDeclarations);
|
|
@@ -152,7 +154,6 @@
|
|
|
152
154
|
var(--navigation-stack-right-width);
|
|
153
155
|
grid-template-rows: auto minmax(0, 1fr);
|
|
154
156
|
overflow: hidden;
|
|
155
|
-
transition: grid-template-columns 300ms ease-in-out;
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
.navigation-stack-pane {
|
|
@@ -171,7 +172,15 @@
|
|
|
171
172
|
|
|
172
173
|
.navigation-stack-pane-center.navigation-stack-pane-header,
|
|
173
174
|
.navigation-stack-pane-center.navigation-stack-pane-body {
|
|
174
|
-
grid-column:
|
|
175
|
+
grid-column: 1 / 4;
|
|
176
|
+
margin-left: var(--navigation-stack-center-margin-left);
|
|
177
|
+
margin-right: var(--navigation-stack-center-margin-right);
|
|
178
|
+
z-index: 2;
|
|
179
|
+
transition:
|
|
180
|
+
margin-left 300ms ease-in-out,
|
|
181
|
+
margin-right 300ms ease-in-out,
|
|
182
|
+
border-color 300ms ease-in-out,
|
|
183
|
+
background-color 300ms ease-in-out;
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
.navigation-stack-pane-right.navigation-stack-pane-header,
|
|
@@ -202,6 +211,7 @@
|
|
|
202
211
|
}
|
|
203
212
|
|
|
204
213
|
.navigation-stack-content {
|
|
214
|
+
background: var(--sveltely-background-color);
|
|
205
215
|
overflow: auto;
|
|
206
216
|
}
|
|
207
217
|
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<Grid
|
|
24
24
|
columns="repeat(auto-fit, minmax(min(100%, 18rem), 1fr))"
|
|
25
25
|
autoRows={14}
|
|
26
|
-
gap={
|
|
27
|
-
paddingX=
|
|
28
|
-
paddingY=
|
|
26
|
+
gap={10}
|
|
27
|
+
paddingX={15}
|
|
28
|
+
paddingY={15}
|
|
29
29
|
>
|
|
30
30
|
{#each demos as entry (entry.name)}
|
|
31
31
|
{@const DemoComponent = entry.component}
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
height="100%"
|
|
18
18
|
shrink={0}
|
|
19
19
|
align="stretch"
|
|
20
|
-
gap={
|
|
20
|
+
gap={5}
|
|
21
21
|
border="1px solid var(--sveltely-border-color)"
|
|
22
|
-
borderRadius={
|
|
22
|
+
borderRadius={7.5}
|
|
23
23
|
background="var(--sveltely-background-color)"
|
|
24
|
-
paddingX={
|
|
25
|
-
paddingY={
|
|
24
|
+
paddingX={15}
|
|
25
|
+
paddingY={15}
|
|
26
26
|
>
|
|
27
27
|
{#if title}
|
|
28
28
|
<h1 class="text-3xl font-semibold tracking-tight text-[var(--sveltely-primary-color)]">
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
let {
|
|
20
|
-
fontSize = $bindable(
|
|
21
|
-
borderRadius = $bindable(
|
|
22
|
-
paddingX = $bindable(
|
|
23
|
-
paddingY = $bindable(
|
|
24
|
-
gap = $bindable(
|
|
25
|
-
inset = $bindable(
|
|
20
|
+
fontSize = $bindable(10),
|
|
21
|
+
borderRadius = $bindable(7.5),
|
|
22
|
+
paddingX = $bindable(7.5),
|
|
23
|
+
paddingY = $bindable(7.5),
|
|
24
|
+
gap = $bindable(5),
|
|
25
|
+
inset = $bindable(2.5),
|
|
26
26
|
borderColor = $bindable('#e4e4e7'),
|
|
27
27
|
primaryColor = $bindable('#18181b'),
|
|
28
28
|
secondaryColor = $bindable('#71717a'),
|
|
@@ -42,44 +42,44 @@
|
|
|
42
42
|
<div class="vstack gap-2">
|
|
43
43
|
<div class="hstack items-center justify-between gap-3">
|
|
44
44
|
<span class="font-medium">Font size</span>
|
|
45
|
-
<span class="text-[var(--sveltely-secondary-color)]">{fontSize.toFixed(
|
|
45
|
+
<span class="text-[var(--sveltely-secondary-color)]">{fontSize.toFixed(1)}</span>
|
|
46
46
|
</div>
|
|
47
|
-
<Slider bind:value={fontSize} min={
|
|
47
|
+
<Slider bind:value={fontSize} min={5} max={20} step={0.5} />
|
|
48
48
|
</div>
|
|
49
49
|
<div class="vstack gap-2">
|
|
50
50
|
<div class="hstack items-center justify-between gap-3">
|
|
51
51
|
<span class="font-medium">Border radius</span>
|
|
52
|
-
<span class="text-[var(--sveltely-secondary-color)]">{borderRadius.toFixed(
|
|
52
|
+
<span class="text-[var(--sveltely-secondary-color)]">{borderRadius.toFixed(1)}</span>
|
|
53
53
|
</div>
|
|
54
|
-
<Slider bind:value={borderRadius} min={0} max={
|
|
54
|
+
<Slider bind:value={borderRadius} min={0} max={30} step={0.5} />
|
|
55
55
|
</div>
|
|
56
56
|
<div class="vstack gap-2">
|
|
57
57
|
<div class="hstack items-center justify-between gap-3">
|
|
58
58
|
<span class="font-medium">Padding X</span>
|
|
59
|
-
<span class="text-[var(--sveltely-secondary-color)]">{paddingX.toFixed(
|
|
59
|
+
<span class="text-[var(--sveltely-secondary-color)]">{paddingX.toFixed(1)}</span>
|
|
60
60
|
</div>
|
|
61
|
-
<Slider bind:value={paddingX} min={0} max={
|
|
61
|
+
<Slider bind:value={paddingX} min={0} max={20} step="any" />
|
|
62
62
|
</div>
|
|
63
63
|
<div class="vstack gap-2">
|
|
64
64
|
<div class="hstack items-center justify-between gap-3">
|
|
65
65
|
<span class="font-medium">Padding Y</span>
|
|
66
|
-
<span class="text-[var(--sveltely-secondary-color)]">{paddingY.toFixed(
|
|
66
|
+
<span class="text-[var(--sveltely-secondary-color)]">{paddingY.toFixed(1)}</span>
|
|
67
67
|
</div>
|
|
68
|
-
<Slider bind:value={paddingY} min={0} max={
|
|
68
|
+
<Slider bind:value={paddingY} min={0} max={20} step="any" />
|
|
69
69
|
</div>
|
|
70
70
|
<div class="vstack gap-2">
|
|
71
71
|
<div class="hstack items-center justify-between gap-3">
|
|
72
72
|
<span class="font-medium">Gap</span>
|
|
73
|
-
<span class="text-[var(--sveltely-secondary-color)]">{gap.toFixed(
|
|
73
|
+
<span class="text-[var(--sveltely-secondary-color)]">{gap.toFixed(1)}</span>
|
|
74
74
|
</div>
|
|
75
|
-
<Slider bind:value={gap} min={0} max={
|
|
75
|
+
<Slider bind:value={gap} min={0} max={20} step="any" />
|
|
76
76
|
</div>
|
|
77
77
|
<div class="vstack gap-2">
|
|
78
78
|
<div class="hstack items-center justify-between gap-3">
|
|
79
79
|
<span class="font-medium">Inset</span>
|
|
80
|
-
<span class="text-[var(--sveltely-secondary-color)]">{inset.toFixed(
|
|
80
|
+
<span class="text-[var(--sveltely-secondary-color)]">{inset.toFixed(1)}</span>
|
|
81
81
|
</div>
|
|
82
|
-
<Slider bind:value={inset} min={0} max={
|
|
82
|
+
<Slider bind:value={inset} min={0} max={10} step="any" />
|
|
83
83
|
</div>
|
|
84
84
|
<div class="vstack gap-2">
|
|
85
85
|
<div class="hstack items-center justify-between gap-3">
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { default as Image } from './components/Library/Image';
|
|
|
27
27
|
export { default as ImageMask } from './components/Library/ImageMask';
|
|
28
28
|
export type { ImageMaskValue } from './components/Library/ImageMask';
|
|
29
29
|
export { default as Label } from './components/Library/Label';
|
|
30
|
+
export { default as NavigationLink } from './components/Library/NavigationLink';
|
|
30
31
|
export { default as NavigationStack } from './components/Library/NavigationStack';
|
|
31
32
|
export { default as NumberField } from './components/Library/NumberField';
|
|
32
33
|
export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { default as HStack } from './components/Library/HStack';
|
|
|
18
18
|
export { default as Image } from './components/Library/Image';
|
|
19
19
|
export { default as ImageMask } from './components/Library/ImageMask';
|
|
20
20
|
export { default as Label } from './components/Library/Label';
|
|
21
|
+
export { default as NavigationLink } from './components/Library/NavigationLink';
|
|
21
22
|
export { default as NavigationStack } from './components/Library/NavigationStack';
|
|
22
23
|
export { default as NumberField } from './components/Library/NumberField';
|
|
23
24
|
export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
|
package/dist/style/index.css
CHANGED
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
--sveltely-padding-x: 0.75rem;
|
|
13
13
|
--sveltely-padding-y: 0.75rem;
|
|
14
14
|
--sveltely-gap: 0.5rem;
|
|
15
|
+
--sveltely-scale-0: 0;
|
|
16
|
+
--sveltely-scale-1: 0.1;
|
|
17
|
+
--sveltely-scale-2: 0.2;
|
|
18
|
+
--sveltely-scale-3: 0.3;
|
|
19
|
+
--sveltely-scale-4: 0.4;
|
|
20
|
+
--sveltely-scale-5: 0.5;
|
|
21
|
+
--sveltely-scale-6: 0.6;
|
|
22
|
+
--sveltely-scale-7: 0.7;
|
|
23
|
+
--sveltely-scale-8: 0.8;
|
|
24
|
+
--sveltely-scale-9: 0.9;
|
|
25
|
+
--sveltely-scale-10: 1;
|
|
15
26
|
--sveltely-primary-color: var(--color-zinc-900);
|
|
16
27
|
--sveltely-secondary-color: var(--color-zinc-500);
|
|
17
28
|
--sveltely-active-color: var(--color-zinc-900);
|
package/dist/style/surface.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type StyleProps = {
|
|
2
|
-
fontSize?: number
|
|
3
|
-
paddingX?: number
|
|
4
|
-
paddingY?: number
|
|
5
|
-
gap?: number
|
|
6
|
-
borderRadius?: number
|
|
7
|
-
inset?: number
|
|
2
|
+
fontSize?: number;
|
|
3
|
+
paddingX?: number;
|
|
4
|
+
paddingY?: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
borderRadius?: number;
|
|
7
|
+
inset?: number;
|
|
8
8
|
background?: string;
|
|
9
9
|
borderColor?: string;
|
|
10
10
|
color?: string;
|
package/dist/style/surface.js
CHANGED
|
@@ -9,7 +9,7 @@ const STYLE_PROP_KEYS = new Set([
|
|
|
9
9
|
'borderColor',
|
|
10
10
|
'color'
|
|
11
11
|
]);
|
|
12
|
-
const toRem = (value) => value === undefined ? undefined :
|
|
12
|
+
const toRem = (value) => (value === undefined ? undefined : `${value / 10}rem`);
|
|
13
13
|
const pushVar = (declarations, name, value) => {
|
|
14
14
|
const resolved = toRem(value);
|
|
15
15
|
if (resolved === undefined)
|
package/dist/style.css
CHANGED
|
@@ -853,6 +853,17 @@
|
|
|
853
853
|
--sveltely-padding-x: 0.75rem;
|
|
854
854
|
--sveltely-padding-y: 0.75rem;
|
|
855
855
|
--sveltely-gap: 0.5rem;
|
|
856
|
+
--sveltely-scale-0: 0;
|
|
857
|
+
--sveltely-scale-1: 0.1;
|
|
858
|
+
--sveltely-scale-2: 0.2;
|
|
859
|
+
--sveltely-scale-3: 0.3;
|
|
860
|
+
--sveltely-scale-4: 0.4;
|
|
861
|
+
--sveltely-scale-5: 0.5;
|
|
862
|
+
--sveltely-scale-6: 0.6;
|
|
863
|
+
--sveltely-scale-7: 0.7;
|
|
864
|
+
--sveltely-scale-8: 0.8;
|
|
865
|
+
--sveltely-scale-9: 0.9;
|
|
866
|
+
--sveltely-scale-10: 1;
|
|
856
867
|
--sveltely-primary-color: var(--color-zinc-900);
|
|
857
868
|
--sveltely-secondary-color: var(--color-zinc-500);
|
|
858
869
|
--sveltely-active-color: var(--color-zinc-900);
|