UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

35 lines (34 loc) 1.54 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { createComponent, ErrorType } from '@workday/canvas-kit-react/common'; import { createStencil, calc, handleCsProp } from '@workday/canvas-kit-styling'; import { system } from '@workday/canvas-tokens-web'; import { textInputStencil } from '@workday/canvas-kit-react/text-input'; export const TextAreaResizeDirection = { None: 'none', Both: 'both', Horizontal: 'horizontal', Vertical: 'vertical', }; export const textAreaStencil = createStencil({ extends: textInputStencil, base: { name: "49groe", styles: "box-sizing:border-box;min-height:var(--cnvs-sys-space-x16);min-width:calc(calc(var(--cnvs-sys-space-x20) * 3) + var(--cnvs-sys-space-x10));&::webkit-resizer{display:none;}" }, modifiers: { resize: { both: { name: "1z7xxx", styles: "resize:both;" }, horizontal: { name: "yrs5m", styles: "resize:horizontal;" }, vertical: { name: "tegxn", styles: "resize:vertical;" }, none: { name: "1ni3kk", styles: "resize:none;" } } }, defaultModifiers: { resize: 'both', } }, "text-area-aff4ba"); 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, }, });