@fluentui/react-input 9.4.4 → 9.4.6

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 (63) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +85 -1
  3. package/CHANGELOG.md +29 -2
  4. package/lib/Input.js.map +1 -1
  5. package/lib/InputField.js.map +1 -1
  6. package/lib/components/Input/Input.js.map +1 -1
  7. package/lib/components/Input/Input.types.js +1 -1
  8. package/lib/components/Input/Input.types.js.map +1 -1
  9. package/lib/components/Input/index.js.map +1 -1
  10. package/lib/components/Input/renderInput.js +1 -9
  11. package/lib/components/Input/renderInput.js.map +1 -1
  12. package/lib/components/Input/useInput.js +3 -2
  13. package/lib/components/Input/useInput.js.map +1 -1
  14. package/lib/components/Input/useInputStyles.js.map +1 -1
  15. package/lib/components/InputField/InputField.js +1 -2
  16. package/lib/components/InputField/InputField.js.map +1 -1
  17. package/lib/components/InputField/index.js.map +1 -1
  18. package/lib/index.js.map +1 -1
  19. package/lib-commonjs/Input.js +5 -4
  20. package/lib-commonjs/Input.js.map +1 -1
  21. package/lib-commonjs/InputField.js +5 -4
  22. package/lib-commonjs/InputField.js.map +1 -1
  23. package/lib-commonjs/components/Input/Input.js +19 -20
  24. package/lib-commonjs/components/Input/Input.js.map +1 -1
  25. package/lib-commonjs/components/Input/Input.types.js +5 -2
  26. package/lib-commonjs/components/Input/Input.types.js.map +1 -1
  27. package/lib-commonjs/components/Input/index.js +9 -8
  28. package/lib-commonjs/components/Input/index.js.map +1 -1
  29. package/lib-commonjs/components/Input/renderInput.js +13 -24
  30. package/lib-commonjs/components/Input/renderInput.js.map +1 -1
  31. package/lib-commonjs/components/Input/useInput.js +66 -70
  32. package/lib-commonjs/components/Input/useInput.js.map +1 -1
  33. package/lib-commonjs/components/Input/useInputStyles.js +394 -178
  34. package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
  35. package/lib-commonjs/components/InputField/InputField.js +17 -11
  36. package/lib-commonjs/components/InputField/InputField.js.map +1 -1
  37. package/lib-commonjs/components/InputField/index.js +5 -4
  38. package/lib-commonjs/components/InputField/index.js.map +1 -1
  39. package/lib-commonjs/index.js +21 -49
  40. package/lib-commonjs/index.js.map +1 -1
  41. package/package.json +10 -9
  42. package/lib-amd/Input.js +0 -6
  43. package/lib-amd/Input.js.map +0 -1
  44. package/lib-amd/InputField.js +0 -6
  45. package/lib-amd/InputField.js.map +0 -1
  46. package/lib-amd/components/Input/Input.js +0 -17
  47. package/lib-amd/components/Input/Input.js.map +0 -1
  48. package/lib-amd/components/Input/Input.types.js +0 -5
  49. package/lib-amd/components/Input/Input.types.js.map +0 -1
  50. package/lib-amd/components/Input/index.js +0 -10
  51. package/lib-amd/components/Input/index.js.map +0 -1
  52. package/lib-amd/components/Input/renderInput.js +0 -17
  53. package/lib-amd/components/Input/renderInput.js.map +0 -1
  54. package/lib-amd/components/Input/useInput.js +0 -64
  55. package/lib-amd/components/Input/useInput.js.map +0 -1
  56. package/lib-amd/components/Input/useInputStyles.js +0 -214
  57. package/lib-amd/components/Input/useInputStyles.js.map +0 -1
  58. package/lib-amd/components/InputField/InputField.js +0 -10
  59. package/lib-amd/components/InputField/InputField.js.map +0 -1
  60. package/lib-amd/components/InputField/index.js +0 -6
  61. package/lib-amd/components/InputField/index.js.map +0 -1
  62. package/lib-amd/index.js +0 -13
  63. package/lib-amd/index.js.map +0 -1
@@ -1,214 +0,0 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"], function (require, exports, tslib_1, react_theme_1, react_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useInputStyles_unstable = exports.inputClassNames = void 0;
5
- exports.inputClassNames = {
6
- root: 'fui-Input',
7
- input: 'fui-Input__input',
8
- contentBefore: 'fui-Input__contentBefore',
9
- contentAfter: 'fui-Input__contentAfter',
10
- };
11
- // TODO(sharing) should these be shared somewhere?
12
- var fieldHeights = {
13
- small: '24px',
14
- medium: '32px',
15
- large: '40px',
16
- };
17
- var useRootClassName = react_1.makeResetStyles(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', alignItems: 'center', flexWrap: 'nowrap', gap: react_theme_1.tokens.spacingHorizontalXXS, borderRadius: react_theme_1.tokens.borderRadiusMedium, position: 'relative', boxSizing: 'border-box',
18
- // size: medium (default)
19
- minHeight: fieldHeights.medium, padding: "0 " + react_theme_1.tokens.spacingHorizontalMNudge }, react_theme_1.typographyStyles.body1), {
20
- // appearance: outline (default)
21
- backgroundColor: react_theme_1.tokens.colorNeutralBackground1, border: "1px solid " + react_theme_1.tokens.colorNeutralStroke1, borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessible,
22
- // This is all for the bottom focus border.
23
- // It's supposed to be 2px flat all the way across and match the radius of the field's corners.
24
- '::after': {
25
- boxSizing: 'border-box',
26
- content: '""',
27
- position: 'absolute',
28
- left: '-1px',
29
- bottom: '-1px',
30
- right: '-1px',
31
- // Maintaining the correct corner radius:
32
- // Use the whole border-radius as the height and only put radii on the bottom corners.
33
- // (Otherwise the radius would be automatically reduced to fit available space.)
34
- // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
35
- height: "max(2px, " + react_theme_1.tokens.borderRadiusMedium + ")",
36
- borderBottomLeftRadius: react_theme_1.tokens.borderRadiusMedium,
37
- borderBottomRightRadius: react_theme_1.tokens.borderRadiusMedium,
38
- // Flat 2px border:
39
- // By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
40
- // (This could be done without trimming using `background: linear-gradient(...)`, but using
41
- // borderBottom makes it easier for people to override the color if needed.)
42
- borderBottom: "2px solid " + react_theme_1.tokens.colorCompoundBrandStroke,
43
- clipPath: 'inset(calc(100% - 2px) 0 0 0)',
44
- // Animation for focus OUT
45
- transform: 'scaleX(0)',
46
- transitionProperty: 'transform',
47
- transitionDuration: react_theme_1.tokens.durationUltraFast,
48
- transitionDelay: react_theme_1.tokens.curveAccelerateMid,
49
- '@media screen and (prefers-reduced-motion: reduce)': {
50
- transitionDuration: '0.01ms',
51
- transitionDelay: '0.01ms',
52
- },
53
- }, ':focus-within::after': {
54
- // Animation for focus IN
55
- transform: 'scaleX(1)',
56
- transitionProperty: 'transform',
57
- transitionDuration: react_theme_1.tokens.durationNormal,
58
- transitionDelay: react_theme_1.tokens.curveDecelerateMid,
59
- '@media screen and (prefers-reduced-motion: reduce)': {
60
- transitionDuration: '0.01ms',
61
- transitionDelay: '0.01ms',
62
- },
63
- }, ':focus-within:active::after': {
64
- // This is if the user clicks the field again while it's already focused
65
- borderBottomColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
66
- }, ':focus-within': {
67
- outline: '2px solid transparent',
68
- } }));
69
- var useRootStyles = react_1.makeStyles({
70
- small: tslib_1.__assign({ minHeight: fieldHeights.small, paddingLeft: react_theme_1.tokens.spacingHorizontalSNudge, paddingRight: react_theme_1.tokens.spacingHorizontalSNudge }, react_theme_1.typographyStyles.caption1),
71
- medium: {
72
- // included in rootBaseStyles
73
- },
74
- large: tslib_1.__assign(tslib_1.__assign({ minHeight: fieldHeights.large, paddingLeft: react_theme_1.tokens.spacingHorizontalM, paddingRight: react_theme_1.tokens.spacingHorizontalM }, react_theme_1.typographyStyles.body2), react_1.shorthands.gap(react_theme_1.tokens.spacingHorizontalSNudge)),
75
- outline: {
76
- // included in rootBaseStyles
77
- },
78
- outlineInteractive: {
79
- ':hover': tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Hover)), { borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessibleHover }),
80
- // DO NOT add a space between the selectors! It changes the behavior of make-styles.
81
- ':active,:focus-within': tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Pressed)), { borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessiblePressed }),
82
- },
83
- underline: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderRadius(0)), {
84
- // border is specified in rootBaseStyles, but we only want a bottom border here
85
- borderTopStyle: 'none', borderRightStyle: 'none', borderLeftStyle: 'none',
86
- // Make the focus underline (::after) match the width of the bottom border
87
- '::after': {
88
- left: 0,
89
- right: 0,
90
- } }),
91
- underlineInteractive: {
92
- ':hover': {
93
- borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessibleHover,
94
- },
95
- // DO NOT add a space between the selectors! It changes the behavior of make-styles.
96
- ':active,:focus-within': {
97
- borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessiblePressed,
98
- },
99
- '::after': react_1.shorthands.borderRadius(0), // remove rounded corners from focus underline
100
- },
101
- filled: tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
102
- filledInteractive: {
103
- // DO NOT add a space between the selectors! It changes the behavior of make-styles.
104
- ':hover,:focus-within': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStrokeInteractive)),
105
- },
106
- invalid: {
107
- ':not(:focus-within),:hover:not(:focus-within)': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteRedBorder2)),
108
- },
109
- 'filled-darker': {
110
- backgroundColor: react_theme_1.tokens.colorNeutralBackground3,
111
- },
112
- 'filled-lighter': {
113
- backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
114
- },
115
- 'filled-darker-shadow': {
116
- backgroundColor: react_theme_1.tokens.colorNeutralBackground3,
117
- boxShadow: react_theme_1.tokens.shadow2,
118
- },
119
- 'filled-lighter-shadow': {
120
- backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
121
- boxShadow: react_theme_1.tokens.shadow2,
122
- },
123
- disabled: tslib_1.__assign(tslib_1.__assign({ cursor: 'not-allowed', backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), { '@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('GrayText')),
124
- // remove the focus border
125
- '::after': {
126
- content: 'unset',
127
- },
128
- // remove the focus outline
129
- ':focus-within': {
130
- outlineStyle: 'none',
131
- } }),
132
- });
133
- var useInputClassName = react_1.makeResetStyles({
134
- boxSizing: 'border-box',
135
- flexGrow: 1,
136
- minWidth: 0,
137
- borderStyle: 'none',
138
- padding: "0 " + react_theme_1.tokens.spacingHorizontalXXS,
139
- color: react_theme_1.tokens.colorNeutralForeground1,
140
- // Use literal "transparent" (not from the theme) to always let the color from the root show through
141
- backgroundColor: 'transparent',
142
- '::placeholder': {
143
- color: react_theme_1.tokens.colorNeutralForeground4,
144
- opacity: 1, // browser style override
145
- },
146
- outlineStyle: 'none',
147
- // Inherit typography styles from root
148
- fontFamily: 'inherit',
149
- fontSize: 'inherit',
150
- fontWeight: 'inherit',
151
- lineHeight: 'inherit',
152
- });
153
- var useInputElementStyles = react_1.makeStyles({
154
- large: {
155
- paddingLeft: react_theme_1.tokens.spacingHorizontalSNudge,
156
- paddingRight: react_theme_1.tokens.spacingHorizontalSNudge,
157
- },
158
- disabled: {
159
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
160
- backgroundColor: react_theme_1.tokens.colorTransparentBackground,
161
- cursor: 'not-allowed',
162
- '::placeholder': {
163
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
164
- },
165
- },
166
- });
167
- var useContentClassName = react_1.makeResetStyles({
168
- boxSizing: 'border-box',
169
- color: react_theme_1.tokens.colorNeutralForeground3,
170
- display: 'flex',
171
- // special case styling for icons (most common case) to ensure they're centered vertically
172
- // size: medium (default)
173
- '> svg': { fontSize: '20px' },
174
- });
175
- var useContentStyles = react_1.makeStyles({
176
- disabled: {
177
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
178
- },
179
- // Ensure resizable icons show up with the proper font size
180
- small: {
181
- '> svg': { fontSize: '16px' },
182
- },
183
- medium: {
184
- // included in useContentClassName
185
- },
186
- large: {
187
- '> svg': { fontSize: '24px' },
188
- },
189
- });
190
- /**
191
- * Apply styling to the Input slots based on the state
192
- */
193
- var useInputStyles_unstable = function (state) {
194
- var size = state.size, appearance = state.appearance;
195
- var disabled = state.input.disabled;
196
- var invalid = "" + state.input['aria-invalid'] === 'true';
197
- var filled = appearance.startsWith('filled');
198
- var rootStyles = useRootStyles();
199
- var inputStyles = useInputElementStyles();
200
- var contentStyles = useContentStyles();
201
- state.root.className = react_1.mergeClasses(exports.inputClassNames.root, useRootClassName(), rootStyles[size], 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);
202
- state.input.className = react_1.mergeClasses(exports.inputClassNames.input, useInputClassName(), size === 'large' && inputStyles.large, disabled && inputStyles.disabled, state.input.className);
203
- var contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];
204
- if (state.contentBefore) {
205
- state.contentBefore.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.inputClassNames.contentBefore], contentClasses), [state.contentBefore.className]));
206
- }
207
- if (state.contentAfter) {
208
- state.contentAfter.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.inputClassNames.contentAfter], contentClasses), [state.contentAfter.className]));
209
- }
210
- return state;
211
- };
212
- exports.useInputStyles_unstable = useInputStyles_unstable;
213
- });
214
- //# sourceMappingURL=useInputStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInputStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/Input/useInputStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,kBAAkB;QACzB,aAAa,EAAE,0BAA0B;QACzC,YAAY,EA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,QAAQ,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,kBAAkB,EACtE,CAAC,QAAQ,IAAI,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC,oBAAoB,EAC1E,CAAC,QAAQ,IAAI,MAAM,IAAI,UAAU,CAAC,iBAAiB,EACnD,MAAM,IAAI,UAAU,CAAC,MAAM,EAC3B,CAAC,QAAQ,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,EAC1C,QAAQ,IAAI,UAAU,CAAC,QAAQ,EAC/B,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,oBAAY,CAClC,uBAAe,CAAC,KAAK,EACrB,iBAAiB,EAAE,EACnB,IAAI,KAAK,OAAO,IAAI,WAAW,CAAC,KAAK,EACrC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAChC,KAAK,CAAC,KAAK,CAAC,SAAS,CACtB,CAAC;QAEF,IAAM,cAAc,GAAG,CAAC,mBAAmB,EAAE,EAAE,QAAQ,IAAI,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QACxG,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,oBAAY,4DAC1C,uBAAe,CAAC,aAAa,GAC1B,cAAc,IACjB,KAAK,CAAC,aAAa,CAAC,SAAS,GAC9B,CAAC;SACH;QACD,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,YAAY,CAAC,SAAS,GAAG,oBAAY,4DACzC,uBAAe,CAAC,YAAY,GACzB,cAAc,IACjB,KAAK,CAAC,YAAY,CAAC,SAAS,GAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjDW,QAAA,uBAAuB,2BAiDlC","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\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\n // size: medium (default)\n minHeight: fieldHeights.medium,\n padding: `0 ${tokens.spacingHorizontalMNudge}`,\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 paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalM,\n ...typographyStyles.body2,\n ...shorthands.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 ...shorthands.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': shorthands.borderRadius(0), // remove rounded corners from focus underline\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 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\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});\n\nconst useInputClassName = makeResetStyles({\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 ${tokens.spacingHorizontalXXS}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\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 large: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst 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 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 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 size === 'large' && inputStyles.large,\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"]}
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-field", "../../Input"], function (require, exports, react_field_1, Input_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.InputField = exports.inputFieldClassNames = void 0;
5
- /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
6
- exports.inputFieldClassNames = react_field_1.getDeprecatedFieldClassNames(Input_1.inputClassNames.root);
7
- /** @deprecated Use Field with Input: `<Field><Input /></Field>` */
8
- exports.InputField = react_field_1.makeDeprecatedField(Input_1.Input);
9
- });
10
- //# sourceMappingURL=InputField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/InputField/InputField.tsx"],"names":[],"mappings":";;;;IAOA,mEAAmE;IACtD,QAAA,oBAAoB,GAAG,0CAA4B,CAAC,uBAAe,CAAC,IAAI,CAAC,CAAC;IACvF,mEAAmE;IACtD,QAAA,UAAU,GAAyC,iCAAmB,CAAC,aAAK,CAAC,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Input, inputClassNames, InputProps } from '../../Input';\n\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport type InputFieldProps = DeprecatedFieldProps<InputProps>;\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const inputFieldClassNames = getDeprecatedFieldClassNames(inputClassNames.root);\n/** @deprecated Use Field with Input: `<Field><Input /></Field>` */\nexport const InputField: ForwardRefComponent<InputFieldProps> = makeDeprecatedField(Input);\n"]}
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./InputField"], function (require, exports, tslib_1, InputField_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(InputField_1, exports);
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/InputField/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B","sourcesContent":["export * from './InputField';\n"]}
package/lib-amd/index.js DELETED
@@ -1,13 +0,0 @@
1
- define(["require", "exports", "./Input", "./InputField"], function (require, exports, Input_1, InputField_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.inputFieldClassNames = exports.InputField_unstable = exports.useInput_unstable = exports.useInputStyles_unstable = exports.renderInput_unstable = exports.inputClassNames = exports.Input = void 0;
5
- Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return Input_1.Input; } });
6
- Object.defineProperty(exports, "inputClassNames", { enumerable: true, get: function () { return Input_1.inputClassNames; } });
7
- Object.defineProperty(exports, "renderInput_unstable", { enumerable: true, get: function () { return Input_1.renderInput_unstable; } });
8
- Object.defineProperty(exports, "useInputStyles_unstable", { enumerable: true, get: function () { return Input_1.useInputStyles_unstable; } });
9
- Object.defineProperty(exports, "useInput_unstable", { enumerable: true, get: function () { return Input_1.useInput_unstable; } });
10
- Object.defineProperty(exports, "InputField_unstable", { enumerable: true, get: function () { return InputField_1.InputField; } });
11
- Object.defineProperty(exports, "inputFieldClassNames", { enumerable: true, get: function () { return InputField_1.inputFieldClassNames; } });
12
- });
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-input/src/index.ts"],"names":[],"mappings":";;;;IAAS,8FAAA,KAAK,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,6GAAA,oBAAoB,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAAE,0GAAA,iBAAiB,OAAA;IAIxF,iHAAA,UAAU,OAAuB;IAAE,kHAAA,oBAAoB,OAAA","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { InputField as InputField_unstable, inputFieldClassNames } from './InputField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { InputFieldProps as InputFieldProps_unstable } from './InputField';\n"]}