@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.5 → 7.0.0-alpha.78-next.6
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/README.md +1 -1
- package/combobox/lib/Combobox.tsx +6 -10
- package/common/index.ts +0 -8
- package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +3 -6
- package/dist/commonjs/common/index.d.ts +0 -8
- package/dist/commonjs/common/index.d.ts.map +1 -1
- package/dist/commonjs/common/index.js +0 -1
- package/dist/commonjs/drawer/lib/DrawerHeader.js +2 -2
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +16 -22
- package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +4 -7
- package/dist/es6/common/index.d.ts +0 -8
- package/dist/es6/common/index.d.ts.map +1 -1
- package/dist/es6/common/index.js +0 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +3 -3
- package/dist/es6/index.d.ts +0 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +17 -23
- package/drawer/lib/DrawerHeader.tsx +3 -3
- package/index.ts +0 -2
- package/package.json +4 -6
- package/search-form/lib/SearchForm.tsx +25 -37
- package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
- package/ts3.5/dist/commonjs/index.d.ts +0 -2
- package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -2
- package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/ts3.5/dist/es6/common/index.d.ts +0 -8
- package/ts3.5/dist/es6/index.d.ts +0 -2
- package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +7 -2
- package/common/lib/Box.tsx +0 -92
- package/common/lib/utils/border.ts +0 -263
- package/common/lib/utils/color.ts +0 -62
- package/common/lib/utils/depth.ts +0 -37
- package/common/lib/utils/flexItem.ts +0 -56
- package/common/lib/utils/layout.ts +0 -77
- package/common/lib/utils/other.ts +0 -20
- package/common/lib/utils/position.ts +0 -96
- package/common/lib/utils/space.ts +0 -207
- package/common/lib/utils/types.ts +0 -105
- package/dist/commonjs/common/lib/Box.d.ts +0 -31
- package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
- package/dist/commonjs/common/lib/Box.js +0 -99
- package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/border.js +0 -153
- package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/color.js +0 -57
- package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/depth.js +0 -29
- package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/flexItem.js +0 -39
- package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/layout.js +0 -43
- package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
- package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/other.js +0 -19
- package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/position.js +0 -78
- package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/space.js +0 -161
- package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/types.js +0 -2
- package/dist/commonjs/header/index.d.ts +0 -9
- package/dist/commonjs/header/index.d.ts.map +0 -1
- package/dist/commonjs/header/index.js +0 -24
- package/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +0 -86
- package/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/dist/commonjs/header/lib/Header.d.ts.map +0 -1
- package/dist/commonjs/header/lib/Header.js +0 -333
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +0 -118
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +0 -137
- package/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/dist/commonjs/header/lib/parts/index.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/index.js +0 -7
- package/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/themes.js +0 -63
- package/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/dist/commonjs/header/lib/shared/types.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/types.js +0 -20
- package/dist/commonjs/layout/index.d.ts +0 -5
- package/dist/commonjs/layout/index.d.ts.map +0 -1
- package/dist/commonjs/layout/index.js +0 -14
- package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Flex.js +0 -83
- package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Stack.js +0 -99
- package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/flex.js +0 -38
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -29
- package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/stack.js +0 -55
- package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/types.js +0 -2
- package/dist/es6/common/lib/Box.d.ts +0 -31
- package/dist/es6/common/lib/Box.d.ts.map +0 -1
- package/dist/es6/common/lib/Box.js +0 -74
- package/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/border.js +0 -149
- package/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/color.js +0 -53
- package/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/depth.js +0 -25
- package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/flexItem.js +0 -35
- package/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/layout.js +0 -39
- package/dist/es6/common/lib/utils/other.d.ts +0 -5
- package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/other.js +0 -15
- package/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/position.js +0 -74
- package/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/space.js +0 -157
- package/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/types.js +0 -1
- package/dist/es6/header/index.d.ts +0 -9
- package/dist/es6/header/index.d.ts.map +0 -1
- package/dist/es6/header/index.js +0 -8
- package/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/es6/header/lib/GlobalHeader.js +0 -62
- package/dist/es6/header/lib/Header.d.ts +0 -76
- package/dist/es6/header/lib/Header.d.ts.map +0 -1
- package/dist/es6/header/lib/Header.js +0 -309
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +0 -93
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +0 -112
- package/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/dist/es6/header/lib/parts/index.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/index.js +0 -2
- package/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/dist/es6/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/themes.js +0 -57
- package/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/dist/es6/header/lib/shared/types.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/types.js +0 -17
- package/dist/es6/layout/index.d.ts +0 -5
- package/dist/es6/layout/index.d.ts.map +0 -1
- package/dist/es6/layout/index.js +0 -2
- package/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/Flex.js +0 -58
- package/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/Stack.js +0 -74
- package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/flex.js +0 -34
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
- package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/stack.js +0 -51
- package/dist/es6/layout/lib/utils/types.d.ts +0 -8
- package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/types.js +0 -1
- package/header/LICENSE +0 -51
- package/header/README.md +0 -359
- package/header/index.ts +0 -9
- package/header/lib/GlobalHeader.tsx +0 -73
- package/header/lib/Header.tsx +0 -429
- package/header/lib/parts/DubLogoTitle.tsx +0 -99
- package/header/lib/parts/WorkdayLogoTitle.tsx +0 -120
- package/header/lib/parts/index.ts +0 -2
- package/header/lib/shared/themes.tsx +0 -97
- package/header/lib/shared/types.tsx +0 -16
- package/header/package.json +0 -5
- package/layout/LICENSE +0 -52
- package/layout/README.md +0 -16
- package/layout/index.ts +0 -4
- package/layout/lib/Flex.tsx +0 -47
- package/layout/lib/Stack.tsx +0 -95
- package/layout/lib/utils/flex.ts +0 -65
- package/layout/lib/utils/getValidChildren.ts +0 -7
- package/layout/lib/utils/stack.ts +0 -78
- package/layout/lib/utils/types.ts +0 -45
- package/layout/package.json +0 -5
- package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
- package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
- package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/commonjs/header/index.d.ts +0 -9
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
- package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
- package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/es6/header/index.d.ts +0 -9
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/es6/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/es6/layout/index.d.ts +0 -5
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import {colors, space, type, CanvasColor, typeColors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
import {
|
|
4
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
import {xIcon} from '@workday/canvas-system-icons-web';
|
|
6
6
|
|
|
7
7
|
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -69,7 +69,7 @@ const HeaderTitle = styled('h4')<Pick<DrawerHeaderProps, 'inverse'>>(
|
|
|
69
69
|
})
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
const CloseButton = styled(
|
|
72
|
+
const CloseButton = styled(TertiaryButton)({
|
|
73
73
|
margin: '-8px', // for inverse and plain button, we always want this margin
|
|
74
74
|
});
|
|
75
75
|
|
|
@@ -93,7 +93,7 @@ export default class DrawerHeader extends React.Component<DrawerHeaderProps, {}>
|
|
|
93
93
|
</HeaderTitle>
|
|
94
94
|
{onClose && closeIconAriaLabel && (
|
|
95
95
|
<CloseButton
|
|
96
|
-
variant={inverse ? 'inverse' :
|
|
96
|
+
variant={inverse ? 'inverse' : undefined}
|
|
97
97
|
onClick={onClose}
|
|
98
98
|
aria-label={closeIconAriaLabel}
|
|
99
99
|
icon={xIcon}
|
package/index.ts
CHANGED
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.78-next.6+400ffc0b",
|
|
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",
|
|
@@ -52,19 +52,17 @@
|
|
|
52
52
|
"react": "^16.8 || ^17.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@emotion/is-prop-valid": "^1.1.1",
|
|
56
55
|
"@emotion/react": "^11.7.1",
|
|
57
56
|
"@emotion/styled": "^11.6.0",
|
|
58
|
-
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.
|
|
59
|
-
"@workday/canvas-kit-react": "^7.0.0-alpha.
|
|
57
|
+
"@workday/canvas-kit-preview-react": "^7.0.0-alpha.78-next.6+400ffc0b",
|
|
58
|
+
"@workday/canvas-kit-react": "^7.0.0-alpha.78-next.6+400ffc0b",
|
|
60
59
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
61
60
|
"chroma-js": "^2.1.0",
|
|
62
|
-
"csstype": "^2.6.17",
|
|
63
61
|
"lodash.flatten": "^4.4.0",
|
|
64
62
|
"rtl-css-js": "^1.14.1"
|
|
65
63
|
},
|
|
66
64
|
"devDependencies": {
|
|
67
65
|
"@types/lodash.flatten": "^4.4.6"
|
|
68
66
|
},
|
|
69
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "400ffc0b29c2762180758d9b7c1bdc0562cb01e4"
|
|
70
68
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import {CSSObject} from '@emotion/styled';
|
|
3
3
|
import {colors, space, spaceNumbers} from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import {GrowthBehavior, styled, generateUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
|
-
import {
|
|
5
|
+
import {TertiaryButton, TertiaryButtonProps} from '@workday/canvas-kit-react/button';
|
|
6
6
|
import {searchIcon, xIcon} from '@workday/canvas-system-icons-web';
|
|
7
7
|
import {FormField, FormFieldLabelPosition} from '@workday/canvas-kit-react/form-field';
|
|
8
8
|
import {Combobox} from '@workday/canvas-kit-labs-react/combobox';
|
|
@@ -82,6 +82,11 @@ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttribute
|
|
|
82
82
|
* @default 40
|
|
83
83
|
*/
|
|
84
84
|
height?: number;
|
|
85
|
+
/**
|
|
86
|
+
* If true, allow onSubmit being called when input value is empty.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
allowEmptyStringSearch?: boolean;
|
|
85
90
|
}
|
|
86
91
|
|
|
87
92
|
export interface SearchFormState {
|
|
@@ -164,39 +169,22 @@ const SearchCombobox = styled(Combobox)({
|
|
|
164
169
|
width: `100%`,
|
|
165
170
|
});
|
|
166
171
|
|
|
167
|
-
const SearchIcon = styled(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
minHeight: size,
|
|
182
|
-
height: size,
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
return {
|
|
186
|
-
position: `absolute`,
|
|
187
|
-
margin: isCollapsed ? `auto ${space.xxs}` : `auto ${space.xxxs}`,
|
|
188
|
-
top: 0,
|
|
189
|
-
bottom: 0,
|
|
190
|
-
left: 0,
|
|
191
|
-
padding: 0,
|
|
192
|
-
zIndex: 3,
|
|
193
|
-
display: isHidden ? 'none' : 'flex',
|
|
194
|
-
...collapseStyles,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
);
|
|
172
|
+
const SearchIcon = styled(TertiaryButton)<
|
|
173
|
+
Pick<SearchFormProps, 'isCollapsed'> & {isHidden: boolean}
|
|
174
|
+
>(({isCollapsed, isHidden}) => {
|
|
175
|
+
return {
|
|
176
|
+
position: `absolute`,
|
|
177
|
+
margin: isCollapsed ? `auto ${space.xxs}` : `auto ${space.xxxs}`,
|
|
178
|
+
top: 0,
|
|
179
|
+
bottom: 0,
|
|
180
|
+
left: 0,
|
|
181
|
+
padding: 0,
|
|
182
|
+
zIndex: 3,
|
|
183
|
+
display: isHidden ? 'none' : 'flex',
|
|
184
|
+
};
|
|
185
|
+
});
|
|
198
186
|
|
|
199
|
-
const CloseButton = styled(
|
|
187
|
+
const CloseButton = styled(TertiaryButton)<
|
|
200
188
|
Pick<SearchFormProps, 'isCollapsed'> & Pick<SearchFormState, 'showForm'>
|
|
201
189
|
>(({isCollapsed, showForm}) => {
|
|
202
190
|
const collapseStyles: CSSObject =
|
|
@@ -320,18 +308,18 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
|
|
|
320
308
|
return getInputColors(theme, this.state.isFocused);
|
|
321
309
|
};
|
|
322
310
|
|
|
323
|
-
getIconButtonType = ():
|
|
311
|
+
getIconButtonType = (): TertiaryButtonProps['variant'] => {
|
|
324
312
|
let background = this.getThemeColors().background || `#fff`;
|
|
325
313
|
if (this.props.isCollapsed && this.state.showForm) {
|
|
326
314
|
background = formCollapsedBackground;
|
|
327
315
|
}
|
|
328
316
|
const isDarkBackground = chroma(background as string).get('lab.l') < 70;
|
|
329
|
-
return isDarkBackground ? 'inverse' :
|
|
317
|
+
return isDarkBackground ? 'inverse' : undefined;
|
|
330
318
|
};
|
|
331
319
|
|
|
332
320
|
handleSubmit = (event: React.FormEvent<HTMLFormElement>): void => {
|
|
333
321
|
event.preventDefault();
|
|
334
|
-
if (this.state.searchQuery.trim()) {
|
|
322
|
+
if (this.props.allowEmptyStringSearch || this.state.searchQuery.trim()) {
|
|
335
323
|
this.props.onSubmit(event);
|
|
336
324
|
} else {
|
|
337
325
|
this.focusInput();
|
|
@@ -407,6 +395,7 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
|
|
|
407
395
|
initialValue,
|
|
408
396
|
searchTheme,
|
|
409
397
|
rightAlign,
|
|
398
|
+
allowEmptyStringSearch = false,
|
|
410
399
|
...elemProps
|
|
411
400
|
} = this.props;
|
|
412
401
|
|
|
@@ -479,7 +468,6 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
|
|
|
479
468
|
aria-label={closeButtonAriaLabel}
|
|
480
469
|
icon={xIcon}
|
|
481
470
|
isCollapsed={isCollapsed}
|
|
482
|
-
variant="plain"
|
|
483
471
|
showForm={this.state.showForm}
|
|
484
472
|
onClick={this.closeCollapsedSearch}
|
|
485
473
|
type="button"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
4
|
-
import {
|
|
4
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
5
5
|
import { TextInputProps } from '@workday/canvas-kit-react/text-input';
|
|
6
6
|
export interface ComboBoxMenuItemGroup {
|
|
7
7
|
header: React.ReactElement<MenuItemProps>;
|
|
@@ -17,10 +17,9 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
|
|
|
17
17
|
*/
|
|
18
18
|
initialValue?: string;
|
|
19
19
|
/**
|
|
20
|
-
* The variant of the Combobox clear button.
|
|
21
|
-
* @default IconButton.Variant.Plain
|
|
20
|
+
* The variant of the Combobox clear button. The default is a TertiaryButton
|
|
22
21
|
*/
|
|
23
|
-
clearButtonVariant?:
|
|
22
|
+
clearButtonVariant?: TertiaryButtonProps['variant'];
|
|
24
23
|
/**
|
|
25
24
|
* If true, render the Combobox with a button to clear the text input.
|
|
26
25
|
* @default false
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
export * from './lib/Box';
|
|
2
1
|
export * from './lib/theming';
|
|
3
|
-
export { BorderStyleProps } from './lib/utils/border';
|
|
4
|
-
export { ColorStyleProps } from './lib/utils/color';
|
|
5
|
-
export { DepthStyleProps } from './lib/utils/depth';
|
|
6
|
-
export { FlexItemStyleProps } from './lib/utils/flexItem';
|
|
7
|
-
export { LayoutStyleProps } from './lib/utils/layout';
|
|
8
|
-
export { PositionStyleProps } from './lib/utils/position';
|
|
9
|
-
export { SpaceStyleProps } from './lib/utils/space';
|
|
10
2
|
export { ComponentStatesTable } from './lib/storybook-utils/ComponentStatesTable';
|
|
11
3
|
export { permutateProps } from './lib/storybook-utils/permutateProps';
|
|
12
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
3
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
4
4
|
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
5
5
|
import { SearchTheme, SearchThemeAttributes } from './themes';
|
|
6
6
|
export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
|
|
@@ -74,6 +74,11 @@ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttribute
|
|
|
74
74
|
* @default 40
|
|
75
75
|
*/
|
|
76
76
|
height?: number;
|
|
77
|
+
/**
|
|
78
|
+
* If true, allow onSubmit being called when input value is empty.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
allowEmptyStringSearch?: boolean;
|
|
77
82
|
}
|
|
78
83
|
export interface SearchFormState {
|
|
79
84
|
showForm: boolean;
|
|
@@ -88,7 +93,7 @@ export declare class SearchForm extends React.Component<SearchFormProps, SearchF
|
|
|
88
93
|
state: Readonly<SearchFormState>;
|
|
89
94
|
private getTheme;
|
|
90
95
|
private getThemeColors;
|
|
91
|
-
getIconButtonType: () =>
|
|
96
|
+
getIconButtonType: () => TertiaryButtonProps['variant'];
|
|
92
97
|
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
93
98
|
openCollapsedSearch: () => void;
|
|
94
99
|
closeCollapsedSearch: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
4
|
-
import {
|
|
4
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
5
5
|
import { TextInputProps } from '@workday/canvas-kit-react/text-input';
|
|
6
6
|
export interface ComboBoxMenuItemGroup {
|
|
7
7
|
header: React.ReactElement<MenuItemProps>;
|
|
@@ -17,10 +17,9 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
|
|
|
17
17
|
*/
|
|
18
18
|
initialValue?: string;
|
|
19
19
|
/**
|
|
20
|
-
* The variant of the Combobox clear button.
|
|
21
|
-
* @default IconButton.Variant.Plain
|
|
20
|
+
* The variant of the Combobox clear button. The default is a TertiaryButton
|
|
22
21
|
*/
|
|
23
|
-
clearButtonVariant?:
|
|
22
|
+
clearButtonVariant?: TertiaryButtonProps['variant'];
|
|
24
23
|
/**
|
|
25
24
|
* If true, render the Combobox with a button to clear the text input.
|
|
26
25
|
* @default false
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
export * from './lib/Box';
|
|
2
1
|
export * from './lib/theming';
|
|
3
|
-
export { BorderStyleProps } from './lib/utils/border';
|
|
4
|
-
export { ColorStyleProps } from './lib/utils/color';
|
|
5
|
-
export { DepthStyleProps } from './lib/utils/depth';
|
|
6
|
-
export { FlexItemStyleProps } from './lib/utils/flexItem';
|
|
7
|
-
export { LayoutStyleProps } from './lib/utils/layout';
|
|
8
|
-
export { PositionStyleProps } from './lib/utils/position';
|
|
9
|
-
export { SpaceStyleProps } from './lib/utils/space';
|
|
10
2
|
export { ComponentStatesTable } from './lib/storybook-utils/ComponentStatesTable';
|
|
11
3
|
export { permutateProps } from './lib/storybook-utils/permutateProps';
|
|
12
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {
|
|
3
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
4
4
|
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
5
5
|
import { SearchTheme, SearchThemeAttributes } from './themes';
|
|
6
6
|
export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
|
|
@@ -74,6 +74,11 @@ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttribute
|
|
|
74
74
|
* @default 40
|
|
75
75
|
*/
|
|
76
76
|
height?: number;
|
|
77
|
+
/**
|
|
78
|
+
* If true, allow onSubmit being called when input value is empty.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
allowEmptyStringSearch?: boolean;
|
|
77
82
|
}
|
|
78
83
|
export interface SearchFormState {
|
|
79
84
|
showForm: boolean;
|
|
@@ -88,7 +93,7 @@ export declare class SearchForm extends React.Component<SearchFormProps, SearchF
|
|
|
88
93
|
state: Readonly<SearchFormState>;
|
|
89
94
|
private getTheme;
|
|
90
95
|
private getThemeColors;
|
|
91
|
-
getIconButtonType: () =>
|
|
96
|
+
getIconButtonType: () => TertiaryButtonProps['variant'];
|
|
92
97
|
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
93
98
|
openCollapsedSearch: () => void;
|
|
94
99
|
closeCollapsedSearch: () => void;
|
package/common/lib/Box.tsx
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import isPropValid from '@emotion/is-prop-valid';
|
|
4
|
-
import {createComponent, StyledType, useConstant} from '@workday/canvas-kit-react/common';
|
|
5
|
-
|
|
6
|
-
// style props
|
|
7
|
-
import {border, BorderStyleProps} from './utils/border';
|
|
8
|
-
import {color, ColorStyleProps} from './utils/color';
|
|
9
|
-
import {depth, DepthStyleProps} from './utils/depth';
|
|
10
|
-
import {flexItem, FlexItemStyleProps} from './utils/flexItem';
|
|
11
|
-
import {layout, LayoutStyleProps} from './utils/layout';
|
|
12
|
-
import {other, OtherStyleProps} from './utils/other';
|
|
13
|
-
import {position, PositionStyleProps} from './utils/position';
|
|
14
|
-
import {space, SpaceStyleProps} from './utils/space';
|
|
15
|
-
|
|
16
|
-
export type BoxProps = BorderStyleProps &
|
|
17
|
-
ColorStyleProps &
|
|
18
|
-
DepthStyleProps &
|
|
19
|
-
FlexItemStyleProps &
|
|
20
|
-
LayoutStyleProps &
|
|
21
|
-
OtherStyleProps &
|
|
22
|
-
PositionStyleProps &
|
|
23
|
-
SpaceStyleProps & {
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const omittedProps = ['display', 'color', 'height', 'overflow', 'width', 'border', 'background'];
|
|
28
|
-
|
|
29
|
-
const shouldForwardProp = (prop: string) => {
|
|
30
|
-
return isPropValid(prop) && !omittedProps.includes(prop);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// Meant to be used with elements. The `shouldForwardProps` will remove all style props
|
|
34
|
-
const StyledBoxElement = styled('div', {shouldForwardProp})<StyledType & BoxProps>(
|
|
35
|
-
{
|
|
36
|
-
boxSizing: 'border-box',
|
|
37
|
-
},
|
|
38
|
-
border,
|
|
39
|
-
color,
|
|
40
|
-
depth,
|
|
41
|
-
flexItem,
|
|
42
|
-
layout,
|
|
43
|
-
position,
|
|
44
|
-
space
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// Meant to be used with components. There is no `shouldForwardProps` - all props will be forwarded to the component
|
|
48
|
-
const StyledBoxComponent = styled('div')<StyledType & BoxProps>(
|
|
49
|
-
{
|
|
50
|
-
boxSizing: 'border-box',
|
|
51
|
-
},
|
|
52
|
-
border,
|
|
53
|
-
color,
|
|
54
|
-
depth,
|
|
55
|
-
flexItem,
|
|
56
|
-
layout,
|
|
57
|
-
other,
|
|
58
|
-
position,
|
|
59
|
-
space
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
|
|
64
|
-
* It is highly flexible, and its primary purpose is to build other components.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* import { Box, BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
68
|
-
*
|
|
69
|
-
* interface CardProps extends BoxProps {
|
|
70
|
-
* // card-specific props
|
|
71
|
-
* }
|
|
72
|
-
*
|
|
73
|
-
* // `Card`'s default values are set using `BoxProps`
|
|
74
|
-
* const Card = (props: CardProps) => (
|
|
75
|
-
* <Box depth={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
76
|
-
* );
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
export const Box = createComponent('div')({
|
|
80
|
-
displayName: 'Box',
|
|
81
|
-
Component: ({children, ...elemProps}: BoxProps, ref, Element) => {
|
|
82
|
-
const BoxComponent = useConstant(() =>
|
|
83
|
-
typeof Element === 'string' ? StyledBoxElement : StyledBoxComponent
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<BoxComponent as={Element} ref={ref} {...elemProps}>
|
|
88
|
-
{children}
|
|
89
|
-
</BoxComponent>
|
|
90
|
-
);
|
|
91
|
-
},
|
|
92
|
-
});
|