@fluentui/react-input 9.6.7 → 9.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @fluentui/react-input
2
2
 
3
- This log was last generated on Fri, 11 Jul 2025 15:56:58 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 28 Jul 2025 18:44:12 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.7.1)
8
+
9
+ Mon, 28 Jul 2025 18:44:12 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.7.0..@fluentui/react-input_v9.7.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-field to v9.4.1 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.1.3 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.23.0 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
17
+
18
+ ## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.7.0)
19
+
20
+ Thu, 17 Jul 2025 13:49:40 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.6.7..@fluentui/react-input_v9.7.0)
22
+
23
+ ### Minor changes
24
+
25
+ - feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
26
+ - Bump @fluentui/react-field to v9.4.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
27
+
7
28
  ## [9.6.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.6.7)
8
29
 
9
- Fri, 11 Jul 2025 15:56:58 GMT
30
+ Fri, 11 Jul 2025 15:59:24 GMT
10
31
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.6.6..@fluentui/react-input_v9.6.7)
11
32
 
12
33
  ### Patches
package/lib/Input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Input.ts"],"sourcesContent":["export type { InputOnChangeData, InputProps, InputSlots, InputState } from './components/Input/index';\nexport {\n Input,\n inputClassNames,\n renderInput_unstable,\n useInputStyles_unstable,\n useInput_unstable,\n} from './components/Input/index';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,2BAA2B"}
1
+ {"version":3,"sources":["../src/Input.ts"],"sourcesContent":["export type { InputOnChangeData, InputProps, InputSlots, InputState } from './components/Input/index';\nexport {\n Input,\n inputClassNames,\n renderInput_unstable,\n useInputStyles_unstable,\n useInput_unstable,\n} from './components/Input/index';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"mappings":"AACA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["React","useInput_unstable","renderInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","Input","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IAExBL,4BAA4B,2BAA2BK;IAEvD,OAAOP,qBAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["React","useInput_unstable","renderInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","Input","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IAExBL,4BAA4B,2BAA2BK;IAEvD,OAAOP,qBAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\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?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/Input/Input.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\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?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","renderInput_unstable","useInput_unstable","inputClassNames","useInputStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,KAAK,QAAQ,UAAU;AAEhC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
1
+ {"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","renderInput_unstable","useInput_unstable","inputClassNames","useInputStyles_unstable"],"mappings":"AAAA,SAASA,KAAK,QAAQ,UAAU;AAEhC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputState) => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInput_unstable","state","root","contentBefore","input","contentAfter"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IACxB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;0BAC5C,KAACF,MAAMG,KAAK;YACXH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;;;AAGhD,EAAE"}
1
+ {"version":3,"sources":["../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputState) => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInput_unstable","state","root","contentBefore","input","contentAfter"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IACxB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;0BAC5C,KAACF,MAAMG,KAAK;YACXH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;;;AAGhD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/useInput.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 { 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 props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(props.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(props.contentBefore, { elementType: 'span' }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["React","useFieldControlProps_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","supportsLabelFor","supportsRequired","supportsSize","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","always","defaultProps","type","primary","elementType","optional","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,oBAAoB,CAACC,OAAmBC;IACnDD,QAAQR,8BAA8BQ,OAAO;QAAEE,kBAAkB;QAAMC,kBAAkB;QAAMC,cAAc;IAAK;IAElH,MAAMC,YAAYP;QAEoBO;IAAtC,MAAM,EAAEC,OAAO,QAAQ,EAAEC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OnB;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Input/useInput.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 { 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 props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(props.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(props.contentBefore, { elementType: 'span' }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["React","useFieldControlProps_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","supportsLabelFor","supportsRequired","supportsSize","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","always","defaultProps","type","primary","elementType","optional","ev","newValue","target"],"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,oBAAoB,CAACC,OAAmBC;IACnDD,QAAQR,8BAA8BQ,OAAO;QAAEE,kBAAkB;QAAMC,kBAAkB;QAAMC,cAAc;IAAK;IAElH,MAAMC,YAAYP;QAEoBO;IAAtC,MAAM,EAAEC,OAAO,QAAQ,EAAEC,aAAaF,CAAAA,oCAAAA,UAAUG,sBAAsB,cAAhCH,+CAAAA,oCAAoC,SAAS,EAAEI,QAAQ,EAAE,GAAGT;IAElG,IACEU,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBL,CAAAA,eAAe,0BAA0BA,eAAe,uBAAsB,GAC/E;QACA,sCAAsC;QACtCM,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGtB,qBAAqB;QAC7CuB,OAAOjB,MAAMe,KAAK;QAClBG,cAAclB,MAAMmB,YAAY;QAChCC,cAAc;IAChB;IAEA,MAAMC,cAAc5B,0BAA0B;QAC5CO;QACAsB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAQ;YAAY;YAAS;SAAe;IAClE;IAEA,MAAMN,QAAoB;QACxBX;QACAC;QACAiB,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,eAAe;YACfC,cAAc;QAChB;QACAF,OAAO9B,KAAKiC,MAAM,CAAC7B,MAAM0B,KAAK,EAAE;YAC9BI,cAAc;gBACZC,MAAM;gBACN9B;gBACA,GAAGoB,YAAYW,OAAO;YACxB;YACAC,aAAa;QACf;QACAL,cAAchC,KAAKsC,QAAQ,CAAClC,MAAM4B,YAAY,EAAE;YAAEK,aAAa;QAAO;QACtEN,eAAe/B,KAAKsC,QAAQ,CAAClC,MAAM2B,aAAa,EAAE;YAAEM,aAAa;QAAO;QACxER,MAAM7B,KAAKiC,MAAM,CAAC7B,MAAMyB,IAAI,EAAE;YAC5BK,cAAcT,YAAYI,IAAI;YAC9BQ,aAAa;QACf;IACF;IAEAhB,MAAMS,KAAK,CAACX,KAAK,GAAGA;IACpBE,MAAMS,KAAK,CAACjB,QAAQ,GAAGd,iBAAiBwC,CAAAA;QACtC,MAAMC,WAAWD,GAAGE,MAAM,CAACtB,KAAK;QAChCN,qBAAAA,+BAAAA,SAAW0B,IAAI;YAAEpB,OAAOqB;QAAS;QACjCpB,SAASoB;IACX;IAEA,OAAOnB;AACT,EAAE"}
@@ -0,0 +1,330 @@
1
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
2
+ import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';
3
+ export const inputClassNames = {
4
+ root: 'fui-Input',
5
+ input: 'fui-Input__input',
6
+ contentBefore: 'fui-Input__contentBefore',
7
+ contentAfter: 'fui-Input__contentAfter'
8
+ };
9
+ // TODO(sharing) should these be shared somewhere?
10
+ const fieldHeights = {
11
+ small: '24px',
12
+ medium: '32px',
13
+ large: '40px'
14
+ };
15
+ // With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.
16
+ // If there is contentBefore or contentAfter, then the root and input slots use their individual padding.
17
+ const horizontalPadding = {
18
+ root: {
19
+ small: tokens.spacingHorizontalSNudge,
20
+ medium: tokens.spacingHorizontalMNudge,
21
+ large: tokens.spacingHorizontalM
22
+ },
23
+ input: {
24
+ small: tokens.spacingHorizontalXXS,
25
+ medium: tokens.spacingHorizontalXXS,
26
+ large: tokens.spacingHorizontalSNudge
27
+ },
28
+ combined: {
29
+ small: tokens.spacingHorizontalS,
30
+ medium: tokens.spacingHorizontalM,
31
+ large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`
32
+ }
33
+ };
34
+ const useRootClassName = makeResetStyles({
35
+ display: 'inline-flex',
36
+ alignItems: 'center',
37
+ flexWrap: 'nowrap',
38
+ gap: tokens.spacingHorizontalXXS,
39
+ borderRadius: tokens.borderRadiusMedium,
40
+ position: 'relative',
41
+ boxSizing: 'border-box',
42
+ verticalAlign: 'middle',
43
+ // size: medium (default)
44
+ minHeight: fieldHeights.medium,
45
+ ...typographyStyles.body1,
46
+ // appearance: outline (default)
47
+ backgroundColor: tokens.colorNeutralBackground1,
48
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
49
+ borderBottomColor: tokens.colorNeutralStrokeAccessible,
50
+ // This is all for the bottom focus border.
51
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
52
+ '::after': {
53
+ boxSizing: 'border-box',
54
+ content: '""',
55
+ position: 'absolute',
56
+ left: '-1px',
57
+ bottom: '-1px',
58
+ right: '-1px',
59
+ // Maintaining the correct corner radius:
60
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
61
+ // (Otherwise the radius would be automatically reduced to fit available space.)
62
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
63
+ height: `max(2px, ${tokens.borderRadiusMedium})`,
64
+ borderBottomLeftRadius: tokens.borderRadiusMedium,
65
+ borderBottomRightRadius: tokens.borderRadiusMedium,
66
+ // Flat 2px border:
67
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
68
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
69
+ // borderBottom makes it easier for people to override the color if needed.)
70
+ borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,
71
+ clipPath: 'inset(calc(100% - 2px) 0 0 0)',
72
+ // Animation for focus OUT
73
+ transform: 'scaleX(0)',
74
+ transitionProperty: 'transform',
75
+ transitionDuration: tokens.durationUltraFast,
76
+ transitionDelay: tokens.curveAccelerateMid,
77
+ '@media screen and (prefers-reduced-motion: reduce)': {
78
+ transitionDuration: '0.01ms',
79
+ transitionDelay: '0.01ms'
80
+ }
81
+ },
82
+ ':focus-within::after': {
83
+ // Animation for focus IN
84
+ transform: 'scaleX(1)',
85
+ transitionProperty: 'transform',
86
+ transitionDuration: tokens.durationNormal,
87
+ transitionDelay: tokens.curveDecelerateMid,
88
+ '@media screen and (prefers-reduced-motion: reduce)': {
89
+ transitionDuration: '0.01ms',
90
+ transitionDelay: '0.01ms'
91
+ }
92
+ },
93
+ ':focus-within:active::after': {
94
+ // This is if the user clicks the field again while it's already focused
95
+ borderBottomColor: tokens.colorCompoundBrandStrokePressed
96
+ },
97
+ ':focus-within': {
98
+ outline: '2px solid transparent'
99
+ }
100
+ });
101
+ const useRootStyles = makeStyles({
102
+ small: {
103
+ minHeight: fieldHeights.small,
104
+ ...typographyStyles.caption1
105
+ },
106
+ medium: {
107
+ },
108
+ large: {
109
+ minHeight: fieldHeights.large,
110
+ ...typographyStyles.body2,
111
+ gap: tokens.spacingHorizontalSNudge
112
+ },
113
+ outline: {
114
+ },
115
+ outlineInteractive: {
116
+ ':hover': {
117
+ ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),
118
+ borderBottomColor: tokens.colorNeutralStrokeAccessibleHover
119
+ },
120
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
121
+ ':active,:focus-within': {
122
+ ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),
123
+ borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed
124
+ }
125
+ },
126
+ underline: {
127
+ backgroundColor: tokens.colorTransparentBackground,
128
+ borderRadius: '0',
129
+ // border is specified in rootBaseStyles, but we only want a bottom border here
130
+ borderTopStyle: 'none',
131
+ borderRightStyle: 'none',
132
+ borderLeftStyle: 'none',
133
+ // Make the focus underline (::after) match the width of the bottom border
134
+ '::after': {
135
+ left: 0,
136
+ right: 0
137
+ }
138
+ },
139
+ underlineInteractive: {
140
+ ':hover': {
141
+ borderBottomColor: tokens.colorNeutralStrokeAccessibleHover
142
+ },
143
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
144
+ ':active,:focus-within': {
145
+ borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed
146
+ },
147
+ '::after': {
148
+ // remove rounded corners from focus underline
149
+ borderRadius: '0'
150
+ }
151
+ },
152
+ filled: {
153
+ ...shorthands.borderColor(tokens.colorTransparentStroke)
154
+ },
155
+ filledInteractive: {
156
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
157
+ ':hover,:focus-within': {
158
+ // also handles pressed border color (:active)
159
+ ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)
160
+ }
161
+ },
162
+ invalid: {
163
+ ':not(:focus-within),:hover:not(:focus-within)': {
164
+ ...shorthands.borderColor(tokens.colorPaletteRedBorder2)
165
+ }
166
+ },
167
+ 'filled-darker': {
168
+ backgroundColor: tokens.colorNeutralBackground3
169
+ },
170
+ 'filled-lighter': {
171
+ backgroundColor: tokens.colorNeutralBackground1
172
+ },
173
+ // This shadow appearance is deprecated and will be removed in a future release.
174
+ 'filled-darker-shadow': {
175
+ backgroundColor: tokens.colorNeutralBackground3,
176
+ boxShadow: tokens.shadow2
177
+ },
178
+ // This shadow appearance is deprecated and will be removed in a future release.
179
+ 'filled-lighter-shadow': {
180
+ backgroundColor: tokens.colorNeutralBackground1,
181
+ boxShadow: tokens.shadow2
182
+ },
183
+ disabled: {
184
+ cursor: 'not-allowed',
185
+ backgroundColor: tokens.colorTransparentBackground,
186
+ ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),
187
+ '@media (forced-colors: active)': {
188
+ ...shorthands.borderColor('GrayText')
189
+ },
190
+ // remove the focus border
191
+ '::after': {
192
+ content: 'unset'
193
+ },
194
+ // remove the focus outline
195
+ ':focus-within': {
196
+ outlineStyle: 'none'
197
+ }
198
+ },
199
+ smallWithContentBefore: {
200
+ paddingLeft: horizontalPadding.root.small
201
+ },
202
+ smallWithContentAfter: {
203
+ paddingRight: horizontalPadding.root.small
204
+ },
205
+ mediumWithContentBefore: {
206
+ paddingLeft: horizontalPadding.root.medium
207
+ },
208
+ mediumWithContentAfter: {
209
+ paddingRight: horizontalPadding.root.medium
210
+ },
211
+ largeWithContentBefore: {
212
+ paddingLeft: horizontalPadding.root.large
213
+ },
214
+ largeWithContentAfter: {
215
+ paddingRight: horizontalPadding.root.large
216
+ }
217
+ });
218
+ const useInputClassName = makeResetStyles({
219
+ alignSelf: 'stretch',
220
+ boxSizing: 'border-box',
221
+ flexGrow: 1,
222
+ minWidth: 0,
223
+ borderStyle: 'none',
224
+ padding: `0 ${horizontalPadding.combined.medium}`,
225
+ color: tokens.colorNeutralForeground1,
226
+ // Use literal "transparent" (not from the theme) to always let the color from the root show through
227
+ backgroundColor: 'transparent',
228
+ '::placeholder': {
229
+ color: tokens.colorNeutralForeground4,
230
+ opacity: 1
231
+ },
232
+ outlineStyle: 'none',
233
+ // Inherit typography styles from root
234
+ fontFamily: 'inherit',
235
+ fontSize: 'inherit',
236
+ fontWeight: 'inherit',
237
+ lineHeight: 'inherit'
238
+ });
239
+ const useInputElementStyles = makeStyles({
240
+ small: {
241
+ paddingLeft: horizontalPadding.combined.small,
242
+ paddingRight: horizontalPadding.combined.small
243
+ },
244
+ medium: {
245
+ },
246
+ large: {
247
+ paddingLeft: horizontalPadding.combined.large,
248
+ paddingRight: horizontalPadding.combined.large
249
+ },
250
+ smallWithContentBefore: {
251
+ paddingLeft: horizontalPadding.input.small
252
+ },
253
+ smallWithContentAfter: {
254
+ paddingRight: horizontalPadding.input.small
255
+ },
256
+ mediumWithContentBefore: {
257
+ paddingLeft: horizontalPadding.input.medium
258
+ },
259
+ mediumWithContentAfter: {
260
+ paddingRight: horizontalPadding.input.medium
261
+ },
262
+ largeWithContentBefore: {
263
+ paddingLeft: horizontalPadding.input.large
264
+ },
265
+ largeWithContentAfter: {
266
+ paddingRight: horizontalPadding.input.large
267
+ },
268
+ disabled: {
269
+ color: tokens.colorNeutralForegroundDisabled,
270
+ backgroundColor: tokens.colorTransparentBackground,
271
+ cursor: 'not-allowed',
272
+ '::placeholder': {
273
+ color: tokens.colorNeutralForegroundDisabled
274
+ }
275
+ }
276
+ });
277
+ const useContentClassName = makeResetStyles({
278
+ boxSizing: 'border-box',
279
+ color: tokens.colorNeutralForeground3,
280
+ display: 'flex',
281
+ // special case styling for icons (most common case) to ensure they're centered vertically
282
+ // size: medium (default)
283
+ '> svg': {
284
+ fontSize: '20px'
285
+ }
286
+ });
287
+ const useContentStyles = makeStyles({
288
+ disabled: {
289
+ color: tokens.colorNeutralForegroundDisabled
290
+ },
291
+ // Ensure resizable icons show up with the proper font size
292
+ small: {
293
+ '> svg': {
294
+ fontSize: '16px'
295
+ }
296
+ },
297
+ medium: {
298
+ },
299
+ large: {
300
+ '> svg': {
301
+ fontSize: '24px'
302
+ }
303
+ }
304
+ });
305
+ /**
306
+ * Apply styling to the Input slots based on the state
307
+ */ export const useInputStyles_unstable = (state)=>{
308
+ 'use no memo';
309
+ const { size, appearance } = state;
310
+ const disabled = state.input.disabled;
311
+ const invalid = `${state.input['aria-invalid']}` === 'true';
312
+ const filled = appearance.startsWith('filled');
313
+ const rootStyles = useRootStyles();
314
+ const inputStyles = useInputElementStyles();
315
+ const contentStyles = useContentStyles();
316
+ state.root.className = mergeClasses(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);
317
+ state.input.className = mergeClasses(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);
318
+ const contentClasses = [
319
+ useContentClassName(),
320
+ disabled && contentStyles.disabled,
321
+ contentStyles[size]
322
+ ];
323
+ if (state.contentBefore) {
324
+ state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
325
+ }
326
+ if (state.contentAfter) {
327
+ state.contentAfter.className = mergeClasses(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);
328
+ }
329
+ return state;
330
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Input/useInputStyles.styles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM,\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge,\n },\n combined: {\n small: tokens.spacingHorizontalS, // SNudge + XXS\n medium: tokens.spacingHorizontalM, // MNudge + XXS\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n },\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge,\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0', // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0',\n },\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large,\n },\n});\n\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small,\n },\n medium: {\n // Included in useInputClassName\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large,\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n 'use no memo';\n\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n state.contentBefore && rootStyles[`${size}WithContentBefore`],\n state.contentAfter && rootStyles[`${size}WithContentAfter`],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n inputStyles[size],\n state.contentBefore && inputStyles[`${size}WithContentBefore`],\n state.contentAfter && inputStyles[`${size}WithContentAfter`],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","shorthands","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","display","alignItems","flexWrap","gap","borderRadius","borderRadiusMedium","position","boxSizing","verticalAlign","minHeight","body1","backgroundColor","colorNeutralBackground1","border","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","colorCompoundBrandStrokePressed","outline","useRootStyles","caption1","body2","outlineInteractive","borderColor","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","underline","colorTransparentBackground","borderTopStyle","borderRightStyle","borderLeftStyle","underlineInteractive","filled","colorTransparentStroke","filledInteractive","colorTransparentStrokeInteractive","invalid","colorPaletteRedBorder2","colorNeutralBackground3","boxShadow","shadow2","disabled","cursor","colorNeutralStrokeDisabled","outlineStyle","smallWithContentBefore","paddingLeft","smallWithContentAfter","paddingRight","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","useInputClassName","alignSelf","flexGrow","minWidth","borderStyle","padding","color","colorNeutralForeground1","colorNeutralForeground4","opacity","fontFamily","fontSize","fontWeight","lineHeight","useInputElementStyles","colorNeutralForegroundDisabled","useContentClassName","colorNeutralForeground3","useContentStyles","useInputStyles_unstable","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","contentClasses"],"mappings":"AAAA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAGvF,OAAO,MAAMC,kBAA8C;IACzDC,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEF,kDAAkD;AAClD,MAAMC,eAAe;IACnBC,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT;AAEA,0GAA0G;AAC1G,yGAAyG;AACzG,MAAMC,oBAAoB;IACxBR,MAAM;QACJK,OAAOZ,OAAOgB,uBAAuB;QACrCH,QAAQb,OAAOiB,uBAAuB;QACtCH,OAAOd,OAAOkB,kBAAkB;IAClC;IACAV,OAAO;QACLI,OAAOZ,OAAOmB,oBAAoB;QAClCN,QAAQb,OAAOmB,oBAAoB;QACnCL,OAAOd,OAAOgB,uBAAuB;IACvC;IACAI,UAAU;QACRR,OAAOZ,OAAOqB,kBAAkB;QAChCR,QAAQb,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,KAAK,CAACmH,SAAS,GAAGvH,aACtBE,gBAAgBE,KAAK,EACrBwF,qBACAyB,WAAW,CAACJ,KAAK,EACjBD,MAAM3G,aAAa,IAAIgH,WAAW,CAAC,GAAGJ,KAAK,iBAAiB,CAAC,CAAC,EAC9DD,MAAM1G,YAAY,IAAI+G,WAAW,CAAC,GAAGJ,KAAK,gBAAgB,CAAC,CAAC,EAC5DjC,YAAYqC,YAAYrC,QAAQ,EAChCgC,MAAM5G,KAAK,CAACmH,SAAS;IAGvB,MAAMC,iBAAiB;QAACZ;QAAuB5B,YAAYsC,cAActC,QAAQ;QAAEsC,aAAa,CAACL,KAAK;KAAC;IACvG,IAAID,MAAM3G,aAAa,EAAE;QACvB2G,MAAM3G,aAAa,CAACkH,SAAS,GAAGvH,aAC9BE,gBAAgBG,aAAa,KAC1BmH,gBACHR,MAAM3G,aAAa,CAACkH,SAAS;IAEjC;IACA,IAAIP,MAAM1G,YAAY,EAAE;QACtB0G,MAAM1G,YAAY,CAACiH,SAAS,GAAGvH,aAC7BE,gBAAgBI,YAAY,KACzBkH,gBACHR,MAAM1G,YAAY,CAACiH,SAAS;IAEhC;IAEA,OAAOP;AACT,EAAE"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"rangeMappings":"","mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Input.ts"],"sourcesContent":["export type { InputOnChangeData, InputProps, InputSlots, InputState } from './components/Input/index';\nexport {\n Input,\n inputClassNames,\n renderInput_unstable,\n useInputStyles_unstable,\n useInput_unstable,\n} from './components/Input/index';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,KAAK;eAALA,YAAK;;IACLC,eAAe;eAAfA,sBAAe;;IACfC,oBAAoB;eAApBA,2BAAoB;;IACpBC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,iBAAiB;eAAjBA,wBAAiB;;;uBACZ"}
1
+ {"version":3,"sources":["../src/Input.ts"],"sourcesContent":["export type { InputOnChangeData, InputProps, InputSlots, InputState } from './components/Input/index';\nexport {\n Input,\n inputClassNames,\n renderInput_unstable,\n useInputStyles_unstable,\n useInput_unstable,\n} from './components/Input/index';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"mappings":";;;;;;;;;;;;eAEEA,YAAK;;;eACLC,sBAAe;;;eACfC,2BAAoB;;;eACpBC,8BAAuB;;;eACvBC,wBAAiB;;;uBACZ,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["Input","React","forwardRef","props","ref","state","useInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","renderInput_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;0BACW;6BACG;sCACG;qCAGI;AAKrC,MAAMA,QAAAA,WAAAA,GAAyCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQC,IAAAA,2BAAAA,EAAkBH,OAAOC;IAEvCG,IAAAA,6CAAAA,EAAwBF;IAExBG,IAAAA,gDAAAA,EAA4B,2BAA2BH;IAEvD,OAAOI,IAAAA,iCAAAA,EAAqBJ;AAC9B;AAEAL,MAAMU,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["React","useInput_unstable","renderInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","Input","forwardRef","props","ref","state","displayName"],"mappings":";;;;+BAWaK;;;;;;;iEAXU,QAAQ;0BACG,aAAa;6BACV,gBAAgB;sCACb,0BAA0B;qCAGtB,kCAAkC;AAKvE,cAAMA,WAAAA,GAAyCL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,+BAAAA,EAAkBM,OAAOC;QAEvCL,6CAAAA,EAAwBM;QAExBL,gDAAAA,EAA4B,2BAA2BK;IAEvD,WAAOP,iCAAAA,EAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\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?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/components/Input/Input.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\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?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAILC,eAAe;eAAfA,qCAAe;;IAFfC,oBAAoB;eAApBA,iCAAoB;;IAEHC,uBAAuB;eAAvBA,6CAAuB;;IADxCC,iBAAiB;eAAjBA,2BAAiB;;;uBAHJ;6BAEe;0BACH;sCACuB"}
1
+ {"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","renderInput_unstable","useInput_unstable","inputClassNames","useInputStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,YAAK;;;eAILG,qCAAe;;;eAFfF,iCAAoB;;;eAEHG,6CAAuB;;;eADxCF,2BAAiB;;;uBAHJ,UAAU;6BAEK,gBAAgB;0BACnB,aAAa;sCACU,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputState) => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["renderInput_unstable","state","assertSlots","_jsxs","root","contentBefore","_jsx","input","contentAfter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,uBAAuB,CAACC;IACnCC,IAAAA,2BAAAA,EAAwBD;IACxB,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,aAAa,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,aAAa,EAAA,CAAA;0BAC5CC,IAAAA,eAAA,EAACL,MAAMM,KAAK,EAAA,CAAA;YACXN,MAAMO,YAAY,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACL,MAAMO,YAAY,EAAA,CAAA;;;AAGhD"}
1
+ {"version":3,"sources":["../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputState) => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInput_unstable","state","root","contentBefore","input","contentAfter"],"mappings":";;;;+BASaC;;;;;;4BARb,iCAAiD;gCAErB,4BAA4B;AAMjD,6BAA6B,CAACC;QACnCF,2BAAAA,EAAwBE;IACxB,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,aAAa,IAAA,WAAA,GAAI,mBAAA,EAACF,MAAME,aAAa,EAAA,CAAA;8BAC5C,eAAA,EAACF,MAAMG,KAAK,EAAA,CAAA;YACXH,MAAMI,YAAY,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,YAAY,EAAA,CAAA;;;AAGhD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/useInput.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 { 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 props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(props.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(props.contentBefore, { elementType: 'span' }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["useInput_unstable","props","ref","useFieldControlProps_unstable","supportsLabelFor","supportsRequired","supportsSize","overrides","useOverrides","size","appearance","inputDefaultAppearance","onChange","process","env","NODE_ENV","console","error","value","setValue","useControllableState","state","defaultState","defaultValue","initialState","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","slot","always","defaultProps","type","primary","elementType","optional","useEventCallback","ev","newValue","target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;4BACuB;gCAC0C;qCAElC;AAW/C,MAAMA,oBAAoB,CAACC,OAAmBC;IACnDD,QAAQE,IAAAA,yCAAAA,EAA8BF,OAAO;QA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,KAAK,GAAGA;IACpBG,MAAMU,KAAK,CAACnB,QAAQ,GAAG6B,IAAAA,gCAAAA,EAAiBC,CAAAA;QACtC,MAAMC,WAAWD,GAAGE,MAAM,CAAC1B,KAAK;QAChCN,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAW8B,IAAI;YAAExB,OAAOyB;QAAS;QACjCxB,SAASwB;IACX;IAEA,OAAOtB;AACT"}
1
+ {"version":3,"sources":["../src/components/Input/useInput.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 { 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 props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true, supportsSize: true });\n\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: slot.always(props.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(props.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(props.contentBefore, { elementType: 'span' }),\n root: slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\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"],"names":["React","useFieldControlProps_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","supportsLabelFor","supportsRequired","supportsSize","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","always","defaultProps","type","primary","elementType","optional","ev","newValue","target"],"mappings":";;;;+BAeaQ;;;;;;;iEAfU,QAAQ;4BACe,wBAAwB;gCACkB,4BAA4B;qCAE9D,kCAAkC;AAWjF,0BAA0B,CAACC,OAAmBC;IACnDD,YAAQR,yCAAAA,EAA8BQ,OAAO;QAAEE,kBAAkB;QAAMC,kBAAkB;QAAMC,cAAc;IAAK;IAElH,MAAMC,YAAYP,8CAAAA;QAEoBO;IAAtC,MAAM,EAAEC,OAAO,QAAQ,EAAEC,aAAaF,CAAAA,oCAAAA,UAAUG,sBAAAA,AAAsB,MAAA,QAAhCH,sCAAAA,KAAAA,IAAAA,oCAAoC,SAAS,EAAEI,QAAQ,EAAE,GAAGT;IAElG,IACEU,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBL,CAAAA,eAAe,0BAA0BA,eAAe,uBAAA,CAAsB,EAC/E;QACA,sCAAsC;QACtCM,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAM,CAACC,OAAOC,SAAS,OAAGtB,oCAAAA,EAAqB;QAC7CuB,OAAOjB,MAAMe,KAAK;QAClBG,cAAclB,MAAMmB,YAAY;QAChCC,cAAc;IAChB;IAEA,MAAMC,kBAAc5B,yCAAAA,EAA0B;QAC5CO;QACAsB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAQ;YAAY;YAAS;SAAe;IAClE;IAEA,MAAMN,QAAoB;QACxBX;QACAC;QACAiB,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,eAAe;YACfC,cAAc;QAChB;QACAF,OAAO9B,oBAAAA,CAAKiC,MAAM,CAAC7B,MAAM0B,KAAK,EAAE;YAC9BI,cAAc;gBACZC,MAAM;gBACN9B;gBACA,GAAGoB,YAAYW,OAAO;YACxB;YACAC,aAAa;QACf;QACAL,cAAchC,oBAAAA,CAAKsC,QAAQ,CAAClC,MAAM4B,YAAY,EAAE;YAAEK,aAAa;QAAO;QACtEN,eAAe/B,oBAAAA,CAAKsC,QAAQ,CAAClC,MAAM2B,aAAa,EAAE;YAAEM,aAAa;QAAO;QACxER,MAAM7B,oBAAAA,CAAKiC,MAAM,CAAC7B,MAAMyB,IAAI,EAAE;YAC5BK,cAAcT,YAAYI,IAAI;YAC9BQ,aAAa;QACf;IACF;IAEAhB,MAAMS,KAAK,CAACX,KAAK,GAAGA;IACpBE,MAAMS,KAAK,CAACjB,QAAQ,OAAGd,gCAAAA,EAAiBwC,CAAAA;QACtC,MAAMC,WAAWD,GAAGE,MAAM,CAACtB,KAAK;QAChCN,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAW0B,IAAI;YAAEpB,OAAOqB;QAAS;QACjCpB,SAASoB;IACX;IAEA,OAAOnB;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useInputStyles.styles.js"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nexport const inputClassNames = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter'\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px'\n};\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge\n },\n combined: {\n small: tokens.spacingHorizontalS,\n medium: tokens.spacingHorizontalM,\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`\n }\n};\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium,\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms'\n }\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms'\n }\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed\n },\n ':focus-within': {\n outline: '2px solid transparent'\n }\n});\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1\n },\n medium: {\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge\n },\n outline: {\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed\n }\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0',\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0\n }\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0'\n }\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke)\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2)\n }\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText')\n },\n // remove the focus border\n '::after': {\n content: 'unset'\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none'\n }\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large\n }\n});\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0,\n borderStyle: 'none',\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1\n },\n outlineStyle: 'none',\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit'\n});\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small\n },\n medium: {\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled\n }\n }\n});\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': {\n fontSize: '20px'\n }\n});\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': {\n fontSize: '16px'\n }\n },\n medium: {\n },\n large: {\n '> svg': {\n fontSize: '24px'\n }\n }\n});\n/**\n * Apply styling to the Input slots based on the state\n */ export const useInputStyles_unstable = (state)=>{\n 'use no memo';\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n state.root.className = mergeClasses(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);\n state.input.className = mergeClasses(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);\n const contentClasses = [\n useContentClassName(),\n disabled && contentStyles.disabled,\n contentStyles[size]\n ];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);\n }\n return state;\n};\n"],"names":["inputClassNames","useInputStyles_unstable","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","tokens","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","__resetStyles","r","s","useRootStyles","__styles","sshi5w","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","i8kkvl","Belr9w4","rmohyg","outline","outlineInteractive","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Drbcw7","udz0bu","Be8ivqh","ofdepl","underline","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","icvyot","vrafjx","wvpqe5","Eqx8gd","B1piin3","underlineInteractive","d9w3h3","B3778ie","B4j8arr","Bl18szs","Blrzh8d","filled","g2u3we","h3c5rm","B9xav0g","zhjwy3","filledInteractive","q7v0qe","kmh5ft","nagaa4","B1yhkcb","invalid","tvckwq","gk2u95","hhx65j","Bxowmz0","E5pizo","disabled","Bceei9c","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Bsft5z2","Bduesf4","smallWithContentBefore","uwmqm3","smallWithContentAfter","z189sj","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","d","p","h","a","m","w","useInputClassName","useInputElementStyles","sj55zd","yvdlaj","useContentClassName","useContentStyles","Duoase","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","mergeClasses","contentClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,eAAe;eAAfA;;IAgTIC,uBAAuB;eAAvBA;;;4BAlTwB;uBAC6B;AAC/D,MAAMD,kBAAkB;IAC3BE,MAAM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MpG,YAAY,EAAE;QACpBoG,MAAMpG,YAAY,CAAC2G,SAAS,GAAGC,IAAAA,mBAAY,EAACjH,gBAAgBK,YAAY,KAAK6G,gBAAgBT,MAAMpG,YAAY,CAAC2G,SAAS;IAC7H;IACA,OAAOP;AACX"}
1
+ {"version":3,"sources":["useInputStyles.styles.js"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nexport const inputClassNames = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter'\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px'\n};\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge\n },\n combined: {\n small: tokens.spacingHorizontalS,\n medium: tokens.spacingHorizontalM,\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`\n }\n};\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium,\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms'\n }\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms'\n }\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed\n },\n ':focus-within': {\n outline: '2px solid transparent'\n }\n});\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1\n },\n medium: {\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge\n },\n outline: {\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed\n }\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0',\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0\n }\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0'\n }\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke)\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)\n }\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2)\n }\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText')\n },\n // remove the focus border\n '::after': {\n content: 'unset'\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none'\n }\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large\n }\n});\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0,\n borderStyle: 'none',\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1\n },\n outlineStyle: 'none',\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit'\n});\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small\n },\n medium: {\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled\n }\n }\n});\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': {\n fontSize: '20px'\n }\n});\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': {\n fontSize: '16px'\n }\n },\n medium: {\n },\n large: {\n '> svg': {\n fontSize: '24px'\n }\n }\n});\n/**\n * Apply styling to the Input slots based on the state\n */ export const useInputStyles_unstable = (state)=>{\n 'use no memo';\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n state.root.className = mergeClasses(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);\n state.input.className = mergeClasses(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);\n const contentClasses = [\n useContentClassName(),\n disabled && contentStyles.disabled,\n contentStyles[size]\n ];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);\n }\n return state;\n};\n"],"names":["tokens","typographyStyles","__resetStyles","__styles","mergeClasses","shorthands","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","r","s","useRootStyles","sshi5w","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","i8kkvl","Belr9w4","rmohyg","outline","outlineInteractive","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Drbcw7","udz0bu","Be8ivqh","ofdepl","underline","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","icvyot","vrafjx","wvpqe5","Eqx8gd","B1piin3","underlineInteractive","d9w3h3","B3778ie","B4j8arr","Bl18szs","Blrzh8d","filled","g2u3we","h3c5rm","B9xav0g","zhjwy3","filledInteractive","q7v0qe","kmh5ft","nagaa4","B1yhkcb","invalid","tvckwq","gk2u95","hhx65j","Bxowmz0","E5pizo","disabled","Bceei9c","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Bsft5z2","Bduesf4","smallWithContentBefore","uwmqm3","smallWithContentAfter","z189sj","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","d","p","h","a","m","w","useInputClassName","useInputElementStyles","sj55zd","yvdlaj","useContentClassName","useContentStyles","Duoase","useInputStyles_unstable","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","contentClasses"],"mappings":";;;;;;;;;;;IAEaM,eAAe;;;IAgTXqG,uBAAuB;;;;4BAlTC,uBAAuB;uBACM,gBAAgB;AAC/E,wBAAwB;IAC3BpG,IAAI,EAAE,WAAW;IACjBC,KAAK,EAAE,kBAAkB;IACzBC,aAAa,EAAE,0BAA0B;IACzCC,YAAY,EAAE;AAClB,CAAC;AACD,kDAAA;AACA,MAAMC,YAAY,GAAG;IACjBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;AACX,CAAC;AACD,0GAAA;AACA,yGAAA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C0G,SAAS,CAAC;IACjI;IACA,IAAIP,KAAK,CAAClG,YAAY,EAAE;QACpBkG,KAAK,CAAClG,YAAY,CAACyG,SAAS,OAAG/G,mBAAY,EAACE,eAAe,CAACI,YAAY,EAAE,GAAG0G,cAAc,EAAER,KAAK,CAAClG,YAAY,CAACyG,SAAS,CAAC;IAC9H;IACA,OAAOP,KAAK;AAChB,CAAC"}
@@ -0,0 +1,342 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ inputClassNames: function() {
13
+ return inputClassNames;
14
+ },
15
+ useInputStyles_unstable: function() {
16
+ return useInputStyles_unstable;
17
+ }
18
+ });
19
+ const _reacttheme = require("@fluentui/react-theme");
20
+ const _react = require("@griffel/react");
21
+ const inputClassNames = {
22
+ root: 'fui-Input',
23
+ input: 'fui-Input__input',
24
+ contentBefore: 'fui-Input__contentBefore',
25
+ contentAfter: 'fui-Input__contentAfter'
26
+ };
27
+ // TODO(sharing) should these be shared somewhere?
28
+ const fieldHeights = {
29
+ small: '24px',
30
+ medium: '32px',
31
+ large: '40px'
32
+ };
33
+ // With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.
34
+ // If there is contentBefore or contentAfter, then the root and input slots use their individual padding.
35
+ const horizontalPadding = {
36
+ root: {
37
+ small: _reacttheme.tokens.spacingHorizontalSNudge,
38
+ medium: _reacttheme.tokens.spacingHorizontalMNudge,
39
+ large: _reacttheme.tokens.spacingHorizontalM
40
+ },
41
+ input: {
42
+ small: _reacttheme.tokens.spacingHorizontalXXS,
43
+ medium: _reacttheme.tokens.spacingHorizontalXXS,
44
+ large: _reacttheme.tokens.spacingHorizontalSNudge
45
+ },
46
+ combined: {
47
+ small: _reacttheme.tokens.spacingHorizontalS,
48
+ medium: _reacttheme.tokens.spacingHorizontalM,
49
+ large: `calc(${_reacttheme.tokens.spacingHorizontalM} + ${_reacttheme.tokens.spacingHorizontalSNudge})`
50
+ }
51
+ };
52
+ const useRootClassName = (0, _react.makeResetStyles)({
53
+ display: 'inline-flex',
54
+ alignItems: 'center',
55
+ flexWrap: 'nowrap',
56
+ gap: _reacttheme.tokens.spacingHorizontalXXS,
57
+ borderRadius: _reacttheme.tokens.borderRadiusMedium,
58
+ position: 'relative',
59
+ boxSizing: 'border-box',
60
+ verticalAlign: 'middle',
61
+ // size: medium (default)
62
+ minHeight: fieldHeights.medium,
63
+ ..._reacttheme.typographyStyles.body1,
64
+ // appearance: outline (default)
65
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
66
+ border: `1px solid ${_reacttheme.tokens.colorNeutralStroke1}`,
67
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible,
68
+ // This is all for the bottom focus border.
69
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
70
+ '::after': {
71
+ boxSizing: 'border-box',
72
+ content: '""',
73
+ position: 'absolute',
74
+ left: '-1px',
75
+ bottom: '-1px',
76
+ right: '-1px',
77
+ // Maintaining the correct corner radius:
78
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
79
+ // (Otherwise the radius would be automatically reduced to fit available space.)
80
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
81
+ height: `max(2px, ${_reacttheme.tokens.borderRadiusMedium})`,
82
+ borderBottomLeftRadius: _reacttheme.tokens.borderRadiusMedium,
83
+ borderBottomRightRadius: _reacttheme.tokens.borderRadiusMedium,
84
+ // Flat 2px border:
85
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
86
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
87
+ // borderBottom makes it easier for people to override the color if needed.)
88
+ borderBottom: `2px solid ${_reacttheme.tokens.colorCompoundBrandStroke}`,
89
+ clipPath: 'inset(calc(100% - 2px) 0 0 0)',
90
+ // Animation for focus OUT
91
+ transform: 'scaleX(0)',
92
+ transitionProperty: 'transform',
93
+ transitionDuration: _reacttheme.tokens.durationUltraFast,
94
+ transitionDelay: _reacttheme.tokens.curveAccelerateMid,
95
+ '@media screen and (prefers-reduced-motion: reduce)': {
96
+ transitionDuration: '0.01ms',
97
+ transitionDelay: '0.01ms'
98
+ }
99
+ },
100
+ ':focus-within::after': {
101
+ // Animation for focus IN
102
+ transform: 'scaleX(1)',
103
+ transitionProperty: 'transform',
104
+ transitionDuration: _reacttheme.tokens.durationNormal,
105
+ transitionDelay: _reacttheme.tokens.curveDecelerateMid,
106
+ '@media screen and (prefers-reduced-motion: reduce)': {
107
+ transitionDuration: '0.01ms',
108
+ transitionDelay: '0.01ms'
109
+ }
110
+ },
111
+ ':focus-within:active::after': {
112
+ // This is if the user clicks the field again while it's already focused
113
+ borderBottomColor: _reacttheme.tokens.colorCompoundBrandStrokePressed
114
+ },
115
+ ':focus-within': {
116
+ outline: '2px solid transparent'
117
+ }
118
+ });
119
+ const useRootStyles = (0, _react.makeStyles)({
120
+ small: {
121
+ minHeight: fieldHeights.small,
122
+ ..._reacttheme.typographyStyles.caption1
123
+ },
124
+ medium: {},
125
+ large: {
126
+ minHeight: fieldHeights.large,
127
+ ..._reacttheme.typographyStyles.body2,
128
+ gap: _reacttheme.tokens.spacingHorizontalSNudge
129
+ },
130
+ outline: {},
131
+ outlineInteractive: {
132
+ ':hover': {
133
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Hover),
134
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
135
+ },
136
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
137
+ ':active,:focus-within': {
138
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
139
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
140
+ }
141
+ },
142
+ underline: {
143
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
144
+ borderRadius: '0',
145
+ // border is specified in rootBaseStyles, but we only want a bottom border here
146
+ borderTopStyle: 'none',
147
+ borderRightStyle: 'none',
148
+ borderLeftStyle: 'none',
149
+ // Make the focus underline (::after) match the width of the bottom border
150
+ '::after': {
151
+ left: 0,
152
+ right: 0
153
+ }
154
+ },
155
+ underlineInteractive: {
156
+ ':hover': {
157
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
158
+ },
159
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
160
+ ':active,:focus-within': {
161
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
162
+ },
163
+ '::after': {
164
+ // remove rounded corners from focus underline
165
+ borderRadius: '0'
166
+ }
167
+ },
168
+ filled: {
169
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorTransparentStroke)
170
+ },
171
+ filledInteractive: {
172
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
173
+ ':hover,:focus-within': {
174
+ // also handles pressed border color (:active)
175
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorTransparentStrokeInteractive)
176
+ }
177
+ },
178
+ invalid: {
179
+ ':not(:focus-within),:hover:not(:focus-within)': {
180
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorPaletteRedBorder2)
181
+ }
182
+ },
183
+ 'filled-darker': {
184
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3
185
+ },
186
+ 'filled-lighter': {
187
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1
188
+ },
189
+ // This shadow appearance is deprecated and will be removed in a future release.
190
+ 'filled-darker-shadow': {
191
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
192
+ boxShadow: _reacttheme.tokens.shadow2
193
+ },
194
+ // This shadow appearance is deprecated and will be removed in a future release.
195
+ 'filled-lighter-shadow': {
196
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
197
+ boxShadow: _reacttheme.tokens.shadow2
198
+ },
199
+ disabled: {
200
+ cursor: 'not-allowed',
201
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
202
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
203
+ '@media (forced-colors: active)': {
204
+ ..._react.shorthands.borderColor('GrayText')
205
+ },
206
+ // remove the focus border
207
+ '::after': {
208
+ content: 'unset'
209
+ },
210
+ // remove the focus outline
211
+ ':focus-within': {
212
+ outlineStyle: 'none'
213
+ }
214
+ },
215
+ smallWithContentBefore: {
216
+ paddingLeft: horizontalPadding.root.small
217
+ },
218
+ smallWithContentAfter: {
219
+ paddingRight: horizontalPadding.root.small
220
+ },
221
+ mediumWithContentBefore: {
222
+ paddingLeft: horizontalPadding.root.medium
223
+ },
224
+ mediumWithContentAfter: {
225
+ paddingRight: horizontalPadding.root.medium
226
+ },
227
+ largeWithContentBefore: {
228
+ paddingLeft: horizontalPadding.root.large
229
+ },
230
+ largeWithContentAfter: {
231
+ paddingRight: horizontalPadding.root.large
232
+ }
233
+ });
234
+ const useInputClassName = (0, _react.makeResetStyles)({
235
+ alignSelf: 'stretch',
236
+ boxSizing: 'border-box',
237
+ flexGrow: 1,
238
+ minWidth: 0,
239
+ borderStyle: 'none',
240
+ padding: `0 ${horizontalPadding.combined.medium}`,
241
+ color: _reacttheme.tokens.colorNeutralForeground1,
242
+ // Use literal "transparent" (not from the theme) to always let the color from the root show through
243
+ backgroundColor: 'transparent',
244
+ '::placeholder': {
245
+ color: _reacttheme.tokens.colorNeutralForeground4,
246
+ opacity: 1
247
+ },
248
+ outlineStyle: 'none',
249
+ // Inherit typography styles from root
250
+ fontFamily: 'inherit',
251
+ fontSize: 'inherit',
252
+ fontWeight: 'inherit',
253
+ lineHeight: 'inherit'
254
+ });
255
+ const useInputElementStyles = (0, _react.makeStyles)({
256
+ small: {
257
+ paddingLeft: horizontalPadding.combined.small,
258
+ paddingRight: horizontalPadding.combined.small
259
+ },
260
+ medium: {},
261
+ large: {
262
+ paddingLeft: horizontalPadding.combined.large,
263
+ paddingRight: horizontalPadding.combined.large
264
+ },
265
+ smallWithContentBefore: {
266
+ paddingLeft: horizontalPadding.input.small
267
+ },
268
+ smallWithContentAfter: {
269
+ paddingRight: horizontalPadding.input.small
270
+ },
271
+ mediumWithContentBefore: {
272
+ paddingLeft: horizontalPadding.input.medium
273
+ },
274
+ mediumWithContentAfter: {
275
+ paddingRight: horizontalPadding.input.medium
276
+ },
277
+ largeWithContentBefore: {
278
+ paddingLeft: horizontalPadding.input.large
279
+ },
280
+ largeWithContentAfter: {
281
+ paddingRight: horizontalPadding.input.large
282
+ },
283
+ disabled: {
284
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
285
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
286
+ cursor: 'not-allowed',
287
+ '::placeholder': {
288
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
289
+ }
290
+ }
291
+ });
292
+ const useContentClassName = (0, _react.makeResetStyles)({
293
+ boxSizing: 'border-box',
294
+ color: _reacttheme.tokens.colorNeutralForeground3,
295
+ display: 'flex',
296
+ // special case styling for icons (most common case) to ensure they're centered vertically
297
+ // size: medium (default)
298
+ '> svg': {
299
+ fontSize: '20px'
300
+ }
301
+ });
302
+ const useContentStyles = (0, _react.makeStyles)({
303
+ disabled: {
304
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
305
+ },
306
+ // Ensure resizable icons show up with the proper font size
307
+ small: {
308
+ '> svg': {
309
+ fontSize: '16px'
310
+ }
311
+ },
312
+ medium: {},
313
+ large: {
314
+ '> svg': {
315
+ fontSize: '24px'
316
+ }
317
+ }
318
+ });
319
+ const useInputStyles_unstable = (state)=>{
320
+ 'use no memo';
321
+ const { size, appearance } = state;
322
+ const disabled = state.input.disabled;
323
+ const invalid = `${state.input['aria-invalid']}` === 'true';
324
+ const filled = appearance.startsWith('filled');
325
+ const rootStyles = useRootStyles();
326
+ const inputStyles = useInputElementStyles();
327
+ const contentStyles = useContentStyles();
328
+ state.root.className = (0, _react.mergeClasses)(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);
329
+ state.input.className = (0, _react.mergeClasses)(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);
330
+ const contentClasses = [
331
+ useContentClassName(),
332
+ disabled && contentStyles.disabled,
333
+ contentStyles[size]
334
+ ];
335
+ if (state.contentBefore) {
336
+ state.contentBefore.className = (0, _react.mergeClasses)(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
337
+ }
338
+ if (state.contentAfter) {
339
+ state.contentAfter.className = (0, _react.mergeClasses)(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);
340
+ }
341
+ return state;
342
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Input/useInputStyles.styles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM,\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge,\n },\n combined: {\n small: tokens.spacingHorizontalS, // SNudge + XXS\n medium: tokens.spacingHorizontalM, // MNudge + XXS\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n },\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge,\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0', // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0',\n },\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large,\n },\n});\n\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small,\n },\n medium: {\n // Included in useInputClassName\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large,\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n 'use no memo';\n\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n state.contentBefore && rootStyles[`${size}WithContentBefore`],\n state.contentAfter && rootStyles[`${size}WithContentAfter`],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n inputStyles[size],\n state.contentBefore && inputStyles[`${size}WithContentBefore`],\n state.contentAfter && inputStyles[`${size}WithContentAfter`],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","shorthands","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","display","alignItems","flexWrap","gap","borderRadius","borderRadiusMedium","position","boxSizing","verticalAlign","minHeight","body1","backgroundColor","colorNeutralBackground1","border","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","colorCompoundBrandStrokePressed","outline","useRootStyles","caption1","body2","outlineInteractive","borderColor","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","underline","colorTransparentBackground","borderTopStyle","borderRightStyle","borderLeftStyle","underlineInteractive","filled","colorTransparentStroke","filledInteractive","colorTransparentStrokeInteractive","invalid","colorPaletteRedBorder2","colorNeutralBackground3","boxShadow","shadow2","disabled","cursor","colorNeutralStrokeDisabled","outlineStyle","smallWithContentBefore","paddingLeft","smallWithContentAfter","paddingRight","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","useInputClassName","alignSelf","flexGrow","minWidth","borderStyle","padding","color","colorNeutralForeground1","colorNeutralForeground4","opacity","fontFamily","fontSize","fontWeight","lineHeight","useInputElementStyles","colorNeutralForegroundDisabled","useContentClassName","colorNeutralForeground3","useContentStyles","useInputStyles_unstable","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","contentClasses"],"mappings":";;;;;;;;;;;IAKaM,eAAAA;;;2BAmUA6G;;;;4BAxU4B,wBAAwB;uBAEK,iBAAiB;AAGhF,wBAAoD;IACzD5G,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEF,kDAAkD;AAClD,MAAMC,eAAe;IACnBC,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT;AAEA,0GAA0G;AAC1G,yGAAyG;AACzG,MAAMC,oBAAoB;IACxBR,MAAM;QACJK,OAAOZ,kBAAAA,CAAOgB,uBAAuB;QACrCH,QAAQb,kBAAAA,CAAOiB,uBAAuB;QACtCH,OAAOd,kBAAAA,CAAOkB,kBAAkB;IAClC;IACAV,OAAO;QACLI,OAA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AEjC;IACA,IAAIP,MAAM1G,YAAY,EAAE;QACtB0G,MAAM1G,YAAY,CAACiH,SAAS,OAAGvH,mBAAAA,EAC7BE,gBAAgBI,YAAY,KACzBkH,gBACHR,MAAM1G,YAAY,CAACiH,SAAS;IAEhC;IAEA,OAAOP;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,eAAe;eAAfA,sBAAe;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;;uBAAQ"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"],"names":["Input","inputClassNames","renderInput_unstable","useInputStyles_unstable","useInput_unstable"],"mappings":";;;;;;;;;;;;eAASA,YAAK;;;eAAEC,sBAAe;;;eAAEC,2BAAoB;;;eAAEC,8BAAuB;;;eAAEC,wBAAiB;;;uBAAQ,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-input",
3
- "version": "9.6.7",
3
+ "version": "9.7.1",
4
4
  "description": "Fluent UI React Input component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -19,11 +19,11 @@
19
19
  "@fluentui/scripts-api-extractor": "*"
20
20
  },
21
21
  "dependencies": {
22
- "@fluentui/react-field": "^9.3.7",
23
- "@fluentui/react-jsx-runtime": "^9.1.2",
22
+ "@fluentui/react-field": "^9.4.1",
23
+ "@fluentui/react-jsx-runtime": "^9.1.3",
24
24
  "@fluentui/react-shared-contexts": "^9.24.0",
25
25
  "@fluentui/react-theme": "^9.1.24",
26
- "@fluentui/react-utilities": "^9.22.0",
26
+ "@fluentui/react-utilities": "^9.23.0",
27
27
  "@griffel/react": "^1.5.22",
28
28
  "@swc/helpers": "^0.5.1"
29
29
  },