@fluentui/react-input 9.6.7 → 9.7.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 CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/react-input
2
2
 
3
- This log was last generated on Fri, 11 Jul 2025 15:56:58 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Jul 2025 13:45:40 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.7.0)
8
+
9
+ Thu, 17 Jul 2025 13:45:40 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.6.7..@fluentui/react-input_v9.7.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/react-field to v9.4.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
16
+
7
17
  ## [9.6.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.6.7)
8
18
 
9
- Fri, 11 Jul 2025 15:56:58 GMT
19
+ Fri, 11 Jul 2025 15:59:24 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.6.6..@fluentui/react-input_v9.6.7)
11
21
 
12
22
  ### Patches
@@ -0,0 +1,330 @@
1
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
2
+ import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';
3
+ export const inputClassNames = {
4
+ root: 'fui-Input',
5
+ input: 'fui-Input__input',
6
+ contentBefore: 'fui-Input__contentBefore',
7
+ contentAfter: 'fui-Input__contentAfter'
8
+ };
9
+ // TODO(sharing) should these be shared somewhere?
10
+ const fieldHeights = {
11
+ small: '24px',
12
+ medium: '32px',
13
+ large: '40px'
14
+ };
15
+ // With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.
16
+ // If there is contentBefore or contentAfter, then the root and input slots use their individual padding.
17
+ const horizontalPadding = {
18
+ root: {
19
+ small: tokens.spacingHorizontalSNudge,
20
+ medium: tokens.spacingHorizontalMNudge,
21
+ large: tokens.spacingHorizontalM
22
+ },
23
+ input: {
24
+ small: tokens.spacingHorizontalXXS,
25
+ medium: tokens.spacingHorizontalXXS,
26
+ large: tokens.spacingHorizontalSNudge
27
+ },
28
+ combined: {
29
+ small: tokens.spacingHorizontalS,
30
+ medium: tokens.spacingHorizontalM,
31
+ large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`
32
+ }
33
+ };
34
+ const useRootClassName = makeResetStyles({
35
+ display: 'inline-flex',
36
+ alignItems: 'center',
37
+ flexWrap: 'nowrap',
38
+ gap: tokens.spacingHorizontalXXS,
39
+ borderRadius: tokens.borderRadiusMedium,
40
+ position: 'relative',
41
+ boxSizing: 'border-box',
42
+ verticalAlign: 'middle',
43
+ // size: medium (default)
44
+ minHeight: fieldHeights.medium,
45
+ ...typographyStyles.body1,
46
+ // appearance: outline (default)
47
+ backgroundColor: tokens.colorNeutralBackground1,
48
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
49
+ borderBottomColor: tokens.colorNeutralStrokeAccessible,
50
+ // This is all for the bottom focus border.
51
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
52
+ '::after': {
53
+ boxSizing: 'border-box',
54
+ content: '""',
55
+ position: 'absolute',
56
+ left: '-1px',
57
+ bottom: '-1px',
58
+ right: '-1px',
59
+ // Maintaining the correct corner radius:
60
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
61
+ // (Otherwise the radius would be automatically reduced to fit available space.)
62
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
63
+ height: `max(2px, ${tokens.borderRadiusMedium})`,
64
+ borderBottomLeftRadius: tokens.borderRadiusMedium,
65
+ borderBottomRightRadius: tokens.borderRadiusMedium,
66
+ // Flat 2px border:
67
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
68
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
69
+ // borderBottom makes it easier for people to override the color if needed.)
70
+ borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,
71
+ clipPath: 'inset(calc(100% - 2px) 0 0 0)',
72
+ // Animation for focus OUT
73
+ transform: 'scaleX(0)',
74
+ transitionProperty: 'transform',
75
+ transitionDuration: tokens.durationUltraFast,
76
+ transitionDelay: tokens.curveAccelerateMid,
77
+ '@media screen and (prefers-reduced-motion: reduce)': {
78
+ transitionDuration: '0.01ms',
79
+ transitionDelay: '0.01ms'
80
+ }
81
+ },
82
+ ':focus-within::after': {
83
+ // Animation for focus IN
84
+ transform: 'scaleX(1)',
85
+ transitionProperty: 'transform',
86
+ transitionDuration: tokens.durationNormal,
87
+ transitionDelay: tokens.curveDecelerateMid,
88
+ '@media screen and (prefers-reduced-motion: reduce)': {
89
+ transitionDuration: '0.01ms',
90
+ transitionDelay: '0.01ms'
91
+ }
92
+ },
93
+ ':focus-within:active::after': {
94
+ // This is if the user clicks the field again while it's already focused
95
+ borderBottomColor: tokens.colorCompoundBrandStrokePressed
96
+ },
97
+ ':focus-within': {
98
+ outline: '2px solid transparent'
99
+ }
100
+ });
101
+ const useRootStyles = makeStyles({
102
+ small: {
103
+ minHeight: fieldHeights.small,
104
+ ...typographyStyles.caption1
105
+ },
106
+ medium: {
107
+ },
108
+ large: {
109
+ minHeight: fieldHeights.large,
110
+ ...typographyStyles.body2,
111
+ gap: tokens.spacingHorizontalSNudge
112
+ },
113
+ outline: {
114
+ },
115
+ outlineInteractive: {
116
+ ':hover': {
117
+ ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),
118
+ borderBottomColor: tokens.colorNeutralStrokeAccessibleHover
119
+ },
120
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
121
+ ':active,:focus-within': {
122
+ ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),
123
+ borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed
124
+ }
125
+ },
126
+ underline: {
127
+ backgroundColor: tokens.colorTransparentBackground,
128
+ borderRadius: '0',
129
+ // border is specified in rootBaseStyles, but we only want a bottom border here
130
+ borderTopStyle: 'none',
131
+ borderRightStyle: 'none',
132
+ borderLeftStyle: 'none',
133
+ // Make the focus underline (::after) match the width of the bottom border
134
+ '::after': {
135
+ left: 0,
136
+ right: 0
137
+ }
138
+ },
139
+ underlineInteractive: {
140
+ ':hover': {
141
+ borderBottomColor: tokens.colorNeutralStrokeAccessibleHover
142
+ },
143
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
144
+ ':active,:focus-within': {
145
+ borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed
146
+ },
147
+ '::after': {
148
+ // remove rounded corners from focus underline
149
+ borderRadius: '0'
150
+ }
151
+ },
152
+ filled: {
153
+ ...shorthands.borderColor(tokens.colorTransparentStroke)
154
+ },
155
+ filledInteractive: {
156
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
157
+ ':hover,:focus-within': {
158
+ // also handles pressed border color (:active)
159
+ ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive)
160
+ }
161
+ },
162
+ invalid: {
163
+ ':not(:focus-within),:hover:not(:focus-within)': {
164
+ ...shorthands.borderColor(tokens.colorPaletteRedBorder2)
165
+ }
166
+ },
167
+ 'filled-darker': {
168
+ backgroundColor: tokens.colorNeutralBackground3
169
+ },
170
+ 'filled-lighter': {
171
+ backgroundColor: tokens.colorNeutralBackground1
172
+ },
173
+ // This shadow appearance is deprecated and will be removed in a future release.
174
+ 'filled-darker-shadow': {
175
+ backgroundColor: tokens.colorNeutralBackground3,
176
+ boxShadow: tokens.shadow2
177
+ },
178
+ // This shadow appearance is deprecated and will be removed in a future release.
179
+ 'filled-lighter-shadow': {
180
+ backgroundColor: tokens.colorNeutralBackground1,
181
+ boxShadow: tokens.shadow2
182
+ },
183
+ disabled: {
184
+ cursor: 'not-allowed',
185
+ backgroundColor: tokens.colorTransparentBackground,
186
+ ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),
187
+ '@media (forced-colors: active)': {
188
+ ...shorthands.borderColor('GrayText')
189
+ },
190
+ // remove the focus border
191
+ '::after': {
192
+ content: 'unset'
193
+ },
194
+ // remove the focus outline
195
+ ':focus-within': {
196
+ outlineStyle: 'none'
197
+ }
198
+ },
199
+ smallWithContentBefore: {
200
+ paddingLeft: horizontalPadding.root.small
201
+ },
202
+ smallWithContentAfter: {
203
+ paddingRight: horizontalPadding.root.small
204
+ },
205
+ mediumWithContentBefore: {
206
+ paddingLeft: horizontalPadding.root.medium
207
+ },
208
+ mediumWithContentAfter: {
209
+ paddingRight: horizontalPadding.root.medium
210
+ },
211
+ largeWithContentBefore: {
212
+ paddingLeft: horizontalPadding.root.large
213
+ },
214
+ largeWithContentAfter: {
215
+ paddingRight: horizontalPadding.root.large
216
+ }
217
+ });
218
+ const useInputClassName = makeResetStyles({
219
+ alignSelf: 'stretch',
220
+ boxSizing: 'border-box',
221
+ flexGrow: 1,
222
+ minWidth: 0,
223
+ borderStyle: 'none',
224
+ padding: `0 ${horizontalPadding.combined.medium}`,
225
+ color: tokens.colorNeutralForeground1,
226
+ // Use literal "transparent" (not from the theme) to always let the color from the root show through
227
+ backgroundColor: 'transparent',
228
+ '::placeholder': {
229
+ color: tokens.colorNeutralForeground4,
230
+ opacity: 1
231
+ },
232
+ outlineStyle: 'none',
233
+ // Inherit typography styles from root
234
+ fontFamily: 'inherit',
235
+ fontSize: 'inherit',
236
+ fontWeight: 'inherit',
237
+ lineHeight: 'inherit'
238
+ });
239
+ const useInputElementStyles = makeStyles({
240
+ small: {
241
+ paddingLeft: horizontalPadding.combined.small,
242
+ paddingRight: horizontalPadding.combined.small
243
+ },
244
+ medium: {
245
+ },
246
+ large: {
247
+ paddingLeft: horizontalPadding.combined.large,
248
+ paddingRight: horizontalPadding.combined.large
249
+ },
250
+ smallWithContentBefore: {
251
+ paddingLeft: horizontalPadding.input.small
252
+ },
253
+ smallWithContentAfter: {
254
+ paddingRight: horizontalPadding.input.small
255
+ },
256
+ mediumWithContentBefore: {
257
+ paddingLeft: horizontalPadding.input.medium
258
+ },
259
+ mediumWithContentAfter: {
260
+ paddingRight: horizontalPadding.input.medium
261
+ },
262
+ largeWithContentBefore: {
263
+ paddingLeft: horizontalPadding.input.large
264
+ },
265
+ largeWithContentAfter: {
266
+ paddingRight: horizontalPadding.input.large
267
+ },
268
+ disabled: {
269
+ color: tokens.colorNeutralForegroundDisabled,
270
+ backgroundColor: tokens.colorTransparentBackground,
271
+ cursor: 'not-allowed',
272
+ '::placeholder': {
273
+ color: tokens.colorNeutralForegroundDisabled
274
+ }
275
+ }
276
+ });
277
+ const useContentClassName = makeResetStyles({
278
+ boxSizing: 'border-box',
279
+ color: tokens.colorNeutralForeground3,
280
+ display: 'flex',
281
+ // special case styling for icons (most common case) to ensure they're centered vertically
282
+ // size: medium (default)
283
+ '> svg': {
284
+ fontSize: '20px'
285
+ }
286
+ });
287
+ const useContentStyles = makeStyles({
288
+ disabled: {
289
+ color: tokens.colorNeutralForegroundDisabled
290
+ },
291
+ // Ensure resizable icons show up with the proper font size
292
+ small: {
293
+ '> svg': {
294
+ fontSize: '16px'
295
+ }
296
+ },
297
+ medium: {
298
+ },
299
+ large: {
300
+ '> svg': {
301
+ fontSize: '24px'
302
+ }
303
+ }
304
+ });
305
+ /**
306
+ * Apply styling to the Input slots based on the state
307
+ */ export const useInputStyles_unstable = (state)=>{
308
+ 'use no memo';
309
+ const { size, appearance } = state;
310
+ const disabled = state.input.disabled;
311
+ const invalid = `${state.input['aria-invalid']}` === 'true';
312
+ const filled = appearance.startsWith('filled');
313
+ const rootStyles = useRootStyles();
314
+ const inputStyles = useInputElementStyles();
315
+ const contentStyles = useContentStyles();
316
+ state.root.className = mergeClasses(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);
317
+ state.input.className = mergeClasses(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);
318
+ const contentClasses = [
319
+ useContentClassName(),
320
+ disabled && contentStyles.disabled,
321
+ contentStyles[size]
322
+ ];
323
+ if (state.contentBefore) {
324
+ state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
325
+ }
326
+ if (state.contentAfter) {
327
+ state.contentAfter.className = mergeClasses(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);
328
+ }
329
+ return state;
330
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Input/useInputStyles.styles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM,\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge,\n },\n combined: {\n small: tokens.spacingHorizontalS, // SNudge + XXS\n medium: tokens.spacingHorizontalM, // MNudge + XXS\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n },\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge,\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0', // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0',\n },\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large,\n },\n});\n\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small,\n },\n medium: {\n // Included in useInputClassName\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large,\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n 'use no memo';\n\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n state.contentBefore && rootStyles[`${size}WithContentBefore`],\n state.contentAfter && rootStyles[`${size}WithContentAfter`],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n inputStyles[size],\n state.contentBefore && inputStyles[`${size}WithContentBefore`],\n state.contentAfter && inputStyles[`${size}WithContentAfter`],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","shorthands","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","display","alignItems","flexWrap","gap","borderRadius","borderRadiusMedium","position","boxSizing","verticalAlign","minHeight","body1","backgroundColor","colorNeutralBackground1","border","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","colorCompoundBrandStrokePressed","outline","useRootStyles","caption1","body2","outlineInteractive","borderColor","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","underline","colorTransparentBackground","borderTopStyle","borderRightStyle","borderLeftStyle","underlineInteractive","filled","colorTransparentStroke","filledInteractive","colorTransparentStrokeInteractive","invalid","colorPaletteRedBorder2","colorNeutralBackground3","boxShadow","shadow2","disabled","cursor","colorNeutralStrokeDisabled","outlineStyle","smallWithContentBefore","paddingLeft","smallWithContentAfter","paddingRight","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","useInputClassName","alignSelf","flexGrow","minWidth","borderStyle","padding","color","colorNeutralForeground1","colorNeutralForeground4","opacity","fontFamily","fontSize","fontWeight","lineHeight","useInputElementStyles","colorNeutralForegroundDisabled","useContentClassName","colorNeutralForeground3","useContentStyles","useInputStyles_unstable","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","contentClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,eAAe,EAAEC,UAAU,EAAEC,YAAY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BAAgBI,YAAY,KACzBkH,gBACHR,MAAM1G,YAAY,CAACiH,SAAS;IAEhC;IAEA,OAAOP;AACT,EAAE"}
@@ -0,0 +1,342 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ inputClassNames: function() {
13
+ return inputClassNames;
14
+ },
15
+ useInputStyles_unstable: function() {
16
+ return useInputStyles_unstable;
17
+ }
18
+ });
19
+ const _reacttheme = require("@fluentui/react-theme");
20
+ const _react = require("@griffel/react");
21
+ const inputClassNames = {
22
+ root: 'fui-Input',
23
+ input: 'fui-Input__input',
24
+ contentBefore: 'fui-Input__contentBefore',
25
+ contentAfter: 'fui-Input__contentAfter'
26
+ };
27
+ // TODO(sharing) should these be shared somewhere?
28
+ const fieldHeights = {
29
+ small: '24px',
30
+ medium: '32px',
31
+ large: '40px'
32
+ };
33
+ // With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.
34
+ // If there is contentBefore or contentAfter, then the root and input slots use their individual padding.
35
+ const horizontalPadding = {
36
+ root: {
37
+ small: _reacttheme.tokens.spacingHorizontalSNudge,
38
+ medium: _reacttheme.tokens.spacingHorizontalMNudge,
39
+ large: _reacttheme.tokens.spacingHorizontalM
40
+ },
41
+ input: {
42
+ small: _reacttheme.tokens.spacingHorizontalXXS,
43
+ medium: _reacttheme.tokens.spacingHorizontalXXS,
44
+ large: _reacttheme.tokens.spacingHorizontalSNudge
45
+ },
46
+ combined: {
47
+ small: _reacttheme.tokens.spacingHorizontalS,
48
+ medium: _reacttheme.tokens.spacingHorizontalM,
49
+ large: `calc(${_reacttheme.tokens.spacingHorizontalM} + ${_reacttheme.tokens.spacingHorizontalSNudge})`
50
+ }
51
+ };
52
+ const useRootClassName = (0, _react.makeResetStyles)({
53
+ display: 'inline-flex',
54
+ alignItems: 'center',
55
+ flexWrap: 'nowrap',
56
+ gap: _reacttheme.tokens.spacingHorizontalXXS,
57
+ borderRadius: _reacttheme.tokens.borderRadiusMedium,
58
+ position: 'relative',
59
+ boxSizing: 'border-box',
60
+ verticalAlign: 'middle',
61
+ // size: medium (default)
62
+ minHeight: fieldHeights.medium,
63
+ ..._reacttheme.typographyStyles.body1,
64
+ // appearance: outline (default)
65
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
66
+ border: `1px solid ${_reacttheme.tokens.colorNeutralStroke1}`,
67
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible,
68
+ // This is all for the bottom focus border.
69
+ // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
70
+ '::after': {
71
+ boxSizing: 'border-box',
72
+ content: '""',
73
+ position: 'absolute',
74
+ left: '-1px',
75
+ bottom: '-1px',
76
+ right: '-1px',
77
+ // Maintaining the correct corner radius:
78
+ // Use the whole border-radius as the height and only put radii on the bottom corners.
79
+ // (Otherwise the radius would be automatically reduced to fit available space.)
80
+ // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
81
+ height: `max(2px, ${_reacttheme.tokens.borderRadiusMedium})`,
82
+ borderBottomLeftRadius: _reacttheme.tokens.borderRadiusMedium,
83
+ borderBottomRightRadius: _reacttheme.tokens.borderRadiusMedium,
84
+ // Flat 2px border:
85
+ // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
86
+ // (This could be done without trimming using `background: linear-gradient(...)`, but using
87
+ // borderBottom makes it easier for people to override the color if needed.)
88
+ borderBottom: `2px solid ${_reacttheme.tokens.colorCompoundBrandStroke}`,
89
+ clipPath: 'inset(calc(100% - 2px) 0 0 0)',
90
+ // Animation for focus OUT
91
+ transform: 'scaleX(0)',
92
+ transitionProperty: 'transform',
93
+ transitionDuration: _reacttheme.tokens.durationUltraFast,
94
+ transitionDelay: _reacttheme.tokens.curveAccelerateMid,
95
+ '@media screen and (prefers-reduced-motion: reduce)': {
96
+ transitionDuration: '0.01ms',
97
+ transitionDelay: '0.01ms'
98
+ }
99
+ },
100
+ ':focus-within::after': {
101
+ // Animation for focus IN
102
+ transform: 'scaleX(1)',
103
+ transitionProperty: 'transform',
104
+ transitionDuration: _reacttheme.tokens.durationNormal,
105
+ transitionDelay: _reacttheme.tokens.curveDecelerateMid,
106
+ '@media screen and (prefers-reduced-motion: reduce)': {
107
+ transitionDuration: '0.01ms',
108
+ transitionDelay: '0.01ms'
109
+ }
110
+ },
111
+ ':focus-within:active::after': {
112
+ // This is if the user clicks the field again while it's already focused
113
+ borderBottomColor: _reacttheme.tokens.colorCompoundBrandStrokePressed
114
+ },
115
+ ':focus-within': {
116
+ outline: '2px solid transparent'
117
+ }
118
+ });
119
+ const useRootStyles = (0, _react.makeStyles)({
120
+ small: {
121
+ minHeight: fieldHeights.small,
122
+ ..._reacttheme.typographyStyles.caption1
123
+ },
124
+ medium: {},
125
+ large: {
126
+ minHeight: fieldHeights.large,
127
+ ..._reacttheme.typographyStyles.body2,
128
+ gap: _reacttheme.tokens.spacingHorizontalSNudge
129
+ },
130
+ outline: {},
131
+ outlineInteractive: {
132
+ ':hover': {
133
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Hover),
134
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
135
+ },
136
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
137
+ ':active,:focus-within': {
138
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
139
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
140
+ }
141
+ },
142
+ underline: {
143
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
144
+ borderRadius: '0',
145
+ // border is specified in rootBaseStyles, but we only want a bottom border here
146
+ borderTopStyle: 'none',
147
+ borderRightStyle: 'none',
148
+ borderLeftStyle: 'none',
149
+ // Make the focus underline (::after) match the width of the bottom border
150
+ '::after': {
151
+ left: 0,
152
+ right: 0
153
+ }
154
+ },
155
+ underlineInteractive: {
156
+ ':hover': {
157
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
158
+ },
159
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
160
+ ':active,:focus-within': {
161
+ borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
162
+ },
163
+ '::after': {
164
+ // remove rounded corners from focus underline
165
+ borderRadius: '0'
166
+ }
167
+ },
168
+ filled: {
169
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorTransparentStroke)
170
+ },
171
+ filledInteractive: {
172
+ // DO NOT add a space between the selectors! It changes the behavior of make-styles.
173
+ ':hover,:focus-within': {
174
+ // also handles pressed border color (:active)
175
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorTransparentStrokeInteractive)
176
+ }
177
+ },
178
+ invalid: {
179
+ ':not(:focus-within),:hover:not(:focus-within)': {
180
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorPaletteRedBorder2)
181
+ }
182
+ },
183
+ 'filled-darker': {
184
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3
185
+ },
186
+ 'filled-lighter': {
187
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1
188
+ },
189
+ // This shadow appearance is deprecated and will be removed in a future release.
190
+ 'filled-darker-shadow': {
191
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
192
+ boxShadow: _reacttheme.tokens.shadow2
193
+ },
194
+ // This shadow appearance is deprecated and will be removed in a future release.
195
+ 'filled-lighter-shadow': {
196
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
197
+ boxShadow: _reacttheme.tokens.shadow2
198
+ },
199
+ disabled: {
200
+ cursor: 'not-allowed',
201
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
202
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
203
+ '@media (forced-colors: active)': {
204
+ ..._react.shorthands.borderColor('GrayText')
205
+ },
206
+ // remove the focus border
207
+ '::after': {
208
+ content: 'unset'
209
+ },
210
+ // remove the focus outline
211
+ ':focus-within': {
212
+ outlineStyle: 'none'
213
+ }
214
+ },
215
+ smallWithContentBefore: {
216
+ paddingLeft: horizontalPadding.root.small
217
+ },
218
+ smallWithContentAfter: {
219
+ paddingRight: horizontalPadding.root.small
220
+ },
221
+ mediumWithContentBefore: {
222
+ paddingLeft: horizontalPadding.root.medium
223
+ },
224
+ mediumWithContentAfter: {
225
+ paddingRight: horizontalPadding.root.medium
226
+ },
227
+ largeWithContentBefore: {
228
+ paddingLeft: horizontalPadding.root.large
229
+ },
230
+ largeWithContentAfter: {
231
+ paddingRight: horizontalPadding.root.large
232
+ }
233
+ });
234
+ const useInputClassName = (0, _react.makeResetStyles)({
235
+ alignSelf: 'stretch',
236
+ boxSizing: 'border-box',
237
+ flexGrow: 1,
238
+ minWidth: 0,
239
+ borderStyle: 'none',
240
+ padding: `0 ${horizontalPadding.combined.medium}`,
241
+ color: _reacttheme.tokens.colorNeutralForeground1,
242
+ // Use literal "transparent" (not from the theme) to always let the color from the root show through
243
+ backgroundColor: 'transparent',
244
+ '::placeholder': {
245
+ color: _reacttheme.tokens.colorNeutralForeground4,
246
+ opacity: 1
247
+ },
248
+ outlineStyle: 'none',
249
+ // Inherit typography styles from root
250
+ fontFamily: 'inherit',
251
+ fontSize: 'inherit',
252
+ fontWeight: 'inherit',
253
+ lineHeight: 'inherit'
254
+ });
255
+ const useInputElementStyles = (0, _react.makeStyles)({
256
+ small: {
257
+ paddingLeft: horizontalPadding.combined.small,
258
+ paddingRight: horizontalPadding.combined.small
259
+ },
260
+ medium: {},
261
+ large: {
262
+ paddingLeft: horizontalPadding.combined.large,
263
+ paddingRight: horizontalPadding.combined.large
264
+ },
265
+ smallWithContentBefore: {
266
+ paddingLeft: horizontalPadding.input.small
267
+ },
268
+ smallWithContentAfter: {
269
+ paddingRight: horizontalPadding.input.small
270
+ },
271
+ mediumWithContentBefore: {
272
+ paddingLeft: horizontalPadding.input.medium
273
+ },
274
+ mediumWithContentAfter: {
275
+ paddingRight: horizontalPadding.input.medium
276
+ },
277
+ largeWithContentBefore: {
278
+ paddingLeft: horizontalPadding.input.large
279
+ },
280
+ largeWithContentAfter: {
281
+ paddingRight: horizontalPadding.input.large
282
+ },
283
+ disabled: {
284
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
285
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
286
+ cursor: 'not-allowed',
287
+ '::placeholder': {
288
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
289
+ }
290
+ }
291
+ });
292
+ const useContentClassName = (0, _react.makeResetStyles)({
293
+ boxSizing: 'border-box',
294
+ color: _reacttheme.tokens.colorNeutralForeground3,
295
+ display: 'flex',
296
+ // special case styling for icons (most common case) to ensure they're centered vertically
297
+ // size: medium (default)
298
+ '> svg': {
299
+ fontSize: '20px'
300
+ }
301
+ });
302
+ const useContentStyles = (0, _react.makeStyles)({
303
+ disabled: {
304
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
305
+ },
306
+ // Ensure resizable icons show up with the proper font size
307
+ small: {
308
+ '> svg': {
309
+ fontSize: '16px'
310
+ }
311
+ },
312
+ medium: {},
313
+ large: {
314
+ '> svg': {
315
+ fontSize: '24px'
316
+ }
317
+ }
318
+ });
319
+ const useInputStyles_unstable = (state)=>{
320
+ 'use no memo';
321
+ const { size, appearance } = state;
322
+ const disabled = state.input.disabled;
323
+ const invalid = `${state.input['aria-invalid']}` === 'true';
324
+ const filled = appearance.startsWith('filled');
325
+ const rootStyles = useRootStyles();
326
+ const inputStyles = useInputElementStyles();
327
+ const contentStyles = useContentStyles();
328
+ state.root.className = (0, _react.mergeClasses)(inputClassNames.root, useRootClassName(), rootStyles[size], state.contentBefore && rootStyles[`${size}WithContentBefore`], state.contentAfter && rootStyles[`${size}WithContentAfter`], rootStyles[appearance], !disabled && appearance === 'outline' && rootStyles.outlineInteractive, !disabled && appearance === 'underline' && rootStyles.underlineInteractive, !disabled && filled && rootStyles.filledInteractive, filled && rootStyles.filled, !disabled && invalid && rootStyles.invalid, disabled && rootStyles.disabled, state.root.className);
329
+ state.input.className = (0, _react.mergeClasses)(inputClassNames.input, useInputClassName(), inputStyles[size], state.contentBefore && inputStyles[`${size}WithContentBefore`], state.contentAfter && inputStyles[`${size}WithContentAfter`], disabled && inputStyles.disabled, state.input.className);
330
+ const contentClasses = [
331
+ useContentClassName(),
332
+ disabled && contentStyles.disabled,
333
+ contentStyles[size]
334
+ ];
335
+ if (state.contentBefore) {
336
+ state.contentBefore.className = (0, _react.mergeClasses)(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
337
+ }
338
+ if (state.contentAfter) {
339
+ state.contentAfter.className = (0, _react.mergeClasses)(inputClassNames.contentAfter, ...contentClasses, state.contentAfter.className);
340
+ }
341
+ return state;
342
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Input/useInputStyles.styles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n// With no contentBefore or contentAfter, the input slot uses combined padding to increase its hit target.\n// If there is contentBefore or contentAfter, then the root and input slots use their individual padding.\nconst horizontalPadding = {\n root: {\n small: tokens.spacingHorizontalSNudge,\n medium: tokens.spacingHorizontalMNudge,\n large: tokens.spacingHorizontalM,\n },\n input: {\n small: tokens.spacingHorizontalXXS,\n medium: tokens.spacingHorizontalXXS,\n large: tokens.spacingHorizontalSNudge,\n },\n combined: {\n small: tokens.spacingHorizontalS, // SNudge + XXS\n medium: tokens.spacingHorizontalM, // MNudge + XXS\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n },\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n verticalAlign: 'middle',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n ...typographyStyles.body2,\n gap: tokens.spacingHorizontalSNudge,\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRadius: '0', // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': {\n // remove rounded corners from focus underline\n borderRadius: '0',\n },\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n // This shadow appearance is deprecated and will be removed in a future release.\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.root.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.root.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.root.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.root.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.root.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.root.large,\n },\n});\n\nconst useInputClassName = makeResetStyles({\n alignSelf: 'stretch',\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${horizontalPadding.combined.medium}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n small: {\n paddingLeft: horizontalPadding.combined.small,\n paddingRight: horizontalPadding.combined.small,\n },\n medium: {\n // Included in useInputClassName\n },\n large: {\n paddingLeft: horizontalPadding.combined.large,\n paddingRight: horizontalPadding.combined.large,\n },\n smallWithContentBefore: {\n paddingLeft: horizontalPadding.input.small,\n },\n smallWithContentAfter: {\n paddingRight: horizontalPadding.input.small,\n },\n mediumWithContentBefore: {\n paddingLeft: horizontalPadding.input.medium,\n },\n mediumWithContentAfter: {\n paddingRight: horizontalPadding.input.medium,\n },\n largeWithContentBefore: {\n paddingLeft: horizontalPadding.input.large,\n },\n largeWithContentAfter: {\n paddingRight: horizontalPadding.input.large,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n 'use no memo';\n\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n state.contentBefore && rootStyles[`${size}WithContentBefore`],\n state.contentAfter && rootStyles[`${size}WithContentAfter`],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n inputStyles[size],\n state.contentBefore && inputStyles[`${size}WithContentBefore`],\n state.contentAfter && inputStyles[`${size}WithContentAfter`],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["inputClassNames","useInputStyles_unstable","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","horizontalPadding","tokens","spacingHorizontalSNudge","spacingHorizontalMNudge","spacingHorizontalM","spacingHorizontalXXS","combined","spacingHorizontalS","useRootClassName","makeResetStyles","display","alignItems","flexWrap","gap","borderRadius","borderRadiusMedium","position","boxSizing","verticalAlign","minHeight","typographyStyles","body1","backgroundColor","colorNeutralBackground1","border","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","colorCompoundBrandStrokePressed","outline","useRootStyles","makeStyles","caption1","body2","outlineInteractive","shorthands","borderColor","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","underline","colorTransparentBackground","borderTopStyle","borderRightStyle","borderLeftStyle","underlineInteractive","filled","colorTransparentStroke","filledInteractive","colorTransparentStrokeInteractive","invalid","colorPaletteRedBorder2","colorNeutralBackground3","boxShadow","shadow2","disabled","cursor","colorNeutralStrokeDisabled","outlineStyle","smallWithContentBefore","paddingLeft","smallWithContentAfter","paddingRight","mediumWithContentBefore","mediumWithContentAfter","largeWithContentBefore","largeWithContentAfter","useInputClassName","alignSelf","flexGrow","minWidth","borderStyle","padding","color","colorNeutralForeground1","colorNeutralForeground4","opacity","fontFamily","fontSize","fontWeight","lineHeight","useInputElementStyles","colorNeutralForegroundDisabled","useContentClassName","colorNeutralForeground3","useContentStyles","state","size","appearance","startsWith","rootStyles","inputStyles","contentStyles","className","mergeClasses","contentClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,eAAAA;eAAAA;;IAmUAC,uBAAAA;eAAAA;;;4BAxU4B;uBAE6B;AAG/D,MAAMD,kBAA8C;IACzDE,MAAM;IACNC,OAAO;IACPC,eAAe;IACfC,cAAc;AAChB;AAEA,kDAAkD;AAClD,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K,gBAAgB,CAAC,CAAC,EAC5DhC,YAAYoC,YAAYpC,QAAQ,EAChC+B,MAAMhH,KAAK,CAACuH,SAAS;IAGvB,MAAME,iBAAiB;QAACZ;QAAuB5B,YAAYqC,cAAcrC,QAAQ;QAAEqC,aAAa,CAACL,KAAK;KAAC;IACvG,IAAID,MAAM/G,aAAa,EAAE;QACvB+G,MAAM/G,aAAa,CAACsH,SAAS,GAAGC,IAAAA,mBAAAA,EAC9B3H,gBAAgBI,aAAa,KAC1BwH,gBACHT,MAAM/G,aAAa,CAACsH,SAAS;IAEjC;IACA,IAAIP,MAAM9G,YAAY,EAAE;QACtB8G,MAAM9G,YAAY,CAACqH,SAAS,GAAGC,IAAAA,mBAAAA,EAC7B3H,gBAAgBK,YAAY,KACzBuH,gBACHT,MAAM9G,YAAY,CAACqH,SAAS;IAEhC;IAEA,OAAOP;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-input",
3
- "version": "9.6.7",
3
+ "version": "9.7.0",
4
4
  "description": "Fluent UI React Input component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -19,7 +19,7 @@
19
19
  "@fluentui/scripts-api-extractor": "*"
20
20
  },
21
21
  "dependencies": {
22
- "@fluentui/react-field": "^9.3.7",
22
+ "@fluentui/react-field": "^9.4.0",
23
23
  "@fluentui/react-jsx-runtime": "^9.1.2",
24
24
  "@fluentui/react-shared-contexts": "^9.24.0",
25
25
  "@fluentui/react-theme": "^9.1.24",