UNPKG

@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.

33 lines (32 loc) 1.61 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextArea = 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 TextAreaField_1 = require("./TextAreaField"); const text_input_1 = require("@workday/canvas-kit-preview-react/text-input"); /** * @stencil formFieldStencil * @deprecated ⚠️ `TextArea` 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.TextArea = (0, common_1.createContainer)('div')({ displayName: 'TextArea', modelHook: text_input_1.useTextInputModel, subComponents: { Field: TextAreaField_1.TextAreaField, Label: form_field_1.FormField.Label, Hint: form_field_1.FormField.Hint, }, })(({ children, grow, orientation, ...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)); });