@neo4j-ndl/react 4.5.10 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/lib/cjs/ai/code-preview/CodePreview.js +2 -1
  2. package/lib/cjs/ai/code-preview/CodePreview.js.map +1 -1
  3. package/lib/cjs/ai/index.js +3 -1
  4. package/lib/cjs/ai/index.js.map +1 -1
  5. package/lib/cjs/ai/preview/Preview.js +111 -0
  6. package/lib/cjs/ai/preview/Preview.js.map +1 -0
  7. package/lib/cjs/ai/preview/index.js +38 -0
  8. package/lib/cjs/ai/preview/index.js.map +1 -0
  9. package/lib/cjs/ai/preview/stories/index.js +56 -0
  10. package/lib/cjs/ai/preview/stories/index.js.map +1 -0
  11. package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js +36 -0
  12. package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js.map +1 -0
  13. package/lib/cjs/ai/preview/stories/preview-code-languages.story.js +36 -0
  14. package/lib/cjs/ai/preview/stories/preview-code-languages.story.js.map +1 -0
  15. package/lib/cjs/ai/preview/stories/preview-code-loading.story.js +30 -0
  16. package/lib/cjs/ai/preview/stories/preview-code-loading.story.js.map +1 -0
  17. package/lib/cjs/ai/preview/stories/preview-code-read.story.js +35 -0
  18. package/lib/cjs/ai/preview/stories/preview-code-read.story.js.map +1 -0
  19. package/lib/cjs/ai/preview/stories/preview-code-write.story.js +35 -0
  20. package/lib/cjs/ai/preview/stories/preview-code-write.story.js.map +1 -0
  21. package/lib/cjs/ai/preview/stories/preview-code.stories.js +100 -0
  22. package/lib/cjs/ai/preview/stories/preview-code.stories.js.map +1 -0
  23. package/lib/cjs/ai/preview/stories/preview-confirmation-standalone.story.js +33 -0
  24. package/lib/cjs/ai/preview/stories/preview-confirmation-standalone.story.js.map +1 -0
  25. package/lib/cjs/ai/preview/stories/preview-data-grid.story.js +71 -0
  26. package/lib/cjs/ai/preview/stories/preview-data-grid.story.js.map +1 -0
  27. package/lib/cjs/ai/preview/stories/preview.stories.js +63 -0
  28. package/lib/cjs/ai/preview/stories/preview.stories.js.map +1 -0
  29. package/lib/cjs/code-block/code-languages.js.map +1 -1
  30. package/lib/cjs/kbd/stories/kbd.stories.js +1 -1
  31. package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
  32. package/lib/cjs/popover/use-popover.js.map +1 -1
  33. package/lib/cjs/spotlight/use-spotlight.js.map +1 -1
  34. package/lib/cjs/text-link/TextLink.js +3 -2
  35. package/lib/cjs/text-link/TextLink.js.map +1 -1
  36. package/lib/cjs/text-link/stories/index.js +5 -1
  37. package/lib/cjs/text-link/stories/index.js.map +1 -1
  38. package/lib/cjs/text-link/stories/text-link-external-underline.story.js +30 -0
  39. package/lib/cjs/text-link/stories/text-link-external-underline.story.js.map +1 -0
  40. package/lib/cjs/text-link/stories/text-link-internal-underline.story.js +1 -1
  41. package/lib/cjs/text-link/stories/text-link-internal-underline.story.js.map +1 -1
  42. package/lib/cjs/text-link/stories/text-link.stories.js +14 -1
  43. package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
  44. package/lib/cjs/toast/Toast.js.map +1 -1
  45. package/lib/esm/ai/code-preview/CodePreview.js +2 -1
  46. package/lib/esm/ai/code-preview/CodePreview.js.map +1 -1
  47. package/lib/esm/ai/index.js +1 -0
  48. package/lib/esm/ai/index.js.map +1 -1
  49. package/lib/esm/ai/preview/Preview.js +105 -0
  50. package/lib/esm/ai/preview/Preview.js.map +1 -0
  51. package/lib/esm/ai/preview/index.js +22 -0
  52. package/lib/esm/ai/preview/index.js.map +1 -0
  53. package/lib/esm/ai/preview/stories/index.js +43 -0
  54. package/lib/esm/ai/preview/stories/index.js.map +1 -0
  55. package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js +34 -0
  56. package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js.map +1 -0
  57. package/lib/esm/ai/preview/stories/preview-code-languages.story.js +34 -0
  58. package/lib/esm/ai/preview/stories/preview-code-languages.story.js.map +1 -0
  59. package/lib/esm/ai/preview/stories/preview-code-loading.story.js +28 -0
  60. package/lib/esm/ai/preview/stories/preview-code-loading.story.js.map +1 -0
  61. package/lib/esm/ai/preview/stories/preview-code-read.story.js +33 -0
  62. package/lib/esm/ai/preview/stories/preview-code-read.story.js.map +1 -0
  63. package/lib/esm/ai/preview/stories/preview-code-write.story.js +33 -0
  64. package/lib/esm/ai/preview/stories/preview-code-write.story.js.map +1 -0
  65. package/lib/esm/ai/preview/stories/preview-code.stories.js +97 -0
  66. package/lib/esm/ai/preview/stories/preview-code.stories.js.map +1 -0
  67. package/lib/esm/ai/preview/stories/preview-confirmation-standalone.story.js +31 -0
  68. package/lib/esm/ai/preview/stories/preview-confirmation-standalone.story.js.map +1 -0
  69. package/lib/esm/ai/preview/stories/preview-data-grid.story.js +69 -0
  70. package/lib/esm/ai/preview/stories/preview-data-grid.story.js.map +1 -0
  71. package/lib/esm/ai/preview/stories/preview.stories.js +60 -0
  72. package/lib/esm/ai/preview/stories/preview.stories.js.map +1 -0
  73. package/lib/esm/code-block/code-languages.js.map +1 -1
  74. package/lib/esm/kbd/stories/kbd.stories.js +1 -1
  75. package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
  76. package/lib/esm/popover/use-popover.js.map +1 -1
  77. package/lib/esm/spotlight/use-spotlight.js.map +1 -1
  78. package/lib/esm/text-link/TextLink.js +3 -2
  79. package/lib/esm/text-link/TextLink.js.map +1 -1
  80. package/lib/esm/text-link/stories/index.js +3 -0
  81. package/lib/esm/text-link/stories/index.js.map +1 -1
  82. package/lib/esm/text-link/stories/text-link-external-underline.story.js +28 -0
  83. package/lib/esm/text-link/stories/text-link-external-underline.story.js.map +1 -0
  84. package/lib/esm/text-link/stories/text-link-internal-underline.story.js +3 -3
  85. package/lib/esm/text-link/stories/text-link-internal-underline.story.js.map +1 -1
  86. package/lib/esm/text-link/stories/text-link.stories.js +14 -1
  87. package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
  88. package/lib/esm/toast/Toast.js.map +1 -1
  89. package/lib/types/ai/code-preview/CodePreview.d.ts +1 -0
  90. package/lib/types/ai/code-preview/CodePreview.d.ts.map +1 -1
  91. package/lib/types/ai/index.d.ts +1 -0
  92. package/lib/types/ai/index.d.ts.map +1 -1
  93. package/lib/types/ai/preview/Preview.d.ts +64 -0
  94. package/lib/types/ai/preview/Preview.d.ts.map +1 -0
  95. package/lib/types/ai/preview/index.d.ts +22 -0
  96. package/lib/types/ai/preview/index.d.ts.map +1 -0
  97. package/lib/types/ai/preview/stories/index.d.ts +35 -0
  98. package/lib/types/ai/preview/stories/index.d.ts.map +1 -0
  99. package/lib/types/ai/preview/stories/preview-code-confirmation.story.d.ts +24 -0
  100. package/lib/types/ai/preview/stories/preview-code-confirmation.story.d.ts.map +1 -0
  101. package/lib/types/ai/preview/stories/preview-code-languages.story.d.ts +24 -0
  102. package/lib/types/ai/preview/stories/preview-code-languages.story.d.ts.map +1 -0
  103. package/lib/types/ai/preview/stories/preview-code-loading.story.d.ts +24 -0
  104. package/lib/types/ai/preview/stories/preview-code-loading.story.d.ts.map +1 -0
  105. package/lib/types/ai/preview/stories/preview-code-read.story.d.ts +24 -0
  106. package/lib/types/ai/preview/stories/preview-code-read.story.d.ts.map +1 -0
  107. package/lib/types/ai/preview/stories/preview-code-write.story.d.ts +24 -0
  108. package/lib/types/ai/preview/stories/preview-code-write.story.d.ts.map +1 -0
  109. package/lib/types/ai/preview/stories/preview-code.stories.d.ts +31 -0
  110. package/lib/types/ai/preview/stories/preview-code.stories.d.ts.map +1 -0
  111. package/lib/types/ai/preview/stories/preview-confirmation-standalone.story.d.ts +24 -0
  112. package/lib/types/ai/preview/stories/preview-confirmation-standalone.story.d.ts.map +1 -0
  113. package/lib/types/ai/preview/stories/preview-data-grid.story.d.ts +24 -0
  114. package/lib/types/ai/preview/stories/preview-data-grid.story.d.ts.map +1 -0
  115. package/lib/types/ai/preview/stories/preview.stories.d.ts +28 -0
  116. package/lib/types/ai/preview/stories/preview.stories.d.ts.map +1 -0
  117. package/lib/types/code-block/code-languages.d.ts.map +1 -1
  118. package/lib/types/popover/use-popover.d.ts.map +1 -1
  119. package/lib/types/spotlight/use-spotlight.d.ts.map +1 -1
  120. package/lib/types/text-link/TextLink.d.ts +6 -5
  121. package/lib/types/text-link/TextLink.d.ts.map +1 -1
  122. package/lib/types/text-link/stories/index.d.ts +2 -0
  123. package/lib/types/text-link/stories/index.d.ts.map +1 -1
  124. package/lib/types/text-link/stories/text-link-external-underline.story.d.ts +24 -0
  125. package/lib/types/text-link/stories/text-link-external-underline.story.d.ts.map +1 -0
  126. package/lib/types/text-link/stories/text-link-internal-underline.story.d.ts.map +1 -1
  127. package/lib/types/text-link/stories/text-link.stories.d.ts +1 -0
  128. package/lib/types/text-link/stories/text-link.stories.d.ts.map +1 -1
  129. package/lib/types/toast/Toast.d.ts.map +1 -1
  130. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { TextLink, Typography } from '@neo4j-ndl/react';
24
+ const Component = () => {
25
+ return (_jsxs(Typography, { variant: "body-medium", children: ["The quick brown fox", ' ', _jsx(TextLink, { href: "https://neo4j.com", type: "external-underline", children: "jumps" }), ' ', "over the lazy dog."] }));
26
+ };
27
+ export default Component;
28
+ //# sourceMappingURL=text-link-external-underline.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-link-external-underline.story.js","sourceRoot":"","sources":["../../../../src/text-link/stories/text-link-external-underline.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,MAAC,UAAU,IAAC,OAAO,EAAC,aAAa,oCACX,GAAG,EACvB,KAAC,QAAQ,IAAC,IAAI,EAAC,mBAAmB,EAAC,IAAI,EAAC,oBAAoB,sBAEjD,EAAC,GAAG,0BAEJ,CACd,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 { TextLink, Typography } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <Typography variant=\"body-medium\">\n The quick brown fox{' '}\n <TextLink href=\"https://neo4j.com\" type=\"external-underline\">\n jumps\n </TextLink>{' '}\n over the lazy dog.\n </Typography>\n );\n};\n\nexport default Component;\n"]}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  *
4
4
  * Copyright (c) "Neo4j"
@@ -20,9 +20,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
22
  import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
- import { TextLink } from '@neo4j-ndl/react';
23
+ import { TextLink, Typography } from '@neo4j-ndl/react';
24
24
  const Component = () => {
25
- return (_jsx(TextLink, { href: "/", type: "internal-underline", children: "Link" }));
25
+ return (_jsxs(Typography, { variant: "body-medium", children: ["The quick brown fox", ' ', _jsx(TextLink, { href: "/", type: "internal-underline", children: "jumps" }), ' ', "over the lazy dog."] }));
26
26
  };
27
27
  export default Component;
28
28
  //# sourceMappingURL=text-link-internal-underline.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-link-internal-underline.story.js","sourceRoot":"","sources":["../../../../src/text-link/stories/text-link-internal-underline.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,oBAAoB,qBAEjC,CACZ,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 { TextLink } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <TextLink href=\"/\" type=\"internal-underline\">\n Link\n </TextLink>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"text-link-internal-underline.story.js","sourceRoot":"","sources":["../../../../src/text-link/stories/text-link-internal-underline.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,MAAC,UAAU,IAAC,OAAO,EAAC,aAAa,oCACX,GAAG,EACvB,KAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,oBAAoB,sBAEjC,EAAC,GAAG,0BAEJ,CACd,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 { TextLink, Typography } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <Typography variant=\"body-medium\">\n The quick brown fox{' '}\n <TextLink href=\"/\" type=\"internal-underline\">\n jumps\n </TextLink>{' '}\n over the lazy dog.\n </Typography>\n );\n};\n\nexport default Component;\n"]}
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
22
  import { TextLink } from '@neo4j-ndl/react';
23
- import { TextLinkDefault, TextLinkDefaultSource, TextLinkExternal, TextLinkExternalSource, TextLinkInternalIcon, TextLinkInternalIconSource, TextLinkInternalUnderline, TextLinkInternalUnderlineSource, } from '.';
23
+ import { TextLinkDefault, TextLinkDefaultSource, TextLinkExternal, TextLinkExternalSource, TextLinkExternalUnderline, TextLinkExternalUnderlineSource, TextLinkInternalIcon, TextLinkInternalIconSource, TextLinkInternalUnderline, TextLinkInternalUnderlineSource, } from '.';
24
24
  const componentMeta = {
25
25
  component: TextLink,
26
26
  decorators: [
@@ -70,6 +70,19 @@ export const External = {
70
70
  },
71
71
  render: TextLinkExternal,
72
72
  };
73
+ export const ExternalUnderline = {
74
+ args: {},
75
+ parameters: {
76
+ docs: {
77
+ source: {
78
+ code: TextLinkExternalUnderlineSource,
79
+ language: 'tsx',
80
+ type: 'code',
81
+ },
82
+ },
83
+ },
84
+ render: TextLinkExternalUnderline,
85
+ };
73
86
  export const InternalIcon = {
74
87
  args: {},
75
88
  parameters: {
@@ -1 +1 @@
1
- {"version":3,"file":"text-link.stories.js","sourceRoot":"","sources":["../../../../src/text-link/stories/text-link.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,GAAG,CAAC;AAEX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,MAAM,EAAE,oBAAoB;CAC7B,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 { TextLink } from '@neo4j-ndl/react';\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport {\n TextLinkDefault,\n TextLinkDefaultSource,\n TextLinkExternal,\n TextLinkExternalSource,\n TextLinkInternalIcon,\n TextLinkInternalIconSource,\n TextLinkInternalUnderline,\n TextLinkInternalUnderlineSource,\n} from '.';\n\nconst componentMeta: Meta<typeof TextLink> = {\n component: TextLink,\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n id: 'components-text-link',\n tags: ['docsPage'],\n title: 'Components/TextLink',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof TextLink>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkDefaultSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkDefault,\n};\n\nexport const InternalUnderline: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkInternalUnderlineSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkInternalUnderline,\n};\n\nexport const External: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkExternalSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkExternal,\n};\n\nexport const InternalIcon: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkInternalIconSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkInternalIcon,\n};\n"]}
1
+ {"version":3,"file":"text-link.stories.js","sourceRoot":"","sources":["../../../../src/text-link/stories/text-link.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,GAAG,CAAC;AAEX,MAAM,aAAa,GAA0B;IAC3C,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,cAAK,SAAS,EAAC,yBAAyB,YACtC,KAAC,KAAK,KAAG,GACL,CACP;KACF;IACD,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,eAAe,aAAa,CAAC;AAG7B,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,+BAA+B;gBACrC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,yBAAyB;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,+BAA+B;gBACrC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,yBAAyB;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,0BAA0B;gBAChC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,oBAAoB;CAC7B,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 { TextLink } from '@neo4j-ndl/react';\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport {\n TextLinkDefault,\n TextLinkDefaultSource,\n TextLinkExternal,\n TextLinkExternalSource,\n TextLinkExternalUnderline,\n TextLinkExternalUnderlineSource,\n TextLinkInternalIcon,\n TextLinkInternalIconSource,\n TextLinkInternalUnderline,\n TextLinkInternalUnderlineSource,\n} from '.';\n\nconst componentMeta: Meta<typeof TextLink> = {\n component: TextLink,\n decorators: [\n (Story) => (\n <div className=\"n-flex n-justify-center\">\n <Story />\n </div>\n ),\n ],\n id: 'components-text-link',\n tags: ['docsPage'],\n title: 'Components/TextLink',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof TextLink>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkDefaultSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkDefault,\n};\n\nexport const InternalUnderline: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkInternalUnderlineSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkInternalUnderline,\n};\n\nexport const External: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkExternalSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkExternal,\n};\n\nexport const ExternalUnderline: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkExternalUnderlineSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkExternalUnderline,\n};\n\nexport const InternalIcon: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: TextLinkInternalIconSource,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: TextLinkInternalIcon,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAEL,KAAK,IAAI,WAAW,EACpB,OAAO,IAAI,aAAa,GAGzB,MAAM,QAAQ,CAAC;AAGhB,OAAO,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AAO,EAAE,OAAO,EAAE,KAAK,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 */\nimport classNames from 'classnames';\nimport { type ReactNode } from 'react';\nimport {\n type ExternalToast as SonnerExternalToast,\n toast as sonnerToast,\n Toaster as SonnerToaster,\n type ToasterProps as SonnerToasterProps,\n type ToastT as SonnerToastT,\n} from 'sonner';\n\nimport { type CommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport {\n CheckCircleIconSolid,\n ExclamationCircleIconSolid,\n XMarkIconOutline,\n} from '../icons';\nimport { OutlinedButton } from '../outlined-button';\nimport { ProgressBar } from '../progress-bar';\n\ntype ToastVariants = 'neutral' | 'success' | 'danger' | 'progress-bar';\n\ntype ToastCommandVariants = 'neutral' | 'success' | 'danger' | 'progressBar';\n\ntype ToastId = string | number;\n\ntype BaseToastProps = CommonProps<\n 'div',\n {\n /** If `true` a close button will be displayed in the toast. */\n isCloseable?: boolean;\n /** If `true` the toast will close when the action button is triggered. */\n shouldCloseOnAction?: boolean;\n /** Function that will be called when the toast is closed. */\n onClose?: (id: ToastId) => void;\n /** If true the toast will close automatically after a certain time. */\n shouldAutoClose?: boolean;\n /** Function that will be called when the toast is automatically closed. */\n onAutoClose?: (id: ToastId) => void;\n /** If set an action button will be displayed. The value here will be displayed\n * in the action button. If this is set the toast property `shouldAutoClose` will\n * automatically be set to `false` unless overridden. */\n actionLabel?: string;\n /** Function that will be called when the action button is clicked. */\n onAction?: (id: ToastId) => void;\n /** If a dev wishes to set the underlying framework props (Sonner Toast).\n * https://sonner.emilkowal.ski/toast#api-reference */\n sonnerToastProps?: SonnerExternalToast;\n /** If true the toast is controlled by the parent. */\n isControlled?: boolean;\n }\n>;\n\ninterface ToastNeutralProps extends BaseToastProps {\n icon?: ReactNode;\n}\n// oxlint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface ToastSuccessProps extends BaseToastProps {}\n// oxlint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface ToastDangerProps extends BaseToastProps {}\n\ninterface ToastProgressBarProps extends BaseToastProps {\n icon?: ReactNode;\n initialProgressBarValue?: number;\n}\n\ntype ToastVariantsProps =\n | ToastNeutralProps\n | ToastSuccessProps\n | ToastDangerProps\n | ToastProgressBarProps;\n\ninterface ToasterProps\n extends Pick<SonnerToasterProps, 'position' | 'visibleToasts' | 'className'> {\n sonnerToasterProps?: SonnerToasterProps;\n}\n\nconst Toaster = (props: ToasterProps) => {\n const {\n position = 'bottom-left',\n visibleToasts = 1,\n className,\n sonnerToasterProps,\n } = props;\n\n const classes = classNames('ndl-toast-container', className);\n\n return (\n <SonnerToaster\n className={classes}\n position={position}\n visibleToasts={visibleToasts}\n {...sonnerToasterProps}\n />\n );\n};\n\ntype SonnerToast = typeof sonnerToast;\ninterface CustomSonnerToast extends SonnerToast {\n needle: Record<string, { onClose?: (id: ToastId) => void }>;\n}\n\nfunction onCloseCallback(\n callback: ((id: ToastId) => void) | undefined,\n id: ToastId,\n) {\n if (callback) {\n callback(id);\n // Cleanup\n delete (sonnerToast as CustomSonnerToast).needle[id];\n }\n}\n\ntype ToastElement = ToastVariantsProps & {\n icon: ReactNode;\n id: ToastId;\n variant: ToastVariants;\n text: ReactNode;\n initialProgressBarValue?: number;\n isControlled?: boolean;\n};\n\nconst Toast = ({\n icon,\n id,\n text,\n variant,\n isCloseable,\n onClose,\n actionLabel,\n onAction,\n shouldCloseOnAction,\n initialProgressBarValue,\n isControlled,\n htmlAttributes,\n ref,\n ...restProps\n}: ToastElement) => {\n const isProgressBar = variant === 'progress-bar';\n\n const handleOnClose = () => {\n if (isControlled === true) {\n onCloseCallback(onClose, id);\n return;\n }\n sonnerToast.dismiss(id);\n onCloseCallback(onClose, id);\n };\n\n const handleOnAction = () => {\n if (onAction) {\n onAction(id);\n }\n if (shouldCloseOnAction === true) {\n sonnerToast.dismiss(id);\n onCloseCallback(onClose, id);\n }\n };\n\n return (\n <div\n id={String(id)}\n className=\"ndl-toast\"\n tabIndex={-1}\n ref={ref}\n data-variant={variant}\n data-testid=\"ndl-toast\"\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-toast-content\" tabIndex={-1}>\n {icon && (\n <div className={`ndl-toast-icon ndl-toast-${variant}`}>{icon}</div>\n )}\n <div className=\"ndl-toast-text\">{text}</div>\n {actionLabel && (\n <OutlinedButton\n className=\"ndl-toast-action\"\n size=\"small\"\n onClick={handleOnAction}\n >\n {actionLabel}\n </OutlinedButton>\n )}\n {(isCloseable || actionLabel || isProgressBar) && (\n <CleanIconButton\n className=\"ndl-toast-close-button\"\n onClick={handleOnClose}\n description={null}\n size=\"small\"\n htmlAttributes={{\n 'aria-label': 'Close',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </div>\n {isProgressBar && (\n <ProgressBar size=\"small\" value={initialProgressBarValue ?? 0} />\n )}\n </div>\n );\n};\n\nfunction getProps(\n onClose: ((id: ToastId) => void) | undefined,\n shouldAutoClose: boolean | undefined,\n onAutoClose: ((id: ToastId) => void) | undefined,\n onAction: ((id: ToastId) => void) | undefined,\n sonnerToastProps: SonnerExternalToast | undefined,\n variant: ToastVariants,\n) {\n const isProgressBar = variant === 'progress-bar';\n // https://sonner.emilkowal.ski/toast#api-reference\n return {\n duration:\n !isProgressBar && shouldAutoClose ? (!onAction ? 5000 : 8000) : Infinity,\n unstyled: true,\n onDismiss: (toast: SonnerToastT) => {\n onCloseCallback(onClose, toast.id);\n },\n onAutoClose: (toast: SonnerToastT) => {\n if (onAutoClose) {\n return onAutoClose(toast.id);\n }\n },\n ...sonnerToastProps,\n };\n}\n\nfunction createToast(\n text: ReactNode,\n props: ToastVariantsProps,\n variant: ToastVariants,\n icon: ReactNode,\n) {\n const {\n ref,\n sonnerToastProps = {},\n onClose,\n shouldAutoClose,\n onAutoClose,\n onAction,\n ...restProps\n } = props;\n\n const { id: sonnerToastPropsId } = sonnerToastProps;\n sonnerToastProps.id = sonnerToastPropsId ?? `ndl-toast-${Date.now()}`;\n\n // Unfortunately calling sonnerToast.dismiss does not trigger the onDismiss\n // callback (weird). So we need to save the onClose callback and call it manually\n // when calling dismiss manually as we want an onClose callback.\n // https://sonner.emilkowal.ski/toast#on-close-callback\n // https://github.com/emilkowalski/sonner/blob/main/src/index.tsx#L320\n // https://github.com/emilkowalski/sonner/blob/main/src/index.tsx#L359\n (sonnerToast as CustomSonnerToast).needle = {\n [String(sonnerToastProps.id)]: {\n onClose,\n },\n };\n\n return sonnerToast.custom(\n (id: ToastId) => (\n <Toast\n {...restProps}\n ref={ref}\n id={id}\n text={text}\n variant={variant}\n icon={icon}\n onClose={onClose}\n onAction={onAction}\n />\n ),\n {\n ...getProps(\n onClose,\n shouldAutoClose,\n onAutoClose,\n onAction,\n sonnerToastProps,\n variant,\n ),\n },\n );\n}\n\n// eslint-disable-next-line no-redeclare\ninterface Toast {\n neutral: (text: ReactNode, props?: ToastNeutralProps) => ToastId;\n success: (text: ReactNode, props?: ToastSuccessProps) => ToastId;\n danger: (text: ReactNode, props?: ToastDangerProps) => ToastId;\n progressBar: (text: ReactNode, props?: ToastProgressBarProps) => ToastId;\n updateProgressBarValue: (id: ToastId, value: number) => void;\n close: (id: ToastId) => void;\n sonnerToast: typeof sonnerToast;\n}\n\nconst toast: Toast = {\n close: (id) => {\n sonnerToast.dismiss(id);\n onCloseCallback((sonnerToast as CustomSonnerToast).needle[id]?.onClose, id);\n },\n danger: (text: ReactNode, props = {}) =>\n createToast(text, props, 'danger', <ExclamationCircleIconSolid />),\n neutral: (text, props = {}) => {\n const { icon, ...restProps } = props;\n return createToast(text, restProps, 'neutral', icon);\n },\n progressBar: (text: ReactNode, props = {}) => {\n const { icon, ...restProps } = props;\n return createToast(text, restProps, 'progress-bar', icon);\n },\n sonnerToast,\n success: (text: ReactNode, props = {}) => {\n const icon = <CheckCircleIconSolid />;\n return createToast(text, props, 'success', icon);\n },\n updateProgressBarValue: (id, givenValue) => {\n const value = givenValue > 100 ? 100 : givenValue < 0 ? 0 : givenValue;\n\n // Unable to use the sonner toast.update on custom toasts.\n const widthValue = `${value}%`;\n const toastElement = document.getElementById(String(id)) as HTMLDivElement;\n\n if (!toastElement) {\n return;\n }\n\n const progressBarContainerElement = toastElement.querySelector(\n '.ndl-progress-bar-container',\n ) as HTMLDivElement;\n progressBarContainerElement.ariaValueNow = String(value);\n const progressBarElement = progressBarContainerElement.querySelector(\n '.ndl-progress-bar',\n ) as HTMLDivElement;\n\n if (!progressBarContainerElement) {\n return;\n }\n\n progressBarElement.style.setProperty('width', widthValue);\n }, // If devs wish to directly access sonner toast.\n};\n\nexport { Toaster, toast };\nexport type {\n ToasterProps,\n ToastVariants,\n ToastCommandVariants,\n ToastNeutralProps,\n ToastSuccessProps,\n ToastDangerProps,\n ToastProgressBarProps,\n ToastVariantsProps,\n ToastElement,\n ToastId,\n};\n"]}
1
+ {"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAEL,KAAK,IAAI,WAAW,EACpB,OAAO,IAAI,aAAa,GAGzB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AACl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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 ReactNode } from 'react';\nimport {\n type ExternalToast as SonnerExternalToast,\n toast as sonnerToast,\n Toaster as SonnerToaster,\n type ToasterProps as SonnerToasterProps,\n type ToastT as SonnerToastT,\n} from 'sonner';\n\nimport { type CommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport {\n CheckCircleIconSolid,\n ExclamationCircleIconSolid,\n XMarkIconOutline,\n} from '../icons';\nimport { OutlinedButton } from '../outlined-button';\nimport { ProgressBar } from '../progress-bar';\n\ntype ToastVariants = 'neutral' | 'success' | 'danger' | 'progress-bar';\n\ntype ToastCommandVariants = 'neutral' | 'success' | 'danger' | 'progressBar';\n\ntype ToastId = string | number;\n\ntype BaseToastProps = CommonProps<\n 'div',\n {\n /** If `true` a close button will be displayed in the toast. */\n isCloseable?: boolean;\n /** If `true` the toast will close when the action button is triggered. */\n shouldCloseOnAction?: boolean;\n /** Function that will be called when the toast is closed. */\n onClose?: (id: ToastId) => void;\n /** If true the toast will close automatically after a certain time. */\n shouldAutoClose?: boolean;\n /** Function that will be called when the toast is automatically closed. */\n onAutoClose?: (id: ToastId) => void;\n /** If set an action button will be displayed. The value here will be displayed\n * in the action button. If this is set the toast property `shouldAutoClose` will\n * automatically be set to `false` unless overridden. */\n actionLabel?: string;\n /** Function that will be called when the action button is clicked. */\n onAction?: (id: ToastId) => void;\n /** If a dev wishes to set the underlying framework props (Sonner Toast).\n * https://sonner.emilkowal.ski/toast#api-reference */\n sonnerToastProps?: SonnerExternalToast;\n /** If true the toast is controlled by the parent. */\n isControlled?: boolean;\n }\n>;\n\ninterface ToastNeutralProps extends BaseToastProps {\n icon?: ReactNode;\n}\n// oxlint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface ToastSuccessProps extends BaseToastProps {}\n// oxlint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface ToastDangerProps extends BaseToastProps {}\n\ninterface ToastProgressBarProps extends BaseToastProps {\n icon?: ReactNode;\n initialProgressBarValue?: number;\n}\n\ntype ToastVariantsProps =\n | ToastNeutralProps\n | ToastSuccessProps\n | ToastDangerProps\n | ToastProgressBarProps;\n\ninterface ToasterProps extends Pick<\n SonnerToasterProps,\n 'position' | 'visibleToasts' | 'className'\n> {\n sonnerToasterProps?: SonnerToasterProps;\n}\n\nconst Toaster = (props: ToasterProps) => {\n const {\n position = 'bottom-left',\n visibleToasts = 1,\n className,\n sonnerToasterProps,\n } = props;\n\n const classes = classNames('ndl-toast-container', className);\n\n return (\n <SonnerToaster\n className={classes}\n position={position}\n visibleToasts={visibleToasts}\n {...sonnerToasterProps}\n />\n );\n};\n\ntype SonnerToast = typeof sonnerToast;\ninterface CustomSonnerToast extends SonnerToast {\n needle: Record<string, { onClose?: (id: ToastId) => void }>;\n}\n\nfunction onCloseCallback(\n callback: ((id: ToastId) => void) | undefined,\n id: ToastId,\n) {\n if (callback) {\n callback(id);\n // Cleanup\n delete (sonnerToast as CustomSonnerToast).needle[id];\n }\n}\n\ntype ToastElement = ToastVariantsProps & {\n icon: ReactNode;\n id: ToastId;\n variant: ToastVariants;\n text: ReactNode;\n initialProgressBarValue?: number;\n isControlled?: boolean;\n};\n\nconst Toast = ({\n icon,\n id,\n text,\n variant,\n isCloseable,\n onClose,\n actionLabel,\n onAction,\n shouldCloseOnAction,\n initialProgressBarValue,\n isControlled,\n htmlAttributes,\n ref,\n ...restProps\n}: ToastElement) => {\n const isProgressBar = variant === 'progress-bar';\n\n const handleOnClose = () => {\n if (isControlled === true) {\n onCloseCallback(onClose, id);\n return;\n }\n sonnerToast.dismiss(id);\n onCloseCallback(onClose, id);\n };\n\n const handleOnAction = () => {\n if (onAction) {\n onAction(id);\n }\n if (shouldCloseOnAction === true) {\n sonnerToast.dismiss(id);\n onCloseCallback(onClose, id);\n }\n };\n\n return (\n <div\n id={String(id)}\n className=\"ndl-toast\"\n tabIndex={-1}\n ref={ref}\n data-variant={variant}\n data-testid=\"ndl-toast\"\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-toast-content\" tabIndex={-1}>\n {icon && (\n <div className={`ndl-toast-icon ndl-toast-${variant}`}>{icon}</div>\n )}\n <div className=\"ndl-toast-text\">{text}</div>\n {actionLabel && (\n <OutlinedButton\n className=\"ndl-toast-action\"\n size=\"small\"\n onClick={handleOnAction}\n >\n {actionLabel}\n </OutlinedButton>\n )}\n {(isCloseable || actionLabel || isProgressBar) && (\n <CleanIconButton\n className=\"ndl-toast-close-button\"\n onClick={handleOnClose}\n description={null}\n size=\"small\"\n htmlAttributes={{\n 'aria-label': 'Close',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </div>\n {isProgressBar && (\n <ProgressBar size=\"small\" value={initialProgressBarValue ?? 0} />\n )}\n </div>\n );\n};\n\nfunction getProps(\n onClose: ((id: ToastId) => void) | undefined,\n shouldAutoClose: boolean | undefined,\n onAutoClose: ((id: ToastId) => void) | undefined,\n onAction: ((id: ToastId) => void) | undefined,\n sonnerToastProps: SonnerExternalToast | undefined,\n variant: ToastVariants,\n) {\n const isProgressBar = variant === 'progress-bar';\n // https://sonner.emilkowal.ski/toast#api-reference\n return {\n duration:\n !isProgressBar && shouldAutoClose ? (!onAction ? 5000 : 8000) : Infinity,\n unstyled: true,\n onDismiss: (toast: SonnerToastT) => {\n onCloseCallback(onClose, toast.id);\n },\n onAutoClose: (toast: SonnerToastT) => {\n if (onAutoClose) {\n return onAutoClose(toast.id);\n }\n },\n ...sonnerToastProps,\n };\n}\n\nfunction createToast(\n text: ReactNode,\n props: ToastVariantsProps,\n variant: ToastVariants,\n icon: ReactNode,\n) {\n const {\n ref,\n sonnerToastProps = {},\n onClose,\n shouldAutoClose,\n onAutoClose,\n onAction,\n ...restProps\n } = props;\n\n const { id: sonnerToastPropsId } = sonnerToastProps;\n sonnerToastProps.id = sonnerToastPropsId ?? `ndl-toast-${Date.now()}`;\n\n // Unfortunately calling sonnerToast.dismiss does not trigger the onDismiss\n // callback (weird). So we need to save the onClose callback and call it manually\n // when calling dismiss manually as we want an onClose callback.\n // https://sonner.emilkowal.ski/toast#on-close-callback\n // https://github.com/emilkowalski/sonner/blob/main/src/index.tsx#L320\n // https://github.com/emilkowalski/sonner/blob/main/src/index.tsx#L359\n (sonnerToast as CustomSonnerToast).needle = {\n [String(sonnerToastProps.id)]: {\n onClose,\n },\n };\n\n return sonnerToast.custom(\n (id: ToastId) => (\n <Toast\n {...restProps}\n ref={ref}\n id={id}\n text={text}\n variant={variant}\n icon={icon}\n onClose={onClose}\n onAction={onAction}\n />\n ),\n {\n ...getProps(\n onClose,\n shouldAutoClose,\n onAutoClose,\n onAction,\n sonnerToastProps,\n variant,\n ),\n },\n );\n}\n\n// eslint-disable-next-line no-redeclare\ninterface Toast {\n neutral: (text: ReactNode, props?: ToastNeutralProps) => ToastId;\n success: (text: ReactNode, props?: ToastSuccessProps) => ToastId;\n danger: (text: ReactNode, props?: ToastDangerProps) => ToastId;\n progressBar: (text: ReactNode, props?: ToastProgressBarProps) => ToastId;\n updateProgressBarValue: (id: ToastId, value: number) => void;\n close: (id: ToastId) => void;\n sonnerToast: typeof sonnerToast;\n}\n\nconst toast: Toast = {\n close: (id) => {\n sonnerToast.dismiss(id);\n onCloseCallback((sonnerToast as CustomSonnerToast).needle[id]?.onClose, id);\n },\n danger: (text: ReactNode, props = {}) =>\n createToast(text, props, 'danger', <ExclamationCircleIconSolid />),\n neutral: (text, props = {}) => {\n const { icon, ...restProps } = props;\n return createToast(text, restProps, 'neutral', icon);\n },\n progressBar: (text: ReactNode, props = {}) => {\n const { icon, ...restProps } = props;\n return createToast(text, restProps, 'progress-bar', icon);\n },\n sonnerToast,\n success: (text: ReactNode, props = {}) => {\n const icon = <CheckCircleIconSolid />;\n return createToast(text, props, 'success', icon);\n },\n updateProgressBarValue: (id, givenValue) => {\n const value = givenValue > 100 ? 100 : givenValue < 0 ? 0 : givenValue;\n\n // Unable to use the sonner toast.update on custom toasts.\n const widthValue = `${value}%`;\n const toastElement = document.getElementById(String(id)) as HTMLDivElement;\n\n if (!toastElement) {\n return;\n }\n\n const progressBarContainerElement = toastElement.querySelector(\n '.ndl-progress-bar-container',\n ) as HTMLDivElement;\n progressBarContainerElement.ariaValueNow = String(value);\n const progressBarElement = progressBarContainerElement.querySelector(\n '.ndl-progress-bar',\n ) as HTMLDivElement;\n\n if (!progressBarContainerElement) {\n return;\n }\n\n progressBarElement.style.setProperty('width', widthValue);\n }, // If devs wish to directly access sonner toast.\n};\n\nexport { Toaster, toast };\nexport type {\n ToasterProps,\n ToastVariants,\n ToastCommandVariants,\n ToastNeutralProps,\n ToastSuccessProps,\n ToastDangerProps,\n ToastProgressBarProps,\n ToastVariantsProps,\n ToastElement,\n ToastId,\n};\n"]}
@@ -38,6 +38,7 @@ type CodePreviewProps = {
38
38
  * The component is used to display code that is generated by an LLM.
39
39
  *
40
40
  * @alpha - Changes to this component may be breaking.
41
+ * @deprecated - Use <Preview /> with <Preview.Code /> instead.
41
42
  */
42
43
  export declare const CodePreview: ({ code, language, label, isLoading, headerActions, theme, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", CodePreviewProps>) => import("react/jsx-runtime").JSX.Element;
43
44
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../../../src/ai/code-preview/CodePreview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,KAAK,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AEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,iHAYzB,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,4CA6GtC,CAAC"}
@@ -30,4 +30,5 @@ export { Thinking } from './thinking';
30
30
  export { Reasoning } from './reasoning';
31
31
  export { ToolCall } from './tool-call';
32
32
  export { CodePreview } from './code-preview';
33
+ export { Preview } from './preview';
33
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { type CodeBlock } from '@neo4j-ndl/react';
22
+ import { type CommonProps } from '../../_common/types';
23
+ type PreviewProps = {
24
+ children: React.ReactNode;
25
+ };
26
+ type PreviewHeaderProps = {
27
+ children?: React.ReactNode;
28
+ actions?: React.ReactNode;
29
+ };
30
+ type PreviewConfirmationProps = {
31
+ /** The content to display in the confirmation */
32
+ children?: React.ReactNode;
33
+ /** The actions to display in the confirmation, usually two buttons; one for confirming and one for rejecting. */
34
+ actions: React.ReactNode;
35
+ /** Whether the confirmation is used as a footer */
36
+ isFooter?: boolean;
37
+ /** The status of the confirmation */
38
+ status?: 'pending' | 'confirmed' | 'rejected';
39
+ /** The text to display for the confirmed status */
40
+ confirmedActionText?: string;
41
+ /** The text to display for the rejected status */
42
+ rejectedActionText?: string;
43
+ };
44
+ type PreviewCodeProps = {
45
+ /** The code content to display */
46
+ code: string;
47
+ /** The language of the code (e.g., 'cypher', 'python', 'javascript') */
48
+ language: React.ComponentProps<typeof CodeBlock>['language'];
49
+ /** The current state of the code block */
50
+ label?: 'read' | 'write';
51
+ /** Whether the code block is loading */
52
+ isLoading?: boolean;
53
+ /** The actions to display in the header. Should be small buttons or icon buttons only. */
54
+ headerActions?: React.ReactNode;
55
+ /** The theme of the code block */
56
+ theme?: 'ndl-code-dark' | 'ndl-code-light';
57
+ };
58
+ export declare const Preview: (({ children, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewProps>) => import("react/jsx-runtime").JSX.Element) & {
59
+ Code: ({ code, language, label, isLoading, headerActions, theme, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewCodeProps>) => import("react/jsx-runtime").JSX.Element;
60
+ Confirmation: ({ children, actions, isFooter, status, confirmedActionText, rejectedActionText, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewConfirmationProps>) => import("react/jsx-runtime").JSX.Element;
61
+ Header: ({ children, actions, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewHeaderProps>) => import("react/jsx-runtime").JSX.Element;
62
+ };
63
+ export {};
64
+ //# sourceMappingURL=Preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../../../src/ai/preview/Preview.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAAE,KAAK,WA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AAwB,CAAC;yFAnD5C,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC;CAqOvC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './Preview';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/preview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,WAAW,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export { default as PreviewDataGrid } from './preview-data-grid.story';
22
+ export { default as PreviewConfirmationStandalone } from './preview-confirmation-standalone.story';
23
+ export { default as PreviewCodeConfirmation } from './preview-code-confirmation.story';
24
+ export { default as PreviewCodeLoading } from './preview-code-loading.story';
25
+ export { default as PreviewCodeRead } from './preview-code-read.story';
26
+ export { default as PreviewCodeWrite } from './preview-code-write.story';
27
+ export { default as PreviewCodeLanguages } from './preview-code-languages.story';
28
+ export declare const PreviewDataGridSrc: string;
29
+ export declare const PreviewConfirmationStandaloneSrc: string;
30
+ export declare const PreviewCodeConfirmationSrc: string;
31
+ export declare const PreviewCodeLoadingSrc: string;
32
+ export declare const PreviewCodeReadSrc: string;
33
+ export declare const PreviewCodeWriteSrc: string;
34
+ export declare const PreviewCodeLanguagesSrc: string;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAWjF,eAAO,MAAM,kBAAkB,QAA6C,CAAC;AAC7E,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,0BAA0B,QAEtC,CAAC;AACF,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AACF,eAAO,MAAM,kBAAkB,QAA6C,CAAC;AAC7E,eAAO,MAAM,mBAAmB,QAA8C,CAAC;AAC/E,eAAO,MAAM,uBAAuB,QAEnC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-code-confirmation.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code-confirmation.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-confirmation.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAUjD,QAAA,MAAM,SAAS,+CA2Cd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-code-languages.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code-languages.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-languages.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAWjD,QAAA,MAAM,SAAS,+CAMd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-code-loading.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code-loading.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-loading.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAIjD,QAAA,MAAM,SAAS,+CAMd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-code-read.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code-read.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-read.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAUjD,QAAA,MAAM,SAAS,+CAmBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-code-write.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code-write.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code-write.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAajD,QAAA,MAAM,SAAS,+CA4Bd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
22
+ import { Preview } from '../Preview';
23
+ declare const componentMeta: Meta<typeof Preview>;
24
+ export default componentMeta;
25
+ type Story = StoryObj<typeof componentMeta>;
26
+ export declare const Loading: Story;
27
+ export declare const Read: Story;
28
+ export declare const Write: Story;
29
+ export declare const OtherLanguages: Story;
30
+ export declare const WithConfirmationFooter: Story;
31
+ //# sourceMappingURL=preview-code.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-code.stories.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code.stories.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAcrC,QAAA,MAAM,aAAa,EAAE,IAAI,CAAC,OAAO,OAAO,CAMvC,CAAC;AAEF,eAAe,aAAa,CAAC;AAE7B,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5C,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAY5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAYpC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-confirmation-standalone.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-confirmation-standalone.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-confirmation-standalone.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAMjD,QAAA,MAAM,SAAS,+CAsCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
24
+ //# sourceMappingURL=preview-data-grid.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-data-grid.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-data-grid.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AA0BjD,QAAA,MAAM,SAAS,+CAiEd,CAAC;AAEF,eAAe,SAAS,CAAC"}