@spaced-out/ui-design-system 0.1.122 → 0.1.124
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/CHANGELOG.md +19 -0
- package/lib/components/PageTitle/PageTitle.js +3 -1
- package/lib/components/PageTitle/PageTitle.js.flow +5 -1
- package/lib/components/SideMenuLink/SideMenuLink.js +24 -5
- package/lib/components/SideMenuLink/SideMenuLink.js.flow +74 -38
- package/lib/components/SideMenuLink/SideMenuLink.module.css +42 -3
- package/package.json +1 -1
package/.cspell/custom-words.txt
CHANGED
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
- name: Check Permissions
|
|
23
23
|
id: check-permissions
|
|
24
24
|
env:
|
|
25
|
-
ALLOWED_USERS: superrover, Anant-Raj, ashwini-sensehq, vish-sah, VishalBarnawal, sanskar-s, VivekJangid, sharad-kushwah, Swatantramishra1
|
|
25
|
+
ALLOWED_USERS: superrover, Anant-Raj, ashwini-sensehq, vish-sah, VishalBarnawal, sanskar-s, VivekJangid, sharad-kushwah, Swatantramishra1, bhatiarush27
|
|
26
26
|
if: ${{ !contains(env.ALLOWED_USERS, github.actor) }}
|
|
27
27
|
run: |
|
|
28
28
|
echo "You don't have correct permissions to do this release"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
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.124](https://github.com/spaced-out/ui-design-system/compare/v0.1.123...v0.1.124) (2024-08-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* github pages release access ([#256](https://github.com/spaced-out/ui-design-system/issues/256)) ([f7e4e47](https://github.com/spaced-out/ui-design-system/commit/f7e4e474aed55ccff84835feed20caeb477b9d83))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* side menu link accesibility ([#259](https://github.com/spaced-out/ui-design-system/issues/259)) ([3c06c7b](https://github.com/spaced-out/ui-design-system/commit/3c06c7bcedfc6545cddad96e60dbcde5ec05c9dc))
|
|
16
|
+
|
|
17
|
+
### [0.1.123](https://github.com/spaced-out/ui-design-system/compare/v0.1.122...v0.1.123) (2024-08-26)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* [GDS-429] side menu link accordion and href inclusion ([#251](https://github.com/spaced-out/ui-design-system/issues/251)) ([e54f712](https://github.com/spaced-out/ui-design-system/commit/e54f712b6e450c80ca70aad3565fe1be8820bbb9))
|
|
23
|
+
|
|
5
24
|
### [0.1.122](https://github.com/spaced-out/ui-design-system/compare/v0.1.121...v0.1.122) (2024-08-22)
|
|
6
25
|
|
|
7
26
|
|
|
@@ -218,7 +218,9 @@ const PageTitle = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
218
218
|
}, /*#__PURE__*/React.createElement("div", {
|
|
219
219
|
className: _PageTitleModule.default.headerWithBackBtn
|
|
220
220
|
}, showBackButton && /*#__PURE__*/React.createElement(_Tooltip.Tooltip, {
|
|
221
|
-
title: "Navigate Back"
|
|
221
|
+
title: "Navigate Back",
|
|
222
|
+
delayMotionDuration: "slow",
|
|
223
|
+
placement: "top-start"
|
|
222
224
|
}, /*#__PURE__*/React.createElement(_Button.Button, {
|
|
223
225
|
onClick: handleBack,
|
|
224
226
|
type: "tertiary",
|
|
@@ -239,7 +239,11 @@ export const PageTitle: React$AbstractComponent<
|
|
|
239
239
|
<div className={classify(css.leftSlot, classNames?.leftSlot)}>
|
|
240
240
|
<div className={css.headerWithBackBtn}>
|
|
241
241
|
{showBackButton && (
|
|
242
|
-
<Tooltip
|
|
242
|
+
<Tooltip
|
|
243
|
+
title="Navigate Back"
|
|
244
|
+
delayMotionDuration="slow"
|
|
245
|
+
placement="top-start"
|
|
246
|
+
>
|
|
243
247
|
<Button
|
|
244
248
|
onClick={handleBack}
|
|
245
249
|
type="tertiary"
|
|
@@ -9,6 +9,7 @@ var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
|
9
9
|
var _Button = require("../Button");
|
|
10
10
|
var _ConditionalWrapper = require("../ConditionalWrapper");
|
|
11
11
|
var _Icon = require("../Icon");
|
|
12
|
+
var _Link = require("../Link");
|
|
12
13
|
var _Text = require("../Text");
|
|
13
14
|
var _Tooltip = require("../Tooltip");
|
|
14
15
|
var _SideMenuLinkModule = _interopRequireDefault(require("./SideMenuLink.module.css"));
|
|
@@ -189,6 +190,10 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
189
190
|
onChange,
|
|
190
191
|
tabIndex = 0,
|
|
191
192
|
tooltip,
|
|
193
|
+
isGroupMenuLink = false,
|
|
194
|
+
linkComponent: LinkComponent,
|
|
195
|
+
rightSlot,
|
|
196
|
+
to,
|
|
192
197
|
...restButtonProps
|
|
193
198
|
} = _ref;
|
|
194
199
|
const selected = selectedValue === pageNameKey;
|
|
@@ -197,6 +202,17 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
197
202
|
onChange && onChange(e, pageNameKey);
|
|
198
203
|
};
|
|
199
204
|
return /*#__PURE__*/React.createElement(_ConditionalWrapper.ConditionalWrapper, {
|
|
205
|
+
condition: to !== undefined,
|
|
206
|
+
wrapper: children => /*#__PURE__*/React.createElement(_Link.Link, {
|
|
207
|
+
to: to,
|
|
208
|
+
tabIndex: disabled ? -1 : 0,
|
|
209
|
+
linkComponent: LinkComponent,
|
|
210
|
+
className: (0, _classify.default)(_SideMenuLinkModule.default.linkComponent, {
|
|
211
|
+
[_SideMenuLinkModule.default.closed]: !opened
|
|
212
|
+
}),
|
|
213
|
+
onClick: onChangeHandler
|
|
214
|
+
}, children)
|
|
215
|
+
}, /*#__PURE__*/React.createElement(_ConditionalWrapper.ConditionalWrapper, {
|
|
200
216
|
condition: Boolean(!opened && !inActive),
|
|
201
217
|
wrapper: children => /*#__PURE__*/React.createElement(_Tooltip.Tooltip, _extends({
|
|
202
218
|
body: MENU_NAME_LIST[pageNameKey].title
|
|
@@ -210,7 +226,7 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
210
226
|
}, classNames?.wrapper),
|
|
211
227
|
onClick: onChangeHandler,
|
|
212
228
|
ref: ref,
|
|
213
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
229
|
+
tabIndex: disabled || to !== undefined ? -1 : tabIndex,
|
|
214
230
|
disabled: disabled,
|
|
215
231
|
key: pageNameKey
|
|
216
232
|
}), pageNameKey && MENU_NAME_LIST[pageNameKey] ? /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
@@ -219,10 +235,13 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
219
235
|
size: "medium",
|
|
220
236
|
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
221
237
|
className: _SideMenuLinkModule.default.menuIcon
|
|
222
|
-
}) : null,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
238
|
+
}) : null, opened ? /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: _SideMenuLinkModule.default.menuLabelContainer
|
|
240
|
+
}, pageNameKey && MENU_NAME_LIST[pageNameKey] ? isGroupMenuLink ? /*#__PURE__*/React.createElement(_Text.SubTitleSmall, {
|
|
241
|
+
className: _SideMenuLinkModule.default.groupMenuLinkText
|
|
242
|
+
}, MENU_NAME_LIST[pageNameKey].title) : /*#__PURE__*/React.createElement(_Text.BodyMedium, {
|
|
243
|
+
className: _SideMenuLinkModule.default.menuLinkText
|
|
244
|
+
}, MENU_NAME_LIST[pageNameKey].title) : null, rightSlot ? rightSlot : null) : null)));
|
|
226
245
|
});
|
|
227
246
|
exports.SideMenuLink = SideMenuLink;
|
|
228
247
|
SideMenuLink.displayName = 'SideMenuLink';
|
|
@@ -6,7 +6,9 @@ import classify from '../../utils/classify';
|
|
|
6
6
|
import {UnstyledButton} from '../Button';
|
|
7
7
|
import {ConditionalWrapper} from '../ConditionalWrapper';
|
|
8
8
|
import {Icon} from '../Icon';
|
|
9
|
-
import {
|
|
9
|
+
import type {BaseLinkProps} from '../Link';
|
|
10
|
+
import {Link} from '../Link';
|
|
11
|
+
import {BodyMedium, SubTitleSmall, TEXT_COLORS} from '../Text';
|
|
10
12
|
import type {BaseTooltipProps} from '../Tooltip';
|
|
11
13
|
import {Tooltip} from '../Tooltip';
|
|
12
14
|
|
|
@@ -189,6 +191,10 @@ export type SideMenuLinkProps = {
|
|
|
189
191
|
onChange?: (e: SyntheticEvent<HTMLElement>, newValue: string) => mixed,
|
|
190
192
|
tabIndex?: number,
|
|
191
193
|
tooltip?: BaseTooltipProps,
|
|
194
|
+
isGroupMenuLink?: boolean,
|
|
195
|
+
to?: string,
|
|
196
|
+
rightSlot?: React.Node,
|
|
197
|
+
linkComponent?: React.AbstractComponent<BaseLinkProps, ?HTMLAnchorElement>,
|
|
192
198
|
...
|
|
193
199
|
};
|
|
194
200
|
|
|
@@ -206,6 +212,10 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
206
212
|
onChange,
|
|
207
213
|
tabIndex = 0,
|
|
208
214
|
tooltip,
|
|
215
|
+
isGroupMenuLink = false,
|
|
216
|
+
linkComponent: LinkComponent,
|
|
217
|
+
rightSlot,
|
|
218
|
+
to,
|
|
209
219
|
...restButtonProps
|
|
210
220
|
}: SideMenuLinkProps,
|
|
211
221
|
ref,
|
|
@@ -218,49 +228,75 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
218
228
|
|
|
219
229
|
return (
|
|
220
230
|
<ConditionalWrapper
|
|
221
|
-
condition={
|
|
231
|
+
condition={to !== undefined}
|
|
222
232
|
wrapper={(children) => (
|
|
223
|
-
<
|
|
233
|
+
<Link
|
|
234
|
+
to={to}
|
|
235
|
+
tabIndex={disabled ? -1 : 0}
|
|
236
|
+
linkComponent={LinkComponent}
|
|
237
|
+
className={classify(css.linkComponent, {
|
|
238
|
+
[css.closed]: !opened,
|
|
239
|
+
})}
|
|
240
|
+
onClick={onChangeHandler}
|
|
241
|
+
>
|
|
224
242
|
{children}
|
|
225
|
-
</
|
|
243
|
+
</Link>
|
|
226
244
|
)}
|
|
227
245
|
>
|
|
228
|
-
<
|
|
229
|
-
{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
[css.disabled]: disabled,
|
|
235
|
-
[css.inActive]: inActive,
|
|
236
|
-
[css.closed]: !opened,
|
|
237
|
-
},
|
|
238
|
-
classNames?.wrapper,
|
|
246
|
+
<ConditionalWrapper
|
|
247
|
+
condition={Boolean(!opened && !inActive)}
|
|
248
|
+
wrapper={(children) => (
|
|
249
|
+
<Tooltip body={MENU_NAME_LIST[pageNameKey].title} {...tooltip}>
|
|
250
|
+
{children}
|
|
251
|
+
</Tooltip>
|
|
239
252
|
)}
|
|
240
|
-
onClick={onChangeHandler}
|
|
241
|
-
ref={ref}
|
|
242
|
-
tabIndex={disabled ? -1 : tabIndex}
|
|
243
|
-
disabled={disabled}
|
|
244
|
-
key={pageNameKey}
|
|
245
253
|
>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
254
|
+
<UnstyledButton
|
|
255
|
+
{...restButtonProps}
|
|
256
|
+
className={classify(
|
|
257
|
+
css.linkWrapper,
|
|
258
|
+
{
|
|
259
|
+
[css.selected]: selected,
|
|
260
|
+
[css.disabled]: disabled,
|
|
261
|
+
[css.inActive]: inActive,
|
|
262
|
+
[css.closed]: !opened,
|
|
263
|
+
},
|
|
264
|
+
classNames?.wrapper,
|
|
265
|
+
)}
|
|
266
|
+
onClick={onChangeHandler}
|
|
267
|
+
ref={ref}
|
|
268
|
+
tabIndex={disabled || to !== undefined ? -1 : tabIndex}
|
|
269
|
+
disabled={disabled}
|
|
270
|
+
key={pageNameKey}
|
|
271
|
+
>
|
|
272
|
+
{pageNameKey && MENU_NAME_LIST[pageNameKey] ? (
|
|
273
|
+
<Icon
|
|
274
|
+
type={MENU_NAME_LIST[pageNameKey].iconType}
|
|
275
|
+
name={MENU_NAME_LIST[pageNameKey].iconName}
|
|
276
|
+
size="medium"
|
|
277
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
278
|
+
className={css.menuIcon}
|
|
279
|
+
/>
|
|
280
|
+
) : null}
|
|
281
|
+
{opened ? (
|
|
282
|
+
<div className={css.menuLabelContainer}>
|
|
283
|
+
{pageNameKey && MENU_NAME_LIST[pageNameKey] ? (
|
|
284
|
+
isGroupMenuLink ? (
|
|
285
|
+
<SubTitleSmall className={css.groupMenuLinkText}>
|
|
286
|
+
{MENU_NAME_LIST[pageNameKey].title}
|
|
287
|
+
</SubTitleSmall>
|
|
288
|
+
) : (
|
|
289
|
+
<BodyMedium className={css.menuLinkText}>
|
|
290
|
+
{MENU_NAME_LIST[pageNameKey].title}
|
|
291
|
+
</BodyMedium>
|
|
292
|
+
)
|
|
293
|
+
) : null}
|
|
294
|
+
|
|
295
|
+
{rightSlot ? rightSlot : null}
|
|
296
|
+
</div>
|
|
297
|
+
) : null}
|
|
298
|
+
</UnstyledButton>
|
|
299
|
+
</ConditionalWrapper>
|
|
264
300
|
</ConditionalWrapper>
|
|
265
301
|
);
|
|
266
302
|
},
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
colorSideMenuBackgroundDefault,
|
|
9
9
|
colorSideMenuBackgroundHovered,
|
|
10
10
|
colorSideMenuBackgroundSelected,
|
|
11
|
+
colorGroupMenuTextDefault,
|
|
11
12
|
colorFocusPrimary
|
|
12
13
|
) from '../../styles/variables/_color.css';
|
|
13
14
|
@value ( spaceNone, spaceXXSmall, spaceXSmall, spaceSmall ) from '../../styles/variables/_space.css';
|
|
@@ -62,22 +63,60 @@
|
|
|
62
63
|
color: colorSideMenuIconDefault;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
.linkComponent {
|
|
67
|
+
width: sizeFluid;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.linkComponent.closed {
|
|
72
|
+
width: size32;
|
|
73
|
+
min-width: size32;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.linkComponent:focus-visible {
|
|
78
|
+
border-radius: borderRadiusSmall;
|
|
79
|
+
outline: none;
|
|
80
|
+
box-shadow: borderWidthNone borderWidthNone borderWidthNone
|
|
81
|
+
borderWidthTertiary colorFocusPrimary;
|
|
82
|
+
}
|
|
83
|
+
|
|
65
84
|
.linkWrapper.selected {
|
|
66
85
|
background: colorSideMenuBackgroundSelected;
|
|
67
86
|
color: colorTextInversePrimary;
|
|
68
87
|
}
|
|
69
88
|
|
|
70
|
-
.linkWrapper.selected .menuIcon
|
|
89
|
+
.linkWrapper.selected .menuIcon,
|
|
90
|
+
.linkWrapper.selected .menuLinkText {
|
|
71
91
|
color: colorSideMenuIconActive;
|
|
72
92
|
}
|
|
73
93
|
|
|
74
|
-
.linkWrapper:
|
|
94
|
+
.linkWrapper:hover .menuIcon {
|
|
75
95
|
color: colorSideMenuIconActive;
|
|
76
96
|
}
|
|
77
97
|
|
|
78
|
-
.
|
|
98
|
+
.groupMenuLinkText {
|
|
79
99
|
color: inherit;
|
|
80
100
|
margin-right: spaceSmall;
|
|
81
101
|
white-space: nowrap;
|
|
82
102
|
padding-right: spaceXXSmall;
|
|
83
103
|
}
|
|
104
|
+
|
|
105
|
+
.menuLinkText {
|
|
106
|
+
color: colorGroupMenuTextDefault;
|
|
107
|
+
margin-right: spaceSmall;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
padding-right: spaceXXSmall;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.linkWrapper:hover .menuLinkText {
|
|
113
|
+
color: colorSideMenuIconActive;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.menuLabelContainer {
|
|
117
|
+
color: inherit;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex: 1;
|
|
120
|
+
justify-content: space-between;
|
|
121
|
+
padding-right: spaceXSmall;
|
|
122
|
+
}
|