@elliemae/ds-button-group 2.0.0-next.7 → 2.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSButtonGroup.js +40 -27
- package/esm/DSButtonGroup.js +40 -27
- package/package.json +9 -4
- package/types/DSButtonGroup.d.ts +49 -7
package/cjs/DSButtonGroup.js
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
13
|
var React = require('react');
|
|
7
14
|
var reactDesc = require('react-desc');
|
|
8
15
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
@@ -21,35 +28,41 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
28
|
|
|
22
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
30
|
const blockName = 'button-group';
|
|
24
|
-
const GroupContainer = dsClassnames.aggregatedClasses('div')(blockName, null,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}) => ({
|
|
29
|
-
vertical,
|
|
30
|
-
horizontal,
|
|
31
|
-
[spacing]: spacing
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
const DSButtonGroup = ({
|
|
35
|
-
size,
|
|
36
|
-
buttonType,
|
|
37
|
-
orientation,
|
|
38
|
-
spacing,
|
|
39
|
-
children: buttons,
|
|
40
|
-
containerProps
|
|
41
|
-
}) => /*#__PURE__*/jsxRuntime.jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
42
|
-
classProps: {
|
|
43
|
-
vertical: orientation === 'vertical',
|
|
44
|
-
horizontal: orientation !== 'vertical',
|
|
31
|
+
const GroupContainer = dsClassnames.aggregatedClasses('div')(blockName, null, _ref => {
|
|
32
|
+
let {
|
|
33
|
+
vertical,
|
|
34
|
+
horizontal,
|
|
45
35
|
spacing
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
} = _ref;
|
|
37
|
+
return {
|
|
38
|
+
vertical,
|
|
39
|
+
horizontal,
|
|
40
|
+
[spacing]: spacing
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const DSButtonGroup = _ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
size,
|
|
49
47
|
buttonType,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
orientation,
|
|
49
|
+
spacing,
|
|
50
|
+
children: buttons,
|
|
51
|
+
containerProps
|
|
52
|
+
} = _ref2;
|
|
53
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
54
|
+
classProps: {
|
|
55
|
+
vertical: orientation === 'vertical',
|
|
56
|
+
horizontal: orientation !== 'vertical',
|
|
57
|
+
spacing
|
|
58
|
+
}
|
|
59
|
+
}, containerProps), {}, {
|
|
60
|
+
children: React__default["default"].Children.map(buttons, button => /*#__PURE__*/React__default["default"].cloneElement(button, _objectSpread({
|
|
61
|
+
buttonType,
|
|
62
|
+
size
|
|
63
|
+
}, button.props)), null)
|
|
64
|
+
}));
|
|
65
|
+
};
|
|
53
66
|
|
|
54
67
|
DSButtonGroup.defaultProps = {
|
|
55
68
|
size: 'm',
|
package/esm/DSButtonGroup.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
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';
|
|
2
9
|
import React from 'react';
|
|
3
10
|
import { PropTypes, describe } from 'react-desc';
|
|
4
11
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
@@ -11,35 +18,41 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
11
18
|
|
|
12
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
20
|
const blockName = 'button-group';
|
|
14
|
-
const GroupContainer = aggregatedClasses('div')(blockName, null,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) => ({
|
|
19
|
-
vertical,
|
|
20
|
-
horizontal,
|
|
21
|
-
[spacing]: spacing
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
const DSButtonGroup = ({
|
|
25
|
-
size,
|
|
26
|
-
buttonType,
|
|
27
|
-
orientation,
|
|
28
|
-
spacing,
|
|
29
|
-
children: buttons,
|
|
30
|
-
containerProps
|
|
31
|
-
}) => /*#__PURE__*/jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
32
|
-
classProps: {
|
|
33
|
-
vertical: orientation === 'vertical',
|
|
34
|
-
horizontal: orientation !== 'vertical',
|
|
21
|
+
const GroupContainer = aggregatedClasses('div')(blockName, null, _ref => {
|
|
22
|
+
let {
|
|
23
|
+
vertical,
|
|
24
|
+
horizontal,
|
|
35
25
|
spacing
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
} = _ref;
|
|
27
|
+
return {
|
|
28
|
+
vertical,
|
|
29
|
+
horizontal,
|
|
30
|
+
[spacing]: spacing
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const DSButtonGroup = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
size,
|
|
39
37
|
buttonType,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
orientation,
|
|
39
|
+
spacing,
|
|
40
|
+
children: buttons,
|
|
41
|
+
containerProps
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return /*#__PURE__*/jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
44
|
+
classProps: {
|
|
45
|
+
vertical: orientation === 'vertical',
|
|
46
|
+
horizontal: orientation !== 'vertical',
|
|
47
|
+
spacing
|
|
48
|
+
}
|
|
49
|
+
}, containerProps), {}, {
|
|
50
|
+
children: React.Children.map(buttons, button => /*#__PURE__*/React.cloneElement(button, _objectSpread({
|
|
51
|
+
buttonType,
|
|
52
|
+
size
|
|
53
|
+
}, button.props)), null)
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
43
56
|
|
|
44
57
|
DSButtonGroup.defaultProps = {
|
|
45
58
|
size: 'm',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-button-group",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Button Group",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -40,9 +40,14 @@
|
|
|
40
40
|
"build": "node ../../scripts/build/build.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-button": "2.0.0-
|
|
44
|
-
"@elliemae/ds-classnames": "2.0.0-
|
|
45
|
-
"
|
|
43
|
+
"@elliemae/ds-button": "2.0.0-rc.10",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-rc.10",
|
|
45
|
+
"@elliemae/ds-shared": "2.0.0-rc.10",
|
|
46
|
+
"react-desc": "~4.1.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
50
|
+
"@testing-library/react": "~12.1.2"
|
|
46
51
|
},
|
|
47
52
|
"peerDependencies": {
|
|
48
53
|
"react": "^17.0.2",
|
package/types/DSButtonGroup.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSButtonGroup: {
|
|
3
4
|
({ size, buttonType, orientation, spacing, children: buttons, containerProps, }: {
|
|
@@ -19,29 +20,70 @@ declare const DSButtonGroup: {
|
|
|
19
20
|
};
|
|
20
21
|
propTypes: {
|
|
21
22
|
/** props injected to wrapper of page header */
|
|
22
|
-
containerProps:
|
|
23
|
+
containerProps: {
|
|
24
|
+
defaultValue<T = unknown>(arg: T): {
|
|
25
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
23
29
|
/**
|
|
24
30
|
* ['s', 'm', 'l']
|
|
25
31
|
*/
|
|
26
|
-
size:
|
|
32
|
+
size: {
|
|
33
|
+
defaultValue<T = unknown>(arg: T): {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
27
38
|
/**
|
|
28
39
|
* ['primary', 'secondary', 'text', 'link']
|
|
29
40
|
*/
|
|
30
|
-
buttonType:
|
|
41
|
+
buttonType: {
|
|
42
|
+
defaultValue<T = unknown>(arg: T): {
|
|
43
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
46
|
+
};
|
|
31
47
|
/**
|
|
32
48
|
* ['horizontal', 'vertical']
|
|
33
49
|
*/
|
|
34
|
-
orientation:
|
|
50
|
+
orientation: {
|
|
51
|
+
defaultValue<T = unknown>(arg: T): {
|
|
52
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
54
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
55
|
+
};
|
|
35
56
|
/**
|
|
36
57
|
* ['s', 'm', 'l']
|
|
37
58
|
*/
|
|
38
|
-
spacing:
|
|
59
|
+
spacing: {
|
|
60
|
+
defaultValue<T = unknown>(arg: T): {
|
|
61
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
64
|
+
};
|
|
39
65
|
/**
|
|
40
66
|
* Button group items to show of type DSButton
|
|
41
67
|
*/
|
|
42
|
-
children:
|
|
68
|
+
children: {
|
|
69
|
+
defaultValue<T = unknown>(arg: T): {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
72
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
73
|
+
};
|
|
43
74
|
};
|
|
44
75
|
};
|
|
45
|
-
declare const DSButtonGroupWithSchema:
|
|
76
|
+
declare const DSButtonGroupWithSchema: {
|
|
77
|
+
(props?: {
|
|
78
|
+
size: any;
|
|
79
|
+
buttonType: any;
|
|
80
|
+
orientation: any;
|
|
81
|
+
spacing: any;
|
|
82
|
+
children: any;
|
|
83
|
+
containerProps: any;
|
|
84
|
+
} | undefined): JSX.Element;
|
|
85
|
+
propTypes: unknown;
|
|
86
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
87
|
+
};
|
|
46
88
|
export { DSButtonGroup, DSButtonGroupWithSchema };
|
|
47
89
|
export default DSButtonGroup;
|