@ghostvue/mcp 0.1.0 → 0.2.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.
Files changed (152) hide show
  1. package/dist/assets/bundle.json +2 -2
  2. package/dist/assets/component-exports.json +1 -0
  3. package/dist/assets/docs/pages.json +1 -1
  4. package/dist/assets/examples/catalog.json +1 -1
  5. package/dist/assets/examples/sources/accordion/billing-faq.vue +123 -0
  6. package/dist/assets/examples/sources/avatar/team-roster.vue +69 -5
  7. package/dist/assets/examples/sources/badge/release-channels.vue +1 -1
  8. package/dist/assets/examples/sources/breadcrumb/basic.vue +60 -15
  9. package/dist/assets/examples/sources/button/refresh-status.vue +95 -0
  10. package/dist/assets/examples/sources/calendar/availability.vue +235 -0
  11. package/dist/assets/examples/sources/calendar/office-locale.vue +197 -0
  12. package/dist/assets/examples/sources/card/project-summary.vue +38 -3
  13. package/dist/assets/examples/sources/checkbox-group/basic.vue +56 -0
  14. package/dist/assets/examples/sources/checkbox-group/field.vue +73 -0
  15. package/dist/assets/examples/sources/checkbox-group/form.vue +100 -0
  16. package/dist/assets/examples/sources/checkbox-group/headless.vue +68 -0
  17. package/dist/assets/examples/sources/checkbox-group/notification-preferences.vue +380 -0
  18. package/dist/assets/examples/sources/collapsible/shipment-history.vue +135 -0
  19. package/dist/assets/examples/sources/combobox/review-request-form.vue +415 -0
  20. package/dist/assets/examples/sources/command-palette/async.vue +60 -12
  21. package/dist/assets/examples/sources/command-palette/basic.vue +123 -2
  22. package/dist/assets/examples/sources/command-palette/shortcut.vue +132 -5
  23. package/dist/assets/examples/sources/command-palette/themed.vue +44 -4
  24. package/dist/assets/examples/sources/command-palette/virtualized.vue +124 -3
  25. package/dist/assets/examples/sources/context-menu/themed.vue +81 -26
  26. package/dist/assets/examples/sources/data-table/themed-invoices.vue +219 -44
  27. package/dist/assets/examples/sources/date-picker/controlled.vue +8 -293
  28. package/dist/assets/examples/sources/date-picker/custom-format.vue +6 -295
  29. package/dist/assets/examples/sources/date-picker/nested-dialog.vue +28 -350
  30. package/dist/assets/examples/sources/date-picker/rtl.vue +5 -294
  31. package/dist/assets/examples/sources/date-picker/themed.vue +2 -2
  32. package/dist/assets/examples/sources/date-picker/validation.vue +8 -294
  33. package/dist/assets/examples/sources/dropdown-menu/nested-export.vue +56 -0
  34. package/dist/assets/examples/sources/empty-state/search-results.vue +26 -1
  35. package/dist/assets/examples/sources/field/billing-address-headless.vue +93 -0
  36. package/dist/assets/examples/sources/field/billing-address.vue +192 -0
  37. package/dist/assets/examples/sources/field/checkbox.vue +10 -2
  38. package/dist/assets/examples/sources/field/themed.vue +12 -11
  39. package/dist/assets/examples/sources/file-upload/asset-submission.vue +96 -36
  40. package/dist/assets/examples/sources/form/async-validation.vue +180 -0
  41. package/dist/assets/examples/sources/form/composable.vue +146 -0
  42. package/dist/assets/examples/sources/form/nested-webhooks.vue +233 -0
  43. package/dist/assets/examples/sources/form/profile-schema.vue +376 -0
  44. package/dist/assets/examples/sources/inline-alert/billing-notices.vue +26 -5
  45. package/dist/assets/examples/sources/inline-alert/feed-status.vue +229 -0
  46. package/dist/assets/examples/sources/input/clearable-search-headless.vue +162 -0
  47. package/dist/assets/examples/sources/input/clearable-search.vue +225 -0
  48. package/dist/assets/examples/sources/input/unit-suffix.vue +109 -0
  49. package/dist/assets/examples/sources/interactive-surface/basic.vue +20 -8
  50. package/dist/assets/examples/sources/interactive-surface/feature-tiles.vue +42 -8
  51. package/dist/assets/examples/sources/kbd/command-shortcuts.vue +0 -1
  52. package/dist/assets/examples/sources/link/documentation-footer.vue +11 -4
  53. package/dist/assets/examples/sources/link/router.vue +9 -5
  54. package/dist/assets/examples/sources/menubar/themed.vue +46 -10
  55. package/dist/assets/examples/sources/number-input/order-limits.vue +5 -0
  56. package/dist/assets/examples/sources/number-input/themed.vue +12 -6
  57. package/dist/assets/examples/sources/number-input/workshop-booking.vue +207 -0
  58. package/dist/assets/examples/sources/pagination/controlled.vue +83 -18
  59. package/dist/assets/examples/sources/pagination/ellipsis.vue +44 -14
  60. package/dist/assets/examples/sources/pagination/themed.vue +161 -21
  61. package/dist/assets/examples/sources/presence/basic.vue +81 -0
  62. package/dist/assets/examples/sources/presence/portal.vue +92 -0
  63. package/dist/assets/examples/sources/progress/report-export.vue +160 -0
  64. package/dist/assets/examples/sources/scroll-area/activity-feed.vue +0 -1
  65. package/dist/assets/examples/sources/scroll-area/horizontal.vue +169 -14
  66. package/dist/assets/examples/sources/scroll-area/themed.vue +42 -3
  67. package/dist/assets/examples/sources/scroll-spy/themed.vue +180 -31
  68. package/dist/assets/examples/sources/select/alert-routing-form.vue +356 -0
  69. package/dist/assets/examples/sources/select/multiple-form.vue +201 -0
  70. package/dist/assets/examples/sources/select/multiple-labels.vue +142 -0
  71. package/dist/assets/examples/sources/skeleton/profile-loading.vue +28 -4
  72. package/dist/assets/examples/sources/slider/audio-mixer.vue +8 -2
  73. package/dist/assets/examples/sources/slider/price-filter.vue +162 -0
  74. package/dist/assets/examples/sources/slider/vertical.vue +3 -2
  75. package/dist/assets/examples/sources/spinner/sync-status.vue +13 -10
  76. package/dist/assets/examples/sources/switch/form.vue +43 -11
  77. package/dist/assets/examples/sources/table/contain-horizontal.vue +24 -12
  78. package/dist/assets/examples/sources/table/row-headers.vue +118 -19
  79. package/dist/assets/examples/sources/tabs/review-sections.vue +43 -0
  80. package/dist/assets/examples/sources/tags-input/headless-field.vue +31 -0
  81. package/dist/assets/examples/sources/tags-input/project-labels.vue +64 -0
  82. package/dist/assets/examples/sources/tags-input/read-only.vue +12 -0
  83. package/dist/assets/examples/sources/toast/themed.vue +42 -19
  84. package/dist/assets/examples/sources/toolbar/themed.vue +22 -4
  85. package/dist/assets/examples/sources/tooltip/themed.vue +12 -1
  86. package/dist/assets/examples/sources/tree/themed.vue +70 -17
  87. package/dist/assets/manifests/themes/ghost-accordion.manifest.json +1 -0
  88. package/dist/assets/manifests/themes/ghost-button.manifest.json +1 -0
  89. package/dist/assets/manifests/themes/ghost-calendar.manifest.json +3 -1
  90. package/dist/assets/manifests/themes/ghost-checkbox-group.manifest.json +90 -0
  91. package/dist/assets/manifests/themes/ghost-collapsible.manifest.json +1 -0
  92. package/dist/assets/manifests/themes/ghost-combobox.manifest.json +1 -0
  93. package/dist/assets/manifests/themes/ghost-command-palette.manifest.json +2 -1
  94. package/dist/assets/manifests/themes/ghost-date-picker.manifest.json +5 -0
  95. package/dist/assets/manifests/themes/ghost-dropdown-menu.manifest.json +9 -0
  96. package/dist/assets/manifests/themes/ghost-field.manifest.json +10 -2
  97. package/dist/assets/manifests/themes/ghost-inline-alert.manifest.json +1 -0
  98. package/dist/assets/manifests/themes/ghost-input.manifest.json +3 -1
  99. package/dist/assets/manifests/themes/ghost-link.manifest.json +2 -1
  100. package/dist/assets/manifests/themes/ghost-number-input.manifest.json +1 -0
  101. package/dist/assets/manifests/themes/ghost-pagination.manifest.json +6 -2
  102. package/dist/assets/manifests/themes/ghost-progress.manifest.json +1 -0
  103. package/dist/assets/manifests/themes/ghost-radio-group-item.manifest.json +63 -0
  104. package/dist/assets/manifests/themes/ghost-scroll-area.manifest.json +12 -2
  105. package/dist/assets/manifests/themes/ghost-select.manifest.json +3 -0
  106. package/dist/assets/manifests/themes/ghost-slider.manifest.json +1 -0
  107. package/dist/assets/manifests/themes/ghost-table.manifest.json +2 -1
  108. package/dist/assets/manifests/themes/ghost-tags-input.manifest.json +255 -0
  109. package/dist/assets/manifests/vue/ghost-checkbox-group.manifest.json +173 -0
  110. package/dist/assets/manifests/vue/ghost-command-palette-content.manifest.json +6 -2
  111. package/dist/assets/manifests/vue/ghost-command-palette-overlay.manifest.json +6 -2
  112. package/dist/assets/manifests/vue/ghost-command-palette.manifest.json +0 -1
  113. package/dist/assets/manifests/vue/ghost-context-menu-content.manifest.json +3 -3
  114. package/dist/assets/manifests/vue/ghost-context-menu.manifest.json +1 -1
  115. package/dist/assets/manifests/vue/ghost-data-table-preset.manifest.json +1 -1
  116. package/dist/assets/manifests/vue/ghost-data-table-table.manifest.json +1 -1
  117. package/dist/assets/manifests/vue/ghost-data-table.manifest.json +99 -2
  118. package/dist/assets/manifests/vue/ghost-date-picker-content.manifest.json +12 -3
  119. package/dist/assets/manifests/vue/ghost-date-picker.manifest.json +1 -6
  120. package/dist/assets/manifests/vue/ghost-dialog-content.manifest.json +6 -2
  121. package/dist/assets/manifests/vue/ghost-dialog-overlay.manifest.json +6 -2
  122. package/dist/assets/manifests/vue/ghost-drawer-content.manifest.json +6 -2
  123. package/dist/assets/manifests/vue/ghost-drawer-overlay.manifest.json +6 -2
  124. package/dist/assets/manifests/vue/ghost-field-error.manifest.json +12 -1
  125. package/dist/assets/manifests/vue/ghost-field.manifest.json +35 -3
  126. package/dist/assets/manifests/vue/ghost-form.manifest.json +221 -0
  127. package/dist/assets/manifests/vue/ghost-hover-card-content.manifest.json +12 -3
  128. package/dist/assets/manifests/vue/ghost-input.manifest.json +2 -1
  129. package/dist/assets/manifests/vue/ghost-link.manifest.json +1 -2
  130. package/dist/assets/manifests/vue/ghost-menubar-content.manifest.json +3 -3
  131. package/dist/assets/manifests/vue/ghost-menubar.manifest.json +4 -4
  132. package/dist/assets/manifests/vue/ghost-pagination.manifest.json +0 -2
  133. package/dist/assets/manifests/vue/ghost-popover-content.manifest.json +6 -2
  134. package/dist/assets/manifests/vue/ghost-presence.manifest.json +96 -0
  135. package/dist/assets/manifests/vue/ghost-scroll-area.manifest.json +0 -1
  136. package/dist/assets/manifests/vue/ghost-select-content.manifest.json +6 -1
  137. package/dist/assets/manifests/vue/ghost-select-group.manifest.json +6 -1
  138. package/dist/assets/manifests/vue/ghost-select-label.manifest.json +6 -1
  139. package/dist/assets/manifests/vue/ghost-select-option.manifest.json +6 -1
  140. package/dist/assets/manifests/vue/ghost-select-trigger.manifest.json +6 -1
  141. package/dist/assets/manifests/vue/ghost-select-value.manifest.json +18 -2
  142. package/dist/assets/manifests/vue/ghost-select.manifest.json +18 -6
  143. package/dist/assets/manifests/vue/ghost-submenu-content.manifest.json +168 -0
  144. package/dist/assets/manifests/vue/ghost-submenu-trigger.manifest.json +102 -0
  145. package/dist/assets/manifests/vue/ghost-submenu.manifest.json +59 -0
  146. package/dist/assets/manifests/vue/ghost-table.manifest.json +0 -2
  147. package/dist/assets/manifests/vue/ghost-tabs.manifest.json +2 -1
  148. package/dist/assets/manifests/vue/ghost-tags-input.manifest.json +260 -0
  149. package/dist/assets/tokens.json +15 -0
  150. package/dist/components.d.ts +5 -0
  151. package/dist/components.js +80 -11
  152. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, useTemplateRef, watch } from 'vue'
3
+
4
+ import {
5
+ GhostButton,
6
+ GhostField,
7
+ GhostFieldControl,
8
+ GhostFieldLabel,
9
+ GhostInput,
10
+ type GhostInputExposed,
11
+ } from '@ghostvue/vue'
12
+
13
+ const query = ref('')
14
+ const submitted = ref('')
15
+ const group = useTemplateRef<HTMLElement>('group')
16
+ const input = useTemplateRef<GhostInputExposed>('input')
17
+ const canClear = computed(() => query.value !== '')
18
+
19
+ function clear(): void {
20
+ query.value = ''
21
+ // Focus before the button unmounts so focus never falls to <body>.
22
+ input.value?.focus()
23
+ }
24
+
25
+ // Move focus to the input if the button disappears while it holds focus.
26
+ watch(
27
+ canClear,
28
+ (next) => {
29
+ const active = document.activeElement
30
+ if (
31
+ !next &&
32
+ active !== input.value?.element &&
33
+ group.value?.contains(active)
34
+ )
35
+ input.value?.focus()
36
+ },
37
+ { flush: 'pre' },
38
+ )
39
+
40
+ function search(event: SubmitEvent): void {
41
+ if (!(event.currentTarget instanceof HTMLFormElement)) return
42
+ const q = new FormData(event.currentTarget).get('q')
43
+ submitted.value = typeof q === 'string' ? `q=${q}` : ''
44
+ }
45
+ </script>
46
+
47
+ <template>
48
+ <form
49
+ role="search"
50
+ aria-label="Documents"
51
+ class="doc-search"
52
+ @submit.prevent="search"
53
+ >
54
+ <GhostField class="doc-search__field">
55
+ <GhostFieldLabel>Search documents</GhostFieldLabel>
56
+ <GhostFieldControl v-slot="field">
57
+ <span ref="group" class="doc-search__group">
58
+ <svg
59
+ class="doc-search__icon"
60
+ aria-hidden="true"
61
+ focusable="false"
62
+ viewBox="0 0 16 16"
63
+ width="16"
64
+ height="16"
65
+ >
66
+ <circle
67
+ cx="7"
68
+ cy="7"
69
+ r="4.5"
70
+ fill="none"
71
+ stroke="currentColor"
72
+ stroke-width="1.5"
73
+ />
74
+ <path
75
+ d="m10.5 10.5 3.5 3.5"
76
+ stroke="currentColor"
77
+ stroke-width="1.5"
78
+ stroke-linecap="round"
79
+ />
80
+ </svg>
81
+ <GhostInput
82
+ ref="input"
83
+ v-bind="field"
84
+ v-model="query"
85
+ type="search"
86
+ name="q"
87
+ class="doc-search__input"
88
+ />
89
+ <GhostButton
90
+ v-if="canClear"
91
+ class="doc-search__clear"
92
+ aria-label="Clear search"
93
+ @click="clear"
94
+ >
95
+ <span aria-hidden="true">×</span>
96
+ </GhostButton>
97
+ </span>
98
+ </GhostFieldControl>
99
+ </GhostField>
100
+ <button type="submit" class="doc-search__submit">Search</button>
101
+ <output aria-label="Submitted entries">{{ submitted }}</output>
102
+ </form>
103
+ </template>
104
+
105
+ <style scoped>
106
+ .doc-search {
107
+ display: grid;
108
+ gap: 0.75rem;
109
+ justify-items: start;
110
+ max-inline-size: 24rem;
111
+ }
112
+
113
+ .doc-search__field {
114
+ display: grid;
115
+ gap: 0.25rem;
116
+ inline-size: 100%;
117
+ }
118
+
119
+ /* The end track keeps the button's size so the input never resizes. */
120
+ .doc-search__group {
121
+ align-items: center;
122
+ display: grid;
123
+ gap: 0.5rem;
124
+ grid-template-columns: auto minmax(0, 1fr) 2.25rem;
125
+ }
126
+
127
+ .doc-search__input,
128
+ .doc-search__clear,
129
+ .doc-search__submit {
130
+ /* currentColor keeps the controls readable in light and dark hosts. */
131
+ background: transparent;
132
+ border: 1px solid color-mix(in srgb, currentColor 60%, transparent);
133
+ border-radius: 0.375rem;
134
+ box-sizing: border-box;
135
+ color: inherit;
136
+ font: inherit;
137
+ min-block-size: 2.25rem;
138
+ }
139
+
140
+ .doc-search__input {
141
+ inline-size: 100%;
142
+ padding: 0.375rem 0.5rem;
143
+ }
144
+
145
+ .doc-search__input::-webkit-search-cancel-button {
146
+ display: none;
147
+ }
148
+
149
+ .doc-search__clear {
150
+ inline-size: 2.25rem;
151
+ padding: 0;
152
+ }
153
+
154
+ .doc-search__submit {
155
+ padding: 0.375rem 0.75rem;
156
+ }
157
+
158
+ :is(.doc-search__input, .doc-search__clear, .doc-search__submit):focus-visible {
159
+ outline: 2px solid currentColor;
160
+ outline-offset: 2px;
161
+ }
162
+ </style>
@@ -0,0 +1,225 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, useTemplateRef, watch } from 'vue'
3
+
4
+ import {
5
+ GhostButton,
6
+ GhostField,
7
+ GhostFieldControl,
8
+ GhostFieldLabel,
9
+ GhostInput,
10
+ type GhostInputExposed,
11
+ } from '@ghostvue/themes'
12
+
13
+ // Deterministic local data; a real app would query its own source.
14
+ const reports = [
15
+ 'Q3 revenue forecast',
16
+ 'Churn by region',
17
+ 'Forecast accuracy, trailing twelve months',
18
+ 'Seat expansion by plan',
19
+ ] as const
20
+
21
+ const query = ref('')
22
+ const readonly = ref(false)
23
+ const disabled = ref(false)
24
+ const submitted = ref('')
25
+ const group = useTemplateRef<HTMLElement>('group')
26
+ const input = useTemplateRef<GhostInputExposed>('input')
27
+
28
+ // Clearing is an edit, so the button exists only while the field is editable.
29
+ const canClear = computed(
30
+ () => query.value !== '' && !disabled.value && !readonly.value,
31
+ )
32
+
33
+ const matches = computed(() => {
34
+ const needle = query.value.trim().toLowerCase()
35
+ return needle === ''
36
+ ? reports
37
+ : reports.filter((report) => report.toLowerCase().includes(needle))
38
+ })
39
+
40
+ function clear(): void {
41
+ query.value = ''
42
+ // Focus before the button unmounts so focus never falls to <body>.
43
+ input.value?.focus()
44
+ }
45
+
46
+ /*
47
+ * The button can also disappear while it holds focus, for example when the
48
+ * field becomes read-only. It is the group's only other focusable part, so
49
+ * move focus to the input before the render removes it.
50
+ */
51
+ watch(
52
+ canClear,
53
+ (next) => {
54
+ const active = document.activeElement
55
+ if (
56
+ !next &&
57
+ active !== input.value?.element &&
58
+ group.value?.contains(active)
59
+ )
60
+ input.value?.focus()
61
+ },
62
+ { flush: 'pre' },
63
+ )
64
+
65
+ function search(event: SubmitEvent): void {
66
+ if (!(event.currentTarget instanceof HTMLFormElement)) return
67
+ submitted.value =
68
+ Array.from(
69
+ new FormData(event.currentTarget),
70
+ ([name, value]) =>
71
+ `${name}=${typeof value === 'string' ? value : value.name}`,
72
+ ).join(', ') || 'No search fields submitted.'
73
+ }
74
+ </script>
75
+
76
+ <template>
77
+ <div class="report-search">
78
+ <form
79
+ role="search"
80
+ aria-label="Reports"
81
+ class="report-search__form"
82
+ @submit.prevent="search"
83
+ @reset="submitted = ''"
84
+ >
85
+ <GhostField :disabled>
86
+ <GhostFieldLabel>Search reports</GhostFieldLabel>
87
+ <GhostFieldControl v-slot="field">
88
+ <span ref="group" class="report-search__group">
89
+ <svg
90
+ class="report-search__icon"
91
+ aria-hidden="true"
92
+ focusable="false"
93
+ viewBox="0 0 16 16"
94
+ width="16"
95
+ height="16"
96
+ >
97
+ <circle
98
+ cx="7"
99
+ cy="7"
100
+ r="4.5"
101
+ fill="none"
102
+ stroke="currentColor"
103
+ stroke-width="1.5"
104
+ />
105
+ <path
106
+ d="m10.5 10.5 3.5 3.5"
107
+ stroke="currentColor"
108
+ stroke-width="1.5"
109
+ stroke-linecap="round"
110
+ />
111
+ </svg>
112
+ <GhostInput
113
+ ref="input"
114
+ v-bind="field"
115
+ v-model="query"
116
+ type="search"
117
+ name="q"
118
+ placeholder="Forecast"
119
+ :readonly
120
+ block
121
+ />
122
+ <GhostButton
123
+ v-if="canClear"
124
+ variant="ghost"
125
+ tone="neutral"
126
+ icon-only
127
+ aria-label="Clear search"
128
+ @click="clear"
129
+ >
130
+ <span data-part="icon" aria-hidden="true">×</span>
131
+ </GhostButton>
132
+ </span>
133
+ </GhostFieldControl>
134
+ </GhostField>
135
+ <div class="report-search__actions">
136
+ <GhostButton type="submit">Search</GhostButton>
137
+ <GhostButton type="reset" variant="ghost" tone="neutral">
138
+ Reset
139
+ </GhostButton>
140
+ </div>
141
+ </form>
142
+ <p class="report-search__meta" role="status">
143
+ {{ matches.length }} of {{ reports.length }} reports
144
+ </p>
145
+ <ul class="report-search__results" aria-label="Matching reports">
146
+ <li v-for="report in matches" :key="report">{{ report }}</li>
147
+ </ul>
148
+ <output aria-label="Submitted entries" class="report-search__meta">
149
+ {{ submitted }}
150
+ </output>
151
+ <details class="report-search__settings">
152
+ <summary>Example settings</summary>
153
+ <label><input v-model="readonly" type="checkbox" /> Read-only</label>
154
+ <label><input v-model="disabled" type="checkbox" /> Disabled</label>
155
+ </details>
156
+ </div>
157
+ </template>
158
+
159
+ <style scoped>
160
+ .report-search {
161
+ display: grid;
162
+ gap: var(--ghost-space-stack-md);
163
+ max-inline-size: 28rem;
164
+ min-inline-size: 0;
165
+ }
166
+
167
+ .report-search__form {
168
+ display: grid;
169
+ gap: var(--ghost-space-stack-sm);
170
+ }
171
+
172
+ /*
173
+ * Grid tracks size the direct child without selecting the themed input's
174
+ * scope span. The end track keeps the icon-only button's size so the input
175
+ * does not resize as the button appears.
176
+ */
177
+ .report-search__group {
178
+ align-items: center;
179
+ display: grid;
180
+ gap: var(--ghost-space-gap-sm);
181
+ grid-template-columns: auto minmax(0, 1fr) var(--ghost-control-size-md-min);
182
+ }
183
+
184
+ .report-search__icon {
185
+ color: var(--ghost-text-muted);
186
+ }
187
+
188
+ /* One clear affordance: hide the UA cancel button inside this group only. */
189
+ .report-search__group :deep(.ghost-input::-webkit-search-cancel-button) {
190
+ display: none;
191
+ }
192
+
193
+ .report-search__actions {
194
+ display: flex;
195
+ flex-wrap: wrap;
196
+ gap: var(--ghost-space-gap-sm);
197
+ }
198
+
199
+ .report-search__meta {
200
+ color: var(--ghost-text-muted);
201
+ font-size: var(--ghost-type-size-sm);
202
+ line-height: var(--ghost-type-line-snug);
203
+ margin: 0;
204
+ overflow-wrap: anywhere;
205
+ }
206
+
207
+ /* Owns list spacing so docs prose rules do not decide it. */
208
+ .report-search__results {
209
+ color: var(--ghost-text-default);
210
+ display: grid;
211
+ font-size: var(--ghost-type-size-sm);
212
+ gap: var(--ghost-space-gap-xs);
213
+ line-height: var(--ghost-type-line-snug);
214
+ list-style: none;
215
+ margin: 0;
216
+ overflow-wrap: anywhere;
217
+ padding: 0;
218
+ }
219
+
220
+ .report-search__settings label {
221
+ align-items: baseline;
222
+ display: flex;
223
+ gap: var(--ghost-space-gap-xs);
224
+ }
225
+ </style>
@@ -0,0 +1,109 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, useId } from 'vue'
3
+
4
+ import {
5
+ GhostButton,
6
+ GhostField,
7
+ GhostFieldControl,
8
+ GhostFieldDescription,
9
+ GhostFieldError,
10
+ GhostFieldLabel,
11
+ GhostInput,
12
+ } from '@ghostvue/themes'
13
+
14
+ const timeout = ref('30')
15
+ const submitted = ref('')
16
+ // One ID per instance, so sibling copies reference their own unit.
17
+ const unitId = `${useId()}-unit`
18
+
19
+ const invalid = computed(() => {
20
+ const seconds = Number(timeout.value)
21
+ return !/^\d+$/.test(timeout.value) || seconds < 1 || seconds > 120
22
+ })
23
+
24
+ /*
25
+ * GhostFieldControl passes its own aria-describedby without merging caller
26
+ * IDs, so join them here. The unit comes first so it qualifies the value
27
+ * before the hint is read.
28
+ */
29
+ function describedBy(fieldIds: string | undefined): string {
30
+ return [unitId, fieldIds].filter(Boolean).join(' ')
31
+ }
32
+
33
+ function save(event: SubmitEvent): void {
34
+ if (invalid.value || !(event.currentTarget instanceof HTMLFormElement)) return
35
+ submitted.value = Array.from(
36
+ new FormData(event.currentTarget),
37
+ ([name, value]) =>
38
+ `${name}=${typeof value === 'string' ? value : value.name}`,
39
+ ).join(', ')
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <form class="webhook-timeout" novalidate @submit.prevent="save">
45
+ <GhostField :invalid>
46
+ <GhostFieldLabel>Request timeout</GhostFieldLabel>
47
+ <GhostFieldDescription>Between 1 and 120.</GhostFieldDescription>
48
+ <GhostFieldControl v-slot="field">
49
+ <span class="webhook-timeout__group">
50
+ <GhostInput
51
+ v-bind="field"
52
+ v-model="timeout"
53
+ :aria-describedby="describedBy(field['aria-describedby'])"
54
+ name="timeoutSeconds"
55
+ inputmode="numeric"
56
+ autocomplete="off"
57
+ block
58
+ />
59
+ <span :id="unitId" class="webhook-timeout__unit">seconds</span>
60
+ </span>
61
+ </GhostFieldControl>
62
+ <GhostFieldError v-if="invalid">
63
+ Enter a whole number from 1 to 120.
64
+ </GhostFieldError>
65
+ </GhostField>
66
+ <div class="webhook-timeout__actions">
67
+ <GhostButton type="submit">Save timeout</GhostButton>
68
+ <output aria-label="Submitted entries" class="webhook-timeout__result">
69
+ {{ submitted }}
70
+ </output>
71
+ </div>
72
+ </form>
73
+ </template>
74
+
75
+ <style scoped>
76
+ .webhook-timeout {
77
+ display: grid;
78
+ gap: var(--ghost-space-stack-md);
79
+ max-inline-size: 24rem;
80
+ min-inline-size: 0;
81
+ }
82
+
83
+ /*
84
+ * Grid tracks size the direct child without selecting the themed input's
85
+ * scope span. The input keeps at least half the width; a long unit wraps in
86
+ * its own track.
87
+ */
88
+ .webhook-timeout__group {
89
+ align-items: center;
90
+ display: grid;
91
+ gap: var(--ghost-space-gap-sm);
92
+ grid-template-columns: minmax(50%, 1fr) minmax(0, auto);
93
+ }
94
+
95
+ .webhook-timeout__unit,
96
+ .webhook-timeout__result {
97
+ color: var(--ghost-text-muted);
98
+ font-size: var(--ghost-type-size-sm);
99
+ line-height: var(--ghost-type-line-snug);
100
+ overflow-wrap: anywhere;
101
+ }
102
+
103
+ .webhook-timeout__actions {
104
+ align-items: center;
105
+ display: flex;
106
+ flex-wrap: wrap;
107
+ gap: var(--ghost-space-gap-sm) var(--ghost-space-gap-md);
108
+ }
109
+ </style>
@@ -4,7 +4,7 @@ import { GhostInteractiveSurface } from '@ghostvue/themes'
4
4
 
5
5
  <template>
6
6
  <div class="surface-basic-example">
7
- <GhostInteractiveSurface class="report-card">
7
+ <GhostInteractiveSurface class="surface-basic-example__card">
8
8
  <span class="report-card__title">Quarterly report</span>
9
9
  <span class="report-card__copy">
10
10
  The glow follows the pointer. Copy stays readable without it.
@@ -18,13 +18,6 @@ import { GhostInteractiveSurface } from '@ghostvue/themes'
18
18
  display: grid;
19
19
  }
20
20
 
21
- .report-card {
22
- display: grid;
23
- gap: var(--ghost-space-gap-xs);
24
- min-block-size: 8rem;
25
- padding: var(--ghost-space-inset-md);
26
- }
27
-
28
21
  .report-card__title {
29
22
  color: var(--ghost-text-default);
30
23
  font-size: var(--ghost-type-size-md);
@@ -38,3 +31,22 @@ import { GhostInteractiveSurface } from '@ghostvue/themes'
38
31
  line-height: var(--ghost-type-line-normal);
39
32
  }
40
33
  </style>
34
+
35
+ <!--
36
+ Unscoped on purpose: the themed surface forwards `class` to its inner
37
+ element, which does not carry this file's scoped attribute.
38
+ -->
39
+ <style>
40
+ .surface-basic-example__card {
41
+ align-content: start;
42
+ background-color: var(--ghost-elevation-1-bg, Canvas);
43
+ border: var(--ghost-border-hairline-width, 1px) solid
44
+ var(--ghost-elevation-1-border, CanvasText);
45
+ border-radius: var(--ghost-radius-md, 0.5rem);
46
+ box-sizing: border-box;
47
+ display: grid;
48
+ gap: var(--ghost-space-gap-xs);
49
+ min-block-size: 8rem;
50
+ padding: var(--ghost-space-inset-md);
51
+ }
52
+ </style>
@@ -1,5 +1,9 @@
1
1
  <script setup lang="ts">
2
- import { GhostBadge, GhostInteractiveSurface } from '@ghostvue/themes'
2
+ import {
3
+ GhostBadge,
4
+ GhostInteractiveSurface,
5
+ GhostLink,
6
+ } from '@ghostvue/themes'
3
7
 
4
8
  const capabilities = [
5
9
  {
@@ -7,12 +11,16 @@ const capabilities = [
7
11
  tag: 'Ambient',
8
12
  description:
9
13
  'Updates --ghost-pointer-x and --ghost-pointer-y smoothly on pointer move.',
14
+ action: 'Read the styling hooks',
15
+ href: '/components/interactive-surface#styling',
10
16
  },
11
17
  {
12
18
  title: 'Reduced motion',
13
19
  tag: 'Accessible',
14
20
  description:
15
21
  'Disables spotlight tracking automatically when prefers-reduced-motion is active.',
22
+ action: 'Review accessibility behavior',
23
+ href: '/components/interactive-surface#accessibility-and-environment-behavior',
16
24
  },
17
25
  ] as const
18
26
  </script>
@@ -31,6 +39,13 @@ const capabilities = [
31
39
  </GhostBadge>
32
40
  </div>
33
41
  <span class="surface-showcase__copy">{{ item.description }}</span>
42
+ <!--
43
+ The surface is decoration and never takes focus. The tile's action is
44
+ a real link inside it, so keyboard users reach it and see its focus ring.
45
+ -->
46
+ <span class="surface-showcase__action">
47
+ <GhostLink :href="item.href">{{ item.action }}</GhostLink>
48
+ </span>
34
49
  </GhostInteractiveSurface>
35
50
  </div>
36
51
  </template>
@@ -41,13 +56,6 @@ const capabilities = [
41
56
  gap: var(--ghost-space-stack-md);
42
57
  }
43
58
 
44
- .surface-showcase__tile {
45
- display: grid;
46
- gap: var(--ghost-space-gap-xs);
47
- min-block-size: 7rem;
48
- padding: var(--ghost-space-inset-md);
49
- }
50
-
51
59
  .surface-showcase__header {
52
60
  align-items: center;
53
61
  display: flex;
@@ -63,6 +71,12 @@ const capabilities = [
63
71
  line-height: var(--ghost-type-line-snug);
64
72
  }
65
73
 
74
+ .surface-showcase__action {
75
+ align-self: end;
76
+ font-size: var(--ghost-type-size-sm);
77
+ line-height: var(--ghost-type-line-normal);
78
+ }
79
+
66
80
  .surface-showcase__copy {
67
81
  color: var(--ghost-text-muted);
68
82
  font-size: var(--ghost-type-size-sm);
@@ -75,3 +89,23 @@ const capabilities = [
75
89
  }
76
90
  }
77
91
  </style>
92
+
93
+ <!--
94
+ Unscoped on purpose: the themed surface forwards `class` to its inner
95
+ element, which does not carry this file's scoped attribute.
96
+ -->
97
+ <style>
98
+ .surface-showcase__tile {
99
+ background-color: var(--ghost-elevation-1-bg, Canvas);
100
+ border: var(--ghost-border-hairline-width, 1px) solid
101
+ var(--ghost-elevation-1-border, CanvasText);
102
+ border-radius: var(--ghost-radius-md, 0.5rem);
103
+ box-sizing: border-box;
104
+ display: grid;
105
+ gap: var(--ghost-space-gap-xs);
106
+ /* Header and copy stay together; the action sits at the bottom edge. */
107
+ grid-template-rows: auto auto 1fr;
108
+ min-block-size: 7rem;
109
+ padding: var(--ghost-space-inset-md);
110
+ }
111
+ </style>
@@ -28,7 +28,6 @@ const shortcuts = [
28
28
  <GhostSegmentedControl
29
29
  v-model="platform"
30
30
  aria-label="Keycap platform"
31
- size="sm"
32
31
  >
33
32
  <GhostSegmentedControlItem value="apple">
34
33
  Apple
@@ -12,20 +12,27 @@ import { GhostCard, GhostLink, GhostSeparator } from '@ghostvue/themes'
12
12
  <div class="link-showcase__grid">
13
13
  <div class="link-showcase__group">
14
14
  <span class="link-showcase__heading">Guides</span>
15
- <GhostLink href="#getting-started">Getting started</GhostLink>
16
- <GhostLink href="#theming" variant="subtle">
15
+ <!-- In-app routes stay in the same tab and keep native link behavior. -->
16
+ <GhostLink href="/getting-started">Getting started</GhostLink>
17
+ <GhostLink href="/themes/tokens" variant="subtle">
17
18
  Theme token reference
18
19
  </GhostLink>
19
- <GhostLink href="#migration" disabled>
20
+ <!-- Disabled drops the href, so the archived page is not reachable. -->
21
+ <GhostLink href="/migration/v1" disabled>
20
22
  Legacy v1 migration (archived)
21
23
  </GhostLink>
22
24
  </div>
23
25
 
24
26
  <div class="link-showcase__group">
25
27
  <span class="link-showcase__heading">Specifications</span>
28
+ <!--
29
+ target="_blank" adds rel="noopener noreferrer", the external icon,
30
+ and a visually hidden "Opens in new tab" hint.
31
+ -->
26
32
  <GhostLink href="https://www.w3.org/WAI/ARIA/apg/" target="_blank">
27
33
  WAI-ARIA Authoring Practices
28
34
  </GhostLink>
35
+ <!-- external marks an outbound link that opens in the same tab. -->
29
36
  <GhostLink href="https://vuejs.org/" external>
30
37
  Vue.js documentation
31
38
  </GhostLink>
@@ -36,7 +43,7 @@ import { GhostCard, GhostLink, GhostSeparator } from '@ghostvue/themes'
36
43
 
37
44
  <span class="link-showcase__note">
38
45
  Read the
39
- <GhostLink href="#accessibility-contract">
46
+ <GhostLink href="/specs/link#accessibility-contract">
40
47
  accessibility contract
41
48
  </GhostLink>
42
49
  before shipping custom wrappers.