@fluentui-copilot/react-prompt-starter 0.0.0-nightly-20251006-0406-b5da4f6a.1 → 0.0.0-nightly-20251010-0406-7df7c6d1.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 +4 -4
- package/package.json +7 -7
- package/dist/index.d.ts +0 -162
- package/lib/PromptStarter.js +0 -1
- package/lib/PromptStarter.js.map +0 -1
- package/lib/PromptStarterList.js +0 -1
- package/lib/PromptStarterList.js.map +0 -1
- package/lib/PromptStarterV2.js +0 -1
- package/lib/PromptStarterV2.js.map +0 -1
- package/lib/components/PromptStarter/PromptStarter.js +0 -12
- package/lib/components/PromptStarter/PromptStarter.js.map +0 -1
- package/lib/components/PromptStarter/PromptStarter.types.js +0 -3
- package/lib/components/PromptStarter/PromptStarter.types.js.map +0 -1
- package/lib/components/PromptStarter/index.js +0 -4
- package/lib/components/PromptStarter/index.js.map +0 -1
- package/lib/components/PromptStarter/renderPromptStarter.js +0 -18
- package/lib/components/PromptStarter/renderPromptStarter.js.map +0 -1
- package/lib/components/PromptStarter/usePromptStarter.js +0 -53
- package/lib/components/PromptStarter/usePromptStarter.js.map +0 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js +0 -138
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js.map +0 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +0 -94
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +0 -12
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +0 -3
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/index.js +0 -4
- package/lib/components/PromptStarterV2/PromptStarter/index.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +0 -63
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +0 -17
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +0 -66
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +0 -276
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +0 -131
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +0 -12
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +0 -4
- package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +0 -21
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +0 -113
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +0 -6
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +0 -57
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +0 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +0 -61
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +0 -1
- package/lib/contexts/PromptStarterListContext.js +0 -7
- package/lib/contexts/PromptStarterListContext.js.map +0 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib-commonjs/PromptStarter.js +0 -28
- package/lib-commonjs/PromptStarter.js.map +0 -1
- package/lib-commonjs/PromptStarterList.js +0 -28
- package/lib-commonjs/PromptStarterList.js.map +0 -1
- package/lib-commonjs/PromptStarterV2.js +0 -28
- package/lib-commonjs/PromptStarterV2.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js +0 -23
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +0 -6
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/index.js +0 -31
- package/lib-commonjs/components/PromptStarter/index.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js +0 -28
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js +0 -55
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js +0 -292
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js +0 -112
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +0 -23
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +0 -6
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +0 -31
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +0 -73
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +0 -27
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +0 -68
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +0 -516
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +0 -149
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +0 -23
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +0 -4
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +0 -31
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +0 -29
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +0 -116
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +0 -16
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +0 -89
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +0 -77
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/contexts/PromptStarterListContext.js +0 -28
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +0 -1
- package/lib-commonjs/index.js +0 -60
- package/lib-commonjs/index.js.map +0 -1
|
@@ -1,131 +0,0 @@
|
|
|
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
|
-
primaryAction: 'fai-PromptStarter__primaryAction',
|
|
6
|
-
icon: 'fai-PromptStarter__icon',
|
|
7
|
-
prompt: 'fai-PromptStarter__prompt',
|
|
8
|
-
reasonMarker: 'fai-PromptStarter__reasonMarker',
|
|
9
|
-
actions: 'fai-PromptStarter__actions'
|
|
10
|
-
};
|
|
11
|
-
const useRootResetStyles = makeResetStyles({
|
|
12
|
-
display: 'grid',
|
|
13
|
-
gridTemplateColumns: '1fr auto',
|
|
14
|
-
gridTemplateRows: 'max-content auto',
|
|
15
|
-
minWidth: '214px',
|
|
16
|
-
// Apply styles to the primary action on hover / active states
|
|
17
|
-
'&:hover': {
|
|
18
|
-
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
19
|
-
boxShadow: tokens.shadow16,
|
|
20
|
-
transform: 'scale(1.03)',
|
|
21
|
-
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
'&:active': {
|
|
25
|
-
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
26
|
-
boxShadow: tokens.shadow8,
|
|
27
|
-
transform: 'scale(1.03)',
|
|
28
|
-
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
// Hide actions when not focused or hovered
|
|
32
|
-
':not(:focus-within):not(:hover)': {
|
|
33
|
-
[`& .${promptStarterClassNames.actions}`]: {
|
|
34
|
-
clip: 'rect(0px, 0px, 0px, 0px)',
|
|
35
|
-
height: '1px',
|
|
36
|
-
margin: '-1px',
|
|
37
|
-
overflow: 'hidden',
|
|
38
|
-
padding: '0px',
|
|
39
|
-
width: '1px',
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
opacity: 0
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const useStyles = makeStyles({
|
|
46
|
-
primaryAction: {
|
|
47
|
-
gridRow: '1 / 3',
|
|
48
|
-
gridColumn: '1 / 3',
|
|
49
|
-
display: 'flex',
|
|
50
|
-
flexDirection: 'column',
|
|
51
|
-
position: 'relative',
|
|
52
|
-
borderRadius: '28px',
|
|
53
|
-
backgroundColor: tokens.colorNeutralBackground1,
|
|
54
|
-
color: tokens.colorNeutralForeground2,
|
|
55
|
-
fontFamily: tokens.fontFamilyBase,
|
|
56
|
-
cursor: 'pointer',
|
|
57
|
-
outlineStyle: 'none',
|
|
58
|
-
textAlign: 'left',
|
|
59
|
-
rowGap: tokens.spacingHorizontalS,
|
|
60
|
-
padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,
|
|
61
|
-
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),
|
|
62
|
-
...createFocusOutlineStyle({
|
|
63
|
-
style: {
|
|
64
|
-
outlineRadius: '28px'
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
},
|
|
68
|
-
primaryActionHovered: {
|
|
69
|
-
boxShadow: tokens.shadow16,
|
|
70
|
-
transform: 'scale(1.03)',
|
|
71
|
-
transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`
|
|
72
|
-
},
|
|
73
|
-
icon: {
|
|
74
|
-
display: 'flex',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
minHeight: tokens.spacingVerticalXXL
|
|
77
|
-
},
|
|
78
|
-
actions: {
|
|
79
|
-
margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}
|
|
80
|
-
${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,
|
|
81
|
-
position: 'relative',
|
|
82
|
-
gridRow: '1 / 2',
|
|
83
|
-
gridColumn: '2 / 3',
|
|
84
|
-
opacity: 1,
|
|
85
|
-
transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`
|
|
86
|
-
},
|
|
87
|
-
prompt: {
|
|
88
|
-
...typographyStyles.body1Strong,
|
|
89
|
-
// Truncate text after two lines.
|
|
90
|
-
display: '-webkit-box',
|
|
91
|
-
'-webkit-box-orient': 'vertical',
|
|
92
|
-
'-webkit-line-clamp': '2',
|
|
93
|
-
overflowY: 'hidden'
|
|
94
|
-
},
|
|
95
|
-
reasonMarker: {
|
|
96
|
-
...typographyStyles.caption2
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const useSingleColumnStyles = makeStyles({
|
|
100
|
-
primaryAction: {
|
|
101
|
-
borderRadius: tokens.borderRadius2XL,
|
|
102
|
-
...createFocusOutlineStyle({
|
|
103
|
-
style: {
|
|
104
|
-
outlineRadius: tokens.borderRadius2XL
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
},
|
|
108
|
-
prompt: {
|
|
109
|
-
...typographyStyles.caption1Strong
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
export const usePromptStarterStyles_unstable = (state)=>{
|
|
113
|
-
'use no memo';
|
|
114
|
-
const { isSingleColumn } = state;
|
|
115
|
-
const styles = useStyles();
|
|
116
|
-
const rootResetStyles = useRootResetStyles();
|
|
117
|
-
const singleColumnStyles = useSingleColumnStyles();
|
|
118
|
-
state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);
|
|
119
|
-
state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, isSingleColumn && singleColumnStyles.primaryAction, state.primaryAction.className);
|
|
120
|
-
if (state.icon) {
|
|
121
|
-
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
122
|
-
}
|
|
123
|
-
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
124
|
-
if (state.reasonMarker) {
|
|
125
|
-
state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, state.reasonMarker.className);
|
|
126
|
-
}
|
|
127
|
-
if (state.actions) {
|
|
128
|
-
state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);
|
|
129
|
-
}
|
|
130
|
-
return state;
|
|
131
|
-
};
|
package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n rowGap: tokens.spacingHorizontalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n },\n actions: {\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n position: 'relative',\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n prompt: {\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n },\n reasonMarker: {\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n const singleColumnStyles = useSingleColumnStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n isSingleColumn && singleColumnStyles.primaryAction,\n state.primaryAction.className,\n );\n if (state.icon) {\n state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n isSingleColumn && singleColumnStyles.prompt,\n state.prompt.className,\n );\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","caption2","useSingleColumnStyles","borderRadius2XL","caption1Strong","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","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,eAAe;IACfC,MAAM;IACNC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBb,gBAAgB;IACzCc,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEX,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOc,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CA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,CAACoE,SAAS;IAE/B,IAAIL,MAAM9D,IAAI,EAAE;QACd8D,MAAM9D,IAAI,CAACmE,SAAS,GAAG3E,aAAaK,wBAAwBG,IAAI,EAAEgE,OAAOhE,IAAI,EAAE8D,MAAM9D,IAAI,CAACmE,SAAS;IACrG;IACAL,MAAM7D,MAAM,CAACkE,SAAS,GAAG3E,aACvBK,wBAAwBI,MAAM,EAC9B+D,OAAO/D,MAAM,EACb8D,kBAAkBG,mBAAmBjE,MAAM,EAC3C6D,MAAM7D,MAAM,CAACkE,SAAS;IAExB,IAAIL,MAAM5D,YAAY,EAAE;QACtB4D,MAAM5D,YAAY,CAACiE,SAAS,GAAG3E,aAC7BK,wBAAwBK,YAAY,EACpC8D,OAAO9D,YAAY,EACnB4D,MAAM5D,YAAY,CAACiE,SAAS;IAEhC;IACA,IAAIL,MAAM3D,OAAO,EAAE;QACjB2D,MAAM3D,OAAO,CAACgE,SAAS,GAAG3E,aAAaK,wBAAwBM,OAAO,EAAE6D,OAAO7D,OAAO,EAAE2D,MAAM3D,OAAO,CAACgE,SAAS;IACjH;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
3
|
-
import { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
4
|
-
import { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
-
import { usePromptStarterListContextValues } from './usePromptStarterListContextValues';
|
|
6
|
-
export const PromptStarterList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
-
const state = usePromptStarterList_unstable(props, ref);
|
|
8
|
-
const contextValues = usePromptStarterListContextValues(state);
|
|
9
|
-
usePromptStarterListStyles_unstable(state);
|
|
10
|
-
return renderPromptStarterList_unstable(state, contextValues);
|
|
11
|
-
});
|
|
12
|
-
PromptStarterList.displayName = 'PromptStarterList';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarterList_unstable } from './usePromptStarterList';\nimport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nimport { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\nimport type { PromptStarterListProps } from './PromptStarterList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { usePromptStarterListContextValues } from './usePromptStarterListContextValues';\n\nexport const PromptStarterList: ForwardRefComponent<PromptStarterListProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarterList_unstable(props, ref);\n const contextValues = usePromptStarterListContextValues(state);\n\n usePromptStarterListStyles_unstable(state);\n return renderPromptStarterList_unstable(state, contextValues);\n});\n\nPromptStarterList.displayName = 'PromptStarterList';\n"],"names":["React","usePromptStarterList_unstable","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterListContextValues","PromptStarterList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,sCAAsC;AAG1F,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQR,8BAA8BM,OAAOC;IACnD,MAAME,gBAAgBN,kCAAkCK;IAExDN,oCAAoCM;IACpC,OAAOP,iCAAiCO,OAAOC;AACjD,GAAG;AAEHL,kBAAkBM,WAAW,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarterList.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type {\n ComponentProps,\n ComponentState,\n Slot,\n Button,\n UseArrowNavigationGroupOptions,\n} from '@fluentui/react-components';\n\nexport type PromptStarterListSlots = {\n root: NonNullable<Slot<'div'>>;\n gridWrapper: NonNullable<Slot<'div'>>;\n expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<Partial<PromptStarterListSlots>, 'gridWrapper'> &\n DesignVersion & {\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n /**\n * Arrow navigation options. This can be used to customize Tabster's direction,\n * tab behavior, and memoization options.\n *\n * default: { axis: 'horizontal', memorizeCurrent: true }\n */\n arrowNavigationOptions?: UseArrowNavigationGroupOptions;\n\n /**\n * Whether to animate the entrance of its items when it first mounts.\n *\n * @default true\n */\n animateOnMount?: boolean;\n };\n\n/**\n * State used in rendering PromptStarterList\n */\nexport type PromptStarterListState = ComponentState<PromptStarterListSlots> &\n Required<Pick<PromptStarterListProps, 'designVersion'>> & {\n numberOfColumns: number;\n isExpanded?: boolean;\n };\n\nexport type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;\n"],"names":[],"rangeMappings":"","mappings":"AAyDA,WAA2G"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { PromptStarterList } from './PromptStarterList';
|
|
2
|
-
export { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
3
|
-
export { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
4
|
-
export { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptStarterList } from './PromptStarterList';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\nexport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nexport { usePromptStarterList_unstable } from './usePromptStarterList';\nexport { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\n"],"names":["PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,sBAAsB;AAOxD,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,2BAA2B,EAAEC,mCAAmC,QAAQ,sCAAsC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots, PresenceGroup } from '@fluentui/react-components';
|
|
3
|
-
import { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';
|
|
4
|
-
/**
|
|
5
|
-
* Render the final JSX of PromptStarterList
|
|
6
|
-
*/ export const renderPromptStarterList_unstable = (state, contextValue)=>{
|
|
7
|
-
assertSlots(state);
|
|
8
|
-
return /*#__PURE__*/ _jsx(PromptStarterListProvider, {
|
|
9
|
-
value: contextValue,
|
|
10
|
-
children: /*#__PURE__*/ _jsxs(state.root, {
|
|
11
|
-
children: [
|
|
12
|
-
/*#__PURE__*/ _jsx(PresenceGroup, {
|
|
13
|
-
children: /*#__PURE__*/ _jsx(state.gridWrapper, {
|
|
14
|
-
children: state.root.children
|
|
15
|
-
})
|
|
16
|
-
}),
|
|
17
|
-
state.expandButton && /*#__PURE__*/ _jsx(state.expandButton, {})
|
|
18
|
-
]
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPromptStarterList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, PresenceGroup } from '@fluentui/react-components';\nimport { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';\nimport type {\n PromptStarterListState,\n PromptStarterListSlots,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\n\n/**\n * Render the final JSX of PromptStarterList\n */\nexport const renderPromptStarterList_unstable = (\n state: PromptStarterListState,\n contextValue: PromptStarterListContextValue,\n) => {\n assertSlots<PromptStarterListSlots>(state);\n\n return (\n <PromptStarterListProvider value={contextValue}>\n <state.root>\n <PresenceGroup>\n <state.gridWrapper>{state.root.children}</state.gridWrapper>\n </PresenceGroup>\n {state.expandButton && <state.expandButton />}\n </state.root>\n </PromptStarterListProvider>\n );\n};\n"],"names":["assertSlots","PresenceGroup","PromptStarterListProvider","renderPromptStarterList_unstable","state","contextValue","value","root","gridWrapper","children","expandButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,aAAa,QAAQ,6BAA6B;AACxE,SAASC,yBAAyB,QAAQ,6CAA6C;AAOvF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAC9CC,OACAC;IAEAL,YAAoCI;IAEpC,qBACE,KAACF;QAA0BI,OAAOD;kBAChC,cAAA,MAACD,MAAMG,IAAI;;8BACT,KAACN;8BACC,cAAA,KAACG,MAAMI,WAAW;kCAAEJ,MAAMG,IAAI,CAACE,QAAQ;;;gBAExCL,MAAMM,YAAY,kBAAI,KAACN,MAAMM,YAAY;;;;AAIlD,EAAE"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeCallbacks, useFluent, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
-
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
4
|
-
import { ChevronDown12Regular } from '@fluentui/react-icons';
|
|
5
|
-
import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
6
|
-
/**
|
|
7
|
-
* Create the state required to render PromptStarterList.
|
|
8
|
-
*
|
|
9
|
-
* The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,
|
|
10
|
-
* before being passed to renderPromptStarterList_unstable.
|
|
11
|
-
*
|
|
12
|
-
* @param props - props from this instance of PromptStarterList
|
|
13
|
-
* @param ref - reference to root HTMLElement of PromptStarterList
|
|
14
|
-
*/ export const usePromptStarterList_unstable = (props, ref)=>{
|
|
15
|
-
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', animateOnMount = true } = props;
|
|
16
|
-
const designVersion = useDesignVersion(props.designVersion);
|
|
17
|
-
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
18
|
-
const focusAttrs = useArrowNavigationGroup({
|
|
19
|
-
...arrowNavigationOptions,
|
|
20
|
-
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'grid-linear',
|
|
21
|
-
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
22
|
-
});
|
|
23
|
-
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
24
|
-
const [numberOfColumns, setNumberOfColumns] = React.useState(3);
|
|
25
|
-
const gridWrapperRef = React.useRef(null);
|
|
26
|
-
const { targetDocument } = useFluent();
|
|
27
|
-
const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
|
|
28
|
-
React.useEffect(()=>{
|
|
29
|
-
if (!win || !gridWrapperRef.current) return;
|
|
30
|
-
const promptStarterGrid = gridWrapperRef.current;
|
|
31
|
-
const updateNumberOfColumns = ()=>{
|
|
32
|
-
const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
|
|
33
|
-
setNumberOfColumns(numColumns);
|
|
34
|
-
};
|
|
35
|
-
const ro = new win.ResizeObserver(updateNumberOfColumns);
|
|
36
|
-
ro.observe(promptStarterGrid);
|
|
37
|
-
return ()=>{
|
|
38
|
-
ro.unobserve(promptStarterGrid);
|
|
39
|
-
};
|
|
40
|
-
}, [
|
|
41
|
-
win
|
|
42
|
-
]);
|
|
43
|
-
const state = {
|
|
44
|
-
numberOfColumns: numberOfColumns,
|
|
45
|
-
isExpanded,
|
|
46
|
-
designVersion,
|
|
47
|
-
components: {
|
|
48
|
-
root: 'div',
|
|
49
|
-
gridWrapper: 'div',
|
|
50
|
-
expandButton: Button
|
|
51
|
-
},
|
|
52
|
-
root: slot.always(getIntrinsicElementProps('div', {
|
|
53
|
-
ref,
|
|
54
|
-
...props
|
|
55
|
-
}), {
|
|
56
|
-
elementType: 'div'
|
|
57
|
-
}),
|
|
58
|
-
gridWrapper: slot.always(props.gridWrapper, {
|
|
59
|
-
defaultProps: {
|
|
60
|
-
role: 'list',
|
|
61
|
-
...focusAttrs
|
|
62
|
-
},
|
|
63
|
-
elementType: 'div'
|
|
64
|
-
}),
|
|
65
|
-
expandButton: slot.optional(props.expandButton, {
|
|
66
|
-
defaultProps: {
|
|
67
|
-
appearance: 'subtle',
|
|
68
|
-
size: 'small',
|
|
69
|
-
shape: 'rounded',
|
|
70
|
-
icon: /*#__PURE__*/ React.createElement(ChevronDown12Regular, null),
|
|
71
|
-
iconPosition: 'after',
|
|
72
|
-
'aria-expanded': isExpanded,
|
|
73
|
-
children: isExpanded ? collapseButtonLabel : expandButtonLabel
|
|
74
|
-
},
|
|
75
|
-
renderByDefault: true,
|
|
76
|
-
elementType: Button
|
|
77
|
-
})
|
|
78
|
-
};
|
|
79
|
-
state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);
|
|
80
|
-
// Get the array of children.
|
|
81
|
-
const childrenArray = React.useMemo(()=>{
|
|
82
|
-
return React.Children.toArray(state.root.children);
|
|
83
|
-
}, [
|
|
84
|
-
state.root.children
|
|
85
|
-
]);
|
|
86
|
-
// Add motion to the children.
|
|
87
|
-
const childrenWithMotion = React.useMemo(()=>childrenArray.map((child, index)=>{
|
|
88
|
-
// Throw error if the child is not a valid React element or is a Fragment.
|
|
89
|
-
if (!/*#__PURE__*/ React.isValidElement(child) || child.type === React.Fragment) {
|
|
90
|
-
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
91
|
-
}
|
|
92
|
-
// In the collapsed state, if there is one column, we show three children.
|
|
93
|
-
// If there are two or three columns, we show two or three. All children
|
|
94
|
-
// are shown in the expanded state.
|
|
95
|
-
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
|
|
96
|
-
return /*#__PURE__*/ React.createElement(PromptStarterMotion, {
|
|
97
|
-
appear: animateOnMount,
|
|
98
|
-
key: index,
|
|
99
|
-
index: index,
|
|
100
|
-
visible: visibility,
|
|
101
|
-
numberOfColumns: numberOfColumns
|
|
102
|
-
}, child);
|
|
103
|
-
}), [
|
|
104
|
-
childrenArray,
|
|
105
|
-
numberOfColumns,
|
|
106
|
-
isExpanded
|
|
107
|
-
]);
|
|
108
|
-
state.root.children = childrenWithMotion;
|
|
109
|
-
if (state.expandButton) {
|
|
110
|
-
state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, ()=>setIsExpanded(!isExpanded));
|
|
111
|
-
}
|
|
112
|
-
return state;
|
|
113
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const {\n arrowNavigationOptions,\n expandButtonLabel = 'Show more',\n collapseButtonLabel = 'Show less',\n animateOnMount = true,\n } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'grid-linear',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = React.useState(false);\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'list',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<\n (React.ReactElement<any> | number | string | Iterable<React.ReactNode> | React.ReactPortal)[]\n >(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n\n // In the collapsed state, if there is one column, we show three children.\n // If there are two or three columns, we show two or three. All children\n // are shown in the expanded state.\n const visibility = (numberOfColumns === 1 && index < 3) || index < numberOfColumns || isExpanded;\n\n return (\n <PromptStarterMotion\n appear={animateOnMount}\n key={index}\n index={index}\n visible={visibility}\n numberOfColumns={numberOfColumns}\n >\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns, isExpanded],\n );\n\n state.root.children = childrenWithMotion;\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n () => setIsExpanded(!isExpanded),\n );\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","animateOnMount","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","appear","key","visible","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,MAAM,EACNC,uBAAuB,EACvBC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,6BAA6B;AAEpC,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAE3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EACJC,sBAAsB,EACtBC,oBAAoB,WAAW,EAC/BC,sBAAsB,WAAW,EACjCC,iBAAiB,IAAI,EACtB,GAAGL;IACJ,MAAMM,gBAAgBV,iBAAiBI,MAAMM,aAAa;QAGlDJ,8BACWA;IAHnB,MAAMK,aAAaf,wBAAwB;QACzC,GAAGU,sBAAsB;QACzBM,MAAMN,CAAAA,+BAAAA,mCAAAA,6CAAAA,uBAAwBM,IAAI,cAA5BN,0CAAAA,+BAAgC;QACtCO,iBAAiBP,CAAAA,0CAAAA,mCAAAA,6CAAAA,uBAAwBO,eAAe,cAAvCP,qDAAAA,0CAA2C;IAC9D;IAEA,MAAM,CAACQ,YAAYC,cAAc,GAAGvB,MAAMwB,QAAQ,CAAC;IACnD,MAA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,gBAAgBkB,MAAMG,WAAW,CAACnC,GAAG;IAE3E,6BAA6B;IAC7B,MAAMiD,gBAAgB9D,MAAM+D,OAAO,CAEjC;QACA,OAAO/D,MAAMgE,QAAQ,CAACC,OAAO,CAACpB,MAAME,IAAI,CAACa,QAAQ;IACnD,GAAG;QAACf,MAAME,IAAI,CAACa,QAAQ;KAAC;IAExB,8BAA8B;IAC9B,MAAMM,qBAAqBlE,MAAM+D,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,eAACrE,MAAMsE,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAKvE,MAAMwE,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,0EAA0E;YAC1E,wEAAwE;YACxE,mCAAmC;YACnC,MAAMC,aAAa,AAACjD,oBAAoB,KAAK4C,QAAQ,KAAMA,QAAQ5C,mBAAmBH;YAEtF,qBACE,oBAACZ;gBACCiE,QAAQ1D;gBACR2D,KAAKP;gBACLA,OAAOA;gBACPQ,SAASH;gBACTjD,iBAAiBA;eAEhB2C;QAGP,IACF;QAACN;QAAerC;QAAiBH;KAAW;IAG9CuB,MAAME,IAAI,CAACa,QAAQ,GAAGM;IAEtB,IAAIrB,MAAMI,YAAY,EAAE;QACtBJ,MAAMI,YAAY,CAAC6B,OAAO,GAAGzE,eAC3BwC,MAAMI,YAAY,CAAC6B,OAAO,EAC1B,IAAMvD,cAAc,CAACD;IAEzB;IAEA,OAAOuB;AACT,EAAE"}
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;","mappings":"AAEA,OAAO,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { buttonClassNames, __resetStyles, __styles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
-
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
-
export const promptStarterListClassNames = {
|
|
4
|
-
root: 'fai-PromptStarterList',
|
|
5
|
-
gridWrapper: 'fai-PromptStarterList__gridWrapper',
|
|
6
|
-
expandButton: 'fai-PromptStarterList__expandButton'
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Styles for the root slot
|
|
10
|
-
*/
|
|
11
|
-
const useRootClassName = __resetStyles("r1n85ojv", null, [".r1n85ojv{display:flex;flex-direction:column;max-width:772px;gap:var(--spacingHorizontalXL);}"]);
|
|
12
|
-
const useStyles = __styles({
|
|
13
|
-
gridWrapper: {
|
|
14
|
-
mc9l5x: "f13qh94s",
|
|
15
|
-
i8kkvl: 0,
|
|
16
|
-
Belr9w4: 0,
|
|
17
|
-
rmohyg: "f1p93rwu",
|
|
18
|
-
t4k1zu: "f4wu0r3",
|
|
19
|
-
Budl1dq: "fvo7o13",
|
|
20
|
-
Bxotwcr: "f1nkeedh"
|
|
21
|
-
},
|
|
22
|
-
expandButton: {
|
|
23
|
-
qb2dma: "f1locze1",
|
|
24
|
-
wrk2wx: "f11k2d1d",
|
|
25
|
-
dutsh0: "f1iwh30k",
|
|
26
|
-
B4u5nao: "fn63aq9",
|
|
27
|
-
Bbdnnc7: "fm7zj7h",
|
|
28
|
-
x3br3k: "fuzcl37"
|
|
29
|
-
},
|
|
30
|
-
expandButtonExpanded: {
|
|
31
|
-
Bs9jjb3: ["f5l68jj", "f1i29bk4"]
|
|
32
|
-
}
|
|
33
|
-
}, {
|
|
34
|
-
d: [".f13qh94s{display:grid;}", [".f1p93rwu{gap:var(--spacingHorizontalL);}", {
|
|
35
|
-
p: -1
|
|
36
|
-
}], ".f4wu0r3{grid-auto-columns:max-content;}", ".fvo7o13{grid-template-columns:repeat(auto-fit, minmax(214px, 1fr));}", ".f1nkeedh{grid-auto-flow:unset;}", ".f1locze1{align-self:end;}", ".f11k2d1d .fui-Button__icon{font-size:12px;}", ".f1iwh30k .fui-Button__icon{height:12px;}", ".fn63aq9 .fui-Button__icon{width:12px;}", ".f5l68jj>.fui-Button__icon{transform:rotate(180deg);}", ".f1i29bk4>.fui-Button__icon{transform:rotate(-180deg);}"],
|
|
37
|
-
h: [".fm7zj7h:hover .fui-Button__icon{color:var(--colorNeutralForeground2Hover);}", ".fuzcl37:hover:active .fui-Button__icon{color:var(--colorNeutralForeground2Pressed);}"]
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* Apply styling to the PromptStarterList slots based on the state
|
|
41
|
-
*/
|
|
42
|
-
export const usePromptStarterListStyles_unstable = state => {
|
|
43
|
-
'use no memo';
|
|
44
|
-
|
|
45
|
-
const {
|
|
46
|
-
isExpanded
|
|
47
|
-
} = state;
|
|
48
|
-
const rootClassName = useRootClassName();
|
|
49
|
-
const styles = useStyles();
|
|
50
|
-
state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);
|
|
51
|
-
state.gridWrapper.className = mergeClasses(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
|
|
52
|
-
if (state.expandButton) {
|
|
53
|
-
state.expandButton.className = mergeClasses(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
|
|
54
|
-
}
|
|
55
|
-
return state;
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=usePromptStarterListStyles.styles.js.map
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterListStyles.styles.ts"],"sourcesContent":["import { buttonClassNames, makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { PromptStarterListSlots, PromptStarterListState } from './PromptStarterList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nexport const promptStarterListClassNames: SlotClassNames<PromptStarterListSlots> = {\n root: 'fai-PromptStarterList',\n gridWrapper: 'fai-PromptStarterList__gridWrapper',\n expandButton: 'fai-PromptStarterList__expandButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'column',\n maxWidth: '772px',\n gap: tokens.spacingHorizontalXL,\n});\n\nconst useStyles = makeStyles({\n gridWrapper: {\n display: 'grid',\n gap: tokens.spacingHorizontalL,\n gridAutoColumns: 'max-content',\n\n gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,\n gridAutoFlow: 'unset',\n },\n\n expandButton: {\n alignSelf: 'end',\n [`& .${buttonClassNames.icon}`]: {\n fontSize: '12px',\n height: '12px',\n width: '12px',\n },\n ':hover': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n ':hover:active': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n expandButtonExpanded: {\n [`& > .${buttonClassNames.icon}`]: {\n transform: 'rotate(180deg)',\n },\n },\n});\n\n/**\n * Apply styling to the PromptStarterList slots based on the state\n */\nexport const usePromptStarterListStyles_unstable = (state: PromptStarterListState): PromptStarterListState => {\n 'use no memo';\n\n const { isExpanded } = state;\n\n const rootClassName = useRootClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);\n state.gridWrapper.className = mergeClasses(\n promptStarterListClassNames.gridWrapper,\n styles.gridWrapper,\n state.gridWrapper.className,\n );\n if (state.expandButton) {\n state.expandButton.className = mergeClasses(\n promptStarterListClassNames.expandButton,\n styles.expandButton,\n isExpanded && styles.expandButtonExpanded,\n state.expandButton.className,\n );\n }\n\n return state;\n};\n"],"names":["buttonClassNames","makeResetStyles","makeStyles","mergeClasses","tokens","promptStarterListClassNames","root","gridWrapper","expandButton","useRootClassName","display","flexDirection","maxWidth","gap","spacingHorizontalXL","useStyles","spacingHorizontalL","gridAutoColumns","gridTemplateColumns","gridAutoFlow","alignSelf","icon","fontSize","height","width","color","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","expandButtonExpanded","transform","usePromptStarterListStyles_unstable","state","isExpanded","rootClassName","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AAGzG,SAASC,MAAM,QAAQ,2BAA2B;AAElD,OAAO,MAAMC,8BAAsE;IACjFC,MAAM;IACNC,aAAa;IACbC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBR,gBAAgB;IACvCS,SAAS;IACTC,eAAe;IACfC,UAAU;IACVC,KAAKT,OAAOU,mBAAmB;AACjC;AAEA,MAAMC,YAAYb,WAAW;IAC3BK,aAAa;QACXG,SAAS;QACTG,KAAKT,OAAOY,kBAAkB;QAC9BC,iBAAiB;QAEjBC,qBAAqB,CAAC,oCAAoC,CAAC;QAC3DC,cAAc;IAChB;IAEAX,cAAc;QACZY,WAAW;QACX,CAAC,CAAC,GAAG,EAAEpB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YAC/BC,UAAU;YACVC,QAAQ;YACRC,OAAO;QACT;QACA,UAAU;YACR,CAAC,CAAC,GAAG,EAAExB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOsB,4BAA4B;YAC5C;QACF;QACA,iBAAiB;YACf,CAAC,CAAC,GAAG,EAAE1B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOuB,8BAA8B;YAC9C;QACF;IACF;IAEAC,sBAAsB;QACpB,CAAC,CAAC,KAAK,EAAE5B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YACjCQ,WAAW;QACb;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,sCAAsC,CAACC;IAClD;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAGD;IAEvB,MAAME,gBAAgBxB;IACtB,MAAMyB,SAASnB;IACfgB,MAAMzB,IAAI,CAAC6B,SAAS,GAAGhC,aAAaE,4BAA4BC,IAAI,EAAE2B,eAAeF,MAAMzB,IAAI,CAAC6B,SAAS;IACzGJ,MAAMxB,WAAW,CAAC4B,SAAS,GAAGhC,aAC5BE,4BAA4BE,WAAW,EACvC2B,OAAO3B,WAAW,EAClBwB,MAAMxB,WAAW,CAAC4B,SAAS;IAE7B,IAAIJ,MAAMvB,YAAY,EAAE;QACtBuB,MAAMvB,YAAY,CAAC2B,SAAS,GAAGhC,aAC7BE,4BAA4BG,YAAY,EACxC0B,OAAO1B,YAAY,EACnBwB,cAAcE,OAAON,oBAAoB,EACzCG,MAAMvB,YAAY,CAAC2B,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { buttonClassNames, makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
-
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
-
export const promptStarterListClassNames = {
|
|
4
|
-
root: 'fai-PromptStarterList',
|
|
5
|
-
gridWrapper: 'fai-PromptStarterList__gridWrapper',
|
|
6
|
-
expandButton: 'fai-PromptStarterList__expandButton'
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Styles for the root slot
|
|
10
|
-
*/ const useRootClassName = makeResetStyles({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
flexDirection: 'column',
|
|
13
|
-
maxWidth: '772px',
|
|
14
|
-
gap: tokens.spacingHorizontalXL
|
|
15
|
-
});
|
|
16
|
-
const useStyles = makeStyles({
|
|
17
|
-
gridWrapper: {
|
|
18
|
-
display: 'grid',
|
|
19
|
-
gap: tokens.spacingHorizontalL,
|
|
20
|
-
gridAutoColumns: 'max-content',
|
|
21
|
-
gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,
|
|
22
|
-
gridAutoFlow: 'unset'
|
|
23
|
-
},
|
|
24
|
-
expandButton: {
|
|
25
|
-
alignSelf: 'end',
|
|
26
|
-
[`& .${buttonClassNames.icon}`]: {
|
|
27
|
-
fontSize: '12px',
|
|
28
|
-
height: '12px',
|
|
29
|
-
width: '12px'
|
|
30
|
-
},
|
|
31
|
-
':hover': {
|
|
32
|
-
[`& .${buttonClassNames.icon}`]: {
|
|
33
|
-
color: tokens.colorNeutralForeground2Hover
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
':hover:active': {
|
|
37
|
-
[`& .${buttonClassNames.icon}`]: {
|
|
38
|
-
color: tokens.colorNeutralForeground2Pressed
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
expandButtonExpanded: {
|
|
43
|
-
[`& > .${buttonClassNames.icon}`]: {
|
|
44
|
-
transform: 'rotate(180deg)'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
/**
|
|
49
|
-
* Apply styling to the PromptStarterList slots based on the state
|
|
50
|
-
*/ export const usePromptStarterListStyles_unstable = (state)=>{
|
|
51
|
-
'use no memo';
|
|
52
|
-
const { isExpanded } = state;
|
|
53
|
-
const rootClassName = useRootClassName();
|
|
54
|
-
const styles = useStyles();
|
|
55
|
-
state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);
|
|
56
|
-
state.gridWrapper.className = mergeClasses(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
|
|
57
|
-
if (state.expandButton) {
|
|
58
|
-
state.expandButton.className = mergeClasses(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
|
|
59
|
-
}
|
|
60
|
-
return state;
|
|
61
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptStarterListStyles.styles.ts"],"sourcesContent":["import { buttonClassNames, makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { PromptStarterListSlots, PromptStarterListState } from './PromptStarterList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nexport const promptStarterListClassNames: SlotClassNames<PromptStarterListSlots> = {\n root: 'fai-PromptStarterList',\n gridWrapper: 'fai-PromptStarterList__gridWrapper',\n expandButton: 'fai-PromptStarterList__expandButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'column',\n maxWidth: '772px',\n gap: tokens.spacingHorizontalXL,\n});\n\nconst useStyles = makeStyles({\n gridWrapper: {\n display: 'grid',\n gap: tokens.spacingHorizontalL,\n gridAutoColumns: 'max-content',\n\n gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,\n gridAutoFlow: 'unset',\n },\n\n expandButton: {\n alignSelf: 'end',\n [`& .${buttonClassNames.icon}`]: {\n fontSize: '12px',\n height: '12px',\n width: '12px',\n },\n ':hover': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n ':hover:active': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n expandButtonExpanded: {\n [`& > .${buttonClassNames.icon}`]: {\n transform: 'rotate(180deg)',\n },\n },\n});\n\n/**\n * Apply styling to the PromptStarterList slots based on the state\n */\nexport const usePromptStarterListStyles_unstable = (state: PromptStarterListState): PromptStarterListState => {\n 'use no memo';\n\n const { isExpanded } = state;\n\n const rootClassName = useRootClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);\n state.gridWrapper.className = mergeClasses(\n promptStarterListClassNames.gridWrapper,\n styles.gridWrapper,\n state.gridWrapper.className,\n );\n if (state.expandButton) {\n state.expandButton.className = mergeClasses(\n promptStarterListClassNames.expandButton,\n styles.expandButton,\n isExpanded && styles.expandButtonExpanded,\n state.expandButton.className,\n );\n }\n\n return state;\n};\n"],"names":["buttonClassNames","makeResetStyles","makeStyles","mergeClasses","tokens","promptStarterListClassNames","root","gridWrapper","expandButton","useRootClassName","display","flexDirection","maxWidth","gap","spacingHorizontalXL","useStyles","spacingHorizontalL","gridAutoColumns","gridTemplateColumns","gridAutoFlow","alignSelf","icon","fontSize","height","width","color","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","expandButtonExpanded","transform","usePromptStarterListStyles_unstable","state","isExpanded","rootClassName","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AAGzG,SAASC,MAAM,QAAQ,2BAA2B;AAElD,OAAO,MAAMC,8BAAsE;IACjFC,MAAM;IACNC,aAAa;IACbC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBR,gBAAgB;IACvCS,SAAS;IACTC,eAAe;IACfC,UAAU;IACVC,KAAKT,OAAOU,mBAAmB;AACjC;AAEA,MAAMC,YAAYb,WAAW;IAC3BK,aAAa;QACXG,SAAS;QACTG,KAAKT,OAAOY,kBAAkB;QAC9BC,iBAAiB;QAEjBC,qBAAqB,CAAC,oC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context-selector';
|
|
2
|
-
export const PromptStarterListContext = createContext(undefined);
|
|
3
|
-
const promptStarterListContextDefaultValue = {
|
|
4
|
-
numberOfColumns: 3
|
|
5
|
-
};
|
|
6
|
-
export const usePromptStarterListContext = (selector)=>useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue)=>selector(ctx));
|
|
7
|
-
export const PromptStarterListProvider = PromptStarterListContext.Provider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarterListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport type { PromptStarterListContextValue } from '../PromptStarterList';\n\nexport const PromptStarterListContext = createContext<PromptStarterListContextValue | undefined>(undefined);\n\nconst promptStarterListContextDefaultValue: PromptStarterListContextValue = {\n numberOfColumns: 3,\n};\n\nexport const usePromptStarterListContext = <T>(selector: ContextSelector<PromptStarterListContextValue, T>) =>\n useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));\nexport const PromptStarterListProvider = PromptStarterListContext.Provider;\n"],"names":["createContext","useContextSelector","PromptStarterListContext","undefined","promptStarterListContextDefaultValue","numberOfColumns","usePromptStarterListContext","selector","ctx","PromptStarterListProvider","Provider"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,OAAO,MAAMC,2BAA2BF,cAAyDG,WAAW;AAE5G,MAAMC,uCAAsE;IAC1EC,iBAAiB;AACnB;AAEA,OAAO,MAAMC,8BAA8B,CAAIC,WAC7CN,mBAAmBC,0BAA0B,CAACM,MAAMJ,oCAAoC,GAAKG,SAASC,MAAM;AAC9G,OAAO,MAAMC,4BAA4BP,yBAAyBQ,QAAQ,CAAC"}
|
package/lib/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { PromptStarter, promptStarterClassNames, renderPromptStarter_unstable, usePromptStarterStyles_unstable, usePromptStarter_unstable } from './PromptStarter';
|
|
2
|
-
export { PromptStarter as PromptStarterV2, promptStarterClassNames as promptStarterV2ClassNames, renderPromptStarter_unstable as renderPromptStarterV2_unstable, usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable, usePromptStarter_unstable as usePromptStarterV2_unstable } from './PromptStarterV2';
|
|
3
|
-
export { PromptStarterList, renderPromptStarterList_unstable, usePromptStarterList_unstable, promptStarterListClassNames, usePromptStarterListStyles_unstable } from './PromptStarterList';
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './PromptStarter';\n\nexport type {\n PromptStarterProps as PromptStarterV2Props,\n PromptStarterSlots as PromptStarterV2Slots,\n PromptStarterState as PromptStarterV2State,\n} from './PromptStarterV2';\nexport {\n PromptStarter as PromptStarterV2,\n promptStarterClassNames as promptStarterV2ClassNames,\n renderPromptStarter_unstable as renderPromptStarterV2_unstable,\n usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable,\n usePromptStarter_unstable as usePromptStarterV2_unstable,\n} from './PromptStarterV2';\n\nexport {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './PromptStarterList';\nexport type { PromptStarterListProps, PromptStarterListSlots, PromptStarterListState } from './PromptStarterList';"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable","PromptStarterV2","promptStarterV2ClassNames","renderPromptStarterV2_unstable","usePromptStarterV2Styles_unstable","usePromptStarterV2_unstable","PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEJ,iBAAiBK,eAAe,EAChCJ,2BAA2BK,yBAAyB,EACpDJ,gCAAgCK,8BAA8B,EAC9DJ,mCAAmCK,iCAAiC,EACpEJ,6BAA6BK,2BAA2B,QACnD,oBAAoB;AAE3B,SACEC,iBAAiB,EACjBC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mCAAmC,QAC9B,sBAAsB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
PromptStarter: function() {
|
|
13
|
-
return _index.PromptStarter;
|
|
14
|
-
},
|
|
15
|
-
promptStarterClassNames: function() {
|
|
16
|
-
return _index.promptStarterClassNames;
|
|
17
|
-
},
|
|
18
|
-
renderPromptStarter_unstable: function() {
|
|
19
|
-
return _index.renderPromptStarter_unstable;
|
|
20
|
-
},
|
|
21
|
-
usePromptStarterStyles_unstable: function() {
|
|
22
|
-
return _index.usePromptStarterStyles_unstable;
|
|
23
|
-
},
|
|
24
|
-
usePromptStarter_unstable: function() {
|
|
25
|
-
return _index.usePromptStarter_unstable;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const _index = require("./components/PromptStarter/index");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarter.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './components/PromptStarter/index';\nexport { PromptStarter, promptStarterClassNames, renderPromptStarter_unstable, usePromptStarterStyles_unstable, usePromptStarter_unstable } from './components/PromptStarter/index';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,aAAa;eAAbA,oBAAa;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,4BAA4B;eAA5BA,mCAA4B;;IAAEC,+BAA+B;eAA/BA,sCAA+B;;IAAEC,yBAAyB;eAAzBA,gCAAyB;;;uBAAQ"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
PromptStarterList: function() {
|
|
13
|
-
return _index.PromptStarterList;
|
|
14
|
-
},
|
|
15
|
-
promptStarterListClassNames: function() {
|
|
16
|
-
return _index.promptStarterListClassNames;
|
|
17
|
-
},
|
|
18
|
-
renderPromptStarterList_unstable: function() {
|
|
19
|
-
return _index.renderPromptStarterList_unstable;
|
|
20
|
-
},
|
|
21
|
-
usePromptStarterListStyles_unstable: function() {
|
|
22
|
-
return _index.usePromptStarterListStyles_unstable;
|
|
23
|
-
},
|
|
24
|
-
usePromptStarterList_unstable: function() {
|
|
25
|
-
return _index.usePromptStarterList_unstable;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const _index = require("./components/PromptStarterV2/PromptStarterList/index");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptStarterList.ts"],"sourcesContent":["export {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './components/PromptStarterV2/PromptStarterList/index';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './components/PromptStarterV2/PromptStarterList/index';\n"],"names":["PromptStarterList","promptStarterListClassNames","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,iBAAiB;eAAjBA,wBAAiB;;IAGjBC,2BAA2B;eAA3BA,kCAA2B;;IAF3BC,gCAAgC;eAAhCA,uCAAgC;;IAGhCC,mCAAmC;eAAnCA,0CAAmC;;IAFnCC,6BAA6B;eAA7BA,oCAA6B;;;uBAGxB"}
|