@workday/canvas-kit-react 11.1.17 → 11.1.19
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/parts/ButtonLabelIcon.tsx +3 -2
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +2 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +3 -3
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.js +2 -2
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.js +2 -1
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts +3 -3
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/es6/select/lib/hooks/useSelectInput.js +2 -2
- package/package.json +4 -4
- package/select/lib/hooks/useSelectInput.ts +2 -2
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import {ButtonSizes} from '../types';
|
|
3
3
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
4
|
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
5
|
+
import {px2rem} from '@workday/canvas-kit-styling';
|
|
5
6
|
|
|
6
7
|
export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
7
8
|
/**
|
|
@@ -42,8 +43,8 @@ export const ButtonLabelIcon = createComponent('span')({
|
|
|
42
43
|
size={iconSize}
|
|
43
44
|
icon={icon}
|
|
44
45
|
shouldMirror={shouldMirrorIcon}
|
|
45
|
-
width={
|
|
46
|
-
height={
|
|
46
|
+
width={px2rem(iconSize)}
|
|
47
|
+
height={px2rem(iconSize)}
|
|
47
48
|
display="inline-block"
|
|
48
49
|
{...elemProps}
|
|
49
50
|
/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAG3E,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,2FAyB1B,CAAC"}
|
|
@@ -7,6 +7,7 @@ exports.ButtonLabelIcon = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
10
|
+
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
10
11
|
const iconSizes = {
|
|
11
12
|
extraSmall: 18,
|
|
12
13
|
small: 20,
|
|
@@ -20,6 +21,6 @@ exports.ButtonLabelIcon = common_1.createComponent('span')({
|
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
const iconSize = iconSizes[size];
|
|
23
|
-
return (react_1.default.createElement(icon_1.SystemIcon, Object.assign({ size: iconSize, icon: icon, shouldMirror: shouldMirrorIcon, width:
|
|
24
|
+
return (react_1.default.createElement(icon_1.SystemIcon, Object.assign({ size: iconSize, icon: icon, shouldMirror: shouldMirrorIcon, width: canvas_kit_styling_1.px2rem(iconSize), height: canvas_kit_styling_1.px2rem(iconSize), display: "inline-block" }, elemProps)));
|
|
24
25
|
},
|
|
25
26
|
});
|
|
@@ -102,9 +102,6 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
102
102
|
} & {
|
|
103
103
|
ref: (instance: unknown) => void;
|
|
104
104
|
onClick: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
105
|
-
} & {
|
|
106
|
-
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
107
|
-
keySofar: string;
|
|
108
105
|
} & {
|
|
109
106
|
readonly onKeyDown: (event: React.KeyboardEvent) => void;
|
|
110
107
|
readonly onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -117,6 +114,9 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
117
114
|
readonly value: string;
|
|
118
115
|
};
|
|
119
116
|
readonly 'aria-haspopup': "menu";
|
|
117
|
+
} & {
|
|
118
|
+
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
119
|
+
keySofar: string;
|
|
120
120
|
}>;
|
|
121
121
|
export {};
|
|
122
122
|
//# sourceMappingURL=useSelectInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,iBAAS,IAAI,SAEZ;AAED;;GAEG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,iBAAS,IAAI,SAEZ;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2HF,mBAAmB;+BAtFP,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;EAqIvE,CAAC"}
|
|
@@ -14,7 +14,7 @@ function noop() {
|
|
|
14
14
|
/**
|
|
15
15
|
* `useSelectInput` extends {@link useComboboxInput useComboboxInput} and {@link useComboboxKeyboardTypeAhead useComboboxKeyboardTypeAhead} and adds type ahead functionality and Select-specific [keyboard support](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/).
|
|
16
16
|
*/
|
|
17
|
-
exports.useSelectInput = common_1.composeHooks(combobox_1.useComboboxInput, combobox_1.
|
|
17
|
+
exports.useSelectInput = common_1.composeHooks(combobox_1.useComboboxInput, combobox_1.useComboboxResetCursorToSelected, combobox_1.useComboboxMoveCursorToSelected, common_1.createElemPropsHook(useSelectModel_1.useSelectModel)((model, ref, elemProps = {}) => {
|
|
18
18
|
const { elementRef: textInputElementRef, localRef: textInputRef } = common_1.useLocalRef(
|
|
19
19
|
// PopupModel says the targetRef is a `HTMLButtonElement`, but it is a `HTMLInputElement`
|
|
20
20
|
model.state.targetRef);
|
|
@@ -143,4 +143,4 @@ exports.useSelectInput = common_1.composeHooks(combobox_1.useComboboxInput, comb
|
|
|
143
143
|
},
|
|
144
144
|
'aria-haspopup': 'menu',
|
|
145
145
|
};
|
|
146
|
-
}));
|
|
146
|
+
}), combobox_1.useComboboxKeyboardTypeAhead);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAG3E,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,2FAyB1B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
4
|
+
import { px2rem } from '@workday/canvas-kit-styling';
|
|
4
5
|
const iconSizes = {
|
|
5
6
|
extraSmall: 18,
|
|
6
7
|
small: 20,
|
|
@@ -14,6 +15,6 @@ export const ButtonLabelIcon = createComponent('span')({
|
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
17
|
const iconSize = iconSizes[size];
|
|
17
|
-
return (React.createElement(SystemIcon, Object.assign({ size: iconSize, icon: icon, shouldMirror: shouldMirrorIcon, width:
|
|
18
|
+
return (React.createElement(SystemIcon, Object.assign({ size: iconSize, icon: icon, shouldMirror: shouldMirrorIcon, width: px2rem(iconSize), height: px2rem(iconSize), display: "inline-block" }, elemProps)));
|
|
18
19
|
},
|
|
19
20
|
});
|
|
@@ -102,9 +102,6 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
102
102
|
} & {
|
|
103
103
|
ref: (instance: unknown) => void;
|
|
104
104
|
onClick: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
105
|
-
} & {
|
|
106
|
-
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
107
|
-
keySofar: string;
|
|
108
105
|
} & {
|
|
109
106
|
readonly onKeyDown: (event: React.KeyboardEvent) => void;
|
|
110
107
|
readonly onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -117,6 +114,9 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
117
114
|
readonly value: string;
|
|
118
115
|
};
|
|
119
116
|
readonly 'aria-haspopup': "menu";
|
|
117
|
+
} & {
|
|
118
|
+
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
119
|
+
keySofar: string;
|
|
120
120
|
}>;
|
|
121
121
|
export {};
|
|
122
122
|
//# sourceMappingURL=useSelectInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,iBAAS,IAAI,SAEZ;AAED;;GAEG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,iBAAS,IAAI,SAEZ;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2HF,mBAAmB;+BAtFP,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;EAqIvE,CAAC"}
|
|
@@ -8,7 +8,7 @@ function noop() {
|
|
|
8
8
|
/**
|
|
9
9
|
* `useSelectInput` extends {@link useComboboxInput useComboboxInput} and {@link useComboboxKeyboardTypeAhead useComboboxKeyboardTypeAhead} and adds type ahead functionality and Select-specific [keyboard support](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/).
|
|
10
10
|
*/
|
|
11
|
-
export const useSelectInput = composeHooks(useComboboxInput,
|
|
11
|
+
export const useSelectInput = composeHooks(useComboboxInput, useComboboxResetCursorToSelected, useComboboxMoveCursorToSelected, createElemPropsHook(useSelectModel)((model, ref, elemProps = {}) => {
|
|
12
12
|
const { elementRef: textInputElementRef, localRef: textInputRef } = useLocalRef(
|
|
13
13
|
// PopupModel says the targetRef is a `HTMLButtonElement`, but it is a `HTMLInputElement`
|
|
14
14
|
model.state.targetRef);
|
|
@@ -137,4 +137,4 @@ export const useSelectInput = composeHooks(useComboboxInput, useComboboxKeyboard
|
|
|
137
137
|
},
|
|
138
138
|
'aria-haspopup': 'menu',
|
|
139
139
|
};
|
|
140
|
-
}));
|
|
140
|
+
}), useComboboxKeyboardTypeAhead);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.19",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^11.1.
|
|
53
|
-
"@workday/canvas-kit-styling": "^11.1.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^11.1.19",
|
|
53
|
+
"@workday/canvas-kit-styling": "^11.1.19",
|
|
54
54
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
55
55
|
"@workday/canvas-tokens-web": "^2.0.0",
|
|
56
56
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
68
68
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "a8c95915756e6d3b184433220f3a5c7112f168a0"
|
|
71
71
|
}
|
|
@@ -23,7 +23,6 @@ function noop() {
|
|
|
23
23
|
*/
|
|
24
24
|
export const useSelectInput = composeHooks(
|
|
25
25
|
useComboboxInput,
|
|
26
|
-
useComboboxKeyboardTypeAhead,
|
|
27
26
|
useComboboxResetCursorToSelected,
|
|
28
27
|
useComboboxMoveCursorToSelected,
|
|
29
28
|
createElemPropsHook(useSelectModel)(
|
|
@@ -190,5 +189,6 @@ export const useSelectInput = composeHooks(
|
|
|
190
189
|
'aria-haspopup': 'menu',
|
|
191
190
|
} as const;
|
|
192
191
|
}
|
|
193
|
-
)
|
|
192
|
+
),
|
|
193
|
+
useComboboxKeyboardTypeAhead
|
|
194
194
|
);
|