@motion-proto/live-tokens 0.1.1 → 0.3.2
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 +168 -21
- package/dist-plugin/index.cjs +823 -336
- package/dist-plugin/index.d.cts +9 -7
- package/dist-plugin/index.d.ts +9 -7
- package/dist-plugin/index.js +822 -335
- package/package.json +46 -20
- package/src/assets/newspaper.webp +0 -0
- package/src/assets/offering.webp +0 -0
- package/src/component-editor/BadgeEditor.svelte +170 -0
- package/src/component-editor/CalloutEditor.svelte +103 -0
- package/src/component-editor/CardEditor.svelte +184 -0
- package/src/component-editor/CollapsibleSectionEditor.svelte +167 -0
- package/src/component-editor/CornerBadgeEditor.svelte +207 -0
- package/src/component-editor/DialogEditor.svelte +172 -0
- package/src/component-editor/ImageEditor.svelte +72 -0
- package/src/component-editor/InlineEditActionsEditor.svelte +83 -0
- package/src/component-editor/NotificationEditor.svelte +160 -0
- package/src/component-editor/ProgressBarEditor.svelte +124 -0
- package/src/component-editor/RadioButtonEditor.svelte +140 -0
- package/src/component-editor/SectionDividerEditor.svelte +263 -0
- package/src/component-editor/SegmentedControlEditor.svelte +154 -0
- package/src/component-editor/StandardButtonsEditor.svelte +178 -0
- package/src/component-editor/TabBarEditor.svelte +137 -0
- package/src/component-editor/TableEditor.svelte +128 -0
- package/src/component-editor/TooltipEditor.svelte +122 -0
- package/src/component-editor/editorTokens.test.ts +93 -0
- package/src/component-editor/groupKeySlots.test.ts +67 -0
- package/src/component-editor/groupKeySnapshot.test.ts +52 -0
- package/src/component-editor/index.ts +5 -0
- package/src/component-editor/registry.ts +246 -0
- package/src/component-editor/scaffolding/AngleDial.svelte +185 -0
- package/src/component-editor/scaffolding/ComponentEditorBase.svelte +96 -0
- package/src/component-editor/scaffolding/ComponentFileManager.svelte +682 -0
- package/src/component-editor/scaffolding/ComponentFileMenu.svelte +312 -0
- package/src/component-editor/scaffolding/ComponentsTab.svelte +69 -0
- package/src/component-editor/scaffolding/CopyFromMenu.svelte +246 -0
- package/src/component-editor/scaffolding/DemoHeader.svelte +21 -0
- package/src/component-editor/scaffolding/DividerEditor.svelte +81 -0
- package/src/component-editor/scaffolding/FieldsetWrapper.svelte +46 -0
- package/src/component-editor/scaffolding/GradientCard.svelte +291 -0
- package/src/component-editor/scaffolding/LinkageChart.svelte +297 -0
- package/src/component-editor/scaffolding/LinkedBlock.svelte +418 -0
- package/src/component-editor/scaffolding/NonStylableConfig.svelte +57 -0
- package/src/component-editor/scaffolding/SaveAsDialog.svelte +177 -0
- package/src/component-editor/scaffolding/ShadowBackdrop.svelte +25 -0
- package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +56 -0
- package/src/component-editor/scaffolding/StateBlock.svelte +115 -0
- package/src/component-editor/scaffolding/TokenLayout.svelte +511 -0
- package/src/component-editor/scaffolding/TypeEditor.svelte +82 -0
- package/src/component-editor/scaffolding/VariantGroup.svelte +277 -0
- package/src/component-editor/scaffolding/buildTypeGroupTokens.ts +97 -0
- package/src/component-editor/scaffolding/componentSectionType.ts +8 -0
- package/src/component-editor/scaffolding/componentSources.ts +9 -0
- package/src/component-editor/scaffolding/defaultSections.ts +16 -0
- package/src/component-editor/scaffolding/editorContext.ts +44 -0
- package/src/component-editor/scaffolding/linkedBlock.ts +226 -0
- package/src/component-editor/scaffolding/siblings.ts +33 -0
- package/src/component-editor/scaffolding/types.ts +39 -0
- package/src/components/Badge.svelte +231 -42
- package/src/components/Button.svelte +324 -124
- package/src/components/Callout.svelte +145 -0
- package/src/components/Card.svelte +123 -25
- package/src/components/CollapsibleSection.svelte +213 -35
- package/src/components/CornerBadge.svelte +224 -0
- package/src/components/Dialog.svelte +137 -114
- package/src/components/Image.svelte +43 -0
- package/src/components/InlineEditActions.svelte +74 -14
- package/src/components/Notification.svelte +184 -163
- package/src/components/ProgressBar.svelte +216 -22
- package/src/components/RadioButton.svelte +110 -40
- package/src/components/SectionDivider.svelte +428 -74
- package/src/components/SegmentedControl.svelte +203 -0
- package/src/components/TabBar.svelte +146 -21
- package/src/components/Table.svelte +102 -0
- package/src/components/Tooltip.svelte +45 -19
- package/src/components/types.ts +51 -0
- package/src/data/google-fonts.json +75 -0
- package/src/lib/ColumnsOverlay.svelte +20 -7
- package/src/lib/LiveEditorOverlay.svelte +257 -78
- package/src/lib/columnsOverlay.ts +21 -17
- package/src/lib/componentConfig.test.ts +204 -0
- package/src/lib/componentConfigKeys.ts +19 -0
- package/src/lib/componentConfigService.ts +88 -0
- package/src/lib/copyPopover.ts +30 -0
- package/src/lib/cssVarSync.ts +59 -7
- package/src/lib/editorConfigStore.ts +0 -10
- package/src/lib/editorCore.ts +402 -0
- package/src/lib/editorKeybindings.ts +52 -0
- package/src/lib/editorPersistence.ts +106 -0
- package/src/lib/editorRenderer.ts +74 -0
- package/src/lib/editorStore.test.ts +328 -0
- package/src/lib/editorStore.ts +412 -0
- package/src/lib/editorTypes.ts +100 -0
- package/src/lib/editorViewStore.ts +55 -0
- package/src/lib/files/versionedFileResource.ts +140 -0
- package/src/lib/fontLoader.ts +130 -0
- package/src/lib/fontMigration.ts +140 -0
- package/src/lib/fontParse.ts +168 -0
- package/src/lib/index.ts +48 -30
- package/src/lib/lazyConfig.test.ts +54 -0
- package/src/lib/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +64 -0
- package/src/lib/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +71 -0
- package/src/lib/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +43 -0
- package/src/lib/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +68 -0
- package/src/lib/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +35 -0
- package/src/lib/migrations/2026-05-10-sectiondivider-gradient-stops.ts +50 -0
- package/src/lib/migrations/2026-05-13-primary-to-brand.ts +90 -0
- package/src/lib/migrations/index.ts +93 -0
- package/src/lib/migrations/migrations.test.ts +341 -0
- package/src/lib/navLinkTypes.ts +1 -0
- package/src/lib/overlayState.ts +3 -0
- package/src/lib/paletteDerivation.ts +300 -0
- package/src/lib/parentRouteStore.ts +42 -0
- package/src/lib/parsers/globalRootBlock.ts +32 -0
- package/src/lib/presetService.ts +94 -0
- package/src/lib/router.ts +42 -10
- package/src/lib/scrollSection.ts +45 -0
- package/src/lib/slices/columns.ts +59 -0
- package/src/lib/slices/components.ts +362 -0
- package/src/lib/slices/domainVars.ts +15 -0
- package/src/lib/slices/fonts.ts +30 -0
- package/src/lib/slices/gradients.ts +153 -0
- package/src/lib/slices/overlays.ts +132 -0
- package/src/lib/slices/palettes.ts +26 -0
- package/src/lib/slices/shadows.ts +123 -0
- package/src/lib/storage.ts +88 -0
- package/src/lib/themeInit.ts +74 -0
- package/src/lib/themeService.ts +101 -0
- package/src/lib/themeTypes.ts +146 -0
- package/src/lib/tokenRegistry.ts +148 -0
- package/src/pages/ComponentEditorPage.svelte +384 -0
- package/src/pages/ComponentEditorPage.svelte.d.ts +2 -0
- package/src/pages/Editor.svelte +98 -0
- package/src/pages/Editor.svelte.d.ts +2 -0
- package/src/pages/EditorShell.svelte +348 -0
- package/src/styles/_padding.scss +34 -0
- package/src/styles/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
- package/src/styles/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Manrope/Manrope-latin.woff2 +0 -0
- package/src/styles/fonts.css +22 -10
- package/src/styles/form-controls.css +14 -16
- package/src/styles/tokens.css +1322 -0
- package/src/styles/ui-editor.css +126 -0
- package/src/{showcase → ui}/BezierCurveEditor.svelte +14 -14
- package/src/{showcase → ui}/ColorEditPanel.svelte +42 -36
- package/src/ui/EditorViewSwitcher.svelte +180 -0
- package/src/ui/FontStackEditor.svelte +360 -0
- package/src/ui/GradientEditor.svelte +461 -0
- package/src/ui/GradientStopPicker.svelte +74 -0
- package/src/ui/PaletteEditor.svelte +1590 -0
- package/src/ui/PaletteEditor.test.ts +108 -0
- package/src/ui/PresetFileManager.svelte +567 -0
- package/src/ui/ProjectFontsSection.svelte +645 -0
- package/src/{showcase → ui}/SurfacesTab.svelte +39 -39
- package/src/{showcase → ui}/TextTab.svelte +27 -27
- package/src/{showcase/TokenFileManager.svelte → ui/ThemeFileManager.svelte} +196 -112
- package/src/ui/Toggle.svelte +108 -0
- package/src/ui/UICopyPopover.svelte +78 -0
- package/src/{showcase/EditorDialog.svelte → ui/UIDialog.svelte} +66 -25
- package/src/ui/UIFontFamilySelector.svelte +309 -0
- package/src/ui/UIFontSizeSelector.svelte +165 -0
- package/src/ui/UIFontWeightSelector.svelte +52 -0
- package/src/ui/UILineHeightSelector.svelte +47 -0
- package/src/ui/UILinkToggle.svelte +60 -0
- package/src/ui/UIOptionItem.svelte +74 -0
- package/src/ui/UIOptionList.svelte +27 -0
- package/src/ui/UIPaddingSelector.svelte +661 -0
- package/src/ui/UIPaletteSelector.svelte +1084 -0
- package/src/ui/UIRadio.svelte +72 -0
- package/src/ui/UIRadioGroup.svelte +59 -0
- package/src/ui/UIRelinkConfirmPopover.svelte +235 -0
- package/src/ui/UITokenSelector.svelte +509 -0
- package/src/ui/UIVariantSelector.svelte +145 -0
- package/src/ui/VariablesTab.svelte +252 -0
- package/src/ui/index.ts +31 -0
- package/src/ui/keepInViewport.ts +84 -0
- package/src/ui/palette/GradientStopEditor.svelte +482 -0
- package/src/ui/palette/OverridesPanel.svelte +526 -0
- package/src/ui/palette/PaletteBase.svelte +165 -0
- package/src/ui/palette/ScaleCurveEditor.svelte +38 -0
- package/src/ui/palette/paletteEditorState.ts +89 -0
- package/src/ui/sections/ColumnsSection.svelte +273 -0
- package/src/ui/sections/GradientsSection.svelte +147 -0
- package/src/ui/sections/OverlaysSection.svelte +670 -0
- package/src/ui/sections/ShadowsSection.svelte +1250 -0
- package/src/ui/sections/TokenScaleTable.svelte +332 -0
- package/src/ui/sections/tokenScales.ts +81 -0
- package/src/ui/variantScales.ts +108 -0
- package/src/components/DetailNav.svelte +0 -78
- package/src/components/Toggle.svelte +0 -86
- package/src/lib/tokenInit.ts +0 -29
- package/src/lib/tokenService.ts +0 -144
- package/src/lib/tokenTypes.ts +0 -45
- package/src/pages/Admin.svelte +0 -100
- package/src/pages/ShowcasePage.svelte +0 -144
- package/src/showcase/BackupBrowser.svelte +0 -617
- package/src/showcase/ComponentsTab.svelte +0 -105
- package/src/showcase/PaletteEditor.svelte +0 -2579
- package/src/showcase/PaletteSelector.svelte +0 -627
- package/src/showcase/TokenMap.svelte +0 -54
- package/src/showcase/VariablesTab.svelte +0 -2655
- package/src/showcase/VisualsTab.svelte +0 -231
- package/src/showcase/demos/BadgeDemo.svelte +0 -56
- package/src/showcase/demos/CardDemo.svelte +0 -50
- package/src/showcase/demos/ChoiceButtonsDemo.svelte +0 -192
- package/src/showcase/demos/CollapsibleSectionDemo.svelte +0 -54
- package/src/showcase/demos/DialogDemo.svelte +0 -42
- package/src/showcase/demos/InlineEditActionsDemo.svelte +0 -25
- package/src/showcase/demos/NotificationDemo.svelte +0 -147
- package/src/showcase/demos/ProgressBarDemo.svelte +0 -54
- package/src/showcase/demos/RadioButtonDemo.svelte +0 -56
- package/src/showcase/demos/SectionDividerDemo.svelte +0 -77
- package/src/showcase/demos/StandardButtonsDemo.svelte +0 -455
- package/src/showcase/demos/TabBarDemo.svelte +0 -58
- package/src/showcase/demos/TooltipDemo.svelte +0 -52
- package/src/showcase/editor.css +0 -93
- package/src/showcase/index.ts +0 -17
- package/src/styles/fonts/Domine/Domine-VariableFont_wght.ttf +0 -0
- package/src/styles/fonts/Domine/OFL.txt +0 -97
- package/src/styles/fonts/Domine/README.txt +0 -66
- /package/src/{showcase → ui}/curveEngine.ts +0 -0
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
export let disabled = false;
|
|
10
10
|
export let saveTitle = "Save";
|
|
11
11
|
export let cancelTitle = "Cancel";
|
|
12
|
+
let className: string = '';
|
|
13
|
+
export { className as class };
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
|
-
<div class="inline-actions">
|
|
16
|
+
<div class="inline-actions {className}">
|
|
15
17
|
<button
|
|
16
18
|
class="save-btn"
|
|
19
|
+
type="button"
|
|
17
20
|
on:click={onSave}
|
|
18
21
|
{disabled}
|
|
19
22
|
title={saveTitle}
|
|
@@ -22,6 +25,7 @@
|
|
|
22
25
|
</button>
|
|
23
26
|
<button
|
|
24
27
|
class="cancel-btn"
|
|
28
|
+
type="button"
|
|
25
29
|
on:click={onCancel}
|
|
26
30
|
disabled={disabled}
|
|
27
31
|
title={cancelTitle}
|
|
@@ -31,6 +35,44 @@
|
|
|
31
35
|
</div>
|
|
32
36
|
|
|
33
37
|
<style lang="scss">
|
|
38
|
+
:global(:root) {
|
|
39
|
+
/* Save (default) */
|
|
40
|
+
--inlineeditactions-save-default-surface: var(--surface-success-low);
|
|
41
|
+
--inlineeditactions-save-default-text: var(--text-success);
|
|
42
|
+
--inlineeditactions-save-default-border: var(--border-success);
|
|
43
|
+
--inlineeditactions-save-default-border-width: var(--border-width-0);
|
|
44
|
+
--inlineeditactions-save-default-radius: var(--radius-md);
|
|
45
|
+
--inlineeditactions-save-default-padding: var(--space-4);
|
|
46
|
+
--inlineeditactions-save-default-icon-size: var(--icon-size-md);
|
|
47
|
+
|
|
48
|
+
/* Save (hover) */
|
|
49
|
+
--inlineeditactions-save-hover-surface: var(--surface-success-high);
|
|
50
|
+
--inlineeditactions-save-hover-text: var(--text-success);
|
|
51
|
+
--inlineeditactions-save-hover-border: var(--border-success);
|
|
52
|
+
--inlineeditactions-save-hover-border-width: var(--border-width-0);
|
|
53
|
+
--inlineeditactions-save-hover-radius: var(--radius-md);
|
|
54
|
+
--inlineeditactions-save-hover-padding: var(--space-4);
|
|
55
|
+
--inlineeditactions-save-hover-icon-size: var(--icon-size-md);
|
|
56
|
+
|
|
57
|
+
/* Cancel (default) */
|
|
58
|
+
--inlineeditactions-cancel-default-surface: var(--surface-danger-low);
|
|
59
|
+
--inlineeditactions-cancel-default-text: var(--text-danger);
|
|
60
|
+
--inlineeditactions-cancel-default-border: var(--border-danger);
|
|
61
|
+
--inlineeditactions-cancel-default-border-width: var(--border-width-0);
|
|
62
|
+
--inlineeditactions-cancel-default-radius: var(--radius-md);
|
|
63
|
+
--inlineeditactions-cancel-default-padding: var(--space-4);
|
|
64
|
+
--inlineeditactions-cancel-default-icon-size: var(--icon-size-md);
|
|
65
|
+
|
|
66
|
+
/* Cancel (hover) */
|
|
67
|
+
--inlineeditactions-cancel-hover-surface: var(--surface-danger-high);
|
|
68
|
+
--inlineeditactions-cancel-hover-text: var(--text-danger);
|
|
69
|
+
--inlineeditactions-cancel-hover-border: var(--border-danger);
|
|
70
|
+
--inlineeditactions-cancel-hover-border-width: var(--border-width-0);
|
|
71
|
+
--inlineeditactions-cancel-hover-radius: var(--radius-md);
|
|
72
|
+
--inlineeditactions-cancel-hover-padding: var(--space-4);
|
|
73
|
+
--inlineeditactions-cancel-hover-icon-size: var(--icon-size-md);
|
|
74
|
+
}
|
|
75
|
+
|
|
34
76
|
.inline-actions {
|
|
35
77
|
display: flex;
|
|
36
78
|
gap: var(--space-8);
|
|
@@ -38,36 +80,54 @@
|
|
|
38
80
|
|
|
39
81
|
.save-btn,
|
|
40
82
|
.cancel-btn {
|
|
41
|
-
padding: var(--space-4) var(--space-8);
|
|
42
|
-
border: none;
|
|
43
|
-
border-radius: var(--radius-md);
|
|
44
83
|
cursor: pointer;
|
|
45
|
-
transition: all
|
|
84
|
+
transition: all var(--duration-200);
|
|
46
85
|
display: flex;
|
|
47
86
|
align-items: center;
|
|
48
87
|
gap: var(--space-8);
|
|
49
88
|
|
|
50
89
|
&:disabled {
|
|
51
|
-
|
|
90
|
+
background: var(--surface-neutral-low);
|
|
91
|
+
color: var(--text-disabled);
|
|
52
92
|
cursor: not-allowed;
|
|
53
93
|
}
|
|
54
94
|
}
|
|
55
95
|
|
|
56
96
|
.save-btn {
|
|
57
|
-
background:
|
|
58
|
-
color:
|
|
97
|
+
background: var(--inlineeditactions-save-default-surface);
|
|
98
|
+
color: var(--inlineeditactions-save-default-text);
|
|
99
|
+
border: var(--inlineeditactions-save-default-border-width) solid var(--inlineeditactions-save-default-border);
|
|
100
|
+
border-radius: var(--inlineeditactions-save-default-radius);
|
|
101
|
+
padding: var(--inlineeditactions-save-default-padding) calc(var(--inlineeditactions-save-default-padding) * 2);
|
|
102
|
+
font-size: var(--inlineeditactions-save-default-icon-size);
|
|
59
103
|
|
|
60
|
-
&:hover:not(:disabled)
|
|
61
|
-
|
|
104
|
+
&:hover:not(:disabled),
|
|
105
|
+
.inline-actions.force-hover &:not(:disabled) {
|
|
106
|
+
background: var(--inlineeditactions-save-hover-surface);
|
|
107
|
+
color: var(--inlineeditactions-save-hover-text);
|
|
108
|
+
border: var(--inlineeditactions-save-hover-border-width) solid var(--inlineeditactions-save-hover-border);
|
|
109
|
+
border-radius: var(--inlineeditactions-save-hover-radius);
|
|
110
|
+
padding: var(--inlineeditactions-save-hover-padding) calc(var(--inlineeditactions-save-hover-padding) * 2);
|
|
111
|
+
font-size: var(--inlineeditactions-save-hover-icon-size);
|
|
62
112
|
}
|
|
63
113
|
}
|
|
64
114
|
|
|
65
115
|
.cancel-btn {
|
|
66
|
-
background:
|
|
67
|
-
color:
|
|
116
|
+
background: var(--inlineeditactions-cancel-default-surface);
|
|
117
|
+
color: var(--inlineeditactions-cancel-default-text);
|
|
118
|
+
border: var(--inlineeditactions-cancel-default-border-width) solid var(--inlineeditactions-cancel-default-border);
|
|
119
|
+
border-radius: var(--inlineeditactions-cancel-default-radius);
|
|
120
|
+
padding: var(--inlineeditactions-cancel-default-padding) calc(var(--inlineeditactions-cancel-default-padding) * 2);
|
|
121
|
+
font-size: var(--inlineeditactions-cancel-default-icon-size);
|
|
68
122
|
|
|
69
|
-
&:hover:not(:disabled)
|
|
70
|
-
|
|
123
|
+
&:hover:not(:disabled),
|
|
124
|
+
.inline-actions.force-hover &:not(:disabled) {
|
|
125
|
+
background: var(--inlineeditactions-cancel-hover-surface);
|
|
126
|
+
color: var(--inlineeditactions-cancel-hover-text);
|
|
127
|
+
border: var(--inlineeditactions-cancel-hover-border-width) solid var(--inlineeditactions-cancel-hover-border);
|
|
128
|
+
border-radius: var(--inlineeditactions-cancel-hover-radius);
|
|
129
|
+
padding: var(--inlineeditactions-cancel-hover-padding) calc(var(--inlineeditactions-cancel-hover-padding) * 2);
|
|
130
|
+
font-size: var(--inlineeditactions-cancel-hover-icon-size);
|
|
71
131
|
}
|
|
72
132
|
}
|
|
73
133
|
</style>
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
3
|
import Button from './Button.svelte';
|
|
4
|
+
import type { NotificationActions } from './types';
|
|
4
5
|
|
|
5
6
|
export let title: string;
|
|
6
7
|
export let description: string;
|
|
7
|
-
export let impact: string = '';
|
|
8
8
|
export let variant: 'info' | 'warning' | 'danger' | 'success' = 'info';
|
|
9
9
|
export let size: 'normal' | 'compact' = 'normal';
|
|
10
10
|
export let icon: string = '';
|
|
11
11
|
export let dismissible: boolean = false;
|
|
12
12
|
export let emphasis: boolean = false;
|
|
13
|
-
|
|
14
|
-
// Action button props
|
|
15
|
-
export let actionText: string = '';
|
|
16
|
-
export let actionIcon: string = '';
|
|
17
|
-
export let onAction: (() => void) | undefined = undefined;
|
|
18
|
-
export let actionInline: boolean = false;
|
|
19
|
-
export let actionHeader: boolean = false; // NEW: Show action button in header row
|
|
13
|
+
export let actions: NotificationActions = {};
|
|
20
14
|
|
|
21
15
|
const dispatch = createEventDispatcher();
|
|
22
16
|
|
|
@@ -36,13 +30,13 @@
|
|
|
36
30
|
</script>
|
|
37
31
|
|
|
38
32
|
<div class="notification" class:info={variant === 'info'} class:warning={variant === 'warning'} class:danger={variant === 'danger'} class:success={variant === 'success'} class:emphasis={emphasis} class:compact={size === 'compact'}>
|
|
39
|
-
<div class="notification-header" class:has-action={
|
|
33
|
+
<div class="notification-header" class:has-action={actions.header}>
|
|
40
34
|
<i class={displayIcon}></i>
|
|
41
35
|
<span class="notification-title">{title}</span>
|
|
42
|
-
{#if
|
|
36
|
+
{#if actions.header}
|
|
43
37
|
<div class="action-button-backdrop">
|
|
44
|
-
<Button variant=
|
|
45
|
-
{
|
|
38
|
+
<Button variant={actions.header.variant ?? 'outline'} icon={actions.header.icon} disabled={actions.header.disabled} on:click={actions.header.onClick}>
|
|
39
|
+
{actions.header.label ?? ''}
|
|
46
40
|
</Button>
|
|
47
41
|
</div>
|
|
48
42
|
{/if}
|
|
@@ -52,44 +46,135 @@
|
|
|
52
46
|
</button>
|
|
53
47
|
{/if}
|
|
54
48
|
</div>
|
|
55
|
-
{#if description && !
|
|
56
|
-
<div class="notification-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
{#if (description && !actions.inline) || actions.right || actions.left}
|
|
50
|
+
<div class="notification-body">
|
|
51
|
+
{#if description && !actions.inline}
|
|
52
|
+
<div class="notification-description">{description}</div>
|
|
53
|
+
{/if}
|
|
54
|
+
{#if actions.right || actions.left}
|
|
55
|
+
<div class="notification-body-actions">
|
|
56
|
+
{#if actions.left}
|
|
57
|
+
<Button variant={actions.left.variant ?? 'outline'} icon={actions.left.icon} disabled={actions.left.disabled} on:click={actions.left.onClick}>
|
|
58
|
+
{actions.left.label ?? ''}
|
|
59
|
+
</Button>
|
|
60
|
+
{/if}
|
|
61
|
+
{#if actions.right}
|
|
62
|
+
<Button variant={actions.right.variant ?? 'primary'} icon={actions.right.icon} disabled={actions.right.disabled} on:click={actions.right.onClick}>
|
|
63
|
+
{actions.right.label ?? ''}
|
|
64
|
+
</Button>
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
60
69
|
{/if}
|
|
61
70
|
<slot />
|
|
62
|
-
{#if
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</div>
|
|
72
|
-
{:else}
|
|
73
|
-
<div class="notification-actions">
|
|
74
|
-
<Button variant="outline" icon={actionIcon} on:click={onAction}>
|
|
75
|
-
{actionText}
|
|
76
|
-
</Button>
|
|
77
|
-
</div>
|
|
78
|
-
{/if}
|
|
71
|
+
{#if actions.inline}
|
|
72
|
+
<div class="notification-actions-inline">
|
|
73
|
+
{#if description}
|
|
74
|
+
<span class="description-text">{description}</span>
|
|
75
|
+
{/if}
|
|
76
|
+
<Button variant={actions.inline.variant ?? 'outline'} icon={actions.inline.icon} disabled={actions.inline.disabled} on:click={actions.inline.onClick}>
|
|
77
|
+
{actions.inline.label ?? ''}
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
79
80
|
{/if}
|
|
80
81
|
</div>
|
|
81
82
|
|
|
82
83
|
<style lang="scss">
|
|
84
|
+
@use '../styles/padding' as *;
|
|
85
|
+
|
|
86
|
+
// The four-variant token block below is intentionally NOT collapsed via SCSS
|
|
87
|
+
// `@each`. The Layer-2 token-discovery parser (`extractGlobalRootBody` in
|
|
88
|
+
// src/lib/parsers/globalRootBlock.ts) reads the `.svelte` source verbatim and
|
|
89
|
+
// does not pre-compile SCSS — wrapping these declarations in `@each` would
|
|
90
|
+
// make the editor's alias picker / file-manager UI see zero tokens for
|
|
91
|
+
// Notification, even though the rendered DOM would be unchanged. The
|
|
92
|
+
// declarations are kept flat by design so the parser can scrape them.
|
|
93
|
+
:global(:root) {
|
|
94
|
+
/* Info */
|
|
95
|
+
--notification-info-surface: var(--surface-info);
|
|
96
|
+
--notification-info-border: var(--border-info);
|
|
97
|
+
--notification-info-border-width: var(--border-width-1);
|
|
98
|
+
--notification-info-radius: var(--radius-md);
|
|
99
|
+
--notification-info-padding: var(--space-12);
|
|
100
|
+
--notification-info-icon: var(--text-info);
|
|
101
|
+
--notification-info-icon-size: var(--icon-size-md);
|
|
102
|
+
--notification-info-title: var(--text-info);
|
|
103
|
+
--notification-info-title-font-family: var(--font-sans);
|
|
104
|
+
--notification-info-title-font-size: var(--font-size-lg);
|
|
105
|
+
--notification-info-title-font-weight: var(--font-weight-normal);
|
|
106
|
+
--notification-info-title-line-height: var(--line-height-snug);
|
|
107
|
+
--notification-info-text: var(--text-primary);
|
|
108
|
+
--notification-info-text-font-family: var(--font-sans);
|
|
109
|
+
--notification-info-text-font-size: var(--font-size-md);
|
|
110
|
+
--notification-info-text-font-weight: var(--font-weight-extralight);
|
|
111
|
+
--notification-info-text-line-height: var(--line-height-normal);
|
|
112
|
+
|
|
113
|
+
/* Success */
|
|
114
|
+
--notification-success-surface: var(--surface-success);
|
|
115
|
+
--notification-success-border: var(--border-success);
|
|
116
|
+
--notification-success-border-width: var(--border-width-1);
|
|
117
|
+
--notification-success-radius: var(--radius-md);
|
|
118
|
+
--notification-success-padding: var(--space-12);
|
|
119
|
+
--notification-success-icon: var(--text-success);
|
|
120
|
+
--notification-success-icon-size: var(--icon-size-md);
|
|
121
|
+
--notification-success-title: var(--text-success);
|
|
122
|
+
--notification-success-title-font-family: var(--font-sans);
|
|
123
|
+
--notification-success-title-font-size: var(--font-size-lg);
|
|
124
|
+
--notification-success-title-font-weight: var(--font-weight-normal);
|
|
125
|
+
--notification-success-title-line-height: var(--line-height-snug);
|
|
126
|
+
--notification-success-text: var(--text-primary);
|
|
127
|
+
--notification-success-text-font-family: var(--font-sans);
|
|
128
|
+
--notification-success-text-font-size: var(--font-size-md);
|
|
129
|
+
--notification-success-text-font-weight: var(--font-weight-extralight);
|
|
130
|
+
--notification-success-text-line-height: var(--line-height-normal);
|
|
131
|
+
|
|
132
|
+
/* Warning */
|
|
133
|
+
--notification-warning-surface: var(--surface-warning);
|
|
134
|
+
--notification-warning-border: var(--border-warning);
|
|
135
|
+
--notification-warning-border-width: var(--border-width-1);
|
|
136
|
+
--notification-warning-radius: var(--radius-md);
|
|
137
|
+
--notification-warning-padding: var(--space-12);
|
|
138
|
+
--notification-warning-icon: var(--text-warning);
|
|
139
|
+
--notification-warning-icon-size: var(--icon-size-md);
|
|
140
|
+
--notification-warning-title: var(--text-warning);
|
|
141
|
+
--notification-warning-title-font-family: var(--font-sans);
|
|
142
|
+
--notification-warning-title-font-size: var(--font-size-lg);
|
|
143
|
+
--notification-warning-title-font-weight: var(--font-weight-normal);
|
|
144
|
+
--notification-warning-title-line-height: var(--line-height-snug);
|
|
145
|
+
--notification-warning-text: var(--text-primary);
|
|
146
|
+
--notification-warning-text-font-family: var(--font-sans);
|
|
147
|
+
--notification-warning-text-font-size: var(--font-size-md);
|
|
148
|
+
--notification-warning-text-font-weight: var(--font-weight-extralight);
|
|
149
|
+
--notification-warning-text-line-height: var(--line-height-normal);
|
|
150
|
+
|
|
151
|
+
/* Danger */
|
|
152
|
+
--notification-danger-surface: var(--surface-danger);
|
|
153
|
+
--notification-danger-border: var(--border-danger);
|
|
154
|
+
--notification-danger-border-width: var(--border-width-1);
|
|
155
|
+
--notification-danger-radius: var(--radius-md);
|
|
156
|
+
--notification-danger-padding: var(--space-12);
|
|
157
|
+
--notification-danger-icon: var(--text-danger);
|
|
158
|
+
--notification-danger-icon-size: var(--icon-size-md);
|
|
159
|
+
--notification-danger-title: var(--text-danger);
|
|
160
|
+
--notification-danger-title-font-family: var(--font-sans);
|
|
161
|
+
--notification-danger-title-font-size: var(--font-size-lg);
|
|
162
|
+
--notification-danger-title-font-weight: var(--font-weight-normal);
|
|
163
|
+
--notification-danger-title-line-height: var(--line-height-snug);
|
|
164
|
+
--notification-danger-text: var(--text-primary);
|
|
165
|
+
--notification-danger-text-font-family: var(--font-sans);
|
|
166
|
+
--notification-danger-text-font-size: var(--font-size-md);
|
|
167
|
+
--notification-danger-text-font-weight: var(--font-weight-extralight);
|
|
168
|
+
--notification-danger-text-line-height: var(--line-height-normal);
|
|
169
|
+
}
|
|
170
|
+
|
|
83
171
|
.notification {
|
|
84
172
|
display: flex;
|
|
85
173
|
flex-direction: column;
|
|
86
174
|
align-items: flex-start;
|
|
87
175
|
width: 100%;
|
|
88
176
|
gap: 0;
|
|
89
|
-
|
|
90
|
-
font-size: var(--font-md);
|
|
91
|
-
border: 1px solid;
|
|
92
|
-
transition: all var(--transition-fast);
|
|
177
|
+
transition: all var(--duration-150);
|
|
93
178
|
position: relative;
|
|
94
179
|
text-align: left;
|
|
95
180
|
overflow: hidden;
|
|
@@ -99,95 +184,42 @@
|
|
|
99
184
|
}
|
|
100
185
|
|
|
101
186
|
&.compact {
|
|
102
|
-
font-size: var(--font-sm);
|
|
103
|
-
|
|
104
|
-
.notification-header {
|
|
105
|
-
padding: var(--space-6) var(--space-12);
|
|
106
|
-
|
|
107
|
-
i {
|
|
108
|
-
font-size: var(--font-sm);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.notification-title {
|
|
112
|
-
font-size: var(--font-md);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.notification-description {
|
|
117
|
-
font-size: var(--font-sm);
|
|
118
|
-
padding: var(--space-8) var(--space-12);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.notification-impact {
|
|
122
|
-
font-size: var(--font-sm);
|
|
123
|
-
padding: var(--space-8) var(--space-12);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.notification-actions-inline {
|
|
127
|
-
padding: var(--space-8) var(--space-12);
|
|
128
|
-
|
|
129
|
-
.description-text {
|
|
130
|
-
font-size: var(--font-sm);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
187
|
+
font-size: var(--font-size-sm);
|
|
133
188
|
|
|
189
|
+
.notification-description,
|
|
190
|
+
.notification-actions-inline,
|
|
134
191
|
.notification-actions {
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Info variant (blue)
|
|
140
|
-
&.info {
|
|
141
|
-
border-color: var(--border-info-darker);
|
|
142
|
-
color: var(--text-primary);
|
|
143
|
-
|
|
144
|
-
.notification-header {
|
|
145
|
-
background: var(--surface-info-low);
|
|
146
|
-
|
|
147
|
-
i {
|
|
148
|
-
color: var(--text-info);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Warning variant (orange)
|
|
154
|
-
&.warning {
|
|
155
|
-
border-color: var(--border-warning);
|
|
156
|
-
color: var(--text-primary);
|
|
157
|
-
|
|
158
|
-
.notification-header {
|
|
159
|
-
background: var(--surface-warning);
|
|
160
|
-
|
|
161
|
-
i {
|
|
162
|
-
color: var(--text-warning);
|
|
163
|
-
}
|
|
192
|
+
font-size: var(--font-size-sm);
|
|
164
193
|
}
|
|
165
194
|
}
|
|
166
195
|
|
|
167
|
-
//
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
// Variant rules (info / warning / danger / success) only differ by token prefix.
|
|
197
|
+
@each $variant in (info, warning, danger, success) {
|
|
198
|
+
&.#{$variant} {
|
|
199
|
+
border: var(--notification-#{$variant}-border-width) solid var(--notification-#{$variant}-border);
|
|
200
|
+
border-radius: var(--notification-#{$variant}-radius);
|
|
201
|
+
color: var(--notification-#{$variant}-text);
|
|
202
|
+
font-family: var(--notification-#{$variant}-text-font-family);
|
|
203
|
+
font-size: var(--notification-#{$variant}-text-font-size);
|
|
204
|
+
font-weight: var(--notification-#{$variant}-text-font-weight);
|
|
205
|
+
line-height: var(--notification-#{$variant}-text-line-height);
|
|
206
|
+
|
|
207
|
+
.notification-header {
|
|
208
|
+
background: var(--notification-#{$variant}-surface);
|
|
209
|
+
@include themed-padding(--notification-#{$variant}-padding, $h: 1.33);
|
|
210
|
+
|
|
211
|
+
i {
|
|
212
|
+
color: var(--notification-#{$variant}-icon);
|
|
213
|
+
font-size: var(--notification-#{$variant}-icon-size);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.notification-title {
|
|
217
|
+
color: var(--notification-#{$variant}-title);
|
|
218
|
+
font-family: var(--notification-#{$variant}-title-font-family);
|
|
219
|
+
font-size: var(--notification-#{$variant}-title-font-size);
|
|
220
|
+
font-weight: var(--notification-#{$variant}-title-font-weight);
|
|
221
|
+
line-height: var(--notification-#{$variant}-title-line-height);
|
|
222
|
+
}
|
|
191
223
|
}
|
|
192
224
|
}
|
|
193
225
|
}
|
|
@@ -199,7 +231,7 @@
|
|
|
199
231
|
justify-content: flex-start;
|
|
200
232
|
gap: var(--space-8);
|
|
201
233
|
width: 100%;
|
|
202
|
-
|
|
234
|
+
box-sizing: border-box;
|
|
203
235
|
position: relative;
|
|
204
236
|
|
|
205
237
|
// When action button is in header, add spacing
|
|
@@ -208,13 +240,10 @@
|
|
|
208
240
|
}
|
|
209
241
|
|
|
210
242
|
i {
|
|
211
|
-
font-size: var(--font-md);
|
|
212
243
|
flex-shrink: 0;
|
|
213
244
|
}
|
|
214
245
|
|
|
215
246
|
.notification-title {
|
|
216
|
-
font-weight: var(--font-weight-semibold);
|
|
217
|
-
font-size: var(--font-lg);
|
|
218
247
|
text-align: left;
|
|
219
248
|
flex: 1;
|
|
220
249
|
}
|
|
@@ -226,54 +255,48 @@
|
|
|
226
255
|
}
|
|
227
256
|
|
|
228
257
|
.notification-close {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
transform: translateY(-50%);
|
|
258
|
+
flex-shrink: 0;
|
|
259
|
+
margin-left: auto;
|
|
260
|
+
padding: 0;
|
|
233
261
|
background: none;
|
|
234
262
|
border: none;
|
|
235
263
|
cursor: pointer;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
opacity: 0.7;
|
|
241
|
-
transition: opacity var(--transition-fast);
|
|
242
|
-
|
|
243
|
-
i {
|
|
244
|
-
font-size: var(--font-sm);
|
|
245
|
-
color: inherit;
|
|
246
|
-
}
|
|
264
|
+
color: inherit;
|
|
265
|
+
font-size: inherit;
|
|
266
|
+
line-height: 1;
|
|
267
|
+
transition: color var(--duration-200);
|
|
247
268
|
|
|
248
269
|
&:hover {
|
|
249
|
-
|
|
270
|
+
color: var(--text-primary);
|
|
250
271
|
}
|
|
251
272
|
|
|
252
273
|
&:focus {
|
|
253
|
-
outline:
|
|
254
|
-
outline-offset:
|
|
255
|
-
border-radius: var(--radius-sm);
|
|
274
|
+
outline: var(--border-width-2) solid currentColor;
|
|
275
|
+
outline-offset: var(--space-2);
|
|
256
276
|
}
|
|
257
277
|
}
|
|
258
278
|
}
|
|
259
279
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
280
|
+
// Body row: description (col 1) + optional action buttons (col 2, right-aligned).
|
|
281
|
+
.notification-body {
|
|
282
|
+
display: flex;
|
|
283
|
+
align-items: center;
|
|
284
|
+
gap: var(--space-16);
|
|
285
|
+
padding: var(--space-12) var(--space-16);
|
|
286
|
+
width: 100%;
|
|
287
|
+
box-sizing: border-box;
|
|
264
288
|
text-align: left;
|
|
265
|
-
padding: .75rem var(--space-16);
|
|
266
289
|
}
|
|
267
290
|
|
|
268
|
-
.notification-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
291
|
+
.notification-description {
|
|
292
|
+
flex: 1;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.notification-body-actions {
|
|
296
|
+
display: flex;
|
|
297
|
+
gap: var(--space-8);
|
|
298
|
+
margin-left: auto;
|
|
299
|
+
flex-shrink: 0;
|
|
277
300
|
}
|
|
278
301
|
|
|
279
302
|
// Action buttons - inline variant
|
|
@@ -285,9 +308,6 @@
|
|
|
285
308
|
|
|
286
309
|
.description-text {
|
|
287
310
|
flex: 1;
|
|
288
|
-
line-height: 1.4;
|
|
289
|
-
font-size: var(--font-md);
|
|
290
|
-
font-weight: var(--font-weight-light);
|
|
291
311
|
}
|
|
292
312
|
|
|
293
313
|
// Button stays on the right (doesn't shrink or grow)
|
|
@@ -303,6 +323,7 @@
|
|
|
303
323
|
gap: var(--space-8);
|
|
304
324
|
padding: var(--space-12) var(--space-16);
|
|
305
325
|
padding-top: var(--space-8);
|
|
306
|
-
border-top:
|
|
326
|
+
border-top: var(--border-width-1) solid var(--border-neutral-subtle);
|
|
307
327
|
}
|
|
328
|
+
|
|
308
329
|
</style>
|