@neo4j-ndl/react 0.3.1 → 0.5.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 (126) hide show
  1. package/lib/cjs/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
  2. package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
  3. package/lib/cjs/_common/input/types.js +3 -0
  4. package/lib/cjs/_common/input/types.js.map +1 -0
  5. package/lib/cjs/_common/utils.js +59 -0
  6. package/lib/cjs/_common/utils.js.map +1 -0
  7. package/lib/cjs/button/Button.js +4 -8
  8. package/lib/cjs/button/Button.js.map +1 -1
  9. package/lib/cjs/button/IconButton.js +85 -0
  10. package/lib/cjs/button/IconButton.js.map +1 -0
  11. package/lib/cjs/button/IconButtonArray.js +52 -0
  12. package/lib/cjs/button/IconButtonArray.js.map +1 -0
  13. package/lib/cjs/button/index.js +2 -0
  14. package/lib/cjs/button/index.js.map +1 -1
  15. package/lib/cjs/checkbox/Checkbox.js +2 -2
  16. package/lib/cjs/checkbox/Checkbox.js.map +1 -1
  17. package/lib/cjs/context-menu/ContextMenu.js +7 -13
  18. package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
  19. package/lib/cjs/dialog/Dialog.js +161 -0
  20. package/lib/cjs/dialog/Dialog.js.map +1 -0
  21. package/lib/cjs/dialog/index.js +38 -0
  22. package/lib/cjs/dialog/index.js.map +1 -0
  23. package/lib/cjs/index.js +3 -0
  24. package/lib/cjs/index.js.map +1 -1
  25. package/lib/cjs/modal/Modal.js +105 -0
  26. package/lib/cjs/modal/Modal.js.map +1 -0
  27. package/lib/cjs/modal/index.js +38 -0
  28. package/lib/cjs/modal/index.js.map +1 -0
  29. package/lib/cjs/popover/Popover.js +30 -52
  30. package/lib/cjs/popover/Popover.js.map +1 -1
  31. package/lib/cjs/portal/Portal.js +52 -0
  32. package/lib/cjs/portal/Portal.js.map +1 -0
  33. package/lib/cjs/portal/index.js +38 -0
  34. package/lib/cjs/portal/index.js.map +1 -0
  35. package/lib/cjs/radio/Radio.js +2 -2
  36. package/lib/cjs/radio/Radio.js.map +1 -1
  37. package/lib/cjs/switch/Switch.js +2 -2
  38. package/lib/cjs/switch/Switch.js.map +1 -1
  39. package/lib/cjs/table/Table.js +5 -5
  40. package/lib/cjs/table/Table.js.map +1 -1
  41. package/lib/cjs/text-input/TextInput.js +72 -0
  42. package/lib/cjs/text-input/TextInput.js.map +1 -0
  43. package/lib/cjs/{input → text-input}/index.js +3 -3
  44. package/lib/cjs/text-input/index.js.map +1 -0
  45. package/lib/cjs/trap-focus/TrapFocus.js +310 -0
  46. package/lib/cjs/trap-focus/TrapFocus.js.map +1 -0
  47. package/lib/cjs/trap-focus/index.js +38 -0
  48. package/lib/cjs/trap-focus/index.js.map +1 -0
  49. package/lib/esm/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
  50. package/lib/esm/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
  51. package/lib/esm/_common/input/types.js +2 -0
  52. package/lib/esm/_common/input/types.js.map +1 -0
  53. package/lib/esm/_common/utils.js +52 -0
  54. package/lib/esm/_common/utils.js.map +1 -0
  55. package/lib/esm/button/Button.js +2 -4
  56. package/lib/esm/button/Button.js.map +1 -1
  57. package/lib/esm/button/IconButton.js +79 -0
  58. package/lib/esm/button/IconButton.js.map +1 -0
  59. package/lib/esm/button/IconButtonArray.js +46 -0
  60. package/lib/esm/button/IconButtonArray.js.map +1 -0
  61. package/lib/esm/button/index.js +2 -0
  62. package/lib/esm/button/index.js.map +1 -1
  63. package/lib/esm/checkbox/Checkbox.js +2 -2
  64. package/lib/esm/checkbox/Checkbox.js.map +1 -1
  65. package/lib/esm/context-menu/ContextMenu.js +7 -13
  66. package/lib/esm/context-menu/ContextMenu.js.map +1 -1
  67. package/lib/esm/dialog/Dialog.js +131 -0
  68. package/lib/esm/dialog/Dialog.js.map +1 -0
  69. package/lib/esm/{input → dialog}/index.js +1 -1
  70. package/lib/esm/dialog/index.js.map +1 -0
  71. package/lib/esm/index.js +3 -0
  72. package/lib/esm/index.js.map +1 -1
  73. package/lib/esm/modal/Modal.js +75 -0
  74. package/lib/esm/modal/Modal.js.map +1 -0
  75. package/lib/esm/modal/index.js +22 -0
  76. package/lib/esm/modal/index.js.map +1 -0
  77. package/lib/esm/popover/Popover.js +30 -29
  78. package/lib/esm/popover/Popover.js.map +1 -1
  79. package/lib/esm/portal/Portal.js +25 -0
  80. package/lib/esm/portal/Portal.js.map +1 -0
  81. package/lib/esm/portal/index.js +22 -0
  82. package/lib/esm/portal/index.js.map +1 -0
  83. package/lib/esm/radio/Radio.js +2 -2
  84. package/lib/esm/radio/Radio.js.map +1 -1
  85. package/lib/esm/switch/Switch.js +2 -2
  86. package/lib/esm/switch/Switch.js.map +1 -1
  87. package/lib/esm/table/Table.js +5 -5
  88. package/lib/esm/table/Table.js.map +1 -1
  89. package/lib/esm/text-input/TextInput.js +67 -0
  90. package/lib/esm/text-input/TextInput.js.map +1 -0
  91. package/lib/esm/text-input/index.js +22 -0
  92. package/lib/esm/text-input/index.js.map +1 -0
  93. package/lib/esm/trap-focus/TrapFocus.js +283 -0
  94. package/lib/esm/trap-focus/TrapFocus.js.map +1 -0
  95. package/lib/esm/trap-focus/index.js +22 -0
  96. package/lib/esm/trap-focus/index.js.map +1 -0
  97. package/lib/types/_common/input/RadioAndCheckboxWrapper.d.ts +37 -0
  98. package/lib/types/_common/input/types.d.ts +31 -0
  99. package/lib/types/_common/utils.d.ts +29 -0
  100. package/lib/types/button/Button.d.ts +1 -4
  101. package/lib/types/button/IconButton.d.ts +47 -0
  102. package/lib/types/button/IconButtonArray.d.ts +37 -0
  103. package/lib/types/button/index.d.ts +2 -0
  104. package/lib/types/checkbox/Checkbox.d.ts +2 -2
  105. package/lib/types/context-menu/ContextMenu.d.ts +4 -1
  106. package/lib/types/dialog/Dialog.d.ts +55 -0
  107. package/lib/types/{input → dialog}/index.d.ts +1 -1
  108. package/lib/types/index.d.ts +3 -0
  109. package/lib/types/modal/Modal.d.ts +34 -0
  110. package/lib/types/modal/index.d.ts +21 -0
  111. package/lib/types/popover/Popover.d.ts +5 -3
  112. package/lib/types/portal/Portal.d.ts +27 -0
  113. package/lib/types/portal/index.d.ts +21 -0
  114. package/lib/types/radio/Radio.d.ts +2 -2
  115. package/lib/types/switch/Switch.d.ts +2 -2
  116. package/lib/types/table/Table.d.ts +1 -8
  117. package/lib/types/text-input/TextInput.d.ts +55 -0
  118. package/lib/types/text-input/index.d.ts +21 -0
  119. package/lib/types/trap-focus/TrapFocus.d.ts +35 -0
  120. package/lib/types/trap-focus/index.d.ts +21 -0
  121. package/package.json +2 -2
  122. package/lib/cjs/input/Input.js.map +0 -1
  123. package/lib/cjs/input/index.js.map +0 -1
  124. package/lib/esm/input/Input.js.map +0 -1
  125. package/lib/esm/input/index.js.map +0 -1
  126. package/lib/types/input/Input.d.ts +0 -44
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Input = void 0;
27
- var Input_1 = require("./Input");
28
- Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return __importDefault(Input_1).default; } });
26
+ exports.TextInput = void 0;
27
+ var TextInput_1 = require("./TextInput");
28
+ Object.defineProperty(exports, "TextInput", { enumerable: true, get: function () { return __importDefault(TextInput_1).default; } });
29
29
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-input/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,yCAAmD;AAA1C,uHAAA,OAAO,OAAa"}
@@ -0,0 +1,310 @@
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TrapFocus = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ /**
29
+ *
30
+ * Copyright (c) "Neo4j"
31
+ * Neo4j Sweden AB [http://neo4j.com]
32
+ *
33
+ * This file is part of Neo4j.
34
+ *
35
+ * Neo4j is free software: you can redistribute it and/or modify
36
+ * it under the terms of the GNU General Public License as published by
37
+ * the Free Software Foundation, either version 3 of the License, or
38
+ * (at your option) any later version.
39
+ *
40
+ * This program is distributed in the hope that it will be useful,
41
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43
+ * GNU General Public License for more details.
44
+ *
45
+ * You should have received a copy of the GNU General Public License
46
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
47
+ */
48
+ /* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */
49
+ const React = __importStar(require("react"));
50
+ /**
51
+ * A modified version of the Material UI (@mui/material) TrapFocus component.
52
+ * We use a modified/slimmed version for easier maintenance.
53
+ *
54
+ * See the LICENSES.txt file for license for @mui/material
55
+ */
56
+ function setRef(ref, value) {
57
+ if (typeof ref === 'function') {
58
+ ref(value);
59
+ }
60
+ else if (ref) {
61
+ ref.current = value;
62
+ }
63
+ }
64
+ function useForkRef(refA, refB) {
65
+ /**
66
+ * This will create a new function if the ref props change and are defined.
67
+ * This means react will call the old forkRef with `null` and the new forkRef
68
+ * with the ref. Cleanup naturally emerges from this behavior.
69
+ */
70
+ return React.useMemo(() => {
71
+ if (refA == null && refB == null) {
72
+ return null;
73
+ }
74
+ return (refValue) => {
75
+ setRef(refA, refValue);
76
+ setRef(refB, refValue);
77
+ };
78
+ }, [refA, refB]);
79
+ }
80
+ function ownerDocument(node) {
81
+ return (node && node.ownerDocument) || document;
82
+ }
83
+ // Inspired by https://github.com/focus-trap/tabbable
84
+ const candidatesSelector = [
85
+ 'input',
86
+ 'select',
87
+ 'textarea',
88
+ 'a[href]',
89
+ 'button',
90
+ '[tabindex]',
91
+ 'audio[controls]',
92
+ 'video[controls]',
93
+ '[contenteditable]:not([contenteditable="false"])',
94
+ ].join(',');
95
+ function getTabIndex(node) {
96
+ const tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
97
+ if (!Number.isNaN(tabindexAttr)) {
98
+ return tabindexAttr;
99
+ }
100
+ // Browsers do not return `tabIndex` correctly for contentEditable nodes;
101
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2
102
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
103
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
104
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
105
+ // yet they are still part of the regular tab order; in FF, they get a default
106
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
107
+ // order, consider their tab index to be 0.
108
+ if (node.contentEditable === 'true' ||
109
+ ((node.nodeName === 'AUDIO' ||
110
+ node.nodeName === 'VIDEO' ||
111
+ node.nodeName === 'DETAILS') &&
112
+ node.getAttribute('tabindex') === null)) {
113
+ return 0;
114
+ }
115
+ return node.tabIndex;
116
+ }
117
+ function isNonTabbableRadio(node) {
118
+ if (node.tagName !== 'INPUT' || node.type !== 'radio') {
119
+ return false;
120
+ }
121
+ if (!node.name) {
122
+ return false;
123
+ }
124
+ const getRadio = (selector) => node.ownerDocument.querySelector(`input[type="radio"]${selector}`);
125
+ let roving = getRadio(`[name="${node.name}"]:checked`);
126
+ if (!roving) {
127
+ roving = getRadio(`[name="${node.name}"]`);
128
+ }
129
+ return roving !== node;
130
+ }
131
+ function isNodeMatchingSelectorFocusable(node) {
132
+ if (node.disabled ||
133
+ (node.tagName === 'INPUT' && node.type === 'hidden') ||
134
+ isNonTabbableRadio(node)) {
135
+ return false;
136
+ }
137
+ return true;
138
+ }
139
+ function defaultGetTabbable(root) {
140
+ const regularTabNodes = [];
141
+ const orderedTabNodes = [];
142
+ Array.from(root.querySelectorAll(candidatesSelector)).forEach((node, i) => {
143
+ const nodeTabIndex = getTabIndex(node);
144
+ if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {
145
+ return;
146
+ }
147
+ if (nodeTabIndex === 0) {
148
+ regularTabNodes.push(node);
149
+ }
150
+ else {
151
+ orderedTabNodes.push({
152
+ documentOrder: i,
153
+ tabIndex: nodeTabIndex,
154
+ node,
155
+ });
156
+ }
157
+ });
158
+ return orderedTabNodes
159
+ .sort((a, b) => a.tabIndex === b.tabIndex
160
+ ? a.documentOrder - b.documentOrder
161
+ : a.tabIndex - b.tabIndex)
162
+ .map((a) => a.node)
163
+ .concat(regularTabNodes);
164
+ }
165
+ /**
166
+ * Utility component that locks focus inside the component.
167
+ */
168
+ function TrapFocus(props) {
169
+ const { children, disableRestoreFocus = false, getTabbable = defaultGetTabbable, open, } = props;
170
+ const ignoreNextEnforceFocus = React.useRef();
171
+ const sentinelStart = React.useRef(null);
172
+ const sentinelEnd = React.useRef(null);
173
+ const nodeToRestore = React.useRef(null);
174
+ const reactFocusEventTarget = React.useRef(null);
175
+ const rootRef = React.useRef(null);
176
+ const handleRef = useForkRef(children.ref, rootRef);
177
+ const lastKeydown = React.useRef(null);
178
+ React.useEffect(() => {
179
+ // We might render an empty child.
180
+ if (!open || !rootRef.current) {
181
+ return;
182
+ }
183
+ const doc = ownerDocument(rootRef.current);
184
+ if (!rootRef.current.contains(doc.activeElement)) {
185
+ if (!rootRef.current.hasAttribute('tabIndex')) {
186
+ rootRef.current.setAttribute('tabIndex', '-1');
187
+ }
188
+ rootRef.current.focus();
189
+ }
190
+ return () => {
191
+ // restoreLastFocus()
192
+ if (!disableRestoreFocus) {
193
+ // In IE11 it is possible for document.activeElement to be null resulting
194
+ // in nodeToRestore.current being null.
195
+ // Not all elements in IE11 have a focus method.
196
+ // Once IE11 support is dropped the focus() call can be unconditional.
197
+ if (nodeToRestore.current && nodeToRestore.current.focus) {
198
+ ignoreNextEnforceFocus.current = true;
199
+ nodeToRestore.current.focus();
200
+ }
201
+ nodeToRestore.current = null;
202
+ }
203
+ };
204
+ // Missing `disableRestoreFocus` which is fine.
205
+ // We don't support changing that prop on an open TrapFocus
206
+ // eslint-disable-next-line react-hooks/exhaustive-deps
207
+ }, [open]);
208
+ React.useEffect(() => {
209
+ // We might render an empty child.
210
+ if (!open || !rootRef.current) {
211
+ return;
212
+ }
213
+ const doc = ownerDocument(rootRef.current);
214
+ const contain = (nativeEvent) => {
215
+ var _a, _b;
216
+ const { current: rootElement } = rootRef;
217
+ // Cleanup functions are executed lazily in React 17.
218
+ // Contain can be called between the component being unmounted and its cleanup function being run.
219
+ if (rootElement === null) {
220
+ return;
221
+ }
222
+ if (!doc.hasFocus() || ignoreNextEnforceFocus.current) {
223
+ ignoreNextEnforceFocus.current = false;
224
+ return;
225
+ }
226
+ if (!rootElement.contains(doc.activeElement)) {
227
+ // if the focus event is not coming from inside the children's react tree, reset the refs
228
+ if ((nativeEvent &&
229
+ reactFocusEventTarget.current !== nativeEvent.target) ||
230
+ doc.activeElement !== reactFocusEventTarget.current) {
231
+ reactFocusEventTarget.current = null;
232
+ }
233
+ else if (reactFocusEventTarget.current !== null) {
234
+ return;
235
+ }
236
+ let tabbable = [];
237
+ if (doc.activeElement === sentinelStart.current ||
238
+ doc.activeElement === sentinelEnd.current) {
239
+ tabbable = getTabbable(rootRef.current);
240
+ }
241
+ if (tabbable.length > 0) {
242
+ const isShiftTab = Boolean(((_a = lastKeydown.current) === null || _a === void 0 ? void 0 : _a.shiftKey) && ((_b = lastKeydown.current) === null || _b === void 0 ? void 0 : _b.key) === 'Tab');
243
+ const focusNext = tabbable[0];
244
+ const focusPrevious = tabbable[tabbable.length - 1];
245
+ if (isShiftTab) {
246
+ focusPrevious.focus();
247
+ }
248
+ else {
249
+ focusNext.focus();
250
+ }
251
+ }
252
+ else {
253
+ rootElement.focus();
254
+ }
255
+ }
256
+ };
257
+ const loopFocus = (nativeEvent) => {
258
+ var _a;
259
+ lastKeydown.current = nativeEvent;
260
+ if (nativeEvent.key !== 'Tab') {
261
+ return;
262
+ }
263
+ // Make sure the next tab starts from the right place.
264
+ // doc.activeElement referes to the origin.
265
+ if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
266
+ // We need to ignore the next contain as
267
+ // it will try to move the focus back to the rootRef element.
268
+ ignoreNextEnforceFocus.current = true;
269
+ (_a = sentinelEnd.current) === null || _a === void 0 ? void 0 : _a.focus();
270
+ }
271
+ };
272
+ doc.addEventListener('focusin', contain);
273
+ doc.addEventListener('keydown', loopFocus, true);
274
+ // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.
275
+ // e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=559561.
276
+ // Instead, we can look if the active element was restored on the BODY element.
277
+ //
278
+ // The whatwg spec defines how the browser should behave but does not explicitly mention any events:
279
+ // https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
280
+ const interval = setInterval(() => {
281
+ var _a;
282
+ if (((_a = doc.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'BODY') {
283
+ contain();
284
+ }
285
+ }, 50);
286
+ return () => {
287
+ clearInterval(interval);
288
+ doc.removeEventListener('focusin', contain);
289
+ doc.removeEventListener('keydown', loopFocus, true);
290
+ };
291
+ }, [disableRestoreFocus, open, getTabbable]);
292
+ const onFocus = (event) => {
293
+ if (nodeToRestore.current === null) {
294
+ nodeToRestore.current = event.relatedTarget;
295
+ }
296
+ reactFocusEventTarget.current = event.target;
297
+ const childrenPropsHandler = children.props.onFocus;
298
+ if (childrenPropsHandler) {
299
+ childrenPropsHandler(event);
300
+ }
301
+ };
302
+ const handleFocusSentinel = (event) => {
303
+ if (nodeToRestore.current === null) {
304
+ nodeToRestore.current = event.relatedTarget;
305
+ }
306
+ };
307
+ return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { tabIndex: 0, onFocus: handleFocusSentinel, ref: sentinelStart, "data-test": "sentinelStart" }), React.cloneElement(children, { ref: handleRef, onFocus }), (0, jsx_runtime_1.jsx)("div", { tabIndex: 0, onFocus: handleFocusSentinel, ref: sentinelEnd, "data-test": "sentinelEnd" })] }));
308
+ }
309
+ exports.TrapFocus = TrapFocus;
310
+ //# sourceMappingURL=TrapFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrapFocus.js","sourceRoot":"","sources":["../../../src/trap-focus/TrapFocus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,2EAA2E;AAC3E,6CAA+B;AAE/B;;;;;GAKG;AAEH,SAAS,MAAM,CACb,GAIa,EACb,KAAe;IAEf,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;QAC7B,GAAG,CAAC,KAAK,CAAC,CAAC;KACZ;SAAM,IAAI,GAAG,EAAE;QACd,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACrB;AACH,CAAC;AAED,SAAS,UAAU,CACjB,IAA6C,EAC7C,IAA6C;IAE7C;;;;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neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
+ desc = { enumerable: true, get: function() { return m[k]; } };
27
+ }
28
+ Object.defineProperty(o, k2, desc);
29
+ }) : (function(o, m, k, k2) {
30
+ if (k2 === undefined) k2 = k;
31
+ o[k2] = m[k];
32
+ }));
33
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ __exportStar(require("./TrapFocus"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/trap-focus/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,8CAA4B"}
@@ -40,16 +40,16 @@ import classnames from 'classnames';
40
40
  *
41
41
  *
42
42
  */
43
- const Input = (props, ref) => {
44
- const { label, fluid, labelBefore } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore"]);
45
- const containerWrappingClass = classnames('ndl-form-item', {
43
+ const RadioAndCheckboxWrapper = (props, ref) => {
44
+ const { label, fluid, labelBefore, type = 'text' } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore", "type"]);
45
+ const containerWrappingClass = classnames(`ndl-form-item ndl-type-${type}`, {
46
46
  disabled: otherInputProps.disabled,
47
47
  });
48
48
  const labelWrappingClass = classnames(`form-item-label`, {
49
49
  fluid,
50
50
  'label-before': labelBefore,
51
51
  });
52
- return (_jsx("div", Object.assign({ className: containerWrappingClass }, { children: _jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsx("input", Object.assign({}, otherInputProps, { ref: ref })), label] })) })));
52
+ return (_jsx("div", Object.assign({ className: containerWrappingClass }, { children: _jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsx("input", Object.assign({}, otherInputProps, { ref: ref, type: type })), _jsx("span", Object.assign({ className: "form-label-text" }, { children: label }))] })) })));
53
53
  };
54
- export default forwardRef(Input);
55
- //# sourceMappingURL=Input.js.map
54
+ export default forwardRef(RadioAndCheckboxWrapper);
55
+ //# sourceMappingURL=RadioAndCheckboxWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioAndCheckboxWrapper.js","sourceRoot":"","sources":["../../../../src/_common/input/RadioAndCheckboxWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,UAAU,MAAM,YAAY,CAAC;AAmBpC,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,uBAAuB,GAAG,CAC9B,KAA4B,EAC5B,GAAmC,EACnC,EAAE;IACF,MAAM,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,GAAG,MAAM,KAEX,KAAK,EADJ,eAAe,UAChB,KAAK,EANH,yCAML,CAAQ,CAAC;IAEV,MAAM,sBAAsB,GAAG,UAAU,CAAC,0BAA0B,IAAI,EAAE,EAAE;QAC1E,QAAQ,EAAE,eAAe,CAAC,QAAQ;KACnC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB,EAAE;QACvD,KAAK;QACL,cAAc,EAAE,WAAW;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,4BAAK,SAAS,EAAE,sBAAsB,gBAGpC,+BAAO,SAAS,EAAE,kBAAkB,iBAClC,gCAAW,eAAe,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,EACpD,6BAAM,SAAS,EAAC,iBAAiB,gBAAE,KAAK,IAAQ,KAC1C,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
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 { useCallback, useRef } from 'react';
22
+ export const removeNewlines = (input) => input.replace(/(\r\n|\n|\r)/gm, '');
23
+ /** Remove extra spaces from sting */
24
+ export const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
25
+ export const needleWarningMessage = (message) => console.warn(`[🪡 Needle]: ${message}`);
26
+ const getScrollbarSize = (doc) => {
27
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
28
+ const documentWidth = doc.documentElement.clientWidth;
29
+ return Math.abs(window.innerWidth - documentWidth);
30
+ };
31
+ const getPaddingRight = (element) => parseInt(window.getComputedStyle(element).paddingRight, 10) || 0;
32
+ /**
33
+ * Toggles scroll on the provided document.
34
+ * Useful for disabling scroll when a popup is open (ie ContextMenu/Modal)
35
+ */
36
+ export const useDocumentScrollToggle = () => {
37
+ const bodyPadding = useRef(0);
38
+ return useCallback((disable, doc = document) => {
39
+ if (disable) {
40
+ const existingPaddingRight = getPaddingRight(doc.body);
41
+ bodyPadding.current = existingPaddingRight;
42
+ const newPaddingRight = existingPaddingRight + getScrollbarSize(doc);
43
+ doc.body.style.overflow = 'hidden';
44
+ doc.body.style.paddingRight = `${newPaddingRight}px`;
45
+ }
46
+ else {
47
+ doc.body.style.overflow = '';
48
+ doc.body.style.paddingRight = `${bodyPadding.current}px`;
49
+ }
50
+ }, []);
51
+ };
52
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAE,EAAE,CACtD,OAAO,CAA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x, jsxs as _jsxs } from "react/jsx-runtime";
33
33
  import React from 'react';
34
34
  import classnames from 'classnames';
35
35
  import { LoadingSpinner } from '../loading-spinner';
36
- export const removeNewlines = (input) => input.replace(/(\r\n|\n|\r)/gm, '');
37
- /** Remove extra spaces from sting */
38
- export const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
36
+ import { removeNewlines, removeSpaces } from '../_common/utils';
39
37
  export const Button = React.forwardRef(function Button(_a, ref) {
40
- var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = 'regular', className, onClick, floating = false, tabIndex = 0 } = _a, props = __rest(_a, ["children", "as", "type", "loading", "color", "disabled", "fill", "rectangle", "buttonSize", "className", "onClick", "floating", "tabIndex"]);
38
+ var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = 'medium', className, onClick, floating = false, tabIndex = 0 } = _a, props = __rest(_a, ["children", "as", "type", "loading", "color", "disabled", "fill", "rectangle", "buttonSize", "className", "onClick", "floating", "tabIndex"]);
41
39
  let Component = as || 'button';
42
40
  if (!as && props.href) {
43
41
  Component = 'a';
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,I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AC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,SAAS;IACR,uEAAuE;wBACnE,KAAK,EAEL,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,YAAY,EACvB,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAClD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,iBAEtC,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,cAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC7D,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,KACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import React from 'react';
34
+ import classnames from 'classnames';
35
+ import { LoadingSpinner } from '../loading-spinner';
36
+ import { needleWarningMessage } from '../_common/utils';
37
+ export const IconButton = React.forwardRef(function Button(_a, ref) {
38
+ var { children, as, type = 'button', loading = false, disabled = false, buttonSize = 'medium', className, onClick, grouped, floating = false, danger, clean } = _a, props = __rest(_a, ["children", "as", "type", "loading", "disabled", "buttonSize", "className", "onClick", "grouped", "floating", "danger", "clean"]);
39
+ let Component = as || 'button';
40
+ if (!as && props.href) {
41
+ Component = 'a';
42
+ }
43
+ const interactable = !disabled && !loading;
44
+ const classes = classnames(`ndl-icon-btn ${buttonSize} ${className}`, {
45
+ grouped,
46
+ disabled,
47
+ loading,
48
+ floating,
49
+ danger,
50
+ clean,
51
+ });
52
+ if (clean && floating) {
53
+ needleWarningMessage("Can't have 'clean' and 'floating' props true at the same time");
54
+ }
55
+ if (!props['aria-label']) {
56
+ needleWarningMessage('Icon buttons do not have text, be sure to include an aria-label for screen readers link: https://dequeuniversity.com/rules/axe/4.4/button-name?application=axeAPI');
57
+ }
58
+ const handleClick = (e) => {
59
+ if (!interactable) {
60
+ // By default, a <button /> element with disabled set to true will not get its
61
+ // on click handler called. To support the same behavior on <a /> tags we
62
+ // swallow the event here when disabled, since the <a /> tag with disabled set to
63
+ // true will have its onClick handler called
64
+ e.preventDefault();
65
+ e.stopPropagation();
66
+ return;
67
+ }
68
+ if (onClick) {
69
+ onClick(e);
70
+ }
71
+ else if (!props.href) {
72
+ console.error('onClick was not provided');
73
+ }
74
+ };
75
+ return (_jsx(Component
76
+ /** First props and then className to avoid overriding in classNames */
77
+ , Object.assign({}, props, (Component === 'button' ? { type } : {}), { onClick: handleClick, disabled: !interactable, className: classes, ref: ref }, { children: _jsx("div", Object.assign({ className: "ndl-icon" }, { children: loading ? (_jsx(LoadingSpinner, { className: "n-my-auto n-mr-1", size: "small" })) : (children) })) })));
78
+ });
79
+ //# sourceMappingURL=IconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/button/IconButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAmCxD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CACxD,EAckB,EAClB,GAAG;QAfH,EACE,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,QAAQ,EACrB,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,MAAM,EACN,KAAK,OAEW,EADb,KAAK,cAbV,iIAcC,CADS;IAIV,IAAI,SAAS,GAAG,EAAE,IAAI,QAAQ,CAAC;IAE/B,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE;QACrB,SAAS,GAAG,GAAG,CAAC;KACjB;IAED,MAAM,YAAY,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC;IAE3C,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,UAAU,IAAI,SAAS,EAAE,EAAE;QACpE,OAAO;QACP,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,MAAM;QACN,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,QAAQ,EAAE;QACrB,oBAAoB,CAClB,+DAA+D,CAChE,CAAC;KACH;IAED,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QACxB,oBAAoB,CAClB,mKAAmK,CACpK,CAAC;KACH;IAED,MAAM,WAAW,GAAG,CAAC,CAAkD,EAAE,EAAE;QACzE,IAAI,CAAC,YAAY,EAAE;YACjB,8EAA8E;YAC9E,yEAAyE;YACzE,iFAAiF;YACjF,4CAA4C;YAC5C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,OAAO;SACR;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,SAAS;IACR,uEAAuE;wBACnE,KAAK,EAEL,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,YAAY,EACvB,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,GAAG,gBAER,4BAAK,SAAS,EAAC,UAAU,gBACtB,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,cAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC7D,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,IACG,IACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import React from 'react';
34
+ import classnames from 'classnames';
35
+ export const IconButtonArray = React.forwardRef(function Button(_a, ref) {
36
+ var { children, as, className, floating = false, orientation = 'horizontal' } = _a, props = __rest(_a, ["children", "as", "className", "floating", "orientation"]);
37
+ const Component = as || 'div';
38
+ const classes = classnames(`ndl-icon-btn-array`, {
39
+ 'n-flex-row': orientation === 'horizontal',
40
+ 'n-flex-col': orientation === 'vertical',
41
+ 'array-floating': floating,
42
+ [`${className}`]: className,
43
+ });
44
+ return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
45
+ });
46
+ //# sourceMappingURL=IconButtonArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButtonArray.js","sourceRoot":"","sources":["../../../src/button/IconButtonArray.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAqBpC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7D,EAOuB,EACvB,GAAG;QARH,EACE,QAAQ,EACR,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,YAAY,OAEL,EADlB,KAAK,cANV,0DAOC,CADS;IAIV,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;IAE9B,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,EAAE;QAC/C,YAAY,EAAE,WAAW,KAAK,YAAY;QAC1C,YAAY,EAAE,WAAW,KAAK,UAAU;QACxC,gBAAgB,EAAE,QAAQ;QAC1B,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,gBAC/C,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}