@fluentui/react-textarea 9.1.9 → 9.1.11

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.
Files changed (34) hide show
  1. package/CHANGELOG.json +69 -1
  2. package/CHANGELOG.md +24 -2
  3. package/lib/components/Textarea/Textarea.js +0 -1
  4. package/lib/components/Textarea/Textarea.js.map +1 -1
  5. package/lib/components/Textarea/renderTextarea.js +4 -3
  6. package/lib/components/Textarea/renderTextarea.js.map +1 -1
  7. package/lib/components/Textarea/useTextarea.js +0 -3
  8. package/lib/components/Textarea/useTextarea.js.map +1 -1
  9. package/lib/components/Textarea/useTextareaStyles.js +246 -253
  10. package/lib/components/Textarea/useTextareaStyles.js.map +1 -1
  11. package/lib/components/TextareaField/TextareaField.js.map +1 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib-commonjs/Textarea.js +0 -2
  14. package/lib-commonjs/Textarea.js.map +1 -1
  15. package/lib-commonjs/TextareaField.js +0 -2
  16. package/lib-commonjs/TextareaField.js.map +1 -1
  17. package/lib-commonjs/components/Textarea/Textarea.js +0 -6
  18. package/lib-commonjs/components/Textarea/Textarea.js.map +1 -1
  19. package/lib-commonjs/components/Textarea/Textarea.types.js.map +1 -1
  20. package/lib-commonjs/components/Textarea/index.js +0 -6
  21. package/lib-commonjs/components/Textarea/index.js.map +1 -1
  22. package/lib-commonjs/components/Textarea/renderTextarea.js +4 -7
  23. package/lib-commonjs/components/Textarea/renderTextarea.js.map +1 -1
  24. package/lib-commonjs/components/Textarea/useTextarea.js +0 -6
  25. package/lib-commonjs/components/Textarea/useTextarea.js.map +1 -1
  26. package/lib-commonjs/components/Textarea/useTextareaStyles.js +246 -257
  27. package/lib-commonjs/components/Textarea/useTextareaStyles.js.map +1 -1
  28. package/lib-commonjs/components/TextareaField/TextareaField.js +0 -4
  29. package/lib-commonjs/components/TextareaField/TextareaField.js.map +1 -1
  30. package/lib-commonjs/components/TextareaField/index.js +0 -2
  31. package/lib-commonjs/components/TextareaField/index.js.map +1 -1
  32. package/lib-commonjs/index.js +0 -4
  33. package/lib-commonjs/index.js.map +1 -1
  34. package/package.json +6 -6
package/CHANGELOG.json CHANGED
@@ -2,7 +2,75 @@
2
2
  "name": "@fluentui/react-textarea",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 21 Dec 2022 10:17:15 GMT",
5
+ "date": "Mon, 09 Jan 2023 14:31:49 GMT",
6
+ "tag": "@fluentui/react-textarea_v9.1.11",
7
+ "version": "9.1.11",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-textarea",
13
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.14",
14
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-textarea",
19
+ "comment": "Bump @fluentui/react-utilities to v9.4.0",
20
+ "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Wed, 04 Jan 2023 01:40:37 GMT",
27
+ "tag": "@fluentui/react-textarea_v9.1.10",
28
+ "version": "9.1.10",
29
+ "comments": {
30
+ "none": [
31
+ {
32
+ "author": "martinhochel@microsoft.com",
33
+ "package": "@fluentui/react-textarea",
34
+ "commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
35
+ "comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
36
+ },
37
+ {
38
+ "author": "martinhochel@microsoft.com",
39
+ "package": "@fluentui/react-textarea",
40
+ "commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
41
+ "comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
42
+ }
43
+ ],
44
+ "patch": [
45
+ {
46
+ "author": "olfedias@microsoft.com",
47
+ "package": "@fluentui/react-textarea",
48
+ "commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
49
+ "comment": "chore: Update Griffel to latest version"
50
+ },
51
+ {
52
+ "author": "beachball",
53
+ "package": "@fluentui/react-textarea",
54
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.13",
55
+ "commit": "3e322d15529451be153e97298873253e21af4082"
56
+ },
57
+ {
58
+ "author": "beachball",
59
+ "package": "@fluentui/react-textarea",
60
+ "comment": "Bump @fluentui/react-utilities to v9.3.1",
61
+ "commit": "3e322d15529451be153e97298873253e21af4082"
62
+ },
63
+ {
64
+ "author": "beachball",
65
+ "package": "@fluentui/react-textarea",
66
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
67
+ "commit": "3e322d15529451be153e97298873253e21af4082"
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ {
73
+ "date": "Wed, 21 Dec 2022 10:20:32 GMT",
6
74
  "tag": "@fluentui/react-textarea_v9.1.9",
7
75
  "version": "9.1.9",
8
76
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/react-textarea
2
2
 
3
- This log was last generated on Wed, 21 Dec 2022 10:17:15 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 09 Jan 2023 14:31:49 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.1.11)
8
+
9
+ Mon, 09 Jan 2023 14:31:49 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.1.10..@fluentui/react-textarea_v9.1.11)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-field to v9.0.0-alpha.14 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
15
+ - Bump @fluentui/react-utilities to v9.4.0 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
16
+
17
+ ## [9.1.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.1.10)
18
+
19
+ Wed, 04 Jan 2023 01:40:37 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.1.9..@fluentui/react-textarea_v9.1.10)
21
+
22
+ ### Patches
23
+
24
+ - chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
25
+ - Bump @fluentui/react-field to v9.0.0-alpha.13 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
26
+ - Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
27
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
28
+
7
29
  ## [9.1.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.1.9)
8
30
 
9
- Wed, 21 Dec 2022 10:17:15 GMT
31
+ Wed, 21 Dec 2022 10:20:32 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.1.8..@fluentui/react-textarea_v9.1.9)
11
33
 
12
34
  ### Patches
@@ -5,7 +5,6 @@ import { useTextareaStyles_unstable } from './useTextareaStyles';
5
5
  /**
6
6
  * The Textarea component allows the user to enter and edit text in multiple lines.
7
7
  */
8
-
9
8
  export const Textarea = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useTextarea_unstable(props, ref);
11
10
  useTextareaStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-textarea/src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AAIA;;AAEG;;AACH,OAAO,MAAM,QAAQ,gBAAuC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC1F,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAD,EAAQ,GAAR,CAAlC;EAEA,0BAA0B,CAAC,KAAD,CAA1B;EACA,OAAO,uBAAuB,CAAC,KAAD,CAA9B;AACD,CAL2D,CAArD;AAOP,QAAQ,CAAC,WAAT,GAAuB,UAAvB","sourcesContent":["import * as React from 'react';\nimport { renderTextarea_unstable } from './renderTextarea';\nimport { useTextarea_unstable } from './useTextarea';\nimport { useTextareaStyles_unstable } from './useTextareaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { TextareaProps } from './Textarea.types';\n\n/**\n * The Textarea component allows the user to enter and edit text in multiple lines.\n */\nexport const Textarea: ForwardRefComponent<TextareaProps> = React.forwardRef((props, ref) => {\n const state = useTextarea_unstable(props, ref);\n\n useTextareaStyles_unstable(state);\n return renderTextarea_unstable(state);\n});\n\nTextarea.displayName = 'Textarea';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,0BAA0B,QAAQ,qBAAqB;AAIhE;;;AAGA,OAAO,MAAMC,QAAQ,gBAAuCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGN,oBAAoB,CAACI,KAAK,EAAEC,GAAG,CAAC;EAE9CJ,0BAA0B,CAACK,KAAK,CAAC;EACjC,OAAOP,uBAAuB,CAACO,KAAK,CAAC;AACvC,CAAC,CAAC;AAEFJ,QAAQ,CAACK,WAAW,GAAG,UAAU","names":["React","renderTextarea_unstable","useTextarea_unstable","useTextareaStyles_unstable","Textarea","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderTextarea_unstable } from './renderTextarea';\nimport { useTextarea_unstable } from './useTextarea';\nimport { useTextareaStyles_unstable } from './useTextareaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { TextareaProps } from './Textarea.types';\n\n/**\n * The Textarea component allows the user to enter and edit text in multiple lines.\n */\nexport const Textarea: ForwardRefComponent<TextareaProps> = React.forwardRef((props, ref) => {\n const state = useTextarea_unstable(props, ref);\n\n useTextareaStyles_unstable(state);\n return renderTextarea_unstable(state);\n});\n\nTextarea.displayName = 'Textarea';\n"]}
@@ -3,14 +3,15 @@ import { getSlots } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of Textarea
5
5
  */
6
-
7
6
  export const renderTextarea_unstable = state => {
8
7
  const {
9
8
  slots,
10
9
  slotProps
11
10
  } = getSlots(state);
12
- return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
- }, /*#__PURE__*/React.createElement(slots.textarea, { ...slotProps.textarea
11
+ return /*#__PURE__*/React.createElement(slots.root, {
12
+ ...slotProps.root
13
+ }, /*#__PURE__*/React.createElement(slots.textarea, {
14
+ ...slotProps.textarea
14
15
  }));
15
16
  };
16
17
  //# sourceMappingURL=renderTextarea.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-textarea/src/components/Textarea/renderTextarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAyB;EAC9D,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAgB,KAAhB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TextareaState, TextareaSlots } from './Textarea.types';\n\n/**\n * Render the final JSX of Textarea\n */\nexport const renderTextarea_unstable = (state: TextareaState) => {\n const { slots, slotProps } = getSlots<TextareaSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.textarea {...slotProps.textarea} />\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAoB,IAAI;EAC9D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAgBE,KAAK,CAAC;EAE3D,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,gBAC5BN,oBAACI,KAAK,CAACG,QAAQ;IAAA,GAAKF,SAAS,CAACE;EAAQ,EAAI,CAC/B;AAEjB,CAAC","names":["React","getSlots","renderTextarea_unstable","state","slots","slotProps","root","textarea"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/Textarea/renderTextarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TextareaState, TextareaSlots } from './Textarea.types';\n\n/**\n * Render the final JSX of Textarea\n */\nexport const renderTextarea_unstable = (state: TextareaState) => {\n const { slots, slotProps } = getSlots<TextareaSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.textarea {...slotProps.textarea} />\n </slots.root>\n );\n};\n"]}
@@ -8,7 +8,6 @@ import { getPartitionedNativeProps, resolveShorthand, useControllableState, useE
8
8
  * @param props - props from this instance of Textarea
9
9
  * @param ref - reference to root HTMLElement of Textarea
10
10
  */
11
-
12
11
  export const useTextarea_unstable = (props, ref) => {
13
12
  const {
14
13
  size = 'medium',
@@ -16,12 +15,10 @@ export const useTextarea_unstable = (props, ref) => {
16
15
  resize = 'none',
17
16
  onChange
18
17
  } = props;
19
-
20
18
  if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
21
19
  // eslint-disable-next-line no-console
22
20
  console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" + ' future.');
23
21
  }
24
-
25
22
  const [value, setValue] = useControllableState({
26
23
  state: props.value,
27
24
  defaultState: props.defaultValue,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-textarea/src/components/Textarea/useTextarea.ts"],"names":[],"mappings":"AACA,SACE,yBADF,EAEE,gBAFF,EAGE,oBAHF,EAIE,gBAJF,QAKO,2BALP;AAQA;;;;;;;;AAQG;;AACH,OAAO,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAAuB,GAAvB,KAA6E;EAC/G,MAAM;IAAE,IAAI,GAAG,QAAT;IAAmB,UAAU,GAAG,SAAhC;IAA2C,MAAM,GAAG,MAApD;IAA4D;EAA5D,IAAyE,KAA/E;;EAEA,IACE,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAAzB,KACC,UAAU,KAAK,sBAAf,IAAyC,UAAU,KAAK,uBADzD,CADF,EAGE;IACA;IACA,OAAO,CAAC,KAAR,CACE,iHACE,UAFJ;EAID;;EAED,MAAM,CAAC,KAAD,EAAQ,QAAR,IAAoB,oBAAoB,CAAC;IAC7C,KAAK,EAAE,KAAK,CAAC,KADgC;IAE7C,YAAY,EAAE,KAAK,CAAC,YAFyB;IAG7C,YAAY,EAAE;EAH+B,CAAD,CAA9C;EAMA,MAAM,WAAW,GAAG,yBAAyB,CAAC;IAC5C,KAD4C;IAE5C,kBAAkB,EAAE,UAFwB;IAG5C,iBAAiB,EAAE,CAAC,UAAD,EAAa,OAAb,EAAsB,cAAtB;EAHyB,CAAD,CAA7C;EAMA,MAAM,KAAK,GAAkB;IAC3B,IAD2B;IAE3B,UAF2B;IAG3B,MAH2B;IAI3B,UAAU,EAAE;MACV,IAAI,EAAE,MADI;MAEV,QAAQ,EAAE;IAFA,CAJe;IAQ3B,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,QAAP,EAAiB;MACzC,QAAQ,EAAE,IAD+B;MAEzC,YAAY,EAAE;QACZ,GADY;QAEZ,GAAG,WAAW,CAAC;MAFH;IAF2B,CAAjB,CARC;IAe3B,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;MACjC,QAAQ,EAAE,IADuB;MAEjC,YAAY,EAAE,WAAW,CAAC;IAFO,CAAb;EAfK,CAA7B;EAqBA,KAAK,CAAC,QAAN,CAAe,KAAf,GAAuB,KAAvB;EACA,KAAK,CAAC,QAAN,CAAe,QAAf,GAA0B,gBAAgB,CAAC,EAAE,IAAG;IAC9C,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAH,CAAU,KAA3B;IACA,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,EAAH,EAAO;MAAE,KAAK,EAAE;IAAT,CAAP,CAAR;IACA,QAAQ,CAAC,QAAD,CAAR;EACD,CAJyC,CAA1C;EAMA,OAAO,KAAP;AACD,CAvDM","sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { TextareaProps, TextareaState } from './Textarea.types';\n\n/**\n * Create the state required to render Textarea.\n *\n * The returned state can be modified with hooks such as useTextareaStyles_unstable,\n * before being passed to renderTextarea_unstable.\n *\n * @param props - props from this instance of Textarea\n * @param ref - reference to root HTMLElement of Textarea\n */\nexport const useTextarea_unstable = (props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>): TextareaState => {\n const { size = 'medium', appearance = 'outline', resize = 'none', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: undefined,\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'textarea',\n excludedPropNames: ['onChange', 'value', 'defaultValue'],\n });\n\n const state: TextareaState = {\n size,\n appearance,\n resize,\n components: {\n root: 'span',\n textarea: 'textarea',\n },\n textarea: resolveShorthand(props.textarea, {\n required: true,\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n }),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.textarea.value = value;\n state.textarea.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SACEA,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,QACX,2BAA2B;AAGlC;;;;;;;;;AASA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAoB,EAAEC,GAAmC,KAAmB;EAC/G,MAAM;IAAEC,IAAI,GAAG,QAAQ;IAAEC,UAAU,GAAG,SAAS;IAAEC,MAAM,GAAG,MAAM;IAAEC;EAAQ,CAAE,GAAGL,KAAK;EAEpF,IACEM,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,KACpCL,UAAU,KAAK,sBAAsB,IAAIA,UAAU,KAAK,uBAAuB,CAAC,EACjF;IACA;IACAM,OAAO,CAACC,KAAK,CACX,8GAA8G,GAC5G,UAAU,CACb;;EAGH,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGf,oBAAoB,CAAC;IAC7CgB,KAAK,EAAEb,KAAK,CAACW,KAAK;IAClBG,YAAY,EAAEd,KAAK,CAACe,YAAY;IAChCC,YAAY,EAAEC;GACf,CAAC;EAEF,MAAMC,WAAW,GAAGvB,yBAAyB,CAAC;IAC5CK,KAAK;IACLmB,kBAAkB,EAAE,UAAU;IAC9BC,iBAAiB,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc;GACxD,CAAC;EAEF,MAAMP,KAAK,GAAkB;IAC3BX,IAAI;IACJC,UAAU;IACVC,MAAM;IACNiB,UAAU,EAAE;MACVC,IAAI,EAAE,MAAM;MACZC,QAAQ,EAAE;KACX;IACDA,QAAQ,EAAE3B,gBAAgB,CAACI,KAAK,CAACuB,QAAQ,EAAE;MACzCC,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZxB,GAAG;QACH,GAAGiB,WAAW,CAACQ;;KAElB,CAAC;IACFJ,IAAI,EAAE1B,gBAAgB,CAACI,KAAK,CAACsB,IAAI,EAAE;MACjCE,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAEP,WAAW,CAACI;KAC3B;GACF;EAEDT,KAAK,CAACU,QAAQ,CAACZ,KAAK,GAAGA,KAAK;EAC5BE,KAAK,CAACU,QAAQ,CAAClB,QAAQ,GAAGP,gBAAgB,CAAC6B,EAAE,IAAG;IAC9C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAAClB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGsB,EAAE,EAAE;MAAEhB,KAAK,EAAEiB;IAAQ,CAAE,CAAC;IACnChB,QAAQ,CAACgB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOf,KAAK;AACd,CAAC","names":["getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useTextarea_unstable","props","ref","size","appearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","state","defaultState","defaultValue","initialState","undefined","nativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","required","defaultProps","primary","ev","newValue","target"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/Textarea/useTextarea.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { TextareaProps, TextareaState } from './Textarea.types';\n\n/**\n * Create the state required to render Textarea.\n *\n * The returned state can be modified with hooks such as useTextareaStyles_unstable,\n * before being passed to renderTextarea_unstable.\n *\n * @param props - props from this instance of Textarea\n * @param ref - reference to root HTMLElement of Textarea\n */\nexport const useTextarea_unstable = (props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>): TextareaState => {\n const { size = 'medium', appearance = 'outline', resize = 'none', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: undefined,\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'textarea',\n excludedPropNames: ['onChange', 'value', 'defaultValue'],\n });\n\n const state: TextareaState = {\n size,\n appearance,\n resize,\n components: {\n root: 'span',\n textarea: 'textarea',\n },\n textarea: resolveShorthand(props.textarea, {\n required: true,\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n }),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.textarea.value = value;\n state.textarea.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}