@fluentui-copilot/react-send-button 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -2
- package/lib/SendButton.js +0 -1
- package/lib/components/SendButton/SendButton.js +4 -5
- package/lib/components/SendButton/SendButton.types.js +1 -2
- package/lib/components/SendButton/buttonMotion.js +199 -138
- package/lib/components/SendButton/index.js +0 -1
- package/lib/components/SendButton/renderSendButton.js +38 -30
- package/lib/components/SendButton/useSendButton.js +95 -97
- package/lib/components/SendButton/useSendButtonStyles.styles.js +43 -11
- package/lib/components/SendButton/useSendButtonStyles.styles.js.map +1 -1
- package/lib/components/SendButton/useSendButtonStyles.styles.raw.js +220 -0
- package/lib/components/SendButton/useSendButtonStyles.styles.raw.js.map +1 -0
- package/lib/index.js +0 -1
- package/lib-commonjs/SendButton.js +0 -1
- package/lib-commonjs/components/SendButton/SendButton.js +1 -1
- package/lib-commonjs/components/SendButton/SendButton.js.map +1 -1
- package/lib-commonjs/components/SendButton/SendButton.types.js +0 -1
- package/lib-commonjs/components/SendButton/buttonMotion.js +1 -1
- package/lib-commonjs/components/SendButton/buttonMotion.js.map +1 -1
- package/lib-commonjs/components/SendButton/index.js +0 -1
- package/lib-commonjs/components/SendButton/renderSendButton.js +1 -1
- package/lib-commonjs/components/SendButton/renderSendButton.js.map +1 -1
- package/lib-commonjs/components/SendButton/useSendButton.js +1 -1
- package/lib-commonjs/components/SendButton/useSendButton.js.map +1 -1
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.js +85 -9
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.raw.js +236 -0
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +0 -1
- package/package.json +4 -4
|
@@ -13,101 +13,99 @@ const SendIcon = bundleIcon(SendFilled, SendRegular);
|
|
|
13
13
|
*
|
|
14
14
|
* @param props - props from this instance of SendButton
|
|
15
15
|
* @param ref - reference to root HTMLElement of SendButton
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return state;
|
|
16
|
+
*/ export const useSendButton_unstable = (props, ref)=>{
|
|
17
|
+
/** Used to apply/remove styles when button is animating */ const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);
|
|
18
|
+
const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);
|
|
19
|
+
const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;
|
|
20
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
21
|
+
const mode = useCopilotMode(props.mode);
|
|
22
|
+
const [visible, setVisible] = React.useState(false);
|
|
23
|
+
const mountRef = React.useCallback((elem)=>{
|
|
24
|
+
if (elem) {
|
|
25
|
+
setVisible(true);
|
|
26
|
+
} else {
|
|
27
|
+
setVisible(false);
|
|
28
|
+
}
|
|
29
|
+
}, []);
|
|
30
|
+
const finalRef = useMergedRefs(ref, mountRef);
|
|
31
|
+
const buttonState = useButton_unstable({
|
|
32
|
+
shape: designVersion === 'next' ? 'circular' : undefined,
|
|
33
|
+
...props,
|
|
34
|
+
appearance: 'transparent',
|
|
35
|
+
'aria-disabled': props.disabled ? true : undefined,
|
|
36
|
+
type: 'submit'
|
|
37
|
+
}, finalRef);
|
|
38
|
+
const icon = (()=>{
|
|
39
|
+
if (designVersion === 'next') {
|
|
40
|
+
return mode === 'canvas' ? /*#__PURE__*/ React.createElement(ArrowRight24Filled, null) : /*#__PURE__*/ React.createElement(ArrowRight20Filled, null);
|
|
41
|
+
} else {
|
|
42
|
+
if (props.isSendIconFilled || isButtonMotionRunning) {
|
|
43
|
+
return /*#__PURE__*/ React.createElement(SendFilled, null);
|
|
44
|
+
} else {
|
|
45
|
+
return /*#__PURE__*/ React.createElement(SendIcon, null);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
49
|
+
var _props_isDictationActive;
|
|
50
|
+
const state = {
|
|
51
|
+
...buttonState,
|
|
52
|
+
components: {
|
|
53
|
+
root: 'button',
|
|
54
|
+
sendIcon: 'span',
|
|
55
|
+
stopIcon: 'span',
|
|
56
|
+
stopBackground: 'div',
|
|
57
|
+
sendButtonMotion: SendButtonMotion,
|
|
58
|
+
stopButtonMotion: StopButtonMotion,
|
|
59
|
+
stopBackgroundMotion: CircleButtonMotion
|
|
60
|
+
},
|
|
61
|
+
root: buttonState.root,
|
|
62
|
+
sendIcon: slot.always(props.sendIcon, {
|
|
63
|
+
elementType: 'span',
|
|
64
|
+
defaultProps: {
|
|
65
|
+
children: icon
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
stopIcon: slot.optional(props.stopIcon, {
|
|
69
|
+
elementType: 'span',
|
|
70
|
+
defaultProps: {
|
|
71
|
+
children: designVersion === 'next' ? mode === 'canvas' ? /*#__PURE__*/ React.createElement(Stop20Filled, null) : /*#__PURE__*/ React.createElement(Stop16Filled, null) : /*#__PURE__*/ React.createElement(Stop16Filled, null)
|
|
72
|
+
},
|
|
73
|
+
renderByDefault: true
|
|
74
|
+
}),
|
|
75
|
+
stopBackground: slot.always(props.stopBackground, {
|
|
76
|
+
elementType: 'div'
|
|
77
|
+
}),
|
|
78
|
+
sendButtonMotion: presenceMotionSlot(props.sendButtonMotion, {
|
|
79
|
+
elementType: SendButtonMotion,
|
|
80
|
+
defaultProps: {
|
|
81
|
+
visible: !props.isSending,
|
|
82
|
+
unmountOnExit: true,
|
|
83
|
+
onMotionFinish: ()=>setIsSendMotionRunning(false),
|
|
84
|
+
onMotionStart: ()=>setIsSendMotionRunning(true)
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
87
|
+
stopButtonMotion: presenceMotionSlot(props.stopButtonMotion, {
|
|
88
|
+
elementType: StopButtonMotion,
|
|
89
|
+
defaultProps: {
|
|
90
|
+
visible: props.isSending,
|
|
91
|
+
unmountOnExit: true,
|
|
92
|
+
onMotionFinish: ()=>setIsStopMotionRunning(false),
|
|
93
|
+
onMotionStart: ()=>setIsStopMotionRunning(true)
|
|
94
|
+
}
|
|
95
|
+
}),
|
|
96
|
+
stopBackgroundMotion: presenceMotionSlot(props.stopBackgroundMotion, {
|
|
97
|
+
elementType: CircleButtonMotion,
|
|
98
|
+
defaultProps: {
|
|
99
|
+
visible: designVersion === 'next' ? visible : props.isSending,
|
|
100
|
+
unmountOnExit: true
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
isButtonMotionRunning,
|
|
104
|
+
isDictationActive: (_props_isDictationActive = props.isDictationActive) !== null && _props_isDictationActive !== void 0 ? _props_isDictationActive : false,
|
|
105
|
+
isSendIconFilled: props.isSendIconFilled,
|
|
106
|
+
isSending: props.isSending,
|
|
107
|
+
designVersion,
|
|
108
|
+
mode
|
|
109
|
+
};
|
|
110
|
+
return state;
|
|
112
111
|
};
|
|
113
|
-
//# sourceMappingURL=useSendButton.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __styles, mergeClasses, useButtonStyles_unstable, createCustomFocusIndicatorStyle } from '@fluentui/react-components';
|
|
1
|
+
import { __styles, mergeClasses, useButtonStyles_unstable, createCustomFocusIndicatorStyle, shorthands } from '@fluentui/react-components';
|
|
2
2
|
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
3
|
export const sendButtonClassNames = {
|
|
4
4
|
root: 'fai-SendButton',
|
|
@@ -71,7 +71,8 @@ const useNextStyles = __styles({
|
|
|
71
71
|
Bq1tomu: "fwzfryc",
|
|
72
72
|
qhf8xq: "f1tmlkn4",
|
|
73
73
|
Bj3rh1h: "f19g0ac",
|
|
74
|
-
sj55zd: "f1phragk"
|
|
74
|
+
sj55zd: "f1phragk",
|
|
75
|
+
B7iucu3: "fqc85l4"
|
|
75
76
|
},
|
|
76
77
|
dictationActive: {
|
|
77
78
|
sj55zd: "fkfq4zb"
|
|
@@ -116,7 +117,10 @@ const useNextStyles = __styles({
|
|
|
116
117
|
p: -1
|
|
117
118
|
}], ".f1l02sjl{height:100%;}", ".fly5x3f{width:100%;}", [".f44lkw9{border-radius:var(--borderRadiusCircular);}", {
|
|
118
119
|
p: -1
|
|
119
|
-
}], ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f16xkysk{background-color:var(--colorBrandBackground2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1bg9a2p{background-color:var(--colorNeutralBackgroundDisabled);}"]
|
|
120
|
+
}], ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f16xkysk{background-color:var(--colorBrandBackground2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1bg9a2p{background-color:var(--colorNeutralBackgroundDisabled);}"],
|
|
121
|
+
m: [["@media (forced-colors: active){.fqc85l4{color:HighlightText;}}", {
|
|
122
|
+
m: "(forced-colors: active)"
|
|
123
|
+
}]]
|
|
120
124
|
});
|
|
121
125
|
const useRootNextStyles = __styles({
|
|
122
126
|
root: {
|
|
@@ -147,13 +151,18 @@ const useRootNextStyles = __styles({
|
|
|
147
151
|
g2u3we: 0,
|
|
148
152
|
icvyot: 0,
|
|
149
153
|
B4j52fo: 0,
|
|
150
|
-
irswps: "
|
|
154
|
+
irswps: "f88035w",
|
|
151
155
|
qhf8xq: "f10pi13n",
|
|
152
156
|
Bfpq7zp: 0,
|
|
153
157
|
g9k6zt: 0,
|
|
154
158
|
Bn4voq9: 0,
|
|
155
|
-
giviqs: "
|
|
156
|
-
j6ew2k: "
|
|
159
|
+
giviqs: "f1m9av4t",
|
|
160
|
+
j6ew2k: "f1nlh5rk",
|
|
161
|
+
Bcq6wej: "fjq791v",
|
|
162
|
+
Jcjdmf: ["fkq2p2y", "f1sehlss"],
|
|
163
|
+
sc4o1m: "f11odvng",
|
|
164
|
+
Bosien3: ["f1sehlss", "fkq2p2y"],
|
|
165
|
+
B0a1hpu: "f12mm4ns"
|
|
157
166
|
},
|
|
158
167
|
canvas: {
|
|
159
168
|
Bf4jedk: "f12clzc2",
|
|
@@ -165,30 +174,53 @@ const useRootNextStyles = __styles({
|
|
|
165
174
|
},
|
|
166
175
|
notSending: {
|
|
167
176
|
Bmdhgnd: "fiaw31n",
|
|
168
|
-
|
|
177
|
+
Buhwtog: "fmv7hed",
|
|
178
|
+
Bsyoesm: "f10g5jnj",
|
|
179
|
+
B5xjowy: "f1hzts53",
|
|
169
180
|
f30giq: "f3l45fr"
|
|
170
181
|
},
|
|
171
182
|
notSendingDictationActive: {
|
|
172
183
|
Bmdhgnd: "fkhxdak",
|
|
184
|
+
Buhwtog: "fmv7hed",
|
|
173
185
|
jhc297: "f1dxmfzy",
|
|
186
|
+
B885nwu: "f175mo2",
|
|
174
187
|
f30giq: "f1zsivl",
|
|
175
188
|
Ba808g4: "f50srwi"
|
|
176
189
|
},
|
|
177
190
|
sending: {
|
|
178
191
|
Bmdhgnd: "f1hzdlu9",
|
|
192
|
+
Buhwtog: "fmv7hed",
|
|
179
193
|
uj1ttc: "fe9pnmy",
|
|
194
|
+
E4wjbi: "f18cpvo8",
|
|
180
195
|
f30giq: "f876z59",
|
|
181
196
|
Bssu2nw: "fqsoy9w"
|
|
182
197
|
}
|
|
183
198
|
}, {
|
|
184
199
|
d: [".f13qh94s{display:grid;}", ".f9o42qa{grid-template-areas:\"button\";}", ".f1u7ey36{grid-template-rows:1fr;}", ".f1c2z91y{grid-template-columns:1fr;}", ".f1oiokrs{justify-items:center;}", ".f122n59{align-items:center;}", [".fv5o1b5{padding:var(--spacingVerticalNone);}", {
|
|
185
200
|
p: -1
|
|
186
|
-
}], [".
|
|
201
|
+
}], [".f88035w{border:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
187
202
|
p: -2
|
|
188
|
-
}], ".f10pi13n{position:relative;}", [".
|
|
203
|
+
}], ".f10pi13n{position:relative;}", [".f1m9av4t[data-fui-focus-visible]{outline:var(--strokeWidthThin) solid var(--colorTransparentStroke) inset;}", {
|
|
189
204
|
p: -1
|
|
190
|
-
}], ".
|
|
191
|
-
|
|
205
|
+
}], ".f1nlh5rk[data-fui-focus-visible]{box-shadow:0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2);}", ".f12clzc2{min-width:40px;}", ".fbhnoac{height:40px;}", ".fwbmr0d{min-width:32px;}", ".f1d2rq10{height:32px;}"],
|
|
206
|
+
m: [["@media (forced-colors: active){.fjq791v{border-top-color:Highlight;}}", {
|
|
207
|
+
m: "(forced-colors: active)"
|
|
208
|
+
}], ["@media (forced-colors: active){.f1sehlss{border-left-color:Highlight;}.fkq2p2y{border-right-color:Highlight;}}", {
|
|
209
|
+
m: "(forced-colors: active)"
|
|
210
|
+
}], ["@media (forced-colors: active){.f11odvng{border-bottom-color:Highlight;}}", {
|
|
211
|
+
m: "(forced-colors: active)"
|
|
212
|
+
}], ["@media (forced-colors: active){.f12mm4ns .fai-SendButton__stopBackground{background-color:Highlight;}}", {
|
|
213
|
+
m: "(forced-colors: active)"
|
|
214
|
+
}], ["@media (forced-colors: active){.fmv7hed:hover .fai-SendButton__stopBackground{background-color:HighlightText;}}", {
|
|
215
|
+
m: "(forced-colors: active)"
|
|
216
|
+
}], ["@media (forced-colors: active){.f1hzts53:hover .fai-SendButton__sendIcon,.f1hzts53:hover .fai-SendButton__stopIcon{color:Highlight;}}", {
|
|
217
|
+
m: "(forced-colors: active)"
|
|
218
|
+
}], ["@media (forced-colors: active){.f175mo2:hover .fai-SendButton__sendIcon{color:Highlight;}}", {
|
|
219
|
+
m: "(forced-colors: active)"
|
|
220
|
+
}], ["@media (forced-colors: active){.f18cpvo8:hover .fai-SendButton__stopIcon{color:Highlight;}}", {
|
|
221
|
+
m: "(forced-colors: active)"
|
|
222
|
+
}]],
|
|
223
|
+
h: [".fiaw31n:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundHover);}", ".f10g5jnj:hover .fai-SendButton__sendIcon,.f10g5jnj:hover .fai-SendButton__stopIcon{color:var(--colorNeutralForegroundOnBrand);}", ".fkhxdak:hover .fai-SendButton__stopBackground{background-color:var(--colorSubtleBackgroundHover);}", ".f1dxmfzy:hover .fai-SendButton__sendIcon{color:var(--colorNeutralForeground2Hover);}", ".f1hzdlu9:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackground2Hover);}", ".fe9pnmy:hover .fai-SendButton__stopIcon{color:var(--colorBrandForeground2Hover);}"],
|
|
192
224
|
a: [".f3l45fr:active .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundPressed);}", ".f1zsivl:active .fai-SendButton__stopBackground{background-color:var(--colorSubtleBackgroundPressed);}", ".f50srwi:active .fai-SendButton__sendIcon{color:var(--colorNeutralForeground2Pressed);}", ".f876z59:active .fai-SendButton__stopBackground{background-color:var(--colorBrandBackground2Pressed);}", ".fqsoy9w:active .fai-SendButton__stopIcon{color:var(--colorBrandForeground2Pressed);}"]
|
|
193
225
|
});
|
|
194
226
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSendButtonStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n mergeClasses,\n useButtonStyles_unstable,\n createCustomFocusIndicatorStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nimport type { SendButtonSlots, SendButtonState } from './SendButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const sendButtonClassNames: SlotClassNames<SendButtonSlots> = {\n root: 'fai-SendButton',\n sendIcon: 'fai-SendButton__sendIcon',\n stopIcon: 'fai-SendButton__stopIcon',\n stopBackground: 'fai-SendButton__stopBackground',\n sendButtonMotion: 'fai-SendButton__sendButtonMotion',\n stopButtonMotion: 'fai-SendButton__stopButtonMotion',\n stopBackgroundMotion: 'fai-SendButton__stopBackgroundMotion',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n width: '32px',\n minWidth: '32px',\n height: '32px',\n alignItems: 'center',\n padding: '0',\n },\n\n baseIconButton: {\n position: 'absolute',\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n fontSize: tokens.fontSizeBase500, // 20px\n height: '20px',\n width: '20px',\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n iconFilled: {\n color: tokens.colorCompoundBrandBackground,\n ':hover': {\n color: tokens.colorCompoundBrandBackgroundHover,\n },\n },\n\n stopBackground: {\n position: 'absolute',\n width: 'inherit',\n height: 'inherit',\n borderRadius: tokens.borderRadiusCircular,\n /** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/\n backgroundColor: tokens.colorBrandBackground2,\n },\n});\n\nconst useNextStyles = makeStyles({\n baseIconButton: {\n display: 'inline-flex',\n justifyContent: 'center',\n gridArea: 'button',\n position: 'initial',\n zIndex: 1,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n dictationActive: {\n color: tokens.colorNeutralForeground2,\n },\n\n sendIconFilled: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n stopIconFilled: {\n color: tokens.colorBrandForeground2,\n },\n\n stopBackground: {\n gridArea: 'button',\n height: '100%',\n width: '100%',\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorBrandBackground,\n },\n\n stopBackgroundSending: {\n backgroundColor: tokens.colorBrandBackground2,\n },\n\n stopBackgroundDictationActive: {\n backgroundColor: tokens.colorTransparentBackground,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n stopBackgroundDisabled: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n },\n});\n\nconst useRootNextStyles = makeStyles({\n root: {\n display: 'grid',\n gridTemplateAreas: `\"button\"`,\n gridTemplateRows: '1fr',\n gridTemplateColumns: '1fr',\n justifyItems: 'center',\n alignItems: 'center',\n padding: tokens.spacingVerticalNone,\n border: 'none',\n position: 'relative',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorTransparentStroke}`,\n boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}`,\n }),\n },\n\n canvas: {\n minWidth: '40px',\n height: '40px',\n },\n\n sidecar: {\n minWidth: '32px',\n height: '32px',\n },\n\n notSending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundHover,\n },\n\n [`& .${sendButtonClassNames.sendIcon},.${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n },\n },\n },\n notSendingDictationActive: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n\n [`& .${sendButtonClassNames.sendIcon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n [`& .${sendButtonClassNames.sendIcon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n sending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n [`& .${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorBrandForeground2Hover,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n [`& .${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorBrandForeground2Pressed,\n },\n },\n },\n});\n\n/**\n * Apply styling to the SendButton slots based on the state\n */\nexport const useSendButtonStyles_unstable = (state: SendButtonState): SendButtonState => {\n 'use no memo';\n const { isDictationActive, isSendIconFilled, isSending, disabled, designVersion, mode } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootNextStyles = useRootNextStyles();\n\n const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;\n const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;\n\n state.root.className = mergeClasses(\n sendButtonClassNames.root,\n designVersion === 'next' ? rootNextStyles.root : styles.root,\n isSendIconFilled && sendIconFilledStyle,\n (state.isButtonMotionRunning || isSending) && sendIconFilledStyle,\n designVersion === 'next' && rootNextStyles[mode],\n designVersion === 'next' && rootNextStyles.root,\n !disabled &&\n designVersion === 'next' &&\n !isSending &&\n (isDictationActive ? rootNextStyles.notSendingDictationActive : rootNextStyles.notSending),\n !disabled && designVersion === 'next' && isSending && rootNextStyles.sending,\n disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.sendIcon) {\n state.sendIcon.className = mergeClasses(\n sendButtonClassNames.sendIcon,\n designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton,\n !disabled && designVersion === 'next' && !isSending && isDictationActive && nextStyles.dictationActive,\n disabled && designVersion === 'next' && nextStyles.disabled,\n state.sendIcon.className,\n );\n }\n\n if (state.stopIcon) {\n state.stopIcon.className = mergeClasses(\n sendButtonClassNames.stopIcon,\n designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton,\n stopIconFilledStyle,\n state.stopIcon.className,\n );\n }\n\n if (state.stopBackground) {\n state.stopBackground.className = mergeClasses(\n sendButtonClassNames.stopBackground,\n designVersion === 'next' ? nextStyles.stopBackground : styles.stopBackground,\n designVersion === 'next' && isSending && nextStyles.stopBackgroundSending,\n designVersion === 'next' && !isSending && isDictationActive && nextStyles.stopBackgroundDictationActive,\n designVersion === 'next' && disabled && nextStyles.stopBackgroundDisabled,\n state.stopBackground.className,\n );\n }\n\n // Add style hooks from button\n useButtonStyles_unstable({ ...state, components: { ...state.components, icon: 'span' }, iconOnly: false });\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useButtonStyles_unstable","createCustomFocusIndicatorStyle","tokens","sendButtonClassNames","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","useStyles","display","width","minWidth","height","alignItems","padding","baseIconButton","position","justifyContent","fontSize","fontSizeBase500","disabled","color","colorNeutralForegroundDisabled","iconFilled","colorCompoundBrandBackground","colorCompoundBrandBackgroundHover","borderRadius","borderRadiusCircular","backgroundColor","colorBrandBackground2","useNextStyles","gridArea","zIndex","colorNeutralForegroundOnBrand","dictationActive","colorNeutralForeground2","sendIconFilled","stopIconFilled","colorBrandForeground2","colorBrandBackground","stopBackgroundSending","stopBackgroundDictationActive","colorTransparentBackground","stopBackgroundDisabled","colorNeutralBackgroundDisabled","useRootNextStyles","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","justifyItems","spacingVerticalNone","border","outline","strokeWidthThick","colorTransparentStroke","boxShadow","colorStrokeFocus2","canvas","sidecar","notSending","colorBrandBackgroundHover","colorBrandBackgroundPressed","notSendingDictationActive","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","sending","colorBrandBackground2Hover","colorBrandForeground2Hover","colorBrandBackground2Pressed","colorBrandForeground2Pressed","useSendButtonStyles_unstable","state","isDictationActive","isSendIconFilled","isSending","designVersion","mode","styles","nextStyles","rootNextStyles","sendIconFilledStyle","stopIconFilledStyle","className","isButtonMotionRunning","components","icon","iconOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,YAAY,EACZC,wBAAwB,EACxBC,+BAA+B,QAC1B,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAKlD,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,UAAU;IACVC,UAAU;IACVC,gBAAgB;IAChBC,kBAAkB;IAClBC,kBAAkB;IAClBC,sBAAsB;AAC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,CAACD,aAAaF,qBAAqBM,WAAWvC,6BAA6B,EACvGoC,kBAAkB,UAAUzD,YAAY4D,WAAWrC,sBAAsB,EACzE8B,MAAMrE,cAAc,CAACgF,SAAS;IAElC;IAEA,8BAA8B;IAC9BvF,yBAAyB;QAAE,GAAG4E,KAAK;QAAEa,YAAY;YAAE,GAAGb,MAAMa,UAAU;YAAEC,MAAM;QAAO;QAAGC,UAAU;IAAM;IAExG,OAAOf;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useSendButtonStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n mergeClasses,\n useButtonStyles_unstable,\n createCustomFocusIndicatorStyle,\n shorthands,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nimport type { SendButtonSlots, SendButtonState } from './SendButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const sendButtonClassNames: SlotClassNames<SendButtonSlots> = {\n root: 'fai-SendButton',\n sendIcon: 'fai-SendButton__sendIcon',\n stopIcon: 'fai-SendButton__stopIcon',\n stopBackground: 'fai-SendButton__stopBackground',\n sendButtonMotion: 'fai-SendButton__sendButtonMotion',\n stopButtonMotion: 'fai-SendButton__stopButtonMotion',\n stopBackgroundMotion: 'fai-SendButton__stopBackgroundMotion',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n width: '32px',\n minWidth: '32px',\n height: '32px',\n alignItems: 'center',\n padding: '0',\n },\n\n baseIconButton: {\n position: 'absolute',\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n fontSize: tokens.fontSizeBase500, // 20px\n height: '20px',\n width: '20px',\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n iconFilled: {\n color: tokens.colorCompoundBrandBackground,\n ':hover': {\n color: tokens.colorCompoundBrandBackgroundHover,\n },\n },\n\n stopBackground: {\n position: 'absolute',\n width: 'inherit',\n height: 'inherit',\n borderRadius: tokens.borderRadiusCircular,\n /** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/\n backgroundColor: tokens.colorBrandBackground2,\n },\n});\n\nconst useNextStyles = makeStyles({\n baseIconButton: {\n display: 'inline-flex',\n justifyContent: 'center',\n gridArea: 'button',\n position: 'initial',\n zIndex: 1,\n color: tokens.colorNeutralForegroundOnBrand,\n\n '@media (forced-colors: active)': {\n color: 'HighlightText',\n },\n },\n\n dictationActive: {\n color: tokens.colorNeutralForeground2,\n },\n\n sendIconFilled: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n stopIconFilled: {\n color: tokens.colorBrandForeground2,\n },\n\n stopBackground: {\n gridArea: 'button',\n height: '100%',\n width: '100%',\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorBrandBackground,\n },\n\n stopBackgroundSending: {\n backgroundColor: tokens.colorBrandBackground2,\n },\n\n stopBackgroundDictationActive: {\n backgroundColor: tokens.colorTransparentBackground,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n stopBackgroundDisabled: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n },\n});\n\nconst useRootNextStyles = makeStyles({\n root: {\n display: 'grid',\n gridTemplateAreas: `\"button\"`,\n gridTemplateRows: '1fr',\n gridTemplateColumns: '1fr',\n justifyItems: 'center',\n alignItems: 'center',\n padding: tokens.spacingVerticalNone,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n position: 'relative',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke} inset`,\n boxShadow: `0 0 0 ${tokens.strokeWidthThin} ${tokens.colorStrokeFocus2}`,\n }),\n\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('Highlight'),\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: 'Highlight',\n },\n },\n },\n\n canvas: {\n minWidth: '40px',\n height: '40px',\n },\n\n sidecar: {\n minWidth: '32px',\n height: '32px',\n },\n\n notSending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundHover,\n\n '@media (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n },\n },\n\n [`& .${sendButtonClassNames.sendIcon}, & .${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n\n '@media (forced-colors: active)': {\n color: 'Highlight',\n },\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n },\n },\n },\n notSendingDictationActive: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n\n '@media (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n },\n },\n\n [`& .${sendButtonClassNames.sendIcon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n\n '@media (forced-colors: active)': {\n color: 'Highlight',\n },\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n [`& .${sendButtonClassNames.sendIcon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n sending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Hover,\n\n '@media (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n },\n },\n [`& .${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorBrandForeground2Hover,\n\n '@media (forced-colors: active)': {\n color: 'Highlight',\n },\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n [`& .${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorBrandForeground2Pressed,\n },\n },\n },\n});\n\n/**\n * Apply styling to the SendButton slots based on the state\n */\nexport const useSendButtonStyles_unstable = (state: SendButtonState): SendButtonState => {\n 'use no memo';\n const { isDictationActive, isSendIconFilled, isSending, disabled, designVersion, mode } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootNextStyles = useRootNextStyles();\n\n const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;\n const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;\n\n state.root.className = mergeClasses(\n sendButtonClassNames.root,\n designVersion === 'next' ? rootNextStyles.root : styles.root,\n isSendIconFilled && sendIconFilledStyle,\n (state.isButtonMotionRunning || isSending) && sendIconFilledStyle,\n designVersion === 'next' && rootNextStyles[mode],\n designVersion === 'next' && rootNextStyles.root,\n !disabled &&\n designVersion === 'next' &&\n !isSending &&\n (isDictationActive ? rootNextStyles.notSendingDictationActive : rootNextStyles.notSending),\n !disabled && designVersion === 'next' && isSending && rootNextStyles.sending,\n disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.sendIcon) {\n state.sendIcon.className = mergeClasses(\n sendButtonClassNames.sendIcon,\n designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton,\n !disabled && designVersion === 'next' && !isSending && isDictationActive && nextStyles.dictationActive,\n disabled && designVersion === 'next' && nextStyles.disabled,\n state.sendIcon.className,\n );\n }\n\n if (state.stopIcon) {\n state.stopIcon.className = mergeClasses(\n sendButtonClassNames.stopIcon,\n designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton,\n stopIconFilledStyle,\n state.stopIcon.className,\n );\n }\n\n if (state.stopBackground) {\n state.stopBackground.className = mergeClasses(\n sendButtonClassNames.stopBackground,\n designVersion === 'next' ? nextStyles.stopBackground : styles.stopBackground,\n designVersion === 'next' && isSending && nextStyles.stopBackgroundSending,\n designVersion === 'next' && !isSending && isDictationActive && nextStyles.stopBackgroundDictationActive,\n designVersion === 'next' && disabled && nextStyles.stopBackgroundDisabled,\n state.stopBackground.className,\n );\n }\n\n // Add style hooks from button\n useButtonStyles_unstable({ ...state, components: { ...state.components, icon: 'span' }, iconOnly: false });\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useButtonStyles_unstable","createCustomFocusIndicatorStyle","shorthands","tokens","sendButtonClassNames","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","useStyles","display","width","minWidth","height","alignItems","padding","baseIconButton","position","justifyContent","fontSize","fontSizeBase500","disabled","color","colorNeutralForegroundDisabled","iconFilled","colorCompoundBrandBackground","colorCompoundBrandBackgroundHover","borderRadius","borderRadiusCircular","backgroundColor","colorBrandBackground2","useNextStyles","gridArea","zIndex","colorNeutralForegroundOnBrand","dictationActive","colorNeutralForeground2","sendIconFilled","stopIconFilled","colorBrandForeground2","colorBrandBackground","stopBackgroundSending","stopBackgroundDictationActive","colorTransparentBackground","stopBackgroundDisabled","colorNeutralBackgroundDisabled","useRootNextStyles","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","justifyItems","spacingVerticalNone","border","strokeWidthThin","colorTransparentStroke","outline","boxShadow","colorStrokeFocus2","borderColor","canvas","sidecar","notSending","colorBrandBackgroundHover","colorBrandBackgroundPressed","notSendingDictationActive","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","sending","colorBrandBackground2Hover","colorBrandForeground2Hover","colorBrandBackground2Pressed","colorBrandForeground2Pressed","useSendButtonStyles_unstable","state","isDictationActive","isSendIconFilled","isSending","designVersion","mode","styles","nextStyles","rootNextStyles","sendIconFilledStyle","stopIconFilledStyle","className","isButtonMotionRunning","components","icon","iconOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE;QAClBwE,MAAMxE,QAAQ,CAACmF,SAAS,GAAG1F,aACzBK,qBAAqBE,QAAQ,EAC7B4E,kBAAkB,SAASG,WAAWlE,cAAc,GAAGiE,OAAOjE,cAAc,EAC5E,CAACK,YAAY0D,kBAAkB,UAAU,CAACD,aAAaF,qBAAqBM,WAAW/C,eAAe,EACtGd,YAAY0D,kBAAkB,UAAUG,WAAW7D,QAAQ,EAC3DsD,MAAMxE,QAAQ,CAACmF,SAAS;IAE5B;IAEA,IAAIX,MAAMvE,QAAQ,EAAE;QAClBuE,MAAMvE,QAAQ,CAACkF,SAAS,GAAG1F,aACzBK,qBAAqBG,QAAQ,EAC7B2E,kBAAkB,SAASG,WAAWlE,cAAc,GAAGiE,OAAOjE,cAAc,EAC5EqE,qBACAV,MAAMvE,QAAQ,CAACkF,SAAS;IAE5B;IAEA,IAAIX,MAAMtE,cAAc,EAAE;QACxBsE,MAAMtE,cAAc,CAACiF,SAAS,GAAG1F,aAC/BK,qBAAqBI,cAAc,EACnC0E,kBAAkB,SAASG,WAAW7E,cAAc,GAAG4E,OAAO5E,cAAc,EAC5E0E,kBAAkB,UAAUD,aAAaI,WAAWzC,qBAAqB,EACzEsC,kBAAkB,UAAU,CAACD,aAAaF,qBAAqBM,WAAWxC,6BAA6B,EACvGqC,kBAAkB,UAAU1D,YAAY6D,WAAWtC,sBAAsB,EACzE+B,MAAMtE,cAAc,CAACiF,SAAS;IAElC;IAEA,8BAA8B;IAC9BzF,yBAAyB;QAAE,GAAG8E,KAAK;QAAEa,YAAY;YAAE,GAAGb,MAAMa,UAAU;YAAEC,MAAM;QAAO;QAAGC,UAAU;IAAM;IAExG,OAAOf;AACT,EAAE"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { makeStyles, mergeClasses, useButtonStyles_unstable, createCustomFocusIndicatorStyle, shorthands } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const sendButtonClassNames = {
|
|
4
|
+
root: 'fai-SendButton',
|
|
5
|
+
sendIcon: 'fai-SendButton__sendIcon',
|
|
6
|
+
stopIcon: 'fai-SendButton__stopIcon',
|
|
7
|
+
stopBackground: 'fai-SendButton__stopBackground',
|
|
8
|
+
sendButtonMotion: 'fai-SendButton__sendButtonMotion',
|
|
9
|
+
stopButtonMotion: 'fai-SendButton__stopButtonMotion',
|
|
10
|
+
stopBackgroundMotion: 'fai-SendButton__stopBackgroundMotion'
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Styles for the root slot
|
|
14
|
+
*/ const useStyles = makeStyles({
|
|
15
|
+
root: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
width: '32px',
|
|
18
|
+
minWidth: '32px',
|
|
19
|
+
height: '32px',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
padding: '0'
|
|
22
|
+
},
|
|
23
|
+
baseIconButton: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
display: 'inline-flex',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
fontSize: tokens.fontSizeBase500,
|
|
29
|
+
height: '20px',
|
|
30
|
+
width: '20px'
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
color: tokens.colorNeutralForegroundDisabled
|
|
34
|
+
},
|
|
35
|
+
iconFilled: {
|
|
36
|
+
color: tokens.colorCompoundBrandBackground,
|
|
37
|
+
':hover': {
|
|
38
|
+
color: tokens.colorCompoundBrandBackgroundHover
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
stopBackground: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
width: 'inherit',
|
|
44
|
+
height: 'inherit',
|
|
45
|
+
borderRadius: tokens.borderRadiusCircular,
|
|
46
|
+
/** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/ backgroundColor: tokens.colorBrandBackground2
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const useNextStyles = makeStyles({
|
|
50
|
+
baseIconButton: {
|
|
51
|
+
display: 'inline-flex',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
gridArea: 'button',
|
|
54
|
+
position: 'initial',
|
|
55
|
+
zIndex: 1,
|
|
56
|
+
color: tokens.colorNeutralForegroundOnBrand,
|
|
57
|
+
'@media (forced-colors: active)': {
|
|
58
|
+
color: 'HighlightText'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
dictationActive: {
|
|
62
|
+
color: tokens.colorNeutralForeground2
|
|
63
|
+
},
|
|
64
|
+
sendIconFilled: {
|
|
65
|
+
color: tokens.colorNeutralForegroundOnBrand
|
|
66
|
+
},
|
|
67
|
+
stopIconFilled: {
|
|
68
|
+
color: tokens.colorBrandForeground2
|
|
69
|
+
},
|
|
70
|
+
stopBackground: {
|
|
71
|
+
gridArea: 'button',
|
|
72
|
+
height: '100%',
|
|
73
|
+
width: '100%',
|
|
74
|
+
borderRadius: tokens.borderRadiusCircular,
|
|
75
|
+
backgroundColor: tokens.colorBrandBackground
|
|
76
|
+
},
|
|
77
|
+
stopBackgroundSending: {
|
|
78
|
+
backgroundColor: tokens.colorBrandBackground2
|
|
79
|
+
},
|
|
80
|
+
stopBackgroundDictationActive: {
|
|
81
|
+
backgroundColor: tokens.colorTransparentBackground
|
|
82
|
+
},
|
|
83
|
+
disabled: {
|
|
84
|
+
color: tokens.colorNeutralForegroundDisabled
|
|
85
|
+
},
|
|
86
|
+
stopBackgroundDisabled: {
|
|
87
|
+
backgroundColor: tokens.colorNeutralBackgroundDisabled
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const useRootNextStyles = makeStyles({
|
|
91
|
+
root: {
|
|
92
|
+
display: 'grid',
|
|
93
|
+
gridTemplateAreas: `"button"`,
|
|
94
|
+
gridTemplateRows: '1fr',
|
|
95
|
+
gridTemplateColumns: '1fr',
|
|
96
|
+
justifyItems: 'center',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
padding: tokens.spacingVerticalNone,
|
|
99
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,
|
|
100
|
+
position: 'relative',
|
|
101
|
+
...createCustomFocusIndicatorStyle({
|
|
102
|
+
outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke} inset`,
|
|
103
|
+
boxShadow: `0 0 0 ${tokens.strokeWidthThin} ${tokens.colorStrokeFocus2}`
|
|
104
|
+
}),
|
|
105
|
+
'@media (forced-colors: active)': {
|
|
106
|
+
...shorthands.borderColor('Highlight'),
|
|
107
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
108
|
+
backgroundColor: 'Highlight'
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
canvas: {
|
|
113
|
+
minWidth: '40px',
|
|
114
|
+
height: '40px'
|
|
115
|
+
},
|
|
116
|
+
sidecar: {
|
|
117
|
+
minWidth: '32px',
|
|
118
|
+
height: '32px'
|
|
119
|
+
},
|
|
120
|
+
notSending: {
|
|
121
|
+
':hover': {
|
|
122
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
123
|
+
backgroundColor: tokens.colorBrandBackgroundHover,
|
|
124
|
+
'@media (forced-colors: active)': {
|
|
125
|
+
backgroundColor: 'HighlightText'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
[`& .${sendButtonClassNames.sendIcon}, & .${sendButtonClassNames.stopIcon}`]: {
|
|
129
|
+
color: tokens.colorNeutralForegroundOnBrand,
|
|
130
|
+
'@media (forced-colors: active)': {
|
|
131
|
+
color: 'Highlight'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
':active': {
|
|
136
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
137
|
+
backgroundColor: tokens.colorBrandBackgroundPressed
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
notSendingDictationActive: {
|
|
142
|
+
':hover': {
|
|
143
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
144
|
+
backgroundColor: tokens.colorSubtleBackgroundHover,
|
|
145
|
+
'@media (forced-colors: active)': {
|
|
146
|
+
backgroundColor: 'HighlightText'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
150
|
+
color: tokens.colorNeutralForeground2Hover,
|
|
151
|
+
'@media (forced-colors: active)': {
|
|
152
|
+
color: 'Highlight'
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
':active': {
|
|
157
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
158
|
+
backgroundColor: tokens.colorSubtleBackgroundPressed
|
|
159
|
+
},
|
|
160
|
+
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
161
|
+
color: tokens.colorNeutralForeground2Pressed
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
sending: {
|
|
166
|
+
':hover': {
|
|
167
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
168
|
+
backgroundColor: tokens.colorBrandBackground2Hover,
|
|
169
|
+
'@media (forced-colors: active)': {
|
|
170
|
+
backgroundColor: 'HighlightText'
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
[`& .${sendButtonClassNames.stopIcon}`]: {
|
|
174
|
+
color: tokens.colorBrandForeground2Hover,
|
|
175
|
+
'@media (forced-colors: active)': {
|
|
176
|
+
color: 'Highlight'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
':active': {
|
|
181
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
182
|
+
backgroundColor: tokens.colorBrandBackground2Pressed
|
|
183
|
+
},
|
|
184
|
+
[`& .${sendButtonClassNames.stopIcon}`]: {
|
|
185
|
+
color: tokens.colorBrandForeground2Pressed
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* Apply styling to the SendButton slots based on the state
|
|
192
|
+
*/ export const useSendButtonStyles_unstable = (state)=>{
|
|
193
|
+
'use no memo';
|
|
194
|
+
const { isDictationActive, isSendIconFilled, isSending, disabled, designVersion, mode } = state;
|
|
195
|
+
const styles = useStyles();
|
|
196
|
+
const nextStyles = useNextStyles();
|
|
197
|
+
const rootNextStyles = useRootNextStyles();
|
|
198
|
+
const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;
|
|
199
|
+
const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;
|
|
200
|
+
state.root.className = mergeClasses(sendButtonClassNames.root, designVersion === 'next' ? rootNextStyles.root : styles.root, isSendIconFilled && sendIconFilledStyle, (state.isButtonMotionRunning || isSending) && sendIconFilledStyle, designVersion === 'next' && rootNextStyles[mode], designVersion === 'next' && rootNextStyles.root, !disabled && designVersion === 'next' && !isSending && (isDictationActive ? rootNextStyles.notSendingDictationActive : rootNextStyles.notSending), !disabled && designVersion === 'next' && isSending && rootNextStyles.sending, disabled && styles.disabled, state.root.className);
|
|
201
|
+
if (state.sendIcon) {
|
|
202
|
+
state.sendIcon.className = mergeClasses(sendButtonClassNames.sendIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, !disabled && designVersion === 'next' && !isSending && isDictationActive && nextStyles.dictationActive, disabled && designVersion === 'next' && nextStyles.disabled, state.sendIcon.className);
|
|
203
|
+
}
|
|
204
|
+
if (state.stopIcon) {
|
|
205
|
+
state.stopIcon.className = mergeClasses(sendButtonClassNames.stopIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, stopIconFilledStyle, state.stopIcon.className);
|
|
206
|
+
}
|
|
207
|
+
if (state.stopBackground) {
|
|
208
|
+
state.stopBackground.className = mergeClasses(sendButtonClassNames.stopBackground, designVersion === 'next' ? nextStyles.stopBackground : styles.stopBackground, designVersion === 'next' && isSending && nextStyles.stopBackgroundSending, designVersion === 'next' && !isSending && isDictationActive && nextStyles.stopBackgroundDictationActive, designVersion === 'next' && disabled && nextStyles.stopBackgroundDisabled, state.stopBackground.className);
|
|
209
|
+
}
|
|
210
|
+
// Add style hooks from button
|
|
211
|
+
useButtonStyles_unstable({
|
|
212
|
+
...state,
|
|
213
|
+
components: {
|
|
214
|
+
...state.components,
|
|
215
|
+
icon: 'span'
|
|
216
|
+
},
|
|
217
|
+
iconOnly: false
|
|
218
|
+
});
|
|
219
|
+
return state;
|
|
220
|
+
};
|