@mongodb-js/compass-components 1.2.0 → 1.4.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/accordion.d.ts.map +1 -1
- package/lib/components/accordion.js +4 -5
- package/lib/components/accordion.js.map +1 -1
- package/lib/components/bson-value.d.ts +5 -3
- package/lib/components/bson-value.d.ts.map +1 -1
- package/lib/components/bson-value.js +52 -34
- package/lib/components/bson-value.js.map +1 -1
- package/lib/components/cancel-loader.js +1 -1
- package/lib/components/cancel-loader.js.map +1 -1
- package/lib/components/collapsible-field-set.d.ts +2 -4
- package/lib/components/collapsible-field-set.d.ts.map +1 -1
- package/lib/components/collapsible-field-set.js +13 -20
- package/lib/components/collapsible-field-set.js.map +1 -1
- package/lib/components/document-list/document-actions-group.js +1 -1
- package/lib/components/document-list/document-actions-group.js.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.d.ts.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.js +17 -11
- package/lib/components/document-list/document-edit-actions-footer.js.map +1 -1
- package/lib/components/document-list/document.js +4 -4
- package/lib/components/document-list/document.js.map +1 -1
- package/lib/components/document-list/element-actions.d.ts.map +1 -1
- package/lib/components/document-list/element-actions.js +18 -15
- package/lib/components/document-list/element-actions.js.map +1 -1
- package/lib/components/document-list/element-editors.d.ts.map +1 -1
- package/lib/components/document-list/element-editors.js +47 -22
- package/lib/components/document-list/element-editors.js.map +1 -1
- package/lib/components/document-list/element.d.ts.map +1 -1
- package/lib/components/document-list/element.js +71 -21
- package/lib/components/document-list/element.js.map +1 -1
- package/lib/components/document-list/typography.d.ts +6 -0
- package/lib/components/document-list/typography.d.ts.map +1 -0
- package/lib/components/document-list/typography.js +10 -0
- package/lib/components/document-list/typography.js.map +1 -0
- package/lib/components/empty-content.d.ts +12 -0
- package/lib/components/empty-content.d.ts.map +1 -0
- package/lib/components/empty-content.js +52 -0
- package/lib/components/empty-content.js.map +1 -0
- package/lib/components/error-warning-summary.d.ts +2 -0
- package/lib/components/error-warning-summary.d.ts.map +1 -1
- package/lib/components/error-warning-summary.js +6 -6
- package/lib/components/error-warning-summary.js.map +1 -1
- package/lib/components/file-input.d.ts +34 -1
- package/lib/components/file-input.d.ts.map +1 -1
- package/lib/components/file-input.js +113 -16
- package/lib/components/file-input.js.map +1 -1
- package/lib/components/form-field-container.d.ts +8 -0
- package/lib/components/form-field-container.d.ts.map +1 -0
- package/lib/components/form-field-container.js +16 -0
- package/lib/components/form-field-container.js.map +1 -0
- package/lib/components/icons/document-icon.d.ts +7 -0
- package/lib/components/icons/document-icon.d.ts.map +1 -0
- package/lib/components/icons/document-icon.js +52 -0
- package/lib/components/icons/document-icon.js.map +1 -0
- package/lib/components/icons/favorite-icon.d.ts.map +1 -1
- package/lib/components/icons/favorite-icon.js +2 -3
- package/lib/components/icons/favorite-icon.js.map +1 -1
- package/lib/components/icons/no-saved-items-icon.d.ts +8 -0
- package/lib/components/icons/no-saved-items-icon.d.ts.map +1 -0
- package/lib/components/icons/no-saved-items-icon.js +41 -0
- package/lib/components/icons/no-saved-items-icon.js.map +1 -0
- package/lib/components/interactive-popover.d.ts +3 -4
- package/lib/components/interactive-popover.d.ts.map +1 -1
- package/lib/components/interactive-popover.js +30 -16
- package/lib/components/interactive-popover.js.map +1 -1
- package/lib/components/item-action-controls.d.ts +13 -0
- package/lib/components/item-action-controls.d.ts.map +1 -1
- package/lib/components/item-action-controls.js +44 -7
- package/lib/components/item-action-controls.js.map +1 -1
- package/lib/components/keyline-card.d.ts +7 -0
- package/lib/components/keyline-card.d.ts.map +1 -0
- package/lib/components/keyline-card.js +28 -0
- package/lib/components/keyline-card.js.map +1 -0
- package/lib/components/leafygreen.d.ts +19 -15
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +27 -9
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/list-editor.d.ts +14 -0
- package/lib/components/list-editor.d.ts.map +1 -0
- package/lib/components/list-editor.js +36 -0
- package/lib/components/list-editor.js.map +1 -0
- package/lib/components/{confirmation-modal.d.ts → modals/confirmation-modal.d.ts} +1 -1
- package/lib/components/modals/confirmation-modal.d.ts.map +1 -0
- package/lib/components/{confirmation-modal.js → modals/confirmation-modal.js} +1 -1
- package/lib/components/modals/confirmation-modal.js.map +1 -0
- package/lib/components/modals/form-modal.d.ts +22 -0
- package/lib/components/modals/form-modal.d.ts.map +1 -0
- package/lib/components/modals/form-modal.js +31 -0
- package/lib/components/modals/form-modal.js.map +1 -0
- package/lib/components/modals/info-modal.d.ts +12 -0
- package/lib/components/modals/info-modal.d.ts.map +1 -0
- package/lib/components/modals/info-modal.js +23 -0
- package/lib/components/modals/info-modal.js.map +1 -0
- package/lib/components/modals/modal-body.d.ts +16 -0
- package/lib/components/modals/modal-body.d.ts.map +1 -0
- package/lib/components/modals/modal-body.js +66 -0
- package/lib/components/modals/modal-body.js.map +1 -0
- package/lib/components/modals/modal-footer-button.d.ts +5 -0
- package/lib/components/modals/modal-footer-button.d.ts.map +1 -0
- package/lib/components/modals/modal-footer-button.js +37 -0
- package/lib/components/modals/modal-footer-button.js.map +1 -0
- package/lib/components/modals/modal-header.d.ts +15 -0
- package/lib/components/modals/modal-header.d.ts.map +1 -0
- package/lib/components/modals/modal-header.js +65 -0
- package/lib/components/modals/modal-header.js.map +1 -0
- package/lib/components/modals/modal.d.ts +7 -0
- package/lib/components/modals/modal.d.ts.map +1 -0
- package/lib/components/{modal.js → modals/modal.js} +9 -3
- package/lib/components/modals/modal.js.map +1 -0
- package/lib/components/placeholder.js +4 -4
- package/lib/components/placeholder.js.map +1 -1
- package/lib/components/resize-handle.d.ts.map +1 -1
- package/lib/components/resize-handle.js +2 -1
- package/lib/components/resize-handle.js.map +1 -1
- package/lib/components/resizeable-sidebar.d.ts.map +1 -1
- package/lib/components/resizeable-sidebar.js +21 -22
- package/lib/components/resizeable-sidebar.js.map +1 -1
- package/lib/components/spin-loader.js +1 -1
- package/lib/components/spin-loader.js.map +1 -1
- package/lib/components/tab-nav-bar.d.ts.map +1 -1
- package/lib/components/tab-nav-bar.js +11 -7
- package/lib/components/tab-nav-bar.js.map +1 -1
- package/lib/components/virtual-grid.d.ts +1 -1
- package/lib/components/workspace-container.d.ts +1 -0
- package/lib/components/workspace-container.d.ts.map +1 -1
- package/lib/components/workspace-container.js +98 -10
- package/lib/components/workspace-container.js.map +1 -1
- package/lib/components/workspace-tabs/tab.d.ts.map +1 -1
- package/lib/components/workspace-tabs/tab.js +26 -27
- package/lib/components/workspace-tabs/tab.js.map +1 -1
- package/lib/components/workspace-tabs/workspace-tabs.d.ts +2 -0
- package/lib/components/workspace-tabs/workspace-tabs.d.ts.map +1 -1
- package/lib/components/workspace-tabs/workspace-tabs.js +10 -8
- package/lib/components/workspace-tabs/workspace-tabs.js.map +1 -1
- package/lib/hooks/use-focus-ring.d.ts.map +1 -1
- package/lib/hooks/use-focus-ring.js +3 -2
- package/lib/hooks/use-focus-ring.js.map +1 -1
- package/lib/hooks/use-formatted-date.d.ts +2 -0
- package/lib/hooks/use-formatted-date.d.ts.map +1 -0
- package/lib/hooks/use-formatted-date.js +20 -0
- package/lib/hooks/use-formatted-date.js.map +1 -0
- package/lib/hooks/use-theme.d.ts +2 -1
- package/lib/hooks/use-theme.d.ts.map +1 -1
- package/lib/hooks/use-theme.js +9 -6
- package/lib/hooks/use-theme.js.map +1 -1
- package/lib/hooks/use-toast.d.ts +2 -0
- package/lib/hooks/use-toast.d.ts.map +1 -1
- package/lib/hooks/use-toast.js +59 -37
- package/lib/hooks/use-toast.js.map +1 -1
- package/lib/index.d.ts +21 -14
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +38 -21
- package/lib/index.js.map +1 -1
- package/lib/utils/format-date.d.ts +2 -0
- package/lib/utils/format-date.d.ts.map +1 -0
- package/lib/utils/format-date.js +47 -0
- package/lib/utils/format-date.js.map +1 -0
- package/package.json +38 -42
- package/lib/compass-font-sizes.d.ts +0 -3
- package/lib/compass-font-sizes.d.ts.map +0 -1
- package/lib/compass-font-sizes.js +0 -6
- package/lib/compass-font-sizes.js.map +0 -1
- package/lib/compass-ui-colors.d.ts +0 -7
- package/lib/compass-ui-colors.d.ts.map +0 -1
- package/lib/compass-ui-colors.js +0 -10
- package/lib/compass-ui-colors.js.map +0 -1
- package/lib/components/confirmation-modal.d.ts.map +0 -1
- package/lib/components/confirmation-modal.js.map +0 -1
- package/lib/components/document-list/font-awesome-icon.d.ts +0 -14
- package/lib/components/document-list/font-awesome-icon.d.ts.map +0 -1
- package/lib/components/document-list/font-awesome-icon.js +0 -29
- package/lib/components/document-list/font-awesome-icon.js.map +0 -1
- package/lib/components/editor.d.ts +0 -36
- package/lib/components/editor.d.ts.map +0 -1
- package/lib/components/editor.js +0 -107
- package/lib/components/editor.js.map +0 -1
- package/lib/components/modal-title.d.ts +0 -5
- package/lib/components/modal-title.d.ts.map +0 -1
- package/lib/components/modal-title.js +0 -18
- package/lib/components/modal-title.js.map +0 -1
- package/lib/components/modal.d.ts +0 -7
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js.map +0 -1
- package/lib/components/toolbar.d.ts +0 -10
- package/lib/components/toolbar.d.ts.map +0 -1
- package/lib/components/toolbar.js +0 -25
- package/lib/components/toolbar.js.map +0 -1
- package/lib/constants/mongodb-ace-theme-query.d.ts +0 -3
- package/lib/constants/mongodb-ace-theme-query.d.ts.map +0 -1
- package/lib/constants/mongodb-ace-theme-query.js +0 -123
- package/lib/constants/mongodb-ace-theme-query.js.map +0 -1
- package/lib/constants/mongodb-ace-theme.d.ts +0 -3
- package/lib/constants/mongodb-ace-theme.d.ts.map +0 -1
- package/lib/constants/mongodb-ace-theme.js +0 -113
- package/lib/constants/mongodb-ace-theme.js.map +0 -1
|
@@ -26,8 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
30
|
-
exports.ComboboxGroup = exports.ComboboxOption = exports.Combobox = void 0;
|
|
29
|
+
exports.InlineKeyCode = exports.InlineCode = exports.Body = exports.Subtitle = exports.H3 = exports.H2 = exports.H1 = exports.Toggle = exports.ToastVariant = exports.Toast = exports.TextInput = exports.TextArea = exports.Tabs = exports.Tab = exports.Stage = exports.Cell = exports.Row = exports.TableHeader = exports.Table = exports.OptionGroup = exports.Option = exports.Select = exports.SegmentedControlOption = exports.SegmentedControl = exports.RadioGroup = exports.Radio = exports.RadioBoxGroup = exports.RadioBox = exports.Popover = exports.Pipeline = exports.MongoDBLogo = exports.MongoDBLogoMark = exports.MarketingModal = exports.ModalFooter = exports.Modal = exports.MenuSeparator = exports.MenuItem = exports.Menu = exports.Language = exports.IconButton = exports.Icon = exports.ConfirmationModal = exports.Code = exports.Checkbox = exports.Card = exports.Button = exports.Banner = exports.Badge = exports.AtlasLogoMark = exports.AtlasLogo = void 0;
|
|
30
|
+
exports.ComboboxGroup = exports.ComboboxOption = exports.Combobox = exports.Description = exports.Link = exports.Label = exports.Overline = exports.Disclaimer = void 0;
|
|
31
|
+
const react_1 = __importDefault(require("react"));
|
|
31
32
|
const use_theme_1 = require("../hooks/use-theme");
|
|
32
33
|
const badge_1 = __importDefault(require("@leafygreen-ui/badge"));
|
|
33
34
|
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return badge_1.default; } });
|
|
@@ -36,12 +37,16 @@ Object.defineProperty(exports, "Banner", { enumerable: true, get: function () {
|
|
|
36
37
|
const button_1 = __importDefault(require("@leafygreen-ui/button"));
|
|
37
38
|
const checkbox_1 = __importDefault(require("@leafygreen-ui/checkbox"));
|
|
38
39
|
const card_1 = __importDefault(require("@leafygreen-ui/card"));
|
|
39
|
-
const code_1 =
|
|
40
|
+
const code_1 = __importStar(require("@leafygreen-ui/code"));
|
|
41
|
+
Object.defineProperty(exports, "Language", { enumerable: true, get: function () { return code_1.Language; } });
|
|
42
|
+
const combobox_1 = require("@leafygreen-ui/combobox");
|
|
43
|
+
Object.defineProperty(exports, "ComboboxOption", { enumerable: true, get: function () { return combobox_1.ComboboxOption; } });
|
|
44
|
+
Object.defineProperty(exports, "ComboboxGroup", { enumerable: true, get: function () { return combobox_1.ComboboxGroup; } });
|
|
40
45
|
const confirmation_modal_1 = __importDefault(require("@leafygreen-ui/confirmation-modal"));
|
|
41
46
|
const icon_1 = __importDefault(require("@leafygreen-ui/icon"));
|
|
42
|
-
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return icon_1.default; } });
|
|
43
47
|
const icon_button_1 = __importDefault(require("@leafygreen-ui/icon-button"));
|
|
44
48
|
const logo_1 = require("@leafygreen-ui/logo");
|
|
49
|
+
Object.defineProperty(exports, "AtlasLogo", { enumerable: true, get: function () { return logo_1.AtlasLogo; } });
|
|
45
50
|
Object.defineProperty(exports, "AtlasLogoMark", { enumerable: true, get: function () { return logo_1.AtlasLogoMark; } });
|
|
46
51
|
Object.defineProperty(exports, "MongoDBLogoMark", { enumerable: true, get: function () { return logo_1.MongoDBLogoMark; } });
|
|
47
52
|
Object.defineProperty(exports, "MongoDBLogo", { enumerable: true, get: function () { return logo_1.MongoDBLogo; } });
|
|
@@ -49,7 +54,14 @@ const menu_1 = require("@leafygreen-ui/menu");
|
|
|
49
54
|
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return menu_1.Menu; } });
|
|
50
55
|
Object.defineProperty(exports, "MenuSeparator", { enumerable: true, get: function () { return menu_1.MenuSeparator; } });
|
|
51
56
|
Object.defineProperty(exports, "MenuItem", { enumerable: true, get: function () { return menu_1.MenuItem; } });
|
|
57
|
+
menu_1.MenuItem.defaultProps = {
|
|
58
|
+
...menu_1.MenuItem.defaultProps,
|
|
59
|
+
type: 'button',
|
|
60
|
+
};
|
|
52
61
|
const modal_1 = __importStar(require("@leafygreen-ui/modal"));
|
|
62
|
+
const marketing_modal_1 = __importDefault(require("@leafygreen-ui/marketing-modal"));
|
|
63
|
+
const pipeline_1 = require("@leafygreen-ui/pipeline");
|
|
64
|
+
Object.defineProperty(exports, "Stage", { enumerable: true, get: function () { return pipeline_1.Stage; } });
|
|
53
65
|
const popover_1 = __importDefault(require("@leafygreen-ui/popover"));
|
|
54
66
|
exports.Popover = popover_1.default;
|
|
55
67
|
const radio_box_group_1 = require("@leafygreen-ui/radio-box-group");
|
|
@@ -75,9 +87,6 @@ Object.defineProperty(exports, "Toast", { enumerable: true, get: function () { r
|
|
|
75
87
|
Object.defineProperty(exports, "ToastVariant", { enumerable: true, get: function () { return toast_1.Variant; } });
|
|
76
88
|
const toggle_1 = __importDefault(require("@leafygreen-ui/toggle"));
|
|
77
89
|
const typography_1 = require("@leafygreen-ui/typography");
|
|
78
|
-
const combobox_1 = require("@leafygreen-ui/combobox");
|
|
79
|
-
Object.defineProperty(exports, "ComboboxOption", { enumerable: true, get: function () { return combobox_1.ComboboxOption; } });
|
|
80
|
-
Object.defineProperty(exports, "ComboboxGroup", { enumerable: true, get: function () { return combobox_1.ComboboxGroup; } });
|
|
81
90
|
const H1 = (0, use_theme_1.withTheme)(typography_1.H1);
|
|
82
91
|
exports.H1 = H1;
|
|
83
92
|
const H2 = (0, use_theme_1.withTheme)(typography_1.H2);
|
|
@@ -106,6 +115,8 @@ const Checkbox = (0, use_theme_1.withTheme)(checkbox_1.default);
|
|
|
106
115
|
exports.Checkbox = Checkbox;
|
|
107
116
|
const Code = (0, use_theme_1.withTheme)(code_1.default);
|
|
108
117
|
exports.Code = Code;
|
|
118
|
+
const Combobox = (0, use_theme_1.withTheme)(combobox_1.Combobox);
|
|
119
|
+
exports.Combobox = Combobox;
|
|
109
120
|
const ConfirmationModal = (0, use_theme_1.withTheme)(confirmation_modal_1.default);
|
|
110
121
|
exports.ConfirmationModal = ConfirmationModal;
|
|
111
122
|
const IconButton = (0, use_theme_1.withTheme)(icon_button_1.default);
|
|
@@ -114,6 +125,10 @@ const ModalFooter = (0, use_theme_1.withTheme)(modal_1.Footer);
|
|
|
114
125
|
exports.ModalFooter = ModalFooter;
|
|
115
126
|
const Modal = (0, use_theme_1.withTheme)(modal_1.default);
|
|
116
127
|
exports.Modal = Modal;
|
|
128
|
+
const MarketingModal = (0, use_theme_1.withTheme)(marketing_modal_1.default);
|
|
129
|
+
exports.MarketingModal = MarketingModal;
|
|
130
|
+
const Pipeline = (0, use_theme_1.withTheme)(pipeline_1.Pipeline);
|
|
131
|
+
exports.Pipeline = Pipeline;
|
|
117
132
|
const RadioGroup = (0, use_theme_1.withTheme)(radio_group_1.RadioGroup);
|
|
118
133
|
exports.RadioGroup = RadioGroup;
|
|
119
134
|
const SegmentedControl = (0, use_theme_1.withTheme)(segmented_control_1.SegmentedControl);
|
|
@@ -134,6 +149,9 @@ const Label = (0, use_theme_1.withTheme)(typography_1.Label);
|
|
|
134
149
|
exports.Label = Label;
|
|
135
150
|
const Description = (0, use_theme_1.withTheme)(typography_1.Description);
|
|
136
151
|
exports.Description = Description;
|
|
137
|
-
const
|
|
138
|
-
|
|
152
|
+
const Icon = ({ size, ...rest }) => {
|
|
153
|
+
size = size === 'xsmall' ? 12 : size;
|
|
154
|
+
return react_1.default.createElement(icon_1.default, { size: size, ...rest });
|
|
155
|
+
};
|
|
156
|
+
exports.Icon = Icon;
|
|
139
157
|
//# sourceMappingURL=leafygreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafygreen.js","sourceRoot":"","sources":["../../src/components/leafygreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"leafygreen.js","sourceRoot":"","sources":["../../src/components/leafygreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,kDAA+C;AAM/C,iEAAwD;AA8MtD,sFA9MkB,eAAK,OA8MlB;AA7MP,mEAA0D;AA8MxD,uFA9MkB,gBAAM,OA8MlB;AA7MR,mEAAoE;AACpE,uEAAwE;A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AAG,CAAC,EACZ,IAAI,EACJ,GAAG,IAAI,EAGR,EAAE,EAAE;IACH,IAAI,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrC,OAAO,8BAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,GAAI,CAAC;AAClD,CAAC,CAAC;AAaA,oBAAI"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ListEditorProps<ItemType> = {
|
|
3
|
+
items: ItemType[];
|
|
4
|
+
renderItem: (item: ItemType, index: number) => JSX.Element;
|
|
5
|
+
disableAddButton?: (item: ItemType, index: number, items: ItemType[]) => boolean;
|
|
6
|
+
disableRemoveButton?: (item: ItemType, index: number, items: ItemType[]) => boolean;
|
|
7
|
+
onAddItem: (indexBefore: number) => void;
|
|
8
|
+
onRemoveItem: (index: number) => void;
|
|
9
|
+
addButtonTestId?: string;
|
|
10
|
+
removeButtonTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function ListEditor<ItemType>({ disableAddButton, disableRemoveButton, items, renderItem, onAddItem, onRemoveItem, addButtonTestId, removeButtonTestId, }: ListEditorProps<ItemType>): React.ReactElement;
|
|
13
|
+
export { ListEditor };
|
|
14
|
+
//# sourceMappingURL=list-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-editor.d.ts","sourceRoot":"","sources":["../../src/components/list-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,aAAK,eAAe,CAAC,QAAQ,IAAI;IAE/B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAElB,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC;IAE3D,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,QAAQ,EAAE,KACd,OAAO,CAAC;IAEb,mBAAmB,CAAC,EAAE,CACpB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,QAAQ,EAAE,KACd,OAAO,CAAC;IAEb,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,iBAAS,UAAU,CAAC,QAAQ,EAAE,EAC5B,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAiChD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.ListEditor = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
9
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
10
|
+
const leafygreen_1 = require("./leafygreen");
|
|
11
|
+
const listEditorStyles = (0, emotion_1.css)({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
gap: tokens_1.spacing[2],
|
|
15
|
+
});
|
|
16
|
+
const listItemStyles = (0, emotion_1.css)({
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
gap: tokens_1.spacing[1],
|
|
20
|
+
});
|
|
21
|
+
const itemContentStyles = (0, emotion_1.css)({
|
|
22
|
+
display: 'inline-block',
|
|
23
|
+
maxWidth: tokens_1.spacing[7] * 5,
|
|
24
|
+
flexGrow: 1,
|
|
25
|
+
});
|
|
26
|
+
function ListEditor({ disableAddButton, disableRemoveButton, items, renderItem, onAddItem, onRemoveItem, addButtonTestId, removeButtonTestId, }) {
|
|
27
|
+
return (react_1.default.createElement("div", { className: listEditorStyles }, items.map((item, itemIndex) => (react_1.default.createElement("div", { className: listItemStyles, key: itemIndex },
|
|
28
|
+
react_1.default.createElement("div", { className: itemContentStyles }, renderItem(item, itemIndex)),
|
|
29
|
+
!(disableAddButton === null || disableAddButton === void 0 ? void 0 : disableAddButton(item, itemIndex, items)) ? (react_1.default.createElement(leafygreen_1.IconButton, { "aria-label": "Add", type: "button", "data-testid": addButtonTestId, disabled: disableAddButton === null || disableAddButton === void 0 ? void 0 : disableAddButton(item, itemIndex, items), onClick: () => onAddItem(itemIndex) },
|
|
30
|
+
react_1.default.createElement(leafygreen_1.Icon, { glyph: "Plus" }))) : null,
|
|
31
|
+
!(disableRemoveButton === null || disableRemoveButton === void 0 ? void 0 : disableRemoveButton(item, itemIndex, items)) &&
|
|
32
|
+
items.length !== 1 ? (react_1.default.createElement(leafygreen_1.IconButton, { "aria-label": "Remove", type: "button", "data-testid": removeButtonTestId, disabled: disableRemoveButton === null || disableRemoveButton === void 0 ? void 0 : disableRemoveButton(item, itemIndex, items), onClick: () => onRemoveItem(itemIndex) },
|
|
33
|
+
react_1.default.createElement(leafygreen_1.Icon, { glyph: "Minus" }))) : null)))));
|
|
34
|
+
}
|
|
35
|
+
exports.ListEditor = ListEditor;
|
|
36
|
+
//# sourceMappingURL=list-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-editor.js","sourceRoot":"","sources":["../../src/components/list-editor.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kDA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CAAC,SAAS,CAAC,SAAS,CAAC;YAEnC,8BAAC,iBAAI,IAAC,KAAK,EAAC,MAAM,GAAG,CACV,CACd,CAAC,CAAC,CAAC,IAAI;QACP,CAAC,CAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;YAC/C,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACnB,8BAAC,uBAAU,kBACE,QAAQ,EACnB,IAAI,EAAC,QAAQ,iBACA,kBAAkB,EAC/B,QAAQ,EAAE,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EACvD,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC;YAEtC,8BAAC,iBAAI,IAAC,KAAK,EAAC,OAAO,GAAG,CACX,CACd,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC;AAEQ,gCAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ConfirmationModal as LeafyGreenConfirmationModal } from '
|
|
2
|
+
import { ConfirmationModal as LeafyGreenConfirmationModal } from '../leafygreen';
|
|
3
3
|
declare function ConfirmationModal({ trackingId, ...props }: React.ComponentProps<typeof LeafyGreenConfirmationModal> & {
|
|
4
4
|
trackingId?: string;
|
|
5
5
|
}): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-modal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/confirmation-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,iBAAiB,IAAI,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjF,iBAAS,iBAAiB,CAAC,EACzB,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,2BAA2B,CAAC,GAAG;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,KAAK,CAAC,YAAY,CAOrB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
27
|
const compass_logging_1 = require("@mongodb-js/compass-logging");
|
|
28
28
|
const { track } = (0, compass_logging_1.createLoggerAndTelemetry)('COMPASS-UI');
|
|
29
|
-
const leafygreen_1 = require("
|
|
29
|
+
const leafygreen_1 = require("../leafygreen");
|
|
30
30
|
function ConfirmationModal({ trackingId, ...props }) {
|
|
31
31
|
(0, react_1.useEffect)(() => {
|
|
32
32
|
if (props.open && trackingId) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-modal.js","sourceRoot":"","sources":["../../../src/components/modals/confirmation-modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,iEAAuE;AACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,0CAAwB,EAAC,YAAY,CAAC,CAAC;AAEzD,8CAAiF;AAEjF,SAAS,iBAAiB,CAAC,EACzB,UAAU,EACV,GAAG,KAAK,EAGT;IACC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,IAAI,IAAI,UAAU,EAAE;YAC5B,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;SACvC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7B,OAAO,8BAAC,8BAA2B,mBAAc,UAAU,KAAM,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal } from './modal';
|
|
3
|
+
export declare const Variant: {
|
|
4
|
+
readonly Default: "primary";
|
|
5
|
+
readonly Danger: "danger";
|
|
6
|
+
};
|
|
7
|
+
export declare type Variant = typeof Variant[keyof typeof Variant];
|
|
8
|
+
declare type FormModalProps = React.ComponentProps<typeof Modal> & {
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
title: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
submitButtonText: string;
|
|
13
|
+
cancelButtonText?: string;
|
|
14
|
+
submitDisabled?: boolean;
|
|
15
|
+
scroll?: boolean;
|
|
16
|
+
minBodyHeight?: number;
|
|
17
|
+
onSubmit: () => void;
|
|
18
|
+
onCancel: () => void;
|
|
19
|
+
};
|
|
20
|
+
declare function FormModal({ title, subtitle, submitButtonText, cancelButtonText, submitDisabled, variant, scroll, minBodyHeight, onSubmit, onCancel, children, ...modalProps }: FormModalProps): JSX.Element;
|
|
21
|
+
export { FormModal };
|
|
22
|
+
//# sourceMappingURL=form-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-modal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/form-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAOhC,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAEX,oBAAY,OAAO,GAAG,OAAO,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE3D,aAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,GAAG;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAA2B,EAC3B,cAAsB,EACtB,OAAyB,EACzB,MAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,UAAU,EACd,EAAE,cAAc,eAiChB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.FormModal = exports.Variant = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const button_1 = require("@leafygreen-ui/button");
|
|
9
|
+
const modal_1 = require("./modal");
|
|
10
|
+
const leafygreen_1 = require("../leafygreen");
|
|
11
|
+
const modal_body_1 = require("./modal-body");
|
|
12
|
+
const modal_header_1 = require("./modal-header");
|
|
13
|
+
const modal_footer_button_1 = require("./modal-footer-button");
|
|
14
|
+
exports.Variant = {
|
|
15
|
+
Default: button_1.Variant.Primary,
|
|
16
|
+
Danger: button_1.Variant.Danger,
|
|
17
|
+
};
|
|
18
|
+
function FormModal({ title, subtitle, submitButtonText, cancelButtonText = 'Cancel', submitDisabled = false, variant = exports.Variant.Default, scroll = true, minBodyHeight, onSubmit, onCancel, children, ...modalProps }) {
|
|
19
|
+
return (react_1.default.createElement(modal_1.Modal, { setOpen: onCancel, ...modalProps },
|
|
20
|
+
react_1.default.createElement("form", { onSubmit: (event) => {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
onSubmit();
|
|
23
|
+
} },
|
|
24
|
+
react_1.default.createElement(modal_header_1.ModalHeader, { title: title, subtitle: subtitle, variant: variant }),
|
|
25
|
+
react_1.default.createElement(modal_body_1.ModalBody, { variant: variant, scroll: scroll, minHeight: minBodyHeight }, children),
|
|
26
|
+
react_1.default.createElement(leafygreen_1.ModalFooter, null,
|
|
27
|
+
react_1.default.createElement(modal_footer_button_1.ModalFooterButton, { "data-testid": "submit-button", variant: variant, type: "submit", disabled: submitDisabled }, submitButtonText),
|
|
28
|
+
react_1.default.createElement(modal_footer_button_1.ModalFooterButton, { "data-testid": "cancel-button", onClick: onCancel, variant: "default" }, cancelButtonText)))));
|
|
29
|
+
}
|
|
30
|
+
exports.FormModal = FormModal;
|
|
31
|
+
//# sourceMappingURL=form-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-modal.js","sourceRoot":"","sources":["../../../src/components/modals/form-modal.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kDAAiE;AACjE,mCAAgC;AAChC,8CAA4C;AAE5C,6CAAyC;AACzC,iDAA6C;AAC7C,+DAA0D;AAE7C,QAAA,OAAO,GAAG;IACrB,OAAO,EAAE,gBAAa,CAAC,OAAO;IAC9B,MAAM,EAAE,gBAAa,CAAC,MAAM;CACpB,CAAC;AAiBX,SAAS,SAAS,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,GAAG,QAAQ,EAC3B,cAAc,GAAG,KAAK,EACtB,OAAO,GAAG,eAAO,CAAC,OAAO,EACzB,MAAM,GAAG,IAAI,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,UAAU,EACE;IACf,OAAO,CACL,8BAAC,aAAK,IAAC,OAAO,EAAE,QAAQ,KAAM,UAAU;QACtC,wCACE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,QAAQ,EAAE,CAAC;YACb,CAAC;YAED,8BAAC,0BAAW,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI;YACnE,8BAAC,sBAAS,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,IAClE,QAAQ,CACC;YACZ,8BAAC,wBAAW;gBACV,8BAAC,uCAAiB,mBACJ,eAAe,EAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,cAAc,IAEvB,gBAAgB,CACC;gBACpB,8BAAC,uCAAiB,mBACJ,eAAe,EAC3B,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAC,SAAS,IAEhB,gBAAgB,CACC,CACR,CACT,CACD,CACT,CAAC;AACJ,CAAC;AAEQ,8BAAS"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal } from './modal';
|
|
3
|
+
declare type InfoModalProps = React.ComponentProps<typeof Modal> & {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
showCloseButton?: boolean;
|
|
7
|
+
closeButtonText?: string;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare function InfoModal({ title, subtitle, showCloseButton, closeButtonText, onClose, children, ...modalProps }: InfoModalProps): JSX.Element;
|
|
11
|
+
export { InfoModal };
|
|
12
|
+
//# sourceMappingURL=info-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-modal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/info-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMhC,aAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,GAAG;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,eAAsB,EACtB,eAAyB,EACzB,OAAO,EACP,QAAQ,EACR,GAAG,UAAU,EACd,EAAE,cAAc,eAwBhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.InfoModal = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
+
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
10
|
+
const modal_1 = require("./modal");
|
|
11
|
+
const leafygreen_1 = require("../leafygreen");
|
|
12
|
+
const modal_body_1 = require("./modal-body");
|
|
13
|
+
const modal_header_1 = require("./modal-header");
|
|
14
|
+
const modal_footer_button_1 = require("./modal-footer-button");
|
|
15
|
+
function InfoModal({ title, subtitle, showCloseButton = true, closeButtonText = 'Close', onClose, children, ...modalProps }) {
|
|
16
|
+
return (react_1.default.createElement(modal_1.Modal, { setOpen: onClose, contentClassName: (0, emotion_1.cx)(!showCloseButton && (0, emotion_1.css)({ paddingBottom: tokens_1.spacing[5] })), ...modalProps },
|
|
17
|
+
react_1.default.createElement(modal_header_1.ModalHeader, { title: title, subtitle: subtitle }),
|
|
18
|
+
react_1.default.createElement(modal_body_1.ModalBody, null, children),
|
|
19
|
+
showCloseButton && (react_1.default.createElement(leafygreen_1.ModalFooter, null,
|
|
20
|
+
react_1.default.createElement(modal_footer_button_1.ModalFooterButton, { "data-testid": "close-button", onClick: onClose, variant: "default" }, closeButtonText)))));
|
|
21
|
+
}
|
|
22
|
+
exports.InfoModal = InfoModal;
|
|
23
|
+
//# sourceMappingURL=info-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-modal.js","sourceRoot":"","sources":["../../../src/components/modals/info-modal.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oDAAiD;AACjD,kDAAgD;AAEhD,mCAAgC;AAChC,8CAA4C;AAC5C,6CAAyC;AACzC,iDAA6C;AAC7C,+DAA0D;AAU1D,SAAS,SAAS,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,eAAe,GAAG,OAAO,EACzB,OAAO,EACP,QAAQ,EACR,GAAG,UAAU,EACE;IACf,OAAO,CACL,8BAAC,aAAK,IACJ,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,IAAA,YAAE,EAClB,CAAC,eAAe,IAAI,IAAA,aAAG,EAAC,EAAE,aAAa,EAAE,gBAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CACvD,KACG,UAAU;QAEd,8BAAC,0BAAW,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI;QACjD,8BAAC,sBAAS,QAAE,QAAQ,CAAa;QAChC,eAAe,IAAI,CAClB,8BAAC,wBAAW;YACV,8BAAC,uCAAiB,mBACJ,cAAc,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAC,SAAS,IAEhB,eAAe,CACE,CACR,CACf,CACK,CACT,CAAC;AACJ,CAAC;AAEQ,8BAAS"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Variant: {
|
|
3
|
+
readonly Default: "primary";
|
|
4
|
+
readonly Danger: "danger";
|
|
5
|
+
};
|
|
6
|
+
export declare type Variant = typeof Variant[keyof typeof Variant];
|
|
7
|
+
declare type ModalBodyProps = {
|
|
8
|
+
variant?: Variant;
|
|
9
|
+
className?: string;
|
|
10
|
+
scroll?: boolean;
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const ModalBody: React.ForwardRefExoticComponent<ModalBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export { ModalBody };
|
|
16
|
+
//# sourceMappingURL=modal-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-body.d.ts","sourceRoot":"","sources":["../../../src/components/modals/modal-body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAEX,oBAAY,OAAO,GAAG,OAAO,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAwB3D,aAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS,uFAsBb,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ModalBody = exports.Variant = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
29
|
+
const palette_1 = require("@leafygreen-ui/palette");
|
|
30
|
+
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
31
|
+
const button_1 = require("@leafygreen-ui/button");
|
|
32
|
+
exports.Variant = {
|
|
33
|
+
Default: button_1.Variant.Primary,
|
|
34
|
+
Danger: button_1.Variant.Danger,
|
|
35
|
+
};
|
|
36
|
+
const contentStyle = (0, emotion_1.css)({
|
|
37
|
+
padding: `0 ${tokens_1.spacing[5]}px`,
|
|
38
|
+
paddingBottom: tokens_1.spacing[1],
|
|
39
|
+
fontFamily: tokens_1.fontFamilies.default,
|
|
40
|
+
fontSize: '13px',
|
|
41
|
+
lineHeight: '20px',
|
|
42
|
+
color: palette_1.palette.black,
|
|
43
|
+
maxHeight: `calc(100vh - ${tokens_1.spacing[6] * 5}px)`,
|
|
44
|
+
overflow: 'auto',
|
|
45
|
+
'&:first-child': {
|
|
46
|
+
paddingTop: tokens_1.spacing[5],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const variantStyle = {
|
|
50
|
+
[exports.Variant.Default]: (0, emotion_1.css)({}),
|
|
51
|
+
[exports.Variant.Danger]: (0, emotion_1.css)({
|
|
52
|
+
paddingLeft: '78px',
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
const ModalBody = (0, react_1.forwardRef)(function ModalBody({ variant = exports.Variant.Default, className, scroll = true, minHeight, children }, ref) {
|
|
56
|
+
const style = {};
|
|
57
|
+
if (minHeight) {
|
|
58
|
+
style.minHeight = `${minHeight}px`;
|
|
59
|
+
}
|
|
60
|
+
if (scroll === false) {
|
|
61
|
+
style.overflow = 'visible';
|
|
62
|
+
}
|
|
63
|
+
return (react_1.default.createElement("div", { className: (0, emotion_1.cx)(contentStyle, variantStyle[variant], className), style: style, ref: ref }, children));
|
|
64
|
+
});
|
|
65
|
+
exports.ModalBody = ModalBody;
|
|
66
|
+
//# sourceMappingURL=modal-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-body.js","sourceRoot":"","sources":["../../../src/components/modals/modal-body.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,oDAAiD;AACjD,oDAAiD;AACjD,kDAA8D;AAC9D,kDAAiE;AAEpD,QAAA,OAAO,GAAG;IACrB,OAAO,EAAE,gBAAa,CAAC,OAAO;IAC9B,MAAM,EAAE,gBAAa,CAAC,MAAM;CACpB,CAAC;AAIX,MAAM,YAAY,GAAG,IAAA,aAAG,EAAC;IACvB,OAAO,EAAE,KAAK,gBAAO,CAAC,CAAC,CAAC,IAAI;IAC5B,aAAa,EAAE,gBAAO,CAAC,CAAC,CAAC;IACzB,UAAU,EAAE,qBAAY,CAAC,OAAO;IAChC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,iBAAO,CAAC,KAAK;IACpB,SAAS,EAAE,gBAAgB,g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,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.ModalFooterButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
+
const leafygreen_1 = require("../leafygreen");
|
|
10
|
+
const use_theme_1 = require("../../hooks/use-theme");
|
|
11
|
+
const buttonStyle = {
|
|
12
|
+
[use_theme_1.Theme.Light]: (0, emotion_1.css)({
|
|
13
|
+
margin: '0 2px',
|
|
14
|
+
'&:first-of-type': {
|
|
15
|
+
margin: '0 0 0 5px',
|
|
16
|
+
},
|
|
17
|
+
'&:last-of-type': {
|
|
18
|
+
margin: '0 5px 0 0',
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
[use_theme_1.Theme.Dark]: (0, emotion_1.css)({
|
|
22
|
+
margin: '0 2px',
|
|
23
|
+
'&:first-of-type': {
|
|
24
|
+
margin: '0 0 0 4px',
|
|
25
|
+
},
|
|
26
|
+
'&:last-of-type': {
|
|
27
|
+
margin: '0 4px 0 0',
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
function UnthemedModalFooterButton({ className, ...props }) {
|
|
32
|
+
const { theme } = (0, use_theme_1.useTheme)();
|
|
33
|
+
return react_1.default.createElement(leafygreen_1.Button, { ...props, className: (0, emotion_1.cx)(className, buttonStyle[theme]) });
|
|
34
|
+
}
|
|
35
|
+
const ModalFooterButton = (0, use_theme_1.withTheme)(UnthemedModalFooterButton);
|
|
36
|
+
exports.ModalFooterButton = ModalFooterButton;
|
|
37
|
+
//# sourceMappingURL=modal-footer-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-footer-button.js","sourceRoot":"","sources":["../../../src/components/modals/modal-footer-button.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oDAAiD;AAEjD,8CAAuC;AACvC,qDAAmE;AAEnE,MAAM,WAAW,GAAG;IAClB,CAAC,iBAAK,CAAC,KAAK,CAAC,EAAE,IAAA,aAAG,EAAC;QACjB,MAAM,EAAE,OAAO;QACf,iBAAiB,EAAE;YACjB,MAAM,EAAE,WAAW;SACpB;QACD,gBAAgB,EAAE;YAChB,MAAM,EAAE,WAAW;SACpB;KACF,CAAC;IACF,CAAC,iBAAK,CAAC,IAAI,CAAC,EAAE,IAAA,aAAG,EAAC;QAChB,MAAM,EAAE,OAAO;QACf,iBAAiB,EAAE;YACjB,MAAM,EAAE,WAAW;SACpB;QACD,gBAAgB,EAAE;YAChB,MAAM,EAAE,WAAW;SACpB;KACF,CAAC;CACH,CAAC;AAEF,SAAS,yBAAyB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAe;IACrE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAQ,GAAE,CAAC;IAC7B,OAAO,8BAAC,mBAAM,OAAK,KAAK,EAAE,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,GAAI,CAAC;AAC7E,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAA,qBAAS,EAAC,yBAAyB,CAAC,CAAC;AAEtD,8CAAiB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Variant: {
|
|
3
|
+
readonly Default: "primary";
|
|
4
|
+
readonly Danger: "danger";
|
|
5
|
+
};
|
|
6
|
+
export declare type Variant = typeof Variant[keyof typeof Variant];
|
|
7
|
+
declare type ModalHeaderProps = {
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
variant?: Variant;
|
|
11
|
+
darkMode?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const ModalHeader: React.ComponentType<ModalHeaderProps>;
|
|
14
|
+
export { ModalHeader };
|
|
15
|
+
//# sourceMappingURL=modal-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-header.d.ts","sourceRoot":"","sources":["../../../src/components/modals/modal-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAEX,oBAAY,OAAO,GAAG,OAAO,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AA8C3D,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA2BF,QAAA,MAAM,WAAW,uCAAiC,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.ModalHeader = exports.Variant = 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 tokens_1 = require("@leafygreen-ui/tokens");
|
|
11
|
+
const button_1 = require("@leafygreen-ui/button");
|
|
12
|
+
const use_theme_1 = require("../../hooks/use-theme");
|
|
13
|
+
const leafygreen_1 = require("../leafygreen");
|
|
14
|
+
exports.Variant = {
|
|
15
|
+
Default: button_1.Variant.Primary,
|
|
16
|
+
Danger: button_1.Variant.Danger,
|
|
17
|
+
};
|
|
18
|
+
const headerStyle = (0, emotion_1.css)({
|
|
19
|
+
padding: tokens_1.spacing[5],
|
|
20
|
+
paddingBottom: 0,
|
|
21
|
+
});
|
|
22
|
+
const variantStyle = {
|
|
23
|
+
[exports.Variant.Default]: (0, emotion_1.css)({}),
|
|
24
|
+
[exports.Variant.Danger]: (0, emotion_1.css)({
|
|
25
|
+
paddingLeft: '78px',
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
const titleStyle = (0, emotion_1.css)({
|
|
29
|
+
fontSize: '24px',
|
|
30
|
+
fontWeight: 700,
|
|
31
|
+
lineHeight: '32px',
|
|
32
|
+
margin: 0,
|
|
33
|
+
marginBottom: '10px',
|
|
34
|
+
color: palette_1.palette.black,
|
|
35
|
+
});
|
|
36
|
+
const titleStyleDark = (0, emotion_1.css)({
|
|
37
|
+
fontWeight: 'bold',
|
|
38
|
+
lineHeight: '25px',
|
|
39
|
+
color: palette_1.uiColors.gray.light2,
|
|
40
|
+
});
|
|
41
|
+
const warningIconStyles = (0, emotion_1.css)({
|
|
42
|
+
width: '32px',
|
|
43
|
+
height: '32px',
|
|
44
|
+
borderRadius: '50%',
|
|
45
|
+
background: `${palette_1.palette.red.light3}`,
|
|
46
|
+
display: 'flex',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
left: '36px',
|
|
51
|
+
top: '32px',
|
|
52
|
+
svg: {
|
|
53
|
+
marginTop: '-3px',
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
function UnthemedModalHeader({ title, subtitle, variant = exports.Variant.Default, darkMode, }) {
|
|
57
|
+
return (react_1.default.createElement("div", { className: (0, emotion_1.cx)(headerStyle, variantStyle[variant]) },
|
|
58
|
+
variant === exports.Variant.Danger && (react_1.default.createElement("div", { className: (0, emotion_1.cx)(warningIconStyles) },
|
|
59
|
+
react_1.default.createElement(leafygreen_1.Icon, { glyph: "Warning", fill: palette_1.palette.red.base, role: "presentation" }))),
|
|
60
|
+
react_1.default.createElement("h1", { className: (0, emotion_1.cx)(titleStyle, darkMode && titleStyleDark), "data-testid": "modal-title", id: "modal-title" }, title),
|
|
61
|
+
subtitle && react_1.default.createElement(leafygreen_1.Body, null, subtitle)));
|
|
62
|
+
}
|
|
63
|
+
const ModalHeader = (0, use_theme_1.withTheme)(UnthemedModalHeader);
|
|
64
|
+
exports.ModalHeader = ModalHeader;
|
|
65
|
+
//# sourceMappingURL=modal-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-header.js","sourceRoot":"","sources":["../../../src/components/modals/modal-header.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oDAAiD;AACjD,oDAA2D;AAC3D,kDAAgD;AAChD,kDAAiE;AACjE,qDAAkD;AAClD,8CAA2C;AAE9B,QAAA,OAAO,GAAG;IACrB,OAAO,EAAE,gBAAa,CAAC,OAAO;IAC9B,MAAM,EAAE,gBAAa,CAAC,MAAM;CACpB,CAAC;AAIX,MAAM,WAAW,GAAG,IAAA,aAAG,EAAC;IACtB,OAAO,EAAE,gBAAO,CAAC,CAAC,CAAC;IACnB,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG;IACnB,CAAC,eAAO,CAAC,OAAO,CAAC,EAAE,IAAA,aAAG,EAAC,EAAE,CAAC;IAC1B,CAAC,eAAO,CAAC,MAAM,CAAC,EAAE,IAAA,aAAG,EAAC;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,UAAU,GAAG,IAAA,aAAG,EAAC;IACrB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,CAAC;IACT,YAAY,EAAE,MAAM;IACpB,KAAK,EAAE,iBAAO,CAAC,KAAK;CACrB,CAAC,CAAC;AAEH,MAAM,cAAc,GA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C,CAAC;AAE1C,kCAAW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal as LeafyGreenModal } from '../leafygreen';
|
|
3
|
+
declare function Modal({ trackingId, contentClassName, ...props }: React.ComponentProps<typeof LeafyGreenModal> & {
|
|
4
|
+
trackingId?: string;
|
|
5
|
+
}): React.ReactElement;
|
|
6
|
+
export { Modal };
|
|
7
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAQzD,iBAAS,KAAK,CAAC,EACb,UAAU,EACV,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,KAAK,CAAC,YAAY,CAYrB;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -25,16 +25,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Modal = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
28
29
|
const compass_logging_1 = require("@mongodb-js/compass-logging");
|
|
29
30
|
const { track } = (0, compass_logging_1.createLoggerAndTelemetry)('COMPASS-UI');
|
|
30
|
-
const leafygreen_1 = require("
|
|
31
|
-
|
|
31
|
+
const leafygreen_1 = require("../leafygreen");
|
|
32
|
+
const contentStyles = (0, emotion_1.css)({
|
|
33
|
+
width: '600px',
|
|
34
|
+
letterSpacing: 0,
|
|
35
|
+
padding: 0,
|
|
36
|
+
});
|
|
37
|
+
function Modal({ trackingId, contentClassName, ...props }) {
|
|
32
38
|
(0, react_1.useEffect)(() => {
|
|
33
39
|
if (props.open && trackingId) {
|
|
34
40
|
track('Screen', { name: trackingId });
|
|
35
41
|
}
|
|
36
42
|
}, [props.open, trackingId]);
|
|
37
|
-
return react_1.default.createElement(leafygreen_1.Modal, { ...props });
|
|
43
|
+
return (react_1.default.createElement(leafygreen_1.Modal, { contentClassName: (0, emotion_1.cx)(contentStyles, contentClassName), ...props }));
|
|
38
44
|
}
|
|
39
45
|
exports.Modal = Modal;
|
|
40
46
|
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/components/modals/modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,oDAAiD;AACjD,iEAAuE;AACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,0CAAwB,EAAC,YAAY,CAAC,CAAC;AAEzD,8CAAyD;AAEzD,MAAM,aAAa,GAAG,IAAA,aAAG,EAAC;IACxB,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC;CACX,CAAC,CAAC;AAEH,SAAS,KAAK,CAAC,EACb,UAAU,EACV,gBAAgB,EAChB,GAAG,KAAK,EAGT;IACC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,IAAI,IAAI,UAAU,EAAE;YAC5B,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;SACvC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7B,OAAO,CACL,8BAAC,kBAAe,IACd,gBAAgB,EAAE,IAAA,YAAE,EAAC,aAAa,EAAE,gBAAgB,CAAC,KACjD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAEQ,sBAAK"}
|