@k2b/ui 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/browser/chat/ChatDecision.js +10 -6
  2. package/dist/browser/chat/ChatDecision.js.map +1 -1
  3. package/dist/browser/content/VirtualFeed.js +26 -21
  4. package/dist/browser/content/VirtualFeed.js.map +1 -1
  5. package/dist/browser/inputs/Combobox.js +14 -6
  6. package/dist/browser/inputs/Combobox.js.map +1 -1
  7. package/dist/browser/layout/AnchoredPopover.js +2 -1
  8. package/dist/browser/layout/AnchoredPopover.js.map +1 -1
  9. package/dist/browser/layout/AppWorkspace.js +340 -440
  10. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  11. package/dist/browser/layout/AppWorkspaceSidebarItemStatus.js +113 -0
  12. package/dist/browser/layout/AppWorkspaceSidebarItemStatus.js.map +1 -0
  13. package/dist/browser/layout/DetailPanel.js +1 -1
  14. package/dist/browser/layout/DetailPanel.js.map +1 -1
  15. package/dist/browser/layout/DetailSections.js +236 -132
  16. package/dist/browser/layout/DetailSections.js.map +1 -1
  17. package/dist/browser/layout/MobileShell.js +30 -13
  18. package/dist/browser/layout/MobileShell.js.map +1 -1
  19. package/dist/browser/layout/detail-sections-messages.js +4 -0
  20. package/dist/browser/layout/detail-sections-messages.js.map +1 -1
  21. package/dist/browser/layout/index.js +1 -0
  22. package/dist/browser/layout/index.js.map +1 -1
  23. package/dist/ssr/chat/ChatDecision.js +10 -6
  24. package/dist/ssr/chat/ChatDecision.js.map +1 -1
  25. package/dist/ssr/content/VirtualFeed.js +26 -21
  26. package/dist/ssr/content/VirtualFeed.js.map +1 -1
  27. package/dist/ssr/inputs/Combobox.js +6 -3
  28. package/dist/ssr/inputs/Combobox.js.map +1 -1
  29. package/dist/ssr/layout/AnchoredPopover.js +2 -1
  30. package/dist/ssr/layout/AnchoredPopover.js.map +1 -1
  31. package/dist/ssr/layout/AppWorkspace.js +61 -127
  32. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  33. package/dist/ssr/layout/AppWorkspaceSidebarItemStatus.js +76 -0
  34. package/dist/ssr/layout/AppWorkspaceSidebarItemStatus.js.map +1 -0
  35. package/dist/ssr/layout/DetailPanel.js +1 -1
  36. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  37. package/dist/ssr/layout/DetailSections.js +126 -50
  38. package/dist/ssr/layout/DetailSections.js.map +1 -1
  39. package/dist/ssr/layout/MobileShell.js +16 -2
  40. package/dist/ssr/layout/MobileShell.js.map +1 -1
  41. package/dist/ssr/layout/detail-sections-messages.js +4 -0
  42. package/dist/ssr/layout/detail-sections-messages.js.map +1 -1
  43. package/dist/ssr/layout/index.js +1 -0
  44. package/dist/ssr/layout/index.js.map +1 -1
  45. package/dist/styles.css +1 -1
  46. package/dist/types/chat/ChatDecision.d.ts +5 -0
  47. package/dist/types/inputs/Combobox.d.ts +2 -0
  48. package/dist/types/layout/AppWorkspace.d.ts +2 -28
  49. package/dist/types/layout/AppWorkspaceSidebarItemStatus.d.ts +30 -0
  50. package/dist/types/layout/DetailSections.d.ts +32 -2
  51. package/dist/types/layout/MobileShell.d.ts +12 -0
  52. package/dist/types/layout/detail-sections-messages.d.ts +2 -0
  53. package/dist/types/layout/index.d.ts +1 -0
  54. package/package.json +1 -1
@@ -0,0 +1,76 @@
1
+ import { memo as _$memo } from "solid-js/web";
2
+ import { createComponent as _$createComponent } from "solid-js/web";
3
+ import { ssr as _$ssr } from "solid-js/web";
4
+ import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
5
+ import { escape as _$escape } from "solid-js/web";
6
+ var _tmpl$ = "<span class=\"k2b-app-workspace__sidebar-status-mention\" aria-hidden=\"true\">@</span>",
7
+ _tmpl$2 = "<span class=\"k2b-app-workspace__sidebar-status-muted\" aria-hidden=\"true\"><i class=\"ti ti-bell-off\"></i></span>",
8
+ _tmpl$3 = ["<span class=\"k2b-app-workspace__sidebar-status-count\"", ">", "</span>"],
9
+ _tmpl$4 = ["<span class=\"k2b-app-workspace__sidebar-status-unread\" aria-hidden=\"true\">", "</span>"],
10
+ _tmpl$5 = ["<span class=\"k2b-sr-only\">, ", "</span>"],
11
+ _tmpl$6 = ["<span class=\"k2b-app-workspace__sidebar-status\"", ">", "</span>"],
12
+ _tmpl$7 = "<span class=\"k2b-app-workspace__sidebar-status-dot\"></span>";
13
+ import { Show } from "solid-js";
14
+ import { useWorkspaceMessages } from "./workspace-messages";
15
+
16
+ /**
17
+ * Unread state for the trailing `meta` slot. Every mark keeps a fixed width,
18
+ * so the row keeps its height and the label its start in every state.
19
+ */
20
+
21
+ export const AppWorkspaceSidebarItemStatus = props => {
22
+ const workspaceMessages = useWorkspaceMessages();
23
+ const waiting = () => props.waiting && Number.isFinite(props.waiting.count) ? Math.max(0, Math.floor(props.waiting.count)) : null;
24
+ const count = () => waiting() ?? (typeof props.unread === "number" && props.unread >= 1 ? Math.floor(props.unread) : 0);
25
+ const dot = () => waiting() === null && props.unread === true;
26
+ // The marks are decorative; the row's accessible name gets one phrase instead,
27
+ // which says no more than the "99+" a capped count shows.
28
+ const description = () => [waiting() !== null ? props.waiting?.label ?? "" : count() > 99 ? workspaceMessages().sidebarUnreadMany : count() ? workspaceMessages().sidebarUnread({
29
+ count: count()
30
+ }) : dot() ? workspaceMessages().sidebarNewActivity : "", props.mention ? workspaceMessages().sidebarMentioned : "", props.muted ? workspaceMessages().sidebarMuted : ""].filter(Boolean).join(", ");
31
+ // The unread slot stays reserved at the end, and the marks that change most
32
+ // often sit outermost, so new activity or a mention never moves another mark.
33
+ // The element itself stays when there is nothing to show: empty, it takes no
34
+ // space, and it still keeps the row's label on one line, so the first count
35
+ // never re-wraps the label and moves the rows below.
36
+ return _$ssr(_tmpl$6, _$ssrAttribute("data-unread", waiting() !== null ? _$escape(undefined, true) : count() ? "count" : dot() ? "dot" : _$escape(undefined, true), false) + _$ssrAttribute("data-waiting", waiting() === null ? _$escape(undefined, true) : waiting() ? "count" : "zero", false) + _$ssrAttribute("data-muted", props.muted ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
37
+ get when() {
38
+ return description();
39
+ },
40
+ get children() {
41
+ return [_$createComponent(Show, {
42
+ get when() {
43
+ return props.mention;
44
+ },
45
+ get children() {
46
+ return _$ssr(_tmpl$);
47
+ }
48
+ }), _$createComponent(Show, {
49
+ get when() {
50
+ return props.muted;
51
+ },
52
+ get children() {
53
+ return _$ssr(_tmpl$2);
54
+ }
55
+ }), _$ssr(_tmpl$4, _$escape(_$createComponent(Show, {
56
+ get when() {
57
+ return count() || waiting() === 0;
58
+ },
59
+ get fallback() {
60
+ return _$createComponent(Show, {
61
+ get when() {
62
+ return dot();
63
+ },
64
+ get children() {
65
+ return _$ssr(_tmpl$7);
66
+ }
67
+ });
68
+ },
69
+ get children() {
70
+ return _$ssr(_tmpl$3, _$ssrAttribute("data-mention", props.mention ? "true" : _$escape(undefined, true), false), count() > 99 ? "99+" : _$escape(count()));
71
+ }
72
+ }))), _$ssr(_tmpl$5, _$escape(description()))];
73
+ }
74
+ })));
75
+ };
76
+ //# sourceMappingURL=AppWorkspaceSidebarItemStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["layout/AppWorkspaceSidebarItemStatus.tsx"],"sourcesContent":["import { type JSX, Show } from \"solid-js\";\nimport { useWorkspaceMessages } from \"./workspace-messages\";\n\n/**\n * Unread state for the trailing `meta` slot. Every mark keeps a fixed width,\n * so the row keeps its height and the label its start in every state.\n */\nexport type AppWorkspaceSidebarItemStatusProps = {\n /**\n * A positive number shows a count (above 99 as \"99+\") and sets the label in\n * a stronger weight; `true` shows a quiet dot for new activity that should\n * not draw attention, such as in a muted conversation.\n */\n unread?: number | boolean;\n /** Marks unread items that mention the person with \"@\". */\n mention?: boolean;\n /**\n * Shows a muted bell, and the item reads as set aside: its label in the muted ink without unread weight, and a\n * mention count without its fill.\n */\n muted?: boolean;\n /**\n * Items that wait for the person, such as requests to approve, in the unread slot instead of `unread`. `label` is\n * the phrase a screen reader hears, for example \"3 waiting\". `0` stays as a muted count, for a count that dropped\n * to zero while the row is still shown; leave the prop out when nothing waits.\n */\n waiting?: { count: number; label: string };\n};\nexport const AppWorkspaceSidebarItemStatus = (props: AppWorkspaceSidebarItemStatusProps): JSX.Element => {\n const workspaceMessages = useWorkspaceMessages();\n const waiting = () => (props.waiting && Number.isFinite(props.waiting.count) ? Math.max(0, Math.floor(props.waiting.count)) : null);\n const count = () => waiting() ?? (typeof props.unread === \"number\" && props.unread >= 1 ? Math.floor(props.unread) : 0);\n const dot = () => waiting() === null && props.unread === true;\n // The marks are decorative; the row's accessible name gets one phrase instead,\n // which says no more than the \"99+\" a capped count shows.\n const description = () =>\n [\n waiting() !== null\n ? (props.waiting?.label ?? \"\")\n : count() > 99\n ? workspaceMessages().sidebarUnreadMany\n : count()\n ? workspaceMessages().sidebarUnread({ count: count() })\n : dot()\n ? workspaceMessages().sidebarNewActivity\n : \"\",\n props.mention ? workspaceMessages().sidebarMentioned : \"\",\n props.muted ? workspaceMessages().sidebarMuted : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n // The unread slot stays reserved at the end, and the marks that change most\n // often sit outermost, so new activity or a mention never moves another mark.\n // The element itself stays when there is nothing to show: empty, it takes no\n // space, and it still keeps the row's label on one line, so the first count\n // never re-wraps the label and moves the rows below.\n return (\n <span\n class=\"k2b-app-workspace__sidebar-status\"\n data-unread={waiting() !== null ? undefined : count() ? \"count\" : dot() ? \"dot\" : undefined}\n data-waiting={waiting() === null ? undefined : waiting() ? \"count\" : \"zero\"}\n data-muted={props.muted ? \"true\" : undefined}\n >\n <Show when={description()}>\n <Show when={props.mention}>\n <span class=\"k2b-app-workspace__sidebar-status-mention\" aria-hidden=\"true\">\n @\n </span>\n </Show>\n <Show when={props.muted}>\n <span class=\"k2b-app-workspace__sidebar-status-muted\" aria-hidden=\"true\">\n <i class=\"ti ti-bell-off\" />\n </span>\n </Show>\n <span class=\"k2b-app-workspace__sidebar-status-unread\" aria-hidden=\"true\">\n <Show\n when={count() || waiting() === 0}\n fallback={\n <Show when={dot()}>\n <span class=\"k2b-app-workspace__sidebar-status-dot\" />\n </Show>\n }\n >\n <span class=\"k2b-app-workspace__sidebar-status-count\" data-mention={props.mention ? \"true\" : undefined}>\n {count() > 99 ? \"99+\" : count()}\n </span>\n </Show>\n </span>\n <span class=\"k2b-sr-only\">, {description()}</span>\n </Show>\n </span>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAAA,SAAmB,IAAI,QAAQ,UAAU;AACzC,SAAS,oBAAoB,QAAQ,sBAAsB;;AAE3D;AACA;AACA;AACA;;AAsBA,OAAO,MAAM,6BAA6B,GAAI,KAAyC,IAAkB;EACvG,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,CAAC;EAChD,MAAM,OAAO,GAAG,MAAO,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,IAAK;EACnI,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,CAAC,KAAK,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;EACvH,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;EAC7D;EACA;EACA,MAAM,WAAW,GAAG,MAClB,CACE,OAAO,CAAC,CAAC,KAAK,IAAI,GACb,KAAK,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,GAC3B,KAAK,CAAC,CAAC,GAAG,EAAE,GACV,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,GACrC,KA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,OAAO,GAAG,MAAM,YAAG,SAAS,iBACnG,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,YAAG,KAAK,CAAC,CAAC;QAAA;MAAA,8BAIR,WAAW,CAAC,CAAC;IAAA;EAAA;AAIlD,CAAC","ignoreList":[]}
@@ -523,7 +523,7 @@ const DetailPanelSection = props => {
523
523
  get children() {
524
524
  return _$ssr(_tmpl$29);
525
525
  }
526
- })), _$ssrAttribute("id", _$escape(bodyId, true), false), _$ssrAttribute("hidden", !open(), true), _$escape(props.children));
526
+ })), _$ssrAttribute("id", _$escape(bodyId, true), false), _$ssrAttribute("hidden", !open(), true), _$escape(resolved()));
527
527
  }
528
528
  });
529
529
  };
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["layout/DetailPanel.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, IconButton } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { useDetailPanelMessages } from \"./detail-panel-messages\";\nimport { createScrollFade } from \"./scroll-fade\";\n\nexport type DetailPanelProps = {\n /** Plain sections share their host surface, as in AppWorkspace.Detail. */\n surface?: \"default\" | \"plain\";\n children: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelHeaderBaseProps = {\n /** A short line above the title that names what is shown, such as \"Conversation\", followed by its state. */\n kind?: JSX.Element;\n title: JSX.Element;\n subtitle?: JSX.Element;\n meta?: JSX.Element;\n /**\n * The resource's \"…\" menu, shown before `actions`. Pass every less frequent command on the shown resource here,\n * so each panel opens its menu from the same place; an empty list shows no button.\n */\n menu?: readonly DropdownItem[];\n /** Accessible name of the \"…\" button. Defaults to \"More actions\". */\n menuLabel?: string;\n actions?: JSX.Element;\n primaryActions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelHeaderProps = DetailPanelHeaderBaseProps &\n (\n | {\n leading?: JSX.Element;\n icon?: never;\n }\n | {\n leading?: never;\n icon?: string;\n }\n );\n\nexport type DetailPanelBodyProps = {\n scrollFade?: boolean;\n children: JSX.Element;\n scrollPreserveKey?: string;\n class?: string;\n};\n\nexport type DetailPanelSummaryProps = {\n title: JSX.Element;\n children: JSX.Element;\n actions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelGroupProps = {\n children: JSX.Element;\n label?: string;\n /**\n * A visible quiet title, such as \"More about this conversation\". Its sections then stand flush as rows below\n * it, which suits collapsed secondary sections with a `summary`.\n */\n title?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelTone = \"accent\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\ntype DetailPanelSectionBaseProps = {\n title: JSX.Element;\n icon?: string;\n tone?: DetailPanelTone;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n class?: string;\n};\n\n/** One direct secondary command, rendered as a sibling icon button at the end of the row. */\nexport type DetailPanelActionSecondary = {\n /** Icon class, for example `ti ti-trash`. */\n icon: string;\n /** Accessible name and tooltip of the icon button. */\n label: string;\n onClick: () => void;\n variant?: \"danger\";\n};\n\ntype DetailPanelActionBaseProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n secondaryAction?: DetailPanelActionSecondary;\n /** Marks the row of the current place, such as the section in view, in the panel's accent. */\n current?: boolean;\n /** Lets the title wrap to two lines instead of ending with an ellipsis. */\n wrap?: boolean;\n class?: string;\n};\n\ntype DetailPanelActionMenuProps =\n | {\n menuItems?: never;\n menuLabel?: never;\n }\n | {\n menuItems: readonly DropdownItem[];\n menuLabel: string;\n };\n\nexport type DetailPanelActionLinkProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonLinkProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href: string;\n };\n\nexport type DetailPanelActionButtonProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href?: never;\n };\n\nexport type DetailPanelActionProps = DetailPanelActionLinkProps | DetailPanelActionButtonProps;\n\n/** A row that only shows something, such as a person and their role: the columns of an action, without a command. */\nexport type DetailPanelRowProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelSectionProps = DetailPanelSectionBaseProps &\n (\n | {\n children?: JSX.Element;\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\ntype DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {\n Header: (props: DetailPanelHeaderProps) => JSX.Element;\n Body: (props: DetailPanelBodyProps) => JSX.Element;\n Summary: (props: DetailPanelSummaryProps) => JSX.Element;\n Group: (props: DetailPanelGroupProps) => JSX.Element;\n Section: (props: DetailPanelSectionProps) => JSX.Element;\n Action: (props: DetailPanelActionProps) => JSX.Element;\n Row: (props: DetailPanelRowProps) => JSX.Element;\n};\n\nconst classNames = (base: string, extra?: string): string => (extra ? `${base} ${extra}` : base);\n\nconst showTruncatedTitle = (event: PointerEvent & { currentTarget: HTMLHeadingElement }) => {\n const heading = event.currentTarget;\n if (heading.scrollHeight > heading.clientHeight + 1) heading.title = heading.textContent ?? \"\";\n else heading.removeAttribute(\"title\");\n};\n\nconst DetailPanelHeader = (props: DetailPanelHeaderProps): JSX.Element => {\n const t = useDetailPanelMessages();\n const menuLabel = () => props.menuLabel ?? t().moreActions;\n const menuTrigger = () => (\n <Dropdown.Root items={props.menu ?? []} align=\"end\" label={menuLabel()} phone=\"sheet\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={menuLabel()} tooltip={menuLabel()}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n // With primary actions, \"…\" ends their row, next to the commands it extends; otherwise it sits beside close.\n const menuInActions = () => Boolean(props.menu?.length) && !props.primaryActions;\n return (\n <header class={classNames(\"k2b-detail-panel__header\", props.class)}>\n <div class=\"k2b-detail-panel__header-main\" data-identity={props.icon || props.leading ? \"true\" : undefined}>\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__header-icon\" aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <Show when={props.leading}>\n <div class=\"k2b-detail-panel__header-leading\">{props.leading}</div>\n </Show>\n <div class=\"k2b-detail-panel__heading\">\n <Show when={props.kind}>\n <div class=\"k2b-detail-panel__kind\">{props.kind}</div>\n </Show>\n {/* A long title wraps to two lines and ends with an ellipsis; then the native hint shows all of it. */}\n <h2 onPointerEnter={showTruncatedTitle}>{props.title}</h2>\n <Show when={props.subtitle || props.meta}>\n <div class=\"k2b-detail-panel__supporting\">\n <Show when={props.subtitle}>\n <p>{props.subtitle}</p>\n </Show>\n <Show when={props.meta}>\n <div class=\"k2b-detail-panel__meta\">{props.meta}</div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={menuInActions() || props.actions}>\n <div class=\"k2b-detail-panel__actions\">\n <Show when={menuInActions()}>{menuTrigger()}</Show>\n {props.actions}\n </div>\n </Show>\n </div>\n <Show when={props.primaryActions}>\n <div class=\"k2b-detail-panel__primary-actions\">\n {props.primaryActions}\n <Show when={props.menu?.length}>{menuTrigger()}</Show>\n </div>\n </Show>\n </header>\n );\n};\n\nconst DetailPanelBody = (props: DetailPanelBodyProps): JSX.Element => {\n let body!: HTMLDivElement;\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <div\n ref={body}\n class={classNames(\"k2b-detail-panel__body\", props.class)}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n data-scroll-preserve={props.scrollPreserveKey}\n >\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSummary = (props: DetailPanelSummaryProps): JSX.Element => {\n const headingId = `k2b-detail-panel-summary-${createUniqueId()}`;\n\n return (\n <section class={classNames(\"k2b-detail-panel__summary\", props.class)} aria-labelledby={headingId}>\n <header class=\"k2b-detail-panel__summary-header\">\n <h3 id={headingId}>{props.title}</h3>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__summary-actions\">{props.actions}</div>\n </Show>\n </header>\n <div class=\"k2b-detail-panel__summary-body\">{props.children}</div>\n </section>\n );\n};\n\nconst DetailPanelGroup = (props: DetailPanelGroupProps): JSX.Element => {\n const titleId = `k2b-detail-panel-group-${createUniqueId()}`;\n return (\n <div\n class={classNames(\"k2b-detail-panel__group\", props.class)}\n role=\"group\"\n aria-label={props.title ? undefined : props.label}\n aria-labelledby={props.title ? titleId : undefined}\n data-titled={props.title ? \"true\" : undefined}\n >\n <Show when={props.title}>\n <div class=\"k2b-detail-panel__group-title\" id={titleId}>\n {props.title}\n </div>\n </Show>\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSectionIcon = (props: Pick<DetailPanelSectionBaseProps, \"icon\" | \"tone\">): JSX.Element => (\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__section-icon\" data-tone={props.tone ?? \"neutral\"} aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n);\n\n/** A count chip, or \"None yet\" for zero; shared by sections and discussions. */\nexport const DetailPanelCount = (props: { count: number }): JSX.Element => {\n const messages = useDetailPanelMessages();\n return (\n <Show when={props.count > 0} fallback={<span class=\"k2b-detail-panel__none\">{messages().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{props.count}</span>\n </Show>\n );\n};\n\n/** Title, then its count and state right after it, so every section reads the same way. */\nconst SectionTitleMeta = (props: Pick<DetailPanelSectionBaseProps, \"count\" | \"meta\">): JSX.Element => (\n <>\n <Show when={props.count !== undefined}>\n <DetailPanelCount count={props.count ?? 0} />\n </Show>\n <Show when={props.meta}>\n <span class=\"k2b-detail-panel__section-meta\">{props.meta}</span>\n </Show>\n </>\n);\n\nconst DetailPanelActionContent = (props: DetailPanelActionBaseProps): JSX.Element => (\n <>\n {/* Hidden while empty: a row's icon, or its text when it has none, starts on the section's text edge. */}\n <span class=\"k2b-detail-panel__action-leading\">{props.leading}</span>\n <span class=\"k2b-detail-panel__action-copy\">\n <span class=\"k2b-detail-panel__action-title\">{props.title}</span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__action-description\">{props.description}</span>\n </Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-detail-panel__action-trailing\">{props.trailing}</span>\n </Show>\n </>\n);\n\nconst DetailPanelAction = (props: DetailPanelActionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"class\",\n \"current\",\n \"description\",\n \"href\",\n \"leading\",\n \"menuItems\",\n \"menuLabel\",\n \"secondaryAction\",\n \"title\",\n \"trailing\",\n \"wrap\",\n ]);\n const className = classNames(\"k2b-detail-panel__action\", local.class);\n const content = () => (\n <DetailPanelActionContent title={local.title} description={local.description} leading={local.leading} trailing={local.trailing} />\n );\n\n const action = () => (\n <Show\n when={local.href !== undefined}\n fallback={\n <Button\n {...(rest as Omit<DetailPanelActionButtonProps, keyof DetailPanelActionBaseProps>)}\n class={className}\n aria-current={local.current ? \"true\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </Button>\n }\n >\n <ButtonLink\n {...(rest as Omit<DetailPanelActionLinkProps, keyof DetailPanelActionBaseProps | \"href\">)}\n href={local.href as string}\n class={className}\n aria-current={local.current ? \"location\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </ButtonLink>\n </Show>\n );\n\n return (\n <Show when={local.secondaryAction || local.menuItems?.length} fallback={action()}>\n <div class=\"k2b-detail-panel__action-row\">\n {action()}\n <Show when={local.secondaryAction}>\n {(secondary) => (\n <IconButton\n size=\"sm\"\n variant=\"ghost\"\n label={secondary().label}\n class=\"k2b-detail-panel__action-secondary\"\n data-tone={secondary().variant}\n onClick={() => secondary().onClick()}\n >\n <i class={secondary().icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </Show>\n <Show when={local.menuItems?.length}>\n <Dropdown.Root items={local.menuItems ?? []} align=\"end\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu-trigger\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </div>\n </Show>\n );\n};\n\nconst DetailPanelRow = (props: DetailPanelRowProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel__row\", props.class)}>\n <DetailPanelActionContent title={props.title} description={props.description} leading={props.leading} trailing={props.trailing} />\n </div>\n);\n\nconst DetailPanelSection = (props: DetailPanelSectionProps): JSX.Element => {\n const headingId = `k2b-detail-panel-section-${createUniqueId()}`;\n const bodyId = `${headingId}-body`;\n const [internalOpen, setInternalOpen] = createSignal(props.defaultOpen ?? false);\n const open = () => props.open ?? internalOpen();\n let expand: HTMLButtonElement | undefined;\n let collapse: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n const toggle = (next: boolean) => {\n if (props.disabled) return;\n if (props.open === undefined) setInternalOpen(next);\n props.onOpenChange?.(next);\n };\n createEffect(() => {\n const expanded = open();\n // Restore focus only when its current control becomes hidden, including\n // a parent-controlled collapse while focus is inside an editor.\n queueMicrotask(() => {\n if (expanded !== open()) return;\n const active = expand?.ownerDocument.activeElement;\n if (expanded && active === expand) collapse?.focus();\n if (!expanded && (active === collapse || (active && body?.contains(active)))) expand?.focus();\n });\n });\n const className = () => classNames(\"k2b-detail-panel__section\", props.class);\n // Resolve once: reading `props.children` twice would instantiate the section body twice.\n const resolved = children(() => props.children);\n\n return (\n <Show\n when={props.collapsible}\n fallback={\n <section class={className()} aria-labelledby={headingId} data-icon={props.icon ? \"true\" : undefined}>\n <header class=\"k2b-detail-panel__section-header\">\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <div class=\"k2b-detail-panel__section-copy\">\n <div class=\"k2b-detail-panel__section-heading\">\n <h3 id={headingId}>{props.title}</h3>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n </div>\n <Show when={props.description}>\n <p class=\"k2b-detail-panel__section-description\">{props.description}</p>\n </Show>\n </div>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__section-actions\">{props.actions}</div>\n </Show>\n </header>\n <Show when={resolved()}>\n <div class=\"k2b-detail-panel__section-body\">{resolved()}</div>\n </Show>\n </section>\n }\n >\n <section\n class={className()}\n aria-labelledby={open() ? headingId : `${headingId}-closed`}\n data-open={open()}\n data-icon={props.icon ? \"true\" : undefined}\n data-summary={props.summary ? \"true\" : undefined}\n >\n <div hidden={open()}>\n <Button\n ref={expand}\n variant=\"ghost\"\n class=\"k2b-detail-panel__section-summary\"\n disabled={props.disabled}\n aria-expanded={false}\n aria-controls={bodyId}\n onClick={() => toggle(true)}\n >\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <span class=\"k2b-detail-panel__section-copy\">\n <span class=\"k2b-detail-panel__section-heading\">\n <span id={`${headingId}-closed`} class=\"k2b-detail-panel__section-title\">\n {props.title}\n </span>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n <Show when={props.summary}>\n <span class=\"k2b-detail-panel__section-preview k2b-truncate-fade\">{props.summary}</span>\n </Show>\n </span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__section-description\">{props.description}</span>\n </Show>\n </span>\n {/* Same column as the open header's collapse button, so nothing moves between the states. */}\n <span class=\"k2b-detail-panel__section-toggle\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </Button>\n </div>\n <div hidden={!open()}>\n <header class=\"k2b-detail-panel__section-header\">\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <div class=\"k2b-detail-panel__section-copy\">\n <div class=\"k2b-detail-panel__section-heading\">\n <h3 id={headingId}>{props.title}</h3>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n </div>\n <Show when={props.description}>\n <p class=\"k2b-detail-panel__section-description\">{props.description}</p>\n </Show>\n </div>\n <Button\n ref={collapse}\n variant=\"ghost\"\n size=\"sm\"\n class=\"k2b-detail-panel__section-toggle\"\n disabled={props.disabled}\n aria-labelledby={headingId}\n aria-expanded={true}\n aria-controls={bodyId}\n onClick={() => toggle(false)}\n >\n <i class=\"ti ti-chevron-up\" aria-hidden=\"true\" />\n </Button>\n </header>\n </div>\n <div ref={body} id={bodyId} hidden={!open()} class=\"k2b-detail-panel__section-body\">\n {props.children}\n </div>\n </section>\n </Show>\n );\n};\n\nconst DetailPanel = ((props: DetailPanelProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel\", props.class)} data-surface={props.surface}>\n {props.children}\n </div>\n)) as DetailPanelComponent;\n\nDetailPanel.Header = DetailPanelHeader;\nDetailPanel.Body = DetailPanelBody;\nDetailPanel.Summary = DetailPanelSummary;\nDetailPanel.Group = DetailPanelGroup;\nDetailPanel.Section = DetailPanelSection;\nDetailPanel.Action = DetailPanelAction;\nDetailPanel.Row = DetailPanelRow;\n\nexport default DetailPanel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAC3G,SAAS,MAAM,EAAE,UAAU,EAA0C,UAAU,QAAQ,mBAA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AC,KAAK;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAA,IAAE,IAAI;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;MAAA,gCAEvD,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,WAAW;QAAA;QAAA;UAAA,gCACuB,KAAK,CAAC,WAAW;QAAA;MAAA,gCAGtE,MAAM;QAEL,OAAO;QACP,IAAI;QAAA;QAAA,IAEJ,QAAQ;UAAA,OAAE,KAAK,CAAC,QAAQ;QAAA;QAAA,mBACP,SAAS;QAAA,iBACX,IAAI;QAAA,iBACJ,MAAM;QACrB,OAAO,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC;QAAA;UAAA;QAAA;MAAA,mCAMd,MAAM,0CAAU,CAAC,IAAI,CAAC,CAAC,kBACxC,KAAK,CAAC,QAAQ;IAAA;EAAA;AAKzB,CAAC;AAED,MAAM,WAAW,GAAK,KAAuB,oDAC/B,UAAU,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,0DAAgB,KAAK,CAAC,OAAO,0BACjF,KAAK,CAAC,QAAQ,EAEO;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,KAAK,GAAG,gBAAgB;AACpC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,GAAG,GAAG,cAAc;AAEhC,eAAe,WAAW","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["layout/DetailPanel.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, type JSX, Show, splitProps } from \"solid-js\";\nimport { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, IconButton } from \"../actions/Button\";\nimport { Dropdown, type DropdownItem } from \"../actions/Dropdown\";\nimport { useDetailPanelMessages } from \"./detail-panel-messages\";\nimport { createScrollFade } from \"./scroll-fade\";\n\nexport type DetailPanelProps = {\n /** Plain sections share their host surface, as in AppWorkspace.Detail. */\n surface?: \"default\" | \"plain\";\n children: JSX.Element;\n class?: string;\n};\n\ntype DetailPanelHeaderBaseProps = {\n /** A short line above the title that names what is shown, such as \"Conversation\", followed by its state. */\n kind?: JSX.Element;\n title: JSX.Element;\n subtitle?: JSX.Element;\n meta?: JSX.Element;\n /**\n * The resource's \"…\" menu, shown before `actions`. Pass every less frequent command on the shown resource here,\n * so each panel opens its menu from the same place; an empty list shows no button.\n */\n menu?: readonly DropdownItem[];\n /** Accessible name of the \"…\" button. Defaults to \"More actions\". */\n menuLabel?: string;\n actions?: JSX.Element;\n primaryActions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelHeaderProps = DetailPanelHeaderBaseProps &\n (\n | {\n leading?: JSX.Element;\n icon?: never;\n }\n | {\n leading?: never;\n icon?: string;\n }\n );\n\nexport type DetailPanelBodyProps = {\n scrollFade?: boolean;\n children: JSX.Element;\n scrollPreserveKey?: string;\n class?: string;\n};\n\nexport type DetailPanelSummaryProps = {\n title: JSX.Element;\n children: JSX.Element;\n actions?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelGroupProps = {\n children: JSX.Element;\n label?: string;\n /**\n * A visible quiet title, such as \"More about this conversation\". Its sections then stand flush as rows below\n * it, which suits collapsed secondary sections with a `summary`.\n */\n title?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelTone = \"accent\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\ntype DetailPanelSectionBaseProps = {\n title: JSX.Element;\n icon?: string;\n tone?: DetailPanelTone;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n class?: string;\n};\n\n/** One direct secondary command, rendered as a sibling icon button at the end of the row. */\nexport type DetailPanelActionSecondary = {\n /** Icon class, for example `ti ti-trash`. */\n icon: string;\n /** Accessible name and tooltip of the icon button. */\n label: string;\n onClick: () => void;\n variant?: \"danger\";\n};\n\ntype DetailPanelActionBaseProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n secondaryAction?: DetailPanelActionSecondary;\n /** Marks the row of the current place, such as the section in view, in the panel's accent. */\n current?: boolean;\n /** Lets the title wrap to two lines instead of ending with an ellipsis. */\n wrap?: boolean;\n class?: string;\n};\n\ntype DetailPanelActionMenuProps =\n | {\n menuItems?: never;\n menuLabel?: never;\n }\n | {\n menuItems: readonly DropdownItem[];\n menuLabel: string;\n };\n\nexport type DetailPanelActionLinkProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonLinkProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href: string;\n };\n\nexport type DetailPanelActionButtonProps = DetailPanelActionBaseProps &\n DetailPanelActionMenuProps &\n Omit<ButtonProps, \"children\" | \"class\" | \"size\" | \"title\" | \"variant\"> & {\n href?: never;\n };\n\nexport type DetailPanelActionProps = DetailPanelActionLinkProps | DetailPanelActionButtonProps;\n\n/** A row that only shows something, such as a person and their role: the columns of an action, without a command. */\nexport type DetailPanelRowProps = {\n title: JSX.Element;\n description?: JSX.Element;\n leading?: JSX.Element;\n trailing?: JSX.Element;\n class?: string;\n};\n\nexport type DetailPanelSectionProps = DetailPanelSectionBaseProps &\n (\n | {\n children?: JSX.Element;\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\ntype DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {\n Header: (props: DetailPanelHeaderProps) => JSX.Element;\n Body: (props: DetailPanelBodyProps) => JSX.Element;\n Summary: (props: DetailPanelSummaryProps) => JSX.Element;\n Group: (props: DetailPanelGroupProps) => JSX.Element;\n Section: (props: DetailPanelSectionProps) => JSX.Element;\n Action: (props: DetailPanelActionProps) => JSX.Element;\n Row: (props: DetailPanelRowProps) => JSX.Element;\n};\n\nconst classNames = (base: string, extra?: string): string => (extra ? `${base} ${extra}` : base);\n\nconst showTruncatedTitle = (event: PointerEvent & { currentTarget: HTMLHeadingElement }) => {\n const heading = event.currentTarget;\n if (heading.scrollHeight > heading.clientHeight + 1) heading.title = heading.textContent ?? \"\";\n else heading.removeAttribute(\"title\");\n};\n\nconst DetailPanelHeader = (props: DetailPanelHeaderProps): JSX.Element => {\n const t = useDetailPanelMessages();\n const menuLabel = () => props.menuLabel ?? t().moreActions;\n const menuTrigger = () => (\n <Dropdown.Root items={props.menu ?? []} align=\"end\" label={menuLabel()} phone=\"sheet\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={menuLabel()} tooltip={menuLabel()}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n // With primary actions, \"…\" ends their row, next to the commands it extends; otherwise it sits beside close.\n const menuInActions = () => Boolean(props.menu?.length) && !props.primaryActions;\n return (\n <header class={classNames(\"k2b-detail-panel__header\", props.class)}>\n <div class=\"k2b-detail-panel__header-main\" data-identity={props.icon || props.leading ? \"true\" : undefined}>\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__header-icon\" aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <Show when={props.leading}>\n <div class=\"k2b-detail-panel__header-leading\">{props.leading}</div>\n </Show>\n <div class=\"k2b-detail-panel__heading\">\n <Show when={props.kind}>\n <div class=\"k2b-detail-panel__kind\">{props.kind}</div>\n </Show>\n {/* A long title wraps to two lines and ends with an ellipsis; then the native hint shows all of it. */}\n <h2 onPointerEnter={showTruncatedTitle}>{props.title}</h2>\n <Show when={props.subtitle || props.meta}>\n <div class=\"k2b-detail-panel__supporting\">\n <Show when={props.subtitle}>\n <p>{props.subtitle}</p>\n </Show>\n <Show when={props.meta}>\n <div class=\"k2b-detail-panel__meta\">{props.meta}</div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={menuInActions() || props.actions}>\n <div class=\"k2b-detail-panel__actions\">\n <Show when={menuInActions()}>{menuTrigger()}</Show>\n {props.actions}\n </div>\n </Show>\n </div>\n <Show when={props.primaryActions}>\n <div class=\"k2b-detail-panel__primary-actions\">\n {props.primaryActions}\n <Show when={props.menu?.length}>{menuTrigger()}</Show>\n </div>\n </Show>\n </header>\n );\n};\n\nconst DetailPanelBody = (props: DetailPanelBodyProps): JSX.Element => {\n let body!: HTMLDivElement;\n createScrollFade(\n () => body,\n () => props.scrollFade !== false,\n );\n return (\n <div\n ref={body}\n class={classNames(\"k2b-detail-panel__body\", props.class)}\n data-scroll-fade-mode={props.scrollFade !== false ? \"both\" : undefined}\n data-scroll-preserve={props.scrollPreserveKey}\n >\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSummary = (props: DetailPanelSummaryProps): JSX.Element => {\n const headingId = `k2b-detail-panel-summary-${createUniqueId()}`;\n\n return (\n <section class={classNames(\"k2b-detail-panel__summary\", props.class)} aria-labelledby={headingId}>\n <header class=\"k2b-detail-panel__summary-header\">\n <h3 id={headingId}>{props.title}</h3>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__summary-actions\">{props.actions}</div>\n </Show>\n </header>\n <div class=\"k2b-detail-panel__summary-body\">{props.children}</div>\n </section>\n );\n};\n\nconst DetailPanelGroup = (props: DetailPanelGroupProps): JSX.Element => {\n const titleId = `k2b-detail-panel-group-${createUniqueId()}`;\n return (\n <div\n class={classNames(\"k2b-detail-panel__group\", props.class)}\n role=\"group\"\n aria-label={props.title ? undefined : props.label}\n aria-labelledby={props.title ? titleId : undefined}\n data-titled={props.title ? \"true\" : undefined}\n >\n <Show when={props.title}>\n <div class=\"k2b-detail-panel__group-title\" id={titleId}>\n {props.title}\n </div>\n </Show>\n {props.children}\n </div>\n );\n};\n\nconst DetailPanelSectionIcon = (props: Pick<DetailPanelSectionBaseProps, \"icon\" | \"tone\">): JSX.Element => (\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-detail-panel__section-icon\" data-tone={props.tone ?? \"neutral\"} aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n);\n\n/** A count chip, or \"None yet\" for zero; shared by sections and discussions. */\nexport const DetailPanelCount = (props: { count: number }): JSX.Element => {\n const messages = useDetailPanelMessages();\n return (\n <Show when={props.count > 0} fallback={<span class=\"k2b-detail-panel__none\">{messages().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{props.count}</span>\n </Show>\n );\n};\n\n/** Title, then its count and state right after it, so every section reads the same way. */\nconst SectionTitleMeta = (props: Pick<DetailPanelSectionBaseProps, \"count\" | \"meta\">): JSX.Element => (\n <>\n <Show when={props.count !== undefined}>\n <DetailPanelCount count={props.count ?? 0} />\n </Show>\n <Show when={props.meta}>\n <span class=\"k2b-detail-panel__section-meta\">{props.meta}</span>\n </Show>\n </>\n);\n\nconst DetailPanelActionContent = (props: DetailPanelActionBaseProps): JSX.Element => (\n <>\n {/* Hidden while empty: a row's icon, or its text when it has none, starts on the section's text edge. */}\n <span class=\"k2b-detail-panel__action-leading\">{props.leading}</span>\n <span class=\"k2b-detail-panel__action-copy\">\n <span class=\"k2b-detail-panel__action-title\">{props.title}</span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__action-description\">{props.description}</span>\n </Show>\n </span>\n <Show when={props.trailing}>\n <span class=\"k2b-detail-panel__action-trailing\">{props.trailing}</span>\n </Show>\n </>\n);\n\nconst DetailPanelAction = (props: DetailPanelActionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"class\",\n \"current\",\n \"description\",\n \"href\",\n \"leading\",\n \"menuItems\",\n \"menuLabel\",\n \"secondaryAction\",\n \"title\",\n \"trailing\",\n \"wrap\",\n ]);\n const className = classNames(\"k2b-detail-panel__action\", local.class);\n const content = () => (\n <DetailPanelActionContent title={local.title} description={local.description} leading={local.leading} trailing={local.trailing} />\n );\n\n const action = () => (\n <Show\n when={local.href !== undefined}\n fallback={\n <Button\n {...(rest as Omit<DetailPanelActionButtonProps, keyof DetailPanelActionBaseProps>)}\n class={className}\n aria-current={local.current ? \"true\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </Button>\n }\n >\n <ButtonLink\n {...(rest as Omit<DetailPanelActionLinkProps, keyof DetailPanelActionBaseProps | \"href\">)}\n href={local.href as string}\n class={className}\n aria-current={local.current ? \"location\" : undefined}\n data-current={local.current ? \"true\" : undefined}\n data-wrap={local.wrap ? \"true\" : undefined}\n variant=\"ghost\"\n size=\"sm\"\n >\n {content()}\n </ButtonLink>\n </Show>\n );\n\n return (\n <Show when={local.secondaryAction || local.menuItems?.length} fallback={action()}>\n <div class=\"k2b-detail-panel__action-row\">\n {action()}\n <Show when={local.secondaryAction}>\n {(secondary) => (\n <IconButton\n size=\"sm\"\n variant=\"ghost\"\n label={secondary().label}\n class=\"k2b-detail-panel__action-secondary\"\n data-tone={secondary().variant}\n onClick={() => secondary().onClick()}\n >\n <i class={secondary().icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </Show>\n <Show when={local.menuItems?.length}>\n <Dropdown.Root items={local.menuItems ?? []} align=\"end\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu\">\n <Dropdown.Trigger iconOnly size=\"sm\" variant=\"ghost\" label={local.menuLabel} class=\"k2b-detail-panel__action-menu-trigger\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </Show>\n </div>\n </Show>\n );\n};\n\nconst DetailPanelRow = (props: DetailPanelRowProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel__row\", props.class)}>\n <DetailPanelActionContent title={props.title} description={props.description} leading={props.leading} trailing={props.trailing} />\n </div>\n);\n\nconst DetailPanelSection = (props: DetailPanelSectionProps): JSX.Element => {\n const headingId = `k2b-detail-panel-section-${createUniqueId()}`;\n const bodyId = `${headingId}-body`;\n const [internalOpen, setInternalOpen] = createSignal(props.defaultOpen ?? false);\n const open = () => props.open ?? internalOpen();\n let expand: HTMLButtonElement | undefined;\n let collapse: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n const toggle = (next: boolean) => {\n if (props.disabled) return;\n if (props.open === undefined) setInternalOpen(next);\n props.onOpenChange?.(next);\n };\n createEffect(() => {\n const expanded = open();\n // Restore focus only when its current control becomes hidden, including\n // a parent-controlled collapse while focus is inside an editor.\n queueMicrotask(() => {\n if (expanded !== open()) return;\n const active = expand?.ownerDocument.activeElement;\n if (expanded && active === expand) collapse?.focus();\n if (!expanded && (active === collapse || (active && body?.contains(active)))) expand?.focus();\n });\n });\n const className = () => classNames(\"k2b-detail-panel__section\", props.class);\n // Resolve once: reading `props.children` twice would instantiate the section body twice.\n const resolved = children(() => props.children);\n\n return (\n <Show\n when={props.collapsible}\n fallback={\n <section class={className()} aria-labelledby={headingId} data-icon={props.icon ? \"true\" : undefined}>\n <header class=\"k2b-detail-panel__section-header\">\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <div class=\"k2b-detail-panel__section-copy\">\n <div class=\"k2b-detail-panel__section-heading\">\n <h3 id={headingId}>{props.title}</h3>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n </div>\n <Show when={props.description}>\n <p class=\"k2b-detail-panel__section-description\">{props.description}</p>\n </Show>\n </div>\n <Show when={props.actions}>\n <div class=\"k2b-detail-panel__section-actions\">{props.actions}</div>\n </Show>\n </header>\n <Show when={resolved()}>\n <div class=\"k2b-detail-panel__section-body\">{resolved()}</div>\n </Show>\n </section>\n }\n >\n <section\n class={className()}\n aria-labelledby={open() ? headingId : `${headingId}-closed`}\n data-open={open()}\n data-icon={props.icon ? \"true\" : undefined}\n data-summary={props.summary ? \"true\" : undefined}\n >\n <div hidden={open()}>\n <Button\n ref={expand}\n variant=\"ghost\"\n class=\"k2b-detail-panel__section-summary\"\n disabled={props.disabled}\n aria-expanded={false}\n aria-controls={bodyId}\n onClick={() => toggle(true)}\n >\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <span class=\"k2b-detail-panel__section-copy\">\n <span class=\"k2b-detail-panel__section-heading\">\n <span id={`${headingId}-closed`} class=\"k2b-detail-panel__section-title\">\n {props.title}\n </span>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n <Show when={props.summary}>\n <span class=\"k2b-detail-panel__section-preview k2b-truncate-fade\">{props.summary}</span>\n </Show>\n </span>\n <Show when={props.description}>\n <span class=\"k2b-detail-panel__section-description\">{props.description}</span>\n </Show>\n </span>\n {/* Same column as the open header's collapse button, so nothing moves between the states. */}\n <span class=\"k2b-detail-panel__section-toggle\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </Button>\n </div>\n <div hidden={!open()}>\n <header class=\"k2b-detail-panel__section-header\">\n <DetailPanelSectionIcon icon={props.icon} tone={props.tone} />\n <div class=\"k2b-detail-panel__section-copy\">\n <div class=\"k2b-detail-panel__section-heading\">\n <h3 id={headingId}>{props.title}</h3>\n <SectionTitleMeta count={props.count} meta={props.meta} />\n </div>\n <Show when={props.description}>\n <p class=\"k2b-detail-panel__section-description\">{props.description}</p>\n </Show>\n </div>\n <Button\n ref={collapse}\n variant=\"ghost\"\n size=\"sm\"\n class=\"k2b-detail-panel__section-toggle\"\n disabled={props.disabled}\n aria-labelledby={headingId}\n aria-expanded={true}\n aria-controls={bodyId}\n onClick={() => toggle(false)}\n >\n <i class=\"ti ti-chevron-up\" aria-hidden=\"true\" />\n </Button>\n </header>\n </div>\n <div ref={body} id={bodyId} hidden={!open()} class=\"k2b-detail-panel__section-body\">\n {resolved()}\n </div>\n </section>\n </Show>\n );\n};\n\nconst DetailPanel = ((props: DetailPanelProps): JSX.Element => (\n <div class={classNames(\"k2b-detail-panel\", props.class)} data-surface={props.surface}>\n {props.children}\n </div>\n)) as DetailPanelComponent;\n\nDetailPanel.Header = DetailPanelHeader;\nDetailPanel.Body = DetailPanelBody;\nDetailPanel.Summary = DetailPanelSummary;\nDetailPanel.Group = DetailPanelGroup;\nDetailPanel.Section = DetailPanelSection;\nDetailPanel.Action = DetailPanelAction;\nDetailPanel.Row = DetailPanelRow;\n\nexport default DetailPanel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAC3G,SAAS,MAAM,EAAE,UAAU,EAA0C,UAAU,QAAQ,mBAAmB;AAC1G,SAAS,QAAQ,QAA2B,qBAAqB;AACjE,SAAS,sBAAsB,QAAQ,yBAAyB;AAChE,SAAS,gBAAgB,QAAQ,eAAe;;AA8EhD;;AA+CA;;AA4CA,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAc,KAAc,KAAK,GAAG,GAAG,IAAI,IAAI,KAAK,EAAE,GAAG,IAAK;AAEhG,MAAM,kBAAkB,GAAI,KAA2D,IAAK;EAC1F,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa;EACnC,IAAI,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,CAAC,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,KAC1F,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC;AACvC,CAAC;AAED,MAAM,iBAAiB,GAAI,KAA6B,IAAkB;EACxE,MAAM,CAAC,GAAG,sBAAsB,CAAC,CAAC;EAClC,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW;EAC1D,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AQ,EAEO;AAE1B,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,KAAK,GAAG,gBAAgB;AACpC,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,MAAM,GAAG,iBAAiB;AACtC,WAAW,CAAC,GAAG,GAAG,cAAc;AAEhC,eAAe,WAAW","ignoreList":[]}
@@ -30,17 +30,19 @@ var _tmpl$ = ["<span class=\"k2b-detail-presence__face\"", ">", "<span class=\"k
30
30
  _tmpl$21 = "<span class=\"k2b-detail-row-skeleton\"></span>",
31
31
  _tmpl$22 = "<i class=\"ti ti-settings\" aria-hidden=\"true\"></i>",
32
32
  _tmpl$23 = ["<div class=\"k2b-detail-section-group\"><div class=\"k2b-detail-section-label\">", "</div>", "", "</div>"],
33
- _tmpl$24 = ["<div class=\"k2b-detail-section-rows\">", "", "</div>"],
34
- _tmpl$25 = ["<dl class=\"k2b-detail-properties\">", "</dl>"],
35
- _tmpl$26 = ["<span class=\"k2b-detail-properties__leading\">", "</span>"],
36
- _tmpl$27 = ["<div class=\"k2b-detail-properties__item\"><dt>", "</dt><dd>", "", "</dd></div>"],
37
- _tmpl$28 = ["<span class=\"k2b-detail-properties__value\">", "</span>"],
38
- _tmpl$29 = ["<a class=\"k2b-detail-properties__value k2b-detail-properties__link\"", ">", "</a>"],
39
- _tmpl$30 = ["<ul class=\"k2b-detail-tags\">", "</ul>"],
40
- _tmpl$31 = ["<li>", "</li>"],
41
- _tmpl$32 = ["<span class=\"k2b-detail-tag\">#", "</span>"],
42
- _tmpl$33 = ["<a class=\"k2b-detail-tag\"", ">#", "</a>"];
43
- import { createMemo, createSignal, For, onCleanup, Show } from "solid-js";
33
+ _tmpl$24 = ["<div class=\"k2b-detail-section-rows\" aria-busy=\"true\">", "<span class=\"k2b-sr-only\" role=\"status\">", "</span></div>"],
34
+ _tmpl$25 = ["<div class=\"k2b-detail-section-rows\">", "", "", "", "</div>"],
35
+ _tmpl$26 = ["<div class=\"k2b-detail-section-rows\">", "", "</div>"],
36
+ _tmpl$27 = ["<dl class=\"k2b-detail-properties\">", "</dl>"],
37
+ _tmpl$28 = ["<span class=\"k2b-detail-properties__leading\">", "</span>"],
38
+ _tmpl$29 = ["<div class=\"k2b-detail-properties__item\"><dt>", "</dt><dd>", "", "</dd></div>"],
39
+ _tmpl$30 = ["<span class=\"k2b-detail-properties__value\">", "</span>"],
40
+ _tmpl$31 = ["<a class=\"k2b-detail-properties__value k2b-detail-properties__link\"", ">", "</a>"],
41
+ _tmpl$32 = ["<ul class=\"k2b-detail-tags\">", "</ul>"],
42
+ _tmpl$33 = ["<li>", "</li>"],
43
+ _tmpl$34 = ["<span class=\"k2b-detail-tag\">#", "</span>"],
44
+ _tmpl$35 = ["<a class=\"k2b-detail-tag\"", ">#", "</a>"];
45
+ import { children, createMemo, createSignal, For, onCleanup, Show } from "solid-js";
44
46
  import { Button } from "../actions/Button";
45
47
  import { Avatar } from "../surfaces/Avatar";
46
48
  import { AvatarStack } from "../surfaces/AvatarStack";
@@ -518,6 +520,46 @@ export function DetailAccess(props) {
518
520
 
519
521
  // ── Links ───────────────────────────────────────────────────────────────
520
522
 
523
+ const LinkRow = props => {
524
+ const item = props.item;
525
+ const menu = item.menuItems ? {
526
+ menuItems: item.menuItems,
527
+ menuLabel: item.menuLabel
528
+ } : {};
529
+ const shared = {
530
+ leading: item.leading ?? _$ssr(_tmpl$4, _$ssrAttribute("class", _$escape(item.icon ?? "ti ti-file-text", true), false)),
531
+ title: item.title,
532
+ description: item.description,
533
+ trailing: item.trailing,
534
+ ...menu
535
+ };
536
+ return _$createComponent(Show, {
537
+ get when() {
538
+ return _$memo(() => !!!item.disabled)() && item.href;
539
+ },
540
+ get fallback() {
541
+ return _$createComponent(DetailPanel.Action, _$mergeProps({
542
+ type: "button",
543
+ get disabled() {
544
+ return item.disabled;
545
+ },
546
+ onClick: event => item.onClick?.(event)
547
+ }, shared));
548
+ },
549
+ children: href => _$createComponent(DetailPanel.Action, _$mergeProps({
550
+ get href() {
551
+ return href();
552
+ },
553
+ get target() {
554
+ return item.target;
555
+ },
556
+ get rel() {
557
+ return item.rel;
558
+ },
559
+ onClick: event => item.onClick?.(event)
560
+ }, shared))
561
+ });
562
+ };
521
563
  const LinkGroup = props => {
522
564
  const panel = useDetailPanelMessages();
523
565
  const [all, setAll] = createSignal(false);
@@ -526,30 +568,9 @@ const LinkGroup = props => {
526
568
  get each() {
527
569
  return _$memo(() => !!all())() ? props.items : props.items.slice(0, props.limit);
528
570
  },
529
- children: item => {
530
- const shared = {
531
- leading: _$ssr(_tmpl$4, _$ssrAttribute("class", _$escape(item.icon ?? "ti ti-file-text", true), false)),
532
- title: item.title,
533
- trailing: item.trailing
534
- };
535
- return _$createComponent(Show, {
536
- get when() {
537
- return item.href;
538
- },
539
- get fallback() {
540
- return _$createComponent(DetailPanel.Action, _$mergeProps({
541
- type: "button",
542
- onClick: event => item.onClick?.(event)
543
- }, shared));
544
- },
545
- children: href => _$createComponent(DetailPanel.Action, _$mergeProps({
546
- get href() {
547
- return href();
548
- },
549
- onClick: event => item.onClick?.(event)
550
- }, shared))
551
- });
552
- }
571
+ children: item => _$createComponent(LinkRow, {
572
+ item: item
573
+ })
553
574
  })), _$escape(_$createComponent(Show, {
554
575
  get when() {
555
576
  return hiddenCount() > 0;
@@ -574,18 +595,61 @@ const LinkGroup = props => {
574
595
  })));
575
596
  };
576
597
 
577
- /** "Linked from" and "Links to" in one section. Without links it is one row: the title and "None yet". */
598
+ /**
599
+ * "Linked from" and "Links to" in one section. Without links it is one row: the title and "None yet", followed by the
600
+ * `footer` when there is one.
601
+ */
578
602
  export function DetailLinks(props) {
579
603
  const t = useDetailSectionMessages();
580
604
  const limit = () => Math.max(1, props.limit ?? 5);
605
+ const state = () => props.state ?? "ready";
581
606
  const total = () => props.incoming.length + props.outgoing.length;
607
+ // Resolve once: the empty state reads it as a condition and as content.
608
+ const footer = children(() => props.footer);
582
609
  const summary = () => {
610
+ if (state() === "loading") return t().linksLoading;
611
+ if (state() === "error") return t().linksFailed;
583
612
  const names = items => ({
584
613
  names: listNames(items.slice(0, 2).map(item => item.title), t().and),
585
614
  more: Math.max(0, items.length - 2)
586
615
  });
587
616
  return props.incoming.length ? t().linkedBySummary(names(props.incoming)) : t().linksToSummary(names(props.outgoing));
588
617
  };
618
+ // Loading and failure take the row the next links would take, so the loaded rows above never move.
619
+ const pending = () => [_$createComponent(Show, {
620
+ get when() {
621
+ return state() === "loading";
622
+ },
623
+ get children() {
624
+ return _$ssr(_tmpl$24, _$escape(_$createComponent(DetailPanel.Row, {
625
+ get leading() {
626
+ return _$ssr(_tmpl$20);
627
+ },
628
+ get title() {
629
+ return _$ssr(_tmpl$21);
630
+ }
631
+ })), _$escape(t().linksLoading));
632
+ }
633
+ }), _$createComponent(Show, {
634
+ get when() {
635
+ return state() === "error";
636
+ },
637
+ get children() {
638
+ return _$ssr(_tmpl$17, _$escape(t().linksFailed), _$escape(_$createComponent(Show, {
639
+ get when() {
640
+ return props.onRetry;
641
+ },
642
+ children: retry => _$createComponent(Button, {
643
+ variant: "text",
644
+ size: "xs",
645
+ onClick: () => retry()(),
646
+ get children() {
647
+ return t().retry;
648
+ }
649
+ })
650
+ })));
651
+ }
652
+ })];
589
653
  return _$createComponent(Show, {
590
654
  get when() {
591
655
  return total() > 0;
@@ -596,9 +660,21 @@ export function DetailLinks(props) {
596
660
  return props.title ?? t().links;
597
661
  },
598
662
  icon: "ti ti-arrows-exchange",
599
- count: 0,
663
+ get count() {
664
+ return state() === "ready" ? 0 : undefined;
665
+ },
600
666
  get ["class"]() {
601
667
  return props.class;
668
+ },
669
+ get children() {
670
+ return _$createComponent(Show, {
671
+ get when() {
672
+ return state() !== "ready" || footer();
673
+ },
674
+ get children() {
675
+ return _$ssr(_tmpl$26, _$escape(pending()), _$escape(footer()));
676
+ }
677
+ });
602
678
  }
603
679
  });
604
680
  },
@@ -609,7 +685,7 @@ export function DetailLinks(props) {
609
685
  },
610
686
  icon: "ti ti-arrows-exchange",
611
687
  get count() {
612
- return total();
688
+ return _$memo(() => state() === "ready")() ? total() : undefined;
613
689
  },
614
690
  collapsible: true,
615
691
  get defaultOpen() {
@@ -622,7 +698,7 @@ export function DetailLinks(props) {
622
698
  return props.class;
623
699
  },
624
700
  get children() {
625
- return _$ssr(_tmpl$24, _$escape(_$createComponent(Show, {
701
+ return _$ssr(_tmpl$25, _$escape(_$createComponent(Show, {
626
702
  get when() {
627
703
  return props.incoming.length > 0;
628
704
  },
@@ -660,7 +736,7 @@ export function DetailLinks(props) {
660
736
  }
661
737
  });
662
738
  }
663
- })));
739
+ })), _$escape(pending()), _$escape(footer()));
664
740
  }
665
741
  });
666
742
  }
@@ -690,27 +766,27 @@ export function DetailProperties(props) {
690
766
  return props.class;
691
767
  },
692
768
  get children() {
693
- return _$ssr(_tmpl$25, _$escape(_$createComponent(For, {
769
+ return [_$ssr(_tmpl$27, _$escape(_$createComponent(For, {
694
770
  get each() {
695
771
  return props.items;
696
772
  },
697
- children: item => _$ssr(_tmpl$27, _$escape(item.label), _$escape(_$createComponent(Show, {
773
+ children: item => _$ssr(_tmpl$29, _$escape(item.label), _$escape(_$createComponent(Show, {
698
774
  get when() {
699
775
  return item.leading;
700
776
  },
701
777
  get children() {
702
- return _$ssr(_tmpl$26, _$escape(item.leading));
778
+ return _$ssr(_tmpl$28, _$escape(item.leading));
703
779
  }
704
780
  })), _$escape(_$createComponent(Show, {
705
781
  get when() {
706
782
  return item.href;
707
783
  },
708
784
  get fallback() {
709
- return _$ssr(_tmpl$28, _$escape(item.value));
785
+ return _$ssr(_tmpl$30, _$escape(item.value));
710
786
  },
711
- children: href => _$ssr(_tmpl$29, _$ssrAttribute("href", _$escape(href(), true), false), _$escape(item.value))
787
+ children: href => _$ssr(_tmpl$31, _$ssrAttribute("href", _$escape(href(), true), false), _$escape(item.value))
712
788
  })))
713
- })));
789
+ }))), props.children];
714
790
  }
715
791
  });
716
792
  }
@@ -740,18 +816,18 @@ export function DetailTags(props) {
740
816
  return _$memo(() => !!props.emptyHint)() ? _$ssr(_tmpl$18, _$escape(props.emptyHint)) : undefined;
741
817
  },
742
818
  get children() {
743
- return _$ssr(_tmpl$30, _$escape(_$createComponent(For, {
819
+ return _$ssr(_tmpl$32, _$escape(_$createComponent(For, {
744
820
  get each() {
745
821
  return props.tags;
746
822
  },
747
- children: tag => _$ssr(_tmpl$31, _$escape(_$createComponent(Show, {
823
+ children: tag => _$ssr(_tmpl$33, _$escape(_$createComponent(Show, {
748
824
  get when() {
749
825
  return tag.href;
750
826
  },
751
827
  get fallback() {
752
- return _$ssr(_tmpl$32, _$escape(tag.label));
828
+ return _$ssr(_tmpl$34, _$escape(tag.label));
753
829
  },
754
- children: href => _$ssr(_tmpl$33, _$ssrAttribute("href", _$escape(href(), true), false), _$escape(tag.label))
830
+ children: href => _$ssr(_tmpl$35, _$ssrAttribute("href", _$escape(href(), true), false), _$escape(tag.label))
755
831
  })))
756
832
  })));
757
833
  }