@fluentui/react-input 0.0.0-nightlyf8be6a7c6520220106.1 → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +561 -18
- package/CHANGELOG.md +213 -49
- package/README.md +32 -0
- package/Spec-styling.md +8 -8
- package/Spec-variants.md +2 -2
- package/dist/{react-input.d.ts → index.d.ts} +16 -22
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/Input.js.map +1 -1
- package/lib/components/Input/Input.js +6 -8
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.types.js.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/Input/renderInput.js +4 -4
- package/lib/components/Input/renderInput.js.map +1 -1
- package/lib/components/Input/useInput.js +3 -5
- package/lib/components/Input/useInput.js.map +1 -1
- package/lib/components/Input/useInputStyles.js +106 -93
- package/lib/components/Input/useInputStyles.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Input.js.map +1 -1
- package/lib-commonjs/components/Input/Input.js +3 -5
- package/lib-commonjs/components/Input/Input.js.map +1 -1
- package/lib-commonjs/components/Input/Input.types.js.map +1 -1
- package/lib-commonjs/components/Input/index.js.map +1 -1
- package/lib-commonjs/components/Input/renderInput.js +6 -6
- package/lib-commonjs/components/Input/renderInput.js.map +1 -1
- package/lib-commonjs/components/Input/useInput.js +5 -7
- package/lib-commonjs/components/Input/useInput.js.map +1 -1
- package/lib-commonjs/components/Input/useInputStyles.js +112 -98
- package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
- package/lib-commonjs/index.js +32 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +18 -24
- package/lib/Input.d.ts +0 -1
- package/lib/components/Input/Input.d.ts +0 -8
- package/lib/components/Input/Input.types.d.ts +0 -84
- package/lib/components/Input/index.d.ts +0 -5
- package/lib/components/Input/renderInput.d.ts +0 -5
- package/lib/components/Input/useInput.d.ts +0 -12
- package/lib/components/Input/useInputStyles.d.ts +0 -6
- package/lib/index.d.ts +0 -1
- package/lib-commonjs/Input.d.ts +0 -1
- package/lib-commonjs/components/Input/Input.d.ts +0 -8
- package/lib-commonjs/components/Input/Input.types.d.ts +0 -84
- package/lib-commonjs/components/Input/index.d.ts +0 -5
- package/lib-commonjs/components/Input/renderInput.d.ts +0 -5
- package/lib-commonjs/components/Input/useInput.d.ts +0 -12
- package/lib-commonjs/components/Input/useInputStyles.d.ts +0 -6
- package/lib-commonjs/index.d.ts +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
2
2
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
3
3
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
4
|
-
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
|
5
4
|
import * as React_2 from 'react';
|
|
5
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
6
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The Input component allows people to enter and edit text.
|
|
9
|
-
*
|
|
10
|
-
* ⚠️ **This component is still in alpha (unstable) status. APIs may change before the final release.**
|
|
11
10
|
*/
|
|
12
11
|
export declare const Input: ForwardRefComponent<InputProps>;
|
|
13
12
|
|
|
14
|
-
export declare const
|
|
13
|
+
export declare const inputClassNames: SlotClassNames<InputSlots>;
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Data passed to the `onChange` callback when a user changes the input's value.
|
|
@@ -21,7 +20,7 @@ export declare type InputOnChangeData = {
|
|
|
21
20
|
value: string;
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
export declare type InputProps = Omit<ComponentProps<InputSlots
|
|
23
|
+
export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & {
|
|
25
24
|
/** Input can't have children. */
|
|
26
25
|
children?: never;
|
|
27
26
|
/**
|
|
@@ -29,16 +28,11 @@ export declare type InputProps = Omit<ComponentProps<InputSlots, 'input'>, 'chil
|
|
|
29
28
|
* @default 'medium'
|
|
30
29
|
*/
|
|
31
30
|
size?: 'small' | 'medium' | 'large';
|
|
32
|
-
/**
|
|
33
|
-
* If true, the input will have inline display, allowing it be used within text content.
|
|
34
|
-
* If false (the default), the input will have block display.
|
|
35
|
-
*/
|
|
36
|
-
inline?: boolean;
|
|
37
31
|
/**
|
|
38
32
|
* Controls the colors and borders of the input.
|
|
39
33
|
* @default 'outline'
|
|
40
34
|
*/
|
|
41
|
-
appearance?: 'outline' | 'underline' | '
|
|
35
|
+
appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
|
42
36
|
/**
|
|
43
37
|
* Default value of the input. Provide this if the input should be an uncontrolled component
|
|
44
38
|
* which tracks its current state internally; otherwise, use `value`.
|
|
@@ -56,7 +50,7 @@ export declare type InputProps = Omit<ComponentProps<InputSlots, 'input'>, 'chil
|
|
|
56
50
|
/**
|
|
57
51
|
* Called when the user changes the input's value.
|
|
58
52
|
*/
|
|
59
|
-
onChange?: (ev: React_2.
|
|
53
|
+
onChange?: (ev: React_2.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
|
|
60
54
|
/**
|
|
61
55
|
* An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)
|
|
62
56
|
* based on the type of value the user will enter.
|
|
@@ -79,7 +73,7 @@ export declare type InputSlots = {
|
|
|
79
73
|
* The root slot receives the `className` and `style` specified directly on the `<Input>`.
|
|
80
74
|
* All other top-level native props will be applied to the primary slot, `input`.
|
|
81
75
|
*/
|
|
82
|
-
root:
|
|
76
|
+
root: NonNullable<Slot<'span'>>;
|
|
83
77
|
/**
|
|
84
78
|
* The actual `<input>` element. `type="text"` will be automatically applied unless overridden.
|
|
85
79
|
*
|
|
@@ -87,37 +81,37 @@ export declare type InputSlots = {
|
|
|
87
81
|
* (except `className` and `style`, which go to the `root` slot). The top-level `ref` will
|
|
88
82
|
* also go here.
|
|
89
83
|
*/
|
|
90
|
-
input:
|
|
84
|
+
input: NonNullable<Slot<'input'>>;
|
|
91
85
|
/** Element before the input text, within the input border */
|
|
92
|
-
contentBefore?:
|
|
86
|
+
contentBefore?: Slot<'span'>;
|
|
93
87
|
/** Element after the input text, within the input border */
|
|
94
|
-
contentAfter?:
|
|
88
|
+
contentAfter?: Slot<'span'>;
|
|
95
89
|
};
|
|
96
90
|
|
|
97
91
|
/**
|
|
98
92
|
* State used in rendering Input.
|
|
99
93
|
*/
|
|
100
|
-
export declare type InputState = Required<Pick<InputProps, 'appearance' | '
|
|
94
|
+
export declare type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;
|
|
101
95
|
|
|
102
96
|
/**
|
|
103
97
|
* Render the final JSX of Input
|
|
104
98
|
*/
|
|
105
|
-
export declare const
|
|
99
|
+
export declare const renderInput_unstable: (state: InputState) => JSX.Element;
|
|
106
100
|
|
|
107
101
|
/**
|
|
108
102
|
* Create the state required to render Input.
|
|
109
103
|
*
|
|
110
|
-
* The returned state can be modified with hooks such as
|
|
111
|
-
* before being passed to
|
|
104
|
+
* The returned state can be modified with hooks such as useInputStyles_unstable,
|
|
105
|
+
* before being passed to renderInput_unstable.
|
|
112
106
|
*
|
|
113
107
|
* @param props - props from this instance of Input
|
|
114
108
|
* @param ref - reference to `<input>` element of Input
|
|
115
109
|
*/
|
|
116
|
-
export declare const
|
|
110
|
+
export declare const useInput_unstable: (props: InputProps, ref: React_2.Ref<HTMLInputElement>) => InputState;
|
|
117
111
|
|
|
118
112
|
/**
|
|
119
113
|
* Apply styling to the Input slots based on the state
|
|
120
114
|
*/
|
|
121
|
-
export declare const
|
|
115
|
+
export declare const useInputStyles_unstable: (state: InputState) => InputState;
|
|
122
116
|
|
|
123
117
|
export { }
|
|
File without changes
|
package/lib/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"../src/","sources":["Input.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './components/Input/index';\n"]}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useInput_unstable } from './useInput';
|
|
3
|
+
import { renderInput_unstable } from './renderInput';
|
|
4
|
+
import { useInputStyles_unstable } from './useInputStyles';
|
|
5
5
|
/**
|
|
6
6
|
* The Input component allows people to enter and edit text.
|
|
7
|
-
*
|
|
8
|
-
* ⚠️ **This component is still in alpha (unstable) status. APIs may change before the final release.**
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
9
|
export const Input = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
-
const state =
|
|
13
|
-
|
|
14
|
-
return
|
|
10
|
+
const state = useInput_unstable(props, ref);
|
|
11
|
+
useInputStyles_unstable(state);
|
|
12
|
+
return renderInput_unstable(state);
|
|
15
13
|
});
|
|
16
14
|
Input.displayName = 'Input';
|
|
17
15
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,YAAlC;AACA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AAIA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;EAEA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\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 return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"Input.types.js","sourceRoot":"../src/","sources":["components/Input/Input.types.ts"],"names":[],"mappings":"","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 appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';\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 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './Input';\nexport * from './Input.types';\nexport * from './renderInput';\nexport * from './useInput';\nexport * from './useInputStyles';\n"]}
|
|
@@ -4,15 +4,15 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
|
4
4
|
* Render the final JSX of Input
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const renderInput_unstable = state => {
|
|
8
8
|
const {
|
|
9
9
|
slots,
|
|
10
10
|
slotProps
|
|
11
|
-
} = getSlots(state
|
|
11
|
+
} = getSlots(state);
|
|
12
12
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
13
|
-
}, /*#__PURE__*/React.createElement(slots.contentBefore, { ...slotProps.contentBefore
|
|
13
|
+
}, slots.contentBefore && /*#__PURE__*/React.createElement(slots.contentBefore, { ...slotProps.contentBefore
|
|
14
14
|
}), /*#__PURE__*/React.createElement(slots.input, { ...slotProps.input
|
|
15
|
-
}), /*#__PURE__*/React.createElement(slots.contentAfter, { ...slotProps.contentAfter
|
|
15
|
+
}), slots.contentAfter && /*#__PURE__*/React.createElement(slots.contentAfter, { ...slotProps.contentAfter
|
|
16
16
|
}));
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=renderInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Input/renderInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;EACxD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAa,KAAb,CAArC;EACA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,aAAN,iBAAuB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,aAAP,EAAoB,EAAA,GAAK,SAAS,CAAC;EAAf,CAApB,CAD1B,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;EAAf,CAAZ,CAFF,EAGG,KAAK,CAAC,YAAN,iBAAsB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAnB,CAHzB,CADF;AAOD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 const { slots, slotProps } = getSlots<InputSlots>(state);\n return (\n <slots.root {...slotProps.root}>\n {slots.contentBefore && <slots.contentBefore {...slotProps.contentBefore} />}\n <slots.input {...slotProps.input} />\n {slots.contentAfter && <slots.contentAfter {...slotProps.contentAfter} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -2,18 +2,17 @@ import { getPartitionedNativeProps, resolveShorthand, useControllableState, useE
|
|
|
2
2
|
/**
|
|
3
3
|
* Create the state required to render Input.
|
|
4
4
|
*
|
|
5
|
-
* The returned state can be modified with hooks such as
|
|
6
|
-
* before being passed to
|
|
5
|
+
* The returned state can be modified with hooks such as useInputStyles_unstable,
|
|
6
|
+
* before being passed to renderInput_unstable.
|
|
7
7
|
*
|
|
8
8
|
* @param props - props from this instance of Input
|
|
9
9
|
* @param ref - reference to `<input>` element of Input
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const useInput_unstable = (props, ref) => {
|
|
13
13
|
const {
|
|
14
14
|
size = 'medium',
|
|
15
15
|
appearance = 'outline',
|
|
16
|
-
inline = false,
|
|
17
16
|
onChange
|
|
18
17
|
} = props;
|
|
19
18
|
const [value, setValue] = useControllableState({
|
|
@@ -29,7 +28,6 @@ export const useInput = (props, ref) => {
|
|
|
29
28
|
const state = {
|
|
30
29
|
size,
|
|
31
30
|
appearance,
|
|
32
|
-
inline,
|
|
33
31
|
components: {
|
|
34
32
|
root: 'span',
|
|
35
33
|
input: 'input',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Input/useInput.ts"],"names":[],"mappings":"AACA,SACE,yBADF,EAEE,gBAFF,EAGE,oBAHF,EAIE,gBAJF,QAKO,2BALP;AAQA;;;;;;;;AAQG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;EACnG,MAAM;IAAE,IAAI,GAAG,QAAT;IAAmB,UAAU,GAAG,SAAhC;IAA2C;EAA3C,IAAwD,KAA9D;EAEA,MAAM,CAAC,KAAD,EAAQ,QAAR,IAAoB,oBAAoB,CAAC;IAC7C,KAAK,EAAE,KAAK,CAAC,KADgC;IAE7C,YAAY,EAAE,KAAK,CAAC,YAFyB;IAG7C,YAAY,EAAE;EAH+B,CAAD,CAA9C;EAMA,MAAM,WAAW,GAAG,yBAAyB,CAAC;IAC5C,KAD4C;IAE5C,kBAAkB,EAAE,OAFwB;IAG5C,iBAAiB,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,OAArB,EAA8B,cAA9B;EAHyB,CAAD,CAA7C;EAMA,MAAM,KAAK,GAAe;IACxB,IADwB;IAExB,UAFwB;IAGxB,UAAU,EAAE;MACV,IAAI,EAAE,MADI;MAEV,KAAK,EAAE,OAFG;MAGV,aAAa,EAAE,MAHL;MAIV,YAAY,EAAE;IAJJ,CAHY;IASxB,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAP,EAAc;MACnC,QAAQ,EAAE,IADyB;MAEnC,YAAY,EAAE;QACZ,IAAI,EAAE,MADM;QAEZ,GAFY;QAGZ,GAAG,WAAW,CAAC;MAHH;IAFqB,CAAd,CATC;IAiBxB,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAAC,YAAP,CAjBN;IAkBxB,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,aAAP,CAlBP;IAmBxB,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;MACjC,QAAQ,EAAE,IADuB;MAEjC,YAAY,EAAE,WAAW,CAAC;IAFO,CAAb;EAnBE,CAA1B;EAyBA,KAAK,CAAC,KAAN,CAAY,KAAZ,GAAoB,KAApB;EACA,KAAK,CAAC,KAAN,CAAY,QAAZ,GAAuB,gBAAgB,CAAC,EAAE,IAAG;IAC3C,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAH,CAAU,KAA3B;IACA,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,EAAH,EAAO;MAAE,KAAK,EAAE;IAAT,CAAP,CAAR;IACA,QAAQ,CAAC,QAAD,CAAR;EACD,CAJsC,CAAvC;EAMA,OAAO,KAAP;AACD,CAhDM","sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport type { InputProps, InputState } from './Input.types';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const { size = 'medium', appearance = 'outline', onChange } = props;\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: undefined,\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['size', 'onChange', 'value', 'defaultValue'],\n });\n\n const state: InputState = {\n size,\n appearance,\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n }),\n contentAfter: resolveShorthand(props.contentAfter),\n contentBefore: resolveShorthand(props.contentBefore),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1,37 +1,19 @@
|
|
|
1
|
-
import { __styles, mergeClasses, shorthands } from '@
|
|
2
|
-
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
export const inputClassNames = {
|
|
4
|
+
root: 'fui-Input',
|
|
5
|
+
input: 'fui-Input__input',
|
|
6
|
+
contentBefore: 'fui-Input__contentBefore',
|
|
7
|
+
contentAfter: 'fui-Input__contentAfter'
|
|
8
|
+
}; // TODO(sharing) use theme values once available
|
|
3
9
|
|
|
4
|
-
const horizontalSpacing = {
|
|
5
|
-
xxs: '2px',
|
|
6
|
-
xs: '4px',
|
|
7
|
-
sNudge: '6px',
|
|
8
|
-
s: '8px',
|
|
9
|
-
mNudge: '10px',
|
|
10
|
-
m: '12px'
|
|
11
|
-
};
|
|
12
|
-
const motionDurations = {
|
|
13
|
-
ultraFast: '0.05s',
|
|
14
|
-
normal: '0.2s'
|
|
15
|
-
};
|
|
16
|
-
const motionCurves = {
|
|
17
|
-
accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',
|
|
18
|
-
decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)'
|
|
19
|
-
};
|
|
20
10
|
const contentSizes = {
|
|
21
|
-
// TODO
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
fontSize: theme.fontSizeBase200,
|
|
28
|
-
lineHeight: theme.lineHeightBase200
|
|
29
|
-
}),
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
31
|
-
400: theme => ({
|
|
32
|
-
fontSize: theme.fontSizeBase400,
|
|
33
|
-
lineHeight: theme.lineHeightBase400
|
|
34
|
-
})
|
|
11
|
+
// TODO: This 400 style is not in the typography styles.
|
|
12
|
+
// May need a design change
|
|
13
|
+
400: {
|
|
14
|
+
fontSize: tokens.fontSizeBase400,
|
|
15
|
+
lineHeight: tokens.lineHeightBase400
|
|
16
|
+
}
|
|
35
17
|
}; // TODO(sharing) should these be shared somewhere?
|
|
36
18
|
|
|
37
19
|
const fieldHeights = {
|
|
@@ -42,11 +24,11 @@ const fieldHeights = {
|
|
|
42
24
|
|
|
43
25
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
44
26
|
"base": {
|
|
45
|
-
"mc9l5x": "
|
|
27
|
+
"mc9l5x": "ftuwxu6",
|
|
46
28
|
"Bt984gj": "f122n59",
|
|
47
29
|
"Eh141a": "flvyvdh",
|
|
48
|
-
"i8kkvl": "
|
|
49
|
-
"Belr9w4": "
|
|
30
|
+
"i8kkvl": "f14mj54c",
|
|
31
|
+
"Belr9w4": "fiut8dr",
|
|
50
32
|
"Bahqtrf": "fk6fouc",
|
|
51
33
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
52
34
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
@@ -56,60 +38,64 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
56
38
|
"B7ck84d": "f1ewtqcl"
|
|
57
39
|
},
|
|
58
40
|
"interactive": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
41
|
+
"li1rpt": "f1gw3sf2",
|
|
42
|
+
"Bsft5z2": "f13zj6fq",
|
|
43
|
+
"E3zdtr": "f1mdlcz9",
|
|
44
|
+
"Eqx8gd": ["f1a7op3", "f1cjjd47"],
|
|
45
|
+
"By385i5": "f1gboi2j",
|
|
46
|
+
"B1piin3": ["f1cjjd47", "f1a7op3"],
|
|
47
|
+
"Dlnsje": "f145g4dw",
|
|
48
|
+
"d9w3h3": ["f1kp91vd", "f1ibwz09"],
|
|
49
|
+
"B3778ie": ["f1ibwz09", "f1kp91vd"],
|
|
50
|
+
"Bcgy8vk": "f1cb6c3",
|
|
51
|
+
"Bw17bha": "f1lh990p",
|
|
52
|
+
"B1q35kw": "f1jc6hxc",
|
|
53
|
+
"Gjdm7m": "f13evtba",
|
|
54
|
+
"b1kco5": "f1yk9hq",
|
|
55
|
+
"Ba2ppi3": "fhwpy7i",
|
|
56
|
+
"F2fol1": "f14ee0xe",
|
|
57
|
+
"lck23g": "f1xhbsuh",
|
|
58
|
+
"umuwi5": "fjw5xc1",
|
|
59
|
+
"Blcqepd": "f1xdyd5c",
|
|
60
|
+
"nplu4u": "fatpbeo",
|
|
61
|
+
"Bioka5o": "fb7uyps",
|
|
62
|
+
"Bercvud": "f1ibeo51",
|
|
63
|
+
"Bbr2w1p": "f14a1fxs",
|
|
64
|
+
"Bduesf4": "f3e99gv",
|
|
65
|
+
"Bpq79vn": "fhljsf7"
|
|
81
66
|
},
|
|
82
67
|
"small": {
|
|
83
68
|
"sshi5w": "f1pha7fy",
|
|
84
69
|
"z8tnut": "f1g0x7ka",
|
|
85
|
-
"z189sj": ["
|
|
70
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
86
71
|
"Byoj8tv": "f1qch9an",
|
|
87
|
-
"uwmqm3": ["
|
|
72
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
73
|
+
"Bahqtrf": "fk6fouc",
|
|
88
74
|
"Be2twd7": "fy9rknc",
|
|
75
|
+
"Bhrd7zp": "figsok6",
|
|
89
76
|
"Bg96gwp": "fwrc4pm"
|
|
90
77
|
},
|
|
91
78
|
"medium": {
|
|
92
79
|
"sshi5w": "f1nxs5xn",
|
|
93
80
|
"z8tnut": "f1g0x7ka",
|
|
94
|
-
"z189sj": ["
|
|
81
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
95
82
|
"Byoj8tv": "f1qch9an",
|
|
96
|
-
"uwmqm3": ["
|
|
83
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
84
|
+
"Bahqtrf": "fk6fouc",
|
|
97
85
|
"Be2twd7": "fkhj508",
|
|
86
|
+
"Bhrd7zp": "figsok6",
|
|
98
87
|
"Bg96gwp": "f1i3iumi"
|
|
99
88
|
},
|
|
100
89
|
"large": {
|
|
101
90
|
"sshi5w": "f1w5jphr",
|
|
102
91
|
"z8tnut": "f1g0x7ka",
|
|
103
|
-
"z189sj": ["
|
|
92
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
104
93
|
"Byoj8tv": "f1qch9an",
|
|
105
|
-
"uwmqm3": ["
|
|
94
|
+
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
106
95
|
"Be2twd7": "fod5ikn",
|
|
107
96
|
"Bg96gwp": "faaz57k",
|
|
108
|
-
"i8kkvl": "
|
|
109
|
-
"Belr9w4": "
|
|
110
|
-
},
|
|
111
|
-
"inline": {
|
|
112
|
-
"mc9l5x": "ftuwxu6"
|
|
97
|
+
"i8kkvl": "f1rjii52",
|
|
98
|
+
"Belr9w4": "f1r7g2jn"
|
|
113
99
|
},
|
|
114
100
|
"outline": {
|
|
115
101
|
"De3pzq": "fxugw4r",
|
|
@@ -149,10 +135,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
149
135
|
"underlineInteractive": {
|
|
150
136
|
"oetu4i": "f1l4zc64",
|
|
151
137
|
"Be8ivqh": "f1klwx88",
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
138
|
+
"B3778ie": ["f1nf3wye", "feulmo5"],
|
|
139
|
+
"d9w3h3": ["feulmo5", "f1nf3wye"],
|
|
140
|
+
"Bl18szs": ["f18vqdqu", "f53nyzz"],
|
|
141
|
+
"B4j8arr": ["f53nyzz", "f18vqdqu"]
|
|
156
142
|
},
|
|
157
143
|
"filled": {
|
|
158
144
|
"E5pizo": "fyed02w",
|
|
@@ -175,14 +161,15 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
175
161
|
"nagaa4": "f1tpwn32",
|
|
176
162
|
"B1yhkcb": ["fsrcdbj", "f17blpuu"]
|
|
177
163
|
},
|
|
178
|
-
"
|
|
164
|
+
"filled-darker": {
|
|
179
165
|
"De3pzq": "f16xq7d1"
|
|
180
166
|
},
|
|
181
|
-
"
|
|
167
|
+
"filled-lighter": {
|
|
182
168
|
"De3pzq": "fxugw4r"
|
|
183
169
|
},
|
|
184
170
|
"disabled": {
|
|
185
171
|
"Bceei9c": "fdrzuqr",
|
|
172
|
+
"De3pzq": "f1c21dwh",
|
|
186
173
|
"B4j52fo": "f5ogflp",
|
|
187
174
|
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
188
175
|
"Bn0qgzm": "f1f09k3d",
|
|
@@ -198,48 +185,66 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
198
185
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
199
186
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
200
187
|
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
|
201
|
-
"Btl43ni": ["fyu767a", "f1jar5jt"]
|
|
188
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
|
189
|
+
"Bjwas2f": "fg455y9",
|
|
190
|
+
"Bn1d65q": ["f1rvyvqg", "f14g86mu"],
|
|
191
|
+
"Bxeuatn": "f1cwzwz",
|
|
192
|
+
"n51gp8": ["f14g86mu", "f1rvyvqg"]
|
|
202
193
|
}
|
|
203
194
|
}, {
|
|
204
|
-
"d": [".
|
|
205
|
-
"w": [".
|
|
206
|
-
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fsrcdbj:hover
|
|
207
|
-
"a": [".f8vnjqi:active,.f8vnjqi:focus-within{border-top-color:var(--colorNeutralStroke1Pressed);}", ".fz1etlk:active,.fz1etlk:focus-within{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1hc16gm:active
|
|
195
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".flvyvdh{-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}", ".f14mj54c{-webkit-column-gap:var(--spacingHorizontalXXS);column-gap:var(--spacingHorizontalXXS);}", ".fiut8dr{row-gap:var(--spacingHorizontalXXS);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".f1ewtqcl{box-sizing:border-box;}", ".f1gw3sf2::after{box-sizing:border-box;}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".f1a7op3::after{left:-1px;}", ".f1cjjd47::after{right:-1px;}", ".f1gboi2j::after{bottom:-1px;}", ".f145g4dw::after{height:max(2px, var(--borderRadiusMedium));}", ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1cb6c3::after{border-bottom-width:2px;}", ".f1lh990p::after{border-bottom-style:solid;}", ".f1jc6hxc::after{border-bottom-color:var(--colorCompoundBrandStroke);}", ".f13evtba::after{-webkit-clip-path:inset(calc(100% - 2px) 0 0 0);clip-path:inset(calc(100% - 2px) 0 0 0);}", ".f1yk9hq::after{-webkit-transform:scaleX(0);-moz-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);}", ".fhwpy7i::after{transition-property:transform;}", ".f14ee0xe::after{transition-duration:var(--durationUltraFast);}", ".f1xhbsuh::after{transition-delay:var(--curveAccelerateMid);}", ".f1pha7fy{min-height:24px;}", ".f1g0x7ka{padding-top:0;}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1qch9an{padding-bottom:0;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1nxs5xn{min-height:32px;}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1w5jphr{min-height:40px;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1rjii52{-webkit-column-gap:var(--spacingHorizontalSNudge);column-gap:var(--spacingHorizontalSNudge);}", ".f1r7g2jn{row-gap:var(--spacingHorizontalSNudge);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".f1nf3wye::after{border-bottom-right-radius:0;}", ".feulmo5::after{border-bottom-left-radius:0;}", ".f18vqdqu::after{border-top-right-radius:0;}", ".f53nyzz::after{border-top-left-radius:0;}", ".fyed02w{box-shadow:var(--shadow2);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fdrzuqr{cursor:not-allowed;}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}"],
|
|
196
|
+
"w": [".fjw5xc1:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);}", ".f1xdyd5c:focus-within::after{transition-property:transform;}", ".fatpbeo:focus-within::after{transition-duration:var(--durationNormal);}", ".fb7uyps:focus-within::after{transition-delay:var(--curveDecelerateMid);}", ".f1ibeo51:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".f14a1fxs:focus-within{outline-width:2px;}", ".f3e99gv:focus-within{outline-style:solid;}", ".fhljsf7:focus-within{outline-color:transparent;}"],
|
|
197
|
+
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fsrcdbj:hover,.fsrcdbj:focus-within{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f1tpwn32:hover,.f1tpwn32:focus-within{border-bottom-color:var(--colorTransparentStrokeInteractive);}"],
|
|
198
|
+
"a": [".f8vnjqi:active,.f8vnjqi:focus-within{border-top-color:var(--colorNeutralStroke1Pressed);}", ".fz1etlk:active,.fz1etlk:focus-within{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1hc16gm:active,.f1hc16gm:focus-within{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f1klwx88:active,.f1klwx88:focus-within{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}"],
|
|
199
|
+
"m": [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
200
|
+
"m": "(forced-colors: active)"
|
|
201
|
+
}], ["@media (forced-colors: active){.f1rvyvqg{border-right-color:GrayText;}.f14g86mu{border-left-color:GrayText;}}", {
|
|
202
|
+
"m": "(forced-colors: active)"
|
|
203
|
+
}], ["@media (forced-colors: active){.f1cwzwz{border-bottom-color:GrayText;}}", {
|
|
204
|
+
"m": "(forced-colors: active)"
|
|
205
|
+
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
206
|
+
"m": "(forced-colors: active)"
|
|
207
|
+
}]]
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
const useInputElementStyles = /*#__PURE__*/__styles({
|
|
211
211
|
"base": {
|
|
212
212
|
"B7ck84d": "f1ewtqcl",
|
|
213
213
|
"Bh6795r": "fqerorx",
|
|
214
|
+
"Bf4jedk": "fy77jfu",
|
|
214
215
|
"icvyot": "f1ern45e",
|
|
215
216
|
"vrafjx": ["f1n71otn", "f1deefiw"],
|
|
216
217
|
"oivjwe": "f1h8hb77",
|
|
217
218
|
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
218
219
|
"z8tnut": "f1g0x7ka",
|
|
219
|
-
"z189sj": ["
|
|
220
|
+
"z189sj": ["ffczdla", "fgiv446"],
|
|
220
221
|
"Byoj8tv": "f1qch9an",
|
|
221
|
-
"uwmqm3": ["
|
|
222
|
+
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
222
223
|
"sj55zd": "f19n0e5",
|
|
223
224
|
"De3pzq": "f3rmtva",
|
|
224
225
|
"yvdlaj": "fwyc1cq",
|
|
225
226
|
"B3o7kgh": "f13ta7ih",
|
|
226
|
-
"
|
|
227
|
+
"oeaueh": "f1s6fcnf"
|
|
227
228
|
},
|
|
228
229
|
"small": {
|
|
230
|
+
"Bahqtrf": "fk6fouc",
|
|
229
231
|
"Be2twd7": "fy9rknc",
|
|
232
|
+
"Bhrd7zp": "figsok6",
|
|
230
233
|
"Bg96gwp": "fwrc4pm"
|
|
231
234
|
},
|
|
232
235
|
"medium": {
|
|
236
|
+
"Bahqtrf": "fk6fouc",
|
|
233
237
|
"Be2twd7": "fkhj508",
|
|
238
|
+
"Bhrd7zp": "figsok6",
|
|
234
239
|
"Bg96gwp": "f1i3iumi"
|
|
235
240
|
},
|
|
236
241
|
"large": {
|
|
237
242
|
"Be2twd7": "fod5ikn",
|
|
238
243
|
"Bg96gwp": "faaz57k",
|
|
239
244
|
"z8tnut": "f1g0x7ka",
|
|
240
|
-
"z189sj": ["
|
|
245
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
241
246
|
"Byoj8tv": "f1qch9an",
|
|
242
|
-
"uwmqm3": ["
|
|
247
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"]
|
|
243
248
|
},
|
|
244
249
|
"disabled": {
|
|
245
250
|
"sj55zd": "f1s2aq7o",
|
|
@@ -248,8 +253,7 @@ const useInputElementStyles = /*#__PURE__*/__styles({
|
|
|
248
253
|
"yvdlaj": "fahhnxm"
|
|
249
254
|
}
|
|
250
255
|
}, {
|
|
251
|
-
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f1g0x7ka{padding-top:0;}", ".
|
|
252
|
-
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
256
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".fy77jfu{min-width:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f1g0x7ka{padding-top:0;}", ".ffczdla{padding-right:var(--spacingHorizontalXXS);}", ".fgiv446{padding-left:var(--spacingHorizontalXXS);}", ".f1qch9an{padding-bottom:0;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f3rmtva{background-color:transparent;}", ".fwyc1cq::-webkit-input-placeholder{color:var(--colorNeutralForeground4);}", ".fwyc1cq::-moz-placeholder{color:var(--colorNeutralForeground4);}", ".f13ta7ih::-webkit-input-placeholder{opacity:1;}", ".f13ta7ih::-moz-placeholder{opacity:1;}", ".f1s6fcnf{outline-style:none;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fdrzuqr{cursor:not-allowed;}", ".fahhnxm::-webkit-input-placeholder{color:var(--colorNeutralForegroundDisabled);}", ".fahhnxm::-moz-placeholder{color:var(--colorNeutralForegroundDisabled);}"]
|
|
253
257
|
});
|
|
254
258
|
|
|
255
259
|
const useContentStyles = /*#__PURE__*/__styles({
|
|
@@ -260,16 +264,25 @@ const useContentStyles = /*#__PURE__*/__styles({
|
|
|
260
264
|
},
|
|
261
265
|
"disabled": {
|
|
262
266
|
"sj55zd": "f1s2aq7o"
|
|
267
|
+
},
|
|
268
|
+
"small": {
|
|
269
|
+
"kwki1k": "f3u2cy0"
|
|
270
|
+
},
|
|
271
|
+
"medium": {
|
|
272
|
+
"kwki1k": "f1oqplr0"
|
|
273
|
+
},
|
|
274
|
+
"large": {
|
|
275
|
+
"kwki1k": "fa420co"
|
|
263
276
|
}
|
|
264
277
|
}, {
|
|
265
|
-
"d": [".f1ewtqcl{box-sizing:border-box;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fyuhxbn>svg{display:block;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"]
|
|
278
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fyuhxbn>svg{display:block;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f3u2cy0>svg{font-size:16px;}", ".f1oqplr0>svg{font-size:20px;}", ".fa420co>svg{font-size:24px;}"]
|
|
266
279
|
});
|
|
267
280
|
/**
|
|
268
281
|
* Apply styling to the Input slots based on the state
|
|
269
282
|
*/
|
|
270
283
|
|
|
271
284
|
|
|
272
|
-
export const
|
|
285
|
+
export const useInputStyles_unstable = state => {
|
|
273
286
|
const {
|
|
274
287
|
size,
|
|
275
288
|
appearance
|
|
@@ -279,16 +292,16 @@ export const useInputStyles = state => {
|
|
|
279
292
|
const rootStyles = useRootStyles();
|
|
280
293
|
const inputStyles = useInputElementStyles();
|
|
281
294
|
const contentStyles = useContentStyles();
|
|
282
|
-
state.root.className = mergeClasses(
|
|
283
|
-
state.input.className = mergeClasses(inputStyles.base, inputStyles[size], disabled && inputStyles.disabled, state.input.className);
|
|
284
|
-
const contentClasses = [contentStyles.base, disabled && contentStyles.disabled];
|
|
295
|
+
state.root.className = mergeClasses(inputClassNames.root, rootStyles.base, rootStyles[size], rootStyles[appearance], !disabled && rootStyles.interactive, !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, disabled && rootStyles.disabled, state.root.className);
|
|
296
|
+
state.input.className = mergeClasses(inputClassNames.input, inputStyles.base, inputStyles[size], disabled && inputStyles.disabled, state.input.className);
|
|
297
|
+
const contentClasses = [contentStyles.base, disabled && contentStyles.disabled, contentStyles[size]];
|
|
285
298
|
|
|
286
299
|
if (state.contentBefore) {
|
|
287
|
-
state.contentBefore.className = mergeClasses(...contentClasses, state.contentBefore.className);
|
|
300
|
+
state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
|
|
288
301
|
}
|
|
289
302
|
|
|
290
303
|
if (state.contentAfter) {
|
|
291
|
-
state.contentAfter.className = mergeClasses(...contentClasses, state.contentAfter.className);
|
|
304
|
+
state.contentAfter.className = mergeClasses(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);
|
|
292
305
|
}
|
|
293
306
|
|
|
294
307
|
return state;
|