UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

35 lines (34 loc) 1.52 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { ErrorType, createComponent } from '@workday/canvas-kit-react/common'; import { textInputStencil } from '@workday/canvas-kit-react/text-input'; import { createStencil, handleCsProp, px2rem } from '@workday/canvas-kit-styling'; import { system } from '@workday/canvas-tokens-web'; export const TextAreaResizeDirection = { None: 'none', Both: 'both', Horizontal: 'horizontal', Vertical: 'vertical', }; export const textAreaStencil = createStencil({ extends: textInputStencil, base: { name: "2jh3vz", 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: "1xnjbm", styles: "resize:both;" }, horizontal: { name: "21vy8x", styles: "resize:horizontal;" }, vertical: { name: "2hdccb", styles: "resize:vertical;" }, none: { name: "3v92pl", styles: "resize:none;" } } }, defaultModifiers: { resize: 'both', } }, "text-area-51c69b"); export const TextArea = createComponent('textarea')({ displayName: 'TextArea', Component: ({ resize = TextAreaResizeDirection.Both, grow, error, ...elemProps }, ref, Element) => _jsx(Element, { ref: ref, ...handleCsProp(elemProps, textAreaStencil({ error, grow, resize })) }), subComponents: { ErrorType, ResizeDirection: TextAreaResizeDirection, }, });