@fluentui/react-textarea 9.5.6 → 9.6.0

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 CHANGED
@@ -1,12 +1,31 @@
1
1
  # Change Log - @fluentui/react-textarea
2
2
 
3
- This log was last generated on Fri, 04 Jul 2025 10:00:11 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Jul 2025 13:45:50 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.6.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.6.0)
8
+
9
+ Thu, 17 Jul 2025 13:45:50 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.5.7..@fluentui/react-textarea_v9.6.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/react-field to v9.4.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
16
+
17
+ ## [9.5.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.5.7)
18
+
19
+ Fri, 11 Jul 2025 15:59:24 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.5.6..@fluentui/react-textarea_v9.5.7)
21
+
22
+ ### Patches
23
+
24
+ - Bump @fluentui/react-field to v9.3.7 ([PR #34807](https://github.com/microsoft/fluentui/pull/34807) by beachball)
25
+
7
26
  ## [9.5.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.5.6)
8
27
 
9
- Fri, 04 Jul 2025 10:00:11 GMT
28
+ Fri, 04 Jul 2025 10:02:51 GMT
10
29
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.5.5..@fluentui/react-textarea_v9.5.6)
11
30
 
12
31
  ### Patches
@@ -0,0 +1,208 @@
1
+ import { makeStyles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ export const textareaClassNames = {
4
+ root: 'fui-Textarea',
5
+ textarea: 'fui-Textarea__textarea'
6
+ };
7
+ /**
8
+ * Styles for the root(wrapper) slot
9
+ */ const useRootStyles = makeStyles({
10
+ base: {
11
+ display: 'inline-flex',
12
+ boxSizing: 'border-box',
13
+ position: 'relative',
14
+ // Padding needed so the focus indicator does not overlap the resize handle, this should match focus indicator size.
15
+ padding: `0 0 ${tokens.strokeWidthThick} 0`,
16
+ margin: '0',
17
+ borderRadius: tokens.borderRadiusMedium,
18
+ verticalAlign: 'top'
19
+ },
20
+ disabled: {
21
+ backgroundColor: tokens.colorTransparentBackground,
22
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeDisabled}`,
23
+ '@media (forced-colors: active)': {
24
+ ...shorthands.borderColor('GrayText')
25
+ }
26
+ },
27
+ interactive: {
28
+ // This is all for the bottom focus border.
29
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
30
+ '::after': {
31
+ boxSizing: 'border-box',
32
+ content: '""',
33
+ position: 'absolute',
34
+ left: '-1px',
35
+ bottom: '-1px',
36
+ right: '-1px',
37
+ // Maintaining the correct corner radius:
38
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
39
+ // (Otherwise the radius would be automatically reduced to fit available space.)
40
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
41
+ height: `max(${tokens.strokeWidthThick}, ${tokens.borderRadiusMedium})`,
42
+ borderBottomLeftRadius: tokens.borderRadiusMedium,
43
+ borderBottomRightRadius: tokens.borderRadiusMedium,
44
+ // Flat 2px border:
45
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
46
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
47
+ // borderBottom makes it easier for people to override the color if needed.)
48
+ borderBottom: `${tokens.strokeWidthThick} solid ${tokens.colorCompoundBrandStroke}`,
49
+ clipPath: `inset(calc(100% - ${tokens.strokeWidthThick}) 0 0 0)`,
50
+ // Animation for focus OUT
51
+ transform: 'scaleX(0)',
52
+ transitionProperty: 'transform',
53
+ transitionDuration: tokens.durationUltraFast,
54
+ transitionDelay: tokens.curveAccelerateMid,
55
+ '@media screen and (prefers-reduced-motion: reduce)': {
56
+ transitionDuration: '0.01ms',
57
+ transitionDelay: '0.01ms'
58
+ }
59
+ },
60
+ ':focus-within::after': {
61
+ // Animation for focus IN
62
+ transform: 'scaleX(1)',
63
+ transitionProperty: 'transform',
64
+ transitionDuration: tokens.durationNormal,
65
+ transitionDelay: tokens.curveDecelerateMid,
66
+ '@media screen and (prefers-reduced-motion: reduce)': {
67
+ transitionDuration: '0.01ms',
68
+ transitionDelay: '0.01ms'
69
+ }
70
+ },
71
+ ':focus-within:active::after': {
72
+ // This is if the user clicks the field again while it's already focused
73
+ borderBottomColor: tokens.colorCompoundBrandStrokePressed
74
+ },
75
+ ':focus-within': {
76
+ outlineWidth: tokens.strokeWidthThick,
77
+ outlineStyle: 'solid',
78
+ outlineColor: 'transparent'
79
+ }
80
+ },
81
+ filled: {
82
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,
83
+ ':hover,:focus-within': {
84
+ ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)
85
+ }
86
+ },
87
+ 'filled-darker': {
88
+ backgroundColor: tokens.colorNeutralBackground3
89
+ },
90
+ 'filled-lighter': {
91
+ backgroundColor: tokens.colorNeutralBackground1
92
+ },
93
+ 'filled-darker-shadow': {
94
+ backgroundColor: tokens.colorNeutralBackground3,
95
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,
96
+ boxShadow: tokens.shadow2
97
+ },
98
+ 'filled-lighter-shadow': {
99
+ backgroundColor: tokens.colorNeutralBackground1,
100
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,
101
+ boxShadow: tokens.shadow2
102
+ },
103
+ outline: {
104
+ backgroundColor: tokens.colorNeutralBackground1,
105
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
106
+ borderBottomColor: tokens.colorNeutralStrokeAccessible
107
+ },
108
+ outlineInteractive: {
109
+ ':hover': {
110
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Hover}`,
111
+ borderBottomColor: tokens.colorNeutralStrokeAccessibleHover
112
+ },
113
+ ':active': {
114
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,
115
+ borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed
116
+ },
117
+ ':focus-within': {
118
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,
119
+ borderBottomColor: tokens.colorCompoundBrandStroke
120
+ }
121
+ },
122
+ invalid: {
123
+ ':not(:focus-within),:hover:not(:focus-within)': {
124
+ ...shorthands.borderColor(tokens.colorPaletteRedBorder2)
125
+ }
126
+ }
127
+ });
128
+ /**
129
+ * Styles for the textarea slot
130
+ */ const useTextareaStyles = makeStyles({
131
+ base: {
132
+ ...shorthands.borderStyle('none'),
133
+ margin: '0',
134
+ backgroundColor: 'transparent',
135
+ boxSizing: 'border-box',
136
+ color: tokens.colorNeutralForeground1,
137
+ flexGrow: 1,
138
+ fontFamily: tokens.fontFamilyBase,
139
+ height: '100%',
140
+ '::placeholder': {
141
+ color: tokens.colorNeutralForeground4,
142
+ opacity: 1
143
+ },
144
+ '::selection': {
145
+ color: tokens.colorNeutralForegroundInverted,
146
+ backgroundColor: tokens.colorNeutralBackgroundInverted
147
+ },
148
+ outlineStyle: 'none'
149
+ },
150
+ disabled: {
151
+ color: tokens.colorNeutralForegroundDisabled,
152
+ cursor: 'not-allowed',
153
+ '::placeholder': {
154
+ color: tokens.colorNeutralForegroundDisabled
155
+ }
156
+ },
157
+ // The padding style adds both content and regular padding (from design spec), this is because the handle is not
158
+ // affected by changing the padding of the root.
159
+ small: {
160
+ minHeight: '40px',
161
+ padding: `${tokens.spacingVerticalXS} calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,
162
+ maxHeight: '200px',
163
+ ...typographyStyles.caption1
164
+ },
165
+ medium: {
166
+ minHeight: '52px',
167
+ padding: `${tokens.spacingVerticalSNudge} calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,
168
+ maxHeight: '260px',
169
+ ...typographyStyles.body1
170
+ },
171
+ large: {
172
+ minHeight: '64px',
173
+ padding: `${tokens.spacingVerticalS} calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalXXS})`,
174
+ maxHeight: '320px',
175
+ ...typographyStyles.body2
176
+ }
177
+ });
178
+ /**
179
+ * Styles for the textarea's resize property
180
+ */ const useTextareaResizeStyles = makeStyles({
181
+ none: {
182
+ resize: 'none'
183
+ },
184
+ both: {
185
+ resize: 'both'
186
+ },
187
+ horizontal: {
188
+ resize: 'horizontal'
189
+ },
190
+ vertical: {
191
+ resize: 'vertical'
192
+ }
193
+ });
194
+ /**
195
+ * Apply styling to the Textarea slots based on the state
196
+ */ export const useTextareaStyles_unstable = (state)=>{
197
+ 'use no memo';
198
+ const { size, appearance, resize } = state;
199
+ const disabled = state.textarea.disabled;
200
+ const invalid = `${state.textarea['aria-invalid']}` === 'true';
201
+ const filled = appearance.startsWith('filled');
202
+ const rootStyles = useRootStyles();
203
+ state.root.className = mergeClasses(textareaClassNames.root, rootStyles.base, disabled && rootStyles.disabled, !disabled && filled && rootStyles.filled, !disabled && rootStyles[appearance], !disabled && rootStyles.interactive, !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && invalid && rootStyles.invalid, state.root.className);
204
+ const textareaStyles = useTextareaStyles();
205
+ const textareaResizeStyles = useTextareaResizeStyles();
206
+ state.textarea.className = mergeClasses(textareaClassNames.textarea, textareaStyles.base, textareaStyles[size], textareaResizeStyles[resize], disabled && textareaStyles.disabled, state.textarea.className);
207
+ return state;
208
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Textarea/useTextareaStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TextareaSlots, TextareaState } from './Textarea.types';\n\nexport const textareaClassNames: SlotClassNames<TextareaSlots> = {\n root: 'fui-Textarea',\n textarea: 'fui-Textarea__textarea',\n};\n\n/**\n * Styles for the root(wrapper) slot\n */\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n boxSizing: 'border-box',\n position: 'relative',\n // Padding needed so the focus indicator does not overlap the resize handle, this should match focus indicator size.\n padding: `0 0 ${tokens.strokeWidthThick} 0`,\n margin: '0',\n borderRadius: tokens.borderRadiusMedium,\n verticalAlign: 'top',\n },\n\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeDisabled}`,\n\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(${tokens.strokeWidthThick}, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `${tokens.strokeWidthThick} solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: `inset(calc(100% - ${tokens.strokeWidthThick}) 0 0 0)`,\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n\n filled: {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n ':hover,:focus-within': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,\n boxShadow: tokens.shadow2,\n },\n\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n ':hover': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Hover}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n ':active': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n\n ':focus-within': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,\n borderBottomColor: tokens.colorCompoundBrandStroke,\n },\n },\n\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n});\n\n/**\n * Styles for the textarea slot\n */\nconst useTextareaStyles = makeStyles({\n base: {\n ...shorthands.borderStyle('none'),\n margin: '0',\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n fontFamily: tokens.fontFamilyBase,\n height: '100%',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1,\n },\n\n '::selection': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorNeutralBackgroundInverted,\n },\n\n outlineStyle: 'none', // disable default browser outline\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // The padding style adds both content and regular padding (from design spec), this is because the handle is not\n // affected by changing the padding of the root.\n small: {\n minHeight: '40px',\n padding: `${tokens.spacingVerticalXS} calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '200px',\n ...typographyStyles.caption1,\n },\n medium: {\n minHeight: '52px',\n padding: `${tokens.spacingVerticalSNudge} calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '260px',\n ...typographyStyles.body1,\n },\n large: {\n minHeight: '64px',\n padding: `${tokens.spacingVerticalS} calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '320px',\n ...typographyStyles.body2,\n },\n});\n\n/**\n * Styles for the textarea's resize property\n */\nconst useTextareaResizeStyles = makeStyles({\n none: {\n resize: 'none',\n },\n both: {\n resize: 'both',\n },\n horizontal: {\n resize: 'horizontal',\n },\n vertical: {\n resize: 'vertical',\n },\n});\n\n/**\n * Apply styling to the Textarea slots based on the state\n */\nexport const useTextareaStyles_unstable = (state: TextareaState): TextareaState => {\n 'use no memo';\n\n const { size, appearance, resize } = state;\n const disabled = state.textarea.disabled;\n const invalid = `${state.textarea['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n textareaClassNames.root,\n rootStyles.base,\n disabled && rootStyles.disabled,\n !disabled && filled && rootStyles.filled,\n !disabled && rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && invalid && rootStyles.invalid,\n state.root.className,\n );\n\n const textareaStyles = useTextareaStyles();\n const textareaResizeStyles = useTextareaResizeStyles();\n state.textarea.className = mergeClasses(\n textareaClassNames.textarea,\n textareaStyles.base,\n textareaStyles[size],\n textareaResizeStyles[resize],\n disabled && textareaStyles.disabled,\n state.textarea.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","textareaClassNames","root","textarea","useRootStyles","base","display","boxSizing","position","padding","strokeWidthThick","margin","borderRadius","borderRadiusMedium","verticalAlign","disabled","backgroundColor","colorTransparentBackground","border","strokeWidthThin","colorNeutralStrokeDisabled","borderColor","interactive","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","borderBottomColor","colorCompoundBrandStrokePressed","outlineWidth","outlineStyle","outlineColor","filled","colorTransparentStroke","colorTransparentStrokeInteractive","colorNeutralBackground3","colorNeutralBackground1","boxShadow","shadow2","outline","colorNeutralStroke1","colorNeutralStrokeAccessible","outlineInteractive","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","invalid","colorPaletteRedBorder2","useTextareaStyles","borderStyle","color","colorNeutralForeground1","flexGrow","fontFamily","fontFamilyBase","colorNeutralForeground4","opacity","colorNeutralForegroundInverted","colorNeutralBackgroundInverted","colorNeutralForegroundDisabled","cursor","small","minHeight","spacingVerticalXS","spacingHorizontalSNudge","spacingHorizontalXXS","maxHeight","caption1","medium","spacingVerticalSNudge","spacingHorizontalMNudge","body1","large","spacingVerticalS","spacingHorizontalM","body2","useTextareaResizeStyles","none","resize","both","horizontal","vertical","useTextareaStyles_unstable","state","size","appearance","startsWith","rootStyles","className","textareaStyles","textareaResizeStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACtE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAIjE,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAgBR,WAAW;IAC/BS,MAAM;QACJC,SAAS;QACTC,WAAW;QACXC,UAAU;QACV,oHAAoH;QACpHC,SAAS,CAAC,IAAI,EAAEV,OAAOW,gBAAgB,CAAC,EAAE,CAAC;QAC3CC,QAAQ;QACRC,cAAcb,OAAOc,kBAAkB;QACvCC,eAAe;IACjB;IAEAC,UAAU;QACRC,iB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oB,CAACZ,OAAO,EAC5B9E,YAAYyF,eAAezF,QAAQ,EACnCmF,MAAM/F,QAAQ,CAACoG,SAAS;IAG1B,OAAOL;AACT,EAAE"}
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ textareaClassNames: function() {
13
+ return textareaClassNames;
14
+ },
15
+ useTextareaStyles_unstable: function() {
16
+ return useTextareaStyles_unstable;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const _reacttheme = require("@fluentui/react-theme");
21
+ const textareaClassNames = {
22
+ root: 'fui-Textarea',
23
+ textarea: 'fui-Textarea__textarea'
24
+ };
25
+ /**
26
+ * Styles for the root(wrapper) slot
27
+ */ const useRootStyles = (0, _react.makeStyles)({
28
+ base: {
29
+ display: 'inline-flex',
30
+ boxSizing: 'border-box',
31
+ position: 'relative',
32
+ // Padding needed so the focus indicator does not overlap the resize handle, this should match focus indicator size.
33
+ padding: `0 0 ${_reacttheme.tokens.strokeWidthThick} 0`,
34
+ margin: '0',
35
+ borderRadius: _reacttheme.tokens.borderRadiusMedium,
36
+ verticalAlign: 'top'
37
+ },
38
+ disabled: {
39
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
40
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStrokeDisabled}`,
41
+ '@media (forced-colors: active)': {
42
+ ..._react.shorthands.borderColor('GrayText')
43
+ }
44
+ },
45
+ interactive: {
46
+ // This is all for the bottom focus border.
47
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
48
+ '::after': {
49
+ boxSizing: 'border-box',
50
+ content: '""',
51
+ position: 'absolute',
52
+ left: '-1px',
53
+ bottom: '-1px',
54
+ right: '-1px',
55
+ // Maintaining the correct corner radius:
56
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
57
+ // (Otherwise the radius would be automatically reduced to fit available space.)
58
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
59
+ height: `max(${_reacttheme.tokens.strokeWidthThick}, ${_reacttheme.tokens.borderRadiusMedium})`,
60
+ borderBottomLeftRadius: _reacttheme.tokens.borderRadiusMedium,
61
+ borderBottomRightRadius: _reacttheme.tokens.borderRadiusMedium,
62
+ // Flat 2px border:
63
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
64
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
65
+ // borderBottom makes it easier for people to override the color if needed.)
66
+ borderBottom: `${_reacttheme.tokens.strokeWidthThick} solid ${_reacttheme.tokens.colorCompoundBrandStroke}`,
67
+ clipPath: `inset(calc(100% - ${_reacttheme.tokens.strokeWidthThick}) 0 0 0)`,
68
+ // Animation for focus OUT
69
+ transform: 'scaleX(0)',
70
+ transitionProperty: 'transform',
71
+ transitionDuration: _reacttheme.tokens.durationUltraFast,
72
+ transitionDelay: _reacttheme.tokens.curveAccelerateMid,
73
+ '@media screen and (prefers-reduced-motion: reduce)': {
74
+ transitionDuration: '0.01ms',
75
+ transitionDelay: '0.01ms'
76
+ }
77
+ },
78
+ ':focus-within::after': {
79
+ // Animation for focus IN
80
+ transform: 'scaleX(1)',
81
+ transitionProperty: 'transform',
82
+ transitionDuration: _reacttheme.tokens.durationNormal,
83
+ transitionDelay: _reacttheme.tokens.curveDecelerateMid,
84
+ '@media screen and (prefers-reduced-motion: reduce)': {
85
+ transitionDuration: '0.01ms',
86
+ transitionDelay: '0.01ms'
87
+ }
88
+ },
89
+ ':focus-within:active::after': {
90
+ // This is if the user clicks the field again while it's already focused
91
+ borderBottomColor: _reacttheme.tokens.colorCompoundBrandStrokePressed
92
+ },
93
+ ':focus-within': {
94
+ outlineWidth: _reacttheme.tokens.strokeWidthThick,
95
+ outlineStyle: 'solid',
96
+ outlineColor: 'transparent'
97
+ }
98
+ },
99
+ filled: {
100
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorTransparentStroke}`,
101
+ ':hover,:focus-within': {
102
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorTransparentStrokeInteractive)
103
+ }
104
+ },
105
+ 'filled-darker': {
106
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3
107
+ },
108
+ 'filled-lighter': {
109
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1
110
+ },
111
+ 'filled-darker-shadow': {
112
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
113
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorTransparentStrokeInteractive}`,
114
+ boxShadow: _reacttheme.tokens.shadow2
115
+ },
116
+ 'filled-lighter-shadow': {
117
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
118
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorTransparentStrokeInteractive}`,
119
+ boxShadow: _reacttheme.tokens.shadow2
120
+ },
121
+ outline: {
122
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
123
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1}`,
124
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible
125
+ },
126
+ outlineInteractive: {
127
+ ':hover': {
128
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1Hover}`,
129
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
130
+ },
131
+ ':active': {
132
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1Pressed}`,
133
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
134
+ },
135
+ ':focus-within': {
136
+ border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1Pressed}`,
137
+ borderBottomColor: _reacttheme.tokens.colorCompoundBrandStroke
138
+ }
139
+ },
140
+ invalid: {
141
+ ':not(:focus-within),:hover:not(:focus-within)': {
142
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorPaletteRedBorder2)
143
+ }
144
+ }
145
+ });
146
+ /**
147
+ * Styles for the textarea slot
148
+ */ const useTextareaStyles = (0, _react.makeStyles)({
149
+ base: {
150
+ ..._react.shorthands.borderStyle('none'),
151
+ margin: '0',
152
+ backgroundColor: 'transparent',
153
+ boxSizing: 'border-box',
154
+ color: _reacttheme.tokens.colorNeutralForeground1,
155
+ flexGrow: 1,
156
+ fontFamily: _reacttheme.tokens.fontFamilyBase,
157
+ height: '100%',
158
+ '::placeholder': {
159
+ color: _reacttheme.tokens.colorNeutralForeground4,
160
+ opacity: 1
161
+ },
162
+ '::selection': {
163
+ color: _reacttheme.tokens.colorNeutralForegroundInverted,
164
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundInverted
165
+ },
166
+ outlineStyle: 'none'
167
+ },
168
+ disabled: {
169
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
170
+ cursor: 'not-allowed',
171
+ '::placeholder': {
172
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
173
+ }
174
+ },
175
+ // The padding style adds both content and regular padding (from design spec), this is because the handle is not
176
+ // affected by changing the padding of the root.
177
+ small: {
178
+ minHeight: '40px',
179
+ padding: `${_reacttheme.tokens.spacingVerticalXS} calc(${_reacttheme.tokens.spacingHorizontalSNudge} + ${_reacttheme.tokens.spacingHorizontalXXS})`,
180
+ maxHeight: '200px',
181
+ ..._reacttheme.typographyStyles.caption1
182
+ },
183
+ medium: {
184
+ minHeight: '52px',
185
+ padding: `${_reacttheme.tokens.spacingVerticalSNudge} calc(${_reacttheme.tokens.spacingHorizontalMNudge} + ${_reacttheme.tokens.spacingHorizontalXXS})`,
186
+ maxHeight: '260px',
187
+ ..._reacttheme.typographyStyles.body1
188
+ },
189
+ large: {
190
+ minHeight: '64px',
191
+ padding: `${_reacttheme.tokens.spacingVerticalS} calc(${_reacttheme.tokens.spacingHorizontalM} + ${_reacttheme.tokens.spacingHorizontalXXS})`,
192
+ maxHeight: '320px',
193
+ ..._reacttheme.typographyStyles.body2
194
+ }
195
+ });
196
+ /**
197
+ * Styles for the textarea's resize property
198
+ */ const useTextareaResizeStyles = (0, _react.makeStyles)({
199
+ none: {
200
+ resize: 'none'
201
+ },
202
+ both: {
203
+ resize: 'both'
204
+ },
205
+ horizontal: {
206
+ resize: 'horizontal'
207
+ },
208
+ vertical: {
209
+ resize: 'vertical'
210
+ }
211
+ });
212
+ const useTextareaStyles_unstable = (state)=>{
213
+ 'use no memo';
214
+ const { size, appearance, resize } = state;
215
+ const disabled = state.textarea.disabled;
216
+ const invalid = `${state.textarea['aria-invalid']}` === 'true';
217
+ const filled = appearance.startsWith('filled');
218
+ const rootStyles = useRootStyles();
219
+ state.root.className = (0, _react.mergeClasses)(textareaClassNames.root, rootStyles.base, disabled && rootStyles.disabled, !disabled && filled && rootStyles.filled, !disabled && rootStyles[appearance], !disabled && rootStyles.interactive, !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && invalid && rootStyles.invalid, state.root.className);
220
+ const textareaStyles = useTextareaStyles();
221
+ const textareaResizeStyles = useTextareaResizeStyles();
222
+ state.textarea.className = (0, _react.mergeClasses)(textareaClassNames.textarea, textareaStyles.base, textareaStyles[size], textareaResizeStyles[resize], disabled && textareaStyles.disabled, state.textarea.className);
223
+ return state;
224
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Textarea/useTextareaStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TextareaSlots, TextareaState } from './Textarea.types';\n\nexport const textareaClassNames: SlotClassNames<TextareaSlots> = {\n root: 'fui-Textarea',\n textarea: 'fui-Textarea__textarea',\n};\n\n/**\n * Styles for the root(wrapper) slot\n */\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n boxSizing: 'border-box',\n position: 'relative',\n // Padding needed so the focus indicator does not overlap the resize handle, this should match focus indicator size.\n padding: `0 0 ${tokens.strokeWidthThick} 0`,\n margin: '0',\n borderRadius: tokens.borderRadiusMedium,\n verticalAlign: 'top',\n },\n\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeDisabled}`,\n\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(${tokens.strokeWidthThick}, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `${tokens.strokeWidthThick} solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: `inset(calc(100% - ${tokens.strokeWidthThick}) 0 0 0)`,\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n\n filled: {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n ':hover,:focus-within': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStrokeInteractive}`,\n boxShadow: tokens.shadow2,\n },\n\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n ':hover': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Hover}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n ':active': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n\n ':focus-within': {\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1Pressed}`,\n borderBottomColor: tokens.colorCompoundBrandStroke,\n },\n },\n\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n});\n\n/**\n * Styles for the textarea slot\n */\nconst useTextareaStyles = makeStyles({\n base: {\n ...shorthands.borderStyle('none'),\n margin: '0',\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n fontFamily: tokens.fontFamilyBase,\n height: '100%',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1,\n },\n\n '::selection': {\n color: tokens.colorNeutralForegroundInverted,\n backgroundColor: tokens.colorNeutralBackgroundInverted,\n },\n\n outlineStyle: 'none', // disable default browser outline\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // The padding style adds both content and regular padding (from design spec), this is because the handle is not\n // affected by changing the padding of the root.\n small: {\n minHeight: '40px',\n padding: `${tokens.spacingVerticalXS} calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '200px',\n ...typographyStyles.caption1,\n },\n medium: {\n minHeight: '52px',\n padding: `${tokens.spacingVerticalSNudge} calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '260px',\n ...typographyStyles.body1,\n },\n large: {\n minHeight: '64px',\n padding: `${tokens.spacingVerticalS} calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalXXS})`,\n maxHeight: '320px',\n ...typographyStyles.body2,\n },\n});\n\n/**\n * Styles for the textarea's resize property\n */\nconst useTextareaResizeStyles = makeStyles({\n none: {\n resize: 'none',\n },\n both: {\n resize: 'both',\n },\n horizontal: {\n resize: 'horizontal',\n },\n vertical: {\n resize: 'vertical',\n },\n});\n\n/**\n * Apply styling to the Textarea slots based on the state\n */\nexport const useTextareaStyles_unstable = (state: TextareaState): TextareaState => {\n 'use no memo';\n\n const { size, appearance, resize } = state;\n const disabled = state.textarea.disabled;\n const invalid = `${state.textarea['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n textareaClassNames.root,\n rootStyles.base,\n disabled && rootStyles.disabled,\n !disabled && filled && rootStyles.filled,\n !disabled && rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && invalid && rootStyles.invalid,\n state.root.className,\n );\n\n const textareaStyles = useTextareaStyles();\n const textareaResizeStyles = useTextareaResizeStyles();\n state.textarea.className = mergeClasses(\n textareaClassNames.textarea,\n textareaStyles.base,\n textareaStyles[size],\n textareaResizeStyles[resize],\n disabled && textareaStyles.disabled,\n state.textarea.className,\n );\n\n return state;\n};\n"],"names":["textareaClassNames","useTextareaStyles_unstable","root","textarea","useRootStyles","makeStyles","base","display","boxSizing","position","padding","tokens","strokeWidthThick","margin","borderRadius","borderRadiusMedium","verticalAlign","disabled","backgroundColor","colorTransparentBackground","border","strokeWidthThin","colorNeutralStrokeDisabled","shorthands","borderColor","interactive","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","borderBottomColor","colorCompoundBrandStrokePressed","outlineWidth","outlineStyle","outlineColor","filled","colorTransparentStroke","colorTransparentStrokeInteractive","colorNeutralBackground3","colorNeutralBackground1","boxShadow","shadow2","outline","colorNeutralStroke1","colorNeutralStrokeAccessible","outlineInteractive","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","invalid","colorPaletteRedBorder2","useTextareaStyles","borderStyle","color","colorNeutralForeground1","flexGrow","fontFamily","fontFamilyBase","colorNeutralForeground4","opacity","colorNeutralForegroundInverted","colorNeutralBackgroundInverted","colorNeutralForegroundDisabled","cursor","small","minHeight","spacingVerticalXS","spacingHorizontalSNudge","spacingHorizontalXXS","maxHeight","typographyStyles","caption1","medium","spacingVerticalSNudge","spacingHorizontalMNudge","body1","large","spacingVerticalS","spacingHorizontalM","body2","useTextareaResizeStyles","none","resize","both","horizontal","vertical","state","size","appearance","startsWith","rootStyles","className","mergeClasses","textareaStyles","textareaResizeStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,kBAAAA;eAAAA;;IA2NAC,0BAAAA;eAAAA;;;uBAhOwC;4BACZ;AAIlC,MAAMD,qBAAoD;IAC/DE,MAAM;IACNC,UAAU;AACZ;AAEA;;CAEC,GACD,MAAMC,gBAAgBC,IAAAA,iBAAAA,EAAW;IAC/BC,MAAM;QACJC,SAAS;QACTC,WAAW;QACXC,UAAU;QACV,oHAAoH;QACpHC,SAAS,CAAC,IAAI,EAAEC,kBAAAA,CAAOC,gBAAgB,CAAC,EAAE,CAAC;QAC3CC,QAAQ;QACRC,cAAcH,kBAAAA,CAAOI,kBAAkB;QACvCC,eAAe;IACjB;IAEAC,UAAU;QACRC,iBAAiBP,kBAAAA,CAAOQ,0BAA0B;QAClDC,QAAQ,CAAC,EAAET,kBAAAA,CAAOU,eAAe,CAAC,OAAO,EAAEV,kBAAAA,CAAOW,0BAA0B,CAAC,CAAC;QAE9E,kCAAkC;YAChC,GAAGC,iBAAAA,CAAWC,WAAW,CAAC,WAAW;QACvC;IACF;IAEAC,aAAa;QACX,2CAA2C;QAC3C,+FAA+F;QAC/F,WAAW;YACTjB,WAAW;YACXkB,SAAS;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AAWzC,OAAO,EAC1CqC,MAAMnG,IAAI,CAACwG,SAAS;IAGtB,MAAME,iBAAiB1C;IACvB,MAAM2C,uBAAuBd;IAC7BM,MAAMlG,QAAQ,CAACuG,SAAS,GAAGC,IAAAA,mBAAAA,EACzB3G,mBAAmBG,QAAQ,EAC3ByG,eAAetG,IAAI,EACnBsG,cAAc,CAACN,KAAK,EACpBO,oBAAoB,CAACZ,OAAO,EAC5BhF,YAAY2F,eAAe3F,QAAQ,EACnCoF,MAAMlG,QAAQ,CAACuG,SAAS;IAG1B,OAAOL;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-textarea",
3
- "version": "9.5.6",
3
+ "version": "9.6.0",
4
4
  "description": "Fluent UI TextArea component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -18,7 +18,7 @@
18
18
  "@fluentui/scripts-api-extractor": "*"
19
19
  },
20
20
  "dependencies": {
21
- "@fluentui/react-field": "^9.3.6",
21
+ "@fluentui/react-field": "^9.4.0",
22
22
  "@fluentui/react-shared-contexts": "^9.24.0",
23
23
  "@fluentui/react-theme": "^9.1.24",
24
24
  "@fluentui/react-utilities": "^9.22.0",