@elliemae/ds-toolbar 3.3.0-next.4 → 3.3.0-next.7

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.
@@ -3,34 +3,8 @@ var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
6
  var __getProtoOf = Object.getPrototypeOf;
8
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __spreadValues = (a, b) => {
12
- for (var prop in b || (b = {}))
13
- if (__hasOwnProp.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- if (__getOwnPropSymbols)
16
- for (var prop of __getOwnPropSymbols(b)) {
17
- if (__propIsEnum.call(b, prop))
18
- __defNormalProp(a, prop, b[prop]);
19
- }
20
- return a;
21
- };
22
- var __objRest = (source, exclude) => {
23
- var target = {};
24
- for (var prop in source)
25
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
- target[prop] = source[prop];
27
- if (source != null && __getOwnPropSymbols)
28
- for (var prop of __getOwnPropSymbols(source)) {
29
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
- target[prop] = source[prop];
31
- }
32
- return target;
33
- };
34
8
  var __export = (target, all) => {
35
9
  for (var name in all)
36
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -63,7 +37,7 @@ const DSToolbarItemV2 = (props) => {
63
37
  const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultItemProps);
64
38
  (0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_react_desc_prop_types.DSToolbarItemV2Schema);
65
39
  const { render, isFirstItem } = propsWithDefaults;
66
- const _a = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults), { id } = _a, restGlobals = __objRest(_a, ["id"]);
40
+ const { id, ...restGlobals } = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults);
67
41
  const { registerReference, activeItem } = (0, import_react.useContext)(import_DSToolbarV2Context.DSToolbarV2Context);
68
42
  const ref = (0, import_react.useRef)(null);
69
43
  const toolbarItemId = (0, import_react.useMemo)(() => {
@@ -73,11 +47,13 @@ const DSToolbarItemV2 = (props) => {
73
47
  }, [registerReference, ref]);
74
48
  const tabIndex = (0, import_react.useMemo)(() => activeItem === toolbarItemId || !activeItem && isFirstItem ? 0 : -1, [activeItem, isFirstItem, toolbarItemId]);
75
49
  const handlers = (0, import_useToolbarItemHandlers.useToolbarItemHandlers)(toolbarItemId);
76
- return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarItem, __spreadValues(__spreadValues({
50
+ return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarItem, {
77
51
  id: toolbarItemId,
78
52
  "data-testid": "ds-toolbar-item",
79
- className: "ds-toolbar-item"
80
- }, handlers), restGlobals), render({ innerRef: ref, tabIndex }));
53
+ className: "ds-toolbar-item",
54
+ ...handlers,
55
+ ...restGlobals
56
+ }, render({ innerRef: ref, tabIndex }));
81
57
  };
82
58
  DSToolbarItemV2.propTypes = import_react_desc_prop_types.DSToolbarItemV2Schema;
83
59
  DSToolbarItemV2.displayName = "DSToolbarItemV2";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSToolbarItemV2.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types';\nimport type { DSToolbarItemT } from './react-desc-prop-types';\nconst DSToolbarItemV2: React.ComponentType<DSToolbarItemT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultItemProps);\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema);\n const { render, isFirstItem } = propsWithDefaults;\n const { id, ...restGlobals } = useGetGlobalAttributes(propsWithDefaults);\n const { registerReference, activeItem } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const tabIndex = useMemo(\n () => (activeItem === toolbarItemId || (!activeItem && isFirstItem) ? 0 : -1),\n [activeItem, isFirstItem, toolbarItemId],\n );\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n return (\n <StyledToolbarItem\n id={toolbarItemId}\n data-testid=\"ds-toolbar-item\"\n className=\"ds-toolbar-item\"\n {...handlers}\n {...restGlobals}\n >\n {render({ innerRef: ref, tabIndex })}\n </StyledToolbarItem>\n );\n};\n\nDSToolbarItemV2.propTypes = DSToolbarItemV2Schema;\n\nDSToolbarItemV2.displayName = 'DSToolbarItemV2';\nconst DSToolbarItemV2WithSchema = describe(DSToolbarItemV2).description('Toolbar Item');\nDSToolbarItemV2WithSchema.propTypes = DSToolbarItemV2Schema;\n\nexport { DSToolbarItemV2, DSToolbarItemV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAmD;AACnD,0BAKO;AACP,iBAAoB;AACpB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,QAAM,EAAE,OAAO,gBAAgB,gDAAuB,iBAAiB;AACvE,QAAM,EAAE,mBAAmB,eAAe,6BAAW,4CAAkB;AACvE,QAAM,MAAM,yBAAO,IAAI;AACvB,QAAM,gBAAgB,0BAAQ,MAAM;AAClC,UAAM,MAAK,mBAAmB,oBAAI;AAClC,sBAAkB,KAAI,GAAG;AACzB,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,GAAG,CAAC;AAE3B,QAAM,WAAW,0BACf,MAAO,eAAe,iBAAkB,CAAC,cAAc,cAAe,IAAI,IAC1E,CAAC,YAAY,aAAa,aAAa,CACzC;AAEA,QAAM,WAAW,0DAAuB,aAAa;AACrD,SACE,mDAAC;AAAA,IACC,IAAI;AAAA,IACJ,eAAY;AAAA,IACZ,WAAU;AAAA,IACT,GAAG;AAAA,IACH,GAAG;AAAA,KAEH,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CACrC;AAEJ;AAEA,gBAAgB,YAAY;AAE5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,kCAAS,eAAe,EAAE,YAAY,cAAc;AACtF,0BAA0B,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -59,12 +42,12 @@ const DSToolbarV2 = (props) => {
59
42
  const [itemReferences, setItemReferences] = (0, import_react.useState)({});
60
43
  const [activeItem, setActiveItem] = (0, import_react.useState)("");
61
44
  const registerReference = (0, import_react.useCallback)((itemId, ref) => {
62
- setItemReferences((prevItemReferences) => __spreadProps(__spreadValues({}, prevItemReferences), { [itemId]: ref }));
45
+ setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));
63
46
  }, [setItemReferences]);
64
47
  const ctx = (0, import_react.useMemo)(() => ({ toolbarUid, registerReference, itemReferences, activeItem, setActiveItem }), [activeItem, itemReferences, registerReference, toolbarUid]);
65
48
  return /* @__PURE__ */ import_react.default.createElement(import_DSToolbarV2Context.DSToolbarV2Context.Provider, {
66
49
  value: ctx
67
- }, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarWrapper, __spreadValues({
50
+ }, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarWrapper, {
68
51
  role: "toolbar",
69
52
  "data-testid": "ds-toolbar-wrapper",
70
53
  id: toolbarUid,
@@ -73,8 +56,9 @@ const DSToolbarV2 = (props) => {
73
56
  withDepth,
74
57
  gutter: "xxs2",
75
58
  compact,
76
- ref: innerRef
77
- }, globalsProps), children));
59
+ ref: innerRef,
60
+ ...globalsProps
61
+ }, children));
78
62
  };
79
63
  DSToolbarV2.propTypes = import_react_desc_prop_types.DSToolbarV2Schema;
80
64
  DSToolbarV2.displayName = "DSToolbarV2";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSToolbarV2.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema, defaultProps } from './react-desc-prop-types';\nimport { StyledToolbarWrapper } from './styled';\nimport type { DSToolbarT, DSToolbarItemT } from './react-desc-prop-types';\n\nconst DSToolbarV2: React.ComponentType<DSToolbarT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarV2Schema);\n\n const { alignment, withDepth, compact, innerRef, children } = propsWithDefaults;\n\n const globalsProps = useGetGlobalAttributes(propsWithDefaults);\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n const [activeItem, setActiveItem] = useState('');\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<DSToolbarItemT.RenderHTMLElementT>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n const ctx = useMemo(\n () => ({ toolbarUid, registerReference, itemReferences, activeItem, setActiveItem }),\n [activeItem, itemReferences, registerReference, toolbarUid],\n );\n\n return (\n <DSToolbarV2Context.Provider value={ctx}>\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 gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n {...globalsProps}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\n\nDSToolbarV2.displayName = 'DSToolbarV2';\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAsD;AACtD,0BAIO;AACP,2BAAyB;AACzB,iBAAoB;AACpB,gCAAmC;AACnC,mCAAgD;AAChD,oBAAqC;AAGrC,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM,oBAAoB,sDAA6B,OAAO,yCAAY;AAE1E,0DAA+B,mBAAmB,8CAAiB;AAEnE,QAAM,EAAE,WAAW,WAAW,SAAS,UAAU,aAAa;AAE9D,QAAM,eAAe,gDAAuB,iBAAiB;AAE7D,QAAM,aAAa,0BAAQ,MAAM,cAAc,oBAAI,KAAK,CAAC,CAAC;AAE1D,QAAM,CAAC,gBAAgB,qBAAqB,2BAAS,CAAC,CAAC;AACvD,QAAM,CAAC,YAAY,iBAAiB,2BAAS,EAAE;AAE/C,QAAM,oBAAoB,8BACxB,CAAC,QAAgB,QAAmE;AAClF,sBAAkB,CAAC,uBAAwB,iCAAK,qBAAL,EAAyB,CAAC,SAAS,IAAI,EAAE;AAAA,EACtF,GACA,CAAC,iBAAiB,CACpB;AAEA,QAAM,MAAM,0BACV,MAAO,GAAE,YAAY,mBAAmB,gBAAgB,YAAY,cAAc,IAClF,CAAC,YAAY,gBAAgB,mBAAmB,UAAU,CAC5D;AAEA,SACE,mDAAC,6CAAmB,UAAnB;AAAA,IAA4B,OAAO;AAAA,KAClC,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,IAAI;AAAA,IACJ,YAAW;AAAA,IACX,gB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AA,IACtD;AAAA,IACA,QAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,IACJ,GAAG;AAAA,KAEH,QACH,CACF;AAEJ;AAEA,YAAY,YAAY;AAExB,YAAY,cAAc;AAC1B,MAAM,wBAAwB,mCAAS,WAAW,EAAE,YAAY,SAAS;AACzE,sBAAsB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,39 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
8
  var __export = (target, all) => {
38
9
  for (var name in all)
39
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -73,31 +44,25 @@ const ToolbarContainer = (0, import_ds_classnames.aggregatedClasses)("div")(bloc
73
44
  [alignment]: !!alignment,
74
45
  [size]: size
75
46
  }));
76
- const DSToolbar = (_a) => {
77
- var _b = _a, {
78
- containerProps = {},
79
- innerRef,
80
- withDepth = true,
81
- alignment = "right",
82
- autoFocusOnMount = true,
83
- children = [],
84
- size = "normal"
85
- } = _b, otherProps = __objRest(_b, [
86
- "containerProps",
87
- "innerRef",
88
- "withDepth",
89
- "alignment",
90
- "autoFocusOnMount",
91
- "children",
92
- "size"
93
- ]);
47
+ const DSToolbar = ({
48
+ containerProps = {},
49
+ innerRef,
50
+ withDepth = true,
51
+ alignment = "right",
52
+ autoFocusOnMount = true,
53
+ children = [],
54
+ size = "normal",
55
+ ...otherProps
56
+ }) => {
94
57
  const containerRef = (0, import_react.useRef)(null);
95
58
  const { handleOnKeyDown } = (0, import_useKeyboardNavigation.useKeyboardNavigation)({ containerRef, autoFocusOnMount });
96
- return /* @__PURE__ */ import_react.default.createElement(ToolbarContainer, __spreadProps(__spreadValues(__spreadValues({}, containerProps), otherProps), {
59
+ return /* @__PURE__ */ import_react.default.createElement(ToolbarContainer, {
60
+ ...containerProps,
61
+ ...otherProps,
97
62
  classProps: { withDepth, alignment, size },
98
63
  innerRef: (0, import_ds_utilities.mergeRefs)(innerRef, containerRef),
99
64
  onKeyDown: handleOnKeyDown
100
- }), (0, import_decorateToolbarChildren.default)(children));
65
+ }, (0, import_decorateToolbarChildren.default)(children));
101
66
  };
102
67
  const toolbarProps = {
103
68
  containerProps: import_ds_utilities.PropTypes.object.description("Set of Properties attached to the main container"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/deprecated/DSToolbar.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useRef } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { describe, PropTypes, mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\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 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAC9B,2BAAkC;AAClC,0BAA+C;AAC/C,qCAAoC;AACpC,yBAAiB;AACjB,0BAAyB;AACzB,4BAAoB;AACpB,mCAAsC;AAEtC,MAAM,YAAY;AAElB,MAAM,mBAAmB,4CAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACtG,iBAAiB,CAAC;AAAA,EAClB,CAAC,YAAY,CAAC,CAAC;AAAA,EACf,CAAC,OAAO;AACV,EAAE;AAEF,MAAM,YAAY,CAAC,OASb;AATa,eACjB;AAAA,qBAAiB,CAAC;AAAA,IAClB;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,WAAW,CAAC;AAAA,IACZ,OAAO;AAAA,MAPU,IAQd,uBARc,IAQd;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,yBAA8B,IAAI;AAEvD,QAAM,EAAE,oBAAoB,wDAAsB,EAAE,cAAc,iBAAiB,CAAC;AAEpF,SACE,mDAAC,kEACK,iBACA,aAFL;AAAA,IAGC,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,IACzC,UAAU,mCAAU,UAAU,YAAY;AAAA,IAC1C,WAAW;AAAA,MAEV,4CAAwB,QAAQ,CACnC;AAEJ;AAEA,MAAM,eAAe;AAAA,EACnB,gBAAgB,8BAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,8BAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,IAAI;AAAA,EAC1F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ACE,mDAAC;AAAA,IACE,GAAG;AAAA,IACH,GAAG;AAAA,IACJ,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,IACzC,UAAU,mCAAU,UAAU,YAAY;AAAA,IAC1C,WAAW;AAAA,KAEV,4CAAwB,QAAQ,CACnC;AAEJ;AAEA,MAAM,eAAe;AAAA,EACnB,gBAAgB,8BAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,8BAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,IAAI;AAAA,EAC1F,WAAW,8BAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,yCAAyC,EACrD,aAAa,OAAO;AAAA,EACvB,MAAM,8BAAU,MAAM,CAAC,UAAU,SAAS,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,QAAQ;AAAA,EAC9F,kBAAkB,8BAAU,KACzB,YAAY,qDAAqD,EACjE,aAAa,IAAI;AAAA,EACpB,UAAU,8BAAU,UAAU,CAAC,8BAAU,OAAO,8BAAU,MAAM,8BAAU,IAAI,CAAC,EAAE,YAAY,eAAe,EACzG;AAAA,EACH,UAAU,8BAAU,OAAO,YAAY,sCAAsC;AAC/E;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,kCAAS,SAAS;AAC5C,kBAAkB,YAAY;AAI9B,IAAO,oBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,39 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
8
  var __export = (target, all) => {
38
9
  for (var name in all)
39
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -59,20 +30,22 @@ var import_prop_types = __toESM(require("prop-types"));
59
30
  var import_ds_shared = require("@elliemae/ds-shared");
60
31
  var import_ds_button = require("@elliemae/ds-button");
61
32
  var import_ds_popper = require("@elliemae/ds-popper");
62
- const ToolbarItem = (_a) => {
63
- var _b = _a, { icon, labelText, menu = void 0, containerProps = {} } = _b, otherProps = __objRest(_b, ["icon", "labelText", "menu", "containerProps"]);
33
+ const ToolbarItem = ({ icon, labelText, menu = void 0, containerProps = {}, ...otherProps }) => {
64
34
  const [ref, setRef] = (0, import_react.useState)(null);
65
35
  (0, import_ds_shared.useFocusGroupWithState)(ref);
66
- const btn = /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButtonV2, __spreadValues(__spreadProps(__spreadValues({}, otherProps), {
36
+ const btn = /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButtonV2, {
37
+ ...otherProps,
67
38
  buttonType: "icon",
68
39
  innerRef: (r) => setRef(r),
69
- labelText
70
- }), containerProps), icon);
40
+ labelText,
41
+ ...containerProps
42
+ }, icon);
71
43
  if (menu) {
72
- return import_react.default.cloneElement(menu, __spreadProps(__spreadValues({}, menu.props), {
44
+ return import_react.default.cloneElement(menu, {
45
+ ...menu.props,
73
46
  placement: import_ds_popper.PopperPositions.BOTTOM_END,
74
47
  triggerComponent: btn
75
- }));
48
+ });
76
49
  }
77
50
  return btn;
78
51
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/deprecated/ToolbarItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared';\nimport { DSButtonV2 } from '@elliemae/ds-button';\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;ADAvB,mBAAgC;AAChC,wBAAsB;AACtB,uBAAuC;AACvC,uBAA2B;AAC3B,uBAA4C;AAE5C,MAAM,cAAc,CAAC,OAA8E;AAA9E,eAAE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;AAAA,EACtB,MAAM,0BAAU;AAAA,EAChB,WAAW,0BAAU;AACvB;AAEA,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -43,7 +26,9 @@ __export(decorateToolbarChildren_exports, {
43
26
  module.exports = __toCommonJS(decorateToolbarChildren_exports);
44
27
  var React = __toESM(require("react"));
45
28
  var import_react = __toESM(require("react"));
46
- var decorateToolbarChildren_default = (children, extraProps = {}) => import_react.default.Children.map(children, (component) => component ? (0, import_react.cloneElement)(component, __spreadProps(__spreadValues(__spreadValues({}, extraProps), component.props), {
29
+ var decorateToolbarChildren_default = (children, extraProps = {}) => import_react.default.Children.map(children, (component) => component ? (0, import_react.cloneElement)(component, {
30
+ ...extraProps,
31
+ ...component.props,
47
32
  className: `${component.props.className} toolbar-item`
48
- })) : component, null);
33
+ }) : component, null);
49
34
  //# sourceMappingURL=decorateToolbarChildren.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/deprecated/decorateToolbarChildren.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import 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;ADAvB,mBAAoC;AAEpC,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtC,qBAAM,SAAS,IACb,UACA,eACE,YACI,+BAAa,WAAW,gDACnB,aACA,UAAU,QAFS;AAAA,EAGtB,WAAW,GAAG,UAAU,MAAM;AAChC,EAAC,IACD,WACN,IACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAEpC,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtC,qBAAM,SAAS,IACb,UACA,eACE,YACI,+BAAa,WAAW;AAAA,EACtB,GAAG;AAAA,EACH,GAAG,UAAU;AAAA,EACb,WAAW,GAAG,UAAU,MAAM;AAChC,CAAC,IACD,WACN,IACF;",
6
6
  "names": []
7
7
  }
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -56,15 +39,17 @@ const defaultProps = {
56
39
  withDepth: true,
57
40
  compact: false
58
41
  };
59
- const DSToolbarV2Schema = __spreadProps(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), {
42
+ const DSToolbarV2Schema = {
43
+ ...import_ds_utilities.globalAttributesPropTypes,
60
44
  alignment: import_ds_utilities.PropTypes.oneOf(["right", "left"]).description("Whether to align the content left or right").defaultValue("right"),
61
45
  withDepth: import_ds_utilities.PropTypes.bool.description("Whether to add a box-shadow to the container").defaultValue(true),
62
46
  compact: import_ds_utilities.PropTypes.bool.description("Whether you want the compact version of the toolbar").defaultValue(false),
63
47
  innerRef: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.func, import_ds_utilities.PropTypes.object]).description("Reference to attach to the wrapper")
64
- });
65
- const DSToolbarItemV2Schema = __spreadProps(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), {
48
+ };
49
+ const DSToolbarItemV2Schema = {
50
+ ...import_ds_utilities.globalAttributesPropTypes,
66
51
  render: import_ds_utilities.PropTypes.func.isRequired.description("render function").defaultValue(() => {
67
52
  }),
68
53
  isFirstItem: import_ds_utilities.PropTypes.bool.description("If true the item will have tab index 0 to be the first element focusable by keyboard on the page load").defaultValue(false)
69
- });
54
+ };
70
55
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSToolbarT {\n export interface Props {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children: React.Component<DSToolbarItemT.Props>;\n }\n}\n\nexport declare namespace DSToolbarItemT {\n export type RenderHTMLElementT =\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement;\n export interface Props {\n render: (props: { innerRef: React.MutableRefObject<HTMLElement>; tabIndex: number }) => JSX.Element;\n isFirstItem?: boolean;\n }\n}\n\nexport const defaultItemProps = {\n render: () => {},\n isFirstItem: false,\n};\n\nexport const defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\n\nexport const DSToolbarV2Schema = {\n ...globalAttributesPropTypes,\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n\nexport const DSToolbarItemV2Schema = {\n ...globalAttributesPropTypes,\n render: PropTypes.func.isRequired.description('render function').defaultValue(() => {}),\n isFirstItem: PropTypes.bool\n .description(\n 'If true the item will have tab index 0 to be the first element focusable by keyboard on the page load',\n )\n .defaultValue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S,MAAM,CAAC,EACzC,YAAY,4CAA4C,EACxD,aAAa,OAAO;AAAA,EACvB,WAAW,8BAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,IAAI;AAAA,EACvG,SAAS,8BAAU,KAAK,YAAY,qDAAqD,EAAE,aAAa,KAAK;AAAA,EAC7G,UAAU,8BAAU,UAAU,CAAC,8BAAU,MAAM,8BAAU,MAAM,CAAC,EAAE,YAAY,oCAAoC;AACpH;AAEO,MAAM,wBAAwB;AAAA,EACnC,GAAG;AAAA,EACH,QAAQ,8BAAU,KAAK,WAAW,YAAY,iBAAiB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACtF,aAAa,8BAAU,KACpB,YACC,uGACF,EACC,aAAa,KAAK;AACvB;",
6
6
  "names": []
7
7
  }
@@ -1,32 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __spreadValues = (a, b) => {
8
- for (var prop in b || (b = {}))
9
- if (__hasOwnProp.call(b, prop))
10
- __defNormalProp(a, prop, b[prop]);
11
- if (__getOwnPropSymbols)
12
- for (var prop of __getOwnPropSymbols(b)) {
13
- if (__propIsEnum.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- }
16
- return a;
17
- };
18
- var __objRest = (source, exclude) => {
19
- var target = {};
20
- for (var prop in source)
21
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
22
- target[prop] = source[prop];
23
- if (source != null && __getOwnPropSymbols)
24
- for (var prop of __getOwnPropSymbols(source)) {
25
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
26
- target[prop] = source[prop];
27
- }
28
- return target;
29
- };
30
2
  import * as React from "react";
31
3
  import React2, { useContext, useMemo, useRef } from "react";
32
4
  import {
@@ -44,7 +16,7 @@ const DSToolbarItemV2 = (props) => {
44
16
  const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultItemProps);
45
17
  useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema);
46
18
  const { render, isFirstItem } = propsWithDefaults;
47
- const _a = useGetGlobalAttributes(propsWithDefaults), { id } = _a, restGlobals = __objRest(_a, ["id"]);
19
+ const { id, ...restGlobals } = useGetGlobalAttributes(propsWithDefaults);
48
20
  const { registerReference, activeItem } = useContext(DSToolbarV2Context);
49
21
  const ref = useRef(null);
50
22
  const toolbarItemId = useMemo(() => {
@@ -54,11 +26,13 @@ const DSToolbarItemV2 = (props) => {
54
26
  }, [registerReference, ref]);
55
27
  const tabIndex = useMemo(() => activeItem === toolbarItemId || !activeItem && isFirstItem ? 0 : -1, [activeItem, isFirstItem, toolbarItemId]);
56
28
  const handlers = useToolbarItemHandlers(toolbarItemId);
57
- return /* @__PURE__ */ React2.createElement(StyledToolbarItem, __spreadValues(__spreadValues({
29
+ return /* @__PURE__ */ React2.createElement(StyledToolbarItem, {
58
30
  id: toolbarItemId,
59
31
  "data-testid": "ds-toolbar-item",
60
- className: "ds-toolbar-item"
61
- }, handlers), restGlobals), render({ innerRef: ref, tabIndex }));
32
+ className: "ds-toolbar-item",
33
+ ...handlers,
34
+ ...restGlobals
35
+ }, render({ innerRef: ref, tabIndex }));
62
36
  };
63
37
  DSToolbarItemV2.propTypes = DSToolbarItemV2Schema;
64
38
  DSToolbarItemV2.displayName = "DSToolbarItemV2";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarItemV2.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types';\nimport type { DSToolbarItemT } from './react-desc-prop-types';\nconst DSToolbarItemV2: React.ComponentType<DSToolbarItemT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultItemProps);\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema);\n const { render, isFirstItem } = propsWithDefaults;\n const { id, ...restGlobals } = useGetGlobalAttributes(propsWithDefaults);\n const { registerReference, activeItem } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const tabIndex = useMemo(\n () => (activeItem === toolbarItemId || (!activeItem && isFirstItem) ? 0 : -1),\n [activeItem, isFirstItem, toolbarItemId],\n );\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n return (\n <StyledToolbarItem\n id={toolbarItemId}\n data-testid=\"ds-toolbar-item\"\n className=\"ds-toolbar-item\"\n {...handlers}\n {...restGlobals}\n >\n {render({ innerRef: ref, tabIndex })}\n </StyledToolbarItem>\n );\n};\n\nDSToolbarItemV2.propTypes = DSToolbarItemV2Schema;\n\nDSToolbarItemV2.displayName = 'DSToolbarItemV2';\nconst DSToolbarItemV2WithSchema = describe(DSToolbarItemV2).description('Toolbar Item');\nDSToolbarItemV2WithSchema.propTypes = DSToolbarItemV2Schema;\n\nexport { DSToolbarItemV2, DSToolbarItemV2WithSchema };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAEA,M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AAK,mBAAmB,IAAI;AAClC,sBAAkB,KAAI,GAAG;AACzB,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,GAAG,CAAC;AAE3B,QAAM,WAAW,QACf,MAAO,eAAe,iBAAkB,CAAC,cAAc,cAAe,IAAI,IAC1E,CAAC,YAAY,aAAa,aAAa,CACzC;AAEA,QAAM,WAAW,uBAAuB,aAAa;AACrD,SACE,qCAAC;AAAA,IACC,IAAI;AAAA,IACJ,eAAY;AAAA,IACZ,WAAU;AAAA,IACT,GAAG;AAAA,IACH,GAAG;AAAA,KAEH,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CACrC;AAEJ;AAEA,gBAAgB,YAAY;AAE5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,SAAS,eAAe,EAAE,YAAY,cAAc;AACtF,0BAA0B,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
2
  import * as React from "react";
22
3
  import React2, { useCallback, useMemo, useState } from "react";
23
4
  import {
@@ -39,12 +20,12 @@ const DSToolbarV2 = (props) => {
39
20
  const [itemReferences, setItemReferences] = useState({});
40
21
  const [activeItem, setActiveItem] = useState("");
41
22
  const registerReference = useCallback((itemId, ref) => {
42
- setItemReferences((prevItemReferences) => __spreadProps(__spreadValues({}, prevItemReferences), { [itemId]: ref }));
23
+ setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));
43
24
  }, [setItemReferences]);
44
25
  const ctx = useMemo(() => ({ toolbarUid, registerReference, itemReferences, activeItem, setActiveItem }), [activeItem, itemReferences, registerReference, toolbarUid]);
45
26
  return /* @__PURE__ */ React2.createElement(DSToolbarV2Context.Provider, {
46
27
  value: ctx
47
- }, /* @__PURE__ */ React2.createElement(StyledToolbarWrapper, __spreadValues({
28
+ }, /* @__PURE__ */ React2.createElement(StyledToolbarWrapper, {
48
29
  role: "toolbar",
49
30
  "data-testid": "ds-toolbar-wrapper",
50
31
  id: toolbarUid,
@@ -53,8 +34,9 @@ const DSToolbarV2 = (props) => {
53
34
  withDepth,
54
35
  gutter: "xxs2",
55
36
  compact,
56
- ref: innerRef
57
- }, globalsProps), children));
37
+ ref: innerRef,
38
+ ...globalsProps
39
+ }, children));
58
40
  };
59
41
  DSToolbarV2.propTypes = DSToolbarV2Schema;
60
42
  DSToolbarV2.displayName = "DSToolbarV2";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarV2.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema, defaultProps } from './react-desc-prop-types';\nimport { StyledToolbarWrapper } from './styled';\nimport type { DSToolbarT, DSToolbarItemT } from './react-desc-prop-types';\n\nconst DSToolbarV2: React.ComponentType<DSToolbarT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarV2Schema);\n\n const { alignment, withDepth, compact, innerRef, children } = propsWithDefaults;\n\n const globalsProps = useGetGlobalAttributes(propsWithDefaults);\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n const [activeItem, setActiveItem] = useState('');\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<DSToolbarItemT.RenderHTMLElementT>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n const ctx = useMemo(\n () => ({ toolbarUid, registerReference, itemReferences, activeItem, setActiveItem }),\n [activeItem, itemReferences, registerReference, toolbarUid],\n );\n\n return (\n <DSToolbarV2Context.Provider value={ctx}>\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 gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n {...globalsProps}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\n\nDSToolbarV2.displayName = 'DSToolbarV2';\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AACA;AACA;AACA;AAGA,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM,oBAAoB,6BAA6B,OAAO,YAAY;AAE1E,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cAAc,IAAI,KAAK,CAAC,CAAC;AAE1D,QAAM,CAAC,gBAAgB,qBAAqB,SAAS,CAAC,CAAC;AACvD,QAAM,CAAC,YAAY,iBAAiB,SAAS,EAAE;AAE/C,QAAM,oBAAoB,YACxB,CAAC,QAAgB,QAAmE;AAClF,sBAAkB,CAAC,uBAAwB,GAAE,GAAG,oBAAoB,CAAC,SAAS,IAAI,EAAE;AAAA,EACtF,GACA,CAAC,iBAAiB,CACpB;AAEA,QAAM,MAAM,QACV,MAAO,GAAE,YAAY,mBAAmB,gBAAgB,YAAY,cAAc,IAClF,CAAC,YAAY,gBAAgB,mBAAmB,UAAU,CAC5D;AAEA,SACE,qCAAC,mBAAmB,UAAnB;AAAA,IAA4B,OAAO;AAAA,KAClC,qCAAC;AAAA,IACC,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,IAAI;AAAA,IACJ,YAAW;AAAA,IACX,gBAAgB,cAAc,SAAS,eAAe;AAAA,IACtD;AAAA,IACA,QAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,IACJ,GAAG;AAAA,KAEH,QACH,CACF;AAEJ;AAEA,YAAY,YAAY;AAExB,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW,EAAE,YAAY,SAAS;AACzE,sBAAsB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,35 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
2
  import * as React from "react";
34
3
  import React2, { useRef } from "react";
35
4
  import { aggregatedClasses } from "@elliemae/ds-classnames";
@@ -45,31 +14,25 @@ const ToolbarContainer = aggregatedClasses("div")(blockName, null, ({ withDepth,
45
14
  [alignment]: !!alignment,
46
15
  [size]: size
47
16
  }));
48
- const DSToolbar = (_a) => {
49
- var _b = _a, {
50
- containerProps = {},
51
- innerRef,
52
- withDepth = true,
53
- alignment = "right",
54
- autoFocusOnMount = true,
55
- children = [],
56
- size = "normal"
57
- } = _b, otherProps = __objRest(_b, [
58
- "containerProps",
59
- "innerRef",
60
- "withDepth",
61
- "alignment",
62
- "autoFocusOnMount",
63
- "children",
64
- "size"
65
- ]);
17
+ const DSToolbar = ({
18
+ containerProps = {},
19
+ innerRef,
20
+ withDepth = true,
21
+ alignment = "right",
22
+ autoFocusOnMount = true,
23
+ children = [],
24
+ size = "normal",
25
+ ...otherProps
26
+ }) => {
66
27
  const containerRef = useRef(null);
67
28
  const { handleOnKeyDown } = useKeyboardNavigation({ containerRef, autoFocusOnMount });
68
- return /* @__PURE__ */ React2.createElement(ToolbarContainer, __spreadProps(__spreadValues(__spreadValues({}, containerProps), otherProps), {
29
+ return /* @__PURE__ */ React2.createElement(ToolbarContainer, {
30
+ ...containerProps,
31
+ ...otherProps,
69
32
  classProps: { withDepth, alignment, size },
70
33
  innerRef: mergeRefs(innerRef, containerRef),
71
34
  onKeyDown: handleOnKeyDown
72
- }), decorateToolbarChildren(children));
35
+ }, decorateToolbarChildren(children));
73
36
  };
74
37
  const toolbarProps = {
75
38
  containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/DSToolbar.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { describe, PropTypes, mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\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 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;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACtG,iBAAiB,CAAC;AAAA,EAClB,CAAC,YAAY,CAAC,CAAC;AAAA,EACf,CAAC,OAAO;AACV,EAAE;AAEF,MAAM,YAAY,CAAC,OASb;AATa,eACjB;AAAA,qBAAiB,CAAC;AAAA,IAClB;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,WAAW,CAAC;AAAA,IACZ,OAAO;AAAA,MAPU,IAQd,uBARc,IAQd;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,OAA8B,IAAI;AAEvD,QAAM,EAAE,oBAAoB,sBAAsB,EAAE,cAAc,iBAAiB,CAAC;AAEpF,SACE,qCAAC,kEACK,iBACA,aAFL;AAAA,IAGC,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,IACzC,UAAU,UAAU,UAAU,YAAY;AA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CAAC;AAEpF,SACE,qCAAC;AAAA,IACE,GAAG;AAAA,IACH,GAAG;AAAA,IACJ,YAAY,EAAE,WAAW,WAAW,KAAK;AAAA,IACzC,UAAU,UAAU,UAAU,YAAY;AAAA,IAC1C,WAAW;AAAA,KAEV,wBAAwB,QAAQ,CACnC;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
6
  "names": []
7
7
  }
@@ -1,55 +1,26 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
2
  import * as React from "react";
34
3
  import React2, { useState } from "react";
35
4
  import PropTypes from "prop-types";
36
5
  import { useFocusGroupWithState } from "@elliemae/ds-shared";
37
6
  import { DSButtonV2 } from "@elliemae/ds-button";
38
7
  import { PopperPositions as Position } from "@elliemae/ds-popper";
39
- const ToolbarItem = (_a) => {
40
- var _b = _a, { icon, labelText, menu = void 0, containerProps = {} } = _b, otherProps = __objRest(_b, ["icon", "labelText", "menu", "containerProps"]);
8
+ const ToolbarItem = ({ icon, labelText, menu = void 0, containerProps = {}, ...otherProps }) => {
41
9
  const [ref, setRef] = useState(null);
42
10
  useFocusGroupWithState(ref);
43
- const btn = /* @__PURE__ */ React2.createElement(DSButtonV2, __spreadValues(__spreadProps(__spreadValues({}, otherProps), {
11
+ const btn = /* @__PURE__ */ React2.createElement(DSButtonV2, {
12
+ ...otherProps,
44
13
  buttonType: "icon",
45
14
  innerRef: (r) => setRef(r),
46
- labelText
47
- }), containerProps), icon);
15
+ labelText,
16
+ ...containerProps
17
+ }, icon);
48
18
  if (menu) {
49
- return React2.cloneElement(menu, __spreadProps(__spreadValues({}, menu.props), {
19
+ return React2.cloneElement(menu, {
20
+ ...menu.props,
50
21
  placement: Position.BOTTOM_END,
51
22
  triggerComponent: btn
52
- }));
23
+ });
53
24
  }
54
25
  return btn;
55
26
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/ToolbarItem.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared';\nimport { DSButtonV2 } from '@elliemae/ds-button';\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;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,OAA8E;AAA9E,eAAE,QAAM,WAAW,OAAO,QAAW,iBAAiB,CAAC,MAAvD,IAA6D,uBAA7D,IAA6D,CAA3D,QAAM,aAAW,QAAkB;AACxD,QAAM,CAAC,KAAK,UAAU,SAAS,IAAI;AAEnC,yBAAuB,GAAG;AAC1B,QAAM,MACJ,qCAAC,4DAAe,aAAf;AAAA,IAA2B,YAAW;AAAA,IAAO,UAAU,CAAC,MAAM,OAAO,CAAC;AAAA,IAAG;AAAA,MAA0B,iBACjG,IACH;AAEF,MAAI,MAAM;AACR,WAAO,OAAM,aAAa,MAAM,iCAC3B,KAAK,QADsB;AAAA,MAE9B,WAAW,SAAS;AAAA,MACpB,kBAAkB;AAAA,IACpB,EAAC;AAAA,EACH;AACA,SAAO;AACT;AAEA,YAAY,cAAc;AAE1B,YAAY,YAAY;AAAA,EACtB,MAAM,UAAU;AAAA,EAChB,WAAW,UAAU;AACvB;AAEA,IAAO,sBAAQ;",
5
+ "mappings": ";AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,EAAE,MAAM,WAAW,OAAO,QAAW,iBAAiB,CAAC,MAAM,iBAAiB;AACjG,QAAM,CAAC,KAAK,UAAU,SAAS,IAAI;AAEnC,yBAAuB,GAAG;AAC1B,QAAM,MACJ,qCAAC;AAAA,IAAY,GAAG;AAAA,IAAY,YAAW;AAAA,IAAO,UAAU,CAAC,MAAM,OAAO,CAAC;AAAA,IAAG;AAAA,IAAuB,GAAG;AAAA,KACjG,IACH;AAEF,MAAI,MAAM;AACR,WAAO,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
6
  "names": []
7
7
  }
@@ -1,28 +1,11 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
2
  import * as React from "react";
22
3
  import React2, { cloneElement } from "react";
23
- var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(children, (component) => component ? cloneElement(component, __spreadProps(__spreadValues(__spreadValues({}, extraProps), component.props), {
4
+ var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(children, (component) => component ? cloneElement(component, {
5
+ ...extraProps,
6
+ ...component.props,
24
7
  className: `${component.props.className} toolbar-item`
25
- })) : component, null);
8
+ }) : component, null);
26
9
  export {
27
10
  decorateToolbarChildren_default as default
28
11
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/decorateToolbarChildren.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import 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;ACAA;AAEA,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtC,OAAM,SAAS,IACb,UACA,eACE,YACI,aAAa,WAAW,gDACnB,aACA,UAAU,QAFS;AAAA,EAGtB,WAAW,GAAG,UAAU,MAAM;AAChC,EAAC,IACD,WACN,IACF;",
5
+ "mappings": ";AAAA;ACAA;AAEA,IAAO,kCAAQ,CAAC,UAAU,aAAa,CAAC,MACtC,OAAM,SAAS,IACb,UACA,eACE,YACI,aAAa,WAAW;AAAA,EACtB,GAAG;AAAA,EACH,GAAG,UAAU;AAAA,EACb,WAAW,GAAG,UAAU,MAAM;AAChC,CAAC,IACD,WACN,IACF;",
6
6
  "names": []
7
7
  }
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
2
  import * as React from "react";
22
3
  import { globalAttributesPropTypes, PropTypes } from "@elliemae/ds-utilities";
23
4
  const defaultItemProps = {
@@ -30,17 +11,19 @@ const defaultProps = {
30
11
  withDepth: true,
31
12
  compact: false
32
13
  };
33
- const DSToolbarV2Schema = __spreadProps(__spreadValues({}, globalAttributesPropTypes), {
14
+ const DSToolbarV2Schema = {
15
+ ...globalAttributesPropTypes,
34
16
  alignment: PropTypes.oneOf(["right", "left"]).description("Whether to align the content left or right").defaultValue("right"),
35
17
  withDepth: PropTypes.bool.description("Whether to add a box-shadow to the container").defaultValue(true),
36
18
  compact: PropTypes.bool.description("Whether you want the compact version of the toolbar").defaultValue(false),
37
19
  innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description("Reference to attach to the wrapper")
38
- });
39
- const DSToolbarItemV2Schema = __spreadProps(__spreadValues({}, globalAttributesPropTypes), {
20
+ };
21
+ const DSToolbarItemV2Schema = {
22
+ ...globalAttributesPropTypes,
40
23
  render: PropTypes.func.isRequired.description("render function").defaultValue(() => {
41
24
  }),
42
25
  isFirstItem: PropTypes.bool.description("If true the item will have tab index 0 to be the first element focusable by keyboard on the page load").defaultValue(false)
43
- });
26
+ };
44
27
  export {
45
28
  DSToolbarItemV2Schema,
46
29
  DSToolbarV2Schema,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSToolbarT {\n export interface Props {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children: React.Component<DSToolbarItemT.Props>;\n }\n}\n\nexport declare namespace DSToolbarItemT {\n export type RenderHTMLElementT =\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement;\n export interface Props {\n render: (props: { innerRef: React.MutableRefObject<HTMLElement>; tabIndex: number }) => JSX.Element;\n isFirstItem?: boolean;\n }\n}\n\nexport const defaultItemProps = {\n render: () => {},\n isFirstItem: false,\n};\n\nexport const defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\n\nexport const DSToolbarV2Schema = {\n ...globalAttributesPropTypes,\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n\nexport const DSToolbarItemV2Schema = {\n ...globalAttributesPropTypes,\n render: PropTypes.func.isRequired.description('render function').defaultValue(() => {}),\n isFirstItem: PropTypes.bool\n .description(\n 'If true the item will have tab index 0 to be the first element focusable by keyboard on the page load',\n )\n .defaultValue(false),\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAyBO,MAAM,mBAAmB;AAAA,EAC9B,QAAQ,MAAM;AAAA,EAAC;AAAA,EACf,aAAa;AACf;AAEO,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AACX;AAEO,MAAM,oBAAoB,iCAC5B,4BAD4B;AAAA,EAE/B,WAAW,UAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,4CAA4C,EACxD,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,IAAI;AAAA,EACvG,SAAS,UAAU,KAAK,YAAY,qDAAqD,EAAE,aAAa,KAAK;AAAA,EAC7G,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,oCAAoC;AACpH;AAEO,MAAM,wBAAwB,iCAChC,4BADgC;AAAA,EAEnC,QAAQ,UAAU,KAAK,WAAW,YAAY,iBAAiB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACtF,aAAa,UAAU,KACpB,YACC,uGACF,EACC,aAAa,KAAK;AACvB;",
5
+ "mappings": ";AAAA;ACAA;AAyBO,MAAM,mBAAmB;AAAA,EAC9B,QAAQ,MAAM;AAAA,EAAC;AAAA,EACf,aAAa;AACf;AAEO,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AACX;AAEO,MAAM,oBAAoB;AAAA,EAC/B,GAAG;AAAA,EACH,WAAW,UAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,4CAA4C,EACxD,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,IAAI;AAAA,EACvG,SAAS,UAAU,KAAK,YAAY,qDAAqD,EAAE,aAAa,KAAK;AAAA,EAC7G,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,oCAAoC;AACpH;AAEO,MAAM,wBAAwB;AAAA,EACnC,GAAG;AAAA,EACH,QAAQ,UAAU,KAAK,WAAW,YAAY,iBAAiB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACtF,aAAa,UAAU,KACpB,YACC,uGACF,EACC,aAAa,KAAK;AACvB;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-toolbar",
3
- "version": "3.3.0-next.4",
3
+ "version": "3.3.0-next.7",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Toolbar",
6
6
  "files": [
@@ -87,14 +87,14 @@
87
87
  "indent": 4
88
88
  },
89
89
  "dependencies": {
90
- "@elliemae/ds-button": "3.3.0-next.4",
91
- "@elliemae/ds-classnames": "3.3.0-next.4",
92
- "@elliemae/ds-grid": "3.3.0-next.4",
93
- "@elliemae/ds-icons": "3.3.0-next.4",
94
- "@elliemae/ds-popper": "3.3.0-next.4",
95
- "@elliemae/ds-shared": "3.3.0-next.4",
96
- "@elliemae/ds-system": "3.3.0-next.4",
97
- "@elliemae/ds-utilities": "3.3.0-next.4",
90
+ "@elliemae/ds-button": "3.3.0-next.7",
91
+ "@elliemae/ds-classnames": "3.3.0-next.7",
92
+ "@elliemae/ds-grid": "3.3.0-next.7",
93
+ "@elliemae/ds-icons": "3.3.0-next.7",
94
+ "@elliemae/ds-popper": "3.3.0-next.7",
95
+ "@elliemae/ds-shared": "3.3.0-next.7",
96
+ "@elliemae/ds-system": "3.3.0-next.7",
97
+ "@elliemae/ds-utilities": "3.3.0-next.7",
98
98
  "prop-types": "~15.8.1",
99
99
  "uid": "2.0.0"
100
100
  },