@k2b/ui 0.51.0 → 0.52.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 (206) hide show
  1. package/dist/base.css +3 -0
  2. package/dist/browser/actions/Toolbar.js +8 -2
  3. package/dist/browser/actions/Toolbar.js.map +1 -1
  4. package/dist/browser/charts/core/bar-labels.js +5 -0
  5. package/dist/browser/charts/core/bar-labels.js.map +1 -0
  6. package/dist/browser/charts/core/bubble.js +166 -0
  7. package/dist/browser/charts/core/bubble.js.map +1 -0
  8. package/dist/browser/charts/core/default-styles.js +83 -0
  9. package/dist/browser/charts/core/default-styles.js.map +1 -0
  10. package/dist/browser/charts/core/funnel-layout.js +79 -0
  11. package/dist/browser/charts/core/funnel-layout.js.map +1 -0
  12. package/dist/browser/charts/core/funnel.js +27 -0
  13. package/dist/browser/charts/core/funnel.js.map +1 -0
  14. package/dist/browser/charts/core/index.js +6 -1
  15. package/dist/browser/charts/core/index.js.map +1 -1
  16. package/dist/browser/charts/core/pareto.js +120 -0
  17. package/dist/browser/charts/core/pareto.js.map +1 -0
  18. package/dist/browser/charts/core/radar.js +101 -0
  19. package/dist/browser/charts/core/radar.js.map +1 -0
  20. package/dist/browser/charts/core/registry.js +11 -1
  21. package/dist/browser/charts/core/registry.js.map +1 -1
  22. package/dist/browser/charts/core/render-size.js +3 -1
  23. package/dist/browser/charts/core/render-size.js.map +1 -1
  24. package/dist/browser/charts/core/render.js +19 -0
  25. package/dist/browser/charts/core/render.js.map +1 -1
  26. package/dist/browser/charts/core/snapshot.js +1 -1
  27. package/dist/browser/charts/core/snapshot.js.map +1 -1
  28. package/dist/browser/charts/core/svg-barGauge.js +67 -0
  29. package/dist/browser/charts/core/svg-barGauge.js.map +1 -0
  30. package/dist/browser/charts/core/svg-boxplot.js +127 -0
  31. package/dist/browser/charts/core/svg-boxplot.js.map +1 -0
  32. package/dist/browser/charts/core/svg-common.js +1065 -0
  33. package/dist/browser/charts/core/svg-common.js.map +1 -0
  34. package/dist/browser/charts/core/svg-gauge.js +185 -0
  35. package/dist/browser/charts/core/svg-gauge.js.map +1 -0
  36. package/dist/browser/charts/core/svg-heatmap.js +80 -0
  37. package/dist/browser/charts/core/svg-heatmap.js.map +1 -0
  38. package/dist/browser/charts/core/svg-histogram.js +73 -0
  39. package/dist/browser/charts/core/svg-histogram.js.map +1 -0
  40. package/dist/browser/charts/core/svg-renderers.js +9 -1777
  41. package/dist/browser/charts/core/svg-renderers.js.map +1 -1
  42. package/dist/browser/charts/core/svg-scatter.js +114 -0
  43. package/dist/browser/charts/core/svg-scatter.js.map +1 -0
  44. package/dist/browser/charts/core/treemap.js +138 -0
  45. package/dist/browser/charts/core/treemap.js.map +1 -0
  46. package/dist/browser/charts/description.js.map +1 -1
  47. package/dist/browser/content/ChartRoot.js +21 -7
  48. package/dist/browser/content/ChartRoot.js.map +1 -1
  49. package/dist/browser/content/ChartSnapshotView.js +4 -1
  50. package/dist/browser/content/ChartSnapshotView.js.map +1 -1
  51. package/dist/browser/content/DataTable.js +186 -193
  52. package/dist/browser/content/DataTable.js.map +1 -1
  53. package/dist/browser/content/Lightbox.js +55 -23
  54. package/dist/browser/content/Lightbox.js.map +1 -1
  55. package/dist/browser/content/ThumbnailStrip.js +174 -0
  56. package/dist/browser/content/ThumbnailStrip.js.map +1 -0
  57. package/dist/browser/content/chart-bar.js +98 -0
  58. package/dist/browser/content/chart-bar.js.map +1 -1
  59. package/dist/browser/content/chart-inspection-core.js +28 -8
  60. package/dist/browser/content/chart-inspection-core.js.map +1 -1
  61. package/dist/browser/content/chart-message-catalog.js +18 -0
  62. package/dist/browser/content/chart-message-catalog.js.map +1 -1
  63. package/dist/browser/content/index.js +1 -0
  64. package/dist/browser/content/index.js.map +1 -1
  65. package/dist/browser/content/thumbnail-strip-messages.js +24 -0
  66. package/dist/browser/content/thumbnail-strip-messages.js.map +1 -0
  67. package/dist/browser/inputs/ChoiceInputs.js +132 -101
  68. package/dist/browser/inputs/ChoiceInputs.js.map +1 -1
  69. package/dist/browser/inputs/index.js +1 -0
  70. package/dist/browser/inputs/index.js.map +1 -1
  71. package/dist/browser/inputs/markdown/MarkdownSelectionToolbar.js +330 -0
  72. package/dist/browser/inputs/markdown/MarkdownSelectionToolbar.js.map +1 -0
  73. package/dist/browser/internal/field.js +96 -77
  74. package/dist/browser/internal/field.js.map +1 -1
  75. package/dist/browser/layout/AppWorkspace.js +7 -5
  76. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  77. package/dist/browser/layout/PanelDialog.js +92 -68
  78. package/dist/browser/layout/PanelDialog.js.map +1 -1
  79. package/dist/browser/surfaces/StatCell.js +82 -70
  80. package/dist/browser/surfaces/StatCell.js.map +1 -1
  81. package/dist/browser/surfaces/stat-cell-messages.js +4 -2
  82. package/dist/browser/surfaces/stat-cell-messages.js.map +1 -1
  83. package/dist/browser/widgets/DashboardFrame.js +93 -88
  84. package/dist/browser/widgets/DashboardFrame.js.map +1 -1
  85. package/dist/ssr/actions/Toolbar.js +8 -2
  86. package/dist/ssr/actions/Toolbar.js.map +1 -1
  87. package/dist/ssr/charts/core/bar-labels.js +5 -0
  88. package/dist/ssr/charts/core/bar-labels.js.map +1 -0
  89. package/dist/ssr/charts/core/bubble.js +166 -0
  90. package/dist/ssr/charts/core/bubble.js.map +1 -0
  91. package/dist/ssr/charts/core/default-styles.js +83 -0
  92. package/dist/ssr/charts/core/default-styles.js.map +1 -0
  93. package/dist/ssr/charts/core/funnel-layout.js +79 -0
  94. package/dist/ssr/charts/core/funnel-layout.js.map +1 -0
  95. package/dist/ssr/charts/core/funnel.js +27 -0
  96. package/dist/ssr/charts/core/funnel.js.map +1 -0
  97. package/dist/ssr/charts/core/index.js +6 -1
  98. package/dist/ssr/charts/core/index.js.map +1 -1
  99. package/dist/ssr/charts/core/pareto.js +120 -0
  100. package/dist/ssr/charts/core/pareto.js.map +1 -0
  101. package/dist/ssr/charts/core/radar.js +101 -0
  102. package/dist/ssr/charts/core/radar.js.map +1 -0
  103. package/dist/ssr/charts/core/registry.js +11 -1
  104. package/dist/ssr/charts/core/registry.js.map +1 -1
  105. package/dist/ssr/charts/core/render-size.js +3 -1
  106. package/dist/ssr/charts/core/render-size.js.map +1 -1
  107. package/dist/ssr/charts/core/render.js +19 -0
  108. package/dist/ssr/charts/core/render.js.map +1 -1
  109. package/dist/ssr/charts/core/snapshot.js +1 -1
  110. package/dist/ssr/charts/core/snapshot.js.map +1 -1
  111. package/dist/ssr/charts/core/svg-barGauge.js +67 -0
  112. package/dist/ssr/charts/core/svg-barGauge.js.map +1 -0
  113. package/dist/ssr/charts/core/svg-boxplot.js +127 -0
  114. package/dist/ssr/charts/core/svg-boxplot.js.map +1 -0
  115. package/dist/ssr/charts/core/svg-common.js +1065 -0
  116. package/dist/ssr/charts/core/svg-common.js.map +1 -0
  117. package/dist/ssr/charts/core/svg-gauge.js +185 -0
  118. package/dist/ssr/charts/core/svg-gauge.js.map +1 -0
  119. package/dist/ssr/charts/core/svg-heatmap.js +80 -0
  120. package/dist/ssr/charts/core/svg-heatmap.js.map +1 -0
  121. package/dist/ssr/charts/core/svg-histogram.js +73 -0
  122. package/dist/ssr/charts/core/svg-histogram.js.map +1 -0
  123. package/dist/ssr/charts/core/svg-renderers.js +9 -1777
  124. package/dist/ssr/charts/core/svg-renderers.js.map +1 -1
  125. package/dist/ssr/charts/core/svg-scatter.js +114 -0
  126. package/dist/ssr/charts/core/svg-scatter.js.map +1 -0
  127. package/dist/ssr/charts/core/treemap.js +138 -0
  128. package/dist/ssr/charts/core/treemap.js.map +1 -0
  129. package/dist/ssr/charts/description.js.map +1 -1
  130. package/dist/ssr/content/ChartRoot.js +21 -7
  131. package/dist/ssr/content/ChartRoot.js.map +1 -1
  132. package/dist/ssr/content/ChartSnapshotView.js +1 -0
  133. package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
  134. package/dist/ssr/content/DataTable.js +12 -16
  135. package/dist/ssr/content/DataTable.js.map +1 -1
  136. package/dist/ssr/content/Lightbox.js +32 -3
  137. package/dist/ssr/content/Lightbox.js.map +1 -1
  138. package/dist/ssr/content/ThumbnailStrip.js +103 -0
  139. package/dist/ssr/content/ThumbnailStrip.js.map +1 -0
  140. package/dist/ssr/content/chart-bar.js +98 -0
  141. package/dist/ssr/content/chart-bar.js.map +1 -1
  142. package/dist/ssr/content/chart-inspection-core.js +28 -8
  143. package/dist/ssr/content/chart-inspection-core.js.map +1 -1
  144. package/dist/ssr/content/chart-message-catalog.js +18 -0
  145. package/dist/ssr/content/chart-message-catalog.js.map +1 -1
  146. package/dist/ssr/content/index.js +1 -0
  147. package/dist/ssr/content/index.js.map +1 -1
  148. package/dist/ssr/content/thumbnail-strip-messages.js +24 -0
  149. package/dist/ssr/content/thumbnail-strip-messages.js.map +1 -0
  150. package/dist/ssr/inputs/ChoiceInputs.js +55 -40
  151. package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
  152. package/dist/ssr/inputs/index.js +1 -0
  153. package/dist/ssr/inputs/index.js.map +1 -1
  154. package/dist/ssr/inputs/markdown/MarkdownSelectionToolbar.js +293 -0
  155. package/dist/ssr/inputs/markdown/MarkdownSelectionToolbar.js.map +1 -0
  156. package/dist/ssr/internal/field.js +36 -24
  157. package/dist/ssr/internal/field.js.map +1 -1
  158. package/dist/ssr/layout/AppWorkspace.js +5 -1
  159. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  160. package/dist/ssr/layout/PanelDialog.js +40 -26
  161. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  162. package/dist/ssr/surfaces/StatCell.js +29 -18
  163. package/dist/ssr/surfaces/StatCell.js.map +1 -1
  164. package/dist/ssr/surfaces/stat-cell-messages.js +4 -2
  165. package/dist/ssr/surfaces/stat-cell-messages.js.map +1 -1
  166. package/dist/ssr/widgets/DashboardFrame.js +6 -11
  167. package/dist/ssr/widgets/DashboardFrame.js.map +1 -1
  168. package/dist/styles.css +1 -1
  169. package/dist/types/actions/Toolbar.d.ts +2 -0
  170. package/dist/types/charts/core/bar-labels.d.ts +1 -0
  171. package/dist/types/charts/core/bubble.d.ts +66 -0
  172. package/dist/types/charts/core/default-styles.d.ts +1 -0
  173. package/dist/types/charts/core/funnel-layout.d.ts +43 -0
  174. package/dist/types/charts/core/funnel.d.ts +13 -0
  175. package/dist/types/charts/core/index.d.ts +6 -1
  176. package/dist/types/charts/core/pareto.d.ts +40 -0
  177. package/dist/types/charts/core/radar.d.ts +47 -0
  178. package/dist/types/charts/core/registry.d.ts +10 -0
  179. package/dist/types/charts/core/render-size.d.ts +1 -1
  180. package/dist/types/charts/core/svg-barGauge.d.ts +3 -0
  181. package/dist/types/charts/core/svg-boxplot.d.ts +18 -0
  182. package/dist/types/charts/core/svg-common.d.ts +612 -0
  183. package/dist/types/charts/core/svg-gauge.d.ts +6 -0
  184. package/dist/types/charts/core/svg-heatmap.d.ts +6 -0
  185. package/dist/types/charts/core/svg-histogram.d.ts +16 -0
  186. package/dist/types/charts/core/svg-renderers.d.ts +8 -612
  187. package/dist/types/charts/core/svg-scatter.d.ts +23 -0
  188. package/dist/types/charts/core/treemap.d.ts +45 -0
  189. package/dist/types/charts/description.d.ts +63 -0
  190. package/dist/types/content/ChartRoot.d.ts +1 -1
  191. package/dist/types/content/Lightbox.d.ts +2 -0
  192. package/dist/types/content/ThumbnailStrip.d.ts +29 -0
  193. package/dist/types/content/chart-bar.d.ts +38 -2
  194. package/dist/types/content/chart-inspection-core.d.ts +7 -0
  195. package/dist/types/content/chart-inspection.d.ts +1 -0
  196. package/dist/types/content/chart-message-catalog.d.ts +8 -0
  197. package/dist/types/content/index.d.ts +1 -0
  198. package/dist/types/content/thumbnail-strip-messages.d.ts +10 -0
  199. package/dist/types/inputs/ChoiceInputs.d.ts +2 -0
  200. package/dist/types/inputs/index.d.ts +2 -0
  201. package/dist/types/inputs/markdown/MarkdownSelectionToolbar.d.ts +19 -0
  202. package/dist/types/internal/field.d.ts +2 -0
  203. package/dist/types/layout/PanelDialog.d.ts +5 -0
  204. package/dist/types/surfaces/stat-cell-messages.d.ts +1 -0
  205. package/dist/types/widgets/DashboardFrame.d.ts +4 -1
  206. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["actions/Toolbar.tsx"],"sourcesContent":["import { createContext, createEffect, createSignal, type JSX, onCleanup, onMount, Show, sharedConfig, useContext } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { Kbd } from \"../content/Kbd\";\nimport { useLocale } from \"../intl/locale\";\nimport { formatShortcut, type KeyboardPlatform, keyboardPlatform } from \"../intl/shortcut\";\nimport { IconButton } from \"./Button\";\nimport { Dropdown, type DropdownAction } from \"./Dropdown\";\nimport { useToolbarMessages } from \"./toolbar-messages\";\n\nexport type ToolbarProps = {\n children: JSX.Element;\n label: string;\n orientation?: \"horizontal\" | \"vertical\";\n wrap?: boolean;\n /** `floating` floats the toolbar at the bottom of its column. Defaults to `inline`. */\n variant?: \"inline\" | \"floating\";\n class?: string;\n};\n\nexport type ToolbarActionProps = {\n /** Accessible name, tooltip text, and the row label in the More menu. */\n label: string;\n /** Icon class, such as \"ti ti-archive\". */\n icon: string;\n /**\n * Shortcut hint below the icon, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler.\n * SelectionToolbar's compact actions keep only the tooltip suffix and aria-keyshortcuts.\n */\n keys?: string;\n /** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */\n priority?: number;\n disabled?: boolean;\n onClick?: () => void;\n};\nexport type ToolbarLabelProps = { children: JSX.Element; class?: string };\n\nexport type ToolbarGroupProps = { children: JSX.Element; label?: string; class?: string };\nexport type ToolbarSeparatorProps = { class?: string };\n\ntype ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {\n Action: (props: ToolbarActionProps) => JSX.Element;\n Label: (props: ToolbarLabelProps) => JSX.Element;\n Group: (props: ToolbarGroupProps) => JSX.Element;\n Separator: (props: ToolbarSeparatorProps) => JSX.Element;\n Spacer: () => JSX.Element;\n};\n\ntype ToolbarOrientation = NonNullable<ToolbarProps[\"orientation\"]>;\n\nconst defaultToolbarOrientation: () => ToolbarOrientation = () => \"horizontal\";\nconst ToolbarOrientationContext = createContext(defaultToolbarOrientation);\n/** False where actions are icon-sized, such as SelectionToolbar: no room below the icon for a hint. Package-internal. */\nexport const ToolbarHintsContext = createContext(true);\n\n// `item` is created once per action: the More menu keys its rows by identity, so a remeasure keeps a focused row.\ntype RegisteredAction = { element: HTMLButtonElement; props: ToolbarActionProps; item: DropdownAction };\nconst ToolbarActionsContext = createContext<(action: RegisteredAction) => () => void>();\nconst overflowAttribute = \"data-overflow\";\nconst hide = (element: Element) => element.setAttribute(overflowAttribute, \"hidden\");\nconst reveal = (element: Element) => element.removeAttribute(overflowAttribute);\n\n// ARIA uses language-independent key names, unlike the translated tooltip and caps.\nconst ariaShortcut = (keys: string | undefined, platform: KeyboardPlatform): string | undefined => {\n if (!keys || !formatShortcut(keys, { platform, locale: \"en\" }).keys.length) return undefined;\n const input = keys.trim().toLowerCase();\n const plus = input === \"+\" || input.endsWith(\"++\");\n const parts = (plus ? input.slice(0, -1) : input).split(\"+\");\n // ARIA separates keys with \"+\", so the plus key itself is named \"plus\".\n const key = plus ? \"plus\" : parts.pop() || \"space\";\n if (plus) parts.pop();\n const names: Record<string, string> = {\n mod: platform === \"apple\" ? \"Meta\" : \"Control\",\n ctrl: \"Control\",\n alt: \"Alt\",\n shift: \"Shift\",\n meta: \"Meta\",\n arrowup: \"ArrowUp\",\n arrowdown: \"ArrowDown\",\n arrowleft: \"ArrowLeft\",\n arrowright: \"ArrowRight\",\n escape: \"Escape\",\n esc: \"Escape\",\n backspace: \"Backspace\",\n enter: \"Enter\",\n delete: \"Delete\",\n space: \"Space\",\n tab: \"Tab\",\n home: \"Home\",\n end: \"End\",\n pageup: \"PageUp\",\n pagedown: \"PageDown\",\n plus: \"plus\",\n };\n const final = key.length === 1 || /^f(?:[1-9]|1[0-2])$/.test(key) ? key.toUpperCase() : names[key];\n return final ? [...new Set(parts.map((part) => names[part])), final].join(\"+\") : undefined;\n};\n\nconst ToolbarAction = (props: ToolbarActionProps): JSX.Element => {\n const register = useContext(ToolbarActionsContext);\n const hints = useContext(ToolbarHintsContext);\n const locale = useLocale();\n const [platform, setPlatform] = createSignal<KeyboardPlatform>(isServer || sharedConfig.context ? \"other\" : keyboardPlatform());\n onMount(() => setPlatform(keyboardPlatform()));\n const tooltip = () => {\n const shortcut = props.keys ? formatShortcut(props.keys, { platform: platform(), locale: locale() }).label : \"\";\n return shortcut ? `${props.label} (${shortcut})` : props.label;\n };\n return (\n <IconButton\n ref={(element) => {\n const item: DropdownAction = {\n get label() {\n return props.label;\n },\n get icon() {\n return props.icon;\n },\n get disabled() {\n return props.disabled;\n },\n action: () => props.onClick?.(),\n };\n const unregister = register?.({ element, props, item });\n if (unregister) onCleanup(unregister);\n }}\n class=\"k2b-toolbar__action\"\n label={props.label}\n variant=\"ghost\"\n tooltip={tooltip()}\n aria-keyshortcuts={ariaShortcut(props.keys, platform())}\n data-priority={props.priority}\n disabled={props.disabled}\n onClick={() => props.onClick?.()}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n <Show when={hints && props.keys}>{(keys) => <Kbd keys={keys()} class=\"k2b-kbd-hint k2b-toolbar__hint\" />}</Show>\n </IconButton>\n );\n};\n\nconst ToolbarLabel = (props: ToolbarLabelProps): JSX.Element => (\n <span class={`k2b-toolbar__label ${props.class ?? \"\"}`}>{props.children}</span>\n);\n\nconst ToolbarGroup = (props: ToolbarGroupProps): JSX.Element => (\n <div class={`k2b-toolbar__group ${props.class ?? \"\"}`} role=\"group\" aria-label={props.label}>\n {props.children}\n </div>\n);\n\nconst ToolbarSeparator = (props: ToolbarSeparatorProps): JSX.Element => {\n const toolbarOrientation = useContext(ToolbarOrientationContext);\n const separatorOrientation = () => (toolbarOrientation() === \"horizontal\" ? \"vertical\" : \"horizontal\");\n\n return (\n <span\n class={`k2b-toolbar__separator ${props.class ?? \"\"}`}\n role=\"separator\"\n aria-orientation={separatorOrientation()}\n data-orientation={separatorOrientation()}\n />\n );\n};\n\nconst ToolbarSpacer = (): JSX.Element => <span class=\"k2b-toolbar__spacer\" aria-hidden=\"true\" />;\n\nconst rovingFocus = (root: HTMLDivElement, orientation: () => ToolbarOrientation) => {\n let last: HTMLElement | undefined;\n const setLast = (item: HTMLElement | undefined) => {\n if (item === last) return;\n if (last) resizeObserver.unobserve(last);\n last = item;\n if (last) resizeObserver.observe(last);\n };\n const controls = () =>\n Array.from(root.querySelectorAll<HTMLElement>(\"button, a[href], input, select, textarea, [tabindex]\")).filter((item) => {\n if (\n item.matches(\"textarea, select\") ||\n item.isContentEditable ||\n (item.matches(\"input\") && !/^(button|checkbox|reset|submit|image|color|file)$/i.test(item.getAttribute(\"type\") ?? \"text\"))\n )\n return false;\n const nested = item.closest('[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"], [popover]');\n return !nested || !root.contains(nested);\n });\n const items = () =>\n controls().filter(\n (item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]') && item.getClientRects().length > 0,\n );\n const sync = () => {\n const available = items();\n if (!last || !available.includes(last)) setLast(available[0]);\n for (const item of controls()) item.tabIndex = item === last ? 0 : -1;\n };\n const focusin = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement && items().includes(event.target)) {\n setLast(event.target);\n sync();\n }\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const available = items();\n const target = event.target;\n if (!(target instanceof HTMLElement) || !available.includes(target)) return;\n const forward = orientation() === \"vertical\" ? \"ArrowDown\" : getComputedStyle(root).direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = orientation() === \"vertical\" ? \"ArrowUp\" : forward === \"ArrowRight\" ? \"ArrowLeft\" : \"ArrowRight\";\n const index = available.indexOf(target);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? available.length - 1\n : event.key === forward\n ? (index + 1) % available.length\n : event.key === backward\n ? (index + available.length - 1) % available.length\n : -1;\n if (next < 0) return;\n event.preventDefault();\n setLast(available[next]);\n sync();\n last?.focus();\n };\n const observer = new MutationObserver(sync);\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\", \"class\", \"style\", overflowAttribute],\n });\n const resizeObserver = new ResizeObserver(sync);\n resizeObserver.observe(root);\n root.addEventListener(\"focusin\", focusin);\n sync();\n return {\n keydown,\n sync,\n cleanup: () => {\n observer.disconnect();\n resizeObserver.disconnect();\n root.removeEventListener(\"focusin\", focusin);\n },\n };\n};\n\n/**\n * All measurement writes are DOM attributes: reactive writes do not flush during onMount. More is never toggled while\n * measuring: hiding it, even for a moment, can make the browser drop focus from it or from its open menu. An idle More\n * stays out of the flow but keeps its box, so its width is always known.\n */\nconst measureOverflow = (\n root: HTMLDivElement,\n more: HTMLDivElement,\n actions: RegisteredAction[],\n available: number,\n): RegisteredAction[] => {\n for (const element of root.querySelectorAll(`[${overflowAttribute}]`)) if (element !== more) reveal(element);\n const children = Array.from(root.children).filter(\n (element): element is HTMLElement => element instanceof HTMLElement && element !== more,\n );\n const visible = (element: Element) => !element.matches(\"[popover]\") && element.getClientRects().length > 0;\n const separator = (element: Element) => element.classList.contains(\"k2b-toolbar__separator\");\n const item = (element: Element) => !separator(element) && !element.classList.contains(\"k2b-toolbar__spacer\");\n // Separators are tidied in DOM order with More, the last control, counted as shown when `withMore` is set.\n const all = Array.from(root.children).filter((element): element is HTMLElement => element instanceof HTMLElement);\n const tidy = (withMore: boolean) => {\n for (const group of root.querySelectorAll(\".k2b-toolbar__group\")) {\n reveal(group);\n if (!Array.from(group.children).some(visible)) hide(group);\n }\n for (const child of children) if (separator(child)) reveal(child);\n const shown = (element: HTMLElement) => (element === more ? withMore : visible(element));\n let preceding = false;\n for (let index = 0; index < all.length; index++) {\n const child = all[index]!;\n if (!shown(child)) continue;\n if (separator(child)) {\n const following = all.slice(index + 1).some((next) => item(next) && shown(next));\n if (!preceding || !following) hide(child);\n else preceding = false;\n } else if (item(child)) preceding = true;\n }\n };\n const style = getComputedStyle(root);\n const edges = [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (Number.parseFloat(value) || 0),\n 0,\n );\n const gap = Number.parseFloat(style.columnGap) || 0;\n // A label may shrink in an overfull pill; measure its untruncated width (up to its cap) so actions move before the\n // count or title truncates.\n const width = (child: HTMLElement) => {\n // Separators carry inline margins, which bounding boxes leave out.\n const childStyle = getComputedStyle(child);\n const box =\n child.getBoundingClientRect().width +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0);\n if (!child.classList.contains(\"k2b-toolbar__label\")) return box;\n const cap = Number.parseFloat(childStyle.maxWidth);\n return Math.max(box, Math.min(child.scrollWidth, Number.isNaN(cap) ? Number.POSITIVE_INFINITY : cap));\n };\n const moreWidth = width(more) + gap;\n const used = (withMore: boolean) => {\n const shown = children.filter(visible);\n return shown.reduce((sum, child) => sum + width(child), edges) + gap * Math.max(0, shown.length - 1) + (withMore ? moreWidth : 0);\n };\n // Stable sort retains DOM order for the menu, but removes later actions first on a priority tie.\n const candidates = actions\n // An action its application hides, even with `visibility: hidden`, must not reappear as a More row.\n .filter(\n (action) =>\n action.props.priority !== undefined && visible(action.element) && getComputedStyle(action.element).visibility !== \"hidden\",\n )\n .reverse()\n .sort((a, b) => b.props.priority! - a.props.priority!);\n let movedAny = false;\n tidy(false);\n for (const action of candidates) {\n if (used(movedAny) <= available) break;\n hide(action.element);\n movedAny = true;\n tidy(true);\n }\n // More changes only here, and only when its state changes.\n if (movedAny) reveal(more);\n else if (!more.hasAttribute(overflowAttribute)) hide(more);\n return actions.filter((action) => action.element.hasAttribute(overflowAttribute));\n};\n\nexport const Toolbar = Object.assign(\n (props: ToolbarProps): JSX.Element => {\n // The variant decides the DOM shape, so it is read once.\n const floating = props.variant === \"floating\";\n const orientation = () => (floating ? \"horizontal\" : (props.orientation ?? \"horizontal\"));\n const messages = useToolbarMessages();\n const actions = new Set<RegisteredAction>();\n const [revision, setRevision] = createSignal(0);\n const [moved, setMoved] = createSignal<RegisteredAction[]>([]);\n let root!: HTMLDivElement;\n let strip: HTMLDivElement | undefined;\n let more: HTMLDivElement | undefined;\n let trigger: HTMLButtonElement | undefined;\n let mounted = false;\n let navigation: ReturnType<typeof rovingFocus> | undefined;\n // Only the floating variant moves actions into More; inline toolbars keep every action in place.\n const measure = () => {\n if (!mounted || !strip || !more) return;\n const style = getComputedStyle(strip);\n const available = strip.clientWidth - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight);\n if (available <= 0) return;\n const ordered = [...actions].sort((a, b) =>\n a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n const focused = document.activeElement;\n // Cleared before measuring so the pending `visibility: hidden` does not hide every action from the check\n // below; the whole measurement still runs before the next paint.\n root.removeAttribute(\"data-overflow-pending\");\n const next = measureOverflow(root, more, ordered, available);\n setMoved((previous) =>\n previous.length === next.length && previous.every((action, index) => action === next[index]) ? previous : next,\n );\n navigation?.sync();\n // Focus on an action that moved, on a menu row whose action came back, or on a More that disappeared goes to\n // More, or to the toolbar's tab stop when nothing is left in More. Inside an effect the menu rows update after\n // this function returns, so the check waits for that flush; a microtask still runs before the next paint.\n queueMicrotask(() => {\n // A toolbar unmounted meanwhile, as its view closes, owns no focus any more.\n if (!mounted) return;\n const lost =\n next.some((action) => action.element === focused) ||\n (focused instanceof HTMLElement && !focused.isConnected) ||\n (focused === trigger && !next.length);\n if (lost) (next.length ? trigger : root.querySelector<HTMLElement>('[tabindex=\"0\"]'))?.focus();\n });\n };\n const register = (action: RegisteredAction) => {\n actions.add(action);\n setRevision((value) => value + 1);\n return () => {\n actions.delete(action);\n setRevision((value) => value + 1);\n };\n };\n if (floating)\n createEffect(() => {\n revision();\n for (const action of actions) {\n // Content and priority changes can affect intrinsic widths as well as menu rows.\n void action.props.priority;\n void action.props.label;\n void action.props.icon;\n void action.props.keys;\n }\n measure();\n });\n onMount(() => {\n mounted = true;\n navigation = rovingFocus(root, orientation);\n onCleanup(() => {\n mounted = false;\n navigation?.cleanup();\n });\n if (!strip) return;\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(strip);\n observer.observe(root);\n const mutations = new MutationObserver(measure);\n // Visibility an application sets also counts. Measurement writes only data attributes, which stay unobserved.\n mutations.observe(root, {\n childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: [\"hidden\", \"class\", \"style\"],\n });\n onCleanup(() => {\n observer.disconnect();\n mutations.disconnect();\n });\n });\n const menuItems = (): DropdownAction[] => moved().map((action) => action.item);\n const content = (\n <ToolbarOrientationContext.Provider value={orientation}>\n <ToolbarActionsContext.Provider value={floating ? register : undefined}>\n <div\n ref={root}\n onKeyDown={(event) => navigation?.keydown(event)}\n class={`k2b-toolbar ${props.class ?? \"\"}`}\n role=\"toolbar\"\n aria-label={props.label}\n aria-orientation={orientation()}\n data-orientation={orientation()}\n data-variant={floating ? \"floating\" : undefined}\n data-wrap={!floating && props.wrap ? \"true\" : undefined}\n data-overflow-pending={floating ? \"\" : undefined}\n >\n {props.children}\n <Show when={floating}>\n <div ref={more} class=\"k2b-toolbar__more\" data-overflow=\"hidden\">\n <Dropdown.Root\n items={menuItems()}\n position=\"top-left\"\n label={messages().moreActions}\n // An open menu closes when its last row returns to the toolbar.\n disabled={moved().length === 0}\n >\n <Dropdown.Trigger ref={trigger} iconOnly label={messages().moreActions}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </div>\n </Show>\n </div>\n </ToolbarActionsContext.Provider>\n </ToolbarOrientationContext.Provider>\n );\n return floating ? (\n <div ref={strip} class=\"k2b-toolbar-float\">\n {content}\n </div>\n ) : (\n content\n );\n },\n { Action: ToolbarAction, Label: ToolbarLabel, Group: ToolbarGroup, Separator: Toolbar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3D,wBAAe,KAAK,CAAC,KAAK,IAAI,EAAE,SAAE,wCAE7B,KAAK,CAAC,KAAK,8DACL,WAAW,CAAC,CAAC,8DACb,WAAW,CAAC,CAAC,iDACjB,QAAQ,GAAG,UAAU,YAAG,SAAS,8CACpC,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,GAAG,MAAM,YAAG,SAAS,0DAChC,QAAQ,GAAG,EAAE,YAAG,SAAS,0BAE/C,KAAK,CAAC,QAAQ,8BACd,IAAI;YAAC,IAAI,EAAE,QAAQ;YAAA;cAAA,iDAEf,QAAQ,CAAC,IAAI;gBAAA,IACZ,KAAK;kBAAA,OAAE,SAAS,CAAC,CAAC;gBAAA;gBAClB,QAAQ;gBAAA,IACR,KAAK;kBAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,WAAW;gBAAA;gBAAA,IAE7B,QAAQ;kBAAA,OAAE,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC;gBAAA;gBAAA;kBAAA,yBAE7B,QAAQ,CAAC,OAAO;oBAAe,QAAQ;oBAAA,IAAC,KAAK;sBAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,WAAW;oBAAA;oBAAA;sBAAA;oBAAA;kBAAA;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EASnF;EACD,OAAO,QAAQ,2BAEV,OAAO,KAGV,OACD;AACH,CAAC,EACD;EAAE,MAAM,EAAE,aAAa;EAAE,KAAK,EAAE,YAAY;EAAE,KAAK,EAAE,YAAY;EAAE,SAAS,EAAE,gBAAgB;EAAE,MAAM,EAAE;AAAc,CACxH,CAAqB;AAErB,eAAe,OAAO","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["actions/Toolbar.tsx"],"sourcesContent":["import { createContext, createEffect, createSignal, type JSX, onCleanup, onMount, Show, sharedConfig, useContext } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { Kbd } from \"../content/Kbd\";\nimport { useLocale } from \"../intl/locale\";\nimport { formatShortcut, type KeyboardPlatform, keyboardPlatform } from \"../intl/shortcut\";\nimport { IconButton } from \"./Button\";\nimport { Dropdown, type DropdownAction } from \"./Dropdown\";\nimport { useToolbarMessages } from \"./toolbar-messages\";\n\nexport type ToolbarProps = {\n children: JSX.Element;\n label: string;\n orientation?: \"horizontal\" | \"vertical\";\n wrap?: boolean;\n /** `floating` floats the toolbar at the bottom of its column. Defaults to `inline`. */\n variant?: \"inline\" | \"floating\";\n class?: string;\n};\n\nexport type ToolbarActionProps = {\n /** Accessible name, tooltip text, and the row label in the More menu. */\n label: string;\n /** Icon class, such as \"ti ti-archive\". */\n icon: string;\n /**\n * Shortcut hint below the icon, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler.\n * SelectionToolbar's compact actions keep only the tooltip suffix and aria-keyshortcuts.\n */\n keys?: string;\n /** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */\n priority?: number;\n disabled?: boolean;\n /** Makes the action a toggle and exposes its state as `aria-pressed`, such as Bold over bold text. */\n pressed?: boolean;\n onClick?: () => void;\n};\nexport type ToolbarLabelProps = { children: JSX.Element; class?: string };\n\nexport type ToolbarGroupProps = { children: JSX.Element; label?: string; class?: string };\nexport type ToolbarSeparatorProps = { class?: string };\n\ntype ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {\n Action: (props: ToolbarActionProps) => JSX.Element;\n Label: (props: ToolbarLabelProps) => JSX.Element;\n Group: (props: ToolbarGroupProps) => JSX.Element;\n Separator: (props: ToolbarSeparatorProps) => JSX.Element;\n Spacer: () => JSX.Element;\n};\n\ntype ToolbarOrientation = NonNullable<ToolbarProps[\"orientation\"]>;\n\nconst defaultToolbarOrientation: () => ToolbarOrientation = () => \"horizontal\";\nconst ToolbarOrientationContext = createContext(defaultToolbarOrientation);\n/** False where actions are icon-sized, such as SelectionToolbar: no room below the icon for a hint. Package-internal. */\nexport const ToolbarHintsContext = createContext(true);\n\n// `item` is created once per action: the More menu keys its rows by identity, so a remeasure keeps a focused row.\ntype RegisteredAction = { element: HTMLButtonElement; props: ToolbarActionProps; item: DropdownAction };\nconst ToolbarActionsContext = createContext<(action: RegisteredAction) => () => void>();\nconst overflowAttribute = \"data-overflow\";\nconst hide = (element: Element) => element.setAttribute(overflowAttribute, \"hidden\");\nconst reveal = (element: Element) => element.removeAttribute(overflowAttribute);\n\n// ARIA uses language-independent key names, unlike the translated tooltip and caps.\nconst ariaShortcut = (keys: string | undefined, platform: KeyboardPlatform): string | undefined => {\n if (!keys || !formatShortcut(keys, { platform, locale: \"en\" }).keys.length) return undefined;\n const input = keys.trim().toLowerCase();\n const plus = input === \"+\" || input.endsWith(\"++\");\n const parts = (plus ? input.slice(0, -1) : input).split(\"+\");\n // ARIA separates keys with \"+\", so the plus key itself is named \"plus\".\n const key = plus ? \"plus\" : parts.pop() || \"space\";\n if (plus) parts.pop();\n const names: Record<string, string> = {\n mod: platform === \"apple\" ? \"Meta\" : \"Control\",\n ctrl: \"Control\",\n alt: \"Alt\",\n shift: \"Shift\",\n meta: \"Meta\",\n arrowup: \"ArrowUp\",\n arrowdown: \"ArrowDown\",\n arrowleft: \"ArrowLeft\",\n arrowright: \"ArrowRight\",\n escape: \"Escape\",\n esc: \"Escape\",\n backspace: \"Backspace\",\n enter: \"Enter\",\n delete: \"Delete\",\n space: \"Space\",\n tab: \"Tab\",\n home: \"Home\",\n end: \"End\",\n pageup: \"PageUp\",\n pagedown: \"PageDown\",\n plus: \"plus\",\n };\n const final = key.length === 1 || /^f(?:[1-9]|1[0-2])$/.test(key) ? key.toUpperCase() : names[key];\n return final ? [...new Set(parts.map((part) => names[part])), final].join(\"+\") : undefined;\n};\n\nconst ToolbarAction = (props: ToolbarActionProps): JSX.Element => {\n const register = useContext(ToolbarActionsContext);\n const hints = useContext(ToolbarHintsContext);\n const locale = useLocale();\n const [platform, setPlatform] = createSignal<KeyboardPlatform>(isServer || sharedConfig.context ? \"other\" : keyboardPlatform());\n onMount(() => setPlatform(keyboardPlatform()));\n const tooltip = () => {\n const shortcut = props.keys ? formatShortcut(props.keys, { platform: platform(), locale: locale() }).label : \"\";\n return shortcut ? `${props.label} (${shortcut})` : props.label;\n };\n return (\n <IconButton\n ref={(element) => {\n const item: DropdownAction = {\n get label() {\n return props.label;\n },\n get icon() {\n return props.icon;\n },\n get disabled() {\n return props.disabled;\n },\n action: () => props.onClick?.(),\n };\n const unregister = register?.({ element, props, item });\n if (unregister) onCleanup(unregister);\n }}\n class=\"k2b-toolbar__action\"\n label={props.label}\n variant=\"ghost\"\n tooltip={tooltip()}\n aria-keyshortcuts={ariaShortcut(props.keys, platform())}\n aria-pressed={props.pressed === undefined ? undefined : props.pressed ? \"true\" : \"false\"}\n data-priority={props.priority}\n disabled={props.disabled}\n onClick={() => props.onClick?.()}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n <Show when={hints && props.keys}>{(keys) => <Kbd keys={keys()} class=\"k2b-kbd-hint k2b-toolbar__hint\" />}</Show>\n </IconButton>\n );\n};\n\nconst ToolbarLabel = (props: ToolbarLabelProps): JSX.Element => (\n <span class={`k2b-toolbar__label ${props.class ?? \"\"}`}>{props.children}</span>\n);\n\nconst ToolbarGroup = (props: ToolbarGroupProps): JSX.Element => (\n <div class={`k2b-toolbar__group ${props.class ?? \"\"}`} role=\"group\" aria-label={props.label}>\n {props.children}\n </div>\n);\n\nconst ToolbarSeparator = (props: ToolbarSeparatorProps): JSX.Element => {\n const toolbarOrientation = useContext(ToolbarOrientationContext);\n const separatorOrientation = () => (toolbarOrientation() === \"horizontal\" ? \"vertical\" : \"horizontal\");\n\n return (\n <span\n class={`k2b-toolbar__separator ${props.class ?? \"\"}`}\n role=\"separator\"\n aria-orientation={separatorOrientation()}\n data-orientation={separatorOrientation()}\n />\n );\n};\n\nconst ToolbarSpacer = (): JSX.Element => <span class=\"k2b-toolbar__spacer\" aria-hidden=\"true\" />;\n\nconst rovingFocus = (root: HTMLDivElement, orientation: () => ToolbarOrientation) => {\n let last: HTMLElement | undefined;\n const setLast = (item: HTMLElement | undefined) => {\n if (item === last) return;\n if (last) resizeObserver.unobserve(last);\n last = item;\n if (last) resizeObserver.observe(last);\n };\n const controls = () =>\n Array.from(root.querySelectorAll<HTMLElement>(\"button, a[href], input, select, textarea, [tabindex]\")).filter((item) => {\n if (\n item.matches(\"textarea, select\") ||\n item.isContentEditable ||\n (item.matches(\"input\") && !/^(button|checkbox|reset|submit|image|color|file)$/i.test(item.getAttribute(\"type\") ?? \"text\"))\n )\n return false;\n const nested = item.closest('[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"], [popover]');\n return !nested || !root.contains(nested);\n });\n const items = () =>\n controls().filter(\n (item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]') && item.getClientRects().length > 0,\n );\n const sync = () => {\n // A toolbar that is still hidden, such as a SelectionToolbar about to show, keeps one stop: otherwise Tab right\n // after it shows would pass it before the next measure.\n const shown = items();\n const available = shown.length\n ? shown\n : controls().filter((item) => !item.matches(\":disabled\") && !item.closest('[data-overflow=\"hidden\"]'));\n if (!last || !available.includes(last)) setLast(available[0]);\n for (const item of controls()) item.tabIndex = item === last ? 0 : -1;\n };\n const focusin = (event: FocusEvent) => {\n if (event.target instanceof HTMLElement && items().includes(event.target)) {\n setLast(event.target);\n sync();\n }\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const available = items();\n const target = event.target;\n if (!(target instanceof HTMLElement) || !available.includes(target)) return;\n const forward = orientation() === \"vertical\" ? \"ArrowDown\" : getComputedStyle(root).direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = orientation() === \"vertical\" ? \"ArrowUp\" : forward === \"ArrowRight\" ? \"ArrowLeft\" : \"ArrowRight\";\n const index = available.indexOf(target);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? available.length - 1\n : event.key === forward\n ? (index + 1) % available.length\n : event.key === backward\n ? (index + available.length - 1) % available.length\n : -1;\n if (next < 0) return;\n event.preventDefault();\n setLast(available[next]);\n sync();\n last?.focus();\n };\n const observer = new MutationObserver(sync);\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\", \"class\", \"style\", overflowAttribute],\n });\n const resizeObserver = new ResizeObserver(sync);\n resizeObserver.observe(root);\n root.addEventListener(\"focusin\", focusin);\n sync();\n return {\n keydown,\n sync,\n cleanup: () => {\n observer.disconnect();\n resizeObserver.disconnect();\n root.removeEventListener(\"focusin\", focusin);\n },\n };\n};\n\n/**\n * All measurement writes are DOM attributes: reactive writes do not flush during onMount. More is never toggled while\n * measuring: hiding it, even for a moment, can make the browser drop focus from it or from its open menu. An idle More\n * stays out of the flow but keeps its box, so its width is always known.\n */\nconst measureOverflow = (\n root: HTMLDivElement,\n more: HTMLDivElement,\n actions: RegisteredAction[],\n available: number,\n): RegisteredAction[] => {\n for (const element of root.querySelectorAll(`[${overflowAttribute}]`)) if (element !== more) reveal(element);\n const children = Array.from(root.children).filter(\n (element): element is HTMLElement => element instanceof HTMLElement && element !== more,\n );\n const visible = (element: Element) => !element.matches(\"[popover]\") && element.getClientRects().length > 0;\n const separator = (element: Element) => element.classList.contains(\"k2b-toolbar__separator\");\n const item = (element: Element) => !separator(element) && !element.classList.contains(\"k2b-toolbar__spacer\");\n // Separators are tidied in DOM order with More, the last control, counted as shown when `withMore` is set.\n const all = Array.from(root.children).filter((element): element is HTMLElement => element instanceof HTMLElement);\n const tidy = (withMore: boolean) => {\n for (const group of root.querySelectorAll(\".k2b-toolbar__group\")) {\n reveal(group);\n if (!Array.from(group.children).some(visible)) hide(group);\n }\n for (const child of children) if (separator(child)) reveal(child);\n const shown = (element: HTMLElement) => (element === more ? withMore : visible(element));\n let preceding = false;\n for (let index = 0; index < all.length; index++) {\n const child = all[index]!;\n if (!shown(child)) continue;\n if (separator(child)) {\n const following = all.slice(index + 1).some((next) => item(next) && shown(next));\n if (!preceding || !following) hide(child);\n else preceding = false;\n } else if (item(child)) preceding = true;\n }\n };\n const style = getComputedStyle(root);\n const edges = [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (Number.parseFloat(value) || 0),\n 0,\n );\n const gap = Number.parseFloat(style.columnGap) || 0;\n // A label may shrink in an overfull pill; measure its untruncated width (up to its cap) so actions move before the\n // count or title truncates.\n const width = (child: HTMLElement) => {\n // Separators carry inline margins, which bounding boxes leave out.\n const childStyle = getComputedStyle(child);\n const box =\n child.getBoundingClientRect().width +\n (Number.parseFloat(childStyle.marginLeft) || 0) +\n (Number.parseFloat(childStyle.marginRight) || 0);\n if (!child.classList.contains(\"k2b-toolbar__label\")) return box;\n const cap = Number.parseFloat(childStyle.maxWidth);\n return Math.max(box, Math.min(child.scrollWidth, Number.isNaN(cap) ? Number.POSITIVE_INFINITY : cap));\n };\n const moreWidth = width(more) + gap;\n const used = (withMore: boolean) => {\n const shown = children.filter(visible);\n return shown.reduce((sum, child) => sum + width(child), edges) + gap * Math.max(0, shown.length - 1) + (withMore ? moreWidth : 0);\n };\n // Stable sort retains DOM order for the menu, but removes later actions first on a priority tie.\n const candidates = actions\n // An action its application hides, even with `visibility: hidden`, must not reappear as a More row.\n .filter(\n (action) =>\n action.props.priority !== undefined && visible(action.element) && getComputedStyle(action.element).visibility !== \"hidden\",\n )\n .reverse()\n .sort((a, b) => b.props.priority! - a.props.priority!);\n let movedAny = false;\n tidy(false);\n for (const action of candidates) {\n if (used(movedAny) <= available) break;\n hide(action.element);\n movedAny = true;\n tidy(true);\n }\n // More changes only here, and only when its state changes.\n if (movedAny) reveal(more);\n else if (!more.hasAttribute(overflowAttribute)) hide(more);\n return actions.filter((action) => action.element.hasAttribute(overflowAttribute));\n};\n\nexport const Toolbar = Object.assign(\n (props: ToolbarProps): JSX.Element => {\n // The variant decides the DOM shape, so it is read once.\n const floating = props.variant === \"floating\";\n const orientation = () => (floating ? \"horizontal\" : (props.orientation ?? \"horizontal\"));\n const messages = useToolbarMessages();\n const actions = new Set<RegisteredAction>();\n const [revision, setRevision] = createSignal(0);\n const [moved, setMoved] = createSignal<RegisteredAction[]>([]);\n let root!: HTMLDivElement;\n let strip: HTMLDivElement | undefined;\n let more: HTMLDivElement | undefined;\n let trigger: HTMLButtonElement | undefined;\n let mounted = false;\n let navigation: ReturnType<typeof rovingFocus> | undefined;\n // Only the floating variant moves actions into More; inline toolbars keep every action in place.\n const measure = () => {\n if (!mounted || !strip || !more) return;\n const style = getComputedStyle(strip);\n const available = strip.clientWidth - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight);\n if (available <= 0) return;\n const ordered = [...actions].sort((a, b) =>\n a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n const focused = document.activeElement;\n // Cleared before measuring so the pending `visibility: hidden` does not hide every action from the check\n // below; the whole measurement still runs before the next paint.\n root.removeAttribute(\"data-overflow-pending\");\n const next = measureOverflow(root, more, ordered, available);\n setMoved((previous) =>\n previous.length === next.length && previous.every((action, index) => action === next[index]) ? previous : next,\n );\n navigation?.sync();\n // Focus on an action that moved, on a menu row whose action came back, or on a More that disappeared goes to\n // More, or to the toolbar's tab stop when nothing is left in More. Inside an effect the menu rows update after\n // this function returns, so the check waits for that flush; a microtask still runs before the next paint.\n queueMicrotask(() => {\n // A toolbar unmounted meanwhile, as its view closes, owns no focus any more.\n if (!mounted) return;\n const lost =\n next.some((action) => action.element === focused) ||\n (focused instanceof HTMLElement && !focused.isConnected) ||\n (focused === trigger && !next.length);\n if (lost) (next.length ? trigger : root.querySelector<HTMLElement>('[tabindex=\"0\"]'))?.focus();\n });\n };\n const register = (action: RegisteredAction) => {\n actions.add(action);\n setRevision((value) => value + 1);\n return () => {\n actions.delete(action);\n setRevision((value) => value + 1);\n };\n };\n if (floating)\n createEffect(() => {\n revision();\n for (const action of actions) {\n // Content and priority changes can affect intrinsic widths as well as menu rows.\n void action.props.priority;\n void action.props.label;\n void action.props.icon;\n void action.props.keys;\n }\n measure();\n });\n onMount(() => {\n mounted = true;\n navigation = rovingFocus(root, orientation);\n onCleanup(() => {\n mounted = false;\n navigation?.cleanup();\n });\n if (!strip) return;\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(strip);\n observer.observe(root);\n const mutations = new MutationObserver(measure);\n // Visibility an application sets also counts. Measurement writes only data attributes, which stay unobserved.\n mutations.observe(root, {\n childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: [\"hidden\", \"class\", \"style\"],\n });\n onCleanup(() => {\n observer.disconnect();\n mutations.disconnect();\n });\n });\n const menuItems = (): DropdownAction[] => moved().map((action) => action.item);\n const content = (\n <ToolbarOrientationContext.Provider value={orientation}>\n <ToolbarActionsContext.Provider value={floating ? register : undefined}>\n <div\n ref={root}\n onKeyDown={(event) => navigation?.keydown(event)}\n class={`k2b-toolbar ${props.class ?? \"\"}`}\n role=\"toolbar\"\n aria-label={props.label}\n aria-orientation={orientation()}\n data-orientation={orientation()}\n data-variant={floating ? \"floating\" : undefined}\n data-wrap={!floating && props.wrap ? \"true\" : undefined}\n data-overflow-pending={floating ? \"\" : undefined}\n >\n {props.children}\n <Show when={floating}>\n <div ref={more} class=\"k2b-toolbar__more\" data-overflow=\"hidden\">\n <Dropdown.Root\n items={menuItems()}\n position=\"top-left\"\n label={messages().moreActions}\n // An open menu closes when its last row returns to the toolbar.\n disabled={moved().length === 0}\n >\n <Dropdown.Trigger ref={trigger} iconOnly label={messages().moreActions}>\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </div>\n </Show>\n </div>\n </ToolbarActionsContext.Provider>\n </ToolbarOrientationContext.Provider>\n );\n return floating ? (\n <div ref={strip} class=\"k2b-toolbar-float\">\n {content}\n </div>\n ) : (\n content\n );\n },\n { Action: ToolbarAction, Label: ToolbarLabel, Group: ToolbarGroup, Separator: ToolbarSeparator, Spacer: ToolbarSpacer },\n) as Toolb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YAAY;EAAE,SAAS,EAAE,gBAAgB;EAAE,MAAM,EAAE;AAAc,CACxH,CAAqB;AAErB,eAAe,OAAO","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export const barPercent = (locale = "en") => new Intl.NumberFormat(locale, {
2
+ style: "percent",
3
+ maximumFractionDigits: 1
4
+ });
5
+ //# sourceMappingURL=bar-labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["charts/core/bar-labels.ts"],"sourcesContent":["export const barPercent = (locale = \"en\") => new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 1 });\n"],"mappings":"AAAA,OAAO,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,IAAI,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;EAAE,KAAK,EAAE,SAAS;EAAE,qBAAqB,EAAE;AAAE,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,166 @@
1
+ import { chartDatumSvg, escapeXml, renderHeader, svgRoot } from "./svg";
2
+ const palette = ["#3b82f6", "#10b981", "#f59e0b", "#8b5cf6", "#ec4899", "#06b6d4", "#84cc16", "#f97316"];
3
+ const color = index => `var(--stdlib-chart-c${index % 8 + 1},${palette[index % 8]})`;
4
+ export function bubbleLayout(spec, size = {
5
+ width: spec.width ?? 480,
6
+ height: spec.height ?? 280
7
+ }) {
8
+ for (const p of spec.data) {
9
+ if (![p.x, p.y].every(Number.isFinite) || p.size !== undefined && (!Number.isFinite(p.size) || p.size < 0)) throw new RangeError("Bubble coordinates must be finite and sizes nonnegative.");
10
+ if (!spec.groups.includes(p.group)) throw new RangeError("Bubble groups must contain every point group.");
11
+ }
12
+ const width = spec.displayWidth ?? size.width,
13
+ height = size.height;
14
+ const header = renderHeader(width, spec.title, spec.subtitle);
15
+ const legend = [];
16
+ let lx = 0,
17
+ row = 0;
18
+ if (spec.legend !== false) spec.groups.forEach((label, index) => {
19
+ const space = Math.min(width, label.length * 12 + 28);
20
+ if (lx && lx + space > width) {
21
+ lx = 0;
22
+ row++;
23
+ }
24
+ legend.push({
25
+ label,
26
+ index,
27
+ x: lx,
28
+ row
29
+ });
30
+ lx += space;
31
+ });
32
+ const left = 48,
33
+ right = width - 24,
34
+ top = header.height + (spec.averages ? 72 : 20);
35
+ const bottom = height - 36 - (legend.length ? (row + 1) * 20 : 0);
36
+ const domain = values => {
37
+ let lo = Math.min(0, ...values),
38
+ hi = Math.max(0, ...values);
39
+ if (!Number.isFinite(hi - lo)) throw new RangeError("Bubble coordinate ranges must be finite.");
40
+ if (lo === hi) {
41
+ lo = -1;
42
+ hi = 1;
43
+ }
44
+ return [lo, hi];
45
+ };
46
+ const xd = domain(spec.data.map(p => p.x)),
47
+ yd = domain(spec.data.map(p => p.y));
48
+ const physicalWidth = spec.displayWidth ?? Math.min(296, width),
49
+ inverseX = width / physicalWidth;
50
+ const maxRadius = Math.max(0, Math.min(21, physicalWidth / 20, (bottom - top - 4) / 2)),
51
+ maxSize = Math.max(0, ...spec.data.map(p => p.size ?? 0));
52
+ const padding = Math.max(4.5, maxRadius) * inverseX + 2;
53
+ const x = value => left + padding + (value - xd[0]) / (xd[1] - xd[0]) * Math.max(0, right - left - padding * 2);
54
+ const y = value => bottom - maxRadius - 2 - (value - yd[0]) / (yd[1] - yd[0]) * Math.max(0, bottom - top - maxRadius * 2 - 4);
55
+ const meanX = spec.data.reduce((sum, p) => sum + p.x / Math.max(1, spec.data.length), 0);
56
+ const meanY = spec.data.reduce((sum, p) => sum + p.y / Math.max(1, spec.data.length), 0);
57
+ const points = spec.data.map((p, index) => ({
58
+ ...p,
59
+ index,
60
+ cx: x(p.x),
61
+ cy: y(p.y),
62
+ radius: p.size === undefined ? 4.5 : maxSize ? Math.sqrt(p.size / maxSize) * maxRadius : 0,
63
+ labelBox: undefined
64
+ }));
65
+ const placed = [];
66
+ const overlap = (a, b) => a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;
67
+ const boxes = points.map(p => ({
68
+ x: p.cx - p.radius * inverseX,
69
+ y: p.cy - p.radius,
70
+ width: p.radius * 2 * inverseX,
71
+ height: p.radius * 2
72
+ }));
73
+ for (const p of [...points].sort((a, b) => b.radius - a.radius || a.index - b.index)) {
74
+ const box = {
75
+ x: p.cx + (p.radius + 4) * inverseX,
76
+ y: p.cy - 9,
77
+ width: p.label.length * 12 * inverseX,
78
+ height: 14
79
+ };
80
+ if (box.x + box.width > right || box.y < top || box.y + box.height > bottom || boxes.some((b, index) => index !== p.index && overlap(box, b)) || placed.some(b => overlap(box, b))) continue;
81
+ p.labelBox = box;
82
+ placed.push(box);
83
+ }
84
+ return {
85
+ width,
86
+ height,
87
+ header,
88
+ left,
89
+ right,
90
+ top,
91
+ bottom,
92
+ xd,
93
+ yd,
94
+ x,
95
+ y,
96
+ points,
97
+ meanX,
98
+ meanY,
99
+ legend
100
+ };
101
+ }
102
+ export function renderBubbleSvg(spec) {
103
+ const s = bubbleLayout(spec),
104
+ locale = spec.locale ?? "en";
105
+ const number = new Intl.NumberFormat(locale, {
106
+ maximumSignificantDigits: 15
107
+ }).format;
108
+ const xf = spec.xFormat ?? number,
109
+ yf = spec.yFormat ?? number,
110
+ sf = spec.sizeFormat ?? number;
111
+ const compact = new Intl.NumberFormat(locale, {
112
+ notation: "compact",
113
+ maximumSignificantDigits: 3
114
+ }).format;
115
+ const scientific = new Intl.NumberFormat(locale, {
116
+ notation: "scientific",
117
+ maximumSignificantDigits: 3
118
+ }).format;
119
+ const tick = v => v && (Math.abs(v) >= 1e12 || Math.abs(v) < 1e-6) ? scientific(v) : compact(v);
120
+ const xt = spec.xFormat ?? tick,
121
+ yt = spec.yFormat ?? tick;
122
+ const text = "var(--k2b-text-muted,#45454e)",
123
+ border = "var(--k2b-border,#e4e4e7)";
124
+ const body = [s.header.svg.replace(/<text class="stdlib-chart-title"/g, '<text fill="var(--k2b-text,#27272a)" font-size="14" class="stdlib-chart-title"').replace(/<text class="stdlib-chart-subtitle"/g, '<text fill="var(--k2b-text-muted,#45454e)" font-size="11" class="stdlib-chart-subtitle"')];
125
+ for (let i = 0; i <= 4; i++) {
126
+ const xv = s.xd[0] + (s.xd[1] - s.xd[0]) * (i / 4),
127
+ yv = s.yd[0] + (s.yd[1] - s.yd[0]) * (i / 4);
128
+ body.push(`<line x1="${s.left}" x2="${s.right}" y1="${s.y(yv)}" y2="${s.y(yv)}" stroke="${border}"/><text x="${s.left - 7}" y="${s.y(yv) + 4}" text-anchor="end" font-size="10" fill="${text}">${escapeXml(yt(yv))}</text><text x="${s.x(xv)}" y="${s.bottom + 16}" text-anchor="middle" font-size="10" fill="${text}">${escapeXml(xt(xv))}</text>`);
129
+ }
130
+ body.push(`<line class="stdlib-chart-axis" x1="${s.left}" x2="${s.left}" y1="${s.top}" y2="${s.bottom}" stroke="${border}"/><line class="stdlib-chart-axis" x1="${s.left}" x2="${s.right}" y1="${s.bottom}" y2="${s.bottom}" stroke="${border}"/><text x="${s.right}" y="${s.bottom + 30}" class="k2b-chart-bubble-x-title" text-anchor="end" font-size="11" fill="${text}">${escapeXml(spec.xLabel)} →</text><text x="${s.left}" y="${s.top - 7}" class="k2b-chart-bubble-y-title" font-size="11" fill="${text}">↑ ${escapeXml(spec.yLabel)}</text>`);
131
+ if (spec.averages) {
132
+ const label = locale.startsWith("de") ? "Ungewichteter Durchschnitt" : "Unweighted average";
133
+ body.push(`<line class="k2b-chart-average" x1="${s.x(s.meanX)}" x2="${s.x(s.meanX)}" y1="${s.top}" y2="${s.bottom}" stroke="${text}" stroke-dasharray="4 4"/><line class="k2b-chart-average" x1="${s.left}" x2="${s.right}" y1="${s.y(s.meanY)}" y2="${s.y(s.meanY)}" stroke="${text}" stroke-dasharray="4 4"/><text x="${s.left}" y="${s.header.height + 11}" class="k2b-chart-bubble-average-label" font-size="11" fill="${text}">${label}<title>X: ${escapeXml(xf(s.meanX))} · Y: ${escapeXml(yf(s.meanY))}</title></text><text x="${s.left}" y="${s.header.height + 29}" class="k2b-chart-bubble-average-value" font-size="11" fill="${text}">X: ${escapeXml(xf(s.meanX))} · Y: ${escapeXml(yf(s.meanY))}</text>`);
134
+ }
135
+ for (const p of [...s.points].sort((a, b) => b.radius - a.radius || a.index - b.index)) {
136
+ const paint = color(spec.groups.indexOf(p.group));
137
+ body.push(chartDatumSvg(`<circle cx="${p.cx}" cy="${p.cy}" r="${p.radius}" fill="${paint}" fill-opacity="0.62" stroke="${paint}" stroke-width="1.2"/>${p.labelBox ? `<text class="k2b-chart-bubble-label" x="${p.labelBox.x}" y="${p.cy + 4}" font-size="11.5" fill="${text}" pointer-events="none">${escapeXml(p.label)}</text>` : ""}`, {
138
+ role: "point",
139
+ index: p.index,
140
+ label: p.label,
141
+ anchor: [p.cx, p.cy],
142
+ values: [{
143
+ key: "group",
144
+ value: p.group
145
+ }, {
146
+ key: "x",
147
+ value: p.x,
148
+ formatted: xf(p.x)
149
+ }, {
150
+ key: "y",
151
+ value: p.y,
152
+ formatted: yf(p.y)
153
+ }, ...(p.size === undefined ? [] : [{
154
+ key: "size",
155
+ value: p.size,
156
+ formatted: sf(p.size)
157
+ }])]
158
+ }, spec.inspect));
159
+ }
160
+ for (const item of s.legend) body.push(`<rect x="${item.x}" y="${s.height - (s.legend.at(-1).row - item.row) * 20 - 14}" width="8" height="8" rx="2" fill="${color(item.index)}"/><text x="${item.x + 13}" y="${s.height - (s.legend.at(-1).row - item.row) * 20 - 6}" font-size="11" fill="${text}">${escapeXml(item.label.slice(0, Math.floor((s.width - 28) / 12)))}</text>`);
161
+ return svgRoot({
162
+ ...s,
163
+ className: spec.className
164
+ }, body.join(""));
165
+ }
166
+ //# sourceMappingURL=bubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["charts/core/bubble.ts"],"sourcesContent":["import { type ChartOptions, chartDatumSvg, escapeXml, renderHeader, svgRoot } from \"./svg\";\n\nexport type BubbleOptions = ChartOptions & {\n groups: string[];\n data: { label: string; group: string; x: number; y: number; size?: number }[];\n xLabel: string;\n yLabel: string;\n sizeLabel?: string;\n averages?: boolean;\n legend?: boolean;\n locale?: string;\n xFormat?: (value: number) => string;\n yFormat?: (value: number) => string;\n sizeFormat?: (value: number) => string;\n displayWidth?: number;\n};\nconst palette = [\"#3b82f6\", \"#10b981\", \"#f59e0b\", \"#8b5cf6\", \"#ec4899\", \"#06b6d4\", \"#84cc16\", \"#f97316\"];\nconst color = (index: number) => `var(--stdlib-chart-c${(index % 8) + 1},${palette[index % 8]})`;\n\nexport function bubbleLayout(spec: BubbleOptions, size = { width: spec.width ?? 480, height: spec.height ?? 280 }) {\n for (const p of spec.data) {\n if (![p.x, p.y].every(Number.isFinite) || (p.size !== undefined && (!Number.isFinite(p.size) || p.size < 0)))\n throw new RangeError(\"Bubble coordinates must be finite and sizes nonnegative.\");\n if (!spec.groups.includes(p.group)) throw new RangeError(\"Bubble groups must contain every point group.\");\n }\n const width = spec.displayWidth ?? size.width,\n height = size.height;\n const header = renderHeader(width, spec.title, spec.subtitle);\n const legend: { label: string; index: number; x: number; row: number }[] = [];\n let lx = 0,\n row = 0;\n if (spec.legend !== false)\n spec.groups.forEach((label, index) => {\n const space = Math.min(width, label.length * 12 + 28);\n if (lx && lx + space > width) {\n lx = 0;\n row++;\n }\n legend.push({ label, index, x: lx, row });\n lx += space;\n });\n const left = 48,\n right = width - 24,\n top = header.height + (spec.averages ? 72 : 20);\n const bottom = height - 36 - (legend.length ? (row + 1) * 20 : 0);\n const domain = (values: number[]) => {\n let lo = Math.min(0, ...values),\n hi = Math.max(0, ...values);\n if (!Number.isFinite(hi - lo)) throw new RangeError(\"Bubble coordinate ranges must be finite.\");\n if (lo === hi) {\n lo = -1;\n hi = 1;\n }\n return [lo, hi] as const;\n };\n const xd = domain(spec.data.map((p) => p.x)),\n yd = domain(spec.data.map((p) => p.y));\n const physicalWidth = spec.displayWidth ?? Math.min(296, width),\n inverseX = width / physicalWidth;\n const maxRadius = Math.max(0, Math.min(21, physicalWidth / 20, (bottom - top - 4) / 2)),\n maxSize = Math.max(0, ...spec.data.map((p) => p.size ?? 0));\n const padding = Math.max(4.5, maxRadius) * inverseX + 2;\n const x = (value: number) => left + padding + ((value - xd[0]) / (xd[1] - xd[0])) * Math.max(0, right - left - padding * 2);\n const y = (value: number) => bottom - maxRadius - 2 - ((value - yd[0]) / (yd[1] - yd[0])) * Math.max(0, bottom - top - maxRadius * 2 - 4);\n const meanX = spec.data.reduce((sum, p) => sum + p.x / Math.max(1, spec.data.length), 0);\n const meanY = spec.data.reduce((sum, p) => sum + p.y / Math.max(1, spec.data.length), 0);\n const points = spec.data.map((p, index) => ({\n ...p,\n index,\n cx: x(p.x),\n cy: y(p.y),\n radius: p.size === undefined ? 4.5 : maxSize ? Math.sqrt(p.size / maxSize) * maxRadius : 0,\n labelBox: undefined as { x: number; y: number; width: number; height: number } | undefined,\n }));\n const placed: { x: number; y: number; width: number; height: number }[] = [];\n const overlap = (a: (typeof placed)[number], b: (typeof placed)[number]) =>\n a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;\n const boxes = points.map((p) => ({\n x: p.cx - p.radius * inverseX,\n y: p.cy - p.radius,\n width: p.radius * 2 * inverseX,\n height: p.radius * 2,\n }));\n for (const p of [...points].sort((a, b) => b.radius - a.radius || a.index - b.index)) {\n const box = { x: p.cx + (p.radius + 4) * inverseX, y: p.cy - 9, width: p.label.length * 12 * inverseX, height: 14 };\n if (\n box.x + box.width > right ||\n box.y < top ||\n box.y + box.height > bottom ||\n boxes.some((b, index) => index !== p.index && overlap(box, b)) ||\n placed.some((b) => overlap(box, b))\n )\n continue;\n p.labelBox = box;\n placed.push(box);\n }\n return { width, height, header, left, right, top, bottom, xd, yd, x, y, points, meanX, meanY, legend };\n}\n\nexport function renderBubbleSvg(spec: BubbleOptions): string {\n const s = bubbleLayout(spec),\n locale = spec.locale ?? \"en\";\n const number = new Intl.NumberFormat(locale, { maximumSignificantDigits: 15 }).format;\n const xf = spec.xFormat ?? number,\n yf = spec.yFormat ?? number,\n sf = spec.sizeFormat ?? number;\n const compact = new Intl.NumberFormat(locale, { notation: \"compact\", maximumSignificantDigits: 3 }).format;\n const scientific = new Intl.NumberFormat(locale, { notation: \"scientific\", maximumSignificantDigits: 3 }).format;\n const tick = (v: number) => (v && (Math.abs(v) >= 1e12 || Math.abs(v) < 1e-6) ? scientific(v) : compact(v));\n const xt = spec.xFormat ?? tick,\n yt = spec.yFormat ?? tick;\n const text = \"var(--k2b-text-muted,#45454e)\",\n border = \"var(--k2b-border,#e4e4e7)\";\n const body = [\n s.header.svg\n .replace(/<text class=\"stdlib-chart-title\"/g, '<text fill=\"var(--k2b-text,#27272a)\" font-size=\"14\" class=\"stdlib-chart-title\"')\n .replace(\n /<text class=\"stdlib-chart-subtitle\"/g,\n '<text fill=\"var(--k2b-text-muted,#45454e)\" font-size=\"11\" class=\"stdlib-chart-subtitle\"',\n ),\n ];\n for (let i = 0; i <= 4; i++) {\n const xv = s.xd[0] + (s.xd[1] - s.xd[0]) * (i / 4),\n yv = s.yd[0] + (s.yd[1] - s.yd[0]) * (i / 4);\n body.push(\n `<line x1=\"${s.left}\" x2=\"${s.right}\" y1=\"${s.y(yv)}\" y2=\"${s.y(yv)}\" stroke=\"${border}\"/><text x=\"${s.left - 7}\" y=\"${s.y(yv) + 4}\" text-anchor=\"end\" font-size=\"10\" fill=\"${text}\">${escapeXml(yt(yv))}</text><text x=\"${s.x(xv)}\" y=\"${s.bottom + 16}\" text-anchor=\"middle\" font-size=\"10\" fill=\"${text}\">${escapeXml(xt(xv))}</text>`,\n );\n }\n body.push(\n `<line class=\"stdlib-chart-axis\" x1=\"${s.left}\" x2=\"${s.left}\" y1=\"${s.top}\" y2=\"${s.bottom}\" stroke=\"${border}\"/><line class=\"stdlib-chart-axis\" x1=\"${s.left}\" x2=\"${s.right}\" y1=\"${s.bottom}\" y2=\"${s.bottom}\" stroke=\"${border}\"/><text x=\"${s.right}\" y=\"${s.bottom + 30}\" class=\"k2b-chart-bubble-x-title\" text-anchor=\"end\" font-size=\"11\" fill=\"${text}\">${escapeXml(spec.xLabel)} →</text><text x=\"${s.left}\" y=\"${s.top - 7}\" class=\"k2b-chart-bubble-y-title\" font-size=\"11\" fill=\"${text}\">↑ ${escapeXml(spec.yLabel)}</text>`,\n );\n if (spec.averages) {\n const label = locale.startsWith(\"de\") ? \"Ungewichteter Durchschnitt\" : \"Unweighted average\";\n body.push(\n `<line class=\"k2b-chart-average\" x1=\"${s.x(s.meanX)}\" x2=\"${s.x(s.meanX)}\" y1=\"${s.top}\" y2=\"${s.bottom}\" stroke=\"${text}\" stroke-dasharray=\"4 4\"/><line class=\"k2b-chart-average\" x1=\"${s.left}\" x2=\"${s.right}\" y1=\"${s.y(s.meanY)}\" y2=\"${s.y(s.meanY)}\" stroke=\"${text}\" stroke-dasharray=\"4 4\"/><text x=\"${s.left}\" y=\"${s.header.height + 11}\" class=\"k2b-chart-bubble-average-label\" font-size=\"11\" fill=\"${text}\">${label}<title>X: ${escapeXml(xf(s.meanX))} · Y: ${escapeXml(yf(s.meanY))}</title></text><text x=\"${s.left}\" y=\"${s.header.height + 29}\" class=\"k2b-chart-bubble-average-value\" font-size=\"11\" fill=\"${text}\">X: ${escapeXml(xf(s.meanX))} · Y: ${escapeXml(yf(s.meanY))}</text>`,\n );\n }\n for (const p of [...s.points].sort((a, b) => b.radius - a.radius || a.index - b.index)) {\n const paint = color(spec.groups.indexOf(p.group));\n body.push(\n chartDatumSvg(\n `<circle cx=\"${p.cx}\" cy=\"${p.cy}\" r=\"${p.radius}\" fill=\"${paint}\" fill-opacity=\"0.62\" stroke=\"${paint}\" stroke-width=\"1.2\"/>${p.labelBox ? `<text class=\"k2b-chart-bubble-label\" x=\"${p.labelBox.x}\" y=\"${p.cy + 4}\" font-size=\"11.5\" fill=\"${text}\" pointer-events=\"none\">${escapeXml(p.label)}</text>` : \"\"}`,\n {\n role: \"point\",\n index: p.index,\n label: p.label,\n anchor: [p.cx, p.cy],\n values: [\n { key: \"group\", value: p.group },\n { key: \"x\", value: p.x, formatted: xf(p.x) },\n { key: \"y\", value: p.y, formatted: yf(p.y) },\n ...(p.size === undefined ? [] : [{ key: \"size\", value: p.size, formatted: sf(p.size) }]),\n ],\n },\n spec.inspect,\n ),\n );\n }\n for (const item of s.legend)\n body.push(\n `<rect x=\"${item.x}\" y=\"${s.height - (s.legend.at(-1)!.row - item.row) * 20 - 14}\" width=\"8\" height=\"8\" rx=\"2\" fill=\"${color(item.index)}\"/><text x=\"${item.x + 13}\" y=\"${s.height - (s.legend.at(-1)!.row - item.row) * 20 - 6}\" font-size=\"11\" fill=\"${text}\">${escapeXml(item.label.slice(0, Math.floor((s.width - 28) / 12)))}</text>`,\n );\n return svgRoot({ ...s, className: spec.className }, body.join(\"\"));\n}\n"],"mappings":"AAAA,SAA4B,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,QAAQ,OAAO;AAgB1F,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;AACxG,MAAM,KAAK,GAAI,KAAa,IAAK,uBAAwB,KAAK,GAAG,CAAC,GAAI,CAAC,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG;AAEhG,OAAO,SAAS,YAAY,CAAC,IAAmB,EAAE,IAAI,GAAG;EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,GAAG;EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI;AAAI,CAAC,EAAE;EACjH,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE;IACzB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAK,CAAC,CAAC,IAAI,KAAK,SAAS,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,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AC,GAAG,EAAE,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,0BAA0B,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SACnU,CAAC;EACH,OAAO,OAAO,CAAC;IAAE,GAAG,CAAC;IAAE,SAAS,EAAE,IAAI,CAAC;EAAU,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpE","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ // CSS rule order is significant. Series-N rules emit first so shape-specific
2
+ // rules below can override (e.g. line's `fill: none` beats series fill, and
3
+ // slice/point's `stroke: white` beats series stroke).
4
+ export const DEFAULT_STYLES = `
5
+ /* font-family is intentionally not set here so the chart inherits the app's
6
+ font from its surrounding HTML context. For standalone SVG usage, set
7
+ font-family on a wrapping element or override .stdlib-chart in your CSS. */
8
+ .stdlib-chart {
9
+ color: #1f2937;
10
+ --stdlib-chart-c1: #3b82f6; --stdlib-chart-c2: #10b981;
11
+ --stdlib-chart-c3: #f59e0b; --stdlib-chart-c4: #ef4444;
12
+ --stdlib-chart-c5: #8b5cf6; --stdlib-chart-c6: #ec4899;
13
+ --stdlib-chart-c7: #14b8a6; --stdlib-chart-c8: #f97316;
14
+ }
15
+ .stdlib-chart-series-0 { fill: var(--stdlib-chart-c1); stroke: var(--stdlib-chart-c1); }
16
+ .stdlib-chart-series-1 { fill: var(--stdlib-chart-c2); stroke: var(--stdlib-chart-c2); }
17
+ .stdlib-chart-series-2 { fill: var(--stdlib-chart-c3); stroke: var(--stdlib-chart-c3); }
18
+ .stdlib-chart-series-3 { fill: var(--stdlib-chart-c4); stroke: var(--stdlib-chart-c4); }
19
+ .stdlib-chart-series-4 { fill: var(--stdlib-chart-c5); stroke: var(--stdlib-chart-c5); }
20
+ .stdlib-chart-series-5 { fill: var(--stdlib-chart-c6); stroke: var(--stdlib-chart-c6); }
21
+ .stdlib-chart-series-6 { fill: var(--stdlib-chart-c7); stroke: var(--stdlib-chart-c7); }
22
+ .stdlib-chart-series-7 { fill: var(--stdlib-chart-c8); stroke: var(--stdlib-chart-c8); }
23
+ .stdlib-chart-axis { stroke: currentColor; opacity: 0.4; fill: none; }
24
+ .stdlib-chart-tick-label { font-size: 10px; fill: currentColor; opacity: 0.6; }
25
+ .stdlib-chart-axis-label { font-size: 11px; fill: currentColor; opacity: 0.85; }
26
+ .stdlib-chart-grid { stroke: currentColor; opacity: 0.08; stroke-dasharray: 2 2; fill: none; }
27
+ .stdlib-chart-title { font-size: 14px; font-weight: 600; fill: currentColor; }
28
+ .stdlib-chart-subtitle { font-size: 11px; fill: currentColor; opacity: 0.7; }
29
+ .stdlib-chart-reference { stroke: currentColor; opacity: 0.5; stroke-dasharray: 4 4; fill: none; }
30
+ .stdlib-chart-reference-label { font-size: 10px; fill: currentColor; opacity: 0.7; }
31
+ .stdlib-chart-line { fill: none; stroke-width: 2; }
32
+ .stdlib-chart-area { fill-opacity: 0.18; stroke: none; }
33
+ .stdlib-chart-sparkline { fill: none; stroke-width: 1.5; stroke: currentColor; }
34
+ .stdlib-chart-sparkline-area { stroke: none; }
35
+ .stdlib-chart-sparkline-last { fill: currentColor; stroke: none; }
36
+ .stdlib-chart-sparkline-max { fill: #10b981; stroke: none; }
37
+ .stdlib-chart-sparkline-min { fill: #ef4444; stroke: none; }
38
+ .stdlib-chart-point { stroke: white; stroke-width: 1.5; }
39
+ .stdlib-chart-slice { stroke: white; stroke-width: 2; stroke-linejoin: round; }
40
+ .stdlib-chart-label { font-size: 11px; fill: currentColor; }
41
+ .stdlib-chart-bar-value { font-size: 10px; fill: currentColor; opacity: 0.8; }
42
+ .stdlib-chart-errorbar { stroke: currentColor; opacity: 0.55; fill: none; stroke-width: 1; }
43
+ .stdlib-chart-error-band { fill-opacity: 0.15; stroke: none; }
44
+ .stdlib-chart-trendline { stroke: currentColor; opacity: 0.55; stroke-width: 1.5; fill: none; stroke-dasharray: 5 4; }
45
+ .stdlib-chart-minor-tick { stroke: currentColor; opacity: 0.25; }
46
+ .stdlib-chart-box { fill-opacity: 0.4; stroke-width: 1; }
47
+ .stdlib-chart-box-median { stroke: currentColor; stroke-width: 1.5; fill: none; }
48
+ .stdlib-chart-box-whisker { stroke: currentColor; opacity: 0.6; fill: none; }
49
+ .stdlib-chart-box-cap { stroke: currentColor; opacity: 0.6; fill: none; }
50
+ .stdlib-chart-box-outlier { fill: currentColor; opacity: 0.5; stroke: white; stroke-width: 1; }
51
+ .stdlib-chart-legend-swatch { stroke: none; }
52
+ .stdlib-chart-legend-label { font-size: 11px; font-weight: 400; fill: currentColor; stroke: none; }
53
+ .stdlib-chart-empty-text { font-size: 11px; fill: currentColor; opacity: 0.5; }
54
+ .stdlib-chart-gauge-track { stroke: currentColor; stroke-width: 10; opacity: 0.12; fill: none; stroke-linecap: round; }
55
+ .stdlib-chart-gauge-fill { stroke-width: 10; fill: none; stroke-linecap: round; }
56
+ .stdlib-chart-gauge-gradient-segment { stroke-width: 10; fill: none; stroke-linecap: butt; }
57
+ .stdlib-chart-gauge-gradient-scale { opacity: 0.22; }
58
+ .stdlib-chart-gauge-needle { stroke-width: 2; fill: none; stroke-linecap: round; }
59
+ .stdlib-chart-gauge-hub { fill: currentColor; stroke: none; }
60
+ .stdlib-chart-gauge-value { font-size: 28px; font-weight: 700; fill: currentColor; }
61
+ .stdlib-chart-gauge-label { font-size: 12px; fill: currentColor; opacity: 0.72; }
62
+ .stdlib-chart-gauge-unit { font-size: 11px; fill: currentColor; opacity: 0.6; }
63
+ .stdlib-chart-bar-gauge-track { fill: currentColor; opacity: 0.1; }
64
+ .stdlib-chart-bar-gauge-fill { stroke: none; }
65
+ .stdlib-chart-bar-gauge-label { font-size: 11px; fill: currentColor; opacity: 0.75; }
66
+ .stdlib-chart-bar-gauge-value { font-size: 11px; font-weight: 600; fill: currentColor; }
67
+ .stdlib-chart-stat-label { font-size: 12px; fill: currentColor; opacity: 0.72; }
68
+ .stdlib-chart-stat-value { font-size: 30px; font-weight: 700; fill: currentColor; }
69
+ .stdlib-chart-stat-unit { font-size: 14px; font-weight: 600; fill: currentColor; opacity: 0.72; }
70
+ .stdlib-chart-stat-delta { font-size: 12px; font-weight: 600; fill: currentColor; opacity: 0.72; }
71
+ .stdlib-chart-stat-delta-up { fill: #10b981; opacity: 1; }
72
+ .stdlib-chart-stat-delta-down { fill: #ef4444; opacity: 1; }
73
+ .stdlib-chart-stat-sparkline { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.86; }
74
+ .stdlib-chart-stat-sparkline-area { stroke: none; opacity: 0.18; }
75
+ .stdlib-chart-heatmap-cell { stroke: white; stroke-width: 1; }
76
+ .stdlib-chart-heatmap-label { font-size: 10px; fill: currentColor; opacity: 0.68; }
77
+ .stdlib-chart-map-land { fill: currentColor; opacity: var(--stdlib-chart-map-land-opacity, 0.12); stroke: currentColor; stroke-width: 0.5; stroke-linejoin: round; }
78
+ .stdlib-chart-map-point { stroke: var(--stdlib-chart-map-point-stroke, white); stroke-width: 1.5; }
79
+ .stdlib-chart-map-empty { font-size: 11px; fill: currentColor; opacity: 0.55; }
80
+ .stdlib-chart-state-region { stroke: white; stroke-width: 1; }
81
+ .stdlib-chart-state-label { font-size: 11px; fill: currentColor; opacity: 0.75; }
82
+ `.trim();
83
+ //# sourceMappingURL=default-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["charts/core/default-styles.ts"],"sourcesContent":["// CSS rule order is significant. Series-N rules emit first so shape-specific\n// rules below can override (e.g. line's `fill: none` beats series fill, and\n// slice/point's `stroke: white` beats series stroke).\nexport const DEFAULT_STYLES = `\n/* font-family is intentionally not set here so the chart inherits the app's\n font from its surrounding HTML context. For standalone SVG usage, set\n font-family on a wrapping element or override .stdlib-chart in your CSS. */\n.stdlib-chart {\n color: #1f2937;\n --stdlib-chart-c1: #3b82f6; --stdlib-chart-c2: #10b981;\n --stdlib-chart-c3: #f59e0b; --stdlib-chart-c4: #ef4444;\n --stdlib-chart-c5: #8b5cf6; --stdlib-chart-c6: #ec4899;\n --stdlib-chart-c7: #14b8a6; --stdlib-chart-c8: #f97316;\n}\n.stdlib-chart-series-0 { fill: var(--stdlib-chart-c1); stroke: var(--stdlib-chart-c1); }\n.stdlib-chart-series-1 { fill: var(--stdlib-chart-c2); stroke: var(--stdlib-chart-c2); }\n.stdlib-chart-series-2 { fill: var(--stdlib-chart-c3); stroke: var(--stdlib-chart-c3); }\n.stdlib-chart-series-3 { fill: var(--stdlib-chart-c4); stroke: var(--stdlib-chart-c4); }\n.stdlib-chart-series-4 { fill: var(--stdlib-chart-c5); stroke: var(--stdlib-chart-c5); }\n.stdlib-chart-series-5 { fill: var(--stdlib-chart-c6); stroke: var(--stdlib-chart-c6); }\n.stdlib-chart-series-6 { fill: var(--stdlib-chart-c7); stroke: var(--stdlib-chart-c7); }\n.stdlib-chart-series-7 { fill: var(--stdlib-chart-c8); stroke: var(--stdlib-chart-c8); }\n.stdlib-chart-axis { stroke: currentColor; opacity: 0.4; fill: none; }\n.stdlib-chart-tick-label { font-size: 10px; fill: currentColor; opacity: 0.6; }\n.stdlib-chart-axis-label { font-size: 11px; fill: currentColor; opacity: 0.85; }\n.stdlib-chart-grid { stroke: currentColor; opacity: 0.08; stroke-dasharray: 2 2; fill: none; }\n.stdlib-chart-title { font-size: 14px; font-weight: 600; fill: currentColor; }\n.stdlib-chart-subtitle { font-size: 11px; fill: currentColor; opacity: 0.7; }\n.stdlib-chart-reference { stroke: currentColor; opacity: 0.5; stroke-dasharray: 4 4; fill: none; }\n.stdlib-chart-reference-label { font-size: 10px; fill: currentColor; opacity: 0.7; }\n.stdlib-chart-line { fill: none; stroke-width: 2; }\n.stdlib-chart-area { fill-opacity: 0.18; stroke: none; }\n.stdlib-chart-sparkline { fill: none; stroke-width: 1.5; stroke: currentColor; }\n.stdlib-chart-sparkline-area { stroke: none; }\n.stdlib-chart-sparkline-last { fill: currentColor; stroke: none; }\n.stdlib-chart-sparkline-max { fill: #10b981; stroke: none; }\n.stdlib-chart-sparkline-min { fill: #ef4444; stroke: none; }\n.stdlib-chart-point { stroke: white; stroke-width: 1.5; }\n.stdlib-chart-slice { stroke: white; stroke-width: 2; stroke-linejoin: round; }\n.stdlib-chart-label { font-size: 11px; fill: currentColor; }\n.stdlib-chart-bar-value { font-size: 10px; fill: currentColor; opacity: 0.8; }\n.stdlib-chart-errorbar { stroke: currentColor; opacity: 0.55; fill: none; stroke-width: 1; }\n.stdlib-chart-error-band { fill-opacity: 0.15; stroke: none; }\n.stdlib-chart-trendline { stroke: currentColor; opacity: 0.55; stroke-width: 1.5; fill: none; stroke-dasharray: 5 4; }\n.stdlib-chart-minor-tick { stroke: currentColor; opacity: 0.25; }\n.stdlib-chart-box { fill-opacity: 0.4; stroke-width: 1; }\n.stdlib-chart-box-median { stroke: currentColor; stroke-width: 1.5; fill: none; }\n.stdlib-chart-box-whisker { stroke: currentColor; opacity: 0.6; fill: none; }\n.stdlib-chart-box-cap { stroke: currentColor; opacity: 0.6; fill: none; }\n.stdlib-chart-box-outlier { fill: currentColor; opacity: 0.5; stroke: white; stroke-width: 1; }\n.stdlib-chart-legend-swatch { stroke: none; }\n.stdlib-chart-legend-label { font-size: 11px; font-weight: 400; fill: currentColor; stroke: none; }\n.stdlib-chart-empty-text { font-size: 11px; fill: currentColor; opacity: 0.5; }\n.stdlib-chart-gauge-track { stroke: currentColor; stroke-width: 10; opacity: 0.12; fill: none; stroke-linecap: round; }\n.stdlib-chart-gauge-fill { stroke-width: 10; fill: none; stroke-linecap: round; }\n.stdlib-chart-gauge-gradient-segment { stroke-width: 10; fill: none; stroke-linecap: butt; }\n.stdlib-chart-gauge-gradient-scale { opacity: 0.22; }\n.stdlib-chart-gauge-needle { stroke-width: 2; fill: none; stroke-linecap: round; }\n.stdlib-chart-gauge-hub { fill: currentColor; stroke: none; }\n.stdlib-chart-gauge-value { font-size: 28px; font-weight: 700; fill: currentColor; }\n.stdlib-chart-gauge-label { font-size: 12px; fill: currentColor; opacity: 0.72; }\n.stdlib-chart-gauge-unit { font-size: 11px; fill: currentColor; opacity: 0.6; }\n.stdlib-chart-bar-gauge-track { fill: currentColor; opacity: 0.1; }\n.stdlib-chart-bar-gauge-fill { stroke: none; }\n.stdlib-chart-bar-gauge-label { font-size: 11px; fill: currentColor; opacity: 0.75; }\n.stdlib-chart-bar-gauge-value { font-size: 11px; font-weight: 600; fill: currentColor; }\n.stdlib-chart-stat-label { font-size: 12px; fill: currentColor; opacity: 0.72; }\n.stdlib-chart-stat-value { font-size: 30px; font-weight: 700; fill: currentColor; }\n.stdlib-chart-stat-unit { font-size: 14px; font-weight: 600; fill: currentColor; opacity: 0.72; }\n.stdlib-chart-stat-delta { font-size: 12px; font-weight: 600; fill: currentColor; opacity: 0.72; }\n.stdlib-chart-stat-delta-up { fill: #10b981; opacity: 1; }\n.stdlib-chart-stat-delta-down { fill: #ef4444; opacity: 1; }\n.stdlib-chart-stat-sparkline { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.86; }\n.stdlib-chart-stat-sparkline-area { stroke: none; opacity: 0.18; }\n.stdlib-chart-heatmap-cell { stroke: white; stroke-width: 1; }\n.stdlib-chart-heatmap-label { font-size: 10px; fill: currentColor; opacity: 0.68; }\n.stdlib-chart-map-land { fill: currentColor; opacity: var(--stdlib-chart-map-land-opacity, 0.12); stroke: currentColor; stroke-width: 0.5; stroke-linejoin: round; }\n.stdlib-chart-map-point { stroke: var(--stdlib-chart-map-point-stroke, white); stroke-width: 1.5; }\n.stdlib-chart-map-empty { font-size: 11px; fill: currentColor; opacity: 0.55; }\n.stdlib-chart-state-region { stroke: white; stroke-width: 1; }\n.stdlib-chart-state-label { font-size: 11px; fill: currentColor; opacity: 0.75; }\n`.trim();\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAM,cAAc,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,IAAI,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,79 @@
1
+ import { chartTextWidth, headerHeight, wrapLabel } from "../../content/chart-bar";
2
+ import { chartMessages } from "../../content/chart-message-catalog";
3
+ import { barPercent } from "./bar-labels";
4
+ /** Ratios use the original start/previous observation. Geometry fits the largest observed step, including rises. */
5
+ export function funnelLayout(spec, size = {
6
+ width: 480,
7
+ height: 280
8
+ }) {
9
+ if (spec.data.some(d => d.value !== null && (!Number.isFinite(d.value) || d.value < 0))) throw new RangeError("Funnel values must be finite and nonnegative, or null");
10
+ const unit = size.width / 296;
11
+ const numbers = new Intl.NumberFormat(spec.locale ?? "en");
12
+ const format = spec.valueFormat ?? (v => numbers.format(v));
13
+ const labels = chartMessages.resolve([spec.locale ?? "en"]).t;
14
+ const percent = barPercent(spec.locale);
15
+ const share = (value, denominator) => value === null || denominator == null || denominator === 0 ? null : value / denominator;
16
+ const left = Math.min(96 * unit, size.width * 0.3);
17
+ const right = Math.max(104 * unit, ...spec.data.map(d => d.value === null ? 0 : (chartTextWidth(format(d.value)) + 8) * unit));
18
+ const plot = Math.max(0, size.width - left - right - 8);
19
+ const center = left + plot / 2;
20
+ const top = headerHeight(spec);
21
+ const pitch = (size.height - top) / Math.max(1, spec.data.length);
22
+ const height = Math.min(pitch * 0.6, 34);
23
+ const max = Math.max(0, ...spec.data.map(d => d.value ?? 0));
24
+ const steps = spec.data.map((d, index) => {
25
+ const startShare = share(d.value, spec.data[0]?.value);
26
+ const previousShare = index ? share(d.value, spec.data[index - 1]?.value) : null;
27
+ const y = top + index * pitch + (pitch - height) / 2;
28
+ const fields = [{
29
+ key: "value",
30
+ value: d.value ?? "–",
31
+ formatted: d.value === null ? "–" : format(d.value)
32
+ }, {
33
+ key: "startPercent",
34
+ value: startShare === null ? "–" : startShare * 100,
35
+ formatted: startShare === null ? "–" : percent.format(startShare)
36
+ }, ...(index ? [{
37
+ key: "previousPercent",
38
+ value: previousShare === null ? "–" : previousShare * 100,
39
+ formatted: previousShare === null ? "–" : percent.format(previousShare)
40
+ }] : [])];
41
+ const datum = {
42
+ role: "item",
43
+ index,
44
+ label: d.label,
45
+ anchor: [center, y],
46
+ values: fields
47
+ };
48
+ return {
49
+ ...d,
50
+ index,
51
+ center,
52
+ y,
53
+ width: d.value === null || max === 0 ? 0 : d.value / max * plot,
54
+ startShare,
55
+ previousShare,
56
+ datum,
57
+ labelLines: wrapLabel(d.label, (left / unit - 8) * 11 / 12.5, 2).lines,
58
+ valueText: fields[0].formatted,
59
+ shareText: `${fields[1].formatted} ${labels.chartBarStart}`,
60
+ title: `${d.label} · ${fields[0].formatted} · ${labels.chartFields({
61
+ key: "startPercent"
62
+ })}: ${fields[1].formatted}${index ? ` · ${labels.chartFields({
63
+ key: "previousPercent"
64
+ })}: ${fields[2].formatted}` : ""}`
65
+ };
66
+ });
67
+ return {
68
+ ...size,
69
+ unit,
70
+ left,
71
+ right,
72
+ center,
73
+ top,
74
+ pitch,
75
+ barHeight: height,
76
+ steps
77
+ };
78
+ }
79
+ //# sourceMappingURL=funnel-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["charts/core/funnel-layout.ts"],"sourcesContent":["import { chartTextWidth, headerHeight, wrapLabel } from \"../../content/chart-bar\";\nimport { chartMessages } from \"../../content/chart-message-catalog\";\nimport { barPercent } from \"./bar-labels\";\nimport type { ChartDatum } from \"./types\";\n\nexport type FunnelOptions = {\n data: { label: string; value: number | null }[];\n valueFormat?: (value: number) => string;\n locale?: string;\n title?: string;\n subtitle?: string;\n className?: string;\n};\n\n/** Ratios use the original start/previous observation. Geometry fits the largest observed step, including rises. */\nexport function funnelLayout(spec: FunnelOptions, size = { width: 480, height: 280 }) {\n if (spec.data.some((d) => d.value !== null && (!Number.isFinite(d.value) || d.value < 0)))\n throw new RangeError(\"Funnel values must be finite and nonnegative, or null\");\n const unit = size.width / 296;\n const numbers = new Intl.NumberFormat(spec.locale ?? \"en\");\n const format = spec.valueFormat ?? ((v: number) => numbers.format(v));\n const labels = chartMessages.resolve([spec.locale ?? \"en\"]).t;\n const percent = barPercent(spec.locale);\n const share = (value: number | null, denominator: number | null | undefined) =>\n value === null || denominator == null || denominator === 0 ? null : value / denominator;\n const left = Math.min(96 * unit, size.width * 0.3);\n const right = Math.max(104 * unit, ...spec.data.map((d) => (d.value === null ? 0 : (chartTextWidth(format(d.value)) + 8) * unit)));\n const plot = Math.max(0, size.width - left - right - 8);\n const center = left + plot / 2;\n const top = headerHeight(spec);\n const pitch = (size.height - top) / Math.max(1, spec.data.length);\n const height = Math.min(pitch * 0.6, 34);\n const max = Math.max(0, ...spec.data.map((d) => d.value ?? 0));\n const steps = spec.data.map((d, index) => {\n const startShare = share(d.value, spec.data[0]?.value);\n const previousShare = index ? share(d.value, spec.data[index - 1]?.value) : null;\n const y = top + index * pitch + (pitch - height) / 2;\n const fields = [\n { key: \"value\", value: d.value ?? \"–\", formatted: d.value === null ? \"–\" : format(d.value) },\n {\n key: \"startPercent\",\n value: startShare === null ? \"–\" : startShare * 100,\n formatted: startShare === null ? \"–\" : percent.format(startShare),\n },\n ...(index\n ? [\n {\n key: \"previousPercent\",\n value: previousShare === null ? \"–\" : previousShare * 100,\n formatted: previousShare === null ? \"–\" : percent.format(previousShare),\n },\n ]\n : []),\n ];\n const datum: ChartDatum = { role: \"item\", index, label: d.label, anchor: [center, y], values: fields };\n return {\n ...d,\n index,\n center,\n y,\n width: d.value === null || max === 0 ? 0 : (d.value / max) * plot,\n startShare,\n previousShare,\n datum,\n labelLines: wrapLabel(d.label, ((left / unit - 8) * 11) / 12.5, 2).lines,\n valueText: fields[0]!.formatted,\n shareText: `${fields[1]!.formatted} ${labels.chartBarStart}`,\n title: `${d.label} · ${fields[0]!.formatted} · ${labels.chartFields({ key: \"startPercent\" })}: ${fields[1]!.formatted}${index ? ` · ${labels.chartFields({ key: \"previousPercent\" })}: ${fields[2]!.formatted}` : \"\"}`,\n };\n });\n return { ...size, unit, left, right, center, top, pitch, barHeight: height, steps };\n}\n\nexport type FunnelLayout = ReturnType<typeof funnelLayout>;\n"],"mappings":"AAAA,SAAS,cAAc,EAAE,YAAY,EAAE,SAAS,QAAQ,yBAAyB;AACjF,SAAS,aAAa,QAAQ,qCAAqC;AACnE,SAAS,UAAU,QAAQ,cAAc;AAYzC;AACA,OAAO,SAAS,YAAY,CAAC,IAAmB,EAAE,IAAI,GAAG;EAAE,KAAK,EAAE,GAAG;EAAE,MAAM,EAAE;AAAI,CAAC,EAAE;EACpF,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,IAAK,CAAC,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EACvF,MAAM,IAAI,UAAU,CAAC,uDAAuD,CAAC;EAC/E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG;EAC7B,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC;EAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,KAAM,CAAS,IAAK,OA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