@elliemae/ds-toolbar 2.2.0-next.4 → 2.3.0-alpha.2
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/cjs/DSToolbarItemV2.js +49 -44
- package/cjs/DSToolbarItemV2.js.map +7 -0
- package/cjs/DSToolbarSeparatorV2.js +38 -17
- package/cjs/DSToolbarSeparatorV2.js.map +7 -0
- package/cjs/DSToolbarV2.js +62 -69
- package/cjs/DSToolbarV2.js.map +7 -0
- package/cjs/DSToolbarV2Context.js +37 -10
- package/cjs/DSToolbarV2Context.js.map +7 -0
- package/cjs/deprecated/DSToolbar.js +86 -89
- package/cjs/deprecated/DSToolbar.js.map +7 -0
- package/cjs/deprecated/ToolbarDivider.js +39 -9
- package/cjs/deprecated/ToolbarDivider.js.map +7 -0
- package/cjs/deprecated/ToolbarGroup.js +48 -34
- package/cjs/deprecated/ToolbarGroup.js.map +7 -0
- package/cjs/deprecated/ToolbarItem.js +58 -54
- package/cjs/deprecated/ToolbarItem.js.map +7 -0
- package/cjs/deprecated/decorateToolbarChildren.js +39 -27
- package/cjs/deprecated/decorateToolbarChildren.js.map +7 -0
- package/cjs/deprecated/index.js +36 -17
- package/cjs/deprecated/index.js.map +7 -0
- package/cjs/index.js +39 -24
- package/cjs/index.js.map +7 -0
- package/cjs/props.js +39 -12
- package/cjs/props.js.map +7 -0
- package/cjs/styled.js +51 -22
- package/cjs/styled.js.map +7 -0
- package/cjs/useToolbarItemHandlers.js +48 -28
- package/cjs/useToolbarItemHandlers.js.map +7 -0
- package/esm/DSToolbarItemV2.js +17 -33
- package/esm/DSToolbarItemV2.js.map +7 -0
- package/esm/DSToolbarSeparatorV2.js +9 -9
- package/esm/DSToolbarSeparatorV2.js.map +7 -0
- package/esm/DSToolbarV2.js +29 -54
- package/esm/DSToolbarV2.js.map +7 -0
- package/esm/DSToolbarV2Context.js +8 -6
- package/esm/DSToolbarV2Context.js.map +7 -0
- package/esm/deprecated/DSToolbar.js +57 -73
- package/esm/deprecated/DSToolbar.js.map +7 -0
- package/esm/deprecated/ToolbarDivider.js +10 -7
- package/esm/deprecated/ToolbarDivider.js.map +7 -0
- package/esm/deprecated/ToolbarGroup.js +21 -30
- package/esm/deprecated/ToolbarGroup.js.map +7 -0
- package/esm/deprecated/ToolbarItem.js +27 -43
- package/esm/deprecated/ToolbarItem.js.map +7 -0
- package/esm/deprecated/decorateToolbarChildren.js +11 -21
- package/esm/deprecated/decorateToolbarChildren.js.map +7 -0
- package/esm/deprecated/index.js +7 -4
- package/esm/deprecated/index.js.map +7 -0
- package/esm/index.js +10 -7
- package/esm/index.js.map +7 -0
- package/esm/props.js +10 -8
- package/esm/props.js.map +7 -0
- package/esm/styled.js +23 -12
- package/esm/styled.js.map +7 -0
- package/esm/useToolbarItemHandlers.js +19 -24
- package/esm/useToolbarItemHandlers.js.map +7 -0
- package/package.json +10 -10
- package/types/deprecated/DSToolbar.d.ts +1 -10
package/cjs/styled.js
CHANGED
|
@@ -1,25 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styled_exports = {};
|
|
29
|
+
__export(styled_exports, {
|
|
30
|
+
StyledSeparator: () => StyledSeparator,
|
|
31
|
+
StyledToolbarItem: () => StyledToolbarItem,
|
|
32
|
+
StyledToolbarWrapper: () => StyledToolbarWrapper
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_ds_grid = __toESM(require("@elliemae/ds-grid"));
|
|
37
|
+
const StyledToolbarWrapper = (0, import_styled_components.default)(import_ds_grid.default)`
|
|
38
|
+
background-color: ${(props) => props.theme.colors.neutral["000"]};
|
|
2
39
|
|
|
3
|
-
|
|
40
|
+
min-height: ${(props) => props.compact ? "28px" : "40px"};
|
|
41
|
+
max-height: ${(props) => props.theme.space.xxl};
|
|
4
42
|
|
|
5
|
-
|
|
6
|
-
var Grid = require('@elliemae/ds-grid');
|
|
43
|
+
padding: 0 ${(props) => props.theme.space.xxs};
|
|
7
44
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})([""]);
|
|
19
|
-
const StyledSeparator = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
20
|
-
componentId: "sc-8ez8n4-2"
|
|
21
|
-
})(["height:30px;width:1px;background-color:", ";"], props => props.theme.colors.neutral[200]);
|
|
22
|
-
|
|
23
|
-
exports.StyledSeparator = StyledSeparator;
|
|
24
|
-
exports.StyledToolbarItem = StyledToolbarItem;
|
|
25
|
-
exports.StyledToolbarWrapper = StyledToolbarWrapper;
|
|
45
|
+
box-shadow: ${(props) => !props.withDepth ? "none" : "0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)"};
|
|
46
|
+
`;
|
|
47
|
+
const StyledToolbarItem = (0, import_styled_components.default)(import_ds_grid.default)``;
|
|
48
|
+
const StyledSeparator = (0, import_styled_components.default)(import_ds_grid.default)`
|
|
49
|
+
height: 30px;
|
|
50
|
+
width: 1px;
|
|
51
|
+
background-color: ${(props) => props.theme.colors.neutral[200]};
|
|
52
|
+
`;
|
|
53
|
+
module.exports = __toCommonJS(styled_exports);
|
|
54
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import styled from 'styled-components';\nimport Grid from '@elliemae/ds-grid';\n\nexport const StyledToolbarWrapper = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n\n min-height: ${(props) => (props.compact ? '28px' : '40px')};\n max-height: ${(props) => props.theme.space.xxl};\n\n padding: 0 ${(props) => props.theme.space.xxs};\n\n box-shadow: ${(props) => (!props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)')};\n`;\n\nexport const StyledToolbarItem = styled(Grid)``;\n\nexport const StyledSeparator = styled(Grid)`\n height: 30px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[200]};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAiB;AAEV,MAAM,uBAAuB,sCAAO;AAAA,sBACrB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,gBAE5C,CAAC,UAAW,MAAM,UAAU,SAAS;AAAA,gBACrC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,eAE9B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,gBAE5B,CAAC,UAAW,CAAC,MAAM,YAAY,SAAS;AAAA;AAGjD,MAAM,oBAAoB,sCAAO;AAEjC,MAAM,kBAAkB,sCAAO;AAAA;AAAA;AAAA,sBAGhB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,39 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useToolbarItemHandlers_exports = {};
|
|
29
|
+
__export(useToolbarItemHandlers_exports, {
|
|
30
|
+
useToolbarItemHandlers: () => useToolbarItemHandlers
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_DSToolbarV2Context = require("./DSToolbarV2Context");
|
|
35
|
+
const useToolbarItemHandlers = (toolbarItemId) => {
|
|
36
|
+
const { toolbarUid, itemReferences } = (0, import_react.useContext)(import_DSToolbarV2Context.DSToolbarV2Context);
|
|
37
|
+
const onKeyDown = (0, import_react.useCallback)((e) => {
|
|
38
|
+
const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];
|
|
16
39
|
let nextToolbarItemIndex = -1;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} else if (e.code === 'Home') {
|
|
40
|
+
if (["ArrowLeft", "ArrowRight"].includes(e.code)) {
|
|
41
|
+
const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);
|
|
42
|
+
nextToolbarItemIndex = toolbarItemIndex + (e.code === "ArrowLeft" ? -1 : 1);
|
|
43
|
+
} else if (e.code === "Home") {
|
|
22
44
|
nextToolbarItemIndex = 0;
|
|
23
|
-
} else if (e.code ===
|
|
45
|
+
} else if (e.code === "End") {
|
|
24
46
|
nextToolbarItemIndex = toolbarItems.length - 1;
|
|
25
47
|
}
|
|
26
|
-
|
|
27
48
|
if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {
|
|
28
49
|
e.preventDefault();
|
|
29
50
|
e.stopPropagation();
|
|
30
51
|
const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];
|
|
31
|
-
if (ref.current)
|
|
52
|
+
if (ref.current)
|
|
53
|
+
ref.current.focus();
|
|
32
54
|
}
|
|
33
55
|
}, [toolbarUid, toolbarItemId, itemReferences]);
|
|
34
|
-
return {
|
|
35
|
-
onKeyDown
|
|
36
|
-
};
|
|
56
|
+
return { onKeyDown };
|
|
37
57
|
};
|
|
38
|
-
|
|
39
|
-
|
|
58
|
+
module.exports = __toCommonJS(useToolbarItemHandlers_exports);
|
|
59
|
+
//# sourceMappingURL=useToolbarItemHandlers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/useToolbarItemHandlers.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useContext } from 'react';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\n\nexport const useToolbarItemHandlers = (\n toolbarItemId: string,\n): {\n onKeyDown: React.KeyboardEventHandler;\n} => {\n const { toolbarUid, itemReferences } = useContext(DSToolbarV2Context);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];\n let nextToolbarItemIndex = -1;\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.code)) {\n const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);\n nextToolbarItemIndex = toolbarItemIndex + (e.code === 'ArrowLeft' ? -1 : 1);\n } else if (e.code === 'Home') {\n nextToolbarItemIndex = 0;\n } else if (e.code === 'End') {\n nextToolbarItemIndex = toolbarItems.length - 1;\n }\n\n if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {\n e.preventDefault();\n e.stopPropagation();\n const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];\n if (ref.current) ref.current.focus();\n }\n },\n [toolbarUid, toolbarItemId, itemReferences],\n );\n\n return { onKeyDown };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwC;AACxC,gCAAmC;AAE5B,MAAM,yBAAyB,CACpC,kBAGG;AACH,QAAM,EAAE,YAAY,mBAAmB,6BAAW;AAElD,QAAM,YAAwC,8BAC5C,CAAC,MAAM;AACL,UAAM,eAAe,CAAC,GAAG,SAAS,iBAAiB,IAAI;AACvD,QAAI,uBAAuB;AAE3B,QAAI,CAAC,aAAa,cAAc,SAAS,EAAE,OAAO;AAChD,YAAM,mBAAmB,aAAa,UAAU,CAAC,YAAY,QAAQ,OAAO;AAC5E,6BAAuB,mBAAoB,GAAE,SAAS,cAAc,KAAK;AAAA,eAChE,EAAE,SAAS,QAAQ;AAC5B,6BAAuB;AAAA,eACd,EAAE,SAAS,OAAO;AAC3B,6BAAuB,aAAa,SAAS;AAAA;AAG/C,QAAI,wBAAwB,KAAK,uBAAuB,aAAa,QAAQ;AAC3E,QAAE;AACF,QAAE;AACF,YAAM,MAAM,eAAe,aAAa,sBAAsB;AAC9D,UAAI,IAAI;AAAS,YAAI,QAAQ;AAAA;AAAA,KAGjC,CAAC,YAAY,eAAe;AAG9B,SAAO,EAAE;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/DSToolbarItemV2.js
CHANGED
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { DSToolbarV2Context } from './DSToolbarV2Context.js';
|
|
10
|
-
import { StyledToolbarItem } from './styled.js';
|
|
11
|
-
import { useToolbarItemHandlers } from './useToolbarItemHandlers.js';
|
|
12
|
-
import { jsx } from 'react/jsx-runtime';
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
const DSToolbarItemV2 = _ref => {
|
|
18
|
-
let {
|
|
19
|
-
render
|
|
20
|
-
} = _ref;
|
|
21
|
-
const {
|
|
22
|
-
registerReference
|
|
23
|
-
} = useContext(DSToolbarV2Context);
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext, useMemo, useRef } from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { DSToolbarV2Context } from "./DSToolbarV2Context";
|
|
5
|
+
import { StyledToolbarItem } from "./styled";
|
|
6
|
+
import { useToolbarItemHandlers } from "./useToolbarItemHandlers";
|
|
7
|
+
const DSToolbarItemV2 = ({ render }) => {
|
|
8
|
+
const { registerReference } = useContext(DSToolbarV2Context);
|
|
24
9
|
const ref = useRef(null);
|
|
25
10
|
const toolbarItemId = useMemo(() => {
|
|
26
|
-
const id =
|
|
11
|
+
const id = `ds-toolbar-item-${uid()}`;
|
|
27
12
|
registerReference(id, ref);
|
|
28
13
|
return id;
|
|
29
14
|
}, [registerReference, ref]);
|
|
30
15
|
const handlers = useToolbarItemHandlers(toolbarItemId);
|
|
31
|
-
return
|
|
16
|
+
return /* @__PURE__ */ React2.createElement(StyledToolbarItem, {
|
|
32
17
|
id: toolbarItemId,
|
|
33
18
|
"data-testid": "ds-toolbar-item",
|
|
34
|
-
className: "ds-toolbar-item"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
innerRef: ref
|
|
38
|
-
})
|
|
39
|
-
}));
|
|
19
|
+
className: "ds-toolbar-item",
|
|
20
|
+
...handlers
|
|
21
|
+
}, render({ innerRef: ref }));
|
|
40
22
|
};
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
export {
|
|
24
|
+
DSToolbarItemV2
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=DSToolbarItemV2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarItemV2.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AAMO,MAAM,kBAAyD,CAAC,EAAE,aAAa;AACpF,QAAM,EAAE,sBAAsB,WAAW;AACzC,QAAM,MAAM,OAAO;AAEnB,QAAM,gBAAgB,QAAQ,MAAM;AAClC,UAAM,KAAK,mBAAmB;AAC9B,sBAAkB,IAAI;AACtB,WAAO;AAAA,KACN,CAAC,mBAAmB;AAEvB,QAAM,WAAW,uBAAuB;AAExC,SACE,qCAAC,mBAAD;AAAA,IAAmB,IAAI;AAAA,IAAe,eAAY;AAAA,IAAkB,WAAU;AAAA,OAAsB;AAAA,KACjG,OAAO,EAAE,UAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { StyledSeparator } from
|
|
4
|
-
|
|
5
|
-
var _StyledSeparator;
|
|
6
|
-
const DSToolbarSeparatorV2 = () => _StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx(StyledSeparator, {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { StyledSeparator } from "./styled";
|
|
4
|
+
const DSToolbarSeparatorV2 = () => /* @__PURE__ */ React2.createElement(StyledSeparator, {
|
|
7
5
|
className: "ds-toolbar-separator"
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
DSToolbarSeparatorV2
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=DSToolbarSeparatorV2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarSeparatorV2.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { StyledSeparator } from './styled';\n\nexport const DSToolbarSeparatorV2: React.ComponentType = () => <StyledSeparator className=\"ds-toolbar-separator\" />;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,uBAA4C,MAAM,qCAAC,iBAAD;AAAA,EAAiB,WAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/DSToolbarV2.js
CHANGED
|
@@ -1,69 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import React, { useMemo, useState, useCallback } from 'react';
|
|
12
|
-
import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
13
|
-
import { describe } from 'react-desc';
|
|
14
|
-
import { uid } from 'uid';
|
|
15
|
-
import { DSToolbarV2Context } from './DSToolbarV2Context.js';
|
|
16
|
-
import { DSToolbarV2Schema } from './props.js';
|
|
17
|
-
import { StyledToolbarWrapper } from './styled.js';
|
|
18
|
-
import { jsx } from 'react/jsx-runtime';
|
|
19
|
-
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
24
|
-
const DSToolbarV2 = props => {
|
|
25
|
-
const {
|
|
26
|
-
alignment,
|
|
27
|
-
withDepth,
|
|
28
|
-
compact,
|
|
29
|
-
innerRef,
|
|
30
|
-
children
|
|
31
|
-
} = props;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { describe } from "react-desc";
|
|
5
|
+
import { uid } from "uid";
|
|
6
|
+
import { DSToolbarV2Context } from "./DSToolbarV2Context";
|
|
7
|
+
import { DSToolbarV2Schema } from "./props";
|
|
8
|
+
import { StyledToolbarWrapper } from "./styled";
|
|
9
|
+
const DSToolbarV2 = (props) => {
|
|
10
|
+
const { alignment, withDepth, compact, innerRef, children } = props;
|
|
32
11
|
useValidateTypescriptPropTypes(props, DSToolbarV2Schema);
|
|
33
|
-
const toolbarUid = useMemo(() =>
|
|
12
|
+
const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);
|
|
34
13
|
const [itemReferences, setItemReferences] = useState({});
|
|
35
14
|
const registerReference = useCallback((itemId, ref) => {
|
|
36
|
-
setItemReferences(prevItemReferences =>
|
|
37
|
-
[itemId]: ref
|
|
38
|
-
}));
|
|
15
|
+
setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));
|
|
39
16
|
}, [setItemReferences]);
|
|
40
|
-
return
|
|
41
|
-
value: {
|
|
42
|
-
|
|
43
|
-
registerReference,
|
|
44
|
-
itemReferences
|
|
45
|
-
}
|
|
46
|
-
}, void 0, /*#__PURE__*/jsx(StyledToolbarWrapper, {
|
|
17
|
+
return /* @__PURE__ */ React2.createElement(DSToolbarV2Context.Provider, {
|
|
18
|
+
value: { toolbarUid, registerReference, itemReferences }
|
|
19
|
+
}, /* @__PURE__ */ React2.createElement(StyledToolbarWrapper, {
|
|
47
20
|
role: "toolbar",
|
|
48
21
|
"data-testid": "ds-toolbar-wrapper",
|
|
49
22
|
id: toolbarUid,
|
|
50
23
|
alignItems: "center",
|
|
51
|
-
justifyContent: alignment ===
|
|
52
|
-
withDepth
|
|
53
|
-
cols:
|
|
24
|
+
justifyContent: alignment === "left" ? "flex-start" : "flex-end",
|
|
25
|
+
withDepth,
|
|
26
|
+
cols: React2.Children.map(children, () => ["auto"]),
|
|
54
27
|
gutter: "xxs2",
|
|
55
|
-
compact
|
|
56
|
-
ref: innerRef
|
|
57
|
-
|
|
58
|
-
}));
|
|
28
|
+
compact,
|
|
29
|
+
ref: innerRef
|
|
30
|
+
}, children));
|
|
59
31
|
};
|
|
60
|
-
|
|
32
|
+
DSToolbarV2.propTypes = DSToolbarV2Schema;
|
|
61
33
|
DSToolbarV2.defaultProps = {
|
|
62
|
-
alignment:
|
|
34
|
+
alignment: "right",
|
|
63
35
|
withDepth: true,
|
|
64
36
|
compact: false
|
|
65
37
|
};
|
|
66
|
-
const DSToolbarV2WithSchema = describe(DSToolbarV2).description(
|
|
38
|
+
const DSToolbarV2WithSchema = describe(DSToolbarV2).description("Toolbar");
|
|
67
39
|
DSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;
|
|
68
|
-
|
|
69
|
-
|
|
40
|
+
export {
|
|
41
|
+
DSToolbarV2,
|
|
42
|
+
DSToolbarV2WithSchema
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=DSToolbarV2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarV2.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2Schema);\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,MAAM,cAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,WAAW,WAAW,SAAS,UAAU,aAAa;AAE9D,iCAA+B,OAAO;AAEtC,QAAM,aAAa,QAAQ,MAAM,cAAc,SAAS;AAExD,QAAM,CAAC,gBAAgB,qBAAqB,SAAS;AAErD,QAAM,oBAAoB,YACxB,CAAC,QAAgB,QAA6C;AAC5D,sBAAkB,CAAC,uBAAwB,MAAK,qBAAqB,SAAS;AAAA,KAEhF,CAAC;AAGH,SACE,qCAAC,mBAAmB,UAApB;AAAA,IAA6B,OAAO,EAAE,YAAY,mBAAmB;AAAA,KACnE,qCAAC,sBAAD;AAAA,IACE,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,IAAI;AAAA,IACJ,YAAW;AAAA,IACX,gBAAgB,cAAc,SAAS,eAAe;AAAA,IACtD;AAAA,IACA,MAAM,OAAM,SAAS,IAAI,UAAU,MAAM,CAAC;AAAA,IAC1C,QAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,KAEJ;AAAA;AAMT,YAAY,YAAY;AACxB,YAAY,eAAe;AAAA,EACzB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA;AAEX,MAAM,wBAAwB,SAAS,aAAa,YAAY;AAChE,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const DSToolbarV2Context =
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
const DSToolbarV2Context = createContext({
|
|
4
4
|
registerReference: () => null,
|
|
5
5
|
itemReferences: {},
|
|
6
|
-
toolbarUid:
|
|
6
|
+
toolbarUid: ""
|
|
7
7
|
});
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export {
|
|
9
|
+
DSToolbarV2Context
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=DSToolbarV2Context.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarV2Context.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext, MutableRefObject } from 'react';\n\ninterface IDSToolbarV2Context {\n registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;\n itemReferences: Record<string, MutableRefObject<HTMLElement>>;\n toolbarUid: string;\n}\n\nexport const DSToolbarV2Context = createContext<IDSToolbarV2Context>({\n registerReference: () => null,\n itemReferences: {},\n toolbarUid: '',\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAQO,MAAM,qBAAqB,cAAmC;AAAA,EACnE,mBAAmB,MAAM;AAAA,EACzB,gBAAgB;AAAA,EAChB,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,83 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let {
|
|
28
|
-
withDepth,
|
|
29
|
-
alignment,
|
|
30
|
-
size
|
|
31
|
-
} = _ref;
|
|
32
|
-
return {
|
|
33
|
-
'without-depth': !withDepth,
|
|
34
|
-
[alignment]: !!alignment,
|
|
35
|
-
[size]: size
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const DSToolbar = _ref2 => {
|
|
40
|
-
let {
|
|
41
|
-
containerProps = {},
|
|
42
|
-
innerRef,
|
|
43
|
-
withDepth = true,
|
|
44
|
-
alignment = 'right',
|
|
45
|
-
// left || right
|
|
46
|
-
autoFocusOnMount = true,
|
|
47
|
-
children = [],
|
|
48
|
-
size = 'normal'
|
|
49
|
-
} = _ref2,
|
|
50
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded);
|
|
51
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useRef } from "react";
|
|
3
|
+
import { describe, PropTypes } from "react-desc";
|
|
4
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
5
|
+
import FocusGroupProvider from "@elliemae/ds-shared/FocusGroup/FocusGroupManager";
|
|
6
|
+
import { mergeRefs } from "@elliemae/ds-utilities";
|
|
7
|
+
import decorateToolbarChildren from "./decorateToolbarChildren";
|
|
8
|
+
import Item from "./ToolbarItem";
|
|
9
|
+
import ToolbarGroup from "./ToolbarGroup";
|
|
10
|
+
import Divider from "./ToolbarDivider";
|
|
11
|
+
const blockName = "toolbar";
|
|
12
|
+
const ToolbarContainer = aggregatedClasses("div")(blockName, null, ({ withDepth, alignment, size }) => ({
|
|
13
|
+
"without-depth": !withDepth,
|
|
14
|
+
[alignment]: !!alignment,
|
|
15
|
+
[size]: size
|
|
16
|
+
}));
|
|
17
|
+
const DSToolbar = ({
|
|
18
|
+
containerProps = {},
|
|
19
|
+
innerRef,
|
|
20
|
+
withDepth = true,
|
|
21
|
+
alignment = "right",
|
|
22
|
+
autoFocusOnMount = true,
|
|
23
|
+
children = [],
|
|
24
|
+
size = "normal",
|
|
25
|
+
...otherProps
|
|
26
|
+
}) => {
|
|
52
27
|
const containerRef = useRef(null);
|
|
53
|
-
return
|
|
54
|
-
autoFocusOnMount
|
|
28
|
+
return /* @__PURE__ */ React2.createElement(FocusGroupProvider, {
|
|
29
|
+
autoFocusOnMount,
|
|
55
30
|
getContainer: () => containerRef.current,
|
|
56
31
|
keyBindings: {
|
|
57
|
-
Tab:
|
|
32
|
+
Tab: "next"
|
|
58
33
|
},
|
|
59
34
|
orientation: "horizontal"
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
innerRef: mergeRefs(innerRef, containerRef),
|
|
67
|
-
children: decorateToolbarChildren(children)
|
|
68
|
-
})));
|
|
35
|
+
}, /* @__PURE__ */ React2.createElement(ToolbarContainer, {
|
|
36
|
+
...containerProps,
|
|
37
|
+
...otherProps,
|
|
38
|
+
classProps: { withDepth, alignment, size },
|
|
39
|
+
innerRef: mergeRefs(innerRef, containerRef)
|
|
40
|
+
}, decorateToolbarChildren(children)));
|
|
69
41
|
};
|
|
70
|
-
|
|
71
42
|
const toolbarProps = {
|
|
72
|
-
containerProps: PropTypes.object.description(
|
|
73
|
-
withDepth: PropTypes.bool.description(
|
|
74
|
-
alignment: PropTypes.oneOf([
|
|
75
|
-
size: PropTypes.oneOf([
|
|
76
|
-
autoFocusOnMount: PropTypes.bool.description(
|
|
77
|
-
children: PropTypes.oneOfType([
|
|
78
|
-
|
|
43
|
+
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
44
|
+
withDepth: PropTypes.bool.description("Shows a shadow rear the toolbar").defaultValue(true),
|
|
45
|
+
alignment: PropTypes.oneOf(["right", "left"]).description("Aligns the toolbar to the left or right").defaultValue("right"),
|
|
46
|
+
size: PropTypes.oneOf(["normal", "compact"]).description("Toolbar size").defaultValue("normal"),
|
|
47
|
+
autoFocusOnMount: PropTypes.bool.description("Wheter to focus the component when it mounts or not").defaultValue(true),
|
|
48
|
+
children: PropTypes.oneOfType([
|
|
49
|
+
PropTypes.array,
|
|
50
|
+
PropTypes.func,
|
|
51
|
+
PropTypes.node
|
|
52
|
+
]).description("Toolbar items").isRequired,
|
|
53
|
+
innerRef: PropTypes.object.description("Ref to the Toolbar container element")
|
|
79
54
|
};
|
|
55
|
+
DSToolbar.propTypes = toolbarProps;
|
|
80
56
|
const ToolbarWithSchema = describe(DSToolbar);
|
|
81
57
|
ToolbarWithSchema.propTypes = toolbarProps;
|
|
82
|
-
|
|
83
|
-
export {
|
|
58
|
+
var DSToolbar_default = DSToolbar;
|
|
59
|
+
export {
|
|
60
|
+
DSToolbar,
|
|
61
|
+
Divider as ToolbarDivider,
|
|
62
|
+
ToolbarGroup,
|
|
63
|
+
Item as ToolbarItem,
|
|
64
|
+
ToolbarWithSchema,
|
|
65
|
+
DSToolbar_default as default
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=DSToolbar.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/DSToolbar.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,OACzC,WACA,MACA,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACnC,iBAAiB,CAAC;AAAA,GACjB,YAAY,CAAC,CAAC;AAAA,GACd,OAAO;AAAA;AAIZ,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,OAAO;AAAA,KACJ;AAAA,MACC;AACJ,QAAM,eAAe,OAAO;AAC5B,SACE,qCAAC,oBAAD;AAAA,IACE;AAAA,IACA,cAAc,MAAM,aAAa;AAAA,IACjC,aAAa;AAAA,MACX,KAAK;AAAA;AAAA,IAEP,aAAY;AAAA,KAEZ,qCAAC,kBAAD;AAAA,OACM;AAAA,OACA;AAAA,IACJ,YAAY,EAAE,WAAW,WAAW;AAAA,IACpC,UAAU,UAAU,UAAU;AAAA,KAE7B,wBAAwB;AAAA;AAMjC,MAAM,eAAe;AAAA,EACnB,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAEF,WAAW,UAAU,KAClB,YAAY,mCACZ,aAAa;AAAA,EAChB,WAAW,UAAU,MAAM,CAAC,SAAS,SAClC,YAAY,2CACZ,aAAa;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,YAC9B,YAAY,gBACZ,aAAa;AAAA,EAChB,kBAAkB,UAAU,KACzB,YAAY,uDACZ,aAAa;AAAA,EAChB,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,KACT,YAAY,iBAAiB;AAAA,EAChC,UAAU,UAAU,OAAO,YACzB;AAAA;AAIJ,UAAU,YAAY;AAEtB,MAAM,oBAAoB,SAAS;AACnC,kBAAkB,YAAY;AAU9B,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const blockName =
|
|
4
|
-
const ToolbarDivider = aggregatedClasses(
|
|
5
|
-
ToolbarDivider.displayName =
|
|
6
|
-
|
|
7
|
-
export {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
3
|
+
const blockName = "toolbar";
|
|
4
|
+
const ToolbarDivider = aggregatedClasses("div")(blockName, "divider");
|
|
5
|
+
ToolbarDivider.displayName = "ToolbarDivider";
|
|
6
|
+
var ToolbarDivider_default = ToolbarDivider;
|
|
7
|
+
export {
|
|
8
|
+
ToolbarDivider_default as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=ToolbarDivider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/ToolbarDivider.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'toolbar';\n\nconst ToolbarDivider = aggregatedClasses('div')(blockName, 'divider');\n\nToolbarDivider.displayName = 'ToolbarDivider';\n\nexport default ToolbarDivider;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,MAAM,YAAY;AAElB,MAAM,iBAAiB,kBAAkB,OAAO,WAAW;AAE3D,eAAe,cAAc;AAE7B,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|