@happydesigns/ui 0.13.5 → 0.15.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 +53 -94
- package/app/app.config.ts +168 -169
- package/app/app.vue +11 -0
- package/app/components/article/ArticleGrid.vue +134 -158
- package/app/components/article/ArticleGridDate.vue +1 -1
- package/app/components/article/ArticleHeaderBody.vue +20 -20
- package/app/components/article/ArticleHeadlineMeta.vue +26 -26
- package/app/components/article/ArticleList.vue +80 -95
- package/app/components/article/ArticlePage.vue +17 -16
- package/app/components/footer/FooterColumnHeading.vue +5 -5
- package/app/components/footer/FooterColumns.vue +16 -20
- package/app/components/footer/FooterCopyright.vue +35 -29
- package/app/components/traits/Authors.vue +21 -20
- package/app/components/traits/BackButton.vue +15 -26
- package/app/components/traits/Category.vue +9 -9
- package/app/components/traits/CopyButton.vue +32 -39
- package/app/components/traits/Dates.vue +20 -20
- package/app/components/traits/Links.vue +17 -17
- package/app/components/traits/Location.vue +20 -20
- package/app/components/traits/Separator.vue +21 -26
- package/app/components/traits/SeparatorButtons.vue +54 -56
- package/app/components/traits/Surround.vue +51 -60
- package/app/components/traits/Toc.vue +16 -16
- package/app/composables/useArticleList.ts +13 -15
- package/app/composables/useArticleListQuery.ts +54 -0
- package/app/composables/useCategoryBadge.ts +27 -27
- package/app/composables/useClipboard.ts +26 -26
- package/app/composables/usePageContent.ts +18 -18
- package/app/composables/usePageSeo.ts +30 -30
- package/app/layouts/article.vue +120 -128
- package/app/layouts/content.vue +59 -67
- package/app/layouts/default.vue +1 -10
- package/app/types/config.ts +13 -6
- package/app/utils/resolveUsers.ts +32 -3
- package/content.config.ts +6 -6
- package/nuxt.config.ts +72 -80
- package/package.json +29 -18
- package/schemas/collections.ts +46 -46
- package/schemas/index.ts +2 -2
- package/schemas/traits.ts +90 -90
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happydesigns/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"private": false,
|
|
6
|
-
"packageManager": "pnpm@
|
|
6
|
+
"packageManager": "pnpm@11.11.0",
|
|
7
7
|
"author": "happydesigns",
|
|
8
8
|
"homepage": "https://github.com/happydesigns",
|
|
9
9
|
"exports": {
|
|
@@ -22,39 +22,50 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "nuxt dev playground",
|
|
25
|
-
"docs": "nuxt dev docs
|
|
25
|
+
"docs": "nuxt dev docs",
|
|
26
|
+
"docs:build": "nuxt generate docs && node scripts/validate-docs-output.mjs",
|
|
27
|
+
"docs:build:server": "nuxt build docs",
|
|
26
28
|
"prepare": "nuxt prepare && nuxt prepare playground",
|
|
27
29
|
"build": "nuxt build playground",
|
|
28
30
|
"preview": "nuxt preview playground",
|
|
29
31
|
"lint": "eslint .",
|
|
30
32
|
"lint:fix": "eslint . --fix",
|
|
33
|
+
"typecheck": "nuxt typecheck && nuxt typecheck playground",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest",
|
|
31
36
|
"release": "changelogen --release",
|
|
32
37
|
"release:pre": "changelogen --release --prerelease",
|
|
33
38
|
"release:alpha": "changelogen --release --versionSuffix alpha.0",
|
|
34
39
|
"release:beta": "changelogen --release --versionSuffix beta.0"
|
|
35
40
|
},
|
|
36
41
|
"dependencies": {
|
|
42
|
+
"@happydesigns/nuxt-variants": "^0.0.6",
|
|
37
43
|
"@iconify-json/heroicons": "^1.2.3",
|
|
38
|
-
"@iconify-json/lucide": "^1.2.
|
|
39
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
40
|
-
"@nuxt/content": "^3.
|
|
41
|
-
"@nuxt/ui": "^4.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
+
"@iconify-json/lucide": "^1.2.116",
|
|
45
|
+
"@iconify-json/simple-icons": "^1.2.89",
|
|
46
|
+
"@nuxt/content": "^3.15.0",
|
|
47
|
+
"@nuxt/ui": "^4.9.0",
|
|
48
|
+
"@vueuse/core": "^14.3.0",
|
|
49
|
+
"better-sqlite3": "^12.11.1",
|
|
50
|
+
"nuxt-studio": "^1.7.0",
|
|
51
|
+
"pathe": "^2.0.3",
|
|
52
|
+
"zod": "^4.4.3"
|
|
44
53
|
},
|
|
45
54
|
"devDependencies": {
|
|
46
|
-
"@antfu/eslint-config": "^
|
|
47
|
-
"@antfu/ni": "^30.
|
|
48
|
-
"@
|
|
49
|
-
"@nuxt/eslint": "^1.15.2",
|
|
55
|
+
"@antfu/eslint-config": "^9.1.0",
|
|
56
|
+
"@antfu/ni": "^30.2.0",
|
|
57
|
+
"@nuxt/eslint-config": "^1.16.0",
|
|
50
58
|
"changelogen": "^0.6.2",
|
|
51
59
|
"cross-env": "^10.1.0",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
60
|
+
"docus": "5.12.3",
|
|
61
|
+
"eslint": "^10.6.0",
|
|
62
|
+
"nuxt": "^4.4.8",
|
|
63
|
+
"typescript": "^6.0.3",
|
|
64
|
+
"vitest": "^4.1.10",
|
|
65
|
+
"vue-tsc": "^3.3.7",
|
|
66
|
+
"zod-to-json-schema": "^3.25.2"
|
|
56
67
|
},
|
|
57
68
|
"resolutions": {
|
|
58
69
|
"@happydesigns/ui": "workspace:*"
|
|
59
70
|
}
|
|
60
|
-
}
|
|
71
|
+
}
|
package/schemas/collections.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { mergeVariantSchemas } from '@happydesigns/nuxt-variants/schemas'
|
|
2
|
-
import { defineCollection } from '@nuxt/content'
|
|
3
|
-
import { variantSchemas } from './traits'
|
|
4
|
-
|
|
5
|
-
export const collections = {
|
|
6
|
-
snippet: defineCollection({
|
|
7
|
-
type: 'page',
|
|
8
|
-
source: {
|
|
9
|
-
include: 'snippets/**/*.{md,yaml}',
|
|
10
|
-
prefix: '/snippets',
|
|
11
|
-
},
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
article: defineCollection({
|
|
15
|
-
type: 'page',
|
|
16
|
-
source: {
|
|
17
|
-
include: 'articles/**/*.{md,yaml}',
|
|
18
|
-
prefix: '/articles',
|
|
19
|
-
},
|
|
20
|
-
schema: mergeVariantSchemas(['article'], variantSchemas),
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
event: defineCollection({
|
|
24
|
-
type: 'page',
|
|
25
|
-
source: {
|
|
26
|
-
include: 'events/**/*.{md,yaml}',
|
|
27
|
-
prefix: '/events',
|
|
28
|
-
},
|
|
29
|
-
schema: mergeVariantSchemas(['event'], variantSchemas),
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
page: defineCollection({
|
|
33
|
-
type: 'page',
|
|
34
|
-
source: {
|
|
35
|
-
include: 'pages/**/*.{md,yaml}',
|
|
36
|
-
prefix: '/',
|
|
37
|
-
},
|
|
38
|
-
schema: mergeVariantSchemas(['page'], variantSchemas),
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
user: defineCollection({
|
|
42
|
-
type: 'data',
|
|
43
|
-
source: 'users/**/*.{md,yaml}',
|
|
44
|
-
schema: mergeVariantSchemas(['user'], variantSchemas),
|
|
45
|
-
}),
|
|
46
|
-
}
|
|
1
|
+
import { mergeVariantSchemas } from '@happydesigns/nuxt-variants/schemas'
|
|
2
|
+
import { defineCollection } from '@nuxt/content'
|
|
3
|
+
import { variantSchemas } from './traits'
|
|
4
|
+
|
|
5
|
+
export const collections = {
|
|
6
|
+
snippet: defineCollection({
|
|
7
|
+
type: 'page',
|
|
8
|
+
source: {
|
|
9
|
+
include: 'snippets/**/*.{md,yaml}',
|
|
10
|
+
prefix: '/snippets',
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
|
|
14
|
+
article: defineCollection({
|
|
15
|
+
type: 'page',
|
|
16
|
+
source: {
|
|
17
|
+
include: 'articles/**/*.{md,yaml}',
|
|
18
|
+
prefix: '/articles',
|
|
19
|
+
},
|
|
20
|
+
schema: mergeVariantSchemas(['article'], variantSchemas),
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
event: defineCollection({
|
|
24
|
+
type: 'page',
|
|
25
|
+
source: {
|
|
26
|
+
include: 'events/**/*.{md,yaml}',
|
|
27
|
+
prefix: '/events',
|
|
28
|
+
},
|
|
29
|
+
schema: mergeVariantSchemas(['event'], variantSchemas),
|
|
30
|
+
}),
|
|
31
|
+
|
|
32
|
+
page: defineCollection({
|
|
33
|
+
type: 'page',
|
|
34
|
+
source: {
|
|
35
|
+
include: 'pages/**/*.{md,yaml}',
|
|
36
|
+
prefix: '/',
|
|
37
|
+
},
|
|
38
|
+
schema: mergeVariantSchemas(['page'], variantSchemas),
|
|
39
|
+
}),
|
|
40
|
+
|
|
41
|
+
user: defineCollection({
|
|
42
|
+
type: 'data',
|
|
43
|
+
source: 'users/**/*.{md,yaml}',
|
|
44
|
+
schema: mergeVariantSchemas(['user'], variantSchemas),
|
|
45
|
+
}),
|
|
46
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './collections'
|
|
2
|
-
export * from './traits'
|
|
1
|
+
export * from './collections'
|
|
2
|
+
export * from './traits'
|
package/schemas/traits.ts
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { property } from '@nuxt/content'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const datesTrait = {
|
|
5
|
-
schema: z.object({
|
|
6
|
-
date: z.date().optional(),
|
|
7
|
-
dateEnd: z.date().optional(),
|
|
8
|
-
}),
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const authorsTrait = {
|
|
12
|
-
schema: z.object({
|
|
13
|
-
authors: z.array(z.string()).optional(),
|
|
14
|
-
}),
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const categoryTrait = {
|
|
18
|
-
schema: z.object({
|
|
19
|
-
category: z.string().optional(),
|
|
20
|
-
}),
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const statusTrait = {
|
|
24
|
-
schema: z.object({
|
|
25
|
-
status: z.enum(['published', 'draft', 'archived']).default('published'),
|
|
26
|
-
}),
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const headerTrait = {
|
|
30
|
-
schema: z.object({
|
|
31
|
-
header: property(z.object({})).inherit('@nuxt/ui/components/PageHeader.vue').optional(),
|
|
32
|
-
}),
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const tocTrait = {
|
|
36
|
-
schema: z.object({
|
|
37
|
-
toc: z.boolean().default(true),
|
|
38
|
-
}),
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const linksTrait = {
|
|
42
|
-
schema: z.object({
|
|
43
|
-
links: z.array(
|
|
44
|
-
property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
|
|
45
|
-
).optional(),
|
|
46
|
-
}),
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const locationTrait = {
|
|
50
|
-
schema: z.object({
|
|
51
|
-
location: z.object({
|
|
52
|
-
name: z.string(),
|
|
53
|
-
url: z.string().optional(),
|
|
54
|
-
}).optional(),
|
|
55
|
-
}),
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const layoutTrait = {
|
|
59
|
-
schema: z.object({
|
|
60
|
-
layout: z.enum(['default', 'content']).optional(),
|
|
61
|
-
}),
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const userTrait = {
|
|
65
|
-
schema: z.object({
|
|
66
|
-
username: z.string(),
|
|
67
|
-
name: z.string().optional(),
|
|
68
|
-
description: z.string().optional(),
|
|
69
|
-
to: z.string().optional(),
|
|
70
|
-
avatar: property(z.object({})).inherit('@nuxt/ui/components/Avatar.vue').optional(),
|
|
71
|
-
socials: z.array(z.object({
|
|
72
|
-
name: z.string(),
|
|
73
|
-
url: z.url(),
|
|
74
|
-
})).optional(),
|
|
75
|
-
email: z.email().optional(),
|
|
76
|
-
}),
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const variantSchemas = {
|
|
80
|
-
dates: datesTrait.schema,
|
|
81
|
-
authors: authorsTrait.schema,
|
|
82
|
-
category: categoryTrait.schema,
|
|
83
|
-
status: statusTrait.schema,
|
|
84
|
-
header: headerTrait.schema,
|
|
85
|
-
toc: tocTrait.schema,
|
|
86
|
-
links: linksTrait.schema,
|
|
87
|
-
location: locationTrait.schema,
|
|
88
|
-
layout: layoutTrait.schema,
|
|
89
|
-
user: userTrait.schema,
|
|
90
|
-
}
|
|
1
|
+
import { property } from '@nuxt/content'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
export const datesTrait = {
|
|
5
|
+
schema: z.object({
|
|
6
|
+
date: z.date().optional(),
|
|
7
|
+
dateEnd: z.date().optional(),
|
|
8
|
+
}),
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const authorsTrait = {
|
|
12
|
+
schema: z.object({
|
|
13
|
+
authors: z.array(z.string()).optional(),
|
|
14
|
+
}),
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const categoryTrait = {
|
|
18
|
+
schema: z.object({
|
|
19
|
+
category: z.string().optional(),
|
|
20
|
+
}),
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const statusTrait = {
|
|
24
|
+
schema: z.object({
|
|
25
|
+
status: z.enum(['published', 'draft', 'archived']).default('published'),
|
|
26
|
+
}),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const headerTrait = {
|
|
30
|
+
schema: z.object({
|
|
31
|
+
header: property(z.object({})).inherit('@nuxt/ui/components/PageHeader.vue').optional(),
|
|
32
|
+
}),
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const tocTrait = {
|
|
36
|
+
schema: z.object({
|
|
37
|
+
toc: z.boolean().default(true),
|
|
38
|
+
}),
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const linksTrait = {
|
|
42
|
+
schema: z.object({
|
|
43
|
+
links: z.array(
|
|
44
|
+
property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
|
|
45
|
+
).optional(),
|
|
46
|
+
}),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const locationTrait = {
|
|
50
|
+
schema: z.object({
|
|
51
|
+
location: z.object({
|
|
52
|
+
name: z.string(),
|
|
53
|
+
url: z.string().optional(),
|
|
54
|
+
}).optional(),
|
|
55
|
+
}),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const layoutTrait = {
|
|
59
|
+
schema: z.object({
|
|
60
|
+
layout: z.enum(['default', 'content']).optional(),
|
|
61
|
+
}),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const userTrait = {
|
|
65
|
+
schema: z.object({
|
|
66
|
+
username: z.string(),
|
|
67
|
+
name: z.string().optional(),
|
|
68
|
+
description: z.string().optional(),
|
|
69
|
+
to: z.string().optional(),
|
|
70
|
+
avatar: property(z.object({})).inherit('@nuxt/ui/components/Avatar.vue').optional(),
|
|
71
|
+
socials: z.array(z.object({
|
|
72
|
+
name: z.string(),
|
|
73
|
+
url: z.url(),
|
|
74
|
+
})).optional(),
|
|
75
|
+
email: z.email().optional(),
|
|
76
|
+
}),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const variantSchemas = {
|
|
80
|
+
dates: datesTrait.schema,
|
|
81
|
+
authors: authorsTrait.schema,
|
|
82
|
+
category: categoryTrait.schema,
|
|
83
|
+
status: statusTrait.schema,
|
|
84
|
+
header: headerTrait.schema,
|
|
85
|
+
toc: tocTrait.schema,
|
|
86
|
+
links: linksTrait.schema,
|
|
87
|
+
location: locationTrait.schema,
|
|
88
|
+
layout: layoutTrait.schema,
|
|
89
|
+
user: userTrait.schema,
|
|
90
|
+
}
|