@fluentui/react-input 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +31 -9
  2. package/README.md +11 -0
  3. package/lib/components/Input/Input.js.map +1 -1
  4. package/lib/components/Input/Input.module.css +305 -0
  5. package/lib/components/Input/Input.types.js.map +1 -1
  6. package/lib/components/Input/index.js.map +1 -1
  7. package/lib/components/Input/renderInput.js +2 -2
  8. package/lib/components/Input/renderInput.js.map +1 -1
  9. package/lib/components/Input/useInput.js +2 -2
  10. package/lib/components/Input/useInput.js.map +1 -1
  11. package/lib/components/Input/useInputStyles.styles.css.js +20 -0
  12. package/lib/components/Input/useInputStyles.styles.css.js.map +1 -0
  13. package/lib/components/Input/useInputStyles.styles.raw.css.js +20 -0
  14. package/lib/components/Input/useInputStyles.styles.raw.css.js.map +1 -0
  15. package/lib/components/Input/useInputStyles.styles.raw.js.map +1 -1
  16. package/lib-commonjs/Input.cjs +7 -7
  17. package/lib-commonjs/components/Input/Input.cjs.map +1 -1
  18. package/lib-commonjs/components/Input/Input.module.css +305 -0
  19. package/lib-commonjs/components/Input/Input.types.cjs.map +1 -1
  20. package/lib-commonjs/components/Input/index.cjs +7 -7
  21. package/lib-commonjs/components/Input/index.cjs.map +1 -1
  22. package/lib-commonjs/components/Input/renderInput.cjs.map +1 -1
  23. package/lib-commonjs/components/Input/useInput.cjs +5 -5
  24. package/lib-commonjs/components/Input/useInput.cjs.map +1 -1
  25. package/lib-commonjs/components/Input/useInputStyles.styles.cjs +3 -3
  26. package/lib-commonjs/components/Input/useInputStyles.styles.cjs.map +1 -1
  27. package/lib-commonjs/components/Input/useInputStyles.styles.css.cjs +39 -0
  28. package/lib-commonjs/components/Input/useInputStyles.styles.css.cjs.map +1 -0
  29. package/lib-commonjs/components/Input/useInputStyles.styles.raw.cjs +3 -3
  30. package/lib-commonjs/components/Input/useInputStyles.styles.raw.cjs.map +1 -1
  31. package/lib-commonjs/components/Input/useInputStyles.styles.raw.css.cjs +39 -0
  32. package/lib-commonjs/components/Input/useInputStyles.styles.raw.css.cjs.map +1 -0
  33. package/lib-commonjs/index.cjs +7 -7
  34. package/package.json +13 -13
  35. package/dist/metadata/api/api-root.json +0 -1
  36. package/dist/metadata/index.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,21 +1,43 @@
1
1
  # Change Log - @fluentui/react-input
2
2
 
3
- <!-- This log was last generated on Tue, 06 Oct 2026 11:40:23 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 31 Oct 2026 11:08:45 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
7
+ ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
8
8
 
9
- Tue, 06 Oct 2026 11:40:23 GMT
9
+ Sat, 31 Oct 2026 11:08:45 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
- - Bump @fluentui/react-field to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
- - Bump @fluentui/react-jsx-runtime to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
+ - Bump @fluentui/react-field to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+
20
+ ## [9.8.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.8.8)
21
+
22
+ Mon, 19 Oct 2026 16:49:01 GMT
23
+
24
+ ### Patches
25
+
26
+ - Bump @fluentui/react-field to v9.5.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
27
+ - Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
28
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
29
+
30
+ ## [9.8.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.8.7)
31
+
32
+ Tue, 22 Sep 2026 11:25:39 GMT
33
+
34
+ ### Patches
35
+
36
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
37
+ - Bump @fluentui/react-field to v9.5.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
38
+ - Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
39
+ - Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
40
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
41
 
20
42
  ## [9.8.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.8.6)
21
43
 
package/README.md CHANGED
@@ -33,3 +33,14 @@ See [Spec.md](./Spec.md)
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
+ layered 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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["React","useInput_unstable","renderInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","Input","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,uBAAuB,QAAQ,6BAA0B;AAGlE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IAExBL,4BAA4B,2BAA2BK;IAEvD,OAAOP,qBAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useInput_unstable } from './useInput';\nimport { renderInput_unstable } from './renderInput';\nimport { useInputStyles_unstable } from './useInputStyles.styles';\nimport type { InputProps } from './Input.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The Input component allows people to enter and edit text.\n */\nexport const Input: ForwardRefComponent<InputProps> = React.forwardRef((props, ref) => {\n const state = useInput_unstable(props, ref);\n\n useInputStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInputStyles_unstable')(state);\n\n return renderInput_unstable(state);\n});\n\nInput.displayName = 'Input';\n"],"names":["React","useInput_unstable","renderInput_unstable","useInputStyles_unstable","useCustomStyleHook_unstable","Input","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,uBAAuB,QAAQ,6BAA0B;AAGlE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IAExBL,4BAA4B,2BAA2BK;IAEvD,OAAOP,qBAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
@@ -0,0 +1,305 @@
1
+ @layer fluentui {
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-bottom-left-radius: var(--borderRadiusMedium);
28
+ border-bottom-right-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-right-color: var(--colorNeutralStroke1Hover);
112
+ border-bottom-color: var(--colorNeutralStrokeAccessibleHover);
113
+ border-left-color: var(--colorNeutralStroke1Hover);
114
+ }
115
+
116
+ &:active,
117
+ &:focus-within {
118
+ border-top-color: var(--colorNeutralStroke1Pressed);
119
+ border-right-color: var(--colorNeutralStroke1Pressed);
120
+ border-bottom-color: var(--colorNeutralStrokeAccessiblePressed);
121
+ border-left-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-right-color: var(--colorTransparentStrokeInteractive);
145
+ border-bottom-color: var(--colorTransparentStrokeInteractive);
146
+ border-left-color: var(--colorTransparentStrokeInteractive);
147
+ }
148
+ }
149
+
150
+ .root:where(.filled) {
151
+ border-top-color: var(--colorTransparentStroke);
152
+ border-right-color: var(--colorTransparentStroke);
153
+ border-bottom-color: var(--colorTransparentStroke);
154
+ border-left-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-right-color: var(--colorPaletteRedBorder2);
162
+ border-bottom-color: var(--colorPaletteRedBorder2);
163
+ border-left-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-right-color: var(--colorNeutralStrokeDisabled);
172
+ border-bottom-color: var(--colorNeutralStrokeDisabled);
173
+ border-left-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-right-color: GrayText;
185
+ border-bottom-color: GrayText;
186
+ border-left-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
+ font-size: var(--fontSizeBase500);
284
+ }
285
+ }
286
+
287
+ :where(.disabled) > .contentBefore,
288
+ :where(.disabled) > .contentAfter {
289
+ color: var(--colorNeutralForegroundDisabled);
290
+ }
291
+
292
+ :where(.small) > .contentBefore,
293
+ :where(.small) > .contentAfter {
294
+ & > svg {
295
+ font-size: var(--fontSizeBase400);
296
+ }
297
+ }
298
+
299
+ :where(.large) > .contentBefore,
300
+ :where(.large) > .contentAfter {
301
+ & > svg {
302
+ font-size: var(--fontSizeBase600);
303
+ }
304
+ }
305
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/Input.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\n * @default 'outline'\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * Input props without design-specific props (appearance, size).\n * Use this when building a base input that is unstyled or uses a custom design system.\n */\nexport type InputBaseProps = Omit<InputProps, 'appearance' | 'size'>;\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Input state without design-specific state (appearance, size).\n */\nexport type InputBaseState = Omit<InputState, 'appearance' | 'size'>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":[],"mappings":"AA4HA;;CAEC,GACD,WAGE"}
1
+ {"version":3,"sources":["../../../src/components/Input/Input.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type InputSlots = {\n /**\n * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.\n * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)\n *\n * The root slot receives the `className` and `style` specified directly on the `<Input>`.\n * All other top-level native props will be applied to the primary slot, `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The actual `<input>` element. `type=\"text\"` will be automatically applied unless overridden.\n *\n * This is the \"primary\" slot, so native props specified directly on the `<Input>` will go here\n * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will\n * also go here.\n */\n input: NonNullable<Slot<'input'>>;\n\n /** Element before the input text, within the input border */\n contentBefore?: Slot<'span'>;\n\n /** Element after the input text, within the input border */\n contentAfter?: Slot<'span'>;\n};\n\nexport type InputProps = Omit<\n ComponentProps<Partial<InputSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> & {\n /** Input can't have children. */\n children?: never;\n\n /**\n * Size of the input (changes the font size and spacing).\n * @default 'medium'\n */\n // This name overlaps with the native `size` prop, but that prop isn't very useful in practice\n // (we could add `htmlSize` for the native functionality if someone needs it)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Controls the colors and borders of the input.\n * @default 'outline'\n *\n * Note: 'filled-darker-shadow' and 'filled-lighter-shadow' are deprecated and will be removed in the future.\n */\n appearance?:\n | 'outline'\n | 'underline'\n | 'filled-darker'\n | 'filled-lighter'\n | 'filled-darker-shadow'\n | 'filled-lighter-shadow';\n\n /**\n * Default value of the input. Provide this if the input should be an uncontrolled component\n * which tracks its current state internally; otherwise, use `value`.\n *\n * (This prop is mutually exclusive with `value`.)\n */\n defaultValue?: string;\n\n /**\n * Current value of the input. Provide this if the input is a controlled component where you\n * are maintaining its current state; otherwise, use `defaultValue`.\n *\n * (This prop is mutually exclusive with `defaultValue`.)\n */\n value?: string;\n\n /**\n * Called when the user changes the input's value.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;\n\n /**\n * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)\n * based on the type of value the user will enter.\n *\n * Note that no custom styling is currently applied for alternative types, and some types may\n * activate browser-default styling which does not match the Fluent design language.\n *\n * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an\n * `<input>` element instead.)\n * @default 'text'\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'search'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'number'\n | 'time'\n | 'week';\n};\n\n/**\n * Input props without design-specific props (appearance, size).\n * Use this when building a base input that is unstyled or uses a custom design system.\n */\nexport type InputBaseProps = Omit<InputProps, 'appearance' | 'size'>;\n\n/**\n * State used in rendering Input.\n */\nexport type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;\n\n/**\n * Input state without design-specific state (appearance, size).\n */\nexport type InputBaseState = Omit<InputState, 'appearance' | 'size'>;\n\n/**\n * Data passed to the `onChange` callback when a user changes the input's value.\n */\nexport type InputOnChangeData = {\n /** Updated input value from the user */\n value: string;\n};\n"],"names":[],"mappings":"AA4HA;;CAEC,GACD,WAGE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type {\n InputBaseProps,\n InputBaseState,\n InputOnChangeData,\n InputProps,\n InputSlots,\n InputState,\n} from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable, useInputBase_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","renderInput_unstable","useInput_unstable","useInputBase_unstable","inputClassNames","useInputStyles_unstable"],"mappings":"AAAA,SAASA,KAAK,QAAQ,aAAU;AAShC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,gBAAa;AACtE,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,6BAA0B"}
1
+ {"version":3,"sources":["../../../src/components/Input/index.ts"],"sourcesContent":["export { Input } from './Input';\nexport type {\n InputBaseProps,\n InputBaseState,\n InputOnChangeData,\n InputProps,\n InputSlots,\n InputState,\n} from './Input.types';\nexport { renderInput_unstable } from './renderInput';\nexport { useInput_unstable, useInputBase_unstable } from './useInput';\nexport { inputClassNames, useInputStyles_unstable } from './useInputStyles.styles';\n"],"names":["Input","renderInput_unstable","useInput_unstable","useInputBase_unstable","inputClassNames","useInputStyles_unstable"],"mappings":"AAAA,SAASA,KAAK,QAAQ,aAAU;AAShC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,gBAAa;AACtE,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,6BAA0B"}
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from "@fluentui/react-utilities";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Render the final JSX of Input
5
5
  */ export const renderInput_unstable = (state)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InputBaseState, InputSlots } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputBaseState): JSXElement => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInput_unstable","state","root","contentBefore","input","contentAfter"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IACxB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;0BAC5C,KAACF,MAAMG,KAAK;YACXH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;;;AAGhD,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Input/renderInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InputBaseState, InputSlots } from './Input.types';\n\n/**\n * Render the final JSX of Input\n */\nexport const renderInput_unstable = (state: InputBaseState): JSXElement => {\n assertSlots<InputSlots>(state);\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && <state.contentAfter />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInput_unstable","state","root","contentBefore","input","contentAfter"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IACxB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;0BAC5C,KAACF,MAAMG,KAAK;YACXH,MAAMI,YAAY,kBAAI,KAACJ,MAAMI,YAAY;;;AAGhD,EAAE"}
@@ -11,10 +11,10 @@ import { useOverrides_unstable as useOverrides } from "@fluentui/react-shared-co
11
11
  * @param props - props from this instance of Input
12
12
  * @param ref - reference to `<input>` element of Input
13
13
  */ export const useInput_unstable = (props, ref)=>{
14
+ var _ref, _overrides_inputDefaultAppearance;
14
15
  const overrides = useOverrides();
15
16
  const fieldContext = useFieldContext_unstable();
16
- var _fieldContext_size, _overrides_inputDefaultAppearance;
17
- const { size = (_fieldContext_size = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.size) !== null && _fieldContext_size !== void 0 ? _fieldContext_size : 'medium', appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline', ...baseProps } = props;
17
+ const { size = (_ref = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.size) !== null && _ref !== void 0 ? _ref : 'medium', appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline', ...baseProps } = props;
18
18
  if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
19
19
  // eslint-disable-next-line no-console
20
20
  console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" + ' future.');
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Input/useInput.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable, useFieldContext_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { InputBaseProps, InputBaseState, InputProps, InputState } from './Input.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const overrides = useOverrides();\n const fieldContext = useFieldContext_unstable();\n\n const {\n size = fieldContext?.size ?? 'medium',\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n ...baseProps\n } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const state = useInputBase_unstable(baseProps, ref);\n\n return {\n size,\n appearance,\n ...state,\n };\n};\n\n/**\n * Base hook for Input component, which manages state related to controlled/uncontrolled value,\n * slot structure, and onChange handling. This hook excludes design-specific props (appearance, size).\n *\n * @param props - User provided props to the Input component.\n * @param ref - User provided ref to be passed to the Input component.\n */\nexport const useInputBase_unstable = (props: InputBaseProps, ref: React.Ref<HTMLInputElement>): InputBaseState => {\n const fieldControlProps = useFieldControlProps_unstable(props, {\n supportsLabelFor: true,\n supportsRequired: true,\n });\n\n const [value, setValue] = useControllableState({\n state: fieldControlProps.value,\n defaultState: fieldControlProps.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props: fieldControlProps,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange', 'value', 'defaultValue'],\n });\n\n const state: InputBaseState = {\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: slot.always(fieldControlProps.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(fieldControlProps.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(fieldControlProps.contentBefore, { elementType: 'span' }),\n root: slot.always(fieldControlProps.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n fieldControlProps.onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"],"names":["useFieldControlProps_unstable","useFieldContext_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","overrides","fieldContext","size","appearance","inputDefaultAppearance","baseProps","process","env","NODE_ENV","console","error","state","useInputBase_unstable","fieldControlProps","supportsLabelFor","supportsRequired","value","setValue","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","always","defaultProps","type","primary","elementType","optional","onChange","ev","newValue","target"],"mappings":"AAAA;AAGA,SAASA,6BAA6B,EAAEC,wBAAwB,QAAQ,wBAAwB;AAChG,SAASC,yBAAyB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAEpH,SAASC,yBAAyBC,YAAY,QAAQ,kCAAkC;AAExF;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAMC,YAAYJ;IAClB,MAAMK,eAAeX;QAGZW,oBACMD;IAFf,MAAM,EACJE,OAAOD,CAAAA,qBAAAA,yBAAAA,mCAAAA,aAAcC,IAAI,cAAlBD,gCAAAA,qBAAsB,QAAQ,EACrCE,aAAaH,CAAAA,oCAAAA,UAAUI,sBAAsB,cAAhCJ,+CAAAA,oCAAoC,SAAS,EAC1D,GAAGK,WACJ,GAAGP;IAEJ,IACEQ,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBL,CAAAA,eAAe,0BAA0BA,eAAe,uBAAsB,GAC/E;QACA,sCAAsC;QACtCM,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAMC,QAAQC,sBAAsBP,WAAWN;IAE/C,OAAO;QACLG;QACAC;QACA,GAAGQ,KAAK;IACV;AACF,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwB,CAACd,OAAuBC;IAC3D,MAAMc,oBAAoBxB,8BAA8BS,OAAO;QAC7DgB,kBAAkB;QAClBC,kBAAkB;IACpB;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGzB,qBAAqB;QAC7CmB,OAAOE,kBAAkBG,KAAK;QAC9BE,cAAcL,kBAAkBM,YAAY;QAC5CC,cAAc;IAChB;IAEA,MAAMC,cAAc9B,0BAA0B;QAC5CO,OAAOe;QACPS,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;YAAS;SAAe;IAC1D;IAEA,MAAMZ,QAAwB;QAC5Ba,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,eAAe;YACfC,cAAc;QAChB;QACAF,OAAOhC,KAAKmC,MAAM,CAAChB,kBAAkBa,KAAK,EAAE;YAC1CI,cAAc;gBACZC,MAAM;gBACNhC;gBACA,GAAGsB,YAAYW,OAAO;YACxB;YACAC,aAAa;QACf;QACAL,cAAclC,KAAKwC,QAAQ,CAACrB,kBAAkBe,YAAY,EAAE;YAAEK,aAAa;QAAO;QAClFN,eAAejC,KAAKwC,QAAQ,CAACrB,kBAAkBc,aAAa,EAAE;YAAEM,aAAa;QAAO;QACpFR,MAAM/B,KAAKmC,MAAM,CAAChB,kBAAkBY,IAAI,EAAE;YACxCK,cAAcT,YAAYI,IAAI;YAC9BQ,aAAa;QACf;IACF;IAEAtB,MAAMe,KAAK,CAACV,KAAK,GAAGA;IACpBL,MAAMe,KAAK,CAACS,QAAQ,GAAG1C,iBAAiB2C,CAAAA;YAEtCvB;QADA,MAAMwB,WAAWD,GAAGE,MAAM,CAACtB,KAAK;SAChCH,8BAAAA,kBAAkBsB,QAAQ,cAA1BtB,kDAAAA,iCAAAA,mBAA6BuB,IAAI;YAAEpB,OAAOqB;QAAS;QACnDpB,SAASoB;IACX;IAEA,OAAO1B;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Input/useInput.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldControlProps_unstable, useFieldContext_unstable } from '@fluentui/react-field';\nimport { getPartitionedNativeProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { InputBaseProps, InputBaseState, InputProps, InputState } from './Input.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Input.\n *\n * The returned state can be modified with hooks such as useInputStyles_unstable,\n * before being passed to renderInput_unstable.\n *\n * @param props - props from this instance of Input\n * @param ref - reference to `<input>` element of Input\n */\nexport const useInput_unstable = (props: InputProps, ref: React.Ref<HTMLInputElement>): InputState => {\n const overrides = useOverrides();\n const fieldContext = useFieldContext_unstable();\n\n const {\n size = fieldContext?.size ?? 'medium',\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n ...baseProps\n } = props;\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')\n ) {\n // eslint-disable-next-line no-console\n console.error(\n \"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" +\n ' future.',\n );\n }\n\n const state = useInputBase_unstable(baseProps, ref);\n\n return {\n size,\n appearance,\n ...state,\n };\n};\n\n/**\n * Base hook for Input component, which manages state related to controlled/uncontrolled value,\n * slot structure, and onChange handling. This hook excludes design-specific props (appearance, size).\n *\n * @param props - User provided props to the Input component.\n * @param ref - User provided ref to be passed to the Input component.\n */\nexport const useInputBase_unstable = (props: InputBaseProps, ref: React.Ref<HTMLInputElement>): InputBaseState => {\n const fieldControlProps = useFieldControlProps_unstable(props, {\n supportsLabelFor: true,\n supportsRequired: true,\n });\n\n const [value, setValue] = useControllableState({\n state: fieldControlProps.value,\n defaultState: fieldControlProps.defaultValue,\n initialState: '',\n });\n\n const nativeProps = getPartitionedNativeProps({\n props: fieldControlProps,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange', 'value', 'defaultValue'],\n });\n\n const state: InputBaseState = {\n components: {\n root: 'span',\n input: 'input',\n contentBefore: 'span',\n contentAfter: 'span',\n },\n input: slot.always(fieldControlProps.input, {\n defaultProps: {\n type: 'text',\n ref,\n ...nativeProps.primary,\n },\n elementType: 'input',\n }),\n contentAfter: slot.optional(fieldControlProps.contentAfter, { elementType: 'span' }),\n contentBefore: slot.optional(fieldControlProps.contentBefore, { elementType: 'span' }),\n root: slot.always(fieldControlProps.root, {\n defaultProps: nativeProps.root,\n elementType: 'span',\n }),\n };\n\n state.input.value = value;\n state.input.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n fieldControlProps.onChange?.(ev, { value: newValue });\n setValue(newValue);\n });\n\n return state;\n};\n"],"names":["useFieldControlProps_unstable","useFieldContext_unstable","getPartitionedNativeProps","useControllableState","useEventCallback","slot","useOverrides_unstable","useOverrides","useInput_unstable","props","ref","overrides","fieldContext","size","appearance","inputDefaultAppearance","baseProps","process","env","NODE_ENV","console","error","state","useInputBase_unstable","fieldControlProps","supportsLabelFor","supportsRequired","value","setValue","defaultState","defaultValue","initialState","nativeProps","primarySlotTagName","excludedPropNames","components","root","input","contentBefore","contentAfter","always","defaultProps","type","primary","elementType","optional","onChange","ev","newValue","target"],"mappings":"AAAA;AAGA,SAASA,6BAA6B,EAAEC,wBAAwB,QAAQ,wBAAwB;AAChG,SAASC,yBAAyB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAEpH,SAASC,yBAAyBC,YAAY,QAAQ,kCAAkC;AAExF;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;cAMpCC;IALf,MAAMA,YAAYJ;IAClB,MAAMK,eAAeX;IAErB,MAAM,EACJY,eAAOD,yBAAAA,mCAAAA,aAAcC,IAAI,uCAAI,QAAQ,EACrCC,cAAaH,oCAAAA,UAAUI,sBAAsB,cAAhCJ,+CAAAA,oCAAoC,SAAS,EAC1D,GAAGK,WACJ,GAAGP;IAEJ,IACEQ,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACxBL,CAAAA,eAAe,0BAA0BA,eAAe,uBAAsB,GAC/E;QACA,sCAAsC;QACtCM,QAAQC,KAAK,CACX,iHACE;IAEN;IAEA,MAAMC,QAAQC,sBAAsBP,WAAWN;IAE/C,OAAO;QACLG;QACAC;QACA,GAAGQ,KAAK;IACV;AACF,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwB,CAACd,OAAuBC;IAC3D,MAAMc,oBAAoBxB,8BAA8BS,OAAO;QAC7DgB,kBAAkB;QAClBC,kBAAkB;IACpB;IAEA,MAAM,CAACC,OAAOC,SAAS,GAAGzB,qBAAqB;QAC7CmB,OAAOE,kBAAkBG,KAAK;QAC9BE,cAAcL,kBAAkBM,YAAY;QAC5CC,cAAc;IAChB;IAEA,MAAMC,cAAc9B,0BAA0B;QAC5CO,OAAOe;QACPS,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;YAAS;SAAe;IAC1D;IAEA,MAAMZ,QAAwB;QAC5Ba,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,eAAe;YACfC,cAAc;QAChB;QACAF,OAAOhC,KAAKmC,MAAM,CAAChB,kBAAkBa,KAAK,EAAE;YAC1CI,cAAc;gBACZC,MAAM;gBACNhC;gBACA,GAAGsB,YAAYW,OAAO;YACxB;YACAC,aAAa;QACf;QACAL,cAAclC,KAAKwC,QAAQ,CAACrB,kBAAkBe,YAAY,EAAE;YAAEK,aAAa;QAAO;QAClFN,eAAejC,KAAKwC,QAAQ,CAACrB,kBAAkBc,aAAa,EAAE;YAAEM,aAAa;QAAO;QACpFR,MAAM/B,KAAKmC,MAAM,CAAChB,kBAAkBY,IAAI,EAAE;YACxCK,cAAcT,YAAYI,IAAI;YAC9BQ,aAAa;QACf;IACF;IAEAtB,MAAMe,KAAK,CAACV,KAAK,GAAGA;IACpBL,MAAMe,KAAK,CAACS,QAAQ,GAAG1C,iBAAiB2C,CAAAA;YAEtCvB;QADA,MAAMwB,WAAWD,GAAGE,MAAM,CAACtB,KAAK;SAChCH,8BAAAA,kBAAkBsB,QAAQ,cAA1BtB,kDAAAA,iCAAAA,mBAA6BuB,IAAI;YAAEpB,OAAOqB;QAAS;QACnDpB,SAASoB;IACX;IAEA,OAAO1B;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,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"}