@workday/canvas-kit-react 7.4.10 → 7.4.12
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/button/lib/BaseButton.tsx +3 -2
- package/button/lib/parts/ButtonLabelIcon.tsx +2 -9
- package/collection/lib/useListItemSelect.tsx +3 -4
- package/dist/commonjs/button/lib/BaseButton.d.ts +2 -2
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +2 -8
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemSelect.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemSelect.js +3 -4
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.js +3 -0
- package/dist/commonjs/form-field/lib/Label.d.ts +4 -3
- package/dist/commonjs/form-field/lib/Label.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Label.js +4 -4
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +5 -2
- package/dist/es6/button/lib/BaseButton.d.ts +2 -2
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +2 -8
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemSelect.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemSelect.js +3 -4
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.js +3 -0
- package/dist/es6/form-field/lib/Label.d.ts +4 -3
- package/dist/es6/form-field/lib/Label.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Label.js +4 -4
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +5 -2
- package/form-field/lib/FormField.tsx +4 -0
- package/form-field/lib/Label.tsx +9 -8
- package/menu/lib/MenuItem.tsx +5 -2
- package/package.json +5 -4
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
EmotionCanvasTheme,
|
|
13
13
|
StyledType,
|
|
14
14
|
} from '@workday/canvas-kit-react/common';
|
|
15
|
-
import {
|
|
15
|
+
import {SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
16
|
+
import {boxStyleFn} from '@workday/canvas-kit-react/layout';
|
|
16
17
|
import {borderRadius, space, spaceNumbers, type} from '@workday/canvas-kit-react/tokens';
|
|
17
18
|
|
|
18
19
|
import {ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes} from './types';
|
|
@@ -20,7 +21,7 @@ import {ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes} from './t
|
|
|
20
21
|
import {CSSObject} from '@emotion/styled';
|
|
21
22
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
22
23
|
|
|
23
|
-
export interface ButtonContainerProps extends
|
|
24
|
+
export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBehavior {
|
|
24
25
|
colors?: ButtonColors;
|
|
25
26
|
/**
|
|
26
27
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
3
2
|
import {ButtonSizes, IconPositions} from '../types';
|
|
4
3
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
-
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
6
|
-
import {BoxProps} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
7
5
|
|
|
8
|
-
export interface ButtonLabelIconProps extends
|
|
6
|
+
export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
9
7
|
/**
|
|
10
8
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
11
9
|
*
|
|
12
10
|
* @default 'medium'
|
|
13
11
|
*/
|
|
14
12
|
size?: ButtonSizes;
|
|
15
|
-
/**
|
|
16
|
-
* The icon of the Button.
|
|
17
|
-
* Note: not displayed at `small` size
|
|
18
|
-
*/
|
|
19
|
-
icon?: CanvasSystemIcon;
|
|
20
13
|
/**
|
|
21
14
|
* Button icon positions can either be `left` or `right`.
|
|
22
15
|
* If no value is provided, it defaults to `left`.
|
|
@@ -9,12 +9,11 @@ export const useListItemSelect = createElemPropsHook(useListModel)(
|
|
|
9
9
|
const name = elemProps['data-id'] || '';
|
|
10
10
|
const onClick = (event: React.MouseEvent<HTMLElement>) => {
|
|
11
11
|
if (
|
|
12
|
-
state.nonInteractiveIds.includes(name)
|
|
13
|
-
event.currentTarget.
|
|
12
|
+
!state.nonInteractiveIds.includes(name) &&
|
|
13
|
+
event.currentTarget.getAttribute('aria-disabled') !== 'true'
|
|
14
14
|
) {
|
|
15
|
-
|
|
15
|
+
events.select({id: name});
|
|
16
16
|
}
|
|
17
|
-
events.select({id: name});
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
return {onClick};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
3
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
4
4
|
import { ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes } from './types';
|
|
5
5
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
6
|
-
export interface ButtonContainerProps extends
|
|
6
|
+
export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBehavior {
|
|
7
7
|
colors?: ButtonColors;
|
|
8
8
|
/**
|
|
9
9
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc;IACpF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAgL7E,eAAO,MAAM,iBAAiB,aAClB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,2EAcxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,aACjB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,QACjC,gBAAgB,GAAG,SAAS,gBACpB,aAAa,GAAG,SAAS,eAiDxC,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAarB,CAAC"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
1
|
import { ButtonSizes, IconPositions } from '../types';
|
|
3
|
-
import {
|
|
4
|
-
export interface ButtonLabelIconProps extends
|
|
2
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
3
|
+
export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
5
4
|
/**
|
|
6
5
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
7
6
|
*
|
|
8
7
|
* @default 'medium'
|
|
9
8
|
*/
|
|
10
9
|
size?: ButtonSizes;
|
|
11
|
-
/**
|
|
12
|
-
* The icon of the Button.
|
|
13
|
-
* Note: not displayed at `small` size
|
|
14
|
-
*/
|
|
15
|
-
icon?: CanvasSystemIcon;
|
|
16
10
|
/**
|
|
17
11
|
* Button icon positions can either be `left` or `right`.
|
|
18
12
|
* If no value is provided, it defaults to `left`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,0EAyB1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;;;
|
|
1
|
+
{"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;;;OAWxD,CAAC"}
|
|
@@ -8,11 +8,10 @@ exports.useListItemSelect = common_1.createElemPropsHook(useListModel_1.useListM
|
|
|
8
8
|
if (elemProps === void 0) { elemProps = {}; }
|
|
9
9
|
var name = elemProps['data-id'] || '';
|
|
10
10
|
var onClick = function (event) {
|
|
11
|
-
if (state.nonInteractiveIds.includes(name)
|
|
12
|
-
event.currentTarget.
|
|
13
|
-
|
|
11
|
+
if (!state.nonInteractiveIds.includes(name) &&
|
|
12
|
+
event.currentTarget.getAttribute('aria-disabled') !== 'true') {
|
|
13
|
+
events.select({ id: name });
|
|
14
14
|
}
|
|
15
|
-
events.select({ id: name });
|
|
16
15
|
};
|
|
17
16
|
return { onClick: onClick };
|
|
18
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,SAAS,EAET,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,sBAAsB,EAAiC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,cACf,SAAQ,SAAS,EACf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,cAAc;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAoED,cAAM,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,SAAS,mBAAa;IAE7B,OAAO,CAAC,OAAO,CAAoD;IAEnE,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,SAAS,EAET,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,sBAAsB,EAAiC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,cACf,SAAQ,SAAS,EACf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,cAAc;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAoED,cAAM,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,SAAS,mBAAa;IAE7B,OAAO,CAAC,OAAO,CAAoD;IAEnE,OAAO,CAAC,cAAc,CAkCpB;IAEF,MAAM;CA2DP;AAKD,eAAe,SAAS,CAAC"}
|
|
@@ -12,7 +12,7 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
12
12
|
*/
|
|
13
13
|
isLegend?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
* The id of
|
|
15
|
+
* The id of the form-related element. Synonymous with `for`.
|
|
16
16
|
*/
|
|
17
17
|
htmlFor?: string;
|
|
18
18
|
/**
|
|
@@ -21,8 +21,9 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
21
21
|
*/
|
|
22
22
|
required?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
24
|
+
* The required label is not visible to screen readers and should have no label. This prop will be
|
|
25
|
+
* ignored.
|
|
26
|
+
* @deprecated
|
|
26
27
|
*/
|
|
27
28
|
requiredLabel?: string;
|
|
28
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,sBAAsB,EAAE,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,8BAA8B;IAChE;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,sBAAsB,EAAE,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,8BAA8B;IAChE;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAuDD,cAAM,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;IAC7C,MAAM,CAAC,QAAQ,gCAA0B;IAElC,MAAM;CA8Bd;AAID,eAAe,KAAK,CAAC"}
|
|
@@ -86,7 +86,7 @@ var labelStyles = [
|
|
|
86
86
|
}));
|
|
87
87
|
},
|
|
88
88
|
];
|
|
89
|
-
var
|
|
89
|
+
var RequiredAsterisk = common_1.styled('abbr')({
|
|
90
90
|
color: tokens_1.colors.cinnamon500,
|
|
91
91
|
fontSize: '16px',
|
|
92
92
|
fontWeight: 400,
|
|
@@ -116,12 +116,12 @@ var Label = /** @class */ (function (_super) {
|
|
|
116
116
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
117
117
|
}
|
|
118
118
|
Label.prototype.render = function () {
|
|
119
|
-
var _a = this.props, _b = _a.labelPosition, labelPosition = _b === void 0 ? Label.Position.Top : _b, _c = _a.isLegend, isLegend = _c === void 0 ? false : _c,
|
|
120
|
-
var children = !
|
|
119
|
+
var _a = this.props, _b = _a.labelPosition, labelPosition = _b === void 0 ? Label.Position.Top : _b, _c = _a.isLegend, isLegend = _c === void 0 ? false : _c, required = _a.required, elemProps = __rest(_a, ["labelPosition", "isLegend", "required"]);
|
|
120
|
+
var children = !required
|
|
121
121
|
? this.props.children
|
|
122
122
|
: [
|
|
123
123
|
this.props.children,
|
|
124
|
-
React.createElement(
|
|
124
|
+
React.createElement(RequiredAsterisk, { key: '0', "aria-hidden": true }, "*"),
|
|
125
125
|
];
|
|
126
126
|
return (React.createElement(React.Fragment, null, isLegend ? (React.createElement(LegendComponent, __assign({ labelPosition: labelPosition, isLegend: isLegend }, elemProps, { children: children }))) : (React.createElement(LabelComponent, __assign({ labelPosition: labelPosition }, elemProps, { children: children })))));
|
|
127
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6FD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6FD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCvB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBnB,CAAC"}
|
|
@@ -91,7 +91,7 @@ var StyledItem = common_1.styled(layout_1.Box.as('button'))(function (_a) {
|
|
|
91
91
|
fill: tokens_1.iconColors.hover,
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
|
-
}, _b.backgroundColor = 'inherit', _b['&:disabled, &[aria-disabled]'] = {
|
|
94
|
+
}, _b.backgroundColor = 'inherit', _b['&:disabled, &[aria-disabled=true]'] = {
|
|
95
95
|
color: tokens_1.colors.licorice100,
|
|
96
96
|
cursor: 'default',
|
|
97
97
|
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
@@ -146,7 +146,10 @@ exports.useMenuItem = common_1.composeHooks(common_1.createElemPropsHook(useMenu
|
|
|
146
146
|
role: 'menuitem',
|
|
147
147
|
onClick: model.state.mode === 'single'
|
|
148
148
|
? function (event) {
|
|
149
|
-
|
|
149
|
+
// only hide if the item isn't disabled
|
|
150
|
+
if (event.currentTarget.getAttribute('aria-disabled') !== 'true') {
|
|
151
|
+
model.events.hide(event);
|
|
152
|
+
}
|
|
150
153
|
}
|
|
151
154
|
: undefined,
|
|
152
155
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
3
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
4
4
|
import { ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes } from './types';
|
|
5
5
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
6
|
-
export interface ButtonContainerProps extends
|
|
6
|
+
export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBehavior {
|
|
7
7
|
colors?: ButtonColors;
|
|
8
8
|
/**
|
|
9
9
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc;IACpF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAgL7E,eAAO,MAAM,iBAAiB,aAClB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,2EAcxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,aACjB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,QACjC,gBAAgB,GAAG,SAAS,gBACpB,aAAa,GAAG,SAAS,eAiDxC,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAarB,CAAC"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
1
|
import { ButtonSizes, IconPositions } from '../types';
|
|
3
|
-
import {
|
|
4
|
-
export interface ButtonLabelIconProps extends
|
|
2
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
3
|
+
export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
5
4
|
/**
|
|
6
5
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
7
6
|
*
|
|
8
7
|
* @default 'medium'
|
|
9
8
|
*/
|
|
10
9
|
size?: ButtonSizes;
|
|
11
|
-
/**
|
|
12
|
-
* The icon of the Button.
|
|
13
|
-
* Note: not displayed at `small` size
|
|
14
|
-
*/
|
|
15
|
-
icon?: CanvasSystemIcon;
|
|
16
10
|
/**
|
|
17
11
|
* Button icon positions can either be `left` or `right`.
|
|
18
12
|
* If no value is provided, it defaults to `left`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,0EAyB1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;;;
|
|
1
|
+
{"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;;;OAWxD,CAAC"}
|
|
@@ -5,11 +5,10 @@ export var useListItemSelect = createElemPropsHook(useListModel)(function (_a, _
|
|
|
5
5
|
if (elemProps === void 0) { elemProps = {}; }
|
|
6
6
|
var name = elemProps['data-id'] || '';
|
|
7
7
|
var onClick = function (event) {
|
|
8
|
-
if (state.nonInteractiveIds.includes(name)
|
|
9
|
-
event.currentTarget.
|
|
10
|
-
|
|
8
|
+
if (!state.nonInteractiveIds.includes(name) &&
|
|
9
|
+
event.currentTarget.getAttribute('aria-disabled') !== 'true') {
|
|
10
|
+
events.select({ id: name });
|
|
11
11
|
}
|
|
12
|
-
events.select({ id: name });
|
|
13
12
|
};
|
|
14
13
|
return { onClick: onClick };
|
|
15
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,SAAS,EAET,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,sBAAsB,EAAiC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,cACf,SAAQ,SAAS,EACf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,cAAc;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAoED,cAAM,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,SAAS,mBAAa;IAE7B,OAAO,CAAC,OAAO,CAAoD;IAEnE,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,SAAS,EAET,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,sBAAsB,EAAiC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,cACf,SAAQ,SAAS,EACf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,cAAc;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAoED,cAAM,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,SAAS,mBAAa;IAE7B,OAAO,CAAC,OAAO,CAAoD;IAEnE,OAAO,CAAC,cAAc,CAkCpB;IAEF,MAAM;CA2DP;AAKD,eAAe,SAAS,CAAC"}
|
|
@@ -12,7 +12,7 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
12
12
|
*/
|
|
13
13
|
isLegend?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
* The id of
|
|
15
|
+
* The id of the form-related element. Synonymous with `for`.
|
|
16
16
|
*/
|
|
17
17
|
htmlFor?: string;
|
|
18
18
|
/**
|
|
@@ -21,8 +21,9 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
21
21
|
*/
|
|
22
22
|
required?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
24
|
+
* The required label is not visible to screen readers and should have no label. This prop will be
|
|
25
|
+
* ignored.
|
|
26
|
+
* @deprecated
|
|
26
27
|
*/
|
|
27
28
|
requiredLabel?: string;
|
|
28
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,sBAAsB,EAAE,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,8BAA8B;IAChE;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,sBAAsB,EAAE,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,8BAA8B;IAChE;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAuDD,cAAM,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;IAC7C,MAAM,CAAC,QAAQ,gCAA0B;IAElC,MAAM;CA8Bd;AAID,eAAe,KAAK,CAAC"}
|
|
@@ -65,7 +65,7 @@ var labelStyles = [
|
|
|
65
65
|
}));
|
|
66
66
|
},
|
|
67
67
|
];
|
|
68
|
-
var
|
|
68
|
+
var RequiredAsterisk = styled('abbr')({
|
|
69
69
|
color: colors.cinnamon500,
|
|
70
70
|
fontSize: '16px',
|
|
71
71
|
fontWeight: 400,
|
|
@@ -95,12 +95,12 @@ var Label = /** @class */ (function (_super) {
|
|
|
95
95
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
96
96
|
}
|
|
97
97
|
Label.prototype.render = function () {
|
|
98
|
-
var _a = this.props, _b = _a.labelPosition, labelPosition = _b === void 0 ? Label.Position.Top : _b, _c = _a.isLegend, isLegend = _c === void 0 ? false : _c,
|
|
99
|
-
var children = !
|
|
98
|
+
var _a = this.props, _b = _a.labelPosition, labelPosition = _b === void 0 ? Label.Position.Top : _b, _c = _a.isLegend, isLegend = _c === void 0 ? false : _c, required = _a.required, elemProps = __rest(_a, ["labelPosition", "isLegend", "required"]);
|
|
99
|
+
var children = !required
|
|
100
100
|
? this.props.children
|
|
101
101
|
: [
|
|
102
102
|
this.props.children,
|
|
103
|
-
React.createElement(
|
|
103
|
+
React.createElement(RequiredAsterisk, { key: '0', "aria-hidden": true }, "*"),
|
|
104
104
|
];
|
|
105
105
|
return (React.createElement(React.Fragment, null, isLegend ? (React.createElement(LegendComponent, __assign({ labelPosition: labelPosition, isLegend: isLegend }, elemProps, { children: children }))) : (React.createElement(LabelComponent, __assign({ labelPosition: labelPosition }, elemProps, { children: children })))));
|
|
106
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6FD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6FD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCvB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBnB,CAAC"}
|
|
@@ -69,7 +69,7 @@ var StyledItem = styled(Box.as('button'))(function (_a) {
|
|
|
69
69
|
fill: iconColors.hover,
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
|
-
}, _b.backgroundColor = 'inherit', _b['&:disabled, &[aria-disabled]'] = {
|
|
72
|
+
}, _b.backgroundColor = 'inherit', _b['&:disabled, &[aria-disabled=true]'] = {
|
|
73
73
|
color: colors.licorice100,
|
|
74
74
|
cursor: 'default',
|
|
75
75
|
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
@@ -124,7 +124,10 @@ export var useMenuItem = composeHooks(createElemPropsHook(useMenuModel)(function
|
|
|
124
124
|
role: 'menuitem',
|
|
125
125
|
onClick: model.state.mode === 'single'
|
|
126
126
|
? function (event) {
|
|
127
|
-
|
|
127
|
+
// only hide if the item isn't disabled
|
|
128
|
+
if (event.currentTarget.getAttribute('aria-disabled') !== 'true') {
|
|
129
|
+
model.events.hide(event);
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
132
|
: undefined,
|
|
130
133
|
};
|
package/form-field/lib/Label.tsx
CHANGED
|
@@ -15,7 +15,7 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
15
15
|
*/
|
|
16
16
|
isLegend?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
* The id of
|
|
18
|
+
* The id of the form-related element. Synonymous with `for`.
|
|
19
19
|
*/
|
|
20
20
|
htmlFor?: string;
|
|
21
21
|
/**
|
|
@@ -24,8 +24,9 @@ export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
|
24
24
|
*/
|
|
25
25
|
required?: boolean;
|
|
26
26
|
/**
|
|
27
|
-
* The
|
|
28
|
-
*
|
|
27
|
+
* The required label is not visible to screen readers and should have no label. This prop will be
|
|
28
|
+
* ignored.
|
|
29
|
+
* @deprecated
|
|
29
30
|
*/
|
|
30
31
|
requiredLabel?: string;
|
|
31
32
|
/**
|
|
@@ -62,7 +63,7 @@ const labelStyles = [
|
|
|
62
63
|
},
|
|
63
64
|
];
|
|
64
65
|
|
|
65
|
-
const
|
|
66
|
+
const RequiredAsterisk = styled('abbr')({
|
|
66
67
|
color: colors.cinnamon500,
|
|
67
68
|
fontSize: '16px',
|
|
68
69
|
fontWeight: 400,
|
|
@@ -95,16 +96,16 @@ class Label extends React.Component<LabelProps> {
|
|
|
95
96
|
const {
|
|
96
97
|
labelPosition = Label.Position.Top,
|
|
97
98
|
isLegend = false,
|
|
98
|
-
|
|
99
|
+
required,
|
|
99
100
|
...elemProps
|
|
100
101
|
} = this.props;
|
|
101
|
-
const children = !
|
|
102
|
+
const children = !required
|
|
102
103
|
? this.props.children
|
|
103
104
|
: [
|
|
104
105
|
this.props.children,
|
|
105
|
-
<
|
|
106
|
+
<RequiredAsterisk key={'0'} aria-hidden>
|
|
106
107
|
*
|
|
107
|
-
</
|
|
108
|
+
</RequiredAsterisk>,
|
|
108
109
|
];
|
|
109
110
|
return (
|
|
110
111
|
<>
|
package/menu/lib/MenuItem.tsx
CHANGED
|
@@ -97,7 +97,7 @@ const StyledItem = styled(Box.as('button'))<StyledType>(
|
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
99
|
backgroundColor: 'inherit',
|
|
100
|
-
'&:disabled, &[aria-disabled]': {
|
|
100
|
+
'&:disabled, &[aria-disabled=true]': {
|
|
101
101
|
color: colors.licorice100,
|
|
102
102
|
cursor: 'default',
|
|
103
103
|
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
@@ -158,7 +158,10 @@ export const useMenuItem = composeHooks(
|
|
|
158
158
|
onClick:
|
|
159
159
|
model.state.mode === 'single'
|
|
160
160
|
? (event: React.SyntheticEvent) => {
|
|
161
|
-
|
|
161
|
+
// only hide if the item isn't disabled
|
|
162
|
+
if (event.currentTarget.getAttribute('aria-disabled') !== 'true') {
|
|
163
|
+
model.events.hide(event);
|
|
164
|
+
}
|
|
162
165
|
}
|
|
163
166
|
: undefined,
|
|
164
167
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.12",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"workday"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"react": "^16.8 || ^17.0"
|
|
44
|
+
"react": "^16.8 || ^17.0",
|
|
45
|
+
"react-dom": "^16.8 || ^17.0"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@emotion/is-prop-valid": "^1.1.1",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"@emotion/styled": "^11.6.0",
|
|
50
51
|
"@popperjs/core": "^2.5.4",
|
|
51
52
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^7.4.
|
|
53
|
+
"@workday/canvas-kit-popup-stack": "^7.4.12",
|
|
53
54
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
54
55
|
"@workday/design-assets-types": "^0.2.8",
|
|
55
56
|
"chroma-js": "^2.1.0",
|
|
@@ -68,5 +69,5 @@
|
|
|
68
69
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
69
70
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
70
71
|
},
|
|
71
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c1702abe32e2ee10d97536a2ca0b81c11092cdd3"
|
|
72
73
|
}
|