@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/README.md
CHANGED
|
@@ -1,94 +1,53 @@
|
|
|
1
|
-
# @happydesigns/ui
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Content Configuration
|
|
57
|
-
|
|
58
|
-
By default, this layer provides a `content.config.ts` that defines two collections: `page` (sourced from `pages/`) and `snippet` (sourced from `snippets/`).
|
|
59
|
-
|
|
60
|
-
You can use these as-is by following the default directory structure, or you can define your own `content.config.ts` in your main application to extend or completely override these collections:
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
// your-app/content.config.ts
|
|
64
|
-
import { pageCollectionConfig, snippetCollectionConfig } from '@happydesigns/ui/content.config'
|
|
65
|
-
import { defineContentConfig } from '@nuxt/content'
|
|
66
|
-
|
|
67
|
-
export default defineContentConfig({
|
|
68
|
-
collections: {
|
|
69
|
-
// Reuse the layer's configs
|
|
70
|
-
page: pageCollectionConfig,
|
|
71
|
-
snippet: snippetCollectionConfig,
|
|
72
|
-
// Or add your own
|
|
73
|
-
posts: defineCollection({ })
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Development
|
|
79
|
-
|
|
80
|
-
If you want to contribute to the layer or run it locally:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# Install dependencies
|
|
84
|
-
pnpm install
|
|
85
|
-
|
|
86
|
-
# Prepare types
|
|
87
|
-
pnpm prepare
|
|
88
|
-
|
|
89
|
-
# Start the playground (dev server)
|
|
90
|
-
pnpm dev
|
|
91
|
-
|
|
92
|
-
# Build the playground
|
|
93
|
-
pnpm build
|
|
94
|
-
```
|
|
1
|
+
# @happydesigns/ui
|
|
2
|
+
|
|
3
|
+
Reusable Nuxt layer for happydesigns websites, docs sites, and product apps.
|
|
4
|
+
|
|
5
|
+
The package provides shared Nuxt setup, Nuxt UI conventions, content collection schemas, public `H*` components, composables, variants, and app config conventions. Projects extend the layer and keep project-specific routes, content, branding, and deployment settings in the project that owns them.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @happydesigns/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
export default defineNuxtConfig({
|
|
15
|
+
extends: ['@happydesigns/ui'],
|
|
16
|
+
})
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run Nuxt preparation after changing dependencies or layer configuration:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm exec nuxt prepare
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm install
|
|
29
|
+
pnpm prepare
|
|
30
|
+
pnpm dev
|
|
31
|
+
pnpm build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`pnpm dev` starts the playground app. `pnpm build` builds the playground.
|
|
35
|
+
|
|
36
|
+
## Product Docs
|
|
37
|
+
|
|
38
|
+
The product docs live in `docs/` and are built with Docus.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm docs
|
|
42
|
+
pnpm docs:build
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`pnpm docs:build` generates a static Docus build in `docs/.output/public`. Use `pnpm docs:build:server` only when the deployment target needs a server-capable Docus build for live MCP support.
|
|
46
|
+
|
|
47
|
+
The docs explain how to use the layer, content model, components, composables, variants, and configuration. Component props, slots, examples, variants, and collection tables are generated from the package source where possible.
|
|
48
|
+
|
|
49
|
+
## Package Scope
|
|
50
|
+
|
|
51
|
+
This package owns reusable interface and content foundations. It does not own project copy, customer-specific routes, final brand assets, deployment settings, or product-specific domain behavior.
|
|
52
|
+
|
|
53
|
+
Use the product docs for usage guidance. Use the source files for implementation facts.
|
package/app/app.config.ts
CHANGED
|
@@ -1,169 +1,168 @@
|
|
|
1
|
-
import type { ButtonProps, FooterColumn } from '@nuxt/ui'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
copyButton: {
|
|
12
|
-
config: {
|
|
13
|
-
copyButton: {
|
|
14
|
-
icon: 'i-ph-link-simple-duotone',
|
|
15
|
-
label: 'Copy URL',
|
|
16
|
-
successIcon: 'i-lucide-copy-check',
|
|
17
|
-
successLabel: 'Link copied to clipboard',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
separator: { config: { separator: { buttons: [], separator: 'or' } } },
|
|
22
|
-
surround: {
|
|
23
|
-
config: {
|
|
24
|
-
surround: {
|
|
25
|
-
show: true,
|
|
26
|
-
prevIcon: 'i-lucide-arrow-left',
|
|
27
|
-
nextIcon: 'i-lucide-arrow-right',
|
|
28
|
-
prevLabel: 'Previous',
|
|
29
|
-
nextLabel: 'Next',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
// Collection variants — runtime config overrides only
|
|
35
|
-
article: {
|
|
36
|
-
config: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
1
|
+
import type { BadgeProps, ButtonProps, FooterColumn } from '@nuxt/ui'
|
|
2
|
+
import type { QueryConfig } from './types/config'
|
|
3
|
+
|
|
4
|
+
export * from './types/config'
|
|
5
|
+
|
|
6
|
+
export default defineAppConfig({
|
|
7
|
+
variants: {
|
|
8
|
+
// UI feature variants — config overrides (extends defined in nuxt.config.ts)
|
|
9
|
+
user: { config: { user: { target: '_blank' } } },
|
|
10
|
+
backButton: { config: { backButton: { icon: 'i-ph-arrow-left', label: 'Back' } as Pick<ButtonProps, 'icon' | 'label' | 'to'> } },
|
|
11
|
+
copyButton: {
|
|
12
|
+
config: {
|
|
13
|
+
copyButton: {
|
|
14
|
+
icon: 'i-ph-link-simple-duotone',
|
|
15
|
+
label: 'Copy URL',
|
|
16
|
+
successIcon: 'i-lucide-copy-check',
|
|
17
|
+
successLabel: 'Link copied to clipboard',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
separator: { config: { separator: { buttons: [], separator: 'or' } } },
|
|
22
|
+
surround: {
|
|
23
|
+
config: {
|
|
24
|
+
surround: {
|
|
25
|
+
show: true,
|
|
26
|
+
prevIcon: 'i-lucide-arrow-left',
|
|
27
|
+
nextIcon: 'i-lucide-arrow-right',
|
|
28
|
+
prevLabel: 'Previous',
|
|
29
|
+
nextLabel: 'Next',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
// Collection variants — runtime config overrides only
|
|
35
|
+
article: {
|
|
36
|
+
config: {
|
|
37
|
+
query: {
|
|
38
|
+
fields: ['title', 'description', 'status', 'date'],
|
|
39
|
+
order: { field: 'date', direction: 'DESC' },
|
|
40
|
+
where: [{ field: 'status', operator: '=', value: 'published' }],
|
|
41
|
+
} as QueryConfig,
|
|
42
|
+
categories: {} as Record<string, BadgeProps>,
|
|
43
|
+
breadcrumbs: [],
|
|
44
|
+
list: {
|
|
45
|
+
itemsPerPage: 12,
|
|
46
|
+
labelAll: 'All',
|
|
47
|
+
noResultsMessage: 'No articles found.',
|
|
48
|
+
noResultsIcon: 'i-ph-article-ny-times-light',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
event: {
|
|
53
|
+
config: {
|
|
54
|
+
query: {
|
|
55
|
+
fields: ['title', 'description', 'status', 'date', 'dateEnd', 'location'],
|
|
56
|
+
order: { field: 'date', direction: 'DESC' },
|
|
57
|
+
where: [{ field: 'status', operator: '=', value: 'published' }],
|
|
58
|
+
} as QueryConfig,
|
|
59
|
+
categories: {} as Record<string, BadgeProps>,
|
|
60
|
+
breadcrumbs: [],
|
|
61
|
+
list: {
|
|
62
|
+
itemsPerPage: 12,
|
|
63
|
+
labelAll: 'All',
|
|
64
|
+
noResultsMessage: 'No events found.',
|
|
65
|
+
noResultsIcon: 'i-ph-calendar-blank',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
app: {
|
|
72
|
+
meta: {
|
|
73
|
+
copyright: {},
|
|
74
|
+
socials: [],
|
|
75
|
+
github: {
|
|
76
|
+
repo: '',
|
|
77
|
+
branch: 'main',
|
|
78
|
+
dir: 'content',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
links: {
|
|
83
|
+
header: [],
|
|
84
|
+
footer: [],
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
icons: {} as Record<string, string>,
|
|
88
|
+
|
|
89
|
+
toc: {
|
|
90
|
+
title: '',
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
date: {
|
|
94
|
+
locale: 'en',
|
|
95
|
+
options: {
|
|
96
|
+
year: 'numeric',
|
|
97
|
+
month: 'short',
|
|
98
|
+
day: 'numeric',
|
|
99
|
+
} as Intl.DateTimeFormatOptions,
|
|
100
|
+
datetimeOptions: {
|
|
101
|
+
year: 'numeric',
|
|
102
|
+
month: 'short',
|
|
103
|
+
day: 'numeric',
|
|
104
|
+
hour: 'numeric',
|
|
105
|
+
minute: 'numeric',
|
|
106
|
+
} as Intl.DateTimeFormatOptions,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
ui: {
|
|
111
|
+
main: {
|
|
112
|
+
base: 'wrap-break-word',
|
|
113
|
+
},
|
|
114
|
+
footerColumns: {
|
|
115
|
+
slots: {},
|
|
116
|
+
columns: {},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
declare module '@nuxt/schema' {
|
|
122
|
+
interface AppConfigInput {
|
|
123
|
+
app?: {
|
|
124
|
+
[key: string]: any
|
|
125
|
+
meta?: {
|
|
126
|
+
copyright?: {
|
|
127
|
+
/** The year in which the copyright was issued */
|
|
128
|
+
copyrightYear?: number
|
|
129
|
+
/** The name of the copyright holder */
|
|
130
|
+
copyrightHolder?: string
|
|
131
|
+
/** The homepage URL of the copyright holder */
|
|
132
|
+
copyrightHomepage?: string
|
|
133
|
+
}
|
|
134
|
+
/** Social button definitions (e.g. Instagram, Facebook, GitHub) */
|
|
135
|
+
socials?: Array<ButtonProps>
|
|
136
|
+
/** Configuration for GitHub repository info */
|
|
137
|
+
github?: {
|
|
138
|
+
/** The repository identifier (e.g. 'sfbiberach/schachfreunde-biberach.de') */
|
|
139
|
+
repo?: string
|
|
140
|
+
/** The branch name (e.g. 'main') */
|
|
141
|
+
branch?: string
|
|
142
|
+
/** The directory where the content is stored (e.g. 'content') */
|
|
143
|
+
dir?: string
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Link collections for various UI regions (e.g. header, footer) */
|
|
147
|
+
links?: {
|
|
148
|
+
header?: Array<FooterColumn>
|
|
149
|
+
footer?: Array<FooterColumn>
|
|
150
|
+
}
|
|
151
|
+
/** Configuration for the table of contents */
|
|
152
|
+
toc?: {
|
|
153
|
+
/** The default title to be shown in the table of contents */
|
|
154
|
+
title?: string
|
|
155
|
+
}
|
|
156
|
+
/** A mapping of internal identifier strings to icon strings */
|
|
157
|
+
icons?: Record<string, string>
|
|
158
|
+
date?: {
|
|
159
|
+
/** The locale used for date formatting (e.g. 'en', 'de') */
|
|
160
|
+
locale?: string
|
|
161
|
+
/** Options for Intl.DateTimeFormat for dates */
|
|
162
|
+
options?: Intl.DateTimeFormatOptions
|
|
163
|
+
/** Options for Intl.DateTimeFormat for datetimes */
|
|
164
|
+
datetimeOptions?: Intl.DateTimeFormatOptions
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|