@x33025/sveltely 0.1.18 → 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 +1 -1
- package/dist/components/Library/ArticleEditor/ArticleEditorHeader.svelte +20 -30
- package/dist/components/Library/ArticleEditor/Blocks/Code.svelte +0 -1
- package/dist/components/Library/ArticleEditor/Blocks/FAQ.svelte +1 -1
- package/dist/components/Library/ArticleEditor/Blocks/Heading.svelte +7 -7
- package/dist/components/Library/ArticleEditor/Blocks/Image.svelte +20 -36
- package/dist/components/Library/ArticleEditor/Blocks/Image.svelte.d.ts +1 -0
- package/dist/components/Library/ArticleEditor/Blocks/List.svelte +2 -2
- package/dist/components/Library/ArticleEditor/Blocks/Paragraph.svelte +1 -1
- package/dist/components/Library/ArticleEditor/Blocks/index.d.ts +0 -1
- package/dist/components/Library/ArticleEditor/Blocks/index.js +0 -1
- 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 -111
- package/package.json +1 -1
- package/dist/components/Library/ArticleEditor/Blocks/ImagePreview.svelte +0 -71
- package/dist/components/Library/ArticleEditor/Blocks/ImagePreview.svelte.d.ts +0 -8
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLButtonAttributes } 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 &
|
|
12
|
+
TooltipProps &
|
|
10
13
|
Omit<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
|
|
11
14
|
|
|
12
|
-
let {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
label,
|
|
18
|
+
tooltip,
|
|
19
|
+
disabled = false,
|
|
20
|
+
type = 'button',
|
|
21
|
+
...restProps
|
|
22
|
+
}: Props = $props();
|
|
13
23
|
|
|
14
24
|
const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
|
|
15
25
|
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
@@ -40,6 +50,7 @@
|
|
|
40
50
|
style={rootStyle}
|
|
41
51
|
{disabled}
|
|
42
52
|
{...props}
|
|
53
|
+
use:tooltipAction={tooltip}
|
|
43
54
|
>
|
|
44
55
|
{#if children}
|
|
45
56
|
{@render children()}
|
|
@@ -55,8 +66,8 @@
|
|
|
55
66
|
--button-icon-size: calc(var(--button-font-size) * 1.143);
|
|
56
67
|
border: 1px solid var(--button-border-color, var(--sveltely-border-color));
|
|
57
68
|
border-radius: var(--button-border-radius, var(--sveltely-border-radius));
|
|
58
|
-
background: var(--button-background, var(--sveltely-background-color));
|
|
59
|
-
color: var(--button-color, var(--sveltely-primary-color));
|
|
69
|
+
background: var(--button-background, var(--sveltely-control-background-color));
|
|
70
|
+
color: var(--button-color, var(--sveltely-text-primary-color));
|
|
60
71
|
gap: var(--button-gap, var(--sveltely-gap));
|
|
61
72
|
font-size: var(--button-font-size);
|
|
62
73
|
line-height: 1.25;
|
|
@@ -64,19 +75,7 @@
|
|
|
64
75
|
var(--button-padding-x, calc(var(--sveltely-padding-x) * var(--button-scale)));
|
|
65
76
|
transition:
|
|
66
77
|
color 150ms,
|
|
67
|
-
border-color 150ms
|
|
68
|
-
background-color 150ms;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.button:hover {
|
|
72
|
-
background: var(
|
|
73
|
-
--button-hover-background,
|
|
74
|
-
color-mix(
|
|
75
|
-
in oklab,
|
|
76
|
-
var(--button-background, var(--sveltely-background-color)) 88%,
|
|
77
|
-
var(--button-color, var(--sveltely-primary-color))
|
|
78
|
-
)
|
|
79
|
-
);
|
|
78
|
+
border-color 150ms;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
.button-icon-only {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLButtonAttributes } 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<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
|
|
8
|
+
} & StyleProps & TooltipProps & Omit<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
|
|
8
9
|
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
9
10
|
type Button = ReturnType<typeof Button>;
|
|
10
11
|
export default Button;
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
--calendar-font-size: calc(var(--sveltely-font-size) * 0.971);
|
|
165
165
|
--calendar-scale: calc(var(--calendar-font-size) / 1rem);
|
|
166
166
|
--calendar-cell-core-size: max(2ch, calc(2ch * var(--calendar-scale)));
|
|
167
|
-
--calendar-weekend-color: var(--sveltely-secondary-color);
|
|
168
|
-
--calendar-weekend-header-color: var(--sveltely-secondary-color);
|
|
169
|
-
--calendar-weekend-selected-color: var(--sveltely-background-color);
|
|
167
|
+
--calendar-weekend-color: var(--sveltely-text-secondary-color);
|
|
168
|
+
--calendar-weekend-header-color: var(--sveltely-text-secondary-color);
|
|
169
|
+
--calendar-weekend-selected-color: var(--sveltely-control-background-color);
|
|
170
170
|
--calendar-cell-width: calc(var(--calendar-cell-core-size) + (var(--sveltely-padding-x) * 2.2));
|
|
171
171
|
--calendar-cell-height: calc(
|
|
172
172
|
var(--calendar-cell-core-size) + (var(--sveltely-padding-y) * 2.2)
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
font-size: var(--calendar-title-size);
|
|
194
194
|
line-height: 1.4;
|
|
195
195
|
font-weight: 600;
|
|
196
|
-
color: var(--sveltely-primary-color);
|
|
196
|
+
color: var(--sveltely-text-primary-color);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.calendar-nav-button {
|
|
@@ -210,20 +210,19 @@
|
|
|
210
210
|
max-height: var(--calendar-cell-height);
|
|
211
211
|
border: 1px solid color-mix(in oklab, var(--sveltely-border-color) 75%, white);
|
|
212
212
|
border-radius: var(--sveltely-border-radius);
|
|
213
|
-
background: color-mix(in oklab, white 92%, var(--sveltely-inactive-color));
|
|
213
|
+
background: color-mix(in oklab, white 92%, var(--sveltely-control-inactive-color));
|
|
214
214
|
padding: 0;
|
|
215
|
-
color: var(--sveltely-secondary-color);
|
|
216
|
-
cursor: pointer;
|
|
215
|
+
color: var(--sveltely-text-secondary-color);
|
|
217
216
|
appearance: none;
|
|
218
217
|
}
|
|
219
218
|
|
|
220
219
|
.calendar-nav-button:focus-visible {
|
|
221
|
-
outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
|
|
220
|
+
outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
|
|
222
221
|
outline-offset: 2px;
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
.calendar-nav-button:hover {
|
|
226
|
-
background: var(--sveltely-
|
|
225
|
+
background: color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent);
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
.calendar-nav-icon {
|
|
@@ -250,7 +249,7 @@
|
|
|
250
249
|
font-size: var(--calendar-weekday-size);
|
|
251
250
|
line-height: 1;
|
|
252
251
|
text-align: center;
|
|
253
|
-
color: var(--sveltely-secondary-color);
|
|
252
|
+
color: var(--sveltely-text-secondary-color);
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
.calendar-weekday-weekend {
|
|
@@ -266,12 +265,11 @@
|
|
|
266
265
|
height: 100%;
|
|
267
266
|
border: 1px solid color-mix(in oklab, var(--sveltely-border-color) 75%, white);
|
|
268
267
|
border-radius: var(--sveltely-border-radius);
|
|
269
|
-
background: color-mix(in oklab, white 92%, var(--sveltely-inactive-color));
|
|
268
|
+
background: color-mix(in oklab, white 92%, var(--sveltely-control-inactive-color));
|
|
270
269
|
padding: 0;
|
|
271
270
|
font-size: calc(var(--calendar-font-size) * 0.85);
|
|
272
271
|
line-height: 1;
|
|
273
|
-
color: var(--sveltely-primary-color);
|
|
274
|
-
cursor: pointer;
|
|
272
|
+
color: var(--sveltely-text-primary-color);
|
|
275
273
|
appearance: none;
|
|
276
274
|
}
|
|
277
275
|
|
|
@@ -280,32 +278,24 @@
|
|
|
280
278
|
}
|
|
281
279
|
|
|
282
280
|
.calendar-day:focus-visible {
|
|
283
|
-
outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
|
|
281
|
+
outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
|
|
284
282
|
outline-offset: 2px;
|
|
285
283
|
}
|
|
286
284
|
|
|
287
|
-
.calendar-day:hover {
|
|
288
|
-
background: var(--sveltely-hover-color);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
285
|
.calendar-day-outside {
|
|
292
286
|
border-color: transparent;
|
|
293
287
|
background: transparent;
|
|
294
|
-
color: var(--sveltely-secondary-color);
|
|
288
|
+
color: var(--sveltely-text-secondary-color);
|
|
295
289
|
}
|
|
296
290
|
|
|
297
291
|
.calendar-day-today {
|
|
298
|
-
border-color: color-mix(in oklab, var(--sveltely-active-color) 18%, white);
|
|
292
|
+
border-color: color-mix(in oklab, var(--sveltely-control-active-color) 18%, white);
|
|
299
293
|
}
|
|
300
294
|
|
|
301
295
|
.calendar-day-selected {
|
|
302
|
-
border-color: var(--sveltely-active-color);
|
|
303
|
-
background: var(--sveltely-active-color);
|
|
304
|
-
color: var(--sveltely-background-color);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.calendar-day-selected:hover {
|
|
308
|
-
background: var(--sveltely-active-hover-color);
|
|
296
|
+
border-color: var(--sveltely-control-active-color);
|
|
297
|
+
background: var(--sveltely-control-active-color);
|
|
298
|
+
color: var(--sveltely-control-background-color);
|
|
309
299
|
}
|
|
310
300
|
|
|
311
301
|
.calendar-day-selected.calendar-day-weekend {
|
|
@@ -7,14 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import Checkbox from './Checkbox.svelte';
|
|
10
|
+
import Label from '../Label';
|
|
10
11
|
|
|
11
12
|
let notificationsEnabled = $state(true);
|
|
12
13
|
let weeklySummaryEnabled = $state(false);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<div class="vstack gap-3">
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
<Label label="Enable notifications" orientation="leading" width="fit">
|
|
18
|
+
<Checkbox bind:checked={notificationsEnabled} />
|
|
19
|
+
</Label>
|
|
20
|
+
<Label label="Send weekly summary" orientation="leading" width="fit">
|
|
21
|
+
<Checkbox bind:checked={weeklySummaryEnabled} />
|
|
22
|
+
</Label>
|
|
20
23
|
</div>
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { CheckIcon } from '@lucide/svelte';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
3
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
4
|
+
import { tooltip as tooltipAction } from '../../../actions/tooltip';
|
|
5
5
|
import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
|
|
6
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
8
9
|
checked?: boolean;
|
|
9
|
-
label?: string;
|
|
10
|
-
children?: Snippet;
|
|
11
10
|
} & StyleProps &
|
|
12
|
-
|
|
11
|
+
TooltipProps &
|
|
12
|
+
Omit<HTMLInputAttributes, 'type' | 'class' | 'style' | 'checked'>;
|
|
13
13
|
|
|
14
|
-
let {
|
|
15
|
-
checked = $bindable(false),
|
|
16
|
-
label,
|
|
17
|
-
children,
|
|
18
|
-
disabled = false,
|
|
19
|
-
...restProps
|
|
20
|
-
}: Props = $props();
|
|
14
|
+
let { checked = $bindable(false), tooltip, disabled = false, ...restProps }: Props = $props();
|
|
21
15
|
|
|
22
16
|
const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
|
|
23
17
|
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
@@ -26,26 +20,15 @@
|
|
|
26
20
|
</script>
|
|
27
21
|
|
|
28
22
|
<label
|
|
29
|
-
class="checkbox
|
|
23
|
+
class="checkbox"
|
|
30
24
|
style={rootStyle}
|
|
31
25
|
data-disabled={disabled ? 'true' : 'false'}
|
|
26
|
+
use:tooltipAction={tooltip}
|
|
32
27
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
<CheckIcon class="checkbox-icon" />
|
|
37
|
-
</span>
|
|
28
|
+
<input bind:checked type="checkbox" {disabled} {...props} />
|
|
29
|
+
<span class="checkbox-mark" aria-hidden="true">
|
|
30
|
+
<CheckIcon class="checkbox-icon" />
|
|
38
31
|
</span>
|
|
39
|
-
|
|
40
|
-
{#if children || label}
|
|
41
|
-
<span class="checkbox-label">
|
|
42
|
-
{#if children}
|
|
43
|
-
{@render children()}
|
|
44
|
-
{:else if label}
|
|
45
|
-
{label}
|
|
46
|
-
{/if}
|
|
47
|
-
</span>
|
|
48
|
-
{/if}
|
|
49
32
|
</label>
|
|
50
33
|
|
|
51
34
|
<style>
|
|
@@ -57,11 +40,12 @@
|
|
|
57
40
|
(var(--sveltely-padding-y) * 0.28 * var(--checkbox-scale))
|
|
58
41
|
);
|
|
59
42
|
--checkbox-icon-size: calc(var(--checkbox-box-size) * 0.64);
|
|
60
|
-
|
|
43
|
+
display: inline-block;
|
|
44
|
+
position: relative;
|
|
45
|
+
flex: 0 0 auto;
|
|
46
|
+
inline-size: var(--checkbox-box-size);
|
|
47
|
+
block-size: var(--checkbox-box-size);
|
|
61
48
|
font-size: var(--checkbox-font-size);
|
|
62
|
-
line-height: 1.25;
|
|
63
|
-
color: var(--checkbox-color, var(--sveltely-primary-color));
|
|
64
|
-
cursor: pointer;
|
|
65
49
|
user-select: none;
|
|
66
50
|
}
|
|
67
51
|
|
|
@@ -70,14 +54,7 @@
|
|
|
70
54
|
opacity: 0.5;
|
|
71
55
|
}
|
|
72
56
|
|
|
73
|
-
.checkbox
|
|
74
|
-
position: relative;
|
|
75
|
-
flex: 0 0 auto;
|
|
76
|
-
inline-size: var(--checkbox-box-size);
|
|
77
|
-
block-size: var(--checkbox-box-size);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.checkbox-control input {
|
|
57
|
+
.checkbox input {
|
|
81
58
|
position: absolute;
|
|
82
59
|
inset: 0;
|
|
83
60
|
margin: 0;
|
|
@@ -90,34 +67,24 @@
|
|
|
90
67
|
block-size: 100%;
|
|
91
68
|
border: 1px solid var(--checkbox-border-color, var(--sveltely-border-color));
|
|
92
69
|
border-radius: var(--checkbox-border-radius, calc(var(--sveltely-border-radius) * 0.5));
|
|
93
|
-
background: var(--checkbox-background, var(--sveltely-inactive-color));
|
|
70
|
+
background: var(--checkbox-background, var(--sveltely-control-inactive-color));
|
|
94
71
|
color: transparent;
|
|
95
72
|
display: inline-flex;
|
|
96
73
|
align-items: center;
|
|
97
74
|
justify-content: center;
|
|
98
75
|
transition:
|
|
99
76
|
color 150ms,
|
|
100
|
-
border-color 150ms
|
|
101
|
-
background-color 150ms;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.checkbox:hover .checkbox-mark {
|
|
105
|
-
background: var(--checkbox-hover-background, var(--sveltely-inactive-hover-color));
|
|
77
|
+
border-color 150ms;
|
|
106
78
|
}
|
|
107
79
|
|
|
108
|
-
.checkbox
|
|
109
|
-
border-color: var(--checkbox-checked-border-color, var(--sveltely-active-color));
|
|
110
|
-
background: var(--checkbox-checked-background, var(--sveltely-active-color));
|
|
111
|
-
color: var(--checkbox-checked-color, var(--sveltely-background-color));
|
|
80
|
+
.checkbox input:checked + .checkbox-mark {
|
|
81
|
+
border-color: var(--checkbox-checked-border-color, var(--sveltely-control-active-color));
|
|
82
|
+
background: var(--checkbox-checked-background, var(--sveltely-control-active-color));
|
|
83
|
+
color: var(--checkbox-checked-color, var(--sveltely-control-background-color));
|
|
112
84
|
}
|
|
113
85
|
|
|
114
|
-
.checkbox
|
|
115
|
-
|
|
116
|
-
border-color: var(--checkbox-checked-hover-border-color, var(--sveltely-active-hover-color));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.checkbox-control input:focus-visible + .checkbox-mark {
|
|
120
|
-
outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
|
|
86
|
+
.checkbox input:focus-visible + .checkbox-mark {
|
|
87
|
+
outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
|
|
121
88
|
outline-offset: 2px;
|
|
122
89
|
}
|
|
123
90
|
|
|
@@ -126,8 +93,4 @@
|
|
|
126
93
|
width: var(--checkbox-icon-size);
|
|
127
94
|
height: var(--checkbox-icon-size);
|
|
128
95
|
}
|
|
129
|
-
|
|
130
|
-
.checkbox-label {
|
|
131
|
-
min-width: 0;
|
|
132
|
-
}
|
|
133
96
|
</style>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
2
|
import { type StyleProps } from '../../../style/surface';
|
|
3
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
4
4
|
type Props = {
|
|
5
5
|
checked?: boolean;
|
|
6
|
-
|
|
7
|
-
children?: Snippet;
|
|
8
|
-
} & StyleProps & Omit<HTMLInputAttributes, 'type' | 'children' | 'class' | 'style' | 'checked'>;
|
|
6
|
+
} & StyleProps & TooltipProps & Omit<HTMLInputAttributes, 'type' | 'class' | 'style' | 'checked'>;
|
|
9
7
|
declare const Checkbox: import("svelte").Component<Props, {}, "checked">;
|
|
10
8
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
11
9
|
export default Checkbox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
export const demo = {
|
|
3
|
-
name: '
|
|
3
|
+
name: 'Chip Input',
|
|
4
4
|
description: 'Editable chip list with bindable tags.'
|
|
5
5
|
};
|
|
6
6
|
</script>
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
|
|
14
14
|
<div class="vstack w-full max-w-sm gap-2">
|
|
15
15
|
<ChipInput bind:tags />
|
|
16
|
-
<p class="text-xs text-[var(--sveltely-secondary-color)]">Tags: {tags.join(', ')}</p>
|
|
16
|
+
<p class="text-xs text-[var(--sveltely-text-secondary-color)]">Tags: {tags.join(', ')}</p>
|
|
17
17
|
</div>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import { tick } from 'svelte';
|
|
4
4
|
import { Plus } from '@lucide/svelte';
|
|
5
|
+
import { tooltip as tooltipAction } from '../../../actions/tooltip';
|
|
5
6
|
import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
|
|
7
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
6
8
|
|
|
7
9
|
type Props = {
|
|
8
10
|
placeholder?: string;
|
|
@@ -11,6 +13,7 @@
|
|
|
11
13
|
disabled?: boolean;
|
|
12
14
|
action?: Snippet;
|
|
13
15
|
} & StyleProps &
|
|
16
|
+
TooltipProps &
|
|
14
17
|
Record<string, unknown>;
|
|
15
18
|
|
|
16
19
|
let {
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
selection = $bindable<string[] | undefined>(),
|
|
20
23
|
disabled = false,
|
|
21
24
|
action,
|
|
25
|
+
tooltip,
|
|
22
26
|
...restProps
|
|
23
27
|
}: Props = $props();
|
|
24
28
|
|
|
@@ -248,6 +252,7 @@
|
|
|
248
252
|
style={rootStyle}
|
|
249
253
|
class:chip-input-disabled={disabled}
|
|
250
254
|
aria-disabled={disabled}
|
|
255
|
+
use:tooltipAction={tooltip}
|
|
251
256
|
{...props}
|
|
252
257
|
>
|
|
253
258
|
{#each tags as tag, index (tag)}
|
|
@@ -332,7 +337,7 @@
|
|
|
332
337
|
box-sizing: border-box;
|
|
333
338
|
border: 1px solid var(--sveltely-border-color);
|
|
334
339
|
border-radius: var(--sveltely-border-radius);
|
|
335
|
-
background: var(--sveltely-inactive-color);
|
|
340
|
+
background: var(--sveltely-control-inactive-color);
|
|
336
341
|
color: black;
|
|
337
342
|
min-height: var(--chip-input-control-height);
|
|
338
343
|
padding: var(--chip-input-padding-y) var(--chip-input-padding-x);
|
|
@@ -345,13 +350,8 @@
|
|
|
345
350
|
border-color: var(--sveltely-border-color);
|
|
346
351
|
}
|
|
347
352
|
|
|
348
|
-
.chip:hover,
|
|
349
353
|
.chip-hovered {
|
|
350
|
-
background: var(--sveltely-
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.chip-input-field:hover {
|
|
354
|
-
background: var(--sveltely-hover-color);
|
|
354
|
+
background: color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent);
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
.chip-input-disabled {
|
|
@@ -363,10 +363,6 @@
|
|
|
363
363
|
opacity: 0.5;
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
.chip-input-disabled .chip:hover {
|
|
367
|
-
background: var(--sveltely-hover-color);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
366
|
.chip-input-action {
|
|
371
367
|
padding: 0;
|
|
372
368
|
width: var(--chip-input-control-height);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import { type StyleProps } from '../../../style/surface';
|
|
3
|
+
import type { TooltipProps } from '../../../style/tooltip';
|
|
3
4
|
type Props = {
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
tags: string[];
|
|
6
7
|
selection?: string[];
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
action?: Snippet;
|
|
9
|
-
} & StyleProps & Record<string, unknown>;
|
|
10
|
-
declare const ChipInput: import("svelte").Component<Props, {}, "
|
|
10
|
+
} & StyleProps & TooltipProps & Record<string, unknown>;
|
|
11
|
+
declare const ChipInput: import("svelte").Component<Props, {}, "selection" | "tags">;
|
|
11
12
|
type ChipInput = ReturnType<typeof ChipInput>;
|
|
12
13
|
export default ChipInput;
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
|
|
90
90
|
<div class="grid w-full gap-4 md:grid-cols-2">
|
|
91
91
|
<div class="vstack gap-2">
|
|
92
|
-
<p class="text-sm font-medium text-[var(--sveltely-primary-color)]">Default trigger</p>
|
|
92
|
+
<p class="text-sm font-medium text-[var(--sveltely-text-primary-color)]">Default trigger</p>
|
|
93
93
|
<Dropdown bind:value={status} placeholder="Choose status" selectedLabel={selectedStatusLabel}>
|
|
94
94
|
<Dropdown.Section label="Publishing">
|
|
95
95
|
<Dropdown.Item value="draft">Draft</Dropdown.Item>
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
<Dropdown.Item value="private" disabled>Private</Dropdown.Item>
|
|
104
104
|
</Dropdown.Section>
|
|
105
105
|
</Dropdown>
|
|
106
|
-
<p class="text-xs text-[var(--sveltely-secondary-color)]">
|
|
106
|
+
<p class="text-xs text-[var(--sveltely-text-secondary-color)]">
|
|
107
107
|
Selected: {selectedStatusLabel ?? 'none'}
|
|
108
108
|
</p>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
<div class="vstack gap-2">
|
|
112
|
-
<p class="text-sm font-medium text-[var(--sveltely-primary-color)]">
|
|
112
|
+
<p class="text-sm font-medium text-[var(--sveltely-text-primary-color)]">
|
|
113
113
|
Custom trigger and rich rows
|
|
114
114
|
</p>
|
|
115
115
|
<Dropdown
|
|
@@ -121,17 +121,17 @@
|
|
|
121
121
|
<Dropdown.Trigger>
|
|
122
122
|
{#if selectedWebsite}
|
|
123
123
|
<span class="hstack min-w-0 items-center gap-2">
|
|
124
|
-
<span class="truncate text-[var(--sveltely-primary-color)]"
|
|
124
|
+
<span class="truncate text-[var(--sveltely-text-primary-color)]"
|
|
125
125
|
>{selectedWebsite.name}</span
|
|
126
126
|
>
|
|
127
127
|
{#if selectedWebsite.domain}
|
|
128
|
-
<span class="truncate text-xs text-[var(--sveltely-secondary-color)]">
|
|
128
|
+
<span class="truncate text-xs text-[var(--sveltely-text-secondary-color)]">
|
|
129
129
|
{selectedWebsite.domain}
|
|
130
130
|
</span>
|
|
131
131
|
{/if}
|
|
132
132
|
</span>
|
|
133
133
|
{:else}
|
|
134
|
-
<span class="text-[var(--sveltely-secondary-color)]">Select website</span>
|
|
134
|
+
<span class="text-[var(--sveltely-text-secondary-color)]">Select website</span>
|
|
135
135
|
{/if}
|
|
136
136
|
</Dropdown.Trigger>
|
|
137
137
|
{/snippet}
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
</Dropdown.Item>
|
|
149
149
|
<Dropdown.Section label="Websites">
|
|
150
150
|
{#if filteredWebsites.length === 0}
|
|
151
|
-
<div class="px-2 py-1 text-sm text-[var(--sveltely-secondary-color)]">
|
|
151
|
+
<div class="px-2 py-1 text-sm text-[var(--sveltely-text-secondary-color)]">
|
|
152
152
|
No websites found.
|
|
153
153
|
</div>
|
|
154
154
|
{:else}
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
<div class="vstack min-w-0 gap-0.5">
|
|
167
167
|
<span class="truncate">{website.name}</span>
|
|
168
168
|
{#if website.domain}
|
|
169
|
-
<span class="truncate text-xs text-[var(--sveltely-secondary-color)]"
|
|
169
|
+
<span class="truncate text-xs text-[var(--sveltely-text-secondary-color)]"
|
|
170
170
|
>{website.domain}</span
|
|
171
171
|
>
|
|
172
172
|
{/if}
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
{#if selected}
|
|
175
175
|
<CheckIcon
|
|
176
176
|
size={14}
|
|
177
|
-
class="shrink-0 text-[var(--sveltely-primary-color)]"
|
|
177
|
+
class="shrink-0 text-[var(--sveltely-text-primary-color)]"
|
|
178
178
|
/>
|
|
179
179
|
{/if}
|
|
180
180
|
{/snippet}
|
|
@@ -186,6 +186,6 @@
|
|
|
186
186
|
{/if}
|
|
187
187
|
</Dropdown.Section>
|
|
188
188
|
</Dropdown>
|
|
189
|
-
<p class="text-xs text-[var(--sveltely-secondary-color)]">Actions clicked: {actionCount}</p>
|
|
189
|
+
<p class="text-xs text-[var(--sveltely-text-secondary-color)]">Actions clicked: {actionCount}</p>
|
|
190
190
|
</div>
|
|
191
191
|
</div>
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
onclick={triggerState.toggle}
|
|
122
122
|
>
|
|
123
123
|
<span class="dropdown-trigger-label">{triggerState.selectedLabel}</span>
|
|
124
|
-
<ChevronDownIcon class="size-4 text-[var(--sveltely-secondary-color)]" />
|
|
124
|
+
<ChevronDownIcon class="size-4 text-[var(--sveltely-text-secondary-color)]" />
|
|
125
125
|
</button>
|
|
126
126
|
{/if}
|
|
127
127
|
{/snippet}
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
border: 1px solid var(--sveltely-border-color);
|
|
152
152
|
border-radius: var(--sveltely-border-radius);
|
|
153
153
|
background: var(--sveltely-background-color);
|
|
154
|
-
color: var(--sveltely-primary-color);
|
|
154
|
+
color: var(--sveltely-text-primary-color);
|
|
155
155
|
gap: var(--sveltely-gap);
|
|
156
156
|
padding: calc(var(--sveltely-padding-y) * 0.67) var(--sveltely-padding-x);
|
|
157
157
|
font-size: 0.875rem;
|
|
@@ -174,10 +174,6 @@
|
|
|
174
174
|
flex: 0 0 auto;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.dropdown-trigger:hover {
|
|
178
|
-
background: var(--sveltely-hover-color);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
177
|
.dropdown-content {
|
|
182
178
|
--dropdown-item-padding-x: calc(var(--sveltely-padding-x) * 0.67);
|
|
183
179
|
--dropdown-item-padding-y: calc(var(--sveltely-padding-y) * 0.33);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
})}
|
|
42
42
|
{/if}
|
|
43
43
|
{#if resolvedShowCheck && selected}
|
|
44
|
-
<CheckIcon class="dropdown-item-check size-4 text-[var(--sveltely-primary-color)]" />
|
|
44
|
+
<CheckIcon class="dropdown-item-check size-4 text-[var(--sveltely-text-primary-color)]" />
|
|
45
45
|
{/if}
|
|
46
46
|
</button>
|
|
47
47
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.dropdown-item:hover {
|
|
61
|
-
background: var(--sveltely-
|
|
61
|
+
background: color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.dropdown-item:disabled {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{dropdown.selectedLabel}
|
|
30
30
|
{/if}
|
|
31
31
|
</span>
|
|
32
|
-
<ChevronDownIcon class="size-4 text-[var(--sveltely-secondary-color)]" />
|
|
32
|
+
<ChevronDownIcon class="size-4 text-[var(--sveltely-text-secondary-color)]" />
|
|
33
33
|
</button>
|
|
34
34
|
|
|
35
35
|
<style>
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
border: 1px solid var(--sveltely-border-color);
|
|
42
42
|
border-radius: var(--sveltely-border-radius);
|
|
43
|
-
background: var(--sveltely-background-color);
|
|
44
|
-
color: var(--sveltely-primary-color);
|
|
43
|
+
background: var(--sveltely-control-background-color);
|
|
44
|
+
color: var(--sveltely-text-primary-color);
|
|
45
45
|
gap: var(--sveltely-gap);
|
|
46
46
|
padding: calc(var(--sveltely-padding-y) * 0.67) var(--sveltely-padding-x);
|
|
47
47
|
font-size: 0.875rem;
|
|
@@ -64,8 +64,4 @@
|
|
|
64
64
|
.dropdown-trigger :global(svg) {
|
|
65
65
|
flex: 0 0 auto;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
.dropdown-trigger:hover {
|
|
69
|
-
background: var(--sveltely-hover-color);
|
|
70
|
-
}
|
|
71
67
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
export const demo = {
|
|
3
3
|
name: 'Image',
|
|
4
|
-
description: 'Responsive image display with
|
|
4
|
+
description: 'Responsive image display with icon placeholder and busy states.'
|
|
5
5
|
};
|
|
6
6
|
</script>
|
|
7
7
|
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=600&q=80"
|
|
14
14
|
alt="Red sneaker"
|
|
15
15
|
fit="cover"
|
|
16
|
-
|
|
16
|
+
aspectRatio="1 / 1"
|
|
17
17
|
/>
|
|
18
|
-
<Image busy
|
|
18
|
+
<Image busy aspectRatio="1 / 1" />
|