@spaced-out/ui-design-system 0.0.53 → 0.0.54
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.54](https://github.com/spaced-out/ui-design-system/compare/v0.0.53...v0.0.54) (2023-03-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added support for hover events in a chip ([242d98d](https://github.com/spaced-out/ui-design-system/commit/242d98ddb62d02b6b8fd9e9a470d9fe1957d7bfc))
|
|
11
|
+
|
|
5
12
|
### [0.0.53](https://github.com/spaced-out/ui-design-system/compare/v0.0.52...v0.0.53) (2023-03-21)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -12,7 +12,7 @@ var _ChipModule = _interopRequireDefault(require("./Chip.module.css"));
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
16
16
|
const CHIP_SEMANTIC = Object.freeze({
|
|
17
17
|
primary: 'primary',
|
|
18
18
|
information: 'information',
|
|
@@ -33,10 +33,12 @@ const Chip = _ref => {
|
|
|
33
33
|
dismissable = false,
|
|
34
34
|
onDismiss = () => null,
|
|
35
35
|
onClick,
|
|
36
|
-
disabled
|
|
36
|
+
disabled,
|
|
37
|
+
...rest
|
|
37
38
|
} = _ref;
|
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
"data-testid": "Chip"
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
40
|
+
"data-testid": "Chip"
|
|
41
|
+
}, rest, {
|
|
40
42
|
className: (0, _classify.classify)(_ChipModule.default.chipWrapper, {
|
|
41
43
|
[_ChipModule.default.primary]: semantic === CHIP_SEMANTIC.primary,
|
|
42
44
|
[_ChipModule.default.information]: semantic === CHIP_SEMANTIC.information,
|
|
@@ -51,7 +53,7 @@ const Chip = _ref => {
|
|
|
51
53
|
[_ChipModule.default.disabled]: disabled
|
|
52
54
|
}, classNames?.wrapper),
|
|
53
55
|
onClick: onClick
|
|
54
|
-
}, iconName && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
56
|
+
}), iconName && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
55
57
|
className: _ChipModule.default.chipIcon,
|
|
56
58
|
name: iconName,
|
|
57
59
|
type: iconType,
|
|
@@ -29,6 +29,8 @@ export type BaseChipProps = {
|
|
|
29
29
|
children: React.Node,
|
|
30
30
|
disabled?: boolean,
|
|
31
31
|
onClick?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
32
|
+
onMouseEnter?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
33
|
+
onMouseLeave?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export type MediumChipProps = {
|
|
@@ -57,9 +59,11 @@ export const Chip = ({
|
|
|
57
59
|
onDismiss = () => null,
|
|
58
60
|
onClick,
|
|
59
61
|
disabled,
|
|
62
|
+
...rest
|
|
60
63
|
}: ChipProps): React.Node => (
|
|
61
64
|
<div
|
|
62
65
|
data-testid="Chip"
|
|
66
|
+
{...rest}
|
|
63
67
|
className={classify(
|
|
64
68
|
css.chipWrapper,
|
|
65
69
|
{
|