@neo4j-ndl/react 2.3.13 → 2.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#717](https://github.com/neo4j/needle/pull/717) [`b49b844b733b8d69a9d0157f316eb12c926eec5c`](https://github.com/neo4j/needle/commit/b49b844b733b8d69a9d0157f316eb12c926eec5c) Thanks [@basickarl](https://github.com/basickarl)! - Added new avatar component
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`b49b844b733b8d69a9d0157f316eb12c926eec5c`](https://github.com/neo4j/needle/commit/b49b844b733b8d69a9d0157f316eb12c926eec5c)]:
12
+ - @neo4j-ndl/base@2.4.0
13
+
3
14
  ## 2.3.13
4
15
 
5
16
  ### Patch Changes
package/lib/LICENSES.txt CHANGED
@@ -5133,6 +5133,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
5133
5133
 
5134
5134
  -----
5135
5135
 
5136
+ The following software may be included in this product: @tanstack/react-table, react-table. A copy of the source code may be downloaded from git+https://github.com/tanstack/table.git (@tanstack/react-table), https://github.com/tannerlinsley/react-table (react-table). This software contains the following license and notice below:
5137
+
5138
+ MIT License
5139
+
5140
+ Copyright (c) 2016 Tanner Linsley
5141
+
5142
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5143
+ of this software and associated documentation files (the "Software"), to deal
5144
+ in the Software without restriction, including without limitation the rights
5145
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5146
+ copies of the Software, and to permit persons to whom the Software is
5147
+ furnished to do so, subject to the following conditions:
5148
+
5149
+ The above copyright notice and this permission notice shall be included in all
5150
+ copies or substantial portions of the Software.
5151
+
5152
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5153
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5154
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5155
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5156
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5157
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5158
+ SOFTWARE.
5159
+
5160
+ -----
5161
+
5136
5162
  The following software may be included in this product: @testing-library/jest-dom. A copy of the source code may be downloaded from https://github.com/testing-library/jest-dom. This software contains the following license and notice below:
5137
5163
 
5138
5164
  The MIT License (MIT)
@@ -5425,7 +5451,7 @@ SOFTWARE.
5425
5451
 
5426
5452
  -----
5427
5453
 
5428
- The following software may be included in this product: classnames. A copy of the source code may be downloaded from https://github.com/JedWatson/classnames.git. This software contains the following license and notice below:
5454
+ The following software may be included in this product: classnames. A copy of the source code may be downloaded from git+https://github.com/JedWatson/classnames.git. This software contains the following license and notice below:
5429
5455
 
5430
5456
  The MIT License (MIT)
5431
5457
 
@@ -17396,32 +17422,6 @@ SOFTWARE.
17396
17422
 
17397
17423
  -----
17398
17424
 
17399
- The following software may be included in this product: react-table. A copy of the source code may be downloaded from https://github.com/tannerlinsley/react-table. This software contains the following license and notice below:
17400
-
17401
- MIT License
17402
-
17403
- Copyright (c) 2016 Tanner Linsley
17404
-
17405
- Permission is hereby granted, free of charge, to any person obtaining a copy
17406
- of this software and associated documentation files (the "Software"), to deal
17407
- in the Software without restriction, including without limitation the rights
17408
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17409
- copies of the Software, and to permit persons to whom the Software is
17410
- furnished to do so, subject to the following conditions:
17411
-
17412
- The above copyright notice and this permission notice shall be included in all
17413
- copies or substantial portions of the Software.
17414
-
17415
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17416
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17417
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17418
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17419
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17420
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17421
- SOFTWARE.
17422
-
17423
- -----
17424
-
17425
17425
  The following software may be included in this product: react-use. A copy of the source code may be downloaded from https://github.com/streamich/react-use. This software contains the following license and notice below:
17426
17426
 
17427
17427
  This is free and unencumbered software released into the public domain.
@@ -19051,6 +19051,38 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19051
19051
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19052
19052
 
19053
19053
 
19054
+ --------------------------------------------------------------------------------
19055
+
19056
+ web license:
19057
+
19058
+ Copyright 2023, the Dart project authors.
19059
+
19060
+ Redistribution and use in source and binary forms, with or without
19061
+ modification, are permitted provided that the following conditions are
19062
+ met:
19063
+ * Redistributions of source code must retain the above copyright
19064
+ notice, this list of conditions and the following disclaimer.
19065
+ * Redistributions in binary form must reproduce the above
19066
+ copyright notice, this list of conditions and the following
19067
+ disclaimer in the documentation and/or other materials provided
19068
+ with the distribution.
19069
+ * Neither the name of Google LLC nor the names of its
19070
+ contributors may be used to endorse or promote products derived
19071
+ from this software without specific prior written permission.
19072
+
19073
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19074
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19075
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19076
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19077
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19078
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19079
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19080
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19081
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19082
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19083
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19084
+
19085
+
19054
19086
  --------------------------------------------------------------------------------
19055
19087
 
19056
19088
  yaml license:
package/lib/NOTICE.txt CHANGED
@@ -23,7 +23,7 @@ Full license texts are found in LICENSES.txt.
23
23
  Third-party licenses
24
24
  --------------------
25
25
  ├─ MIT
26
- │ ├─ @babel/core@npm:7.23.6 (via npm:^7.16.0)
26
+ │ ├─ @babel/core@npm:7.23.7 (via npm:^7.16.0)
27
27
  │ │ ├─ URL: https://github.com/babel/babel.git
28
28
  │ │ ├─ VendorName: The Babel Team
29
29
  │ │ └─ VendorUrl: https://babel.dev/docs/en/next/babel-core
@@ -83,7 +83,7 @@ Third-party licenses
83
83
  │ │ └─ URL: https://github.com/konsalex/table-nav
84
84
  │ ├─ @table-nav/react@npm:0.0.7 [a2e03] (via npm:0.0.7 [a2e03])
85
85
  │ │ └─ URL: https://github.com/konsalex/table-nav
86
- │ ├─ @tanstack/react-table@npm:8.11.2 [a2e03] (via npm:^8.9.3 [a2e03])
86
+ │ ├─ @tanstack/react-table@npm:8.11.6 [a2e03] (via npm:^8.9.3 [a2e03])
87
87
  │ │ ├─ URL: git+https://github.com/tanstack/table.git
88
88
  │ │ ├─ VendorName: Tanner Linsley
89
89
  │ │ └─ VendorUrl: https://github.com/tanstack/table#readme
@@ -109,13 +109,13 @@ Third-party licenses
109
109
  │ ├─ @types/jest@npm:27.5.2 (via npm:^27.0.3)
110
110
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
111
111
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest
112
- │ ├─ @types/node@npm:16.18.68 (via npm:^16.11.7)
112
+ │ ├─ @types/node@npm:16.18.71 (via npm:^16.11.7)
113
113
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
114
114
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
115
115
  │ ├─ @types/react@npm:18.2.18 (via npm:18.2.18)
116
116
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
117
117
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react
118
- │ ├─ @types/react-datepicker@npm:4.19.4 (via npm:^4.11.2)
118
+ │ ├─ @types/react-datepicker@npm:4.19.5 (via npm:^4.11.2)
119
119
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
120
120
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-datepicker
121
121
  │ ├─ @types/react-dom@npm:18.2.7 (via npm:18.2.7)
@@ -127,7 +127,7 @@ Third-party licenses
127
127
  │ ├─ @types/react-syntax-highlighter@npm:15.5.11 (via npm:^15.5.5)
128
128
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
129
129
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-syntax-highlighter
130
- │ ├─ @types/react-table@npm:7.7.18 (via npm:^7.7.10)
130
+ │ ├─ @types/react-table@npm:7.7.19 (via npm:^7.7.10)
131
131
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
132
132
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table
133
133
  │ ├─ @types/tinycolor2@npm:1.4.6 (via npm:^1.4.3)
@@ -135,10 +135,10 @@ Third-party licenses
135
135
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tinycolor2
136
136
  │ ├─ @typescript-eslint/eslint-plugin@npm:5.62.0 [a2e03] (via npm:^5.5.0 [a2e03])
137
137
  │ │ └─ URL: https://github.com/typescript-eslint/typescript-eslint.git
138
- │ ├─ acorn@npm:8.11.2 (via npm:^8.8.2)
138
+ │ ├─ acorn@npm:8.11.3 (via npm:^8.8.2)
139
139
  │ │ ├─ URL: https://github.com/acornjs/acorn.git
140
140
  │ │ └─ VendorUrl: https://github.com/acornjs/acorn
141
- │ ├─ acorn-walk@npm:8.3.1 (via npm:^8.2.0)
141
+ │ ├─ acorn-walk@npm:8.3.2 (via npm:^8.2.0)
142
142
  │ │ ├─ URL: https://github.com/acornjs/acorn.git
143
143
  │ │ └─ VendorUrl: https://github.com/acornjs/acorn
144
144
  │ ├─ autoprefixer@npm:10.4.16 [708d2] (via npm:^10.4.0 [708d2])
@@ -149,8 +149,8 @@ Third-party licenses
149
149
  │ ├─ chromatic@npm:6.24.1 (via npm:^6.5.1)
150
150
  │ │ ├─ URL: https://github.com/chromaui/chromatic-cli.git
151
151
  │ │ └─ VendorUrl: https://www.chromatic.com
152
- │ ├─ classnames@npm:2.3.2 (via npm:^2.3.1)
153
- │ │ ├─ URL: https://github.com/JedWatson/classnames.git
152
+ │ ├─ classnames@npm:2.5.1 (via npm:^2.3.1)
153
+ │ │ ├─ URL: git+https://github.com/JedWatson/classnames.git
154
154
  │ │ └─ VendorName: Jed Watson
155
155
  │ ├─ commitizen@npm:4.3.0 (via npm:^4.2.4)
156
156
  │ │ ├─ URL: https://github.com/commitizen/cz-cli.git
@@ -202,7 +202,7 @@ Third-party licenses
202
202
  │ │ └─ URL: git+https://github.com/jsdom/jsdom.git
203
203
  │ ├─ leva@npm:0.9.35 [d75d7] (via npm:^0.9.35 [d75d7])
204
204
  │ │ └─ URL: https://github.com/pmndrs/leva.git
205
- │ ├─ postcss@npm:8.4.32 (via npm:^8.4.18)
205
+ │ ├─ postcss@npm:8.4.33 (via npm:^8.4.18)
206
206
  │ │ ├─ URL: git+https://github.com/postcss/postcss.git
207
207
  │ │ ├─ VendorName: Andrey Sitnik
208
208
  │ │ └─ VendorUrl: https://postcss.org/
@@ -274,14 +274,14 @@ Third-party licenses
274
274
  │ │ ├─ URL: https://github.com/que-etc/resize-observer-polyfill.git
275
275
  │ │ ├─ VendorName: Denis Rul
276
276
  │ │ └─ VendorUrl: https://github.com/que-etc/resize-observer-polyfill
277
- │ ├─ sass@npm:1.69.5 (via npm:^1.62.0)
277
+ │ ├─ sass@npm:1.69.7 (via npm:^1.62.0)
278
278
  │ │ ├─ URL: https://github.com/sass/dart-sass
279
279
  │ │ ├─ VendorName: Natalie Weizenbaum
280
280
  │ │ └─ VendorUrl: https://github.com/sass/dart-sass
281
- │ ├─ sb@npm:7.6.6 (via npm:^7.0.10)
281
+ │ ├─ sb@npm:7.6.8 (via npm:^7.0.10)
282
282
  │ │ ├─ URL: https://github.com/storybookjs/storybook.git
283
283
  │ │ └─ VendorUrl: https://github.com/storybookjs/storybook/tree/next/code/lib/cli
284
- │ ├─ storybook@npm:7.6.6 (via npm:^7.1.0)
284
+ │ ├─ storybook@npm:7.6.8 (via npm:7.6.8)
285
285
  │ │ ├─ URL: https://github.com/storybookjs/storybook.git
286
286
  │ │ └─ VendorUrl: https://github.com/storybookjs/storybook/tree/next/code/lib/cli
287
287
  │ ├─ storybook-addon-pseudo-states@npm:1.15.5 [d75d7] (via npm:^1.15.1 [d75d7])
@@ -333,7 +333,7 @@ Third-party licenses
333
333
  │ │ ├─ URL: https://github.com/krisk/Fuse.git
334
334
  │ │ ├─ VendorName: Kiro Risk
335
335
  │ │ └─ VendorUrl: http://fusejs.io
336
- │ ├─ react-aria@npm:3.31.0 [a2e03] (via npm:^3.25.0 [a2e03])
336
+ │ ├─ react-aria@npm:3.31.1 [a2e03] (via npm:^3.25.0 [a2e03])
337
337
  │ │ └─ URL: https://github.com/adobe/react-spectrum
338
338
  │ ├─ style-dictionary@npm:3.9.1 (via npm:^3.0.3)
339
339
  │ │ ├─ URL: git://github.com/amzn/style-dictionary.git
@@ -379,7 +379,7 @@ Third-party licenses
379
379
  │ └─ VendorUrl: https://github.com/rpearce/react-medium-image-zoom
380
380
 
381
381
  └─ Unlicense
382
- └─ react-use@npm:17.4.2 [a2e03] (via npm:^17.4.0 [a2e03])
382
+ └─ react-use@npm:17.4.3 [a2e03] (via npm:^17.4.0 [a2e03])
383
383
  ├─ URL: https://github.com/streamich/react-use
384
384
  ├─ VendorName: @streamich
385
385
  └─ VendorUrl: https://github.com/streamich/react-use#readme
@@ -26,5 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.classNames = void 0;
27
27
  // This file is help with consistent naming of default imports throughout the files.
28
28
  const classnames_1 = __importDefault(require("classnames"));
29
+ // Fix for error: Exported variable 'classNames' has or is using name 'ClassNames' from external module "/Users/karl/development/neo4j/neo4j-design-2/node_modules/classnames/index" but cannot be named.ts(4023)
30
+ // https://github.com/JedWatson/classnames/blob/main/index.d.ts#L18
29
31
  exports.classNames = classnames_1.default;
30
32
  //# sourceMappingURL=defaultImports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultImports.js","sourceRoot":"","sources":["../../../src/_common/defaultImports.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,oFAAoF;AACpF,4DAA2C;AAC9B,QAAA,UAAU,GAAG,oBAAiB,CAAC"}
1
+ {"version":3,"file":"defaultImports.js","sourceRoot":"","sources":["../../../src/_common/defaultImports.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,oFAAoF;AACpF,4DAAmE;AACnE,iNAAiN;AACjN,mEAAmE;AACtD,QAAA,UAAU,GAAuC,oBAAiB,CAAC"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Avatar = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ /**
20
+ *
21
+ * Copyright (c) "Neo4j"
22
+ * Neo4j Sweden AB [http://neo4j.com]
23
+ *
24
+ * This file is part of Neo4j.
25
+ *
26
+ * Neo4j is free software: you can redistribute it and/or modify
27
+ * it under the terms of the GNU General Public License as published by
28
+ * the Free Software Foundation, either version 3 of the License, or
29
+ * (at your option) any later version.
30
+ *
31
+ * This program is distributed in the hope that it will be useful,
32
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+ * GNU General Public License for more details.
35
+ *
36
+ * You should have received a copy of the GNU General Public License
37
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
38
+ */
39
+ const defaultImports_1 = require("../_common/defaultImports");
40
+ const react_1 = __importDefault(require("react"));
41
+ const typography_1 = require("../typography");
42
+ const icons_1 = require("../icons");
43
+ function circleSizeFactory(size) {
44
+ switch (size) {
45
+ case 'small':
46
+ return {
47
+ cxAndCy: '4',
48
+ diameter: '8',
49
+ r: '2.75',
50
+ rUnknown: '8',
51
+ rUnknownInner: '5',
52
+ };
53
+ case 'medium':
54
+ return {
55
+ cxAndCy: '5',
56
+ diameter: '10',
57
+ r: '3.75',
58
+ rUnknown: '4.5',
59
+ rUnknownInner: '2',
60
+ };
61
+ case 'large':
62
+ return {
63
+ cxAndCy: '6',
64
+ diameter: '12',
65
+ r: '5',
66
+ rUnknown: '6',
67
+ rUnknownInner: '3',
68
+ };
69
+ case 'x-large':
70
+ default:
71
+ return {
72
+ cxAndCy: '8',
73
+ diameter: '16',
74
+ r: '7',
75
+ rUnknown: '8',
76
+ rUnknownInner: '5',
77
+ };
78
+ }
79
+ }
80
+ function StatusIndicator({ size, status, }) {
81
+ const { cxAndCy, diameter, r, rUnknown, rUnknownInner } = circleSizeFactory(size);
82
+ const statusClasses = `ndl-avatar-status ndl-avatar-status-${size}`;
83
+ const svgCircleClasses = (0, defaultImports_1.classNames)(`ndl-avatar-status-svg-${size}`, {
84
+ [`ndl-avatar-status-svg-unknown-${size}`]: status === 'unknown',
85
+ [`ndl-avatar-status-svg-${status}`]: status !== 'unknown',
86
+ });
87
+ return ((0, jsx_runtime_1.jsx)("div", { "data-testid": "ndl-avatar-status", className: statusClasses, title: status.charAt(0).toUpperCase() + status.slice(1), role: "presentation", children: (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: diameter, width: diameter, viewBox: `0 0 ${diameter} ${diameter}`, fill: "none", children: [status === 'unknown' && size !== 'small' && ((0, jsx_runtime_1.jsx)("circle", { cx: cxAndCy, cy: cxAndCy, r: rUnknown, className: "ndl-avatar-status-svg-unknown-inner" })), (0, jsx_runtime_1.jsx)("circle", { cx: cxAndCy, cy: cxAndCy, r: status === 'unknown' && size !== 'small' ? rUnknownInner : r, className: svgCircleClasses })] }) }));
88
+ }
89
+ exports.Avatar = react_1.default.forwardRef(function Avatar(_a, ref) {
90
+ var { as = 'div', className, hasStatus = false, isDisabled = false, name, shape = 'circle', size = 'medium', source, status = undefined, type: initialType = 'image' } = _a, restProps = __rest(_a, ["as", "className", "hasStatus", "isDisabled", "name", "shape", "size", "source", "status", "type"]);
91
+ // If source is not provided, fallback to icon
92
+ const type = initialType === 'image' && !source ? 'icon' : initialType;
93
+ const Component = as;
94
+ const classes = (0, defaultImports_1.classNames)(`ndl-avatar ndl-avatar-${size}`, className);
95
+ const shapeClasses = (0, defaultImports_1.classNames)(`ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`, {
96
+ 'ndl-avatar-disabled': isDisabled,
97
+ });
98
+ const typeClass = `ndl-avatar-${type}`;
99
+ const typeSizeClass = `ndl-avatar-${type}-${size}`;
100
+ const renderImageType = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { "data-testid": "ndl-avatar-image", src: source, alt: name }), (0, jsx_runtime_1.jsx)("div", { "data-testid": "ndl-avatar-image-overlay", className: `${shapeClasses} ndl-avatar-image-overlay` })] }));
101
+ const renderIconType = () => ((0, jsx_runtime_1.jsx)(icons_1.UserIconOutline, { "data-testid": "ndl-avatar-icon", className: typeSizeClass }));
102
+ const renderLettersType = () => {
103
+ const typographyVariant = size === 'small'
104
+ ? 'body-small'
105
+ : size === 'large' || size === 'x-large'
106
+ ? 'subheading-small'
107
+ : 'body-medium';
108
+ return ((0, jsx_runtime_1.jsx)(typography_1.Typography, { "data-testid": "ndl-avatar-letters", variant: typographyVariant, className: typeSizeClass, children: name }));
109
+ };
110
+ const TypeComponent = type === 'image'
111
+ ? renderImageType()
112
+ : type === 'icon'
113
+ ? renderIconType()
114
+ : type === 'letters' && name
115
+ ? renderLettersType()
116
+ : null;
117
+ const isStatusIndicatorVisible = hasStatus && !isDisabled && status;
118
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ ref: ref }, restProps, { className: classes, "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, defaultImports_1.classNames)(shapeClasses, typeClass), "aria-label": `avatar ${name}`, role: "button", tabIndex: 0, "data-testid": "ndl-avatar-container", children: TypeComponent }), isStatusIndicatorVisible && ((0, jsx_runtime_1.jsx)(StatusIndicator, { size: size, status: status }))] })));
119
+ });
120
+ exports.default = exports.Avatar;
121
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8DAAuD;AACvD,kDAA0B;AAC1B,8CAA2C;AAE3C,oCAA2C;AAkB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO;YACV,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,GAAG;gBACb,CAAC,EAAE,MAAM;gBACT,QAAQ,EAAE,GAAG;gBACb,aAAa,EAAE,GAAG;aACnB,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,IAAI;gBACd,CAAC,EAAE,MAAM;gBACT,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,GAAG;aACnB,CAAC;QACJ,KAAK,OAAO;YACV,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,IAAI;gBACd,CAAC,EAAE,GAAG;gBACN,QAAQ,EAAE,GAAG;gBACb,aAAa,EAAE,GAAG;aACnB,CAAC;QACJ,KAAK,SAAS,CAAC;QACf;YACE,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,IAAI;gBACd,CAAC,EAAE,GAAG;gBACN,QAAQ,EAAE,GAAG;gBACb,aAAa,EAAE,GAAG;aACnB,CAAC;KACL;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,IAAI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,OAAO,IAAI,IAAI,KAAK,SAAS;gBACtC,CAAC,CAAC,kBAAkB;gBACpB,CAAC,CAAC,aAAa,CAAC;QACtB,OAAO,CACL,uBAAC,uBAAU,mBACG,oBAAoB,EAChC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,aAAa,YAEvB,IAAI,GACM,CACd,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,aAAa,GACjB,IAAI,KAAK,OAAO;QACd,CAAC,CAAC,eAAe,EAAE;QACnB,CAAC,CAAC,IAAI,KAAK,MAAM;YACf,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI;gBAC1B,CAAC,CAAC,iBAAiB,EAAE;gBACrB,CAAC,CAAC,IAAI,CAAC;IAEf,MAAM,wBAAwB,GAAG,SAAS,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC;IAEpE,OAAO,CACL,wBAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,IAAM,SAAS,IAAE,SAAS,EAAE,OAAO,iBAAc,MAAM,aACxE,gCACE,SAAS,EAAE,IAAA,2BAAU,EAAC,YAAY,EAAE,SAAS,CAAC,gBAClC,UAAU,IAAI,EAAE,EAC5B,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,iBACC,sBAAsB,YAEjC,aAAa,GACV,EACL,wBAAwB,IAAI,CAC3B,uBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,cAAM,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
+ desc = { enumerable: true, get: function() { return m[k]; } };
27
+ }
28
+ Object.defineProperty(o, k2, desc);
29
+ }) : (function(o, m, k, k2) {
30
+ if (k2 === undefined) k2 = k;
31
+ o[k2] = m[k];
32
+ }));
33
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ __exportStar(require("./Avatar"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/avatar/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB"}
package/lib/cjs/index.js CHANGED
@@ -72,4 +72,5 @@ __exportStar(require("./drawer"), exports);
72
72
  __exportStar(require("./breadcrumbs"), exports);
73
73
  __exportStar(require("./hooks"), exports);
74
74
  __exportStar(require("./layout"), exports);
75
+ __exportStar(require("./avatar"), exports);
75
76
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;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B;AAC9B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB"}
@@ -20,5 +20,7 @@
20
20
  */
21
21
  // This file is help with consistent naming of default imports throughout the files.
22
22
  import classNamesDefault from 'classnames';
23
+ // Fix for error: Exported variable 'classNames' has or is using name 'ClassNames' from external module "/Users/karl/development/neo4j/neo4j-design-2/node_modules/classnames/index" but cannot be named.ts(4023)
24
+ // https://github.com/JedWatson/classnames/blob/main/index.d.ts#L18
23
25
  export const classNames = classNamesDefault;
24
26
  //# sourceMappingURL=defaultImports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultImports.js","sourceRoot":"","sources":["../../../src/_common/defaultImports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,oFAAoF;AACpF,OAAO,iBAAiB,MAAM,YAAY,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"defaultImports.js","sourceRoot":"","sources":["../../../src/_common/defaultImports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,oFAAoF;AACpF,OAAO,iBAAyC,MAAM,YAAY,CAAC;AACnE,iNAAiN;AACjN,mEAAmE;AACnE,MAAM,CAAC,MAAM,UAAU,GAAuC,iBAAiB,CAAC"}
@@ -0,0 +1,115 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import { classNames } from '../_common/defaultImports';
34
+ import React from 'react';
35
+ import { Typography } from '../typography';
36
+ import { UserIconOutline } from '../icons';
37
+ function circleSizeFactory(size) {
38
+ switch (size) {
39
+ case 'small':
40
+ return {
41
+ cxAndCy: '4',
42
+ diameter: '8',
43
+ r: '2.75',
44
+ rUnknown: '8',
45
+ rUnknownInner: '5',
46
+ };
47
+ case 'medium':
48
+ return {
49
+ cxAndCy: '5',
50
+ diameter: '10',
51
+ r: '3.75',
52
+ rUnknown: '4.5',
53
+ rUnknownInner: '2',
54
+ };
55
+ case 'large':
56
+ return {
57
+ cxAndCy: '6',
58
+ diameter: '12',
59
+ r: '5',
60
+ rUnknown: '6',
61
+ rUnknownInner: '3',
62
+ };
63
+ case 'x-large':
64
+ default:
65
+ return {
66
+ cxAndCy: '8',
67
+ diameter: '16',
68
+ r: '7',
69
+ rUnknown: '8',
70
+ rUnknownInner: '5',
71
+ };
72
+ }
73
+ }
74
+ function StatusIndicator({ size, status, }) {
75
+ const { cxAndCy, diameter, r, rUnknown, rUnknownInner } = circleSizeFactory(size);
76
+ const statusClasses = `ndl-avatar-status ndl-avatar-status-${size}`;
77
+ const svgCircleClasses = classNames(`ndl-avatar-status-svg-${size}`, {
78
+ [`ndl-avatar-status-svg-unknown-${size}`]: status === 'unknown',
79
+ [`ndl-avatar-status-svg-${status}`]: status !== 'unknown',
80
+ });
81
+ return (_jsx("div", { "data-testid": "ndl-avatar-status", className: statusClasses, title: status.charAt(0).toUpperCase() + status.slice(1), role: "presentation", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: diameter, width: diameter, viewBox: `0 0 ${diameter} ${diameter}`, fill: "none", children: [status === 'unknown' && size !== 'small' && (_jsx("circle", { cx: cxAndCy, cy: cxAndCy, r: rUnknown, className: "ndl-avatar-status-svg-unknown-inner" })), _jsx("circle", { cx: cxAndCy, cy: cxAndCy, r: status === 'unknown' && size !== 'small' ? rUnknownInner : r, className: svgCircleClasses })] }) }));
82
+ }
83
+ export const Avatar = React.forwardRef(function Avatar(_a, ref) {
84
+ var { as = 'div', className, hasStatus = false, isDisabled = false, name, shape = 'circle', size = 'medium', source, status = undefined, type: initialType = 'image' } = _a, restProps = __rest(_a, ["as", "className", "hasStatus", "isDisabled", "name", "shape", "size", "source", "status", "type"]);
85
+ // If source is not provided, fallback to icon
86
+ const type = initialType === 'image' && !source ? 'icon' : initialType;
87
+ const Component = as;
88
+ const classes = classNames(`ndl-avatar ndl-avatar-${size}`, className);
89
+ const shapeClasses = classNames(`ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`, {
90
+ 'ndl-avatar-disabled': isDisabled,
91
+ });
92
+ const typeClass = `ndl-avatar-${type}`;
93
+ const typeSizeClass = `ndl-avatar-${type}-${size}`;
94
+ const renderImageType = () => (_jsxs(_Fragment, { children: [_jsx("img", { "data-testid": "ndl-avatar-image", src: source, alt: name }), _jsx("div", { "data-testid": "ndl-avatar-image-overlay", className: `${shapeClasses} ndl-avatar-image-overlay` })] }));
95
+ const renderIconType = () => (_jsx(UserIconOutline, { "data-testid": "ndl-avatar-icon", className: typeSizeClass }));
96
+ const renderLettersType = () => {
97
+ const typographyVariant = size === 'small'
98
+ ? 'body-small'
99
+ : size === 'large' || size === 'x-large'
100
+ ? 'subheading-small'
101
+ : 'body-medium';
102
+ return (_jsx(Typography, { "data-testid": "ndl-avatar-letters", variant: typographyVariant, className: typeSizeClass, children: name }));
103
+ };
104
+ const TypeComponent = type === 'image'
105
+ ? renderImageType()
106
+ : type === 'icon'
107
+ ? renderIconType()
108
+ : type === 'letters' && name
109
+ ? renderLettersType()
110
+ : null;
111
+ const isStatusIndicatorVisible = hasStatus && !isDisabled && status;
112
+ return (_jsxs(Component, Object.assign({ ref: ref }, restProps, { className: classes, "aria-hidden": "true", children: [_jsx("div", { className: classNames(shapeClasses, typeClass), "aria-label": `avatar ${name}`, role: "button", tabIndex: 0, "data-testid": "ndl-avatar-container", children: TypeComponent }), isStatusIndicatorVisible && (_jsx(StatusIndicator, { size: size, status: status }))] })));
113
+ });
114
+ export default Avatar;
115
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAkB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO;YACV,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,GAAG;gBACb,CAAC,EAAE,MAAM;gBACT,QAAQ,EAAE,GAAG;gBACb,aAAa,EAAE,GAAG;aACnB,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,IAAI;gBACd,CAAC,EAAE,MAAM;gBACT,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,GAAG;aACnB,CAAC;QACJ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,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './Avatar';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/avatar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC"}
package/lib/esm/index.js CHANGED
@@ -56,4 +56,5 @@ export * from './drawer';
56
56
  export * from './breadcrumbs';
57
57
  export * from './hooks';
58
58
  export * from './layout';
59
+ export * from './avatar';
59
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACx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,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -18,5 +18,5 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- import classNamesDefault from 'classnames';
22
- export declare const classNames: typeof classNamesDefault;
21
+ import { type ArgumentArray } from 'classnames';
22
+ export declare const classNames: (...args: ArgumentArray) => string;
@@ -0,0 +1,37 @@
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
+ import React from 'react';
23
+ import { type ElementBase } from '../helpers';
24
+ export interface AvatarProps extends ElementBase<HTMLDivElement> {
25
+ as?: string | React.ComponentType<any>;
26
+ className?: string;
27
+ hasStatus?: boolean;
28
+ isDisabled?: boolean;
29
+ name?: string;
30
+ shape?: 'circle' | 'square' | undefined;
31
+ size?: 'small' | 'medium' | 'large' | 'x-large';
32
+ source?: string;
33
+ status?: 'offline' | 'online' | 'unknown' | undefined;
34
+ type?: 'icon' | 'image' | 'letters';
35
+ }
36
+ export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<unknown>>;
37
+ export default Avatar;
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './Avatar';
@@ -56,3 +56,4 @@ export * from './drawer';
56
56
  export * from './breadcrumbs';
57
57
  export * from './hooks';
58
58
  export * from './layout';
59
+ export * from './avatar';
@@ -19,7 +19,7 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
  import { FloatingPortal } from '@floating-ui/react';
22
- import { type Side } from '@floating-ui/core/src/types';
22
+ import { type Side } from '@floating-ui/core';
23
23
  import { type ElementBase } from '../helpers';
24
24
  import { Typography } from '../typography';
25
25
  import React, { type ComponentProps } from 'react';
@@ -38,7 +38,7 @@ export interface TipProps {
38
38
  export declare function useTip({ allowedPlacements, isOpen: controlledOpen, isDisabled, onOpenChange: setControlledOpen, type, }?: TipProps): {
39
39
  placement: import("@floating-ui/utils").Placement;
40
40
  strategy: import("@floating-ui/utils").Strategy;
41
- middlewareData: import("@floating-ui/react").MiddlewareData;
41
+ middlewareData: import("@floating-ui/core").MiddlewareData;
42
42
  x: number;
43
43
  y: number;
44
44
  isPositioned: boolean;
@@ -59,7 +59,7 @@ export declare function useTip({ allowedPlacements, isOpen: controlledOpen, isDi
59
59
  strategy: import("@floating-ui/utils").Strategy;
60
60
  x: number;
61
61
  y: number;
62
- middlewareData: import("@floating-ui/react").MiddlewareData;
62
+ middlewareData: import("@floating-ui/core").MiddlewareData;
63
63
  isPositioned: boolean;
64
64
  update: () => void;
65
65
  floatingStyles: React.CSSProperties;
@@ -82,7 +82,7 @@ export declare function useTip({ allowedPlacements, isOpen: controlledOpen, isDi
82
82
  export declare const useTipContext: () => {
83
83
  placement: import("@floating-ui/utils").Placement;
84
84
  strategy: import("@floating-ui/utils").Strategy;
85
- middlewareData: import("@floating-ui/react").MiddlewareData;
85
+ middlewareData: import("@floating-ui/core").MiddlewareData;
86
86
  x: number;
87
87
  y: number;
88
88
  isPositioned: boolean;
@@ -103,7 +103,7 @@ export declare const useTipContext: () => {
103
103
  strategy: import("@floating-ui/utils").Strategy;
104
104
  x: number;
105
105
  y: number;
106
- middlewareData: import("@floating-ui/react").MiddlewareData;
106
+ middlewareData: import("@floating-ui/core").MiddlewareData;
107
107
  isPositioned: boolean;
108
108
  update: () => void;
109
109
  floatingStyles: React.CSSProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "2.3.13",
3
+ "version": "2.4.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -93,7 +93,7 @@
93
93
  "@floating-ui/react": "0.25.1",
94
94
  "@heroicons/react": "2.0.13",
95
95
  "@neo4j-cypher/react-codemirror": "^1.0.1",
96
- "@neo4j-ndl/base": "^2.3.9",
96
+ "@neo4j-ndl/base": "^2.4.0",
97
97
  "@table-nav/core": "0.0.7",
98
98
  "@table-nav/react": "0.0.7",
99
99
  "@tanstack/react-table": "^8.9.3",