@spaced-out/ui-design-system 0.1.45 → 0.1.47
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 +14 -0
- package/lib/components/Dropdown/Dropdown.js +1 -3
- package/lib/components/Dropdown/Dropdown.js.flow +0 -2
- package/lib/components/Typeahead/Typeahead.js +1 -3
- package/lib/components/Typeahead/Typeahead.js.flow +0 -2
- package/lib/hooks/useModal/useModal.js +5 -1
- package/lib/hooks/useModal/useModal.js.flow +6 -1
- package/package.json +1 -1
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.1.47](https://github.com/spaced-out/ui-design-system/compare/v0.1.46...v0.1.47) (2023-08-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* background fix for dropdown and typeahead ([2dc52ef](https://github.com/spaced-out/ui-design-system/commit/2dc52ef72eeb557e479c65abfda67d19c1576eee))
|
|
11
|
+
|
|
12
|
+
### [0.1.46](https://github.com/spaced-out/ui-design-system/compare/v0.1.45...v0.1.46) (2023-08-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add delay to clear extras data in use modal ([#140](https://github.com/spaced-out/ui-design-system/issues/140)) ([030c841](https://github.com/spaced-out/ui-design-system/commit/030c84138f2582b8769a8bd249ea1f8a9a125e51))
|
|
18
|
+
|
|
5
19
|
### [0.1.45](https://github.com/spaced-out/ui-design-system/compare/v0.1.44...v0.1.45) (2023-08-29)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Dropdown = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _react2 = require("@floating-ui/react");
|
|
9
|
-
var _color = require("../../styles/variables/_color");
|
|
10
9
|
var _size = require("../../styles/variables/_size");
|
|
11
10
|
var _space = require("../../styles/variables/_space");
|
|
12
11
|
var _classify = require("../../utils/classify");
|
|
@@ -81,8 +80,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
81
80
|
position: strategy,
|
|
82
81
|
top: y ?? _space.spaceNone,
|
|
83
82
|
left: x ?? _space.spaceNone,
|
|
84
|
-
width: _size.sizeFluid
|
|
85
|
-
backgroundColor: _color.colorBackgroundTertiary
|
|
83
|
+
width: _size.sizeFluid
|
|
86
84
|
}
|
|
87
85
|
}, /*#__PURE__*/React.createElement(_Menu.Menu, _extends({}, menu, {
|
|
88
86
|
onSelect: option => {
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
useFloating,
|
|
13
13
|
} from '@floating-ui/react';
|
|
14
14
|
|
|
15
|
-
import {colorBackgroundTertiary} from '../../styles/variables/_color';
|
|
16
15
|
import {sizeFluid} from '../../styles/variables/_size';
|
|
17
16
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
18
17
|
import {classify} from '../../utils/classify';
|
|
@@ -102,7 +101,6 @@ export const Dropdown: React$AbstractComponent<
|
|
|
102
101
|
top: y ?? spaceNone,
|
|
103
102
|
left: x ?? spaceNone,
|
|
104
103
|
width: sizeFluid,
|
|
105
|
-
backgroundColor: colorBackgroundTertiary,
|
|
106
104
|
}}
|
|
107
105
|
>
|
|
108
106
|
<Menu
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Typeahead = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _react2 = require("@floating-ui/react");
|
|
9
|
-
var _color = require("../../styles/variables/_color");
|
|
10
9
|
var _size = require("../../styles/variables/_size");
|
|
11
10
|
var _space = require("../../styles/variables/_space");
|
|
12
11
|
var _classify = require("../../utils/classify");
|
|
@@ -109,8 +108,7 @@ const Typeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
109
108
|
position: strategy,
|
|
110
109
|
top: y ?? _space.spaceNone,
|
|
111
110
|
left: x ?? _space.spaceNone,
|
|
112
|
-
width: _size.sizeFluid
|
|
113
|
-
backgroundColor: _color.colorBackgroundTertiary
|
|
111
|
+
width: _size.sizeFluid
|
|
114
112
|
}
|
|
115
113
|
}, /*#__PURE__*/React.createElement(_Menu.Menu, _extends({}, menu, {
|
|
116
114
|
options: filteredOptions,
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
useFloating,
|
|
13
13
|
} from '@floating-ui/react';
|
|
14
14
|
|
|
15
|
-
import {colorBackgroundTertiary} from '../../styles/variables/_color';
|
|
16
15
|
import {sizeFluid} from '../../styles/variables/_size';
|
|
17
16
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
18
17
|
import {classify} from '../../utils/classify';
|
|
@@ -144,7 +143,6 @@ export const Typeahead: React$AbstractComponent<
|
|
|
144
143
|
top: y ?? spaceNone,
|
|
145
144
|
left: x ?? spaceNone,
|
|
146
145
|
width: sizeFluid,
|
|
147
|
-
backgroundColor: colorBackgroundTertiary,
|
|
148
146
|
}}
|
|
149
147
|
>
|
|
150
148
|
<Menu
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useModal = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _motion = require("../../styles/variables/_motion");
|
|
8
9
|
|
|
9
10
|
const useModal = () => {
|
|
10
11
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
@@ -16,7 +17,10 @@ const useModal = () => {
|
|
|
16
17
|
}, []);
|
|
17
18
|
const closeModal = () => {
|
|
18
19
|
setIsOpen(false);
|
|
19
|
-
|
|
20
|
+
// Since the Dialog close uses animation and its duration is motionDurationNormal, we should clear the data after the animation duration for better user experience
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
setExtras({});
|
|
23
|
+
}, parseInt(_motion.motionDurationNormal));
|
|
20
24
|
};
|
|
21
25
|
return {
|
|
22
26
|
isOpen,
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import {useCallback, useState} from 'react';
|
|
4
4
|
|
|
5
|
+
import {motionDurationNormal} from '../../styles/variables/_motion';
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
export type UseModalExtras = {
|
|
7
9
|
// TODO(Ashwini): Add type for extras
|
|
@@ -27,7 +29,10 @@ export const useModal = (): UseModalReturnType => {
|
|
|
27
29
|
|
|
28
30
|
const closeModal = () => {
|
|
29
31
|
setIsOpen(false);
|
|
30
|
-
|
|
32
|
+
// Since the Dialog close uses animation and its duration is motionDurationNormal, we should clear the data after the animation duration for better user experience
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
setExtras({});
|
|
35
|
+
}, parseInt(motionDurationNormal));
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
return {isOpen, openModal, closeModal, extras};
|