@burojs/ui-shadcn 0.6.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.
Files changed (158) hide show
  1. package/README.md +9 -0
  2. package/dist/bulk-summary-2HLgz7Il.cjs +169 -0
  3. package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
  4. package/dist/bulk-summary-D6A0ua21.js +169 -0
  5. package/dist/bulk-summary-D6A0ua21.js.map +1 -0
  6. package/dist/{candidates-relation-picker-Cy0rTxvI.cjs → candidates-relation-picker-C47mF260.cjs} +4 -4
  7. package/dist/{candidates-relation-picker-Cy0rTxvI.cjs.map → candidates-relation-picker-C47mF260.cjs.map} +1 -1
  8. package/dist/{candidates-relation-picker-B116Bmqi.js → candidates-relation-picker-CGXItMN0.js} +3 -3
  9. package/dist/{candidates-relation-picker-B116Bmqi.js.map → candidates-relation-picker-CGXItMN0.js.map} +1 -1
  10. package/dist/{check-confirm-dialog--gPFnEeg.cjs → check-confirm-dialog-BT04Mieo.cjs} +475 -107
  11. package/dist/check-confirm-dialog-BT04Mieo.cjs.map +1 -0
  12. package/dist/{check-confirm-dialog-bRT8lt0d.js → check-confirm-dialog-CtiRzOAt.js} +391 -108
  13. package/dist/check-confirm-dialog-CtiRzOAt.js.map +1 -0
  14. package/dist/{dialog-B_rt9S1c.js → dialog-C123sVQ8.js} +4 -4
  15. package/dist/dialog-C123sVQ8.js.map +1 -0
  16. package/dist/{dialog-DRNUq9EA.cjs → dialog-vmMdfUWs.cjs} +3 -3
  17. package/dist/dialog-vmMdfUWs.cjs.map +1 -0
  18. package/dist/{filter-builder-nXqtM_h4.cjs → filter-builder-ByGhxLf_.cjs} +1021 -154
  19. package/dist/filter-builder-ByGhxLf_.cjs.map +1 -0
  20. package/dist/{filter-builder-Bhn-dhZV.js → filter-builder-z3Axzf9Y.js} +929 -140
  21. package/dist/filter-builder-z3Axzf9Y.js.map +1 -0
  22. package/dist/{flow-runtime-D3avVH0I.cjs → flow-runtime-BVFjMU5-.cjs} +64 -29
  23. package/dist/flow-runtime-BVFjMU5-.cjs.map +1 -0
  24. package/dist/{flow-runtime-s6lkRPKF.js → flow-runtime-DrUWyTS0.js} +65 -30
  25. package/dist/flow-runtime-DrUWyTS0.js.map +1 -0
  26. package/dist/{flow-screen-CCvgDI9G.js → flow-screen-3fk6J33y.js} +130 -87
  27. package/dist/flow-screen-3fk6J33y.js.map +1 -0
  28. package/dist/{flow-screen-Ci_Sik4Y.cjs → flow-screen-6y5E_HT6.cjs} +130 -87
  29. package/dist/flow-screen-6y5E_HT6.cjs.map +1 -0
  30. package/dist/index.cjs +1186 -950
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +631 -322
  33. package/dist/index.d.ts +631 -322
  34. package/dist/index.js +1100 -870
  35. package/dist/index.js.map +1 -1
  36. package/dist/{inline-flow-host-DV1et3c6.cjs → inline-flow-host-C4KmZIYE.cjs} +5 -5
  37. package/dist/inline-flow-host-C4KmZIYE.cjs.map +1 -0
  38. package/dist/{inline-flow-host-B6FI0ctQ.js → inline-flow-host-YnnvWjdU.js} +5 -5
  39. package/dist/inline-flow-host-YnnvWjdU.js.map +1 -0
  40. package/dist/{candidates-gate-D33jXLHO.cjs → lazy-relation-picker-dialog-BAKBRn3V.cjs} +10 -10
  41. package/dist/lazy-relation-picker-dialog-BAKBRn3V.cjs.map +1 -0
  42. package/dist/{candidates-gate-Bb70LPAy.js → lazy-relation-picker-dialog-DN4bvQfg.js} +11 -11
  43. package/dist/lazy-relation-picker-dialog-DN4bvQfg.js.map +1 -0
  44. package/dist/{page-flow-route-i3ZfJ1sd.js → page-flow-route-CtEfqAvU.js} +35 -23
  45. package/dist/page-flow-route-CtEfqAvU.js.map +1 -0
  46. package/dist/{page-flow-route-hdnULWqd.cjs → page-flow-route-DEjAxHe3.cjs} +42 -30
  47. package/dist/page-flow-route-DEjAxHe3.cjs.map +1 -0
  48. package/dist/{place-node-NraNYKPx.js → place-node-BdxT-30h.js} +1980 -1041
  49. package/dist/place-node-BdxT-30h.js.map +1 -0
  50. package/dist/{place-node-C5SmIAYU.cjs → place-node-Bhl8B3fF.cjs} +2038 -1087
  51. package/dist/place-node-Bhl8B3fF.cjs.map +1 -0
  52. package/dist/{related-list-cards-CFq3meUn.cjs → related-list-cards-Bc_vfCE_.cjs} +9 -4
  53. package/dist/{related-list-cards-CFq3meUn.cjs.map → related-list-cards-Bc_vfCE_.cjs.map} +1 -1
  54. package/dist/{related-list-cards-BWZ9GfOG.js → related-list-cards-BvkD5OcC.js} +9 -4
  55. package/dist/{related-list-cards-BWZ9GfOG.js.map → related-list-cards-BvkD5OcC.js.map} +1 -1
  56. package/dist/related-list-timeline-DCrwN9oO.js +167 -0
  57. package/dist/related-list-timeline-DCrwN9oO.js.map +1 -0
  58. package/dist/related-list-timeline-k0DtnxTs.cjs +167 -0
  59. package/dist/related-list-timeline-k0DtnxTs.cjs.map +1 -0
  60. package/dist/{related-rows-ea43qhhy.cjs → related-rows-BW9Jr07T.cjs} +27 -16
  61. package/dist/related-rows-BW9Jr07T.cjs.map +1 -0
  62. package/dist/{related-rows-o0_t-Yce.js → related-rows-CPE-9FFr.js} +25 -14
  63. package/dist/related-rows-CPE-9FFr.js.map +1 -0
  64. package/dist/{search-access-CPPmfuvy.js → relation-create-C43cdPQt.js} +595 -13
  65. package/dist/relation-create-C43cdPQt.js.map +1 -0
  66. package/dist/{search-access-Dugvttlg.cjs → relation-create-DDEYcKfw.cjs} +633 -14
  67. package/dist/relation-create-DDEYcKfw.cjs.map +1 -0
  68. package/dist/{relation-many-picker-bvkjkv-k.js → relation-many-picker-BlrGRwMV.js} +210 -104
  69. package/dist/relation-many-picker-BlrGRwMV.js.map +1 -0
  70. package/dist/{relation-many-picker-C8zFEjwd.cjs → relation-many-picker-Br-zBHxT.cjs} +218 -112
  71. package/dist/relation-many-picker-Br-zBHxT.cjs.map +1 -0
  72. package/dist/{relation-picker-gag0qSR5.cjs → relation-picker-ADjxI_TI.cjs} +36 -73
  73. package/dist/relation-picker-ADjxI_TI.cjs.map +1 -0
  74. package/dist/{relation-picker-dialog-B6nIiJBf.js → relation-picker-dialog-CyKliBkN.js} +134 -36
  75. package/dist/relation-picker-dialog-CyKliBkN.js.map +1 -0
  76. package/dist/{relation-picker-dialog-0IzkjmiA.cjs → relation-picker-dialog-DimVQF9Y.cjs} +133 -35
  77. package/dist/relation-picker-dialog-DimVQF9Y.cjs.map +1 -0
  78. package/dist/{relation-picker-Z0ZJJ5uS.js → relation-picker-x7P5HKie.js} +30 -61
  79. package/dist/relation-picker-x7P5HKie.js.map +1 -0
  80. package/dist/relation-select-B8Fq4o-t.js +48 -0
  81. package/dist/relation-select-B8Fq4o-t.js.map +1 -0
  82. package/dist/relation-select-Cr3CfNLy.cjs +55 -0
  83. package/dist/relation-select-Cr3CfNLy.cjs.map +1 -0
  84. package/dist/{resource-page-router-3RUf9d1j.js → resource-page-router-BRpUnhay.js} +634 -264
  85. package/dist/resource-page-router-BRpUnhay.js.map +1 -0
  86. package/dist/{resource-page-router-PXfMW9nh.cjs → resource-page-router-qEd2xb55.cjs} +694 -312
  87. package/dist/resource-page-router-qEd2xb55.cjs.map +1 -0
  88. package/dist/{rich-text-vTyVjDoa.cjs → rich-text-C_7JCvRo.cjs} +2 -2
  89. package/dist/{rich-text-vTyVjDoa.cjs.map → rich-text-C_7JCvRo.cjs.map} +1 -1
  90. package/dist/{rich-text-DFerywgz.js → rich-text-RcPBf6hr.js} +2 -2
  91. package/dist/{rich-text-DFerywgz.js.map → rich-text-RcPBf6hr.js.map} +1 -1
  92. package/dist/success-notices-Dl3M1fZP.cjs +46 -0
  93. package/dist/success-notices-Dl3M1fZP.cjs.map +1 -0
  94. package/dist/success-notices-LDEgEkc4.js +41 -0
  95. package/dist/success-notices-LDEgEkc4.js.map +1 -0
  96. package/dist/{toaster-Cr51X7bz.cjs → toaster-BbByOytP.cjs} +60 -15
  97. package/dist/toaster-BbByOytP.cjs.map +1 -0
  98. package/dist/{toaster-C02XbB9r.js → toaster-Ct_YHGs6.js} +43 -16
  99. package/dist/toaster-Ct_YHGs6.js.map +1 -0
  100. package/dist/{use-dialog-filter-state-C--oMAZG.js → use-dialog-filter-state-B_MqzHaT.js} +5 -4
  101. package/dist/use-dialog-filter-state-B_MqzHaT.js.map +1 -0
  102. package/dist/{use-dialog-filter-state-Dhe8PcB5.cjs → use-dialog-filter-state-tNvqAAjh.cjs} +6 -5
  103. package/dist/use-dialog-filter-state-tNvqAAjh.cjs.map +1 -0
  104. package/dist/use-record-subtitle-bfwIoUme.cjs +70 -0
  105. package/dist/use-record-subtitle-bfwIoUme.cjs.map +1 -0
  106. package/dist/use-record-subtitle-gIaCGgbI.js +53 -0
  107. package/dist/use-record-subtitle-gIaCGgbI.js.map +1 -0
  108. package/package.json +11 -11
  109. package/dist/bulk-summary-CwSd6Yjb.cjs +0 -108
  110. package/dist/bulk-summary-CwSd6Yjb.cjs.map +0 -1
  111. package/dist/bulk-summary-GxMDP4bw.js +0 -108
  112. package/dist/bulk-summary-GxMDP4bw.js.map +0 -1
  113. package/dist/candidates-gate-Bb70LPAy.js.map +0 -1
  114. package/dist/candidates-gate-D33jXLHO.cjs.map +0 -1
  115. package/dist/check-confirm-dialog--gPFnEeg.cjs.map +0 -1
  116. package/dist/check-confirm-dialog-bRT8lt0d.js.map +0 -1
  117. package/dist/dialog-B_rt9S1c.js.map +0 -1
  118. package/dist/dialog-DRNUq9EA.cjs.map +0 -1
  119. package/dist/filter-builder-Bhn-dhZV.js.map +0 -1
  120. package/dist/filter-builder-nXqtM_h4.cjs.map +0 -1
  121. package/dist/flow-runtime-D3avVH0I.cjs.map +0 -1
  122. package/dist/flow-runtime-s6lkRPKF.js.map +0 -1
  123. package/dist/flow-screen-CCvgDI9G.js.map +0 -1
  124. package/dist/flow-screen-Ci_Sik4Y.cjs.map +0 -1
  125. package/dist/inline-flow-host-B6FI0ctQ.js.map +0 -1
  126. package/dist/inline-flow-host-DV1et3c6.cjs.map +0 -1
  127. package/dist/page-flow-route-hdnULWqd.cjs.map +0 -1
  128. package/dist/page-flow-route-i3ZfJ1sd.js.map +0 -1
  129. package/dist/place-node-C5SmIAYU.cjs.map +0 -1
  130. package/dist/place-node-NraNYKPx.js.map +0 -1
  131. package/dist/related-list-timeline-CCzl71aA.cjs +0 -142
  132. package/dist/related-list-timeline-CCzl71aA.cjs.map +0 -1
  133. package/dist/related-list-timeline-yrPsjA3F.js +0 -142
  134. package/dist/related-list-timeline-yrPsjA3F.js.map +0 -1
  135. package/dist/related-rows-ea43qhhy.cjs.map +0 -1
  136. package/dist/related-rows-o0_t-Yce.js.map +0 -1
  137. package/dist/relation-create-IA40t1hi.cjs +0 -364
  138. package/dist/relation-create-IA40t1hi.cjs.map +0 -1
  139. package/dist/relation-create-h6F9B4C4.js +0 -339
  140. package/dist/relation-create-h6F9B4C4.js.map +0 -1
  141. package/dist/relation-many-picker-C8zFEjwd.cjs.map +0 -1
  142. package/dist/relation-many-picker-bvkjkv-k.js.map +0 -1
  143. package/dist/relation-picker-Z0ZJJ5uS.js.map +0 -1
  144. package/dist/relation-picker-dialog-0IzkjmiA.cjs.map +0 -1
  145. package/dist/relation-picker-dialog-B6nIiJBf.js.map +0 -1
  146. package/dist/relation-picker-gag0qSR5.cjs.map +0 -1
  147. package/dist/resource-page-router-3RUf9d1j.js.map +0 -1
  148. package/dist/resource-page-router-PXfMW9nh.cjs.map +0 -1
  149. package/dist/search-access-CPPmfuvy.js.map +0 -1
  150. package/dist/search-access-Dugvttlg.cjs.map +0 -1
  151. package/dist/shell-BPlk8hEa.js +0 -205
  152. package/dist/shell-BPlk8hEa.js.map +0 -1
  153. package/dist/shell-DxhlsPwm.cjs +0 -271
  154. package/dist/shell-DxhlsPwm.cjs.map +0 -1
  155. package/dist/toaster-C02XbB9r.js.map +0 -1
  156. package/dist/toaster-Cr51X7bz.cjs.map +0 -1
  157. package/dist/use-dialog-filter-state-C--oMAZG.js.map +0 -1
  158. package/dist/use-dialog-filter-state-Dhe8PcB5.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-confirm-dialog-bRT8lt0d.js","names":["DESTRUCTIVE_ITEM"],"sources":["../src/doc/doc-info.tsx","../src/primitives/tooltip.tsx","../src/primitives/dropdown-menu.tsx","../src/primitives/icon.tsx","../src/flows/load-runtime.tsx","../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';\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","'use client';\nimport { 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 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 const value = t('block.failed');\n return value === 'block.failed' ? 'This section could not be loaded.' : value;\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({ onRetry }: { readonly onRetry: () => void }): ReactElement {\n const t = useOptionalT();\n const instance = useUIInstance();\n const retryText = t('actions.retry') === 'actions.retry' ? 'Retry' : t('actions.retry');\n const closeText = t('flow.close') === 'flow.close' ? 'Close' : t('flow.close');\n return (\n <div role=\"alert\" data-buro-flow-load=\"failed\" className=\"flex flex-col gap-3 text-sm\">\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","'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 } from '@burojs/core';\nimport { useApp, type useOptionalT } from '@burojs/react';\nimport type { ReactNode } from 'react';\nimport { resolveActionIcon, useResolvedLabel } from '../actions/action-button.js';\n\ntype Translate = ReturnType<typeof useOptionalT>;\nexport const text = (\n t: Translate,\n key: string,\n fallback: string,\n params?: Record<string, unknown>,\n) => {\n const value = t(key, params === undefined ? undefined : { params });\n return value === key ? fallback : value;\n};\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/** The label, icon and tone of a flow's control. */\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 return {\n label,\n labelText: typeof label === 'string' ? label : humanizeKey(actionName),\n icon: resolveActionIcon(declared, actionName),\n destructive: declared.variant === 'destructive',\n };\n}\n\nexport type FlowChrome = ReturnType<typeof useFlowChrome>;\n","'use client';\nimport type { ActionDensity, FlowControlState } from '@burojs/core';\nimport {\n conjoinHostPage,\n type FlowRowControl,\n type HostPage,\n useHostPage,\n useApp,\n useFlowRowResolver,\n usePresentFlow,\n useProjectedTitle,\n useTestIds,\n} from '@burojs/react';\nimport { compileFlow, 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 readonly resource: string;\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(props: FlowActionButtonProps): ReactElement | null {\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 testid = makeTestId(scope, resource, actionName, record?.id ?? '', 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 = 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 * @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, record?.id, 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 testid = makeTestId(\n props.scope,\n props.resource,\n props.actionName,\n props.record?.id ?? '',\n tid,\n );\n const runRecord = props.control.record ?? props.record;\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 { 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(region: 'cell', resource: string): ListCellRenderer | undefined;\nexport function useListSlot(region: 'filters', resource: string): ListSlot | undefined;\nexport function useListSlot(\n region: ListSlotRegion,\n resource: string,\n): ListSlot | ListCellRenderer | undefined {\n return useComponent<ListSlot | ListCellRenderer>(listSlot(region, 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 { evaluateCondition, isFlowAction } from '@burojs/core/internal';\nimport type {\n Action,\n ActionDensity,\n ActionLink,\n ActionModal,\n Availability,\n PortableFieldCondition,\n ResourceHandle,\n} from '@burojs/core';\nimport {\n declaredText,\n hasRecordPage,\n humanizeKey,\n isBuiltinItemAction,\n normalizeEntityRef,\n resolveContentSlot,\n} from '@burojs/core';\nimport {\n buildDI,\n resolveRoute,\n useApp,\n useAvailabilityResolver,\n useI18nCaps,\n useTestIds,\n usePresentBlock,\n} from '@burojs/react';\nimport { useEffect } 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 { 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 resource: string;\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\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 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?: string;\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({\n reason,\n label,\n icon,\n testid,\n size,\n variant,\n className,\n asMenuItem,\n resource,\n density = 'regular',\n actionName,\n surface,\n}: DisabledActionProps): React.ReactElement {\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 ? resolveContentSlot(i18nCaps, [reason], { resource, default: reason })\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 if (asMenuItem) {\n return (\n <DropdownMenuItem\n aria-disabled=\"true\"\n data-testid={testid}\n onSelect={(e) => e.preventDefault()}\n onClick={onClick}\n className=\"opacity-60\"\n >\n <ActionInner icon={icon} label={label} />\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\nfunction actionResourceHandle(resource: string): ResourceHandle {\n return { kind: 'resource', ref: normalizeEntityRef(resource) };\n}\n\nexport function ActionButton(props: ActionButtonProps): React.ReactElement | null {\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 availability = resolveAvailability(props.actionName, props.record);\n const action =\n findAction(def?.actions?.item, props.actionName) ??\n findAction(def?.actions?.resource, props.actionName);\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.\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): a portable condition over the record — a link or modal shows only while it\n // holds. Undecided (no record to read) hides it: a control shown on no information is the\n // worse failure. The function `visible` it replaces is refused at definition.\n if (!actionWhenHolds(action, props.record)) return null;\n if (action.kind === 'link') {\n return (\n <LinkActionButton {...props} action={action as ActionLink} availability={availability} />\n );\n }\n if (action.kind === 'modal') {\n return (\n <ModalActionButton {...props} action={action as ActionModal} availability={availability} />\n );\n }\n return null;\n}\n\n/**\n * @internal A link or modal action's `when` (P4, spec 4.20) over the record: true shows it;\n * false or undecided hides it. No `when` shows it.\n */\nexport function actionWhenHolds(\n action: unknown,\n record: Record<string, unknown> | undefined,\n): boolean {\n const when = (action as { readonly when?: PortableFieldCondition }).when;\n if (when === undefined) return true;\n const decided = evaluateCondition(\n when,\n record === undefined ? {} : { record: { status: 'ready', value: record, refreshing: false } },\n { mode: 'show' },\n );\n return decided === true;\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 (typeof target.resource !== 'string') return null;\n if (target.action !== 'show' && target.action !== 'edit' && target.action !== 'create')\n return null;\n let def: ReturnType<typeof registry.get>;\n try {\n def = registry.get(target.resource);\n } catch {\n return null;\n }\n if (def === undefined || hasRecordPage(def, target.action)) return null;\n return { resource: target.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}: ActionButtonProps & {\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 = record?.id ?? '';\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}: ActionButtonProps & { action: ActionModal; availability: Availability }): React.ReactElement {\n const tid = useTestIds();\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 = record?.id ?? '';\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 FRAMEWORK_TEXT_KEYS,\n type ValidationIssue,\n type ValidationIssues,\n} from '@burojs/core';\nimport { 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 * `'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 * `translateOrFallback` from `declarative-form.tsx`: `useOptionalT()`'s\n * `defaultValue` is only consulted with no provider mounted; with a real\n * `BuroProvider` a miss returns the raw key. Comparing the two lets this one\n * helper resolve correctly in both cases.\n *\n * `params` is forwarded to `t()` — see `resolveValidationMessage`\n * (`@burojs/react`), which forwards `issue.params` to its `t`\n * call the same way. Without it, a bundle entry with a `{{checkId}}` (etc.)\n * placeholder would render the literal `{{checkId}}` here while resolving\n * correctly in field-level rendering.\n */\nfunction translateOrFallback(\n t: ReturnType<typeof useOptionalT>,\n key: string,\n fallback: string,\n params: Record<string, unknown> | undefined,\n resource: string | undefined,\n): string {\n const translated = t(key, { params, ...(resource === undefined ? {} : { resource }) });\n return translated === key ? fallback : translated;\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 resource: string | undefined,\n): string {\n const params = issue.params as Record<string, unknown> | undefined;\n const checkId = params?.checkId;\n const ownCheck = typeof checkId === 'string' && 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.params?.resolved === true) return declared ?? issue.message.key;\n if (!ownCheck) return translateOrFallback(t, issue.message.key, declared ?? '', params, resource);\n // A check's entry is `checks.<id>.message` or `checks.<id>` (two spellings of one entry).\n const miss = '\\u0000';\n const bundled = [`${issue.message.key}.message`, issue.message.key]\n .map((key) => translateOrFallback(t, key, miss, params, resource))\n .find((text) => text !== miss);\n if (bundled !== undefined) return bundled;\n if (declared !== undefined) return declared;\n // No text anywhere: the framework sentence with the check's humanized id.\n const name = String(params?.name ?? checkId);\n return translateOrFallback(\n t,\n FRAMEWORK_TEXT_KEYS.checkFailed,\n checkFailedDefault(name),\n { ...params, name },\n undefined,\n );\n}\n\n/**\n * `evaluateChecks` always stamps `params.checkId` (`@burojs/core`'s\n * `evaluate.ts`); this just narrows the `unknown`.\n */\nfunction checkIdOf(issue: ValidationIssue, index: number): string {\n const id = issue.params?.checkId;\n return typeof id === 'string' ? 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 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, 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 tone,\n}: CheckConfirmDialogProps): ReactElement {\n const t = useOptionalT();\n const { resource, open, busy, header, blockers, confirmable, proceed, cancel } = state;\n const blocked = blockers.length > 0;\n // Bound on every lookup below, chrome included: an unbound key still falls\n // through `resources._.` → `common.` exactly as before, so this only ADDS\n // the per-resource entry as a first candidate.\n const bound = resource === undefined ? {} : { 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 ?? t('checks.dialogTitle', { defaultValue: 'Please review', ...bound });\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 {t('checks.blocked', { defaultValue: 'Cannot continue', ...bound })}\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 {t('checks.back', { defaultValue: 'Go back', ...bound })}\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 ?? t('checks.proceed', { defaultValue: 'Continue anyway', ...bound })}\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAuDA,SAAgB,QAAQ,EAAE,SAAS,MAAM,QAAQ,aAA+C;CAC9F,MAAM,MAAM,OAAO,OAAO;CAC1B,MAAM,OAAO,YAAY;CACzB,MAAM,IAAI,aAAa;CACvB,MAAM,EAAE,cAAc,YAAY;CAClC,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAatC,MAAM,MAAM,cAAc,MAAM,OAAO;CACvC,MAAM,EAAE,OAAO,cAAc,SAAS,eAAe,oBAAoB,OAAO,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A2B,CAAA,CAEzD,EAAA,CAAA;IACd,KAAC,MAAD;KAAI,WAAU;KAAd,UAAA;MACG,WACC,IAAC,MAAD;OAAI,WAAU;OACX,UAAA,EAAE,kBAAkB;QAAE,cAAc;QAAmB,GAAG;OAAM,CAAC;MAChE,CAAA;MAEN,IAAC,YAAD;OACE,QAAQ;OACA;OACI;OACF;MACX,CAAA;MACD,IAAC,YAAD;OACE,QAAQ;OACA;OACI;OACF;MACX,CAAA;KACC;;IACJ,KAAC,cAAD,EAAA,UAAA,CACE,IAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,SAAS;KACT,eAAa,GAAG,OAAO;KACvB,UAAU;KAET,UAAA,EAAE,eAAe;MAAE,cAAc;MAAW,GAAG;KAAM,CAAC;IACjD,CAAA,GACP,CAAC,WACA,IAAC,QAAD;KACE,MAAK;KACL,SAAS,SAAS,gBAAgB,gBAAgB;KAClD,SAAS;KACT,eAAa,GAAG,OAAO;KACvB,UAAU;KAET,UAAA,gBAAgB,EAAE,kBAAkB;MAAE,cAAc;MAAmB,GAAG;KAAM,CAAC;IAC5E,CAAA,CAEE,EAAA,CAAA;GACD;;CACT,CAAA;AAEZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-B_rt9S1c.js","names":[],"sources":["../src/primitives/dialog.tsx"],"sourcesContent":["'use client';\nimport { useOptionalT } from '@burojs/react';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogClose = DialogPrimitive.Close;\nconst DialogPortal = DialogPrimitive.Portal;\n\nexport type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n DialogOverlayProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\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-overlay)] ease-[var(--ease-overlay)]',\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nexport type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n /**\n * Optional className applied to the rendered `<DialogOverlay>`.\n * Useful for case-by-case backdrop styling (e.g. the command palette\n * applies `backdrop-blur-sm` to soften the underlying chrome) without\n * having to fork the whole `DialogContent` wrapper.\n */\n overlayClassName?: string;\n /** Whether the standard visual close button is rendered. Defaults to true. */\n showClose?: boolean;\n};\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, overlayClassName, showClose = true, ...props }, ref) => {\n const t = useOptionalT();\n return (\n <DialogPortal>\n <DialogOverlay className={overlayClassName} />\n {/* No slide-* class here on purpose. This surface centres itself with\n `translate-x-[-50%] translate-y-[-50%]`, which Tailwind v4 compiles\n to the `translate` CSS property; tw-animate-css's slide keyframes\n write `transform`. `translate` and `transform` COMPOSE instead of\n one overriding the other, so a `slide-in-from-*`/`slide-out-to-*`\n class here would ADD an offset on top of the centring and the\n dialog would animate in diagonally — see\n tests/overlay-animation.test.tsx. Fade + zoom are safe: zoom only\n feeds `--tw-enter-scale`, which lives inside the keyframe's own\n `transform`. */}\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background text-foreground p-6 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 sm:rounded-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.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-accent data-[state=open]:text-muted-foreground\">\n <IconX className=\"h-4 w-4\" />\n <span className=\"sr-only\">{t('actions.close', { defaultValue: 'Close' })}</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nexport type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return (\n <div\n className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\nDialogHeader.displayName = 'DialogHeader';\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps) {\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}\nDialogFooter.displayName = 'DialogFooter';\n\nexport type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n DialogTitleProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport type DialogDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Description\n>;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n DialogDescriptionProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n DialogClose,\n};\n"],"mappings":";;;;;;;AAQA,MAAM,SAAS,gBAAgB;AAC/B,MAAM,gBAAgB,gBAAgB;AACtC,MAAM,cAAc,gBAAgB;AACpC,MAAM,eAAe,gBAAgB;AAIrC,MAAM,gBAAgB,MAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,IAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,0NACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAcpD,MAAM,gBAAgB,MAAM,YAGzB,EAAE,WAAW,UAAU,kBAAkB,YAAY,MAAM,GAAG,SAAS,QAAQ;CAChF,MAAM,IAAI,aAAa;CACvB,OACE,KAAC,cAAD,EAAA,UAAA,CACE,IAAC,eAAD,EAAe,WAAW,iBAAmB,CAAA,GAW7C,KAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,wZACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,aACC,KAAC,gBAAgB,OAAjB;GAAuB,WAAU;GAAjC,UAAA,CACE,IAAC,OAAD,EAAO,WAAU,UAAW,CAAA,GAC5B,IAAC,QAAD;IAAM,WAAU;IAAW,UAAA,EAAE,iBAAiB,EAAE,cAAc,QAAQ,CAAC;GAAQ,CAAA,CAC1D;EAEF,CAAA,CAAA;CACb,CAAA,CAAA,EAAA,CAAA;AAElB,CAAC;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAIpD,SAAS,aAAa,EAAE,WAAW,GAAG,SAA4B;CAChE,OACE,IAAC,OAAD;EACE,WAAW,GAAG,sDAAsD,SAAS;EAC7E,GAAI;CACL,CAAA;AAEL;AACA,aAAa,cAAc;AAI3B,SAAS,aAAa,EAAE,WAAW,GAAG,SAA4B;CAChE,OACE,IAAC,OAAD;EACE,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;CACL,CAAA;AAEL;AACA,aAAa,cAAc;AAI3B,MAAM,cAAc,MAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,IAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,qDAAqD,SAAS;CAC5E,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAMhD,MAAM,oBAAoB,MAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,IAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,iCAAiC,SAAS;CACxD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-DRNUq9EA.cjs","names":["DialogPrimitive","React","cn","useOptionalT","IconX"],"sources":["../src/primitives/dialog.tsx"],"sourcesContent":["'use client';\nimport { useOptionalT } from '@burojs/react';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogClose = DialogPrimitive.Close;\nconst DialogPortal = DialogPrimitive.Portal;\n\nexport type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n DialogOverlayProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\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-overlay)] ease-[var(--ease-overlay)]',\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nexport type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n /**\n * Optional className applied to the rendered `<DialogOverlay>`.\n * Useful for case-by-case backdrop styling (e.g. the command palette\n * applies `backdrop-blur-sm` to soften the underlying chrome) without\n * having to fork the whole `DialogContent` wrapper.\n */\n overlayClassName?: string;\n /** Whether the standard visual close button is rendered. Defaults to true. */\n showClose?: boolean;\n};\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, overlayClassName, showClose = true, ...props }, ref) => {\n const t = useOptionalT();\n return (\n <DialogPortal>\n <DialogOverlay className={overlayClassName} />\n {/* No slide-* class here on purpose. This surface centres itself with\n `translate-x-[-50%] translate-y-[-50%]`, which Tailwind v4 compiles\n to the `translate` CSS property; tw-animate-css's slide keyframes\n write `transform`. `translate` and `transform` COMPOSE instead of\n one overriding the other, so a `slide-in-from-*`/`slide-out-to-*`\n class here would ADD an offset on top of the centring and the\n dialog would animate in diagonally — see\n tests/overlay-animation.test.tsx. Fade + zoom are safe: zoom only\n feeds `--tw-enter-scale`, which lives inside the keyframe's own\n `transform`. */}\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background text-foreground p-6 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 sm:rounded-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.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-accent data-[state=open]:text-muted-foreground\">\n <IconX className=\"h-4 w-4\" />\n <span className=\"sr-only\">{t('actions.close', { defaultValue: 'Close' })}</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nexport type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return (\n <div\n className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\nDialogHeader.displayName = 'DialogHeader';\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps) {\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}\nDialogFooter.displayName = 'DialogFooter';\n\nexport type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n DialogTitleProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport type DialogDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Description\n>;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n DialogDescriptionProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n DialogClose,\n};\n"],"mappings":";;;;;;;;;AAQA,MAAM,SAASA,uBAAgB;AAC/B,MAAM,gBAAgBA,uBAAgB;AACtC,MAAM,cAAcA,uBAAgB;AACpC,MAAM,eAAeA,uBAAgB;AAIrC,MAA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