@spaced-out/ui-design-system 0.0.3-beta.0 → 0.0.3-beta.1
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 +7 -0
- package/lib/components/Checkbox/CheckboxGroup.js +1 -1
- package/lib/components/Checkbox/CheckboxGroup.js.flow +1 -1
- package/lib/components/Checkbox/index.js +2 -2
- package/lib/components/Checkbox/index.js.flow +2 -2
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dialog/Dialog.js.flow +2 -2
- package/lib/components/Dialog/index.js +1 -1
- package/lib/components/Dialog/index.js.flow +2 -2
- package/lib/components/Icon/index.js +1 -1
- package/lib/components/Icon/index.js.flow +1 -1
- package/lib/components/Modal/Modal.js +4 -4
- package/lib/components/Modal/Modal.js.flow +5 -5
- package/lib/components/Modal/index.js +19 -1
- package/lib/components/Modal/index.js.flow +7 -2
- package/lib/components/Panel/Panel.js +3 -1
- package/lib/components/Panel/Panel.js.flow +2 -0
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/Panel/index.js.flow +2 -2
- package/lib/components/RadioButton/RadioGroup.js +1 -1
- package/lib/components/RadioButton/RadioGroup.js.flow +1 -1
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButton/index.js.flow +2 -2
- package/lib/components/Toggle/index.js +1 -1
- package/lib/components/Toggle/index.js.flow +1 -1
- package/lib/components/Truncate/Truncate.js +12 -6
- package/lib/components/Truncate/Truncate.js.flow +15 -3
- package/package.json +1 -1
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.3-beta.1 (2022-11-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* rename showBackdrop in modal to hideBackdrop and releated changes ([303c4d8](https://github.com/Spaced-Out/ui-design-system/commit/303c4d8c95aa75219cf5eca682ebdecf53c27e7c))
|
|
11
|
+
|
|
5
12
|
### 0.0.3-beta.0 (2022-11-21)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CheckboxGroup = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
-
var _Text = require("../Text/Text
|
|
9
|
+
var _Text = require("../Text/Text");
|
|
10
10
|
var _CheckboxGroupModule = _interopRequireDefault(require("./CheckboxGroup.module.css"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import type {GroupAlign} from '../../types/common';
|
|
6
6
|
import classify from '../../utils/classify';
|
|
7
|
-
import {BodySmall} from '../Text/Text
|
|
7
|
+
import {BodySmall} from '../Text/Text';
|
|
8
8
|
|
|
9
9
|
import css from './CheckboxGroup.module.css';
|
|
10
10
|
|
|
@@ -15,5 +15,5 @@ Object.defineProperty(exports, "CheckboxGroup", {
|
|
|
15
15
|
return _CheckboxGroup.CheckboxGroup;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var _Checkbox = require("./Checkbox
|
|
19
|
-
var _CheckboxGroup = require("./CheckboxGroup
|
|
18
|
+
var _Checkbox = require("./Checkbox");
|
|
19
|
+
var _CheckboxGroup = require("./CheckboxGroup");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {Checkbox} from './Checkbox
|
|
3
|
-
export {CheckboxGroup} from './CheckboxGroup
|
|
2
|
+
export {Checkbox} from './Checkbox';
|
|
3
|
+
export {CheckboxGroup} from './CheckboxGroup';
|
|
@@ -101,7 +101,7 @@ const Dialog = _ref5 => {
|
|
|
101
101
|
let {
|
|
102
102
|
children,
|
|
103
103
|
isOpen = false,
|
|
104
|
-
|
|
104
|
+
hideBackdrop = false,
|
|
105
105
|
onClose,
|
|
106
106
|
tapOutsideToClose = false,
|
|
107
107
|
iconName = '',
|
|
@@ -111,7 +111,7 @@ const Dialog = _ref5 => {
|
|
|
111
111
|
return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
|
|
112
112
|
isOpen: isOpen,
|
|
113
113
|
onClose: onClose,
|
|
114
|
-
|
|
114
|
+
hideBackdrop: hideBackdrop,
|
|
115
115
|
tapOutsideToClose: tapOutsideToClose
|
|
116
116
|
}, restDialogProps, {
|
|
117
117
|
classNames: {
|
|
@@ -130,7 +130,7 @@ export const DialogFooter = ({children}: DialogFooterProps): React.Node => (
|
|
|
130
130
|
export const Dialog = ({
|
|
131
131
|
children,
|
|
132
132
|
isOpen = false,
|
|
133
|
-
|
|
133
|
+
hideBackdrop = false,
|
|
134
134
|
onClose,
|
|
135
135
|
tapOutsideToClose = false,
|
|
136
136
|
iconName = '',
|
|
@@ -140,7 +140,7 @@ export const Dialog = ({
|
|
|
140
140
|
<Modal
|
|
141
141
|
isOpen={isOpen}
|
|
142
142
|
onClose={onClose}
|
|
143
|
-
|
|
143
|
+
hideBackdrop={hideBackdrop}
|
|
144
144
|
tapOutsideToClose={tapOutsideToClose}
|
|
145
145
|
{...restDialogProps}
|
|
146
146
|
classNames={{
|
|
@@ -4,11 +4,11 @@ export type {
|
|
|
4
4
|
DialogFooterProps,
|
|
5
5
|
DialogHeaderProps,
|
|
6
6
|
DialogProps,
|
|
7
|
-
} from './Dialog
|
|
7
|
+
} from './Dialog';
|
|
8
8
|
export {
|
|
9
9
|
Dialog,
|
|
10
10
|
DIALOG_SEMANTIC,
|
|
11
11
|
DialogBody,
|
|
12
12
|
DialogFooter,
|
|
13
13
|
DialogHeader,
|
|
14
|
-
} from './Dialog
|
|
14
|
+
} from './Dialog';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
3
|
export type {CloseIconProps} from './ClickableIcon';
|
|
4
|
-
export {ClickableIcon, CloseIcon} from './ClickableIcon
|
|
4
|
+
export {ClickableIcon, CloseIcon} from './ClickableIcon';
|
|
5
5
|
export type {IconProps, IconSize, IconType} from './Icon';
|
|
6
6
|
export {Icon} from './Icon';
|
|
@@ -10,8 +10,8 @@ var _reactDomInteractions = require("@floating-ui/react-dom-interactions");
|
|
|
10
10
|
var _useMountTransition = _interopRequireDefault(require("../../hooks/useMountTransition"));
|
|
11
11
|
var _motion = require("../../styles/variables/_motion");
|
|
12
12
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
13
|
-
var _Button = require("../Button/Button
|
|
14
|
-
var _Truncate = require("../Truncate/Truncate
|
|
13
|
+
var _Button = require("../Button/Button");
|
|
14
|
+
var _Truncate = require("../Truncate/Truncate");
|
|
15
15
|
var _ModalModule = _interopRequireDefault(require("./Modal.module.css"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -68,7 +68,7 @@ const Modal = _ref4 => {
|
|
|
68
68
|
children,
|
|
69
69
|
isOpen = false,
|
|
70
70
|
onClose,
|
|
71
|
-
|
|
71
|
+
hideBackdrop = false,
|
|
72
72
|
removeWhenClosed = true,
|
|
73
73
|
tapOutsideToClose = true,
|
|
74
74
|
initialFocus = -1
|
|
@@ -146,7 +146,7 @@ const Modal = _ref4 => {
|
|
|
146
146
|
}, classNames?.container)
|
|
147
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
148
148
|
className: (0, _classify.default)(_ModalModule.default.backdrop, {
|
|
149
|
-
[_ModalModule.default.darkBackdrop]:
|
|
149
|
+
[_ModalModule.default.darkBackdrop]: !hideBackdrop
|
|
150
150
|
}, classNames?.backdrop),
|
|
151
151
|
onClick: onBackdropClick
|
|
152
152
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import useMountTransition from '../../hooks/useMountTransition';
|
|
14
14
|
import {motionDurationNormal} from '../../styles/variables/_motion';
|
|
15
15
|
import classify from '../../utils/classify';
|
|
16
|
-
import {Button} from '../Button/Button
|
|
17
|
-
import {Truncate} from '../Truncate/Truncate
|
|
16
|
+
import {Button} from '../Button/Button';
|
|
17
|
+
import {Truncate} from '../Truncate/Truncate';
|
|
18
18
|
|
|
19
19
|
import css from './Modal.module.css';
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ export type ModalProps = {
|
|
|
30
30
|
children?: React.Node,
|
|
31
31
|
isOpen?: boolean,
|
|
32
32
|
onClose?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
33
|
-
|
|
33
|
+
hideBackdrop?: boolean,
|
|
34
34
|
removeWhenClosed?: boolean,
|
|
35
35
|
tapOutsideToClose?: boolean,
|
|
36
36
|
initialFocus?: number,
|
|
@@ -100,7 +100,7 @@ export const Modal = ({
|
|
|
100
100
|
children,
|
|
101
101
|
isOpen = false,
|
|
102
102
|
onClose,
|
|
103
|
-
|
|
103
|
+
hideBackdrop = false,
|
|
104
104
|
removeWhenClosed = true,
|
|
105
105
|
tapOutsideToClose = true,
|
|
106
106
|
initialFocus = -1,
|
|
@@ -195,7 +195,7 @@ export const Modal = ({
|
|
|
195
195
|
className={classify(
|
|
196
196
|
css.backdrop,
|
|
197
197
|
{
|
|
198
|
-
[css.darkBackdrop]:
|
|
198
|
+
[css.darkBackdrop]: !hideBackdrop,
|
|
199
199
|
},
|
|
200
200
|
classNames?.backdrop,
|
|
201
201
|
)}
|
|
@@ -9,4 +9,22 @@ Object.defineProperty(exports, "Modal", {
|
|
|
9
9
|
return _Modal.Modal;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
Object.defineProperty(exports, "ModalBody", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Modal.ModalBody;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ModalFooter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _Modal.ModalFooter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ModalHeader", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _Modal.ModalHeader;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _Modal = require("./Modal");
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export type {
|
|
3
|
-
|
|
2
|
+
export type {
|
|
3
|
+
ModalBodyProps,
|
|
4
|
+
ModalFooterProps,
|
|
5
|
+
ModalHeaderProps,
|
|
6
|
+
ModalProps,
|
|
7
|
+
} from './Modal';
|
|
8
|
+
export {Modal, ModalBody, ModalFooter, ModalHeader} from './Modal';
|
|
@@ -61,12 +61,14 @@ const Panel = _ref4 => {
|
|
|
61
61
|
size = 'medium',
|
|
62
62
|
anchor = 'left',
|
|
63
63
|
onClose,
|
|
64
|
+
hideBackdrop = true,
|
|
64
65
|
...restPanelProps
|
|
65
66
|
} = _ref4;
|
|
66
67
|
const isTransitioning = (0, _useMountTransition.default)(isOpen, parseInt(_motion.motionDurationNormal));
|
|
67
68
|
return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
|
|
68
69
|
isOpen: isOpen,
|
|
69
|
-
onClose: onClose
|
|
70
|
+
onClose: onClose,
|
|
71
|
+
hideBackdrop: hideBackdrop
|
|
70
72
|
}, restPanelProps, {
|
|
71
73
|
classNames: {
|
|
72
74
|
container: (0, _classify.default)(_PanelModule.default.panelContainer, {
|
|
@@ -80,6 +80,7 @@ export const Panel = ({
|
|
|
80
80
|
size = 'medium',
|
|
81
81
|
anchor = 'left',
|
|
82
82
|
onClose,
|
|
83
|
+
hideBackdrop = true,
|
|
83
84
|
...restPanelProps
|
|
84
85
|
}: PanelProps): React.Node => {
|
|
85
86
|
const isTransitioning = useMountTransition(
|
|
@@ -91,6 +92,7 @@ export const Panel = ({
|
|
|
91
92
|
<Modal
|
|
92
93
|
isOpen={isOpen}
|
|
93
94
|
onClose={onClose}
|
|
95
|
+
hideBackdrop={hideBackdrop}
|
|
94
96
|
{...restPanelProps}
|
|
95
97
|
classNames={{
|
|
96
98
|
container: classify(css.panelContainer, {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RadioGroup = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
-
var _Text = require("../Text/Text
|
|
9
|
+
var _Text = require("../Text/Text");
|
|
10
10
|
var _RadioGroupModule = _interopRequireDefault(require("./RadioGroup.module.css"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import type {GroupAlign} from '../../types/common';
|
|
6
6
|
import classify from '../../utils/classify';
|
|
7
|
-
import {BodySmall} from '../Text/Text
|
|
7
|
+
import {BodySmall} from '../Text/Text';
|
|
8
8
|
|
|
9
9
|
import css from './RadioGroup.module.css';
|
|
10
10
|
|
|
@@ -15,5 +15,5 @@ Object.defineProperty(exports, "RadioGroup", {
|
|
|
15
15
|
return _RadioGroup.RadioGroup;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var _RadioButton = require("./RadioButton
|
|
19
|
-
var _RadioGroup = require("./RadioGroup
|
|
18
|
+
var _RadioButton = require("./RadioButton");
|
|
19
|
+
var _RadioGroup = require("./RadioGroup");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {RadioButton} from './RadioButton
|
|
3
|
-
export {RadioGroup} from './RadioGroup
|
|
2
|
+
export {RadioButton} from './RadioButton';
|
|
3
|
+
export {RadioGroup} from './RadioGroup';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {Toggle} from './Toggle
|
|
2
|
+
export {Toggle} from './Toggle';
|
|
@@ -14,37 +14,43 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
const BaseTruncate = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
children,
|
|
17
|
-
line = 1
|
|
17
|
+
line = 1,
|
|
18
|
+
showFullTextOnHover = false
|
|
18
19
|
} = _ref;
|
|
19
20
|
return /*#__PURE__*/React.createElement("span", {
|
|
20
21
|
className: (0, _classify.classify)(_TruncateModule.default.truncateLineClamp),
|
|
21
22
|
style: {
|
|
22
23
|
WebkitLineClamp: `${line}`
|
|
23
|
-
}
|
|
24
|
+
},
|
|
25
|
+
title: showFullTextOnHover ? children : ''
|
|
24
26
|
}, children);
|
|
25
27
|
};
|
|
26
28
|
exports.BaseTruncate = BaseTruncate;
|
|
27
29
|
const Truncate = _ref2 => {
|
|
28
30
|
let {
|
|
29
31
|
children,
|
|
30
|
-
line = 1
|
|
32
|
+
line = 1,
|
|
33
|
+
showFullTextOnHover = false
|
|
31
34
|
} = _ref2;
|
|
32
35
|
const arrayChildren = React.Children.toArray(children);
|
|
33
36
|
if (arrayChildren.length) {
|
|
34
37
|
const child = arrayChildren[0];
|
|
35
38
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
36
39
|
const {
|
|
37
|
-
className
|
|
40
|
+
className,
|
|
41
|
+
children
|
|
38
42
|
} = child.props;
|
|
39
43
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
40
44
|
className: (0, _classify.classify)(_TruncateModule.default.truncateLineClamp, className),
|
|
41
45
|
style: {
|
|
42
46
|
WebkitLineClamp: `${line}`
|
|
43
|
-
}
|
|
47
|
+
},
|
|
48
|
+
title: showFullTextOnHover ? children : ''
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
51
|
return /*#__PURE__*/React.createElement(BaseTruncate, {
|
|
47
|
-
line: line
|
|
52
|
+
line: line,
|
|
53
|
+
showFullTextOnHover: showFullTextOnHover
|
|
48
54
|
}, children);
|
|
49
55
|
}
|
|
50
56
|
return null;
|
|
@@ -10,33 +10,45 @@ import css from './Truncate.module.css';
|
|
|
10
10
|
export type TruncateProps = {
|
|
11
11
|
children?: React.Node,
|
|
12
12
|
line?: number,
|
|
13
|
+
showFullTextOnHover?: boolean,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const BaseTruncate = ({
|
|
16
17
|
children,
|
|
17
18
|
line = 1,
|
|
19
|
+
showFullTextOnHover = false,
|
|
18
20
|
}: TruncateProps): React.Node => (
|
|
19
21
|
<span
|
|
20
22
|
className={classify(css.truncateLineClamp)}
|
|
21
23
|
style={{WebkitLineClamp: `${line}`}}
|
|
24
|
+
title={showFullTextOnHover ? children : ''}
|
|
22
25
|
>
|
|
23
26
|
{children}
|
|
24
27
|
</span>
|
|
25
28
|
);
|
|
26
29
|
|
|
27
|
-
export const Truncate = ({
|
|
30
|
+
export const Truncate = ({
|
|
31
|
+
children,
|
|
32
|
+
line = 1,
|
|
33
|
+
showFullTextOnHover = false,
|
|
34
|
+
}: TruncateProps): React.Node => {
|
|
28
35
|
const arrayChildren = React.Children.toArray(children);
|
|
29
36
|
if (arrayChildren.length) {
|
|
30
37
|
const child = arrayChildren[0];
|
|
31
38
|
if (React.isValidElement(child)) {
|
|
32
|
-
const {className} = child.props;
|
|
39
|
+
const {className, children} = child.props;
|
|
33
40
|
|
|
34
41
|
return React.cloneElement(child, {
|
|
35
42
|
className: classify(css.truncateLineClamp, className),
|
|
36
43
|
style: {WebkitLineClamp: `${line}`},
|
|
44
|
+
title: showFullTextOnHover ? children : '',
|
|
37
45
|
});
|
|
38
46
|
}
|
|
39
|
-
return
|
|
47
|
+
return (
|
|
48
|
+
<BaseTruncate line={line} showFullTextOnHover={showFullTextOnHover}>
|
|
49
|
+
{children}
|
|
50
|
+
</BaseTruncate>
|
|
51
|
+
);
|
|
40
52
|
}
|
|
41
53
|
return null;
|
|
42
54
|
};
|