@fluentui-copilot/react-prompt-starter 0.0.0-nightly-20250610-0405-e23ffd06.1 → 0.0.0-nightly-20250611-0405-d9945da4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.json +3 -3
  2. package/CHANGELOG.md +4 -4
  3. package/dist/index.d.ts +73 -2
  4. package/lib/PromptStarterList.js +2 -0
  5. package/lib/PromptStarterList.js.map +1 -0
  6. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -1
  7. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +43 -0
  8. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  9. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +6 -1
  10. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
  11. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +13 -12
  12. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
  13. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
  14. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  15. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
  16. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  17. package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
  18. package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  19. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
  20. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  21. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +114 -0
  22. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  23. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
  24. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  25. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
  26. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  27. package/lib/contexts/PromptStarterListContext.js +8 -0
  28. package/lib/contexts/PromptStarterListContext.js.map +1 -0
  29. package/lib/index.js +1 -0
  30. package/lib/index.js.map +1 -1
  31. package/lib-commonjs/PromptStarterList.js +29 -0
  32. package/lib-commonjs/PromptStarterList.js.map +1 -0
  33. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -1
  34. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +60 -0
  35. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  36. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +5 -0
  37. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
  38. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +12 -16
  39. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -1
  40. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
  41. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  42. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
  43. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  44. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
  45. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  46. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
  47. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  48. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
  49. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  50. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
  51. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  52. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
  53. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  54. package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
  55. package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
  56. package/lib-commonjs/index.js +16 -0
  57. package/lib-commonjs/index.js.map +1 -1
  58. package/package.json +4 -3
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui-copilot/react-prompt-starter",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 10 Jun 2025 04:13:04 GMT",
6
- "tag": "@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250610-0405-e23ffd06.1",
7
- "version": "0.0.0-nightly-20250610-0405-e23ffd06.1",
5
+ "date": "Wed, 11 Jun 2025 04:12:26 GMT",
6
+ "tag": "@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250611-0405-d9945da4.1",
7
+ "version": "0.0.0-nightly-20250611-0405-d9945da4.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Change Log - @fluentui-copilot/react-prompt-starter
2
2
 
3
- This log was last generated on Tue, 10 Jun 2025 04:13:04 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 11 Jun 2025 04:12:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20250610-0405-e23ffd06.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250610-0405-e23ffd06.1)
7
+ ## [0.0.0-nightly-20250611-0405-d9945da4.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250611-0405-d9945da4.1)
8
8
 
9
- Tue, 10 Jun 2025 04:13:04 GMT
10
- [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.9.4..@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250610-0405-e23ffd06.1)
9
+ Wed, 11 Jun 2025 04:12:26 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.9.4..@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20250611-0405-d9945da4.1)
11
11
 
12
12
  ### Changes
13
13
 
package/dist/index.d.ts CHANGED
@@ -1,15 +1,63 @@
1
1
  import type { BadgeProps } from '@fluentui/react-components';
2
+ import type { Button } from '@fluentui/react-components';
2
3
  import type { ComponentProps } from '@fluentui/react-components';
3
4
  import type { ComponentState } from '@fluentui/react-components';
4
5
  import type { DesignVersion } from '@fluentui-copilot/react-provider';
5
6
  import type { ForwardRefComponent } from '@fluentui/react-components';
7
+ import * as React_2 from 'react';
6
8
  import type { Slot } from '@fluentui/react-components';
7
9
  import type { SlotClassNames } from '@fluentui/react-components';
10
+ import type { UseArrowNavigationGroupOptions } from '@fluentui/react-components';
8
11
 
9
12
  export declare const PromptStarter: ForwardRefComponent<PromptStarterProps>;
10
13
 
11
14
  export declare const promptStarterClassNames: SlotClassNames<PromptStarterSlots>;
12
15
 
16
+ export declare const PromptStarterList: ForwardRefComponent<PromptStarterListProps>;
17
+
18
+ export declare const promptStarterListClassNames: SlotClassNames<PromptStarterListSlots>;
19
+
20
+ declare type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;
21
+
22
+ /**
23
+ * PromptStarterList Props
24
+ */
25
+ export declare type PromptStarterListProps = ComponentProps<PromptStarterListSlots> & DesignVersion & {
26
+ /**
27
+ * Text for the expand button when the list is collapsed.
28
+ *
29
+ * default: "Show more"
30
+ */
31
+ expandButtonLabel?: string;
32
+ /**
33
+ * Text for the expand button when the list is expanded.
34
+ *
35
+ * default: "Show less"
36
+ */
37
+ collapseButtonLabel?: string;
38
+ /**
39
+ * Arrow navigation options. This can be used to customize Tabster's direction,
40
+ * tab behavior, and memoization options.
41
+ *
42
+ * default: { axis: 'horizontal', memorizeCurrent: true }
43
+ */
44
+ arrowNavigationOptions?: UseArrowNavigationGroupOptions;
45
+ };
46
+
47
+ export declare type PromptStarterListSlots = {
48
+ root: NonNullable<Slot<'div'>>;
49
+ gridWrapper: NonNullable<Slot<'div'>>;
50
+ expandButton?: Slot<typeof Button>;
51
+ };
52
+
53
+ /**
54
+ * State used in rendering PromptStarterList
55
+ */
56
+ export declare type PromptStarterListState = ComponentState<PromptStarterListSlots> & Required<Pick<PromptStarterListProps, 'designVersion'>> & {
57
+ numberOfColumns: number;
58
+ isExpanded?: boolean;
59
+ };
60
+
13
61
  /**
14
62
  * PromptStarter Props
15
63
  */
@@ -35,7 +83,7 @@ export declare const promptStarterV2ClassNames: SlotClassNames<PromptStarterV2Sl
35
83
  /**
36
84
  * PromptStarter Props
37
85
  */
38
- export declare type PromptStarterV2Props = Omit<ComponentProps<PromptStarterV2Slots>, 'disabled'> & {};
86
+ export declare type PromptStarterV2Props = Omit<ComponentProps<PromptStarterV2Slots>, 'disabled'>;
39
87
 
40
88
  export declare type PromptStarterV2Slots = {
41
89
  root: NonNullable<Slot<'div'>>;
@@ -49,10 +97,17 @@ export declare type PromptStarterV2Slots = {
49
97
  /**
50
98
  * State used in rendering PromptStarter
51
99
  */
52
- export declare type PromptStarterV2State = ComponentState<PromptStarterV2Slots>;
100
+ export declare type PromptStarterV2State = ComponentState<PromptStarterV2Slots> & {
101
+ isSingleColumn?: boolean;
102
+ };
53
103
 
54
104
  export declare const renderPromptStarter_unstable: (state: PromptStarterState) => JSX.Element;
55
105
 
106
+ /**
107
+ * Render the final JSX of PromptStarterList
108
+ */
109
+ export declare const renderPromptStarterList_unstable: (state: PromptStarterListState, contextValue: PromptStarterListContextValue) => JSX.Element;
110
+
56
111
  export declare const renderPromptStarterV2_unstable: (state: PromptStarterV2State) => JSX.Element;
57
112
 
58
113
  /**
@@ -66,6 +121,22 @@ export declare const renderPromptStarterV2_unstable: (state: PromptStarterV2Stat
66
121
  */
67
122
  export declare const usePromptStarter_unstable: (props: PromptStarterProps, ref: React.Ref<HTMLButtonElement>) => PromptStarterState;
68
123
 
124
+ /**
125
+ * Create the state required to render PromptStarterList.
126
+ *
127
+ * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,
128
+ * before being passed to renderPromptStarterList_unstable.
129
+ *
130
+ * @param props - props from this instance of PromptStarterList
131
+ * @param ref - reference to root HTMLElement of PromptStarterList
132
+ */
133
+ export declare const usePromptStarterList_unstable: (props: PromptStarterListProps, ref: React_2.Ref<HTMLDivElement>) => PromptStarterListState;
134
+
135
+ /**
136
+ * Apply styling to the PromptStarterList slots based on the state
137
+ */
138
+ export declare const usePromptStarterListStyles_unstable: (state: PromptStarterListState) => PromptStarterListState;
139
+
69
140
  export declare const usePromptStarterStyles_unstable: (state: PromptStarterState) => PromptStarterState;
70
141
 
71
142
  /**
@@ -0,0 +1,2 @@
1
+ export { PromptStarterList, renderPromptStarterList_unstable, usePromptStarterList_unstable, promptStarterListClassNames, usePromptStarterListStyles_unstable } from './components/PromptStarterV2/PromptStarterList/index';
2
+ //# sourceMappingURL=PromptStarterList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PromptStarterList.ts"],"sourcesContent":["export {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './components/PromptStarterV2/PromptStarterList/index';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './components/PromptStarterV2/PromptStarterList/index';\n"],"names":["PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,iBAAiB,EACjBC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mCAAmC,QAC9B,uDAAuD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["PromptStarter.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PromptStarterSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button'>>;\n icon: NonNullable<Slot<'span'>>;\n prompt: NonNullable<Slot<'span'>>;\n reasonMarker?: Slot<'span'>;\n actions?: Slot<'span'>;\n};\n\n/**\n * PromptStarter Props\n */\nexport type PromptStarterProps = Omit<ComponentProps<PromptStarterSlots>, 'disabled'> & {};\n\n/**\n * State used in rendering PromptStarter\n */\nexport type PromptStarterState = ComponentState<PromptStarterSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAgBA;;CAEC,GACD,WAAoE"}
1
+ {"version":3,"sources":["PromptStarter.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PromptStarterSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button'>>;\n icon: NonNullable<Slot<'span'>>;\n prompt: NonNullable<Slot<'span'>>;\n reasonMarker?: Slot<'span'>;\n actions?: Slot<'span'>;\n};\n\n/**\n * PromptStarter Props\n */\nexport type PromptStarterProps = Omit<ComponentProps<PromptStarterSlots>, 'disabled'>;\n\n/**\n * State used in rendering PromptStarter\n */\nexport type PromptStarterState = ComponentState<PromptStarterSlots> & {\n isSingleColumn?: boolean;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAgBA;;CAEC,GACD,WAEE"}
@@ -0,0 +1,43 @@
1
+ import { createPresenceComponent } from '@fluentui/react-components';
2
+ export const PromptStarterMotion = createPresenceComponent(({
3
+ index,
4
+ numberOfColumns
5
+ }) => {
6
+ const isFirstRow = index < numberOfColumns;
7
+ const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;
8
+ const opacityDuration = 100;
9
+ const opacityOffset = delay / (delay + 100);
10
+ const opacityEasing = 'linear';
11
+ const scaleDuration = 500;
12
+ const scaleOffset = delay / (delay + scaleDuration);
13
+ const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;
14
+ return {
15
+ enter: [{
16
+ keyframes: [{
17
+ opacity: 0
18
+ }, {
19
+ opacity: 0,
20
+ offset: opacityOffset
21
+ }, {
22
+ opacity: 1
23
+ }],
24
+ easing: opacityEasing,
25
+ duration: opacityDuration + delay
26
+ }, {
27
+ keyframes: [{
28
+ transform: 'scale(0.9)'
29
+ }, {
30
+ transform: 'scale(0.9)',
31
+ offset: scaleOffset
32
+ }, {
33
+ transform: 'scale(1)'
34
+ }],
35
+ easing: scaleEasing,
36
+ duration: scaleDuration + delay
37
+ }],
38
+ exit: {
39
+ keyframes: []
40
+ }
41
+ };
42
+ });
43
+ //# sourceMappingURL=promptStarterMotion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["promptStarterMotion.ts"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-components';\n\nexport type PromptStarterMotionParams = { index: number; numberOfColumns: number };\n\nexport const PromptStarterMotion = createPresenceComponent<PromptStarterMotionParams>(({ index, numberOfColumns }) => {\n const isFirstRow = index < numberOfColumns;\n const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;\n\n const opacityDuration = 100;\n const opacityOffset = delay / (delay + 100);\n const opacityEasing = 'linear';\n\n const scaleDuration = 500;\n const scaleOffset = delay / (delay + scaleDuration);\n const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;\n\n return {\n enter: [\n {\n keyframes: [{ opacity: 0 }, { opacity: 0, offset: opacityOffset }, { opacity: 1 }],\n easing: opacityEasing,\n duration: opacityDuration + delay,\n },\n {\n keyframes: [\n { transform: 'scale(0.9)' },\n { transform: 'scale(0.9)', offset: scaleOffset },\n { transform: 'scale(1)' },\n ],\n easing: scaleEasing,\n duration: scaleDuration + delay,\n },\n ],\n exit: {\n keyframes: [],\n },\n };\n});\n"],"names":["createPresenceComponent","PromptStarterMotion","index","numberOfColumns","isFirstRow","delay","opacityDuration","opacityOffset","opacityEasing","scaleDuration","scaleOffset","scaleEasing","enter","keyframes","opacity","offset","easing","duration","transform","exit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,uBAAuB,QAAQ,6BAA6B;AAIrE,OAAO,MAAMC,sBAAsBD,wBAAmD,CAAC,EAAEE,KAAK,EAAEC,eAAe,EAAE;IAC/G,MAAMC,aAAaF,QAAQC;IAC3B,MAAME,QAAQD,aAAaF,QAAQ,KAAK,AAACA,CAAAA,QAAQC,eAAc,IAAK;IAEpE,MAAMG,kBAAkB;IACxB,MAAMC,gBAAgBF,QAASA,CAAAA,QAAQ,GAAE;IACzC,MAAMG,gBAAgB;IAEtB,MAAMC,gBAAgB;IACtB,MAAMC,cAAcL,QAASA,CAAAA,QAAQI,aAAY;IACjD,MAAME,cAAc,CAAC,iCAAiC,CAAC;IAEvD,OAAO;QACLC,OAAO;YACL;gBACEC,WAAW;oBAAC;wBAAEC,SAAS;oBAAE;oBAAG;wBAAEA,SAAS;wBAAGC,QAAQR;oBAAc;oBAAG;wBAAEO,SAAS;oBAAE;iBAAE;gBAClFE,QAAQR;gBACRS,UAAUX,kBAAkBD;YAC9B;YACA;gBACEQ,WAAW;oBACT;wBAAEK,WAAW;oBAAa;oBAC1B;wBAAEA,WAAW;wBAAcH,QAAQL;oBAAY;oBAC/C;wBAAEQ,WAAW;oBAAW;iBACzB;gBACDF,QAAQL;gBACRM,UAAUR,gBAAgBJ;YAC5B;SACD;QACDc,MAAM;YACJN,WAAW,EAAE;QACf;IACF;AACF,GAAG"}
@@ -1,4 +1,5 @@
1
- import { getIntrinsicElementProps, slot, useId } from '@fluentui/react-components';
1
+ import { getIntrinsicElementProps, slot, useFocusableGroup, useId } from '@fluentui/react-components';
2
+ import { usePromptStarterListContext } from '../../../contexts/PromptStarterListContext';
2
3
  /**
3
4
  * Create the state required to render PromptStarter.
4
5
  *
@@ -10,7 +11,10 @@ import { getIntrinsicElementProps, slot, useId } from '@fluentui/react-component
10
11
  */
11
12
  export const usePromptStarter_unstable = (props, ref) => {
12
13
  const id = useId('prompt-starter');
14
+ const focusAttrs = useFocusableGroup();
15
+ const numberOfColumns = usePromptStarterListContext(ctx => ctx.numberOfColumns);
13
16
  const state = {
17
+ isSingleColumn: numberOfColumns === 1,
14
18
  components: {
15
19
  root: 'div',
16
20
  primaryAction: 'button',
@@ -23,6 +27,7 @@ export const usePromptStarter_unstable = (props, ref) => {
23
27
  ref,
24
28
  'aria-labelledby': `${id}-prompt`,
25
29
  'aria-describedby': `${id}-icon, ${id}-reasonMarker`,
30
+ ...focusAttrs,
26
31
  ...props
27
32
  }), {
28
33
  elementType: 'div'
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useId } from '@fluentui/react-components';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterState => {\n const id = useId('prompt-starter');\n\n const state: PromptStarterState = {\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n 'aria-labelledby': `${id}-prompt`,\n 'aria-describedby': `${id}-icon, ${id}-reasonMarker`,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n elementType: 'button',\n }),\n icon: slot.always(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n }),\n prompt: slot.always(props.prompt, {\n defaultProps: { id: `${id}-prompt` },\n elementType: 'span',\n }),\n reasonMarker: slot.optional(props.reasonMarker, {\n defaultProps: { id: `${id}-reasonMarker` },\n elementType: 'span',\n }),\n actions: slot.optional(props.actions, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","slot","useId","usePromptStarter_unstable","props","ref","id","state","components","root","primaryAction","icon","prompt","reasonMarker","actions","always","elementType","defaultProps","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAGnF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,KAAKJ,MAAM;IAEjB,MAAMK,QAA4B;QAChCC,YAAY;YACVC,MAAM;YACNC,eAAe;YACfC,MAAM;YACNC,QAAQ;YACRC,cAAc;YACdC,SAAS;QACX;QACAL,MAAMR,KAAKc,MAAM,CACff,yBAAyB,OAAO;YAC9BK;YACA,mBAAmB,CAAC,EAAEC,GAAG,OAAO,CAAC;YACjC,oBAAoB,CAAC,EAAEA,GAAG,OAAO,EAAEA,GAAG,aAAa,CAAC;YACpD,GAAGF,KAAK;QACV,IACA;YAAEY,aAAa;QAAM;QAEvBN,eAAeT,KAAKc,MAAM,CAACX,MAAMM,aAAa,EAAE;YAC9CM,aAAa;QACf;QACAL,MAAMV,KAAKc,MAAM,CAACX,MAAMO,IAAI,EAAE;YAC5BM,cAAc;gBAAEX,IAAI,CAAC,EAAEA,GAAG,KAAK,CAAC;YAAC;YACjCU,aAAa;QACf;QACAJ,QAAQX,KAAKc,MAAM,CAACX,MAAMQ,MAAM,EAAE;YAChCK,cAAc;gBAAEX,IAAI,CAAC,EAAEA,GAAG,OAAO,CAAC;YAAC;YACnCU,aAAa;QACf;QACAH,cAAcZ,KAAKiB,QAAQ,CAACd,MAAMS,YAAY,EAAE;YAC9CI,cAAc;gBAAEX,IAAI,CAAC,EAAEA,GAAG,aAAa,CAAC;YAAC;YACzCU,aAAa;QACf;QACAF,SAASb,KAAKiB,QAAQ,CAACd,MAAMU,OAAO,EAAE;YAAEE,aAAa;QAAO;IAC9D;IAEA,OAAOT;AACT,EAAE"}
1
+ {"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useFocusableGroup, useId } from '@fluentui/react-components';\nimport { usePromptStarterListContext } from '../../../contexts/PromptStarterListContext';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterState => {\n const id = useId('prompt-starter');\n const focusAttrs = useFocusableGroup();\n\n const numberOfColumns = usePromptStarterListContext(ctx => ctx.numberOfColumns);\n\n const state: PromptStarterState = {\n isSingleColumn: numberOfColumns === 1,\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n 'aria-labelledby': `${id}-prompt`,\n 'aria-describedby': `${id}-icon, ${id}-reasonMarker`,\n ...focusAttrs,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n elementType: 'button',\n }),\n icon: slot.always(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n }),\n prompt: slot.always(props.prompt, {\n defaultProps: { id: `${id}-prompt` },\n elementType: 'span',\n }),\n reasonMarker: slot.optional(props.reasonMarker, {\n defaultProps: { id: `${id}-reasonMarker` },\n elementType: 'span',\n }),\n actions: slot.optional(props.actions, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","slot","useFocusableGroup","useId","usePromptStarterListContext","usePromptStarter_unstable","props","ref","id","focusAttrs","numberOfColumns","ctx","state","isSingleColumn","components","root","primaryAction","icon","prompt","reasonMarker","actions","always","elementType","defaultProps","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,KAAK,QAAQ,6BAA6B;AACtG,SAASC,2BAA2B,QAAQ,6CAA6C;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,KAAKL,MAAM;IACjB,MAAMM,aAAaP;IAEnB,MAAMQ,kBAAkBN,4BAA4BO,CAAAA,MAAOA,IAAID,eAAe;IAE9E,MAAME,QAA4B;QAChCC,gBAAgBH,oBAAoB;QACpCI,YAAY;YACVC,MAAM;YACNC,eAAe;YACfC,MAAM;YACNC,QAAQ;YACRC,cAAc;YACdC,SAAS;QACX;QACAL,MAAMd,KAAKoB,MAAM,CACfrB,yBAAyB,OAAO;YAC9BO;YACA,mBAAmB,CAAC,EAAEC,GAAG,OAAO,CAAC;YACjC,oBAAoB,CAAC,EAAEA,GAAG,OAAO,EAAEA,GAAG,aAAa,CAAC;YACpD,GAAGC,UAAU;YACb,GAAGH,KAAK;QACV,IACA;YAAEgB,aAAa;QAAM;QAEvBN,eAAef,KAAKoB,MAAM,CAACf,MAAMU,aAAa,EAAE;YAC9CM,aAAa;QACf;QACAL,MAAMhB,KAAKoB,MAAM,CAACf,MAAMW,IAAI,EAAE;YAC5BM,cAAc;gBAAEf,IAAI,CAAC,EAAEA,GAAG,KAAK,CAAC;YAAC;YACjCc,aAAa;QACf;QACAJ,QAAQjB,KAAKoB,MAAM,CAACf,MAAMY,MAAM,EAAE;YAChCK,cAAc;gBAAEf,IAAI,CAAC,EAAEA,GAAG,OAAO,CAAC;YAAC;YACnCc,aAAa;QACf;QACAH,cAAclB,KAAKuB,QAAQ,CAAClB,MAAMa,YAAY,EAAE;YAC9CI,cAAc;gBAAEf,IAAI,CAAC,EAAEA,GAAG,aAAa,CAAC;YAAC;YACzCc,aAAa;QACf;QACAF,SAASnB,KAAKuB,QAAQ,CAAClB,MAAMc,OAAO,EAAE;YAAEE,aAAa;QAAO;IAC9D;IAEA,OAAOV;AACT,EAAE"}
@@ -103,8 +103,7 @@ const useStyles = __styles({
103
103
  icon: {
104
104
  mc9l5x: "f22iagw",
105
105
  Bt984gj: "f122n59",
106
- sshi5w: "fntfeoj",
107
- B3oa8pd: "fyhwzhv"
106
+ sshi5w: "fntfeoj"
108
107
  },
109
108
  actions: {
110
109
  jrapky: 0,
@@ -125,8 +124,7 @@ const useStyles = __styles({
125
124
  B3o57yi: 0,
126
125
  Bmy1vo4: 0,
127
126
  Bkqvd7p: 0,
128
- Bi2q7bf: "f1964ud6",
129
- B3oa8pd: "fyhwzhv"
127
+ Bi2q7bf: "f1964ud6"
130
128
  },
131
129
  prompt: {
132
130
  Bahqtrf: "fk6fouc",
@@ -142,8 +140,10 @@ const useStyles = __styles({
142
140
  Bahqtrf: "fk6fouc",
143
141
  Be2twd7: "f13mqy1h",
144
142
  Bhrd7zp: "figsok6",
145
- Bg96gwp: "fcpl73t",
146
- B3oa8pd: "fyhwzhv"
143
+ Bg96gwp: "fcpl73t"
144
+ },
145
+ singleColumnStyles: {
146
+ mc9l5x: "fjseox"
147
147
  }
148
148
  }, {
149
149
  d: [[".fcdwmbt{grid-row:1/3;}", {
@@ -170,7 +170,7 @@ const useStyles = __styles({
170
170
  p: -1
171
171
  }], ".f5p0z4x{opacity:1;}", [".f1964ud6{transition:opacity var(--durationFast) var(--curveLinear);}", {
172
172
  p: -1
173
- }], ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1rvi9lw{display:-webkit-box;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1sil6mw{overflow-y:hidden;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}"],
173
+ }], ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1rvi9lw{display:-webkit-box;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1sil6mw{overflow-y:hidden;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fjseox{display:none;}"],
174
174
  f: [".ftqa4ok:focus{outline-style:none;}"],
175
175
  i: [".f2hkw1w:focus-visible{outline-style:none;}"],
176
176
  m: [["@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}", {
@@ -179,24 +179,25 @@ const useStyles = __styles({
179
179
  m: "(forced-colors: active)"
180
180
  }], ["@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}", {
181
181
  m: "(forced-colors: active)"
182
- }], ["@media (max-width: 450px){.fyhwzhv{display:none;}}", {
183
- m: "(max-width: 450px)"
184
182
  }]]
185
183
  });
186
184
  export const usePromptStarterStyles_unstable = state => {
187
185
  'use no memo';
188
186
 
187
+ const {
188
+ isSingleColumn
189
+ } = state;
189
190
  const styles = useStyles();
190
191
  const rootResetStyles = useRootResetStyles();
191
192
  state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);
192
193
  state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, state.primaryAction.className);
193
- state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, state.icon.className);
194
+ state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, isSingleColumn && styles.singleColumnStyles, state.icon.className);
194
195
  state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, state.prompt.className);
195
196
  if (state.reasonMarker) {
196
- state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, state.reasonMarker.className);
197
+ state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, isSingleColumn && styles.singleColumnStyles, state.reasonMarker.className);
197
198
  }
198
199
  if (state.actions) {
199
- state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);
200
+ state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, isSingleColumn && styles.singleColumnStyles, state.actions.className);
200
201
  }
201
202
  return state;
202
203
  };
@@ -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 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 // Reflow: hide icon when under 450px\n '@media (max-width: 450px)': {\n display: 'none',\n },\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 // Reflow: hide actions when under 450px\n '@media (max-width: 450px)': {\n display: 'none',\n },\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 // Reflow: hide reason marker when under 450px\n '@media (max-width: 450px)': {\n display: 'none',\n },\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\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(promptStarterClassNames.icon, styles.icon, state.icon.className);\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 state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, state.actions.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","caption2","usePromptStarterStyles_unstable","state","styles","rootResetStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,eAAe;IACfC,MAAM;IACNC,QAAQ;IACRC,cAAc;IACdC,SAAS;AACX,EAAE;AAEF,MAAMC,qBAAqBb,gBAAgB;IACzCc,SAAS;IACTC,qBAAqB;IACrBC,kBAAkB;IAClBC,UAAU;IAEV,8DAA8D;IAC9D,WAAW;QACT,CAAC,CAAC,GAAG,EAAEX,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOc,QAAQ;YAC1BC,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EAAEjB,OAAOkB,kBAAkB,CAAC,CAAC;QAC/E;IACF;IACA,YAAY;QACV,CAAC,CAAC,GAAG,EAAEjB,wBAAwBE,aAAa,CAAC,CAAC,CAAC,EAAE;YAC/CU,WAAWb,OAAOmB,OAAO;YACzBJ,WAAW;YACXC,YAAY,CAAC,UAAU,EAAEhB,OAAOiB,cAAc,CAAC,CAAC,EA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AAIH,MAAMxD,OAAO,EAAE;QACjBwD,MAAMxD,OAAO,CAAC2D,SAAS,GAAGtE,aAAaK,wBAAwBM,OAAO,EAAEyD,OAAOzD,OAAO,EAAEwD,MAAMxD,OAAO,CAAC2D,SAAS;IACjH;IAEA,OAAOH;AACT,EAAE"}
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":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","caption2","singleColumnStyles","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,UAAU,EACVC,eAAe,EACfC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,QAClB,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2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MAAM9D,IAAI,CAACkE,SAAS;IACvGJ,MAAM7D,aAAa,CAACiE,SAAS,GAAGxE,aAC9BK,wBAAwBE,aAAa,EACrC+D,OAAO/D,aAAa,EACpB6D,MAAM7D,aAAa,CAACiE,SAAS;IAE/BJ,MAAM5D,IAAI,CAACgE,SAAS,GAAGxE,aACrBK,wBAAwBG,IAAI,EAC5B8D,OAAO9D,IAAI,EACX6D,kBAAkBC,OAAOJ,kBAAkB,EAC3CE,MAAM5D,IAAI,CAACgE,SAAS;IAEtBJ,MAAM3D,MAAM,CAAC+D,SAAS,GAAGxE,aAAaK,wBAAwBI,MAAM,EAAE6D,OAAO7D,MAAM,EAAE2D,MAAM3D,MAAM,CAAC+D,SAAS;IAC3G,IAAIJ,MAAM1D,YAAY,EAAE;QACtB0D,MAAM1D,YAAY,CAAC8D,SAAS,GAAGxE,aAC7BK,wBAAwBK,YAAY,EACpC4D,OAAO5D,YAAY,EACnB2D,kBAAkBC,OAAOJ,kBAAkB,EAC3CE,MAAM1D,YAAY,CAAC8D,SAAS;IAEhC;IACA,IAAIJ,MAAMzD,OAAO,EAAE;QACjByD,MAAMzD,OAAO,CAAC6D,SAAS,GAAGxE,aACxBK,wBAAwBM,OAAO,EAC/B2D,OAAO3D,OAAO,EACd0D,kBAAkBC,OAAOJ,kBAAkB,EAC3CE,MAAMzD,OAAO,CAAC6D,SAAS;IAE3B;IAEA,OAAOJ;AACT,EAAE"}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { usePromptStarterList_unstable } from './usePromptStarterList';
3
+ import { renderPromptStarterList_unstable } from './renderPromptStarterList';
4
+ import { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
5
+ import { usePromptStarterListContextValues } from './usePromptStarterListContextValues';
6
+ export const PromptStarterList = /*#__PURE__*/React.forwardRef((props, ref) => {
7
+ const state = usePromptStarterList_unstable(props, ref);
8
+ const contextValues = usePromptStarterListContextValues(state);
9
+ usePromptStarterListStyles_unstable(state);
10
+ return renderPromptStarterList_unstable(state, contextValues);
11
+ });
12
+ PromptStarterList.displayName = 'PromptStarterList';
13
+ //# 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":["React","usePromptStarterList_unstable","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterListContextValues","PromptStarterList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,sCAAsC;AAG1F,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQR,8BAA8BM,OAAOC;IACnD,MAAME,gBAAgBN,kCAAkCK;IAExDN,oCAAoCM;IACpC,OAAOP,iCAAiCO,OAAOC;AACjD,GAAG;AAEHL,kBAAkBM,WAAW,GAAG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# 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":"AAkDA,WAA2G"}
@@ -0,0 +1,5 @@
1
+ export { PromptStarterList } from './PromptStarterList';
2
+ export { renderPromptStarterList_unstable } from './renderPromptStarterList';
3
+ export { usePromptStarterList_unstable } from './usePromptStarterList';
4
+ export { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
5
+ //# 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","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,sBAAsB;AAOxD,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,2BAA2B,EAAEC,mCAAmC,QAAQ,sCAAsC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots, PresenceGroup } from '@fluentui/react-components';
3
+ import { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';
4
+ /**
5
+ * Render the final JSX of PromptStarterList
6
+ */
7
+ export const renderPromptStarterList_unstable = (state, contextValue) => {
8
+ assertSlots(state);
9
+ return /*#__PURE__*/_jsx(PromptStarterListProvider, {
10
+ value: contextValue,
11
+ children: /*#__PURE__*/_jsxs(state.root, {
12
+ children: [/*#__PURE__*/_jsx(PresenceGroup, {
13
+ children: /*#__PURE__*/_jsx(state.gridWrapper, {
14
+ children: state.root.children
15
+ })
16
+ }), state.expandButton && /*#__PURE__*/_jsx(state.expandButton, {})]
17
+ })
18
+ });
19
+ };
20
+ //# 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","PresenceGroup","PromptStarterListProvider","renderPromptStarterList_unstable","state","contextValue","value","root","gridWrapper","children","expandButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,aAAa,QAAQ,6BAA6B;AACxE,SAASC,yBAAyB,QAAQ,6CAA6C;AAOvF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAC9CC,OACAC;IAEAL,YAAoCI;IAEpC,qBACE,KAACF;QAA0BI,OAAOD;kBAChC,cAAA,MAACD,MAAMG,IAAI;;8BACT,KAACN;8BACC,cAAA,KAACG,MAAMI,WAAW;kCAAEJ,MAAMG,IAAI,CAACE,QAAQ;;;gBAExCL,MAAMM,YAAY,kBAAI,KAACN,MAAMM,YAAY;;;;AAIlD,EAAE"}
@@ -0,0 +1,114 @@
1
+ import * as React from 'react';
2
+ import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeCallbacks, useFluent, useMergedRefs } from '@fluentui/react-components';
3
+ import { useDesignVersion } from '@fluentui-copilot/react-provider';
4
+ import { ChevronDown12Regular } from '@fluentui/react-icons';
5
+ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
6
+ /**
7
+ * Create the state required to render PromptStarterList.
8
+ *
9
+ * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,
10
+ * before being passed to renderPromptStarterList_unstable.
11
+ *
12
+ * @param props - props from this instance of PromptStarterList
13
+ * @param ref - reference to root HTMLElement of PromptStarterList
14
+ */
15
+ export const usePromptStarterList_unstable = (props, ref) => {
16
+ const {
17
+ arrowNavigationOptions,
18
+ expandButtonLabel = 'Show more',
19
+ collapseButtonLabel = 'Show less'
20
+ } = props;
21
+ const designVersion = useDesignVersion(props.designVersion);
22
+ var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
23
+ const focusAttrs = useArrowNavigationGroup({
24
+ ...arrowNavigationOptions,
25
+ axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'grid-linear',
26
+ memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
27
+ });
28
+ const [isExpanded, setIsExpanded] = React.useState(false);
29
+ const [numberOfColumns, setNumberOfColumns] = React.useState(3);
30
+ const gridWrapperRef = React.useRef(null);
31
+ const {
32
+ targetDocument
33
+ } = useFluent();
34
+ const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
35
+ React.useEffect(() => {
36
+ if (!win || !gridWrapperRef.current) return;
37
+ const promptStarterGrid = gridWrapperRef.current;
38
+ const updateNumberOfColumns = () => {
39
+ const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
40
+ setNumberOfColumns(numColumns);
41
+ };
42
+ const ro = new win.ResizeObserver(updateNumberOfColumns);
43
+ ro.observe(promptStarterGrid);
44
+ return () => {
45
+ ro.unobserve(promptStarterGrid);
46
+ };
47
+ }, [win]);
48
+ const state = {
49
+ numberOfColumns: numberOfColumns,
50
+ isExpanded,
51
+ designVersion,
52
+ components: {
53
+ root: 'div',
54
+ gridWrapper: 'div',
55
+ expandButton: Button
56
+ },
57
+ root: slot.always(getIntrinsicElementProps('div', {
58
+ ref,
59
+ ...props
60
+ }), {
61
+ elementType: 'div'
62
+ }),
63
+ gridWrapper: slot.always(props.gridWrapper, {
64
+ defaultProps: {
65
+ role: 'group',
66
+ ...focusAttrs
67
+ },
68
+ elementType: 'div'
69
+ }),
70
+ expandButton: slot.optional(props.expandButton, {
71
+ defaultProps: {
72
+ appearance: 'subtle',
73
+ size: 'small',
74
+ shape: 'rounded',
75
+ icon: /*#__PURE__*/React.createElement(ChevronDown12Regular, null),
76
+ iconPosition: 'after',
77
+ 'aria-expanded': isExpanded,
78
+ children: isExpanded ? collapseButtonLabel : expandButtonLabel
79
+ },
80
+ renderByDefault: true,
81
+ elementType: Button
82
+ })
83
+ };
84
+ state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);
85
+ // Get the array of children.
86
+ const childrenArray = React.useMemo(() => {
87
+ return React.Children.toArray(state.root.children);
88
+ }, [state.root.children]);
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, {
96
+ appear: true,
97
+ key: index,
98
+ index: index,
99
+ numberOfColumns: numberOfColumns
100
+ }, child);
101
+ }), [childrenArray, numberOfColumns]);
102
+ // In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.
103
+ if (!isExpanded) {
104
+ const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;
105
+ state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);
106
+ } else {
107
+ state.root.children = childrenWithMotion;
108
+ }
109
+ if (state.expandButton) {
110
+ state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, () => setIsExpanded(!isExpanded));
111
+ }
112
+ return state;
113
+ };
114
+ //# 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":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","appear","key","collapsedVisibleItems","slice","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,MAAM,EACNC,uBAAuB,EACvBC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,6BAA6B;AAEpC,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAE3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EAAEC,sBAAsB,EAAEC,oBAAoB,WAAW,EAAEC,sBAAsB,WAAW,EAAE,GAAGJ;IACvG,MAAMK,gBAAgBT,iBAAiBI,MAAMK,aAAa;QAGlDH,8BACWA;IAHnB,MAAMI,aAAad,wBAAwB;QACzC,GAAGU,sBAAsB;QACzBK,MAAML,CAAAA,+BAAAA,mCAAAA,6CAAAA,uBAAwBK,IAAI,cAA5BL,0CAAAA,+BAA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;
5
+ return {
6
+ numberOfColumns
7
+ };
8
+ }
9
+ //# sourceMappingURL=usePromptStarterListContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;","mappings":"AAEA,OAAO,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}