@fluentui-copilot/react-prompt-starter 0.0.0-nightly-20251016-0037-d64d1d29.1 → 0.0.0-nightly-20251017-0406-90196598.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui-copilot/react-prompt-starter",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 16 Oct 2025 00:43:55 GMT",
6
- "tag": "@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251016-0037-d64d1d29.1",
7
- "version": "0.0.0-nightly-20251016-0037-d64d1d29.1",
5
+ "date": "Fri, 17 Oct 2025 04:12:53 GMT",
6
+ "tag": "@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251017-0406-90196598.1",
7
+ "version": "0.0.0-nightly-20251017-0406-90196598.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 Thu, 16 Oct 2025 00:43:55 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 17 Oct 2025 04:12:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20251016-0037-d64d1d29.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251016-0037-d64d1d29.1)
7
+ ## [0.0.0-nightly-20251017-0406-90196598.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251017-0406-90196598.1)
8
8
 
9
- Thu, 16 Oct 2025 00:43:55 GMT
10
- [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.10.7..@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251016-0037-d64d1d29.1)
9
+ Fri, 17 Oct 2025 04:12:53 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-starter_v0.10.7..@fluentui-copilot/react-prompt-starter_v0.0.0-nightly-20251017-0406-90196598.1)
11
11
 
12
12
  ### Changes
13
13
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+
1
3
  import type { BadgeProps } from '@fluentui/react-components';
2
4
  import type { Button } from '@fluentui/react-components';
3
5
  import type { ComponentProps } from '@fluentui/react-components';
@@ -24,6 +26,22 @@ declare type PromptStarterListContextValue = Pick<PromptStarterListState, 'numbe
24
26
  * PromptStarterList Props
25
27
  */
26
28
  export declare type PromptStarterListProps = ComponentProps<Partial<PromptStarterListSlots>, 'gridWrapper'> & DesignVersion & {
29
+ /**
30
+ * Uncontrolled initial value for the expanded prop.
31
+ *
32
+ * @default false
33
+ */
34
+ defaultExpanded?: boolean;
35
+ /**
36
+ * Controls whether the PromptStarterList is expanded.
37
+ */
38
+ isExpanded?: boolean;
39
+ /**
40
+ * Callback to execute when the expanded state changes.
41
+ */
42
+ onExpandedChange?: (event: React.MouseEvent<HTMLElement>, data: {
43
+ isExpanded: boolean;
44
+ }) => void;
27
45
  /**
28
46
  * Text for the expand button when the list is collapsed.
29
47
  *
@@ -49,6 +67,13 @@ export declare type PromptStarterListProps = ComponentProps<Partial<PromptStarte
49
67
  * @default true
50
68
  */
51
69
  animateOnMount?: boolean;
70
+ /**
71
+ * The number of rows that are visible in the two and three column layouts.
72
+ * In the one column layout, there will always be three visible PromptStarters.
73
+ *
74
+ * @default 1
75
+ */
76
+ visibleRows?: number;
52
77
  };
53
78
 
54
79
  export declare type PromptStarterListSlots = {
@@ -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":"AA0DA,WAA2G"}
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":"AAqFA,WAA2G"}
@@ -3,6 +3,7 @@ import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeC
3
3
  import { useDesignVersion } from '@fluentui-copilot/react-provider';
4
4
  import { ChevronDown12Regular } from '@fluentui/react-icons';
5
5
  import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
6
+ import { useControllableState } from '@fluentui/react-utilities';
6
7
  /**
7
8
  * Create the state required to render PromptStarterList.
8
9
  *
@@ -12,7 +13,7 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
12
13
  * @param props - props from this instance of PromptStarterList
13
14
  * @param ref - reference to root HTMLElement of PromptStarterList
14
15
  */ export const usePromptStarterList_unstable = (props, ref)=>{
15
- const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', animateOnMount = true } = props;
16
+ const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less', onExpandedChange, animateOnMount = true, visibleRows = 1 } = props;
16
17
  const designVersion = useDesignVersion(props.designVersion);
17
18
  var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
18
19
  const focusAttrs = useArrowNavigationGroup({
@@ -20,7 +21,22 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
20
21
  axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'both',
21
22
  memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
22
23
  });
23
- const [isExpanded, setIsExpanded] = React.useState(false);
24
+ const [isExpanded, setIsExpanded] = useControllableState({
25
+ state: props.isExpanded,
26
+ defaultState: props.defaultExpanded,
27
+ initialState: false
28
+ });
29
+ const toggleExpanded = React.useCallback((event)=>{
30
+ setIsExpanded((prevExpanded)=>{
31
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(event, {
32
+ isExpanded: !prevExpanded
33
+ });
34
+ return !prevExpanded;
35
+ });
36
+ }, [
37
+ setIsExpanded,
38
+ onExpandedChange
39
+ ]);
24
40
  const [numberOfColumns, setNumberOfColumns] = React.useState(3);
25
41
  const gridWrapperRef = React.useRef(null);
26
42
  const { targetDocument } = useFluent();
@@ -42,7 +58,7 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
42
58
  ]);
43
59
  const state = {
44
60
  numberOfColumns: numberOfColumns,
45
- isExpanded,
61
+ isExpanded: isExpanded,
46
62
  designVersion,
47
63
  components: {
48
64
  root: 'div',
@@ -93,10 +109,9 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
93
109
  if (!/*#__PURE__*/ React.isValidElement(child) || child.type === React.Fragment) {
94
110
  throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
95
111
  }
96
- // In the collapsed state, if there is one column, we show three children.
97
- // If there are two or three columns, we show two or three. All children
98
- // are shown in the expanded state.
99
- const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
112
+ // In the collapsed state, if there is one column, we show three children. If there are two or three columns,
113
+ // we show two or three (or four or six, if there are two visible rows). All children are shown in the isExpanded state.
114
+ const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns * visibleRows || isExpanded;
100
115
  return /*#__PURE__*/ React.createElement(PromptStarterMotion, {
101
116
  appear: animateOnMount,
102
117
  key: index,
@@ -110,8 +125,12 @@ import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
110
125
  isExpanded
111
126
  ]);
112
127
  state.root.children = childrenWithMotion;
128
+ const numChildren = childrenArray.length;
129
+ if (numberOfColumns === 1 && numChildren <= 3 || numChildren <= numberOfColumns * visibleRows) {
130
+ state.expandButton = undefined;
131
+ }
113
132
  if (state.expandButton) {
114
- state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, ()=>setIsExpanded(!isExpanded));
133
+ state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, toggleExpanded);
115
134
  }
116
135
  return state;
117
136
  };
@@ -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":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","animateOnMount","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","actions","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","appear","key","visible","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,MAAM,EACNC,uBAAuB,EACvBC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,6BAA6B;AAEpC,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAE3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EACJC,sBAAsB,EACtBC,oBAAoB,WAAW,EAC/BC,sBAAsB,WAAW,EACjCC,iBAAiB,IAAI,EACtB,GAAGL;IACJ,MAAMM,gBAAgBV,iBAAiBI,MAAMM,aAAa;QAGlDJ,8BACWA;IAHnB,MAAMK,aAAaf,wBAAwB;QACzC,GAAGU,sBAAsB;QACzBM,MAAMN,CAAAA,+BAAAA,mCAAAA,6CAAAA,uBAAwBM,IAAI,cAA5BN,0CAAAA,+BAAgC;QACtCO,iBAAiBP,CAAAA,0CAAAA,mCAAAA,6CAAAA,uBAAwBO,eAAe,cAAvCP,qDAAAA,0CAA2C;IAC9D;IAEA,MAAM,CAACQ,YAAYC,cAAc,GAAGvB,MAAMwB,QAAQ,CAAC;IACnD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/C;YACA+C,iBAAiB;YACjBV,aAAajD;QACf;IACF;IAEA0C,MAAMG,WAAW,CAACnC,GAAG,GAAGN,cAAcoB,gBAAgBkB,MAAMG,WAAW,CAACnC,GAAG;IAE3E,6BAA6B;IAC7B,MAAMkD,gBAAgB/D,MAAMgE,OAAO,CAEjC;QACA,OAAOhE,MAAMiE,QAAQ,CAACC,OAAO,CAACrB,MAAME,IAAI,CAACc,QAAQ;IACnD,GAAG;QAAChB,MAAME,IAAI,CAACc,QAAQ;KAAC;IAExB,8BAA8B;IAC9B,MAAMM,qBAAqBnE,MAAMgE,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,eAACtE,MAAMuE,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAKxE,MAAMyE,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,0EAA0E;YAC1E,wEAAwE;YACxE,mCAAmC;YACnC,MAAMC,aAAa,AAAClD,oBAAoB,KAAK6C,QAAQ,KAAMA,QAAQ7C,mBAAmBH;YAEtF,qBACE,oBAACZ;gBACCkE,QAAQ3D;gBACR4D,KAAKP;gBACLA,OAAOA;gBACPQ,SAASH;gBACTlD,iBAAiBA;eAEhB4C;QAGP,IACF;QAACN;QAAetC;QAAiBH;KAAW;IAG9CuB,MAAME,IAAI,CAACc,QAAQ,GAAGM;IAEtB,IAAItB,MAAMK,YAAY,EAAE;QACtBL,MAAMK,YAAY,CAAC6B,OAAO,GAAG1E,eAC3BwC,MAAMK,YAAY,CAAC6B,OAAO,EAC1B,IAAMxD,cAAc,CAACD;IAEzB;IAEA,OAAOuB;AACT,EAAE"}
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":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","useControllableState","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","onExpandedChange","animateOnMount","visibleRows","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","state","defaultState","defaultExpanded","initialState","toggleExpanded","useCallback","event","prevExpanded","numberOfColumns","setNumberOfColumns","useState","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","components","root","gridWrapper","actions","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","appear","key","visible","numChildren","undefined","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;A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AAC;IAExB,8BAA8B;IAC9B,MAAMM,qBAAqB7E,MAAM0E,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,eAAChF,MAAMiF,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAKlF,MAAMmF,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,6GAA6G;YAC7G,wHAAwH;YACxH,MAAMC,aAAa,AAAClD,oBAAoB,KAAK6C,QAAQ,KAAMA,QAAQ7C,kBAAkBf,eAAeK;YAEpG,qBACE,oBAACf;gBACC4E,QAAQnE;gBACRoE,KAAKP;gBACLA,OAAOA;gBACPQ,SAASH;gBACTlD,iBAAiBA;eAEhB4C;QAGP,IACF;QAACN;QAAetC;QAAiBV;KAAW;IAG9CE,MAAM8B,IAAI,CAACc,QAAQ,GAAGM;IAEtB,MAAMY,cAAchB,cAActB,MAAM;IACxC,IAAI,AAAChB,oBAAoB,KAAKsD,eAAe,KAAMA,eAAetD,kBAAkBf,aAAa;QAC/FO,MAAMiC,YAAY,GAAG8B;IACvB;IAEA,IAAI/D,MAAMiC,YAAY,EAAE;QACtBjC,MAAMiC,YAAY,CAAC+B,OAAO,GAAGtF,eAC3BsB,MAAMiC,YAAY,CAAC+B,OAAO,EAC1B5D;IAEJ;IAEA,OAAOJ;AACT,EAAE"}
@@ -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] = _react.useState(false);
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
- // If there are two or three columns, we show two or three. All children
101
- // are shown in the expanded state.
102
- const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
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, ()=>setIsExpanded(!isExpanded));
136
+ state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick, toggleExpanded);
118
137
  }
119
138
  return state;
120
139
  };
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC3B,MAAME,IAAI,CAACmB,QAAQ;IACnD,GAAG;QAACrB,MAAME,IAAI,CAACmB,QAAQ;KAAC;IAExB,8BAA8B;IAC9B,MAAMO,qBAAqBnD,OAAMgD,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,CAAA,WAAA,GAACtD,OAAMuD,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAKxD,OAAMyD,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,GAAG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AMkD,OAAO,CACtC,IACED,cAAcK,GAAG,CAAC,CAACC,OAAOC;YACxB,0EAA0E;YAC1E,IAAI,CAAA,WAAA,GAACxD,OAAMyD,cAAc,CAACF,UAAUA,MAAMG,IAAI,KAAK1D,OAAM2D,QAAQ,EAAE;gBACjE,MAAM,IAAIC,MAAM;YAClB;YAEA,6GAA6G;YAC7G,wHAAwH;YACxH,MAAMC,aAAazD,oBAAqB,KAAKoD,QAAQ,KAAMA,QAAQpD,kBAAkBnB,eAAeO;YAEpG,OAAA,WAAA,GACEQ,OAAA2C,aAAA,CAACmB,wCAAAA,EAAAA;gBACCC,QAAQ/E;gBACRgF,KAAKR;gBACLA,OAAOA;gBACPS,SAASJ;gBACTzD,iBAAiBA;eAEhBmD;QAGP,IACF;QAACN;QAAe7C;QAAiBZ;KAAW;IAG9CG,MAAMgC,IAAI,CAACmB,QAAQ,GAAGO;IAEtB,MAAMa,cAAcjB,cAAc5B,MAAM;IACxC,IAAIjB,oBAAqB,KAAK8D,eAAe,KAAMA,eAAe9D,kBAAkBnB,aAAa;QAC/FU,MAAMmC,YAAY,GAAGqC;IACvB;IAEA,IAAIxE,MAAMmC,YAAY,EAAE;QACtBnC,MAAMmC,YAAY,CAACsC,OAAO,GAAGC,IAAAA,+BAAAA,EAC3B1E,MAAMmC,YAAY,CAACsC,OAAO,EAC1BrE;IAEJ;IAEA,OAAOJ;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-prompt-starter",
3
- "version": "0.0.0-nightly-20251016-0037-d64d1d29.1",
3
+ "version": "0.0.0-nightly-20251017-0406-90196598.1",
4
4
  "description": "A Fluent AI package",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/react-provider": "0.0.0-nightly-20251016-0037-d64d1d29.1",
16
- "@fluentui-copilot/tokens": "0.0.0-nightly-20251016-0037-d64d1d29.1",
15
+ "@fluentui-copilot/react-provider": "0.0.0-nightly-20251017-0406-90196598.1",
16
+ "@fluentui-copilot/tokens": "0.0.0-nightly-20251017-0406-90196598.1",
17
17
  "@swc/helpers": "^0.5.1"
18
18
  },
19
19
  "peerDependencies": {