@fluentui-copilot/react-prompt-starter 0.9.3 → 0.10.0

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.
Files changed (80) hide show
  1. package/CHANGELOG.json +57 -1
  2. package/CHANGELOG.md +23 -2
  3. package/dist/index.d.ts +109 -0
  4. package/lib/PromptStarterList.js +2 -0
  5. package/lib/PromptStarterList.js.map +1 -0
  6. package/lib/PromptStarterV2.js +2 -0
  7. package/lib/PromptStarterV2.js.map +1 -0
  8. package/lib/components/PromptStarter/usePromptStarter.js +10 -1
  9. package/lib/components/PromptStarter/usePromptStarter.js.map +1 -1
  10. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +13 -0
  11. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  12. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +4 -0
  13. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  14. package/lib/components/PromptStarterV2/PromptStarter/index.js +5 -0
  15. package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  16. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +43 -0
  17. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  18. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +11 -0
  19. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  20. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  21. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  22. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +204 -0
  23. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  24. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
  25. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  26. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
  27. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  28. package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
  29. package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  30. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
  31. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  32. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +114 -0
  33. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  34. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
  35. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  36. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
  37. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  38. package/lib/contexts/PromptStarterListContext.js +8 -0
  39. package/lib/contexts/PromptStarterListContext.js.map +1 -0
  40. package/lib/index.js +2 -0
  41. package/lib/index.js.map +1 -1
  42. package/lib-commonjs/PromptStarterList.js +29 -0
  43. package/lib-commonjs/PromptStarterList.js.map +1 -0
  44. package/lib-commonjs/PromptStarterV2.js +29 -0
  45. package/lib-commonjs/PromptStarterV2.js.map +1 -0
  46. package/lib-commonjs/components/PromptStarter/usePromptStarter.js +9 -0
  47. package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
  48. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +23 -0
  49. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  50. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +7 -0
  51. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  52. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +32 -0
  53. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  54. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +60 -0
  55. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  56. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +27 -0
  57. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  58. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  59. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  60. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +381 -0
  61. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  62. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
  63. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  64. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
  65. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  66. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
  67. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  68. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
  69. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  70. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
  71. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  72. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
  73. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  74. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
  75. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  76. package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
  77. package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
  78. package/lib-commonjs/index.js +32 -0
  79. package/lib-commonjs/index.js.map +1 -1
  80. package/package.json +3 -2
@@ -0,0 +1,381 @@
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 promptStarterClassNames = {
21
+ root: 'fai-PromptStarter',
22
+ primaryAction: 'fai-PromptStarter__primaryAction',
23
+ icon: 'fai-PromptStarter__icon',
24
+ prompt: 'fai-PromptStarter__prompt',
25
+ reasonMarker: 'fai-PromptStarter__reasonMarker',
26
+ actions: 'fai-PromptStarter__actions'
27
+ };
28
+ const useRootResetStyles = (0, _reactcomponents.__resetStyles)("r1x2hm06", null, [
29
+ ".r1x2hm06{display:grid;grid-template-columns:1fr auto;grid-template-rows:max-content auto;min-width:214px;}",
30
+ ".r1x2hm06:hover .fai-PromptStarter__primaryAction{box-shadow:var(--shadow16);transform:scale(1.03);transition:transform var(--durationNormal) var(--curveDecelerateMin);}",
31
+ ".r1x2hm06:active .fai-PromptStarter__primaryAction{box-shadow:var(--shadow8);transform:scale(1.03);transition:transform var(--durationNormal) var(--curveDecelerateMin);}",
32
+ ".r1x2hm06:not(:focus-within):not(:hover) .fai-PromptStarter__actions{clip:rect(0px, 0px, 0px, 0px);height:1px;margin:-1px;overflow:hidden;padding:0px;width:1px;position:absolute;opacity:0;}"
33
+ ]);
34
+ const useStyles = (0, _reactcomponents.__styles)({
35
+ primaryAction: {
36
+ nk6f5a: 0,
37
+ Ijaq50: 0,
38
+ h3tjnc: "fcdwmbt",
39
+ Bw0ie65: 0,
40
+ Br312pm: 0,
41
+ Beweih1: "f1eb8yyf",
42
+ mc9l5x: "f22iagw",
43
+ Beiy3e4: "f1vx9l62",
44
+ qhf8xq: "f10pi13n",
45
+ Beyfa6y: 0,
46
+ Bbmb7ep: 0,
47
+ Btl43ni: 0,
48
+ B7oj6ja: 0,
49
+ Dimara: "f14w4nd",
50
+ De3pzq: "fxugw4r",
51
+ sj55zd: "fkfq4zb",
52
+ Bahqtrf: "fk6fouc",
53
+ Bceei9c: "f1k6fduh",
54
+ oeaueh: "f1s6fcnf",
55
+ fsow6f: [
56
+ "f1o700av",
57
+ "fes3tcz"
58
+ ],
59
+ Belr9w4: "fylz90v",
60
+ Byoj8tv: 0,
61
+ uwmqm3: 0,
62
+ z189sj: 0,
63
+ z8tnut: 0,
64
+ B0ocmuz: "fq88wcj",
65
+ B4j52fo: "f192inf7",
66
+ Bekrc4i: [
67
+ "f5tn483",
68
+ "f1ojsxk5"
69
+ ],
70
+ Bn0qgzm: "f1vxd6vx",
71
+ ibv6hh: [
72
+ "f1ojsxk5",
73
+ "f5tn483"
74
+ ],
75
+ icvyot: "fzkkow9",
76
+ vrafjx: [
77
+ "fcdblym",
78
+ "fjik90z"
79
+ ],
80
+ oivjwe: "fg706s2",
81
+ wvpqe5: [
82
+ "fjik90z",
83
+ "fcdblym"
84
+ ],
85
+ g2u3we: "f68mrw8",
86
+ h3c5rm: [
87
+ "f7pw515",
88
+ "fw35ms5"
89
+ ],
90
+ B9xav0g: "frpde29",
91
+ zhjwy3: [
92
+ "fw35ms5",
93
+ "f7pw515"
94
+ ],
95
+ Brovlpu: "ftqa4ok",
96
+ B486eqv: "f2hkw1w",
97
+ B8q5s1w: "f8hki3x",
98
+ Bci5o5g: [
99
+ "f1d2448m",
100
+ "ffh67wi"
101
+ ],
102
+ n8qw10: "f1bjia2o",
103
+ Bdrgwmp: [
104
+ "ffh67wi",
105
+ "f1d2448m"
106
+ ],
107
+ Bqhya38: "f1j6vpng",
108
+ Bwxa6fj: [
109
+ "f1pniga2",
110
+ "f1ffjurs"
111
+ ],
112
+ Bdhvstf: "f987i1v",
113
+ B7zbvrb: [
114
+ "f1ffjurs",
115
+ "f1pniga2"
116
+ ],
117
+ Bm4h7ae: "f15bsgw9",
118
+ B7ys5i9: "f14e48fq",
119
+ Busjfv9: "f18yb2kv",
120
+ Bhk32uz: "fd6o370",
121
+ f6g5ot: 0,
122
+ Boxcth7: 0,
123
+ Bhdgwq3: 0,
124
+ hgwjuy: 0,
125
+ Bshpdp8: 0,
126
+ Bsom6fd: 0,
127
+ Blkhhs4: 0,
128
+ Bonggc9: 0,
129
+ Ddfuxk: 0,
130
+ i03rao: 0,
131
+ kclons: 0,
132
+ clg4pj: 0,
133
+ Bpqj9nj: 0,
134
+ B6dhp37: 0,
135
+ Bf4ptjt: 0,
136
+ Bqtpl0w: 0,
137
+ i4rwgc: "ffwy5si",
138
+ Dah5zi: 0,
139
+ B1tsrr9: 0,
140
+ qqdqy8: 0,
141
+ Bkh64rk: 0,
142
+ e3fwne: "faugzkp",
143
+ J0r882: "f57olzd",
144
+ Bule8hv: [
145
+ "f4stah7",
146
+ "fs1por5"
147
+ ],
148
+ Bjwuhne: "f480a47",
149
+ Ghsupd: [
150
+ "fs1por5",
151
+ "f4stah7"
152
+ ]
153
+ },
154
+ primaryActionHovered: {
155
+ E5pizo: "f1hg901r",
156
+ Bz10aip: "f15ncuxf",
157
+ Bn62ygk: 0,
158
+ Cwk7ip: 0,
159
+ B3o57yi: 0,
160
+ Bmy1vo4: 0,
161
+ Bkqvd7p: 0,
162
+ Bi2q7bf: "ffrhwuo"
163
+ },
164
+ icon: {
165
+ mc9l5x: "f22iagw",
166
+ Bt984gj: "f122n59",
167
+ sshi5w: "fntfeoj"
168
+ },
169
+ actions: {
170
+ jrapky: 0,
171
+ Frg6f3: 0,
172
+ t21cq0: 0,
173
+ B6of3ja: 0,
174
+ B74szlk: [
175
+ "foizga4",
176
+ "f5m8a6r"
177
+ ],
178
+ qhf8xq: "f10pi13n",
179
+ nk6f5a: 0,
180
+ Ijaq50: 0,
181
+ h3tjnc: "f3hl5xl",
182
+ Bw0ie65: 0,
183
+ Br312pm: 0,
184
+ Beweih1: "f14q5zaz",
185
+ abs64n: "f5p0z4x",
186
+ Bn62ygk: 0,
187
+ Cwk7ip: 0,
188
+ B3o57yi: 0,
189
+ Bmy1vo4: 0,
190
+ Bkqvd7p: 0,
191
+ Bi2q7bf: "f1964ud6"
192
+ },
193
+ prompt: {
194
+ Bahqtrf: "fk6fouc",
195
+ Be2twd7: "fkhj508",
196
+ Bhrd7zp: "fl43uef",
197
+ Bg96gwp: "f1i3iumi",
198
+ mc9l5x: "f1rvi9lw",
199
+ Fd1uvx: "fpfc2by",
200
+ Bh9c35c: "f1lvsx7g",
201
+ Bmxbyg5: "f1sil6mw"
202
+ },
203
+ reasonMarker: {
204
+ Bahqtrf: "fk6fouc",
205
+ Be2twd7: "f13mqy1h",
206
+ Bhrd7zp: "figsok6",
207
+ Bg96gwp: "fcpl73t"
208
+ },
209
+ singleColumnStyles: {
210
+ mc9l5x: "fjseox"
211
+ }
212
+ }, {
213
+ d: [
214
+ [
215
+ ".fcdwmbt{grid-row:1/3;}",
216
+ {
217
+ p: -1
218
+ }
219
+ ],
220
+ [
221
+ ".f1eb8yyf{grid-column:1/3;}",
222
+ {
223
+ p: -1
224
+ }
225
+ ],
226
+ ".f22iagw{display:flex;}",
227
+ ".f1vx9l62{flex-direction:column;}",
228
+ ".f10pi13n{position:relative;}",
229
+ [
230
+ ".f14w4nd{border-radius:28px;}",
231
+ {
232
+ p: -1
233
+ }
234
+ ],
235
+ ".fxugw4r{background-color:var(--colorNeutralBackground1);}",
236
+ ".fkfq4zb{color:var(--colorNeutralForeground2);}",
237
+ ".fk6fouc{font-family:var(--fontFamilyBase);}",
238
+ ".f1k6fduh{cursor:pointer;}",
239
+ ".f1s6fcnf{outline-style:none;}",
240
+ ".f1o700av{text-align:left;}",
241
+ ".fes3tcz{text-align:right;}",
242
+ ".fylz90v{row-gap:var(--spacingHorizontalS);}",
243
+ [
244
+ ".fq88wcj{padding:var(--spacingVerticalL) var(--spacingHorizontalL);}",
245
+ {
246
+ p: -1
247
+ }
248
+ ],
249
+ ".f192inf7{border-top-width:var(--strokeWidthThin);}",
250
+ ".f5tn483{border-right-width:var(--strokeWidthThin);}",
251
+ ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}",
252
+ ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}",
253
+ ".fzkkow9{border-top-style:solid;}",
254
+ ".fcdblym{border-right-style:solid;}",
255
+ ".fjik90z{border-left-style:solid;}",
256
+ ".fg706s2{border-bottom-style:solid;}",
257
+ ".f68mrw8{border-top-color:var(--colorNeutralStroke2);}",
258
+ ".f7pw515{border-right-color:var(--colorNeutralStroke2);}",
259
+ ".fw35ms5{border-left-color:var(--colorNeutralStroke2);}",
260
+ ".frpde29{border-bottom-color:var(--colorNeutralStroke2);}",
261
+ ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}",
262
+ ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}",
263
+ ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}",
264
+ ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}",
265
+ ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}",
266
+ ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}",
267
+ ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}",
268
+ ".fd6o370[data-fui-focus-visible]::after{z-index:1;}",
269
+ [
270
+ ".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}",
271
+ {
272
+ p: -2
273
+ }
274
+ ],
275
+ [
276
+ ".faugzkp[data-fui-focus-visible]::after{border-radius:28px;}",
277
+ {
278
+ p: -1
279
+ }
280
+ ],
281
+ ".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}",
282
+ ".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}",
283
+ ".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}",
284
+ ".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}",
285
+ ".f1hg901r{box-shadow:var(--shadow16);}",
286
+ ".f15ncuxf{transform:scale(1.03);}",
287
+ [
288
+ ".ffrhwuo{transition:transform var(--durationNormal) var(--curveDecelerateMin);}",
289
+ {
290
+ p: -1
291
+ }
292
+ ],
293
+ ".f122n59{align-items:center;}",
294
+ ".fntfeoj{min-height:var(--spacingVerticalXXL);}",
295
+ [
296
+ ".foizga4{margin:var(--spacingVerticalL) var(--spacingHorizontalL) var(--spacingVerticalNone) var(--spacingHorizontalNone);}",
297
+ {
298
+ p: -1
299
+ }
300
+ ],
301
+ [
302
+ ".f5m8a6r{margin:var(--spacingVerticalL) var(--spacingHorizontalNone) var(--spacingVerticalNone) var(--spacingHorizontalL);}",
303
+ {
304
+ p: -1
305
+ }
306
+ ],
307
+ [
308
+ ".f3hl5xl{grid-row:1/2;}",
309
+ {
310
+ p: -1
311
+ }
312
+ ],
313
+ [
314
+ ".f14q5zaz{grid-column:2/3;}",
315
+ {
316
+ p: -1
317
+ }
318
+ ],
319
+ ".f5p0z4x{opacity:1;}",
320
+ [
321
+ ".f1964ud6{transition:opacity var(--durationFast) var(--curveLinear);}",
322
+ {
323
+ p: -1
324
+ }
325
+ ],
326
+ ".fkhj508{font-size:var(--fontSizeBase300);}",
327
+ ".fl43uef{font-weight:var(--fontWeightSemibold);}",
328
+ ".f1i3iumi{line-height:var(--lineHeightBase300);}",
329
+ ".f1rvi9lw{display:-webkit-box;}",
330
+ ".fpfc2by{-webkit-box-orient:vertical;}",
331
+ ".f1lvsx7g{-webkit-line-clamp:2;}",
332
+ ".f1sil6mw{overflow-y:hidden;}",
333
+ ".f13mqy1h{font-size:var(--fontSizeBase100);}",
334
+ ".figsok6{font-weight:var(--fontWeightRegular);}",
335
+ ".fcpl73t{line-height:var(--lineHeightBase100);}",
336
+ ".fjseox{display:none;}"
337
+ ],
338
+ f: [
339
+ ".ftqa4ok:focus{outline-style:none;}"
340
+ ],
341
+ i: [
342
+ ".f2hkw1w:focus-visible{outline-style:none;}"
343
+ ],
344
+ m: [
345
+ [
346
+ "@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}",
347
+ {
348
+ m: "(forced-colors: active)"
349
+ }
350
+ ],
351
+ [
352
+ "@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}",
353
+ {
354
+ m: "(forced-colors: active)"
355
+ }
356
+ ],
357
+ [
358
+ "@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}",
359
+ {
360
+ m: "(forced-colors: active)"
361
+ }
362
+ ]
363
+ ]
364
+ });
365
+ const usePromptStarterStyles_unstable = (state)=>{
366
+ 'use no memo';
367
+ const { isSingleColumn } = state;
368
+ const styles = useStyles();
369
+ const rootResetStyles = useRootResetStyles();
370
+ state.root.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.root, rootResetStyles, state.root.className);
371
+ state.primaryAction.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.primaryAction, styles.primaryAction, state.primaryAction.className);
372
+ state.icon.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.icon, styles.icon, isSingleColumn && styles.singleColumnStyles, state.icon.className);
373
+ state.prompt.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.prompt, styles.prompt, state.prompt.className);
374
+ if (state.reasonMarker) {
375
+ state.reasonMarker.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.reasonMarker, styles.reasonMarker, isSingleColumn && styles.singleColumnStyles, state.reasonMarker.className);
376
+ }
377
+ if (state.actions) {
378
+ state.actions.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.actions, styles.actions, isSingleColumn && styles.singleColumnStyles, state.actions.className);
379
+ }
380
+ return state;
381
+ }; //# sourceMappingURL=usePromptStarterStyles.styles.js.map
@@ -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 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 // Hide icon, actions, and reason marker in single column appearance\n singleColumnStyles: {\n display: 'none',\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 state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n state.primaryAction.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n isSingleColumn && styles.singleColumnStyles,\n state.icon.className,\n );\n state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, state.prompt.className);\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n isSingleColumn && styles.singleColumnStyles,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n isSingleColumn && styles.singleColumnStyles,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterClassNames","root","primaryAction","icon","prompt","reasonMarker","actions","useRootResetStyles","makeResetStyles","display","__styles","gridTemplateColumns","gridTemplateRows","minWidth","h3tjnc","Bw0ie65","boxShadow","transform","transition","Beyfa6y","Bbmb7ep","Bahqtrf","Bceei9c","oeaueh","clip","height","margin","overflow","padding","width","position","opacity","ibv6hh","icvyot","vrafjx","useStyles","makeStyles","gridRow","gridColumn","flexDirection","borderRadius","backgroundColor","color","fontFamily","tokens","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","shorthands","border","strokeWidthThin","createFocusOutlineStyle","style","Boxcth7","primaryActionHovered","Blkhhs4","alignItems","minHeight","clg4pj","Bkh64rk","typographyStyles","E5pizo","Cwk7ip","B3o57yi","singleColumnStyles","Bi2q7bf","mc9l5x","Bt984gj","isSingleColumn","sshi5w","styles","state","B6of3ja","className","qhf8xq","nk6f5a","Br312pm"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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X;QACbuD,QAAA;QACA3D,SAAAA;iBACK0D;QACLE,QAAA;QAEAC,SAAA;QACAC,SAAAA;iBACE1D;QACF2D,SAAA;IACF;IAEAjE,MAAO;QACLkE,QAAA;QAEAC,SAAQC;QAERC,QAAMC;;aAEAxE;QACNyE,QAAMxE;QAKNwE,QAAMvE;QAMNuE,QAAMtE;QACNuE,SAAID;iBACFA;YAAMrE;YAAAA;SAAauE;QAMrBC,QAAA;QACAC,QAAIJ;gBACFA;QAMF5D,QAAA;QAEAC,SAAO2D;QACPK,SAAA"}
@@ -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'; //# sourceMappingURL=PromptStarterList.js.map
@@ -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","state","usePromptStarterList_unstable","contextValues","usePromptStarterListContextValues","usePromptStarterListStyles_unstable","renderPromptStarterList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;sCACuB;yCACG;kDACG;mDAGF;AAE3C,MAAMA,oBAAAA,WAAAA,GAAAA,OAAiEC,UAAMC,CAAU,CAACC,OAACA;UAC9FC,QAAMA,IAAAA,mDAAQC,EAAAA,OAA8BF;UAC5CG,gBAAMA,IAAAA,oEAAgBC,EAAAA;6EAEtBC,EAAAA;WACAC,IAAAA,yDAAOA,EAAAA,OAAiCL;AAC1C;AAEAJ,kBAAkBU,WAAW,GAAG"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ //# sourceMappingURL=PromptStarterList.types.js.map
@@ -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 expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<PromptStarterListSlots> &\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/**\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,32 @@
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");
32
+ //# sourceMappingURL=index.js.map
@@ -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,29 @@
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.expandButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandButton, {})
26
+ ]
27
+ })
28
+ });
29
+ }; //# sourceMappingURL=renderPromptStarterList.js.map
@@ -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 { 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","state","value","contextValue","_jsx","PresenceGroup","gridWrapper"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBEA;;;eAAAA;;;4BAjBF;iCAE2C;0CACD;AAcxCA,MAAAA,mCAAoCC,CAAAA,OAAAA;oCAEpC,EAAAA;WAC6BC,WAAOC,GAAAA,IAAAA,eAAAA,EAAAA,mDAAAA,EAAAA;;;;8BAE9BC,IAAAA,eAAA,EAACC,8BAAAA,EAAAA;4CACCD,IAAAA,eAAA,EAAAH,MAAAK,WAACL,EAAMK;qDAAaL"}
@@ -0,0 +1,116 @@
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' } = 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 : 'grid-linear',
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
+ expandButton: _reactcomponents.Button
54
+ },
55
+ root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
56
+ ref,
57
+ ...props
58
+ }), {
59
+ elementType: 'div'
60
+ }),
61
+ gridWrapper: _reactcomponents.slot.always(props.gridWrapper, {
62
+ defaultProps: {
63
+ role: 'group',
64
+ ...focusAttrs
65
+ },
66
+ elementType: 'div'
67
+ }),
68
+ expandButton: _reactcomponents.slot.optional(props.expandButton, {
69
+ defaultProps: {
70
+ appearance: 'subtle',
71
+ size: 'small',
72
+ shape: 'rounded',
73
+ icon: /*#__PURE__*/ _react.createElement(_reacticons.ChevronDown12Regular, null),
74
+ iconPosition: 'after',
75
+ 'aria-expanded': isExpanded,
76
+ children: isExpanded ? collapseButtonLabel : expandButtonLabel
77
+ },
78
+ renderByDefault: true,
79
+ elementType: _reactcomponents.Button
80
+ })
81
+ };
82
+ state.gridWrapper.ref = (0, _reactcomponents.useMergedRefs)(gridWrapperRef, state.gridWrapper.ref);
83
+ // Get the array of children.
84
+ const childrenArray = _react.useMemo(()=>{
85
+ return _react.Children.toArray(state.root.children);
86
+ }, [
87
+ state.root.children
88
+ ]);
89
+ // Add motion to the children.
90
+ const childrenWithMotion = _react.useMemo(()=>childrenArray.map((child, index)=>{
91
+ // Throw error if the child is not a valid React element or is a Fragment.
92
+ if (!/*#__PURE__*/ _react.isValidElement(child) || child.type === _react.Fragment) {
93
+ throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
94
+ }
95
+ return /*#__PURE__*/ _react.createElement(_promptStarterMotion.PromptStarterMotion, {
96
+ appear: true,
97
+ key: index,
98
+ index: index,
99
+ numberOfColumns: numberOfColumns
100
+ }, child);
101
+ }), [
102
+ childrenArray,
103
+ numberOfColumns
104
+ ]);
105
+ // In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.
106
+ if (!isExpanded) {
107
+ const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;
108
+ state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);
109
+ } else {
110
+ state.root.children = childrenWithMotion;
111
+ }
112
+ if (state.expandButton) {
113
+ state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick, ()=>setIsExpanded(!isExpanded));
114
+ }
115
+ return state;
116
+ }; //# sourceMappingURL=usePromptStarterList.js.map
@@ -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 { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less' } = 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: 'group',\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<(React.ReactChild | React.ReactFragment | React.ReactPortal)[]>(() => {\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 return (\n <PromptStarterMotion appear key={index} index={index} numberOfColumns={numberOfColumns}>\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns],\n );\n\n // In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.\n if (!isExpanded) {\n const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;\n state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);\n } else {\n state.root.children = childrenWithMotion;\n }\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":["arrowNavigationOptions","expandButtonLabel","useArrowNavigationGroup","memorizeCurrent","_arrowNavigationOptions_axis","_arrowNavigationOptions_memorizeCurrent","focusAttrs","isExpanded","React","setNumberOfColumns","axis","gridWrapperRef","targetDocument","useFluent","setIsExpanded","useState","numberOfColumns","promptStarterGrid","numColumns","win","defaultView","useEffect","ro","observe","current","getComputedStyle","gridTemplateColumns","split","length","ResizeObserver","updateNumberOfColumns","state","components","root","gridWrapper","slot","ref","props","Button","always","getIntrinsicElementProps","defaultProps","elementType","expandButton","size","icon","iconPosition","renderByDefault","createElement","ChevronDown12Regular","children","collapseButtonLabel","childrenArray","useMemo","childrenWithMotion","Error","map","child","index","isValidElement","PromptStarterMotion","appear","collapsedVisibleItems","slice","onClick","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BUA;;;eAAAA;;;;iEA5Ba;iCAShB;+BAE0B;4BACI;qCACD;AAelC,MAAQA,gCAAwBC,CAAAA,OAAAA;UAChC,wBAGQD,EAFRC,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