@happydesigns/ui 0.17.0 → 0.17.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 +6 -0
- package/app/layouts/article.vue +1 -3
- package/app/layouts/content.vue +5 -7
- package/package.json +19 -2
- package/app/internal/pageLayout.ts +0 -7
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @happydesigns/ui
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@happydesigns/ui)
|
|
4
|
+
[](https://www.npmjs.com/package/@happydesigns/ui)
|
|
5
|
+
[](https://github.com/happydesigns/ui/actions/workflows/ci.yml)
|
|
6
|
+
|
|
3
7
|
Reusable Nuxt layer for happydesigns websites, docs sites, and product apps.
|
|
4
8
|
|
|
5
9
|
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
10
|
|
|
11
|
+
[npm](https://www.npmjs.com/package/@happydesigns/ui) · [npmx](https://npmx.dev/package/@happydesigns/ui) · [GitHub](https://github.com/happydesigns/ui)
|
|
12
|
+
|
|
7
13
|
## Installation
|
|
8
14
|
|
|
9
15
|
```bash
|
package/app/layouts/article.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts" generic="C extends keyof PageCollections = 'article'">
|
|
2
2
|
import type { PageCollections } from '@nuxt/content'
|
|
3
3
|
import type { BreadcrumbItem } from '@nuxt/ui'
|
|
4
|
-
import { getPageLayoutUi } from '../internal/pageLayout'
|
|
5
4
|
|
|
6
5
|
const props = defineProps<{
|
|
7
6
|
path?: string
|
|
@@ -27,7 +26,6 @@ const tocEnabled = computed(() => !page.value || !('toc' in page.value) || page.
|
|
|
27
26
|
const renderToc = computed(() => hasToc.value
|
|
28
27
|
&& tocEnabled.value
|
|
29
28
|
&& Boolean(page.value?.body?.toc?.links?.length))
|
|
30
|
-
const pageUi = computed(() => getPageLayoutUi(renderToc.value))
|
|
31
29
|
|
|
32
30
|
if (!page.value) {
|
|
33
31
|
throw createError({
|
|
@@ -93,7 +91,7 @@ const backLink = computed(() => {
|
|
|
93
91
|
</HArticleHeaderBody>
|
|
94
92
|
</UPageHeader>
|
|
95
93
|
|
|
96
|
-
<UPage
|
|
94
|
+
<UPage>
|
|
97
95
|
<UPageBody>
|
|
98
96
|
<slot />
|
|
99
97
|
|
package/app/layouts/content.vue
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts" generic="C extends 'page' = 'page'">
|
|
2
2
|
import type { Collections } from '@nuxt/content'
|
|
3
|
-
import { getPageLayoutUi } from '../internal/pageLayout'
|
|
4
3
|
|
|
5
4
|
const {
|
|
6
5
|
path,
|
|
@@ -35,18 +34,17 @@ usePageSeo(page)
|
|
|
35
34
|
const renderToc = computed(() => hasToc.value
|
|
36
35
|
&& page.value?.toc !== false
|
|
37
36
|
&& Boolean(page.value?.body?.toc?.links?.length))
|
|
38
|
-
const pageUi = computed(() => getPageLayoutUi(renderToc.value))
|
|
39
37
|
const header = computed(() => resolvePageHeader(page.value))
|
|
40
38
|
</script>
|
|
41
39
|
|
|
42
40
|
<template>
|
|
43
41
|
<UContainer v-if="page">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<UPage>
|
|
43
|
+
<UPageHeader
|
|
44
|
+
v-if="hasHeader && header"
|
|
45
|
+
v-bind="header"
|
|
46
|
+
/>
|
|
48
47
|
|
|
49
|
-
<UPage :ui="pageUi">
|
|
50
48
|
<UPageBody>
|
|
51
49
|
<slot />
|
|
52
50
|
</UPageBody>
|
package/package.json
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happydesigns/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@11.11.0",
|
|
7
|
+
"description": "A reusable Nuxt foundation for content-driven happydesigns websites and applications.",
|
|
7
8
|
"author": "happydesigns",
|
|
8
|
-
"homepage": "https://github.com/happydesigns",
|
|
9
|
+
"homepage": "https://github.com/happydesigns/ui#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/happydesigns/ui.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/happydesigns/ui/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"nuxt",
|
|
19
|
+
"nuxt-layer",
|
|
20
|
+
"nuxt-ui",
|
|
21
|
+
"nuxt-content",
|
|
22
|
+
"vue",
|
|
23
|
+
"design-system",
|
|
24
|
+
"content-management"
|
|
25
|
+
],
|
|
9
26
|
"exports": {
|
|
10
27
|
".": "./nuxt.config.ts",
|
|
11
28
|
"./schemas": "./schemas/index.ts",
|