@neo4j-ndl/react 0.8.0 → 0.8.2
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 +318 -0
- package/lib/cjs/dropdown/Dropdown.js +1 -1
- package/lib/cjs/dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/graph-label/GraphLabel.js +80 -42
- package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
- package/lib/cjs/graph-label/color.js +87 -0
- package/lib/cjs/graph-label/color.js.map +1 -0
- package/lib/esm/dropdown/Dropdown.js +1 -1
- package/lib/esm/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/graph-label/GraphLabel.js +57 -42
- package/lib/esm/graph-label/GraphLabel.js.map +1 -1
- package/lib/esm/graph-label/color.js +77 -0
- package/lib/esm/graph-label/color.js.map +1 -0
- package/lib/types/graph-label/GraphLabel.d.ts +11 -38
- package/lib/types/graph-label/color.d.ts +41 -0
- package/package.json +6 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## 0.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 98ea3fe: fix yarn workspace versioning issue
|
|
8
|
+
- Updated dependencies [7d934b2]
|
|
9
|
+
- Updated dependencies [98ea3fe]
|
|
10
|
+
- @neo4j-ndl/base@0.8.2
|
|
11
|
+
|
|
12
|
+
## 0.8.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- b7d901c: Relationship Graph label background and border colors adjustable
|
|
17
|
+
- 62804f6: dropdown max tag width to avoid line break
|
|
18
|
+
- Updated dependencies [b7d901c]
|
|
19
|
+
- @neo4j-ndl/base@0.8.1
|
|
20
|
+
|
|
21
|
+
## 0.8.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 6c20210: code-block component and styling added
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [6c20210]
|
|
30
|
+
- @neo4j-ndl/base@0.8.0
|
|
31
|
+
|
|
32
|
+
## 0.7.2
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 9be8862: export graph-label
|
|
37
|
+
|
|
38
|
+
## 0.7.1
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- 4f8a272: remove padding and bg
|
|
43
|
+
- ae5c9bf: Added checkbox tooltip functionality for a bug fix in importers implemetation of the NDL checkbox
|
|
44
|
+
- Updated dependencies [4f8a272]
|
|
45
|
+
- @neo4j-ndl/base@0.7.1
|
|
46
|
+
|
|
47
|
+
## 0.7.0
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- 3cd0cf1: wizard and graph label component added
|
|
52
|
+
- b2a2c91: Added graph labels
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- 55965a1: fix centering of loading spinner for icon button
|
|
57
|
+
- Updated dependencies [3cd0cf1]
|
|
58
|
+
- Updated dependencies [b2a2c91]
|
|
59
|
+
- @neo4j-ndl/base@0.7.0
|
|
60
|
+
|
|
61
|
+
## 0.6.3
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 0f46a61: fix d-n-d safari bug and small color fix
|
|
66
|
+
- Updated dependencies [3f019df]
|
|
67
|
+
- Updated dependencies [0f46a61]
|
|
68
|
+
- Updated dependencies [b21abb3]
|
|
69
|
+
- Updated dependencies [2759379]
|
|
70
|
+
- @neo4j-ndl/base@0.6.2
|
|
71
|
+
|
|
72
|
+
## 0.6.2
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 8f74098: enable table row actions and fix group icon button background
|
|
77
|
+
- Updated dependencies [8f74098]
|
|
78
|
+
- @neo4j-ndl/base@0.6.1
|
|
79
|
+
|
|
80
|
+
## 0.6.1
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- c692c1c: fix dropdown partial props for storybook inference
|
|
85
|
+
- 2d4d6d4: Improve algorithm for pagination display values
|
|
86
|
+
|
|
87
|
+
## 0.6.0
|
|
88
|
+
|
|
89
|
+
### Minor Changes
|
|
90
|
+
|
|
91
|
+
- c14db02: dropdown component added
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- c14db02: tag extented props, add onKeyDown listener, and pass event to the remove callback
|
|
96
|
+
- Updated dependencies [c14db02]
|
|
97
|
+
- @neo4j-ndl/base@0.6.0
|
|
98
|
+
|
|
99
|
+
## 0.5.3
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- f61d8db: add proper tag exporting in react lib
|
|
104
|
+
|
|
105
|
+
## 0.5.2
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- aa799f8: drag and drop responsiveness and vertical alignment
|
|
110
|
+
- Updated dependencies [82bfb55]
|
|
111
|
+
- Updated dependencies [aa799f8]
|
|
112
|
+
- @neo4j-ndl/base@0.5.1
|
|
113
|
+
|
|
114
|
+
## 0.5.1
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- f009031: center aligment for popover
|
|
119
|
+
|
|
120
|
+
## 0.5.0
|
|
121
|
+
|
|
122
|
+
### Minor Changes
|
|
123
|
+
|
|
124
|
+
- 57696ad: Add Dialog and Modal components
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- b9f5ed7: dont focus first menu item on open and disable click on events on disabled items
|
|
129
|
+
- Updated dependencies [57696ad]
|
|
130
|
+
- Updated dependencies [b9f5ed7]
|
|
131
|
+
- @neo4j-ndl/base@0.5.0
|
|
132
|
+
|
|
133
|
+
## 0.4.0
|
|
134
|
+
|
|
135
|
+
### Minor Changes
|
|
136
|
+
|
|
137
|
+
- 936a731: icon button added
|
|
138
|
+
- 6ca6bc1: icon array component added
|
|
139
|
+
- 103d711: text input component implementation
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- 517e42f: renamed regular size to medium in button to reflect better figma design system
|
|
144
|
+
- c86128c: resolve tailwind class name conflict and fix safari inconsistencies
|
|
145
|
+
- 9fa7653: table row key error fix
|
|
146
|
+
- Updated dependencies [936a731]
|
|
147
|
+
- Updated dependencies [6ca6bc1]
|
|
148
|
+
- Updated dependencies [517e42f]
|
|
149
|
+
- Updated dependencies [c86128c]
|
|
150
|
+
- Updated dependencies [103d711]
|
|
151
|
+
- @neo4j-ndl/base@0.4.0
|
|
152
|
+
|
|
153
|
+
## 0.3.1
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- c7b2bea: button outline neutral fix
|
|
158
|
+
- Updated dependencies [67ef31d]
|
|
159
|
+
- @neo4j-ndl/base@0.3.1
|
|
160
|
+
|
|
161
|
+
All notable changes to this project will be documented in this file.
|
|
162
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
163
|
+
|
|
164
|
+
# [0.3.0](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.2.0...@neo4j-ndl/react@0.3.0) (2022-04-28)
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
- **react:** table page types and state pageIndex check ([07aa817](https://github.com/neo4j/neo4j-design/commit/07aa817989dddd559f69203b8ab3647eff848b5d))
|
|
169
|
+
- **repo:** tsconfig issues with merging ([b0085ad](https://github.com/neo4j/neo4j-design/commit/b0085ad720942679c5429152cdd52a79c155b1f1))
|
|
170
|
+
- **table:** add support for no plugins ([ed40565](https://github.com/neo4j/neo4j-design/commit/ed405653286a75493ac58d3e8412cdda8b3cfd91))
|
|
171
|
+
|
|
172
|
+
### Features
|
|
173
|
+
|
|
174
|
+
- **react:** improve progress bar options ([#66](https://github.com/neo4j/neo4j-design/issues/66)) ([4427541](https://github.com/neo4j/neo4j-design/commit/442754127e2a40369d10a1e2de419b1438d9232e))
|
|
175
|
+
- **react:** table ready for rfc ([6e0c538](https://github.com/neo4j/neo4j-design/commit/6e0c538a33b4d93ece003587b652a20213bd1b14))
|
|
176
|
+
|
|
177
|
+
# [0.2.0](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.4...@neo4j-ndl/react@0.2.0) (2022-04-19)
|
|
178
|
+
|
|
179
|
+
### Bug Fixes
|
|
180
|
+
|
|
181
|
+
- **component/alert:** update styles ([0dc4e37](https://github.com/neo4j/neo4j-design/commit/0dc4e37e0b005fcc98ce8661323024b16686f0ef))
|
|
182
|
+
- **react:** proper dropzone typings and better typesafety ([25e5a2e](https://github.com/neo4j/neo4j-design/commit/25e5a2e1210b2c0be12d2a23ea54e4b4b26066e1))
|
|
183
|
+
- **react:** small typo ([a00a60c](https://github.com/neo4j/neo4j-design/commit/a00a60c07ab39cbf631ba65294522720001e0a9f))
|
|
184
|
+
- **test:** remove react import ([5820a44](https://github.com/neo4j/neo4j-design/commit/5820a444dc8d83562747b87ce064215b4d536d57))
|
|
185
|
+
|
|
186
|
+
### Features
|
|
187
|
+
|
|
188
|
+
- **react/base:** sync and add custom icons ([674b67a](https://github.com/neo4j/neo4j-design/commit/674b67a86f60daee8cdc829a85b0a8403ff0f766))
|
|
189
|
+
- **react:** add drag and drop component ([339763d](https://github.com/neo4j/neo4j-design/commit/339763debd7f3ae00237b06b6580944a74a13635))
|
|
190
|
+
|
|
191
|
+
## [0.1.4](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.3...@neo4j-ndl/react@0.1.4) (2022-04-04)
|
|
192
|
+
|
|
193
|
+
**Note:** Version bump only for package @neo4j-ndl/react
|
|
194
|
+
|
|
195
|
+
## [0.1.3](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.2...@neo4j-ndl/react@0.1.3) (2022-04-04)
|
|
196
|
+
|
|
197
|
+
### Bug Fixes
|
|
198
|
+
|
|
199
|
+
- **react:** add label changes to PR ([bfc78a7](https://github.com/neo4j/neo4j-design/commit/bfc78a707ffdbfc1f7fba3ab8532eabb52275a58))
|
|
200
|
+
- **react:** add missing progress bar export ([#52](https://github.com/neo4j/neo4j-design/issues/52)) ([c559d59](https://github.com/neo4j/neo4j-design/commit/c559d59334315a9b9998bf4011bf7af4d1917fdd))
|
|
201
|
+
- **react:** propagate button and menu item events ([b8d5b71](https://github.com/neo4j/neo4j-design/commit/b8d5b71b38f2094080e57acf3a7ca6654276fe74))
|
|
202
|
+
- **tests:** fix label test with color prop ([2f8422b](https://github.com/neo4j/neo4j-design/commit/2f8422b59db2e1da85a09707a3ce7e9c993c2462))
|
|
203
|
+
- **view-selector:** pass classname to children ([2817e56](https://github.com/neo4j/neo4j-design/commit/2817e567ac03446b0702268b354046101e5cc3e5))
|
|
204
|
+
|
|
205
|
+
## [0.1.2](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.1...@neo4j-ndl/react@0.1.2) (2022-03-14)
|
|
206
|
+
|
|
207
|
+
### Bug Fixes
|
|
208
|
+
|
|
209
|
+
- **react:** use generic forwardRef to fix typing issues ([fb5e836](https://github.com/neo4j/neo4j-design/commit/fb5e836b5a491d6c08e7359d5443824560ae072d))
|
|
210
|
+
|
|
211
|
+
## [0.1.1](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.0...@neo4j-ndl/react@0.1.1) (2022-03-14)
|
|
212
|
+
|
|
213
|
+
### Bug Fixes
|
|
214
|
+
|
|
215
|
+
- **alert:** add name prop for a11y ([cd10794](https://github.com/neo4j/neo4j-design/commit/cd10794cb384f426c3ceb678d81e5b3b8d40e6f4))
|
|
216
|
+
- **alert:** allow react node as title ([7d06925](https://github.com/neo4j/neo4j-design/commit/7d06925dce54fa993d58d374b893c78c3ced712c))
|
|
217
|
+
- **alert:** style title as title if children provided ([5c005bf](https://github.com/neo4j/neo4j-design/commit/5c005bf1d86c7a6bb8391a404ed07107b89349a8))
|
|
218
|
+
- **base:** change components to appropriate typescale classes ([97c3af3](https://github.com/neo4j/neo4j-design/commit/97c3af3a17bcf3a68f283ba77186b76b77a33e49))
|
|
219
|
+
- **button:** fix button link click working when disabled ([f0a5272](https://github.com/neo4j/neo4j-design/commit/f0a52721d7565cb4d1b8a2778f73cd7c4dbc6a21))
|
|
220
|
+
- **button:** fix loading spinner pushing text to end on wide buttons ([65e673a](https://github.com/neo4j/neo4j-design/commit/65e673a0f0889d83ac82b75d01dcff04511ecf79))
|
|
221
|
+
- fix ref types and prop types in stories ([2bf548e](https://github.com/neo4j/neo4j-design/commit/2bf548e017ca15061ade731f18c7bf13acc0c1a6))
|
|
222
|
+
- **label:** fix label semi filled classes not being applied ([6fc0ff9](https://github.com/neo4j/neo4j-design/commit/6fc0ff9a8023d535879d02bafbda64c01d560cca))
|
|
223
|
+
- **menu:** fix menu propogating arrow keys to parent menu ([af32c3b](https://github.com/neo4j/neo4j-design/commit/af32c3b7a38b4d3a9996d076e36155402b32d514))
|
|
224
|
+
- pass all extra props and forward all refs ([46190b9](https://github.com/neo4j/neo4j-design/commit/46190b9ec35511a1aaaee8ece4640536a5b0c85f))
|
|
225
|
+
- **react:** make sure className is always forwarded ([5feda6e](https://github.com/neo4j/neo4j-design/commit/5feda6eb4ff45b9cee98b9ad7fc630546e8b0478))
|
|
226
|
+
|
|
227
|
+
# 0.1.0 (2022-03-01)
|
|
228
|
+
|
|
229
|
+
### Bug Fixes
|
|
230
|
+
|
|
231
|
+
- **alert:** prefix alert classes ([eb53aa0](https://github.com/neo4j/neo4j-design/commit/eb53aa0ef98c9415de4a533276bd43214e43ee83))
|
|
232
|
+
- **base:** Update colors to match color document ([e3cf9e2](https://github.com/neo4j/neo4j-design/commit/e3cf9e270907894eddb3404cf4ed04eeef33b195))
|
|
233
|
+
- **button:** add "as" prop ([b94beeb](https://github.com/neo4j/neo4j-design/commit/b94beeb3a327893302c5754a778c4ec1eaa0cec0))
|
|
234
|
+
- **button:** clean up button load/disabled state ([213ae48](https://github.com/neo4j/neo4j-design/commit/213ae48349d4f9faaa944ee752d19208a1af5197))
|
|
235
|
+
- **button:** prefix button root class with ndl ([b30e27a](https://github.com/neo4j/neo4j-design/commit/b30e27a6155ba3851adb6ba49332c34b19a2332a))
|
|
236
|
+
- **button:** update text button colors ([6400389](https://github.com/neo4j/neo4j-design/commit/640038987b544361099762404d972e786d70cabd))
|
|
237
|
+
- **context-menu:** move to next item with menuitem role ([183ff01](https://github.com/neo4j/neo4j-design/commit/183ff015b22ab15d624297a3c0bd77a943457634))
|
|
238
|
+
- **input:** scope input css classes ([e26ff55](https://github.com/neo4j/neo4j-design/commit/e26ff550c06c95ad0ccaa78e2fb11a531684c991))
|
|
239
|
+
- **label:** rename classNames to className ([49643c5](https://github.com/neo4j/neo4j-design/commit/49643c50a2ccad6ad8f3537044010a592efc71ac))
|
|
240
|
+
- **label:** scope css classes ([400daf8](https://github.com/neo4j/neo4j-design/commit/400daf855b5fef3154af2d40f4c023ee2d7ec956))
|
|
241
|
+
- **loading-spinner:** export loading spinner ([0cb4261](https://github.com/neo4j/neo4j-design/commit/0cb42613f5d2b6c0931518310be1ab5e1d5c7ca9))
|
|
242
|
+
- **loading-spinner:** scope css classes ([03c7593](https://github.com/neo4j/neo4j-design/commit/03c7593808d6940a24268b67b36689ecde57c6bc))
|
|
243
|
+
- **menu:** add disabled state to menu item. map menu enter pressed to click event ([cac6c50](https://github.com/neo4j/neo4j-design/commit/cac6c5036822b34d66161ec036fbfb595cb98f80))
|
|
244
|
+
- **menu:** scope css classes ([572917e](https://github.com/neo4j/neo4j-design/commit/572917eeb6e94927a53b474a91bbeb5cc0dfc9d9))
|
|
245
|
+
- **popover:** scope css classes ([3cb3207](https://github.com/neo4j/neo4j-design/commit/3cb3207fc224cfe3bd160bdd13c8d179e5f54168))
|
|
246
|
+
- **popover:** use react portal to avoid pos fixed + transform issues ([3253a8e](https://github.com/neo4j/neo4j-design/commit/3253a8e43a6ed84b8f115a43c914cf7994c33690))
|
|
247
|
+
- **popover:** use react portal to avoid pos fixed + transform issues ([81f803e](https://github.com/neo4j/neo4j-design/commit/81f803ea923dfcd977dc267ef782af410ba8ba43))
|
|
248
|
+
- **progress-bar:** scope css classes ([8316e36](https://github.com/neo4j/neo4j-design/commit/8316e36da210e7b9bc0458adbd9e088e7dff5980))
|
|
249
|
+
- **react:** bad refactor ([26fc799](https://github.com/neo4j/neo4j-design/commit/26fc7992c4c1597aa9b17a58080c7895cb896af7))
|
|
250
|
+
- **react:** button component hover cursor and storybook disabled prop missing ([861fb8e](https://github.com/neo4j/neo4j-design/commit/861fb8ecff51e8f5f5fc2b739cdd8ae990fbe0ca))
|
|
251
|
+
- **react:** button test ([efb6026](https://github.com/neo4j/neo4j-design/commit/efb60263ded373a74c93eb589220280e6d7793e4))
|
|
252
|
+
- **react:** components naming ([69a4510](https://github.com/neo4j/neo4j-design/commit/69a4510aa9e772eb0c14aa9f378ede1b9ece04e0))
|
|
253
|
+
- **react:** removed false as class names and forced neods-font-sans ([49991f6](https://github.com/neo4j/neo4j-design/commit/49991f6242b03e0488ac1a9e702238b8db49e5c8))
|
|
254
|
+
- **react:** safari render of context menu item and chore ([9a44fbd](https://github.com/neo4j/neo4j-design/commit/9a44fbd5261a020c88c6bc88211d0754d6d4f8f5))
|
|
255
|
+
- **react:** view-selector export ([c4d7320](https://github.com/neo4j/neo4j-design/commit/c4d7320ce29bdf268a882d93b34575f26b0e4827))
|
|
256
|
+
- **storybook-typography:** fix incorrect tailwind class ([a073fcf](https://github.com/neo4j/neo4j-design/commit/a073fcf35042fd06802a307ed2ddeabf60320ca8))
|
|
257
|
+
- **storybook:** pills path ([8911016](https://github.com/neo4j/neo4j-design/commit/8911016e0f65da3dfcf6b41a05e65ece0b43c8c2))
|
|
258
|
+
- **tabs:** export tabs ([20f6683](https://github.com/neo4j/neo4j-design/commit/20f668368ebc7c08ef67a6c0c3e16af04ce44024))
|
|
259
|
+
- **tabs:** scope css classes ([b0137a0](https://github.com/neo4j/neo4j-design/commit/b0137a02645a58473590f8d6c4f09158cf9e101c))
|
|
260
|
+
- **tag:** scope css classes ([89086e1](https://github.com/neo4j/neo4j-design/commit/89086e1d0c47479cc040327fd8105728ef8c46d9))
|
|
261
|
+
- **tooltip:** scope css classes ([0e56690](https://github.com/neo4j/neo4j-design/commit/0e56690b88b970cdcd6da90c9458386d67ee3746))
|
|
262
|
+
- **view-selector:** scope css classes ([6262035](https://github.com/neo4j/neo4j-design/commit/62620353f1ff1f371b2ea463302cafbff9d8a5f4))
|
|
263
|
+
|
|
264
|
+
### Features
|
|
265
|
+
|
|
266
|
+
- add tooltip component ([#23](https://github.com/neo4j/neo4j-design/issues/23)) ([c02f5d6](https://github.com/neo4j/neo4j-design/commit/c02f5d634b1a4e266a415feec6c48ce9bf064ef5))
|
|
267
|
+
- **base:** typography added ([e24a090](https://github.com/neo4j/neo4j-design/commit/e24a090c9734acc9543731a32da99e222fe0ea0f))
|
|
268
|
+
- **icons:** add web-component icons ([ad453b6](https://github.com/neo4j/neo4j-design/commit/ad453b6152b4e0f379c67d9be37996a56791289c))
|
|
269
|
+
- **popover:** create popover from menu ([d1a20a4](https://github.com/neo4j/neo4j-design/commit/d1a20a49761e9cfcba43ec6d2078f3e9f6a11faa))
|
|
270
|
+
- **project:** button finished, pill renamed to label with +1 variant and Tailwind v2 to v3 ([3093d4f](https://github.com/neo4j/neo4j-design/commit/3093d4f34d6d41818f7f560c2dde1ed96ab0652e))
|
|
271
|
+
- **react:** add alert component ([2b9b8ed](https://github.com/neo4j/neo4j-design/commit/2b9b8ed0b0248b0e35d964764dfb671e247cbe4a))
|
|
272
|
+
- **react:** add context menu ([acc319d](https://github.com/neo4j/neo4j-design/commit/acc319d25e7def7168d6fd5761434044c506ed3d))
|
|
273
|
+
- **react:** add radio, checkbox and switch components ([9fa81f3](https://github.com/neo4j/neo4j-design/commit/9fa81f3d6dd8b560e96a01ddbdd07431ea95c2e8))
|
|
274
|
+
- **react:** add switch and checkbox component ([a82f962](https://github.com/neo4j/neo4j-design/commit/a82f9627e1cede05b8013d9eb0326720ff5b9163))
|
|
275
|
+
- **react:** add Tag component ([91f6972](https://github.com/neo4j/neo4j-design/commit/91f69721bf5c4d5fb207019125b4edd1fbc56857))
|
|
276
|
+
- **react:** icons added ([c97bd25](https://github.com/neo4j/neo4j-design/commit/c97bd25db1650e36558c714988b46a4584f8eabb))
|
|
277
|
+
- **react:** loading spinner ([0e3a583](https://github.com/neo4j/neo4j-design/commit/0e3a5836ee8a60bab2dbbda3d4bdbad689eef8e1))
|
|
278
|
+
- **react:** view-selector component ([17a0789](https://github.com/neo4j/neo4j-design/commit/17a0789a9600aa02eb1c4d8e34e43d689d52af7c))
|
|
279
|
+
- **tabs:** add tabs ([1186a66](https://github.com/neo4j/neo4j-design/commit/1186a66d5d08ee26480c1aefba156314050914ef))
|
|
280
|
+
|
|
281
|
+
## [0.1.2](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.1...@neo4j-ndl/react@0.1.2) (2021-12-02)
|
|
282
|
+
|
|
283
|
+
### Bug Fixes
|
|
284
|
+
|
|
285
|
+
- **react:** removed false as class names and forced neods-font-sans ([49991f6](https://github.com/neo4j/neo4j-design/commit/49991f6242b03e0488ac1a9e702238b8db49e5c8))
|
|
286
|
+
- **storybook:** pills path ([8911016](https://github.com/neo4j/neo4j-design/commit/8911016e0f65da3dfcf6b41a05e65ece0b43c8c2))
|
|
287
|
+
|
|
288
|
+
## [0.1.1](https://github.com/neo4j/neo4j-design/compare/@neo4j-ndl/react@0.1.0...@neo4j-ndl/react@0.1.1) (2021-12-02)
|
|
289
|
+
|
|
290
|
+
### Bug Fixes
|
|
291
|
+
|
|
292
|
+
- **react:** components naming ([69a4510](https://github.com/neo4j/neo4j-design/commit/69a4510aa9e772eb0c14aa9f378ede1b9ece04e0))
|
|
293
|
+
|
|
294
|
+
# 0.1.0 (2021-12-01)
|
|
295
|
+
|
|
296
|
+
### Features
|
|
297
|
+
|
|
298
|
+
- **base:** typography added ([e24a090](https://github.com/neo4j/neo4j-design/commit/e24a090c9734acc9543731a32da99e222fe0ea0f))
|
|
299
|
+
|
|
300
|
+
## [0.0.4](https://github.com/konsalex/neo4j-design/compare/@neo4j-ndl/buttons@0.0.3...@neo4j-ndl/buttons@0.0.4) (2021-11-24)
|
|
301
|
+
|
|
302
|
+
**Note:** Version bump only for package @neo4j-ndl/buttons
|
|
303
|
+
|
|
304
|
+
## [0.0.3](https://github.com/konsalex/neo4j-design/compare/@neo4j-ndl/buttons@0.0.2...@neo4j-ndl/buttons@0.0.3) (2021-11-23)
|
|
305
|
+
|
|
306
|
+
### Bug Fixes
|
|
307
|
+
|
|
308
|
+
- **base:** fix tailwind conflicts with existing css files, disabled pre-flight and more ([1d8fb98](https://github.com/konsalex/neo4j-design/commit/1d8fb985cf8ac4082029f35e55b1039d38dee866))
|
|
309
|
+
|
|
310
|
+
## 0.0.2 (2021-11-23)
|
|
311
|
+
|
|
312
|
+
### Bug Fixes
|
|
313
|
+
|
|
314
|
+
- **packages:** renamed packages to test - unpublished are still active ([b4693d2](https://github.com/konsalex/neo4j-design/commit/b4693d2f5c1ec8bf7730f9301578b7f2a3a8bff1))
|
|
315
|
+
|
|
316
|
+
## 0.0.2 (2021-11-23)
|
|
317
|
+
|
|
318
|
+
**Note:** Version bump only for package @neo4j-ndl/button
|
|
@@ -78,7 +78,7 @@ const customStyles = ({ errorText, size, }) => {
|
|
|
78
78
|
? `1px solid ${focusedBorderColor}`
|
|
79
79
|
: `1px solid ${defaultBorder}`,
|
|
80
80
|
} })),
|
|
81
|
-
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px' })),
|
|
81
|
+
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px', maxWidth: '95%' })),
|
|
82
82
|
indicatorsContainer: (provided) => (Object.assign(Object.assign({}, provided), {
|
|
83
83
|
/**
|
|
84
84
|
* The right icon has padding of 8px so:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAuC;AACvC,4DAAoC;AACpC,kFAA0D;AAE1D,2CAA2C;AAC3C,gEAAiD;AACjD,uEAA+C;AAC/C,+DAA6C;AAE7C,wCAAwC;AACxC,4CAAwD;AAMxD,2CAKqB;AAErB;;;;;;GAMG;AAEH,MAAM,kBAAkB,GAAG,CAKzB,KAAmE,EACnE,EAAE,CACF,CAAC;IACC,iBAAiB,EAAE,IAAA,qCAAyB,EAAC,KAAK,CAAC;IACnD,kBAAkB,EAAE,IAAI;IACxB,cAAc,EAAE,IAAA,iCAAqB,EAAC,KAAK,CAAC;IAC5C,gBAAgB,EAAE,IAAA,kCAAsB,EAAC,KAAK,CAAC;IAC/C,WAAW,EAAE,IAAA,6BAAiB,EAAC,KAAK,CAAC;CAKR,CAAA,CAAC;AAElC,MAAM,YAAY,GAAG,CAInB,EACA,SAAS,EACT,IAAI,GAIL,EAAE,EAAE;IACH,MAAM,kBAAkB,GAAG,SAAS;QAClC,CAAC,CAAC,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;QAC3C,CAAC,CAAC,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAEvC,MAAM,aAAa,GAAG,SAAS;QAC7B,CAAC,CAAC,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;QAC3C,CAAC,CAAC,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAE/C,OAAO;QACL,O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BAAiB,IACrB,MAAM,kCAAO,cAAc,GAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KACnD,CACH,CAAC;YACF,MAAM;QACR;YACE,aAAa,GAAG,CACd,uBAAC,sBAAM,kBACL,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,kBAAkB,IAC1B,iBAAiB,IACrB,MAAM,kCAAO,cAAc,GAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KACnD,CACH,CAAC;KACL;IAED,OAAO,CACL,wBAAC,SAAS,kBACR,GAAG,EAAE,GAAG,IACJ,SAAS,IACb,SAAS,EAAE,IAAA,oBAAU,EAAC,cAAc,EAAE,IAAI,EAAE;YAC1C,KAAK;SACN,CAAC,iBAED,KAAK,IAAI,gDAAO,OAAO,EAAE,UAAU,gBAAG,KAAK,IAAS,EACpD,aAAa,EACb,QAAQ,IAAI,CAAC,SAAS,IAAI,+CAAM,SAAS,EAAC,UAAU,gBAAE,QAAQ,IAAQ,EACtE,SAAS,IAAI,+CAAM,SAAS,EAAC,qBAAqB,gBAAE,SAAS,IAAQ,KAC5D,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
26
|
var t = {};
|
|
4
27
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -35,8 +58,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
35
58
|
* You should have received a copy of the GNU General Public License
|
|
36
59
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
37
60
|
*/
|
|
38
|
-
const react_1 =
|
|
61
|
+
const react_1 = __importStar(require("react"));
|
|
39
62
|
const classnames_1 = __importDefault(require("classnames"));
|
|
63
|
+
const tokens_1 = __importDefault(require("@neo4j-ndl/base/lib/tokens/js/tokens"));
|
|
64
|
+
const color_1 = require("./color");
|
|
40
65
|
/**
|
|
41
66
|
*
|
|
42
67
|
*
|
|
@@ -44,7 +69,9 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
44
69
|
*
|
|
45
70
|
*
|
|
46
71
|
*/
|
|
47
|
-
const HexagonEnd = ({ direction = 'left'
|
|
72
|
+
const HexagonEnd = ({ direction = 'left', color }) => {
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `ndl-hexagon-end ${direction}` }, { children: [(0, jsx_runtime_1.jsx)("svg", Object.assign({ width: "8", height: "24", viewBox: "0 0 7 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsx)("path", { className: "ndl-hexagon-end-inner", style: { fill: color }, fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })), (0, jsx_runtime_1.jsx)("svg", Object.assign({ className: "ndl-hexagon-end-active", width: "13", height: "30", viewBox: "0 0 13 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.075 2C9.12474 2 8.24318 2.54521 7.74867 3.43873L2.21419 13.4387C1.68353 14.3976 1.68353 15.6024 2.21419 16.5613L7.74867 26.5613C8.24318 27.4548 9.12474 28 10.075 28H13V30H10.075C8.49126 30 7.022 29.0913 6.1978 27.6021L0.663324 17.6021C-0.221109 16.0041 -0.221108 13.9959 0.663325 12.3979L6.1978 2.39789C7.022 0.90869 8.49126 0 10.075 0H13V2H10.075Z" }) }))] })));
|
|
74
|
+
};
|
|
48
75
|
/**
|
|
49
76
|
*
|
|
50
77
|
*
|
|
@@ -53,7 +80,16 @@ const HexagonEnd = ({ direction = 'left' }) => ((0, jsx_runtime_1.jsxs)("div", O
|
|
|
53
80
|
*
|
|
54
81
|
*/
|
|
55
82
|
const GraphLabel = react_1.default.forwardRef(function GraphLabel(_a, ref) {
|
|
56
|
-
var { type = 'node', disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "disabled", "selected", "as", "onClick"]);
|
|
83
|
+
var { type = 'node', color, disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "color", "disabled", "selected", "as", "onClick"]);
|
|
84
|
+
const [isHover, setIsHover] = (0, react_1.useState)(false);
|
|
85
|
+
const handleMouseEnter = (event) => {
|
|
86
|
+
setIsHover(true);
|
|
87
|
+
props.onMouseEnter && props.onMouseEnter(event);
|
|
88
|
+
};
|
|
89
|
+
const handleMouseLeave = (event) => {
|
|
90
|
+
setIsHover(false);
|
|
91
|
+
props.onMouseLeave && props.onMouseLeave(event);
|
|
92
|
+
};
|
|
57
93
|
const handleClick = (e) => {
|
|
58
94
|
// By default, a <button /> element with disabled set to true will not get its
|
|
59
95
|
// on click handler called. To support the same behavior on <a /> tags we
|
|
@@ -68,51 +104,53 @@ const GraphLabel = react_1.default.forwardRef(function GraphLabel(_a, ref) {
|
|
|
68
104
|
onClick(e);
|
|
69
105
|
}
|
|
70
106
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
let backgroundColor = (0, react_1.useMemo)(() => {
|
|
108
|
+
if (!color) {
|
|
109
|
+
switch (type) {
|
|
110
|
+
case 'node':
|
|
111
|
+
return tokens_1.default.colors.warning[40];
|
|
112
|
+
case 'relationship':
|
|
113
|
+
return tokens_1.default.palette.light.neutral.bg.strong;
|
|
114
|
+
default:
|
|
115
|
+
return tokens_1.default.palette.light.neutral.bg.strongest;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return color;
|
|
119
|
+
}, [color, type]);
|
|
120
|
+
const hoverColor = (0, react_1.useMemo)(() => (0, color_1.getHoverColor)(backgroundColor ? backgroundColor : tokens_1.default.colors.warning[40]), [backgroundColor]);
|
|
121
|
+
const textColor = (0, react_1.useMemo)(() => (0, color_1.getTextColorFromBackground)(backgroundColor ? backgroundColor : tokens_1.default.colors.warning[40]), [backgroundColor]);
|
|
122
|
+
const disabledTextColor = (0, react_1.useMemo)(() => (0, color_1.getDisabledTextColor)(backgroundColor ? backgroundColor : tokens_1.default.colors.warning[40]), [backgroundColor]);
|
|
123
|
+
if (isHover && !disabled)
|
|
124
|
+
backgroundColor = hoverColor;
|
|
125
|
+
if (disabled)
|
|
126
|
+
backgroundColor = (0, color_1.getDisabledColor)(backgroundColor);
|
|
82
127
|
let Component = 'button';
|
|
83
128
|
if (as) {
|
|
84
129
|
Component = as;
|
|
85
130
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
93
|
-
const RelationshipLabel = react_1.default.forwardRef(function RelationshipLabel(_a, ref) {
|
|
94
|
-
var { children, disabled, selected, as } = _a, props = __rest(_a, ["children", "disabled", "selected", "as"]);
|
|
95
|
-
let Component = 'button';
|
|
96
|
-
if (as) {
|
|
97
|
-
Component = as;
|
|
131
|
+
if (type === 'node') {
|
|
132
|
+
const classes = (0, classnames_1.default)('ndl-node-label', props.className, {
|
|
133
|
+
disabled: disabled,
|
|
134
|
+
selected: selected,
|
|
135
|
+
});
|
|
136
|
+
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({}, props, { className: classes, ref: ref, style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, { children: props.children })));
|
|
98
137
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
138
|
+
else if (type === 'relationship') {
|
|
139
|
+
const classes = (0, classnames_1.default)('ndl-relationship-label', {
|
|
140
|
+
disabled: disabled,
|
|
141
|
+
selected: selected,
|
|
142
|
+
});
|
|
143
|
+
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { color: disabled ? disabledTextColor : textColor }), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: [(0, jsx_runtime_1.jsx)("svg", Object.assign({ style: { display: 'none' } }, { children: (0, jsx_runtime_1.jsx)("mask", Object.assign({ id: "ndl-relationship-label-mask-outer-border", fill: "white" }, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })) })), (0, jsx_runtime_1.jsx)(HexagonEnd, { direction: "left", color: backgroundColor }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-relationship-label-content", style: {
|
|
144
|
+
backgroundColor: backgroundColor,
|
|
145
|
+
} }, { children: props.children })), (0, jsx_runtime_1.jsx)(HexagonEnd, { direction: "right", color: backgroundColor })] })));
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const classes = (0, classnames_1.default)('ndl-property-key-label', {
|
|
149
|
+
disabled: disabled,
|
|
150
|
+
selected: selected,
|
|
151
|
+
});
|
|
152
|
+
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({}, props, { style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: props.children })));
|
|
110
153
|
}
|
|
111
|
-
const classes = (0, classnames_1.default)('ndl-property-key-label', {
|
|
112
|
-
disabled: disabled,
|
|
113
|
-
selected: selected,
|
|
114
|
-
});
|
|
115
|
-
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
|
|
116
154
|
});
|
|
117
155
|
exports.default = GraphLabel;
|
|
118
156
|
//# sourceMappingURL=GraphLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphLabel.js","sourceRoot":"","sources":["../../../src/graph-label/GraphLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphLabel.js","sourceRoot":"","sources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OAAO,CACL,uBAAC,SAAS,oBACJ,KAAK,IACT,KAAK,kBACH,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,IAC5C,KAAK,CAAC,KAAK,GAEhB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,EAAE,GAAG,gBAEP,KAAK,CAAC,QAAQ,IACL,CACb,CAAC;KACH;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.getDisabledColor = exports.getDisabledTextColor = exports.getHoverColor = exports.getTextColorFromBackground = void 0;
|
|
27
|
+
const tinycolor2_1 = __importDefault(require("tinycolor2"));
|
|
28
|
+
const tokens_1 = __importDefault(require("@neo4j-ndl/base/lib/tokens/js/tokens"));
|
|
29
|
+
/**
|
|
30
|
+
* Takes a color string and returns color string
|
|
31
|
+
* that is readable on top of that background. Prioritizes pallete
|
|
32
|
+
* text colors and uses black or white as fallback.
|
|
33
|
+
*/
|
|
34
|
+
const getTextColorFromBackground = (color) => {
|
|
35
|
+
return tinycolor2_1.default
|
|
36
|
+
.mostReadable(color, [
|
|
37
|
+
tokens_1.default.palette.light.neutral.text.default,
|
|
38
|
+
tokens_1.default.palette.light.neutral.text.inverse,
|
|
39
|
+
], {
|
|
40
|
+
includeFallbackColors: true,
|
|
41
|
+
})
|
|
42
|
+
.toString();
|
|
43
|
+
};
|
|
44
|
+
exports.getTextColorFromBackground = getTextColorFromBackground;
|
|
45
|
+
/**
|
|
46
|
+
* Takes a color string and returns a color string
|
|
47
|
+
* that is darker or ligher depending on the given color.
|
|
48
|
+
*/
|
|
49
|
+
const getHoverColor = (color) => {
|
|
50
|
+
const hslColor = (0, tinycolor2_1.default)(color).toHsl();
|
|
51
|
+
if (hslColor.l < 0.5) {
|
|
52
|
+
return (0, tinycolor2_1.default)(color).lighten(10).toString();
|
|
53
|
+
}
|
|
54
|
+
return (0, tinycolor2_1.default)(color).darken(10).toString();
|
|
55
|
+
};
|
|
56
|
+
exports.getHoverColor = getHoverColor;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the most readlabale color on the given background color
|
|
59
|
+
* as a string from a list of palette text colors
|
|
60
|
+
*/
|
|
61
|
+
const getDisabledTextColor = (backgroundColor) => {
|
|
62
|
+
//TODO: update to token when dark theme is available
|
|
63
|
+
//inverse of text.weaker color should probably be replaced by token
|
|
64
|
+
const inverseTextColor = '#8e887f';
|
|
65
|
+
return tinycolor2_1.default
|
|
66
|
+
.mostReadable(backgroundColor, [
|
|
67
|
+
inverseTextColor,
|
|
68
|
+
tokens_1.default.palette.light.neutral.text.weakest,
|
|
69
|
+
tokens_1.default.palette.light.neutral.text.weak,
|
|
70
|
+
tokens_1.default.palette.light.neutral.text.weaker,
|
|
71
|
+
])
|
|
72
|
+
.toString();
|
|
73
|
+
};
|
|
74
|
+
exports.getDisabledTextColor = getDisabledTextColor;
|
|
75
|
+
/**
|
|
76
|
+
* Takes a color string and returns a color string
|
|
77
|
+
* that is darker or ligher depending on the given color.
|
|
78
|
+
*/
|
|
79
|
+
const getDisabledColor = (color) => {
|
|
80
|
+
const hslColor = (0, tinycolor2_1.default)(color).toHsl();
|
|
81
|
+
if (hslColor.l < 0.5) {
|
|
82
|
+
return (0, tinycolor2_1.default)(color).lighten(15).toString();
|
|
83
|
+
}
|
|
84
|
+
return (0, tinycolor2_1.default)(color).darken(15).toString();
|
|
85
|
+
};
|
|
86
|
+
exports.getDisabledColor = getDisabledColor;
|
|
87
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../src/graph-label/color.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,4DAAmC;AACnC,kFAA0D;AAE1D;;;;GAIG;AACI,MAAM,0BAA0B,GAAG,CAAC,KAAa,EAAU,EAAE;IAClE,OAAO,oBAAS;SACb,YAAY,CACX,KAAK,EACL;QACE,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;QACzC,gBAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;KAC1C,EACD;QACE,qBAAqB,EAAE,IAAI;KAC5B,CACF;SACA,QAAQ,EAAE,CAAC;AAChB,CAAC,CAAC;AAbW,QAAA,0BAA0B,8BAarC;AAEF;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,MAAM,QAAQ,GAAG,IAAA,oBAAS,EA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AAChD,CAAC,CAAC;AANW,QAAA,gBAAgB,oBAM3B"}
|
|
@@ -72,7 +72,7 @@ const customStyles = ({ errorText, size, }) => {
|
|
|
72
72
|
? `1px solid ${focusedBorderColor}`
|
|
73
73
|
: `1px solid ${defaultBorder}`,
|
|
74
74
|
} })),
|
|
75
|
-
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px' })),
|
|
75
|
+
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px', maxWidth: '95%' })),
|
|
76
76
|
indicatorsContainer: (provided) => (Object.assign(Object.assign({}, provided), {
|
|
77
77
|
/**
|
|
78
78
|
* The right icon has padding of 8px so:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAE1D,2CAA2C;AAC3C,OAAO,MAAqB,MAAM,cAAc,CAAC;AACjD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAMxD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AAEH,MAAM,kBAAkB,GAAG,CAKzB,KAAmE,EACnE,EAAE,CACF,CAAC;IACC,iBAAiB,EAAE,yBAAyB,CAAC,KAAK,CAAC;IACnD,kBAAkB,EAAE,IAAI;IACxB,cAAc,EAAE,qBAAqB,CAAC,K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,SAAS,IACb,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,IAAI,EAAE;YAC1C,KAAK;SACN,CAAC,iBAED,KAAK,IAAI,8BAAO,OAAO,EAAE,UAAU,gBAAG,KAAK,IAAS,EACpD,aAAa,EACb,QAAQ,IAAI,CAAC,SAAS,IAAI,6BAAM,SAAS,EAAC,UAAU,gBAAE,QAAQ,IAAQ,EACtE,SAAS,IAAI,6BAAM,SAAS,EAAC,qBAAqB,gBAAE,SAAS,IAAQ,KAC5D,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -30,8 +30,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
* You should have received a copy of the GNU General Public License
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
|
-
import React from 'react';
|
|
33
|
+
import React, { useMemo, useState } from 'react';
|
|
34
34
|
import classnames from 'classnames';
|
|
35
|
+
import tokens from '@neo4j-ndl/base/lib/tokens/js/tokens';
|
|
36
|
+
import { getDisabledColor, getDisabledTextColor, getHoverColor, getTextColorFromBackground, } from './color';
|
|
35
37
|
/**
|
|
36
38
|
*
|
|
37
39
|
*
|
|
@@ -39,7 +41,9 @@ import classnames from 'classnames';
|
|
|
39
41
|
*
|
|
40
42
|
*
|
|
41
43
|
*/
|
|
42
|
-
const HexagonEnd = ({ direction = 'left'
|
|
44
|
+
const HexagonEnd = ({ direction = 'left', color }) => {
|
|
45
|
+
return (_jsxs("div", Object.assign({ className: `ndl-hexagon-end ${direction}` }, { children: [_jsx("svg", Object.assign({ width: "8", height: "24", viewBox: "0 0 7 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { className: "ndl-hexagon-end-inner", style: { fill: color }, fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })), _jsx("svg", Object.assign({ className: "ndl-hexagon-end-active", width: "13", height: "30", viewBox: "0 0 13 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.075 2C9.12474 2 8.24318 2.54521 7.74867 3.43873L2.21419 13.4387C1.68353 14.3976 1.68353 15.6024 2.21419 16.5613L7.74867 26.5613C8.24318 27.4548 9.12474 28 10.075 28H13V30H10.075C8.49126 30 7.022 29.0913 6.1978 27.6021L0.663324 17.6021C-0.221109 16.0041 -0.221108 13.9959 0.663325 12.3979L6.1978 2.39789C7.022 0.90869 8.49126 0 10.075 0H13V2H10.075Z" }) }))] })));
|
|
46
|
+
};
|
|
43
47
|
/**
|
|
44
48
|
*
|
|
45
49
|
*
|
|
@@ -48,7 +52,16 @@ const HexagonEnd = ({ direction = 'left' }) => (_jsxs("div", Object.assign({ cla
|
|
|
48
52
|
*
|
|
49
53
|
*/
|
|
50
54
|
const GraphLabel = React.forwardRef(function GraphLabel(_a, ref) {
|
|
51
|
-
var { type = 'node', disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "disabled", "selected", "as", "onClick"]);
|
|
55
|
+
var { type = 'node', color, disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "color", "disabled", "selected", "as", "onClick"]);
|
|
56
|
+
const [isHover, setIsHover] = useState(false);
|
|
57
|
+
const handleMouseEnter = (event) => {
|
|
58
|
+
setIsHover(true);
|
|
59
|
+
props.onMouseEnter && props.onMouseEnter(event);
|
|
60
|
+
};
|
|
61
|
+
const handleMouseLeave = (event) => {
|
|
62
|
+
setIsHover(false);
|
|
63
|
+
props.onMouseLeave && props.onMouseLeave(event);
|
|
64
|
+
};
|
|
52
65
|
const handleClick = (e) => {
|
|
53
66
|
// By default, a <button /> element with disabled set to true will not get its
|
|
54
67
|
// on click handler called. To support the same behavior on <a /> tags we
|
|
@@ -63,51 +76,53 @@ const GraphLabel = React.forwardRef(function GraphLabel(_a, ref) {
|
|
|
63
76
|
onClick(e);
|
|
64
77
|
}
|
|
65
78
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
let backgroundColor = useMemo(() => {
|
|
80
|
+
if (!color) {
|
|
81
|
+
switch (type) {
|
|
82
|
+
case 'node':
|
|
83
|
+
return tokens.colors.warning[40];
|
|
84
|
+
case 'relationship':
|
|
85
|
+
return tokens.palette.light.neutral.bg.strong;
|
|
86
|
+
default:
|
|
87
|
+
return tokens.palette.light.neutral.bg.strongest;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return color;
|
|
91
|
+
}, [color, type]);
|
|
92
|
+
const hoverColor = useMemo(() => getHoverColor(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
93
|
+
const textColor = useMemo(() => getTextColorFromBackground(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
94
|
+
const disabledTextColor = useMemo(() => getDisabledTextColor(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
95
|
+
if (isHover && !disabled)
|
|
96
|
+
backgroundColor = hoverColor;
|
|
97
|
+
if (disabled)
|
|
98
|
+
backgroundColor = getDisabledColor(backgroundColor);
|
|
77
99
|
let Component = 'button';
|
|
78
100
|
if (as) {
|
|
79
101
|
Component = as;
|
|
80
102
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
const RelationshipLabel = React.forwardRef(function RelationshipLabel(_a, ref) {
|
|
89
|
-
var { children, disabled, selected, as } = _a, props = __rest(_a, ["children", "disabled", "selected", "as"]);
|
|
90
|
-
let Component = 'button';
|
|
91
|
-
if (as) {
|
|
92
|
-
Component = as;
|
|
103
|
+
if (type === 'node') {
|
|
104
|
+
const classes = classnames('ndl-node-label', props.className, {
|
|
105
|
+
disabled: disabled,
|
|
106
|
+
selected: selected,
|
|
107
|
+
});
|
|
108
|
+
return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref, style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, { children: props.children })));
|
|
93
109
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
else if (type === 'relationship') {
|
|
111
|
+
const classes = classnames('ndl-relationship-label', {
|
|
112
|
+
disabled: disabled,
|
|
113
|
+
selected: selected,
|
|
114
|
+
});
|
|
115
|
+
return (_jsxs(Component, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { color: disabled ? disabledTextColor : textColor }), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: [_jsx("svg", Object.assign({ style: { display: 'none' } }, { children: _jsx("mask", Object.assign({ id: "ndl-relationship-label-mask-outer-border", fill: "white" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })) })), _jsx(HexagonEnd, { direction: "left", color: backgroundColor }), _jsx("div", Object.assign({ className: "ndl-relationship-label-content", style: {
|
|
116
|
+
backgroundColor: backgroundColor,
|
|
117
|
+
} }, { children: props.children })), _jsx(HexagonEnd, { direction: "right", color: backgroundColor })] })));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const classes = classnames('ndl-property-key-label', {
|
|
121
|
+
disabled: disabled,
|
|
122
|
+
selected: selected,
|
|
123
|
+
});
|
|
124
|
+
return (_jsx(Component, Object.assign({}, props, { style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: props.children })));
|
|
105
125
|
}
|
|
106
|
-
const classes = classnames('ndl-property-key-label', {
|
|
107
|
-
disabled: disabled,
|
|
108
|
-
selected: selected,
|
|
109
|
-
});
|
|
110
|
-
return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
|
|
111
126
|
});
|
|
112
127
|
export default GraphLabel;
|
|
113
128
|
//# sourceMappingURL=GraphLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphLabel.js","sourceRoot":"","sources":["../../../src/graph-label/GraphLabel.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphLabel.js","sourceRoot":"","sources":["../../../src/graph-label/GraphLabel.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,0BAA0B,GAC3B,MAAM,SAAS,CAAC;AA6BjB;;;;;;GAMG;AAEH,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,EAAE,KAAK,EAAmB,EAAE,EAAE;IACpE,OAAO,CACL,6B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@ -0,0 +1,77 @@
|
|
|
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 tinycolor from 'tinycolor2';
|
|
22
|
+
import tokens from '@neo4j-ndl/base/lib/tokens/js/tokens';
|
|
23
|
+
/**
|
|
24
|
+
* Takes a color string and returns color string
|
|
25
|
+
* that is readable on top of that background. Prioritizes pallete
|
|
26
|
+
* text colors and uses black or white as fallback.
|
|
27
|
+
*/
|
|
28
|
+
export const getTextColorFromBackground = (color) => {
|
|
29
|
+
return tinycolor
|
|
30
|
+
.mostReadable(color, [
|
|
31
|
+
tokens.palette.light.neutral.text.default,
|
|
32
|
+
tokens.palette.light.neutral.text.inverse,
|
|
33
|
+
], {
|
|
34
|
+
includeFallbackColors: true,
|
|
35
|
+
})
|
|
36
|
+
.toString();
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Takes a color string and returns a color string
|
|
40
|
+
* that is darker or ligher depending on the given color.
|
|
41
|
+
*/
|
|
42
|
+
export const getHoverColor = (color) => {
|
|
43
|
+
const hslColor = tinycolor(color).toHsl();
|
|
44
|
+
if (hslColor.l < 0.5) {
|
|
45
|
+
return tinycolor(color).lighten(10).toString();
|
|
46
|
+
}
|
|
47
|
+
return tinycolor(color).darken(10).toString();
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns the most readlabale color on the given background color
|
|
51
|
+
* as a string from a list of palette text colors
|
|
52
|
+
*/
|
|
53
|
+
export const getDisabledTextColor = (backgroundColor) => {
|
|
54
|
+
//TODO: update to token when dark theme is available
|
|
55
|
+
//inverse of text.weaker color should probably be replaced by token
|
|
56
|
+
const inverseTextColor = '#8e887f';
|
|
57
|
+
return tinycolor
|
|
58
|
+
.mostReadable(backgroundColor, [
|
|
59
|
+
inverseTextColor,
|
|
60
|
+
tokens.palette.light.neutral.text.weakest,
|
|
61
|
+
tokens.palette.light.neutral.text.weak,
|
|
62
|
+
tokens.palette.light.neutral.text.weaker,
|
|
63
|
+
])
|
|
64
|
+
.toString();
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Takes a color string and returns a color string
|
|
68
|
+
* that is darker or ligher depending on the given color.
|
|
69
|
+
*/
|
|
70
|
+
export const getDisabledColor = (color) => {
|
|
71
|
+
const hslColor = tinycolor(color).toHsl();
|
|
72
|
+
if (hslColor.l < 0.5) {
|
|
73
|
+
return tinycolor(color).lighten(15).toString();
|
|
74
|
+
}
|
|
75
|
+
return tinycolor(color).darken(15).toString();
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../src/graph-label/color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAa,EAAU,EAAE;IAClE,OAAO,SAAS;SACb,YAAY,CACX,KAAK,EACL;QACE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AAC,CAAC,KAAK,EAAE,CAAC;IAC1C,IAAI,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE;QACpB,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;KAChD;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -19,52 +19,25 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
-
import { ElementBase } from '../helpers';
|
|
23
22
|
/**
|
|
24
23
|
*
|
|
25
24
|
*
|
|
26
|
-
*
|
|
25
|
+
* GraphLabel Component
|
|
27
26
|
*
|
|
28
27
|
*
|
|
29
28
|
*/
|
|
30
|
-
declare
|
|
29
|
+
declare const GraphLabel: React.ForwardRefExoticComponent<{
|
|
30
|
+
type: 'node' | 'relationship' | 'propertyKey';
|
|
31
31
|
children?: React.ReactNode;
|
|
32
|
+
/** The background color of the label only applicable to type node and relationship*/
|
|
33
|
+
color?: string | undefined;
|
|
32
34
|
/** Sets the label to the disabled style */
|
|
33
|
-
disabled?: boolean;
|
|
35
|
+
disabled?: boolean | undefined;
|
|
34
36
|
/** Additional classes only applicable to type node*/
|
|
35
|
-
className?: string;
|
|
36
|
-
/** The background color of the label only applicable to type node*/
|
|
37
|
-
color?: string;
|
|
38
|
-
/** If the element is selected */
|
|
39
|
-
selected?: boolean;
|
|
40
|
-
} & ElementBase<HTMLButtonElement>;
|
|
41
|
-
declare type RelationshipLabelProps = {
|
|
42
|
-
children?: React.ReactNode;
|
|
43
|
-
/** Sets the label to the disabled style */
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
/** If the element is selected */
|
|
46
|
-
selected?: boolean;
|
|
47
|
-
} & ElementBase<HTMLButtonElement>;
|
|
48
|
-
declare type PropertyKeyLabelProps = {
|
|
49
|
-
children?: React.ReactNode;
|
|
50
|
-
/** Sets the label to the disabled style */
|
|
51
|
-
disabled?: boolean;
|
|
37
|
+
className?: string | undefined;
|
|
52
38
|
/** If the element is selected */
|
|
53
|
-
selected?: boolean;
|
|
54
|
-
} &
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} & NodeLabelProps) | ({
|
|
58
|
-
type: 'relationship';
|
|
59
|
-
} & RelationshipLabelProps) | ({
|
|
60
|
-
type: 'propertyKey';
|
|
61
|
-
} & PropertyKeyLabelProps);
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* GraphLabel Component
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
|
-
declare const GraphLabel: React.ForwardRefExoticComponent<GraphLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
selected?: boolean | undefined;
|
|
40
|
+
} & Omit<React.HTMLProps<HTMLButtonElement>, "ref" | "size" | "as" | "selected" | "onChange"> & {
|
|
41
|
+
as?: string | React.ComponentType<any> | undefined;
|
|
42
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
70
43
|
export default GraphLabel;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* Takes a color string and returns color string
|
|
23
|
+
* that is readable on top of that background. Prioritizes pallete
|
|
24
|
+
* text colors and uses black or white as fallback.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getTextColorFromBackground: (color: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Takes a color string and returns a color string
|
|
29
|
+
* that is darker or ligher depending on the given color.
|
|
30
|
+
*/
|
|
31
|
+
export declare const getHoverColor: (color: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the most readlabale color on the given background color
|
|
34
|
+
* as a string from a list of palette text colors
|
|
35
|
+
*/
|
|
36
|
+
export declare const getDisabledTextColor: (backgroundColor: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Takes a color string and returns a color string
|
|
39
|
+
* that is darker or ligher depending on the given color.
|
|
40
|
+
*/
|
|
41
|
+
export declare const getDisabledColor: (color: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "React implementation of Neo4j Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"button",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@types/jest-axe": "^3.5.3",
|
|
49
49
|
"@types/react-dom": "^17.0.11",
|
|
50
50
|
"@types/react-table": "^7.7.10",
|
|
51
|
+
"@types/tinycolor2": "^1.4.3",
|
|
51
52
|
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
52
53
|
"@typescript-eslint/parser": "^5.5.0",
|
|
53
54
|
"babel-jest": "^27.3.1",
|
|
@@ -68,13 +69,14 @@
|
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@heroicons/react": "^1.0.5",
|
|
71
|
-
"@neo4j-ndl/base": "^0.8.
|
|
72
|
+
"@neo4j-ndl/base": "^0.8.2",
|
|
72
73
|
"classnames": "^2.3.1",
|
|
73
74
|
"detect-browser": "^5.3.0",
|
|
74
75
|
"react-dropzone": "^14.0.0",
|
|
75
76
|
"react-select": "^5.3.2",
|
|
76
77
|
"react-syntax-highlighter": "^15.5.0",
|
|
77
78
|
"react-table": "^7.7.0",
|
|
78
|
-
"react-use": "^17.4.0"
|
|
79
|
+
"react-use": "^17.4.0",
|
|
80
|
+
"tinycolor2": "^1.4.2"
|
|
79
81
|
}
|
|
80
|
-
}
|
|
82
|
+
}
|