Zum Hauptinhalt springen

TypeScript · @chbrdk/dic-app

UI framework package for DIC product shells. No federation protocol, no secrets.

Package@chbrdk/dic-app@0.1.0
Entryimport { … } from '@chbrdk/dic-app'
GuideApp Framework overview

Install​

npm install @chbrdk/dic-app@0.1.0

Public exports​

App definition and shell​

ExportKindNotes
defineDicAppfnBuilds a DicAppDefinition from input
DicAppDefinition / DicAppDefinitionInput / DicAppNavItemtypesNav + product metadata
DicAppLayoutcomponentPrimary product frame
DicAppShellcomponentLower-level shell / presentation
DicAppPresentationtypePresentation mode union

Providers and confirm​

ExportKindNotes
DicAppProviderscomponentToast + confirm host
DicConfirmProvider / useDicConfirmcontextImperative confirm dialogs
DicConfirmOptionstypeTitle, body, confirm label, …

Networking helper (same-origin)​

ExportKindNotes
appJsonfnJSON fetch helper for your BFF
AppRequestErrorclassTyped non-OK responses
AppJsonInittypeInit options

Jobs​

ExportKindNotes
DicJobList / DicJobStatuscomponentsRender job rows / status
isDicJobActivefnPhase helper
DicJobView and related typestypesYou supply the data

Notices​

ExportKindNotes
DicBannercomponentSystem banner
DicNotificationIndicatorcomponentAttention / count chrome
formatDicCount / isDicBannerActivefnsSmall helpers
DicBannerView / DicNotificationIndicatorViewtypesHost-owned payloads

Uploads​

ExportKindNotes
DicFileUploadControlcomponentUpload list UI
dicFileUploadItemKey / isDicFileUploadBusyfnsKeys + busy check
DicFileUploadItemView / DicFileUploadResulttypesAdapter contract

Minimal confirm example​

'use client'

import { useDicConfirm } from '@chbrdk/dic-app'

export function DeleteButton({ onConfirm }: { onConfirm: () => Promise<void> }) {
const confirm = useDicConfirm()
return (
<button
type="button"
onClick={() =>
confirm({
title: 'Delete item?',
body: 'This cannot be undone.',
confirmLabel: 'Delete',
onConfirm,
})
}
>
Delete
</button>
)
}

Remember: the tree above this button must include DicAppProviders.

Stability​

Only exports listed from the package entry are supported. If you need a new primitive, prefer extending @msqdx/ui / dic-app properly over copying chrome into the product repo.