@spaced-out/ui-design-system 0.0.35 → 0.0.36

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.0.36](https://github.com/spaced-out/ui-design-system/compare/v0.0.35...v0.0.36) (2023-03-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * custom component in menu option ([31061ad](https://github.com/spaced-out/ui-design-system/commit/31061ad9cf685e2d73bb4cd9b733bfe3f9088e4a))
11
+
5
12
  ### [0.0.35](https://github.com/spaced-out/ui-design-system/compare/v0.0.34...v0.0.35) (2023-03-02)
6
13
 
7
14
 
@@ -13,8 +13,9 @@ type ClassNames = $ReadOnly<{wrapper?: string}>;
13
13
 
14
14
  export type MenuOption = {
15
15
  key?: string,
16
- label: string,
16
+ label?: string,
17
17
  secondaryLabel?: string,
18
+ customComponent?: React.Node,
18
19
  iconLeft?: string,
19
20
  iconLeftType?: IconType,
20
21
  iconRight?: string,
@@ -26,6 +26,7 @@ const MenuOptionButton = props => {
26
26
  key,
27
27
  label,
28
28
  secondaryLabel,
29
+ customComponent,
29
30
  iconLeft,
30
31
  iconLeftType,
31
32
  iconRight,
@@ -58,7 +59,7 @@ const MenuOptionButton = props => {
58
59
  className: _MenuModule.default.optionTextContainer
59
60
  }, /*#__PURE__*/React.createElement("div", {
60
61
  className: _MenuModule.default.optionTextLabel
61
- }, /*#__PURE__*/React.createElement(_Truncate.Truncate, null, label)), !!secondaryLabel && /*#__PURE__*/React.createElement("div", {
62
+ }, /*#__PURE__*/React.isValidElement(customComponent) ? customComponent : /*#__PURE__*/React.createElement(_Truncate.Truncate, null, label)), !!secondaryLabel && /*#__PURE__*/React.createElement("div", {
62
63
  className: _MenuModule.default.optionTextSecondaryLabel
63
64
  }, /*#__PURE__*/React.createElement(_Truncate.Truncate, null, secondaryLabel))), !!iconRight && /*#__PURE__*/React.createElement(_Icon.Icon, {
64
65
  name: iconRight,
@@ -30,6 +30,7 @@ export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
30
30
  key,
31
31
  label,
32
32
  secondaryLabel,
33
+ customComponent,
33
34
  iconLeft,
34
35
  iconLeftType,
35
36
  iconRight,
@@ -67,7 +68,11 @@ export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
67
68
  )}
68
69
  <div className={css.optionTextContainer}>
69
70
  <div className={css.optionTextLabel}>
70
- <Truncate>{label}</Truncate>
71
+ {React.isValidElement(customComponent) ? (
72
+ customComponent
73
+ ) : (
74
+ <Truncate>{label}</Truncate>
75
+ )}
71
76
  </div>
72
77
 
73
78
  {!!secondaryLabel && (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {