@spaced-out/ui-design-system 0.0.20 → 0.0.21

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,14 @@
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.21](https://github.com/spaced-out/ui-design-system/compare/v0.0.20...v0.0.21) (2023-02-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * actiontype default value should be button ([#59](https://github.com/spaced-out/ui-design-system/issues/59)) ([f0c1c38](https://github.com/spaced-out/ui-design-system/commit/f0c1c382a2c6501a57b7ffd2e50c4b585f3079af))
11
+ * incontext alert design fixes ([#60](https://github.com/spaced-out/ui-design-system/issues/60)) ([60e8aa0](https://github.com/spaced-out/ui-design-system/commit/60e8aa052d56f2624a6a83aa77fdeb0f24d7327c))
12
+
5
13
  ### [0.0.20](https://github.com/spaced-out/ui-design-system/compare/v0.0.19...v0.0.20) (2023-02-08)
6
14
 
7
15
 
@@ -71,7 +71,7 @@ const Button = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
71
71
  type = 'primary',
72
72
  isFluid = false,
73
73
  disabled = false,
74
- actionType = 'submit',
74
+ actionType = 'button',
75
75
  size = 'medium',
76
76
  ...props
77
77
  } = _ref2;
@@ -110,7 +110,7 @@ export const Button: React$AbstractComponent<ButtonProps, HTMLButtonElement> =
110
110
  type = 'primary',
111
111
  isFluid = false,
112
112
  disabled = false,
113
- actionType = 'submit',
113
+ actionType = 'button',
114
114
  size = 'medium',
115
115
  ...props
116
116
  }: ButtonProps,
@@ -81,7 +81,9 @@ const InContextAlert = props => {
81
81
  children,
82
82
  selfDismiss = false,
83
83
  leftIconName = '',
84
- onCloseClick
84
+ onCloseClick,
85
+ actionText = '',
86
+ onAction
85
87
  } = props;
86
88
  const [dismissed, setDismissed] = React.useState(false);
87
89
  const closeClickHandler = e => {
@@ -103,7 +105,10 @@ const InContextAlert = props => {
103
105
  className: (0, _classify.classify)(classNames?.alertText)
104
106
  }, /*#__PURE__*/React.createElement(_Truncate.Truncate, {
105
107
  line: 2
106
- }, children)), dismissable && /*#__PURE__*/React.createElement(_Icon.Icon, {
108
+ }, children)), actionText ? /*#__PURE__*/React.createElement(_Text.ButtonTextExtraSmall, {
109
+ className: _InContextAlertModule.default.actionText,
110
+ onClick: onAction
111
+ }, actionText) : dismissable && /*#__PURE__*/React.createElement(_Icon.Icon, {
107
112
  color: _typography.TEXT_COLORS.primary,
108
113
  name: "close",
109
114
  size: "small",
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import {TEXT_COLORS} from '../../types/typography';
6
6
  import {classify} from '../../utils/classify';
7
7
  import {Icon} from '../Icon';
8
- import {SubTitleExtraSmall} from '../Text';
8
+ import {ButtonTextExtraSmall, SubTitleExtraSmall} from '../Text';
9
9
  import {Truncate} from '../Truncate';
10
10
 
11
11
  import css from './InContextAlert.module.css';
@@ -32,6 +32,8 @@ type InContextAlertBaseProps = {
32
32
  }
33
33
  | {dismissable?: false},
34
34
  children?: string,
35
+ actionText?: string,
36
+ onAction?: ?(SyntheticEvent<HTMLElement>) => mixed,
35
37
  };
36
38
 
37
39
  type InContextAlertPropsFixedIcon = {
@@ -127,6 +129,8 @@ export const InContextAlert = (props: InContextAlertProps): React.Node => {
127
129
  selfDismiss = false,
128
130
  leftIconName = '',
129
131
  onCloseClick,
132
+ actionText = '',
133
+ onAction,
130
134
  } = props;
131
135
  const [dismissed, setDismissed] = React.useState(false);
132
136
  const closeClickHandler = (e) => {
@@ -156,15 +160,21 @@ export const InContextAlert = (props: InContextAlertProps): React.Node => {
156
160
  <Truncate line={2}>{children}</Truncate>
157
161
  </SubTitleExtraSmall>
158
162
  )}
159
- {dismissable && (
160
- <Icon
161
- color={TEXT_COLORS.primary}
162
- name="close"
163
- size="small"
164
- type="regular"
165
- onClick={closeClickHandler}
166
- className={css.closeIcon}
167
- />
163
+ {actionText ? (
164
+ <ButtonTextExtraSmall className={css.actionText} onClick={onAction}>
165
+ {actionText}
166
+ </ButtonTextExtraSmall>
167
+ ) : (
168
+ dismissable && (
169
+ <Icon
170
+ color={TEXT_COLORS.primary}
171
+ name="close"
172
+ size="small"
173
+ type="regular"
174
+ onClick={closeClickHandler}
175
+ className={css.closeIcon}
176
+ />
177
+ )
168
178
  )}
169
179
  </div>
170
180
  )}
@@ -34,7 +34,6 @@
34
34
  border-radius: borderRadiusXSmall;
35
35
  width: sizeFluid;
36
36
  word-break: normal;
37
- overflow-wrap: anywhere;
38
37
  border-width: borderWidthPrimary;
39
38
  border-style: solid;
40
39
  }
@@ -68,3 +67,9 @@
68
67
  cursor: pointer;
69
68
  margin-left: auto;
70
69
  }
70
+
71
+ .actionText {
72
+ cursor: pointer;
73
+ margin-left: auto;
74
+ text-decoration: underline;
75
+ }
@@ -27,7 +27,8 @@ const OptionButton = _ref => {
27
27
  onButtonClick,
28
28
  onMenuOpen,
29
29
  onMenuClose,
30
- ariaLabel
30
+ ariaLabel,
31
+ actionType
31
32
  } = _ref;
32
33
  const [iconName, setIconName] = React.useState('chevron-down');
33
34
  return /*#__PURE__*/React.createElement("div", {
@@ -43,7 +44,8 @@ const OptionButton = _ref => {
43
44
  },
44
45
  disabled: disabled,
45
46
  isFluid: isFluid,
46
- ariaLabel: ariaLabel
47
+ ariaLabel: ariaLabel,
48
+ actionType: actionType
47
49
  }, children), /*#__PURE__*/React.createElement(_ButtonDropdown.ButtonDropdown, {
48
50
  anchorPosition: anchorPosition,
49
51
  ariaLabel: ariaLabel,
@@ -37,6 +37,7 @@ export const OptionButton = ({
37
37
  onMenuOpen,
38
38
  onMenuClose,
39
39
  ariaLabel,
40
+ actionType,
40
41
  }: OptionButtonProps): React.Node => {
41
42
  const [iconName, setIconName] = React.useState('chevron-down');
42
43
 
@@ -52,6 +53,7 @@ export const OptionButton = ({
52
53
  disabled={disabled}
53
54
  isFluid={isFluid}
54
55
  ariaLabel={ariaLabel}
56
+ actionType={actionType}
55
57
  >
56
58
  {children}
57
59
  </Button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {