@spaced-out/ui-design-system 0.0.14 → 0.0.16-beta.0

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,25 @@
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.16-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.0.15...v0.0.16-beta.0) (2023-01-18)
6
+
7
+
8
+ ### Features
9
+
10
+ * changed to displayName from name ([#49](https://github.com/spaced-out/ui-design-system/issues/49)) ([b91af6e](https://github.com/spaced-out/ui-design-system/commit/b91af6ecea5a93af6a857dab68dfb75e3c8d81b5))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * secondary label story fix ([64a33c4](https://github.com/spaced-out/ui-design-system/commit/64a33c48778a725389ce7aacba305619e2a84e39))
16
+
17
+ ### [0.0.15](https://github.com/spaced-out/ui-design-system/compare/v0.0.14...v0.0.15) (2023-01-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * type prop conflict between button and icon ([#48](https://github.com/spaced-out/ui-design-system/issues/48)) ([726b747](https://github.com/spaced-out/ui-design-system/commit/726b747722751444b7eef76c29bf84f12f77f657))
23
+
5
24
  ### [0.0.14](https://github.com/spaced-out/ui-design-system/compare/v0.0.13...v0.0.14) (2023-01-17)
6
25
 
7
26
 
@@ -39,6 +39,7 @@ const UnstyledButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
39
39
  onClick,
40
40
  className,
41
41
  ariaLabel,
42
+ actionType,
42
43
  ...props
43
44
  } = _ref;
44
45
  return /*#__PURE__*/React.createElement("button", _extends({}, props, ariaLabel ? {
@@ -48,6 +49,7 @@ const UnstyledButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
48
49
  ref: ref,
49
50
  role: "button",
50
51
  disabled: disabled,
52
+ type: actionType,
51
53
  onClick: event => {
52
54
  if (disabled) {
53
55
  event.preventDefault();
@@ -74,7 +76,7 @@ const Button = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
74
76
  ...props
75
77
  } = _ref2;
76
78
  return /*#__PURE__*/React.createElement(UnstyledButton, _extends({}, props, {
77
- type: actionType,
79
+ actionType: actionType,
78
80
  className: (0, _classify.classify)(_ButtonModule.default.button, {
79
81
  [_ButtonModule.default.primary]: type === 'primary',
80
82
  [_ButtonModule.default.secondary]: type === 'secondary',
@@ -31,7 +31,7 @@ export type ButtonActionType = $Values<typeof BUTTON_ACTION_TYPE>;
31
31
  export type UnstyledButtonProps = {
32
32
  children?: React.Node,
33
33
  disabled?: mixed,
34
- type?: ButtonActionType,
34
+ actionType?: ButtonActionType,
35
35
  onClick?: ?(SyntheticEvent<HTMLElement>) => mixed,
36
36
  className?: string,
37
37
  ariaLabel?: string,
@@ -68,7 +68,14 @@ export const UnstyledButton: React$AbstractComponent<
68
68
  HTMLButtonElement,
69
69
  > = React.forwardRef<UnstyledButtonProps, HTMLButtonElement>(
70
70
  (
71
- {disabled, onClick, className, ariaLabel, ...props}: UnstyledButtonProps,
71
+ {
72
+ disabled,
73
+ onClick,
74
+ className,
75
+ ariaLabel,
76
+ actionType,
77
+ ...props
78
+ }: UnstyledButtonProps,
72
79
  ref: React.Ref<'button'>,
73
80
  ) => (
74
81
  <button
@@ -78,6 +85,7 @@ export const UnstyledButton: React$AbstractComponent<
78
85
  ref={ref}
79
86
  role="button"
80
87
  disabled={disabled}
88
+ type={actionType}
81
89
  onClick={(event) => {
82
90
  if (disabled) {
83
91
  event.preventDefault();
@@ -110,7 +118,7 @@ export const Button: React$AbstractComponent<ButtonProps, HTMLButtonElement> =
110
118
  ) => (
111
119
  <UnstyledButton
112
120
  {...props}
113
- type={actionType}
121
+ actionType={actionType}
114
122
  className={classify(
115
123
  css.button,
116
124
  {
@@ -123,6 +123,7 @@ const TabSlot = _ref => {
123
123
  }), children);
124
124
  };
125
125
  exports.TabSlot = TabSlot;
126
+ TabSlot.displayName = 'TabSlot';
126
127
  const RightSlot = _ref2 => {
127
128
  let {
128
129
  children,
@@ -131,6 +132,7 @@ const RightSlot = _ref2 => {
131
132
  return /*#__PURE__*/React.createElement("div", props, children);
132
133
  };
133
134
  exports.RightSlot = RightSlot;
135
+ RightSlot.displayName = 'RightSlot';
134
136
  const PageName = _ref3 => {
135
137
  let {
136
138
  children,
@@ -141,6 +143,7 @@ const PageName = _ref3 => {
141
143
  }), children);
142
144
  };
143
145
  exports.PageName = PageName;
146
+ PageName.displayName = 'PageName';
144
147
  const PageTitle = _ref4 => {
145
148
  let {
146
149
  classNames,
@@ -152,7 +155,7 @@ const PageTitle = _ref4 => {
152
155
  if (childrenArray.length) {
153
156
  const nodes = [];
154
157
  for (const child of childrenArray) {
155
- if (child?.type?.name === comp) {
158
+ if (child?.type?.displayName === comp) {
156
159
  nodes.push(child);
157
160
  }
158
161
  }
@@ -136,6 +136,8 @@ export const TabSlot = ({
136
136
  </div>
137
137
  );
138
138
 
139
+ TabSlot.displayName = 'TabSlot';
140
+
139
141
  export type RightSlotProps = {
140
142
  children?: React.Node,
141
143
  ...
@@ -145,6 +147,8 @@ export const RightSlot = ({children, ...props}: RightSlotProps): React.Node => (
145
147
  <div {...props}>{children}</div>
146
148
  );
147
149
 
150
+ RightSlot.displayName = 'RightSlot';
151
+
148
152
  export type PageNameProps = {
149
153
  children?: React.Node,
150
154
  ...
@@ -155,6 +159,7 @@ export const PageName = ({children, ...props}: PageNameProps): React.Node => (
155
159
  {children}
156
160
  </div>
157
161
  );
162
+ PageName.displayName = 'PageName';
158
163
 
159
164
  export const PageTitle = ({
160
165
  classNames,
@@ -166,7 +171,7 @@ export const PageTitle = ({
166
171
  if (childrenArray.length) {
167
172
  const nodes: React.Node[] = [];
168
173
  for (const child of childrenArray) {
169
- if (child?.type?.name === comp) {
174
+ if (child?.type?.displayName === comp) {
170
175
  nodes.push(child);
171
176
  }
172
177
  }
@@ -76,6 +76,7 @@ const ToastTitle = _ref2 => {
76
76
  return children;
77
77
  };
78
78
  exports.ToastTitle = ToastTitle;
79
+ ToastTitle.displayName = 'ToastTitle';
79
80
  const ToastBody = _ref3 => {
80
81
  let {
81
82
  children
@@ -83,6 +84,7 @@ const ToastBody = _ref3 => {
83
84
  return children;
84
85
  };
85
86
  exports.ToastBody = ToastBody;
87
+ ToastBody.displayName = 'ToastBody';
86
88
  const ToastFooter = _ref4 => {
87
89
  let {
88
90
  children,
@@ -99,14 +101,14 @@ const ToastFooter = _ref4 => {
99
101
  onClose && onClose();
100
102
  onClick && onClick(e);
101
103
  };
102
- if (child?.type?.name === 'Button' && isLast) {
104
+ if (child?.type?.displayName === 'Button' && isLast) {
103
105
  return /*#__PURE__*/React.cloneElement(child, {
104
106
  size: 'small',
105
107
  type: 'primary',
106
108
  ...child.props,
107
109
  onClick: buttonClickHandler
108
110
  });
109
- } else if (child?.type?.name === 'Button') {
111
+ } else if (child?.type?.displayName === 'Button') {
110
112
  return /*#__PURE__*/React.cloneElement(child, {
111
113
  size: 'small',
112
114
  type: 'tertiary',
@@ -122,6 +124,7 @@ const ToastFooter = _ref4 => {
122
124
  }, footerActions) : null;
123
125
  };
124
126
  exports.ToastFooter = ToastFooter;
127
+ ToastFooter.displayName = 'ToastFooter';
125
128
  const Toast = _ref5 => {
126
129
  let {
127
130
  classNames,
@@ -140,7 +143,7 @@ const Toast = _ref5 => {
140
143
  if (childrenArray.length) {
141
144
  const nodes = [];
142
145
  for (const child of childrenArray) {
143
- if (child?.type?.name === comp) {
146
+ if (child?.type?.displayName === comp) {
144
147
  nodes.push(child);
145
148
  }
146
149
  }
@@ -107,12 +107,16 @@ export type ToastTitleProps = {
107
107
 
108
108
  export const ToastTitle = ({children}: ToastTitleProps): React.Node => children;
109
109
 
110
+ ToastTitle.displayName = 'ToastTitle';
111
+
110
112
  export type ToastBodyProps = {
111
113
  children?: React.Node,
112
114
  };
113
115
 
114
116
  export const ToastBody = ({children}: ToastBodyProps): React.Node => children;
115
117
 
118
+ ToastBody.displayName = 'ToastBody';
119
+
116
120
  export type ToastFooterProps = {
117
121
  children?: React.Node,
118
122
  onClose?: () => void,
@@ -133,14 +137,14 @@ export const ToastFooter = ({
133
137
  onClick && onClick(e);
134
138
  };
135
139
 
136
- if (child?.type?.name === 'Button' && isLast) {
140
+ if (child?.type?.displayName === 'Button' && isLast) {
137
141
  return React.cloneElement(child, {
138
142
  size: 'small',
139
143
  type: 'primary',
140
144
  ...child.props,
141
145
  onClick: buttonClickHandler,
142
146
  });
143
- } else if (child?.type?.name === 'Button') {
147
+ } else if (child?.type?.displayName === 'Button') {
144
148
  return React.cloneElement(child, {
145
149
  size: 'small',
146
150
  type: 'tertiary',
@@ -157,6 +161,8 @@ export const ToastFooter = ({
157
161
  ) : null;
158
162
  };
159
163
 
164
+ ToastFooter.displayName = 'ToastFooter';
165
+
160
166
  export const Toast = ({
161
167
  classNames,
162
168
  children,
@@ -172,7 +178,7 @@ export const Toast = ({
172
178
  if (childrenArray.length) {
173
179
  const nodes: React.Node[] = [];
174
180
  for (const child of childrenArray) {
175
- if (child?.type?.name === comp) {
181
+ if (child?.type?.displayName === comp) {
176
182
  nodes.push(child);
177
183
  }
178
184
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.0.14",
3
+ "version": "0.0.16-beta.0",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {