@fluentui/react-textarea 9.1.13 → 9.2.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/CHANGELOG.json CHANGED
@@ -2,7 +2,75 @@
2
2
  "name": "@fluentui/react-textarea",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 23 Jan 2023 16:41:44 GMT",
5
+ "date": "Tue, 31 Jan 2023 19:50:42 GMT",
6
+ "tag": "@fluentui/react-textarea_v9.2.1",
7
+ "version": "9.2.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-textarea",
13
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.18",
14
+ "commit": "22477ef4202cd24add6ebf823196b5888c9d8083"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-textarea",
19
+ "comment": "Bump @fluentui/react-utilities to v9.5.1",
20
+ "commit": "22477ef4202cd24add6ebf823196b5888c9d8083"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Thu, 26 Jan 2023 13:31:01 GMT",
27
+ "tag": "@fluentui/react-textarea_v9.2.0",
28
+ "version": "9.2.0",
29
+ "comments": {
30
+ "minor": [
31
+ {
32
+ "author": "miroslav.stastny@microsoft.com",
33
+ "package": "@fluentui/react-textarea",
34
+ "commit": "6f29c8f65b2db6125efbd2a7ec2d7abdd0f44601",
35
+ "comment": "feat: Allow default appearance override"
36
+ },
37
+ {
38
+ "author": "olfedias@microsoft.com",
39
+ "package": "@fluentui/react-textarea",
40
+ "commit": "fdc548e6e52077bad22ced4a332b39c7b8641a6c",
41
+ "comment": "feat: export TextareaOnChangeData type"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-textarea",
46
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.17",
47
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-textarea",
52
+ "comment": "Bump @fluentui/react-shared-contexts to v9.2.0",
53
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
54
+ },
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-textarea",
58
+ "comment": "Bump @fluentui/react-utilities to v9.5.0",
59
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
60
+ }
61
+ ],
62
+ "patch": [
63
+ {
64
+ "author": "behowell@microsoft.com",
65
+ "package": "@fluentui/react-textarea",
66
+ "commit": "d6e98c0b5390c5c7e03601537b2026307e01a8d4",
67
+ "comment": "Deprecate TextareaField_unstable in favor of Field with Textarea as its child."
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ {
73
+ "date": "Mon, 23 Jan 2023 16:43:12 GMT",
6
74
  "tag": "@fluentui/react-textarea_v9.1.13",
7
75
  "version": "9.1.13",
8
76
  "comments": {
@@ -11,7 +79,7 @@
11
79
  "author": "beachball",
12
80
  "package": "@fluentui/react-textarea",
13
81
  "comment": "Bump @fluentui/react-field to v9.0.0-alpha.16",
14
- "commit": "86a28f6ebcc84819c695f12b841b9377736fb5f7"
82
+ "commit": "828c4260edc4fba07c9ccc8e94f15051c7fd25d3"
15
83
  }
16
84
  ]
17
85
  }
package/CHANGELOG.md CHANGED
@@ -1,17 +1,44 @@
1
1
  # Change Log - @fluentui/react-textarea
2
2
 
3
- This log was last generated on Mon, 23 Jan 2023 16:41:44 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 31 Jan 2023 19:50:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.2.1)
8
+
9
+ Tue, 31 Jan 2023 19:50:42 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.2.0..@fluentui/react-textarea_v9.2.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-field to v9.0.0-alpha.18 ([PR #26491](https://github.com/microsoft/fluentui/pull/26491) by beachball)
15
+ - Bump @fluentui/react-utilities to v9.5.1 ([PR #26491](https://github.com/microsoft/fluentui/pull/26491) by beachball)
16
+
17
+ ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.2.0)
18
+
19
+ Thu, 26 Jan 2023 13:31:01 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.1.13..@fluentui/react-textarea_v9.2.0)
21
+
22
+ ### Minor changes
23
+
24
+ - feat: Allow default appearance override ([PR #25262](https://github.com/microsoft/fluentui/pull/25262) by miroslav.stastny@microsoft.com)
25
+ - feat: export TextareaOnChangeData type ([PR #26455](https://github.com/microsoft/fluentui/pull/26455) by olfedias@microsoft.com)
26
+ - Bump @fluentui/react-field to v9.0.0-alpha.17 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
27
+ - Bump @fluentui/react-shared-contexts to v9.2.0 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
28
+ - Bump @fluentui/react-utilities to v9.5.0 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
29
+
30
+ ### Patches
31
+
32
+ - Deprecate TextareaField_unstable in favor of Field with Textarea as its child. ([PR #26430](https://github.com/microsoft/fluentui/pull/26430) by behowell@microsoft.com)
33
+
7
34
  ## [9.1.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.1.13)
8
35
 
9
- Mon, 23 Jan 2023 16:41:44 GMT
36
+ Mon, 23 Jan 2023 16:43:12 GMT
10
37
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.1.12..@fluentui/react-textarea_v9.1.13)
11
38
 
12
39
  ### Patches
13
40
 
14
- - Bump @fluentui/react-field to v9.0.0-alpha.16 ([PR #26454](https://github.com/microsoft/fluentui/pull/26454) by beachball)
41
+ - Bump @fluentui/react-field to v9.0.0-alpha.16 ([PR #26434](https://github.com/microsoft/fluentui/pull/26434) by beachball)
15
42
 
16
43
  ## [9.1.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.1.12)
17
44
 
package/dist/index.d.ts CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  import type { ComponentProps } from '@fluentui/react-utilities';
4
4
  import type { ComponentState } from '@fluentui/react-utilities';
5
- import { FieldControl } from '@fluentui/react-field';
6
- import type { FieldProps } from '@fluentui/react-field';
7
- import { FieldSlots } from '@fluentui/react-field';
5
+ import { DeprecatedFieldProps } from '@fluentui/react-field';
8
6
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
9
7
  import * as React_2 from 'react';
10
8
  import type { Slot } from '@fluentui/react-utilities';
@@ -22,16 +20,26 @@ export declare const Textarea: ForwardRefComponent<TextareaProps>;
22
20
 
23
21
  export declare const textareaClassNames: SlotClassNames<TextareaSlots>;
24
22
 
23
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
25
24
  export declare const TextareaField_unstable: ForwardRefComponent<TextareaFieldProps_unstable>;
26
25
 
27
- export declare const textareaFieldClassNames: SlotClassNames<FieldSlots<FieldControl>>;
26
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
27
+ export declare const textareaFieldClassNames: {
28
+ control: string;
29
+ root: string;
30
+ label: string;
31
+ validationMessage: string;
32
+ validationMessageIcon: string;
33
+ hint: string;
34
+ };
28
35
 
29
- export declare type TextareaFieldProps_unstable = FieldProps<typeof Textarea>;
36
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
37
+ export declare type TextareaFieldProps_unstable = DeprecatedFieldProps<TextareaProps>;
30
38
 
31
39
  /**
32
40
  * Data passed to the `onChange` callback when the textarea's value changes.
33
41
  */
34
- declare type TextareaOnChangeData = {
42
+ export declare type TextareaOnChangeData = {
35
43
  value: string;
36
44
  };
37
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/Textarea/Textarea.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TextareaSlots = {\n /**\n * Wrapper element used for displaying the borders for Textarea. This wrapper is needed due to the focus\n * indicator border animation. For more information, see Spec.md\n *\n * The root only receives `className` and `style`. All other props are applied to the `textarea` slot.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The `<textarea>` element. This is the primary slot, all native props and ref are applied to this slot.\n */\n textarea: NonNullable<Slot<'textarea'>>;\n};\n\n/**\n * Textarea Props\n */\nexport type TextareaProps = Omit<\n ComponentProps<Partial<TextareaSlots>, 'textarea'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Styling the Textarea should use.\n *\n * @default outline\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';\n\n /**\n * The default value of the Textarea.\n */\n defaultValue?: string;\n\n /**\n * Callback for when the user changes the value.\n */\n onChange?: (ev: React.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;\n\n /**\n * Which direction the Textarea is allowed to be resized.\n *\n * @default none\n */\n resize?: 'none' | 'horizontal' | 'vertical' | 'both';\n\n /**\n * Size of the Textarea.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * The value of the Textarea.\n */\n value?: string;\n};\n\n/**\n * State used in rendering Textarea\n */\nexport type TextareaState = ComponentState<TextareaSlots> &\n Required<Pick<TextareaProps, 'appearance' | 'resize' | 'size'>>;\n\n/**\n * Data passed to the `onChange` callback when the textarea's value changes.\n */\ntype TextareaOnChangeData = {\n value: string;\n};\n"]}
1
+ {"version":3,"file":"Textarea.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/Textarea/Textarea.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TextareaSlots = {\n /**\n * Wrapper element used for displaying the borders for Textarea. This wrapper is needed due to the focus\n * indicator border animation. For more information, see Spec.md\n *\n * The root only receives `className` and `style`. All other props are applied to the `textarea` slot.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The `<textarea>` element. This is the primary slot, all native props and ref are applied to this slot.\n */\n textarea: NonNullable<Slot<'textarea'>>;\n};\n\n/**\n * Textarea Props\n */\nexport type TextareaProps = Omit<\n ComponentProps<Partial<TextareaSlots>, 'textarea'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Styling the Textarea should use.\n *\n * @default outline\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';\n\n /**\n * The default value of the Textarea.\n */\n defaultValue?: string;\n\n /**\n * Callback for when the user changes the value.\n */\n onChange?: (ev: React.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;\n\n /**\n * Which direction the Textarea is allowed to be resized.\n *\n * @default none\n */\n resize?: 'none' | 'horizontal' | 'vertical' | 'both';\n\n /**\n * Size of the Textarea.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * The value of the Textarea.\n */\n value?: string;\n};\n\n/**\n * State used in rendering Textarea\n */\nexport type TextareaState = ComponentState<TextareaSlots> &\n Required<Pick<TextareaProps, 'appearance' | 'resize' | 'size'>>;\n\n/**\n * Data passed to the `onChange` callback when the textarea's value changes.\n */\nexport type TextareaOnChangeData = {\n value: string;\n};\n"]}
@@ -1,4 +1,5 @@
1
1
  import { getPartitionedNativeProps, resolveShorthand, useControllableState, useEventCallback } from '@fluentui/react-utilities';
2
+ import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';
2
3
  /**
3
4
  * Create the state required to render Textarea.
4
5
  *
@@ -9,9 +10,11 @@ import { getPartitionedNativeProps, resolveShorthand, useControllableState, useE
9
10
  * @param ref - reference to root HTMLElement of Textarea
10
11
  */
11
12
  export const useTextarea_unstable = (props, ref) => {
13
+ var _a;
14
+ const overrides = useOverrides();
12
15
  const {
13
16
  size = 'medium',
14
- appearance = 'outline',
17
+ appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
15
18
  resize = 'none',
16
19
  onChange
17
20
  } = props;
@@ -1 +1 @@
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"]}
1
+ {"version":3,"mappings":"AACA,SACEA,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,QACX,2BAA2B;AAElC,SAASC,qBAAqB,IAAIC,YAAY,QAAQ,iCAAiC;AAEvF;;;;;;;;;AASA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAoB,EAAEC,GAAmC,KAAmB;;EAC/G,MAAMC,SAAS,GAAGJ,YAAY,EAAE;EAEhC,MAAM;IACJK,IAAI,GAAG,QAAQ;IACfC,UAAU,GAAG,eAAS,CAACC,sBAAsB,mCAAI,SAAS;IAC1DC,MAAM,GAAG,MAAM;IACfC;EAAQ,CACT,GAAGP,KAAK;EAET,IACEQ,OAAO,CAACC,G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ACgB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOf,KAAK;AACd,CAAC","names":["getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useOverrides_unstable","useOverrides","useTextarea_unstable","props","ref","overrides","size","appearance","inputDefaultAppearance","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';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\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 overrides = useOverrides();\n\n const {\n size = 'medium',\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n resize = 'none',\n onChange,\n } = 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"]}
@@ -1,14 +1,8 @@
1
- import * as React from 'react';
2
- import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '@fluentui/react-field';
3
- import { Textarea } from '../../Textarea';
4
- export const textareaFieldClassNames = /*#__PURE__*/getFieldClassNames('TextareaField');
5
- export const TextareaField = /*#__PURE__*/React.forwardRef((props, ref) => {
6
- const state = useField_unstable(props, ref, {
7
- component: Textarea,
8
- classNames: textareaFieldClassNames
9
- });
10
- useFieldStyles_unstable(state);
11
- return renderField_unstable(state);
12
- });
13
- TextareaField.displayName = 'TextareaField';
1
+ /* eslint-disable deprecation/deprecation */
2
+ import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
3
+ import { Textarea, textareaClassNames } from '../../Textarea';
4
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
5
+ export const textareaFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(textareaClassNames.root);
6
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
7
+ export const TextareaField = /*#__PURE__*/makeDeprecatedField(Textarea);
14
8
  //# sourceMappingURL=TextareaField.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,uBAAuB;AAE9B,SAASC,QAAQ,QAAQ,gBAAgB;AAIzC,OAAO,MAAMC,uBAAuB,gBAAGL,kBAAkB,CAAC,eAAe,CAAC;AAE1E,OAAO,MAAMM,aAAa,gBAA4CP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpG,MAAMC,KAAK,GAAGP,iBAAiB,CAACK,KAAK,EAAEC,GAAG,EAAE;IAAEE,SAAS,EAAEP,QAAQ;IAAEQ,UAAU,EAAEP;EAAuB,CAAE,CAAC;EACzGH,uBAAuB,CAACQ,KAAK,CAAC;EAC9B,OAAOT,oBAAoB,CAACS,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFJ,aAAa,CAACO,WAAW,GAAG,eAAe","names":["React","getFieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","Textarea","textareaFieldClassNames","TextareaField","forwardRef","props","ref","state","component","classNames","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea } from '../../Textarea';\n\nexport type TextareaFieldProps = FieldProps<typeof Textarea>;\n\nexport const textareaFieldClassNames = getFieldClassNames('TextareaField');\n\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Textarea, classNames: textareaFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nTextareaField.displayName = 'TextareaField';\n"]}
1
+ {"version":3,"mappings":"AAAA;AACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ,uBAAuB;AAE/G,SAASC,QAAQ,EAAEC,kBAAkB,QAAuB,gBAAgB;AAI5E;AACA,OAAO,MAAMC,uBAAuB,gBAAGJ,4BAA4B,CAACG,kBAAkB,CAACE,IAAI,CAAC;AAC5F;AACA,OAAO,MAAMC,aAAa,gBAA4CL,mBAAmB,CAACC,QAAQ,CAAC","names":["getDeprecatedFieldClassNames","makeDeprecatedField","Textarea","textareaClassNames","textareaFieldClassNames","root","TextareaField"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea, textareaClassNames, TextareaProps } from '../../Textarea';\n\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport type TextareaFieldProps = DeprecatedFieldProps<TextareaProps>;\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const textareaFieldClassNames = getDeprecatedFieldClassNames(textareaClassNames.root);\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = makeDeprecatedField(Textarea);\n"]}
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { Textarea, renderTextarea_unstable, textareaClassNames, useTextareaStyles_unstable, useTextarea_unstable } from './Textarea';
2
+ // eslint-disable-next-line deprecation/deprecation
2
3
  export { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';
3
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,oBAAoB,QACf,YAAY;AAGnB,SAASC,aAAa,IAAIC,sBAAsB,EAAEC,uBAAuB,QAAQ,iBAAiB","names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable","TextareaField","TextareaField_unstable","textareaFieldClassNames"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/index.ts"],"sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
1
+ {"version":3,"mappings":"AAAA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,oBAAoB,QACf,YAAY;AAGnB;AACA,SAASC,aAAa,IAAIC,sBAAsB,EAAEC,uBAAuB,QAAQ,iBAAiB","names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable","TextareaField","TextareaField_unstable","textareaFieldClassNames"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/index.ts"],"sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/Textarea/Textarea.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TextareaSlots = {\n /**\n * Wrapper element used for displaying the borders for Textarea. This wrapper is needed due to the focus\n * indicator border animation. For more information, see Spec.md\n *\n * The root only receives `className` and `style`. All other props are applied to the `textarea` slot.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The `<textarea>` element. This is the primary slot, all native props and ref are applied to this slot.\n */\n textarea: NonNullable<Slot<'textarea'>>;\n};\n\n/**\n * Textarea Props\n */\nexport type TextareaProps = Omit<\n ComponentProps<Partial<TextareaSlots>, 'textarea'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Styling the Textarea should use.\n *\n * @default outline\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';\n\n /**\n * The default value of the Textarea.\n */\n defaultValue?: string;\n\n /**\n * Callback for when the user changes the value.\n */\n onChange?: (ev: React.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;\n\n /**\n * Which direction the Textarea is allowed to be resized.\n *\n * @default none\n */\n resize?: 'none' | 'horizontal' | 'vertical' | 'both';\n\n /**\n * Size of the Textarea.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * The value of the Textarea.\n */\n value?: string;\n};\n\n/**\n * State used in rendering Textarea\n */\nexport type TextareaState = ComponentState<TextareaSlots> &\n Required<Pick<TextareaProps, 'appearance' | 'resize' | 'size'>>;\n\n/**\n * Data passed to the `onChange` callback when the textarea's value changes.\n */\ntype TextareaOnChangeData = {\n value: string;\n};\n"]}
1
+ {"version":3,"file":"Textarea.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/Textarea/Textarea.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TextareaSlots = {\n /**\n * Wrapper element used for displaying the borders for Textarea. This wrapper is needed due to the focus\n * indicator border animation. For more information, see Spec.md\n *\n * The root only receives `className` and `style`. All other props are applied to the `textarea` slot.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The `<textarea>` element. This is the primary slot, all native props and ref are applied to this slot.\n */\n textarea: NonNullable<Slot<'textarea'>>;\n};\n\n/**\n * Textarea Props\n */\nexport type TextareaProps = Omit<\n ComponentProps<Partial<TextareaSlots>, 'textarea'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Styling the Textarea should use.\n *\n * @default outline\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';\n\n /**\n * The default value of the Textarea.\n */\n defaultValue?: string;\n\n /**\n * Callback for when the user changes the value.\n */\n onChange?: (ev: React.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;\n\n /**\n * Which direction the Textarea is allowed to be resized.\n *\n * @default none\n */\n resize?: 'none' | 'horizontal' | 'vertical' | 'both';\n\n /**\n * Size of the Textarea.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * The value of the Textarea.\n */\n value?: string;\n};\n\n/**\n * State used in rendering Textarea\n */\nexport type TextareaState = ComponentState<TextareaSlots> &\n Required<Pick<TextareaProps, 'appearance' | 'resize' | 'size'>>;\n\n/**\n * Data passed to the `onChange` callback when the textarea's value changes.\n */\nexport type TextareaOnChangeData = {\n value: string;\n};\n"]}
@@ -1,4 +1,4 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
1
+ define(["require", "exports", "tslib", "@fluentui/react-utilities", "@fluentui/react-shared-contexts"], function (require, exports, tslib_1, react_utilities_1, react_shared_contexts_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.useTextarea_unstable = void 0;
@@ -12,18 +12,20 @@ define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (r
12
12
  * @param ref - reference to root HTMLElement of Textarea
13
13
  */
14
14
  var useTextarea_unstable = function (props, ref) {
15
- var _a = props.size, size = _a === void 0 ? 'medium' : _a, _b = props.appearance, appearance = _b === void 0 ? 'outline' : _b, _c = props.resize, resize = _c === void 0 ? 'none' : _c, onChange = props.onChange;
15
+ var _a;
16
+ var overrides = react_shared_contexts_1.useOverrides_unstable();
17
+ var _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.appearance, appearance = _c === void 0 ? (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline' : _c, _d = props.resize, resize = _d === void 0 ? 'none' : _d, onChange = props.onChange;
16
18
  if (process.env.NODE_ENV !== 'production' &&
17
19
  (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
18
20
  // eslint-disable-next-line no-console
19
21
  console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" +
20
22
  ' future.');
21
23
  }
22
- var _d = react_utilities_1.useControllableState({
24
+ var _e = react_utilities_1.useControllableState({
23
25
  state: props.value,
24
26
  defaultState: props.defaultValue,
25
27
  initialState: undefined,
26
- }), value = _d[0], setValue = _d[1];
28
+ }), value = _e[0], setValue = _e[1];
27
29
  var nativeProps = react_utilities_1.getPartitionedNativeProps({
28
30
  props: props,
29
31
  primarySlotTagName: 'textarea',
@@ -1 +1 @@
1
- {"version":3,"file":"useTextarea.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/Textarea/useTextarea.ts"],"names":[],"mappings":";;;;IASA;;;;;;;;OAQG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAAoB,EAAE,GAAmC;QACpF,IAAA,KAAuE,KAAK,KAA7D,EAAf,IAAI,mBAAG,QAAQ,KAAA,EAAE,KAAsD,KAAK,WAArC,EAAtB,UAAU,mBAAG,SAAS,KAAA,EAAE,KAA8B,KAAK,OAApB,EAAf,MAAM,mBAAG,MAAM,KAAA,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAErF,IACE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;YACrC,CAAC,UAAU,KAAK,sBAAsB,IAAI,UAAU,KAAK,uBAAuB,CAAC,EACjF;YACA,sCAAsC;YACtC,OAAO,CAAC,KAAK,CACX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AAC;IAvDW,QAAA,oBAAoB,wBAuD/B","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"]}
1
+ {"version":3,"file":"useTextarea.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/Textarea/useTextarea.ts"],"names":[],"mappings":";;;;IAUA;;;;;;;;OAQG;IACI,IAAM,oBAAoB,GAAG,UAAC,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gBACjC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,WAAW,CAAC,IAAI;aAC/B,CAAC;SACH,CAAC;QAEF,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QAC7B,KAAK,CAAC,QAAQ,CAAC,QAAQ,GAAG,kCAAgB,CAAC,UAAA,EAAE;YAC3C,IAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;YACjC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9DW,QAAA,oBAAoB,wBA8D/B","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';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\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 overrides = useOverrides();\n\n const {\n size = 'medium',\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n resize = 'none',\n onChange,\n } = 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"]}
@@ -1,13 +1,10 @@
1
- define(["require", "exports", "react", "@fluentui/react-field", "../../Textarea"], function (require, exports, React, react_field_1, Textarea_1) {
1
+ define(["require", "exports", "@fluentui/react-field", "../../Textarea"], function (require, exports, react_field_1, Textarea_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.TextareaField = exports.textareaFieldClassNames = void 0;
5
- exports.textareaFieldClassNames = react_field_1.getFieldClassNames('TextareaField');
6
- exports.TextareaField = React.forwardRef(function (props, ref) {
7
- var state = react_field_1.useField_unstable(props, ref, { component: Textarea_1.Textarea, classNames: exports.textareaFieldClassNames });
8
- react_field_1.useFieldStyles_unstable(state);
9
- return react_field_1.renderField_unstable(state);
10
- });
11
- exports.TextareaField.displayName = 'TextareaField';
5
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
6
+ exports.textareaFieldClassNames = react_field_1.getDeprecatedFieldClassNames(Textarea_1.textareaClassNames.root);
7
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
8
+ exports.TextareaField = react_field_1.makeDeprecatedField(Textarea_1.Textarea);
12
9
  });
13
10
  //# sourceMappingURL=TextareaField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"names":[],"mappings":";;;;IAaa,QAAA,uBAAuB,GAAG,gCAAkB,CAAC,eAAe,CAAC,CAAC;IAE9D,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,+BAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,mBAAQ,EAAE,UAAU,EAAE,+BAAuB,EAAE,CAAC,CAAC;QAC1G,qCAAuB,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea } from '../../Textarea';\n\nexport type TextareaFieldProps = FieldProps<typeof Textarea>;\n\nexport const textareaFieldClassNames = getFieldClassNames('TextareaField');\n\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Textarea, classNames: textareaFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nTextareaField.displayName = 'TextareaField';\n"]}
1
+ {"version":3,"file":"TextareaField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"names":[],"mappings":";;;;IAOA,yEAAyE;IAC5D,QAAA,uBAAuB,GAAG,0CAA4B,CAAC,6BAAkB,CAAC,IAAI,CAAC,CAAC;IAC7F,yEAAyE;IAC5D,QAAA,aAAa,GAA4C,iCAAmB,CAAC,mBAAQ,CAAC,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea, textareaClassNames, TextareaProps } from '../../Textarea';\n\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport type TextareaFieldProps = DeprecatedFieldProps<TextareaProps>;\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const textareaFieldClassNames = getDeprecatedFieldClassNames(textareaClassNames.root);\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = makeDeprecatedField(Textarea);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-textarea/src/index.ts"],"names":[],"mappings":";;;;IACE,oGAAA,QAAQ,OAAA;IACR,mHAAA,uBAAuB,OAAA;IACvB,8GAAA,kBAAkB,OAAA;IAClB,sHAAA,0BAA0B,OAAA;IAC1B,gHAAA,oBAAoB,OAAA;IAIb,uHAAA,aAAa,OAA0B;IAAE,wHAAA,uBAAuB,OAAA","sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-textarea/src/index.ts"],"names":[],"mappings":";;;;IACE,oGAAA,QAAQ,OAAA;IACR,mHAAA,uBAAuB,OAAA;IACvB,8GAAA,kBAAkB,OAAA;IAClB,sHAAA,0BAA0B,OAAA;IAC1B,gHAAA,oBAAoB,OAAA;IAKb,uHAAA,aAAa,OAA0B;IAAE,wHAAA,uBAAuB,OAAA","sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useTextarea_unstable = void 0;
7
7
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
8
9
  /**
9
10
  * Create the state required to render Textarea.
10
11
  *
@@ -15,9 +16,11 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
16
  * @param ref - reference to root HTMLElement of Textarea
16
17
  */
17
18
  const useTextarea_unstable = (props, ref) => {
19
+ var _a;
20
+ const overrides = react_shared_contexts_1.useOverrides_unstable();
18
21
  const {
19
22
  size = 'medium',
20
- appearance = 'outline',
23
+ appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
21
24
  resize = 'none',
22
25
  onChange
23
26
  } = props;
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAQA;;;;;;;;;AASO,MAAMA,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,GAAGC,sCAAoB,CAAC;IAC7CC,KAAK,EAAEd,KAAK,CAACW,KAAK;IAClBI,YAAY,EAAEf,KAAK,CAACgB,YAAY;IAChCC,YAAY,EAAEC;GACf,CAAC;EAEF,MAAMC,WAAW,GAAGN,2CAAyB,CAAC;IAC5Cb,KAAK;IACLoB,kBAAkB,EAAE,UAAU;IAC9BC,iBAAiB,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc;GACxD,CAAC;EAEF,MAAMP,KAAK,GAAkB;IAC3BZ,IAAI;IACJC,UAAU;IACVC,MAAM;IACNkB,UAAU,EAAE;MACVC,IAAI,EAAE,MAAM;MACZC,QAAQ,EAAE;KACX;IACDA,QAAQ,EAAEX,kCAAgB,CAACb,KAAK,CAACwB,QAAQ,EAAE;MACzCC,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZzB,GAAG;QACH,GAAGkB,WAAW,CAACQ;;KAElB,CAAC;IACFJ,IAAI,EAAEV,kCAAgB,CAACb,KAAK,CAACuB,IAAI,EAAE;MACjCE,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAEP,WAAW,CAACI;KAC3B;GACF;EAEDT,KAAK,CAACU,QAAQ,CAACb,KAAK,GAAGA,KAAK;EAC5BG,KAAK,CAACU,QAAQ,CAACnB,QAAQ,GAAGQ,kCAAgB,CAACe,EAAE,IAAG;IAC9C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAACnB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGuB,EAAE,EAAE;MAAEjB,KAAK,EAAEkB;IAAQ,CAAE,CAAC;IACnCjB,QAAQ,CAACiB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOf,KAAK;AACd,CAAC;AAvDYiB,4BAAoB","names":["useTextarea_unstable","props","ref","size","appearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","react_utilities_1","state","defaultState","defaultValue","initialState","undefined","nativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","required","defaultProps","primary","ev","newValue","target","exports"],"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"]}
1
+ {"version":3,"mappings":";;;;;;AAC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CAACU,QAAQ,CAACb,KAAK,GAAGA,KAAK;EAC5BG,KAAK,CAACU,QAAQ,CAACnB,QAAQ,GAAGQ,kCAAgB,CAACe,EAAE,IAAG;IAC9C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAACnB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGuB,EAAE,EAAE;MAAEjB,KAAK,EAAEkB;IAAQ,CAAE,CAAC;IACnCjB,QAAQ,CAACiB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOf,KAAK;AACd,CAAC;AA9DYiB,4BAAoB","names":["useTextarea_unstable","props","ref","overrides","react_shared_contexts_1","size","appearance","inputDefaultAppearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","react_utilities_1","state","defaultState","defaultValue","initialState","undefined","nativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","required","defaultProps","primary","ev","newValue","target","exports"],"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';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\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 overrides = useOverrides();\n\n const {\n size = 'medium',\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n resize = 'none',\n onChange,\n } = 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"]}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TextareaField = exports.textareaFieldClassNames = void 0;
7
- const React = /*#__PURE__*/require("react");
7
+ /* eslint-disable deprecation/deprecation */
8
8
  const react_field_1 = /*#__PURE__*/require("@fluentui/react-field");
9
9
  const Textarea_1 = /*#__PURE__*/require("../../Textarea");
10
- exports.textareaFieldClassNames = /*#__PURE__*/react_field_1.getFieldClassNames('TextareaField');
11
- exports.TextareaField = /*#__PURE__*/React.forwardRef((props, ref) => {
12
- const state = react_field_1.useField_unstable(props, ref, {
13
- component: Textarea_1.Textarea,
14
- classNames: exports.textareaFieldClassNames
15
- });
16
- react_field_1.useFieldStyles_unstable(state);
17
- return react_field_1.renderField_unstable(state);
18
- });
19
- exports.TextareaField.displayName = 'TextareaField';
10
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
11
+ exports.textareaFieldClassNames = /*#__PURE__*/react_field_1.getDeprecatedFieldClassNames(Textarea_1.textareaClassNames.root);
12
+ /** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
13
+ exports.TextareaField = /*#__PURE__*/react_field_1.makeDeprecatedField(Textarea_1.Textarea);
20
14
  //# sourceMappingURL=TextareaField.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AAOA;AAIaA,+BAAuB,gBAAGC,gCAAkB,CAAC,eAAe,CAAC;AAE7DD,qBAAa,gBAA4CE,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpG,MAAMC,KAAK,GAAGL,+BAAiB,CAACG,KAAK,EAAEC,GAAG,EAAE;IAAEE,SAAS,EAAEC,mBAAQ;IAAEC,UAAU,EAAET;EAAuB,CAAE,CAAC;EACzGC,qCAAuB,CAACK,KAAK,CAAC;EAC9B,OAAOL,kCAAoB,CAACK,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFN,qBAAa,CAACU,WAAW,GAAG,eAAe","names":["exports","react_field_1","React","forwardRef","props","ref","state","component","Textarea_1","classNames","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea } from '../../Textarea';\n\nexport type TextareaFieldProps = FieldProps<typeof Textarea>;\n\nexport const textareaFieldClassNames = getFieldClassNames('TextareaField');\n\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Textarea, classNames: textareaFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nTextareaField.displayName = 'TextareaField';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AAIA;AACaA,+BAAuB,gBAAGC,0CAA4B,CAACC,6BAAkB,CAACC,IAAI,CAAC;AAC5F;AACaH,qBAAa,gBAA4CC,iCAAmB,CAACC,mBAAQ,CAAC","names":["exports","react_field_1","Textarea_1","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/components/TextareaField/TextareaField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Textarea, textareaClassNames, TextareaProps } from '../../Textarea';\n\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport type TextareaFieldProps = DeprecatedFieldProps<TextareaProps>;\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const textareaFieldClassNames = getDeprecatedFieldClassNames(textareaClassNames.root);\n/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */\nexport const TextareaField: ForwardRefComponent<TextareaFieldProps> = makeDeprecatedField(Textarea);\n"]}
@@ -35,6 +35,7 @@ Object.defineProperty(exports, "useTextarea_unstable", {
35
35
  return Textarea_1.useTextarea_unstable;
36
36
  }
37
37
  });
38
+ // eslint-disable-next-line deprecation/deprecation
38
39
  var TextareaField_1 = /*#__PURE__*/require("./TextareaField");
39
40
  Object.defineProperty(exports, "TextareaField_unstable", {
40
41
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACEA;EAAAC;EAAAC;IAAA,0BAAQ;EAAA;AAAA;AACRF;EAAAC;EAAAC;IAAA,yCAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,oCAAkB;EAAA;AAAA;AAClBF;EAAAC;EAAAC;IAAA,4CAA0B;EAAA;AAAA;AAC1BF;EAAAC;EAAAC;IAAA,sCAAoB;EAAA;AAAA;AAItB;AAASF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AAA4BF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/index.ts"],"sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACEA;EAAAC;EAAAC;IAAA,0BAAQ;EAAA;AAAA;AACRF;EAAAC;EAAAC;IAAA,yCAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,oCAAkB;EAAA;AAAA;AAClBF;EAAAC;EAAAC;IAAA,4CAA0B;EAAA;AAAA;AAC1BF;EAAAC;EAAAC;IAAA,sCAAoB;EAAA;AAAA;AAItB;AACA;AAASF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AAA4BF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-textarea/src/index.ts"],"sourcesContent":["export {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './Textarea';\nexport type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './Textarea';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { TextareaField as TextareaField_unstable, textareaFieldClassNames } from './TextareaField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { TextareaFieldProps as TextareaFieldProps_unstable } from './TextareaField';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-textarea",
3
- "version": "9.1.13",
3
+ "version": "9.2.1",
4
4
  "description": "Fluent UI TextArea component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -32,9 +32,10 @@
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-field": "9.0.0-alpha.16",
35
+ "@fluentui/react-field": "9.0.0-alpha.18",
36
+ "@fluentui/react-shared-contexts": "^9.2.0",
36
37
  "@fluentui/react-theme": "^9.1.5",
37
- "@fluentui/react-utilities": "^9.4.0",
38
+ "@fluentui/react-utilities": "^9.5.1",
38
39
  "@griffel/react": "^1.5.2",
39
40
  "tslib": "^2.1.0"
40
41
  },