@workday/canvas-kit-preview-react 5.3.15 → 5.4.0-next.1
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/breadcrumbs/lib/Breadcrumbs/List/hooks.ts +5 -5
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.js +4 -4
- package/dist/commonjs/form-field/index.d.ts +3 -0
- package/dist/commonjs/form-field/index.d.ts.map +1 -0
- package/dist/commonjs/form-field/index.js +7 -0
- package/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/FormField.js +51 -0
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/FormFieldHint.js +45 -0
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/FormFieldInput.js +41 -0
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +51 -0
- package/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
- package/dist/commonjs/form-field/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/index.js +10 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +13 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +16 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +13 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +21 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +24 -0
- package/dist/commonjs/index.d.ts +3 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +4 -0
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +1 -2
- package/dist/commonjs/menu/lib/MenuItem.js +1 -1
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +2 -3
- package/dist/commonjs/select/lib/SelectBase.d.ts +20 -1
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectBase.js +6 -4
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +0 -1
- package/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
- package/dist/commonjs/text-area/index.d.ts +2 -0
- package/dist/commonjs/text-area/index.d.ts.map +1 -0
- package/dist/commonjs/text-area/index.js +6 -0
- package/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/TextArea.js +52 -0
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/TextAreaField.js +65 -0
- package/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
- package/dist/commonjs/text-area/lib/TextAreaHint.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/TextAreaHint.js +4 -0
- package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
- package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/TextAreaLabel.js +4 -0
- package/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
- package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/hooks/index.js +6 -0
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +4 -0
- package/dist/commonjs/text-input/index.d.ts +3 -0
- package/dist/commonjs/text-input/index.d.ts.map +1 -0
- package/dist/commonjs/text-input/index.js +7 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInput.js +52 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputField.js +67 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputHint.js +4 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.js +4 -0
- package/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
- package/dist/commonjs/text-input/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/index.js +7 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +11 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +4 -0
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.js +4 -4
- package/dist/es6/form-field/index.d.ts +3 -0
- package/dist/es6/form-field/index.d.ts.map +1 -0
- package/dist/es6/form-field/index.js +2 -0
- package/dist/es6/form-field/lib/FormField.d.ts +31 -0
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -0
- package/dist/es6/form-field/lib/FormField.js +46 -0
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
- package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -0
- package/dist/es6/form-field/lib/FormFieldHint.js +43 -0
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
- package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +1 -0
- package/dist/es6/form-field/lib/FormFieldInput.js +36 -0
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -0
- package/dist/es6/form-field/lib/FormFieldLabel.js +49 -0
- package/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
- package/dist/es6/form-field/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/index.js +5 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +11 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +14 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +11 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +19 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +22 -0
- package/dist/es6/index.d.ts +3 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +4 -0
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +2 -3
- package/dist/es6/menu/lib/MenuItem.js +1 -1
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +3 -4
- package/dist/es6/select/lib/SelectBase.d.ts +20 -1
- package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectBase.js +6 -4
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +0 -1
- package/dist/es6/side-panel/lib/hooks.d.ts +7 -7
- package/dist/es6/text-area/index.d.ts +2 -0
- package/dist/es6/text-area/index.d.ts.map +1 -0
- package/dist/es6/text-area/index.js +1 -0
- package/dist/es6/text-area/lib/TextArea.d.ts +22 -0
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -0
- package/dist/es6/text-area/lib/TextArea.js +47 -0
- package/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -0
- package/dist/es6/text-area/lib/TextAreaField.js +63 -0
- package/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
- package/dist/es6/text-area/lib/TextAreaHint.d.ts.map +1 -0
- package/dist/es6/text-area/lib/TextAreaHint.js +2 -0
- package/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
- package/dist/es6/text-area/lib/TextAreaLabel.d.ts.map +1 -0
- package/dist/es6/text-area/lib/TextAreaLabel.js +2 -0
- package/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
- package/dist/es6/text-area/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/text-area/lib/hooks/index.js +1 -0
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +2 -0
- package/dist/es6/text-input/index.d.ts +3 -0
- package/dist/es6/text-input/index.d.ts.map +1 -0
- package/dist/es6/text-input/index.js +2 -0
- package/dist/es6/text-input/lib/TextInput.d.ts +22 -0
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInput.js +47 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputField.js +65 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputHint.js +2 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputLabel.js +2 -0
- package/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
- package/dist/es6/text-input/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/index.js +2 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.js +9 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -0
- package/form-field/LICENSE +52 -0
- package/form-field/README.md +8 -0
- package/form-field/index.ts +2 -0
- package/form-field/lib/FormField.tsx +58 -0
- package/form-field/lib/FormFieldHint.tsx +50 -0
- package/form-field/lib/FormFieldInput.tsx +21 -0
- package/form-field/lib/FormFieldLabel.tsx +64 -0
- package/form-field/lib/hooks/index.ts +5 -0
- package/form-field/lib/hooks/useFormFieldHint.tsx +12 -0
- package/form-field/lib/hooks/useFormFieldInput.tsx +15 -0
- package/form-field/lib/hooks/useFormFieldLabel.tsx +12 -0
- package/form-field/lib/hooks/useFormFieldModel.tsx +62 -0
- package/form-field/lib/hooks/useFormFieldOrientation.tsx +29 -0
- package/form-field/package.json +5 -0
- package/index.ts +5 -0
- package/menu/lib/Menu.tsx +3 -3
- package/menu/lib/MenuItem.tsx +1 -1
- package/package.json +7 -7
- package/select/lib/Select.tsx +9 -4
- package/select/lib/SelectBase.tsx +27 -3
- package/side-panel/lib/SidePanel.tsx +0 -1
- package/side-panel/lib/hooks.ts +7 -7
- package/text-area/LICENSE +52 -0
- package/text-area/README.md +7 -0
- package/text-area/index.ts +1 -0
- package/text-area/lib/TextArea.tsx +47 -0
- package/text-area/lib/TextAreaField.tsx +87 -0
- package/text-area/lib/TextAreaHint.tsx +6 -0
- package/text-area/lib/TextAreaLabel.tsx +6 -0
- package/text-area/lib/hooks/index.ts +1 -0
- package/text-area/lib/hooks/useTextAreaModel.ts +5 -0
- package/text-area/package.json +5 -0
- package/text-input/LICENSE +52 -0
- package/text-input/README.md +7 -0
- package/text-input/index.ts +2 -0
- package/text-input/lib/TextInput.tsx +47 -0
- package/text-input/lib/TextInputField.tsx +86 -0
- package/text-input/lib/TextInputHint.tsx +6 -0
- package/text-input/lib/TextInputLabel.tsx +6 -0
- package/text-input/lib/hooks/index.ts +2 -0
- package/text-input/lib/hooks/useTextInputField.tsx +10 -0
- package/text-input/lib/hooks/useTextInputModel.ts +5 -0
- package/text-input/package.json +5 -0
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
- package/ts3.5/dist/commonjs/form-field/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
- package/ts3.5/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
- package/ts3.5/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
- package/ts3.5/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
- package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
- package/ts3.5/dist/commonjs/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/select/lib/SelectBase.d.ts +20 -1
- package/ts3.5/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
- package/ts3.5/dist/commonjs/text-area/index.d.ts +2 -0
- package/ts3.5/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
- package/ts3.5/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
- package/ts3.5/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
- package/ts3.5/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
- package/ts3.5/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
- package/ts3.5/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
- package/ts3.5/dist/commonjs/text-input/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
- package/ts3.5/dist/es6/form-field/index.d.ts +3 -0
- package/ts3.5/dist/es6/form-field/lib/FormField.d.ts +31 -0
- package/ts3.5/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
- package/ts3.5/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
- package/ts3.5/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
- package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
- package/ts3.5/dist/es6/index.d.ts +3 -0
- package/ts3.5/dist/es6/select/lib/SelectBase.d.ts +20 -1
- package/ts3.5/dist/es6/side-panel/lib/hooks.d.ts +7 -7
- package/ts3.5/dist/es6/text-area/index.d.ts +2 -0
- package/ts3.5/dist/es6/text-area/lib/TextArea.d.ts +22 -0
- package/ts3.5/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
- package/ts3.5/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
- package/ts3.5/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
- package/ts3.5/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
- package/ts3.5/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
- package/ts3.5/dist/es6/text-input/index.d.ts +3 -0
- package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +22 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
/** @jsx jsx */
|
|
26
|
+
var core_1 = require("@emotion/core");
|
|
27
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
28
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
29
|
+
var common_2 = require("@workday/canvas-kit-labs-react/common");
|
|
30
|
+
var form_field_1 = require("@workday/canvas-kit-preview-react/form-field");
|
|
31
|
+
var TextInput_1 = require("./TextInput");
|
|
32
|
+
var hooks_1 = require("./hooks");
|
|
33
|
+
var baseStyles = __assign(__assign({}, tokens_1.type.levels.subtext.large), { transition: '0.2s box-shadow, 0.2s border-color', '&::placeholder': {
|
|
34
|
+
color: tokens_1.inputColors.placeholder,
|
|
35
|
+
}, '&:hover': {
|
|
36
|
+
borderColor: tokens_1.inputColors.hoverBorder,
|
|
37
|
+
}, '&:focus:not([disabled])': {
|
|
38
|
+
outline: 'none',
|
|
39
|
+
}, '&:disabled': {
|
|
40
|
+
backgroundColor: tokens_1.inputColors.disabled.background,
|
|
41
|
+
borderColor: tokens_1.inputColors.disabled.border,
|
|
42
|
+
color: tokens_1.inputColors.disabled.text,
|
|
43
|
+
'&::placeholder': {
|
|
44
|
+
color: tokens_1.inputColors.disabled.text,
|
|
45
|
+
},
|
|
46
|
+
}, '::-ms-clear': {
|
|
47
|
+
display: 'none',
|
|
48
|
+
} });
|
|
49
|
+
exports.TextInputField = common_1.createComponent('input')({
|
|
50
|
+
displayName: 'TextInput.Field',
|
|
51
|
+
Component: function (_a, ref) {
|
|
52
|
+
var model = _a.model, elemProps = __rest(_a, ["model"]);
|
|
53
|
+
var localModel = common_1.useModelContext(TextInput_1.TextInputModelContext, model);
|
|
54
|
+
var props = hooks_1.useTextInputField(localModel, elemProps, ref);
|
|
55
|
+
var theme = common_1.useTheme();
|
|
56
|
+
var errorRing = common_2.useThemedRing('error');
|
|
57
|
+
var focusStyles = localModel.state.hasError
|
|
58
|
+
? errorRing
|
|
59
|
+
: {
|
|
60
|
+
'&:focus:not([disabled])': {
|
|
61
|
+
borderColor: theme.canvas.palette.common.focusOutline,
|
|
62
|
+
boxShadow: "inset 0 0 0 1px " + theme.canvas.palette.common.focusOutline,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
return (core_1.jsx(form_field_1.FormField.Input, __assign({ as: "input", css: [baseStyles, focusStyles], padding: tokens_1.space.xxs, margin: 0, display: "block", height: "40px", minWidth: "280px", border: "1px solid " + tokens_1.inputColors.border, backgroundColor: tokens_1.inputColors.background, borderRadius: tokens_1.borderRadius.m }, props)));
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { FormField } from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
+
export declare type TextInputHintProps = ExtractProps<typeof FormField.Hint, never>;
|
|
4
|
+
export declare const TextInputHint: import("@workday/canvas-kit-react/common").ElementComponent<"p", import("../../form-field/lib/FormFieldHint").FormFieldHintProps>;
|
|
5
|
+
//# sourceMappingURL=TextInputHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputHint.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputHint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,SAAS,EAAC,MAAM,8CAA8C,CAAC;AAEvE,oBAAY,kBAAkB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAE5E,eAAO,MAAM,aAAa,mIAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { FormField } from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
+
export declare type TextInputLabelProps = ExtractProps<typeof FormField.Label, never>;
|
|
4
|
+
export declare const TextInputLabel: import("@workday/canvas-kit-react/common").ElementComponent<"label", import("../../form-field/lib/FormFieldLabel").FormFieldLabelProps>;
|
|
5
|
+
//# sourceMappingURL=TextInputLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputLabel.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,SAAS,EAAC,MAAM,8CAA8C,CAAC;AAEvE,oBAAY,mBAAmB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE9E,eAAO,MAAM,cAAc,yIAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to a `Field` component. Used by the TextInput.Field subcomponent.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useTextInputField: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<any, any>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
|
|
6
|
+
type: string;
|
|
7
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
8
|
+
ref: import("react").Ref<R>;
|
|
9
|
+
} : {});
|
|
10
|
+
//# sourceMappingURL=useTextInputField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTextInputField.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputField.tsx"],"names":[],"mappings":";AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;OAI5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
4
|
+
/**
|
|
5
|
+
* Adds the necessary props to a `Field` component. Used by the TextInput.Field subcomponent.
|
|
6
|
+
*/
|
|
7
|
+
exports.useTextInputField = common_1.createHook(function () {
|
|
8
|
+
return {
|
|
9
|
+
type: 'text',
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormFieldModel } from '@workday/canvas-kit-preview-react/form-field';
|
|
2
|
+
export declare const useTextInputModel: (config?: import("../../../form-field").FormFieldModelConfig) => import("@workday/canvas-kit-react/common").Model<{
|
|
3
|
+
hasError?: boolean | undefined;
|
|
4
|
+
id?: string | undefined;
|
|
5
|
+
isRequired?: boolean | undefined;
|
|
6
|
+
}, {}>;
|
|
7
|
+
export declare type TextInputModel = FormFieldModel;
|
|
8
|
+
//# sourceMappingURL=useTextInputModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTextInputModel.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,cAAc,EAAC,MAAM,8CAA8C,CAAC;AAE/F,eAAO,MAAM,iBAAiB;;;;MAAoB,CAAC;AAEnD,oBAAY,cAAc,GAAG,cAAc,CAAC"}
|
|
@@ -9,7 +9,7 @@ export declare const useBuildCollapsedList: <E extends HTMLElement>(listEl: Reac
|
|
|
9
9
|
};
|
|
10
10
|
export declare const useTruncateTooltip: (ref?: React.RefObject<HTMLSpanElement> | undefined) => {
|
|
11
11
|
isTooltipOpen: boolean;
|
|
12
|
-
openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element>) => void;
|
|
12
|
+
openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element, Element>) => void;
|
|
13
13
|
closeTooltip: () => void;
|
|
14
14
|
shouldShowTooltip: boolean;
|
|
15
15
|
tooltipProps: {
|
|
@@ -12,7 +12,7 @@ export var useCollapse = function (listEl, maxWidth) {
|
|
|
12
12
|
};
|
|
13
13
|
var getBreadcrumbLink = function (breadcrumb) {
|
|
14
14
|
return Children.toArray(breadcrumb.props.children).filter(function (child) {
|
|
15
|
-
return child.type === BreadcrumbLink;
|
|
15
|
+
return React.isValidElement(child) && child.type === BreadcrumbLink;
|
|
16
16
|
})[0];
|
|
17
17
|
};
|
|
18
18
|
var buildCollapsedList = function (list, containerWidth, maxWidth, collapsedList) {
|
|
@@ -42,7 +42,7 @@ export var useBuildCollapsedList = function (listEl, children, maxWidth) {
|
|
|
42
42
|
var breadcrumbLink = getBreadcrumbLink(child);
|
|
43
43
|
// We should make this match work better
|
|
44
44
|
var listItemNode = listItemNodes[index];
|
|
45
|
-
// We might need to allow folks to
|
|
45
|
+
// We might need to allow folks to spread more props from the link
|
|
46
46
|
listItems.push({
|
|
47
47
|
index: index,
|
|
48
48
|
link: ((_a = breadcrumbLink === null || breadcrumbLink === void 0 ? void 0 : breadcrumbLink.props) === null || _a === void 0 ? void 0 : _a.href) || '',
|
|
@@ -53,8 +53,8 @@ export var useBuildCollapsedList = function (listEl, children, maxWidth) {
|
|
|
53
53
|
});
|
|
54
54
|
// don't collapse the root breadcrumb
|
|
55
55
|
var collapsibleListItems = listItems.slice(1);
|
|
56
|
-
var
|
|
57
|
-
setCollapsedItems(
|
|
56
|
+
var collapsedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
|
|
57
|
+
setCollapsedItems(collapsedList);
|
|
58
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
59
|
}, [maxWidth]);
|
|
60
60
|
var collapsedItemIndices = collapsedItems.map(function (child) { return child.index; });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../form-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Stack, StackSpacing } from '@workday/canvas-kit-labs-react/layout';
|
|
4
|
+
import { FormFieldModel, FormFieldModelConfig } from './hooks';
|
|
5
|
+
export declare const FormFieldModelContext: React.Context<import("@workday/canvas-kit-react/common").Model<{
|
|
6
|
+
hasError?: boolean | undefined;
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
isRequired?: boolean | undefined;
|
|
9
|
+
}, {}>>;
|
|
10
|
+
export interface FormFieldProps extends FormFieldModelConfig, Omit<ExtractProps<typeof Stack, never>, 'spacing'> {
|
|
11
|
+
model?: FormFieldModel;
|
|
12
|
+
/**
|
|
13
|
+
* Children of the Text Input. Should contain a `<FormField.Input>`, a `<FormField.Label>` and an optional `<FormField.Hint>`
|
|
14
|
+
*/
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The direction the child elements should stack
|
|
18
|
+
*/
|
|
19
|
+
orientation: 'vertical' | 'horizontal';
|
|
20
|
+
/**
|
|
21
|
+
* Spacing between children elements
|
|
22
|
+
* @default xxxs when vertical l when orientation is horizontal
|
|
23
|
+
*/
|
|
24
|
+
spacing?: StackSpacing;
|
|
25
|
+
}
|
|
26
|
+
export declare const FormField: import("@workday/canvas-kit-react/common").Component<FormFieldProps> & {
|
|
27
|
+
Input: import("@workday/canvas-kit-react/common").ElementComponent<"input", import("./FormFieldInput").FormFieldInputProps>;
|
|
28
|
+
Label: import("@workday/canvas-kit-react/common").ElementComponent<"label", import("./FormFieldLabel").FormFieldLabelProps>;
|
|
29
|
+
Hint: import("@workday/canvas-kit-react/common").ElementComponent<"p", import("./FormFieldHint").FormFieldHintProps>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=FormField.d.ts.map
|
|
@@ -0,0 +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,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAEL,cAAc,EACd,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,qBAAqB;;;;OAAiD,CAAC;AAEpF,MAAM,WAAW,cACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IACpD,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,SAAS;;;;CAqBpB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createComponent, useDefaultModel } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Stack } from '@workday/canvas-kit-labs-react/layout';
|
|
26
|
+
import { useFormFieldModel, useFormFieldOrientation, } from './hooks';
|
|
27
|
+
import { FormFieldInput } from './FormFieldInput';
|
|
28
|
+
import { FormFieldLabel } from './FormFieldLabel';
|
|
29
|
+
import { FormFieldHint } from './FormFieldHint';
|
|
30
|
+
export var FormFieldModelContext = React.createContext({});
|
|
31
|
+
export var FormField = createComponent()({
|
|
32
|
+
displayName: 'FormField',
|
|
33
|
+
Component: function (_a, ref) {
|
|
34
|
+
var children = _a.children, model = _a.model, spacing = _a.spacing, orientation = _a.orientation, props = __rest(_a, ["children", "model", "spacing", "orientation"]);
|
|
35
|
+
var hasError = props.hasError, id = props.id, isRequired = props.isRequired, elemProps = __rest(props, ["hasError", "id", "isRequired"]);
|
|
36
|
+
var value = useDefaultModel(model, { hasError: hasError, id: id, isRequired: isRequired }, useFormFieldModel);
|
|
37
|
+
var layoutProps = useFormFieldOrientation(orientation);
|
|
38
|
+
return (React.createElement(FormFieldModelContext.Provider, { value: value },
|
|
39
|
+
React.createElement(Stack, __assign({ ref: ref }, layoutProps, elemProps), children)));
|
|
40
|
+
},
|
|
41
|
+
subComponents: {
|
|
42
|
+
Input: FormFieldInput,
|
|
43
|
+
Label: FormFieldLabel,
|
|
44
|
+
Hint: FormFieldHint,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Box } from '@workday/canvas-kit-labs-react/common';
|
|
4
|
+
import { FormFieldModel } from './hooks';
|
|
5
|
+
export interface FormFieldHintProps extends ExtractProps<typeof Box, never> {
|
|
6
|
+
model?: FormFieldModel;
|
|
7
|
+
/**
|
|
8
|
+
* Hint text to show to the user regarding the Error/Alert
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponent<"p", FormFieldHintProps>;
|
|
13
|
+
//# sourceMappingURL=FormFieldHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,GAAG,EAAC,MAAM,uCAAuC,CAAC;AAG1D,OAAO,EAAC,cAAc,EAAmB,MAAM,SAAS,CAAC;AAEzD,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IACzE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,sFAyBxB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/** @jsx jsx */
|
|
24
|
+
import { jsx } from '@emotion/core';
|
|
25
|
+
import { createComponent, useModelContext, useTheme, } from '@workday/canvas-kit-react/common';
|
|
26
|
+
import { type } from '@workday/canvas-kit-react/tokens';
|
|
27
|
+
import { Box } from '@workday/canvas-kit-labs-react/common';
|
|
28
|
+
import { FormFieldModelContext } from './FormField';
|
|
29
|
+
import { useFormFieldHint } from './hooks';
|
|
30
|
+
export var FormFieldHint = createComponent('p')({
|
|
31
|
+
displayName: 'FormField.Hint',
|
|
32
|
+
Component: function (_a, ref, Element) {
|
|
33
|
+
var model = _a.model, children = _a.children, elemProps = __rest(_a, ["model", "children"]);
|
|
34
|
+
var localModel = useModelContext(FormFieldModelContext, model);
|
|
35
|
+
var props = useFormFieldHint(localModel, elemProps, ref);
|
|
36
|
+
var theme = useTheme();
|
|
37
|
+
if (!children) {
|
|
38
|
+
// If there is no hint text just skip rendering
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return (jsx(Box, __assign({ as: Element, css: __assign(__assign({}, type.levels.subtext.medium), { color: localModel.state.hasError ? theme.canvas.palette.error.main : undefined }) }, props), children));
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { Box } from '@workday/canvas-kit-labs-react/common';
|
|
3
|
+
import { FormFieldModel } from './hooks';
|
|
4
|
+
export interface FormFieldInputProps extends ExtractProps<typeof Box, never> {
|
|
5
|
+
model?: FormFieldModel;
|
|
6
|
+
}
|
|
7
|
+
export declare const FormFieldInput: import("@workday/canvas-kit-react/common").ElementComponent<"input", FormFieldInputProps>;
|
|
8
|
+
//# sourceMappingURL=FormFieldInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldInput.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,GAAG,EAAC,MAAM,uCAAuC,CAAC;AAG1D,OAAO,EAAC,cAAc,EAAoB,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IAC1E,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,2FAQzB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createComponent, useModelContext } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Box } from '@workday/canvas-kit-labs-react/common';
|
|
26
|
+
import { FormFieldModelContext } from './FormField';
|
|
27
|
+
import { useFormFieldInput } from './hooks';
|
|
28
|
+
export var FormFieldInput = createComponent('input')({
|
|
29
|
+
displayName: 'FormField.Input',
|
|
30
|
+
Component: function (_a, ref, Element) {
|
|
31
|
+
var model = _a.model, elemProps = __rest(_a, ["model"]);
|
|
32
|
+
var localModel = useModelContext(FormFieldModelContext, model);
|
|
33
|
+
var props = useFormFieldInput(localModel, elemProps, ref);
|
|
34
|
+
return React.createElement(Box, __assign({ as: Element }, props));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { HStack, StackSpacing } from '@workday/canvas-kit-labs-react/layout';
|
|
4
|
+
import { FormFieldModel } from './hooks';
|
|
5
|
+
export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, never>, 'spacing'> {
|
|
6
|
+
model?: FormFieldModel;
|
|
7
|
+
/**
|
|
8
|
+
* The text of the label.
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* When the input is required, this is spacing between label and asterisk.
|
|
13
|
+
* @default xxxs
|
|
14
|
+
*/
|
|
15
|
+
spacing?: StackSpacing;
|
|
16
|
+
}
|
|
17
|
+
export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponent<"label", FormFieldLabelProps>;
|
|
18
|
+
//# sourceMappingURL=FormFieldLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAG3E,OAAO,EAAC,cAAc,EAAoB,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAC9F,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAcD,eAAO,MAAM,cAAc,2FAqBzB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/** @jsx jsx */
|
|
24
|
+
import { jsx } from '@emotion/core';
|
|
25
|
+
import { createComponent, useModelContext, useTheme, } from '@workday/canvas-kit-react/common';
|
|
26
|
+
import { type } from '@workday/canvas-kit-react/tokens';
|
|
27
|
+
import { HStack } from '@workday/canvas-kit-labs-react/layout';
|
|
28
|
+
import { FormFieldModelContext } from './FormField';
|
|
29
|
+
import { useFormFieldLabel } from './hooks';
|
|
30
|
+
var styles = {
|
|
31
|
+
label: __assign(__assign({}, type.levels.subtext.large), { fontWeight: type.properties.fontWeights.medium }),
|
|
32
|
+
asterisk: {
|
|
33
|
+
fontSize: type.properties.fontSizes[16],
|
|
34
|
+
fontWeight: type.properties.fontWeights.regular,
|
|
35
|
+
textDecoration: 'unset',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export var FormFieldLabel = createComponent('label')({
|
|
39
|
+
displayName: 'FormField.Label',
|
|
40
|
+
Component: function (_a, ref) {
|
|
41
|
+
var _b = _a.spacing, spacing = _b === void 0 ? 'xxxs' : _b, model = _a.model, children = _a.children, elemProps = __rest(_a, ["spacing", "model", "children"]);
|
|
42
|
+
var localModel = useModelContext(FormFieldModelContext, model);
|
|
43
|
+
var props = useFormFieldLabel(localModel, elemProps, ref);
|
|
44
|
+
var theme = useTheme();
|
|
45
|
+
return (jsx(HStack, __assign({ as: "label", spacing: spacing, css: styles.label, minWidth: "180px" }, props),
|
|
46
|
+
jsx("span", null, children),
|
|
47
|
+
localModel.state.isRequired && (jsx("span", { css: [styles.asterisk, { color: theme.canvas.palette.error.main }], "aria-hidden": "true" }, "*"))));
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to a `Hint` component.
|
|
4
|
+
* Used by the FormField.Hint subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export declare const useFormFieldHint: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
|
|
7
|
+
hasError?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
isRequired?: boolean | undefined;
|
|
10
|
+
}, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
|
|
11
|
+
id: string;
|
|
12
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
13
|
+
ref: import("react").Ref<R>;
|
|
14
|
+
} : {});
|
|
15
|
+
//# sourceMappingURL=useFormFieldHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormFieldHint.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldHint.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;OAI3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createHook } from '@workday/canvas-kit-react/common';
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to a `Hint` component.
|
|
4
|
+
* Used by the FormField.Hint subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export var useFormFieldHint = createHook(function (_a) {
|
|
7
|
+
var state = _a.state;
|
|
8
|
+
return {
|
|
9
|
+
id: "hint-" + state.id,
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to an `Input` component.
|
|
4
|
+
* Used by the FormField.Input subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export declare const useFormFieldInput: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
|
|
7
|
+
hasError?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
isRequired?: boolean | undefined;
|
|
10
|
+
}, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
|
|
11
|
+
required: boolean | undefined;
|
|
12
|
+
'aria-invalid': boolean | undefined;
|
|
13
|
+
'aria-describedby': string;
|
|
14
|
+
id: string;
|
|
15
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
16
|
+
ref: import("react").Ref<R>;
|
|
17
|
+
} : {});
|
|
18
|
+
//# sourceMappingURL=useFormFieldInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormFieldInput.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldInput.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;OAO5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createHook } from '@workday/canvas-kit-react/common';
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to an `Input` component.
|
|
4
|
+
* Used by the FormField.Input subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export var useFormFieldInput = createHook(function (_a) {
|
|
7
|
+
var state = _a.state;
|
|
8
|
+
return {
|
|
9
|
+
required: state.isRequired ? true : undefined,
|
|
10
|
+
'aria-invalid': state.hasError ? true : undefined,
|
|
11
|
+
'aria-describedby': "hint-" + state.id,
|
|
12
|
+
id: "input-" + state.id,
|
|
13
|
+
};
|
|
14
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to a `Label` component.
|
|
4
|
+
* Used by the FormField.Label subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export declare const useFormFieldLabel: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
|
|
7
|
+
hasError?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
isRequired?: boolean | undefined;
|
|
10
|
+
}, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
|
|
11
|
+
htmlFor: string;
|
|
12
|
+
} & P & (R extends HTMLOrSVGElement ? {
|
|
13
|
+
ref: import("react").Ref<R>;
|
|
14
|
+
} : {});
|
|
15
|
+
//# sourceMappingURL=useFormFieldLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldLabel.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;OAI5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createHook } from '@workday/canvas-kit-react/common';
|
|
2
|
+
/**
|
|
3
|
+
* Adds the necessary props to a `Label` component.
|
|
4
|
+
* Used by the FormField.Label subcomponent and other input type components
|
|
5
|
+
*/
|
|
6
|
+
export var useFormFieldLabel = createHook(function (_a) {
|
|
7
|
+
var state = _a.state;
|
|
8
|
+
return {
|
|
9
|
+
htmlFor: "input-" + state.id,
|
|
10
|
+
};
|
|
11
|
+
});
|