@mongodb-js/compass-components 0.12.0 → 0.15.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/compass-font-sizes.d.ts +1 -0
- package/lib/compass-font-sizes.d.ts.map +1 -1
- package/lib/compass-font-sizes.js +2 -1
- package/lib/compass-font-sizes.js.map +1 -1
- package/lib/compass-ui-colors.d.ts +2 -0
- package/lib/compass-ui-colors.d.ts.map +1 -1
- package/lib/compass-ui-colors.js +3 -1
- package/lib/compass-ui-colors.js.map +1 -1
- package/lib/components/accordion.d.ts +5 -3
- package/lib/components/accordion.d.ts.map +1 -1
- package/lib/components/accordion.js +21 -9
- package/lib/components/accordion.js.map +1 -1
- package/lib/components/bson-value.d.ts +40 -0
- package/lib/components/bson-value.d.ts.map +1 -0
- package/lib/components/bson-value.js +208 -0
- package/lib/components/bson-value.js.map +1 -0
- package/lib/components/cancel-loader.d.ts.map +1 -1
- package/lib/components/cancel-loader.js +15 -48
- package/lib/components/cancel-loader.js.map +1 -1
- package/lib/components/checkbox.d.ts +1 -1
- package/lib/components/checkbox.d.ts.map +1 -1
- package/lib/components/checkbox.js +2 -6
- package/lib/components/checkbox.js.map +1 -1
- package/lib/components/confirmation-modal.d.ts +1 -1
- package/lib/components/confirmation-modal.d.ts.map +1 -1
- package/lib/components/confirmation-modal.js +2 -5
- package/lib/components/confirmation-modal.js.map +1 -1
- package/lib/components/document-list/auto-focus-context.d.ts +9 -0
- package/lib/components/document-list/auto-focus-context.d.ts.map +1 -0
- package/lib/components/document-list/auto-focus-context.js +10 -0
- package/lib/components/document-list/auto-focus-context.js.map +1 -0
- package/lib/components/document-list/document-actions-group.d.ts +16 -0
- package/lib/components/document-list/document-actions-group.d.ts.map +1 -0
- package/lib/components/document-list/document-actions-group.js +95 -0
- package/lib/components/document-list/document-actions-group.js.map +1 -0
- package/lib/components/document-list/document-fields-toggle-group.d.ts +11 -0
- package/lib/components/document-list/document-fields-toggle-group.d.ts.map +1 -0
- package/lib/components/document-list/document-fields-toggle-group.js +69 -0
- package/lib/components/document-list/document-fields-toggle-group.js.map +1 -0
- package/lib/components/document-list/document.d.ts +12 -0
- package/lib/components/document-list/document.d.ts.map +1 -0
- package/lib/components/document-list/document.js +90 -0
- package/lib/components/document-list/document.js.map +1 -0
- package/lib/components/document-list/element-actions.d.ts +16 -0
- package/lib/components/document-list/element-actions.d.ts.map +1 -0
- package/lib/components/document-list/element-actions.js +94 -0
- package/lib/components/document-list/element-actions.js.map +1 -0
- package/lib/components/document-list/element-editors.d.ts +33 -0
- package/lib/components/document-list/element-editors.d.ts.map +1 -0
- package/lib/components/document-list/element-editors.js +143 -0
- package/lib/components/document-list/element-editors.js.map +1 -0
- package/lib/components/document-list/element.d.ts +12 -0
- package/lib/components/document-list/element.d.ts.map +1 -0
- package/lib/components/document-list/element.js +347 -0
- package/lib/components/document-list/element.js.map +1 -0
- package/lib/components/document-list/font-awesome-icon.d.ts +14 -0
- package/lib/components/document-list/font-awesome-icon.d.ts.map +1 -0
- package/lib/components/document-list/font-awesome-icon.js +29 -0
- package/lib/components/document-list/font-awesome-icon.js.map +1 -0
- package/lib/components/document-list/index.d.ts +4 -0
- package/lib/components/document-list/index.d.ts.map +1 -0
- package/lib/components/document-list/index.js +13 -0
- package/lib/components/document-list/index.js.map +1 -0
- package/lib/components/document-list/use-force-update.d.ts +2 -0
- package/lib/components/document-list/use-force-update.d.ts.map +1 -0
- package/lib/components/document-list/use-force-update.js +13 -0
- package/lib/components/document-list/use-force-update.js.map +1 -0
- package/lib/components/document-list/use-previous.d.ts +2 -0
- package/lib/components/document-list/use-previous.d.ts.map +1 -0
- package/lib/components/document-list/use-previous.js +13 -0
- package/lib/components/document-list/use-previous.js.map +1 -0
- package/lib/components/editor.d.ts +31 -0
- package/lib/components/editor.d.ts.map +1 -0
- package/lib/components/editor.js +62 -0
- package/lib/components/editor.js.map +1 -0
- package/lib/components/error-boundary.d.ts +2 -10
- package/lib/components/error-boundary.d.ts.map +1 -1
- package/lib/components/error-boundary.js +7 -3
- package/lib/components/error-boundary.js.map +1 -1
- package/lib/components/error-warning-summary.d.ts +22 -0
- package/lib/components/error-warning-summary.d.ts.map +1 -0
- package/lib/components/error-warning-summary.js +84 -0
- package/lib/components/error-warning-summary.js.map +1 -0
- package/lib/components/file-input.d.ts +16 -15
- package/lib/components/file-input.d.ts.map +1 -1
- package/lib/components/file-input.js +21 -13
- package/lib/components/file-input.js.map +1 -1
- package/lib/components/inline-definition.js +2 -2
- package/lib/components/inline-definition.js.map +1 -1
- package/lib/components/inline-info-link.js +3 -4
- package/lib/components/inline-info-link.js.map +1 -1
- package/lib/components/leafygreen.d.ts +63 -0
- package/lib/components/leafygreen.d.ts.map +1 -0
- package/lib/components/leafygreen.js +116 -0
- package/lib/components/leafygreen.js.map +1 -0
- package/lib/components/modal-title.d.ts +5 -0
- package/lib/components/modal-title.d.ts.map +1 -0
- package/lib/components/modal-title.js +18 -0
- package/lib/components/modal-title.js.map +1 -0
- package/lib/components/modal.d.ts +1 -1
- package/lib/components/modal.d.ts.map +1 -1
- package/lib/components/modal.js +2 -5
- package/lib/components/modal.js.map +1 -1
- package/lib/components/radio-box-group.d.ts +1 -1
- package/lib/components/radio-box-group.d.ts.map +1 -1
- package/lib/components/radio-box-group.js +2 -2
- package/lib/components/radio-box-group.js.map +1 -1
- package/lib/components/resize-handle.d.ts.map +1 -1
- package/lib/components/resize-handle.js +1 -0
- package/lib/components/resize-handle.js.map +1 -1
- package/lib/components/tab-nav-bar.d.ts +14 -0
- package/lib/components/tab-nav-bar.d.ts.map +1 -0
- package/lib/components/tab-nav-bar.js +47 -0
- package/lib/components/tab-nav-bar.js.map +1 -0
- package/lib/components/toggle.d.ts +1 -1
- package/lib/components/toggle.d.ts.map +1 -1
- package/lib/components/toggle.js +2 -2
- package/lib/components/toggle.js.map +1 -1
- package/lib/components/toolbar.d.ts +10 -0
- package/lib/components/toolbar.d.ts.map +1 -0
- package/lib/components/toolbar.js +25 -0
- package/lib/components/toolbar.js.map +1 -0
- package/lib/components/tooltip.d.ts +1 -1
- package/lib/components/tooltip.d.ts.map +1 -1
- package/lib/components/tooltip.js +2 -5
- package/lib/components/tooltip.js.map +1 -1
- package/lib/components/virtual-grid.d.ts +3 -2
- package/lib/components/virtual-grid.d.ts.map +1 -1
- package/lib/components/virtual-grid.js +5 -7
- package/lib/components/virtual-grid.js.map +1 -1
- package/lib/components/workspace-container.d.ts +8 -0
- package/lib/components/workspace-container.d.ts.map +1 -0
- package/lib/components/workspace-container.js +31 -0
- package/lib/components/workspace-container.js.map +1 -0
- package/lib/components/workspace-tabs/tab.d.ts +16 -0
- package/lib/components/workspace-tabs/tab.d.ts.map +1 -0
- package/lib/components/workspace-tabs/tab.js +223 -0
- package/lib/components/workspace-tabs/tab.js.map +1 -0
- package/lib/components/workspace-tabs/workspace-tabs.d.ts +24 -0
- package/lib/components/workspace-tabs/workspace-tabs.d.ts.map +1 -0
- package/lib/components/workspace-tabs/workspace-tabs.js +175 -0
- package/lib/components/workspace-tabs/workspace-tabs.js.map +1 -0
- package/lib/hooks/use-default-action.d.ts.map +1 -1
- package/lib/hooks/use-default-action.js +1 -5
- package/lib/hooks/use-default-action.js.map +1 -1
- package/lib/hooks/use-theme.d.ts +6 -2
- package/lib/hooks/use-theme.d.ts.map +1 -1
- package/lib/hooks/use-theme.js +15 -2
- package/lib/hooks/use-theme.js.map +1 -1
- package/lib/hooks/use-virtual-grid.d.ts +3 -6
- package/lib/hooks/use-virtual-grid.d.ts.map +1 -1
- package/lib/hooks/use-virtual-grid.js +72 -42
- package/lib/hooks/use-virtual-grid.js.map +1 -1
- package/lib/hooks/use-virtual-grid.test.js +7 -6
- package/lib/hooks/use-virtual-grid.test.js.map +1 -1
- package/lib/index.d.ts +19 -22
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +29 -60
- package/lib/index.js.map +1 -1
- package/package.json +28 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useForceUpdate = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useForceUpdate() {
|
|
6
|
+
const [, setState] = (0, react_1.useState)({});
|
|
7
|
+
const forceUpdate = (0, react_1.useCallback)(() => {
|
|
8
|
+
setState({});
|
|
9
|
+
}, []);
|
|
10
|
+
return forceUpdate;
|
|
11
|
+
}
|
|
12
|
+
exports.useForceUpdate = useForceUpdate;
|
|
13
|
+
//# sourceMappingURL=use-force-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-force-update.js","sourceRoot":"","sources":["../../../src/components/document-list/use-force-update.tsx"],"names":[],"mappings":";;;AAAA,iCAA8C;AAE9C,SAAgB,cAAc;IAC5B,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAClC,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,WAAW,CAAC;AACrB,CAAC;AAND,wCAMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-previous.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/use-previous.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAMtD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePrevious = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function usePrevious(value) {
|
|
6
|
+
const ref = (0, react_1.useRef)();
|
|
7
|
+
(0, react_1.useEffect)(() => {
|
|
8
|
+
ref.current = value;
|
|
9
|
+
}, [value]);
|
|
10
|
+
return ref.current;
|
|
11
|
+
}
|
|
12
|
+
exports.usePrevious = usePrevious;
|
|
13
|
+
//# sourceMappingURL=use-previous.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-previous.js","sourceRoot":"","sources":["../../../src/components/document-list/use-previous.tsx"],"names":[],"mappings":";;;AAAA,iCAA0C;AAE1C,SAAgB,WAAW,CAAI,KAAQ;IACrC,MAAM,GAAG,GAAG,IAAA,cAAM,GAAiB,CAAC;IACpC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAND,kCAMC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'ace-builds';
|
|
3
|
+
import type { IAceEditorProps, IAceOptions } from 'react-ace';
|
|
4
|
+
import 'ace-builds/src-noconflict/ext-language_tools';
|
|
5
|
+
import 'ace-builds/src-noconflict/mode-javascript';
|
|
6
|
+
import 'ace-builds/src-noconflict/mode-json';
|
|
7
|
+
import 'ace-builds/src-noconflict/mode-csharp';
|
|
8
|
+
import 'ace-builds/src-noconflict/mode-python';
|
|
9
|
+
import 'ace-builds/src-noconflict/mode-java';
|
|
10
|
+
import 'ace-builds/src-noconflict/mode-ruby';
|
|
11
|
+
import 'ace-builds/src-noconflict/mode-rust';
|
|
12
|
+
import 'mongodb-ace-mode';
|
|
13
|
+
import 'mongodb-ace-theme';
|
|
14
|
+
import 'mongodb-ace-theme-query';
|
|
15
|
+
declare const EditorVariant: {
|
|
16
|
+
readonly Shell: "Shell";
|
|
17
|
+
readonly EJSON: "EJSON";
|
|
18
|
+
readonly Generic: "Generic";
|
|
19
|
+
};
|
|
20
|
+
declare type EditorProps = {
|
|
21
|
+
variant: keyof typeof EditorVariant;
|
|
22
|
+
text?: string;
|
|
23
|
+
options?: Omit<IAceOptions, 'readOnly'>;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
completer?: unknown;
|
|
26
|
+
onChangeText?: (text: string, event?: any) => void;
|
|
27
|
+
} & Omit<IAceEditorProps, 'onChange' | 'value'>;
|
|
28
|
+
declare function Editor({ text, variant, options, readOnly, onChangeText, completer, onFocus, ...aceProps }: EditorProps): React.ReactElement;
|
|
29
|
+
declare const EditorTextCompleter: any;
|
|
30
|
+
export { Editor, EditorVariant, EditorTextCompleter };
|
|
31
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/components/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AAgBjC,QAAA,MAAM,aAAa;;;;CAIT,CAAC;AAEX,aAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,OAAO,aAAa,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACpD,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAEhD,iBAAS,MAAM,CAAC,EACd,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,OAAO,EACP,GAAG,QAAQ,EACZ,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAkClC;AAED,QAAA,MAAM,mBAAmB,KAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.EditorTextCompleter = exports.EditorVariant = exports.Editor = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
if (typeof window === 'undefined' && typeof globalThis !== 'undefined') {
|
|
9
|
+
globalThis.window = {};
|
|
10
|
+
}
|
|
11
|
+
require("ace-builds");
|
|
12
|
+
const react_ace_1 = __importDefault(require("react-ace"));
|
|
13
|
+
require("ace-builds/src-noconflict/ext-language_tools");
|
|
14
|
+
require("ace-builds/src-noconflict/mode-javascript");
|
|
15
|
+
require("ace-builds/src-noconflict/mode-json");
|
|
16
|
+
require("ace-builds/src-noconflict/mode-csharp");
|
|
17
|
+
require("ace-builds/src-noconflict/mode-python");
|
|
18
|
+
require("ace-builds/src-noconflict/mode-java");
|
|
19
|
+
require("ace-builds/src-noconflict/mode-ruby");
|
|
20
|
+
require("ace-builds/src-noconflict/mode-rust");
|
|
21
|
+
require("mongodb-ace-mode");
|
|
22
|
+
require("mongodb-ace-theme");
|
|
23
|
+
require("mongodb-ace-theme-query");
|
|
24
|
+
const ext_language_tools_1 = __importDefault(require("ace-builds/src-noconflict/ext-language_tools"));
|
|
25
|
+
const DEFAULT_OPTIONS = {
|
|
26
|
+
enableLiveAutocompletion: false,
|
|
27
|
+
tabSize: 2,
|
|
28
|
+
fontSize: 11,
|
|
29
|
+
minLines: 10,
|
|
30
|
+
maxLines: Infinity,
|
|
31
|
+
showGutter: true,
|
|
32
|
+
useWorker: false,
|
|
33
|
+
};
|
|
34
|
+
const EditorVariant = {
|
|
35
|
+
Shell: 'Shell',
|
|
36
|
+
EJSON: 'EJSON',
|
|
37
|
+
Generic: 'Generic',
|
|
38
|
+
};
|
|
39
|
+
exports.EditorVariant = EditorVariant;
|
|
40
|
+
function Editor({ text, variant, options, readOnly, onChangeText, completer, onFocus, ...aceProps }) {
|
|
41
|
+
const setOptions = {
|
|
42
|
+
...DEFAULT_OPTIONS,
|
|
43
|
+
...options,
|
|
44
|
+
...(typeof readOnly === 'boolean' && { readOnly }),
|
|
45
|
+
...(variant === 'Shell' && { mode: 'ace/mode/mongodb' }),
|
|
46
|
+
...(!!completer && { enableLiveAutocompletion: true }),
|
|
47
|
+
};
|
|
48
|
+
return (react_1.default.createElement(react_ace_1.default, { mode: variant === 'Generic'
|
|
49
|
+
? undefined
|
|
50
|
+
: variant === 'EJSON'
|
|
51
|
+
? 'json'
|
|
52
|
+
: 'javascript', theme: "mongodb", width: "100%", value: text, onChange: onChangeText, editorProps: { $blockScrolling: Infinity }, setOptions: setOptions, readOnly: readOnly, ...aceProps, onFocus: (ev) => {
|
|
53
|
+
if (completer) {
|
|
54
|
+
ext_language_tools_1.default.setCompleters([completer]);
|
|
55
|
+
}
|
|
56
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(ev);
|
|
57
|
+
} }));
|
|
58
|
+
}
|
|
59
|
+
exports.Editor = Editor;
|
|
60
|
+
const EditorTextCompleter = ext_language_tools_1.default.textCompleter;
|
|
61
|
+
exports.EditorTextCompleter = EditorTextCompleter;
|
|
62
|
+
//# sourceMappingURL=edit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C;IAEF,OAAO,CACL,8BAAC,mBAAS,IACR,IAAI,EACF,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,OAAO,KAAK,OAAO;gBACrB,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,YAAY,EAElB,KAAK,EAAC,SAAS,EACf,KAAK,EAAC,MAAM,EACZ,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,EAC1C,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,KACd,QAAQ,EACZ,OAAO,EAAE,CAAC,EAAO,EAAE,EAAE;YACnB,IAAI,SAAS,EAAE;gBACb,4BAAK,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;aAClC;YACD,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,EAAE,CAAC,CAAC;QAChB,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAGQ,wBAAM;AADf,MAAM,mBAAmB,GAAG,4BAAK,CAAC,aAAa,CAAC;AAChB,kDAAmB"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import type { ErrorInfo } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare type State = {
|
|
4
|
-
error: Error | null;
|
|
5
|
-
};
|
|
6
3
|
declare type Props = {
|
|
7
4
|
displayName?: string;
|
|
8
5
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
9
6
|
children: React.ReactElement;
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static getDerivedStateFromError(error: Error): State;
|
|
14
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
15
|
-
render(): React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
8
|
+
declare const _ErrorBoundary: React.FunctionComponent<Props>;
|
|
9
|
+
export { _ErrorBoundary as ErrorBoundary };
|
|
18
10
|
//# sourceMappingURL=error-boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/components/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/components/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,aAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACvD,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAAC;AAqCF,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CASlD,CAAC;AAEF,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ErrorBoundary = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const banner_1 = __importDefault(require("@leafygreen-ui/banner"));
|
|
9
8
|
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
10
9
|
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
10
|
+
const leafygreen_1 = require("./leafygreen");
|
|
11
11
|
const errorContainerStyles = (0, emotion_1.css)({
|
|
12
12
|
padding: tokens_1.spacing[3],
|
|
13
13
|
width: '100%',
|
|
@@ -34,7 +34,7 @@ class ErrorBoundary extends react_1.default.Component {
|
|
|
34
34
|
const { error } = this.state;
|
|
35
35
|
if (error) {
|
|
36
36
|
return (react_1.default.createElement("div", { className: errorContainerStyles },
|
|
37
|
-
react_1.default.createElement(
|
|
37
|
+
react_1.default.createElement(leafygreen_1.Banner, { variant: "danger" },
|
|
38
38
|
"An error occurred while rendering",
|
|
39
39
|
displayName ? ` ${displayName}` : '',
|
|
40
40
|
": ",
|
|
@@ -43,5 +43,9 @@ class ErrorBoundary extends react_1.default.Component {
|
|
|
43
43
|
return this.props.children;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
const _ErrorBoundary = (props) => {
|
|
47
|
+
var _a;
|
|
48
|
+
return ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.COMPASS_DISABLE_ERROR_BOUNDARY) === 'true' ? (react_1.default.createElement(react_1.default.Fragment, null, props.children)) : (react_1.default.createElement(ErrorBoundary, { ...props }));
|
|
49
|
+
};
|
|
50
|
+
exports.ErrorBoundary = _ErrorBoundary;
|
|
47
51
|
//# sourceMappingURL=error-boundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../src/components/error-boundary.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../src/components/error-boundary.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,oDAA6C;AAC7C,kDAAgD;AAEhD,6CAAsC;AAEtC,MAAM,oBAAoB,GAAG,IAAA,aAAG,EAAC;IAC/B,OAAO,EAAE,gBAAO,CAAC,CAAC,CAAC;IACnB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAYH,MAAM,aAAc,SAAQ,eAAK,CAAC,SAAgB;IAAlD;;QACE,UAAK,GAAU;YACb,KAAK,EAAE,IAAI;SACZ,CAAC;IA8BJ,CAAC;IA5BC,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO;YACL,KAAK;SACN,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,SAAoB;QAClD,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SACtC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACnC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7B,IAAI,KAAK,EAAE;YACT,OAAO,CACL,uCAAK,SAAS,EAAE,oBAAoB;gBAClC,8BAAC,mBAAM,IAAC,OAAO,EAAC,QAAQ;;oBAErB,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;;oBAAI,KAAK,CAAC,OAAO,CAC/C,CACL,CACP,CAAC;SACH;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,cAAc,GAAmC,CAAC,KAAK,EAAE,EAAE;;IAI/D,OAAO,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAE,8BAA8B,MAAK,MAAM,CAAC,CAAC,CAAC,CAC/D,8DAAG,KAAK,CAAC,QAAQ,CAAI,CACtB,CAAC,CAAC,CAAC,CACF,8BAAC,aAAa,OAAK,KAAK,GAAkB,CAC3C,CAAC;AACJ,CAAC,CAAC;AAEyB,uCAAa"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ErrorSummary: React.FunctionComponent<{
|
|
3
|
+
errors: string | string[];
|
|
4
|
+
['data-testid']?: string;
|
|
5
|
+
} & ({
|
|
6
|
+
actionText: string;
|
|
7
|
+
onAction(): void;
|
|
8
|
+
} | {
|
|
9
|
+
actionText?: never;
|
|
10
|
+
onAction?: never;
|
|
11
|
+
})>;
|
|
12
|
+
export declare const WarningSummary: React.FunctionComponent<{
|
|
13
|
+
warnings: string | string[];
|
|
14
|
+
['data-testid']?: string;
|
|
15
|
+
} & ({
|
|
16
|
+
actionText: string;
|
|
17
|
+
onAction(): void;
|
|
18
|
+
} | {
|
|
19
|
+
actionText?: never;
|
|
20
|
+
onAction?: never;
|
|
21
|
+
})>;
|
|
22
|
+
//# sourceMappingURL=error-warning-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-warning-summary.d.ts","sourceRoot":"","sources":["../../src/components/error-warning-summary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAgHvC,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAChD;IAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CACtD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,IAAI,IAAI,CAAA;CAAE,GACxC;IAAE,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAC3C,CASF,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAClD;IAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CACxD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,IAAI,IAAI,CAAA;CAAE,GACxC;IAAE,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAC3C,CASF,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.WarningSummary = exports.ErrorSummary = void 0;
|
|
23
|
+
const react_1 = __importStar(require("react"));
|
|
24
|
+
const banner_1 = require("@leafygreen-ui/banner");
|
|
25
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
26
|
+
const inline_definition_1 = require("./inline-definition");
|
|
27
|
+
const leafygreen_1 = require("./leafygreen");
|
|
28
|
+
const bannerStyle = (0, emotion_1.css)({
|
|
29
|
+
width: '100%',
|
|
30
|
+
});
|
|
31
|
+
const listStyle = (0, emotion_1.css)({
|
|
32
|
+
padding: 0,
|
|
33
|
+
margin: 0,
|
|
34
|
+
listStylePosition: 'inside',
|
|
35
|
+
});
|
|
36
|
+
const summaryStyles = (0, emotion_1.css)({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
});
|
|
39
|
+
const actionButtonStyles = (0, emotion_1.css)({
|
|
40
|
+
marginLeft: 'auto',
|
|
41
|
+
});
|
|
42
|
+
function Summary({ messages }) {
|
|
43
|
+
if (messages.length === 1) {
|
|
44
|
+
return react_1.default.createElement("div", null, messages[0]);
|
|
45
|
+
}
|
|
46
|
+
if (messages.length === 2) {
|
|
47
|
+
return (react_1.default.createElement("div", null,
|
|
48
|
+
react_1.default.createElement("ol", { className: listStyle }, messages.map((message, i) => (react_1.default.createElement("li", { key: i }, message))))));
|
|
49
|
+
}
|
|
50
|
+
const tooltipErrors = (react_1.default.createElement("ol", { className: listStyle }, messages.map((message, i) => (react_1.default.createElement("li", { key: i }, message)))));
|
|
51
|
+
const firstMessageNoDot = messages[0].endsWith('.')
|
|
52
|
+
? messages[0].slice(0, messages[0].length - 1)
|
|
53
|
+
: messages[0];
|
|
54
|
+
return (react_1.default.createElement("div", null,
|
|
55
|
+
react_1.default.createElement("span", null,
|
|
56
|
+
firstMessageNoDot,
|
|
57
|
+
", and other ",
|
|
58
|
+
messages.length - 1,
|
|
59
|
+
" problems."),
|
|
60
|
+
' ',
|
|
61
|
+
react_1.default.createElement(inline_definition_1.InlineDefinition, { tooltipProps: {
|
|
62
|
+
align: 'top',
|
|
63
|
+
justify: 'start',
|
|
64
|
+
delay: 500,
|
|
65
|
+
}, definition: tooltipErrors }, "View all")));
|
|
66
|
+
}
|
|
67
|
+
const BannerWithSummary = ({ ['data-testid']: dataTestId, messages, onAction, actionText, variant, }) => {
|
|
68
|
+
const _messages = (0, react_1.useMemo)(() => {
|
|
69
|
+
return !Array.isArray(messages) ? [messages] : messages;
|
|
70
|
+
}, [messages]);
|
|
71
|
+
return (react_1.default.createElement(leafygreen_1.Banner, { "data-testid": dataTestId, variant: variant, className: bannerStyle },
|
|
72
|
+
react_1.default.createElement("div", { className: summaryStyles },
|
|
73
|
+
react_1.default.createElement(Summary, { messages: _messages }),
|
|
74
|
+
onAction && actionText && (react_1.default.createElement(leafygreen_1.Button, { "data-testid": "banner-action", size: "xsmall", onClick: onAction, className: actionButtonStyles }, actionText)))));
|
|
75
|
+
};
|
|
76
|
+
const ErrorSummary = ({ errors, ...props }) => {
|
|
77
|
+
return (react_1.default.createElement(BannerWithSummary, { messages: errors, variant: banner_1.Variant.Danger, ...props }));
|
|
78
|
+
};
|
|
79
|
+
exports.ErrorSummary = ErrorSummary;
|
|
80
|
+
const WarningSummary = ({ warnings, ...props }) => {
|
|
81
|
+
return (react_1.default.createElement(BannerWithSummary, { messages: warnings, variant: banner_1.Variant.Warning, ...props }));
|
|
82
|
+
};
|
|
83
|
+
exports.WarningSummary = WarningSummary;
|
|
84
|
+
//# sourceMappingURL=error-warning-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-warning-summary.js","sourceRoot":"","sources":["../../src/components/error-warning-summary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AACvC,kDAAiE;AACjE,oDAA6C;AAE7C,2DAAuD;AACvD,6CAA8C;AAE9C,MAAM,WAAW,GAAG,IAAA,aAAG,EAAC;IACtB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAA,aAAG,EAAC;IACpB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,iBAAiB,EAAE,QAAQ;CAC5B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,IAAA,aAAG,EAAC;IACxB,OAAO,EAAE,MAAM;CAChB,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAA,aAAG,EAAC;IAC7B,UAAU,EAAE,MAAM;CACnB,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,EAAE,QAAQ,EAA0B;IACnD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,2CAAM,QAAQ,CAAC,CAAC,CAAC,CAAO,CAAC;KACjC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,CACL;YACE,sCAAI,SAAS,EAAE,SAAS,IACrB,QAAQ,CAAC,GAAG,CAAC,CAAC,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AO,CACL,8BAAC,mBAAM,mBAAc,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW;QACvE,uCAAK,SAAS,EAAE,aAAa;YAC3B,8BAAC,OAAO,IAAC,QAAQ,EAAE,SAAS,GAAY;YACvC,QAAQ,IAAI,UAAU,IAAI,CACzB,8BAAC,mBAAM,mBACO,eAAe,EAC3B,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,kBAAkB,IAE5B,UAAU,CACJ,CACV,CACG,CACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,YAAY,GAKrB,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC3B,OAAO,CACL,8BAAC,iBAAiB,IAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAa,CAAC,MAAM,KACzB,KAAK,GACU,CACtB,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,cAAc,GAKvB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7B,OAAO,CACL,8BAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAa,CAAC,OAAO,KAC1B,KAAK,GACU,CACtB,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB"}
|
|
@@ -3,22 +3,23 @@ export declare enum Variant {
|
|
|
3
3
|
Horizontal = "HORIZONTAL",
|
|
4
4
|
Vertical = "VERTICAL"
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
6
|
+
declare const _default: React.ComponentType<{
|
|
7
7
|
id: string;
|
|
8
8
|
label: string;
|
|
9
|
-
dataTestId?: string;
|
|
9
|
+
dataTestId?: string | undefined;
|
|
10
10
|
onChange: (files: string[]) => void;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
darkMode?: boolean | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
multi?: boolean | undefined;
|
|
14
|
+
optional?: boolean | undefined;
|
|
15
|
+
optionalMessage?: string | undefined;
|
|
16
|
+
error?: boolean | undefined;
|
|
17
|
+
errorMessage?: string | undefined;
|
|
18
|
+
variant?: Variant | undefined;
|
|
19
|
+
link?: string | undefined;
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
showFileOnNewLine?: boolean | undefined;
|
|
22
|
+
values?: string[] | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export default _default;
|
|
24
25
|
//# sourceMappingURL=file-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiG1B,oBAAY,OAAO;IACjB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;;;;;;;;;;;;;;;;;;;AAqLD,wBAAoC"}
|
|
@@ -9,7 +9,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
10
10
|
const palette_1 = require("@leafygreen-ui/palette");
|
|
11
11
|
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
12
|
-
const
|
|
12
|
+
const use_theme_1 = require("../hooks/use-theme");
|
|
13
|
+
const leafygreen_1 = require("./leafygreen");
|
|
13
14
|
const { base: redBaseColor } = palette_1.uiColors.red;
|
|
14
15
|
const formItemHorizontalStyles = (0, emotion_1.css)({
|
|
15
16
|
marginTop: tokens_1.spacing[2],
|
|
@@ -69,15 +70,19 @@ const labelIconStyles = (0, emotion_1.css)({
|
|
|
69
70
|
color: '#fbb129',
|
|
70
71
|
},
|
|
71
72
|
});
|
|
72
|
-
const
|
|
73
|
+
const disabledDescriptionLightStyles = (0, emotion_1.css)({
|
|
73
74
|
color: palette_1.uiColors.gray.dark1,
|
|
74
75
|
});
|
|
76
|
+
const disabledDescriptionDarkStyles = (0, emotion_1.css)({
|
|
77
|
+
color: palette_1.uiColors.gray.light1,
|
|
78
|
+
});
|
|
75
79
|
var Variant;
|
|
76
80
|
(function (Variant) {
|
|
77
81
|
Variant["Horizontal"] = "HORIZONTAL";
|
|
78
82
|
Variant["Vertical"] = "VERTICAL";
|
|
79
83
|
})(Variant = exports.Variant || (exports.Variant = {}));
|
|
80
|
-
function FileInput({ id, label, dataTestId, onChange, disabled, multi = false, optional = false, optionalMessage, error = false, errorMessage, variant = Variant.Horizontal, showFileOnNewLine = false, link, description, values, }) {
|
|
84
|
+
function FileInput({ id, label, dataTestId, darkMode, onChange, disabled, multi = false, optional = false, optionalMessage, error = false, errorMessage, variant = Variant.Horizontal, showFileOnNewLine = false, link, description, values, }) {
|
|
85
|
+
var _a, _b;
|
|
81
86
|
const inputRef = react_1.default.useRef(null);
|
|
82
87
|
const buttonText = react_1.default.useMemo(() => {
|
|
83
88
|
if (Array.isArray(values) && values.length > 0) {
|
|
@@ -97,39 +102,42 @@ function FileInput({ id, label, dataTestId, onChange, disabled, multi = false, o
|
|
|
97
102
|
return null;
|
|
98
103
|
}
|
|
99
104
|
if (!link) {
|
|
100
|
-
return (react_1.default.createElement(
|
|
105
|
+
return (react_1.default.createElement(leafygreen_1.Description, { "data-testid": 'file-input-description' }, description));
|
|
101
106
|
}
|
|
102
|
-
return (react_1.default.createElement(
|
|
107
|
+
return (react_1.default.createElement(leafygreen_1.Link, { "data-testid": 'file-input-link', href: link, className: (0, emotion_1.cx)(description ? infoLinkStyles : labelIconStyles), hideExternalIcon: !description }, description !== null && description !== void 0 ? description : ''));
|
|
103
108
|
};
|
|
109
|
+
const applyTheme = ((_b = (_a = global === null || global === void 0 ? void 0 : global.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.COMPASS_LG_DARKMODE) === 'true';
|
|
104
110
|
return (react_1.default.createElement("div", null,
|
|
105
111
|
react_1.default.createElement("div", { className: (0, emotion_1.cx)({ [formItemHorizontalStyles]: variant === Variant.Horizontal }, { [formItemVerticalStyles]: variant === Variant.Vertical }) },
|
|
106
112
|
react_1.default.createElement("div", { className: (0, emotion_1.cx)({
|
|
107
113
|
[labelHorizontalStyles]: variant === Variant.Horizontal,
|
|
108
114
|
}) },
|
|
109
|
-
react_1.default.createElement(
|
|
115
|
+
react_1.default.createElement(leafygreen_1.Label, { htmlFor: `${id}_file_input`, disabled: disabled },
|
|
110
116
|
react_1.default.createElement("span", { className: (0, emotion_1.cx)({
|
|
111
|
-
[
|
|
117
|
+
[applyTheme && darkMode
|
|
118
|
+
? disabledDescriptionDarkStyles
|
|
119
|
+
: disabledDescriptionLightStyles]: disabled,
|
|
112
120
|
}) }, label)),
|
|
113
121
|
optional && (react_1.default.createElement("div", { className: optionalLabelStyles }, optionalMessage ? optionalMessage : 'Optional')),
|
|
114
122
|
renderDescription()),
|
|
115
123
|
react_1.default.createElement("input", { "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : 'file-input', ref: inputRef, id: `${id}_file_input`, name: id, type: "file", multiple: multi, onChange: onFilesChanged, style: { display: 'none' }, key: values ? values.join(',') : 'empty' }),
|
|
116
|
-
react_1.default.createElement(
|
|
124
|
+
react_1.default.createElement(leafygreen_1.Button, { id: id, "data-testid": "file-input-button", className: buttonStyles, disabled: disabled, onClick: () => {
|
|
117
125
|
if (!disabled && inputRef.current) {
|
|
118
126
|
inputRef.current.click();
|
|
119
127
|
}
|
|
120
|
-
}, title: "Select a file", leftGlyph: react_1.default.createElement(
|
|
128
|
+
}, title: "Select a file", leftGlyph: react_1.default.createElement(leafygreen_1.Icon, { glyph: "AddFile", title: null, fill: "currentColor" }) }, buttonText)),
|
|
121
129
|
showFileOnNewLine &&
|
|
122
130
|
values &&
|
|
123
131
|
values.length > 0 &&
|
|
124
132
|
values.map((value, index) => (react_1.default.createElement("div", { className: removeFileLineStyles, key: value },
|
|
125
133
|
value,
|
|
126
|
-
react_1.default.createElement(
|
|
134
|
+
react_1.default.createElement(leafygreen_1.IconButton, { className: removeFileButtonStyles, "aria-label": "Remove file", onClick: () => {
|
|
127
135
|
const newValues = [...values];
|
|
128
136
|
newValues.splice(index, 1);
|
|
129
137
|
onChange(newValues);
|
|
130
138
|
} },
|
|
131
|
-
react_1.default.createElement(
|
|
132
|
-
error && errorMessage && (react_1.default.createElement(
|
|
139
|
+
react_1.default.createElement(leafygreen_1.Icon, { glyph: "X" }))))),
|
|
140
|
+
error && errorMessage && (react_1.default.createElement(leafygreen_1.Label, { "data-testid": 'file-input-error', className: errorMessageStyles, htmlFor: '' }, errorMessage))));
|
|
133
141
|
}
|
|
134
|
-
exports.default = FileInput;
|
|
142
|
+
exports.default = (0, use_theme_1.withTheme)(FileInput);
|
|
135
143
|
//# sourceMappingURL=file-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,oDAAiD;AACjD,oDAAkD;AAClD,kDAAgD;
|
|
1
|
+
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,oDAAiD;AACjD,oDAAkD;AAClD,kDAAgD;AAChD,kDAA+C;AAE/C,6CAOsB;AAEtB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,kBAAQ,CAAC,GAAG,CAAC;AAE5C,MAAM,wBAAwB,GAAG,IAAA,aAAG,EAAC;IACnC,SAAS,EAAE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AAQ,EAClB,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE;wBACjC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;qBAC1B;gBACH,CAAC,EACD,KAAK,EAAC,eAAe,EACrB,SAAS,EAAE,8BAAC,iBAAI,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,cAAc,GAAG,IAEnE,UAAU,CACJ,CACL;QACL,iBAAiB;YAChB,MAAM;YACN,MAAM,CAAC,MAAM,GAAG,CAAC;YACjB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,uCAAK,SAAS,EAAE,oBAAoB,EAAE,GAAG,EAAE,KAAK;gBAC7C,KAAK;gBACN,8BAAC,uBAAU,IACT,SAAS,EAAE,sBAAsB,gBACtB,aAAa,EACxB,OAAO,EAAE,GAAG,EAAE;wBACZ,MAAM,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;wBAC9B,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;wBAC3B,QAAQ,CAAC,SAAS,CAAC,CAAC;oBACtB,CAAC;oBAED,8BAAC,iBAAI,IAAC,KAAK,EAAC,GAAG,GAAG,CACP,CACT,CACP,CAAC;QACH,KAAK,IAAI,YAAY,IAAI,CACxB,8BAAC,kBAAK,mBACS,kBAAkB,EAC/B,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,EAAE,IAEV,YAAY,CACP,CACT,CACG,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC"}
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InlineDefinition = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const typography_1 = require("@leafygreen-ui/typography");
|
|
9
8
|
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
+
const leafygreen_1 = require("./leafygreen");
|
|
10
10
|
const tooltip_1 = require("./tooltip");
|
|
11
11
|
const merge_props_1 = require("../utils/merge-props");
|
|
12
12
|
const underline = (0, emotion_1.css)({
|
|
@@ -25,7 +25,7 @@ const InlineDefinition = ({ children, definition, tooltipProps, ...props }) => {
|
|
|
25
25
|
children,
|
|
26
26
|
tooltip));
|
|
27
27
|
}, ...tooltipProps },
|
|
28
|
-
react_1.default.createElement(
|
|
28
|
+
react_1.default.createElement(leafygreen_1.Body, { className: maxWidth }, definition)));
|
|
29
29
|
};
|
|
30
30
|
exports.InlineDefinition = InlineDefinition;
|
|
31
31
|
//# sourceMappingURL=inline-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-definition.js","sourceRoot":"","sources":["../../src/components/inline-definition.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"inline-definition.js","sourceRoot":"","sources":["../../src/components/inline-definition.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,oDAA6C;AAC7C,6CAAoC;AACpC,uCAAoC;AACpC,sDAAkD;AAElD,MAAM,SAAS,GAAG,IAAA,aAAG,EAAC;IACpB,gBAAgB,EAAE,UAAU;IAC5B,kBAAkB,EAAE,eAAe;IACnC,cAAc,EAAE,SAAS;IACzB,eAAe,EACb,0EAA0E;CAC7E,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,IAAA,aAAG,EAAC;IACnB,QAAQ,EAAE,OAAO;CAClB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAOlB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACvD,OAAO,CACL,8BAAC,iBAAO,IACN,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE,EAAE,EAAE;YAClD,MAAM,MAAM,GAAG,IAAA,wBAAU,EACvB,EAAE,SAAS,EAAE,SAAS,EAAE,EACxB,YAAY,EACZ,KAAK,CACN,CAAC;YACF,OAAO,CACL,2CAAU,MAAM;gBACb,QAAQ;gBACR,OAAO,CACH,CACR,CAAC;QACJ,CAAC,KACG,YAAY;QAEhB,8BAAC,iBAAI,IAAC,SAAS,EAAE,QAAQ,IAAG,UAAU,CAAQ,CACtC,CACX,CAAC;AACJ,CAAC,CAAC;AAEO,4CAAgB"}
|
|
@@ -7,8 +7,7 @@ exports.InlineInfoLink = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
9
|
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
10
|
-
const
|
|
11
|
-
const icon_1 = __importDefault(require("@leafygreen-ui/icon"));
|
|
10
|
+
const leafygreen_1 = require("./leafygreen");
|
|
12
11
|
const infoButtonStyles = (0, emotion_1.css)({
|
|
13
12
|
marginTop: -tokens_1.spacing[2],
|
|
14
13
|
marginBottom: -tokens_1.spacing[2],
|
|
@@ -16,8 +15,8 @@ const infoButtonStyles = (0, emotion_1.css)({
|
|
|
16
15
|
function InlineInfoLink(props) {
|
|
17
16
|
const { 'aria-label': ariaLabel, href } = props;
|
|
18
17
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
19
|
-
react_1.default.createElement(
|
|
20
|
-
react_1.default.createElement(
|
|
18
|
+
react_1.default.createElement(leafygreen_1.IconButton, { as: "a", className: infoButtonStyles, "aria-label": ariaLabel, href: href, target: "_blank" },
|
|
19
|
+
react_1.default.createElement(leafygreen_1.Icon, { glyph: "InfoWithCircle", size: "small" }))));
|
|
21
20
|
}
|
|
22
21
|
exports.InlineInfoLink = InlineInfoLink;
|
|
23
22
|
//# sourceMappingURL=inline-info-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-info-link.js","sourceRoot":"","sources":["../../src/components/inline-info-link.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oDAA6C;AAC7C,kDAAgD;
|
|
1
|
+
{"version":3,"file":"inline-info-link.js","sourceRoot":"","sources":["../../src/components/inline-info-link.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oDAA6C;AAC7C,kDAAgD;AAEhD,6CAAgD;AAEhD,MAAM,gBAAgB,GAAG,IAAA,aAAG,EAAC;IAC3B,SAAS,EAAE,CAAC,gBAAO,CAAC,CAAC,CAAC;IACtB,YAAY,EAAE,CAAC,gBAAO,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAOH,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEhD,OAAO,CACL;QACE,8BAAC,uBAAU,IACT,EAAE,EAAC,GAAG,EACN,SAAS,EAAE,gBAAgB,gBACf,SAAS,EACrB,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,QAAQ;YAEf,8BAAC,iBAAI,IAAC,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,GAAG,CACjC,CACZ,CACJ,CAAC;AACJ,CAAC;AAEQ,wCAAc"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { default as Badge } from '@leafygreen-ui/badge';
|
|
3
|
+
import { default as Banner } from '@leafygreen-ui/banner';
|
|
4
|
+
import { default as LeafyGreenCheckbox } from '@leafygreen-ui/checkbox';
|
|
5
|
+
import { default as LeafyGreenCard } from '@leafygreen-ui/card';
|
|
6
|
+
import { default as LeafyGreenConfirmationModal } from '@leafygreen-ui/confirmation-modal';
|
|
7
|
+
import { default as Icon } from '@leafygreen-ui/icon';
|
|
8
|
+
import { default as LeafyGreenIconButton } from '@leafygreen-ui/icon-button';
|
|
9
|
+
import { AtlasLogoMark, MongoDBLogoMark, MongoDBLogo } from '@leafygreen-ui/logo';
|
|
10
|
+
import { Menu, MenuSeparator, MenuItem } from '@leafygreen-ui/menu';
|
|
11
|
+
import { default as LeafyGreenModal, Footer as LeafyGreenModalFooter } from '@leafygreen-ui/modal';
|
|
12
|
+
import { RadioBox, RadioBoxGroup } from '@leafygreen-ui/radio-box-group';
|
|
13
|
+
import { Radio, RadioGroup as LeafyGreenRadioGroup } from '@leafygreen-ui/radio-group';
|
|
14
|
+
import { SegmentedControlOption } from '@leafygreen-ui/segmented-control';
|
|
15
|
+
import { Select as LeafyGreenSelect, Option, OptionGroup } from '@leafygreen-ui/select';
|
|
16
|
+
import { Table as LeafyGreenTable, TableHeader, Row, Cell } from '@leafygreen-ui/table';
|
|
17
|
+
import { Tabs as LeafyGreenTabs, Tab } from '@leafygreen-ui/tabs';
|
|
18
|
+
import { default as LeafyGreenTextArea } from '@leafygreen-ui/text-area';
|
|
19
|
+
import { default as LeafyGreenTextInput } from '@leafygreen-ui/text-input';
|
|
20
|
+
import { default as Toast } from '@leafygreen-ui/toast';
|
|
21
|
+
import { default as LeafyGreenToggle } from '@leafygreen-ui/toggle';
|
|
22
|
+
import { default as LeafyGreenTooltip } from '@leafygreen-ui/tooltip';
|
|
23
|
+
import { H1, H2, H3, Subtitle, Body, InlineCode, InlineKeyCode, Disclaimer, Overline, Link } from '@leafygreen-ui/typography';
|
|
24
|
+
declare const Button: import("@leafygreen-ui/box").ExtendableBox<import("@leafygreen-ui/button/dist/types").ButtonProps & {
|
|
25
|
+
ref?: React.Ref<any> | undefined;
|
|
26
|
+
}, "button">;
|
|
27
|
+
declare const Card: typeof LeafyGreenCard;
|
|
28
|
+
declare const Checkbox: typeof LeafyGreenCheckbox;
|
|
29
|
+
declare const ConfirmationModal: typeof LeafyGreenConfirmationModal;
|
|
30
|
+
declare const IconButton: typeof LeafyGreenIconButton;
|
|
31
|
+
declare const ModalFooter: typeof LeafyGreenModalFooter;
|
|
32
|
+
declare const Modal: typeof LeafyGreenModal;
|
|
33
|
+
declare const RadioGroup: typeof LeafyGreenRadioGroup;
|
|
34
|
+
declare const SegmentedControl: React.ForwardRefExoticComponent<import("@leafygreen-ui/segmented-control/dist/SegmentedControl").SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const Select: typeof LeafyGreenSelect;
|
|
36
|
+
declare const Table: typeof LeafyGreenTable;
|
|
37
|
+
declare const Tabs: typeof LeafyGreenTabs;
|
|
38
|
+
declare const TextArea: typeof LeafyGreenTextArea;
|
|
39
|
+
declare const TextInput: typeof LeafyGreenTextInput;
|
|
40
|
+
declare const Toggle: typeof LeafyGreenToggle;
|
|
41
|
+
declare const Tooltip: typeof LeafyGreenTooltip;
|
|
42
|
+
declare const Label: {
|
|
43
|
+
({ darkMode, className, children, disabled, ...rest }: Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
44
|
+
ref?: undefined;
|
|
45
|
+
key?: React.Key | null | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
darkMode?: boolean | undefined;
|
|
48
|
+
htmlFor: string;
|
|
49
|
+
disabled?: boolean | undefined;
|
|
50
|
+
}): JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
declare const Description: {
|
|
54
|
+
({ darkMode, children, className, ...rest }: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
55
|
+
ref?: undefined;
|
|
56
|
+
key?: React.Key | null | undefined;
|
|
57
|
+
} & {
|
|
58
|
+
darkMode?: boolean | undefined;
|
|
59
|
+
}): JSX.Element;
|
|
60
|
+
displayName: string;
|
|
61
|
+
};
|
|
62
|
+
export { AtlasLogoMark, Badge, Banner, Button, Card, Checkbox, ConfirmationModal, Icon, IconButton, Menu, MenuItem, MenuSeparator, Modal, ModalFooter, MongoDBLogoMark, MongoDBLogo, RadioBox, RadioBoxGroup, Radio, RadioGroup, SegmentedControl, SegmentedControlOption, Select, Option, OptionGroup, Table, TableHeader, Row, Cell, Tab, Tabs, TextArea, TextInput, Toast, Toggle, Tooltip, H1, H2, H3, Subtitle, Body, InlineCode, InlineKeyCode, Disclaimer, Overline, Label, Link, Description, };
|
|
63
|
+
//# sourceMappingURL=leafygreen.d.ts.map
|