@neo4j-ndl/react 0.1.0 → 0.1.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.
- package/lib/alert/Alert.d.ts +9 -4
- package/lib/alert/Alert.js +13 -6
- package/lib/alert/Alert.js.map +1 -1
- package/lib/button/Button.d.ts +2 -2
- package/lib/button/Button.js +21 -19
- package/lib/button/Button.js.map +1 -1
- package/lib/checkbox/Checkbox.js +3 -0
- package/lib/checkbox/Checkbox.js.map +1 -1
- package/lib/context-menu/ContextMenu.d.ts +3 -3
- package/lib/context-menu/ContextMenu.js +24 -22
- package/lib/context-menu/ContextMenu.js.map +1 -1
- package/lib/helpers/testing.d.ts +28 -0
- package/lib/helpers/testing.js +81 -0
- package/lib/helpers/testing.js.map +1 -0
- package/lib/helpers/types.d.ts +1 -1
- package/lib/icons/Custom.d.ts +2 -2
- package/lib/icons/Custom.js +3 -4
- package/lib/icons/Custom.js.map +1 -1
- package/lib/icons/Hero.d.ts +2 -2
- package/lib/icons/Hero.js +3 -4
- package/lib/icons/Hero.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/input/Input.js +2 -2
- package/lib/input/Input.js.map +1 -1
- package/lib/label/Label.d.ts +1 -1
- package/lib/label/Label.js +28 -6
- package/lib/label/Label.js.map +1 -1
- package/lib/loading-spinner/LoadingSpinner.d.ts +2 -2
- package/lib/loading-spinner/LoadingSpinner.js +27 -8
- package/lib/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/popover/Popover.js +4 -3
- package/lib/popover/Popover.js.map +1 -1
- package/lib/progress-bar/ProgressBar.d.ts +2 -1
- package/lib/progress-bar/ProgressBar.js +29 -5
- package/lib/progress-bar/ProgressBar.js.map +1 -1
- package/lib/radio/Radio.d.ts +2 -2
- package/lib/radio/Radio.js +3 -3
- package/lib/radio/Radio.js.map +1 -1
- package/lib/switch/Switch.js +1 -2
- package/lib/switch/Switch.js.map +1 -1
- package/lib/tabs/Tabs.d.ts +3 -3
- package/lib/tabs/Tabs.js +26 -17
- package/lib/tabs/Tabs.js.map +1 -1
- package/lib/tag/Tag.d.ts +1 -1
- package/lib/tag/Tag.js +29 -9
- package/lib/tag/Tag.js.map +1 -1
- package/lib/tooltip/Tooltip.d.ts +1 -1
- package/lib/tooltip/Tooltip.js +5 -3
- package/lib/tooltip/Tooltip.js.map +1 -1
- package/lib/view-selector/ViewSelector.d.ts +3 -10
- package/lib/view-selector/ViewSelector.js +31 -14
- package/lib/view-selector/ViewSelector.js.map +1 -1
- package/package.json +5 -3
package/lib/radio/Radio.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
import React from 'react';
|
|
22
22
|
import { InputProps } from '../input/Input';
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
@@ -35,5 +35,5 @@ import { InputProps } from '../input/Input';
|
|
|
35
35
|
*
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
declare const Radio:
|
|
38
|
+
declare const Radio: React.ForwardRefExoticComponent<Pick<InputProps, "size" | "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "list" | "children" | "role" | "onChange" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "enterKeyHint" | "fluid" | "labelBefore"> & React.RefAttributes<HTMLInputElement>>;
|
|
39
39
|
export default Radio;
|
package/lib/radio/Radio.js
CHANGED
|
@@ -51,8 +51,8 @@ var input_1 = require("../input");
|
|
|
51
51
|
*
|
|
52
52
|
*
|
|
53
53
|
*/
|
|
54
|
-
var Radio = function (props) {
|
|
55
|
-
return react_1["default"].createElement(input_1.Input, __assign({}, props, { type: "radio", role: "radio" }));
|
|
56
|
-
};
|
|
54
|
+
var Radio = react_1["default"].forwardRef(function Radio(props, ref) {
|
|
55
|
+
return react_1["default"].createElement(input_1.Input, __assign({}, props, { type: "radio", role: "radio", ref: ref }));
|
|
56
|
+
});
|
|
57
57
|
exports["default"] = Radio;
|
|
58
58
|
//# sourceMappingURL=Radio.js.map
|
package/lib/radio/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/radio/Radio.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,kCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,IAAM,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/radio/Radio.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,kCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,IAAM,KAAK,GAAG,kBAAK,CAAC,UAAU,CAAC,SAAS,KAAK,CAC3C,KAAiB,EACjB,GAAyC;IAEzC,OAAO,iCAAC,aAAK,eAAK,KAAK,IAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,qBAAe,KAAK,CAAC"}
|
package/lib/switch/Switch.js
CHANGED
|
@@ -51,9 +51,8 @@ var input_1 = require("../input");
|
|
|
51
51
|
*
|
|
52
52
|
*
|
|
53
53
|
*/
|
|
54
|
-
var Switch = react_1["default"].forwardRef(function (props, ref) {
|
|
54
|
+
var Switch = react_1["default"].forwardRef(function Switch(props, ref) {
|
|
55
55
|
return react_1["default"].createElement(input_1.Input, __assign({}, props, { ref: ref, type: "checkbox", role: "switch" }));
|
|
56
56
|
});
|
|
57
|
-
Switch.displayName = 'Switch';
|
|
58
57
|
exports["default"] = Switch;
|
|
59
58
|
//# sourceMappingURL=Switch.js.map
|
package/lib/switch/Switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/switch/Switch.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,kCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,IAAM,MAAM,GAAG,kBAAK,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/switch/Switch.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,kCAAiC;AAGjC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,IAAM,MAAM,GAAG,kBAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7C,KAAiB,EACjB,GAAyC;IAEzC,OAAO,iCAAC,aAAK,eAAK,KAAK,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,QAAQ,IAAG,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,qBAAe,MAAM,CAAC"}
|
package/lib/tabs/Tabs.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface BaseTabsProps<T extends TabId> {
|
|
|
42
42
|
as?: string | React.ComponentType<any>;
|
|
43
43
|
}
|
|
44
44
|
export declare type TabsProps = BaseTabsProps<string> | BaseTabsProps<number>;
|
|
45
|
-
export declare const Tabs:
|
|
45
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<unknown>>;
|
|
46
46
|
interface TabProps<T extends TabId> {
|
|
47
47
|
tabId: T;
|
|
48
48
|
children: React.ReactNode | string;
|
|
@@ -53,7 +53,7 @@ interface TabProps<T extends TabId> {
|
|
|
53
53
|
*/
|
|
54
54
|
as?: string | React.ComponentType<any>;
|
|
55
55
|
}
|
|
56
|
-
export declare const Tab: <
|
|
56
|
+
export declare const Tab: React.ForwardRefExoticComponent<TabProps<TabId> & React.RefAttributes<unknown>>;
|
|
57
57
|
interface TabPanelProps {
|
|
58
58
|
children: React.ReactNode | string;
|
|
59
59
|
/**
|
|
@@ -68,5 +68,5 @@ interface TabPanelProps {
|
|
|
68
68
|
*/
|
|
69
69
|
as?: string | React.ComponentType<any>;
|
|
70
70
|
}
|
|
71
|
-
export declare const TabPanel:
|
|
71
|
+
export declare const TabPanel: React.ForwardRefExoticComponent<TabPanelProps & React.RefAttributes<unknown>>;
|
|
72
72
|
export {};
|
package/lib/tabs/Tabs.js
CHANGED
|
@@ -49,6 +49,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
49
49
|
__setModuleDefault(result, mod);
|
|
50
50
|
return result;
|
|
51
51
|
};
|
|
52
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
53
|
+
var t = {};
|
|
54
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
55
|
+
t[p] = s[p];
|
|
56
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
57
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
58
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
59
|
+
t[p[i]] = s[p[i]];
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
62
|
+
};
|
|
52
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
54
65
|
};
|
|
@@ -73,17 +84,16 @@ var getGeneralTabClasses = function (size, fill) {
|
|
|
73
84
|
underline: fill === 'underline'
|
|
74
85
|
};
|
|
75
86
|
};
|
|
76
|
-
|
|
77
|
-
var children = _a.children, _b = _a.size, size = _b === void 0 ? 'large' : _b, _c = _a.fill, fill = _c === void 0 ? 'underline' : _c, onChange = _a.onChange, value = _a.value,
|
|
78
|
-
var
|
|
87
|
+
exports.Tabs = react_1["default"].forwardRef(function Tabs(_a, ref) {
|
|
88
|
+
var children = _a.children, _b = _a.size, size = _b === void 0 ? 'large' : _b, _c = _a.fill, fill = _c === void 0 ? 'underline' : _c, onChange = _a.onChange, value = _a.value, className = _a.className, _d = _a.as, as = _d === void 0 ? 'div' : _d, rest = __rest(_a, ["children", "size", "fill", "onChange", "value", "className", "as"]);
|
|
89
|
+
var classes = (0, classnames_1["default"])('ndl-tabs', getGeneralTabClasses(size, fill), className);
|
|
79
90
|
var Component = as;
|
|
80
|
-
return (react_1["default"].createElement(Component, { className:
|
|
91
|
+
return (react_1["default"].createElement(Component, __assign({ className: classes, role: "tablist" }, rest, { ref: ref }),
|
|
81
92
|
react_1["default"].createElement(TabsContext.Provider, { value: { value: value, size: size, fill: fill, onChange: onChange } }, children)));
|
|
82
|
-
};
|
|
83
|
-
exports.
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var _e = useTabsContext(), size = _e.size, fill = _e.fill, value = _e.value, onChange = _e.onChange;
|
|
93
|
+
});
|
|
94
|
+
exports.Tab = react_1["default"].forwardRef(function Tab(_a, ref) {
|
|
95
|
+
var children = _a.children, tabId = _a.tabId, _b = _a.disabled, disabled = _b === void 0 ? false : _b, className = _a.className, _c = _a.as, as = _c === void 0 ? 'button' : _c, rest = __rest(_a, ["children", "tabId", "disabled", "className", "as"]);
|
|
96
|
+
var _d = useTabsContext(), size = _d.size, fill = _d.fill, value = _d.value, onChange = _d.onChange;
|
|
87
97
|
var base = (0, classnames_1["default"])(__assign(__assign({}, getGeneralTabClasses(size, fill)), { selected: value === tabId, disabled: disabled }));
|
|
88
98
|
var Component = as;
|
|
89
99
|
// Cast onChange since the compiler isn't smart enough to figure out union of function's parameters
|
|
@@ -91,15 +101,14 @@ var Tab = function (_a) {
|
|
|
91
101
|
// https://stackoverflow.com/questions/55572797/why-does-typescript-expect-never-as-function-argument-when-retrieving-the-func
|
|
92
102
|
var castOnChange = onChange;
|
|
93
103
|
var handleChange = function () { return !disabled && castOnChange(tabId); };
|
|
94
|
-
|
|
104
|
+
var classes = (0, classnames_1["default"])('tab', base, className);
|
|
105
|
+
return (react_1["default"].createElement(Component, __assign({ className: classes, onClick: handleChange, role: "tab", "aria-controls": getTabPanelId(tabId) }, rest, { ref: ref }),
|
|
95
106
|
children,
|
|
96
107
|
fill === 'underline' && react_1["default"].createElement("span", { className: "tab-underline" })));
|
|
97
|
-
};
|
|
98
|
-
exports.
|
|
99
|
-
var
|
|
100
|
-
var _b = _a.as, as = _b === void 0 ? 'div' : _b, children = _a.children, value = _a.value, tabId = _a.tabId, _c = _a.className, className = _c === void 0 ? '' : _c;
|
|
108
|
+
});
|
|
109
|
+
exports.TabPanel = react_1["default"].forwardRef(function TabPanel(_a, ref) {
|
|
110
|
+
var _b = _a.as, as = _b === void 0 ? 'div' : _b, children = _a.children, value = _a.value, tabId = _a.tabId, rest = __rest(_a, ["as", "children", "value", "tabId"]);
|
|
101
111
|
var Component = as;
|
|
102
|
-
return (react_1["default"].createElement(react_1["default"].Fragment, null, value === tabId && (react_1["default"].createElement(Component, { role: "tabpanel", id: getTabPanelId(tabId),
|
|
103
|
-
};
|
|
104
|
-
exports.TabPanel = TabPanel;
|
|
112
|
+
return (react_1["default"].createElement(react_1["default"].Fragment, null, value === tabId && (react_1["default"].createElement(Component, __assign({ role: "tabpanel", id: getTabPanelId(tabId) }, rest, { ref: ref }), children))));
|
|
113
|
+
});
|
|
105
114
|
//# sourceMappingURL=Tabs.js.map
|
package/lib/tabs/Tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/tabs/Tabs.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/tabs/Tabs.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA0C;AAC1C,0DAAoC;AAsCpC,IAAM,WAAW,GAAG,kBAAK,CAAC,aAAa,CAAyB,IAAI,CAAC,CAAC;AAEtE,IAAM,cAAc,GAAG;IACrB,IAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,WAAW,CAAC,CAAC;IAExC,IAAI,OAAO,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,UAAC,KAAY,IAAK,OAAA,mBAAY,KAAK,CAAE,EAAnB,CAAmB,CAAC;AAE5D,IAAM,oBAAoB,GAAG,UAAC,IAAU,EAAE,IAAU;IAClD,OAAO;QACL,KAAK,EAAE,IAAI,KAAK,OAAO;QACvB,KAAK,EAAE,IAAI,KAAK,OAAO;QACvB,MAAM,EAAE,IAAI,KAAK,QA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package/lib/tag/Tag.d.ts
CHANGED
|
@@ -57,5 +57,5 @@ export declare type TagProps = RemoveableTagProps | NonRemovableTagProps;
|
|
|
57
57
|
*
|
|
58
58
|
*
|
|
59
59
|
*/
|
|
60
|
-
declare const Tag:
|
|
60
|
+
declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
61
|
export default Tag;
|
package/lib/tag/Tag.js
CHANGED
|
@@ -19,6 +19,28 @@
|
|
|
19
19
|
* You should have received a copy of the GNU General Public License
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
|
+
var __assign = (this && this.__assign) || function () {
|
|
23
|
+
__assign = Object.assign || function(t) {
|
|
24
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
25
|
+
s = arguments[i];
|
|
26
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
27
|
+
t[p] = s[p];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
31
|
+
return __assign.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
34
|
+
var t = {};
|
|
35
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
36
|
+
t[p] = s[p];
|
|
37
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
40
|
+
t[p[i]] = s[p[i]];
|
|
41
|
+
}
|
|
42
|
+
return t;
|
|
43
|
+
};
|
|
22
44
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
46
|
};
|
|
@@ -41,20 +63,18 @@ var icons_1 = require("../icons");
|
|
|
41
63
|
*
|
|
42
64
|
*
|
|
43
65
|
*/
|
|
44
|
-
var Tag = function (props) {
|
|
45
|
-
var _a;
|
|
46
|
-
var children = props.children, _b = props.type, type = _b === void 0 ? 'default' : _b, removeable = props.removeable, onRemove = props.onRemove;
|
|
66
|
+
var Tag = react_1["default"].forwardRef(function Tag(props, ref) {
|
|
67
|
+
var children = props.children, _a = props.type, type = _a === void 0 ? 'default' : _a, removeable = props.removeable, onRemove = props.onRemove, rest = __rest(props, ["children", "type", "removeable", "onRemove"]);
|
|
47
68
|
if (removeable && typeof onRemove !== 'function') {
|
|
48
69
|
console.error('Tag element is removable but onRemove prop is not a function or provided');
|
|
49
70
|
}
|
|
50
|
-
var classes = (0, classnames_1["default"])("ndl-tag",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (react_1["default"].createElement("div", { className: classes },
|
|
71
|
+
var classes = (0, classnames_1["default"])("ndl-tag", type, {
|
|
72
|
+
removeable: removeable
|
|
73
|
+
});
|
|
74
|
+
return (react_1["default"].createElement("div", __assign({}, rest, { className: classes, ref: ref }),
|
|
55
75
|
children,
|
|
56
76
|
removeable && (react_1["default"].createElement("button", { type: "button", className: "remove-icon", onClick: onRemove },
|
|
57
77
|
react_1["default"].createElement(icons_1.HeroIcon, { iconName: "XIcon" })))));
|
|
58
|
-
};
|
|
78
|
+
});
|
|
59
79
|
exports["default"] = Tag;
|
|
60
80
|
//# sourceMappingURL=Tag.js.map
|
package/lib/tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,0DAAoC;AACpC,kCAAoC;AAgCpC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,IAAM,GAAG,GAAG,kBAAK,CAAC,UAAU,CAAC,SAAS,GAAG,CACvC,KAAe,EACf,GAAuC;IAE/B,IAAA,QAAQ,GAAsD,KAAK,SAA3D,EAAE,KAAoD,KAAK,KAAzC,EAAhB,IAAI,mBAAG,SAAS,KAAA,EAAE,UAAU,GAAwB,KAAK,WAA7B,EAAE,QAAQ,GAAc,KAAK,SAAnB,EAAK,IAAI,UAAK,KAAK,EAArE,8CAA6D,CAAF,CAAW;IAE5E,IAAI,UAAU,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QAChD,OAAO,CAAC,KAAK,CACX,0EAA0E,CAC3E,CAAC;KACH;IAED,IAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,SAAS,EAAE,IAAI,EAAE;QAC1C,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;IAEH,OAAO,CACL,qDAAS,IAAI,IAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG;QACxC,QAAQ;QACR,UAAU,IAAI,CACb,6CAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,QAAQ;YAC7D,iCAAC,gBAAQ,IAAC,QAAQ,EAAC,OAAO,GAAG,CACtB,CACV,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAe,GAAG,CAAC"}
|
package/lib/tooltip/Tooltip.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export interface TooltipProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
25
25
|
children: React.ReactNode | string;
|
|
26
26
|
className?: string;
|
|
27
27
|
}
|
|
28
|
-
declare const Tooltip:
|
|
28
|
+
declare const Tooltip: React.ForwardRefExoticComponent<Pick<TooltipProps, "size" | "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "children" | "role" | "as" | "selected" | "onChange" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "arrowPosition"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
29
|
export default Tooltip;
|
package/lib/tooltip/Tooltip.js
CHANGED
|
@@ -46,11 +46,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
exports.__esModule = true;
|
|
48
48
|
var react_1 = __importDefault(require("react"));
|
|
49
|
-
var
|
|
49
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
50
|
+
var Tooltip = react_1["default"].forwardRef(function Tooltip(_a, ref) {
|
|
50
51
|
var arrowPosition = _a.arrowPosition, children = _a.children, className = _a.className, props = __rest(_a, ["arrowPosition", "children", "className"]);
|
|
51
|
-
|
|
52
|
+
var classes = (0, classnames_1["default"])('ndl-tooltip-wrapper', className);
|
|
53
|
+
return (react_1["default"].createElement("div", __assign({}, props, { role: "tooltip", className: classes, ref: ref }),
|
|
52
54
|
children,
|
|
53
55
|
react_1["default"].createElement("div", { className: "tooltip-triangle ".concat(arrowPosition) })));
|
|
54
|
-
};
|
|
56
|
+
});
|
|
55
57
|
exports["default"] = Tooltip;
|
|
56
58
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAA0B;
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAC1B,0DAAoC;AAgBpC,IAAM,OAAO,GAAG,kBAAK,CAAC,UAAU,CAAC,SAAS,OAAO,CAC/C,EAA8D,EAC9D,GAAuC;IADrC,IAAA,aAAa,mBAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAK,KAAK,cAA9C,0CAAgD,CAAF;IAG9C,IAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAE7D,OAAO,CACL,qDAAS,KAAK,IAAE,IAAI,EAAC,SAAS,EAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG;QACxD,QAAQ;QACT,0CAAK,SAAS,EAAE,2BAAoB,aAAa,CAAE,GAAI,CACnD,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAe,OAAO,CAAC"}
|
|
@@ -42,17 +42,10 @@ export interface ViewSelectorProps<T extends ViewSelectorID> extends ElementBase
|
|
|
42
42
|
selected: T;
|
|
43
43
|
children: React.ReactNode | string;
|
|
44
44
|
}
|
|
45
|
-
export declare const ViewSelector: <
|
|
46
|
-
export declare const ViewSelectorItem:
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* Types
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
45
|
+
export declare const ViewSelector: React.ForwardRefExoticComponent<ViewSelectorProps<ViewSelectorID> & React.RefAttributes<unknown>>;
|
|
46
|
+
export declare const ViewSelectorItem: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement>, "ref" | "size" | "as" | "selected" | "onChange"> & {
|
|
54
47
|
as?: string | React.ComponentType<any> | undefined;
|
|
55
48
|
} & {
|
|
56
49
|
value: string;
|
|
57
|
-
}
|
|
50
|
+
} & React.RefAttributes<unknown>>;
|
|
58
51
|
export {};
|
|
@@ -19,6 +19,17 @@
|
|
|
19
19
|
* You should have received a copy of the GNU General Public License
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
|
+
var __assign = (this && this.__assign) || function () {
|
|
23
|
+
__assign = Object.assign || function(t) {
|
|
24
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
25
|
+
s = arguments[i];
|
|
26
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
27
|
+
t[p] = s[p];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
31
|
+
return __assign.apply(this, arguments);
|
|
32
|
+
};
|
|
22
33
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
34
|
if (k2 === undefined) k2 = k;
|
|
24
35
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -38,6 +49,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
49
|
__setModuleDefault(result, mod);
|
|
39
50
|
return result;
|
|
40
51
|
};
|
|
52
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
53
|
+
var t = {};
|
|
54
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
55
|
+
t[p] = s[p];
|
|
56
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
57
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
58
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
59
|
+
t[p[i]] = s[p[i]];
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
62
|
+
};
|
|
41
63
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
65
|
};
|
|
@@ -53,26 +75,21 @@ var useSelectorContext = function () {
|
|
|
53
75
|
}
|
|
54
76
|
return context;
|
|
55
77
|
};
|
|
56
|
-
|
|
57
|
-
var _b;
|
|
58
|
-
var
|
|
59
|
-
var classes = (0, classnames_1["default"])("ndl-view-selector", (_b = {},
|
|
60
|
-
_b[size] = size,
|
|
61
|
-
_b));
|
|
78
|
+
exports.ViewSelector = react_1["default"].forwardRef(function ViewSelector(_a, ref) {
|
|
79
|
+
var _b = _a.size, size = _b === void 0 ? 'large' : _b, _c = _a.icons, icons = _c === void 0 ? false : _c, children = _a.children, selected = _a.selected, onChange = _a.onChange, _d = _a.as, as = _d === void 0 ? 'div' : _d, rest = __rest(_a, ["size", "icons", "children", "selected", "onChange", "as"]);
|
|
80
|
+
var classes = (0, classnames_1["default"])("ndl-view-selector", size);
|
|
62
81
|
var Component = as;
|
|
63
|
-
return (react_1["default"].createElement(Component, { className: classes, role: "group" },
|
|
82
|
+
return (react_1["default"].createElement(Component, __assign({}, rest, { className: classes, role: "group", ref: ref }),
|
|
64
83
|
react_1["default"].createElement(ViewSelectorContext.Provider, { value: { onChange: onChange, selected: selected, icons: icons } }, children)));
|
|
65
|
-
};
|
|
66
|
-
exports.
|
|
67
|
-
var
|
|
68
|
-
var children = _a.children, value = _a.value, _b = _a.as, as = _b === void 0 ? 'button' : _b;
|
|
84
|
+
});
|
|
85
|
+
exports.ViewSelectorItem = react_1["default"].forwardRef(function ViewSelectorItem(_a, ref) {
|
|
86
|
+
var children = _a.children, value = _a.value, _b = _a.as, as = _b === void 0 ? 'button' : _b, rest = __rest(_a, ["children", "value", "as"]);
|
|
69
87
|
var _c = useSelectorContext(), onChange = _c.onChange, selected = _c.selected, icons = _c.icons;
|
|
70
88
|
var isSelected = value && value === selected;
|
|
71
89
|
var base = (0, classnames_1["default"])("selector-".concat(icons ? 'icon' : 'item'), {
|
|
72
90
|
current: value && value === selected
|
|
73
91
|
});
|
|
74
92
|
var Component = as;
|
|
75
|
-
return (react_1["default"].createElement(Component, { onClick: function () { return !isSelected && onChange(value); }, className: base }, children));
|
|
76
|
-
};
|
|
77
|
-
exports.ViewSelectorItem = ViewSelectorItem;
|
|
93
|
+
return (react_1["default"].createElement(Component, __assign({}, rest, { onClick: function () { return !isSelected && onChange(value); }, className: base, ref: ref }), children));
|
|
94
|
+
});
|
|
78
95
|
//# sourceMappingURL=ViewSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewSelector.js","sourceRoot":"","sources":["../../src/view-selector/ViewSelector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"ViewSelector.js","sourceRoot":"","sources":["../../src/view-selector/ViewSelector.tsx"],"names":[],"mappings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AAA,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,UAAa,EAAb,EAAE,mBAAG,QAAQ,KAAA,EACV,IAAI,cAJT,2BAKC,CADQ;IAMH,IAAA,KAAgC,kBAAkB,EAAE,EAAlD,QAAQ,cAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAyB,CAAC;IAE3D,IAAM,UAAU,GAAG,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC;IAE/C,IAAM,IAAI,GAAG,IAAA,uBAAU,EAAC,mBAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAE,EAAE;QAC7D,OAAO,EAAE,KAAK,IAAI,KAAK,KAAK,QAAQ;KACrC,CAAC,CAAC;IAEH,IAAM,SAAS,GAAG,EAAE,CAAC;IAErB,OAAO,CACL,iCAAC,SAAS,eACJ,IAAI,IACR,OAAO,EAAE,cAAM,OAAA,CAAC,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,EAA9B,CAA8B,EAC7C,SAAS,EAAE,IAAI,EACf,GAAG,EAAE,GAAG,KAEP,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React implementation of Neo4j Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"button",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@babel/preset-react": "^7.16.0",
|
|
38
38
|
"@testing-library/jest-dom": "^5.15.1",
|
|
39
39
|
"@testing-library/react": "^12.1.2",
|
|
40
|
+
"@types/jest-axe": "^3.5.3",
|
|
40
41
|
"@types/react-dom": "^17.0.11",
|
|
41
42
|
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
42
43
|
"@typescript-eslint/parser": "^5.5.0",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"eslint-plugin-react": "^7.27.1",
|
|
49
50
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
50
51
|
"jest": "^27.3.1",
|
|
52
|
+
"jest-axe": "^5.0.1",
|
|
51
53
|
"react": "^17.0.2",
|
|
52
54
|
"ts-jest": "^27.0.7"
|
|
53
55
|
},
|
|
@@ -56,8 +58,8 @@
|
|
|
56
58
|
},
|
|
57
59
|
"dependencies": {
|
|
58
60
|
"@heroicons/react": "^1.0.5",
|
|
59
|
-
"@neo4j-ndl/base": "^0.1.
|
|
61
|
+
"@neo4j-ndl/base": "^0.1.1",
|
|
60
62
|
"classnames": "^2.3.1"
|
|
61
63
|
},
|
|
62
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "ddd93302174a2110eef5e1e276546cb39a1fadab"
|
|
63
65
|
}
|