@fluentui/react-textarea 9.3.4 → 9.3.5
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/.swcrc +30 -0
- package/CHANGELOG.json +52 -1
- package/CHANGELOG.md +17 -2
- package/lib/Textarea.js.map +1 -1
- package/lib/TextareaField.js.map +1 -1
- package/lib/components/Textarea/Textarea.js.map +1 -1
- package/lib/components/Textarea/Textarea.types.js +1 -1
- package/lib/components/Textarea/Textarea.types.js.map +1 -1
- package/lib/components/Textarea/index.js.map +1 -1
- package/lib/components/Textarea/renderTextarea.js +1 -5
- package/lib/components/Textarea/renderTextarea.js.map +1 -1
- package/lib/components/Textarea/useTextarea.js +3 -2
- package/lib/components/Textarea/useTextarea.js.map +1 -1
- package/lib/components/Textarea/useTextareaStyles.js.map +1 -1
- package/lib/components/TextareaField/TextareaField.js +1 -2
- package/lib/components/TextareaField/TextareaField.js.map +1 -1
- package/lib/components/TextareaField/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Textarea.js +5 -4
- package/lib-commonjs/Textarea.js.map +1 -1
- package/lib-commonjs/TextareaField.js +5 -4
- package/lib-commonjs/TextareaField.js.map +1 -1
- package/lib-commonjs/components/Textarea/Textarea.js +19 -20
- package/lib-commonjs/components/Textarea/Textarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/Textarea.types.js +5 -2
- package/lib-commonjs/components/Textarea/Textarea.types.js.map +1 -1
- package/lib-commonjs/components/Textarea/index.js +9 -8
- package/lib-commonjs/components/Textarea/index.js.map +1 -1
- package/lib-commonjs/components/Textarea/renderTextarea.js +13 -20
- package/lib-commonjs/components/Textarea/renderTextarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/useTextarea.js +61 -67
- package/lib-commonjs/components/Textarea/useTextarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/useTextareaStyles.js +744 -314
- package/lib-commonjs/components/Textarea/useTextareaStyles.js.map +1 -1
- package/lib-commonjs/components/TextareaField/TextareaField.js +17 -11
- package/lib-commonjs/components/TextareaField/TextareaField.js.map +1 -1
- package/lib-commonjs/components/TextareaField/index.js +5 -4
- package/lib-commonjs/components/TextareaField/index.js.map +1 -1
- package/lib-commonjs/index.js +21 -49
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/lib-amd/Textarea.js +0 -6
- package/lib-amd/Textarea.js.map +0 -1
- package/lib-amd/TextareaField.js +0 -6
- package/lib-amd/TextareaField.js.map +0 -1
- package/lib-amd/components/Textarea/Textarea.js +0 -17
- package/lib-amd/components/Textarea/Textarea.js.map +0 -1
- package/lib-amd/components/Textarea/Textarea.types.js +0 -5
- package/lib-amd/components/Textarea/Textarea.types.js.map +0 -1
- package/lib-amd/components/Textarea/index.js +0 -10
- package/lib-amd/components/Textarea/index.js.map +0 -1
- package/lib-amd/components/Textarea/renderTextarea.js +0 -15
- package/lib-amd/components/Textarea/renderTextarea.js.map +0 -1
- package/lib-amd/components/Textarea/useTextarea.js +0 -61
- package/lib-amd/components/Textarea/useTextarea.js.map +0 -1
- package/lib-amd/components/Textarea/useTextareaStyles.js +0 -131
- package/lib-amd/components/Textarea/useTextareaStyles.js.map +0 -1
- package/lib-amd/components/TextareaField/TextareaField.js +0 -10
- package/lib-amd/components/TextareaField/TextareaField.js.map +0 -1
- package/lib-amd/components/TextareaField/index.js +0 -6
- package/lib-amd/components/TextareaField/index.js.map +0 -1
- package/lib-amd/index.js +0 -13
- package/lib-amd/index.js.map +0 -1
package/.swcrc
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"/testing",
|
|
5
|
+
"/**/*.cy.ts",
|
|
6
|
+
"/**/*.cy.tsx",
|
|
7
|
+
"/**/*.spec.ts",
|
|
8
|
+
"/**/*.spec.tsx",
|
|
9
|
+
"/**/*.test.ts",
|
|
10
|
+
"/**/*.test.tsx"
|
|
11
|
+
],
|
|
12
|
+
"jsc": {
|
|
13
|
+
"parser": {
|
|
14
|
+
"syntax": "typescript",
|
|
15
|
+
"tsx": true,
|
|
16
|
+
"decorators": false,
|
|
17
|
+
"dynamicImport": false
|
|
18
|
+
},
|
|
19
|
+
"externalHelpers": true,
|
|
20
|
+
"transform": {
|
|
21
|
+
"react": {
|
|
22
|
+
"runtime": "classic",
|
|
23
|
+
"useSpread": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
27
|
+
},
|
|
28
|
+
"minify": false,
|
|
29
|
+
"sourceMaps": true
|
|
30
|
+
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,58 @@
|
|
|
2
2
|
"name": "@fluentui/react-textarea",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 21 Mar 2023 21:18:23 GMT",
|
|
6
|
+
"tag": "@fluentui/react-textarea_v9.3.5",
|
|
7
|
+
"version": "9.3.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-textarea",
|
|
13
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
14
|
+
"comment": "fix: add node field to package.json exports map."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "tristan.watanabe@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-textarea",
|
|
19
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
20
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-textarea",
|
|
25
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.27",
|
|
26
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-textarea",
|
|
31
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
|
|
32
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-textarea",
|
|
37
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
38
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-textarea",
|
|
43
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
44
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-textarea",
|
|
49
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
50
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Thu, 16 Mar 2023 14:36:59 GMT",
|
|
6
57
|
"tag": "@fluentui/react-textarea_v9.3.4",
|
|
7
58
|
"version": "9.3.4",
|
|
8
59
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-textarea
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 21 Mar 2023 21:18:23 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.3.5)
|
|
8
|
+
|
|
9
|
+
Tue, 21 Mar 2023 21:18:23 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.3.4..@fluentui/react-textarea_v9.3.5)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
15
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
16
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.27 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
20
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
21
|
+
|
|
7
22
|
## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-textarea_v9.3.4)
|
|
8
23
|
|
|
9
|
-
Thu, 16 Mar 2023 14:
|
|
24
|
+
Thu, 16 Mar 2023 14:36:59 GMT
|
|
10
25
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-textarea_v9.3.3..@fluentui/react-textarea_v9.3.4)
|
|
11
26
|
|
|
12
27
|
### Patches
|
package/lib/Textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/Textarea.ts"],"sourcesContent":["export * from './components/Textarea/index';\n"],"mappings":"AAAA,cAAc"}
|
package/lib/TextareaField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/TextareaField.ts"],"sourcesContent":["export * from './components/TextareaField/index';\n"],"mappings":"AAAA,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","renderTextarea_unstable","useTextarea_unstable","useTextareaStyles_unstable","useCustomStyleHooks_unstable","Textarea","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","renderTextarea_unstable","useTextarea_unstable","useTextareaStyles_unstable","useCustomStyleHooks_unstable","Textarea","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderTextarea_unstable } from './renderTextarea';\nimport { useTextarea_unstable } from './useTextarea';\nimport { useTextareaStyles_unstable } from './useTextareaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { TextareaProps } from './Textarea.types';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Textarea component allows the user to enter and edit text in multiple lines.\n */\nexport const Textarea: ForwardRefComponent<TextareaProps> = React.forwardRef((props, ref) => {\n const state = useTextarea_unstable(props, ref);\n\n useTextareaStyles_unstable(state);\n\n const { useTextareaStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderTextarea_unstable(state);\n});\n\nTextarea.displayName = 'Textarea';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,4BAA4B,QAAQ;AAE7C;;;AAGA,OAAO,MAAMC,QAAA,gBAA+CL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3F,MAAMC,KAAA,GAAQP,oBAAA,CAAqBK,KAAA,EAAOC,GAAA;EAE1CL,0BAAA,CAA2BM,KAAA;EAE3B,MAAM;IAAEN,0BAAA,EAA4BO;EAAe,CAAE,GAAGN,4BAAA;EACxDM,eAAA,CAAgBD,KAAA;EAEhB,OAAOR,uBAAA,CAAwBQ,KAAA;AACjC;AAEAJ,QAAA,CAASM,WAAW,GAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
//# sourceMappingURL=Textarea.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React"],"sources":["../../../src/components/Textarea/Textarea.types.ts"],"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"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Textarea/index.ts"],"sourcesContent":["export * from './Textarea';\nexport * from './Textarea.types';\nexport * from './renderTextarea';\nexport * from './useTextarea';\nexport * from './useTextareaStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
|
@@ -8,10 +8,6 @@ export const renderTextarea_unstable = state => {
|
|
|
8
8
|
slots,
|
|
9
9
|
slotProps
|
|
10
10
|
} = getSlots(state);
|
|
11
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
|
12
|
-
...slotProps.root
|
|
13
|
-
}, /*#__PURE__*/React.createElement(slots.textarea, {
|
|
14
|
-
...slotProps.textarea
|
|
15
|
-
}));
|
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.textarea, slotProps.textarea));
|
|
16
12
|
};
|
|
17
13
|
//# sourceMappingURL=renderTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderTextarea_unstable","state","slots","slotProps","createElement","root","textarea"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getSlots","renderTextarea_unstable","state","slots","slotProps","createElement","root","textarea"],"sources":["../../../src/components/Textarea/renderTextarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TextareaState, TextareaSlots } from './Textarea.types';\n\n/**\n * Render the final JSX of Textarea\n */\nexport const renderTextarea_unstable = (state: TextareaState) => {\n const { slots, slotProps } = getSlots<TextareaSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.textarea {...slotProps.textarea} />\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,uBAAA,GAA2BC,KAAA,IAAyB;EAC/D,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAwBE,KAAA;EAErD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,QAAQ,EAAKH,SAAA,CAAUG,QAAQ;AAG5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { getPartitionedNativeProps, resolveShorthand, useControllableState, useEventCallback } from '@fluentui/react-utilities';
|
|
2
3
|
import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';
|
|
3
4
|
/**
|
|
@@ -10,11 +11,11 @@ import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-co
|
|
|
10
11
|
* @param ref - reference to root HTMLElement of Textarea
|
|
11
12
|
*/
|
|
12
13
|
export const useTextarea_unstable = (props, ref) => {
|
|
13
|
-
var _a;
|
|
14
14
|
const overrides = useOverrides();
|
|
15
|
+
var _overrides_inputDefaultAppearance;
|
|
15
16
|
const {
|
|
16
17
|
size = 'medium',
|
|
17
|
-
appearance = (
|
|
18
|
+
appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline',
|
|
18
19
|
resize = 'none',
|
|
19
20
|
onChange
|
|
20
21
|
} = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useOverrides_unstable","useOverrides","useTextarea_unstable","props","ref","overrides","
|
|
1
|
+
{"version":3,"names":["React","getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useOverrides_unstable","useOverrides","useTextarea_unstable","props","ref","overrides","_overrides_inputDefaultAppearance","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"],"sources":["../../../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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,QACX;AAEP,SAASC,qBAAA,IAAyBC,YAAY,QAAQ;AAEtD;;;;;;;;;AASA,OAAO,MAAMC,oBAAA,GAAuBA,CAACC,KAAA,EAAsBC,GAAA,KAAuD;EAChH,MAAMC,SAAA,GAAYJ,YAAA;MAIHK,iCAAA;EAFf,MAAM;IACJC,IAAA,GAAO;IACPC,UAAA,GAAa,CAAAF,iCAAA,GAAAD,SAAA,CAAUI,sBAAsB,cAAhCH,iCAAA,cAAAA,iCAAA,GAAoC,SAAS;IAC1DI,MAAA,GAAS;IACTC;EAAQ,CACT,GAAGR,KAAA;EAEJ,IACES,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,iBACxBN,UAAA,KAAe,0BAA0BA,UAAA,KAAe,uBAAsB,GAC/E;IACA;IACAO,OAAA,CAAQC,KAAK,CACX,iHACE;EAEN;EAEA,MAAM,CAACC,KAAA,EAAOC,QAAA,CAAS,GAAGpB,oBAAA,CAAqB;IAC7CqB,KAAA,EAAOhB,KAAA,CAAMc,KAAK;IAClBG,YAAA,EAAcjB,KAAA,CAAMkB,YAAY;IAChCC,YAAA,EAAcC;EAChB;EAEA,MAAMC,WAAA,GAAc5B,yBAAA,CAA0B;IAC5CO,KAAA;IACAsB,kBAAA,EAAoB;IACpBC,iBAAA,EAAmB,CAAC,YAAY,SAAS;EAC3C;EAEA,MAAMP,KAAA,GAAuB;IAC3BZ,IAAA;IACAC,UAAA;IACAE,MAAA;IACAiB,UAAA,EAAY;MACVC,IAAA,EAAM;MACNC,QAAA,EAAU;IACZ;IACAA,QAAA,EAAUhC,gBAAA,CAAiBM,KAAA,CAAM0B,QAAQ,EAAE;MACzCC,QAAA,EAAU,IAAI;MACdC,YAAA,EAAc;QACZ3B,GAAA;QACA,GAAGoB,WAAA,CAAYQ;MACjB;IACF;IACAJ,IAAA,EAAM/B,gBAAA,CAAiBM,KAAA,CAAMyB,IAAI,EAAE;MACjCE,QAAA,EAAU,IAAI;MACdC,YAAA,EAAcP,WAAA,CAAYI;IAC5B;EACF;EAEAT,KAAA,CAAMU,QAAQ,CAACZ,KAAK,GAAGA,KAAA;EACvBE,KAAA,CAAMU,QAAQ,CAAClB,QAAQ,GAAGZ,gBAAA,CAAiBkC,EAAA,IAAM;IAC/C,MAAMC,QAAA,GAAWD,EAAA,CAAGE,MAAM,CAAClB,KAAK;IAChCN,QAAA,aAAAA,QAAA,uBAAAA,QAAA,CAAWsB,EAAA,EAAI;MAAEhB,KAAA,EAAOiB;IAAS;IACjChB,QAAA,CAASgB,QAAA;EACX;EAEA,OAAOf,KAAA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","textareaClassNames","root","textarea","textareaHeight","small","medium","large","useRootStyles","base","mc9l5x","B7ck84d","qhf8xq","z8tnut","z189sj","Byoj8tv","uwmqm3","B6of3ja","t21cq0","jrapky","Frg6f3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","disabled","De3pzq","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","luzg7z","B1sv8sq","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","interactive","li1rpt","Bsft5z2","E3zdtr","Eqx8gd","By385i5","B1piin3","Dlnsje","d9w3h3","B3778ie","Bcgy8vk","Bw17bha","B1q35kw","Gjdm7m","b1kco5","Ba2ppi3","F2fol1","lck23g","df92cz","I188md","umuwi5","Blcqepd","nplu4u","Bioka5o","H713fs","B9ooomg","Bercvud","Bbr2w1p","Bduesf4","Bpq79vn","filled","q7v0qe","kmh5ft","nagaa4","B1yhkcb","E5pizo","outline","outlineInteractive","ckks6v","B2zwrfe","xv9156","dt87k2","Bf40cpq","Bop6t4b","gvrnp0","Beu9t3s","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","uqwnxt","Bvecx4l","Bs0cc2w","e1hlit","e2sjt0","Bbcopvn","Bj33j0h","f7epvg","B6oc9vd","ak43y8","wmxk5l","B50zh58","Bbs6y8j","rexu52","B7pmvfx","Belqbek","Bawrxx6","r7b1zc","Bt3ojkv","t1ykpo","Bvq3b66","Brahy3i","zoxjo1","an54nd","invalid","tvckwq","gk2u95","hhx65j","Bxowmz0","d","m","w","h","a","useTextareaStyles","sj55zd","Bh6795r","Bahqtrf","Bqenvij","Bxyxcbc","yvdlaj","B3o7kgh","B4brmom","Brrnbx2","oeaueh","sshi5w","Be2twd7","Bhrd7zp","Bg96gwp","useTextareaResizeStyles","none","B3rzk8w","both","horizontal","vertical","useTextareaStyles_unstable","state","size","appearance","resize","startsWith","rootStyles","className","textareaStyles","textareaResizeStyles"],"sources":["../src/packages/react-components/react-textarea/src/components/Textarea/useTextareaStyles.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\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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAIhE,OAAO,MAAMC,kBAAkB,GAAkC;EAC/DC,IAAI,EAAE,cAAc;EACpBC,QAAQ,EAAE;CACX;AAED,MAAMC,cAAc,GAAG;EACrBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,MAAM;EACdC,KAAK,EAAE;CACR;AAED;;;AAGA,MAAMC,aAAa,gBAAGZ,QAAA;EAAAa,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;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+I,KAAK,CAACrJ,IAAI,CAAC2J,SAAS,GAAGhK,YAAY,CACjCI,kBAAkB,CAACC,IAAI,EACvB0J,UAAU,CAACnJ,IAAI,EACfmJ,UAAU,CAACH,UAAU,CAAC,EACtB9E,MAAM,IAAIiF,UAAU,CAACjF,MAAM,EAC3BlD,QAAQ,IAAImI,UAAU,CAACnI,QAAQ,EAC/B,CAACA,QAAQ,IAAImI,UAAU,CAAC/G,WAAW,EACnC,CAACpB,QAAQ,IAAIgI,UAAU,KAAK,SAAS,IAAIG,UAAU,CAAC1E,kBAAkB,EACtE,CAACzD,QAAQ,IAAI8F,OAAO,IAAIqC,UAAU,CAACrC,OAAO,EAC1CgC,KAAK,CAACrJ,IAAI,CAAC2J,SAAS,CACrB;EAED,MAAMC,cAAc,GAAG7B,iBAAiB,EAAE;EAC1C,MAAM8B,oBAAoB,GAAGf,uBAAuB,EAAE;EACtDO,KAAK,CAACpJ,QAAQ,CAAC0J,SAAS,GAAGhK,YAAY,CACrCI,kBAAkB,CAACE,QAAQ,EAC3B2J,cAAc,CAACrJ,IAAI,EACnBqJ,cAAc,CAACN,IAAI,CAAC,EACpBO,oBAAoB,CAACL,MAAM,CAAC,EAC5BH,KAAK,CAACpJ,QAAQ,CAAC0J,SAAS,CACzB;EAED,OAAON,KAAK;AACd,CAAC"}
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","textareaClassNames","root","textarea","textareaHeight","small","medium","large","useRootStyles","base","mc9l5x","B7ck84d","qhf8xq","z8tnut","z189sj","Byoj8tv","uwmqm3","B6of3ja","t21cq0","jrapky","Frg6f3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","disabled","De3pzq","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","luzg7z","B1sv8sq","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","interactive","li1rpt","Bsft5z2","E3zdtr","Eqx8gd","By385i5","B1piin3","Dlnsje","d9w3h3","B3778ie","Bcgy8vk","Bw17bha","B1q35kw","Gjdm7m","b1kco5","Ba2ppi3","F2fol1","lck23g","df92cz","I188md","umuwi5","Blcqepd","nplu4u","Bioka5o","H713fs","B9ooomg","Bercvud","Bbr2w1p","Bduesf4","Bpq79vn","filled","q7v0qe","kmh5ft","nagaa4","B1yhkcb","E5pizo","outline","outlineInteractive","ckks6v","B2zwrfe","xv9156","dt87k2","Bf40cpq","Bop6t4b","gvrnp0","Beu9t3s","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","uqwnxt","Bvecx4l","Bs0cc2w","e1hlit","e2sjt0","Bbcopvn","Bj33j0h","f7epvg","B6oc9vd","ak43y8","wmxk5l","B50zh58","Bbs6y8j","rexu52","B7pmvfx","Belqbek","Bawrxx6","r7b1zc","Bt3ojkv","t1ykpo","Bvq3b66","Brahy3i","zoxjo1","an54nd","invalid","tvckwq","gk2u95","hhx65j","Bxowmz0","d","m","w","h","a","useTextareaStyles","sj55zd","Bh6795r","Bahqtrf","Bqenvij","Bxyxcbc","yvdlaj","B3o7kgh","B4brmom","Brrnbx2","oeaueh","sshi5w","Be2twd7","Bhrd7zp","Bg96gwp","useTextareaResizeStyles","none","B3rzk8w","both","horizontal","vertical","useTextareaStyles_unstable","state","size","appearance","resize","startsWith","rootStyles","className","textareaStyles","textareaResizeStyles"],"sources":["../../../src/components/Textarea/useTextareaStyles.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\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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,kBAAA,GAAoD;EAC/DC,IAAA,EAAM;EACNC,QAAA,EAAU;AACZ;AAEA,MAAMC,cAAA,GAAiB;EACrBC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,KAAA,EAAO;AACT;AAEA;;;AAGA,MAAMC,aAAA,gBAAgBZ,QAAA;EAAAa,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,M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CAAWnJ,IAAI,EACfmJ,UAAU,CAACH,UAAA,CAAW,EACtB9E,MAAA,IAAUiF,UAAA,CAAWjF,MAAM,EAC3BlD,QAAA,IAAYmI,UAAA,CAAWnI,QAAQ,EAC/B,CAACA,QAAA,IAAYmI,UAAA,CAAW/G,WAAW,EACnC,CAACpB,QAAA,IAAYgI,UAAA,KAAe,aAAaG,UAAA,CAAW1E,kBAAkB,EACtE,CAACzD,QAAA,IAAY8F,OAAA,IAAWqC,UAAA,CAAWrC,OAAO,EAC1CgC,KAAA,CAAMrJ,IAAI,CAAC2J,SAAS;EAGtB,MAAMC,cAAA,GAAiB7B,iBAAA;EACvB,MAAM8B,oBAAA,GAAuBf,uBAAA;EAC7BO,KAAA,CAAMpJ,QAAQ,CAAC0J,SAAS,GAAGhK,YAAA,CACzBI,kBAAA,CAAmBE,QAAQ,EAC3B2J,cAAA,CAAerJ,IAAI,EACnBqJ,cAAc,CAACN,IAAA,CAAK,EACpBO,oBAAoB,CAACL,MAAA,CAAO,EAC5BH,KAAA,CAAMpJ,QAAQ,CAAC0J,SAAS;EAG1B,OAAON,KAAA;AACT"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/* eslint-disable deprecation/deprecation */
|
|
2
|
-
import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
|
|
1
|
+
/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
|
|
3
2
|
import { Textarea, textareaClassNames } from '../../Textarea';
|
|
4
3
|
/** @deprecated Use Field with Textarea: `<Field><Textarea /></Field>` */
|
|
5
4
|
export const textareaFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(textareaClassNames.root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","Textarea","textareaClassNames","textareaFieldClassNames","root","TextareaField"],"sources":["
|
|
1
|
+
{"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","Textarea","textareaClassNames","textareaFieldClassNames","root","TextareaField"],"sources":["../../../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"],"mappings":"AAAA,4CACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ;AAExF,SAASC,QAAQ,EAAEC,kBAAkB,QAAuB;AAI5D;AACA,OAAO,MAAMC,uBAAA,gBAA0BJ,4BAAA,CAA6BG,kBAAA,CAAmBE,IAAI;AAC3F;AACA,OAAO,MAAMC,aAAA,gBAAyDL,mBAAA,CAAoBC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/TextareaField/index.ts"],"sourcesContent":["export * from './TextareaField';\n"],"mappings":"AAAA,cAAc"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable","TextareaField","TextareaField_unstable","textareaFieldClassNames"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable","TextareaField","TextareaField_unstable","textareaFieldClassNames"],"sources":["../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"],"mappings":"AAAA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,oBAAoB,QACf;AAGP;AACA,SAASC,aAAA,IAAiBC,sBAAsB,EAAEC,uBAAuB,QAAQ"}
|
package/lib-commonjs/Textarea.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/Textarea/index"), exports);
|
|
7
|
+
//# sourceMappingURL=Textarea.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/Textarea.js"],"sourcesContent":["export * from './components/Textarea/index';\n//# sourceMappingURL=Textarea.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,oCAAoC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/TextareaField/index"), exports);
|
|
7
|
+
//# sourceMappingURL=TextareaField.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=TextareaField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/TextareaField.js"],"sourcesContent":["export * from './components/TextareaField/index';\n//# sourceMappingURL=TextareaField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Textarea", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Textarea
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
useTextareaStyles_unstable: useCustomStyles
|
|
20
|
-
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
|
21
|
-
useCustomStyles(state);
|
|
22
|
-
return renderTextarea_1.renderTextarea_unstable(state);
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _renderTextarea = require("./renderTextarea");
|
|
12
|
+
const _useTextarea = require("./useTextarea");
|
|
13
|
+
const _useTextareaStyles = require("./useTextareaStyles");
|
|
14
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const Textarea = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
|
+
const state = (0, _useTextarea.useTextarea_unstable)(props, ref);
|
|
17
|
+
(0, _useTextareaStyles.useTextareaStyles_unstable)(state);
|
|
18
|
+
const { useTextareaStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
|
|
19
|
+
useCustomStyles(state);
|
|
20
|
+
return (0, _renderTextarea.renderTextarea_unstable)(state);
|
|
23
21
|
});
|
|
24
|
-
|
|
22
|
+
Textarea.displayName = 'Textarea'; //# sourceMappingURL=Textarea.js.map
|
|
23
|
+
|
|
25
24
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/Textarea.js"],"sourcesContent":["import * as React from 'react';\nimport { renderTextarea_unstable } from './renderTextarea';\nimport { useTextarea_unstable } from './useTextarea';\nimport { useTextareaStyles_unstable } from './useTextareaStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * The Textarea component allows the user to enter and edit text in multiple lines.\n */\nexport const Textarea = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useTextarea_unstable(props, ref);\n useTextareaStyles_unstable(state);\n const {\n useTextareaStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderTextarea_unstable(state);\n});\nTextarea.displayName = 'Textarea';\n//# sourceMappingURL=Textarea.js.map"],"names":["Textarea","React","forwardRef","props","ref","state","useTextarea_unstable","useTextareaStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderTextarea_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACiB;6BACH;mCACM;qCACE;AAItC,MAAMA,WAAW,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACpE,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1CG,IAAAA,6CAA0B,EAACF;IAC3B,MAAM,EACJE,4BAA4BC,gBAAe,EAC5C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,uCAAuB,EAACL;AACjC;AACAL,SAASW,WAAW,GAAG,YACvB,oCAAoC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
7
|
+
//# sourceMappingURL=Textarea.types.js.map
|
|
8
|
+
|
|
6
9
|
//# sourceMappingURL=Textarea.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/Textarea.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Textarea.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,0CAA0C"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./Textarea"), exports);
|
|
7
|
+
_exportStar(require("./Textarea.types"), exports);
|
|
8
|
+
_exportStar(require("./renderTextarea"), exports);
|
|
9
|
+
_exportStar(require("./useTextarea"), exports);
|
|
10
|
+
_exportStar(require("./useTextareaStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/index.js"],"sourcesContent":["export * from './Textarea';\nexport * from './Textarea.types';\nexport * from './renderTextarea';\nexport * from './useTextarea';\nexport * from './useTextareaStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderTextarea_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderTextarea_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
slots,
|
|
15
|
-
slotProps
|
|
16
|
-
} = react_utilities_1.getSlots(state);
|
|
17
|
-
return React.createElement(slots.root, {
|
|
18
|
-
...slotProps.root
|
|
19
|
-
}, React.createElement(slots.textarea, {
|
|
20
|
-
...slotProps.textarea
|
|
21
|
-
}));
|
|
22
|
-
};
|
|
23
|
-
exports.renderTextarea_unstable = renderTextarea_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const renderTextarea_unstable = (state)=>{
|
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
14
|
+
return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, /*#__PURE__*/ _react.createElement(slots.textarea, slotProps.textarea));
|
|
15
|
+
}; //# sourceMappingURL=renderTextarea.js.map
|
|
16
|
+
|
|
24
17
|
//# sourceMappingURL=renderTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/renderTextarea.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Textarea\n */\nexport const renderTextarea_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.textarea, slotProps.textarea));\n};\n//# sourceMappingURL=renderTextarea.js.map"],"names":["renderTextarea_unstable","state","slots","slotProps","getSlots","React","createElement","root","textarea"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,0BAA0BC,CAAAA,QAAS;IAC9C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACJ,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ;AACzI,GACA,0CAA0C"}
|