@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,380 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref } from 'vue'
3
+
4
+ import {
5
+ GhostButton,
6
+ GhostCard,
7
+ GhostCheckbox,
8
+ GhostCheckboxGroup,
9
+ GhostField,
10
+ GhostFieldControl,
11
+ GhostFieldDescription,
12
+ GhostFieldLabel,
13
+ } from '@ghostvue/themes'
14
+
15
+ type ProjectNotification = 'mentions' | 'assignments' | 'digest'
16
+ type AccountNotification = 'security' | 'billing'
17
+
18
+ interface Option<TValue extends string> {
19
+ value: TValue
20
+ label: string
21
+ description: string
22
+ /** Workspace policy owns this choice; members cannot change it. */
23
+ locked?: boolean
24
+ }
25
+
26
+ const projectOptions: readonly Option<ProjectNotification>[] = [
27
+ {
28
+ value: 'mentions',
29
+ label: 'Comments and mentions',
30
+ description: 'Someone replies to you or mentions you by name.',
31
+ },
32
+ {
33
+ value: 'assignments',
34
+ label: 'Task assignments',
35
+ description: 'A task is assigned to you or its due date changes.',
36
+ },
37
+ {
38
+ value: 'digest',
39
+ label: 'Weekly digest',
40
+ description: 'A Monday summary of activity across your projects.',
41
+ },
42
+ ]
43
+
44
+ const accountOptions: readonly Option<AccountNotification>[] = [
45
+ {
46
+ value: 'security',
47
+ label: 'Security alerts',
48
+ description:
49
+ 'New sign-ins and password changes. Required by your workspace.',
50
+ locked: true,
51
+ },
52
+ {
53
+ value: 'billing',
54
+ label: 'Billing receipts',
55
+ description: 'Invoices, payment confirmations, and failed charges.',
56
+ },
57
+ ]
58
+
59
+ const projectDefaults: readonly ProjectNotification[] = [
60
+ 'mentions',
61
+ 'assignments',
62
+ ]
63
+ const accountDefaults: readonly AccountNotification[] = ['security']
64
+
65
+ // The consumer owns these arrays. The group emits new arrays and never
66
+ // mutates them.
67
+ const project = ref<ProjectNotification[]>([...projectDefaults])
68
+ const account = ref<AccountNotification[]>([...accountDefaults])
69
+ const submittedValues = ref<string[] | null>(null)
70
+
71
+ // Select-all counts enabled options only so disabled choices never trap it in mixed.
72
+ const projectEnabled = computed(() =>
73
+ projectOptions.filter((option) => !option.locked).map((o) => o.value),
74
+ )
75
+ const projectOnCount = computed(
76
+ () => projectEnabled.value.filter((v) => project.value.includes(v)).length,
77
+ )
78
+ const allProject = computed(
79
+ () =>
80
+ projectEnabled.value.length > 0 &&
81
+ projectOnCount.value === projectEnabled.value.length,
82
+ )
83
+ const someProject = computed(
84
+ () => projectOnCount.value > 0 && !allProject.value,
85
+ )
86
+
87
+ function setAllProject(checked: boolean): void {
88
+ const enabled = new Set<ProjectNotification>(projectEnabled.value)
89
+ project.value = checked
90
+ ? [
91
+ ...project.value,
92
+ ...projectEnabled.value.filter((v) => !project.value.includes(v)),
93
+ ]
94
+ : project.value.filter((v) => !enabled.has(v))
95
+ }
96
+
97
+ // Listen to native `change` (user activation only), never `update:modelValue`
98
+ // which also fires on native form reset.
99
+ function onAllProjectChange(event: Event): void {
100
+ if (event.target instanceof HTMLInputElement) {
101
+ setAllProject(event.target.checked)
102
+ }
103
+ }
104
+
105
+ function restoreDefaults(): void {
106
+ project.value = [...projectDefaults]
107
+ account.value = [...accountDefaults]
108
+ submittedValues.value = null
109
+ }
110
+
111
+ function clearSaved(): void {
112
+ submittedValues.value = null
113
+ }
114
+
115
+ function save(event: Event): void {
116
+ const form = event.currentTarget as HTMLFormElement
117
+ submittedValues.value = new FormData(form)
118
+ .getAll('notifications')
119
+ .filter((entry): entry is string => typeof entry === 'string')
120
+ }
121
+ </script>
122
+
123
+ <template>
124
+ <form class="prefs" @submit.prevent="save" @change="clearSaved">
125
+ <GhostCard as="section" aria-labelledby="prefs-title">
126
+ <template #header>
127
+ <div class="prefs__header">
128
+ <h2 id="prefs-title" class="prefs__title">Email notifications</h2>
129
+ <p class="prefs__lead">
130
+ Choose what reaches ada@analytical-engines.example.
131
+ </p>
132
+ </div>
133
+ </template>
134
+
135
+ <div class="prefs__groups">
136
+ <GhostCheckboxGroup
137
+ v-model="project"
138
+ name="notifications"
139
+ aria-describedby="prefs-project-hint"
140
+ >
141
+ <legend>Project activity</legend>
142
+ <p id="prefs-project-hint" class="prefs__group-hint">
143
+ Updates from projects you follow.
144
+ </p>
145
+
146
+ <!-- No `value`: keeps standalone boolean contract and mixed state. -->
147
+ <GhostField class="pref">
148
+ <GhostFieldControl v-slot="field">
149
+ <GhostCheckbox
150
+ v-bind="field"
151
+ :model-value="allProject"
152
+ :indeterminate="someProject"
153
+ @change="onAllProjectChange"
154
+ />
155
+ </GhostFieldControl>
156
+ <GhostFieldLabel>All project activity</GhostFieldLabel>
157
+ <GhostFieldDescription>
158
+ {{ projectOnCount }} of {{ projectEnabled.length }} on
159
+ </GhostFieldDescription>
160
+ </GhostField>
161
+
162
+ <div class="prefs__children">
163
+ <GhostField
164
+ v-for="option in projectOptions"
165
+ :key="option.value"
166
+ :disabled="Boolean(option.locked)"
167
+ class="pref"
168
+ >
169
+ <GhostFieldControl v-slot="field">
170
+ <GhostCheckbox v-bind="field" :value="option.value" />
171
+ </GhostFieldControl>
172
+ <GhostFieldLabel>{{ option.label }}</GhostFieldLabel>
173
+ <GhostFieldDescription>
174
+ {{ option.description }}
175
+ </GhostFieldDescription>
176
+ </GhostField>
177
+ </div>
178
+ </GhostCheckboxGroup>
179
+
180
+ <GhostCheckboxGroup
181
+ v-model="account"
182
+ name="notifications"
183
+ aria-describedby="prefs-account-hint"
184
+ class="prefs__group--separated"
185
+ >
186
+ <legend>Account</legend>
187
+ <p id="prefs-account-hint" class="prefs__group-hint">
188
+ Security and billing for you.
189
+ </p>
190
+
191
+ <GhostField
192
+ v-for="option in accountOptions"
193
+ :key="option.value"
194
+ :disabled="Boolean(option.locked)"
195
+ class="pref"
196
+ >
197
+ <GhostFieldControl v-slot="field">
198
+ <GhostCheckbox v-bind="field" :value="option.value" />
199
+ </GhostFieldControl>
200
+ <GhostFieldLabel>{{ option.label }}</GhostFieldLabel>
201
+ <GhostFieldDescription>
202
+ {{ option.description }}
203
+ </GhostFieldDescription>
204
+ </GhostField>
205
+ </GhostCheckboxGroup>
206
+
207
+ <dl class="prefs__readout">
208
+ <div class="prefs__readout-row">
209
+ <dt>Model</dt>
210
+ <dd>
211
+ <code>{{ JSON.stringify([...project, ...account]) }}</code>
212
+ </dd>
213
+ </div>
214
+ <div class="prefs__readout-row">
215
+ <dt>FormData</dt>
216
+ <dd>
217
+ <code>{{
218
+ submittedValues === null
219
+ ? 'Submit to inspect getAll("notifications")'
220
+ : JSON.stringify(submittedValues)
221
+ }}</code>
222
+ </dd>
223
+ </div>
224
+ </dl>
225
+ </div>
226
+
227
+ <template #footer>
228
+ <div class="prefs__actions">
229
+ <p class="prefs__status" role="status">
230
+ {{
231
+ submittedValues === null
232
+ ? ''
233
+ : `Saved ${submittedValues.length} preference${submittedValues.length === 1 ? '' : 's'}.`
234
+ }}
235
+ </p>
236
+ <GhostButton
237
+ type="button"
238
+ variant="ghost"
239
+ tone="neutral"
240
+ class="prefs__action"
241
+ @click="restoreDefaults"
242
+ >
243
+ Restore defaults
244
+ </GhostButton>
245
+ <GhostButton type="submit" class="prefs__action">
246
+ Save preferences
247
+ </GhostButton>
248
+ </div>
249
+ </template>
250
+ </GhostCard>
251
+ </form>
252
+ </template>
253
+
254
+ <style scoped>
255
+ .prefs {
256
+ max-inline-size: 42rem;
257
+ }
258
+
259
+ .prefs__header {
260
+ display: grid;
261
+ gap: var(--ghost-space-gap-xs);
262
+ padding-block-end: var(--ghost-space-stack-sm);
263
+ }
264
+
265
+ .prefs__title {
266
+ color: var(--ghost-text-default);
267
+ font-size: var(--ghost-type-size-lg);
268
+ font-weight: var(--ghost-type-weight-semibold);
269
+ line-height: var(--ghost-type-line-tight);
270
+ margin: 0;
271
+ }
272
+
273
+ .prefs__lead,
274
+ .prefs__group-hint,
275
+ .prefs__status {
276
+ color: var(--ghost-text-muted);
277
+ font-size: var(--ghost-type-size-sm);
278
+ line-height: var(--ghost-type-line-snug);
279
+ margin: 0;
280
+ overflow-wrap: anywhere;
281
+ }
282
+
283
+ .prefs__groups {
284
+ display: grid;
285
+ gap: var(--ghost-space-stack-md);
286
+ }
287
+
288
+ .prefs__group--separated {
289
+ border-block-start: var(--ghost-border-hairline-width) solid
290
+ var(--ghost-border-muted);
291
+ padding-block-start: var(--ghost-space-stack-md);
292
+ }
293
+
294
+ .prefs__children {
295
+ display: grid;
296
+ gap: var(--ghost-space-stack-sm);
297
+ padding-inline-start: calc(
298
+ var(--ghost-control-size-md-min) + var(--ghost-space-gap-sm)
299
+ );
300
+ }
301
+
302
+ .prefs :deep(.pref) {
303
+ column-gap: var(--ghost-space-gap-sm);
304
+ display: grid;
305
+ grid-template-columns: auto minmax(0, 1fr);
306
+ row-gap: var(--ghost-space-gap-xs);
307
+ }
308
+
309
+ .prefs :deep(.pref > .ghost-themed-scope) {
310
+ display: flex;
311
+ grid-row: 1 / span 2;
312
+ }
313
+
314
+ .prefs :deep(.pref > [data-part='label']) {
315
+ cursor: pointer;
316
+ grid-column: 2;
317
+ padding-block-start: calc((var(--ghost-control-size-md-min) - 1lh) / 2);
318
+ }
319
+
320
+ .prefs :deep(.pref[data-state='disabled'] > [data-part='label']) {
321
+ cursor: not-allowed;
322
+ }
323
+
324
+ .prefs :deep(.pref > [data-part='description']) {
325
+ grid-column: 2;
326
+ overflow-wrap: anywhere;
327
+ }
328
+
329
+ .prefs__readout {
330
+ border-block-start: var(--ghost-border-hairline-width) solid
331
+ var(--ghost-border-muted);
332
+ display: grid;
333
+ gap: var(--ghost-space-gap-xs);
334
+ margin: 0;
335
+ padding-block-start: var(--ghost-space-stack-sm);
336
+ }
337
+
338
+ .prefs__readout-row {
339
+ display: flex;
340
+ flex-wrap: wrap;
341
+ font-size: var(--ghost-type-size-xs);
342
+ gap: var(--ghost-space-gap-xs);
343
+ }
344
+
345
+ .prefs__readout-row dt {
346
+ color: var(--ghost-text-muted);
347
+ font-weight: var(--ghost-type-weight-medium);
348
+ }
349
+
350
+ .prefs__readout-row dd {
351
+ color: var(--ghost-text-default);
352
+ margin: 0;
353
+ overflow-wrap: anywhere;
354
+ }
355
+
356
+ .prefs__actions {
357
+ display: grid;
358
+ gap: var(--ghost-space-gap-sm) var(--ghost-space-gap-md);
359
+ }
360
+
361
+ .prefs :deep(.prefs__action) {
362
+ inline-size: 100%;
363
+ }
364
+
365
+ @container ghost-demo (min-width: 30rem) {
366
+ .prefs__actions {
367
+ align-items: center;
368
+ display: flex;
369
+ justify-content: flex-end;
370
+ }
371
+
372
+ .prefs__status {
373
+ flex: 1 1 auto;
374
+ }
375
+
376
+ .prefs :deep(.prefs__action) {
377
+ inline-size: auto;
378
+ }
379
+ }
380
+ </style>
@@ -0,0 +1,135 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+
4
+ import {
5
+ GhostCollapsible,
6
+ GhostCollapsibleContent,
7
+ GhostCollapsibleTrigger,
8
+ } from '@ghostvue/themes'
9
+
10
+ const open = ref(false)
11
+
12
+ const scans = [
13
+ { time: 'Nov 26, 08:12', location: 'Reno, NV', event: 'Picked up' },
14
+ {
15
+ time: 'Nov 26, 21:40',
16
+ location: 'Salt Lake City, UT',
17
+ event: 'In transit',
18
+ },
19
+ { time: 'Nov 27, 06:05', location: 'Denver, CO', event: 'At sort facility' },
20
+ { time: 'Nov 27, 14:30', location: 'Denver, CO', event: 'Out for delivery' },
21
+ ] as const
22
+ </script>
23
+
24
+ <template>
25
+ <div class="shipment-history">
26
+ <div class="shipment-history__summary">
27
+ <span class="shipment-history__title">Order 48213</span>
28
+ <span class="shipment-history__meta">
29
+ Out for delivery · 4 carrier scans
30
+ </span>
31
+ </div>
32
+ <!--
33
+ An in-flow disclosure: the table pushes the content below it down
34
+ instead of floating over it. Collapsing animates the height, and the
35
+ panel receives native `hidden` once that motion finishes.
36
+ -->
37
+ <GhostCollapsible v-slot="{ open: isOpen }" v-model:open="open">
38
+ <GhostCollapsibleTrigger data-themed>
39
+ {{ isOpen ? 'Hide scan history' : 'Show scan history' }}
40
+ </GhostCollapsibleTrigger>
41
+ <GhostCollapsibleContent data-themed>
42
+ <div
43
+ class="shipment-history__scroll"
44
+ role="region"
45
+ aria-label="Carrier scans"
46
+ tabindex="0"
47
+ >
48
+ <table class="shipment-history__table">
49
+ <thead>
50
+ <tr>
51
+ <th scope="col">Time</th>
52
+ <th scope="col">Location</th>
53
+ <th scope="col">Event</th>
54
+ </tr>
55
+ </thead>
56
+ <tbody>
57
+ <tr v-for="scan in scans" :key="scan.time">
58
+ <td>{{ scan.time }}</td>
59
+ <td>{{ scan.location }}</td>
60
+ <td>{{ scan.event }}</td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
64
+ </div>
65
+ </GhostCollapsibleContent>
66
+ </GhostCollapsible>
67
+ <span class="shipment-history__meta">
68
+ Delivery window: today, 2–6 PM.
69
+ </span>
70
+ </div>
71
+ </template>
72
+
73
+ <style scoped>
74
+ .shipment-history {
75
+ display: grid;
76
+ gap: var(--ghost-space-gap-sm);
77
+ }
78
+
79
+ .shipment-history__summary {
80
+ display: grid;
81
+ gap: var(--ghost-space-gap-xs);
82
+ min-inline-size: 0;
83
+ }
84
+
85
+ .shipment-history__title {
86
+ color: var(--ghost-text-default);
87
+ font-size: var(--ghost-type-size-md);
88
+ font-weight: var(--ghost-type-weight-semibold);
89
+ line-height: var(--ghost-type-line-snug);
90
+ }
91
+
92
+ .shipment-history__meta {
93
+ color: var(--ghost-text-muted);
94
+ font-size: var(--ghost-type-size-sm);
95
+ line-height: var(--ghost-type-line-normal);
96
+ }
97
+
98
+ /* Narrow previews scroll the table instead of overflowing the page. */
99
+ .shipment-history__scroll {
100
+ overflow-x: auto;
101
+ }
102
+
103
+ .shipment-history__scroll:focus-visible {
104
+ outline: var(--ghost-focus-ring-width) solid var(--ghost-focus-ring-color);
105
+ outline-offset: var(--ghost-focus-ring-offset);
106
+ }
107
+
108
+ .shipment-history__table {
109
+ border-collapse: collapse;
110
+ color: var(--ghost-surface-fg);
111
+ font-size: var(--ghost-type-size-sm);
112
+ inline-size: 100%;
113
+ line-height: var(--ghost-type-line-normal);
114
+ margin: 0;
115
+ }
116
+
117
+ .shipment-history__table th,
118
+ .shipment-history__table td {
119
+ border: 0;
120
+ border-block-end: var(--ghost-border-hairline-width) solid
121
+ var(--ghost-border-default);
122
+ padding: var(--ghost-space-gap-xs) var(--ghost-space-gap-sm);
123
+ text-align: start;
124
+ white-space: nowrap;
125
+ }
126
+
127
+ .shipment-history__table th {
128
+ color: var(--ghost-text-muted);
129
+ font-weight: var(--ghost-type-weight-medium);
130
+ }
131
+
132
+ .shipment-history__table tbody tr:last-child td {
133
+ border-block-end: 0;
134
+ }
135
+ </style>