@fluentui/react-input 9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.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.md +18 -9
- package/README.md +12 -1
- package/lib/components/Input/Input.module.css +307 -0
- package/lib/components/Input/useInputStyles.styles.css.js +20 -0
- package/lib/components/Input/useInputStyles.styles.css.js.map +1 -0
- package/lib/components/Input/useInputStyles.styles.raw.css.js +20 -0
- package/lib/components/Input/useInputStyles.styles.raw.css.js.map +1 -0
- package/lib-commonjs/components/Input/Input.module.css +307 -0
- package/lib-commonjs/components/Input/useInputStyles.styles.css.cjs +39 -0
- package/lib-commonjs/components/Input/useInputStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Input/useInputStyles.styles.raw.css.cjs +39 -0
- package/lib-commonjs/components/Input/useInputStyles.styles.raw.css.cjs.map +1 -0
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-input
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Nov 2026 20:37:15 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.75.
|
|
7
|
+
## [9.75.2-experimental.css-modules.20261113-ba13c87438.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fri, 13 Nov 2026 20:37:15 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.8.9..@fluentui/react-input_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
10
11
|
|
|
11
12
|
### Changes
|
|
12
13
|
|
|
13
|
-
- Release 9.75.
|
|
14
|
-
- Bump @fluentui/react-field to v9.75.
|
|
15
|
-
- Bump @fluentui/react-jsx-runtime to v9.75.
|
|
16
|
-
- Bump @fluentui/react-shared-contexts to v9.75.
|
|
17
|
-
- Bump @fluentui/react-theme to v9.75.
|
|
18
|
-
- Bump @fluentui/react-utilities to v9.75.
|
|
14
|
+
- Release 9.75.2-experimental.css-modules.20261113-ba13c87438 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/react-field to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
|
|
21
|
+
## [9.8.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.8.9)
|
|
22
|
+
|
|
23
|
+
Tue, 10 Nov 2026 16:50:23 GMT
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- fix: apply icon sizing and layout styles to font glyphs as well as SVG icons ([PR #36958](https://github.com/microsoft/fluentui/pull/36958) by martinhochel@microsoft.com)
|
|
19
28
|
|
|
20
29
|
## [9.8.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.8.8)
|
|
21
30
|
|
package/README.md
CHANGED
|
@@ -28,8 +28,19 @@ Alternatively, run Storybook locally with:
|
|
|
28
28
|
|
|
29
29
|
### Specification
|
|
30
30
|
|
|
31
|
-
See [Spec.md](./Spec.md)
|
|
31
|
+
See [Spec.md](./docs/Spec.md)
|
|
32
32
|
|
|
33
33
|
### Upgrade Guide
|
|
34
34
|
|
|
35
35
|
If you're upgrading to Fluent UI v9 see the upgrade guide in [Storybook](https://react.fluentui.dev/) under Concepts > Upgrading.
|
|
36
|
+
|
|
37
|
+
## Opt-in CSS Modules styles
|
|
38
|
+
|
|
39
|
+
The `use*Styles.styles.css` modules beside the existing Griffel hooks provide opt-in,
|
|
40
|
+
CSS alternatives with the same exports. Configure the bundler to replace
|
|
41
|
+
`.styles` with `.styles.css.ts` for source imports and `.styles.js` with
|
|
42
|
+
`.styles.css.js` for built imports. Load CSS Modules as default class-name maps and
|
|
43
|
+
retain the package CSS assets. Default component imports still use Griffel.
|
|
44
|
+
Composed components require their own style alternatives; this does not remove
|
|
45
|
+
all reachable Griffel dependencies. Browser, forced-colors, RTL, and visual-regression
|
|
46
|
+
parity must be validated before switching defaults.
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/* @griffel-buckets reset: .root, .input, .contentBefore, .contentAfter */
|
|
2
|
+
.root {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
gap: var(--spacingHorizontalXXS);
|
|
7
|
+
border-radius: var(--borderRadiusMedium);
|
|
8
|
+
position: relative;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
min-height: var(--spacingVerticalXXXL);
|
|
12
|
+
font-family: var(--fontFamilyBase);
|
|
13
|
+
font-size: var(--fontSizeBase300);
|
|
14
|
+
font-weight: var(--fontWeightRegular);
|
|
15
|
+
line-height: var(--lineHeightBase300);
|
|
16
|
+
background-color: var(--colorNeutralBackground1);
|
|
17
|
+
border: var(--strokeWidthThin) solid var(--colorNeutralStroke1);
|
|
18
|
+
border-bottom-color: var(--colorNeutralStrokeAccessible);
|
|
19
|
+
&::after {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset-inline-start: calc(0px - var(--strokeWidthThin));
|
|
24
|
+
bottom: calc(0px - var(--strokeWidthThin));
|
|
25
|
+
inset-inline-end: calc(0px - var(--strokeWidthThin));
|
|
26
|
+
height: max(var(--strokeWidthThick), var(--borderRadiusMedium));
|
|
27
|
+
border-end-start-radius: var(--borderRadiusMedium);
|
|
28
|
+
border-end-end-radius: var(--borderRadiusMedium);
|
|
29
|
+
border-bottom: var(--strokeWidthThick) solid var(--colorCompoundBrandStroke);
|
|
30
|
+
clip-path: inset(calc(100% - var(--strokeWidthThick)) 0 0 0);
|
|
31
|
+
transform: scaleX(0);
|
|
32
|
+
transition-property: transform;
|
|
33
|
+
transition-duration: var(--durationUltraFast);
|
|
34
|
+
transition-delay: var(--curveAccelerateMid);
|
|
35
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
36
|
+
transition-duration: 0.01ms;
|
|
37
|
+
transition-delay: 0.01ms;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus-within::after {
|
|
42
|
+
transform: scaleX(1);
|
|
43
|
+
transition-property: transform;
|
|
44
|
+
transition-duration: var(--durationNormal);
|
|
45
|
+
transition-delay: var(--curveDecelerateMid);
|
|
46
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
47
|
+
transition-duration: 0.01ms;
|
|
48
|
+
transition-delay: 0.01ms;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:focus-within:active::after {
|
|
53
|
+
border-bottom-color: var(--colorCompoundBrandStrokePressed);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:focus-within {
|
|
57
|
+
outline: var(--strokeWidthThick) solid transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.root:where(.small) {
|
|
62
|
+
min-height: var(--spacingHorizontalXXL);
|
|
63
|
+
font-family: var(--fontFamilyBase);
|
|
64
|
+
font-size: var(--fontSizeBase200);
|
|
65
|
+
font-weight: var(--fontWeightRegular);
|
|
66
|
+
line-height: var(--lineHeightBase200);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.root:where(.large) {
|
|
70
|
+
min-height: calc(var(--spacingVerticalXXL) + var(--spacingVerticalL));
|
|
71
|
+
font-family: var(--fontFamilyBase);
|
|
72
|
+
font-size: var(--fontSizeBase400);
|
|
73
|
+
font-weight: var(--fontWeightRegular);
|
|
74
|
+
line-height: var(--lineHeightBase400);
|
|
75
|
+
gap: var(--spacingHorizontalSNudge);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.root:where(.underline) {
|
|
79
|
+
background-color: var(--colorTransparentBackground);
|
|
80
|
+
border-radius: 0;
|
|
81
|
+
border-top-style: none;
|
|
82
|
+
border-inline-end-style: none;
|
|
83
|
+
border-inline-start-style: none;
|
|
84
|
+
&::after {
|
|
85
|
+
inset-inline-start: 0;
|
|
86
|
+
inset-inline-end: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.root:where(.filled-darker) {
|
|
91
|
+
background-color: var(--colorNeutralBackground3);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.root:where(.filled-lighter) {
|
|
95
|
+
background-color: var(--colorNeutralBackground1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.root:where(.filled-darker-shadow) {
|
|
99
|
+
background-color: var(--colorNeutralBackground3);
|
|
100
|
+
box-shadow: var(--shadow2);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.root:where(.filled-lighter-shadow) {
|
|
104
|
+
background-color: var(--colorNeutralBackground1);
|
|
105
|
+
box-shadow: var(--shadow2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.root:where(.outline:not(.disabled)) {
|
|
109
|
+
&:hover {
|
|
110
|
+
border-top-color: var(--colorNeutralStroke1Hover);
|
|
111
|
+
border-inline-end-color: var(--colorNeutralStroke1Hover);
|
|
112
|
+
border-bottom-color: var(--colorNeutralStrokeAccessibleHover);
|
|
113
|
+
border-inline-start-color: var(--colorNeutralStroke1Hover);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus-within {
|
|
118
|
+
border-top-color: var(--colorNeutralStroke1Pressed);
|
|
119
|
+
border-inline-end-color: var(--colorNeutralStroke1Pressed);
|
|
120
|
+
border-bottom-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
121
|
+
border-inline-start-color: var(--colorNeutralStroke1Pressed);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.root:where(.underline:not(.disabled)) {
|
|
126
|
+
&:hover {
|
|
127
|
+
border-bottom-color: var(--colorNeutralStrokeAccessibleHover);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:active,
|
|
131
|
+
&:focus-within {
|
|
132
|
+
border-bottom-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&::after {
|
|
136
|
+
border-radius: 0;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.root:where(.filled:not(.disabled)) {
|
|
141
|
+
&:hover,
|
|
142
|
+
&:focus-within {
|
|
143
|
+
border-top-color: var(--colorTransparentStrokeInteractive);
|
|
144
|
+
border-inline-end-color: var(--colorTransparentStrokeInteractive);
|
|
145
|
+
border-bottom-color: var(--colorTransparentStrokeInteractive);
|
|
146
|
+
border-inline-start-color: var(--colorTransparentStrokeInteractive);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.root:where(.filled) {
|
|
151
|
+
border-top-color: var(--colorTransparentStroke);
|
|
152
|
+
border-inline-end-color: var(--colorTransparentStroke);
|
|
153
|
+
border-bottom-color: var(--colorTransparentStroke);
|
|
154
|
+
border-inline-start-color: var(--colorTransparentStroke);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.root:where(.invalid:not(.disabled)) {
|
|
158
|
+
&:not(:focus-within),
|
|
159
|
+
&:hover:not(:focus-within) {
|
|
160
|
+
border-top-color: var(--colorPaletteRedBorder2);
|
|
161
|
+
border-inline-end-color: var(--colorPaletteRedBorder2);
|
|
162
|
+
border-bottom-color: var(--colorPaletteRedBorder2);
|
|
163
|
+
border-inline-start-color: var(--colorPaletteRedBorder2);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.root:where(.disabled) {
|
|
168
|
+
cursor: not-allowed;
|
|
169
|
+
background-color: var(--colorTransparentBackground);
|
|
170
|
+
border-top-color: var(--colorNeutralStrokeDisabled);
|
|
171
|
+
border-inline-end-color: var(--colorNeutralStrokeDisabled);
|
|
172
|
+
border-bottom-color: var(--colorNeutralStrokeDisabled);
|
|
173
|
+
border-inline-start-color: var(--colorNeutralStrokeDisabled);
|
|
174
|
+
&::after {
|
|
175
|
+
content: unset;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:focus-within {
|
|
179
|
+
outline-style: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@media (forced-colors: active) {
|
|
183
|
+
border-top-color: GrayText;
|
|
184
|
+
border-inline-end-color: GrayText;
|
|
185
|
+
border-bottom-color: GrayText;
|
|
186
|
+
border-inline-start-color: GrayText;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.root:where(.small.withContentBefore) {
|
|
191
|
+
padding-inline-start: var(--spacingHorizontalSNudge);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.root:where(.small.withContentAfter) {
|
|
195
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.root:where(.medium.withContentBefore) {
|
|
199
|
+
padding-inline-start: var(--spacingHorizontalMNudge);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.root:where(.medium.withContentAfter) {
|
|
203
|
+
padding-inline-end: var(--spacingHorizontalMNudge);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.root:where(.large.withContentBefore) {
|
|
207
|
+
padding-inline-start: var(--spacingHorizontalM);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.root:where(.large.withContentAfter) {
|
|
211
|
+
padding-inline-end: var(--spacingHorizontalM);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.input {
|
|
215
|
+
align-self: stretch;
|
|
216
|
+
box-sizing: border-box;
|
|
217
|
+
flex-grow: 1;
|
|
218
|
+
min-width: 0;
|
|
219
|
+
border-style: none;
|
|
220
|
+
padding: 0 var(--spacingHorizontalM);
|
|
221
|
+
color: var(--colorNeutralForeground1);
|
|
222
|
+
background-color: transparent;
|
|
223
|
+
outline-style: none;
|
|
224
|
+
font-family: inherit;
|
|
225
|
+
font-size: inherit;
|
|
226
|
+
font-weight: inherit;
|
|
227
|
+
line-height: inherit;
|
|
228
|
+
&::placeholder {
|
|
229
|
+
color: var(--colorNeutralForeground4);
|
|
230
|
+
opacity: 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:where(.small) > .input {
|
|
235
|
+
padding-inline-start: var(--spacingHorizontalS);
|
|
236
|
+
padding-inline-end: var(--spacingHorizontalS);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:where(.large) > .input {
|
|
240
|
+
padding-inline-start: calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));
|
|
241
|
+
padding-inline-end: calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:where(.disabled) > .input {
|
|
245
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
246
|
+
background-color: var(--colorTransparentBackground);
|
|
247
|
+
cursor: not-allowed;
|
|
248
|
+
&::placeholder {
|
|
249
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
:where(.small.withContentBefore) > .input {
|
|
254
|
+
padding-inline-start: var(--spacingHorizontalXXS);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
:where(.small.withContentAfter) > .input {
|
|
258
|
+
padding-inline-end: var(--spacingHorizontalXXS);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:where(.medium.withContentBefore) > .input {
|
|
262
|
+
padding-inline-start: var(--spacingHorizontalXXS);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:where(.medium.withContentAfter) > .input {
|
|
266
|
+
padding-inline-end: var(--spacingHorizontalXXS);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:where(.large.withContentBefore) > .input {
|
|
270
|
+
padding-inline-start: var(--spacingHorizontalSNudge);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:where(.large.withContentAfter) > .input {
|
|
274
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.contentBefore,
|
|
278
|
+
.contentAfter {
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
color: var(--colorNeutralForeground3);
|
|
281
|
+
display: flex;
|
|
282
|
+
& > svg,
|
|
283
|
+
& > :global(.fui-Icon-font) {
|
|
284
|
+
font-size: var(--fontSizeBase500);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
:where(.disabled) > .contentBefore,
|
|
289
|
+
:where(.disabled) > .contentAfter {
|
|
290
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:where(.small) > .contentBefore,
|
|
294
|
+
:where(.small) > .contentAfter {
|
|
295
|
+
& > svg,
|
|
296
|
+
& > :global(.fui-Icon-font) {
|
|
297
|
+
font-size: var(--fontSizeBase400);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
:where(.large) > .contentBefore,
|
|
302
|
+
:where(.large) > .contentAfter {
|
|
303
|
+
& > svg,
|
|
304
|
+
& > :global(.fui-Icon-font) {
|
|
305
|
+
font-size: var(--fontSizeBase600);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Input.module.css";
|
|
3
|
+
export const inputClassNames = {
|
|
4
|
+
root: 'fui-Input',
|
|
5
|
+
input: 'fui-Input__input',
|
|
6
|
+
contentBefore: 'fui-Input__contentBefore',
|
|
7
|
+
contentAfter: 'fui-Input__contentAfter'
|
|
8
|
+
};
|
|
9
|
+
export const useInputStyles_unstable = (state)=>{
|
|
10
|
+
const { size, appearance } = state;
|
|
11
|
+
state.root.className = clsx(inputClassNames.root, styles.root, styles[size], styles[appearance], appearance.startsWith('filled') && styles.filled, state.input.disabled && styles.disabled, `${state.input['aria-invalid']}` === 'true' && styles.invalid, state.contentBefore && styles.withContentBefore, state.contentAfter && styles.withContentAfter, state.root.className);
|
|
12
|
+
state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);
|
|
13
|
+
if (state.contentBefore) {
|
|
14
|
+
state.contentBefore.className = clsx(inputClassNames.contentBefore, styles.contentBefore, state.contentBefore.className);
|
|
15
|
+
}
|
|
16
|
+
if (state.contentAfter) {
|
|
17
|
+
state.contentAfter.className = clsx(inputClassNames.contentAfter, styles.contentAfter, state.contentAfter.className);
|
|
18
|
+
}
|
|
19
|
+
return state;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Input/useInputStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\nimport styles from './Input.module.css';\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\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n state.root.className = clsx(\n inputClassNames.root,\n styles.root,\n styles[size],\n styles[appearance],\n appearance.startsWith('filled') && styles.filled,\n state.input.disabled && styles.disabled,\n `${state.input['aria-invalid']}` === 'true' && styles.invalid,\n state.contentBefore && styles.withContentBefore,\n state.contentAfter && styles.withContentAfter,\n state.root.className,\n );\n state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);\n if (state.contentBefore) {\n state.contentBefore.className = clsx(\n inputClassNames.contentBefore,\n styles.contentBefore,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = clsx(\n inputClassNames.contentAfter,\n styles.contentAfter,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","inputClassNames","root","input","contentBefore","contentAfter","useInputStyles_unstable","state","size","appearance","className","startsWith","filled","disabled","invalid","withContentBefore","withContentAfter"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,qBAAqB;AAExC,OAAO,MAAMC,kBAA8C;IACzDC,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEF,OAAO,MAAMC,0BAA0B,CAACC;IACtC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGF;IAC7BA,MAAML,IAAI,CAACQ,SAAS,GAAGX,KACrBE,gBAAgBC,IAAI,EACpBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,KAAK,EACZR,MAAM,CAACS,WAAW,EAClBA,WAAWE,UAAU,CAAC,aAAaX,OAAOY,MAAM,EAChDL,MAAMJ,KAAK,CAACU,QAAQ,IAAIb,OAAOa,QAAQ,EACvC,GAAGN,MAAMJ,KAAK,CAAC,eAAe,EAAE,KAAK,UAAUH,OAAOc,OAAO,EAC7DP,MAAMH,aAAa,IAAIJ,OAAOe,iBAAiB,EAC/CR,MAAMF,YAAY,IAAIL,OAAOgB,gBAAgB,EAC7CT,MAAML,IAAI,CAACQ,SAAS;IAEtBH,MAAMJ,KAAK,CAACO,SAAS,GAAGX,KAAKE,gBAAgBE,KAAK,EAAEH,OAAOG,KAAK,EAAEI,MAAMJ,KAAK,CAACO,SAAS;IACvF,IAAIH,MAAMH,aAAa,EAAE;QACvBG,MAAMH,aAAa,CAACM,SAAS,GAAGX,KAC9BE,gBAAgBG,aAAa,EAC7BJ,OAAOI,aAAa,EACpBG,MAAMH,aAAa,CAACM,SAAS;IAEjC;IACA,IAAIH,MAAMF,YAAY,EAAE;QACtBE,MAAMF,YAAY,CAACK,SAAS,GAAGX,KAC7BE,gBAAgBI,YAAY,EAC5BL,OAAOK,YAAY,EACnBE,MAAMF,YAAY,CAACK,SAAS;IAEhC;IAEA,OAAOH;AACT,EAAE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Input.module.css";
|
|
3
|
+
export const inputClassNames = {
|
|
4
|
+
root: 'fui-Input',
|
|
5
|
+
input: 'fui-Input__input',
|
|
6
|
+
contentBefore: 'fui-Input__contentBefore',
|
|
7
|
+
contentAfter: 'fui-Input__contentAfter'
|
|
8
|
+
};
|
|
9
|
+
export const useInputStyles_unstable = (state)=>{
|
|
10
|
+
const { size, appearance } = state;
|
|
11
|
+
state.root.className = clsx(inputClassNames.root, styles.root, styles[size], styles[appearance], appearance.startsWith('filled') && styles.filled, state.input.disabled && styles.disabled, `${state.input['aria-invalid']}` === 'true' && styles.invalid, state.contentBefore && styles.withContentBefore, state.contentAfter && styles.withContentAfter, state.root.className);
|
|
12
|
+
state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);
|
|
13
|
+
if (state.contentBefore) {
|
|
14
|
+
state.contentBefore.className = clsx(inputClassNames.contentBefore, styles.contentBefore, state.contentBefore.className);
|
|
15
|
+
}
|
|
16
|
+
if (state.contentAfter) {
|
|
17
|
+
state.contentAfter.className = clsx(inputClassNames.contentAfter, styles.contentAfter, state.contentAfter.className);
|
|
18
|
+
}
|
|
19
|
+
return state;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Input/useInputStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\nimport styles from './Input.module.css';\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\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n state.root.className = clsx(\n inputClassNames.root,\n styles.root,\n styles[size],\n styles[appearance],\n appearance.startsWith('filled') && styles.filled,\n state.input.disabled && styles.disabled,\n `${state.input['aria-invalid']}` === 'true' && styles.invalid,\n state.contentBefore && styles.withContentBefore,\n state.contentAfter && styles.withContentAfter,\n state.root.className,\n );\n state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);\n if (state.contentBefore) {\n state.contentBefore.className = clsx(\n inputClassNames.contentBefore,\n styles.contentBefore,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = clsx(\n inputClassNames.contentAfter,\n styles.contentAfter,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","inputClassNames","root","input","contentBefore","contentAfter","useInputStyles_unstable","state","size","appearance","className","startsWith","filled","disabled","invalid","withContentBefore","withContentAfter"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,qBAAqB;AAExC,OAAO,MAAMC,kBAA8C;IACzDC,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEF,OAAO,MAAMC,0BAA0B,CAACC;IACtC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGF;IAC7BA,MAAML,IAAI,CAACQ,SAAS,GAAGX,KACrBE,gBAAgBC,IAAI,EACpBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,KAAK,EACZR,MAAM,CAACS,WAAW,EAClBA,WAAWE,UAAU,CAAC,aAAaX,OAAOY,MAAM,EAChDL,MAAMJ,KAAK,CAACU,QAAQ,IAAIb,OAAOa,QAAQ,EACvC,GAAGN,MAAMJ,KAAK,CAAC,eAAe,EAAE,KAAK,UAAUH,OAAOc,OAAO,EAC7DP,MAAMH,aAAa,IAAIJ,OAAOe,iBAAiB,EAC/CR,MAAMF,YAAY,IAAIL,OAAOgB,gBAAgB,EAC7CT,MAAML,IAAI,CAACQ,SAAS;IAEtBH,MAAMJ,KAAK,CAACO,SAAS,GAAGX,KAAKE,gBAAgBE,KAAK,EAAEH,OAAOG,KAAK,EAAEI,MAAMJ,KAAK,CAACO,SAAS;IACvF,IAAIH,MAAMH,aAAa,EAAE;QACvBG,MAAMH,aAAa,CAACM,SAAS,GAAGX,KAC9BE,gBAAgBG,aAAa,EAC7BJ,OAAOI,aAAa,EACpBG,MAAMH,aAAa,CAACM,SAAS;IAEjC;IACA,IAAIH,MAAMF,YAAY,EAAE;QACtBE,MAAMF,YAAY,CAACK,SAAS,GAAGX,KAC7BE,gBAAgBI,YAAY,EAC5BL,OAAOK,YAAY,EACnBE,MAAMF,YAAY,CAACK,SAAS;IAEhC;IAEA,OAAOH;AACT,EAAE"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/* @griffel-buckets reset: .root, .input, .contentBefore, .contentAfter */
|
|
2
|
+
.root {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
gap: var(--spacingHorizontalXXS);
|
|
7
|
+
border-radius: var(--borderRadiusMedium);
|
|
8
|
+
position: relative;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
min-height: var(--spacingVerticalXXXL);
|
|
12
|
+
font-family: var(--fontFamilyBase);
|
|
13
|
+
font-size: var(--fontSizeBase300);
|
|
14
|
+
font-weight: var(--fontWeightRegular);
|
|
15
|
+
line-height: var(--lineHeightBase300);
|
|
16
|
+
background-color: var(--colorNeutralBackground1);
|
|
17
|
+
border: var(--strokeWidthThin) solid var(--colorNeutralStroke1);
|
|
18
|
+
border-bottom-color: var(--colorNeutralStrokeAccessible);
|
|
19
|
+
&::after {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset-inline-start: calc(0px - var(--strokeWidthThin));
|
|
24
|
+
bottom: calc(0px - var(--strokeWidthThin));
|
|
25
|
+
inset-inline-end: calc(0px - var(--strokeWidthThin));
|
|
26
|
+
height: max(var(--strokeWidthThick), var(--borderRadiusMedium));
|
|
27
|
+
border-end-start-radius: var(--borderRadiusMedium);
|
|
28
|
+
border-end-end-radius: var(--borderRadiusMedium);
|
|
29
|
+
border-bottom: var(--strokeWidthThick) solid var(--colorCompoundBrandStroke);
|
|
30
|
+
clip-path: inset(calc(100% - var(--strokeWidthThick)) 0 0 0);
|
|
31
|
+
transform: scaleX(0);
|
|
32
|
+
transition-property: transform;
|
|
33
|
+
transition-duration: var(--durationUltraFast);
|
|
34
|
+
transition-delay: var(--curveAccelerateMid);
|
|
35
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
36
|
+
transition-duration: 0.01ms;
|
|
37
|
+
transition-delay: 0.01ms;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus-within::after {
|
|
42
|
+
transform: scaleX(1);
|
|
43
|
+
transition-property: transform;
|
|
44
|
+
transition-duration: var(--durationNormal);
|
|
45
|
+
transition-delay: var(--curveDecelerateMid);
|
|
46
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
47
|
+
transition-duration: 0.01ms;
|
|
48
|
+
transition-delay: 0.01ms;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:focus-within:active::after {
|
|
53
|
+
border-bottom-color: var(--colorCompoundBrandStrokePressed);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:focus-within {
|
|
57
|
+
outline: var(--strokeWidthThick) solid transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.root:where(.small) {
|
|
62
|
+
min-height: var(--spacingHorizontalXXL);
|
|
63
|
+
font-family: var(--fontFamilyBase);
|
|
64
|
+
font-size: var(--fontSizeBase200);
|
|
65
|
+
font-weight: var(--fontWeightRegular);
|
|
66
|
+
line-height: var(--lineHeightBase200);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.root:where(.large) {
|
|
70
|
+
min-height: calc(var(--spacingVerticalXXL) + var(--spacingVerticalL));
|
|
71
|
+
font-family: var(--fontFamilyBase);
|
|
72
|
+
font-size: var(--fontSizeBase400);
|
|
73
|
+
font-weight: var(--fontWeightRegular);
|
|
74
|
+
line-height: var(--lineHeightBase400);
|
|
75
|
+
gap: var(--spacingHorizontalSNudge);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.root:where(.underline) {
|
|
79
|
+
background-color: var(--colorTransparentBackground);
|
|
80
|
+
border-radius: 0;
|
|
81
|
+
border-top-style: none;
|
|
82
|
+
border-inline-end-style: none;
|
|
83
|
+
border-inline-start-style: none;
|
|
84
|
+
&::after {
|
|
85
|
+
inset-inline-start: 0;
|
|
86
|
+
inset-inline-end: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.root:where(.filled-darker) {
|
|
91
|
+
background-color: var(--colorNeutralBackground3);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.root:where(.filled-lighter) {
|
|
95
|
+
background-color: var(--colorNeutralBackground1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.root:where(.filled-darker-shadow) {
|
|
99
|
+
background-color: var(--colorNeutralBackground3);
|
|
100
|
+
box-shadow: var(--shadow2);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.root:where(.filled-lighter-shadow) {
|
|
104
|
+
background-color: var(--colorNeutralBackground1);
|
|
105
|
+
box-shadow: var(--shadow2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.root:where(.outline:not(.disabled)) {
|
|
109
|
+
&:hover {
|
|
110
|
+
border-top-color: var(--colorNeutralStroke1Hover);
|
|
111
|
+
border-inline-end-color: var(--colorNeutralStroke1Hover);
|
|
112
|
+
border-bottom-color: var(--colorNeutralStrokeAccessibleHover);
|
|
113
|
+
border-inline-start-color: var(--colorNeutralStroke1Hover);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus-within {
|
|
118
|
+
border-top-color: var(--colorNeutralStroke1Pressed);
|
|
119
|
+
border-inline-end-color: var(--colorNeutralStroke1Pressed);
|
|
120
|
+
border-bottom-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
121
|
+
border-inline-start-color: var(--colorNeutralStroke1Pressed);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.root:where(.underline:not(.disabled)) {
|
|
126
|
+
&:hover {
|
|
127
|
+
border-bottom-color: var(--colorNeutralStrokeAccessibleHover);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:active,
|
|
131
|
+
&:focus-within {
|
|
132
|
+
border-bottom-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&::after {
|
|
136
|
+
border-radius: 0;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.root:where(.filled:not(.disabled)) {
|
|
141
|
+
&:hover,
|
|
142
|
+
&:focus-within {
|
|
143
|
+
border-top-color: var(--colorTransparentStrokeInteractive);
|
|
144
|
+
border-inline-end-color: var(--colorTransparentStrokeInteractive);
|
|
145
|
+
border-bottom-color: var(--colorTransparentStrokeInteractive);
|
|
146
|
+
border-inline-start-color: var(--colorTransparentStrokeInteractive);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.root:where(.filled) {
|
|
151
|
+
border-top-color: var(--colorTransparentStroke);
|
|
152
|
+
border-inline-end-color: var(--colorTransparentStroke);
|
|
153
|
+
border-bottom-color: var(--colorTransparentStroke);
|
|
154
|
+
border-inline-start-color: var(--colorTransparentStroke);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.root:where(.invalid:not(.disabled)) {
|
|
158
|
+
&:not(:focus-within),
|
|
159
|
+
&:hover:not(:focus-within) {
|
|
160
|
+
border-top-color: var(--colorPaletteRedBorder2);
|
|
161
|
+
border-inline-end-color: var(--colorPaletteRedBorder2);
|
|
162
|
+
border-bottom-color: var(--colorPaletteRedBorder2);
|
|
163
|
+
border-inline-start-color: var(--colorPaletteRedBorder2);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.root:where(.disabled) {
|
|
168
|
+
cursor: not-allowed;
|
|
169
|
+
background-color: var(--colorTransparentBackground);
|
|
170
|
+
border-top-color: var(--colorNeutralStrokeDisabled);
|
|
171
|
+
border-inline-end-color: var(--colorNeutralStrokeDisabled);
|
|
172
|
+
border-bottom-color: var(--colorNeutralStrokeDisabled);
|
|
173
|
+
border-inline-start-color: var(--colorNeutralStrokeDisabled);
|
|
174
|
+
&::after {
|
|
175
|
+
content: unset;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:focus-within {
|
|
179
|
+
outline-style: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@media (forced-colors: active) {
|
|
183
|
+
border-top-color: GrayText;
|
|
184
|
+
border-inline-end-color: GrayText;
|
|
185
|
+
border-bottom-color: GrayText;
|
|
186
|
+
border-inline-start-color: GrayText;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.root:where(.small.withContentBefore) {
|
|
191
|
+
padding-inline-start: var(--spacingHorizontalSNudge);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.root:where(.small.withContentAfter) {
|
|
195
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.root:where(.medium.withContentBefore) {
|
|
199
|
+
padding-inline-start: var(--spacingHorizontalMNudge);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.root:where(.medium.withContentAfter) {
|
|
203
|
+
padding-inline-end: var(--spacingHorizontalMNudge);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.root:where(.large.withContentBefore) {
|
|
207
|
+
padding-inline-start: var(--spacingHorizontalM);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.root:where(.large.withContentAfter) {
|
|
211
|
+
padding-inline-end: var(--spacingHorizontalM);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.input {
|
|
215
|
+
align-self: stretch;
|
|
216
|
+
box-sizing: border-box;
|
|
217
|
+
flex-grow: 1;
|
|
218
|
+
min-width: 0;
|
|
219
|
+
border-style: none;
|
|
220
|
+
padding: 0 var(--spacingHorizontalM);
|
|
221
|
+
color: var(--colorNeutralForeground1);
|
|
222
|
+
background-color: transparent;
|
|
223
|
+
outline-style: none;
|
|
224
|
+
font-family: inherit;
|
|
225
|
+
font-size: inherit;
|
|
226
|
+
font-weight: inherit;
|
|
227
|
+
line-height: inherit;
|
|
228
|
+
&::placeholder {
|
|
229
|
+
color: var(--colorNeutralForeground4);
|
|
230
|
+
opacity: 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:where(.small) > .input {
|
|
235
|
+
padding-inline-start: var(--spacingHorizontalS);
|
|
236
|
+
padding-inline-end: var(--spacingHorizontalS);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:where(.large) > .input {
|
|
240
|
+
padding-inline-start: calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));
|
|
241
|
+
padding-inline-end: calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:where(.disabled) > .input {
|
|
245
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
246
|
+
background-color: var(--colorTransparentBackground);
|
|
247
|
+
cursor: not-allowed;
|
|
248
|
+
&::placeholder {
|
|
249
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
:where(.small.withContentBefore) > .input {
|
|
254
|
+
padding-inline-start: var(--spacingHorizontalXXS);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
:where(.small.withContentAfter) > .input {
|
|
258
|
+
padding-inline-end: var(--spacingHorizontalXXS);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:where(.medium.withContentBefore) > .input {
|
|
262
|
+
padding-inline-start: var(--spacingHorizontalXXS);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:where(.medium.withContentAfter) > .input {
|
|
266
|
+
padding-inline-end: var(--spacingHorizontalXXS);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:where(.large.withContentBefore) > .input {
|
|
270
|
+
padding-inline-start: var(--spacingHorizontalSNudge);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:where(.large.withContentAfter) > .input {
|
|
274
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.contentBefore,
|
|
278
|
+
.contentAfter {
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
color: var(--colorNeutralForeground3);
|
|
281
|
+
display: flex;
|
|
282
|
+
& > svg,
|
|
283
|
+
& > :global(.fui-Icon-font) {
|
|
284
|
+
font-size: var(--fontSizeBase500);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
:where(.disabled) > .contentBefore,
|
|
289
|
+
:where(.disabled) > .contentAfter {
|
|
290
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:where(.small) > .contentBefore,
|
|
294
|
+
:where(.small) > .contentAfter {
|
|
295
|
+
& > svg,
|
|
296
|
+
& > :global(.fui-Icon-font) {
|
|
297
|
+
font-size: var(--fontSizeBase400);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
:where(.large) > .contentBefore,
|
|
302
|
+
:where(.large) > .contentAfter {
|
|
303
|
+
& > svg,
|
|
304
|
+
& > :global(.fui-Icon-font) {
|
|
305
|
+
font-size: var(--fontSizeBase600);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get inputClassNames () {
|
|
13
|
+
return inputClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useInputStyles_unstable () {
|
|
16
|
+
return useInputStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Inputmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Input.module.css"));
|
|
22
|
+
const inputClassNames = {
|
|
23
|
+
root: 'fui-Input',
|
|
24
|
+
input: 'fui-Input__input',
|
|
25
|
+
contentBefore: 'fui-Input__contentBefore',
|
|
26
|
+
contentAfter: 'fui-Input__contentAfter'
|
|
27
|
+
};
|
|
28
|
+
const useInputStyles_unstable = (state)=>{
|
|
29
|
+
const { size, appearance } = state;
|
|
30
|
+
state.root.className = (0, _clsx.clsx)(inputClassNames.root, _Inputmodulecss.default.root, _Inputmodulecss.default[size], _Inputmodulecss.default[appearance], appearance.startsWith('filled') && _Inputmodulecss.default.filled, state.input.disabled && _Inputmodulecss.default.disabled, `${state.input['aria-invalid']}` === 'true' && _Inputmodulecss.default.invalid, state.contentBefore && _Inputmodulecss.default.withContentBefore, state.contentAfter && _Inputmodulecss.default.withContentAfter, state.root.className);
|
|
31
|
+
state.input.className = (0, _clsx.clsx)(inputClassNames.input, _Inputmodulecss.default.input, state.input.className);
|
|
32
|
+
if (state.contentBefore) {
|
|
33
|
+
state.contentBefore.className = (0, _clsx.clsx)(inputClassNames.contentBefore, _Inputmodulecss.default.contentBefore, state.contentBefore.className);
|
|
34
|
+
}
|
|
35
|
+
if (state.contentAfter) {
|
|
36
|
+
state.contentAfter.className = (0, _clsx.clsx)(inputClassNames.contentAfter, _Inputmodulecss.default.contentAfter, state.contentAfter.className);
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Input/useInputStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\nimport styles from './Input.module.css';\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\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n state.root.className = clsx(\n inputClassNames.root,\n styles.root,\n styles[size],\n styles[appearance],\n appearance.startsWith('filled') && styles.filled,\n state.input.disabled && styles.disabled,\n `${state.input['aria-invalid']}` === 'true' && styles.invalid,\n state.contentBefore && styles.withContentBefore,\n state.contentAfter && styles.withContentAfter,\n state.root.className,\n );\n state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);\n if (state.contentBefore) {\n state.contentBefore.className = clsx(\n inputClassNames.contentBefore,\n styles.contentBefore,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = clsx(\n inputClassNames.contentAfter,\n styles.contentAfter,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","inputClassNames","root","input","contentBefore","contentAfter","useInputStyles_unstable","state","size","appearance","className","startsWith","filled","disabled","invalid","withContentBefore","withContentAfter"],"mappings":";;;;;;;;;;;QAKaE;;;QAOAK;;;;;sBAZQ,OAAO;yEAGT,qBAAqB;AAEjC,wBAAoD;IACzDJ,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEK,gCAAgC,CAACE;IACtC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGF;IAC7BA,MAAML,IAAI,CAACQ,SAAS,OAAGX,UAAAA,EACrBE,gBAAgBC,IAAI,EACpBF,uBAAAA,CAAOE,IAAI,EACXF,uBAAM,CAACQ,KAAK,EACZR,uBAAM,CAACS,WAAW,EAClBA,WAAWE,UAAU,CAAC,aAAaX,uBAAAA,CAAOY,MAAM,EAChDL,MAAMJ,KAAK,CAACU,QAAQ,IAAIb,uBAAAA,CAAOa,QAAQ,EACvC,GAAGN,MAAMJ,KAAK,CAAC,eAAe,EAAE,KAAK,UAAUH,uBAAAA,CAAOc,OAAO,EAC7DP,MAAMH,aAAa,IAAIJ,uBAAAA,CAAOe,iBAAiB,EAC/CR,MAAMF,YAAY,IAAIL,uBAAAA,CAAOgB,gBAAgB,EAC7CT,MAAML,IAAI,CAACQ,SAAS;IAEtBH,MAAMJ,KAAK,CAACO,SAAS,OAAGX,UAAAA,EAAKE,gBAAgBE,KAAK,EAAEH,uBAAAA,CAAOG,KAAK,EAAEI,MAAMJ,KAAK,CAACO,SAAS;IACvF,IAAIH,MAAMH,aAAa,EAAE;QACvBG,MAAMH,aAAa,CAACM,SAAS,OAAGX,UAAAA,EAC9BE,gBAAgBG,aAAa,EAC7BJ,uBAAAA,CAAOI,aAAa,EACpBG,MAAMH,aAAa,CAACM,SAAS;IAEjC;IACA,IAAIH,MAAMF,YAAY,EAAE;QACtBE,MAAMF,YAAY,CAACK,SAAS,OAAGX,UAAAA,EAC7BE,gBAAgBI,YAAY,EAC5BL,uBAAAA,CAAOK,YAAY,EACnBE,MAAMF,YAAY,CAACK,SAAS;IAEhC;IAEA,OAAOH;AACT,EAAE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get inputClassNames () {
|
|
13
|
+
return inputClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useInputStyles_unstable () {
|
|
16
|
+
return useInputStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Inputmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Input.module.css"));
|
|
22
|
+
const inputClassNames = {
|
|
23
|
+
root: 'fui-Input',
|
|
24
|
+
input: 'fui-Input__input',
|
|
25
|
+
contentBefore: 'fui-Input__contentBefore',
|
|
26
|
+
contentAfter: 'fui-Input__contentAfter'
|
|
27
|
+
};
|
|
28
|
+
const useInputStyles_unstable = (state)=>{
|
|
29
|
+
const { size, appearance } = state;
|
|
30
|
+
state.root.className = (0, _clsx.clsx)(inputClassNames.root, _Inputmodulecss.default.root, _Inputmodulecss.default[size], _Inputmodulecss.default[appearance], appearance.startsWith('filled') && _Inputmodulecss.default.filled, state.input.disabled && _Inputmodulecss.default.disabled, `${state.input['aria-invalid']}` === 'true' && _Inputmodulecss.default.invalid, state.contentBefore && _Inputmodulecss.default.withContentBefore, state.contentAfter && _Inputmodulecss.default.withContentAfter, state.root.className);
|
|
31
|
+
state.input.className = (0, _clsx.clsx)(inputClassNames.input, _Inputmodulecss.default.input, state.input.className);
|
|
32
|
+
if (state.contentBefore) {
|
|
33
|
+
state.contentBefore.className = (0, _clsx.clsx)(inputClassNames.contentBefore, _Inputmodulecss.default.contentBefore, state.contentBefore.className);
|
|
34
|
+
}
|
|
35
|
+
if (state.contentAfter) {
|
|
36
|
+
state.contentAfter.className = (0, _clsx.clsx)(inputClassNames.contentAfter, _Inputmodulecss.default.contentAfter, state.contentAfter.className);
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Input/useInputStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InputSlots, InputState } from './Input.types';\nimport styles from './Input.module.css';\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\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n state.root.className = clsx(\n inputClassNames.root,\n styles.root,\n styles[size],\n styles[appearance],\n appearance.startsWith('filled') && styles.filled,\n state.input.disabled && styles.disabled,\n `${state.input['aria-invalid']}` === 'true' && styles.invalid,\n state.contentBefore && styles.withContentBefore,\n state.contentAfter && styles.withContentAfter,\n state.root.className,\n );\n state.input.className = clsx(inputClassNames.input, styles.input, state.input.className);\n if (state.contentBefore) {\n state.contentBefore.className = clsx(\n inputClassNames.contentBefore,\n styles.contentBefore,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = clsx(\n inputClassNames.contentAfter,\n styles.contentAfter,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","inputClassNames","root","input","contentBefore","contentAfter","useInputStyles_unstable","state","size","appearance","className","startsWith","filled","disabled","invalid","withContentBefore","withContentAfter"],"mappings":";;;;;;;;;;;QAKaE;;;QAOAK;;;;;sBAZQ,OAAO;yEAGT,qBAAqB;AAEjC,wBAAoD;IACzDJ,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB,EAAE;AAEK,gCAAgC,CAACE;IACtC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAE,GAAGF;IAC7BA,MAAML,IAAI,CAACQ,SAAS,OAAGX,UAAAA,EACrBE,gBAAgBC,IAAI,EACpBF,uBAAAA,CAAOE,IAAI,EACXF,uBAAM,CAACQ,KAAK,EACZR,uBAAM,CAACS,WAAW,EAClBA,WAAWE,UAAU,CAAC,aAAaX,uBAAAA,CAAOY,MAAM,EAChDL,MAAMJ,KAAK,CAACU,QAAQ,IAAIb,uBAAAA,CAAOa,QAAQ,EACvC,GAAGN,MAAMJ,KAAK,CAAC,eAAe,EAAE,KAAK,UAAUH,uBAAAA,CAAOc,OAAO,EAC7DP,MAAMH,aAAa,IAAIJ,uBAAAA,CAAOe,iBAAiB,EAC/CR,MAAMF,YAAY,IAAIL,uBAAAA,CAAOgB,gBAAgB,EAC7CT,MAAML,IAAI,CAACQ,SAAS;IAEtBH,MAAMJ,KAAK,CAACO,SAAS,OAAGX,UAAAA,EAAKE,gBAAgBE,KAAK,EAAEH,uBAAAA,CAAOG,KAAK,EAAEI,MAAMJ,KAAK,CAACO,SAAS;IACvF,IAAIH,MAAMH,aAAa,EAAE;QACvBG,MAAMH,aAAa,CAACM,SAAS,OAAGX,UAAAA,EAC9BE,gBAAgBG,aAAa,EAC7BJ,uBAAAA,CAAOI,aAAa,EACpBG,MAAMH,aAAa,CAACM,SAAS;IAEjC;IACA,IAAIH,MAAMF,YAAY,EAAE;QACtBE,MAAMF,YAAY,CAACK,SAAS,OAAGX,UAAAA,EAC7BE,gBAAgBI,YAAY,EAC5BL,uBAAAA,CAAOK,YAAY,EACnBE,MAAMF,YAAY,CAACK,SAAS;IAEhC;IAEA,OAAOH;AACT,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-input",
|
|
3
|
-
"version": "9.75.
|
|
3
|
+
"version": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
4
4
|
"description": "Fluent UI React Input component",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
9
11
|
"repository": {
|
|
10
12
|
"type": "git",
|
|
11
13
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
14
|
},
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"@fluentui/react-field": "9.75.
|
|
16
|
-
"@fluentui/react-jsx-runtime": "9.75.
|
|
17
|
-
"@fluentui/react-shared-contexts": "9.75.
|
|
18
|
-
"@fluentui/react-theme": "9.75.
|
|
19
|
-
"@fluentui/react-utilities": "9.75.
|
|
17
|
+
"@fluentui/react-field": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
18
|
+
"@fluentui/react-jsx-runtime": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
19
|
+
"@fluentui/react-shared-contexts": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
20
|
+
"@fluentui/react-theme": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
21
|
+
"@fluentui/react-utilities": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
20
22
|
"@griffel/react": "^1.5.32",
|
|
21
|
-
"@swc/helpers": "^0.5.1"
|
|
23
|
+
"@swc/helpers": "^0.5.1",
|
|
24
|
+
"clsx": "^2.1.1"
|
|
22
25
|
},
|
|
23
26
|
"peerDependencies": {
|
|
24
27
|
"@types/react": ">=16.14.0 <20.0.0",
|