@motion-proto/live-tokens 0.3.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/package.json +18 -12
- package/src/component-editor/BadgeEditor.svelte +24 -22
- package/src/component-editor/CalloutEditor.svelte +3 -3
- package/src/component-editor/CardEditor.svelte +25 -21
- package/src/component-editor/CollapsibleSectionEditor.svelte +27 -25
- package/src/component-editor/CornerBadgeEditor.svelte +37 -35
- package/src/component-editor/DialogEditor.svelte +26 -24
- package/src/component-editor/ImageEditor.svelte +11 -9
- package/src/component-editor/InlineEditActionsEditor.svelte +17 -15
- package/src/component-editor/NotificationEditor.svelte +32 -30
- package/src/component-editor/ProgressBarEditor.svelte +3 -3
- package/src/component-editor/RadioButtonEditor.svelte +31 -29
- package/src/component-editor/SectionDividerEditor.svelte +30 -28
- package/src/component-editor/SegmentedControlEditor.svelte +29 -25
- package/src/component-editor/StandardButtonsEditor.svelte +42 -38
- package/src/component-editor/TabBarEditor.svelte +20 -18
- package/src/component-editor/TableEditor.svelte +4 -4
- package/src/component-editor/TooltipEditor.svelte +11 -9
- package/src/component-editor/registry.ts +2 -2
- package/src/component-editor/scaffolding/AngleDial.svelte +20 -19
- package/src/component-editor/scaffolding/ComponentEditorBase.svelte +44 -20
- package/src/component-editor/scaffolding/ComponentFileManager.svelte +262 -38
- package/src/component-editor/scaffolding/ComponentFileMenu.svelte +41 -29
- package/src/component-editor/scaffolding/ComponentsTab.svelte +7 -3
- package/src/component-editor/scaffolding/CopyFromMenu.svelte +21 -12
- package/src/component-editor/scaffolding/DemoHeader.svelte +13 -4
- package/src/component-editor/scaffolding/DividerEditor.svelte +27 -14
- package/src/component-editor/scaffolding/FieldsetWrapper.svelte +10 -4
- package/src/component-editor/scaffolding/GradientCard.svelte +25 -20
- package/src/component-editor/scaffolding/LinkageChart.svelte +43 -34
- package/src/component-editor/scaffolding/LinkedBlock.svelte +24 -21
- package/src/component-editor/scaffolding/NonStylableConfig.svelte +6 -1
- package/src/component-editor/scaffolding/SaveAsDialog.svelte +39 -35
- package/src/component-editor/scaffolding/ShadowBackdrop.svelte +21 -9
- package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +8 -3
- package/src/component-editor/scaffolding/StateBlock.svelte +30 -13
- package/src/component-editor/scaffolding/TokenLayout.svelte +46 -30
- package/src/component-editor/scaffolding/TypeEditor.svelte +52 -26
- package/src/component-editor/scaffolding/VariantGroup.svelte +81 -48
- package/src/component-editor/scaffolding/componentSectionType.ts +2 -2
- package/src/components/Badge.svelte +45 -26
- package/src/components/Button.svelte +44 -21
- package/src/components/Callout.svelte +17 -12
- package/src/components/Card.svelte +23 -11
- package/src/components/CollapsibleSection.svelte +56 -27
- package/src/components/CornerBadge.svelte +32 -18
- package/src/components/Dialog.svelte +55 -31
- package/src/components/Image.svelte +14 -5
- package/src/components/InlineEditActions.svelte +22 -10
- package/src/components/Notification.svelte +39 -19
- package/src/components/ProgressBar.svelte +27 -17
- package/src/components/RadioButton.svelte +27 -10
- package/src/components/SectionDivider.svelte +34 -26
- package/src/components/SegmentedControl.svelte +23 -9
- package/src/components/TabBar.svelte +23 -10
- package/src/components/Table.svelte +8 -3
- package/src/components/Tooltip.svelte +15 -5
- package/src/lib/ColumnsOverlay.svelte +3 -3
- package/src/lib/LiveEditorOverlay.svelte +57 -36
- package/src/pages/ComponentEditorPage.svelte +25 -14
- package/src/pages/Editor.svelte +8 -2
- package/src/pages/EditorShell.svelte +24 -20
- package/src/styles/site.css +138 -0
- package/src/styles/tokens.css +78 -76
- package/src/styles/ui-form-controls.css +186 -0
- package/src/ui/BezierCurveEditor.svelte +59 -43
- package/src/ui/ColorEditPanel.svelte +71 -44
- package/src/ui/EditorViewSwitcher.svelte +9 -5
- package/src/ui/FontStackEditor.svelte +17 -16
- package/src/ui/GradientEditor.svelte +42 -33
- package/src/ui/GradientStopPicker.svelte +18 -29
- package/src/ui/PaletteEditor.svelte +238 -212
- package/src/ui/PresetFileManager.svelte +20 -18
- package/src/ui/ProjectFontsSection.svelte +34 -34
- package/src/ui/SurfacesTab.svelte +3 -3
- package/src/ui/TextTab.svelte +2 -2
- package/src/ui/ThemeFileManager.svelte +38 -35
- package/src/ui/Toggle.svelte +11 -9
- package/src/ui/UICopyPopover.svelte +19 -15
- package/src/ui/UIDialog.svelte +48 -30
- package/src/ui/UIFontFamilySelector.svelte +104 -78
- package/src/ui/UIFontSizeSelector.svelte +38 -20
- package/src/ui/UIFontWeightSelector.svelte +33 -13
- package/src/ui/UILineHeightSelector.svelte +33 -13
- package/src/ui/UILinkToggle.svelte +7 -6
- package/src/ui/UIOptionItem.svelte +21 -7
- package/src/ui/UIOptionList.svelte +9 -3
- package/src/ui/UIPaddingSelector.svelte +108 -82
- package/src/ui/UIPaletteSelector.svelte +186 -161
- package/src/ui/UIRadio.svelte +23 -8
- package/src/ui/UIRadioGroup.svelte +9 -8
- package/src/ui/UIRelinkConfirmPopover.svelte +26 -16
- package/src/ui/UITokenSelector.svelte +112 -68
- package/src/ui/UIVariantSelector.svelte +79 -57
- package/src/ui/VariablesTab.svelte +15 -15
- package/src/ui/palette/GradientStopEditor.svelte +45 -26
- package/src/ui/palette/OverridesPanel.svelte +85 -49
- package/src/ui/palette/PaletteBase.svelte +60 -32
- package/src/ui/palette/ScaleCurveEditor.svelte +25 -10
- package/src/ui/sections/ColumnsSection.svelte +13 -13
- package/src/ui/sections/GradientsSection.svelte +12 -9
- package/src/ui/sections/OverlaysSection.svelte +50 -47
- package/src/ui/sections/ShadowsSection.svelte +110 -104
- package/src/ui/sections/TokenScaleTable.svelte +38 -22
- package/src/ui/sections/tokenScales.ts +2 -2
- package/src/styles/form-controls.css +0 -188
|
@@ -3,15 +3,34 @@
|
|
|
3
3
|
import Button from './Button.svelte';
|
|
4
4
|
import type { NotificationActions } from './types';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
variant?: 'info' | 'warning' | 'danger' | 'success';
|
|
10
|
+
size?: 'normal' | 'compact';
|
|
11
|
+
icon?: string;
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
emphasis?: boolean;
|
|
14
|
+
actions?: NotificationActions;
|
|
15
|
+
/** Dismiss callback. Preferred over `on:dismiss` from 0.5.0 onward. */
|
|
16
|
+
ondismiss?: () => void;
|
|
17
|
+
children?: import('svelte').Snippet;
|
|
18
|
+
}
|
|
14
19
|
|
|
20
|
+
let {
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
variant = 'info',
|
|
24
|
+
size = 'normal',
|
|
25
|
+
icon = '',
|
|
26
|
+
dismissible = false,
|
|
27
|
+
emphasis = false,
|
|
28
|
+
actions = {},
|
|
29
|
+
ondismiss,
|
|
30
|
+
children
|
|
31
|
+
}: Props = $props();
|
|
32
|
+
|
|
33
|
+
// Dual-fire bridge — see Button.svelte for the deprecation timeline.
|
|
15
34
|
const dispatch = createEventDispatcher();
|
|
16
35
|
|
|
17
36
|
// Default icons based on variant
|
|
@@ -22,9 +41,10 @@
|
|
|
22
41
|
success: 'fas fa-check-circle'
|
|
23
42
|
};
|
|
24
43
|
|
|
25
|
-
|
|
44
|
+
let displayIcon = $derived(icon || defaultIcons[variant]);
|
|
26
45
|
|
|
27
46
|
function handleDismiss() {
|
|
47
|
+
ondismiss?.();
|
|
28
48
|
dispatch('dismiss');
|
|
29
49
|
}
|
|
30
50
|
</script>
|
|
@@ -41,7 +61,7 @@
|
|
|
41
61
|
</div>
|
|
42
62
|
{/if}
|
|
43
63
|
{#if dismissible}
|
|
44
|
-
<button class="notification-close"
|
|
64
|
+
<button class="notification-close" onclick={handleDismiss} type="button" aria-label="Dismiss">
|
|
45
65
|
<i class="fas fa-times"></i>
|
|
46
66
|
</button>
|
|
47
67
|
{/if}
|
|
@@ -67,7 +87,7 @@
|
|
|
67
87
|
{/if}
|
|
68
88
|
</div>
|
|
69
89
|
{/if}
|
|
70
|
-
|
|
90
|
+
{@render children?.()}
|
|
71
91
|
{#if actions.inline}
|
|
72
92
|
<div class="notification-actions-inline">
|
|
73
93
|
{#if description}
|
|
@@ -103,12 +123,12 @@
|
|
|
103
123
|
--notification-info-title-font-family: var(--font-sans);
|
|
104
124
|
--notification-info-title-font-size: var(--font-size-lg);
|
|
105
125
|
--notification-info-title-font-weight: var(--font-weight-normal);
|
|
106
|
-
--notification-info-title-line-height: var(--line-height-
|
|
126
|
+
--notification-info-title-line-height: var(--line-height-sm);
|
|
107
127
|
--notification-info-text: var(--text-primary);
|
|
108
128
|
--notification-info-text-font-family: var(--font-sans);
|
|
109
129
|
--notification-info-text-font-size: var(--font-size-md);
|
|
110
130
|
--notification-info-text-font-weight: var(--font-weight-extralight);
|
|
111
|
-
--notification-info-text-line-height: var(--line-height-
|
|
131
|
+
--notification-info-text-line-height: var(--line-height-md);
|
|
112
132
|
|
|
113
133
|
/* Success */
|
|
114
134
|
--notification-success-surface: var(--surface-success);
|
|
@@ -122,12 +142,12 @@
|
|
|
122
142
|
--notification-success-title-font-family: var(--font-sans);
|
|
123
143
|
--notification-success-title-font-size: var(--font-size-lg);
|
|
124
144
|
--notification-success-title-font-weight: var(--font-weight-normal);
|
|
125
|
-
--notification-success-title-line-height: var(--line-height-
|
|
145
|
+
--notification-success-title-line-height: var(--line-height-sm);
|
|
126
146
|
--notification-success-text: var(--text-primary);
|
|
127
147
|
--notification-success-text-font-family: var(--font-sans);
|
|
128
148
|
--notification-success-text-font-size: var(--font-size-md);
|
|
129
149
|
--notification-success-text-font-weight: var(--font-weight-extralight);
|
|
130
|
-
--notification-success-text-line-height: var(--line-height-
|
|
150
|
+
--notification-success-text-line-height: var(--line-height-md);
|
|
131
151
|
|
|
132
152
|
/* Warning */
|
|
133
153
|
--notification-warning-surface: var(--surface-warning);
|
|
@@ -141,12 +161,12 @@
|
|
|
141
161
|
--notification-warning-title-font-family: var(--font-sans);
|
|
142
162
|
--notification-warning-title-font-size: var(--font-size-lg);
|
|
143
163
|
--notification-warning-title-font-weight: var(--font-weight-normal);
|
|
144
|
-
--notification-warning-title-line-height: var(--line-height-
|
|
164
|
+
--notification-warning-title-line-height: var(--line-height-sm);
|
|
145
165
|
--notification-warning-text: var(--text-primary);
|
|
146
166
|
--notification-warning-text-font-family: var(--font-sans);
|
|
147
167
|
--notification-warning-text-font-size: var(--font-size-md);
|
|
148
168
|
--notification-warning-text-font-weight: var(--font-weight-extralight);
|
|
149
|
-
--notification-warning-text-line-height: var(--line-height-
|
|
169
|
+
--notification-warning-text-line-height: var(--line-height-md);
|
|
150
170
|
|
|
151
171
|
/* Danger */
|
|
152
172
|
--notification-danger-surface: var(--surface-danger);
|
|
@@ -160,12 +180,12 @@
|
|
|
160
180
|
--notification-danger-title-font-family: var(--font-sans);
|
|
161
181
|
--notification-danger-title-font-size: var(--font-size-lg);
|
|
162
182
|
--notification-danger-title-font-weight: var(--font-weight-normal);
|
|
163
|
-
--notification-danger-title-line-height: var(--line-height-
|
|
183
|
+
--notification-danger-title-line-height: var(--line-height-sm);
|
|
164
184
|
--notification-danger-text: var(--text-primary);
|
|
165
185
|
--notification-danger-text-font-family: var(--font-sans);
|
|
166
186
|
--notification-danger-text-font-size: var(--font-size-md);
|
|
167
187
|
--notification-danger-text-font-weight: var(--font-weight-extralight);
|
|
168
|
-
--notification-danger-text-line-height: var(--line-height-
|
|
188
|
+
--notification-danger-text-line-height: var(--line-height-md);
|
|
169
189
|
}
|
|
170
190
|
|
|
171
191
|
.notification {
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
value?: number;
|
|
4
|
+
label?: string;
|
|
5
|
+
variant?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
6
|
+
size?: 'default' | 'compact';
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
value = 0,
|
|
12
|
+
label = '',
|
|
13
|
+
variant = 'primary',
|
|
14
|
+
size = 'default',
|
|
15
|
+
showIcon = true
|
|
16
|
+
}: Props = $props();
|
|
7
17
|
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
let clampedValue = $derived(Math.min(100, Math.max(0, value)));
|
|
19
|
+
let isComplete = $derived(clampedValue >= 100);
|
|
10
20
|
</script>
|
|
11
21
|
|
|
12
22
|
<div class="progress {variant}" class:compact={size === 'compact'}>
|
|
@@ -42,12 +52,12 @@
|
|
|
42
52
|
--progressbar-primary-label-font-family: var(--font-sans);
|
|
43
53
|
--progressbar-primary-label-font-size: var(--font-size-sm);
|
|
44
54
|
--progressbar-primary-label-font-weight: var(--font-weight-light);
|
|
45
|
-
--progressbar-primary-label-line-height: var(--line-height-
|
|
55
|
+
--progressbar-primary-label-line-height: var(--line-height-md);
|
|
46
56
|
--progressbar-primary-value: var(--text-tertiary);
|
|
47
57
|
--progressbar-primary-value-font-family: var(--font-mono);
|
|
48
58
|
--progressbar-primary-value-font-size: var(--font-size-xs);
|
|
49
59
|
--progressbar-primary-value-font-weight: var(--font-weight-light);
|
|
50
|
-
--progressbar-primary-value-line-height: var(--line-height-
|
|
60
|
+
--progressbar-primary-value-line-height: var(--line-height-md);
|
|
51
61
|
|
|
52
62
|
/* Success */
|
|
53
63
|
--progressbar-success-track-surface: var(--surface-neutral-low);
|
|
@@ -60,12 +70,12 @@
|
|
|
60
70
|
--progressbar-success-label-font-family: var(--font-sans);
|
|
61
71
|
--progressbar-success-label-font-size: var(--font-size-sm);
|
|
62
72
|
--progressbar-success-label-font-weight: var(--font-weight-light);
|
|
63
|
-
--progressbar-success-label-line-height: var(--line-height-
|
|
73
|
+
--progressbar-success-label-line-height: var(--line-height-md);
|
|
64
74
|
--progressbar-success-value: var(--text-tertiary);
|
|
65
75
|
--progressbar-success-value-font-family: var(--font-mono);
|
|
66
76
|
--progressbar-success-value-font-size: var(--font-size-xs);
|
|
67
77
|
--progressbar-success-value-font-weight: var(--font-weight-light);
|
|
68
|
-
--progressbar-success-value-line-height: var(--line-height-
|
|
78
|
+
--progressbar-success-value-line-height: var(--line-height-md);
|
|
69
79
|
|
|
70
80
|
/* Warning */
|
|
71
81
|
--progressbar-warning-track-surface: var(--surface-neutral-low);
|
|
@@ -78,12 +88,12 @@
|
|
|
78
88
|
--progressbar-warning-label-font-family: var(--font-sans);
|
|
79
89
|
--progressbar-warning-label-font-size: var(--font-size-sm);
|
|
80
90
|
--progressbar-warning-label-font-weight: var(--font-weight-light);
|
|
81
|
-
--progressbar-warning-label-line-height: var(--line-height-
|
|
91
|
+
--progressbar-warning-label-line-height: var(--line-height-md);
|
|
82
92
|
--progressbar-warning-value: var(--text-tertiary);
|
|
83
93
|
--progressbar-warning-value-font-family: var(--font-mono);
|
|
84
94
|
--progressbar-warning-value-font-size: var(--font-size-xs);
|
|
85
95
|
--progressbar-warning-value-font-weight: var(--font-weight-light);
|
|
86
|
-
--progressbar-warning-value-line-height: var(--line-height-
|
|
96
|
+
--progressbar-warning-value-line-height: var(--line-height-md);
|
|
87
97
|
|
|
88
98
|
/* Danger */
|
|
89
99
|
--progressbar-danger-track-surface: var(--surface-neutral-low);
|
|
@@ -96,12 +106,12 @@
|
|
|
96
106
|
--progressbar-danger-label-font-family: var(--font-sans);
|
|
97
107
|
--progressbar-danger-label-font-size: var(--font-size-sm);
|
|
98
108
|
--progressbar-danger-label-font-weight: var(--font-weight-light);
|
|
99
|
-
--progressbar-danger-label-line-height: var(--line-height-
|
|
109
|
+
--progressbar-danger-label-line-height: var(--line-height-md);
|
|
100
110
|
--progressbar-danger-value: var(--text-tertiary);
|
|
101
111
|
--progressbar-danger-value-font-family: var(--font-mono);
|
|
102
112
|
--progressbar-danger-value-font-size: var(--font-size-xs);
|
|
103
113
|
--progressbar-danger-value-font-weight: var(--font-weight-light);
|
|
104
|
-
--progressbar-danger-value-line-height: var(--line-height-
|
|
114
|
+
--progressbar-danger-value-line-height: var(--line-height-md);
|
|
105
115
|
|
|
106
116
|
/* Info */
|
|
107
117
|
--progressbar-info-track-surface: var(--surface-neutral-low);
|
|
@@ -114,12 +124,12 @@
|
|
|
114
124
|
--progressbar-info-label-font-family: var(--font-sans);
|
|
115
125
|
--progressbar-info-label-font-size: var(--font-size-sm);
|
|
116
126
|
--progressbar-info-label-font-weight: var(--font-weight-light);
|
|
117
|
-
--progressbar-info-label-line-height: var(--line-height-
|
|
127
|
+
--progressbar-info-label-line-height: var(--line-height-md);
|
|
118
128
|
--progressbar-info-value: var(--text-tertiary);
|
|
119
129
|
--progressbar-info-value-font-family: var(--font-mono);
|
|
120
130
|
--progressbar-info-value-font-size: var(--font-size-xs);
|
|
121
131
|
--progressbar-info-value-font-weight: var(--font-weight-light);
|
|
122
|
-
--progressbar-info-value-line-height: var(--line-height-
|
|
132
|
+
--progressbar-info-value-line-height: var(--line-height-md);
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
.progress {
|
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
/** Click callback. Preferred over `on:click` from 0.5.0 onward. */
|
|
10
|
+
onclick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
active = false,
|
|
15
|
+
label,
|
|
16
|
+
color = '',
|
|
17
|
+
class: className = '',
|
|
18
|
+
onclick
|
|
19
|
+
}: Props = $props();
|
|
9
20
|
|
|
21
|
+
// Dual-fire bridge — see Button.svelte for the deprecation timeline.
|
|
10
22
|
const dispatch = createEventDispatcher();
|
|
23
|
+
|
|
24
|
+
function fireClick() {
|
|
25
|
+
onclick?.();
|
|
26
|
+
dispatch('click');
|
|
27
|
+
}
|
|
11
28
|
</script>
|
|
12
29
|
|
|
13
30
|
<button
|
|
14
31
|
class="radio-button {className}"
|
|
15
32
|
class:active
|
|
16
33
|
style={color ? `--radiobutton-color: ${color};` : ''}
|
|
17
|
-
|
|
34
|
+
onclick={fireClick}
|
|
18
35
|
>
|
|
19
36
|
<span class="radio-dot"></span>
|
|
20
37
|
<span class="radio-label">{label}</span>
|
|
@@ -31,7 +48,7 @@
|
|
|
31
48
|
--radiobutton-default-label-font-family: var(--font-sans);
|
|
32
49
|
--radiobutton-default-label-font-size: var(--font-size-md);
|
|
33
50
|
--radiobutton-default-label-font-weight: var(--font-weight-semibold);
|
|
34
|
-
--radiobutton-default-label-line-height: var(--line-height-
|
|
51
|
+
--radiobutton-default-label-line-height: var(--line-height-xs);
|
|
35
52
|
|
|
36
53
|
/* Hover */
|
|
37
54
|
--radiobutton-hover-dot-border-color: var(--border-neutral);
|
|
@@ -42,7 +59,7 @@
|
|
|
42
59
|
--radiobutton-hover-label-font-family: var(--font-sans);
|
|
43
60
|
--radiobutton-hover-label-font-size: var(--font-size-md);
|
|
44
61
|
--radiobutton-hover-label-font-weight: var(--font-weight-semibold);
|
|
45
|
-
--radiobutton-hover-label-line-height: var(--line-height-
|
|
62
|
+
--radiobutton-hover-label-line-height: var(--line-height-xs);
|
|
46
63
|
|
|
47
64
|
/* Active */
|
|
48
65
|
--radiobutton-active-dot-border-color: var(--border-neutral);
|
|
@@ -53,7 +70,7 @@
|
|
|
53
70
|
--radiobutton-active-label-font-family: var(--font-sans);
|
|
54
71
|
--radiobutton-active-label-font-size: var(--font-size-md);
|
|
55
72
|
--radiobutton-active-label-font-weight: var(--font-weight-semibold);
|
|
56
|
-
--radiobutton-active-label-line-height: var(--line-height-
|
|
73
|
+
--radiobutton-active-label-line-height: var(--line-height-xs);
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
.radio-button {
|
|
@@ -65,7 +82,7 @@
|
|
|
65
82
|
border: none;
|
|
66
83
|
cursor: pointer;
|
|
67
84
|
transition: all var(--duration-200);
|
|
68
|
-
line-height: var(--line-height-
|
|
85
|
+
line-height: var(--line-height-xs);
|
|
69
86
|
|
|
70
87
|
&:hover,
|
|
71
88
|
&.force-hover {
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { run } from 'svelte/legacy';
|
|
3
|
+
|
|
2
4
|
import { onMount, tick } from 'svelte';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
variant?: 'canvas' | 'neutral' | 'alternate' | 'primary' | 'accent' | 'special';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { title, description = undefined, variant = 'canvas' }: Props = $props();
|
|
7
13
|
|
|
8
|
-
let svgEl: SVGSVGElement | undefined;
|
|
9
|
-
let svgTextEl: SVGTextElement | undefined;
|
|
10
|
-
let svgW = 0;
|
|
11
|
-
let svgH = 0;
|
|
12
|
-
let svgX = 0;
|
|
13
|
-
let svgY = 0;
|
|
14
|
+
let svgEl: SVGSVGElement | undefined = $state();
|
|
15
|
+
let svgTextEl: SVGTextElement | undefined = $state();
|
|
16
|
+
let svgW = $state(0);
|
|
17
|
+
let svgH = $state(0);
|
|
18
|
+
let svgX = $state(0);
|
|
19
|
+
let svgY = $state(0);
|
|
14
20
|
|
|
15
21
|
// feMorphology radius and feFlood flood-color are non-presentation attributes:
|
|
16
22
|
// they can't read CSS vars. We read the resolved values off the SVG element
|
|
@@ -18,8 +24,8 @@
|
|
|
18
24
|
// mutates inline CSS vars on documentElement. Reading the variant-scoped
|
|
19
25
|
// internal `--_divider-title-*` vars (set by the .variant-{v} class) keeps
|
|
20
26
|
// this independent of the variant prop.
|
|
21
|
-
let outlineRadius = '0';
|
|
22
|
-
let outlineColor = '#000';
|
|
27
|
+
let outlineRadius = $state('0');
|
|
28
|
+
let outlineColor = $state('#000');
|
|
23
29
|
// Stable per-instance id so multiple SectionDividers on the same page each
|
|
24
30
|
// bind their <text> to their own filter.
|
|
25
31
|
const filterId = `sd-outline-${Math.random().toString(36).slice(2, 10)}`;
|
|
@@ -49,9 +55,11 @@
|
|
|
49
55
|
svgH = Math.ceil(bb.height);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
run(() => {
|
|
59
|
+
if (title) {
|
|
60
|
+
tick().then(() => { measure(); syncFilter(); });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
55
63
|
|
|
56
64
|
onMount(() => {
|
|
57
65
|
measure();
|
|
@@ -108,7 +116,7 @@
|
|
|
108
116
|
--sectiondivider-canvas-title-font-family: var(--font-display);
|
|
109
117
|
--sectiondivider-canvas-title-font-size: var(--font-size-5xl);
|
|
110
118
|
--sectiondivider-canvas-title-font-weight: var(--font-weight-normal);
|
|
111
|
-
--sectiondivider-canvas-title-line-height: var(--line-height-
|
|
119
|
+
--sectiondivider-canvas-title-line-height: var(--line-height-xs);
|
|
112
120
|
--sectiondivider-canvas-title-border-width: var(--border-width-4);
|
|
113
121
|
--sectiondivider-canvas-title-stroke-color: var(--surface-canvas-lowest);
|
|
114
122
|
/* Title stroke defaults intentionally diverge per variant — the property
|
|
@@ -118,7 +126,7 @@
|
|
|
118
126
|
--sectiondivider-canvas-description-font-family: var(--font-sans);
|
|
119
127
|
--sectiondivider-canvas-description-font-size: var(--font-size-md);
|
|
120
128
|
--sectiondivider-canvas-description-font-weight: var(--font-weight-normal);
|
|
121
|
-
--sectiondivider-canvas-description-line-height: var(--line-height-
|
|
129
|
+
--sectiondivider-canvas-description-line-height: var(--line-height-md);
|
|
122
130
|
--sectiondivider-canvas-gradient-angle: var(--gradient-angle-diagonal);
|
|
123
131
|
--sectiondivider-canvas-gradient-stop-1-color: var(--surface-canvas-highest);
|
|
124
132
|
--sectiondivider-canvas-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -137,14 +145,14 @@
|
|
|
137
145
|
--sectiondivider-neutral-title-font-family: var(--font-display);
|
|
138
146
|
--sectiondivider-neutral-title-font-size: var(--font-size-5xl);
|
|
139
147
|
--sectiondivider-neutral-title-font-weight: var(--font-weight-normal);
|
|
140
|
-
--sectiondivider-neutral-title-line-height: var(--line-height-
|
|
148
|
+
--sectiondivider-neutral-title-line-height: var(--line-height-xs);
|
|
141
149
|
--sectiondivider-neutral-title-border-width: var(--border-width-4);
|
|
142
150
|
--sectiondivider-neutral-title-stroke-color: var(--surface-neutral-lowest);
|
|
143
151
|
--sectiondivider-neutral-description: var(--text-secondary);
|
|
144
152
|
--sectiondivider-neutral-description-font-family: var(--font-sans);
|
|
145
153
|
--sectiondivider-neutral-description-font-size: var(--font-size-md);
|
|
146
154
|
--sectiondivider-neutral-description-font-weight: var(--font-weight-normal);
|
|
147
|
-
--sectiondivider-neutral-description-line-height: var(--line-height-
|
|
155
|
+
--sectiondivider-neutral-description-line-height: var(--line-height-md);
|
|
148
156
|
--sectiondivider-neutral-gradient-angle: var(--gradient-angle-diagonal);
|
|
149
157
|
--sectiondivider-neutral-gradient-stop-1-color: var(--surface-neutral-highest);
|
|
150
158
|
--sectiondivider-neutral-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -163,14 +171,14 @@
|
|
|
163
171
|
--sectiondivider-alternate-title-font-family: var(--font-display);
|
|
164
172
|
--sectiondivider-alternate-title-font-size: var(--font-size-5xl);
|
|
165
173
|
--sectiondivider-alternate-title-font-weight: var(--font-weight-normal);
|
|
166
|
-
--sectiondivider-alternate-title-line-height: var(--line-height-
|
|
174
|
+
--sectiondivider-alternate-title-line-height: var(--line-height-xs);
|
|
167
175
|
--sectiondivider-alternate-title-border-width: var(--border-width-4);
|
|
168
176
|
--sectiondivider-alternate-title-stroke-color: var(--surface-alternate-lowest);
|
|
169
177
|
--sectiondivider-alternate-description: var(--text-secondary);
|
|
170
178
|
--sectiondivider-alternate-description-font-family: var(--font-sans);
|
|
171
179
|
--sectiondivider-alternate-description-font-size: var(--font-size-md);
|
|
172
180
|
--sectiondivider-alternate-description-font-weight: var(--font-weight-normal);
|
|
173
|
-
--sectiondivider-alternate-description-line-height: var(--line-height-
|
|
181
|
+
--sectiondivider-alternate-description-line-height: var(--line-height-md);
|
|
174
182
|
--sectiondivider-alternate-gradient-angle: var(--gradient-angle-diagonal);
|
|
175
183
|
--sectiondivider-alternate-gradient-stop-1-color: var(--surface-alternate-highest);
|
|
176
184
|
--sectiondivider-alternate-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -189,14 +197,14 @@
|
|
|
189
197
|
--sectiondivider-primary-title-font-family: var(--font-display);
|
|
190
198
|
--sectiondivider-primary-title-font-size: var(--font-size-5xl);
|
|
191
199
|
--sectiondivider-primary-title-font-weight: var(--font-weight-normal);
|
|
192
|
-
--sectiondivider-primary-title-line-height: var(--line-height-
|
|
200
|
+
--sectiondivider-primary-title-line-height: var(--line-height-xs);
|
|
193
201
|
--sectiondivider-primary-title-border-width: var(--border-width-4);
|
|
194
202
|
--sectiondivider-primary-title-stroke-color: var(--surface-brand-lowest);
|
|
195
203
|
--sectiondivider-primary-description: var(--text-secondary);
|
|
196
204
|
--sectiondivider-primary-description-font-family: var(--font-sans);
|
|
197
205
|
--sectiondivider-primary-description-font-size: var(--font-size-md);
|
|
198
206
|
--sectiondivider-primary-description-font-weight: var(--font-weight-normal);
|
|
199
|
-
--sectiondivider-primary-description-line-height: var(--line-height-
|
|
207
|
+
--sectiondivider-primary-description-line-height: var(--line-height-md);
|
|
200
208
|
--sectiondivider-primary-gradient-angle: var(--gradient-angle-diagonal);
|
|
201
209
|
--sectiondivider-primary-gradient-stop-1-color: var(--surface-brand-highest);
|
|
202
210
|
--sectiondivider-primary-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -215,14 +223,14 @@
|
|
|
215
223
|
--sectiondivider-accent-title-font-family: var(--font-display);
|
|
216
224
|
--sectiondivider-accent-title-font-size: var(--font-size-5xl);
|
|
217
225
|
--sectiondivider-accent-title-font-weight: var(--font-weight-normal);
|
|
218
|
-
--sectiondivider-accent-title-line-height: var(--line-height-
|
|
226
|
+
--sectiondivider-accent-title-line-height: var(--line-height-xs);
|
|
219
227
|
--sectiondivider-accent-title-border-width: var(--border-width-4);
|
|
220
228
|
--sectiondivider-accent-title-stroke-color: var(--surface-accent-lowest);
|
|
221
229
|
--sectiondivider-accent-description: var(--text-secondary);
|
|
222
230
|
--sectiondivider-accent-description-font-family: var(--font-sans);
|
|
223
231
|
--sectiondivider-accent-description-font-size: var(--font-size-md);
|
|
224
232
|
--sectiondivider-accent-description-font-weight: var(--font-weight-normal);
|
|
225
|
-
--sectiondivider-accent-description-line-height: var(--line-height-
|
|
233
|
+
--sectiondivider-accent-description-line-height: var(--line-height-md);
|
|
226
234
|
--sectiondivider-accent-gradient-angle: var(--gradient-angle-diagonal);
|
|
227
235
|
--sectiondivider-accent-gradient-stop-1-color: var(--surface-accent-highest);
|
|
228
236
|
--sectiondivider-accent-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -241,14 +249,14 @@
|
|
|
241
249
|
--sectiondivider-special-title-font-family: var(--font-display);
|
|
242
250
|
--sectiondivider-special-title-font-size: var(--font-size-5xl);
|
|
243
251
|
--sectiondivider-special-title-font-weight: var(--font-weight-normal);
|
|
244
|
-
--sectiondivider-special-title-line-height: var(--line-height-
|
|
252
|
+
--sectiondivider-special-title-line-height: var(--line-height-xs);
|
|
245
253
|
--sectiondivider-special-title-border-width: var(--border-width-4);
|
|
246
254
|
--sectiondivider-special-title-stroke-color: var(--surface-special-lowest);
|
|
247
255
|
--sectiondivider-special-description: var(--text-secondary);
|
|
248
256
|
--sectiondivider-special-description-font-family: var(--font-sans);
|
|
249
257
|
--sectiondivider-special-description-font-size: var(--font-size-md);
|
|
250
258
|
--sectiondivider-special-description-font-weight: var(--font-weight-normal);
|
|
251
|
-
--sectiondivider-special-description-line-height: var(--line-height-
|
|
259
|
+
--sectiondivider-special-description-line-height: var(--line-height-md);
|
|
252
260
|
--sectiondivider-special-gradient-angle: var(--gradient-angle-diagonal);
|
|
253
261
|
--sectiondivider-special-gradient-stop-1-color: var(--surface-special-highest);
|
|
254
262
|
--sectiondivider-special-gradient-stop-1-position: var(--gradient-stop-start);
|
|
@@ -8,15 +8,29 @@
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
interface Props {
|
|
12
|
+
segments?: Segment[];
|
|
13
|
+
value?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
forceHoverValue?: string | null;
|
|
16
|
+
/** Selection callback. Preferred over `on:change` from 0.5.0 onward. */
|
|
17
|
+
onchange?: (value: string) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
segments = [],
|
|
22
|
+
value = $bindable(''),
|
|
23
|
+
disabled = false,
|
|
24
|
+
forceHoverValue = null,
|
|
25
|
+
onchange
|
|
26
|
+
}: Props = $props();
|
|
15
27
|
|
|
28
|
+
// Dual-fire bridge — see Button.svelte for the deprecation timeline.
|
|
16
29
|
const dispatch = createEventDispatcher<{ change: string }>();
|
|
17
30
|
|
|
18
31
|
function select(v: string) {
|
|
19
32
|
value = v;
|
|
33
|
+
onchange?.(v);
|
|
20
34
|
dispatch('change', v);
|
|
21
35
|
}
|
|
22
36
|
</script>
|
|
@@ -34,7 +48,7 @@
|
|
|
34
48
|
disabled={disabled || seg.disabled}
|
|
35
49
|
role="radio"
|
|
36
50
|
aria-checked={value === seg.value}
|
|
37
|
-
|
|
51
|
+
onclick={() => select(seg.value)}
|
|
38
52
|
>
|
|
39
53
|
{#if seg.icon}<i class={seg.icon}></i>{/if}
|
|
40
54
|
<span>{seg.label}</span>
|
|
@@ -64,7 +78,7 @@
|
|
|
64
78
|
--segmentedcontrol-option-text-font-family: var(--font-sans);
|
|
65
79
|
--segmentedcontrol-option-text-font-size: var(--font-size-md);
|
|
66
80
|
--segmentedcontrol-option-text-font-weight: var(--font-weight-normal);
|
|
67
|
-
--segmentedcontrol-option-text-line-height: var(--line-height-
|
|
81
|
+
--segmentedcontrol-option-text-line-height: var(--line-height-md);
|
|
68
82
|
--segmentedcontrol-option-icon: var(--text-secondary);
|
|
69
83
|
--segmentedcontrol-option-icon-size: var(--icon-size-md);
|
|
70
84
|
|
|
@@ -74,7 +88,7 @@
|
|
|
74
88
|
--segmentedcontrol-option-hover-text-font-family: var(--font-sans);
|
|
75
89
|
--segmentedcontrol-option-hover-text-font-size: var(--font-size-md);
|
|
76
90
|
--segmentedcontrol-option-hover-text-font-weight: var(--font-weight-normal);
|
|
77
|
-
--segmentedcontrol-option-hover-text-line-height: var(--line-height-
|
|
91
|
+
--segmentedcontrol-option-hover-text-line-height: var(--line-height-md);
|
|
78
92
|
--segmentedcontrol-option-hover-icon: var(--text-secondary);
|
|
79
93
|
--segmentedcontrol-option-hover-icon-size: var(--icon-size-md);
|
|
80
94
|
|
|
@@ -84,7 +98,7 @@
|
|
|
84
98
|
--segmentedcontrol-selected-text-font-family: var(--font-sans);
|
|
85
99
|
--segmentedcontrol-selected-text-font-size: var(--font-size-md);
|
|
86
100
|
--segmentedcontrol-selected-text-font-weight: var(--font-weight-semibold);
|
|
87
|
-
--segmentedcontrol-selected-text-line-height: var(--line-height-
|
|
101
|
+
--segmentedcontrol-selected-text-line-height: var(--line-height-md);
|
|
88
102
|
--segmentedcontrol-selected-icon: var(--text-secondary);
|
|
89
103
|
--segmentedcontrol-selected-icon-size: var(--icon-size-md);
|
|
90
104
|
--segmentedcontrol-selected-border: var(--border-success);
|
|
@@ -97,7 +111,7 @@
|
|
|
97
111
|
--segmentedcontrol-disabled-text-font-family: var(--font-sans);
|
|
98
112
|
--segmentedcontrol-disabled-text-font-size: var(--font-size-md);
|
|
99
113
|
--segmentedcontrol-disabled-text-font-weight: var(--font-weight-light);
|
|
100
|
-
--segmentedcontrol-disabled-text-line-height: var(--line-height-
|
|
114
|
+
--segmentedcontrol-disabled-text-line-height: var(--line-height-md);
|
|
101
115
|
--segmentedcontrol-disabled-icon: var(--text-tertiary);
|
|
102
116
|
--segmentedcontrol-disabled-icon-size: var(--icon-size-md);
|
|
103
117
|
}
|
|
@@ -8,18 +8,31 @@
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
interface Props {
|
|
12
|
+
tabs?: Tab[];
|
|
13
|
+
selectedTab?: string;
|
|
14
|
+
iconOnly?: boolean;
|
|
15
|
+
class?: string;
|
|
16
|
+
/** Tab-change callback. Preferred over `on:tabChange` from 0.5.0 onward. */
|
|
17
|
+
ontabChange?: (id: string) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
tabs = [],
|
|
22
|
+
selectedTab = '',
|
|
23
|
+
iconOnly = false,
|
|
24
|
+
class: className = '',
|
|
25
|
+
ontabChange
|
|
26
|
+
}: Props = $props();
|
|
16
27
|
|
|
28
|
+
// Dual-fire bridge — see Button.svelte for the deprecation timeline.
|
|
17
29
|
const dispatch = createEventDispatcher<{
|
|
18
30
|
tabChange: string;
|
|
19
31
|
}>();
|
|
20
32
|
|
|
21
33
|
function selectTab(tab: Tab) {
|
|
22
34
|
if (!tab.disabled) {
|
|
35
|
+
ontabChange?.(tab.id);
|
|
23
36
|
dispatch('tabChange', tab.id);
|
|
24
37
|
}
|
|
25
38
|
}
|
|
@@ -32,7 +45,7 @@
|
|
|
32
45
|
class:active={selectedTab === tab.id}
|
|
33
46
|
class:icon-only={iconOnly}
|
|
34
47
|
disabled={tab.disabled}
|
|
35
|
-
|
|
48
|
+
onclick={() => selectTab(tab)}
|
|
36
49
|
>
|
|
37
50
|
{#if tab.icon}
|
|
38
51
|
<i class={tab.icon}></i>
|
|
@@ -62,7 +75,7 @@
|
|
|
62
75
|
--tabbar-default-text-font-family: var(--font-sans);
|
|
63
76
|
--tabbar-default-text-font-size: var(--font-size-md);
|
|
64
77
|
--tabbar-default-text-font-weight: var(--font-weight-light);
|
|
65
|
-
--tabbar-default-text-line-height: var(--line-height-
|
|
78
|
+
--tabbar-default-text-line-height: var(--line-height-md);
|
|
66
79
|
--tabbar-default-icon-size: var(--icon-size-md);
|
|
67
80
|
--tabbar-default-padding: var(--space-8);
|
|
68
81
|
--tabbar-default-border: var(--color-transparent);
|
|
@@ -78,7 +91,7 @@
|
|
|
78
91
|
--tabbar-hover-text-font-family: var(--font-sans);
|
|
79
92
|
--tabbar-hover-text-font-size: var(--font-size-md);
|
|
80
93
|
--tabbar-hover-text-font-weight: var(--font-weight-light);
|
|
81
|
-
--tabbar-hover-text-line-height: var(--line-height-
|
|
94
|
+
--tabbar-hover-text-line-height: var(--line-height-md);
|
|
82
95
|
--tabbar-hover-icon-size: var(--icon-size-md);
|
|
83
96
|
--tabbar-hover-padding: var(--space-8);
|
|
84
97
|
--tabbar-hover-border: var(--color-transparent);
|
|
@@ -94,7 +107,7 @@
|
|
|
94
107
|
--tabbar-active-text-font-family: var(--font-sans);
|
|
95
108
|
--tabbar-active-text-font-size: var(--font-size-md);
|
|
96
109
|
--tabbar-active-text-font-weight: var(--font-weight-light);
|
|
97
|
-
--tabbar-active-text-line-height: var(--line-height-
|
|
110
|
+
--tabbar-active-text-line-height: var(--line-height-md);
|
|
98
111
|
--tabbar-active-icon-size: var(--icon-size-md);
|
|
99
112
|
--tabbar-active-padding: var(--space-8);
|
|
100
113
|
--tabbar-active-tab-border-color: var(--color-transparent);
|
|
@@ -107,7 +120,7 @@
|
|
|
107
120
|
--tabbar-disabled-text-font-family: var(--font-sans);
|
|
108
121
|
--tabbar-disabled-text-font-size: var(--font-size-md);
|
|
109
122
|
--tabbar-disabled-text-font-weight: var(--font-weight-light);
|
|
110
|
-
--tabbar-disabled-text-line-height: var(--line-height-
|
|
123
|
+
--tabbar-disabled-text-line-height: var(--line-height-md);
|
|
111
124
|
--tabbar-disabled-icon-size: var(--icon-size-md);
|
|
112
125
|
--tabbar-disabled-padding: var(--space-8);
|
|
113
126
|
--tabbar-disabled-border: var(--color-transparent);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
let { children }: Props = $props();
|
|
2
7
|
</script>
|
|
3
8
|
|
|
4
9
|
<div class="table-wrapper">
|
|
5
|
-
|
|
10
|
+
{@render children?.()}
|
|
6
11
|
</div>
|
|
7
12
|
|
|
8
13
|
<style lang="scss">
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
--table-default-header-font-family: var(--font-sans);
|
|
20
25
|
--table-default-header-font-size: var(--font-size-sm);
|
|
21
26
|
--table-default-header-font-weight: var(--font-weight-normal);
|
|
22
|
-
--table-default-header-line-height: var(--line-height-
|
|
27
|
+
--table-default-header-line-height: var(--line-height-xs);
|
|
23
28
|
--table-default-header-padding: var(--space-12);
|
|
24
29
|
--table-default-header-border: var(--border-canvas-subtle);
|
|
25
30
|
--table-default-header-border-width: var(--border-width-1);
|
|
@@ -29,7 +34,7 @@
|
|
|
29
34
|
--table-default-cell-font-family: var(--font-sans);
|
|
30
35
|
--table-default-cell-font-size: var(--font-size-sm);
|
|
31
36
|
--table-default-cell-font-weight: var(--font-weight-normal);
|
|
32
|
-
--table-default-cell-line-height: var(--line-height-
|
|
37
|
+
--table-default-cell-line-height: var(--line-height-md);
|
|
33
38
|
--table-default-cell-padding: var(--space-8);
|
|
34
39
|
|
|
35
40
|
/* Row */
|