@cohesivesystems/presentation-react-shadcn 0.1.0-alpha.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/LICENSE +55 -0
- package/dist/document-workspace-surface-slot-renderers.d.ts +58 -0
- package/dist/document-workspace-surface-slot-renderers.d.ts.map +1 -0
- package/dist/document-workspace-surface-slot-renderers.js +206 -0
- package/dist/document-workspace-surface-slot-renderers.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts +8 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.js +2 -0
- package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts +9 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.js +2 -0
- package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
- package/dist/page-host-unavailable-renderer.d.ts +10 -0
- package/dist/page-host-unavailable-renderer.d.ts.map +1 -0
- package/dist/page-host-unavailable-renderer.js +27 -0
- package/dist/page-host-unavailable-renderer.js.map +1 -0
- package/dist/presentation-action-group.d.ts +99 -0
- package/dist/presentation-action-group.d.ts.map +1 -0
- package/dist/presentation-action-group.js +214 -0
- package/dist/presentation-action-group.js.map +1 -0
- package/dist/presentation-badge-target-interpreter.d.ts +26 -0
- package/dist/presentation-badge-target-interpreter.d.ts.map +1 -0
- package/dist/presentation-badge-target-interpreter.js +17 -0
- package/dist/presentation-badge-target-interpreter.js.map +1 -0
- package/dist/presentation-component-groups.d.ts +968 -0
- package/dist/presentation-component-groups.d.ts.map +1 -0
- package/dist/presentation-component-groups.js +505 -0
- package/dist/presentation-component-groups.js.map +1 -0
- package/dist/presentation-component-system-diagnostics.d.ts +27 -0
- package/dist/presentation-component-system-diagnostics.d.ts.map +1 -0
- package/dist/presentation-component-system-diagnostics.js +399 -0
- package/dist/presentation-component-system-diagnostics.js.map +1 -0
- package/dist/presentation-component-system.d.ts +31 -0
- package/dist/presentation-component-system.d.ts.map +1 -0
- package/dist/presentation-component-system.js +61 -0
- package/dist/presentation-component-system.js.map +1 -0
- package/dist/presentation-icon-diagnostics.d.ts +12 -0
- package/dist/presentation-icon-diagnostics.d.ts.map +1 -0
- package/dist/presentation-icon-diagnostics.js +17 -0
- package/dist/presentation-icon-diagnostics.js.map +1 -0
- package/dist/presentation-icon-registry.d.ts +28 -0
- package/dist/presentation-icon-registry.d.ts.map +1 -0
- package/dist/presentation-icon-registry.js +80 -0
- package/dist/presentation-icon-registry.js.map +1 -0
- package/dist/presentation-projection-trace-panel.d.ts +10 -0
- package/dist/presentation-projection-trace-panel.d.ts.map +1 -0
- package/dist/presentation-projection-trace-panel.js +48 -0
- package/dist/presentation-projection-trace-panel.js.map +1 -0
- package/dist/presentation-routed-surface-host.d.ts +19 -0
- package/dist/presentation-routed-surface-host.d.ts.map +1 -0
- package/dist/presentation-routed-surface-host.js +12 -0
- package/dist/presentation-routed-surface-host.js.map +1 -0
- package/dist/presentation-shadcn-component-system.d.ts +22 -0
- package/dist/presentation-shadcn-component-system.d.ts.map +1 -0
- package/dist/presentation-shadcn-component-system.js +2 -0
- package/dist/presentation-shadcn-component-system.js.map +1 -0
- package/dist/presentation-standard-renderers.d.ts +168 -0
- package/dist/presentation-standard-renderers.d.ts.map +1 -0
- package/dist/presentation-standard-renderers.js +440 -0
- package/dist/presentation-standard-renderers.js.map +1 -0
- package/dist/presentation-surface-renderer.d.ts +23 -0
- package/dist/presentation-surface-renderer.d.ts.map +1 -0
- package/dist/presentation-surface-renderer.js +119 -0
- package/dist/presentation-surface-renderer.js.map +1 -0
- package/dist/presentation-value-renderers.d.ts +10 -0
- package/dist/presentation-value-renderers.d.ts.map +1 -0
- package/dist/presentation-value-renderers.js +14 -0
- package/dist/presentation-value-renderers.js.map +1 -0
- package/dist/process-task-icons.d.ts +49 -0
- package/dist/process-task-icons.d.ts.map +1 -0
- package/dist/process-task-icons.js +154 -0
- package/dist/process-task-icons.js.map +1 -0
- package/dist/projected-activity-state.d.ts +17 -0
- package/dist/projected-activity-state.d.ts.map +1 -0
- package/dist/projected-activity-state.js +22 -0
- package/dist/projected-activity-state.js.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts +4 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.js +9 -0
- package/dist/projected-collection-action-runtime-diagnostics.js.map +1 -0
- package/dist/projected-collection-view.d.ts +90 -0
- package/dist/projected-collection-view.d.ts.map +1 -0
- package/dist/projected-collection-view.js +532 -0
- package/dist/projected-collection-view.js.map +1 -0
- package/dist/projected-document-action-status-notices.d.ts +15 -0
- package/dist/projected-document-action-status-notices.d.ts.map +1 -0
- package/dist/projected-document-action-status-notices.js +33 -0
- package/dist/projected-document-action-status-notices.js.map +1 -0
- package/dist/projected-document-badges.d.ts +24 -0
- package/dist/projected-document-badges.d.ts.map +1 -0
- package/dist/projected-document-badges.js +53 -0
- package/dist/projected-document-badges.js.map +1 -0
- package/dist/projected-document-editor-surface.d.ts +46 -0
- package/dist/projected-document-editor-surface.d.ts.map +1 -0
- package/dist/projected-document-editor-surface.js +399 -0
- package/dist/projected-document-editor-surface.js.map +1 -0
- package/dist/projected-document-workspace-notices.d.ts +24 -0
- package/dist/projected-document-workspace-notices.d.ts.map +1 -0
- package/dist/projected-document-workspace-notices.js +14 -0
- package/dist/projected-document-workspace-notices.js.map +1 -0
- package/dist/projected-document-workspace-prompt-child-view-registry.d.ts +25 -0
- package/dist/projected-document-workspace-prompt-child-view-registry.d.ts.map +1 -0
- package/dist/projected-document-workspace-prompt-child-view-registry.js +41 -0
- package/dist/projected-document-workspace-prompt-child-view-registry.js.map +1 -0
- package/dist/projected-document-workspace-prompt-child-view-renderers.d.ts +32 -0
- package/dist/projected-document-workspace-prompt-child-view-renderers.d.ts.map +1 -0
- package/dist/projected-document-workspace-prompt-child-view-renderers.js +77 -0
- package/dist/projected-document-workspace-prompt-child-view-renderers.js.map +1 -0
- package/dist/projected-document-workspace-shell.d.ts +100 -0
- package/dist/projected-document-workspace-shell.d.ts.map +1 -0
- package/dist/projected-document-workspace-shell.js +153 -0
- package/dist/projected-document-workspace-shell.js.map +1 -0
- package/dist/projected-document-workspace.d.ts +39 -0
- package/dist/projected-document-workspace.d.ts.map +1 -0
- package/dist/projected-document-workspace.js +63 -0
- package/dist/projected-document-workspace.js.map +1 -0
- package/dist/projected-field-value-rendering.d.ts +94 -0
- package/dist/projected-field-value-rendering.d.ts.map +1 -0
- package/dist/projected-field-value-rendering.js +377 -0
- package/dist/projected-field-value-rendering.js.map +1 -0
- package/dist/projected-inline-list.d.ts +20 -0
- package/dist/projected-inline-list.d.ts.map +1 -0
- package/dist/projected-inline-list.js +149 -0
- package/dist/projected-inline-list.js.map +1 -0
- package/dist/projected-input-form.d.ts +143 -0
- package/dist/projected-input-form.d.ts.map +1 -0
- package/dist/projected-input-form.js +612 -0
- package/dist/projected-input-form.js.map +1 -0
- package/dist/projected-metric-dashboard.d.ts +26 -0
- package/dist/projected-metric-dashboard.d.ts.map +1 -0
- package/dist/projected-metric-dashboard.js +20 -0
- package/dist/projected-metric-dashboard.js.map +1 -0
- package/dist/projected-metric-strip.d.ts +20 -0
- package/dist/projected-metric-strip.d.ts.map +1 -0
- package/dist/projected-metric-strip.js +131 -0
- package/dist/projected-metric-strip.js.map +1 -0
- package/dist/projected-navigation-shell-view-host.d.ts +34 -0
- package/dist/projected-navigation-shell-view-host.d.ts.map +1 -0
- package/dist/projected-navigation-shell-view-host.js +75 -0
- package/dist/projected-navigation-shell-view-host.js.map +1 -0
- package/dist/projected-navigation-shell.d.ts +33 -0
- package/dist/projected-navigation-shell.d.ts.map +1 -0
- package/dist/projected-navigation-shell.js +112 -0
- package/dist/projected-navigation-shell.js.map +1 -0
- package/dist/projected-presentation-badges.d.ts +34 -0
- package/dist/projected-presentation-badges.d.ts.map +1 -0
- package/dist/projected-presentation-badges.js +22 -0
- package/dist/projected-presentation-badges.js.map +1 -0
- package/dist/projected-presentation-diagnostics.d.ts +10 -0
- package/dist/projected-presentation-diagnostics.d.ts.map +1 -0
- package/dist/projected-presentation-diagnostics.js +40 -0
- package/dist/projected-presentation-diagnostics.js.map +1 -0
- package/dist/projected-presentation-flow-layer.d.ts +33 -0
- package/dist/projected-presentation-flow-layer.d.ts.map +1 -0
- package/dist/projected-presentation-flow-layer.js +71 -0
- package/dist/projected-presentation-flow-layer.js.map +1 -0
- package/dist/projected-process-task-notices.d.ts +37 -0
- package/dist/projected-process-task-notices.d.ts.map +1 -0
- package/dist/projected-process-task-notices.js +225 -0
- package/dist/projected-process-task-notices.js.map +1 -0
- package/dist/projected-prompt-child-view-renderer.d.ts +101 -0
- package/dist/projected-prompt-child-view-renderer.d.ts.map +1 -0
- package/dist/projected-prompt-child-view-renderer.js +442 -0
- package/dist/projected-prompt-child-view-renderer.js.map +1 -0
- package/dist/projected-prompt-document-preview.d.ts +39 -0
- package/dist/projected-prompt-document-preview.d.ts.map +1 -0
- package/dist/projected-prompt-document-preview.js +50 -0
- package/dist/projected-prompt-document-preview.js.map +1 -0
- package/dist/projected-prompt-view.d.ts +35 -0
- package/dist/projected-prompt-view.d.ts.map +1 -0
- package/dist/projected-prompt-view.js +292 -0
- package/dist/projected-prompt-view.js.map +1 -0
- package/dist/projected-query-form.d.ts +56 -0
- package/dist/projected-query-form.d.ts.map +1 -0
- package/dist/projected-query-form.js +100 -0
- package/dist/projected-query-form.js.map +1 -0
- package/dist/projected-record-details.d.ts +20 -0
- package/dist/projected-record-details.d.ts.map +1 -0
- package/dist/projected-record-details.js +60 -0
- package/dist/projected-record-details.js.map +1 -0
- package/dist/projected-routed-surface-runtime.d.ts +86 -0
- package/dist/projected-routed-surface-runtime.d.ts.map +1 -0
- package/dist/projected-routed-surface-runtime.js +332 -0
- package/dist/projected-routed-surface-runtime.js.map +1 -0
- package/dist/projected-tabs-view.d.ts +21 -0
- package/dist/projected-tabs-view.d.ts.map +1 -0
- package/dist/projected-tabs-view.js +140 -0
- package/dist/projected-tabs-view.js.map +1 -0
- package/dist/projected-view-chrome.d.ts +15 -0
- package/dist/projected-view-chrome.d.ts.map +1 -0
- package/dist/projected-view-chrome.js +67 -0
- package/dist/projected-view-chrome.js.map +1 -0
- package/dist/projected-view-surface.d.ts +34 -0
- package/dist/projected-view-surface.d.ts.map +1 -0
- package/dist/projected-view-surface.js +40 -0
- package/dist/projected-view-surface.js.map +1 -0
- package/dist/standard-collection-chrome-slot-renderers.d.ts +26 -0
- package/dist/standard-collection-chrome-slot-renderers.d.ts.map +1 -0
- package/dist/standard-collection-chrome-slot-renderers.js +250 -0
- package/dist/standard-collection-chrome-slot-renderers.js.map +1 -0
- package/dist/standard-view-chrome-slot-renderers.d.ts +57 -0
- package/dist/standard-view-chrome-slot-renderers.d.ts.map +1 -0
- package/dist/standard-view-chrome-slot-renderers.js +614 -0
- package/dist/standard-view-chrome-slot-renderers.js.map +1 -0
- package/package.json +68 -0
- package/src/document-workspace-surface-slot-renderers.tsx +395 -0
- package/src/index.ts +53 -0
- package/src/navigation-shell-frame-renderer-registry.ts +29 -0
- package/src/navigation-shell-slot-renderer-registry.ts +46 -0
- package/src/page-host-unavailable-renderer.tsx +79 -0
- package/src/presentation-action-group.tsx +475 -0
- package/src/presentation-badge-target-interpreter.ts +54 -0
- package/src/presentation-component-groups.ts +2505 -0
- package/src/presentation-component-system-diagnostics.ts +848 -0
- package/src/presentation-component-system.ts +365 -0
- package/src/presentation-icon-diagnostics.ts +53 -0
- package/src/presentation-icon-registry.tsx +181 -0
- package/src/presentation-projection-trace-panel.tsx +140 -0
- package/src/presentation-routed-surface-host.tsx +48 -0
- package/src/presentation-shadcn-component-system.ts +102 -0
- package/src/presentation-standard-renderers.tsx +1290 -0
- package/src/presentation-surface-renderer.tsx +263 -0
- package/src/presentation-value-renderers.tsx +40 -0
- package/src/process-task-icons.tsx +258 -0
- package/src/projected-activity-state.tsx +63 -0
- package/src/projected-collection-action-runtime-diagnostics.ts +22 -0
- package/src/projected-collection-view.tsx +1273 -0
- package/src/projected-document-action-status-notices.tsx +66 -0
- package/src/projected-document-badges.tsx +134 -0
- package/src/projected-document-editor-surface.tsx +808 -0
- package/src/projected-document-workspace-notices.tsx +77 -0
- package/src/projected-document-workspace-prompt-child-view-registry.ts +99 -0
- package/src/projected-document-workspace-prompt-child-view-renderers.tsx +205 -0
- package/src/projected-document-workspace-shell.tsx +427 -0
- package/src/projected-document-workspace.tsx +216 -0
- package/src/projected-field-value-rendering.tsx +704 -0
- package/src/projected-inline-list.tsx +434 -0
- package/src/projected-input-form.tsx +1218 -0
- package/src/projected-metric-dashboard.tsx +106 -0
- package/src/projected-metric-strip.tsx +244 -0
- package/src/projected-navigation-shell-view-host.tsx +177 -0
- package/src/projected-navigation-shell.tsx +219 -0
- package/src/projected-presentation-badges.tsx +95 -0
- package/src/projected-presentation-diagnostics.tsx +120 -0
- package/src/projected-presentation-flow-layer.tsx +186 -0
- package/src/projected-process-task-notices.tsx +501 -0
- package/src/projected-prompt-child-view-renderer.tsx +698 -0
- package/src/projected-prompt-document-preview.tsx +197 -0
- package/src/projected-prompt-view.tsx +592 -0
- package/src/projected-query-form.tsx +286 -0
- package/src/projected-record-details.tsx +133 -0
- package/src/projected-routed-surface-runtime.tsx +713 -0
- package/src/projected-tabs-view.tsx +308 -0
- package/src/projected-view-chrome.tsx +148 -0
- package/src/projected-view-surface.tsx +131 -0
- package/src/standard-collection-chrome-slot-renderers.tsx +391 -0
- package/src/standard-view-chrome-slot-renderers.tsx +1064 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getErrorMessage,
|
|
3
|
+
type DocumentProfileProjection,
|
|
4
|
+
type ProjectedDocumentActionStatus,
|
|
5
|
+
type ProjectedDocumentActionStatusMap,
|
|
6
|
+
resolvePresentationContent,
|
|
7
|
+
} from '@cohesivesystems/presentation-core'
|
|
8
|
+
import { documentActionStatusNoticeKinds } from '@cohesivesystems/presentation-contracts'
|
|
9
|
+
import { ProjectedStatusBlock } from './projected-activity-state'
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
ProjectedDocumentActionStatus,
|
|
13
|
+
ProjectedDocumentActionStatusMap,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ProjectedDocumentActionStatusNoticesProps {
|
|
17
|
+
readonly actionStatuses: ProjectedDocumentActionStatusMap
|
|
18
|
+
readonly profile: Pick<DocumentProfileProjection, 'ActionStatusNotices'> | null
|
|
19
|
+
readonly region?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Projects document-profile action status notices into status blocks.
|
|
24
|
+
*
|
|
25
|
+
* The profile declares which action statuses should surface in workspace
|
|
26
|
+
* chrome. Runtime action executors only provide current status by action id.
|
|
27
|
+
*/
|
|
28
|
+
export function ProjectedDocumentActionStatusNotices({
|
|
29
|
+
actionStatuses,
|
|
30
|
+
profile,
|
|
31
|
+
region,
|
|
32
|
+
}: ProjectedDocumentActionStatusNoticesProps) {
|
|
33
|
+
const notices =
|
|
34
|
+
profile?.ActionStatusNotices?.filter((notice) => !region || notice.Region === region) ?? []
|
|
35
|
+
const renderedNotices = notices
|
|
36
|
+
.map((notice) => {
|
|
37
|
+
const status = actionStatuses[notice.ActionId]
|
|
38
|
+
if (
|
|
39
|
+
notice.Kind === documentActionStatusNoticeKinds.error &&
|
|
40
|
+
status?.error
|
|
41
|
+
) {
|
|
42
|
+
const errorMessage = getErrorMessage(status.error)
|
|
43
|
+
const content = resolvePresentationContent(notice.Content, {
|
|
44
|
+
...status,
|
|
45
|
+
errorMessage,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ProjectedStatusBlock
|
|
50
|
+
key={notice.Id}
|
|
51
|
+
label={content.description ?? content.title ?? errorMessage}
|
|
52
|
+
tone="error"
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return null
|
|
58
|
+
})
|
|
59
|
+
.filter(Boolean)
|
|
60
|
+
|
|
61
|
+
if (renderedNotices.length === 0) {
|
|
62
|
+
return null
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return <div className="grid gap-2">{renderedNotices}</div>
|
|
66
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
PresentationShadcnComponentSystem as PresentationComponentSystem,
|
|
5
|
+
} from './presentation-shadcn-component-system'
|
|
6
|
+
import {
|
|
7
|
+
documentBadgeIconIds,
|
|
8
|
+
} from '@cohesivesystems/presentation-core'
|
|
9
|
+
import {
|
|
10
|
+
renderPresentationIcon,
|
|
11
|
+
} from './presentation-icon-registry'
|
|
12
|
+
import {
|
|
13
|
+
projectPresentationIconDiagnostics,
|
|
14
|
+
} from './presentation-icon-diagnostics'
|
|
15
|
+
import {
|
|
16
|
+
usePresentationModule,
|
|
17
|
+
useRegisterPresentationProjectionDiagnostics,
|
|
18
|
+
} from '@cohesivesystems/presentation-react'
|
|
19
|
+
import {
|
|
20
|
+
getPresentationTextBadgeClassName,
|
|
21
|
+
type PresentationTextBadgeTone,
|
|
22
|
+
} from '@cohesivesystems/presentation-tailwind'
|
|
23
|
+
|
|
24
|
+
export function TextBadge({
|
|
25
|
+
children,
|
|
26
|
+
componentSystem,
|
|
27
|
+
tone = 'slate',
|
|
28
|
+
}: {
|
|
29
|
+
readonly children: ReactNode
|
|
30
|
+
readonly componentSystem: PresentationComponentSystem
|
|
31
|
+
readonly tone?: PresentationTextBadgeTone
|
|
32
|
+
}) {
|
|
33
|
+
if (children === null || children === undefined || children === '') {
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const BadgeComponent = componentSystem.badges.Badge
|
|
38
|
+
return (
|
|
39
|
+
<BadgeComponent className={getPresentationTextBadgeClassName(tone)} variant="outline">
|
|
40
|
+
{children}
|
|
41
|
+
</BadgeComponent>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function OriginBadge({
|
|
46
|
+
componentSystem,
|
|
47
|
+
label,
|
|
48
|
+
}: {
|
|
49
|
+
readonly componentSystem: PresentationComponentSystem
|
|
50
|
+
readonly label: string
|
|
51
|
+
}) {
|
|
52
|
+
return <TextBadge componentSystem={componentSystem} tone="teal">{label}</TextBadge>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function ObservationVersionBadge({
|
|
56
|
+
componentSystem,
|
|
57
|
+
version,
|
|
58
|
+
}: {
|
|
59
|
+
readonly componentSystem: PresentationComponentSystem
|
|
60
|
+
readonly version?: number | null
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<TextBadge componentSystem={componentSystem}>
|
|
64
|
+
{version === null || version === undefined
|
|
65
|
+
? 'Observation unversioned'
|
|
66
|
+
: `Observation v${version.toLocaleString()}`}
|
|
67
|
+
</TextBadge>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ResourceLinkBadge({
|
|
72
|
+
componentSystem,
|
|
73
|
+
disabled,
|
|
74
|
+
label,
|
|
75
|
+
onClick,
|
|
76
|
+
prefix,
|
|
77
|
+
}: {
|
|
78
|
+
readonly componentSystem: PresentationComponentSystem
|
|
79
|
+
readonly disabled?: boolean
|
|
80
|
+
readonly label: string
|
|
81
|
+
readonly onClick: () => void
|
|
82
|
+
readonly prefix: string
|
|
83
|
+
}) {
|
|
84
|
+
const module = usePresentationModule()
|
|
85
|
+
const ActionButton = componentSystem.actions.ActionButton
|
|
86
|
+
const iconDiagnostics = useMemo(
|
|
87
|
+
() => projectPresentationIconDiagnostics({
|
|
88
|
+
icons: [{
|
|
89
|
+
details: {
|
|
90
|
+
prefix,
|
|
91
|
+
},
|
|
92
|
+
icon: documentBadgeIconIds.open,
|
|
93
|
+
id: `${prefix}:${label}:open`,
|
|
94
|
+
kind: 'document-badge-icon',
|
|
95
|
+
label: `Open ${prefix}`,
|
|
96
|
+
}],
|
|
97
|
+
module,
|
|
98
|
+
source: `document-badge-icons:${prefix}:${label}`,
|
|
99
|
+
}),
|
|
100
|
+
[
|
|
101
|
+
label,
|
|
102
|
+
module,
|
|
103
|
+
prefix,
|
|
104
|
+
],
|
|
105
|
+
)
|
|
106
|
+
useRegisterPresentationProjectionDiagnostics(
|
|
107
|
+
`document-badge-icons:${prefix}:${label}`,
|
|
108
|
+
iconDiagnostics,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<ActionButton
|
|
113
|
+
aria-label={`Open ${prefix}: ${label}`}
|
|
114
|
+
className="h-6 max-w-full rounded-md border-sky-700/15 bg-sky-50 px-2 text-xs font-medium text-sky-700 hover:bg-sky-100 hover:text-sky-900"
|
|
115
|
+
disabled={disabled}
|
|
116
|
+
onClick={onClick}
|
|
117
|
+
size="sm"
|
|
118
|
+
type="button"
|
|
119
|
+
variant="outline"
|
|
120
|
+
>
|
|
121
|
+
<span className="truncate">
|
|
122
|
+
{prefix}: {label}
|
|
123
|
+
</span>
|
|
124
|
+
{renderPresentationIcon({
|
|
125
|
+
className: 'size-3',
|
|
126
|
+
icon: documentBadgeIconIds.open,
|
|
127
|
+
module,
|
|
128
|
+
}) ?? renderPresentationIcon({
|
|
129
|
+
className: 'size-3',
|
|
130
|
+
icon: 'square-arrow-out-up-right',
|
|
131
|
+
})}
|
|
132
|
+
</ActionButton>
|
|
133
|
+
)
|
|
134
|
+
}
|