@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.
- package/lib/cjs/ai/code-preview/CodePreview.js +2 -1
- package/lib/cjs/ai/code-preview/CodePreview.js.map +1 -1
- package/lib/cjs/ai/index.js +3 -1
- package/lib/cjs/ai/index.js.map +1 -1
- package/lib/cjs/ai/preview/Preview.js +111 -0
- package/lib/cjs/ai/preview/Preview.js.map +1 -0
- package/lib/cjs/ai/preview/index.js +38 -0
- package/lib/cjs/ai/preview/index.js.map +1 -0
- package/lib/cjs/ai/preview/stories/index.js +56 -0
- package/lib/cjs/ai/preview/stories/index.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js +36 -0
- package/lib/cjs/ai/preview/stories/preview-code-confirmation.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-languages.story.js +36 -0
- package/lib/cjs/ai/preview/stories/preview-code-languages.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-loading.story.js +30 -0
- package/lib/cjs/ai/preview/stories/preview-code-loading.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-read.story.js +35 -0
- package/lib/cjs/ai/preview/stories/preview-code-read.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code-write.story.js +35 -0
- package/lib/cjs/ai/preview/stories/preview-code-write.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-code.stories.js +100 -0
- package/lib/cjs/ai/preview/stories/preview-code.stories.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-confirmation-standalone.story.js +33 -0
- package/lib/cjs/ai/preview/stories/preview-confirmation-standalone.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-data-grid.story.js +71 -0
- package/lib/cjs/ai/preview/stories/preview-data-grid.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview.stories.js +63 -0
- package/lib/cjs/ai/preview/stories/preview.stories.js.map +1 -0
- package/lib/cjs/code-block/code-languages.js.map +1 -1
- package/lib/cjs/kbd/stories/kbd.stories.js +1 -1
- package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/cjs/popover/use-popover.js.map +1 -1
- package/lib/cjs/spotlight/use-spotlight.js.map +1 -1
- package/lib/cjs/text-link/TextLink.js +3 -2
- package/lib/cjs/text-link/TextLink.js.map +1 -1
- package/lib/cjs/text-link/stories/index.js +5 -1
- package/lib/cjs/text-link/stories/index.js.map +1 -1
- package/lib/cjs/text-link/stories/text-link-external-underline.story.js +30 -0
- package/lib/cjs/text-link/stories/text-link-external-underline.story.js.map +1 -0
- package/lib/cjs/text-link/stories/text-link-internal-underline.story.js +1 -1
- package/lib/cjs/text-link/stories/text-link-internal-underline.story.js.map +1 -1
- package/lib/cjs/text-link/stories/text-link.stories.js +14 -1
- package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/cjs/toast/Toast.js.map +1 -1
- package/lib/esm/ai/code-preview/CodePreview.js +2 -1
- package/lib/esm/ai/code-preview/CodePreview.js.map +1 -1
- package/lib/esm/ai/index.js +1 -0
- package/lib/esm/ai/index.js.map +1 -1
- package/lib/esm/ai/preview/Preview.js +105 -0
- package/lib/esm/ai/preview/Preview.js.map +1 -0
- package/lib/esm/ai/preview/index.js +22 -0
- package/lib/esm/ai/preview/index.js.map +1 -0
- package/lib/esm/ai/preview/stories/index.js +43 -0
- package/lib/esm/ai/preview/stories/index.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js +34 -0
- package/lib/esm/ai/preview/stories/preview-code-confirmation.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-languages.story.js +34 -0
- package/lib/esm/ai/preview/stories/preview-code-languages.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-loading.story.js +28 -0
- package/lib/esm/ai/preview/stories/preview-code-loading.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-read.story.js +33 -0
- package/lib/esm/ai/preview/stories/preview-code-read.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code-write.story.js +33 -0
- package/lib/esm/ai/preview/stories/preview-code-write.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-code.stories.js +97 -0
- package/lib/esm/ai/preview/stories/preview-code.stories.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-confirmation-standalone.story.js +31 -0
- package/lib/esm/ai/preview/stories/preview-confirmation-standalone.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-data-grid.story.js +69 -0
- package/lib/esm/ai/preview/stories/preview-data-grid.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview.stories.js +60 -0
- package/lib/esm/ai/preview/stories/preview.stories.js.map +1 -0
- package/lib/esm/code-block/code-languages.js.map +1 -1
- package/lib/esm/kbd/stories/kbd.stories.js +1 -1
- package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/esm/popover/use-popover.js.map +1 -1
- package/lib/esm/spotlight/use-spotlight.js.map +1 -1
- package/lib/esm/text-link/TextLink.js +3 -2
- package/lib/esm/text-link/TextLink.js.map +1 -1
- package/lib/esm/text-link/stories/index.js +3 -0
- package/lib/esm/text-link/stories/index.js.map +1 -1
- package/lib/esm/text-link/stories/text-link-external-underline.story.js +28 -0
- package/lib/esm/text-link/stories/text-link-external-underline.story.js.map +1 -0
- package/lib/esm/text-link/stories/text-link-internal-underline.story.js +3 -3
- package/lib/esm/text-link/stories/text-link-internal-underline.story.js.map +1 -1
- package/lib/esm/text-link/stories/text-link.stories.js +14 -1
- package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/esm/toast/Toast.js.map +1 -1
- package/lib/types/ai/code-preview/CodePreview.d.ts +1 -0
- package/lib/types/ai/code-preview/CodePreview.d.ts.map +1 -1
- package/lib/types/ai/index.d.ts +1 -0
- package/lib/types/ai/index.d.ts.map +1 -1
- package/lib/types/ai/preview/Preview.d.ts +64 -0
- package/lib/types/ai/preview/Preview.d.ts.map +1 -0
- package/lib/types/ai/preview/index.d.ts +22 -0
- package/lib/types/ai/preview/index.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/index.d.ts +35 -0
- package/lib/types/ai/preview/stories/index.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-confirmation.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-code-confirmation.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-languages.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-code-languages.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-loading.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-code-loading.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-read.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-code-read.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code-write.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-code-write.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-code.stories.d.ts +31 -0
- package/lib/types/ai/preview/stories/preview-code.stories.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-confirmation-standalone.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-confirmation-standalone.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-data-grid.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-data-grid.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview.stories.d.ts +28 -0
- package/lib/types/ai/preview/stories/preview.stories.d.ts.map +1 -0
- package/lib/types/code-block/code-languages.d.ts.map +1 -1
- package/lib/types/popover/use-popover.d.ts.map +1 -1
- package/lib/types/spotlight/use-spotlight.d.ts.map +1 -1
- package/lib/types/text-link/TextLink.d.ts +6 -5
- package/lib/types/text-link/TextLink.d.ts.map +1 -1
- package/lib/types/text-link/stories/index.d.ts +2 -0
- package/lib/types/text-link/stories/index.d.ts.map +1 -1
- package/lib/types/text-link/stories/text-link-external-underline.story.d.ts +24 -0
- package/lib/types/text-link/stories/text-link-external-underline.story.d.ts.map +1 -0
- package/lib/types/text-link/stories/text-link-internal-underline.story.d.ts.map +1 -1
- package/lib/types/text-link/stories/text-link.stories.d.ts +1 -0
- package/lib/types/text-link/stories/text-link.stories.d.ts.map +1 -1
- package/lib/types/toast/Toast.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
|
|
22
|
+
"use strict";
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.WithConfirmationFooter = exports.OtherLanguages = exports.Write = exports.Read = exports.Loading = void 0;
|
|
25
|
+
const Preview_1 = require("../Preview");
|
|
26
|
+
const _1 = require(".");
|
|
27
|
+
const componentMeta = {
|
|
28
|
+
component: Preview_1.Preview,
|
|
29
|
+
parameters: {
|
|
30
|
+
controls: { disable: true },
|
|
31
|
+
},
|
|
32
|
+
title: 'Components/AI/Preview/Code',
|
|
33
|
+
};
|
|
34
|
+
exports.default = componentMeta;
|
|
35
|
+
exports.Loading = {
|
|
36
|
+
args: {},
|
|
37
|
+
parameters: {
|
|
38
|
+
docs: {
|
|
39
|
+
source: {
|
|
40
|
+
code: _1.PreviewCodeLoadingSrc,
|
|
41
|
+
language: 'tsx',
|
|
42
|
+
type: 'code',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
render: _1.PreviewCodeLoading,
|
|
47
|
+
};
|
|
48
|
+
exports.Read = {
|
|
49
|
+
args: {},
|
|
50
|
+
parameters: {
|
|
51
|
+
docs: {
|
|
52
|
+
source: {
|
|
53
|
+
code: _1.PreviewCodeReadSrc,
|
|
54
|
+
language: 'tsx',
|
|
55
|
+
type: 'code',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
render: _1.PreviewCodeRead,
|
|
60
|
+
};
|
|
61
|
+
exports.Write = {
|
|
62
|
+
args: {},
|
|
63
|
+
parameters: {
|
|
64
|
+
docs: {
|
|
65
|
+
source: {
|
|
66
|
+
code: _1.PreviewCodeWriteSrc,
|
|
67
|
+
language: 'tsx',
|
|
68
|
+
type: 'code',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
render: _1.PreviewCodeWrite,
|
|
73
|
+
};
|
|
74
|
+
exports.OtherLanguages = {
|
|
75
|
+
args: {},
|
|
76
|
+
parameters: {
|
|
77
|
+
docs: {
|
|
78
|
+
source: {
|
|
79
|
+
code: _1.PreviewCodeLanguagesSrc,
|
|
80
|
+
language: 'tsx',
|
|
81
|
+
type: 'code',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
render: _1.PreviewCodeLanguages,
|
|
86
|
+
};
|
|
87
|
+
exports.WithConfirmationFooter = {
|
|
88
|
+
args: {},
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
source: {
|
|
92
|
+
code: _1.PreviewCodeConfirmationSrc,
|
|
93
|
+
language: 'tsx',
|
|
94
|
+
type: 'code',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
render: _1.PreviewCodeConfirmation,
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=preview-code.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-code.stories.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-code.stories.tsx"],"names":[],"mappings":";;;AAsBA,wCAAqC;AACrC,wBAWW;AAEX,MAAM,aAAa,GAAyB;IAC1C,SAAS,EAAE,iBAAO;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,KAAK,EAAE,4BAA4B;CACpC,CAAC;AAEF,kBAAe,aAAa,CAAC;AAIhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,qBAAkB;CAC3B,CAAC;AAEW,QAAA,IAAI,GAAU;IACzB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAkB;gBACxB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,0BAAuB;gBAC7B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,uBAAoB;CAC7B,CAAC;AAEW,QAAA,sBAAsB,GAAU;IAC3C,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,6BAA0B;gBAChC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,0BAAuB;CAChC,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Preview } from '../Preview';\nimport {\n PreviewCodeConfirmation,\n PreviewCodeConfirmationSrc,\n PreviewCodeLanguages,\n PreviewCodeLanguagesSrc,\n PreviewCodeLoading,\n PreviewCodeLoadingSrc,\n PreviewCodeRead,\n PreviewCodeReadSrc,\n PreviewCodeWrite,\n PreviewCodeWriteSrc,\n} from '.';\n\nconst componentMeta: Meta<typeof Preview> = {\n component: Preview,\n parameters: {\n controls: { disable: true },\n },\n title: 'Components/AI/Preview/Code',\n};\n\nexport default componentMeta;\n\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Loading: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewCodeLoadingSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewCodeLoading,\n};\n\nexport const Read: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewCodeReadSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewCodeRead,\n};\n\nexport const Write: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewCodeWriteSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewCodeWrite,\n};\n\nexport const OtherLanguages: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewCodeLanguagesSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewCodeLanguages,\n};\n\nexport const WithConfirmationFooter: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewCodeConfirmationSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewCodeConfirmation,\n};\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const ai_1 = require("@neo4j-ndl/react/ai");
|
|
27
|
+
const react_2 = require("react");
|
|
28
|
+
const Component = () => {
|
|
29
|
+
const [status, setStatus] = (0, react_2.useState)('pending');
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(ai_1.Preview, { children: (0, jsx_runtime_1.jsx)(ai_1.Preview.Confirmation, { status: status, isFooter: false, confirmedActionText: "Action confirmed", rejectedActionText: "Action rejected", actions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { variant: "neutral", size: "small", onClick: () => setStatus('rejected'), children: "Reject" }), (0, jsx_runtime_1.jsx)(react_1.FilledButton, { variant: "primary", size: "small", onClick: () => setStatus('confirmed'), children: "Confirm" })] }), children: "This confirmation is used when the assistant does not have a preview, but asks about doing something in plain text on top of the canvas in the chat. Do you approve this action?" }) }));
|
|
31
|
+
};
|
|
32
|
+
exports.default = Component;
|
|
33
|
+
//# sourceMappingURL=preview-confirmation-standalone.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-confirmation-standalone.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-confirmation-standalone.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgE;AAChE,4CAA8C;AAC9C,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvB,IAAA,gBAAQ,EACN,SAAS,CACV,CAAC;IAEJ,OAAO,CACL,uBAAC,YAAO,cACN,uBAAC,YAAO,CAAC,YAAY,IACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,KAAK,EACf,mBAAmB,EAAC,kBAAkB,EACtC,kBAAkB,EAAC,iBAAiB,EACpC,OAAO,EACL,6DACE,uBAAC,sBAAc,IACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,uBAGrB,EACjB,uBAAC,oBAAY,IACX,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,wBAGxB,IACd,iMAMgB,GACf,CACX,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 { FilledButton, OutlinedButton } from '@neo4j-ndl/react';\nimport { Preview } from '@neo4j-ndl/react/ai';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [status, setStatus] =\n useState<React.ComponentProps<typeof Preview.Confirmation>['status']>(\n 'pending',\n );\n\n return (\n <Preview>\n <Preview.Confirmation\n status={status}\n isFooter={false}\n confirmedActionText=\"Action confirmed\"\n rejectedActionText=\"Action rejected\"\n actions={\n <>\n <OutlinedButton\n variant=\"neutral\"\n size=\"small\"\n onClick={() => setStatus('rejected')}\n >\n Reject\n </OutlinedButton>\n <FilledButton\n variant=\"primary\"\n size=\"small\"\n onClick={() => setStatus('confirmed')}\n >\n Confirm\n </FilledButton>\n </>\n }\n >\n This confirmation is used when the assistant does not have a preview,\n but asks about doing something in plain text on top of the canvas in the\n chat. Do you approve this action?\n </Preview.Confirmation>\n </Preview>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const ai_1 = require("@neo4j-ndl/react/ai");
|
|
27
|
+
const react_table_1 = require("@tanstack/react-table");
|
|
28
|
+
const react_2 = require("react");
|
|
29
|
+
const DATA = [
|
|
30
|
+
{
|
|
31
|
+
project_role: 'Viewer',
|
|
32
|
+
user: 'John Doe',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
project_role: 'Viewer',
|
|
36
|
+
user: 'Alice Appleton',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
project_role: 'Editor',
|
|
40
|
+
user: 'Bob Blueburr',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const Component = () => {
|
|
44
|
+
const [status, setStatus] = (0, react_2.useState)('pending');
|
|
45
|
+
const table = (0, react_table_1.useReactTable)({
|
|
46
|
+
columns: [
|
|
47
|
+
{
|
|
48
|
+
accessorKey: 'user',
|
|
49
|
+
header: 'User',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
accessorKey: 'project_role',
|
|
53
|
+
header: 'Project Role',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
data: DATA,
|
|
57
|
+
defaultColumn: {
|
|
58
|
+
minSize: 100,
|
|
59
|
+
},
|
|
60
|
+
enableSorting: true,
|
|
61
|
+
getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
|
|
62
|
+
getSortedRowModel: (0, react_table_1.getSortedRowModel)(),
|
|
63
|
+
});
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(ai_1.Preview, { children: [(0, jsx_runtime_1.jsx)(react_1.DataGrid, { isResizable: false, tableInstance: table, isKeyboardNavigable: false, styling: {
|
|
65
|
+
borderStyle: 'all-sides',
|
|
66
|
+
}, components: {
|
|
67
|
+
Navigation: null,
|
|
68
|
+
} }), (0, jsx_runtime_1.jsx)(ai_1.Preview.Confirmation, { isFooter: true, status: status, actions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { variant: "neutral", size: "small", onClick: () => setStatus('rejected'), children: "Skip" }), (0, jsx_runtime_1.jsx)(react_1.FilledButton, { variant: "primary", size: "small", onClick: () => setStatus('confirmed'), children: "Invite users" })] }), children: "Assistant wants to perform an action" })] }));
|
|
69
|
+
};
|
|
70
|
+
exports.default = Component;
|
|
71
|
+
//# sourceMappingURL=preview-data-grid.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-data-grid.story.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-data-grid.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA0E;AAC1E,4CAA8C;AAC9C,uDAI+B;AAC/B,iCAAiC;AAEjC,MAAM,IAAI,GAAG;IACX;QACE,YAAY,EAAE,QAAQ;QACtB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,YAAY,EAAE,QAAQ;QACtB,IAAI,EAAE,gBAAgB;KACvB;IACD;QACE,YAAY,EAAE,QAAQ;QACtB,IAAI,EAAE,cAAc;KACrB;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvB,IAAA,gBAAQ,EACN,SAAS,CACV,CAAC;IAEJ,MAAM,KAAK,GAAG,IAAA,2BAAa,EAAC;QAC1B,OAAO,EAAE;YACP;gBACE,WAAW,EAAE,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;YACD;gBACE,WAAW,EAAE,cAAc;gBAC3B,MAAM,EAAE,cAAc;aACvB;SACF;QACD,IAAI,EAAE,IAAI;QACV,aAAa,EAAE;YACb,OAAO,EAAE,GAAG;SACb;QACD,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,IAAA,6BAAe,GAAE;QAClC,iBAAiB,EAAE,IAAA,+BAAiB,GAAE;KACvC,CAAC,CAAC;IAEH,OAAO,CACL,wBAAC,YAAO,eACN,uBAAC,gBAAQ,IACP,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,KAAK,EACpB,mBAAmB,EAAE,KAAK,EAC1B,OAAO,EAAE;oBACP,WAAW,EAAE,WAAW;iBACzB,EACD,UAAU,EAAE;oBACV,UAAU,EAAE,IAAI;iBACjB,GACD,EACF,uBAAC,YAAO,CAAC,YAAY,IACnB,QAAQ,EAAE,IAAI,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EACL,6DACE,uBAAC,sBAAc,IACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,qBAGrB,EACjB,uBAAC,oBAAY,IACX,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,6BAGxB,IACd,qDAIgB,IACf,CACX,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 { DataGrid, FilledButton, OutlinedButton } from '@neo4j-ndl/react';\nimport { Preview } from '@neo4j-ndl/react/ai';\nimport {\n getCoreRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\nimport { useState } from 'react';\n\nconst DATA = [\n {\n project_role: 'Viewer',\n user: 'John Doe',\n },\n {\n project_role: 'Viewer',\n user: 'Alice Appleton',\n },\n {\n project_role: 'Editor',\n user: 'Bob Blueburr',\n },\n];\n\nconst Component = () => {\n const [status, setStatus] =\n useState<React.ComponentProps<typeof Preview.Confirmation>['status']>(\n 'pending',\n );\n\n const table = useReactTable({\n columns: [\n {\n accessorKey: 'user',\n header: 'User',\n },\n {\n accessorKey: 'project_role',\n header: 'Project Role',\n },\n ],\n data: DATA,\n defaultColumn: {\n minSize: 100,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n });\n\n return (\n <Preview>\n <DataGrid\n isResizable={false}\n tableInstance={table}\n isKeyboardNavigable={false}\n styling={{\n borderStyle: 'all-sides',\n }}\n components={{\n Navigation: null,\n }}\n />\n <Preview.Confirmation\n isFooter={true}\n status={status}\n actions={\n <>\n <OutlinedButton\n variant=\"neutral\"\n size=\"small\"\n onClick={() => setStatus('rejected')}\n >\n Skip\n </OutlinedButton>\n <FilledButton\n variant=\"primary\"\n size=\"small\"\n onClick={() => setStatus('confirmed')}\n >\n Invite users\n </FilledButton>\n </>\n }\n >\n Assistant wants to perform an action\n </Preview.Confirmation>\n </Preview>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
|
|
22
|
+
"use strict";
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.DataGridWithConfirmationFooter = exports.StandaloneConfirmation = void 0;
|
|
25
|
+
const Preview_1 = require("../Preview");
|
|
26
|
+
const _1 = require(".");
|
|
27
|
+
const componentMeta = {
|
|
28
|
+
component: Preview_1.Preview,
|
|
29
|
+
id: 'components-ai-preview',
|
|
30
|
+
parameters: {
|
|
31
|
+
controls: { disable: true },
|
|
32
|
+
},
|
|
33
|
+
tags: ['docsPage'],
|
|
34
|
+
title: 'Components/AI/Preview',
|
|
35
|
+
};
|
|
36
|
+
exports.default = componentMeta;
|
|
37
|
+
exports.StandaloneConfirmation = {
|
|
38
|
+
args: {},
|
|
39
|
+
parameters: {
|
|
40
|
+
docs: {
|
|
41
|
+
source: {
|
|
42
|
+
code: _1.PreviewConfirmationStandaloneSrc,
|
|
43
|
+
language: 'tsx',
|
|
44
|
+
type: 'code',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
render: _1.PreviewConfirmationStandalone,
|
|
49
|
+
};
|
|
50
|
+
exports.DataGridWithConfirmationFooter = {
|
|
51
|
+
args: {},
|
|
52
|
+
parameters: {
|
|
53
|
+
docs: {
|
|
54
|
+
source: {
|
|
55
|
+
code: _1.PreviewDataGridSrc,
|
|
56
|
+
language: 'tsx',
|
|
57
|
+
type: 'code',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
render: _1.PreviewDataGrid,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=preview.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.stories.js","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview.stories.tsx"],"names":[],"mappings":";;;AAsBA,wCAAqC;AACrC,wBAKW;AAEX,MAAM,aAAa,GAAyB;IAC1C,SAAS,EAAE,iBAAO;IAClB,EAAE,EAAE,uBAAuB;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,uBAAuB;CAC/B,CAAC;AAEF,kBAAe,aAAa,CAAC;AAIhB,QAAA,sBAAsB,GAAU;IAC3C,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,mCAAgC;gBACtC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,gCAA6B;CACtC,CAAC;AAEW,QAAA,8BAA8B,GAAU;IACnD,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAkB;gBACxB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Preview } from '../Preview';\nimport {\n PreviewConfirmationStandalone,\n PreviewConfirmationStandaloneSrc,\n PreviewDataGrid,\n PreviewDataGridSrc,\n} from '.';\n\nconst componentMeta: Meta<typeof Preview> = {\n component: Preview,\n id: 'components-ai-preview',\n parameters: {\n controls: { disable: true },\n },\n tags: ['docsPage'],\n title: 'Components/AI/Preview',\n};\n\nexport default componentMeta;\n\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const StandaloneConfirmation: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewConfirmationStandaloneSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewConfirmationStandalone,\n};\n\nexport const DataGridWithConfirmationFooter: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: PreviewDataGridSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: PreviewDataGrid,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-languages.js","sourceRoot":"","sources":["../../../src/code-block/code-languages.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gJAAgJ;AACnI,QAAA,SAAS,GAAG;IACvB,UAAU;IACV,MAAM;IACN,GAAG;IACH,QAAQ;IACR,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,SAAS;IACT,MAAM;IACN,SAAS;IACT,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,OAAO;IACP,MAAM;IACN,KAAK;IACL,YAAY;IACZ,KAAK;IACL,MAAM;CACE,CAAC;AAIJ,MAAM,YAAY,GAAG,CAAC,QAAsB,EAAE,EAAE;IACrD,iIAAiI;IACjI,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,
|
|
1
|
+
{"version":3,"file":"code-languages.js","sourceRoot":"","sources":["../../../src/code-block/code-languages.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gJAAgJ;AACnI,QAAA,SAAS,GAAG;IACvB,UAAU;IACV,MAAM;IACN,GAAG;IACH,QAAQ;IACR,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,SAAS;IACT,MAAM;IACN,SAAS;IACT,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,OAAO;IACP,MAAM;IACN,KAAK;IACL,YAAY;IACZ,KAAK;IACL,MAAM;CACE,CAAC;AAIJ,MAAM,YAAY,GAAG,CAAC,QAAsB,EAAE,EAAE;IACrD,iIAAiI;IACjI,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,yDAAc,4DAA4D,IAAE;QAC9E,KAAK,MAAM;YACT,yDAAc,wDAAwD,IAAE;QAC1E,KAAK,GAAG;YACN,yDAAc,qDAAqD,IAAE;QACvE,KAAK,QAAQ;YACX,yDAAc,0DAA0D,IAAE;QAC5E,KAAK,KAAK;YACR,yDAAc,uDAAuD,IAAE;QACzE,KAAK,YAAY;YACf,yDAAc,8DAA8D,IAAE;QAChF,KAAK,QAAQ;YACX,yDAAc,0DAA0D,IAAE;QAC5E,KAAK,QAAQ;YACX,yDAAc,0DAA0D,IAAE;QAC5E,KAAK,MAAM;YACT,yDAAc,wDAAwD,IAAE;QAC1E,KAAK,IAAI;YACP,yDAAc,sDAAsD,IAAE;QACxE,KAAK,SAAS;YACZ,yDAAc,2DAA2D,IAAE;QAC7E,KAAK,MAAM;YACT,yDAAc,wDAAwD,IAAE;QAC1E,KAAK,SAAS;YACZ,yDAAc,2DAA2D,IAAE;QAC7E,KAAK,YAAY;YACf,yDAAc,8DAA8D,IAAE;QAChF,KAAK,KAAK;YACR,yDAAc,uDAAuD,IAAE;QACzE,KAAK,QAAQ;YACX,yDAAc,0DAA0D,IAAE;QAC5E,KAAK,KAAK;YACR,yDAAc,uDAAuD,IAAE;QACzE,KAAK,QAAQ;YACX,yDAAc,0DAA0D,IAAE;QAC5E,KAAK,OAAO;YACV,yDAAc,yDAAyD,IAAE;QAC3E,KAAK,MAAM;YACT,yDAAc,wDAAwD,IAAE;QAC1E,KAAK,KAAK;YACR,yDAAc,uDAAuD,IAAE;QACzE,KAAK,YAAY;YACf,yDAAc,8DAA8D,IAAE;QAChF,KAAK,KAAK;YACR,yDAAc,2DAA2D,IAAE;QAC7E,KAAK,MAAM;YACT,yDAAc,wDAAwD,IAAE;QAE1E;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC;AAvDW,QAAA,YAAY,gBAuDvB","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\n// Source for available languages: https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD\nexport const Languages = [\n 'asciidoc',\n 'bash',\n 'c',\n 'csharp',\n 'css',\n 'css-extras',\n 'cypher',\n 'docker',\n 'json',\n 'go',\n 'graphql',\n 'java',\n 'javadoc',\n 'javascript',\n 'jsx',\n 'kotlin',\n 'php',\n 'python',\n 'regex',\n 'rust',\n 'sql',\n 'typescript',\n 'xml',\n 'yaml',\n] as const;\n\nexport type LanguageProp = (typeof Languages)[number];\n\nexport const loadLanguage = (language: LanguageProp) => {\n /* need to import the languages dynamically to reduce the bundle size and need to use a string literal for proper tree shaking */\n switch (language) {\n case 'asciidoc':\n return import('react-syntax-highlighter/dist/esm/languages/prism/asciidoc');\n case 'bash':\n return import('react-syntax-highlighter/dist/esm/languages/prism/bash');\n case 'c':\n return import('react-syntax-highlighter/dist/esm/languages/prism/c');\n case 'csharp':\n return import('react-syntax-highlighter/dist/esm/languages/prism/csharp');\n case 'css':\n return import('react-syntax-highlighter/dist/esm/languages/prism/css');\n case 'css-extras':\n return import('react-syntax-highlighter/dist/esm/languages/prism/css-extras');\n case 'cypher':\n return import('react-syntax-highlighter/dist/esm/languages/prism/cypher');\n case 'docker':\n return import('react-syntax-highlighter/dist/esm/languages/prism/docker');\n case 'json':\n return import('react-syntax-highlighter/dist/esm/languages/prism/json');\n case 'go':\n return import('react-syntax-highlighter/dist/esm/languages/prism/go');\n case 'graphql':\n return import('react-syntax-highlighter/dist/esm/languages/prism/graphql');\n case 'java':\n return import('react-syntax-highlighter/dist/esm/languages/prism/java');\n case 'javadoc':\n return import('react-syntax-highlighter/dist/esm/languages/prism/javadoc');\n case 'javascript':\n return import('react-syntax-highlighter/dist/esm/languages/prism/javascript');\n case 'jsx':\n return import('react-syntax-highlighter/dist/esm/languages/prism/jsx');\n case 'kotlin':\n return import('react-syntax-highlighter/dist/esm/languages/prism/kotlin');\n case 'php':\n return import('react-syntax-highlighter/dist/esm/languages/prism/php');\n case 'python':\n return import('react-syntax-highlighter/dist/esm/languages/prism/python');\n case 'regex':\n return import('react-syntax-highlighter/dist/esm/languages/prism/regex');\n case 'rust':\n return import('react-syntax-highlighter/dist/esm/languages/prism/rust');\n case 'sql':\n return import('react-syntax-highlighter/dist/esm/languages/prism/sql');\n case 'typescript':\n return import('react-syntax-highlighter/dist/esm/languages/prism/typescript');\n case 'xml':\n return import('react-syntax-highlighter/dist/esm/languages/prism/xml-doc');\n case 'yaml':\n return import('react-syntax-highlighter/dist/esm/languages/prism/yaml');\n\n default:\n throw new Error(`Unsupported language: ${language}`);\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.stories.js","sourceRoot":"","sources":["../../../../src/kbd/stories/kbd.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAkC;AAClC,wBAA2E;AAE3E,MAAM,aAAa,GAAqB;IACtC,SAAS,EAAE,WAAG;IACd,EAAE,EAAE,gBAAgB;IACpB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"kbd.stories.js","sourceRoot":"","sources":["../../../../src/kbd/stories/kbd.stories.tsx"],"names":[],"mappings":";;;AAsBA,uCAAkC;AAClC,wBAA2E;AAE3E,MAAM,aAAa,GAAqB;IACtC,SAAS,EAAE,WAAG;IACd,EAAE,EAAE,gBAAgB;IACpB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,mCAAmC;CAC3C,CAAC;AAEF,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,gBAAa;gBACnB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,aAAU;CACnB,CAAC;AAEW,QAAA,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAc;gBACpB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,cAAW;CACpB,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 { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport { Kbd } from '../../index';\nimport { KbdDefault, KbdDefaultSrc, KbdSequence, KbdSequenceSrc } from '.';\n\nconst componentMeta: Meta<typeof Kbd> = {\n component: Kbd,\n id: 'components-kbd',\n parameters: {\n controls: {},\n },\n tags: ['docsPage'],\n title: 'Components/Kbd (Keyboard display)',\n};\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Default: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: KbdDefaultSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: KbdDefault,\n};\n\nexport const Sequence: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: KbdSequenceSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: KbdSequence,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-popover.js","sourceRoot":"","sources":["../../../src/popover/use-popover.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-popover.js","sourceRoot":"","sources":["../../../src/popover/use-popover.tsx"],"names":[],"mappings":"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","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 autoUpdate,\n flip,\n offset,\n type OffsetOptions,\n type Placement,\n shift,\n useClick,\n useClientPoint,\n useDismiss,\n useFloating,\n useInteractions,\n type UseInteractionsReturn,\n useRole,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport { useMemo, useState } from 'react';\n\nexport interface PopoverOptions {\n isInitialOpen?: boolean;\n placement?: Placement;\n isOpen?: boolean;\n onOpenChange?: (open: boolean, event?: Event) => void;\n offsetOption?: OffsetOptions;\n anchorElement?: Element | null;\n anchorPosition?: {\n x: number;\n y: number;\n };\n anchorElementAsPortalAnchor?: boolean;\n shouldCaptureFocus?: boolean;\n initialFocus?: number | React.RefObject<HTMLElement | null>;\n role?:\n | 'tooltip'\n | 'dialog'\n | 'alertdialog'\n | 'menu'\n | 'listbox'\n | 'grid'\n | 'tree';\n closeOnClickOutside?: boolean;\n strategy?: 'fixed' | 'absolute';\n isPortaled?: boolean;\n}\n\nexport interface UsePopoverReturn\n extends UseInteractionsReturn, ReturnType<typeof useFloating> {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n labelId: string | undefined;\n descriptionId: string | undefined;\n transitionStyles: React.CSSProperties;\n setLabelId: (labelId: string | undefined) => void;\n setDescriptionId: (descriptionId: string | undefined) => void;\n anchorElementAsPortalAnchor: boolean | undefined;\n shouldCaptureFocus: boolean | undefined;\n initialFocus: number | React.RefObject<HTMLElement | null> | undefined;\n isPortaled: boolean;\n}\n\nexport function usePopover({\n isInitialOpen = false,\n placement = 'bottom',\n isOpen: controlledOpen,\n onOpenChange: setControlledOpen,\n offsetOption = 10,\n anchorElement,\n anchorPosition,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n role: roleProp,\n closeOnClickOutside,\n strategy = 'absolute',\n isPortaled = true,\n}: PopoverOptions = {}): UsePopoverReturn {\n const [isOpenUncontrolled, setIsOpenUncontrolled] = useState(isInitialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n const isOpen = controlledOpen ?? isOpenUncontrolled;\n const setIsOpen = setControlledOpen ?? setIsOpenUncontrolled;\n const data = useFloating({\n elements: {\n reference: anchorElement,\n },\n middleware: [\n offset(offsetOption),\n flip({\n crossAxis: placement.includes('-'),\n fallbackAxisSideDirection: 'end',\n padding: 5,\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open, event) => {\n setIsOpen(open);\n setControlledOpen?.(open, event);\n },\n open: isOpen,\n placement: placement,\n strategy,\n whileElementsMounted: autoUpdate,\n });\n const context = data.context;\n\n const click = useClick(context, {\n enabled: controlledOpen === undefined,\n });\n\n const dismiss = useDismiss(context, {\n outsidePress: closeOnClickOutside,\n });\n const role = useRole(context, {\n role: roleProp,\n });\n\n const clientPoint = useClientPoint(context, {\n enabled: anchorPosition !== undefined,\n x: anchorPosition?.x,\n y: anchorPosition?.y,\n });\n\n const interactions = useInteractions([click, dismiss, role, clientPoint]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n return useMemo(\n () => ({\n isOpen,\n setIsOpen,\n ...interactions,\n ...data,\n transitionStyles,\n labelId,\n descriptionId,\n setLabelId,\n setDescriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n }),\n [\n isOpen,\n setIsOpen,\n interactions,\n data,\n transitionStyles,\n labelId,\n descriptionId,\n anchorElementAsPortalAnchor,\n shouldCaptureFocus,\n initialFocus,\n isPortaled,\n ],\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spotlight.js","sourceRoot":"","sources":["../../../src/spotlight/use-spotlight.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-spotlight.js","sourceRoot":"","sources":["../../../src/spotlight/use-spotlight.tsx"],"names":[],"mappings":"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","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 autoUpdate,\n flip,\n offset,\n type Placement,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n type UseInteractionsReturn,\n useRole,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport { useMemo, useState } from 'react';\n\nexport interface SpotlightOptions {\n isInitialOpen?: boolean;\n placement?: Placement;\n isOpen?: boolean;\n onOpenChange?: (open: boolean, event?: Event) => void;\n anchorElement?: Element | null;\n anchorElementAsPortalAnchor?: boolean;\n initialFocus?: number | React.MutableRefObject<HTMLElement | null>;\n closeOnClickOutside?: boolean;\n strategy?: 'fixed' | 'absolute';\n}\n\nexport interface UseSpotlightReturn\n extends UseInteractionsReturn, ReturnType<typeof useFloating> {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n labelId: string | undefined;\n transitionStyles: React.CSSProperties;\n anchorElementAsPortalAnchor: boolean | undefined;\n initialFocus: number | React.MutableRefObject<HTMLElement | null> | undefined;\n}\n\nexport function useSpotlight({\n isInitialOpen = false,\n placement = 'bottom',\n isOpen: controlledOpen,\n onOpenChange: setControlledOpen,\n anchorElement,\n anchorElementAsPortalAnchor,\n initialFocus,\n closeOnClickOutside,\n strategy = 'absolute',\n}: SpotlightOptions = {}): UseSpotlightReturn {\n const [isOpenUncontrolled, setIsOpenUncontrolled] = useState(isInitialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n const isOpen = controlledOpen ?? isOpenUncontrolled;\n const setIsOpen = setControlledOpen ?? setIsOpenUncontrolled;\n const data = useFloating({\n elements: {\n reference: anchorElement,\n },\n middleware: [\n offset(10),\n flip({\n crossAxis: placement.includes('-'),\n fallbackAxisSideDirection: 'end',\n padding: 5,\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open, event) => {\n setIsOpen(open);\n setControlledOpen?.(open, event);\n },\n open: isOpen,\n placement: placement,\n strategy,\n whileElementsMounted: autoUpdate,\n });\n const context = data.context;\n\n const click = useClick(context, {\n enabled: controlledOpen === undefined,\n });\n\n const dismiss = useDismiss(context, {\n outsidePress: closeOnClickOutside,\n });\n const role = useRole(context, {\n role: 'dialog',\n });\n\n const interactions = useInteractions([click, dismiss, role]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n return useMemo(\n () => ({\n isOpen,\n setIsOpen,\n ...interactions,\n ...data,\n anchorElementAsPortalAnchor,\n descriptionId,\n initialFocus,\n labelId,\n setDescriptionId,\n setLabelId,\n transitionStyles,\n }),\n [\n isOpen,\n setIsOpen,\n interactions,\n data,\n transitionStyles,\n labelId,\n anchorElementAsPortalAnchor,\n descriptionId,\n initialFocus,\n ],\n );\n}\n"]}
|
|
@@ -39,14 +39,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
39
39
|
const classnames_1 = __importDefault(require("classnames"));
|
|
40
40
|
const icons_1 = require("../icons");
|
|
41
41
|
const TextLink = (_a) => {
|
|
42
|
-
var { children, href, type = 'internal', as, className, target = type === 'external' ? '_blank' : '', style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "href", "type", "as", "className", "target", "style", "htmlAttributes", "ref"]);
|
|
42
|
+
var { children, href, type = 'internal', as, className, target = type === 'external' || type === 'external-underline' ? '_blank' : '', style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "href", "type", "as", "className", "target", "style", "htmlAttributes", "ref"]);
|
|
43
43
|
const Component = as !== null && as !== void 0 ? as : 'a';
|
|
44
44
|
const classes = (0, classnames_1.default)('ndl-text-link', className, {
|
|
45
45
|
'ndl-external-link': type === 'external',
|
|
46
|
+
'ndl-external-underline': type === 'external-underline',
|
|
46
47
|
'ndl-internal-icon': type === 'internal-icon',
|
|
47
48
|
'ndl-internal-underline': type === 'internal-underline',
|
|
48
49
|
});
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, href: href, ref: ref, style: style, target: target }, restProps, htmlAttributes, { children: [children, type === 'external' && ((0, jsx_runtime_1.jsx)(icons_1.ArrowUpRightIconOutline, { className: "ndl-external-link-icon" })), type === 'internal-icon' && ((0, jsx_runtime_1.jsx)(icons_1.ChevronRightIconOutline, { className: "ndl-external-link-icon" }))] })));
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ className: classes, href: href, ref: ref, style: style, target: target }, restProps, htmlAttributes, { children: [children, (type === 'external' || type === 'external-underline') && ((0, jsx_runtime_1.jsx)(icons_1.ArrowUpRightIconOutline, { className: "ndl-external-link-icon" })), type === 'internal-icon' && ((0, jsx_runtime_1.jsx)(icons_1.ChevronRightIconOutline, { className: "ndl-external-link-icon" }))] })));
|
|
50
51
|
};
|
|
51
52
|
exports.TextLink = TextLink;
|
|
52
53
|
//# sourceMappingURL=TextLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextLink.js","sourceRoot":"","sources":["../../../src/text-link/TextLink.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAIpC,oCAA4E;
|
|
1
|
+
{"version":3,"file":"TextLink.js","sourceRoot":"","sources":["../../../src/text-link/TextLink.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAIpC,oCAA4E;AAkCrE,MAAM,QAAQ,GAAG,CAAoC,EAWjB,EAAE,EAAE;QAXa,EAC1D,QAAQ,EACR,IAAI,EACJ,IAAI,GAAG,UAAU,EACjB,EAAE,EACF,SAAS,EACT,MAAM,GAAG,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAC7E,KAAK,EACL,cAAc,EACd,GAAG,OAEsC,EADtC,SAAS,cAV8C,2FAW3D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,GAAG,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,eAAe,EAAE,SAAS,EAAE;QACrD,mBAAmB,EAAE,IAAI,KAAK,UAAU;QACxC,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;QACvD,mBAAmB,EAAE,IAAI,KAAK,eAAe;QAC7C,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;KACxD,CAAC,CAAC;IAEH,OAAO,CACL,wBAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,IACV,SAAS,EACT,cAAc,eAEjB,QAAQ,EACR,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,IAAI,CACzD,uBAAC,+BAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,EACA,IAAI,KAAK,eAAe,IAAI,CAC3B,uBAAC,+BAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,QAAQ,YAwCnB","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 { ArrowUpRightIconOutline, ChevronRightIconOutline } from '../icons';\n\ntype TextLinkType =\n | 'internal'\n | 'internal-underline'\n | 'internal-icon'\n | 'external'\n | 'external-underline';\n\ntype TextLinkProps = {\n /** The content displayed inside the link */\n children: React.ReactNode;\n\n /** The URL the link points to */\n href?: string;\n\n /**\n * The type of the text link\n * - 'internal': A link to another page within the application\n * - 'internal-underline': A link to another page within the application with an underline\n * - 'internal-icon': A link to another page within the application with an icon\n * - 'external': A link to an external website. An external link icon is appended.\n * - 'external-underline': A link to an external website with an underline and an external link icon is appended.\n * @default 'internal'\n */\n type?: TextLinkType;\n\n /** Specifies where to open the linked document. If omitted and `type` is `\"external\"` it defaults to `\"_blank\"`. */\n target?: HTMLAnchorElement['target'];\n\n /** Additional class name */\n className?: string;\n};\n\nexport const TextLink = <T extends React.ElementType = 'a'>({\n children,\n href,\n type = 'internal',\n as,\n className,\n target = type === 'external' || type === 'external-underline' ? '_blank' : '',\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TextLinkProps>) => {\n const Component: React.ElementType = as ?? 'a';\n\n const classes = classNames('ndl-text-link', className, {\n 'ndl-external-link': type === 'external',\n 'ndl-external-underline': type === 'external-underline',\n 'ndl-internal-icon': type === 'internal-icon',\n 'ndl-internal-underline': type === 'internal-underline',\n });\n\n return (\n <Component\n className={classes}\n href={href}\n ref={ref}\n style={style}\n target={target}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n {(type === 'external' || type === 'external-underline') && (\n <ArrowUpRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n {type === 'internal-icon' && (\n <ChevronRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n </Component>\n );\n};\n"]}
|
|
@@ -23,11 +23,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.TextLinkInternalUnderlineSource = exports.TextLinkInternalIconSource = exports.TextLinkExternalSource = exports.TextLinkDefaultSource = exports.TextLinkInternalUnderline = exports.TextLinkInternalIcon = exports.TextLinkExternal = exports.TextLinkDefault = void 0;
|
|
26
|
+
exports.TextLinkInternalUnderlineSource = exports.TextLinkInternalIconSource = exports.TextLinkExternalUnderlineSource = exports.TextLinkExternalSource = exports.TextLinkDefaultSource = exports.TextLinkInternalUnderline = exports.TextLinkInternalIcon = exports.TextLinkExternalUnderline = exports.TextLinkExternal = exports.TextLinkDefault = void 0;
|
|
27
27
|
var text_link_default_story_1 = require("./text-link-default.story");
|
|
28
28
|
Object.defineProperty(exports, "TextLinkDefault", { enumerable: true, get: function () { return __importDefault(text_link_default_story_1).default; } });
|
|
29
29
|
var text_link_external_story_1 = require("./text-link-external.story");
|
|
30
30
|
Object.defineProperty(exports, "TextLinkExternal", { enumerable: true, get: function () { return __importDefault(text_link_external_story_1).default; } });
|
|
31
|
+
var text_link_external_underline_story_1 = require("./text-link-external-underline.story");
|
|
32
|
+
Object.defineProperty(exports, "TextLinkExternalUnderline", { enumerable: true, get: function () { return __importDefault(text_link_external_underline_story_1).default; } });
|
|
31
33
|
var text_link_internal_icon_story_1 = require("./text-link-internal-icon.story");
|
|
32
34
|
Object.defineProperty(exports, "TextLinkInternalIcon", { enumerable: true, get: function () { return __importDefault(text_link_internal_icon_story_1).default; } });
|
|
33
35
|
var text_link_internal_underline_story_1 = require("./text-link-internal-underline.story");
|
|
@@ -35,10 +37,12 @@ Object.defineProperty(exports, "TextLinkInternalUnderline", { enumerable: true,
|
|
|
35
37
|
const export_stories_utils_1 = require("../../_common/export-stories-utils");
|
|
36
38
|
const text_link_default_story_raw_1 = __importDefault(require("./text-link-default.story?raw"));
|
|
37
39
|
const text_link_external_story_raw_1 = __importDefault(require("./text-link-external.story?raw"));
|
|
40
|
+
const text_link_external_underline_story_raw_1 = __importDefault(require("./text-link-external-underline.story?raw"));
|
|
38
41
|
const text_link_internal_icon_story_raw_1 = __importDefault(require("./text-link-internal-icon.story?raw"));
|
|
39
42
|
const text_link_internal_underline_story_raw_1 = __importDefault(require("./text-link-internal-underline.story?raw"));
|
|
40
43
|
exports.TextLinkDefaultSource = (0, export_stories_utils_1.removeLicenseHeader)(text_link_default_story_raw_1.default);
|
|
41
44
|
exports.TextLinkExternalSource = (0, export_stories_utils_1.removeLicenseHeader)(text_link_external_story_raw_1.default);
|
|
45
|
+
exports.TextLinkExternalUnderlineSource = (0, export_stories_utils_1.removeLicenseHeader)(text_link_external_underline_story_raw_1.default);
|
|
42
46
|
exports.TextLinkInternalIconSource = (0, export_stories_utils_1.removeLicenseHeader)(text_link_internal_icon_story_raw_1.default);
|
|
43
47
|
exports.TextLinkInternalUnderlineSource = (0, export_stories_utils_1.removeLicenseHeader)(text_link_internal_underline_story_raw_1.default);
|
|
44
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/text-link/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,qEAAuE;AAA9D,2IAAA,OAAO,OAAmB;AACnC,uEAAyE;AAAhE,6IAAA,OAAO,OAAoB;AACpC,iFAAkF;AAAzE,sJAAA,OAAO,OAAwB;AACxC,2FAA4F;AAAnF,gKAAA,OAAO,OAA6B;AAE7C,6EAAyE;AACzE,gGAAqE;AACrE,kGAAuE;AACvE,4GAAgF;AAChF,sHAA0F;AAE7E,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,qCAAwB,CACzB,CAAC;AACW,QAAA,sBAAsB,GAAG,IAAA,0CAAmB,EACvD,sCAAyB,CAC1B,CAAC;AACW,QAAA,0BAA0B,GAAG,IAAA,0CAAmB,EAC3D,2CAA6B,CAC9B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,gDAAkC,CACnC,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\nexport { default as TextLinkDefault } from './text-link-default.story';\nexport { default as TextLinkExternal } from './text-link-external.story';\nexport { default as TextLinkInternalIcon } from './text-link-internal-icon.story';\nexport { default as TextLinkInternalUnderline } from './text-link-internal-underline.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport TextLinkDefaultSourceRaw from './text-link-default.story?raw';\nimport TextLinkExternalSourceRaw from './text-link-external.story?raw';\nimport TextLinkInternalIconSourceRaw from './text-link-internal-icon.story?raw';\nimport TextLinkInternalUnderlineSourceRaw from './text-link-internal-underline.story?raw';\n\nexport const TextLinkDefaultSource = removeLicenseHeader(\n TextLinkDefaultSourceRaw,\n);\nexport const TextLinkExternalSource = removeLicenseHeader(\n TextLinkExternalSourceRaw,\n);\nexport const TextLinkInternalIconSource = removeLicenseHeader(\n TextLinkInternalIconSourceRaw,\n);\nexport const TextLinkInternalUnderlineSource = removeLicenseHeader(\n TextLinkInternalUnderlineSourceRaw,\n);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/text-link/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,qEAAuE;AAA9D,2IAAA,OAAO,OAAmB;AACnC,uEAAyE;AAAhE,6IAAA,OAAO,OAAoB;AACpC,2FAA4F;AAAnF,gKAAA,OAAO,OAA6B;AAC7C,iFAAkF;AAAzE,sJAAA,OAAO,OAAwB;AACxC,2FAA4F;AAAnF,gKAAA,OAAO,OAA6B;AAE7C,6EAAyE;AACzE,gGAAqE;AACrE,kGAAuE;AACvE,sHAA0F;AAC1F,4GAAgF;AAChF,sHAA0F;AAE7E,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,qCAAwB,CACzB,CAAC;AACW,QAAA,sBAAsB,GAAG,IAAA,0CAAmB,EACvD,sCAAyB,CAC1B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,gDAAkC,CACnC,CAAC;AACW,QAAA,0BAA0B,GAAG,IAAA,0CAAmB,EAC3D,2CAA6B,CAC9B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,gDAAkC,CACnC,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\nexport { default as TextLinkDefault } from './text-link-default.story';\nexport { default as TextLinkExternal } from './text-link-external.story';\nexport { default as TextLinkExternalUnderline } from './text-link-external-underline.story';\nexport { default as TextLinkInternalIcon } from './text-link-internal-icon.story';\nexport { default as TextLinkInternalUnderline } from './text-link-internal-underline.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport TextLinkDefaultSourceRaw from './text-link-default.story?raw';\nimport TextLinkExternalSourceRaw from './text-link-external.story?raw';\nimport TextLinkExternalUnderlineSourceRaw from './text-link-external-underline.story?raw';\nimport TextLinkInternalIconSourceRaw from './text-link-internal-icon.story?raw';\nimport TextLinkInternalUnderlineSourceRaw from './text-link-internal-underline.story?raw';\n\nexport const TextLinkDefaultSource = removeLicenseHeader(\n TextLinkDefaultSourceRaw,\n);\nexport const TextLinkExternalSource = removeLicenseHeader(\n TextLinkExternalSourceRaw,\n);\nexport const TextLinkExternalUnderlineSource = removeLicenseHeader(\n TextLinkExternalUnderlineSourceRaw,\n);\nexport const TextLinkInternalIconSource = removeLicenseHeader(\n TextLinkInternalIconSourceRaw,\n);\nexport const TextLinkInternalUnderlineSource = removeLicenseHeader(\n TextLinkInternalUnderlineSourceRaw,\n);\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["The quick brown fox", ' ', (0, jsx_runtime_1.jsx)(react_1.TextLink, { href: "https://neo4j.com", type: "external-underline", children: "jumps" }), ' ', "over the lazy dog."] }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# 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,mDAAiD;AAEjD,4CAAwD;AAExD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,wBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,oCACX,GAAG,EACvB,uBAAC,gBAAQ,IAAC,IAAI,EAAC,mBAAmB,EAAC,IAAI,EAAC,oBAAoB,sBAEjD,EAAC,GAAG,0BAEJ,CACd,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 { 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"]}
|
|
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const Component = () => {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(react_1.TextLink, { href: "/", type: "internal-underline", children: "
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["The quick brown fox", ' ', (0, jsx_runtime_1.jsx)(react_1.TextLink, { href: "/", type: "internal-underline", children: "jumps" }), ' ', "over the lazy dog."] }));
|
|
28
28
|
};
|
|
29
29
|
exports.default = Component;
|
|
30
30
|
//# 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,mDAAiD;AAEjD,
|
|
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,mDAAiD;AAEjD,4CAAwD;AAExD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,wBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,oCACX,GAAG,EACvB,uBAAC,gBAAQ,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,oBAAoB,sBAEjC,EAAC,GAAG,0BAEJ,CACd,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 { 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"]}
|