Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
@fluentui/react-textarea
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
+20
View File
@@ -0,0 +1,20 @@
# @fluentui/react-textarea
**React Textarea components for [Fluent UI React](https://react.fluentui.dev)**
The Textarea component is a multiline text input that allows the user to enter
## Usage
To import Textarea:
```js
import { Textarea } from '@fluentui/react-textarea';
```
### Examples
```js
<Textarea placeholder="Enter text here..." />
<Textarea defaultValue="Lorem ipsum dolor" />
```
+102
View File
@@ -0,0 +1,102 @@
/// <reference types="react" />
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import { SlotClassNames } from '@fluentui/react-utilities';
/**
* Render the final JSX of Textarea
*/
export declare const renderTextarea_unstable: (state: TextareaState) => JSX.Element;
/**
* The Textarea component allows the user to enter and edit text in multiple lines.
*/
export declare const Textarea: ForwardRefComponent<TextareaProps>;
export declare const textareaClassNames: SlotClassNames<TextareaSlots>;
/**
* Data passed to the `onChange` callback when the textarea's value changes.
*/
export declare type TextareaOnChangeData = {
value: string;
};
/**
* Textarea Props
*/
export declare type TextareaProps = Omit<ComponentProps<Partial<TextareaSlots>, 'textarea'>, 'defaultValue' | 'onChange' | 'size' | 'value'> & {
/**
* Styling the Textarea should use.
*
* @default outline
*
* Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.
*/
appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';
/**
* The default value of the Textarea.
*/
defaultValue?: string;
/**
* Callback for when the user changes the value.
*/
onChange?: (ev: React_2.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;
/**
* Which direction the Textarea is allowed to be resized.
*
* @default none
*/
resize?: 'none' | 'horizontal' | 'vertical' | 'both';
/**
* Size of the Textarea.
*
* @default medium
*/
size?: 'small' | 'medium' | 'large';
/**
* The value of the Textarea.
*/
value?: string;
};
export declare type TextareaSlots = {
/**
* Wrapper element used for displaying the borders for Textarea. This wrapper is needed due to the focus
* indicator border animation. For more information, see Spec.md
*
* The root only receives `className` and `style`. All other props are applied to the `textarea` slot.
*/
root: NonNullable<Slot<'span'>>;
/**
* The `<textarea>` element. This is the primary slot, all native props and ref are applied to this slot.
*/
textarea: NonNullable<Slot<'textarea'>>;
};
/**
* State used in rendering Textarea
*/
export declare type TextareaState = ComponentState<TextareaSlots> & Required<Pick<TextareaProps, 'appearance' | 'resize' | 'size'>>;
/**
* Create the state required to render Textarea.
*
* The returned state can be modified with hooks such as useTextareaStyles_unstable,
* before being passed to renderTextarea_unstable.
*
* @param props - props from this instance of Textarea
* @param ref - reference to root HTMLElement of Textarea
*/
export declare const useTextarea_unstable: (props: TextareaProps, ref: React_2.Ref<HTMLTextAreaElement>) => TextareaState;
/**
* Apply styling to the Textarea slots based on the state
*/
export declare const useTextareaStyles_unstable: (state: TextareaState) => TextareaState;
export { }
+28
View File
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Textarea: function() {
return _index.Textarea;
},
renderTextarea_unstable: function() {
return _index.renderTextarea_unstable;
},
textareaClassNames: function() {
return _index.textareaClassNames;
},
useTextareaStyles_unstable: function() {
return _index.useTextareaStyles_unstable;
},
useTextarea_unstable: function() {
return _index.useTextarea_unstable;
}
});
const _index = require("./components/Textarea/index");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Textarea.ts"],"sourcesContent":["export type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './components/Textarea/index';\nexport {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './components/Textarea/index';\n"],"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,QAAQ;eAARA,eAAQ;;IACRC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,kBAAkB;eAAlBA,yBAAkB;;IAClBC,0BAA0B;eAA1BA,iCAA0B;;IAC1BC,oBAAoB;eAApBA,2BAAoB;;;uBACf"}
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Textarea", {
enumerable: true,
get: function() {
return Textarea;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _renderTextarea = require("./renderTextarea");
const _useTextarea = require("./useTextarea");
const _useTextareaStylesstyles = require("./useTextareaStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const Textarea = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useTextarea.useTextarea_unstable)(props, ref);
(0, _useTextareaStylesstyles.useTextareaStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useTextareaStyles_unstable')(state);
return (0, _renderTextarea.renderTextarea_unstable)(state);
});
Textarea.displayName = 'Textarea';
@@ -0,0 +1 @@
{"version":3,"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.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { TextareaProps } from './Textarea.types';\nimport { useCustomStyleHook_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 useCustomStyleHook_unstable('useTextareaStyles_unstable')(state);\n\n return renderTextarea_unstable(state);\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":["Textarea","React","forwardRef","props","ref","state","useTextarea_unstable","useTextareaStyles_unstable","useCustomStyleHook_unstable","renderTextarea_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACiB;6BACH;yCACM;qCAGC;AAKrC,MAAMA,WAAAA,WAAAA,GAA+CC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQC,IAAAA,iCAAAA,EAAqBH,OAAOC;IAE1CG,IAAAA,mDAAAA,EAA2BF;IAE3BG,IAAAA,gDAAAA,EAA4B,8BAA8BH;IAE1D,OAAOI,IAAAA,uCAAAA,EAAwBJ;AACjC;AAEAL,SAASU,WAAW,GAAG"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"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 // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\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"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Textarea: function() {
return _Textarea.Textarea;
},
renderTextarea_unstable: function() {
return _renderTextarea.renderTextarea_unstable;
},
textareaClassNames: function() {
return _useTextareaStylesstyles.textareaClassNames;
},
useTextareaStyles_unstable: function() {
return _useTextareaStylesstyles.useTextareaStyles_unstable;
},
useTextarea_unstable: function() {
return _useTextarea.useTextarea_unstable;
}
});
const _Textarea = require("./Textarea");
const _renderTextarea = require("./renderTextarea");
const _useTextarea = require("./useTextarea");
const _useTextareaStylesstyles = require("./useTextareaStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/index.ts"],"sourcesContent":["export { Textarea } from './Textarea';\nexport type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './Textarea.types';\nexport { renderTextarea_unstable } from './renderTextarea';\nexport { useTextarea_unstable } from './useTextarea';\nexport { textareaClassNames, useTextareaStyles_unstable } from './useTextareaStyles.styles';\n"],"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAERC,uBAAuB;eAAvBA,uCAAuB;;IAEvBC,kBAAkB;eAAlBA,2CAAkB;;IAAEC,0BAA0B;eAA1BA,mDAA0B;;IAD9CC,oBAAoB;eAApBA,iCAAoB;;;0BAHJ;gCAEe;6BACH;yCAC0B"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderTextarea_unstable", {
enumerable: true,
get: function() {
return renderTextarea_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderTextarea_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.textarea, {})
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/renderTextarea.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<TextareaSlots>(state);\n\n return (\n <state.root>\n <state.textarea />\n </state.root>\n );\n};\n"],"names":["renderTextarea_unstable","state","assertSlots","_jsx","root","textarea"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,0BAA0B,CAACC;IACtCC,IAAAA,2BAAAA,EAA2BD;IAE3B,OAAA,WAAA,GACEE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBACT,WAAA,GAAAD,IAAAA,eAAA,EAACF,MAAMI,QAAQ,EAAA,CAAA;;AAGrB"}
@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useTextarea_unstable", {
enumerable: true,
get: function() {
return useTextarea_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactfield = require("@fluentui/react-field");
const _reactutilities = require("@fluentui/react-utilities");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const useTextarea_unstable = (props, ref)=>{
// Merge props from surrounding <Field>, if any
props = (0, _reactfield.useFieldControlProps_unstable)(props, {
supportsLabelFor: true,
supportsRequired: true,
supportsSize: true
});
const overrides = (0, _reactsharedcontexts.useOverrides_unstable)();
var _overrides_inputDefaultAppearance;
const { size = 'medium', appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline', resize = 'none', onChange } = props;
if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
// eslint-disable-next-line no-console
console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" + ' future.');
}
const [value, setValue] = (0, _reactutilities.useControllableState)({
state: props.value,
defaultState: props.defaultValue,
initialState: undefined
});
const nativeProps = (0, _reactutilities.getPartitionedNativeProps)({
props,
primarySlotTagName: 'textarea',
excludedPropNames: [
'onChange',
'value',
'defaultValue'
]
});
const state = {
size,
appearance,
resize,
components: {
root: 'span',
textarea: 'textarea'
},
textarea: _reactutilities.slot.always(props.textarea, {
defaultProps: {
ref,
...nativeProps.primary
},
elementType: 'textarea'
}),
root: _reactutilities.slot.always(props.root, {
defaultProps: nativeProps.root,
elementType: 'span'
})
};
state.textarea.value = value;
state.textarea.onChange = (0, _reactutilities.useEventCallback)((ev)=>{
const newValue = ev.target.value;
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
value: newValue
});
setValue(newValue);
});
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/useTextarea.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useControllableState, useEventCallback, slot } 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 // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.textarea, {\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n elementType: 'textarea',\n }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["useTextarea_unstable","props","ref","useFieldControlProps_unstable","supportsLabelFor","supportsRequired","supportsSize","overrides","useOverrides","size","appearance","inputDefaultAppearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","useControllableState","state","defaultState","defaultValue","initialState","undefined","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","slot","always","defaultProps","primary","elementType","useEventCallback","ev","newValue","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;4BACuB;gCAC0C;qCAElC;AAW/C,MAAMA,uBAAuB,CAACC,OAAsBC;IACzD,+CAA+C;IAC/CD,QAAQE,IAAAA,yCAAAA,EAA8BF,OAAO;QAAEG,kBAAkB;QAAMC,kBAAkB;QAAMC,cAAc;IAAK;IAElH,MAAMC,YAAYC,IAAAA,0CAAAA;QAIHD;IAFf,MAAM,EACJE,OAAO,QAAQ,EACfC,aAAaH,CAAAA,oCAAAA,UAAUI,sBAAsB,AAAtBA,MAAsB,QAAhCJ,sCAAAA,KAAAA,IAAAA,oCAAoC,SAAS,EAC1DK,SAAS,MAAM,EACfC,QAAQ,EACT,GAAGZ;IAEJ,IACEa,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBN,CAAAA,eAAe,0BAA0BA,eAAe,uBAAA,GACzD;QACA,sCAAsC;QACtCO,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGC,IAAAA,oCAAAA,EAAqB;QAC7CC,OAAOrB,MAAMkB,KAAK;QAClBI,cAActB,MAAMuB,YAAY;QAChCC,cAAcC;IAChB;IAEA,MAAMC,cAAcC,IAAAA,yCAAAA,EAA0B;QAC5C3B;QACA4B,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;YAAS;SAAe;IAC1D;IAEA,MAAMR,QAAuB;QAC3Bb;QACAC;QACAE;QACAmB,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUC,oBAAAA,CAAKC,MAAM,CAAClC,MAAMgC,QAAQ,EAAE;YACpCG,cAAc;gBACZlC;gBACA,GAAGyB,YAAYU,OAAO;YACxB;YACAC,aAAa;QACf;QACAN,MAAME,oBAAAA,CAAKC,MAAM,CAAClC,MAAM+B,IAAI,EAAE;YAC5BI,cAAcT,YAAYK,IAAI;YAC9BM,aAAa;QACf;IACF;IAEAhB,MAAMW,QAAQ,CAACd,KAAK,GAAGA;IACvBG,MAAMW,QAAQ,CAACpB,QAAQ,GAAG0B,IAAAA,gCAAAA,EAAiBC,CAAAA;QACzC,MAAMC,WAAWD,GAAGE,MAAM,CAACvB,KAAK;QAChCN,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAW2B,IAAI;YAAErB,OAAOsB;QAAS;QACjCrB,SAASqB;IACX;IAEA,OAAOnB;AACT"}
@@ -0,0 +1,624 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
textareaClassNames: function() {
return textareaClassNames;
},
useTextareaStyles_unstable: function() {
return useTextareaStyles_unstable;
}
});
const _react = require("@griffel/react");
const textareaClassNames = {
root: 'fui-Textarea',
textarea: 'fui-Textarea__textarea'
};
/**
* Styles for the root(wrapper) slot
*/ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
mc9l5x: "ftuwxu6",
B7ck84d: "f1ewtqcl",
qhf8xq: "f10pi13n",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1yiegib",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
ha4doy: "f12kltsn"
},
disabled: {
De3pzq: "f1c21dwh",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "ff3nzm7",
Bjwas2f: "fg455y9",
Bn1d65q: [
"f1rvyvqg",
"f14g86mu"
],
Bxeuatn: "f1cwzwz",
n51gp8: [
"f14g86mu",
"f1rvyvqg"
]
},
interactive: {
li1rpt: "f1gw3sf2",
Bsft5z2: "f13zj6fq",
E3zdtr: "f1mdlcz9",
Eqx8gd: [
"f1a7op3",
"f1cjjd47"
],
By385i5: "f1gboi2j",
B1piin3: [
"f1cjjd47",
"f1a7op3"
],
Dlnsje: "ffyw7fx",
d9w3h3: [
"f1kp91vd",
"f1ibwz09"
],
B3778ie: [
"f1ibwz09",
"f1kp91vd"
],
B1q35kw: 0,
Bw17bha: 0,
Bcgy8vk: 0,
Bjuhk93: "f1mnjydx",
Gjdm7m: "fj2g8qd",
b1kco5: "f1yk9hq",
Ba2ppi3: "fhwpy7i",
F2fol1: "f14ee0xe",
lck23g: "f1xhbsuh",
df92cz: "fv8e3ye",
I188md: "ftb5wc6",
umuwi5: "fjw5xc1",
Blcqepd: "f1xdyd5c",
nplu4u: "fatpbeo",
Bioka5o: "fb7uyps",
H713fs: "f1cmft4k",
B9ooomg: "f1x58t8o",
Bercvud: "f1ibeo51",
Bbr2w1p: "f1vnc8sk",
Bduesf4: "f3e99gv",
Bpq79vn: "fhljsf7"
},
filled: {
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f88035w",
q7v0qe: "ftmjh5b",
kmh5ft: [
"f17blpuu",
"fsrcdbj"
],
nagaa4: "f1tpwn32",
B1yhkcb: [
"fsrcdbj",
"f17blpuu"
]
},
"filled-darker": {
De3pzq: "f16xq7d1"
},
"filled-lighter": {
De3pzq: "fxugw4r"
},
"filled-darker-shadow": {
De3pzq: "f16xq7d1",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f1gmd7mu",
E5pizo: "fyed02w"
},
"filled-lighter-shadow": {
De3pzq: "fxugw4r",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f1gmd7mu",
E5pizo: "fyed02w"
},
outline: {
De3pzq: "fxugw4r",
Bgfg5da: 0,
B9xav0g: "f1c1zstj",
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "fhz96rm"
},
outlineInteractive: {
kzujx5: 0,
oetu4i: "f1l4zc64",
gvrnp0: 0,
xv9156: 0,
jek2p4: 0,
gg5e9n: 0,
Beu9t3s: 0,
dt87k2: 0,
Bt1vbvt: 0,
Bwzppfd: 0,
Bop6t4b: 0,
B2zwrfe: 0,
Bwp2tzp: 0,
Bgoe8wy: 0,
Bf40cpq: 0,
ckks6v: 0,
Baalond: "f9mts5e",
v2iqwr: 0,
wmxk5l: "f1z0osm6",
Bj33j0h: 0,
Bs0cc2w: 0,
qwjtx1: 0,
B50zh58: 0,
f7epvg: 0,
e1hlit: 0,
B7mkhst: 0,
ak43y8: 0,
Bbcopvn: 0,
Bvecx4l: 0,
lwioe0: 0,
B6oc9vd: 0,
e2sjt0: 0,
uqwnxt: 0,
asj8p9: "f1acnei2",
Br8fjdy: 0,
zoxjo1: "f1so894s",
Bt3ojkv: 0,
B7pmvfx: 0,
Bfht2n1: 0,
an54nd: 0,
t1ykpo: 0,
Belqbek: 0,
bbt1vd: 0,
Brahy3i: 0,
r7b1zc: 0,
rexu52: 0,
ovtnii: 0,
Bvq3b66: 0,
Bawrxx6: 0,
Bbs6y8j: 0,
B2qpgjt: "fds4ob8"
},
invalid: {
tvckwq: "fs4k3qj",
gk2u95: [
"fcee079",
"fmyw78r"
],
hhx65j: "f1fgmyf4",
Bxowmz0: [
"fmyw78r",
"fcee079"
]
}
}, {
d: [
".ftuwxu6{display:inline-flex;}",
".f1ewtqcl{box-sizing:border-box;}",
".f10pi13n{position:relative;}",
[
".f1yiegib{padding:0 0 var(--strokeWidthThick) 0;}",
{
p: -1
}
],
[
".f1s184ao{margin:0;}",
{
p: -1
}
],
[
".ft85np5{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".f12kltsn{vertical-align:top;}",
".f1c21dwh{background-color:var(--colorTransparentBackground);}",
[
".ff3nzm7{border:var(--strokeWidthThin) solid var(--colorNeutralStrokeDisabled);}",
{
p: -2
}
],
".f1gw3sf2::after{box-sizing:border-box;}",
".f13zj6fq::after{content:\"\";}",
".f1mdlcz9::after{position:absolute;}",
".f1a7op3::after{left:-1px;}",
".f1cjjd47::after{right:-1px;}",
".f1gboi2j::after{bottom:-1px;}",
".ffyw7fx::after{height:max(var(--strokeWidthThick), var(--borderRadiusMedium));}",
".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
[
".f1mnjydx::after{border-bottom:var(--strokeWidthThick) solid var(--colorCompoundBrandStroke);}",
{
p: -1
}
],
".fj2g8qd::after{clip-path:inset(calc(100% - var(--strokeWidthThick)) 0 0 0);}",
".f1yk9hq::after{transform:scaleX(0);}",
".fhwpy7i::after{transition-property:transform;}",
".f14ee0xe::after{transition-duration:var(--durationUltraFast);}",
".f1xhbsuh::after{transition-delay:var(--curveAccelerateMid);}",
[
".f88035w{border:var(--strokeWidthThin) solid var(--colorTransparentStroke);}",
{
p: -2
}
],
".f16xq7d1{background-color:var(--colorNeutralBackground3);}",
".fxugw4r{background-color:var(--colorNeutralBackground1);}",
[
".f1gmd7mu{border:var(--strokeWidthThin) solid var(--colorTransparentStrokeInteractive);}",
{
p: -2
}
],
".fyed02w{box-shadow:var(--shadow2);}",
[
".f1gmd7mu{border:var(--strokeWidthThin) solid var(--colorTransparentStrokeInteractive);}",
{
p: -2
}
],
[
".fhz96rm{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);}",
{
p: -2
}
],
".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}",
".fs4k3qj:not(:focus-within),.fs4k3qj:hover:not(:focus-within){border-top-color:var(--colorPaletteRedBorder2);}",
".fcee079:not(:focus-within),.fcee079:hover:not(:focus-within){border-right-color:var(--colorPaletteRedBorder2);}",
".fmyw78r:not(:focus-within),.fmyw78r:hover:not(:focus-within){border-left-color:var(--colorPaletteRedBorder2);}",
".f1fgmyf4:not(:focus-within),.f1fgmyf4:hover:not(:focus-within){border-bottom-color:var(--colorPaletteRedBorder2);}"
],
m: [
[
"@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1cwzwz{border-bottom-color:GrayText;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media screen and (prefers-reduced-motion: reduce){.fv8e3ye::after{transition-duration:0.01ms;}}",
{
m: "screen and (prefers-reduced-motion: reduce)"
}
],
[
"@media screen and (prefers-reduced-motion: reduce){.ftb5wc6::after{transition-delay:0.01ms;}}",
{
m: "screen and (prefers-reduced-motion: reduce)"
}
],
[
"@media screen and (prefers-reduced-motion: reduce){.f1cmft4k:focus-within::after{transition-duration:0.01ms;}}",
{
m: "screen and (prefers-reduced-motion: reduce)"
}
],
[
"@media screen and (prefers-reduced-motion: reduce){.f1x58t8o:focus-within::after{transition-delay:0.01ms;}}",
{
m: "screen and (prefers-reduced-motion: reduce)"
}
]
],
w: [
".fjw5xc1:focus-within::after{transform:scaleX(1);}",
".f1xdyd5c:focus-within::after{transition-property:transform;}",
".fatpbeo:focus-within::after{transition-duration:var(--durationNormal);}",
".fb7uyps:focus-within::after{transition-delay:var(--curveDecelerateMid);}",
".f1ibeo51:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}",
".f1vnc8sk:focus-within{outline-width:var(--strokeWidthThick);}",
".f3e99gv:focus-within{outline-style:solid;}",
".fhljsf7:focus-within{outline-color:transparent;}",
[
".fds4ob8:focus-within{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);}",
{
p: -2
}
],
".f1so894s:focus-within{border-bottom-color:var(--colorCompoundBrandStroke);}"
],
h: [
".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}",
".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}",
".fsrcdbj:hover,.fsrcdbj:focus-within{border-left-color:var(--colorTransparentStrokeInteractive);}",
".f1tpwn32:hover,.f1tpwn32:focus-within{border-bottom-color:var(--colorTransparentStrokeInteractive);}",
[
".f9mts5e:hover{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1Hover);}",
{
p: -2
}
],
".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}"
],
a: [
[
".f1acnei2:active{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1Pressed);}",
{
p: -2
}
],
".f1z0osm6:active{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}"
]
});
/**
* Styles for the textarea slot
*/ const useTextareaStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
icvyot: "f1ern45e",
vrafjx: [
"f1n71otn",
"f1deefiw"
],
oivjwe: "f1h8hb77",
wvpqe5: [
"f1deefiw",
"f1n71otn"
],
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
De3pzq: "f3rmtva",
B7ck84d: "f1ewtqcl",
sj55zd: "f19n0e5",
Bh6795r: "fqerorx",
Bahqtrf: "fk6fouc",
Bqenvij: "f1l02sjl",
yvdlaj: "fwyc1cq",
B3o7kgh: "f13ta7ih",
B4brmom: "f1vw9udw",
Brrnbx2: "fbb3kq8",
oeaueh: "f1s6fcnf"
},
disabled: {
sj55zd: "f1s2aq7o",
Bceei9c: "fdrzuqr",
yvdlaj: "fahhnxm"
},
small: {
sshi5w: "f1w5jphr",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1pnffij",
Bxyxcbc: "f192z54u",
Bahqtrf: "fk6fouc",
Be2twd7: "fy9rknc",
Bhrd7zp: "figsok6",
Bg96gwp: "fwrc4pm"
},
medium: {
sshi5w: "fvmd9f",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1ww82xo",
Bxyxcbc: "f1if7ixc",
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
Bg96gwp: "f1i3iumi"
},
large: {
sshi5w: "f1kfson",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f15hvtkj",
Bxyxcbc: "f3kip1f",
Bahqtrf: "fk6fouc",
Be2twd7: "fod5ikn",
Bhrd7zp: "figsok6",
Bg96gwp: "faaz57k"
}
}, {
d: [
".f1ern45e{border-top-style:none;}",
".f1n71otn{border-right-style:none;}",
".f1deefiw{border-left-style:none;}",
".f1h8hb77{border-bottom-style:none;}",
[
".f1s184ao{margin:0;}",
{
p: -1
}
],
".f3rmtva{background-color:transparent;}",
".f1ewtqcl{box-sizing:border-box;}",
".f19n0e5{color:var(--colorNeutralForeground1);}",
".fqerorx{flex-grow:1;}",
".fk6fouc{font-family:var(--fontFamilyBase);}",
".f1l02sjl{height:100%;}",
".fwyc1cq::-webkit-input-placeholder{color:var(--colorNeutralForeground4);}",
".fwyc1cq::-moz-placeholder{color:var(--colorNeutralForeground4);}",
".f13ta7ih::-webkit-input-placeholder{opacity:1;}",
".f13ta7ih::-moz-placeholder{opacity:1;}",
".f1vw9udw::selection{color:var(--colorNeutralForegroundInverted);}",
".fbb3kq8::selection{background-color:var(--colorNeutralBackgroundInverted);}",
".f1s6fcnf{outline-style:none;}",
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
".fdrzuqr{cursor:not-allowed;}",
".fahhnxm::-webkit-input-placeholder{color:var(--colorNeutralForegroundDisabled);}",
".fahhnxm::-moz-placeholder{color:var(--colorNeutralForegroundDisabled);}",
".f1w5jphr{min-height:40px;}",
[
".f1pnffij{padding:var(--spacingVerticalXS) calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}",
{
p: -1
}
],
".f192z54u{max-height:200px;}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".figsok6{font-weight:var(--fontWeightRegular);}",
".fwrc4pm{line-height:var(--lineHeightBase200);}",
".fvmd9f{min-height:52px;}",
[
".f1ww82xo{padding:var(--spacingVerticalSNudge) calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}",
{
p: -1
}
],
".f1if7ixc{max-height:260px;}",
".fkhj508{font-size:var(--fontSizeBase300);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}",
".f1kfson{min-height:64px;}",
[
".f15hvtkj{padding:var(--spacingVerticalS) calc(var(--spacingHorizontalM) + var(--spacingHorizontalXXS));}",
{
p: -1
}
],
".f3kip1f{max-height:320px;}",
".fod5ikn{font-size:var(--fontSizeBase400);}",
".faaz57k{line-height:var(--lineHeightBase400);}"
]
});
/**
* Styles for the textarea's resize property
*/ const useTextareaResizeStyles = /*#__PURE__*/ (0, _react.__styles)({
none: {
B3rzk8w: "f1o1s39h"
},
both: {
B3rzk8w: "f1pxm0xe"
},
horizontal: {
B3rzk8w: "fq6nmtn"
},
vertical: {
B3rzk8w: "f1f5ktr4"
}
}, {
d: [
".f1o1s39h{resize:none;}",
".f1pxm0xe{resize:both;}",
".fq6nmtn{resize:horizontal;}",
".f1f5ktr4{resize:vertical;}"
]
});
const useTextareaStyles_unstable = (state)=>{
'use no memo';
const { size, appearance, resize } = state;
const disabled = state.textarea.disabled;
const invalid = `${state.textarea['aria-invalid']}` === 'true';
const filled = appearance.startsWith('filled');
const rootStyles = useRootStyles();
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);
const textareaStyles = useTextareaStyles();
const textareaResizeStyles = useTextareaResizeStyles();
state.textarea.className = (0, _react.mergeClasses)(textareaClassNames.textarea, textareaStyles.base, textareaStyles[size], textareaResizeStyles[resize], disabled && textareaStyles.disabled, state.textarea.className);
return state;
};
File diff suppressed because one or more lines are too long
+28
View File
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Textarea: function() {
return _Textarea.Textarea;
},
renderTextarea_unstable: function() {
return _Textarea.renderTextarea_unstable;
},
textareaClassNames: function() {
return _Textarea.textareaClassNames;
},
useTextareaStyles_unstable: function() {
return _Textarea.useTextareaStyles_unstable;
},
useTextarea_unstable: function() {
return _Textarea.useTextarea_unstable;
}
});
const _Textarea = require("./Textarea");
+1
View File
@@ -0,0 +1 @@
{"version":3,"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"],"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,QAAQ;eAARA,kBAAQ;;IACRC,uBAAuB;eAAvBA,iCAAuB;;IACvBC,kBAAkB;eAAlBA,4BAAkB;;IAClBC,0BAA0B;eAA1BA,oCAA0B;;IAC1BC,oBAAoB;eAApBA,8BAAoB;;;0BACf"}
+1
View File
@@ -0,0 +1 @@
export { Textarea, renderTextarea_unstable, textareaClassNames, useTextareaStyles_unstable, useTextarea_unstable } from './components/Textarea/index';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Textarea.ts"],"sourcesContent":["export type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './components/Textarea/index';\nexport {\n Textarea,\n renderTextarea_unstable,\n textareaClassNames,\n useTextareaStyles_unstable,\n useTextarea_unstable,\n} from './components/Textarea/index';\n"],"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,oBAAoB,QACf,8BAA8B"}
@@ -0,0 +1,14 @@
import * as React from 'react';
import { renderTextarea_unstable } from './renderTextarea';
import { useTextarea_unstable } from './useTextarea';
import { useTextareaStyles_unstable } from './useTextareaStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* The Textarea component allows the user to enter and edit text in multiple lines.
*/ export const Textarea = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useTextarea_unstable(props, ref);
useTextareaStyles_unstable(state);
useCustomStyleHook_unstable('useTextareaStyles_unstable')(state);
return renderTextarea_unstable(state);
});
Textarea.displayName = 'Textarea';
@@ -0,0 +1 @@
{"version":3,"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.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { TextareaProps } from './Textarea.types';\nimport { useCustomStyleHook_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 useCustomStyleHook_unstable('useTextareaStyles_unstable')(state);\n\n return renderTextarea_unstable(state);\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":["React","renderTextarea_unstable","useTextarea_unstable","useTextareaStyles_unstable","useCustomStyleHook_unstable","Textarea","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,yBAA+CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQP,qBAAqBK,OAAOC;IAE1CL,2BAA2BM;IAE3BL,4BAA4B,8BAA8BK;IAE1D,OAAOR,wBAAwBQ;AACjC,GAAG;AAEHJ,SAASK,WAAW,GAAG"}
@@ -0,0 +1 @@
import * as React from 'react';
@@ -0,0 +1 @@
{"version":3,"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 // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\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"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,4 @@
export { Textarea } from './Textarea';
export { renderTextarea_unstable } from './renderTextarea';
export { useTextarea_unstable } from './useTextarea';
export { textareaClassNames, useTextareaStyles_unstable } from './useTextareaStyles.styles';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/index.ts"],"sourcesContent":["export { Textarea } from './Textarea';\nexport type { TextareaOnChangeData, TextareaProps, TextareaSlots, TextareaState } from './Textarea.types';\nexport { renderTextarea_unstable } from './renderTextarea';\nexport { useTextarea_unstable } from './useTextarea';\nexport { textareaClassNames, useTextareaStyles_unstable } from './useTextareaStyles.styles';\n"],"names":["Textarea","renderTextarea_unstable","useTextarea_unstable","textareaClassNames","useTextareaStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,QAAQ,QAAQ,aAAa;AAEtC,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,6BAA6B"}
@@ -0,0 +1,10 @@
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of Textarea
*/ export const renderTextarea_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(state.root, {
children: /*#__PURE__*/ _jsx(state.textarea, {})
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/renderTextarea.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<TextareaSlots>(state);\n\n return (\n <state.root>\n <state.textarea />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTextarea_unstable","state","root","textarea"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtCF,YAA2BE;IAE3B,qBACE,KAACA,MAAMC,IAAI;kBACT,cAAA,KAACD,MAAME,QAAQ;;AAGrB,EAAE"}
@@ -0,0 +1,70 @@
import * as React from 'react';
import { useFieldControlProps_unstable } from '@fluentui/react-field';
import { getPartitionedNativeProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';
/**
* Create the state required to render Textarea.
*
* The returned state can be modified with hooks such as useTextareaStyles_unstable,
* before being passed to renderTextarea_unstable.
*
* @param props - props from this instance of Textarea
* @param ref - reference to root HTMLElement of Textarea
*/ export const useTextarea_unstable = (props, ref)=>{
// Merge props from surrounding <Field>, if any
props = useFieldControlProps_unstable(props, {
supportsLabelFor: true,
supportsRequired: true,
supportsSize: true
});
const overrides = useOverrides();
var _overrides_inputDefaultAppearance;
const { size = 'medium', appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline', resize = 'none', onChange } = props;
if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
// eslint-disable-next-line no-console
console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" + ' future.');
}
const [value, setValue] = useControllableState({
state: props.value,
defaultState: props.defaultValue,
initialState: undefined
});
const nativeProps = getPartitionedNativeProps({
props,
primarySlotTagName: 'textarea',
excludedPropNames: [
'onChange',
'value',
'defaultValue'
]
});
const state = {
size,
appearance,
resize,
components: {
root: 'span',
textarea: 'textarea'
},
textarea: slot.always(props.textarea, {
defaultProps: {
ref,
...nativeProps.primary
},
elementType: 'textarea'
}),
root: slot.always(props.root, {
defaultProps: nativeProps.root,
elementType: 'span'
})
};
state.textarea.value = value;
state.textarea.onChange = useEventCallback((ev)=>{
const newValue = ev.target.value;
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
value: newValue
});
setValue(newValue);
});
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Textarea/useTextarea.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useControllableState, useEventCallback, slot } 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 // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.textarea, {\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n elementType: 'textarea',\n }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["React","useFieldControlProps_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useTextarea_unstable","props","ref","supportsLabelFor","supportsRequired","supportsSize","overrides","size","appearance","inputDefaultAppearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","state","defaultState","defaultValue","initialState","undefined","nativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","always","defaultProps","primary","elementType","ev","newValue","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,yBAAyB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAEpH,SAASC,yBAAyBC,YAAY,QAAQ,kCAAkC;AAExF;;;;;;;;CAQC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,+CAA+C;IAC/CD,QAAQR,8BAA8BQ,OAAO;QAAEE,kBAAkB;QAAMC,kBAAkB;QAAMC,cAAc;IAAK;IAElH,MAAMC,YAAYP;QAIHO;IAFf,MAAM,EACJC,OAAO,QAAQ,EACfC,aAAaF,CAAAA,oCAAAA,UAAUG,sBAAsB,cAAhCH,+CAAAA,oCAAoC,SAAS,EAC1DI,SAAS,MAAM,EACfC,QAAQ,EACT,GAAGV;IAEJ,IACEW,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBN,CAAAA,eAAe,0BAA0BA,eAAe,uBAAsB,GAC/E;QACA,sCAAsC;QACtCO,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGvB,qBAAqB;QAC7CwB,OAAOlB,MAAMgB,KAAK;QAClBG,cAAcnB,MAAMoB,YAAY;QAChCC,cAAcC;IAChB;IAEA,MAAMC,cAAc9B,0BAA0B;QAC5CO;QACAwB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;YAAS;SAAe;IAC1D;IAEA,MAAMP,QAAuB;QAC3BZ;QACAC;QACAE;QACAiB,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUhC,KAAKiC,MAAM,CAAC7B,MAAM4B,QAAQ,EAAE;YACpCE,cAAc;gBACZ7B;gBACA,GAAGsB,YAAYQ,OAAO;YACxB;YACAC,aAAa;QACf;QACAL,MAAM/B,KAAKiC,MAAM,CAAC7B,MAAM2B,IAAI,EAAE;YAC5BG,cAAcP,YAAYI,IAAI;YAC9BK,aAAa;QACf;IACF;IAEAd,MAAMU,QAAQ,CAACZ,KAAK,GAAGA;IACvBE,MAAMU,QAAQ,CAAClB,QAAQ,GAAGf,iBAAiBsC,CAAAA;QACzC,MAAMC,WAAWD,GAAGE,MAAM,CAACnB,KAAK;QAChCN,qBAAAA,+BAAAA,SAAWuB,IAAI;YAAEjB,OAAOkB;QAAS;QACjCjB,SAASiB;IACX;IAEA,OAAOhB;AACT,EAAE"}
@@ -0,0 +1,403 @@
import { __styles, mergeClasses, shorthands } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
export const textareaClassNames = {
root: 'fui-Textarea',
textarea: 'fui-Textarea__textarea'
};
/**
* Styles for the root(wrapper) slot
*/
const useRootStyles = /*#__PURE__*/__styles({
base: {
mc9l5x: "ftuwxu6",
B7ck84d: "f1ewtqcl",
qhf8xq: "f10pi13n",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1yiegib",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
ha4doy: "f12kltsn"
},
disabled: {
De3pzq: "f1c21dwh",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "ff3nzm7",
Bjwas2f: "fg455y9",
Bn1d65q: ["f1rvyvqg", "f14g86mu"],
Bxeuatn: "f1cwzwz",
n51gp8: ["f14g86mu", "f1rvyvqg"]
},
interactive: {
li1rpt: "f1gw3sf2",
Bsft5z2: "f13zj6fq",
E3zdtr: "f1mdlcz9",
Eqx8gd: ["f1a7op3", "f1cjjd47"],
By385i5: "f1gboi2j",
B1piin3: ["f1cjjd47", "f1a7op3"],
Dlnsje: "ffyw7fx",
d9w3h3: ["f1kp91vd", "f1ibwz09"],
B3778ie: ["f1ibwz09", "f1kp91vd"],
B1q35kw: 0,
Bw17bha: 0,
Bcgy8vk: 0,
Bjuhk93: "f1mnjydx",
Gjdm7m: "fj2g8qd",
b1kco5: "f1yk9hq",
Ba2ppi3: "fhwpy7i",
F2fol1: "f14ee0xe",
lck23g: "f1xhbsuh",
df92cz: "fv8e3ye",
I188md: "ftb5wc6",
umuwi5: "fjw5xc1",
Blcqepd: "f1xdyd5c",
nplu4u: "fatpbeo",
Bioka5o: "fb7uyps",
H713fs: "f1cmft4k",
B9ooomg: "f1x58t8o",
Bercvud: "f1ibeo51",
Bbr2w1p: "f1vnc8sk",
Bduesf4: "f3e99gv",
Bpq79vn: "fhljsf7"
},
filled: {
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f88035w",
q7v0qe: "ftmjh5b",
kmh5ft: ["f17blpuu", "fsrcdbj"],
nagaa4: "f1tpwn32",
B1yhkcb: ["fsrcdbj", "f17blpuu"]
},
"filled-darker": {
De3pzq: "f16xq7d1"
},
"filled-lighter": {
De3pzq: "fxugw4r"
},
"filled-darker-shadow": {
De3pzq: "f16xq7d1",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f1gmd7mu",
E5pizo: "fyed02w"
},
"filled-lighter-shadow": {
De3pzq: "fxugw4r",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f1gmd7mu",
E5pizo: "fyed02w"
},
outline: {
De3pzq: "fxugw4r",
Bgfg5da: 0,
B9xav0g: "f1c1zstj",
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "fhz96rm"
},
outlineInteractive: {
kzujx5: 0,
oetu4i: "f1l4zc64",
gvrnp0: 0,
xv9156: 0,
jek2p4: 0,
gg5e9n: 0,
Beu9t3s: 0,
dt87k2: 0,
Bt1vbvt: 0,
Bwzppfd: 0,
Bop6t4b: 0,
B2zwrfe: 0,
Bwp2tzp: 0,
Bgoe8wy: 0,
Bf40cpq: 0,
ckks6v: 0,
Baalond: "f9mts5e",
v2iqwr: 0,
wmxk5l: "f1z0osm6",
Bj33j0h: 0,
Bs0cc2w: 0,
qwjtx1: 0,
B50zh58: 0,
f7epvg: 0,
e1hlit: 0,
B7mkhst: 0,
ak43y8: 0,
Bbcopvn: 0,
Bvecx4l: 0,
lwioe0: 0,
B6oc9vd: 0,
e2sjt0: 0,
uqwnxt: 0,
asj8p9: "f1acnei2",
Br8fjdy: 0,
zoxjo1: "f1so894s",
Bt3ojkv: 0,
B7pmvfx: 0,
Bfht2n1: 0,
an54nd: 0,
t1ykpo: 0,
Belqbek: 0,
bbt1vd: 0,
Brahy3i: 0,
r7b1zc: 0,
rexu52: 0,
ovtnii: 0,
Bvq3b66: 0,
Bawrxx6: 0,
Bbs6y8j: 0,
B2qpgjt: "fds4ob8"
},
invalid: {
tvckwq: "fs4k3qj",
gk2u95: ["fcee079", "fmyw78r"],
hhx65j: "f1fgmyf4",
Bxowmz0: ["fmyw78r", "fcee079"]
}
}, {
d: [".ftuwxu6{display:inline-flex;}", ".f1ewtqcl{box-sizing:border-box;}", ".f10pi13n{position:relative;}", [".f1yiegib{padding:0 0 var(--strokeWidthThick) 0;}", {
p: -1
}], [".f1s184ao{margin:0;}", {
p: -1
}], [".ft85np5{border-radius:var(--borderRadiusMedium);}", {
p: -1
}], ".f12kltsn{vertical-align:top;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", [".ff3nzm7{border:var(--strokeWidthThin) solid var(--colorNeutralStrokeDisabled);}", {
p: -2
}], ".f1gw3sf2::after{box-sizing:border-box;}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".f1a7op3::after{left:-1px;}", ".f1cjjd47::after{right:-1px;}", ".f1gboi2j::after{bottom:-1px;}", ".ffyw7fx::after{height:max(var(--strokeWidthThick), var(--borderRadiusMedium));}", ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}", [".f1mnjydx::after{border-bottom:var(--strokeWidthThick) solid var(--colorCompoundBrandStroke);}", {
p: -1
}], ".fj2g8qd::after{clip-path:inset(calc(100% - var(--strokeWidthThick)) 0 0 0);}", ".f1yk9hq::after{transform:scaleX(0);}", ".fhwpy7i::after{transition-property:transform;}", ".f14ee0xe::after{transition-duration:var(--durationUltraFast);}", ".f1xhbsuh::after{transition-delay:var(--curveAccelerateMid);}", [".f88035w{border:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
p: -2
}], ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", [".f1gmd7mu{border:var(--strokeWidthThin) solid var(--colorTransparentStrokeInteractive);}", {
p: -2
}], ".fyed02w{box-shadow:var(--shadow2);}", [".f1gmd7mu{border:var(--strokeWidthThin) solid var(--colorTransparentStrokeInteractive);}", {
p: -2
}], [".fhz96rm{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);}", {
p: -2
}], ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".fs4k3qj:not(:focus-within),.fs4k3qj:hover:not(:focus-within){border-top-color:var(--colorPaletteRedBorder2);}", ".fcee079:not(:focus-within),.fcee079:hover:not(:focus-within){border-right-color:var(--colorPaletteRedBorder2);}", ".fmyw78r:not(:focus-within),.fmyw78r:hover:not(:focus-within){border-left-color:var(--colorPaletteRedBorder2);}", ".f1fgmyf4:not(:focus-within),.f1fgmyf4:hover:not(:focus-within){border-bottom-color:var(--colorPaletteRedBorder2);}"],
m: [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f1cwzwz{border-bottom-color:GrayText;}}", {
m: "(forced-colors: active)"
}], ["@media screen and (prefers-reduced-motion: reduce){.fv8e3ye::after{transition-duration:0.01ms;}}", {
m: "screen and (prefers-reduced-motion: reduce)"
}], ["@media screen and (prefers-reduced-motion: reduce){.ftb5wc6::after{transition-delay:0.01ms;}}", {
m: "screen and (prefers-reduced-motion: reduce)"
}], ["@media screen and (prefers-reduced-motion: reduce){.f1cmft4k:focus-within::after{transition-duration:0.01ms;}}", {
m: "screen and (prefers-reduced-motion: reduce)"
}], ["@media screen and (prefers-reduced-motion: reduce){.f1x58t8o:focus-within::after{transition-delay:0.01ms;}}", {
m: "screen and (prefers-reduced-motion: reduce)"
}]],
w: [".fjw5xc1:focus-within::after{transform:scaleX(1);}", ".f1xdyd5c:focus-within::after{transition-property:transform;}", ".fatpbeo:focus-within::after{transition-duration:var(--durationNormal);}", ".fb7uyps:focus-within::after{transition-delay:var(--curveDecelerateMid);}", ".f1ibeo51:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".f1vnc8sk:focus-within{outline-width:var(--strokeWidthThick);}", ".f3e99gv:focus-within{outline-style:solid;}", ".fhljsf7:focus-within{outline-color:transparent;}", [".fds4ob8:focus-within{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);}", {
p: -2
}], ".f1so894s:focus-within{border-bottom-color:var(--colorCompoundBrandStroke);}"],
h: [".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fsrcdbj:hover,.fsrcdbj:focus-within{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f1tpwn32:hover,.f1tpwn32:focus-within{border-bottom-color:var(--colorTransparentStrokeInteractive);}", [".f9mts5e:hover{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1Hover);}", {
p: -2
}], ".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}"],
a: [[".f1acnei2:active{border:var(--strokeWidthThin) solid var(--colorNeutralStroke1Pressed);}", {
p: -2
}], ".f1z0osm6:active{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}"]
});
/**
* Styles for the textarea slot
*/
const useTextareaStyles = /*#__PURE__*/__styles({
base: {
icvyot: "f1ern45e",
vrafjx: ["f1n71otn", "f1deefiw"],
oivjwe: "f1h8hb77",
wvpqe5: ["f1deefiw", "f1n71otn"],
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
De3pzq: "f3rmtva",
B7ck84d: "f1ewtqcl",
sj55zd: "f19n0e5",
Bh6795r: "fqerorx",
Bahqtrf: "fk6fouc",
Bqenvij: "f1l02sjl",
yvdlaj: "fwyc1cq",
B3o7kgh: "f13ta7ih",
B4brmom: "f1vw9udw",
Brrnbx2: "fbb3kq8",
oeaueh: "f1s6fcnf"
},
disabled: {
sj55zd: "f1s2aq7o",
Bceei9c: "fdrzuqr",
yvdlaj: "fahhnxm"
},
small: {
sshi5w: "f1w5jphr",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1pnffij",
Bxyxcbc: "f192z54u",
Bahqtrf: "fk6fouc",
Be2twd7: "fy9rknc",
Bhrd7zp: "figsok6",
Bg96gwp: "fwrc4pm"
},
medium: {
sshi5w: "fvmd9f",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1ww82xo",
Bxyxcbc: "f1if7ixc",
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
Bg96gwp: "f1i3iumi"
},
large: {
sshi5w: "f1kfson",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f15hvtkj",
Bxyxcbc: "f3kip1f",
Bahqtrf: "fk6fouc",
Be2twd7: "fod5ikn",
Bhrd7zp: "figsok6",
Bg96gwp: "faaz57k"
}
}, {
d: [".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", [".f1s184ao{margin:0;}", {
p: -1
}], ".f3rmtva{background-color:transparent;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fqerorx{flex-grow:1;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1l02sjl{height:100%;}", ".fwyc1cq::-webkit-input-placeholder{color:var(--colorNeutralForeground4);}", ".fwyc1cq::-moz-placeholder{color:var(--colorNeutralForeground4);}", ".f13ta7ih::-webkit-input-placeholder{opacity:1;}", ".f13ta7ih::-moz-placeholder{opacity:1;}", ".f1vw9udw::selection{color:var(--colorNeutralForegroundInverted);}", ".fbb3kq8::selection{background-color:var(--colorNeutralBackgroundInverted);}", ".f1s6fcnf{outline-style:none;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".fahhnxm::-webkit-input-placeholder{color:var(--colorNeutralForegroundDisabled);}", ".fahhnxm::-moz-placeholder{color:var(--colorNeutralForegroundDisabled);}", ".f1w5jphr{min-height:40px;}", [".f1pnffij{padding:var(--spacingVerticalXS) calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", {
p: -1
}], ".f192z54u{max-height:200px;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fvmd9f{min-height:52px;}", [".f1ww82xo{padding:var(--spacingVerticalSNudge) calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}", {
p: -1
}], ".f1if7ixc{max-height:260px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1kfson{min-height:64px;}", [".f15hvtkj{padding:var(--spacingVerticalS) calc(var(--spacingHorizontalM) + var(--spacingHorizontalXXS));}", {
p: -1
}], ".f3kip1f{max-height:320px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}"]
});
/**
* Styles for the textarea's resize property
*/
const useTextareaResizeStyles = /*#__PURE__*/__styles({
none: {
B3rzk8w: "f1o1s39h"
},
both: {
B3rzk8w: "f1pxm0xe"
},
horizontal: {
B3rzk8w: "fq6nmtn"
},
vertical: {
B3rzk8w: "f1f5ktr4"
}
}, {
d: [".f1o1s39h{resize:none;}", ".f1pxm0xe{resize:both;}", ".fq6nmtn{resize:horizontal;}", ".f1f5ktr4{resize:vertical;}"]
});
/**
* Apply styling to the Textarea slots based on the state
*/
export const useTextareaStyles_unstable = state => {
'use no memo';
const {
size,
appearance,
resize
} = state;
const disabled = state.textarea.disabled;
const invalid = `${state.textarea['aria-invalid']}` === 'true';
const filled = appearance.startsWith('filled');
const rootStyles = useRootStyles();
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);
const textareaStyles = useTextareaStyles();
const textareaResizeStyles = useTextareaResizeStyles();
state.textarea.className = mergeClasses(textareaClassNames.textarea, textareaStyles.base, textareaStyles[size], textareaResizeStyles[resize], disabled && textareaStyles.disabled, state.textarea.className);
return state;
};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
export { Textarea, renderTextarea_unstable, textareaClassNames, useTextareaStyles_unstable, useTextarea_unstable } from './Textarea';
+1
View File
@@ -0,0 +1 @@
{"version":3,"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"],"names":["Textarea","renderTextarea_unstable","textareaClassNames","useTextareaStyles_unstable","useTextarea_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,oBAAoB,QACf,aAAa"}
+56
View File
@@ -0,0 +1,56 @@
{
"name": "@fluentui/react-textarea",
"version": "9.4.0",
"description": "Fluent UI TextArea component",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/react-conformance": "*",
"@fluentui/react-conformance-griffel": "*",
"@fluentui/scripts-api-extractor": "*"
},
"dependencies": {
"@fluentui/react-field": "^9.2.0",
"@fluentui/react-shared-contexts": "^9.21.2",
"@fluentui/react-theme": "^9.1.24",
"@fluentui/react-utilities": "^9.18.20",
"@fluentui/react-jsx-runtime": "^9.0.50",
"@griffel/react": "^1.5.22",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <19.0.0",
"@types/react-dom": ">=16.9.0 <19.0.0",
"react": ">=16.14.0 <19.0.0",
"react-dom": ">=16.14.0 <19.0.0"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}