@fluentui/react-input 9.3.5 → 9.3.7
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 +37 -1
- package/CHANGELOG.md +21 -2
- package/lib/components/Input/useInputStyles.js +10 -78
- package/lib/components/Input/useInputStyles.js.map +1 -1
- package/lib-amd/components/Input/useInputStyles.js +21 -18
- package/lib-amd/components/Input/useInputStyles.js.map +1 -1
- package/lib-commonjs/components/Input/useInputStyles.js +10 -78
- package/lib-commonjs/components/Input/useInputStyles.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@fluentui/react-input",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
5
|
+
"date": "Wed, 22 Feb 2023 23:04:46 GMT",
|
|
6
|
+
"tag": "@fluentui/react-input_v9.3.7",
|
|
7
|
+
"version": "9.3.7",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "behowell@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-input",
|
|
13
|
+
"commit": "fbee0f3858ee67d53ee2540531a0cfb6497165cb",
|
|
14
|
+
"comment": "chore: Clean up Input's interactive styles"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "behowell@microsoft.com",
|
|
18
|
+
"package": "@fluentui/react-input",
|
|
19
|
+
"commit": "29ed7fb57a05a6595835f947193460886e80cfc5",
|
|
20
|
+
"comment": "fix: Fix the width of Input's focus border with appearance=underline"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Thu, 16 Feb 2023 19:18:47 GMT",
|
|
27
|
+
"tag": "@fluentui/react-input_v9.3.6",
|
|
28
|
+
"version": "9.3.6",
|
|
29
|
+
"comments": {
|
|
30
|
+
"patch": [
|
|
31
|
+
{
|
|
32
|
+
"author": "mgodbolt@microsoft.com",
|
|
33
|
+
"package": "@fluentui/react-input",
|
|
34
|
+
"commit": "c6f47613e95f8e43ef00792ea673d673881e14fb",
|
|
35
|
+
"comment": "fixing build issues"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Thu, 16 Feb 2023 16:18:01 GMT",
|
|
6
42
|
"tag": "@fluentui/react-input_v9.3.5",
|
|
7
43
|
"version": "9.3.5",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-input
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 22 Feb 2023 23:04:46 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.7)
|
|
8
|
+
|
|
9
|
+
Wed, 22 Feb 2023 23:04:46 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.6..@fluentui/react-input_v9.3.7)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: Clean up Input's interactive styles ([PR #26865](https://github.com/microsoft/fluentui/pull/26865) by behowell@microsoft.com)
|
|
15
|
+
- fix: Fix the width of Input's focus border with appearance=underline ([PR #26881](https://github.com/microsoft/fluentui/pull/26881) by behowell@microsoft.com)
|
|
16
|
+
|
|
17
|
+
## [9.3.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.6)
|
|
18
|
+
|
|
19
|
+
Thu, 16 Feb 2023 19:18:47 GMT
|
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.5..@fluentui/react-input_v9.3.6)
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- fixing build issues ([PR #26877](https://github.com/microsoft/fluentui/pull/26877) by mgodbolt@microsoft.com)
|
|
25
|
+
|
|
7
26
|
## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-input_v9.3.5)
|
|
8
27
|
|
|
9
|
-
|
|
28
|
+
Thu, 16 Feb 2023 16:18:01 GMT
|
|
10
29
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-input_v9.3.4..@fluentui/react-input_v9.3.5)
|
|
11
30
|
|
|
12
31
|
### Patches
|
|
@@ -12,77 +12,7 @@ const fieldHeights = {
|
|
|
12
12
|
medium: '32px',
|
|
13
13
|
large: '40px'
|
|
14
14
|
};
|
|
15
|
-
const
|
|
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
|
+
const useRootClassName = /*#__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;}"]);
|
|
86
16
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
87
17
|
small: {
|
|
88
18
|
sshi5w: "f1pha7fy",
|
|
@@ -124,7 +54,9 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
124
54
|
Btl43ni: ["f1ozlkrg", "f10ostut"],
|
|
125
55
|
icvyot: "f1ern45e",
|
|
126
56
|
vrafjx: ["f1n71otn", "f1deefiw"],
|
|
127
|
-
wvpqe5: ["f1deefiw", "f1n71otn"]
|
|
57
|
+
wvpqe5: ["f1deefiw", "f1n71otn"],
|
|
58
|
+
Eqx8gd: ["f1n6gb5g", "f15yvnhg"],
|
|
59
|
+
B1piin3: ["f15yvnhg", "f1n6gb5g"]
|
|
128
60
|
},
|
|
129
61
|
underlineInteractive: {
|
|
130
62
|
oetu4i: "f1l4zc64",
|
|
@@ -176,10 +108,12 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
176
108
|
Bjwas2f: "fg455y9",
|
|
177
109
|
Bn1d65q: ["f1rvyvqg", "f14g86mu"],
|
|
178
110
|
Bxeuatn: "f1cwzwz",
|
|
179
|
-
n51gp8: ["f14g86mu", "f1rvyvqg"]
|
|
111
|
+
n51gp8: ["f14g86mu", "f1rvyvqg"],
|
|
112
|
+
Bsft5z2: "fhr9occ",
|
|
113
|
+
Bduesf4: "f99w1ws"
|
|
180
114
|
}
|
|
181
115
|
}, {
|
|
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);}"],
|
|
116
|
+
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;}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right: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;}", ".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);}", ".fhr9occ::after{content:unset;}"],
|
|
183
117
|
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
118
|
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
119
|
m: [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
@@ -190,7 +124,8 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
|
190
124
|
m: "(forced-colors: active)"
|
|
191
125
|
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
192
126
|
m: "(forced-colors: active)"
|
|
193
|
-
}]]
|
|
127
|
+
}]],
|
|
128
|
+
w: [".f99w1ws:focus-within{outline-style:none;}"]
|
|
194
129
|
});
|
|
195
130
|
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;}"]);
|
|
196
131
|
const useInputElementStyles = /*#__PURE__*/__styles({
|
|
@@ -233,9 +168,6 @@ export const useInputStyles_unstable = state => {
|
|
|
233
168
|
const disabled = state.input.disabled;
|
|
234
169
|
const invalid = `${state.input['aria-invalid']}` === 'true';
|
|
235
170
|
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;
|
|
239
171
|
const rootStyles = useRootStyles();
|
|
240
172
|
const inputStyles = useInputElementStyles();
|
|
241
173
|
const contentStyles = useContentStyles();
|
|
@@ -1 +1 @@
|
|
|
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,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EAED,MAAMI,cAAc,GAAG,CAAClB,mBAAmB,EAAE,EAAEM,QAAQ,IAAIO,aAAa,CAACP,QAAQ,EAAEO,aAAa,CAACT,IAAI,CAAC,CAAC;EACvG,IAAID,KAAK,CAACvD,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"]}
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAEhE,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,gBAAgB,gBAAG,uhIA0EvB;AAEF,MAAMC,aAAa,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;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root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","useRootClassName","useRootStyles","useInputClassName","useInputElementStyles","useContentClassName","useContentStyles","useInputStyles_unstable","state","size","appearance","disabled","invalid","filled","startsWith","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 { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n padding: `0 ${tokens.spacingHorizontalMNudge}`,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalM,\n ...typographyStyles.body2,\n ...shorthands.gap(tokens.spacingHorizontalSNudge),\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderRadius(0), // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n});\n\nconst useInputClassName = makeResetStyles({\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${tokens.spacingHorizontalXXS}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n large: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n size === 'large' && inputStyles.large,\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -14,12 +14,11 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
14
14
|
medium: '32px',
|
|
15
15
|
large: '40px',
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var useRootClassName = react_1.makeResetStyles(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', alignItems: 'center', flexWrap: 'nowrap', gap: react_theme_1.tokens.spacingHorizontalXXS, borderRadius: react_theme_1.tokens.borderRadiusMedium, position: 'relative', boxSizing: 'border-box',
|
|
18
18
|
// size: medium (default)
|
|
19
19
|
minHeight: fieldHeights.medium, padding: "0 " + react_theme_1.tokens.spacingHorizontalMNudge }, react_theme_1.typographyStyles.body1), {
|
|
20
20
|
// appearance: outline (default)
|
|
21
|
-
backgroundColor: react_theme_1.tokens.colorNeutralBackground1, border: "1px solid " + react_theme_1.tokens.colorNeutralStroke1, borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessible
|
|
22
|
-
var rootInteractiveStyles = {
|
|
21
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1, border: "1px solid " + react_theme_1.tokens.colorNeutralStroke1, borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessible,
|
|
23
22
|
// This is all for the bottom focus border.
|
|
24
23
|
// It's supposed to be 2px flat all the way across and match the radius of the field's corners.
|
|
25
24
|
'::after': {
|
|
@@ -51,8 +50,7 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
51
50
|
transitionDuration: '0.01ms',
|
|
52
51
|
transitionDelay: '0.01ms',
|
|
53
52
|
},
|
|
54
|
-
},
|
|
55
|
-
':focus-within::after': {
|
|
53
|
+
}, ':focus-within::after': {
|
|
56
54
|
// Animation for focus IN
|
|
57
55
|
transform: 'scaleX(1)',
|
|
58
56
|
transitionProperty: 'transform',
|
|
@@ -62,17 +60,12 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
62
60
|
transitionDuration: '0.01ms',
|
|
63
61
|
transitionDelay: '0.01ms',
|
|
64
62
|
},
|
|
65
|
-
},
|
|
66
|
-
':focus-within:active::after': {
|
|
63
|
+
}, ':focus-within:active::after': {
|
|
67
64
|
// This is if the user clicks the field again while it's already focused
|
|
68
65
|
borderBottomColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
|
|
69
|
-
},
|
|
70
|
-
':focus-within': {
|
|
66
|
+
}, ':focus-within': {
|
|
71
67
|
outline: '2px solid transparent',
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
var useRootNonInteractiveClassName = react_1.makeResetStyles(rootBaseStyles);
|
|
75
|
-
var useRootInteractiveClassName = react_1.makeResetStyles(tslib_1.__assign(tslib_1.__assign({}, rootBaseStyles), rootInteractiveStyles));
|
|
68
|
+
} }));
|
|
76
69
|
var useRootStyles = react_1.makeStyles({
|
|
77
70
|
small: tslib_1.__assign({ minHeight: fieldHeights.small, paddingLeft: react_theme_1.tokens.spacingHorizontalSNudge, paddingRight: react_theme_1.tokens.spacingHorizontalSNudge }, react_theme_1.typographyStyles.caption1),
|
|
78
71
|
medium: {
|
|
@@ -89,7 +82,12 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
89
82
|
},
|
|
90
83
|
underline: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderRadius(0)), {
|
|
91
84
|
// border is specified in rootBaseStyles, but we only want a bottom border here
|
|
92
|
-
borderTopStyle: 'none', borderRightStyle: 'none', borderLeftStyle: 'none'
|
|
85
|
+
borderTopStyle: 'none', borderRightStyle: 'none', borderLeftStyle: 'none',
|
|
86
|
+
// Make the focus underline (::after) match the width of the bottom border
|
|
87
|
+
'::after': {
|
|
88
|
+
left: 0,
|
|
89
|
+
right: 0,
|
|
90
|
+
} }),
|
|
93
91
|
underlineInteractive: {
|
|
94
92
|
':hover': {
|
|
95
93
|
borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessibleHover,
|
|
@@ -122,7 +120,15 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
122
120
|
backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
|
|
123
121
|
boxShadow: react_theme_1.tokens.shadow2,
|
|
124
122
|
},
|
|
125
|
-
disabled: tslib_1.__assign(tslib_1.__assign({ cursor: 'not-allowed', backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), { '@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('GrayText'))
|
|
123
|
+
disabled: tslib_1.__assign(tslib_1.__assign({ cursor: 'not-allowed', backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), { '@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('GrayText')),
|
|
124
|
+
// remove the focus border
|
|
125
|
+
'::after': {
|
|
126
|
+
content: 'unset',
|
|
127
|
+
},
|
|
128
|
+
// remove the focus outline
|
|
129
|
+
':focus-within': {
|
|
130
|
+
outlineStyle: 'none',
|
|
131
|
+
} }),
|
|
126
132
|
});
|
|
127
133
|
var useInputClassName = react_1.makeResetStyles({
|
|
128
134
|
boxSizing: 'border-box',
|
|
@@ -189,9 +195,6 @@ define(["require", "exports", "tslib", "@fluentui/react-theme", "@griffel/react"
|
|
|
189
195
|
var disabled = state.input.disabled;
|
|
190
196
|
var invalid = "" + state.input['aria-invalid'] === 'true';
|
|
191
197
|
var filled = appearance.startsWith('filled');
|
|
192
|
-
// Call exactly one of the two base className hooks. Each of these hooks is functionally identical, but with
|
|
193
|
-
// different styles applied, which makes it ok to conditionally change which hook is called.
|
|
194
|
-
var useRootClassName = disabled ? useRootNonInteractiveClassName : useRootInteractiveClassName;
|
|
195
198
|
var rootStyles = useRootStyles();
|
|
196
199
|
var inputStyles = useInputElementStyles();
|
|
197
200
|
var contentStyles = useContentStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/Input/useInputStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,kBAAkB;QACzB,aAAa,EAAE,0BAA0B;QACzC,YAAY,EAAE,yBAAyB;KACxC,CAAC;IAEF,kDAAkD;IAClD,IAAM,YAAY,GAAG;QACnB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd,CAAC;IAEF,IAAM,cAAc,uCAClB,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,QAAQ,EACpB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,oBAAM,CAAC,oBAAoB,EAChC,YAAY,EAAE,oBAAM,CAAC,kBAAkB,EACvC,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,YAAY;QAEvB,yBAAyB;QACzB,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EAC/B,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,oBAAY,CAClC,uBAAe,CAAC,KAAK,EACrB,iBAAiB,EAAE,EACnB,IAAI,KAAK,OAAO,IAAI,WAAW,CAAC,KAAK,EACrC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAChC,KAAK,CAAC,KAAK,CAAC,SAAS,CACtB,CAAC;QAEF,IAAM,cAAc,GAAG,CAAC,mBAAmB,EAAE,EAAE,QAAQ,IAAI,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QACxG,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,oBAAY,4DAC1C,uBAAe,CAAC,aAAa,GAC1B,cAAc,IACjB,KAAK,CAAC,aAAa,CAAC,SAAS,GAC9B,CAAC;SACH;QACD,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,YAAY,CAAC,SAAS,GAAG,oBAAY,4DACzC,uBAAe,CAAC,YAAY,GACzB,cAAc,IACjB,KAAK,CAAC,YAAY,CAAC,SAAS,GAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IArDW,QAAA,uBAAuB,2BAqDlC","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"]}
|
|
1
|
+
{"version":3,"file":"useInputStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-input/src/components/Input/useInputStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,kBAAkB;QACzB,aAAa,EAAE,0BAA0B;QACzC,YAAY,EAAE,yBAAyB;KACxC,CAAC;IAEF,kDAAkD;IAClD,IAAM,YAAY,GAAG;QACnB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd,CAAC;IAEF,IAAM,gBAAgB,GAAG,uBAAe,qCACtC,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,QAAQ,EACpB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,oBAAM,CAAC,oBAAoB,EAChC,YAAY,EAAE,oBAAM,CAAC,kBAAkB,EACvC,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,YAAY;QAEvB,yBAAyB;QACzB,SAAS,EAAE,YAAY,CAAC,MAAM,EAC9B,OAAO,EAAE,OAAK,oBAAM,CAAC,uBAAyB,IAC3C,8BAAgB,CAAC,KAAK;QAEzB,gCAAgC;QAChC,eAAe,EAAE,oBAAM,CAAC,uBAAuB,EAC/C,MAAM,EAAE,eAAa,oBAAM,CAAC,mBAAqB,EACjD,iBAAiB,EAAE,oBAAM,CAAC,4BAA4B;QAEtD,2CAA2C;QAC3C,+FAA+F;QAC/F,SAAS,EAAE;YACT,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;YAEb,yCAAyC;YACzC,sFAAsF;YACtF,gFAAgF;YAChF,qGAAqG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H;QACD,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,YAAY,CAAC,SAAS,GAAG,oBAAY,4DACzC,uBAAe,CAAC,YAAY,GACzB,cAAc,IACjB,KAAK,CAAC,YAAY,CAAC,SAAS,GAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAjDW,QAAA,uBAAuB,2BAiDlC","sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n padding: `0 ${tokens.spacingHorizontalMNudge}`,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalM,\n ...typographyStyles.body2,\n ...shorthands.gap(tokens.spacingHorizontalSNudge),\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderRadius(0), // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n});\n\nconst useInputClassName = makeResetStyles({\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${tokens.spacingHorizontalXXS}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n large: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n size === 'large' && inputStyles.large,\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -18,77 +18,7 @@ const fieldHeights = {
|
|
|
18
18
|
medium: '32px',
|
|
19
19
|
large: '40px'
|
|
20
20
|
};
|
|
21
|
-
const
|
|
22
|
-
display: 'inline-flex',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
flexWrap: 'nowrap',
|
|
25
|
-
gap: react_theme_1.tokens.spacingHorizontalXXS,
|
|
26
|
-
borderRadius: react_theme_1.tokens.borderRadiusMedium,
|
|
27
|
-
position: 'relative',
|
|
28
|
-
boxSizing: 'border-box',
|
|
29
|
-
// size: medium (default)
|
|
30
|
-
minHeight: fieldHeights.medium,
|
|
31
|
-
padding: `0 ${react_theme_1.tokens.spacingHorizontalMNudge}`,
|
|
32
|
-
...react_theme_1.typographyStyles.body1,
|
|
33
|
-
// appearance: outline (default)
|
|
34
|
-
backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
|
|
35
|
-
border: `1px solid ${react_theme_1.tokens.colorNeutralStroke1}`,
|
|
36
|
-
borderBottomColor: react_theme_1.tokens.colorNeutralStrokeAccessible
|
|
37
|
-
};
|
|
38
|
-
const rootInteractiveStyles = {
|
|
39
|
-
// This is all for the bottom focus border.
|
|
40
|
-
// It's supposed to be 2px flat all the way across and match the radius of the field's corners.
|
|
41
|
-
'::after': {
|
|
42
|
-
boxSizing: 'border-box',
|
|
43
|
-
content: '""',
|
|
44
|
-
position: 'absolute',
|
|
45
|
-
left: '-1px',
|
|
46
|
-
bottom: '-1px',
|
|
47
|
-
right: '-1px',
|
|
48
|
-
// Maintaining the correct corner radius:
|
|
49
|
-
// Use the whole border-radius as the height and only put radii on the bottom corners.
|
|
50
|
-
// (Otherwise the radius would be automatically reduced to fit available space.)
|
|
51
|
-
// max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.
|
|
52
|
-
height: `max(2px, ${react_theme_1.tokens.borderRadiusMedium})`,
|
|
53
|
-
borderBottomLeftRadius: react_theme_1.tokens.borderRadiusMedium,
|
|
54
|
-
borderBottomRightRadius: react_theme_1.tokens.borderRadiusMedium,
|
|
55
|
-
// Flat 2px border:
|
|
56
|
-
// By default borderBottom will cause little "horns" on the ends. The clipPath trims them off.
|
|
57
|
-
// (This could be done without trimming using `background: linear-gradient(...)`, but using
|
|
58
|
-
// borderBottom makes it easier for people to override the color if needed.)
|
|
59
|
-
borderBottom: `2px solid ${react_theme_1.tokens.colorCompoundBrandStroke}`,
|
|
60
|
-
clipPath: 'inset(calc(100% - 2px) 0 0 0)',
|
|
61
|
-
// Animation for focus OUT
|
|
62
|
-
transform: 'scaleX(0)',
|
|
63
|
-
transitionProperty: 'transform',
|
|
64
|
-
transitionDuration: react_theme_1.tokens.durationUltraFast,
|
|
65
|
-
transitionDelay: react_theme_1.tokens.curveAccelerateMid,
|
|
66
|
-
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
67
|
-
transitionDuration: '0.01ms',
|
|
68
|
-
transitionDelay: '0.01ms'
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
':focus-within::after': {
|
|
72
|
-
// Animation for focus IN
|
|
73
|
-
transform: 'scaleX(1)',
|
|
74
|
-
transitionProperty: 'transform',
|
|
75
|
-
transitionDuration: react_theme_1.tokens.durationNormal,
|
|
76
|
-
transitionDelay: react_theme_1.tokens.curveDecelerateMid,
|
|
77
|
-
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
78
|
-
transitionDuration: '0.01ms',
|
|
79
|
-
transitionDelay: '0.01ms'
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
':focus-within:active::after': {
|
|
83
|
-
// This is if the user clicks the field again while it's already focused
|
|
84
|
-
borderBottomColor: react_theme_1.tokens.colorCompoundBrandStrokePressed
|
|
85
|
-
},
|
|
86
|
-
':focus-within': {
|
|
87
|
-
outline: '2px solid transparent'
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const useRootNonInteractiveClassName = /*#__PURE__*/react_1.__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);}"]);
|
|
91
|
-
const useRootInteractiveClassName = /*#__PURE__*/react_1.__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;}"]);
|
|
21
|
+
const useRootClassName = /*#__PURE__*/react_1.__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;}"]);
|
|
92
22
|
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
93
23
|
small: {
|
|
94
24
|
sshi5w: "f1pha7fy",
|
|
@@ -130,7 +60,9 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
130
60
|
Btl43ni: ["f1ozlkrg", "f10ostut"],
|
|
131
61
|
icvyot: "f1ern45e",
|
|
132
62
|
vrafjx: ["f1n71otn", "f1deefiw"],
|
|
133
|
-
wvpqe5: ["f1deefiw", "f1n71otn"]
|
|
63
|
+
wvpqe5: ["f1deefiw", "f1n71otn"],
|
|
64
|
+
Eqx8gd: ["f1n6gb5g", "f15yvnhg"],
|
|
65
|
+
B1piin3: ["f15yvnhg", "f1n6gb5g"]
|
|
134
66
|
},
|
|
135
67
|
underlineInteractive: {
|
|
136
68
|
oetu4i: "f1l4zc64",
|
|
@@ -182,10 +114,12 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
182
114
|
Bjwas2f: "fg455y9",
|
|
183
115
|
Bn1d65q: ["f1rvyvqg", "f14g86mu"],
|
|
184
116
|
Bxeuatn: "f1cwzwz",
|
|
185
|
-
n51gp8: ["f14g86mu", "f1rvyvqg"]
|
|
117
|
+
n51gp8: ["f14g86mu", "f1rvyvqg"],
|
|
118
|
+
Bsft5z2: "fhr9occ",
|
|
119
|
+
Bduesf4: "f99w1ws"
|
|
186
120
|
}
|
|
187
121
|
}, {
|
|
188
|
-
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);}"],
|
|
122
|
+
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;}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right: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;}", ".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);}", ".fhr9occ::after{content:unset;}"],
|
|
189
123
|
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);}"],
|
|
190
124
|
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);}"],
|
|
191
125
|
m: [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
@@ -196,7 +130,8 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
|
196
130
|
m: "(forced-colors: active)"
|
|
197
131
|
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
198
132
|
m: "(forced-colors: active)"
|
|
199
|
-
}]]
|
|
133
|
+
}]],
|
|
134
|
+
w: [".f99w1ws:focus-within{outline-style:none;}"]
|
|
200
135
|
});
|
|
201
136
|
const useInputClassName = /*#__PURE__*/react_1.__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;}"]);
|
|
202
137
|
const useInputElementStyles = /*#__PURE__*/react_1.__styles({
|
|
@@ -239,9 +174,6 @@ const useInputStyles_unstable = state => {
|
|
|
239
174
|
const disabled = state.input.disabled;
|
|
240
175
|
const invalid = `${state.input['aria-invalid']}` === 'true';
|
|
241
176
|
const filled = appearance.startsWith('filled');
|
|
242
|
-
// Call exactly one of the two base className hooks. Each of these hooks is functionally identical, but with
|
|
243
|
-
// different styles applied, which makes it ok to conditionally change which hook is called.
|
|
244
|
-
const useRootClassName = disabled ? useRootNonInteractiveClassName : useRootInteractiveClassName;
|
|
245
177
|
const rootStyles = useRootStyles();
|
|
246
178
|
const inputStyles = useInputElementStyles();
|
|
247
179
|
const contentStyles = useContentStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AAGA;AAGaA,uBAAe,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,cAA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UAAU,CAACJ,OAAO,EAC1CD,QAAQ,IAAIK,UAAU,CAACL,QAAQ,EAC/BH,KAAK,CAAC3D,IAAI,CAACsE,SAAS,CACrB;EAEDX,KAAK,CAAC1D,KAAK,CAACqE,SAAS,GAAGnB,oBAAY,CAClCpD,uBAAe,CAACE,KAAK,EACrBqD,iBAAiB,EAAE,EACnBM,IAAI,KAAK,OAAO,IAAIQ,WAAW,CAAC7D,KAAK,EACrCuD,QAAQ,IAAIM,WAAW,CAACN,QAAQ,EAChCH,KAAK,CAAC1D,KAAK,CAACqE,SAAS,CACtB;EAED,MAAMI,cAAc,GAAG,CAAClB,mBAAmB,EAAE,EAAEM,QAAQ,IAAIO,aAAa,CAACP,QAAQ,EAAEO,aAAa,CAACT,IAAI,CAAC,CAAC;EACvG,IAAID,KAAK,CAACzD,aAAa,EAAE;IACvByD,KAAK,CAACzD,aAAa,CAACoE,SAAS,GAAGnB,oBAAY,CAC1CpD,uBAAe,CAACG,aAAa,EAC7B,GAAGwE,cAAc,EACjBf,KAAK,CAACzD,aAAa,CAACoE,SAAS,CAC9B;;EAEH,IAAIX,KAAK,CAACxD,YAAY,EAAE;IACtBwD,KAAK,CAACxD,YAAY,CAACmE,SAAS,GAAGnB,oBAAY,CACzCpD,uBAAe,CAACI,YAAY,EAC5B,GAAGuE,cAAc,EACjBf,KAAK,CAACxD,YAAY,CAACmE,SAAS,CAC7B;;EAGH,OAAOX,KAAK;AACd,CAAC;AArDY5D,+BAAuB","names":["exports","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","rootBaseStyles","display","alignItems","flexWrap","gap","react_theme_1","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","react_1","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"]}
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAEA;AAGaA,uBAAe,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,gBAAgB,gBAAGC,qBAAe,0gIA0EtC;AAEF,MAAMC,aAAa,gBAAGD,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAA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AC7B,GAAG4B,cAAc,EACjBd,KAAK,CAACd,aAAa,CAACwB,SAAS,CAC9B;;EAEH,IAAIV,KAAK,CAACb,YAAY,EAAE;IACtBa,KAAK,CAACb,YAAY,CAACuB,SAAS,GAAGjB,oBAAY,CACzCV,uBAAe,CAACI,YAAY,EAC5B,GAAG2B,cAAc,EACjBd,KAAK,CAACb,YAAY,CAACuB,SAAS,CAC7B;;EAGH,OAAOV,KAAK;AACd,CAAC;AAjDYjB,+BAAuB","names":["exports","root","input","contentBefore","contentAfter","fieldHeights","small","medium","large","useRootClassName","react_1","useRootStyles","useInputClassName","useInputElementStyles","useContentClassName","useContentStyles","useInputStyles_unstable","state","size","appearance","disabled","invalid","filled","startsWith","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 { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { InputSlots, InputState } from './Input.types';\n\nexport const inputClassNames: SlotClassNames<InputSlots> = {\n root: 'fui-Input',\n input: 'fui-Input__input',\n contentBefore: 'fui-Input__contentBefore',\n contentAfter: 'fui-Input__contentAfter',\n};\n\n// TODO(sharing) should these be shared somewhere?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n flexWrap: 'nowrap',\n gap: tokens.spacingHorizontalXXS,\n borderRadius: tokens.borderRadiusMedium, // used for all but underline\n position: 'relative',\n boxSizing: 'border-box',\n\n // size: medium (default)\n minHeight: fieldHeights.medium,\n padding: `0 ${tokens.spacingHorizontalMNudge}`,\n ...typographyStyles.body1,\n\n // appearance: outline (default)\n backgroundColor: tokens.colorNeutralBackground1,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n // This is all for the bottom focus border.\n // It's supposed to be 2px flat all the way across and match the radius of the field's corners.\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n\n // Maintaining the correct corner radius:\n // Use the whole border-radius as the height and only put radii on the bottom corners.\n // (Otherwise the radius would be automatically reduced to fit available space.)\n // max() ensures the focus border still shows up even if someone sets tokens.borderRadiusMedium to 0.\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n // Flat 2px border:\n // By default borderBottom will cause little \"horns\" on the ends. The clipPath trims them off.\n // (This could be done without trimming using `background: linear-gradient(...)`, but using\n // borderBottom makes it easier for people to override the color if needed.)\n borderBottom: `2px solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n\n // Animation for focus OUT\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n // Animation for focus IN\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n // This is if the user clicks the field again while it's already focused\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n ':focus-within': {\n outline: '2px solid transparent',\n },\n});\n\nconst useRootStyles = makeStyles({\n small: {\n minHeight: fieldHeights.small,\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n ...typographyStyles.caption1,\n },\n medium: {\n // included in rootBaseStyles\n },\n large: {\n minHeight: fieldHeights.large,\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalM,\n ...typographyStyles.body2,\n ...shorthands.gap(tokens.spacingHorizontalSNudge),\n },\n outline: {\n // included in rootBaseStyles\n },\n outlineInteractive: {\n ':hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderRadius(0), // corners look strange if rounded\n // border is specified in rootBaseStyles, but we only want a bottom border here\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderLeftStyle: 'none',\n // Make the focus underline (::after) match the width of the bottom border\n '::after': {\n left: 0,\n right: 0,\n },\n },\n underlineInteractive: {\n ':hover': {\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':active,:focus-within': {\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n '::after': shorthands.borderRadius(0), // remove rounded corners from focus underline\n },\n filled: {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n filledInteractive: {\n // DO NOT add a space between the selectors! It changes the behavior of make-styles.\n ':hover,:focus-within': {\n // also handles pressed border color (:active)\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker-shadow': {\n backgroundColor: tokens.colorNeutralBackground3,\n boxShadow: tokens.shadow2,\n },\n 'filled-lighter-shadow': {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow2,\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n // remove the focus border\n '::after': {\n content: 'unset',\n },\n // remove the focus outline\n ':focus-within': {\n outlineStyle: 'none',\n },\n },\n});\n\nconst useInputClassName = makeResetStyles({\n boxSizing: 'border-box',\n flexGrow: 1,\n minWidth: 0, // required to make the input shrink to fit the wrapper\n borderStyle: 'none', // input itself never has a border (this is handled by inputWrapper)\n padding: `0 ${tokens.spacingHorizontalXXS}`,\n color: tokens.colorNeutralForeground1,\n // Use literal \"transparent\" (not from the theme) to always let the color from the root show through\n backgroundColor: 'transparent',\n\n '::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1, // browser style override\n },\n\n outlineStyle: 'none', // disable default browser outline\n\n // Inherit typography styles from root\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n});\n\nconst useInputElementStyles = makeStyles({\n large: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useContentClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': { fontSize: '16px' },\n },\n medium: {\n // included in useContentClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the Input slots based on the state\n */\nexport const useInputStyles_unstable = (state: InputState): InputState => {\n const { size, appearance } = state;\n const disabled = state.input.disabled;\n const invalid = `${state.input['aria-invalid']}` === 'true';\n const filled = appearance.startsWith('filled');\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputElementStyles();\n const contentStyles = useContentStyles();\n\n state.root.className = mergeClasses(\n inputClassNames.root,\n useRootClassName(),\n rootStyles[size],\n rootStyles[appearance],\n !disabled && appearance === 'outline' && rootStyles.outlineInteractive,\n !disabled && appearance === 'underline' && rootStyles.underlineInteractive,\n !disabled && filled && rootStyles.filledInteractive,\n filled && rootStyles.filled,\n !disabled && invalid && rootStyles.invalid,\n disabled && rootStyles.disabled,\n state.root.className,\n );\n\n state.input.className = mergeClasses(\n inputClassNames.input,\n useInputClassName(),\n size === 'large' && inputStyles.large,\n disabled && inputStyles.disabled,\n state.input.className,\n );\n\n const contentClasses = [useContentClassName(), disabled && contentStyles.disabled, contentStyles[size]];\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(\n inputClassNames.contentBefore,\n ...contentClasses,\n state.contentBefore.className,\n );\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(\n inputClassNames.contentAfter,\n ...contentClasses,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"]}
|