UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

38 lines (37 loc) 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextArea = exports.textAreaStencil = exports.TextAreaResizeDirection = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const common_1 = require("@workday/canvas-kit-react/common"); const text_input_1 = require("@workday/canvas-kit-react/text-input"); const canvas_kit_styling_1 = require("@workday/canvas-kit-styling"); const canvas_tokens_web_1 = require("@workday/canvas-tokens-web"); exports.TextAreaResizeDirection = { None: 'none', Both: 'both', Horizontal: 'horizontal', Vertical: 'vertical', }; exports.textAreaStencil = (0, canvas_kit_styling_1.createStencil)({ extends: text_input_1.textInputStencil, base: { name: "11zry6", styles: "box-sizing:border-box;min-height:var(--cnvs-sys-size-xxl, var(--cnvs-sys-space-x16, 4rem));min-width:17.5rem;&::webkit-resizer{display:none;}" }, modifiers: { resize: { both: { name: "1nt8gp", styles: "resize:both;" }, horizontal: { name: "q11tc", styles: "resize:horizontal;" }, vertical: { name: "3gxp2m", styles: "resize:vertical;" }, none: { name: "p7axs", styles: "resize:none;" } } }, defaultModifiers: { resize: 'both', } }, "text-area-51c69b"); exports.TextArea = (0, common_1.createComponent)('textarea')({ displayName: 'TextArea', Component: ({ resize = exports.TextAreaResizeDirection.Both, grow, error, ...elemProps }, ref, Element) => (0, jsx_runtime_1.jsx)(Element, { ref: ref, ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, (0, exports.textAreaStencil)({ error, grow, resize })) }), subComponents: { ErrorType: common_1.ErrorType, ResizeDirection: exports.TextAreaResizeDirection, }, });