@neo4j-ndl/react 5.0.1 → 5.1.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/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/operational-tag/OperationalTag.js +58 -0
- package/lib/cjs/operational-tag/OperationalTag.js.map +1 -0
- package/lib/cjs/operational-tag/index.js +26 -0
- package/lib/cjs/operational-tag/index.js.map +1 -0
- package/lib/cjs/operational-tag/stories/index.js +56 -0
- package/lib/cjs/operational-tag/stories/index.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-active.story.js +30 -0
- package/lib/cjs/operational-tag/stories/operational-tag-active.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-default.story.js +30 -0
- package/lib/cjs/operational-tag/stories/operational-tag-default.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-disabled.story.js +30 -0
- package/lib/cjs/operational-tag/stories/operational-tag-disabled.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-sizes.story.js +30 -0
- package/lib/cjs/operational-tag/stories/operational-tag-sizes.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-truncation.story.js +31 -0
- package/lib/cjs/operational-tag/stories/operational-tag-truncation.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-with-leading-color.story.js +30 -0
- package/lib/cjs/operational-tag/stories/operational-tag-with-leading-color.story.js.map +1 -0
- package/lib/cjs/operational-tag/stories/operational-tag-with-leading-icon.story.js +31 -0
- package/lib/cjs/operational-tag/stories/operational-tag-with-leading-icon.story.js.map +1 -0
- package/lib/cjs/tag-base/stories/tag-variants.story.js +1 -1
- package/lib/cjs/tag-base/stories/tag-variants.story.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/operational-tag/OperationalTag.js +51 -0
- package/lib/esm/operational-tag/OperationalTag.js.map +1 -0
- package/lib/esm/operational-tag/index.js +22 -0
- package/lib/esm/operational-tag/index.js.map +1 -0
- package/lib/esm/operational-tag/stories/index.js +43 -0
- package/lib/esm/operational-tag/stories/index.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-active.story.js +28 -0
- package/lib/esm/operational-tag/stories/operational-tag-active.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-default.story.js +28 -0
- package/lib/esm/operational-tag/stories/operational-tag-default.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-disabled.story.js +28 -0
- package/lib/esm/operational-tag/stories/operational-tag-disabled.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-sizes.story.js +28 -0
- package/lib/esm/operational-tag/stories/operational-tag-sizes.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-truncation.story.js +29 -0
- package/lib/esm/operational-tag/stories/operational-tag-truncation.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-with-leading-color.story.js +28 -0
- package/lib/esm/operational-tag/stories/operational-tag-with-leading-color.story.js.map +1 -0
- package/lib/esm/operational-tag/stories/operational-tag-with-leading-icon.story.js +29 -0
- package/lib/esm/operational-tag/stories/operational-tag-with-leading-icon.story.js.map +1 -0
- package/lib/esm/tag-base/stories/tag-variants.story.js +2 -2
- package/lib/esm/tag-base/stories/tag-variants.story.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/operational-tag/OperationalTag.d.ts +47 -0
- package/lib/types/operational-tag/OperationalTag.d.ts.map +1 -0
- package/lib/types/operational-tag/index.d.ts +22 -0
- package/lib/types/operational-tag/index.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/index.d.ts +35 -0
- package/lib/types/operational-tag/stories/index.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-active.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-active.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-default.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-default.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-disabled.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-disabled.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-sizes.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-sizes.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-truncation.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-truncation.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-with-leading-color.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-with-leading-color.story.d.ts.map +1 -0
- package/lib/types/operational-tag/stories/operational-tag-with-leading-icon.story.d.ts +24 -0
- package/lib/types/operational-tag/stories/operational-tag-with-leading-icon.story.d.ts.map +1 -0
- package/lib/types/tag-base/stories/tag-variants.story.d.ts.map +1 -1
- package/package.json +7 -2
- package/skills/ndl-react/SKILL.md +4 -3
- package/skills/ndl-react/components/operational-tag.md +187 -0
|
@@ -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=operational-tag-default.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-default.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-default.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAIjD,QAAA,MAAM,SAAS,+CAEd,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=operational-tag-disabled.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-disabled.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-disabled.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAIjD,QAAA,MAAM,SAAS,+CAEd,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=operational-tag-sizes.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-sizes.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-sizes.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAIjD,QAAA,MAAM,SAAS,+CASd,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=operational-tag-truncation.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-truncation.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-truncation.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAOjD,QAAA,MAAM,SAAS,+CAWd,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=operational-tag-with-leading-color.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-with-leading-color.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-with-leading-color.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=operational-tag-with-leading-icon.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-tag-with-leading-icon.story.d.ts","sourceRoot":"","sources":["../../../../src/operational-tag/stories/operational-tag-with-leading-icon.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAKjD,QAAA,MAAM,SAAS,+CAMd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-variants.story.d.ts","sourceRoot":"","sources":["../../../../src/tag-base/stories/tag-variants.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"tag-variants.story.d.ts","sourceRoot":"","sources":["../../../../src/tag-base/stories/tag-variants.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAUjD,QAAA,MAAM,SAAS,+CAsBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -217,6 +217,11 @@
|
|
|
217
217
|
"require": "./lib/cjs/next/index.js",
|
|
218
218
|
"import": "./lib/esm/next/index.js"
|
|
219
219
|
},
|
|
220
|
+
"./operational-tag": {
|
|
221
|
+
"types": "./lib/types/operational-tag/index.d.ts",
|
|
222
|
+
"require": "./lib/cjs/operational-tag/index.js",
|
|
223
|
+
"import": "./lib/esm/operational-tag/index.js"
|
|
224
|
+
},
|
|
220
225
|
"./outlined-button": {
|
|
221
226
|
"types": "./lib/types/outlined-button/index.d.ts",
|
|
222
227
|
"require": "./lib/cjs/outlined-button/index.js",
|
|
@@ -424,7 +429,7 @@
|
|
|
424
429
|
"@tanstack/react-table": "8.21.3",
|
|
425
430
|
"react": ">=19.0.0",
|
|
426
431
|
"react-dom": ">=19.0.0",
|
|
427
|
-
"@neo4j-ndl/base": "^5.0
|
|
432
|
+
"@neo4j-ndl/base": "^5.1.0"
|
|
428
433
|
},
|
|
429
434
|
"dependencies": {
|
|
430
435
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: ndl-react
|
|
3
3
|
metadata:
|
|
4
4
|
package: '@neo4j-ndl/react'
|
|
5
|
-
version: '5.0
|
|
5
|
+
version: '5.1.0'
|
|
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.0.
|
|
18
|
+
> 📌 Shipped with `@neo4j-ndl/react` v5.1.0. 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.
|
|
@@ -121,7 +121,7 @@ not a lookalike you now own.
|
|
|
121
121
|
Each button variant is a distinct component with its own visual language.
|
|
122
122
|
Don't take a `FilledButton` and restyle it to look like an `OutlinedButton` —
|
|
123
123
|
use `OutlinedButton` directly. Same for tags (`Tag`, `SelectableTag`,
|
|
124
|
-
`DismissibleTag`, `ReadOnlyTag`), and any other variant family.
|
|
124
|
+
`DismissibleTag`, `ReadOnlyTag`, `OperationalTag`), and any other variant family.
|
|
125
125
|
|
|
126
126
|
## How to use this skill
|
|
127
127
|
|
|
@@ -175,6 +175,7 @@ Import from `@neo4j-ndl/react`.
|
|
|
175
175
|
| `Logo` | [components/logo.md](components/logo.md) | | 3 |
|
|
176
176
|
| `Menu` | [components/menu.md](components/menu.md) | ✅ | 13 |
|
|
177
177
|
| `Modal` | [components/modal.md](components/modal.md) | ✅ | 0 |
|
|
178
|
+
| `OperationalTag` | [components/operational-tag.md](components/operational-tag.md) | ✅ | 7 |
|
|
178
179
|
| `OutlinedButton` | [components/outlined-button.md](components/outlined-button.md) | | 0 |
|
|
179
180
|
| `Popover` | [components/popover.md](components/popover.md) | ✅ | 6 |
|
|
180
181
|
| `ProgressBar` | [components/progress-bar.md](components/progress-bar.md) | ✅ | 3 |
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
2
|
+
|
|
3
|
+
# OperationalTag
|
|
4
|
+
|
|
5
|
+
Import: `import { OperationalTag } from '@neo4j-ndl/react'`
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
### OperationalTag
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Required | Default | Description |
|
|
12
|
+
|------|------|----------|---------|-------------|
|
|
13
|
+
| `children` | `ReactNode` | | | The content of the tag |
|
|
14
|
+
| `isActive` | `boolean` | | | Whether the tag is in an active (pressed) state |
|
|
15
|
+
| `isDisabled` | `boolean` | | `false` | Whether the tag is disabled |
|
|
16
|
+
| `leadingColor` | `Color` | | | Decorative color shown before the content to help users recognize the item. It carries no meaning of its own and is hidden from assistive technology, so the tag text must identify the item. Accepts a CSS variable or a hex color. |
|
|
17
|
+
| `leadingVisual` | `ReactNode` | | | Icon to display before the content |
|
|
18
|
+
| `onClick` | `MouseEventHandler<HTMLButtonElement>` | | | Callback fired when the tag is clicked |
|
|
19
|
+
| `ref` | `Ref<HTMLButtonElement>` | | | A ref to apply to the root element. |
|
|
20
|
+
| `size` | `'large' \| 'medium' \| 'small' \| 'x-small'` | | `medium` | Size of the tag |
|
|
21
|
+
|
|
22
|
+
Clickable tag for actions and for identifying an item with a color or icon.
|
|
23
|
+
For choosing from a set of options, use `SelectableTag`.
|
|
24
|
+
|
|
25
|
+
## Accessibility
|
|
26
|
+
|
|
27
|
+
## Keyboard interactions
|
|
28
|
+
|
|
29
|
+
The tag renders as a native `<button>` so it uses standard button keyboard behavior.
|
|
30
|
+
|
|
31
|
+
| Key | Description |
|
|
32
|
+
| ------------- | ----------------------------------------------- |
|
|
33
|
+
| `Tab` | Moves focus to the tag |
|
|
34
|
+
| `Shift + Tab` | Moves focus to the previous focusable element |
|
|
35
|
+
| `Enter` | Activates the tag (calls `onClick` if provided) |
|
|
36
|
+
| `Space` | Activates the tag (calls `onClick` if provided) |
|
|
37
|
+
|
|
38
|
+
A disabled tag (`isDisabled`) uses the native `disabled` attribute. It is removed from the tab order and cannot be activated.
|
|
39
|
+
|
|
40
|
+
## WAI-ARIA roles and attributes
|
|
41
|
+
|
|
42
|
+
- The root is a `<button type="button">` which gives it the `button` role and an accessible name from its text content.
|
|
43
|
+
- `aria-pressed` is only set when `isActive` is explicitly provided: `true` when active, `false` when `isActive={false}`. It is omitted when `isActive` is not passed, so a plain action tag is not announced as a toggle button.
|
|
44
|
+
- The leading color dot is decorative and has `aria-hidden="true"`. It is not announced by screen readers.
|
|
45
|
+
- The leading visual is not given a label by the component. Provide meaning through the tag text, or make sure the icon is decorative.
|
|
46
|
+
|
|
47
|
+
## Implementation guidelines
|
|
48
|
+
|
|
49
|
+
- `leadingColor` is a recognition aid, not a way to convey information. Use it for things like a color a user has picked for a database or instance. The tag text must always identify the item, because the color is hidden from assistive technology and can't be perceived by everyone, including people with color vision deficiency. Do not use it to show status, category, or any other meaning.
|
|
50
|
+
- Choose custom colors with enough contrast against the tag background in both themes. A color close to the background (for example white on white) can make the dot invisible. Prefer a design token (for example `var(--categorical-1)`), which is defined for each theme.
|
|
51
|
+
- Only pass `isActive` when the tag represents a toggled state (a selected filter). Otherwise leave it out so it is not announced as pressed or not pressed.
|
|
52
|
+
- Text that is truncated is cut with an ellipsis. Make sure the full text is available elsewhere (for example in a tooltip) when it carries meaning (see the Truncation story).
|
|
53
|
+
|
|
54
|
+
### Related WCAG criteria
|
|
55
|
+
|
|
56
|
+
- [1.4.1 Use of Color](https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html) (A): The leading color must not be the only means of conveying information.
|
|
57
|
+
- [1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html) (AA): Custom leading colors need sufficient contrast against the tag background.
|
|
58
|
+
- [2.1.1 Keyboard](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) (A): The tag is a native button and fully keyboard operable.
|
|
59
|
+
- [4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) (A): The role comes from the native `<button>`, the name from the text content, and `aria-pressed` conveys the active state.
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Default
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
67
|
+
|
|
68
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
69
|
+
|
|
70
|
+
const Component = () => {
|
|
71
|
+
return <OperationalTag>Operational Tag</OperationalTag>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default Component;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Active
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
81
|
+
|
|
82
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
83
|
+
|
|
84
|
+
const Component = () => {
|
|
85
|
+
return <OperationalTag isActive>Active operational tag</OperationalTag>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export default Component;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Disabled
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
95
|
+
|
|
96
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
97
|
+
|
|
98
|
+
const Component = () => {
|
|
99
|
+
return <OperationalTag isDisabled>Disabled operational tag</OperationalTag>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default Component;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Sizes
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
109
|
+
|
|
110
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
111
|
+
|
|
112
|
+
const Component = () => {
|
|
113
|
+
return (
|
|
114
|
+
<div className="flex flex-row gap-token-8">
|
|
115
|
+
<OperationalTag size="x-small">X-Small</OperationalTag>
|
|
116
|
+
<OperationalTag size="small">Small</OperationalTag>
|
|
117
|
+
<OperationalTag size="medium">Medium</OperationalTag>
|
|
118
|
+
<OperationalTag size="large">Large</OperationalTag>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default Component;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Truncation
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
130
|
+
|
|
131
|
+
import { OperationalTag, Tooltip } from '@neo4j-ndl/react';
|
|
132
|
+
|
|
133
|
+
const label =
|
|
134
|
+
'This is a very very very long tag label that should be truncated';
|
|
135
|
+
|
|
136
|
+
const Component = () => {
|
|
137
|
+
return (
|
|
138
|
+
<div style={{ maxWidth: 200 }}>
|
|
139
|
+
<Tooltip type="simple">
|
|
140
|
+
<Tooltip.Trigger hasButtonWrapper>
|
|
141
|
+
<OperationalTag>{label}</OperationalTag>
|
|
142
|
+
</Tooltip.Trigger>
|
|
143
|
+
<Tooltip.Content>{label}</Tooltip.Content>
|
|
144
|
+
</Tooltip>
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default Component;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### With Leading Color
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
156
|
+
|
|
157
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
158
|
+
|
|
159
|
+
const Component = () => {
|
|
160
|
+
return (
|
|
161
|
+
<OperationalTag leadingColor="var(--categorical-1)">
|
|
162
|
+
Operational Tag with leading color
|
|
163
|
+
</OperationalTag>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default Component;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### With Leading Icon
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
174
|
+
|
|
175
|
+
import { OperationalTag } from '@neo4j-ndl/react';
|
|
176
|
+
import { DatabasePlusIcon } from '@neo4j-ndl/react/icons';
|
|
177
|
+
|
|
178
|
+
const Component = () => {
|
|
179
|
+
return (
|
|
180
|
+
<OperationalTag leadingVisual={<DatabasePlusIcon />}>
|
|
181
|
+
Operational Tag with leading icon
|
|
182
|
+
</OperationalTag>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export default Component;
|
|
187
|
+
```
|