@x33025/sveltely 0.1.17 → 0.1.19
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 +33 -8
- package/dist/actions/LoaderOverlay.svelte.d.ts +3 -0
- package/dist/actions/loader.d.ts +3 -0
- package/dist/actions/loader.js +20 -7
- package/dist/components/Library/AnimatedNumber/AnimatedNumber.demo.svelte +3 -9
- package/dist/components/Library/ArticleEditor/ArticleEditor.svelte +3 -3
- package/dist/components/Library/ArticleEditor/ArticleEditorBody.svelte +59 -74
- package/dist/components/Library/ArticleEditor/ArticleEditorHeader.svelte +21 -31
- package/dist/components/Library/ArticleEditor/{ArticleBlockCode.svelte → Blocks/Code.svelte} +2 -3
- package/dist/components/Library/ArticleEditor/Blocks/Code.svelte.d.ts +8 -0
- package/dist/components/Library/ArticleEditor/{ArticleBlockFAQ.svelte → Blocks/FAQ.svelte} +3 -3
- package/dist/components/Library/ArticleEditor/Blocks/FAQ.svelte.d.ts +8 -0
- package/dist/components/Library/ArticleEditor/{ArticleBlockHeading.svelte → Blocks/Heading.svelte} +9 -9
- package/dist/components/Library/ArticleEditor/{ArticleBlockHeading.svelte.d.ts → Blocks/Heading.svelte.d.ts} +4 -4
- package/dist/components/Library/ArticleEditor/Blocks/Image.svelte +32 -0
- package/dist/components/Library/ArticleEditor/Blocks/Image.svelte.d.ts +10 -0
- package/dist/components/Library/ArticleEditor/{ArticleBlockList.svelte → Blocks/List.svelte} +4 -4
- package/dist/components/Library/ArticleEditor/{ArticleBlockList.svelte.d.ts → Blocks/List.svelte.d.ts} +4 -4
- package/dist/components/Library/ArticleEditor/{ArticleBlockParagraph.svelte → Blocks/Paragraph.svelte} +3 -3
- package/dist/components/Library/ArticleEditor/{ArticleBlockFallback.svelte.d.ts → Blocks/Paragraph.svelte.d.ts} +4 -4
- package/dist/components/Library/ArticleEditor/{ArticleBlockTable.svelte → Blocks/Table.svelte} +1 -1
- package/dist/components/Library/ArticleEditor/{ArticleBlockTable.svelte.d.ts → Blocks/Table.svelte.d.ts} +4 -4
- package/dist/components/Library/ArticleEditor/Blocks/index.d.ts +7 -0
- package/dist/components/Library/ArticleEditor/Blocks/index.js +7 -0
- package/dist/components/Library/ArticleEditor/index.d.ts +1 -9
- package/dist/components/Library/ArticleEditor/index.js +1 -9
- package/dist/components/Library/AsyncButton/AsyncButton.demo.svelte +2 -6
- package/dist/components/Library/AsyncButton/AsyncButton.svelte +9 -5
- package/dist/components/Library/AsyncButton/AsyncButton.svelte.d.ts +2 -1
- package/dist/components/Library/Button/Button.demo.svelte +2 -17
- package/dist/components/Library/Button/Button.demo.svelte.d.ts +0 -1
- package/dist/components/Library/Button/Button.svelte +15 -16
- package/dist/components/Library/Button/Button.svelte.d.ts +2 -1
- package/dist/components/Library/Calendar/Calendar.svelte +17 -27
- package/dist/components/Library/Checkbox/Checkbox.demo.svelte +7 -4
- package/dist/components/Library/Checkbox/Checkbox.svelte +24 -61
- package/dist/components/Library/Checkbox/Checkbox.svelte.d.ts +2 -4
- package/dist/components/Library/ChipInput/ChipInput.demo.svelte +2 -2
- package/dist/components/Library/ChipInput/ChipInput.svelte +7 -11
- package/dist/components/Library/ChipInput/ChipInput.svelte.d.ts +3 -2
- package/dist/components/Library/Dropdown/Action.svelte +1 -1
- package/dist/components/Library/Dropdown/Dropdown.demo.svelte +10 -10
- package/dist/components/Library/Dropdown/Dropdown.svelte +2 -6
- package/dist/components/Library/Dropdown/Item.svelte +2 -2
- package/dist/components/Library/Dropdown/Section.svelte +1 -1
- package/dist/components/Library/Dropdown/Trigger.svelte +3 -7
- package/dist/components/Library/Image/Image.demo.svelte +3 -3
- package/dist/components/Library/Image/Image.svelte +57 -12
- package/dist/components/Library/Image/Image.svelte.d.ts +1 -2
- package/dist/components/Library/Image/ImagePlaceholder.demo.svelte +12 -0
- package/dist/components/Library/Image/ImagePlaceholder.demo.svelte.d.ts +23 -0
- package/dist/components/Library/Image/ImagePlaceholder.svelte +28 -4
- package/dist/components/Library/Image/ImagePlaceholder.svelte.d.ts +1 -1
- package/dist/components/Library/Image/index.d.ts +1 -0
- package/dist/components/Library/Image/index.js +1 -0
- package/dist/components/Library/ImageMask/BrushPreview.svelte +6 -6
- package/dist/components/Library/ImageMask/ImageMask.demo.svelte +10 -8
- package/dist/components/Library/ImageMask/ImageMask.svelte +14 -6
- package/dist/components/Library/ImageMask/ImageMask.svelte.d.ts +1 -2
- package/dist/components/Library/ImageMask/MaskLayer.svelte +12 -6
- package/dist/components/Library/Label/Label.demo.svelte +9 -3
- package/dist/components/Library/Label/Label.svelte +8 -2
- package/dist/components/Library/Link/Link.svelte +10 -22
- package/dist/components/Library/Link/Link.svelte.d.ts +2 -3
- package/dist/components/Library/Loader/Loader.demo.svelte +9 -3
- package/dist/components/Library/NavigationStack/Link.svelte +8 -12
- package/dist/components/Library/NavigationStack/Link.svelte.d.ts +1 -3
- package/dist/components/Library/NavigationStack/SidebarToggle.svelte +8 -2
- package/dist/components/Library/NumberField/NumberField.svelte +21 -17
- package/dist/components/Library/NumberField/NumberField.svelte.d.ts +4 -2
- package/dist/components/Library/Pagination/Pagination.svelte +3 -3
- package/dist/components/Library/Popover/Popover.svelte +2 -7
- package/dist/components/Library/ScrollView/ScrollView.demo.svelte +50 -0
- package/dist/components/Library/ScrollView/ScrollView.demo.svelte.d.ts +10 -0
- package/dist/components/Library/ScrollView/ScrollView.svelte +414 -67
- package/dist/components/Library/ScrollView/ScrollView.svelte.d.ts +17 -1
- package/dist/components/Library/ScrollView/index.d.ts +1 -1
- package/dist/components/Library/SearchField/SearchField.demo.svelte +2 -2
- package/dist/components/Library/SearchField/SearchField.svelte +9 -4
- package/dist/components/Library/SearchField/SearchField.svelte.d.ts +2 -1
- package/dist/components/Library/SegmentedPicker/SegmentedPicker.demo.svelte +2 -2
- package/dist/components/Library/SegmentedPicker/SegmentedPicker.svelte +7 -7
- package/dist/components/Library/Sheet/Sheet.demo.svelte +1 -1
- package/dist/components/Library/Sheet/Sheet.svelte +2 -7
- package/dist/components/Library/Slider/Slider.demo.svelte +1 -1
- package/dist/components/Library/Slider/Slider.svelte +11 -7
- package/dist/components/Library/Slider/Slider.svelte.d.ts +2 -1
- package/dist/components/Library/Spinner/Spinner.demo.svelte +1 -1
- package/dist/components/Library/Switch/Switch.demo.svelte +7 -4
- package/dist/components/Library/Switch/Switch.svelte +28 -68
- package/dist/components/Library/Switch/Switch.svelte.d.ts +2 -4
- package/dist/components/Library/Table/Column.svelte +81 -0
- package/dist/components/Library/Table/Column.svelte.d.ts +39 -0
- package/dist/components/Library/Table/Table.demo.svelte +148 -0
- package/dist/components/Library/Table/Table.demo.svelte.d.ts +10 -0
- package/dist/components/Library/Table/Table.svelte +624 -0
- package/dist/components/Library/Table/Table.svelte.d.ts +42 -0
- package/dist/components/Library/Table/context.d.ts +5 -0
- package/dist/components/Library/Table/context.js +2 -0
- package/dist/components/Library/Table/index.js +5 -0
- package/dist/components/Library/Table/types.d.ts +37 -0
- package/dist/components/Library/Table/types.js +1 -0
- package/dist/components/Library/Text/Text.demo.svelte +21 -0
- package/dist/components/Library/Text/Text.demo.svelte.d.ts +24 -0
- package/dist/components/Library/Text/Text.svelte +41 -0
- package/dist/components/Library/Text/Text.svelte.d.ts +9 -0
- package/dist/components/Library/Text/index.d.ts +1 -0
- package/dist/components/Library/Text/index.js +1 -0
- package/dist/components/Library/TextEditor/TextEditor.svelte +15 -9
- package/dist/components/Library/TextEditor/TextEditor.svelte.d.ts +2 -4
- package/dist/components/Library/TextField/TextField.demo.svelte +1 -1
- package/dist/components/Library/TextField/TextField.svelte +21 -18
- package/dist/components/Library/TextField/TextField.svelte.d.ts +4 -2
- package/dist/components/Library/TextShimmer/TextShimmer.demo.svelte +1 -1
- package/dist/components/Library/TimePicker/TimePicker.demo.svelte +10 -2
- package/dist/components/Library/TimePicker/TimePicker.svelte +10 -5
- package/dist/components/Library/TokenSearchField/TokenSearchField.demo.svelte +4 -2
- package/dist/components/Library/TokenSearchField/TokenSearchField.svelte +11 -11
- package/dist/components/Library/TokenSearchField/TokenSearchField.svelte.d.ts +2 -1
- package/dist/components/Library/WheelPicker/WheelColumn.svelte +183 -126
- package/dist/components/Library/WheelPicker/WheelPicker.svelte +4 -4
- package/dist/components/Library/WheelPicker/WheelPicker.svelte.d.ts +2 -2
- package/dist/components/Library/WheelPicker/index.d.ts +1 -1
- package/dist/components/Library/WheelPicker/types.d.ts +6 -0
- package/dist/components/Local/ColorStyleControls.svelte +201 -0
- package/dist/components/Local/ColorStyleControls.svelte.d.ts +13 -0
- package/dist/components/Local/HeroCard.svelte +3 -3
- package/dist/components/Local/LayoutStyleControls.svelte +67 -0
- package/dist/components/Local/LayoutStyleControls.svelte.d.ts +11 -0
- package/dist/components/Local/StyleControls.svelte +48 -124
- package/dist/components/Local/StyleControls.svelte.d.ts +7 -5
- package/dist/index.d.ts +9 -2
- package/dist/index.js +5 -1
- package/dist/style/index.css +7 -12
- package/dist/style/label.d.ts +2 -1
- package/dist/style/label.js +2 -1
- package/dist/style/surface.js +4 -0
- package/dist/style/text-editor.d.ts +2 -13
- package/dist/style/text-editor.js +1 -12
- package/dist/style/text.d.ts +26 -0
- package/dist/style/text.js +69 -0
- package/dist/style/tooltip.d.ts +4 -0
- package/dist/style/tooltip.js +1 -0
- package/dist/style.css +41 -114
- package/package.json +1 -1
- package/dist/components/Library/ArticleEditor/ArticleBlockCode.svelte.d.ts +0 -8
- package/dist/components/Library/ArticleEditor/ArticleBlockFAQ.svelte.d.ts +0 -8
- package/dist/components/Library/ArticleEditor/ArticleBlockFallback.svelte +0 -79
- package/dist/components/Library/ArticleEditor/ArticleBlockImage.svelte +0 -48
- package/dist/components/Library/ArticleEditor/ArticleBlockImage.svelte.d.ts +0 -9
- package/dist/components/Library/ArticleEditor/ArticleBlockParagraph.svelte.d.ts +0 -15
- package/dist/components/Library/ArticleEditor/ArticleImagePreview.svelte +0 -71
- package/dist/components/Library/ArticleEditor/ArticleImagePreview.svelte.d.ts +0 -8
|
@@ -130,6 +130,11 @@
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function drawOutlineSurface() {
|
|
133
|
+
if (isDrawing) {
|
|
134
|
+
outlineContext?.clearRect(0, 0, viewportWidth, viewportHeight);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
133
138
|
drawMarchingAnts({
|
|
134
139
|
context: outlineContext,
|
|
135
140
|
contours,
|
|
@@ -144,14 +149,14 @@
|
|
|
144
149
|
drawOutlineSurface();
|
|
145
150
|
context.clearRect(0, 0, viewportWidth, viewportHeight);
|
|
146
151
|
if (!surfaceCanvas) return;
|
|
147
|
-
const
|
|
148
|
-
? getComputedStyle(canvas).getPropertyValue('--sveltely-active-color').trim() ||
|
|
149
|
-
'var(--sveltely-active-color)'
|
|
150
|
-
: 'var(--sveltely-active-color)';
|
|
152
|
+
const maskColor = canvas
|
|
153
|
+
? getComputedStyle(canvas).getPropertyValue('--sveltely-control-active-color').trim() ||
|
|
154
|
+
'var(--sveltely-control-active-color)'
|
|
155
|
+
: 'var(--sveltely-control-active-color)';
|
|
151
156
|
context.save();
|
|
152
157
|
context.drawImage(surfaceCanvas, 0, 0, viewportWidth, viewportHeight);
|
|
153
158
|
context.globalCompositeOperation = 'source-in';
|
|
154
|
-
context.fillStyle =
|
|
159
|
+
context.fillStyle = maskColor;
|
|
155
160
|
context.globalAlpha = 0.32;
|
|
156
161
|
context.fillRect(0, 0, viewportWidth, viewportHeight);
|
|
157
162
|
context.restore();
|
|
@@ -160,7 +165,7 @@
|
|
|
160
165
|
context.save();
|
|
161
166
|
context.drawImage(outlineCanvas, 0, 0, viewportWidth, viewportHeight);
|
|
162
167
|
context.globalCompositeOperation = 'source-in';
|
|
163
|
-
context.fillStyle =
|
|
168
|
+
context.fillStyle = maskColor;
|
|
164
169
|
context.globalAlpha = 0.9;
|
|
165
170
|
context.fillRect(0, 0, viewportWidth, viewportHeight);
|
|
166
171
|
context.restore();
|
|
@@ -253,6 +258,7 @@
|
|
|
253
258
|
isDrawing = false;
|
|
254
259
|
lastPoint = null;
|
|
255
260
|
rebuildContours();
|
|
261
|
+
drawFrame();
|
|
256
262
|
emitMask();
|
|
257
263
|
}
|
|
258
264
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
export const demo = {
|
|
3
3
|
name: 'Label',
|
|
4
|
-
description: 'Form label wrapper with top and
|
|
4
|
+
description: 'Form label wrapper with top, leading, and trailing placement.',
|
|
5
5
|
columnSpan: 2
|
|
6
6
|
};
|
|
7
7
|
</script>
|
|
@@ -9,20 +9,26 @@
|
|
|
9
9
|
<script lang="ts">
|
|
10
10
|
import { HashIcon, UserIcon } from '@lucide/svelte';
|
|
11
11
|
import HStack from '../HStack';
|
|
12
|
+
import Switch from '../Switch';
|
|
12
13
|
import NumberField from '../NumberField';
|
|
13
14
|
import TextField from '../TextField';
|
|
14
15
|
import Label from './Label.svelte';
|
|
15
16
|
|
|
16
17
|
let name = $state('');
|
|
17
18
|
let amount = $state<number | null>(35);
|
|
19
|
+
let enabled = $state(true);
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
<HStack gap={10} align="center">
|
|
21
|
-
<Label label="Name" icon={UserIcon} orientation="top">
|
|
23
|
+
<Label label="Name" icon={UserIcon} orientation="top" width="fit">
|
|
22
24
|
<TextField bind:value={name} placeholder="Sveltely" />
|
|
23
25
|
</Label>
|
|
24
26
|
|
|
25
|
-
<Label label="Amount" icon={HashIcon} orientation="
|
|
27
|
+
<Label label="Amount" icon={HashIcon} orientation="leading" width="fit">
|
|
26
28
|
<NumberField bind:value={amount} min={0} max={100} />
|
|
27
29
|
</Label>
|
|
30
|
+
|
|
31
|
+
<Label label="Enabled" orientation="trailing" width="fit">
|
|
32
|
+
<Switch bind:checked={enabled} />
|
|
33
|
+
</Label>
|
|
28
34
|
</HStack>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
min-height: min-content;
|
|
126
126
|
gap: var(--label-gap, calc(var(--sveltely-gap) * 0.75));
|
|
127
127
|
border-radius: var(--label-border-radius, 0px);
|
|
128
|
-
color: var(--label-color, var(--sveltely-primary-color));
|
|
128
|
+
color: var(--label-color, var(--sveltely-text-primary-color));
|
|
129
129
|
font-size: var(--label-font-size);
|
|
130
130
|
padding: var(--label-padding-y, 0px) var(--label-padding-x, 0px);
|
|
131
131
|
}
|
|
@@ -135,11 +135,17 @@
|
|
|
135
135
|
align-items: stretch;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
.label[data-orientation='
|
|
138
|
+
.label[data-orientation='leading'],
|
|
139
|
+
.label[data-orientation='trailing'] {
|
|
139
140
|
flex-direction: row;
|
|
140
141
|
align-items: center;
|
|
141
142
|
}
|
|
142
143
|
|
|
144
|
+
.label[data-orientation='trailing'] {
|
|
145
|
+
flex-direction: row-reverse;
|
|
146
|
+
justify-content: flex-end;
|
|
147
|
+
}
|
|
148
|
+
|
|
143
149
|
.label-heading {
|
|
144
150
|
display: inline-flex;
|
|
145
151
|
min-width: max-content;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
4
|
+
import { tooltip as tooltipAction } from '../../../actions/tooltip';
|
|
4
5
|
import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
|
|
6
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
5
7
|
|
|
6
8
|
type Props = {
|
|
7
9
|
children?: Snippet;
|
|
8
10
|
label?: string;
|
|
9
11
|
} & StyleProps &
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
12
|
+
TooltipProps &
|
|
13
|
+
Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'>;
|
|
13
14
|
|
|
14
|
-
let { children, label,
|
|
15
|
+
let { children, label, tooltip, ...restProps }: Props = $props();
|
|
15
16
|
|
|
16
17
|
const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
|
|
17
18
|
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
@@ -35,11 +36,10 @@
|
|
|
35
36
|
</script>
|
|
36
37
|
|
|
37
38
|
<a
|
|
38
|
-
class="link inline-flex items-center justify-center {iconOnly
|
|
39
|
-
? 'link-icon-only'
|
|
40
|
-
: ''} {className}"
|
|
39
|
+
class="link inline-flex items-center justify-center {iconOnly ? 'link-icon-only' : ''}"
|
|
41
40
|
style={rootStyle}
|
|
42
41
|
{...props}
|
|
42
|
+
use:tooltipAction={tooltip}
|
|
43
43
|
>
|
|
44
44
|
{#if children}
|
|
45
45
|
{@render children()}
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
--link-icon-size: calc(var(--link-font-size) * 1.143);
|
|
56
56
|
border: 1px solid var(--link-border-color, var(--sveltely-border-color));
|
|
57
57
|
border-radius: var(--link-border-radius, var(--sveltely-border-radius));
|
|
58
|
-
background: var(--link-background, var(--sveltely-background-color));
|
|
59
|
-
color: var(--link-color, var(--sveltely-primary-color));
|
|
58
|
+
background: var(--link-background, var(--sveltely-control-background-color));
|
|
59
|
+
color: var(--link-color, var(--sveltely-text-primary-color));
|
|
60
60
|
gap: var(--link-gap, var(--sveltely-gap));
|
|
61
61
|
font-size: var(--link-font-size);
|
|
62
62
|
line-height: 1.25;
|
|
@@ -65,19 +65,7 @@
|
|
|
65
65
|
text-decoration: none;
|
|
66
66
|
transition:
|
|
67
67
|
color 150ms,
|
|
68
|
-
border-color 150ms
|
|
69
|
-
background-color 150ms;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.link:hover {
|
|
73
|
-
background: var(
|
|
74
|
-
--link-hover-background,
|
|
75
|
-
color-mix(
|
|
76
|
-
in oklab,
|
|
77
|
-
var(--link-background, var(--sveltely-background-color)) 88%,
|
|
78
|
-
var(--link-color, var(--sveltely-primary-color))
|
|
79
|
-
)
|
|
80
|
-
);
|
|
68
|
+
border-color 150ms;
|
|
81
69
|
}
|
|
82
70
|
|
|
83
71
|
.link-icon-only {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
3
|
import { type StyleProps } from '../../../style/surface';
|
|
4
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
4
5
|
type Props = {
|
|
5
6
|
children?: Snippet;
|
|
6
7
|
label?: string;
|
|
7
|
-
} & StyleProps & Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'
|
|
8
|
-
class?: HTMLAnchorAttributes['class'];
|
|
9
|
-
};
|
|
8
|
+
} & StyleProps & TooltipProps & Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'>;
|
|
10
9
|
declare const Link: import("svelte").Component<Props, {}, "">;
|
|
11
10
|
type Link = ReturnType<typeof Link>;
|
|
12
11
|
export default Link;
|
|
@@ -28,10 +28,16 @@
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<ScrollView
|
|
31
|
-
background="color-mix(in oklab, var(--sveltely-background-color) 94%, var(--sveltely-primary-color))"
|
|
31
|
+
background="color-mix(in oklab, var(--sveltely-background-color) 94%, var(--sveltely-text-primary-color))"
|
|
32
32
|
borderRadius={7.5}
|
|
33
33
|
scrollGradient={false}
|
|
34
|
-
loader={{
|
|
34
|
+
loader={{
|
|
35
|
+
text: 'Loading preview...',
|
|
36
|
+
promise: pending,
|
|
37
|
+
background:
|
|
38
|
+
'color-mix(in oklab, var(--sveltely-background-color) 94%, var(--sveltely-text-primary-color))',
|
|
39
|
+
fontSize: 12
|
|
40
|
+
}}
|
|
35
41
|
>
|
|
36
42
|
<div class="loader-demo">
|
|
37
43
|
<div class="loader-demo-copy">
|
|
@@ -67,7 +73,7 @@
|
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
.loader-demo-copy span {
|
|
70
|
-
color: var(--sveltely-secondary-color);
|
|
76
|
+
color: var(--sveltely-text-secondary-color);
|
|
71
77
|
font-size: calc(var(--sveltely-font-size) * 0.875);
|
|
72
78
|
line-height: 1.3;
|
|
73
79
|
}
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
label?: string;
|
|
9
9
|
active?: boolean;
|
|
10
10
|
} & StyleProps &
|
|
11
|
-
Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'
|
|
12
|
-
class?: HTMLAnchorAttributes['class'];
|
|
13
|
-
};
|
|
11
|
+
Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'>;
|
|
14
12
|
|
|
15
|
-
let { children, label, active = false,
|
|
13
|
+
let { children, label, active = false, ...restProps }: Props = $props();
|
|
16
14
|
|
|
17
15
|
const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
|
|
18
16
|
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
@@ -20,12 +18,7 @@
|
|
|
20
18
|
const rootStyle = $derived.by(() => surfaceStyle(styleProps, 'navigation-link'));
|
|
21
19
|
</script>
|
|
22
20
|
|
|
23
|
-
<a
|
|
24
|
-
class="navigation-link {className}"
|
|
25
|
-
class:navigation-link-active={active}
|
|
26
|
-
style={rootStyle}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
21
|
+
<a class="navigation-link" class:navigation-link-active={active} style={rootStyle} {...props}>
|
|
29
22
|
{#if children}
|
|
30
23
|
{@render children()}
|
|
31
24
|
{:else if label}
|
|
@@ -42,7 +35,7 @@
|
|
|
42
35
|
min-width: 0;
|
|
43
36
|
align-items: center;
|
|
44
37
|
border-radius: var(--navigation-link-border-radius, var(--sveltely-border-radius));
|
|
45
|
-
color: var(--navigation-link-color, var(--sveltely-primary-color));
|
|
38
|
+
color: var(--navigation-link-color, var(--sveltely-text-primary-color));
|
|
46
39
|
gap: var(--navigation-link-gap, var(--sveltely-gap));
|
|
47
40
|
font-size: var(--navigation-link-font-size);
|
|
48
41
|
line-height: 1.25;
|
|
@@ -62,7 +55,10 @@
|
|
|
62
55
|
|
|
63
56
|
.navigation-link:hover,
|
|
64
57
|
.navigation-link-active {
|
|
65
|
-
background: var(
|
|
58
|
+
background: var(
|
|
59
|
+
--navigation-link-active-background,
|
|
60
|
+
color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent)
|
|
61
|
+
);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
.navigation-link :global(svg) {
|
|
@@ -5,9 +5,7 @@ type Props = {
|
|
|
5
5
|
children?: Snippet;
|
|
6
6
|
label?: string;
|
|
7
7
|
active?: boolean;
|
|
8
|
-
} & StyleProps & Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'
|
|
9
|
-
class?: HTMLAnchorAttributes['class'];
|
|
10
|
-
};
|
|
8
|
+
} & StyleProps & Omit<HTMLAnchorAttributes, 'children' | 'class' | 'style'>;
|
|
11
9
|
declare const Link: import("svelte").Component<Props, {}, "">;
|
|
12
10
|
type Link = ReturnType<typeof Link>;
|
|
13
11
|
export default Link;
|
|
@@ -30,7 +30,13 @@
|
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<button
|
|
33
|
+
<button
|
|
34
|
+
onclick={handleClick}
|
|
35
|
+
class="sidebar-toggle"
|
|
36
|
+
style={rootStyle}
|
|
37
|
+
title="Toggle {side} sidebar"
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
34
40
|
{#if children}
|
|
35
41
|
{@render children()}
|
|
36
42
|
{:else if side === 'left'}
|
|
@@ -47,6 +53,6 @@
|
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
.sidebar-toggle:hover {
|
|
50
|
-
background: var(--sveltely-
|
|
56
|
+
background: color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent);
|
|
51
57
|
}
|
|
52
58
|
</style>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
import { tooltip } from '../../../actions/tooltip';
|
|
3
|
+
import { tooltip as tooltipAction } from '../../../actions/tooltip';
|
|
4
4
|
import { surfaceStyle, type StyleProps } from '../../../style/surface';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type TextInputMode
|
|
9
|
-
} from '../../../style/text-editor';
|
|
5
|
+
import { textStyle, type TextProps } from '../../../style/text';
|
|
6
|
+
import { type TextInputMode } from '../../../style/text-editor';
|
|
7
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
10
8
|
|
|
11
9
|
type Props = {
|
|
12
10
|
value?: number | null;
|
|
@@ -23,7 +21,8 @@
|
|
|
23
21
|
max?: number;
|
|
24
22
|
step?: number | 'any';
|
|
25
23
|
} & StyleProps &
|
|
26
|
-
|
|
24
|
+
TextProps &
|
|
25
|
+
TooltipProps;
|
|
27
26
|
|
|
28
27
|
let {
|
|
29
28
|
value = $bindable(null),
|
|
@@ -39,6 +38,8 @@
|
|
|
39
38
|
min,
|
|
40
39
|
max,
|
|
41
40
|
step,
|
|
41
|
+
tooltip,
|
|
42
|
+
as,
|
|
42
43
|
textAlign = 'right',
|
|
43
44
|
fontSize,
|
|
44
45
|
paddingX,
|
|
@@ -62,13 +63,14 @@
|
|
|
62
63
|
borderColor,
|
|
63
64
|
color
|
|
64
65
|
});
|
|
65
|
-
const
|
|
66
|
+
const textProps = $derived({ as, textAlign });
|
|
66
67
|
const rootStyle = $derived.by(() =>
|
|
67
|
-
[
|
|
68
|
+
[textStyle(textProps, 'text-field'), surfaceStyle(styleProps, 'text-field')]
|
|
68
69
|
.filter(Boolean)
|
|
69
70
|
.join(' ')
|
|
70
71
|
);
|
|
71
72
|
const describedBy = $derived(help ? 'text-field-message' : undefined);
|
|
73
|
+
const resolvedTooltip = $derived(error ? { label: error } : tooltip);
|
|
72
74
|
|
|
73
75
|
let draftValue = $state(formatValue(value));
|
|
74
76
|
let committedValue = $state(value);
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
</script>
|
|
113
115
|
|
|
114
116
|
<div
|
|
115
|
-
use:
|
|
117
|
+
use:tooltipAction={resolvedTooltip}
|
|
116
118
|
class="text-field"
|
|
117
119
|
style={rootStyle}
|
|
118
120
|
data-disabled={disabled ? 'true' : 'false'}
|
|
@@ -150,8 +152,8 @@
|
|
|
150
152
|
min-width: 0;
|
|
151
153
|
flex-direction: column;
|
|
152
154
|
gap: var(--text-field-gap, calc(var(--sveltely-gap) * 0.75));
|
|
153
|
-
color: var(--text-field-color, var(--sveltely-primary-color));
|
|
154
|
-
font-size: var(--text-field-font-size,
|
|
155
|
+
color: var(--text-field-color, var(--sveltely-text-primary-color));
|
|
156
|
+
font-size: var(--text-field-font-size, var(--sveltely-font-size));
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
.text-field-input {
|
|
@@ -159,10 +161,12 @@
|
|
|
159
161
|
min-width: 0;
|
|
160
162
|
border: 1px solid var(--text-field-border-color, var(--sveltely-border-color));
|
|
161
163
|
border-radius: var(--text-field-border-radius, var(--sveltely-border-radius));
|
|
162
|
-
background: var(--text-field-background, var(--sveltely-background-color));
|
|
164
|
+
background: var(--text-field-background, var(--sveltely-control-background-color));
|
|
163
165
|
color: inherit;
|
|
166
|
+
font-size: var(--text-field-font-size);
|
|
167
|
+
font-weight: var(--text-field-font-weight);
|
|
164
168
|
font-variant-numeric: tabular-nums;
|
|
165
|
-
line-height:
|
|
169
|
+
line-height: var(--text-field-line-height);
|
|
166
170
|
outline: none;
|
|
167
171
|
padding: var(--text-field-padding-y, calc(var(--sveltely-padding-y) * 0.67))
|
|
168
172
|
var(--text-field-padding-x, var(--sveltely-padding-x));
|
|
@@ -175,15 +179,15 @@
|
|
|
175
179
|
}
|
|
176
180
|
|
|
177
181
|
.text-field-input:focus {
|
|
178
|
-
border-color: color-mix(in oklab, var(--sveltely-active-color) 50%, white);
|
|
182
|
+
border-color: color-mix(in oklab, var(--sveltely-control-active-color) 50%, white);
|
|
179
183
|
}
|
|
180
184
|
|
|
181
185
|
.text-field-input::placeholder {
|
|
182
|
-
color: var(--sveltely-secondary-color);
|
|
186
|
+
color: var(--sveltely-text-secondary-color);
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
.text-field-message {
|
|
186
|
-
color: var(--sveltely-secondary-color);
|
|
190
|
+
color: var(--sveltely-text-secondary-color);
|
|
187
191
|
font-size: calc(var(--text-field-font-size, 0.875rem) * 0.857);
|
|
188
192
|
line-height: 1.25;
|
|
189
193
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
2
|
import { type StyleProps } from '../../../style/surface';
|
|
3
|
-
import { type
|
|
3
|
+
import { type TextProps } from '../../../style/text';
|
|
4
|
+
import { type TextInputMode } from '../../../style/text-editor';
|
|
5
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
4
6
|
type Props = {
|
|
5
7
|
value?: number | null;
|
|
6
8
|
help?: string;
|
|
@@ -15,7 +17,7 @@ type Props = {
|
|
|
15
17
|
min?: number;
|
|
16
18
|
max?: number;
|
|
17
19
|
step?: number | 'any';
|
|
18
|
-
} & StyleProps &
|
|
20
|
+
} & StyleProps & TextProps & TooltipProps;
|
|
19
21
|
declare const NumberField: import("svelte").Component<Props, {}, "value">;
|
|
20
22
|
type NumberField = ReturnType<typeof NumberField>;
|
|
21
23
|
export default NumberField;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
const hasNext = () => (typeof data.hasNext === 'boolean' ? data.hasNext : safePage() < maxPage());
|
|
50
50
|
const hasPrevious = () => safePage() > 1;
|
|
51
51
|
const buttonClass = () =>
|
|
52
|
-
`pagination-button action disabled:bg-zinc-200 disabled:text-[var(--sveltely-secondary-color)] inline-flex items-center justify-center leading-none ${
|
|
52
|
+
`pagination-button action disabled:bg-zinc-200 disabled:text-[var(--sveltely-text-secondary-color)] inline-flex items-center justify-center leading-none ${
|
|
53
53
|
variant === 'icon' ? 'pagination-button-icon' : ''
|
|
54
54
|
}`;
|
|
55
55
|
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
|
|
188
188
|
.pagination-button {
|
|
189
189
|
border-radius: var(--sveltely-border-radius);
|
|
190
|
-
background: var(--sveltely-inactive-color);
|
|
190
|
+
background: var(--sveltely-control-inactive-color);
|
|
191
191
|
padding: calc(var(--sveltely-padding-y) * 0.67 * var(--pagination-scale))
|
|
192
192
|
calc(var(--sveltely-padding-x) * 0.67 * var(--pagination-scale));
|
|
193
193
|
}
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
.pagination-input {
|
|
212
212
|
width: 10ch;
|
|
213
213
|
border-radius: var(--sveltely-border-radius);
|
|
214
|
-
background: var(--sveltely-inactive-color);
|
|
214
|
+
background: var(--sveltely-control-inactive-color);
|
|
215
215
|
font-size: inherit;
|
|
216
216
|
line-height: 1.25;
|
|
217
217
|
outline: none;
|
|
@@ -78,18 +78,13 @@
|
|
|
78
78
|
border: 1px solid var(--sveltely-border-color);
|
|
79
79
|
border-radius: var(--sveltely-border-radius);
|
|
80
80
|
background: var(--sveltely-background-color);
|
|
81
|
-
color: var(--sveltely-primary-color);
|
|
81
|
+
color: var(--sveltely-text-primary-color);
|
|
82
82
|
gap: var(--sveltely-gap);
|
|
83
83
|
padding: calc(var(--sveltely-padding-y) * 0.67) var(--sveltely-padding-x);
|
|
84
84
|
font-size: 0.875rem;
|
|
85
85
|
line-height: 1.25rem;
|
|
86
86
|
transition:
|
|
87
87
|
color 150ms,
|
|
88
|
-
border-color 150ms
|
|
89
|
-
background-color 150ms;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
:global(.popover-trigger[data-styled='true']:hover) {
|
|
93
|
-
background: var(--sveltely-hover-color);
|
|
88
|
+
border-color 150ms;
|
|
94
89
|
}
|
|
95
90
|
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export const demo = {
|
|
3
|
+
name: 'Scroll View',
|
|
4
|
+
description: 'Debug fixture for top and bottom scroll gradients.',
|
|
5
|
+
columnSpan: 2,
|
|
6
|
+
rowSpan: 2
|
|
7
|
+
};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import ScrollView, { type ScrollGeometry } from './index';
|
|
12
|
+
import VStack from '../VStack';
|
|
13
|
+
|
|
14
|
+
const rows = Array.from({ length: 24 }, (_, index) => `Debug row ${index + 1}`);
|
|
15
|
+
let geometry = $state<ScrollGeometry | null>(null);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<VStack height="100%" width="100%" gap={6}>
|
|
19
|
+
<div class="scroll-view-demo-meta">
|
|
20
|
+
<span>offset {Math.round(geometry?.offset.y ?? 0)}</span>
|
|
21
|
+
<span>viewport {Math.round(geometry?.viewport.height ?? 0)}</span>
|
|
22
|
+
<span>content {Math.round(geometry?.content.height ?? 0)}</span>
|
|
23
|
+
<span>bottom {Math.round(geometry?.remaining.bottom ?? 0)}</span>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<ScrollView height="100%" width="100%" onScroll={(nextGeometry) => (geometry = nextGeometry)}>
|
|
27
|
+
<VStack gap={4}>
|
|
28
|
+
{#each rows as row}
|
|
29
|
+
<div class="scroll-view-demo-row">{row}</div>
|
|
30
|
+
{/each}
|
|
31
|
+
</VStack>
|
|
32
|
+
</ScrollView>
|
|
33
|
+
</VStack>
|
|
34
|
+
|
|
35
|
+
<style>
|
|
36
|
+
.scroll-view-demo-meta {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
gap: 0.375rem;
|
|
40
|
+
color: var(--sveltely-text-secondary-color);
|
|
41
|
+
font-size: 0.75rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.scroll-view-demo-row {
|
|
45
|
+
border-radius: var(--sveltely-border-radius-nested);
|
|
46
|
+
background: var(--sveltely-background-color);
|
|
47
|
+
padding: 0.625rem 0.75rem;
|
|
48
|
+
color: var(--sveltely-text-primary-color);
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const demo: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
columnSpan: number;
|
|
5
|
+
rowSpan: number;
|
|
6
|
+
};
|
|
7
|
+
import ScrollView from './index';
|
|
8
|
+
declare const ScrollView: import("svelte").Component<Record<string, never>, {}, "">;
|
|
9
|
+
type ScrollView = ReturnType<typeof ScrollView>;
|
|
10
|
+
export default ScrollView;
|