@workday/canvas-kit-preview-react 11.0.0-alpha.796-next.0 → 11.0.0-alpha.798-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/dist/commonjs/form-field/index.d.ts +4 -0
- package/dist/commonjs/form-field/index.d.ts.map +1 -1
- package/dist/commonjs/form-field/index.js +9 -0
- package/dist/commonjs/form-field/lib/FormField.d.ts +14 -7
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.js +16 -13
- package/dist/commonjs/form-field/lib/FormFieldContainer.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldContainer.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldContainer.js +5 -5
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +104 -2
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.js +11 -12
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +0 -1
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +107 -10
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +14 -34
- package/dist/commonjs/form-field/lib/formFieldStencil.d.ts +29 -0
- package/dist/commonjs/form-field/lib/formFieldStencil.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/formFieldStencil.js +27 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +0 -25
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +0 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +2 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +2 -0
- package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -7
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +8 -3
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +0 -2
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -8
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +8 -3
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -2
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -5
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/es6/form-field/index.d.ts +4 -0
- package/dist/es6/form-field/index.d.ts.map +1 -1
- package/dist/es6/form-field/index.js +4 -0
- package/dist/es6/form-field/lib/FormField.d.ts +14 -7
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.js +18 -15
- package/dist/es6/form-field/lib/FormFieldContainer.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldContainer.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldContainer.js +3 -3
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +104 -2
- package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.js +12 -13
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +0 -1
- package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts +107 -10
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.js +14 -34
- package/dist/es6/form-field/lib/formFieldStencil.d.ts +29 -0
- package/dist/es6/form-field/lib/formFieldStencil.d.ts.map +1 -0
- package/dist/es6/form-field/lib/formFieldStencil.js +24 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +0 -25
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +0 -5
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +2 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +2 -0
- package/dist/es6/text-area/lib/TextArea.d.ts +2 -7
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +10 -5
- package/dist/es6/text-area/lib/TextAreaField.d.ts +0 -2
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.d.ts +2 -8
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +10 -5
- package/dist/es6/text-input/lib/TextInputField.d.ts +0 -2
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -1
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -5
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/form-field/index.ts +4 -0
- package/form-field/lib/FormField.tsx +28 -29
- package/form-field/lib/FormFieldContainer.tsx +1 -1
- package/form-field/lib/FormFieldHint.tsx +24 -28
- package/form-field/lib/FormFieldLabel.tsx +35 -69
- package/form-field/lib/formFieldStencil.ts +42 -0
- package/form-field/lib/hooks/useFormFieldModel.tsx +0 -5
- package/form-field/lib/hooks/useFormFieldOrientation.tsx +2 -0
- package/package.json +4 -4
- package/text-area/lib/TextArea.tsx +16 -7
- package/text-input/lib/TextInput.tsx +16 -7
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export * from './lib/FormField';
|
|
2
2
|
export * from './lib/hooks/';
|
|
3
|
+
export { formFieldStencil } from './lib/formFieldStencil';
|
|
4
|
+
export { formFieldContainerStencil } from './lib/FormFieldContainer';
|
|
5
|
+
export { formFieldHintStencil } from './lib/FormFieldHint';
|
|
6
|
+
export { formFieldLabelStencil } from './lib/FormFieldLabel';
|
|
3
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../form-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../form-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAC,yBAAyB,EAAC,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -10,5 +10,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.formFieldLabelStencil = exports.formFieldHintStencil = exports.formFieldContainerStencil = exports.formFieldStencil = void 0;
|
|
13
14
|
__exportStar(require("./lib/FormField"), exports);
|
|
14
15
|
__exportStar(require("./lib/hooks/"), exports);
|
|
16
|
+
var formFieldStencil_1 = require("./lib/formFieldStencil");
|
|
17
|
+
Object.defineProperty(exports, "formFieldStencil", { enumerable: true, get: function () { return formFieldStencil_1.formFieldStencil; } });
|
|
18
|
+
var FormFieldContainer_1 = require("./lib/FormFieldContainer");
|
|
19
|
+
Object.defineProperty(exports, "formFieldContainerStencil", { enumerable: true, get: function () { return FormFieldContainer_1.formFieldContainerStencil; } });
|
|
20
|
+
var FormFieldHint_1 = require("./lib/FormFieldHint");
|
|
21
|
+
Object.defineProperty(exports, "formFieldHintStencil", { enumerable: true, get: function () { return FormFieldHint_1.formFieldHintStencil; } });
|
|
22
|
+
var FormFieldLabel_1 = require("./lib/FormFieldLabel");
|
|
23
|
+
Object.defineProperty(exports, "formFieldLabelStencil", { enumerable: true, get: function () { return FormFieldLabel_1.formFieldLabelStencil; } });
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
4
4
|
export interface FormFieldProps extends FlexProps, GrowthBehavior {
|
|
5
|
+
/**
|
|
6
|
+
* The direction the child elements should stack
|
|
7
|
+
* @default vertical
|
|
8
|
+
*/
|
|
9
|
+
orientation?: 'vertical' | 'horizontal';
|
|
5
10
|
children: React.ReactNode;
|
|
6
11
|
}
|
|
7
12
|
/**
|
|
@@ -14,17 +19,17 @@ export interface FormFieldProps extends FlexProps, GrowthBehavior {
|
|
|
14
19
|
* <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />
|
|
15
20
|
* </FormField>
|
|
16
21
|
* ```
|
|
22
|
+
*
|
|
23
|
+
* @stencil formFieldStencil
|
|
17
24
|
*/
|
|
18
25
|
export declare const FormField: import("@workday/canvas-kit-react/common").ElementComponentM<"div", FormFieldProps & Partial<{
|
|
19
26
|
error: "alert" | "error" | undefined;
|
|
20
|
-
orientation: "horizontal" | "vertical";
|
|
21
27
|
id: string;
|
|
22
28
|
isRequired: boolean;
|
|
23
29
|
}> & {} & {}, {
|
|
24
30
|
state: {
|
|
25
31
|
id: string;
|
|
26
32
|
error: "alert" | "error" | undefined;
|
|
27
|
-
orientation: "horizontal" | "vertical";
|
|
28
33
|
isRequired: boolean;
|
|
29
34
|
};
|
|
30
35
|
events: {};
|
|
@@ -46,7 +51,6 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
46
51
|
state: {
|
|
47
52
|
id: string;
|
|
48
53
|
error: "alert" | "error" | undefined;
|
|
49
|
-
orientation: "horizontal" | "vertical";
|
|
50
54
|
isRequired: boolean;
|
|
51
55
|
};
|
|
52
56
|
events: {};
|
|
@@ -60,12 +64,13 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
60
64
|
* <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />
|
|
61
65
|
* </FormField>
|
|
62
66
|
* ```
|
|
67
|
+
*
|
|
68
|
+
* @stencil formFieldLabelStencil
|
|
63
69
|
*/
|
|
64
70
|
Label: import("@workday/canvas-kit-react/common").ElementComponentM<"label", import("./FormFieldLabel").FormFieldLabelProps, {
|
|
65
71
|
state: {
|
|
66
72
|
id: string;
|
|
67
73
|
error: "alert" | "error" | undefined;
|
|
68
|
-
orientation: "horizontal" | "vertical";
|
|
69
74
|
isRequired: boolean;
|
|
70
75
|
};
|
|
71
76
|
events: {};
|
|
@@ -81,12 +86,13 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
81
86
|
* <FormField.Hint>This is your hint text</FormField.Hint>
|
|
82
87
|
* </FormField>
|
|
83
88
|
* ```
|
|
89
|
+
*
|
|
90
|
+
* @stencil formFieldHintStencil
|
|
84
91
|
*/
|
|
85
|
-
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p",
|
|
92
|
+
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", import("@workday/canvas-kit-react/text").TextProps, {
|
|
86
93
|
state: {
|
|
87
94
|
id: string;
|
|
88
95
|
error: "alert" | "error" | undefined;
|
|
89
|
-
orientation: "horizontal" | "vertical";
|
|
90
96
|
isRequired: boolean;
|
|
91
97
|
};
|
|
92
98
|
events: {};
|
|
@@ -103,12 +109,13 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
103
109
|
* </FormField.Container>
|
|
104
110
|
* </FormField>
|
|
105
111
|
* ```
|
|
112
|
+
*
|
|
113
|
+
* @stencil formFieldContainerStencil
|
|
106
114
|
*/
|
|
107
115
|
Container: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("@workday/canvas-kit-styling").CSProps, {
|
|
108
116
|
state: {
|
|
109
117
|
id: string;
|
|
110
118
|
error: "alert" | "error" | undefined;
|
|
111
|
-
orientation: "horizontal" | "vertical";
|
|
112
119
|
isRequired: boolean;
|
|
113
120
|
};
|
|
114
121
|
events: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAC,SAAS,EAAc,MAAM,kCAAkC,CAAC;AASxE,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,cAAc;IAC/D;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;IAIlB;;;;;;;;;;;;OAYG;;;;;;;;;IAEH;;;;;;;;;;;OAWG;;;;;;;;;IAEH;;;;;;;;;;;;;OAaG;;;;;;;;;IAEH;;;;;;;;;;;;;;OAcG;;;;;;;;;CAmBL,CAAC"}
|
|
@@ -7,21 +7,12 @@ exports.FormField = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
10
|
-
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
11
|
-
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
12
10
|
const hooks_1 = require("./hooks");
|
|
13
11
|
const FormFieldInput_1 = require("./FormFieldInput");
|
|
14
12
|
const FormFieldLabel_1 = require("./FormFieldLabel");
|
|
15
13
|
const FormFieldHint_1 = require("./FormFieldHint");
|
|
16
14
|
const FormFieldContainer_1 = require("./FormFieldContainer");
|
|
17
|
-
const
|
|
18
|
-
base: { name: "6fc20a", styles: "box-sizing:border-box;border:none;padding:var(--cnvs-sys-space-zero);margin:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x6);" },
|
|
19
|
-
modifiers: {
|
|
20
|
-
grow: {
|
|
21
|
-
true: { name: "59f66e", styles: "width:100%;[data-width=\"ck-formfield-width\"]{width:100%;}" }
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}, "form-field-aed57a");
|
|
15
|
+
const formFieldStencil_1 = require("./formFieldStencil");
|
|
25
16
|
/**
|
|
26
17
|
* Use `FormField` to wrap input components to make them accessible. You can customize the field
|
|
27
18
|
* by passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `FormField.Input` through the `as` prop.
|
|
@@ -32,6 +23,8 @@ const formFieldStencil = canvas_kit_styling_1.createStencil({
|
|
|
32
23
|
* <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />
|
|
33
24
|
* </FormField>
|
|
34
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @stencil formFieldStencil
|
|
35
28
|
*/
|
|
36
29
|
exports.FormField = common_1.createContainer('div')({
|
|
37
30
|
displayName: 'FormField',
|
|
@@ -60,6 +53,8 @@ exports.FormField = common_1.createContainer('div')({
|
|
|
60
53
|
* <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />
|
|
61
54
|
* </FormField>
|
|
62
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* @stencil formFieldLabelStencil
|
|
63
58
|
*/
|
|
64
59
|
Label: FormFieldLabel_1.FormFieldLabel,
|
|
65
60
|
/**
|
|
@@ -73,6 +68,8 @@ exports.FormField = common_1.createContainer('div')({
|
|
|
73
68
|
* <FormField.Hint>This is your hint text</FormField.Hint>
|
|
74
69
|
* </FormField>
|
|
75
70
|
* ```
|
|
71
|
+
*
|
|
72
|
+
* @stencil formFieldHintStencil
|
|
76
73
|
*/
|
|
77
74
|
Hint: FormFieldHint_1.FormFieldHint,
|
|
78
75
|
/**
|
|
@@ -87,10 +84,16 @@ exports.FormField = common_1.createContainer('div')({
|
|
|
87
84
|
* </FormField.Container>
|
|
88
85
|
* </FormField>
|
|
89
86
|
* ```
|
|
87
|
+
*
|
|
88
|
+
* @stencil formFieldContainerStencil
|
|
90
89
|
*/
|
|
91
90
|
Container: FormFieldContainer_1.FormFieldContainer,
|
|
92
91
|
},
|
|
93
|
-
})(({ children, ...elemProps }, Element, model) => {
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
})(({ children, grow, orientation, ...elemProps }, Element, model) => {
|
|
93
|
+
return (react_1.default.createElement(Element, Object.assign({}, layout_1.mergeStyles(elemProps, formFieldStencil_1.formFieldStencil({
|
|
94
|
+
grow,
|
|
95
|
+
orientation,
|
|
96
|
+
error: model.state.error,
|
|
97
|
+
required: model.state.isRequired,
|
|
98
|
+
}))), children));
|
|
96
99
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSProps } from '@workday/canvas-kit-styling';
|
|
2
|
+
export declare const formFieldContainerStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
2
3
|
export declare const FormFieldContainer: import("@workday/canvas-kit-react/common").ElementComponentM<"div", CSProps, {
|
|
3
4
|
state: {
|
|
4
5
|
id: string;
|
|
5
6
|
error: "alert" | "error" | undefined;
|
|
6
|
-
orientation: "horizontal" | "vertical";
|
|
7
7
|
isRequired: boolean;
|
|
8
8
|
};
|
|
9
9
|
events: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldContainer.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldContainer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,OAAO,EAAgB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"FormFieldContainer.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldContainer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,OAAO,EAAgB,MAAM,6BAA6B,CAAC;AAIjF,eAAO,MAAM,yBAAyB,yIAKpC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;EAU7B,CAAC"}
|
|
@@ -3,17 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FormFieldContainer = void 0;
|
|
6
|
+
exports.FormFieldContainer = exports.formFieldContainerStencil = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
10
10
|
const hooks_1 = require("./hooks");
|
|
11
|
-
|
|
12
|
-
base: { name: "
|
|
13
|
-
}, "form-field-container-
|
|
11
|
+
exports.formFieldContainerStencil = canvas_kit_styling_1.createStencil({
|
|
12
|
+
base: { name: "0926c9", styles: "box-sizing:border-box;display:flex;flex-direction:column;" }
|
|
13
|
+
}, "form-field-container-6d2b75");
|
|
14
14
|
exports.FormFieldContainer = common_1.createSubcomponent('div')({
|
|
15
15
|
displayName: 'FormField.Container',
|
|
16
16
|
modelHook: hooks_1.useFormFieldModel,
|
|
17
17
|
})((elemProps, Element, model) => {
|
|
18
|
-
return (react_1.default.createElement(Element, Object.assign({ "data-width": "ck-formfield-width" }, canvas_kit_styling_1.handleCsProp(elemProps, formFieldContainerStencil()))));
|
|
18
|
+
return (react_1.default.createElement(Element, Object.assign({ "data-width": "ck-formfield-width" }, canvas_kit_styling_1.handleCsProp(elemProps, exports.formFieldContainerStencil()))));
|
|
19
19
|
});
|
|
@@ -1,8 +1,110 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const formFieldHintStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, import("@workday/canvas-kit-styling").Stencil<{
|
|
2
|
+
typeLevel: {
|
|
3
|
+
'title.large': {
|
|
4
|
+
color: "--cnvs-sys-color-text-strong";
|
|
5
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
6
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
7
|
+
lineHeight: "--cnvs-base-line-height-600";
|
|
8
|
+
fontSize: "--cnvs-base-font-size-600";
|
|
9
|
+
};
|
|
10
|
+
'title.medium': {
|
|
11
|
+
color: "--cnvs-sys-color-text-strong";
|
|
12
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
13
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
14
|
+
lineHeight: "--cnvs-base-line-height-500";
|
|
15
|
+
fontSize: "--cnvs-base-font-size-500";
|
|
16
|
+
};
|
|
17
|
+
'title.small': {
|
|
18
|
+
color: "--cnvs-sys-color-text-strong";
|
|
19
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
20
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
21
|
+
lineHeight: "--cnvs-base-line-height-400";
|
|
22
|
+
fontSize: "--cnvs-base-font-size-400";
|
|
23
|
+
};
|
|
24
|
+
'heading.large': {
|
|
25
|
+
color: "--cnvs-sys-color-text-strong";
|
|
26
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
27
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
28
|
+
lineHeight: "--cnvs-base-line-height-350";
|
|
29
|
+
fontSize: "--cnvs-base-font-size-300";
|
|
30
|
+
};
|
|
31
|
+
'heading.medium': {
|
|
32
|
+
color: "--cnvs-sys-color-text-strong";
|
|
33
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
34
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
35
|
+
lineHeight: "--cnvs-base-line-height-300";
|
|
36
|
+
fontSize: "--cnvs-base-font-size-250";
|
|
37
|
+
};
|
|
38
|
+
'heading.small': {
|
|
39
|
+
color: "--cnvs-sys-color-text-strong";
|
|
40
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
41
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
42
|
+
lineHeight: "--cnvs-base-line-height-250";
|
|
43
|
+
fontSize: "--cnvs-base-font-size-200";
|
|
44
|
+
};
|
|
45
|
+
'body.large': {
|
|
46
|
+
color: "--cnvs-sys-color-text-default";
|
|
47
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
48
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
49
|
+
lineHeight: "--cnvs-base-line-height-200";
|
|
50
|
+
fontSize: "--cnvs-base-font-size-150";
|
|
51
|
+
};
|
|
52
|
+
'body.medium': {
|
|
53
|
+
color: "--cnvs-sys-color-text-default";
|
|
54
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
55
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
56
|
+
lineHeight: "--cnvs-base-line-height-200";
|
|
57
|
+
fontSize: "--cnvs-base-font-size-125";
|
|
58
|
+
};
|
|
59
|
+
'body.small': {
|
|
60
|
+
color: "--cnvs-sys-color-text-default";
|
|
61
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
62
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
63
|
+
lineHeight: "--cnvs-base-line-height-150";
|
|
64
|
+
fontSize: "--cnvs-base-font-size-100";
|
|
65
|
+
letterSpacing: "--cnvs-base-letter-spacing-200";
|
|
66
|
+
};
|
|
67
|
+
'subtext.large': {
|
|
68
|
+
color: "--cnvs-sys-color-text-default";
|
|
69
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
70
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
71
|
+
lineHeight: "--cnvs-base-line-height-100";
|
|
72
|
+
fontSize: "--cnvs-base-font-size-75";
|
|
73
|
+
letterSpacing: "--cnvs-base-letter-spacing-150";
|
|
74
|
+
};
|
|
75
|
+
'subtext.medium': {
|
|
76
|
+
color: "--cnvs-sys-color-text-default";
|
|
77
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
78
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
79
|
+
lineHeight: "--cnvs-base-line-height-50";
|
|
80
|
+
fontSize: "--cnvs-base-font-size-50";
|
|
81
|
+
letterSpacing: "--cnvs-base-letter-spacing-100";
|
|
82
|
+
};
|
|
83
|
+
'subtext.small': {
|
|
84
|
+
color: "--cnvs-sys-color-text-default";
|
|
85
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
86
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
87
|
+
lineHeight: "--cnvs-base-line-height-50";
|
|
88
|
+
fontSize: "--cnvs-base-font-size-25";
|
|
89
|
+
letterSpacing: "--cnvs-base-letter-spacing-50";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
variant: {
|
|
93
|
+
error: {
|
|
94
|
+
color: "--cnvs-sys-color-text-critical-default";
|
|
95
|
+
};
|
|
96
|
+
hint: {
|
|
97
|
+
color: "--cnvs-sys-color-text-hint";
|
|
98
|
+
};
|
|
99
|
+
inverse: {
|
|
100
|
+
color: "--cnvs-sys-color-text-inverse";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}, {}, never, never>, never>;
|
|
104
|
+
export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", import("@workday/canvas-kit-react/text").TextProps, {
|
|
2
105
|
state: {
|
|
3
106
|
id: string;
|
|
4
107
|
error: "alert" | "error" | undefined;
|
|
5
|
-
orientation: "horizontal" | "vertical";
|
|
6
108
|
isRequired: boolean;
|
|
7
109
|
};
|
|
8
110
|
events: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAY/B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;EAexB,CAAC"}
|
|
@@ -3,31 +3,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FormFieldHint = void 0;
|
|
6
|
+
exports.FormFieldHint = exports.formFieldHintStencil = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
10
10
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
11
|
-
const hooks_1 = require("./hooks");
|
|
12
11
|
const text_1 = require("@workday/canvas-kit-react/text");
|
|
13
12
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const hooks_1 = require("./hooks");
|
|
14
|
+
const formFieldStencil_1 = require("./formFieldStencil");
|
|
15
|
+
exports.formFieldHintStencil = canvas_kit_styling_1.createStencil({
|
|
16
|
+
extends: text_1.textStencil,
|
|
17
|
+
base: { name: "5bd110", styles: "box-sizing:border-box;margin:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-zero) var(--cnvs-sys-space-zero);.maf76bf :where(&){color:var(--cnvs-brand-error-base);}" },
|
|
18
|
+
defaultModifiers: {
|
|
19
|
+
typeLevel: 'subtext.medium',
|
|
21
20
|
}
|
|
22
|
-
}, "form-field-hint-
|
|
21
|
+
}, "form-field-hint-7fbdaa");
|
|
23
22
|
exports.FormFieldHint = common_1.createSubcomponent('p')({
|
|
24
23
|
displayName: 'FormField.Hint',
|
|
25
24
|
modelHook: hooks_1.useFormFieldModel,
|
|
26
25
|
elemPropsHook: hooks_1.useFormFieldHint,
|
|
27
|
-
})(({ children, ...elemProps }, Element
|
|
26
|
+
})(({ children, typeLevel, variant, ...elemProps }, Element) => {
|
|
28
27
|
if (!children) {
|
|
29
28
|
// If there is no hint text just skip rendering
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
32
|
-
return (react_1.default.createElement(
|
|
31
|
+
return (react_1.default.createElement(Element, Object.assign({}, layout_1.mergeStyles(elemProps, exports.formFieldHintStencil({ typeLevel, variant }))), children));
|
|
33
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldInput.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldInput.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"FormFieldInput.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldInput.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;;;;;;;EAMzB,CAAC"}
|
|
@@ -1,23 +1,120 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Text } from '@workday/canvas-kit-react/text';
|
|
4
|
+
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
5
|
+
export interface FormFieldLabelProps extends FlexProps, Omit<ExtractProps<typeof Text, never>, 'display'> {
|
|
3
6
|
/**
|
|
4
7
|
* The text of the label.
|
|
5
8
|
*/
|
|
6
9
|
children: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Will style the text as disabled
|
|
9
|
-
*/
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Changes the color of the text
|
|
13
|
-
*/
|
|
14
|
-
variant?: 'error' | 'hint' | 'inverse';
|
|
15
10
|
}
|
|
11
|
+
export declare const formFieldLabelStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, import("@workday/canvas-kit-styling").Stencil<{
|
|
12
|
+
typeLevel: {
|
|
13
|
+
'title.large': {
|
|
14
|
+
color: "--cnvs-sys-color-text-strong";
|
|
15
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
16
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
17
|
+
lineHeight: "--cnvs-base-line-height-600";
|
|
18
|
+
fontSize: "--cnvs-base-font-size-600";
|
|
19
|
+
};
|
|
20
|
+
'title.medium': {
|
|
21
|
+
color: "--cnvs-sys-color-text-strong";
|
|
22
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
23
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
24
|
+
lineHeight: "--cnvs-base-line-height-500";
|
|
25
|
+
fontSize: "--cnvs-base-font-size-500";
|
|
26
|
+
};
|
|
27
|
+
'title.small': {
|
|
28
|
+
color: "--cnvs-sys-color-text-strong";
|
|
29
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
30
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
31
|
+
lineHeight: "--cnvs-base-line-height-400";
|
|
32
|
+
fontSize: "--cnvs-base-font-size-400";
|
|
33
|
+
};
|
|
34
|
+
'heading.large': {
|
|
35
|
+
color: "--cnvs-sys-color-text-strong";
|
|
36
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
37
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
38
|
+
lineHeight: "--cnvs-base-line-height-350";
|
|
39
|
+
fontSize: "--cnvs-base-font-size-300";
|
|
40
|
+
};
|
|
41
|
+
'heading.medium': {
|
|
42
|
+
color: "--cnvs-sys-color-text-strong";
|
|
43
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
44
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
45
|
+
lineHeight: "--cnvs-base-line-height-300";
|
|
46
|
+
fontSize: "--cnvs-base-font-size-250";
|
|
47
|
+
};
|
|
48
|
+
'heading.small': {
|
|
49
|
+
color: "--cnvs-sys-color-text-strong";
|
|
50
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
51
|
+
fontWeight: "--cnvs-base-font-weight-700";
|
|
52
|
+
lineHeight: "--cnvs-base-line-height-250";
|
|
53
|
+
fontSize: "--cnvs-base-font-size-200";
|
|
54
|
+
};
|
|
55
|
+
'body.large': {
|
|
56
|
+
color: "--cnvs-sys-color-text-default";
|
|
57
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
58
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
59
|
+
lineHeight: "--cnvs-base-line-height-200";
|
|
60
|
+
fontSize: "--cnvs-base-font-size-150";
|
|
61
|
+
};
|
|
62
|
+
'body.medium': {
|
|
63
|
+
color: "--cnvs-sys-color-text-default";
|
|
64
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
65
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
66
|
+
lineHeight: "--cnvs-base-line-height-200";
|
|
67
|
+
fontSize: "--cnvs-base-font-size-125";
|
|
68
|
+
};
|
|
69
|
+
'body.small': {
|
|
70
|
+
color: "--cnvs-sys-color-text-default";
|
|
71
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
72
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
73
|
+
lineHeight: "--cnvs-base-line-height-150";
|
|
74
|
+
fontSize: "--cnvs-base-font-size-100";
|
|
75
|
+
letterSpacing: "--cnvs-base-letter-spacing-200";
|
|
76
|
+
};
|
|
77
|
+
'subtext.large': {
|
|
78
|
+
color: "--cnvs-sys-color-text-default";
|
|
79
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
80
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
81
|
+
lineHeight: "--cnvs-base-line-height-100";
|
|
82
|
+
fontSize: "--cnvs-base-font-size-75";
|
|
83
|
+
letterSpacing: "--cnvs-base-letter-spacing-150";
|
|
84
|
+
};
|
|
85
|
+
'subtext.medium': {
|
|
86
|
+
color: "--cnvs-sys-color-text-default";
|
|
87
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
88
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
89
|
+
lineHeight: "--cnvs-base-line-height-50";
|
|
90
|
+
fontSize: "--cnvs-base-font-size-50";
|
|
91
|
+
letterSpacing: "--cnvs-base-letter-spacing-100";
|
|
92
|
+
};
|
|
93
|
+
'subtext.small': {
|
|
94
|
+
color: "--cnvs-sys-color-text-default";
|
|
95
|
+
fontFamily: "--cnvs-base-font-family-50";
|
|
96
|
+
fontWeight: "--cnvs-base-font-weight-400";
|
|
97
|
+
lineHeight: "--cnvs-base-line-height-50";
|
|
98
|
+
fontSize: "--cnvs-base-font-size-25";
|
|
99
|
+
letterSpacing: "--cnvs-base-letter-spacing-50";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
variant: {
|
|
103
|
+
error: {
|
|
104
|
+
color: "--cnvs-sys-color-text-critical-default";
|
|
105
|
+
};
|
|
106
|
+
hint: {
|
|
107
|
+
color: "--cnvs-sys-color-text-hint";
|
|
108
|
+
};
|
|
109
|
+
inverse: {
|
|
110
|
+
color: "--cnvs-sys-color-text-inverse";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}, {}, never, never>, never>;
|
|
16
114
|
export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponentM<"label", FormFieldLabelProps, {
|
|
17
115
|
state: {
|
|
18
116
|
id: string;
|
|
19
117
|
error: "alert" | "error" | undefined;
|
|
20
|
-
orientation: "horizontal" | "vertical";
|
|
21
118
|
isRequired: boolean;
|
|
22
119
|
};
|
|
23
120
|
events: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAqB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAC,IAAI,EAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,SAAS,EAAc,MAAM,kCAAkC,CAAC;AAMxE,MAAM,WAAW,mBACf,SAAQ,SAAS,EACf,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IACnD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAoChC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;EAUzB,CAAC"}
|
|
@@ -3,47 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FormFieldLabel = void 0;
|
|
6
|
+
exports.FormFieldLabel = exports.formFieldLabelStencil = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
-
const hooks_1 = require("./hooks");
|
|
10
9
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
10
|
+
const text_1 = require("@workday/canvas-kit-react/text");
|
|
11
11
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
12
12
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
variant: {
|
|
24
|
-
error: { name: "3296af", styles: "color:var(--cnvs-sys-color-text-critical-default);" },
|
|
25
|
-
hint: { name: "d58a54", styles: "color:var(--cnvs-sys-color-text-hint);" },
|
|
26
|
-
inverse: { name: "447f36", styles: "color:var(--cnvs-sys-color-text-inverse);" }
|
|
27
|
-
},
|
|
28
|
-
disabled: {
|
|
29
|
-
true: { name: "269a41", styles: "cursor:default;color:var(--cnvs-sys-color-text-disabled);" }
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
compound: [
|
|
33
|
-
{
|
|
34
|
-
modifiers: { variant: 'inverse', disabled: true },
|
|
35
|
-
styles: { name: "a1f92a", styles: "opacity:var(--cnvs-sys-opacity-disabled);color:var(--cnvs-sys-color-text-inverse);" }
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}, "form-field-label-4d554f");
|
|
13
|
+
const hooks_1 = require("./hooks");
|
|
14
|
+
const formFieldStencil_1 = require("./formFieldStencil");
|
|
15
|
+
exports.formFieldLabelStencil = canvas_kit_styling_1.createStencil({
|
|
16
|
+
extends: text_1.textStencil,
|
|
17
|
+
// @ts-ignore Still weird about CSS variables
|
|
18
|
+
base: { name: "925c8d", styles: "box-sizing:border-box;font-weight:var(--cnvs-sys-font-weight-medium);color:var(--cnvs-sys-color-text-default);padding-inline-start:var(--cnvs-sys-space-zero);margin-bottom:var(--cnvs-sys-space-x1);display:flex;align-items:center;min-width:11.25rem;.mea419a :where(&){&::after{content:\"*\";font-size:var(--cnvs-sys-font-size-body-large);font-weight:var(--cnvs-sys-font-weight-normal);color:var(--cnvs-brand-error-base);text-decoration:unset;margin-inline-start:var(--cnvs-sys-space-x1);}}.m33728f :where(&){float:left;max-height:var(--cnvs-sys-space-x10);}.m185604 :where(&){width:100%;}" },
|
|
19
|
+
defaultModifiers: {
|
|
20
|
+
typeLevel: 'subtext.large',
|
|
21
|
+
}
|
|
22
|
+
}, "form-field-label-b9c77f");
|
|
39
23
|
exports.FormFieldLabel = common_1.createSubcomponent('label')({
|
|
40
24
|
displayName: 'FormField.Label',
|
|
41
25
|
modelHook: hooks_1.useFormFieldModel,
|
|
42
26
|
elemPropsHook: hooks_1.useFormFieldLabel,
|
|
43
|
-
})(({ children,
|
|
44
|
-
return (react_1.default.createElement(Element, Object.assign({}, layout_1.mergeStyles(elemProps,
|
|
45
|
-
formFieldLabelStencil({ orientation: model.state.orientation, disabled, variant }),
|
|
46
|
-
])),
|
|
47
|
-
children,
|
|
48
|
-
model.state.isRequired && (react_1.default.createElement("span", Object.assign({ "aria-hidden": "true" }, formFieldLabelAsteriskStencil()), "*"))));
|
|
27
|
+
})(({ children, typeLevel, variant, ...elemProps }, Element) => {
|
|
28
|
+
return (react_1.default.createElement(Element, Object.assign({}, layout_1.mergeStyles(elemProps, exports.formFieldLabelStencil({ typeLevel, variant }))), children));
|
|
49
29
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const formFieldStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
2
|
+
grow: {
|
|
3
|
+
true: {
|
|
4
|
+
width: string;
|
|
5
|
+
'[data-width="ck-formfield-width"]': {
|
|
6
|
+
width: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal: {
|
|
12
|
+
flexDirection: "row";
|
|
13
|
+
gap: "--cnvs-sys-space-x8";
|
|
14
|
+
};
|
|
15
|
+
vertical: {
|
|
16
|
+
flexDirection: "column";
|
|
17
|
+
gap: "--cnvs-sys-space-x1";
|
|
18
|
+
alignItems: "flex-start";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: {
|
|
22
|
+
true: {};
|
|
23
|
+
};
|
|
24
|
+
error: {
|
|
25
|
+
error: {};
|
|
26
|
+
alert: {};
|
|
27
|
+
};
|
|
28
|
+
}, {}, never, never>;
|
|
29
|
+
//# sourceMappingURL=formFieldStencil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formFieldStencil.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/formFieldStencil.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsC3B,CAAC"}
|