@workday/canvas-kit-labs-react 7.0.0-alpha.88-next.15 → 7.0.0-alpha.91-next.18
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/package.json +7 -16
- package/ts3.5/dist/commonjs/combobox/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/combobox/lib/AutocompleteList.d.ts +0 -32
- package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +0 -63
- package/ts3.5/dist/commonjs/combobox/lib/Status.d.ts +0 -11
- package/ts3.5/dist/commonjs/common/index.d.ts +0 -4
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/common/lib/theming/useThemeRTL.d.ts +0 -36
- package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/commonjs/drawer/index.d.ts +0 -6
- package/ts3.5/dist/commonjs/drawer/lib/Drawer.d.ts +0 -49
- package/ts3.5/dist/commonjs/drawer/lib/DrawerHeader.d.ts +0 -38
- package/ts3.5/dist/commonjs/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/search-form/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +0 -108
- package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +0 -21
- package/ts3.5/dist/es6/combobox/index.d.ts +0 -5
- package/ts3.5/dist/es6/combobox/lib/AutocompleteList.d.ts +0 -32
- package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +0 -63
- package/ts3.5/dist/es6/combobox/lib/Status.d.ts +0 -11
- package/ts3.5/dist/es6/common/index.d.ts +0 -4
- package/ts3.5/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/ts3.5/dist/es6/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/ts3.5/dist/es6/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/ts3.5/dist/es6/common/lib/theming/index.d.ts +0 -3
- package/ts3.5/dist/es6/common/lib/theming/useThemeRTL.d.ts +0 -36
- package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/es6/drawer/index.d.ts +0 -6
- package/ts3.5/dist/es6/drawer/lib/Drawer.d.ts +0 -49
- package/ts3.5/dist/es6/drawer/lib/DrawerHeader.d.ts +0 -38
- package/ts3.5/dist/es6/index.d.ts +0 -5
- package/ts3.5/dist/es6/search-form/index.d.ts +0 -3
- package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +0 -108
- package/ts3.5/dist/es6/search-form/lib/themes.d.ts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-labs-react",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.91-next.18+f92b7ba5",
|
|
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",
|
|
@@ -17,25 +17,16 @@
|
|
|
17
17
|
"*/lib/*",
|
|
18
18
|
"*/index.ts",
|
|
19
19
|
"dist/",
|
|
20
|
-
"index.ts"
|
|
21
|
-
"ts3.5/**/*"
|
|
20
|
+
"index.ts"
|
|
22
21
|
],
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"<=3.5": {
|
|
25
|
-
"*": [
|
|
26
|
-
"ts3.5/*"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
22
|
"scripts": {
|
|
31
23
|
"watch": "yarn build:es6 -w",
|
|
32
24
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
|
-
"clean": "rimraf dist && rimraf
|
|
25
|
+
"clean": "rimraf dist && rimraf .build-info && mkdirp dist",
|
|
34
26
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
35
27
|
"build:es6": "tsc -p tsconfig.es6.json",
|
|
36
28
|
"build:rebuild": "npm-run-all clean build",
|
|
37
|
-
"build
|
|
38
|
-
"build": "npm-run-all --parallel build:cjs build:es6 --sequential build:downlevel-dts",
|
|
29
|
+
"build": "npm-run-all --parallel build:cjs build:es6",
|
|
39
30
|
"prepack": "node ../../utils/publish.js pre labs-react",
|
|
40
31
|
"postpack": "node ../../utils/publish.js post labs-react",
|
|
41
32
|
"depcheck": "node ../../utils/check-dependencies-exist.js",
|
|
@@ -54,8 +45,8 @@
|
|
|
54
45
|
"dependencies": {
|
|
55
46
|
"@emotion/react": "^11.7.1",
|
|
56
47
|
"@emotion/styled": "^11.6.0",
|
|
57
|
-
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.
|
|
58
|
-
"@workday/canvas-kit-react": "^7.0.0-alpha.
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.91-next.18+f92b7ba5",
|
|
49
|
+
"@workday/canvas-kit-react": "^7.0.0-alpha.91-next.18+f92b7ba5",
|
|
59
50
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
60
51
|
"chroma-js": "^2.1.0",
|
|
61
52
|
"lodash.flatten": "^4.4.0",
|
|
@@ -64,5 +55,5 @@
|
|
|
64
55
|
"devDependencies": {
|
|
65
56
|
"@types/lodash.flatten": "^4.4.6"
|
|
66
57
|
},
|
|
67
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "f92b7ba590e19e7f55f7a6417d0d4b7ae3b1bba4"
|
|
68
59
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
3
|
-
import { ComboBoxMenuItemGroup } from './Combobox';
|
|
4
|
-
interface AutocompleteListProps {
|
|
5
|
-
/**
|
|
6
|
-
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
7
|
-
*/
|
|
8
|
-
autocompleteItems: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
|
|
9
|
-
/**
|
|
10
|
-
* Index of the active autocomplete item
|
|
11
|
-
*/
|
|
12
|
-
selectedIndex: number | null;
|
|
13
|
-
/**
|
|
14
|
-
* The function called when an autocomplete item is selected
|
|
15
|
-
*/
|
|
16
|
-
handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps: MenuItemProps) => void;
|
|
17
|
-
/**
|
|
18
|
-
* The id of the form field.
|
|
19
|
-
*/
|
|
20
|
-
labelId: string;
|
|
21
|
-
/**
|
|
22
|
-
* The id of the combobox.
|
|
23
|
-
*/
|
|
24
|
-
comboboxId: string;
|
|
25
|
-
/**
|
|
26
|
-
* True when group changes via keyboard control
|
|
27
|
-
*/
|
|
28
|
-
showGroupText: boolean;
|
|
29
|
-
}
|
|
30
|
-
declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) => JSX.Element | null;
|
|
31
|
-
export default AutocompleteList;
|
|
32
|
-
//# sourceMappingURL=AutocompleteList.d.ts.map
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
4
|
-
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
5
|
-
import { TextInputProps } from '@workday/canvas-kit-react/text-input';
|
|
6
|
-
export interface ComboBoxMenuItemGroup {
|
|
7
|
-
header: React.ReactElement<MenuItemProps>;
|
|
8
|
-
items: React.ReactElement<MenuItemProps>[];
|
|
9
|
-
}
|
|
10
|
-
export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
/**
|
|
12
|
-
* The TextInput child of the Combobox.
|
|
13
|
-
*/
|
|
14
|
-
children: React.ReactElement<TextInputProps>;
|
|
15
|
-
/**
|
|
16
|
-
* The initial value of the Combobox.
|
|
17
|
-
*/
|
|
18
|
-
initialValue?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The variant of the Combobox clear button. The default is a TertiaryButton
|
|
21
|
-
*/
|
|
22
|
-
clearButtonVariant?: TertiaryButtonProps['variant'];
|
|
23
|
-
/**
|
|
24
|
-
* If true, render the Combobox with a button to clear the text input.
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
showClearButton?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* The `aria-label` for the Combobox clear button.
|
|
30
|
-
* @default Reset Search Input
|
|
31
|
-
*/
|
|
32
|
-
clearButtonAriaLabel?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
35
|
-
*/
|
|
36
|
-
autocompleteItems?: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
|
|
37
|
-
/**
|
|
38
|
-
* The function called when the Combobox text input changes.
|
|
39
|
-
*/
|
|
40
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
41
|
-
/**
|
|
42
|
-
* The function called when the Combobox text input focuses.
|
|
43
|
-
*/
|
|
44
|
-
onFocus?: React.FocusEventHandler;
|
|
45
|
-
/**
|
|
46
|
-
* The function called when the Combobox text input blurs.
|
|
47
|
-
*/
|
|
48
|
-
onBlur?: React.FocusEventHandler;
|
|
49
|
-
/**
|
|
50
|
-
* The id of the form field.
|
|
51
|
-
*/
|
|
52
|
-
labelId?: string;
|
|
53
|
-
/**
|
|
54
|
-
* The text for screen readers announcing the autocomplete count
|
|
55
|
-
*/
|
|
56
|
-
getStatusText?: (listCount: number) => string;
|
|
57
|
-
}
|
|
58
|
-
export declare const listBoxIdPart = "listbox";
|
|
59
|
-
export declare const getOptionId: (baseId?: string | undefined, index?: number | undefined) => string;
|
|
60
|
-
export declare const getTextFromElement: (children?: React.ReactNode) => string;
|
|
61
|
-
declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) => JSX.Element;
|
|
62
|
-
export default Combobox;
|
|
63
|
-
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface StatusProps {
|
|
2
|
-
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
3
|
-
role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';
|
|
4
|
-
ariaRelevant?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
|
|
5
|
-
ariaAtomic?: boolean;
|
|
6
|
-
expireMilliseconds?: number;
|
|
7
|
-
announcementText?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const Status: ({ ariaLive, role, ariaAtomic, ariaRelevant, expireMilliseconds, announcementText, }: StatusProps) => JSX.Element;
|
|
10
|
-
export default Status;
|
|
11
|
-
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropCombination, Props } from './propTypes';
|
|
3
|
-
/**
|
|
4
|
-
* A helper to generate a table of all possible states for component visual testing.
|
|
5
|
-
*/
|
|
6
|
-
export interface ComponentStatesTableProps {
|
|
7
|
-
/**
|
|
8
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
9
|
-
* row label for that permutation. It is encouraged to use the result of permutateProps()
|
|
10
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
11
|
-
*/
|
|
12
|
-
rowProps: PropCombination[];
|
|
13
|
-
/**
|
|
14
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
15
|
-
* column label for that permutation. It is encouraged to use the result of permutateProps()
|
|
16
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
17
|
-
*/
|
|
18
|
-
columnProps: PropCombination[];
|
|
19
|
-
/**
|
|
20
|
-
* The render function called to render the component in each cell of the table. This gives you
|
|
21
|
-
* the ability to add extra styling or markup (a blue background for an inverse variant, for example).
|
|
22
|
-
*/
|
|
23
|
-
children(props: Props): React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare const ComponentStatesTable: ({ rowProps, columnProps, children, }: ComponentStatesTableProps) => JSX.Element;
|
|
26
|
-
//# sourceMappingURL=ComponentStatesTable.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PropCombination, PropDeclaration, Props, PropsDeclaration } from './propTypes';
|
|
2
|
-
export declare const permutateProps: (allProps: PropsDeclaration, filter?: ((props: Props) => boolean) | undefined, remainingProps?: string[], values?: {
|
|
3
|
-
[key: string]: PropDeclaration;
|
|
4
|
-
}) => PropCombination[];
|
|
5
|
-
//# sourceMappingURL=permutateProps.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type PropDeclaration = {
|
|
2
|
-
value: any;
|
|
3
|
-
label: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type PropsDeclaration = {
|
|
6
|
-
[key: string]: PropDeclaration[];
|
|
7
|
-
};
|
|
8
|
-
export declare type Props = {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
export declare type PropCombination = {
|
|
12
|
-
label: string;
|
|
13
|
-
props: Props;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
export declare type ComponentStyles = Record<string, CSSProperties>;
|
|
3
|
-
/**
|
|
4
|
-
* A helpful hook for supporting bidirectional styles.
|
|
5
|
-
* * Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).
|
|
6
|
-
*
|
|
7
|
-
* @returns
|
|
8
|
-
* * `themeRTL` - a function to transform bidirectional styles
|
|
9
|
-
* * `theme` - the Canvas theme object (optional, provided for convenience)
|
|
10
|
-
*
|
|
11
|
-
* `themeRTL` allows you to support bidirectionality with a single set of styles and pass them along to a component.
|
|
12
|
-
* It accepts CSS object styles and transforms CSS attributes based on the content direction set in the theme (LTR or RTL).
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* import { type } from '@workday/canvas-kit-react/tokens';
|
|
16
|
-
* import { useThemeRTL } from '@workday/canvas-kit-labs-react/common';
|
|
17
|
-
*
|
|
18
|
-
* const ErrorText: React.FC = (props) => {
|
|
19
|
-
* const { themeRTL, theme } = useThemeRTL();
|
|
20
|
-
* // `borderLeft` will be converted to `borderRight`
|
|
21
|
-
* // when the theme direction is `RTL`.
|
|
22
|
-
* // All other styles will remain unchanged.
|
|
23
|
-
* const errorTextStyles = themeRTL({
|
|
24
|
-
* ...type.levels.subtext.medium,
|
|
25
|
-
* color: theme.canvas.palette.error.main,
|
|
26
|
-
* borderLeft: `solid 2px ${theme.canvas.palette.error.main}`,
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* return <span css={errorTextStyles} {...props} />;
|
|
30
|
-
* }
|
|
31
|
-
*/
|
|
32
|
-
export declare function useThemeRTL(): {
|
|
33
|
-
themeRTL: (...cssObject: CSSProperties[]) => CSSProperties;
|
|
34
|
-
theme: import("@workday/canvas-kit-react/common").EmotionCanvasTheme;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=useThemeRTL.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
2
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
declare type paletteSelection = Exclude<keyof EmotionCanvasTheme['canvas']['palette'], 'common'>;
|
|
4
|
-
interface ContrastColors {
|
|
5
|
-
outer?: string;
|
|
6
|
-
inner?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function getPaletteColors(type: paletteSelection, theme: EmotionCanvasTheme): ContrastColors;
|
|
9
|
-
export declare const useThemedRing: (type: paletteSelection) => CSSProperties;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useThemedRing.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The padding of the Drawer contents.
|
|
6
|
-
* @default space.s
|
|
7
|
-
*/
|
|
8
|
-
padding?: CanvasSpaceValues;
|
|
9
|
-
/**
|
|
10
|
-
* The direction from which the Drawer opens. Accepts `Left` or `Right`.
|
|
11
|
-
* @default DrawerDirection.Right
|
|
12
|
-
*/
|
|
13
|
-
openDirection?: DrawerDirection;
|
|
14
|
-
/**
|
|
15
|
-
* The width of the Drawer in `px`.
|
|
16
|
-
* @default 360
|
|
17
|
-
*/
|
|
18
|
-
width?: number;
|
|
19
|
-
/**
|
|
20
|
-
* If true, render the Drawer with a drop shadow.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
showDropShadow?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
|
|
26
|
-
*/
|
|
27
|
-
header?: React.ReactElement;
|
|
28
|
-
/**
|
|
29
|
-
* The `aria-labelledby` of the Drawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
|
|
30
|
-
*/
|
|
31
|
-
'aria-labelledby'?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
|
|
34
|
-
*/
|
|
35
|
-
'aria-label'?: string;
|
|
36
|
-
/**
|
|
37
|
-
* The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
38
|
-
*/
|
|
39
|
-
role?: string;
|
|
40
|
-
}
|
|
41
|
-
export declare enum DrawerDirection {
|
|
42
|
-
Left = 0,
|
|
43
|
-
Right = 1
|
|
44
|
-
}
|
|
45
|
-
export default class Drawer extends React.Component<DrawerProps, {}> {
|
|
46
|
-
static OpenDirection: typeof DrawerDirection;
|
|
47
|
-
render(): JSX.Element;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
6
|
-
*/
|
|
7
|
-
title?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The function called when the DrawerHeader close button is clicked.
|
|
10
|
-
*/
|
|
11
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
-
/**
|
|
13
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
14
|
-
* @default Close
|
|
15
|
-
*/
|
|
16
|
-
closeIconAriaLabel?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The background color of the DrawerHeader.
|
|
19
|
-
*/
|
|
20
|
-
headerColor?: CanvasColor | string;
|
|
21
|
-
/**
|
|
22
|
-
* The border color of the DrawerHeader. This should match something close to `headerColor`.
|
|
23
|
-
*/
|
|
24
|
-
borderColor?: CanvasColor | string;
|
|
25
|
-
/**
|
|
26
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
inverse?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The unique id of the DrawerHeader for accessibility.
|
|
32
|
-
*/
|
|
33
|
-
id?: string;
|
|
34
|
-
}
|
|
35
|
-
export default class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
|
|
36
|
-
render(): JSX.Element;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=DrawerHeader.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
4
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
5
|
-
import { SearchTheme, SearchThemeAttributes } from './themes';
|
|
6
|
-
export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
|
|
7
|
-
/**
|
|
8
|
-
* The function called when the SearchForm form is submitted. The current input value is passed to the callback function.
|
|
9
|
-
*/
|
|
10
|
-
onSubmit: React.FormEventHandler<HTMLFormElement>;
|
|
11
|
-
/**
|
|
12
|
-
* If true, collapse the SearchForm text input into a toggle icon. Useful for responsive layouts.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
isCollapsed?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The function called when the SearchForm text input changes.
|
|
18
|
-
*/
|
|
19
|
-
onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
20
|
-
/**
|
|
21
|
-
* The autocomplete items of the SearchForm. This array of menu items is shown under the search bar.
|
|
22
|
-
*/
|
|
23
|
-
autocompleteItems?: React.ReactElement<MenuItemProps>[];
|
|
24
|
-
/**
|
|
25
|
-
* The theme of the header the search input is being rendered in.
|
|
26
|
-
*/
|
|
27
|
-
searchTheme?: SearchTheme | SearchThemeAttributes;
|
|
28
|
-
/**
|
|
29
|
-
* The placeholder text of the SearchForm text input.
|
|
30
|
-
* @default Search
|
|
31
|
-
*/
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The initial value of the SearchForm text input.
|
|
35
|
-
*/
|
|
36
|
-
initialValue?: string;
|
|
37
|
-
/**
|
|
38
|
-
* If true, right-align the SearchForm. If false, the text input should grow to left-align the SearchForm.
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
rightAlign?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The screenreader label text for the SearchForm text input.
|
|
44
|
-
* @default Search
|
|
45
|
-
*/
|
|
46
|
-
inputLabel?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The screenreader label text for the SearchForm submit button.
|
|
49
|
-
* @default Search
|
|
50
|
-
*/
|
|
51
|
-
submitAriaLabel?: string;
|
|
52
|
-
/**
|
|
53
|
-
* The screenreader label text for the SearchForm clear button.
|
|
54
|
-
* @default Reset Search Form
|
|
55
|
-
*/
|
|
56
|
-
clearButtonAriaLabel?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The screenreader label text for the button to open the collapsed SearchForm.
|
|
59
|
-
* @default Open Search
|
|
60
|
-
*/
|
|
61
|
-
openButtonAriaLabel?: string;
|
|
62
|
-
/**
|
|
63
|
-
* The screenreader label text for the button to close the open SearchForm.
|
|
64
|
-
* @default Cancel
|
|
65
|
-
*/
|
|
66
|
-
closeButtonAriaLabel?: string;
|
|
67
|
-
/**
|
|
68
|
-
* If true, render the SearchForm with a button to clear the text input.
|
|
69
|
-
* @default true
|
|
70
|
-
*/
|
|
71
|
-
showClearButton?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Height of the Search Form in pixels
|
|
74
|
-
* @default 40
|
|
75
|
-
*/
|
|
76
|
-
height?: number;
|
|
77
|
-
/**
|
|
78
|
-
* If true, allow onSubmit being called when input value is empty.
|
|
79
|
-
* @default false
|
|
80
|
-
*/
|
|
81
|
-
allowEmptyStringSearch?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface SearchFormState {
|
|
84
|
-
showForm: boolean;
|
|
85
|
-
searchQuery: string;
|
|
86
|
-
isFocused: boolean;
|
|
87
|
-
}
|
|
88
|
-
export declare class SearchForm extends React.Component<SearchFormProps, SearchFormState> {
|
|
89
|
-
static Theme: typeof SearchTheme;
|
|
90
|
-
private inputRef;
|
|
91
|
-
private openRef;
|
|
92
|
-
private labelId;
|
|
93
|
-
state: Readonly<SearchFormState>;
|
|
94
|
-
private getTheme;
|
|
95
|
-
private getThemeColors;
|
|
96
|
-
getIconButtonType: () => TertiaryButtonProps['variant'];
|
|
97
|
-
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
98
|
-
openCollapsedSearch: () => void;
|
|
99
|
-
closeCollapsedSearch: () => void;
|
|
100
|
-
componentDidUpdate(prevProps: SearchFormProps, prevState: SearchFormState): void;
|
|
101
|
-
focusInput: () => void;
|
|
102
|
-
focusOpen: () => void;
|
|
103
|
-
handleFocus: () => void;
|
|
104
|
-
handleBlur: () => void;
|
|
105
|
-
handleSearchInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
106
|
-
render(): JSX.Element;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=SearchForm.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare enum SearchTheme {
|
|
2
|
-
Light = 0,
|
|
3
|
-
Dark = 1,
|
|
4
|
-
Transparent = 2
|
|
5
|
-
}
|
|
6
|
-
export interface SearchThemeAttributes {
|
|
7
|
-
background?: string;
|
|
8
|
-
backgroundFocus?: string;
|
|
9
|
-
backgroundHover?: string;
|
|
10
|
-
color?: string;
|
|
11
|
-
colorFocus?: string;
|
|
12
|
-
placeholderColor?: string;
|
|
13
|
-
placeholderColorFocus?: string;
|
|
14
|
-
boxShadow?: string | string[];
|
|
15
|
-
boxShadowFocus?: string | string[];
|
|
16
|
-
}
|
|
17
|
-
export interface SearchThemes {
|
|
18
|
-
[key: string]: SearchThemeAttributes;
|
|
19
|
-
}
|
|
20
|
-
export declare const searchThemes: SearchThemes;
|
|
21
|
-
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
3
|
-
import { ComboBoxMenuItemGroup } from './Combobox';
|
|
4
|
-
interface AutocompleteListProps {
|
|
5
|
-
/**
|
|
6
|
-
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
7
|
-
*/
|
|
8
|
-
autocompleteItems: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
|
|
9
|
-
/**
|
|
10
|
-
* Index of the active autocomplete item
|
|
11
|
-
*/
|
|
12
|
-
selectedIndex: number | null;
|
|
13
|
-
/**
|
|
14
|
-
* The function called when an autocomplete item is selected
|
|
15
|
-
*/
|
|
16
|
-
handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps: MenuItemProps) => void;
|
|
17
|
-
/**
|
|
18
|
-
* The id of the form field.
|
|
19
|
-
*/
|
|
20
|
-
labelId: string;
|
|
21
|
-
/**
|
|
22
|
-
* The id of the combobox.
|
|
23
|
-
*/
|
|
24
|
-
comboboxId: string;
|
|
25
|
-
/**
|
|
26
|
-
* True when group changes via keyboard control
|
|
27
|
-
*/
|
|
28
|
-
showGroupText: boolean;
|
|
29
|
-
}
|
|
30
|
-
declare const AutocompleteList: ({ autocompleteItems, comboboxId, selectedIndex, handleAutocompleteClick, labelId, showGroupText, }: AutocompleteListProps) => JSX.Element | null;
|
|
31
|
-
export default AutocompleteList;
|
|
32
|
-
//# sourceMappingURL=AutocompleteList.d.ts.map
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
4
|
-
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
5
|
-
import { TextInputProps } from '@workday/canvas-kit-react/text-input';
|
|
6
|
-
export interface ComboBoxMenuItemGroup {
|
|
7
|
-
header: React.ReactElement<MenuItemProps>;
|
|
8
|
-
items: React.ReactElement<MenuItemProps>[];
|
|
9
|
-
}
|
|
10
|
-
export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
/**
|
|
12
|
-
* The TextInput child of the Combobox.
|
|
13
|
-
*/
|
|
14
|
-
children: React.ReactElement<TextInputProps>;
|
|
15
|
-
/**
|
|
16
|
-
* The initial value of the Combobox.
|
|
17
|
-
*/
|
|
18
|
-
initialValue?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The variant of the Combobox clear button. The default is a TertiaryButton
|
|
21
|
-
*/
|
|
22
|
-
clearButtonVariant?: TertiaryButtonProps['variant'];
|
|
23
|
-
/**
|
|
24
|
-
* If true, render the Combobox with a button to clear the text input.
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
showClearButton?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* The `aria-label` for the Combobox clear button.
|
|
30
|
-
* @default Reset Search Input
|
|
31
|
-
*/
|
|
32
|
-
clearButtonAriaLabel?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
35
|
-
*/
|
|
36
|
-
autocompleteItems?: React.ReactElement<MenuItemProps>[] | ComboBoxMenuItemGroup[];
|
|
37
|
-
/**
|
|
38
|
-
* The function called when the Combobox text input changes.
|
|
39
|
-
*/
|
|
40
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
41
|
-
/**
|
|
42
|
-
* The function called when the Combobox text input focuses.
|
|
43
|
-
*/
|
|
44
|
-
onFocus?: React.FocusEventHandler;
|
|
45
|
-
/**
|
|
46
|
-
* The function called when the Combobox text input blurs.
|
|
47
|
-
*/
|
|
48
|
-
onBlur?: React.FocusEventHandler;
|
|
49
|
-
/**
|
|
50
|
-
* The id of the form field.
|
|
51
|
-
*/
|
|
52
|
-
labelId?: string;
|
|
53
|
-
/**
|
|
54
|
-
* The text for screen readers announcing the autocomplete count
|
|
55
|
-
*/
|
|
56
|
-
getStatusText?: (listCount: number) => string;
|
|
57
|
-
}
|
|
58
|
-
export declare const listBoxIdPart = "listbox";
|
|
59
|
-
export declare const getOptionId: (baseId?: string | undefined, index?: number | undefined) => string;
|
|
60
|
-
export declare const getTextFromElement: (children?: React.ReactNode) => string;
|
|
61
|
-
declare const Combobox: ({ autocompleteItems, children, grow, initialValue, onChange, onFocus, onBlur, showClearButton, clearButtonVariant, clearButtonAriaLabel, labelId, getStatusText, id, ...elemProps }: ComboboxProps) => JSX.Element;
|
|
62
|
-
export default Combobox;
|
|
63
|
-
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface StatusProps {
|
|
2
|
-
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
3
|
-
role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';
|
|
4
|
-
ariaRelevant?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
|
|
5
|
-
ariaAtomic?: boolean;
|
|
6
|
-
expireMilliseconds?: number;
|
|
7
|
-
announcementText?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const Status: ({ ariaLive, role, ariaAtomic, ariaRelevant, expireMilliseconds, announcementText, }: StatusProps) => JSX.Element;
|
|
10
|
-
export default Status;
|
|
11
|
-
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropCombination, Props } from './propTypes';
|
|
3
|
-
/**
|
|
4
|
-
* A helper to generate a table of all possible states for component visual testing.
|
|
5
|
-
*/
|
|
6
|
-
export interface ComponentStatesTableProps {
|
|
7
|
-
/**
|
|
8
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
9
|
-
* row label for that permutation. It is encouraged to use the result of permutateProps()
|
|
10
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
11
|
-
*/
|
|
12
|
-
rowProps: PropCombination[];
|
|
13
|
-
/**
|
|
14
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
15
|
-
* column label for that permutation. It is encouraged to use the result of permutateProps()
|
|
16
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
17
|
-
*/
|
|
18
|
-
columnProps: PropCombination[];
|
|
19
|
-
/**
|
|
20
|
-
* The render function called to render the component in each cell of the table. This gives you
|
|
21
|
-
* the ability to add extra styling or markup (a blue background for an inverse variant, for example).
|
|
22
|
-
*/
|
|
23
|
-
children(props: Props): React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare const ComponentStatesTable: ({ rowProps, columnProps, children, }: ComponentStatesTableProps) => JSX.Element;
|
|
26
|
-
//# sourceMappingURL=ComponentStatesTable.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PropCombination, PropDeclaration, Props, PropsDeclaration } from './propTypes';
|
|
2
|
-
export declare const permutateProps: (allProps: PropsDeclaration, filter?: ((props: Props) => boolean) | undefined, remainingProps?: string[], values?: {
|
|
3
|
-
[key: string]: PropDeclaration;
|
|
4
|
-
}) => PropCombination[];
|
|
5
|
-
//# sourceMappingURL=permutateProps.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type PropDeclaration = {
|
|
2
|
-
value: any;
|
|
3
|
-
label: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type PropsDeclaration = {
|
|
6
|
-
[key: string]: PropDeclaration[];
|
|
7
|
-
};
|
|
8
|
-
export declare type Props = {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
export declare type PropCombination = {
|
|
12
|
-
label: string;
|
|
13
|
-
props: Props;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
export declare type ComponentStyles = Record<string, CSSProperties>;
|
|
3
|
-
/**
|
|
4
|
-
* A helpful hook for supporting bidirectional styles.
|
|
5
|
-
* * Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).
|
|
6
|
-
*
|
|
7
|
-
* @returns
|
|
8
|
-
* * `themeRTL` - a function to transform bidirectional styles
|
|
9
|
-
* * `theme` - the Canvas theme object (optional, provided for convenience)
|
|
10
|
-
*
|
|
11
|
-
* `themeRTL` allows you to support bidirectionality with a single set of styles and pass them along to a component.
|
|
12
|
-
* It accepts CSS object styles and transforms CSS attributes based on the content direction set in the theme (LTR or RTL).
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* import { type } from '@workday/canvas-kit-react/tokens';
|
|
16
|
-
* import { useThemeRTL } from '@workday/canvas-kit-labs-react/common';
|
|
17
|
-
*
|
|
18
|
-
* const ErrorText: React.FC = (props) => {
|
|
19
|
-
* const { themeRTL, theme } = useThemeRTL();
|
|
20
|
-
* // `borderLeft` will be converted to `borderRight`
|
|
21
|
-
* // when the theme direction is `RTL`.
|
|
22
|
-
* // All other styles will remain unchanged.
|
|
23
|
-
* const errorTextStyles = themeRTL({
|
|
24
|
-
* ...type.levels.subtext.medium,
|
|
25
|
-
* color: theme.canvas.palette.error.main,
|
|
26
|
-
* borderLeft: `solid 2px ${theme.canvas.palette.error.main}`,
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* return <span css={errorTextStyles} {...props} />;
|
|
30
|
-
* }
|
|
31
|
-
*/
|
|
32
|
-
export declare function useThemeRTL(): {
|
|
33
|
-
themeRTL: (...cssObject: CSSProperties[]) => CSSProperties;
|
|
34
|
-
theme: import("@workday/canvas-kit-react/common").EmotionCanvasTheme;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=useThemeRTL.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
2
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
declare type paletteSelection = Exclude<keyof EmotionCanvasTheme['canvas']['palette'], 'common'>;
|
|
4
|
-
interface ContrastColors {
|
|
5
|
-
outer?: string;
|
|
6
|
-
inner?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function getPaletteColors(type: paletteSelection, theme: EmotionCanvasTheme): ContrastColors;
|
|
9
|
-
export declare const useThemedRing: (type: paletteSelection) => CSSProperties;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useThemedRing.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The padding of the Drawer contents.
|
|
6
|
-
* @default space.s
|
|
7
|
-
*/
|
|
8
|
-
padding?: CanvasSpaceValues;
|
|
9
|
-
/**
|
|
10
|
-
* The direction from which the Drawer opens. Accepts `Left` or `Right`.
|
|
11
|
-
* @default DrawerDirection.Right
|
|
12
|
-
*/
|
|
13
|
-
openDirection?: DrawerDirection;
|
|
14
|
-
/**
|
|
15
|
-
* The width of the Drawer in `px`.
|
|
16
|
-
* @default 360
|
|
17
|
-
*/
|
|
18
|
-
width?: number;
|
|
19
|
-
/**
|
|
20
|
-
* If true, render the Drawer with a drop shadow.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
showDropShadow?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
|
|
26
|
-
*/
|
|
27
|
-
header?: React.ReactElement;
|
|
28
|
-
/**
|
|
29
|
-
* The `aria-labelledby` of the Drawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
|
|
30
|
-
*/
|
|
31
|
-
'aria-labelledby'?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
|
|
34
|
-
*/
|
|
35
|
-
'aria-label'?: string;
|
|
36
|
-
/**
|
|
37
|
-
* The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
38
|
-
*/
|
|
39
|
-
role?: string;
|
|
40
|
-
}
|
|
41
|
-
export declare enum DrawerDirection {
|
|
42
|
-
Left = 0,
|
|
43
|
-
Right = 1
|
|
44
|
-
}
|
|
45
|
-
export default class Drawer extends React.Component<DrawerProps, {}> {
|
|
46
|
-
static OpenDirection: typeof DrawerDirection;
|
|
47
|
-
render(): JSX.Element;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
6
|
-
*/
|
|
7
|
-
title?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The function called when the DrawerHeader close button is clicked.
|
|
10
|
-
*/
|
|
11
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
-
/**
|
|
13
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
14
|
-
* @default Close
|
|
15
|
-
*/
|
|
16
|
-
closeIconAriaLabel?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The background color of the DrawerHeader.
|
|
19
|
-
*/
|
|
20
|
-
headerColor?: CanvasColor | string;
|
|
21
|
-
/**
|
|
22
|
-
* The border color of the DrawerHeader. This should match something close to `headerColor`.
|
|
23
|
-
*/
|
|
24
|
-
borderColor?: CanvasColor | string;
|
|
25
|
-
/**
|
|
26
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
inverse?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The unique id of the DrawerHeader for accessibility.
|
|
32
|
-
*/
|
|
33
|
-
id?: string;
|
|
34
|
-
}
|
|
35
|
-
export default class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
|
|
36
|
-
render(): JSX.Element;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=DrawerHeader.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
4
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
5
|
-
import { SearchTheme, SearchThemeAttributes } from './themes';
|
|
6
|
-
export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
|
|
7
|
-
/**
|
|
8
|
-
* The function called when the SearchForm form is submitted. The current input value is passed to the callback function.
|
|
9
|
-
*/
|
|
10
|
-
onSubmit: React.FormEventHandler<HTMLFormElement>;
|
|
11
|
-
/**
|
|
12
|
-
* If true, collapse the SearchForm text input into a toggle icon. Useful for responsive layouts.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
isCollapsed?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The function called when the SearchForm text input changes.
|
|
18
|
-
*/
|
|
19
|
-
onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
20
|
-
/**
|
|
21
|
-
* The autocomplete items of the SearchForm. This array of menu items is shown under the search bar.
|
|
22
|
-
*/
|
|
23
|
-
autocompleteItems?: React.ReactElement<MenuItemProps>[];
|
|
24
|
-
/**
|
|
25
|
-
* The theme of the header the search input is being rendered in.
|
|
26
|
-
*/
|
|
27
|
-
searchTheme?: SearchTheme | SearchThemeAttributes;
|
|
28
|
-
/**
|
|
29
|
-
* The placeholder text of the SearchForm text input.
|
|
30
|
-
* @default Search
|
|
31
|
-
*/
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The initial value of the SearchForm text input.
|
|
35
|
-
*/
|
|
36
|
-
initialValue?: string;
|
|
37
|
-
/**
|
|
38
|
-
* If true, right-align the SearchForm. If false, the text input should grow to left-align the SearchForm.
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
rightAlign?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The screenreader label text for the SearchForm text input.
|
|
44
|
-
* @default Search
|
|
45
|
-
*/
|
|
46
|
-
inputLabel?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The screenreader label text for the SearchForm submit button.
|
|
49
|
-
* @default Search
|
|
50
|
-
*/
|
|
51
|
-
submitAriaLabel?: string;
|
|
52
|
-
/**
|
|
53
|
-
* The screenreader label text for the SearchForm clear button.
|
|
54
|
-
* @default Reset Search Form
|
|
55
|
-
*/
|
|
56
|
-
clearButtonAriaLabel?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The screenreader label text for the button to open the collapsed SearchForm.
|
|
59
|
-
* @default Open Search
|
|
60
|
-
*/
|
|
61
|
-
openButtonAriaLabel?: string;
|
|
62
|
-
/**
|
|
63
|
-
* The screenreader label text for the button to close the open SearchForm.
|
|
64
|
-
* @default Cancel
|
|
65
|
-
*/
|
|
66
|
-
closeButtonAriaLabel?: string;
|
|
67
|
-
/**
|
|
68
|
-
* If true, render the SearchForm with a button to clear the text input.
|
|
69
|
-
* @default true
|
|
70
|
-
*/
|
|
71
|
-
showClearButton?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Height of the Search Form in pixels
|
|
74
|
-
* @default 40
|
|
75
|
-
*/
|
|
76
|
-
height?: number;
|
|
77
|
-
/**
|
|
78
|
-
* If true, allow onSubmit being called when input value is empty.
|
|
79
|
-
* @default false
|
|
80
|
-
*/
|
|
81
|
-
allowEmptyStringSearch?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface SearchFormState {
|
|
84
|
-
showForm: boolean;
|
|
85
|
-
searchQuery: string;
|
|
86
|
-
isFocused: boolean;
|
|
87
|
-
}
|
|
88
|
-
export declare class SearchForm extends React.Component<SearchFormProps, SearchFormState> {
|
|
89
|
-
static Theme: typeof SearchTheme;
|
|
90
|
-
private inputRef;
|
|
91
|
-
private openRef;
|
|
92
|
-
private labelId;
|
|
93
|
-
state: Readonly<SearchFormState>;
|
|
94
|
-
private getTheme;
|
|
95
|
-
private getThemeColors;
|
|
96
|
-
getIconButtonType: () => TertiaryButtonProps['variant'];
|
|
97
|
-
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
98
|
-
openCollapsedSearch: () => void;
|
|
99
|
-
closeCollapsedSearch: () => void;
|
|
100
|
-
componentDidUpdate(prevProps: SearchFormProps, prevState: SearchFormState): void;
|
|
101
|
-
focusInput: () => void;
|
|
102
|
-
focusOpen: () => void;
|
|
103
|
-
handleFocus: () => void;
|
|
104
|
-
handleBlur: () => void;
|
|
105
|
-
handleSearchInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
106
|
-
render(): JSX.Element;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=SearchForm.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare enum SearchTheme {
|
|
2
|
-
Light = 0,
|
|
3
|
-
Dark = 1,
|
|
4
|
-
Transparent = 2
|
|
5
|
-
}
|
|
6
|
-
export interface SearchThemeAttributes {
|
|
7
|
-
background?: string;
|
|
8
|
-
backgroundFocus?: string;
|
|
9
|
-
backgroundHover?: string;
|
|
10
|
-
color?: string;
|
|
11
|
-
colorFocus?: string;
|
|
12
|
-
placeholderColor?: string;
|
|
13
|
-
placeholderColorFocus?: string;
|
|
14
|
-
boxShadow?: string | string[];
|
|
15
|
-
boxShadowFocus?: string | string[];
|
|
16
|
-
}
|
|
17
|
-
export interface SearchThemes {
|
|
18
|
-
[key: string]: SearchThemeAttributes;
|
|
19
|
-
}
|
|
20
|
-
export declare const searchThemes: SearchThemes;
|
|
21
|
-
//# sourceMappingURL=themes.d.ts.map
|