@fluentui-copilot/react-send-button 0.0.0-nightly-20250416-0405-24e1479b.1 → 0.0.0-nightly-20250418-0405-0b1ae88d.1
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 +3 -3
- package/CHANGELOG.md +3 -3
- package/dist/index.d.ts +2 -1
- package/lib/components/SendButton/SendButton.types.js.map +1 -1
- package/lib/components/SendButton/useSendButton.js +2 -0
- package/lib/components/SendButton/useSendButton.js.map +1 -1
- package/lib/components/SendButton/useSendButtonStyles.styles.js +39 -17
- package/lib/components/SendButton/useSendButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SendButton/SendButton.types.js.map +1 -1
- package/lib-commonjs/components/SendButton/useSendButton.js +2 -0
- package/lib-commonjs/components/SendButton/useSendButton.js.map +1 -1
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.js +50 -19
- package/lib-commonjs/components/SendButton/useSendButtonStyles.styles.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-send-button",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui-copilot/react-send-button_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Fri, 18 Apr 2025 04:13:08 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-send-button_v0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
7
|
+
"version": "0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-send-button
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 18 Apr 2025 04:13:08 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20250418-0405-0b1ae88d.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-send-button_v0.0.0-nightly-20250418-0405-0b1ae88d.1)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fri, 18 Apr 2025 04:13:08 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare type SendButtonProps = ComponentProps<Partial<SendButtonSlots>> &
|
|
|
29
29
|
*/
|
|
30
30
|
isSending?: boolean;
|
|
31
31
|
isSendIconFilled?: boolean;
|
|
32
|
+
isDictationActive?: boolean;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
export declare type SendButtonSlots = {
|
|
@@ -45,7 +46,7 @@ export declare type SendButtonSlots = {
|
|
|
45
46
|
/**
|
|
46
47
|
* State used in rendering SendButton
|
|
47
48
|
*/
|
|
48
|
-
export declare type SendButtonState = ComponentState<SendButtonSlots> & Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> & Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> & Pick<Required<SendButtonProps>, 'designVersion' | 'mode'> & {
|
|
49
|
+
export declare type SendButtonState = ComponentState<SendButtonSlots> & Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> & Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> & Pick<Required<SendButtonProps>, 'designVersion' | 'mode' | 'isDictationActive'> & {
|
|
49
50
|
isButtonMotionRunning?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SendButton.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ButtonProps, ButtonState, ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nexport type SendButtonSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n sendIcon: NonNullable<Slot<'span'>>;\n stopIcon?: Slot<'span'>;\n /** Stop button's circle background */\n stopBackground: NonNullable<Slot<'div'>>;\n sendButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopBackgroundMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\n/**\n * SendButton Props\n */\nexport type SendButtonProps = ComponentProps<Partial<SendButtonSlots>> &\n Pick<ButtonProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n DesignVersion &\n CopilotMode & {\n /**\n * Checks whether query is sending.\n */\n isSending?: boolean;\n isSendIconFilled?: boolean;\n };\n\n/**\n * State used in rendering SendButton\n */\nexport type SendButtonState = ComponentState<SendButtonSlots> &\n Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> &\n Pick<Required<SendButtonProps>, 'designVersion' | 'mode'> & {\n isButtonMotionRunning?: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"
|
|
1
|
+
{"version":3,"sources":["SendButton.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ButtonProps, ButtonState, ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nexport type SendButtonSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n sendIcon: NonNullable<Slot<'span'>>;\n stopIcon?: Slot<'span'>;\n /** Stop button's circle background */\n stopBackground: NonNullable<Slot<'div'>>;\n sendButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopBackgroundMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\n/**\n * SendButton Props\n */\nexport type SendButtonProps = ComponentProps<Partial<SendButtonSlots>> &\n Pick<ButtonProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n DesignVersion &\n CopilotMode & {\n /**\n * Checks whether query is sending.\n */\n isSending?: boolean;\n isSendIconFilled?: boolean;\n\n /*\n * Use alternate styles when dictation is active\n */\n isDictationActive?: boolean;\n };\n\n/**\n * State used in rendering SendButton\n */\nexport type SendButtonState = ComponentState<SendButtonSlots> &\n Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> &\n Pick<Required<SendButtonProps>, 'designVersion' | 'mode' | 'isDictationActive'> & {\n isButtonMotionRunning?: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAkCA;;CAEC,GACD,WAKI"}
|
|
@@ -53,6 +53,7 @@ export const useSendButton_unstable = (props, ref) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
})();
|
|
56
|
+
var _props_isDictationActive;
|
|
56
57
|
const state = {
|
|
57
58
|
...buttonState,
|
|
58
59
|
components: {
|
|
@@ -107,6 +108,7 @@ export const useSendButton_unstable = (props, ref) => {
|
|
|
107
108
|
}
|
|
108
109
|
}),
|
|
109
110
|
isButtonMotionRunning,
|
|
111
|
+
isDictationActive: (_props_isDictationActive = props.isDictationActive) !== null && _props_isDictationActive !== void 0 ? _props_isDictationActive : false,
|
|
110
112
|
isSendIconFilled: props.isSendIconFilled,
|
|
111
113
|
isSending: props.isSending,
|
|
112
114
|
designVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ButtonProps } from '@fluentui/react-components';\nimport { slot, useButton_unstable, useMergedRefs } from '@fluentui/react-components';\nimport type { SendButtonProps, SendButtonState } from './SendButton.types';\n\nimport { CircleButtonMotion, SendButtonMotion, StopButtonMotion } from './buttonMotion';\nimport {\n bundleIcon,\n SendFilled,\n SendRegular,\n Stop16Filled,\n Stop24Filled,\n ArrowRight24Filled,\n ArrowRight24Regular,\n Stop20Filled,\n ArrowRight20Regular,\n ArrowRight20Filled,\n} from '@fluentui/react-icons';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\nconst SendIcon = bundleIcon(SendFilled, SendRegular);\nconst SendIconV2Canvas = bundleIcon(ArrowRight24Filled, ArrowRight24Regular);\nconst SendIconV2Sidecar = bundleIcon(ArrowRight20Filled, ArrowRight20Regular);\n\n/**\n * Create the state required to render SendButton.\n *\n * The returned state can be modified with hooks such as useSendButtonStyles_unstable,\n * before being passed to renderSendButton_unstable.\n *\n * @param props - props from this instance of SendButton\n * @param ref - reference to root HTMLElement of SendButton\n */\nexport const useSendButton_unstable = (\n props: SendButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SendButtonState => {\n /** Used to apply/remove styles when button is animating */\n const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);\n const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);\n const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const [visible, setVisible] = React.useState(false);\n const mountRef = React.useCallback((elem: HTMLElement | null) => {\n if (elem) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n }, []);\n const finalRef = useMergedRefs(ref, mountRef);\n const buttonState = useButton_unstable(\n {\n shape: designVersion === 'next' ? 'circular' : undefined,\n ...(props as ButtonProps),\n appearance: 'transparent',\n 'aria-disabled': props.disabled ? true : undefined,\n type: 'submit',\n },\n finalRef,\n );\n\n const icon = (() => {\n if (designVersion === 'next') {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return mode === 'canvas' ? <ArrowRight24Filled /> : <ArrowRight20Regular />;\n } else {\n return mode === 'canvas' ? <SendIconV2Canvas /> : <SendIconV2Sidecar />;\n }\n } else {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return <SendFilled />;\n } else {\n return <SendIcon />;\n }\n }\n })();\n\n const state: SendButtonState = {\n ...buttonState,\n components: {\n root: 'button',\n sendIcon: 'span',\n stopIcon: 'span',\n stopBackground: 'div',\n sendButtonMotion: SendButtonMotion as React.ComponentType,\n stopButtonMotion: StopButtonMotion as React.ComponentType,\n stopBackgroundMotion: CircleButtonMotion as React.ComponentType,\n },\n root: buttonState.root,\n sendIcon: slot.always(props.sendIcon, {\n elementType: 'span',\n defaultProps: {\n children: icon,\n },\n }),\n stopIcon: slot.optional(props.stopIcon, {\n elementType: 'span',\n defaultProps: {\n children: designVersion === 'next' ? mode === 'canvas' ? <Stop24Filled /> : <Stop20Filled /> : <Stop16Filled />,\n },\n renderByDefault: true,\n }),\n stopBackground: slot.always(props.stopBackground, { elementType: 'div' }),\n sendButtonMotion: presenceMotionSlot<{}>(props.sendButtonMotion, {\n elementType: SendButtonMotion,\n defaultProps: {\n visible: !props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsSendMotionRunning(false),\n onMotionStart: () => setIsSendMotionRunning(true),\n },\n }),\n stopButtonMotion: presenceMotionSlot<{}>(props.stopButtonMotion, {\n elementType: StopButtonMotion,\n defaultProps: {\n visible: props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsStopMotionRunning(false),\n onMotionStart: () => setIsStopMotionRunning(true),\n },\n }),\n stopBackgroundMotion: presenceMotionSlot<{}>(props.stopBackgroundMotion, {\n elementType: CircleButtonMotion,\n defaultProps: {\n visible: designVersion === 'next' ? visible : props.isSending,\n unmountOnExit: true,\n },\n }),\n isButtonMotionRunning,\n isSendIconFilled: props.isSendIconFilled,\n isSending: props.isSending,\n designVersion,\n mode,\n };\n\n return state;\n};\n"],"names":["React","slot","useButton_unstable","useMergedRefs","CircleButtonMotion","SendButtonMotion","StopButtonMotion","bundleIcon","SendFilled","SendRegular","Stop16Filled","Stop24Filled","ArrowRight24Filled","ArrowRight24Regular","Stop20Filled","ArrowRight20Regular","ArrowRight20Filled","presenceMotionSlot","useCopilotMode","useDesignVersion","SendIcon","SendIconV2Canvas","SendIconV2Sidecar","useSendButton_unstable","props","ref","isSendMotionRunning","setIsSendMotionRunning","useState","isStopMotionRunning","setIsStopMotionRunning","isButtonMotionRunning","designVersion","mode","visible","setVisible","mountRef","useCallback","elem","finalRef","buttonState","shape","undefined","appearance","disabled","type","icon","isSendIconFilled","state","components","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","always","elementType","defaultProps","children","optional","renderByDefault","isSending","unmountOnExit","onMotionFinish","onMotionStart"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["useSendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ButtonProps } from '@fluentui/react-components';\nimport { slot, useButton_unstable, useMergedRefs } from '@fluentui/react-components';\nimport type { SendButtonProps, SendButtonState } from './SendButton.types';\n\nimport { CircleButtonMotion, SendButtonMotion, StopButtonMotion } from './buttonMotion';\nimport {\n bundleIcon,\n SendFilled,\n SendRegular,\n Stop16Filled,\n Stop24Filled,\n ArrowRight24Filled,\n ArrowRight24Regular,\n Stop20Filled,\n ArrowRight20Regular,\n ArrowRight20Filled,\n} from '@fluentui/react-icons';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\nconst SendIcon = bundleIcon(SendFilled, SendRegular);\nconst SendIconV2Canvas = bundleIcon(ArrowRight24Filled, ArrowRight24Regular);\nconst SendIconV2Sidecar = bundleIcon(ArrowRight20Filled, ArrowRight20Regular);\n\n/**\n * Create the state required to render SendButton.\n *\n * The returned state can be modified with hooks such as useSendButtonStyles_unstable,\n * before being passed to renderSendButton_unstable.\n *\n * @param props - props from this instance of SendButton\n * @param ref - reference to root HTMLElement of SendButton\n */\nexport const useSendButton_unstable = (\n props: SendButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SendButtonState => {\n /** Used to apply/remove styles when button is animating */\n const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);\n const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);\n const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const [visible, setVisible] = React.useState(false);\n const mountRef = React.useCallback((elem: HTMLElement | null) => {\n if (elem) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n }, []);\n const finalRef = useMergedRefs(ref, mountRef);\n const buttonState = useButton_unstable(\n {\n shape: designVersion === 'next' ? 'circular' : undefined,\n ...(props as ButtonProps),\n appearance: 'transparent',\n 'aria-disabled': props.disabled ? true : undefined,\n type: 'submit',\n },\n finalRef,\n );\n\n const icon = (() => {\n if (designVersion === 'next') {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return mode === 'canvas' ? <ArrowRight24Filled /> : <ArrowRight20Regular />;\n } else {\n return mode === 'canvas' ? <SendIconV2Canvas /> : <SendIconV2Sidecar />;\n }\n } else {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return <SendFilled />;\n } else {\n return <SendIcon />;\n }\n }\n })();\n\n const state: SendButtonState = {\n ...buttonState,\n components: {\n root: 'button',\n sendIcon: 'span',\n stopIcon: 'span',\n stopBackground: 'div',\n sendButtonMotion: SendButtonMotion as React.ComponentType,\n stopButtonMotion: StopButtonMotion as React.ComponentType,\n stopBackgroundMotion: CircleButtonMotion as React.ComponentType,\n },\n root: buttonState.root,\n sendIcon: slot.always(props.sendIcon, {\n elementType: 'span',\n defaultProps: {\n children: icon,\n },\n }),\n stopIcon: slot.optional(props.stopIcon, {\n elementType: 'span',\n defaultProps: {\n children: designVersion === 'next' ? mode === 'canvas' ? <Stop24Filled /> : <Stop20Filled /> : <Stop16Filled />,\n },\n renderByDefault: true,\n }),\n stopBackground: slot.always(props.stopBackground, { elementType: 'div' }),\n sendButtonMotion: presenceMotionSlot<{}>(props.sendButtonMotion, {\n elementType: SendButtonMotion,\n defaultProps: {\n visible: !props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsSendMotionRunning(false),\n onMotionStart: () => setIsSendMotionRunning(true),\n },\n }),\n stopButtonMotion: presenceMotionSlot<{}>(props.stopButtonMotion, {\n elementType: StopButtonMotion,\n defaultProps: {\n visible: props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsStopMotionRunning(false),\n onMotionStart: () => setIsStopMotionRunning(true),\n },\n }),\n stopBackgroundMotion: presenceMotionSlot<{}>(props.stopBackgroundMotion, {\n elementType: CircleButtonMotion,\n defaultProps: {\n visible: designVersion === 'next' ? visible : props.isSending,\n unmountOnExit: true,\n },\n }),\n isButtonMotionRunning,\n isDictationActive: props.isDictationActive ?? false,\n isSendIconFilled: props.isSendIconFilled,\n isSending: props.isSending,\n designVersion,\n mode,\n };\n\n return state;\n};\n"],"names":["React","slot","useButton_unstable","useMergedRefs","CircleButtonMotion","SendButtonMotion","StopButtonMotion","bundleIcon","SendFilled","SendRegular","Stop16Filled","Stop24Filled","ArrowRight24Filled","ArrowRight24Regular","Stop20Filled","ArrowRight20Regular","ArrowRight20Filled","presenceMotionSlot","useCopilotMode","useDesignVersion","SendIcon","SendIconV2Canvas","SendIconV2Sidecar","useSendButton_unstable","props","ref","isSendMotionRunning","setIsSendMotionRunning","useState","isStopMotionRunning","setIsStopMotionRunning","isButtonMotionRunning","designVersion","mode","visible","setVisible","mountRef","useCallback","elem","finalRef","buttonState","shape","undefined","appearance","disabled","type","icon","isSendIconFilled","state","components","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","always","elementType","defaultProps","children","optional","renderByDefault","isSending","unmountOnExit","onMotionFinish","onMotionStart","isDictationActive"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,IAAI,EAAEC,kBAAkB,EAAEC,aAAa,QAAQ,6BAA6B;AAGrF,SAASC,kBAAkB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,iBAAiB;AACxF,SACEC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,mBAAmB,EACnBC,kBAAkB,QACb,wBAAwB;AAC/B,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,mCAAmC;AAEpF,MAAMC,WAAWb,WAAWC,YAAYC;AACxC,MAAMY,mBAAmBd,WAAWK,oBAAoBC;AACxD,MAAMS,oBAAoBf,WAAWS,oBAAoBD;AAEzD;;;;;;;;CAQC,GACD,OAAO,MAAMQ,yBAAyB,CACpCC,OACAC;IAEA,yDAAyD,GACzD,MAAM,CAACC,qBAAqBC,uBAAuB,GAAG3B,MAAM4B,QAAQ,CAAC;IACrE,MAAM,CAACC,qBAAqBC,uBAAuB,GAAG9B,MAAM4B,QAAQ,CAAC;IACrE,MAAMG,wBAAwBL,uBAAuBG;IAErD,MAAMG,gBAAgBb,iBAAiBK,MAAMQ,aAAa;IAC1D,MAAMC,OAAOf,eAAeM,MAAMS,IAAI;IAEtC,MAAM,CAACC,SAASC,WAAW,GAAGnC,MAAM4B,QAAQ,CAAC;IAC7C,MAAMQ,WAA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c,EAAE;YAAEK,aAAa;QAAM;QACvEJ,kBAAkBrC,mBAAuBO,MAAM8B,gBAAgB,EAAE;YAC/DI,aAAarD;YACbsD,cAAc;gBACZzB,SAAS,CAACV,MAAMuC,SAAS;gBACzBC,eAAe;gBACfC,gBAAgB,IAAMtC,uBAAuB;gBAC7CuC,eAAe,IAAMvC,uBAAuB;YAC9C;QACF;QACA4B,kBAAkBtC,mBAAuBO,MAAM+B,gBAAgB,EAAE;YAC/DG,aAAapD;YACbqD,cAAc;gBACZzB,SAASV,MAAMuC,SAAS;gBACxBC,eAAe;gBACfC,gBAAgB,IAAMnC,uBAAuB;gBAC7CoC,eAAe,IAAMpC,uBAAuB;YAC9C;QACF;QACA0B,sBAAsBvC,mBAAuBO,MAAMgC,oBAAoB,EAAE;YACvEE,aAAatD;YACbuD,cAAc;gBACZzB,SAASF,kBAAkB,SAASE,UAAUV,MAAMuC,SAAS;gBAC7DC,eAAe;YACjB;QACF;QACAjC;QACAoC,mBAAmB3C,CAAAA,2BAAAA,MAAM2C,iBAAiB,cAAvB3C,sCAAAA,2BAA2B;QAC9CuB,kBAAkBvB,MAAMuB,gBAAgB;QACxCgB,WAAWvC,MAAMuC,SAAS;QAC1B/B;QACAC;IACF;IAEA,OAAOe;AACT,EAAE"}
|
|
@@ -70,13 +70,17 @@ const useNextStyles = __styles({
|
|
|
70
70
|
Ijaq50: 0,
|
|
71
71
|
Bq1tomu: "fwzfryc",
|
|
72
72
|
qhf8xq: "f1tmlkn4",
|
|
73
|
-
Bj3rh1h: "f19g0ac"
|
|
73
|
+
Bj3rh1h: "f19g0ac",
|
|
74
|
+
sj55zd: "f1phragk"
|
|
75
|
+
},
|
|
76
|
+
dictationActive: {
|
|
77
|
+
sj55zd: "fkfq4zb"
|
|
74
78
|
},
|
|
75
79
|
sendIconFilled: {
|
|
76
|
-
sj55zd: "
|
|
80
|
+
sj55zd: "f1phragk"
|
|
77
81
|
},
|
|
78
82
|
stopIconFilled: {
|
|
79
|
-
sj55zd: "
|
|
83
|
+
sj55zd: "faj9fo0"
|
|
80
84
|
},
|
|
81
85
|
stopBackground: {
|
|
82
86
|
Bw0ie65: 0,
|
|
@@ -91,19 +95,28 @@ const useNextStyles = __styles({
|
|
|
91
95
|
Btl43ni: 0,
|
|
92
96
|
B7oj6ja: 0,
|
|
93
97
|
Dimara: "f44lkw9",
|
|
94
|
-
De3pzq: "
|
|
98
|
+
De3pzq: "ffp7eso"
|
|
95
99
|
},
|
|
96
100
|
stopBackgroundSending: {
|
|
97
|
-
De3pzq: "
|
|
101
|
+
De3pzq: "f16xkysk"
|
|
102
|
+
},
|
|
103
|
+
stopBackgroundDictationActive: {
|
|
104
|
+
De3pzq: "f1c21dwh"
|
|
105
|
+
},
|
|
106
|
+
disabled: {
|
|
107
|
+
sj55zd: "f1s2aq7o"
|
|
108
|
+
},
|
|
109
|
+
stopBackgroundDisabled: {
|
|
110
|
+
De3pzq: "f1bg9a2p"
|
|
98
111
|
}
|
|
99
112
|
}, {
|
|
100
113
|
d: [".ftuwxu6{display:inline-flex;}", ".f4d9j23{justify-content:center;}", [".fwzfryc{grid-area:button;}", {
|
|
101
114
|
p: -1
|
|
102
|
-
}], ".f1tmlkn4{position:initial;}", ".f19g0ac{z-index:1;}", ".
|
|
115
|
+
}], ".f1tmlkn4{position:initial;}", ".f19g0ac{z-index:1;}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".faj9fo0{color:var(--colorBrandForeground2);}", [".fwzfryc{grid-area:button;}", {
|
|
103
116
|
p: -1
|
|
104
117
|
}], ".f1l02sjl{height:100%;}", ".fly5x3f{width:100%;}", [".f44lkw9{border-radius:var(--borderRadiusCircular);}", {
|
|
105
118
|
p: -1
|
|
106
|
-
}], ".f16xkysk{background-color:var(--colorBrandBackground2);}", ".
|
|
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);}"]
|
|
107
120
|
});
|
|
108
121
|
const useRootNextStyles = __styles({
|
|
109
122
|
root: {
|
|
@@ -151,13 +164,21 @@ const useRootNextStyles = __styles({
|
|
|
151
164
|
Bqenvij: "f1d2rq10"
|
|
152
165
|
},
|
|
153
166
|
notSending: {
|
|
154
|
-
Bmdhgnd: "f1hzdlu9",
|
|
155
|
-
yc1b9o: "f147vv5y",
|
|
156
|
-
f30giq: "f876z59"
|
|
157
|
-
},
|
|
158
|
-
sending: {
|
|
159
167
|
Bmdhgnd: "fiaw31n",
|
|
168
|
+
yc1b9o: "f7x9b1s",
|
|
160
169
|
f30giq: "f3l45fr"
|
|
170
|
+
},
|
|
171
|
+
notSendingDictationActive: {
|
|
172
|
+
Bmdhgnd: "fkhxdak",
|
|
173
|
+
jhc297: "f1dxmfzy",
|
|
174
|
+
f30giq: "f1zsivl",
|
|
175
|
+
Ba808g4: "f50srwi"
|
|
176
|
+
},
|
|
177
|
+
sending: {
|
|
178
|
+
Bmdhgnd: "f1hzdlu9",
|
|
179
|
+
uj1ttc: "fe9pnmy",
|
|
180
|
+
f30giq: "f876z59",
|
|
181
|
+
Bssu2nw: "fqsoy9w"
|
|
161
182
|
}
|
|
162
183
|
}, {
|
|
163
184
|
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);}", {
|
|
@@ -167,8 +188,8 @@ const useRootNextStyles = __styles({
|
|
|
167
188
|
}], ".f10pi13n{position:relative;}", [".f1pz6nmm[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);}", {
|
|
168
189
|
p: -1
|
|
169
190
|
}], ".f43rluz[data-fui-focus-visible]{box-shadow:0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus2);}", ".f12clzc2{min-width:40px;}", ".fbhnoac{height:40px;}", ".fwbmr0d{min-width:32px;}", ".f1d2rq10{height:32px;}"],
|
|
170
|
-
h: [".
|
|
171
|
-
a: [".
|
|
191
|
+
h: [".fiaw31n:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundHover);}", ".f7x9b1s:hover .fai-SendButton__sendIcon,.f7x9b1s: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
|
+
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);}"]
|
|
172
193
|
});
|
|
173
194
|
/**
|
|
174
195
|
* Apply styling to the SendButton slots based on the state
|
|
@@ -177,6 +198,7 @@ export const useSendButtonStyles_unstable = state => {
|
|
|
177
198
|
'use no memo';
|
|
178
199
|
|
|
179
200
|
const {
|
|
201
|
+
isDictationActive,
|
|
180
202
|
isSendIconFilled,
|
|
181
203
|
isSending,
|
|
182
204
|
disabled,
|
|
@@ -188,15 +210,15 @@ export const useSendButtonStyles_unstable = state => {
|
|
|
188
210
|
const rootNextStyles = useRootNextStyles();
|
|
189
211
|
const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;
|
|
190
212
|
const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;
|
|
191
|
-
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 && rootNextStyles.notSending, !disabled && designVersion === 'next' && isSending && rootNextStyles.sending, disabled && styles.disabled, state.root.className);
|
|
213
|
+
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);
|
|
192
214
|
if (state.sendIcon) {
|
|
193
|
-
state.sendIcon.className = mergeClasses(sendButtonClassNames.sendIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, state.sendIcon.className);
|
|
215
|
+
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);
|
|
194
216
|
}
|
|
195
217
|
if (state.stopIcon) {
|
|
196
218
|
state.stopIcon.className = mergeClasses(sendButtonClassNames.stopIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, stopIconFilledStyle, state.stopIcon.className);
|
|
197
219
|
}
|
|
198
220
|
if (state.stopBackground) {
|
|
199
|
-
state.stopBackground.className = mergeClasses(sendButtonClassNames.stopBackground, designVersion === 'next' ? nextStyles.stopBackground : styles.stopBackground, designVersion === 'next' && isSending && nextStyles.stopBackgroundSending, state.stopBackground.className);
|
|
221
|
+
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);
|
|
200
222
|
}
|
|
201
223
|
// Add style hooks from button
|
|
202
224
|
useButtonStyles_unstable({
|
|
@@ -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 },\n\n sendIconFilled: {\n color: tokens.colorCompoundBrandBackground,\n },\n\n stopIconFilled: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n stopBackground: {\n gridArea: 'button',\n height: '100%',\n width: '100%',\n borderRadius: tokens.borderRadiusCircular,\n /** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/\n backgroundColor: tokens.colorBrandBackground2,\n },\n\n stopBackgroundSending: {\n backgroundColor: tokens.colorBrandBackground,\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.colorBrandBackground2Hover,\n },\n\n [`& .${sendButtonClassNames.sendIcon},.${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorCompoundBrandBackground,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n },\n },\n\n sending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundHover,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundPressed,\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 { 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 && designVersion === 'next' && !isSending && 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 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 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","sendIconFilled","stopIconFilled","colorNeutralForegroundOnBrand","stopBackgroundSending","colorBrandBackground","useRootNextStyles","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","justifyItems","spacingVerticalNone","border","outline","strokeWidthThick","colorTransparentStroke","boxShadow","colorStrokeFocus2","canvas","sidecar","notSending","colorBrandBackground2Hover","colorBrandBackground2Pressed","sending","colorBrandBackgroundHover","colorBrandBackgroundPressed","useSendButtonStyles_unstable","state","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;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BAAqBI,cAAc,EACnC0D,kBAAkB,SAASG,WAAW7D,cAAc,GAAG4D,OAAO5D,cAAc,EAC5E0D,kBAAkB,UAAUD,aAAaI,WAAW7B,qBAAqB,EACzEuB,MAAMvD,cAAc,CAACiE,SAAS;IAElC;IAEA,8BAA8B;IAC9BxE,yBAAyB;QAAE,GAAG8D,KAAK;QAAEY,YAAY;YAAE,GAAGZ,MAAMY,UAAU;YAAEC,MAAM;QAAO;QAAGC,UAAU;IAAM;IAExG,OAAOd;AACT,EAAE"}
|
|
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;AACxB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYb,WAAW;IAC3BM,MAAM;QACJQ,SAAS;QACTC,OAAO;QACPC,UAAU;QACVC,QAAQ;QACRC,YAAY;QACZC,SAAS;IACX;IAEAC,gBAAgB;QACdC,UAAU;QACVH,YAAY;QACZJ,SAAS;QACTQ,gBAAgB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Gb,MAAMa,UAAU;YAAEC,MAAM;QAAO;QAAGC,UAAU;IAAM;IAExG,OAAOf;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SendButton.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ButtonProps, ButtonState, ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nexport type SendButtonSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n sendIcon: NonNullable<Slot<'span'>>;\n stopIcon?: Slot<'span'>;\n /** Stop button's circle background */\n stopBackground: NonNullable<Slot<'div'>>;\n sendButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopBackgroundMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\n/**\n * SendButton Props\n */\nexport type SendButtonProps = ComponentProps<Partial<SendButtonSlots>> &\n Pick<ButtonProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n DesignVersion &\n CopilotMode & {\n /**\n * Checks whether query is sending.\n */\n isSending?: boolean;\n isSendIconFilled?: boolean;\n };\n\n/**\n * State used in rendering SendButton\n */\nexport type SendButtonState = ComponentState<SendButtonSlots> &\n Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> &\n Pick<Required<SendButtonProps>, 'designVersion' | 'mode'> & {\n isButtonMotionRunning?: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"
|
|
1
|
+
{"version":3,"sources":["SendButton.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ButtonProps, ButtonState, ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nexport type SendButtonSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n sendIcon: NonNullable<Slot<'span'>>;\n stopIcon?: Slot<'span'>;\n /** Stop button's circle background */\n stopBackground: NonNullable<Slot<'div'>>;\n sendButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopButtonMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n stopBackgroundMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\n/**\n * SendButton Props\n */\nexport type SendButtonProps = ComponentProps<Partial<SendButtonSlots>> &\n Pick<ButtonProps, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n DesignVersion &\n CopilotMode & {\n /**\n * Checks whether query is sending.\n */\n isSending?: boolean;\n isSendIconFilled?: boolean;\n\n /*\n * Use alternate styles when dictation is active\n */\n isDictationActive?: boolean;\n };\n\n/**\n * State used in rendering SendButton\n */\nexport type SendButtonState = ComponentState<SendButtonSlots> &\n Pick<ButtonState, 'appearance' | 'disabled' | 'disabledFocusable' | 'iconPosition' | 'shape' | 'size'> &\n Pick<SendButtonProps, 'isSendIconFilled' | 'isSending'> &\n Pick<Required<SendButtonProps>, 'designVersion' | 'mode' | 'isDictationActive'> & {\n isButtonMotionRunning?: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAkCA;;CAEC"}
|
|
@@ -55,6 +55,7 @@ const useSendButton_unstable = (props, ref)=>{
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
})();
|
|
58
|
+
var _props_isDictationActive;
|
|
58
59
|
const state = {
|
|
59
60
|
...buttonState,
|
|
60
61
|
components: {
|
|
@@ -109,6 +110,7 @@ const useSendButton_unstable = (props, ref)=>{
|
|
|
109
110
|
}
|
|
110
111
|
}),
|
|
111
112
|
isButtonMotionRunning,
|
|
113
|
+
isDictationActive: (_props_isDictationActive = props.isDictationActive) !== null && _props_isDictationActive !== void 0 ? _props_isDictationActive : false,
|
|
112
114
|
isSendIconFilled: props.isSendIconFilled,
|
|
113
115
|
isSending: props.isSending,
|
|
114
116
|
designVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ButtonProps } from '@fluentui/react-components';\nimport { slot, useButton_unstable, useMergedRefs } from '@fluentui/react-components';\nimport type { SendButtonProps, SendButtonState } from './SendButton.types';\n\nimport { CircleButtonMotion, SendButtonMotion, StopButtonMotion } from './buttonMotion';\nimport {\n bundleIcon,\n SendFilled,\n SendRegular,\n Stop16Filled,\n Stop24Filled,\n ArrowRight24Filled,\n ArrowRight24Regular,\n Stop20Filled,\n ArrowRight20Regular,\n ArrowRight20Filled,\n} from '@fluentui/react-icons';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\nconst SendIcon = bundleIcon(SendFilled, SendRegular);\nconst SendIconV2Canvas = bundleIcon(ArrowRight24Filled, ArrowRight24Regular);\nconst SendIconV2Sidecar = bundleIcon(ArrowRight20Filled, ArrowRight20Regular);\n\n/**\n * Create the state required to render SendButton.\n *\n * The returned state can be modified with hooks such as useSendButtonStyles_unstable,\n * before being passed to renderSendButton_unstable.\n *\n * @param props - props from this instance of SendButton\n * @param ref - reference to root HTMLElement of SendButton\n */\nexport const useSendButton_unstable = (\n props: SendButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SendButtonState => {\n /** Used to apply/remove styles when button is animating */\n const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);\n const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);\n const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const [visible, setVisible] = React.useState(false);\n const mountRef = React.useCallback((elem: HTMLElement | null) => {\n if (elem) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n }, []);\n const finalRef = useMergedRefs(ref, mountRef);\n const buttonState = useButton_unstable(\n {\n shape: designVersion === 'next' ? 'circular' : undefined,\n ...(props as ButtonProps),\n appearance: 'transparent',\n 'aria-disabled': props.disabled ? true : undefined,\n type: 'submit',\n },\n finalRef,\n );\n\n const icon = (() => {\n if (designVersion === 'next') {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return mode === 'canvas' ? <ArrowRight24Filled /> : <ArrowRight20Regular />;\n } else {\n return mode === 'canvas' ? <SendIconV2Canvas /> : <SendIconV2Sidecar />;\n }\n } else {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return <SendFilled />;\n } else {\n return <SendIcon />;\n }\n }\n })();\n\n const state: SendButtonState = {\n ...buttonState,\n components: {\n root: 'button',\n sendIcon: 'span',\n stopIcon: 'span',\n stopBackground: 'div',\n sendButtonMotion: SendButtonMotion as React.ComponentType,\n stopButtonMotion: StopButtonMotion as React.ComponentType,\n stopBackgroundMotion: CircleButtonMotion as React.ComponentType,\n },\n root: buttonState.root,\n sendIcon: slot.always(props.sendIcon, {\n elementType: 'span',\n defaultProps: {\n children: icon,\n },\n }),\n stopIcon: slot.optional(props.stopIcon, {\n elementType: 'span',\n defaultProps: {\n children: designVersion === 'next' ? mode === 'canvas' ? <Stop24Filled /> : <Stop20Filled /> : <Stop16Filled />,\n },\n renderByDefault: true,\n }),\n stopBackground: slot.always(props.stopBackground, { elementType: 'div' }),\n sendButtonMotion: presenceMotionSlot<{}>(props.sendButtonMotion, {\n elementType: SendButtonMotion,\n defaultProps: {\n visible: !props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsSendMotionRunning(false),\n onMotionStart: () => setIsSendMotionRunning(true),\n },\n }),\n stopButtonMotion: presenceMotionSlot<{}>(props.stopButtonMotion, {\n elementType: StopButtonMotion,\n defaultProps: {\n visible: props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsStopMotionRunning(false),\n onMotionStart: () => setIsStopMotionRunning(true),\n },\n }),\n stopBackgroundMotion: presenceMotionSlot<{}>(props.stopBackgroundMotion, {\n elementType: CircleButtonMotion,\n defaultProps: {\n visible: designVersion === 'next' ? visible : props.isSending,\n unmountOnExit: true,\n },\n }),\n isButtonMotionRunning,\n isSendIconFilled: props.isSendIconFilled,\n isSending: props.isSending,\n designVersion,\n mode,\n };\n\n return state;\n};\n"],"names":["useSendButton_unstable","SendIcon","bundleIcon","SendFilled","SendRegular","SendIconV2Canvas","ArrowRight24Filled","ArrowRight24Regular","SendIconV2Sidecar","ArrowRight20Filled","ArrowRight20Regular","props","ref","React","useState","setIsSendMotionRunning","isStopMotionRunning","isButtonMotionRunning","isSendMotionRunning","useDesignVersion","designVersion","useCopilotMode","mode","visible","setVisible","mountRef","useCallback","elem","finalRef","buttonState","useButton_unstable","shape","undefined","appearance","disabled","type","icon","isSendIconFilled","createElement","state","components","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","StopButtonMotion","stopBackgroundMotion","CircleButtonMotion","slot","always","elementType","defaultProps","children","Stop24Filled","Stop20Filled","Stop16Filled","SendButtonMotion","unmountOnExit","onMotionFinish","onMotionStart","setIsStopMotionRunning","isSending"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["useSendButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ButtonProps } from '@fluentui/react-components';\nimport { slot, useButton_unstable, useMergedRefs } from '@fluentui/react-components';\nimport type { SendButtonProps, SendButtonState } from './SendButton.types';\n\nimport { CircleButtonMotion, SendButtonMotion, StopButtonMotion } from './buttonMotion';\nimport {\n bundleIcon,\n SendFilled,\n SendRegular,\n Stop16Filled,\n Stop24Filled,\n ArrowRight24Filled,\n ArrowRight24Regular,\n Stop20Filled,\n ArrowRight20Regular,\n ArrowRight20Filled,\n} from '@fluentui/react-icons';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\nconst SendIcon = bundleIcon(SendFilled, SendRegular);\nconst SendIconV2Canvas = bundleIcon(ArrowRight24Filled, ArrowRight24Regular);\nconst SendIconV2Sidecar = bundleIcon(ArrowRight20Filled, ArrowRight20Regular);\n\n/**\n * Create the state required to render SendButton.\n *\n * The returned state can be modified with hooks such as useSendButtonStyles_unstable,\n * before being passed to renderSendButton_unstable.\n *\n * @param props - props from this instance of SendButton\n * @param ref - reference to root HTMLElement of SendButton\n */\nexport const useSendButton_unstable = (\n props: SendButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SendButtonState => {\n /** Used to apply/remove styles when button is animating */\n const [isSendMotionRunning, setIsSendMotionRunning] = React.useState(false);\n const [isStopMotionRunning, setIsStopMotionRunning] = React.useState(false);\n const isButtonMotionRunning = isSendMotionRunning || isStopMotionRunning;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const [visible, setVisible] = React.useState(false);\n const mountRef = React.useCallback((elem: HTMLElement | null) => {\n if (elem) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n }, []);\n const finalRef = useMergedRefs(ref, mountRef);\n const buttonState = useButton_unstable(\n {\n shape: designVersion === 'next' ? 'circular' : undefined,\n ...(props as ButtonProps),\n appearance: 'transparent',\n 'aria-disabled': props.disabled ? true : undefined,\n type: 'submit',\n },\n finalRef,\n );\n\n const icon = (() => {\n if (designVersion === 'next') {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return mode === 'canvas' ? <ArrowRight24Filled /> : <ArrowRight20Regular />;\n } else {\n return mode === 'canvas' ? <SendIconV2Canvas /> : <SendIconV2Sidecar />;\n }\n } else {\n if (props.isSendIconFilled || isButtonMotionRunning) {\n return <SendFilled />;\n } else {\n return <SendIcon />;\n }\n }\n })();\n\n const state: SendButtonState = {\n ...buttonState,\n components: {\n root: 'button',\n sendIcon: 'span',\n stopIcon: 'span',\n stopBackground: 'div',\n sendButtonMotion: SendButtonMotion as React.ComponentType,\n stopButtonMotion: StopButtonMotion as React.ComponentType,\n stopBackgroundMotion: CircleButtonMotion as React.ComponentType,\n },\n root: buttonState.root,\n sendIcon: slot.always(props.sendIcon, {\n elementType: 'span',\n defaultProps: {\n children: icon,\n },\n }),\n stopIcon: slot.optional(props.stopIcon, {\n elementType: 'span',\n defaultProps: {\n children: designVersion === 'next' ? mode === 'canvas' ? <Stop24Filled /> : <Stop20Filled /> : <Stop16Filled />,\n },\n renderByDefault: true,\n }),\n stopBackground: slot.always(props.stopBackground, { elementType: 'div' }),\n sendButtonMotion: presenceMotionSlot<{}>(props.sendButtonMotion, {\n elementType: SendButtonMotion,\n defaultProps: {\n visible: !props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsSendMotionRunning(false),\n onMotionStart: () => setIsSendMotionRunning(true),\n },\n }),\n stopButtonMotion: presenceMotionSlot<{}>(props.stopButtonMotion, {\n elementType: StopButtonMotion,\n defaultProps: {\n visible: props.isSending,\n unmountOnExit: true,\n onMotionFinish: () => setIsStopMotionRunning(false),\n onMotionStart: () => setIsStopMotionRunning(true),\n },\n }),\n stopBackgroundMotion: presenceMotionSlot<{}>(props.stopBackgroundMotion, {\n elementType: CircleButtonMotion,\n defaultProps: {\n visible: designVersion === 'next' ? visible : props.isSending,\n unmountOnExit: true,\n },\n }),\n isButtonMotionRunning,\n isDictationActive: props.isDictationActive ?? false,\n isSendIconFilled: props.isSendIconFilled,\n isSending: props.isSending,\n designVersion,\n mode,\n };\n\n return state;\n};\n"],"names":["useSendButton_unstable","SendIcon","bundleIcon","SendFilled","SendRegular","SendIconV2Canvas","ArrowRight24Filled","ArrowRight24Regular","SendIconV2Sidecar","ArrowRight20Filled","ArrowRight20Regular","props","ref","React","useState","setIsSendMotionRunning","isStopMotionRunning","isButtonMotionRunning","isSendMotionRunning","useDesignVersion","designVersion","useCopilotMode","mode","visible","setVisible","mountRef","useCallback","elem","finalRef","buttonState","useButton_unstable","shape","undefined","appearance","disabled","type","icon","isSendIconFilled","createElement","_props_isDictationActive","state","components","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","StopButtonMotion","stopBackgroundMotion","CircleButtonMotion","slot","always","elementType","defaultProps","children","Stop24Filled","Stop20Filled","Stop16Filled","SendButtonMotion","unmountOnExit","onMotionFinish","onMotionStart","setIsStopMotionRunning","isSending","isDictationActive"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsCEA;;;eAAAA;;;;iEAtCqB;iCAEiC;8BAGe;4BAYhE;6BAC4B;+BACc;AAEjD,MAAMC,WAAWC,IAAAA,sBAAAA,EAAWC,sBAAAA,EAAYC,uBAAAA;AACxC,MAAMC,mBAAmBH,IAAAA,sBAAAA,EAAWI,8BAAAA,EAAoBC,+BAAAA;AACxD,MAAMC,oBAAoBN,IAAAA,sBAAAA,EAAWO,8BAAAA,EAAoBC,+BAAAA;AAevD,MAAAV,yBAAA,CAAAW,OAAAC;6DAEsDC,GAAAA,MAAMC,CAAAA,qBAASC,uBAAA,GAAAF,OAAAC,QAAA,CAAA;UACrE,CAAAE,qBAAMC,uBAAwBC,GAAAA,OAAuBF,QAAAA,CAAAA;UAErDC,wBAAsBE,uBAAuBC;UAC7CA,gBAAaC,IAAAA,+BAAqBC,EAAAA,MAAIF,aAAA;UAEtCE,OAAOC,IAAAA,6BAASC,EAAAA,MAAcX,IAAMC;UACpC,CAAAS,SAAME,WAAiBC,GAAAA,OAAWZ,QAAEa,CAAAA;UAClCF,WAAUZ,OAAAa,WAAA,CAAAC,CAAAA;kBACRH;uBACK;;uBAEP;QACF;OACA,EAAA;UACAI,WAAMC,IAAAA,8BAAcC,EAAAA,KAAAA;UAEhBC,cAAOX,IAAAA,mCAAkB,EA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A,SAAe;+BACfC;gCACAC,IAAAA,uBAAqB/C;+BACvB,IAAAA,uBAAA;;;0BAGAsC,IAAAA,+BAAaL,EAAAA,MAAAA,gBAAAA,EAAAA;yBACbM,8BAAc;0BACZ/B;yBACAqC,MAAAA,SAAe;+BACfC;gCACAC,IAAAA,uBAAqBC;+BACvB,IAAAA,uBAAA;;;8BAGab,IAAAA,+BAAAA,EAAAA,MAAAA,oBAAAA,EAAAA;yBACbI,gCAAc;0BACZ/B;yBACAqC,kBAAe,SAAArC,UAAAZ,MAAAqD,SAAA;+BACjB;;;;2BAIF3B,CAAAA,2BAAwC1B,MAAAsD,iBAAA,MAAA,QAAA1B,6BAAA,KAAA,IAAAA,2BAAA;0BAC7B5B,MAAMqD,gBAAS;mBAC1B5C,MAAAA,SAAAA;;QAEFE;;IAGA,OAAAkB"}
|
|
@@ -113,13 +113,17 @@ const useNextStyles = (0, _reactcomponents.__styles)({
|
|
|
113
113
|
Ijaq50: 0,
|
|
114
114
|
Bq1tomu: "fwzfryc",
|
|
115
115
|
qhf8xq: "f1tmlkn4",
|
|
116
|
-
Bj3rh1h: "f19g0ac"
|
|
116
|
+
Bj3rh1h: "f19g0ac",
|
|
117
|
+
sj55zd: "f1phragk"
|
|
118
|
+
},
|
|
119
|
+
dictationActive: {
|
|
120
|
+
sj55zd: "fkfq4zb"
|
|
117
121
|
},
|
|
118
122
|
sendIconFilled: {
|
|
119
|
-
sj55zd: "
|
|
123
|
+
sj55zd: "f1phragk"
|
|
120
124
|
},
|
|
121
125
|
stopIconFilled: {
|
|
122
|
-
sj55zd: "
|
|
126
|
+
sj55zd: "faj9fo0"
|
|
123
127
|
},
|
|
124
128
|
stopBackground: {
|
|
125
129
|
Bw0ie65: 0,
|
|
@@ -134,10 +138,19 @@ const useNextStyles = (0, _reactcomponents.__styles)({
|
|
|
134
138
|
Btl43ni: 0,
|
|
135
139
|
B7oj6ja: 0,
|
|
136
140
|
Dimara: "f44lkw9",
|
|
137
|
-
De3pzq: "
|
|
141
|
+
De3pzq: "ffp7eso"
|
|
138
142
|
},
|
|
139
143
|
stopBackgroundSending: {
|
|
140
|
-
De3pzq: "
|
|
144
|
+
De3pzq: "f16xkysk"
|
|
145
|
+
},
|
|
146
|
+
stopBackgroundDictationActive: {
|
|
147
|
+
De3pzq: "f1c21dwh"
|
|
148
|
+
},
|
|
149
|
+
disabled: {
|
|
150
|
+
sj55zd: "f1s2aq7o"
|
|
151
|
+
},
|
|
152
|
+
stopBackgroundDisabled: {
|
|
153
|
+
De3pzq: "f1bg9a2p"
|
|
141
154
|
}
|
|
142
155
|
}, {
|
|
143
156
|
d: [
|
|
@@ -151,8 +164,9 @@ const useNextStyles = (0, _reactcomponents.__styles)({
|
|
|
151
164
|
],
|
|
152
165
|
".f1tmlkn4{position:initial;}",
|
|
153
166
|
".f19g0ac{z-index:1;}",
|
|
154
|
-
".f1oyzx04{color:var(--colorCompoundBrandBackground);}",
|
|
155
167
|
".f1phragk{color:var(--colorNeutralForegroundOnBrand);}",
|
|
168
|
+
".fkfq4zb{color:var(--colorNeutralForeground2);}",
|
|
169
|
+
".faj9fo0{color:var(--colorBrandForeground2);}",
|
|
156
170
|
[
|
|
157
171
|
".fwzfryc{grid-area:button;}",
|
|
158
172
|
{
|
|
@@ -167,8 +181,11 @@ const useNextStyles = (0, _reactcomponents.__styles)({
|
|
|
167
181
|
p: -1
|
|
168
182
|
}
|
|
169
183
|
],
|
|
184
|
+
".ffp7eso{background-color:var(--colorBrandBackground);}",
|
|
170
185
|
".f16xkysk{background-color:var(--colorBrandBackground2);}",
|
|
171
|
-
".
|
|
186
|
+
".f1c21dwh{background-color:var(--colorTransparentBackground);}",
|
|
187
|
+
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
|
|
188
|
+
".f1bg9a2p{background-color:var(--colorNeutralBackgroundDisabled);}"
|
|
172
189
|
]
|
|
173
190
|
});
|
|
174
191
|
const useRootNextStyles = (0, _reactcomponents.__styles)({
|
|
@@ -217,13 +234,21 @@ const useRootNextStyles = (0, _reactcomponents.__styles)({
|
|
|
217
234
|
Bqenvij: "f1d2rq10"
|
|
218
235
|
},
|
|
219
236
|
notSending: {
|
|
220
|
-
Bmdhgnd: "f1hzdlu9",
|
|
221
|
-
yc1b9o: "f147vv5y",
|
|
222
|
-
f30giq: "f876z59"
|
|
223
|
-
},
|
|
224
|
-
sending: {
|
|
225
237
|
Bmdhgnd: "fiaw31n",
|
|
238
|
+
yc1b9o: "f7x9b1s",
|
|
226
239
|
f30giq: "f3l45fr"
|
|
240
|
+
},
|
|
241
|
+
notSendingDictationActive: {
|
|
242
|
+
Bmdhgnd: "fkhxdak",
|
|
243
|
+
jhc297: "f1dxmfzy",
|
|
244
|
+
f30giq: "f1zsivl",
|
|
245
|
+
Ba808g4: "f50srwi"
|
|
246
|
+
},
|
|
247
|
+
sending: {
|
|
248
|
+
Bmdhgnd: "f1hzdlu9",
|
|
249
|
+
uj1ttc: "fe9pnmy",
|
|
250
|
+
f30giq: "f876z59",
|
|
251
|
+
Bssu2nw: "fqsoy9w"
|
|
227
252
|
}
|
|
228
253
|
}, {
|
|
229
254
|
d: [
|
|
@@ -259,32 +284,38 @@ const useRootNextStyles = (0, _reactcomponents.__styles)({
|
|
|
259
284
|
".f1d2rq10{height:32px;}"
|
|
260
285
|
],
|
|
261
286
|
h: [
|
|
287
|
+
".fiaw31n:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundHover);}",
|
|
288
|
+
".f7x9b1s:hover .fai-SendButton__sendIcon,.f7x9b1s:hover.fai-SendButton__stopIcon{color:var(--colorNeutralForegroundOnBrand);}",
|
|
289
|
+
".fkhxdak:hover .fai-SendButton__stopBackground{background-color:var(--colorSubtleBackgroundHover);}",
|
|
290
|
+
".f1dxmfzy:hover .fai-SendButton__sendIcon{color:var(--colorNeutralForeground2Hover);}",
|
|
262
291
|
".f1hzdlu9:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackground2Hover);}",
|
|
263
|
-
".
|
|
264
|
-
".fiaw31n:hover .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundHover);}"
|
|
292
|
+
".fe9pnmy:hover .fai-SendButton__stopIcon{color:var(--colorBrandForeground2Hover);}"
|
|
265
293
|
],
|
|
266
294
|
a: [
|
|
295
|
+
".f3l45fr:active .fai-SendButton__stopBackground{background-color:var(--colorBrandBackgroundPressed);}",
|
|
296
|
+
".f1zsivl:active .fai-SendButton__stopBackground{background-color:var(--colorSubtleBackgroundPressed);}",
|
|
297
|
+
".f50srwi:active .fai-SendButton__sendIcon{color:var(--colorNeutralForeground2Pressed);}",
|
|
267
298
|
".f876z59:active .fai-SendButton__stopBackground{background-color:var(--colorBrandBackground2Pressed);}",
|
|
268
|
-
".
|
|
299
|
+
".fqsoy9w:active .fai-SendButton__stopIcon{color:var(--colorBrandForeground2Pressed);}"
|
|
269
300
|
]
|
|
270
301
|
});
|
|
271
302
|
const useSendButtonStyles_unstable = (state)=>{
|
|
272
303
|
'use no memo';
|
|
273
|
-
const { isSendIconFilled, isSending, disabled, designVersion, mode } = state;
|
|
304
|
+
const { isDictationActive, isSendIconFilled, isSending, disabled, designVersion, mode } = state;
|
|
274
305
|
const styles = useStyles();
|
|
275
306
|
const nextStyles = useNextStyles();
|
|
276
307
|
const rootNextStyles = useRootNextStyles();
|
|
277
308
|
const sendIconFilledStyle = designVersion === 'next' ? nextStyles.sendIconFilled : styles.iconFilled;
|
|
278
309
|
const stopIconFilledStyle = designVersion === 'next' ? nextStyles.stopIconFilled : styles.iconFilled;
|
|
279
|
-
state.root.className = (0, _reactcomponents.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 && rootNextStyles.notSending, !disabled && designVersion === 'next' && isSending && rootNextStyles.sending, disabled && styles.disabled, state.root.className);
|
|
310
|
+
state.root.className = (0, _reactcomponents.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);
|
|
280
311
|
if (state.sendIcon) {
|
|
281
|
-
state.sendIcon.className = (0, _reactcomponents.mergeClasses)(sendButtonClassNames.sendIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, state.sendIcon.className);
|
|
312
|
+
state.sendIcon.className = (0, _reactcomponents.mergeClasses)(sendButtonClassNames.sendIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, !disabled && designVersion === 'next' && !isSending && isDictationActive && nextStyles.dictationActive, disabled && designVersion === 'next' && nextStyles.disabled, state.sendIcon.className);
|
|
282
313
|
}
|
|
283
314
|
if (state.stopIcon) {
|
|
284
315
|
state.stopIcon.className = (0, _reactcomponents.mergeClasses)(sendButtonClassNames.stopIcon, designVersion === 'next' ? nextStyles.baseIconButton : styles.baseIconButton, stopIconFilledStyle, state.stopIcon.className);
|
|
285
316
|
}
|
|
286
317
|
if (state.stopBackground) {
|
|
287
|
-
state.stopBackground.className = (0, _reactcomponents.mergeClasses)(sendButtonClassNames.stopBackground, designVersion === 'next' ? nextStyles.stopBackground : styles.stopBackground, designVersion === 'next' && isSending && nextStyles.stopBackgroundSending, state.stopBackground.className);
|
|
318
|
+
state.stopBackground.className = (0, _reactcomponents.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);
|
|
288
319
|
}
|
|
289
320
|
// Add style hooks from button
|
|
290
321
|
(0, _reactcomponents.useButtonStyles_unstable)({
|
|
@@ -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 },\n\n sendIconFilled: {\n color: tokens.colorCompoundBrandBackground,\n },\n\n stopIconFilled: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n stopBackground: {\n gridArea: 'button',\n height: '100%',\n width: '100%',\n borderRadius: tokens.borderRadiusCircular,\n /** To-do: Change to backgroundColor: var(--Brand-Background-Tint-Rest, #EBEFFF);*/\n backgroundColor: tokens.colorBrandBackground2,\n },\n\n stopBackgroundSending: {\n backgroundColor: tokens.colorBrandBackground,\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.colorBrandBackground2Hover,\n },\n\n [`& .${sendButtonClassNames.sendIcon},.${sendButtonClassNames.stopIcon}`]: {\n color: tokens.colorCompoundBrandBackground,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n },\n },\n\n sending: {\n ':hover': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundHover,\n },\n },\n ':active': {\n [`& .${sendButtonClassNames.stopBackground}`]: {\n backgroundColor: tokens.colorBrandBackgroundPressed,\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 { 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 && designVersion === 'next' && !isSending && 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 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 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":["sendButtonClassNames","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","__styles","display","width","minWidth","height","alignItems","padding","Byoj8tv","baseIconButton","position","tokens","mc9l5x","disabled","color","Bqenvij","iconFilled","borderRadius","Beyfa6y","Bbmb7ep","useNextStyles","justifyContent","gridArea","sendIconFilled","colorCompoundBrandBackground","p","stopIconFilled","nk6f5a","stopBackgroundSending","backgroundColor","qhf8xq","Bj3rh1h","gridTemplateRows","gridTemplateColumns","border","createCustomFocusIndicatorStyle","outline","boxShadow","canvas","Dimara","sidecar","De3pzq","wkccdc","sending","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","u1mtju","h3c5rm","isSendIconFilled","vrafjx","styles","Bekrc4i","nextStyles","i8vvqc","rootNextStyles","g2u3we","sendIconFilledStyle","icvyot","stopIconFilledStyle","state","irswps","Bfpq7zp","g9k6zt","giviqs","j6ew2k","Bf4jedk","useButtonStyles_unstable","components","icon","iconOnly","Bmdhgnd","yc1b9o","f30giq"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAWaA,oBAAAA;eAAAA;;;;;;iCAPoB;AAO1B,MAAMA,uBAAwD;UACnEC;cACAC;cACAC;oBACAC;sBACAC;sBACAC;0BACAC;AACF;AAEA;;CAEC,SAECN,YAAMO,IAAAA,yBAAA,EAAA;UACJC;gBACAC;gBACAC;iBACAC;iBACAC;iBACAC;QACFC,SAAA;QAEAC,QAAAA;gBACEC;gBACAJ;iBACAJ;;oBAEUS;gBACVN;iBACAF;QACFS,QAAA;QAEAC,SAAAA;iBACEC;QACFC,SAAA;QAEAC,QAAAA;;cAEE;gBACEF;;gBAEJ;QAEAjB,QAAAA;iBACEa;;oBAEQ;gBACRO;gBACA;QAEFF,SAAA;QACFG,SAAA;QAEAC,SAAMC;QACJX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ourcesContent":["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":["sendButtonClassNames","root","sendIcon","stopIcon","stopBackground","sendButtonMotion","stopButtonMotion","stopBackgroundMotion","__styles","display","width","minWidth","height","alignItems","padding","Byoj8tv","baseIconButton","position","tokens","mc9l5x","disabled","color","Bqenvij","iconFilled","borderRadius","Beyfa6y","Bbmb7ep","useNextStyles","justifyContent","gridArea","colorNeutralForegroundOnBrand","p","dictationActive","sendIconFilled","stopIconFilled","Brf1p80","backgroundColor","Bj3rh1h","stopBackgroundSending","stopBackgroundDictationActive","stopBackgroundDisabled","Bw0ie65","Br312pm","useRootNextStyles","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","justifyItems","border","createCustomFocusIndicatorStyle","sidecar","De3pzq","wkccdc","notSendingDictationActive","h3c5rm","sending","Bf4jedk","Bmdhgnd","isDictationActive","yc1b9o","styles","f30giq","nextStyles","sendIconFilledStyle","stopIconFilledStyle","state","uj1ttc","useButtonStyles_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACGgC;;2BAEW;gBACZ;;mCAGI;gBACNtC;;cAEF;QAEAuC,QAAAA;;4BAEU;QACVC,QAAA;;;;;QAIgC/C;QAAmB;YAAA;YAAA;;;;;QAE/C;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;;;;;QAGgB0B;QAAAA;YAA6B;YAAA;;;;;QAE/C;QAAA;QAAA;QAAA;KAAA;;0BAES9B,IAAAA,yBAAAA,EAAAA;;gBAEP;gBACF;QACFoD,QAAA;QACAC,SAAAA;iBACE;iBACG;;gBAED;gBAEA;;iBAEA;iBACF;iBACA;gBACE;;iBAEA;gBACA;;gBAEA;gBACF;QACFC,QAAA;QAEAC,QAAAA;iBACE;gBACE;;gBAEA;iBACC;;gBAED;iBACF;gBACA;iBACG;;gBAED;;;iBAGA;iBACF;;IAEJL,SAAA;QAEAM,SAAA;;IAEC;gBAEC;QACAC,SAAQC;QAERC,QAAMC;QACNC,QAAMC;;+BAGAC;QACNN,SAAMO;QAENC,QAAMhE;QAgBN4D,QAAII;iBACFA;;aASEA;iBACFA;QAMFC,QAAA;QAEAL,QAAII;iBACFA;;;OAWFE;QAAAA;QAAyB;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;oBAAE;;;;;YAAsB;;;;;QAA6B;YAAA;YAAA;oBAAO;;;;QAAa;QAAA;QAAA;QAAA;KAAA;OAAM;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;OAExG;QAAA;QAAOF;QAAAA;QAAAA;QAAAA;KAAAA;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-send-button",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
4
4
|
"description": "Fluent AI control for the send button used in ChatInput and PromptInput.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/react-provider": "^0.0.0-nightly-
|
|
16
|
-
"@fluentui-copilot/react-utilities": "^0.0.0-nightly-
|
|
17
|
-
"@fluentui-copilot/tokens": "^0.0.0-nightly-
|
|
15
|
+
"@fluentui-copilot/react-provider": "^0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
16
|
+
"@fluentui-copilot/react-utilities": "^0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
17
|
+
"@fluentui-copilot/tokens": "^0.0.0-nightly-20250418-0405-0b1ae88d.1",
|
|
18
18
|
"@swc/helpers": "^0.5.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|