@elliemae/ds-form-input-textarea 3.50.1-next.9 → 3.51.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSControlledLargeTextInput.js +5 -3
- package/dist/cjs/DSControlledLargeTextInput.js.map +2 -2
- package/dist/cjs/exported-related/theming.js +1 -1
- package/dist/cjs/exported-related/theming.js.map +1 -1
- package/dist/cjs/styles.js +10 -7
- package/dist/cjs/styles.js.map +2 -2
- package/dist/esm/DSControlledLargeTextInput.js +5 -3
- package/dist/esm/DSControlledLargeTextInput.js.map +2 -2
- package/dist/esm/exported-related/theming.js +1 -1
- package/dist/esm/exported-related/theming.js.map +1 -1
- package/dist/esm/styles.js +10 -7
- package/dist/esm/styles.js.map +2 -2
- package/dist/types/DSControlledLargeTextInput.d.ts +1 -0
- package/dist/types/exported-related/theming.d.ts +1 -1
- package/package.json +9 -9
|
@@ -43,7 +43,7 @@ var import_exported_related = require("./exported-related/index.js");
|
|
|
43
43
|
const DSControlledLargeTextInput = (props) => {
|
|
44
44
|
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_react_desc_prop_types.propTypes, import_exported_related.DSControlledLargeTextInputName);
|
|
45
45
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
46
|
-
const { value, onChange, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } = propsWithDefault;
|
|
46
|
+
const { value, onChange, readOnly, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } = propsWithDefault;
|
|
47
47
|
const { className, rows, ...globalAttributes } = (0, import_ds_props_helpers.useGetGlobalAttributes)(otherProps);
|
|
48
48
|
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(otherProps);
|
|
49
49
|
const [calculatedMinHeight, setCalculatedMinHeight] = (0, import_react.useState)();
|
|
@@ -78,7 +78,7 @@ const DSControlledLargeTextInput = (props) => {
|
|
|
78
78
|
className,
|
|
79
79
|
"data-testid": import_exported_related.DSControlledLargetTextInputDatatestids.CONTAINER,
|
|
80
80
|
$isDisabled: otherProps.disabled,
|
|
81
|
-
applyAriaDisabled,
|
|
81
|
+
applyAriaDisabled: applyAriaDisabled || readOnly,
|
|
82
82
|
...xstyledProps,
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.WrapperBorder, { $hasError: hasError, $isDisabled: otherProps.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -97,7 +97,9 @@ const DSControlledLargeTextInput = (props) => {
|
|
|
97
97
|
"aria-describedby": id !== void 0 ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : void 0,
|
|
98
98
|
"aria-invalid": hasError,
|
|
99
99
|
"aria-disabled": applyAriaDisabled,
|
|
100
|
-
...globalAttributes
|
|
100
|
+
...globalAttributes,
|
|
101
|
+
readOnly,
|
|
102
|
+
"aria-readonly": readOnly
|
|
101
103
|
}
|
|
102
104
|
) }),
|
|
103
105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSControlledLargeTextInput.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo, useRef, useState, useLayoutEffect, useEffect } from 'react';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { propTypes, defaultProps } from './react-desc-prop-types.js';\nimport { StyledTextArea, StyledContainer, WrapperBorder } from './styles.js';\nimport { DSControlledLargeTextInputName, DSControlledLargetTextInputDatatestids } from './exported-related/index.js';\nimport type { DSControlledLargeTextInputT } from './react-desc-prop-types.js';\n\nconst DSControlledLargeTextInput = (props: DSControlledLargeTextInputT.Props): JSX.Element => {\n useValidateTypescriptPropTypes(props, propTypes, DSControlledLargeTextInputName);\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledLargeTextInputT.InternalProps>(props, defaultProps);\n\n const { value, onChange, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } =\n propsWithDefault;\n\n const { className, rows, ...globalAttributes } = useGetGlobalAttributes(otherProps);\n\n const xstyledProps = useGetXstyledProps(otherProps);\n\n const [calculatedMinHeight, setCalculatedMinHeight] = useState<number>();\n const [scrollBarWidth, setScrollBarWidth] = useState<number>(0);\n\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const ghostRef = useRef<HTMLTextAreaElement | null>(null);\n\n const handleOnChange = useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (e) => {\n if (applyAriaDisabled) return;\n onChange(e.currentTarget.value, e);\n },\n [onChange, applyAriaDisabled],\n );\n\n useEffect(() => {\n if (textareaRef && textareaRef.current) {\n const { offsetWidth, clientWidth } = textareaRef.current;\n setScrollBarWidth(offsetWidth - clientWidth);\n }\n }, [value]);\n\n useLayoutEffect(() => {\n if (ghostRef && ghostRef.current) {\n const { offsetHeight, scrollHeight } = ghostRef.current;\n if (rows !== undefined) setCalculatedMinHeight(offsetHeight);\n else if (maxHeight !== undefined && scrollHeight >= maxHeight) setCalculatedMinHeight(maxHeight);\n else setCalculatedMinHeight(scrollHeight);\n }\n }, [maxHeight, value, rows]);\n\n const referenceSetter = useMemo(() => mergeRefs(textareaRef, innerRef), [innerRef]);\n\n return (\n <StyledContainer\n className={className}\n data-testid={DSControlledLargetTextInputDatatestids.CONTAINER}\n $isDisabled={otherProps.disabled}\n applyAriaDisabled={applyAriaDisabled}\n {...xstyledProps}\n >\n <WrapperBorder $hasError={hasError} $isDisabled={otherProps.disabled}>\n <StyledTextArea\n innerRef={referenceSetter}\n aria-multiline\n value={value}\n $maxHeight={maxHeight}\n $minHeight={calculatedMinHeight}\n onChange={handleOnChange}\n name={name}\n id={id}\n data-testid={DSControlledLargetTextInputDatatestids.INPUT}\n rows={rows}\n aria-describedby={\n id !== undefined ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : undefined\n }\n aria-invalid={hasError}\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n />\n </WrapperBorder>\n <StyledTextArea\n disabled\n aria-label=\"ghost textarea\"\n innerRef={ghostRef}\n value={value}\n $maxHeight={maxHeight}\n rows={rows}\n style={{\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n paddingLeft: '9px',\n paddingRight: `${9 + scrollBarWidth}px`,\n overflow: 'hidden',\n }}\n />\n </StyledContainer>\n );\n};\n\nDSControlledLargeTextInput.displayName = 'DSControlledLargeTextInput';\nconst DSControlledLargeTextInputWithSchema = describe(DSControlledLargeTextInput);\nDSControlledLargeTextInputWithSchema.propTypes = propTypes as ValidationMap<unknown>;\nexport { DSControlledLargeTextInput, DSControlledLargeTextInputWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4DnB;AA5DJ,mBAA0F;AAC1F,8BAOO;AACP,uBAA0B;AAC1B,mCAAwC;AACxC,oBAA+D;AAC/D,8BAAuF;AAGvF,MAAM,6BAA6B,CAAC,UAA0D;AAC5F,8DAA+B,OAAO,wCAAW,sDAA8B;AAE/E,QAAM,uBAAmB,sDAAwE,OAAO,yCAAY;AAEpH,QAAM,EAAE,OAAO,UAAU,UAAU,MAAM,IAAI,UAAU,WAAW,mBAAmB,GAAG,WAAW,
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useMemo, useRef, useState, useLayoutEffect, useEffect } from 'react';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { propTypes, defaultProps } from './react-desc-prop-types.js';\nimport { StyledTextArea, StyledContainer, WrapperBorder } from './styles.js';\nimport { DSControlledLargeTextInputName, DSControlledLargetTextInputDatatestids } from './exported-related/index.js';\nimport type { DSControlledLargeTextInputT } from './react-desc-prop-types.js';\n\nconst DSControlledLargeTextInput = (props: DSControlledLargeTextInputT.Props): JSX.Element => {\n useValidateTypescriptPropTypes(props, propTypes, DSControlledLargeTextInputName);\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledLargeTextInputT.InternalProps>(props, defaultProps);\n\n const { value, onChange, readOnly, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } =\n propsWithDefault;\n\n const { className, rows, ...globalAttributes } = useGetGlobalAttributes(otherProps);\n\n const xstyledProps = useGetXstyledProps(otherProps);\n\n const [calculatedMinHeight, setCalculatedMinHeight] = useState<number>();\n const [scrollBarWidth, setScrollBarWidth] = useState<number>(0);\n\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const ghostRef = useRef<HTMLTextAreaElement | null>(null);\n\n const handleOnChange = useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (e) => {\n if (applyAriaDisabled) return;\n onChange(e.currentTarget.value, e);\n },\n [onChange, applyAriaDisabled],\n );\n\n useEffect(() => {\n if (textareaRef && textareaRef.current) {\n const { offsetWidth, clientWidth } = textareaRef.current;\n setScrollBarWidth(offsetWidth - clientWidth);\n }\n }, [value]);\n\n useLayoutEffect(() => {\n if (ghostRef && ghostRef.current) {\n const { offsetHeight, scrollHeight } = ghostRef.current;\n if (rows !== undefined) setCalculatedMinHeight(offsetHeight);\n else if (maxHeight !== undefined && scrollHeight >= maxHeight) setCalculatedMinHeight(maxHeight);\n else setCalculatedMinHeight(scrollHeight);\n }\n }, [maxHeight, value, rows]);\n\n const referenceSetter = useMemo(() => mergeRefs(textareaRef, innerRef), [innerRef]);\n\n return (\n <StyledContainer\n className={className}\n data-testid={DSControlledLargetTextInputDatatestids.CONTAINER}\n $isDisabled={otherProps.disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n {...xstyledProps}\n >\n <WrapperBorder $hasError={hasError} $isDisabled={otherProps.disabled}>\n <StyledTextArea\n innerRef={referenceSetter}\n aria-multiline\n value={value}\n $maxHeight={maxHeight}\n $minHeight={calculatedMinHeight}\n onChange={handleOnChange}\n name={name}\n id={id}\n data-testid={DSControlledLargetTextInputDatatestids.INPUT}\n rows={rows}\n aria-describedby={\n id !== undefined ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : undefined\n }\n aria-invalid={hasError}\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n readOnly={readOnly}\n aria-readonly={readOnly}\n />\n </WrapperBorder>\n <StyledTextArea\n disabled\n aria-label=\"ghost textarea\"\n innerRef={ghostRef}\n value={value}\n $maxHeight={maxHeight}\n rows={rows}\n style={{\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n paddingLeft: '9px',\n paddingRight: `${9 + scrollBarWidth}px`,\n overflow: 'hidden',\n }}\n />\n </StyledContainer>\n );\n};\n\nDSControlledLargeTextInput.displayName = 'DSControlledLargeTextInput';\nconst DSControlledLargeTextInputWithSchema = describe(DSControlledLargeTextInput);\nDSControlledLargeTextInputWithSchema.propTypes = propTypes as ValidationMap<unknown>;\nexport { DSControlledLargeTextInput, DSControlledLargeTextInputWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4DnB;AA5DJ,mBAA0F;AAC1F,8BAOO;AACP,uBAA0B;AAC1B,mCAAwC;AACxC,oBAA+D;AAC/D,8BAAuF;AAGvF,MAAM,6BAA6B,CAAC,UAA0D;AAC5F,8DAA+B,OAAO,wCAAW,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AA,MAEJ;AAAA,oDAAC,+BAAc,WAAW,UAAU,aAAa,WAAW,UAC1D;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,kBAAc;AAAA,YACd;AAAA,YACA,YAAY;AAAA,YACZ,YAAY;AAAA,YACZ,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA,eAAa,+DAAuC;AAAA,YACpD;AAAA,YACA,oBACE,OAAO,SAAY,GAAG,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,0BAA0B;AAAA,YAE/F,gBAAc;AAAA,YACd,iBAAe;AAAA,YACd,GAAG;AAAA,YACJ;AAAA,YACA,iBAAe;AAAA;AAAA,QACjB,GACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAQ;AAAA,YACR,cAAW;AAAA,YACX,UAAU;AAAA,YACV;AAAA,YACA,YAAY;AAAA,YACZ;AAAA,YACA,OAAO;AAAA,cACL,YAAY;AAAA,cACZ,eAAe;AAAA,cACf,UAAU;AAAA,cACV,aAAa;AAAA,cACb,cAAc,GAAG,IAAI,cAAc;AAAA,cACnC,UAAU;AAAA,YACZ;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,2BAA2B,cAAc;AACzC,MAAM,2CAAuC,kCAAS,0BAA0B;AAChF,qCAAqC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ __export(theming_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(theming_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
|
-
const DSControlledLargeTextInputName = "
|
|
36
|
+
const DSControlledLargeTextInputName = "DSControlledlargetextinput";
|
|
37
37
|
const DSControlledLargeTextInputSlots = {
|
|
38
38
|
CONTAINER: "root",
|
|
39
39
|
INPUT: "input",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported-related/theming.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const DSControlledLargeTextInputName = '
|
|
4
|
+
"sourcesContent": ["export const DSControlledLargeTextInputName = 'DSControlledlargetextinput';\n\nexport const DSControlledLargeTextInputSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n CHAR_COUNTER: 'char-counter',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,iCAAiC;AAEvC,MAAM,kCAAkC;AAAA,EAC7C,WAAW;AAAA,EACX,OAAO;AAAA,EACP,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -47,16 +47,19 @@ const StyledContainer = (0, import_ds_system.styled)("div", {
|
|
|
47
47
|
background-color: #EBEDF0;
|
|
48
48
|
color: #616b7f;
|
|
49
49
|
` : ``}
|
|
50
|
-
${({ applyAriaDisabled }) => applyAriaDisabled ? `
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
${({ applyAriaDisabled, theme }) => applyAriaDisabled ? `
|
|
51
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
52
|
+
color: #616b7f;
|
|
53
|
+
textarea {
|
|
54
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
55
|
+
}
|
|
53
56
|
` : ``}
|
|
54
57
|
${import_ds_system.xStyledCommonProps}
|
|
55
58
|
`;
|
|
56
59
|
const WrapperBorder = (0, import_ds_system.styled)("div")`
|
|
57
60
|
${({ $isDisabled, theme }) => !$isDisabled ? `
|
|
58
61
|
&:hover {
|
|
59
|
-
outline: 1px solid ${theme.colors.brand[
|
|
62
|
+
outline: 1px solid ${theme.colors.brand[600]};
|
|
60
63
|
outline-offset: -1px;
|
|
61
64
|
}
|
|
62
65
|
&:focus,
|
|
@@ -88,14 +91,14 @@ const StyledTextArea = (0, import_ds_system.styled)("textarea", {
|
|
|
88
91
|
resize: none;
|
|
89
92
|
${({ $maxHeight }) => $maxHeight ? `max-height: ${$maxHeight}px;` : ``}
|
|
90
93
|
${({ $minHeight }) => $minHeight ? `min-height: ${$minHeight}px;` : ``}
|
|
91
|
-
${({ disabled }) => disabled ? `
|
|
94
|
+
${({ disabled, theme }) => disabled ? `
|
|
92
95
|
overflow: hidden;
|
|
93
|
-
|
|
96
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
94
97
|
cursor: not-allowed;
|
|
95
98
|
` : ""}
|
|
96
99
|
&[aria-disabled='true'] {
|
|
97
100
|
overflow: hidden;
|
|
98
|
-
background-color:
|
|
101
|
+
background-color: ${({ theme }) => theme.colors.neutral["050"]};
|
|
99
102
|
cursor: not-allowed;
|
|
100
103
|
caret-color: transparent;
|
|
101
104
|
}
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSControlledLargeTextInputName, DSControlledLargeTextInputSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.CONTAINER,\n})<{ $isDisabled?: boolean; applyAriaDisabled?: boolean }>`\n display: grid;\n grid-template-rows: auto auto;\n grid-template-columns: fit-content;\n ${({ $isDisabled }) =>\n $isDisabled\n ? `\n background-color: #EBEDF0;\n color: #616b7f;\n `\n : ``}\n ${({ applyAriaDisabled }) =>\n applyAriaDisabled\n ? `\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,8BAAgF;AAEzE,MAAM,sBAAkB,yBAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,wDAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,CAAC,EAAE,YAAY,MACf,cACI;AAAA;AAAA;AAAA,MAIA,EAAE;AAAA,IACN,CAAC,EAAE,
|
|
4
|
+
"sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSControlledLargeTextInputName, DSControlledLargeTextInputSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.CONTAINER,\n})<{ $isDisabled?: boolean; applyAriaDisabled?: boolean }>`\n display: grid;\n grid-template-rows: auto auto;\n grid-template-columns: fit-content;\n ${({ $isDisabled }) =>\n $isDisabled\n ? `\n background-color: #EBEDF0;\n color: #616b7f;\n `\n : ``}\n ${({ applyAriaDisabled, theme }) =>\n applyAriaDisabled\n ? `\n background-color: ${theme.colors.neutral['050']};\n color: #616b7f;\n textarea {\n background-color: ${theme.colors.neutral['050']};\n }\n `\n : ``}\n ${xStyledCommonProps}\n`;\n\nexport const WrapperBorder = styled('div')<{ $hasError?: boolean; $isDisabled?: boolean }>`\n ${({ $isDisabled, theme }) =>\n !$isDisabled\n ? `\n&:hover {\n outline: 1px solid ${theme.colors.brand[600]};\n outline-offset: -1px;\n}\n&:focus,\n&:focus-within {\n outline: 2px solid ${theme.colors.brand[700]};\n outline-offset: -2px;\n}\n&:hover,\n&:focus,\n&:focus-within {\n border-color: transparent;\n} \n`\n : ``}\n border: 1px solid neutral-400;\n border-radius: 2px;\n position: relative;\n box-sizing: content-box;\n ${({ $hasError, theme }) => ($hasError ? `border: 1px solid ${theme.colors.danger[900]};` : ``)}\n`;\n\ninterface StyledTextAreaT {\n resizable?: boolean;\n hasError?: boolean;\n applyAriaDisabled?: boolean;\n $maxHeight?: number;\n $minHeight?: number;\n}\n\nexport const StyledTextArea = styled('textarea', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.INPUT,\n})<StyledTextAreaT>`\n line-height: 1;\n outline: none;\n width: 100%;\n border: none;\n padding: 8px;\n resize: none;\n ${({ $maxHeight }) => ($maxHeight ? `max-height: ${$maxHeight}px;` : ``)}\n ${({ $minHeight }) => ($minHeight ? `min-height: ${$minHeight}px;` : ``)}\n ${({ disabled, theme }) =>\n disabled\n ? `\n overflow: hidden;\n background-color: ${theme.colors.neutral['050']};\n cursor: not-allowed;\n `\n : ''}\n &[aria-disabled='true'] {\n overflow: hidden;\n background-color: ${({ theme }) => theme.colors.neutral['050']};\n cursor: not-allowed;\n caret-color: transparent;\n }\n\n ${({ rows, $maxHeight }) => {\n if (rows === undefined && $maxHeight === undefined) return 'overflow: hidden;';\n return '';\n }}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,8BAAgF;AAEzE,MAAM,sBAAkB,yBAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,wDAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,CAAC,EAAE,YAAY,MACf,cACI;AAAA;AAAA;AAAA,MAIA,EAAE;AAAA,IACN,CAAC,EAAE,mBAAmB,MAAM,MAC5B,oBACI;AAAA,wBACgB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,0BAGzB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,MAG7C,EAAE;AAAA,IACN,mCAAkB;AAAA;AAGf,MAAM,oBAAgB,yBAAO,KAAK;AAAA,IACrC,CAAC,EAAE,aAAa,MAAM,MACtB,CAAC,cACG;AAAA;AAAA,uBAEe,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKvB,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAStC,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,CAAC,EAAE,WAAW,MAAM,MAAO,YAAY,qBAAqB,MAAM,OAAO,OAAO,GAAG,CAAC,MAAM,EAAG;AAAA;AAW1F,MAAM,qBAAiB,yBAAO,YAAY;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,wDAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOG,CAAC,EAAE,WAAW,MAAO,aAAa,eAAe,UAAU,QAAQ,EAAG;AAAA,IACtE,CAAC,EAAE,WAAW,MAAO,aAAa,eAAe,UAAU,QAAQ,EAAG;AAAA,IACtE,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA;AAAA,wBAEgB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,MAG3C,EAAE;AAAA;AAAA;AAAA,wBAGc,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK9D,CAAC,EAAE,MAAM,WAAW,MAAM;AAC1B,MAAI,SAAS,UAAa,eAAe,OAAW,QAAO;AAC3D,SAAO;AACT,CAAC;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ import { DSControlledLargeTextInputName, DSControlledLargetTextInputDatatestids
|
|
|
15
15
|
const DSControlledLargeTextInput = (props) => {
|
|
16
16
|
useValidateTypescriptPropTypes(props, propTypes, DSControlledLargeTextInputName);
|
|
17
17
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
18
|
-
const { value, onChange, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } = propsWithDefault;
|
|
18
|
+
const { value, onChange, readOnly, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } = propsWithDefault;
|
|
19
19
|
const { className, rows, ...globalAttributes } = useGetGlobalAttributes(otherProps);
|
|
20
20
|
const xstyledProps = useGetXstyledProps(otherProps);
|
|
21
21
|
const [calculatedMinHeight, setCalculatedMinHeight] = useState();
|
|
@@ -50,7 +50,7 @@ const DSControlledLargeTextInput = (props) => {
|
|
|
50
50
|
className,
|
|
51
51
|
"data-testid": DSControlledLargetTextInputDatatestids.CONTAINER,
|
|
52
52
|
$isDisabled: otherProps.disabled,
|
|
53
|
-
applyAriaDisabled,
|
|
53
|
+
applyAriaDisabled: applyAriaDisabled || readOnly,
|
|
54
54
|
...xstyledProps,
|
|
55
55
|
children: [
|
|
56
56
|
/* @__PURE__ */ jsx(WrapperBorder, { $hasError: hasError, $isDisabled: otherProps.disabled, children: /* @__PURE__ */ jsx(
|
|
@@ -69,7 +69,9 @@ const DSControlledLargeTextInput = (props) => {
|
|
|
69
69
|
"aria-describedby": id !== void 0 ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : void 0,
|
|
70
70
|
"aria-invalid": hasError,
|
|
71
71
|
"aria-disabled": applyAriaDisabled,
|
|
72
|
-
...globalAttributes
|
|
72
|
+
...globalAttributes,
|
|
73
|
+
readOnly,
|
|
74
|
+
"aria-readonly": readOnly
|
|
73
75
|
}
|
|
74
76
|
) }),
|
|
75
77
|
/* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSControlledLargeTextInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo, useRef, useState, useLayoutEffect, useEffect } from 'react';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { propTypes, defaultProps } from './react-desc-prop-types.js';\nimport { StyledTextArea, StyledContainer, WrapperBorder } from './styles.js';\nimport { DSControlledLargeTextInputName, DSControlledLargetTextInputDatatestids } from './exported-related/index.js';\nimport type { DSControlledLargeTextInputT } from './react-desc-prop-types.js';\n\nconst DSControlledLargeTextInput = (props: DSControlledLargeTextInputT.Props): JSX.Element => {\n useValidateTypescriptPropTypes(props, propTypes, DSControlledLargeTextInputName);\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledLargeTextInputT.InternalProps>(props, defaultProps);\n\n const { value, onChange, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } =\n propsWithDefault;\n\n const { className, rows, ...globalAttributes } = useGetGlobalAttributes(otherProps);\n\n const xstyledProps = useGetXstyledProps(otherProps);\n\n const [calculatedMinHeight, setCalculatedMinHeight] = useState<number>();\n const [scrollBarWidth, setScrollBarWidth] = useState<number>(0);\n\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const ghostRef = useRef<HTMLTextAreaElement | null>(null);\n\n const handleOnChange = useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (e) => {\n if (applyAriaDisabled) return;\n onChange(e.currentTarget.value, e);\n },\n [onChange, applyAriaDisabled],\n );\n\n useEffect(() => {\n if (textareaRef && textareaRef.current) {\n const { offsetWidth, clientWidth } = textareaRef.current;\n setScrollBarWidth(offsetWidth - clientWidth);\n }\n }, [value]);\n\n useLayoutEffect(() => {\n if (ghostRef && ghostRef.current) {\n const { offsetHeight, scrollHeight } = ghostRef.current;\n if (rows !== undefined) setCalculatedMinHeight(offsetHeight);\n else if (maxHeight !== undefined && scrollHeight >= maxHeight) setCalculatedMinHeight(maxHeight);\n else setCalculatedMinHeight(scrollHeight);\n }\n }, [maxHeight, value, rows]);\n\n const referenceSetter = useMemo(() => mergeRefs(textareaRef, innerRef), [innerRef]);\n\n return (\n <StyledContainer\n className={className}\n data-testid={DSControlledLargetTextInputDatatestids.CONTAINER}\n $isDisabled={otherProps.disabled}\n applyAriaDisabled={applyAriaDisabled}\n {...xstyledProps}\n >\n <WrapperBorder $hasError={hasError} $isDisabled={otherProps.disabled}>\n <StyledTextArea\n innerRef={referenceSetter}\n aria-multiline\n value={value}\n $maxHeight={maxHeight}\n $minHeight={calculatedMinHeight}\n onChange={handleOnChange}\n name={name}\n id={id}\n data-testid={DSControlledLargetTextInputDatatestids.INPUT}\n rows={rows}\n aria-describedby={\n id !== undefined ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : undefined\n }\n aria-invalid={hasError}\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n />\n </WrapperBorder>\n <StyledTextArea\n disabled\n aria-label=\"ghost textarea\"\n innerRef={ghostRef}\n value={value}\n $maxHeight={maxHeight}\n rows={rows}\n style={{\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n paddingLeft: '9px',\n paddingRight: `${9 + scrollBarWidth}px`,\n overflow: 'hidden',\n }}\n />\n </StyledContainer>\n );\n};\n\nDSControlledLargeTextInput.displayName = 'DSControlledLargeTextInput';\nconst DSControlledLargeTextInputWithSchema = describe(DSControlledLargeTextInput);\nDSControlledLargeTextInputWithSchema.propTypes = propTypes as ValidationMap<unknown>;\nexport { DSControlledLargeTextInput, DSControlledLargeTextInputWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC4DnB,SAQI,KARJ;AA5DJ,SAAgB,aAAa,SAAS,QAAQ,UAAU,iBAAiB,iBAAiB;AAC1F;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,iBAAiB;AAC1B,SAAS,WAAW,oBAAoB;AACxC,SAAS,gBAAgB,iBAAiB,qBAAqB;AAC/D,SAAS,gCAAgC,8CAA8C;AAGvF,MAAM,6BAA6B,CAAC,UAA0D;AAC5F,iCAA+B,OAAO,WAAW,8BAA8B;AAE/E,QAAM,mBAAmB,6BAAwE,OAAO,YAAY;AAEpH,QAAM,EAAE,OAAO,UAAU,UAAU,MAAM,IAAI,UAAU,WAAW,mBAAmB,GAAG,WAAW,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo, useRef, useState, useLayoutEffect, useEffect } from 'react';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { propTypes, defaultProps } from './react-desc-prop-types.js';\nimport { StyledTextArea, StyledContainer, WrapperBorder } from './styles.js';\nimport { DSControlledLargeTextInputName, DSControlledLargetTextInputDatatestids } from './exported-related/index.js';\nimport type { DSControlledLargeTextInputT } from './react-desc-prop-types.js';\n\nconst DSControlledLargeTextInput = (props: DSControlledLargeTextInputT.Props): JSX.Element => {\n useValidateTypescriptPropTypes(props, propTypes, DSControlledLargeTextInputName);\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledLargeTextInputT.InternalProps>(props, defaultProps);\n\n const { value, onChange, readOnly, innerRef, name, id, hasError, maxHeight, applyAriaDisabled, ...otherProps } =\n propsWithDefault;\n\n const { className, rows, ...globalAttributes } = useGetGlobalAttributes(otherProps);\n\n const xstyledProps = useGetXstyledProps(otherProps);\n\n const [calculatedMinHeight, setCalculatedMinHeight] = useState<number>();\n const [scrollBarWidth, setScrollBarWidth] = useState<number>(0);\n\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const ghostRef = useRef<HTMLTextAreaElement | null>(null);\n\n const handleOnChange = useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (e) => {\n if (applyAriaDisabled) return;\n onChange(e.currentTarget.value, e);\n },\n [onChange, applyAriaDisabled],\n );\n\n useEffect(() => {\n if (textareaRef && textareaRef.current) {\n const { offsetWidth, clientWidth } = textareaRef.current;\n setScrollBarWidth(offsetWidth - clientWidth);\n }\n }, [value]);\n\n useLayoutEffect(() => {\n if (ghostRef && ghostRef.current) {\n const { offsetHeight, scrollHeight } = ghostRef.current;\n if (rows !== undefined) setCalculatedMinHeight(offsetHeight);\n else if (maxHeight !== undefined && scrollHeight >= maxHeight) setCalculatedMinHeight(maxHeight);\n else setCalculatedMinHeight(scrollHeight);\n }\n }, [maxHeight, value, rows]);\n\n const referenceSetter = useMemo(() => mergeRefs(textareaRef, innerRef), [innerRef]);\n\n return (\n <StyledContainer\n className={className}\n data-testid={DSControlledLargetTextInputDatatestids.CONTAINER}\n $isDisabled={otherProps.disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n {...xstyledProps}\n >\n <WrapperBorder $hasError={hasError} $isDisabled={otherProps.disabled}>\n <StyledTextArea\n innerRef={referenceSetter}\n aria-multiline\n value={value}\n $maxHeight={maxHeight}\n $minHeight={calculatedMinHeight}\n onChange={handleOnChange}\n name={name}\n id={id}\n data-testid={DSControlledLargetTextInputDatatestids.INPUT}\n rows={rows}\n aria-describedby={\n id !== undefined ? `${id}_feedback_message ${id}_error_message ${id}_remaining_characters` : undefined\n }\n aria-invalid={hasError}\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n readOnly={readOnly}\n aria-readonly={readOnly}\n />\n </WrapperBorder>\n <StyledTextArea\n disabled\n aria-label=\"ghost textarea\"\n innerRef={ghostRef}\n value={value}\n $maxHeight={maxHeight}\n rows={rows}\n style={{\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n paddingLeft: '9px',\n paddingRight: `${9 + scrollBarWidth}px`,\n overflow: 'hidden',\n }}\n />\n </StyledContainer>\n );\n};\n\nDSControlledLargeTextInput.displayName = 'DSControlledLargeTextInput';\nconst DSControlledLargeTextInputWithSchema = describe(DSControlledLargeTextInput);\nDSControlledLargeTextInputWithSchema.propTypes = propTypes as ValidationMap<unknown>;\nexport { DSControlledLargeTextInput, DSControlledLargeTextInputWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4DnB,SAQI,KARJ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../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/theming.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSControlledLargeTextInputName = '
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSControlledLargeTextInputName = 'DSControlledlargetextinput';\n\nexport const DSControlledLargeTextInputSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n CHAR_COUNTER: 'char-counter',\n} as const;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,iCAAiC;AAEvC,MAAM,kCAAkC;AAAA,EAC7C,WAAW;AAAA,EACX,OAAO;AAAA,EACP,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js
CHANGED
|
@@ -12,16 +12,19 @@ const StyledContainer = styled("div", {
|
|
|
12
12
|
background-color: #EBEDF0;
|
|
13
13
|
color: #616b7f;
|
|
14
14
|
` : ``}
|
|
15
|
-
${({ applyAriaDisabled }) => applyAriaDisabled ? `
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
${({ applyAriaDisabled, theme }) => applyAriaDisabled ? `
|
|
16
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
17
|
+
color: #616b7f;
|
|
18
|
+
textarea {
|
|
19
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
20
|
+
}
|
|
18
21
|
` : ``}
|
|
19
22
|
${xStyledCommonProps}
|
|
20
23
|
`;
|
|
21
24
|
const WrapperBorder = styled("div")`
|
|
22
25
|
${({ $isDisabled, theme }) => !$isDisabled ? `
|
|
23
26
|
&:hover {
|
|
24
|
-
outline: 1px solid ${theme.colors.brand[
|
|
27
|
+
outline: 1px solid ${theme.colors.brand[600]};
|
|
25
28
|
outline-offset: -1px;
|
|
26
29
|
}
|
|
27
30
|
&:focus,
|
|
@@ -53,14 +56,14 @@ const StyledTextArea = styled("textarea", {
|
|
|
53
56
|
resize: none;
|
|
54
57
|
${({ $maxHeight }) => $maxHeight ? `max-height: ${$maxHeight}px;` : ``}
|
|
55
58
|
${({ $minHeight }) => $minHeight ? `min-height: ${$minHeight}px;` : ``}
|
|
56
|
-
${({ disabled }) => disabled ? `
|
|
59
|
+
${({ disabled, theme }) => disabled ? `
|
|
57
60
|
overflow: hidden;
|
|
58
|
-
|
|
61
|
+
background-color: ${theme.colors.neutral["050"]};
|
|
59
62
|
cursor: not-allowed;
|
|
60
63
|
` : ""}
|
|
61
64
|
&[aria-disabled='true'] {
|
|
62
65
|
overflow: hidden;
|
|
63
|
-
background-color:
|
|
66
|
+
background-color: ${({ theme }) => theme.colors.neutral["050"]};
|
|
64
67
|
cursor: not-allowed;
|
|
65
68
|
caret-color: transparent;
|
|
66
69
|
}
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSControlledLargeTextInputName, DSControlledLargeTextInputSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.CONTAINER,\n})<{ $isDisabled?: boolean; applyAriaDisabled?: boolean }>`\n display: grid;\n grid-template-rows: auto auto;\n grid-template-columns: fit-content;\n ${({ $isDisabled }) =>\n $isDisabled\n ? `\n background-color: #EBEDF0;\n color: #616b7f;\n `\n : ``}\n ${({ applyAriaDisabled }) =>\n applyAriaDisabled\n ? `\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,gCAAgC,uCAAuC;AAEzE,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gCAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,CAAC,EAAE,YAAY,MACf,cACI;AAAA;AAAA;AAAA,MAIA,EAAE;AAAA,IACN,CAAC,EAAE,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSControlledLargeTextInputName, DSControlledLargeTextInputSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.CONTAINER,\n})<{ $isDisabled?: boolean; applyAriaDisabled?: boolean }>`\n display: grid;\n grid-template-rows: auto auto;\n grid-template-columns: fit-content;\n ${({ $isDisabled }) =>\n $isDisabled\n ? `\n background-color: #EBEDF0;\n color: #616b7f;\n `\n : ``}\n ${({ applyAriaDisabled, theme }) =>\n applyAriaDisabled\n ? `\n background-color: ${theme.colors.neutral['050']};\n color: #616b7f;\n textarea {\n background-color: ${theme.colors.neutral['050']};\n }\n `\n : ``}\n ${xStyledCommonProps}\n`;\n\nexport const WrapperBorder = styled('div')<{ $hasError?: boolean; $isDisabled?: boolean }>`\n ${({ $isDisabled, theme }) =>\n !$isDisabled\n ? `\n&:hover {\n outline: 1px solid ${theme.colors.brand[600]};\n outline-offset: -1px;\n}\n&:focus,\n&:focus-within {\n outline: 2px solid ${theme.colors.brand[700]};\n outline-offset: -2px;\n}\n&:hover,\n&:focus,\n&:focus-within {\n border-color: transparent;\n} \n`\n : ``}\n border: 1px solid neutral-400;\n border-radius: 2px;\n position: relative;\n box-sizing: content-box;\n ${({ $hasError, theme }) => ($hasError ? `border: 1px solid ${theme.colors.danger[900]};` : ``)}\n`;\n\ninterface StyledTextAreaT {\n resizable?: boolean;\n hasError?: boolean;\n applyAriaDisabled?: boolean;\n $maxHeight?: number;\n $minHeight?: number;\n}\n\nexport const StyledTextArea = styled('textarea', {\n name: DSControlledLargeTextInputName,\n slot: DSControlledLargeTextInputSlots.INPUT,\n})<StyledTextAreaT>`\n line-height: 1;\n outline: none;\n width: 100%;\n border: none;\n padding: 8px;\n resize: none;\n ${({ $maxHeight }) => ($maxHeight ? `max-height: ${$maxHeight}px;` : ``)}\n ${({ $minHeight }) => ($minHeight ? `min-height: ${$minHeight}px;` : ``)}\n ${({ disabled, theme }) =>\n disabled\n ? `\n overflow: hidden;\n background-color: ${theme.colors.neutral['050']};\n cursor: not-allowed;\n `\n : ''}\n &[aria-disabled='true'] {\n overflow: hidden;\n background-color: ${({ theme }) => theme.colors.neutral['050']};\n cursor: not-allowed;\n caret-color: transparent;\n }\n\n ${({ rows, $maxHeight }) => {\n if (rows === undefined && $maxHeight === undefined) return 'overflow: hidden;';\n return '';\n }}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,gCAAgC,uCAAuC;AAEzE,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,gCAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,CAAC,EAAE,YAAY,MACf,cACI;AAAA;AAAA;AAAA,MAIA,EAAE;AAAA,IACN,CAAC,EAAE,mBAAmB,MAAM,MAC5B,oBACI;AAAA,wBACgB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,0BAGzB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,MAG7C,EAAE;AAAA,IACN,kBAAkB;AAAA;AAGf,MAAM,gBAAgB,OAAO,KAAK;AAAA,IACrC,CAAC,EAAE,aAAa,MAAM,MACtB,CAAC,cACG;AAAA;AAAA,uBAEe,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKvB,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAStC,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,CAAC,EAAE,WAAW,MAAM,MAAO,YAAY,qBAAqB,MAAM,OAAO,OAAO,GAAG,CAAC,MAAM,EAAG;AAAA;AAW1F,MAAM,iBAAiB,OAAO,YAAY;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gCAAgC;AACxC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOG,CAAC,EAAE,WAAW,MAAO,aAAa,eAAe,UAAU,QAAQ,EAAG;AAAA,IACtE,CAAC,EAAE,WAAW,MAAO,aAAa,eAAe,UAAU,QAAQ,EAAG;AAAA,IACtE,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA;AAAA,wBAEgB,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,MAG3C,EAAE;AAAA;AAAA;AAAA,wBAGc,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK9D,CAAC,EAAE,MAAM,WAAW,MAAM;AAC1B,MAAI,SAAS,UAAa,eAAe,OAAW,QAAO;AAC3D,SAAO;AACT,CAAC;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DSControlledLargeTextInputName = "
|
|
1
|
+
export declare const DSControlledLargeTextInputName = "DSControlledlargetextinput";
|
|
2
2
|
export declare const DSControlledLargeTextInputSlots: {
|
|
3
3
|
readonly CONTAINER: "root";
|
|
4
4
|
readonly INPUT: "input";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-input-textarea",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.51.0-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Input Textarea",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"pnpm": ">=
|
|
29
|
-
"node": ">=
|
|
28
|
+
"pnpm": ">=9",
|
|
29
|
+
"node": ">=22"
|
|
30
30
|
},
|
|
31
31
|
"author": "ICE MT",
|
|
32
32
|
"jestSonar": {
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-props-helpers": "3.
|
|
40
|
-
"@elliemae/ds-system": "3.
|
|
39
|
+
"@elliemae/ds-props-helpers": "3.51.0-beta.1",
|
|
40
|
+
"@elliemae/ds-system": "3.51.0-beta.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
43
|
+
"@elliemae/pui-cli": "9.0.0-next.55",
|
|
44
44
|
"@elliemae/pui-theme": "~2.10.0",
|
|
45
45
|
"@xstyled/system": "~3.7.3",
|
|
46
46
|
"jest": "~29.7.0",
|
|
47
47
|
"styled-components": "~5.3.9",
|
|
48
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
48
|
+
"@elliemae/ds-monorepo-devops": "3.51.0-beta.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@elliemae/pui-theme": "~2.10.0",
|
|
52
52
|
"@xstyled/system": "~3.7.3",
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
53
|
+
"react": "^18.3.1",
|
|
54
|
+
"react-dom": "^18.3.1",
|
|
55
55
|
"styled-components": "~5.3.9",
|
|
56
56
|
"styled-system": "^5.1.5"
|
|
57
57
|
},
|