@happydesigns/ui 0.20.0 → 0.20.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/README.md CHANGED
@@ -39,6 +39,17 @@ Run Nuxt preparation after changing dependencies or layer configuration:
39
39
  pnpm exec nuxt prepare
40
40
  ```
41
41
 
42
+ ## Maintenance page
43
+
44
+ For a branded temporary notice, use `HMaintenancePage` with title, description, actions and optional logo/tools/footer slots. Activation, routing and HTTP status stay application-owned. See [Maintenance page](docs/content/6.configuration/9.maintenance.md).
45
+
46
+ ## Site search
47
+
48
+ Render `<HSiteSearch />` once in the app shell and use `<UContentSearchButton />`
49
+ to open it. Configure navigation shortcuts with `app.search.links` and
50
+ `app.search.groups`. The base-layer search does not load content indexes or
51
+ activate Nuxt Content or Studio. See [Search](docs/content/6.configuration/8.content-search.md).
52
+
42
53
  ## Content collections
43
54
 
44
55
  Applications using Nuxt Content extend `@happydesigns/ui/content` instead of
@@ -0,0 +1,80 @@
1
+ <script setup lang="ts">
2
+ import type { ButtonProps } from '@nuxt/ui'
3
+
4
+ withDefaults(defineProps<{
5
+ title: string
6
+ description?: string
7
+ icon?: string
8
+ iconColor?: 'primary' | 'secondary'
9
+ mainId?: string
10
+ actions?: ButtonProps[]
11
+ }>(), { actions: () => [], mainId: 'main-content', iconColor: 'primary' })
12
+ </script>
13
+
14
+ <template>
15
+ <div class="flex min-h-dvh flex-col bg-default text-default">
16
+ <header v-if="$slots.logo || $slots.tools" class="border-b border-default">
17
+ <UContainer class="flex min-h-16 max-w-[88rem] items-center justify-between gap-6 py-3">
18
+ <slot name="logo" />
19
+ <slot name="tools" />
20
+ </UContainer>
21
+ </header>
22
+ <main :id="mainId" tabindex="-1" class="holding-surface relative isolate flex flex-1 items-center px-0 py-16 sm:py-20">
23
+ <UContainer class="relative w-full">
24
+ <div class="mx-auto max-w-3xl text-center">
25
+ <UIcon v-if="icon" :name="icon" class="mb-6 size-10 sm:size-12" :class="iconColor === 'secondary' ? 'text-secondary' : 'text-primary'" aria-hidden="true" />
26
+ <h1 class="text-4xl font-semibold tracking-tight text-balance text-highlighted sm:text-5xl">
27
+ {{ title }}
28
+ </h1>
29
+ <p v-if="description" class="mx-auto mt-6 max-w-xl text-lg leading-relaxed text-muted sm:text-xl">
30
+ {{ description }}
31
+ </p>
32
+ <slot />
33
+ <div v-if="actions.length || $slots.actions" class="mt-8 flex flex-wrap justify-center gap-3 sm:mt-10">
34
+ <slot name="actions">
35
+ <UButton v-for="(action, index) in actions" :key="index" v-bind="action" />
36
+ </slot>
37
+ </div>
38
+ </div>
39
+ </UContainer>
40
+ </main>
41
+ <footer v-if="$slots.footer" class="border-t border-default py-6 text-sm text-muted">
42
+ <UContainer><slot name="footer" /></UContainer>
43
+ </footer>
44
+ </div>
45
+ </template>
46
+
47
+ <style scoped>
48
+ .holding-surface {
49
+ background: var(--ui-bg);
50
+ background-image: radial-gradient(ellipse at center, transparent 15%, color-mix(in srgb, var(--ui-bg-muted) 20%, var(--ui-bg)) 100%);
51
+ }
52
+ .holding-surface::before {
53
+ content: '';
54
+ position: absolute;
55
+ inset: 0;
56
+ z-index: -1;
57
+ pointer-events: none;
58
+ opacity: .13;
59
+ background-image: radial-gradient(ellipse 3px 1px, var(--ui-primary) 95%, transparent), radial-gradient(ellipse 1px 3px, var(--ui-primary) 95%, transparent);
60
+ background-size: 44px 44px;
61
+ mask-image: radial-gradient(ellipse at center, transparent 25%, black 100%);
62
+ }
63
+ /* Static monochrome grain dithers the gradient without filtering the content. */
64
+ .holding-surface::after {
65
+ content: '';
66
+ position: absolute;
67
+ inset: 0;
68
+ z-index: -1;
69
+ pointer-events: none;
70
+ opacity: .045;
71
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='grain' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23808080' filter='url(%23grain)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
72
+ background-size: 160px 160px;
73
+ }
74
+ @media (forced-colors: active) {
75
+ .holding-surface::before,
76
+ .holding-surface::after {
77
+ display: none;
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import type { CommandPaletteGroup, ContentSearchProps } from '@nuxt/ui'
3
+
4
+ const props = defineProps<Pick<ContentSearchProps, 'files' | 'navigation' | 'loading' | 'groups'>>()
5
+ const appConfig = useAppConfig()
6
+ const search = computed(() => appConfig.app.search)
7
+ const searchTerm = ref('')
8
+ const groups = computed<CommandPaletteGroup[]>(() => [
9
+ ...props.groups ?? [],
10
+ ...search.value.groups ?? [],
11
+ ])
12
+ </script>
13
+
14
+ <template>
15
+ <UContentSearch
16
+ v-model:search-term="searchTerm"
17
+ :title="search.title"
18
+ :description="search.description"
19
+ :placeholder="search.placeholder"
20
+ :links="search.links"
21
+ :groups="groups"
22
+ :files="props.files"
23
+ :navigation="props.navigation"
24
+ :loading="props.loading"
25
+ :fuse="{ resultLimit: search.resultLimit }"
26
+ />
27
+ </template>
@@ -4,14 +4,11 @@ import type { CommandPaletteGroup } from '@nuxt/ui'
4
4
  const appConfig = useAppConfig()
5
5
  const { open } = useContentSearch()
6
6
  const search = computed(() => appConfig.app.search)
7
- const searchTerm = ref('')
8
7
  const { navigation, files, status, error, load } = useContentSearchData()
9
8
 
10
9
  const groups = computed<CommandPaletteGroup[]>(() => {
11
- const configuredGroups = search.value.groups ?? []
12
-
13
10
  if (!error.value) {
14
- return configuredGroups
11
+ return []
15
12
  }
16
13
 
17
14
  return [
@@ -28,7 +25,6 @@ const groups = computed<CommandPaletteGroup[]>(() => {
28
25
  },
29
26
  ],
30
27
  },
31
- ...configuredGroups,
32
28
  ]
33
29
  })
34
30
 
@@ -44,16 +40,10 @@ watch(open, (isOpen) => {
44
40
  </script>
45
41
 
46
42
  <template>
47
- <UContentSearch
48
- v-model:search-term="searchTerm"
49
- :title="search.title"
50
- :description="search.description"
51
- :placeholder="search.placeholder"
52
- :links="search.links"
43
+ <HSiteSearch
53
44
  :groups="groups"
54
45
  :files="files"
55
46
  :navigation="navigation"
56
47
  :loading="status === 'pending'"
57
- :fuse="{ resultLimit: search.resultLimit }"
58
48
  />
59
49
  </template>
package/nuxt.config.ts CHANGED
@@ -18,6 +18,10 @@ export default defineNuxtConfig({
18
18
  '@nuxt/ui',
19
19
  ],
20
20
 
21
+ ui: {
22
+ content: true,
23
+ },
24
+
21
25
  variants: {
22
26
  registry: variantRegistry,
23
27
  },
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@happydesigns/ui",
3
3
  "type": "module",
4
- "version": "0.20.0",
4
+ "version": "0.20.1",
5
5
  "private": false,
6
- "packageManager": "pnpm@11.11.0",
7
6
  "description": "A reusable Nuxt foundation for content-driven happydesigns websites and applications.",
8
7
  "author": "happydesigns",
9
8
  "homepage": "https://github.com/happydesigns/ui#readme",
@@ -45,27 +44,6 @@
45
44
  "publishConfig": {
46
45
  "access": "public"
47
46
  },
48
- "scripts": {
49
- "dev": "nuxt dev playground",
50
- "docs": "nuxt dev docs",
51
- "docs:build": "nuxt generate docs && node scripts/validate-docs-output.mjs",
52
- "docs:build:server": "nuxt build docs",
53
- "prepare": "nuxt prepare && nuxt prepare playground",
54
- "build": "nuxt build playground",
55
- "generate": "nuxt generate playground && node scripts/validate-playground-output.mjs",
56
- "package:check": "node scripts/validate-package.mjs",
57
- "consumer:check": "node scripts/validate-consumer.mjs",
58
- "preview": "nuxt preview playground",
59
- "lint": "eslint .",
60
- "lint:fix": "eslint . --fix",
61
- "typecheck": "nuxt typecheck && nuxt typecheck playground",
62
- "test": "vitest run",
63
- "test:watch": "vitest",
64
- "release": "changelogen --release",
65
- "release:pre": "changelogen --release --prerelease",
66
- "release:alpha": "changelogen --release --versionSuffix alpha.0",
67
- "release:beta": "changelogen --release --versionSuffix beta.0"
68
- },
69
47
  "peerDependencies": {
70
48
  "tailwindcss": "^4.3.2",
71
49
  "vue": "^3.5.41"
@@ -97,5 +75,25 @@
97
75
  },
98
76
  "resolutions": {
99
77
  "@happydesigns/ui": "workspace:*"
78
+ },
79
+ "scripts": {
80
+ "dev": "nuxt dev playground",
81
+ "docs": "nuxt dev docs",
82
+ "docs:build": "nuxt generate docs && node scripts/validate-docs-output.mjs",
83
+ "docs:build:server": "nuxt build docs",
84
+ "build": "nuxt build playground && node scripts/validate-playground-output.mjs",
85
+ "generate": "nuxt generate playground && node scripts/validate-playground-output.mjs",
86
+ "package:check": "node scripts/validate-package.mjs",
87
+ "consumer:check": "node scripts/validate-consumer.mjs",
88
+ "preview": "nuxt preview playground",
89
+ "lint": "eslint .",
90
+ "lint:fix": "eslint . --fix",
91
+ "typecheck": "nuxt typecheck && nuxt typecheck playground",
92
+ "test": "vitest run",
93
+ "test:watch": "vitest",
94
+ "release": "changelogen --release",
95
+ "release:pre": "changelogen --release --prerelease",
96
+ "release:alpha": "changelogen --release --versionSuffix alpha.0",
97
+ "release:beta": "changelogen --release --versionSuffix beta.0"
100
98
  }
101
- }
99
+ }