@mongodb-js/compass-components 1.43.0 → 1.45.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/document-list/document-edit-actions-footer.d.ts.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.js +31 -26
- package/lib/components/document-list/document-edit-actions-footer.js.map +1 -1
- package/lib/components/drawer/constants.d.ts +9 -0
- package/lib/components/drawer/constants.d.ts.map +1 -0
- package/lib/components/drawer/constants.js +13 -0
- package/lib/components/drawer/constants.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.constants.d.ts +3 -0
- package/lib/components/drawer/drawer/drawer.constants.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.constants.js +6 -0
- package/lib/components/drawer/drawer/drawer.constants.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.d.ts +4 -0
- package/lib/components/drawer/drawer/drawer.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.js +137 -0
- package/lib/components/drawer/drawer/drawer.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.styles.d.ts +29 -0
- package/lib/components/drawer/drawer/drawer.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.styles.js +174 -0
- package/lib/components/drawer/drawer/drawer.styles.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.types.d.ts +35 -0
- package/lib/components/drawer/drawer/drawer.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.types.js +13 -0
- package/lib/components/drawer/drawer/drawer.types.js.map +1 -0
- package/lib/components/drawer/drawer/index.d.ts +5 -0
- package/lib/components/drawer/drawer/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer/index.js +12 -0
- package/lib/components/drawer/drawer/index.js.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.d.ts +17 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.js +57 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.js.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.d.ts +34 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.js +3 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/index.js +6 -0
- package/lib/components/drawer/drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.d.ts +8 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.js +71 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.d.ts +21 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.js +3 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/index.d.ts +3 -0
- package/lib/components/drawer/drawer-stack-context/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/index.js +8 -0
- package/lib/components/drawer/drawer-stack-context/index.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.d.ts +6 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.js +85 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.d.ts +37 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.js +3 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/index.d.ts +2 -0
- package/lib/components/drawer/drawer-toolbar-context/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/index.js +7 -0
- package/lib/components/drawer/drawer-toolbar-context/index.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.d.ts +18 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.js +82 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.d.ts +15 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.js +50 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.d.ts +2 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.js +11 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.d.ts +44 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.js +3 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.d.ts +3 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.js +6 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.d.ts +11 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.js +63 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.d.ts +10 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.js +137 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.d.ts +11 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.js +3 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.d.ts +2 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.js +6 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.d.ts +12 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.js +55 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.d.ts +6 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.js +54 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.d.ts +8 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.js +3 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/embedded-drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/index.js +6 -0
- package/lib/components/drawer/embedded-drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/index.d.ts +6 -0
- package/lib/components/drawer/index.d.ts.map +1 -0
- package/lib/components/drawer/index.js +17 -0
- package/lib/components/drawer/index.js.map +1 -0
- package/lib/components/drawer/layout-component/index.d.ts +3 -0
- package/lib/components/drawer/layout-component/index.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/index.js +6 -0
- package/lib/components/drawer/layout-component/index.js.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.d.ts +18 -0
- package/lib/components/drawer/layout-component/layout-component.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.js +53 -0
- package/lib/components/drawer/layout-component/layout-component.js.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.styles.d.ts +20 -0
- package/lib/components/drawer/layout-component/layout-component.styles.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.styles.js +3 -0
- package/lib/components/drawer/layout-component/layout-component.styles.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/overlay-drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/index.js +6 -0
- package/lib/components/drawer/overlay-drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.d.ts +11 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.js +54 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.d.ts +5 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.js +27 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.d.ts +3 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.js +3 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/utils/get-lg-ids.d.ts +8 -0
- package/lib/components/drawer/utils/get-lg-ids.d.ts.map +1 -0
- package/lib/components/drawer/utils/get-lg-ids.js +11 -0
- package/lib/components/drawer/utils/get-lg-ids.js.map +1 -0
- package/lib/components/drawer/utils/index.d.ts +2 -0
- package/lib/components/drawer/utils/index.d.ts.map +1 -0
- package/lib/components/drawer/utils/index.js +7 -0
- package/lib/components/drawer/utils/index.js.map +1 -0
- package/lib/components/{file-input.d.ts → file-picker-dialog.d.ts} +13 -3
- package/lib/components/file-picker-dialog.d.ts.map +1 -0
- package/lib/components/{file-input.js → file-picker-dialog.js} +13 -3
- package/lib/components/file-picker-dialog.js.map +1 -0
- package/lib/components/file-selector.d.ts +11 -0
- package/lib/components/file-selector.d.ts.map +1 -0
- package/lib/components/file-selector.js +49 -0
- package/lib/components/file-selector.js.map +1 -0
- package/lib/components/leafygreen.d.ts +1 -0
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +9 -2
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/toolbar/constants.d.ts +3 -0
- package/lib/components/toolbar/constants.d.ts.map +1 -0
- package/lib/components/toolbar/constants.js +6 -0
- package/lib/components/toolbar/constants.js.map +1 -0
- package/lib/components/toolbar/context/index.d.ts +3 -0
- package/lib/components/toolbar/context/index.d.ts.map +1 -0
- package/lib/components/toolbar/context/index.js +10 -0
- package/lib/components/toolbar/context/index.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.d.ts +6 -0
- package/lib/components/toolbar/context/toolbar-context.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.js +65 -0
- package/lib/components/toolbar/context/toolbar-context.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.types.d.ts +21 -0
- package/lib/components/toolbar/context/toolbar-context.types.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.types.js +3 -0
- package/lib/components/toolbar/context/toolbar-context.types.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.d.ts +5 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.js +10 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.js.map +1 -0
- package/lib/components/toolbar/index.d.ts +5 -0
- package/lib/components/toolbar/index.d.ts.map +1 -0
- package/lib/components/toolbar/index.js +27 -0
- package/lib/components/toolbar/index.js.map +1 -0
- package/lib/components/toolbar/toolbar/index.d.ts +4 -0
- package/lib/components/toolbar/toolbar/index.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/index.js +8 -0
- package/lib/components/toolbar/toolbar/index.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.d.ts +4 -0
- package/lib/components/toolbar/toolbar/toolbar.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.js +93 -0
- package/lib/components/toolbar/toolbar/toolbar.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.d.ts +7 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.js +26 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.types.d.ts +6 -0
- package/lib/components/toolbar/toolbar/toolbar.types.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.types.js +3 -0
- package/lib/components/toolbar/toolbar/toolbar.types.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/index.d.ts +3 -0
- package/lib/components/toolbar/toolbar-icon-button/index.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/index.js +6 -0
- package/lib/components/toolbar/toolbar-icon-button/index.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.d.ts +4 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.js +77 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.d.ts +13 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.js +38 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.d.ts +19 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.js +3 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.js.map +1 -0
- package/lib/components/toolbar/utils/get-lg-ids.d.ts +8 -0
- package/lib/components/toolbar/utils/get-lg-ids.d.ts.map +1 -0
- package/lib/components/toolbar/utils/get-lg-ids.js +14 -0
- package/lib/components/toolbar/utils/get-lg-ids.js.map +1 -0
- package/lib/components/toolbar/utils/index.d.ts +2 -0
- package/lib/components/toolbar/utils/index.d.ts.map +1 -0
- package/lib/components/toolbar/utils/index.js +7 -0
- package/lib/components/toolbar/utils/index.js.map +1 -0
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -7
- package/lib/index.js.map +1 -1
- package/package.json +11 -9
- package/lib/components/file-input.d.ts.map +0 -1
- package/lib/components/file-input.js.map +0 -1
|
@@ -36,8 +36,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.ComboboxOption = exports.ComboboxGroup = exports.Combobox = exports.getFilteredRowModel = exports.getExpandedRowModel = exports.useLeafyGreenTable = exports.flexRender = exports.InfoSprinkle = exports.SearchInput = exports.Description = exports.Label = exports.Overline = exports.Disclaimer = exports.InlineKeyCode = exports.InlineCode = exports.Body = exports.Subtitle = exports.H3 = exports.H2 = void 0;
|
|
39
|
+
exports.Tab = exports.Stage = exports.Cell = exports.Row = exports.TableHead = exports.TableBody = 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.Icon = exports.HeaderRow = exports.HeaderCell = exports.ExpandedContent = exports.ConfirmationModal = exports.Code = exports.Chip = exports.Checkbox = exports.Card = exports.Banner = exports.Badge = exports.AtlasNavGraphic = exports.useDrawerToolbarContext = exports.useDrawerStackContext = exports.DrawerStackProvider = exports.DrawerDisplayMode = exports.DrawerLayout = exports.Drawer = exports.IconButton = exports.Button = exports.Link = exports.useMergeRefs = exports.usePrevious = void 0;
|
|
40
|
+
exports.ComboboxOption = exports.ComboboxGroup = exports.Combobox = exports.getFilteredRowModel = exports.getExpandedRowModel = exports.useLeafyGreenTable = exports.flexRender = exports.InfoSprinkle = exports.SearchInput = exports.Description = exports.Label = exports.Overline = exports.Disclaimer = exports.InlineKeyCode = exports.InlineCode = exports.Body = exports.Subtitle = exports.H3 = exports.H2 = exports.H1 = exports.Tooltip = exports.Toggle = exports.TextInput = exports.TextArea = exports.Tabs = void 0;
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
// This file exports `@leafygreen-ui` components and wraps some of them.
|
|
43
43
|
// 1. Import the components we use from leafygreen.
|
|
@@ -167,4 +167,11 @@ const TextInput = react_1.default.forwardRef(function TextInput({ defaultValue,
|
|
|
167
167
|
});
|
|
168
168
|
exports.TextInput = TextInput;
|
|
169
169
|
TextInput.displayName = 'TextInput';
|
|
170
|
+
var drawer_1 = require("./drawer");
|
|
171
|
+
Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return drawer_1.Drawer; } });
|
|
172
|
+
Object.defineProperty(exports, "DrawerLayout", { enumerable: true, get: function () { return drawer_1.DrawerLayout; } });
|
|
173
|
+
Object.defineProperty(exports, "DrawerDisplayMode", { enumerable: true, get: function () { return drawer_1.DisplayMode; } });
|
|
174
|
+
Object.defineProperty(exports, "DrawerStackProvider", { enumerable: true, get: function () { return drawer_1.DrawerStackProvider; } });
|
|
175
|
+
Object.defineProperty(exports, "useDrawerStackContext", { enumerable: true, get: function () { return drawer_1.useDrawerStackContext; } });
|
|
176
|
+
Object.defineProperty(exports, "useDrawerToolbarContext", { enumerable: true, get: function () { return drawer_1.useDrawerToolbarContext; } });
|
|
170
177
|
//# sourceMappingURL=leafygreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafygreen.js","sourceRoot":"","sources":["../../src/components/leafygreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AAExC,wEAAwE;AAExE,mDAAmD;AACnD,iEAAwD;
|
|
1
|
+
{"version":3,"file":"leafygreen.js","sourceRoot":"","sources":["../../src/components/leafygreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AAExC,wEAAwE;AAExE,mDAAmD;AACnD,iEAAwD;AAgJtD,sFAhJkB,eAAK,OAgJlB;AA/IP,mEAA0D;AAgJxD,uFAhJkB,gBAAM,OAgJlB;AA/IR,uEAA+C;AAiJ7C,mBAjJK,kBAAQ,CAiJL;AAhJV,+DAAuC;AA+IrC,eA/IK,cAAI,CA+IL;AA9IN,4DAAqD;AAiJnD,eAjJK,cAAI,CAiJL;AAMJ,yFAvJa,eAAQ,OAuJb;AAtJV,2FAAkE;AAiJhE,4BAjJK,4BAAiB,CAiJL;AAhJnB,+DAAgE;AAGhE,8CAA2C;AA2IzC,qFA3IO,WAAI,OA2IP;AA1IN,8CAI6B;AAiI3B,gGApIA,sBAAe,OAoIA;AAmBf,gGAtJA,sBAAe,OAsJA;AACf,4FAtJA,kBAAW,OAsJA;AApJb,8CAAoE;AA6IlE,qFA7IO,WAAI,OA6IP;AAEJ,8FA/Ia,oBAAa,OA+Ib;AADb,yFA9I4B,eAAQ,OA8I5B;AA5IV,gEAA4D;AAsL1D,6FAtLO,4BAAY,OAsLP;AApLd,8EAA8E;AAC9E,kFAAkF;AAClF,2EAA2E;AAC1E,eAAgB,CAAC,YAAY,GAAG;IAC/B,GAAI,eAAgB,CAA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AAoB,CAAC,GAAG,IAAA,gBAAQ,EACxD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAC3B,CAAC;IACF,MAAM,YAAY,GAAG,OAAO,YAAY,KAAK,WAAW,CAAC;IACzD,OAAO,CACL,8BAAC,oBAAmB,OACd,KAAK,EACT,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,EAC/C,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC5C,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC,EACD,GAAG,EAAE,GAAG,GACa,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAyDA,8BAAS;AAvDX,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,mCAQkB;AAPhB,gGAAA,MAAM,OAAA;AACN,sGAAA,YAAY,OAAA;AACZ,2GAAA,WAAW,OAAqB;AAChC,6GAAA,mBAAmB,OAAA;AACnB,+GAAA,qBAAqB,OAAA;AACrB,iHAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,kBAAkB,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/toolbar/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,EAAE,CAAC;AACnB,QAAA,kBAAkB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useToolbarDescendantsContext = exports.ToolbarDescendantsContext = exports.useToolbarContext = exports.ToolbarContextProvider = void 0;
|
|
4
|
+
var toolbar_context_1 = require("./toolbar-context");
|
|
5
|
+
Object.defineProperty(exports, "ToolbarContextProvider", { enumerable: true, get: function () { return toolbar_context_1.ToolbarContextProvider; } });
|
|
6
|
+
Object.defineProperty(exports, "useToolbarContext", { enumerable: true, get: function () { return toolbar_context_1.useToolbarContext; } });
|
|
7
|
+
var toolbar_descendants_context_1 = require("./toolbar-descendants-context");
|
|
8
|
+
Object.defineProperty(exports, "ToolbarDescendantsContext", { enumerable: true, get: function () { return toolbar_descendants_context_1.ToolbarDescendantsContext; } });
|
|
9
|
+
Object.defineProperty(exports, "useToolbarDescendantsContext", { enumerable: true, get: function () { return toolbar_descendants_context_1.useToolbarDescendantsContext; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/toolbar/context/index.ts"],"names":[],"mappings":";;;AAAA,qDAA8E;AAArE,yHAAA,sBAAsB,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAClD,6EAGuC;AAFrC,wIAAA,yBAAyB,OAAA;AACzB,2IAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { ToolbarProviderProps } from './toolbar-context.types';
|
|
3
|
+
export declare const ToolbarContext: React.Context<ToolbarProviderProps>;
|
|
4
|
+
export declare const useToolbarContext: () => ToolbarProviderProps;
|
|
5
|
+
export declare const ToolbarContextProvider: ({ children, focusedIndex, shouldFocus, lgIds, handleOnIconButtonClick, darkMode, }: PropsWithChildren<ToolbarProviderProps>) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=toolbar-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-context.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,eAAO,MAAM,cAAc,qCAKzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,4BACoB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,GAAI,oFAOpC,iBAAiB,CAAC,oBAAoB,CAAC,sBAiBzC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ToolbarContextProvider = exports.useToolbarContext = exports.ToolbarContext = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const leafygreen_provider_1 = __importDefault(require("@leafygreen-ui/leafygreen-provider"));
|
|
42
|
+
const utils_1 = require("../utils");
|
|
43
|
+
exports.ToolbarContext = (0, react_1.createContext)({
|
|
44
|
+
focusedIndex: undefined,
|
|
45
|
+
shouldFocus: false,
|
|
46
|
+
lgIds: (0, utils_1.getLgIds)(),
|
|
47
|
+
handleOnIconButtonClick: () => { },
|
|
48
|
+
});
|
|
49
|
+
const useToolbarContext = () => (0, react_1.useContext)(exports.ToolbarContext);
|
|
50
|
+
exports.useToolbarContext = useToolbarContext;
|
|
51
|
+
const ToolbarContextProvider = ({ children, focusedIndex, shouldFocus, lgIds, handleOnIconButtonClick, darkMode = false, }) => {
|
|
52
|
+
const ToolbarProvider = exports.ToolbarContext.Provider;
|
|
53
|
+
const toolbarProviderData = (0, react_1.useMemo)(() => {
|
|
54
|
+
return {
|
|
55
|
+
focusedIndex,
|
|
56
|
+
shouldFocus,
|
|
57
|
+
lgIds,
|
|
58
|
+
handleOnIconButtonClick,
|
|
59
|
+
};
|
|
60
|
+
}, [focusedIndex, shouldFocus, lgIds, handleOnIconButtonClick]);
|
|
61
|
+
return (react_1.default.createElement(leafygreen_provider_1.default, { darkMode: darkMode },
|
|
62
|
+
react_1.default.createElement(ToolbarProvider, { value: toolbarProviderData }, children)));
|
|
63
|
+
};
|
|
64
|
+
exports.ToolbarContextProvider = ToolbarContextProvider;
|
|
65
|
+
//# sourceMappingURL=toolbar-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-context.js","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAKe;AAEf,6FAAoE;AAEpE,oCAAoC;AAIvB,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAuB;IAChE,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE,IAAA,gBAAQ,GAAE;IACjB,uBAAuB,EAAE,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC,CAAC;AAEI,MAAM,iBAAiB,GAAG,GAAG,EAAE,CACpC,IAAA,kBAAU,EAAuB,sBAAc,CAAC,CAAC;AADtC,QAAA,iBAAiB,qBACqB;AAE5C,MAAM,sBAAsB,GAAG,CAAC,EACrC,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,KAAK,EACL,uBAAuB,EACvB,QAAQ,GAAG,KAAK,GACwB,EAAE,EAAE;IAC5C,MAAM,eAAe,GAAG,sBAAc,CAAC,QAAQ,CAAC;IAEhD,MAAM,mBAAmB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACvC,OAAO;YACL,YAAY;YACZ,WAAW;YACX,KAAK;YACL,uBAAuB;SACxB,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAEhE,OAAO,CACL,8BAAC,6BAAkB,IAAC,QAAQ,EAAE,QAAQ;QACpC,8BAAC,eAAe,IAAC,KAAK,EAAE,mBAAmB,IAAG,QAAQ,CAAmB,CACtD,CACtB,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,sBAAsB,0BAwBjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DarkModeProps } from '@leafygreen-ui/lib';
|
|
2
|
+
import type { GetLgIdsReturnType } from '../utils';
|
|
3
|
+
export type ToolbarProviderProps = DarkModeProps & {
|
|
4
|
+
/**
|
|
5
|
+
* The index of the currently focused item in the toolbar.
|
|
6
|
+
*/
|
|
7
|
+
focusedIndex?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the toolbar should focus the currently focused item. This will prevent this component from hijacking focus on initial page load.
|
|
10
|
+
*/
|
|
11
|
+
shouldFocus?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* LGIDs for Toolbar components.
|
|
14
|
+
*/
|
|
15
|
+
lgIds: GetLgIdsReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Callback to handle clicks on ToolbarIconButtons.
|
|
18
|
+
*/
|
|
19
|
+
handleOnIconButtonClick: (event: React.MouseEvent<HTMLButtonElement>, focusedIndex: number, onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void) => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=toolbar-context.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-context.types.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-context.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAE1B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,KACvD,IAAI,CAAC;CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-context.types.js","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-context.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const ToolbarDescendantsContext: import("@leafygreen-ui/descendants/dist/Descendants/DescendantsContext").DescendantContextType<HTMLButtonElement>;
|
|
2
|
+
export declare function useToolbarDescendantsContext(): {
|
|
3
|
+
descendants: import("@leafygreen-ui/descendants").DescendantsList<HTMLButtonElement>;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=toolbar-descendants-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-descendants-context.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-descendants-context.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,mHACoC,CAAC;AAE3E,wBAAgB,4BAA4B;;EAE3C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolbarDescendantsContext = void 0;
|
|
4
|
+
exports.useToolbarDescendantsContext = useToolbarDescendantsContext;
|
|
5
|
+
const descendants_1 = require("@leafygreen-ui/descendants");
|
|
6
|
+
exports.ToolbarDescendantsContext = (0, descendants_1.createDescendantsContext)('ToolbarDescendantsContext');
|
|
7
|
+
function useToolbarDescendantsContext() {
|
|
8
|
+
return (0, descendants_1.useDescendantsContext)(exports.ToolbarDescendantsContext);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=toolbar-descendants-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-descendants-context.js","sourceRoot":"","sources":["../../../../src/components/toolbar/context/toolbar-descendants-context.tsx"],"names":[],"mappings":";;;AAQA,oEAEC;AAVD,4DAGoC;AAEvB,QAAA,yBAAyB,GACpC,IAAA,sCAAwB,EAAoB,2BAA2B,CAAC,CAAC;AAE3E,SAAgB,4BAA4B;IAC1C,OAAO,IAAA,mCAAqB,EAAC,iCAAyB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export { Toolbar, toolbarClassName, type ToolbarProps } from './toolbar';
|
|
3
|
+
export { ToolbarIconButton, type ToolbarIconButtonProps, } from './toolbar-icon-button';
|
|
4
|
+
export { DEFAULT_LGID_ROOT, getLgIds, type GetLgIdsReturnType } from './utils';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getLgIds = exports.DEFAULT_LGID_ROOT = exports.ToolbarIconButton = exports.toolbarClassName = exports.Toolbar = void 0;
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
var toolbar_1 = require("./toolbar");
|
|
20
|
+
Object.defineProperty(exports, "Toolbar", { enumerable: true, get: function () { return toolbar_1.Toolbar; } });
|
|
21
|
+
Object.defineProperty(exports, "toolbarClassName", { enumerable: true, get: function () { return toolbar_1.toolbarClassName; } });
|
|
22
|
+
var toolbar_icon_button_1 = require("./toolbar-icon-button");
|
|
23
|
+
Object.defineProperty(exports, "ToolbarIconButton", { enumerable: true, get: function () { return toolbar_icon_button_1.ToolbarIconButton; } });
|
|
24
|
+
var utils_1 = require("./utils");
|
|
25
|
+
Object.defineProperty(exports, "DEFAULT_LGID_ROOT", { enumerable: true, get: function () { return utils_1.DEFAULT_LGID_ROOT; } });
|
|
26
|
+
Object.defineProperty(exports, "getLgIds", { enumerable: true, get: function () { return utils_1.getLgIds; } });
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toolbar/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qCAAyE;AAAhE,kGAAA,OAAO,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAClC,6DAG+B;AAF7B,wHAAA,iBAAiB,OAAA;AAGnB,iCAA+E;AAAtE,0GAAA,iBAAiB,OAAA;AAAE,iGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolbarClassName = exports.Toolbar = void 0;
|
|
4
|
+
var toolbar_1 = require("./toolbar");
|
|
5
|
+
Object.defineProperty(exports, "Toolbar", { enumerable: true, get: function () { return toolbar_1.Toolbar; } });
|
|
6
|
+
var toolbar_styles_1 = require("./toolbar.styles");
|
|
7
|
+
Object.defineProperty(exports, "toolbarClassName", { enumerable: true, get: function () { return toolbar_styles_1.toolbarClassName; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAaxC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,OAAO,kGA+FnB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Toolbar = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const descendants_1 = require("@leafygreen-ui/descendants");
|
|
39
|
+
const leafygreen_provider_1 = require("@leafygreen-ui/leafygreen-provider");
|
|
40
|
+
const lib_1 = require("@leafygreen-ui/lib");
|
|
41
|
+
const context_1 = require("../context");
|
|
42
|
+
const utils_1 = require("../utils");
|
|
43
|
+
const toolbar_styles_1 = require("./toolbar.styles");
|
|
44
|
+
exports.Toolbar = react_1.default.forwardRef(({ className, children, darkMode: darkModeProp, 'data-lgid': dataLgId = utils_1.DEFAULT_LGID_ROOT, ...rest }, forwardedRef) => {
|
|
45
|
+
const { darkMode, theme } = (0, leafygreen_provider_1.useDarkMode)(darkModeProp);
|
|
46
|
+
const { descendants, dispatch } = (0, descendants_1.useInitDescendants)(context_1.ToolbarDescendantsContext);
|
|
47
|
+
const [focusedIndex, setFocusedIndex] = (0, react_1.useState)(0);
|
|
48
|
+
const childrenLength = descendants?.length ?? 0;
|
|
49
|
+
const [isUsingKeyboard, setIsUsingKeyboard] = (0, react_1.useState)(false);
|
|
50
|
+
const lgIds = (0, utils_1.getLgIds)(dataLgId);
|
|
51
|
+
/**
|
|
52
|
+
* Implements roving tabindex
|
|
53
|
+
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
|
|
54
|
+
* @param event Keyboard event
|
|
55
|
+
*/
|
|
56
|
+
const handleKeyDown = (event) => {
|
|
57
|
+
// Note: Arrow keys don't fire a keyPress event — need to use onKeyDownCapture
|
|
58
|
+
// We only handle up and down arrow keys
|
|
59
|
+
switch (event.key) {
|
|
60
|
+
case lib_1.keyMap.ArrowDown:
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
setIsUsingKeyboard(true);
|
|
64
|
+
setFocusedIndex((focusedIndex + 1) % childrenLength);
|
|
65
|
+
break;
|
|
66
|
+
case lib_1.keyMap.ArrowUp:
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
setIsUsingKeyboard(true);
|
|
70
|
+
setFocusedIndex((focusedIndex - 1 + childrenLength) % childrenLength);
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Callback to handle click events on ToolbarIconButtons.
|
|
78
|
+
* Also updates the focused index to ensure that the correct button is focused when using the up/down arrows.
|
|
79
|
+
* @param event MouseEvent
|
|
80
|
+
* @param focusedIndex number
|
|
81
|
+
* @param onClick MouseEvent
|
|
82
|
+
*/
|
|
83
|
+
const handleOnIconButtonClick = (event, focusedIndex, onClick) => {
|
|
84
|
+
onClick?.(event);
|
|
85
|
+
// This ensures that on click, the buttons tabIndex is set to 0 so that when the up/down arrows are pressed, the correct button is focused
|
|
86
|
+
setFocusedIndex(focusedIndex);
|
|
87
|
+
};
|
|
88
|
+
return (react_1.default.createElement(context_1.ToolbarContextProvider, { darkMode: darkMode, focusedIndex: focusedIndex, shouldFocus: isUsingKeyboard, lgIds: lgIds, handleOnIconButtonClick: handleOnIconButtonClick },
|
|
89
|
+
react_1.default.createElement(descendants_1.DescendantsProvider, { context: context_1.ToolbarDescendantsContext, descendants: descendants, dispatch: dispatch },
|
|
90
|
+
react_1.default.createElement("div", { role: "toolbar", ref: forwardedRef, className: (0, toolbar_styles_1.getBaseStyles)({ theme, className }), "aria-orientation": "vertical", onKeyDownCapture: handleKeyDown, onBlur: () => setIsUsingKeyboard(false), onMouseDown: () => setIsUsingKeyboard(false), "data-lgid": lgIds.root, "data-testid": lgIds.root, ...rest }, children))));
|
|
91
|
+
});
|
|
92
|
+
exports.Toolbar.displayName = 'Toolbar';
|
|
93
|
+
//# sourceMappingURL=toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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W,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAKvE,eAAO,MAAM,gBAAgB,QAAsC,CAAC;AAEpE,eAAO,MAAM,aAAa,GAAI,uBAG3B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,WAoBE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseStyles = exports.toolbarClassName = void 0;
|
|
4
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
5
|
+
const lib_1 = require("@leafygreen-ui/lib");
|
|
6
|
+
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
exports.toolbarClassName = (0, lib_1.createUniqueClassName)('lg-toolbar');
|
|
9
|
+
const getBaseStyles = ({ theme, className, }) => (0, emotion_1.cx)((0, emotion_1.css) `
|
|
10
|
+
height: 100%;
|
|
11
|
+
width: ${constants_1.TOOLBAR_WIDTH}px;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
background: ${tokens_1.color[theme].background.primary.default};
|
|
16
|
+
border: 1px solid ${tokens_1.color[theme].border.secondary.default};
|
|
17
|
+
|
|
18
|
+
// Show the focus ring on the toolbar itself when a child element is focused and only when navigating with a keyboard
|
|
19
|
+
&:has(:focus-visible) {
|
|
20
|
+
box-shadow: ${tokens_1.focusRing[theme].default};
|
|
21
|
+
// So the focus ring overlaps sibling elements
|
|
22
|
+
z-index: 1;
|
|
23
|
+
}
|
|
24
|
+
`, exports.toolbarClassName, className);
|
|
25
|
+
exports.getBaseStyles = getBaseStyles;
|
|
26
|
+
//# sourceMappingURL=toolbar.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.styles.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.styles.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AACjD,4CAAuE;AACvE,kDAAyD;AAEzD,4CAA6C;AAEhC,QAAA,gBAAgB,GAAG,IAAA,2BAAqB,EAAC,YAAY,CAAC,CAAC;AAE7D,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,SAAS,GAIV,EAAE,EAAE,CACH,IAAA,YAAE,EACA,IAAA,aAAG,EAAA;;eAEQ,yBAAa;;;;oBAIR,cAAK,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO;0BACjC,cAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO;;;;sBAIzC,kBAAS,CAAC,KAAK,CAAC,CAAC,OAAO;;;;KAIzC,EACD,wBAAgB,EAChB,SAAS,CACV,CAAC;AA1BS,QAAA,aAAa,iBA0BtB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { DarkModeProps, LgIdProps } from '@leafygreen-ui/lib';
|
|
3
|
+
export interface ToolbarProps extends ComponentPropsWithRef<'div'>, DarkModeProps, LgIdProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=toolbar.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.types.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnE,MAAM,WAAW,YACf,SAAQ,qBAAqB,CAAC,KAAK,CAAC,EAClC,aAAa,EACb,SAAS;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.types.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolbarIconButton = void 0;
|
|
4
|
+
var toolbar_icon_button_1 = require("./toolbar-icon-button");
|
|
5
|
+
Object.defineProperty(exports, "ToolbarIconButton", { enumerable: true, get: function () { return toolbar_icon_button_1.ToolbarIconButton; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ToolbarIconButtonProps } from './toolbar-icon-button.types';
|
|
3
|
+
export declare const ToolbarIconButton: React.ForwardRefExoticComponent<ToolbarIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
//# sourceMappingURL=toolbar-icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAexE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,eAAO,MAAM,iBAAiB,kGAiF7B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ToolbarIconButton = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const descendants_1 = require("@leafygreen-ui/descendants");
|
|
42
|
+
const icon_1 = __importDefault(require("@leafygreen-ui/icon"));
|
|
43
|
+
const icon_button_1 = __importDefault(require("@leafygreen-ui/icon-button"));
|
|
44
|
+
const leafygreen_provider_1 = require("@leafygreen-ui/leafygreen-provider");
|
|
45
|
+
const lib_1 = require("@leafygreen-ui/lib");
|
|
46
|
+
const tooltip_1 = __importStar(require("@leafygreen-ui/tooltip"));
|
|
47
|
+
const context_1 = require("../context");
|
|
48
|
+
const toolbar_icon_button_styles_1 = require("./toolbar-icon-button.styles");
|
|
49
|
+
exports.ToolbarIconButton = react_1.default.forwardRef(({ className, onClick, label, glyph, disabled = false, active = false, 'aria-label': ariaLabel, ...rest }, forwardedRef) => {
|
|
50
|
+
const { theme } = (0, leafygreen_provider_1.useDarkMode)();
|
|
51
|
+
const { index, ref } = (0, descendants_1.useDescendant)(context_1.ToolbarDescendantsContext, forwardedRef);
|
|
52
|
+
const { focusedIndex, shouldFocus, lgIds, handleOnIconButtonClick } = (0, context_1.useToolbarContext)();
|
|
53
|
+
const isFocusable = index === focusedIndex;
|
|
54
|
+
if (focusedIndex === undefined) {
|
|
55
|
+
// eslint-disable-next-line no-console
|
|
56
|
+
console.error('ToolbarIconButton should only be used inside the Toolbar component.');
|
|
57
|
+
}
|
|
58
|
+
if (glyph === undefined) {
|
|
59
|
+
// eslint-disable-next-line no-console
|
|
60
|
+
console.error('A glpyh is required for ToolbarIconButton. Please provide a valid glyph. The list of available glyphs can be found in the LG Icon README, https://github.com/mongodb/leafygreen-ui/blob/main/packages/icon/README.md#properties.');
|
|
61
|
+
}
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
// shouldFocus prevents this component from hijacking focus on initial page load.
|
|
64
|
+
if (isFocusable && shouldFocus)
|
|
65
|
+
ref.current?.focus();
|
|
66
|
+
}, [isFocusable, ref, shouldFocus]);
|
|
67
|
+
return (react_1.default.createElement(tooltip_1.default, { "data-testid": `${lgIds.iconButtonTooltip}-${index}`, "data-lgid": `${lgIds.iconButtonTooltip}-${index}`, align: tooltip_1.Align.Left, trigger: react_1.default.createElement("div", { className: toolbar_icon_button_styles_1.triggerStyles },
|
|
68
|
+
react_1.default.createElement(icon_button_1.default, { "aria-label": ariaLabel || (0, lib_1.getNodeTextContent)(label), active: active, className: (0, toolbar_icon_button_styles_1.getIconButtonStyles)({
|
|
69
|
+
theme,
|
|
70
|
+
active,
|
|
71
|
+
disabled,
|
|
72
|
+
className,
|
|
73
|
+
}), tabIndex: isFocusable ? 0 : -1, onClick: (event) => handleOnIconButtonClick(event, index, onClick), disabled: disabled, "data-testid": `${lgIds.iconButton}-${index}`, "data-lgid": `${lgIds.iconButton}-${index}`, "data-active": active, ref: ref, ...rest },
|
|
74
|
+
react_1.default.createElement(icon_1.default, { glyph: glyph }))) }, label));
|
|
75
|
+
});
|
|
76
|
+
exports.ToolbarIconButton.displayName = 'ToolbarIconButton';
|
|
77
|
+
//# sourceMappingURL=toolbar-icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwE;AAExE,4DAA2D;AAC3D,+DAAuC;AACvC,6EAAoD;AACpD,4EAAiE;AACjE,4CAAwD;AACxD,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