@spaced-out/ui-design-system 0.0.65 → 0.0.66

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.66](https://github.com/spaced-out/ui-design-system/compare/v0.0.65...v0.0.66) (2023-03-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * onkeydown fix for clickable icon ([#89](https://github.com/spaced-out/ui-design-system/issues/89)) ([28c9c1a](https://github.com/spaced-out/ui-design-system/commit/28c9c1a6f65934c644959c4105c957e008881b7d))
11
+
5
12
  ### [0.0.65](https://github.com/spaced-out/ui-design-system/compare/v0.0.64...v0.0.65) (2023-03-29)
6
13
 
7
14
 
@@ -19,9 +19,18 @@ const ClickableIcon = _ref => {
19
19
  size = 'medium',
20
20
  className,
21
21
  ariaLabel,
22
+ onClick,
22
23
  ...props
23
24
  } = _ref;
25
+ const onKeyDownHandler = e => {
26
+ e.preventDefault();
27
+ if (e.key === 'Enter') {
28
+ onClick && onClick(e);
29
+ }
30
+ };
24
31
  return /*#__PURE__*/React.createElement(_Button.UnstyledButton, _extends({}, props, {
32
+ onClick: onClick,
33
+ onKeyDown: onKeyDownHandler,
25
34
  ariaLabel: ariaLabel,
26
35
  className: (0, _classify.default)(_ClickableIconModule.default.button, {
27
36
  [_ClickableIconModule.default.small]: size === 'small',
@@ -17,23 +17,34 @@ export const ClickableIcon = ({
17
17
  size = 'medium',
18
18
  className,
19
19
  ariaLabel,
20
+ onClick,
20
21
  ...props
21
- }: IconProps): React.Node => (
22
- <UnstyledButton
23
- {...props}
24
- ariaLabel={ariaLabel}
25
- className={classify(
26
- css.button,
27
- {
28
- [css.small]: size === 'small',
29
- [css.medium]: size === 'medium',
30
- },
31
- className,
32
- )}
33
- >
34
- <Icon size={size} {...props} />
35
- </UnstyledButton>
36
- );
22
+ }: IconProps): React.Node => {
23
+ const onKeyDownHandler = (e) => {
24
+ e.preventDefault();
25
+ if (e.key === 'Enter') {
26
+ onClick && onClick(e);
27
+ }
28
+ };
29
+ return (
30
+ <UnstyledButton
31
+ {...props}
32
+ onClick={onClick}
33
+ onKeyDown={onKeyDownHandler}
34
+ ariaLabel={ariaLabel}
35
+ className={classify(
36
+ css.button,
37
+ {
38
+ [css.small]: size === 'small',
39
+ [css.medium]: size === 'medium',
40
+ },
41
+ className,
42
+ )}
43
+ >
44
+ <Icon size={size} {...props} />
45
+ </UnstyledButton>
46
+ );
47
+ };
37
48
 
38
49
  export type CloseIconProps = {
39
50
  size?: IconSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {