@elliemae/ds-toolbar-v1 3.22.0-next.24

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.
Files changed (38) hide show
  1. package/dist/cjs/DSToolbar.js +96 -0
  2. package/dist/cjs/DSToolbar.js.map +7 -0
  3. package/dist/cjs/ToolbarDivider.js +40 -0
  4. package/dist/cjs/ToolbarDivider.js.map +7 -0
  5. package/dist/cjs/ToolbarGroup.js +50 -0
  6. package/dist/cjs/ToolbarGroup.js.map +7 -0
  7. package/dist/cjs/ToolbarItem.js +60 -0
  8. package/dist/cjs/ToolbarItem.js.map +7 -0
  9. package/dist/cjs/decorateToolbarChildren.js +45 -0
  10. package/dist/cjs/decorateToolbarChildren.js.map +7 -0
  11. package/dist/cjs/hooks/useKeyboardNavigation.js +72 -0
  12. package/dist/cjs/hooks/useKeyboardNavigation.js.map +7 -0
  13. package/dist/cjs/index.js +38 -0
  14. package/dist/cjs/index.js.map +7 -0
  15. package/dist/cjs/package.json +7 -0
  16. package/dist/esm/DSToolbar.js +66 -0
  17. package/dist/esm/DSToolbar.js.map +7 -0
  18. package/dist/esm/ToolbarDivider.js +10 -0
  19. package/dist/esm/ToolbarDivider.js.map +7 -0
  20. package/dist/esm/ToolbarGroup.js +20 -0
  21. package/dist/esm/ToolbarGroup.js.map +7 -0
  22. package/dist/esm/ToolbarItem.js +30 -0
  23. package/dist/esm/ToolbarItem.js.map +7 -0
  24. package/dist/esm/decorateToolbarChildren.js +15 -0
  25. package/dist/esm/decorateToolbarChildren.js.map +7 -0
  26. package/dist/esm/hooks/useKeyboardNavigation.js +42 -0
  27. package/dist/esm/hooks/useKeyboardNavigation.js.map +7 -0
  28. package/dist/esm/index.js +7 -0
  29. package/dist/esm/index.js.map +7 -0
  30. package/dist/esm/package.json +7 -0
  31. package/dist/types/DSToolbar.d.ts +37 -0
  32. package/dist/types/ToolbarDivider.d.ts +3 -0
  33. package/dist/types/ToolbarGroup.d.ts +14 -0
  34. package/dist/types/ToolbarItem.d.ts +16 -0
  35. package/dist/types/decorateToolbarChildren.d.ts +2 -0
  36. package/dist/types/hooks/useKeyboardNavigation.d.ts +9 -0
  37. package/dist/types/index.d.ts +2 -0
  38. package/package.json +127 -0
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSToolbar_exports = {};
30
+ __export(DSToolbar_exports, {
31
+ DSToolbar: () => DSToolbar,
32
+ ToolbarDivider: () => import_ToolbarDivider.default,
33
+ ToolbarGroup: () => import_ToolbarGroup.default,
34
+ ToolbarItem: () => import_ToolbarItem.default,
35
+ ToolbarWithSchema: () => ToolbarWithSchema,
36
+ default: () => DSToolbar_default
37
+ });
38
+ module.exports = __toCommonJS(DSToolbar_exports);
39
+ var React = __toESM(require("react"));
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var import_react = require("react");
42
+ var import_ds_classnames = require("@elliemae/ds-classnames");
43
+ var import_ds_utilities = require("@elliemae/ds-utilities");
44
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
45
+ var import_decorateToolbarChildren = __toESM(require("./decorateToolbarChildren.js"));
46
+ var import_ToolbarItem = __toESM(require("./ToolbarItem.js"));
47
+ var import_ToolbarGroup = __toESM(require("./ToolbarGroup.js"));
48
+ var import_ToolbarDivider = __toESM(require("./ToolbarDivider.js"));
49
+ var import_useKeyboardNavigation = require("./hooks/useKeyboardNavigation.js");
50
+ const blockName = "toolbar";
51
+ const ToolbarContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, null, ({ withDepth, alignment, size }) => ({
52
+ "without-depth": !withDepth,
53
+ [alignment]: !!alignment,
54
+ [size]: size
55
+ }));
56
+ const DSToolbar = ({
57
+ containerProps = {},
58
+ innerRef,
59
+ withDepth = true,
60
+ alignment = "right",
61
+ // left || right
62
+ autoFocusOnMount = true,
63
+ children = [],
64
+ size = "normal",
65
+ ...otherProps
66
+ }) => {
67
+ (0, import_ds_utilities.useDeprecateComponent)({ componentName: "ds-toolbar", version: "TBD Date: 2023 Q3" });
68
+ const containerRef = (0, import_react.useRef)(null);
69
+ const { handleOnKeyDown } = (0, import_useKeyboardNavigation.useKeyboardNavigation)({ containerRef, autoFocusOnMount });
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
+ ToolbarContainer,
72
+ {
73
+ ...containerProps,
74
+ ...otherProps,
75
+ classProps: { withDepth, alignment, size },
76
+ innerRef: (0, import_ds_utilities.mergeRefs)(innerRef, containerRef),
77
+ onKeyDown: handleOnKeyDown,
78
+ children: (0, import_decorateToolbarChildren.default)(children)
79
+ }
80
+ );
81
+ };
82
+ const toolbarProps = {
83
+ containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container"),
84
+ withDepth: import_ds_props_helpers.PropTypes.bool.description("Shows a shadow rear the toolbar").defaultValue(true),
85
+ alignment: import_ds_props_helpers.PropTypes.oneOf(["right", "left"]).description("Aligns the toolbar to the left or right").defaultValue("right"),
86
+ size: import_ds_props_helpers.PropTypes.oneOf(["normal", "compact"]).description("Toolbar size").defaultValue("normal"),
87
+ autoFocusOnMount: import_ds_props_helpers.PropTypes.bool.description("Wheter to focus the component when it mounts or not").defaultValue(true),
88
+ children: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.array, import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.node]).description("Toolbar items").isRequired,
89
+ innerRef: import_ds_props_helpers.PropTypes.object.description("Ref to the Toolbar container element")
90
+ };
91
+ DSToolbar.propTypes = toolbarProps;
92
+ DSToolbar.displayName = "DSToolbar";
93
+ const ToolbarWithSchema = (0, import_ds_props_helpers.describe)(DSToolbar);
94
+ ToolbarWithSchema.propTypes = toolbarProps;
95
+ var DSToolbar_default = DSToolbar;
96
+ //# sourceMappingURL=DSToolbar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSToolbar.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useRef } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { mergeRefs, useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport decorateToolbarChildren from './decorateToolbarChildren.js';\nimport Item from './ToolbarItem.js';\nimport ToolbarGroup from './ToolbarGroup.js';\nimport Divider from './ToolbarDivider.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(blockName, null, ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\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 useDeprecateComponent({ componentName: 'ds-toolbar', version: 'TBD Date: 2023 Q3' });\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const { handleOnKeyDown } = useKeyboardNavigation({ containerRef, autoFocusOnMount });\n\n return (\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n onKeyDown={handleOnKeyDown}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n withDepth: PropTypes.bool.description('Shows a shadow rear the toolbar').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']).description('Toolbar size').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([PropTypes.array, PropTypes.func, PropTypes.node]).description('Toolbar items')\n .isRequired,\n innerRef: PropTypes.object.description('Ref to the Toolbar container element'),\n};\n\nDSToolbar.propTypes = toolbarProps;\nDSToolbar.displayName = 'DSToolbar';\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport { DSToolbar, Item as ToolbarItem, ToolbarGroup, Divider as ToolbarDivider, ToolbarWithSchema };\n\nexport default DSToolbar;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,wCAAAC;AAAA,EAAA,sCAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuCnB;AAnCJ,mBAA8B;AAC9B,2BAAkC;AAClC,0BAAiD;AACjD,8BAAoC;AACpC,qCAAoC;AACpC,yBAAiB;AACjB,0BAAyB;AACzB,4BAAoB;AACpB,mCAAsC;AAEtC,MAAM,YAAY;AAElB,MAAM,uBAAmB,wCAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,WAAW,WAAW,KAAK,OAAO;AAAA,EACtG,iBAAiB,CAAC;AAAA,EAClB,CAAC,SAAS,GAAG,CAAC,CAAC;AAAA,EACf,CAAC,IAAI,GAAG;AACV,EAAE;AAEF,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA;AAAA,EACZ,mBAAmB;AAAA,EACnB,WAAW,CAAC;AAAA,EACZ,OAAO;AAAA,EACP,GAAG;AACL,MAAM;AACJ,iDAAsB,EAAE,eAAe,cAAc,SAAS,oBAAoB,CAAC;AAEnF,QAAM,mBAAe,qBAA8B,IAAI;AAEvD,QAAM,EAAE,gBAAgB,QAAI,oDAAsB,EAAE,cAAc,iBAAiB,CAAC;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,MACzC,cAAU,+BAAU,UAAU,YAAY;AAAA,MAC1C,WAAW;AAAA,MAEV,6CAAAC,SAAwB,QAAQ;AAAA;AAAA,EACnC;AAEJ;AAEA,MAAM,eAAe;AAAA,EACnB,gBAAgB,kCAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,kCAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,IAAI;AAAA,EAC1F,WAAW,kCAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,yCAAyC,EACrD,aAAa,OAAO;AAAA,EACvB,MAAM,kCAAU,MAAM,CAAC,UAAU,SAAS,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,QAAQ;AAAA,EAC9F,kBAAkB,kCAAU,KACzB,YAAY,qDAAqD,EACjE,aAAa,IAAI;AAAA,EACpB,UAAU,kCAAU,UAAU,CAAC,kCAAU,OAAO,kCAAU,MAAM,kCAAU,IAAI,CAAC,EAAE,YAAY,eAAe,EACzG;AAAA,EACH,UAAU,kCAAU,OAAO,YAAY,sCAAsC;AAC/E;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,wBAAoB,kCAAS,SAAS;AAC5C,kBAAkB,YAAY;AAI9B,IAAO,oBAAQ;",
6
+ "names": ["Divider", "ToolbarGroup", "Item", "decorateToolbarChildren"]
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ToolbarDivider_exports = {};
30
+ __export(ToolbarDivider_exports, {
31
+ default: () => ToolbarDivider_default
32
+ });
33
+ module.exports = __toCommonJS(ToolbarDivider_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_classnames = require("@elliemae/ds-classnames");
36
+ const blockName = "toolbar";
37
+ const ToolbarDivider = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "divider");
38
+ ToolbarDivider.displayName = "ToolbarDivider";
39
+ var ToolbarDivider_default = ToolbarDivider;
40
+ //# sourceMappingURL=ToolbarDivider.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/ToolbarDivider.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,qBAAiB,wCAAkB,KAAK,EAAE,WAAW,SAAS;AAEpE,eAAe,cAAc;AAE7B,IAAO,yBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ToolbarGroup_exports = {};
30
+ __export(ToolbarGroup_exports, {
31
+ default: () => ToolbarGroup_default
32
+ });
33
+ module.exports = __toCommonJS(ToolbarGroup_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_prop_types = __toESM(require("prop-types"));
37
+ var import_ds_classnames = require("@elliemae/ds-classnames");
38
+ var import_decorateToolbarChildren = __toESM(require("./decorateToolbarChildren.js"));
39
+ const blockName = "toolbar-group";
40
+ const ToolbarGroupContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, null, ({ space }) => ({
41
+ [`space-${space}`]: !!space
42
+ }));
43
+ const ToolbarGroup = ({ children, size, space = 0 }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolbarGroupContainer, { classProps: { space }, children: (0, import_decorateToolbarChildren.default)(children, { size }) });
44
+ ToolbarGroup.propTypes = {
45
+ children: import_prop_types.default.any,
46
+ size: import_prop_types.default.number,
47
+ space: import_prop_types.default.number
48
+ };
49
+ var ToolbarGroup_default = ToolbarGroup;
50
+ //# sourceMappingURL=ToolbarGroup.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/ToolbarGroup.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren.js';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(blockName, null, ({ space }) => ({\n [`space-${space}`]: !!space,\n}));\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>{decorateToolbarChildren(children, { size })}</ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgBrB;AAXF,wBAAsB;AACtB,2BAAkC;AAClC,qCAAoC;AAEpC,MAAM,YAAY;AAElB,MAAM,4BAAwB,wCAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,MAAM,OAAO;AAAA,EACtF,CAAC,SAAS,OAAO,GAAG,CAAC,CAAC;AACxB,EAAE;AAEF,MAAM,eAAe,CAAC,EAAE,UAAU,MAAM,QAAQ,EAAE,MAChD,4CAAC,yBAAsB,YAAY,EAAE,MAAM,GAAI,6CAAAA,SAAwB,UAAU,EAAE,KAAK,CAAC,GAAE;AAG7F,aAAa,YAAY;AAAA,EACvB,UAAU,kBAAAC,QAAU;AAAA,EACpB,MAAM,kBAAAA,QAAU;AAAA,EAChB,OAAO,kBAAAA,QAAU;AACnB;AAEA,IAAO,uBAAQ;",
6
+ "names": ["decorateToolbarChildren", "PropTypes"]
7
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ToolbarItem_exports = {};
30
+ __export(ToolbarItem_exports, {
31
+ default: () => ToolbarItem_default
32
+ });
33
+ module.exports = __toCommonJS(ToolbarItem_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = __toESM(require("react"));
37
+ var import_prop_types = __toESM(require("prop-types"));
38
+ var import_ds_shared = require("@elliemae/ds-shared");
39
+ var import_ds_button_v2 = require("@elliemae/ds-button-v2");
40
+ var import_ds_popper = require("@elliemae/ds-popper");
41
+ const ToolbarItem = ({ icon, labelText, menu = void 0, containerProps = {}, ...otherProps }) => {
42
+ const [ref, setRef] = (0, import_react.useState)(null);
43
+ (0, import_ds_shared.useFocusGroupWithState)(ref);
44
+ const btn = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button_v2.DSButtonV2, { ...otherProps, buttonType: "icon", innerRef: (r) => setRef(r), labelText, ...containerProps, children: icon });
45
+ if (menu) {
46
+ return import_react.default.cloneElement(menu, {
47
+ ...menu.props,
48
+ placement: import_ds_popper.PopperPositions.BOTTOM_END,
49
+ triggerComponent: btn
50
+ });
51
+ }
52
+ return btn;
53
+ };
54
+ ToolbarItem.displayName = "ToolbarItem";
55
+ ToolbarItem.propTypes = {
56
+ icon: import_prop_types.default.element,
57
+ labelText: import_prop_types.default.string
58
+ };
59
+ var ToolbarItem_default = ToolbarItem;
60
+ //# sourceMappingURL=ToolbarItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/ToolbarItem.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, containerProps = {}, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButtonV2 {...otherProps} buttonType=\"icon\" innerRef={(r) => setRef(r)} labelText={labelText} {...containerProps}>\n {icon}\n </DSButtonV2>\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADenB;AAXJ,mBAAgC;AAChC,wBAAsB;AACtB,uBAAuC;AACvC,0BAA2B;AAC3B,uBAA4C;AAE5C,MAAM,cAAc,CAAC,EAAE,MAAM,WAAW,OAAO,QAAW,iBAAiB,CAAC,GAAG,GAAG,WAAW,MAAM;AACjG,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAS,IAAI;AAEnC,+CAAuB,GAAG;AAC1B,QAAM,MACJ,4CAAC,kCAAY,GAAG,YAAY,YAAW,QAAO,UAAU,CAAC,MAAM,OAAO,CAAC,GAAG,WAAuB,GAAG,gBACjG,gBACH;AAEF,MAAI,MAAM;AACR,WAAO,aAAAA,QAAM,aAAa,MAAM;AAAA,MAC9B,GAAG,KAAK;AAAA,MACR,WAAW,iBAAAC,gBAAS;AAAA,MACpB,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEA,YAAY,cAAc;AAE1B,YAAY,YAAY;AAAA,EACtB,MAAM,kBAAAC,QAAU;AAAA,EAChB,WAAW,kBAAAA,QAAU;AACvB;AAEA,IAAO,sBAAQ;",
6
+ "names": ["React", "Position", "PropTypes"]
7
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var decorateToolbarChildren_exports = {};
30
+ __export(decorateToolbarChildren_exports, {
31
+ default: () => decorateToolbarChildren_default
32
+ });
33
+ module.exports = __toCommonJS(decorateToolbarChildren_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var decorateToolbarChildren_default = (children, extraProps = {}) => import_react.default.Children.map(
37
+ children,
38
+ (component) => component ? (0, import_react.cloneElement)(component, {
39
+ ...extraProps,
40
+ ...component.props,
41
+ className: `${component.props.className} toolbar-item`
42
+ }) : component,
43
+ null
44
+ );
45
+ //# sourceMappingURL=decorateToolbarChildren.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/decorateToolbarChildren.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n (component) =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAoC;AAEpC,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtC,aAAAA,QAAM,SAAS;AAAA,EACb;AAAA,EACA,CAAC,cACC,gBACI,2BAAa,WAAW;AAAA,IACtB,GAAG;AAAA,IACH,GAAG,UAAU;AAAA,IACb,WAAW,GAAG,UAAU,MAAM;AAAA,EAChC,CAAC,IACD;AAAA,EACN;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useKeyboardNavigation_exports = {};
30
+ __export(useKeyboardNavigation_exports, {
31
+ useKeyboardNavigation: () => useKeyboardNavigation
32
+ });
33
+ module.exports = __toCommonJS(useKeyboardNavigation_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = require("react");
36
+ const useKeyboardNavigation = ({ containerRef, autoFocusOnMount }) => {
37
+ const allChildrenButtonRef = (0, import_react.useRef)(null);
38
+ (0, import_react.useEffect)(() => {
39
+ if (containerRef.current) {
40
+ allChildrenButtonRef.current = containerRef.current.querySelectorAll("button");
41
+ }
42
+ if (autoFocusOnMount) {
43
+ setTimeout(() => allChildrenButtonRef.current?.[0].focus());
44
+ }
45
+ }, [autoFocusOnMount]);
46
+ const handleOnKeyDown = (0, import_react.useCallback)((e) => {
47
+ if (allChildrenButtonRef.current) {
48
+ const lastButton = allChildrenButtonRef.current[allChildrenButtonRef.current?.length - 1];
49
+ const firstButton = allChildrenButtonRef.current[0];
50
+ if (e.key === "ArrowRight") {
51
+ e.preventDefault();
52
+ if (e.target !== lastButton) {
53
+ e.target.nextSibling.focus();
54
+ } else {
55
+ firstButton.focus();
56
+ }
57
+ }
58
+ if (e.key === "ArrowLeft") {
59
+ e.preventDefault();
60
+ if (e.target !== firstButton) {
61
+ e.target.previousSibling.focus();
62
+ } else {
63
+ lastButton.focus();
64
+ }
65
+ }
66
+ }
67
+ }, []);
68
+ return {
69
+ handleOnKeyDown
70
+ };
71
+ };
72
+ //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useKeyboardNavigation.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport type React from 'react';\nimport { useRef, useEffect, useCallback } from 'react';\n\ninterface useKeyboardNavigationT {\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n autoFocusOnMount: boolean;\n}\n\n// Toolbar should not allow to use Tab/Shift+Tab to navigate between ToolbarItems.\n// Tab/Shift+Tab should be only used once to enter the whole controller.\n// Toolbars should be only navigable with Arrows to follow correct a11y.\n// https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html\n\nexport const useKeyboardNavigation = ({ containerRef, autoFocusOnMount }: useKeyboardNavigationT) => {\n const allChildrenButtonRef = useRef<NodeListOf<HTMLButtonElement> | null>(null);\n\n useEffect(() => {\n if (containerRef.current) {\n allChildrenButtonRef.current = containerRef.current.querySelectorAll('button');\n // allChildrenButtonRef.current.forEach((button, index) => {\n // if (index !== 0) {\n // button.setAttribute('tabindex', '-1');\n // }\n // });\n }\n\n if (autoFocusOnMount) {\n setTimeout(() => allChildrenButtonRef.current?.[0].focus());\n }\n\n // return () => {\n // allChildrenButtonRef.current?.forEach((button, index) => {\n // if (index !== 0) {\n // button.setAttribute('tabindex', '');\n // }\n // });\n // };\n }, [autoFocusOnMount]);\n\n const handleOnKeyDown = useCallback((e) => {\n if (allChildrenButtonRef.current) {\n const lastButton = allChildrenButtonRef.current[allChildrenButtonRef.current?.length - 1];\n const firstButton = allChildrenButtonRef.current[0];\n\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n if (e.target !== lastButton) {\n e.target.nextSibling.focus();\n } else {\n firstButton.focus();\n }\n }\n if (e.key === 'ArrowLeft') {\n e.preventDefault();\n if (e.target !== firstButton) {\n e.target.previousSibling.focus();\n } else {\n lastButton.focus();\n }\n }\n }\n }, []);\n\n return {\n handleOnKeyDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAYxC,MAAM,wBAAwB,CAAC,EAAE,cAAc,iBAAiB,MAA8B;AACnG,QAAM,2BAAuB,qBAA6C,IAAI;AAE9E,8BAAU,MAAM;AACd,QAAI,aAAa,SAAS;AACxB,2BAAqB,UAAU,aAAa,QAAQ,iBAAiB,QAAQ;AAAA,IAM/E;AAEA,QAAI,kBAAkB;AACpB,iBAAW,MAAM,qBAAqB,UAAU,CAAC,EAAE,MAAM,CAAC;AAAA,IAC5D;AAAA,EASF,GAAG,CAAC,gBAAgB,CAAC;AAErB,QAAM,sBAAkB,0BAAY,CAAC,MAAM;AACzC,QAAI,qBAAqB,SAAS;AAChC,YAAM,aAAa,qBAAqB,QAAQ,qBAAqB,SAAS,SAAS,CAAC;AACxF,YAAM,cAAc,qBAAqB,QAAQ,CAAC;AAElD,UAAI,EAAE,QAAQ,cAAc;AAC1B,UAAE,eAAe;AACjB,YAAI,EAAE,WAAW,YAAY;AAC3B,YAAE,OAAO,YAAY,MAAM;AAAA,QAC7B,OAAO;AACL,sBAAY,MAAM;AAAA,QACpB;AAAA,MACF;AACA,UAAI,EAAE,QAAQ,aAAa;AACzB,UAAE,eAAe;AACjB,YAAI,EAAE,WAAW,aAAa;AAC5B,YAAE,OAAO,gBAAgB,MAAM;AAAA,QACjC,OAAO;AACL,qBAAW,MAAM;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AAAA,IACL;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ default: () => import_DSToolbar.default
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ __reExport(src_exports, require("./DSToolbar.js"), module.exports);
37
+ var import_DSToolbar = __toESM(require("./DSToolbar.js"));
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable import/export */\nexport * from './DSToolbar.js';\n\nexport { default } from './DSToolbar.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAAc,2BADd;AAGA,uBAAwB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,66 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
5
+ import { mergeRefs, useDeprecateComponent } from "@elliemae/ds-utilities";
6
+ import { describe, PropTypes } from "@elliemae/ds-props-helpers";
7
+ import decorateToolbarChildren from "./decorateToolbarChildren.js";
8
+ import Item from "./ToolbarItem.js";
9
+ import ToolbarGroup from "./ToolbarGroup.js";
10
+ import Divider from "./ToolbarDivider.js";
11
+ import { useKeyboardNavigation } from "./hooks/useKeyboardNavigation.js";
12
+ const blockName = "toolbar";
13
+ const ToolbarContainer = aggregatedClasses("div")(blockName, null, ({ withDepth, alignment, size }) => ({
14
+ "without-depth": !withDepth,
15
+ [alignment]: !!alignment,
16
+ [size]: size
17
+ }));
18
+ const DSToolbar = ({
19
+ containerProps = {},
20
+ innerRef,
21
+ withDepth = true,
22
+ alignment = "right",
23
+ // left || right
24
+ autoFocusOnMount = true,
25
+ children = [],
26
+ size = "normal",
27
+ ...otherProps
28
+ }) => {
29
+ useDeprecateComponent({ componentName: "ds-toolbar", version: "TBD Date: 2023 Q3" });
30
+ const containerRef = useRef(null);
31
+ const { handleOnKeyDown } = useKeyboardNavigation({ containerRef, autoFocusOnMount });
32
+ return /* @__PURE__ */ jsx(
33
+ ToolbarContainer,
34
+ {
35
+ ...containerProps,
36
+ ...otherProps,
37
+ classProps: { withDepth, alignment, size },
38
+ innerRef: mergeRefs(innerRef, containerRef),
39
+ onKeyDown: handleOnKeyDown,
40
+ children: decorateToolbarChildren(children)
41
+ }
42
+ );
43
+ };
44
+ const toolbarProps = {
45
+ containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
46
+ withDepth: PropTypes.bool.description("Shows a shadow rear the toolbar").defaultValue(true),
47
+ alignment: PropTypes.oneOf(["right", "left"]).description("Aligns the toolbar to the left or right").defaultValue("right"),
48
+ size: PropTypes.oneOf(["normal", "compact"]).description("Toolbar size").defaultValue("normal"),
49
+ autoFocusOnMount: PropTypes.bool.description("Wheter to focus the component when it mounts or not").defaultValue(true),
50
+ children: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.node]).description("Toolbar items").isRequired,
51
+ innerRef: PropTypes.object.description("Ref to the Toolbar container element")
52
+ };
53
+ DSToolbar.propTypes = toolbarProps;
54
+ DSToolbar.displayName = "DSToolbar";
55
+ const ToolbarWithSchema = describe(DSToolbar);
56
+ ToolbarWithSchema.propTypes = toolbarProps;
57
+ var DSToolbar_default = DSToolbar;
58
+ export {
59
+ DSToolbar,
60
+ Divider as ToolbarDivider,
61
+ ToolbarGroup,
62
+ Item as ToolbarItem,
63
+ ToolbarWithSchema,
64
+ DSToolbar_default as default
65
+ };
66
+ //# sourceMappingURL=DSToolbar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbar.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useRef } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { mergeRefs, useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport decorateToolbarChildren from './decorateToolbarChildren.js';\nimport Item from './ToolbarItem.js';\nimport ToolbarGroup from './ToolbarGroup.js';\nimport Divider from './ToolbarDivider.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(blockName, null, ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\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 useDeprecateComponent({ componentName: 'ds-toolbar', version: 'TBD Date: 2023 Q3' });\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const { handleOnKeyDown } = useKeyboardNavigation({ containerRef, autoFocusOnMount });\n\n return (\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n onKeyDown={handleOnKeyDown}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n withDepth: PropTypes.bool.description('Shows a shadow rear the toolbar').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']).description('Toolbar size').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([PropTypes.array, PropTypes.func, PropTypes.node]).description('Toolbar items')\n .isRequired,\n innerRef: PropTypes.object.description('Ref to the Toolbar container element'),\n};\n\nDSToolbar.propTypes = toolbarProps;\nDSToolbar.displayName = 'DSToolbar';\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport { DSToolbar, Item as ToolbarItem, ToolbarGroup, Divider as ToolbarDivider, ToolbarWithSchema };\n\nexport default DSToolbar;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACuCnB;AAnCJ,SAAgB,cAAc;AAC9B,SAAS,yBAAyB;AAClC,SAAS,WAAW,6BAA6B;AACjD,SAAS,UAAU,iBAAiB;AACpC,OAAO,6BAA6B;AACpC,OAAO,UAAU;AACjB,OAAO,kBAAkB;AACzB,OAAO,aAAa;AACpB,SAAS,6BAA6B;AAEtC,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,WAAW,WAAW,KAAK,OAAO;AAAA,EACtG,iBAAiB,CAAC;AAAA,EAClB,CAAC,SAAS,GAAG,CAAC,CAAC;AAAA,EACf,CAAC,IAAI,GAAG;AACV,EAAE;AAEF,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA;AAAA,EACZ,mBAAmB;AAAA,EACnB,WAAW,CAAC;AAAA,EACZ,OAAO;AAAA,EACP,GAAG;AACL,MAAM;AACJ,wBAAsB,EAAE,eAAe,cAAc,SAAS,oBAAoB,CAAC;AAEnF,QAAM,eAAe,OAA8B,IAAI;AAEvD,QAAM,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,cAAc,iBAAiB,CAAC;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,MACzC,UAAU,UAAU,UAAU,YAAY;AAAA,MAC1C,WAAW;AAAA,MAEV,kCAAwB,QAAQ;AAAA;AAAA,EACnC;AAEJ;AAEA,MAAM,eAAe;AAAA,EACnB,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,UAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,IAAI;AAAA,EAC1F,WAAW,UAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,yCAAyC,EACrD,aAAa,OAAO;AAAA,EACvB,MAAM,UAAU,MAAM,CAAC,UAAU,SAAS,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,QAAQ;AAAA,EAC9F,kBAAkB,UAAU,KACzB,YAAY,qDAAqD,EACjE,aAAa,IAAI;AAAA,EACpB,UAAU,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,UAAU,IAAI,CAAC,EAAE,YAAY,eAAe,EACzG;AAAA,EACH,UAAU,UAAU,OAAO,YAAY,sCAAsC;AAC/E;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;AAI9B,IAAO,oBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
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/ToolbarDivider.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { 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,YAAY,WAAW;ACIvB,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,iBAAiB,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAEpE,eAAe,cAAc;AAE7B,IAAO,yBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import PropTypes from "prop-types";
4
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
5
+ import decorateToolbarChildren from "./decorateToolbarChildren.js";
6
+ const blockName = "toolbar-group";
7
+ const ToolbarGroupContainer = aggregatedClasses("div")(blockName, null, ({ space }) => ({
8
+ [`space-${space}`]: !!space
9
+ }));
10
+ const ToolbarGroup = ({ children, size, space = 0 }) => /* @__PURE__ */ jsx(ToolbarGroupContainer, { classProps: { space }, children: decorateToolbarChildren(children, { size }) });
11
+ ToolbarGroup.propTypes = {
12
+ children: PropTypes.any,
13
+ size: PropTypes.number,
14
+ space: PropTypes.number
15
+ };
16
+ var ToolbarGroup_default = ToolbarGroup;
17
+ export {
18
+ ToolbarGroup_default as default
19
+ };
20
+ //# sourceMappingURL=ToolbarGroup.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ToolbarGroup.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren.js';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(blockName, null, ({ space }) => ({\n [`space-${space}`]: !!space,\n}));\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>{decorateToolbarChildren(children, { size })}</ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgBrB;AAXF,OAAO,eAAe;AACtB,SAAS,yBAAyB;AAClC,OAAO,6BAA6B;AAEpC,MAAM,YAAY;AAElB,MAAM,wBAAwB,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,MAAM,OAAO;AAAA,EACtF,CAAC,SAAS,OAAO,GAAG,CAAC,CAAC;AACxB,EAAE;AAEF,MAAM,eAAe,CAAC,EAAE,UAAU,MAAM,QAAQ,EAAE,MAChD,oBAAC,yBAAsB,YAAY,EAAE,MAAM,GAAI,kCAAwB,UAAU,EAAE,KAAK,CAAC,GAAE;AAG7F,aAAa,YAAY;AAAA,EACvB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AACnB;AAEA,IAAO,uBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import React2, { useState } from "react";
4
+ import PropTypes from "prop-types";
5
+ import { useFocusGroupWithState } from "@elliemae/ds-shared";
6
+ import { DSButtonV2 } from "@elliemae/ds-button-v2";
7
+ import { PopperPositions as Position } from "@elliemae/ds-popper";
8
+ const ToolbarItem = ({ icon, labelText, menu = void 0, containerProps = {}, ...otherProps }) => {
9
+ const [ref, setRef] = useState(null);
10
+ useFocusGroupWithState(ref);
11
+ const btn = /* @__PURE__ */ jsx(DSButtonV2, { ...otherProps, buttonType: "icon", innerRef: (r) => setRef(r), labelText, ...containerProps, children: icon });
12
+ if (menu) {
13
+ return React2.cloneElement(menu, {
14
+ ...menu.props,
15
+ placement: Position.BOTTOM_END,
16
+ triggerComponent: btn
17
+ });
18
+ }
19
+ return btn;
20
+ };
21
+ ToolbarItem.displayName = "ToolbarItem";
22
+ ToolbarItem.propTypes = {
23
+ icon: PropTypes.element,
24
+ labelText: PropTypes.string
25
+ };
26
+ var ToolbarItem_default = ToolbarItem;
27
+ export {
28
+ ToolbarItem_default as default
29
+ };
30
+ //# sourceMappingURL=ToolbarItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ToolbarItem.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, containerProps = {}, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButtonV2 {...otherProps} buttonType=\"icon\" innerRef={(r) => setRef(r)} labelText={labelText} {...containerProps}>\n {icon}\n </DSButtonV2>\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACenB;AAXJ,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB,gBAAgB;AAE5C,MAAM,cAAc,CAAC,EAAE,MAAM,WAAW,OAAO,QAAW,iBAAiB,CAAC,GAAG,GAAG,WAAW,MAAM;AACjG,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,IAAI;AAEnC,yBAAuB,GAAG;AAC1B,QAAM,MACJ,oBAAC,cAAY,GAAG,YAAY,YAAW,QAAO,UAAU,CAAC,MAAM,OAAO,CAAC,GAAG,WAAuB,GAAG,gBACjG,gBACH;AAEF,MAAI,MAAM;AACR,WAAOA,OAAM,aAAa,MAAM;AAAA,MAC9B,GAAG,KAAK;AAAA,MACR,WAAW,SAAS;AAAA,MACpB,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEA,YAAY,cAAc;AAE1B,YAAY,YAAY;AAAA,EACtB,MAAM,UAAU;AAAA,EAChB,WAAW,UAAU;AACvB;AAEA,IAAO,sBAAQ;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import React2, { cloneElement } from "react";
3
+ var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(
4
+ children,
5
+ (component) => component ? cloneElement(component, {
6
+ ...extraProps,
7
+ ...component.props,
8
+ className: `${component.props.className} toolbar-item`
9
+ }) : component,
10
+ null
11
+ );
12
+ export {
13
+ decorateToolbarChildren_default as default
14
+ };
15
+ //# sourceMappingURL=decorateToolbarChildren.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/decorateToolbarChildren.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n (component) =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,OAAOA,UAAS,oBAAoB;AAEpC,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtCA,OAAM,SAAS;AAAA,EACb;AAAA,EACA,CAAC,cACC,YACI,aAAa,WAAW;AAAA,IACtB,GAAG;AAAA,IACH,GAAG,UAAU;AAAA,IACb,WAAW,GAAG,UAAU,MAAM;AAAA,EAChC,CAAC,IACD;AAAA,EACN;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ import { useRef, useEffect, useCallback } from "react";
3
+ const useKeyboardNavigation = ({ containerRef, autoFocusOnMount }) => {
4
+ const allChildrenButtonRef = useRef(null);
5
+ useEffect(() => {
6
+ if (containerRef.current) {
7
+ allChildrenButtonRef.current = containerRef.current.querySelectorAll("button");
8
+ }
9
+ if (autoFocusOnMount) {
10
+ setTimeout(() => allChildrenButtonRef.current?.[0].focus());
11
+ }
12
+ }, [autoFocusOnMount]);
13
+ const handleOnKeyDown = useCallback((e) => {
14
+ if (allChildrenButtonRef.current) {
15
+ const lastButton = allChildrenButtonRef.current[allChildrenButtonRef.current?.length - 1];
16
+ const firstButton = allChildrenButtonRef.current[0];
17
+ if (e.key === "ArrowRight") {
18
+ e.preventDefault();
19
+ if (e.target !== lastButton) {
20
+ e.target.nextSibling.focus();
21
+ } else {
22
+ firstButton.focus();
23
+ }
24
+ }
25
+ if (e.key === "ArrowLeft") {
26
+ e.preventDefault();
27
+ if (e.target !== firstButton) {
28
+ e.target.previousSibling.focus();
29
+ } else {
30
+ lastButton.focus();
31
+ }
32
+ }
33
+ }
34
+ }, []);
35
+ return {
36
+ handleOnKeyDown
37
+ };
38
+ };
39
+ export {
40
+ useKeyboardNavigation
41
+ };
42
+ //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useKeyboardNavigation.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport type React from 'react';\nimport { useRef, useEffect, useCallback } from 'react';\n\ninterface useKeyboardNavigationT {\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n autoFocusOnMount: boolean;\n}\n\n// Toolbar should not allow to use Tab/Shift+Tab to navigate between ToolbarItems.\n// Tab/Shift+Tab should be only used once to enter the whole controller.\n// Toolbars should be only navigable with Arrows to follow correct a11y.\n// https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html\n\nexport const useKeyboardNavigation = ({ containerRef, autoFocusOnMount }: useKeyboardNavigationT) => {\n const allChildrenButtonRef = useRef<NodeListOf<HTMLButtonElement> | null>(null);\n\n useEffect(() => {\n if (containerRef.current) {\n allChildrenButtonRef.current = containerRef.current.querySelectorAll('button');\n // allChildrenButtonRef.current.forEach((button, index) => {\n // if (index !== 0) {\n // button.setAttribute('tabindex', '-1');\n // }\n // });\n }\n\n if (autoFocusOnMount) {\n setTimeout(() => allChildrenButtonRef.current?.[0].focus());\n }\n\n // return () => {\n // allChildrenButtonRef.current?.forEach((button, index) => {\n // if (index !== 0) {\n // button.setAttribute('tabindex', '');\n // }\n // });\n // };\n }, [autoFocusOnMount]);\n\n const handleOnKeyDown = useCallback((e) => {\n if (allChildrenButtonRef.current) {\n const lastButton = allChildrenButtonRef.current[allChildrenButtonRef.current?.length - 1];\n const firstButton = allChildrenButtonRef.current[0];\n\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n if (e.target !== lastButton) {\n e.target.nextSibling.focus();\n } else {\n firstButton.focus();\n }\n }\n if (e.key === 'ArrowLeft') {\n e.preventDefault();\n if (e.target !== firstButton) {\n e.target.previousSibling.focus();\n } else {\n lastButton.focus();\n }\n }\n }\n }, []);\n\n return {\n handleOnKeyDown,\n };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,QAAQ,WAAW,mBAAmB;AAYxC,MAAM,wBAAwB,CAAC,EAAE,cAAc,iBAAiB,MAA8B;AACnG,QAAM,uBAAuB,OAA6C,IAAI;AAE9E,YAAU,MAAM;AACd,QAAI,aAAa,SAAS;AACxB,2BAAqB,UAAU,aAAa,QAAQ,iBAAiB,QAAQ;AAAA,IAM/E;AAEA,QAAI,kBAAkB;AACpB,iBAAW,MAAM,qBAAqB,UAAU,CAAC,EAAE,MAAM,CAAC;AAAA,IAC5D;AAAA,EASF,GAAG,CAAC,gBAAgB,CAAC;AAErB,QAAM,kBAAkB,YAAY,CAAC,MAAM;AACzC,QAAI,qBAAqB,SAAS;AAChC,YAAM,aAAa,qBAAqB,QAAQ,qBAAqB,SAAS,SAAS,CAAC;AACxF,YAAM,cAAc,qBAAqB,QAAQ,CAAC;AAElD,UAAI,EAAE,QAAQ,cAAc;AAC1B,UAAE,eAAe;AACjB,YAAI,EAAE,WAAW,YAAY;AAC3B,YAAE,OAAO,YAAY,MAAM;AAAA,QAC7B,OAAO;AACL,sBAAY,MAAM;AAAA,QACpB;AAAA,MACF;AACA,UAAI,EAAE,QAAQ,aAAa;AACzB,UAAE,eAAe;AACjB,YAAI,EAAE,WAAW,aAAa;AAC5B,YAAE,OAAO,gBAAgB,MAAM;AAAA,QACjC,OAAO;AACL,qBAAW,MAAM;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AAAA,IACL;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export * from "./DSToolbar.js";
3
+ import { default as default2 } from "./DSToolbar.js";
4
+ export {
5
+ default2 as default
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/export */\nexport * from './DSToolbar.js';\n\nexport { default } from './DSToolbar.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,cAAc;AAEd,SAAS,WAAAA,gBAAe;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,37 @@
1
+ import Item from './ToolbarItem.js';
2
+ import ToolbarGroup from './ToolbarGroup.js';
3
+ import Divider from './ToolbarDivider.js';
4
+ declare const DSToolbar: {
5
+ ({ containerProps, innerRef, withDepth, alignment, autoFocusOnMount, children, size, ...otherProps }: {
6
+ [x: string]: any;
7
+ containerProps?: {} | undefined;
8
+ innerRef: any;
9
+ withDepth?: boolean | undefined;
10
+ alignment?: string | undefined;
11
+ autoFocusOnMount?: boolean | undefined;
12
+ children?: never[] | undefined;
13
+ size?: string | undefined;
14
+ }): import("react/jsx-runtime.js").JSX.Element;
15
+ propTypes: {
16
+ containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
17
+ withDepth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
18
+ alignment: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
19
+ size: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
20
+ autoFocusOnMount: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
21
+ children: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
22
+ innerRef: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
23
+ };
24
+ displayName: string;
25
+ };
26
+ declare const ToolbarWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<{
27
+ [x: string]: any;
28
+ containerProps?: {} | undefined;
29
+ innerRef: any;
30
+ withDepth?: boolean | undefined;
31
+ alignment?: string | undefined;
32
+ autoFocusOnMount?: boolean | undefined;
33
+ children?: never[] | undefined;
34
+ size?: string | undefined;
35
+ }>;
36
+ export { DSToolbar, Item as ToolbarItem, ToolbarGroup, Divider as ToolbarDivider, ToolbarWithSchema };
37
+ export default DSToolbar;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ToolbarDivider: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
3
+ export default ToolbarDivider;
@@ -0,0 +1,14 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const ToolbarGroup: {
3
+ ({ children, size, space }: {
4
+ children: any;
5
+ size: any;
6
+ space?: number | undefined;
7
+ }): import("react/jsx-runtime.js").JSX.Element;
8
+ propTypes: {
9
+ children: PropTypes.Requireable<any>;
10
+ size: PropTypes.Requireable<number>;
11
+ space: PropTypes.Requireable<number>;
12
+ };
13
+ };
14
+ export default ToolbarGroup;
@@ -0,0 +1,16 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const ToolbarItem: {
3
+ ({ icon, labelText, menu, containerProps, ...otherProps }: {
4
+ [x: string]: any;
5
+ icon: any;
6
+ labelText: any;
7
+ menu?: undefined;
8
+ containerProps?: {} | undefined;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ propTypes: {
12
+ icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
13
+ labelText: PropTypes.Requireable<string>;
14
+ };
15
+ };
16
+ export default ToolbarItem;
@@ -0,0 +1,2 @@
1
+ declare const _default: (children: any, extraProps?: {}) => any;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type React from 'react';
2
+ interface useKeyboardNavigationT {
3
+ containerRef: React.MutableRefObject<HTMLDivElement | null>;
4
+ autoFocusOnMount: boolean;
5
+ }
6
+ export declare const useKeyboardNavigation: ({ containerRef, autoFocusOnMount }: useKeyboardNavigationT) => {
7
+ handleOnKeyDown: (e: any) => void;
8
+ };
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './DSToolbar.js';
2
+ export { default } from './DSToolbar.js';
package/package.json ADDED
@@ -0,0 +1,127 @@
1
+ {
2
+ "name": "@elliemae/ds-toolbar-v1",
3
+ "version": "3.22.0-next.24",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Toolbar",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ },
17
+ "./useToolbarItemHandlers": {
18
+ "import": "./dist/esm/useToolbarItemHandlers.js",
19
+ "require": "./dist/cjs/useToolbarItemHandlers.js"
20
+ },
21
+ "./styled": {
22
+ "import": "./dist/esm/styled.js",
23
+ "require": "./dist/cjs/styled.js"
24
+ },
25
+ "./props": {
26
+ "import": "./dist/esm/props.js",
27
+ "require": "./dist/cjs/props.js"
28
+ },
29
+ "./DSToolbarV2Context": {
30
+ "import": "./dist/esm/DSToolbarV2Context.js",
31
+ "require": "./dist/cjs/DSToolbarV2Context.js"
32
+ },
33
+ "./DSToolbarV2": {
34
+ "import": "./dist/esm/DSToolbarV2.js",
35
+ "require": "./dist/cjs/DSToolbarV2.js"
36
+ },
37
+ "./DSToolbarSeparatorV2": {
38
+ "import": "./dist/esm/DSToolbarSeparatorV2.js",
39
+ "require": "./dist/cjs/DSToolbarSeparatorV2.js"
40
+ },
41
+ "./DSToolbarItemV2": {
42
+ "import": "./dist/esm/DSToolbarItemV2.js",
43
+ "require": "./dist/cjs/DSToolbarItemV2.js"
44
+ },
45
+ "./deprecated/ToolbarItem": {
46
+ "import": "./dist/esm/deprecated/ToolbarItem.js",
47
+ "require": "./dist/cjs/deprecated/ToolbarItem.js"
48
+ },
49
+ "./deprecated/ToolbarGroup": {
50
+ "import": "./dist/esm/deprecated/ToolbarGroup.js",
51
+ "require": "./dist/cjs/deprecated/ToolbarGroup.js"
52
+ },
53
+ "./deprecated/ToolbarDivider": {
54
+ "import": "./dist/esm/deprecated/ToolbarDivider.js",
55
+ "require": "./dist/cjs/deprecated/ToolbarDivider.js"
56
+ },
57
+ "./deprecated": {
58
+ "import": "./dist/esm/deprecated/index.js",
59
+ "require": "./dist/cjs/deprecated/index.js"
60
+ },
61
+ "./deprecated/DSToolbar": {
62
+ "import": "./dist/esm/deprecated/DSToolbar.js",
63
+ "require": "./dist/cjs/deprecated/DSToolbar.js"
64
+ },
65
+ "./deprecated/decorateToolbarChildren": {
66
+ "import": "./dist/esm/deprecated/decorateToolbarChildren.js",
67
+ "require": "./dist/cjs/deprecated/decorateToolbarChildren.js"
68
+ }
69
+ },
70
+ "sideEffects": [
71
+ "*.css",
72
+ "*.scss"
73
+ ],
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
77
+ },
78
+ "engines": {
79
+ "pnpm": ">=6",
80
+ "node": ">=16"
81
+ },
82
+ "author": "ICE MT",
83
+ "jestSonar": {
84
+ "sonar56x": true,
85
+ "reportPath": "reports",
86
+ "reportFile": "tests.xml",
87
+ "indent": 4
88
+ },
89
+ "dependencies": {
90
+ "prop-types": "~15.8.1",
91
+ "@elliemae/ds-button-v2": "3.22.0-next.24",
92
+ "@elliemae/ds-classnames": "3.22.0-next.24",
93
+ "@elliemae/ds-popper": "3.22.0-next.24",
94
+ "@elliemae/ds-props-helpers": "3.22.0-next.24",
95
+ "@elliemae/ds-shared": "3.22.0-next.24",
96
+ "@elliemae/ds-utilities": "3.22.0-next.24"
97
+ },
98
+ "devDependencies": {
99
+ "@elliemae/pui-cli": "~9.0.0-next.22",
100
+ "@testing-library/jest-dom": "~5.16.5",
101
+ "@testing-library/react": "~12.1.3",
102
+ "@testing-library/user-event": "~13.5.0",
103
+ "styled-components": "~5.3.9",
104
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.24"
105
+ },
106
+ "peerDependencies": {
107
+ "lodash": "^4.17.21",
108
+ "react": "^17.0.2",
109
+ "react-dom": "^17.0.2",
110
+ "styled-components": "~5.3.9"
111
+ },
112
+ "publishConfig": {
113
+ "access": "public",
114
+ "typeSafety": false
115
+ },
116
+ "scripts": {
117
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
118
+ "test": "pui-cli test --passWithNoTests",
119
+ "lint": "node ../../scripts/lint.mjs",
120
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
121
+ "dts": "node ../../scripts/dts.mjs",
122
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
123
+ "dev:build": "pnpm --filter {.}... build",
124
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
125
+ "checkDeps": "npm exec ../ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
126
+ }
127
+ }