@fluentui-copilot/react-send-button 0.0.4-hotfix.1 → 0.0.4-hotfix.2
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 +4 -4
- package/CHANGELOG.md +5 -5
- package/lib/SendButton.js +1 -0
- package/lib/components/SendButton/SendButton.js +5 -4
- package/lib/components/SendButton/SendButton.types.js +2 -1
- package/lib/components/SendButton/buttonMotion.js +138 -199
- package/lib/components/SendButton/index.js +1 -0
- package/lib/components/SendButton/renderSendButton.js +30 -38
- package/lib/components/SendButton/useSendButton.js +97 -95
- package/lib/components/SendButton/useSendButtonStyles.styles.raw.js +187 -176
- package/lib/index.js +1 -0
- package/lib-commonjs/SendButton.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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.raw.js +1 -1
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/package.json +4 -4
|
@@ -13,99 +13,101 @@ 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
|
-
|
|
16
|
+
*/
|
|
17
|
+
export const useSendButton_unstable = (props, ref) => {
|
|
18
|
+
/** Used to apply/remove styles when button is animating */const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);
|
|
19
|
+
const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);
|
|
20
|
+
const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;
|
|
21
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
22
|
+
const mode = useCopilotMode(props.mode);
|
|
23
|
+
const [visible, setVisible] = React.useState(false);
|
|
24
|
+
const mountRef = React.useCallback(elem => {
|
|
25
|
+
if (elem) {
|
|
26
|
+
setVisible(true);
|
|
27
|
+
} else {
|
|
28
|
+
setVisible(false);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const finalRef = useMergedRefs(ref, mountRef);
|
|
32
|
+
const buttonState = useButton_unstable({
|
|
33
|
+
shape: designVersion === 'next' ? 'circular' : undefined,
|
|
34
|
+
...props,
|
|
35
|
+
appearance: 'transparent',
|
|
36
|
+
'aria-disabled': props.disabled ? true : undefined,
|
|
37
|
+
type: 'submit'
|
|
38
|
+
}, finalRef);
|
|
39
|
+
const icon = (() => {
|
|
40
|
+
if (designVersion === 'next') {
|
|
41
|
+
return mode === 'canvas' ? /*#__PURE__*/React.createElement(ArrowRight24Filled, null) : /*#__PURE__*/React.createElement(ArrowRight20Filled, null);
|
|
42
|
+
} else {
|
|
43
|
+
if (props.isSendIconFilled || isButtonMotionRunning) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(SendFilled, null);
|
|
45
|
+
} else {
|
|
46
|
+
return /*#__PURE__*/React.createElement(SendIcon, null);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
var _props_isDictationActive;
|
|
51
|
+
const state = {
|
|
52
|
+
...buttonState,
|
|
53
|
+
components: {
|
|
54
|
+
root: 'button',
|
|
55
|
+
sendIcon: 'span',
|
|
56
|
+
stopIcon: 'span',
|
|
57
|
+
stopBackground: 'div',
|
|
58
|
+
sendButtonMotion: SendButtonMotion,
|
|
59
|
+
stopButtonMotion: StopButtonMotion,
|
|
60
|
+
stopBackgroundMotion: CircleButtonMotion
|
|
61
|
+
},
|
|
62
|
+
root: buttonState.root,
|
|
63
|
+
sendIcon: slot.always(props.sendIcon, {
|
|
64
|
+
elementType: 'span',
|
|
65
|
+
defaultProps: {
|
|
66
|
+
children: icon
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
stopIcon: slot.optional(props.stopIcon, {
|
|
70
|
+
elementType: 'span',
|
|
71
|
+
defaultProps: {
|
|
72
|
+
children: designVersion === 'next' ? mode === 'canvas' ? /*#__PURE__*/React.createElement(Stop20Filled, null) : /*#__PURE__*/React.createElement(Stop16Filled, null) : /*#__PURE__*/React.createElement(Stop16Filled, null)
|
|
73
|
+
},
|
|
74
|
+
renderByDefault: true
|
|
75
|
+
}),
|
|
76
|
+
stopBackground: slot.always(props.stopBackground, {
|
|
77
|
+
elementType: 'div'
|
|
78
|
+
}),
|
|
79
|
+
sendButtonMotion: presenceMotionSlot(props.sendButtonMotion, {
|
|
80
|
+
elementType: SendButtonMotion,
|
|
81
|
+
defaultProps: {
|
|
82
|
+
visible: !props.isSending,
|
|
83
|
+
unmountOnExit: true,
|
|
84
|
+
onMotionFinish: () => setIsSendMotionRunning(false),
|
|
85
|
+
onMotionStart: () => setIsSendMotionRunning(true)
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
stopButtonMotion: presenceMotionSlot(props.stopButtonMotion, {
|
|
89
|
+
elementType: StopButtonMotion,
|
|
90
|
+
defaultProps: {
|
|
91
|
+
visible: props.isSending,
|
|
92
|
+
unmountOnExit: true,
|
|
93
|
+
onMotionFinish: () => setIsStopMotionRunning(false),
|
|
94
|
+
onMotionStart: () => setIsStopMotionRunning(true)
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
stopBackgroundMotion: presenceMotionSlot(props.stopBackgroundMotion, {
|
|
98
|
+
elementType: CircleButtonMotion,
|
|
99
|
+
defaultProps: {
|
|
100
|
+
visible: designVersion === 'next' ? visible : props.isSending,
|
|
101
|
+
unmountOnExit: true
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
isButtonMotionRunning,
|
|
105
|
+
isDictationActive: (_props_isDictationActive = props.isDictationActive) !== null && _props_isDictationActive !== void 0 ? _props_isDictationActive : false,
|
|
106
|
+
isSendIconFilled: props.isSendIconFilled,
|
|
107
|
+
isSending: props.isSending,
|
|
108
|
+
designVersion,
|
|
109
|
+
mode
|
|
110
|
+
};
|
|
111
|
+
return state;
|
|
111
112
|
};
|
|
113
|
+
//# sourceMappingURL=useSendButton.js.map
|
|
@@ -1,193 +1,204 @@
|
|
|
1
1
|
import { makeStyles, mergeClasses, useButtonStyles_unstable, createCustomFocusIndicatorStyle } from '@fluentui/react-components';
|
|
2
2
|
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
3
|
export const sendButtonClassNames = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Styles for the root slot
|
|
14
|
-
*/
|
|
15
|
-
|
|
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
|
-
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
|
|
14
|
+
*/
|
|
15
|
+
const useStyles = makeStyles({
|
|
16
|
+
root: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
width: '32px',
|
|
19
|
+
minWidth: '32px',
|
|
20
|
+
height: '32px',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
padding: '0'
|
|
23
|
+
},
|
|
24
|
+
baseIconButton: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
display: 'inline-flex',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
fontSize: tokens.fontSizeBase500,
|
|
30
|
+
height: '20px',
|
|
31
|
+
width: '20px'
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
color: tokens.colorNeutralForegroundDisabled
|
|
35
|
+
},
|
|
36
|
+
iconFilled: {
|
|
37
|
+
color: tokens.colorCompoundBrandBackground,
|
|
38
|
+
':hover': {
|
|
39
|
+
color: tokens.colorCompoundBrandBackgroundHover
|
|
47
40
|
}
|
|
41
|
+
},
|
|
42
|
+
stopBackground: {
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
width: 'inherit',
|
|
45
|
+
height: 'inherit',
|
|
46
|
+
borderRadius: tokens.borderRadiusCircular,
|
|
47
|
+
/** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/backgroundColor: tokens.colorBrandBackground2
|
|
48
|
+
}
|
|
48
49
|
});
|
|
49
50
|
const useNextStyles = makeStyles({
|
|
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
|
-
|
|
51
|
+
baseIconButton: {
|
|
52
|
+
display: 'inline-flex',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
gridArea: 'button',
|
|
55
|
+
position: 'initial',
|
|
56
|
+
zIndex: 1,
|
|
57
|
+
color: tokens.colorNeutralForegroundOnBrand
|
|
58
|
+
},
|
|
59
|
+
dictationActive: {
|
|
60
|
+
color: tokens.colorNeutralForeground2
|
|
61
|
+
},
|
|
62
|
+
sendIconFilled: {
|
|
63
|
+
color: tokens.colorNeutralForegroundOnBrand
|
|
64
|
+
},
|
|
65
|
+
stopIconFilled: {
|
|
66
|
+
color: tokens.colorBrandForeground2
|
|
67
|
+
},
|
|
68
|
+
stopBackground: {
|
|
69
|
+
gridArea: 'button',
|
|
70
|
+
height: '100%',
|
|
71
|
+
width: '100%',
|
|
72
|
+
borderRadius: tokens.borderRadiusCircular,
|
|
73
|
+
backgroundColor: tokens.colorBrandBackground
|
|
74
|
+
},
|
|
75
|
+
stopBackgroundSending: {
|
|
76
|
+
backgroundColor: tokens.colorBrandBackground2
|
|
77
|
+
},
|
|
78
|
+
stopBackgroundDictationActive: {
|
|
79
|
+
backgroundColor: tokens.colorTransparentBackground
|
|
80
|
+
},
|
|
81
|
+
disabled: {
|
|
82
|
+
color: tokens.colorNeutralForegroundDisabled
|
|
83
|
+
},
|
|
84
|
+
stopBackgroundDisabled: {
|
|
85
|
+
backgroundColor: tokens.colorNeutralBackgroundDisabled
|
|
86
|
+
}
|
|
86
87
|
});
|
|
87
88
|
const useRootNextStyles = makeStyles({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
':active': {
|
|
121
|
-
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
122
|
-
backgroundColor: tokens.colorBrandBackgroundPressed
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
notSendingDictationActive: {
|
|
127
|
-
':hover': {
|
|
128
|
-
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
129
|
-
backgroundColor: tokens.colorSubtleBackgroundHover
|
|
130
|
-
},
|
|
131
|
-
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
132
|
-
color: tokens.colorNeutralForeground2Hover
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
':active': {
|
|
136
|
-
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
137
|
-
backgroundColor: tokens.colorSubtleBackgroundPressed
|
|
138
|
-
},
|
|
139
|
-
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
140
|
-
color: tokens.colorNeutralForeground2Pressed
|
|
141
|
-
}
|
|
142
|
-
}
|
|
89
|
+
root: {
|
|
90
|
+
display: 'grid',
|
|
91
|
+
gridTemplateAreas: `"button"`,
|
|
92
|
+
gridTemplateRows: '1fr',
|
|
93
|
+
gridTemplateColumns: '1fr',
|
|
94
|
+
justifyItems: 'center',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
padding: tokens.spacingVerticalNone,
|
|
97
|
+
border: 'none',
|
|
98
|
+
position: 'relative',
|
|
99
|
+
...createCustomFocusIndicatorStyle({
|
|
100
|
+
outline: `${tokens.strokeWidthThick} solid ${tokens.colorTransparentStroke}`,
|
|
101
|
+
boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}`
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
canvas: {
|
|
105
|
+
minWidth: '40px',
|
|
106
|
+
height: '40px'
|
|
107
|
+
},
|
|
108
|
+
sidecar: {
|
|
109
|
+
minWidth: '32px',
|
|
110
|
+
height: '32px'
|
|
111
|
+
},
|
|
112
|
+
notSending: {
|
|
113
|
+
':hover': {
|
|
114
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
115
|
+
backgroundColor: tokens.colorBrandBackgroundHover
|
|
116
|
+
},
|
|
117
|
+
[`& .${sendButtonClassNames.sendIcon},.${sendButtonClassNames.stopIcon}`]: {
|
|
118
|
+
color: tokens.colorNeutralForegroundOnBrand
|
|
119
|
+
}
|
|
143
120
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
121
|
+
':active': {
|
|
122
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
123
|
+
backgroundColor: tokens.colorBrandBackgroundPressed
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
notSendingDictationActive: {
|
|
128
|
+
':hover': {
|
|
129
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
130
|
+
backgroundColor: tokens.colorSubtleBackgroundHover
|
|
131
|
+
},
|
|
132
|
+
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
133
|
+
color: tokens.colorNeutralForeground2Hover
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
':active': {
|
|
137
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
138
|
+
backgroundColor: tokens.colorSubtleBackgroundPressed
|
|
139
|
+
},
|
|
140
|
+
[`& .${sendButtonClassNames.sendIcon}`]: {
|
|
141
|
+
color: tokens.colorNeutralForeground2Pressed
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
sending: {
|
|
146
|
+
':hover': {
|
|
147
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
148
|
+
backgroundColor: tokens.colorBrandBackground2Hover
|
|
149
|
+
},
|
|
150
|
+
[`& .${sendButtonClassNames.stopIcon}`]: {
|
|
151
|
+
color: tokens.colorBrandForeground2Hover
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
':active': {
|
|
155
|
+
[`& .${sendButtonClassNames.stopBackground}`]: {
|
|
156
|
+
backgroundColor: tokens.colorBrandBackground2Pressed
|
|
157
|
+
},
|
|
158
|
+
[`& .${sendButtonClassNames.stopIcon}`]: {
|
|
159
|
+
color: tokens.colorBrandForeground2Pressed
|
|
160
|
+
}
|
|
161
161
|
}
|
|
162
|
+
}
|
|
162
163
|
});
|
|
163
164
|
/**
|
|
164
165
|
* Apply styling to the SendButton slots based on the state
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
166
|
+
*/
|
|
167
|
+
export const useSendButtonStyles_unstable = state => {
|
|
168
|
+
'use no memo';
|
|
169
|
+
|
|
170
|
+
const {
|
|
171
|
+
isDictationActive,
|
|
172
|
+
isSendIconFilled,
|
|
173
|
+
isSending,
|
|
174
|
+
disabled,
|
|
175
|
+
designVersion,
|
|
176
|
+
mode
|
|
177
|
+
} = state;
|
|
178
|
+
const styles = useStyles();
|
|
179
|
+
const nextStyles = useNextStyles();
|
|
180
|
+
const rootNextStyles = useRootNextStyles();
|
|
181
|
+
const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;
|
|
182
|
+
const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;
|
|
183
|
+
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);
|
|
184
|
+
if (state.sendIcon) {
|
|
185
|
+
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);
|
|
186
|
+
}
|
|
187
|
+
if (state.stopIcon) {
|
|
188
|
+
state.stopIcon.className = mergeClasses(sendButtonClassNames.stopIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, stopIconFilledStyle, state.stopIcon.className);
|
|
189
|
+
}
|
|
190
|
+
if (state.stopBackground) {
|
|
191
|
+
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);
|
|
192
|
+
}
|
|
193
|
+
// Add style hooks from button
|
|
194
|
+
useButtonStyles_unstable({
|
|
195
|
+
...state,
|
|
196
|
+
components: {
|
|
197
|
+
...state.components,
|
|
198
|
+
icon: 'span'
|
|
199
|
+
},
|
|
200
|
+
iconOnly: false
|
|
201
|
+
});
|
|
202
|
+
return state;
|
|
193
203
|
};
|
|
204
|
+
//# sourceMappingURL=useSendButtonStyles.styles.raw.js.map
|
package/lib/index.js
CHANGED
|
@@ -18,4 +18,4 @@ const SendButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
18
18
|
(0, _useSendButtonStylesstyles.useSendButtonStyles_unstable)(state);
|
|
19
19
|
return (0, _renderSendButton.renderSendButton_unstable)(state);
|
|
20
20
|
});
|
|
21
|
-
SendButton.displayName = 'SendButton';
|
|
21
|
+
SendButton.displayName = 'SendButton'; //# sourceMappingURL=SendButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSendButton_unstable } from './useSendButton';\nimport { renderSendButton_unstable } from './renderSendButton';\nimport { useSendButtonStyles_unstable } from './useSendButtonStyles.styles';\nimport type { SendButtonProps } from './SendButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// SendButton component - TODO: add more docs\nexport const SendButton: ForwardRefComponent<SendButtonProps> = React.forwardRef((props, ref) => {\n const state = useSendButton_unstable(props, ref);\n\n useSendButtonStyles_unstable(state);\n return renderSendButton_unstable(state);\n});\n\nSendButton.displayName = 'SendButton';\n"],"names":["SendButton","React","forwardRef","props","
|
|
1
|
+
{"version":3,"sources":["SendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSendButton_unstable } from './useSendButton';\nimport { renderSendButton_unstable } from './renderSendButton';\nimport { useSendButtonStyles_unstable } from './useSendButtonStyles.styles';\nimport type { SendButtonProps } from './SendButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// SendButton component - TODO: add more docs\nexport const SendButton: ForwardRefComponent<SendButtonProps> = React.forwardRef((props, ref) => {\n const state = useSendButton_unstable(props, ref);\n\n useSendButtonStyles_unstable(state);\n return renderSendButton_unstable(state);\n});\n\nSendButton.displayName = 'SendButton';\n"],"names":["SendButton","React","forwardRef","props","state","useSendButton_unstable","useSendButtonStyles_unstable","renderSendButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;+BACgB;kCACG;2CACG;AAKtC,MAAMA,aAAAA,WAAAA,GAAAA,OAAmDC,UAAMC,CAAU,CAACC,OAACA;UAChFC,QAAMA,IAAAA,qCAAQC,EAAAA,OAAuBF;+DAErCG,EAAAA;WACAC,IAAAA,2CAAOA,EAAAA;AACT;AAEAP,WAAWQ,WAAW,GAAG"}
|
|
@@ -230,4 +230,4 @@ const circleMotion = ()=>{
|
|
|
230
230
|
};
|
|
231
231
|
const SendButtonMotion = (0, _reactcomponents.createPresenceComponent)(sendMotion);
|
|
232
232
|
const StopButtonMotion = (0, _reactcomponents.createPresenceComponent)(stopMotion);
|
|
233
|
-
const CircleButtonMotion = (0, _reactcomponents.createPresenceComponent)(circleMotion);
|
|
233
|
+
const CircleButtonMotion = (0, _reactcomponents.createPresenceComponent)(circleMotion); //# sourceMappingURL=buttonMotion.js.map
|