@spaced-out/ui-design-system 0.1.42 → 0.1.44-beta.0
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/.cspell/custom-words.txt +2 -0
- package/.github/workflows/publish_to_npm.yml +1 -1
- package/.storybook/SenseTheme.js +1 -1
- package/.storybook/manager-head.html +1 -1
- package/.storybook/preview-head.html +5 -0
- package/CHANGELOG.md +23 -0
- package/CONTRIBUTING.md +9 -2
- package/README.md +48 -38
- package/design-tokens/color/app-color.json +1 -1
- package/lib/components/ButtonDropdown/ButtonDropdown.js +8 -2
- package/lib/components/ButtonDropdown/ButtonDropdown.js.flow +10 -1
- package/lib/components/Chip/Chip.js +10 -2
- package/lib/components/Chip/Chip.js.flow +24 -4
- package/lib/components/Chip/Chip.module.css +4 -0
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.js +17 -4
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.js.flow +36 -23
- package/lib/components/Icon/Icon.js +0 -3
- package/lib/components/Icon/Icon.js.flow +0 -3
- package/lib/components/StatusIndicator/StatusIndicator.js +6 -2
- package/lib/components/StatusIndicator/StatusIndicator.js.flow +5 -0
- package/lib/components/StatusIndicator/StatusIndicator.module.css +20 -7
- package/lib/components/Table/TableBar.module.css +1 -1
- package/lib/components/Text/Text.js +13 -13
- package/lib/components/Text/Text.js.flow +56 -43
- package/lib/styles/index.css +1 -1
- package/lib/styles/index.js +1 -1
- package/lib/styles/index.js.flow +1 -1
- package/lib/styles/variables/_color.css +1 -1
- package/lib/styles/variables/_color.js +1 -1
- package/lib/styles/variables/_color.js.flow +1 -1
- package/package.json +2 -2
- package/.storybook/public/images/Alias.png +0 -0
- package/.storybook/public/images/Base.png +0 -0
- package/.storybook/public/images/Logo.png +0 -0
- package/.storybook/public/images/component-token.png +0 -0
- package/.storybook/public/images/components.png +0 -0
- package/.storybook/public/images/contributions.png +0 -0
- package/.storybook/public/images/design-tokens.png +0 -0
- package/.storybook/public/images/intro-cover.png +0 -0
- package/.storybook/public/images/personas/1.png +0 -0
- package/.storybook/public/images/personas/2.png +0 -0
- package/.storybook/public/images/personas/3.png +0 -0
- package/.storybook/public/images/personas/4.png +0 -0
- package/.storybook/public/images/personas/5.png +0 -0
- package/.storybook/public/images/personas/6.png +0 -0
- package/.storybook/public/images/usage.png +0 -0
- package/lib/assets/fontawesome/LICENSE.txt +0 -18
- package/lib/assets/fontawesome/css/all.min.css +0 -27184
- package/lib/assets/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-duotone-900.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-duotone-900.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-light-300.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-light-300.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-thin-100.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-thin-100.woff2 +0 -0
- package/lib/assets/fontawesome/webfonts/fa-v4compatibility.ttf +0 -0
- package/lib/assets/fontawesome/webfonts/fa-v4compatibility.woff2 +0 -0
- package/lib/components/Icon/FontAwesomeLibrary.js +0 -3
- package/lib/components/Icon/FontAwesomeLibrary.js.flow +0 -3
|
@@ -11,11 +11,13 @@ import css from './StatusIndicator.module.css';
|
|
|
11
11
|
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
12
12
|
|
|
13
13
|
export const STATUS_SEMANTIC = Object.freeze({
|
|
14
|
+
primary: 'primary',
|
|
14
15
|
information: 'information',
|
|
15
16
|
success: 'success',
|
|
16
17
|
warning: 'warning',
|
|
17
18
|
danger: 'danger',
|
|
18
19
|
neutral: 'neutral',
|
|
20
|
+
secondary: 'secondary',
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export type StatusSemanticType = $Values<typeof STATUS_SEMANTIC>;
|
|
@@ -25,6 +27,7 @@ export type StatusIndicatorProps = {
|
|
|
25
27
|
status?: StatusSemanticType,
|
|
26
28
|
withBorder?: boolean,
|
|
27
29
|
borderColorToken?: $Keys<typeof COLORS>,
|
|
30
|
+
disabled?: boolean,
|
|
28
31
|
...
|
|
29
32
|
};
|
|
30
33
|
|
|
@@ -38,6 +41,7 @@ export const StatusIndicator: React$AbstractComponent<
|
|
|
38
41
|
status = 'information',
|
|
39
42
|
withBorder,
|
|
40
43
|
borderColorToken = 'colorBackgroundTertiary',
|
|
44
|
+
disabled,
|
|
41
45
|
...props
|
|
42
46
|
}: StatusIndicatorProps,
|
|
43
47
|
ref,
|
|
@@ -50,6 +54,7 @@ export const StatusIndicator: React$AbstractComponent<
|
|
|
50
54
|
css[status],
|
|
51
55
|
{
|
|
52
56
|
[css.withBorder]: withBorder,
|
|
57
|
+
[css.disabled]: disabled,
|
|
53
58
|
},
|
|
54
59
|
classNames?.wrapper,
|
|
55
60
|
)}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
@value (
|
|
1
|
+
@value (
|
|
2
|
+
colorTextInformation,
|
|
3
|
+
colorTextSuccess,
|
|
4
|
+
colorTextWarning,
|
|
5
|
+
colorTextDanger,
|
|
6
|
+
colorTextNeutral,
|
|
7
|
+
colorBackgroundTertiary,
|
|
8
|
+
colorTextPrimary,
|
|
9
|
+
colorTextDisabled
|
|
10
|
+
) from '../../styles/variables/_color.css';
|
|
2
11
|
@value (size8) from '../../styles/variables/_size.css';
|
|
3
12
|
@value (borderRadiusCircle, borderWidthTertiary) from '../../styles/variables/_border.css';
|
|
4
13
|
|
|
@@ -9,28 +18,32 @@
|
|
|
9
18
|
width: size8;
|
|
10
19
|
height: size8;
|
|
11
20
|
border-radius: borderRadiusCircle;
|
|
12
|
-
background-color:
|
|
21
|
+
background-color: colorTextPrimary;
|
|
13
22
|
box-sizing: content-box;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
.information {
|
|
17
|
-
background-color:
|
|
26
|
+
background-color: colorTextInformation;
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
.success {
|
|
21
|
-
background-color:
|
|
30
|
+
background-color: colorTextSuccess;
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
.warning {
|
|
25
|
-
background-color:
|
|
34
|
+
background-color: colorTextWarning;
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
.danger {
|
|
29
|
-
background-color:
|
|
38
|
+
background-color: colorTextDanger;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
.neutral {
|
|
33
|
-
background-color:
|
|
42
|
+
background-color: colorTextNeutral;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.disabled {
|
|
46
|
+
background-color: colorTextDisabled;
|
|
34
47
|
}
|
|
35
48
|
|
|
36
49
|
.withBorder {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@value (spaceNone, spaceXXSmall, spaceXSmall, spaceSmall, spaceMedium, spaceHalfFluid, spaceNegHalfFluid) from '../../styles/variables/_space.css';
|
|
2
|
-
@value (size2, size22, size48, size60, size240, size300) from '../../styles/variables/_size.css';
|
|
2
|
+
@value (size2, size22, size48, size60, size240, size300, sizeFluid) from '../../styles/variables/_size.css';
|
|
3
3
|
@value (borderRadiusMedium, borderRadiusNone) from '../../styles/variables/_border.css';
|
|
4
4
|
@value (colorBackgroundTertiary) from '../../styles/variables/_color.css';
|
|
5
5
|
@value (elevationMenu) from '../../styles/variables/_elevation.css';
|
|
@@ -22,22 +22,22 @@ const HighlightText = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
22
22
|
highlightWithBackground
|
|
23
23
|
} = _ref;
|
|
24
24
|
// Split text on highlight term, include term itself into parts, ignore case
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} else {
|
|
29
|
-
highlights = (0, _string.escapeRegExp)(highlight);
|
|
30
|
-
}
|
|
25
|
+
// Convert highlight to an array if it's not already
|
|
26
|
+
const highlightArray = [].concat(highlight).filter(item => item !== '');
|
|
27
|
+
const highlights = highlightArray.map(_string.escapeRegExp).join('|');
|
|
31
28
|
const parts = text.split(new RegExp(`(${highlights})`, caseSensitiveHighlighting ? '' : 'gi')).filter(part => part !== '');
|
|
32
29
|
return /*#__PURE__*/React.createElement("span", {
|
|
33
30
|
ref: ref
|
|
34
|
-
}, parts.map((part, idx) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
}, parts.map((part, idx) => {
|
|
32
|
+
const isHighlighted = highlightArray.some(highlightTerm => caseSensitiveHighlighting ? (0, _string.escapeRegExp)(part).includes((0, _string.escapeRegExp)(highlightTerm)) : (0, _string.escapeRegExp)(part).toLowerCase().includes((0, _string.escapeRegExp)(highlightTerm).toLowerCase()));
|
|
33
|
+
return isHighlighted ? /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
35
|
+
key: idx,
|
|
36
|
+
className: (0, _classify.default)(_typographyModule.default.highlightText, {
|
|
37
|
+
[_typographyModule.default.bgHighlighting]: highlightWithBackground
|
|
38
|
+
}, highlightClassName)
|
|
39
|
+
}, part) : part;
|
|
40
|
+
}));
|
|
41
41
|
});
|
|
42
42
|
const JumboMedium = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
43
43
|
let {
|
|
@@ -29,51 +29,64 @@ export type HighlightTextProps = {
|
|
|
29
29
|
highlightWithBackground?: boolean,
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const HighlightText: React$AbstractComponent<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
const HighlightText: React$AbstractComponent<
|
|
33
|
+
HighlightTextProps,
|
|
34
|
+
HTMLSpanElement,
|
|
35
|
+
> = React.forwardRef<HighlightTextProps, HTMLSpanElement>(
|
|
36
|
+
(
|
|
37
|
+
{
|
|
38
|
+
text,
|
|
39
|
+
highlight,
|
|
40
|
+
highlightClassName,
|
|
41
|
+
caseSensitiveHighlighting,
|
|
42
|
+
highlightWithBackground,
|
|
43
|
+
}: HighlightTextProps,
|
|
44
|
+
ref,
|
|
45
|
+
) => {
|
|
46
|
+
// Split text on highlight term, include term itself into parts, ignore case
|
|
47
|
+
// Convert highlight to an array if it's not already
|
|
48
|
+
const highlightArray = [].concat(highlight).filter((item) => item !== '');
|
|
49
|
+
const highlights = highlightArray.map(escapeRegExp).join('|');
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const parts = text
|
|
52
|
+
.split(
|
|
53
|
+
new RegExp(`(${highlights})`, caseSensitiveHighlighting ? '' : 'gi'),
|
|
54
|
+
)
|
|
55
|
+
.filter((part) => part !== '');
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
57
|
+
return (
|
|
58
|
+
<span ref={ref}>
|
|
59
|
+
{parts.map((part, idx) => {
|
|
60
|
+
const isHighlighted = highlightArray.some((highlightTerm) =>
|
|
61
|
+
caseSensitiveHighlighting
|
|
62
|
+
? escapeRegExp(part).includes(escapeRegExp(highlightTerm))
|
|
63
|
+
: escapeRegExp(part)
|
|
64
|
+
.toLowerCase()
|
|
65
|
+
.includes(escapeRegExp(highlightTerm).toLowerCase()),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return isHighlighted ? (
|
|
69
|
+
<span
|
|
70
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
71
|
+
key={idx}
|
|
72
|
+
className={classify(
|
|
73
|
+
css.highlightText,
|
|
74
|
+
{
|
|
75
|
+
[css.bgHighlighting]: highlightWithBackground,
|
|
76
|
+
},
|
|
77
|
+
highlightClassName,
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
{part}
|
|
81
|
+
</span>
|
|
82
|
+
) : (
|
|
83
|
+
part
|
|
84
|
+
);
|
|
85
|
+
})}
|
|
86
|
+
</span>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
);
|
|
77
90
|
|
|
78
91
|
export const JumboMedium: React$AbstractComponent<TextProps, HTMLSpanElement> =
|
|
79
92
|
React.forwardRef<TextProps, HTMLSpanElement>(
|
package/lib/styles/index.css
CHANGED
package/lib/styles/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const colorTextDanger = '#cf1945';
|
|
|
53
53
|
exports.colorTextDanger = colorTextDanger;
|
|
54
54
|
const colorTextInversePrimary = '#ffffff';
|
|
55
55
|
exports.colorTextInversePrimary = colorTextInversePrimary;
|
|
56
|
-
const colorTextInverseSecondary = '#
|
|
56
|
+
const colorTextInverseSecondary = '#9F9FBC';
|
|
57
57
|
exports.colorTextInverseSecondary = colorTextInverseSecondary;
|
|
58
58
|
const colorBorderPrimary = '#e1e1e1';
|
|
59
59
|
exports.colorBorderPrimary = colorBorderPrimary;
|
package/lib/styles/index.js.flow
CHANGED
|
@@ -46,7 +46,7 @@ export const colorTextDanger = '#cf1945';
|
|
|
46
46
|
|
|
47
47
|
export const colorTextInversePrimary = '#ffffff';
|
|
48
48
|
|
|
49
|
-
export const colorTextInverseSecondary = '#
|
|
49
|
+
export const colorTextInverseSecondary = '#9F9FBC';
|
|
50
50
|
|
|
51
51
|
export const colorBorderPrimary = '#e1e1e1';
|
|
52
52
|
|
|
@@ -27,7 +27,7 @@ const colorTextDanger = '#cf1945';
|
|
|
27
27
|
exports.colorTextDanger = colorTextDanger;
|
|
28
28
|
const colorTextInversePrimary = '#ffffff';
|
|
29
29
|
exports.colorTextInversePrimary = colorTextInversePrimary;
|
|
30
|
-
const colorTextInverseSecondary = '#
|
|
30
|
+
const colorTextInverseSecondary = '#9F9FBC';
|
|
31
31
|
exports.colorTextInverseSecondary = colorTextInverseSecondary;
|
|
32
32
|
const colorBorderPrimary = '#e1e1e1';
|
|
33
33
|
exports.colorBorderPrimary = colorBorderPrimary;
|
|
@@ -22,7 +22,7 @@ export const colorTextDanger = '#cf1945';
|
|
|
22
22
|
|
|
23
23
|
export const colorTextInversePrimary = '#ffffff';
|
|
24
24
|
|
|
25
|
-
export const colorTextInverseSecondary = '#
|
|
25
|
+
export const colorTextInverseSecondary = '#9F9FBC';
|
|
26
26
|
|
|
27
27
|
export const colorBorderPrimary = '#e1e1e1';
|
|
28
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaced-out/ui-design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Sense UI components library",
|
|
6
6
|
"author": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "rimraf lib && yarn build:style-variables && gulp build",
|
|
12
12
|
"build:style-variables": "rimraf src/styles/variables && style-dictionary build --config ./config.js",
|
|
13
|
-
"storybook": "yarn build:style-variables && storybook dev
|
|
13
|
+
"storybook": "yarn build:style-variables && storybook dev --host genesis.proxysense.co --port 6006",
|
|
14
14
|
"storybook:export": "yarn build:style-variables && rimraf storybook-static && storybook build",
|
|
15
15
|
"build-storybook": "yarn build:style-variables && rimraf storybook-static && storybook build",
|
|
16
16
|
"generate": "node ./scripts/create-component",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Font Awesome Pro License
|
|
2
|
-
------------------------
|
|
3
|
-
|
|
4
|
-
Font Awesome Pro is commercial software that requires a paid license. Full
|
|
5
|
-
Font Awesome Pro license: https://fontawesome.com/license.
|
|
6
|
-
|
|
7
|
-
# Commercial License
|
|
8
|
-
The Font Awesome Pro commercial license allows you to pay for FA Pro once, own
|
|
9
|
-
it, and use it just about everywhere you'd like.
|
|
10
|
-
|
|
11
|
-
# Attribution
|
|
12
|
-
Attribution is not required by the Font Awesome Pro commercial license.
|
|
13
|
-
|
|
14
|
-
# Brand Icons
|
|
15
|
-
All brand icons are trademarks of their respective owners. The use of these
|
|
16
|
-
trademarks does not indicate endorsement of the trademark holder by Font
|
|
17
|
-
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
|
|
18
|
-
to represent the company, product, or service to which they refer.**
|