@decisiv/ui-components 2.0.1-alpha.84 → 2.0.1-alpha.97
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/lib/atoms/BooleanInput/types.js +5 -1
- package/lib/atoms/Calendar/types.js +5 -1
- package/lib/atoms/OptionsList/types.js +5 -1
- package/lib/components/Accordion/types.js +5 -1
- package/lib/components/Accordion/useAccordion/types.js +5 -1
- package/lib/components/Avatar/types.js +5 -1
- package/lib/components/Badge/constants.d.ts +2 -0
- package/lib/components/Badge/constants.d.ts.map +1 -0
- package/lib/components/Badge/constants.js +29 -0
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +12 -23
- package/lib/components/Badge/index.test.js +51 -8
- package/lib/components/Badge/schema.js +1 -1
- package/lib/components/Badge/types.d.ts +1 -1
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +7 -3
- package/lib/components/Breadcrumbs/types.js +5 -1
- package/lib/components/Button/types.js +5 -1
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +11 -1
- package/lib/components/Combobox/types.js +5 -1
- package/lib/components/Filter/types.js +5 -1
- package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +3 -3
- package/lib/components/JumpTo/types.js +5 -1
- package/lib/components/LeftNav/Item/types.js +5 -1
- package/lib/components/LeftNav/types.js +5 -1
- package/lib/components/Link/index.d.ts +2 -2
- package/lib/components/Link/index.d.ts.map +1 -1
- package/lib/components/Link/index.js +1 -1
- package/lib/components/Link/index.test.js +8 -0
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +1 -1
- package/lib/components/Menu/types.js +5 -1
- package/lib/components/Modal/types.js +5 -1
- package/lib/components/Pagination/types.js +5 -1
- package/lib/components/Select/types.js +5 -1
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +11 -1
- package/lib/components/SelectDate/types.js +5 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +11 -1
- package/lib/components/SelectDateRange/types.js +5 -1
- package/lib/components/Table/HeaderCell/types.js +5 -1
- package/lib/components/Tabs/types.js +5 -1
- package/lib/components/Tag/types.js +5 -1
- package/lib/components/Toggle/types.js +5 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/constants.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAKzC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sizeStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
/* eslint-disable import/prefer-default-export */
|
|
13
|
+
var makeSizeStyles = function makeSizeStyles(size) {
|
|
14
|
+
var value = (0, _rem.default)(size);
|
|
15
|
+
return {
|
|
16
|
+
width: value,
|
|
17
|
+
minWidth: value,
|
|
18
|
+
height: value,
|
|
19
|
+
minHeight: value
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var sizeStyles = {
|
|
24
|
+
'small.square': makeSizeStyles(20),
|
|
25
|
+
'medium.round': makeSizeStyles(36),
|
|
26
|
+
'medium.square': makeSizeStyles(30),
|
|
27
|
+
'large.round': makeSizeStyles(60)
|
|
28
|
+
};
|
|
29
|
+
exports.sizeStyles = sizeStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAmB,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAQvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAsDhC,QAAA,MAAM,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,UAAU,CAE9D,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -17,8 +17,6 @@ Object.defineProperty(exports, "BadgeProps", {
|
|
|
17
17
|
});
|
|
18
18
|
exports.default = void 0;
|
|
19
19
|
|
|
20
|
-
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
21
|
-
|
|
22
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
21
|
|
|
24
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
@@ -27,16 +25,18 @@ var _styledComponentsModifiers = require("styled-components-modifiers");
|
|
|
27
25
|
|
|
28
26
|
var _color = _interopRequireDefault(require("../../modifiers/color"));
|
|
29
27
|
|
|
28
|
+
var _constants = require("./constants");
|
|
29
|
+
|
|
30
30
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
31
31
|
|
|
32
32
|
var _utils = require("../../utils");
|
|
33
33
|
|
|
34
34
|
var _types = require("./types");
|
|
35
35
|
|
|
36
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
37
|
-
|
|
38
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
37
|
|
|
38
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
39
|
+
|
|
40
40
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
41
|
|
|
42
42
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -48,32 +48,21 @@ var colorModifiers = (0, _utils.applyDynamicModifiers)('color', function (_ref)
|
|
|
48
48
|
return (0, _styledComponents.css)(["", ""], color && color in _commonUIColors.commonUIColors && (0, _color.default)(_commonUIColors.commonUIColors[color]));
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
var makeSizeStyles = function makeSizeStyles(size) {
|
|
52
|
-
return {
|
|
53
|
-
width: (0, _rem.default)(size),
|
|
54
|
-
minWidth: (0, _rem.default)(size),
|
|
55
|
-
height: (0, _rem.default)(size),
|
|
56
|
-
minHeight: (0, _rem.default)(size)
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var sizeStyles = {
|
|
61
|
-
'medium.round': makeSizeStyles(36),
|
|
62
|
-
'medium.square': makeSizeStyles(30),
|
|
63
|
-
'large.round': makeSizeStyles(60)
|
|
64
|
-
};
|
|
65
|
-
|
|
66
51
|
var getSizeStyles = function getSizeStyles(key) {
|
|
67
|
-
return (0, _styledComponents.css)(sizeStyles[key] || '');
|
|
52
|
+
return (0, _styledComponents.css)(_constants.sizeStyles[key] || '');
|
|
68
53
|
};
|
|
69
54
|
|
|
70
55
|
var sizeModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
|
|
71
|
-
|
|
56
|
+
small: function small(_ref2) {
|
|
72
57
|
var v = _ref2.variant;
|
|
73
|
-
return getSizeStyles("
|
|
58
|
+
return getSizeStyles("small.".concat(v));
|
|
74
59
|
},
|
|
75
|
-
|
|
60
|
+
medium: function medium(_ref3) {
|
|
76
61
|
var v = _ref3.variant;
|
|
62
|
+
return getSizeStyles("medium.".concat(v));
|
|
63
|
+
},
|
|
64
|
+
large: function large(_ref4) {
|
|
65
|
+
var v = _ref4.variant;
|
|
77
66
|
return getSizeStyles("large.".concat(v));
|
|
78
67
|
}
|
|
79
68
|
}, 'size');
|
|
@@ -10,6 +10,8 @@ var _Home = _interopRequireDefault(require("@decisiv/iconix/lib/components/Home"
|
|
|
10
10
|
|
|
11
11
|
var _ = _interopRequireDefault(require("."));
|
|
12
12
|
|
|
13
|
+
var _constants = require("./constants");
|
|
14
|
+
|
|
13
15
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
14
16
|
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -53,16 +55,25 @@ describe('Badge', function () {
|
|
|
53
55
|
expect(container).toMatchSnapshot();
|
|
54
56
|
});
|
|
55
57
|
});
|
|
58
|
+
it("renders correctly with size=\"small\" and variant=\"square\"", function () {
|
|
59
|
+
var _renderBadge3 = renderBadge({
|
|
60
|
+
size: 'small',
|
|
61
|
+
variant: 'square'
|
|
62
|
+
}),
|
|
63
|
+
container = _renderBadge3.container;
|
|
64
|
+
|
|
65
|
+
expect(container).toMatchSnapshot();
|
|
66
|
+
});
|
|
56
67
|
it('renders correctly in any of the common UI colors', function () {
|
|
57
68
|
Object.entries(_commonUIColors.commonUIColors).forEach(function (_ref) {
|
|
58
69
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
59
70
|
key = _ref2[0],
|
|
60
71
|
value = _ref2[1];
|
|
61
72
|
|
|
62
|
-
var
|
|
73
|
+
var _renderBadge4 = renderBadge({
|
|
63
74
|
color: key
|
|
64
75
|
}),
|
|
65
|
-
container =
|
|
76
|
+
container = _renderBadge4.container;
|
|
66
77
|
|
|
67
78
|
expect(container.firstChild).toHaveStyleRule('background-color', (0, _toColorString.default)(value));
|
|
68
79
|
});
|
|
@@ -75,12 +86,44 @@ describe('Badge', function () {
|
|
|
75
86
|
// @ts-ignore
|
|
76
87
|
console.error.mockRestore();
|
|
77
88
|
});
|
|
78
|
-
it('warns
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
it('warns for invalid size/variant combinations', function () {
|
|
90
|
+
var sizes = ['small', 'medium', 'large'];
|
|
91
|
+
var variants = ['round', 'square'];
|
|
92
|
+
var validCombinations = Object.keys(_constants.sizeStyles);
|
|
93
|
+
|
|
94
|
+
for (var _i2 = 0, _sizes = sizes; _i2 < _sizes.length; _i2++) {
|
|
95
|
+
var size = _sizes[_i2];
|
|
96
|
+
var _iteratorNormalCompletion = true;
|
|
97
|
+
var _didIteratorError = false;
|
|
98
|
+
var _iteratorError = undefined;
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
for (var _iterator = variants[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
102
|
+
var variant = _step.value;
|
|
103
|
+
|
|
104
|
+
if (!validCombinations.includes("".concat(size, ".").concat(variant))) {
|
|
105
|
+
renderBadge({
|
|
106
|
+
size: size,
|
|
107
|
+
variant: variant
|
|
108
|
+
});
|
|
109
|
+
expect(console.error).toHaveBeenCalledWith("Warning: Failed prop type: The Badge component does not support the '".concat(size, "' size and '").concat(variant, "' variant props combination.\n in Badge"));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} catch (err) {
|
|
113
|
+
_didIteratorError = true;
|
|
114
|
+
_iteratorError = err;
|
|
115
|
+
} finally {
|
|
116
|
+
try {
|
|
117
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
118
|
+
_iterator.return();
|
|
119
|
+
}
|
|
120
|
+
} finally {
|
|
121
|
+
if (_didIteratorError) {
|
|
122
|
+
throw _iteratorError;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
84
127
|
});
|
|
85
128
|
});
|
|
86
129
|
});
|
|
@@ -15,7 +15,7 @@ schema.propTypes = {
|
|
|
15
15
|
'aria-label': _reactDesc.PropTypes.string.description('Descriptive text for accessibility purposes').isRequired,
|
|
16
16
|
color: _reactDesc.PropTypes.string.description('(See note) Sets the color for the background and the icon').defaultValue('information'),
|
|
17
17
|
icon: _reactDesc.PropTypes.element.description('Must be an icon component from `@decisiv/iconix`').isRequired,
|
|
18
|
-
size: _reactDesc.PropTypes.oneOf(['medium', 'large']).description('(See note) Sets the size of the badge').defaultValue('medium'),
|
|
18
|
+
size: _reactDesc.PropTypes.oneOf(['small', 'medium', 'large']).description('(See note) Sets the size of the badge').defaultValue('medium'),
|
|
19
19
|
variant: _reactDesc.PropTypes.oneOf(['round', 'square']).description('(See note) Controls primary style variations of the badge').defaultValue('round')
|
|
20
20
|
};
|
|
21
21
|
var _default = schema;
|
|
@@ -8,7 +8,7 @@ export interface BadgeProps {
|
|
|
8
8
|
'aria-label': string;
|
|
9
9
|
color?: CommonUIColorKeys;
|
|
10
10
|
icon: IconComponent;
|
|
11
|
-
size?: 'medium' | 'large';
|
|
11
|
+
size?: 'small' | 'medium' | 'large';
|
|
12
12
|
variant?: 'round' | 'square';
|
|
13
13
|
}
|
|
14
14
|
declare function variantValidator(props: BadgeProps, propName: 'variant', componentName: 'Badge'): Error | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAIpC,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,oBAAY,QAAQ,GAAG,cAAc,CAAC;AAItC,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9B;AAED,iBAAS,gBAAgB,CACvB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,SAAS,EACnB,aAAa,EAAE,OAAO,GACrB,KAAK,GAAG,IAAI,CAqBd;AAED,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
|
|
@@ -9,15 +9,19 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
|
|
10
10
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
11
11
|
|
|
12
|
+
var _constants = require("./constants");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
16
|
+
var validSizeVariantCombinations = Object.keys(_constants.sizeStyles);
|
|
17
|
+
|
|
14
18
|
function variantValidator(props, propName, componentName) {
|
|
15
19
|
if (process.env.NODE_ENV !== 'production') {
|
|
16
20
|
var size = props.size,
|
|
17
21
|
variant = props[propName];
|
|
18
22
|
|
|
19
|
-
if (size
|
|
20
|
-
return Error("The
|
|
23
|
+
if (!validSizeVariantCombinations.includes("".concat(size, ".").concat(variant))) {
|
|
24
|
+
return Error("The Badge component does not support the '".concat(size, "' size and '").concat(variant, "' variant props combination."));
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
_propTypes.default.checkPropTypes({
|
|
@@ -33,7 +37,7 @@ function variantValidator(props, propName, componentName) {
|
|
|
33
37
|
var propTypes = {
|
|
34
38
|
color: _propTypes.default.oneOf(_commonUIColors.commonUIColorKeys),
|
|
35
39
|
icon: _propTypes.default.elementType.isRequired,
|
|
36
|
-
size: _propTypes.default.oneOf(['medium', 'large']),
|
|
40
|
+
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
37
41
|
variant: variantValidator
|
|
38
42
|
};
|
|
39
43
|
exports.propTypes = propTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/index.tsx"],"names":[],"mappings":"AASA,OAAc,EAGZ,sBAAsB,EAQvB,MAAM,OAAO,CAAC;AA2Bf,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAQ,MAAM,SAAS,CAAC;AAqiBhE,QAAA,MAAM,eAAe,EAAE,sBAAsB,CAC3C,gBAAgB,EAChB,aAAa,CACS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/index.tsx"],"names":[],"mappings":"AASA,OAAc,EAGZ,sBAAsB,EAQvB,MAAM,OAAO,CAAC;AA2Bf,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAQ,MAAM,SAAS,CAAC;AAqiBhE,QAAA,MAAM,eAAe,EAAE,sBAAsB,CAC3C,gBAAgB,EAChB,aAAa,CACS,CAAC;AAOzB,eAAe,eAAe,CAAC"}
|
|
@@ -21,6 +21,8 @@ var _last = _interopRequireDefault(require("lodash/last"));
|
|
|
21
21
|
|
|
22
22
|
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
23
23
|
|
|
24
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
+
|
|
24
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
25
27
|
|
|
26
28
|
var _breakpointObserver = require("@decisiv/breakpoint-observer");
|
|
@@ -63,6 +65,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
63
65
|
|
|
64
66
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
65
67
|
|
|
68
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
69
|
+
|
|
70
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
71
|
+
|
|
72
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
73
|
+
|
|
66
74
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
67
75
|
|
|
68
76
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
@@ -555,6 +563,8 @@ function Combobox(props, ref) {
|
|
|
555
563
|
}
|
|
556
564
|
|
|
557
565
|
var ComboboxWithRef = (0, _react.forwardRef)(Combobox);
|
|
558
|
-
ComboboxWithRef.propTypes = _schema.default.propTypes
|
|
566
|
+
ComboboxWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
567
|
+
icon: _propTypes.default.elementType
|
|
568
|
+
});
|
|
559
569
|
var _default = ComboboxWithRef;
|
|
560
570
|
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { JumpToProps, JumpToRef } from './types';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const JumpToMenuWithRef: React.ForwardRefExoticComponent<JumpToProps & React.RefAttributes<JumpToRef>>;
|
|
4
|
+
export default JumpToMenuWithRef;
|
|
5
5
|
//# sourceMappingURL=JumpToMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JumpToMenu.d.ts","sourceRoot":"","sources":["../../../src/components/JumpTo/JumpToMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JumpToMenu.d.ts","sourceRoot":"","sources":["../../../src/components/JumpTo/JumpToMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAa9E,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiH7D,QAAA,MAAM,iBAAiB,+EAAyB,CAAC;AAKjD,eAAe,iBAAiB,CAAC"}
|
|
@@ -136,8 +136,8 @@ function JumpToMenu(props, forwardedRef) {
|
|
|
136
136
|
}, rest))));
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
var
|
|
139
|
+
var JumpToMenuWithRef = (0, _react.forwardRef)(JumpToMenu); // @ts-ignore
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
var _default =
|
|
141
|
+
JumpToMenuWithRef.propTypes = _schema.default.propTypes;
|
|
142
|
+
var _default = JumpToMenuWithRef;
|
|
143
143
|
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RgbaColor, RgbColor } from 'polished/lib/types/color';
|
|
2
|
-
import { ComponentPropsWithRef, RefForwardingComponent } from 'react';
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode, RefForwardingComponent } from 'react';
|
|
3
3
|
import { FlattenSimpleInterpolation } from 'styled-components';
|
|
4
4
|
import { IconProps } from '@decisiv/iconix';
|
|
5
5
|
import { LinkRendererRef } from '../../providers/ConfigProvider';
|
|
@@ -14,7 +14,7 @@ export interface LinkProps extends ComponentPropsWithRef<'a'> {
|
|
|
14
14
|
icon?: IconComponent;
|
|
15
15
|
iconPosition?: IconPosition;
|
|
16
16
|
size?: LinkSize;
|
|
17
|
-
text?: string;
|
|
17
|
+
text?: string | ReactNode;
|
|
18
18
|
to: string;
|
|
19
19
|
variant?: LinkVariant;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAc,EACZ,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAc,EACZ,qBAAqB,EACrB,SAAS,EAET,sBAAsB,EAGvB,MAAM,OAAO,CAAC;AACf,OAAe,EACb,0BAA0B,EAI3B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,oBAAY,OAAO,GAAG,eAAe,CAAC;AACtC,oBAAY,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC1C,oBAAY,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5C,oBAAY,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEhD,aAAK,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAClC,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,GAAG,CAAC;IAC3D,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAyBD,wBAAgB,eAAe,CAC7B,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,KAAK,EACjB,WAAW,CAAC,EAAE;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,KAAK,CAAA;CAAE,GAC7C,0BAA0B,CAsC5B;AA0ID,QAAA,MAAM,WAAW,EAAE,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAE3D,CAAC;AAwBF,eAAe,WAAW,CAAC"}
|
|
@@ -195,7 +195,7 @@ LinkWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
195
195
|
return (0, _isEmpty.default)(text);
|
|
196
196
|
}),
|
|
197
197
|
icon: _propTypes.default.elementType,
|
|
198
|
-
text: (0, _propTypes2.requireIf)(_propTypes.default.string, function (_ref2) {
|
|
198
|
+
text: (0, _propTypes2.requireIf)(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]), function (_ref2) {
|
|
199
199
|
var icon = _ref2.icon;
|
|
200
200
|
return (0, _isEmpty.default)(icon);
|
|
201
201
|
})
|
|
@@ -63,4 +63,12 @@ describe('Link', function () {
|
|
|
63
63
|
|
|
64
64
|
expect(container).toMatchSnapshot();
|
|
65
65
|
});
|
|
66
|
+
it('correctly renders with text as HTML', function () {
|
|
67
|
+
var _renderLink5 = renderLink({
|
|
68
|
+
text: _react.default.createElement("span", null, "link with", _react.default.createElement("strong", null, "HTML"))
|
|
69
|
+
}),
|
|
70
|
+
container = _renderLink5.container;
|
|
71
|
+
|
|
72
|
+
expect(container).toMatchSnapshot();
|
|
73
|
+
});
|
|
66
74
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Link/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Link/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,cAsBlC,CAAC;AAEH,QAAA,MAAM,MAAM,KAAoC,CAAC;AAIjD,eAAe,MAAM,CAAC"}
|
|
@@ -11,7 +11,7 @@ var _reactDesc = require("react-desc");
|
|
|
11
11
|
var makeLinkSchemaPropTypes = function makeLinkSchemaPropTypes() {
|
|
12
12
|
return {
|
|
13
13
|
to: _reactDesc.PropTypes.string.description('Where to navigate when the link is clicked.').isRequired,
|
|
14
|
-
text: _reactDesc.PropTypes.string.description("The link's text."),
|
|
14
|
+
text: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.string, _reactDesc.PropTypes.node]).description("The link's inline text content. Required if no icon is provided."),
|
|
15
15
|
size: _reactDesc.PropTypes.oneOf(['small', 'medium']).description("The size in which to render the link's text and icon").defaultValue('medium'),
|
|
16
16
|
icon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render.'),
|
|
17
17
|
iconPosition: _reactDesc.PropTypes.oneOf(['left', 'right']).description('In which side of the text the icon should be rendered.').defaultValue('left'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectDate/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectDate/index.tsx"],"names":[],"mappings":"AAMA,OAAc,EAEZ,sBAAsB,EAMvB,MAAM,OAAO,CAAC;AAsBf,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAQ,MAAM,SAAS,CAAC;AAIjE,OAAO,EACL,SAAS,EACT,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAiQxC,QAAA,MAAM,iBAAiB,EAAE,sBAAsB,CAC7C,cAAc,EACd,gBAAgB,CACQ,CAAC;AAQ3B,eAAe,iBAAiB,CAAC"}
|
|
@@ -25,6 +25,8 @@ var _isDate = _interopRequireDefault(require("lodash/isDate"));
|
|
|
25
25
|
|
|
26
26
|
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
27
27
|
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
+
|
|
28
30
|
var _react = _interopRequireWildcard(require("react"));
|
|
29
31
|
|
|
30
32
|
var _breakpointObserver = require("@decisiv/breakpoint-observer");
|
|
@@ -65,6 +67,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
65
67
|
|
|
66
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
67
69
|
|
|
70
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
71
|
+
|
|
72
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
73
|
+
|
|
74
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
75
|
+
|
|
68
76
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
69
77
|
|
|
70
78
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -298,7 +306,9 @@ function SelectDate(props, ref) {
|
|
|
298
306
|
}
|
|
299
307
|
|
|
300
308
|
var SelectDateWithRef = (0, _react.forwardRef)(SelectDate);
|
|
301
|
-
SelectDateWithRef.propTypes = _schema.default.propTypes
|
|
309
|
+
SelectDateWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
310
|
+
icon: _propTypes.default.elementType
|
|
311
|
+
});
|
|
302
312
|
SelectDateWithRef.displayName = 'SelectDate';
|
|
303
313
|
var _default = SelectDateWithRef;
|
|
304
314
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectDateRange/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectDateRange/index.tsx"],"names":[],"mappings":"AAKA,OAAc,EAEZ,sBAAsB,EAMvB,MAAM,OAAO,CAAC;AAyBf,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAQ,MAAM,SAAS,CAAC;AAI3E,OAAO,EACL,SAAS,EACT,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AA0TxC,QAAA,MAAM,sBAAsB,EAAE,sBAAsB,CAClD,mBAAmB,EACnB,qBAAqB,CACQ,CAAC;AAQhC,eAAe,sBAAsB,CAAC"}
|
|
@@ -23,6 +23,8 @@ var _get = _interopRequireDefault(require("lodash/get"));
|
|
|
23
23
|
|
|
24
24
|
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
25
25
|
|
|
26
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
+
|
|
26
28
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
29
|
|
|
28
30
|
var _breakpointObserver = require("@decisiv/breakpoint-observer");
|
|
@@ -69,6 +71,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
69
71
|
|
|
70
72
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
71
73
|
|
|
74
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
75
|
+
|
|
76
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
77
|
+
|
|
78
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
79
|
+
|
|
72
80
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
73
81
|
|
|
74
82
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -344,7 +352,9 @@ function SelectDateRange(props, ref) {
|
|
|
344
352
|
}
|
|
345
353
|
|
|
346
354
|
var SelectDateRangeWithRef = (0, _react.forwardRef)(SelectDateRange);
|
|
347
|
-
SelectDateRangeWithRef.propTypes = _schema.default.propTypes
|
|
355
|
+
SelectDateRangeWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
356
|
+
icon: _propTypes.default.elementType
|
|
357
|
+
});
|
|
348
358
|
SelectDateRangeWithRef.displayName = 'SelectDateRange';
|
|
349
359
|
var _default = SelectDateRangeWithRef;
|
|
350
360
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decisiv/ui-components",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.97+e8c90c8",
|
|
4
4
|
"description": "Decisiv's design system React components",
|
|
5
5
|
"author": "Decisiv UI Development Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
73
|
"private": false,
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e8c90c851847fdda5d1dbc8339d962d4bf79d185"
|
|
75
75
|
}
|