@mittwald/flow-react-components 0.2.0-alpha.324 → 0.2.0-alpha.326
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/CHANGELOG.md +10 -0
- package/dist/assets/doc-properties.json +4101 -4101
- package/dist/js/components/src/components/TextArea/TextArea.mjs +0 -2
- package/dist/js/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -14,7 +14,6 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
14
14
|
const {
|
|
15
15
|
children,
|
|
16
16
|
placeholder,
|
|
17
|
-
defaultValue,
|
|
18
17
|
rows = 5,
|
|
19
18
|
autoResizeMaxRows = rows,
|
|
20
19
|
ref,
|
|
@@ -44,7 +43,6 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
44
43
|
className: styles.textArea,
|
|
45
44
|
ref: mergeRefs(localRef, ref),
|
|
46
45
|
onChange: updateHeight,
|
|
47
|
-
defaultValue,
|
|
48
46
|
style: {
|
|
49
47
|
minHeight: getHeight(rows),
|
|
50
48
|
maxHeight: getHeight(autoResizeMaxRows)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport type { TextFieldBaseProps } from \"@/components/TextFieldBase\";\nimport { TextFieldBase } from \"@/components/TextFieldBase\";\nimport styles from \"./TextArea.module.scss\";\nimport ClearPropsContext from \"@/components/ClearPropsContext/ClearPropsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { mergeRefs } from \"@react-aria/utils\";\nimport { ReactAriaControlledValueFix } from \"@/lib/react/ReactAriaControlledValueFix\";\n\nexport interface TextAreaProps\n extends Omit<TextFieldBaseProps, \"input\" | \"ref\">,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport type { TextFieldBaseProps } from \"@/components/TextFieldBase\";\nimport { TextFieldBase } from \"@/components/TextFieldBase\";\nimport styles from \"./TextArea.module.scss\";\nimport ClearPropsContext from \"@/components/ClearPropsContext/ClearPropsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { mergeRefs } from \"@react-aria/utils\";\nimport { ReactAriaControlledValueFix } from \"@/lib/react/ReactAriaControlledValueFix\";\n\nexport interface TextAreaProps\n extends Omit<TextFieldBaseProps, \"input\" | \"ref\">,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n ...rest\n } = props;\n\n const localRef = useRef<HTMLTextAreaElement>(null);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height--m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const updateHeight = () => {\n if (localRef.current && rows !== autoResizeMaxRows) {\n // https://stackoverflow.com/a/60795884\n localRef.current.style.height = \"0px\";\n const scrollHeight = localRef.current.scrollHeight;\n localRef.current.style.height = scrollHeight + \"px\";\n }\n };\n\n const input = (\n <ReactAriaControlledValueFix\n inputContext={Aria.TextAreaContext}\n props={props}\n >\n <Aria.TextArea\n rows={rows}\n placeholder={placeholder}\n className={styles.textArea}\n ref={mergeRefs(localRef, ref)}\n onChange={updateHeight}\n style={{\n minHeight: getHeight(rows),\n maxHeight: getHeight(autoResizeMaxRows),\n }}\n />\n </ReactAriaControlledValueFix>\n );\n\n return (\n <ClearPropsContext>\n <TextFieldBase {...rest} input={input}>\n {children}\n </TextFieldBase>\n </ClearPropsContext>\n );\n});\n\nexport default TextArea;\n"],"names":["rows"],"mappings":";;;;;;;;;;AA0BO,MAAM,QAAW,GAAA,aAAA,CAAc,UAAY,EAAA,CAAC,KAAU,KAAA;AAC3D,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAO,GAAA,CAAA;AAAA,IACP,iBAAoB,GAAA,IAAA;AAAA,IACpB,GAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAM,MAAA,QAAA,GAAW,OAA4B,IAAI,CAAA;AAEjD,EAAM,MAAA,SAAA,GAAY,CAACA,KAAiB,KAAA;AAClC,IAAA,OAAO,gCAAgCA,KAAI,CAAA,wCAAA,CAAA;AAAA,GAC7C;AAEA,EAAA,MAAM,eAAe,MAAM;AACzB,IAAI,IAAA,QAAA,CAAS,OAAW,IAAA,IAAA,KAAS,iBAAmB,EAAA;AAElD,MAAS,QAAA,CAAA,OAAA,CAAQ,MAAM,MAAS,GAAA,KAAA;AAChC,MAAM,MAAA,YAAA,GAAe,SAAS,OAAQ,CAAA,YAAA;AACtC,MAAS,QAAA,CAAA,OAAA,CAAQ,KAAM,CAAA,MAAA,GAAS,YAAe,GAAA,IAAA;AAAA;AACjD,GACF;AAEA,EAAA,MAAM,KACJ,mBAAA,GAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,cAAc,IAAK,CAAA,eAAA;AAAA,MACnB,KAAA;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAK,CAAA,QAAA;AAAA,QAAL;AAAA,UACC,IAAA;AAAA,UACA,WAAA;AAAA,UACA,WAAW,MAAO,CAAA,QAAA;AAAA,UAClB,GAAA,EAAK,SAAU,CAAA,QAAA,EAAU,GAAG,CAAA;AAAA,UAC5B,QAAU,EAAA,YAAA;AAAA,UACV,KAAO,EAAA;AAAA,YACL,SAAA,EAAW,UAAU,IAAI,CAAA;AAAA,YACzB,SAAA,EAAW,UAAU,iBAAiB;AAAA;AACxC;AAAA;AACF;AAAA,GACF;AAGF,EACE,uBAAA,GAAA,CAAC,qBACC,QAAC,kBAAA,GAAA,CAAA,aAAA,EAAA,EAAe,GAAG,IAAM,EAAA,KAAA,EACtB,UACH,CACF,EAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK/E,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,KAAK,CAAC,EAC/C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAAC,EAChD,kBAAkB,CAAC,mBAAmB,CAAC;IACzC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK/E,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,KAAK,CAAC,EAC/C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAAC,EAChD,kBAAkB,CAAC,mBAAmB,CAAC;IACzC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,uGAmDnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.326",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@chakra-ui/live-region": "^2.1.0",
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "^2.1.4",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.326",
|
|
62
62
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
63
63
|
"@react-aria/form": "^3.0.16",
|
|
64
64
|
"@react-aria/utils": "^3.29.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@faker-js/faker": "^9.8.0",
|
|
100
100
|
"@internationalized/date": "^3.8.1",
|
|
101
101
|
"@mittwald/flow-core": "",
|
|
102
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
102
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.326",
|
|
103
103
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
104
104
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
105
105
|
"@mittwald/typescript-config": "",
|
|
@@ -181,5 +181,5 @@
|
|
|
181
181
|
"optional": true
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
|
-
"gitHead": "
|
|
184
|
+
"gitHead": "2c1ee2270c113c0cdb984b9fbc3d05a01e470817"
|
|
185
185
|
}
|