@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
35 lines (34 loc) • 1.51 kB
JavaScript
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: "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");
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,
},
});