@neo4j-ndl/react 4.21.1 → 4.21.2-alpha.585cb7c.16.1

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 (155) hide show
  1. package/lib/cjs/accordion/stories/accordion-full.story.js +1 -1
  2. package/lib/cjs/accordion/stories/accordion-full.story.js.map +1 -1
  3. package/lib/cjs/ai/preview/Preview.js +1 -1
  4. package/lib/cjs/ai/preview/Preview.js.map +1 -1
  5. package/lib/cjs/ai/reasoning/Reasoning.js +2 -2
  6. package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -1
  7. package/lib/cjs/ai/thinking/Thinking.js +1 -1
  8. package/lib/cjs/ai/thinking/Thinking.js.map +1 -1
  9. package/lib/cjs/avatar/Avatar.js +1 -1
  10. package/lib/cjs/avatar/Avatar.js.map +1 -1
  11. package/lib/cjs/banner/Banner.js +1 -1
  12. package/lib/cjs/banner/Banner.js.map +1 -1
  13. package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
  14. package/lib/cjs/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
  15. package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
  16. package/lib/cjs/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
  17. package/lib/cjs/data-grid/Components.js +1 -1
  18. package/lib/cjs/data-grid/Components.js.map +1 -1
  19. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
  20. package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  21. package/lib/cjs/date-picker/DatePicker.js +2 -2
  22. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  23. package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js +2 -2
  24. package/lib/cjs/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
  25. package/lib/cjs/drawer/Drawer.js +1 -1
  26. package/lib/cjs/drawer/Drawer.js.map +1 -1
  27. package/lib/cjs/dropzone/Dropzone.js +2 -2
  28. package/lib/cjs/dropzone/Dropzone.js.map +1 -1
  29. package/lib/cjs/dropzone/stories/dropzone-full.story.js +7 -7
  30. package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
  31. package/lib/cjs/icon-button/stories/icon-button-sizes.story.js +1 -1
  32. package/lib/cjs/icon-button/stories/icon-button-sizes.story.js.map +1 -1
  33. package/lib/cjs/icon-button/stories/icon-button-tone.story.js +1 -1
  34. package/lib/cjs/icon-button/stories/icon-button-tone.story.js.map +1 -1
  35. package/lib/cjs/radio/stories/radio-custom-label.story.js +1 -1
  36. package/lib/cjs/radio/stories/radio-custom-label.story.js.map +1 -1
  37. package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
  38. package/lib/cjs/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
  39. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  40. package/lib/cjs/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  41. package/lib/cjs/side-navigation/SideNavigation.js +2 -2
  42. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  43. package/lib/cjs/side-navigation/stories/side-nav-badges.story.js +1 -1
  44. package/lib/cjs/side-navigation/stories/side-nav-badges.story.js.map +1 -1
  45. package/lib/cjs/side-navigation/stories/side-nav-compact.story.js +1 -1
  46. package/lib/cjs/side-navigation/stories/side-nav-compact.story.js.map +1 -1
  47. package/lib/cjs/side-navigation/stories/side-nav-default.story.js +1 -1
  48. package/lib/cjs/side-navigation/stories/side-nav-default.story.js.map +1 -1
  49. package/lib/cjs/side-navigation/stories/side-nav-secondary.story.js +1 -1
  50. package/lib/cjs/side-navigation/stories/side-nav-secondary.story.js.map +1 -1
  51. package/lib/cjs/skeleton/stories/skeleton-full-example.story.js +1 -1
  52. package/lib/cjs/skeleton/stories/skeleton-full-example.story.js.map +1 -1
  53. package/lib/cjs/skeleton/stories/skeleton-inherit-width.story.js +1 -1
  54. package/lib/cjs/skeleton/stories/skeleton-inherit-width.story.js.map +1 -1
  55. package/lib/cjs/spotlight/Spotlight.js +1 -1
  56. package/lib/cjs/spotlight/Spotlight.js.map +1 -1
  57. package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js +1 -1
  58. package/lib/cjs/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
  59. package/lib/cjs/tabs/Tabs.js +1 -1
  60. package/lib/cjs/tabs/Tabs.js.map +1 -1
  61. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js +1 -1
  62. package/lib/cjs/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  63. package/lib/cjs/tabs/stories/tabs-sizes.story.js +1 -1
  64. package/lib/cjs/tabs/stories/tabs-sizes.story.js.map +1 -1
  65. package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
  66. package/lib/cjs/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
  67. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
  68. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  69. package/lib/cjs/typography/Typography.js.map +1 -1
  70. package/lib/cjs/typography/stories/typography-anchor.story.js +1 -1
  71. package/lib/cjs/typography/stories/typography-anchor.story.js.map +1 -1
  72. package/lib/esm/accordion/stories/accordion-full.story.js +1 -1
  73. package/lib/esm/accordion/stories/accordion-full.story.js.map +1 -1
  74. package/lib/esm/ai/preview/Preview.js +1 -1
  75. package/lib/esm/ai/preview/Preview.js.map +1 -1
  76. package/lib/esm/ai/reasoning/Reasoning.js +2 -2
  77. package/lib/esm/ai/reasoning/Reasoning.js.map +1 -1
  78. package/lib/esm/ai/thinking/Thinking.js +1 -1
  79. package/lib/esm/ai/thinking/Thinking.js.map +1 -1
  80. package/lib/esm/avatar/Avatar.js +1 -1
  81. package/lib/esm/avatar/Avatar.js.map +1 -1
  82. package/lib/esm/banner/Banner.js +1 -1
  83. package/lib/esm/banner/Banner.js.map +1 -1
  84. package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js +1 -1
  85. package/lib/esm/clean-icon-button/stories/clean-icon-button-sizes.story.js.map +1 -1
  86. package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js +1 -1
  87. package/lib/esm/clean-icon-button/stories/clean-icon-button-tone.story.js.map +1 -1
  88. package/lib/esm/data-grid/Components.js +1 -1
  89. package/lib/esm/data-grid/Components.js.map +1 -1
  90. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +1 -1
  91. package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
  92. package/lib/esm/date-picker/DatePicker.js +2 -2
  93. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  94. package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js +2 -2
  95. package/lib/esm/date-picker/stories/date-picker-with-timezone-both-mode.story.js.map +1 -1
  96. package/lib/esm/drawer/Drawer.js +1 -1
  97. package/lib/esm/drawer/Drawer.js.map +1 -1
  98. package/lib/esm/dropzone/Dropzone.js +2 -2
  99. package/lib/esm/dropzone/Dropzone.js.map +1 -1
  100. package/lib/esm/dropzone/stories/dropzone-full.story.js +7 -7
  101. package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
  102. package/lib/esm/icon-button/stories/icon-button-sizes.story.js +1 -1
  103. package/lib/esm/icon-button/stories/icon-button-sizes.story.js.map +1 -1
  104. package/lib/esm/icon-button/stories/icon-button-tone.story.js +1 -1
  105. package/lib/esm/icon-button/stories/icon-button-tone.story.js.map +1 -1
  106. package/lib/esm/radio/stories/radio-custom-label.story.js +1 -1
  107. package/lib/esm/radio/stories/radio-custom-label.story.js.map +1 -1
  108. package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js +1 -1
  109. package/lib/esm/select-icon-button/stories/select-icon-button-sizes.story.js.map +1 -1
  110. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js +1 -1
  111. package/lib/esm/select-icon-button/stories/select-icon-button-states.story.js.map +1 -1
  112. package/lib/esm/side-navigation/SideNavigation.js +2 -2
  113. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  114. package/lib/esm/side-navigation/stories/side-nav-badges.story.js +1 -1
  115. package/lib/esm/side-navigation/stories/side-nav-badges.story.js.map +1 -1
  116. package/lib/esm/side-navigation/stories/side-nav-compact.story.js +1 -1
  117. package/lib/esm/side-navigation/stories/side-nav-compact.story.js.map +1 -1
  118. package/lib/esm/side-navigation/stories/side-nav-default.story.js +1 -1
  119. package/lib/esm/side-navigation/stories/side-nav-default.story.js.map +1 -1
  120. package/lib/esm/side-navigation/stories/side-nav-secondary.story.js +1 -1
  121. package/lib/esm/side-navigation/stories/side-nav-secondary.story.js.map +1 -1
  122. package/lib/esm/skeleton/stories/skeleton-full-example.story.js +1 -1
  123. package/lib/esm/skeleton/stories/skeleton-full-example.story.js.map +1 -1
  124. package/lib/esm/skeleton/stories/skeleton-inherit-width.story.js +1 -1
  125. package/lib/esm/skeleton/stories/skeleton-inherit-width.story.js.map +1 -1
  126. package/lib/esm/spotlight/Spotlight.js +1 -1
  127. package/lib/esm/spotlight/Spotlight.js.map +1 -1
  128. package/lib/esm/status-indicator/stories/status-indicator-variants.story.js +1 -1
  129. package/lib/esm/status-indicator/stories/status-indicator-variants.story.js.map +1 -1
  130. package/lib/esm/tabs/Tabs.js +1 -1
  131. package/lib/esm/tabs/Tabs.js.map +1 -1
  132. package/lib/esm/tabs/stories/tabs-fill-variants.story.js +1 -1
  133. package/lib/esm/tabs/stories/tabs-fill-variants.story.js.map +1 -1
  134. package/lib/esm/tabs/stories/tabs-sizes.story.js +1 -1
  135. package/lib/esm/tabs/stories/tabs-sizes.story.js.map +1 -1
  136. package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js +1 -1
  137. package/lib/esm/timezone-picker/stories/timezone-picker-both-mode.story.js.map +1 -1
  138. package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
  139. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  140. package/lib/esm/typography/Typography.js.map +1 -1
  141. package/lib/esm/typography/stories/typography-anchor.story.js +1 -1
  142. package/lib/esm/typography/stories/typography-anchor.story.js.map +1 -1
  143. package/lib/types/typography/Typography.d.ts +6 -1
  144. package/lib/types/typography/Typography.d.ts.map +1 -1
  145. package/package.json +2 -2
  146. package/skills/ndl-react/components/clean-icon-button.md +5 -5
  147. package/skills/ndl-react/components/color-picker.md +32 -32
  148. package/skills/ndl-react/components/date-picker.md +1 -1
  149. package/skills/ndl-react/components/dropzone.md +6 -6
  150. package/skills/ndl-react/components/icon-button.md +5 -5
  151. package/skills/ndl-react/components/radio.md +1 -1
  152. package/skills/ndl-react/components/select-icon-button.md +6 -6
  153. package/skills/ndl-react/components/status-indicator.md +5 -5
  154. package/skills/ndl-react/components/tabs.md +4 -4
  155. package/skills/ndl-react/components/typography.md +1 -1
@@ -27,7 +27,7 @@ const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [smallValue, setSmallValue] = (0, react_2.useState)('0');
29
29
  const [largeValue, setLargeValue] = (0, react_2.useState)('0');
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: "Small Size" }), (0, jsx_runtime_1.jsxs)("div", { className: "n-w-fit", children: [(0, jsx_runtime_1.jsxs)(react_1.Tabs, { value: smallValue, onChange: setSmallValue, size: "small", className: "n-mb-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "0", children: "Tab 1" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "1", children: "Tab 2" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "2", children: "Tab 3" })] }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "0", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 1" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "1", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 2" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "2", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 3" }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", children: "Large Size (Default)" }), (0, jsx_runtime_1.jsxs)(react_1.Tabs, { value: largeValue, onChange: setLargeValue, size: "large", className: "n-mb-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "0", children: "Tab 1" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "1", children: "Tab 2" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "2", children: "Tab 3" })] }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "0", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 1" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "1", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 2" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "2", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 3" }) })] })] }));
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-3", children: "Small Size" }), (0, jsx_runtime_1.jsxs)("div", { className: "n-w-fit", children: [(0, jsx_runtime_1.jsxs)(react_1.Tabs, { value: smallValue, onChange: setSmallValue, size: "small", className: "n-mb-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "0", children: "Tab 1" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "1", children: "Tab 2" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "2", children: "Tab 3" })] }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "0", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 1" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "1", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 2" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: smallValue, tabId: "2", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-small", children: "Content for small tab 3" }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-3", children: "Large Size (Default)" }), (0, jsx_runtime_1.jsxs)(react_1.Tabs, { value: largeValue, onChange: setLargeValue, size: "large", className: "n-mb-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "0", children: "Tab 1" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "1", children: "Tab 2" }), (0, jsx_runtime_1.jsx)(react_1.Tabs.Tab, { id: "2", children: "Tab 3" })] }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "0", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 1" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "1", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 2" }) }), (0, jsx_runtime_1.jsx)(react_1.Tabs.TabPanel, { value: largeValue, tabId: "2", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Content for large tab 3" }) })] })] }));
31
31
  };
32
32
  exports.default = Component;
33
33
  //# sourceMappingURL=tabs-sizes.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-sizes.story.js","sourceRoot":"","sources":["../../../../src/tabs/stories/tabs-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAoD;AACpD,iCAAiC;AAIjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAY,GAAG,CAAC,CAAC;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAY,GAAG,CAAC,CAAC;IAE7D,OAAO,CACL,iCAAK,SAAS,EAAC,sBAAsB,aACnC,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,uBAAC,kBAAU,IAAC,OAAO,EAAC,OAAO,2BAAwB,EACnD,iCAAK,SAAS,EAAC,SAAS,aACtB,wBAAC,YAAI,IACH,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,cAAc,aAExB,uBAAC,YAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,uBAAC,YAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,uBAAC,YAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,IAC5B,EACP,uBAAC,YAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,GAAG,YACzC,uBAAC,kBAAU,IAAC,OAAO,EAAC,YAAY,wCAEnB,GACC,EAChB,uBAAC,YAAI,CAAC,QAAQ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n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Tabs, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype TabValues = '0' | '1' | '2';\n\nconst Component = () => {\n const [smallValue, setSmallValue] = useState<TabValues>('0');\n const [largeValue, setLargeValue] = useState<TabValues>('0');\n\n return (\n <div className=\"n-flex n-gap-token-8\">\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"label\">Small Size</Typography>\n <div className=\"n-w-fit\">\n <Tabs\n value={smallValue}\n onChange={setSmallValue}\n size=\"small\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={smallValue} tabId=\"0\">\n <Typography variant=\"body-small\">\n Content for small tab 1\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"1\">\n <Typography variant=\"body-small\">\n Content for small tab 2\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"2\">\n <Typography variant=\"body-small\">\n Content for small tab 3\n </Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"label\">Large Size (Default)</Typography>\n <Tabs\n value={largeValue}\n onChange={setLargeValue}\n size=\"large\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={largeValue} tabId=\"0\">\n <Typography variant=\"body-medium\">Content for large tab 1</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"1\">\n <Typography variant=\"body-medium\">Content for large tab 2</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"2\">\n <Typography variant=\"body-medium\">Content for large tab 3</Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"tabs-sizes.story.js","sourceRoot":"","sources":["../../../../src/tabs/stories/tabs-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAoD;AACpD,iCAAiC;AAIjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAY,GAAG,CAAC,CAAC;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAY,GAAG,CAAC,CAAC;IAE7D,OAAO,CACL,iCAAK,SAAS,EAAC,sBAAsB,aACnC,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,uBAAC,kBAAU,IAAC,OAAO,EAAC,SAAS,2BAAwB,EACrD,iCAAK,SAAS,EAAC,SAAS,aACtB,wBAAC,YAAI,IACH,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,cAAc,aAExB,uBAAC,YAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,uBAAC,YAAI,CAAC,GAAG,IAAC,EAAE,EAAC,GAAG,sBAAiB,EACjC,uBAAC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,EAAC,GAAG,YACzC,uBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,wCAAqC,GACxD,IACZ,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Tabs, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype TabValues = '0' | '1' | '2';\n\nconst Component = () => {\n const [smallValue, setSmallValue] = useState<TabValues>('0');\n const [largeValue, setLargeValue] = useState<TabValues>('0');\n\n return (\n <div className=\"n-flex n-gap-token-8\">\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"title-3\">Small Size</Typography>\n <div className=\"n-w-fit\">\n <Tabs\n value={smallValue}\n onChange={setSmallValue}\n size=\"small\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={smallValue} tabId=\"0\">\n <Typography variant=\"body-small\">\n Content for small tab 1\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"1\">\n <Typography variant=\"body-small\">\n Content for small tab 2\n </Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={smallValue} tabId=\"2\">\n <Typography variant=\"body-small\">\n Content for small tab 3\n </Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n\n <div className=\"n-flex n-flex-col n-gap-token-8\">\n <Typography variant=\"title-3\">Large Size (Default)</Typography>\n <Tabs\n value={largeValue}\n onChange={setLargeValue}\n size=\"large\"\n className=\"n-mb-token-8\"\n >\n <Tabs.Tab id=\"0\">Tab 1</Tabs.Tab>\n <Tabs.Tab id=\"1\">Tab 2</Tabs.Tab>\n <Tabs.Tab id=\"2\">Tab 3</Tabs.Tab>\n </Tabs>\n <Tabs.TabPanel value={largeValue} tabId=\"0\">\n <Typography variant=\"body-medium\">Content for large tab 1</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"1\">\n <Typography variant=\"body-medium\">Content for large tab 2</Typography>\n </Tabs.TabPanel>\n <Tabs.TabPanel value={largeValue} tabId=\"2\">\n <Typography variant=\"body-medium\">Content for large tab 3</Typography>\n </Tabs.TabPanel>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -27,7 +27,7 @@ const typography_1 = require("../../typography");
27
27
  const TimeZonePicker_1 = require("../TimeZonePicker");
28
28
  const TimeZonePickerBothMode = () => {
29
29
  const [selectedTimezone, setSelectedTimezone] = (0, react_1.useState)('America/New_York');
30
- return ((0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: '400px', padding: '20px' }, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "title-4", style: { marginBottom: '16px' }, children: "Both Mode - UTC and City-Based Timezones" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "body-medium", style: { marginBottom: '24px' }, children: "This mode displays both UTC offsets and city-based timezones in separate sections within the dropdown. Perfect for users who need flexibility in choosing between precise UTC offsets or familiar city names." }), (0, jsx_runtime_1.jsx)(TimeZonePicker_1.TimeZonePicker, { label: "Select Timezone", mode: "both", value: selectedTimezone, onChange: (tz) => {
30
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: '400px', padding: '20px' }, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "title-3", style: { marginBottom: '16px' }, children: "Both Mode - UTC and City-Based Timezones" }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "body-medium", style: { marginBottom: '24px' }, children: "This mode displays both UTC offsets and city-based timezones in separate sections within the dropdown. Perfect for users who need flexibility in choosing between precise UTC offsets or familiar city names." }), (0, jsx_runtime_1.jsx)(TimeZonePicker_1.TimeZonePicker, { label: "Select Timezone", mode: "both", value: selectedTimezone, onChange: (tz) => {
31
31
  setSelectedTimezone(tz);
32
32
  }, htmlAttributes: { id: 'time-zone-input' } }), (0, jsx_runtime_1.jsxs)("div", { style: {
33
33
  backgroundColor: '#f5f5f5',
@@ -1 +1 @@
1
- {"version":3,"file":"timezone-picker-both-mode.story.js","sourceRoot":"","sources":["../../../../src/timezone-picker/stories/timezone-picker-both-mode.story.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAiC;AAEjC,iDAA8C;AAC9C,sDAAmD;AAE5C,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAC3C,IAAA,gBAAQ,EAAS,kBAAkB,CAAC,CAAC;IAEvC,OAAO,CACL,iCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAChD,uBAAC,uBAAU,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,yDAEhD,EACb,uBAAC,uBAAU,IAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,8NAIpD,EAEb,uBAAC,+BAAc,IACb,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE;oBACf,mBAAmB,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC,EACD,cAAc,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GACzC,EAEF,iCACE,KAAK,EAAE;oBACL,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,MAAM;iBAChB,aAED,uBAAC,uBAAU,IACT,OAAO,EAAC,YAAY,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,mCAGpC,EACb,uBAAC,uBAAU,IAAC,OAAO,EAAC,aAAa,YAC9B,gBAAgB,IAAI,MAAM,GAChB,IACT,EAEN,gCAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAC/B,wBAAC,uBAAU,IAAC,OAAO,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aACvD,2DAA0B,EAC1B,gCAAI,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAClD,iHAGK,EACL,wFAAmD,EACnD,uFAAkD,EAClD,4FAAuD,EACvD,2FAAsD,IACnD,IACM,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,sBAAsB,0BA6DjC;AAEF,kBAAe,8BAAsB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useState } from 'react';\n\nimport { Typography } from '../../typography';\nimport { TimeZonePicker } from '../TimeZonePicker';\n\nexport const TimeZonePickerBothMode = () => {\n const [selectedTimezone, setSelectedTimezone] =\n useState<string>('America/New_York');\n\n return (\n <div style={{ maxWidth: '400px', padding: '20px' }}>\n <Typography variant=\"title-4\" style={{ marginBottom: '16px' }}>\n Both Mode - UTC and City-Based Timezones\n </Typography>\n <Typography variant=\"body-medium\" style={{ marginBottom: '24px' }}>\n This mode displays both UTC offsets and city-based timezones in separate\n sections within the dropdown. Perfect for users who need flexibility in\n choosing between precise UTC offsets or familiar city names.\n </Typography>\n\n <TimeZonePicker\n label=\"Select Timezone\"\n mode=\"both\"\n value={selectedTimezone}\n onChange={(tz) => {\n setSelectedTimezone(tz);\n }}\n htmlAttributes={{ id: 'time-zone-input' }}\n />\n\n <div\n style={{\n backgroundColor: '#f5f5f5',\n borderRadius: '4px',\n marginTop: '24px',\n padding: '16px',\n }}\n >\n <Typography\n variant=\"body-small\"\n style={{ fontWeight: 600, marginBottom: '8px' }}\n >\n Selected Timezone:\n </Typography>\n <Typography variant=\"body-medium\">\n {selectedTimezone || 'None'}\n </Typography>\n </div>\n\n <div style={{ marginTop: '16px' }}>\n <Typography variant=\"body-small\" style={{ color: '#666' }}>\n <strong>Features:</strong>\n <ul style={{ marginTop: '8px', paddingLeft: '20px' }}>\n <li>\n Two separate sections: &quot;UTC Offsets&quot; and\n &quot;City-Based Timezones&quot;\n </li>\n <li>Search across both sections simultaneously</li>\n <li>Custom UTC input support (e.g., UTC+5:30)</li>\n <li>All standard UTC offsets from UTC-12 to UTC+14</li>\n <li>All IANA timezone identifiers with city names</li>\n </ul>\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default TimeZonePickerBothMode;\n"]}
1
+ {"version":3,"file":"timezone-picker-both-mode.story.js","sourceRoot":"","sources":["../../../../src/timezone-picker/stories/timezone-picker-both-mode.story.tsx"],"names":[],"mappings":";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,MAAM,EAAE,aACvD,2DAA0B,EAC1B,gCAAI,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAClD,iHAGK,EACL,wFAAmD,EACnD,uFAAkD,EAClD,4FAAuD,EACvD,2FAAsD,IACnD,IACM,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,sBAAsB,0BA6DjC;AAEF,kBAAe,8BAAsB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useState } from 'react';\n\nimport { Typography } from '../../typography';\nimport { TimeZonePicker } from '../TimeZonePicker';\n\nexport const TimeZonePickerBothMode = () => {\n const [selectedTimezone, setSelectedTimezone] =\n useState<string>('America/New_York');\n\n return (\n <div style={{ maxWidth: '400px', padding: '20px' }}>\n <Typography variant=\"title-3\" style={{ marginBottom: '16px' }}>\n Both Mode - UTC and City-Based Timezones\n </Typography>\n <Typography variant=\"body-medium\" style={{ marginBottom: '24px' }}>\n This mode displays both UTC offsets and city-based timezones in separate\n sections within the dropdown. Perfect for users who need flexibility in\n choosing between precise UTC offsets or familiar city names.\n </Typography>\n\n <TimeZonePicker\n label=\"Select Timezone\"\n mode=\"both\"\n value={selectedTimezone}\n onChange={(tz) => {\n setSelectedTimezone(tz);\n }}\n htmlAttributes={{ id: 'time-zone-input' }}\n />\n\n <div\n style={{\n backgroundColor: '#f5f5f5',\n borderRadius: '4px',\n marginTop: '24px',\n padding: '16px',\n }}\n >\n <Typography\n variant=\"body-small\"\n style={{ fontWeight: 600, marginBottom: '8px' }}\n >\n Selected Timezone:\n </Typography>\n <Typography variant=\"body-medium\">\n {selectedTimezone || 'None'}\n </Typography>\n </div>\n\n <div style={{ marginTop: '16px' }}>\n <Typography variant=\"body-small\" style={{ color: '#666' }}>\n <strong>Features:</strong>\n <ul style={{ marginTop: '8px', paddingLeft: '20px' }}>\n <li>\n Two separate sections: &quot;UTC Offsets&quot; and\n &quot;City-Based Timezones&quot;\n </li>\n <li>Search across both sections simultaneously</li>\n <li>Custom UTC input support (e.g., UTC+5:30)</li>\n <li>All standard UTC offsets from UTC-12 to UTC+14</li>\n <li>All IANA timezone identifiers with city names</li>\n </ul>\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default TimeZonePickerBothMode;\n"]}
@@ -137,7 +137,7 @@ const TreeViewTextItem = (_a) => {
137
137
  }
138
138
  }
139
139
  onItemsChanged(newItems, { item, reason: 'selected' });
140
- }, "aria-label": item.data.text }) }))), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, Object.assign({ onBackground: "weak", shape: "rectangular", height: "20px" }, item.skeletonProps, { isLoading: item.isSkeletonLoading, children: (0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: item.data.onTextClick !== undefined, wrap: (children) => ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: item.data.onTextClick, className: "ndl-tree-view-text-clickable", tabIndex: tabIndex, children: children })), children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: item.canHaveSubItems ? 'subheading-small' : 'body-medium', htmlAttributes: {
140
+ }, "aria-label": item.data.text }) }))), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, Object.assign({ onBackground: "weak", shape: "rectangular", height: "20px" }, item.skeletonProps, { isLoading: item.isSkeletonLoading, children: (0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: item.data.onTextClick !== undefined, wrap: (children) => ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: item.data.onTextClick, className: "ndl-tree-view-text-clickable", tabIndex: tabIndex, children: children })), children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: item.canHaveSubItems ? 'subheading-medium' : 'body-medium', htmlAttributes: {
141
141
  style: {
142
142
  overflow: 'hidden',
143
143
  textOverflow: 'ellipsis',
@@ -1 +1 @@
1
- {"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,0CAAuC;AACvC,4DAAuD;AACvD,0DAAsD;AACtD,gGAA6F;AAC7F,kGAA+F;AAC/F,0CAAuC;AACvC,8CAA2C;AAM3C,uDAAoD;AAEpD;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,KAAwC,EAC/B,EAAE;IACX,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3E,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,KAAwC,EAC/B,EAAE;IACX,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QA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AAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,EAClE,cAAc,EAAE;4BACd,KAAK,EAAE;gCACL,QAAQ,EAAE,QAAQ;gCAClB,YAAY,EAAE,UAAU;gCACxB,UAAU,EAAE,QAAQ;6BACrB;yBACF,YAEA,IAAI,CAAC,IAAI,CAAC,IAAI,GACJ,GACG,IACT,EACX,gCAAK,SAAS,EAAC,uBAAuB,YACnC,IAAI,CAAC,IAAI,CAAC,OAAO;oBAChB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBACtC,OAAO,CACL,uBAAC,mCAAe,kBAEd,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,OAAO,IACR,MAAM,CAAC,WAAW,IACtB,cAAc,kBACZ,QAAQ,IACL,MAAM,CAAC,WAAW,CAAC,cAAc,aAGrC,MAAM,CAAC,IAAI,KATP,KAAK,CAUM,CACnB,CAAC;oBACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC;AA/MW,QAAA,gBAAgB,oBA+M3B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((parentItem) => parentItem.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((childItem) => childItem.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (childItem) =>\n childItem.isSelected || childrenCheckedRecursively(childItem, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((treeItem) => {\n if (treeItem.id === item.id) {\n return {\n ...treeItem,\n isSelected: event.target.checked,\n };\n }\n return treeItem;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((childItem) => childItem.parentId === item.id)\n .map((childItem) => childItem.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find(\n (childItem) => childItem.id === childId,\n );\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((childItem) => childItem.parentId === child.id)\n .forEach((childItem) => {\n childIdsToUncheck.push(childItem.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-small' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,0CAAuC;AACvC,4DAAuD;AACvD,0DAAsD;A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EAAE;wBACtC,OAAO,CACL,uBAAC,mCAAe,kBAEd,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,OAAO,IACR,MAAM,CAAC,WAAW,IACtB,cAAc,kBACZ,QAAQ,IACL,MAAM,CAAC,WAAW,CAAC,cAAc,aAGrC,MAAM,CAAC,IAAI,KATP,KAAK,CAUM,CACnB,CAAC;oBACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC;AA/MW,QAAA,gBAAgB,oBA+M3B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline } from '../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((parentItem) => parentItem.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item - Tree item\n * @param items - Flattened tree items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((childItem) => childItem.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (childItem) =>\n childItem.isSelected || childrenCheckedRecursively(childItem, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((treeItem) => {\n if (treeItem.id === item.id) {\n return {\n ...treeItem,\n isSelected: event.target.checked,\n };\n }\n return treeItem;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((childItem) => childItem.parentId === item.id)\n .map((childItem) => childItem.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find(\n (childItem) => childItem.id === childId,\n );\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((childItem) => childItem.parentId === child.id)\n .forEach((childItem) => {\n childIdsToUncheck.push(childItem.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-medium' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,4DAAoC;AAa7B,MAAM,UAAU,GAAG,CACxB,KAAiD,EACtB,EAAE;IAC7B,MAAM,EACJ,EAAE,EACF,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,OAAO,EACP,cAAc,EACd,GAAG,KAED,KAAK,EADJ,SAAS,UACV,KAAK,EARH,mEAQL,CAAQ,CAAC;IAEV,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,KAAK,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,MAAM,CAAC;IAE/B,OAAO,CACL,uBAAC,SAAS,kBAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAM,SAAS,EAAM,cAAc,cACvE,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,UAAU,cAqBrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\nexport type TypographyVariants = keyof typeof tokens.typography;\n\ntype TypographyProps = {\n /** The typography variant to use for the text. */\n variant: TypographyVariants;\n /** Content displayed inside the component */\n children?: React.ReactNode;\n};\n\nexport const Typography = <T extends React.ElementType = 'span'>(\n props: PolymorphicCommonProps<T, TypographyProps>,\n): React.ReactElement | null => {\n const {\n as,\n className = '',\n children,\n variant,\n htmlAttributes,\n ref,\n ...restProps\n } = props;\n\n const classes = classNames(`n-${variant}`, className);\n const Component = as ?? 'span';\n\n return (\n <Component className={classes} ref={ref} {...restProps} {...htmlAttributes}>\n {children}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,4DAAoC;AAkB7B,MAAM,UAAU,GAAG,CACxB,KAAiD,EACtB,EAAE;IAC7B,MAAM,EACJ,EAAE,EACF,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,OAAO,EACP,cAAc,EACd,GAAG,KAED,KAAK,EADJ,SAAS,UACV,KAAK,EARH,mEAQL,CAAQ,CAAC;IAEV,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,KAAK,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,MAAM,CAAC;IAE/B,OAAO,CACL,uBAAC,SAAS,kBAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAM,SAAS,EAAM,cAAc,cACvE,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,UAAU,cAqBrB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\n\nexport type TypographyVariants = keyof typeof tokens.typography;\n\ntype TypographyProps = {\n /**\n * The typography variant to use for the text.\n *\n * `label` is deprecated: it is identical to `title-4`, which should be used\n * instead.\n */\n variant: TypographyVariants;\n /** Content displayed inside the component */\n children?: React.ReactNode;\n};\n\nexport const Typography = <T extends React.ElementType = 'span'>(\n props: PolymorphicCommonProps<T, TypographyProps>,\n): React.ReactElement | null => {\n const {\n as,\n className = '',\n children,\n variant,\n htmlAttributes,\n ref,\n ...restProps\n } = props;\n\n const classes = classNames(`n-${variant}`, className);\n const Component = as ?? 'span';\n\n return (\n <Component className={classes} ref={ref} {...restProps} {...htmlAttributes}>\n {children}\n </Component>\n );\n};\n"]}
@@ -18,7 +18,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
18
18
  */
19
19
  const Typography_1 = require("../Typography");
20
20
  const Component = () => {
21
- const variant = 'title-1';
21
+ const variant = 'title-2';
22
22
  return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { as: "a", htmlAttributes: { href: '/index' }, variant: variant, children: [variant, ": The quick brown fox jumps over the lazy dog"] }));
23
23
  };
24
24
  exports.default = Component;
@@ -1 +1 @@
1
- {"version":3,"file":"typography-anchor.story.js","sourceRoot":"","sources":["../../../../src/typography/stories/typography-anchor.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,8CAA2C;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,SAAS,CAAC;IAE1B,OAAO,CACL,wBAAC,uBAAU,IAAC,EAAE,EAAC,GAAG,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,aACpE,OAAO,qDACG,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n * This file is part of Neo4j.\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Typography } from '../Typography';\n\nconst Component = () => {\n const variant = 'title-1';\n\n return (\n <Typography as=\"a\" htmlAttributes={{ href: '/index' }} variant={variant}>\n {variant}: The quick brown fox jumps over the lazy dog\n </Typography>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"typography-anchor.story.js","sourceRoot":"","sources":["../../../../src/typography/stories/typography-anchor.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,8CAA2C;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,SAAS,CAAC;IAE1B,OAAO,CACL,wBAAC,uBAAU,IAAC,EAAE,EAAC,GAAG,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,aACpE,OAAO,qDACG,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n * This file is part of Neo4j.\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Typography } from '../Typography';\n\nconst Component = () => {\n const variant = 'title-2';\n\n return (\n <Typography as=\"a\" htmlAttributes={{ href: '/index' }} variant={variant}>\n {variant}: The quick brown fox jumps over the lazy dog\n </Typography>\n );\n};\n\nexport default Component;\n"]}
@@ -29,7 +29,7 @@ const Component = () => {
29
29
  ]);
30
30
  const onChange = (expandedItemIds) => setExpandedItemIds(expandedItemIds);
31
31
  const onExpandedChange = (hasExpanded) => console.info(`Expanded change: ${hasExpanded}`);
32
- return (_jsxs(Accordion, { expandedItemIds: expandedItemIds, isMultiple: true, onChange: onChange, children: [_jsx(Accordion.CleanItem, { itemId: itemIds[0], title: `Accordion ${itemIds[0]}`, children: itemIds[0] }), _jsx(Accordion.CleanItem, { arrowPosition: "trailing", isDisabled: false, itemId: itemIds[1], onExpandedChange: onExpandedChange, trailingContent: _jsx(Checkbox, { label: "Right content" }), title: `Accordion ${itemIds[1]}`, titleTypographyVariant: "title-4", children: itemIds[1] }), _jsx(Accordion.CleanItem, { itemId: itemIds[2], title: `Accordion ${itemIds[2]}`, children: itemIds[2] }), _jsx(Accordion.CleanItem, { itemId: itemIds[3], title: `Accordion ${itemIds[3]}`, children: itemIds[3] })] }));
32
+ return (_jsxs(Accordion, { expandedItemIds: expandedItemIds, isMultiple: true, onChange: onChange, children: [_jsx(Accordion.CleanItem, { itemId: itemIds[0], title: `Accordion ${itemIds[0]}`, children: itemIds[0] }), _jsx(Accordion.CleanItem, { arrowPosition: "trailing", isDisabled: false, itemId: itemIds[1], onExpandedChange: onExpandedChange, trailingContent: _jsx(Checkbox, { label: "Right content" }), title: `Accordion ${itemIds[1]}`, titleTypographyVariant: "title-3", children: itemIds[1] }), _jsx(Accordion.CleanItem, { itemId: itemIds[2], title: `Accordion ${itemIds[2]}`, children: itemIds[2] }), _jsx(Accordion.CleanItem, { itemId: itemIds[3], title: `Accordion ${itemIds[3]}`, children: itemIds[3] })] }));
33
33
  };
34
34
  export default Component;
35
35
  //# sourceMappingURL=accordion-full.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion-full.story.js","sourceRoot":"","sources":["../../../../src/accordion/stories/accordion-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEzD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAA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eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Accordion, Checkbox } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype AccordionItemId = React.ComponentProps<\n typeof Accordion.CleanItem\n>['itemId'];\n\nconst Component = () => {\n const itemIds = ['item-1', 'item-2', 'item-3', 'item-4'];\n\n const [expandedItemIds, setExpandedItemIds] = useState<AccordionItemId[]>([\n itemIds[1],\n ]);\n\n const onChange = (expandedItemIds: AccordionItemId[]) =>\n setExpandedItemIds(expandedItemIds);\n\n const onExpandedChange = (hasExpanded: boolean) =>\n console.info(`Expanded change: ${hasExpanded}`);\n\n return (\n <Accordion\n expandedItemIds={expandedItemIds}\n isMultiple={true}\n onChange={onChange}\n >\n <Accordion.CleanItem\n itemId={itemIds[0]}\n title={`Accordion ${itemIds[0]}`}\n >\n {itemIds[0]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n arrowPosition=\"trailing\"\n isDisabled={false}\n itemId={itemIds[1]}\n onExpandedChange={onExpandedChange}\n trailingContent={<Checkbox label=\"Right content\" />}\n title={`Accordion ${itemIds[1]}`}\n titleTypographyVariant=\"title-4\"\n >\n {itemIds[1]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n itemId={itemIds[2]}\n title={`Accordion ${itemIds[2]}`}\n >\n {itemIds[2]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n itemId={itemIds[3]}\n title={`Accordion ${itemIds[3]}`}\n >\n {itemIds[3]}\n </Accordion.CleanItem>\n </Accordion>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"accordion-full.story.js","sourceRoot":"","sources":["../../../../src/accordion/stories/accordion-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEzD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAoB;QACxE,OAAO,CAAC,CAAC,CAAC;KACX,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,CAAC,eAAkC,EAAE,EAAE,CACtD,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAEtC,MAAM,gBAAgB,GAAG,CAAC,WAAoB,EAAE,EAAE,CAChD,OAAO,CAAC,IAAI,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;IAElD,OAAO,CACL,MAAC,SAAS,IACR,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,QAAQ,aAElB,KAAC,SAAS,CAAC,SAAS,IAClB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,KAAK,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,EAAE,YAE/B,OAAO,CAAC,CAAC,CAAC,GACS,EACtB,KAAC,SAAS,CAAC,SAAS,IAClB,aAAa,EAAC,UAAU,EACxB,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,KAAC,QAAQ,IAAC,KAAK,EAAC,eAAe,GAAG,EACnD,KAAK,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,EAAE,EAChC,sBAAsB,EAAC,SAAS,YAE/B,OAAO,CAAC,CAAC,CAAC,GACS,EACtB,KAAC,SAAS,CAAC,SAAS,IAClB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,KAAK,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,EAAE,YAE/B,OAAO,CAAC,CAAC,CAAC,GACS,EACtB,KAAC,SAAS,CAAC,SAAS,IAClB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,KAAK,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,EAAE,YAE/B,OAAO,CAAC,CAAC,CAAC,GACS,IACZ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Accordion, Checkbox } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\ntype AccordionItemId = React.ComponentProps<\n typeof Accordion.CleanItem\n>['itemId'];\n\nconst Component = () => {\n const itemIds = ['item-1', 'item-2', 'item-3', 'item-4'];\n\n const [expandedItemIds, setExpandedItemIds] = useState<AccordionItemId[]>([\n itemIds[1],\n ]);\n\n const onChange = (expandedItemIds: AccordionItemId[]) =>\n setExpandedItemIds(expandedItemIds);\n\n const onExpandedChange = (hasExpanded: boolean) =>\n console.info(`Expanded change: ${hasExpanded}`);\n\n return (\n <Accordion\n expandedItemIds={expandedItemIds}\n isMultiple={true}\n onChange={onChange}\n >\n <Accordion.CleanItem\n itemId={itemIds[0]}\n title={`Accordion ${itemIds[0]}`}\n >\n {itemIds[0]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n arrowPosition=\"trailing\"\n isDisabled={false}\n itemId={itemIds[1]}\n onExpandedChange={onExpandedChange}\n trailingContent={<Checkbox label=\"Right content\" />}\n title={`Accordion ${itemIds[1]}`}\n titleTypographyVariant=\"title-3\"\n >\n {itemIds[1]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n itemId={itemIds[2]}\n title={`Accordion ${itemIds[2]}`}\n >\n {itemIds[2]}\n </Accordion.CleanItem>\n <Accordion.CleanItem\n itemId={itemIds[3]}\n title={`Accordion ${itemIds[3]}`}\n >\n {itemIds[3]}\n </Accordion.CleanItem>\n </Accordion>\n );\n};\n\nexport default Component;\n"]}
@@ -58,7 +58,7 @@ const PreviewConfirmation = (_a) => {
58
58
  const classes = classNames('ndl-ai-preview-confirmation', className, {
59
59
  'ndl-ai-preview-confirmation-footer': isFooter,
60
60
  });
61
- return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [!(isFooter && status !== 'pending') && (_jsx(Typography, { as: "div", variant: isFooter ? 'subheading-small' : 'body-medium', className: "ndl-ai-preview-confirmation-content", children: children })), _jsxs(Typography, { variant: "body-medium", as: "div", className: "ndl-ai-preview-confirmation-actions", children: [status === 'pending' && actions, status === 'confirmed' && (_jsxs("div", { className: "ndl-ai-preview-confirmation-confirm-reject", children: [_jsx(CheckIconOutline, { className: "ndl-ai-preview-confirmation-action-icon" }), confirmedActionText] })), status === 'rejected' && (_jsxs("div", { className: "ndl-ai-preview-confirmation-confirm-reject", children: [_jsx(XMarkIconOutline, { className: "ndl-ai-preview-confirmation-action-icon" }), rejectedActionText] }))] })] })));
61
+ return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [!(isFooter && status !== 'pending') && (_jsx(Typography, { as: "div", variant: isFooter ? 'subheading-medium' : 'body-medium', className: "ndl-ai-preview-confirmation-content", children: children })), _jsxs(Typography, { variant: "body-medium", as: "div", className: "ndl-ai-preview-confirmation-actions", children: [status === 'pending' && actions, status === 'confirmed' && (_jsxs("div", { className: "ndl-ai-preview-confirmation-confirm-reject", children: [_jsx(CheckIconOutline, { className: "ndl-ai-preview-confirmation-action-icon" }), confirmedActionText] })), status === 'rejected' && (_jsxs("div", { className: "ndl-ai-preview-confirmation-confirm-reject", children: [_jsx(XMarkIconOutline, { className: "ndl-ai-preview-confirmation-action-icon" }), rejectedActionText] }))] })] })));
62
62
  };
63
63
  const PreviewCode = (_a) => {
64
64
  var { code, language, label, isLoading = false, headerActions, theme, heading, ref, style, className, htmlAttributes } = _a, restProps = __rest(_a, ["code", "language", "label", "isLoading", "headerActions", "theme", "heading", "ref", "style", "className", "htmlAttributes"]);
@@ -1 +1 @@
1
- {"version":3,"file":"Preview.js","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,eAAe,EAEf,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,EAEL,SAAS,EACT,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,WA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BAAmB,EAAE,EAChD,eAAe,EAAE,KAAK,YAErB,IAAI,GACa,GAChB,IACL,CACJ,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,cAAc,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACtB,QAAQ,EACR,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAc,OAE0B,EADrC,SAAS,cANU,2DAOvB,CADa;IAEZ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,SAAS,CAAC,IACtD,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACrD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n ClipboardButton,\n type CodeBlock,\n LoadingSpinner,\n StatusLabel,\n Typography,\n useNeedleTheme,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { TruncatedTextWithTooltip } from '../../_common/TruncatedTextWithTooltip';\nimport { type CommonProps } from '../../_common/types';\nimport {\n type LanguageProp,\n Languages,\n loadLanguage,\n} from '../../code-block/code-languages';\nimport ndlCodeDark from '../../code-block/themes/ndl-code-dark';\nimport ndlCodeLight from '../../code-block/themes/ndl-code-light';\nimport { CheckIconOutline } from '../../icons/generated/heroIcons/CheckIconOutline';\nimport { XMarkIconOutline } from '../../icons/generated/heroIcons/XMarkIconOutline';\n\ntype PreviewProps = {\n children: React.ReactNode;\n};\n\n/**\n * Component to use for previewing certain content in AI chat applications.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PreviewComponent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\ntype PreviewHeaderProps = {\n /** The content to display in the header. When a plain string is passed, it truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n children?: React.ReactNode;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n actions?: React.ReactNode;\n};\n\nconst PreviewHeader = ({\n children,\n actions,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewHeaderProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-header', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"code\"\n as=\"div\"\n className=\"ndl-ai-preview-header-leading-content\"\n >\n {typeof children === 'string' ? (\n <TruncatedTextWithTooltip text={children} />\n ) : (\n children\n )}\n </Typography>\n\n {actions && (\n <div className=\"ndl-ai-preview-header-actions\">{actions}</div>\n )}\n </div>\n );\n};\n\ntype PreviewConfirmationProps = {\n /** The content to display in the confirmation */\n children?: React.ReactNode;\n /** The actions to display in the confirmation, usually two buttons; one for confirming and one for rejecting. */\n actions: React.ReactNode;\n /** Whether the confirmation is used as a footer */\n isFooter?: boolean;\n /** The status of the confirmation */\n status?: 'pending' | 'confirmed' | 'rejected';\n /** The text to display for the confirmed status */\n confirmedActionText?: string;\n /** The text to display for the rejected status */\n rejectedActionText?: string;\n};\n\nconst PreviewConfirmation = ({\n children,\n actions,\n isFooter = false,\n status = 'pending',\n confirmedActionText = 'Action confirmed',\n rejectedActionText = 'Action rejected',\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewConfirmationProps>) => {\n const classes = classNames('ndl-ai-preview-confirmation', className, {\n 'ndl-ai-preview-confirmation-footer': isFooter,\n });\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {!(isFooter && status !== 'pending') && (\n <Typography\n as=\"div\"\n variant={isFooter ? 'subheading-small' : 'body-medium'}\n className=\"ndl-ai-preview-confirmation-content\"\n >\n {children}\n </Typography>\n )}\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-ai-preview-confirmation-actions\"\n >\n {status === 'pending' && actions}\n {status === 'confirmed' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <CheckIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {confirmedActionText}\n </div>\n )}\n {status === 'rejected' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <XMarkIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {rejectedActionText}\n </div>\n )}\n </Typography>\n </div>\n );\n};\n\ntype PreviewCodeProps = {\n /** The code content to display */\n code: string;\n /** The language of the code (e.g., 'cypher', 'python', 'javascript') */\n language: React.ComponentProps<typeof CodeBlock>['language'];\n /** The current state of the code block\n * @deprecated - The query should be described in the heading property instead.\n */\n label?: 'read' | 'write';\n /** Whether the code block is loading */\n isLoading?: boolean;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n headerActions?: React.ReactNode;\n /** The theme of the code block */\n theme?: 'ndl-code-dark' | 'ndl-code-light';\n /** The heading to display in the header. If not provided, the language will be displayed. Truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n heading?: string;\n};\n\nconst PreviewCode = ({\n code,\n language,\n label,\n isLoading = false,\n headerActions,\n theme,\n heading,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewCodeProps>) => {\n const [loadedLanguage, setLoadedLanguage] = useState<\n PreviewCodeProps['language'] | null\n >(null);\n const { theme: ndlTheme } = useNeedleTheme();\n\n useEffect(() => {\n if (!language || !(Languages as readonly string[]).includes(language)) {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language as LanguageProp)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n .catch((err) => console.error(err));\n }, [language]);\n\n const getTheme = () => {\n switch (theme) {\n case 'ndl-code-dark':\n return ndlCodeDark;\n case 'ndl-code-light':\n return ndlCodeLight;\n default:\n return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;\n }\n };\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-code', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {isLoading && (\n <div className=\"ndl-ai-preview-code-loading\">\n <LoadingSpinner size=\"medium\" />\n <Typography variant=\"code\">\n WRITING {language.toUpperCase()}\n </Typography>\n </div>\n )}\n {!isLoading && (\n <>\n <PreviewHeader\n className=\"ndl-ai-preview-code-header\"\n actions={\n <>\n <ClipboardButton\n textToCopy={code}\n type=\"clean-icon-button\"\n size=\"small\"\n />\n {headerActions}\n </>\n }\n >\n <TruncatedTextWithTooltip\n className=\"ndl-ai-preview-code-header-heading\"\n text={\n heading ??\n `${language}${language.toLowerCase() === 'cypher' ? ' QUERY' : ''}`\n }\n />\n {label && (\n <StatusLabel\n variant={label === 'write' ? 'warning' : 'info'}\n size=\"small\"\n fill=\"semi-filled\"\n >\n {label.toUpperCase()}\n </StatusLabel>\n )}\n </PreviewHeader>\n <div className=\"ndl-ai-preview-code-content\">\n <SyntaxHighlighter\n language={loadedLanguage ?? 'text'}\n style={{\n ...getTheme(),\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n overflowX: 'auto',\n padding: 'var(--space-12)',\n width: 'fit-content',\n },\n }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n codeTagProps={{ className: 'n-ai-preview-code' }}\n showLineNumbers={false}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </>\n )}\n </div>\n );\n};\n\ntype PreviewContentProps = {\n children?: React.ReactNode;\n};\n\nconst PreviewContent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewContentProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-content', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nexport const Preview = Object.assign(PreviewComponent, {\n Code: PreviewCode,\n Confirmation: PreviewConfirmation,\n Content: PreviewContent,\n Header: PreviewHeader,\n});\n"]}
1
+ {"version":3,"file":"Preview.js","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,eAAe,EAEf,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,OAAO,EAEL,SAAS,EACT,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,WAAW,MAAM,uCAA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AChD,eAAe,EAAE,KAAK,YAErB,IAAI,GACa,GAChB,IACL,CACJ,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,cAAc,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACtB,QAAQ,EACR,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAc,OAE0B,EADrC,SAAS,cANU,2DAOvB,CADa;IAEZ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,SAAS,CAAC,IACtD,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACrD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n ClipboardButton,\n type CodeBlock,\n LoadingSpinner,\n StatusLabel,\n Typography,\n useNeedleTheme,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { TruncatedTextWithTooltip } from '../../_common/TruncatedTextWithTooltip';\nimport { type CommonProps } from '../../_common/types';\nimport {\n type LanguageProp,\n Languages,\n loadLanguage,\n} from '../../code-block/code-languages';\nimport ndlCodeDark from '../../code-block/themes/ndl-code-dark';\nimport ndlCodeLight from '../../code-block/themes/ndl-code-light';\nimport { CheckIconOutline } from '../../icons/generated/heroIcons/CheckIconOutline';\nimport { XMarkIconOutline } from '../../icons/generated/heroIcons/XMarkIconOutline';\n\ntype PreviewProps = {\n children: React.ReactNode;\n};\n\n/**\n * Component to use for previewing certain content in AI chat applications.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst PreviewComponent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\ntype PreviewHeaderProps = {\n /** The content to display in the header. When a plain string is passed, it truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n children?: React.ReactNode;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n actions?: React.ReactNode;\n};\n\nconst PreviewHeader = ({\n children,\n actions,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewHeaderProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-header', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"code\"\n as=\"div\"\n className=\"ndl-ai-preview-header-leading-content\"\n >\n {typeof children === 'string' ? (\n <TruncatedTextWithTooltip text={children} />\n ) : (\n children\n )}\n </Typography>\n\n {actions && (\n <div className=\"ndl-ai-preview-header-actions\">{actions}</div>\n )}\n </div>\n );\n};\n\ntype PreviewConfirmationProps = {\n /** The content to display in the confirmation */\n children?: React.ReactNode;\n /** The actions to display in the confirmation, usually two buttons; one for confirming and one for rejecting. */\n actions: React.ReactNode;\n /** Whether the confirmation is used as a footer */\n isFooter?: boolean;\n /** The status of the confirmation */\n status?: 'pending' | 'confirmed' | 'rejected';\n /** The text to display for the confirmed status */\n confirmedActionText?: string;\n /** The text to display for the rejected status */\n rejectedActionText?: string;\n};\n\nconst PreviewConfirmation = ({\n children,\n actions,\n isFooter = false,\n status = 'pending',\n confirmedActionText = 'Action confirmed',\n rejectedActionText = 'Action rejected',\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewConfirmationProps>) => {\n const classes = classNames('ndl-ai-preview-confirmation', className, {\n 'ndl-ai-preview-confirmation-footer': isFooter,\n });\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {!(isFooter && status !== 'pending') && (\n <Typography\n as=\"div\"\n variant={isFooter ? 'subheading-medium' : 'body-medium'}\n className=\"ndl-ai-preview-confirmation-content\"\n >\n {children}\n </Typography>\n )}\n <Typography\n variant=\"body-medium\"\n as=\"div\"\n className=\"ndl-ai-preview-confirmation-actions\"\n >\n {status === 'pending' && actions}\n {status === 'confirmed' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <CheckIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {confirmedActionText}\n </div>\n )}\n {status === 'rejected' && (\n <div className=\"ndl-ai-preview-confirmation-confirm-reject\">\n <XMarkIconOutline className=\"ndl-ai-preview-confirmation-action-icon\" />\n {rejectedActionText}\n </div>\n )}\n </Typography>\n </div>\n );\n};\n\ntype PreviewCodeProps = {\n /** The code content to display */\n code: string;\n /** The language of the code (e.g., 'cypher', 'python', 'javascript') */\n language: React.ComponentProps<typeof CodeBlock>['language'];\n /** The current state of the code block\n * @deprecated - The query should be described in the heading property instead.\n */\n label?: 'read' | 'write';\n /** Whether the code block is loading */\n isLoading?: boolean;\n /** The actions to display in the header. Should be small buttons or icon buttons only. */\n headerActions?: React.ReactNode;\n /** The theme of the code block */\n theme?: 'ndl-code-dark' | 'ndl-code-light';\n /** The heading to display in the header. If not provided, the language will be displayed. Truncates with an ellipsis and shows a tooltip with the full text when space is limited. */\n heading?: string;\n};\n\nconst PreviewCode = ({\n code,\n language,\n label,\n isLoading = false,\n headerActions,\n theme,\n heading,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewCodeProps>) => {\n const [loadedLanguage, setLoadedLanguage] = useState<\n PreviewCodeProps['language'] | null\n >(null);\n const { theme: ndlTheme } = useNeedleTheme();\n\n useEffect(() => {\n if (!language || !(Languages as readonly string[]).includes(language)) {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language as LanguageProp)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n .catch((err) => console.error(err));\n }, [language]);\n\n const getTheme = () => {\n switch (theme) {\n case 'ndl-code-dark':\n return ndlCodeDark;\n case 'ndl-code-light':\n return ndlCodeLight;\n default:\n return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;\n }\n };\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-code', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {isLoading && (\n <div className=\"ndl-ai-preview-code-loading\">\n <LoadingSpinner size=\"medium\" />\n <Typography variant=\"code\">\n WRITING {language.toUpperCase()}\n </Typography>\n </div>\n )}\n {!isLoading && (\n <>\n <PreviewHeader\n className=\"ndl-ai-preview-code-header\"\n actions={\n <>\n <ClipboardButton\n textToCopy={code}\n type=\"clean-icon-button\"\n size=\"small\"\n />\n {headerActions}\n </>\n }\n >\n <TruncatedTextWithTooltip\n className=\"ndl-ai-preview-code-header-heading\"\n text={\n heading ??\n `${language}${language.toLowerCase() === 'cypher' ? ' QUERY' : ''}`\n }\n />\n {label && (\n <StatusLabel\n variant={label === 'write' ? 'warning' : 'info'}\n size=\"small\"\n fill=\"semi-filled\"\n >\n {label.toUpperCase()}\n </StatusLabel>\n )}\n </PreviewHeader>\n <div className=\"ndl-ai-preview-code-content\">\n <SyntaxHighlighter\n language={loadedLanguage ?? 'text'}\n style={{\n ...getTheme(),\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n overflowX: 'auto',\n padding: 'var(--space-12)',\n width: 'fit-content',\n },\n }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n codeTagProps={{ className: 'n-ai-preview-code' }}\n showLineNumbers={false}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </>\n )}\n </div>\n );\n};\n\ntype PreviewContentProps = {\n children?: React.ReactNode;\n};\n\nconst PreviewContent = ({\n children,\n ref,\n style,\n className,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', PreviewContentProps>) => {\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-preview-content', className)}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nexport const Preview = Object.assign(PreviewComponent, {\n Code: PreviewCode,\n Confirmation: PreviewConfirmation,\n Content: PreviewContent,\n Header: PreviewHeader,\n});\n"]}
@@ -50,7 +50,7 @@ const ReasoningComponent = (_a) => {
50
50
  const buttonId = useId();
51
51
  const panelId = useId();
52
52
  const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);
53
- return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [_jsx(Typography, Object.assign({ variant: "label", className: classNames('ndl-ai-reasoning-header', {
53
+ return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [_jsx(Typography, Object.assign({ variant: "title-3", className: classNames('ndl-ai-reasoning-header', {
54
54
  'ndl-expanded': isExpanded,
55
55
  }) }, (!isThinking
56
56
  ? {
@@ -72,7 +72,7 @@ const ReasoningComponent = (_a) => {
72
72
  const Section = (_a) => {
73
73
  var { heading, leadingVisual, children, className, style, htmlAttributes, ref, isExpanded: _isExpanded, isDefaultExpanded: _isDefaultExpanded, onExpandChange: _onExpandChange } = _a, restProps = __rest(_a, ["heading", "leadingVisual", "children", "className", "style", "htmlAttributes", "ref", "isExpanded", "isDefaultExpanded", "onExpandChange"]);
74
74
  const classes = classNames('ndl-ai-reasoning-section', className);
75
- return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [_jsxs("div", { className: "ndl-ai-reasoning-section-header", children: [_jsx("div", { className: "ndl-ai-reasoning-section-leading", children: leadingVisual }), _jsx(Typography, { variant: "subheading-small", children: heading })] }), _jsxs("div", { className: "ndl-ai-reasoning-section-content", children: [_jsx("div", { className: "ndl-ai-reasoning-section-content-line-container", children: _jsx("div", { className: "ndl-ai-reasoning-section-content-line" }) }), _jsx("div", { className: "ndl-ai-reasoning-section-content-children", children: children })] })] })));
75
+ return (_jsxs("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: [_jsxs("div", { className: "ndl-ai-reasoning-section-header", children: [_jsx("div", { className: "ndl-ai-reasoning-section-leading", children: leadingVisual }), _jsx(Typography, { variant: "subheading-medium", children: heading })] }), _jsxs("div", { className: "ndl-ai-reasoning-section-content", children: [_jsx("div", { className: "ndl-ai-reasoning-section-content-line-container", children: _jsx("div", { className: "ndl-ai-reasoning-section-content-line" }) }), _jsx("div", { className: "ndl-ai-reasoning-section-content-children", children: children })] })] })));
76
76
  };
77
77
  const Footer = (_a) => {
78
78
  var { children, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "htmlAttributes", "ref"]);
@@ -1 +1 @@
1
- {"version":3,"file":"Reasoning.js","sourceRoot":"","sources":["../../../../src/ai/reasoning/Reasoning.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EA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BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAElB,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cAAK,SAAS,EAAC,kCAAkC,YAAE,aAAa,GAAO,EACvE,KAAC,UAAU,IAAC,OAAO,EAAC,kBAAkB,YAAE,OAAO,GAAc,IACzD,EACN,eAAK,SAAS,EAAC,kCAAkC,aAC/C,cAAK,SAAS,EAAC,iDAAiD,YAC9D,cAAK,SAAS,EAAC,uCAAuC,GAAG,GACrD,EACN,cAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,IACF,KACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EAOoC,EAAE,EAAE;QAPxC,EACd,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAE+C,EAD/C,SAAS,cANE,2DAOf,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;IACjE,OAAO,CACL,KAAC,UAAU,kBACT,EAAE,EAAC,KAAK,EACR,OAAO,EAAC,YAAY,EACpB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAEjB,QAAQ,IACE,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Typography } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useId, useState } from 'react';\n\nimport { type CommonProps } from '../../_common/types';\nimport { ChevronDownIconOutline } from '../../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from '../thinking/thinking-duration-formatter';\n\ntype ReasoningProps = {\n /** What should be displayed inside the reasoning component. */\n children?: React.ReactNode;\n /** Whether the AI is thinking */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n /** The current action the AI is performing */\n currentAction?: string;\n};\n\n/**\n * The component is used to display the reasoning state of an LLM.\n * It has an accordion like behavior to show the reasoning steps.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ReasoningComponent = ({\n isThinking = true,\n thinkingMs = 1000,\n currentAction = 'Thinking',\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ReasoningProps>) => {\n const classes = classNames('ndl-ai-reasoning', className);\n const [isExpanded, setIsExpanded] = useState(false);\n const shouldShowChildren = isExpanded && isThinking === false;\n const buttonId = useId();\n const panelId = useId();\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"label\"\n className={classNames('ndl-ai-reasoning-header', {\n 'ndl-expanded': isExpanded,\n })}\n {...(!isThinking\n ? {\n as: 'button',\n htmlAttributes: {\n 'aria-controls': panelId,\n 'aria-expanded': isExpanded,\n id: buttonId,\n onClick: () => setIsExpanded(!isExpanded),\n type: 'button',\n },\n }\n : { as: 'div', htmlAttributes: { id: buttonId } })}\n >\n {isThinking === true ? (\n <>\n <Presence\n isThinking={isThinking}\n className=\"ndl-ai-reasoning-presence\"\n />\n <span className=\"ndl-ai-reasoning-header-text\">\n {currentAction}...\n </span>\n </>\n ) : (\n <>\n <span>\n Thought for {thinkingDuration} {unit}\n </span>\n <ChevronDownIconOutline\n className={classNames('ndl-ai-reasoning-chevron', {\n 'ndl-expanded': isExpanded,\n })}\n />\n </>\n )}\n </Typography>\n <div\n className={classNames('ndl-ai-reasoning-content', {\n 'ndl-expanded': shouldShowChildren,\n })}\n inert={!shouldShowChildren}\n aria-hidden={!shouldShowChildren}\n aria-labelledby={buttonId}\n role=\"region\"\n id={panelId}\n >\n <div className=\"ndl-ai-reasoning-content-inner\">\n <div className=\"ndl-ai-reasoning-content-inner-2\">{children}</div>\n </div>\n </div>\n </div>\n );\n};\n\ntype SectionProps = {\n /** The heading of the section */\n heading?: React.ReactNode;\n /** The children of the section */\n children?: React.ReactNode;\n /** The visual leading the section */\n leadingVisual?: React.ReactNode;\n // TODO v5: remove this prop\n /** Whether the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n isExpanded?: boolean;\n // TODO v5: remove this prop\n /** The default value of the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n isDefaultExpanded?: boolean;\n // TODO v5: remove this prop\n /** Callback function triggered when the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n onExpandChange?: (isExpanded: boolean) => void;\n};\n\nconst Section = ({\n heading,\n leadingVisual,\n children,\n className,\n style,\n htmlAttributes,\n ref,\n isExpanded: _isExpanded,\n isDefaultExpanded: _isDefaultExpanded,\n onExpandChange: _onExpandChange,\n ...restProps\n}: CommonProps<'div', SectionProps>) => {\n const classes = classNames('ndl-ai-reasoning-section', className);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-reasoning-section-header\">\n <div className=\"ndl-ai-reasoning-section-leading\">{leadingVisual}</div>\n <Typography variant=\"subheading-small\">{heading}</Typography>\n </div>\n <div className=\"ndl-ai-reasoning-section-content\">\n <div className=\"ndl-ai-reasoning-section-content-line-container\">\n <div className=\"ndl-ai-reasoning-section-content-line\" />\n </div>\n <div className=\"ndl-ai-reasoning-section-content-children\">\n {children}\n </div>\n </div>\n </div>\n );\n};\n\nconst Footer = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-ai-reasoning-footer', className);\n return (\n <Typography\n as=\"div\"\n variant=\"body-small\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n};\n\nconst Reasoning = Object.assign(ReasoningComponent, {\n Footer,\n Section,\n});\n\nexport { Reasoning };\n"]}
1
+ {"version":3,"file":"Reasoning.js","sourceRoot":"","sources":["../../../../src/ai/reasoning/Reasoning.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAajF;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,EAUS,EAAE,EAAE;QAVb,EAC1B,UAAU,GAAG,IAAI,EACjB,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,UAAU,EAC1B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEgC,EADhC,SAAS,cATc,wGAU3B,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAA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E,EAAE;QAPxC,EACd,QAAQ,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAE+C,EAD/C,SAAS,cANE,2DAOf,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;IACjE,OAAO,CACL,KAAC,UAAU,kBACT,EAAE,EAAC,KAAK,EACR,OAAO,EAAC,YAAY,EACpB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAEjB,QAAQ,IACE,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IAClD,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Typography } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { useId, useState } from 'react';\n\nimport { type CommonProps } from '../../_common/types';\nimport { ChevronDownIconOutline } from '../../icons/generated/heroIcons/ChevronDownIconOutline';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from '../thinking/thinking-duration-formatter';\n\ntype ReasoningProps = {\n /** What should be displayed inside the reasoning component. */\n children?: React.ReactNode;\n /** Whether the AI is thinking */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n /** The current action the AI is performing */\n currentAction?: string;\n};\n\n/**\n * The component is used to display the reasoning state of an LLM.\n * It has an accordion like behavior to show the reasoning steps.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst ReasoningComponent = ({\n isThinking = true,\n thinkingMs = 1000,\n currentAction = 'Thinking',\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ReasoningProps>) => {\n const classes = classNames('ndl-ai-reasoning', className);\n const [isExpanded, setIsExpanded] = useState(false);\n const shouldShowChildren = isExpanded && isThinking === false;\n const buttonId = useId();\n const panelId = useId();\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <Typography\n variant=\"title-3\"\n className={classNames('ndl-ai-reasoning-header', {\n 'ndl-expanded': isExpanded,\n })}\n {...(!isThinking\n ? {\n as: 'button',\n htmlAttributes: {\n 'aria-controls': panelId,\n 'aria-expanded': isExpanded,\n id: buttonId,\n onClick: () => setIsExpanded(!isExpanded),\n type: 'button',\n },\n }\n : { as: 'div', htmlAttributes: { id: buttonId } })}\n >\n {isThinking === true ? (\n <>\n <Presence\n isThinking={isThinking}\n className=\"ndl-ai-reasoning-presence\"\n />\n <span className=\"ndl-ai-reasoning-header-text\">\n {currentAction}...\n </span>\n </>\n ) : (\n <>\n <span>\n Thought for {thinkingDuration} {unit}\n </span>\n <ChevronDownIconOutline\n className={classNames('ndl-ai-reasoning-chevron', {\n 'ndl-expanded': isExpanded,\n })}\n />\n </>\n )}\n </Typography>\n <div\n className={classNames('ndl-ai-reasoning-content', {\n 'ndl-expanded': shouldShowChildren,\n })}\n inert={!shouldShowChildren}\n aria-hidden={!shouldShowChildren}\n aria-labelledby={buttonId}\n role=\"region\"\n id={panelId}\n >\n <div className=\"ndl-ai-reasoning-content-inner\">\n <div className=\"ndl-ai-reasoning-content-inner-2\">{children}</div>\n </div>\n </div>\n </div>\n );\n};\n\ntype SectionProps = {\n /** The heading of the section */\n heading?: React.ReactNode;\n /** The children of the section */\n children?: React.ReactNode;\n /** The visual leading the section */\n leadingVisual?: React.ReactNode;\n // TODO v5: remove this prop\n /** Whether the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n isExpanded?: boolean;\n // TODO v5: remove this prop\n /** The default value of the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n isDefaultExpanded?: boolean;\n // TODO v5: remove this prop\n /** Callback function triggered when the section is expanded.\n * @deprecated - Does nothing, will be removed in v5 */\n onExpandChange?: (isExpanded: boolean) => void;\n};\n\nconst Section = ({\n heading,\n leadingVisual,\n children,\n className,\n style,\n htmlAttributes,\n ref,\n isExpanded: _isExpanded,\n isDefaultExpanded: _isDefaultExpanded,\n onExpandChange: _onExpandChange,\n ...restProps\n}: CommonProps<'div', SectionProps>) => {\n const classes = classNames('ndl-ai-reasoning-section', className);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-ai-reasoning-section-header\">\n <div className=\"ndl-ai-reasoning-section-leading\">{leadingVisual}</div>\n <Typography variant=\"subheading-medium\">{heading}</Typography>\n </div>\n <div className=\"ndl-ai-reasoning-section-content\">\n <div className=\"ndl-ai-reasoning-section-content-line-container\">\n <div className=\"ndl-ai-reasoning-section-content-line\" />\n </div>\n <div className=\"ndl-ai-reasoning-section-content-children\">\n {children}\n </div>\n </div>\n </div>\n );\n};\n\nconst Footer = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-ai-reasoning-footer', className);\n return (\n <Typography\n as=\"div\"\n variant=\"body-small\"\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n};\n\nconst Reasoning = Object.assign(ReasoningComponent, {\n Footer,\n Section,\n});\n\nexport { Reasoning };\n"]}
@@ -44,7 +44,7 @@ const Thinking = (_a) => {
44
44
  var { className, isThinking = true, style, htmlAttributes, ref, thinkingMs = 1000 } = _a, restProps = __rest(_a, ["className", "isThinking", "style", "htmlAttributes", "ref", "thinkingMs"]);
45
45
  const classes = classNames('n-flex n-flex-col n-items-start n-gap-token-12', className);
46
46
  const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);
47
- return (_jsx("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: isThinking === true ? (_jsxs(_Fragment, { children: [_jsx(Presence, { isThinking: isThinking, className: "n-size-token-32" }), _jsx("span", { className: "n-subheading-small n-text-neutral-text-default", children: "Thinking" })] })) : (_jsxs("span", { className: "n-subheading-small n-text-neutral-text-weak", children: ["Thought", ' ', _jsxs("span", { className: "n-font-normal", children: ["for ", thinkingDuration, " ", unit] })] })) })));
47
+ return (_jsx("div", Object.assign({ ref: ref, className: classes, style: style }, restProps, htmlAttributes, { children: isThinking === true ? (_jsxs(_Fragment, { children: [_jsx(Presence, { isThinking: isThinking, className: "n-size-token-32" }), _jsx("span", { className: "n-subheading-medium n-text-neutral-text-default", children: "Thinking" })] })) : (_jsxs("span", { className: "n-subheading-medium n-text-neutral-text-weak", children: ["Thought", ' ', _jsxs("span", { className: "n-font-normal", children: ["for ", thinkingDuration, " ", unit] })] })) })));
48
48
  };
49
49
  export { Thinking };
50
50
  //# sourceMappingURL=Thinking.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Thinking.js","sourceRoot":"","sources":["../../../../src/ai/thinking/Thinking.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAYvE;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQkB,EAAE,EAAE;QARtB,EAChB,SAAS,EACT,UAAU,GAAG,IAAI,EACjB,KAAK,EACL,cAAc,EACd,GAAG,EACH,UAAU,GAAG,IAAI,OAEiB,EAD/B,SAAS,cAPI,2EAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,gDAAgD,EAChD,SAAS,CACV,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CACrB,8BACE,KAAC,QAAQ,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,iBAAiB,GAAG,EAChE,eAAM,SAAS,EAAC,gDAAgD,yBAEzD,IACN,CACJ,CAAC,CAAC,CAAC,CACF,gBAAM,SAAS,EAAC,6CAA6C,wBACnD,GAAG,EACX,gBAAM,SAAS,EAAC,eAAe,qBACxB,gBAAgB,OAAG,IAAI,IACvB,IACF,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\n\nimport type { CommonProps } from '../../_common/types';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from './thinking-duration-formatter';\n\ntype ThinkingProps = {\n /** Whether the AI is thinking.\n * If true, will render a thinking presence icon and the text \"Thinking\".\n * If false, will render the duration of the thinking.\n */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n};\n\n/**\n * The component is used to display the thinking state of an LLM.\n * If the `isThinking` prop is true, it will render a thinking presence icon and the text \"Thinking\".\n * If the `isThinking` prop is false, it will render the duration of the thinking.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Thinking = ({\n className,\n isThinking = true,\n style,\n htmlAttributes,\n ref,\n thinkingMs = 1000,\n ...restProps\n}: CommonProps<'div', ThinkingProps>) => {\n const classes = classNames(\n 'n-flex n-flex-col n-items-start n-gap-token-12',\n className,\n );\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-32\" />\n <span className=\"n-subheading-small n-text-neutral-text-default\">\n Thinking\n </span>\n </>\n ) : (\n <span className=\"n-subheading-small n-text-neutral-text-weak\">\n Thought{' '}\n <span className=\"n-font-normal\">\n for {thinkingDuration} {unit}\n </span>\n </span>\n )}\n </div>\n );\n};\n\nexport { Thinking };\n"]}
1
+ {"version":3,"file":"Thinking.js","sourceRoot":"","sources":["../../../../src/ai/thinking/Thinking.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAYvE;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CAAC,EAQkB,EAAE,EAAE;QARtB,EAChB,SAAS,EACT,UAAU,GAAG,IAAI,EACjB,KAAK,EACL,cAAc,EACd,GAAG,EACH,UAAU,GAAG,IAAI,OAEiB,EAD/B,SAAS,cAPI,2EAQjB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CACxB,gDAAgD,EAChD,SAAS,CACV,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAE7E,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CACrB,8BACE,KAAC,QAAQ,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,iBAAiB,GAAG,EAChE,eAAM,SAAS,EAAC,iDAAiD,yBAE1D,IACN,CACJ,CAAC,CAAC,CAAC,CACF,gBAAM,SAAS,EAAC,8CAA8C,wBACpD,GAAG,EACX,gBAAM,SAAS,EAAC,eAAe,qBACxB,gBAAgB,OAAG,IAAI,IACvB,IACF,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\n\nimport type { CommonProps } from '../../_common/types';\nimport { Presence } from '../presence';\nimport { formatThinkingDuration } from './thinking-duration-formatter';\n\ntype ThinkingProps = {\n /** Whether the AI is thinking.\n * If true, will render a thinking presence icon and the text \"Thinking\".\n * If false, will render the duration of the thinking.\n */\n isThinking?: boolean;\n /** The duration of the thinking in milliseconds */\n thinkingMs?: number;\n};\n\n/**\n * The component is used to display the thinking state of an LLM.\n * If the `isThinking` prop is true, it will render a thinking presence icon and the text \"Thinking\".\n * If the `isThinking` prop is false, it will render the duration of the thinking.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Thinking = ({\n className,\n isThinking = true,\n style,\n htmlAttributes,\n ref,\n thinkingMs = 1000,\n ...restProps\n}: CommonProps<'div', ThinkingProps>) => {\n const classes = classNames(\n 'n-flex n-flex-col n-items-start n-gap-token-12',\n className,\n );\n\n const { value: thinkingDuration, unit } = formatThinkingDuration(thinkingMs);\n\n return (\n <div\n ref={ref}\n className={classes}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {isThinking === true ? (\n <>\n <Presence isThinking={isThinking} className=\"n-size-token-32\" />\n <span className=\"n-subheading-medium n-text-neutral-text-default\">\n Thinking\n </span>\n </>\n ) : (\n <span className=\"n-subheading-medium n-text-neutral-text-weak\">\n Thought{' '}\n <span className=\"n-font-normal\">\n for {thinkingDuration} {unit}\n </span>\n </span>\n )}\n </div>\n );\n};\n\nexport { Thinking };\n"]}
@@ -86,7 +86,7 @@ export const Avatar = (_a) => {
86
86
  const renderImageType = () => (_jsxs(_Fragment, { children: [_jsx("img", { "data-testid": "ndl-avatar-image", src: source, alt: name }), _jsx("div", { "data-testid": "ndl-avatar-image-overlay", className: `${shapeClasses} ndl-avatar-image-overlay` })] }));
87
87
  const renderIconType = () => _jsx(_Fragment, { children: icon !== null && icon !== void 0 ? icon : _jsx(UserIconOutline, {}) });
88
88
  const renderLettersType = () => {
89
- return (_jsx(Typography, { variant: "subheading-small", className: "ndl-avatar-typography", children: getLettersDisplay(name !== null && name !== void 0 ? name : '') }));
89
+ return (_jsx(Typography, { variant: "subheading-medium", className: "ndl-avatar-typography", children: getLettersDisplay(name !== null && name !== void 0 ? name : '') }));
90
90
  };
91
91
  const TypeComponent = type === 'image'
92
92
  ? renderImageType()
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,CAAC;gBACX,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,KAAK,OAAO,CAAC;QACb,KAAK,SAAS,CAAC;QACf;YACE,OAAO;gBACL,OAAO,EAAE,CAAC;gBACV,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,CAAC;aACV,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,IAAI,EACJ,MAAM,GAIP;IACC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,uCAAuC,MAAM,EAAE,CAAC;IAEtE,OAAO,CACL,cACE,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EACvD,IAAI,EAAC,cAAc,YAEnB,eACE,KAAK,EAAC,4BAA4B,E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,KAAK,MAAM;YACf,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;gBACnC,CAAC,CAAC,iBAAiB,EAAE;gBACrB,CAAC,CAAC,IAAI,CAAC;IAEf,MAAM,wBAAwB,GAC5B,SAAS,IAAI,CAAC,UAAU,IAAI,MAAM,KAAK,SAAS,CAAC;IAEnD,OAAO,CACL,MAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,iBACC,CAAC,QAAQ,IAClB,CAAC,QAAQ,IAAI;QACf,QAAQ,EAAE,UAAU;KACrB,CAAC,kBACU,UAAU,IAAI,EAAE,IACxB,SAAS,EACT,cAAc,eAElB,cAAK,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,YAAG,aAAa,GAAO,EACzE,wBAAwB,IAAI,CAC3B,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { UserIconOutline } from '../icons/generated/heroIcons/UserIconOutline';\nimport { Typography } from '../typography';\n\ntype SizeType = AvatarProps['size'];\ntype StatusType = NonNullable<AvatarProps['status']>;\n\ninterface CircleProperties {\n /** Center coordinates of the circles */\n cxAndCy: number;\n /** Diameter of the circles */\n diameter: number;\n /** Radius of the inner circle */\n rInner: number;\n /** Radius of the outer circle */\n rOuter: number;\n}\n\nfunction circleSizeFactory(size: SizeType): CircleProperties {\n switch (size) {\n case 'x-small':\n case 'small':\n case 'medium':\n return {\n cxAndCy: 4.5,\n diameter: 9,\n rInner: 3,\n rOuter: 4.5,\n };\n case 'large':\n case 'x-large':\n default:\n return {\n cxAndCy: 6,\n diameter: 12,\n rInner: 4,\n rOuter: 6,\n };\n }\n}\n\nfunction StatusIndicator({\n size,\n status,\n}: {\n size: SizeType;\n status: StatusType;\n}) {\n const { cxAndCy, diameter, rInner, rOuter } = circleSizeFactory(size);\n const statusClasses = `ndl-avatar-status ndl-avatar-status-${status}`;\n\n return (\n <div\n className={statusClasses}\n title={status.charAt(0).toUpperCase() + status.slice(1)}\n role=\"presentation\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height={diameter}\n width={diameter}\n viewBox={`0 0 ${diameter} ${diameter}`}\n fill=\"none\"\n >\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={rOuter}\n className=\"ndl-avatar-status-circle-outer\"\n />\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={status === 'unknown' ? rInner - 1 : rInner}\n className=\"ndl-avatar-status-circle-inner\"\n />\n </svg>\n </div>\n );\n}\n\ntype AvatarProps = {\n /** Whether to display a status indicator */\n hasStatus?: boolean;\n /** Whether the avatar is disabled. When disabled, status indicators are hidden and `onClick` handlers are disabled when cast as a button */\n isDisabled?: boolean;\n /** The name associated with the avatar. Used for alt text and aria-label. For letters type, this text is displayed */\n name?: string;\n /** The shape of the avatar */\n shape?: 'circle' | 'square';\n /** The size of the avatar */\n size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';\n /** Source URI for the image. When provided with `type=\"image`\", displays the image */\n source?: string;\n /** The status to display. Only shown when `hasStatus` is `true` and component is not disabled */\n status?: 'offline' | 'online' | 'unknown';\n /** The type of avatar content. If `type=\"image\"` and no source is provided, automatically falls back to `icon` */\n type?: 'icon' | 'image' | 'letters';\n /** Custom icon to display when `type` is `\"icon\"`. Defaults to `UserIconOutline` */\n icon?: React.ReactNode;\n} & (\n | {\n as: 'button';\n onClick: () => void;\n }\n | {\n as?: React.ElementType;\n }\n);\n\nconst getLettersDisplay = (displayName: string) => {\n const words = displayName.trim().split(/\\s+/).filter(Boolean);\n if (words.length <= 1) {\n return displayName.trim();\n }\n return words\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n};\n\nexport const Avatar = <T extends React.ElementType = 'div'>({\n as,\n hasStatus = false,\n icon,\n isDisabled = false,\n name,\n shape = 'circle',\n size = 'medium',\n source,\n status,\n type: initialType = 'image',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, AvatarProps>) => {\n // If source is not provided, fallback to icon\n const type =\n initialType === 'image' && (source === undefined || source === '')\n ? 'icon'\n : initialType;\n\n const Component: React.ElementType = as ?? 'div';\n const isButton = Component === 'button';\n const classes = classNames(\n `ndl-avatar ndl-avatar-${shape} ndl-avatar-${size}`,\n className,\n );\n const shapeClasses = classNames(\n `ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`,\n {\n 'ndl-avatar-disabled': isDisabled,\n },\n );\n\n const typeClass = `ndl-avatar-${type}`;\n\n const renderImageType = () => (\n <>\n <img data-testid=\"ndl-avatar-image\" src={source} alt={name} />\n <div\n data-testid=\"ndl-avatar-image-overlay\"\n className={`${shapeClasses} ndl-avatar-image-overlay`}\n />\n </>\n );\n\n const renderIconType = () => <>{icon ?? <UserIconOutline />}</>;\n\n const renderLettersType = () => {\n return (\n <Typography variant=\"subheading-small\" className=\"ndl-avatar-typography\">\n {getLettersDisplay(name ?? '')}\n </Typography>\n );\n };\n\n const TypeComponent =\n type === 'image'\n ? renderImageType()\n : type === 'icon'\n ? renderIconType()\n : type === 'letters' && Boolean(name)\n ? renderLettersType()\n : null;\n\n const isStatusIndicatorVisible =\n hasStatus && !isDisabled && status !== undefined;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n aria-hidden={!isButton}\n {...(isButton && {\n disabled: isDisabled,\n })}\n aria-label={`Avatar ${name}`}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={classNames(shapeClasses, typeClass)}>{TypeComponent}</div>\n {isStatusIndicatorVisible && (\n <StatusIndicator size={size} status={status} />\n )}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,CAAC;gBACX,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,KAAK,OAAO,CAAC;QACb,KAAK,SAAS,CAAC;QACf;YACE,OAAO;gBACL,OAAO,EAAE,CAAC;gBACV,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,CAAC;aACV,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,IAAI,EACJ,MAAM,GAIP;IACC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,uCAA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mBAAmB,EAAC,SAAS,EAAC,uBAAuB,YACtE,iBAAiB,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,GACnB,CACd,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,aAAa,GACjB,IAAI,KAAK,OAAO;QACd,CAAC,CAAC,eAAe,EAAE;QACnB,CAAC,CAAC,IAAI,KAAK,MAAM;YACf,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;gBACnC,CAAC,CAAC,iBAAiB,EAAE;gBACrB,CAAC,CAAC,IAAI,CAAC;IAEf,MAAM,wBAAwB,GAC5B,SAAS,IAAI,CAAC,UAAU,IAAI,MAAM,KAAK,SAAS,CAAC;IAEnD,OAAO,CACL,MAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,iBACC,CAAC,QAAQ,IAClB,CAAC,QAAQ,IAAI;QACf,QAAQ,EAAE,UAAU;KACrB,CAAC,kBACU,UAAU,IAAI,EAAE,IACxB,SAAS,EACT,cAAc,eAElB,cAAK,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,YAAG,aAAa,GAAO,EACzE,wBAAwB,IAAI,CAC3B,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { UserIconOutline } from '../icons/generated/heroIcons/UserIconOutline';\nimport { Typography } from '../typography';\n\ntype SizeType = AvatarProps['size'];\ntype StatusType = NonNullable<AvatarProps['status']>;\n\ninterface CircleProperties {\n /** Center coordinates of the circles */\n cxAndCy: number;\n /** Diameter of the circles */\n diameter: number;\n /** Radius of the inner circle */\n rInner: number;\n /** Radius of the outer circle */\n rOuter: number;\n}\n\nfunction circleSizeFactory(size: SizeType): CircleProperties {\n switch (size) {\n case 'x-small':\n case 'small':\n case 'medium':\n return {\n cxAndCy: 4.5,\n diameter: 9,\n rInner: 3,\n rOuter: 4.5,\n };\n case 'large':\n case 'x-large':\n default:\n return {\n cxAndCy: 6,\n diameter: 12,\n rInner: 4,\n rOuter: 6,\n };\n }\n}\n\nfunction StatusIndicator({\n size,\n status,\n}: {\n size: SizeType;\n status: StatusType;\n}) {\n const { cxAndCy, diameter, rInner, rOuter } = circleSizeFactory(size);\n const statusClasses = `ndl-avatar-status ndl-avatar-status-${status}`;\n\n return (\n <div\n className={statusClasses}\n title={status.charAt(0).toUpperCase() + status.slice(1)}\n role=\"presentation\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height={diameter}\n width={diameter}\n viewBox={`0 0 ${diameter} ${diameter}`}\n fill=\"none\"\n >\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={rOuter}\n className=\"ndl-avatar-status-circle-outer\"\n />\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={status === 'unknown' ? rInner - 1 : rInner}\n className=\"ndl-avatar-status-circle-inner\"\n />\n </svg>\n </div>\n );\n}\n\ntype AvatarProps = {\n /** Whether to display a status indicator */\n hasStatus?: boolean;\n /** Whether the avatar is disabled. When disabled, status indicators are hidden and `onClick` handlers are disabled when cast as a button */\n isDisabled?: boolean;\n /** The name associated with the avatar. Used for alt text and aria-label. For letters type, this text is displayed */\n name?: string;\n /** The shape of the avatar */\n shape?: 'circle' | 'square';\n /** The size of the avatar */\n size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';\n /** Source URI for the image. When provided with `type=\"image`\", displays the image */\n source?: string;\n /** The status to display. Only shown when `hasStatus` is `true` and component is not disabled */\n status?: 'offline' | 'online' | 'unknown';\n /** The type of avatar content. If `type=\"image\"` and no source is provided, automatically falls back to `icon` */\n type?: 'icon' | 'image' | 'letters';\n /** Custom icon to display when `type` is `\"icon\"`. Defaults to `UserIconOutline` */\n icon?: React.ReactNode;\n} & (\n | {\n as: 'button';\n onClick: () => void;\n }\n | {\n as?: React.ElementType;\n }\n);\n\nconst getLettersDisplay = (displayName: string) => {\n const words = displayName.trim().split(/\\s+/).filter(Boolean);\n if (words.length <= 1) {\n return displayName.trim();\n }\n return words\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n};\n\nexport const Avatar = <T extends React.ElementType = 'div'>({\n as,\n hasStatus = false,\n icon,\n isDisabled = false,\n name,\n shape = 'circle',\n size = 'medium',\n source,\n status,\n type: initialType = 'image',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, AvatarProps>) => {\n // If source is not provided, fallback to icon\n const type =\n initialType === 'image' && (source === undefined || source === '')\n ? 'icon'\n : initialType;\n\n const Component: React.ElementType = as ?? 'div';\n const isButton = Component === 'button';\n const classes = classNames(\n `ndl-avatar ndl-avatar-${shape} ndl-avatar-${size}`,\n className,\n );\n const shapeClasses = classNames(\n `ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`,\n {\n 'ndl-avatar-disabled': isDisabled,\n },\n );\n\n const typeClass = `ndl-avatar-${type}`;\n\n const renderImageType = () => (\n <>\n <img data-testid=\"ndl-avatar-image\" src={source} alt={name} />\n <div\n data-testid=\"ndl-avatar-image-overlay\"\n className={`${shapeClasses} ndl-avatar-image-overlay`}\n />\n </>\n );\n\n const renderIconType = () => <>{icon ?? <UserIconOutline />}</>;\n\n const renderLettersType = () => {\n return (\n <Typography variant=\"subheading-medium\" className=\"ndl-avatar-typography\">\n {getLettersDisplay(name ?? '')}\n </Typography>\n );\n };\n\n const TypeComponent =\n type === 'image'\n ? renderImageType()\n : type === 'icon'\n ? renderIconType()\n : type === 'letters' && Boolean(name)\n ? renderLettersType()\n : null;\n\n const isStatusIndicatorVisible =\n hasStatus && !isDisabled && status !== undefined;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n aria-hidden={!isButton}\n {...(isButton && {\n disabled: isDisabled,\n })}\n aria-label={`Avatar ${name}`}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={classNames(shapeClasses, typeClass)}>{TypeComponent}</div>\n {isStatusIndicatorVisible && (\n <StatusIndicator size={size} status={status} />\n )}\n </Component>\n );\n};\n"]}
@@ -61,7 +61,7 @@ const StatusIcon = ({ variant }) => {
61
61
  const BannerHeader = (_a) => {
62
62
  var { children, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "htmlAttributes", "ref"]);
63
63
  const classes = classNames('ndl-banner-header', className);
64
- return (_jsx(Typography, Object.assign({ as: "span", variant: "title-4", className: classes, style: style, ref: ref, htmlAttributes: htmlAttributes }, restProps, { children: children })));
64
+ return (_jsx(Typography, Object.assign({ as: "span", variant: "title-3", className: classes, style: style, ref: ref, htmlAttributes: htmlAttributes }, restProps, { children: children })));
65
65
  };
66
66
  const BannerDescription = (_a) => {
67
67
  var { children, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "htmlAttributes", "ref"]);