@workday/canvas-kit-labs-react 13.0.0-alpha.998-next.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/lib/Status.tsx +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.js +33 -34
- package/dist/commonjs/combobox/lib/Combobox.d.ts +1 -1
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +2 -8
- package/dist/commonjs/combobox/lib/Status.d.ts +1 -2
- package/dist/commonjs/combobox/lib/Status.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Status.js +3 -25
- package/dist/commonjs/index.d.ts +0 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +2 -9
- package/dist/es6/combobox/lib/AutocompleteList.d.ts +1 -1
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/AutocompleteList.js +33 -34
- package/dist/es6/combobox/lib/Combobox.d.ts +1 -1
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +2 -8
- package/dist/es6/combobox/lib/Status.d.ts +1 -2
- package/dist/es6/combobox/lib/Status.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Status.js +3 -2
- package/dist/es6/index.d.ts +0 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -1
- package/dist/es6/search-form/lib/SearchForm.d.ts +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +2 -9
- package/index.ts +0 -1
- package/package.json +6 -6
- package/dist/commonjs/expandable/index.d.ts +0 -3
- package/dist/commonjs/expandable/index.d.ts.map +0 -1
- package/dist/commonjs/expandable/index.js +0 -18
- package/dist/commonjs/expandable/lib/Expandable.d.ts +0 -108
- package/dist/commonjs/expandable/lib/Expandable.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/Expandable.js +0 -59
- package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts +0 -5
- package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/ExpandableAvatar.js +0 -21
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +0 -21
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/ExpandableContent.js +0 -18
- package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts +0 -29
- package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/ExpandableIcon.js +0 -35
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +0 -33
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/ExpandableTarget.js +0 -32
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +0 -11
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/ExpandableTitle.js +0 -16
- package/dist/commonjs/expandable/lib/hooks/index.d.ts +0 -5
- package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/hooks/index.js +0 -20
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +0 -18
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +0 -11
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +0 -13
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +0 -10
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.d.ts +0 -53
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.js +0 -22
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +0 -15
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +0 -1
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +0 -19
- package/dist/es6/expandable/index.d.ts +0 -3
- package/dist/es6/expandable/index.d.ts.map +0 -1
- package/dist/es6/expandable/index.js +0 -2
- package/dist/es6/expandable/lib/Expandable.d.ts +0 -108
- package/dist/es6/expandable/lib/Expandable.d.ts.map +0 -1
- package/dist/es6/expandable/lib/Expandable.js +0 -53
- package/dist/es6/expandable/lib/ExpandableAvatar.d.ts +0 -5
- package/dist/es6/expandable/lib/ExpandableAvatar.d.ts.map +0 -1
- package/dist/es6/expandable/lib/ExpandableAvatar.js +0 -15
- package/dist/es6/expandable/lib/ExpandableContent.d.ts +0 -21
- package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +0 -1
- package/dist/es6/expandable/lib/ExpandableContent.js +0 -12
- package/dist/es6/expandable/lib/ExpandableIcon.d.ts +0 -29
- package/dist/es6/expandable/lib/ExpandableIcon.d.ts.map +0 -1
- package/dist/es6/expandable/lib/ExpandableIcon.js +0 -29
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts +0 -33
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +0 -1
- package/dist/es6/expandable/lib/ExpandableTarget.js +0 -26
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts +0 -11
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +0 -1
- package/dist/es6/expandable/lib/ExpandableTitle.js +0 -10
- package/dist/es6/expandable/lib/hooks/index.d.ts +0 -5
- package/dist/es6/expandable/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/expandable/lib/hooks/index.js +0 -4
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +0 -18
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +0 -1
- package/dist/es6/expandable/lib/hooks/useExpandableContent.js +0 -8
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +0 -13
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +0 -1
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +0 -7
- package/dist/es6/expandable/lib/hooks/useExpandableModel.d.ts +0 -53
- package/dist/es6/expandable/lib/hooks/useExpandableModel.d.ts.map +0 -1
- package/dist/es6/expandable/lib/hooks/useExpandableModel.js +0 -19
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +0 -15
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +0 -1
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +0 -16
- package/expandable/index.ts +0 -2
- package/expandable/lib/Expandable.tsx +0 -68
- package/expandable/lib/ExpandableAvatar.tsx +0 -32
- package/expandable/lib/ExpandableContent.tsx +0 -32
- package/expandable/lib/ExpandableIcon.tsx +0 -80
- package/expandable/lib/ExpandableTarget.tsx +0 -67
- package/expandable/lib/ExpandableTitle.tsx +0 -32
- package/expandable/lib/hooks/index.ts +0 -4
- package/expandable/lib/hooks/useExpandableContent.ts +0 -9
- package/expandable/lib/hooks/useExpandableIcon.ts +0 -8
- package/expandable/lib/hooks/useExpandableModel.tsx +0 -20
- package/expandable/lib/hooks/useExpandableTarget.ts +0 -16
- package/expandable/package.json +0 -6
package/combobox/lib/Status.tsx
CHANGED
|
@@ -26,6 +26,6 @@ interface AutocompleteListProps {
|
|
|
26
26
|
*/
|
|
27
27
|
showGroupText: boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) =>
|
|
29
|
+
export declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=AutocompleteList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,mDAiFvB,CAAC"}
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.AutocompleteList = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
31
|
const react_1 = __importStar(require("react"));
|
|
31
32
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
32
33
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
@@ -50,50 +51,48 @@ const AutocompleteList = ({ autocompleteItems, comboboxId, selectedIndex, handle
|
|
|
50
51
|
};
|
|
51
52
|
const createListItem = (listboxItem, itemIndex, groupMessage) => {
|
|
52
53
|
const children = [
|
|
53
|
-
|
|
54
|
+
(0, jsx_runtime_1.jsx)(AccessibleHide, { children: groupMessage }, `group-message-${itemIndex}`),
|
|
54
55
|
...react_1.default.Children.toArray(listboxItem.props.children),
|
|
55
56
|
];
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: react_1.default.cloneElement(listboxItem, {
|
|
58
|
+
children: children,
|
|
59
|
+
id: (0, Combobox_1.getOptionId)(componentId, itemIndex),
|
|
60
|
+
role: 'option',
|
|
61
|
+
isFocused: selectedIndex === itemIndex,
|
|
62
|
+
'aria-selected': selectedIndex === itemIndex ? true : undefined,
|
|
63
|
+
onMouseDown: (event) => {
|
|
64
|
+
// prevent focus from shifting away from the the combobox
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
},
|
|
67
|
+
onClick: (event) => {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
handleAutocompleteClick(event, listboxItem.props);
|
|
70
|
+
},
|
|
71
|
+
}) }, itemIndex));
|
|
71
72
|
};
|
|
72
73
|
if (!autocompleteItems.length) {
|
|
73
74
|
return null;
|
|
74
75
|
}
|
|
75
76
|
else if (autocompleteItems[0].hasOwnProperty('header')) {
|
|
76
77
|
let itemIndex = 0;
|
|
77
|
-
return (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
})));
|
|
93
|
-
})));
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(Autocomplete, { ...listBoxProps, children: autocompleteItems.map(({ header, items }, groupIndex) => {
|
|
79
|
+
const groupLabel = `itemGroup-${componentId}-${groupIndex}`;
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [react_1.default.cloneElement(header, {
|
|
81
|
+
role: 'presentation',
|
|
82
|
+
style: { pointerEvents: `none` },
|
|
83
|
+
}), items.map((listboxItem) => {
|
|
84
|
+
const headerName = (0, Combobox_1.getTextFromElement)(header);
|
|
85
|
+
const groupMessage = showGroupText
|
|
86
|
+
? `Entering group ${headerName}, with ${items.length} options.`
|
|
87
|
+
: undefined;
|
|
88
|
+
const item = createListItem(listboxItem, itemIndex, groupMessage);
|
|
89
|
+
itemIndex++;
|
|
90
|
+
return item;
|
|
91
|
+
})] }, groupLabel));
|
|
92
|
+
}) }));
|
|
94
93
|
}
|
|
95
94
|
else {
|
|
96
|
-
return (
|
|
95
|
+
return ((0, jsx_runtime_1.jsx)(Autocomplete, { ...listBoxProps, children: autocompleteItems.map((listboxItem, index) => createListItem(listboxItem, index)) }));
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
exports.AutocompleteList = AutocompleteList;
|
|
@@ -57,5 +57,5 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
|
|
|
57
57
|
export declare const listBoxIdPart = "listbox";
|
|
58
58
|
export declare const getOptionId: (baseId?: string, index?: number) => string;
|
|
59
59
|
export declare const getTextFromElement: (children?: React.ReactNode) => string;
|
|
60
|
-
export declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) =>
|
|
60
|
+
export declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAKpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAEhC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CAClC;AAED,MAAM,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kB,cAAe,MAAM,SAAS,WAc5D,CAAC;AAYF,eAAO,MAAM,QAAQ,wLAelB,aAAa,4CAsTf,CAAC"}
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Combobox = exports.getTextFromElement = exports.getOptionId = exports.listBoxIdPart = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
31
|
const react_1 = __importStar(require("react"));
|
|
31
32
|
const react_2 = require("@emotion/react");
|
|
32
33
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
@@ -334,13 +335,6 @@ const Combobox = ({ autocompleteItems, children, grow, initialValue, onChange, o
|
|
|
334
335
|
});
|
|
335
336
|
return cloneElement(inputElement, { ...inputElement.props, ...newTextInputProps });
|
|
336
337
|
};
|
|
337
|
-
return (
|
|
338
|
-
react_1.default.createElement(InputContainer, { ref: comboboxRef },
|
|
339
|
-
isValidSingleChild(children) && react_1.default.Children.map(children, renderChildren),
|
|
340
|
-
showClearButton && (react_1.default.createElement(ResetButton, { shouldShow: !!value, "aria-label": clearButtonAriaLabel, icon: canvas_system_icons_web_1.xSmallIcon, variant: clearButtonVariant, onClick: resetSearchInput, onBlur: handleBlur, size: "small", type: "button" })),
|
|
341
|
-
showingAutocomplete && autocompleteItems && (react_1.default.createElement(MenuContainer, { padding: tokens_1.space.zero, depth: 3 },
|
|
342
|
-
react_1.default.createElement(card_1.Card.Body, null,
|
|
343
|
-
react_1.default.createElement(AutocompleteList_1.AutocompleteList, { comboboxId: componentId, autocompleteItems: autocompleteItems, selectedIndex: selectedAutocompleteIndex, handleAutocompleteClick: handleAutocompleteClick, labelId: formLabelId, showGroupText: showGroupText }))))),
|
|
344
|
-
react_1.default.createElement(Status_1.Status, { announcementText: announcementText })));
|
|
338
|
+
return ((0, jsx_runtime_1.jsxs)(Container, { grow: grow, ...elemProps, children: [(0, jsx_runtime_1.jsxs)(InputContainer, { ref: comboboxRef, children: [isValidSingleChild(children) && react_1.default.Children.map(children, renderChildren), showClearButton && ((0, jsx_runtime_1.jsx)(ResetButton, { shouldShow: !!value, "aria-label": clearButtonAriaLabel, icon: canvas_system_icons_web_1.xSmallIcon, variant: clearButtonVariant, onClick: resetSearchInput, onBlur: handleBlur, size: "small", type: "button" })), showingAutocomplete && autocompleteItems && ((0, jsx_runtime_1.jsx)(MenuContainer, { padding: tokens_1.space.zero, depth: 3, children: (0, jsx_runtime_1.jsx)(card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(AutocompleteList_1.AutocompleteList, { comboboxId: componentId, autocompleteItems: autocompleteItems, selectedIndex: selectedAutocompleteIndex, handleAutocompleteClick: handleAutocompleteClick, labelId: formLabelId, showGroupText: showGroupText }) }) }))] }), (0, jsx_runtime_1.jsx)(Status_1.Status, { announcementText: announcementText })] }));
|
|
345
339
|
};
|
|
346
340
|
exports.Combobox = Combobox;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export interface StatusProps {
|
|
3
2
|
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
4
3
|
role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';
|
|
@@ -7,5 +6,5 @@ export interface StatusProps {
|
|
|
7
6
|
expireMilliseconds?: number;
|
|
8
7
|
announcementText?: string;
|
|
9
8
|
}
|
|
10
|
-
export declare const Status: ({ ariaLive, role, ariaRelevant, expireMilliseconds, announcementText, ariaAtomic, }: StatusProps) =>
|
|
9
|
+
export declare const Status: ({ ariaLive, role, ariaRelevant, expireMilliseconds, announcementText, ariaAtomic, }: StatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Status.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Status.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC1C,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;IACxE,YAAY,CAAC,EAAE,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,eAAO,MAAM,MAAM,wFAOhB,WAAW,4CAuBb,CAAC"}
|
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Status = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
32
10
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
33
11
|
const Container = (0, styled_1.default)('div')(common_1.accessibleHide);
|
|
@@ -43,6 +21,6 @@ const Status = ({ ariaLive = 'polite', role = 'status', ariaRelevant = 'addition
|
|
|
43
21
|
clearTimeout(clearText);
|
|
44
22
|
};
|
|
45
23
|
}, [announcementText, expireMilliseconds]);
|
|
46
|
-
return (
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(Container, { "aria-live": ariaLive, role: role, "aria-relevant": ariaRelevant, "aria-atomic": ariaAtomic, children: displayText }));
|
|
47
25
|
};
|
|
48
26
|
exports.Status = Status;
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./combobox"), exports);
|
|
18
|
-
__exportStar(require("./expandable"), exports);
|
|
19
18
|
__exportStar(require("./search-form"), exports);
|
|
@@ -107,6 +107,6 @@ export declare class SearchForm extends React.Component<SearchFormProps, SearchF
|
|
|
107
107
|
handleFocus: () => void;
|
|
108
108
|
handleBlur: () => void;
|
|
109
109
|
handleSearchInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
110
|
-
render():
|
|
110
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
111
111
|
}
|
|
112
112
|
//# sourceMappingURL=SearchForm.d.ts.map
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.SearchForm = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
31
|
const React = __importStar(require("react"));
|
|
31
32
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
32
33
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
@@ -284,15 +285,7 @@ class SearchForm extends React.Component {
|
|
|
284
285
|
}
|
|
285
286
|
render() {
|
|
286
287
|
const { clearButtonAriaLabel = 'Reset Search Form', placeholder = 'Search', inputLabel = 'Search', submitAriaLabel = 'Search', openButtonAriaLabel = 'Open Search', closeButtonAriaLabel = 'Cancel', labelId = this.defaultLabelId, showClearButton = true, height = 40, grow, onSubmit, isCollapsed, onInputChange, autocompleteItems, initialValue, searchTheme, rightAlign, allowEmptyStringSearch = false, ...elemProps } = this.props;
|
|
287
|
-
return (
|
|
288
|
-
React.createElement(SearchContainer, { height: height },
|
|
289
|
-
React.createElement(SearchIcon, { "aria-label": submitAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }),
|
|
290
|
-
React.createElement(SearchIcon, { "aria-label": openButtonAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }),
|
|
291
|
-
React.createElement(SearchField, { grow: grow, id: labelId, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height },
|
|
292
|
-
React.createElement(form_field_1.FormField.Label, { cs: common_1.accessibleHideStyles }, inputLabel),
|
|
293
|
-
React.createElement(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: labelId },
|
|
294
|
-
React.createElement(form_field_1.FormField.Input, { as: SearchInput, ref: this.inputRef, cs: { maxWidth: grow ? '100%' : maxWidth }, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }))),
|
|
295
|
-
React.createElement(CloseButton, { "aria-label": closeButtonAriaLabel, icon: canvas_system_icons_web_1.xIcon, isCollapsed: isCollapsed, showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" }))));
|
|
288
|
+
return ((0, jsx_runtime_1.jsx)(StyledSearchForm, { role: "search", action: ".", rightAlign: rightAlign, grow: grow, "aria-labelledby": labelId, isCollapsed: isCollapsed, onSubmit: this.handleSubmit, showForm: this.state.showForm, ...elemProps, children: (0, jsx_runtime_1.jsxs)(SearchContainer, { height: height, children: [(0, jsx_runtime_1.jsx)(SearchIcon, { "aria-label": submitAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }), (0, jsx_runtime_1.jsx)(SearchIcon, { "aria-label": openButtonAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }), (0, jsx_runtime_1.jsxs)(SearchField, { grow: grow, id: labelId, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height, children: [(0, jsx_runtime_1.jsx)(form_field_1.FormField.Label, { cs: common_1.accessibleHideStyles, children: inputLabel }), (0, jsx_runtime_1.jsx)(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: labelId, children: (0, jsx_runtime_1.jsx)(form_field_1.FormField.Input, { as: SearchInput, ref: this.inputRef, cs: { maxWidth: grow ? '100%' : maxWidth }, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }) })] }), (0, jsx_runtime_1.jsx)(CloseButton, { "aria-label": closeButtonAriaLabel, icon: canvas_system_icons_web_1.xIcon, isCollapsed: isCollapsed, showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" })] }) }));
|
|
296
289
|
}
|
|
297
290
|
}
|
|
298
291
|
SearchForm.Theme = themes_1.SearchTheme;
|
|
@@ -26,6 +26,6 @@ interface AutocompleteListProps {
|
|
|
26
26
|
*/
|
|
27
27
|
showGroupText: boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) =>
|
|
29
|
+
export declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=AutocompleteList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,mDAiFvB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React, { Fragment, useState } from 'react';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
3
4
|
import { space } from '@workday/canvas-kit-react/tokens';
|
|
@@ -21,49 +22,47 @@ export const AutocompleteList = ({ autocompleteItems, comboboxId, selectedIndex,
|
|
|
21
22
|
};
|
|
22
23
|
const createListItem = (listboxItem, itemIndex, groupMessage) => {
|
|
23
24
|
const children = [
|
|
24
|
-
|
|
25
|
+
_jsx(AccessibleHide, { children: groupMessage }, `group-message-${itemIndex}`),
|
|
25
26
|
...React.Children.toArray(listboxItem.props.children),
|
|
26
27
|
];
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
return (_jsx(Fragment, { children: React.cloneElement(listboxItem, {
|
|
29
|
+
children: children,
|
|
30
|
+
id: getOptionId(componentId, itemIndex),
|
|
31
|
+
role: 'option',
|
|
32
|
+
isFocused: selectedIndex === itemIndex,
|
|
33
|
+
'aria-selected': selectedIndex === itemIndex ? true : undefined,
|
|
34
|
+
onMouseDown: (event) => {
|
|
35
|
+
// prevent focus from shifting away from the the combobox
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
},
|
|
38
|
+
onClick: (event) => {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
handleAutocompleteClick(event, listboxItem.props);
|
|
41
|
+
},
|
|
42
|
+
}) }, itemIndex));
|
|
42
43
|
};
|
|
43
44
|
if (!autocompleteItems.length) {
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
47
|
else if (autocompleteItems[0].hasOwnProperty('header')) {
|
|
47
48
|
let itemIndex = 0;
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})));
|
|
64
|
-
})));
|
|
49
|
+
return (_jsx(Autocomplete, { ...listBoxProps, children: autocompleteItems.map(({ header, items }, groupIndex) => {
|
|
50
|
+
const groupLabel = `itemGroup-${componentId}-${groupIndex}`;
|
|
51
|
+
return (_jsxs(Fragment, { children: [React.cloneElement(header, {
|
|
52
|
+
role: 'presentation',
|
|
53
|
+
style: { pointerEvents: `none` },
|
|
54
|
+
}), items.map((listboxItem) => {
|
|
55
|
+
const headerName = getTextFromElement(header);
|
|
56
|
+
const groupMessage = showGroupText
|
|
57
|
+
? `Entering group ${headerName}, with ${items.length} options.`
|
|
58
|
+
: undefined;
|
|
59
|
+
const item = createListItem(listboxItem, itemIndex, groupMessage);
|
|
60
|
+
itemIndex++;
|
|
61
|
+
return item;
|
|
62
|
+
})] }, groupLabel));
|
|
63
|
+
}) }));
|
|
65
64
|
}
|
|
66
65
|
else {
|
|
67
|
-
return (
|
|
66
|
+
return (_jsx(Autocomplete, { ...listBoxProps, children: autocompleteItems.map((listboxItem, index) => createListItem(listboxItem, index)) }));
|
|
68
67
|
}
|
|
69
68
|
};
|
|
@@ -57,5 +57,5 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
|
|
|
57
57
|
export declare const listBoxIdPart = "listbox";
|
|
58
58
|
export declare const getOptionId: (baseId?: string, index?: number) => string;
|
|
59
59
|
export declare const getTextFromElement: (children?: React.ReactNode) => string;
|
|
60
|
-
export declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) =>
|
|
60
|
+
export declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAKpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAEhC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK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AC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACxE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AA6DD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,eAAO,MAAM,WAAW,YAAa,MAAM,UAAU,MAAM,WACrB,CAAC;AAEvC,eAAO,MAAM,kBAAkB,cAAe,MAAM,SAAS,WAc5D,CAAC;AAYF,eAAO,MAAM,QAAQ,wLAelB,aAAa,4CAsTf,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React, { useEffect, useLayoutEffect, useRef, useState, useCallback } from 'react';
|
|
2
3
|
import { jsx, keyframes } from '@emotion/react';
|
|
3
4
|
import { useForkRef, styled, useIsRTL, useUniqueId, filterOutProps, } from '@workday/canvas-kit-react/common';
|
|
@@ -303,12 +304,5 @@ export const Combobox = ({ autocompleteItems, children, grow, initialValue, onCh
|
|
|
303
304
|
});
|
|
304
305
|
return cloneElement(inputElement, { ...inputElement.props, ...newTextInputProps });
|
|
305
306
|
};
|
|
306
|
-
return (
|
|
307
|
-
React.createElement(InputContainer, { ref: comboboxRef },
|
|
308
|
-
isValidSingleChild(children) && React.Children.map(children, renderChildren),
|
|
309
|
-
showClearButton && (React.createElement(ResetButton, { shouldShow: !!value, "aria-label": clearButtonAriaLabel, icon: xSmallIcon, variant: clearButtonVariant, onClick: resetSearchInput, onBlur: handleBlur, size: "small", type: "button" })),
|
|
310
|
-
showingAutocomplete && autocompleteItems && (React.createElement(MenuContainer, { padding: space.zero, depth: 3 },
|
|
311
|
-
React.createElement(Card.Body, null,
|
|
312
|
-
React.createElement(AutocompleteList, { comboboxId: componentId, autocompleteItems: autocompleteItems, selectedIndex: selectedAutocompleteIndex, handleAutocompleteClick: handleAutocompleteClick, labelId: formLabelId, showGroupText: showGroupText }))))),
|
|
313
|
-
React.createElement(Status, { announcementText: announcementText })));
|
|
307
|
+
return (_jsxs(Container, { grow: grow, ...elemProps, children: [_jsxs(InputContainer, { ref: comboboxRef, children: [isValidSingleChild(children) && React.Children.map(children, renderChildren), showClearButton && (_jsx(ResetButton, { shouldShow: !!value, "aria-label": clearButtonAriaLabel, icon: xSmallIcon, variant: clearButtonVariant, onClick: resetSearchInput, onBlur: handleBlur, size: "small", type: "button" })), showingAutocomplete && autocompleteItems && (_jsx(MenuContainer, { padding: space.zero, depth: 3, children: _jsx(Card.Body, { children: _jsx(AutocompleteList, { comboboxId: componentId, autocompleteItems: autocompleteItems, selectedIndex: selectedAutocompleteIndex, handleAutocompleteClick: handleAutocompleteClick, labelId: formLabelId, showGroupText: showGroupText }) }) }))] }), _jsx(Status, { announcementText: announcementText })] }));
|
|
314
308
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export interface StatusProps {
|
|
3
2
|
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
4
3
|
role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';
|
|
@@ -7,5 +6,5 @@ export interface StatusProps {
|
|
|
7
6
|
expireMilliseconds?: number;
|
|
8
7
|
announcementText?: string;
|
|
9
8
|
}
|
|
10
|
-
export declare const Status: ({ ariaLive, role, ariaRelevant, expireMilliseconds, announcementText, ariaAtomic, }: StatusProps) =>
|
|
9
|
+
export declare const Status: ({ ariaLive, role, ariaRelevant, expireMilliseconds, announcementText, ariaAtomic, }: StatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Status.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Status.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC1C,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;IACxE,YAAY,CAAC,EAAE,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,eAAO,MAAM,MAAM,wFAOhB,WAAW,4CAuBb,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
3
4
|
import { accessibleHide } from '@workday/canvas-kit-react/common';
|
|
4
5
|
const Container = styled('div')(accessibleHide);
|
|
@@ -14,5 +15,5 @@ export const Status = ({ ariaLive = 'polite', role = 'status', ariaRelevant = 'a
|
|
|
14
15
|
clearTimeout(clearText);
|
|
15
16
|
};
|
|
16
17
|
}, [announcementText, expireMilliseconds]);
|
|
17
|
-
return (
|
|
18
|
+
return (_jsx(Container, { "aria-live": ariaLive, role: role, "aria-relevant": ariaRelevant, "aria-atomic": ariaAtomic, children: displayText }));
|
|
18
19
|
};
|
package/dist/es6/index.d.ts
CHANGED
package/dist/es6/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
package/dist/es6/index.js
CHANGED
|
@@ -107,6 +107,6 @@ export declare class SearchForm extends React.Component<SearchFormProps, SearchF
|
|
|
107
107
|
handleFocus: () => void;
|
|
108
108
|
handleBlur: () => void;
|
|
109
109
|
handleSearchInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
110
|
-
render():
|
|
110
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
111
111
|
}
|
|
112
112
|
//# sourceMappingURL=SearchForm.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
3
4
|
import { styled, generateUniqueId, filterOutProps, accessibleHideStyles, } from '@workday/canvas-kit-react/common';
|
|
@@ -255,15 +256,7 @@ class SearchForm extends React.Component {
|
|
|
255
256
|
}
|
|
256
257
|
render() {
|
|
257
258
|
const { clearButtonAriaLabel = 'Reset Search Form', placeholder = 'Search', inputLabel = 'Search', submitAriaLabel = 'Search', openButtonAriaLabel = 'Open Search', closeButtonAriaLabel = 'Cancel', labelId = this.defaultLabelId, showClearButton = true, height = 40, grow, onSubmit, isCollapsed, onInputChange, autocompleteItems, initialValue, searchTheme, rightAlign, allowEmptyStringSearch = false, ...elemProps } = this.props;
|
|
258
|
-
return (
|
|
259
|
-
React.createElement(SearchContainer, { height: height },
|
|
260
|
-
React.createElement(SearchIcon, { "aria-label": submitAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }),
|
|
261
|
-
React.createElement(SearchIcon, { "aria-label": openButtonAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }),
|
|
262
|
-
React.createElement(SearchField, { grow: grow, id: labelId, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height },
|
|
263
|
-
React.createElement(FormField.Label, { cs: accessibleHideStyles }, inputLabel),
|
|
264
|
-
React.createElement(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: labelId },
|
|
265
|
-
React.createElement(FormField.Input, { as: SearchInput, ref: this.inputRef, cs: { maxWidth: grow ? '100%' : maxWidth }, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }))),
|
|
266
|
-
React.createElement(CloseButton, { "aria-label": closeButtonAriaLabel, icon: xIcon, isCollapsed: isCollapsed, showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" }))));
|
|
259
|
+
return (_jsx(StyledSearchForm, { role: "search", action: ".", rightAlign: rightAlign, grow: grow, "aria-labelledby": labelId, isCollapsed: isCollapsed, onSubmit: this.handleSubmit, showForm: this.state.showForm, ...elemProps, children: _jsxs(SearchContainer, { height: height, children: [_jsx(SearchIcon, { "aria-label": submitAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }), _jsx(SearchIcon, { "aria-label": openButtonAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }), _jsxs(SearchField, { grow: grow, id: labelId, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height, children: [_jsx(FormField.Label, { cs: accessibleHideStyles, children: inputLabel }), _jsx(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: labelId, children: _jsx(FormField.Input, { as: SearchInput, ref: this.inputRef, cs: { maxWidth: grow ? '100%' : maxWidth }, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }) })] }), _jsx(CloseButton, { "aria-label": closeButtonAriaLabel, icon: xIcon, isCollapsed: isCollapsed, showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" })] }) }));
|
|
267
260
|
}
|
|
268
261
|
}
|
|
269
262
|
SearchForm.Theme = SearchTheme;
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-labs-react",
|
|
3
|
-
"version": "13.0.0
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functionality. The Labs modules allow us to do that as needed.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"workday"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"react": ">=
|
|
44
|
+
"react": ">=17.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"@emotion/styled": "^11.6.0",
|
|
49
|
-
"@workday/canvas-kit-react": "^13.0.0
|
|
50
|
-
"@workday/canvas-kit-styling": "^13.0.0
|
|
49
|
+
"@workday/canvas-kit-react": "^13.0.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^13.0.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
|
-
"@workday/canvas-tokens-web": "^2.1.
|
|
52
|
+
"@workday/canvas-tokens-web": "^2.1.1",
|
|
53
53
|
"@workday/design-assets-types": "^0.2.8",
|
|
54
54
|
"chroma-js": "^2.2.0",
|
|
55
55
|
"lodash.flatten": "^4.4.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/lodash.flatten": "^4.4.6"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "3cb203410f3b0b8b912e6ec84a846d3108e4958f"
|
|
62
62
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../expandable/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./lib/Expandable"), exports);
|
|
18
|
-
__exportStar(require("./lib/hooks"), exports);
|