@workday/canvas-kit-react 11.0.0-alpha.631-next.0 → 11.0.0-alpha.635-next.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/badge/lib/CountBadge.tsx +71 -46
- package/common/lib/types.ts +2 -2
- package/dist/commonjs/badge/lib/CountBadge.d.ts +22 -3
- package/dist/commonjs/badge/lib/CountBadge.d.ts.map +1 -1
- package/dist/commonjs/badge/lib/CountBadge.js +48 -42
- package/dist/commonjs/button/lib/BaseButton.js +17 -17
- package/dist/commonjs/button/lib/DeleteButton.js +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.js +15 -15
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/common/lib/types.d.ts +2 -2
- package/dist/commonjs/common/lib/types.d.ts.map +1 -1
- package/dist/commonjs/common/lib/types.js +2 -2
- package/dist/commonjs/form-field/lib/FormField.d.ts +6 -0
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.js +3 -0
- package/dist/commonjs/form-field/lib/Hint.d.ts +6 -0
- package/dist/commonjs/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Hint.js +3 -0
- package/dist/commonjs/form-field/lib/Label.d.ts +6 -0
- package/dist/commonjs/form-field/lib/Label.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/Label.js +3 -0
- package/dist/commonjs/form-field/lib/types.d.ts +6 -0
- package/dist/commonjs/form-field/lib/types.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/types.js +3 -0
- package/dist/commonjs/select/lib/Select.js +3 -3
- package/dist/es6/badge/lib/CountBadge.d.ts +22 -3
- package/dist/es6/badge/lib/CountBadge.d.ts.map +1 -1
- package/dist/es6/badge/lib/CountBadge.js +47 -37
- package/dist/es6/button/lib/BaseButton.js +17 -17
- package/dist/es6/button/lib/DeleteButton.js +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.js +2 -2
- package/dist/es6/button/lib/TertiaryButton.js +15 -15
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/common/lib/types.d.ts +2 -2
- package/dist/es6/common/lib/types.d.ts.map +1 -1
- package/dist/es6/common/lib/types.js +2 -2
- package/dist/es6/form-field/lib/FormField.d.ts +6 -0
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.js +3 -0
- package/dist/es6/form-field/lib/Hint.d.ts +6 -0
- package/dist/es6/form-field/lib/Hint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Hint.js +3 -0
- package/dist/es6/form-field/lib/Label.d.ts +6 -0
- package/dist/es6/form-field/lib/Label.d.ts.map +1 -1
- package/dist/es6/form-field/lib/Label.js +3 -0
- package/dist/es6/form-field/lib/types.d.ts +6 -0
- package/dist/es6/form-field/lib/types.d.ts.map +1 -1
- package/dist/es6/form-field/lib/types.js +3 -0
- package/dist/es6/select/lib/Select.js +3 -3
- package/form-field/lib/FormField.tsx +6 -2
- package/form-field/lib/Hint.tsx +6 -2
- package/form-field/lib/Label.tsx +6 -2
- package/form-field/lib/types.ts +6 -1
- package/package.json +4 -4
- package/select/lib/Select.tsx +2 -2
|
@@ -49,6 +49,9 @@ const LegendComponent = styled('legend')(...labelStyles, ({ labelPosition }) =>
|
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
const LabelComponent = styled('label')(...labelStyles);
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated ⚠️ `Label` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
54
|
+
*/
|
|
52
55
|
class Label extends React.Component {
|
|
53
56
|
render() {
|
|
54
57
|
const { labelPosition = Label.Position.Top, isLegend = false, required, ...elemProps } = this.props;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
+
*
|
|
2
3
|
* The position of the FormField label (Top vs Left vs Hidden).
|
|
4
|
+
*
|
|
5
|
+
* @deprecated ⚠️ `FormFieldLabelPosition` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
3
6
|
*/
|
|
4
7
|
export declare enum FormFieldLabelPosition {
|
|
5
8
|
Top = 0,
|
|
6
9
|
Left = 1,
|
|
7
10
|
Hidden = 2
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated ⚠️ `FormFieldLabelPositionBehavior` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
14
|
+
*/
|
|
9
15
|
export interface FormFieldLabelPositionBehavior {
|
|
10
16
|
labelPosition?: FormFieldLabelPosition;
|
|
11
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,sBAAsB;IAChC,GAAG,IAAA;IACH,IAAI,IAAA;IACJ,MAAM,IAAA;CACP;AACD;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
*
|
|
2
3
|
* The position of the FormField label (Top vs Left vs Hidden).
|
|
4
|
+
*
|
|
5
|
+
* @deprecated ⚠️ `FormFieldLabelPosition` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
3
6
|
*/
|
|
4
7
|
export var FormFieldLabelPosition;
|
|
5
8
|
(function (FormFieldLabelPosition) {
|
|
@@ -9,12 +9,12 @@ import { useSelectModel } from './hooks/useSelectModel';
|
|
|
9
9
|
import { useSelectCard } from './hooks/useSelectCard';
|
|
10
10
|
import { useSelectInput } from './hooks/useSelectInput';
|
|
11
11
|
import { createStyles } from '@workday/canvas-kit-styling';
|
|
12
|
-
const selectInputStyles = createStyles({ name: "
|
|
12
|
+
const selectInputStyles = createStyles({ name: "jif512", styles: "caret-color:transparent;cursor:default;&::selection{background-color:transparent;}" });
|
|
13
13
|
export const SelectInput = createSubcomponent(TextInput)({
|
|
14
14
|
modelHook: useSelectModel,
|
|
15
15
|
elemPropsHook: useSelectInput,
|
|
16
|
-
})(({ placeholder = 'Choose an option', inputStartIcon, ...elemProps }, Element, model) => {
|
|
17
|
-
return (React.createElement(InputGroup,
|
|
16
|
+
})(({ placeholder = 'Choose an option', inputStartIcon, width, ...elemProps }, Element, model) => {
|
|
17
|
+
return (React.createElement(InputGroup, { width: width },
|
|
18
18
|
inputStartIcon && model.state.selectedIds.length > 0 && (React.createElement(InputGroup.InnerStart, { pointerEvents: "none" },
|
|
19
19
|
React.createElement(SystemIcon, { icon: inputStartIcon }))),
|
|
20
20
|
React.createElement(InputGroup.Input, Object.assign({ as: Element, placeholder: placeholder }, mergeStyles(elemProps, [selectInputStyles]))),
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
import {Hint} from './Hint';
|
|
11
11
|
import {Label} from './Label';
|
|
12
12
|
import {FormFieldLabelPosition, FormFieldLabelPositionBehavior} from './types';
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated ⚠️ `FormFieldProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
15
|
+
*/
|
|
14
16
|
export interface FormFieldProps
|
|
15
17
|
extends Themeable,
|
|
16
18
|
React.HTMLAttributes<HTMLDivElement>,
|
|
@@ -136,7 +138,9 @@ const FormFieldInputContainer = styled('div')<GrowthBehavior & FormFieldLabelPos
|
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
);
|
|
139
|
-
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated ⚠️ `FormField` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
143
|
+
*/
|
|
140
144
|
export class FormField extends React.Component<React.PropsWithChildren<FormFieldProps>> {
|
|
141
145
|
static LabelPosition = FormFieldLabelPosition;
|
|
142
146
|
static ErrorType = ErrorType;
|
package/form-field/lib/Hint.tsx
CHANGED
|
@@ -2,7 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import {ErrorType, Themeable, styled} from '@workday/canvas-kit-react/common';
|
|
3
3
|
import {space} from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import {Subtext, Text} from '@workday/canvas-kit-react/text';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated ⚠️ `HintProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
7
|
+
*/
|
|
6
8
|
export interface HintProps extends Themeable, React.HTMLAttributes<HTMLParagraphElement> {
|
|
7
9
|
/**
|
|
8
10
|
* The type of error associated with the Hint (if applicable).
|
|
@@ -23,7 +25,9 @@ export interface HintProps extends Themeable, React.HTMLAttributes<HTMLParagraph
|
|
|
23
25
|
const Message = styled(Subtext)<Pick<HintProps, 'error'>>(
|
|
24
26
|
({error, theme}) => error === ErrorType.Error && {color: theme.canvas.palette.error.main}
|
|
25
27
|
);
|
|
26
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated ⚠️ `Hint` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
30
|
+
*/
|
|
27
31
|
class Hint extends React.Component<HintProps> {
|
|
28
32
|
static ErrorType = ErrorType;
|
|
29
33
|
|
package/form-field/lib/Label.tsx
CHANGED
|
@@ -2,7 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import {colors, space, type} from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import {accessibleHide as accessibleHideCSS, styled} from '@workday/canvas-kit-react/common';
|
|
4
4
|
import {FormFieldLabelPosition, FormFieldLabelPositionBehavior} from './types';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated ⚠️ `LabelProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
7
|
+
*/
|
|
6
8
|
export interface LabelProps extends FormFieldLabelPositionBehavior {
|
|
7
9
|
/**
|
|
8
10
|
* The position of the Label.
|
|
@@ -87,7 +89,9 @@ const LegendComponent = styled('legend')<LabelProps>(...labelStyles, ({labelPosi
|
|
|
87
89
|
});
|
|
88
90
|
|
|
89
91
|
const LabelComponent = styled('label')<LabelProps>(...labelStyles);
|
|
90
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated ⚠️ `Label` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
94
|
+
*/
|
|
91
95
|
class Label extends React.Component<React.PropsWithChildren<LabelProps>> {
|
|
92
96
|
static Position = FormFieldLabelPosition;
|
|
93
97
|
|
package/form-field/lib/types.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
+
*
|
|
2
3
|
* The position of the FormField label (Top vs Left vs Hidden).
|
|
4
|
+
*
|
|
5
|
+
* @deprecated ⚠️ `FormFieldLabelPosition` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
3
6
|
*/
|
|
4
7
|
export enum FormFieldLabelPosition {
|
|
5
8
|
Top,
|
|
6
9
|
Left,
|
|
7
10
|
Hidden,
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated ⚠️ `FormFieldLabelPositionBehavior` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead.
|
|
14
|
+
*/
|
|
10
15
|
export interface FormFieldLabelPositionBehavior {
|
|
11
16
|
labelPosition?: FormFieldLabelPosition;
|
|
12
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.635-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@emotion/styled": "^11.6.0",
|
|
51
51
|
"@popperjs/core": "^2.5.4",
|
|
52
52
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
53
|
-
"@workday/canvas-kit-popup-stack": "^11.0.0-alpha.
|
|
54
|
-
"@workday/canvas-kit-styling": "^11.0.0-alpha.
|
|
53
|
+
"@workday/canvas-kit-popup-stack": "^11.0.0-alpha.635-next.0",
|
|
54
|
+
"@workday/canvas-kit-styling": "^11.0.0-alpha.635-next.0",
|
|
55
55
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
56
56
|
"@workday/canvas-tokens-web": "^1.0.0",
|
|
57
57
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
70
70
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b522b22caa5815a97f8ce46c0da521da319b4282"
|
|
73
73
|
}
|
package/select/lib/Select.tsx
CHANGED
|
@@ -38,9 +38,9 @@ export const SelectInput = createSubcomponent(TextInput)({
|
|
|
38
38
|
modelHook: useSelectModel,
|
|
39
39
|
elemPropsHook: useSelectInput,
|
|
40
40
|
})<SelectInputProps>(
|
|
41
|
-
({placeholder = 'Choose an option', inputStartIcon, ...elemProps}, Element, model) => {
|
|
41
|
+
({placeholder = 'Choose an option', inputStartIcon, width, ...elemProps}, Element, model) => {
|
|
42
42
|
return (
|
|
43
|
-
<InputGroup>
|
|
43
|
+
<InputGroup width={width}>
|
|
44
44
|
{inputStartIcon && model.state.selectedIds.length > 0 && (
|
|
45
45
|
<InputGroup.InnerStart pointerEvents="none">
|
|
46
46
|
<SystemIcon icon={inputStartIcon} />
|