@fluentui-copilot/react-prompt-starter 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +36 -1
- package/CHANGELOG.md +13 -2
- package/dist/index.d.ts +48 -0
- package/lib/components/PromptStarter/PromptStarter.js +4 -1
- package/lib/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/PromptStarter.types.js +2 -0
- package/lib/components/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib/components/PromptStarter/renderPromptStarter.js +4 -1
- package/lib/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarter.js +3 -0
- package/lib/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js +4 -0
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +4 -1
- package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +2 -2
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +58 -31
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +33 -12
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +27 -8
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +2 -0
- package/lib-commonjs/components/PromptStarter/PromptStarter.types.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +2 -2
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +72 -34
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +33 -12
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +27 -8
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
- package/package.json +1 -1
package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js
CHANGED
|
@@ -176,20 +176,32 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
176
176
|
Beweih1: "f12k0sjh"
|
|
177
177
|
},
|
|
178
178
|
category: {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
nk6f5a: 0,
|
|
180
|
+
Ijaq50: 0,
|
|
181
|
+
h3tjnc: "fm1owph",
|
|
182
|
+
Bw0ie65: 0,
|
|
183
|
+
Br312pm: 0,
|
|
184
|
+
Beweih1: "f14q5zaz",
|
|
185
|
+
qb2dma: "f7nlbp4",
|
|
186
|
+
sj55zd: "f19n0e5",
|
|
181
187
|
Bahqtrf: "fk6fouc",
|
|
182
188
|
Be2twd7: "fkhj508",
|
|
183
189
|
Bhrd7zp: "fl43uef",
|
|
184
190
|
Bg96gwp: "f1i3iumi",
|
|
191
|
+
mc9l5x: "f1rvi9lw",
|
|
192
|
+
Fd1uvx: "fpfc2by",
|
|
193
|
+
Bh9c35c: "fvvof4m",
|
|
194
|
+
Bmxbyg5: "f1sil6mw",
|
|
195
|
+
Biipf1f: "f9ijwd5"
|
|
196
|
+
},
|
|
197
|
+
actions: {
|
|
185
198
|
nk6f5a: 0,
|
|
186
199
|
Ijaq50: 0,
|
|
187
|
-
h3tjnc: "
|
|
200
|
+
h3tjnc: "f3hl5xl",
|
|
188
201
|
Bw0ie65: 0,
|
|
189
202
|
Br312pm: 0,
|
|
190
|
-
Beweih1: "f14q5zaz"
|
|
191
|
-
|
|
192
|
-
actions: {
|
|
203
|
+
Beweih1: "f14q5zaz",
|
|
204
|
+
qhf8xq: "f10pi13n",
|
|
193
205
|
jrapky: 0,
|
|
194
206
|
Frg6f3: 0,
|
|
195
207
|
t21cq0: 0,
|
|
@@ -198,13 +210,6 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
198
210
|
"foizga4",
|
|
199
211
|
"f5m8a6r"
|
|
200
212
|
],
|
|
201
|
-
qhf8xq: "f10pi13n",
|
|
202
|
-
nk6f5a: 0,
|
|
203
|
-
Ijaq50: 0,
|
|
204
|
-
h3tjnc: "f3hl5xl",
|
|
205
|
-
Bw0ie65: 0,
|
|
206
|
-
Br312pm: 0,
|
|
207
|
-
Beweih1: "f14q5zaz",
|
|
208
213
|
abs64n: "f5p0z4x",
|
|
209
214
|
Bn62ygk: 0,
|
|
210
215
|
Cwk7ip: 0,
|
|
@@ -221,6 +226,12 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
221
226
|
]
|
|
222
227
|
},
|
|
223
228
|
prompt: {
|
|
229
|
+
nk6f5a: 0,
|
|
230
|
+
Ijaq50: 0,
|
|
231
|
+
h3tjnc: "f1daok31",
|
|
232
|
+
Bw0ie65: 0,
|
|
233
|
+
Br312pm: 0,
|
|
234
|
+
Beweih1: "f1eb8yyf",
|
|
224
235
|
Bahqtrf: "fk6fouc",
|
|
225
236
|
Be2twd7: "fkhj508",
|
|
226
237
|
Bhrd7zp: "fl43uef",
|
|
@@ -229,12 +240,7 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
229
240
|
Fd1uvx: "fpfc2by",
|
|
230
241
|
Bh9c35c: "f1lvsx7g",
|
|
231
242
|
Bmxbyg5: "f1sil6mw",
|
|
232
|
-
|
|
233
|
-
Ijaq50: 0,
|
|
234
|
-
h3tjnc: "f1daok31",
|
|
235
|
-
Bw0ie65: 0,
|
|
236
|
-
Br312pm: 0,
|
|
237
|
-
Beweih1: "f1eb8yyf"
|
|
243
|
+
Biipf1f: "f9ijwd5"
|
|
238
244
|
},
|
|
239
245
|
promptNoReasonMarker: {
|
|
240
246
|
Bh9c35c: "f197wrh9"
|
|
@@ -249,7 +255,12 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
249
255
|
Bahqtrf: "fk6fouc",
|
|
250
256
|
Be2twd7: "f13mqy1h",
|
|
251
257
|
Bhrd7zp: "figsok6",
|
|
252
|
-
Bg96gwp: "fcpl73t"
|
|
258
|
+
Bg96gwp: "fcpl73t",
|
|
259
|
+
mc9l5x: "f1rvi9lw",
|
|
260
|
+
Fd1uvx: "fpfc2by",
|
|
261
|
+
Bh9c35c: "fvvof4m",
|
|
262
|
+
Bmxbyg5: "f1sil6mw",
|
|
263
|
+
Biipf1f: "f9ijwd5"
|
|
253
264
|
}
|
|
254
265
|
}, {
|
|
255
266
|
d: [
|
|
@@ -349,9 +360,6 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
349
360
|
p: -1
|
|
350
361
|
}
|
|
351
362
|
],
|
|
352
|
-
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
353
|
-
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
354
|
-
".f1i3iumi{line-height:var(--lineHeightBase300);}",
|
|
355
363
|
[
|
|
356
364
|
".fm1owph{grid-row:1;}",
|
|
357
365
|
{
|
|
@@ -364,26 +372,36 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
364
372
|
p: -1
|
|
365
373
|
}
|
|
366
374
|
],
|
|
375
|
+
".f7nlbp4{align-self:center;}",
|
|
376
|
+
".f19n0e5{color:var(--colorNeutralForeground1);}",
|
|
377
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
378
|
+
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
379
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}",
|
|
380
|
+
".f1rvi9lw{display:-webkit-box;}",
|
|
381
|
+
".fpfc2by{-webkit-box-orient:vertical;}",
|
|
382
|
+
".fvvof4m{-webkit-line-clamp:1;}",
|
|
383
|
+
".f1sil6mw{overflow-y:hidden;}",
|
|
384
|
+
".f9ijwd5{word-break:break-word;}",
|
|
367
385
|
[
|
|
368
|
-
".
|
|
386
|
+
".f3hl5xl{grid-row:1/2;}",
|
|
369
387
|
{
|
|
370
388
|
p: -1
|
|
371
389
|
}
|
|
372
390
|
],
|
|
373
391
|
[
|
|
374
|
-
".
|
|
392
|
+
".f14q5zaz{grid-column:2/3;}",
|
|
375
393
|
{
|
|
376
394
|
p: -1
|
|
377
395
|
}
|
|
378
396
|
],
|
|
379
397
|
[
|
|
380
|
-
".
|
|
398
|
+
".foizga4{margin:var(--spacingVerticalL) var(--spacingHorizontalL) var(--spacingVerticalNone) var(--spacingHorizontalNone);}",
|
|
381
399
|
{
|
|
382
400
|
p: -1
|
|
383
401
|
}
|
|
384
402
|
],
|
|
385
403
|
[
|
|
386
|
-
".
|
|
404
|
+
".f5m8a6r{margin:var(--spacingVerticalL) var(--spacingHorizontalNone) var(--spacingVerticalNone) var(--spacingHorizontalL);}",
|
|
387
405
|
{
|
|
388
406
|
p: -1
|
|
389
407
|
}
|
|
@@ -397,10 +415,6 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
397
415
|
],
|
|
398
416
|
".f1u7pq1e{box-shadow:-12px 0 12px 0 var(--colorNeutralBackground1);}",
|
|
399
417
|
".f1pdyzui{box-shadow:12px 0 12px 0 var(--colorNeutralBackground1);}",
|
|
400
|
-
".f1rvi9lw{display:-webkit-box;}",
|
|
401
|
-
".fpfc2by{-webkit-box-orient:vertical;}",
|
|
402
|
-
".f1lvsx7g{-webkit-line-clamp:2;}",
|
|
403
|
-
".f1sil6mw{overflow-y:hidden;}",
|
|
404
418
|
[
|
|
405
419
|
".f1daok31{grid-row:2;}",
|
|
406
420
|
{
|
|
@@ -413,6 +427,7 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
413
427
|
p: -1
|
|
414
428
|
}
|
|
415
429
|
],
|
|
430
|
+
".f1lvsx7g{-webkit-line-clamp:2;}",
|
|
416
431
|
".f197wrh9{-webkit-line-clamp:3;}",
|
|
417
432
|
[
|
|
418
433
|
".f17e42vn{grid-row:3;}",
|
|
@@ -460,6 +475,12 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
460
475
|
const useSingleColumnStyles = (0, _reactcomponents.__styles)({
|
|
461
476
|
primaryAction: {
|
|
462
477
|
mc9l5x: "f22iagw",
|
|
478
|
+
Beiy3e4: "f1vx9l62",
|
|
479
|
+
Byoj8tv: 0,
|
|
480
|
+
uwmqm3: 0,
|
|
481
|
+
z189sj: 0,
|
|
482
|
+
z8tnut: 0,
|
|
483
|
+
B0ocmuz: "fcvcxyf",
|
|
463
484
|
Beyfa6y: 0,
|
|
464
485
|
Bbmb7ep: 0,
|
|
465
486
|
Btl43ni: 0,
|
|
@@ -524,15 +545,30 @@ const useSingleColumnStyles = (0, _reactcomponents.__styles)({
|
|
|
524
545
|
"f4stah7"
|
|
525
546
|
]
|
|
526
547
|
},
|
|
548
|
+
category: {
|
|
549
|
+
Bahqtrf: "fk6fouc",
|
|
550
|
+
Be2twd7: "fy9rknc",
|
|
551
|
+
Bhrd7zp: "fl43uef",
|
|
552
|
+
Bg96gwp: "fwrc4pm",
|
|
553
|
+
qb2dma: "fio29c6"
|
|
554
|
+
},
|
|
527
555
|
prompt: {
|
|
528
556
|
Bahqtrf: "fk6fouc",
|
|
529
557
|
Be2twd7: "fy9rknc",
|
|
530
558
|
Bhrd7zp: "fl43uef",
|
|
531
|
-
Bg96gwp: "fwrc4pm"
|
|
559
|
+
Bg96gwp: "fwrc4pm",
|
|
560
|
+
Bh9c35c: "f1lvsx7g"
|
|
532
561
|
}
|
|
533
562
|
}, {
|
|
534
563
|
d: [
|
|
535
564
|
".f22iagw{display:flex;}",
|
|
565
|
+
".f1vx9l62{flex-direction:column;}",
|
|
566
|
+
[
|
|
567
|
+
".fcvcxyf{padding:var(--spacingVerticalM) var(--spacingHorizontalM);}",
|
|
568
|
+
{
|
|
569
|
+
p: -1
|
|
570
|
+
}
|
|
571
|
+
],
|
|
536
572
|
[
|
|
537
573
|
".f1jxijnj{border-radius:var(--borderRadius2XL);}",
|
|
538
574
|
{
|
|
@@ -566,7 +602,9 @@ const useSingleColumnStyles = (0, _reactcomponents.__styles)({
|
|
|
566
602
|
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
567
603
|
".fy9rknc{font-size:var(--fontSizeBase200);}",
|
|
568
604
|
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
569
|
-
".fwrc4pm{line-height:var(--lineHeightBase200);}"
|
|
605
|
+
".fwrc4pm{line-height:var(--lineHeightBase200);}",
|
|
606
|
+
".fio29c6{align-self:auto;}",
|
|
607
|
+
".f1lvsx7g{-webkit-line-clamp:2;}"
|
|
570
608
|
],
|
|
571
609
|
f: [
|
|
572
610
|
".ftqa4ok:focus{outline-style:none;}"
|
|
@@ -607,7 +645,7 @@ const usePromptStarterStyles_unstable = (state)=>{
|
|
|
607
645
|
state.icon.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
608
646
|
}
|
|
609
647
|
if (state.category) {
|
|
610
|
-
state.category.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.category, styles.category, state.category.className);
|
|
648
|
+
state.category.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.category, styles.category, isSingleColumn && singleColumnStyles.category, state.category.className);
|
|
611
649
|
}
|
|
612
650
|
state.prompt.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.prompt, styles.prompt, !state.reasonMarker && styles.promptNoReasonMarker, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
613
651
|
if (state.reasonMarker) {
|
package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map
CHANGED
|
@@ -1 +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","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","makeResetStyles","display","__styles","gridTemplateColumns","gridTemplateRows","minWidth","h3tjnc","Bw0ie65","boxShadow","transform","transition","v29qe6","Beyfa6y","sj55zd","Bahqtrf","Bceei9c","clip","height","margin","overflow","padding","width","position","opacity","Bekrc4i","Bn0qgzm","ibv6hh","useStyles","makeStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","color","fontFamily","cursor","outlineStyle","textAlign","columnGap","rowGap","spacingVerticalS","shorthands","border","strokeWidthThin","createFocusOutlineStyle","style","Boxcth7","primaryActionHovered","Blkhhs4","alignItems","minHeight","B6dhp37","typographyStyles","Bkh64rk","spacingVerticalNone","Bz10aip","actionsWithCategory","Bkqvd7p","overflowY","promptNoReasonMarker","Bhrd7zp","Bg96gwp","nk6f5a","useSingleColumnStyles","Frg6f3","B74szlk","qhf8xq","Ijaq50","isSingleColumn","styles","Br312pm","rootResetStyles","Beweih1","singleColumnStyles","state","Cwk7ip","Bmy1vo4","className","De3pzq","Be2twd7"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;;;;;iCANY;AAMlB,MAAMA,0BAA8D;UACzEC;mBACAC;UACAC;cACAC;YACAC;kBACAC;aACAC;AACF;AAEA,MAAMC,qBAAqBC,IAAAA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;QACAqD,SAAAA;iBACE;;cAEF;QACA/D,QAAAA;iBACEgC;iBACAC;iBACGuB;QACLQ,SAAA;QACFC,SAAA;QAEAC,QAAMC;QACJvE,QAAAA;gBACEQ;iBACA+B;iBACGa;iBAA0BC;;;gBAAmD;QAClFmB,QAAA;QACArE,QAAQ;iBACHyD;QACLa,SAAA;YAAA;YAAA;SAAA;QACFC,QAAA;QAEAJ,QAAO;QACLK,QAAA;QAEA9D,QAAQ+D;QAER9D,SAAM+D;QACNC,SAAMC;QACNC,SAAMC;QACNC,QAAMnF;QACNmF,SAAMlF;QAMNmF,QAAID;iBACFA;QACFE,SAAA;QACAnB,SAAIiB;iBACFA;;yBAMWG;QAObC,QAAIJ;gBACFA;YAAAA;YAAM9E;SAAsB;;YAM1B8E;iBACFA;QAMFK,SAAA;QAEAnB,SAAOc;QACPb,SAAA"}
|
|
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 gridRow: 1,\n gridColumn: '2 / 3',\n alignSelf: 'center',\n\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1Strong,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n actions: {\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n position: 'relative',\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\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 gridRow: '2',\n gridColumn: '1 / 3',\n\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 wordBreak: 'break-word',\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\n ...typographyStyles.caption2,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n flexDirection: 'column',\n padding: `${tokens.spacingVerticalM} ${tokens.spacingHorizontalM}`,\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n category: {\n ...typographyStyles.caption1Strong,\n alignSelf: 'auto',\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n\n // Always truncate after two lines in single column layout.\n '-webkit-line-clamp': '2',\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 isSingleColumn && singleColumnStyles.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","root","primaryAction","icon","category","prompt","reasonMarker","actions","useRootResetStyles","makeResetStyles","display","__styles","gridTemplateColumns","gridTemplateRows","minWidth","h3tjnc","Bw0ie65","boxShadow","transform","transition","v29qe6","Beyfa6y","sj55zd","Bahqtrf","Bceei9c","clip","height","margin","overflow","padding","width","position","opacity","Bekrc4i","Bn0qgzm","ibv6hh","useStyles","makeStyles","gridRow","gridColumn","gridAutoRows","borderRadius","backgroundColor","color","fontFamily","cursor","outlineStyle","textAlign","columnGap","rowGap","spacingVerticalS","shorthands","border","strokeWidthThin","createFocusOutlineStyle","style","Boxcth7","primaryActionHovered","Blkhhs4","alignItems","minHeight","B6dhp37","alignSelf","typographyStyles","overflowY","wordBreak","Bi2q7bf","sshi5w","promptNoReasonMarker","qb2dma","nk6f5a","useSingleColumnStyles","flexDirection","B74szlk","B3o57yi","De3pzq","E5pizo","usePromptStarterStyles_unstable","styles","Ijaq50","rootResetStyles","singleColumnStyles","state","Beweih1","Be2twd7","Bhrd7zp","mc9l5x","Bh9c35c","Biipf1f","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;;;;;iCANY;AAMlB,MAAMA,0BAA8D;UACzEC;mBACAC;UACAC;cACAC;YACAC;kBACAC;aACAC;AACF;AAEA,MAAMC,qBAAqBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;IAAA;IAAA;IAAA;CAAA;MACzCC,YAASC,IAAAA,yBAAA,EAAA;mBACTC;QACAC,QAAAA;QACAC,QAAAA;QAEAC,QAAA;QACAC,SAAA;iBACO;iBACHC;gBACAC;gBACAC;iBACF;QACFC,QAAA;QACAC,SAAA;iBACO;iBACHJ;iBACAC;gBACAC;gBACF;QACFG,QAAA;QAEAC,SAAA;QACAC,SAAA;gBACI;gBACAC;YAAAA;YAAM;SAAA;gBACNC;iBACAC;iBACAC;gBACAC;gBACAC;gBACAC;iBACAC;iBACF;QACFC,SAAA;YAAA;YAAA;SAAA;QACFC,SAAA;QAEAC,QAAMC;YAAAA;YAAYC;SAAW;QAC3BnC,QAAAA;gBACEoC;YAAAA;YAAS;SAAA;gBACTC;gBACAR;YAAAA;YAAU;SAAA;gBACVrB;gBACAE;YAAAA;YAAAA;SAAqB;iBACrB4B;gBACAC;YAAAA;YAAc;SAAA;iBACdC;iBACAC;iBACAC;iBACAC;YAAAA;YAAQ;SAAA;gBACRC;iBACAC;YAAAA;YAAW;SAAA;iBACXC;iBACAC;YAAAA;YAAeC;SAAAA;iBACfrB;iBACGsB;YAAAA;YAAWC;SAAcC;iBACzBC;iBAA0BC;;iBAA+B;gBAAI;QAClEC,SAAA;QAEAC,SAAAA;gBACExC;iBACAC;iBACAC;QACFuC,SAAA;QAEAvD,SAAM;gBACJO;gBACAiD;gBACAC;gBACAtB;iBACAC;QACFsB,SAAA;QACAzD,SAAAA;iBACEkC;gBACAC;gBACAuB;iBAEAnB;gBACGoB;iBAEH;gBACArD;gBACA;iBACA;YAAA;YAAA;SAAsB;iBACtBsD;gBACAC;YAAAA;YAAW;SAAA;;0BAEJ;gBACP3B;iBACAC;iBACAR;gBACAJ;iBACS;iBACTK;iBACAb;QACF+C,SAAA;;UAEE;gBACAxB;iBAEAzB;QACFkD,QAAA;QACA9D,QAAQ;gBACNiC;gBACAC;iBAEGwB;iBAEH;iBACArD;;cAEA;gBACAsD;gBACAC;QACFlD,QAAA;QACAqD,SAAAA;iBACE;iBACA;QACFC,QAAA;QACA/D,QAAAA;iBACEgC;iBACAC;iBAEGwB;iBAEH;gBACArD;gBACA;iBACA;iBACAsD;iBACAC;;IAEJ1D,SAAA;QAEA+D,QAAMC;QACJrE,QAAAA;gBACEQ;iBACA8D;iBACA3C;iBACAY;gBACGa;gBAA0BC;;gBAA+C;iBAAI;QAClFkB,SAAA;YAAA;YAAA;SAAA;QACArE,QAAAA;iBACK2D;gBACHD;QACFY,SAAA;QACArE,SAAQ;iBACH0D;iBAEH;;yBAEF;QACFY,QAAA;QAEAC,QAAO;YAAMC;YAAAA;SAAAA;;YAGL;QAENP,QAAMQ;QACNC,QAAMC;QACNjE,QAAMkE;QACNC,SAAMjF;QACNiF,SAAMhF;QAMNiF,SAAID;iBACFA;QACFE,SAAA;QACAC,SAAIH;iBACFA;QAMFI,QAAA;QACAJ,QAAM7E;QAONkF,SAAIL;iBACFA;QAKFM,SAAA;;0BAEgBC;QAMhBF,SAAA;;IAGAjF,cAAA"}
|
package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js
CHANGED
|
@@ -99,18 +99,24 @@ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
|
99
99
|
gridColumn: '1 / 2'
|
|
100
100
|
},
|
|
101
101
|
category: {
|
|
102
|
-
display: 'flex',
|
|
103
|
-
alignItems: 'center',
|
|
104
|
-
..._reactcomponents.typographyStyles.body1Strong,
|
|
105
102
|
gridRow: 1,
|
|
106
|
-
gridColumn: '2 / 3'
|
|
103
|
+
gridColumn: '2 / 3',
|
|
104
|
+
alignSelf: 'center',
|
|
105
|
+
color: _tokens.tokens.colorNeutralForeground1,
|
|
106
|
+
..._reactcomponents.typographyStyles.body1Strong,
|
|
107
|
+
// Truncate text after one line.
|
|
108
|
+
display: '-webkit-box',
|
|
109
|
+
'-webkit-box-orient': 'vertical',
|
|
110
|
+
'-webkit-line-clamp': '1',
|
|
111
|
+
overflowY: 'hidden',
|
|
112
|
+
wordBreak: 'break-word'
|
|
107
113
|
},
|
|
108
114
|
actions: {
|
|
109
|
-
margin: `${_tokens.tokens.spacingVerticalL} ${_tokens.tokens.spacingHorizontalL}
|
|
110
|
-
${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalNone}`,
|
|
111
|
-
position: 'relative',
|
|
112
115
|
gridRow: '1 / 2',
|
|
113
116
|
gridColumn: '2 / 3',
|
|
117
|
+
position: 'relative',
|
|
118
|
+
margin: `${_tokens.tokens.spacingVerticalL} ${_tokens.tokens.spacingHorizontalL}
|
|
119
|
+
${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalNone}`,
|
|
114
120
|
opacity: 1,
|
|
115
121
|
transition: `opacity ${_tokens.tokens.durationFast} ${_tokens.tokens.curveLinear}`
|
|
116
122
|
},
|
|
@@ -120,14 +126,15 @@ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
|
120
126
|
boxShadow: `-12px 0 12px 0 ${_tokens.tokens.colorNeutralBackground1}`
|
|
121
127
|
},
|
|
122
128
|
prompt: {
|
|
129
|
+
gridRow: '2',
|
|
130
|
+
gridColumn: '1 / 3',
|
|
123
131
|
..._reactcomponents.typographyStyles.body1Strong,
|
|
124
132
|
// Truncate text after two lines.
|
|
125
133
|
display: '-webkit-box',
|
|
126
134
|
'-webkit-box-orient': 'vertical',
|
|
127
135
|
'-webkit-line-clamp': '2',
|
|
128
136
|
overflowY: 'hidden',
|
|
129
|
-
|
|
130
|
-
gridColumn: '1 / 3'
|
|
137
|
+
wordBreak: 'break-word'
|
|
131
138
|
},
|
|
132
139
|
promptNoReasonMarker: {
|
|
133
140
|
// Truncate text after three lines when no reason marker is present.
|
|
@@ -136,12 +143,20 @@ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
|
136
143
|
reasonMarker: {
|
|
137
144
|
gridRow: '3',
|
|
138
145
|
gridColumn: '1 / 3',
|
|
139
|
-
..._reactcomponents.typographyStyles.caption2
|
|
146
|
+
..._reactcomponents.typographyStyles.caption2,
|
|
147
|
+
// Truncate text after one line.
|
|
148
|
+
display: '-webkit-box',
|
|
149
|
+
'-webkit-box-orient': 'vertical',
|
|
150
|
+
'-webkit-line-clamp': '1',
|
|
151
|
+
overflowY: 'hidden',
|
|
152
|
+
wordBreak: 'break-word'
|
|
140
153
|
}
|
|
141
154
|
});
|
|
142
155
|
const useSingleColumnStyles = (0, _reactcomponents.makeStyles)({
|
|
143
156
|
primaryAction: {
|
|
144
157
|
display: 'flex',
|
|
158
|
+
flexDirection: 'column',
|
|
159
|
+
padding: `${_tokens.tokens.spacingVerticalM} ${_tokens.tokens.spacingHorizontalM}`,
|
|
145
160
|
borderRadius: _tokens.tokens.borderRadius2XL,
|
|
146
161
|
...(0, _reactcomponents.createFocusOutlineStyle)({
|
|
147
162
|
style: {
|
|
@@ -149,8 +164,14 @@ const useSingleColumnStyles = (0, _reactcomponents.makeStyles)({
|
|
|
149
164
|
}
|
|
150
165
|
})
|
|
151
166
|
},
|
|
167
|
+
category: {
|
|
168
|
+
..._reactcomponents.typographyStyles.caption1Strong,
|
|
169
|
+
alignSelf: 'auto'
|
|
170
|
+
},
|
|
152
171
|
prompt: {
|
|
153
|
-
..._reactcomponents.typographyStyles.caption1Strong
|
|
172
|
+
..._reactcomponents.typographyStyles.caption1Strong,
|
|
173
|
+
// Always truncate after two lines in single column layout.
|
|
174
|
+
'-webkit-line-clamp': '2'
|
|
154
175
|
}
|
|
155
176
|
});
|
|
156
177
|
const usePromptStarterStyles_unstable = (state)=>{
|
|
@@ -165,7 +186,7 @@ const usePromptStarterStyles_unstable = (state)=>{
|
|
|
165
186
|
state.icon.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.icon, styles.icon, state.icon.className);
|
|
166
187
|
}
|
|
167
188
|
if (state.category) {
|
|
168
|
-
state.category.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.category, styles.category, state.category.className);
|
|
189
|
+
state.category.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.category, styles.category, isSingleColumn && singleColumnStyles.category, state.category.className);
|
|
169
190
|
}
|
|
170
191
|
state.prompt.className = (0, _reactcomponents.mergeClasses)(promptStarterClassNames.prompt, styles.prompt, !state.reasonMarker && styles.promptNoReasonMarker, isSingleColumn && singleColumnStyles.prompt, state.prompt.className);
|
|
171
192
|
if (state.reasonMarker) {
|
|
@@ -1 +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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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etStyles,\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 gridRow: 1,\n gridColumn: '2 / 3',\n alignSelf: 'center',\n\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1Strong,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n actions: {\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n position: 'relative',\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\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 gridRow: '2',\n gridColumn: '1 / 3',\n\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 wordBreak: 'break-word',\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\n ...typographyStyles.caption2,\n\n // Truncate text after one line.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '1',\n overflowY: 'hidden',\n wordBreak: 'break-word',\n },\n});\n\nconst useSingleColumnStyles = makeStyles({\n primaryAction: {\n display: 'flex',\n flexDirection: 'column',\n padding: `${tokens.spacingVerticalM} ${tokens.spacingHorizontalM}`,\n borderRadius: tokens.borderRadius2XL,\n ...createFocusOutlineStyle({ style: { outlineRadius: tokens.borderRadius2XL } }),\n },\n category: {\n ...typographyStyles.caption1Strong,\n alignSelf: 'auto',\n },\n prompt: {\n ...typographyStyles.caption1Strong,\n\n // Always truncate after two lines in single column layout.\n '-webkit-line-clamp': '2',\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 isSingleColumn && singleColumnStyles.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","alignSelf","colorNeutralForeground1","typographyStyles","body1Strong","overflowY","wordBreak","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","actionsWithCategory","promptNoReasonMarker","caption2","useSingleColumnStyles","flexDirection","spacingVerticalM","spacingHorizontalM","borderRadius2XL","caption1Strong","state","isSingleColumn","styles","rootResetStyles","singleColumnStyles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,uBAAAA;eAAAA;;IAoKAC,+BAAAA;eAAAA;;;iCAzKN;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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ib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map
CHANGED
|
@@ -1 +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":""}
|
|
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 * Uncontrolled initial value for the expanded prop.\n *\n * @default false\n */\n defaultExpanded?: boolean;\n\n /**\n * Controls whether the PromptStarterList is expanded.\n */\n isExpanded?: boolean;\n\n /**\n * Callback to execute when the expanded state changes.\n */\n onExpandedChange?: (event: React.MouseEvent<HTMLElement>, data: { isExpanded: boolean }) => void;\n\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n\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 * The number of rows that are visible in the two and three column layouts.\n * In the one column layout, there will always be three visible PromptStarters.\n *\n * @default 1\n */\n visibleRows?: number;\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":""}
|
|
@@ -14,8 +14,9 @@ const _reactcomponents = require("@fluentui/react-components");
|
|
|
14
14
|
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
15
15
|
const _reacticons = require("@fluentui/react-icons");
|
|
16
16
|
const _promptStarterMotion = require("../PromptStarter/promptStarterMotion");
|
|
17
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
17
18
|
const usePromptStarterList_unstable = (props, ref)=>{
|
|
18
|
-
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', animateOnMount = true } = props;
|
|
19
|
+
const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', onExpandedChange, animateOnMount = true, visibleRows = 1 } = props;
|
|
19
20
|
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
20
21
|
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
21
22
|
const focusAttrs = (0, _reactcomponents.useArrowNavigationGroup)({
|
|
@@ -23,7 +24,22 @@ const usePromptStarterList_unstable = (props, ref)=>{
|
|
|
23
24
|
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'both',
|
|
24
25
|
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
25
26
|
});
|
|
26
|
-
const [isExpanded, setIsExpanded] =
|
|
27
|
+
const [isExpanded, setIsExpanded] = (0, _reactutilities.useControllableState)({
|
|
28
|
+
state: props.isExpanded,
|
|
29
|
+
defaultState: props.defaultExpanded,
|
|
30
|
+
initialState: false
|
|
31
|
+
});
|
|
32
|
+
const toggleExpanded = _react.useCallback((event)=>{
|
|
33
|
+
setIsExpanded((prevExpanded)=>{
|
|
34
|
+
onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(event, {
|
|
35
|
+
isExpanded: !prevExpanded
|
|
36
|
+
});
|
|
37
|
+
return !prevExpanded;
|
|
38
|
+
});
|
|
39
|
+
}, [
|
|
40
|
+
setIsExpanded,
|
|
41
|
+
onExpandedChange
|
|
42
|
+
]);
|
|
27
43
|
const [numberOfColumns, setNumberOfColumns] = _react.useState(3);
|
|
28
44
|
const gridWrapperRef = _react.useRef(null);
|
|
29
45
|
const { targetDocument } = (0, _reactcomponents.useFluent)();
|
|
@@ -45,7 +61,7 @@ const usePromptStarterList_unstable = (props, ref)=>{
|
|
|
45
61
|
]);
|
|
46
62
|
const state = {
|
|
47
63
|
numberOfColumns: numberOfColumns,
|
|
48
|
-
isExpanded,
|
|
64
|
+
isExpanded: isExpanded,
|
|
49
65
|
designVersion,
|
|
50
66
|
components: {
|
|
51
67
|
root: 'div',
|
|
@@ -96,10 +112,9 @@ const usePromptStarterList_unstable = (props, ref)=>{
|
|
|
96
112
|
if (!/*#__PURE__*/ _react.isValidElement(child) || child.type === _react.Fragment) {
|
|
97
113
|
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
98
114
|
}
|
|
99
|
-
// In the collapsed state, if there is one column, we show three children.
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
|
|
115
|
+
// In the collapsed state, if there is one column, we show three children. If there are two or three columns,
|
|
116
|
+
// we show two or three (or four or six, if there are two visible rows). All children are shown in the isExpanded state.
|
|
117
|
+
const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns * visibleRows || isExpanded;
|
|
103
118
|
return /*#__PURE__*/ _react.createElement(_promptStarterMotion.PromptStarterMotion, {
|
|
104
119
|
appear: animateOnMount,
|
|
105
120
|
key: index,
|
|
@@ -113,8 +128,12 @@ const usePromptStarterList_unstable = (props, ref)=>{
|
|
|
113
128
|
isExpanded
|
|
114
129
|
]);
|
|
115
130
|
state.root.children = childrenWithMotion;
|
|
131
|
+
const numChildren = childrenArray.length;
|
|
132
|
+
if (numberOfColumns === 1 && numChildren <= 3 || numChildren <= numberOfColumns * visibleRows) {
|
|
133
|
+
state.expandButton = undefined;
|
|
134
|
+
}
|
|
116
135
|
if (state.expandButton) {
|
|
117
|
-
state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick,
|
|
136
|
+
state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick, toggleExpanded);
|
|
118
137
|
}
|
|
119
138
|
return state;
|
|
120
139
|
};
|
package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map
CHANGED
|
@@ -1 +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,EACj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MyD,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,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"}
|
|
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';\nimport { useControllableState } from '@fluentui/react-utilities';\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 onExpandedChange,\n animateOnMount = true,\n visibleRows = 1,\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] = useControllableState({\n state: props.isExpanded,\n defaultState: props.defaultExpanded,\n initialState: false,\n });\n const toggleExpanded = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n setIsExpanded(prevExpanded => {\n onExpandedChange?.(event, { isExpanded: !prevExpanded });\n return !prevExpanded;\n });\n },\n [setIsExpanded, onExpandedChange],\n );\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: 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. If there are two or three columns,\n // we show two or three (or four or six, if there are two visible rows). All children are shown in the isExpanded state.\n const visibility = (numberOfColumns === 1 && index < 3) || index < numberOfColumns * visibleRows || 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 const numChildren = childrenArray.length;\n if ((numberOfColumns === 1 && numChildren <= 3) || numChildren <= numberOfColumns * visibleRows) {\n state.expandButton = undefined;\n }\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n toggleExpanded,\n );\n }\n\n return state;\n};\n"],"names":["usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","onExpandedChange","animateOnMount","visibleRows","designVersion","useDesignVersion","focusAttrs","useArrowNavigationGroup","axis","memorizeCurrent","isExpanded","setIsExpanded","useControllableState","state","defaultState","defaultExpanded","initialState","toggleExpanded","React","useCallback","event","prevExpanded","numberOfColumns","setNumberOfColumns","useState","gridWrapperRef","useRef","targetDocument","useFluent","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","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","numChildren","undefined","onClick","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAyBaA;;;eAAAA;;;;iEAzBU;iCAShB;+BAE0B;4BACI;qCACD;gCACC;AAW9B,MAAMA,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EACJC,sBAAsB,EACtBC,oBAAoB,WAAW,EAC/BC,sBAAsB,WAAW,EACjCC,gBAAgB,EAChBC,iBAAiB,IAAI,EACrBC,cAAc,CAAC,EAChB,GAAGP;IACJ,MAAMQ,gBAAgBC,IAAAA,+BAAAA,EAAiBT,MAAMQ,aAAa;QAGlDN,8BACWA;IAHnB,MAAMQ,aAAaC,IAAAA,wCAAAA,EAAwB;QACzC,GAAGT,sBAAsB;QACzBU,MAAMV,CAAAA,+BAAAA,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAwBU,IAAI,AAAJA,MAAI,QAA5BV,iCAAAA,KAAAA,IAAAA,+BAAgC;QACtCW,iBAAiBX,CAAAA,0CAAAA,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAwBW,eAAe,AAAfA,MAAe,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