@fluentui/react-input 9.0.0-beta.8 → 9.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +142 -1
- package/CHANGELOG.md +45 -2
- package/README.md +32 -0
- package/dist/index.d.ts +1 -6
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Input/Input.types.js.map +1 -1
- package/lib/components/Input/useInputStyles.js +36 -56
- package/lib/components/Input/useInputStyles.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Input/useInputStyles.js +36 -56
- package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -8
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -6
- package/lib/Input.d.ts +0 -1
- package/lib/components/Input/Input.d.ts +0 -6
- package/lib/components/Input/Input.types.d.ts +0 -79
- package/lib/components/Input/index.d.ts +0 -5
- package/lib/components/Input/renderInput.d.ts +0 -5
- package/lib/components/Input/useInput.d.ts +0 -12
- package/lib/components/Input/useInputStyles.d.ts +0 -11
- package/lib/index.d.ts +0 -2
- package/lib-commonjs/Input.d.ts +0 -1
- package/lib-commonjs/components/Input/Input.d.ts +0 -6
- package/lib-commonjs/components/Input/Input.types.d.ts +0 -79
- package/lib-commonjs/components/Input/index.d.ts +0 -5
- package/lib-commonjs/components/Input/renderInput.d.ts +0 -5
- package/lib-commonjs/components/Input/useInput.d.ts +0 -12
- package/lib-commonjs/components/Input/useInputStyles.d.ts +0 -11
- package/lib-commonjs/index.d.ts +0 -2
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useInputStyles_unstable = exports.inputClassNames =
|
|
6
|
+
exports.useInputStyles_unstable = exports.inputClassNames = void 0;
|
|
7
7
|
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `inputClassNames.root` instead.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
11
|
|
|
16
|
-
exports.inputClassName = 'fui-Input';
|
|
17
12
|
exports.inputClassNames = {
|
|
18
13
|
root: 'fui-Input',
|
|
19
14
|
input: 'fui-Input__input',
|
|
@@ -21,32 +16,9 @@ exports.inputClassNames = {
|
|
|
21
16
|
contentAfter: 'fui-Input__contentAfter'
|
|
22
17
|
}; // TODO(sharing) use theme values once available
|
|
23
18
|
|
|
24
|
-
const horizontalSpacing = {
|
|
25
|
-
xxs: '2px',
|
|
26
|
-
xs: '4px',
|
|
27
|
-
sNudge: '6px',
|
|
28
|
-
s: '8px',
|
|
29
|
-
mNudge: '10px',
|
|
30
|
-
m: '12px'
|
|
31
|
-
};
|
|
32
|
-
const motionDurations = {
|
|
33
|
-
ultraFast: '0.05s',
|
|
34
|
-
normal: '0.2s'
|
|
35
|
-
};
|
|
36
|
-
const motionCurves = {
|
|
37
|
-
accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',
|
|
38
|
-
decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)'
|
|
39
|
-
};
|
|
40
19
|
const contentSizes = {
|
|
41
|
-
// TODO
|
|
42
|
-
|
|
43
|
-
fontSize: react_theme_1.tokens.fontSizeBase300,
|
|
44
|
-
lineHeight: react_theme_1.tokens.lineHeightBase300
|
|
45
|
-
},
|
|
46
|
-
caption1: {
|
|
47
|
-
fontSize: react_theme_1.tokens.fontSizeBase200,
|
|
48
|
-
lineHeight: react_theme_1.tokens.lineHeightBase200
|
|
49
|
-
},
|
|
20
|
+
// TODO: This 400 style is not in the typography styles.
|
|
21
|
+
// May need a design change
|
|
50
22
|
400: {
|
|
51
23
|
fontSize: react_theme_1.tokens.fontSizeBase400,
|
|
52
24
|
lineHeight: react_theme_1.tokens.lineHeightBase400
|
|
@@ -64,8 +36,8 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
64
36
|
"mc9l5x": "ftuwxu6",
|
|
65
37
|
"Bt984gj": "f122n59",
|
|
66
38
|
"Eh141a": "flvyvdh",
|
|
67
|
-
"i8kkvl": "
|
|
68
|
-
"Belr9w4": "
|
|
39
|
+
"i8kkvl": "f14mj54c",
|
|
40
|
+
"Belr9w4": "fiut8dr",
|
|
69
41
|
"Bahqtrf": "fk6fouc",
|
|
70
42
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
71
43
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
@@ -90,12 +62,12 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
90
62
|
"Gjdm7m": "f13evtba",
|
|
91
63
|
"b1kco5": "f1yk9hq",
|
|
92
64
|
"Ba2ppi3": "fhwpy7i",
|
|
93
|
-
"F2fol1": "
|
|
94
|
-
"lck23g": "
|
|
65
|
+
"F2fol1": "f14ee0xe",
|
|
66
|
+
"lck23g": "f1xhbsuh",
|
|
95
67
|
"umuwi5": "fjw5xc1",
|
|
96
68
|
"Blcqepd": "f1xdyd5c",
|
|
97
|
-
"nplu4u": "
|
|
98
|
-
"Bioka5o": "
|
|
69
|
+
"nplu4u": "fatpbeo",
|
|
70
|
+
"Bioka5o": "fb7uyps",
|
|
99
71
|
"Bercvud": "f1ibeo51",
|
|
100
72
|
"Bbr2w1p": "f14a1fxs",
|
|
101
73
|
"Bduesf4": "f3e99gv",
|
|
@@ -104,31 +76,35 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
104
76
|
"small": {
|
|
105
77
|
"sshi5w": "f1pha7fy",
|
|
106
78
|
"z8tnut": "f1g0x7ka",
|
|
107
|
-
"z189sj": ["
|
|
79
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
108
80
|
"Byoj8tv": "f1qch9an",
|
|
109
|
-
"uwmqm3": ["
|
|
81
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
82
|
+
"Bahqtrf": "fk6fouc",
|
|
110
83
|
"Be2twd7": "fy9rknc",
|
|
84
|
+
"Bhrd7zp": "figsok6",
|
|
111
85
|
"Bg96gwp": "fwrc4pm"
|
|
112
86
|
},
|
|
113
87
|
"medium": {
|
|
114
88
|
"sshi5w": "f1nxs5xn",
|
|
115
89
|
"z8tnut": "f1g0x7ka",
|
|
116
|
-
"z189sj": ["
|
|
90
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
117
91
|
"Byoj8tv": "f1qch9an",
|
|
118
|
-
"uwmqm3": ["
|
|
92
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
93
|
+
"Bahqtrf": "fk6fouc",
|
|
119
94
|
"Be2twd7": "fkhj508",
|
|
95
|
+
"Bhrd7zp": "figsok6",
|
|
120
96
|
"Bg96gwp": "f1i3iumi"
|
|
121
97
|
},
|
|
122
98
|
"large": {
|
|
123
99
|
"sshi5w": "f1w5jphr",
|
|
124
100
|
"z8tnut": "f1g0x7ka",
|
|
125
|
-
"z189sj": ["
|
|
101
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
126
102
|
"Byoj8tv": "f1qch9an",
|
|
127
|
-
"uwmqm3": ["
|
|
103
|
+
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
128
104
|
"Be2twd7": "fod5ikn",
|
|
129
105
|
"Bg96gwp": "faaz57k",
|
|
130
|
-
"i8kkvl": "
|
|
131
|
-
"Belr9w4": "
|
|
106
|
+
"i8kkvl": "f1rjii52",
|
|
107
|
+
"Belr9w4": "f1r7g2jn"
|
|
132
108
|
},
|
|
133
109
|
"outline": {
|
|
134
110
|
"De3pzq": "fxugw4r",
|
|
@@ -194,10 +170,10 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
194
170
|
"nagaa4": "f1tpwn32",
|
|
195
171
|
"B1yhkcb": ["fsrcdbj", "f17blpuu"]
|
|
196
172
|
},
|
|
197
|
-
"
|
|
173
|
+
"filled-darker": {
|
|
198
174
|
"De3pzq": "f16xq7d1"
|
|
199
175
|
},
|
|
200
|
-
"
|
|
176
|
+
"filled-lighter": {
|
|
201
177
|
"De3pzq": "fxugw4r"
|
|
202
178
|
},
|
|
203
179
|
"disabled": {
|
|
@@ -225,10 +201,10 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
225
201
|
"n51gp8": ["f14g86mu", "f1rvyvqg"]
|
|
226
202
|
}
|
|
227
203
|
}, {
|
|
228
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".flvyvdh{-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}", ".
|
|
229
|
-
"w": [".fjw5xc1:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);}", ".f1xdyd5c:focus-within::after{transition-property:transform;}", ".
|
|
230
|
-
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fsrcdbj:hover
|
|
231
|
-
"a": [".f8vnjqi:active,.f8vnjqi:focus-within{border-top-color:var(--colorNeutralStroke1Pressed);}", ".fz1etlk:active,.fz1etlk:focus-within{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1hc16gm:active
|
|
204
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".flvyvdh{-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}", ".f14mj54c{-webkit-column-gap:var(--spacingHorizontalXXS);column-gap:var(--spacingHorizontalXXS);}", ".fiut8dr{row-gap:var(--spacingHorizontalXXS);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".f1ewtqcl{box-sizing:border-box;}", ".f1gw3sf2::after{box-sizing:border-box;}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".f1a7op3::after{left:-1px;}", ".f1cjjd47::after{right:-1px;}", ".f1gboi2j::after{bottom:-1px;}", ".f145g4dw::after{height:max(2px, var(--borderRadiusMedium));}", ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1cb6c3::after{border-bottom-width:2px;}", ".f1lh990p::after{border-bottom-style:solid;}", ".f1jc6hxc::after{border-bottom-color:var(--colorCompoundBrandStroke);}", ".f13evtba::after{-webkit-clip-path:inset(calc(100% - 2px) 0 0 0);clip-path:inset(calc(100% - 2px) 0 0 0);}", ".f1yk9hq::after{-webkit-transform:scaleX(0);-moz-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);}", ".fhwpy7i::after{transition-property:transform;}", ".f14ee0xe::after{transition-duration:var(--durationUltraFast);}", ".f1xhbsuh::after{transition-delay:var(--curveAccelerateMid);}", ".f1pha7fy{min-height:24px;}", ".f1g0x7ka{padding-top:0;}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1qch9an{padding-bottom:0;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1nxs5xn{min-height:32px;}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1w5jphr{min-height:40px;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1rjii52{-webkit-column-gap:var(--spacingHorizontalSNudge);column-gap:var(--spacingHorizontalSNudge);}", ".f1r7g2jn{row-gap:var(--spacingHorizontalSNudge);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".f1nf3wye::after{border-bottom-right-radius:0;}", ".feulmo5::after{border-bottom-left-radius:0;}", ".f18vqdqu::after{border-top-right-radius:0;}", ".f53nyzz::after{border-top-left-radius:0;}", ".fyed02w{box-shadow:var(--shadow2);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fdrzuqr{cursor:not-allowed;}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}"],
|
|
205
|
+
"w": [".fjw5xc1:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);}", ".f1xdyd5c:focus-within::after{transition-property:transform;}", ".fatpbeo:focus-within::after{transition-duration:var(--durationNormal);}", ".fb7uyps:focus-within::after{transition-delay:var(--curveDecelerateMid);}", ".f1ibeo51:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".f14a1fxs:focus-within{outline-width:2px;}", ".f3e99gv:focus-within{outline-style:solid;}", ".fhljsf7:focus-within{outline-color:transparent;}"],
|
|
206
|
+
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1l4zc64:hover{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".ftmjh5b:hover,.ftmjh5b:focus-within{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f17blpuu:hover,.f17blpuu:focus-within{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fsrcdbj:hover,.fsrcdbj:focus-within{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f1tpwn32:hover,.f1tpwn32:focus-within{border-bottom-color:var(--colorTransparentStrokeInteractive);}"],
|
|
207
|
+
"a": [".f8vnjqi:active,.f8vnjqi:focus-within{border-top-color:var(--colorNeutralStroke1Pressed);}", ".fz1etlk:active,.fz1etlk:focus-within{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1hc16gm:active,.f1hc16gm:focus-within{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f1klwx88:active,.f1klwx88:focus-within{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}"],
|
|
232
208
|
"t": ["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", "@media (forced-colors: active){.f1rvyvqg{border-right-color:GrayText;}.f14g86mu{border-left-color:GrayText;}}", "@media (forced-colors: active){.f1cwzwz{border-bottom-color:GrayText;}}", "@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}"]
|
|
233
209
|
});
|
|
234
210
|
|
|
@@ -242,9 +218,9 @@ const useInputElementStyles = /*#__PURE__*/react_1.__styles({
|
|
|
242
218
|
"oivjwe": "f1h8hb77",
|
|
243
219
|
"wvpqe5": ["f1deefiw", "f1n71otn"],
|
|
244
220
|
"z8tnut": "f1g0x7ka",
|
|
245
|
-
"z189sj": ["
|
|
221
|
+
"z189sj": ["ffczdla", "fgiv446"],
|
|
246
222
|
"Byoj8tv": "f1qch9an",
|
|
247
|
-
"uwmqm3": ["
|
|
223
|
+
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
248
224
|
"sj55zd": "f19n0e5",
|
|
249
225
|
"De3pzq": "f3rmtva",
|
|
250
226
|
"yvdlaj": "fwyc1cq",
|
|
@@ -252,20 +228,24 @@ const useInputElementStyles = /*#__PURE__*/react_1.__styles({
|
|
|
252
228
|
"B486eqv": "f2hkw1w"
|
|
253
229
|
},
|
|
254
230
|
"small": {
|
|
231
|
+
"Bahqtrf": "fk6fouc",
|
|
255
232
|
"Be2twd7": "fy9rknc",
|
|
233
|
+
"Bhrd7zp": "figsok6",
|
|
256
234
|
"Bg96gwp": "fwrc4pm"
|
|
257
235
|
},
|
|
258
236
|
"medium": {
|
|
237
|
+
"Bahqtrf": "fk6fouc",
|
|
259
238
|
"Be2twd7": "fkhj508",
|
|
239
|
+
"Bhrd7zp": "figsok6",
|
|
260
240
|
"Bg96gwp": "f1i3iumi"
|
|
261
241
|
},
|
|
262
242
|
"large": {
|
|
263
243
|
"Be2twd7": "fod5ikn",
|
|
264
244
|
"Bg96gwp": "faaz57k",
|
|
265
245
|
"z8tnut": "f1g0x7ka",
|
|
266
|
-
"z189sj": ["
|
|
246
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
267
247
|
"Byoj8tv": "f1qch9an",
|
|
268
|
-
"uwmqm3": ["
|
|
248
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"]
|
|
269
249
|
},
|
|
270
250
|
"disabled": {
|
|
271
251
|
"sj55zd": "f1s2aq7o",
|
|
@@ -274,7 +254,7 @@ const useInputElementStyles = /*#__PURE__*/react_1.__styles({
|
|
|
274
254
|
"yvdlaj": "fahhnxm"
|
|
275
255
|
}
|
|
276
256
|
}, {
|
|
277
|
-
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".fy77jfu{min-width:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f1g0x7ka{padding-top:0;}", ".
|
|
257
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".fy77jfu{min-width:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f1g0x7ka{padding-top:0;}", ".ffczdla{padding-right:var(--spacingHorizontalXXS);}", ".fgiv446{padding-left:var(--spacingHorizontalXXS);}", ".f1qch9an{padding-bottom:0;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f3rmtva{background-color:transparent;}", ".fwyc1cq::-webkit-input-placeholder{color:var(--colorNeutralForeground4);}", ".fwyc1cq::-moz-placeholder{color:var(--colorNeutralForeground4);}", ".f13ta7ih::-webkit-input-placeholder{opacity:1;}", ".f13ta7ih::-moz-placeholder{opacity:1;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fdrzuqr{cursor:not-allowed;}", ".fahhnxm::-webkit-input-placeholder{color:var(--colorNeutralForegroundDisabled);}", ".fahhnxm::-moz-placeholder{color:var(--colorNeutralForegroundDisabled);}"],
|
|
278
258
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
279
259
|
});
|
|
280
260
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Input/useInputStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,GAAiB,WAAjB;AACA,OAAA,CAAA,eAA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EtB,WAAW,CAAC,IAFU,EAGtB,WAAW,CAAC,IAAD,CAHW,EAItB,QAAQ,IAAI,WAAW,CAAC,QAJF,EAKtB,KAAK,CAAC,KAAN,CAAY,SALU,CAAxB;AAQA,QAAM,cAAc,GAAG,CAAC,aAAa,CAAC,IAAf,EAAqB,QAAQ,IAAI,aAAa,CAAC,QAA/C,EAAyD,aAAa,CAAC,IAAD,CAAtE,CAAvB;;AACA,MAAI,KAAK,CAAC,aAAV,EAAyB;AACvB,IAAA,KAAK,CAAC,aAAN,CAAoB,SAApB,GAAgC,OAAA,CAAA,YAAA,CAC9B,OAAA,CAAA,eAAA,CAAgB,aADc,EAE9B,GAAG,cAF2B,EAG9B,KAAK,CAAC,aAAN,CAAoB,SAHU,CAAhC;AAKD;;AACD,MAAI,KAAK,CAAC,YAAV,EAAwB;AACtB,IAAA,KAAK,CAAC,YAAN,CAAmB,SAAnB,GAA+B,OAAA,CAAA,YAAA,CAC7B,OAAA,CAAA,eAAA,CAAgB,YADa,EAE7B,GAAG,cAF0B,EAG7B,KAAK,CAAC,YAAN,CAAmB,SAHU,CAA/B;AAKD;;AAED,SAAO,KAAP;AACD,CAhDM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { InputSlots, InputState } from './Input.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `inputClassNames.root` instead.\n */\nexport const inputClassName = 'fui-Input';\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) use theme values once available\nconst horizontalSpacing = {\n xxs: '2px',\n xs: '4px',\n sNudge: '6px',\n s: '8px',\n mNudge: '10px',\n m: '12px',\n};\nconst motionDurations = {\n ultraFast: '0.05s',\n normal: '0.2s',\n};\nconst motionCurves = {\n accelerateMid: 'cubic-bezier(0.7,0,1,0.5)',\n decelerateMid: 'cubic-bezier(0.1,0.9,0.2,1)',\n};\nconst contentSizes = {\n // TODO(sharing) shouldn't these be in the theme?\n body1: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n caption1: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n ...shorthands.gap(horizontalSpacing.xxs),\n fontFamily: tokens.fontFamilyBase,\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n },\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n ...shorthands.borderBottom('2px', 'solid', tokens.colorCompoundBrandStroke),\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: motionDurations.ultraFast,\n transitionDelay: motionCurves.accelerateMid,\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: motionDurations.normal,\n transitionDelay: motionCurves.decelerateMid,\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n small: {\n minHeight: fieldHeights.small,\n ...shorthands.padding('0', horizontalSpacing.sNudge),\n ...contentSizes.caption1,\n },\n medium: {\n minHeight: fieldHeights.medium,\n ...shorthands.padding('0', horizontalSpacing.mNudge),\n ...contentSizes.body1,\n },\n large: {\n minHeight: fieldHeights.large,\n ...shorthands.padding('0', horizontalSpacing.m),\n ...contentSizes[400],\n ...shorthands.gap(horizontalSpacing.sNudge),\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderRadius(0), // corners look strange if rounded\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n boxShadow: tokens.shadow2, // optional shadow for filled appearances\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n filledDarker: {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n filledLighter: {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // because underline doesn't usually have a radius\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n});\n\nconst useInputElementStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n ...shorthands.borderStyle('none'), // input itself never has a border (this is handled by inputWrapper)\n ...shorthands.padding('0', horizontalSpacing.xxs),\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n ':focus-visible': {\n outlineStyle: 'none', // disable default browser outline\n },\n },\n small: {\n // This is set on root but doesn't inherit\n ...contentSizes.caption1,\n },\n medium: {\n ...contentSizes.body1,\n },\n large: {\n ...contentSizes[400],\n ...shorthands.padding('0', horizontalSpacing.sNudge),\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n // special case styling for icons (most common case) to ensure they're centered vertically\n '> svg': { display: 'block' },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n '> svg': { fontSize: '20px' },\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n rootStyles.base,\n rootStyles[size],\n rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n inputStyles.base,\n inputStyles[size],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [contentStyles.base, disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["components/Input/useInputStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,eAAA,GAA8C;AACzD,EAA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,KAAK,CAAC,YAAN,CAAmB,SAHU,CAA/B;AAKD;;AAED,SAAO,KAAP;AACD,CAhDM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { InputSlots, InputState } from './Input.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) use theme values once available\nconst contentSizes = {\n // TODO: This 400 style is not in the typography styles.\n // May need a design change\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n ...shorthands.gap(tokens.spacingHorizontalXXS),\n fontFamily: tokens.fontFamilyBase,\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n },\n interactive: {\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n ...shorthands.borderBottom('2px', 'solid', tokens.colorCompoundBrandStroke),\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n small: {\n minHeight: fieldHeights.small,\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption1,\n },\n medium: {\n minHeight: fieldHeights.medium,\n ...shorthands.padding('0', tokens.spacingHorizontalMNudge),\n ...typographyStyles.body1,\n },\n large: {\n minHeight: fieldHeights.large,\n ...shorthands.padding('0', tokens.spacingHorizontalM),\n ...contentSizes[400],\n ...shorthands.gap(tokens.spacingHorizontalSNudge),\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderRadius(0), // corners look strange if rounded\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n boxShadow: tokens.shadow2, // optional shadow for filled appearances\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n ...shorthands.borderRadius(tokens.borderRadiusMedium), // because underline doesn't usually have a radius\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n});\n\nconst useInputElementStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n ...shorthands.borderStyle('none'), // input itself never has a border (this is handled by inputWrapper)\n ...shorthands.padding('0', tokens.spacingHorizontalXXS),\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n ':focus-visible': {\n outlineStyle: 'none', // disable default browser outline\n },\n },\n small: {\n // This is set on root but doesn't inherit\n ...typographyStyles.caption1,\n },\n medium: {\n ...typographyStyles.body1,\n },\n large: {\n ...contentSizes[400],\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentStyles = makeStyles({\n base: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n // special case styling for icons (most common case) to ensure they're centered vertically\n '> svg': { display: 'block' },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n '> svg': { fontSize: '20px' },\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n rootStyles.base,\n rootStyles[size],\n rootStyles[appearance],\n !disabled && rootStyles.interactive,\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n inputStyles.base,\n inputStyles[size],\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [contentStyles.base, disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useInput_unstable = exports.useInputStyles_unstable = exports.renderInput_unstable = exports.inputClassNames = exports.
|
|
6
|
+
exports.useInput_unstable = exports.useInputStyles_unstable = exports.renderInput_unstable = exports.inputClassNames = exports.Input = void 0;
|
|
7
7
|
|
|
8
8
|
var Input_1 = /*#__PURE__*/require("./Input");
|
|
9
9
|
|
|
@@ -12,13 +12,6 @@ Object.defineProperty(exports, "Input", {
|
|
|
12
12
|
get: function () {
|
|
13
13
|
return Input_1.Input;
|
|
14
14
|
}
|
|
15
|
-
}); // eslint-disable-next-line deprecation/deprecation
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "inputClassName", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () {
|
|
20
|
-
return Input_1.inputClassName;
|
|
21
|
-
}
|
|
22
15
|
});
|
|
23
16
|
Object.defineProperty(exports, "inputClassNames", {
|
|
24
17
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA;AAAO,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AAAsB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AAAyB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA","sourcesContent":["export { Input, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable } from './Input';\nexport type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-input",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-rc.3",
|
|
4
4
|
"description": "Fluent UI React Input component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.7",
|
|
32
|
+
"@fluentui/react-text": "9.0.0-rc.10",
|
|
32
33
|
"@fluentui/scripts": "^1.0.0"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
|
36
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
|
37
|
-
"@griffel/react": "1.0.
|
|
36
|
+
"@fluentui/react-theme": "9.0.0-rc.9",
|
|
37
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
|
38
|
+
"@griffel/react": "1.0.5",
|
|
38
39
|
"tslib": "^2.1.0"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
package/lib/Input.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Input/index';
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
export declare type InputSlots = {
|
|
4
|
-
/**
|
|
5
|
-
* Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.
|
|
6
|
-
* (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)
|
|
7
|
-
*
|
|
8
|
-
* The root slot receives the `className` and `style` specified directly on the `<Input>`.
|
|
9
|
-
* All other top-level native props will be applied to the primary slot, `input`.
|
|
10
|
-
*/
|
|
11
|
-
root: NonNullable<Slot<'span'>>;
|
|
12
|
-
/**
|
|
13
|
-
* The actual `<input>` element. `type="text"` will be automatically applied unless overridden.
|
|
14
|
-
*
|
|
15
|
-
* This is the "primary" slot, so native props specified directly on the `<Input>` will go here
|
|
16
|
-
* (except `className` and `style`, which go to the `root` slot). The top-level `ref` will
|
|
17
|
-
* also go here.
|
|
18
|
-
*/
|
|
19
|
-
input: NonNullable<Slot<'input'>>;
|
|
20
|
-
/** Element before the input text, within the input border */
|
|
21
|
-
contentBefore?: Slot<'span'>;
|
|
22
|
-
/** Element after the input text, within the input border */
|
|
23
|
-
contentAfter?: Slot<'span'>;
|
|
24
|
-
};
|
|
25
|
-
export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & {
|
|
26
|
-
/** Input can't have children. */
|
|
27
|
-
children?: never;
|
|
28
|
-
/**
|
|
29
|
-
* Size of the input (changes the font size and spacing).
|
|
30
|
-
* @default 'medium'
|
|
31
|
-
*/
|
|
32
|
-
size?: 'small' | 'medium' | 'large';
|
|
33
|
-
/**
|
|
34
|
-
* Controls the colors and borders of the input.
|
|
35
|
-
* @default 'outline'
|
|
36
|
-
*/
|
|
37
|
-
appearance?: 'outline' | 'underline' | 'filledDarker' | 'filledLighter';
|
|
38
|
-
/**
|
|
39
|
-
* Default value of the input. Provide this if the input should be an uncontrolled component
|
|
40
|
-
* which tracks its current state internally; otherwise, use `value`.
|
|
41
|
-
*
|
|
42
|
-
* (This prop is mutually exclusive with `value`.)
|
|
43
|
-
*/
|
|
44
|
-
defaultValue?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Current value of the input. Provide this if the input is a controlled component where you
|
|
47
|
-
* are maintaining its current state; otherwise, use `defaultValue`.
|
|
48
|
-
*
|
|
49
|
-
* (This prop is mutually exclusive with `defaultValue`.)
|
|
50
|
-
*/
|
|
51
|
-
value?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Called when the user changes the input's value.
|
|
54
|
-
*/
|
|
55
|
-
onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
|
|
56
|
-
/**
|
|
57
|
-
* An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)
|
|
58
|
-
* based on the type of value the user will enter.
|
|
59
|
-
*
|
|
60
|
-
* Note that no custom styling is currently applied for alternative types, and some types may
|
|
61
|
-
* activate browser-default styling which does not match the Fluent design language.
|
|
62
|
-
*
|
|
63
|
-
* (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an
|
|
64
|
-
* `<input>` element instead.)
|
|
65
|
-
* @default 'text'
|
|
66
|
-
*/
|
|
67
|
-
type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'number' | 'time' | 'week';
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* State used in rendering Input.
|
|
71
|
-
*/
|
|
72
|
-
export declare type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;
|
|
73
|
-
/**
|
|
74
|
-
* Data passed to the `onChange` callback when a user changes the input's value.
|
|
75
|
-
*/
|
|
76
|
-
export declare type InputOnChangeData = {
|
|
77
|
-
/** Updated input value from the user */
|
|
78
|
-
value: string;
|
|
79
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { InputProps, InputState } from './Input.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render Input.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useInputStyles_unstable,
|
|
7
|
-
* before being passed to renderInput_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of Input
|
|
10
|
-
* @param ref - reference to `<input>` element of Input
|
|
11
|
-
*/
|
|
12
|
-
export declare const useInput_unstable: (props: InputProps, ref: React.Ref<HTMLInputElement>) => InputState;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { InputSlots, InputState } from './Input.types';
|
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use `inputClassNames.root` instead.
|
|
5
|
-
*/
|
|
6
|
-
export declare const inputClassName = "fui-Input";
|
|
7
|
-
export declare const inputClassNames: SlotClassNames<InputSlots>;
|
|
8
|
-
/**
|
|
9
|
-
* Apply styling to the Input slots based on the state
|
|
10
|
-
*/
|
|
11
|
-
export declare const useInputStyles_unstable: (state: InputState) => InputState;
|
package/lib/index.d.ts
DELETED
package/lib-commonjs/Input.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Input/index';
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
export declare type InputSlots = {
|
|
4
|
-
/**
|
|
5
|
-
* Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.
|
|
6
|
-
* (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)
|
|
7
|
-
*
|
|
8
|
-
* The root slot receives the `className` and `style` specified directly on the `<Input>`.
|
|
9
|
-
* All other top-level native props will be applied to the primary slot, `input`.
|
|
10
|
-
*/
|
|
11
|
-
root: NonNullable<Slot<'span'>>;
|
|
12
|
-
/**
|
|
13
|
-
* The actual `<input>` element. `type="text"` will be automatically applied unless overridden.
|
|
14
|
-
*
|
|
15
|
-
* This is the "primary" slot, so native props specified directly on the `<Input>` will go here
|
|
16
|
-
* (except `className` and `style`, which go to the `root` slot). The top-level `ref` will
|
|
17
|
-
* also go here.
|
|
18
|
-
*/
|
|
19
|
-
input: NonNullable<Slot<'input'>>;
|
|
20
|
-
/** Element before the input text, within the input border */
|
|
21
|
-
contentBefore?: Slot<'span'>;
|
|
22
|
-
/** Element after the input text, within the input border */
|
|
23
|
-
contentAfter?: Slot<'span'>;
|
|
24
|
-
};
|
|
25
|
-
export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & {
|
|
26
|
-
/** Input can't have children. */
|
|
27
|
-
children?: never;
|
|
28
|
-
/**
|
|
29
|
-
* Size of the input (changes the font size and spacing).
|
|
30
|
-
* @default 'medium'
|
|
31
|
-
*/
|
|
32
|
-
size?: 'small' | 'medium' | 'large';
|
|
33
|
-
/**
|
|
34
|
-
* Controls the colors and borders of the input.
|
|
35
|
-
* @default 'outline'
|
|
36
|
-
*/
|
|
37
|
-
appearance?: 'outline' | 'underline' | 'filledDarker' | 'filledLighter';
|
|
38
|
-
/**
|
|
39
|
-
* Default value of the input. Provide this if the input should be an uncontrolled component
|
|
40
|
-
* which tracks its current state internally; otherwise, use `value`.
|
|
41
|
-
*
|
|
42
|
-
* (This prop is mutually exclusive with `value`.)
|
|
43
|
-
*/
|
|
44
|
-
defaultValue?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Current value of the input. Provide this if the input is a controlled component where you
|
|
47
|
-
* are maintaining its current state; otherwise, use `defaultValue`.
|
|
48
|
-
*
|
|
49
|
-
* (This prop is mutually exclusive with `defaultValue`.)
|
|
50
|
-
*/
|
|
51
|
-
value?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Called when the user changes the input's value.
|
|
54
|
-
*/
|
|
55
|
-
onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
|
|
56
|
-
/**
|
|
57
|
-
* An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)
|
|
58
|
-
* based on the type of value the user will enter.
|
|
59
|
-
*
|
|
60
|
-
* Note that no custom styling is currently applied for alternative types, and some types may
|
|
61
|
-
* activate browser-default styling which does not match the Fluent design language.
|
|
62
|
-
*
|
|
63
|
-
* (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an
|
|
64
|
-
* `<input>` element instead.)
|
|
65
|
-
* @default 'text'
|
|
66
|
-
*/
|
|
67
|
-
type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'number' | 'time' | 'week';
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* State used in rendering Input.
|
|
71
|
-
*/
|
|
72
|
-
export declare type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;
|
|
73
|
-
/**
|
|
74
|
-
* Data passed to the `onChange` callback when a user changes the input's value.
|
|
75
|
-
*/
|
|
76
|
-
export declare type InputOnChangeData = {
|
|
77
|
-
/** Updated input value from the user */
|
|
78
|
-
value: string;
|
|
79
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { InputProps, InputState } from './Input.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render Input.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useInputStyles_unstable,
|
|
7
|
-
* before being passed to renderInput_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of Input
|
|
10
|
-
* @param ref - reference to `<input>` element of Input
|
|
11
|
-
*/
|
|
12
|
-
export declare const useInput_unstable: (props: InputProps, ref: React.Ref<HTMLInputElement>) => InputState;
|