@neo4j-ndl/react 3.6.2 → 3.7.1

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.
Files changed (46) hide show
  1. package/lib/cjs/_common/export-stories-utils.js +33 -0
  2. package/lib/cjs/_common/export-stories-utils.js.map +1 -0
  3. package/lib/cjs/color-picker/ColorPicker.js +213 -0
  4. package/lib/cjs/color-picker/ColorPicker.js.map +1 -0
  5. package/lib/cjs/color-picker/index.js +38 -0
  6. package/lib/cjs/color-picker/index.js.map +1 -0
  7. package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js +61 -0
  8. package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -0
  9. package/lib/cjs/color-picker/stories/color-picker-full.story.js +36 -0
  10. package/lib/cjs/color-picker/stories/color-picker-full.story.js.map +1 -0
  11. package/lib/cjs/color-picker/stories/color-picker-without-eye-dropper.story.js +36 -0
  12. package/lib/cjs/color-picker/stories/color-picker-without-eye-dropper.story.js.map +1 -0
  13. package/lib/cjs/color-picker/stories/color-picker.stories.js +78 -0
  14. package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -0
  15. package/lib/cjs/color-picker/stories/index.js +40 -0
  16. package/lib/cjs/color-picker/stories/index.js.map +1 -0
  17. package/lib/cjs/index.js +1 -0
  18. package/lib/cjs/index.js.map +1 -1
  19. package/lib/esm/_common/export-stories-utils.js +29 -0
  20. package/lib/esm/_common/export-stories-utils.js.map +1 -0
  21. package/lib/esm/color-picker/ColorPicker.js +207 -0
  22. package/lib/esm/color-picker/ColorPicker.js.map +1 -0
  23. package/lib/esm/color-picker/index.js +22 -0
  24. package/lib/esm/color-picker/index.js.map +1 -0
  25. package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js +59 -0
  26. package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -0
  27. package/lib/esm/color-picker/stories/color-picker-full.story.js +34 -0
  28. package/lib/esm/color-picker/stories/color-picker-full.story.js.map +1 -0
  29. package/lib/esm/color-picker/stories/color-picker-without-eye-dropper.story.js +34 -0
  30. package/lib/esm/color-picker/stories/color-picker-without-eye-dropper.story.js.map +1 -0
  31. package/lib/esm/color-picker/stories/color-picker.stories.js +75 -0
  32. package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -0
  33. package/lib/esm/color-picker/stories/index.js +31 -0
  34. package/lib/esm/color-picker/stories/index.js.map +1 -0
  35. package/lib/esm/index.js +1 -0
  36. package/lib/esm/index.js.map +1 -1
  37. package/lib/types/_common/export-stories-utils.d.ts +26 -0
  38. package/lib/types/color-picker/ColorPicker.d.ts +36 -0
  39. package/lib/types/color-picker/index.d.ts +21 -0
  40. package/lib/types/color-picker/stories/color-picker-custom-swatches.story.d.ts +22 -0
  41. package/lib/types/color-picker/stories/color-picker-full.story.d.ts +22 -0
  42. package/lib/types/color-picker/stories/color-picker-without-eye-dropper.story.d.ts +22 -0
  43. package/lib/types/color-picker/stories/color-picker.stories.d.ts +47 -0
  44. package/lib/types/color-picker/stories/index.d.ts +26 -0
  45. package/lib/types/index.d.ts +1 -0
  46. package/package.json +4 -2
@@ -0,0 +1,207 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
+ import 'eyedropper-polyfill';
23
+ import { EyeDropperIcon } from '@heroicons/react/24/outline';
24
+ import { tokens } from '@neo4j-ndl/base';
25
+ import { hexToHsva, hsvaToHex, hsvaToRgba, Hue, rgbaToHex, rgbaToHsva, Saturation, validHex, } from '@uiw/react-color';
26
+ import classNames from 'classnames';
27
+ import { forwardRef, useEffect, useState } from 'react';
28
+ import { IconButton } from '../button';
29
+ import { Select } from '../select';
30
+ import { TextInput } from '../text-input';
31
+ export const ColorPicker = forwardRef(function ColorPicker({ color, onChange, swatches = Object.values(tokens.palette.graph).filter(validHex), shouldShowEyeDropper = true, className, style, }, ref) {
32
+ const [isEyeDropperActiveState, setIsEyeDropperActiveState] = useState(false);
33
+ const [format, setFormat] = useState({
34
+ label: 'Hex',
35
+ value: 'hex',
36
+ });
37
+ const isEyeDropperActive = 'EyeDropper' in window && shouldShowEyeDropper;
38
+ const hsva = typeof color === 'string'
39
+ ? hexToHsva(color)
40
+ : typeof color === 'object' && 'r' in color
41
+ ? rgbaToHsva(color)
42
+ : Object.assign(Object.assign({ h: 0, s: 0, v: 0 }, color), { a: 1 });
43
+ const handleChange = (hsva) => {
44
+ const hex = hsvaToHex(hsva);
45
+ const rgb = hsvaToRgba(hsva);
46
+ onChange({
47
+ // used since typescript cannot infer the type of the color
48
+ hex: `#${hex.split('#')[1]}`,
49
+ hsva,
50
+ rgb,
51
+ });
52
+ };
53
+ return (_jsxs("div", { ref: ref, className: classNames('ndl-color-picker', className), style: style, children: [_jsx(Saturation, { hsva: hsva, className: "ndl-color-picker-saturation", onChange: (newColor) => {
54
+ handleChange(Object.assign(Object.assign(Object.assign({}, hsva), newColor), { a: hsva.a }));
55
+ }, pointer: (props) => _jsx(Pointer, Object.assign({}, props, { hsva: hsva })), radius: tokens.borderRadius['lg'], tabIndex: -1 }), _jsx(Swatch, { colors: swatches, hsva: hsva, onChange: (newColor) => {
56
+ handleChange(newColor);
57
+ } }), _jsxs("div", { className: "ndl-color-picker-hue-container", children: [isEyeDropperActive && (_jsx(IconButton, { size: "small", isActive: isEyeDropperActiveState, onClick: () => {
58
+ setIsEyeDropperActiveState(true);
59
+ // TODO: Remove the any casting when polyfiller is not needed anymore. https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper
60
+ // Type assertion to handle the unknown type
61
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
+ const eyeDropper = new window.EyeDropper();
63
+ eyeDropper
64
+ .open()
65
+ .then((result) => {
66
+ handleChange(hexToHsva(result.sRGBHex));
67
+ })
68
+ .catch((err) => {
69
+ console.error(err);
70
+ })
71
+ .finally(() => {
72
+ setIsEyeDropperActiveState(false);
73
+ });
74
+ }, isClean: true, ariaLabel: "Pick color", children: _jsx(EyeDropperIcon, {}) })), _jsx(Hue, { className: "ndl-color-picker-hue", hue: hsva.h, onChange: (newHue) => {
75
+ handleChange(Object.assign(Object.assign({}, hsva), { h: newHue.h }));
76
+ }, radius: tokens.borderRadius['lg'], pointer: (props) => (_jsx(Pointer, Object.assign({}, props, { hsva: {
77
+ a: 1,
78
+ h: hsva.h,
79
+ s: 100,
80
+ v: 100,
81
+ } }))) })] }), _jsxs("div", { className: "ndl-color-picker-inputs", children: [_jsx(Select, { size: "small", type: "select", selectProps: {
82
+ 'aria-label': 'Color format',
83
+ isSearchable: false,
84
+ onChange: (newFormat) => {
85
+ if (!newFormat)
86
+ return;
87
+ setFormat({
88
+ label: newFormat.label,
89
+ value: newFormat.value,
90
+ });
91
+ },
92
+ options: [
93
+ {
94
+ label: 'Hex',
95
+ value: 'hex',
96
+ },
97
+ {
98
+ label: 'RGB',
99
+ value: 'rgb',
100
+ },
101
+ ],
102
+ value: { label: format.label, value: format.value },
103
+ } }), format.value === 'hex' && (_jsx(HexInput, { hsva: hsva, onChange: (newColor) => {
104
+ handleChange(hexToHsva(newColor));
105
+ } })), format.value === 'rgb' && (_jsx(RgbInput, { hsva: hsva, onChange: (newColor) => {
106
+ handleChange(hexToHsva(newColor));
107
+ } }))] })] }));
108
+ });
109
+ const HexInput = ({ hsva, onChange, }) => {
110
+ const [inputValue, setInputValue] = useState(() => hsvaToHex(hsva).split('#')[1]);
111
+ // Update input value when hsva changes from outside
112
+ useEffect(() => {
113
+ setInputValue(hsvaToHex(hsva).split('#')[1]);
114
+ }, [hsva]);
115
+ const handleChange = (e) => {
116
+ // Remove # if user pastes a hex code with it
117
+ const value = e.target.value.split('#')[1];
118
+ // Always update the input value for immediate feedback
119
+ setInputValue(value);
120
+ // Check if the input is a valid hex color (only 6 characters)
121
+ const isValidHex = /^[0-9A-Fa-f]{6}$/.test(value);
122
+ if (isValidHex) {
123
+ onChange(`#${value}`);
124
+ }
125
+ };
126
+ const hexValue = hsvaToHex(hsva);
127
+ return (_jsx(TextInput, { size: "small", value: inputValue, leftElement: _jsx("div", { className: "ndl-color-picker-hex-input-prefix", children: "#" }), onChange: handleChange, isFluid: true, style: { width: '100%' }, htmlAttributes: {
128
+ 'aria-label': 'Hex color code',
129
+ maxLength: 6,
130
+ onCopy: (e) => {
131
+ e.preventDefault();
132
+ navigator.clipboard.writeText(hexValue);
133
+ },
134
+ } }));
135
+ };
136
+ const RgbInput = ({ hsva, onChange, }) => {
137
+ const rgba = hsvaToRgba(hsva);
138
+ const [rgbValues, setRgbValues] = useState({
139
+ b: rgba.b,
140
+ g: rgba.g,
141
+ r: rgba.r,
142
+ });
143
+ // Update input values when hsva changes from outside
144
+ useEffect(() => {
145
+ const newRgba = hsvaToRgba(hsva);
146
+ setRgbValues({
147
+ b: newRgba.b,
148
+ g: newRgba.g,
149
+ r: newRgba.r,
150
+ });
151
+ }, [hsva]);
152
+ const handleChange = (channel, e) => {
153
+ const value = parseInt(e.target.value, 10);
154
+ // Validate the input is a number between 0-255
155
+ const validValue = isNaN(value) ? 0 : Math.max(0, Math.min(255, value));
156
+ const newRgbValues = Object.assign(Object.assign({}, rgbValues), { [channel]: validValue });
157
+ setRgbValues(newRgbValues);
158
+ // Convert RGB to hex and call onChange
159
+ const hexColor = `#${newRgbValues.r.toString(16).padStart(2, '0')}${newRgbValues.g.toString(16).padStart(2, '0')}${newRgbValues.b.toString(16).padStart(2, '0')}`;
160
+ onChange(hexColor);
161
+ };
162
+ return (_jsxs("div", { className: "ndl-color-picker-rgb-inputs", children: [_jsx(TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.r.toString(), onChange: (e) => handleChange('r', e), htmlAttributes: {
163
+ 'aria-label': 'Red',
164
+ max: '255',
165
+ min: '0',
166
+ type: 'number',
167
+ } }), _jsx(TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.g.toString(), onChange: (e) => handleChange('g', e), htmlAttributes: {
168
+ 'aria-label': 'Green',
169
+ max: '255',
170
+ min: '0',
171
+ type: 'number',
172
+ } }), _jsx(TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.b.toString(), onChange: (e) => handleChange('b', e), htmlAttributes: {
173
+ 'aria-label': 'Blue',
174
+ max: '255',
175
+ min: '0',
176
+ type: 'number',
177
+ } })] }));
178
+ };
179
+ const Swatch = ({ colors, onChange, hsva, }) => {
180
+ return (_jsx("div", { className: "ndl-color-picker-swatch", children: colors.map((color) => {
181
+ const hexColor = typeof color === 'string'
182
+ ? color
183
+ : typeof color === 'object' && 'r' in color
184
+ ? rgbaToHex(color)
185
+ : hsvaToHex(color);
186
+ const hsvaColor = typeof color === 'string'
187
+ ? hexToHsva(color)
188
+ : 'r' in color
189
+ ? rgbaToHsva(color)
190
+ : color;
191
+ const isActive = hsva.h === hsvaColor.h &&
192
+ hsva.s === hsvaColor.s &&
193
+ hsva.v === hsvaColor.v;
194
+ return (_jsx("button", { "aria-label": hexColor, className: classNames('ndl-color-picker-swatch-color', {
195
+ 'ndl-color-picker-swatch-color-active': isActive,
196
+ }), style: { backgroundColor: hsvaToHex(hsvaColor) }, onClick: () => onChange(hsvaColor) }, hexColor));
197
+ }) }));
198
+ };
199
+ const Pointer = ({ prefixCls, left, top, hsva, }) => {
200
+ const rgba = hsvaToRgba(hsva);
201
+ return (_jsx("div", { style: {
202
+ backgroundColor: `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`,
203
+ left,
204
+ top,
205
+ }, className: classNames(prefixCls, 'ndl-color-picker-pointer') }));
206
+ };
207
+ //# sourceMappingURL=ColorPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/color-picker/ColorPicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAEL,SAAS,EAET,SAAS,EACT,UAAU,EACV,GAAG,EAGH,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAe1C,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EACE,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAC/D,oBAAoB,GAAG,IAAI,EAC3B,SAAS,EACT,KAAK,GACN,EACD,GAAG;IAEH,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GACzD,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAGjC;QACD,KA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BACrD,sCAAsC,EAAE,QAAQ;iBACjD,CAAC,EACF,KAAK,EAAE,EAAE,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,EAChD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAN7B,QAAQ,CAOb,CACH,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,OAAO,GAAG,CAAC,EACf,SAAS,EACT,IAAI,EACJ,GAAG,EACH,IAAI,GAC+B,EAAE,EAAE;IACvC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CACL,cACE,KAAK,EAAE;YACL,eAAe,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG;YACnE,IAAI;YACJ,GAAG;SACJ,EACD,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,0BAA0B,CAAC,GAC5D,CACH,CAAC;AACJ,CAAC,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 './ColorPicker';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/color-picker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,eAAe,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import { useState } from 'react';
23
+ import { ColorPicker } from '../ColorPicker';
24
+ const Component = () => {
25
+ const [color, setColor] = useState({
26
+ a: 1,
27
+ b: 0,
28
+ g: 0,
29
+ r: 0,
30
+ });
31
+ return (_jsx("div", { className: "n-w-60", children: _jsx(ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb), swatches: [
32
+ {
33
+ a: 1,
34
+ b: 0,
35
+ g: 0,
36
+ r: 0,
37
+ },
38
+ {
39
+ a: 1,
40
+ b: 255,
41
+ g: 0,
42
+ r: 0,
43
+ },
44
+ {
45
+ a: 1,
46
+ b: 0,
47
+ g: 255,
48
+ r: 0,
49
+ },
50
+ {
51
+ a: 1,
52
+ b: 0,
53
+ g: 0,
54
+ r: 255,
55
+ },
56
+ ] }) }));
57
+ };
58
+ export default Component;
59
+ //# sourceMappingURL=color-picker-custom-swatches.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-picker-custom-swatches.story.js","sourceRoot":"","sources":["../../../../src/color-picker/stories/color-picker-custom-swatches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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
+ import { useState } from 'react';
23
+ import { ColorPicker } from '../ColorPicker';
24
+ const Component = () => {
25
+ const [color, setColor] = useState({
26
+ a: 1,
27
+ b: 0,
28
+ g: 0,
29
+ r: 0,
30
+ });
31
+ return (_jsx("div", { className: "n-w-60", children: _jsx(ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb) }) }));
32
+ };
33
+ export default Component;
34
+ //# sourceMappingURL=color-picker-full.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-picker-full.story.js","sourceRoot":"","sources":["../../../../src/color-picker/stories/color-picker-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC;QACjC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,QAAQ,YACrB,KAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAC9C,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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
+ import { useState } from 'react';
23
+ import { ColorPicker } from '../ColorPicker';
24
+ const Component = () => {
25
+ const [color, setColor] = useState({
26
+ a: 1,
27
+ b: 0,
28
+ g: 0,
29
+ r: 0,
30
+ });
31
+ return (_jsx("div", { className: "n-w-60", children: _jsx(ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb), shouldShowEyeDropper: false }) }));
32
+ };
33
+ export default Component;
34
+ //# sourceMappingURL=color-picker-without-eye-dropper.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-picker-without-eye-dropper.story.js","sourceRoot":"","sources":["../../../../src/color-picker/stories/color-picker-without-eye-dropper.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC;QACjC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,QAAQ,YACrB,KAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC9C,oBAAoB,EAAE,KAAK,GAC3B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,75 @@
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 { ColorPicker } from '../ColorPicker';
23
+ import { ColorPickerCustomSwatches, ColorPickerCustomSwatchesSource, ColorPickerFull, ColorPickerFullSource, ColorPickerWithoutEyeDropper, ColorPickerWithoutEyeDropperSource, } from '.';
24
+ const componentMeta = {
25
+ component: ColorPicker,
26
+ parameters: {
27
+ controls: { disable: true },
28
+ },
29
+ tags: ['docsPage'],
30
+ title: 'Components/ColorPicker',
31
+ };
32
+ export default componentMeta;
33
+ export const Full = {
34
+ // @ts-expect-error The args from the full story are not actually used but we get a type issue here
35
+ args: {},
36
+ parameters: {
37
+ docs: {
38
+ source: {
39
+ code: ColorPickerFullSource,
40
+ language: 'tsx',
41
+ type: 'code',
42
+ },
43
+ },
44
+ },
45
+ render: ColorPickerFull,
46
+ };
47
+ export const WithoutEyeDropper = {
48
+ // @ts-expect-error The args from the full story are not actually used but we get a type issue here
49
+ args: {},
50
+ parameters: {
51
+ docs: {
52
+ source: {
53
+ code: ColorPickerWithoutEyeDropperSource,
54
+ language: 'tsx',
55
+ type: 'code',
56
+ },
57
+ },
58
+ },
59
+ render: ColorPickerWithoutEyeDropper,
60
+ };
61
+ export const CustomSwatches = {
62
+ // @ts-expect-error The args from the full story are not actually used but we get a type issue here
63
+ args: {},
64
+ parameters: {
65
+ docs: {
66
+ source: {
67
+ code: ColorPickerCustomSwatchesSource,
68
+ language: 'tsx',
69
+ type: 'code',
70
+ },
71
+ },
72
+ },
73
+ render: ColorPickerCustomSwatches,
74
+ };
75
+ //# sourceMappingURL=color-picker.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-picker.stories.js","sourceRoot":"","sources":["../../../../src/color-picker/stories/color-picker.stories.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,GAAG,CAAC;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC5B;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,wBAAwB;CACG,CAAC;AAErC,eAAe,aAAa,CAAC;AAG7B,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kCAAkC;gBACxC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,4BAA4B;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,+BAA+B;gBACrC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,yBAAyB;CAClC,CAAC"}
@@ -0,0 +1,31 @@
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 { default as ColorPickerFull } from './color-picker-full.story';
22
+ export { default as ColorPickerWithoutEyeDropper } from './color-picker-without-eye-dropper.story';
23
+ export { default as ColorPickerCustomSwatches } from './color-picker-custom-swatches.story';
24
+ import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
25
+ import ColorPickerCustomSwatchesSourceRaw from './color-picker-custom-swatches.story.tsx?raw';
26
+ import ColorPickerFullSourceRaw from './color-picker-full.story.tsx?raw';
27
+ import ColorPickerWithoutEyeDropperSourceRaw from './color-picker-without-eye-dropper.story.tsx?raw';
28
+ export const ColorPickerFullSource = removeLicenseHeader(ColorPickerFullSourceRaw);
29
+ export const ColorPickerWithoutEyeDropperSource = removeLicenseHeader(ColorPickerWithoutEyeDropperSourceRaw);
30
+ export const ColorPickerCustomSwatchesSource = removeLicenseHeader(ColorPickerCustomSwatchesSourceRaw);
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/color-picker/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAE5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,kCAAkC,MAAM,8CAA8C,CAAC;AAC9F,OAAO,wBAAwB,MAAM,mCAAmC,CAAC;AACzE,OAAO,qCAAqC,MAAM,kDAAkD,CAAC;AAErG,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAG,mBAAmB,CACnE,qCAAqC,CACtC,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,kCAAkC,CACnC,CAAC"}
package/lib/esm/index.js CHANGED
@@ -70,4 +70,5 @@ export * from './spotlight';
70
70
  export * from './loading-bar';
71
71
  export * from './conditional-wrap';
72
72
  export * from './ai-presence';
73
+ export * from './color-picker';
73
74
  //# 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,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,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;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc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,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,26 @@
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
+ * Removes license header comments from source code
23
+ * @param source Raw source code string
24
+ * @returns Source code with license header removed
25
+ */
26
+ export declare const removeLicenseHeader: (source: string) => string;
@@ -0,0 +1,36 @@
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 'eyedropper-polyfill';
22
+ import { type HexColor, type HsvaColor, type RgbaColor } from '@uiw/react-color';
23
+ type ColorPickerProps = {
24
+ color: HsvaColor | RgbaColor | HexColor;
25
+ swatches?: (HsvaColor | RgbaColor | HexColor)[];
26
+ shouldShowEyeDropper?: boolean;
27
+ onChange: (newColor: {
28
+ hex: HexColor;
29
+ rgb: RgbaColor;
30
+ hsva: HsvaColor;
31
+ }) => void;
32
+ className?: string;
33
+ style?: React.CSSProperties;
34
+ };
35
+ export declare const ColorPicker: import("react").ForwardRefExoticComponent<ColorPickerProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ export {};
@@ -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 './ColorPicker';
@@ -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
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
22
+ export default Component;