@fluentui/react-input 9.3.4 → 9.3.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.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -2
- package/lib/components/Input/useInputStyles.js +97 -154
- package/lib/components/Input/useInputStyles.js.map +1 -1
- package/lib-amd/components/Input/useInputStyles.js +109 -60
- package/lib-amd/components/Input/useInputStyles.js.map +1 -1
- package/lib-commonjs/components/Input/useInputStyles.js +96 -153
- package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui/react-input",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 16 Feb 2023 19:18:18 GMT",
|
|
6
|
+
"tag": "@fluentui/react-input_v9.3.6",
|
|
7
|
+
"version": "9.3.6",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "mgodbolt@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-input",
|
|
13
|
+
"commit": "c6f47613e95f8e43ef00792ea673d673881e14fb",
|
|
14
|
+
"comment": "fixing build issues"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 16 Feb 2023 16:18:01 GMT",
|
|
21
|
+
"tag": "@fluentui/react-input_v9.3.5",
|
|
22
|
+
"version": "9.3.5",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "behowell@microsoft.com",
|
|
27
|
+
"package": "@fluentui/react-input",
|
|
28
|
+
"commit": "2a39824231365b95ba70991285301a6b83b4f107",
|
|
29
|
+
"comment": "chore: Update Input to use makeResetStyles and reduce the number of classes applied"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Wed, 15 Feb 2023 11:44:52 GMT",
|
|
6
36
|
"tag": "@fluentui/react-input_v9.3.4",
|
|
7
37
|
"version": "9.3.4",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-input
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 16 Feb 2023 19:18:18 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.3.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.6)
|
|
8
|
+
|
|
9
|
+
Thu, 16 Feb 2023 19:18:18 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.5..@fluentui/react-input_v9.3.6)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fixing build issues ([PR #26877](https://github.com/microsoft/fluentui/pull/26877) by mgodbolt@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.5)
|
|
17
|
+
|
|
18
|
+
Thu, 16 Feb 2023 16:18:01 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.4..@fluentui/react-input_v9.3.5)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- chore: Update Input to use makeResetStyles and reduce the number of classes applied ([PR #26815](https://github.com/microsoft/fluentui/pull/26815) by behowell@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.4)
|
|
8
26
|
|
|
9
|
-
Wed, 15 Feb 2023 11:
|
|
27
|
+
Wed, 15 Feb 2023 11:44:52 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.3..@fluentui/react-input_v9.3.4)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
1
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
2
|
+
import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
3
3
|
export const inputClassNames = {
|
|
4
4
|
root: 'fui-Input',
|
|
5
5
|
input: 'fui-Input__input',
|
|
@@ -12,80 +12,92 @@ const fieldHeights = {
|
|
|
12
12
|
medium: '32px',
|
|
13
13
|
large: '40px'
|
|
14
14
|
};
|
|
15
|
+
const rootBaseStyles = {
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
flexWrap: 'nowrap',
|
|
19
|
+
gap: tokens.spacingHorizontalXXS,
|
|
20
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
21
|
+
position: 'relative',
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
// size: medium (default)
|
|
24
|
+
minHeight: fieldHeights.medium,
|
|
25
|
+
padding: `0 ${tokens.spacingHorizontalMNudge}`,
|
|
26
|
+
...typographyStyles.body1,
|
|
27
|
+
// appearance: outline (default)
|
|
28
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
29
|
+
border: `1px solid ${tokens.colorNeutralStroke1}`,
|
|
30
|
+
borderBottomColor: tokens.colorNeutralStrokeAccessible
|
|
31
|
+
};
|
|
32
|
+
const rootInteractiveStyles = {
|
|
33
|
+
// This is all for the bottom focus border.
|
|
34
|
+
// It's supposed to be 2px flat all the way across and match the radius of the field's corners.
|
|
35
|
+
'::after': {
|
|
36
|
+
boxSizing: 'border-box',
|
|
37
|
+
content: '""',
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
left: '-1px',
|
|
40
|
+
bottom: '-1px',
|
|
41
|
+
right: '-1px',
|
|
42
|
+
// Maintaining the correct corner radius:
|
|
43
|
+
// Use the whole border-radius as the height and only put radii on the bottom corners.
|
|
44
|
+
// (Otherwise the radius would be automatically reduced to fit available space.)
|
|
45
|
+
// max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
|
|
46
|
+
height: `max(2px, ${tokens.borderRadiusMedium})`,
|
|
47
|
+
borderBottomLeftRadius: tokens.borderRadiusMedium,
|
|
48
|
+
borderBottomRightRadius: tokens.borderRadiusMedium,
|
|
49
|
+
// Flat 2px border:
|
|
50
|
+
// By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
|
|
51
|
+
// (This could be done without trimming using `background: linear-gradient(...)`, but using
|
|
52
|
+
// borderBottom makes it easier for people to override the color if needed.)
|
|
53
|
+
borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,
|
|
54
|
+
clipPath: 'inset(calc(100% - 2px) 0 0 0)',
|
|
55
|
+
// Animation for focus OUT
|
|
56
|
+
transform: 'scaleX(0)',
|
|
57
|
+
transitionProperty: 'transform',
|
|
58
|
+
transitionDuration: tokens.durationUltraFast,
|
|
59
|
+
transitionDelay: tokens.curveAccelerateMid,
|
|
60
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
61
|
+
transitionDuration: '0.01ms',
|
|
62
|
+
transitionDelay: '0.01ms'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
':focus-within::after': {
|
|
66
|
+
// Animation for focus IN
|
|
67
|
+
transform: 'scaleX(1)',
|
|
68
|
+
transitionProperty: 'transform',
|
|
69
|
+
transitionDuration: tokens.durationNormal,
|
|
70
|
+
transitionDelay: tokens.curveDecelerateMid,
|
|
71
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
72
|
+
transitionDuration: '0.01ms',
|
|
73
|
+
transitionDelay: '0.01ms'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
':focus-within:active::after': {
|
|
77
|
+
// This is if the user clicks the field again while it's already focused
|
|
78
|
+
borderBottomColor: tokens.colorCompoundBrandStrokePressed
|
|
79
|
+
},
|
|
80
|
+
':focus-within': {
|
|
81
|
+
outline: '2px solid transparent'
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const useRootNonInteractiveClassName = /*#__PURE__*/__resetStyles("rqztyh5", null, [".rqztyh5{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;gap:var(--spacingHorizontalXXS);border-radius:var(--borderRadiusMedium);position:relative;box-sizing:border-box;min-height:32px;padding:0 var(--spacingHorizontalMNudge);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);background-color:var(--colorNeutralBackground1);border:1px solid var(--colorNeutralStroke1);border-bottom-color:var(--colorNeutralStrokeAccessible);}"]);
|
|
85
|
+
const useRootInteractiveClassName = /*#__PURE__*/__resetStyles("r1jtohuq", "rl1z2p5", [".r1jtohuq{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;gap:var(--spacingHorizontalXXS);border-radius:var(--borderRadiusMedium);position:relative;box-sizing:border-box;min-height:32px;padding:0 var(--spacingHorizontalMNudge);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);background-color:var(--colorNeutralBackground1);border:1px solid var(--colorNeutralStroke1);border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".r1jtohuq::after{box-sizing:border-box;content:\"\";position:absolute;left:-1px;bottom:-1px;right:-1px;height:max(2px, var(--borderRadiusMedium));border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-bottom:2px solid var(--colorCompoundBrandStroke);-webkit-clip-path:inset(calc(100% - 2px) 0 0 0);clip-path:inset(calc(100% - 2px) 0 0 0);-webkit-transform:scaleX(0);-moz-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);transition-property:transform;transition-duration:var(--durationUltraFast);transition-delay:var(--curveAccelerateMid);}", "@media screen and (prefers-reduced-motion: reduce){.r1jtohuq::after{transition-duration:0.01ms;transition-delay:0.01ms;}}", ".r1jtohuq:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);transition-property:transform;transition-duration:var(--durationNormal);transition-delay:var(--curveDecelerateMid);}", "@media screen and (prefers-reduced-motion: reduce){.r1jtohuq:focus-within::after{transition-duration:0.01ms;transition-delay:0.01ms;}}", ".r1jtohuq:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".r1jtohuq:focus-within{outline:2px solid transparent;}", ".rl1z2p5{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;gap:var(--spacingHorizontalXXS);border-radius:var(--borderRadiusMedium);position:relative;box-sizing:border-box;min-height:32px;padding:0 var(--spacingHorizontalMNudge);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);background-color:var(--colorNeutralBackground1);border:1px solid var(--colorNeutralStroke1);border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".rl1z2p5::after{box-sizing:border-box;content:\"\";position:absolute;right:-1px;bottom:-1px;left:-1px;height:max(2px, var(--borderRadiusMedium));border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-bottom:2px solid var(--colorCompoundBrandStroke);-webkit-clip-path:inset(calc(100% - 2px) 0 0 0);clip-path:inset(calc(100% - 2px) 0 0 0);-webkit-transform:scaleX(0);-moz-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);transition-property:transform;transition-duration:var(--durationUltraFast);transition-delay:var(--curveAccelerateMid);}", "@media screen and (prefers-reduced-motion: reduce){.rl1z2p5::after{transition-duration:0.01ms;transition-delay:0.01ms;}}", ".rl1z2p5:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);transition-property:transform;transition-duration:var(--durationNormal);transition-delay:var(--curveDecelerateMid);}", "@media screen and (prefers-reduced-motion: reduce){.rl1z2p5:focus-within::after{transition-duration:0.01ms;transition-delay:0.01ms;}}", ".rl1z2p5:focus-within:active::after{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".rl1z2p5:focus-within{outline:2px solid transparent;}"]);
|
|
15
86
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
16
|
-
base: {
|
|
17
|
-
mc9l5x: "ftuwxu6",
|
|
18
|
-
Bt984gj: "f122n59",
|
|
19
|
-
Eh141a: "flvyvdh",
|
|
20
|
-
i8kkvl: "f14mj54c",
|
|
21
|
-
Belr9w4: "fiut8dr",
|
|
22
|
-
Bahqtrf: "fk6fouc",
|
|
23
|
-
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
24
|
-
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
25
|
-
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
26
|
-
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
27
|
-
qhf8xq: "f10pi13n",
|
|
28
|
-
B7ck84d: "f1ewtqcl"
|
|
29
|
-
},
|
|
30
|
-
interactive: {
|
|
31
|
-
li1rpt: "f1gw3sf2",
|
|
32
|
-
Bsft5z2: "f13zj6fq",
|
|
33
|
-
E3zdtr: "f1mdlcz9",
|
|
34
|
-
Eqx8gd: ["f1a7op3", "f1cjjd47"],
|
|
35
|
-
By385i5: "f1gboi2j",
|
|
36
|
-
B1piin3: ["f1cjjd47", "f1a7op3"],
|
|
37
|
-
Dlnsje: "f145g4dw",
|
|
38
|
-
d9w3h3: ["f1kp91vd", "f1ibwz09"],
|
|
39
|
-
B3778ie: ["f1ibwz09", "f1kp91vd"],
|
|
40
|
-
Bcgy8vk: "f1cb6c3",
|
|
41
|
-
Bw17bha: "f1lh990p",
|
|
42
|
-
B1q35kw: "f1jc6hxc",
|
|
43
|
-
Gjdm7m: "f13evtba",
|
|
44
|
-
b1kco5: "f1yk9hq",
|
|
45
|
-
Ba2ppi3: "fhwpy7i",
|
|
46
|
-
F2fol1: "f14ee0xe",
|
|
47
|
-
lck23g: "f1xhbsuh",
|
|
48
|
-
df92cz: "fv8e3ye",
|
|
49
|
-
I188md: "ftb5wc6",
|
|
50
|
-
umuwi5: "fjw5xc1",
|
|
51
|
-
Blcqepd: "f1xdyd5c",
|
|
52
|
-
nplu4u: "fatpbeo",
|
|
53
|
-
Bioka5o: "fb7uyps",
|
|
54
|
-
H713fs: "f1cmft4k",
|
|
55
|
-
B9ooomg: "f1x58t8o",
|
|
56
|
-
Bercvud: "f1ibeo51",
|
|
57
|
-
Bbr2w1p: "f14a1fxs",
|
|
58
|
-
Bduesf4: "f3e99gv",
|
|
59
|
-
Bpq79vn: "fhljsf7"
|
|
60
|
-
},
|
|
61
87
|
small: {
|
|
62
88
|
sshi5w: "f1pha7fy",
|
|
63
|
-
z8tnut: "f1g0x7ka",
|
|
64
|
-
z189sj: ["fdw0yi8", "fk8j09s"],
|
|
65
|
-
Byoj8tv: "f1qch9an",
|
|
66
89
|
uwmqm3: ["fk8j09s", "fdw0yi8"],
|
|
90
|
+
z189sj: ["fdw0yi8", "fk8j09s"],
|
|
67
91
|
Bahqtrf: "fk6fouc",
|
|
68
92
|
Be2twd7: "fy9rknc",
|
|
69
93
|
Bhrd7zp: "figsok6",
|
|
70
94
|
Bg96gwp: "fwrc4pm"
|
|
71
95
|
},
|
|
72
|
-
medium: {
|
|
73
|
-
sshi5w: "f1nxs5xn",
|
|
74
|
-
z8tnut: "f1g0x7ka",
|
|
75
|
-
z189sj: ["f11gcy0p", "f1ng84yb"],
|
|
76
|
-
Byoj8tv: "f1qch9an",
|
|
77
|
-
uwmqm3: ["f1ng84yb", "f11gcy0p"],
|
|
78
|
-
Bahqtrf: "fk6fouc",
|
|
79
|
-
Be2twd7: "fkhj508",
|
|
80
|
-
Bhrd7zp: "figsok6",
|
|
81
|
-
Bg96gwp: "f1i3iumi"
|
|
82
|
-
},
|
|
96
|
+
medium: {},
|
|
83
97
|
large: {
|
|
84
98
|
sshi5w: "f1w5jphr",
|
|
85
|
-
z8tnut: "f1g0x7ka",
|
|
86
|
-
z189sj: ["fw5db7e", "f1uw59to"],
|
|
87
|
-
Byoj8tv: "f1qch9an",
|
|
88
99
|
uwmqm3: ["f1uw59to", "fw5db7e"],
|
|
100
|
+
z189sj: ["fw5db7e", "f1uw59to"],
|
|
89
101
|
Bahqtrf: "fk6fouc",
|
|
90
102
|
Be2twd7: "fod5ikn",
|
|
91
103
|
Bhrd7zp: "figsok6",
|
|
@@ -93,21 +105,7 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
93
105
|
i8kkvl: "f1rjii52",
|
|
94
106
|
Belr9w4: "f1r7g2jn"
|
|
95
107
|
},
|
|
96
|
-
outline: {
|
|
97
|
-
De3pzq: "fxugw4r",
|
|
98
|
-
B4j52fo: "f5ogflp",
|
|
99
|
-
Bekrc4i: ["f1hqa2wf", "finvdd3"],
|
|
100
|
-
Bn0qgzm: "f1f09k3d",
|
|
101
|
-
ibv6hh: ["finvdd3", "f1hqa2wf"],
|
|
102
|
-
icvyot: "fzkkow9",
|
|
103
|
-
vrafjx: ["fcdblym", "fjik90z"],
|
|
104
|
-
oivjwe: "fg706s2",
|
|
105
|
-
wvpqe5: ["fjik90z", "fcdblym"],
|
|
106
|
-
g2u3we: "fj3muxo",
|
|
107
|
-
h3c5rm: ["f1akhkt", "f1lxtadh"],
|
|
108
|
-
B9xav0g: "f1c1zstj",
|
|
109
|
-
zhjwy3: ["f1lxtadh", "f1akhkt"]
|
|
110
|
-
},
|
|
108
|
+
outline: {},
|
|
111
109
|
outlineInteractive: {
|
|
112
110
|
Bgoe8wy: "fvcxoqz",
|
|
113
111
|
Bwzppfd: ["f1ub3y4t", "f1m52nbi"],
|
|
@@ -124,9 +122,9 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
124
122
|
Beyfa6y: ["f1deotkl", "f1krrbdw"],
|
|
125
123
|
B7oj6ja: ["f10ostut", "f1ozlkrg"],
|
|
126
124
|
Btl43ni: ["f1ozlkrg", "f10ostut"],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
icvyot: "f1ern45e",
|
|
126
|
+
vrafjx: ["f1n71otn", "f1deefiw"],
|
|
127
|
+
wvpqe5: ["f1deefiw", "f1n71otn"]
|
|
130
128
|
},
|
|
131
129
|
underlineInteractive: {
|
|
132
130
|
oetu4i: "f1l4zc64",
|
|
@@ -137,14 +135,6 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
137
135
|
B4j8arr: ["f53nyzz", "f18vqdqu"]
|
|
138
136
|
},
|
|
139
137
|
filled: {
|
|
140
|
-
B4j52fo: "f5ogflp",
|
|
141
|
-
Bekrc4i: ["f1hqa2wf", "finvdd3"],
|
|
142
|
-
Bn0qgzm: "f1f09k3d",
|
|
143
|
-
ibv6hh: ["finvdd3", "f1hqa2wf"],
|
|
144
|
-
icvyot: "fzkkow9",
|
|
145
|
-
vrafjx: ["fcdblym", "fjik90z"],
|
|
146
|
-
oivjwe: "fg706s2",
|
|
147
|
-
wvpqe5: ["fjik90z", "fcdblym"],
|
|
148
138
|
g2u3we: "fghlq4f",
|
|
149
139
|
h3c5rm: ["f1gn591s", "fjscplz"],
|
|
150
140
|
B9xav0g: "fb073pr",
|
|
@@ -189,16 +179,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
189
179
|
n51gp8: ["f14g86mu", "f1rvyvqg"]
|
|
190
180
|
}
|
|
191
181
|
}, {
|
|
192
|
-
d: [".
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
197
|
-
}], ["@media screen and (prefers-reduced-motion: reduce){.f1cmft4k:focus-within::after{transition-duration:0.01ms;}}", {
|
|
198
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
199
|
-
}], ["@media screen and (prefers-reduced-motion: reduce){.f1x58t8o:focus-within::after{transition-delay:0.01ms;}}", {
|
|
200
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
201
|
-
}], ["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
182
|
+
d: [".f1pha7fy{min-height:24px;}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1w5jphr{min-height:40px;}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fw5db7e{padding-right: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);}", ".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;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".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;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".fs4k3qj:not(:focus-within),.fs4k3qj:hover:not(:focus-within){border-top-color:var(--colorPaletteRedBorder2);}", ".fcee079:not(:focus-within),.fcee079:hover:not(:focus-within){border-right-color:var(--colorPaletteRedBorder2);}", ".fmyw78r:not(:focus-within),.fmyw78r:hover:not(:focus-within){border-left-color:var(--colorPaletteRedBorder2);}", ".f1fgmyf4:not(:focus-within),.f1fgmyf4:hover:not(:focus-within){border-bottom-color:var(--colorPaletteRedBorder2);}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fyed02w{box-shadow:var(--shadow2);}", ".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);}"],
|
|
183
|
+
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);}"],
|
|
184
|
+
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);}"],
|
|
185
|
+
m: [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
202
186
|
m: "(forced-colors: active)"
|
|
203
187
|
}], ["@media (forced-colors: active){.f1rvyvqg{border-right-color:GrayText;}.f14g86mu{border-left-color:GrayText;}}", {
|
|
204
188
|
m: "(forced-colors: active)"
|
|
@@ -206,51 +190,13 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
206
190
|
m: "(forced-colors: active)"
|
|
207
191
|
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
208
192
|
m: "(forced-colors: active)"
|
|
209
|
-
}]]
|
|
210
|
-
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;}"],
|
|
211
|
-
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);}"],
|
|
212
|
-
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);}"]
|
|
193
|
+
}]]
|
|
213
194
|
});
|
|
195
|
+
const useInputClassName = /*#__PURE__*/__resetStyles("rvp2gzh", null, [".rvp2gzh{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;min-width:0;border-style:none;padding:0 var(--spacingHorizontalXXS);color:var(--colorNeutralForeground1);background-color:transparent;outline-style:none;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;}", ".rvp2gzh::-webkit-input-placeholder{color:var(--colorNeutralForeground4);opacity:1;}", ".rvp2gzh::-moz-placeholder{color:var(--colorNeutralForeground4);opacity:1;}", ".rvp2gzh:-ms-input-placeholder{color:var(--colorNeutralForeground4);opacity:1;}", ".rvp2gzh::placeholder{color:var(--colorNeutralForeground4);opacity:1;}"]);
|
|
214
196
|
const useInputElementStyles = /*#__PURE__*/__styles({
|
|
215
|
-
base: {
|
|
216
|
-
B7ck84d: "f1ewtqcl",
|
|
217
|
-
Bh6795r: "fqerorx",
|
|
218
|
-
Bf4jedk: "fy77jfu",
|
|
219
|
-
icvyot: "f1ern45e",
|
|
220
|
-
vrafjx: ["f1n71otn", "f1deefiw"],
|
|
221
|
-
oivjwe: "f1h8hb77",
|
|
222
|
-
wvpqe5: ["f1deefiw", "f1n71otn"],
|
|
223
|
-
z8tnut: "f1g0x7ka",
|
|
224
|
-
z189sj: ["ffczdla", "fgiv446"],
|
|
225
|
-
Byoj8tv: "f1qch9an",
|
|
226
|
-
uwmqm3: ["fgiv446", "ffczdla"],
|
|
227
|
-
sj55zd: "f19n0e5",
|
|
228
|
-
De3pzq: "f3rmtva",
|
|
229
|
-
yvdlaj: "fwyc1cq",
|
|
230
|
-
B3o7kgh: "f13ta7ih",
|
|
231
|
-
oeaueh: "f1s6fcnf"
|
|
232
|
-
},
|
|
233
|
-
small: {
|
|
234
|
-
Bahqtrf: "fk6fouc",
|
|
235
|
-
Be2twd7: "fy9rknc",
|
|
236
|
-
Bhrd7zp: "figsok6",
|
|
237
|
-
Bg96gwp: "fwrc4pm"
|
|
238
|
-
},
|
|
239
|
-
medium: {
|
|
240
|
-
Bahqtrf: "fk6fouc",
|
|
241
|
-
Be2twd7: "fkhj508",
|
|
242
|
-
Bhrd7zp: "figsok6",
|
|
243
|
-
Bg96gwp: "f1i3iumi"
|
|
244
|
-
},
|
|
245
197
|
large: {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
Bhrd7zp: "figsok6",
|
|
249
|
-
Bg96gwp: "faaz57k",
|
|
250
|
-
z8tnut: "f1g0x7ka",
|
|
251
|
-
z189sj: ["fdw0yi8", "fk8j09s"],
|
|
252
|
-
Byoj8tv: "f1qch9an",
|
|
253
|
-
uwmqm3: ["fk8j09s", "fdw0yi8"]
|
|
198
|
+
uwmqm3: ["fk8j09s", "fdw0yi8"],
|
|
199
|
+
z189sj: ["fdw0yi8", "fk8j09s"]
|
|
254
200
|
},
|
|
255
201
|
disabled: {
|
|
256
202
|
sj55zd: "f1s2aq7o",
|
|
@@ -259,28 +205,22 @@ const useInputElementStyles = /*#__PURE__*/__styles({
|
|
|
259
205
|
yvdlaj: "fahhnxm"
|
|
260
206
|
}
|
|
261
207
|
}, {
|
|
262
|
-
d: [".
|
|
208
|
+
d: [".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fdw0yi8{padding-right: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);}"]
|
|
263
209
|
});
|
|
210
|
+
const useContentClassName = /*#__PURE__*/__resetStyles("r1572tok", null, [".r1572tok{box-sizing:border-box;color:var(--colorNeutralForeground3);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".r1572tok>svg{font-size:20px;}"]);
|
|
264
211
|
const useContentStyles = /*#__PURE__*/__styles({
|
|
265
|
-
base: {
|
|
266
|
-
B7ck84d: "f1ewtqcl",
|
|
267
|
-
sj55zd: "f11d4kpn",
|
|
268
|
-
mc9l5x: "f22iagw"
|
|
269
|
-
},
|
|
270
212
|
disabled: {
|
|
271
213
|
sj55zd: "f1s2aq7o"
|
|
272
214
|
},
|
|
273
215
|
small: {
|
|
274
216
|
kwki1k: "f3u2cy0"
|
|
275
217
|
},
|
|
276
|
-
medium: {
|
|
277
|
-
kwki1k: "f1oqplr0"
|
|
278
|
-
},
|
|
218
|
+
medium: {},
|
|
279
219
|
large: {
|
|
280
220
|
kwki1k: "fa420co"
|
|
281
221
|
}
|
|
282
222
|
}, {
|
|
283
|
-
d: [".
|
|
223
|
+
d: [".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f3u2cy0>svg{font-size:16px;}", ".fa420co>svg{font-size:24px;}"]
|
|
284
224
|
});
|
|
285
225
|
/**
|
|
286
226
|
* Apply styling to the Input slots based on the state
|
|
@@ -293,12 +233,15 @@ export const useInputStyles_unstable = state => {
|
|
|
293
233
|
const disabled = state.input.disabled;
|
|
294
234
|
const invalid = `${state.input['aria-invalid']}` === 'true';
|
|
295
235
|
const filled = appearance.startsWith('filled');
|
|
236
|
+
// Call exactly one of the two base className hooks. Each of these hooks is functionally identical, but with
|
|
237
|
+
// different styles applied, which makes it ok to conditionally change which hook is called.
|
|
238
|
+
const useRootClassName = disabled ? useRootNonInteractiveClassName : useRootInteractiveClassName;
|
|
296
239
|
const rootStyles = useRootStyles();
|
|
297
240
|
const inputStyles = useInputElementStyles();
|
|
298
241
|
const contentStyles = useContentStyles();
|
|
299
|
-
state.root.className = mergeClasses(inputClassNames.root,
|
|
300
|
-
state.input.className = mergeClasses(inputClassNames.input,
|
|
301
|
-
const contentClasses = [
|
|
242
|
+
state.root.className = mergeClasses(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);
|
|
243
|
+
state.input.className = mergeClasses(inputClassNames.input, useInputClassName(), size === 'large' && inputStyles.large, disabled && inputStyles.disabled, state.input.className);
|
|
244
|
+
const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];
|
|
302
245
|
if (state.contentBefore) {
|
|
303
246
|
state.contentBefore.className = mergeClasses(inputClassNames.contentBefore, ...contentClasses, state.contentBefore.className);
|
|
304
247
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAu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ACT,YAAY,CAACmB,SAAS,CAC7B;;EAGH,OAAOV,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","tokens","typographyStyles","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","useRootStyles","useInputElementStyles","useContentStyles","useInputStyles_unstable","state","size","appearance","disabled","invalid","filled","startsWith","rootStyles","inputStyles","contentStyles","className","base","interactive","outlineInteractive","underlineInteractive","filledInteractive","contentClasses"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInputStyles.ts"],"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) 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 '@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 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 ...typographyStyles.body2,\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 ...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 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 },\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\n outlineStyle: 'none', // disable default browser outline\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 ...typographyStyles.body2,\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 display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\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 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 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 && invalid && rootStyles.invalid,\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"]}
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAGhE,kCAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGtF,OAAO,MAAMC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,kBAAkB;EACzBC,aAAa,EAAE,0BAA0B;EACzCC,YAAY,EAAE;CACf;AAED;AACA,MAAMC,YAAY,GAAG;EACnBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,MAAM;EACdC,KAAK,EAAE;CACR;AAED,MAAMC,cAAc,GAAsB;EACxCC,OAAO,EAAE,aAAa;EACtBC,UAAU,EAAE,QAAQ;EACpBC,QAAQ,EAAE,QAAQ;EAClBC,GAAG,EAAEjB,MAAM,CAACkB,oBAAoB;EAChCC,YAAY,EAAEnB,MAAM,CAACoB,kBAAkB;EACvCC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,YAAY;EAEvB;EACAC,SAAS,EAAEd,YAAY,CAACE,MAAM;EAC9Ba,OAAO,EAAE,KAAKxB,MAAM,CAACyB,uBAAuB,EAAE;EAC9C,GAAGxB,gBAAgB,CAACyB,KAAK;EAEzB;EACAC,eAAe,EAAE3B,MAAM,CAAC4B,uBAAuB;EAC/CC,MAAM,EAAE,a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vD,aAAa,EAAE;IACvBuD,KAAK,CAACvD,aAAa,CAACkE,SAAS,GAAGvE,YAAY,CAC1CE,eAAe,CAACG,aAAa,EAC7B,GAAGsE,cAAc,EACjBf,KAAK,CAACvD,aAAa,CAACkE,SAAS,CAC9B;;EAEH,IAAIX,KAAK,CAACtD,YAAY,EAAE;IACtBsD,KAAK,CAACtD,YAAY,CAACiE,SAAS,GAAGvE,YAAY,CACzCE,eAAe,CAACI,YAAY,EAC5B,GAAGqE,cAAc,EACjBf,KAAK,CAACtD,YAAY,CAACiE,SAAS,CAC7B;;EAGH,OAAOX,KAAK;AACd,CAAC","names":["tokens","typographyStyles","mergeClasses","shorthands","inputClassNames","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","rootBaseStyles","display","alignItems","flexWrap","gap","spacingHorizontalXXS","borderRadius","borderRadiusMedium","position","boxSizing","minHeight","padding","spacingHorizontalMNudge","body1","backgroundColor","colorNeutralBackground1","border","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","rootInteractiveStyles","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","colorCompoundBrandStrokePressed","outline","useRootNonInteractiveClassName","useRootInteractiveClassName","useRootStyles","useInputClassName","useInputElementStyles","useContentClassName","useContentStyles","useInputStyles_unstable","state","size","appearance","disabled","invalid","filled","startsWith","useRootClassName","rootStyles","inputStyles","contentStyles","className","outlineInteractive","underlineInteractive","filledInteractive","contentClasses"],"sourceRoot":"../src/","sources":["packages/react-components/react-input/src/components/Input/useInputStyles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { GriffelResetStyle } from '@griffel/react';\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 rootBaseStyles: GriffelResetStyle = {\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\nconst rootInteractiveStyles: GriffelResetStyle = {\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 useRootNonInteractiveClassName = makeResetStyles(rootBaseStyles);\nconst useRootInteractiveClassName = makeResetStyles({ ...rootBaseStyles, ...rootInteractiveStyles });\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 },\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 },\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 // Call exactly one of the two base className hooks. Each of these hooks is functionally identical, but with\n // different styles applied, which makes it ok to conditionally change which hook is called.\n const useRootClassName = disabled ? useRootNonInteractiveClassName : useRootInteractiveClassName;\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"]}
|