@burojs/ui-shadcn 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/bulk-summary-BWSAS7k2.js +143 -0
- package/dist/bulk-summary-BWSAS7k2.js.map +1 -0
- package/dist/bulk-summary-CrEij5vq.cjs +143 -0
- package/dist/bulk-summary-CrEij5vq.cjs.map +1 -0
- package/dist/{candidates-relation-picker-B116Bmqi.js → candidates-relation-picker-CS_JZ4Fd.js} +3 -3
- package/dist/{candidates-relation-picker-B116Bmqi.js.map → candidates-relation-picker-CS_JZ4Fd.js.map} +1 -1
- package/dist/{candidates-relation-picker-Cy0rTxvI.cjs → candidates-relation-picker-y5M6_oe4.cjs} +4 -4
- package/dist/{candidates-relation-picker-Cy0rTxvI.cjs.map → candidates-relation-picker-y5M6_oe4.cjs.map} +1 -1
- package/dist/{check-confirm-dialog-bRT8lt0d.js → check-confirm-dialog-2j0gOd7x.js} +384 -108
- package/dist/check-confirm-dialog-2j0gOd7x.js.map +1 -0
- package/dist/{check-confirm-dialog--gPFnEeg.cjs → check-confirm-dialog-C-NHgMST.cjs} +468 -107
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +1 -0
- package/dist/{dialog-B_rt9S1c.js → dialog-C123sVQ8.js} +4 -4
- package/dist/dialog-C123sVQ8.js.map +1 -0
- package/dist/{dialog-DRNUq9EA.cjs → dialog-vmMdfUWs.cjs} +3 -3
- package/dist/dialog-vmMdfUWs.cjs.map +1 -0
- package/dist/{filter-builder-nXqtM_h4.cjs → filter-builder-DFu0JP-1.cjs} +923 -120
- package/dist/filter-builder-DFu0JP-1.cjs.map +1 -0
- package/dist/{filter-builder-Bhn-dhZV.js → filter-builder-DaWHUZuV.js} +839 -108
- package/dist/filter-builder-DaWHUZuV.js.map +1 -0
- package/dist/{flow-runtime-D3avVH0I.cjs → flow-runtime-BpmrIUb6.cjs} +61 -29
- package/dist/flow-runtime-BpmrIUb6.cjs.map +1 -0
- package/dist/{flow-runtime-s6lkRPKF.js → flow-runtime-DyqTmK3H.js} +62 -30
- package/dist/flow-runtime-DyqTmK3H.js.map +1 -0
- package/dist/{flow-screen-Ci_Sik4Y.cjs → flow-screen-Bcz9NF2V.cjs} +128 -87
- package/dist/flow-screen-Bcz9NF2V.cjs.map +1 -0
- package/dist/{flow-screen-CCvgDI9G.js → flow-screen-DCdli6Ha.js} +128 -87
- package/dist/flow-screen-DCdli6Ha.js.map +1 -0
- package/dist/index.cjs +731 -906
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +455 -247
- package/dist/index.d.ts +455 -247
- package/dist/index.js +647 -828
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-DV1et3c6.cjs → inline-flow-host-3vw7LzzD.cjs} +5 -5
- package/dist/inline-flow-host-3vw7LzzD.cjs.map +1 -0
- package/dist/{inline-flow-host-B6FI0ctQ.js → inline-flow-host-C0rI9B7f.js} +5 -5
- package/dist/inline-flow-host-C0rI9B7f.js.map +1 -0
- package/dist/{candidates-gate-D33jXLHO.cjs → lazy-relation-picker-dialog-Bt8lrEIu.cjs} +10 -10
- package/dist/lazy-relation-picker-dialog-Bt8lrEIu.cjs.map +1 -0
- package/dist/{candidates-gate-Bb70LPAy.js → lazy-relation-picker-dialog-CAScLPb2.js} +11 -11
- package/dist/lazy-relation-picker-dialog-CAScLPb2.js.map +1 -0
- package/dist/{page-flow-route-i3ZfJ1sd.js → page-flow-route-BHUEpn0I.js} +36 -23
- package/dist/page-flow-route-BHUEpn0I.js.map +1 -0
- package/dist/{page-flow-route-hdnULWqd.cjs → page-flow-route-DS8IVTVH.cjs} +41 -28
- package/dist/page-flow-route-DS8IVTVH.cjs.map +1 -0
- package/dist/{place-node-C5SmIAYU.cjs → place-node-CNb3w-c7.cjs} +1869 -947
- package/dist/place-node-CNb3w-c7.cjs.map +1 -0
- package/dist/{place-node-NraNYKPx.js → place-node-CfzQvh4Y.js} +1824 -926
- package/dist/place-node-CfzQvh4Y.js.map +1 -0
- package/dist/{related-list-cards-BWZ9GfOG.js → related-list-cards-BIqqY69Y.js} +9 -4
- package/dist/{related-list-cards-BWZ9GfOG.js.map → related-list-cards-BIqqY69Y.js.map} +1 -1
- package/dist/{related-list-cards-CFq3meUn.cjs → related-list-cards-CelMxl4q.cjs} +9 -4
- package/dist/{related-list-cards-CFq3meUn.cjs.map → related-list-cards-CelMxl4q.cjs.map} +1 -1
- package/dist/{related-list-timeline-yrPsjA3F.js → related-list-timeline-CRh7xwLD.js} +6 -7
- package/dist/related-list-timeline-CRh7xwLD.js.map +1 -0
- package/dist/{related-list-timeline-CCzl71aA.cjs → related-list-timeline-DsLdi8sv.cjs} +5 -6
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +1 -0
- package/dist/{related-rows-o0_t-Yce.js → related-rows--uP2iKQC.js} +25 -14
- package/dist/related-rows--uP2iKQC.js.map +1 -0
- package/dist/{related-rows-ea43qhhy.cjs → related-rows-MPnLCmPF.cjs} +27 -16
- package/dist/related-rows-MPnLCmPF.cjs.map +1 -0
- package/dist/{search-access-CPPmfuvy.js → relation-create-C43cdPQt.js} +595 -13
- package/dist/relation-create-C43cdPQt.js.map +1 -0
- package/dist/{search-access-Dugvttlg.cjs → relation-create-DDEYcKfw.cjs} +633 -14
- package/dist/relation-create-DDEYcKfw.cjs.map +1 -0
- package/dist/{relation-many-picker-bvkjkv-k.js → relation-many-picker-BJhaEqxz.js} +203 -102
- package/dist/relation-many-picker-BJhaEqxz.js.map +1 -0
- package/dist/{relation-many-picker-C8zFEjwd.cjs → relation-many-picker-DzuGJpEl.cjs} +211 -110
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +1 -0
- package/dist/{relation-picker-Z0ZJJ5uS.js → relation-picker-D-tBBZW_.js} +23 -59
- package/dist/relation-picker-D-tBBZW_.js.map +1 -0
- package/dist/{relation-picker-gag0qSR5.cjs → relation-picker-DaIMzf2H.cjs} +29 -71
- package/dist/relation-picker-DaIMzf2H.cjs.map +1 -0
- package/dist/{relation-picker-dialog-0IzkjmiA.cjs → relation-picker-dialog-9Vg5vvR1.cjs} +133 -35
- package/dist/relation-picker-dialog-9Vg5vvR1.cjs.map +1 -0
- package/dist/{relation-picker-dialog-B6nIiJBf.js → relation-picker-dialog-DoEY8EkH.js} +134 -36
- package/dist/relation-picker-dialog-DoEY8EkH.js.map +1 -0
- package/dist/relation-select-B8Fq4o-t.js +48 -0
- package/dist/relation-select-B8Fq4o-t.js.map +1 -0
- package/dist/relation-select-Cr3CfNLy.cjs +55 -0
- package/dist/relation-select-Cr3CfNLy.cjs.map +1 -0
- package/dist/{resource-page-router-PXfMW9nh.cjs → resource-page-router-C_kGW2o_.cjs} +543 -300
- package/dist/resource-page-router-C_kGW2o_.cjs.map +1 -0
- package/dist/{resource-page-router-3RUf9d1j.js → resource-page-router-Diw6S6TK.js} +498 -255
- package/dist/resource-page-router-Diw6S6TK.js.map +1 -0
- package/dist/{rich-text-vTyVjDoa.cjs → rich-text-C_7JCvRo.cjs} +2 -2
- package/dist/{rich-text-vTyVjDoa.cjs.map → rich-text-C_7JCvRo.cjs.map} +1 -1
- package/dist/{rich-text-DFerywgz.js → rich-text-RcPBf6hr.js} +2 -2
- package/dist/{rich-text-DFerywgz.js.map → rich-text-RcPBf6hr.js.map} +1 -1
- package/dist/success-notices-Dl3M1fZP.cjs +46 -0
- package/dist/success-notices-Dl3M1fZP.cjs.map +1 -0
- package/dist/success-notices-LDEgEkc4.js +41 -0
- package/dist/success-notices-LDEgEkc4.js.map +1 -0
- package/dist/{toaster-Cr51X7bz.cjs → toaster-BbByOytP.cjs} +60 -15
- package/dist/toaster-BbByOytP.cjs.map +1 -0
- package/dist/{toaster-C02XbB9r.js → toaster-Ct_YHGs6.js} +43 -16
- package/dist/toaster-Ct_YHGs6.js.map +1 -0
- package/dist/{use-dialog-filter-state-C--oMAZG.js → use-dialog-filter-state-B_MqzHaT.js} +5 -4
- package/dist/use-dialog-filter-state-B_MqzHaT.js.map +1 -0
- package/dist/{use-dialog-filter-state-Dhe8PcB5.cjs → use-dialog-filter-state-tNvqAAjh.cjs} +6 -5
- package/dist/use-dialog-filter-state-tNvqAAjh.cjs.map +1 -0
- package/package.json +11 -11
- package/dist/bulk-summary-CwSd6Yjb.cjs +0 -108
- package/dist/bulk-summary-CwSd6Yjb.cjs.map +0 -1
- package/dist/bulk-summary-GxMDP4bw.js +0 -108
- package/dist/bulk-summary-GxMDP4bw.js.map +0 -1
- package/dist/candidates-gate-Bb70LPAy.js.map +0 -1
- package/dist/candidates-gate-D33jXLHO.cjs.map +0 -1
- package/dist/check-confirm-dialog--gPFnEeg.cjs.map +0 -1
- package/dist/check-confirm-dialog-bRT8lt0d.js.map +0 -1
- package/dist/dialog-B_rt9S1c.js.map +0 -1
- package/dist/dialog-DRNUq9EA.cjs.map +0 -1
- package/dist/filter-builder-Bhn-dhZV.js.map +0 -1
- package/dist/filter-builder-nXqtM_h4.cjs.map +0 -1
- package/dist/flow-runtime-D3avVH0I.cjs.map +0 -1
- package/dist/flow-runtime-s6lkRPKF.js.map +0 -1
- package/dist/flow-screen-CCvgDI9G.js.map +0 -1
- package/dist/flow-screen-Ci_Sik4Y.cjs.map +0 -1
- package/dist/inline-flow-host-B6FI0ctQ.js.map +0 -1
- package/dist/inline-flow-host-DV1et3c6.cjs.map +0 -1
- package/dist/page-flow-route-hdnULWqd.cjs.map +0 -1
- package/dist/page-flow-route-i3ZfJ1sd.js.map +0 -1
- package/dist/place-node-C5SmIAYU.cjs.map +0 -1
- package/dist/place-node-NraNYKPx.js.map +0 -1
- package/dist/related-list-timeline-CCzl71aA.cjs.map +0 -1
- package/dist/related-list-timeline-yrPsjA3F.js.map +0 -1
- package/dist/related-rows-ea43qhhy.cjs.map +0 -1
- package/dist/related-rows-o0_t-Yce.js.map +0 -1
- package/dist/relation-create-IA40t1hi.cjs +0 -364
- package/dist/relation-create-IA40t1hi.cjs.map +0 -1
- package/dist/relation-create-h6F9B4C4.js +0 -339
- package/dist/relation-create-h6F9B4C4.js.map +0 -1
- package/dist/relation-many-picker-C8zFEjwd.cjs.map +0 -1
- package/dist/relation-many-picker-bvkjkv-k.js.map +0 -1
- package/dist/relation-picker-Z0ZJJ5uS.js.map +0 -1
- package/dist/relation-picker-dialog-0IzkjmiA.cjs.map +0 -1
- package/dist/relation-picker-dialog-B6nIiJBf.js.map +0 -1
- package/dist/relation-picker-gag0qSR5.cjs.map +0 -1
- package/dist/resource-page-router-3RUf9d1j.js.map +0 -1
- package/dist/resource-page-router-PXfMW9nh.cjs.map +0 -1
- package/dist/search-access-CPPmfuvy.js.map +0 -1
- package/dist/search-access-Dugvttlg.cjs.map +0 -1
- package/dist/shell-BPlk8hEa.js +0 -205
- package/dist/shell-BPlk8hEa.js.map +0 -1
- package/dist/shell-DxhlsPwm.cjs +0 -271
- package/dist/shell-DxhlsPwm.cjs.map +0 -1
- package/dist/toaster-C02XbB9r.js.map +0 -1
- package/dist/toaster-Cr51X7bz.cjs.map +0 -1
- package/dist/use-dialog-filter-state-C--oMAZG.js.map +0 -1
- package/dist/use-dialog-filter-state-Dhe8PcB5.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-create-C43cdPQt.js","names":["Command","CommandPrimitive"],"sources":["../src/primitives/command.tsx","../src/record/record-state.tsx","../src/load-error/list-error-panel.tsx","../src/load-error/state.ts","../src/load-error/load-error-view.tsx","../src/fields/claimed-quick-link.tsx","../src/resource/record-display-name.ts","../src/resource/use-row-title.ts","../src/quick/peek-context.ts","../src/quick/use-peek-intent.tsx","../src/fields/relation-display.tsx","../src/fields/search-access.ts","../src/fields/relation-hand-back.tsx","../src/fields/relation-view-button.tsx","../src/fields/relation-create.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { IconSearch } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\nimport {\n Dialog,\n DialogContent,\n DialogTitle,\n DialogDescription,\n type DialogContentProps,\n} from './dialog.js';\n\n/**\n * Shadcn-canonical Command primitive built on `cmdk`. Provides\n * keyboard-navigable, ARIA-correct combobox/listbox semantics: arrow\n * keys to navigate items, Enter to select, type-ahead search via the\n * embedded `<CommandInput>`. Use this for any searchable list inside a\n * Popover (typeaheads, command palettes, relation pickers).\n *\n * Filter behavior: by default cmdk filters items client-side based on\n * the input text. For server-side filtering (typical for relation\n * pickers that hit `useList` with a `contains` operator), pass\n * `shouldFilter={false}` to the root `<Command>` and drive the option\n * list yourself from the server-side results.\n */\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <IconSearch className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" aria-hidden=\"true\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input-disabled',\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm text-muted-foreground\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"group relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Loading>,\n CommandLoadingProps\n>(({ ...props }, ref) => <CommandPrimitive.Loading ref={ref} {...props} />);\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/**\n * Props for `<CommandDialog>`. Mirrors Radix Dialog's `Root` props\n * (`open`, `onOpenChange`, `defaultOpen`, `modal`) plus optional\n * accessibility labels and dialog-content className overrides.\n *\n * The shadcn-canonical pattern wraps a Radix `<Dialog>` around the\n * `<Command>` root so cmdk's keyboard navigation (arrow keys, Enter,\n * type-ahead) operates on the items rendered as children. We render\n * a visually-hidden `<DialogTitle>` + `<DialogDescription>` for the\n * a11y tree (Radix requires a labelled dialog or it warns at runtime).\n */\nexport interface CommandDialogProps {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n modal?: boolean;\n /** Accessible title (visually hidden). Defaults to \"Command Palette\". */\n title?: string;\n /** Accessible description (visually hidden). Defaults to \"Search and run actions.\" */\n description?: string;\n /** Forwarded to the `<DialogContent>` className. */\n className?: string;\n /** Forwarded to the inner `<Command>` className. */\n commandClassName?: string;\n /** The Command groups + items + input. */\n children?: React.ReactNode;\n /** Optional dialog-content overrides (e.g. style for animations). */\n contentProps?: Omit<DialogContentProps, 'children' | 'className'>;\n}\n\n/**\n * Modal command palette. Combines Radix Dialog with cmdk's `<Command>`\n * root so adopters can compose `<CommandInput>`, `<CommandList>`,\n * `<CommandGroup>`, `<CommandItem>` as children and get focus-trapped\n * keyboard navigation out of the box.\n *\n * Usage:\n * ```tsx\n * <CommandDialog open={open} onOpenChange={setOpen}>\n * <CommandInput placeholder=\"Search…\" />\n * <CommandList>\n * <CommandEmpty>No matches.</CommandEmpty>\n * <CommandGroup heading=\"Resources\">\n * <CommandItem onSelect={...}>Documents</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </CommandDialog>\n * ```\n */\nfunction CommandDialog({\n open,\n onOpenChange,\n defaultOpen,\n modal,\n title = 'Command Palette',\n description = 'Search and run actions.',\n className,\n commandClassName,\n children,\n contentProps,\n}: CommandDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange} defaultOpen={defaultOpen} modal={modal}>\n <DialogContent\n {...contentProps}\n // Width: cap to 480px regardless of breakpoint (the shadcn default\n // `DialogContent` uses `max-w-lg` ~512px). `sm:max-w-[480px]`\n // re-asserts at the `sm` breakpoint so any built-in `sm:max-w-lg`\n // override loses to ours.\n className={cn('overflow-hidden p-0 shadow-lg max-w-[480px] sm:max-w-[480px]', className)}\n // Backdrop blur for the command palette specifically: softens\n // the underlying chrome so the palette feels like a focused\n // overlay rather than a stacked panel. Other dialogs keep the\n // shadcn-default solid backdrop.\n overlayClassName=\"backdrop-blur-sm\"\n >\n {/* Visually-hidden labels: Radix Dialog needs them for a11y, but\n the palette UI itself supplies its own search affordance. */}\n <DialogTitle className=\"sr-only\">{title}</DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n <Command\n className={cn(\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5',\n commandClassName,\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\nCommandDialog.displayName = 'CommandDialog';\n\nexport {\n Command,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandLoading,\n CommandDialog,\n};\n","'use client';\nimport { useChromeT, useT } from '@burojs/react';\nimport type { ReactElement } from 'react';\nimport type { LoadErrorState } from '../load-error/state.js';\nimport { Button } from '../primitives/button.js';\n\nexport type RecordErrorState = LoadErrorState;\n\n/**\n * A record that is loading or cannot be shown: `record-page:loading`, or\n * `record-page:<state>` with Retry when the caller passes `onRetry`. Shared by\n * the record route and `<RecordScreen>`.\n */\nexport function RecordState({\n state,\n onRetry,\n message: given,\n}: {\n readonly state: RecordErrorState | 'loading';\n readonly onRetry?: () => void;\n /** The sentence to show instead of the state's `router.record*` text (a load error's own). */\n readonly message?: string;\n}): ReactElement {\n const t = useT();\n const chromeT = useChromeT();\n if (state === 'loading') {\n return (\n <div\n role=\"status\"\n aria-busy=\"true\"\n data-testid=\"record-page:loading\"\n className=\"p-6 text-sm text-muted-foreground\"\n >\n {t('router.recordLoading')}\n </div>\n );\n }\n const message =\n given ??\n (state === 'not-found'\n ? t('record.notFoundOrNoAccess')\n : state === 'session-expired'\n ? t('router.recordSessionExpired')\n : t('router.recordError'));\n return (\n <div\n // A failed read is announced; loading stays a polite `status`.\n role=\"alert\"\n data-testid={`record-page:${state}`}\n className=\"flex flex-col items-center justify-center gap-3 px-6 py-24 text-center\"\n >\n <p className=\"max-w-sm text-sm text-muted-foreground\">{message}</p>\n {onRetry ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n data-testid=\"record-page:retry\"\n onClick={onRetry}\n >\n {chromeT('actions.retry')}\n </Button>\n ) : null}\n </div>\n );\n}\n","'use client';\nimport { useChromeT, useOptionalT, useT } from '@burojs/react';\nimport { IconAlertCircle, IconRefresh } from '@tabler/icons-react';\nimport { cn } from '../lib/cn.js';\nimport { Button } from '../primitives/button.js';\nimport type { ListErrorStateProps } from '../resource/list-error-state.js';\n\n/**\n * The kit's default `list` load-error view: the panel `<ListErrorState>` draws. Its sentence is\n * the load error's one text (`useLoadErrorText`, the rule every surface shares); the technical\n * text is shown under Details in development only.\n */\nexport function ListErrorPanel({\n text,\n technical,\n onRetry,\n resource,\n title,\n className,\n}: Omit<ListErrorStateProps, 'error'> & {\n /** The sentence the user reads. */\n readonly text: string;\n /** The failure's first technical text, for whoever diagnoses it. */\n readonly technical?: string | undefined;\n}): React.ReactElement {\n // `useT()` keeps this panel provider-only (it throws without a BuroProvider) and subscribes\n // to the locale; `useOptionalT()` is the translator that honours a `defaultValue`.\n useT();\n const t = useOptionalT();\n const chromeT = useChromeT();\n const raw = process.env.NODE_ENV === 'production' ? undefined : technical;\n\n return (\n <div\n role=\"alert\"\n className={cn(\n 'flex flex-col items-center justify-center gap-3 px-6 py-16 rounded-lg border border-destructive/40 bg-destructive/5 text-center',\n className,\n )}\n data-testid=\"error\"\n >\n <div className=\"rounded-full bg-destructive/10 p-3 text-destructive\">\n <IconAlertCircle className=\"size-6\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold tracking-tight text-destructive\">\n {title ?? t('list.errorTitle')}\n </h3>\n <p className=\"max-w-md text-sm text-muted-foreground\">{text}</p>\n </div>\n {/*\n The raw string still matters — to whoever has to diagnose it, not to\n the operator staring at a broken page. Collapsed, and only when it\n actually differs from what is already shown.\n */}\n {raw && raw !== text ? (\n <details className=\"max-w-md text-left\">\n <summary className=\"cursor-pointer text-xs text-muted-foreground hover:text-foreground\">\n {t('list.errorDetails')}\n </summary>\n <p\n className=\"mt-1.5 break-all font-mono text-xs text-muted-foreground\"\n data-testid=\"list-error-detail\"\n >\n {raw}\n </p>\n </details>\n ) : null}\n {onRetry && (\n <div className=\"flex justify-center pt-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n data-testid={resource ? `list-error-retry:${resource}` : 'list-error-retry'}\n onClick={onRetry}\n className=\"gap-1.5\"\n >\n <IconRefresh className=\"size-3.5\" aria-hidden=\"true\" />\n {chromeT('actions.retry')}\n </Button>\n </div>\n )}\n </div>\n );\n}\n","import { normalizeDataError } from '@burojs/core';\nimport type { LoadErrorViewProps } from '@burojs/react';\n\n/** The state a failed read renders: {@link LoadErrorViewProps.state}. */\nexport type LoadErrorState = LoadErrorViewProps['state'];\n\n/**\n * The state a failed read renders. `not-found` and `forbidden` render\n * identically (no existence oracle). `auth` is a session-expired state with no\n * Retry: the session failed rather than the request, and the runtime's auth\n * controller has already tried to recover. Every other kind — including an\n * error of no recognisable shape, which normalizes to `transport` — is the\n * error state with Retry. The mapping is the providers' job, never a status\n * fallback here.\n */\nexport function recordErrorState(error: unknown): LoadErrorState {\n const { kind } = normalizeDataError(error);\n if (kind === 'not-found' || kind === 'forbidden') return 'not-found';\n if (kind === 'auth') return 'session-expired';\n return 'error';\n}\n","'use client';\nimport { type DataError, normalizeDataError } from '@burojs/core';\nimport {\n type LoadErrorViewProps,\n specificErrorText,\n useChromeT,\n useI18nCaps,\n useLoadErrorView,\n useOptionalT,\n} from '@burojs/react';\nimport { Component, type ErrorInfo, type ReactElement, type ReactNode, useMemo } from 'react';\nimport { cn } from '../lib/cn.js';\nimport { friendlyStringsFrom, technicalTexts, toFriendlyError } from '../lib/friendly-error.js';\nimport { Button } from '../primitives/button.js';\nimport { RecordState } from '../record/record-state.js';\nimport { ListErrorPanel } from './list-error-panel.js';\nimport { type LoadErrorState, recordErrorState } from './state.js';\n\n/** The text a surface falls back to, when no specific text of the error answers (spec 4.15, kind tier). */\nexport interface LoadErrorFallback {\n readonly key: string;\n readonly default: string;\n}\n\nexport interface LoadErrorProps {\n /** Whatever the read threw; the app's view receives it normalized. */\n readonly error: unknown;\n readonly surface: LoadErrorViewProps['surface'];\n readonly resource?: string;\n /** The state to render; derived from the error's kind when omitted. */\n readonly state?: LoadErrorState;\n /** The Retry the surface offers; the kit passes it on for the `'error'` state only. */\n readonly retry?: () => void;\n /** The sentence a surface falls back to (record: `router.record*`, by state). */\n readonly fallback?: LoadErrorFallback;\n /** The default view's test id (a compact surface keeps the id it always had). */\n readonly testId?: string;\n readonly className?: string;\n /** A compact surface's visible content; the sentence is its `title`. */\n readonly children?: ReactNode;\n /** The `list` surface's heading override. */\n readonly title?: string;\n /** Extra DOM attributes for the default alert (a screen node's `data-buro-*`). */\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n}\n\n/** What the kit's default view reads besides the view props. */\ntype DefaultViewProps = LoadErrorViewProps & {\n readonly original: unknown;\n readonly fallback: LoadErrorFallback | undefined;\n readonly testId: string | undefined;\n readonly className: string | undefined;\n readonly title: string | undefined;\n readonly attributes: LoadErrorProps['attributes'];\n readonly children?: ReactNode;\n};\n\nconst RECORD_KEYS: Record<LoadErrorState, string> = {\n 'not-found': 'record.notFoundOrNoAccess',\n 'session-expired': 'router.recordSessionExpired',\n error: 'router.recordError',\n};\n\n/** The list surface's sentence for a failure with no text of its own. */\nconst LIST_FALLBACK: LoadErrorFallback = {\n key: 'list.errorBody',\n default: 'Failed to load data. Please try again.',\n};\n\n/**\n * Every developer-facing text of a failed read: the normalized error's (`details`, `cause`), then\n * the value as thrown (a legacy object's string `message`). For the friendly sentence and the\n * development details only; never the sentence itself.\n */\nexport function loadErrorTechnicalTexts(error: DataError, original: unknown): readonly string[] {\n const out = [...technicalTexts(error), ...technicalTexts(original)];\n if (original !== null && typeof original === 'object' && !(original instanceof Error)) {\n const message = (original as { readonly message?: unknown }).message;\n if (typeof message === 'string') out.push(message);\n }\n return out.filter((text, index) => text.length > 0 && out.indexOf(text) === index);\n}\n\n/**\n * The one sentence of a load error on every surface (spec 4.15 and 4.16). Not-found and forbidden\n * read the not-found sentence and never the error's own text, so no surface tells a missing record\n * from a forbidden one; an expired session reads the session sentence. Every other failure reads\n * the error's own text (the code's, the provider's reference), then the plain-language sentence of\n * a dead network or an unavailable service recognised in its technical text, then the surface's\n * sentence. Technical text itself is never the sentence.\n */\nfunction useLoadErrorText(\n error: DataError,\n original: unknown,\n state: LoadErrorState,\n surface: LoadErrorViewProps['surface'],\n fallback: LoadErrorFallback | undefined,\n): string {\n const t = useOptionalT();\n const caps = useI18nCaps();\n if (state !== 'error') return t(RECORD_KEYS[state]);\n const own = specificErrorText(error, caps);\n if (own !== undefined) return own;\n const strings = friendlyStringsFrom(t);\n for (const text of loadErrorTechnicalTexts(error, original)) {\n const friendly = toFriendlyError(text, '', strings);\n // \"Please try again.\" alone says less than the surface's own sentence.\n if (friendly.replaced && friendly.detail !== strings.generic) return friendly.detail;\n }\n const generic = surface === 'list' ? (fallback ?? LIST_FALLBACK) : fallback;\n if (surface === 'record' || generic === undefined) return t(RECORD_KEYS.error);\n return t(generic.key, { defaultValue: generic.default });\n}\n\n/** The kit's view of a load error, for every surface. */\nfunction DefaultLoadErrorView(props: DefaultViewProps): ReactElement {\n const {\n error,\n surface,\n state,\n retry,\n original,\n fallback,\n testId,\n className,\n children,\n attributes,\n } = props;\n const text = useLoadErrorText(error, original, state, surface, fallback);\n const chromeT = useChromeT();\n if (surface === 'record') {\n return (\n <RecordState\n state={state}\n message={text}\n {...(retry === undefined ? {} : { onRetry: retry })}\n />\n );\n }\n if (surface === 'list') {\n return (\n <ListErrorPanel\n text={text}\n technical={loadErrorTechnicalTexts(error, original)[0]}\n {...(retry === undefined ? {} : { onRetry: retry })}\n {...(props.resource === undefined ? {} : { resource: props.resource })}\n {...(props.title === undefined ? {} : { title: props.title })}\n {...(className === undefined ? {} : { className })}\n />\n );\n }\n if (surface === 'relation' || surface === 'picker') {\n // The raw failure text is for whoever diagnoses it: a tooltip detail in development only.\n const technical =\n process.env.NODE_ENV === 'production'\n ? undefined\n : loadErrorTechnicalTexts(error, original)[0];\n return (\n <span\n {...attributes}\n {...(testId === undefined ? {} : { 'data-testid': testId })}\n className={className}\n title={technical === undefined ? text : `${text} (${technical})`}\n >\n {children ?? text}\n </span>\n );\n }\n return (\n <div\n {...attributes}\n role=\"alert\"\n {...(testId === undefined ? {} : { 'data-testid': testId })}\n className={cn(\n 'flex flex-wrap items-center gap-2 rounded-md border border-dashed px-3 py-2 text-sm text-muted-foreground',\n className,\n )}\n >\n <span>{text}</span>\n {retry === undefined ? null : (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={retry}>\n {chromeT('actions.retry', { defaultValue: 'Retry' })}\n </Button>\n )}\n </div>\n );\n}\n\ninterface BoundaryProps {\n readonly error: unknown;\n readonly fallback: ReactElement;\n readonly children: ReactNode;\n}\n\n/**\n * Renders the app's view; if it throws, the kit's view takes over and one development error names\n * the failure. A new error to show gives the app's view another chance.\n */\nconst UNSET = Symbol('unset');\n\nclass AppViewBoundary extends Component<BoundaryProps, { failedFor: unknown; failed: boolean }> {\n override state: { failedFor: unknown; failed: boolean } = { failedFor: UNSET, failed: false };\n\n static getDerivedStateFromError(): { failed: true } {\n return { failed: true };\n }\n\n static getDerivedStateFromProps(\n props: BoundaryProps,\n state: { failedFor: unknown; failed: boolean },\n ): { failedFor: unknown; failed: boolean } | null {\n if (state.failed && state.failedFor !== UNSET && state.failedFor !== props.error) {\n return { failedFor: UNSET, failed: false };\n }\n return null;\n }\n\n override componentDidCatch(error: unknown, _info: ErrorInfo): void {\n this.setState({ failedFor: this.props.error });\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n \"[burojs] load-error.view-threw: the app's views.loadError threw while rendering; the kit's view is shown instead.\",\n error,\n );\n }\n }\n\n override render(): ReactNode {\n return this.state.failed ? this.props.fallback : this.props.children;\n }\n}\n\n/**\n * A failed read, drawn by the app's `views.loadError` when it has one and by the kit's view\n * otherwise. The error is normalized once, here; the app's view receives the raw {@link DataError}.\n */\nexport function LoadError(props: LoadErrorProps): ReactElement {\n const App = useLoadErrorView();\n const { error: original, surface, resource } = props;\n const error = useMemo(() => normalizeDataError(original), [original]);\n const state = props.state ?? recordErrorState(error);\n const retry = state === 'error' ? props.retry : undefined;\n const viewProps: LoadErrorViewProps = {\n error,\n surface,\n state,\n ...(resource === undefined ? {} : { resource }),\n ...(retry === undefined ? {} : { retry }),\n };\n const standard = (\n <DefaultLoadErrorView\n {...viewProps}\n original={original}\n fallback={props.fallback}\n testId={props.testId}\n className={props.className}\n title={props.title}\n attributes={props.attributes}\n >\n {props.children}\n </DefaultLoadErrorView>\n );\n if (App === undefined) return standard;\n return (\n <AppViewBoundary error={original} fallback={standard}>\n <App {...viewProps} />\n </AppViewBoundary>\n );\n}\n\n/**\n * What a route's id that names no record reads as (`/orders/abc` for a numeric id field): a\n * not-found answered without a request, under the framework's `invalid-record-id` code.\n */\nconst INVALID_ROUTE_ID: DataError = Object.freeze({\n kind: 'not-found',\n code: 'invalid-record-id',\n});\n\n/**\n * The not-found of a record route whose id is no valid id of its resource (spec 4.19), through\n * {@link LoadError}, so an app's `views.loadError` draws it like any other not-found.\n */\nexport function InvalidRouteId({ resource }: { readonly resource: string }): ReactElement {\n return (\n <LoadError surface=\"record\" resource={resource} state=\"not-found\" error={INVALID_ROUTE_ID} />\n );\n}\n","'use client';\nimport { QUICK_ANCHOR_ATTRIBUTE, quickAnchorRef } from '@burojs/react';\nimport type * as React from 'react';\nimport { useLinkComponent } from '../layout/link-component.js';\n\n/** A plain left click: the main button, no modifier. Anything else follows the `href`. */\nexport function isPlainLeftClick(event: React.MouseEvent): boolean {\n return event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;\n}\n\n/** Claims the anchor an app's link component rendered (it may not forward a ref). */\nfunction claimAnchor(wrapper: HTMLSpanElement | null): void {\n const anchor = wrapper?.querySelector('a') ?? null;\n quickAnchorRef(anchor);\n}\n\n/**\n * A quick opener's anchor (spec 4.5): the app's link component to the record's page, marked with\n * `data-buro-quick` and claimed for its opener, so the navigation guard leaves its click to it. A\n * plain left click calls `preventDefault()` and `onOpen()`; a modified click follows the `href`\n * (a new tab, guarded as any link).\n */\nexport function ClaimedQuickLink({\n href,\n testid,\n className,\n onOpen,\n children,\n}: {\n readonly href: string;\n readonly testid?: string;\n readonly className?: string;\n readonly onOpen: () => void;\n readonly children: React.ReactNode;\n}): React.ReactElement {\n const RouterLink = useLinkComponent();\n return (\n <span ref={claimAnchor} className=\"contents\">\n <RouterLink\n href={href}\n {...(testid === undefined ? {} : { 'data-testid': testid })}\n {...{ [QUICK_ANCHOR_ATTRIBUTE]: '' }}\n {...(className === undefined ? {} : { className })}\n onClick={(event: React.MouseEvent<HTMLAnchorElement>) => {\n event.stopPropagation();\n if (!isPlainLeftClick(event) || event.currentTarget.target === '_blank') return;\n event.preventDefault();\n onOpen();\n }}\n >\n {children}\n </RouterLink>\n </span>\n );\n}\n","/**\n * A record's display name: its `displayField` value when present and non-empty, else its `id`.\n * Exported for consumers building delete dialogs, breadcrumbs and relation labels.\n */\nexport function recordDisplayName(record: Record<string, unknown>, displayField?: string): string {\n if (displayField && record[displayField] != null && record[displayField] !== '') {\n return String(record[displayField]);\n }\n return String(record.id ?? '');\n}\n","import { useListAccess } from '@burojs/react';\nimport { useCallback } from 'react';\nimport { recordDisplayName } from './record-display-name.js';\n\n/**\n * The display name of a row of `target` as a list surface may show it (P5 spec 3.6, decision\n * P5-27): the row's `displayField` value only while that field is visible in any-record reach,\n * else the id. While the decision is pending the id is shown as well, never the value. Picker\n * options, relation displays, related labels and palette results read their titles through this.\n */\nexport function useRowTitle(\n target: string,\n displayField: string | undefined,\n): (row: Record<string, unknown>) => string {\n const access = useListAccess(target);\n const visible =\n displayField !== undefined && access.status === 'ready' && access.fieldVisible(displayField);\n return useCallback(\n (row) => recordDisplayName(row, visible ? displayField : undefined),\n [visible, displayField],\n );\n}\n","'use client';\nimport { createContext } from 'react';\n\n/**\n * @internal What the popover host gives the screen inside it: the anchor element it is positioned\n * against (the relation display the peek was opened from), and a setter for the popover's\n * accessible name once the screen knows the record's title.\n */\nexport interface PeekHostValue {\n readonly anchor: HTMLElement | null;\n setLabel(label: string): void;\n}\n\n/** @internal Provided by `PopoverPresentationHost`; `null` outside a popover. */\nexport const PeekHostContext = createContext<PeekHostValue | null>(null);\n\n/**\n * @internal True inside a peek (provided by `PeekScreen`): a relation display there attaches no\n * hover intent, so a peek never opens a second peek (spec 4.6).\n */\nexport const PeekContext = createContext(false);\n","'use client';\nimport {\n PEEK_COMPONENT,\n type PeekScreenProps,\n useCurrentUIActivation,\n useEntryGate,\n useQuickOpener,\n useUIPresentationRuntime,\n} from '@burojs/react';\nimport {\n type FocusEvent,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { PeekContext } from './peek-context.js';\n\n/** The hover (and keyboard-focus) delay before a peek opens (spec 4.6). */\nexport const PEEK_DELAY_MS = 500;\n/** Focus this soon after a Tab or arrow keydown is keyboard modality. */\nconst KEYBOARD_FOCUS_WINDOW_MS = 100;\n\nconst NAVIGATION_KEYS = new Set(['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']);\n\n/** When the last Tab or arrow keydown happened; a pointer down forgets it. */\nlet lastNavigationKeyAt = Number.NEGATIVE_INFINITY;\nconst listening = new WeakSet<Document>();\n\nfunction listenForModality(doc: Document): void {\n if (listening.has(doc)) return;\n listening.add(doc);\n doc.addEventListener(\n 'keydown',\n (event) => {\n if (NAVIGATION_KEYS.has(event.key)) lastNavigationKeyAt = Date.now();\n },\n true,\n );\n const forget = () => {\n lastNavigationKeyAt = Number.NEGATIVE_INFINITY;\n };\n doc.addEventListener('pointerdown', forget, true);\n doc.addEventListener('mousedown', forget, true);\n}\n\n/** Whether a focus now came from the keyboard (a Tab or arrow keydown just before it). */\nfunction keyboardModality(): boolean {\n return Date.now() - lastNavigationKeyAt <= KEYBOARD_FOCUS_WINDOW_MS;\n}\n\n/** Elements about to be focused by code: their next focus opens no peek. */\nconst focusedByCode = new WeakSet<Element>();\n\n/**\n * @internal Focus `element` by code (the peek's anchor, when its title opens `quick.show`): the\n * focus opens no peek, whatever key was pressed last.\n */\nexport function focusWithoutPeek(element: HTMLElement): void {\n focusedByCode.add(element);\n element.focus();\n focusedByCode.delete(element);\n}\n\n/** What opens a record from where an anchor sits: its display's own quick opener. */\nexport type PeekAnchorOpener = (target: string, id: string) => void;\n\n/**\n * Each anchor's opener, taken where the display renders: inside a quick sheet it pushes into that\n * sheet, inside a dialog it closes the dialog first. The peek renders beside the overlays, outside\n * the sheet's context, so its title opens through this instead of its own opener.\n */\nconst anchorOpeners = new WeakMap<Element, PeekAnchorOpener>();\n\n/** @internal The opener registered for `anchor` by its peek intent, if any. */\nexport function peekAnchorOpener(anchor: Element | null): PeekAnchorOpener | undefined {\n return anchor === null ? undefined : anchorOpeners.get(anchor);\n}\n\n/** What a peek previews: the display's target and the key it holds (an id, or a `by` key). */\nexport interface PeekTarget {\n readonly to: string;\n readonly id?: string;\n readonly by?: { readonly field: string; readonly key: string };\n}\n\n/** The anchor inside the wrapper: the opener (`data-buro-quick`), else the first element. */\nfunction anchorIn(wrapper: HTMLElement | null): HTMLElement | null {\n if (wrapper === null) return null;\n const marked = wrapper.querySelector<HTMLElement>('[data-buro-quick]');\n if (marked !== null) return marked;\n const first = wrapper.firstElementChild;\n return first instanceof HTMLElement ? first : null;\n}\n\nconst noSubscription = () => () => undefined;\n\n/**\n * A relation display's hover intent (spec 4.6): a `mouse` or `pen` pointer resting on the anchor,\n * or keyboard-modality focus on it (a Tab or arrow keydown just before, never focus set by code),\n * for {@link PEEK_DELAY_MS} asks the entry gate for the target's peek; only `open` presents it,\n * after dismissing any other open peek. Leaving or blurring before then cancels. Nothing is read\n * before the peek opens. Inside a peek it renders its children only.\n */\nexport function PeekIntent({\n target,\n children,\n}: {\n readonly target: PeekTarget;\n readonly children: ReactNode;\n}): ReactElement {\n const inside = useContext(PeekContext);\n if (inside) return <>{children}</>;\n return <ActivePeekIntent target={target}>{children}</ActivePeekIntent>;\n}\n\nfunction ActivePeekIntent({\n target,\n children,\n}: {\n readonly target: PeekTarget;\n readonly children: ReactNode;\n}): ReactElement {\n const gate = useEntryGate();\n const runtime = useUIPresentationRuntime();\n const activation = useCurrentUIActivation();\n const [anchor, setAnchor] = useState<HTMLElement | null>(null);\n const wrapper = useRef<HTMLSpanElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n // The latest of each, read when the timer fires (the access answer may have changed since).\n const latest = useRef({ gate, target, activation });\n latest.current = { gate, target, activation };\n\n const attach = useCallback((element: HTMLSpanElement | null) => {\n wrapper.current = element;\n if (element !== null && element.ownerDocument !== undefined)\n listenForModality(element.ownerDocument);\n setAnchor(anchorIn(element));\n }, []);\n\n const expanded = useSyncExternalStore(\n anchor === null ? noSubscription : runtime.subscribe,\n () =>\n anchor !== null &&\n runtime\n .getSnapshot()\n .some((d) => d.component === PEEK_COMPONENT && d.anchor?.element === anchor),\n () => false,\n );\n const peekable = gate(target.to, 'peek').state === 'open';\n\n // The anchor is the app's link (it may not forward props): its popup state is set on it.\n useEffect(() => {\n if (anchor === null) return;\n if (!peekable) {\n anchor.removeAttribute('aria-haspopup');\n anchor.removeAttribute('aria-expanded');\n return;\n }\n anchor.setAttribute('aria-haspopup', 'dialog');\n anchor.setAttribute('aria-expanded', expanded ? 'true' : 'false');\n }, [anchor, peekable, expanded]);\n\n // The opener of where this display sits (a sheet pushes, a dialog closes first), for every\n // display with a peek: an eager one, a lazy `by` one and one under undecided access alike.\n const quickOpen = useQuickOpener();\n const onOpen = useCallback<PeekAnchorOpener>((to, id) => void quickOpen(to, id), [quickOpen]);\n useEffect(() => {\n if (anchor === null) return;\n anchorOpeners.set(anchor, onOpen);\n return () => {\n if (anchorOpeners.get(anchor) === onOpen) anchorOpeners.delete(anchor);\n };\n }, [anchor, onOpen]);\n\n const cancel = useCallback(() => {\n if (timer.current === null) return;\n clearTimeout(timer.current);\n timer.current = null;\n }, []);\n useEffect(() => cancel, [cancel]);\n\n const fire = useCallback(() => {\n timer.current = null;\n const { gate: ask, target: what, activation: from } = latest.current;\n const element = anchorIn(wrapper.current);\n if (element === null || !element.isConnected) return;\n // Only `open` presents: undecided access reads nothing (spec 4.14), a refusal opens nothing.\n const answer = ask(what.to, 'peek');\n if (answer.state !== 'open') return;\n const snapshot = runtime.getSnapshot();\n if (snapshot.some((d) => d.component === PEEK_COMPONENT && d.anchor?.element === element))\n return;\n // One peek at a time.\n for (const descriptor of snapshot)\n if (descriptor.component === PEEK_COMPONENT) runtime.dismiss(descriptor.id);\n const props: PeekScreenProps = {\n target: answer.target,\n ...(what.id === undefined ? {} : { id: what.id }),\n ...(what.by === undefined ? {} : { by: what.by }),\n };\n runtime.present({\n component: PEEK_COMPONENT,\n host: 'popover',\n anchor: { element },\n props: props as unknown as Readonly<Record<string, unknown>>,\n activation: from,\n });\n }, [runtime]);\n\n const schedule = useCallback(() => {\n if (timer.current !== null) return;\n timer.current = setTimeout(fire, PEEK_DELAY_MS);\n }, [fire]);\n\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: a `display: contents` wrapper that only observes the anchor inside it; the anchor is the interactive element\n <span\n ref={attach}\n className=\"contents\"\n onPointerEnter={(event: PointerEvent) => {\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') schedule();\n }}\n onPointerLeave={cancel}\n onFocus={(event: FocusEvent) => {\n if (focusedByCode.has(event.target)) return;\n if (keyboardModality()) schedule();\n }}\n onBlur={cancel}\n // A click is always quick.show (spec 4.6): it cancels a pending peek.\n onPointerDown={cancel}\n onClickCapture={cancel}\n >\n {children}\n </span>\n );\n}\n","'use client';\nimport type * as React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n hasRecordPage,\n relationAmbiguousError,\n resourceKey,\n relationOpenOf,\n type RelationOpen,\n resourceShowHref,\n type ResourceDef,\n type ResourceRefInput,\n routeResourceKey,\n type ResourceNameOrRef,\n} from '@burojs/core';\nimport {\n QUICK_ANCHOR_ATTRIBUTE,\n useApp,\n useEntryGate,\n useList,\n useOptionalT,\n useQuickOpener,\n useRelatedRecord,\n} from '@burojs/react';\nimport { LoadError } from '../load-error/load-error-view.js';\nimport { technicalText } from '../lib/friendly-error.js';\nimport { useRowTitle } from '../resource/use-row-title.js';\nimport { useLinkComponent } from '../layout/link-component.js';\nimport { PeekIntent, type PeekTarget } from '../quick/use-peek-intent.js';\nimport { ClaimedQuickLink } from './claimed-quick-link.js';\nimport type { FieldRendererProps } from './registry.js';\n\ntype App = ReturnType<typeof useApp>;\n\n/**\n * Shared link styling for in-table relation/row links. Persistent muted\n * dotted underline at idle that snaps to a solid foreground underline on\n * hover. Color stays at `text-foreground` so the link blends with body\n * text — affordance is carried by the underline alone, avoiding the\n * \"every link in brand color\" noise common in admin tables.\n *\n * Used by `<RelationDisplay>` and the first-cell row-anchor link in\n * `<ResourceList>`.\n *\n * `underline-offset-4` is intentional (vs the more common `-2`) to\n * clear the descenders of non-Latin glyphs seen in our\n * playground's Locations column.\n */\nexport const relationLinkClassName =\n 'rounded text-foreground underline decoration-muted-foreground/40 decoration-dotted underline-offset-4 transition-all hover:decoration-foreground hover:decoration-solid focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring';\n\n/**\n * Render a foreign-key value as a clickable link to the related\n * entity's show page.\n *\n * Resolution order:\n * 1. Read `field.meta.to` to get the target resource name (set by\n * `f.relation({ to: '<name>' })`).\n * 2. Look up the target resource's `displayField` from the app\n * registry — used to resolve the link text.\n * 3. Fetch the target record via `useRelatedRecord(to, id)`.\n * 4. Render `<a href=\"/<to>/<id>\">{displayName}</a>`.\n *\n * Fallbacks (matches the fail-soft policy used by `<EnumBadge>`):\n * - Value null/undefined/empty → em-dash placeholder, no fetch.\n * - Target resource not in registry → raw value as muted plain text.\n * Do NOT fire the fetch — the data provider would 404.\n * - Loading → small skeleton placeholder.\n * - Fetch errored → raw value muted, with the error message as title.\n * - Target row not found (no error, no record) → raw value muted with\n * `title=\"<resource>#<id> not found\"`.\n */\nexport function RelationDisplay({ value, field }: FieldRendererProps): React.ReactElement {\n const app = useApp();\n const meta = field?.meta as\n | { to?: ResourceRefInput; by?: unknown; resolve?: unknown }\n | undefined;\n const by = typeof meta?.by === 'string' ? meta.by : undefined;\n const lazy = meta?.resolve === 'lazy';\n // A target this surface cannot name — a builder field's thunk `to` that no app registration\n // lowered (a declarative form or display), or a malformed ref — renders like no target, as the\n // picker does, instead of throwing during render.\n let to: string | undefined;\n try {\n to = meta?.to === undefined ? undefined : resourceKey(meta.to);\n } catch {\n to = undefined;\n }\n const id = value as string | number | null | undefined;\n const idStr = String(value ?? '');\n const baseId = `relation-display:${to ?? 'unknown'}:${idStr}`;\n // What a click on the title opens: the overlay (default), the page, or nothing (`ui.open`).\n const open = relationOpenOf({ ui: (field as { readonly ui?: unknown } | undefined)?.ui });\n\n // Empty / null FK — render em-dash, do not fetch.\n // NB: do NOT short-circuit on `value === 0`; the relation schema is\n // `string | number`, and a target row with PK 0 (rare but valid) would\n // otherwise be silently treated as missing.\n if (value == null || value === '') {\n return (\n <span data-testid={`${baseId}:empty`} className=\"text-muted-foreground\">\n —\n </span>\n );\n }\n\n // Target resource not declared on the field. Without a target we\n // cannot build a link — degrade to plain text.\n if (!to) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[RelationDisplay] no meta.to declared on field — rendering raw value '${idStr}'`,\n );\n }\n return <span data-testid={`relation-display:unknown:${idStr}:no-target`}>{idStr}</span>;\n }\n\n // `lazy` (spec 4.3): nothing registers, nothing is read — the key itself is shown.\n if (lazy) return <LazyRelationDisplay to={to} by={by} idStr={idStr} app={app} open={open} />;\n\n return (\n <GatedRelationDisplay\n to={to}\n by={by}\n id={id as string | number}\n idStr={idStr}\n app={app}\n open={open}\n />\n );\n}\n\n/**\n * Public, adopter-facing entry point for rendering a foreign-key value.\n * Thin convenience wrapper over `<RelationDisplay>`: adopters write\n * `<RelationField to=\"reference_locations\" value={id} />` instead of\n * constructing the field-registry `{ name, meta }` shape by hand.\n * `RelationDisplay` itself stays the field-kind renderer registered for\n * `f.relation(...)` — its `{ value, field }` signature is dictated by the\n * `FieldRendererProps` contract and is unchanged.\n *\n * `RelationDisplay` reads the target resource from `field.meta.to` (see\n * `RelationDisplay` above), so this wrapper just shapes that `meta` object;\n * `field.name` is set to `''` since standalone usage has no owning field.\n */\nexport function RelationField<const N extends string = string>({\n to: toInput,\n value,\n}: {\n /** Target resource name (matches `f.relation({ to: '...' })`). */\n to: ResourceNameOrRef<N>;\n /** FK value to resolve, or null/undefined/'' when empty. */\n value: unknown;\n}): React.ReactElement {\n const to = routeResourceKey(toInput);\n return <RelationDisplay value={value} field={{ name: '', meta: { to } }} />;\n}\n\n/** What a key's peek previews: the row by id, or by the `by` field the key holds. */\nfunction peekTarget(to: string, by: string | undefined, key: string): PeekTarget {\n return by === undefined ? { to, id: key } : { to, by: { field: by, key } };\n}\n\n/** The definition whose record pages a link to `def`'s record lands on (`routesTo.show`). */\nfunction showPageDef(app: App, def: ResourceDef): ResourceDef | undefined {\n const delegate = def.routesTo?.show;\n if (delegate === undefined) return def;\n try {\n return app.registry.get(resourceKey(delegate as ResourceRefInput));\n } catch {\n return undefined;\n }\n}\n\n/** Whether `def`'s record has a show page to link to, following `routesTo.show`. */\nexport function linksToPage(app: App, def: ResourceDef): boolean {\n const target = showPageDef(app, def);\n return target !== undefined && hasRecordPage(target, 'show');\n}\n\n/**\n * A relation display's opener (spec 4.5): the title as an anchor to the page (when there is one)\n * or a button (when there is none), carrying `data-buro-quick` and claimed for the opener, whose\n * plain left click opens `quick.show` instead of navigating. A modified click follows the `href`.\n */\nfunction QuickOpener({\n href,\n testid,\n onOpen,\n children,\n}: {\n readonly href: string | null;\n readonly testid: string;\n readonly onOpen: () => void;\n readonly children: React.ReactNode;\n}): React.ReactElement {\n if (href === null)\n return (\n <button\n type=\"button\"\n data-testid={testid}\n {...{ [QUICK_ANCHOR_ATTRIBUTE]: '' }}\n className={`${relationLinkClassName} text-left`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n onOpen();\n }}\n >\n {children}\n </button>\n );\n return (\n <ClaimedQuickLink href={href} testid={testid} className={relationLinkClassName} onOpen={onOpen}>\n {children}\n </ClaimedQuickLink>\n );\n}\n\n/**\n * A lazy relation's key (spec 4.3, 4.5): nothing is read until it is clicked. An id key is the\n * opener of the target's `quick.show`; a `by` key is a button whose click reads the one row the\n * key names (`where <by> eq <key>`, two rows) and opens it — no row renders the not-available\n * text, two rows the muted key with the development error, and neither opens anything.\n */\nfunction LazyRelationDisplay({\n to,\n by,\n idStr,\n app,\n open: openMode,\n}: Omit<BodyProps, 'id'>): React.ReactElement {\n const RouterLink = useLinkComponent();\n const gate = useEntryGate();\n const open = useQuickOpener();\n const targetDef = app.registry.get(to);\n const baseId = `relation-display:${to}:${idStr}`;\n if (!targetDef || openMode === 'none') return <span data-testid={`${baseId}:lazy`}>{idStr}</span>;\n const answer = gate(to, 'show');\n // Undecided: the key as text, nothing read; its peek asks the gate again when it would open.\n if (answer.state === 'undecided')\n return (\n <PeekIntent target={peekTarget(to, by, idStr)}>\n <span data-testid={`${baseId}:lazy`}>{idStr}</span>\n </PeekIntent>\n );\n // Denied: the key as text, nothing to open (no read, no anchor).\n if (answer.state === 'hidden' || answer.state === 'disabled')\n return <span data-testid={`${baseId}:lazy`}>{idStr}</span>;\n const page = linksToPage(app, targetDef);\n // `open: 'page'`: the key is a plain page link whatever the gate says about the overlay.\n if (openMode === 'page') {\n if (by !== undefined || !page) return <span data-testid={`${baseId}:lazy`}>{idStr}</span>;\n return (\n <RouterLink\n href={resourceShowHref(app.registry, targetDef, to, idStr)}\n data-testid={`${baseId}:lazy`}\n className={relationLinkClassName}\n onClick={(e) => e.stopPropagation()}\n >\n {idStr}\n </RouterLink>\n );\n }\n if (answer.state !== 'open') {\n if (by !== undefined || !page) return <span data-testid={`${baseId}:lazy`}>{idStr}</span>;\n return (\n <RouterLink\n href={resourceShowHref(app.registry, targetDef, to, idStr)}\n data-testid={`${baseId}:lazy`}\n className={relationLinkClassName}\n onClick={(e) => e.stopPropagation()}\n >\n {idStr}\n </RouterLink>\n );\n }\n if (by !== undefined)\n return (\n <PeekIntent target={peekTarget(to, by, idStr)}>\n <LazyByOpener to={to} by={by} idStr={idStr} target={answer.target} />\n </PeekIntent>\n );\n const openKey = () => void open(to, idStr);\n return (\n <PeekIntent target={peekTarget(to, undefined, idStr)}>\n <QuickOpener\n href={page ? resourceShowHref(app.registry, targetDef, to, idStr) : null}\n testid={`${baseId}:lazy`}\n onOpen={openKey}\n >\n {idStr}\n </QuickOpener>\n </PeekIntent>\n );\n}\n\n/** A lazy `by` key's button: one `where <by> eq <key>` read on click, then the row it names. */\nfunction LazyByOpener({\n to,\n by,\n idStr,\n target,\n}: {\n readonly to: string;\n readonly by: string;\n readonly idStr: string;\n readonly target: string;\n}): React.ReactElement {\n const app = useApp();\n const t = useOptionalT();\n const open = useQuickOpener();\n const [asked, setAsked] = useState(false);\n const read = useList(to, {\n ...(asked\n ? {\n filter: { field: by, op: 'eq', value: idStr } as never,\n pagination: { kind: 'offset', page: 1, pageSize: 2 } as never,\n }\n : {}),\n // A key names one record: never narrowed by a scope. The quick peek reads this same\n // descriptor (`peek-screen.tsx`), so both say `'none'`.\n scope: 'none',\n enabled: asked,\n retry: false,\n });\n const rows = (read.data as { readonly data?: readonly Record<string, unknown>[] } | undefined)\n ?.data;\n const baseId = `relation-display:${to}:${idStr}`;\n const idField = (app.registry.get(target)?.data as { readonly idField?: unknown } | undefined)\n ?.idField;\n const rowId =\n rows?.length === 1\n ? rows[0]?.[typeof idField === 'string' && idField.length > 0 ? idField : 'id']\n : undefined;\n // Only a click opens: a click before the row is read leaves a request here, the effect below\n // answers it once; a refetch that changes the rows later opens nothing.\n const requested = useRef(false);\n useEffect(() => {\n if (!asked || rows === undefined || !requested.current) return;\n if (rows.length > 1) {\n requested.current = false;\n if (process.env.NODE_ENV !== 'production')\n console.error(`[burojs] ${technicalText(relationAmbiguousError(to, by, idStr))}`);\n return;\n }\n requested.current = false;\n if (rows.length === 1 && rowId !== undefined && rowId !== null) open(to, String(rowId));\n }, [asked, rows, rowId, open, to, by, idStr]);\n if (asked && rows !== undefined && rows.length === 0)\n return (\n <span data-testid={`${baseId}:unavailable`} className=\"text-muted-foreground\">\n {t('relation.unavailable', { defaultValue: 'Not available' })}\n </span>\n );\n if (asked && rows !== undefined && rows.length > 1)\n return (\n <span data-testid={`${baseId}:ambiguous`} className=\"text-muted-foreground\">\n {idStr}\n </span>\n );\n return (\n <button\n type=\"button\"\n data-testid={`${baseId}:lazy`}\n {...{ [QUICK_ANCHOR_ATTRIBUTE]: '' }}\n className={`${relationLinkClassName} text-left`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n // A key already read opens its row at once; otherwise the read answers this click.\n if (asked && rowId !== undefined && rowId !== null) open(to, String(rowId));\n else {\n requested.current = true;\n setAsked(true);\n }\n }}\n >\n {idStr}\n </button>\n );\n}\n\ninterface BodyProps {\n to: string;\n /** The target field the key holds (`meta.by`); the target's id field when absent. */\n by?: string;\n id: string | number;\n idStr: string;\n app: App;\n /** What a click on the title opens (`ui.open`). */\n open: RelationOpen;\n}\n\n/**\n * The entry gate decides before anything is read (spec 4.4, 4.14): while it is undecided (the\n * permission map loads) or when `show` is denied, the key renders as plain text and the display\n * registers no read; otherwise the body reads the title and renders the opener — or, when the\n * target has no quick show (`absent`), the page link of before, or text when there is no page.\n */\nfunction GatedRelationDisplay(props: BodyProps): React.ReactElement {\n const gate = useEntryGate();\n const target = props.to;\n const { idStr } = props;\n const answer = gate(target, 'show');\n // Undecided: plain text and no read; its peek (hover) asks the gate again when it would open,\n // and opens nothing until access is decided (spec 4.14).\n if (answer.state === 'undecided')\n return (\n <PeekIntent target={peekTarget(target, props.by, idStr)}>\n <span data-testid={`relation-display:${target}:${idStr}:text`}>{idStr}</span>\n </PeekIntent>\n );\n if (answer.state === 'hidden' || answer.state === 'disabled')\n return <span data-testid={`relation-display:${target}:${idStr}:text`}>{idStr}</span>;\n return (\n <RelationDisplayBody\n {...props}\n quickTarget={answer.state === 'open' && props.open === 'quick' ? answer.target : null}\n />\n );\n}\n\n/**\n * Split body so the hook is only called when we know `to` is set and\n * the value is non-falsy. React's rules of hooks require unconditional\n * hook calls per render — separating the body keeps the early-return\n * branches above hook-free.\n */\nfunction RelationDisplayBody({\n to,\n by,\n id,\n idStr,\n app,\n open: openMode,\n quickTarget,\n}: BodyProps & { readonly quickTarget: string | null }): React.ReactElement {\n const targetDef = app.registry.get(to);\n const rowTitle = useRowTitle(to, targetDef?.displayField);\n const baseId = `relation-display:${to}:${idStr}`;\n const RouterLink = useLinkComponent();\n const open = useQuickOpener();\n const { record, isLoading, error, ambiguous } = useRelatedRecord(\n to,\n id,\n by === undefined ? undefined : { by },\n );\n\n // Target resource not in registry — degrade to plain text. No link\n // can be built without a basePath. Same fail-soft as `<EnumBadge>`.\n if (!targetDef) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[RelationDisplay] target resource '${to}' not registered — rendering raw value '${idStr}'`,\n );\n }\n return (\n <span data-testid={`${baseId}:unregistered`} className=\"text-muted-foreground\">\n {idStr}\n </span>\n );\n }\n\n if (isLoading) {\n return (\n <span\n data-testid={`relation-display-loading:${to}`}\n className=\"inline-block h-5 w-20 animate-pulse rounded bg-muted\"\n aria-busy=\"true\"\n />\n );\n }\n\n // A key two rows hold: the raw key, muted — never either row (spec 4.2, fail closed).\n if (ambiguous) {\n return (\n <span\n data-testid={`${baseId}:ambiguous`}\n className=\"text-muted-foreground\"\n title={`${to}: more than one row has ${by ?? 'id'} ${idStr}`}\n >\n {idStr}\n </span>\n );\n }\n\n if (error) {\n return (\n <LoadError\n surface=\"relation\"\n error={error}\n resource={to}\n testId={`${baseId}:error`}\n className=\"text-muted-foreground\"\n fallback={{ key: 'relation.failed', default: 'Failed to load options.' }}\n >\n {idStr}\n </LoadError>\n );\n }\n\n if (!record) {\n return (\n <span\n data-testid={`${baseId}:not-found`}\n className=\"text-muted-foreground\"\n title={`${to} #${idStr} not found`}\n >\n {idStr}\n </span>\n );\n }\n\n const displayName = rowTitle(record);\n // The link names the resolved row by its id field (spec 4.2), never by the key: a `by` key is\n // not an id, and the target's id field need not be `id`.\n const idField = (targetDef.data as { readonly idField?: unknown } | undefined)?.idField;\n const rowId = record[typeof idField === 'string' && idField.length > 0 ? idField : 'id'];\n if (rowId === null || rowId === undefined || rowId === '')\n return (\n <span data-testid={`${baseId}:no-id`} className=\"text-muted-foreground\">\n {displayName}\n </span>\n );\n const page = linksToPage(app, targetDef);\n const href = page ? resourceShowHref(app.registry, targetDef, to, String(rowId)) : null;\n // `open: 'none'`: the title is text, no anchor and no button.\n if (openMode === 'none') return <span data-testid={baseId}>{displayName}</span>;\n if (quickTarget !== null)\n return (\n <RowOpener to={to} rowId={String(rowId)} href={href} testid={baseId} open={open}>\n {displayName}\n </RowOpener>\n );\n // No quick show (switched off, or no host wired): the page link, or text without a page.\n if (href === null) return <span data-testid={baseId}>{displayName}</span>;\n return (\n <RouterLink\n href={href}\n data-testid={baseId}\n className={relationLinkClassName}\n onClick={(e) => e.stopPropagation()}\n >\n {displayName}\n </RouterLink>\n );\n}\n\n/**\n * A resolved row's opener: a click opens its `quick.show`, a hover its peek — by the row's id,\n * the record descriptor `quick.show` reads, so the two share one read.\n */\nfunction RowOpener({\n to,\n rowId,\n href,\n testid,\n open,\n children,\n}: {\n readonly to: string;\n readonly rowId: string;\n readonly href: string | null;\n readonly testid: string;\n readonly open: ReturnType<typeof useQuickOpener>;\n readonly children: React.ReactNode;\n}): React.ReactElement {\n const onOpen = useCallback(() => void open(to, rowId), [open, to, rowId]);\n return (\n <PeekIntent target={peekTarget(to, undefined, rowId)}>\n <QuickOpener href={href} testid={testid} onOpen={onOpen}>\n {children}\n </QuickOpener>\n </PeekIntent>\n );\n}\n","import type { ErasedResourceHandle, FilterExpression, SearchDecl } from '@burojs/core';\nimport { filterFields } from '@burojs/react';\n\n/**\n * A declared search set without the fields its user may not view (P5 spec 3.7, decision P5-17).\n * No field left means no search. A function search is kept: its output is checked by\n * {@link namesHiddenField}.\n */\nexport function narrowSearchDecl(\n declared: SearchDecl | undefined,\n visible: (field: string) => boolean,\n): SearchDecl | undefined {\n if (declared === undefined || typeof declared === 'function') return declared;\n if (!Array.isArray(declared.fields)) return declared;\n const fields = declared.fields.filter((ref) =>\n visible(typeof ref === 'string' ? ref : ref.field),\n );\n if (fields.length === declared.fields.length) return declared;\n return fields.length === 0 ? undefined : { ...declared, fields };\n}\n\n/**\n * Whether a composed filter names a field its user may not view: an author predicate (a fixed\n * filter) or a function search's output. Such a read is forbidden, never narrowed — dropping a\n * narrowing predicate would fail open.\n */\nexport function namesHiddenField(\n filter: FilterExpression<ErasedResourceHandle> | undefined,\n visible: (field: string) => boolean,\n): boolean {\n return filter !== undefined && filterFields(filter).some((field) => !visible(field));\n}\n","'use client';\n\nimport * as React from 'react';\nimport {\n composeListFilter,\n type ErasedResourceHandle,\n type FilterExpression,\n type FixedFilterInput,\n normalizeFixedFilters,\n type ScopeSource,\n type SearchDecl,\n} from '@burojs/core';\nimport { useList } from '@burojs/react';\n\ntype ErasedExpression = FilterExpression<ErasedResourceHandle>;\n\n/**\n * The filter the select re-reads a created record through (P6-33): the picker's own option query\n * for an empty search (`composeListFilter`, the same `fixed` filters, the same search\n * declaration), conjoined with `<idField> eq <id>`. The row must come back through the query the\n * select offers from, or it is not selected.\n */\nexport function createdOptionFilter(input: {\n readonly fixed: readonly FixedFilterInput[] | undefined;\n readonly idField: string;\n readonly id: string | number;\n readonly searchDecl?: SearchDecl | undefined;\n readonly searchContext?: { readonly resource: string; readonly def: unknown };\n}): ErasedExpression {\n const own = createdOptionScope(input);\n const byId = { field: input.idField, op: 'eq', value: input.id } as ErasedExpression;\n return own === undefined ? byId : ({ and: [own, byId] } as ErasedExpression);\n}\n\n/**\n * The select's option query for an empty search, without the id predicate: what the picker itself\n * sends, so the same hidden-field rule (`namesHiddenField`) judges both.\n */\nexport function createdOptionScope(input: {\n readonly fixed: readonly FixedFilterInput[] | undefined;\n readonly searchDecl?: SearchDecl | undefined;\n readonly searchContext?: { readonly resource: string; readonly def: unknown };\n}): ErasedExpression | undefined {\n return composeListFilter({\n fixed: normalizeFixedFilters(input.fixed),\n search: '',\n ...(input.searchDecl === undefined ? {} : { searchDecl: input.searchDecl }),\n ...(input.searchContext === undefined ? {} : { searchContext: input.searchContext as never }),\n });\n}\n\n/** What the re-read settled on: the value to select, \"does not fit\", or a failed read. */\nexport type CreatedOptionResult =\n | { readonly kind: 'fits'; readonly value: string | number }\n | { readonly kind: 'does-not-fit' }\n | { readonly kind: 'failed' };\n\nexport interface CreatedOptionReadProps {\n readonly to: string;\n readonly filter: ErasedExpression;\n /**\n * The select's read scope, as its option list takes it: the picker and the hand-back never\n * disagree on which rows fit.\n */\n readonly scope: ScopeSource;\n /** The record field the select writes (`useList`'s `scopeField`), as its option list passes it. */\n readonly scopeField?: string;\n readonly by: string | undefined;\n readonly idField: string;\n /** Called once, with the settled answer. */\n readonly onSettled: (result: CreatedOptionResult) => void;\n}\n\n/**\n * Mounted only while a created record is being handed back. One list read, limit 1, through the\n * select's own option query (Known finding 13): an empty answer is \"does not fit\", a failed read\n * is a failure, never \"fits\". Mounting it is the request; unmounting it drops the answer.\n */\nexport function CreatedOptionRead({\n to,\n filter,\n scope,\n scopeField,\n by,\n idField,\n onSettled,\n}: CreatedOptionReadProps): null {\n const query = useList(to, {\n filter: filter as never,\n pagination: { kind: 'offset', page: 1, pageSize: 1 },\n scope,\n ...(scopeField === undefined ? {} : { scopeField }),\n retry: false,\n });\n const settled = React.useRef(false);\n const latest = React.useRef(onSettled);\n latest.current = onSettled;\n const rows = (query.data as { readonly data?: readonly Record<string, unknown>[] } | undefined)\n ?.data;\n const answered = rows !== undefined && query.isCurrentData && !query.isFetching;\n const failed = query.isError && !query.isFetching;\n React.useEffect(() => {\n if (settled.current) return;\n if (failed) {\n settled.current = true;\n latest.current({ kind: 'failed' });\n return;\n }\n if (!answered) return;\n settled.current = true;\n const value = rows[0]?.[by ?? idField];\n latest.current(\n typeof value === 'string' || typeof value === 'number'\n ? { kind: 'fits', value }\n : { kind: 'does-not-fit' },\n );\n }, [answered, failed, rows, by, idField]);\n return null;\n}\n","'use client';\n\nimport * as React from 'react';\nimport { IconEye } from '@tabler/icons-react';\nimport { type RelationOpen, resourceShowHref } from '@burojs/core';\nimport {\n QUICK_ANCHOR_ATTRIBUTE,\n useApp,\n useEntryGate,\n useList,\n useListAccess,\n useOptionalT,\n useQuick,\n useRouteNavigate,\n useTestIds,\n} from '@burojs/react';\nimport { buttonVariants } from '../primitives/button.js';\nimport { cn } from '../lib/cn.js';\nimport { useLinkComponent } from '../layout/link-component.js';\nimport { ClaimedQuickLink, isPlainLeftClick } from './claimed-quick-link.js';\nimport { linksToPage } from './relation-display.js';\n\n/** A key a read may send: a non-empty string or a finite number (Known finding 1). */\nexport function selectKey(value: unknown): string | null {\n if (typeof value === 'string') return value.length === 0 ? null : value;\n if (typeof value === 'number') return Number.isFinite(value) ? String(value) : null;\n return null;\n}\n\nconst VIEW_CLASS = cn(buttonVariants({ variant: 'outline', size: 'icon' }), 'shrink-0');\nconst TITLE_CLASS = 'min-w-0 max-w-[16rem] truncate';\nconst TITLE_VIEW_CLASS = cn(\n TITLE_CLASS,\n 'cursor-pointer rounded-sm text-left hover:underline focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring',\n);\n\nexport interface RelationViewButtonProps {\n readonly to: string;\n readonly value: unknown;\n readonly by: string | undefined;\n /** The form field holding the key: the test id's second part. */\n readonly fieldName: string;\n /** Runs before the overlay opens: the picker moves focus to its trigger, where it returns. */\n readonly beforeOpen: () => void;\n /**\n * The field's `ui.open` (P7 3.6): `quick` (default) opens the record above the form, `page`\n * goes to its show page through the navigation guard (a dirty form asks first), `none` draws\n * no button.\n */\n readonly open?: RelationOpen;\n /**\n * Draw the record's title as the trigger instead of the eye icon (a relation chip): the title\n * itself opens the record. Where \"view\" is not offered, the title is drawn as plain text.\n */\n readonly title?: string;\n}\n\n/**\n * \"View\" beside a relation select's trigger (P6-28): the target's `quick.show` as a new overlay\n * above the form, never a push and never closing the host. Drawn only when the select holds a\n * key and the entry gate is open without a row (the row-level re-check runs inside the overlay,\n * P3-44); while the gate is undecided nothing is drawn and nothing is read (P3-15). A `by` key is\n * resolved by the limit-2 read on click; zero or two rows open nothing.\n */\nexport function RelationViewButton(props: RelationViewButtonProps): React.ReactElement | null {\n const gate = useEntryGate();\n const { to, value, by } = props;\n const access = useListAccess(to);\n const key = selectKey(value);\n const plain = plainTitle(props.title);\n if (key === null || props.open === 'none') return plain;\n // A `by` field the user may not view is never sent as a predicate: no \"view\", no read.\n if (by !== undefined && !(access.status === 'ready' && access.fieldVisible(by))) return plain;\n const answer = gate(to, 'show');\n if (answer.state !== 'open') return plain;\n // Keyed by the value: a click asked for one key's read and must not outlive it.\n return <ViewButton key={key} {...props} keyString={key} />;\n}\n\nfunction plainTitle(title: string | undefined): React.ReactElement | null {\n return title === undefined ? null : <span className={TITLE_CLASS}>{title}</span>;\n}\n\nfunction ViewButton({\n to,\n by,\n fieldName,\n keyString,\n beforeOpen,\n open: openMode = 'quick',\n title,\n}: RelationViewButtonProps & { readonly keyString: string }): React.ReactElement | null {\n const app = useApp();\n const t = useOptionalT();\n const tid = useTestIds();\n const quick = useQuick();\n const navigate = useRouteNavigate();\n const RouterLink = useLinkComponent();\n const [asked, setAsked] = React.useState(false);\n const requested = React.useRef(false);\n const targetDef = app.registry.get(to);\n const rawIdField = (targetDef?.data as { readonly idField?: unknown } | undefined)?.idField;\n const idField = typeof rawIdField === 'string' && rawIdField.length > 0 ? rawIdField : 'id';\n const read = useList(to, {\n ...(asked && by !== undefined\n ? {\n filter: { field: by, op: 'eq', value: keyString } as never,\n pagination: { kind: 'offset', page: 1, pageSize: 2 } as never,\n }\n : {}),\n // A key names one record: the read is never narrowed by a scope.\n scope: 'none',\n enabled: asked && by !== undefined,\n retry: false,\n });\n // Rows of this key only: a placeholder carried over from another key's read is not an answer.\n const current = read.isCurrentData && !read.isPlaceholderData && !read.isFetching;\n const rows = current\n ? (read.data as { readonly data?: readonly Record<string, unknown>[] } | undefined)?.data\n : undefined;\n const open = React.useCallback(\n (id: string) => {\n beforeOpen();\n if (openMode === 'page') {\n // The page of the record, through the navigation guard: unsaved input asks first.\n if (targetDef !== undefined && linksToPage(app, targetDef))\n navigate(resourceShowHref(app.registry, targetDef, to, id));\n return;\n }\n quick.show(to, id);\n },\n [beforeOpen, quick, to, openMode, navigate, app, targetDef],\n );\n // Only a click opens: the read answers the click that asked for it, once.\n React.useEffect(() => {\n if (by === undefined || !asked || rows === undefined || !requested.current) return;\n requested.current = false;\n if (rows.length !== 1) {\n if (rows.length > 1 && process.env.NODE_ENV !== 'production')\n console.error(\n `[burojs] ${to}: more than one row has ${by} ${keyString}; \"view\" opened nothing.`,\n );\n return;\n }\n const id = rows[0]?.[idField];\n const next = selectKey(id);\n if (next !== null) open(next);\n }, [by, asked, rows, idField, keyString, to, open]);\n\n const label = t('relationPicker.view', { defaultValue: 'View' });\n const content = title === undefined ? <IconEye className=\"h-4 w-4\" aria-hidden /> : title;\n const className = title === undefined ? VIEW_CLASS : TITLE_VIEW_CLASS;\n const testid = tid.relationView(to, fieldName);\n // `page` needs a page to go to (the publish check says so): without one, nothing is drawn.\n if (openMode === 'page' && (targetDef === undefined || !linksToPage(app, targetDef)))\n return plainTitle(title);\n if (openMode === 'page' && by === undefined && targetDef !== undefined)\n return (\n <RouterLink\n href={resourceShowHref(app.registry, targetDef, to, keyString)}\n data-testid={testid}\n className={className}\n onClick={() => beforeOpen()}\n >\n <span className=\"sr-only\">{label} </span>\n {content}\n </RouterLink>\n );\n if (by === undefined && targetDef !== undefined && linksToPage(app, targetDef))\n return (\n <ClaimedQuickLink\n href={resourceShowHref(app.registry, targetDef, to, keyString)}\n testid={testid}\n className={className}\n onOpen={() => open(keyString)}\n >\n <span className=\"sr-only\">{label} </span>\n {content}\n </ClaimedQuickLink>\n );\n return (\n <button\n type=\"button\"\n className={className}\n data-testid={testid}\n aria-label={title === undefined ? label : `${label} ${title}`}\n {...{ [QUICK_ANCHOR_ATTRIBUTE]: '' }}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n // No page to follow (or, for a `by` key, no id to build it from): a modified click is\n // nothing, never an overlay the user asked to avoid.\n if (!isPlainLeftClick(event)) return;\n if (by === undefined) {\n open(keyString);\n return;\n }\n requested.current = true;\n setAsked(true);\n // A key already read opens at once; the effect answers a click made before the read.\n if (rows !== undefined && rows.length === 1) {\n const next = selectKey(rows[0]?.[idField]);\n requested.current = false;\n if (next !== null) open(next);\n }\n }}\n >\n {content}\n </button>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport type { FixedFilterInput, ScopeSource, SearchDecl } from '@burojs/core';\nimport {\n type QuickSettledRow,\n useApp,\n useListAccess,\n useEntryGate,\n useOptionalT,\n useQuick,\n useTestIds,\n} from '@burojs/react';\nimport { toast } from '../notification/toaster.js';\nimport {\n CreatedOptionRead,\n type CreatedOptionResult,\n createdOptionFilter,\n createdOptionScope,\n} from './relation-hand-back.js';\nimport { namesHiddenField } from './search-access.js';\nimport { selectKey } from './relation-view-button.js';\n\n/** What the picker and its dialog share: one pending create per select (P6-34). */\nexport interface SelectCreate {\n readonly pending: boolean;\n /**\n * The hand-back read is forbidden: its filter names a field P5 hides from the user (the same\n * rule that stops the picker's own option read), or the access map is not ready. A blocked\n * select offers no \"+ Create\" and starts none, so no predicate on a hidden field is ever sent.\n */\n readonly blocked: boolean;\n /** Runs `open` unless a create of this select is already pending or the select is gone. */\n start(open: () => Promise<QuickSettledRow>): void;\n}\n\ninterface SelectCreateInput {\n readonly to: string;\n readonly by: string | undefined;\n /** The row field the select holds (`by`, else the target's id field). */\n readonly valueField: string;\n readonly idField: string;\n readonly fixedFilters: readonly FixedFilterInput[] | undefined;\n /** The select's read scope: the hand-back reads as the option list does. */\n readonly scope: ScopeSource;\n /** The record field the select writes, as the option list passes it. */\n readonly scopeField?: string;\n /**\n * The select's candidates gate is not ready (pending, empty, forbidden): the filters above\n * lack the candidate filters, so the hand-back must not read.\n */\n readonly held?: boolean;\n readonly searchDecl: SearchDecl | undefined;\n readonly searchContext: { readonly resource: string; readonly def: unknown };\n /** Called with the value to select, as a user's pick would. */\n readonly onValue: (value: string | number) => void;\n}\n\n/**\n * The select's one pending create: the latch (a ref, so a double click or a second render cannot\n * start two), the mounted guard (a result arriving after the select unmounted is ignored — the\n * record exists, nothing is selected), and the hand-back re-read through the select's own option\n * query. `reader` is mounted by the select while a created record is being handed back.\n */\nexport function useSelectCreate(input: SelectCreateInput): {\n readonly create: SelectCreate;\n readonly reader: React.ReactNode;\n} {\n const t = useOptionalT();\n const { to: target } = input;\n const [pending, setPending] = React.useState(false);\n const [created, setCreated] = React.useState<{ readonly id: string } | null>(null);\n const latch = React.useRef(false);\n const mounted = React.useRef(true);\n React.useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n const latest = React.useRef(input);\n latest.current = input;\n const access = useListAccess(target);\n // The hand-back's own filter, judged as the picker judges its option query.\n const blocked =\n input.held === true ||\n access.status !== 'ready' ||\n namesHiddenField(\n createdOptionScope({\n fixed: input.fixedFilters,\n searchDecl: input.searchDecl,\n searchContext: input.searchContext,\n }),\n (name) => access.fieldVisible(name),\n );\n const blockedRef = React.useRef(blocked);\n blockedRef.current = blocked;\n\n const release = React.useCallback(() => {\n latch.current = false;\n if (mounted.current) {\n setPending(false);\n setCreated(null);\n }\n }, []);\n\n const start = React.useCallback(\n (open: () => Promise<QuickSettledRow>) => {\n if (latch.current || !mounted.current || blockedRef.current) return;\n latch.current = true;\n setPending(true);\n let opened: Promise<QuickSettledRow>;\n try {\n opened = open();\n } catch (error) {\n // A synchronous throw (a `beforeOpen`, the host) must not leave the select locked.\n release();\n throw error;\n }\n void opened.then(\n (row) => {\n if (!mounted.current) {\n latch.current = false;\n return;\n }\n const id =\n row === null ? null : (selectKey(row[latest.current.idField]) ?? selectKey(row.id));\n if (id === null) release();\n else setCreated({ id });\n },\n () => release(),\n );\n },\n [release],\n );\n\n const settle = React.useCallback(\n (result: CreatedOptionResult) => {\n if (mounted.current) {\n if (result.kind === 'fits') latest.current.onValue(result.value);\n else if (result.kind === 'does-not-fit')\n toast(\n t('relationPicker.createdNotFitting', {\n defaultValue: 'The record was created but does not fit this field',\n }),\n );\n else\n toast.error(\n t('relationPicker.createdNotSelected', {\n defaultValue: 'The record was created but could not be selected',\n }),\n );\n }\n release();\n },\n [release, t],\n );\n\n const create = React.useMemo<SelectCreate>(\n () => ({ pending, blocked, start }),\n [pending, blocked, start],\n );\n const reader =\n created === null || blocked ? null : (\n <CreatedOptionRead\n key={created.id}\n to={target}\n filter={createdOptionFilter({\n fixed: input.fixedFilters,\n idField: input.idField,\n id: created.id,\n searchDecl: input.searchDecl,\n searchContext: input.searchContext,\n })}\n scope={input.scope}\n {...(input.scopeField === undefined ? {} : { scopeField: input.scopeField })}\n by={input.by}\n idField={input.idField}\n onSettled={settle}\n />\n );\n return { create, reader };\n}\n\n/** A string field a typed search text may fill: declared plain, not system, not an enum. */\nfunction plainStringField(def: unknown): boolean {\n if (def === null || typeof def !== 'object') return false;\n const field = def as {\n readonly kind?: unknown;\n readonly system?: unknown;\n readonly opts?: {\n readonly system?: unknown;\n readonly enum?: unknown;\n readonly localized?: unknown;\n };\n };\n return (\n field.kind === 'string' &&\n field.system !== true &&\n field.opts?.system !== true &&\n field.opts?.enum === undefined &&\n field.opts?.localized !== true\n );\n}\n\nexport interface RelationCreateButtonProps {\n readonly to: string;\n readonly fieldName: string;\n readonly create: SelectCreate;\n /** The trusted `defaults` tier: the registry field's static `eq` literals (P6-31). */\n readonly seeds: Readonly<Record<string, unknown>> | undefined;\n /** The text typed into the select's search, if any: prefills the display field as user input. */\n readonly search?: string;\n /** Runs before the overlay opens: closes the popover, returns focus to the trigger. */\n readonly beforeOpen: () => void;\n readonly className?: string;\n readonly testId?: string;\n}\n\n/**\n * \"+ create\" (P6-29): the target's `quick.create` as a new overlay above the form. Drawn only when\n * the entry gate is open (P3 4.4: `operations.create`, `views.quick.create`, the host wired, the\n * `create` availability); undecided or denied draws nothing and reads nothing. Disabled while one\n * create of the select is pending.\n */\nexport function RelationCreateButton(props: RelationCreateButtonProps): React.ReactElement | null {\n const gate = useEntryGate();\n const { to } = props;\n if (props.create.blocked || gate(to, 'create').state !== 'open') return null;\n return <CreateButton {...props} />;\n}\n\nfunction CreateButton({\n to,\n fieldName,\n create,\n seeds,\n search,\n beforeOpen,\n className,\n testId,\n}: RelationCreateButtonProps): React.ReactElement {\n const app = useApp();\n const t = useOptionalT();\n const tid = useTestIds();\n const quick = useQuick();\n const label = t('relationPicker.create', { defaultValue: '+ Create' });\n return (\n <button\n type=\"button\"\n data-testid={testId ?? tid.relationCreate(to, fieldName)}\n disabled={create.pending}\n className={className}\n onClick={() => {\n const text = search?.trim() ?? '';\n const displayField = (\n app.registry.get(to) as { readonly displayField?: unknown } | undefined\n )?.displayField;\n const fields = (\n app.registry.get(to) as { readonly fields?: Record<string, unknown> } | undefined\n )?.fields;\n const prefill =\n text.length > 0 &&\n typeof displayField === 'string' &&\n fields !== undefined &&\n Object.hasOwn(fields, displayField) &&\n plainStringField(fields[displayField])\n ? { [displayField]: text }\n : undefined;\n create.start(() => {\n beforeOpen();\n return quick.create(to, {\n ...(seeds === undefined || Object.keys(seeds).length === 0 ? {} : { defaults: seeds }),\n ...(prefill === undefined ? {} : { input: prefill }),\n });\n });\n }}\n >\n {label}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA2BA,MAAMA,YAAU,MAAM,YAGnB,EAAE,WAAW,GAAG,SAAS,QAC1B,IAACC,SAAD;CACO;CACL,WAAW,GACT,6FACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,UAAQ,cAAcA,QAAiB;AAEvC,MAAM,eAAe,MAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,KAAC,OAAD;CAAK,WAAU;CAAkC,sBAAmB;CAApE,UAAA,CACE,IAAC,YAAD;EAAY,WAAU;EAAmC,eAAY;CAAQ,CAAA,GAC7E,IAACA,QAAiB,OAAlB;EACO;EACL,WAAW,GACT,uLACA,SACF;EACA,GAAI;CACL,CAAA,CACE;AACN,CAAA,CAAA;AACD,aAAa,cAAcA,QAAiB,MAAM;AAElD,MAAM,cAAc,MAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,IAACA,QAAiB,MAAlB;CACO;CACL,WAAW,GAAG,mDAAmD,SAAS;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