@fluentui-copilot/react-prompt-starter 0.10.1 → 0.10.3

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 (72) hide show
  1. package/CHANGELOG.json +37 -1
  2. package/CHANGELOG.md +21 -2
  3. package/lib/PromptStarter.js +0 -1
  4. package/lib/PromptStarterList.js +0 -1
  5. package/lib/PromptStarterV2.js +0 -1
  6. package/lib/components/PromptStarter/PromptStarter.js +5 -6
  7. package/lib/components/PromptStarter/PromptStarter.types.js +1 -2
  8. package/lib/components/PromptStarter/index.js +0 -1
  9. package/lib/components/PromptStarter/renderPromptStarter.js +16 -9
  10. package/lib/components/PromptStarter/usePromptStarter.js +42 -44
  11. package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js +94 -0
  12. package/lib/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
  13. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +5 -6
  14. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +1 -2
  15. package/lib/components/PromptStarterV2/PromptStarter/index.js +0 -1
  16. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +61 -50
  17. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -1
  18. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +15 -9
  19. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +49 -51
  20. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +119 -0
  21. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
  22. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +5 -6
  23. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +1 -2
  24. package/lib/components/PromptStarterV2/PromptStarterList/index.js +0 -1
  25. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +15 -14
  26. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +97 -97
  27. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +4 -7
  28. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +61 -0
  29. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
  30. package/lib/contexts/PromptStarterListContext.js +2 -3
  31. package/lib/index.js +0 -1
  32. package/lib-commonjs/PromptStarter.js +0 -1
  33. package/lib-commonjs/PromptStarterList.js +0 -1
  34. package/lib-commonjs/PromptStarterV2.js +0 -1
  35. package/lib-commonjs/components/PromptStarter/PromptStarter.js +1 -1
  36. package/lib-commonjs/components/PromptStarter/PromptStarter.js.map +1 -1
  37. package/lib-commonjs/components/PromptStarter/PromptStarter.types.js +0 -1
  38. package/lib-commonjs/components/PromptStarter/index.js +0 -1
  39. package/lib-commonjs/components/PromptStarter/renderPromptStarter.js +1 -1
  40. package/lib-commonjs/components/PromptStarter/renderPromptStarter.js.map +1 -1
  41. package/lib-commonjs/components/PromptStarter/usePromptStarter.js +1 -1
  42. package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
  43. package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js +112 -0
  44. package/lib-commonjs/components/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
  45. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +1 -1
  46. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -1
  47. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +0 -1
  48. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +0 -1
  49. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +1 -1
  50. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -1
  51. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +1 -1
  52. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -1
  53. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +1 -1
  54. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -1
  55. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js +137 -0
  56. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.raw.js.map +1 -0
  57. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +1 -1
  58. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -1
  59. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +0 -1
  60. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +0 -1
  61. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +1 -1
  62. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -1
  63. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +1 -1
  64. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -1
  65. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +1 -1
  66. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -1
  67. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js +77 -0
  68. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.raw.js.map +1 -0
  69. package/lib-commonjs/contexts/PromptStarterListContext.js +1 -1
  70. package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -1
  71. package/lib-commonjs/index.js +0 -1
  72. package/package.json +9 -9
@@ -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 { 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\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 appear key={index} index={index} visible={visibility} numberOfColumns={numberOfColumns}>\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":["arrowNavigationOptions","expandButtonLabel","useArrowNavigationGroup","memorizeCurrent","_arrowNavigationOptions_axis","_arrowNavigationOptions_memorizeCurrent","focusAttrs","isExpanded","React","setNumberOfColumns","axis","gridWrapperRef","targetDocument","useFluent","setIsExpanded","useState","numberOfColumns","promptStarterGrid","numColumns","win","defaultView","useEffect","ro","observe","current","getComputedStyle","gridTemplateColumns","split","length","ResizeObserver","updateNumberOfColumns","state","components","root","gridWrapper","slot","ref","props","Button","always","getIntrinsicElementProps","defaultProps","elementType","expandButton","size","icon","iconPosition","renderByDefault","createElement","ChevronDown12Regular","children","collapseButtonLabel","childrenArray","useMemo","childrenWithMotion","Error","map","child","index","isValidElement","type","Fragment","PromptStarterMotion","appear","visibility","mergeCallbacks","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BUA;;;eAAAA;;;;iEA5Ba;iCAShB;+BAE0B;4BACI;qCACD;AAelC,MAAQA,gCAAwBC,CAAAA,OAAAA;UAChC,wBAGQD,EAFRC,oBAAmBC,WAAAA,wBACdF,WAAsB;UAEzBG,gBAAAA,IAAAA,+BAAiBH,EAAAA,MAAAA,aAAAA;QACnBI,8BAAAC;UAEAC,aAAOC,IAAAA,wCAA6BC,EAAAA;QACpC,GAAAR,sBAAwBS;QAExBC,MAAMC,CAAAA,+BAA8CX,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAU,IAAA,MAAA,QAAAN,iCAAA,KAAA,IAAAA,+BAAA;QACpDD,iBAAQS,CAAAA,0CAAmBC,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,eAAAA,MAAAA,QAAAA,4CAAAA,KAAAA,IAAAA,0CAAAA;;UAG3BL,CAAAA,YAAgBM,cAAA,GAAAN,OAAAO,QAAA,CAAA;UACd,CAAAC,iBAAaL,mBAAwB,GAAAH,OAAAO,QAAA,CAAA;UAErCJ,iBAAMM,OAAAA,MAAo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,OAAAC;sFAClB;4BAEA,GAAAlD,OAAAmD,cAAA,CAAAF,UAAAA,MAAAG,IAAA,KAAApD,OAAAqD,QAAA,EAAA;sBACA,IAAAN,MAAA;;sFAEmEvC;oFAGhE8C;+CAAoBC;+BAAYL,oBAAAA,KAAAA,QAAAA,KAAAA,QAAAA,mBAAAA;8BAAOA,GAAOA,OAAAA,aAAAA,CAAAA,wCAAAA,EAAAA;;;;yBAKrDM;iCAACZ;;;;QAAgC7C;QAAAA;KAAAA;UAAW0B,IAAA,CAAAiB,QAAA,GAAAI;QAG9CvB,MAAME,YAAa,EAAGqB;QAEtBvB,MAAIA,YAAMY,CAAAA,OAAc,GAAAsB,IAAAA,+BAAA,EAAAlC,MAAAY,YAAA,CAAAuB,OAAA,EAAA,IAAApD,cAAA,CAAAP;;WAKxBwB;GAGF,gDAAE"}
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\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 appear key={index} index={index} visible={visibility} numberOfColumns={numberOfColumns}>\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","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","expandButton","Button","slot","always","getIntrinsicElementProps","elementType","defaultProps","role","optional","appearance","size","shape","icon","createElement","ChevronDown12Regular","iconPosition","children","renderByDefault","useMergedRefs","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","visibility","PromptStarterMotion","appear","key","visible","onClick","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBaA;;;eAAAA;;;;iEAxBU;iCAShB;+BAE0B;4BACI;qCACD;AAW7B,MAAMA,gCAAgC,CAC3CC,OACAC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AM;YAClB;YAEA,0EAA0E;YAC1E,wEAAwE;YACxE,mCAAmC;YACnC,MAAMC,aAAaxD,oBAAqB,KAAKmD,QAAQ,KAAMA,QAAQnD,mBAAmBJ;YAEtF,OAAA,WAAA,GACEE,OAAAwC,aAAA,CAACmB,wCAAAA,EAAAA;gBAAoBC,QAAAA;gBAAOC,KAAKR;gBAAOA,OAAOA;gBAAOS,SAASJ;gBAAYxD,iBAAiBA;eACzFkD;QAGP,IACF;QAACN;QAAe5C;QAAiBJ;KAAW;IAG9CyB,MAAME,IAAI,CAACkB,QAAQ,GAAGO;IAEtB,IAAI3B,MAAMI,YAAY,EAAE;QACtBJ,MAAMI,YAAY,CAACoC,OAAO,GAAGC,IAAAA,+BAAAA,EAC3BzC,MAAMI,YAAY,CAACoC,OAAO,EAC1B,IAAMhE,cAAc,CAACD;IAEzB;IAEA,OAAOyB;AACT"}
@@ -13,4 +13,4 @@ function usePromptStarterListContextValues(state) {
13
13
  return {
14
14
  numberOfColumns
15
15
  };
16
- } //# sourceMappingURL=usePromptStarterListContextValues.js.map
16
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAA6B;UAC7E,EAEAC,eAAO;WAEP;QACFA"}
1
+ {"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ promptStarterListClassNames: function() {
13
+ return promptStarterListClassNames;
14
+ },
15
+ usePromptStarterListStyles_unstable: function() {
16
+ return usePromptStarterListStyles_unstable;
17
+ }
18
+ });
19
+ const _reactcomponents = require("@fluentui/react-components");
20
+ const _tokens = require("@fluentui-copilot/tokens");
21
+ const promptStarterListClassNames = {
22
+ root: 'fai-PromptStarterList',
23
+ gridWrapper: 'fai-PromptStarterList__gridWrapper',
24
+ expandButton: 'fai-PromptStarterList__expandButton'
25
+ };
26
+ /**
27
+ * Styles for the root slot
28
+ */ const useRootClassName = (0, _reactcomponents.makeResetStyles)({
29
+ display: 'flex',
30
+ flexDirection: 'column',
31
+ maxWidth: '772px',
32
+ gap: _tokens.tokens.spacingHorizontalXL
33
+ });
34
+ const useStyles = (0, _reactcomponents.makeStyles)({
35
+ gridWrapper: {
36
+ display: 'grid',
37
+ gap: _tokens.tokens.spacingHorizontalL,
38
+ gridAutoColumns: 'max-content',
39
+ gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,
40
+ gridAutoFlow: 'unset'
41
+ },
42
+ expandButton: {
43
+ alignSelf: 'end',
44
+ [`& .${_reactcomponents.buttonClassNames.icon}`]: {
45
+ fontSize: '12px',
46
+ height: '12px',
47
+ width: '12px'
48
+ },
49
+ ':hover': {
50
+ [`& .${_reactcomponents.buttonClassNames.icon}`]: {
51
+ color: _tokens.tokens.colorNeutralForeground2Hover
52
+ }
53
+ },
54
+ ':hover:active': {
55
+ [`& .${_reactcomponents.buttonClassNames.icon}`]: {
56
+ color: _tokens.tokens.colorNeutralForeground2Pressed
57
+ }
58
+ }
59
+ },
60
+ expandButtonExpanded: {
61
+ [`& > .${_reactcomponents.buttonClassNames.icon}`]: {
62
+ transform: 'rotate(180deg)'
63
+ }
64
+ }
65
+ });
66
+ const usePromptStarterListStyles_unstable = (state)=>{
67
+ 'use no memo';
68
+ const { isExpanded } = state;
69
+ const rootClassName = useRootClassName();
70
+ const styles = useStyles();
71
+ state.root.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.root, rootClassName, state.root.className);
72
+ state.gridWrapper.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
73
+ if (state.expandButton) {
74
+ state.expandButton.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
75
+ }
76
+ return state;
77
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["usePromptStarterListStyles.styles.ts"],"sourcesContent":["import { buttonClassNames, makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { PromptStarterListSlots, PromptStarterListState } from './PromptStarterList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nexport const promptStarterListClassNames: SlotClassNames<PromptStarterListSlots> = {\n root: 'fai-PromptStarterList',\n gridWrapper: 'fai-PromptStarterList__gridWrapper',\n expandButton: 'fai-PromptStarterList__expandButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'column',\n maxWidth: '772px',\n gap: tokens.spacingHorizontalXL,\n});\n\nconst useStyles = makeStyles({\n gridWrapper: {\n display: 'grid',\n gap: tokens.spacingHorizontalL,\n gridAutoColumns: 'max-content',\n\n gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,\n gridAutoFlow: 'unset',\n },\n\n expandButton: {\n alignSelf: 'end',\n [`& .${buttonClassNames.icon}`]: {\n fontSize: '12px',\n height: '12px',\n width: '12px',\n },\n ':hover': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n ':hover:active': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n expandButtonExpanded: {\n [`& > .${buttonClassNames.icon}`]: {\n transform: 'rotate(180deg)',\n },\n },\n});\n\n/**\n * Apply styling to the PromptStarterList slots based on the state\n */\nexport const usePromptStarterListStyles_unstable = (state: PromptStarterListState): PromptStarterListState => {\n 'use no memo';\n\n const { isExpanded } = state;\n\n const rootClassName = useRootClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);\n state.gridWrapper.className = mergeClasses(\n promptStarterListClassNames.gridWrapper,\n styles.gridWrapper,\n state.gridWrapper.className,\n );\n if (state.expandButton) {\n state.expandButton.className = mergeClasses(\n promptStarterListClassNames.expandButton,\n styles.expandButton,\n isExpanded && styles.expandButtonExpanded,\n state.expandButton.className,\n );\n }\n\n return state;\n};\n"],"names":["promptStarterListClassNames","usePromptStarterListStyles_unstable","root","gridWrapper","expandButton","useRootClassName","makeResetStyles","display","flexDirection","maxWidth","gap","tokens","spacingHorizontalXL","useStyles","makeStyles","spacingHorizontalL","gridAutoColumns","gridTemplateColumns","gridAutoFlow","alignSelf","buttonClassNames","icon","fontSize","height","width","color","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","expandButtonExpanded","transform","state","isExpanded","rootClassName","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,2BAAAA;eAAAA;;IAuDAC,mCAAAA;eA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,CAAC+B,SAAS,GAAGC,IAAAA,6BAAAA,EAC5BnC,4BAA4BG,WAAW,EACvC8B,OAAO9B,WAAW,EAClB2B,MAAM3B,WAAW,CAAC+B,SAAS;IAE7B,IAAIJ,MAAM1B,YAAY,EAAE;QACtB0B,MAAM1B,YAAY,CAAC8B,SAAS,GAAGC,IAAAA,6BAAAA,EAC7BnC,4BAA4BI,YAAY,EACxC6B,OAAO7B,YAAY,EACnB2B,cAAcE,OAAOL,oBAAoB,EACzCE,MAAM1B,YAAY,CAAC8B,SAAS;IAEhC;IAEA,OAAOJ;AACT"}
@@ -25,4 +25,4 @@ const promptStarterListContextDefaultValue = {
25
25
  numberOfColumns: 3
26
26
  };
27
27
  const usePromptStarterListContext = (selector)=>(0, _reactcontextselector.useContextSelector)(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue)=>selector(ctx));
28
- const PromptStarterListProvider = PromptStarterListContext.Provider; //# sourceMappingURL=PromptStarterListContext.js.map
28
+ const PromptStarterListProvider = PromptStarterListContext.Provider;
@@ -1 +1 @@
1
- {"version":3,"sources":["PromptStarterListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport type { PromptStarterListContextValue } from '../PromptStarterList';\n\nexport const PromptStarterListContext = createContext<PromptStarterListContextValue | undefined>(undefined);\n\nconst promptStarterListContextDefaultValue: PromptStarterListContextValue = {\n numberOfColumns: 3,\n};\n\nexport const usePromptStarterListContext = <T>(selector: ContextSelector<PromptStarterListContextValue, T>) =>\n useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));\nexport const PromptStarterListProvider = PromptStarterListContext.Provider;\n"],"names":["PromptStarterListContext","PromptStarterListProvider","usePromptStarterListContext","createContext","undefined","promptStarterListContextDefaultValue","numberOfColumns","selector","useContextSelector","ctx","Provider"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,wBAAAA;eAAAA;;IAQAC,yBAAAA;eAAAA;;IAFAC,2BAAAA;eAAAA;;;sCAVqC;AAI3C,MAAMF,2BAA2BG,IAAAA,mCAAAA,EAAyDC;AAEjG,MAAMC,uCAAsE;qBAC1EC;AACF;AAEO,MAAMJ,8BAA8BK,CAAAA,WACzCC,IAAAA,wCAAAA,EAAmBR,0BAA0B,CAACS,MAAMJ,oCAAoC,GAAKE,SAASE;AACjG,MAAMR,4BAA4BD,yBAAyBU,QAAQ"}
1
+ {"version":3,"sources":["PromptStarterListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport type { PromptStarterListContextValue } from '../PromptStarterList';\n\nexport const PromptStarterListContext = createContext<PromptStarterListContextValue | undefined>(undefined);\n\nconst promptStarterListContextDefaultValue: PromptStarterListContextValue = {\n numberOfColumns: 3,\n};\n\nexport const usePromptStarterListContext = <T>(selector: ContextSelector<PromptStarterListContextValue, T>) =>\n useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));\nexport const PromptStarterListProvider = PromptStarterListContext.Provider;\n"],"names":["PromptStarterListContext","PromptStarterListProvider","usePromptStarterListContext","createContext","undefined","promptStarterListContextDefaultValue","numberOfColumns","selector","useContextSelector","ctx","Provider"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,wBAAAA;eAAAA;;IAQAC,yBAAAA;eAAAA;;IAFAC,2BAAAA;eAAAA;;;sCAVqC;AAI3C,MAAMF,2BAA2BG,IAAAA,mCAAAA,EAAyDC;AAEjG,MAAMC,uCAAsE;IAC1EC,iBAAiB;AACnB;AAEO,MAAMJ,8BAA8B,CAAIK,WAC7CC,IAAAA,wCAAAA,EAAmBR,0BAA0B,CAACS,MAAMJ,oCAAoC,GAAKE,SAASE;AACjG,MAAMR,4BAA4BD,yBAAyBU,QAAQ"}
@@ -58,4 +58,3 @@ _export(exports, {
58
58
  const _PromptStarter = require("./PromptStarter");
59
59
  const _PromptStarterV2 = require("./PromptStarterV2");
60
60
  const _PromptStarterList = require("./PromptStarterList");
61
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-prompt-starter",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "A Fluent AI package",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,17 +12,17 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/react-provider": "^0.12.1",
16
- "@fluentui-copilot/tokens": "^0.3.11",
15
+ "@fluentui-copilot/react-provider": "^0.12.3",
16
+ "@fluentui-copilot/tokens": "^0.3.12",
17
17
  "@swc/helpers": "^0.5.1"
18
18
  },
19
19
  "peerDependencies": {
20
- "@fluentui/react-components": ">=9.63.0 <10.0.0",
21
- "@fluentui/react-context-selector": ">=9.1.76 <10.0.0",
22
- "@fluentui/react-icons": ">=2.0.260 <3.0.0",
23
- "@fluentui/react-jsx-runtime": ">=9.0.54 <10.0.0",
24
- "@fluentui/react-shared-contexts": ">=9.23.1 <10.0.0",
25
- "@fluentui/react-utilities": ">=9.19.0 <10.0.0",
20
+ "@fluentui/react-components": ">=9.66.0 <10.0.0",
21
+ "@fluentui/react-context-selector": ">=9.2.1 <10.0.0",
22
+ "@fluentui/react-icons": ">=2.0.303 <3.0.0",
23
+ "@fluentui/react-jsx-runtime": ">=9.1.1 <10.0.0",
24
+ "@fluentui/react-shared-contexts": ">=9.24.0 <10.0.0",
25
+ "@fluentui/react-utilities": ">=9.21.1 <10.0.0",
26
26
  "@types/react": ">=16.14.0 <19.0.0",
27
27
  "@types/react-dom": ">=16.9.8 <19.0.0",
28
28
  "react": ">=16.14.0 <19.0.0",