@spaced-out/ui-design-system 0.3.18 → 0.3.19
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 +7 -0
- package/lib/components/Chip/Chip.js +4 -1
- package/lib/components/Chip/Chip.js.flow +4 -1
- package/lib/components/Chip/Chip.module.css +1 -1
- package/lib/components/Icon/ClickableIcon.js +6 -2
- package/lib/components/Icon/ClickableIcon.js.flow +39 -10
- package/package.json +1 -1
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.3.19](https://github.com/spaced-out/ui-design-system/compare/v0.3.18...v0.3.19) (2025-01-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* chip outline ([#316](https://github.com/spaced-out/ui-design-system/issues/316)) ([18d8467](https://github.com/spaced-out/ui-design-system/commit/18d8467fbc077dcd9e99ec4d283447e0d31dfb70))
|
|
11
|
+
|
|
5
12
|
### [0.3.18](https://github.com/spaced-out/ui-design-system/compare/v0.3.17...v0.3.18) (2025-01-23)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -100,7 +100,10 @@ const Chip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
100
100
|
type: iconType,
|
|
101
101
|
size: "small"
|
|
102
102
|
}), /*#__PURE__*/React.createElement(_Truncate.Truncate, null, children), dismissable && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.CloseIcon, {
|
|
103
|
-
|
|
103
|
+
classNames: {
|
|
104
|
+
icon: _ChipModule.default.dismissIcon,
|
|
105
|
+
button: _ChipModule.default.dismissIconWrapper
|
|
106
|
+
},
|
|
104
107
|
type: iconType,
|
|
105
108
|
size: "small",
|
|
106
109
|
ariaLabel: "Dismiss",
|
|
@@ -159,7 +159,10 @@ export const Chip: React$AbstractComponent<ChipProps, HTMLDivElement> =
|
|
|
159
159
|
|
|
160
160
|
{dismissable && size !== 'small' && (
|
|
161
161
|
<CloseIcon
|
|
162
|
-
|
|
162
|
+
classNames={{
|
|
163
|
+
icon: css.dismissIcon,
|
|
164
|
+
button: css.dismissIconWrapper,
|
|
165
|
+
}}
|
|
163
166
|
type={iconType}
|
|
164
167
|
size="small"
|
|
165
168
|
ariaLabel="Dismiss"
|
|
@@ -19,6 +19,9 @@ const ClickableIcon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
19
19
|
size = 'medium',
|
|
20
20
|
ariaLabel,
|
|
21
21
|
onClick,
|
|
22
|
+
className,
|
|
23
|
+
// Deprecated for Clickable Icon
|
|
24
|
+
classNames,
|
|
22
25
|
...props
|
|
23
26
|
} = _ref;
|
|
24
27
|
const onKeyDownHandler = e => {
|
|
@@ -35,10 +38,11 @@ const ClickableIcon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
35
38
|
[_ClickableIconModule.default.small]: size === 'small',
|
|
36
39
|
[_ClickableIconModule.default.medium]: size === 'medium',
|
|
37
40
|
[_ClickableIconModule.default.large]: size === 'large'
|
|
38
|
-
}),
|
|
41
|
+
}, classNames?.button),
|
|
39
42
|
ref: ref
|
|
40
43
|
}), /*#__PURE__*/React.createElement(_.Icon, _extends({
|
|
41
|
-
size: size
|
|
44
|
+
size: size,
|
|
45
|
+
className: classNames?.icon || className
|
|
42
46
|
}, props)));
|
|
43
47
|
});
|
|
44
48
|
exports.ClickableIcon = ClickableIcon;
|
|
@@ -13,11 +13,31 @@ import {Icon} from './';
|
|
|
13
13
|
import css from './ClickableIcon.module.css';
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
type ClassNames = $ReadOnly<{
|
|
17
|
+
icon?: string,
|
|
18
|
+
button?: string,
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export type ClickableIconProps = {
|
|
22
|
+
...IconProps,
|
|
23
|
+
classNames?: ClassNames,
|
|
24
|
+
};
|
|
25
|
+
|
|
16
26
|
export const ClickableIcon: React$AbstractComponent<
|
|
17
|
-
|
|
27
|
+
ClickableIconProps,
|
|
18
28
|
HTMLButtonElement,
|
|
19
|
-
> = React.forwardRef<
|
|
20
|
-
(
|
|
29
|
+
> = React.forwardRef<ClickableIconProps, HTMLButtonElement>(
|
|
30
|
+
(
|
|
31
|
+
{
|
|
32
|
+
size = 'medium',
|
|
33
|
+
ariaLabel,
|
|
34
|
+
onClick,
|
|
35
|
+
className, // Deprecated for Clickable Icon
|
|
36
|
+
classNames,
|
|
37
|
+
...props
|
|
38
|
+
}: ClickableIconProps,
|
|
39
|
+
ref,
|
|
40
|
+
) => {
|
|
21
41
|
const onKeyDownHandler = (e) => {
|
|
22
42
|
if (e.key === 'Enter') {
|
|
23
43
|
e.preventDefault();
|
|
@@ -30,14 +50,22 @@ export const ClickableIcon: React$AbstractComponent<
|
|
|
30
50
|
onClick={onClick}
|
|
31
51
|
onKeyDown={onKeyDownHandler}
|
|
32
52
|
ariaLabel={ariaLabel}
|
|
33
|
-
className={classify(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
53
|
+
className={classify(
|
|
54
|
+
css.button,
|
|
55
|
+
{
|
|
56
|
+
[css.small]: size === 'small',
|
|
57
|
+
[css.medium]: size === 'medium',
|
|
58
|
+
[css.large]: size === 'large',
|
|
59
|
+
},
|
|
60
|
+
classNames?.button,
|
|
61
|
+
)}
|
|
38
62
|
ref={ref}
|
|
39
63
|
>
|
|
40
|
-
<Icon
|
|
64
|
+
<Icon
|
|
65
|
+
size={size}
|
|
66
|
+
className={classNames?.icon || className}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
41
69
|
</UnstyledButton>
|
|
42
70
|
);
|
|
43
71
|
},
|
|
@@ -48,8 +76,9 @@ export type CloseIconProps = {
|
|
|
48
76
|
type?: IconType,
|
|
49
77
|
color?: ColorTypes,
|
|
50
78
|
onClick?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
51
|
-
className?: string,
|
|
79
|
+
className?: string, // Deprecated for Clickable Icon
|
|
52
80
|
ariaLabel?: string,
|
|
81
|
+
classNames?: ClassNames,
|
|
53
82
|
};
|
|
54
83
|
|
|
55
84
|
export const CloseIcon: React$AbstractComponent<
|