@keboola/design 11.4.0 → 11.6.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 (184) hide show
  1. package/AGENTS.md +198 -7
  2. package/CHANGELOG.md +383 -0
  3. package/COMPONENT-API.md +73 -52
  4. package/dist/{AIKit-DDg5DBCG.js → AIKit-BExvt9pt.js} +390 -70
  5. package/dist/AIKit-BExvt9pt.js.map +1 -0
  6. package/dist/{Alert-DHJFrWnS.js → Alert-Ba5b2YPq.js} +2 -2
  7. package/dist/{Alert-DHJFrWnS.js.map → Alert-Ba5b2YPq.js.map} +1 -1
  8. package/dist/{Badge-Ch26CXoP.js → Badge-D0pXdekt.js} +2 -2
  9. package/dist/Badge-D0pXdekt.js.map +1 -0
  10. package/dist/{BrandEditor-Go7w8Zj2.js → BrandEditor-CSANsxUz.js} +6 -6
  11. package/dist/{BrandEditor-Go7w8Zj2.js.map → BrandEditor-CSANsxUz.js.map} +1 -1
  12. package/dist/{BrandLogo-Dmi7jo21.js → BrandLogo-CoKBk4MI.js} +4 -4
  13. package/dist/BrandLogo-CoKBk4MI.js.map +1 -0
  14. package/dist/{Breadcrumb-uEkM6adI.js → Breadcrumb-g_xn_-Nf.js} +2 -2
  15. package/dist/{Breadcrumb-uEkM6adI.js.map → Breadcrumb-g_xn_-Nf.js.map} +1 -1
  16. package/dist/{Checkbox-fC0BuO2B.js → Checkbox-CUIn2jap.js} +2 -2
  17. package/dist/{Checkbox-fC0BuO2B.js.map → Checkbox-CUIn2jap.js.map} +1 -1
  18. package/dist/{Clipboard-ChPdiUy3.js → Clipboard-BTW6C-b_.js} +2 -2
  19. package/dist/{Clipboard-ChPdiUy3.js.map → Clipboard-BTW6C-b_.js.map} +1 -1
  20. package/dist/{ClipboardButton-D9pDjgkB.js → ClipboardButton-CwZJdRaz.js} +2 -2
  21. package/dist/{ClipboardButton-D9pDjgkB.js.map → ClipboardButton-CwZJdRaz.js.map} +1 -1
  22. package/dist/{CodeEditor-Cxy3HnKH.js → CodeEditor-C9zy7PxK.js} +6 -6
  23. package/dist/{CodeEditor-Cxy3HnKH.js.map → CodeEditor-C9zy7PxK.js.map} +1 -1
  24. package/dist/{ColorInput-Bxj-1eLT.js → ColorInput-BZV-u_94.js} +3 -3
  25. package/dist/{ColorInput-Bxj-1eLT.js.map → ColorInput-BZV-u_94.js.map} +1 -1
  26. package/dist/{Combobox-Cs_1pj2q.js → Combobox-BfIfaVMA.js} +273 -104
  27. package/dist/Combobox-BfIfaVMA.js.map +1 -0
  28. package/dist/{Command-B7ML9YMv.js → Command-Bfa1kpbt.js} +2 -2
  29. package/dist/{Command-B7ML9YMv.js.map → Command-Bfa1kpbt.js.map} +1 -1
  30. package/dist/{CopyField-BO_sh-HO.js → CopyField-DpT0Ngz1.js} +2 -2
  31. package/dist/{CopyField-BO_sh-HO.js.map → CopyField-DpT0Ngz1.js.map} +1 -1
  32. package/dist/{DateInput-ZdaMQo5i.js → DateInput-DiEd5uCL.js} +3 -3
  33. package/dist/{DateInput-ZdaMQo5i.js.map → DateInput-DiEd5uCL.js.map} +1 -1
  34. package/dist/{DateRangeInput-DkvNh_sT.js → DateRangeInput-DPfVYchl.js} +3 -3
  35. package/dist/{DateRangeInput-DkvNh_sT.js.map → DateRangeInput-DPfVYchl.js.map} +1 -1
  36. package/dist/DiagramSource-C5_d8Gdj.js +11 -0
  37. package/dist/DiagramSource-C5_d8Gdj.js.map +1 -0
  38. package/dist/{FieldItem-CCd9-xnp.js → FieldItem-B7XMmZSz.js} +3 -3
  39. package/dist/{FieldItem-CCd9-xnp.js.map → FieldItem-B7XMmZSz.js.map} +1 -1
  40. package/dist/{Form-k6PH-em3.js → Form-CsttTHn4.js} +7 -7
  41. package/dist/Form-CsttTHn4.js.map +1 -0
  42. package/dist/{FormGroup-DbcDtrgU.js → FormGroup-DHvTFdno.js} +3 -3
  43. package/dist/{FormGroup-DbcDtrgU.js.map → FormGroup-DHvTFdno.js.map} +1 -1
  44. package/dist/{FullScreenModal-BvPuYibe.js → FullScreenModal-CN9nAs72.js} +50 -2
  45. package/dist/FullScreenModal-CN9nAs72.js.map +1 -0
  46. package/dist/{InputGroup-BnLHY0eq.js → InputGroup-DcZRlVnN.js} +22 -14
  47. package/dist/InputGroup-DcZRlVnN.js.map +1 -0
  48. package/dist/{Kbd-CvSM3D3-.js → Kbd-Cvvt91Q8.js} +14 -4
  49. package/dist/Kbd-Cvvt91Q8.js.map +1 -0
  50. package/dist/{MermaidDiagram-WkonYErO.js → MermaidDiagram-DSI7xMu2.js} +21 -19
  51. package/dist/MermaidDiagram-DSI7xMu2.js.map +1 -0
  52. package/dist/{MultiActionButtonGroup-CxWH7yWK.js → MultiActionButtonGroup-DokHbPgM.js} +2 -2
  53. package/dist/{MultiActionButtonGroup-CxWH7yWK.js.map → MultiActionButtonGroup-DokHbPgM.js.map} +1 -1
  54. package/dist/{Navbar-B2UsolVU.js → Navbar-Liy1TPI7.js} +6 -6
  55. package/dist/{Navbar-B2UsolVU.js.map → Navbar-Liy1TPI7.js.map} +1 -1
  56. package/dist/PageHeader-Q3IpCnQd.js.map +1 -1
  57. package/dist/{PageToolbar-DnbFt14Q.js → PageToolbar-DExqEYGl.js} +2 -2
  58. package/dist/{PageToolbar-DnbFt14Q.js.map → PageToolbar-DExqEYGl.js.map} +1 -1
  59. package/dist/{Popconfirm-CILjmzKI.js → Popconfirm-5pBzT_HQ.js} +10 -11
  60. package/dist/{Popconfirm-CILjmzKI.js.map → Popconfirm-5pBzT_HQ.js.map} +1 -1
  61. package/dist/{RadioGroup-XFzFd1ti.js → RadioGroup-DXPbSj8P.js} +2 -2
  62. package/dist/{RadioGroup-XFzFd1ti.js.map → RadioGroup-DXPbSj8P.js.map} +1 -1
  63. package/dist/{Search-4Bxtt8hS.js → Search-5uQAiNIP.js} +2 -2
  64. package/dist/{Search-4Bxtt8hS.js.map → Search-5uQAiNIP.js.map} +1 -1
  65. package/dist/{SearchInput-f_oY9T4Z.js → SearchInput-D4UgAXJK.js} +3 -3
  66. package/dist/{SearchInput-f_oY9T4Z.js.map → SearchInput-D4UgAXJK.js.map} +1 -1
  67. package/dist/{SectionNav-BpJlisbT.js → SectionNav-OkKCjSA-.js} +3 -3
  68. package/dist/{SectionNav-BpJlisbT.js.map → SectionNav-OkKCjSA-.js.map} +1 -1
  69. package/dist/{Select-DpcgKqKB.js → Select-DV3Hak_l.js} +3 -4
  70. package/dist/Select-DV3Hak_l.js.map +1 -0
  71. package/dist/{Sidebar-Cm6I4dE1.js → Sidebar-D3cY1kha.js} +44 -20
  72. package/dist/Sidebar-D3cY1kha.js.map +1 -0
  73. package/dist/{Slider-pPC_3gz9.js → Slider-CRf-bB4y.js} +2 -2
  74. package/dist/{Slider-pPC_3gz9.js.map → Slider-CRf-bB4y.js.map} +1 -1
  75. package/dist/{Switch-ChfPKcTE.js → Switch-B0WdGSjz.js} +7 -7
  76. package/dist/{Switch-ChfPKcTE.js.map → Switch-B0WdGSjz.js.map} +1 -1
  77. package/dist/{TextInput-DHM6dHmn.js → TextInput-DH5SkbsE.js} +3 -3
  78. package/dist/{TextInput-DHM6dHmn.js.map → TextInput-DH5SkbsE.js.map} +1 -1
  79. package/dist/{ThemeProvider-DrQJtzpd.js → ThemeProvider-2RMdVGxO.js} +17 -12
  80. package/dist/{ThemeProvider-DrQJtzpd.js.map → ThemeProvider-2RMdVGxO.js.map} +1 -1
  81. package/dist/{Timeline-6btyJl4D.js → Timeline-BG5Xogxh.js} +11 -11
  82. package/dist/{Timeline-6btyJl4D.js.map → Timeline-BG5Xogxh.js.map} +1 -1
  83. package/dist/{Workbench-BzE-Vvd9.js → Workbench-UR2FBC7I.js} +3 -1
  84. package/dist/Workbench-UR2FBC7I.js.map +1 -0
  85. package/dist/{ZoomableSvg-BWnDkR61.js → ZoomableSvg-pooPb1Cu.js} +3 -3
  86. package/dist/{ZoomableSvg-BWnDkR61.js.map → ZoomableSvg-pooPb1Cu.js.map} +1 -1
  87. package/dist/editors.js +4 -4
  88. package/dist/flint.js +136 -9
  89. package/dist/flint.js.map +1 -1
  90. package/dist/index.d.ts +801 -324
  91. package/dist/index.js +41 -40
  92. package/dist/internal/blocks/AIKit.js +2 -2
  93. package/dist/internal/blocks/AuthLayout.js +118 -0
  94. package/dist/internal/blocks/AuthLayout.js.map +1 -0
  95. package/dist/internal/blocks/BrandEditor.js +1 -1
  96. package/dist/internal/blocks/ClipboardButton.js +1 -1
  97. package/dist/internal/blocks/ColorInput.js +1 -1
  98. package/dist/internal/blocks/Command.js +1 -1
  99. package/dist/internal/blocks/CopyField.js +1 -1
  100. package/dist/internal/blocks/DateInput.js +1 -1
  101. package/dist/internal/blocks/DateRangeInput.js +1 -1
  102. package/dist/internal/blocks/ExportMenu.js +1 -1
  103. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  104. package/dist/internal/blocks/Form.js +1 -1
  105. package/dist/internal/blocks/FormGroup.js +1 -1
  106. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  107. package/dist/internal/blocks/MultiCombobox.js +107 -48
  108. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  109. package/dist/internal/blocks/NumberInput.js +1 -1
  110. package/dist/internal/blocks/PageToolbar.js +1 -1
  111. package/dist/internal/blocks/PasswordInput.js +2 -2
  112. package/dist/internal/blocks/SearchInput.js +1 -1
  113. package/dist/internal/blocks/SearchInputWithNavigation.js +2 -2
  114. package/dist/internal/blocks/SectionNav.js +1 -1
  115. package/dist/internal/blocks/TextInput.js +1 -1
  116. package/dist/internal/blocks/Textarea.js +1 -1
  117. package/dist/internal/blocks/TimeInput.js +2 -2
  118. package/dist/internal/components/Alert.js +1 -1
  119. package/dist/internal/components/Avatar.js +1 -1
  120. package/dist/internal/components/Badge.js +1 -1
  121. package/dist/internal/components/BrandLogo.js +1 -1
  122. package/dist/internal/components/Breadcrumb.js +1 -1
  123. package/dist/internal/components/Checkbox.js +1 -1
  124. package/dist/internal/components/Clipboard.js +1 -1
  125. package/dist/internal/components/CollapsiblePanel.js +1 -1
  126. package/dist/internal/components/Combobox.js +2 -2
  127. package/dist/internal/components/FullScreenModal.js +1 -1
  128. package/dist/internal/components/InputGroup.js +1 -1
  129. package/dist/internal/components/Kbd.js +1 -1
  130. package/dist/internal/components/Navbar.js +1 -1
  131. package/dist/internal/components/Popconfirm.js +1 -1
  132. package/dist/internal/components/Progress.js +3 -1
  133. package/dist/internal/components/Progress.js.map +1 -1
  134. package/dist/internal/components/RadioGroup.js +1 -1
  135. package/dist/internal/components/Search.js +1 -1
  136. package/dist/internal/components/Select.js +1 -1
  137. package/dist/internal/components/Sidebar.js +1 -1
  138. package/dist/internal/components/Slider.js +1 -1
  139. package/dist/internal/components/Switch.js +1 -1
  140. package/dist/internal/components/ThemeProvider.js +1 -1
  141. package/dist/internal/components/Timeline.js +1 -1
  142. package/dist/internal/components/Tooltip.js +1 -1
  143. package/dist/internal/components/Truncated.js +1 -1
  144. package/dist/internal/components/Workbench.js +1 -1
  145. package/dist/internal/components/ZoomableSvg.js +1 -1
  146. package/dist/internal/utils.js +2 -2
  147. package/dist/markdown-editor.js +29 -23
  148. package/dist/markdown-editor.js.map +1 -1
  149. package/dist/mermaid.js +1 -1
  150. package/dist/rjsf.js +22 -23
  151. package/dist/rjsf.js.map +1 -1
  152. package/dist/styles.css +1 -1
  153. package/dist/{svgTransforms-C9njt92h.js → svgTransforms-CJAYPk7o.js} +2 -10
  154. package/dist/svgTransforms-CJAYPk7o.js.map +1 -0
  155. package/dist/testing.js +1 -1
  156. package/dist/{useColorSchemeState-klihG9-i.js → themeScopeContext-D7fSyb06.js} +16 -3
  157. package/dist/themeScopeContext-D7fSyb06.js.map +1 -0
  158. package/dist/{themeTokens-D70HeNVF.js → themeTokens-qP1-55O7.js} +37 -10
  159. package/dist/themeTokens-qP1-55O7.js.map +1 -0
  160. package/dist/{utils-B5Z52hYs.js → utils-DSvrhU8E.js} +6 -2
  161. package/dist/{utils-B5Z52hYs.js.map → utils-DSvrhU8E.js.map} +1 -1
  162. package/dist/vega.d.ts +1 -1
  163. package/dist/vega.js +3 -3
  164. package/dist/vega.js.map +1 -1
  165. package/dist/{vegaTheme-DfoEQhOy.js → vegaTheme-CSvFEMBl.js} +6 -6
  166. package/dist/vegaTheme-CSvFEMBl.js.map +1 -0
  167. package/package.json +11 -9
  168. package/src/styles.css +3 -0
  169. package/dist/AIKit-DDg5DBCG.js.map +0 -1
  170. package/dist/Badge-Ch26CXoP.js.map +0 -1
  171. package/dist/BrandLogo-Dmi7jo21.js.map +0 -1
  172. package/dist/Combobox-Cs_1pj2q.js.map +0 -1
  173. package/dist/Form-k6PH-em3.js.map +0 -1
  174. package/dist/FullScreenModal-BvPuYibe.js.map +0 -1
  175. package/dist/InputGroup-BnLHY0eq.js.map +0 -1
  176. package/dist/Kbd-CvSM3D3-.js.map +0 -1
  177. package/dist/MermaidDiagram-WkonYErO.js.map +0 -1
  178. package/dist/Select-DpcgKqKB.js.map +0 -1
  179. package/dist/Sidebar-Cm6I4dE1.js.map +0 -1
  180. package/dist/Workbench-BzE-Vvd9.js.map +0 -1
  181. package/dist/svgTransforms-C9njt92h.js.map +0 -1
  182. package/dist/themeTokens-D70HeNVF.js.map +0 -1
  183. package/dist/useColorSchemeState-klihG9-i.js.map +0 -1
  184. package/dist/vegaTheme-DfoEQhOy.js.map +0 -1
@@ -1,11 +1,3 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
2
- import { jsx } from "react/jsx-runtime";
3
- //#region src/blocks/DiagramShared/DiagramSource.tsx
4
- const DiagramSource = ({ code }) => /* @__PURE__ */ jsx("pre", {
5
- className: cn("tw:my-3 tw:overflow-auto tw:whitespace-pre-wrap tw:break-all", "tw:py-3 tw:px-4", "tw:bg-muted", "tw:rounded-md tw:text-muted-foreground", "tw:text-sm tw:font-mono"),
6
- children: /* @__PURE__ */ jsx("code", { children: code })
7
- });
8
- //#endregion
9
1
  //#region src/blocks/DiagramShared/svgTransforms.ts
10
2
  const HTML_TAG = /<[^>]+>/g;
11
3
  const FOREIGN_OBJECT = /(<foreignObject\b[^>]*>)([\s\S]*?)(<\/foreignObject>)/g;
@@ -84,6 +76,6 @@ const hasDrawnContent = (svg) => {
84
76
  return Number(viewBox[2]) > 0 && Number(viewBox[3]) > 0;
85
77
  };
86
78
  //#endregion
87
- export { DiagramSource, flattenForeignObjectLabels, hasDrawnContent, makeResponsive };
79
+ export { flattenForeignObjectLabels, hasDrawnContent, makeResponsive };
88
80
 
89
- //# sourceMappingURL=svgTransforms-C9njt92h.js.map
81
+ //# sourceMappingURL=svgTransforms-CJAYPk7o.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgTransforms-CJAYPk7o.js","names":[],"sources":["../src/blocks/DiagramShared/svgTransforms.ts"],"sourcesContent":["// Pure post-processing of diagram SVG output (mermaid, vega), before it reaches\n// ZoomableSvg's DOMPurify pass. Extracted for unit testing.\n\nconst HTML_TAG = /<[^>]+>/g;\nconst FOREIGN_OBJECT = /(<foreignObject\\b[^>]*>)([\\s\\S]*?)(<\\/foreignObject>)/g;\n// The root <svg> open tag, anchored to the start of the string.\nconst ROOT_SVG_TAG = /^(\\s*<svg\\b)([^>]*)(>)/i;\n\n/**\n * Mermaid renders node labels — including icon-shape (`@{ icon: … }`) labels — as\n * HTML (`<div><span><p>…</p></span></div>`) inside an SVG `<foreignObject>`. The\n * ZoomableSvg DOMPurify pass runs the SVG namespace profile, which strips every\n * XHTML-namespaced element under an `<svg>` root, so those wrapped labels vanish\n * (icon rendered, text gone). DOMPurify keeps *bare text* directly inside a\n * `<foreignObject>`, so collapse each label's HTML to its text content. Mermaid\n * has already sanitized that text under `securityLevel: 'strict'`, and dropping\n * the wrapper tags is strictly safer than keeping them.\n *\n * Entities are left encoded (`&amp;`, `&lt;`, …): as text-node content inside the\n * `<foreignObject>` the browser renders them correctly, and decoding them here\n * would risk turning `&lt;`/`&gt;` back into real angle brackets that could form\n * markup in the sanitized SVG.\n */\nexport const flattenForeignObjectLabels = (svg: string): string =>\n svg.replace(FOREIGN_OBJECT, (_match, open: string, inner: string, close: string) => {\n const text = inner.replace(HTML_TAG, ' ').replace(/\\s+/g, ' ').trim();\n return `${open}${text}${close}`;\n });\n\n/**\n * Make the diagram fluid: strip the root `<svg>`'s fixed width/height/style and\n * set `width=\"100%\"` plus a `max-width` from the viewBox width so it never\n * overflows its container.\n *\n * Only the ROOT `<svg>` tag is rewritten (anchored to string start). Icon-shape\n * nodes embed their own inner `<svg>` icons with fixed width/height; an earlier\n * unanchored regex matched the first `<svg …height…>` anywhere, so when the root\n * tag carried no height (mermaid emits `width=\"100%\"` alone) it stripped the\n * FIRST icon's height instead — detaching and mis-sizing that icon.\n *\n * The existing `style` attribute is preserved (only an existing `max-width` is\n * replaced): beautiful-mermaid carries theme CSS vars (`--bg`, `--fg`) there that\n * its inner `<style>` block derives node/text colors from — dropping the whole\n * attribute made every derived color resolve to black.\n */\nconst STYLE_ATTR = /\\s+style=\"([^\"]*)\"/i;\n\nexport const makeResponsive = (svgString: string): string => {\n const viewBoxMatch = svgString.match(/viewBox=\"[^\"]*\\s([\\d.]+)\\s[\\d.]+\"/);\n const vbWidth = viewBoxMatch ? Math.round(Number(viewBoxMatch[1])) : undefined;\n\n return svgString.replace(ROOT_SVG_TAG, (_match, open: string, attrs: string, close: string) => {\n const existingStyle = attrs.match(STYLE_ATTR)?.[1] ?? '';\n const styleDecls = existingStyle\n .replace(/max-width:\\s*[^;\"]*;?\\s*/gi, '')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/;$/, '');\n\n let nextAttrs = attrs\n .replace(/\\s+width=\"[^\"]*\"/i, '')\n .replace(/\\s+height=\"[^\"]*\"/i, '')\n .replace(STYLE_ATTR, '');\n\n nextAttrs += ' width=\"100%\"';\n\n const styleParts = [styleDecls, vbWidth ? `max-width: ${vbWidth}px` : '']\n .filter(Boolean)\n .join('; ');\n if (styleParts) nextAttrs += ` style=\"${styleParts}\"`;\n\n return `${open}${nextAttrs}${close}`;\n });\n};\n\n/**\n * Whether an SVG has drawn content, i.e. a non-degenerate viewBox.\n *\n * - beautiful-mermaid does not throw on every syntax it cannot lay out: an\n * `erDiagram` entity whose quoted name contains a space (`\"sample (Copy)\"`)\n * returns a well-formed SVG with `viewBox=\"0 0 0 0\"` and an empty `<defs>`.\n * - Such output is truthy, so it would be cached and rendered as an empty box,\n * and the async mermaid renderer — which parses the same code fine — would\n * never run.\n * - A missing viewBox counts as drawn: mermaid's own output is sized via\n * width/height attributes on some diagram types.\n * - Only the ROOT `<svg>` is inspected. Icon-shape nodes embed their own inner\n * `<svg>` / `<symbol>`, so an unanchored search reads a nested viewBox when the\n * root carries none — discarding a diagram that had in fact been drawn. Same\n * trap `makeResponsive` documents above.\n * - Either quote style is accepted, and whitespace around the `=`. Both current\n * renderers emit `viewBox=\"…\"` exactly, so this is future-proofing rather than a\n * live case: a miss reads as \"no viewBox\", i.e. drawn, silently restoring the\n * empty-diagram bug.\n */\nconst ROOT_VIEWBOX =\n /^\\s*<svg\\b[^>]*\\sviewBox\\s*=\\s*([\"'])\\s*[\\d.eE+-]+\\s+[\\d.eE+-]+\\s+([\\d.eE+-]+)\\s+([\\d.eE+-]+)\\s*\\1/i;\n\nexport const hasDrawnContent = (svg: string): boolean => {\n const viewBox = svg.match(ROOT_VIEWBOX);\n if (!viewBox) return true;\n return Number(viewBox[2]) > 0 && Number(viewBox[3]) > 0;\n};\n"],"mappings":";AAGA,MAAM,WAAW;AACjB,MAAM,iBAAiB;AAEvB,MAAM,eAAe;;;;;;;;;;;;;;;;AAiBrB,MAAa,8BAA8B,QACzC,IAAI,QAAQ,iBAAiB,QAAQ,MAAc,OAAe,UAAkB;CAElF,OAAO,GAAG,OADG,MAAM,QAAQ,UAAU,GAAG,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAC3C,IAAI;AAC1B,CAAC;;;;;;;;;;;;;;;;;AAkBH,MAAM,aAAa;AAEnB,MAAa,kBAAkB,cAA8B;CAC3D,MAAM,eAAe,UAAU,MAAM,mCAAmC;CACxE,MAAM,UAAU,eAAe,KAAK,MAAM,OAAO,aAAa,EAAE,CAAC,IAAI,KAAA;CAErE,OAAO,UAAU,QAAQ,eAAe,QAAQ,MAAc,OAAe,UAAkB;EAE7F,MAAM,cADgB,MAAM,MAAM,UAAU,CAAC,GAAG,MAAM,GAAA,CAEnD,QAAQ,8BAA8B,EAAE,CAAC,CACzC,QAAQ,QAAQ,GAAG,CAAC,CACpB,KAAK,CAAC,CACN,QAAQ,MAAM,EAAE;EAEnB,IAAI,YAAY,MACb,QAAQ,qBAAqB,EAAE,CAAC,CAChC,QAAQ,sBAAsB,EAAE,CAAC,CACjC,QAAQ,YAAY,EAAE;EAEzB,aAAa;EAEb,MAAM,aAAa,CAAC,YAAY,UAAU,cAAc,QAAQ,MAAM,EAAE,CAAC,CACtE,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;EACZ,IAAI,YAAY,aAAa,WAAW,WAAW;EAEnD,OAAO,GAAG,OAAO,YAAY;CAC/B,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,eACJ;AAEF,MAAa,mBAAmB,QAAyB;CACvD,MAAM,UAAU,IAAI,MAAM,YAAY;CACtC,IAAI,CAAC,SAAS,OAAO;CACrB,OAAO,OAAO,QAAQ,EAAE,IAAI,KAAK,OAAO,QAAQ,EAAE,IAAI;AACxD"}
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ArgoDesignContext } from "./context-D7X470dy.js";
2
- import { ThemeProvider } from "./ThemeProvider-DrQJtzpd.js";
2
+ import { ThemeProvider } from "./ThemeProvider-2RMdVGxO.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { keboola, keboolaLegacySidebar, keboolaLegacyTopnav } from "@keboola/brand-registry";
5
5
  import { render } from "@testing-library/react";
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_BRAND_ID, DEFAULT_COLOR_SCHEME } from "./defaults-i_xG2F_1.js";
2
- import { useCallback, useEffect, useState } from "react";
2
+ import { createContext, useCallback, useEffect, useState } from "react";
3
3
  //#region src/components/ThemeProvider/useBrandState.ts
4
4
  const BRAND_ATTRIBUTE = "data-brand";
5
5
  const useBrandState = ({ defaultBrandId: defaultBrand = DEFAULT_BRAND_ID, brandId: controlledBrand, onBrandIdChange: onBrandChange } = {}) => {
@@ -56,6 +56,19 @@ const useColorSchemeState = ({ defaultScheme = DEFAULT_COLOR_SCHEME, scheme: pro
56
56
  };
57
57
  };
58
58
  //#endregion
59
- export { BRAND_ATTRIBUTE, THEME_ATTRIBUTE, useBrandState, useColorSchemeState };
59
+ //#region src/components/ThemeProvider/themeScopeContext.ts
60
+ /**
61
+ * What a `ThemeScope` publishes about itself, in its own module so a hook can read it without
62
+ * importing the component that provides it.
63
+ *
64
+ * - `scheme`: the scheme this subtree is pinned to, or `null` outside a scope.
65
+ * - `container`: a body-level node carrying the scope's `data-theme` and token vars. A canvas
66
+ * (chart, diagram) that resolves live `--*` values reads them off this rather than `<html>`,
67
+ * which is still painting the page's scheme.
68
+ */
69
+ const ThemeScopeSchemeContext = createContext(null);
70
+ const ThemeScopeContainerContext = createContext(null);
71
+ //#endregion
72
+ export { BRAND_ATTRIBUTE, THEME_ATTRIBUTE, ThemeScopeContainerContext, ThemeScopeSchemeContext, useBrandState, useColorSchemeState };
60
73
 
61
- //# sourceMappingURL=useColorSchemeState-klihG9-i.js.map
74
+ //# sourceMappingURL=themeScopeContext-D7fSyb06.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeScopeContext-D7fSyb06.js","names":[],"sources":["../src/components/ThemeProvider/useBrandState.ts","../src/components/ThemeProvider/useColorSchemeState.ts","../src/components/ThemeProvider/themeScopeContext.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { DEFAULT_BRAND_ID } from './defaults';\nimport type { BrandId } from './types';\n\nexport const BRAND_ATTRIBUTE = 'data-brand';\n\nexport type UseBrandOptions = {\n /** Initial active brand id for uncontrolled use. Defaults to the design-system sentinel (`DEFAULT_BRAND_ID`) — no brand tokens injected, so the stylesheet defaults apply. */\n defaultBrandId?: BrandId;\n /** Controlled active brand id. When set, the parent owns the value and `setBrand` only notifies via `onBrandIdChange` (it does not mutate internal state). */\n brandId?: BrandId;\n /** Called with the next id whenever `setBrand` runs — required to persist the choice in controlled mode. */\n onBrandIdChange?: (brandId: BrandId) => void;\n};\n\nexport const useBrandState = ({\n defaultBrandId: defaultBrand = DEFAULT_BRAND_ID,\n brandId: controlledBrand,\n onBrandIdChange: onBrandChange,\n}: UseBrandOptions = {}) => {\n const [uncontrolledBrand, setUncontrolledBrand] = useState(defaultBrand);\n\n const isControlled = controlledBrand !== undefined;\n const brandId = isControlled ? controlledBrand : uncontrolledBrand;\n\n const setBrand = useCallback(\n (next: BrandId) => {\n if (!isControlled) setUncontrolledBrand(next);\n onBrandChange?.(next);\n },\n [isControlled, onBrandChange],\n );\n\n useEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(BRAND_ATTRIBUTE, brandId);\n }, [brandId]);\n\n return { brandId, setBrand };\n};\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { DEFAULT_COLOR_SCHEME } from './defaults';\nimport type { ColorScheme, ResolvedColorScheme } from './types';\n\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\nexport const THEME_ATTRIBUTE = 'data-theme';\n\nconst getSystemColorScheme = (): ResolvedColorScheme => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return 'light';\n return window.matchMedia(DARK_QUERY).matches ? 'dark' : 'light';\n};\n\nexport type UseColorSchemeOptions = {\n /** Initial colour scheme for uncontrolled use. Defaults to `light` (`DEFAULT_COLOR_SCHEME`). */\n defaultScheme?: ColorScheme;\n /** Controlled colour scheme (`light` / `dark` / `system`). When set, the parent owns the value and `setScheme` only notifies via `onSchemeChange`. `system` follows `prefers-color-scheme` and resolves reactively. */\n scheme?: ColorScheme;\n /** Called with the next scheme whenever `setScheme` runs — required to persist the choice in controlled mode. */\n onSchemeChange?: (theme: ColorScheme) => void;\n};\n\nexport const useColorSchemeState = ({\n defaultScheme = DEFAULT_COLOR_SCHEME,\n scheme: propScheme,\n onSchemeChange,\n}: UseColorSchemeOptions = {}) => {\n const [uncontrolledScheme, setUncontrolledScheme] = useState(defaultScheme);\n const [systemScheme, setSystemScheme] = useState<ResolvedColorScheme>(getSystemColorScheme);\n\n const isControlled = propScheme !== undefined;\n const scheme = isControlled ? propScheme : uncontrolledScheme;\n\n const setScheme = useCallback(\n (next: ColorScheme) => {\n if (!isControlled) setUncontrolledScheme(next);\n onSchemeChange?.(next);\n },\n [isControlled, onSchemeChange],\n );\n\n // Track the OS preference so `system` stays live as the user flips it.\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n const mq = window.matchMedia(DARK_QUERY);\n const onChange = () => setSystemScheme(mq.matches ? 'dark' : 'light');\n onChange();\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n }, []);\n\n const resolvedScheme: ResolvedColorScheme = scheme === 'system' ? systemScheme : scheme;\n\n useEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(THEME_ATTRIBUTE, resolvedScheme);\n }, [resolvedScheme]);\n\n return { scheme, resolvedScheme, setScheme };\n};\n","import { createContext } from 'react';\n\nimport type { ResolvedColorScheme } from './types';\n\n/**\n * What a `ThemeScope` publishes about itself, in its own module so a hook can read it without\n * importing the component that provides it.\n *\n * - `scheme`: the scheme this subtree is pinned to, or `null` outside a scope.\n * - `container`: a body-level node carrying the scope's `data-theme` and token vars. A canvas\n * (chart, diagram) that resolves live `--*` values reads them off this rather than `<html>`,\n * which is still painting the page's scheme.\n */\nexport const ThemeScopeSchemeContext = createContext<ResolvedColorScheme | null>(null);\nexport const ThemeScopeContainerContext = createContext<HTMLElement | null>(null);\n"],"mappings":";;;AAKA,MAAa,kBAAkB;AAW/B,MAAa,iBAAiB,EAC5B,gBAAgB,eAAe,kBAC/B,SAAS,iBACT,iBAAi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AAM,iBAAsC,WAAW,WAAW,eAAe;CAEjF,gBAAgB;EACd,IAAI,OAAO,aAAa,aAAa;EACrC,SAAS,gBAAgB,aAAa,iBAAiB,cAAc;CACvE,GAAG,CAAC,cAAc,CAAC;CAEnB,OAAO;EAAE;EAAQ;EAAgB;CAAU;AAC7C;;;;;;;;;;;;AC9CA,MAAa,0BAA0B,cAA0C,IAAI;AACrF,MAAa,6BAA6B,cAAkC,IAAI"}
@@ -1,11 +1,12 @@
1
1
  import { DEFAULT_BRAND_ID, DEFAULT_COLOR_SCHEME } from "./defaults-i_xG2F_1.js";
2
- import { BRAND_ATTRIBUTE, THEME_ATTRIBUTE } from "./useColorSchemeState-klihG9-i.js";
3
- import { useSyncExternalStore } from "react";
2
+ import { BRAND_ATTRIBUTE, THEME_ATTRIBUTE, ThemeScopeContainerContext, ThemeScopeSchemeContext } from "./themeScopeContext-D7fSyb06.js";
3
+ import { use, useMemo, useSyncExternalStore } from "react";
4
4
  //#region src/components/ThemeProvider/useThemeAttributes.ts
5
5
  const DEFAULT_ATTRIBUTES = {
6
6
  cacheKey: `${DEFAULT_COLOR_SCHEME}:${DEFAULT_BRAND_ID}`,
7
7
  scheme: DEFAULT_COLOR_SCHEME,
8
- brandId: DEFAULT_BRAND_ID
8
+ brandId: DEFAULT_BRAND_ID,
9
+ scope: null
9
10
  };
10
11
  let snapshot = DEFAULT_ATTRIBUTES;
11
12
  const readThemeAttributes = () => {
@@ -18,7 +19,8 @@ const readThemeAttributes = () => {
18
19
  if (cacheKey !== snapshot.cacheKey) snapshot = {
19
20
  cacheKey,
20
21
  scheme,
21
- brandId
22
+ brandId,
23
+ scope: null
22
24
  };
23
25
  return snapshot;
24
26
  };
@@ -45,8 +47,32 @@ const getServerSnapshot = () => DEFAULT_ATTRIBUTES;
45
47
  *
46
48
  * Returning `scheme` from the same read is what makes that safe by construction:
47
49
  * a caller cannot pick up the new key and the old scheme.
50
+ *
51
+ * Inside a `ThemeScope` the scope's scheme wins. `<html>` still carries the page's, but the
52
+ * scope re-points the tokens for its own subtree, so a consumer that read the root would build
53
+ * light values for a dark panel — a white chart on a dark card. Unlike the provider's, the
54
+ * scope's attribute and vars are rendered in the same commit as the subtree, so context and
55
+ * DOM cannot disagree here.
48
56
  */
49
- const useThemeAttributes = () => useSyncExternalStore(subscribe, readThemeAttributes, getServerSnapshot);
57
+ const useThemeAttributes = () => {
58
+ const root = useSyncExternalStore(subscribe, readThemeAttributes, getServerSnapshot);
59
+ const scopedScheme = use(ThemeScopeSchemeContext);
60
+ const scope = use(ThemeScopeContainerContext);
61
+ return useMemo(() => {
62
+ if (scopedScheme === null && scope === null) return root;
63
+ const scheme = scopedScheme ?? root.scheme;
64
+ return {
65
+ scheme,
66
+ brandId: root.brandId,
67
+ scope,
68
+ cacheKey: `${scheme}:${root.brandId}${scope === null ? "" : ":scoped"}`
69
+ };
70
+ }, [
71
+ scopedScheme,
72
+ scope,
73
+ root
74
+ ]);
75
+ };
50
76
  //#endregion
51
77
  //#region src/utils/themeTokens.ts
52
78
  /**
@@ -78,15 +104,16 @@ const resolveToken = (token, fallbackChannels, alpha) => {
78
104
  * {@link createChannelResolver} is the same snapshot answering the raw `"R G B"`
79
105
  * channels, for a consumer that needs another serialization.
80
106
  */
81
- const createChannelResolver = () => {
82
- const computed = typeof document === "undefined" ? null : getComputedStyle(document.documentElement);
107
+ const createChannelResolver = (from) => {
108
+ const element = from ?? (typeof document === "undefined" ? null : document.documentElement);
109
+ const computed = element === null ? null : getComputedStyle(element);
83
110
  return (token, fallbackChannels) => computed?.getPropertyValue(`--${token}`).trim() || fallbackChannels;
84
111
  };
85
- const createTokenResolver = () => {
86
- const resolve = createChannelResolver();
112
+ const createTokenResolver = (from) => {
113
+ const resolve = createChannelResolver(from);
87
114
  return (token, fallbackChannels, alpha) => format(resolve(token, fallbackChannels), alpha);
88
115
  };
89
116
  //#endregion
90
117
  export { createChannelResolver, createTokenResolver, resolveToken, useThemeAttributes };
91
118
 
92
- //# sourceMappingURL=themeTokens-D70HeNVF.js.map
119
+ //# sourceMappingURL=themeTokens-qP1-55O7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeTokens-qP1-55O7.js","names":[],"sources":["../src/components/ThemeProvider/useThemeAttributes.ts","../src/utils/themeTokens.ts"],"sourcesContent":["import { use, useMemo, useSyncExternalStore } from 'react';\n\nimport { DEFAULT_BRAND_ID, DEFAULT_COLOR_SCHEME } from './defaults';\nimport { ThemeScopeContainerContext, ThemeScopeSchemeContext } from './themeScopeContext';\nimport type { BrandId, ResolvedColorScheme } from './types';\nimport { BRAND_ATTRIBUTE } from './useBrandState';\nimport { THEME_ATTRIBUTE } from './useColorSchemeState';\n\nexport type ThemeAttributes = {\n /** Changes whenever `scheme`, `brandId` or `scope` does — the memo key for anything built from live `--*` values. */\n cacheKey: string;\n scheme: ResolvedColorScheme;\n brandId: BrandId;\n /**\n * The element to read live `--*` values off, or `null` for `<html>`.\n *\n * Set inside a `ThemeScope`, whose subtree carries its own tokens. It arrives one commit\n * after the scope mounts, which is why it is part of `cacheKey` — a palette built against\n * `<html>` must not be served once the scope's own is available.\n */\n scope: HTMLElement | null;\n};\n\n// No attribute set means the stylesheet's own `:root` block is painting, which is\n// the default scheme — not a third \"unknown\" state. Same value on the server, so\n// the SSR snapshot and the client's first render agree.\nconst DEFAULT_ATTRIBUTES: ThemeAttributes = {\n cacheKey: `${DEFAULT_COLOR_SCHEME}:${DEFAULT_BRAND_ID}`,\n scheme: DEFAULT_COLOR_SCHEME,\n brandId: DEFAULT_BRAND_ID,\n scope: null,\n};\n\n// `useSyncExternalStore` re-renders forever on a snapshot whose reference changes\n// on every read, so the object is rebuilt only when the key it stands for moves.\nlet snapshot = DEFAULT_ATTRIBUTES;\n\nconst readThemeAttributes = (): ThemeAttributes => {\n if (typeof document === 'undefined') return DEFAULT_ATTRIBUTES;\n\n const root = document.documentElement;\n const theme = root.getAttribute(THEME_ATTRIBUTE);\n const scheme: ResolvedColorScheme =\n theme === 'dark' || theme === 'light' ? theme : DEFAULT_COLOR_SCHEME;\n const brandId = root.getAttribute(BRAND_ATTRIBUTE) ?? DEFAULT_BRAND_ID;\n const cacheKey = `${scheme}:${brandId}`;\n\n if (cacheKey !== snapshot.cacheKey) snapshot = { cacheKey, scheme, brandId, scope: null };\n\n return snapshot;\n};\n\nconst subscribe = (onChange: () => void): (() => void) => {\n if (typeof document === 'undefined') return () => {};\n\n const observer = new MutationObserver(onChange);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [THEME_ATTRIBUTE, BRAND_ATTRIBUTE],\n });\n\n return () => observer.disconnect();\n};\n\nconst getServerSnapshot = (): ThemeAttributes => DEFAULT_ATTRIBUTES;\n\n/**\n * The colour scheme and brand currently applied to `<html>`, plus a key that\n * changes whenever they do — for memoizing anything built from `resolveToken`.\n *\n * Read from the DOM rather than `useTheme()` on purpose: `ThemeProvider` writes\n * both attributes from passive effects, so during the render after a scheme\n * change the context already says `dark` while `<html>` — and therefore every\n * computed `--*` value — is still light. Keying off the attributes keeps the\n * values and the key that stands for them in lockstep, and works in a subtree\n * with no `ThemeProvider` above it.\n *\n * Returning `scheme` from the same read is what makes that safe by construction:\n * a caller cannot pick up the new key and the old scheme.\n *\n * Inside a `ThemeScope` the scope's scheme wins. `<html>` still carries the page's, but the\n * scope re-points the tokens for its own subtree, so a consumer that read the root would build\n * light values for a dark panel — a white chart on a dark card. Unlike the provider's, the\n * scope's attribute and vars are rendered in the same commit as the subtree, so context and\n * DOM cannot disagree here.\n */\nexport const useThemeAttributes = (): ThemeAttributes => {\n const root = useSyncExternalStore(subscribe, readThemeAttributes, getServerSnapshot);\n const scopedScheme = use(ThemeScopeSchemeContext);\n const scope = use(ThemeScopeContainerContext);\n\n // The reference is a memo key for callers, so it may only move when the values do.\n return useMemo(() => {\n if (scopedScheme === null && scope === null) return root;\n\n const scheme = scopedScheme ?? root.scheme;\n return {\n scheme,\n brandId: root.brandId,\n scope,\n cacheKey: `${scheme}:${root.brandId}${scope === null ? '' : ':scoped'}`,\n };\n }, [scopedScheme, scope, root]);\n};\n","/**\n * Live access to the semantic `--*` design tokens for consumers that cannot use\n * a Tailwind class — a CodeMirror theme object, a mermaid `themeVariables` map,\n * an SVG serialized for export. Those all need a concrete color string at build\n * time, so we resolve the value the browser currently computes for `<html>` and\n * hand the resulting `rgb(...)` to the library.\n *\n * SSR/no-document falls back to a literal; so does a token the stylesheet has\n * not defined (which is what unit tests see, since they load no CSS).\n */\nconst format = (channels: string, alpha?: number): string =>\n alpha === undefined ? `rgb(${channels})` : `rgb(${channels} / ${alpha})`;\n\nexport const resolveToken = (token: string, fallbackChannels: string, alpha?: number): string => {\n const channels =\n typeof document === 'undefined'\n ? fallbackChannels\n : getComputedStyle(document.documentElement).getPropertyValue(`--${token}`).trim() ||\n fallbackChannels;\n return format(channels, alpha);\n};\n\n/**\n * A {@link resolveToken} bound to a single `getComputedStyle` snapshot.\n *\n * Reach for this when building a whole palette at once: `resolveToken` reads the\n * computed style per call, so a config with dozens of token lookups forces dozens\n * of style resolutions for one render. Take a snapshot, read every token off it,\n * throw it away.\n *\n * Snapshot per palette build, never module-level — the values change whenever the\n * scheme or brand does, and a cached resolver would keep serving the old ones.\n *\n * {@link createChannelResolver} is the same snapshot answering the raw `\"R G B\"`\n * channels, for a consumer that needs another serialization.\n */\nexport const createChannelResolver = (from?: Element | null) => {\n // `from` is a node inside the subtree whose palette is wanted — a `ThemeScope` re-points the\n // tokens for its own subtree, so reading `<html>` there builds the page's palette instead.\n const element = from ?? (typeof document === 'undefined' ? null : document.documentElement);\n const computed = element === null ? null : getComputedStyle(element);\n\n return (token: string, fallbackChannels: string): string =>\n computed?.getPropertyValue(`--${token}`).trim() || fallbackChannels;\n};\n\nexport const createTokenResolver = (from?: Element | null) => {\n const resolve = createChannelResolver(from);\n\n return (token: string, fallbackChannels: string, alpha?: number): string =>\n format(resolve(token, fallbackChannels), alpha);\n};\n"],"mappings":";;;;AA0BA,MAAM,qBAAsC;CAC1C,UAAU,GAAG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F,MAAM,WACJ,OAAO,aAAa,cAChB,mBACA,iBAAiB,SAAS,eAAe,CAAC,CAAC,iBAAiB,KAAK,OAAO,CAAC,CAAC,KAAK,KAC/E;CACN,OAAO,OAAO,UAAU,KAAK;AAC/B;;;;;;;;;;;;;;;AAgBA,MAAa,yBAAyB,SAA0B;CAG9D,MAAM,UAAU,SAAS,OAAO,aAAa,cAAc,OAAO,SAAS;CAC3E,MAAM,WAAW,YAAY,OAAO,OAAO,iBAAiB,OAAO;CAEnE,QAAQ,OAAe,qBACrB,UAAU,iBAAiB,KAAK,OAAO,CAAC,CAAC,KAAK,KAAK;AACvD;AAEA,MAAa,uBAAuB,SAA0B;CAC5D,MAAM,UAAU,sBAAsB,IAAI;CAE1C,QAAQ,OAAe,kBAA0B,UAC/C,OAAO,QAAQ,OAAO,gBAAgB,GAAG,KAAK;AAClD"}
@@ -249,6 +249,10 @@ Tooltip.Trigger = TooltipTrigger;
249
249
  //#endregion
250
250
  //#region src/utils/decorators.tsx
251
251
  const withTooltipProvider = (Story) => /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(Story, {}) });
252
+ const withVisualSettle = (Story) => /* @__PURE__ */ jsx("div", {
253
+ "data-visual-settle": true,
254
+ children: /* @__PURE__ */ jsx(Story, {})
255
+ });
252
256
  const withHiddenFullscreen = (Story) => /* @__PURE__ */ jsx("div", {
253
257
  className: "tw:[&_[aria-label=Fullscreen]]:hidden",
254
258
  children: /* @__PURE__ */ jsx(Story, {})
@@ -303,6 +307,6 @@ const useSHA256 = (text) => {
303
307
  return text ? hash : "";
304
308
  };
305
309
  //#endregion
306
- export { Tooltip, TooltipProvider, copyToClipboard, createChangeInputEvent, createPrefixedString, debounce, isMac, keyCodes, noop, useSHA256, withHiddenFullscreen, withTooltipProvider };
310
+ export { Tooltip, TooltipProvider, copyToClipboard, createChangeInputEvent, createPrefixedString, debounce, isMac, keyCodes, noop, useSHA256, withHiddenFullscreen, withTooltipProvider, withVisualSettle };
307
311
 
308
- //# sourceMappingURL=utils-B5Z52hYs.js.map
312
+ //# sourceMappingURL=utils-DSvrhU8E.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-B5Z52hYs.js","names":["Root"],"sources":["../src/utils/copyToClipboard.ts","../src/utils/createChangeInputEvent.ts","../src/constants/keyCodes.ts","../src/components/Tooltip/TooltipContent.tsx","../src/components/Tooltip/TooltipRoot.tsx","../src/components/Tooltip/TooltipTrigger.tsx","../src/components/Tooltip/Tooltip.tsx","../src/utils/decorators.tsx","../src/utils/createPrefixedString.ts","../src/utils/noop.ts","../src/utils/debounce.ts","../src/utils/isMac.ts","../src/utils/useSHA256.ts"],"sourcesContent":["/**\n * The async Clipboard API requires the document to be focused and rejects with\n * `NotAllowedError: Document is not focused` otherwise — which is the normal state\n * for a page inside an iframe that has not taken focus, such as Storybook's canvas\n * or an embedded preview. `execCommand` has no such requirement because it copies\n * the selection of a node we focus ourselves, so it covers that gap.\n */\nconst copyViaSelection = (text: string) => {\n const node = document.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.cssText = 'position:fixed;top:0;left:0;opacity:0';\n document.body.append(node);\n node.select();\n\n try {\n return document.execCommand('copy');\n } finally {\n node.remove();\n }\n};\n\nexport const copyToClipboard = async (text: string) => {\n try {\n await navigator.clipboard.writeText(text);\n } catch (error) {\n if (!copyViaSelection(text)) throw error;\n }\n};\n","import type { ChangeEvent } from 'react';\n\nexport const createChangeInputEvent = (input: HTMLInputElement) => {\n const changeEvent: ChangeEvent<HTMLInputElement> = {\n target: input,\n currentTarget: input,\n type: 'change',\n nativeEvent: new Event('change', { bubbles: true }),\n bubbles: true,\n cancelable: false,\n defaultPrevented: false,\n eventPhase: 2, // AT_TARGET\n isTrusted: false, // Synthetic events are not trusted\n preventDefault: () => {}, // Provide dummy functions if not needed\n isDefaultPrevented: () => false,\n stopPropagation: () => {},\n isPropagationStopped: () => false,\n persist: () => {},\n timeStamp: Date.now(),\n };\n\n Object.defineProperty(changeEvent, 'target', {\n value: input,\n writable: false,\n });\n\n return changeEvent;\n};\n","export const keyCodes = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SPACE: ' ',\n};\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-tooltip';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nconst tooltipVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:inline-block',\n 'tw:break-anywhere',\n 'tw:max-h-96',\n 'tw:overflow-y-auto',\n 'tw:z-[1060]',\n\n // legacy (dark) chrome — default\n 'tw:rounded',\n 'tw:bg-neutral-800',\n 'tw:text-white',\n\n // argo chrome overrides — semantic floating-panel tokens\n 'tw:data-[argo=true]:rounded-2xl',\n 'tw:data-[argo=true]:border',\n 'tw:data-[argo=true]:border-solid',\n 'tw:data-[argo=true]:border-border',\n 'tw:data-[argo=true]:bg-popover',\n 'tw:data-[argo=true]:text-popover-foreground',\n 'tw:data-[argo=true]:shadow-md',\n\n // argo open animation\n 'tw:data-[argo=true]:data-[state=delayed-open]:animate-in',\n 'tw:data-[argo=true]:data-[state=instant-open]:animate-in',\n 'tw:data-[argo=true]:data-[state=delayed-open]:fade-in-0',\n 'tw:data-[argo=true]:data-[state=instant-open]:fade-in-0',\n 'tw:data-[argo=true]:data-[state=delayed-open]:zoom-in-95',\n 'tw:data-[argo=true]:data-[state=instant-open]:zoom-in-95',\n\n // argo closed animation\n 'tw:data-[argo=true]:data-[state=closed]:animate-out',\n 'tw:data-[argo=true]:data-[state=closed]:fade-out-0',\n 'tw:data-[argo=true]:data-[state=closed]:zoom-out-95',\n\n // argo position animation\n 'tw:data-[argo=true]:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[argo=true]:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[argo=true]:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[argo=true]:data-[side=top]:slide-in-from-bottom-2',\n ],\n {\n defaultVariants: {\n variant: 'action',\n },\n variants: {\n variant: {\n action: [\n 'tw:max-w-fit',\n 'tw:px-3',\n 'tw:py-2',\n\n 'tw:text-center',\n 'tw:text-xs',\n 'tw:font-medium',\n // Legacy chrome uppercases the action tooltip; the Keboola V2 brand\n // (`data-brand=\"keboola\"`) renders it in standard case instead.\n 'tw:uppercase',\n 'tw:tracking-wider',\n 'tw:[[data-brand=keboola]_&]:normal-case',\n 'tw:[[data-brand=keboola]_&]:tracking-normal',\n ],\n explanatory: [\n 'tw:max-w-80',\n 'tw:px-4',\n 'tw:py-3',\n 'tw:text-left',\n\n 'tw:text-sm',\n 'tw:font-normal',\n ],\n },\n },\n },\n);\n\ntype Props = {\n keepOpenOnPointerDownOutside?: boolean;\n placement?: ComponentProps<typeof Content>['side'];\n} & Omit<ComponentProps<typeof Content>, 'side'> &\n VariantProps<typeof tooltipVariants>;\n\nexport const TooltipContent = ({\n className,\n variant,\n keepOpenOnPointerDownOutside = false,\n children,\n onPointerDownOutside,\n sideOffset = 8,\n collisionPadding = 8,\n hideWhenDetached = true,\n placement = 'right',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handlePointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n return (\n <Portal>\n <Content\n {...rest}\n // Marks the dark (non-argo) tooltip chrome so styles.css can invert\n // nested `.tw\\:prose` for contrast.\n data-tooltip-content={renderArgo ? undefined : true}\n data-argo={renderArgo}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n onPointerDownOutside={handlePointerDownOutside}\n className={tooltipVariants({ className, variant })}\n hideWhenDetached={hideWhenDetached}\n side={placement}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-tooltip';\n\ntype Props = ComponentProps<typeof Root>;\n\nconst DELAY_SHOW_TOOLTIP = 300;\n\nexport const TooltipRoot = ({ children, delayDuration = DELAY_SHOW_TOOLTIP, ...rest }: Props) => (\n <Root {...rest} delayDuration={delayDuration}>\n {children}\n </Root>\n);\n","import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Trigger } from '@radix-ui/react-tooltip';\n\nimport { cn } from '../../utils';\n\n/**\n * Radix stamps the tooltip's own open/closed `data-state` onto the trigger. Merged onto an\n * `asChild` child that keeps a `data-state` of its own — `ToggleGroup.Item`, `Switch`, a `Tabs`\n * trigger — it wins, because those primitives spread incoming props *after* their own attribute.\n * The child then silently loses every `data-[state=…]` style it has, which is usually the only\n * thing marking it as selected.\n *\n * The tooltip's trigger state is styled nowhere, so it is dropped before it reaches the child.\n */\nconst WithoutTooltipState = ({\n children,\n ...props\n // `Slot`'s own props, plus the one attribute this exists to remove: React's types declare no\n // `data-*`, so it has to be named to be destructured away.\n}: ComponentProps<typeof Slot> & { 'data-state'?: string }) => {\n const { 'data-state': _tooltipState, ...rest } = props;\n\n return <Slot {...rest}>{children}</Slot>;\n};\n\ntype Props = {\n keepOpenOnClick?: boolean;\n} & ComponentProps<typeof Trigger>;\n\nexport const TooltipTrigger = ({\n ref,\n children,\n className,\n keepOpenOnClick = false,\n onClick,\n onPointerDown,\n asChild,\n ...rest\n}: Props) => {\n const handleClick: ComponentProps<typeof Trigger>['onClick'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onClick?.(event);\n };\n\n const handlePointerDown: ComponentProps<typeof Trigger>['onPointerDown'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onPointerDown?.(event);\n };\n\n return (\n <Trigger\n {...rest}\n asChild\n ref={ref}\n className={cn('tailwindcss-preflight', className)}\n onClick={handleClick}\n onPointerDown={handlePointerDown}\n >\n {asChild ? (\n <WithoutTooltipState>{children}</WithoutTooltipState>\n ) : (\n // Default-mode trigger wraps children in a span so Radix has a\n // single DOM element to attach handlers to. `tailwindcss-preflight`\n // (merged in via Slot) activates Tailwind's preflight inside the\n // span, which sets `svg { display: block }` — without an inline-flex\n // container that would stack any bare Lucide icon onto its own\n // line. `tw:inline-flex tw:items-center` keeps icon + text aligned.\n <span className=\"tw:inline-flex tw:items-center\">{children}</span>\n )}\n </Trigger>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { Content, Trigger } from '@radix-ui/react-tooltip';\nimport { Provider } from '@radix-ui/react-tooltip';\n\nimport { keyCodes } from '../../constants/keyCodes';\n\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipRoot } from './TooltipRoot';\nimport { TooltipTrigger } from './TooltipTrigger';\n\nconst ACTION_TOOLTIP_LIMIT = 30;\n\ntype TriggerProps = {\n triggerAsChild?: boolean;\n};\n\n/**\n * Props for `Tooltip`. `tooltip` is the popup content; `children` is the trigger element.\n * `variant` auto-resolves to `\"explanatory\"` for strings >30 chars, else `\"action\"`.\n */\nexport type Props = {\n /** Keep the tooltip visible when the user clicks the trigger (useful for click-to-copy feedback). */\n keepOpenOnTriggerClick?: boolean;\n /** Content rendered inside the tooltip. Plain text only — no interactive elements (use `HoverCard` or `Popover` for that). */\n tooltip: ReactNode;\n children: ReactNode;\n placement?: ComponentProps<typeof Content>['side'];\n /** Forcibly hide the tooltip regardless of hover state. */\n forceHide?: boolean;\n /** Forcibly show the tooltip regardless of hover state. Useful for guided-tour overlays. */\n forceShow?: boolean;\n /** Hover delay before the tooltip opens, in ms. Defaults to the shared 300ms. */\n delayDuration?: number;\n className?: string;\n} & TriggerProps &\n Pick<ComponentProps<typeof TooltipContent>, 'variant' | 'className'>;\n\n/** Re-export of Radix `Tooltip.Provider`. Mount once at the app root so tooltips share delay state. */\nexport const TooltipProvider = Provider;\n\n/**\n * Short plain-text label that appears on hover or focus.\n *\n * **When to use:** describing an icon-only `Button`, explaining a disabled control, or labelling a\n * truncated value. Plain text only — auto-switches to the longer `\"explanatory\"` variant when the string\n * exceeds 30 characters.\n * **When NOT to use:** for rich preview content (multiple lines, formatted text, structured data) use\n * `HoverCard`; for tooltips containing links or buttons use `Popover` (interactive elements break a11y\n * inside a `Tooltip`).\n * **Composition:** wrap any focusable element via `triggerAsChild` so the tooltip targets the underlying\n * native element. Mount `TooltipProvider` once at the app root.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n */\nexport const Tooltip = ({\n tooltip,\n children,\n className,\n keepOpenOnTriggerClick = false,\n variant,\n placement = 'right',\n forceHide = false,\n forceShow = false,\n delayDuration,\n // trigger props\n triggerAsChild = false,\n}: Props) => {\n const [open, setOpen] = useState(false);\n\n const resolvedVariant = (() => {\n if (!!variant) return variant;\n if (typeof tooltip === 'string' && tooltip.length > ACTION_TOOLTIP_LIMIT) return 'explanatory';\n\n return 'action';\n })();\n\n const isActionVariant = resolvedVariant === 'action';\n\n const handleKeyUp: ComponentProps<typeof Trigger>['onKeyUp'] = (event) => {\n if (![keyCodes.ENTER, keyCodes.SPACE].includes(event.key)) return;\n event.stopPropagation();\n };\n\n return (\n <TooltipRoot\n open={!!tooltip && (open || forceShow) && !forceHide}\n onOpenChange={setOpen}\n delayDuration={delayDuration}\n disableHoverableContent={isActionVariant}\n >\n <TooltipTrigger\n asChild={triggerAsChild}\n keepOpenOnClick={keepOpenOnTriggerClick}\n onKeyUp={handleKeyUp}\n >\n {children}\n </TooltipTrigger>\n\n <TooltipContent\n className={className}\n variant={resolvedVariant}\n placement={placement}\n keepOpenOnPointerDownOutside={keepOpenOnTriggerClick}\n >\n {tooltip}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nTooltip.Root = TooltipRoot;\nTooltip.Content = TooltipContent;\nTooltip.Trigger = TooltipTrigger;\n","import type { ComponentType } from 'react';\n\nimport { TooltipProvider } from '../components/Tooltip';\n\nexport const withTooltipProvider = (Story: ComponentType) => (\n <TooltipProvider>\n <Story />\n </TooltipProvider>\n);\n\n// position:fixed only fills the Storybook iframe, not the browser window.\nexport const withHiddenFullscreen = (Story: ComponentType) => (\n <div className=\"tw:[&_[aria-label=Fullscreen]]:hidden\">\n <Story />\n </div>\n);\n","export const createPrefixedString = (prefix: string) => (literals: TemplateStringsArray) =>\n literals.reduce((acc, literal) => acc + literal, `${prefix}-`);\n","export const noop = () => void 0;\n","type DebouncedFn<T extends (...args: any[]) => void> = {\n (...args: Parameters<T>): void;\n cancel: () => void;\n};\n\nexport const debounce = <T extends (...args: any[]) => void>(\n fn: T,\n delay: number,\n): DebouncedFn<T> => {\n let timeoutId: ReturnType<typeof setTimeout>;\n const debounced = (...args: Parameters<T>) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn(...args), delay);\n };\n debounced.cancel = () => clearTimeout(timeoutId);\n return debounced;\n};\n","// Platform detection\ntype NavigatorUAData = {\n platform: string;\n brands: { brand: string; version: string }[];\n mobile: boolean;\n};\n\nconst getIsMac = (): boolean => {\n // Modern approach using navigator.userAgentData\n if (typeof navigator !== 'undefined' && 'userAgentData' in navigator) {\n const platform = (navigator.userAgentData as NavigatorUAData).platform;\n\n if (typeof platform === 'string') {\n return platform.toLowerCase() === 'macos';\n }\n }\n\n if (typeof navigator !== 'undefined' && typeof navigator.platform === 'string') {\n return navigator.platform.toUpperCase().indexOf('MAC') >= 0;\n }\n\n // Server-side rendering fallback\n return false;\n};\n\nexport const isMac = getIsMac();\n","import { useEffect, useState } from 'react';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#converting_a_digest_to_a_hex_string\nconst sha256 = async (text: string) => {\n const msgUint8 = new TextEncoder().encode(text);\n const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n};\n\nexport const useSHA256 = (text?: string) => {\n const [hash, setHash] = useState('');\n\n useEffect(() => {\n if (!text) return;\n let cancelled = false;\n sha256(text).then((h) => {\n if (!cancelled) setHash(h);\n });\n return () => {\n cancelled = true;\n };\n }, [text]);\n\n // Empty input has no hash — derive it during render instead of syncing state\n // in the effect (avoids the extra render and a stale-value frame).\n return text ? hash : '';\n};\n"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,SAAiB;CACzC,MAAM,OAAO,SAAS,cAAc,UAAU;CAC9C,KAAK,QAAQ;CACb,KAAK,aAAa,YAAY,EAAE;CAChC,KAAK,MAAM,UAAU;CACrB,SAAS,KAAK,OAAO,IAAI;CACzB,KAAK,OAAO;CAEZ,IAAI;EACF,OAAO,SAAS,YAAY,MAAM;CACpC,UAAU;EACR,KAAK,OAAO;CACd;AACF;AAEA,MAAa,kBAAkB,OAAO,SAAiB;CACrD,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,IAAI;CAC1C,SAAS,OAAO;EACd,IAAI,CAAC,iBAAiB,IAAI,GAAG,MAAM;CACrC;AACF;;;AC1BA,MAAa,0BAA0B,UAA4B;CACjE,MAAM,cAA6C;EACjD,QAAQ;EACR,eAAe;EACf,MAAM;EACN,aAAa,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC;EAClD,SAAS;EACT,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,sBAAsB,CAAC;EACvB,0BAA0B;EAC1B,uBAAuB,CAAC;EACxB,4BAA4B;EAC5B,eAAe,CAAC;EAChB,WAAW,KAAK,IAAI;CACtB;CAEA,OAAO,eAAe,aAAa,UAAU;EAC3C,OAAO;EACP,UAAU;CACZ,CAAC;CAED,OAAO;AACT;;;AC3BA,MAAa,WAAW;CACtB,OAAO;CACP,QAAQ;CACR,OAAO;AACT;;;ACGA,MAAM,kBAAkB,IACtB;CACE;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,SACX;CACA,UAAU,EACR,SAAS;EACP,QAAQ;GACN;GACA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js","names":["Root"],"sources":["../src/utils/copyToClipboard.ts","../src/utils/createChangeInputEvent.ts","../src/constants/keyCodes.ts","../src/components/Tooltip/TooltipContent.tsx","../src/components/Tooltip/TooltipRoot.tsx","../src/components/Tooltip/TooltipTrigger.tsx","../src/components/Tooltip/Tooltip.tsx","../src/utils/decorators.tsx","../src/utils/createPrefixedString.ts","../src/utils/noop.ts","../src/utils/debounce.ts","../src/utils/isMac.ts","../src/utils/useSHA256.ts"],"sourcesContent":["/**\n * The async Clipboard API requires the document to be focused and rejects with\n * `NotAllowedError: Document is not focused` otherwise — which is the normal state\n * for a page inside an iframe that has not taken focus, such as Storybook's canvas\n * or an embedded preview. `execCommand` has no such requirement because it copies\n * the selection of a node we focus ourselves, so it covers that gap.\n */\nconst copyViaSelection = (text: string) => {\n const node = document.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.cssText = 'position:fixed;top:0;left:0;opacity:0';\n document.body.append(node);\n node.select();\n\n try {\n return document.execCommand('copy');\n } finally {\n node.remove();\n }\n};\n\nexport const copyToClipboard = async (text: string) => {\n try {\n await navigator.clipboard.writeText(text);\n } catch (error) {\n if (!copyViaSelection(text)) throw error;\n }\n};\n","import type { ChangeEvent } from 'react';\n\nexport const createChangeInputEvent = (input: HTMLInputElement) => {\n const changeEvent: ChangeEvent<HTMLInputElement> = {\n target: input,\n currentTarget: input,\n type: 'change',\n nativeEvent: new Event('change', { bubbles: true }),\n bubbles: true,\n cancelable: false,\n defaultPrevented: false,\n eventPhase: 2, // AT_TARGET\n isTrusted: false, // Synthetic events are not trusted\n preventDefault: () => {}, // Provide dummy functions if not needed\n isDefaultPrevented: () => false,\n stopPropagation: () => {},\n isPropagationStopped: () => false,\n persist: () => {},\n timeStamp: Date.now(),\n };\n\n Object.defineProperty(changeEvent, 'target', {\n value: input,\n writable: false,\n });\n\n return changeEvent;\n};\n","export const keyCodes = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SPACE: ' ',\n};\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-tooltip';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nconst tooltipVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:inline-block',\n 'tw:break-anywhere',\n 'tw:max-h-96',\n 'tw:overflow-y-auto',\n 'tw:z-[1060]',\n\n // legacy (dark) chrome — default\n 'tw:rounded',\n 'tw:bg-neutral-800',\n 'tw:text-white',\n\n // argo chrome overrides — semantic floating-panel tokens\n 'tw:data-[argo=true]:rounded-2xl',\n 'tw:data-[argo=true]:border',\n 'tw:data-[argo=true]:border-solid',\n 'tw:data-[argo=true]:border-border',\n 'tw:data-[argo=true]:bg-popover',\n 'tw:data-[argo=true]:text-popover-foreground',\n 'tw:data-[argo=true]:shadow-md',\n\n // argo open animation\n 'tw:data-[argo=true]:data-[state=delayed-open]:animate-in',\n 'tw:data-[argo=true]:data-[state=instant-open]:animate-in',\n 'tw:data-[argo=true]:data-[state=delayed-open]:fade-in-0',\n 'tw:data-[argo=true]:data-[state=instant-open]:fade-in-0',\n 'tw:data-[argo=true]:data-[state=delayed-open]:zoom-in-95',\n 'tw:data-[argo=true]:data-[state=instant-open]:zoom-in-95',\n\n // argo closed animation\n 'tw:data-[argo=true]:data-[state=closed]:animate-out',\n 'tw:data-[argo=true]:data-[state=closed]:fade-out-0',\n 'tw:data-[argo=true]:data-[state=closed]:zoom-out-95',\n\n // argo position animation\n 'tw:data-[argo=true]:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[argo=true]:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[argo=true]:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[argo=true]:data-[side=top]:slide-in-from-bottom-2',\n ],\n {\n defaultVariants: {\n variant: 'action',\n },\n variants: {\n variant: {\n action: [\n 'tw:max-w-fit',\n 'tw:px-3',\n 'tw:py-2',\n\n 'tw:text-center',\n 'tw:text-xs',\n 'tw:font-medium',\n // Legacy chrome uppercases the action tooltip; the Keboola V2 brand\n // (`data-brand=\"keboola\"`) renders it in standard case instead.\n 'tw:uppercase',\n 'tw:tracking-wider',\n 'tw:[[data-brand=keboola]_&]:normal-case',\n 'tw:[[data-brand=keboola]_&]:tracking-normal',\n ],\n explanatory: [\n 'tw:max-w-80',\n 'tw:px-4',\n 'tw:py-3',\n 'tw:text-left',\n\n 'tw:text-sm',\n 'tw:font-normal',\n ],\n },\n },\n },\n);\n\ntype Props = {\n keepOpenOnPointerDownOutside?: boolean;\n placement?: ComponentProps<typeof Content>['side'];\n} & Omit<ComponentProps<typeof Content>, 'side'> &\n VariantProps<typeof tooltipVariants>;\n\nexport const TooltipContent = ({\n className,\n variant,\n keepOpenOnPointerDownOutside = false,\n children,\n onPointerDownOutside,\n sideOffset = 8,\n collisionPadding = 8,\n hideWhenDetached = true,\n placement = 'right',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handlePointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n return (\n <Portal>\n <Content\n {...rest}\n // Marks the dark (non-argo) tooltip chrome so styles.css can invert\n // nested `.tw\\:prose` for contrast.\n data-tooltip-content={renderArgo ? undefined : true}\n data-argo={renderArgo}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n onPointerDownOutside={handlePointerDownOutside}\n className={tooltipVariants({ className, variant })}\n hideWhenDetached={hideWhenDetached}\n side={placement}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-tooltip';\n\ntype Props = ComponentProps<typeof Root>;\n\nconst DELAY_SHOW_TOOLTIP = 300;\n\nexport const TooltipRoot = ({ children, delayDuration = DELAY_SHOW_TOOLTIP, ...rest }: Props) => (\n <Root {...rest} delayDuration={delayDuration}>\n {children}\n </Root>\n);\n","import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { Trigger } from '@radix-ui/react-tooltip';\n\nimport { cn } from '../../utils';\n\n/**\n * Radix stamps the tooltip's own open/closed `data-state` onto the trigger. Merged onto an\n * `asChild` child that keeps a `data-state` of its own — `ToggleGroup.Item`, `Switch`, a `Tabs`\n * trigger — it wins, because those primitives spread incoming props *after* their own attribute.\n * The child then silently loses every `data-[state=…]` style it has, which is usually the only\n * thing marking it as selected.\n *\n * The tooltip's trigger state is styled nowhere, so it is dropped before it reaches the child.\n */\nconst WithoutTooltipState = ({\n children,\n ...props\n // `Slot`'s own props, plus the one attribute this exists to remove: React's types declare no\n // `data-*`, so it has to be named to be destructured away.\n}: ComponentProps<typeof Slot> & { 'data-state'?: string }) => {\n const { 'data-state': _tooltipState, ...rest } = props;\n\n return <Slot {...rest}>{children}</Slot>;\n};\n\ntype Props = {\n keepOpenOnClick?: boolean;\n} & ComponentProps<typeof Trigger>;\n\nexport const TooltipTrigger = ({\n ref,\n children,\n className,\n keepOpenOnClick = false,\n onClick,\n onPointerDown,\n asChild,\n ...rest\n}: Props) => {\n const handleClick: ComponentProps<typeof Trigger>['onClick'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onClick?.(event);\n };\n\n const handlePointerDown: ComponentProps<typeof Trigger>['onPointerDown'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onPointerDown?.(event);\n };\n\n return (\n <Trigger\n {...rest}\n asChild\n ref={ref}\n className={cn('tailwindcss-preflight', className)}\n onClick={handleClick}\n onPointerDown={handlePointerDown}\n >\n {asChild ? (\n <WithoutTooltipState>{children}</WithoutTooltipState>\n ) : (\n // Default-mode trigger wraps children in a span so Radix has a\n // single DOM element to attach handlers to. `tailwindcss-preflight`\n // (merged in via Slot) activates Tailwind's preflight inside the\n // span, which sets `svg { display: block }` — without an inline-flex\n // container that would stack any bare Lucide icon onto its own\n // line. `tw:inline-flex tw:items-center` keeps icon + text aligned.\n <span className=\"tw:inline-flex tw:items-center\">{children}</span>\n )}\n </Trigger>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { Content, Trigger } from '@radix-ui/react-tooltip';\nimport { Provider } from '@radix-ui/react-tooltip';\n\nimport { keyCodes } from '../../constants/keyCodes';\n\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipRoot } from './TooltipRoot';\nimport { TooltipTrigger } from './TooltipTrigger';\n\nconst ACTION_TOOLTIP_LIMIT = 30;\n\ntype TriggerProps = {\n triggerAsChild?: boolean;\n};\n\n/**\n * Props for `Tooltip`. `tooltip` is the popup content; `children` is the trigger element.\n * `variant` auto-resolves to `\"explanatory\"` for strings >30 chars, else `\"action\"`.\n */\nexport type Props = {\n /** Keep the tooltip visible when the user clicks the trigger (useful for click-to-copy feedback). */\n keepOpenOnTriggerClick?: boolean;\n /** Content rendered inside the tooltip. Plain text only — no interactive elements (use `HoverCard` or `Popover` for that). */\n tooltip: ReactNode;\n children: ReactNode;\n placement?: ComponentProps<typeof Content>['side'];\n /** Forcibly hide the tooltip regardless of hover state. */\n forceHide?: boolean;\n /** Forcibly show the tooltip regardless of hover state. Useful for guided-tour overlays. */\n forceShow?: boolean;\n /** Hover delay before the tooltip opens, in ms. Defaults to the shared 300ms. */\n delayDuration?: number;\n className?: string;\n} & TriggerProps &\n Pick<ComponentProps<typeof TooltipContent>, 'variant' | 'className'>;\n\n/** Re-export of Radix `Tooltip.Provider`. Mount once at the app root so tooltips share delay state. */\nexport const TooltipProvider = Provider;\n\n/**\n * Short plain-text label that appears on hover or focus.\n *\n * **When to use:** describing an icon-only `Button`, explaining a disabled control, or labelling a\n * truncated value. Plain text only — auto-switches to the longer `\"explanatory\"` variant when the string\n * exceeds 30 characters.\n * **When NOT to use:** for rich preview content (multiple lines, formatted text, structured data) use\n * `HoverCard`; for tooltips containing links or buttons use `Popover` (interactive elements break a11y\n * inside a `Tooltip`).\n * **Composition:** wrap any focusable element via `triggerAsChild` so the tooltip targets the underlying\n * native element. Mount `TooltipProvider` once at the app root.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n */\nexport const Tooltip = ({\n tooltip,\n children,\n className,\n keepOpenOnTriggerClick = false,\n variant,\n placement = 'right',\n forceHide = false,\n forceShow = false,\n delayDuration,\n // trigger props\n triggerAsChild = false,\n}: Props) => {\n const [open, setOpen] = useState(false);\n\n const resolvedVariant = (() => {\n if (!!variant) return variant;\n if (typeof tooltip === 'string' && tooltip.length > ACTION_TOOLTIP_LIMIT) return 'explanatory';\n\n return 'action';\n })();\n\n const isActionVariant = resolvedVariant === 'action';\n\n const handleKeyUp: ComponentProps<typeof Trigger>['onKeyUp'] = (event) => {\n if (![keyCodes.ENTER, keyCodes.SPACE].includes(event.key)) return;\n event.stopPropagation();\n };\n\n return (\n <TooltipRoot\n open={!!tooltip && (open || forceShow) && !forceHide}\n onOpenChange={setOpen}\n delayDuration={delayDuration}\n disableHoverableContent={isActionVariant}\n >\n <TooltipTrigger\n asChild={triggerAsChild}\n keepOpenOnClick={keepOpenOnTriggerClick}\n onKeyUp={handleKeyUp}\n >\n {children}\n </TooltipTrigger>\n\n <TooltipContent\n className={className}\n variant={resolvedVariant}\n placement={placement}\n keepOpenOnPointerDownOutside={keepOpenOnTriggerClick}\n >\n {tooltip}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nTooltip.Root = TooltipRoot;\nTooltip.Content = TooltipContent;\nTooltip.Trigger = TooltipTrigger;\n","import type { ComponentType } from 'react';\n\nimport { TooltipProvider } from '../components/Tooltip';\n\nexport const withTooltipProvider = (Story: ComponentType) => (\n <TooltipProvider>\n <Story />\n </TooltipProvider>\n);\n\n// Marks a story whose final render arrives asynchronously (lazy chunk, debounced\n// parse). The visual suite waits for every `[data-skeleton]` inside this box to\n// unmount before capturing, so the baseline is the settled content, never the\n// placeholder it briefly shows.\nexport const withVisualSettle = (Story: ComponentType) => (\n <div data-visual-settle>\n <Story />\n </div>\n);\n\n// position:fixed only fills the Storybook iframe, not the browser window.\nexport const withHiddenFullscreen = (Story: ComponentType) => (\n <div className=\"tw:[&_[aria-label=Fullscreen]]:hidden\">\n <Story />\n </div>\n);\n","export const createPrefixedString = (prefix: string) => (literals: TemplateStringsArray) =>\n literals.reduce((acc, literal) => acc + literal, `${prefix}-`);\n","export const noop = () => void 0;\n","type DebouncedFn<T extends (...args: any[]) => void> = {\n (...args: Parameters<T>): void;\n cancel: () => void;\n};\n\nexport const debounce = <T extends (...args: any[]) => void>(\n fn: T,\n delay: number,\n): DebouncedFn<T> => {\n let timeoutId: ReturnType<typeof setTimeout>;\n const debounced = (...args: Parameters<T>) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn(...args), delay);\n };\n debounced.cancel = () => clearTimeout(timeoutId);\n return debounced;\n};\n","// Platform detection\ntype NavigatorUAData = {\n platform: string;\n brands: { brand: string; version: string }[];\n mobile: boolean;\n};\n\nconst getIsMac = (): boolean => {\n // Modern approach using navigator.userAgentData\n if (typeof navigator !== 'undefined' && 'userAgentData' in navigator) {\n const platform = (navigator.userAgentData as NavigatorUAData).platform;\n\n if (typeof platform === 'string') {\n return platform.toLowerCase() === 'macos';\n }\n }\n\n if (typeof navigator !== 'undefined' && typeof navigator.platform === 'string') {\n return navigator.platform.toUpperCase().indexOf('MAC') >= 0;\n }\n\n // Server-side rendering fallback\n return false;\n};\n\nexport const isMac = getIsMac();\n","import { useEffect, useState } from 'react';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#converting_a_digest_to_a_hex_string\nconst sha256 = async (text: string) => {\n const msgUint8 = new TextEncoder().encode(text);\n const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n};\n\nexport const useSHA256 = (text?: string) => {\n const [hash, setHash] = useState('');\n\n useEffect(() => {\n if (!text) return;\n let cancelled = false;\n sha256(text).then((h) => {\n if (!cancelled) setHash(h);\n });\n return () => {\n cancelled = true;\n };\n }, [text]);\n\n // Empty input has no hash — derive it during render instead of syncing state\n // in the effect (avoids the extra render and a stale-value frame).\n return text ? hash : '';\n};\n"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,SAAiB;CACzC,MAAM,OAAO,SAAS,cAAc,UAAU;CAC9C,KAAK,QAAQ;CACb,KAAK,aAAa,YAAY,EAAE;CAChC,KAAK,MAAM,UAAU;CACrB,SAAS,KAAK,OAAO,IAAI;CACzB,KAAK,OAAO;CAEZ,IAAI;EACF,OAAO,SAAS,YAAY,MAAM;CACpC,UAAU;EACR,KAAK,OAAO;CACd;AACF;AAEA,MAAa,kBAAkB,OAAO,SAAiB;CACrD,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,IAAI;CAC1C,SAAS,OAAO;EACd,IAAI,CAAC,iBAAiB,IAAI,GAAG,MAAM;CACrC;AACF;;;AC1BA,MAAa,0BAA0B,UAA4B;CACjE,MAAM,cAA6C;EACjD,QAAQ;EACR,eAAe;EACf,MAAM;EACN,aAAa,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC;EAClD,SAAS;EACT,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,sBAAsB,CAAC;EACvB,0BAA0B;EAC1B,uBAAuB,CAAC;EACxB,4BAA4B;EAC5B,eAAe,CAAC;EAChB,WAAW,KAAK,IAAI;CACtB;CAEA,OAAO,eAAe,aAAa,UAAU;EAC3C,OAAO;EACP,UAAU;CACZ,CAAC;CAED,OAAO;AACT;;;AC3BA,MAAa,WAAW;CACtB,OAAO;CACP,QAAQ;CACR,OAAO;AACT;;;ACGA,MAAM,kBAAkB,IACtB;CACE;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAi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,IAAI,CAAC,WAAW,QAAQ,CAAC;EAC3B,CAAC;EACD,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,IAAI,CAAC;CAIT,OAAO,OAAO,OAAO;AACvB"}
package/dist/vega.d.ts CHANGED
@@ -40,7 +40,7 @@ declare const useVegaTheme: () => Config;
40
40
  * stylesheet. Rebuild the config when the scheme or brand changes —
41
41
  * `useVegaTheme` does that for you.
42
42
  */
43
- declare const vegaTheme: (scheme: ResolvedColorScheme) => Config;
43
+ declare const vegaTheme: (scheme: ResolvedColorScheme, from?: Element | null) => Config;
44
44
  //#endregion
45
45
  export { useVegaTheme, vegaTheme };
46
46
  //# sourceMappingURL=vega.d.ts.map
package/dist/vega.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useThemeAttributes } from "./themeTokens-D70HeNVF.js";
2
- import { vegaTheme } from "./vegaTheme-DfoEQhOy.js";
1
+ import { useThemeAttributes } from "./themeTokens-qP1-55O7.js";
2
+ import { vegaTheme } from "./vegaTheme-CSvFEMBl.js";
3
3
  import { useMemo } from "react";
4
4
  //#region src/vega/useVegaTheme.ts
5
5
  /**
@@ -18,7 +18,7 @@ import { useMemo } from "react";
18
18
  */
19
19
  const useVegaTheme = () => {
20
20
  const theme = useThemeAttributes();
21
- return useMemo(() => vegaTheme(theme.scheme), [theme]);
21
+ return useMemo(() => vegaTheme(theme.scheme, theme.scope), [theme]);
22
22
  };
23
23
  //#endregion
24
24
  export { useVegaTheme, vegaTheme };
package/dist/vega.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vega.js","names":[],"sources":["../src/vega/useVegaTheme.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Config } from 'vega-lite';\n\nimport { useThemeAttributes } from '../components/ThemeProvider/useThemeAttributes';\n\nimport { vegaTheme } from './vegaTheme';\n\n/**\n * {@link vegaTheme} for the scheme and brand currently painted on `<html>`,\n * rebuilt whenever either changes.\n *\n * - The config holds resolved colour strings, not `var()` references, so a\n * mounted chart would otherwise keep the palette it was first built with.\n * - The `useThemeAttributes` snapshot is the memo key: its reference moves on a\n * scheme or brand switch and stands still otherwise, and `scheme` comes out of\n * the same read, so the colours can never be resolved under one scheme and\n * memoized under the other.\n * - Re-rendering is not enough on its own — a consumer that compiles a spec in\n * an effect must depend on this config (or on `useThemeAttributes().cacheKey`)\n * and re-render the chart.\n */\nexport const useVegaTheme = (): Config => {\n const theme = useThemeAttributes();\n\n // The whole snapshot is the memo key, not `theme.scheme`: its reference moves\n // when the scheme *or* the brand does, and a brand switch repaints every\n // `--*` value while leaving the scheme alone.\n return useMemo(() => vegaTheme(theme.scheme), [theme]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAa,qBAA6B;CACxC,MAAM,QAAQ,mBAAmB;CAKjC,OAAO,cAAc,UAAU,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC;AACvD"}
1
+ {"version":3,"file":"vega.js","names":[],"sources":["../src/vega/useVegaTheme.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Config } from 'vega-lite';\n\nimport { useThemeAttributes } from '../components/ThemeProvider/useThemeAttributes';\n\nimport { vegaTheme } from './vegaTheme';\n\n/**\n * {@link vegaTheme} for the scheme and brand currently painted on `<html>`,\n * rebuilt whenever either changes.\n *\n * - The config holds resolved colour strings, not `var()` references, so a\n * mounted chart would otherwise keep the palette it was first built with.\n * - The `useThemeAttributes` snapshot is the memo key: its reference moves on a\n * scheme or brand switch and stands still otherwise, and `scheme` comes out of\n * the same read, so the colours can never be resolved under one scheme and\n * memoized under the other.\n * - Re-rendering is not enough on its own — a consumer that compiles a spec in\n * an effect must depend on this config (or on `useThemeAttributes().cacheKey`)\n * and re-render the chart.\n */\nexport const useVegaTheme = (): Config => {\n const theme = useThemeAttributes();\n\n // The whole snapshot is the memo key, not `theme.scheme`: its reference moves\n // when the scheme *or* the brand does, and a brand switch repaints every\n // `--*` value while leaving the scheme alone.\n return useMemo(() => vegaTheme(theme.scheme, theme.scope), [theme]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAa,qBAA6B;CACxC,MAAM,QAAQ,mBAAmB;CAKjC,OAAO,cAAc,UAAU,MAAM,QAAQ,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC;AACpE"}
@@ -1,4 +1,4 @@
1
- import { createChannelResolver } from "./themeTokens-D70HeNVF.js";
1
+ import { createChannelResolver } from "./themeTokens-qP1-55O7.js";
2
2
  //#region src/vega/vegaTokens.ts
3
3
  /**
4
4
  * Serializes `"R G B"` channels comma-separated, the only form vega parses.
@@ -77,8 +77,8 @@ const FALLBACK_CHANNELS = {
77
77
  * - Build one per palette, never at module level: the values change whenever
78
78
  * the scheme or the brand does.
79
79
  */
80
- const createVegaColorResolver = (scheme) => {
81
- const resolve = createChannelResolver();
80
+ const createVegaColorResolver = (scheme, from) => {
81
+ const resolve = createChannelResolver(from);
82
82
  return (token, alpha) => vegaRgb(resolve(token, FALLBACK_CHANNELS[token][scheme]), alpha);
83
83
  };
84
84
  //#endregion
@@ -106,8 +106,8 @@ const CHART_FONT = "Inter, system-ui, sans-serif";
106
106
  * stylesheet. Rebuild the config when the scheme or brand changes —
107
107
  * `useVegaTheme` does that for you.
108
108
  */
109
- const vegaTheme = (scheme) => {
110
- const token = createVegaColorResolver(scheme);
109
+ const vegaTheme = (scheme, from) => {
110
+ const token = createVegaColorResolver(scheme, from);
111
111
  const label = token("muted-foreground");
112
112
  const heading = token("foreground");
113
113
  const line = token("border");
@@ -143,4 +143,4 @@ const vegaTheme = (scheme) => {
143
143
  //#endregion
144
144
  export { SERIES_TOKENS, createVegaColorResolver, vegaRgb, vegaTheme };
145
145
 
146
- //# sourceMappingURL=vegaTheme-DfoEQhOy.js.map
146
+ //# sourceMappingURL=vegaTheme-CSvFEMBl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vegaTheme-CSvFEMBl.js","names":[],"sources":["../src/vega/vegaTokens.ts","../src/vega/vegaTheme.ts"],"sourcesContent":["import type { ResolvedColorScheme } from '../components/ThemeProvider/types';\nimport { createChannelResolver } from '../utils/themeTokens';\n\n/**\n * Serializes `\"R G B\"` channels comma-separated, the only form vega parses.\n *\n * - vega reads colours through d3-color 3.1, which answers `null` for the\n * space-separated CSS Color 4 form the rest of the package emits.\n * - A flat fill survives that anyway — the string reaches the SVG attribute and\n * the browser parses it. An interpolated one does not: both endpoints of a\n * sequential ramp collapse, and a quantitative scale paints solid black.\n */\nexport const vegaRgb = (channels: string, alpha?: number): string => {\n const c = channels.split(/\\s+/).join(', ');\n return alpha === undefined ? `rgb(${c})` : `rgba(${c}, ${alpha})`;\n};\n\n/** The `--chart-*` slots, in series order. */\nexport const SERIES_TOKENS = ['chart-1', 'chart-2', 'chart-3', 'chart-4', 'chart-5'] as const;\n\n/**\n * Fallback channels for the tokens a vega chart reads, mirroring the `:root` /\n * `[data-theme='dark']` blocks of `styles.css`. The resolver reaches these only\n * when the live custom property is missing — SSR, or a unit test that loads no\n * CSS.\n */\nconst FALLBACK_CHANNELS = {\n foreground: { light: '30 41 59', dark: '229 230 236' },\n 'muted-foreground': { light: '100 116 139', dark: '141 144 153' },\n border: { light: '229 231 235', dark: '52 53 62' },\n 'chart-1': { light: '31 143 255', dark: '92 173 255' },\n 'chart-2': { light: '0 194 135', dark: '0 230 161' },\n 'chart-3': { light: '146 92 255', dark: '173 133 255' },\n 'chart-4': { light: '245 147 0', dark: '255 190 92' },\n 'chart-5': { light: '237 94 223', dark: '242 140 232' },\n // The sequential ramp's low end and the surface it must stay legible against.\n accent: { light: '224 242 254', dark: '30 58 95' },\n card: { light: '255 255 255', dark: '34 34 40' },\n} as const;\n\nexport type VegaTokenName = keyof typeof FALLBACK_CHANNELS;\n\n/**\n * A vega-serializing token resolver bound to one `getComputedStyle` snapshot.\n *\n * - Answers `rgb(R, G, B)` / `rgba(R, G, B, a)` — see {@link vegaRgb}.\n * - Falls back per scheme when the custom property is not painted.\n * - Build one per palette, never at module level: the values change whenever\n * the scheme or the brand does.\n */\nexport const createVegaColorResolver = (scheme: ResolvedColorScheme, from?: Element | null) => {\n const resolve = createChannelResolver(from);\n\n return (token: VegaTokenName, alpha?: number): string =>\n vegaRgb(resolve(token, FALLBACK_CHANNELS[token][scheme]), alpha);\n};\n","import type { Config } from 'vega-lite';\n\nimport type { ResolvedColorScheme } from '../components/ThemeProvider/types';\n\nimport { createVegaColorResolver, SERIES_TOKENS } from './vegaTokens';\n\nconst CHART_FONT = 'Inter, system-ui, sans-serif';\n\n/**\n * Scheme-following Vega-Lite config — the design system's chart look as a plain\n * `Config`, for any consumer that compiles or renders a Vega-Lite spec.\n *\n * - `background: 'transparent'` drops vega's opaque white backdrop, so the page\n * surface shows through in both schemes.\n * - Axis/legend/header/title text and lines read the live semantic tokens, so a\n * dark scheme (and a customer brand) recolour the chart chrome for free.\n * - `range.category` is `--chart-1..5` in series order — the same decorative\n * palette the recharts wrappers in `@keboola/design/charts` use — so a\n * categorical encoding matches the rest of the platform's data-viz instead of\n * falling back to vega's `tableau10`.\n * - `range.ramp` puts the low end of a quantitative scale on `--accent` rather\n * than vega's blue-only default, which keeps the pale end legible on a dark\n * surface.\n * - A range set on the spec's own scale still wins, which is how a Flint chart\n * keeps the series colours it resolves during assembly.\n * - Colours are resolved to concrete `rgb(R, G, B)` strings, not `var()`\n * references: vega does its colour maths in JS and never consults the\n * stylesheet. Rebuild the config when the scheme or brand changes —\n * `useVegaTheme` does that for you.\n */\nexport const vegaTheme = (scheme: ResolvedColorScheme, from?: Element | null): Config => {\n const token = createVegaColorResolver(scheme, from);\n\n const label = token('muted-foreground');\n const heading = token('foreground');\n const line = token('border');\n\n return {\n background: 'transparent',\n font: CHART_FONT,\n axis: {\n labelColor: label,\n titleColor: heading,\n gridColor: token('border', 0.6),\n domainColor: line,\n tickColor: line,\n },\n legend: { labelColor: label, titleColor: heading },\n header: { labelColor: label, titleColor: heading },\n title: { color: heading, subtitleColor: label },\n text: { color: heading },\n range: {\n category: SERIES_TOKENS.map((name) => token(name)),\n ramp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EAAG;GAC9B,aAAa;GACb,WAAW;EACb;EACA,QAAQ;GAAE,YAAY;GAAO,YAAY;EAAQ;EACjD,QAAQ;GAAE,YAAY;GAAO,YAAY;EAAQ;EACjD,OAAO;GAAE,OAAO;GAAS,eAAe;EAAM;EAC9C,MAAM,EAAE,OAAO,QAAQ;EACvB,OAAO;GACL,UAAU,cAAc,KAAK,SAAS,MAAM,IAAI,CAAC;GACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC;EAC1C;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keboola/design",
3
- "version": "11.4.0",
3
+ "version": "11.6.0",
4
4
  "description": "Keboola UI platform design system — shadcn-aligned React primitives, Keboola-branded blocks, and the form bindings built on TanStack Form.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -147,8 +147,8 @@
147
147
  "@vitest/coverage-v8": "^4.1.10",
148
148
  "d3-color": "^3.1.0",
149
149
  "eslint-plugin-storybook": "^10.3.5",
150
- "oxfmt": "^0.57.0",
151
- "oxlint": "^1.72.0",
150
+ "oxfmt": "^0.66.0",
151
+ "oxlint": "^1.81.0",
152
152
  "playwright": "1.60.0",
153
153
  "react": "^19.2.7",
154
154
  "react-docgen-typescript": "^2.4.0",
@@ -163,7 +163,7 @@
163
163
  "typescript": "npm:@typescript/typescript6@^6.0.2",
164
164
  "vite": "^8.1.5",
165
165
  "vitest": "^4.1.10",
166
- "@keboola/oxlint-config": "^10.0.2",
166
+ "@keboola/oxlint-config": "^10.1.0",
167
167
  "@keboola/tsconfig": "^0.2.1",
168
168
  "@keboola/vitest-config": "^1.0.0"
169
169
  },
@@ -192,7 +192,6 @@
192
192
  "@codemirror/state": "^6.7.1",
193
193
  "@codemirror/view": "^6.43.9",
194
194
  "@iconify-json/lucide": "^1.2.118",
195
- "@lezer/highlight": "^1.2.3",
196
195
  "@lexical/code": "^0.42.0",
197
196
  "@lexical/link": "^0.42.0",
198
197
  "@lexical/list": "^0.42.0",
@@ -200,11 +199,13 @@
200
199
  "@lexical/react": "^0.42.0",
201
200
  "@lexical/rich-text": "^0.42.0",
202
201
  "@lexical/utils": "^0.42.0",
202
+ "@lezer/highlight": "^1.2.3",
203
203
  "@radix-ui/react-alert-dialog": "^1.1.17",
204
204
  "@radix-ui/react-avatar": "^1.2.0",
205
205
  "@radix-ui/react-checkbox": "^1.3.5",
206
206
  "@radix-ui/react-collapsible": "^1.1.14",
207
207
  "@radix-ui/react-dialog": "^1.1.17",
208
+ "@radix-ui/react-dismissable-layer": "^1.1.13",
208
209
  "@radix-ui/react-dropdown-menu": "^2.1.18",
209
210
  "@radix-ui/react-hover-card": "^1.1.17",
210
211
  "@radix-ui/react-label": "^2.1.10",
@@ -253,9 +254,9 @@
253
254
  "tailwind-merge": "^3.6.0",
254
255
  "vega": "^6.4.0",
255
256
  "vega-lite": "^6.4.3",
257
+ "@keboola/brand-registry": "^1.9.4",
256
258
  "@keboola/codemirror-lang-sql": "^0.7.3",
257
- "@keboola/tailwind-config": "^1.1.2",
258
- "@keboola/brand-registry": "^1.9.4"
259
+ "@keboola/tailwind-config": "^1.1.2"
259
260
  },
260
261
  "scripts": {
261
262
  "dev": "storybook dev -p \"${PORT:-6006}\"",
@@ -277,7 +278,7 @@
277
278
  "lint:format": "oxfmt --check",
278
279
  "lint:oxlint": "oxlint . --quiet",
279
280
  "lint:design": "designmd lint DESIGN.md",
280
- "ci-checks": "pnpm check:api && pnpm check:icons && pnpm check:contrast && pnpm size",
281
+ "ci-checks": "pnpm check:api && pnpm check:icons && pnpm check:contrast && pnpm check:css && pnpm size",
281
282
  "size": "size-limit",
282
283
  "generate:api": "tsx scripts/generate-component-api.ts",
283
284
  "check:api": "tsx scripts/generate-component-api.ts --check",
@@ -285,6 +286,7 @@
285
286
  "type-check": "tsc",
286
287
  "generate:icons": "tsx scripts/generate-icon-exports.ts",
287
288
  "check:icons": "tsx scripts/generate-icon-exports.ts && git diff --exit-code -- src/icons/index.ts",
288
- "check:contrast": "tsx scripts/contrast-audit.ts && git diff --exit-code -- CONTRAST-AUDIT.md"
289
+ "check:contrast": "tsx scripts/contrast-audit.ts && git diff --exit-code -- CONTRAST-AUDIT.md",
290
+ "check:css": "tsx scripts/check-dead-css.ts"
289
291
  }
290
292
  }
package/src/styles.css CHANGED
@@ -189,6 +189,9 @@
189
189
  /* Motion — brand overrides via `theme.motion`. */
190
190
  --motion-duration: 200ms;
191
191
  --motion-easing: cubic-bezier(0.2, 0.7, 0.2, 1);
192
+ /* The rail's slide — the `Sidebar`, its menu and anything laid out against it read these. */
193
+ --sidebar-motion-duration: 420ms;
194
+ --sidebar-motion-easing: cubic-bezier(0.32, 0.72, 0, 1);
192
195
 
193
196
  /* Brand gradient — defaults to a primary→accent sweep; override via `theme.gradient`. */
194
197
  --gradient-brand: linear-gradient(