@fluentui/react-textarea 9.3.4 → 9.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +73 -1
  3. package/CHANGELOG.md +27 -2
  4. package/lib/Textarea.js.map +1 -1
  5. package/lib/TextareaField.js.map +1 -1
  6. package/lib/components/Textarea/Textarea.js.map +1 -1
  7. package/lib/components/Textarea/Textarea.types.js +1 -1
  8. package/lib/components/Textarea/Textarea.types.js.map +1 -1
  9. package/lib/components/Textarea/index.js.map +1 -1
  10. package/lib/components/Textarea/renderTextarea.js +1 -5
  11. package/lib/components/Textarea/renderTextarea.js.map +1 -1
  12. package/lib/components/Textarea/useTextarea.js +3 -2
  13. package/lib/components/Textarea/useTextarea.js.map +1 -1
  14. package/lib/components/Textarea/useTextareaStyles.js.map +1 -1
  15. package/lib/components/TextareaField/TextareaField.js +1 -2
  16. package/lib/components/TextareaField/TextareaField.js.map +1 -1
  17. package/lib/components/TextareaField/index.js.map +1 -1
  18. package/lib/index.js.map +1 -1
  19. package/lib-commonjs/Textarea.js +5 -4
  20. package/lib-commonjs/Textarea.js.map +1 -1
  21. package/lib-commonjs/TextareaField.js +5 -4
  22. package/lib-commonjs/TextareaField.js.map +1 -1
  23. package/lib-commonjs/components/Textarea/Textarea.js +19 -20
  24. package/lib-commonjs/components/Textarea/Textarea.js.map +1 -1
  25. package/lib-commonjs/components/Textarea/Textarea.types.js +5 -2
  26. package/lib-commonjs/components/Textarea/Textarea.types.js.map +1 -1
  27. package/lib-commonjs/components/Textarea/index.js +9 -8
  28. package/lib-commonjs/components/Textarea/index.js.map +1 -1
  29. package/lib-commonjs/components/Textarea/renderTextarea.js +13 -20
  30. package/lib-commonjs/components/Textarea/renderTextarea.js.map +1 -1
  31. package/lib-commonjs/components/Textarea/useTextarea.js +61 -67
  32. package/lib-commonjs/components/Textarea/useTextarea.js.map +1 -1
  33. package/lib-commonjs/components/Textarea/useTextareaStyles.js +744 -314
  34. package/lib-commonjs/components/Textarea/useTextareaStyles.js.map +1 -1
  35. package/lib-commonjs/components/TextareaField/TextareaField.js +17 -11
  36. package/lib-commonjs/components/TextareaField/TextareaField.js.map +1 -1
  37. package/lib-commonjs/components/TextareaField/index.js +5 -4
  38. package/lib-commonjs/components/TextareaField/index.js.map +1 -1
  39. package/lib-commonjs/index.js +21 -49
  40. package/lib-commonjs/index.js.map +1 -1
  41. package/package.json +9 -8
  42. package/lib-amd/Textarea.js +0 -6
  43. package/lib-amd/Textarea.js.map +0 -1
  44. package/lib-amd/TextareaField.js +0 -6
  45. package/lib-amd/TextareaField.js.map +0 -1
  46. package/lib-amd/components/Textarea/Textarea.js +0 -17
  47. package/lib-amd/components/Textarea/Textarea.js.map +0 -1
  48. package/lib-amd/components/Textarea/Textarea.types.js +0 -5
  49. package/lib-amd/components/Textarea/Textarea.types.js.map +0 -1
  50. package/lib-amd/components/Textarea/index.js +0 -10
  51. package/lib-amd/components/Textarea/index.js.map +0 -1
  52. package/lib-amd/components/Textarea/renderTextarea.js +0 -15
  53. package/lib-amd/components/Textarea/renderTextarea.js.map +0 -1
  54. package/lib-amd/components/Textarea/useTextarea.js +0 -61
  55. package/lib-amd/components/Textarea/useTextarea.js.map +0 -1
  56. package/lib-amd/components/Textarea/useTextareaStyles.js +0 -131
  57. package/lib-amd/components/Textarea/useTextareaStyles.js.map +0 -1
  58. package/lib-amd/components/TextareaField/TextareaField.js +0 -10
  59. package/lib-amd/components/TextareaField/TextareaField.js.map +0 -1
  60. package/lib-amd/components/TextareaField/index.js +0 -6
  61. package/lib-amd/components/TextareaField/index.js.map +0 -1
  62. package/lib-amd/index.js +0 -13
  63. package/lib-amd/index.js.map +0 -1
@@ -1,131 +0,0 @@
1
- define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_theme_1) {
2
- "use strict";
3
- var _a;
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.useTextareaStyles_unstable = exports.textareaClassNames = void 0;
6
- exports.textareaClassNames = {
7
- root: 'fui-Textarea',
8
- textarea: 'fui-Textarea__textarea',
9
- };
10
- var textareaHeight = {
11
- small: '24px',
12
- medium: '32px',
13
- large: '40px',
14
- };
15
- /**
16
- * Styles for the root(wrapper) slot
17
- */
18
- var useRootStyles = react_1.makeStyles({
19
- base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', boxSizing: 'border-box', position: 'relative' }, react_1.shorthands.padding('0', '0', react_theme_1.tokens.strokeWidthThick, '0')), react_1.shorthands.margin('0')), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
20
- disabled: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStrokeDisabled)), (_a = {}, _a["& > textarea"] = {
21
- cursor: 'not-allowed',
22
- '::placeholder': {
23
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
24
- },
25
- }, _a['@media (forced-colors: active)'] = tslib_1.__assign({}, react_1.shorthands.borderColor('GrayText')), _a)),
26
- interactive: {
27
- // This is all for the bottom focus border.
28
- // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
29
- '::after': tslib_1.__assign(tslib_1.__assign({ boxSizing: 'border-box', content: '""', position: 'absolute', left: '-1px', bottom: '-1px', right: '-1px',
30
- // Maintaining the correct corner radius:
31
- // Use the whole border-radius as the height and only put radii on the bottom corners.
32
- // (Otherwise the radius would be automatically reduced to fit available space.)
33
- // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
34
- height: "max(" + react_theme_1.tokens.strokeWidthThick + ", " + react_theme_1.tokens.borderRadiusMedium + ")", borderBottomLeftRadius: react_theme_1.tokens.borderRadiusMedium, borderBottomRightRadius: react_theme_1.tokens.borderRadiusMedium }, react_1.shorthands.borderBottom(react_theme_1.tokens.strokeWidthThick, 'solid', react_theme_1.tokens.colorCompoundBrandStroke)), { clipPath: "inset(calc(100% - " + react_theme_1.tokens.strokeWidthThick + ") 0 0 0)",
35
- // Animation for focus OUT
36
- transform: 'scaleX(0)', transitionProperty: 'transform', transitionDuration: react_theme_1.tokens.durationUltraFast, transitionDelay: react_theme_1.tokens.curveAccelerateMid, '@media screen and (prefers-reduced-motion: reduce)': {
37
- transitionDuration: '0.01ms',
38
- transitionDelay: '0.01ms',
39
- } }),
40
- ':focus-within::after': {
41
- // Animation for focus IN
42
- transform: 'scaleX(1)',
43
- transitionProperty: 'transform',
44
- transitionDuration: react_theme_1.tokens.durationNormal,
45
- transitionDelay: react_theme_1.tokens.curveDecelerateMid,
46
- '@media screen and (prefers-reduced-motion: reduce)': {
47
- transitionDuration: '0.01ms',
48
- transitionDelay: '0.01ms',
49
- },
50
- },
51
- ':focus-within:active::after': {
52
- // This is if the user clicks the field again while it's already focused
53
- borderBottomColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
54
- },
55
- ':focus-within': {
56
- outlineWidth: react_theme_1.tokens.strokeWidthThick,
57
- outlineStyle: 'solid',
58
- outlineColor: 'transparent',
59
- },
60
- },
61
- filled: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorTransparentStroke)), { ':hover,:focus-within': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStrokeInteractive)) }),
62
- 'filled-darker': {
63
- backgroundColor: react_theme_1.tokens.colorNeutralBackground3,
64
- },
65
- 'filled-lighter': {
66
- backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
67
- },
68
- 'filled-darker-shadow': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackground3 }, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorTransparentStrokeInteractive)), { boxShadow: react_theme_1.tokens.shadow2 }),
69
- 'filled-lighter-shadow': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorTransparentStrokeInteractive)), { boxShadow: react_theme_1.tokens.shadow2 }),
70
- outline: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStroke1)), { borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessible }),
71
- outlineInteractive: {
72
- ':hover': tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStroke1Hover)), { borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessibleHover }),
73
- ':active': tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStroke1Pressed)), { borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessiblePressed }),
74
- ':focus-within': tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStroke1)), { borderBottomColor: react_theme_1.tokens.colorCompoundBrandStroke }),
75
- },
76
- invalid: {
77
- ':not(:focus-within),:hover:not(:focus-within)': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteRedBorder2)),
78
- },
79
- });
80
- /**
81
- * Styles for the textarea slot
82
- */
83
- var useTextareaStyles = react_1.makeStyles({
84
- base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderStyle('none')), react_1.shorthands.margin('0')), { backgroundColor: 'transparent', boxSizing: 'border-box', color: react_theme_1.tokens.colorNeutralForeground1, flexGrow: 1, fontFamily: react_theme_1.tokens.fontFamilyBase, height: '100%', maxHeight: '100%', '::placeholder': {
85
- color: react_theme_1.tokens.colorNeutralForeground4,
86
- opacity: 1,
87
- }, '::selection': {
88
- color: react_theme_1.tokens.colorNeutralForegroundInverted,
89
- backgroundColor: react_theme_1.tokens.colorNeutralBackgroundInverted,
90
- }, outlineStyle: 'none' }),
91
- // The padding style adds both content and regular padding (from design spec), this is because the handle is not
92
- // affected by changing the padding of the root.
93
- small: tslib_1.__assign(tslib_1.__assign({ height: textareaHeight.small, minHeight: '40px' }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalXS, "calc(" + react_theme_1.tokens.spacingHorizontalSNudge + " + " + react_theme_1.tokens.spacingHorizontalXXS + ")")), react_theme_1.typographyStyles.caption1),
94
- medium: tslib_1.__assign(tslib_1.__assign({ height: textareaHeight.medium, minHeight: '52px' }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalSNudge, "calc(" + react_theme_1.tokens.spacingHorizontalMNudge + " + " + react_theme_1.tokens.spacingHorizontalXXS + ")")), react_theme_1.typographyStyles.body1),
95
- large: tslib_1.__assign(tslib_1.__assign({ height: textareaHeight.large, minHeight: '64px' }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, "calc(" + react_theme_1.tokens.spacingHorizontalM + " + " + react_theme_1.tokens.spacingHorizontalXXS + ")")), react_theme_1.typographyStyles.body2),
96
- });
97
- /**
98
- * Styles for the textarea's resize property
99
- */
100
- var useTextareaResizeStyles = react_1.makeStyles({
101
- none: {
102
- resize: 'none',
103
- },
104
- both: {
105
- resize: 'both',
106
- },
107
- horizontal: {
108
- resize: 'horizontal',
109
- },
110
- vertical: {
111
- resize: 'vertical',
112
- },
113
- });
114
- /**
115
- * Apply styling to the Textarea slots based on the state
116
- */
117
- var useTextareaStyles_unstable = function (state) {
118
- var size = state.size, appearance = state.appearance, resize = state.resize;
119
- var disabled = state.textarea.disabled;
120
- var invalid = "" + state.textarea['aria-invalid'] === 'true';
121
- var filled = appearance.startsWith('filled');
122
- var rootStyles = useRootStyles();
123
- state.root.className = react_1.mergeClasses(exports.textareaClassNames.root, rootStyles.base, rootStyles[appearance], filled && rootStyles.filled, disabled && rootStyles.disabled, !disabled && rootStyles.interactive, !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && invalid && rootStyles.invalid, state.root.className);
124
- var textareaStyles = useTextareaStyles();
125
- var textareaResizeStyles = useTextareaResizeStyles();
126
- state.textarea.className = react_1.mergeClasses(exports.textareaClassNames.textarea, textareaStyles.base, textareaStyles[size], textareaResizeStyles[resize], state.textarea.className);
127
- return state;
128
- };
129
- exports.useTextareaStyles_unstable = useTextareaStyles_unstable;
130
- });
131
- //# sourceMappingURL=useTextareaStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTextareaStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/Textarea/useTextareaStyles.ts"],"names":[],"mappings":";;;;;IAKa,QAAA,kBAAkB,GAAkC;QAC/D,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,wBAAwB;KACnC,CAAC;IAEF,IAAM,cAAc,GAAG;QACrB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd,CAAC;IAEF;;OAEG;IACH,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,IAAI,uDACF,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,UAAU,IAEjB,kBAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAM,CAAC,gBAAgB,EAAE,GAAG,CAAC,GAC1D,kBAAU,CAAC,MAAM,CAAC,GAAG,CAAC,GACtB,kBAAU,CAAC,YAAY,CAAC,oBAAM,CAAC,kBAAkB,CAAC,CACtD;QAED,QAAQ,sCACN,eAAe,EAAE,oBAAM,CAAC,0BAA0B,IAC/C,kBAAU,CAAC,MAAM,CAAC,oBAAM,CAAC,eAAe,EAAE,OAAO,EAA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AAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE/C,IAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,0BAAkB,CAAC,IAAI,EACvB,UAAU,CAAC,IAAI,EACf,UAAU,CAAC,UAAU,CAAC,EACtB,MAAM,IAAI,UAAU,CAAC,MAAM,EAC3B,QAAQ,IAAI,UAAU,CAAC,QAAQ,EAC/B,CAAC,QAAQ,IAAI,UAAU,CAAC,WAAW,EACnC,CAAC,QAAQ,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,kBAAkB,EACtE,CAAC,QAAQ,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,EAC1C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,IAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;QAC3C,IAAM,oBAAoB,GAAG,uBAAuB,EAAE,CAAC;QACvD,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,oBAAY,CACrC,0BAAkB,CAAC,QAAQ,EAC3B,cAAc,CAAC,IAAI,EACnB,cAAc,CAAC,IAAI,CAAC,EACpB,oBAAoB,CAAC,MAAM,CAAC,EAC5B,KAAK,CAAC,QAAQ,CAAC,SAAS,CACzB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9BW,QAAA,0BAA0B,8BA8BrC","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\nconst textareaHeight = {\n small: '24px',\n medium: '32px',\n large: '40px',\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 ...shorthands.padding('0', '0', tokens.strokeWidthThick, '0'),\n ...shorthands.margin('0'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n [`& > textarea`]: {\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\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 ...shorthands.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 ...shorthands.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 ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow2,\n },\n\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n ':active': {\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n\n ':focus-within': {\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\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 ...shorthands.margin('0'),\n backgroundColor: 'transparent',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n fontFamily: tokens.fontFamilyBase,\n height: '100%',\n maxHeight: '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 // 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 height: textareaHeight.small,\n minHeight: '40px',\n ...shorthands.padding(\n tokens.spacingVerticalXS,\n `calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,\n ),\n ...typographyStyles.caption1,\n },\n medium: {\n height: textareaHeight.medium,\n minHeight: '52px',\n ...shorthands.padding(\n tokens.spacingVerticalSNudge,\n `calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,\n ),\n ...typographyStyles.body1,\n },\n large: {\n height: textareaHeight.large,\n minHeight: '64px',\n ...shorthands.padding(\n tokens.spacingVerticalS,\n `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalXXS})`,\n ),\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 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 rootStyles[appearance],\n filled && rootStyles.filled,\n disabled && rootStyles.disabled,\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 state.textarea.className,\n );\n\n return state;\n};\n"]}
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-field", "../../Textarea"], function (require, exports, react_field_1, Textarea_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.TextareaField = exports.textareaFieldClassNames = void 0;
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);
9
- });
10
- //# sourceMappingURL=TextareaField.js.map
@@ -1 +0,0 @@
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,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./TextareaField"], function (require, exports, tslib_1, TextareaField_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(TextareaField_1, exports);
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-textarea/src/components/TextareaField/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC","sourcesContent":["export * from './TextareaField';\n"]}
package/lib-amd/index.js DELETED
@@ -1,13 +0,0 @@
1
- define(["require", "exports", "./Textarea", "./TextareaField"], function (require, exports, Textarea_1, TextareaField_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.textareaFieldClassNames = exports.TextareaField_unstable = exports.useTextarea_unstable = exports.useTextareaStyles_unstable = exports.textareaClassNames = exports.renderTextarea_unstable = exports.Textarea = void 0;
5
- Object.defineProperty(exports, "Textarea", { enumerable: true, get: function () { return Textarea_1.Textarea; } });
6
- Object.defineProperty(exports, "renderTextarea_unstable", { enumerable: true, get: function () { return Textarea_1.renderTextarea_unstable; } });
7
- Object.defineProperty(exports, "textareaClassNames", { enumerable: true, get: function () { return Textarea_1.textareaClassNames; } });
8
- Object.defineProperty(exports, "useTextareaStyles_unstable", { enumerable: true, get: function () { return Textarea_1.useTextareaStyles_unstable; } });
9
- Object.defineProperty(exports, "useTextarea_unstable", { enumerable: true, get: function () { return Textarea_1.useTextarea_unstable; } });
10
- Object.defineProperty(exports, "TextareaField_unstable", { enumerable: true, get: function () { return TextareaField_1.TextareaField; } });
11
- Object.defineProperty(exports, "textareaFieldClassNames", { enumerable: true, get: function () { return TextareaField_1.textareaFieldClassNames; } });
12
- });
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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"]}