@neo4j-ndl/react 3.6.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/_common/export-stories-utils.js +33 -0
- package/lib/cjs/_common/export-stories-utils.js.map +1 -0
- package/lib/cjs/color-picker/ColorPicker.js +213 -0
- package/lib/cjs/color-picker/ColorPicker.js.map +1 -0
- package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js +61 -0
- package/lib/cjs/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -0
- package/lib/cjs/color-picker/stories/color-picker-full.story.js +36 -0
- package/lib/cjs/color-picker/stories/color-picker-full.story.js.map +1 -0
- package/lib/cjs/color-picker/stories/color-picker-without-eye-dropper.story.js +36 -0
- package/lib/cjs/color-picker/stories/color-picker-without-eye-dropper.story.js.map +1 -0
- package/lib/cjs/color-picker/stories/color-picker.stories.js +78 -0
- package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -0
- package/lib/cjs/color-picker/stories/index.js +40 -0
- package/lib/cjs/color-picker/stories/index.js.map +1 -0
- package/lib/cjs/context-menu/ContextMenu.js +51 -51
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/_common/export-stories-utils.js +29 -0
- package/lib/esm/_common/export-stories-utils.js.map +1 -0
- package/lib/esm/color-picker/ColorPicker.js +207 -0
- package/lib/esm/color-picker/ColorPicker.js.map +1 -0
- package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js +59 -0
- package/lib/esm/color-picker/stories/color-picker-custom-swatches.story.js.map +1 -0
- package/lib/esm/color-picker/stories/color-picker-full.story.js +34 -0
- package/lib/esm/color-picker/stories/color-picker-full.story.js.map +1 -0
- package/lib/esm/color-picker/stories/color-picker-without-eye-dropper.story.js +34 -0
- package/lib/esm/color-picker/stories/color-picker-without-eye-dropper.story.js.map +1 -0
- package/lib/esm/color-picker/stories/color-picker.stories.js +75 -0
- package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -0
- package/lib/esm/color-picker/stories/index.js +31 -0
- package/lib/esm/color-picker/stories/index.js.map +1 -0
- package/lib/esm/context-menu/ContextMenu.js +51 -51
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/types/_common/export-stories-utils.d.ts +26 -0
- package/lib/types/color-picker/ColorPicker.d.ts +36 -0
- package/lib/types/color-picker/stories/color-picker-custom-swatches.story.d.ts +22 -0
- package/lib/types/color-picker/stories/color-picker-full.story.d.ts +22 -0
- package/lib/types/color-picker/stories/color-picker-without-eye-dropper.story.d.ts +22 -0
- package/lib/types/color-picker/stories/color-picker.stories.d.ts +47 -0
- package/lib/types/color-picker/stories/index.d.ts +26 -0
- package/lib/types/context-menu/ContextMenu.d.ts +2 -2
- package/package.json +4 -2
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.removeLicenseHeader = void 0;
|
|
24
|
+
/**
|
|
25
|
+
* Removes license header comments from source code
|
|
26
|
+
* @param source Raw source code string
|
|
27
|
+
* @returns Source code with license header removed
|
|
28
|
+
*/
|
|
29
|
+
const removeLicenseHeader = (source) => {
|
|
30
|
+
return source.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
31
|
+
};
|
|
32
|
+
exports.removeLicenseHeader = removeLicenseHeader;
|
|
33
|
+
//# sourceMappingURL=export-stories-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-stories-utils.js","sourceRoot":"","sources":["../../../src/_common/export-stories-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH;;;;GAIG;AACI,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAU,EAAE;IAC5D,OAAO,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ColorPicker = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) "Neo4j"
|
|
11
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
12
|
+
*
|
|
13
|
+
* This file is part of Neo4j.
|
|
14
|
+
*
|
|
15
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
16
|
+
* it under the terms of the GNU General Public License as published by
|
|
17
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
18
|
+
* (at your option) any later version.
|
|
19
|
+
*
|
|
20
|
+
* This program is distributed in the hope that it will be useful,
|
|
21
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23
|
+
* GNU General Public License for more details.
|
|
24
|
+
*
|
|
25
|
+
* You should have received a copy of the GNU General Public License
|
|
26
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
27
|
+
*/
|
|
28
|
+
require("eyedropper-polyfill");
|
|
29
|
+
const outline_1 = require("@heroicons/react/24/outline");
|
|
30
|
+
const base_1 = require("@neo4j-ndl/base");
|
|
31
|
+
const react_color_1 = require("@uiw/react-color");
|
|
32
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
33
|
+
const react_1 = require("react");
|
|
34
|
+
const button_1 = require("../button");
|
|
35
|
+
const select_1 = require("../select");
|
|
36
|
+
const text_input_1 = require("../text-input");
|
|
37
|
+
exports.ColorPicker = (0, react_1.forwardRef)(function ColorPicker({ color, onChange, swatches = Object.values(base_1.tokens.palette.graph).filter(react_color_1.validHex), shouldShowEyeDropper = true, className, style, }, ref) {
|
|
38
|
+
const [isEyeDropperActiveState, setIsEyeDropperActiveState] = (0, react_1.useState)(false);
|
|
39
|
+
const [format, setFormat] = (0, react_1.useState)({
|
|
40
|
+
label: 'Hex',
|
|
41
|
+
value: 'hex',
|
|
42
|
+
});
|
|
43
|
+
const isEyeDropperActive = 'EyeDropper' in window && shouldShowEyeDropper;
|
|
44
|
+
const hsva = typeof color === 'string'
|
|
45
|
+
? (0, react_color_1.hexToHsva)(color)
|
|
46
|
+
: typeof color === 'object' && 'r' in color
|
|
47
|
+
? (0, react_color_1.rgbaToHsva)(color)
|
|
48
|
+
: Object.assign(Object.assign({ h: 0, s: 0, v: 0 }, color), { a: 1 });
|
|
49
|
+
const handleChange = (hsva) => {
|
|
50
|
+
const hex = (0, react_color_1.hsvaToHex)(hsva);
|
|
51
|
+
const rgb = (0, react_color_1.hsvaToRgba)(hsva);
|
|
52
|
+
onChange({
|
|
53
|
+
// used since typescript cannot infer the type of the color
|
|
54
|
+
hex: `#${hex.split('#')[1]}`,
|
|
55
|
+
hsva,
|
|
56
|
+
rgb,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, classnames_1.default)('ndl-color-picker', className), style: style, children: [(0, jsx_runtime_1.jsx)(react_color_1.Saturation, { hsva: hsva, className: "ndl-color-picker-saturation", onChange: (newColor) => {
|
|
60
|
+
handleChange(Object.assign(Object.assign(Object.assign({}, hsva), newColor), { a: hsva.a }));
|
|
61
|
+
}, pointer: (props) => (0, jsx_runtime_1.jsx)(Pointer, Object.assign({}, props, { hsva: hsva })), radius: base_1.tokens.borderRadius['lg'], tabIndex: -1 }), (0, jsx_runtime_1.jsx)(Swatch, { colors: swatches, hsva: hsva, onChange: (newColor) => {
|
|
62
|
+
handleChange(newColor);
|
|
63
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-hue-container", children: [isEyeDropperActive && ((0, jsx_runtime_1.jsx)(button_1.IconButton, { size: "small", isActive: isEyeDropperActiveState, onClick: () => {
|
|
64
|
+
setIsEyeDropperActiveState(true);
|
|
65
|
+
// TODO: Remove the any casting when polyfiller is not needed anymore. https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper
|
|
66
|
+
// Type assertion to handle the unknown type
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
const eyeDropper = new window.EyeDropper();
|
|
69
|
+
eyeDropper
|
|
70
|
+
.open()
|
|
71
|
+
.then((result) => {
|
|
72
|
+
handleChange((0, react_color_1.hexToHsva)(result.sRGBHex));
|
|
73
|
+
})
|
|
74
|
+
.catch((err) => {
|
|
75
|
+
console.error(err);
|
|
76
|
+
})
|
|
77
|
+
.finally(() => {
|
|
78
|
+
setIsEyeDropperActiveState(false);
|
|
79
|
+
});
|
|
80
|
+
}, isClean: true, ariaLabel: "Pick color", children: (0, jsx_runtime_1.jsx)(outline_1.EyeDropperIcon, {}) })), (0, jsx_runtime_1.jsx)(react_color_1.Hue, { className: "ndl-color-picker-hue", hue: hsva.h, onChange: (newHue) => {
|
|
81
|
+
handleChange(Object.assign(Object.assign({}, hsva), { h: newHue.h }));
|
|
82
|
+
}, radius: base_1.tokens.borderRadius['lg'], pointer: (props) => ((0, jsx_runtime_1.jsx)(Pointer, Object.assign({}, props, { hsva: {
|
|
83
|
+
a: 1,
|
|
84
|
+
h: hsva.h,
|
|
85
|
+
s: 100,
|
|
86
|
+
v: 100,
|
|
87
|
+
} }))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-inputs", children: [(0, jsx_runtime_1.jsx)(select_1.Select, { size: "small", type: "select", selectProps: {
|
|
88
|
+
'aria-label': 'Color format',
|
|
89
|
+
isSearchable: false,
|
|
90
|
+
onChange: (newFormat) => {
|
|
91
|
+
if (!newFormat)
|
|
92
|
+
return;
|
|
93
|
+
setFormat({
|
|
94
|
+
label: newFormat.label,
|
|
95
|
+
value: newFormat.value,
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
options: [
|
|
99
|
+
{
|
|
100
|
+
label: 'Hex',
|
|
101
|
+
value: 'hex',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: 'RGB',
|
|
105
|
+
value: 'rgb',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
value: { label: format.label, value: format.value },
|
|
109
|
+
} }), format.value === 'hex' && ((0, jsx_runtime_1.jsx)(HexInput, { hsva: hsva, onChange: (newColor) => {
|
|
110
|
+
handleChange((0, react_color_1.hexToHsva)(newColor));
|
|
111
|
+
} })), format.value === 'rgb' && ((0, jsx_runtime_1.jsx)(RgbInput, { hsva: hsva, onChange: (newColor) => {
|
|
112
|
+
handleChange((0, react_color_1.hexToHsva)(newColor));
|
|
113
|
+
} }))] })] }));
|
|
114
|
+
});
|
|
115
|
+
const HexInput = ({ hsva, onChange, }) => {
|
|
116
|
+
const [inputValue, setInputValue] = (0, react_1.useState)(() => (0, react_color_1.hsvaToHex)(hsva).split('#')[1]);
|
|
117
|
+
// Update input value when hsva changes from outside
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
setInputValue((0, react_color_1.hsvaToHex)(hsva).split('#')[1]);
|
|
120
|
+
}, [hsva]);
|
|
121
|
+
const handleChange = (e) => {
|
|
122
|
+
// Remove # if user pastes a hex code with it
|
|
123
|
+
const value = e.target.value.split('#')[1];
|
|
124
|
+
// Always update the input value for immediate feedback
|
|
125
|
+
setInputValue(value);
|
|
126
|
+
// Check if the input is a valid hex color (only 6 characters)
|
|
127
|
+
const isValidHex = /^[0-9A-Fa-f]{6}$/.test(value);
|
|
128
|
+
if (isValidHex) {
|
|
129
|
+
onChange(`#${value}`);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const hexValue = (0, react_color_1.hsvaToHex)(hsva);
|
|
133
|
+
return ((0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", value: inputValue, leftElement: (0, jsx_runtime_1.jsx)("div", { className: "ndl-color-picker-hex-input-prefix", children: "#" }), onChange: handleChange, isFluid: true, style: { width: '100%' }, htmlAttributes: {
|
|
134
|
+
'aria-label': 'Hex color code',
|
|
135
|
+
maxLength: 6,
|
|
136
|
+
onCopy: (e) => {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
navigator.clipboard.writeText(hexValue);
|
|
139
|
+
},
|
|
140
|
+
} }));
|
|
141
|
+
};
|
|
142
|
+
const RgbInput = ({ hsva, onChange, }) => {
|
|
143
|
+
const rgba = (0, react_color_1.hsvaToRgba)(hsva);
|
|
144
|
+
const [rgbValues, setRgbValues] = (0, react_1.useState)({
|
|
145
|
+
b: rgba.b,
|
|
146
|
+
g: rgba.g,
|
|
147
|
+
r: rgba.r,
|
|
148
|
+
});
|
|
149
|
+
// Update input values when hsva changes from outside
|
|
150
|
+
(0, react_1.useEffect)(() => {
|
|
151
|
+
const newRgba = (0, react_color_1.hsvaToRgba)(hsva);
|
|
152
|
+
setRgbValues({
|
|
153
|
+
b: newRgba.b,
|
|
154
|
+
g: newRgba.g,
|
|
155
|
+
r: newRgba.r,
|
|
156
|
+
});
|
|
157
|
+
}, [hsva]);
|
|
158
|
+
const handleChange = (channel, e) => {
|
|
159
|
+
const value = parseInt(e.target.value, 10);
|
|
160
|
+
// Validate the input is a number between 0-255
|
|
161
|
+
const validValue = isNaN(value) ? 0 : Math.max(0, Math.min(255, value));
|
|
162
|
+
const newRgbValues = Object.assign(Object.assign({}, rgbValues), { [channel]: validValue });
|
|
163
|
+
setRgbValues(newRgbValues);
|
|
164
|
+
// Convert RGB to hex and call onChange
|
|
165
|
+
const hexColor = `#${newRgbValues.r.toString(16).padStart(2, '0')}${newRgbValues.g.toString(16).padStart(2, '0')}${newRgbValues.b.toString(16).padStart(2, '0')}`;
|
|
166
|
+
onChange(hexColor);
|
|
167
|
+
};
|
|
168
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "ndl-color-picker-rgb-inputs", children: [(0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.r.toString(), onChange: (e) => handleChange('r', e), htmlAttributes: {
|
|
169
|
+
'aria-label': 'Red',
|
|
170
|
+
max: '255',
|
|
171
|
+
min: '0',
|
|
172
|
+
type: 'number',
|
|
173
|
+
} }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.g.toString(), onChange: (e) => handleChange('g', e), htmlAttributes: {
|
|
174
|
+
'aria-label': 'Green',
|
|
175
|
+
max: '255',
|
|
176
|
+
min: '0',
|
|
177
|
+
type: 'number',
|
|
178
|
+
} }), (0, jsx_runtime_1.jsx)(text_input_1.TextInput, { size: "small", className: "ndl-color-picker-rgb-input", value: rgbValues.b.toString(), onChange: (e) => handleChange('b', e), htmlAttributes: {
|
|
179
|
+
'aria-label': 'Blue',
|
|
180
|
+
max: '255',
|
|
181
|
+
min: '0',
|
|
182
|
+
type: 'number',
|
|
183
|
+
} })] }));
|
|
184
|
+
};
|
|
185
|
+
const Swatch = ({ colors, onChange, hsva, }) => {
|
|
186
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "ndl-color-picker-swatch", children: colors.map((color) => {
|
|
187
|
+
const hexColor = typeof color === 'string'
|
|
188
|
+
? color
|
|
189
|
+
: typeof color === 'object' && 'r' in color
|
|
190
|
+
? (0, react_color_1.rgbaToHex)(color)
|
|
191
|
+
: (0, react_color_1.hsvaToHex)(color);
|
|
192
|
+
const hsvaColor = typeof color === 'string'
|
|
193
|
+
? (0, react_color_1.hexToHsva)(color)
|
|
194
|
+
: 'r' in color
|
|
195
|
+
? (0, react_color_1.rgbaToHsva)(color)
|
|
196
|
+
: color;
|
|
197
|
+
const isActive = hsva.h === hsvaColor.h &&
|
|
198
|
+
hsva.s === hsvaColor.s &&
|
|
199
|
+
hsva.v === hsvaColor.v;
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)("button", { "aria-label": hexColor, className: (0, classnames_1.default)('ndl-color-picker-swatch-color', {
|
|
201
|
+
'ndl-color-picker-swatch-color-active': isActive,
|
|
202
|
+
}), style: { backgroundColor: (0, react_color_1.hsvaToHex)(hsvaColor) }, onClick: () => onChange(hsvaColor) }, hexColor));
|
|
203
|
+
}) }));
|
|
204
|
+
};
|
|
205
|
+
const Pointer = ({ prefixCls, left, top, hsva, }) => {
|
|
206
|
+
const rgba = (0, react_color_1.hsvaToRgba)(hsva);
|
|
207
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
208
|
+
backgroundColor: `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`,
|
|
209
|
+
left,
|
|
210
|
+
top,
|
|
211
|
+
}, className: (0, classnames_1.default)(prefixCls, 'ndl-color-picker-pointer') }));
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/color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AAC,CAAC;IAC9B,OAAO,CACL,gCACE,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,IAAA,oBAAU,EAAC,SAAS,EAAE,0BAA0B,CAAC,GAC5D,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("react");
|
|
25
|
+
const ColorPicker_1 = require("../ColorPicker");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
const [color, setColor] = (0, react_1.useState)({
|
|
28
|
+
a: 1,
|
|
29
|
+
b: 0,
|
|
30
|
+
g: 0,
|
|
31
|
+
r: 0,
|
|
32
|
+
});
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "n-w-60", children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb), swatches: [
|
|
34
|
+
{
|
|
35
|
+
a: 1,
|
|
36
|
+
b: 0,
|
|
37
|
+
g: 0,
|
|
38
|
+
r: 0,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
a: 1,
|
|
42
|
+
b: 255,
|
|
43
|
+
g: 0,
|
|
44
|
+
r: 0,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
a: 1,
|
|
48
|
+
b: 0,
|
|
49
|
+
g: 255,
|
|
50
|
+
r: 0,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
a: 1,
|
|
54
|
+
b: 0,
|
|
55
|
+
g: 0,
|
|
56
|
+
r: 255,
|
|
57
|
+
},
|
|
58
|
+
] }) }));
|
|
59
|
+
};
|
|
60
|
+
exports.default = Component;
|
|
61
|
+
//# 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.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAiC;AAEjC,gDAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC;QACjC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,SAAS,EAAC,QAAQ,YACrB,uBAAC,yBAAW,IACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC9C,QAAQ,EAAE;gBACR;oBACE,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;iBACL;gBACD;oBACE,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,GAAG;oBACN,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;iBACL;gBACD;oBACE,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,GAAG;oBACN,CAAC,EAAE,CAAC;iBACL;gBACD;oBACE,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,CAAC;oBACJ,CAAC,EAAE,GAAG;iBACP;aACF,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("react");
|
|
25
|
+
const ColorPicker_1 = require("../ColorPicker");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
const [color, setColor] = (0, react_1.useState)({
|
|
28
|
+
a: 1,
|
|
29
|
+
b: 0,
|
|
30
|
+
g: 0,
|
|
31
|
+
r: 0,
|
|
32
|
+
});
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "n-w-60", children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb) }) }));
|
|
34
|
+
};
|
|
35
|
+
exports.default = Component;
|
|
36
|
+
//# 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,iCAAiC;AAEjC,gDAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC;QACjC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,SAAS,EAAC,QAAQ,YACrB,uBAAC,yBAAW,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,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("react");
|
|
25
|
+
const ColorPicker_1 = require("../ColorPicker");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
const [color, setColor] = (0, react_1.useState)({
|
|
28
|
+
a: 1,
|
|
29
|
+
b: 0,
|
|
30
|
+
g: 0,
|
|
31
|
+
r: 0,
|
|
32
|
+
});
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "n-w-60", children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: color, onChange: (newColor) => setColor(newColor.rgb), shouldShowEyeDropper: false }) }));
|
|
34
|
+
};
|
|
35
|
+
exports.default = Component;
|
|
36
|
+
//# 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,iCAAiC;AAEjC,gDAA6C;AAE7C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC;QACjC,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,SAAS,EAAC,QAAQ,YACrB,uBAAC,yBAAW,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,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
"use strict";
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.CustomSwatches = exports.WithoutEyeDropper = exports.Full = void 0;
|
|
25
|
+
const ColorPicker_1 = require("../ColorPicker");
|
|
26
|
+
const _1 = require(".");
|
|
27
|
+
const componentMeta = {
|
|
28
|
+
component: ColorPicker_1.ColorPicker,
|
|
29
|
+
parameters: {
|
|
30
|
+
controls: { disable: true },
|
|
31
|
+
},
|
|
32
|
+
tags: ['docsPage'],
|
|
33
|
+
title: 'Components/ColorPicker',
|
|
34
|
+
};
|
|
35
|
+
exports.default = componentMeta;
|
|
36
|
+
exports.Full = {
|
|
37
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
38
|
+
args: {},
|
|
39
|
+
parameters: {
|
|
40
|
+
docs: {
|
|
41
|
+
source: {
|
|
42
|
+
code: _1.ColorPickerFullSource,
|
|
43
|
+
language: 'tsx',
|
|
44
|
+
type: 'code',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
render: _1.ColorPickerFull,
|
|
49
|
+
};
|
|
50
|
+
exports.WithoutEyeDropper = {
|
|
51
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
52
|
+
args: {},
|
|
53
|
+
parameters: {
|
|
54
|
+
docs: {
|
|
55
|
+
source: {
|
|
56
|
+
code: _1.ColorPickerWithoutEyeDropperSource,
|
|
57
|
+
language: 'tsx',
|
|
58
|
+
type: 'code',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
render: _1.ColorPickerWithoutEyeDropper,
|
|
63
|
+
};
|
|
64
|
+
exports.CustomSwatches = {
|
|
65
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
66
|
+
args: {},
|
|
67
|
+
parameters: {
|
|
68
|
+
docs: {
|
|
69
|
+
source: {
|
|
70
|
+
code: _1.ColorPickerCustomSwatchesSource,
|
|
71
|
+
language: 'tsx',
|
|
72
|
+
type: 'code',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
render: _1.ColorPickerCustomSwatches,
|
|
77
|
+
};
|
|
78
|
+
//# 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,gDAA6C;AAC7C,wBAOW;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,yBAAW;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,kBAAe,aAAa,CAAC;AAGhB,QAAA,IAAI,GAAU;IACzB,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,wBAAqB;gBAC3B,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,CAAC;AAEW,QAAA,iBAAiB,GAAU;IACtC,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qCAAkC;gBACxC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,+BAA4B;CACrC,CAAC;AAEW,QAAA,cAAc,GAAU;IACnC,mGAAmG;IACnG,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kCAA+B;gBACrC,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,4BAAyB;CAClC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.ColorPickerCustomSwatchesSource = exports.ColorPickerWithoutEyeDropperSource = exports.ColorPickerFullSource = exports.ColorPickerCustomSwatches = exports.ColorPickerWithoutEyeDropper = exports.ColorPickerFull = void 0;
|
|
27
|
+
var color_picker_full_story_1 = require("./color-picker-full.story");
|
|
28
|
+
Object.defineProperty(exports, "ColorPickerFull", { enumerable: true, get: function () { return __importDefault(color_picker_full_story_1).default; } });
|
|
29
|
+
var color_picker_without_eye_dropper_story_1 = require("./color-picker-without-eye-dropper.story");
|
|
30
|
+
Object.defineProperty(exports, "ColorPickerWithoutEyeDropper", { enumerable: true, get: function () { return __importDefault(color_picker_without_eye_dropper_story_1).default; } });
|
|
31
|
+
var color_picker_custom_swatches_story_1 = require("./color-picker-custom-swatches.story");
|
|
32
|
+
Object.defineProperty(exports, "ColorPickerCustomSwatches", { enumerable: true, get: function () { return __importDefault(color_picker_custom_swatches_story_1).default; } });
|
|
33
|
+
const export_stories_utils_1 = require("@neo4j-ndl/react/_common/export-stories-utils");
|
|
34
|
+
const color_picker_custom_swatches_story_tsx_raw_1 = __importDefault(require("./color-picker-custom-swatches.story.tsx?raw"));
|
|
35
|
+
const color_picker_full_story_tsx_raw_1 = __importDefault(require("./color-picker-full.story.tsx?raw"));
|
|
36
|
+
const color_picker_without_eye_dropper_story_tsx_raw_1 = __importDefault(require("./color-picker-without-eye-dropper.story.tsx?raw"));
|
|
37
|
+
exports.ColorPickerFullSource = (0, export_stories_utils_1.removeLicenseHeader)(color_picker_full_story_tsx_raw_1.default);
|
|
38
|
+
exports.ColorPickerWithoutEyeDropperSource = (0, export_stories_utils_1.removeLicenseHeader)(color_picker_without_eye_dropper_story_tsx_raw_1.default);
|
|
39
|
+
exports.ColorPickerCustomSwatchesSource = (0, export_stories_utils_1.removeLicenseHeader)(color_picker_custom_swatches_story_tsx_raw_1.default);
|
|
40
|
+
//# 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,qEAAuE;AAA9D,2IAAA,OAAO,OAAmB;AACnC,mGAAmG;AAA1F,uKAAA,OAAO,OAAgC;AAChD,2FAA4F;AAAnF,gKAAA,OAAO,OAA6B;AAE7C,wFAAoF;AAEpF,8HAA8F;AAC9F,wGAAyE;AACzE,sIAAqG;AAExF,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,yCAAwB,CACzB,CAAC;AACW,QAAA,kCAAkC,GAAG,IAAA,0CAAmB,EACnE,wDAAqC,CACtC,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,oDAAkC,CACnC,CAAC"}
|