@elliemae/ds-toolbar 2.2.0-alpha.4 → 3.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/cjs/DSToolbarItemV2.js +44 -49
  2. package/cjs/DSToolbarSeparatorV2.js +17 -38
  3. package/cjs/DSToolbarV2.js +69 -62
  4. package/cjs/DSToolbarV2Context.js +10 -37
  5. package/cjs/deprecated/DSToolbar.js +89 -86
  6. package/cjs/deprecated/ToolbarDivider.js +9 -39
  7. package/cjs/deprecated/ToolbarGroup.js +34 -48
  8. package/cjs/deprecated/ToolbarItem.js +54 -58
  9. package/cjs/deprecated/decorateToolbarChildren.js +27 -39
  10. package/cjs/deprecated/index.js +17 -36
  11. package/cjs/index.js +24 -39
  12. package/cjs/props.js +12 -39
  13. package/cjs/styled.js +22 -51
  14. package/cjs/useToolbarItemHandlers.js +28 -48
  15. package/esm/DSToolbarItemV2.js +33 -17
  16. package/esm/DSToolbarSeparatorV2.js +9 -9
  17. package/esm/DSToolbarV2.js +54 -29
  18. package/esm/DSToolbarV2Context.js +6 -8
  19. package/esm/deprecated/DSToolbar.js +73 -57
  20. package/esm/deprecated/ToolbarDivider.js +7 -10
  21. package/esm/deprecated/ToolbarGroup.js +30 -21
  22. package/esm/deprecated/ToolbarItem.js +43 -27
  23. package/esm/deprecated/decorateToolbarChildren.js +21 -11
  24. package/esm/deprecated/index.js +4 -7
  25. package/esm/index.js +7 -10
  26. package/esm/props.js +8 -10
  27. package/esm/styled.js +12 -23
  28. package/esm/useToolbarItemHandlers.js +24 -19
  29. package/package.json +10 -10
  30. package/cjs/DSToolbarItemV2.js.map +0 -7
  31. package/cjs/DSToolbarSeparatorV2.js.map +0 -7
  32. package/cjs/DSToolbarV2.js.map +0 -7
  33. package/cjs/DSToolbarV2Context.js.map +0 -7
  34. package/cjs/deprecated/DSToolbar.js.map +0 -7
  35. package/cjs/deprecated/ToolbarDivider.js.map +0 -7
  36. package/cjs/deprecated/ToolbarGroup.js.map +0 -7
  37. package/cjs/deprecated/ToolbarItem.js.map +0 -7
  38. package/cjs/deprecated/decorateToolbarChildren.js.map +0 -7
  39. package/cjs/deprecated/index.js.map +0 -7
  40. package/cjs/index.js.map +0 -7
  41. package/cjs/props.js.map +0 -7
  42. package/cjs/styled.js.map +0 -7
  43. package/cjs/useToolbarItemHandlers.js.map +0 -7
  44. package/esm/DSToolbarItemV2.js.map +0 -7
  45. package/esm/DSToolbarSeparatorV2.js.map +0 -7
  46. package/esm/DSToolbarV2.js.map +0 -7
  47. package/esm/DSToolbarV2Context.js.map +0 -7
  48. package/esm/deprecated/DSToolbar.js.map +0 -7
  49. package/esm/deprecated/ToolbarDivider.js.map +0 -7
  50. package/esm/deprecated/ToolbarGroup.js.map +0 -7
  51. package/esm/deprecated/ToolbarItem.js.map +0 -7
  52. package/esm/deprecated/decorateToolbarChildren.js.map +0 -7
  53. package/esm/deprecated/index.js.map +0 -7
  54. package/esm/index.js.map +0 -7
  55. package/esm/props.js.map +0 -7
  56. package/esm/styled.js.map +0 -7
  57. package/esm/useToolbarItemHandlers.js.map +0 -7
@@ -1,26 +1,42 @@
1
- import * as React from "react";
2
- import React2, { useContext, useMemo, useRef } from "react";
3
- import { uid } from "uid";
4
- import { DSToolbarV2Context } from "./DSToolbarV2Context";
5
- import { StyledToolbarItem } from "./styled";
6
- import { useToolbarItemHandlers } from "./useToolbarItemHandlers";
7
- const DSToolbarItemV2 = ({ render }) => {
8
- const { registerReference } = useContext(DSToolbarV2Context);
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import { useContext, useRef, useMemo } from 'react';
8
+ import { uid } from 'uid';
9
+ import { DSToolbarV2Context } from './DSToolbarV2Context.js';
10
+ import { StyledToolbarItem } from './styled.js';
11
+ import { useToolbarItemHandlers } from './useToolbarItemHandlers.js';
12
+ import { jsx } from 'react/jsx-runtime';
13
+
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+ const DSToolbarItemV2 = _ref => {
18
+ let {
19
+ render
20
+ } = _ref;
21
+ const {
22
+ registerReference
23
+ } = useContext(DSToolbarV2Context);
9
24
  const ref = useRef(null);
10
25
  const toolbarItemId = useMemo(() => {
11
- const id = `ds-toolbar-item-${uid()}`;
26
+ const id = "ds-toolbar-item-".concat(uid());
12
27
  registerReference(id, ref);
13
28
  return id;
14
29
  }, [registerReference, ref]);
15
30
  const handlers = useToolbarItemHandlers(toolbarItemId);
16
- return /* @__PURE__ */ React2.createElement(StyledToolbarItem, {
31
+ return /*#__PURE__*/jsx(StyledToolbarItem, _objectSpread(_objectSpread({
17
32
  id: toolbarItemId,
18
33
  "data-testid": "ds-toolbar-item",
19
- className: "ds-toolbar-item",
20
- ...handlers
21
- }, render({ innerRef: ref }));
34
+ className: "ds-toolbar-item"
35
+ }, handlers), {}, {
36
+ children: render({
37
+ innerRef: ref
38
+ })
39
+ }));
22
40
  };
23
- export {
24
- DSToolbarItemV2
25
- };
26
- //# sourceMappingURL=DSToolbarItemV2.js.map
41
+
42
+ export { DSToolbarItemV2 };
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { StyledSeparator } from "./styled";
4
- const DSToolbarSeparatorV2 = () => /* @__PURE__ */ React2.createElement(StyledSeparator, {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { StyledSeparator } from './styled.js';
4
+
5
+ var _StyledSeparator;
6
+ const DSToolbarSeparatorV2 = () => _StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx(StyledSeparator, {
5
7
  className: "ds-toolbar-separator"
6
- });
7
- export {
8
- DSToolbarSeparatorV2
9
- };
10
- //# sourceMappingURL=DSToolbarSeparatorV2.js.map
8
+ }));
9
+
10
+ export { DSToolbarSeparatorV2 };
@@ -1,44 +1,69 @@
1
- import * as React from "react";
2
- import React2, { useCallback, useMemo, useState } from "react";
3
- import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
4
- import { describe } from "react-desc";
5
- import { uid } from "uid";
6
- import { DSToolbarV2Context } from "./DSToolbarV2Context";
7
- import { DSToolbarV2Schema } from "./props";
8
- import { StyledToolbarWrapper } from "./styled";
9
- const DSToolbarV2 = (props) => {
10
- const { alignment, withDepth, compact, innerRef, children } = props;
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'core-js/modules/web.dom-collections.iterator.js';
9
+ import 'core-js/modules/esnext.async-iterator.map.js';
10
+ import 'core-js/modules/esnext.iterator.map.js';
11
+ import React, { useMemo, useState, useCallback } from 'react';
12
+ import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
13
+ import { describe } from 'react-desc';
14
+ import { uid } from 'uid';
15
+ import { DSToolbarV2Context } from './DSToolbarV2Context.js';
16
+ import { DSToolbarV2Schema } from './props.js';
17
+ import { StyledToolbarWrapper } from './styled.js';
18
+ import { jsx } from 'react/jsx-runtime';
19
+
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
+
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+
24
+ const DSToolbarV2 = props => {
25
+ const {
26
+ alignment,
27
+ withDepth,
28
+ compact,
29
+ innerRef,
30
+ children
31
+ } = props;
11
32
  useValidateTypescriptPropTypes(props, DSToolbarV2Schema);
12
- const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);
33
+ const toolbarUid = useMemo(() => "ds-toolbar-".concat(uid()), []);
13
34
  const [itemReferences, setItemReferences] = useState({});
14
35
  const registerReference = useCallback((itemId, ref) => {
15
- setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));
36
+ setItemReferences(prevItemReferences => _objectSpread(_objectSpread({}, prevItemReferences), {}, {
37
+ [itemId]: ref
38
+ }));
16
39
  }, [setItemReferences]);
17
- return /* @__PURE__ */ React2.createElement(DSToolbarV2Context.Provider, {
18
- value: { toolbarUid, registerReference, itemReferences }
19
- }, /* @__PURE__ */ React2.createElement(StyledToolbarWrapper, {
40
+ return /*#__PURE__*/_jsx(DSToolbarV2Context.Provider, {
41
+ value: {
42
+ toolbarUid,
43
+ registerReference,
44
+ itemReferences
45
+ }
46
+ }, void 0, /*#__PURE__*/jsx(StyledToolbarWrapper, {
20
47
  role: "toolbar",
21
48
  "data-testid": "ds-toolbar-wrapper",
22
49
  id: toolbarUid,
23
50
  alignItems: "center",
24
- justifyContent: alignment === "left" ? "flex-start" : "flex-end",
25
- withDepth,
26
- cols: React2.Children.map(children, () => ["auto"]),
51
+ justifyContent: alignment === 'left' ? 'flex-start' : 'flex-end',
52
+ withDepth: withDepth,
53
+ cols: React.Children.map(children, () => ['auto']),
27
54
  gutter: "xxs2",
28
- compact,
29
- ref: innerRef
30
- }, children));
55
+ compact: compact,
56
+ ref: innerRef,
57
+ children: children
58
+ }));
31
59
  };
32
- DSToolbarV2.propTypes = DSToolbarV2Schema;
60
+
33
61
  DSToolbarV2.defaultProps = {
34
- alignment: "right",
62
+ alignment: 'right',
35
63
  withDepth: true,
36
64
  compact: false
37
65
  };
38
- const DSToolbarV2WithSchema = describe(DSToolbarV2).description("Toolbar");
66
+ const DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');
39
67
  DSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;
40
- export {
41
- DSToolbarV2,
42
- DSToolbarV2WithSchema
43
- };
44
- //# sourceMappingURL=DSToolbarV2.js.map
68
+
69
+ export { DSToolbarV2, DSToolbarV2WithSchema };
@@ -1,11 +1,9 @@
1
- import * as React from "react";
2
- import { createContext } from "react";
3
- const DSToolbarV2Context = createContext({
1
+ import { createContext } from 'react';
2
+
3
+ const DSToolbarV2Context = /*#__PURE__*/createContext({
4
4
  registerReference: () => null,
5
5
  itemReferences: {},
6
- toolbarUid: ""
6
+ toolbarUid: ''
7
7
  });
8
- export {
9
- DSToolbarV2Context
10
- };
11
- //# sourceMappingURL=DSToolbarV2Context.js.map
8
+
9
+ export { DSToolbarV2Context };
@@ -1,67 +1,83 @@
1
- import * as React from "react";
2
- import React2, { useRef } from "react";
3
- import { describe, PropTypes } from "react-desc";
4
- import { aggregatedClasses } from "@elliemae/ds-classnames";
5
- import FocusGroupProvider from "@elliemae/ds-shared/FocusGroup/FocusGroupManager";
6
- import { mergeRefs } from "@elliemae/ds-utilities";
7
- import decorateToolbarChildren from "./decorateToolbarChildren";
8
- import Item from "./ToolbarItem";
9
- import ToolbarGroup from "./ToolbarGroup";
10
- import Divider from "./ToolbarDivider";
11
- const blockName = "toolbar";
12
- const ToolbarContainer = aggregatedClasses("div")(blockName, null, ({ withDepth, alignment, size }) => ({
13
- "without-depth": !withDepth,
14
- [alignment]: !!alignment,
15
- [size]: size
16
- }));
17
- const DSToolbar = ({
18
- containerProps = {},
19
- innerRef,
20
- withDepth = true,
21
- alignment = "right",
22
- autoFocusOnMount = true,
23
- children = [],
24
- size = "normal",
25
- ...otherProps
26
- }) => {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
9
+ import { useRef } from 'react';
10
+ import { PropTypes, describe } from 'react-desc';
11
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
12
+ import FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
13
+ import { mergeRefs } from '@elliemae/ds-utilities';
14
+ import decorateToolbarChildren from './decorateToolbarChildren.js';
15
+ export { default as ToolbarItem } from './ToolbarItem.js';
16
+ export { default as ToolbarGroup } from './ToolbarGroup.js';
17
+ export { default as ToolbarDivider } from './ToolbarDivider.js';
18
+ import { jsx } from 'react/jsx-runtime';
19
+
20
+ const _excluded = ["containerProps", "innerRef", "withDepth", "alignment", "autoFocusOnMount", "children", "size"];
21
+
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+ const blockName = 'toolbar';
26
+ const ToolbarContainer = aggregatedClasses('div')(blockName, null, _ref => {
27
+ let {
28
+ withDepth,
29
+ alignment,
30
+ size
31
+ } = _ref;
32
+ return {
33
+ 'without-depth': !withDepth,
34
+ [alignment]: !!alignment,
35
+ [size]: size
36
+ };
37
+ });
38
+
39
+ const DSToolbar = _ref2 => {
40
+ let {
41
+ containerProps = {},
42
+ innerRef,
43
+ withDepth = true,
44
+ alignment = 'right',
45
+ // left || right
46
+ autoFocusOnMount = true,
47
+ children = [],
48
+ size = 'normal'
49
+ } = _ref2,
50
+ otherProps = _objectWithoutProperties(_ref2, _excluded);
51
+
27
52
  const containerRef = useRef(null);
28
- return /* @__PURE__ */ React2.createElement(FocusGroupProvider, {
29
- autoFocusOnMount,
53
+ return /*#__PURE__*/_jsx(FocusGroupProvider, {
54
+ autoFocusOnMount: autoFocusOnMount,
30
55
  getContainer: () => containerRef.current,
31
56
  keyBindings: {
32
- Tab: "next"
57
+ Tab: 'next'
33
58
  },
34
59
  orientation: "horizontal"
35
- }, /* @__PURE__ */ React2.createElement(ToolbarContainer, {
36
- ...containerProps,
37
- ...otherProps,
38
- classProps: { withDepth, alignment, size },
39
- innerRef: mergeRefs(innerRef, containerRef)
40
- }, decorateToolbarChildren(children)));
60
+ }, void 0, /*#__PURE__*/jsx(ToolbarContainer, _objectSpread(_objectSpread(_objectSpread({}, containerProps), otherProps), {}, {
61
+ classProps: {
62
+ withDepth,
63
+ alignment,
64
+ size
65
+ },
66
+ innerRef: mergeRefs(innerRef, containerRef),
67
+ children: decorateToolbarChildren(children)
68
+ })));
41
69
  };
70
+
42
71
  const toolbarProps = {
43
- containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
44
- withDepth: PropTypes.bool.description("Shows a shadow rear the toolbar").defaultValue(true),
45
- alignment: PropTypes.oneOf(["right", "left"]).description("Aligns the toolbar to the left or right").defaultValue("right"),
46
- size: PropTypes.oneOf(["normal", "compact"]).description("Toolbar size").defaultValue("normal"),
47
- autoFocusOnMount: PropTypes.bool.description("Wheter to focus the component when it mounts or not").defaultValue(true),
48
- children: PropTypes.oneOfType([
49
- PropTypes.array,
50
- PropTypes.func,
51
- PropTypes.node
52
- ]).description("Toolbar items").isRequired,
53
- innerRef: PropTypes.object.description("Ref to the Toolbar container element")
72
+ containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
73
+ withDepth: PropTypes.bool.description('Shows a shadow rear the toolbar').defaultValue(true),
74
+ alignment: PropTypes.oneOf(['right', 'left']).description('Aligns the toolbar to the left or right').defaultValue('right'),
75
+ size: PropTypes.oneOf(['normal', 'compact']).description('Toolbar size').defaultValue('normal'),
76
+ autoFocusOnMount: PropTypes.bool.description('Wheter to focus the component when it mounts or not').defaultValue(true),
77
+ children: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.node]).description('Toolbar items').isRequired,
78
+ innerRef: PropTypes.object.description('Ref to the Toolbar container element')
54
79
  };
55
- DSToolbar.propTypes = toolbarProps;
56
80
  const ToolbarWithSchema = describe(DSToolbar);
57
81
  ToolbarWithSchema.propTypes = toolbarProps;
58
- var DSToolbar_default = DSToolbar;
59
- export {
60
- DSToolbar,
61
- Divider as ToolbarDivider,
62
- ToolbarGroup,
63
- Item as ToolbarItem,
64
- ToolbarWithSchema,
65
- DSToolbar_default as default
66
- };
67
- //# sourceMappingURL=DSToolbar.js.map
82
+
83
+ export { DSToolbar, ToolbarWithSchema, DSToolbar as default };
@@ -1,10 +1,7 @@
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
1
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
2
+
3
+ const blockName = 'toolbar';
4
+ const ToolbarDivider = aggregatedClasses('div')(blockName, 'divider');
5
+ ToolbarDivider.displayName = 'ToolbarDivider';
6
+
7
+ export { ToolbarDivider as default };
@@ -1,22 +1,31 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import PropTypes from "prop-types";
4
- import { aggregatedClasses } from "@elliemae/ds-classnames";
5
- import decorateToolbarChildren from "./decorateToolbarChildren";
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__ */ React2.createElement(ToolbarGroupContainer, {
11
- classProps: { space }
12
- }, decorateToolbarChildren(children, { size }));
13
- ToolbarGroup.propTypes = {
14
- children: PropTypes.any,
15
- size: PropTypes.number,
16
- space: PropTypes.number
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
4
+ import decorateToolbarChildren from './decorateToolbarChildren.js';
5
+
6
+ const blockName = 'toolbar-group';
7
+ const ToolbarGroupContainer = aggregatedClasses('div')(blockName, null, _ref => {
8
+ let {
9
+ space
10
+ } = _ref;
11
+ return {
12
+ ["space-".concat(space)]: !!space
13
+ };
14
+ });
15
+
16
+ const ToolbarGroup = _ref2 => {
17
+ let {
18
+ children,
19
+ size,
20
+ space = 0
21
+ } = _ref2;
22
+ return /*#__PURE__*/_jsx(ToolbarGroupContainer, {
23
+ classProps: {
24
+ space
25
+ }
26
+ }, void 0, decorateToolbarChildren(children, {
27
+ size
28
+ }));
17
29
  };
18
- var ToolbarGroup_default = ToolbarGroup;
19
- export {
20
- ToolbarGroup_default as default
21
- };
22
- //# sourceMappingURL=ToolbarGroup.js.map
30
+
31
+ export { ToolbarGroup as default };
@@ -1,35 +1,51 @@
1
- import * as React from "react";
2
- import React2, { useState } from "react";
3
- import PropTypes from "prop-types";
4
- import { useFocusGroupWithState } from "@elliemae/ds-shared/FocusGroup";
5
- import DSButton from "@elliemae/ds-button";
6
- import { PopperPositions as Position } from "@elliemae/ds-popper";
7
- const ToolbarItem = ({ icon, labelText, menu = void 0, ...otherProps }) => {
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
+ import 'core-js/modules/esnext.async-iterator.filter.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.filter.js';
7
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
8
+ import 'core-js/modules/esnext.iterator.for-each.js';
9
+ import React, { useState } from 'react';
10
+ import { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';
11
+ import DSButton from '@elliemae/ds-button';
12
+ import { PopperPositions } from '@elliemae/ds-popper';
13
+ import { jsx } from 'react/jsx-runtime';
14
+
15
+ const _excluded = ["icon", "labelText", "menu"];
16
+
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+
21
+ const ToolbarItem = _ref => {
22
+ let {
23
+ icon,
24
+ labelText,
25
+ menu = undefined
26
+ } = _ref,
27
+ otherProps = _objectWithoutProperties(_ref, _excluded);
28
+
8
29
  const [ref, setRef] = useState(null);
9
30
  useFocusGroupWithState(ref);
10
- const btn = /* @__PURE__ */ React2.createElement(DSButton, {
11
- ...otherProps,
31
+
32
+ const btn = /*#__PURE__*/jsx(DSButton, _objectSpread(_objectSpread({}, otherProps), {}, {
12
33
  buttonType: "text",
13
- icon,
14
- innerRef: (r) => setRef(r),
15
- labelText
16
- });
34
+ icon: icon,
35
+ innerRef: r => setRef(r),
36
+ labelText: labelText
37
+ }));
38
+
17
39
  if (menu) {
18
- return React2.cloneElement(menu, {
19
- ...menu.props,
20
- placement: Position.BOTTOM_END,
40
+ return /*#__PURE__*/React.cloneElement(menu, _objectSpread(_objectSpread({}, menu.props), {}, {
41
+ placement: PopperPositions.BOTTOM_END,
21
42
  triggerComponent: btn
22
- });
43
+ }));
23
44
  }
45
+
24
46
  return btn;
25
47
  };
26
- ToolbarItem.displayName = "ToolbarItem";
27
- ToolbarItem.propTypes = {
28
- icon: PropTypes.element,
29
- labelText: PropTypes.string
30
- };
31
- var ToolbarItem_default = ToolbarItem;
32
- export {
33
- ToolbarItem_default as default
34
- };
35
- //# sourceMappingURL=ToolbarItem.js.map
48
+
49
+ ToolbarItem.displayName = 'ToolbarItem';
50
+
51
+ export { ToolbarItem as default };
@@ -1,11 +1,21 @@
1
- import * as React from "react";
2
- import React2, { cloneElement } from "react";
3
- var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(children, (component) => component ? cloneElement(component, {
4
- ...extraProps,
5
- ...component.props,
6
- className: `${component.props.className} toolbar-item`
7
- }) : component, null);
8
- export {
9
- decorateToolbarChildren_default as default
10
- };
11
- //# sourceMappingURL=decorateToolbarChildren.js.map
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import 'core-js/modules/esnext.async-iterator.map.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
4
+ import 'core-js/modules/esnext.async-iterator.filter.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.filter.js';
7
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
8
+ import 'core-js/modules/esnext.iterator.for-each.js';
9
+ import React, { cloneElement } from 'react';
10
+
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
+ var decorateToolbarChildren = (function (children) {
15
+ let extraProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16
+ return React.Children.map(children, component => component ? /*#__PURE__*/cloneElement(component, _objectSpread(_objectSpread(_objectSpread({}, extraProps), component.props), {}, {
17
+ className: "".concat(component.props.className, " toolbar-item")
18
+ })) : component, null);
19
+ });
20
+
21
+ export { decorateToolbarChildren as default };
@@ -1,7 +1,4 @@
1
- import * as React from "react";
2
- export * from "./DSToolbar";
3
- import { default as default2 } from "./DSToolbar";
4
- export {
5
- default2 as default
6
- };
7
- //# sourceMappingURL=index.js.map
1
+ export { DSToolbar, ToolbarWithSchema, DSToolbar as default } from './DSToolbar.js';
2
+ export { default as ToolbarItem } from './ToolbarItem.js';
3
+ export { default as ToolbarGroup } from './ToolbarGroup.js';
4
+ export { default as ToolbarDivider } from './ToolbarDivider.js';
package/esm/index.js CHANGED
@@ -1,10 +1,7 @@
1
- import * as React from "react";
2
- export * from "./deprecated";
3
- import { default as default2 } from "./deprecated";
4
- export * from "./DSToolbarV2";
5
- export * from "./DSToolbarItemV2";
6
- export * from "./DSToolbarSeparatorV2";
7
- export {
8
- default2 as default
9
- };
10
- //# sourceMappingURL=index.js.map
1
+ export { DSToolbar, ToolbarWithSchema, DSToolbar as default } from './deprecated/DSToolbar.js';
2
+ export { DSToolbarV2, DSToolbarV2WithSchema } from './DSToolbarV2.js';
3
+ export { DSToolbarItemV2 } from './DSToolbarItemV2.js';
4
+ export { DSToolbarSeparatorV2 } from './DSToolbarSeparatorV2.js';
5
+ export { default as ToolbarItem } from './deprecated/ToolbarItem.js';
6
+ export { default as ToolbarGroup } from './deprecated/ToolbarGroup.js';
7
+ export { default as ToolbarDivider } from './deprecated/ToolbarDivider.js';
package/esm/props.js CHANGED
@@ -1,12 +1,10 @@
1
- import * as React from "react";
2
- import { PropTypes } from "react-desc";
1
+ import { PropTypes } from 'react-desc';
2
+
3
3
  const DSToolbarV2Schema = {
4
- alignment: PropTypes.oneOf(["right", "left"]).description("Whether to align the content left or right").defaultValue("right"),
5
- withDepth: PropTypes.bool.description("Whether to add a box-shadow to the container").defaultValue(true),
6
- compact: PropTypes.bool.description("Whether you want the compact version of the toolbar").defaultValue(false),
7
- innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description("Reference to attach to the wrapper")
4
+ alignment: PropTypes.oneOf(['right', 'left']).description('Whether to align the content left or right').defaultValue('right'),
5
+ withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),
6
+ compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),
7
+ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper')
8
8
  };
9
- export {
10
- DSToolbarV2Schema
11
- };
12
- //# sourceMappingURL=props.js.map
9
+
10
+ export { DSToolbarV2Schema };
package/esm/styled.js CHANGED
@@ -1,25 +1,14 @@
1
- import * as React from "react";
2
- import styled from "styled-components";
3
- import Grid from "@elliemae/ds-grid";
4
- const StyledToolbarWrapper = styled(Grid)`
5
- background-color: ${(props) => props.theme.colors.neutral["000"]};
1
+ import styled from 'styled-components';
2
+ import Grid from '@elliemae/ds-grid';
6
3
 
7
- min-height: ${(props) => props.compact ? "28px" : "40px"};
8
- max-height: ${(props) => props.theme.space.xxl};
4
+ const StyledToolbarWrapper = /*#__PURE__*/styled(Grid).withConfig({
5
+ componentId: "sc-8ez8n4-0"
6
+ })(["background-color:", ";min-height:", ";max-height:", ";padding:0 ", ";box-shadow:", ";"], props => props.theme.colors.neutral['000'], props => props.compact ? '28px' : '40px', props => props.theme.space.xxl, props => props.theme.space.xxs, props => !props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)');
7
+ const StyledToolbarItem = /*#__PURE__*/styled(Grid).withConfig({
8
+ componentId: "sc-8ez8n4-1"
9
+ })([""]);
10
+ const StyledSeparator = /*#__PURE__*/styled(Grid).withConfig({
11
+ componentId: "sc-8ez8n4-2"
12
+ })(["height:30px;width:1px;background-color:", ";"], props => props.theme.colors.neutral[200]);
9
13
 
10
- padding: 0 ${(props) => props.theme.space.xxs};
11
-
12
- box-shadow: ${(props) => !props.withDepth ? "none" : "0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)"};
13
- `;
14
- const StyledToolbarItem = styled(Grid)``;
15
- const StyledSeparator = styled(Grid)`
16
- height: 30px;
17
- width: 1px;
18
- background-color: ${(props) => props.theme.colors.neutral[200]};
19
- `;
20
- export {
21
- StyledSeparator,
22
- StyledToolbarItem,
23
- StyledToolbarWrapper
24
- };
25
- //# sourceMappingURL=styled.js.map
14
+ export { StyledSeparator, StyledToolbarItem, StyledToolbarWrapper };