@spaced-out/ui-design-system 0.0.64 → 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 +14 -0
- package/lib/components/Icon/ClickableIcon.js +9 -0
- package/lib/components/Icon/ClickableIcon.js.flow +27 -16
- package/lib/components/SubMenu/SubMenu.js +4 -2
- package/lib/components/SubMenu/SubMenu.js.flow +6 -2
- package/lib/components/SubMenu/SubMenu.module.css +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
### [0.0.65](https://github.com/spaced-out/ui-design-system/compare/v0.0.64...v0.0.65) (2023-03-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* remove focus for non-collapsible group title ([#88](https://github.com/spaced-out/ui-design-system/issues/88)) ([d324b67](https://github.com/spaced-out/ui-design-system/commit/d324b672eb12aa00311ebb9b6c73088470e678af))
|
|
18
|
+
|
|
5
19
|
### [0.0.64](https://github.com/spaced-out/ui-design-system/compare/v0.0.63...v0.0.64) (2023-03-29)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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,
|
|
@@ -143,10 +143,12 @@ const SubMenuGroup = _ref5 => {
|
|
|
143
143
|
return /*#__PURE__*/React.createElement("div", {
|
|
144
144
|
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroupWrapper, classNames?.wrapper)
|
|
145
145
|
}, /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroupHeader,
|
|
146
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroupHeader, {
|
|
147
|
+
[_SubMenuModule.default.collapsible]: collapsible
|
|
148
|
+
}, classNames?.groupHeader),
|
|
147
149
|
onClick: collapseHandler,
|
|
148
150
|
onKeyDown: onKeyDownHandlerHeader,
|
|
149
|
-
tabIndex:
|
|
151
|
+
tabIndex: collapsible ? 0 : -1
|
|
150
152
|
}, /*#__PURE__*/React.createElement(_Text.SubTitleExtraSmall, {
|
|
151
153
|
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
152
154
|
className: _SubMenuModule.default.groupTitle
|
|
@@ -204,10 +204,14 @@ export const SubMenuGroup = ({
|
|
|
204
204
|
return (
|
|
205
205
|
<div className={classify(css.subMenuGroupWrapper, classNames?.wrapper)}>
|
|
206
206
|
<div
|
|
207
|
-
className={classify(
|
|
207
|
+
className={classify(
|
|
208
|
+
css.subMenuGroupHeader,
|
|
209
|
+
{[css.collapsible]: collapsible},
|
|
210
|
+
classNames?.groupHeader,
|
|
211
|
+
)}
|
|
208
212
|
onClick={collapseHandler}
|
|
209
213
|
onKeyDown={onKeyDownHandlerHeader}
|
|
210
|
-
tabIndex=
|
|
214
|
+
tabIndex={collapsible ? 0 : -1}
|
|
211
215
|
>
|
|
212
216
|
<SubTitleExtraSmall
|
|
213
217
|
color={TEXT_COLORS.inverseSecondary}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
.subMenuGroupWrapper {
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
padding:
|
|
68
|
+
padding: spaceSmall spaceNone;
|
|
69
69
|
flex: auto;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
outline: none;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
.subMenuGroupHeader:focus {
|
|
85
|
+
.subMenuGroupHeader.collapsible:focus {
|
|
86
86
|
box-shadow: borderWidthNone borderWidthNone borderWidthNone
|
|
87
87
|
borderWidthTertiary colorFocusPrimary;
|
|
88
88
|
}
|