@fluentui/react-input 9.2.12 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,69 @@
2
2
  "name": "@fluentui/react-input",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 16 Jan 2023 08:35:39 GMT",
5
+ "date": "Thu, 26 Jan 2023 13:27:46 GMT",
6
+ "tag": "@fluentui/react-input_v9.3.0",
7
+ "version": "9.3.0",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "behowell@microsoft.com",
12
+ "package": "@fluentui/react-input",
13
+ "commit": "d6e98c0b5390c5c7e03601537b2026307e01a8d4",
14
+ "comment": "Deprecate InputField_unstable in favor of Field with Input as its child."
15
+ }
16
+ ],
17
+ "minor": [
18
+ {
19
+ "author": "miroslav.stastny@microsoft.com",
20
+ "package": "@fluentui/react-input",
21
+ "commit": "6f29c8f65b2db6125efbd2a7ec2d7abdd0f44601",
22
+ "comment": "feat: Allow default appearance override"
23
+ },
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-input",
27
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.17",
28
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-input",
33
+ "comment": "Bump @fluentui/react-shared-contexts to v9.2.0",
34
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
35
+ },
36
+ {
37
+ "author": "beachball",
38
+ "package": "@fluentui/react-input",
39
+ "comment": "Bump @fluentui/react-utilities to v9.5.0",
40
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
41
+ },
42
+ {
43
+ "author": "beachball",
44
+ "package": "@fluentui/react-input",
45
+ "comment": "Bump @fluentui/react-text to v9.1.14",
46
+ "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "date": "Mon, 23 Jan 2023 16:43:12 GMT",
53
+ "tag": "@fluentui/react-input_v9.2.13",
54
+ "version": "9.2.13",
55
+ "comments": {
56
+ "patch": [
57
+ {
58
+ "author": "beachball",
59
+ "package": "@fluentui/react-input",
60
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.16",
61
+ "commit": "828c4260edc4fba07c9ccc8e94f15051c7fd25d3"
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "date": "Mon, 16 Jan 2023 08:39:03 GMT",
6
68
  "tag": "@fluentui/react-input_v9.2.12",
7
69
  "version": "9.2.12",
8
70
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,38 @@
1
1
  # Change Log - @fluentui/react-input
2
2
 
3
- This log was last generated on Mon, 16 Jan 2023 08:35:39 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 26 Jan 2023 13:27:46 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.0)
8
+
9
+ Thu, 26 Jan 2023 13:27:46 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.2.13..@fluentui/react-input_v9.3.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: Allow default appearance override ([PR #25262](https://github.com/microsoft/fluentui/pull/25262) by miroslav.stastny@microsoft.com)
15
+ - Bump @fluentui/react-field to v9.0.0-alpha.17 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v9.2.0 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.5.0 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
18
+ - Bump @fluentui/react-text to v9.1.14 ([PR #26496](https://github.com/microsoft/fluentui/pull/26496) by beachball)
19
+
20
+ ### Patches
21
+
22
+ - Deprecate InputField_unstable in favor of Field with Input as its child. ([PR #26430](https://github.com/microsoft/fluentui/pull/26430) by behowell@microsoft.com)
23
+
24
+ ## [9.2.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.2.13)
25
+
26
+ Mon, 23 Jan 2023 16:43:12 GMT
27
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.2.12..@fluentui/react-input_v9.2.13)
28
+
29
+ ### Patches
30
+
31
+ - Bump @fluentui/react-field to v9.0.0-alpha.16 ([PR #26434](https://github.com/microsoft/fluentui/pull/26434) by beachball)
32
+
7
33
  ## [9.2.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.2.12)
8
34
 
9
- Mon, 16 Jan 2023 08:35:39 GMT
35
+ Mon, 16 Jan 2023 08:39:03 GMT
10
36
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.2.11..@fluentui/react-input_v9.2.12)
11
37
 
12
38
  ### Patches
package/dist/index.d.ts CHANGED
@@ -2,13 +2,11 @@
2
2
 
3
3
  import type { ComponentProps } from '@fluentui/react-utilities';
4
4
  import type { ComponentState } from '@fluentui/react-utilities';
5
- import { FieldControl } from '@fluentui/react-field';
6
- import type { FieldProps } from '@fluentui/react-field';
7
- import { FieldSlots } from '@fluentui/react-field';
5
+ import { DeprecatedFieldProps } from '@fluentui/react-field';
8
6
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
9
7
  import * as React_2 from 'react';
10
8
  import type { Slot } from '@fluentui/react-utilities';
11
- import { SlotClassNames } from '@fluentui/react-utilities';
9
+ import type { SlotClassNames } from '@fluentui/react-utilities';
12
10
 
13
11
  /**
14
12
  * The Input component allows people to enter and edit text.
@@ -17,11 +15,21 @@ export declare const Input: ForwardRefComponent<InputProps>;
17
15
 
18
16
  export declare const inputClassNames: SlotClassNames<InputSlots>;
19
17
 
18
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
20
19
  export declare const InputField_unstable: ForwardRefComponent<InputFieldProps_unstable>;
21
20
 
22
- export declare const inputFieldClassNames: SlotClassNames<FieldSlots<FieldControl>>;
21
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
22
+ export declare const inputFieldClassNames: {
23
+ control: string;
24
+ root: string;
25
+ label: string;
26
+ validationMessage: string;
27
+ validationMessageIcon: string;
28
+ hint: string;
29
+ };
23
30
 
24
- export declare type InputFieldProps_unstable = FieldProps<typeof Input>;
31
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
32
+ export declare type InputFieldProps_unstable = DeprecatedFieldProps<InputProps>;
25
33
 
26
34
  /**
27
35
  * Data passed to the `onChange` callback when a user changes the input's value.
@@ -1,4 +1,5 @@
1
1
  import { getPartitionedNativeProps, resolveShorthand, useControllableState, useEventCallback } from '@fluentui/react-utilities';
2
+ import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';
2
3
  /**
3
4
  * Create the state required to render Input.
4
5
  *
@@ -9,9 +10,11 @@ import { getPartitionedNativeProps, resolveShorthand, useControllableState, useE
9
10
  * @param ref - reference to `<input>` element of Input
10
11
  */
11
12
  export const useInput_unstable = (props, ref) => {
13
+ var _a;
14
+ const overrides = useOverrides();
12
15
  const {
13
16
  size = 'medium',
14
- appearance = 'outline',
17
+ appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
15
18
  onChange
16
19
  } = props;
17
20
  if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,SACEA,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,QACX,2BAA2B;AAGlC;;;;;;;;;AASA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAAgC,KAAgB;EACnG,MAAM;IAAEC,IAAI,GAAG,QAAQ;IAAEC,UAAU,GAAG,SAAS;IAAEC;EAAQ,CAAE,GAAGJ,KAAK;EAEnE,IACEK,O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,IAAG;IAC3C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAACpB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGwB,EAAE,EAAE;MAAElB,KAAK,EAAEmB;IAAQ,CAAE,CAAC;IACnClB,QAAQ,CAACkB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOjB,KAAK;AACd,CAAC","names":["getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useInput_unstable","props","ref","size","appearance","onChange","process","env","NODE_ENV","console","error","value","setValue","state","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","required","defaultProps","type","primary","ev","newValue","target"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInput.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const { size = 'medium', appearance = 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
1
+ {"version":3,"mappings":"AACA,SACEA,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,QACX,2BAA2B;AAElC,SAASC,qBAAqB,IAAIC,YAAY,QAAQ,iCAAiC;AAEvF;;;;;;;;;AASA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAAgC,KAAgB;;EACnG,MAAMC,SAAS,GAAGJ,YAAY,EAAE;EAEhC,MAAM;IAAEK,IAAI,GAAG,QAAQ;IAAEC,UAAU,GAAG,eAAS,CAACC,sBAAsB,mCAAI,SAAS;IAAEC;EAAQ,CAAE,GAAGN,KAAK;EAEvG,IACEO,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,KACpCL,UAAU,KAAK,sBAAsB,IAAIA,UAAU,KAAK,uBAAuB,CAAC,EACjF;IACA;IACAM,OAAO,CAACC,KAAK,CACX,8GAA8G,GAC5G,UAAU,CACb;;EAGH,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGlB,oBAAoB,CAAC;IAC7CmB,KAAK,EAAEd,KAAK,CAACY,KAAK;IAClBG,YAAY,EAAEf,KAAK,CAACgB,YAAY;IAChCC,YAAY,EAAE;GACf,CAAC;EAEF,MAAMC,WAAW,GAAGzB,yBAAyB,CAAC;IAC5CO,KAAK;IACLmB,kBAAkB,EAAE,OAAO;IAC3BC,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc;GAChE,CAAC;EAEF,MAAMN,KAAK,GAAe;IACxBX,IAAI;IACJC,UAAU;IACViB,UAAU,EAAE;MACVC,IAAI,EAAE,MAAM;MACZC,KAAK,EAAE,OAAO;MACdC,aAAa,EAAE,MAAM;MACrBC,YAAY,EAAE;KACf;IACDF,KAAK,EAAE7B,gBAAgB,CAACM,KAAK,CAACuB,KAAK,EAAE;MACnCG,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZC,IAAI,EAAE,MAAM;QACZ3B,GAAG;QACH,GAAGiB,WAAW,CAACW;;KAElB,CAAC;IACFJ,YAAY,EAAE/B,gBAAgB,CAACM,KAAK,CAACyB,YAAY,CAAC;IAClDD,aAAa,EAAE9B,gBAAgB,CAACM,KAAK,CAACwB,aAAa,CAAC;IACpDF,IAAI,EAAE5B,gBAAgB,CAACM,KAAK,CAACsB,IAAI,EAAE;MACjCI,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAET,WAAW,CAACI;KAC3B;GACF;EAEDR,KAAK,CAACS,KAAK,CAACX,KAAK,GAAGA,KAAK;EACzBE,KAAK,CAACS,KAAK,CAACjB,QAAQ,GAAGV,gBAAgB,CAACkC,EAAE,IAAG;IAC3C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAACpB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGwB,EAAE,EAAE;MAAElB,KAAK,EAAEmB;IAAQ,CAAE,CAAC;IACnClB,QAAQ,CAACkB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOjB,KAAK;AACd,CAAC","names":["getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","overrides","size","appearance","inputDefaultAppearance","onChange","process","env","NODE_ENV","console","error","value","setValue","state","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","required","defaultProps","type","primary","ev","newValue","target"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInput.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const overrides = useOverrides();\n\n const { size = 'medium', appearance = overrides.inputDefaultAppearance ?? 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
@@ -1,14 +1,8 @@
1
- import * as React from 'react';
2
- import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '@fluentui/react-field';
3
- import { Input } from '../../Input';
4
- export const inputFieldClassNames = /*#__PURE__*/getFieldClassNames('InputField');
5
- export const InputField = /*#__PURE__*/React.forwardRef((props, ref) => {
6
- const state = useField_unstable(props, ref, {
7
- component: Input,
8
- classNames: inputFieldClassNames
9
- });
10
- useFieldStyles_unstable(state);
11
- return renderField_unstable(state);
12
- });
13
- InputField.displayName = 'InputField';
1
+ /* eslint-disable deprecation/deprecation */
2
+ import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
3
+ import { Input, inputClassNames } from '../../Input';
4
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
5
+ export const inputFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(inputClassNames.root);
6
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
7
+ export const InputField = /*#__PURE__*/makeDeprecatedField(Input);
14
8
  //# sourceMappingURL=InputField.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,uBAAuB;AAE9B,SAASC,KAAK,QAAQ,aAAa;AAInC,OAAO,MAAMC,oBAAoB,gBAAGL,kBAAkB,CAAC,YAAY,CAAC;AAEpE,OAAO,MAAMM,UAAU,gBAAyCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGP,iBAAiB,CAACK,KAAK,EAAEC,GAAG,EAAE;IAAEE,SAAS,EAAEP,KAAK;IAAEQ,UAAU,EAAEP;EAAoB,CAAE,CAAC;EACnGH,uBAAuB,CAACQ,KAAK,CAAC;EAC9B,OAAOT,oBAAoB,CAACS,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFJ,UAAU,CAACO,WAAW,GAAG,YAAY","names":["React","getFieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","Input","inputFieldClassNames","InputField","forwardRef","props","ref","state","component","classNames","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/InputField/InputField.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input } from '../../Input';\n\nexport type InputFieldProps = FieldProps<typeof Input>;\n\nexport const inputFieldClassNames = getFieldClassNames('InputField');\n\nexport const InputField: ForwardRefComponent<InputFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Input, classNames: inputFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nInputField.displayName = 'InputField';\n"]}
1
+ {"version":3,"mappings":"AAAA;AACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ,uBAAuB;AAE/G,SAASC,KAAK,EAAEC,eAAe,QAAoB,aAAa;AAIhE;AACA,OAAO,MAAMC,oBAAoB,gBAAGJ,4BAA4B,CAACG,eAAe,CAACE,IAAI,CAAC;AACtF;AACA,OAAO,MAAMC,UAAU,gBAAyCL,mBAAmB,CAACC,KAAK,CAAC","names":["getDeprecatedFieldClassNames","makeDeprecatedField","Input","inputClassNames","inputFieldClassNames","root","InputField"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/InputField/InputField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input, inputClassNames, InputProps } from '../../Input';\n\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport type InputFieldProps = DeprecatedFieldProps<InputProps>;\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const inputFieldClassNames = getDeprecatedFieldClassNames(inputClassNames.root);\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const InputField: ForwardRefComponent<InputFieldProps> = makeDeprecatedField(Input);\n"]}
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';
2
+ // eslint-disable-next-line deprecation/deprecation
2
3
  export { InputField as InputField_unstable, inputFieldClassNames } from './InputField';
3
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-input/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGnH,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-input/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGnH,mDAAmD;AACnD,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
@@ -1,4 +1,4 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
1
+ define(["require", "exports", "tslib", "@fluentui/react-utilities", "@fluentui/react-shared-contexts"], function (require, exports, tslib_1, react_utilities_1, react_shared_contexts_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.useInput_unstable = void 0;
@@ -12,18 +12,20 @@ define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (r
12
12
  * @param ref - reference to `<input>` element of Input
13
13
  */
14
14
  var useInput_unstable = function (props, ref) {
15
- var _a = props.size, size = _a === void 0 ? 'medium' : _a, _b = props.appearance, appearance = _b === void 0 ? 'outline' : _b, onChange = props.onChange;
15
+ var _a;
16
+ var overrides = react_shared_contexts_1.useOverrides_unstable();
17
+ var _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.appearance, appearance = _c === void 0 ? (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline' : _c, onChange = props.onChange;
16
18
  if (process.env.NODE_ENV !== 'production' &&
17
19
  (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
18
20
  // eslint-disable-next-line no-console
19
21
  console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" +
20
22
  ' future.');
21
23
  }
22
- var _c = react_utilities_1.useControllableState({
24
+ var _d = react_utilities_1.useControllableState({
23
25
  state: props.value,
24
26
  defaultState: props.defaultValue,
25
27
  initialState: '',
26
- }), value = _c[0], setValue = _c[1];
28
+ }), value = _d[0], setValue = _d[1];
27
29
  var nativeProps = react_utilities_1.getPartitionedNativeProps({
28
30
  props: props,
29
31
  primarySlotTagName: 'input',
@@ -1 +1 @@
1
- {"version":3,"file":"useInput.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/Input/useInput.ts"],"names":[],"mappings":";;;;IASA;;;;;;;;OAQG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAAgC;QAC3E,IAAA,KAAsD,KAAK,KAA5C,EAAf,IAAI,mBAAG,QAAQ,KAAA,EAAE,KAAqC,KAAK,WAApB,EAAtB,UAAU,mBAAG,SAAS,KAAA,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAEpE,IACE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;YACrC,CAAC,UAAU,KAAK,sBAAsB,IAAI,UAAU,KAAK,uBAAuB,CAAC,EACjF;YACA,sCAAsC;YACtC,OAAO,CAAC,KAAK,CACX,8GAA8G;gBAC5G,UAAU,CACb,CAAC;SACH;QAEK,IAAA,KAAoB,sCAAoB,CAAC;YAC7C,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,YAAY,EAAE,EAAE;SACjB,CAAC,EAJK,KAAK,QAAA,EAAE,QAAQ,QAIpB,CAAC;QAEH,IAAM,WAAW,GAAG,2CAAyB,CAAC;YAC5C,KAAK,OAAA;YACL,kBAAkB,EAAE,OAAO;YAC3B,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,CAAC;SACjE,CAAC,CAAC;QAEH,IAAM,KAAK,GAAe;YACxB,IAAI,MAAA;YACJ,UAAU,YAAA;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,OAAO;gBACd,aAAa,EAAE,MAAM;gBACrB,YAAY,EAAE,MAAM;aACrB;YACD,KAAK,EAAE,kCAAgB,CAAC,KAAK,CAAC,KAAK,EAAE;gBACnC,QAAQ,EAAE,IAAI;gBACd,YAAY,qBACV,IAAI,EAAE,MAAM,EACZ,GAAG,KAAA,IACA,WAAW,CAAC,OAAO,CACvB;aACF,CAAC;YACF,YAAY,EAAE,kCAAgB,CAAC,KAAK,CAAC,YAAY,CAAC;YAClD,aAAa,EAAE,kCAAgB,CAAC,KAAK,CAAC,aAAa,CAAC;YACpD,IAAI,EAAE,kCAAgB,CAAC,KAAK,CAAC,IAAI,EAAE;gBACjC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,WAAW,CAAC,IAAI;aAC/B,CAAC;SACH,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,kCAAgB,CAAC,UAAA,EAAE;YACxC,IAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;YACjC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA3DW,QAAA,iBAAiB,qBA2D5B","sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const { size = 'medium', appearance = 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useInput.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/Input/useInput.ts"],"names":[],"mappings":";;;;IAUA;;;;;;;;OAQG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAAgC;;QACnF,IAAM,SAAS,GAAG,6CAAY,EAAE,CAAC;QAEzB,IAAA,KAA0F,KAAK,KAAhF,EAAf,IAAI,mBAAG,QAAQ,KAAA,EAAE,KAAyE,KAAK,WAApB,EAA1D,UAAU,mBAAG,MAAA,SAAS,CAAC,sBAAsB,mCAAI,SAAS,KAAA,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAExG,IACE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;YACrC,CAAC,UAAU,KAAK,sBAAsB,IAAI,UAAU,KAAK,uBAAuB,CAAC,EACjF;YACA,sCAAsC;YACtC,OAAO,CAAC,KAAK,CACX,8GAA8G;gBAC5G,UAAU,CACb,CAAC;SACH;QAEK,IAAA,KAAoB,sCAAoB,CAAC;YAC7C,KAAK,EAAE,KAAK,CAAC,KAAK;Y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QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA7DW,QAAA,iBAAiB,qBA6D5B","sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const overrides = useOverrides();\n\n const { size = 'medium', appearance = overrides.inputDefaultAppearance ?? 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
@@ -1,13 +1,10 @@
1
- define(["require", "exports", "react", "@fluentui/react-field", "../../Input"], function (require, exports, React, react_field_1, Input_1) {
1
+ define(["require", "exports", "@fluentui/react-field", "../../Input"], function (require, exports, react_field_1, Input_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.InputField = exports.inputFieldClassNames = void 0;
5
- exports.inputFieldClassNames = react_field_1.getFieldClassNames('InputField');
6
- exports.InputField = React.forwardRef(function (props, ref) {
7
- var state = react_field_1.useField_unstable(props, ref, { component: Input_1.Input, classNames: exports.inputFieldClassNames });
8
- react_field_1.useFieldStyles_unstable(state);
9
- return react_field_1.renderField_unstable(state);
10
- });
11
- exports.InputField.displayName = 'InputField';
5
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
6
+ exports.inputFieldClassNames = react_field_1.getDeprecatedFieldClassNames(Input_1.inputClassNames.root);
7
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
8
+ exports.InputField = react_field_1.makeDeprecatedField(Input_1.Input);
12
9
  });
13
10
  //# sourceMappingURL=InputField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/InputField/InputField.tsx"],"names":[],"mappings":";;;;IAaa,QAAA,oBAAoB,GAAG,gCAAkB,CAAC,YAAY,CAAC,CAAC;IAExD,QAAA,UAAU,GAAyC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC1F,IAAM,KAAK,GAAG,+BAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,aAAK,EAAE,UAAU,EAAE,4BAAoB,EAAE,CAAC,CAAC;QACpG,qCAAuB,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input } from '../../Input';\n\nexport type InputFieldProps = FieldProps<typeof Input>;\n\nexport const inputFieldClassNames = getFieldClassNames('InputField');\n\nexport const InputField: ForwardRefComponent<InputFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Input, classNames: inputFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nInputField.displayName = 'InputField';\n"]}
1
+ {"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/InputField/InputField.tsx"],"names":[],"mappings":";;;;IAOA,mEAAmE;IACtD,QAAA,oBAAoB,GAAG,0CAA4B,CAAC,uBAAe,CAAC,IAAI,CAAC,CAAC;IACvF,mEAAmE;IACtD,QAAA,UAAU,GAAyC,iCAAmB,CAAC,aAAK,CAAC,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input, inputClassNames, InputProps } from '../../Input';\n\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport type InputFieldProps = DeprecatedFieldProps<InputProps>;\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const inputFieldClassNames = getDeprecatedFieldClassNames(inputClassNames.root);\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const InputField: ForwardRefComponent<InputFieldProps> = makeDeprecatedField(Input);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-input/src/index.ts"],"names":[],"mappings":";;;;IAAS,8FAAA,KAAK,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,6GAAA,oBAAoB,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAAE,0GAAA,iBAAiB,OAAA;IAGxF,iHAAA,UAAU,OAAuB;IAAE,kHAAA,oBAAoB,OAAA","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-input/src/index.ts"],"names":[],"mappings":";;;;IAAS,8FAAA,KAAK,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,6GAAA,oBAAoB,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAAE,0GAAA,iBAAiB,OAAA;IAIxF,iHAAA,UAAU,OAAuB;IAAE,kHAAA,oBAAoB,OAAA","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useInput_unstable = void 0;
7
7
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
8
9
  /**
9
10
  * Create the state required to render Input.
10
11
  *
@@ -15,9 +16,11 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
16
  * @param ref - reference to `<input>` element of Input
16
17
  */
17
18
  const useInput_unstable = (props, ref) => {
19
+ var _a;
20
+ const overrides = react_shared_contexts_1.useOverrides_unstable();
18
21
  const {
19
22
  size = 'medium',
20
- appearance = 'outline',
23
+ appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
21
24
  onChange
22
25
  } = props;
23
26
  if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAQA;;;;;;;;;AASO,MAAMA,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAAgC,KAAgB;EACnG,MAAM;IAAEC,IAAI,GAAG,QAAQ;IAAEC,UAAU,GAAG,SAAS;IAAEC;EAAQ,CAAE,GAAGJ,KAAK;EAEnE,IACEK,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,KACpCJ,UAAU,KAAK,sBAAsB,IAAIA,UAAU,KAAK,uBAAuB,CAAC,EACjF;IACA;IACAK,OAAO,CAACC,KAAK,CACX,8GAA8G,GAC5G,UAAU,CACb;;EAGH,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,sCAAoB,CAAC;IAC7CC,KAAK,EAAEb,KAAK,CAACU,KAAK;IAClBI,YAAY,EAAEd,KAAK,CAACe,YAAY;IAChCC,YAAY,EAAE;GACf,CAAC;EAEF,MAAMC,WAAW,GAAGL,2CAAyB,CAAC;IAC5CZ,KAAK;IACLkB,kBAAkB,EAAE,OAAO;IAC3BC,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc;GAChE,CAAC;EAEF,MAAMN,KAAK,GAAe;IACxBX,IAAI;IACJC,UAAU;IACViB,UAAU,EAAE;MACVC,IAAI,EAAE,MAAM;MACZC,KAAK,EAAE,OAAO;MACdC,aAAa,EAAE,MAAM;MACrBC,YAAY,EAAE;KACf;IACDF,KAAK,EAAEV,kCAAgB,CAACZ,KAAK,CAACsB,KAAK,EAAE;MACnCG,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZC,IAAI,EAAE,MAAM;QACZ1B,GAAG;QACH,GAAGgB,WAAW,CAACW;;KAElB,CAAC;IACFJ,YAAY,EAAEZ,kCAAgB,CAACZ,KAAK,CAACwB,YAAY,CAAC;IAClDD,aAAa,EAAEX,kCAAgB,CAACZ,KAAK,CAACuB,aAAa,CAAC;IACpDF,IAAI,EAAET,kCAAgB,CAACZ,KAAK,CAACqB,IAAI,EAAE;MACjCI,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAET,WAAW,CAACI;KAC3B;GACF;EAEDR,KAAK,CAACS,KAAK,CAACZ,KAAK,GAAGA,KAAK;EACzBG,KAAK,CAACS,KAAK,CAAClB,QAAQ,GAAGQ,kCAAgB,CAACiB,EAAE,IAAG;IAC3C,MAAMC,QAAQ,GAAGD,EAAE,CAACE,MAAM,CAACrB,KAAK;IAChCN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGyB,EAAE,EAAE;MAAEnB,KAAK,EAAEoB;IAAQ,CAAE,CAAC;IACnCnB,QAAQ,CAACmB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOjB,KAAK;AACd,CAAC;AA3DYmB,yBAAiB","names":["useInput_unstable","props","ref","size","appearance","onChange","process","env","NODE_ENV","console","error","value","setValue","react_utilities_1","state","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","required","defaultProps","type","primary","ev","newValue","target","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInput.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const { size = 'medium', appearance = 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
1
+ {"version":3,"mappings":";;;;;;AACA;AAOA;AAEA;;;;;;;;;AASO,MAAMA,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAAgC,KAAgB;;EACnG,MAAMC,SAAS,GAAGC,6CAAY,EAAE;EAEhC,MAAM;IAAEC,IAAI,GAAG,QAAQ;IAAEC,UAAU,GAAG,eAAS,CAACC,sBAAsB,mCAAI,SAAS;IAAEC;EAAQ,CAAE,GAAGP,KAAK;EAEvG,IACEQ,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,KACpCL,UAAU,KAAK,sBAAsB,IAAIA,UAAU,KAAK,uBAAuB,CAAC,EACjF;IACA;IACAM,OAAO,CAACC,KAAK,CACX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KAAK,EAAEoB;IAAQ,CAAE,CAAC;IACnCnB,QAAQ,CAACmB,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOjB,KAAK;AACd,CAAC;AA7DYmB,yBAAiB","names":["useInput_unstable","props","ref","overrides","react_shared_contexts_1","size","appearance","inputDefaultAppearance","onChange","process","env","NODE_ENV","console","error","value","setValue","react_utilities_1","state","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","required","defaultProps","type","primary","ev","newValue","target","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInput.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const overrides = useOverrides();\n\n const { size = 'medium', appearance = overrides.inputDefaultAppearance ?? 'outline', onChange } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"]}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.InputField = exports.inputFieldClassNames = void 0;
7
- const React = /*#__PURE__*/require("react");
7
+ /* eslint-disable deprecation/deprecation */
8
8
  const react_field_1 = /*#__PURE__*/require("@fluentui/react-field");
9
9
  const Input_1 = /*#__PURE__*/require("../../Input");
10
- exports.inputFieldClassNames = /*#__PURE__*/react_field_1.getFieldClassNames('InputField');
11
- exports.InputField = /*#__PURE__*/React.forwardRef((props, ref) => {
12
- const state = react_field_1.useField_unstable(props, ref, {
13
- component: Input_1.Input,
14
- classNames: exports.inputFieldClassNames
15
- });
16
- react_field_1.useFieldStyles_unstable(state);
17
- return react_field_1.renderField_unstable(state);
18
- });
19
- exports.InputField.displayName = 'InputField';
10
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
11
+ exports.inputFieldClassNames = /*#__PURE__*/react_field_1.getDeprecatedFieldClassNames(Input_1.inputClassNames.root);
12
+ /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
13
+ exports.InputField = /*#__PURE__*/react_field_1.makeDeprecatedField(Input_1.Input);
20
14
  //# sourceMappingURL=InputField.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AAOA;AAIaA,4BAAoB,gBAAGC,gCAAkB,CAAC,YAAY,CAAC;AAEvDD,kBAAU,gBAAyCE,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGL,+BAAiB,CAACG,KAAK,EAAEC,GAAG,EAAE;IAAEE,SAAS,EAAEC,aAAK;IAAEC,UAAU,EAAET;EAAoB,CAAE,CAAC;EACnGC,qCAAuB,CAACK,KAAK,CAAC;EAC9B,OAAOL,kCAAoB,CAACK,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFN,kBAAU,CAACU,WAAW,GAAG,YAAY","names":["exports","react_field_1","React","forwardRef","props","ref","state","component","Input_1","classNames","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/InputField/InputField.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input } from '../../Input';\n\nexport type InputFieldProps = FieldProps<typeof Input>;\n\nexport const inputFieldClassNames = getFieldClassNames('InputField');\n\nexport const InputField: ForwardRefComponent<InputFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Input, classNames: inputFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nInputField.displayName = 'InputField';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AAIA;AACaA,4BAAoB,gBAAGC,0CAA4B,CAACC,uBAAe,CAACC,IAAI,CAAC;AACtF;AACaH,kBAAU,gBAAyCC,iCAAmB,CAACC,aAAK,CAAC","names":["exports","react_field_1","Input_1","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/InputField/InputField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input, inputClassNames, InputProps } from '../../Input';\n\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport type InputFieldProps = DeprecatedFieldProps<InputProps>;\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const inputFieldClassNames = getDeprecatedFieldClassNames(inputClassNames.root);\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const InputField: ForwardRefComponent<InputFieldProps> = makeDeprecatedField(Input);\n"]}
@@ -35,6 +35,7 @@ Object.defineProperty(exports, "useInput_unstable", {
35
35
  return Input_1.useInput_unstable;
36
36
  }
37
37
  });
38
+ // eslint-disable-next-line deprecation/deprecation
38
39
  var InputField_1 = /*#__PURE__*/require("./InputField");
39
40
  Object.defineProperty(exports, "InputField_unstable", {
40
41
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,sCAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AAGjG;AAASF;EAAAC;EAAAC;IAAA,8BAAU;EAAA;AAAA;AAAyBF;EAAAC;EAAAC;IAAA,wCAAoB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,sCAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AAGjG;AACA;AAASF;EAAAC;EAAAC;IAAA,8BAAU;EAAA;AAAA;AAAyBF;EAAAC;EAAAC;IAAA,wCAAoB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-input",
3
- "version": "9.2.12",
3
+ "version": "9.3.0",
4
4
  "description": "Fluent UI React Input component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,14 +28,15 @@
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
30
  "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
31
- "@fluentui/react-text": "^9.1.13",
31
+ "@fluentui/react-text": "^9.1.14",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-field": "9.0.0-alpha.15",
36
+ "@fluentui/react-field": "9.0.0-alpha.17",
37
+ "@fluentui/react-shared-contexts": "^9.2.0",
37
38
  "@fluentui/react-theme": "^9.1.5",
38
- "@fluentui/react-utilities": "^9.4.0",
39
+ "@fluentui/react-utilities": "^9.5.0",
39
40
  "@griffel/react": "^1.5.2",
40
41
  "tslib": "^2.1.0"
41
42
  },