@workday/canvas-kit-preview-react 7.0.0-alpha.103-next.28 → 7.0.0-alpha.129-next.3
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/breadcrumbs/index.ts +0 -4
- package/breadcrumbs/lib/Breadcrumbs/List/index.tsx +3 -5
- package/breadcrumbs/package.json +2 -1
- package/color-picker/README.md +1 -1
- package/color-picker/index.ts +1 -1
- package/color-picker/lib/ColorPicker.tsx +2 -3
- package/color-picker/package.json +2 -1
- package/dist/commonjs/breadcrumbs/index.d.ts +0 -3
- package/dist/commonjs/breadcrumbs/index.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/index.js +0 -4
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.js +2 -14
- package/dist/commonjs/color-picker/index.d.ts +1 -1
- package/dist/commonjs/color-picker/index.d.ts.map +1 -1
- package/dist/commonjs/color-picker/index.js +2 -6
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +1 -2
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +5 -4
- package/dist/commonjs/menu/index.d.ts +1 -4
- package/dist/commonjs/menu/index.d.ts.map +1 -1
- package/dist/commonjs/menu/index.js +1 -9
- package/dist/commonjs/menu/lib/Menu.d.ts +1 -1
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +3 -2
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -2
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +2 -1
- package/dist/commonjs/pill/lib/Pill.d.ts +7 -0
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +11 -4
- package/dist/commonjs/pill/lib/PillAvatar.d.ts +1 -0
- package/dist/commonjs/pill/lib/PillAvatar.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillAvatar.js +1 -1
- package/dist/commonjs/pill/lib/PillIcon.d.ts +1 -0
- package/dist/commonjs/pill/lib/PillIcon.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillIcon.js +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.d.ts +6 -0
- package/dist/commonjs/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +17 -24
- package/dist/commonjs/pill/lib/PillLabel.d.ts +1 -0
- package/dist/commonjs/pill/lib/PillLabel.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillLabel.js +1 -1
- package/dist/commonjs/pill/lib/usePillModel.d.ts +13 -0
- package/dist/commonjs/pill/lib/usePillModel.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/usePillModel.js +7 -1
- package/dist/commonjs/select/index.d.ts +1 -4
- package/dist/commonjs/select/index.d.ts.map +1 -1
- package/dist/commonjs/select/index.js +0 -7
- package/dist/commonjs/select/lib/Select.d.ts +0 -1
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +2 -6
- package/dist/commonjs/select/lib/SelectBase.d.ts +21 -2
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectBase.js +12 -13
- package/dist/commonjs/select/lib/SelectMenu.d.ts +2 -2
- package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectMenu.js +2 -2
- package/dist/commonjs/select/lib/SelectOption.d.ts +1 -2
- package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectOption.js +2 -1
- package/dist/commonjs/side-panel/index.d.ts +0 -3
- package/dist/commonjs/side-panel/index.d.ts.map +1 -1
- package/dist/commonjs/side-panel/index.js +0 -7
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +1 -2
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +3 -3
- package/dist/es6/breadcrumbs/index.d.ts +0 -3
- package/dist/es6/breadcrumbs/index.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/index.js +0 -3
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.js +2 -14
- package/dist/es6/color-picker/index.d.ts +1 -1
- package/dist/es6/color-picker/index.d.ts.map +1 -1
- package/dist/es6/color-picker/index.js +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.d.ts +1 -2
- package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +2 -3
- package/dist/es6/menu/index.d.ts +1 -4
- package/dist/es6/menu/index.d.ts.map +1 -1
- package/dist/es6/menu/index.js +1 -4
- package/dist/es6/menu/lib/Menu.d.ts +1 -1
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +2 -2
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -2
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +1 -1
- package/dist/es6/pill/lib/Pill.d.ts +14 -7
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +11 -4
- package/dist/es6/pill/lib/PillAvatar.d.ts +2 -2
- package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillAvatar.js +1 -1
- package/dist/es6/pill/lib/PillIcon.d.ts +2 -2
- package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIcon.js +1 -1
- package/dist/es6/pill/lib/PillIconButton.d.ts +7 -2
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +18 -25
- package/dist/es6/pill/lib/PillLabel.d.ts +2 -2
- package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillLabel.js +1 -1
- package/dist/es6/pill/lib/usePillModel.d.ts +18 -5
- package/dist/es6/pill/lib/usePillModel.d.ts.map +1 -1
- package/dist/es6/pill/lib/usePillModel.js +8 -2
- package/dist/es6/select/index.d.ts +1 -4
- package/dist/es6/select/index.d.ts.map +1 -1
- package/dist/es6/select/index.js +0 -3
- package/dist/es6/select/lib/Select.d.ts +0 -1
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +1 -2
- package/dist/es6/select/lib/SelectBase.d.ts +21 -2
- package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectBase.js +9 -8
- package/dist/es6/select/lib/SelectMenu.d.ts +2 -2
- package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectMenu.js +1 -2
- package/dist/es6/select/lib/SelectOption.d.ts +1 -2
- package/dist/es6/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectOption.js +1 -2
- package/dist/es6/side-panel/index.d.ts +0 -3
- package/dist/es6/side-panel/index.d.ts.map +1 -1
- package/dist/es6/side-panel/index.js +0 -3
- package/dist/es6/side-panel/lib/SidePanel.d.ts +1 -2
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +1 -2
- package/form-field/package.json +2 -1
- package/menu/index.ts +1 -6
- package/menu/lib/Menu.tsx +2 -2
- package/menu/lib/MenuItem.tsx +1 -3
- package/menu/package.json +2 -1
- package/package.json +8 -7
- package/pill/lib/Pill.tsx +10 -2
- package/pill/lib/PillAvatar.tsx +1 -0
- package/pill/lib/PillIcon.tsx +2 -0
- package/pill/lib/PillIconButton.tsx +36 -32
- package/pill/lib/PillLabel.tsx +1 -0
- package/pill/lib/usePillModel.tsx +8 -1
- package/pill/package.json +2 -1
- package/select/README.md +7 -7
- package/select/index.ts +6 -4
- package/select/lib/Select.tsx +1 -3
- package/select/lib/SelectBase.tsx +30 -8
- package/select/lib/SelectMenu.tsx +1 -3
- package/select/lib/SelectOption.tsx +1 -3
- package/select/package.json +2 -1
- package/side-panel/index.ts +0 -4
- package/side-panel/lib/SidePanel.tsx +1 -2
- package/side-panel/package.json +2 -1
- package/text-area/package.json +2 -1
- package/text-input/package.json +2 -1
|
@@ -74,8 +74,7 @@ var Option = styled('li')(__assign(__assign({}, type.levels.subtext.large), { cu
|
|
|
74
74
|
padding: optionPadding + "px " + (error === ErrorType.Alert ? optionPadding - 1 : optionPadding) + "px",
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
-
var SelectOption = function (_a) {
|
|
77
|
+
export var SelectOption = function (_a) {
|
|
78
78
|
var children = _a.children, _b = _a.focused, focused = _b === void 0 ? false : _b, _c = _a.interactive, interactive = _c === void 0 ? true : _c, optionRef = _a.optionRef, value = _a.value, elemProps = __rest(_a, ["children", "focused", "interactive", "optionRef", "value"]);
|
|
79
79
|
return (React.createElement(Option, __assign({ "data-value": value, focused: focused, interactive: interactive, ref: optionRef, role: "option" }, elemProps), children));
|
|
80
80
|
};
|
|
81
|
-
export default SelectOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../side-panel/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../side-panel/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -66,7 +66,7 @@ export declare const SidePanelContext: React.Context<{
|
|
|
66
66
|
state: string;
|
|
67
67
|
origin: string;
|
|
68
68
|
}>;
|
|
69
|
-
declare const SidePanel: {
|
|
69
|
+
export declare const SidePanel: {
|
|
70
70
|
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
71
|
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
72
|
};
|
|
@@ -82,5 +82,4 @@ export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
|
82
82
|
*/
|
|
83
83
|
tooltipTextCollapse?: string;
|
|
84
84
|
};
|
|
85
|
-
export default SidePanel;
|
|
86
85
|
//# sourceMappingURL=SidePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,EAAuB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAKrF,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,EAAuB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAKrF,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,eAAO,MAAM,SAAS;+KAcnB,cAAc;mHA0Gd,iBAAiB,GAAG,MAAM,oBAAoB,CAAC,iBAAiB,CAAC;CAxBnE,CAAC;AAEF,oBAAY,iBAAiB,GAAG,mBAAmB,GAAG;IACpD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC"}
|
|
@@ -56,7 +56,7 @@ export var SidePanelContext = React.createContext({
|
|
|
56
56
|
state: 'expanded',
|
|
57
57
|
origin: 'left',
|
|
58
58
|
});
|
|
59
|
-
var SidePanel = function (_a) {
|
|
59
|
+
export var SidePanel = function (_a) {
|
|
60
60
|
var _b = _a.as, as = _b === void 0 ? 'section' : _b, children = _a.children, _c = _a.collapsedWidth, collapsedWidth = _c === void 0 ? 64 : _c, _d = _a.expanded, expanded = _d === void 0 ? true : _d, _e = _a.expandedWidth, expandedWidth = _e === void 0 ? 320 : _e, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _f = _a.origin, origin = _f === void 0 ? 'left' : _f, _g = _a.variant, variant = _g === void 0 ? 'standard' : _g, touched = _a.touched, elemProps = __rest(_a, ["as", "children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "variant", "touched"]);
|
|
61
61
|
var _h = React.useState(expanded ? 'expanded' : 'collapsed'), state = _h[0], setState = _h[1];
|
|
62
62
|
React.useEffect(function () {
|
|
@@ -146,5 +146,4 @@ var ToggleButton = function (_a) {
|
|
|
146
146
|
jsx(TertiaryButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest))));
|
|
147
147
|
};
|
|
148
148
|
SidePanel.ToggleButton = ToggleButton;
|
|
149
|
-
export default SidePanel;
|
|
150
149
|
var templateObject_1;
|
package/form-field/package.json
CHANGED
package/menu/index.ts
CHANGED
package/menu/lib/Menu.tsx
CHANGED
|
@@ -57,7 +57,7 @@ const List = styled('ul')({
|
|
|
57
57
|
...hideMouseFocus,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
export
|
|
60
|
+
export class Menu extends React.Component<MenuProps, MenuState> {
|
|
61
61
|
private id = generateUniqueId();
|
|
62
62
|
private animateId!: number;
|
|
63
63
|
|
|
@@ -284,7 +284,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
284
284
|
private setFirstCharacters = (): void => {
|
|
285
285
|
const getFirstCharacter = (child: React.ReactNode): string => {
|
|
286
286
|
let character = '';
|
|
287
|
-
if (!child || typeof child === 'boolean'
|
|
287
|
+
if (!child || typeof child === 'boolean') {
|
|
288
288
|
character = '';
|
|
289
289
|
} else if (typeof child === 'string' || typeof child === 'number') {
|
|
290
290
|
character = child
|
package/menu/lib/MenuItem.tsx
CHANGED
|
@@ -237,7 +237,7 @@ const scrollIntoViewIfNeeded = (elem: HTMLElement, centerIfNeeded = true): void
|
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
class MenuItem extends React.Component<MenuItemProps> {
|
|
240
|
+
export class MenuItem extends React.Component<MenuItemProps> {
|
|
241
241
|
ref = React.createRef<HTMLLIElement>();
|
|
242
242
|
|
|
243
243
|
componentDidUpdate = (prevProps: MenuItemProps) => {
|
|
@@ -310,5 +310,3 @@ MenuItem.defaultProps = {
|
|
|
310
310
|
shouldClose: true,
|
|
311
311
|
role: 'menuitem',
|
|
312
312
|
};
|
|
313
|
-
|
|
314
|
-
export default MenuItem;
|
package/menu/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.129-next.3+f4cdec5a",
|
|
4
4
|
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"types": "dist/es6/index.d.ts",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "
|
|
13
|
+
"url": "https://github.com/workday/canvas-kit.git",
|
|
14
|
+
"directory": "modules/preview-react"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"*/package.json",
|
|
@@ -40,20 +41,20 @@
|
|
|
40
41
|
"workday"
|
|
41
42
|
],
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"react": "^
|
|
44
|
+
"react": "^17.0 || ^18.0"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@emotion/react": "^11.7.1",
|
|
47
48
|
"@emotion/styled": "^11.6.0",
|
|
48
|
-
"@workday/canvas-kit-react": "^7.0.0-alpha.
|
|
49
|
+
"@workday/canvas-kit-react": "^7.0.0-alpha.129-next.3+f4cdec5a",
|
|
49
50
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
50
|
-
"@workday/design-assets-types": "^0.2.
|
|
51
|
+
"@workday/design-assets-types": "^0.2.8"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
54
|
-
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.
|
|
55
|
+
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.129-next.3+f4cdec5a",
|
|
55
56
|
"formik": "^2.2.9",
|
|
56
57
|
"yup": "^0.31.1"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f4cdec5aa17c18b03695a3c99417e384fd9aecdc"
|
|
59
60
|
}
|
package/pill/lib/Pill.tsx
CHANGED
|
@@ -92,6 +92,7 @@ const getRemovablePillColors = (disabled?: boolean) => {
|
|
|
92
92
|
icon: colors.licorice200,
|
|
93
93
|
background: colors.soap300,
|
|
94
94
|
label: colors.blackPepper400,
|
|
95
|
+
|
|
95
96
|
focusRing: focusRing({
|
|
96
97
|
width: 0,
|
|
97
98
|
innerColor: 'transparent',
|
|
@@ -124,7 +125,6 @@ const StyledBasePill = styled(BaseButton.as('button'))<StyledType & PillProps>(
|
|
|
124
125
|
{
|
|
125
126
|
...pillBaseStyles,
|
|
126
127
|
'&:focus': {
|
|
127
|
-
borderColor: colors.blueberry400,
|
|
128
128
|
'span[data-count="ck-pill-count"]': {
|
|
129
129
|
borderTop: `1px solid ${colors.blueberry400}`,
|
|
130
130
|
borderBottom: `1px solid ${colors.blueberry400}`,
|
|
@@ -146,12 +146,18 @@ const StyledBasePill = styled(BaseButton.as('button'))<StyledType & PillProps>(
|
|
|
146
146
|
},
|
|
147
147
|
}),
|
|
148
148
|
},
|
|
149
|
+
({variant}) => ({
|
|
150
|
+
'&:focus': {
|
|
151
|
+
borderColor: variant === 'removable' ? undefined : colors.blueberry400,
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
149
154
|
boxStyleFn
|
|
150
155
|
);
|
|
151
156
|
|
|
152
|
-
const StyledNonInteractivePill = styled(StyledBasePill)({
|
|
157
|
+
const StyledNonInteractivePill = styled(StyledBasePill)<StyledType>({
|
|
153
158
|
cursor: 'default',
|
|
154
159
|
overflow: 'revert', // override BaseButton overflow styles so the click target exists outside the pill for removable
|
|
160
|
+
position: 'relative',
|
|
155
161
|
});
|
|
156
162
|
|
|
157
163
|
export const Pill = createContainer('button')({
|
|
@@ -171,6 +177,7 @@ export const Pill = createContainer('button')({
|
|
|
171
177
|
maxWidth={model.state.maxWidth}
|
|
172
178
|
as={Element !== 'button' ? Element : 'span'}
|
|
173
179
|
border={`1px solid ${colors.licorice200}`}
|
|
180
|
+
id={model.state.id}
|
|
174
181
|
{...elemProps}
|
|
175
182
|
>
|
|
176
183
|
<PillLabel>{elemProps.children}</PillLabel>
|
|
@@ -201,6 +208,7 @@ export const Pill = createContainer('button')({
|
|
|
201
208
|
<StyledNonInteractivePill
|
|
202
209
|
colors={getRemovablePillColors(model.state.disabled)}
|
|
203
210
|
as={Element !== 'button' ? Element : 'span'}
|
|
211
|
+
variant={variant}
|
|
204
212
|
{...elemProps}
|
|
205
213
|
>
|
|
206
214
|
<HStack spacing="xxxs" display="inline-flex" alignItems="center" justifyContent="center">
|
package/pill/lib/PillAvatar.tsx
CHANGED
package/pill/lib/PillIcon.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
|
6
6
|
import {usePillModel} from './usePillModel';
|
|
7
7
|
import {xSmallIcon} from '@workday/canvas-system-icons-web';
|
|
8
8
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
9
|
-
import {
|
|
9
|
+
import {colors, space} from '@workday/canvas-kit-react/tokens';
|
|
10
10
|
import {BaseButton} from '@workday/canvas-kit-react/button';
|
|
11
11
|
|
|
12
12
|
export interface PillIconButtonProps extends Omit<SystemIconProps, 'icon'> {
|
|
@@ -15,6 +15,11 @@ export interface PillIconButtonProps extends Omit<SystemIconProps, 'icon'> {
|
|
|
15
15
|
* @default `xSmallIcon`
|
|
16
16
|
*/
|
|
17
17
|
icon?: CanvasSystemIcon;
|
|
18
|
+
/**
|
|
19
|
+
* The aria label for the removable icon
|
|
20
|
+
* @default 'remove'
|
|
21
|
+
*/
|
|
22
|
+
'aria-label'?: string;
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
const getIconColors = () => {
|
|
@@ -33,9 +38,7 @@ const getIconColors = () => {
|
|
|
33
38
|
icon: colors.licorice500,
|
|
34
39
|
|
|
35
40
|
focusRing: focusRing({
|
|
36
|
-
width: 0,
|
|
37
41
|
innerColor: 'transparent',
|
|
38
|
-
outerColor: 'transparent',
|
|
39
42
|
}),
|
|
40
43
|
},
|
|
41
44
|
disabled: {
|
|
@@ -45,51 +48,52 @@ const getIconColors = () => {
|
|
|
45
48
|
};
|
|
46
49
|
};
|
|
47
50
|
|
|
48
|
-
const StyledFocusTarget = styled('span')<StyledType & PillIconButtonProps>({
|
|
49
|
-
height: 20,
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
right: '5px',
|
|
52
|
-
left: space.xxxs,
|
|
53
|
-
margin: 0,
|
|
54
|
-
borderRadius: borderRadius.m,
|
|
55
|
-
'&:focus': {
|
|
56
|
-
outline: 'none',
|
|
57
|
-
...focusRing({
|
|
58
|
-
outerColor: colors.blueberry400,
|
|
59
|
-
innerColor: 'transparent',
|
|
60
|
-
separation: 0,
|
|
61
|
-
width: 2,
|
|
62
|
-
inset: 'inner',
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
51
|
const StyledIconButton = styled(BaseButton)<StyledType & PillIconButtonProps>({
|
|
68
|
-
marginInlineEnd: '-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
marginInlineEnd: '-7px', // visually pull in the pill to the right size
|
|
53
|
+
marginInlineStart: `-2px`, // visually create space between label and the button
|
|
54
|
+
overflow: 'visible',
|
|
55
|
+
'::after': {
|
|
56
|
+
content: '""',
|
|
57
|
+
height: space.l,
|
|
58
|
+
width: space.l,
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
left: '-7px',
|
|
61
|
+
bottom: '-7px',
|
|
62
|
+
margin: 0,
|
|
63
|
+
pointerEvents: 'all',
|
|
64
|
+
cursor: 'pointer',
|
|
65
|
+
},
|
|
71
66
|
});
|
|
72
67
|
|
|
73
68
|
export const PillIconButton = createSubcomponent('button')({
|
|
74
69
|
modelHook: usePillModel,
|
|
75
70
|
})<PillIconButtonProps>(
|
|
76
|
-
(
|
|
71
|
+
(
|
|
72
|
+
{size, icon = xSmallIcon, maxWidth, children, 'aria-label': ariaLabel = 'remove', ...elemProps},
|
|
73
|
+
Element,
|
|
74
|
+
model
|
|
75
|
+
) => {
|
|
77
76
|
return (
|
|
78
77
|
<StyledIconButton
|
|
79
78
|
borderRadius="s"
|
|
80
|
-
height={
|
|
81
|
-
width={
|
|
79
|
+
height={20}
|
|
80
|
+
width={20}
|
|
82
81
|
padding="zero"
|
|
83
82
|
disabled={model.state.disabled}
|
|
84
83
|
colors={getIconColors()}
|
|
85
|
-
|
|
84
|
+
aria-labelledby={`removable-${model.state.id} label-${model.state.id}`}
|
|
86
85
|
as={Element}
|
|
87
86
|
position="relative"
|
|
88
87
|
{...elemProps}
|
|
89
88
|
>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
<SystemIcon
|
|
90
|
+
aria-label={ariaLabel}
|
|
91
|
+
id={`removable-${model.state.id}`}
|
|
92
|
+
icon={icon}
|
|
93
|
+
size={space.m}
|
|
94
|
+
aria-hidden // This works for Chrome but not needed in Safari
|
|
95
|
+
role="img"
|
|
96
|
+
/>
|
|
93
97
|
</StyledIconButton>
|
|
94
98
|
);
|
|
95
99
|
}
|
package/pill/lib/PillLabel.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {createModelHook} from '@workday/canvas-kit-react/common';
|
|
1
|
+
import {createModelHook, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
2
2
|
|
|
3
3
|
export const usePillModel = createModelHook({
|
|
4
4
|
defaultConfig: {
|
|
@@ -11,10 +11,17 @@ export const usePillModel = createModelHook({
|
|
|
11
11
|
* Use to disable a pill.
|
|
12
12
|
*/
|
|
13
13
|
disabled: false,
|
|
14
|
+
/**
|
|
15
|
+
* ID used to add accessibility labels to pill elements.
|
|
16
|
+
* @default `useUniqueId()`
|
|
17
|
+
*/
|
|
18
|
+
id: '',
|
|
14
19
|
},
|
|
15
20
|
})(config => {
|
|
21
|
+
const id = useUniqueId(config.id);
|
|
16
22
|
const state = {
|
|
17
23
|
...config,
|
|
24
|
+
id,
|
|
18
25
|
};
|
|
19
26
|
|
|
20
27
|
return {state, events: {}};
|
package/pill/package.json
CHANGED
package/select/README.md
CHANGED
|
@@ -34,7 +34,7 @@ fully accessible (see below).
|
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
36
|
import * as React from 'react';
|
|
37
|
-
import Select from '@workday/canvas-kit-preview-react/select';
|
|
37
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
38
38
|
|
|
39
39
|
function Example() {
|
|
40
40
|
const options = [
|
|
@@ -58,8 +58,8 @@ function Example() {
|
|
|
58
58
|
|
|
59
59
|
```tsx
|
|
60
60
|
import * as React from 'react';
|
|
61
|
-
import Select from '@workday/canvas-kit-preview-react/select';
|
|
62
|
-
import FormField from '@workday/canvas-kit-react/form-field';
|
|
61
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
62
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
63
63
|
|
|
64
64
|
function Example() {
|
|
65
65
|
const options = [
|
|
@@ -89,8 +89,8 @@ function Example() {
|
|
|
89
89
|
|
|
90
90
|
```tsx
|
|
91
91
|
import * as React from 'react';
|
|
92
|
-
import Select from '@workday/canvas-kit-preview-react/select';
|
|
93
|
-
import FormField from '@workday/canvas-kit-react/form-field';
|
|
92
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
93
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
94
94
|
|
|
95
95
|
function Example() {
|
|
96
96
|
const options = ['California', 'Florida', 'New York', 'Pennsylvania', 'Texas'];
|
|
@@ -117,8 +117,8 @@ used to customize how each option is rendered.
|
|
|
117
117
|
|
|
118
118
|
```tsx
|
|
119
119
|
import * as React from 'react';
|
|
120
|
-
import Select from '@workday/canvas-kit-preview-react/select';
|
|
121
|
-
import FormField from '@workday/canvas-kit-react/form-field';
|
|
120
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
121
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
122
122
|
import {colors, typeColors} from '@workday/canvas-kit-react/tokens';
|
|
123
123
|
import {
|
|
124
124
|
activityStreamIcon,
|
package/select/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import Select from './lib/Select';
|
|
2
1
|
|
|
3
|
-
export default Select;
|
|
4
|
-
export {Select};
|
|
5
2
|
export * from './lib/Select';
|
|
6
3
|
|
|
7
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
Option,
|
|
6
|
+
RenderableOption,
|
|
7
|
+
RenderOptionFunction,
|
|
8
|
+
RenderSelectedFunction,
|
|
9
|
+
} from './lib/SelectBase';
|
package/select/lib/Select.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
generateUniqueId,
|
|
8
8
|
} from '@workday/canvas-kit-react/common';
|
|
9
9
|
import {menuAnimationDuration} from './SelectMenu';
|
|
10
|
-
import SelectBase,
|
|
10
|
+
import {SelectBase, CoreSelectBaseProps, Option, NormalizedOption} from './SelectBase';
|
|
11
11
|
import {MenuVisibility} from './types';
|
|
12
12
|
import {getCorrectedIndexByValue} from './utils';
|
|
13
13
|
|
|
@@ -587,5 +587,3 @@ export const Select = createComponent('button')({
|
|
|
587
587
|
ErrorType,
|
|
588
588
|
},
|
|
589
589
|
});
|
|
590
|
-
|
|
591
|
-
export default Select;
|
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
import {caretDownSmallIcon} from '@workday/canvas-system-icons-web';
|
|
21
21
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
22
22
|
|
|
23
|
-
import SelectMenu from './SelectMenu';
|
|
24
|
-
import SelectOption from './SelectOption';
|
|
23
|
+
import {SelectMenu} from './SelectMenu';
|
|
24
|
+
import {SelectOption} from './SelectOption';
|
|
25
25
|
import {scrollIntoViewIfNeeded} from './scrolling';
|
|
26
26
|
import {MenuPlacement, MenuVisibility} from './types';
|
|
27
27
|
import {getCorrectedIndexByValue} from './utils';
|
|
@@ -49,6 +49,10 @@ export interface NormalizedOption extends Option {
|
|
|
49
49
|
label: string;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export interface RenderSelectedFunction {
|
|
53
|
+
(option: NormalizedOption): React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
export interface RenderableOption extends NormalizedOption {
|
|
53
57
|
focused: boolean;
|
|
54
58
|
selected: boolean;
|
|
@@ -86,6 +90,22 @@ export interface CoreSelectBaseProps
|
|
|
86
90
|
* @default defaultRenderOption
|
|
87
91
|
*/
|
|
88
92
|
renderOption?: RenderOptionFunction;
|
|
93
|
+
/**
|
|
94
|
+
* The function called to render the selected option.
|
|
95
|
+
*
|
|
96
|
+
* The `option` argument passed to the function is an object which contains the following:
|
|
97
|
+
*
|
|
98
|
+
* * `data: object` (data object carried over from the corresponding option originally passed into the component)
|
|
99
|
+
* * `disabled: boolean`
|
|
100
|
+
* * `id: string`
|
|
101
|
+
* * `label: string`
|
|
102
|
+
* * `value: string`
|
|
103
|
+
*
|
|
104
|
+
* If you omit the `renderSelected` prop, each option will be rendered using a `defaultRenderSelected` function provided by the component.
|
|
105
|
+
*
|
|
106
|
+
* @default defaultRenderSelected
|
|
107
|
+
*/
|
|
108
|
+
renderSelected?: RenderSelectedFunction;
|
|
89
109
|
/**
|
|
90
110
|
* The value of the Select.
|
|
91
111
|
*/
|
|
@@ -261,10 +281,14 @@ const SelectWrapper = styled('div')<Pick<SelectBaseProps, 'grow' | 'disabled'>>(
|
|
|
261
281
|
);
|
|
262
282
|
|
|
263
283
|
const defaultRenderOption: RenderOptionFunction = option => {
|
|
264
|
-
return <div>{option
|
|
284
|
+
return <div>{defaultRenderSelected(option)}</div>;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const defaultRenderSelected: RenderSelectedFunction = option => {
|
|
288
|
+
return option.label;
|
|
265
289
|
};
|
|
266
290
|
|
|
267
|
-
const SelectBase = ({
|
|
291
|
+
export const SelectBase = ({
|
|
268
292
|
'aria-labelledby': ariaLabelledBy,
|
|
269
293
|
'aria-required': ariaRequired,
|
|
270
294
|
as,
|
|
@@ -284,6 +308,7 @@ const SelectBase = ({
|
|
|
284
308
|
onOptionSelection,
|
|
285
309
|
options,
|
|
286
310
|
renderOption = defaultRenderOption,
|
|
311
|
+
renderSelected = defaultRenderSelected,
|
|
287
312
|
required,
|
|
288
313
|
shouldMenuAutoFlip = true,
|
|
289
314
|
shouldMenuAutoFocus = true,
|
|
@@ -393,7 +418,6 @@ const SelectBase = ({
|
|
|
393
418
|
// Do a bit of error-checking in case options weren't provided
|
|
394
419
|
const hasOptions = options.length > 0;
|
|
395
420
|
const selectedOption = hasOptions ? options[getCorrectedIndexByValue(options, value)] : null;
|
|
396
|
-
const selectedOptionLabel = selectedOption ? selectedOption.label : '';
|
|
397
421
|
const selectedOptionValue = selectedOption ? selectedOption.value : '';
|
|
398
422
|
|
|
399
423
|
return (
|
|
@@ -419,7 +443,7 @@ const SelectBase = ({
|
|
|
419
443
|
value={selectedOptionValue}
|
|
420
444
|
{...elemProps}
|
|
421
445
|
>
|
|
422
|
-
{
|
|
446
|
+
{!!selectedOption && renderSelected(selectedOption)}
|
|
423
447
|
</SelectButton>
|
|
424
448
|
<SelectInput onChange={onChange} ref={inputRef} type="text" value={selectedOptionValue} />
|
|
425
449
|
{hasOptions && menuVisibility !== 'closed' && (
|
|
@@ -451,5 +475,3 @@ const SelectBase = ({
|
|
|
451
475
|
</SelectWrapper>
|
|
452
476
|
);
|
|
453
477
|
};
|
|
454
|
-
|
|
455
|
-
export default SelectBase;
|
|
@@ -223,7 +223,7 @@ const generatePopperOptions = (
|
|
|
223
223
|
};
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
const SelectMenu = ({
|
|
226
|
+
export const SelectMenu = ({
|
|
227
227
|
buttonRef,
|
|
228
228
|
children,
|
|
229
229
|
error,
|
|
@@ -294,5 +294,3 @@ const SelectMenu = ({
|
|
|
294
294
|
</Popper>
|
|
295
295
|
);
|
|
296
296
|
};
|
|
297
|
-
|
|
298
|
-
export default SelectMenu;
|
|
@@ -105,7 +105,7 @@ const Option = styled('li')<SelectOptionProps>(
|
|
|
105
105
|
})
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
const SelectOption = ({
|
|
108
|
+
export const SelectOption = ({
|
|
109
109
|
children,
|
|
110
110
|
focused = false,
|
|
111
111
|
interactive = true,
|
|
@@ -126,5 +126,3 @@ const SelectOption = ({
|
|
|
126
126
|
</Option>
|
|
127
127
|
);
|
|
128
128
|
};
|
|
129
|
-
|
|
130
|
-
export default SelectOption;
|
package/select/package.json
CHANGED
package/side-panel/index.ts
CHANGED
|
@@ -110,7 +110,7 @@ export const SidePanelContext = React.createContext({
|
|
|
110
110
|
origin: 'left',
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
const SidePanel = ({
|
|
113
|
+
export const SidePanel = ({
|
|
114
114
|
as = 'section',
|
|
115
115
|
children,
|
|
116
116
|
collapsedWidth = 64,
|
|
@@ -267,4 +267,3 @@ const ToggleButton = ({
|
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
SidePanel.ToggleButton = ToggleButton;
|
|
270
|
-
export default SidePanel;
|
package/side-panel/package.json
CHANGED