@fluentui-copilot/react-prompt-starter 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +37 -1
- package/CHANGELOG.md +21 -2
- package/lib/PromptStarter.js +0 -1
- package/lib/PromptStarterList.js +0 -1
- package/lib/PromptStarterV2.js +0 -1
- package/lib/components/PromptStarter/PromptStarter.js +5 -6
- package/lib/components/PromptStarter/PromptStarter.types.js +1 -2
- package/lib/components/PromptStarter/index.js +0 -1
- package/lib/components/PromptStarter/renderPromptStarter.js +16 -9
- package/lib/components/PromptStarter/usePromptStarter.js +42 -44
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +94 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +5 -6
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +1 -2
- package/lib/components/PromptStarterV2/PromptStarter/index.js +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +61 -50
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +15 -9
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +49 -51
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +119 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +5 -6
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +1 -2
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +15 -14
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +97 -97
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +4 -7
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +61 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib/contexts/PromptStarterListContext.js +2 -3
- package/lib/index.js +0 -1
- package/lib-commonjs/PromptStarter.js +0 -1
- package/lib-commonjs/PromptStarterList.js +0 -1
- package/lib-commonjs/PromptStarterV2.js +0 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +0 -1
- package/lib-commonjs/components/PromptStarter/index.js +0 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js +112 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +137 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +77 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js +1 -1
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -1
- package/package.json +9 -9
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-prompt-starter",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 17 Jul 2025 17:47:34 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-prompt-starter_v0.10.3",
|
|
7
|
+
"version": "0.10.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "hochelmartin@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-prompt-starter",
|
|
13
|
+
"commit": "fef5160c07333e8d9996952a305b34e357604919",
|
|
14
|
+
"comment": "feat: enable griffel raw styles"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 01 Jul 2025 14:45:29 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-prompt-starter_v0.10.2",
|
|
22
|
+
"version": "0.10.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "jiangemma@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-prompt-starter",
|
|
28
|
+
"commit": "93c39ced303a2ffdb20764a1d1a1595a12b4ae27",
|
|
29
|
+
"comment": "chore: Bump v9 to 9.66.0 dependency deduplication followup"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "jiangemma@microsoft.com",
|
|
33
|
+
"package": "@fluentui-copilot/react-prompt-starter",
|
|
34
|
+
"commit": "c9607d83ec7c4f592e563a391e0e7fa87af24929",
|
|
35
|
+
"comment": "Bump v9 to ^9.66.0"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Tue, 24 Jun 2025 22:22:05 GMT",
|
|
6
42
|
"tag": "@fluentui-copilot/react-prompt-starter_v0.10.1",
|
|
7
43
|
"version": "0.10.1",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-prompt-starter
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Jul 2025 17:47:34 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.10.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.10.3)
|
|
8
|
+
|
|
9
|
+
Thu, 17 Jul 2025 17:47:34 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.10.2..@fluentui-copilot/react-prompt-starter_v0.10.3)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- feat: enable griffel raw styles ([PR #3227](https://github.com/microsoft/fluentai/pull/3227) by hochelmartin@gmail.com)
|
|
15
|
+
|
|
16
|
+
## [0.10.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.10.2)
|
|
17
|
+
|
|
18
|
+
Tue, 01 Jul 2025 14:45:29 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.10.1..@fluentui-copilot/react-prompt-starter_v0.10.2)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- chore: Bump v9 to 9.66.0 dependency deduplication followup ([PR #3176](https://github.com/microsoft/fluentai/pull/3176) by jiangemma@microsoft.com)
|
|
24
|
+
- Bump v9 to ^9.66.0 ([PR #3169](https://github.com/microsoft/fluentai/pull/3169) by jiangemma@microsoft.com)
|
|
25
|
+
|
|
7
26
|
## [0.10.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.10.1)
|
|
8
27
|
|
|
9
|
-
Tue, 24 Jun 2025 22:
|
|
28
|
+
Tue, 24 Jun 2025 22:22:05 GMT
|
|
10
29
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.10.0..@fluentui-copilot/react-prompt-starter_v0.10.1)
|
|
11
30
|
|
|
12
31
|
### Patches
|
package/lib/PromptStarter.js
CHANGED
package/lib/PromptStarterList.js
CHANGED
package/lib/PromptStarterV2.js
CHANGED
|
@@ -3,11 +3,10 @@ import { usePromptStarter_unstable } from './usePromptStarter';
|
|
|
3
3
|
import { renderPromptStarter_unstable } from './renderPromptStarter';
|
|
4
4
|
import { usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';
|
|
5
5
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
-
export const PromptStarter = /*#__PURE__*/React.forwardRef((props, ref)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const PromptStarter = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
+
const state = usePromptStarter_unstable(props, ref);
|
|
8
|
+
usePromptStarterStyles_unstable(state);
|
|
9
|
+
useCustomStyleHook('usePromptStarterStyles')(state);
|
|
10
|
+
return renderPromptStarter_unstable(state);
|
|
11
11
|
});
|
|
12
12
|
PromptStarter.displayName = 'PromptStarter';
|
|
13
|
-
//# sourceMappingURL=PromptStarter.js.map
|
|
@@ -2,4 +2,3 @@ export { PromptStarter } from './PromptStarter';
|
|
|
2
2
|
export { renderPromptStarter_unstable } from './renderPromptStarter';
|
|
3
3
|
export { usePromptStarter_unstable } from './usePromptStarter';
|
|
4
4
|
export { promptStarterClassNames, usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
-
export const renderPromptStarter_unstable = state
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export const renderPromptStarter_unstable = (state)=>{
|
|
4
|
+
assertSlots(state);
|
|
5
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
|
6
|
+
children: [
|
|
7
|
+
/*#__PURE__*/ _jsx(state.icon, {}),
|
|
8
|
+
/*#__PURE__*/ _jsxs(state.category, {
|
|
9
|
+
children: [
|
|
10
|
+
state.category.children,
|
|
11
|
+
" ",
|
|
12
|
+
state.badge && /*#__PURE__*/ _jsx(state.badge, {})
|
|
13
|
+
]
|
|
14
|
+
}),
|
|
15
|
+
state.prompt && /*#__PURE__*/ _jsx(state.prompt, {})
|
|
16
|
+
]
|
|
17
|
+
});
|
|
10
18
|
};
|
|
11
|
-
//# sourceMappingURL=renderPromptStarter.js.map
|
|
@@ -8,48 +8,46 @@ import { Badge, getIntrinsicElementProps, slot, useId } from '@fluentui/react-co
|
|
|
8
8
|
*
|
|
9
9
|
* @param props - props from this instance of PromptStarter
|
|
10
10
|
* @param ref - reference to root HTMLElement of PromptStarter
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
11
|
+
*/ export const usePromptStarter_unstable = (props, ref)=>{
|
|
12
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
13
|
+
const idPrefix = useId('prompt-starter');
|
|
14
|
+
return {
|
|
15
|
+
components: {
|
|
16
|
+
root: 'button',
|
|
17
|
+
icon: 'span',
|
|
18
|
+
category: 'span',
|
|
19
|
+
prompt: 'span',
|
|
20
|
+
badge: Badge
|
|
21
|
+
},
|
|
22
|
+
root: slot.always(getIntrinsicElementProps('button', {
|
|
23
|
+
ref,
|
|
24
|
+
'aria-labelledby': `${idPrefix}-category`,
|
|
25
|
+
'aria-describedby': `${idPrefix}-prompt`,
|
|
26
|
+
...props
|
|
27
|
+
}), {
|
|
28
|
+
elementType: 'button'
|
|
29
|
+
}),
|
|
30
|
+
icon: slot.always(props.icon, {
|
|
31
|
+
elementType: 'span'
|
|
32
|
+
}),
|
|
33
|
+
category: slot.always(props.category, {
|
|
34
|
+
defaultProps: {
|
|
35
|
+
id: `${idPrefix}-category`
|
|
36
|
+
},
|
|
37
|
+
elementType: 'span'
|
|
38
|
+
}),
|
|
39
|
+
prompt: slot.optional(props.prompt, {
|
|
40
|
+
defaultProps: {
|
|
41
|
+
id: `${idPrefix}-prompt`
|
|
42
|
+
},
|
|
43
|
+
elementType: 'span'
|
|
44
|
+
}),
|
|
45
|
+
badge: slot.optional(props.badge, {
|
|
46
|
+
defaultProps: {
|
|
47
|
+
appearance: 'tint'
|
|
48
|
+
},
|
|
49
|
+
elementType: Badge
|
|
50
|
+
}),
|
|
51
|
+
designVersion
|
|
52
|
+
};
|
|
54
53
|
};
|
|
55
|
-
//# sourceMappingURL=usePromptStarter.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { makeStyles, makeResetStyles, mergeClasses, shorthands, typographyStyles, createFocusOutlineStyle } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const promptStarterClassNames = {
|
|
4
|
+
root: 'fai-PromptStarter',
|
|
5
|
+
category: 'fai-PromptStarter__category',
|
|
6
|
+
icon: 'fai-PromptStarter__icon',
|
|
7
|
+
prompt: 'fai-PromptStarter__prompt',
|
|
8
|
+
badge: 'fai-PromptStarter__badge'
|
|
9
|
+
};
|
|
10
|
+
const useRootResetStyles = makeResetStyles({
|
|
11
|
+
position: 'relative',
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gridTemplateColumns: 'auto 1fr',
|
|
14
|
+
gridTemplateRows: 'auto auto',
|
|
15
|
+
gridTemplateAreas: `
|
|
16
|
+
"icon category"
|
|
17
|
+
". prompt"
|
|
18
|
+
`,
|
|
19
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
20
|
+
color: tokens.colorNeutralForeground1,
|
|
21
|
+
fontFamily: tokens.fontFamilyBase,
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
outlineStyle: 'none',
|
|
24
|
+
textAlign: 'left',
|
|
25
|
+
gap: '0px 8px',
|
|
26
|
+
padding: '6px 8px 8px 8px',
|
|
27
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),
|
|
28
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
29
|
+
'&:hover': {
|
|
30
|
+
backgroundColor: tokens.colorNeutralBackground1Hover,
|
|
31
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover)
|
|
32
|
+
},
|
|
33
|
+
'&:active': {
|
|
34
|
+
backgroundColor: tokens.colorNeutralBackground1Pressed,
|
|
35
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed)
|
|
36
|
+
},
|
|
37
|
+
...createFocusOutlineStyle()
|
|
38
|
+
});
|
|
39
|
+
const useStyles = makeStyles({
|
|
40
|
+
disabled: {
|
|
41
|
+
cursor: 'not-allowed',
|
|
42
|
+
backgroundColor: tokens.colorNeutralBackgroundDisabled,
|
|
43
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),
|
|
44
|
+
'&:hover': {
|
|
45
|
+
backgroundColor: tokens.colorNeutralBackgroundDisabled,
|
|
46
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled)
|
|
47
|
+
},
|
|
48
|
+
'&:active': {
|
|
49
|
+
backgroundColor: tokens.colorNeutralBackgroundDisabled,
|
|
50
|
+
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
icon: {
|
|
54
|
+
gridArea: 'icon',
|
|
55
|
+
display: 'flex',
|
|
56
|
+
alignSelf: 'center'
|
|
57
|
+
},
|
|
58
|
+
category: {
|
|
59
|
+
...typographyStyles.body1Strong,
|
|
60
|
+
gridArea: 'category'
|
|
61
|
+
},
|
|
62
|
+
prompt: {
|
|
63
|
+
...typographyStyles.body1,
|
|
64
|
+
gridArea: 'prompt'
|
|
65
|
+
},
|
|
66
|
+
disabledText: {
|
|
67
|
+
color: tokens.colorNeutralForegroundDisabled
|
|
68
|
+
},
|
|
69
|
+
disabledBadge: {
|
|
70
|
+
opacity: '40%'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const useNextStyles = makeStyles({
|
|
74
|
+
root: {
|
|
75
|
+
borderRadius: tokens.borderRadiusXLarge
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export const usePromptStarterStyles_unstable = (state)=>{
|
|
79
|
+
'use no memo';
|
|
80
|
+
const { designVersion } = state;
|
|
81
|
+
const styles = useStyles();
|
|
82
|
+
const nextStyles = useNextStyles();
|
|
83
|
+
const rootResetStyles = useRootResetStyles();
|
|
84
|
+
state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, designVersion === 'next' && nextStyles.root, state.root.disabled && styles.disabled, state.root.className);
|
|
85
|
+
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.root.disabled && styles.disabledText, state.icon.className);
|
|
86
|
+
state.category.className = mergeClasses(promptStarterClassNames.category, styles.category, state.category.className, state.root.disabled && styles.disabledText);
|
|
87
|
+
if (state.prompt) {
|
|
88
|
+
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, state.root.disabled && styles.disabledText, state.prompt.className);
|
|
89
|
+
}
|
|
90
|
+
if (state.badge) {
|
|
91
|
+
state.badge.className = mergeClasses(promptStarterClassNames.badge, state.root.disabled && styles.disabledBadge, state.badge.className);
|
|
92
|
+
}
|
|
93
|
+
return state;
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n category: 'fai-PromptStarter__category',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n badge: 'fai-PromptStarter__badge',\n};\n\nconst useRootResetStyles = makeResetStyles({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n \"icon category\"\n \". prompt\"\n `,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n gap: '0px 8px',\n padding: '6px 8px 8px 8px',\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusMedium,\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1Pressed),\n },\n ...createFocusOutlineStyle(),\n});\n\nconst useStyles = makeStyles({\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n '&:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStrokeDisabled),\n },\n },\n icon: { gridArea: 'icon', display: 'flex', alignSelf: 'center' },\n\n category: {\n ...typographyStyles.body1Strong,\n gridArea: 'category',\n },\n prompt: { ...typographyStyles.body1, gridArea: 'prompt' },\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n disabledBadge: {\n opacity: '40%',\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(\n promptStarterClassNames.root,\n rootResetStyles,\n designVersion === 'next' && nextStyles.root,\n state.root.disabled && styles.disabled,\n state.root.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n state.root.disabled && styles.disabledText,\n state.icon.className,\n );\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n state.root.disabled && styles.disabledText,\n );\n if (state.prompt) {\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n state.root.disabled && styles.disabledText,\n state.prompt.className,\n );\n }\n if (state.badge) {\n state.badge.className = mergeClasses(\n promptStarterClassNames.badge,\n state.root.disabled && styles.disabledBadge,\n state.badge.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","category","icon","prompt","badge","useRootResetStyles","position","display","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground1","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","gap","padding","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","useStyles","disabled","colorNeutralBackgroundDisabled","colorNeutralStrokeDisabled","gridArea","alignSelf","body1Strong","body1","disabledText","colorNeutralForegroundDisabled","disabledBadge","opacity","useNextStyles","borderRadiusXLarge","usePromptStarterStyles_unstable","state","designVersion","styles","nextStyles","rootResetStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,UAAU;IACVC,MAAM;IACNC,QAAQ;IACRC,OAAO;AACT,EAAE;AAEF,MAAMC,qBAAqBZ,gBAAgB;IACzCa,UAAU;IACVC,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,mBAAmB,CAAC;;;EAGpB,CAAC;IACDC,iBAAiBb,OAAOc,uBAAuB;IAC/CC,OAAOf,OAAOgB,uBAAuB;IACrCC,YAAYjB,OAAOkB,cAAc;IACjCC,QAAQ;IACRC,cAAc;IACdC,WAAW;IACXC,KAAK;IACLC,SAAS;IACT,GAAG1B,WAAW2B,MAAM,CAACxB,OAAOyB,eAAe,EAAE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_unstable } from './renderPromptStarter';
|
|
4
4
|
import { usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';
|
|
5
5
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
-
export const PromptStarter = /*#__PURE__*/React.forwardRef((props, ref)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const PromptStarter = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
+
const state = usePromptStarter_unstable(props, ref);
|
|
8
|
+
usePromptStarterStyles_unstable(state);
|
|
9
|
+
useCustomStyleHook('usePromptStarterStyles')(state);
|
|
10
|
+
return renderPromptStarter_unstable(state);
|
|
11
11
|
});
|
|
12
12
|
PromptStarter.displayName = 'PromptStarter';
|
|
13
|
-
//# sourceMappingURL=PromptStarter.js.map
|
|
@@ -2,4 +2,3 @@ export { PromptStarter } from './PromptStarter';
|
|
|
2
2
|
export { renderPromptStarter_unstable } from './renderPromptStarter';
|
|
3
3
|
export { usePromptStarter_unstable } from './usePromptStarter';
|
|
4
4
|
export { promptStarterClassNames, usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,52 +1,63 @@
|
|
|
1
1
|
import { createPresenceComponent } from '@fluentui/react-components';
|
|
2
|
-
export const PromptStarterMotion = createPresenceComponent(({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
export const PromptStarterMotion = createPresenceComponent(({ index, numberOfColumns })=>{
|
|
3
|
+
const isFirstRow = index < numberOfColumns;
|
|
4
|
+
const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;
|
|
5
|
+
const opacityDuration = 100;
|
|
6
|
+
const opacityOffset = delay / (delay + opacityDuration);
|
|
7
|
+
const opacityEasing = 'linear';
|
|
8
|
+
const scaleDuration = 500;
|
|
9
|
+
const scaleOffset = delay / (delay + scaleDuration);
|
|
10
|
+
const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;
|
|
11
|
+
const opacityExitDuration = 200;
|
|
12
|
+
return {
|
|
13
|
+
enter: [
|
|
14
|
+
{
|
|
15
|
+
keyframes: [
|
|
16
|
+
{
|
|
17
|
+
opacity: 0
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
opacity: 0,
|
|
21
|
+
offset: opacityOffset
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
opacity: 1
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
easing: opacityEasing,
|
|
28
|
+
duration: opacityDuration + delay
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
keyframes: [
|
|
32
|
+
{
|
|
33
|
+
transform: 'scale(0.9)'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
transform: 'scale(0.9)',
|
|
37
|
+
offset: scaleOffset
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
transform: 'scale(1)'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
easing: scaleEasing,
|
|
44
|
+
duration: scaleDuration + delay
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
exit: {
|
|
48
|
+
keyframes: [
|
|
49
|
+
{
|
|
50
|
+
opacity: 1
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
opacity: 1
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
opacity: 0
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
easing: opacityEasing,
|
|
60
|
+
duration: opacityExitDuration
|
|
61
|
+
}
|
|
62
|
+
};
|
|
51
63
|
});
|
|
52
|
-
//# sourceMappingURL=promptStarterMotion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["promptStarterMotion.ts"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-components';\n\nexport type PromptStarterMotionParams = { index: number; numberOfColumns: number };\n\nexport const PromptStarterMotion
|
|
1
|
+
{"version":3,"sources":["promptStarterMotion.ts"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-components';\n\nexport type PromptStarterMotionParams = { index: number; numberOfColumns: number };\n\nexport const PromptStarterMotion: ReturnType<typeof createPresenceComponent<PromptStarterMotionParams>> =\n createPresenceComponent<PromptStarterMotionParams>(({ index, numberOfColumns }) => {\n const isFirstRow = index < numberOfColumns;\n const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;\n\n const opacityDuration = 100;\n const opacityOffset = delay / (delay + opacityDuration);\n const opacityEasing = 'linear';\n\n const scaleDuration = 500;\n const scaleOffset = delay / (delay + scaleDuration);\n const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;\n\n const opacityExitDuration = 200;\n\n return {\n enter: [\n {\n keyframes: [{ opacity: 0 }, { opacity: 0, offset: opacityOffset }, { opacity: 1 }],\n easing: opacityEasing,\n duration: opacityDuration + delay,\n },\n {\n keyframes: [\n { transform: 'scale(0.9)' },\n { transform: 'scale(0.9)', offset: scaleOffset },\n { transform: 'scale(1)' },\n ],\n easing: scaleEasing,\n duration: scaleDuration + delay,\n },\n ],\n exit: {\n keyframes: [{ opacity: 1 }, { opacity: 1 }, { opacity: 0 }],\n easing: opacityEasing,\n duration: opacityExitDuration,\n },\n };\n });\n"],"names":["createPresenceComponent","PromptStarterMotion","index","numberOfColumns","isFirstRow","delay","opacityDuration","opacityOffset","opacityEasing","scaleDuration","scaleOffset","scaleEasing","opacityExitDuration","enter","keyframes","opacity","offset","easing","duration","transform","exit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,uBAAuB,QAAQ,6BAA6B;AAIrE,OAAO,MAAMC,sBACXD,wBAAmD,CAAC,EAAEE,KAAK,EAAEC,eAAe,EAAE;IAC5E,MAAMC,aAAaF,QAAQC;IAC3B,MAAME,QAAQD,aAAaF,QAAQ,KAAK,AAACA,CAAAA,QAAQC,eAAc,IAAK;IAEpE,MAAMG,kBAAkB;IACxB,MAAMC,gBAAgBF,QAASA,CAAAA,QAAQC,eAAc;IACrD,MAAME,gBAAgB;IAEtB,MAAMC,gBAAgB;IACtB,MAAMC,cAAcL,QAASA,CAAAA,QAAQI,aAAY;IACjD,MAAME,cAAc,CAAC,iCAAiC,CAAC;IAEvD,MAAMC,sBAAsB;IAE5B,OAAO;QACLC,OAAO;YACL;gBACEC,WAAW;oBAAC;wBAAEC,SAAS;oBAAE;oBAAG;wBAAEA,SAAS;wBAAGC,QAAQT;oBAAc;oBAAG;wBAAEQ,SAAS;oBAAE;iBAAE;gBAClFE,QAAQT;gBACRU,UAAUZ,kBAAkBD;YAC9B;YACA;gBACES,WAAW;oBACT;wBAAEK,WAAW;oBAAa;oBAC1B;wBAAEA,WAAW;wBAAcH,QAAQN;oBAAY;oBAC/C;wBAAES,WAAW;oBAAW;iBACzB;gBACDF,QAAQN;gBACRO,UAAUT,gBAAgBJ;YAC5B;SACD;QACDe,MAAM;YACJN,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;YAC3DE,QAAQT;YACRU,UAAUN;QACZ;IACF;AACF,GAAG"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
-
export const renderPromptStarter_unstable = state
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export const renderPromptStarter_unstable = (state)=>{
|
|
4
|
+
assertSlots(state);
|
|
5
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
|
6
|
+
children: [
|
|
7
|
+
/*#__PURE__*/ _jsxs(state.primaryAction, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ _jsx(state.icon, {}),
|
|
10
|
+
/*#__PURE__*/ _jsx(state.prompt, {}),
|
|
11
|
+
state.reasonMarker && /*#__PURE__*/ _jsx(state.reasonMarker, {})
|
|
12
|
+
]
|
|
13
|
+
}),
|
|
14
|
+
state.actions && /*#__PURE__*/ _jsx(state.actions, {})
|
|
15
|
+
]
|
|
16
|
+
});
|
|
10
17
|
};
|
|
11
|
-
//# sourceMappingURL=renderPromptStarter.js.map
|