@neo4j-ndl/react 5.1.1 → 5.1.3
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/response/Response.js +127 -3
- package/lib/cjs/ai/response/Response.js.map +1 -1
- package/lib/cjs/ai/response/safe-href.js +108 -0
- package/lib/cjs/ai/response/safe-href.js.map +1 -0
- package/lib/cjs/ai/response/stories/response-all-components.story.js +10 -3
- package/lib/cjs/ai/response/stories/response-all-components.story.js.map +1 -1
- package/lib/cjs/ai/response/stories/response-lists.story.js +6 -1
- package/lib/cjs/ai/response/stories/response-lists.story.js.map +1 -1
- package/lib/cjs/button/stories/button-disabled.story.js +1 -1
- package/lib/cjs/button/stories/button-disabled.story.js.map +1 -1
- package/lib/cjs/button/stories/button-floating.story.js +1 -1
- package/lib/cjs/button/stories/button-floating.story.js.map +1 -1
- package/lib/cjs/button/stories/button-fluid.story.js +1 -1
- package/lib/cjs/button/stories/button-fluid.story.js.map +1 -1
- package/lib/cjs/button/stories/button-loading.story.js +1 -1
- package/lib/cjs/button/stories/button-loading.story.js.map +1 -1
- package/lib/cjs/button/stories/button-running-cancel.story.js +3 -4
- package/lib/cjs/button/stories/button-running-cancel.story.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js +1 -0
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/clipboard-button/ClipboardButton.js +1 -1
- package/lib/cjs/clipboard-button/ClipboardButton.js.map +1 -1
- package/lib/cjs/dropzone/Dropzone.js +2 -6
- package/lib/cjs/dropzone/Dropzone.js.map +1 -1
- package/lib/cjs/switch/Switch.js +1 -0
- package/lib/cjs/switch/Switch.js.map +1 -1
- package/lib/cjs/toast/Toast.js +4 -4
- package/lib/cjs/toast/Toast.js.map +1 -1
- package/lib/esm/ai/response/Response.js +127 -3
- package/lib/esm/ai/response/Response.js.map +1 -1
- package/lib/esm/ai/response/safe-href.js +104 -0
- package/lib/esm/ai/response/safe-href.js.map +1 -0
- package/lib/esm/ai/response/stories/response-all-components.story.js +10 -3
- package/lib/esm/ai/response/stories/response-all-components.story.js.map +1 -1
- package/lib/esm/ai/response/stories/response-lists.story.js +6 -1
- package/lib/esm/ai/response/stories/response-lists.story.js.map +1 -1
- package/lib/esm/button/stories/button-disabled.story.js +3 -3
- package/lib/esm/button/stories/button-disabled.story.js.map +1 -1
- package/lib/esm/button/stories/button-floating.story.js +3 -3
- package/lib/esm/button/stories/button-floating.story.js.map +1 -1
- package/lib/esm/button/stories/button-fluid.story.js +3 -3
- package/lib/esm/button/stories/button-fluid.story.js.map +1 -1
- package/lib/esm/button/stories/button-loading.story.js +3 -3
- package/lib/esm/button/stories/button-loading.story.js.map +1 -1
- package/lib/esm/button/stories/button-running-cancel.story.js +3 -4
- package/lib/esm/button/stories/button-running-cancel.story.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js +1 -0
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/clipboard-button/ClipboardButton.js +1 -1
- package/lib/esm/clipboard-button/ClipboardButton.js.map +1 -1
- package/lib/esm/dropzone/Dropzone.js +2 -6
- package/lib/esm/dropzone/Dropzone.js.map +1 -1
- package/lib/esm/switch/Switch.js +1 -0
- package/lib/esm/switch/Switch.js.map +1 -1
- package/lib/esm/toast/Toast.js +4 -4
- package/lib/esm/toast/Toast.js.map +1 -1
- package/lib/types/ai/response/Response.d.ts +15 -1
- package/lib/types/ai/response/Response.d.ts.map +1 -1
- package/lib/types/ai/response/safe-href.d.ts +26 -0
- package/lib/types/ai/response/safe-href.d.ts.map +1 -0
- package/lib/types/ai/response/stories/response-all-components.story.d.ts.map +1 -1
- package/lib/types/ai/response/stories/response-lists.story.d.ts.map +1 -1
- package/lib/types/button/stories/button-disabled.story.d.ts.map +1 -1
- package/lib/types/button/stories/button-floating.story.d.ts.map +1 -1
- package/lib/types/button/stories/button-fluid.story.d.ts.map +1 -1
- package/lib/types/button/stories/button-loading.story.d.ts.map +1 -1
- package/lib/types/button/stories/button-running-cancel.story.d.ts.map +1 -1
- package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/types/clipboard-button/ClipboardButton.d.ts.map +1 -1
- package/lib/types/dropzone/Dropzone.d.ts +1 -1
- package/lib/types/dropzone/Dropzone.d.ts.map +1 -1
- package/lib/types/switch/Switch.d.ts.map +1 -1
- package/package.json +5 -5
- package/skills/ndl-react/SKILL.md +2 -2
- package/skills/ndl-react/components/ai/response.md +36 -5
- package/skills/ndl-react/components/dropzone.md +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAUH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGzE,KAAK,aAAa,GAAG;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC/D,GAAG,CACA;IACE,6EAA6E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;CACnB,GACD;IACE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CACJ,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,yLAiBtB,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,4CA4DrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardButton.d.ts","sourceRoot":"","sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipboardButton.d.ts","sourceRoot":"","sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAyMrC;;;GAGG;AACH,UAAU,oBAAoB;IAC5B,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,aAAa,CAAC;CAChE;AAED,eAAO,MAAM,eAAe,GAAI,4FAQ7B,oBAAoB,4CAiDtB,CAAC"}
|
|
@@ -41,7 +41,7 @@ type DropzoneProps = {
|
|
|
41
41
|
loadingElement?: React.ReactNode;
|
|
42
42
|
/** Use when wanting a custom heading. */
|
|
43
43
|
heading?: React.ReactNode;
|
|
44
|
-
/** Message
|
|
44
|
+
/** Message shown when a file is rejected. Defaults to "File extension not supported." when omitted. */
|
|
45
45
|
rejectedText?: React.ReactNode;
|
|
46
46
|
/** The accepted file extensions for the Drag-and-Drop. */
|
|
47
47
|
acceptedFileExtensions?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropzone.d.ts","sourceRoot":"","sources":["../../../src/dropzone/Dropzone.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD;;;;;;GAMG;AACH;;;GAGG;AACH,KAAK,aAAa,GAAG;IACnB,4LAA4L;IAC5L,eAAe,EAAE,eAAe,CAAC;IAEjC,oGAAoG;IACpG,yBAAyB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5C,kDAAkD;IAClD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC,yCAAyC;IACzC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,
|
|
1
|
+
{"version":3,"file":"Dropzone.d.ts","sourceRoot":"","sources":["../../../src/dropzone/Dropzone.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD;;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AAC;IACzC,8DAA8D;IAC9D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,iEAAiE;IACjE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC/D,GAAG,CACA;IACE,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAMlB,gGAAgG;IAChG,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GACD;IACE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CACJ,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,yLAiBpB,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,4CAmDnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
"@vitest/coverage-v8": "4.1.10",
|
|
412
412
|
"a11y-contrast-color": "1.1.0",
|
|
413
413
|
"chromatic": "13.3.5",
|
|
414
|
-
"happo": "6.
|
|
414
|
+
"happo": "6.25.1",
|
|
415
415
|
"jsdom": "26.1.0",
|
|
416
416
|
"leva": "0.10.1",
|
|
417
417
|
"react": "19.2.5",
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
"@tanstack/react-table": "8.21.3",
|
|
430
430
|
"react": ">=19.0.0",
|
|
431
431
|
"react-dom": ">=19.0.0",
|
|
432
|
-
"@neo4j-ndl/base": "^5.1.
|
|
432
|
+
"@neo4j-ndl/base": "^5.1.1"
|
|
433
433
|
},
|
|
434
434
|
"dependencies": {
|
|
435
435
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -471,8 +471,8 @@
|
|
|
471
471
|
"test:unit": "pnpm exec vitest --run --exclude node_modules",
|
|
472
472
|
"typecheck": "pnpm exec tsc -p tsconfig.tests.json",
|
|
473
473
|
"test:playwright": "NODE_OPTIONS=--max-old-space-size=8192 pnpm exec playwright test --grep-invert '@happo|@visual-regression'",
|
|
474
|
-
"test:visual-regression": "pnpm exec playwright test
|
|
475
|
-
"test:visual-regression:check": "pnpm exec playwright test --grep '@visual-regression'",
|
|
474
|
+
"test:visual-regression": "pnpm exec playwright test --grep '@visual-regression' --update-snapshots=changed",
|
|
475
|
+
"test:visual-regression:check": "pnpm exec playwright test --grep '@visual-regression' --update-snapshots=none",
|
|
476
476
|
"build": "pnpm run generate:style-rules && pnpm run build:esm && pnpm run build:cjs && pnpm run build:types",
|
|
477
477
|
"build:esm": "pnpm exec tsc -p tsconfig.esm.json",
|
|
478
478
|
"build:cjs": "pnpm exec tsc -p tsconfig.cjs.json",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: ndl-react
|
|
3
3
|
metadata:
|
|
4
4
|
package: '@neo4j-ndl/react'
|
|
5
|
-
version: '5.1.
|
|
5
|
+
version: '5.1.3'
|
|
6
6
|
description: >-
|
|
7
7
|
Build and edit UI with the Neo4j Needle React design system
|
|
8
8
|
(@neo4j-ndl/react). Use when adding, composing, or modifying Needle components
|
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
|
|
16
16
|
# Neo4j Needle (@neo4j-ndl/react)
|
|
17
17
|
|
|
18
|
-
> 📌 Shipped with `@neo4j-ndl/react` v5.1.
|
|
18
|
+
> 📌 Shipped with `@neo4j-ndl/react` v5.1.3. Once installed into your repo (e.g. via
|
|
19
19
|
> `npx skills add`) this folder is detached from the package — the installed
|
|
20
20
|
> package (TypeScript types in `node_modules/@neo4j-ndl/react`) is the source of
|
|
21
21
|
> truth.
|
|
@@ -10,10 +10,23 @@ Import: `import { Response } from '@neo4j-ndl/react/ai'`
|
|
|
10
10
|
|
|
11
11
|
| Prop | Type | Required | Default | Description |
|
|
12
12
|
|------|------|----------|---------|-------------|
|
|
13
|
-
| `children` | `string` | ✅ | |
|
|
13
|
+
| `children` | `string` | ✅ | | Markdown content from the AI. URLs and attributes are sanitized before render. |
|
|
14
14
|
| `isAnimating` | `boolean` | | | Whether the response is animating |
|
|
15
15
|
| `ref` | `Ref<HTMLDivElement>` | | | A ref to apply to the root element. |
|
|
16
16
|
|
|
17
|
+
Treat `children` as untrusted. Link and image URLs are limited to `http:`,
|
|
18
|
+
`https:`, `mailto:`, and same-origin relative or fragment paths. Unsafe
|
|
19
|
+
schemes (for example `javascript:`) and network-path URLs (for example
|
|
20
|
+
`//evil.example`) render as plain text for links and are omitted for images.
|
|
21
|
+
Markdown attributes are allow-listed so event handlers cannot reach the DOM.
|
|
22
|
+
Allowed links open in a new tab with a fixed `rel="noopener noreferrer"`
|
|
23
|
+
(`target` and `rel` from markdown are ignored). Absolute `http:` and
|
|
24
|
+
`https:` links use `TextLink` `type="external"` when their origin differs
|
|
25
|
+
from the page, and `type="internal"` when it matches. Relative, fragment,
|
|
26
|
+
and `mailto:` links use `type="internal"`.
|
|
27
|
+
Ids and related attributes from model output are prefixed with
|
|
28
|
+
`user-content-` to avoid colliding with the host document.
|
|
29
|
+
|
|
17
30
|
## Examples
|
|
18
31
|
|
|
19
32
|
### Default
|
|
@@ -155,9 +168,13 @@ without syntax highlighting
|
|
|
155
168
|
|
|
156
169
|
## Links
|
|
157
170
|
|
|
158
|
-
Visit [
|
|
171
|
+
Visit [Needle AI Response All Components](/?path=/story/components-ai-response--all-components) to see a full demo of the story. — This link has the href \`/?path=/story/components-ai-response--all-components\`, which is relative to the current origin.
|
|
172
|
+
|
|
173
|
+
Visit [Needle on this origin](https://needle.neo4j.design/?path=/story/components-ai-response--all-components) — This link has the href \`https://needle.neo4j.design/?path=/story/components-ai-response--all-components\`, which is an absolute URL. It is internal when the page origin is \`https://needle.neo4j.design\`.
|
|
174
|
+
|
|
175
|
+
Visit [Neo4j](https://neo4j.com) for more information. — This link has the href \`https://neo4j.com\`, which is an absolute URL on a different origin.
|
|
159
176
|
|
|
160
|
-
Multiple links: [Documentation](https://neo4j.com/docs) and [Community](https://community.neo4j.com)
|
|
177
|
+
Multiple links: [Documentation](https://neo4j.com/docs) and [Community](https://community.neo4j.com). — These links have the hrefs \`https://neo4j.com/docs\` and \`https://community.neo4j.com\`, which are absolute URLs.
|
|
161
178
|
|
|
162
179
|
## Blockquotes
|
|
163
180
|
|
|
@@ -255,9 +272,15 @@ Use code blocks for preformatted text with preserved spacing:
|
|
|
255
272
|
`;
|
|
256
273
|
|
|
257
274
|
export const Component = () => {
|
|
275
|
+
// Keep the live example on the current origin so it renders as internal
|
|
276
|
+
// both locally and on the published Storybook.
|
|
277
|
+
const markdown = comprehensiveMarkdown.replaceAll(
|
|
278
|
+
'https://needle.neo4j.design',
|
|
279
|
+
window.location.origin,
|
|
280
|
+
);
|
|
258
281
|
return (
|
|
259
282
|
<div className="max-w-4xl">
|
|
260
|
-
<Response>{
|
|
283
|
+
<Response>{markdown}</Response>
|
|
261
284
|
</div>
|
|
262
285
|
);
|
|
263
286
|
};
|
|
@@ -1039,6 +1062,8 @@ const listsMarkdown = `
|
|
|
1039
1062
|
- Neo4j Desktop
|
|
1040
1063
|
- Neo4j Browser
|
|
1041
1064
|
- Neo4j Bloom
|
|
1065
|
+
4. Needle
|
|
1066
|
+
- [Needle](https://needle.neo4j.design)
|
|
1042
1067
|
|
|
1043
1068
|
## Lists with Inline Formatting
|
|
1044
1069
|
|
|
@@ -1050,9 +1075,15 @@ const listsMarkdown = `
|
|
|
1050
1075
|
`;
|
|
1051
1076
|
|
|
1052
1077
|
export const Component = () => {
|
|
1078
|
+
// Keep the live example on the current origin so it renders as internal
|
|
1079
|
+
// both locally and on the published Storybook.
|
|
1080
|
+
const markdown = listsMarkdown.replaceAll(
|
|
1081
|
+
'https://needle.neo4j.design',
|
|
1082
|
+
window.location.origin,
|
|
1083
|
+
);
|
|
1053
1084
|
return (
|
|
1054
1085
|
<div className="max-w-4xl">
|
|
1055
|
-
<Response>{
|
|
1086
|
+
<Response>{markdown}</Response>
|
|
1056
1087
|
</div>
|
|
1057
1088
|
);
|
|
1058
1089
|
};
|
|
@@ -15,7 +15,7 @@ Import: `import { Dropzone } from '@neo4j-ndl/react'`
|
|
|
15
15
|
| `heading` | `ReactNode` | | | Use when wanting a custom heading. |
|
|
16
16
|
| `loadingElement` | `ReactNode` | | | Element to display when uploading the file. |
|
|
17
17
|
| `ref` | `Ref<HTMLDivElement>` | | | A ref to apply to the root element. |
|
|
18
|
-
| `rejectedText` | `ReactNode` | | | Message
|
|
18
|
+
| `rejectedText` | `ReactNode` | | | Message shown when a file is rejected. Defaults to "File extension not supported." when omitted. |
|
|
19
19
|
| `supportedFilesDescription` | `ReactNode` | | | Informational text that highlights the supported file types, will be displayed in the footer. |
|
|
20
20
|
|
|
21
21
|
Where `DropzoneOptions` is the props for the `react-dropzone` library. For more information, see the [react-dropzone documentation](https://react-dropzone.js.org/#src).
|