@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.
- package/dist/assets/bundle.json +2 -2
- package/dist/assets/component-exports.json +1 -0
- package/dist/assets/docs/pages.json +1 -1
- package/dist/assets/examples/catalog.json +1 -1
- package/dist/assets/examples/sources/accordion/billing-faq.vue +123 -0
- package/dist/assets/examples/sources/avatar/team-roster.vue +69 -5
- package/dist/assets/examples/sources/badge/release-channels.vue +1 -1
- package/dist/assets/examples/sources/breadcrumb/basic.vue +60 -15
- package/dist/assets/examples/sources/button/refresh-status.vue +95 -0
- package/dist/assets/examples/sources/calendar/availability.vue +235 -0
- package/dist/assets/examples/sources/calendar/office-locale.vue +197 -0
- package/dist/assets/examples/sources/card/project-summary.vue +38 -3
- package/dist/assets/examples/sources/checkbox-group/basic.vue +56 -0
- package/dist/assets/examples/sources/checkbox-group/field.vue +73 -0
- package/dist/assets/examples/sources/checkbox-group/form.vue +100 -0
- package/dist/assets/examples/sources/checkbox-group/headless.vue +68 -0
- package/dist/assets/examples/sources/checkbox-group/notification-preferences.vue +380 -0
- package/dist/assets/examples/sources/collapsible/shipment-history.vue +135 -0
- package/dist/assets/examples/sources/combobox/review-request-form.vue +415 -0
- package/dist/assets/examples/sources/command-palette/async.vue +60 -12
- package/dist/assets/examples/sources/command-palette/basic.vue +123 -2
- package/dist/assets/examples/sources/command-palette/shortcut.vue +132 -5
- package/dist/assets/examples/sources/command-palette/themed.vue +44 -4
- package/dist/assets/examples/sources/command-palette/virtualized.vue +124 -3
- package/dist/assets/examples/sources/context-menu/themed.vue +81 -26
- package/dist/assets/examples/sources/data-table/themed-invoices.vue +219 -44
- package/dist/assets/examples/sources/date-picker/controlled.vue +8 -293
- package/dist/assets/examples/sources/date-picker/custom-format.vue +6 -295
- package/dist/assets/examples/sources/date-picker/nested-dialog.vue +28 -350
- package/dist/assets/examples/sources/date-picker/rtl.vue +5 -294
- package/dist/assets/examples/sources/date-picker/themed.vue +2 -2
- package/dist/assets/examples/sources/date-picker/validation.vue +8 -294
- package/dist/assets/examples/sources/dropdown-menu/nested-export.vue +56 -0
- package/dist/assets/examples/sources/empty-state/search-results.vue +26 -1
- package/dist/assets/examples/sources/field/billing-address-headless.vue +93 -0
- package/dist/assets/examples/sources/field/billing-address.vue +192 -0
- package/dist/assets/examples/sources/field/checkbox.vue +10 -2
- package/dist/assets/examples/sources/field/themed.vue +12 -11
- package/dist/assets/examples/sources/file-upload/asset-submission.vue +96 -36
- package/dist/assets/examples/sources/form/async-validation.vue +180 -0
- package/dist/assets/examples/sources/form/composable.vue +146 -0
- package/dist/assets/examples/sources/form/nested-webhooks.vue +233 -0
- package/dist/assets/examples/sources/form/profile-schema.vue +376 -0
- package/dist/assets/examples/sources/inline-alert/billing-notices.vue +26 -5
- package/dist/assets/examples/sources/inline-alert/feed-status.vue +229 -0
- package/dist/assets/examples/sources/input/clearable-search-headless.vue +162 -0
- package/dist/assets/examples/sources/input/clearable-search.vue +225 -0
- package/dist/assets/examples/sources/input/unit-suffix.vue +109 -0
- package/dist/assets/examples/sources/interactive-surface/basic.vue +20 -8
- package/dist/assets/examples/sources/interactive-surface/feature-tiles.vue +42 -8
- package/dist/assets/examples/sources/kbd/command-shortcuts.vue +0 -1
- package/dist/assets/examples/sources/link/documentation-footer.vue +11 -4
- package/dist/assets/examples/sources/link/router.vue +9 -5
- package/dist/assets/examples/sources/menubar/themed.vue +46 -10
- package/dist/assets/examples/sources/number-input/order-limits.vue +5 -0
- package/dist/assets/examples/sources/number-input/themed.vue +12 -6
- package/dist/assets/examples/sources/number-input/workshop-booking.vue +207 -0
- package/dist/assets/examples/sources/pagination/controlled.vue +83 -18
- package/dist/assets/examples/sources/pagination/ellipsis.vue +44 -14
- package/dist/assets/examples/sources/pagination/themed.vue +161 -21
- package/dist/assets/examples/sources/presence/basic.vue +81 -0
- package/dist/assets/examples/sources/presence/portal.vue +92 -0
- package/dist/assets/examples/sources/progress/report-export.vue +160 -0
- package/dist/assets/examples/sources/scroll-area/activity-feed.vue +0 -1
- package/dist/assets/examples/sources/scroll-area/horizontal.vue +169 -14
- package/dist/assets/examples/sources/scroll-area/themed.vue +42 -3
- package/dist/assets/examples/sources/scroll-spy/themed.vue +180 -31
- package/dist/assets/examples/sources/select/alert-routing-form.vue +356 -0
- package/dist/assets/examples/sources/select/multiple-form.vue +201 -0
- package/dist/assets/examples/sources/select/multiple-labels.vue +142 -0
- package/dist/assets/examples/sources/skeleton/profile-loading.vue +28 -4
- package/dist/assets/examples/sources/slider/audio-mixer.vue +8 -2
- package/dist/assets/examples/sources/slider/price-filter.vue +162 -0
- package/dist/assets/examples/sources/slider/vertical.vue +3 -2
- package/dist/assets/examples/sources/spinner/sync-status.vue +13 -10
- package/dist/assets/examples/sources/switch/form.vue +43 -11
- package/dist/assets/examples/sources/table/contain-horizontal.vue +24 -12
- package/dist/assets/examples/sources/table/row-headers.vue +118 -19
- package/dist/assets/examples/sources/tabs/review-sections.vue +43 -0
- package/dist/assets/examples/sources/tags-input/headless-field.vue +31 -0
- package/dist/assets/examples/sources/tags-input/project-labels.vue +64 -0
- package/dist/assets/examples/sources/tags-input/read-only.vue +12 -0
- package/dist/assets/examples/sources/toast/themed.vue +42 -19
- package/dist/assets/examples/sources/toolbar/themed.vue +22 -4
- package/dist/assets/examples/sources/tooltip/themed.vue +12 -1
- package/dist/assets/examples/sources/tree/themed.vue +70 -17
- package/dist/assets/manifests/themes/ghost-accordion.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-button.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-calendar.manifest.json +3 -1
- package/dist/assets/manifests/themes/ghost-checkbox-group.manifest.json +90 -0
- package/dist/assets/manifests/themes/ghost-collapsible.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-combobox.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-command-palette.manifest.json +2 -1
- package/dist/assets/manifests/themes/ghost-date-picker.manifest.json +5 -0
- package/dist/assets/manifests/themes/ghost-dropdown-menu.manifest.json +9 -0
- package/dist/assets/manifests/themes/ghost-field.manifest.json +10 -2
- package/dist/assets/manifests/themes/ghost-inline-alert.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-input.manifest.json +3 -1
- package/dist/assets/manifests/themes/ghost-link.manifest.json +2 -1
- package/dist/assets/manifests/themes/ghost-number-input.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-pagination.manifest.json +6 -2
- package/dist/assets/manifests/themes/ghost-progress.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-radio-group-item.manifest.json +63 -0
- package/dist/assets/manifests/themes/ghost-scroll-area.manifest.json +12 -2
- package/dist/assets/manifests/themes/ghost-select.manifest.json +3 -0
- package/dist/assets/manifests/themes/ghost-slider.manifest.json +1 -0
- package/dist/assets/manifests/themes/ghost-table.manifest.json +2 -1
- package/dist/assets/manifests/themes/ghost-tags-input.manifest.json +255 -0
- package/dist/assets/manifests/vue/ghost-checkbox-group.manifest.json +173 -0
- package/dist/assets/manifests/vue/ghost-command-palette-content.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-command-palette-overlay.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-command-palette.manifest.json +0 -1
- package/dist/assets/manifests/vue/ghost-context-menu-content.manifest.json +3 -3
- package/dist/assets/manifests/vue/ghost-context-menu.manifest.json +1 -1
- package/dist/assets/manifests/vue/ghost-data-table-preset.manifest.json +1 -1
- package/dist/assets/manifests/vue/ghost-data-table-table.manifest.json +1 -1
- package/dist/assets/manifests/vue/ghost-data-table.manifest.json +99 -2
- package/dist/assets/manifests/vue/ghost-date-picker-content.manifest.json +12 -3
- package/dist/assets/manifests/vue/ghost-date-picker.manifest.json +1 -6
- package/dist/assets/manifests/vue/ghost-dialog-content.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-dialog-overlay.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-drawer-content.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-drawer-overlay.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-field-error.manifest.json +12 -1
- package/dist/assets/manifests/vue/ghost-field.manifest.json +35 -3
- package/dist/assets/manifests/vue/ghost-form.manifest.json +221 -0
- package/dist/assets/manifests/vue/ghost-hover-card-content.manifest.json +12 -3
- package/dist/assets/manifests/vue/ghost-input.manifest.json +2 -1
- package/dist/assets/manifests/vue/ghost-link.manifest.json +1 -2
- package/dist/assets/manifests/vue/ghost-menubar-content.manifest.json +3 -3
- package/dist/assets/manifests/vue/ghost-menubar.manifest.json +4 -4
- package/dist/assets/manifests/vue/ghost-pagination.manifest.json +0 -2
- package/dist/assets/manifests/vue/ghost-popover-content.manifest.json +6 -2
- package/dist/assets/manifests/vue/ghost-presence.manifest.json +96 -0
- package/dist/assets/manifests/vue/ghost-scroll-area.manifest.json +0 -1
- package/dist/assets/manifests/vue/ghost-select-content.manifest.json +6 -1
- package/dist/assets/manifests/vue/ghost-select-group.manifest.json +6 -1
- package/dist/assets/manifests/vue/ghost-select-label.manifest.json +6 -1
- package/dist/assets/manifests/vue/ghost-select-option.manifest.json +6 -1
- package/dist/assets/manifests/vue/ghost-select-trigger.manifest.json +6 -1
- package/dist/assets/manifests/vue/ghost-select-value.manifest.json +18 -2
- package/dist/assets/manifests/vue/ghost-select.manifest.json +18 -6
- package/dist/assets/manifests/vue/ghost-submenu-content.manifest.json +168 -0
- package/dist/assets/manifests/vue/ghost-submenu-trigger.manifest.json +102 -0
- package/dist/assets/manifests/vue/ghost-submenu.manifest.json +59 -0
- package/dist/assets/manifests/vue/ghost-table.manifest.json +0 -2
- package/dist/assets/manifests/vue/ghost-tabs.manifest.json +2 -1
- package/dist/assets/manifests/vue/ghost-tags-input.manifest.json +260 -0
- package/dist/assets/tokens.json +15 -0
- package/dist/components.d.ts +5 -0
- package/dist/components.js +80 -11
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
GhostField,
|
|
4
|
+
GhostFieldControl,
|
|
5
|
+
GhostFieldDescription,
|
|
6
|
+
GhostFieldLabel,
|
|
7
|
+
GhostTagsInput,
|
|
8
|
+
} from '@ghostvue/vue'
|
|
9
|
+
|
|
10
|
+
const initial: readonly string[] = ['Vue']
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<GhostField>
|
|
15
|
+
<GhostFieldLabel>Skills</GhostFieldLabel>
|
|
16
|
+
<GhostFieldDescription>
|
|
17
|
+
Press Enter, or paste a comma-separated list to add several skills.
|
|
18
|
+
</GhostFieldDescription>
|
|
19
|
+
<GhostFieldControl v-slot="field">
|
|
20
|
+
<GhostTagsInput
|
|
21
|
+
v-bind="field"
|
|
22
|
+
:default-value="initial"
|
|
23
|
+
:delimiters="[',']"
|
|
24
|
+
>
|
|
25
|
+
<template #tag="{ value }"
|
|
26
|
+
><strong>{{ value }}</strong></template
|
|
27
|
+
>
|
|
28
|
+
</GhostTagsInput>
|
|
29
|
+
</GhostFieldControl>
|
|
30
|
+
</GhostField>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
GhostButton,
|
|
6
|
+
GhostField,
|
|
7
|
+
GhostFieldControl,
|
|
8
|
+
GhostFieldDescription,
|
|
9
|
+
GhostFieldLabel,
|
|
10
|
+
GhostTagsInput,
|
|
11
|
+
} from '@ghostvue/themes'
|
|
12
|
+
|
|
13
|
+
const initialLabels = ['frontend']
|
|
14
|
+
const labels = ref<string[]>([...initialLabels])
|
|
15
|
+
const saved = ref<string[] | null>(null)
|
|
16
|
+
|
|
17
|
+
function save(event: SubmitEvent): void {
|
|
18
|
+
if (!(event.target instanceof HTMLFormElement)) return
|
|
19
|
+
saved.value = new FormData(event.target).getAll('labels').map(String)
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<form class="project-labels" @submit.prevent="save">
|
|
25
|
+
<GhostField required>
|
|
26
|
+
<GhostFieldLabel>Project labels</GhostFieldLabel>
|
|
27
|
+
<GhostFieldDescription>
|
|
28
|
+
Press Enter to add a label. Press Backspace on the empty entry to focus
|
|
29
|
+
the last label's remove button.
|
|
30
|
+
</GhostFieldDescription>
|
|
31
|
+
<GhostFieldControl v-slot="field">
|
|
32
|
+
<GhostTagsInput
|
|
33
|
+
v-bind="field"
|
|
34
|
+
v-model="labels"
|
|
35
|
+
:default-value="initialLabels"
|
|
36
|
+
name="labels"
|
|
37
|
+
placeholder="Add a label"
|
|
38
|
+
/>
|
|
39
|
+
</GhostFieldControl>
|
|
40
|
+
</GhostField>
|
|
41
|
+
<div class="project-label-actions">
|
|
42
|
+
<GhostButton type="submit">Save project</GhostButton>
|
|
43
|
+
<GhostButton type="reset">Reset labels</GhostButton>
|
|
44
|
+
</div>
|
|
45
|
+
<p v-if="saved">Saved labels: {{ saved.join(', ') }}</p>
|
|
46
|
+
</form>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style scoped>
|
|
50
|
+
.project-labels,
|
|
51
|
+
.project-label-actions {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: var(--ghost-space-gap-sm);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.project-labels {
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
inline-size: min(100%, 28rem);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.project-label-actions {
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useId } from 'vue'
|
|
3
|
+
import { GhostTagsInput } from '@ghostvue/themes'
|
|
4
|
+
|
|
5
|
+
const id = useId()
|
|
6
|
+
const labels: readonly string[] = ['frontend', 'triage']
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<label :for="id">Imported labels</label>
|
|
11
|
+
<GhostTagsInput :id="id" :model-value="labels" readonly name="labels" />
|
|
12
|
+
</template>
|
|
@@ -21,24 +21,55 @@ const ToastApi = defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// One id for one piece of state: every sync attempt updates this toast
|
|
25
|
+
// instead of stacking a new one.
|
|
26
|
+
const SYNC_TOAST_ID = 'sync-status'
|
|
27
|
+
// Failed attempts for the current sync. Sync files resets it to the first.
|
|
28
|
+
let failedAttempts = 0
|
|
29
|
+
|
|
30
|
+
// Ordinary success: an informational toast. It is announced politely and
|
|
31
|
+
// dismisses itself after the provider's 8 seconds (paused on hover and focus).
|
|
32
|
+
function saveDraft({ toast }: UseGhostToastReturn) {
|
|
27
33
|
toast({
|
|
28
|
-
|
|
34
|
+
title: 'Draft saved',
|
|
35
|
+
description: 'Your changes are stored in this workspace.',
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Persistent error: type 'error' and an action both keep the toast until the
|
|
40
|
+
// user dismisses it, and the themed toast picks the danger tone.
|
|
41
|
+
function syncFiles(api: UseGhostToastReturn) {
|
|
42
|
+
failedAttempts = 1
|
|
43
|
+
const failure = {
|
|
29
44
|
type: 'error',
|
|
30
45
|
title: 'Sync failed',
|
|
31
46
|
description: 'Three files could not be uploaded.',
|
|
32
47
|
action: {
|
|
33
48
|
label: 'Retry',
|
|
34
49
|
onClick: () => {
|
|
35
|
-
|
|
36
|
-
title: 'Still failing',
|
|
37
|
-
description: 'Retried once. Check your connection and try again.',
|
|
38
|
-
announceUpdate: true,
|
|
39
|
-
})
|
|
50
|
+
retrySync(api)
|
|
40
51
|
},
|
|
41
52
|
},
|
|
53
|
+
} as const
|
|
54
|
+
// Pressing Sync files while the toast is still visible resets it from
|
|
55
|
+
// "Still failing" back to "Sync failed". toast() with a reused id would
|
|
56
|
+
// merge silently, so update() with announceUpdate reads the change out.
|
|
57
|
+
if (api.toasts.value.some((record) => record.id === SYNC_TOAST_ID)) {
|
|
58
|
+
api.update(SYNC_TOAST_ID, { ...failure, announceUpdate: true })
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
api.toast({ id: SYNC_TOAST_ID, ...failure })
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Retry: this sample stays offline, so each retry updates the same toast in
|
|
65
|
+
// place. It keeps its position and the focused Retry button, does not replay
|
|
66
|
+
// the enter animation, and announceUpdate reads the new text once.
|
|
67
|
+
function retrySync({ update }: UseGhostToastReturn) {
|
|
68
|
+
failedAttempts += 1
|
|
69
|
+
update(SYNC_TOAST_ID, {
|
|
70
|
+
title: 'Still failing',
|
|
71
|
+
description: `Attempt ${String(failedAttempts)} failed. Check your connection and try again.`,
|
|
72
|
+
announceUpdate: true,
|
|
42
73
|
})
|
|
43
74
|
}
|
|
44
75
|
</script>
|
|
@@ -47,18 +78,10 @@ function syncFailed({ toast, update }: UseGhostToastReturn) {
|
|
|
47
78
|
<GhostToastProvider>
|
|
48
79
|
<ToastApi v-slot="api">
|
|
49
80
|
<div class="toast-themed-example">
|
|
50
|
-
<GhostButton
|
|
51
|
-
variant="outline"
|
|
52
|
-
@click="
|
|
53
|
-
api.toast({
|
|
54
|
-
title: 'Draft saved',
|
|
55
|
-
description: 'Your changes are stored in this workspace.',
|
|
56
|
-
})
|
|
57
|
-
"
|
|
58
|
-
>
|
|
81
|
+
<GhostButton variant="outline" @click="saveDraft(api)">
|
|
59
82
|
Save draft
|
|
60
83
|
</GhostButton>
|
|
61
|
-
<GhostButton tone="danger" variant="soft" @click="
|
|
84
|
+
<GhostButton tone="danger" variant="soft" @click="syncFiles(api)">
|
|
62
85
|
Sync files
|
|
63
86
|
</GhostButton>
|
|
64
87
|
</div>
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
2
4
|
import { GhostButton, GhostSeparator, GhostToolbar } from '@ghostvue/themes'
|
|
5
|
+
|
|
6
|
+
const action = ref('No annotation added')
|
|
3
7
|
</script>
|
|
4
8
|
|
|
5
9
|
<template>
|
|
6
10
|
<div class="toolbar-themed-example">
|
|
7
|
-
<GhostToolbar label="
|
|
8
|
-
<GhostButton size="sm"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
<GhostToolbar label="Annotation tools" orientation="vertical">
|
|
12
|
+
<GhostButton size="sm" @click="action = 'Added a text annotation'">
|
|
13
|
+
Text
|
|
14
|
+
</GhostButton>
|
|
15
|
+
<GhostButton size="sm" @click="action = 'Added a highlight'">
|
|
16
|
+
Highlight
|
|
17
|
+
</GhostButton>
|
|
18
|
+
<GhostSeparator orientation="horizontal" :decorative="false" />
|
|
19
|
+
<GhostButton
|
|
20
|
+
size="sm"
|
|
21
|
+
variant="outline"
|
|
22
|
+
@click="action = 'No annotation added'"
|
|
23
|
+
>
|
|
24
|
+
Clear
|
|
25
|
+
</GhostButton>
|
|
11
26
|
</GhostToolbar>
|
|
27
|
+
<p role="status">{{ action }}</p>
|
|
12
28
|
</div>
|
|
13
29
|
</template>
|
|
14
30
|
|
|
15
31
|
<style scoped>
|
|
16
32
|
.toolbar-themed-example {
|
|
17
33
|
display: grid;
|
|
34
|
+
justify-items: start;
|
|
35
|
+
gap: var(--ghost-space-gap-sm);
|
|
18
36
|
}
|
|
19
37
|
</style>
|
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
GhostTooltipTrigger,
|
|
12
12
|
} from '@ghostvue/themes'
|
|
13
13
|
|
|
14
|
-
const statusMessage = ref(
|
|
14
|
+
const statusMessage = ref(
|
|
15
|
+
'Hover or Tab to a control for details. Press Escape to hide a tip.',
|
|
16
|
+
)
|
|
15
17
|
|
|
16
18
|
function triggerAction(message: string): void {
|
|
17
19
|
statusMessage.value = message
|
|
@@ -27,6 +29,15 @@ function triggerAction(message: string): void {
|
|
|
27
29
|
<GhostBadge tone="accent" variant="soft">Healthy</GhostBadge>
|
|
28
30
|
</div>
|
|
29
31
|
|
|
32
|
+
<!--
|
|
33
|
+
GhostTooltipProvider renders nothing and has no theme of its own, so
|
|
34
|
+
it ships from @ghostvue/vue only. It gives both actions a 300 ms
|
|
35
|
+
open delay. A pointer that moves to the other action while a tip is
|
|
36
|
+
open, or within 250 ms of it closing, opens the next tip at once
|
|
37
|
+
and hides the previous one, so only one tip shows at a time.
|
|
38
|
+
Keyboard focus always waits the full delay. Tooltips outside a
|
|
39
|
+
provider, like the metric help below, wait 700 ms.
|
|
40
|
+
-->
|
|
30
41
|
<GhostTooltipProvider :delay-duration="300" :skip-delay-duration="250">
|
|
31
42
|
<div class="deploy-metrics__actions">
|
|
32
43
|
<GhostTooltip>
|
|
@@ -2,36 +2,59 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
+
GhostButton,
|
|
5
6
|
GhostCard,
|
|
6
7
|
GhostTree,
|
|
7
8
|
GhostTreeGroup,
|
|
8
9
|
GhostTreeItem,
|
|
9
10
|
GhostTreeTrigger,
|
|
11
|
+
type GhostTreeDirection,
|
|
10
12
|
type GhostTreeValue,
|
|
11
13
|
} from '@ghostvue/themes'
|
|
12
14
|
|
|
13
15
|
const selected = ref<GhostTreeValue>('components/tree')
|
|
16
|
+
const direction = ref<GhostTreeDirection>('ltr')
|
|
14
17
|
</script>
|
|
15
18
|
|
|
16
19
|
<template>
|
|
17
|
-
<GhostCard class="explorer-card">
|
|
20
|
+
<GhostCard class="explorer-card" :dir="direction">
|
|
18
21
|
<template #header>
|
|
19
|
-
<
|
|
22
|
+
<div class="explorer-card__header">
|
|
23
|
+
<span class="explorer-card__title">Workspace explorer</span>
|
|
24
|
+
<GhostButton
|
|
25
|
+
type="button"
|
|
26
|
+
variant="ghost"
|
|
27
|
+
size="sm"
|
|
28
|
+
:aria-pressed="direction === 'rtl'"
|
|
29
|
+
@click="direction = direction === 'ltr' ? 'rtl' : 'ltr'"
|
|
30
|
+
>
|
|
31
|
+
Right-to-left
|
|
32
|
+
</GhostButton>
|
|
33
|
+
</div>
|
|
20
34
|
</template>
|
|
21
35
|
|
|
22
36
|
<GhostTree
|
|
23
37
|
v-model="selected"
|
|
24
38
|
class="themed-tree"
|
|
25
39
|
aria-label="Library"
|
|
40
|
+
:dir="direction"
|
|
41
|
+
:expand-on-click="false"
|
|
26
42
|
:default-expanded="['components']"
|
|
27
43
|
>
|
|
28
44
|
<GhostTreeItem value="components">
|
|
29
45
|
<template #default="{ expanded }">
|
|
30
|
-
<GhostTreeTrigger>
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
<GhostTreeTrigger action="select">
|
|
47
|
+
<!-- The inner disclosure stops its click before it reaches the select trigger. -->
|
|
48
|
+
<GhostTreeTrigger
|
|
49
|
+
class="folder-toggle"
|
|
50
|
+
action="toggle"
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
data-testid="components-chevron"
|
|
53
|
+
@click.stop
|
|
33
54
|
>
|
|
34
|
-
|
|
55
|
+
<span class="chevron" :data-open="expanded">›</span>
|
|
56
|
+
</GhostTreeTrigger>
|
|
57
|
+
<span>Components</span>
|
|
35
58
|
</GhostTreeTrigger>
|
|
36
59
|
<GhostTreeGroup>
|
|
37
60
|
<GhostTreeItem value="components/button">
|
|
@@ -48,14 +71,16 @@ const selected = ref<GhostTreeValue>('components/tree')
|
|
|
48
71
|
</GhostTreeItem>
|
|
49
72
|
<GhostTreeItem value="components/forms">
|
|
50
73
|
<template #default="{ expanded: formsExpanded }">
|
|
51
|
-
<GhostTreeTrigger>
|
|
52
|
-
<
|
|
53
|
-
class="
|
|
74
|
+
<GhostTreeTrigger action="select">
|
|
75
|
+
<GhostTreeTrigger
|
|
76
|
+
class="folder-toggle"
|
|
77
|
+
action="toggle"
|
|
54
78
|
aria-hidden="true"
|
|
55
|
-
|
|
56
|
-
>›</span
|
|
79
|
+
@click.stop
|
|
57
80
|
>
|
|
58
|
-
|
|
81
|
+
<span class="chevron" :data-open="formsExpanded">›</span>
|
|
82
|
+
</GhostTreeTrigger>
|
|
83
|
+
<span>Forms</span>
|
|
59
84
|
</GhostTreeTrigger>
|
|
60
85
|
<GhostTreeGroup>
|
|
61
86
|
<GhostTreeItem value="components/forms/input">
|
|
@@ -70,6 +95,16 @@ const selected = ref<GhostTreeValue>('components/tree')
|
|
|
70
95
|
Select (beta)
|
|
71
96
|
</GhostTreeTrigger>
|
|
72
97
|
</GhostTreeItem>
|
|
98
|
+
<GhostTreeItem
|
|
99
|
+
value="components/forms/accessibility-checklist"
|
|
100
|
+
>
|
|
101
|
+
<GhostTreeTrigger>
|
|
102
|
+
<span class="chevron-spacer" aria-hidden="true"></span>
|
|
103
|
+
<span class="filename"
|
|
104
|
+
>Design system accessibility review checklist.md</span
|
|
105
|
+
>
|
|
106
|
+
</GhostTreeTrigger>
|
|
107
|
+
</GhostTreeItem>
|
|
73
108
|
</GhostTreeGroup>
|
|
74
109
|
</template>
|
|
75
110
|
</GhostTreeItem>
|
|
@@ -98,6 +133,14 @@ const selected = ref<GhostTreeValue>('components/tree')
|
|
|
98
133
|
max-inline-size: 22rem;
|
|
99
134
|
}
|
|
100
135
|
|
|
136
|
+
.explorer-card__header {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
flex-wrap: wrap;
|
|
141
|
+
gap: var(--ghost-space-gap-xs);
|
|
142
|
+
}
|
|
143
|
+
|
|
101
144
|
.explorer-card__title {
|
|
102
145
|
color: var(--ghost-surface-fg);
|
|
103
146
|
font-size: var(--ghost-type-size-md);
|
|
@@ -113,18 +156,28 @@ const selected = ref<GhostTreeValue>('components/tree')
|
|
|
113
156
|
inline-size: 100%;
|
|
114
157
|
}
|
|
115
158
|
|
|
116
|
-
.
|
|
159
|
+
.folder-toggle,
|
|
117
160
|
.chevron-spacer {
|
|
118
|
-
|
|
119
|
-
inline-size:
|
|
120
|
-
|
|
161
|
+
flex: none;
|
|
162
|
+
inline-size: 1.5rem;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.folder-toggle {
|
|
166
|
+
justify-content: center;
|
|
167
|
+
min-block-size: 1.5rem;
|
|
168
|
+
padding: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.filename {
|
|
172
|
+
min-inline-size: 0;
|
|
173
|
+
overflow-wrap: anywhere;
|
|
121
174
|
}
|
|
122
175
|
|
|
123
176
|
.chevron[data-open='true'] {
|
|
124
177
|
rotate: 90deg;
|
|
125
178
|
}
|
|
126
179
|
|
|
127
|
-
[dir='rtl'] .chevron:not([data-open='true']) {
|
|
180
|
+
.themed-tree[data-dir='rtl'] .chevron:not([data-open='true']) {
|
|
128
181
|
scale: -1 1;
|
|
129
182
|
}
|
|
130
183
|
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"source": "handwritten",
|
|
4
|
+
"name": "GhostCheckboxGroup",
|
|
5
|
+
"package": "@ghostvue/themes",
|
|
6
|
+
"status": "experimental",
|
|
7
|
+
"description": "Themed wrapper around headless GhostCheckboxGroup with fieldset reset and vertical stack spacing. Adds no visual props or per-component tokens.",
|
|
8
|
+
"props": [],
|
|
9
|
+
"models": [],
|
|
10
|
+
"events": [],
|
|
11
|
+
"slots": [
|
|
12
|
+
{
|
|
13
|
+
"name": "default",
|
|
14
|
+
"props": [],
|
|
15
|
+
"description": "Member checkboxes, labels, legend, descriptions, and non-member content."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"exposed": [
|
|
19
|
+
{
|
|
20
|
+
"name": "blur",
|
|
21
|
+
"kind": "method",
|
|
22
|
+
"type": "() => void",
|
|
23
|
+
"description": "Blurs the active member if it is inside the group. Delegates to the unstyled GhostCheckboxGroup."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "element",
|
|
27
|
+
"kind": "property",
|
|
28
|
+
"type": "HTMLElement | null",
|
|
29
|
+
"description": "The group root element after mount; null before mount. Delegates to the unstyled GhostCheckboxGroup."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "focus",
|
|
33
|
+
"kind": "method",
|
|
34
|
+
"type": "(options?: FocusOptions) => void",
|
|
35
|
+
"description": "Focuses the first enabled checked member in DOM order, else the first enabled member. Delegates to the unstyled GhostCheckboxGroup."
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"styling": {
|
|
39
|
+
"parts": [
|
|
40
|
+
{
|
|
41
|
+
"name": "root",
|
|
42
|
+
"description": "The group fieldset or host inside the display:contents themed scope."
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"states": [
|
|
46
|
+
{
|
|
47
|
+
"name": "invalid",
|
|
48
|
+
"description": "Group-level error state."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "disabled",
|
|
52
|
+
"description": "Whole group disabled."
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"cssProperties": [
|
|
56
|
+
{
|
|
57
|
+
"name": "--ghost-space-stack-sm",
|
|
58
|
+
"description": "Vertical stack gap between group children and space below the direct legend."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "--ghost-text-default",
|
|
62
|
+
"description": "Direct legend text color."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "--ghost-type-size-md",
|
|
66
|
+
"description": "Direct legend font size."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "--ghost-type-weight-semibold",
|
|
70
|
+
"description": "Direct legend font weight."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "--ghost-type-line-tight",
|
|
74
|
+
"description": "Direct legend line height."
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"accessibility": {
|
|
79
|
+
"role": "group",
|
|
80
|
+
"apgPattern": "https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/",
|
|
81
|
+
"keyboard": {},
|
|
82
|
+
"requiredAriaAttributes": []
|
|
83
|
+
},
|
|
84
|
+
"examples": [
|
|
85
|
+
"checkbox-group/notification-preferences",
|
|
86
|
+
"checkbox-group/basic",
|
|
87
|
+
"checkbox-group/form",
|
|
88
|
+
"checkbox-group/field"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
@@ -79,6 +79,14 @@
|
|
|
79
79
|
{
|
|
80
80
|
"name": "separator",
|
|
81
81
|
"description": "Divider rendered by GhostDropdownMenuSeparator."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "sub-trigger",
|
|
85
|
+
"description": "Themed submenu trigger."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "sub-content",
|
|
89
|
+
"description": "Themed child menu surface."
|
|
82
90
|
}
|
|
83
91
|
],
|
|
84
92
|
"states": [
|
|
@@ -125,6 +133,7 @@
|
|
|
125
133
|
]
|
|
126
134
|
},
|
|
127
135
|
"examples": [
|
|
136
|
+
"dropdown-menu/nested-export",
|
|
128
137
|
"dropdown-menu/record-actions",
|
|
129
138
|
"dropdown-menu/themed"
|
|
130
139
|
]
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
"description": "Optional control id override.",
|
|
14
14
|
"deprecated": false
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"name": "name",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"required": false,
|
|
20
|
+
"description": "Canonical dot-path key associating this field with an ancestor GhostForm.",
|
|
21
|
+
"deprecated": false
|
|
22
|
+
},
|
|
16
23
|
{
|
|
17
24
|
"name": "disabled",
|
|
18
25
|
"type": "boolean",
|
|
@@ -24,9 +31,8 @@
|
|
|
24
31
|
{
|
|
25
32
|
"name": "invalid",
|
|
26
33
|
"type": "boolean",
|
|
27
|
-
"default": false,
|
|
28
34
|
"required": false,
|
|
29
|
-
"description": "Propagates invalid semantics.",
|
|
35
|
+
"description": "Propagates invalid semantics; overrides ancestor form state when explicitly set.",
|
|
30
36
|
"deprecated": false
|
|
31
37
|
},
|
|
32
38
|
{
|
|
@@ -93,7 +99,9 @@
|
|
|
93
99
|
"requiredAriaAttributes": []
|
|
94
100
|
},
|
|
95
101
|
"examples": [
|
|
102
|
+
"field/billing-address",
|
|
96
103
|
"field/profile-settings",
|
|
104
|
+
"field/checkbox",
|
|
97
105
|
"field/themed"
|
|
98
106
|
]
|
|
99
107
|
}
|