@fluentui-copilot/react-prompt-starter 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251013-0406-7c7739c8.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/dist/index.d.ts +164 -0
- package/lib/PromptStarter.js +1 -0
- package/lib/PromptStarter.js.map +1 -0
- package/lib/PromptStarterList.js +1 -0
- package/lib/PromptStarterList.js.map +1 -0
- package/lib/PromptStarterV2.js +1 -0
- package/lib/PromptStarterV2.js.map +1 -0
- package/lib/components/PromptStarter/PromptStarter.js +12 -0
- package/lib/components/PromptStarter/PromptStarter.js.map +1 -0
- package/lib/components/PromptStarter/PromptStarter.types.js +3 -0
- package/lib/components/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib/components/PromptStarter/index.js +4 -0
- package/lib/components/PromptStarter/index.js.map +1 -0
- package/lib/components/PromptStarter/renderPromptStarter.js +18 -0
- package/lib/components/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib/components/PromptStarter/usePromptStarter.js +53 -0
- package/lib/components/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js +138 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- 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 +12 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +3 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js +4 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +63 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +18 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +73 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +338 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +160 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +12 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +4 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +22 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +117 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +6 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +83 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +73 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib/contexts/PromptStarterListContext.js +7 -0
- package/lib/contexts/PromptStarterListContext.js.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/PromptStarter.js +28 -0
- package/lib-commonjs/PromptStarter.js.map +1 -0
- package/lib-commonjs/PromptStarterList.js +28 -0
- package/lib-commonjs/PromptStarterList.js.map +1 -0
- package/lib-commonjs/PromptStarterV2.js +28 -0
- package/lib-commonjs/PromptStarterV2.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.js +23 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +6 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/index.js +31 -0
- package/lib-commonjs/components/PromptStarter/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js +28 -0
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js +55 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js +292 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- 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 +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +6 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +31 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +73 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +28 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +75 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +620 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +178 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +4 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +31 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +30 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +120 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +126 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +89 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
- package/lib-commonjs/index.js +60 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +3 -3
package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
promptStarterClassNames: function() {
|
|
13
|
+
return promptStarterClassNames;
|
|
14
|
+
},
|
|
15
|
+
usePromptStarterStyles_unstable: function() {
|
|
16
|
+
return usePromptStarterStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const promptStarterClassNames = {
|
|
22
|
+
root: 'fai-PromptStarter',
|
|
23
|
+
primaryAction: 'fai-PromptStarter__primaryAction',
|
|
24
|
+
icon: 'fai-PromptStarter__icon',
|
|
25
|
+
category: 'fai-PromptStarter__category',
|
|
26
|
+
prompt: 'fai-PromptStarter__prompt',
|
|
27
|
+
reasonMarker: 'fai-PromptStarter__reasonMarker',
|
|
28
|
+
actions: 'fai-PromptStarter__actions'
|
|
29
|
+
};
|
|
30
|
+
const useRootResetStyles = (0, _reactcomponents.makeResetStyles)({
|
|
31
|
+
display: 'grid',
|
|
32
|
+
gridTemplateColumns: '1fr auto',
|
|
33
|
+
gridTemplateRows: 'max-content auto',
|
|
34
|
+
minWidth: '214px',
|
|
35
|
+
// Apply styles to the primary action on hover / active states
|
|
36
|
+
'&:hover': {
|
|
37
|
+
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
38
|
+
boxShadow: _tokens.tokens.shadow16,
|
|
39
|
+
transform: 'scale(1.03)',
|
|
40
|
+
transition: `transform ${_tokens.tokens.durationNormal} ${_tokens.tokens.curveDecelerateMin}`
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
'&:active': {
|
|
44
|
+
[`& .${promptStarterClassNames.primaryAction}`]: {
|
|
45
|
+
boxShadow: _tokens.tokens.shadow8,
|
|
46
|
+
transform: 'scale(1.03)',
|
|
47
|
+
transition: `transform ${_tokens.tokens.durationNormal} ${_tokens.tokens.curveDecelerateMin}`
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
// Hide actions when not focused or hovered
|
|
51
|
+
':not(:focus-within):not(:hover)': {
|
|
52
|
+
[`& .${promptStarterClassNames.actions}`]: {
|
|
53
|
+
clip: 'rect(0px, 0px, 0px, 0px)',
|
|
54
|
+
height: '1px',
|
|
55
|
+
margin: '-1px',
|
|
56
|
+
overflow: 'hidden',
|
|
57
|
+
padding: '0px',
|
|
58
|
+
width: '1px',
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
opacity: 0
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const useStyles = (0, _reactcomponents.makeStyles)({
|
|
65
|
+
primaryAction: {
|
|
66
|
+
gridRow: '1 / 3',
|
|
67
|
+
gridColumn: '1 / 3',
|
|
68
|
+
position: 'relative',
|
|
69
|
+
display: 'grid',
|
|
70
|
+
gridTemplateColumns: 'max-content 1fr',
|
|
71
|
+
gridAutoRows: 'max-content 1fr max-content',
|
|
72
|
+
borderRadius: '28px',
|
|
73
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground1,
|
|
74
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
75
|
+
fontFamily: _tokens.tokens.fontFamilyBase,
|
|
76
|
+
cursor: 'pointer',
|
|
77
|
+
outlineStyle: 'none',
|
|
78
|
+
textAlign: 'left',
|
|
79
|
+
columnGap: _tokens.tokens.spacingHorizontalMNudge,
|
|
80
|
+
rowGap: _tokens.tokens.spacingVerticalS,
|
|
81
|
+
padding: `${_tokens.tokens.spacingVerticalL} ${_tokens.tokens.spacingHorizontalL}`,
|
|
82
|
+
..._reactcomponents.shorthands.border(_tokens.tokens.strokeWidthThin, 'solid', _tokens.tokens.colorNeutralStroke2),
|
|
83
|
+
...(0, _reactcomponents.createFocusOutlineStyle)({
|
|
84
|
+
style: {
|
|
85
|
+
outlineRadius: '28px'
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
primaryActionHovered: {
|
|
90
|
+
boxShadow: _tokens.tokens.shadow16,
|
|
91
|
+
transform: 'scale(1.03)',
|
|
92
|
+
transition: `transform ${_tokens.tokens.durationNormal} ${_tokens.tokens.curveDecelerateMin}`
|
|
93
|
+
},
|
|
94
|
+
icon: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
minHeight: _tokens.tokens.spacingVerticalXXL,
|
|
98
|
+
gridRow: 1,
|
|
99
|
+
gridColumn: '1 / 2'
|
|
100
|
+
},
|
|
101
|
+
category: {
|
|
102
|
+
display: 'flex',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
..._reactcomponents.typographyStyles.body1Strong,
|
|
105
|
+
gridRow: 1,
|
|
106
|
+
gridColumn: '2 / 3'
|
|
107
|
+
},
|
|
108
|
+
actions: {
|
|
109
|
+
margin: `${_tokens.tokens.spacingVerticalL} ${_tokens.tokens.spacingHorizontalL}
|
|
110
|
+
${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalNone}`,
|
|
111
|
+
position: 'relative',
|
|
112
|
+
gridRow: '1 / 2',
|
|
113
|
+
gridColumn: '2 / 3',
|
|
114
|
+
opacity: 1,
|
|
115
|
+
transition: `opacity ${_tokens.tokens.durationFast} ${_tokens.tokens.curveLinear}`
|
|
116
|
+
},
|
|
117
|
+
actionsWithCategory: {
|
|
118
|
+
// Add a background and gradient fade to truncate the title if applicable
|
|
119
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground1,
|
|
120
|
+
boxShadow: `-12px 0 12px 0 ${_tokens.tokens.colorNeutralBackground1}`
|
|
121
|
+
},
|
|
122
|
+
prompt: {
|
|
123
|
+
..._reactcomponents.typographyStyles.body1Strong,
|
|
124
|
+
// Truncate text after two lines.
|
|
125
|
+
display: '-webkit-box',
|
|
126
|
+
'-webkit-box-orient': 'vertical',
|
|
127
|
+
'-webkit-line-clamp': '2',
|
|
128
|
+
overflowY: 'hidden',
|
|
129
|
+
gridRow: '2',
|
|
130
|
+
gridColumn: '1 / 3'
|
|
131
|
+
},
|
|
132
|
+
promptNoReasonMarker: {
|
|
133
|
+
// Truncate text after three lines when no reason marker is present.
|
|
134
|
+
'-webkit-line-clamp': '3'
|
|
135
|
+
},
|
|
136
|
+
reasonMarker: {
|
|
137
|
+
gridRow: '3',
|
|
138
|
+
gridColumn: '1 / 3',
|
|
139
|
+
..._reactcomponents.typographyStyles.caption2
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const useSingleColumnStyles = (0, _reactcomponents.makeStyles)({
|
|
143
|
+
primaryAction: {
|
|
144
|
+
display: 'flex',
|
|
145
|
+
borderRadius: _tokens.tokens.borderRadius2XL,
|
|
146
|
+
...(0, _reactcomponents.createFocusOutlineStyle)({
|
|
147
|
+
style: {
|
|
148
|
+
outlineRadius: _tokens.tokens.borderRadius2XL
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
},
|
|
152
|
+
prompt: {
|
|
153
|
+
..._reactcomponents.typographyStyles.caption1Strong
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const usePromptStarterStyles_unstable = (state)=>{
|
|
157
|
+
'use no memo';
|
|
158
|
+
const { isSingleColumn } = state;
|
|
159
|
+
const styles = useStyles();
|
|
160
|
+
const rootResetStyles = useRootResetStyles();
|
|
161
|
+
const singleColumnStyles = useSingleColumnStyles();
|
|
162
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.root, rootResetStyles, state.root.className);
|
|
163
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.primaryAction, styles.primaryAction, isSingleColumn && singleColumnStyles.primaryAction, state.primaryAction.className);
|
|
164
|
+
if (state.icon) {
|
|
165
|
+
state.icon.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
166
|
+
}
|
|
167
|
+
if (state.category) {
|
|
168
|
+
state.category.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.category, styles.category, state.category.className);
|
|
169
|
+
}
|
|
170
|
+
state.prompt.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.prompt, styles.prompt, !state.reasonMarker && styles.promptNoReasonMarker, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
171
|
+
if (state.reasonMarker) {
|
|
172
|
+
state.reasonMarker.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.reasonMarker, styles.reasonMarker, state.reasonMarker.className);
|
|
173
|
+
}
|
|
174
|
+
if (state.actions) {
|
|
175
|
+
state.actions.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.actions, styles.actions, state.category && styles.actionsWithCategory, state.actions.className);
|
|
176
|
+
}
|
|
177
|
+
return state;
|
|
178
|
+
};
|
|
@@ -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 primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n category: 'fai-PromptStarter__category',\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 position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n gridAutoRows: 'max-content 1fr max-content',\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 columnGap: tokens.spacingHorizontalMNudge,\n rowGap: tokens.spacingVerticalS,\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 gridRow: 1,\n gridColumn: '1 / 2',\n },\n category: {\n display: 'flex',\n alignItems: 'center',\n ...typographyStyles.body1Strong,\n\n gridRow: 1,\n gridColumn: '2 / 3',\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 actionsWithCategory: {\n // Add a background and gradient fade to truncate the title if applicable\n backgroundColor: tokens.colorNeutralBackground1,\n\n boxShadow: `-12px 0 12px 0 ${tokens.colorNeutralBackground1}`,\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 gridRow: '2',\n gridColumn: '1 / 3',\n },\n promptNoReasonMarker: {\n // Truncate text after three lines when no reason marker is present.\n '-webkit-line-clamp': '3',\n },\n reasonMarker: {\n gridRow: '3',\n gridColumn: '1 / 3',\n ...typographyStyles.caption2,\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\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 if (state.category) {\n state.category.className = mergeClasses(\n promptStarterClassNames.category,\n styles.category,\n state.category.className,\n );\n }\n state.prompt.className = mergeClasses(\n promptStarterClassNames.prompt,\n styles.prompt,\n !state.reasonMarker && styles.promptNoReasonMarker,\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(\n promptStarterClassNames.actions,\n styles.actions,\n state.category && styles.actionsWithCategory,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","usePromptStarterStyles_unstable","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","makeResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","tokens","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","makeStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","columnGap","spacingHorizontalMNudge","rowGap","spacingVerticalS","spacingVerticalL","spacingHorizontalL","shorthands","border","strokeWidthThin","colorNeutralStroke2","createFocusOutlineStyle","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","typographyStyles","body1Strong","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","overflowY","promptNoReasonMarker","caption2","useSingleColumnStyles","borderRadius2XL","caption1Strong","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;IA2IAC,+BAAAA;eAAAA;;;iCAhJN;wBACgB;AAIhB,MAAMD,0BAA8D;IACzEE,MAAM;IACNC,eAAe;IACfC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX;AAEA,MAAMC,qBAAqBC,IAAAA,gCAAAA,EAAgB;IACzCC,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEd,wBAAwBG,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CY,WAAWC,cAAAA,CAAOC,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEH,cAAAA,CAAOI,cAAc,CAAC,CAAC,EAAEJ,cAAAA,CAAOK,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,EAAErB,wB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EAAE;QACtBqE,MAAMrE,YAAY,CAAC0E,SAAS,GAAGC,IAAAA,6BAAAA,EAC7BlF,wBAAwBO,YAAY,EACpCuE,OAAOvE,YAAY,EACnBqE,MAAMrE,YAAY,CAAC0E,SAAS;IAEhC;IACA,IAAIL,MAAMpE,OAAO,EAAE;QACjBoE,MAAMpE,OAAO,CAACyE,SAAS,GAAGC,IAAAA,6BAAAA,EACxBlF,wBAAwBQ,OAAO,EAC/BsE,OAAOtE,OAAO,EACdoE,MAAMvE,QAAQ,IAAIyE,OAAOT,mBAAmB,EAC5CO,MAAMpE,OAAO,CAACyE,SAAS;IAE3B;IAEA,OAAOL;AACT"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PromptStarterList", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PromptStarterList;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _usePromptStarterList = require("./usePromptStarterList");
|
|
14
|
+
const _renderPromptStarterList = require("./renderPromptStarterList");
|
|
15
|
+
const _usePromptStarterListStylesstyles = require("./usePromptStarterListStyles.styles");
|
|
16
|
+
const _usePromptStarterListContextValues = require("./usePromptStarterListContextValues");
|
|
17
|
+
const PromptStarterList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _usePromptStarterList.usePromptStarterList_unstable)(props, ref);
|
|
19
|
+
const contextValues = (0, _usePromptStarterListContextValues.usePromptStarterListContextValues)(state);
|
|
20
|
+
(0, _usePromptStarterListStylesstyles.usePromptStarterListStyles_unstable)(state);
|
|
21
|
+
return (0, _renderPromptStarterList.renderPromptStarterList_unstable)(state, contextValues);
|
|
22
|
+
});
|
|
23
|
+
PromptStarterList.displayName = 'PromptStarterList';
|
|
@@ -0,0 +1 @@
|
|
|
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":["PromptStarterList","React","forwardRef","props","ref","state","usePromptStarterList_unstable","contextValues","usePromptStarterListContextValues","usePromptStarterListStyles_unstable","renderPromptStarterList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;sCACuB;yCACG;kDACG;mDAGF;AAE3C,MAAMA,oBAAAA,WAAAA,GAAiEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQC,IAAAA,mDAAAA,EAA8BH,OAAOC;IACnD,MAAMG,gBAAgBC,IAAAA,oEAAAA,EAAkCH;IAExDI,IAAAA,qEAAAA,EAAoCJ;IACpC,OAAOK,IAAAA,yDAAAA,EAAiCL,OAAOE;AACjD;AAEAP,kBAAkBW,WAAW,GAAG"}
|
package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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 actions?: Slot<'span'>;\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":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 _PromptStarterList.PromptStarterList;
|
|
14
|
+
},
|
|
15
|
+
promptStarterListClassNames: function() {
|
|
16
|
+
return _usePromptStarterListStylesstyles.promptStarterListClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarterList_unstable: function() {
|
|
19
|
+
return _renderPromptStarterList.renderPromptStarterList_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterListStyles_unstable: function() {
|
|
22
|
+
return _usePromptStarterListStylesstyles.usePromptStarterListStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarterList_unstable: function() {
|
|
25
|
+
return _usePromptStarterList.usePromptStarterList_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _PromptStarterList = require("./PromptStarterList");
|
|
29
|
+
const _renderPromptStarterList = require("./renderPromptStarterList");
|
|
30
|
+
const _usePromptStarterList = require("./usePromptStarterList");
|
|
31
|
+
const _usePromptStarterListStylesstyles = require("./usePromptStarterListStyles.styles");
|
|
@@ -0,0 +1 @@
|
|
|
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","promptStarterListClassNames","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,iBAAiB;eAAjBA,oCAAiB;;IASjBC,2BAA2B;eAA3BA,6DAA2B;;IAF3BC,gCAAgC;eAAhCA,yDAAgC;;IAEHC,mCAAmC;eAAnCA,qEAAmC;;IADhEC,6BAA6B;eAA7BA,mDAA6B;;;mCARJ;yCAOe;sCACH;kDACmC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderPromptStarterList_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderPromptStarterList_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const _PromptStarterListContext = require("../../../contexts/PromptStarterListContext");
|
|
14
|
+
const renderPromptStarterList_unstable = (state, contextValue)=>{
|
|
15
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
16
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_PromptStarterListContext.PromptStarterListProvider, {
|
|
17
|
+
value: contextValue,
|
|
18
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.PresenceGroup, {
|
|
21
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.gridWrapper, {
|
|
22
|
+
children: state.root.children
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
state.actions && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.actions, {}),
|
|
26
|
+
state.expandButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandButton, {})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderPromptStarterList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, PresenceGroup } from '@fluentui/react-components';\nimport type { JSXElement } 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): JSXElement => {\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.actions && <state.actions />}\n {state.expandButton && <state.expandButton />}\n </state.root>\n </PromptStarterListProvider>\n );\n};\n"],"names":["renderPromptStarterList_unstable","state","contextValue","assertSlots","_jsx","PromptStarterListProvider","value","_jsxs","root","PresenceGroup","gridWrapper","children","actions","expandButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;4BAdb;iCAE2C;0CAED;AAUnC,MAAMA,mCAAmC,CAC9CC,OACAC;IAEAC,IAAAA,4BAAAA,EAAoCF;IAEpC,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,mDAAAA,EAAAA;QAA0BC,OAAOJ;kBAChC,WAAA,GAAAK,IAAAA,gBAAA,EAACN,MAAMO,IAAI,EAAA;;8BACTJ,IAAAA,eAAA,EAACK,8BAAAA,EAAAA;8BACC,WAAA,GAAAL,IAAAA,eAAA,EAACH,MAAMS,WAAW,EAAA;kCAAET,MAAMO,IAAI,CAACG,QAAQ;;;gBAExCV,MAAMW,OAAO,IAAA,WAAA,GAAIR,IAAAA,eAAA,EAACH,MAAMW,OAAO,EAAA,CAAA;gBAC/BX,MAAMY,YAAY,IAAA,WAAA,GAAIT,IAAAA,eAAA,EAACH,MAAMY,YAAY,EAAA,CAAA;;;;AAIlD"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "usePromptStarterList_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return usePromptStarterList_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
15
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
+
const _promptStarterMotion = require("../PromptStarter/promptStarterMotion");
|
|
17
|
+
const usePromptStarterList_unstable = (props, ref)=>{
|
|
18
|
+
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', animateOnMount = true } = props;
|
|
19
|
+
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
20
|
+
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
21
|
+
const focusAttrs = (0, _reactcomponents.useArrowNavigationGroup)({
|
|
22
|
+
...arrowNavigationOptions,
|
|
23
|
+
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'both',
|
|
24
|
+
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
25
|
+
});
|
|
26
|
+
const [isExpanded, setIsExpanded] = _react.useState(false);
|
|
27
|
+
const [numberOfColumns, setNumberOfColumns] = _react.useState(3);
|
|
28
|
+
const gridWrapperRef = _react.useRef(null);
|
|
29
|
+
const { targetDocument } = (0, _reactcomponents.useFluent)();
|
|
30
|
+
const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
|
|
31
|
+
_react.useEffect(()=>{
|
|
32
|
+
if (!win || !gridWrapperRef.current) return;
|
|
33
|
+
const promptStarterGrid = gridWrapperRef.current;
|
|
34
|
+
const updateNumberOfColumns = ()=>{
|
|
35
|
+
const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
|
|
36
|
+
setNumberOfColumns(numColumns);
|
|
37
|
+
};
|
|
38
|
+
const ro = new win.ResizeObserver(updateNumberOfColumns);
|
|
39
|
+
ro.observe(promptStarterGrid);
|
|
40
|
+
return ()=>{
|
|
41
|
+
ro.unobserve(promptStarterGrid);
|
|
42
|
+
};
|
|
43
|
+
}, [
|
|
44
|
+
win
|
|
45
|
+
]);
|
|
46
|
+
const state = {
|
|
47
|
+
numberOfColumns: numberOfColumns,
|
|
48
|
+
isExpanded,
|
|
49
|
+
designVersion,
|
|
50
|
+
components: {
|
|
51
|
+
root: 'div',
|
|
52
|
+
gridWrapper: 'div',
|
|
53
|
+
actions: 'span',
|
|
54
|
+
expandButton: _reactcomponents.Button
|
|
55
|
+
},
|
|
56
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
57
|
+
ref,
|
|
58
|
+
...props
|
|
59
|
+
}), {
|
|
60
|
+
elementType: 'div'
|
|
61
|
+
}),
|
|
62
|
+
gridWrapper: _reactcomponents.slot.always(props.gridWrapper, {
|
|
63
|
+
defaultProps: {
|
|
64
|
+
role: 'list',
|
|
65
|
+
...focusAttrs
|
|
66
|
+
},
|
|
67
|
+
elementType: 'div'
|
|
68
|
+
}),
|
|
69
|
+
actions: _reactcomponents.slot.optional(props.actions, {
|
|
70
|
+
elementType: 'span'
|
|
71
|
+
}),
|
|
72
|
+
expandButton: _reactcomponents.slot.optional(props.expandButton, {
|
|
73
|
+
defaultProps: {
|
|
74
|
+
appearance: 'subtle',
|
|
75
|
+
size: 'small',
|
|
76
|
+
shape: 'rounded',
|
|
77
|
+
icon: /*#__PURE__*/ _react.createElement(_reacticons.ChevronDown12Regular, null),
|
|
78
|
+
iconPosition: 'after',
|
|
79
|
+
'aria-expanded': isExpanded,
|
|
80
|
+
children: isExpanded ? collapseButtonLabel : expandButtonLabel
|
|
81
|
+
},
|
|
82
|
+
renderByDefault: true,
|
|
83
|
+
elementType: _reactcomponents.Button
|
|
84
|
+
})
|
|
85
|
+
};
|
|
86
|
+
state.gridWrapper.ref = (0, _reactcomponents.useMergedRefs)(gridWrapperRef, state.gridWrapper.ref);
|
|
87
|
+
// Get the array of children.
|
|
88
|
+
const childrenArray = _react.useMemo(()=>{
|
|
89
|
+
return _react.Children.toArray(state.root.children);
|
|
90
|
+
}, [
|
|
91
|
+
state.root.children
|
|
92
|
+
]);
|
|
93
|
+
// Add motion to the children.
|
|
94
|
+
const childrenWithMotion = _react.useMemo(()=>childrenArray.map((child, index)=>{
|
|
95
|
+
// Throw error if the child is not a valid React element or is a Fragment.
|
|
96
|
+
if (!/*#__PURE__*/ _react.isValidElement(child) || child.type === _react.Fragment) {
|
|
97
|
+
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
98
|
+
}
|
|
99
|
+
// In the collapsed state, if there is one column, we show three children.
|
|
100
|
+
// If there are two or three columns, we show two or three. All children
|
|
101
|
+
// are shown in the expanded state.
|
|
102
|
+
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
|
|
103
|
+
return /*#__PURE__*/ _react.createElement(_promptStarterMotion.PromptStarterMotion, {
|
|
104
|
+
appear: animateOnMount,
|
|
105
|
+
key: index,
|
|
106
|
+
index: index,
|
|
107
|
+
visible: visibility,
|
|
108
|
+
numberOfColumns: numberOfColumns
|
|
109
|
+
}, child);
|
|
110
|
+
}), [
|
|
111
|
+
childrenArray,
|
|
112
|
+
numberOfColumns,
|
|
113
|
+
isExpanded
|
|
114
|
+
]);
|
|
115
|
+
state.root.children = childrenWithMotion;
|
|
116
|
+
if (state.expandButton) {
|
|
117
|
+
state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick, ()=>setIsExpanded(!isExpanded));
|
|
118
|
+
}
|
|
119
|
+
return state;
|
|
120
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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 ?? 'both',\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 actions: 'span',\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 actions: slot.optional(props.actions, {\n elementType: 'span',\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":["usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","animateOnMount","designVersion","useDesignVersion","focusAttrs","useArrowNavigationGroup","axis","memorizeCurrent","isExpanded","setIsExpanded","React","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","useFluent","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","actions","expandButton","Button","slot","always","getIntrinsicElementProps","elementType","defaultProps","role","optional","appearance","size","shape","icon","createElement","ChevronDown12Regular","iconPosition","children","renderByDefault","useMergedRefs","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","PromptStarterMotion","appear","key","visible","onClick","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBaA;;;eAAAA;;;;iEAxBU;iCAShB;+BAE0B;4BACI;qCACD;AAW7B,MAAMA,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EACJC,sBAAsB,EACtBC,oBAAoB,WAAW,EAC/BC,sBAAsB,WAAW,EACjCC,iBAAiB,IAAI,EACtB,GAAGL;IACJ,MAAMM,gBAAgBC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EA,0EAA0E;YAC1E,wEAAwE;YACxE,mCAAmC;YACnC,MAAMC,aAAazD,oBAAqB,KAAKoD,QAAQ,KAAMA,QAAQpD,mBAAmBJ;YAEtF,OAAA,WAAA,GACEE,OAAAyC,aAAA,CAACmB,wCAAAA,EAAAA;gBACCC,QAAQtE;gBACRuE,KAAKR;gBACLA,OAAOA;gBACPS,SAASJ;gBACTzD,iBAAiBA;eAEhBmD;QAGP,IACF;QAACN;QAAe7C;QAAiBJ;KAAW;IAG9CyB,MAAME,IAAI,CAACmB,QAAQ,GAAGO;IAEtB,IAAI5B,MAAMK,YAAY,EAAE;QACtBL,MAAMK,YAAY,CAACoC,OAAO,GAAGC,IAAAA,+BAAAA,EAC3B1C,MAAMK,YAAY,CAACoC,OAAO,EAC1B,IAAMjE,cAAc,CAACD;IAEzB;IAEA,OAAOyB;AACT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "usePromptStarterListContextValues", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return usePromptStarterListContextValues;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function usePromptStarterListContextValues(state) {
|
|
12
|
+
const { numberOfColumns } = state;
|
|
13
|
+
return {
|
|
14
|
+
numberOfColumns
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
promptStarterListClassNames: function() {
|
|
13
|
+
return promptStarterListClassNames;
|
|
14
|
+
},
|
|
15
|
+
usePromptStarterListStyles_unstable: function() {
|
|
16
|
+
return usePromptStarterListStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const promptStarterListClassNames = {
|
|
21
|
+
root: 'fai-PromptStarterList',
|
|
22
|
+
gridWrapper: 'fai-PromptStarterList__gridWrapper',
|
|
23
|
+
actions: 'fai-PromptStarterList__actions',
|
|
24
|
+
expandButton: 'fai-PromptStarterList__expandButton'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Styles for the root slot
|
|
28
|
+
*/ const useRootClassName = (0, _reactcomponents.__resetStyles)("r1svwxtk", null, [
|
|
29
|
+
".r1svwxtk{display:grid;grid-template-columns:1fr max-content max-content;grid-template-rows:max-content max-content;grid-template-areas:\"grid grid grid\" \". actions expandButton\";max-width:772px;row-gap:var(--spacingVerticalXL);column-gap:var(--spacingHorizontalSNudge);}"
|
|
30
|
+
]);
|
|
31
|
+
const useStyles = (0, _reactcomponents.__styles)({
|
|
32
|
+
gridWrapper: {
|
|
33
|
+
Bw0ie65: 0,
|
|
34
|
+
Br312pm: 0,
|
|
35
|
+
nk6f5a: 0,
|
|
36
|
+
Ijaq50: 0,
|
|
37
|
+
Bq1tomu: "fl4njfv",
|
|
38
|
+
mc9l5x: "f13qh94s",
|
|
39
|
+
i8kkvl: 0,
|
|
40
|
+
Belr9w4: 0,
|
|
41
|
+
rmohyg: "f1p93rwu",
|
|
42
|
+
t4k1zu: "f4wu0r3",
|
|
43
|
+
Budl1dq: "fvo7o13",
|
|
44
|
+
Bxotwcr: "f1nkeedh"
|
|
45
|
+
},
|
|
46
|
+
actions: {
|
|
47
|
+
Bw0ie65: 0,
|
|
48
|
+
Br312pm: 0,
|
|
49
|
+
nk6f5a: 0,
|
|
50
|
+
Ijaq50: 0,
|
|
51
|
+
Bq1tomu: "fceb517"
|
|
52
|
+
},
|
|
53
|
+
expandButton: {
|
|
54
|
+
Bw0ie65: 0,
|
|
55
|
+
Br312pm: 0,
|
|
56
|
+
nk6f5a: 0,
|
|
57
|
+
Ijaq50: 0,
|
|
58
|
+
Bq1tomu: "f1najgz0",
|
|
59
|
+
wrk2wx: "f11k2d1d",
|
|
60
|
+
dutsh0: "f1iwh30k",
|
|
61
|
+
B4u5nao: "fn63aq9",
|
|
62
|
+
Bbdnnc7: "fm7zj7h",
|
|
63
|
+
x3br3k: "fuzcl37"
|
|
64
|
+
},
|
|
65
|
+
expandButtonExpanded: {
|
|
66
|
+
Bs9jjb3: [
|
|
67
|
+
"f5l68jj",
|
|
68
|
+
"f1i29bk4"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
d: [
|
|
73
|
+
[
|
|
74
|
+
".fl4njfv{grid-area:grid;}",
|
|
75
|
+
{
|
|
76
|
+
p: -1
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
".f13qh94s{display:grid;}",
|
|
80
|
+
[
|
|
81
|
+
".f1p93rwu{gap:var(--spacingHorizontalL);}",
|
|
82
|
+
{
|
|
83
|
+
p: -1
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
".f4wu0r3{grid-auto-columns:max-content;}",
|
|
87
|
+
".fvo7o13{grid-template-columns:repeat(auto-fit, minmax(214px, 1fr));}",
|
|
88
|
+
".f1nkeedh{grid-auto-flow:unset;}",
|
|
89
|
+
[
|
|
90
|
+
".fceb517{grid-area:actions;}",
|
|
91
|
+
{
|
|
92
|
+
p: -1
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
".f1najgz0{grid-area:expandButton;}",
|
|
97
|
+
{
|
|
98
|
+
p: -1
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
".f11k2d1d .fui-Button__icon{font-size:12px;}",
|
|
102
|
+
".f1iwh30k .fui-Button__icon{height:12px;}",
|
|
103
|
+
".fn63aq9 .fui-Button__icon{width:12px;}",
|
|
104
|
+
".f5l68jj>.fui-Button__icon{transform:rotate(180deg);}",
|
|
105
|
+
".f1i29bk4>.fui-Button__icon{transform:rotate(-180deg);}"
|
|
106
|
+
],
|
|
107
|
+
h: [
|
|
108
|
+
".fm7zj7h:hover .fui-Button__icon{color:var(--colorNeutralForeground2Hover);}",
|
|
109
|
+
".fuzcl37:hover:active .fui-Button__icon{color:var(--colorNeutralForeground2Pressed);}"
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
const usePromptStarterListStyles_unstable = (state)=>{
|
|
113
|
+
'use no memo';
|
|
114
|
+
const { isExpanded } = state;
|
|
115
|
+
const rootClassName = useRootClassName();
|
|
116
|
+
const styles = useStyles();
|
|
117
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.root, rootClassName, state.root.className);
|
|
118
|
+
state.gridWrapper.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
|
|
119
|
+
if (state.actions) {
|
|
120
|
+
state.actions.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.actions, styles.actions, state.actions.className);
|
|
121
|
+
}
|
|
122
|
+
if (state.expandButton) {
|
|
123
|
+
state.expandButton.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
|
|
124
|
+
}
|
|
125
|
+
return state;
|
|
126
|
+
}; //# sourceMappingURL=usePromptStarterListStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 actions: 'fai-PromptStarterList__actions',\n expandButton: 'fai-PromptStarterList__expandButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr max-content max-content',\n gridTemplateRows: 'max-content max-content',\n gridTemplateAreas: `\"grid grid grid\"\n \". actions expandButton\"`,\n maxWidth: '772px',\n rowGap: tokens.spacingVerticalXL,\n columnGap: tokens.spacingHorizontalSNudge,\n});\n\nconst useStyles = makeStyles({\n gridWrapper: {\n gridArea: 'grid',\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 actions: {\n gridArea: 'actions',\n },\n\n expandButton: {\n gridArea: 'expandButton',\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.actions) {\n state.actions.className = mergeClasses(\n promptStarterListClassNames.actions,\n styles.actions,\n state.actions.className,\n );\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":["promptStarterListClassNames","gridWrapper","root","actions","expandButton","display","__resetStyles","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","maxWidth","rowGap","tokens","columnGap","mc9l5x","i8kkvl","useStyles","gridArea","gridAutoColumns","gridAutoFlow","Bw0ie65","Ijaq50","buttonClassNames","fontSize","height","width","expandButtonExpanded","p","usePromptStarterListStyles_unstable","state","isExpanded","rootClassName","useRootClassName","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,2BAAAA;eAAAA;;IAyELC,mCACJD;eADIC;;;iCA9E4D;AAK7D,MAAMD,8BAAsE;UACjFE;iBACAD;aACAE;kBACAC;AACF;AAEA;;CAEC,SAECC,mBAASC,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MACTC,YAAAA,IAAAA,yBAAqB,EAAA;iBACrBC;QACAC,SAAAA;;QAEAC,QAAAA;QACAC,QAAQC;QACRC,SAAAA;QACFC,QAAA;QAEAC,QAAMC;QACJf,SAAAA;gBACEgB;gBACAZ;iBACKO;iBACLM;;aAGAC;QACFC,SAAA;QAEAjB,SAAS;gBACPc;QACFI,QAAA;QAEAjB,SAAAA;;kBAESkB;iBACLC;iBACAC;gBACAC;gBACF;iBACA;gBACE;;iBAEA;iBACF;gBACA;;0BAEWb;iBACT;YAAA;YAAA;SAAA;;;OAIJc;QAAAA;YAAAA;YAAsB;oBACpB;;;;QACa;YAAA;YAAA;oBACb;;SACF;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBACFC,GAAA,CAAA;YAEA;SAAA;QAAA;YAAA;YAAA;;YAEC;SACD;QAAA;QAAaC;QAAuCC;QAAAA;QAAAA;KAAAA;OAClD;QAAA;QAAA;KAAA;;AAOAA,MAAM5B,sCACJD,CAAAA;;UAUF,EACA8B,UAAU1B;UAOV2B,gBAAAC;UAEAC,SAAOJ;IACPA,MAAA3B,IAAA,CAAAgC,SAAA,GAAAC,IAAAA,6BAAA,EAAAnC,4BAAAE,IAAA,EAAA6B,eAAAF,MAAA3B,IAAA,CAAAgC,SAAA"}
|