@burojs/ui-shadcn 0.7.0 → 0.8.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/{bulk-summary-CrEij5vq.cjs → bulk-summary-2HLgz7Il.cjs} +31 -5
- package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
- package/dist/{bulk-summary-BWSAS7k2.js → bulk-summary-D6A0ua21.js} +32 -6
- package/dist/bulk-summary-D6A0ua21.js.map +1 -0
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs → candidates-relation-picker-C47mF260.cjs} +3 -3
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs.map → candidates-relation-picker-C47mF260.cjs.map} +1 -1
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js → candidates-relation-picker-CGXItMN0.js} +3 -3
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js.map → candidates-relation-picker-CGXItMN0.js.map} +1 -1
- package/dist/{check-confirm-dialog-C-NHgMST.cjs → check-confirm-dialog-BT04Mieo.cjs} +13 -6
- package/dist/check-confirm-dialog-BT04Mieo.cjs.map +1 -0
- package/dist/{check-confirm-dialog-2j0gOd7x.js → check-confirm-dialog-CtiRzOAt.js} +14 -7
- package/dist/{check-confirm-dialog-2j0gOd7x.js.map → check-confirm-dialog-CtiRzOAt.js.map} +1 -1
- package/dist/{filter-builder-DFu0JP-1.cjs → filter-builder-ByGhxLf_.cjs} +127 -63
- package/dist/filter-builder-ByGhxLf_.cjs.map +1 -0
- package/dist/{filter-builder-DaWHUZuV.js → filter-builder-z3Axzf9Y.js} +114 -56
- package/dist/filter-builder-z3Axzf9Y.js.map +1 -0
- package/dist/{flow-runtime-BpmrIUb6.cjs → flow-runtime-BVFjMU5-.cjs} +6 -3
- package/dist/{flow-runtime-BpmrIUb6.cjs.map → flow-runtime-BVFjMU5-.cjs.map} +1 -1
- package/dist/{flow-runtime-DyqTmK3H.js → flow-runtime-DrUWyTS0.js} +6 -3
- package/dist/{flow-runtime-DyqTmK3H.js.map → flow-runtime-DrUWyTS0.js.map} +1 -1
- package/dist/{flow-screen-DCdli6Ha.js → flow-screen-3fk6J33y.js} +6 -4
- package/dist/flow-screen-3fk6J33y.js.map +1 -0
- package/dist/{flow-screen-Bcz9NF2V.cjs → flow-screen-6y5E_HT6.cjs} +5 -3
- package/dist/flow-screen-6y5E_HT6.cjs.map +1 -0
- package/dist/index.cjs +518 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +187 -86
- package/dist/index.d.ts +187 -86
- package/dist/index.js +519 -108
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-3vw7LzzD.cjs → inline-flow-host-C4KmZIYE.cjs} +3 -3
- package/dist/{inline-flow-host-3vw7LzzD.cjs.map → inline-flow-host-C4KmZIYE.cjs.map} +1 -1
- package/dist/{inline-flow-host-C0rI9B7f.js → inline-flow-host-YnnvWjdU.js} +3 -3
- package/dist/{inline-flow-host-C0rI9B7f.js.map → inline-flow-host-YnnvWjdU.js.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs → lazy-relation-picker-dialog-BAKBRn3V.cjs} +2 -2
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs.map → lazy-relation-picker-dialog-BAKBRn3V.cjs.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js → lazy-relation-picker-dialog-DN4bvQfg.js} +2 -2
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js.map → lazy-relation-picker-dialog-DN4bvQfg.js.map} +1 -1
- package/dist/{page-flow-route-BHUEpn0I.js → page-flow-route-CtEfqAvU.js} +5 -6
- package/dist/page-flow-route-CtEfqAvU.js.map +1 -0
- package/dist/{page-flow-route-DS8IVTVH.cjs → page-flow-route-DEjAxHe3.cjs} +6 -7
- package/dist/page-flow-route-DEjAxHe3.cjs.map +1 -0
- package/dist/{place-node-CfzQvh4Y.js → place-node-BdxT-30h.js} +149 -108
- package/dist/place-node-BdxT-30h.js.map +1 -0
- package/dist/{place-node-CNb3w-c7.cjs → place-node-Bhl8B3fF.cjs} +163 -134
- package/dist/place-node-Bhl8B3fF.cjs.map +1 -0
- package/dist/{related-list-cards-CelMxl4q.cjs → related-list-cards-Bc_vfCE_.cjs} +3 -3
- package/dist/{related-list-cards-CelMxl4q.cjs.map → related-list-cards-Bc_vfCE_.cjs.map} +1 -1
- package/dist/{related-list-cards-BIqqY69Y.js → related-list-cards-BvkD5OcC.js} +3 -3
- package/dist/{related-list-cards-BIqqY69Y.js.map → related-list-cards-BvkD5OcC.js.map} +1 -1
- package/dist/related-list-timeline-DCrwN9oO.js +167 -0
- package/dist/related-list-timeline-DCrwN9oO.js.map +1 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs +167 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs.map +1 -0
- package/dist/{related-rows-MPnLCmPF.cjs → related-rows-BW9Jr07T.cjs} +3 -3
- package/dist/{related-rows-MPnLCmPF.cjs.map → related-rows-BW9Jr07T.cjs.map} +1 -1
- package/dist/{related-rows--uP2iKQC.js → related-rows-CPE-9FFr.js} +3 -3
- package/dist/{related-rows--uP2iKQC.js.map → related-rows-CPE-9FFr.js.map} +1 -1
- package/dist/{relation-many-picker-BJhaEqxz.js → relation-many-picker-BlrGRwMV.js} +10 -5
- package/dist/relation-many-picker-BlrGRwMV.js.map +1 -0
- package/dist/{relation-many-picker-DzuGJpEl.cjs → relation-many-picker-Br-zBHxT.cjs} +10 -5
- package/dist/relation-many-picker-Br-zBHxT.cjs.map +1 -0
- package/dist/{relation-picker-DaIMzf2H.cjs → relation-picker-ADjxI_TI.cjs} +11 -6
- package/dist/relation-picker-ADjxI_TI.cjs.map +1 -0
- package/dist/{relation-picker-dialog-DoEY8EkH.js → relation-picker-dialog-CyKliBkN.js} +2 -2
- package/dist/{relation-picker-dialog-DoEY8EkH.js.map → relation-picker-dialog-CyKliBkN.js.map} +1 -1
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs → relation-picker-dialog-DimVQF9Y.cjs} +2 -2
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs.map → relation-picker-dialog-DimVQF9Y.cjs.map} +1 -1
- package/dist/{relation-picker-D-tBBZW_.js → relation-picker-x7P5HKie.js} +11 -6
- package/dist/relation-picker-x7P5HKie.js.map +1 -0
- package/dist/{resource-page-router-Diw6S6TK.js → resource-page-router-BRpUnhay.js} +144 -17
- package/dist/resource-page-router-BRpUnhay.js.map +1 -0
- package/dist/{resource-page-router-C_kGW2o_.cjs → resource-page-router-qEd2xb55.cjs} +158 -19
- package/dist/resource-page-router-qEd2xb55.cjs.map +1 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs +70 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs.map +1 -0
- package/dist/use-record-subtitle-gIaCGgbI.js +53 -0
- package/dist/use-record-subtitle-gIaCGgbI.js.map +1 -0
- package/package.json +9 -9
- package/dist/bulk-summary-BWSAS7k2.js.map +0 -1
- package/dist/bulk-summary-CrEij5vq.cjs.map +0 -1
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +0 -1
- package/dist/filter-builder-DFu0JP-1.cjs.map +0 -1
- package/dist/filter-builder-DaWHUZuV.js.map +0 -1
- package/dist/flow-screen-Bcz9NF2V.cjs.map +0 -1
- package/dist/flow-screen-DCdli6Ha.js.map +0 -1
- package/dist/page-flow-route-BHUEpn0I.js.map +0 -1
- package/dist/page-flow-route-DS8IVTVH.cjs.map +0 -1
- package/dist/place-node-CNb3w-c7.cjs.map +0 -1
- package/dist/place-node-CfzQvh4Y.js.map +0 -1
- package/dist/related-list-timeline-CRh7xwLD.js +0 -141
- package/dist/related-list-timeline-CRh7xwLD.js.map +0 -1
- package/dist/related-list-timeline-DsLdi8sv.cjs +0 -141
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +0 -1
- package/dist/relation-many-picker-BJhaEqxz.js.map +0 -1
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +0 -1
- package/dist/relation-picker-D-tBBZW_.js.map +0 -1
- package/dist/relation-picker-DaIMzf2H.cjs.map +0 -1
- package/dist/resource-page-router-C_kGW2o_.cjs.map +0 -1
- package/dist/resource-page-router-Diw6S6TK.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-confirm-dialog-BT04Mieo.cjs","names":["useDoc","useI18nCaps","useOptionalT","useDocPanel","useState","resolveDocSee","docAddressToArticle","useDocTopics","Popover","PopoverTrigger","cn","IconInfoHexagon","PopoverContent","IconArrowRight","IconArrowUpRight","SheetPrimitive","React","cn","cva","useChromeT","IconX","TooltipPrimitive","React","cn","DropdownMenuPrimitive","React","cn","IconChevronRight","IconCheck","IconCircle","IconPlayerPlay","IconCircleCaretRight","IconPlayerTrackNext","IconRotate","IconRefresh","IconBan","IconCircleX","IconTrash","IconCopy","IconHash","IconQrcode","IconNetwork","IconGitBranch","IconLink","IconPencil","IconPlus","IconEye","IconScript","IconHistory","IconDots","IconCircle","IconCircleCheck","IconClock","IconPackage","IconPackageImport","IconPackageExport","IconPackages","IconPackageOff","IconBox","IconArrowsLeftRight","IconFileText","IconFilePencil","IconFileX","IconFileOff","IconTruck","IconTool","IconHammer","IconSettings","IconBell","IconBuilding","IconMapPin","IconUsers","IconUserPlus","IconBoxMultiple","IconTag","IconShieldCheck","IconKey","IconKeyOff","IconClipboardList","IconList","IconCheck","IconX","cn","createContext","DialogHeader","DialogTitle","DialogDescription","useRef","Dialog","DialogContent","useContext","useRef","DialogPrimitive","useState","useCallback","Component","useOptionalT","useChromeT","useUIInstance","Button","resolveContentSlot","humanizeKey","useApp","useI18nCaps","textsValueAt","humanizeKey","DESTRUCTIVE_ITEM","useLinkComponent","cn","Button","IconLoader2","routeResourceKey","useFlowRowResolver","useTestIds","useApp","recordKeyOf","useState","conjoinHostPage","useMemo","compileFlow","flowRecordOf","useProjectedTitle","usePresentFlow","useHostPage","hrefFor","useOptionalRouterAdapter","useCallback","canonicalEntityNodeKey","normalizeEntityRef","useComponent","routeResourceKey","useApp","useQuickEntry","useQuick","useEntryGate","isBuiltinItemAction","recordEntries","routeResourceKey","useI18nCaps","resolveContentSlot","useId","Button","cn","declaredText","humanizeKey","normalizeEntityRef","useApp","useAvailabilityResolver","modeForSurface","useActionWhenSources","isFlowAction","actionWhenHolds","actionWhenSources","isBuiltinItemAction","hasRecordPage","useTestIds","recordKeyOf","buildDI","resolveRoute","useLinkComponent","usePresentBlock","constraintText","FRAMEWORK_TEXT_KEYS","checkFailedDefault","useOptionalT","useI18nCaps","cn","useChromeT","useRef","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","Button"],"sources":["../src/doc/doc-info.tsx","../src/primitives/sheet.tsx","../src/primitives/tooltip.tsx","../src/primitives/dropdown-menu.tsx","../src/primitives/icon.tsx","../src/ui-presentations/shell.tsx","../src/flows/overlay-heading.tsx","../src/flows/load-runtime.tsx","../src/lib/reason-text.ts","../src/actions/action-inner.tsx","../src/actions/action-control.tsx","../src/flows/chrome.ts","../src/flows/flow-action-button.tsx","../src/lib/external-href.ts","../src/list-kit/list-slots.ts","../src/actions/builtin-edit-route.ts","../src/actions/action-button.tsx","../src/checks/check-confirm-dialog.tsx"],"sourcesContent":["'use client';\n\nimport { docAddressToArticle, resolveDocSee } from '@burojs/core';\nimport { useDoc, useDocPanel, useDocTopics, useI18nCaps, useOptionalT } from '@burojs/react';\nimport { IconArrowRight, IconArrowUpRight, IconInfoHexagon } from '@tabler/icons-react';\nimport { type JSX, useState } from 'react';\nimport { cn } from '../lib/cn.js';\nimport { Popover, PopoverContent, PopoverTrigger } from '../primitives/popover.js';\n\nexport interface DocInfoProps {\n /** Doc address, e.g. `document_document/fields/gtin`. */\n address: string;\n /** Human name of the documented thing; goes into the button's accessible name. */\n name: string;\n /** Test id for the trigger; the content gets `${testId}:content`. */\n testId?: string;\n className?: string;\n}\n\n/**\n * The one affordance for contextual documentation: an «i» button that opens a\n * popover with the entity's summary and any external references.\n *\n * Renders NOTHING when the address has no content, so density is authored in\n * the bundle rather than imposed by the framework. On a 40-field form that is\n * the difference between a considered handful of icons and forty of them.\n *\n * **Design intent — quiet until summoned.** At rest the trigger is a bare glyph\n * in the muted tone, carrying no chrome of its own; the 24px target only\n * announces itself as a soft disc on hover, focus, and while open. The popover\n * is then treated as reading matter rather than chrome: foreground text, a\n * 1.6 line height, and a hairline rule before the links.\n *\n * Behavioural choices, each with a reason:\n *\n * - **Click, never hover.** Click-only content falls outside WCAG SC 1.4.13 by\n * construction rather than having to satisfy its three requirements, and\n * hover does not exist on touch devices.\n * - **`role=\"dialog\"`, not `role=\"tooltip\"`.** The popover contains links, and\n * interactive content inside a tooltip is disallowed by every design system\n * that documents the distinction. Radix Popover already provides focus-in,\n * Tab containment and Escape-returns-focus.\n * - **No repeated title.** The trigger always sits beside the thing it\n * documents, so restating the label would spend a third of a 288px popover\n * telling the reader what they are already looking at. The accessible name\n * still carries it, for readers who arrive without that spatial context.\n * - **`w-auto` before `min-w`/`max-w`.** `cn()` is tailwind-merge, and `w-*`\n * and `min-w-*`/`max-w-*` are separate groups: without `w-auto` the\n * primitive's default `w-72` survives and the max-width silently does nothing.\n * - **Full `text-muted-foreground`.** The `/70` variant measures 3.31:1 in\n * light mode — scraping past SC 1.4.11's 3:1 for controls, and failing it\n * outright were this read as text. The full token measures 6.62:1.\n * - **Plain `<a>`, not RouterLink.** These leave the application entirely;\n * routing is not involved, and the framework must not couple to a router here.\n */\nexport function DocInfo({ address, name, testId, className }: DocInfoProps): JSX.Element | null {\n const doc = useDoc(address);\n const caps = useI18nCaps();\n const t = useOptionalT();\n const { openPanel } = useDocPanel();\n const [open, setOpen] = useState(false);\n /*\n Articles hang off the SCOPE — `document_document/fields/gtin` reads its\n articles from `document_document` — and a resource child additionally owns\n one topic inside that scope. `docAddressToArticle` holds that grammar; see\n its note for why splitting on the first slash is not good enough.\n */\n /*\n …and a field that defers to a glossary term reads the TERM's articles. Its\n own address has none — that is what deferring means — so resolving `see`\n first is what makes «Learn more» on `code_code/fields/gtin` land on the GTIN\n article rather than on nothing.\n */\n const see = resolveDocSee(caps, address);\n const { scope: articleScope, topicId: ownTopicId } = docAddressToArticle(see ?? address);\n const topics = useDocTopics(articleScope);\n\n /*\n Whether this address has an article OF ITS OWN. Load-bearing twice over.\n\n For the TRIGGER: an earlier cut rendered it whenever the SCOPE had any\n article, which made every one of a resource's forty fields sprout an «i» the\n moment the resource itself was documented. Density has to stay authored per\n entity — that is the whole premise.\n\n For «Learn more»: the same mistake survived in the link one line further\n down, and was worse there. On `reference_product/fields/pg` it offered\n «Learn more» because reference_product had *some* article, then opened the\n resource's topic list — so a reader asking about ONE FIELD was handed a\n page about the whole resource, having been promised more about the field.\n A link that does not go where it says is worse than no link.\n */\n const hasOwnArticle =\n ownTopicId === undefined ? topics.length > 0 : topics.some((x) => x.id === ownTopicId);\n\n // Hooks must all run before any early return.\n if (!doc && !hasOwnArticle) return null;\n\n const id = testId ?? `doc-info:${address}`;\n const newTabNote = t('docPanel.opensInNewTab', { defaultValue: '(opens in a new tab)' });\n const hasSummary = doc?.summary !== undefined;\n const hasLinks = doc?.links !== undefined && doc.links.length > 0;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-label={t('docPanel.openFor', { params: { name }, defaultValue: `Help: ${name}` })}\n data-testid={id}\n className={cn(\n /*\n SC 2.5.8 Target Size (Minimum), AA, states its floor in CSS\n PIXELS — so the floor has to be expressed in pixels too. At the\n shipped standard 16px root, `size-6` is 1.5rem = 24px. The\n explicit px floor keeps that accessibility minimum intact if an\n adopter customizes the root size.\n */\n 'inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 items-center justify-center rounded-full',\n 'text-muted-foreground',\n // The disc is the whole chrome budget: absent at rest, present the\n // moment the control is engaged. `transition-colors` keeps it from\n // reading as a pop-in.\n 'transition-colors duration-150',\n 'hover:bg-muted hover:text-foreground',\n 'data-[state=open]:bg-muted data-[state=open]:text-foreground',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n className,\n )}\n >\n <IconInfoHexagon className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n // biome-ignore lint/a11y/useSemanticElements: PopoverContent is a Radix\n // component rendered into a portal, not a raw element — a native\n // <dialog> would bring its own modal semantics and top-layer behaviour,\n // which is exactly what this non-modal popover must not have. The role\n // is required because the content holds links, and interactive content\n // inside role=\"tooltip\" is disallowed.\n role=\"dialog\"\n aria-label={name}\n // `w-auto` FIRST — see the note above; without it `w-72` wins.\n // The height cap keeps a long summary from running off a short viewport;\n // `overscroll-contain` stops that scroll from chaining to the page.\n className={cn(\n 'w-auto min-w-[16rem] max-w-[22rem]',\n 'max-h-[min(24rem,60vh)] overflow-y-auto overscroll-contain',\n 'space-y-2.5',\n )}\n data-testid={`${id}:content`}\n >\n {hasSummary && (\n // Reading matter, not chrome: foreground tone and a line height that\n // survives two or three sentences of Russian.\n <p className=\"text-[0.8125rem] leading-[1.6] text-foreground\">{doc?.summary}</p>\n )}\n {hasOwnArticle && (\n <button\n type=\"button\"\n data-testid={`${id}:more`}\n onClick={() => {\n /*\n Close the popover FIRST and suppress its own focus restore, then\n let the panel take focus. Radix would otherwise hand focus back\n to the trigger the instant the popover unmounts, and the panel's\n own focus call would race it.\n */\n setOpen(false);\n /*\n Straight to THIS entity's article. Passing only the scope would\n land on the resource's topic list — technically \"more\", but not\n more about the thing the reader clicked. A resource-level\n address has no `ownTopicId`, and there the list IS the answer.\n */\n openPanel(\n ownTopicId === undefined\n ? { scopes: [articleScope] }\n : { scopes: [articleScope], topicId: ownTopicId },\n id,\n );\n }}\n className={cn(\n 'inline-flex items-center gap-1 rounded-sm text-[0.8125rem] font-medium text-primary',\n 'hover:underline underline-offset-2',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n )}\n >\n {t('docPanel.readMore', { defaultValue: 'Read more' })}\n <IconArrowRight className=\"size-3.5 shrink-0\" aria-hidden=\"true\" />\n </button>\n )}\n {hasLinks && (\n <div\n className={cn(\n 'flex flex-col items-start gap-1.5',\n // A whisper of a rule, not a divider — and only when there is\n // something above it to separate from.\n hasSummary && 'border-t border-border/60 pt-2.5',\n )}\n >\n {doc?.links?.map((link) => (\n <a\n key={link.href}\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n 'group inline-flex max-w-full items-center gap-1 rounded-sm',\n 'text-[0.8125rem] font-medium text-primary',\n 'hover:underline underline-offset-2',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n )}\n >\n <span className=\"min-w-0 truncate\">{link.label}</span>\n <IconArrowUpRight\n className=\"size-3.5 shrink-0 transition-transform duration-150 group-hover:-translate-y-px group-hover:translate-x-px\"\n aria-hidden=\"true\"\n />\n <span className=\"sr-only\">{newTabNote}</span>\n </a>\n ))}\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","'use client';\nimport { useChromeT } from '@burojs/react';\n\nimport * as React from 'react';\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nexport type SheetOverlayProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n SheetOverlayProps\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 bg-overlay/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-[var(--duration-panel)] ease-[var(--ease-overlay)]',\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-background text-foreground p-6 shadow-lg duration-[var(--duration-panel)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'right',\n },\n },\n);\n\nexport interface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {\n /** Whether the standard visual close button is rendered. Defaults to true. */\n showClose?: boolean;\n}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', className, children, showClose = true, ...props }, ref) => {\n const chromeT = useChromeT();\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n {showClose && (\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <IconX className=\"h-4 w-4\" />\n <span className=\"sr-only\">{chromeT('actions.close', { defaultValue: 'Close' })}</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n});\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nexport type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction SheetHeader({ className, ...props }: SheetHeaderProps) {\n return (\n <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />\n );\n}\nSheetHeader.displayName = 'SheetHeader';\n\nexport type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction SheetFooter({ className, ...props }: SheetFooterProps) {\n return (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n );\n}\nSheetFooter.displayName = 'SheetFooter';\n\nexport type SheetTitleProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>;\n\nconst SheetTitle = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Title>, SheetTitleProps>(\n ({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n ),\n);\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nexport type SheetDescriptionProps = React.ComponentPropsWithoutRef<\n typeof SheetPrimitive.Description\n>;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n SheetDescriptionProps\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetTrigger,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n SheetClose,\n};\n","'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '../lib/cn.js';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { IconCheck, IconChevronRight, IconCircle } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md duration-[var(--duration-overlay)] ease-[var(--ease-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCircle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nfunction DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n );\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","'use client';\n\nimport {\n IconArrowsLeftRight,\n IconBan,\n IconBell,\n IconBox,\n IconBoxMultiple,\n IconBuilding,\n IconCheck,\n IconCircle,\n IconCircleCaretRight,\n IconCircleCheck,\n IconCircleX,\n IconClipboardList,\n IconClock,\n IconCopy,\n IconDots,\n IconEye,\n IconFileOff,\n IconFilePencil,\n IconFileText,\n IconFileX,\n IconGitBranch,\n IconHammer,\n IconHash,\n IconHistory,\n IconKey,\n IconKeyOff,\n IconLink,\n IconList,\n IconMapPin,\n IconNetwork,\n IconPackage,\n IconPackageExport,\n IconPackageImport,\n IconPackageOff,\n IconPackages,\n IconPencil,\n IconPlayerPlay,\n IconPlayerTrackNext,\n IconPlus,\n IconQrcode,\n IconRefresh,\n IconRotate,\n IconScript,\n IconSettings,\n IconShieldCheck,\n IconTag,\n IconTool,\n IconTrash,\n IconTruck,\n IconUserPlus,\n IconUsers,\n IconX,\n} from '@tabler/icons-react';\nimport type { ComponentType, SVGProps } from 'react';\nimport { cn } from '../lib/cn.js';\n\n/**\n * Any component that renders an `<svg>`. Wide on purpose: an adopter passing\n * a Tabler icon, a lucide icon they still have around, or their own hand-drawn\n * SVG component all satisfy it, so `registerIcons` accepts every one of them.\n */\nexport type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;\n\n/**\n * Curated, tree-shakeable icon registry.\n *\n * Each icon is imported BY NAME from `@tabler/icons-react` (never `import *`)\n * so the bundler drops the ones an app doesn't reference — the barrel carries\n * ~5900 icons, so this matters.\n *\n * Keys are SEMANTIC and deliberately NOT Tabler's names: they are the strings\n * adopters write in `action.icon` / an option's `icon`, they predate this\n * library, and they must keep resolving across a library swap. `'Play'` is a\n * name in our vocabulary that currently points at `IconPlayerPlay`.\n *\n * Adopters extend it via {@link registerIcons} rather than editing this map.\n */\nconst REGISTRY: Record<string, IconComponent> = {\n Play: IconPlayerPlay,\n PlayCircle: IconCircleCaretRight,\n StepForward: IconPlayerTrackNext,\n RotateCcw: IconRotate,\n RefreshCw: IconRefresh,\n Ban: IconBan,\n XCircle: IconCircleX,\n Trash2: IconTrash,\n Copy: IconCopy,\n Hash: IconHash,\n QrCode: IconQrcode,\n Network: IconNetwork,\n GitBranch: IconGitBranch,\n Link: IconLink,\n Link2: IconLink,\n Pencil: IconPencil,\n Plus: IconPlus,\n Eye: IconEye,\n ScrollText: IconScript,\n History: IconHistory,\n MoreHorizontal: IconDots,\n Circle: IconCircle,\n CircleCheck: IconCircleCheck,\n Clock: IconClock,\n Package: IconPackage,\n PackagePlus: IconPackageImport,\n PackageMinus: IconPackageExport,\n PackageCheck: IconPackages,\n PackageX: IconPackageOff,\n // Tabler ships no open-carton glyph in 3.46.0; IconBoxSeam is a deprecated\n // alias of IconPackage and would make Package/PackageOpen render\n // identically, so the plain unsealed box carries \"opened\" instead.\n PackageOpen: IconBox,\n ArrowRightLeft: IconArrowsLeftRight,\n FileText: IconFileText,\n FileEdit: IconFilePencil,\n FileX: IconFileX,\n FileX2: IconFileOff,\n Truck: IconTruck,\n Wrench: IconTool,\n Hammer: IconHammer,\n Settings: IconSettings,\n Bell: IconBell,\n Building2: IconBuilding,\n MapPin: IconMapPin,\n Users: IconUsers,\n UserPlus: IconUserPlus,\n Boxes: IconBoxMultiple,\n Tag: IconTag,\n ShieldCheck: IconShieldCheck,\n // Credentials: issuing an API key / token, and taking one back.\n Key: IconKey,\n KeyOff: IconKeyOff,\n ClipboardList: IconClipboardList,\n List: IconList,\n Check: IconCheck,\n X: IconX,\n};\n\n/**\n * Merge adopter-supplied icon components into the built-in registry. Keys are\n * the semantic names referenced from `action.icon` (etc.); later calls win\n * on collision. Call once at app bootstrap:\n *\n * ```ts\n * import { IconRocket } from '@tabler/icons-react';\n * registerIcons({ Rocket: IconRocket });\n * ```\n */\nexport function registerIcons(map: Record<string, IconComponent>): void {\n Object.assign(REGISTRY, map);\n}\n\n/** Whether `name` is a registered icon (built-in or via {@link registerIcons}). */\nexport function hasIcon(name: string): boolean {\n return Object.hasOwn(REGISTRY, name);\n}\n\nexport interface IconProps {\n /** Semantic registry key (e.g. `'Hash'`). See REGISTRY above. */\n name?: string;\n className?: string;\n}\n\n/**\n * Resolve a registered icon by name and render it. Unknown / missing names\n * degrade to a neutral `IconCircle` so a typo'd or unregistered `icon` string\n * never leaks to the UI as raw text.\n */\nexport function Icon({ name, className }: IconProps): React.ReactElement | null {\n const Cmp = (name ? REGISTRY[name] : undefined) ?? IconCircle;\n return <Cmp className={cn('h-4 w-4', className)} aria-hidden=\"true\" />;\n}\n","import { createContext, useEffect, useRef, type ReactNode } from 'react';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../primitives/dialog.js';\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from '../primitives/sheet.js';\n\nexport interface PresentationCopy {\n readonly title: string;\n readonly description?: string;\n}\n\ninterface PresentationShellProps {\n readonly dismiss: () => void;\n readonly wrapper: boolean;\n readonly copy: PresentationCopy;\n /**\n * The presented component renders the overlay's title itself, as the Radix `Title` (a quick\n * entry's record title, plan ruling 2): the shell renders no title and no description, and\n * focus moves to the element marked `data-buro-overlay-heading` on open.\n */\n readonly ownTitle?: boolean;\n readonly children: ReactNode;\n}\n\n/**\n * @internal True inside a kit shell asked for `ownTitle`: the presented component may render the\n * Radix `Title` (an app's host, which may not be a Radix dialog at all, leaves it `false`).\n */\nexport const OwnTitleContext = createContext(false);\n\n/** On open, focus the presented component's own heading instead of the first tabbable. */\nfunction focusOwnHeading(event: Event): void {\n const container = event.currentTarget;\n if (!(container instanceof HTMLElement)) return;\n const heading = container.querySelector('[data-buro-overlay-heading]');\n if (!(heading instanceof HTMLElement)) return;\n event.preventDefault();\n heading.focus();\n}\n\nfunction WrappedDialogContent({\n wrapper,\n copy,\n children,\n}: Pick<PresentationShellProps, 'wrapper' | 'copy' | 'children'>) {\n return wrapper ? (\n <>\n <DialogHeader>\n <DialogTitle>{copy.title}</DialogTitle>\n <DialogDescription className={copy.description === undefined ? 'sr-only' : undefined}>\n {copy.description ?? ''}\n </DialogDescription>\n </DialogHeader>\n {children}\n </>\n ) : (\n <>\n <DialogTitle className=\"sr-only\">{copy.title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{copy.description ?? ''}</DialogDescription>\n {children}\n </>\n );\n}\n\nfunction WrappedSheetContent({\n wrapper,\n copy,\n children,\n}: Pick<PresentationShellProps, 'wrapper' | 'copy' | 'children'>) {\n return wrapper ? (\n <>\n <SheetHeader>\n <SheetTitle>{copy.title}</SheetTitle>\n <SheetDescription className={copy.description === undefined ? 'sr-only' : undefined}>\n {copy.description ?? ''}\n </SheetDescription>\n </SheetHeader>\n {children}\n </>\n ) : (\n <>\n <SheetTitle className=\"sr-only\">{copy.title}</SheetTitle>\n <SheetDescription className=\"sr-only\">{copy.description ?? ''}</SheetDescription>\n {children}\n </>\n );\n}\n\nfunction useFocusRestoration(): void {\n // Capture before Radix moves focus into the portal. The host may be removed\n // immediately after `dismiss`, so defer restoration until Radix cleanup has\n // completed its own focus handling.\n const returnFocus = useRef<HTMLElement | null>(\n typeof document === 'undefined' || !(document.activeElement instanceof HTMLElement)\n ? null\n : document.activeElement,\n );\n useEffect(\n () => () => {\n const element = returnFocus.current;\n queueMicrotask(() => {\n // The opener is gone (its row was deleted, say): the nearest surviving landmark instead\n // (spec 4.12), never the document body.\n if (element?.isConnected && element !== document.body) {\n element.focus();\n return;\n }\n const main = document.querySelector<HTMLElement>('main');\n if (main === null) return;\n if (!main.hasAttribute('tabindex')) main.setAttribute('tabindex', '-1');\n main.focus();\n });\n },\n [],\n );\n}\n\n/**\n * A pointer down inside a popover (a peek) is not outside the overlay. The popover is a React\n * sibling of the sheet or dialog (`<UIPresentations>` renders every presentation side by side),\n * and Radix decides \"inside\" by the React tree, so without this a click on a peek's title — which\n * pushes into this sheet — would first dismiss it (or ask about its dirty form).\n */\nfunction keepForPopover(event: { readonly target: EventTarget | null; preventDefault(): void }) {\n const target = event.target;\n if (target instanceof Element && target.closest('[data-buro-popover]') !== null)\n event.preventDefault();\n}\n\n/** No slide and no fade under `prefers-reduced-motion` (spec 4.12). */\nconst REDUCED_MOTION = 'motion-reduce:animate-none motion-reduce:transition-none';\n\n/** Shared Radix lifecycle shell for a centered temporary presentation. */\nexport function DialogPresentationShell({\n dismiss,\n wrapper,\n copy,\n ownTitle = false,\n children,\n}: PresentationShellProps) {\n useFocusRestoration();\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open) dismiss();\n }}\n >\n {ownTitle ? (\n <DialogContent\n className={`flex max-h-[85vh] flex-col ${REDUCED_MOTION}`}\n overlayClassName={REDUCED_MOTION}\n showClose={wrapper}\n aria-describedby={undefined}\n aria-modal=\"true\"\n onOpenAutoFocus={focusOwnHeading}\n onPointerDownOutside={keepForPopover}\n >\n <OwnTitleContext.Provider value={true}>{children}</OwnTitleContext.Provider>\n </DialogContent>\n ) : (\n <DialogContent\n className={REDUCED_MOTION}\n overlayClassName={REDUCED_MOTION}\n showClose={wrapper}\n aria-modal=\"true\"\n onPointerDownOutside={keepForPopover}\n >\n <WrappedDialogContent wrapper={wrapper} copy={copy}>\n {children}\n </WrappedDialogContent>\n </DialogContent>\n )}\n </Dialog>\n );\n}\n\n/** Shared Radix lifecycle shell for a right-hand temporary presentation. */\nexport function SheetPresentationShell({\n dismiss,\n wrapper,\n copy,\n ownTitle = false,\n children,\n}: PresentationShellProps) {\n useFocusRestoration();\n return (\n <Sheet\n open\n onOpenChange={(open) => {\n if (!open) dismiss();\n }}\n >\n {ownTitle ? (\n <SheetContent\n side=\"right\"\n className={`flex flex-col sm:max-w-xl ${REDUCED_MOTION}`}\n showClose={wrapper}\n aria-describedby={undefined}\n aria-modal=\"true\"\n onOpenAutoFocus={focusOwnHeading}\n onPointerDownOutside={keepForPopover}\n >\n <OwnTitleContext.Provider value={true}>{children}</OwnTitleContext.Provider>\n </SheetContent>\n ) : (\n <SheetContent\n side=\"right\"\n className={`sm:max-w-xl ${REDUCED_MOTION}`}\n showClose={wrapper}\n aria-modal=\"true\"\n onPointerDownOutside={keepForPopover}\n >\n <WrappedSheetContent wrapper={wrapper} copy={copy}>\n {children}\n </WrappedSheetContent>\n </SheetContent>\n )}\n </Sheet>\n );\n}\n","import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { type ReactElement, type RefObject, useContext, useEffect, useRef } from 'react';\nimport { OwnTitleContext } from '../ui-presentations/shell.js';\n\n/**\n * Takes focus on mount when it still sits on the page body or on the dialog itself. A heading\n * that replaces the one that held focus (the loading view, the opening view, the held screen)\n * would otherwise leave focus on the body.\n */\nexport function useFocusOnMount(ref: RefObject<HTMLElement | null>): void {\n useEffect(() => {\n const heading = ref.current;\n if (heading === null) return;\n const active = document.activeElement;\n if (active === document.body || active === heading.closest('[role=\"dialog\"]')) {\n heading.focus();\n }\n }, [ref]);\n}\n\n/**\n * The overlay's title: the Radix title a flow dialog is labelled by. It lives in the eagerly\n * loaded chunk so the dialog is named from its first frame (while the lazy screen loads, in\n * the load-failure view and on every reopen). On mount it takes focus when focus still sits\n * on the page body or on the dialog itself, so a screen reader starts at the heading.\n */\nexport function OwnTitleHeading({ label }: { readonly label: string }): ReactElement {\n const ownTitle = useContext(OwnTitleContext);\n const ref = useRef<HTMLHeadingElement>(null);\n useFocusOnMount(ref);\n const heading = (\n <h2 ref={ref} tabIndex={-1} data-buro-overlay-heading=\"\" className=\"text-lg font-semibold\">\n {label}\n </h2>\n );\n return ownTitle ? <DialogPrimitive.Title asChild>{heading}</DialogPrimitive.Title> : heading;\n}\n","'use client';\nimport { useChromeT, useOptionalT, useUIInstance } from '@burojs/react';\nimport {\n Component,\n type ErrorInfo,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport { toast } from '../notification/toaster.js';\nimport { Button } from '../primitives/button.js';\nimport { OwnTitleHeading } from './overlay-heading.js';\nimport type { AppFlowRunnerProps, BulkFlowRunnerProps, FlowRunnerProps } from './flow-runtime.js';\n\n/**\n * A module loaded on demand, retryable (P4-C review C1): a rejected import is not kept — the\n * next request imports again — so a chunk that failed to arrive (a deploy replaced it, the\n * network dropped) can be loaded once the cause is gone.\n */\nfunction retrying<M>(importer: () => Promise<M>): () => Promise<M> {\n let loading: Promise<M> | undefined;\n return () => {\n loading ??= importer().catch((error: unknown) => {\n loading = undefined;\n throw error;\n });\n return loading;\n };\n}\n\n/** The flow runtime's chunk (`./flow-runtime.js`), with the machine behind it. */\nexport const loadFlowRuntime = retrying(() => import('./flow-runtime.js'));\n/** The flow host's screen (`./flow-screen.js`). */\nexport const loadFlowScreen = retrying(() => import('./flow-screen.js'));\n/** A page-hosted flow's route (`./page-flow-route.js`, P6). */\nexport const loadPageFlowRoute = retrying(() => import('./page-flow-route.js'));\n/** An inline flow's host (`./inline-flow-host.js`, P6). */\nexport const loadInlineFlowHost = retrying(() => import('./inline-flow-host.js'));\n/** A bulk flow's summary (`./bulk-summary.js`). */\nexport const loadBulkSummary = retrying(() => import('./bulk-summary.js'));\n\n/** For a hover or a focus: start loading the flow runtime, never fail the event. */\nexport function preloadFlowRuntime(): void {\n void loadFlowRuntime().catch(() => undefined);\n}\n\n/** A loader's state: the module once it arrived, or its failure with a way to try again. */\nexport interface Loaded<M> {\n readonly module?: M;\n readonly error?: unknown;\n retry(): void;\n}\n\n/** @internal Loads `loader`'s module for a component; a failure is shown, never thrown. */\nexport function useLoaded<M>(loader: () => Promise<M>): Loaded<M> {\n const [attempt, setAttempt] = useState(0);\n const [state, setState] = useState<{ module?: M; error?: unknown }>({});\n useEffect(() => {\n let live = true;\n // `attempt` re-runs the import after a failure.\n void attempt;\n loader().then(\n (module) => {\n if (live) setState({ module });\n },\n (error: unknown) => {\n if (live) setState({ error });\n },\n );\n return () => {\n live = false;\n };\n }, [loader, attempt]);\n const retry = useCallback(() => {\n setState({});\n setAttempt((value) => value + 1);\n }, []);\n return { ...state, retry };\n}\n\ninterface BoundaryProps {\n readonly children: ReactNode;\n readonly fallback: (error: unknown, reset: () => void) => ReactNode;\n}\n\n/**\n * @internal A failure inside one flow's runtime stays with that flow (P4-C review C1): its\n * control or its host shows it, and the rest of the page stays.\n */\nexport class FlowBoundary extends Component<BoundaryProps, { readonly error: unknown }> {\n override state: { readonly error: unknown } = { error: undefined };\n static getDerivedStateFromError(error: unknown): { readonly error: unknown } {\n return { error: error ?? new Error('unknown') };\n }\n override componentDidCatch(error: unknown, info: ErrorInfo): void {\n if (process.env.NODE_ENV !== 'production')\n console.error('[burojs] A flow failed to render.', error, info.componentStack);\n }\n override render(): ReactNode {\n if (this.state.error !== undefined)\n return this.props.fallback(this.state.error, () => this.setState({ error: undefined }));\n return this.props.children;\n }\n}\n\ntype Translate = ReturnType<typeof useOptionalT>;\n/** \"This section could not be loaded.\" — the kit's text for a part that failed to arrive. */\nexport function loadFailedText(t: Translate): string {\n return t('block.failed', { defaultValue: 'This section could not be loaded.' });\n}\n\n/** Says a flow failed to load (or to render) once, then ends the interaction. */\nfunction FailedRun({ onDone }: { readonly onDone: () => void }): null {\n const t = useOptionalT();\n useEffect(() => {\n toast(loadFailedText(t));\n onDone();\n }, [t, onDone]);\n return null;\n}\n\n/**\n * A flow started from a control that holds no run (`FlowRunner`), once the runtime arrived. A\n * failed load or render says so and ends the interaction: the control is free again, and the\n * next click requests the runtime again.\n */\nexport function RuntimeFlowRunner(props: FlowRunnerProps): ReactElement | null {\n const loaded = useLoaded(loadFlowRuntime);\n if (loaded.error !== undefined) return <FailedRun onDone={props.onClose} />;\n if (loaded.module === undefined) return null;\n const Runner = loaded.module.FlowRunner;\n return (\n <FlowBoundary fallback={() => <FailedRun onDone={props.onClose} />}>\n <Runner {...props} />\n </FlowBoundary>\n );\n}\n\n/** An app flow's run (`AppFlowRunner`), once the runtime arrived. */\nexport function RuntimeAppFlowRunner(props: AppFlowRunnerProps): ReactElement | null {\n const loaded = useLoaded(loadFlowRuntime);\n if (loaded.error !== undefined) return <FailedRun onDone={props.onClose} />;\n if (loaded.module === undefined) return null;\n const Runner = loaded.module.AppFlowRunner;\n return (\n <FlowBoundary fallback={() => <FailedRun onDone={props.onClose} />}>\n <Runner {...props} />\n </FlowBoundary>\n );\n}\n\n/** A bulk flow's run over the selection (`BulkFlowRunner`), once the runtime arrived. */\nexport function RuntimeBulkFlowRunner(props: BulkFlowRunnerProps): ReactElement | null {\n const loaded = useLoaded(loadFlowRuntime);\n const done = useCallback(\n () => props.onFinish(Object.freeze({ outcome: 'failed' }), undefined),\n [props.onFinish],\n );\n if (loaded.error !== undefined) return <FailedRun onDone={done} />;\n if (loaded.module === undefined) return null;\n const Runner = loaded.module.BulkFlowRunner;\n return (\n <FlowBoundary fallback={() => <FailedRun onDone={done} />}>\n <Runner {...props} />\n </FlowBoundary>\n );\n}\n\n/** What a host shows when its screen failed to load or to render: the reason, Retry and Close. */\nexport function FlowLoadFailed({\n label,\n onRetry,\n}: {\n readonly label?: string;\n readonly onRetry: () => void;\n}): ReactElement {\n const t = useOptionalT();\n const chromeT = useChromeT();\n const instance = useUIInstance();\n const retryText = chromeT('actions.retry', { defaultValue: 'Retry' });\n const closeText = t('flow.close', { defaultValue: 'Close' });\n return (\n <div role=\"alert\" data-buro-flow-load=\"failed\" className=\"flex flex-col gap-3 text-sm\">\n {label === undefined ? null : <OwnTitleHeading label={label} />}\n <p>{loadFailedText(t)}</p>\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" onClick={() => instance.dismiss()}>\n {closeText}\n </Button>\n <Button type=\"button\" onClick={onRetry}>\n {retryText}\n </Button>\n </div>\n </div>\n );\n}\n","import { type I18nCaps, resolveContentSlot } from '@burojs/core';\n\n/**\n * The text of a rule's `reason`, the one way every surface shows it. A reason is either a bundle\n * key (`locks.systemManaged`) or a literal typed straight into the rule; a key that exists\n * renders its translation, anything else renders as written, with no \"Missing translation\"\n * warning (presence is probed with `has()` before anything is translated).\n */\nexport function reasonText(caps: I18nCaps, reason: string, resource?: string): string {\n if (reason === '') return reason;\n return resolveContentSlot(caps, [reason], { resource, default: reason }) ?? reason;\n}\n","'use client';\nimport type * as React from 'react';\nimport { Icon } from '../primitives/icon.js';\n\n/**\n * Icon (when set) + label, shared by the button and menu-item renderers. The\n * host (`<Button>` / `<DropdownMenuItem>`) supplies the `gap` + `[&_svg]` sizing\n * so the two surfaces stay visually consistent.\n *\n * Its own module (not folded into `action-button.tsx`) because\n * `action-control.tsx` needs it too — leaving it in `action-button.tsx` would\n * make the shared chrome resolver import from the file that renders the four\n * action kinds, a cycle waiting to happen.\n */\nexport function ActionInner({\n icon,\n label,\n}: {\n icon?: string;\n label: React.ReactNode;\n}): React.ReactElement {\n return (\n <>\n {icon ? <Icon name={icon} /> : null}\n {label}\n </>\n );\n}\n","'use client';\nimport { humanizeKey, type ActionDensity } from '@burojs/core';\nimport type { ReactElement, ReactNode } from 'react';\nimport { Icon } from '../primitives/icon.js';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../primitives/tooltip.js';\nimport { ActionInner } from './action-inner.js';\n\nexport interface ActionControlChrome {\n compact: boolean;\n size: 'sm' | 'icon';\n className: string | undefined;\n ariaLabel: string | undefined;\n content: ReactNode;\n}\n\n/** Warn once per (action, surface), not once per render. */\nconst warned = new Set<string>();\n\n/**\n * Decide what a STANDALONE action control looks like at a density.\n *\n * One place, because the four action kinds each render their own button and\n * three of them getting this right is not good enough — a link action styled\n * differently from a handler action is exactly the defect this work exists to\n * remove.\n */\nexport function resolveControlChrome(args: {\n density: ActionDensity;\n icon: string | undefined;\n label: ReactNode;\n actionName: string;\n surface: string;\n}): ActionControlChrome {\n const { density, icon, label, actionName, surface } = args;\n // A compact control IS its icon. With no icon there is nothing to draw, so\n // fall back to the readable form rather than render a control the user\n // cannot identify — and say so, or the fallback is invisible.\n if (density === 'compact' && icon == null) {\n const key = `${actionName}@${surface}`;\n if (!warned.has(key)) {\n warned.add(key);\n console.warn(\n `[buro] action \"${actionName}\" is declared 'compact' on surface \"${surface}\" but has no icon; rendering it with its label instead. Give the action an \\`icon\\`, or declare 'regular'.`,\n );\n }\n return {\n compact: false,\n size: 'sm',\n className: undefined,\n ariaLabel: undefined,\n content: <ActionInner icon={icon} label={label} />,\n };\n }\n if (density === 'compact') {\n return {\n compact: true,\n size: 'icon',\n // Matches the overflow kebab it sits beside: 28px in a table row (a\n // 32px control made a row 10px taller than its text), 32px elsewhere,\n // the height of the `size=\"sm\"` controls on a detail toolbar.\n className: surface === 'row' ? 'size-7' : 'h-8 w-8',\n ariaLabel: typeof label === 'string' ? label : humanizeKey(actionName),\n content: <Icon name={icon!} />,\n };\n }\n return {\n compact: false,\n size: 'sm',\n className: undefined,\n ariaLabel: undefined,\n content: <ActionInner icon={icon} label={label} />,\n };\n}\n\n/**\n * Wrap a compact control, or a disabled one, in its tooltip: the label, then the reason it cannot\n * run on a second, muted line. A compact control gets NO `TooltipProvider` — one provider\n * is mounted high (see `AppLayout`), because the provider owns the delay GROUP:\n * per-control providers make every icon in a column re-wait the full delay.\n */\nexport function withActionTooltip(\n control: ReactElement,\n label: ReactNode,\n compact: boolean,\n reason?: ReactNode,\n): ReactElement {\n if (!compact && reason === undefined) return control;\n const tooltip = (\n <Tooltip>\n <TooltipTrigger asChild>{control}</TooltipTrigger>\n <TooltipContent>\n {label}\n {reason === undefined ? null : <span className=\"block opacity-80\">{reason}</span>}\n </TooltipContent>\n </Tooltip>\n );\n // A labelled control shown disabled (not compact) only gained a tooltip to carry its reason, and\n // may sit outside the app's provider (a host with no `AppLayout`): it brings its own. A compact\n // control keeps relying on the shared provider for the delay group.\n return compact ? tooltip : <TooltipProvider>{tooltip}</TooltipProvider>;\n}\n","'use client';\nimport { humanizeKey, textsValueAt } from '@burojs/core';\nimport { useApp, useI18nCaps } from '@burojs/react';\nimport type { ReactNode } from 'react';\nimport { resolveActionIcon, useResolvedLabel } from '../actions/action-button.js';\n\ninterface DeclaredChrome {\n readonly kind?: string;\n readonly texts?: unknown;\n readonly label?: string;\n readonly icon?: string;\n readonly variant?: string;\n}\n\n/** The declared flow entry by name, for its label, icon and tone. */\nfunction findDeclared(\n def: { readonly actions?: unknown } | undefined,\n name: string,\n): DeclaredChrome | undefined {\n const actions = (def?.actions ?? {}) as Readonly<Record<string, unknown>>;\n for (const place of ['item', 'resource', 'bulk']) {\n const list = actions[place];\n if (!Array.isArray(list)) continue;\n const found = list.find((entry) => (entry as { name?: unknown }).name === name);\n if (found !== undefined) return found as DeclaredChrome;\n }\n return undefined;\n}\n\n/**\n * A flow's declaration, for its declared texts: an app action when `resource === ''`, else the\n * resource's flow entry. A name the registry refuses (an inline host of an app flow names its\n * target alone, with an empty name; any malformed name) has none, rather than throwing in render.\n */\nfunction declaredFlow(\n app: ReturnType<typeof useApp>,\n resource: string,\n actionName: string,\n): { readonly texts?: unknown } | undefined {\n try {\n return resource === ''\n ? app.registry.appActions.get(actionName)\n : findDeclared(app.registry.get(resource), actionName);\n } catch {\n return undefined;\n }\n}\n\n/** What a flow's confirm dialog and cancel buttons say. */\nexport interface FlowDialogTexts {\n /** The confirm dialog's heading: `<prefix>.confirm.title`, else the label. */\n readonly confirmTitle: string;\n /** The confirm dialog's proceed button: `<prefix>.confirm.proceed`, else the label. */\n readonly confirmProceed: string;\n /** Every cancel button's word: `<prefix>.dismiss`; `undefined` keeps the kit's own word. */\n readonly dismiss: string | undefined;\n}\n\n/**\n * The confirm dialog's title and proceed and the cancel buttons' word of a flow: the bundle at\n * its own prefix — `appActions.<name>` for an app flow (`resource === ''`), else\n * `resources.<resource>.actions.<name>` — probed with `has` before it is read, then the flow's\n * declared `texts`, as its label is resolved.\n */\nexport function useFlowDialogTexts(\n resource: string,\n actionName: string,\n labelText: string,\n): FlowDialogTexts {\n const app = useApp();\n // Read unscoped: the resource prefix is absolute, and an app flow's sits above every resource.\n const caps = useI18nCaps('');\n const texts = declaredFlow(app, resource, actionName)?.texts;\n const prefix =\n resource === '' ? `appActions.${actionName}` : `resources.${resource}.actions.${actionName}`;\n const own = (path: readonly string[]): string | undefined => {\n const key = `${prefix}.${path.join('.')}`;\n return caps.has(key) ? caps.t(key) : textsValueAt(texts, path);\n };\n return {\n confirmTitle: own(['confirm', 'title']) ?? labelText,\n confirmProceed: own(['confirm', 'proceed']) ?? labelText,\n dismiss: own(['dismiss']),\n };\n}\n\n/** The label, icon and tone of a flow's control, and its dialog's words. */\nexport function useFlowChrome(resource: string, actionName: string, children?: ReactNode) {\n const app = useApp();\n // A flow with no resource (an app flow, drawn by a page) asks the registry nothing.\n const declared =\n (resource === '' ? undefined : findDeclared(app.registry.get(resource), actionName)) ?? {};\n const label = useResolvedLabel(declared, actionName, children, resource);\n const labelText = typeof label === 'string' ? label : humanizeKey(actionName);\n return {\n label,\n labelText,\n icon: resolveActionIcon(declared, actionName),\n destructive: declared.variant === 'destructive',\n ...useFlowDialogTexts(resource, actionName, labelText),\n };\n}\n\nexport type FlowChrome = ReturnType<typeof useFlowChrome>;\n","'use client';\nimport { routeResourceKey } from '@burojs/core';\nimport type { ResourceNameOrRef } from '@burojs/core';\nimport type { ActionDensity, FlowControlState } from '@burojs/core';\nimport {\n conjoinHostPage,\n type FlowRowControl,\n type HostPage,\n recordKeyOf,\n useHostPage,\n useApp,\n useFlowRowResolver,\n usePresentFlow,\n useProjectedTitle,\n useTestIds,\n} from '@burojs/react';\nimport { compileFlow, flowRecordOf, hrefFor } from '@burojs/core';\nimport { IconLoader2 } from '@tabler/icons-react';\nimport { type ReactElement, type ReactNode, useMemo, useState } from 'react';\nimport { DisabledAction, makeTestId } from '../actions/action-button.js';\nimport { resolveControlChrome, withActionTooltip } from '../actions/action-control.js';\nimport { ActionInner } from '../actions/action-inner.js';\nimport { DocInfo } from '../doc/doc-info.js';\nimport { cn } from '../lib/cn.js';\nimport type { ButtonProps } from '../primitives/button.js';\nimport { Button } from '../primitives/button.js';\nimport { DropdownMenuItem } from '../primitives/dropdown-menu.js';\nimport { useLinkComponent } from '../layout/link-component.js';\nimport { type FlowChrome, useFlowChrome } from './chrome.js';\nimport { preloadFlowRuntime, RuntimeFlowRunner } from './load-runtime.js';\n\nexport interface FlowActionButtonProps<N extends string = string> {\n /** A name checked against the registered resources, or the entity ref. */\n readonly resource: ResourceNameOrRef<N>;\n /** The flow's name in the resource's `actions`. */\n readonly actionName: string;\n readonly record?: { id: string } & Record<string, unknown>;\n /** The surface (`'row'`, `'show'`, …): the test id's namespace, as `ActionButton`'s. */\n readonly scope?: string;\n readonly asMenuItem?: boolean;\n readonly density?: ActionDensity;\n readonly variant?: ButtonProps['variant'];\n readonly size?: ButtonProps['size'];\n readonly className?: string;\n readonly children?: ReactNode;\n}\n\nconst DESTRUCTIVE_ITEM =\n 'text-destructive focus:bg-destructive/10 focus:text-destructive data-[highlighted]:text-destructive';\n\ninterface FlowControlProps {\n readonly state: FlowControlState;\n readonly reason?: string;\n readonly resource: string;\n readonly actionName: string;\n readonly testid: string;\n readonly scope: string;\n readonly chrome: FlowChrome;\n readonly asMenuItem?: boolean;\n readonly density?: ActionDensity;\n readonly variant?: ButtonProps['variant'];\n readonly size?: ButtonProps['size'];\n readonly className?: string;\n /** A page-hosted flow's route: a decided control is a link to it (P6). */\n readonly href?: string;\n /** The interaction runs (the control shows the spinner and takes no click). */\n readonly active?: boolean;\n readonly onRun: () => void;\n /** A sign the user means to run it (a hover, a focus): the flow runtime starts loading. */\n readonly onIntent?: () => void;\n}\n\n/**\n * A flow's control by its state (4.14, 4.17): `undecided` and `pending` render disabled and\n * busy (a click does nothing), `disabled` the reason, `absent` nothing.\n */\nexport function FlowControl(props: FlowControlProps): ReactElement | null {\n const { state, chrome, testid, resource, actionName, scope, asMenuItem, density } = props;\n const Anchor = useLinkComponent();\n if (state === 'absent') return null;\n const buttonVariant = props.variant ?? (chrome.destructive ? 'destructive' : 'outline');\n if (state === 'disabled')\n return (\n <DisabledAction\n reason={props.reason}\n label={chrome.label}\n icon={chrome.icon}\n testid={testid}\n size={props.size}\n variant={buttonVariant}\n className={props.className}\n asMenuItem={asMenuItem}\n resource={resource}\n density={density}\n actionName={actionName}\n surface={scope}\n />\n );\n const running = state === 'running' || props.active === true;\n const busy = state === 'undecided' || state === 'pending' || running;\n // A page-hosted flow is a link to its route, so a modified click opens a tab (P6). Until the\n // control is decided it is the usual busy control, with no destination to follow.\n if (props.href !== undefined && !busy) {\n if (asMenuItem === true)\n return (\n <DropdownMenuItem asChild className={cn(chrome.destructive && DESTRUCTIVE_ITEM)}>\n <Anchor\n href={props.href}\n data-testid={testid}\n data-buro-flow-state={state}\n onClick={(event) => event.stopPropagation()}\n >\n <ActionInner icon={chrome.icon} label={chrome.label} />\n </Anchor>\n </DropdownMenuItem>\n );\n const linkChrome = resolveControlChrome({\n density: density ?? 'regular',\n icon: chrome.icon,\n label: chrome.label,\n actionName,\n surface: scope,\n });\n return withActionTooltip(\n <Button\n asChild\n variant={buttonVariant}\n size={linkChrome.size}\n aria-label={linkChrome.ariaLabel}\n className={cn(linkChrome.className, props.className)}\n >\n <Anchor\n href={props.href}\n data-testid={testid}\n data-buro-flow-state={state}\n onClick={(event) => event.stopPropagation()}\n >\n {linkChrome.content}\n </Anchor>\n </Button>,\n chrome.label,\n linkChrome.compact,\n );\n }\n if (asMenuItem === true)\n return (\n <DropdownMenuItem\n data-testid={testid}\n data-buro-flow-state={state}\n disabled={busy}\n aria-busy={busy ? 'true' : undefined}\n className={cn(chrome.destructive && DESTRUCTIVE_ITEM)}\n onFocus={props.onIntent}\n onPointerEnter={props.onIntent}\n onSelect={() => {\n if (!busy) props.onRun();\n }}\n >\n <ActionInner icon={chrome.icon} label={chrome.label} />\n </DropdownMenuItem>\n );\n const controlChrome = resolveControlChrome({\n density: density ?? 'regular',\n icon: chrome.icon,\n label: chrome.label,\n actionName,\n surface: scope,\n });\n return (\n <>\n {withActionTooltip(\n <Button\n type=\"button\"\n variant={buttonVariant}\n size={controlChrome.size}\n aria-label={controlChrome.ariaLabel}\n data-testid={testid}\n data-buro-flow-state={state}\n disabled={busy}\n aria-busy={busy ? 'true' : undefined}\n onPointerEnter={props.onIntent}\n onFocus={props.onIntent}\n onClick={() => {\n if (!busy) props.onRun();\n }}\n className={cn(controlChrome.className, props.className)}\n >\n {running ? <IconLoader2 className=\"h-4 w-4 animate-spin\" aria-hidden=\"true\" /> : null}\n {controlChrome.content}\n </Button>,\n chrome.label,\n controlChrome.compact,\n )}\n <DocInfo\n address={`${resource}/actions/${actionName}`}\n name={chrome.labelText}\n testId={`${testid}:info`}\n />\n </>\n );\n}\n\n/**\n * A flow's button or menu item (P4 spec 4.15, 4.17). The control is decided without a run — the\n * flow's gate (undecided while permissions load), the page's one batched read on a row (I8), its\n * `when` and pre-click checks — so the flow machine is not in the first screen. A hover or a\n * focus starts loading the flow runtime; the click (at the latest) starts the run, whose `with`\n * sources load then: until it has decided, the control is busy and a second click does nothing,\n * so one click sends at most once.\n */\nexport function FlowActionButton<const N extends string = string>(\n input: FlowActionButtonProps<N>,\n): ReactElement | null {\n const props = { ...input, resource: routeResourceKey(input.resource) };\n const { resource, actionName, record, scope = 'row', children } = props;\n const resolve = useFlowRowResolver(resource);\n const control = resolve(actionName, record);\n const chrome = useFlowChrome(resource, actionName, children);\n const tid = useTestIds();\n const app = useApp();\n const recordKey = String(recordKeyOf(app.registry.get(resource), record) ?? '');\n const testid = makeTestId(scope, resource, actionName, recordKey, tid);\n // From the click until the interaction is over (the runtime loading included): busy, so a\n // click during the load is neither dropped nor doubled.\n const [running, setRunning] = useState(false);\n const runRecord = useFlowRecord(resource, actionName, control.record ?? record);\n const hosted = useHostedFlow(resource, actionName, runRecord, chrome.labelText);\n const onRun = () => {\n if (running) return;\n if (hosted.pageHref !== undefined) return;\n // A flow with a form or a review opens its host, which owns the run (P4-C review I1).\n const closed = hosted.present();\n if (closed !== null) {\n setRunning(true);\n void closed.finally(() => setRunning(false));\n return;\n }\n if (!hosted.hasHost) setRunning(true);\n };\n return (\n <>\n <FlowControl\n {...props}\n state={conjoinHostPage(control.state, hosted.hostPage)}\n {...(control.reason === undefined ? {} : { reason: control.reason })}\n testid={testid}\n scope={scope}\n chrome={chrome}\n active={running}\n {...(hosted.pageHref === undefined ? {} : { href: hosted.pageHref })}\n onRun={onRun}\n onIntent={preloadFlowRuntime}\n />\n {running && !hosted.hasHost && hosted.pageHref === undefined ? (\n <RuntimeFlowRunner\n resource={resource}\n actionName={actionName}\n {...(runRecord === undefined ? {} : { record: runRecord })}\n scope={scope}\n onClose={() => setRunning(false)}\n />\n ) : null}\n </>\n );\n}\n\n/**\n * The record a flow's run receives from a control (spec 5.1): the row for an item flow, none for a\n * collection-level flow drawn on a record surface. The control's test id still names the row.\n */\nfunction useFlowRecord<T extends Readonly<Record<string, unknown>>>(\n resource: string,\n actionName: string,\n record: T | undefined,\n): T | undefined {\n const def = useApp().registry.get(resource);\n const compiled = useMemo(() => {\n try {\n return def === undefined ? null : compileFlow(def as never, actionName);\n } catch {\n return null;\n }\n }, [def, actionName]);\n // Fail closed: a flow that does not compile draws nothing, and never runs on the row.\n return compiled === null ? undefined : flowRecordOf(compiled, record);\n}\n\n/**\n * @internal A flow's host from a control: whether the flow has one, and `present()` — which opens\n * it over the record (the host starts and owns the run), or answers `null` for a flow without a\n * host (and when nothing could be presented; one development error names a missing screen).\n */\nexport function useHostedFlow(\n resource: string,\n actionName: string,\n record: Readonly<Record<string, unknown>> | undefined,\n label: string,\n): {\n readonly hasHost: boolean;\n /** The route of a page-hosted flow on this record; such a flow presents no overlay (P6). */\n readonly pageHref: string | undefined;\n /** The custom page of `host: { page }` (P7 3.15), when the flow is hosted on one. */\n readonly hostPage: HostPage | undefined;\n present(): Promise<unknown> | null;\n} {\n const app = useApp();\n const def = app.registry.get(resource);\n const compiled = useMemo(() => {\n try {\n return def === undefined ? null : compileFlow(def as never, actionName);\n } catch {\n return null;\n }\n }, [def, actionName]);\n const title = useProjectedTitle(resource, recordKeyOf(def, record), record);\n const presentFlow = usePresentFlow();\n const hasHost = compiled?.hasHost === true;\n const recordId = record?.[compiled?.idField ?? 'id'] ?? record?.id;\n const hostPage = useHostPage(compiled?.flow.host);\n const pageHref =\n hostPage !== undefined\n ? hostPage.access === 'allowed'\n ? hostPage.href\n : undefined\n : compiled?.flow.host === 'page' &&\n (typeof recordId === 'string' || typeof recordId === 'number') &&\n String(recordId) !== ''\n ? hrefFor(app.registry, resource, {\n action: 'flow',\n id: String(recordId),\n flow: actionName,\n })\n : undefined;\n return {\n hasHost,\n pageHref,\n hostPage,\n present: () =>\n !hasHost || compiled === null || pageHref !== undefined\n ? null\n : presentFlow({\n target: { resource, action: actionName },\n host: compiled.flow.host === 'sheet' ? 'sheet' : 'dialog',\n label,\n ...(record === undefined ? {} : { record }),\n ...(record === undefined || title === '' ? {} : { title }),\n }),\n };\n}\n\nexport interface FlowMenuItemProps {\n readonly resource: string;\n readonly actionName: string;\n /** Absent for a resource-level flow (the route list's toolbar). */\n readonly record?: { id: string } & Record<string, unknown>;\n readonly scope: string;\n /** The control as the menu's owner decided it (`useItemActions`). */\n readonly control: FlowRowControl;\n /** Hands the run to the menu's owner, which starts it outside the menu (`FlowRunner`). */\n readonly onRun: () => void;\n /** Another flow of this menu runs: this one is busy and takes no selection (review M4). */\n readonly active?: boolean;\n}\n\n/**\n * @internal A flow in an overflow menu (4.15): a `DropdownMenuItem` decided without a run; its\n * `onSelect` hands the flow to the menu's owner, which starts it outside the menu, so the menu\n * closes normally and no runner of the old kinds is involved.\n */\nexport function FlowMenuItem(props: FlowMenuItemProps): ReactElement | null {\n const chrome = useFlowChrome(props.resource, props.actionName);\n const tid = useTestIds();\n const def = useApp().registry.get(props.resource);\n const testid = makeTestId(\n props.scope,\n props.resource,\n props.actionName,\n String(recordKeyOf(def, props.record) ?? ''),\n tid,\n );\n const runRecord = useFlowRecord(\n props.resource,\n props.actionName,\n props.control.record ?? props.record,\n );\n const hosted = useHostedFlow(props.resource, props.actionName, runRecord, chrome.labelText);\n return (\n <FlowControl\n state={conjoinHostPage(props.control.state, hosted.hostPage)}\n {...(props.control.reason === undefined ? {} : { reason: props.control.reason })}\n resource={props.resource}\n actionName={props.actionName}\n testid={testid}\n scope={props.scope}\n chrome={chrome}\n asMenuItem\n {...(props.active === true ? { active: true } : {})}\n {...(hosted.pageHref === undefined ? {} : { href: hosted.pageHref })}\n onRun={() => {\n if (hosted.pageHref !== undefined) return;\n // A host owns its run and outlives the menu (P4-C review I1); a hostless flow runs at\n // the menu's owner.\n if (hosted.present() === null && !hosted.hasHost) props.onRun();\n }}\n onIntent={preloadFlowRuntime}\n />\n );\n}\n","import { useOptionalRouterAdapter } from '@burojs/react';\nimport { useCallback } from 'react';\n\nconst EXTERNAL_HREF = /^(?:https?:|mailto:)/i;\n\n/**\n * Whether `href` leaves the application: an absolute `http(s):` URL or a\n * `mailto:` link. Such an href is never handed to the router, which would\n * treat it as an app path. The action button and the command palette share\n * this one rule so they cannot disagree.\n */\nexport function isExternalHref(href: string): boolean {\n return EXTERNAL_HREF.test(href);\n}\n\n/**\n * Open `href` in a new window with neither an opener nor a referrer — how the\n * action button's `target: '_blank'` and the command palette's external links\n * leave the app, so the two cannot disagree on the window features either.\n */\nexport function openExternal(href: string): void {\n window.open(href, '_blank', 'noopener noreferrer');\n}\n\n/**\n * The browser URL of an app path, for a new tab or window that the router does not see: the\n * router's basename prefixed. The inverse of the navigation guard's `stripRouterBasename`: the\n * basename is `window.location.pathname` minus the trailing `currentPath` (the router's own\n * pathname). Every step falls back to `appPath` unchanged — no window, an empty `currentPath`, a\n * location that does not end with it, a basename of `''` or `/`, an external href or one that is\n * not an absolute path.\n */\nexport function toBrowserHref(appPath: string, currentPath: string): string {\n if (typeof window === 'undefined' || isExternalHref(appPath) || !appPath.startsWith('/'))\n return appPath;\n const here = window.location.pathname;\n if (currentPath === '') return appPath;\n // At the router's root the browser path is the basename itself, with or without its trailing\n // slash (`/marketplace` or `/marketplace/` for the router's `/`).\n const basename =\n currentPath === '/'\n ? here.replace(/\\/$/u, '')\n : here.endsWith(currentPath)\n ? here.slice(0, here.length - currentPath.length).replace(/\\/$/u, '')\n : undefined;\n if (basename === undefined) return appPath;\n if (basename === '') return appPath;\n return `${basename}${appPath}`;\n}\n\n/** `toBrowserHref` against the mounted router's pathname (the identity without a router). */\nexport function useToBrowserHref(): (appPath: string) => string {\n const pathname = useOptionalRouterAdapter()?.pathname;\n return useCallback(\n (appPath: string) => (pathname === undefined ? appPath : toBrowserHref(appPath, pathname)),\n [pathname],\n );\n}\n","'use client';\nimport { routeResourceKey } from '@burojs/core';\nimport type { ResourceNameOrRef, EntityRef } from '@burojs/core';\nimport { canonicalEntityNodeKey, normalizeEntityRef } from '@burojs/core';\nimport { useComponent } from '@burojs/react';\nimport type { ComponentType } from 'react';\nimport type { ResourceListProps } from '../resource/resource-list.js';\n\n/**\n * The canonical registry key of `resource`: the bare id in the default namespace (`document`),\n * `namespace:id` otherwise (`crm:deals`), so `'document'` and `'default:document'` name the same\n * slot.\n */\nexport function canonicalResourceName(resource: string): string {\n return canonicalEntityNodeKey({ name: resource, ref: normalizeEntityRef(resource) });\n}\n\n/**\n * The two override seams `<ResourceListPage>` opens on the standard list (core flexibility\n * program, Task B3.2; level 1 added by SP0 Task 5) — the \"level 1\" and \"level 2\" rungs of the\n * spec's override ladder:\n *\n * ```\n * level 0 nothing registered → the standard assembled list\n * level 1 list.cell.<r> → one column's renderer; everything else stays standard\n * level 2 list.filters.<r> → custom filter region; table/footer stay standard\n * ```\n *\n * ⚠️ **The old level 3, `list.body.<r>`, is gone (P7-37).** A whole-body override is a list frame\n * (`views.list.frame`, `defineFrame(id, { for: 'list' })`): it places the framework's pieces\n * (`<ListControls/>`, `<ListBody/>`, …) instead of replacing them, so it keeps the filters, the\n * saved views, the columns menu, URL state, selection and the bulk bar. A component still\n * registered under `list.body.<r>` is a development error at mount and a `checkApp` error\n * (`list.body-removed`), never a silent no-op.\n *\n * ⚠️ **Level 1 is reachable through the registry now, not only through a\n * prop.** `<ResourceList renderCell>` / `<ResourceListPage renderCell>` still\n * work — an explicit prop wins over the registered slot — but neither is\n * reachable through the standard `NavAreaPage` router, which mounts\n * `<ResourceListPage resource={...} />` with no props at all. Before this,\n * an adopter who wanted one column rendered as a badge had no way to reach\n * that router and had to replace the whole list body instead, trading away\n * filters, the columns menu, saved views and URL state to repaint a single\n * cell. `list.cell.<r>` closes that gap the same way `list.filters.<r>` does.\n *\n * ⚠️ **`list.cell.<r>` never sees a column `<ResourceListPage>`'s OWN\n * built-in branches already claimed.** A column with a declared `enum`\n * gets the framework's `<EnumBadge>`, and a typed resource's discriminator column\n * gets its label/badge, BEFORE either the `renderCell` prop or the\n * `list.cell.<r>` slot is consulted — same as the pre-Task-5 behaviour for\n * the prop. The registered renderer's function is simply never called for\n * those columns; it does not get a chance to answer, let alone override.\n * This is the genuinely surprising half of the contract, so it is\n * exercised explicitly in `tests/list-cell-slot.test.tsx`.\n *\n * ⚠️ **Polling is no longer a reason to write a list frame.** A list that needs\n * fresh data declares `views.list.refetchInterval` (`@burojs/core`); the\n * controller resolves it into a `live` slice and `<ResourceListPage>` renders\n * the pause toggle. Every adopter surface that replaced the body *only* to get a\n * `refetchInterval` gave up filters, the columns menu, saved views and URL state to buy one\n * option it can now declare.\n *\n * ⚠️ **Slots are registered through the Components registry, NOT on\n * `ResourceConfig`.** `packages/core` declares `dependencies: {}` and\n * imports React nowhere, and `ResourceViews` is non-generic — an inline\n * `ComponentType` on the config would both drag React into core and lose\n * `TRecord` inference. The registry's keys are dotted with the canonical\n * resource last (`list.<region>.<resource>`, `record.<action>.<resource>`,\n * `layout.<key>`), and they need zero core changes.\n *\n * @see docs/specs/core-flexibility-overview.md §3\n * @see docs/superpowers/plans/2026-07-26-cfb3-assembled-page-slots.md — Task B3.2\n */\n\n/**\n * Which region of the assembled list page a slot replaces.\n *\n * - `'cell'` — a single column's renderer, consulted per cell. Everything\n * else — filters, saved views, the columns menu, the table chrome,\n * pagination — stays standard. See {@link ListCellRenderer}.\n * - `'filters'` — the filter region only (search box + dynamic filter chips\n * + \"+ Add filter\"). Saved views, the columns toggle, the create button,\n * the table, the footer and pagination all stay standard.\n */\nexport type ListSlotRegion = 'filters' | 'cell';\n\n/**\n * A list slot component. It takes **no props**: everything it needs — rows,\n * query state, filters, sorting, columns, selection, saved views, hrefs —\n * comes from `useResourceListContext()` (`@burojs/react`).\n *\n * That is deliberate, and it is what makes a slot cheap to unit-test:\n * mount it under `<ResourceListProvider value={handWrittenStub}>` and it\n * renders with no `BuroProvider` or other app-level provider, no data\n * provider, and no `next/navigation` mock. A prop-carried controller\n * would also participate in the memo\n * comparisons the table's render-perf work depends on.\n */\nexport type ListSlot = ComponentType<Record<string, never>>;\n\n/**\n * A registered `list.cell.<resource>` renderer — level 1 of the ladder. It\n * is a FUNCTION, not a component: it must be able to answer \"render this\n * column the default way\" for a column it doesn't care about, and a\n * component gives no such distinguishable answer without being rendered.\n * Returning `undefined` is that answer, exactly like `<ResourceList\n * renderCell>` — this type is that same prop's signature, derived rather\n * than retyped so the two contracts cannot drift.\n *\n * Hooks still work inside a cell: the renderer returns JSX of its own\n * component, which mounts and runs its own hooks normally (the pattern\n * L2's `DeviceName` already uses).\n */\nexport type ListCellRenderer = NonNullable<ResourceListProps['renderCell']>;\n\n/**\n * Components-registry slot key for one region of a resource's list page.\n *\n * ```tsx\n * <BuroProvider components={{ [listSlot('filters', 'code_code')]: CodeFilterRegion }}>\n * ```\n *\n * The key is `list.<region>.<resource>` with the resource canonicalised, as\n * `canonicalResourceName` does: the bare id in the default namespace (`order` and\n * `default:order` name the same slot), `namespace:id` otherwise\n * (`list.cell.crm:deals`). Typing `region` as a union rather than a free\n * string is the point of the helper — a typo'd slot key is otherwise a\n * silent no-op, which is precisely how registry slots fail.\n */\nexport function listSlot(region: ListSlotRegion, resource: string): string {\n return `list.${region}.${canonicalResourceName(resource)}`;\n}\n\n/**\n * Resolve the component (or, for `'cell'`, the renderer FUNCTION) registered\n * for one list region of `resource`, or `undefined` when the adopter\n * registered none (the level-0 path — the overwhelmingly common case, and\n * the one every existing e2e spec covers).\n *\n * ⚠️ Overloaded, not a single `ListSlot | undefined` return, on purpose:\n * `'cell'` stores a {@link ListCellRenderer} — a 3-arg function, not a\n * no-props component — and this hook is exported for app dispatchers to\n * call directly. A single widened return type would let `useListSlot('cell',\n * r)`'s result typecheck as `<Slot />`, which compiles and then explodes at\n * render (a component invoked as a 3-arg function, or vice versa). The\n * `'filters'` overload's contract is byte-identical to before this\n * region existed.\n */\nexport function useListSlot<const N extends string = string>(\n region: 'cell',\n resource: ResourceNameOrRef<N>,\n): ListCellRenderer | undefined;\nexport function useListSlot<const N extends string = string>(\n region: 'filters',\n resource: ResourceNameOrRef<N>,\n): ListSlot | undefined;\nexport function useListSlot(\n region: ListSlotRegion,\n resource: string | EntityRef,\n): ListSlot | ListCellRenderer | undefined {\n return useComponent<ListSlot | ListCellRenderer>(listSlot(region, routeResourceKey(resource)));\n}\n","'use client';\nimport { isBuiltinItemAction, recordEntries } from '@burojs/core';\nimport { useApp, useEntryGate, useQuick, useQuickEntry } from '@burojs/react';\nimport { canonicalResourceName } from '../list-kit/list-slots.js';\n\n/** Where the built-in Edit of a record leads (spec 4.3, 4.5, 4.9). */\nexport type BuiltinEditRoute =\n /** Any other link action, or the built-in Edit with an edit page: the link as today. */\n | { readonly kind: 'link' }\n /** The record's `quick.edit`: a button, never an anchor. */\n | { readonly kind: 'quick'; open(): void }\n /** Neither an edit page nor a quick edit: the built-in Edit is not drawn. */\n | { readonly kind: 'none' };\n\nconst LINK: BuiltinEditRoute = Object.freeze({ kind: 'link' });\nconst NONE: BuiltinEditRoute = Object.freeze({ kind: 'none' });\n\nfunction sameResource(a: string, b: string): boolean {\n try {\n return canonicalResourceName(a) === canonicalResourceName(b);\n } catch {\n return false;\n }\n}\n\n/**\n * The built-in Edit resolved by `recordEntries` (plan ruling 5): inside a quick entry showing the\n * same record it opens `quick.edit` — in place when that entry has the overlay's host, as a new\n * overlay above it otherwise; on a resource without an edit page it opens `quick.edit` anywhere\n * (a row menu included); with neither entry it is not drawn. Every other link action, and the\n * built-in Edit of a resource with an edit page outside its quick entry, stays a link.\n */\nexport function useBuiltinEditRoute(\n action: unknown,\n resource: string,\n recordId: unknown,\n): BuiltinEditRoute {\n const app = useApp();\n const entry = useQuickEntry();\n const quick = useQuick();\n const gate = useEntryGate();\n if (!isBuiltinItemAction(action, 'edit')) return LINK;\n const def = app.registry.get(resource);\n if (def === undefined) return LINK;\n const entries = recordEntries(def);\n const id = recordId === null || recordId === undefined ? '' : String(recordId);\n const top = entry?.stack.top;\n const inOwnShow =\n entry !== null &&\n top !== undefined &&\n top.mode === 'show' &&\n top.recordId === id &&\n sameResource(top.resource, resource);\n if (inOwnShow && entries.quick.edit !== null) {\n if (entries.quick.edit === entry.host)\n return {\n kind: 'quick',\n open: () => {\n // The same entry gate every opener asks (a rule may deny edit on this row).\n if (gate(resource, 'edit').state !== 'open') return;\n // Unsaved input in the sheet (an inline flow's form) asks first (P6 3.12).\n entry.scope.request(() => entry.stack.replaceTop({ ...top, mode: 'edit' }));\n },\n };\n return { kind: 'quick', open: () => void quick.edit(resource, id) };\n }\n if (entries.page.edit) return LINK;\n if (entries.quick.edit === null) return NONE;\n return { kind: 'quick', open: () => void quick.edit(resource, id) };\n}\n","'use client';\nimport { actionWhenHolds, actionWhenSources, isFlowAction } from '@burojs/core/internal';\nimport type {\n Action,\n ActionDensity,\n ActionLink,\n ActionModal,\n Availability,\n EntityRef,\n ResourceHandle,\n ResourceNameOrRef,\n ScreenSources,\n} from '@burojs/core';\nimport {\n declaredText,\n hasRecordPage,\n humanizeKey,\n isBuiltinItemAction,\n normalizeEntityRef,\n resolveContentSlot,\n routeResourceKey,\n} from '@burojs/core';\nimport {\n buildDI,\n recordKeyOf,\n resolveRoute,\n useActionWhenSources,\n useApp,\n useAvailabilityResolver,\n useI18nCaps,\n useTestIds,\n usePresentBlock,\n} from '@burojs/react';\nimport { useEffect, useId } from 'react';\nimport { FlowActionButton } from '../flows/flow-action-button.js';\nimport { useLinkComponent } from '../layout/link-component.js';\nimport { cn } from '../lib/cn.js';\nimport { isExternalHref, useToBrowserHref } from '../lib/external-href.js';\nimport { reasonText } from '../lib/reason-text.js';\nimport { toast } from '../notification/toaster.js';\nimport { Button, type ButtonProps } from '../primitives/button.js';\nimport { DropdownMenuItem } from '../primitives/dropdown-menu.js';\nimport { resolveControlChrome, withActionTooltip } from './action-control.js';\nimport { useBuiltinEditRoute } from './builtin-edit-route.js';\nimport { ActionInner } from './action-inner.js';\nimport { modeForSurface } from './action-surface.js';\n\nexport interface ActionButtonProps<N extends string = string> {\n /** A name checked against the registered resources, or the entity ref. */\n resource: ResourceNameOrRef<N>;\n actionName: string;\n record?: { id: string } & Record<string, unknown>;\n /**\n * Surface the button renders on — drives the testid namespace so the same\n * action on different surfaces gets distinct, addressable testids:\n * - `'row'` → `list-row-action:<res>:<id>:<name>` (list-row menu)\n * - anything else → `form-action:<res>:<scope>:<name>` (a detail toolbar,\n * e.g. `'show'` / `'edit'` / `'list'`, or an adopter's own panel name)\n * A plain `string`, not a closed union: the core's surface vocabulary\n * (`ActionSurfaces`) is an augmentable interface, so an adopter panel passes\n * its own name and still gets a correctly namespaced testid. `show` and\n * `edit` deliberately differ so the same \"declared once, everywhere\" action\n * never produces a duplicate testid across the two detail toolbars.\n */\n scope?: string;\n variant?: ButtonProps['variant'];\n /**\n * Ignored on the STANDALONE enabled path: a standalone control's size is\n * owned by `density` (via `resolveControlChrome`'s `chrome.size`), not by\n * this prop, so a caller passing `size` alongside `density` sees `density`\n * win. It still applies on the DENIED path (`<DisabledAction>`, `size ??\n * chrome.size`) — a denied action falls back to the same density-derived\n * size only when `size` is left unset. No in-repo caller currently passes\n * `size` to a standalone action.\n */\n size?: ButtonProps['size'];\n /**\n * How prominent the STANDALONE control is — `'compact'` renders just the\n * icon (with a tooltip carrying the label), `'regular'` renders icon +\n * label. Ignored in `asMenuItem` mode: a menu item is always icon + label,\n * regardless of density. Defaults to `'regular'` so every caller that\n * predates this prop — none of which know about density — renders exactly\n * as it did before. `ActionOverflow` is the one caller that supplies a\n * real value, from `ResolvedItemAction.density`.\n */\n density?: ActionDensity;\n className?: string;\n children?: React.ReactNode;\n /**\n * Render the action as a `<DropdownMenuItem>` (icon + label) instead of a\n * standalone `<Button>`, for use inside an overflow `…` menu. Links navigate,\n * modal actions open through the framework's `UIPresentationRuntime`\n * (`useUIPresent`), and a flow hands its run to a runner outside the menu.\n * Destructive actions get destructive item styling.\n */\n asMenuItem?: boolean;\n /**\n * The sources of the screen the button is drawn on (a record screen's header or frame:\n * `FormController.sources`), which the action's `when` reads before its own `record`, `scope`,\n * `user` and `route` (T4 D9 part 4: the screen's win where both have one, except `record`,\n * which stays the action's own unprojected row; the action's fill the rest). The screen loads\n * what its item actions' `when`s read (its show and edit demand them), never waiting on it. Absent in\n * a record's menu: a `when` there reads the action's own four only, and a ref to any other\n * source leaves it undecided, which hides the action.\n */\n sources?: ScreenSources;\n}\n\n/**\n * A denial the rule asked to SHOW.\n *\n * Deliberately not natively `disabled`: a disabled element takes no focus and\n * fires no events, so a keyboard or screen-reader user would get no\n * explanation at all. It stays focusable, says `aria-disabled`, and swaps its\n * behaviour for a toast — which is also why the explanation is a toast and not\n * a tooltip: the click is already intercepted, so one path serves mouse,\n * keyboard and assistive tech alike.\n *\n * Shared by every leaf renderer (`LinkActionButton` / `ModalActionButton` /\n * the flow button) rather than reimplemented in each — one component, both shapes (`asMenuItem` switches between a standalone\n * `<Button>` and a `<DropdownMenuItem>`).\n *\n * Exported (not a package-private leaf) because a `disabled` `Availability` is\n * a general affordance, not something specific to the built-in action-button\n * plumbing: a host rendering its OWN gated control (a connected show page's\n * hand-rolled Edit/Delete, say) needs the identical focusable-but-inert +\n * toast-on-click behaviour, and copying it into app code would fork the one\n * place accessibility for a denied action is decided.\n */\nexport interface DisabledActionProps<N extends string = string> {\n reason?: string;\n label: React.ReactNode;\n icon?: string;\n /** Optional: not every denied affordance is addressed by a test. */\n testid?: string;\n size?: ButtonProps['size'];\n variant?: ButtonProps['variant'];\n className?: string;\n asMenuItem?: boolean;\n /**\n * Resource the denial belongs to — scopes the reason/fallback key lookup the\n * same way the record form's field-lock reason is scoped, so a resource can\n * override the generic wording via `resources.<res>.<key>`.\n */\n resource?: ResourceNameOrRef<N>;\n /**\n * Density for the STANDALONE control (ignored for `asMenuItem`, which is\n * always icon + label). Defaults to `'regular'`, so every caller that\n * predates this prop keeps rendering exactly as before. A denied action\n * must render at the SAME density its enabled sibling would — a compact\n * row action that becomes denied must stay compact, or the toolbar\n * reflows the instant a rule denies it.\n */\n density?: ActionDensity;\n /**\n * Identifies the action for the compact-with-no-icon warning and as the\n * aria-label fallback when `label` isn't a plain string. Only meaningful\n * with `density: 'compact'`.\n */\n actionName?: string;\n /** Surface name, for the same no-icon warning key `resolveControlChrome` keys on. */\n surface?: string;\n}\n\nexport function DisabledAction<const N extends string = string>({\n reason,\n label,\n icon,\n testid,\n size,\n variant,\n className,\n asMenuItem,\n resource: resourceInput,\n density = 'regular',\n actionName,\n surface,\n}: DisabledActionProps<N>): React.ReactElement {\n const resource = resourceInput === undefined ? undefined : routeResourceKey(resourceInput);\n // A rule's `reason` may be a bundle key (`locks.systemManaged`) or a plain-\n // English literal typed straight into the rule — the same duality\n // the record form's field-lock reason resolves via `resolveContentSlot`\n // (see record/record-screen.tsx). `t(reason, { defaultValue: reason })` looked\n // equivalent but ISN'T: this facade's `t()` never implemented i18next's\n // `defaultValue` (see `useOptionalT`'s own doc comment) — a plain-English\n // reason has no bundle entry, so every render both `console.warn`s a\n // \"missing translation\" and returns the raw key it was just warned about,\n // by accident landing on the right text. `resolveContentSlot` probes\n // presence with `has()` first and only falls back to the literal when\n // there truly is no bundle entry — silent, and the identical mechanism the\n // lock-reason path already uses.\n const i18nCaps = useI18nCaps(resource);\n const text = reason\n ? reasonText(i18nCaps, reason, resource)\n : resolveContentSlot(i18nCaps, ['availability.denied'], {\n resource,\n default: \"This action isn't available\",\n });\n const onClick = (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n toast(text);\n };\n // A menu has no room for the toolbar's tooltip: the item names its reason on a second line and\n // points `aria-describedby` at it, so the reason is read before anyone activates the item.\n const reasonId = useId();\n if (asMenuItem) {\n return (\n <DropdownMenuItem\n aria-disabled=\"true\"\n aria-describedby={reasonId}\n data-testid={testid}\n onSelect={(e) => e.preventDefault()}\n onClick={onClick}\n className=\"opacity-60\"\n >\n <ActionInner\n icon={icon}\n label={\n <span className=\"flex min-w-0 flex-col\">\n <span>{label}</span>\n <span id={reasonId} className=\"text-xs text-muted-foreground\">\n {text}\n </span>\n </span>\n }\n />\n </DropdownMenuItem>\n );\n }\n const chrome = resolveControlChrome({\n density,\n icon,\n label,\n actionName: actionName ?? testid ?? '',\n surface: surface ?? 'unknown',\n });\n return withActionTooltip(\n <Button\n type=\"button\"\n size={size ?? chrome.size}\n variant={variant ?? 'outline'}\n className={cn(chrome.className, className)}\n data-testid={testid}\n aria-disabled=\"true\"\n aria-label={chrome.ariaLabel}\n onClick={onClick}\n >\n {chrome.content}\n </Button>,\n label,\n chrome.compact,\n text,\n );\n}\n\n/** Destructive `<DropdownMenuItem>` styling (mirrors shadcn's convention). */\nconst DESTRUCTIVE_ITEM =\n 'text-destructive focus:bg-destructive/10 focus:text-destructive data-[highlighted]:text-destructive';\n\n/**\n * Default glyphs for framework-known action names, keyed by the camelized\n * action name (same normalization the i18n lookup uses). An explicit\n * `action.icon` always wins; this only fills the gap so e.g. `audit-log`\n * renders with an icon without every resource definition repeating it.\n * Values are names in the `<Icon>` registry (`primitives/icon.tsx`).\n */\nconst DEFAULT_ACTION_ICONS: Record<string, string> = {\n create: 'Plus',\n edit: 'Pencil',\n delete: 'Trash2',\n show: 'Eye',\n auditLog: 'ScrollText',\n refresh: 'RefreshCw',\n copy: 'Copy',\n cancel: 'X',\n};\n\n/** `action.icon` → framework default for known action names → none. */\n/** @internal The action's icon, or the framework default for a known name. */\nexport function resolveActionIcon(\n action: { icon?: string },\n actionName: string,\n): string | undefined {\n return action.icon ?? DEFAULT_ACTION_ICONS[camelizeActionName(actionName)];\n}\n\n/**\n * Action names are authored in kebab / snake case (`audit-log`, `write_off`)\n * while the i18n bundle keys them in camelCase (`actions.auditLog`). Normalize\n * so a framework-known action resolves its translation without the app having\n * to hardcode an English `label`.\n */\nfunction camelizeActionName(actionName: string): string {\n return actionName.replace(/[-_]+([a-zA-Z0-9])/g, (_m, c: string) => c.toUpperCase());\n}\n\n/**\n * Resolve the action's display label:\n * `children` → `resources.<r>.actions.<name>[.label]` → the declared label (`texts`, else `label`)\n * → `actions.<name>[.label]` along `resources._` and `common` (also under the\n * camel-cased name) → humanized.\n *\n * The resource's own bundle entry wins over `action.label`; the shared\n * `resources._` and the framework's `common` bundle answer only for an action\n * that declares no label, so framework-known actions (edit / delete /\n * audit-log / …) without one render in the active locale, and an action named\n * like one (`cancel`) with its own label keeps it.\n */\n/** @internal Shared with the flow button (`flows/flow-action-button.tsx`). */\nexport function useResolvedLabel(\n action: { readonly kind?: string; readonly label?: string; readonly texts?: unknown },\n actionName: string,\n children: React.ReactNode,\n /**\n * ⚠️ REQUIRED for the precedence documented below to actually happen.\n *\n * This called `useI18nCaps()` with no resource, so `boundResource` was\n * whatever ambient `ResourceContext` happened to be — undefined in a list\n * row menu — and only the shared `common` bundle was ever searched. The\n * per-resource entry the comment promises could not win because it was\n * never looked at.\n *\n * The visible consequence: `document_document` defines\n * `actions.cancel: «Revoke»` (cancel THE DOCUMENT), and every row menu\n * rendered the framework's `actions.cancel: «Cancel»` — the word this app\n * uses everywhere else for \"dismiss this dialog\" — in the first slot of the\n * menu, where a mis-click lands.\n */\n resource: string,\n): React.ReactNode {\n const caps = useI18nCaps(resource);\n if (children != null) return children;\n // Precedence (i18n content model): a PER-RESOURCE bundle entry wins — an app\n // that supplies `resources.<res>.actions.<name>` gets its translation, exactly\n // like field labels win over `f.label`. Absent that, an EXPLICIT `label` in the\n // resource config wins (adopter control — `{ name: 'ship', label: 'Dispatch' }`\n // is never silently overridden by a generic framework default). Only then do\n // the shared `resources._` entry and framework-known actions (create/edit/\n // delete/auditLog…) in the `common` bundle answer, in the active locale.\n // `useI18nCaps` re-resolves on locale change, so this label flips live\n // without a reload.\n //\n // The per-resource keys are probed ABSOLUTE: a relative `actions.<name>` walks\n // `resources.<res>` → `resources._` → `common`, so an action named like a\n // framework action (`cancel`, `delete`, `save`…) would get the framework's\n // word before its own `label` (\"Cancel\" over \"Cancel order\").\n const raw = `actions.${actionName}`;\n const own = `resources.${resource}.${raw}`;\n // Each pair is ONE entry in two spellings: a shorthand in the active locale beats `.label` in\n // a fallback locale (`resolveContentSlot` groups them).\n const ownLabel = resolveContentSlot(caps, [[`${own}.label`, own]]);\n if (ownLabel !== undefined) return ownLabel;\n // The declared label (its `texts`) arrives from adopter code: only a\n // non-empty string can be shown.\n const declared = declaredText(action.kind === 'flow' ? 'flow' : 'action', action, 'label');\n if (declared !== undefined) return declared;\n const sharedLabel = resolveContentSlot(caps, [[`${raw}.label`, raw]]);\n if (sharedLabel !== undefined) return sharedLabel;\n const camel = `actions.${camelizeActionName(actionName)}`;\n if (caps.has(camel)) return caps.t(camel);\n return humanizeKey(actionName);\n}\n\nfunction findAction(actions: unknown, name: string): Action | undefined {\n if (!Array.isArray(actions)) return undefined;\n return (actions as Action[]).find((a) => 'name' in a && a.name === name);\n}\n\n/** The props past `ActionButton`'s entry: the resource as its canonical key. */\ntype ResolvedActionButtonProps = Omit<ActionButtonProps, 'resource'> & {\n readonly resource: string;\n};\n\nfunction actionResourceHandle(resource: string): ResourceHandle {\n return { kind: 'resource', ref: normalizeEntityRef(resource) };\n}\n\nexport function ActionButton<const N extends string = string>(\n input: ActionButtonProps<N>,\n): React.ReactElement | null {\n const { sources, ...rest } = input;\n const props = { ...rest, resource: routeResourceKey(input.resource) };\n const app = useApp();\n const def = app.registry.get(props.resource);\n // ONE gate, replacing the old `useCapability('run', …)`. Same engine — the\n // deny-wins rule engine that also locks form fields, so \"approve is only\n // available in draft\" lives next to \"status is immutable\" in one rules\n // list — but it now also answers \"the rule wants this shown, disabled, with\n // a reason\", which the previous code computed (via `runnable.reason`) and\n // threw away, always rendering `null` on any denial. Called before any\n // early return so hook order is stable.\n //\n // Resolved with the SAME mode `ActionOverflow` uses for this button's\n // surface — via the shared `modeForSurface`, not a second copy of the\n // mapping — and not `useAvailability`'s hard-coded 'list' default. The\n // container decides whether its menu should exist by asking about\n // 'show'/'edit'; if this child asked with a different mode, a rule that\n // branches on `ctx.mode` would make the two disagree, and the container\n // would render a menu whose item then vanishes (the Task 11 bug, one level\n // down). `useAvailabilityResolver` directly rather than extending\n // `useAvailability` with a mode parameter: this is the only call site that\n // needs one, and the public one-operation hook stays as small as it was.\n const scope = props.scope ?? 'row';\n const resolveAvailability = useAvailabilityResolver(props.resource, modeForSurface(scope));\n const itemAction = findAction(def?.actions?.item, props.actionName);\n const action = itemAction ?? findAction(def?.actions?.resource, props.actionName);\n // A collection-level action (`actions.resource`) reads no record, wherever it is drawn (spec\n // 5.1, decision 1): its availability, its `when` and its `to` decide as on the list.\n const record = itemAction === undefined ? undefined : props.record;\n const availability = resolveAvailability(props.actionName, record);\n // What a link's or a modal's `when` reads (7c.6): the hook `useItemActions` uses too.\n const whenSources = useActionWhenSources({ resource: props.resource, record });\n if (!action) return null;\n // A flow (P4-C): its own button runs the flow's gate, sources and pre-click checks, and\n // presents its host; the availability above is the old kinds' gate. The flow button drops the\n // record of a collection-level flow itself (`flowRecordOf`) and keeps the row's test id.\n if (isFlowAction(action)) return <FlowActionButton {...props} />;\n // `absent` and `hidden` render identically — nothing here depends on WHY.\n // Actions default to allowed: a resource with no rules keeps every action,\n // and only an explicit `deny` with no `fallback: 'disable'` hides one.\n if (availability.state === 'absent' || availability.state === 'hidden') return null;\n // `when` (P4, 7c.6): a portable condition over the record, the scope, the user and the route,\n // and on a screen's header the screen's own sources (T4 C42) — a link or modal shows only while\n // it holds. Undecided (a source absent or pending) hides it: a control shown on no information\n // is the worse failure. The core reading `useItemActions` shares, so the list and the button\n // cannot disagree.\n if (!actionWhenHolds(action, actionWhenSources(whenSources, sources))) return null;\n if (action.kind === 'link') {\n return (\n <LinkActionButton\n {...props}\n record={record}\n action={action as ActionLink}\n availability={availability}\n />\n );\n }\n if (action.kind === 'modal') {\n return (\n <ModalActionButton\n {...props}\n record={record}\n action={action as ActionModal}\n availability={availability}\n />\n );\n }\n return null;\n}\n\n/** The one place a `modal` action's presentation payload is built. Shared by the button and by the menu's runner so the two cannot drift. */\nfunction presentModalAction(args: {\n present: ReturnType<typeof usePresentBlock>;\n action: ActionModal;\n resource: string;\n actionName: string;\n record: Record<string, unknown>;\n recordId: string;\n label: React.ReactNode;\n}): void {\n const { present, action, resource, actionName, record, recordId, label } = args;\n // A modal presents its block (P7 3.16). The row rides along for the screen to read projected\n // and to bind `ref('record', …)` from; the activation names THIS record, so a block that\n // reads `activation.surface` knows which record it was opened for.\n const result = present({\n block: action.block,\n props: action.props ?? {},\n resource,\n record,\n host: action.host === 'sheet' ? 'sheet' : 'dialog',\n ...(typeof label === 'string' ? { label } : {}),\n activation: {\n surface: {\n type: 'item',\n resource: normalizeEntityRef(resource),\n recordId,\n record,\n },\n },\n });\n // `present()` can fail (a disposed runtime, an invalid request). Loud by default: a click that\n // does nothing and says nothing is the worst way to learn a host is missing.\n if (!result.ok) {\n // eslint-disable-next-line no-console\n console.error(\n `[buro/ui-shadcn] modal action \"${actionName}\" failed to open block \"${action.block.namespace}:${action.block.id}\": ${result.code}`,\n );\n }\n}\n\n/** @internal Shared with the flow button: the same test id for the same surface. */\nexport function makeTestId(\n scope: string,\n resource: string,\n actionName: string,\n recordId: string,\n tid: ReturnType<typeof useTestIds>,\n): string {\n if (scope === 'row') return tid.listRowAction(resource, recordId, actionName);\n // A resource-level flow on the route list's toolbar has no record (P7-31).\n if (scope === 'list' && recordId === '') return tid.listFlow(resource, actionName);\n // Every other surface (show / edit / list / an adopter's own panel name)\n // shares the form-action namespace, keyed by the surface so the same\n // action gets a distinct testid per toolbar.\n return tid.formAction(resource, scope, actionName);\n}\n\nconst reportedDeadRoutes = new Set<string>();\n\n/** The record route an authored link action names on a resource that has no such page. */\nfunction deadRecordRoute(\n registry: ReturnType<typeof useApp>['registry'],\n action: ActionLink,\n to: unknown,\n): { readonly resource: string; readonly action: 'show' | 'edit' | 'create' } | null {\n if (isBuiltinItemAction(action) || to === null || typeof to !== 'object') return null;\n const target = to as { readonly resource?: unknown; readonly action?: unknown };\n if (target.action !== 'show' && target.action !== 'edit' && target.action !== 'create')\n return null;\n let resource: string;\n let def: ReturnType<typeof registry.get>;\n try {\n // A name, or an entity ref read as its key.\n if (typeof target.resource === 'string') resource = target.resource;\n else if (target.resource !== null && typeof target.resource === 'object')\n resource = routeResourceKey(target.resource as EntityRef);\n else return null;\n def = registry.get(resource);\n } catch {\n return null;\n }\n if (def === undefined || hasRecordPage(def, target.action)) return null;\n return { resource, action: target.action };\n}\n\nfunction reportDeadRecordRoute(name: string, resource: string, action: string): void {\n if (process.env.NODE_ENV === 'production') return;\n const key = `${name}\\u0000${resource}\\u0000${action}`;\n if (reportedDeadRoutes.has(key)) return;\n reportedDeadRoutes.add(key);\n console.error(\n `[burojs] The action \"${name}\" links to ${resource}'s ${action} page, and ${resource} has none (views.show.page: false).`,\n );\n}\n\n/**\n * A `link` action: navigation, no write. Since P4 it carries no `confirm` and no check gate — a\n * check naming a link is refused at registration (`flow.check-on-non-flow`) — so the control\n * is an anchor: internal hrefs go through the adopter's `LinkComponent` (client-side), external\n * or `_blank` ones are plain anchors (a real document load, the router's basename kept).\n */\nfunction LinkActionButton({\n resource,\n actionName,\n record,\n scope = 'row',\n variant,\n size,\n density,\n className,\n children,\n asMenuItem,\n action,\n availability,\n}: ResolvedActionButtonProps & {\n action: ActionLink;\n availability: Availability;\n}): React.ReactElement | null {\n const tid = useTestIds();\n // The registry, so the target's path is DERIVED rather than guessed as\n // `/${resource}` — see `resolveRoute`.\n const app = useApp();\n // A new tab is outside the router: its URL keeps the router's basename.\n const toBrowser = useToBrowserHref();\n const safeRecord = (record ?? { id: '' }) as Record<string, unknown>;\n const isDestructive = action.variant === 'destructive';\n const buttonVariant = variant ?? (isDestructive ? 'destructive' : 'outline');\n const recordId = String(recordKeyOf(app.registry.get(resource), record) ?? '');\n const testid = makeTestId(scope, resource, actionName, recordId, tid);\n const label = useResolvedLabel(action, actionName, children, resource);\n // The built-in Edit opens the record's quick edit where it has one to open (P3).\n const editRoute = useBuiltinEditRoute(action, resource, recordId);\n\n const to =\n typeof action.to === 'function'\n ? action.to(buildDI(actionResourceHandle(resource), safeRecord))\n : action.to;\n const href = resolveRoute(to, app.registry);\n const target = action.target ?? '_self';\n // An authored link to a record route of a resource without record pages resolves to a\n // not-found route; the checker cannot see a route function, so say it here (spec 4.7).\n const deadPage = deadRecordRoute(app.registry, action, to);\n const deadResource = deadPage?.resource;\n const deadAction = deadPage?.action;\n useEffect(() => {\n if (deadResource !== undefined && deadAction !== undefined)\n reportDeadRecordRoute(actionName, deadResource, deadAction);\n }, [deadResource, deadAction, actionName]);\n const rel = target === '_blank' ? 'noopener noreferrer' : undefined;\n\n const RouterLink = useLinkComponent();\n const isExternal = target === '_blank' || isExternalHref(href);\n const Anchor = isExternal ? 'a' : RouterLink;\n // A plain `<a target=\"_blank\">` is followed by the browser, not the router: its href keeps the\n // router's basename (an external href is unchanged).\n const anchorHref = target === '_blank' ? toBrowser(href) : href;\n\n if (editRoute.kind === 'none') return null;\n\n if (availability.state === 'disabled') {\n return (\n <DisabledAction\n reason={availability.reason}\n label={label}\n icon={resolveActionIcon(action, actionName)}\n testid={testid}\n size={size}\n variant={buttonVariant}\n className={className}\n asMenuItem={asMenuItem}\n resource={resource}\n density={density}\n actionName={actionName}\n surface={scope}\n />\n );\n }\n\n // The built-in Edit opening a quick edit: a button (a menu item), never an anchor — there is\n // no page to open in a new tab, or the entry opens in place (P3).\n if (editRoute.kind === 'quick') {\n if (asMenuItem)\n return (\n <DropdownMenuItem data-testid={testid} onSelect={() => editRoute.open()}>\n <ActionInner icon={resolveActionIcon(action, actionName)} label={label} />\n </DropdownMenuItem>\n );\n const quickChrome = resolveControlChrome({\n density: density ?? 'regular',\n icon: resolveActionIcon(action, actionName),\n label,\n actionName,\n surface: scope,\n });\n return withActionTooltip(\n <Button\n type=\"button\"\n variant={buttonVariant}\n size={quickChrome.size}\n aria-label={quickChrome.ariaLabel}\n className={cn(quickChrome.className, className)}\n data-testid={testid}\n onClick={(e) => {\n e.stopPropagation();\n editRoute.open();\n }}\n >\n {quickChrome.content}\n </Button>,\n label,\n quickChrome.compact,\n );\n }\n\n // Menu-item form: the anchor IS the item (asChild), so navigation + external vs client-side\n // routing behavior is preserved; DropdownMenuItem supplies the item styling.\n if (asMenuItem) {\n return (\n <DropdownMenuItem asChild className={cn(isDestructive && DESTRUCTIVE_ITEM)}>\n <Anchor\n href={anchorHref}\n target={target}\n rel={rel}\n data-testid={testid}\n onClick={(e) => e.stopPropagation()}\n >\n <ActionInner icon={resolveActionIcon(action, actionName)} label={label} />\n </Anchor>\n </DropdownMenuItem>\n );\n }\n\n const chrome = resolveControlChrome({\n density: density ?? 'regular',\n icon: resolveActionIcon(action, actionName),\n label,\n actionName,\n surface: scope,\n });\n\n return withActionTooltip(\n <Button\n asChild\n variant={buttonVariant}\n size={chrome.size}\n aria-label={chrome.ariaLabel}\n className={cn(chrome.className, className)}\n >\n <Anchor\n href={anchorHref}\n target={target}\n rel={rel}\n data-testid={testid}\n // Stop propagation so a row-level rowHref click handler doesn't double-navigate.\n onClick={(e) => e.stopPropagation()}\n >\n {chrome.content}\n </Anchor>\n </Button>,\n label,\n chrome.compact,\n );\n}\n\n/**\n * A `modal` action: presents the app's own component through the presentation runtime, and\n * writes nothing. Since P4 it carries no `confirm` and no check gate (a check naming a modal is\n * refused at registration). The presented component renders in the framework's overlay stack,\n * not in this control's subtree, so a menu item may close on select.\n */\nfunction ModalActionButton({\n resource,\n actionName,\n record,\n scope = 'row',\n variant,\n size,\n density,\n className,\n children,\n asMenuItem,\n action,\n availability,\n}: ResolvedActionButtonProps & {\n action: ActionModal;\n availability: Availability;\n}): React.ReactElement {\n const tid = useTestIds();\n const app = useApp();\n const present = usePresentBlock();\n const safeRecord = (record ?? { id: '' }) as Record<string, unknown>;\n const isDestructive = action.variant === 'destructive';\n const buttonVariant = variant ?? (isDestructive ? 'destructive' : 'outline');\n const recordId = String(recordKeyOf(app.registry.get(resource), record) ?? '');\n const testid = makeTestId(scope, resource, actionName, recordId, tid);\n const label = useResolvedLabel(action, actionName, children, resource);\n\n if (availability.state === 'disabled') {\n return (\n <DisabledAction\n reason={availability.reason}\n label={label}\n icon={resolveActionIcon(action, actionName)}\n testid={testid}\n size={size}\n variant={buttonVariant}\n className={className}\n asMenuItem={asMenuItem}\n resource={resource}\n density={density}\n actionName={actionName}\n surface={scope}\n />\n );\n }\n\n function openModal(): void {\n presentModalAction({\n present,\n action,\n resource,\n actionName,\n record: safeRecord,\n recordId,\n label,\n });\n }\n\n if (asMenuItem) {\n return (\n <DropdownMenuItem\n data-testid={testid}\n className={cn(isDestructive && DESTRUCTIVE_ITEM)}\n onSelect={openModal}\n >\n <ActionInner icon={resolveActionIcon(action, actionName)} label={label} />\n </DropdownMenuItem>\n );\n }\n\n const chrome = resolveControlChrome({\n density: density ?? 'regular',\n icon: resolveActionIcon(action, actionName),\n label,\n actionName,\n surface: scope,\n });\n\n return withActionTooltip(\n <Button\n type=\"button\"\n variant={buttonVariant}\n size={chrome.size}\n aria-label={chrome.ariaLabel}\n data-testid={testid}\n onClick={(e) => {\n e.stopPropagation();\n openModal();\n }}\n className={cn(chrome.className, className)}\n >\n {chrome.content}\n </Button>,\n label,\n chrome.compact,\n );\n}\n","'use client';\nimport {\n checkFailedDefault,\n constraintText,\n type I18nCaps,\n FRAMEWORK_TEXT_KEYS,\n type ValidationIssue,\n type ValidationIssues,\n} from '@burojs/core';\nimport { useChromeT, useI18nCaps, useOptionalT, type CheckGateState } from '@burojs/react';\nimport { useEffect, useRef, type ReactElement, type ReactNode } from 'react';\nimport { Button } from '../primitives/button.js';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../primitives/dialog.js';\nimport { cn } from '../lib/cn.js';\n\nexport interface CheckConfirmDialogProps {\n readonly state: CheckGateState;\n /**\n * Base testid; the dialog and its rows suffix `:dialog`, `:proceed`,\n * `:cancel`, `:item:<checkId>`.\n */\n readonly testid: string;\n /**\n * Fired (before `state.cancel()`) when an anchored row — `path[0]` is a\n * field name — is clicked.\n */\n readonly onAnchorFocus?: (field: string) => void;\n /**\n * Overrides the neutral `checks.dialogTitle` heading. The ACTION call sites\n * pass the action's own label here, so «Archive» heads an archive\n * prompt instead of a generic \"please review\".\n */\n readonly title?: ReactNode;\n /**\n * Overrides the neutral `checks.proceed` label on the confirming button.\n * Again the action's own VERB at the action call sites: a button that\n * repeats what is about to happen reads at a glance, which is exactly what\n * the old dialog's `confirmLabel` did.\n */\n readonly proceedLabel?: ReactNode;\n /**\n * Overrides the neutral `checks.back` label on the cancelling button: a flow's own `dismiss`\n * (\"Keep the order\"), the word every cancel button of that flow says.\n */\n readonly cancelLabel?: ReactNode;\n /**\n * `'destructive'` styles the confirming button destructively — restoring\n * what `action.variant === 'destructive'` used to produce. Default\n * `'default'`, so the form hosts are untouched.\n */\n readonly tone?: 'default' | 'destructive';\n}\n\n/**\n * Localize one issue's message the same way `record/record-screen.tsx`/\n * `declarative-form.tsx` do. The FALLBACK half deliberately does NOT get\n * `params` interpolation — matching `resolveValidationMessage`\n * (`@burojs/react`), which interpolates nothing in the default either.\n * `message.default` is plain author-written text (see `field-issue.ts` /\n * `evaluate.ts`), not a `{{}}` template; only the BUNDLE translation path uses i18next-style\n * placeholders, so only that path takes `params`.\n *\n * `resource` is what makes the per-resource half of the chain reachable:\n * `evaluateChecks` keys a message as `checks.<id>`, and unbound that only ever\n * resolves through `resources._.` / `common.` — never the resource's own\n * bundle. It comes off the gate STATE (`useCheckGate` puts it there), not off\n * the ambient `ResourceContext`, which a list row does not have.\n */\nfunction issueText(\n issue: ValidationIssue,\n t: ReturnType<typeof useOptionalT>,\n caps: I18nCaps,\n resource: string | undefined,\n): string {\n const params = issue.message.params as Record<string, unknown> | undefined;\n const checkId = issue.check?.id;\n const ownCheck = checkId !== undefined && issue.message.key === `checks.${checkId}`;\n const declared =\n typeof issue.message.default === 'string'\n ? issue.message.default\n : ownCheck\n ? undefined\n : issue.message.key;\n // A flow's warnings arrive already translated and interpolated by its run (P4 4.22): the\n // text is final, a second lookup could only lose the declared params.\n if (issue.message.params?.resolved === true) return declared ?? issue.message.key;\n if (!ownCheck)\n return t(issue.message.key, {\n defaultValue: declared ?? '',\n params,\n ...(resource === undefined ? {} : { resource }),\n });\n // A check's entry is `checks.<id>.message` or `checks.<id>` (two spellings of one entry); the\n // presence of each is asked with `has()`, never by comparing a translation with a sentinel.\n const entryKey = [`${issue.message.key}.message`, issue.message.key].find((key) =>\n caps.has(key, { resource }),\n );\n if (entryKey !== undefined) return caps.t(entryKey, { resource, params });\n if (declared !== undefined) return declared;\n // A field's `min` / `max` bound: the framework sentence of its side, with the formatted limit.\n if (issue.check?.constraint !== undefined) {\n const text = constraintText(issue.check.constraint, String(params?.limit ?? ''));\n return t(text.key, { defaultValue: text.defaultValue, params });\n }\n // No text anywhere: the framework sentence with the check's humanized id.\n const name = String(params?.name ?? checkId);\n return t(FRAMEWORK_TEXT_KEYS.checkFailed, {\n defaultValue: checkFailedDefault(name),\n params: { ...params, name },\n });\n}\n\n/** `evaluateChecks` always stamps `check.id` (`@burojs/core`'s `evaluate.ts`). */\nfunction checkIdOf(issue: ValidationIssue, index: number): string {\n return issue.check?.id ?? `${index}`;\n}\n\nconst SEVERITY_CLASSNAME: Record<ValidationIssue['severity'], string> = {\n error: 'text-destructive',\n warning: 'text-warning-emphasis',\n info: 'text-muted-foreground',\n};\n\nfunction ChecksList({\n issues,\n testid,\n onRowClick,\n resource,\n}: {\n issues: ValidationIssues;\n testid: string;\n onRowClick: (field: string) => void;\n resource: string | undefined;\n}): ReactElement[] {\n const t = useOptionalT();\n const caps = useI18nCaps(resource);\n return issues.map((issue, index) => {\n const checkId = checkIdOf(issue, index);\n const anchor = issue.path[0];\n const anchorable = typeof anchor === 'string';\n const text = issueText(issue, t, caps, resource);\n const className = cn('text-sm', SEVERITY_CLASSNAME[issue.severity]);\n return anchorable ? (\n <li key={`${checkId}-${index}`}>\n <button\n type=\"button\"\n data-testid={`${testid}:item:${checkId}`}\n className={cn(className, 'text-left underline-offset-2 hover:underline')}\n onClick={() => onRowClick(anchor)}\n >\n {text}\n </button>\n </li>\n ) : (\n <li\n key={`${checkId}-${index}`}\n data-testid={`${testid}:item:${checkId}`}\n className={className}\n >\n {text}\n </li>\n );\n });\n}\n\n/**\n * Renders `useCheckGate`'s `state` — one dialog for `action.confirm`\n * headers, blocking checks and confirmable warnings alike — since P4 the\n * only confirm dialog an action has (a flow's `confirm` lowers to a check):\n * a controlled `<Dialog>` with a focus-restore-on-close effect and a\n * `data-testid` on the content and both buttons.\n *\n * Blockers ('error' severity) are shown first, under `checks.blocked`, and\n * NEVER get a proceed button — `state.proceed()` already no-ops while\n * blockers exist (defense in depth in the hook), but the visible affordance\n * is removed here too so a blocked user is never offered a button that does\n * nothing.\n */\nexport function CheckConfirmDialog({\n state,\n testid,\n onAnchorFocus,\n title,\n proceedLabel,\n cancelLabel,\n tone,\n}: CheckConfirmDialogProps): ReactElement {\n const chromeT = useChromeT();\n const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;\n const blocked = blockers.length > 0;\n // The dialog's own words are kit chrome, read unscoped (`resources._`, then `common`): bound to\n // the resource, `checks.back` would first read `resources.<r>.checks.back`, the message of a\n // check whose id is `back`. The check messages below stay bound to the resource.\n // Neutral defaults — deliberately surface-agnostic, since ONE dialog gates\n // saves, actions and deletes alike. A host with better words for its own\n // surface (the action call sites, with the action's label) overrides them.\n const heading = title ?? chromeT('checks.dialogTitle', { defaultValue: 'Please review' });\n\n // Focus restore: this dialog is\n // controlled and opened from outside a `<DialogTrigger>` (a submit button,\n // an action button), so Radix has nothing to hand focus back to on close\n // and drops it on <body>.\n const restoreFocusRef = useRef<HTMLElement | null>(null);\n useEffect(() => {\n if (typeof document === 'undefined') return;\n if (open) {\n const active = document.activeElement;\n if (active instanceof HTMLElement && active !== document.body) {\n restoreFocusRef.current = active;\n }\n return;\n }\n const target = restoreFocusRef.current;\n restoreFocusRef.current = null;\n if (!target || !document.contains(target)) return;\n const id = requestAnimationFrame(() => target.focus());\n return () => cancelAnimationFrame(id);\n }, [open]);\n\n const onRowClick = (field: string) => {\n onAnchorFocus?.(field);\n cancel();\n };\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next) cancel();\n }}\n >\n <DialogContent\n data-testid={`${testid}:dialog`}\n // `flex flex-col` + `max-h-[85vh] overflow-hidden` (same technique as\n // `relation-picker-dialog.tsx`'s DialogContent) turns the fixed,\n // viewport-centered dialog into a column with a capped height; the\n // list below is the ONLY child that scrolls, so the title and the\n // proceed/cancel buttons stay pinned and reachable however many\n // checks fired: an unbounded issue list can genuinely overflow the\n // viewport.\n className=\"flex max-h-[85vh] flex-col overflow-hidden\"\n >\n <DialogHeader>\n <DialogTitle>{heading}</DialogTitle>\n {header !== null ? (\n <DialogDescription>{header}</DialogDescription>\n ) : (\n // Radix requires an aria-describedby target for a11y; with no\n // `action.confirm` header there is nothing worth reading aloud\n // twice (the list below already is), so this mirrors\n // `action-button.tsx`'s `sr-only` DialogDescription fallback.\n <DialogDescription className=\"sr-only\">{heading}</DialogDescription>\n )}\n </DialogHeader>\n <ul className=\"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-contain\">\n {blocked && (\n <li className=\"text-xs font-semibold uppercase tracking-wider text-destructive\">\n {chromeT('checks.blocked', { defaultValue: 'Cannot continue' })}\n </li>\n )}\n <ChecksList\n issues={blockers}\n testid={testid}\n onRowClick={onRowClick}\n resource={resource}\n />\n <ChecksList\n issues={confirmable}\n testid={testid}\n onRowClick={onRowClick}\n resource={resource}\n />\n </ul>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={cancel}\n data-testid={`${testid}:cancel`}\n disabled={busy}\n >\n {cancelLabel ?? chromeT('checks.back', { defaultValue: 'Go back' })}\n </Button>\n {!blocked && (\n <Button\n type=\"button\"\n variant={tone === 'destructive' ? 'destructive' : 'default'}\n onClick={proceed}\n data-testid={`${testid}:proceed`}\n disabled={busy}\n >\n {proceedLabel ?? chromeT('checks.proceed', { defaultValue: 'Continue anyway' })}\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,QAAQ,EAAE,SAAS,MAAM,QAAQ,aAA+C;CAC9F,MAAM,OAAA,GAAMA,cAAAA,OAAAA,CAAO,OAAO;CAC1B,MAAM,QAAA,GAAOC,cAAAA,YAAAA,CAAY;CACzB,MAAM,KAAA,GAAIC,cAAAA,aAAAA,CAAa;CACvB,MAAM,EAAE,eAAA,GAAcC,cAAAA,YAAAA,CAAY;CAClC,MAAM,CAAC,MAAM,YAAA,GAAWC,MAAAA,SAAAA,CAAS,KAAK;CAatC,MAAM,OAAA,GAAMC,aAAAA,cAAAA,CAAc,MAAM,OAAO;CACvC,MAAM,EAAE,OAAO,cAAc,SAAS,gBAAA,GAAeC,aAAAA,oBAAAA,CAAoB,OAAO,OAAO;CACvF,MAAM,UAAA,GAASC,cAAAA,aAAAA,CAAa,YAAY;CAiBxC,MAAM,gBACJ,eAAe,KAAA,IAAY,OAAO,SAAS,IAAI,OAAO,MAAM,MAAM,EAAE,OAAO,UAAU;CAGvF,IAAI,CAAC,OAAO,CAAC,e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kBAAA,IAAA,CAAC,YAAD;OACE,QAAQ;OACA;OACI;OACF;MACX,CAAA;KACC;;KACJ,GAAA,kBAAA,KAAA,CAACC,eAAAA,cAAD,EAAA,UAAA,EACE,GAAA,kBAAA,IAAA,CAACC,eAAAA,QAAD;KACE,MAAK;KACL,SAAQ;KACR,SAAS;KACT,eAAa,GAAG,OAAO;KACvB,UAAU;KAET,UAAA,eAAe,QAAQ,eAAe,EAAE,cAAc,UAAU,CAAC;IAC5D,CAAA,GACP,CAAC,YACA,GAAA,kBAAA,IAAA,CAACA,eAAAA,QAAD;KACE,MAAK;KACL,SAAS,SAAS,gBAAgB,gBAAgB;KAClD,SAAS;KACT,eAAa,GAAG,OAAO;KACvB,UAAU;KAET,UAAA,gBAAgB,QAAQ,kBAAkB,EAAE,cAAc,kBAAkB,CAAC;IACxE,CAAA,CAEE,EAAA,CAAA;GACD;;CACT,CAAA;AAEZ"}
|
|
@@ -2,7 +2,7 @@ import { l as cn } from "./use-theme-dnE3Od3I.js";
|
|
|
2
2
|
import { l as useLinkComponent, m as PopoverTrigger, n as toast, p as PopoverContent, u as Popover } from "./toaster-Ct_YHGs6.js";
|
|
3
3
|
import { t as Button } from "./button-MWVeZaqj.js";
|
|
4
4
|
import { a as DialogFooter, i as DialogDescription, o as DialogHeader, r as DialogContent, s as DialogTitle, t as Dialog } from "./dialog-C123sVQ8.js";
|
|
5
|
-
import { FRAMEWORK_TEXT_KEYS, canonicalEntityNodeKey, checkFailedDefault, compileFlow, declaredText, docAddressToArticle, flowRecordOf, hasRecordPage, hrefFor, humanizeKey, isBuiltinItemAction, normalizeEntityRef, recordEntries, resolveContentSlot, resolveDocSee, routeResourceKey, textsValueAt } from "@burojs/core";
|
|
5
|
+
import { FRAMEWORK_TEXT_KEYS, canonicalEntityNodeKey, checkFailedDefault, compileFlow, constraintText, declaredText, docAddressToArticle, flowRecordOf, hasRecordPage, hrefFor, humanizeKey, isBuiltinItemAction, normalizeEntityRef, recordEntries, resolveContentSlot, resolveDocSee, routeResourceKey, textsValueAt } from "@burojs/core";
|
|
6
6
|
import { buildDI, conjoinHostPage, modeForSurface, recordKeyOf, resolveRoute, useActionWhenSources, useApp, useAvailabilityResolver, useChromeT, useComponent, useDoc, useDocPanel, useDocTopics, useEntryGate, useFlowRowResolver, useHostPage, useI18nCaps, useOptionalRouterAdapter, useOptionalT, usePresentBlock, usePresentFlow, useProjectedTitle, useQuick, useQuickEntry, useTestIds, useUIInstance } from "@burojs/react";
|
|
7
7
|
import { IconArrowRight, IconArrowUpRight, IconArrowsLeftRight, IconBan, IconBell, IconBox, IconBoxMultiple, IconBuilding, IconCheck, IconChevronRight, IconCircle, IconCircleCaretRight, IconCircleCheck, IconCircleX, IconClipboardList, IconClock, IconCopy, IconDots, IconEye, IconFileOff, IconFilePencil, IconFileText, IconFileX, IconGitBranch, IconHammer, IconHash, IconHistory, IconInfoHexagon, IconKey, IconKeyOff, IconLink, IconList, IconLoader2, IconMapPin, IconNetwork, IconPackage, IconPackageExport, IconPackageImport, IconPackageOff, IconPackages, IconPencil, IconPlayerPlay, IconPlayerTrackNext, IconPlus, IconQrcode, IconRefresh, IconRotate, IconScript, IconSettings, IconShieldCheck, IconTag, IconTool, IconTrash, IconTruck, IconUserPlus, IconUsers, IconX } from "@tabler/icons-react";
|
|
8
8
|
import * as React from "react";
|
|
@@ -488,11 +488,11 @@ function retrying(importer) {
|
|
|
488
488
|
return loading;
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
|
-
const loadFlowRuntime = retrying(() => import("./flow-runtime-
|
|
492
|
-
const loadFlowScreen = retrying(() => import("./flow-screen-
|
|
493
|
-
const loadPageFlowRoute = retrying(() => import("./page-flow-route-
|
|
494
|
-
const loadInlineFlowHost = retrying(() => import("./inline-flow-host-
|
|
495
|
-
const loadBulkSummary = retrying(() => import("./bulk-summary-
|
|
491
|
+
const loadFlowRuntime = retrying(() => import("./flow-runtime-DrUWyTS0.js"));
|
|
492
|
+
const loadFlowScreen = retrying(() => import("./flow-screen-3fk6J33y.js"));
|
|
493
|
+
const loadPageFlowRoute = retrying(() => import("./page-flow-route-CtEfqAvU.js"));
|
|
494
|
+
const loadInlineFlowHost = retrying(() => import("./inline-flow-host-YnnvWjdU.js"));
|
|
495
|
+
const loadBulkSummary = retrying(() => import("./bulk-summary-D6A0ua21.js"));
|
|
496
496
|
function preloadFlowRuntime() {
|
|
497
497
|
loadFlowRuntime().catch(() => void 0);
|
|
498
498
|
}
|
|
@@ -1400,6 +1400,13 @@ function issueText(issue, t, caps, resource) {
|
|
|
1400
1400
|
params
|
|
1401
1401
|
});
|
|
1402
1402
|
if (declared !== void 0) return declared;
|
|
1403
|
+
if (issue.check?.constraint !== void 0) {
|
|
1404
|
+
const text = constraintText(issue.check.constraint, String(params?.limit ?? ""));
|
|
1405
|
+
return t(text.key, {
|
|
1406
|
+
defaultValue: text.defaultValue,
|
|
1407
|
+
params
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1403
1410
|
const name = String(params?.name ?? checkId);
|
|
1404
1411
|
return t(FRAMEWORK_TEXT_KEYS.checkFailed, {
|
|
1405
1412
|
defaultValue: checkFailedDefault(name),
|
|
@@ -1518,4 +1525,4 @@ function CheckConfirmDialog({ state, testid, onAnchorFocus, title, proceedLabel,
|
|
|
1518
1525
|
//#endregion
|
|
1519
1526
|
export { Tooltip as $, OwnTitleHeading as A, DropdownMenuContent as B, loadBulkSummary as C, loadPageFlowRoute as D, loadInlineFlowHost as E, Icon as F, DropdownMenuRadioGroup as G, DropdownMenuItem as H, hasIcon as I, DropdownMenuShortcut as J, DropdownMenuRadioItem as K, registerIcons as L, DialogPresentationShell as M, OwnTitleContext as N, preloadFlowRuntime as O, SheetPresentationShell as P, DropdownMenuTrigger as Q, DropdownMenu as R, RuntimeFlowRunner as S, loadFlowScreen as T, DropdownMenuLabel as U, DropdownMenuGroup as V, DropdownMenuPortal as W, DropdownMenuSubContent as X, DropdownMenuSub as Y, DropdownMenuSubTrigger as Z, reasonText as _, modeForSurface as a, SheetContent as at, RuntimeAppFlowRunner as b, useListSlot as c, SheetHeader as ct, useToBrowserHref as d, DocInfo as dt, TooltipContent as et, FlowActionButton as f, ActionInner as g, useFlowDialogTexts as h, makeTestId as i, SheetClose as it, useFocusOnMount as j, useLoaded as k, isExternalHref as l, SheetTitle as lt, useFlowChrome as m, ActionButton as n, TooltipTrigger as nt, canonicalResourceName as o, SheetDescription as ot, FlowMenuItem as p, DropdownMenuSeparator as q, DisabledAction as r, Sheet as rt, listSlot as s, SheetFooter as st, CheckConfirmDialog as t, TooltipProvider as tt, openExternal as u, SheetTrigger as ut, FlowBoundary as v, loadFailedText as w, RuntimeBulkFlowRunner as x, FlowLoadFailed as y, DropdownMenuCheckboxItem as z };
|
|
1520
1527
|
|
|
1521
|
-
//# sourceMappingURL=check-confirm-dialog-
|
|
1528
|
+
//# sourceMappingURL=check-confirm-dialog-CtiRzOAt.js.map
|