@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 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
- className: _ChipModule.default.dismissIcon,
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
- className={css.dismissIcon}
162
+ classNames={{
163
+ icon: css.dismissIcon,
164
+ button: css.dismissIconWrapper,
165
+ }}
163
166
  type={iconType}
164
167
  size="small"
165
168
  ariaLabel="Dismiss"
@@ -133,7 +133,7 @@
133
133
  padding: spaceNone spaceXSmall spaceNone spaceSmall;
134
134
  }
135
135
 
136
- .dismissIcon {
136
+ .dismissIconWrapper {
137
137
  margin-left: spaceXSmall;
138
138
  cursor: pointer;
139
139
  }
@@ -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
- IconProps,
27
+ ClickableIconProps,
18
28
  HTMLButtonElement,
19
- > = React.forwardRef<IconProps, HTMLButtonElement>(
20
- ({size = 'medium', ariaLabel, onClick, ...props}: IconProps, ref) => {
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(css.button, {
34
- [css.small]: size === 'small',
35
- [css.medium]: size === 'medium',
36
- [css.large]: size === 'large',
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 size={size} {...props} />
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<
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {