@decisiv/ui-components 2.0.1-alpha.183 → 2.0.1-alpha.185
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/OptionsList/types.d.ts +1 -1
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/components/Badge/types.d.ts +1 -1
- package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
- package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
- package/lib/components/Filter/ActionFilter/index.js +43 -0
- package/lib/components/Filter/IconWrapper/index.d.ts +2 -2
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.d.ts +2 -28
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.js +10 -21
- package/lib/components/Filter/StyledFilter.d.ts +2 -2
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -1
- package/lib/components/Filter/StyledFilter.js +17 -1
- package/lib/components/Filter/StyledLabel/index.d.ts +3 -3
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -1
- package/lib/components/Filter/StyledLabel/index.js +14 -6
- package/lib/components/Filter/index.d.ts +3 -2
- package/lib/components/Filter/index.d.ts.map +1 -1
- package/lib/components/Filter/index.js +28 -28
- package/lib/components/Filter/index.test.js +1 -5
- package/lib/components/Filter/kind.d.ts +4 -3
- package/lib/components/Filter/kind.d.ts.map +1 -1
- package/lib/components/Filter/kind.js +19 -21
- package/lib/components/Filter/schema.d.ts.map +1 -1
- package/lib/components/Filter/schema.js +7 -3
- package/lib/components/Filter/types.d.ts +21 -8
- package/lib/components/Filter/types.d.ts.map +1 -1
- package/lib/components/StepTracker/index.d.ts +11 -0
- package/lib/components/StepTracker/index.d.ts.map +1 -0
- package/lib/components/StepTracker/index.js +56 -0
- package/lib/components/StepTracker/index.test.js +89 -0
- package/lib/components/StepTracker/schema.d.ts +3 -0
- package/lib/components/StepTracker/schema.d.ts.map +1 -0
- package/lib/components/StepTracker/schema.js +19 -0
- package/lib/components/StepTracker/styles.d.ts +605 -0
- package/lib/components/StepTracker/styles.d.ts.map +1 -0
- package/lib/components/StepTracker/styles.js +114 -0
- package/lib/components/Tag/propTypes.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +16 -0
- package/lib/utils/commonUIColors.d.ts +1 -1
- package/lib/utils/commonUIColors.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC;AAClE,oBAAY,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpE,oBAAY,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAC3D,oBAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAClD,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE1C,oBAAY,qBAAqB,GAAG,IAAI,CACtC,eAAe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AgB,CAAC;AAEvD,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;IAC7C,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -14,7 +14,7 @@ export interface BadgeProps {
|
|
|
14
14
|
}
|
|
15
15
|
declare function variantValidator(props: BadgeProps, propName: 'variant', componentName: 'Badge'): Error | null;
|
|
16
16
|
export declare const propTypes: {
|
|
17
|
-
color: PropTypes.Requireable<
|
|
17
|
+
color: PropTypes.Requireable<"information" | "success" | "warning" | "danger" | "berryCrisp" | "koolaidCake" | "cookieMonster" | "cottonCandy" | "fizzyLime" | "mamboMango" | "carrotCake" | "roseGummy" | "licoriceMousse">;
|
|
18
18
|
icon: PropTypes.Validator<PropTypes.ReactComponentLike>;
|
|
19
19
|
size: PropTypes.Requireable<string>;
|
|
20
20
|
variant: typeof variantValidator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionFilterProps } from '../types';
|
|
3
|
+
declare const ActionFilter: ({ active, kind, text, count, startIcon: StartIcon, endIcon: EndIcon, }: ActionFilterProps) => JSX.Element;
|
|
4
|
+
export default ActionFilter;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/ActionFilter/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,QAAA,MAAM,YAAY,4GA2BjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _StyledLabel = _interopRequireDefault(require("../StyledLabel"));
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var ActionFilter = function ActionFilter(_ref) {
|
|
17
|
+
var _ref$active = _ref.active,
|
|
18
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
19
|
+
_ref$kind = _ref.kind,
|
|
20
|
+
kind = _ref$kind === void 0 ? 'primary' : _ref$kind,
|
|
21
|
+
text = _ref.text,
|
|
22
|
+
count = _ref.count,
|
|
23
|
+
StartIcon = _ref.startIcon,
|
|
24
|
+
EndIcon = _ref.endIcon;
|
|
25
|
+
var buttonText = count ? "".concat(text, " ").concat(count) : text;
|
|
26
|
+
return _react.default.createElement(_react.default.Fragment, null, StartIcon && _react.default.createElement(_.Flex, {
|
|
27
|
+
paddingRight: 0.5
|
|
28
|
+
}, _react.default.createElement(StartIcon, {
|
|
29
|
+
size: "small",
|
|
30
|
+
role: "img"
|
|
31
|
+
})), _react.default.createElement(_StyledLabel.default, {
|
|
32
|
+
kind: kind,
|
|
33
|
+
active: active
|
|
34
|
+
}, buttonText), EndIcon && _react.default.createElement(_.Flex, {
|
|
35
|
+
paddingLeft: 0.5
|
|
36
|
+
}, _react.default.createElement(EndIcon, {
|
|
37
|
+
size: "small",
|
|
38
|
+
role: "img"
|
|
39
|
+
})));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = ActionFilter;
|
|
43
|
+
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { SimpleFilterProps } from '../types';
|
|
3
3
|
declare const IconWrapper: import("styled-components").StyledComponent<"div", any, Partial<{
|
|
4
4
|
readonly alignContent?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
5
5
|
readonly XS: "XS";
|
|
@@ -192,6 +192,6 @@ declare const IconWrapper: import("styled-components").StyledComponent<"div", an
|
|
|
192
192
|
readonly LG: "LG";
|
|
193
193
|
readonly XL: "XL";
|
|
194
194
|
}>;
|
|
195
|
-
}> & Pick<
|
|
195
|
+
}> & Pick<SimpleFilterProps, "badgeColor">, never>;
|
|
196
196
|
export default IconWrapper;
|
|
197
197
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/IconWrapper/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/IconWrapper/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgB7C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAOhB,CAAC;AACF,eAAe,WAAW,CAAC"}
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { CommonUIColorKeys } from '../../../utils/commonUIColors';
|
|
5
|
-
declare type IconComponent = (props: IconProps) => JSX.Element;
|
|
6
|
-
interface Props {
|
|
7
|
-
'aria-label': string;
|
|
8
|
-
active: boolean;
|
|
9
|
-
text: string;
|
|
10
|
-
count: number;
|
|
11
|
-
badgeIcon?: IconComponent;
|
|
12
|
-
badgeColor?: CommonUIColorKeys;
|
|
13
|
-
}
|
|
14
|
-
declare const FilterSimplePrimary: {
|
|
15
|
-
({ "aria-label": ariaLabel, active, text, badgeIcon: Icon, badgeColor, count, }: Props): JSX.Element;
|
|
16
|
-
propTypes: {
|
|
17
|
-
active: PropTypes.Requireable<boolean>;
|
|
18
|
-
count: PropTypes.Requireable<number>;
|
|
19
|
-
text: PropTypes.Validator<string>;
|
|
20
|
-
badgeColor: PropTypes.Requireable<string>;
|
|
21
|
-
badgeIcon: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
22
|
-
};
|
|
23
|
-
defaultProps: {
|
|
24
|
-
active: null;
|
|
25
|
-
count: undefined;
|
|
26
|
-
badgeColor: string;
|
|
27
|
-
badgeIcon: null;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
2
|
+
import { SimpleFilterProps } from '../types';
|
|
3
|
+
declare const FilterSimplePrimary: ({ "aria-label": ariaLabel, active, disabled, kind, text, badgeIcon: Icon, badgeColor, count, }: SimpleFilterProps) => JSX.Element;
|
|
30
4
|
export default FilterSimplePrimary;
|
|
31
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/SimplePrimary/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/SimplePrimary/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,QAAA,MAAM,mBAAmB,oIA4BxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -7,11 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
13
|
-
|
|
14
|
-
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
10
|
+
var _visualInterest = require("@decisiv/design-tokens/lib/color/visual-interest");
|
|
15
11
|
|
|
16
12
|
var _IconWrapper = _interopRequireDefault(require("../IconWrapper"));
|
|
17
13
|
|
|
@@ -21,38 +17,31 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
17
|
|
|
22
18
|
var FilterSimplePrimary = function FilterSimplePrimary(_ref) {
|
|
23
19
|
var ariaLabel = _ref['aria-label'],
|
|
24
|
-
active = _ref.active,
|
|
20
|
+
_ref$active = _ref.active,
|
|
21
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
22
|
+
_ref$disabled = _ref.disabled,
|
|
23
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
24
|
+
kind = _ref.kind,
|
|
25
25
|
text = _ref.text,
|
|
26
26
|
Icon = _ref.badgeIcon,
|
|
27
27
|
_ref$badgeColor = _ref.badgeColor,
|
|
28
28
|
badgeColor = _ref$badgeColor === void 0 ? 'information' : _ref$badgeColor,
|
|
29
29
|
count = _ref.count;
|
|
30
|
-
var buttonText =
|
|
30
|
+
var buttonText = count ? "".concat(count, " ").concat(text) : text;
|
|
31
|
+
var colorForBadge = disabled ? _visualInterest.VisualInterestColorName.licoriceMousse : badgeColor;
|
|
31
32
|
return _react.default.createElement(_react.default.Fragment, null, Icon && _react.default.createElement(_IconWrapper.default, {
|
|
32
|
-
badgeColor:
|
|
33
|
+
badgeColor: colorForBadge
|
|
33
34
|
}, _react.default.createElement(Icon, {
|
|
34
35
|
size: "small",
|
|
35
36
|
role: "img",
|
|
36
37
|
"aria-label": ariaLabel
|
|
37
38
|
})), _react.default.createElement(_StyledLabel.default, {
|
|
38
39
|
active: active,
|
|
40
|
+
kind: kind,
|
|
39
41
|
hasBadge: !!Icon,
|
|
40
42
|
marginLeft: 1
|
|
41
43
|
}, buttonText));
|
|
42
44
|
};
|
|
43
45
|
|
|
44
|
-
FilterSimplePrimary.propTypes = {
|
|
45
|
-
active: _propTypes.default.bool,
|
|
46
|
-
count: _propTypes.default.number,
|
|
47
|
-
text: _propTypes.default.string.isRequired,
|
|
48
|
-
badgeColor: _propTypes.default.string,
|
|
49
|
-
badgeIcon: _propTypes.default.elementType
|
|
50
|
-
};
|
|
51
|
-
FilterSimplePrimary.defaultProps = {
|
|
52
|
-
active: null,
|
|
53
|
-
count: undefined,
|
|
54
|
-
badgeColor: "".concat((0, _toColorString.default)(_color.default.status.information.medium)),
|
|
55
|
-
badgeIcon: null
|
|
56
|
-
};
|
|
57
46
|
var _default = FilterSimplePrimary;
|
|
58
47
|
exports.default = _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const StyledFilter: import("styled-components").StyledComponent<"button", any,
|
|
1
|
+
import { BaseFilterProps } from './types';
|
|
2
|
+
declare const StyledFilter: import("styled-components").StyledComponent<"button", any, BaseFilterProps, never>;
|
|
3
3
|
export default StyledFilter;
|
|
4
4
|
//# sourceMappingURL=StyledFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledFilter.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/StyledFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StyledFilter.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/StyledFilter.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA4D1C,QAAA,MAAM,YAAY,oFAiDjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
+
var _styledTheming = _interopRequireDefault(require("styled-theming"));
|
|
11
|
+
|
|
10
12
|
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
11
13
|
|
|
12
14
|
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
@@ -25,17 +27,31 @@ var _focusRingWithColor = _interopRequireDefault(require("../../utils/focusRingW
|
|
|
25
27
|
|
|
26
28
|
var _IconWrapper = _interopRequireDefault(require("./IconWrapper"));
|
|
27
29
|
|
|
30
|
+
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
31
|
+
|
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
33
|
|
|
30
34
|
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; } }
|
|
31
35
|
|
|
32
36
|
var activeStyles = (0, _styledComponents.css)(["color:", ";background-color:", ";border:", " solid ", ";svg{color:", ";}"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _toColorString.default)(_color.default.status.information.medium), (0, _rem.default)(1), (0, _toColorString.default)(_color.default.status.information.medium), (0, _toColorString.default)(_color.default.base.snowWhite));
|
|
33
37
|
var focusStyles = (0, _styledComponents.css)(["border:", " solid ", ";", ";"], (0, _rem.default)(1), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _focusRingWithColor.default)(_colors.focusRingColors.light.normal.secondary.shadow));
|
|
38
|
+
var actionVariantStyles = (0, _styledComponents.css)(["border:", " solid transparent;background:transparent;svg{color:", ";}&:hover{border:", " solid transparent;color:", ";background:transparent;svg{color:inherit;}}&:disabled:disabled{border:none;background:transparent;}"], (0, _rem.default)(1), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _rem.default)(1), (0, _toColorString.default)(_color.default.interaction.indianOcean));
|
|
39
|
+
|
|
40
|
+
var variant = _styledTheming.default.variants(_ConfigProvider.themeKeys.mode, 'variant', {
|
|
41
|
+
simple: {
|
|
42
|
+
light: '',
|
|
43
|
+
dark: ''
|
|
44
|
+
},
|
|
45
|
+
action: {
|
|
46
|
+
light: actionVariantStyles,
|
|
47
|
+
dark: actionVariantStyles
|
|
48
|
+
}
|
|
49
|
+
});
|
|
34
50
|
|
|
35
51
|
var StyledFilter = _styledComponents.default.button.withConfig({
|
|
36
52
|
displayName: "StyledFilter",
|
|
37
53
|
componentId: "sc-10cidio-0"
|
|
38
|
-
})(["display:flex;background:none;padding:", " ", ";border:", " solid ", ";border-radius:", ";justify-content:center;align-items:center;outline:none;font:inherit;color:", ";&:
|
|
54
|
+
})(["display:flex;box-sizing:border-box;background:none;padding:", " ", ";border:", " solid ", ";border-radius:", ";justify-content:center;align-items:center;outline:none;font:inherit;color:", ";&:hover{", ";}&:disabled:disabled{background:", ";border:", " solid ", ";&,&:hover{color:", ";cursor:not-allowed;svg{color:", ";}", "{background-color:", ";svg{color:", ";}}}}", ";", ";&:focus{", ";}", ";"], (0, _rem.default)(_spacing.default.base * 0.6), (0, _rem.default)(_spacing.default.base), (0, _rem.default)(1), (0, _toColorString.default)(_color.default.base.quarterMoon), (0, _rem.default)(2), (0, _toColorString.default)(_color.default.interaction.pacificOcean), _kind.hoverStyles, (0, _toColorString.default)(_color.default.opacity.fullMoon50), (0, _rem.default)(1), (0, _toColorString.default)(_color.default.base.quarterMoon), (0, _toColorString.default)(_color.default.opacity.charcoal40), (0, _toColorString.default)(_color.default.opacity.charcoal40), _IconWrapper.default, (0, _toColorString.default)(_color.default.opacity.charcoal15), (0, _toColorString.default)(_color.default.opacity.charcoal40), _kind.default, variant, focusStyles, (0, _styleModifiers.when)('active', activeStyles));
|
|
39
55
|
|
|
40
56
|
var _default = StyledFilter;
|
|
41
57
|
exports.default = _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlexComponentProps } from '../../Flex';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
hasBadge
|
|
2
|
+
import { FilterProps } from '../types';
|
|
3
|
+
interface Props extends FlexComponentProps, Pick<FilterProps, 'active' | 'kind'> {
|
|
4
|
+
hasBadge?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare const StyledLabel: import("styled-components").StyledComponent<"span", any, Props, never>;
|
|
7
7
|
export default StyledLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/StyledLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/StyledLabel/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,UAAU,KACR,SAAQ,kBAAkB,EACxB,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,wEAehB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -11,18 +11,26 @@ var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
|
11
11
|
|
|
12
12
|
var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
|
|
13
13
|
|
|
14
|
+
var _designTokens = require("@decisiv/design-tokens");
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
var StyledLabel = _styledComponents.default.span.withConfig({
|
|
17
19
|
displayName: "StyledLabel",
|
|
18
20
|
componentId: "sc-1r95cia-0"
|
|
19
|
-
})(["
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
})(["font-size:", ";margin-right:", ";margin-left:", ";"], function (_ref) {
|
|
22
|
+
var _ref$kind = _ref.kind,
|
|
23
|
+
kind = _ref$kind === void 0 ? 'primary' : _ref$kind;
|
|
24
|
+
return kind === 'primary' ? (0, _rem.default)(_designTokens.typography.size.alias.default) : (0, _rem.default)(_designTokens.typography.size.alias.paragraph2);
|
|
23
25
|
}, function (_ref2) {
|
|
24
|
-
var hasBadge = _ref2.hasBadge,
|
|
25
|
-
|
|
26
|
+
var _ref2$hasBadge = _ref2.hasBadge,
|
|
27
|
+
hasBadge = _ref2$hasBadge === void 0 ? false : _ref2$hasBadge,
|
|
28
|
+
marginRight = _ref2.marginRight;
|
|
29
|
+
return hasBadge && marginRight ? (0, _rem.default)(_spacing.default.base) : '0';
|
|
30
|
+
}, function (_ref3) {
|
|
31
|
+
var _ref3$hasBadge = _ref3.hasBadge,
|
|
32
|
+
hasBadge = _ref3$hasBadge === void 0 ? false : _ref3$hasBadge,
|
|
33
|
+
marginLeft = _ref3.marginLeft;
|
|
26
34
|
return hasBadge && marginLeft ? (0, _rem.default)(_spacing.default.base) : '0';
|
|
27
35
|
});
|
|
28
36
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const Filter: React.ForwardRefExoticComponent<
|
|
2
|
+
import { SimpleFilterProps, ActionFilterProps } from './types';
|
|
3
|
+
declare const Filter: React.ForwardRefExoticComponent<(ActionFilterProps & React.RefAttributes<HTMLButtonElement>) | (SimpleFilterProps & React.RefAttributes<HTMLButtonElement>)>;
|
|
4
|
+
export { FilterProps } from './types';
|
|
4
5
|
export default Filter;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAe,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAK5E,QAAA,MAAM,MAAM,8JAgDX,CAAC;AA4BF,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,eAAe,MAAM,CAAC"}
|
|
@@ -3,20 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "FilterProps", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _types.FilterProps;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
exports.default = void 0;
|
|
7
13
|
|
|
8
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
15
|
|
|
10
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
17
|
|
|
12
|
-
var _visualInterest = require("@decisiv/design-tokens/lib/color/visual-interest");
|
|
13
|
-
|
|
14
18
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _types = require("./types");
|
|
17
21
|
|
|
18
22
|
var _StyledFilter = _interopRequireDefault(require("./StyledFilter"));
|
|
19
23
|
|
|
24
|
+
var _SimplePrimary = _interopRequireDefault(require("./SimplePrimary"));
|
|
25
|
+
|
|
26
|
+
var _ActionFilter = _interopRequireDefault(require("./ActionFilter"));
|
|
27
|
+
|
|
20
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
29
|
|
|
22
30
|
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; } }
|
|
@@ -35,31 +43,26 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
35
43
|
|
|
36
44
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
45
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
kind = _ref$kind === void 0 ? 'primary' : _ref$kind,
|
|
48
|
-
onClick = _ref.onClick,
|
|
49
|
-
disabled = _ref.disabled,
|
|
50
|
-
_ref$badgeColor = _ref.badgeColor,
|
|
51
|
-
badgeColor = _ref$badgeColor === void 0 ? 'information' : _ref$badgeColor,
|
|
52
|
-
rest = _objectWithoutProperties(_ref, ["active", "variant", "kind", "onClick", "disabled", "badgeColor"]);
|
|
46
|
+
var Filter = (0, _react.forwardRef)(function (props, ref) {
|
|
47
|
+
var filterActive = props.active,
|
|
48
|
+
_props$variant = props.variant,
|
|
49
|
+
variant = _props$variant === void 0 ? 'simple' : _props$variant,
|
|
50
|
+
_props$kind = props.kind,
|
|
51
|
+
kind = _props$kind === void 0 ? 'primary' : _props$kind,
|
|
52
|
+
onClick = props.onClick,
|
|
53
|
+
disabled = props.disabled,
|
|
54
|
+
rest = _objectWithoutProperties(props, ["active", "variant", "kind", "onClick", "disabled"]);
|
|
53
55
|
|
|
54
56
|
var _useState = (0, _react.useState)(false),
|
|
55
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
56
58
|
active = _useState2[0],
|
|
57
59
|
setActive = _useState2[1];
|
|
58
60
|
|
|
59
|
-
var Component = components[variant];
|
|
60
61
|
var toggleStatus = (0, _react.useCallback)(function () {
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
if (variant === 'simple') {
|
|
63
|
+
setActive(!active);
|
|
64
|
+
}
|
|
65
|
+
}, [active, setActive, variant]);
|
|
63
66
|
var handleOnClick = (0, _react.useCallback)(function (e) {
|
|
64
67
|
if (typeof onClick === 'function') {
|
|
65
68
|
onClick(e);
|
|
@@ -70,21 +73,18 @@ var Filter = (0, _react.forwardRef)(function (_ref, ref) {
|
|
|
70
73
|
return _react.default.createElement(_StyledFilter.default, _extends({
|
|
71
74
|
ref: ref,
|
|
72
75
|
kind: kind,
|
|
76
|
+
variant: variant,
|
|
73
77
|
tabIndex: 0,
|
|
74
78
|
active: filterActive || active,
|
|
75
79
|
onClick: handleOnClick,
|
|
76
80
|
disabled: disabled
|
|
77
|
-
}, rest), _react.default.createElement(
|
|
78
|
-
active: active,
|
|
79
|
-
disabled: disabled,
|
|
80
|
-
badgeColor: disabled ? _visualInterest.VisualInterestColorName.licoriceMousse : badgeColor
|
|
81
|
-
}, rest)));
|
|
81
|
+
}, rest), variant === 'simple' ? _react.default.createElement(_SimplePrimary.default, props) : _react.default.createElement(_ActionFilter.default, props));
|
|
82
82
|
}); // @ts-ignore
|
|
83
83
|
|
|
84
84
|
Filter.propTypes = {
|
|
85
85
|
active: _propTypes.default.bool,
|
|
86
|
-
variant: _propTypes.default.oneOf(['simple']),
|
|
87
|
-
kind: _propTypes.default.oneOf(['primary']),
|
|
86
|
+
variant: _propTypes.default.oneOf(['simple', 'action']),
|
|
87
|
+
kind: _propTypes.default.oneOf(['primary', 'secondary']),
|
|
88
88
|
onClick: _propTypes.default.func,
|
|
89
89
|
text: _propTypes.default.string.isRequired,
|
|
90
90
|
badgeColor: _propTypes.default.oneOf(_commonUIColors.commonUIColorKeys),
|
|
@@ -12,12 +12,10 @@ describe('Filter', function () {
|
|
|
12
12
|
describe('Simple primary variant', function () {
|
|
13
13
|
it('renders label', function () {
|
|
14
14
|
var _render = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
15
|
-
"aria-label": "text sample",
|
|
16
15
|
variant: "simple",
|
|
17
16
|
text: "text sample"
|
|
18
17
|
})),
|
|
19
|
-
container = _render.container
|
|
20
|
-
queryByText = _render.queryByText;
|
|
18
|
+
container = _render.container;
|
|
21
19
|
|
|
22
20
|
expect(container).toMatchSnapshot();
|
|
23
21
|
});
|
|
@@ -25,7 +23,6 @@ describe('Filter', function () {
|
|
|
25
23
|
var onClick = jest.fn();
|
|
26
24
|
|
|
27
25
|
var _render2 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
28
|
-
"aria-label": "text sample",
|
|
29
26
|
active: false,
|
|
30
27
|
variant: "simple",
|
|
31
28
|
text: "text",
|
|
@@ -43,7 +40,6 @@ describe('Filter', function () {
|
|
|
43
40
|
var onClick = jest.fn();
|
|
44
41
|
|
|
45
42
|
var _render3 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
46
|
-
"aria-label": "text sample",
|
|
47
43
|
active: false,
|
|
48
44
|
variant: "simple",
|
|
49
45
|
text: "text",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import theme from 'styled-theming';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
declare const
|
|
2
|
+
export declare const hoverStyles: import("styled-components").FlattenSimpleInterpolation;
|
|
3
|
+
export declare const primaryStyle: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
+
export declare const secondaryStyle: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
+
declare const kindStyles: theme.VariantSet;
|
|
5
6
|
export default kindStyles;
|
|
6
7
|
//# sourceMappingURL=kind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/kind.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAInC,eAAO,MAAM,WAAW,wDAQvB,CAAC;AAEF,eAAO,MAAM,YAAY,wDAWxB,CAAC;AAEF,eAAO,MAAM,cAAc,wDAI1B,CAAC;AAEF,QAAA,MAAM,UAAU,kBAUd,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.hoverStyles = void 0;
|
|
6
|
+
exports.default = exports.secondaryStyle = exports.primaryStyle = exports.hoverStyles = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _designTokens = require("@decisiv/design-tokens");
|
|
9
|
+
|
|
10
|
+
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
11
|
+
|
|
12
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
9
13
|
|
|
10
14
|
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
11
15
|
|
|
12
16
|
var _styledComponents = require("styled-components");
|
|
13
17
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
18
|
+
var _styledTheming = _interopRequireDefault(require("styled-theming"));
|
|
17
19
|
|
|
18
20
|
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
19
21
|
|
|
@@ -22,24 +24,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
24
|
var hoverStyles = (0, _styledComponents.css)(["color:", ";background-color:", ";border:", " solid ", ";svg{color:", ";}"], (0, _toColorString.default)(_color.default.base.snowWhite), (0, _toColorString.default)(_color.default.interaction.indianOcean), (0, _rem.default)(1), (0, _toColorString.default)(_color.default.interaction.indianOcean), (0, _toColorString.default)(_color.default.base.snowWhite));
|
|
23
25
|
exports.hoverStyles = hoverStyles;
|
|
24
26
|
var primaryStyle = (0, _styledComponents.css)(["border:", " solid ", ";&:hover{", ";}&:disabled:disabled{background-color:transparent;color:", ";}"], (0, _rem.default)(1), (0, _toColorString.default)(_color.default.base.quarterMoon), hoverStyles, (0, _toColorString.default)(_color.default.opacity.charcoal40));
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
primary:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
light: function light(_ref) {
|
|
34
|
-
var _ref$kind = _ref.kind,
|
|
35
|
-
kind = _ref$kind === void 0 ? 'primary' : _ref$kind;
|
|
36
|
-
return lightStyles[kind];
|
|
27
|
+
exports.primaryStyle = primaryStyle;
|
|
28
|
+
var secondaryStyle = (0, _styledComponents.css)(["height:", ";font-size:", ";"], (0, _rem.default)(_designTokens.spacing.base * 2.4), (0, _rem.default)(_designTokens.typography.size.alias.paragraph2));
|
|
29
|
+
exports.secondaryStyle = secondaryStyle;
|
|
30
|
+
|
|
31
|
+
var kindStyles = _styledTheming.default.variants(_ConfigProvider.themeKeys.mode, 'kind', {
|
|
32
|
+
primary: {
|
|
33
|
+
light: primaryStyle,
|
|
34
|
+
dark: primaryStyle
|
|
37
35
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return darkStyles[kind];
|
|
36
|
+
secondary: {
|
|
37
|
+
light: secondaryStyle,
|
|
38
|
+
right: secondaryStyle
|
|
42
39
|
}
|
|
43
40
|
});
|
|
41
|
+
|
|
44
42
|
var _default = kindStyles;
|
|
45
43
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,eAAO,MAAM,yBAAyB;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,eAAO,MAAM,yBAAyB;;;;CA0CpC,CAAC;AAEH,QAAA,MAAM,MAAM,KAAsC,CAAC;AAInD,eAAe,MAAM,CAAC"}
|
|
@@ -17,10 +17,14 @@ var makeFilterSchemaPropTypes = function makeFilterSchemaPropTypes(extensions) {
|
|
|
17
17
|
return _objectSpread({
|
|
18
18
|
text: _reactDesc.PropTypes.string.description("The Filter's text"),
|
|
19
19
|
active: _reactDesc.PropTypes.bool.description("The Filter's active status. Use when you want to control the Filter with onClick.").defaultValue('false'),
|
|
20
|
-
badgeIcon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render'),
|
|
21
|
-
badgeColor: _reactDesc.PropTypes.string.description('Which color to use as background for the icon. It always displays when an icon is provided.').defaultValue('information'),
|
|
20
|
+
badgeIcon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render, only usable with the "simple" variant'),
|
|
21
|
+
badgeColor: _reactDesc.PropTypes.string.description('Which color to use as background for the icon. It always displays when an icon is provided. Only usable with the "simple" variant').defaultValue('information'),
|
|
22
22
|
count: _reactDesc.PropTypes.number.description("The Filter's count, displayed to the left of the text. When not provided, no count is rendered."),
|
|
23
|
-
disabled: _reactDesc.PropTypes.bool.description("The Filter's displayed status of disabled or enabled.").defaultValue('false')
|
|
23
|
+
disabled: _reactDesc.PropTypes.bool.description("The Filter's displayed status of disabled or enabled.").defaultValue('false'),
|
|
24
|
+
kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).defaultValue('primary'),
|
|
25
|
+
variant: _reactDesc.PropTypes.oneOf(['simple', 'action']).description('Use the variant to define the type of filter that you want to use').defaultValue('simple'),
|
|
26
|
+
startIcon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render before the filter text, only usable with the "action" variant'),
|
|
27
|
+
endIcon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render after the filter text, only usable with the "action" variant')
|
|
24
28
|
}, extensions);
|
|
25
29
|
};
|
|
26
30
|
|
|
@@ -2,17 +2,30 @@ import { ButtonHTMLAttributes } from 'react';
|
|
|
2
2
|
import { IconProps } from '@decisiv/iconix';
|
|
3
3
|
import { CommonUIColorKeys } from '../../utils/commonUIColors';
|
|
4
4
|
import { TranslatedText } from '../../utils/useTranslations';
|
|
5
|
-
export declare type Variant = 'simple';
|
|
6
|
-
export declare type Kind = 'primary';
|
|
5
|
+
export declare type Variant = 'simple' | 'action';
|
|
6
|
+
export declare type Kind = 'primary' | 'secondary';
|
|
7
7
|
export declare type IconComponent = (props: IconProps) => JSX.Element;
|
|
8
|
-
export interface
|
|
9
|
-
active?: boolean;
|
|
10
|
-
count?: number;
|
|
11
|
-
badgeIcon?: IconComponent;
|
|
12
|
-
badgeColor?: CommonUIColorKeys;
|
|
8
|
+
export interface BaseFilterProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
9
|
kind?: Kind;
|
|
14
|
-
text: TranslatedText;
|
|
15
10
|
variant?: Variant;
|
|
11
|
+
text: TranslatedText;
|
|
12
|
+
count?: number;
|
|
13
|
+
active?: boolean;
|
|
16
14
|
disabled?: boolean;
|
|
17
15
|
}
|
|
16
|
+
export interface SimpleFilterProps extends BaseFilterProps {
|
|
17
|
+
variant: 'simple';
|
|
18
|
+
badgeIcon?: IconComponent;
|
|
19
|
+
badgeColor?: CommonUIColorKeys;
|
|
20
|
+
startIcon?: never;
|
|
21
|
+
endIcon?: never;
|
|
22
|
+
}
|
|
23
|
+
export interface ActionFilterProps extends BaseFilterProps {
|
|
24
|
+
variant: 'action';
|
|
25
|
+
startIcon?: IconComponent;
|
|
26
|
+
endIcon?: IconComponent;
|
|
27
|
+
badgeIcon?: never;
|
|
28
|
+
badgeColor?: never;
|
|
29
|
+
}
|
|
30
|
+
export declare type FilterProps = SimpleFilterProps | ActionFilterProps;
|
|
18
31
|
//# sourceMappingURL=types.d.ts.map
|