@spaced-out/ui-design-system 0.0.22 → 0.0.23-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/CHANGELOG.md +14 -0
- package/design-tokens/color/app-color.json +7 -0
- package/design-tokens/size/base-size.json +6 -0
- package/lib/components/Chip/Chip.js +11 -3
- package/lib/components/Chip/Chip.js.flow +12 -2
- package/lib/components/Chip/Chip.module.css +31 -0
- package/lib/components/Icon/Icon.js.flow +1 -1
- package/lib/components/SideMenuLink/SideMenuLink.module.css +1 -0
- package/lib/components/StatusIndicator/StatusIndicator.js +36 -0
- package/lib/components/StatusIndicator/StatusIndicator.js.flow +47 -0
- package/lib/components/StatusIndicator/StatusIndicator.module.css +37 -0
- package/lib/components/StatusIndicator/index.js +16 -0
- package/lib/components/StatusIndicator/index.js.flow +3 -0
- package/lib/components/SubMenu/SubMenu.js +168 -0
- package/lib/components/SubMenu/SubMenu.js.flow +243 -0
- package/lib/components/SubMenu/SubMenu.module.css +119 -0
- package/lib/components/SubMenu/index.js +42 -0
- package/lib/components/SubMenu/index.js.flow +11 -0
- package/lib/components/Tabs/Tab/Tab.js +2 -2
- package/lib/components/Tabs/Tab/Tab.js.flow +24 -19
- package/lib/components/Tabs/Tab/Tab.module.css +5 -1
- package/lib/styles/variables/_color.css +2 -0
- package/lib/styles/variables/_color.js +3 -1
- package/lib/styles/variables/_color.js.flow +2 -0
- package/lib/styles/variables/_size.css +4 -0
- package/lib/styles/variables/_size.js +6 -2
- package/lib/styles/variables/_size.js.flow +4 -0
- 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.0.23-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.0.22...v0.0.23-beta.0) (2023-02-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* [GDS-118] sub menu ([#61](https://github.com/spaced-out/ui-design-system/issues/61)) ([7e32aae](https://github.com/spaced-out/ui-design-system/commit/7e32aaebb5427188e8e3f35f5fcd7066557be579))
|
|
11
|
+
* status indicator component ([7f6b0bd](https://github.com/spaced-out/ui-design-system/commit/7f6b0bdcb0c5506f9f5c4c3fcc50206073f4eabe))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* chip states and chip truncate text fixes ([16573d2](https://github.com/spaced-out/ui-design-system/commit/16573d24ff201335c33a888aff3d7cf3dd36a133))
|
|
17
|
+
* tab onhover and icon only center ([#64](https://github.com/spaced-out/ui-design-system/issues/64)) ([148606a](https://github.com/spaced-out/ui-design-system/commit/148606af18fa7808612236bd0cb34a61908a2f49))
|
|
18
|
+
|
|
5
19
|
### [0.0.22](https://github.com/spaced-out/ui-design-system/compare/v0.0.21...v0.0.22) (2023-02-09)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
"240": {
|
|
70
70
|
"value": "240px"
|
|
71
71
|
},
|
|
72
|
+
"260": {
|
|
73
|
+
"value": "260px"
|
|
74
|
+
},
|
|
72
75
|
"276": {
|
|
73
76
|
"value": "276px"
|
|
74
77
|
},
|
|
@@ -98,6 +101,9 @@
|
|
|
98
101
|
},
|
|
99
102
|
"fluid": {
|
|
100
103
|
"value": "100%"
|
|
104
|
+
},
|
|
105
|
+
"fullViewportHeight": {
|
|
106
|
+
"value": "100vh"
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
}
|
|
@@ -7,6 +7,7 @@ exports.Chip = exports.CHIP_SEMANTIC = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = require("../../utils/classify");
|
|
9
9
|
var _Icon = require("../Icon");
|
|
10
|
+
var _Truncate = require("../Truncate");
|
|
10
11
|
var _ChipModule = _interopRequireDefault(require("./Chip.module.css"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
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); }
|
|
@@ -31,6 +32,7 @@ const Chip = _ref => {
|
|
|
31
32
|
iconType = 'regular',
|
|
32
33
|
dismissable = false,
|
|
33
34
|
onDismiss = () => null,
|
|
35
|
+
onClick,
|
|
34
36
|
disabled
|
|
35
37
|
} = _ref;
|
|
36
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -47,18 +49,24 @@ const Chip = _ref => {
|
|
|
47
49
|
[_ChipModule.default.dismissable]: dismissable,
|
|
48
50
|
[_ChipModule.default.withIcon]: !!iconName && size !== 'small',
|
|
49
51
|
[_ChipModule.default.disabled]: disabled
|
|
50
|
-
}, classNames?.wrapper)
|
|
52
|
+
}, classNames?.wrapper),
|
|
53
|
+
onClick: onClick
|
|
51
54
|
}, iconName && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
52
55
|
className: _ChipModule.default.chipIcon,
|
|
53
56
|
name: iconName,
|
|
54
57
|
type: iconType,
|
|
55
58
|
size: "small"
|
|
56
|
-
}), children, dismissable && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
59
|
+
}), /*#__PURE__*/React.createElement(_Truncate.Truncate, null, children), dismissable && size !== 'small' && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
57
60
|
className: _ChipModule.default.dismissIcon,
|
|
58
61
|
name: "xmark",
|
|
59
62
|
type: iconType,
|
|
60
63
|
size: "small",
|
|
61
|
-
onClick: event =>
|
|
64
|
+
onClick: event => {
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
if (!disabled && onDismiss) {
|
|
67
|
+
onDismiss(event);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
62
70
|
}));
|
|
63
71
|
};
|
|
64
72
|
exports.Chip = Chip;
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import {classify} from '../../utils/classify';
|
|
6
6
|
import type {IconType} from '../Icon';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
|
+
import {Truncate} from '../Truncate';
|
|
8
9
|
|
|
9
10
|
import css from './Chip.module.css';
|
|
10
11
|
|
|
@@ -27,6 +28,7 @@ export type BaseChipProps = {
|
|
|
27
28
|
semantic?: ChipSemanticType,
|
|
28
29
|
children: React.Node,
|
|
29
30
|
disabled?: boolean,
|
|
31
|
+
onClick?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export type MediumChipProps = {
|
|
@@ -53,6 +55,7 @@ export const Chip = ({
|
|
|
53
55
|
iconType = 'regular',
|
|
54
56
|
dismissable = false,
|
|
55
57
|
onDismiss = () => null,
|
|
58
|
+
onClick,
|
|
56
59
|
disabled,
|
|
57
60
|
}: ChipProps): React.Node => (
|
|
58
61
|
<div
|
|
@@ -74,6 +77,7 @@ export const Chip = ({
|
|
|
74
77
|
},
|
|
75
78
|
classNames?.wrapper,
|
|
76
79
|
)}
|
|
80
|
+
onClick={onClick}
|
|
77
81
|
>
|
|
78
82
|
{iconName && size !== 'small' && (
|
|
79
83
|
<Icon
|
|
@@ -83,14 +87,20 @@ export const Chip = ({
|
|
|
83
87
|
size="small"
|
|
84
88
|
/>
|
|
85
89
|
)}
|
|
86
|
-
{children}
|
|
90
|
+
<Truncate>{children}</Truncate>
|
|
91
|
+
|
|
87
92
|
{dismissable && size !== 'small' && (
|
|
88
93
|
<Icon
|
|
89
94
|
className={css.dismissIcon}
|
|
90
95
|
name="xmark"
|
|
91
96
|
type={iconType}
|
|
92
97
|
size="small"
|
|
93
|
-
onClick={(event) =>
|
|
98
|
+
onClick={(event) => {
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
if (!disabled && onDismiss) {
|
|
101
|
+
onDismiss(event);
|
|
102
|
+
}
|
|
103
|
+
}}
|
|
94
104
|
/>
|
|
95
105
|
)}
|
|
96
106
|
</div>
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
@value (
|
|
2
2
|
colorNeutralLightest,
|
|
3
|
+
colorNeutralLight,
|
|
3
4
|
colorInformationLightest,
|
|
5
|
+
colorInformationLight,
|
|
4
6
|
colorSuccessLightest,
|
|
7
|
+
colorSuccessLight,
|
|
5
8
|
colorWarningLightest,
|
|
9
|
+
colorWarningLight,
|
|
6
10
|
colorDangerLightest,
|
|
11
|
+
colorDangerLight,
|
|
12
|
+
colorGrayLightest,
|
|
7
13
|
colorBackgroundTertiary,
|
|
8
14
|
colorTextDisabled,
|
|
9
15
|
colorFillDisabled
|
|
@@ -28,33 +34,58 @@
|
|
|
28
34
|
padding: spaceXXSmall spaceSmall;
|
|
29
35
|
gap: spaceXXSmall;
|
|
30
36
|
border-radius: borderRadiusXSmall;
|
|
37
|
+
cursor: pointer;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
.primary {
|
|
34
41
|
background-color: colorNeutralLightest;
|
|
35
42
|
}
|
|
36
43
|
|
|
44
|
+
.primary:hover {
|
|
45
|
+
background-color: colorNeutralLight;
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
.information {
|
|
38
49
|
background-color: colorInformationLightest;
|
|
39
50
|
}
|
|
40
51
|
|
|
52
|
+
.information:hover {
|
|
53
|
+
background-color: colorInformationLight;
|
|
54
|
+
}
|
|
55
|
+
|
|
41
56
|
.success {
|
|
42
57
|
background-color: colorSuccessLightest;
|
|
43
58
|
}
|
|
44
59
|
|
|
60
|
+
.success:hover {
|
|
61
|
+
background-color: colorSuccessLight;
|
|
62
|
+
}
|
|
63
|
+
|
|
45
64
|
.warning {
|
|
46
65
|
background-color: colorWarningLightest;
|
|
47
66
|
}
|
|
48
67
|
|
|
68
|
+
.warning:hover {
|
|
69
|
+
background-color: colorWarningLight;
|
|
70
|
+
}
|
|
71
|
+
|
|
49
72
|
.danger {
|
|
50
73
|
background-color: colorDangerLightest;
|
|
51
74
|
}
|
|
52
75
|
|
|
76
|
+
.danger:hover {
|
|
77
|
+
background-color: colorDangerLight;
|
|
78
|
+
}
|
|
79
|
+
|
|
53
80
|
.secondary {
|
|
54
81
|
composes: borderPrimary from '../../styles/border.module.css';
|
|
55
82
|
background-color: colorBackgroundTertiary;
|
|
56
83
|
}
|
|
57
84
|
|
|
85
|
+
.secondary:hover {
|
|
86
|
+
background-color: colorGrayLightest;
|
|
87
|
+
}
|
|
88
|
+
|
|
58
89
|
.withIcon {
|
|
59
90
|
padding: spaceXXSmall spaceSmall spaceXXSmall spaceXSmall;
|
|
60
91
|
}
|
|
@@ -12,7 +12,7 @@ import classify from '../../utils/classify';
|
|
|
12
12
|
import typographyStyle from '../../styles/typography.module.css';
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
export type IconType = 'regular' | 'solid' | 'duotone';
|
|
15
|
+
export type IconType = 'regular' | 'solid' | 'duotone' | 'brands';
|
|
16
16
|
|
|
17
17
|
export const ICON_SIZE = Object.freeze({
|
|
18
18
|
small: 'small',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StatusIndicator = exports.STATUS_SEMANTIC = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
+
var _StatusIndicatorModule = _interopRequireDefault(require("./StatusIndicator.module.css"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
const STATUS_SEMANTIC = Object.freeze({
|
|
15
|
+
information: 'information',
|
|
16
|
+
success: 'success',
|
|
17
|
+
warning: 'warning',
|
|
18
|
+
danger: 'danger',
|
|
19
|
+
neutral: 'neutral'
|
|
20
|
+
});
|
|
21
|
+
exports.STATUS_SEMANTIC = STATUS_SEMANTIC;
|
|
22
|
+
const StatusIndicator = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
classNames,
|
|
25
|
+
status = 'information',
|
|
26
|
+
withBorder,
|
|
27
|
+
...props
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
30
|
+
"data-testid": "StatusIndicator",
|
|
31
|
+
className: (0, _classify.default)(_StatusIndicatorModule.default.statusWrapper, _StatusIndicatorModule.default[status], {
|
|
32
|
+
[_StatusIndicatorModule.default.withBorder]: withBorder
|
|
33
|
+
}, classNames?.wrapper)
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
exports.StatusIndicator = StatusIndicator;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import classify from '../../utils/classify';
|
|
6
|
+
|
|
7
|
+
import css from './StatusIndicator.module.css';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
11
|
+
|
|
12
|
+
export const STATUS_SEMANTIC = Object.freeze({
|
|
13
|
+
information: 'information',
|
|
14
|
+
success: 'success',
|
|
15
|
+
warning: 'warning',
|
|
16
|
+
danger: 'danger',
|
|
17
|
+
neutral: 'neutral',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type StatusSemanticType = $Values<typeof STATUS_SEMANTIC>;
|
|
21
|
+
|
|
22
|
+
export type StatusIndicatorProps = {
|
|
23
|
+
classNames?: ClassNames,
|
|
24
|
+
status?: StatusSemanticType,
|
|
25
|
+
withBorder?: boolean,
|
|
26
|
+
...
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const StatusIndicator = ({
|
|
30
|
+
classNames,
|
|
31
|
+
status = 'information',
|
|
32
|
+
withBorder,
|
|
33
|
+
...props
|
|
34
|
+
}: StatusIndicatorProps): React.Node => (
|
|
35
|
+
<div
|
|
36
|
+
{...props}
|
|
37
|
+
data-testid="StatusIndicator"
|
|
38
|
+
className={classify(
|
|
39
|
+
css.statusWrapper,
|
|
40
|
+
css[status],
|
|
41
|
+
{
|
|
42
|
+
[css.withBorder]: withBorder,
|
|
43
|
+
},
|
|
44
|
+
classNames?.wrapper,
|
|
45
|
+
)}
|
|
46
|
+
></div>
|
|
47
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@value (colorInformation, colorSuccess, colorWarning, colorDanger, colorNeutral, colorBackgroundTertiary) from '../../styles/variables/_color.css';
|
|
2
|
+
@value (size8) from '../../styles/variables/_size.css';
|
|
3
|
+
@value (borderRadiusCircle, borderWidthTertiary) from '../../styles/variables/_border.css';
|
|
4
|
+
|
|
5
|
+
.statusWrapper {
|
|
6
|
+
display: flex;
|
|
7
|
+
color: colorFillPrimary;
|
|
8
|
+
width: size8;
|
|
9
|
+
height: size8;
|
|
10
|
+
border-radius: borderRadiusCircle;
|
|
11
|
+
background-color: colorInformation;
|
|
12
|
+
box-sizing: content-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.information {
|
|
16
|
+
background-color: colorInformation;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.success {
|
|
20
|
+
background-color: colorSuccess;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.warning {
|
|
24
|
+
background-color: colorWarning;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.danger {
|
|
28
|
+
background-color: colorDanger;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.neutral {
|
|
32
|
+
background-color: colorNeutral;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.withBorder {
|
|
36
|
+
border: borderWidthTertiary solid colorBackgroundTertiary;
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _StatusIndicator = require("./StatusIndicator");
|
|
7
|
+
Object.keys(_StatusIndicator).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _StatusIndicator[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _StatusIndicator[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SubMenuItemText = exports.SubMenuItemIcon = exports.SubMenuItemAction = exports.SubMenuItem = exports.SubMenuGroup = exports.SubMenu = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
+
var _Icon = require("../Icon");
|
|
10
|
+
var _Text = require("../Text");
|
|
11
|
+
var _SubMenuModule = _interopRequireDefault(require("./SubMenu.module.css"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
+
const SubMenuItemIcon = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, _extends({}, props, {
|
|
22
|
+
size: "small",
|
|
23
|
+
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
24
|
+
className: (0, _classify.default)(_SubMenuModule.default.menuIcon, className)
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
exports.SubMenuItemIcon = SubMenuItemIcon;
|
|
28
|
+
SubMenuItemIcon.displayName = 'SubMenuItemIcon';
|
|
29
|
+
const SubMenuItemText = _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
} = _ref2;
|
|
35
|
+
return /*#__PURE__*/React.createElement(_Text.ButtonTextSmall, _extends({}, props, {
|
|
36
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuItemText, className),
|
|
37
|
+
color: _Text.TEXT_COLORS.inversePrimary
|
|
38
|
+
}), children);
|
|
39
|
+
};
|
|
40
|
+
exports.SubMenuItemText = SubMenuItemText;
|
|
41
|
+
SubMenuItemText.displayName = 'SubMenuItemText';
|
|
42
|
+
const SubMenuItemAction = _ref3 => {
|
|
43
|
+
let {
|
|
44
|
+
children,
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
} = _ref3;
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
49
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuItemAction, className)
|
|
50
|
+
}), children);
|
|
51
|
+
};
|
|
52
|
+
exports.SubMenuItemAction = SubMenuItemAction;
|
|
53
|
+
SubMenuItemAction.displayName = 'SubMenuItemAction';
|
|
54
|
+
const SubMenuItem = _ref4 => {
|
|
55
|
+
let {
|
|
56
|
+
children,
|
|
57
|
+
selectedMenuKey,
|
|
58
|
+
disabled,
|
|
59
|
+
classNames,
|
|
60
|
+
onChange,
|
|
61
|
+
menuKey
|
|
62
|
+
} = _ref4;
|
|
63
|
+
const onChangeHandler = () => {
|
|
64
|
+
if (!disabled) {
|
|
65
|
+
onChange && onChange(menuKey);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const selected = selectedMenuKey === menuKey;
|
|
69
|
+
const getNamedComp = comp => {
|
|
70
|
+
const childrenArray = React.Children.toArray(children);
|
|
71
|
+
if (childrenArray.length) {
|
|
72
|
+
const nodes = [];
|
|
73
|
+
for (const child of childrenArray) {
|
|
74
|
+
if (child?.type?.displayName === comp) {
|
|
75
|
+
nodes.push( /*#__PURE__*/React.cloneElement(child, {
|
|
76
|
+
selected,
|
|
77
|
+
disabled
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return nodes.length > 1 ? nodes : nodes[0];
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
};
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: (0, _classify.default)(_SubMenuModule.default.menuItem, {
|
|
87
|
+
[_SubMenuModule.default.selected]: selected,
|
|
88
|
+
[_SubMenuModule.default.disabled]: disabled
|
|
89
|
+
}, classNames?.wrapper),
|
|
90
|
+
onClick: onChangeHandler
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: _SubMenuModule.default.menuIconName
|
|
93
|
+
}, getNamedComp('SubMenuItemIcon'), getNamedComp('SubMenuItemText')), getNamedComp('SubMenuItemAction'));
|
|
94
|
+
};
|
|
95
|
+
exports.SubMenuItem = SubMenuItem;
|
|
96
|
+
const SubMenuGroup = _ref5 => {
|
|
97
|
+
let {
|
|
98
|
+
children,
|
|
99
|
+
groupTitle,
|
|
100
|
+
collapsible = false,
|
|
101
|
+
disabled = false,
|
|
102
|
+
onChange,
|
|
103
|
+
selectedMenuKey,
|
|
104
|
+
classNames
|
|
105
|
+
} = _ref5;
|
|
106
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
107
|
+
const collapseHandler = () => {
|
|
108
|
+
collapsible && setCollapsed(!collapsed);
|
|
109
|
+
};
|
|
110
|
+
const onChangeHandler = value => {
|
|
111
|
+
if (onChange) {
|
|
112
|
+
onChange(value);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const childrenWithProps = React.Children.map(children, child => {
|
|
116
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
117
|
+
const {
|
|
118
|
+
disabled: disabledChild
|
|
119
|
+
} = child.props;
|
|
120
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
121
|
+
selectedMenuKey,
|
|
122
|
+
onChange: onChangeHandler,
|
|
123
|
+
disabled: disabledChild || disabled
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return child;
|
|
127
|
+
});
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroupWrapper, classNames?.wrapper)
|
|
130
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroupHeader, classNames?.groupHeader),
|
|
132
|
+
onClick: collapseHandler
|
|
133
|
+
}, /*#__PURE__*/React.createElement(_Text.SubTitleExtraSmall, {
|
|
134
|
+
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
135
|
+
className: _SubMenuModule.default.groupTitle
|
|
136
|
+
}, groupTitle), collapsible && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
137
|
+
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
138
|
+
name: collapsed ? 'chevron-down' : 'chevron-up',
|
|
139
|
+
size: "small"
|
|
140
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuGroup, {
|
|
142
|
+
[_SubMenuModule.default.collapsed]: collapsible && collapsed
|
|
143
|
+
}, classNames?.menuGroup)
|
|
144
|
+
}, childrenWithProps));
|
|
145
|
+
};
|
|
146
|
+
exports.SubMenuGroup = SubMenuGroup;
|
|
147
|
+
const SubMenu = _ref6 => {
|
|
148
|
+
let {
|
|
149
|
+
classNames,
|
|
150
|
+
children,
|
|
151
|
+
title
|
|
152
|
+
} = _ref6;
|
|
153
|
+
const childrenWithProps = React.Children.map(children, child => {
|
|
154
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: _SubMenuModule.default.menuChildWrap
|
|
157
|
+
}, child);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuWrapper, classNames?.wrapper)
|
|
162
|
+
}, /*#__PURE__*/React.createElement(_Text.SubTitleMedium, {
|
|
163
|
+
className: _SubMenuModule.default.subMenuHeader,
|
|
164
|
+
color: _Text.TEXT_COLORS.inversePrimary
|
|
165
|
+
}, title), childrenWithProps);
|
|
166
|
+
};
|
|
167
|
+
exports.SubMenu = SubMenu;
|
|
168
|
+
SubMenu.displayName = 'SubMenu';
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import type {ColorTypes} from '../../types/typography';
|
|
6
|
+
import classify from '../../utils/classify';
|
|
7
|
+
import type {IconProps} from '../Icon';
|
|
8
|
+
import {Icon} from '../Icon';
|
|
9
|
+
import type {TextProps} from '../Text';
|
|
10
|
+
import {
|
|
11
|
+
ButtonTextSmall,
|
|
12
|
+
SubTitleExtraSmall,
|
|
13
|
+
SubTitleMedium,
|
|
14
|
+
TEXT_COLORS,
|
|
15
|
+
} from '../Text';
|
|
16
|
+
|
|
17
|
+
import css from './SubMenu.module.css';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
21
|
+
|
|
22
|
+
export const SubMenuItemIcon = ({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: IconProps): React.Node => (
|
|
26
|
+
<Icon
|
|
27
|
+
{...props}
|
|
28
|
+
size="small"
|
|
29
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
30
|
+
className={classify(css.menuIcon, className)}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
SubMenuItemIcon.displayName = 'SubMenuItemIcon';
|
|
35
|
+
|
|
36
|
+
export const SubMenuItemText = ({
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: TextProps): React.Node => (
|
|
41
|
+
<ButtonTextSmall
|
|
42
|
+
{...props}
|
|
43
|
+
className={classify(css.subMenuItemText, className)}
|
|
44
|
+
color={TEXT_COLORS.inversePrimary}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</ButtonTextSmall>
|
|
48
|
+
);
|
|
49
|
+
SubMenuItemText.displayName = 'SubMenuItemText';
|
|
50
|
+
|
|
51
|
+
export type SubMenuItemActionProps = {
|
|
52
|
+
children?: React.Node,
|
|
53
|
+
color?: ColorTypes,
|
|
54
|
+
className?: string,
|
|
55
|
+
...
|
|
56
|
+
};
|
|
57
|
+
export const SubMenuItemAction = ({
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
|
+
}: SubMenuItemActionProps): React.Node => (
|
|
62
|
+
<div {...props} className={classify(css.subMenuItemAction, className)}>
|
|
63
|
+
{children}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
SubMenuItemAction.displayName = 'SubMenuItemAction';
|
|
67
|
+
|
|
68
|
+
export type SubMenuItemProps = {
|
|
69
|
+
classNames?: ClassNames,
|
|
70
|
+
children?: React.Node,
|
|
71
|
+
selectedMenuKey?: string,
|
|
72
|
+
disabled?: boolean,
|
|
73
|
+
onChange?: (selectedMenuKey: string) => mixed,
|
|
74
|
+
menuKey: string,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const SubMenuItem = ({
|
|
78
|
+
children,
|
|
79
|
+
selectedMenuKey,
|
|
80
|
+
disabled,
|
|
81
|
+
classNames,
|
|
82
|
+
onChange,
|
|
83
|
+
menuKey,
|
|
84
|
+
}: SubMenuItemProps): React.Node => {
|
|
85
|
+
const onChangeHandler = () => {
|
|
86
|
+
if (!disabled) {
|
|
87
|
+
onChange && onChange(menuKey);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const selected = selectedMenuKey === menuKey;
|
|
92
|
+
|
|
93
|
+
const getNamedComp = (comp: string) => {
|
|
94
|
+
const childrenArray = React.Children.toArray(children);
|
|
95
|
+
if (childrenArray.length) {
|
|
96
|
+
const nodes: React.Node[] = [];
|
|
97
|
+
for (const child of childrenArray) {
|
|
98
|
+
if (child?.type?.displayName === comp) {
|
|
99
|
+
nodes.push(
|
|
100
|
+
React.cloneElement(child, {
|
|
101
|
+
selected,
|
|
102
|
+
disabled,
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return nodes.length > 1 ? nodes : nodes[0];
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
className={classify(
|
|
115
|
+
css.menuItem,
|
|
116
|
+
{
|
|
117
|
+
[css.selected]: selected,
|
|
118
|
+
[css.disabled]: disabled,
|
|
119
|
+
},
|
|
120
|
+
classNames?.wrapper,
|
|
121
|
+
)}
|
|
122
|
+
onClick={onChangeHandler}
|
|
123
|
+
>
|
|
124
|
+
<div className={css.menuIconName}>
|
|
125
|
+
{getNamedComp('SubMenuItemIcon')}
|
|
126
|
+
{getNamedComp('SubMenuItemText')}
|
|
127
|
+
</div>
|
|
128
|
+
{getNamedComp('SubMenuItemAction')}
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
type SubMenuGroupClassNames = $ReadOnly<{
|
|
134
|
+
wrapper?: string,
|
|
135
|
+
groupHeader?: string,
|
|
136
|
+
menuGroup?: string,
|
|
137
|
+
}>;
|
|
138
|
+
|
|
139
|
+
export type SubMenuGroupProps = {
|
|
140
|
+
children?: React.Node,
|
|
141
|
+
groupTitle?: string,
|
|
142
|
+
collapsible?: boolean,
|
|
143
|
+
disabled?: boolean,
|
|
144
|
+
onChange?: (value: string) => mixed,
|
|
145
|
+
selectedMenuKey?: string,
|
|
146
|
+
classNames?: SubMenuGroupClassNames,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const SubMenuGroup = ({
|
|
150
|
+
children,
|
|
151
|
+
groupTitle,
|
|
152
|
+
collapsible = false,
|
|
153
|
+
disabled = false,
|
|
154
|
+
onChange,
|
|
155
|
+
selectedMenuKey,
|
|
156
|
+
classNames,
|
|
157
|
+
}: SubMenuGroupProps): React.Node => {
|
|
158
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
159
|
+
const collapseHandler = () => {
|
|
160
|
+
collapsible && setCollapsed(!collapsed);
|
|
161
|
+
};
|
|
162
|
+
const onChangeHandler = (value) => {
|
|
163
|
+
if (onChange) {
|
|
164
|
+
onChange(value);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const childrenWithProps = React.Children.map(children, (child) => {
|
|
168
|
+
if (React.isValidElement(child)) {
|
|
169
|
+
const {disabled: disabledChild} = child.props;
|
|
170
|
+
return React.cloneElement(child, {
|
|
171
|
+
selectedMenuKey,
|
|
172
|
+
onChange: onChangeHandler,
|
|
173
|
+
disabled: disabledChild || disabled,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return child;
|
|
177
|
+
});
|
|
178
|
+
return (
|
|
179
|
+
<div className={classify(css.subMenuGroupWrapper, classNames?.wrapper)}>
|
|
180
|
+
<div
|
|
181
|
+
className={classify(css.subMenuGroupHeader, classNames?.groupHeader)}
|
|
182
|
+
onClick={collapseHandler}
|
|
183
|
+
>
|
|
184
|
+
<SubTitleExtraSmall
|
|
185
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
186
|
+
className={css.groupTitle}
|
|
187
|
+
>
|
|
188
|
+
{groupTitle}
|
|
189
|
+
</SubTitleExtraSmall>
|
|
190
|
+
{collapsible && (
|
|
191
|
+
<Icon
|
|
192
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
193
|
+
name={collapsed ? 'chevron-down' : 'chevron-up'}
|
|
194
|
+
size="small"
|
|
195
|
+
/>
|
|
196
|
+
)}
|
|
197
|
+
</div>
|
|
198
|
+
<div
|
|
199
|
+
className={classify(
|
|
200
|
+
css.subMenuGroup,
|
|
201
|
+
{
|
|
202
|
+
[css.collapsed]: collapsible && collapsed,
|
|
203
|
+
},
|
|
204
|
+
classNames?.menuGroup,
|
|
205
|
+
)}
|
|
206
|
+
>
|
|
207
|
+
{childrenWithProps}
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
);
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export type SubMenuProps = {
|
|
214
|
+
classNames?: ClassNames,
|
|
215
|
+
title: string,
|
|
216
|
+
children?: React.Node,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const SubMenu = ({
|
|
220
|
+
classNames,
|
|
221
|
+
children,
|
|
222
|
+
title,
|
|
223
|
+
}: SubMenuProps): React.Node => {
|
|
224
|
+
const childrenWithProps = React.Children.map(children, (child) => {
|
|
225
|
+
if (React.isValidElement(child)) {
|
|
226
|
+
return <div className={css.menuChildWrap}>{child}</div>;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<div className={classify(css.subMenuWrapper, classNames?.wrapper)}>
|
|
232
|
+
<SubTitleMedium
|
|
233
|
+
className={css.subMenuHeader}
|
|
234
|
+
color={TEXT_COLORS.inversePrimary}
|
|
235
|
+
>
|
|
236
|
+
{title}
|
|
237
|
+
</SubTitleMedium>
|
|
238
|
+
{childrenWithProps}
|
|
239
|
+
</div>
|
|
240
|
+
);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
SubMenu.displayName = 'SubMenu';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@value ( size34, size60, sizeFluid, sizeFullViewportHeight) from '../../styles/variables/_size.css';
|
|
2
|
+
|
|
3
|
+
@value (
|
|
4
|
+
colorNeutralDarkest,
|
|
5
|
+
colorTextInverseSecondary,
|
|
6
|
+
colorTextInversePrimary,
|
|
7
|
+
colorSubMenuBackgroundDefault
|
|
8
|
+
) from '../../styles/variables/_color.css';
|
|
9
|
+
@value ( spaceNone, spaceXSmall, spaceSmall, spaceMedium ) from '../../styles/variables/_space.css';
|
|
10
|
+
|
|
11
|
+
@value ( borderRadiusSmall, borderWidthPrimary) from '../../styles/variables/_border.css';
|
|
12
|
+
|
|
13
|
+
.subMenuWrapper {
|
|
14
|
+
background: colorSubMenuBackgroundDefault;
|
|
15
|
+
width: sizeFluid;
|
|
16
|
+
min-height: sizeFullViewportHeight;
|
|
17
|
+
cursor: default;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.subMenuHeader {
|
|
24
|
+
height: size60;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
padding: spaceMedium;
|
|
29
|
+
border-bottom: borderWidthPrimary solid colorNeutralDarkest;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.menuChildWrap {
|
|
33
|
+
margin: spaceNone spaceSmall;
|
|
34
|
+
border-bottom: borderWidthPrimary solid colorNeutralDarkest;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.menuChildWrap:last-child {
|
|
38
|
+
border-bottom: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.subMenuGroupWrapper {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
padding: spaceMedium spaceNone;
|
|
45
|
+
flex: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.subMenuGroupHeader {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
padding: spaceNone spaceXSmall spaceNone spaceXSmall;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.groupTitle {
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.subMenuGroup {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
margin-top: spaceXSmall;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.subMenuGroup.collapsed {
|
|
67
|
+
display: none !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.menuItem {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
background: colorSubMenuBackgroundDefault;
|
|
74
|
+
color: colorTextInverseSecondary;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
gap: spaceXSmall;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
align-items: center;
|
|
79
|
+
flex: auto;
|
|
80
|
+
height: size34;
|
|
81
|
+
min-height: size34;
|
|
82
|
+
border-radius: borderRadiusSmall;
|
|
83
|
+
width: sizeFluid;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
padding: spaceXSmall;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.menuItem:not(.selected):hover {
|
|
89
|
+
color: colorTextInversePrimary;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.menuIcon {
|
|
93
|
+
color: inherit;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.menuItem.selected {
|
|
97
|
+
background: colorNeutralDarkest;
|
|
98
|
+
color: colorTextInversePrimary;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.menuItem.disabled {
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.menuIconName {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: row;
|
|
108
|
+
gap: spaceSmall;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.subMenuItemText {
|
|
112
|
+
color: inherit;
|
|
113
|
+
margin-right: spaceSmall;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.subMenuItemAction {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: row;
|
|
119
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SubMenu", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _SubMenu.SubMenu;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SubMenuGroup", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _SubMenu.SubMenuGroup;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "SubMenuItem", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _SubMenu.SubMenuItem;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "SubMenuItemAction", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _SubMenu.SubMenuItemAction;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "SubMenuItemIcon", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _SubMenu.SubMenuItemIcon;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "SubMenuItemText", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _SubMenu.SubMenuItemText;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _SubMenu = require("./SubMenu");
|
|
@@ -76,7 +76,7 @@ const Tab = _ref => {
|
|
|
76
76
|
className: (0, _classify.classify)(_TabModule.default.icon, {
|
|
77
77
|
[_TabModule.default.disabled]: disabled === true
|
|
78
78
|
})
|
|
79
|
-
}) : null, size === TAB_SIZE.medium ? /*#__PURE__*/React.createElement(_Text.ButtonTextMedium, {
|
|
79
|
+
}) : null, label && /*#__PURE__*/React.createElement(React.Fragment, null, size === TAB_SIZE.medium ? /*#__PURE__*/React.createElement(_Text.ButtonTextMedium, {
|
|
80
80
|
color: _typography.TEXT_COLORS.secondary,
|
|
81
81
|
className: (0, _classify.classify)(_TabModule.default.tabContainer, {
|
|
82
82
|
[_TabModule.default.disabled]: disabled === true
|
|
@@ -87,7 +87,7 @@ const Tab = _ref => {
|
|
|
87
87
|
[_TabModule.default.selected]: selected === true,
|
|
88
88
|
[_TabModule.default.disabled]: disabled === true
|
|
89
89
|
})
|
|
90
|
-
}, label)));
|
|
90
|
+
}, label))));
|
|
91
91
|
};
|
|
92
92
|
exports.Tab = Tab;
|
|
93
93
|
Tab.displayName = 'Tab';
|
|
@@ -100,25 +100,30 @@ export const Tab = ({
|
|
|
100
100
|
})}
|
|
101
101
|
/>
|
|
102
102
|
) : null}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
|
|
104
|
+
{label && (
|
|
105
|
+
<>
|
|
106
|
+
{size === TAB_SIZE.medium ? (
|
|
107
|
+
<ButtonTextMedium
|
|
108
|
+
color={TEXT_COLORS.secondary}
|
|
109
|
+
className={classify(css.tabContainer, {
|
|
110
|
+
[css.disabled]: disabled === true,
|
|
111
|
+
})}
|
|
112
|
+
>
|
|
113
|
+
{label}
|
|
114
|
+
</ButtonTextMedium>
|
|
115
|
+
) : (
|
|
116
|
+
<ButtonTextSmall
|
|
117
|
+
color={TEXT_COLORS.secondary}
|
|
118
|
+
className={classify(css.tabContainer, {
|
|
119
|
+
[css.selected]: selected === true,
|
|
120
|
+
[css.disabled]: disabled === true,
|
|
121
|
+
})}
|
|
122
|
+
>
|
|
123
|
+
{label}
|
|
124
|
+
</ButtonTextSmall>
|
|
125
|
+
)}
|
|
126
|
+
</>
|
|
122
127
|
)}
|
|
123
128
|
</span>
|
|
124
129
|
</UnstyledButton>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
border: borderWidthTertiary solid colorFocusPrimary;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.button:focus .
|
|
28
|
+
.button:focus .iconTextWrap {
|
|
29
29
|
color: colorTextPrimary;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
border-bottom: borderWidthTertiary solid colorFillNone;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
.iconTextWrap:hover {
|
|
59
|
+
color: colorTextPrimary;
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
.icon {
|
|
59
63
|
color: inherit;
|
|
60
64
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.colorWarningLightest = exports.colorWarningLight = exports.colorWarningDarkest = exports.colorWarningDark = exports.colorWarning = exports.colorTooltipFill = exports.colorTextWarning = exports.colorTextTertiary = exports.colorTextSuccess = exports.colorTextSecondary = exports.colorTextPrimary = exports.colorTextNeutral = exports.colorTextInverseSecondary = exports.colorTextInversePrimary = exports.colorTextInformation = exports.colorTextDisabled = exports.colorTextDanger = exports.colorTextClickable = exports.colorSuccessLightest = exports.colorSuccessLight = exports.colorSuccessDarkest = exports.colorSuccessDark = exports.colorSuccess = exports.colorSideMenuIconDefault = exports.colorSideMenuIconActive = exports.colorNeutralLightest = exports.colorNeutralLight = exports.colorNeutralDarkest = exports.colorNeutralDark = exports.colorNeutral = exports.colorInformationLightest = exports.colorInformationLight = exports.colorInformationDarkest = exports.colorInformationDark = exports.colorInformation = exports.colorGrayLightest = exports.colorFocusPrimary = exports.colorFocusDanger = exports.colorFillSecondary = exports.colorFillPrimary = exports.colorFillNone = exports.colorFillInversePrimary = exports.colorFillDisabled = exports.colorDangerLightest = exports.colorDangerLight = exports.colorDangerDarkest = exports.colorDangerDark = exports.colorDanger = exports.colorButtonFillTertiaryPressed = exports.colorButtonFillTertiaryHovered = exports.colorButtonFillTertiaryEnabled = exports.colorButtonFillSecondaryPressed = exports.colorButtonFillSecondaryHovered = exports.colorButtonFillSecondaryEnabled = exports.colorButtonFillPrimaryPressed = exports.colorButtonFillPrimaryHovered = exports.colorButtonFillPrimaryEnabled = exports.colorButtonFillGhostPressed = exports.colorButtonFillGhostHovered = exports.colorButtonFillGhostEnabled = exports.colorButtonFillDangerPressed = exports.colorButtonFillDangerHovered = exports.colorButtonFillDangerEnabled = exports.colorBorderSecondary = exports.colorBorderPrimary = exports.colorBorderDanger = exports.colorBackgroundTertiary = exports.colorBackgroundSecondary = exports.colorBackgroundPrimary = exports.colorBackdropFill = void 0;
|
|
6
|
+
exports.colorWarningLightest = exports.colorWarningLight = exports.colorWarningDarkest = exports.colorWarningDark = exports.colorWarning = exports.colorTooltipFill = exports.colorTextWarning = exports.colorTextTertiary = exports.colorTextSuccess = exports.colorTextSecondary = exports.colorTextPrimary = exports.colorTextNeutral = exports.colorTextInverseSecondary = exports.colorTextInversePrimary = exports.colorTextInformation = exports.colorTextDisabled = exports.colorTextDanger = exports.colorTextClickable = exports.colorSuccessLightest = exports.colorSuccessLight = exports.colorSuccessDarkest = exports.colorSuccessDark = exports.colorSuccess = exports.colorSubMenuBackgroundDefault = exports.colorSideMenuIconDefault = exports.colorSideMenuIconActive = exports.colorNeutralLightest = exports.colorNeutralLight = exports.colorNeutralDarkest = exports.colorNeutralDark = exports.colorNeutral = exports.colorInformationLightest = exports.colorInformationLight = exports.colorInformationDarkest = exports.colorInformationDark = exports.colorInformation = exports.colorGrayLightest = exports.colorFocusPrimary = exports.colorFocusDanger = exports.colorFillSecondary = exports.colorFillPrimary = exports.colorFillNone = exports.colorFillInversePrimary = exports.colorFillDisabled = exports.colorDangerLightest = exports.colorDangerLight = exports.colorDangerDarkest = exports.colorDangerDark = exports.colorDanger = exports.colorButtonFillTertiaryPressed = exports.colorButtonFillTertiaryHovered = exports.colorButtonFillTertiaryEnabled = exports.colorButtonFillSecondaryPressed = exports.colorButtonFillSecondaryHovered = exports.colorButtonFillSecondaryEnabled = exports.colorButtonFillPrimaryPressed = exports.colorButtonFillPrimaryHovered = exports.colorButtonFillPrimaryEnabled = exports.colorButtonFillGhostPressed = exports.colorButtonFillGhostHovered = exports.colorButtonFillGhostEnabled = exports.colorButtonFillDangerPressed = exports.colorButtonFillDangerHovered = exports.colorButtonFillDangerEnabled = exports.colorBorderSecondary = exports.colorBorderPrimary = exports.colorBorderDanger = exports.colorBackgroundTertiary = exports.colorBackgroundSecondary = exports.colorBackgroundPrimary = exports.colorBackdropFill = void 0;
|
|
7
7
|
|
|
8
8
|
const colorTextPrimary = '#17172A';
|
|
9
9
|
exports.colorTextPrimary = colorTextPrimary;
|
|
@@ -93,6 +93,8 @@ const colorSideMenuIconDefault = '#9F9FBC';
|
|
|
93
93
|
exports.colorSideMenuIconDefault = colorSideMenuIconDefault;
|
|
94
94
|
const colorSideMenuIconActive = '#ffffff';
|
|
95
95
|
exports.colorSideMenuIconActive = colorSideMenuIconActive;
|
|
96
|
+
const colorSubMenuBackgroundDefault = '#1F1F36';
|
|
97
|
+
exports.colorSubMenuBackgroundDefault = colorSubMenuBackgroundDefault;
|
|
96
98
|
const colorGrayLightest = '#EBEBEB';
|
|
97
99
|
exports.colorGrayLightest = colorGrayLightest;
|
|
98
100
|
const colorNeutral = '#706F9B';
|
|
@@ -88,6 +88,8 @@ export const colorSideMenuIconDefault = '#9F9FBC';
|
|
|
88
88
|
|
|
89
89
|
export const colorSideMenuIconActive = '#ffffff';
|
|
90
90
|
|
|
91
|
+
export const colorSubMenuBackgroundDefault = '#1F1F36';
|
|
92
|
+
|
|
91
93
|
export const colorGrayLightest = '#EBEBEB';
|
|
92
94
|
|
|
93
95
|
export const colorNeutral = '#706F9B';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sizeFluid = exports.size960 = exports.size8 = exports.size720 = exports.size60 = exports.size580 = exports.size500 = exports.size5 = exports.size480 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size300 = exports.size30 = exports.size276 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size18 = exports.size160 = exports.size140 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
6
|
+
exports.sizeFullViewportHeight = exports.sizeFluid = exports.size960 = exports.size8 = exports.size720 = exports.size60 = exports.size580 = exports.size500 = exports.size5 = exports.size480 = exports.size42 = exports.size400 = exports.size40 = exports.size4 = exports.size380 = exports.size38 = exports.size36 = exports.size34 = exports.size300 = exports.size30 = exports.size276 = exports.size260 = exports.size240 = exports.size24 = exports.size228 = exports.size22 = exports.size20 = exports.size2 = exports.size18 = exports.size160 = exports.size140 = exports.size12 = exports.size110 = exports.size100 = exports.size10 = void 0;
|
|
7
7
|
|
|
8
8
|
const size2 = '2px';
|
|
9
9
|
exports.size2 = size2;
|
|
@@ -51,6 +51,8 @@ const size228 = '228px';
|
|
|
51
51
|
exports.size228 = size228;
|
|
52
52
|
const size240 = '240px';
|
|
53
53
|
exports.size240 = size240;
|
|
54
|
+
const size260 = '260px';
|
|
55
|
+
exports.size260 = size260;
|
|
54
56
|
const size276 = '276px';
|
|
55
57
|
exports.size276 = size276;
|
|
56
58
|
const size300 = '300px';
|
|
@@ -70,4 +72,6 @@ exports.size720 = size720;
|
|
|
70
72
|
const size960 = '960px';
|
|
71
73
|
exports.size960 = size960;
|
|
72
74
|
const sizeFluid = '100%';
|
|
73
|
-
exports.sizeFluid = sizeFluid;
|
|
75
|
+
exports.sizeFluid = sizeFluid;
|
|
76
|
+
const sizeFullViewportHeight = '100vh';
|
|
77
|
+
exports.sizeFullViewportHeight = sizeFullViewportHeight;
|
|
@@ -46,6 +46,8 @@ export const size228 = '228px';
|
|
|
46
46
|
|
|
47
47
|
export const size240 = '240px';
|
|
48
48
|
|
|
49
|
+
export const size260 = '260px';
|
|
50
|
+
|
|
49
51
|
export const size276 = '276px';
|
|
50
52
|
|
|
51
53
|
export const size300 = '300px';
|
|
@@ -65,3 +67,5 @@ export const size720 = '720px';
|
|
|
65
67
|
export const size960 = '960px';
|
|
66
68
|
|
|
67
69
|
export const sizeFluid = '100%';
|
|
70
|
+
|
|
71
|
+
export const sizeFullViewportHeight = '100vh';
|