@mongodb-js/compass-components 1.8.0 → 1.10.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/components/combobox/Combobox.d.ts.map +1 -1
- package/lib/components/combobox/Combobox.js +15 -10
- package/lib/components/combobox/Combobox.js.map +1 -1
- package/lib/components/combobox-with-custom-option.d.ts +6 -5
- package/lib/components/combobox-with-custom-option.d.ts.map +1 -1
- package/lib/components/combobox-with-custom-option.js +13 -9
- package/lib/components/combobox-with-custom-option.js.map +1 -1
- package/lib/components/document-list/element-editors.d.ts.map +1 -1
- package/lib/components/document-list/element-editors.js +8 -1
- package/lib/components/document-list/element-editors.js.map +1 -1
- package/lib/components/file-input.js +1 -1
- package/lib/components/file-input.js.map +1 -1
- package/lib/components/index-icon.d.ts +1 -1
- package/lib/components/index-icon.d.ts.map +1 -1
- package/lib/components/index-keys-badge.d.ts +5 -1
- package/lib/components/index-keys-badge.d.ts.map +1 -1
- package/lib/components/index-keys-badge.js +7 -1
- package/lib/components/index-keys-badge.js.map +1 -1
- package/lib/components/inline-definition.d.ts +1 -1
- package/lib/components/inline-definition.d.ts.map +1 -1
- package/lib/components/keyline-card.d.ts +1 -1
- package/lib/components/keyline-card.d.ts.map +1 -1
- package/lib/components/keyline-card.js +26 -6
- package/lib/components/keyline-card.js.map +1 -1
- package/lib/components/leafygreen.d.ts +3 -2
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +7 -5
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/list-editor.d.ts +3 -1
- package/lib/components/list-editor.d.ts.map +1 -1
- package/lib/components/list-editor.js +11 -8
- package/lib/components/list-editor.js.map +1 -1
- package/lib/components/loader.d.ts +21 -0
- package/lib/components/loader.d.ts.map +1 -0
- package/lib/components/loader.js +70 -0
- package/lib/components/loader.js.map +1 -0
- package/lib/components/modals/modal-header.d.ts +3 -3
- package/lib/components/modals/modal-header.d.ts.map +1 -1
- package/lib/components/modals/modal.d.ts +3 -1
- package/lib/components/modals/modal.d.ts.map +1 -1
- package/lib/components/modals/modal.js +24 -2
- package/lib/components/modals/modal.js.map +1 -1
- package/lib/components/more-options-toggle.d.ts +2 -0
- package/lib/components/more-options-toggle.d.ts.map +1 -1
- package/lib/components/more-options-toggle.js +19 -9
- package/lib/components/more-options-toggle.js.map +1 -1
- package/lib/components/resizeable-sidebar.d.ts.map +1 -1
- package/lib/components/resizeable-sidebar.js +3 -1
- package/lib/components/resizeable-sidebar.js.map +1 -1
- package/lib/components/workspace-tabs/tab.js +1 -1
- package/lib/components/workspace-tabs/tab.js.map +1 -1
- package/lib/hooks/use-persisted-state.d.ts +4 -0
- package/lib/hooks/use-persisted-state.d.ts.map +1 -0
- package/lib/hooks/use-persisted-state.js +30 -0
- package/lib/hooks/use-persisted-state.js.map +1 -0
- package/lib/hooks/use-toast.d.ts +4 -11
- package/lib/hooks/use-toast.d.ts.map +1 -1
- package/lib/hooks/use-toast.js +39 -26
- package/lib/hooks/use-toast.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -8
- package/lib/index.js.map +1 -1
- package/package.json +17 -19
- package/lib/components/cancel-loader.d.ts +0 -9
- package/lib/components/cancel-loader.d.ts.map +0 -1
- package/lib/components/cancel-loader.js +0 -36
- package/lib/components/cancel-loader.js.map +0 -1
- package/lib/components/spin-loader.d.ts +0 -9
- package/lib/components/spin-loader.d.ts.map +0 -1
- package/lib/components/spin-loader.js +0 -39
- package/lib/components/spin-loader.js.map +0 -1
package/lib/hooks/use-toast.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
type ToastProperties = {
|
|
5
|
-
title?: React.ReactNode;
|
|
6
|
-
body: React.ReactNode;
|
|
7
|
-
variant: ToastVariant;
|
|
8
|
-
progress?: number;
|
|
9
|
-
timeout?: number;
|
|
10
|
-
dismissible?: boolean;
|
|
11
|
-
};
|
|
2
|
+
import type { ToastProps } from '../components/leafygreen';
|
|
3
|
+
export type ToastProperties = Pick<ToastProps, 'title' | 'description' | 'variant' | 'progress' | 'timeout' | 'dismissible'>;
|
|
12
4
|
interface ToastActions {
|
|
13
5
|
openToast: (id: string, toastProperties: ToastProperties) => void;
|
|
14
6
|
closeToast: (id: string) => void;
|
|
15
7
|
}
|
|
16
|
-
export declare const openToast: (id: string,
|
|
8
|
+
export declare const openToast: (id: string, props: ToastProperties) => void;
|
|
17
9
|
export declare const closeToast: (id: string) => void;
|
|
18
10
|
export declare const ToastArea: React.FunctionComponent;
|
|
19
11
|
export declare function useToast(namespace: string): ToastActions;
|
|
12
|
+
export {};
|
|
20
13
|
//# sourceMappingURL=use-toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAM3D,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,UAAU,EACV,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAC7E,CAAC;AAMF,UAAU,YAAY;IACpB,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,KAAK,IAAI,CAAC;IAClE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAsED,eAAO,MAAM,SAAS,OAjDN,MAAM,SAAS,eAAe,KAAG,IAiDa,CAAC;AAE/D,eAAO,MAAM,UAAU,OA9BN,MAAM,KAAG,IA8BsC,CAAC;AAyDjE,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAM7B,CAAC;AAiBF,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAsBxD"}
|
package/lib/hooks/use-toast.js
CHANGED
|
@@ -23,11 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useToast = exports.ToastArea = exports.closeToast = exports.openToast =
|
|
26
|
+
exports.useToast = exports.ToastArea = exports.closeToast = exports.openToast = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const leafygreen_1 = require("../components/leafygreen");
|
|
29
|
-
Object.defineProperty(exports, "ToastVariant", { enumerable: true, get: function () { return leafygreen_1.ToastVariant; } });
|
|
30
|
-
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
31
29
|
const defaultToastProperties = {
|
|
32
30
|
dismissible: true,
|
|
33
31
|
};
|
|
@@ -38,23 +36,28 @@ class GlobalToastState {
|
|
|
38
36
|
this.onToastsChange = () => {
|
|
39
37
|
};
|
|
40
38
|
}
|
|
41
|
-
openToast(id,
|
|
39
|
+
openToast(id, props) {
|
|
42
40
|
this.clearTimeout(id);
|
|
43
|
-
|
|
41
|
+
const toastProps = {
|
|
44
42
|
...defaultToastProperties,
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
...props,
|
|
44
|
+
'data-testid': `toast-${id}`,
|
|
45
|
+
onClose: () => {
|
|
46
|
+
this.closeToast(id);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
this.toasts.set(id, toastProps);
|
|
50
|
+
if (toastProps.timeout) {
|
|
48
51
|
this.timeouts.set(id, setTimeout(() => {
|
|
49
52
|
this.closeToast(id);
|
|
50
|
-
},
|
|
53
|
+
}, toastProps.timeout));
|
|
51
54
|
}
|
|
52
|
-
this.onToastsChange(
|
|
55
|
+
this.onToastsChange('push', { id, ...toastProps }, this.toasts);
|
|
53
56
|
}
|
|
54
57
|
closeToast(id) {
|
|
55
58
|
this.clearTimeout(id);
|
|
56
59
|
this.toasts.delete(id);
|
|
57
|
-
this.onToastsChange(
|
|
60
|
+
this.onToastsChange('pop', { id }, this.toasts);
|
|
58
61
|
}
|
|
59
62
|
clearTimeout(id) {
|
|
60
63
|
if (id) {
|
|
@@ -72,42 +75,52 @@ class GlobalToastState {
|
|
|
72
75
|
}
|
|
73
76
|
clear() {
|
|
74
77
|
this.clearTimeout();
|
|
78
|
+
const ids = Array.from(this.toasts.keys());
|
|
75
79
|
this.toasts.clear();
|
|
80
|
+
return ids;
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
const toastState = new GlobalToastState();
|
|
79
84
|
exports.openToast = toastState.openToast.bind(toastState);
|
|
80
85
|
exports.closeToast = toastState.closeToast.bind(toastState);
|
|
86
|
+
const toastActions = { openToast: exports.openToast, closeToast: exports.closeToast };
|
|
81
87
|
const ToastContext = (0, react_1.createContext)({
|
|
82
88
|
openToast: () => {
|
|
83
89
|
},
|
|
84
90
|
closeToast: () => {
|
|
85
91
|
},
|
|
86
92
|
});
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
position: 'absolute',
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
const ToastArea = ({ children }) => {
|
|
93
|
-
const [toasts, setToasts] = (0, react_1.useState)([]);
|
|
93
|
+
const _ToastArea = ({ children }) => {
|
|
94
|
+
const toastRef = (0, react_1.useRef)((0, leafygreen_1.useToast)());
|
|
94
95
|
const toastStateRef = (0, react_1.useRef)();
|
|
95
96
|
if (!toastStateRef.current) {
|
|
96
97
|
toastStateRef.current = toastState;
|
|
97
|
-
toastStateRef.current.onToastsChange =
|
|
98
|
+
toastStateRef.current.onToastsChange = (action, toast) => {
|
|
99
|
+
if (action === 'push') {
|
|
100
|
+
toastRef.current.pushToast({
|
|
101
|
+
...toast,
|
|
102
|
+
timeout: null,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (action === 'pop') {
|
|
106
|
+
toastRef.current.popToast(toast.id);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
98
109
|
}
|
|
99
|
-
const toastActions = (0, react_1.useMemo)(() => {
|
|
100
|
-
return { openToast: exports.openToast, closeToast: exports.closeToast };
|
|
101
|
-
}, []);
|
|
102
110
|
(0, react_1.useEffect)(() => {
|
|
103
111
|
return () => {
|
|
104
112
|
var _a;
|
|
105
|
-
(_a = toastStateRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
113
|
+
const ids = (_a = toastStateRef.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
114
|
+
ids === null || ids === void 0 ? void 0 : ids.forEach((id) => {
|
|
115
|
+
toastRef.current.popToast(id);
|
|
116
|
+
});
|
|
106
117
|
};
|
|
107
118
|
}, []);
|
|
108
|
-
return (react_1.default.createElement(ToastContext.Provider, { value: toastActions },
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
return (react_1.default.createElement(ToastContext.Provider, { value: toastActions }, children));
|
|
120
|
+
};
|
|
121
|
+
const ToastArea = ({ children }) => {
|
|
122
|
+
return (react_1.default.createElement(leafygreen_1.ToastProvider, null,
|
|
123
|
+
react_1.default.createElement(_ToastArea, null, children)));
|
|
111
124
|
};
|
|
112
125
|
exports.ToastArea = ToastArea;
|
|
113
126
|
function useToast(namespace) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.js","sourceRoot":"","sources":["../../src/hooks/use-toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"use-toast.js","sourceRoot":"","sources":["../../src/hooks/use-toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AAEf,yDAGkC;AAOlC,MAAM,sBAAsB,GAA6B;IACvD,WAAW,EAAE,IAAI;CAClB,CAAC;AAoBF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,YAAY,CAAC,CAAC;IAE3B,MAAM,SAAS,GAAG,IAAA,mBAAW,EAC3B,CAAC,OAAe,EAAE,eAAgC,EAAQ,EAAE;QAC1D,eAAe,CAAC,GAAG,SAAS,KAAK,OAAO,EAAE,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC,EACD,CAAC,SAAS,EAAE,eAAe,CAAC,CAC7B,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,CAAC,OAAe,EAAQ,EAAE;QACxB,gBAAgB,CAAC,GAAG,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC,EACD,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAC9B,CAAC;IAEF,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC;AAtBD,4BAsBC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export * from './components/leafygreen';
|
|
2
2
|
export { default as emotion, flush, hydrate, cx, merge, getRegisteredStyles, injectGlobal, keyframes, css, sheet, cache, } from '@leafygreen-ui/emotion';
|
|
3
|
-
import CancelLoader from './components/cancel-loader';
|
|
4
3
|
import ConfirmationModal from './components/modals/confirmation-modal';
|
|
5
4
|
import FileInput, { ElectronFileDialogOptions, ElectronShowFileDialogProvider, createElectronFileInputBackend, FileInputBackend } from './components/file-input';
|
|
6
5
|
import { MoreOptionsToggle } from './components/more-options-toggle';
|
|
7
6
|
import { ErrorSummary, WarningSummary } from './components/error-warning-summary';
|
|
8
7
|
import { RadioBoxGroup } from './components/radio-box-group';
|
|
9
|
-
|
|
8
|
+
export { SpinLoader, SpinLoaderWithLabel, CancelLoader, } from './components/loader';
|
|
10
9
|
import { ResizeHandle, ResizeDirection } from './components/resize-handle';
|
|
11
10
|
import { Accordion } from './components/accordion';
|
|
12
11
|
import { CollapsibleFieldSet } from './components/collapsible-field-set';
|
|
@@ -28,7 +27,7 @@ export { Size as SelectSize } from '@leafygreen-ui/select';
|
|
|
28
27
|
export { useId } from '@react-aria/utils';
|
|
29
28
|
export { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
30
29
|
export { GuideCue } from '@leafygreen-ui/guide-cue';
|
|
31
|
-
export { useToast, openToast, closeToast, ToastArea
|
|
30
|
+
export { useToast, openToast, closeToast, ToastArea } from './hooks/use-toast';
|
|
32
31
|
export { breakpoints, spacing } from '@leafygreen-ui/tokens';
|
|
33
32
|
export { Tooltip } from './components/tooltip';
|
|
34
33
|
import IndexIcon from './components/index-icon';
|
|
@@ -38,7 +37,7 @@ export { ModalBody } from './components/modals/modal-body';
|
|
|
38
37
|
export { ModalHeader } from './components/modals/modal-header';
|
|
39
38
|
export { FormModal } from './components/modals/form-modal';
|
|
40
39
|
export { InfoModal } from './components/modals/info-modal';
|
|
41
|
-
export { Accordion, CollapsibleFieldSet,
|
|
40
|
+
export { Accordion, CollapsibleFieldSet, ConfirmationModal, ErrorSummary, FileInput, FileInputBackend, IndexIcon, MoreOptionsToggle, RadioBoxGroup, ResizeHandle, ResizeDirection, ResizableSidebar, WarningSummary, WorkspaceTabs, ItemAction, MenuAction, ItemActionControls, ItemActionGroup, ItemActionMenu, DropdownMenuButton, defaultSidebarWidth, ElectronFileDialogOptions, ElectronShowFileDialogProvider, createElectronFileInputBackend, };
|
|
42
41
|
export { useFocusState, useHoverState, FocusState, } from './hooks/use-focus-hover';
|
|
43
42
|
export { getScrollbarStyles, useScrollbars } from './hooks/use-scrollbars';
|
|
44
43
|
export { withDarkMode, useDarkMode, Theme, ThemeProvider, } from './hooks/use-theme';
|
|
@@ -69,10 +68,11 @@ export { KeylineCard } from './components/keyline-card';
|
|
|
69
68
|
export { variantColors as codePalette } from '@leafygreen-ui/code';
|
|
70
69
|
export { useEffectOnChange } from './hooks/use-effect-on-change';
|
|
71
70
|
export { HorizontalRule } from './components/horizontal-rule';
|
|
72
|
-
export { IndexKeysBadge } from './components/index-keys-badge';
|
|
71
|
+
export { IndexBadge, IndexKeysBadge } from './components/index-keys-badge';
|
|
73
72
|
export { Combobox, ComboboxOption, ComboboxGroup } from './components/combobox';
|
|
74
73
|
export { useConfirmationModal, ConfirmationModalVariant, ConfirmationModalArea, showConfirmation, } from './hooks/use-confirmation';
|
|
75
74
|
export { useHotkeys, formatHotkey, KeyboardShortcut, } from './hooks/use-hotkeys';
|
|
76
75
|
export { rafraf } from './utils/rafraf';
|
|
77
76
|
export { ComboboxWithCustomOption } from './components/combobox-with-custom-option';
|
|
77
|
+
export { usePersistedState } from './hooks/use-persisted-state';
|
|
78
78
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,EACL,OAAO,EACP,EAAE,EACF,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,EACH,KAAK,EACL,KAAK,GACN,MAAM,wBAAwB,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,EACL,OAAO,EACP,EAAE,EACF,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,EACH,KAAK,EACL,KAAK,GACN,MAAM,wBAAwB,CAAC;AAChC,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,SAAS,EAAE,EAChB,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,cAAc,EACf,MAAM,oCAAoC,CAAC;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OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -29,9 +29,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.
|
|
33
|
-
exports.HorizontalRule = exports.useEffectOnChange = exports.codePalette = exports.KeylineCard = exports.DocumentList = exports.BSONValue = exports.fontFamilies = exports.useFormattedDate = exports.useSortedItems = exports.useSortControls = exports.useDefaultAction = exports.useFocusRing = exports.focusRing = exports.mergeProps = exports.VirtualGrid = exports.useDOMRect = exports.Placeholder = exports.ListEditor = exports.InteractivePopover = exports.InlineInfoLink = exports.WorkspaceContainer = exports.TabNavBar = exports.StoreConnector = exports.ErrorBoundary = exports.EmptyContent = exports.InlineDefinition = exports.FadeInPlaceholder = exports.ContentWithFallback = exports.ThemeProvider = exports.Theme = exports.useDarkMode = exports.withDarkMode = exports.useScrollbars = exports.getScrollbarStyles = exports.FocusState = exports.useHoverState = exports.useFocusState = exports.createElectronFileInputBackend = exports.defaultSidebarWidth = exports.DropdownMenuButton = exports.ItemActionMenu = exports.ItemActionGroup = exports.ItemActionControls = exports.WorkspaceTabs = exports.WarningSummary = exports.ResizableSidebar = exports.ResizeDirection = exports.ResizeHandle = exports.
|
|
34
|
-
exports.ComboboxWithCustomOption = exports.rafraf = exports.KeyboardShortcut = exports.formatHotkey = exports.useHotkeys = exports.showConfirmation = exports.ConfirmationModalArea = exports.ConfirmationModalVariant = exports.useConfirmationModal = exports.ComboboxGroup = exports.ComboboxOption = exports.Combobox = exports.IndexKeysBadge = void 0;
|
|
32
|
+
exports.IndexIcon = exports.FileInput = exports.ErrorSummary = exports.ConfirmationModal = exports.CollapsibleFieldSet = exports.Accordion = exports.InfoModal = exports.FormModal = exports.ModalHeader = exports.ModalBody = exports.Modal = exports.FormFieldContainer = exports.Tooltip = exports.spacing = exports.breakpoints = exports.ToastArea = exports.closeToast = exports.openToast = exports.useToast = exports.GuideCue = exports.VisuallyHidden = exports.useId = exports.SelectSize = exports.RadioBoxSize = exports.Portal = exports.lighten = exports.rgba = exports.palette = exports.LeafyGreenProvider = exports.ButtonVariant = exports.ButtonSize = exports.BannerVariant = exports.BadgeVariant = exports.NoSavedItemsIcon = exports.FavoriteIcon = exports.DocumentIcon = exports.CancelLoader = exports.SpinLoaderWithLabel = exports.SpinLoader = exports.cache = exports.sheet = exports.css = exports.keyframes = exports.injectGlobal = exports.getRegisteredStyles = exports.merge = exports.cx = exports.hydrate = exports.flush = exports.emotion = void 0;
|
|
33
|
+
exports.HorizontalRule = exports.useEffectOnChange = exports.codePalette = exports.KeylineCard = exports.DocumentList = exports.BSONValue = exports.fontFamilies = exports.useFormattedDate = exports.useSortedItems = exports.useSortControls = exports.useDefaultAction = exports.useFocusRing = exports.focusRing = exports.mergeProps = exports.VirtualGrid = exports.useDOMRect = exports.Placeholder = exports.ListEditor = exports.InteractivePopover = exports.InlineInfoLink = exports.WorkspaceContainer = exports.TabNavBar = exports.StoreConnector = exports.ErrorBoundary = exports.EmptyContent = exports.InlineDefinition = exports.FadeInPlaceholder = exports.ContentWithFallback = exports.ThemeProvider = exports.Theme = exports.useDarkMode = exports.withDarkMode = exports.useScrollbars = exports.getScrollbarStyles = exports.FocusState = exports.useHoverState = exports.useFocusState = exports.createElectronFileInputBackend = exports.defaultSidebarWidth = exports.DropdownMenuButton = exports.ItemActionMenu = exports.ItemActionGroup = exports.ItemActionControls = exports.WorkspaceTabs = exports.WarningSummary = exports.ResizableSidebar = exports.ResizeDirection = exports.ResizeHandle = exports.RadioBoxGroup = exports.MoreOptionsToggle = void 0;
|
|
34
|
+
exports.usePersistedState = exports.ComboboxWithCustomOption = exports.rafraf = exports.KeyboardShortcut = exports.formatHotkey = exports.useHotkeys = exports.showConfirmation = exports.ConfirmationModalArea = exports.ConfirmationModalVariant = exports.useConfirmationModal = exports.ComboboxGroup = exports.ComboboxOption = exports.Combobox = exports.IndexKeysBadge = exports.IndexBadge = void 0;
|
|
35
35
|
__exportStar(require("./components/leafygreen"), exports);
|
|
36
36
|
var emotion_1 = require("@leafygreen-ui/emotion");
|
|
37
37
|
Object.defineProperty(exports, "emotion", { enumerable: true, get: function () { return __importDefault(emotion_1).default; } });
|
|
@@ -45,8 +45,6 @@ Object.defineProperty(exports, "keyframes", { enumerable: true, get: function ()
|
|
|
45
45
|
Object.defineProperty(exports, "css", { enumerable: true, get: function () { return emotion_1.css; } });
|
|
46
46
|
Object.defineProperty(exports, "sheet", { enumerable: true, get: function () { return emotion_1.sheet; } });
|
|
47
47
|
Object.defineProperty(exports, "cache", { enumerable: true, get: function () { return emotion_1.cache; } });
|
|
48
|
-
const cancel_loader_1 = __importDefault(require("./components/cancel-loader"));
|
|
49
|
-
exports.CancelLoader = cancel_loader_1.default;
|
|
50
48
|
const confirmation_modal_1 = __importDefault(require("./components/modals/confirmation-modal"));
|
|
51
49
|
exports.ConfirmationModal = confirmation_modal_1.default;
|
|
52
50
|
const file_input_1 = __importStar(require("./components/file-input"));
|
|
@@ -59,8 +57,10 @@ Object.defineProperty(exports, "ErrorSummary", { enumerable: true, get: function
|
|
|
59
57
|
Object.defineProperty(exports, "WarningSummary", { enumerable: true, get: function () { return error_warning_summary_1.WarningSummary; } });
|
|
60
58
|
const radio_box_group_1 = require("./components/radio-box-group");
|
|
61
59
|
Object.defineProperty(exports, "RadioBoxGroup", { enumerable: true, get: function () { return radio_box_group_1.RadioBoxGroup; } });
|
|
62
|
-
|
|
63
|
-
Object.defineProperty(exports, "SpinLoader", { enumerable: true, get: function () { return
|
|
60
|
+
var loader_1 = require("./components/loader");
|
|
61
|
+
Object.defineProperty(exports, "SpinLoader", { enumerable: true, get: function () { return loader_1.SpinLoader; } });
|
|
62
|
+
Object.defineProperty(exports, "SpinLoaderWithLabel", { enumerable: true, get: function () { return loader_1.SpinLoaderWithLabel; } });
|
|
63
|
+
Object.defineProperty(exports, "CancelLoader", { enumerable: true, get: function () { return loader_1.CancelLoader; } });
|
|
64
64
|
const resize_handle_1 = require("./components/resize-handle");
|
|
65
65
|
Object.defineProperty(exports, "ResizeHandle", { enumerable: true, get: function () { return resize_handle_1.ResizeHandle; } });
|
|
66
66
|
Object.defineProperty(exports, "ResizeDirection", { enumerable: true, get: function () { return resize_handle_1.ResizeDirection; } });
|
|
@@ -115,7 +115,6 @@ Object.defineProperty(exports, "useToast", { enumerable: true, get: function ()
|
|
|
115
115
|
Object.defineProperty(exports, "openToast", { enumerable: true, get: function () { return use_toast_1.openToast; } });
|
|
116
116
|
Object.defineProperty(exports, "closeToast", { enumerable: true, get: function () { return use_toast_1.closeToast; } });
|
|
117
117
|
Object.defineProperty(exports, "ToastArea", { enumerable: true, get: function () { return use_toast_1.ToastArea; } });
|
|
118
|
-
Object.defineProperty(exports, "ToastVariant", { enumerable: true, get: function () { return use_toast_1.ToastVariant; } });
|
|
119
118
|
var tokens_1 = require("@leafygreen-ui/tokens");
|
|
120
119
|
Object.defineProperty(exports, "breakpoints", { enumerable: true, get: function () { return tokens_1.breakpoints; } });
|
|
121
120
|
Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return tokens_1.spacing; } });
|
|
@@ -200,6 +199,7 @@ Object.defineProperty(exports, "useEffectOnChange", { enumerable: true, get: fun
|
|
|
200
199
|
var horizontal_rule_1 = require("./components/horizontal-rule");
|
|
201
200
|
Object.defineProperty(exports, "HorizontalRule", { enumerable: true, get: function () { return horizontal_rule_1.HorizontalRule; } });
|
|
202
201
|
var index_keys_badge_1 = require("./components/index-keys-badge");
|
|
202
|
+
Object.defineProperty(exports, "IndexBadge", { enumerable: true, get: function () { return index_keys_badge_1.IndexBadge; } });
|
|
203
203
|
Object.defineProperty(exports, "IndexKeysBadge", { enumerable: true, get: function () { return index_keys_badge_1.IndexKeysBadge; } });
|
|
204
204
|
var combobox_1 = require("./components/combobox");
|
|
205
205
|
Object.defineProperty(exports, "Combobox", { enumerable: true, get: function () { return combobox_1.Combobox; } });
|
|
@@ -218,4 +218,6 @@ var rafraf_1 = require("./utils/rafraf");
|
|
|
218
218
|
Object.defineProperty(exports, "rafraf", { enumerable: true, get: function () { return rafraf_1.rafraf; } });
|
|
219
219
|
var combobox_with_custom_option_1 = require("./components/combobox-with-custom-option");
|
|
220
220
|
Object.defineProperty(exports, "ComboboxWithCustomOption", { enumerable: true, get: function () { return combobox_with_custom_option_1.ComboboxWithCustomOption; } });
|
|
221
|
+
var use_persisted_state_1 = require("./hooks/use-persisted-state");
|
|
222
|
+
Object.defineProperty(exports, "usePersistedState", { enumerable: true, get: function () { return use_persisted_state_1.usePersistedState; } });
|
|
221
223
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAwC;AAExC,kDAYgC;AAX9B,mHAAA,OAAO,OAAW;AAClB,gGAAA,KAAK,OAAA;AACL,kGAAA,OAAO,OAAA;AACP,6FAAA,EAAE,OAAA;AACF,gGAAA,KAAK,OAAA;AACL,8GAAA,mBAAmB,OAAA;AACnB,uGAAA,YAAY,OAAA;AACZ,oGAAA,SAAS,OAAA;AACT,8FAAA,GAAG,OAAA;AACH,gGAAA,KAAK,OAAA;AACL,gGAAA,KAAK,OAAA;AAEP
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAwC;AAExC,kDAYgC;AAX9B,mHAAA,OAAO,OAAW;AAClB,gGAAA,KAAK,OAAA;AACL,kGAAA,OAAO,OAAA;AACP,6FAAA,EAAE,OAAA;AACF,gGAAA,KAAK,OAAA;AACL,8GAAA,mBAAmB,OAAA;AACnB,uGAAA,YAAY,OAAA;AACZ,oGAAA,SAAS,OAAA;AACT,8FAAA,GAAG,OAAA;AACH,gGAAA,KAAK,OAAA;AACL,gGAAA,KAAK,OAAA;AAEP,gGAAuE;AAuErE,4BAvEK,4BAAiB,CAuEL;AAtEnB,sEAKiC;AAmE/B,oBAxEK,oBAAS,CAwEL;AAmBT,+GAxFA,2CAA8B,OAwFA;AArFhC,0EAAqE;AAqEnE,kGArEO,uCAAiB,OAqEP;AApEnB,8EAG4C;AA6D1C,6FA/DA,oCAAY,OA+DA;AASZ,+FAvEA,sCAAc,OAuEA;AArEhB,kEAA6D;AAiE3D,8FAjEO,+BAAa,OAiEP;AAhEf,8CAI6B;AAH3B,oGAAA,UAAU,OAAA;AACV,6GAAA,mBAAmB,OAAA;AACnB,sGAAA,YAAY,OAAA;AA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AA,WAAW,OAAA;AACpB,mDAAiD;AAAxC,yGAAA,UAAU,OAAA;AACnB,yDAAiE;AAAxD,2GAAA,SAAS,OAAA;AAAE,8GAAA,YAAY,OAAA;AAChC,iEAA8D;AAArD,sHAAA,gBAAgB,OAAA;AACzB,6CAAmE;AAA1D,2GAAA,eAAe,OAAA;AAAE,0GAAA,cAAc,OAAA;AACxC,iEAA8D;AAArD,sHAAA,gBAAgB,OAAA;AACzB,gDAAqD;AAA5C,sGAAA,YAAY,OAAA;AACrB,sDAA+D;AAAtD,wHAAA,OAAO,OAAa;AAC7B,2EAA2D;AAC3D,0DAAwD;AAA/C,2GAAA,WAAW,OAAA;AACpB,4CAAmE;AAA1D,mGAAA,aAAa,OAAe;AACrC,qEAAiE;AAAxD,yHAAA,iBAAiB,OAAA;AAC1B,gEAA8D;AAArD,iHAAA,cAAc,OAAA;AACvB,kEAA2E;AAAlE,8GAAA,UAAU,OAAA;AAAE,kHAAA,cAAc,OAAA;AACnC,kDAAgF;AAAvE,oGAAA,QAAQ,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,yGAAA,aAAa,OAAA;AAChD,6DAKkC;AAJhC,wHAAA,oBAAoB,OAAA;AACpB,4HAAA,wBAAwB,OAAA;AACxB,yHAAA,qBAAqB,OAAA;AACrB,oHAAA,gBAAgB,OAAA;AAElB,mDAI6B;AAH3B,yGAAA,UAAU,OAAA;AACV,2GAAA,YAAY,OAAA;AACZ,+GAAA,gBAAgB,OAAA;AAElB,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AACf,wFAAoF;AAA3E,uIAAA,wBAAwB,OAAA;AACjC,mEAAgE;AAAvD,wHAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongodb-js/compass-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "React Components used in Compass",
|
|
5
5
|
"license": "SSPL",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"bootstrap": "npm run compile",
|
|
17
17
|
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
|
|
18
|
-
"clean": "
|
|
18
|
+
"clean": "node -e \"fs.rmSync('lib', { recursive: true, force: true })\" || true",
|
|
19
19
|
"precompile": "npm run clean",
|
|
20
20
|
"compile": "tsc -p tsconfig.json",
|
|
21
21
|
"eslint": "eslint",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@leafygreen-ui/banner": "^7.0.1",
|
|
39
39
|
"@leafygreen-ui/button": "^19.0.3",
|
|
40
40
|
"@leafygreen-ui/card": "^9.0.2",
|
|
41
|
-
"@leafygreen-ui/checkbox": "^12.0.
|
|
41
|
+
"@leafygreen-ui/checkbox": "^12.0.8",
|
|
42
42
|
"@leafygreen-ui/code": "^14.1.0",
|
|
43
43
|
"@leafygreen-ui/confirmation-modal": "^4.0.1",
|
|
44
44
|
"@leafygreen-ui/emotion": "^4.0.3",
|
|
45
45
|
"@leafygreen-ui/guide-cue": "^4.0.0",
|
|
46
46
|
"@leafygreen-ui/hooks": "^7.3.3",
|
|
47
|
-
"@leafygreen-ui/icon": "^11.
|
|
47
|
+
"@leafygreen-ui/icon": "^11.16.0",
|
|
48
48
|
"@leafygreen-ui/icon-button": "^15.0.3",
|
|
49
49
|
"@leafygreen-ui/inline-definition": "^6.0.0",
|
|
50
50
|
"@leafygreen-ui/leafygreen-provider": "^3.1.0",
|
|
@@ -57,15 +57,16 @@
|
|
|
57
57
|
"@leafygreen-ui/pipeline": "^5.0.1",
|
|
58
58
|
"@leafygreen-ui/popover": "^11.0.1",
|
|
59
59
|
"@leafygreen-ui/portal": "^4.0.7",
|
|
60
|
-
"@leafygreen-ui/radio-box-group": "^12.0.
|
|
61
|
-
"@leafygreen-ui/radio-group": "^10.
|
|
60
|
+
"@leafygreen-ui/radio-box-group": "^12.0.5",
|
|
61
|
+
"@leafygreen-ui/radio-group": "^10.1.1",
|
|
62
|
+
"@leafygreen-ui/search-input": "^2.0.3",
|
|
62
63
|
"@leafygreen-ui/segmented-control": "^7.0.0",
|
|
63
64
|
"@leafygreen-ui/select": "^10.1.0",
|
|
64
65
|
"@leafygreen-ui/table": "^10.0.2",
|
|
65
66
|
"@leafygreen-ui/tabs": "^11.0.1",
|
|
66
67
|
"@leafygreen-ui/text-area": "^8.0.1",
|
|
67
68
|
"@leafygreen-ui/text-input": "^12.1.1",
|
|
68
|
-
"@leafygreen-ui/toast": "^
|
|
69
|
+
"@leafygreen-ui/toast": "^6.1.3",
|
|
69
70
|
"@leafygreen-ui/toggle": "^10.0.2",
|
|
70
71
|
"@leafygreen-ui/tokens": "^1.4.1",
|
|
71
72
|
"@leafygreen-ui/tooltip": "^9.0.2",
|
|
@@ -75,10 +76,10 @@
|
|
|
75
76
|
"@react-aria/utils": "^3.13.1",
|
|
76
77
|
"@react-aria/visually-hidden": "^3.3.1",
|
|
77
78
|
"@react-stately/tooltip": "^3.0.5",
|
|
78
|
-
"bson": "^5.0
|
|
79
|
+
"bson": "^5.2.0",
|
|
79
80
|
"focus-trap-react": "^8.4.2",
|
|
80
|
-
"hadron-document": "^8.2.
|
|
81
|
-
"hadron-type-checker": "^7.0.
|
|
81
|
+
"hadron-document": "^8.2.1",
|
|
82
|
+
"hadron-type-checker": "^7.0.3",
|
|
82
83
|
"is-electron-renderer": "^2.0.1",
|
|
83
84
|
"lodash": "^4.17.21",
|
|
84
85
|
"polished": "^4.2.2",
|
|
@@ -88,16 +89,15 @@
|
|
|
88
89
|
"react-window": "^1.8.6"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
|
-
"react": "^17.0.2"
|
|
92
|
-
"react-ace": "^9.5.0"
|
|
92
|
+
"react": "^17.0.2"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@mongodb-js/eslint-config-compass": "^1.0.
|
|
96
|
-
"@mongodb-js/mocha-config-compass": "^1.
|
|
95
|
+
"@mongodb-js/eslint-config-compass": "^1.0.6",
|
|
96
|
+
"@mongodb-js/mocha-config-compass": "^1.2.0",
|
|
97
97
|
"@mongodb-js/prettier-config-compass": "^1.0.0",
|
|
98
98
|
"@mongodb-js/tsconfig-compass": "^1.0.2",
|
|
99
99
|
"@testing-library/dom": "^8.11.1",
|
|
100
|
-
"@testing-library/react": "^12.
|
|
100
|
+
"@testing-library/react": "^12.1.4",
|
|
101
101
|
"@testing-library/react-hooks": "^7.0.2",
|
|
102
102
|
"@testing-library/user-event": "^13.5.0",
|
|
103
103
|
"@types/chai": "^4.2.21",
|
|
@@ -108,13 +108,11 @@
|
|
|
108
108
|
"chai": "^4.3.4",
|
|
109
109
|
"eslint": "^7.25.0",
|
|
110
110
|
"mocha": "^10.2.0",
|
|
111
|
-
"nyc": "^15.
|
|
111
|
+
"nyc": "^15.1.0",
|
|
112
112
|
"prettier": "^2.7.1",
|
|
113
113
|
"react": "^17.0.2",
|
|
114
|
-
"react-ace": "^9.5.0",
|
|
115
114
|
"react-dom": "^17.0.2",
|
|
116
115
|
"reflux": "^0.4.1",
|
|
117
|
-
"rimraf": "^3.0.2",
|
|
118
116
|
"sinon": "^9.0.0",
|
|
119
117
|
"typescript": "^5.0.4"
|
|
120
118
|
},
|
|
@@ -126,5 +124,5 @@
|
|
|
126
124
|
"publishConfig": {
|
|
127
125
|
"access": "public"
|
|
128
126
|
},
|
|
129
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "1d02bfb24078b4391bee7a83e34cb3d7da39a731"
|
|
130
128
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare function CancelLoader({ ['data-testid']: dataTestId, progressText, cancelText, onCancel, }: {
|
|
3
|
-
'data-testid'?: string;
|
|
4
|
-
progressText: string;
|
|
5
|
-
cancelText: string;
|
|
6
|
-
onCancel: () => void;
|
|
7
|
-
}): React.ReactElement;
|
|
8
|
-
export default CancelLoader;
|
|
9
|
-
//# sourceMappingURL=cancel-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-loader.d.ts","sourceRoot":"","sources":["../../src/components/cancel-loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,iBAAS,YAAY,CAAC,EACpB,CAAC,aAAa,CAAC,EAAE,UAA4B,EAC7C,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,KAAK,CAAC,YAAY,CAkBrB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
8
|
-
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
-
const palette_1 = require("@leafygreen-ui/palette");
|
|
10
|
-
const leafygreen_1 = require("./leafygreen");
|
|
11
|
-
const spin_loader_1 = require("./spin-loader");
|
|
12
|
-
const use_theme_1 = require("../hooks/use-theme");
|
|
13
|
-
const containerStyles = (0, emotion_1.css)({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
gap: tokens_1.spacing[2],
|
|
16
|
-
flexDirection: 'column',
|
|
17
|
-
justifyContent: 'center',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
maxWidth: tokens_1.spacing[6] * 8,
|
|
20
|
-
});
|
|
21
|
-
const textStyles = (0, emotion_1.css)({
|
|
22
|
-
color: palette_1.palette.green.dark2,
|
|
23
|
-
textAlign: 'center',
|
|
24
|
-
});
|
|
25
|
-
const textDarkStyles = (0, emotion_1.css)({
|
|
26
|
-
color: palette_1.palette.green.light2,
|
|
27
|
-
});
|
|
28
|
-
function CancelLoader({ ['data-testid']: dataTestId = 'cancel-loader', progressText, cancelText, onCancel, }) {
|
|
29
|
-
const darkMode = (0, use_theme_1.useDarkMode)();
|
|
30
|
-
return (react_1.default.createElement("div", { className: containerStyles, "data-testid": dataTestId },
|
|
31
|
-
react_1.default.createElement(spin_loader_1.SpinLoader, { size: `${tokens_1.spacing[4]}px` }),
|
|
32
|
-
react_1.default.createElement(leafygreen_1.Subtitle, { className: (0, emotion_1.cx)(textStyles, darkMode && textDarkStyles) }, progressText),
|
|
33
|
-
react_1.default.createElement(leafygreen_1.Button, { variant: "primaryOutline", onClick: onCancel, "data-testid": `${dataTestId}-button` }, cancelText)));
|
|
34
|
-
}
|
|
35
|
-
exports.default = CancelLoader;
|
|
36
|
-
//# sourceMappingURL=cancel-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-loader.js","sourceRoot":"","sources":["../../src/components/cancel-loader.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,kDAAgD;AAChD,oDAAiD;AACjD,oDAAiD;AAEjD,6CAAgD;AAChD,+CAA2C;AAC3C,kDAAiD;AAEjD,MAAM,eAAe,GAAG,IAAA,aAAG,EAAC;IAC1B,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,gBAAO,CAAC,CAAC,CAAC;IACf,aAAa,EAAE,QAAQ;IACvB,cAAc,EAAE,QAAQ;IACxB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,gBAAO,CAAC,CAAC,CAAC,GAAG,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAA,aAAG,EAAC;IACrB,KAAK,EAAE,iBAAO,CAAC,KAAK,CAAC,KAAK;IAC1B,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC;AACH,MAAM,cAAc,GAAG,IAAA,aAAG,EAAC;IACzB,KAAK,EAAE,iBAAO,CAAC,KAAK,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,SAAS,YAAY,CAAC,EACpB,CAAC,aAAa,CAAC,EAAE,UAAU,GAAG,eAAe,EAC7C,YAAY,EACZ,UAAU,EACV,QAAQ,GAMT;IACC,MAAM,QAAQ,GAAG,IAAA,uBAAW,GAAE,CAAC;IAE/B,OAAO,CACL,uCAAK,SAAS,EAAE,eAAe,iBAAe,UAAU;QACtD,8BAAC,wBAAU,IAAC,IAAI,EAAE,GAAG,gBAAO,CAAC,CAAC,CAAC,IAAI,GAAI;QACvC,8BAAC,qBAAQ,IAAC,SAAS,EAAE,IAAA,YAAE,EAAC,UAAU,EAAE,QAAQ,IAAI,cAAc,CAAC,IAC5D,YAAY,CACJ;QACX,8BAAC,mBAAM,IACL,OAAO,EAAC,gBAAgB,EACxB,OAAO,EAAE,QAAQ,iBACJ,GAAG,UAAU,SAAS,IAElC,UAAU,CACJ,CACL,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface SpinLoaderProps {
|
|
3
|
-
size?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
declare function SpinLoader({ size, title, className, }: SpinLoaderProps): JSX.Element;
|
|
8
|
-
export { SpinLoader };
|
|
9
|
-
//# sourceMappingURL=spin-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spin-loader.d.ts","sourceRoot":"","sources":["../../src/components/spin-loader.tsx"],"names":[],"mappings":";AAKA,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD,iBAAS,UAAU,CAAC,EAClB,IAAa,EACb,KAAK,EACL,SAAS,GACV,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAiB/B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
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.SpinLoader = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
-
const palette_1 = require("@leafygreen-ui/palette");
|
|
10
|
-
const use_theme_1 = require("../hooks/use-theme");
|
|
11
|
-
const shellLoaderSpin = (0, emotion_1.keyframes) `
|
|
12
|
-
0% { transform: rotate(0deg); }
|
|
13
|
-
100% { transform: rotate(360deg); }
|
|
14
|
-
`;
|
|
15
|
-
const spinLoaderStyle = (0, emotion_1.css) `
|
|
16
|
-
border: 2px solid transparent;
|
|
17
|
-
border-radius: 50%;
|
|
18
|
-
padding: 0;
|
|
19
|
-
margin: 0;
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
display: inline-block;
|
|
22
|
-
|
|
23
|
-
animation: ${shellLoaderSpin} 700ms ease infinite;
|
|
24
|
-
`;
|
|
25
|
-
const lightStyles = (0, emotion_1.css)({
|
|
26
|
-
borderTop: `2px solid ${palette_1.palette.gray.dark3}`,
|
|
27
|
-
});
|
|
28
|
-
const darkStyles = (0, emotion_1.css)({
|
|
29
|
-
borderTop: `2px solid ${palette_1.palette.gray.light3}`,
|
|
30
|
-
});
|
|
31
|
-
function SpinLoader({ size = '12px', title, className, }) {
|
|
32
|
-
const darkMode = (0, use_theme_1.useDarkMode)();
|
|
33
|
-
return (react_1.default.createElement("div", { className: (0, emotion_1.cx)(spinLoaderStyle, darkMode ? darkStyles : lightStyles, className), style: {
|
|
34
|
-
width: size,
|
|
35
|
-
height: size,
|
|
36
|
-
}, title: title }));
|
|
37
|
-
}
|
|
38
|
-
exports.SpinLoader = SpinLoader;
|
|
39
|
-
//# sourceMappingURL=spin-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spin-loader.js","sourceRoot":"","sources":["../../src/components/spin-loader.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oDAA4D;AAC5D,oDAAiD;AACjD,kDAAiD;AAQjD,MAAM,eAAe,GAAG,IAAA,mBAAS,EAAA;;;CAGhC,CAAC;AAEF,MAAM,eAAe,GAAG,IAAA,aAAG,EAAA;;;;;;;;eAQZ,eAAe;CAC7B,CAAC;AACF,MAAM,WAAW,GAAG,IAAA,aAAG,EAAC;IACtB,SAAS,EAAE,aAAa,iBAAO,CAAC,IAAI,CAAC,KAAK,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAA,aAAG,EAAC;IACrB,SAAS,EAAE,aAAa,iBAAO,CAAC,IAAI,CAAC,MAAM,EAAE;CAC9C,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,EAClB,IAAI,GAAG,MAAM,EACb,KAAK,EACL,SAAS,GACO;IAChB,MAAM,QAAQ,GAAG,IAAA,uBAAW,GAAE,CAAC;IAE/B,OAAO,CACL,uCACE,SAAS,EAAE,IAAA,YAAE,EACX,eAAe,EACf,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EACnC,SAAS,CACV,EACD,KAAK,EAAE;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb,EACD,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC;AAEQ,gCAAU"}
|