@workday/canvas-kit-preview-react
Version:
Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.
32 lines (31 loc) • 1.54 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextInput = void 0;
const react_1 = __importDefault(require("react"));
const common_1 = require("@workday/canvas-kit-react/common");
const form_field_1 = require("@workday/canvas-kit-react/form-field");
const layout_1 = require("@workday/canvas-kit-react/layout");
const TextInputField_1 = require("./TextInputField");
/**
* @stencil formFieldStencil
* @deprecated ⚠️ `TextInput` in Preview 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--basic) instead.
*/
exports.TextInput = (0, common_1.createContainer)('div')({
displayName: 'TextInput',
modelHook: form_field_1.useFormFieldModel,
subComponents: {
Field: TextInputField_1.TextInputField,
Label: form_field_1.FormField.Label,
Hint: form_field_1.FormField.Hint,
},
})(({ children, orientation, grow, ...elemProps }, Element, model) => {
return (react_1.default.createElement(Element, { ...(0, layout_1.mergeStyles)(elemProps, (0, form_field_1.formFieldStencil)({
grow,
orientation: orientation === 'horizontal' ? 'horizontalStart' : orientation,
error: model.state.error,
required: model.state.isRequired,
})) }, children));
});
;