@altafusion/fugue-theme 0.0.0-stage → 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # @altafusion/fugue-theme
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - da3fca4: Rename the light/dark state key from `sse:theme` to `fugue:theme`, and drop the one-time localStorage migration from legacy workflow and recipe keys in `@altafusion/fugue-workflow`. Code that reads `useState('sse:theme')` directly must use the new key.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [da3fca4]
12
+ - @altafusion/nuxt-base@0.3.0
13
+ - @altafusion/fugue-nuxt-ui@0.3.0
14
+
15
+ ## 0.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 7767e60: Rebrand for the public release. In `@altafusion/shell`, `CODERMAR_BRANDS`, `CODERMAR_BRAND_THEME` and `utils/codermarBrandTheme` become `ALTAFUSION_*` and `utils/altafusionBrandTheme`, and the brand cookie key is now `altafusion:brand`. In `@altafusion/msw`, the `codermarMsw*` exports become `altafusionMsw*`. The site settings schema `$id` is now `https://altafusion.com/schemas/site-settings.json`. Package descriptions and docs no longer reference private sites.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [7767e60]
24
+ - @altafusion/fugue-nuxt-ui@0.2.0
25
+ - @altafusion/nuxt-base@0.2.0
26
+
27
+ ## 0.1.1
28
+
29
+ ### Patch Changes
30
+
31
+ - @altafusion/fugue-nuxt-ui@0.1.1
32
+ - @altafusion/nuxt-base@0.1.1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Altafusion
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @altafusion/fugue-theme
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Optional **theme and tokens** module in the **Fugue** design system (`packages-fugue/*`).
4
+
5
+ - Extends **`@altafusion/fugue-nuxt-ui`** with product-agnostic semantic tokens, Nuxt UI theme CSS, and Tailwind **`@theme`** wiring.
6
+ - Unbranded stacks and the workflow playground can omit this layer.
7
+
8
+ Canonical CSS entry: **`themes/theme.css`** (package **`exports`**). **`colorMode.dataValue`** is **`theme`** (aligns with **`[data-theme="dark"]`** tokens).
9
+
10
+ ## Usage
11
+
12
+ ```ts
13
+ export default defineNuxtConfig({
14
+ extends: ['@altafusion/fugue-theme', '@altafusion/fugue-ui'],
15
+ })
16
+ ```
17
+
18
+ ## Consumers
19
+
20
+ > **Local — do not copy-sync.** Repo wiring, ports, catalog keys, consuming apps, and docs-site links.
21
+
22
+ - Altafusion product apps (**`templates/fugue-content-site`**, **`packages-consumer/fugue-content`**) extend here for tokens; **product brand** (logos, `--*` brand vars) lives in **`@altafusion/shell`**, not this package.
23
+ - **`templates/docus-site`** doc sites use Docus chrome — they do **not** require fugue-theme.
@@ -0,0 +1,27 @@
1
+ import { resolveDarkCanvas } from '../../lib/dark-canvas'
2
+
3
+ /** Shared with `@altafusion/fugue-content` settings bridge plugin. */
4
+ const FUGUE_CONTENT_SETTINGS_STATE = 'fugue-content:settings'
5
+
6
+ /**
7
+ * Applies html[data-dark-canvas] for base dark canvas tokens (gray vs black).
8
+ * CMS apps may publish settings into `fugue-content:settings` to override at runtime.
9
+ */
10
+ export default defineNuxtPlugin(() => {
11
+ const config = useRuntimeConfig()
12
+ const fugueContentSettings = useState<{ theme?: { darkCanvas?: string } } | null>(FUGUE_CONTENT_SETTINGS_STATE, () => null)
13
+
14
+ const darkCanvas = computed(() =>
15
+ resolveDarkCanvas(
16
+ fugueContentSettings.value?.theme?.darkCanvas,
17
+ config.public.darkCanvas,
18
+ 'gray',
19
+ ),
20
+ )
21
+
22
+ useHead({
23
+ htmlAttrs: {
24
+ 'data-dark-canvas': darkCanvas,
25
+ },
26
+ })
27
+ })
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Syncs fugue-theme light/dark (`useTheme` / `fugue:theme`) with `[data-theme]` and
3
+ * `@nuxtjs/color-mode` when present — not Altafusion runtime brand (`useBrandTheme`).
4
+ */
5
+ export default defineNuxtPlugin(() => {
6
+ const { theme } = useTheme()
7
+
8
+ // When @nuxtjs/color-mode is present (Docus, Nuxt UI apps), sync our state with it.
9
+ // color-mode will set data-theme when configured with colorMode.dataValue: 'theme'.
10
+ let colorMode: ReturnType<typeof useColorMode> | undefined
11
+ try {
12
+ colorMode = useColorMode()
13
+ } catch {
14
+ colorMode = undefined
15
+ }
16
+ if (colorMode) {
17
+ watch(
18
+ () => colorMode.value,
19
+ (val) => {
20
+ theme.value = val as 'light' | 'dark'
21
+ },
22
+ { immediate: true },
23
+ )
24
+ watch(() => theme.value, (val) => {
25
+ if (colorMode.value !== val)
26
+ colorMode.preference = val
27
+ })
28
+ return
29
+ }
30
+
31
+ // Fallback: set data-theme ourselves (apps without color-mode)
32
+ watchEffect(() => {
33
+ if (typeof document !== 'undefined')
34
+ document.documentElement.setAttribute('data-theme', theme.value)
35
+ })
36
+ })
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Thin re-export — canonical theme entry is `themes/theme.css`.
3
+ */
4
+
5
+ @import '../../themes/theme.css';
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Base Design Tokens
3
+ *
4
+ * These are the foundational design tokens that ALL themes inherit from.
5
+ * Never customize these directly in apps - these define the design system vocabulary.
6
+ */
7
+
8
+ :root {
9
+ /* ===== SPACING SCALE ===== */
10
+ --space-0: 0;
11
+ --space-px: 1px;
12
+ --space-0_5: 0.125rem; /* 2px */
13
+ --space-1: 0.25rem; /* 4px */
14
+ --space-1_5: 0.375rem; /* 6px */
15
+ --space-2: 0.5rem; /* 8px */
16
+ --space-2_5: 0.625rem; /* 10px */
17
+ --space-3: 0.75rem; /* 12px */
18
+ --space-3_5: 0.875rem; /* 14px */
19
+ --space-4: 1rem; /* 16px */
20
+ --space-5: 1.25rem; /* 20px */
21
+ --space-6: 1.5rem; /* 24px */
22
+ --space-7: 1.75rem; /* 28px */
23
+ --space-8: 2rem; /* 32px */
24
+ --space-10: 2.5rem; /* 40px */
25
+ --space-12: 3rem; /* 48px */
26
+ --space-16: 4rem; /* 64px */
27
+ --space-20: 5rem; /* 80px */
28
+
29
+ /* ===== TYPOGRAPHY SCALE ===== */
30
+ --font-size-xs: 0.75rem; /* 12px */
31
+ --font-size-sm: 0.875rem; /* 14px */
32
+ --font-size-base: 1.0625rem; /* 17px — body */
33
+ --font-size-lg: 1.1875rem; /* 19px — secondary body */
34
+ --font-size-xl: 1.5rem; /* 24px */
35
+ --font-size-2xl: 2rem; /* 32px */
36
+ --font-size-3xl: 2.5rem; /* 40px */
37
+ --font-size-4xl: 3rem; /* 48px */
38
+ --font-size-5xl: 3.5rem; /* 56px — hero headline */
39
+
40
+ --font-weight-normal: 400;
41
+ --font-weight-medium: 500;
42
+ --font-weight-semibold: 600;
43
+ --font-weight-bold: 700;
44
+
45
+ --line-height-tight: 1.1; /* headline: 44/40, 60/56 */
46
+ --line-height-normal: 1.47; /* body: 25/17 */
47
+ --line-height-relaxed: 1.75; /* unchanged */
48
+
49
+ /* SF Pro optical tracking — tightens on Text, loosens as Display size grows */
50
+ --tracking-text: -0.022em; /* SF Pro Text @17px */
51
+ --tracking-display: 0.007em; /* SF Pro Display 24-32px */
52
+ --tracking-display-lg: 0; /* SF Pro Display >=40px */
53
+
54
+ /* ===== BORDER & RADIUS ===== */
55
+ --border-width: 1px;
56
+ --border-width-2: 2px;
57
+ --border-width-4: 4px;
58
+
59
+ --border-radius-none: 0;
60
+ --border-radius-sm: 0.125rem; /* 2px */
61
+ --border-radius: 0.25rem; /* 4px */
62
+ --border-radius-md: 0.375rem; /* 6px */
63
+ --border-radius-lg: 0.5rem; /* 8px */
64
+ --border-radius-xl: 0.75rem; /* 12px */
65
+ --border-radius-2xl: 1rem; /* 16px */
66
+ --border-radius-3xl: 1.5rem; /* 24px */
67
+ --border-radius-full: 9999px;
68
+
69
+ /* ===== SHADOWS ===== */
70
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
71
+ --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
72
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
73
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
74
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
75
+
76
+ /* ===== TRANSITIONS ===== */
77
+ --transition-fast: 150ms ease;
78
+ --transition-normal: 250ms ease;
79
+ --transition-slow: 350ms ease;
80
+
81
+ /* ===== Z-INDEX SCALE ===== */
82
+ --z-dropdown: 1000;
83
+ --z-sticky: 1020;
84
+ --z-fixed: 1030;
85
+ --z-modal: 1040;
86
+ --z-popover: 1050;
87
+ --z-tooltip: 1060;
88
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Base theme — semantic color tokens
3
+ *
4
+ * Product-agnostic palette apps inherit; override in app or product shell layers.
5
+ * Built on top of base design tokens for consistency.
6
+ */
7
+
8
+ :root {
9
+ /* ===== NEUTRAL PALETTE (LIGHT) ===== */
10
+ --color-white: #ffffff;
11
+ --color-gray-50: #f9fafb;
12
+ --color-gray-100: #f3f4f6;
13
+ --color-gray-200: #e5e7eb;
14
+ --color-gray-300: #d1d5db;
15
+ --color-gray-400: #9ca3af;
16
+ --color-gray-500: #6b7280;
17
+ --color-gray-600: #4b5563;
18
+ --color-gray-700: #374151;
19
+ --color-gray-800: #1f2937;
20
+ --color-gray-900: #111827;
21
+ --color-black: #000000;
22
+
23
+ /* ===== BRAND COLORS ===== */
24
+ --color-blue-50: #eff6ff;
25
+ --color-blue-100: #dbeafe;
26
+ --color-blue-200: #bfdbfe;
27
+ --color-blue-300: #93c5fd;
28
+ --color-blue-400: #60a5fa;
29
+ --color-blue-500: #3b82f6;
30
+ --color-blue-600: #2563eb;
31
+ --color-blue-700: #1d4ed8;
32
+ --color-blue-800: #1e40af;
33
+ --color-blue-900: #1e3a8a;
34
+
35
+ /* ===== SEMANTIC COLORS (LIGHT THEME) ===== */
36
+ --color-background: var(--color-white);
37
+ --color-background-secondary: var(--color-gray-50);
38
+ --color-background-tertiary: var(--color-gray-100);
39
+
40
+ /* Nuxt UI paints the page with --ui-bg. Follow the canvas so consumers inherit it. */
41
+ --ui-bg: var(--color-background);
42
+ --ui-bg-muted: var(--color-background-secondary);
43
+ --ui-bg-elevated: var(--color-background-tertiary);
44
+
45
+ --color-surface: var(--color-white);
46
+ --color-surface-hover: var(--color-gray-50);
47
+ --color-surface-active: var(--color-gray-100);
48
+
49
+ --color-text: var(--color-gray-900);
50
+ --color-text-secondary: var(--color-gray-600);
51
+ --color-text-tertiary: var(--color-gray-500);
52
+ --color-text-inverse: var(--color-white);
53
+
54
+ --color-border: var(--color-gray-200);
55
+ --color-border-hover: var(--color-gray-300);
56
+ --color-border-focus: var(--color-blue-500);
57
+
58
+ --color-primary: var(--color-blue-600);
59
+ --color-primary-hover: var(--color-blue-700);
60
+ --color-primary-active: var(--color-blue-800);
61
+ --color-primary-light: var(--color-blue-50);
62
+
63
+ --color-secondary: var(--color-gray-600);
64
+ --color-secondary-hover: var(--color-gray-700);
65
+ --color-secondary-active: var(--color-gray-800);
66
+ --color-secondary-light: var(--color-gray-100);
67
+
68
+ /* ===== STATE COLORS ===== */
69
+ --color-success: #059669;
70
+ --color-success-light: #d1fae5;
71
+ --color-warning: #d97706;
72
+ --color-warning-light: #fef3c7;
73
+ --color-error: #dc2626;
74
+ --color-error-light: #fee2e2;
75
+ --color-info: var(--color-blue-600);
76
+ --color-info-light: var(--color-blue-50);
77
+ }
78
+
79
+ /* ===== DARK THEME OVERRIDES ===== */
80
+ .dark,
81
+ [data-theme="dark"] {
82
+ --color-background: var(--dark-canvas);
83
+ --color-background-secondary: var(--dark-canvas-secondary);
84
+ --color-background-tertiary: var(--dark-canvas-tertiary);
85
+
86
+ --ui-bg: var(--color-background);
87
+ --ui-bg-muted: var(--color-background-secondary);
88
+ --ui-bg-elevated: var(--color-background-tertiary);
89
+
90
+ --color-surface: var(--dark-surface);
91
+ --color-surface-hover: var(--dark-surface-hover);
92
+ --color-surface-active: var(--dark-surface-active);
93
+
94
+ /* Text in dark mode */
95
+ --color-text: var(--color-gray-50);
96
+ --color-text-secondary: var(--color-gray-300);
97
+ --color-text-tertiary: var(--color-gray-400);
98
+ --color-text-inverse: var(--dark-canvas);
99
+
100
+ /* Borders in dark mode */
101
+ --color-border: var(--dark-border);
102
+ --color-border-hover: var(--dark-border-hover);
103
+
104
+ /* Primary colors adjusted for dark mode */
105
+ --color-primary: var(--color-blue-400);
106
+ --color-primary-hover: var(--color-blue-300);
107
+ --color-primary-active: var(--color-blue-200);
108
+ --color-primary-light: var(--color-blue-900);
109
+
110
+ --color-secondary: var(--color-gray-400);
111
+ --color-secondary-hover: var(--color-gray-300);
112
+ --color-secondary-active: var(--color-gray-200);
113
+ --color-secondary-light: var(--dark-surface);
114
+
115
+ /* State colors for dark mode */
116
+ --color-success: #10b981;
117
+ --color-success-light: #064e3b;
118
+ --color-warning: #f59e0b;
119
+ --color-warning-light: #451a03;
120
+ --color-error: #f87171;
121
+ --color-error-light: #7f1d1d;
122
+ --color-info: var(--color-blue-400);
123
+ --color-info-light: var(--color-blue-900);
124
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Component-level design tokens
3
+ *
4
+ * These tokens are built on semantic tokens and provide component-specific
5
+ * styling that can be overridden per app if needed.
6
+ */
7
+
8
+ :root {
9
+ /* ===== BUTTON TOKENS ===== */
10
+ --button-padding-x: var(--space-4);
11
+ --button-padding-y: var(--space-2);
12
+ --button-font-size: var(--font-size-sm);
13
+ --button-font-weight: var(--font-weight-medium);
14
+ --button-border-radius: var(--border-radius-md);
15
+ --button-border-width: var(--border-width);
16
+ --button-transition: var(--transition-fast);
17
+
18
+ /* Button variants */
19
+ --button-primary-bg: var(--color-primary);
20
+ --button-primary-bg-hover: var(--color-primary-hover);
21
+ --button-primary-bg-active: var(--color-primary-active);
22
+ --button-primary-text: var(--color-text-inverse);
23
+ --button-primary-border: var(--color-primary);
24
+
25
+ --button-secondary-bg: var(--color-surface);
26
+ --button-secondary-bg-hover: var(--color-surface-hover);
27
+ --button-secondary-bg-active: var(--color-surface-active);
28
+ --button-secondary-text: var(--color-text);
29
+ --button-secondary-border: var(--color-border);
30
+
31
+ --button-danger-bg: var(--color-error);
32
+ --button-danger-bg-hover: #b91c1c;
33
+ --button-danger-bg-active: #991b1b;
34
+ --button-danger-text: var(--color-text-inverse);
35
+ --button-danger-border: var(--color-error);
36
+
37
+ /* ===== CARD TOKENS ===== */
38
+ --card-bg: var(--color-surface);
39
+ --card-border: var(--color-border);
40
+ --card-border-radius: var(--border-radius-lg);
41
+ --card-padding: var(--space-6);
42
+ --card-shadow: var(--shadow);
43
+
44
+ /* ===== INPUT TOKENS ===== */
45
+ --input-bg: var(--color-surface);
46
+ --input-border: var(--color-border);
47
+ --input-border-hover: var(--color-border-hover);
48
+ --input-border-focus: var(--color-border-focus);
49
+ --input-text: var(--color-text);
50
+ --input-placeholder: var(--color-text-tertiary);
51
+ --input-padding-x: var(--space-3);
52
+ --input-padding-y: var(--space-2);
53
+ --input-border-radius: var(--border-radius-md);
54
+ --input-font-size: var(--font-size-base);
55
+
56
+ /* ===== HEADER TOKENS ===== */
57
+ --header-bg: var(--color-surface);
58
+ --header-border: var(--color-border);
59
+ --header-padding-x: var(--space-6);
60
+ --header-padding-y: var(--space-4);
61
+ --header-shadow: var(--shadow-sm);
62
+
63
+ /* ===== NAVIGATION TOKENS ===== */
64
+ --nav-link-color: var(--color-text-secondary);
65
+ --nav-link-hover-color: var(--color-text);
66
+ --nav-link-active-color: var(--color-primary);
67
+ --nav-link-padding-x: var(--space-4);
68
+ --nav-link-padding-y: var(--space-2);
69
+
70
+ /* ===== MODAL TOKENS ===== */
71
+ --modal-bg: var(--color-surface);
72
+ --modal-overlay-bg: rgba(0, 0, 0, 0.5);
73
+ --modal-border-radius: var(--border-radius-xl);
74
+ --modal-shadow: var(--shadow-xl);
75
+ --modal-max-width: 32rem;
76
+
77
+ /* ===== TOOLTIP TOKENS ===== */
78
+ --tooltip-bg: var(--color-gray-900);
79
+ --tooltip-text: var(--color-white);
80
+ --tooltip-padding-x: var(--space-2);
81
+ --tooltip-padding-y: var(--space-1);
82
+ --tooltip-font-size: var(--font-size-xs);
83
+ --tooltip-border-radius: var(--border-radius);
84
+ }
85
+
86
+ [data-theme="dark"] {
87
+ --tooltip-bg: var(--color-gray-700);
88
+ --tooltip-text: var(--color-gray-50);
89
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Dark canvas primitives — switch with html[data-dark-canvas="gray"|"black"].
3
+ * Default is gray when the attribute is absent (legacy gray-900 stack).
4
+ */
5
+
6
+ .dark,
7
+ [data-theme='dark'] {
8
+ --dark-canvas: var(--color-gray-900);
9
+ --dark-canvas-secondary: var(--color-gray-800);
10
+ --dark-canvas-tertiary: var(--color-gray-700);
11
+ --dark-surface: var(--color-gray-800);
12
+ --dark-surface-hover: var(--color-gray-700);
13
+ --dark-surface-active: var(--color-gray-600);
14
+ --dark-border: var(--color-gray-700);
15
+ --dark-border-hover: var(--color-gray-600);
16
+ }
17
+
18
+ .dark[data-dark-canvas='black'],
19
+ [data-theme='dark'][data-dark-canvas='black'] {
20
+ --dark-canvas: var(--color-black);
21
+ --dark-canvas-secondary: rgb(255 255 255 / 0.05);
22
+ --dark-canvas-tertiary: rgb(255 255 255 / 0.08);
23
+ --dark-surface: rgb(255 255 255 / 0.05);
24
+ --dark-surface-hover: rgb(255 255 255 / 0.08);
25
+ --dark-surface-active: rgb(255 255 255 / 0.12);
26
+ --dark-border: rgb(255 255 255 / 0.12);
27
+ --dark-border-hover: rgb(255 255 255 / 0.2);
28
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Light/dark appearance for the fugue-theme layer (`fugue:theme` state).
3
+ * Distinct from `useBrandTheme` in `@altafusion/shell` (Altafusion brand cookie / `[data-brand]`).
4
+ */
5
+ export function useTheme() {
6
+ const theme = useState<'light' | 'dark'>('fugue:theme', () => 'dark')
7
+
8
+ function toggleTheme() {
9
+ theme.value = theme.value === 'light'
10
+ ? 'dark'
11
+ : 'light'
12
+ }
13
+
14
+ const isDark = computed(() => theme.value === 'dark')
15
+
16
+ return { theme, isDark, toggleTheme }
17
+ }
package/dark-canvas.ts ADDED
@@ -0,0 +1,2 @@
1
+ export type { DarkCanvas } from './lib/dark-canvas'
2
+ export { DARK_CANVAS_DEFAULT, normalizeDarkCanvas, resolveDarkCanvas } from './lib/dark-canvas'
@@ -0,0 +1,9 @@
1
+ // @ts-check
2
+ import { createStrictVuePackageEslintConfig } from '@altafusion/eslint-config'
3
+
4
+ export default createStrictVuePackageEslintConfig({
5
+ rules: {
6
+ 'vue/require-default-prop': 'error',
7
+ 'no-console': 'warn',
8
+ },
9
+ })
@@ -0,0 +1,22 @@
1
+ export type DarkCanvas = 'gray' | 'black'
2
+
3
+ export const DARK_CANVAS_DEFAULT: DarkCanvas = 'gray'
4
+
5
+ /** Normalize palette / manifest / runtime values to a supported dark canvas id. */
6
+ export function normalizeDarkCanvas(value: unknown): DarkCanvas {
7
+ return value === 'black'
8
+ ? 'black'
9
+ : 'gray'
10
+ }
11
+
12
+ export function resolveDarkCanvas(
13
+ manifestValue: unknown,
14
+ paletteValue: unknown,
15
+ fallback: unknown = DARK_CANVAS_DEFAULT,
16
+ ): DarkCanvas {
17
+ if (manifestValue !== undefined && manifestValue !== null && manifestValue !== '')
18
+ return normalizeDarkCanvas(manifestValue)
19
+ if (paletteValue !== undefined && paletteValue !== null && paletteValue !== '')
20
+ return normalizeDarkCanvas(paletteValue)
21
+ return normalizeDarkCanvas(fallback)
22
+ }
package/nuxt.config.ts ADDED
@@ -0,0 +1,23 @@
1
+ // Extends @altafusion/fugue-nuxt-ui (unbranded Tailwind + @nuxt/ui + @nuxt/eslint).
2
+ // Product-agnostic theme CSS, color-mode hook, dark-canvas, composables.
3
+
4
+ import { resolve } from 'node:path'
5
+
6
+ export default defineNuxtConfig({
7
+ extends: ['@altafusion/fugue-nuxt-ui'],
8
+
9
+ imports: {
10
+ dirs: [
11
+ resolve(__dirname, 'composables'),
12
+ ],
13
+ },
14
+
15
+ /** Align Nuxt UI color-mode with fugue-theme `[data-theme="dark"]` tokens (see `app/plugins/theme.client.ts`). */
16
+ colorMode: {
17
+ dataValue: 'theme',
18
+ },
19
+
20
+ css: [
21
+ resolve(__dirname, './themes/theme.css'),
22
+ ],
23
+ })
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@altafusion/fugue-theme",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "type": "module",
4
+ "version": "0.3.0",
5
+ "description": "Optional Fugue theme layer — neutral tokens, theme CSS, Tailwind entry, dark-canvas",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/altafusion/fugue/tree/main/packages-fugue/fugue-theme#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/altafusion/fugue/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/altafusion/fugue.git",
14
+ "directory": "packages-fugue/fugue-theme"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "main": "./nuxt.config.ts",
20
+ "exports": {
21
+ ".": "./nuxt.config.ts",
22
+ "./themes/tokens.css": "./themes/tokens.css",
23
+ "./themes/theme.css": "./themes/theme.css",
24
+ "./themes/tailwind.css": "./themes/tailwind.css",
25
+ "./themes/debug.css": "./themes/debug.css",
26
+ "./dark-canvas": "./dark-canvas.ts",
27
+ "./lib/dark-canvas": "./lib/dark-canvas.ts"
28
+ },
29
+ "peerDependencies": {
30
+ "nuxt": ">=4.0.0"
31
+ },
32
+ "dependencies": {
33
+ "@altafusion/fugue-nuxt-ui": "0.3.0",
34
+ "@altafusion/nuxt-base": "0.3.0",
35
+ "@iconify-json/lucide": "^1.2.157",
36
+ "@iconify-json/simple-icons": "^1.2.103",
37
+ "@nuxt/eslint": "^1.17.0",
38
+ "@nuxt/icon": "^2.6.3",
39
+ "@nuxt/ui": "^4.13.0",
40
+ "tailwindcss": "^4.3.5"
41
+ },
42
+ "devDependencies": {
43
+ "@altafusion/eslint-config": "0.3.0",
44
+ "@types/node": "^26.6.6",
45
+ "eslint": "^10.15.0",
46
+ "nuxt": "^4.6.4",
47
+ "typescript": "^6.0.3",
48
+ "vue": "^3.5.46"
49
+ },
50
+ "files": [
51
+ "**",
52
+ "!**/*.test.ts",
53
+ "!**/.nuxt",
54
+ "!**/.output",
55
+ "!**/.data",
56
+ "!**/coverage",
57
+ "!**/node_modules"
58
+ ],
59
+ "scripts": {
60
+ "dev": "pnpm --filter @altafusion/fugue-theme-playground dev",
61
+ "clean": "rm -rf .output .nuxt node_modules/.cache dist",
62
+ "lint": "eslint .",
63
+ "lint:fix": "eslint . --fix"
64
+ }
6
65
  }
@@ -0,0 +1,15 @@
1
+ # Fugue Theme Playground
2
+
3
+ Private Nuxt app on port 7010. Extends `@altafusion/fugue-theme` and `@altafusion/shell` with no product palette, so heading, body, muted, dimmed, and toned roles can be judged in light and dark.
4
+
5
+ ## Run
6
+
7
+ From the repo root:
8
+
9
+ ```bash
10
+ pnpm --filter @altafusion/fugue-theme dev
11
+ ```
12
+
13
+ Open http://localhost:7010. The shell header toggles color mode.
14
+
15
+ The workflow playground (`packages-fugue/fugue-workflow/playground`) extends only `@altafusion/fugue-workflow` and does not load fugue-theme, so it still uses Nuxt UI default contrast.
@@ -0,0 +1,11 @@
1
+ export default defineAppConfig({
2
+ brand: {
3
+ name: 'Fugue Theme',
4
+ },
5
+ ui: {
6
+ colors: {
7
+ primary: 'blue',
8
+ neutral: 'slate',
9
+ },
10
+ },
11
+ })
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <UApp>
3
+ <NuxtLayout>
4
+ <NuxtPage />
5
+ </NuxtLayout>
6
+ </UApp>
7
+ </template>