@fluentui-copilot/react-suggestions 0.8.4 → 0.9.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 +36 -1
- package/CHANGELOG.md +17 -2
- package/dist/index.d.ts +9 -2
- package/lib/components/Suggestion/Suggestion.js +3 -2
- package/lib/components/Suggestion/Suggestion.js.map +1 -1
- package/lib/components/Suggestion/Suggestion.types.js +2 -0
- package/lib/components/Suggestion/Suggestion.types.js.map +1 -0
- package/lib/components/Suggestion/useSuggestion.js +11 -0
- package/lib/components/Suggestion/useSuggestion.js.map +1 -0
- package/lib/components/Suggestion/useSuggestionStyles.styles.js +24 -10
- package/lib/components/Suggestion/useSuggestionStyles.styles.js.map +1 -1
- package/lib/components/SuggestionList/useSuggestionListStyles.styles.js +16 -8
- package/lib/components/SuggestionList/useSuggestionListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Suggestion/Suggestion.js +2 -1
- package/lib-commonjs/components/Suggestion/Suggestion.js.map +1 -1
- package/lib-commonjs/components/Suggestion/Suggestion.types.js +5 -0
- package/lib-commonjs/components/Suggestion/Suggestion.types.js.map +1 -0
- package/lib-commonjs/components/Suggestion/useSuggestion.js +20 -0
- package/lib-commonjs/components/Suggestion/useSuggestion.js.map +1 -0
- package/lib-commonjs/components/Suggestion/useSuggestionStyles.styles.js +36 -36
- package/lib-commonjs/components/Suggestion/useSuggestionStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SuggestionList/useSuggestionListStyles.styles.js +28 -17
- package/lib-commonjs/components/SuggestionList/useSuggestionListStyles.styles.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,42 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-suggestions",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 21 Aug 2024 00:26:05 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-suggestions_v0.9.0",
|
|
7
|
+
"version": "0.9.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ololubek@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-suggestions",
|
|
13
|
+
"commit": "bb3b08691d41053c5b7808c770dd82565048bd75",
|
|
14
|
+
"comment": "fix: Add canvas styling to Suggestion"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"patch": [
|
|
18
|
+
{
|
|
19
|
+
"author": "ololubek@microsoft.com",
|
|
20
|
+
"package": "@fluentui-copilot/react-suggestions",
|
|
21
|
+
"commit": "0a6327b6b174fc99abed7fa70ed0542e698bcf40",
|
|
22
|
+
"comment": "chore: bump react-components version to 9.54.10."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
|
26
|
+
"package": "@fluentui-copilot/react-suggestions",
|
|
27
|
+
"commit": "907c63c4da894b41cad4601b30e0df6d9f269056",
|
|
28
|
+
"comment": "chore: Bumping versions of @fluentui/* and @griffel/* packages to latest (corresponding to version 9.54.8 of @fluentui/react-components)."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
|
32
|
+
"package": "@fluentui-copilot/react-suggestions",
|
|
33
|
+
"commit": "6ce23774f5f2055977299510e8df454d86a1a313",
|
|
34
|
+
"comment": "chore: Removing shorthands' usage now that griffel supports them."
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"date": "Tue, 23 Jul 2024 00:56:25 GMT",
|
|
6
41
|
"tag": "@fluentui-copilot/react-suggestions_v0.8.4",
|
|
7
42
|
"version": "0.8.4",
|
|
8
43
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-suggestions
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 21 Aug 2024 00:26:05 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.9.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-suggestions_v0.9.0)
|
|
8
|
+
|
|
9
|
+
Wed, 21 Aug 2024 00:26:05 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-suggestions_v0.8.4..@fluentui-copilot/react-suggestions_v0.9.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- fix: Add canvas styling to Suggestion ([PR #2010](https://github.com/microsoft/fluentai/pull/2010) by ololubek@microsoft.com)
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- chore: bump react-components version to 9.54.10. ([PR #2018](https://github.com/microsoft/fluentai/pull/2018) by ololubek@microsoft.com)
|
|
19
|
+
- chore: Bumping versions of @fluentui/* and @griffel/* packages to latest (corresponding to version 9.54.8 of @fluentui/react-components). ([PR #1993](https://github.com/microsoft/fluentai/pull/1993) by Humberto.Morimoto@microsoft.com)
|
|
20
|
+
- chore: Removing shorthands' usage now that griffel supports them. ([PR #1994](https://github.com/microsoft/fluentai/pull/1994) by Humberto.Morimoto@microsoft.com)
|
|
21
|
+
|
|
7
22
|
## [0.8.4](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-suggestions_v0.8.4)
|
|
8
23
|
|
|
9
|
-
Tue, 23 Jul 2024 00:
|
|
24
|
+
Tue, 23 Jul 2024 00:56:25 GMT
|
|
10
25
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-suggestions_v0.8.3..@fluentui-copilot/react-suggestions_v0.8.4)
|
|
11
26
|
|
|
12
27
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { ButtonSlots } from '@fluentui/react-components';
|
|
|
6
6
|
import type { ButtonState } from '@fluentui/react-components';
|
|
7
7
|
import type { ComponentProps } from '@fluentui/react-components';
|
|
8
8
|
import type { ComponentState } from '@fluentui/react-components';
|
|
9
|
+
import type { CopilotMode } from '@fluentui-copilot/react-provider';
|
|
9
10
|
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
10
11
|
import * as React_2 from 'react';
|
|
11
12
|
import type { Slot } from '@fluentui/react-components';
|
|
@@ -17,7 +18,7 @@ import type { TooltipProps } from '@fluentui/react-components';
|
|
|
17
18
|
*/
|
|
18
19
|
export declare const renderSuggestionList_unstable: (state: SuggestionListState) => JSX.Element;
|
|
19
20
|
|
|
20
|
-
export declare const Suggestion: ForwardRefComponent<
|
|
21
|
+
export declare const Suggestion: ForwardRefComponent<SuggestionProps>;
|
|
21
22
|
|
|
22
23
|
export declare const suggestionClassNames: SlotClassNames<ButtonSlots>;
|
|
23
24
|
|
|
@@ -50,6 +51,12 @@ export declare type SuggestionListSlots = {
|
|
|
50
51
|
*/
|
|
51
52
|
export declare type SuggestionListState = ComponentState<SuggestionListSlots>;
|
|
52
53
|
|
|
54
|
+
declare type SuggestionProps = CopilotMode & ComponentProps<SuggestionSlots> & Omit<ButtonProps, keyof ButtonSlots>;
|
|
55
|
+
|
|
56
|
+
declare type SuggestionSlots = ButtonSlots;
|
|
57
|
+
|
|
58
|
+
declare type SuggestionState = ComponentState<SuggestionSlots> & Required<Pick<SuggestionProps, 'mode'>> & Omit<ButtonState, keyof ButtonSlots>;
|
|
59
|
+
|
|
53
60
|
export declare type TooltipComponent = React.FunctionComponent<Partial<TooltipProps>>;
|
|
54
61
|
|
|
55
62
|
/**
|
|
@@ -68,6 +75,6 @@ export declare const useSuggestionList_unstable: (props: SuggestionListProps, re
|
|
|
68
75
|
*/
|
|
69
76
|
export declare const useSuggestionListStyles_unstable: (state: SuggestionListState) => SuggestionListState;
|
|
70
77
|
|
|
71
|
-
export declare const useSuggestionStyles_unstable: (state:
|
|
78
|
+
export declare const useSuggestionStyles_unstable: (state: SuggestionState) => SuggestionState;
|
|
72
79
|
|
|
73
80
|
export { }
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSuggestionStyles_unstable } from './useSuggestionStyles.styles';
|
|
3
|
-
import { renderButton_unstable, useButtonStyles_unstable
|
|
3
|
+
import { renderButton_unstable, useButtonStyles_unstable } from '@fluentui/react-components';
|
|
4
4
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
5
|
+
import { useSuggestion_unstable } from './useSuggestion';
|
|
5
6
|
// Suggestion component - TODO: add more docs
|
|
6
7
|
export const Suggestion = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
8
|
'use no memo';
|
|
8
9
|
|
|
9
|
-
const state =
|
|
10
|
+
const state = useSuggestion_unstable(props, ref);
|
|
10
11
|
state.appearance = props.appearance || 'outline';
|
|
11
12
|
useButtonStyles_unstable(state);
|
|
12
13
|
useSuggestionStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Suggestion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSuggestionStyles_unstable } from './useSuggestionStyles.styles';\nimport type {
|
|
1
|
+
{"version":3,"sources":["Suggestion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSuggestionStyles_unstable } from './useSuggestionStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { renderButton_unstable, useButtonStyles_unstable } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\nimport { useSuggestion_unstable } from './useSuggestion';\nimport type { SuggestionProps } from './Suggestion.types';\n\n// Suggestion component - TODO: add more docs\nexport const Suggestion: ForwardRefComponent<SuggestionProps> = React.forwardRef((props, ref) => {\n 'use no memo';\n\n const state = useSuggestion_unstable(props, ref);\n state.appearance = props.appearance || 'outline';\n useButtonStyles_unstable(state);\n useSuggestionStyles_unstable(state);\n useCustomStyleHook('useSuggestionStyles')(state);\n\n return renderButton_unstable(state);\n});\n\nSuggestion.displayName = 'Suggestion';\n"],"names":["React","useSuggestionStyles_unstable","renderButton_unstable","useButtonStyles_unstable","useCustomStyleHook","useSuggestion_unstable","Suggestion","forwardRef","props","ref","state","appearance","displayName"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,4BAA4B,QAAQ,+BAA+B;AAE5E,SAASC,qBAAqB,EAAEC,wBAAwB,QAAQ,6BAA6B;AAC7F,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD,6CAA6C;AAC7C,OAAO,MAAMC,2BAAmDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACvF;IAEA,MAAMC,QAAQL,uBAAuBG,OAAOC;IAC5CC,MAAMC,UAAU,GAAGH,MAAMG,UAAU,IAAI;IACvCR,yBAAyBO;IACzBT,6BAA6BS;IAC7BN,mBAAmB,uBAAuBM;IAE1C,OAAOR,sBAAsBQ;AAC/B,GAAG;AAEHJ,WAAWM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Suggestion.types.ts"],"sourcesContent":["import type { CopilotMode } from '@fluentui-copilot/react-provider';\nimport type { ButtonProps, ButtonSlots, ButtonState, ComponentProps, ComponentState } from '@fluentui/react-components';\n\nexport type SuggestionSlots = ButtonSlots;\n\nexport type SuggestionProps = CopilotMode & ComponentProps<SuggestionSlots> & Omit<ButtonProps, keyof ButtonSlots>;\n\nexport type SuggestionState = ComponentState<SuggestionSlots> &\n Required<Pick<SuggestionProps, 'mode'>> &\n Omit<ButtonState, keyof ButtonSlots>;\n"],"names":[],"rangeMappings":"","mappings":"AAOA,WAEuC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useButton_unstable } from '@fluentui/react-components';
|
|
2
|
+
import { useCopilotMode } from '@fluentui-copilot/react-provider';
|
|
3
|
+
export const useSuggestion_unstable = (props, ref) => {
|
|
4
|
+
const buttonState = useButton_unstable(props, ref);
|
|
5
|
+
const mode = useCopilotMode(props.mode);
|
|
6
|
+
return {
|
|
7
|
+
...buttonState,
|
|
8
|
+
mode
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useSuggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useSuggestion.ts"],"sourcesContent":["import { useButton_unstable } from '@fluentui/react-components';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\nimport type { SuggestionProps } from './Suggestion.types';\n\nexport const useSuggestion_unstable = (\n props: SuggestionProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n) => {\n const buttonState = useButton_unstable(props, ref);\n const mode = useCopilotMode(props.mode);\n return { ...buttonState, mode };\n};\n"],"names":["useButton_unstable","useCopilotMode","useSuggestion_unstable","props","ref","buttonState","mode"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,SAASA,kBAAkB,QAAQ,6BAA6B;AAChE,SAASC,cAAc,QAAQ,mCAAmC;AAGlE,OAAO,MAAMC,yBAAyB,CACpCC,OACAC;IAEA,MAAMC,cAAcL,mBAAmBG,OAAOC;IAC9C,MAAME,OAAOL,eAAeE,MAAMG,IAAI;IACtC,OAAO;QAAE,GAAGD,WAAW;QAAEC;IAAK;AAChC,EAAE"}
|
|
@@ -21,14 +21,16 @@ const useSuggestionStylesStyles = __styles({
|
|
|
21
21
|
h3c5rm: ["f1c8dzaj", "f1sl6hi9"],
|
|
22
22
|
B9xav0g: "f1619yhw",
|
|
23
23
|
zhjwy3: ["f1sl6hi9", "f1c8dzaj"],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
Beyfa6y: 0,
|
|
25
|
+
Bbmb7ep: 0,
|
|
26
|
+
Btl43ni: 0,
|
|
27
|
+
B7oj6ja: 0,
|
|
28
|
+
Dimara: "f1kijzfu",
|
|
29
|
+
Byoj8tv: 0,
|
|
30
|
+
uwmqm3: 0,
|
|
31
|
+
z189sj: 0,
|
|
32
|
+
z8tnut: 0,
|
|
33
|
+
B0ocmuz: "fcca7b8",
|
|
32
34
|
sj55zd: "fkfq4zb",
|
|
33
35
|
fsow6f: "fpgzoln"
|
|
34
36
|
},
|
|
@@ -45,9 +47,21 @@ const useSuggestionStylesStyles = __styles({
|
|
|
45
47
|
H566xl: ["f1u9p12n", "fs1n9un"],
|
|
46
48
|
a9g2gr: "fezean8",
|
|
47
49
|
rgbxn1: "f1yr11xb"
|
|
50
|
+
},
|
|
51
|
+
canvas: {
|
|
52
|
+
Bahqtrf: "fk6fouc",
|
|
53
|
+
Be2twd7: "fkhj508",
|
|
54
|
+
Bhrd7zp: "figsok6",
|
|
55
|
+
Bg96gwp: "f1i3iumi",
|
|
56
|
+
z8tnut: "fp2oml8",
|
|
57
|
+
Byoj8tv: "f1tdddsa"
|
|
48
58
|
}
|
|
49
59
|
}, {
|
|
50
|
-
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f161y7kd{border-top-color:var(--colorBrandStroke2);}", ".f1c8dzaj{border-right-color:var(--colorBrandStroke2);}", ".f1sl6hi9{border-left-color:var(--colorBrandStroke2);}", ".f1619yhw{border-bottom-color:var(--colorBrandStroke2);}", ".
|
|
60
|
+
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f161y7kd{border-top-color:var(--colorBrandStroke2);}", ".f1c8dzaj{border-right-color:var(--colorBrandStroke2);}", ".f1sl6hi9{border-left-color:var(--colorBrandStroke2);}", ".f1619yhw{border-bottom-color:var(--colorBrandStroke2);}", [".f1kijzfu{border-radius:var(--borderRadiusXLarge);}", {
|
|
61
|
+
p: -1
|
|
62
|
+
}], [".fcca7b8{padding:var(--spacingVerticalXS) var(--spacingVerticalS);}", {
|
|
63
|
+
p: -1
|
|
64
|
+
}], ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fpgzoln{text-align:start;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fp2oml8{padding-top:var(--spacingVerticalSNudge);}", ".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}"],
|
|
51
65
|
m: [["@media (forced-colors: none){.fxuoarf:hover{border-top-color:var(--colorBrandStroke2Hover);}}", {
|
|
52
66
|
m: "(forced-colors: none)"
|
|
53
67
|
}], ["@media (forced-colors: none){.f1qi0eim:hover{border-right-color:var(--colorBrandStroke2Hover);}.fiwk2rq:hover{border-left-color:var(--colorBrandStroke2Hover);}}", {
|
|
@@ -74,7 +88,7 @@ export const useSuggestionStyles_unstable = state => {
|
|
|
74
88
|
'use no memo';
|
|
75
89
|
|
|
76
90
|
const styles = useSuggestionStylesStyles();
|
|
77
|
-
state.root.className = mergeClasses(suggestionClassNames.root, styles.root, !state.disabled && styles.enabled, state.root.className);
|
|
91
|
+
state.root.className = mergeClasses(suggestionClassNames.root, styles.root, state.mode === 'canvas' && styles.canvas, !state.disabled && styles.enabled, state.root.className);
|
|
78
92
|
return state;
|
|
79
93
|
};
|
|
80
94
|
//# sourceMappingURL=useSuggestionStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSuggestionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { SlotClassNames, ButtonSlots
|
|
1
|
+
{"version":3,"sources":["useSuggestionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { SlotClassNames, ButtonSlots } from '@fluentui/react-components';\nimport type { SuggestionState } from './Suggestion.types';\n\nexport const suggestionClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fai-Suggestion',\n icon: 'fai-Suggestion__icon',\n};\n\nconst useSuggestionStylesStyles = makeStyles({\n root: {\n ...typographyStyles.caption1,\n // Brand/M365/140\n ...shorthands.border('1px', 'solid', tokens.colorBrandStroke2),\n borderRadius: tokens.borderRadiusXLarge,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingVerticalS}`,\n color: tokens.colorNeutralForeground2,\n textAlign: 'start',\n // remove this MQ once https://github.com/microsoft/fluentui/issues/28552 is resolved\n // media queries have zero specificity\n },\n enabled: {\n '@media (forced-colors: none)': {\n ':hover': {\n // Brand/M365/120\n ...shorthands.borderColor(tokens.colorBrandStroke2Hover),\n color: tokens.colorBrandForeground2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n // Figma states 'on hover and pressed state'\n ':active:hover': {\n // Brand/M365/120\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n color: tokens.colorBrandForeground2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n },\n },\n canvas: {\n ...typographyStyles.body1,\n paddingTop: tokens.spacingVerticalSNudge,\n paddingBottom: tokens.spacingVerticalSNudge,\n },\n});\n\nexport const useSuggestionStyles_unstable = (state: SuggestionState): SuggestionState => {\n 'use no memo';\n\n const styles = useSuggestionStylesStyles();\n state.root.className = mergeClasses(\n suggestionClassNames.root,\n styles.root,\n state.mode === 'canvas' && styles.canvas,\n !state.disabled && styles.enabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","suggestionClassNames","root","icon","useSuggestionStylesStyles","caption1","border","colorBrandStroke2","borderRadius","borderRadiusXLarge","padding","spacingVerticalXS","spacingVerticalS","color","colorNeutralForeground2","textAlign","enabled","borderColor","colorBrandStroke2Hover","colorBrandForeground2Hover","backgroundColor","colorBrandBackground2Hover","colorBrandStroke2Pressed","colorBrandForeground2Pressed","colorBrandBackground2Pressed","canvas","body1","paddingTop","spacingVerticalSNudge","paddingBottom","useSuggestionStyles_unstable","state","styles","className","mode","disabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAI5G,OAAO,MAAMC,uBAAoD;IAC/DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,MAAMC,4BAA4BR,WAAW;IAC3CM,MAAM;QACJ,GAAGF,iBAAiBK,QAAQ;QAC5B,kBAAkB;QAClB,GAAGP,WAAWQ,MAAM,CAAC,OAAO,SAASP,OAAOQ,iBAAiB,CAAC;QAC9DC,cAAcT,OAAOU,kBAAkB;QACvCC,SAAS,CAAC,EAAEX,OAAOY,iBAAiB,CAAC,CAAC,EAAEZ,OAAOa,gBAAgB,CAAC,CAAC;QACjEC,OAAOd,OAAOe,uBAAuB;QACrCC,WAAW;IAGb;IACAC,SAAS;QACP,gCAAgC;YAC9B,UAAU;gBACR,kBAAkB;gBAClB,GAAGlB,WAAWmB,WAAW,CAAClB,OAAOmB,sBAAsB,CAAC;gBACxDL,OAAOd,OAAOoB,0BAA0B;gBACxCC,iBAAiBrB,OAAOsB,0BAA0B;YACpD;YACA,4CAA4C;YAC5C,iBAAiB;gBACf,kBAAkB;gBAClB,GAAGvB,WAAWmB,WAAW,CAAClB,OAAOuB,wBAAwB,CAAC;gBAC1DT,OAAOd,OAAOwB,4BAA4B;gBAC1CH,iBAAiBrB,OAAOyB,4BAA4B;YACtD;QACF;IACF;IACAC,QAAQ;QACN,GAAGzB,iBAAiB0B,KAAK;QACzBC,YAAY5B,OAAO6B,qBAAqB;QACxCC,eAAe9B,OAAO6B,qBAAqB;IAC7C;AACF;AAEA,OAAO,MAAME,+BAA+B,CAACC;IAC3C;IAEA,MAAMC,SAAS5B;IACf2B,MAAM7B,IAAI,CAAC+B,SAAS,GAAGpC,aACrBI,qBAAqBC,IAAI,EACzB8B,OAAO9B,IAAI,EACX6B,MAAMG,IAAI,KAAK,YAAYF,OAAOP,MAAM,EACxC,CAACM,MAAMI,QAAQ,IAAIH,OAAOhB,OAAO,EACjCe,MAAM7B,IAAI,CAAC+B,SAAS;IAGtB,OAAOF;AACT,EAAE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __styles, mergeClasses,
|
|
1
|
+
import { __styles, mergeClasses, tokens } from '@fluentui/react-components';
|
|
2
2
|
export const suggestionListClassNames = {
|
|
3
3
|
root: 'fai-SuggestionList',
|
|
4
4
|
reload: 'fai-SuggestionList__reload',
|
|
@@ -13,12 +13,14 @@ const useStyles = __styles({
|
|
|
13
13
|
mc9l5x: "f22iagw",
|
|
14
14
|
Eh141a: "fni485r",
|
|
15
15
|
Brf1p80: "f9c4gz4",
|
|
16
|
-
i8kkvl:
|
|
17
|
-
Belr9w4:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
i8kkvl: 0,
|
|
17
|
+
Belr9w4: 0,
|
|
18
|
+
rmohyg: "f1yhwmi5",
|
|
19
|
+
jrapky: 0,
|
|
20
|
+
Frg6f3: 0,
|
|
21
|
+
t21cq0: 0,
|
|
22
|
+
B6of3ja: 0,
|
|
23
|
+
B74szlk: ["f4bgq6r", "f83tq75"],
|
|
22
24
|
Beptln2: "fr3gje9"
|
|
23
25
|
},
|
|
24
26
|
reload: {
|
|
@@ -30,7 +32,13 @@ const useStyles = __styles({
|
|
|
30
32
|
B2u0y6b: "f1cs043"
|
|
31
33
|
}
|
|
32
34
|
}, {
|
|
33
|
-
d: [".f22iagw{display:flex;}", ".fni485r{flex-wrap:wrap;}", ".f9c4gz4{justify-content:flex-end;}", ".
|
|
35
|
+
d: [".f22iagw{display:flex;}", ".fni485r{flex-wrap:wrap;}", ".f9c4gz4{justify-content:flex-end;}", [".f1yhwmi5{gap:var(--spacingVerticalS);}", {
|
|
36
|
+
p: -1
|
|
37
|
+
}], [".f4bgq6r{margin:var(--spacingVerticalNone) var(--spacingHorizontalNone) var(--spacingVerticalS) var(--spacingHorizontalNone);}", {
|
|
38
|
+
p: -1
|
|
39
|
+
}], [".f83tq75{margin:var(--spacingVerticalNone) var(--spacingHorizontalNone) var(--spacingVerticalS) var(--spacingHorizontalNone);}", {
|
|
40
|
+
p: -1
|
|
41
|
+
}], ".fr3gje9>:nth-last-of-type(2){max-width:calc(100% - var(--spacingHorizontalXXL) - var(--spacingVerticalS));}", ".f79feoa{min-width:var(--spacingHorizontalXXL);}", ".f1cs043{max-width:var(--spacingHorizontalXXL);}"]
|
|
34
42
|
});
|
|
35
43
|
/**
|
|
36
44
|
* Apply styling to the SuggestionList slots based on the state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSuggestionListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses,
|
|
1
|
+
{"version":3,"sources":["useSuggestionListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { SuggestionListSlots, SuggestionListState } from './SuggestionList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const suggestionListClassNames: SlotClassNames<SuggestionListSlots> = {\n root: 'fai-SuggestionList',\n reload: 'fai-SuggestionList__reload',\n reloadTooltip: 'fai-SuggestionList__reloadTooltip',\n action: 'fai-SuggestionList__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n gap: tokens.spacingVerticalS,\n margin: `\n ${tokens.spacingVerticalNone}\n ${tokens.spacingHorizontalNone}\n ${tokens.spacingVerticalS}\n ${tokens.spacingHorizontalNone}\n `,\n '> :nth-last-of-type(2)': {\n maxWidth: `calc(100% - ${tokens.spacingHorizontalXXL} - ${tokens.spacingVerticalS})`,\n },\n },\n reload: {\n minWidth: tokens.spacingHorizontalXXL,\n maxWidth: tokens.spacingHorizontalXXL,\n },\n\n action: {\n minWidth: tokens.spacingHorizontalXXL,\n maxWidth: tokens.spacingHorizontalXXL,\n },\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the SuggestionList slots based on the state\n */\nexport const useSuggestionListStyles_unstable = (state: SuggestionListState): SuggestionListState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(suggestionListClassNames.root, styles.root, state.root.className);\n\n if (state.reload) {\n state.reload.className = mergeClasses(suggestionListClassNames.reload, styles.reload, state.reload.className);\n }\n\n if (state.action) {\n state.action.className = mergeClasses(suggestionListClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","suggestionListClassNames","root","reload","reloadTooltip","action","useStyles","display","flexWrap","justifyContent","gap","spacingVerticalS","margin","spacingVerticalNone","spacingHorizontalNone","maxWidth","spacingHorizontalXXL","minWidth","useSuggestionListStyles_unstable","state","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI9E,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,QAAQ;IACRC,eAAe;IACfC,QAAQ;AACV,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYR,WAAW;IAC3BI,MAAM;QACJK,SAAS;QACTC,UAAU;QACVC,gBAAgB;QAChBC,KAAKV,OAAOW,gBAAgB;QAC5BC,QAAQ,CAAC;MACP,EAAEZ,OAAOa,mBAAmB,CAAC;MAC7B,EAAEb,OAAOc,qBAAqB,CAAC;MAC/B,EAAEd,OAAOW,gBAAgB,CAAC;MAC1B,EAAEX,OAAOc,qBAAqB,CAAC;IACjC,CAAC;QACD,0BAA0B;YACxBC,UAAU,CAAC,YAAY,EAAEf,OAAOgB,oBAAoB,CAAC,GAAG,EAAEhB,OAAOW,gBAAgB,CAAC,CAAC,CAAC;QACtF;IACF;IACAR,QAAQ;QACNc,UAAUjB,OAAOgB,oBAAoB;QACrCD,UAAUf,OAAOgB,oBAAoB;IACvC;IAEAX,QAAQ;QACNY,UAAUjB,OAAOgB,oBAAoB;QACrCD,UAAUf,OAAOgB,oBAAoB;IACvC;AAGF;AAEA;;CAEC,GACD,OAAO,MAAME,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,SAASd;IACfa,MAAMjB,IAAI,CAACmB,SAAS,GAAGtB,aAAaE,yBAAyBC,IAAI,EAAEkB,OAAOlB,IAAI,EAAEiB,MAAMjB,IAAI,CAACmB,SAAS;IAEpG,IAAIF,MAAMhB,MAAM,EAAE;QAChBgB,MAAMhB,MAAM,CAACkB,SAAS,GAAGtB,aAAaE,yBAAyBE,MAAM,EAAEiB,OAAOjB,MAAM,EAAEgB,MAAMhB,MAAM,CAACkB,SAAS;IAC9G;IAEA,IAAIF,MAAMd,MAAM,EAAE;QAChBc,MAAMd,MAAM,CAACgB,SAAS,GAAGtB,aAAaE,yBAAyBI,MAAM,EAAEe,OAAOf,MAAM,EAAEc,MAAMd,MAAM,CAACgB,SAAS;IAC9G;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -13,9 +13,10 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
|
13
13
|
const _useSuggestionStylesstyles = require("./useSuggestionStyles.styles");
|
|
14
14
|
const _reactcomponents = require("@fluentui/react-components");
|
|
15
15
|
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
16
|
+
const _useSuggestion = require("./useSuggestion");
|
|
16
17
|
const Suggestion = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
18
|
'use no memo';
|
|
18
|
-
const state = (0,
|
|
19
|
+
const state = (0, _useSuggestion.useSuggestion_unstable)(props, ref);
|
|
19
20
|
state.appearance = props.appearance || 'outline';
|
|
20
21
|
(0, _reactcomponents.useButtonStyles_unstable)(state);
|
|
21
22
|
(0, _useSuggestionStylesstyles.useSuggestionStyles_unstable)(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Suggestion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSuggestionStyles_unstable } from './useSuggestionStyles.styles';\nimport type {
|
|
1
|
+
{"version":3,"sources":["Suggestion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSuggestionStyles_unstable } from './useSuggestionStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { renderButton_unstable, useButtonStyles_unstable } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\nimport { useSuggestion_unstable } from './useSuggestion';\nimport type { SuggestionProps } from './Suggestion.types';\n\n// Suggestion component - TODO: add more docs\nexport const Suggestion: ForwardRefComponent<SuggestionProps> = React.forwardRef((props, ref) => {\n 'use no memo';\n\n const state = useSuggestion_unstable(props, ref);\n state.appearance = props.appearance || 'outline';\n useButtonStyles_unstable(state);\n useSuggestionStyles_unstable(state);\n useCustomStyleHook('useSuggestionStyles')(state);\n\n return renderButton_unstable(state);\n});\n\nSuggestion.displayName = 'Suggestion';\n"],"names":["Suggestion","React","forwardRef","props","state","appearance","ref","useButtonStyles_unstable","useSuggestionStyles_unstable","renderButton_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;2CACsB;iCAEmB;+BAC7B;+BACI;AAIhC,MAAMA,aAAAA,WAAAA,GAAAA,OAAmDC,UAAMC,CAAU,CAACC,OAACA;;UAIhFC,QAAMC,IAAAA,qCAAmBA,EAAUF,OAAIG;UACvCC,UAAAA,GAAAA,MAAAA,UAAyBH,IAAAA;iDACzBI,EAAAA;+DACmB,EAAAJ;yCAEZK,EAAAA,uBAAsBL;IAC/B,OAAGK,IAAAA,sCAAA,EAAAL;AAEHJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Suggestion.types.ts"],"sourcesContent":["import type { CopilotMode } from '@fluentui-copilot/react-provider';\nimport type { ButtonProps, ButtonSlots, ButtonState, ComponentProps, ComponentState } from '@fluentui/react-components';\n\nexport type SuggestionSlots = ButtonSlots;\n\nexport type SuggestionProps = CopilotMode & ComponentProps<SuggestionSlots> & Omit<ButtonProps, keyof ButtonSlots>;\n\nexport type SuggestionState = ComponentState<SuggestionSlots> &\n Required<Pick<SuggestionProps, 'mode'>> &\n Omit<ButtonState, keyof ButtonSlots>;\n"],"names":[],"rangeMappings":"","mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useSuggestion_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useSuggestion_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
12
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
13
|
+
const useSuggestion_unstable = (props, ref)=>{
|
|
14
|
+
const buttonState = (0, _reactcomponents.useButton_unstable)(props, ref);
|
|
15
|
+
const mode = (0, _reactprovider.useCopilotMode)(props.mode);
|
|
16
|
+
return {
|
|
17
|
+
...buttonState,
|
|
18
|
+
mode
|
|
19
|
+
};
|
|
20
|
+
}; //# sourceMappingURL=useSuggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useSuggestion.ts"],"sourcesContent":["import { useButton_unstable } from '@fluentui/react-components';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\nimport type { SuggestionProps } from './Suggestion.types';\n\nexport const useSuggestion_unstable = (\n props: SuggestionProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n) => {\n const buttonState = useButton_unstable(props, ref);\n const mode = useCopilotMode(props.mode);\n return { ...buttonState, mode };\n};\n"],"names":["useSuggestion_unstable","props","ref","buttonState","useButton_unstable","mode","useCopilotMode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;iCAJsB;+BACJ;AAGxB,MAAMA,yBAAyB,CACpCC,OACAC;UAEAC,cAAMA,IAAAA,mCAAcC,EAAAA,OAAmBH;UACvCI,OAAMA,IAAAA,6BAAOC,EAAAA,MAAeL,IAAMI;WAClC;sBAAYF;;;AACd"}
|
|
@@ -57,32 +57,16 @@ const useSuggestionStylesStyles = (0, _reactcomponents.__styles)({
|
|
|
57
57
|
"f1sl6hi9",
|
|
58
58
|
"f1c8dzaj"
|
|
59
59
|
],
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"f8yange"
|
|
71
|
-
],
|
|
72
|
-
Btl43ni: [
|
|
73
|
-
"f8yange",
|
|
74
|
-
"f1el4m67"
|
|
75
|
-
],
|
|
76
|
-
z8tnut: "f1ywm7hm",
|
|
77
|
-
z189sj: [
|
|
78
|
-
"f1yjm1ar",
|
|
79
|
-
"f1egtk6x"
|
|
80
|
-
],
|
|
81
|
-
Byoj8tv: "f14wxoun",
|
|
82
|
-
uwmqm3: [
|
|
83
|
-
"f1egtk6x",
|
|
84
|
-
"f1yjm1ar"
|
|
85
|
-
],
|
|
60
|
+
Beyfa6y: 0,
|
|
61
|
+
Bbmb7ep: 0,
|
|
62
|
+
Btl43ni: 0,
|
|
63
|
+
B7oj6ja: 0,
|
|
64
|
+
Dimara: "f1kijzfu",
|
|
65
|
+
Byoj8tv: 0,
|
|
66
|
+
uwmqm3: 0,
|
|
67
|
+
z189sj: 0,
|
|
68
|
+
z8tnut: 0,
|
|
69
|
+
B0ocmuz: "fcca7b8",
|
|
86
70
|
sj55zd: "fkfq4zb",
|
|
87
71
|
fsow6f: "fpgzoln"
|
|
88
72
|
},
|
|
@@ -111,6 +95,14 @@ const useSuggestionStylesStyles = (0, _reactcomponents.__styles)({
|
|
|
111
95
|
],
|
|
112
96
|
a9g2gr: "fezean8",
|
|
113
97
|
rgbxn1: "f1yr11xb"
|
|
98
|
+
},
|
|
99
|
+
canvas: {
|
|
100
|
+
Bahqtrf: "fk6fouc",
|
|
101
|
+
Be2twd7: "fkhj508",
|
|
102
|
+
Bhrd7zp: "figsok6",
|
|
103
|
+
Bg96gwp: "f1i3iumi",
|
|
104
|
+
z8tnut: "fp2oml8",
|
|
105
|
+
Byoj8tv: "f1tdddsa"
|
|
114
106
|
}
|
|
115
107
|
}, {
|
|
116
108
|
d: [
|
|
@@ -130,16 +122,24 @@ const useSuggestionStylesStyles = (0, _reactcomponents.__styles)({
|
|
|
130
122
|
".f1c8dzaj{border-right-color:var(--colorBrandStroke2);}",
|
|
131
123
|
".f1sl6hi9{border-left-color:var(--colorBrandStroke2);}",
|
|
132
124
|
".f1619yhw{border-bottom-color:var(--colorBrandStroke2);}",
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
[
|
|
126
|
+
".f1kijzfu{border-radius:var(--borderRadiusXLarge);}",
|
|
127
|
+
{
|
|
128
|
+
p: -1
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
".fcca7b8{padding:var(--spacingVerticalXS) var(--spacingVerticalS);}",
|
|
133
|
+
{
|
|
134
|
+
p: -1
|
|
135
|
+
}
|
|
136
|
+
],
|
|
141
137
|
".fkfq4zb{color:var(--colorNeutralForeground2);}",
|
|
142
|
-
".fpgzoln{text-align:start;}"
|
|
138
|
+
".fpgzoln{text-align:start;}",
|
|
139
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
140
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}",
|
|
141
|
+
".fp2oml8{padding-top:var(--spacingVerticalSNudge);}",
|
|
142
|
+
".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}"
|
|
143
143
|
],
|
|
144
144
|
m: [
|
|
145
145
|
[
|
|
@@ -207,6 +207,6 @@ const useSuggestionStylesStyles = (0, _reactcomponents.__styles)({
|
|
|
207
207
|
const useSuggestionStyles_unstable = (state)=>{
|
|
208
208
|
'use no memo';
|
|
209
209
|
const styles = useSuggestionStylesStyles();
|
|
210
|
-
state.root.className = (0, _reactcomponents.mergeClasses)(suggestionClassNames.root, styles.root, !state.disabled && styles.enabled, state.root.className);
|
|
210
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(suggestionClassNames.root, styles.root, state.mode === 'canvas' && styles.canvas, !state.disabled && styles.enabled, state.root.className);
|
|
211
211
|
return state;
|
|
212
212
|
}; //# sourceMappingURL=useSuggestionStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSuggestionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { SlotClassNames, ButtonSlots
|
|
1
|
+
{"version":3,"sources":["useSuggestionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { SlotClassNames, ButtonSlots } from '@fluentui/react-components';\nimport type { SuggestionState } from './Suggestion.types';\n\nexport const suggestionClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fai-Suggestion',\n icon: 'fai-Suggestion__icon',\n};\n\nconst useSuggestionStylesStyles = makeStyles({\n root: {\n ...typographyStyles.caption1,\n // Brand/M365/140\n ...shorthands.border('1px', 'solid', tokens.colorBrandStroke2),\n borderRadius: tokens.borderRadiusXLarge,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingVerticalS}`,\n color: tokens.colorNeutralForeground2,\n textAlign: 'start',\n // remove this MQ once https://github.com/microsoft/fluentui/issues/28552 is resolved\n // media queries have zero specificity\n },\n enabled: {\n '@media (forced-colors: none)': {\n ':hover': {\n // Brand/M365/120\n ...shorthands.borderColor(tokens.colorBrandStroke2Hover),\n color: tokens.colorBrandForeground2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n // Figma states 'on hover and pressed state'\n ':active:hover': {\n // Brand/M365/120\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n color: tokens.colorBrandForeground2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n },\n },\n canvas: {\n ...typographyStyles.body1,\n paddingTop: tokens.spacingVerticalSNudge,\n paddingBottom: tokens.spacingVerticalSNudge,\n },\n});\n\nexport const useSuggestionStyles_unstable = (state: SuggestionState): SuggestionState => {\n 'use no memo';\n\n const styles = useSuggestionStylesStyles();\n state.root.className = mergeClasses(\n suggestionClassNames.root,\n styles.root,\n state.mode === 'canvas' && styles.canvas,\n !state.disabled && styles.enabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["suggestionClassNames","root","icon","useSuggestionStylesStyles","makeStyles","typographyStyles","shorthands","borderRadius","padding","color","colorNeutralForeground2","textAlign","ibv6hh","enabled","tokens","colorBrandForeground2Hover","z8tnut","canvas","paddingTop","B9di4we","B1f0e9u","useSuggestionStyles_unstable","bb0oo","B88lpqa","styles","state","Bejlia0","v5djml"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,oBAAAA;eAAAA;;;;;;iCAJ0D;AAIhE,MAAMA,uBAAoD;UAC/DC;UACAC;AACF;AAEA,MAAMC,4BAA4BC,IAAAA,yBAAAA,EAAAA;UAChCH;iBACKI;iBACH;iBACGC;iBACHC;iBACAC;iBACAC;YAAAA;YAAcC;SAAAA;iBACdC;QAGFC,QAAA;YAAA;YAAA;SAAA;QACAC,QAAAA;gBACE;YAAA;YAAA;SAAA;gBACE;;;YACE;SAAkB;;;;YAEXC;SAAOC;;gBAEhB;YAAA;YAAA;SAAA;iBACA;iBACA;;;;;gBAKA;gBACF;QACFC,QAAA;QACAC,SAAQ;gBACHZ;gBACHa;;aAEF;QACFC,SAAA;QAEAC,SAAaC;YAAAA;YAAAA;SAAAA;QACXC,OAAA;QAEAC,SAAMC;YAAAA;YAASrB;SAAAA;QACfsB,QAAMxB;QAQNyB,SAAOD;QACPE,QAAA"}
|
|
@@ -30,17 +30,16 @@ const suggestionListClassNames = {
|
|
|
30
30
|
mc9l5x: "f22iagw",
|
|
31
31
|
Eh141a: "fni485r",
|
|
32
32
|
Brf1p80: "f9c4gz4",
|
|
33
|
-
i8kkvl:
|
|
34
|
-
Belr9w4:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"f1osuteh"
|
|
33
|
+
i8kkvl: 0,
|
|
34
|
+
Belr9w4: 0,
|
|
35
|
+
rmohyg: "f1yhwmi5",
|
|
36
|
+
jrapky: 0,
|
|
37
|
+
Frg6f3: 0,
|
|
38
|
+
t21cq0: 0,
|
|
39
|
+
B6of3ja: 0,
|
|
40
|
+
B74szlk: [
|
|
41
|
+
"f4bgq6r",
|
|
42
|
+
"f83tq75"
|
|
44
43
|
],
|
|
45
44
|
Beptln2: "fr3gje9"
|
|
46
45
|
},
|
|
@@ -57,12 +56,24 @@ const suggestionListClassNames = {
|
|
|
57
56
|
".f22iagw{display:flex;}",
|
|
58
57
|
".fni485r{flex-wrap:wrap;}",
|
|
59
58
|
".f9c4gz4{justify-content:flex-end;}",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
[
|
|
60
|
+
".f1yhwmi5{gap:var(--spacingVerticalS);}",
|
|
61
|
+
{
|
|
62
|
+
p: -1
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
".f4bgq6r{margin:var(--spacingVerticalNone) var(--spacingHorizontalNone) var(--spacingVerticalS) var(--spacingHorizontalNone);}",
|
|
67
|
+
{
|
|
68
|
+
p: -1
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
".f83tq75{margin:var(--spacingVerticalNone) var(--spacingHorizontalNone) var(--spacingVerticalS) var(--spacingHorizontalNone);}",
|
|
73
|
+
{
|
|
74
|
+
p: -1
|
|
75
|
+
}
|
|
76
|
+
],
|
|
66
77
|
".fr3gje9>:nth-last-of-type(2){max-width:calc(100% - var(--spacingHorizontalXXL) - var(--spacingVerticalS));}",
|
|
67
78
|
".f79feoa{min-width:var(--spacingHorizontalXXL);}",
|
|
68
79
|
".f1cs043{max-width:var(--spacingHorizontalXXL);}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSuggestionListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses,
|
|
1
|
+
{"version":3,"sources":["useSuggestionListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { SuggestionListSlots, SuggestionListState } from './SuggestionList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const suggestionListClassNames: SlotClassNames<SuggestionListSlots> = {\n root: 'fai-SuggestionList',\n reload: 'fai-SuggestionList__reload',\n reloadTooltip: 'fai-SuggestionList__reloadTooltip',\n action: 'fai-SuggestionList__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n gap: tokens.spacingVerticalS,\n margin: `\n ${tokens.spacingVerticalNone}\n ${tokens.spacingHorizontalNone}\n ${tokens.spacingVerticalS}\n ${tokens.spacingHorizontalNone}\n `,\n '> :nth-last-of-type(2)': {\n maxWidth: `calc(100% - ${tokens.spacingHorizontalXXL} - ${tokens.spacingVerticalS})`,\n },\n },\n reload: {\n minWidth: tokens.spacingHorizontalXXL,\n maxWidth: tokens.spacingHorizontalXXL,\n },\n\n action: {\n minWidth: tokens.spacingHorizontalXXL,\n maxWidth: tokens.spacingHorizontalXXL,\n },\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the SuggestionList slots based on the state\n */\nexport const useSuggestionListStyles_unstable = (state: SuggestionListState): SuggestionListState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(suggestionListClassNames.root, styles.root, state.root.className);\n\n if (state.reload) {\n state.reload.className = mergeClasses(suggestionListClassNames.reload, styles.reload, state.reload.className);\n }\n\n if (state.action) {\n state.action.className = mergeClasses(suggestionListClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"names":["suggestionListClassNames","useSuggestionListStyles_unstable","root","reload","reloadTooltip","action","__styles","display","flexWrap","justifyContent","tokens","margin","t21cq0","maxWidth","minWidth","d","state","p","useStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,wBAAAA;eAAAA;;IAsDXC,gCAAA;eAAAA;;;iCA1DuC;AAIlC,MAAMD,2BAAgE;UAC3EE;YACAC;mBACAC;YACAC;AACF;AAEA;;CAEC,SAECH,YAAMI,IAAAA,yBAAA,EAAA;UACJC;gBACAC;gBACAC;iBACKC;gBACLC;iBACID;gBACAA;gBACAA;gBACAA;QACJE,QAAC;iBACD;iBACEC;YAAAA;YAAW;SAAY;iBACzB;;YAEFV;iBACEW;iBACAD;;YAGFR;iBACES;iBACAD;;AAIJ,GAAA;IAEAE,GAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;;YAEC;SACD;QAAA;YAAA;YAAiDC;gBAC/CC,GAAA,CAAA;;SAEA;QAAA;YAAA;YAAeC;gBACfF,GAAAA,CAAAA;;SAEA;QAAA;QAAkB;QAAA;KAAA;;AAMlB,MAAAf,mCAAAe,CAAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-suggestions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "A Fluent AI package",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/react-provider": "^0.
|
|
15
|
+
"@fluentui-copilot/react-provider": "^0.9.1",
|
|
16
16
|
"@swc/helpers": "^0.5.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@fluentui/react-components": ">=9.54.
|
|
20
|
-
"@fluentui/react-context-selector": ">=9.1.
|
|
19
|
+
"@fluentui/react-components": ">=9.54.10 <10.0.0",
|
|
20
|
+
"@fluentui/react-context-selector": ">=9.1.65 <10.0.0",
|
|
21
21
|
"@fluentui/react-icons": ">=2.0.247 <3.0.0",
|
|
22
|
-
"@fluentui/react-jsx-runtime": ">=9.0.
|
|
23
|
-
"@fluentui/react-shared-contexts": ">=9.
|
|
24
|
-
"@fluentui/react-utilities": ">=9.18.
|
|
22
|
+
"@fluentui/react-jsx-runtime": ">=9.0.42 <10.0.0",
|
|
23
|
+
"@fluentui/react-shared-contexts": ">=9.20.0 <10.0.0",
|
|
24
|
+
"@fluentui/react-utilities": ">=9.18.13 <10.0.0",
|
|
25
25
|
"@types/react": ">=16.14.0 <19.0.0",
|
|
26
26
|
"@types/react-dom": ">=16.9.8 <19.0.0",
|
|
27
27
|
"react": ">=16.14.0 <19.0.0",
|