@spaced-out/ui-design-system 0.0.50 → 0.0.52
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 +20 -0
- package/README.md +1 -1
- package/lib/components/Button/Button.js +1 -1
- package/lib/components/Button/Button.js.flow +1 -1
- package/lib/components/Modal/Modal.module.css +3 -2
- package/lib/components/Panel/Panel.module.css +2 -0
- package/lib/components/Text/Text.js +9 -2
- package/lib/components/Text/Text.js.flow +11 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
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.52](https://github.com/spaced-out/ui-design-system/compare/v0.0.51...v0.0.52) (2023-03-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* modal positioning fix ([0697163](https://github.com/spaced-out/ui-design-system/commit/0697163bdafbb71828a3282a14e0fe8579998278))
|
|
11
|
+
|
|
12
|
+
### [0.0.51](https://github.com/spaced-out/ui-design-system/compare/v0.0.50...v0.0.51) (2023-03-20)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* text highlighting now supports array of string ([bc7604f](https://github.com/spaced-out/ui-design-system/commit/bc7604fc552ec1e61275d93f792ea9a8267279a5))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* button right icon only type fix ([#81](https://github.com/spaced-out/ui-design-system/issues/81)) ([3e8b819](https://github.com/spaced-out/ui-design-system/commit/3e8b819be701fd31746a944b7be32ed739dfd632))
|
|
23
|
+
* updated picker usage ([9344611](https://github.com/spaced-out/ui-design-system/commit/934461138f750c2e748c1be146204350cfad9041))
|
|
24
|
+
|
|
5
25
|
### [0.0.50](https://github.com/spaced-out/ui-design-system/compare/v0.0.49...v0.0.50) (2023-03-13)
|
|
6
26
|
|
|
7
27
|
|
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ CSS use:
|
|
|
89
89
|
JS use:
|
|
90
90
|
|
|
91
91
|
```js
|
|
92
|
-
import size2 from "@spaced-out/ui-design-system/lib/styles/variables/_size.js";
|
|
92
|
+
import {size2} from "@spaced-out/ui-design-system/lib/styles/variables/_size.js";
|
|
93
93
|
import * as SIZES from "@spaced-out/ui-design-system/lib/styles/variables/_size.js";
|
|
94
94
|
```
|
|
95
95
|
|
|
@@ -104,7 +104,7 @@ const Button = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
104
104
|
name: iconLeftName || iconRightName,
|
|
105
105
|
color: disabled ? 'disabled' : ButtonTypeToIconColorMap[type],
|
|
106
106
|
size: size === 'medium' ? 'medium' : 'small',
|
|
107
|
-
type: iconLeftType
|
|
107
|
+
type: iconLeftName ? iconLeftType : iconRightType,
|
|
108
108
|
className: classNames?.icon
|
|
109
109
|
}) :
|
|
110
110
|
// has icon _and_ child
|
|
@@ -153,7 +153,7 @@ export const Button: React$AbstractComponent<ButtonProps, HTMLButtonElement> =
|
|
|
153
153
|
name={iconLeftName || iconRightName}
|
|
154
154
|
color={disabled ? 'disabled' : ButtonTypeToIconColorMap[type]}
|
|
155
155
|
size={size === 'medium' ? 'medium' : 'small'}
|
|
156
|
-
type={iconLeftType
|
|
156
|
+
type={iconLeftName ? iconLeftType : iconRightType}
|
|
157
157
|
className={classNames?.icon}
|
|
158
158
|
/>
|
|
159
159
|
) : (
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
.modal {
|
|
16
16
|
position: fixed;
|
|
17
17
|
top: spaceHalfFluid;
|
|
18
|
-
|
|
18
|
+
left: spaceHalfFluid;
|
|
19
|
+
transform: translate(spaceNegHalfFluid, spaceNegHalfFluid) scale(0.95);
|
|
19
20
|
opacity: opacity0;
|
|
20
21
|
composes: boxShadow4 from '../../styles/shadow.module.css';
|
|
21
22
|
display: flex;
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
|
|
31
32
|
.modalContainer.open.in .modal {
|
|
32
33
|
opacity: opacity100;
|
|
33
|
-
transform:
|
|
34
|
+
transform: translate(spaceNegHalfFluid, spaceNegHalfFluid) scale(1);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.backdrop {
|
|
@@ -27,12 +27,14 @@
|
|
|
27
27
|
.panel.left {
|
|
28
28
|
top: spaceNone;
|
|
29
29
|
left: spaceNone;
|
|
30
|
+
right: initial;
|
|
30
31
|
transform: translateX(spaceNegFluid);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
.panel.right {
|
|
34
35
|
top: spaceNone;
|
|
35
36
|
right: spaceNone;
|
|
37
|
+
left: initial;
|
|
36
38
|
transform: translateX(spaceFluid);
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -21,8 +21,15 @@ const HighlightText = _ref => {
|
|
|
21
21
|
highlightWithBackground
|
|
22
22
|
} = _ref;
|
|
23
23
|
// Split text on highlight term, include term itself into parts, ignore case
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
let highlights = '';
|
|
25
|
+
if (Array.isArray(highlight)) {
|
|
26
|
+
highlights = highlight.join('|');
|
|
27
|
+
} else {
|
|
28
|
+
highlights = highlight;
|
|
29
|
+
}
|
|
30
|
+
const parts = text.split(new RegExp(`(${highlights})`, caseSensitiveHighlighting ? '' : 'gi'));
|
|
31
|
+
return /*#__PURE__*/React.createElement("span", null, parts.map(part => highlights.toLowerCase().includes(part.toLowerCase()) ? /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
key: part,
|
|
26
33
|
className: (0, _classify.default)(_typographyModule.default.highlightText, {
|
|
27
34
|
[_typographyModule.default.bgHighlighting]: highlightWithBackground
|
|
28
35
|
}, highlightClassName)
|
|
@@ -14,7 +14,7 @@ export type TextProps = {
|
|
|
14
14
|
children?: React.Node,
|
|
15
15
|
className?: string,
|
|
16
16
|
highlightedTextClassName?: string,
|
|
17
|
-
highlightString?: string,
|
|
17
|
+
highlightString?: string | string[],
|
|
18
18
|
caseSensitiveHighlighting?: boolean,
|
|
19
19
|
highlightWithBackground?: boolean,
|
|
20
20
|
...
|
|
@@ -22,7 +22,7 @@ export type TextProps = {
|
|
|
22
22
|
|
|
23
23
|
export type HighlightTextProps = {
|
|
24
24
|
text: string,
|
|
25
|
-
highlight: string,
|
|
25
|
+
highlight: string | string[],
|
|
26
26
|
highlightClassName?: string,
|
|
27
27
|
caseSensitiveHighlighting?: boolean,
|
|
28
28
|
highlightWithBackground?: boolean,
|
|
@@ -36,14 +36,21 @@ const HighlightText = ({
|
|
|
36
36
|
highlightWithBackground,
|
|
37
37
|
}: HighlightTextProps) => {
|
|
38
38
|
// Split text on highlight term, include term itself into parts, ignore case
|
|
39
|
+
let highlights = '';
|
|
40
|
+
if (Array.isArray(highlight)) {
|
|
41
|
+
highlights = highlight.join('|');
|
|
42
|
+
} else {
|
|
43
|
+
highlights = highlight;
|
|
44
|
+
}
|
|
39
45
|
const parts = text.split(
|
|
40
|
-
new RegExp(`(${
|
|
46
|
+
new RegExp(`(${highlights})`, caseSensitiveHighlighting ? '' : 'gi'),
|
|
41
47
|
);
|
|
42
48
|
return (
|
|
43
49
|
<span>
|
|
44
50
|
{parts.map((part) =>
|
|
45
|
-
|
|
51
|
+
highlights.toLowerCase().includes(part.toLowerCase()) ? (
|
|
46
52
|
<span
|
|
53
|
+
key={part}
|
|
47
54
|
className={classify(
|
|
48
55
|
css.highlightText,
|
|
49
56
|
{
|