@spaced-out/ui-design-system 0.2.8 → 0.2.10

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,20 @@
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.2.10](https://github.com/spaced-out/ui-design-system/compare/v0.2.9...v0.2.10) (2024-11-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * support menu open for all menu related components ([#285](https://github.com/spaced-out/ui-design-system/issues/285)) ([657324a](https://github.com/spaced-out/ui-design-system/commit/657324ae683dbcd702dd54ab1d42f007fadb3db2))
11
+
12
+ ### [0.2.9](https://github.com/spaced-out/ui-design-system/compare/v0.2.8...v0.2.9) (2024-11-08)
13
+
14
+
15
+ ### Features
16
+
17
+ * allow menu to persist open state on option select ([#284](https://github.com/spaced-out/ui-design-system/issues/284)) ([403f6f0](https://github.com/spaced-out/ui-design-system/commit/403f6f091a358a9a83423f7084f4ef9e71d5907e))
18
+
5
19
  ### [0.2.8](https://github.com/spaced-out/ui-design-system/compare/v0.2.8-beta.0...v0.2.8) (2024-10-23)
6
20
 
7
21
  ### [0.2.8-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.2.7...v0.2.8-beta.0) (2024-10-23)
@@ -130,7 +130,9 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
130
130
  }, /*#__PURE__*/React.createElement(_Menu.Menu, _extends({}, menu, {
131
131
  onSelect: (option, e) => {
132
132
  onOptionSelect && onOptionSelect(option, e);
133
- if (!menu.optionsVariant || menu.optionsVariant === 'normal') {
133
+ if (
134
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
135
+ !option.keepMenuOpenOnOptionSelect && (!menu.optionsVariant || menu.optionsVariant === 'normal')) {
134
136
  clickAway();
135
137
  }
136
138
  },
@@ -181,8 +181,9 @@ export const ButtonDropdown: React$AbstractComponent<
181
181
  onSelect={(option, e) => {
182
182
  onOptionSelect && onOptionSelect(option, e);
183
183
  if (
184
- !menu.optionsVariant ||
185
- menu.optionsVariant === 'normal'
184
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
185
+ !option.keepMenuOpenOnOptionSelect &&
186
+ (!menu.optionsVariant || menu.optionsVariant === 'normal')
186
187
  ) {
187
188
  clickAway();
188
189
  }
@@ -99,7 +99,9 @@ const Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
99
99
  }, /*#__PURE__*/React.createElement(_Menu.Menu, _extends({}, menu, {
100
100
  onSelect: (option, e) => {
101
101
  onChange && onChange(option, e);
102
- if (!menu.optionsVariant || menu.optionsVariant === 'normal') {
102
+ if (
103
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
104
+ !option.keepMenuOpenOnOptionSelect && (!menu.optionsVariant || menu.optionsVariant === 'normal')) {
103
105
  clickAway();
104
106
  refs.reference.current.querySelector('input').focus();
105
107
  }
@@ -122,8 +122,9 @@ export const Dropdown: React$AbstractComponent<
122
122
  onSelect={(option, e) => {
123
123
  onChange && onChange(option, e);
124
124
  if (
125
- !menu.optionsVariant ||
126
- menu.optionsVariant === 'normal'
125
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
126
+ !option.keepMenuOpenOnOptionSelect &&
127
+ (!menu.optionsVariant || menu.optionsVariant === 'normal')
127
128
  ) {
128
129
  clickAway();
129
130
  refs.reference.current.querySelector('input').focus();
@@ -93,7 +93,9 @@ const InlineDropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
93
93
  }, /*#__PURE__*/React.createElement(_Menu.Menu, _extends({}, menu, {
94
94
  onSelect: (option, e) => {
95
95
  onOptionSelect && onOptionSelect(option, e);
96
- if (!menu.optionsVariant || menu.optionsVariant === 'normal') {
96
+ if (
97
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
98
+ !option.keepMenuOpenOnOptionSelect && (!menu.optionsVariant || menu.optionsVariant === 'normal')) {
97
99
  clickAway();
98
100
  }
99
101
  },
@@ -134,8 +134,9 @@ export const InlineDropdown: React$AbstractComponent<
134
134
  onSelect={(option, e) => {
135
135
  onOptionSelect && onOptionSelect(option, e);
136
136
  if (
137
- !menu.optionsVariant ||
138
- menu.optionsVariant === 'normal'
137
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
138
+ !option.keepMenuOpenOnOptionSelect &&
139
+ (!menu.optionsVariant || menu.optionsVariant === 'normal')
139
140
  ) {
140
141
  clickAway();
141
142
  }
@@ -47,6 +47,7 @@ export type MenuOption = {
47
47
  disabled?: boolean,
48
48
  optionSize?: MenuSizeTypes,
49
49
  optionVariant?: MenuOptionsVariant,
50
+ keepMenuOpenOnOptionSelect?: boolean,
50
51
  };
51
52
 
52
53
  // Render first available option set
@@ -109,7 +109,9 @@ const BaseTypeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
109
109
  options: menuOptions,
110
110
  onSelect: (option, e) => {
111
111
  onSelect && onSelect(option, e);
112
- if (!menu.optionsVariant || menu.optionsVariant === 'normal') {
112
+ if (
113
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
114
+ !option.keepMenuOpenOnOptionSelect && (!menu.optionsVariant || menu.optionsVariant === 'normal')) {
113
115
  clickAway();
114
116
  }
115
117
  },
@@ -144,8 +144,10 @@ const BaseTypeahead: React$AbstractComponent<
144
144
  onSelect={(option, e) => {
145
145
  onSelect && onSelect(option, e);
146
146
  if (
147
- !menu.optionsVariant ||
148
- menu.optionsVariant === 'normal'
147
+ // option.keepMenuOpenOnOptionSelect - to allow the menu persist its open stat upon option selection in normal variant
148
+ !option.keepMenuOpenOnOptionSelect &&
149
+ (!menu.optionsVariant ||
150
+ menu.optionsVariant === 'normal')
149
151
  ) {
150
152
  clickAway();
151
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {