@fluentui/react-input 9.0.0-beta.8 → 9.0.0-rc.3
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 +142 -1
- package/CHANGELOG.md +45 -2
- package/README.md +32 -0
- package/dist/index.d.ts +1 -6
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Input/Input.types.js.map +1 -1
- package/lib/components/Input/useInputStyles.js +36 -56
- package/lib/components/Input/useInputStyles.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Input/useInputStyles.js +36 -56
- package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -8
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -6
- package/lib/Input.d.ts +0 -1
- package/lib/components/Input/Input.d.ts +0 -6
- package/lib/components/Input/Input.types.d.ts +0 -79
- 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 -11
- package/lib/index.d.ts +0 -2
- package/lib-commonjs/Input.d.ts +0 -1
- package/lib-commonjs/components/Input/Input.d.ts +0 -6
- package/lib-commonjs/components/Input/Input.types.d.ts +0 -79
- 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 -11
- package/lib-commonjs/index.d.ts +0 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,148 @@
|
|
|
2
2
|
"name": "@fluentui/react-input",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 23 May 2022 18:54:50 GMT",
|
|
6
|
+
"tag": "@fluentui/react-input_v9.0.0-rc.3",
|
|
7
|
+
"version": "9.0.0-rc.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "esteban.230@hotmail.com",
|
|
12
|
+
"package": "@fluentui/react-input",
|
|
13
|
+
"commit": "5ed22515a7542b432ed694f22606ac3718d501cb",
|
|
14
|
+
"comment": "Removing <componentName>ClassName exports."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "seanmonahan@microsoft.com",
|
|
18
|
+
"package": "@fluentui/react-input",
|
|
19
|
+
"commit": "5ed22515a7542b432ed694f22606ac3718d501cb",
|
|
20
|
+
"comment": "BREAKING: update string unions to use spinal-case"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-input",
|
|
25
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.9",
|
|
26
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-input",
|
|
31
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.7",
|
|
32
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-input",
|
|
37
|
+
"comment": "Bump @fluentui/react-text to v9.0.0-rc.10",
|
|
38
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"date": "Mon, 23 May 2022 12:14:17 GMT",
|
|
45
|
+
"tag": "@fluentui/react-input_v9.0.0-rc.2",
|
|
46
|
+
"version": "9.0.0-rc.2",
|
|
47
|
+
"comments": {
|
|
48
|
+
"prerelease": [
|
|
49
|
+
{
|
|
50
|
+
"author": "seanmonahan@microsoft.com",
|
|
51
|
+
"package": "@fluentui/react-input",
|
|
52
|
+
"commit": "1f5dc959ca89bb722fb9cea57b6880aedb5759aa",
|
|
53
|
+
"comment": "write readme"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "seanmonahan@microsoft.com",
|
|
57
|
+
"package": "@fluentui/react-input",
|
|
58
|
+
"commit": "bcafc0d8c2fdaa68473a317b6d179c5534257602",
|
|
59
|
+
"comment": "react-input: update appearance stories background contrast"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "martinhochel@microsoft.com",
|
|
63
|
+
"package": "@fluentui/react-input",
|
|
64
|
+
"commit": "692e6916819ee07a1dfb0d99ac2ffbdd0d75252f",
|
|
65
|
+
"comment": "feat: ship rolluped only dts"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "olfedias@microsoft.com",
|
|
69
|
+
"package": "@fluentui/react-input",
|
|
70
|
+
"commit": "f120fe9160ad7311a87af0cfacd8d2fb26275e34",
|
|
71
|
+
"comment": "chore: Update Griffel to latest version"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "seanmonahan@microsoft.com",
|
|
75
|
+
"package": "@fluentui/react-input",
|
|
76
|
+
"commit": "70164a1d13eb58eec6693f735029a8974b7aac70",
|
|
77
|
+
"comment": "Move from beta to release candidate."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "olfedias@microsoft.com",
|
|
81
|
+
"package": "@fluentui/react-input",
|
|
82
|
+
"commit": "60804cec07a495b8a5d1fc66338bf0443b212144",
|
|
83
|
+
"comment": "chore: Update Griffel to latest version"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-input",
|
|
88
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.8",
|
|
89
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-input",
|
|
94
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.9",
|
|
95
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-input",
|
|
100
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6",
|
|
101
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "@fluentui/react-input",
|
|
106
|
+
"comment": "Bump @fluentui/react-text to v9.0.0-rc.9",
|
|
107
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"date": "Thu, 05 May 2022 18:26:24 GMT",
|
|
114
|
+
"tag": "@fluentui/react-input_v9.0.0-beta.9",
|
|
115
|
+
"version": "9.0.0-beta.9",
|
|
116
|
+
"comments": {
|
|
117
|
+
"prerelease": [
|
|
118
|
+
{
|
|
119
|
+
"author": "gcox@microsoft.com",
|
|
120
|
+
"package": "@fluentui/react-input",
|
|
121
|
+
"commit": "7ba7e55a61136859e16222c67f82dd1f67da9af0",
|
|
122
|
+
"comment": "Updated to use new theme tokens"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"author": "beachball",
|
|
126
|
+
"package": "@fluentui/react-input",
|
|
127
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.7",
|
|
128
|
+
"commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "beachball",
|
|
132
|
+
"package": "@fluentui/react-input",
|
|
133
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.8",
|
|
134
|
+
"commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"author": "beachball",
|
|
138
|
+
"package": "@fluentui/react-input",
|
|
139
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.5",
|
|
140
|
+
"commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"date": "Wed, 04 May 2022 13:26:43 GMT",
|
|
6
147
|
"tag": "@fluentui/react-input_v9.0.0-beta.8",
|
|
7
148
|
"version": "9.0.0-beta.8",
|
|
8
149
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-input
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 23 May 2022 18:54:50 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.0.0-rc.3)
|
|
8
|
+
|
|
9
|
+
Mon, 23 May 2022 18:54:50 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.0.0-rc.2..@fluentui/react-input_v9.0.0-rc.3)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Removing <componentName>ClassName exports. ([PR #23092](https://github.com/microsoft/fluentui/pull/23092) by esteban.230@hotmail.com)
|
|
15
|
+
- BREAKING: update string unions to use spinal-case ([PR #23092](https://github.com/microsoft/fluentui/pull/23092) by seanmonahan@microsoft.com)
|
|
16
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.9 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
|
17
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.7 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
|
18
|
+
- Bump @fluentui/react-text to v9.0.0-rc.10 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.0.0-rc.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.0.0-rc.2)
|
|
21
|
+
|
|
22
|
+
Mon, 23 May 2022 12:14:17 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.0.0-beta.9..@fluentui/react-input_v9.0.0-rc.2)
|
|
24
|
+
|
|
25
|
+
### Changes
|
|
26
|
+
|
|
27
|
+
- write readme ([PR #22993](https://github.com/microsoft/fluentui/pull/22993) by seanmonahan@microsoft.com)
|
|
28
|
+
- react-input: update appearance stories background contrast ([PR #22966](https://github.com/microsoft/fluentui/pull/22966) by seanmonahan@microsoft.com)
|
|
29
|
+
- feat: ship rolluped only dts ([PR #22793](https://github.com/microsoft/fluentui/pull/22793) by martinhochel@microsoft.com)
|
|
30
|
+
- chore: Update Griffel to latest version ([PR #22894](https://github.com/microsoft/fluentui/pull/22894) by olfedias@microsoft.com)
|
|
31
|
+
- Move from beta to release candidate. ([PR #23090](https://github.com/microsoft/fluentui/pull/23090) by seanmonahan@microsoft.com)
|
|
32
|
+
- chore: Update Griffel to latest version ([PR #23029](https://github.com/microsoft/fluentui/pull/23029) by olfedias@microsoft.com)
|
|
33
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.8 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
34
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
35
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
36
|
+
- Bump @fluentui/react-text to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
37
|
+
|
|
38
|
+
## [9.0.0-beta.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.0.0-beta.9)
|
|
39
|
+
|
|
40
|
+
Thu, 05 May 2022 18:26:24 GMT
|
|
41
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.0.0-beta.8..@fluentui/react-input_v9.0.0-beta.9)
|
|
42
|
+
|
|
43
|
+
### Changes
|
|
44
|
+
|
|
45
|
+
- Updated to use new theme tokens ([PR #22836](https://github.com/microsoft/fluentui/pull/22836) by gcox@microsoft.com)
|
|
46
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.7 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
|
|
47
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.8 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
|
|
48
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.5 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
|
|
49
|
+
|
|
7
50
|
## [9.0.0-beta.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.0.0-beta.8)
|
|
8
51
|
|
|
9
|
-
Wed, 04 May 2022 13:
|
|
52
|
+
Wed, 04 May 2022 13:26:43 GMT
|
|
10
53
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.0.0-beta.7..@fluentui/react-input_v9.0.0-beta.8)
|
|
11
54
|
|
|
12
55
|
### Changes
|
package/README.md
CHANGED
|
@@ -3,3 +3,35 @@
|
|
|
3
3
|
**React Input components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
|
|
4
4
|
|
|
5
5
|
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
|
6
|
+
|
|
7
|
+
Inputs give people a way to enter and edit text.
|
|
8
|
+
|
|
9
|
+
### Usage
|
|
10
|
+
|
|
11
|
+
Import Input:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { Input } from '@fluentui/react-components';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
<Input defaultValue="Hello, World!" />
|
|
21
|
+
<Input value={value} onChange={onInputChange} />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See [Fluent UI Storybook](https://aka.ms/fluentui-storybook) for more detailed usage examples.
|
|
25
|
+
|
|
26
|
+
Alternatively, run Storybook locally with:
|
|
27
|
+
|
|
28
|
+
1. `yarn start`
|
|
29
|
+
2. Select `react-input` from the list.
|
|
30
|
+
|
|
31
|
+
### Specification
|
|
32
|
+
|
|
33
|
+
See [Spec.md](./Spec.md)
|
|
34
|
+
|
|
35
|
+
### Upgrade Guide
|
|
36
|
+
|
|
37
|
+
If you're upgrading to Fluent UI v9 see the upgrade guide in [Storybook](https://aka.ms/fluentui-storybook) under Concepts > Upgrading.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,11 +10,6 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const Input: ForwardRefComponent<InputProps>;
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `inputClassNames.root` instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare const inputClassName = "fui-Input";
|
|
17
|
-
|
|
18
13
|
export declare const inputClassNames: SlotClassNames<InputSlots>;
|
|
19
14
|
|
|
20
15
|
/**
|
|
@@ -37,7 +32,7 @@ export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input
|
|
|
37
32
|
* Controls the colors and borders of the input.
|
|
38
33
|
* @default 'outline'
|
|
39
34
|
*/
|
|
40
|
-
appearance?: 'outline' | 'underline' | '
|
|
35
|
+
appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
|
41
36
|
/**
|
|
42
37
|
* Default value of the input. Provide this if the input should be an uncontrolled component
|
|
43
38
|
* which tracks its current state internally; otherwise, use `value`.
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
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' | '
|
|
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,10 +1,5 @@
|
|
|
1
1
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
-
import { tokens } from '@fluentui/react-theme';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use `inputClassNames.root` instead.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const inputClassName = 'fui-Input';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
8
3
|
export const inputClassNames = {
|
|
9
4
|
root: 'fui-Input',
|
|
10
5
|
input: 'fui-Input__input',
|
|
@@ -12,32 +7,9 @@ export const inputClassNames = {
|
|
|
12
7
|
contentAfter: 'fui-Input__contentAfter'
|
|
13
8
|
}; // TODO(sharing) use theme values once available
|
|
14
9
|
|
|
15
|
-
const horizontalSpacing = {
|
|
16
|
-
xxs: '2px',
|
|
17
|
-
xs: '4px',
|
|
18
|
-
sNudge: '6px',
|
|
19
|
-
s: '8px',
|
|
20
|
-
mNudge: '10px',
|
|
21
|
-
m: '12px'
|
|
22
|
-
};
|
|
23
|
-
const motionDurations = {
|
|
24
|
-
ultraFast: '0.05s',
|
|
25
|
-
normal: '0.2s'
|
|
26
|
-
};
|
|
27
|
-
const motionCurves = {
|
|
28
|
-
accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',
|
|
29
|
-
decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)'
|
|
30
|
-
};
|
|
31
10
|
const contentSizes = {
|
|
32
|
-
// TODO
|
|
33
|
-
|
|
34
|
-
fontSize: tokens.fontSizeBase300,
|
|
35
|
-
lineHeight: tokens.lineHeightBase300
|
|
36
|
-
},
|
|
37
|
-
caption1: {
|
|
38
|
-
fontSize: tokens.fontSizeBase200,
|
|
39
|
-
lineHeight: tokens.lineHeightBase200
|
|
40
|
-
},
|
|
11
|
+
// TODO: This 400 style is not in the typography styles.
|
|
12
|
+
// May need a design change
|
|
41
13
|
400: {
|
|
42
14
|
fontSize: tokens.fontSizeBase400,
|
|
43
15
|
lineHeight: tokens.lineHeightBase400
|
|
@@ -55,8 +27,8 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
55
27
|
"mc9l5x": "ftuwxu6",
|
|
56
28
|
"Bt984gj": "f122n59",
|
|
57
29
|
"Eh141a": "flvyvdh",
|
|
58
|
-
"i8kkvl": "
|
|
59
|
-
"Belr9w4": "
|
|
30
|
+
"i8kkvl": "f14mj54c",
|
|
31
|
+
"Belr9w4": "fiut8dr",
|
|
60
32
|
"Bahqtrf": "fk6fouc",
|
|
61
33
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
62
34
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
@@ -81,12 +53,12 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
81
53
|
"Gjdm7m": "f13evtba",
|
|
82
54
|
"b1kco5": "f1yk9hq",
|
|
83
55
|
"Ba2ppi3": "fhwpy7i",
|
|
84
|
-
"F2fol1": "
|
|
85
|
-
"lck23g": "
|
|
56
|
+
"F2fol1": "f14ee0xe",
|
|
57
|
+
"lck23g": "f1xhbsuh",
|
|
86
58
|
"umuwi5": "fjw5xc1",
|
|
87
59
|
"Blcqepd": "f1xdyd5c",
|
|
88
|
-
"nplu4u": "
|
|
89
|
-
"Bioka5o": "
|
|
60
|
+
"nplu4u": "fatpbeo",
|
|
61
|
+
"Bioka5o": "fb7uyps",
|
|
90
62
|
"Bercvud": "f1ibeo51",
|
|
91
63
|
"Bbr2w1p": "f14a1fxs",
|
|
92
64
|
"Bduesf4": "f3e99gv",
|
|
@@ -95,31 +67,35 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
95
67
|
"small": {
|
|
96
68
|
"sshi5w": "f1pha7fy",
|
|
97
69
|
"z8tnut": "f1g0x7ka",
|
|
98
|
-
"z189sj": ["
|
|
70
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
99
71
|
"Byoj8tv": "f1qch9an",
|
|
100
|
-
"uwmqm3": ["
|
|
72
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
73
|
+
"Bahqtrf": "fk6fouc",
|
|
101
74
|
"Be2twd7": "fy9rknc",
|
|
75
|
+
"Bhrd7zp": "figsok6",
|
|
102
76
|
"Bg96gwp": "fwrc4pm"
|
|
103
77
|
},
|
|
104
78
|
"medium": {
|
|
105
79
|
"sshi5w": "f1nxs5xn",
|
|
106
80
|
"z8tnut": "f1g0x7ka",
|
|
107
|
-
"z189sj": ["
|
|
81
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
108
82
|
"Byoj8tv": "f1qch9an",
|
|
109
|
-
"uwmqm3": ["
|
|
83
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
84
|
+
"Bahqtrf": "fk6fouc",
|
|
110
85
|
"Be2twd7": "fkhj508",
|
|
86
|
+
"Bhrd7zp": "figsok6",
|
|
111
87
|
"Bg96gwp": "f1i3iumi"
|
|
112
88
|
},
|
|
113
89
|
"large": {
|
|
114
90
|
"sshi5w": "f1w5jphr",
|
|
115
91
|
"z8tnut": "f1g0x7ka",
|
|
116
|
-
"z189sj": ["
|
|
92
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
117
93
|
"Byoj8tv": "f1qch9an",
|
|
118
|
-
"uwmqm3": ["
|
|
94
|
+
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
119
95
|
"Be2twd7": "fod5ikn",
|
|
120
96
|
"Bg96gwp": "faaz57k",
|
|
121
|
-
"i8kkvl": "
|
|
122
|
-
"Belr9w4": "
|
|
97
|
+
"i8kkvl": "f1rjii52",
|
|
98
|
+
"Belr9w4": "f1r7g2jn"
|
|
123
99
|
},
|
|
124
100
|
"outline": {
|
|
125
101
|
"De3pzq": "fxugw4r",
|
|
@@ -185,10 +161,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
185
161
|
"nagaa4": "f1tpwn32",
|
|
186
162
|
"B1yhkcb": ["fsrcdbj", "f17blpuu"]
|
|
187
163
|
},
|
|
188
|
-
"
|
|
164
|
+
"filled-darker": {
|
|
189
165
|
"De3pzq": "f16xq7d1"
|
|
190
166
|
},
|
|
191
|
-
"
|
|
167
|
+
"filled-lighter": {
|
|
192
168
|
"De3pzq": "fxugw4r"
|
|
193
169
|
},
|
|
194
170
|
"disabled": {
|
|
@@ -216,10 +192,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
216
192
|
"n51gp8": ["f14g86mu", "f1rvyvqg"]
|
|
217
193
|
}
|
|
218
194
|
}, {
|
|
219
|
-
"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;}", ".
|
|
220
|
-
"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;}", ".
|
|
221
|
-
"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
|
|
222
|
-
"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);}"],
|
|
223
199
|
"t": ["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", "@media (forced-colors: active){.f1rvyvqg{border-right-color:GrayText;}.f14g86mu{border-left-color:GrayText;}}", "@media (forced-colors: active){.f1cwzwz{border-bottom-color:GrayText;}}", "@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}"]
|
|
224
200
|
});
|
|
225
201
|
|
|
@@ -233,9 +209,9 @@ const useInputElementStyles = /*#__PURE__*/__styles({
|
|
|
233
209
|
"oivjwe": "f1h8hb77",
|
|
234
210
|
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
235
211
|
"z8tnut": "f1g0x7ka",
|
|
236
|
-
"z189sj": ["
|
|
212
|
+
"z189sj": ["ffczdla", "fgiv446"],
|
|
237
213
|
"Byoj8tv": "f1qch9an",
|
|
238
|
-
"uwmqm3": ["
|
|
214
|
+
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
239
215
|
"sj55zd": "f19n0e5",
|
|
240
216
|
"De3pzq": "f3rmtva",
|
|
241
217
|
"yvdlaj": "fwyc1cq",
|
|
@@ -243,20 +219,24 @@ const useInputElementStyles = /*#__PURE__*/__styles({
|
|
|
243
219
|
"B486eqv": "f2hkw1w"
|
|
244
220
|
},
|
|
245
221
|
"small": {
|
|
222
|
+
"Bahqtrf": "fk6fouc",
|
|
246
223
|
"Be2twd7": "fy9rknc",
|
|
224
|
+
"Bhrd7zp": "figsok6",
|
|
247
225
|
"Bg96gwp": "fwrc4pm"
|
|
248
226
|
},
|
|
249
227
|
"medium": {
|
|
228
|
+
"Bahqtrf": "fk6fouc",
|
|
250
229
|
"Be2twd7": "fkhj508",
|
|
230
|
+
"Bhrd7zp": "figsok6",
|
|
251
231
|
"Bg96gwp": "f1i3iumi"
|
|
252
232
|
},
|
|
253
233
|
"large": {
|
|
254
234
|
"Be2twd7": "fod5ikn",
|
|
255
235
|
"Bg96gwp": "faaz57k",
|
|
256
236
|
"z8tnut": "f1g0x7ka",
|
|
257
|
-
"z189sj": ["
|
|
237
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
258
238
|
"Byoj8tv": "f1qch9an",
|
|
259
|
-
"uwmqm3": ["
|
|
239
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"]
|
|
260
240
|
},
|
|
261
241
|
"disabled": {
|
|
262
242
|
"sj55zd": "f1s2aq7o",
|
|
@@ -265,7 +245,7 @@ const useInputElementStyles = /*#__PURE__*/__styles({
|
|
|
265
245
|
"yvdlaj": "fahhnxm"
|
|
266
246
|
}
|
|
267
247
|
}, {
|
|
268
|
-
"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;}", ".
|
|
248
|
+
"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;}", ".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);}"],
|
|
269
249
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
270
250
|
});
|
|
271
251
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Input/useInputStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,GAAG,WAAvB;AACP,OAAO,MAAM,eAAe,GAA+B;AACzD,EAAA,IAAI,EAAE,WADmD;AAEzD,EAAA,KAAK,EAAE,kBAFkD;AAGzD,EAAA,aAAa,EAAE,0BAH0C;AAIzD,EAAA,YAAY,EAAE;AAJ2C,CAApD,C,CAOP;;AACA,MAAM,iBAAiB,GAAG;AACxB,EAAA,GAAG,EAAE,KADmB;AAExB,EAAA,EAAE,EAAE,KAFoB;AAGxB,EAAA,MAAM,EAAE,KAHgB;AAIxB,EAAA,CAAC,EAAE,KAJqB;AAKxB,EAAA,MAAM,EAAE,MALgB;AAMxB,EAAA,CAAC,EAAE;AANqB,CAA1B;AAQA,MAAM,eAAe,GAAG;AACtB,EAAA,SAAS,EAAE,OADW;AAEtB,EAAA,MAAM,EAAE;AAFc,CAAxB;AAIA,MAAM,YAAY,GAAG;AACnB,EAAA,aAAa,EAAE,2BADI;AAEnB,EAAA,aAAa,EAAE;AAFI,CAArB;AAIA,MAAM,YAAY,GAAG;AACnB;AACA,EAAA,KAAK,EAAE;AACL,IAAA,QAAQ,EAAE,MAAM,CAAC,eADZ;AAEL,IAAA,UAAU,EAAE,MAAM,CAAC;AAFd,GAFY;AAMnB,EAAA,QAAQ,EAAE;AACR,IAAA,QAAQ,EAAE,MAAM,CAAC,eADT;AA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IAAa,UAAU,KAAK,WAA5B,IAA2C,UAAU,CAAC,oBAPrB,EAQjC,CAAC,QAAD,IAAa,MAAb,IAAuB,UAAU,CAAC,iBARD,EASjC,MAAM,IAAI,UAAU,CAAC,MATY,EAUjC,QAAQ,IAAI,UAAU,CAAC,QAVU,EAWjC,KAAK,CAAC,IAAN,CAAW,SAXsB,CAAnC;AAcA,EAAA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,YAAY,CAClC,eAAe,CAAC,KADkB,EAElC,WAAW,CAAC,IAFsB,EAGlC,WAAW,CAAC,IAAD,CAHuB,EAIlC,QAAQ,IAAI,WAAW,CAAC,QAJU,EAKlC,KAAK,CAAC,KAAN,CAAY,SALsB,CAApC;AAQA,QAAM,cAAc,GAAG,CAAC,aAAa,CAAC,IAAf,EAAqB,QAAQ,IAAI,aAAa,CAAC,QAA/C,EAAyD,aAAa,CAAC,IAAD,CAAtE,CAAvB;;AACA,MAAI,KAAK,CAAC,aAAV,EAAyB;AACvB,IAAA,KAAK,CAAC,aAAN,CAAoB,SAApB,GAAgC,YAAY,CAC1C,eAAe,CAAC,aAD0B,EAE1C,GAAG,cAFuC,EAG1C,KAAK,CAAC,aAAN,CAAoB,SAHsB,CAA5C;AAKD;;AACD,MAAI,KAAK,CAAC,YAAV,EAAwB;AACtB,IAAA,KAAK,CAAC,YAAN,CAAmB,SAAnB,GAA+B,YAAY,CACzC,eAAe,CAAC,YADyB,EAEzC,GAAG,cAFsC,EAGzC,KAAK,CAAC,YAAN,CAAmB,SAHsB,CAA3C;AAKD;;AAED,SAAO,KAAP;AACD,CAhDM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { InputSlots, InputState } from './Input.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `inputClassNames.root` instead.\n */\nexport const inputClassName = 'fui-Input';\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) use theme values once available\nconst horizontalSpacing = {\n xxs: '2px',\n xs: '4px',\n sNudge: '6px',\n s: '8px',\n mNudge: '10px',\n m: '12px',\n};\nconst motionDurations = {\n ultraFast: '0.05s',\n normal: '0.2s',\n};\nconst motionCurves = {\n accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',\n decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)',\n};\nconst contentSizes = {\n // TODO(sharing) shouldn't these be in the theme?\n body1: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n caption1: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n ...shorthands.gap(horizontalSpacing.xxs),\n fontFamily: tokens.fontFamilyBase,\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n },\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(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 ...shorthands.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: motionDurations.ultraFast,\n transitionDelay: motionCurves.accelerateMid,\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: motionDurations.normal,\n transitionDelay: motionCurves.decelerateMid,\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n small: {\n minHeight: fieldHeights.small,\n ...shorthands.padding('0', horizontalSpacing.sNudge),\n ...contentSizes.caption1,\n },\n medium: {\n minHeight: fieldHeights.medium,\n ...shorthands.padding('0', horizontalSpacing.mNudge),\n ...contentSizes.body1,\n },\n large: {\n minHeight: fieldHeights.large,\n ...shorthands.padding('0', horizontalSpacing.m),\n ...contentSizes[400],\n ...shorthands.gap(horizontalSpacing.sNudge),\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\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 ...shorthands.borderRadius(0), // corners look strange if rounded\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\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': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n boxShadow: tokens.shadow2, // optional shadow for filled appearances\n ...shorthands.border('1px', 'solid', 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 filledDarker: {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n filledLighter: {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // because underline doesn't usually have a radius\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n});\n\nconst useInputElementStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n ...shorthands.borderStyle('none'), // input itself never has a border (this is handled by inputWrapper)\n ...shorthands.padding('0', horizontalSpacing.xxs),\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 ':focus-visible': {\n outlineStyle: 'none', // disable default browser outline\n },\n },\n small: {\n // This is set on root but doesn't inherit\n ...contentSizes.caption1,\n },\n medium: {\n ...contentSizes.body1,\n },\n large: {\n ...contentSizes[400],\n ...shorthands.padding('0', horizontalSpacing.sNudge),\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 useContentStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n // special case styling for icons (most common case) to ensure they're centered vertically\n '> svg': { display: 'block' },\n },\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 '> svg': { fontSize: '20px' },\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 const { size, appearance } = state;\n const disabled = state.input.disabled;\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 rootStyles.base,\n rootStyles[size],\n rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n inputStyles.base,\n inputStyles[size],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [contentStyles.base, 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"],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SAAnB,GAA+B,YAAY,CACzC,eAAe,CAAC,YADyB,EAEzC,GAAG,cAFsC,EAGzC,KAAK,CAAC,YAAN,CAAmB,SAHsB,CAA3C;AAKD;;AAED,SAAO,KAAP;AACD,CAhDM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { InputSlots, InputState } from './Input.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\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) use theme values once available\nconst contentSizes = {\n // TODO: This 400 style is not in the typography styles.\n // May need a design change\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n ...shorthands.gap(tokens.spacingHorizontalXXS),\n fontFamily: tokens.fontFamilyBase,\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n },\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(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 ...shorthands.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 ':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 ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n small: {\n minHeight: fieldHeights.small,\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption1,\n },\n medium: {\n minHeight: fieldHeights.medium,\n ...shorthands.padding('0', tokens.spacingHorizontalMNudge),\n ...typographyStyles.body1,\n },\n large: {\n minHeight: fieldHeights.large,\n ...shorthands.padding('0', tokens.spacingHorizontalM),\n ...contentSizes[400],\n ...shorthands.gap(tokens.spacingHorizontalSNudge),\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\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 ...shorthands.borderRadius(0), // corners look strange if rounded\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\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': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n boxShadow: tokens.shadow2, // optional shadow for filled appearances\n ...shorthands.border('1px', 'solid', 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 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // because underline doesn't usually have a radius\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n});\n\nconst useInputElementStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n ...shorthands.borderStyle('none'), // input itself never has a border (this is handled by inputWrapper)\n ...shorthands.padding('0', tokens.spacingHorizontalXXS),\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 ':focus-visible': {\n outlineStyle: 'none', // disable default browser outline\n },\n },\n small: {\n // This is set on root but doesn't inherit\n ...typographyStyles.caption1,\n },\n medium: {\n ...typographyStyles.body1,\n },\n large: {\n ...contentSizes[400],\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\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 useContentStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n // special case styling for icons (most common case) to ensure they're centered vertically\n '> svg': { display: 'block' },\n },\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 '> svg': { fontSize: '20px' },\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 const { size, appearance } = state;\n const disabled = state.input.disabled;\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 rootStyles.base,\n rootStyles[size],\n rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n inputStyles.base,\n inputStyles[size],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [contentStyles.base, 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"],"sourceRoot":"../src/"}
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { Input,
|
|
2
|
-
inputClassName, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';
|
|
1
|
+
export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';
|
|
3
2
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"]}
|