@mongodb-js/compass-components 1.43.0 → 1.44.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/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/package.json +11 -9
|
@@ -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
|
+
{"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar/toolbar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AAExC,4DAGoC;AACpC,4EAAiE;AACjE,4CAA4C;AAE5C,wCAA+E;AAC/E,oCAAuD;AAEvD,qDAAiD;AAGpC,QAAA,OAAO,GAAG,eAAK,CAAC,UAAU,CACrC,CACE,EACE,SAAS,EACT,QAAQ,EACR,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,QAAQ,GAAG,yBAAiB,EACzC,GAAG,IAAI,EACM,EACf,YAAY,EACZ,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAA,iCAAW,EAAC,YAAY,CAAC,CAAC;IACtD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAA,gCAAkB,EAClD,mCAAyB,CAC1B,CAAC;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,WAAW,EAAE,MAAM,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAC;IAEjC;;;;OAIG;IACH,MAAM,aAAa,GAAG,CAAC,KAA0C,EAAE,EAAE;QACnE,8EAA8E;QAC9E,wCAAwC;QACxC,QAAQ,KAAK,CAAC,GAAG,EAAE,CAAC;YAClB,KAAK,YAAM,CAAC,SAAS;gBACnB,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzB,eAAe,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC;gBACrD,MAAM;YACR,KAAK,YAAM,CAAC,OAAO;gBACjB,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzB,eAAe,CAAC,CAAC,YAAY,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,cAAc,CAAC,CAAC;gBACtE,MAAM;YACR;gBACE,MAAM;QACV,CAAC;IACH,CAAC,CAAC;IAEF;;;;;;OAMG;IACH,MAAM,uBAAuB,GAAG,CAC9B,KAA0C,EAC1C,YAAoB,EACpB,OAA0D,EAC1D,EAAE;QACF,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACjB,0IAA0I;QAC1I,eAAe,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,gCAAsB,IACrB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,KAAK,EACZ,uBAAuB,EAAE,uBAAuB;QAEhD,8BAAC,iCAAmB,IAClB,OAAO,EAAE,mCAAyB,EAClC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ;YAElB,uCACE,IAAI,EAAC,SAAS,EACd,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,IAAA,8BAAa,EAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,sBAC7B,UAAU,EAC3B,gBAAgB,EAAE,aAAa,EAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EACvC,WAAW,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,eACjC,KAAK,CAAC,IAAI,iBACR,KAAK,CAAC,IAAI,KACnB,IAAI,IAEP,QAAQ,CACL,CACc,CACC,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAO,CAAC,WAAW,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,kEAAwD;AAExD,wCAA0E;AAE1E,6EAGsC;AAGzB,QAAA,iBAAiB,GAAG,eAAK,CAAC,UAAU,CAI/C,CACE,EACE,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,KAAK,EACd,YAAY,EAAE,SAAS,EACvB,GAAG,IAAI,EACgB,EACzB,YAAY,EACZ,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,iCAAW,GAAE,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAA,2BAAa,EAClC,mCAAyB,EACzB,YAAY,CACb,CAAC;IACF,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,uBAAuB,EAAE,GACjE,IAAA,2BAAiB,GAAE,CAAC;IACtB,MAAM,WAAW,GAAG,KAAK,KAAK,YAAY,CAAC;IAE3C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,sCAAsC;QACtC,OAAO,CAAC,KAAK,CACX,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CACX,kOAAkO,CACnO,CAAC;IACJ,CAAC;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,iFAAiF;QACjF,IAAI,WAAW,IAAI,WAAW;YAAE,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IACvD,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;IAEpC,OAAO,CACL,8BAAC,iBAAO,mBACO,GAAG,KAAK,CAAC,iBAAiB,IAAI,KAAK,EAAE,eACvC,GAAG,KAAK,CAAC,iBAAiB,IAAI,KAAK,EAAE,EAChD,KAAK,EAAE,eAAK,CAAC,IAAI,EACjB,OAAO,EACL,uCAAK,SAAS,EAAE,0CAAa;YAC3B,8BAAC,qBAAU,kBACG,SAAS,IAAI,IAAA,wBAAkB,EAAC,KAAK,CAAC,EAClD,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,IAAA,gDAAmB,EAAC;oBAC7B,KAAK;oBACL,MAAM;oBACN,QAAQ;oBACR,SAAS;iBACV,CAAC,EACF,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC9B,OAAO,EAAE,CAAC,KAA0C,EAAE,EAAE,CACtD,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAEhD,QAAQ,EAAE,QAAQ,iBACL,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,EAAE,eAChC,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,EAAE,iBAC5B,MAAM,EACnB,GAAG,EAAE,GAAG,KACH,IAA2C;gBAEhD,8BAAC,cAAI,IAAC,KAAK,EAAE,KAAK,GAAI,CACX,CACT,IAGP,KAAK,CACE,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Theme } from '@leafygreen-ui/lib';
|
|
2
|
+
export declare const baseIconButtonStyles: string;
|
|
3
|
+
export declare const getIconButtonActiveStyles: ({ theme }: {
|
|
4
|
+
theme: Theme;
|
|
5
|
+
}) => string;
|
|
6
|
+
export declare const getIconButtonStyles: ({ active, theme, disabled, className, }: {
|
|
7
|
+
active: boolean;
|
|
8
|
+
theme: Theme;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
export declare const triggerStyles: string;
|
|
13
|
+
//# sourceMappingURL=toolbar-icon-button.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAM3C,eAAO,MAAM,oBAAoB,QAOhC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,WAWlE,CAAC;AAEJ,eAAO,MAAM,mBAAmB,GAAI,yCAKjC;IACD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,WASE,CAAC;AAEJ,eAAO,MAAM,aAAa,QAIzB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggerStyles = exports.getIconButtonStyles = exports.getIconButtonActiveStyles = exports.baseIconButtonStyles = void 0;
|
|
4
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
5
|
+
const lib_1 = require("@leafygreen-ui/lib");
|
|
6
|
+
const palette_1 = require("@leafygreen-ui/palette");
|
|
7
|
+
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
exports.baseIconButtonStyles = (0, emotion_1.css) `
|
|
10
|
+
&,
|
|
11
|
+
&:hover,
|
|
12
|
+
&[data-hover='true'],
|
|
13
|
+
&::before {
|
|
14
|
+
border-radius: ${tokens_1.borderRadius[150]}px;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
const getIconButtonActiveStyles = ({ theme }) => (0, emotion_1.cx)((0, emotion_1.css) `
|
|
18
|
+
background: ${theme === lib_1.Theme.Light
|
|
19
|
+
? palette_1.palette.green.light3
|
|
20
|
+
: palette_1.palette.green.dark3};
|
|
21
|
+
|
|
22
|
+
color: ${theme === lib_1.Theme.Light
|
|
23
|
+
? palette_1.palette.green.dark2
|
|
24
|
+
: palette_1.palette.green.light1};
|
|
25
|
+
`);
|
|
26
|
+
exports.getIconButtonActiveStyles = getIconButtonActiveStyles;
|
|
27
|
+
const getIconButtonStyles = ({ active, theme, disabled, className, }) => (0, emotion_1.cx)((0, emotion_1.css) `
|
|
28
|
+
${exports.baseIconButtonStyles}
|
|
29
|
+
`, {
|
|
30
|
+
[(0, exports.getIconButtonActiveStyles)({ theme })]: active && !disabled,
|
|
31
|
+
}, className);
|
|
32
|
+
exports.getIconButtonStyles = getIconButtonStyles;
|
|
33
|
+
exports.triggerStyles = (0, emotion_1.css) `
|
|
34
|
+
display: flex;
|
|
35
|
+
height: ${constants_1.ICON_BUTTON_HEIGHT}px;
|
|
36
|
+
align-items: center;
|
|
37
|
+
`;
|
|
38
|
+
//# sourceMappingURL=toolbar-icon-button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.styles.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AACjD,4CAA2C;AAC3C,oDAAiD;AACjD,kDAAqD;AAErD,4CAAkD;AAErC,QAAA,oBAAoB,GAAG,IAAA,aAAG,EAAA;;;;;qBAKlB,qBAAY,CAAC,GAAG,CAAC;;CAErC,CAAC;AAEK,MAAM,yBAAyB,GAAG,CAAC,EAAE,KAAK,EAAoB,EAAE,EAAE,CACvE,IAAA,YAAE,EACA,IAAA,aAAG,EAAA;oBACa,KAAK,KAAK,WAAK,CAAC,KAAK;IACjC,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC,MAAM;IACtB,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC,KAAK;;eAEd,KAAK,KAAK,WAAK,CAAC,KAAK;IAC5B,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC,KAAK;IACrB,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC,MAAM;KACzB,CACF,CAAC;AAXS,QAAA,yBAAyB,6BAWlC;AAEG,MAAM,mBAAmB,GAAG,CAAC,EAClC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,GAMV,EAAE,EAAE,CACH,IAAA,YAAE,EACA,IAAA,aAAG,EAAA;QACC,4BAAoB;KACvB,EACD;IACE,CAAC,IAAA,iCAAyB,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ;CAC5D,EACD,SAAS,CACV,CAAC;AAnBS,QAAA,mBAAmB,uBAmB5B;AAES,QAAA,aAAa,GAAG,IAAA,aAAG,EAAA;;YAEpB,8BAAkB;;CAE7B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GlyphName } from '@leafygreen-ui/icon';
|
|
2
|
+
import type { BaseIconButtonProps as IconButtonProps } from '@leafygreen-ui/icon-button';
|
|
3
|
+
type ButtonProps = Omit<IconButtonProps, 'tabIndex' | 'href' | 'as' | 'ref' | 'children' | 'size' | 'darkMode' | 'onClick'>;
|
|
4
|
+
export interface ToolbarIconButtonProps extends ButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The LG Icon that will render in the button
|
|
7
|
+
*/
|
|
8
|
+
glyph: GlyphName;
|
|
9
|
+
/**
|
|
10
|
+
* The text that will render in the tooltip on hover
|
|
11
|
+
*/
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when the ToolbarIconButton is clicked
|
|
15
|
+
*/
|
|
16
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=toolbar-icon-button.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.types.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEzF,KAAK,WAAW,GAAG,IAAI,CACrB,eAAe,EACb,UAAU,GACV,MAAM,GACN,IAAI,GACJ,KAAK,GACL,UAAU,GACV,MAAM,GACN,UAAU,GACV,SAAS,CACZ,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAChE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-icon-button.types.js","sourceRoot":"","sources":["../../../../src/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DEFAULT_LGID_ROOT = "lg-toolbar";
|
|
2
|
+
export declare const getLgIds: (root?: `lg-${string}`) => {
|
|
3
|
+
readonly root: `lg-${string}`;
|
|
4
|
+
readonly iconButton: `lg-${string}-icon_button`;
|
|
5
|
+
readonly iconButtonTooltip: `lg-${string}-icon_button-tooltip`;
|
|
6
|
+
};
|
|
7
|
+
export type GetLgIdsReturnType = ReturnType<typeof getLgIds>;
|
|
8
|
+
//# sourceMappingURL=get-lg-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-lg-ids.d.ts","sourceRoot":"","sources":["../../../../src/components/toolbar/utils/get-lg-ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,QAAQ,GAAI,OAAM,MAAM,MAAM,EAAsB;;;;CAOhE,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLgIds = exports.DEFAULT_LGID_ROOT = void 0;
|
|
4
|
+
exports.DEFAULT_LGID_ROOT = 'lg-toolbar';
|
|
5
|
+
const getLgIds = (root = exports.DEFAULT_LGID_ROOT) => {
|
|
6
|
+
const ids = {
|
|
7
|
+
root,
|
|
8
|
+
iconButton: `${root}-icon_button`,
|
|
9
|
+
iconButtonTooltip: `${root}-icon_button-tooltip`,
|
|
10
|
+
};
|
|
11
|
+
return ids;
|
|
12
|
+
};
|
|
13
|
+
exports.getLgIds = getLgIds;
|
|
14
|
+
//# sourceMappingURL=get-lg-ids.js.map
|