@happydesigns/ui 0.19.0 → 0.19.1
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/nuxt.config.ts +3 -35
- package/package.json +2 -2
- package/schemas/collections.ts +11 -8
- package/schemas/index.ts +2 -1
- package/schemas/variants.ts +41 -0
package/nuxt.config.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { variantRegistry } from './schemas/variants'
|
|
2
|
+
|
|
1
3
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
4
|
export default defineNuxtConfig({
|
|
3
5
|
|
|
@@ -19,41 +21,7 @@ export default defineNuxtConfig({
|
|
|
19
21
|
],
|
|
20
22
|
|
|
21
23
|
variants: {
|
|
22
|
-
registry:
|
|
23
|
-
// Data features — schema only, no config
|
|
24
|
-
dates: {},
|
|
25
|
-
authors: {},
|
|
26
|
-
category: {},
|
|
27
|
-
published: {},
|
|
28
|
-
header: {},
|
|
29
|
-
toc: {},
|
|
30
|
-
links: {},
|
|
31
|
-
location: {},
|
|
32
|
-
layout: {},
|
|
33
|
-
separatorButtons: {},
|
|
34
|
-
|
|
35
|
-
// UI features — config defined in app.config.ts
|
|
36
|
-
user: {},
|
|
37
|
-
backButton: {},
|
|
38
|
-
copyButton: {},
|
|
39
|
-
separator: {},
|
|
40
|
-
surround: {},
|
|
41
|
-
|
|
42
|
-
// Collection variants — extends chains defined here for graph generation
|
|
43
|
-
snippet: {},
|
|
44
|
-
article: {
|
|
45
|
-
extends: ['dates', 'authors', 'category', 'published', 'header', 'toc', 'surround', 'copyButton', 'separator', 'backButton'],
|
|
46
|
-
config: {},
|
|
47
|
-
},
|
|
48
|
-
event: {
|
|
49
|
-
extends: ['dates', 'location', 'category', 'links', 'published', 'header', 'toc', 'surround', 'copyButton', 'separator', 'backButton'],
|
|
50
|
-
config: {},
|
|
51
|
-
},
|
|
52
|
-
content: {
|
|
53
|
-
extends: ['layout', 'header', 'toc'],
|
|
54
|
-
config: {},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
24
|
+
registry: variantRegistry,
|
|
57
25
|
},
|
|
58
26
|
|
|
59
27
|
studio: false,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happydesigns/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@11.11.0",
|
|
7
7
|
"description": "A reusable Nuxt foundation for content-driven happydesigns websites and applications.",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"tailwindcss": "^4.3.2"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@happydesigns/nuxt-variants": "^0.
|
|
68
|
+
"@happydesigns/nuxt-variants": "^0.1.1",
|
|
69
69
|
"@iconify-json/heroicons": "^1.2.3",
|
|
70
70
|
"@iconify-json/lucide": "^1.2.116",
|
|
71
71
|
"@iconify-json/simple-icons": "^1.2.89",
|
package/schemas/collections.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { variantSchemas } from './traits'
|
|
1
|
+
import { createVariantSchemaResolver } from '@happydesigns/nuxt-variants/schemas'
|
|
2
|
+
import { variantSchemas } from './traits'
|
|
3
|
+
import { variantRegistry } from './variants'
|
|
4
|
+
|
|
5
|
+
const resolveVariantSchema = createVariantSchemaResolver(variantRegistry, variantSchemas)
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Source-agnostic schemas for consumer-owned Nuxt Content collections.
|
|
@@ -7,9 +10,9 @@ import { variantSchemas } from './traits'
|
|
|
7
10
|
* Collection names, sources, prefixes and any project-specific schema fields
|
|
8
11
|
* intentionally remain in the consuming application's `content.config.ts`.
|
|
9
12
|
*/
|
|
10
|
-
export const collectionSchemas = {
|
|
11
|
-
content:
|
|
12
|
-
article:
|
|
13
|
-
event:
|
|
14
|
-
user:
|
|
15
|
-
}
|
|
13
|
+
export const collectionSchemas = {
|
|
14
|
+
content: resolveVariantSchema(['content']),
|
|
15
|
+
article: resolveVariantSchema(['article']),
|
|
16
|
+
event: resolveVariantSchema(['event']),
|
|
17
|
+
user: resolveVariantSchema(['user']),
|
|
18
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public variant registry shared by the Nuxt module and schema composition.
|
|
3
|
+
*
|
|
4
|
+
* Keeping the registry in one place guarantees that runtime inheritance and
|
|
5
|
+
* Nuxt Content schemas are derived from the same explicit variant graph.
|
|
6
|
+
*/
|
|
7
|
+
export const variantRegistry = {
|
|
8
|
+
// Data features — schema only, no config
|
|
9
|
+
dates: {},
|
|
10
|
+
authors: {},
|
|
11
|
+
category: {},
|
|
12
|
+
published: {},
|
|
13
|
+
header: {},
|
|
14
|
+
toc: {},
|
|
15
|
+
links: {},
|
|
16
|
+
location: {},
|
|
17
|
+
layout: {},
|
|
18
|
+
separatorButtons: {},
|
|
19
|
+
|
|
20
|
+
// UI features — config defined in app.config.ts
|
|
21
|
+
user: {},
|
|
22
|
+
backButton: {},
|
|
23
|
+
copyButton: {},
|
|
24
|
+
separator: {},
|
|
25
|
+
surround: {},
|
|
26
|
+
|
|
27
|
+
// Collection variants — extends chains defined here for graph generation
|
|
28
|
+
snippet: {},
|
|
29
|
+
article: {
|
|
30
|
+
extends: ['dates', 'authors', 'category', 'published', 'header', 'toc', 'surround', 'copyButton', 'separator', 'backButton'],
|
|
31
|
+
config: {},
|
|
32
|
+
},
|
|
33
|
+
event: {
|
|
34
|
+
extends: ['dates', 'location', 'category', 'links', 'published', 'header', 'toc', 'surround', 'copyButton', 'separator', 'backButton'],
|
|
35
|
+
config: {},
|
|
36
|
+
},
|
|
37
|
+
content: {
|
|
38
|
+
extends: ['layout', 'header', 'toc'],
|
|
39
|
+
config: {},
|
|
40
|
+
},
|
|
41
|
+
}
|