@mongodb-js/compass-components 0.7.0 → 0.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/compass-ui-colors.d.ts +5 -0
- package/lib/compass-ui-colors.d.ts.map +1 -0
- package/lib/compass-ui-colors.js +8 -0
- package/lib/compass-ui-colors.js.map +1 -0
- package/lib/components/accordion.d.ts +1 -0
- package/lib/components/accordion.d.ts.map +1 -0
- package/lib/components/accordion.js +11 -11
- package/lib/components/accordion.js.map +1 -1
- package/lib/components/cancel-loader.d.ts +1 -0
- package/lib/components/cancel-loader.d.ts.map +1 -0
- package/lib/components/cancel-loader.js +5 -5
- package/lib/components/cancel-loader.js.map +1 -1
- package/lib/components/confirmation-modal.d.ts +1 -0
- package/lib/components/confirmation-modal.d.ts.map +1 -0
- package/lib/components/confirmation-modal.js +1 -1
- package/lib/components/confirmation-modal.js.map +1 -1
- package/lib/components/content-with-fallback.d.ts +18 -0
- package/lib/components/content-with-fallback.d.ts.map +1 -0
- package/lib/components/content-with-fallback.js +119 -0
- package/lib/components/content-with-fallback.js.map +1 -0
- package/lib/components/error-boundary.d.ts +17 -0
- package/lib/components/error-boundary.d.ts.map +1 -0
- package/lib/components/error-boundary.js +42 -0
- package/lib/components/error-boundary.js.map +1 -0
- package/lib/components/file-input.d.ts +10 -1
- package/lib/components/file-input.d.ts.map +1 -0
- package/lib/components/file-input.js +120 -69
- package/lib/components/file-input.js.map +1 -1
- package/lib/components/icons/favorite-icon.d.ts +9 -0
- package/lib/components/icons/favorite-icon.d.ts.map +1 -0
- package/lib/components/icons/favorite-icon.js +18 -0
- package/lib/components/icons/favorite-icon.js.map +1 -0
- package/lib/components/inline-definition.d.ts +8 -0
- package/lib/components/inline-definition.d.ts.map +1 -0
- package/lib/components/inline-definition.js +31 -0
- package/lib/components/inline-definition.js.map +1 -0
- package/lib/components/placeholder.d.ts +10 -0
- package/lib/components/placeholder.d.ts.map +1 -0
- package/lib/components/placeholder.js +68 -0
- package/lib/components/placeholder.js.map +1 -0
- package/lib/components/resize-handle.d.ts +1 -0
- package/lib/components/resize-handle.d.ts.map +1 -0
- package/lib/components/resize-handle.js +6 -6
- package/lib/components/resize-handle.js.map +1 -1
- package/lib/components/spin-loader.d.ts +1 -0
- package/lib/components/spin-loader.d.ts.map +1 -0
- package/lib/components/spin-loader.js +3 -3
- package/lib/components/spin-loader.js.map +1 -1
- package/lib/components/tooltip.d.ts +14 -0
- package/lib/components/tooltip.d.ts.map +1 -0
- package/lib/components/tooltip.js +52 -0
- package/lib/components/tooltip.js.map +1 -0
- package/lib/components/virtual-grid.d.ts +26 -0
- package/lib/components/virtual-grid.d.ts.map +1 -0
- package/lib/components/virtual-grid.js +136 -0
- package/lib/components/virtual-grid.js.map +1 -0
- package/lib/hooks/use-default-action.d.ts +3 -0
- package/lib/hooks/use-default-action.d.ts.map +1 -0
- package/lib/hooks/use-default-action.js +25 -0
- package/lib/hooks/use-default-action.js.map +1 -0
- package/lib/hooks/use-dom-rect.d.ts +6 -0
- package/lib/hooks/use-dom-rect.d.ts.map +1 -0
- package/lib/hooks/use-dom-rect.js +28 -0
- package/lib/hooks/use-dom-rect.js.map +1 -0
- package/lib/hooks/use-focus-hover.d.ts +15 -0
- package/lib/hooks/use-focus-hover.d.ts.map +1 -0
- package/lib/hooks/use-focus-hover.js +57 -0
- package/lib/hooks/use-focus-hover.js.map +1 -0
- package/lib/hooks/use-focus-ring.d.ts +5 -0
- package/lib/hooks/use-focus-ring.d.ts.map +1 -0
- package/lib/hooks/use-focus-ring.js +38 -0
- package/lib/hooks/use-focus-ring.js.map +1 -0
- package/lib/hooks/use-virtual-grid.d.ts +14 -0
- package/lib/hooks/use-virtual-grid.d.ts.map +1 -0
- package/lib/hooks/use-virtual-grid.js +122 -0
- package/lib/hooks/use-virtual-grid.js.map +1 -0
- package/lib/hooks/use-virtual-grid.test.d.ts +2 -0
- package/lib/hooks/use-virtual-grid.test.d.ts.map +1 -0
- package/lib/hooks/use-virtual-grid.test.js +209 -0
- package/lib/hooks/use-virtual-grid.test.js.map +1 -0
- package/lib/index.d.ts +24 -4
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +66 -5
- package/lib/index.js.map +1 -1
- package/lib/utils/merge-props.d.ts +3 -0
- package/lib/utils/merge-props.d.ts.map +1 -0
- package/lib/utils/merge-props.js +24 -0
- package/lib/utils/merge-props.js.map +1 -0
- package/package.json +25 -16
- package/lib/components/compass-ui-colors.d.ts +0 -2
- package/lib/components/compass-ui-colors.js +0 -6
- package/lib/components/compass-ui-colors.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compass-ui-colors.d.ts","sourceRoot":"","sources":["../src/compass-ui-colors.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,IAAI,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gold = exports.transparentWhite = exports.transparentGray = exports.gray8 = void 0;
|
|
4
|
+
exports.gray8 = '#f5f6f7';
|
|
5
|
+
exports.transparentGray = 'rgba(180, 180, 180, 0.5)';
|
|
6
|
+
exports.transparentWhite = 'rgba(255, 255, 255, 0.5)';
|
|
7
|
+
exports.gold = '#FFC010';
|
|
8
|
+
//# sourceMappingURL=compass-ui-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compass-ui-colors.js","sourceRoot":"","sources":["../src/compass-ui-colors.tsx"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAAG,SAAS,CAAC;AAClB,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,gBAAgB,GAAG,0BAA0B,CAAC;AAC9C,QAAA,IAAI,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiCxC,UAAU,cAAc;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,iBAAS,SAAS,CAChB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAC7C,KAAK,CAAC,YAAY,CAiCpB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -24,16 +24,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
const react_1 = __importStar(require("react"));
|
|
26
26
|
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
27
|
-
const
|
|
27
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
28
28
|
const icon_1 = __importDefault(require("@leafygreen-ui/icon"));
|
|
29
29
|
const palette_1 = require("@leafygreen-ui/palette");
|
|
30
30
|
const utils_1 = require("@react-aria/utils");
|
|
31
|
-
const labelStyles =
|
|
31
|
+
const labelStyles = (0, emotion_1.css)({
|
|
32
32
|
padding: 0,
|
|
33
33
|
margin: 0,
|
|
34
34
|
fontWeight: 'bold',
|
|
35
35
|
});
|
|
36
|
-
const buttonStyles =
|
|
36
|
+
const buttonStyles = (0, emotion_1.css)({
|
|
37
37
|
display: 'flex',
|
|
38
38
|
alignItems: 'center',
|
|
39
39
|
border: 'none',
|
|
@@ -45,25 +45,25 @@ const buttonStyles = css_1.css({
|
|
|
45
45
|
boxShadow: `0 0 0 3px ${palette_1.uiColors.focus}`,
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
const containerStyles =
|
|
48
|
+
const containerStyles = (0, emotion_1.css)({
|
|
49
49
|
marginTop: tokens_1.spacing[3],
|
|
50
50
|
display: 'flex',
|
|
51
51
|
alignItems: 'center',
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
});
|
|
53
|
+
const buttonIconStyles = (0, emotion_1.css)({
|
|
54
|
+
marginRight: tokens_1.spacing[1],
|
|
55
55
|
});
|
|
56
56
|
function Accordion(props) {
|
|
57
|
-
const [open, setOpen] = react_1.useState(false);
|
|
58
|
-
const regionId = utils_1.useId('region-');
|
|
59
|
-
const labelId = utils_1.useId('label-');
|
|
57
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
58
|
+
const regionId = (0, utils_1.useId)('region-');
|
|
59
|
+
const labelId = (0, utils_1.useId)('label-');
|
|
60
60
|
return (react_1.default.createElement("div", { "data-testid": props.dataTestId },
|
|
61
61
|
react_1.default.createElement("div", { className: containerStyles },
|
|
62
62
|
react_1.default.createElement("p", { className: labelStyles, id: labelId },
|
|
63
63
|
react_1.default.createElement("button", { className: buttonStyles, type: "button", "aria-expanded": open ? 'true' : 'false', "aria-controls": regionId, onClick: () => {
|
|
64
64
|
setOpen((currentOpen) => !currentOpen);
|
|
65
65
|
} },
|
|
66
|
-
react_1.default.createElement(icon_1.default, { glyph: open ? 'ChevronDown' : 'ChevronRight' }),
|
|
66
|
+
react_1.default.createElement(icon_1.default, { className: buttonIconStyles, glyph: open ? 'ChevronDown' : 'ChevronRight' }),
|
|
67
67
|
props.text))),
|
|
68
68
|
open && (react_1.default.createElement("div", { role: "region", "aria-labelledby": labelId, id: regionId }, props.children))));
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,kDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC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AC,CAAC,CAAC,OAAO,mBACvB,QAAQ,EACvB,OAAO,EAAE,GAAG,EAAE;wBACZ,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;oBACzC,CAAC;oBAED,8BAAC,cAAI,IACH,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,GAC5C;oBACD,KAAK,CAAC,IAAI,CACJ,CACP,CACA;QAEL,IAAI,IAAI,CACP,uCAAK,IAAI,EAAC,QAAQ,qBAAkB,OAAO,EAAE,EAAE,EAAE,QAAQ,IACtD,KAAK,CAAC,QAAQ,CACX,CACP,CACG,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-loader.d.ts","sourceRoot":"","sources":["../../src/components/cancel-loader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAqD1B,iBAAS,YAAY,CAAC,EACpB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,KAAK,CAAC,YAAY,CAcrB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const cancelLoaderStyle =
|
|
8
|
+
const cancelLoaderStyle = (0, emotion_1.css)({
|
|
9
9
|
height: '100%',
|
|
10
10
|
display: 'flex',
|
|
11
11
|
flexDirection: 'column',
|
|
@@ -13,14 +13,14 @@ const cancelLoaderStyle = css_1.css({
|
|
|
13
13
|
justifyContent: 'center',
|
|
14
14
|
padding: '10px 0',
|
|
15
15
|
});
|
|
16
|
-
const progressTextStyle =
|
|
16
|
+
const progressTextStyle = (0, emotion_1.css)({
|
|
17
17
|
margin: '0 auto 30px',
|
|
18
18
|
textAlign: 'left',
|
|
19
19
|
fontSize: '24px',
|
|
20
20
|
color: '#807f7f',
|
|
21
21
|
fontWeight: 200,
|
|
22
22
|
});
|
|
23
|
-
const spinnerStyle =
|
|
23
|
+
const spinnerStyle = (0, emotion_1.css)({
|
|
24
24
|
animation: 'fa-spin 2s infinite linear',
|
|
25
25
|
width: '40px',
|
|
26
26
|
textAlign: 'center',
|
|
@@ -32,7 +32,7 @@ const spinnerStyle = css_1.css({
|
|
|
32
32
|
content: '"\\f1ce"',
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
|
-
const buttonStyle =
|
|
35
|
+
const buttonStyle = (0, emotion_1.css)({
|
|
36
36
|
padding: '0 10px 0 10px',
|
|
37
37
|
height: '28px',
|
|
38
38
|
fontWeight: 'bold',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-loader.js","sourceRoot":"","sources":["../../src/components/cancel-loader.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"cancel-loader.js","sourceRoot":"","sources":["../../src/components/cancel-loader.tsx"],"names":[],"mappings":";;;;;AAAA,oDAA6C;AAC7C,kDAA0B;AAE1B,MAAM,iBAAiB,GAAG,IAAA,aAAG,EAAC;IAC5B,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAC;AAEH,MAAM,iB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,QAAQ,IAC9C,UAAU,CACJ,CACL,CACF,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-modal.d.ts","sourceRoot":"","sources":["../../src/components/confirmation-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,MAAM,mCAAmC,CAAC;AAI5E,iBAAS,iBAAiB,CACxB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,2BAA2B,CAAC,GAAG;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,KAAK,CAAC,YAAY,CAKpB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const confirmation_modal_1 = __importDefault(require("@leafygreen-ui/confirmation-modal"));
|
|
8
8
|
const compass_logging_1 = require("@mongodb-js/compass-logging");
|
|
9
|
-
const { track } = compass_logging_1.createLoggerAndTelemetry('COMPASS-UI');
|
|
9
|
+
const { track } = (0, compass_logging_1.createLoggerAndTelemetry)('COMPASS-UI');
|
|
10
10
|
function ConfirmationModal(props) {
|
|
11
11
|
if (props.open && props.trackingId) {
|
|
12
12
|
track('Screen', { name: props.trackingId });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmation-modal.js","sourceRoot":"","sources":["../../src/components/confirmation-modal.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,2FAA4E;AAC5E,iEAAuE;AACvE,MAAM,EAAE,KAAK,EAAE,GAAG,0CAAwB,
|
|
1
|
+
{"version":3,"file":"confirmation-modal.js","sourceRoot":"","sources":["../../src/components/confirmation-modal.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,2FAA4E;AAC5E,iEAAuE;AACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,0CAAwB,EAAC,YAAY,CAAC,CAAC;AAEzD,SAAS,iBAAiB,CACxB,KAEC;IAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;QAClC,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;KAC7C;IACD,OAAO,8BAAC,4BAA2B,OAAK,KAAK,GAAI,CAAC;AACpD,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ContentWithFallback: React.FunctionComponent<{
|
|
3
|
+
content(shouldRender: boolean, shouldAnimate: boolean): React.ReactElement | boolean | null;
|
|
4
|
+
fallback(shouldRender: boolean): React.ReactElement | boolean | null;
|
|
5
|
+
isContentReady: boolean;
|
|
6
|
+
contentAfterFallbackTimeout?: number;
|
|
7
|
+
fallbackTimeout?: number;
|
|
8
|
+
}>;
|
|
9
|
+
declare type FadeInPlaceholderProps = {
|
|
10
|
+
isContentReady: boolean;
|
|
11
|
+
content(): React.ReactElement | boolean | null;
|
|
12
|
+
fallback(): React.ReactElement | boolean | null;
|
|
13
|
+
contentContainerProps?: React.HTMLProps<HTMLDivElement>;
|
|
14
|
+
fallbackContainerProps?: React.HTMLProps<HTMLDivElement>;
|
|
15
|
+
};
|
|
16
|
+
export declare const FadeInPlaceholder: React.FunctionComponent<FadeInPlaceholderProps & Omit<React.HTMLProps<HTMLDivElement>, keyof FadeInPlaceholderProps>>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=content-with-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-with-fallback.d.ts","sourceRoot":"","sources":["../../src/components/content-with-fallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAuDnD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACxD,OAAO,CACL,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,GACrB,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IACrE,cAAc,EAAE,OAAO,CAAC;IACxB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAqBA,CAAC;AAuCF,aAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,IAAI,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/C,QAAQ,IAAI,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IAChD,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxD,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CACrD,sBAAsB,GACpB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,sBAAsB,CAAC,CA+CtE,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
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.FadeInPlaceholder = exports.ContentWithFallback = void 0;
|
|
23
|
+
const react_1 = __importStar(require("react"));
|
|
24
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
25
|
+
var RenderStatus;
|
|
26
|
+
(function (RenderStatus) {
|
|
27
|
+
RenderStatus["Nothing"] = "Nothing";
|
|
28
|
+
RenderStatus["Fallback"] = "Fallback";
|
|
29
|
+
RenderStatus["Content"] = "Content";
|
|
30
|
+
RenderStatus["ContentAnimated"] = "ContentAnimated";
|
|
31
|
+
})(RenderStatus || (RenderStatus = {}));
|
|
32
|
+
function isContent(status) {
|
|
33
|
+
return [RenderStatus.ContentAnimated, RenderStatus.Content].includes(status);
|
|
34
|
+
}
|
|
35
|
+
function useRenderWithFallback(isContentReady, { contentAfterFallbackTimeout = 200, fallbackTimeout = 30 } = {}) {
|
|
36
|
+
const [renderStatus, setRenderStatus] = (0, react_1.useState)(isContentReady ? RenderStatus.Content : RenderStatus.Nothing);
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
if (isContent(renderStatus)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (isContentReady && renderStatus === RenderStatus.Nothing) {
|
|
42
|
+
setRenderStatus(RenderStatus.Content);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (isContentReady && renderStatus === RenderStatus.Fallback) {
|
|
46
|
+
const timeout = setTimeout(() => {
|
|
47
|
+
setRenderStatus(RenderStatus.ContentAnimated);
|
|
48
|
+
}, contentAfterFallbackTimeout);
|
|
49
|
+
return () => {
|
|
50
|
+
clearTimeout(timeout);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (!isContentReady && renderStatus === RenderStatus.Nothing) {
|
|
54
|
+
const timeout = setTimeout(() => {
|
|
55
|
+
setRenderStatus(RenderStatus.Fallback);
|
|
56
|
+
}, fallbackTimeout);
|
|
57
|
+
return () => {
|
|
58
|
+
clearTimeout(timeout);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
renderStatus,
|
|
63
|
+
isContentReady,
|
|
64
|
+
contentAfterFallbackTimeout,
|
|
65
|
+
fallbackTimeout,
|
|
66
|
+
]);
|
|
67
|
+
return renderStatus;
|
|
68
|
+
}
|
|
69
|
+
const ContentWithFallback = ({ content, fallback, isContentReady, contentAfterFallbackTimeout, fallbackTimeout, }) => {
|
|
70
|
+
const renderStatus = useRenderWithFallback(isContentReady, {
|
|
71
|
+
contentAfterFallbackTimeout,
|
|
72
|
+
fallbackTimeout,
|
|
73
|
+
});
|
|
74
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
|
+
content(isContent(renderStatus), renderStatus === RenderStatus.ContentAnimated),
|
|
76
|
+
fallback(renderStatus === RenderStatus.Fallback)));
|
|
77
|
+
};
|
|
78
|
+
exports.ContentWithFallback = ContentWithFallback;
|
|
79
|
+
const contentWithFallbackContainer = (0, emotion_1.css)({
|
|
80
|
+
position: 'relative',
|
|
81
|
+
});
|
|
82
|
+
const fadeInAnimation = (0, emotion_1.keyframes)({
|
|
83
|
+
from: {
|
|
84
|
+
opacity: 0,
|
|
85
|
+
},
|
|
86
|
+
to: {
|
|
87
|
+
opacity: 1,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
const contentContainer = (0, emotion_1.css)({
|
|
91
|
+
position: 'relative',
|
|
92
|
+
});
|
|
93
|
+
const contentContainerFadeIn = (0, emotion_1.css)({
|
|
94
|
+
animation: `${fadeInAnimation} .16s ease-out`,
|
|
95
|
+
});
|
|
96
|
+
const fallbackContainer = (0, emotion_1.css)({
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
top: 0,
|
|
99
|
+
right: 0,
|
|
100
|
+
bottom: 0,
|
|
101
|
+
left: 0,
|
|
102
|
+
opacity: 0,
|
|
103
|
+
transition: 'opacity .16s ease-out',
|
|
104
|
+
pointerEvents: 'none',
|
|
105
|
+
});
|
|
106
|
+
const fallbackContainerVisible = (0, emotion_1.css)({
|
|
107
|
+
opacity: 1,
|
|
108
|
+
transitionTimingFunction: 'ease-in',
|
|
109
|
+
});
|
|
110
|
+
const FadeInPlaceholder = ({ content, fallback, isContentReady, contentContainerProps = {}, fallbackContainerProps = {}, className, ...props }) => {
|
|
111
|
+
return (react_1.default.createElement("div", { className: (0, emotion_1.cx)(contentWithFallbackContainer, className), ...props },
|
|
112
|
+
react_1.default.createElement(exports.ContentWithFallback, { isContentReady: isContentReady, content: (shouldRender, shouldAnimate) => {
|
|
113
|
+
return (shouldRender && (react_1.default.createElement("div", { ...contentContainerProps, className: (0, emotion_1.cx)(contentContainer, shouldAnimate && contentContainerFadeIn, contentContainerProps.className) }, content())));
|
|
114
|
+
}, fallback: (shouldRender) => {
|
|
115
|
+
return (react_1.default.createElement("div", { ...fallbackContainerProps, className: (0, emotion_1.cx)(fallbackContainer, shouldRender && fallbackContainerVisible, fallbackContainerProps.className) }, fallback()));
|
|
116
|
+
} })));
|
|
117
|
+
};
|
|
118
|
+
exports.FadeInPlaceholder = FadeInPlaceholder;
|
|
119
|
+
//# sourceMappingURL=content-with-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-with-fallback.js","sourceRoot":"","sources":["../../src/components/content-with-fallback.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,+CAAmD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
|
4
|
+
error: Error | null;
|
|
5
|
+
};
|
|
6
|
+
declare type Props = {
|
|
7
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
8
|
+
children: React.ReactElement;
|
|
9
|
+
};
|
|
10
|
+
export declare class ErrorBoundary extends React.Component<Props> {
|
|
11
|
+
state: State;
|
|
12
|
+
static getDerivedStateFromError(error: Error): State;
|
|
13
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
|
+
render(): React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=error-boundary.d.ts.map
|
|
@@ -0,0 +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;AAQ1B,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,aAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACvD,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B,CAAC;AAEF,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IACvD,KAAK,EAAE,KAAK,CAEV;IAEF,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAMpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAM3D,MAAM,IAAI,KAAK,CAAC,SAAS;CAc1B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.ErrorBoundary = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const banner_1 = __importDefault(require("@leafygreen-ui/banner"));
|
|
9
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
10
|
+
const errorContainerStyles = (0, emotion_1.css)({
|
|
11
|
+
width: '100%',
|
|
12
|
+
});
|
|
13
|
+
class ErrorBoundary extends react_1.default.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.state = {
|
|
17
|
+
error: null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static getDerivedStateFromError(error) {
|
|
21
|
+
return {
|
|
22
|
+
error,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
componentDidCatch(error, errorInfo) {
|
|
26
|
+
if (this.props.onError) {
|
|
27
|
+
this.props.onError(error, errorInfo);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const { error } = this.state;
|
|
32
|
+
if (error) {
|
|
33
|
+
return (react_1.default.createElement("div", { className: errorContainerStyles },
|
|
34
|
+
react_1.default.createElement(banner_1.default, { variant: "danger" },
|
|
35
|
+
"An error occurred while rendering: ",
|
|
36
|
+
error.message)));
|
|
37
|
+
}
|
|
38
|
+
return this.props.children;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
42
|
+
//# sourceMappingURL=error-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../src/components/error-boundary.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,mEAA2C;AAC3C,oDAA6C;AAE7C,MAAM,oBAAoB,GAAG,IAAA,aAAG,EAAC;IAC/B,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAWH,MAAa,aAAc,SAAQ,eAAK,CAAC,SAAgB;IAAzD;;QACE,UAAK,GAAU;YACb,KAAK,EAAE,IAAI;SACZ,CAAC;IA4BJ,CAAC;IA1BC,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,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7B,IAAI,KAAK,EAAE;YACT,OAAO,CACL,uCAAK,SAAS,EAAE,oBAAoB;gBAClC,8BAAC,gBAAM,IAAC,OAAO,EAAC,QAAQ;;oBACc,KAAK,CAAC,OAAO,CAC1C,CACL,CACP,CAAC;SACH;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF;AA/BD,sCA+BC"}
|
|
@@ -3,14 +3,23 @@ export declare enum Variant {
|
|
|
3
3
|
Horizontal = "HORIZONTAL",
|
|
4
4
|
Vertical = "VERTICAL"
|
|
5
5
|
}
|
|
6
|
-
declare function FileInput({ id, label, onChange, multi, error, variant, link, values, }: {
|
|
6
|
+
declare function FileInput({ id, label, dataTestId, onChange, disabled, multi, optional, optionalMessage, error, errorMessage, variant, showFileOnNewLine, link, description, values, labelAlignment, }: {
|
|
7
7
|
id: string;
|
|
8
8
|
label: string;
|
|
9
|
+
dataTestId?: string;
|
|
9
10
|
onChange: (files: string[]) => void;
|
|
11
|
+
disabled?: boolean;
|
|
10
12
|
multi?: boolean;
|
|
13
|
+
optional?: boolean;
|
|
14
|
+
optionalMessage?: string;
|
|
11
15
|
error?: boolean;
|
|
16
|
+
errorMessage?: string;
|
|
12
17
|
variant?: Variant;
|
|
13
18
|
link?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
showFileOnNewLine?: boolean;
|
|
14
21
|
values?: string[];
|
|
22
|
+
labelAlignment?: 'right' | 'left' | 'center';
|
|
15
23
|
}): React.ReactElement;
|
|
16
24
|
export default FileInput;
|
|
25
|
+
//# sourceMappingURL=file-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../src/components/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+F1B,oBAAY,OAAO;IACjB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAQD,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,KAAa,EACb,QAAgB,EAChB,eAAe,EACf,KAAa,EACb,YAAY,EACZ,OAA4B,EAC5B,iBAAyB,EACzB,IAAI,EACJ,WAAW,EACX,MAAM,EACN,cAAuB,GACxB,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;CAC9C,GAAG,KAAK,CAAC,YAAY,CA0JrB;AAED,eAAe,SAAS,CAAC"}
|