@entifix/react-controls 0.23.15 → 0.23.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/action-bar/action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAGrB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAOhC,+FAA+F;AAC/F,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;AAczE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,M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KAAK,IAAI,EACjD,QAAQ,UAAQ,GACf,aAAa,EAAE,CAYjB;AA4CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAW,EACX,UAAyB,EACzB,SAAS,GACV,EAAE,cAAc,+BAsJhB"}
@@ -118,6 +118,16 @@ function assertHierarchy(surface, items) {
118
118
  })
119
119
  }, item.key);
120
120
  };
121
+ /**
122
+ * Runs an overflow entry's act once the menu has finished closing.
123
+ *
124
+ * Closing a menu hands focus back to its trigger on its next frame — two
125
+ * animation frames — unless focus by then sits on something tabbable. A verb
126
+ * that opens a dialog focuses the dialog's own frame, which is not
127
+ * tabbable, so the menu pulled focus back out behind the dialog and Tab
128
+ * walked the page underneath it. One frame after that hand-back, the dialog
129
+ * opens from a settled trigger, exactly as it does from a visible button.
130
+ */ const afterMenuCloses = (act)=>act === undefined ? undefined : ()=>requestAnimationFrame(()=>requestAnimationFrame(()=>requestAnimationFrame(act)));
121
131
  const menu = (folded, key)=>{
122
132
  if (folded.length === 0) return undefined;
123
133
  const firstDestructive = folded.findIndex((item)=>item.destructive);
@@ -136,7 +146,7 @@ function assertHierarchy(surface, items) {
136
146
  tone: item.destructive ? 'destructive' : 'neutral',
137
147
  disabled: item.disabled,
138
148
  "aria-keyshortcuts": keyShortcuts(item),
139
- onClick: item.onSelect,
149
+ onClick: afterMenuCloses(item.onSelect),
140
150
  children: item.label
141
151
  })
142
152
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/molecules/action-bar/action-bar.tsx"],"sourcesContent":["'use client';\n\nimport type { UseCaseDescriptor } from '@entifix/core';\nimport { Fragment, type ReactNode } from 'react';\n\nimport { useT } from '../../../i18n/index.js';\nimport {\n type ActionSurface,\n type NavigationIntent,\n OVERFLOW_GLYPH,\n renderAnchor,\n type RenderLink,\n} from '../../actions/index.js';\nimport { ariaKeyShortcuts } from '../../actions/shortcut.js';\nimport { Button, button } from '../../atoms/button/index.js';\nimport { cn } from '../../utils/cn.js';\nimport { useHotkey } from '../../utils/use-hotkey.js';\nimport { Menu } from '../menu/index.js';\n\n/** Every surface an {@link ActionBar} renders: the palette lists, it does not render a bar. */\nexport type ActionBarSurface = Exclude<ActionSurface, 'command-palette'>;\n\n/**\n * Surfaces that are a **page** — a record's header and footer, a list's\n * toolbar. A destructive verb is never the primary there: the thing a page is\n * for is not destroying it. A selection's bar and a row are not pages, and\n * deleting what was selected may well be what the bar is for.\n */\nconst PAGE_SURFACES: ReadonlySet<ActionBarSurface> = new Set([\n 'form-header',\n 'form-footer',\n 'table-toolbar',\n]);\n\n/** How many secondaries stay visible beside the primary before the rest fold. */\nexport const VISIBLE_SECONDARIES = 3;\n\n/** One action in a bar: a declared verb, or one the surface brings itself (Save, New). */\nexport interface ActionBarItem {\n readonly key: string;\n /** Already in the reader's language. */\n readonly label: string;\n readonly emphasis?: 'primary' | 'default';\n /** Order among the secondaries, lowest first; absent keeps the given order. */\n readonly priority?: number;\n readonly destructive?: boolean;\n /** Shown on a row itself rather than only in its menu. */\n readonly rowInline?: boolean;\n readonly shortcut?: string;\n readonly disabled?: boolean;\n /**\n * An action that navigates rather than acts — a list's \"New\". It is never\n * folded into a menu, whatever its emphasis: a menu entry is a button, and a\n * link must stay a link so it can be opened in a new tab.\n */\n readonly href?: string;\n /** What the link means, for a host that answers navigation itself. */\n readonly intent?: NavigationIntent;\n readonly onSelect?: () => void;\n /**\n * Submits the form the bar sits in — a form's Save — so Enter in a field\n * saves too. As a button it leaves the act to the form's submit handler; in\n * a menu, where a menu item cannot submit, it runs `onSelect`.\n */\n readonly submit?: boolean;\n}\n\nexport interface ActionBarProps {\n readonly surface: ActionBarSurface;\n readonly items: readonly ActionBarItem[];\n /**\n * The overflow trigger's name. Defaults to \"More actions\"; a row passes\n * \"Actions for {record}\", so a list of rows is not a list of identical\n * buttons.\n */\n readonly menuLabel?: string;\n readonly size?: 'sm' | 'md';\n readonly renderLink?: RenderLink;\n readonly className?: string;\n}\n\n/**\n * The bar items for declared verbs: label translated, weight and order carried\n * from the descriptor, every one routed through `onSelect` — which is where a\n * surface's `invoke()` asks for a confirmation, so no surface can reach a verb\n * around it.\n */\nexport function itemsForUseCases(\n descriptors: readonly UseCaseDescriptor[],\n translate: (key: string) => string,\n onSelect: (descriptor: UseCaseDescriptor) => void,\n disabled = false,\n): ActionBarItem[] {\n return descriptors.map(descriptor => ({\n key: descriptor.key,\n label: translate(descriptor.labelKey),\n emphasis: descriptor.emphasis,\n priority: descriptor.priority,\n destructive: descriptor.confirm?.tone === 'destructive',\n rowInline: descriptor.rowInline === true,\n shortcut: descriptor.shortcut,\n disabled,\n onSelect: () => onSelect(descriptor),\n }));\n}\n\n/**\n * Secondaries in the order they render: by priority, then as given, with the\n * destructive ones last so a separator can stand between \"do\" and \"destroy\".\n */\nfunction ordered(items: readonly ActionBarItem[]): ActionBarItem[] {\n const ranked = items\n .map((item, index) => ({ item, index }))\n .sort(\n (a, b) =>\n (a.item.priority ?? Infinity) - (b.item.priority ?? Infinity) ||\n a.index - b.index,\n )\n .map(({ item }) => item);\n return [\n ...ranked.filter(item => !item.destructive),\n ...ranked.filter(item => item.destructive),\n ];\n}\n\nfunction assertHierarchy(\n surface: ActionBarSurface,\n items: readonly ActionBarItem[],\n): ActionBarItem | undefined {\n const primaries = items.filter(item => item.emphasis === 'primary');\n if (primaries.length > 1) {\n throw new Error(\n `The ${surface} surface has ${primaries.length} primary actions (${primaries\n .map(item => item.key)\n .join(\n ', ',\n )}). A surface has one thing it is for: declare one primary and give the rest the default emphasis.`,\n );\n }\n const [primary] = primaries;\n if (primary?.destructive && PAGE_SURFACES.has(surface)) {\n throw new Error(\n `\"${primary.key}\" is destructive and declared primary on ${surface}. A page is never for destroying itself: give it the default emphasis, and it renders last, after a separator.`,\n );\n }\n return primary;\n}\n\n/**\n * One way every surface renders its verbs\n * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)):\n * the primary, then up to {@link VISIBLE_SECONDARIES} secondaries, then a\n * \"More actions\" menu button holding the rest — destructive verbs last, after\n * a separator.\n *\n * ⚠️ **It collapses by container, not by viewport.** Below the container's\n * `md` width it renders the primary and one menu holding every secondary; a\n * bar inside a split view or a drawer is as narrow as its container, whatever\n * the window is. Both arrangements are in the DOM and CSS shows one, so the\n * server renders the right one with no measurement.\n *\n * A row renders differently: the verb it declares `rowInline` sits on the row,\n * and everything else is in one menu named for the record.\n *\n * It throws on a second primary, and on a destructive primary on a page\n * surface — both are declarations no rendering can make sensible.\n */\nexport function ActionBar({\n surface,\n items,\n menuLabel,\n size = 'sm',\n renderLink = renderAnchor,\n className,\n}: ActionBarProps) {\n const t = useT();\n const primary = assertHierarchy(surface, items);\n // A row's verbs are bound nowhere — every row would claim the same chord —\n // so they advertise none. Every other surface binds what it advertises.\n const bindsShortcuts = surface !== 'row-menu';\n const keyShortcuts = (item: ActionBarItem) =>\n bindsShortcuts && item.shortcut !== undefined\n ? ariaKeyShortcuts(item.shortcut)\n : undefined;\n const label = menuLabel ?? t('actions.more');\n\n const asButton = (item: ActionBarItem, variant: 'primary' | 'secondary') =>\n item.href === undefined ? (\n <Button\n key={item.key}\n type={item.submit ? 'submit' : 'button'}\n variant={item.destructive ? 'destructive' : variant}\n size={size}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={item.submit ? undefined : item.onSelect}\n >\n {item.label}\n </Button>\n ) : (\n <span key={item.key} className=\"contents\">\n {renderLink({\n href: item.href,\n className: button({ variant, size }),\n children: item.label,\n intent: item.intent ?? { kind: 'new' },\n })}\n </span>\n );\n\n const menu = (folded: readonly ActionBarItem[], key: string): ReactNode => {\n if (folded.length === 0) return undefined;\n const firstDestructive = folded.findIndex(item => item.destructive);\n return (\n <Menu key={key}>\n <Menu.Trigger aria-label={label} title={label}>\n {OVERFLOW_GLYPH}\n </Menu.Trigger>\n <Menu.Items>\n {folded.map((item, index) => (\n <Fragment key={item.key}>\n {index > 0 && index === firstDestructive && <Menu.Separator />}\n <Menu.Item\n tone={item.destructive ? 'destructive' : 'neutral'}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={item.onSelect}\n >\n {item.label}\n </Menu.Item>\n </Fragment>\n ))}\n </Menu.Items>\n </Menu>\n );\n };\n\n if (surface === 'row-menu') {\n const inline = items.filter(item => item.rowInline);\n return (\n <span className={cn('flex items-center gap-2xs', className)}>\n {inline.map(item => asButton(item, 'secondary'))}\n {menu(ordered(items.filter(item => !item.rowInline)), 'row')}\n </span>\n );\n }\n\n const links = items.filter(\n item => item !== primary && item.href !== undefined,\n );\n const secondaries = ordered(\n items.filter(item => item !== primary && item.href === undefined),\n );\n const visible = secondaries.slice(0, VISIBLE_SECONDARIES);\n const separatorAt = visible.findIndex(item => item.destructive);\n // A menu holding one entry is strictly worse than the button it replaced.\n const collapses = secondaries.length > 1;\n\n return (\n <div\n className={cn('min-w-0 @container/actions flex-1', className)}\n data-surface={surface}\n >\n {items.map(item =>\n item.shortcut === undefined ||\n item.onSelect === undefined ||\n item.href !== undefined ? null : (\n <ItemShortcut\n key={item.key}\n chord={item.shortcut}\n onSelect={item.onSelect}\n enabled={item.disabled !== true}\n />\n ),\n )}\n <div className=\"flex flex-wrap items-center gap-2xs\">\n {primary && asButton(primary, 'primary')}\n {links.map(item => asButton(item, 'secondary'))}\n <div\n className={cn(\n 'flex-wrap items-center gap-2xs',\n collapses ? '@md/actions:flex hidden' : 'flex',\n )}\n data-arrangement=\"wide\"\n >\n {visible.map((item, index) => (\n <span key={item.key} className=\"contents\">\n {index > 0 && index === separatorAt && (\n <span\n aria-hidden=\"true\"\n className=\"w-px self-stretch bg-border\"\n />\n )}\n {asButton(item, 'secondary')}\n </span>\n ))}\n {menu(secondaries.slice(VISIBLE_SECONDARIES), 'overflow')}\n </div>\n {collapses && (\n <div className=\"@md/actions:hidden flex\" data-arrangement=\"narrow\">\n {menu(secondaries, 'collapsed')}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Binds one item's shortcut for as long as the bar shows it — yielding to a\n * binding already there, so a host's own chord wins over a surface's default.\n */\nfunction ItemShortcut({\n chord,\n onSelect,\n enabled,\n}: {\n chord: string;\n onSelect: () => void;\n enabled: boolean;\n}) {\n useHotkey([chord], onSelect, { enabled, ifFree: true });\n return null;\n}\n"],"names":["Fragment","useT","OVERFLOW_GLYPH","renderAnchor","ariaKeyShortcuts","Button","button","cn","useHotkey","Menu","PAGE_SURFACES","Set","VISIBLE_SECONDARIES","itemsForUseCases","descriptors","translate","onSelect","disabled","map","descriptor","key","label","labelKey","emphasis","priority","destructive","confirm","tone","rowInline","shortcut","ordered","items","ranked","item","index","sort","a","b","Infinity","filter","assertHierarchy","surface","primaries","length","Error","join","primary","has","ActionBar","menuLabel","size","renderLink","className","t","bindsShortcuts","keyShortcuts","undefined","asButton","variant","href","type","submit","aria-keyshortcuts","onClick","span","children","intent","kind","menu","folded","firstDestructive","findIndex","Trigger","aria-label","title","Items","Separator","Item","inline","links","secondaries","visible","slice","separatorAt","collapses","div","data-surface","ItemShortcut","chord","enabled","data-arrangement","aria-hidden","ifFree"],"mappings":"AAAA;;AAGA,SAASA,QAAQ,QAAwB,QAAQ;AAEjD,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAGEC,cAAc,EACdC,YAAY,QAEP,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AAC7D,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,IAAI,QAAQ,mBAAmB;AAKxC;;;;;CAKC,GACD,MAAMC,gBAA+C,IAAIC,IAAI;IAC3D;IACA;IACA;CACD;AAED,+EAA+E,GAC/E,OAAO,MAAMC,sBAAsB,EAAE;AA8CrC;;;;;CAKC,GACD,OAAO,SAASC,iBACdC,WAAyC,EACzCC,SAAkC,EAClCC,QA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sources":["../../../../src/ui/molecules/action-bar/action-bar.tsx"],"sourcesContent":["'use client';\n\nimport type { UseCaseDescriptor } from '@entifix/core';\nimport { Fragment, type ReactNode } from 'react';\n\nimport { useT } from '../../../i18n/index.js';\nimport {\n type ActionSurface,\n type NavigationIntent,\n OVERFLOW_GLYPH,\n renderAnchor,\n type RenderLink,\n} from '../../actions/index.js';\nimport { ariaKeyShortcuts } from '../../actions/shortcut.js';\nimport { Button, button } from '../../atoms/button/index.js';\nimport { cn } from '../../utils/cn.js';\nimport { useHotkey } from '../../utils/use-hotkey.js';\nimport { Menu } from '../menu/index.js';\n\n/** Every surface an {@link ActionBar} renders: the palette lists, it does not render a bar. */\nexport type ActionBarSurface = Exclude<ActionSurface, 'command-palette'>;\n\n/**\n * Surfaces that are a **page** — a record's header and footer, a list's\n * toolbar. A destructive verb is never the primary there: the thing a page is\n * for is not destroying it. A selection's bar and a row are not pages, and\n * deleting what was selected may well be what the bar is for.\n */\nconst PAGE_SURFACES: ReadonlySet<ActionBarSurface> = new Set([\n 'form-header',\n 'form-footer',\n 'table-toolbar',\n]);\n\n/** How many secondaries stay visible beside the primary before the rest fold. */\nexport const VISIBLE_SECONDARIES = 3;\n\n/** One action in a bar: a declared verb, or one the surface brings itself (Save, New). */\nexport interface ActionBarItem {\n readonly key: string;\n /** Already in the reader's language. */\n readonly label: string;\n readonly emphasis?: 'primary' | 'default';\n /** Order among the secondaries, lowest first; absent keeps the given order. */\n readonly priority?: number;\n readonly destructive?: boolean;\n /** Shown on a row itself rather than only in its menu. */\n readonly rowInline?: boolean;\n readonly shortcut?: string;\n readonly disabled?: boolean;\n /**\n * An action that navigates rather than acts — a list's \"New\". It is never\n * folded into a menu, whatever its emphasis: a menu entry is a button, and a\n * link must stay a link so it can be opened in a new tab.\n */\n readonly href?: string;\n /** What the link means, for a host that answers navigation itself. */\n readonly intent?: NavigationIntent;\n readonly onSelect?: () => void;\n /**\n * Submits the form the bar sits in — a form's Save — so Enter in a field\n * saves too. As a button it leaves the act to the form's submit handler; in\n * a menu, where a menu item cannot submit, it runs `onSelect`.\n */\n readonly submit?: boolean;\n}\n\nexport interface ActionBarProps {\n readonly surface: ActionBarSurface;\n readonly items: readonly ActionBarItem[];\n /**\n * The overflow trigger's name. Defaults to \"More actions\"; a row passes\n * \"Actions for {record}\", so a list of rows is not a list of identical\n * buttons.\n */\n readonly menuLabel?: string;\n readonly size?: 'sm' | 'md';\n readonly renderLink?: RenderLink;\n readonly className?: string;\n}\n\n/**\n * The bar items for declared verbs: label translated, weight and order carried\n * from the descriptor, every one routed through `onSelect` — which is where a\n * surface's `invoke()` asks for a confirmation, so no surface can reach a verb\n * around it.\n */\nexport function itemsForUseCases(\n descriptors: readonly UseCaseDescriptor[],\n translate: (key: string) => string,\n onSelect: (descriptor: UseCaseDescriptor) => void,\n disabled = false,\n): ActionBarItem[] {\n return descriptors.map(descriptor => ({\n key: descriptor.key,\n label: translate(descriptor.labelKey),\n emphasis: descriptor.emphasis,\n priority: descriptor.priority,\n destructive: descriptor.confirm?.tone === 'destructive',\n rowInline: descriptor.rowInline === true,\n shortcut: descriptor.shortcut,\n disabled,\n onSelect: () => onSelect(descriptor),\n }));\n}\n\n/**\n * Secondaries in the order they render: by priority, then as given, with the\n * destructive ones last so a separator can stand between \"do\" and \"destroy\".\n */\nfunction ordered(items: readonly ActionBarItem[]): ActionBarItem[] {\n const ranked = items\n .map((item, index) => ({ item, index }))\n .sort(\n (a, b) =>\n (a.item.priority ?? Infinity) - (b.item.priority ?? Infinity) ||\n a.index - b.index,\n )\n .map(({ item }) => item);\n return [\n ...ranked.filter(item => !item.destructive),\n ...ranked.filter(item => item.destructive),\n ];\n}\n\nfunction assertHierarchy(\n surface: ActionBarSurface,\n items: readonly ActionBarItem[],\n): ActionBarItem | undefined {\n const primaries = items.filter(item => item.emphasis === 'primary');\n if (primaries.length > 1) {\n throw new Error(\n `The ${surface} surface has ${primaries.length} primary actions (${primaries\n .map(item => item.key)\n .join(\n ', ',\n )}). A surface has one thing it is for: declare one primary and give the rest the default emphasis.`,\n );\n }\n const [primary] = primaries;\n if (primary?.destructive && PAGE_SURFACES.has(surface)) {\n throw new Error(\n `\"${primary.key}\" is destructive and declared primary on ${surface}. A page is never for destroying itself: give it the default emphasis, and it renders last, after a separator.`,\n );\n }\n return primary;\n}\n\n/**\n * One way every surface renders its verbs\n * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)):\n * the primary, then up to {@link VISIBLE_SECONDARIES} secondaries, then a\n * \"More actions\" menu button holding the rest — destructive verbs last, after\n * a separator.\n *\n * ⚠️ **It collapses by container, not by viewport.** Below the container's\n * `md` width it renders the primary and one menu holding every secondary; a\n * bar inside a split view or a drawer is as narrow as its container, whatever\n * the window is. Both arrangements are in the DOM and CSS shows one, so the\n * server renders the right one with no measurement.\n *\n * A row renders differently: the verb it declares `rowInline` sits on the row,\n * and everything else is in one menu named for the record.\n *\n * It throws on a second primary, and on a destructive primary on a page\n * surface — both are declarations no rendering can make sensible.\n */\nexport function ActionBar({\n surface,\n items,\n menuLabel,\n size = 'sm',\n renderLink = renderAnchor,\n className,\n}: ActionBarProps) {\n const t = useT();\n const primary = assertHierarchy(surface, items);\n // A row's verbs are bound nowhere — every row would claim the same chord —\n // so they advertise none. Every other surface binds what it advertises.\n const bindsShortcuts = surface !== 'row-menu';\n const keyShortcuts = (item: ActionBarItem) =>\n bindsShortcuts && item.shortcut !== undefined\n ? ariaKeyShortcuts(item.shortcut)\n : undefined;\n const label = menuLabel ?? t('actions.more');\n\n const asButton = (item: ActionBarItem, variant: 'primary' | 'secondary') =>\n item.href === undefined ? (\n <Button\n key={item.key}\n type={item.submit ? 'submit' : 'button'}\n variant={item.destructive ? 'destructive' : variant}\n size={size}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={item.submit ? undefined : item.onSelect}\n >\n {item.label}\n </Button>\n ) : (\n <span key={item.key} className=\"contents\">\n {renderLink({\n href: item.href,\n className: button({ variant, size }),\n children: item.label,\n intent: item.intent ?? { kind: 'new' },\n })}\n </span>\n );\n\n /**\n * Runs an overflow entry's act once the menu has finished closing.\n *\n * Closing a menu hands focus back to its trigger on its next frame — two\n * animation frames — unless focus by then sits on something tabbable. A verb\n * that opens a dialog focuses the dialog's own frame, which is not\n * tabbable, so the menu pulled focus back out behind the dialog and Tab\n * walked the page underneath it. One frame after that hand-back, the dialog\n * opens from a settled trigger, exactly as it does from a visible button.\n */\n const afterMenuCloses = (act: (() => void) | undefined) =>\n act === undefined\n ? undefined\n : () =>\n requestAnimationFrame(() =>\n requestAnimationFrame(() => requestAnimationFrame(act)),\n );\n\n const menu = (folded: readonly ActionBarItem[], key: string): ReactNode => {\n if (folded.length === 0) return undefined;\n const firstDestructive = folded.findIndex(item => item.destructive);\n return (\n <Menu key={key}>\n <Menu.Trigger aria-label={label} title={label}>\n {OVERFLOW_GLYPH}\n </Menu.Trigger>\n <Menu.Items>\n {folded.map((item, index) => (\n <Fragment key={item.key}>\n {index > 0 && index === firstDestructive && <Menu.Separator />}\n <Menu.Item\n tone={item.destructive ? 'destructive' : 'neutral'}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={afterMenuCloses(item.onSelect)}\n >\n {item.label}\n </Menu.Item>\n </Fragment>\n ))}\n </Menu.Items>\n </Menu>\n );\n };\n\n if (surface === 'row-menu') {\n const inline = items.filter(item => item.rowInline);\n return (\n <span className={cn('flex items-center gap-2xs', className)}>\n {inline.map(item => asButton(item, 'secondary'))}\n {menu(ordered(items.filter(item => !item.rowInline)), 'row')}\n </span>\n );\n }\n\n const links = items.filter(\n item => item !== primary && item.href !== undefined,\n );\n const secondaries = ordered(\n items.filter(item => item !== primary && item.href === undefined),\n );\n const visible = secondaries.slice(0, VISIBLE_SECONDARIES);\n const separatorAt = visible.findIndex(item => item.destructive);\n // A menu holding one entry is strictly worse than the button it replaced.\n const collapses = secondaries.length > 1;\n\n return (\n <div\n className={cn('min-w-0 @container/actions flex-1', className)}\n data-surface={surface}\n >\n {items.map(item =>\n item.shortcut === undefined ||\n item.onSelect === undefined ||\n item.href !== undefined ? null : (\n <ItemShortcut\n key={item.key}\n chord={item.shortcut}\n onSelect={item.onSelect}\n enabled={item.disabled !== true}\n />\n ),\n )}\n <div className=\"flex flex-wrap items-center gap-2xs\">\n {primary && asButton(primary, 'primary')}\n {links.map(item => asButton(item, 'secondary'))}\n <div\n className={cn(\n 'flex-wrap items-center gap-2xs',\n collapses ? '@md/actions:flex hidden' : 'flex',\n )}\n data-arrangement=\"wide\"\n >\n {visible.map((item, index) => (\n <span key={item.key} className=\"contents\">\n {index > 0 && index === separatorAt && (\n <span\n aria-hidden=\"true\"\n className=\"w-px self-stretch bg-border\"\n />\n )}\n {asButton(item, 'secondary')}\n </span>\n ))}\n {menu(secondaries.slice(VISIBLE_SECONDARIES), 'overflow')}\n </div>\n {collapses && (\n <div className=\"@md/actions:hidden flex\" data-arrangement=\"narrow\">\n {menu(secondaries, 'collapsed')}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Binds one item's shortcut for as long as the bar shows it — yielding to a\n * binding already there, so a host's own chord wins over a surface's default.\n */\nfunction ItemShortcut({\n chord,\n onSelect,\n enabled,\n}: {\n chord: string;\n onSelect: () => void;\n enabled: boolean;\n}) {\n useHotkey([chord], onSelect, { enabled, ifFree: true });\n return null;\n}\n"],"names":["Fragment","useT","OVERFLOW_GLYPH","renderAnchor","ariaKeyShortcuts","Button","button","cn","useHotkey","Menu","PAGE_SURFACES","Set","VISIBLE_SECONDARIES","itemsForUseCases","descriptors","translate","onSelect","disabled","map","descriptor","key","label","labelKey","emphasis","priority","destructive","confirm","tone","rowInline","shortcut","ordered","items","ranked","item","index","sort","a","b","Infinity","filter","assertHierarchy","surface","primaries","length","Error","join","primary","has","ActionBar","menuLabel","size","renderLink","className","t","bindsShortcuts","keyShortcuts","undefined","asButton","variant","href","type","submit","aria-keyshortcuts","onClick","span","children","intent","kind","afterMenuCloses","act","requestAnimationFrame","menu","folded","firstDestructive","findIndex","Trigger","aria-label","title","Items","Separator","Item","inline","links","secondaries","visible","slice","separatorAt","collapses","div","data-surface","ItemShortcut","chord","enabled","data-arrangement","aria-hidden","ifFree"],"mappings":"AAAA;;AAGA,SAASA,QAAQ,QAAwB,QAAQ;AAEjD,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAGEC,cAAc,EACdC,YAAY,QAEP,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AAC7D,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,IAAI,QAAQ,mBAAmB;AAKxC;;;;;CAKC,GACD,MAAMC,gBAA+C,IAAIC,IAAI;IAC3D;IACA;IACA;CACD;AAED,+EAA+E,GAC/E,OAAO,MAAMC,sBAAsB,EAAE;AA8CrC;;;;;CAKC,GACD,OAAO,SAASC,iBACdC,WAAyC,EACzCC,SAAkC,EAClCC,QAAiD,EACjDC,WAAW,KAAK;IAEhB,OAAOH,YAAYI,GAAG,CAACC,CAAAA;YAKRA;eALuB;YACpCC,KAAKD,WAAWC,GAAG;YACnBC,OAAON,UAAUI,WAAWG,QAAQ;YACpCC,UAAUJ,WAAWI,QAAQ;YAC7BC,UAAUL,WAAWK,QAAQ;YAC7BC,aAAaN,EAAAA,sBAAAA,WAAWO,OAAO,qBAAlBP,oBAAoBQ,IAAI,MAAK;YAC1CC,WAAWT,WAAWS,SAAS,KAAK;YACpCC,UAAUV,WAAWU,QAAQ;YAC7BZ;YACAD,UAAU,IAAMA,SAASG;QAC3B;;AACF;AAEA;;;CAGC,GACD,SAASW,QAAQC,KAA+B;IAC9C,MAAMC,SAASD,MACZb,GAAG,CAAC,CAACe,MAAMC,QAAW,CAAA;YAAED;YAAMC;QAAM,CAAA,GACpCC,IAAI,CACH,CAACC,GAAGC;YACDD,kBAAgCC;eAAjC,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Q;oBACvB4E,SAAS3D,KAAKhB,QAAQ,KAAK;mBAHtBgB,KAAKb,GAAG;0BAOnB,MAACoE;gBAAIpC,WAAU;;oBACZN,WAAWW,SAASX,SAAS;oBAC7BoC,MAAMhE,GAAG,CAACe,CAAAA,OAAQwB,SAASxB,MAAM;kCAClC,MAACuD;wBACCpC,WAAW7C,GACT,kCACAgF,YAAY,4BAA4B;wBAE1CM,oBAAiB;;4BAEhBT,QAAQlE,GAAG,CAAC,CAACe,MAAMC,sBAClB,MAAC8B;oCAAoBZ,WAAU;;wCAC5BlB,QAAQ,KAAKA,UAAUoD,6BACtB,KAACtB;4CACC8B,eAAY;4CACZ1C,WAAU;;wCAGbK,SAASxB,MAAM;;mCAPPA,KAAKb,GAAG;4BAUpBmD,KAAKY,YAAYE,KAAK,CAACzE,sBAAsB;;;oBAE/C2E,2BACC,KAACC;wBAAIpC,WAAU;wBAA0ByC,oBAAiB;kCACvDtB,KAAKY,aAAa;;;;;;AAM/B;AAEA;;;CAGC,GACD,SAASO,aAAa,EACpBC,KAAK,EACL3E,QAAQ,EACR4E,OAAO,EAKR;IACCpF,UAAU;QAACmF;KAAM,EAAE3E,UAAU;QAAE4E;QAASG,QAAQ;IAAK;IACrD,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/react-controls",
3
- "version": "0.23.15",
3
+ "version": "0.23.16",
4
4
  "description": "Entity-agnostic React UI — table, form, filters, wizard, command palette — rendered from entity metadata, plus layout primitives.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -19,7 +19,7 @@
19
19
  "@headlessui/react": "^2.2.10",
20
20
  "class-variance-authority": "^0.7.1",
21
21
  "idb": "^8.0.4",
22
- "@entifix/core": "0.23.15"
22
+ "@entifix/core": "0.23.16"
23
23
  },
24
24
  "exports": {
25
25
  "./package.json": "./package.json",
@@ -55,8 +55,8 @@
55
55
  "react": "19.3.1",
56
56
  "react-i18next": "18.0.1",
57
57
  "storybook": "^10.6.8",
58
- "@entifix/i18n": "0.23.15",
59
- "@entifix/style": "0.23.15"
58
+ "@entifix/style": "0.23.16",
59
+ "@entifix/i18n": "0.23.16"
60
60
  },
61
61
  "nx": {
62
62
  "tags": [
@@ -111,7 +111,7 @@
111
111
  "i18next": ">=26 <28",
112
112
  "react": ">=19 <20",
113
113
  "react-i18next": ">=17 <19",
114
- "@entifix/i18n": "0.23.15"
114
+ "@entifix/i18n": "0.23.16"
115
115
  },
116
116
  "peerDependenciesMeta": {
117
117
  "@entifix/i18n": {