@fluentui-copilot/react-prompt-starter 0.9.4 → 0.10.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 (76) hide show
  1. package/CHANGELOG.json +49 -1
  2. package/CHANGELOG.md +23 -2
  3. package/dist/index.d.ts +109 -0
  4. package/lib/PromptStarterList.js +2 -0
  5. package/lib/PromptStarterList.js.map +1 -0
  6. package/lib/PromptStarterV2.js +2 -0
  7. package/lib/PromptStarterV2.js.map +1 -0
  8. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +13 -0
  9. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  10. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +4 -0
  11. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  12. package/lib/components/PromptStarterV2/PromptStarter/index.js +5 -0
  13. package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  14. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +52 -0
  15. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  16. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +11 -0
  17. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  18. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  19. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  20. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +204 -0
  21. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  22. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
  23. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  24. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
  25. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  26. package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
  27. package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  28. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
  29. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  30. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +113 -0
  31. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  32. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
  33. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  34. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
  35. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  36. package/lib/contexts/PromptStarterListContext.js +8 -0
  37. package/lib/contexts/PromptStarterListContext.js.map +1 -0
  38. package/lib/index.js +2 -0
  39. package/lib/index.js.map +1 -1
  40. package/lib-commonjs/PromptStarterList.js +29 -0
  41. package/lib-commonjs/PromptStarterList.js.map +1 -0
  42. package/lib-commonjs/PromptStarterV2.js +29 -0
  43. package/lib-commonjs/PromptStarterV2.js.map +1 -0
  44. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +23 -0
  45. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  46. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +7 -0
  47. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  48. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +32 -0
  49. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  50. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +73 -0
  51. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  52. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +27 -0
  53. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  54. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  55. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  56. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +381 -0
  57. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  58. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
  59. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  60. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
  61. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  62. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
  63. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  64. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
  65. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  66. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
  67. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  68. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
  69. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  70. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
  71. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  72. package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
  73. package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
  74. package/lib-commonjs/index.js +32 -0
  75. package/lib-commonjs/index.js.map +1 -1
  76. package/package.json +3 -2
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "usePromptStarterList_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return usePromptStarterList_unstable;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactcomponents = require("@fluentui/react-components");
14
+ const _reactprovider = require("@fluentui-copilot/react-provider");
15
+ const _reacticons = require("@fluentui/react-icons");
16
+ const _promptStarterMotion = require("../PromptStarter/promptStarterMotion");
17
+ const usePromptStarterList_unstable = (props, ref)=>{
18
+ const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less' } = props;
19
+ const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
20
+ var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
21
+ const focusAttrs = (0, _reactcomponents.useArrowNavigationGroup)({
22
+ ...arrowNavigationOptions,
23
+ axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'grid-linear',
24
+ memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
25
+ });
26
+ const [isExpanded, setIsExpanded] = _react.useState(false);
27
+ const [numberOfColumns, setNumberOfColumns] = _react.useState(3);
28
+ const gridWrapperRef = _react.useRef(null);
29
+ const { targetDocument } = (0, _reactcomponents.useFluent)();
30
+ const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
31
+ _react.useEffect(()=>{
32
+ if (!win || !gridWrapperRef.current) return;
33
+ const promptStarterGrid = gridWrapperRef.current;
34
+ const updateNumberOfColumns = ()=>{
35
+ const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
36
+ setNumberOfColumns(numColumns);
37
+ };
38
+ const ro = new win.ResizeObserver(updateNumberOfColumns);
39
+ ro.observe(promptStarterGrid);
40
+ return ()=>{
41
+ ro.unobserve(promptStarterGrid);
42
+ };
43
+ }, [
44
+ win
45
+ ]);
46
+ const state = {
47
+ numberOfColumns: numberOfColumns,
48
+ isExpanded,
49
+ designVersion,
50
+ components: {
51
+ root: 'div',
52
+ gridWrapper: 'div',
53
+ expandButton: _reactcomponents.Button
54
+ },
55
+ root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
56
+ ref,
57
+ ...props
58
+ }), {
59
+ elementType: 'div'
60
+ }),
61
+ gridWrapper: _reactcomponents.slot.always(props.gridWrapper, {
62
+ defaultProps: {
63
+ role: 'group',
64
+ ...focusAttrs
65
+ },
66
+ elementType: 'div'
67
+ }),
68
+ expandButton: _reactcomponents.slot.optional(props.expandButton, {
69
+ defaultProps: {
70
+ appearance: 'subtle',
71
+ size: 'small',
72
+ shape: 'rounded',
73
+ icon: /*#__PURE__*/ _react.createElement(_reacticons.ChevronDown12Regular, null),
74
+ iconPosition: 'after',
75
+ 'aria-expanded': isExpanded,
76
+ children: isExpanded ? collapseButtonLabel : expandButtonLabel
77
+ },
78
+ renderByDefault: true,
79
+ elementType: _reactcomponents.Button
80
+ })
81
+ };
82
+ state.gridWrapper.ref = (0, _reactcomponents.useMergedRefs)(gridWrapperRef, state.gridWrapper.ref);
83
+ // Get the array of children.
84
+ const childrenArray = _react.useMemo(()=>{
85
+ return _react.Children.toArray(state.root.children);
86
+ }, [
87
+ state.root.children
88
+ ]);
89
+ // Add motion to the children.
90
+ const childrenWithMotion = _react.useMemo(()=>childrenArray.map((child, index)=>{
91
+ // Throw error if the child is not a valid React element or is a Fragment.
92
+ if (!/*#__PURE__*/ _react.isValidElement(child) || child.type === _react.Fragment) {
93
+ throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
94
+ }
95
+ // In the collapsed state, if there is one column, we show three children.
96
+ // If there are two or three columns, we show two or three. All children
97
+ // are shown in the expanded state.
98
+ const visibility = numberOfColumns === 1 && index < 3 || index < numberOfColumns || isExpanded;
99
+ return /*#__PURE__*/ _react.createElement(_promptStarterMotion.PromptStarterMotion, {
100
+ appear: true,
101
+ key: index,
102
+ index: index,
103
+ visible: visibility,
104
+ numberOfColumns: numberOfColumns
105
+ }, child);
106
+ }), [
107
+ childrenArray,
108
+ numberOfColumns,
109
+ isExpanded
110
+ ]);
111
+ state.root.children = childrenWithMotion;
112
+ if (state.expandButton) {
113
+ state.expandButton.onClick = (0, _reactcomponents.mergeCallbacks)(state.expandButton.onClick, ()=>setIsExpanded(!isExpanded));
114
+ }
115
+ return state;
116
+ }; //# sourceMappingURL=usePromptStarterList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["usePromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less' } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'grid-linear',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = React.useState(false);\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'group',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<(React.ReactChild | React.ReactFragment | React.ReactPortal)[]>(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAAlC,MAAAY,YAAA,CAAAuB,OAAA,EAAA,IAAApD,cAAA,CAAAP;;WAKxBwB;GAGF,gDAAE"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "usePromptStarterListContextValues", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return usePromptStarterListContextValues;
9
+ }
10
+ });
11
+ function usePromptStarterListContextValues(state) {
12
+ const { numberOfColumns } = state;
13
+ return {
14
+ numberOfColumns
15
+ };
16
+ } //# 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":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,kCAAkCC,KAA6B;UAC7E,EAEAC,eAAO;WAEP;QACFA"}
@@ -0,0 +1,89 @@
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 promptStarterListClassNames = {
21
+ root: 'fai-PromptStarterList',
22
+ gridWrapper: 'fai-PromptStarterList__gridWrapper',
23
+ expandButton: 'fai-PromptStarterList__expandButton'
24
+ };
25
+ /**
26
+ * Styles for the root slot
27
+ */ const useRootClassName = (0, _reactcomponents.__resetStyles)("r1n85ojv", null, [
28
+ ".r1n85ojv{display:flex;flex-direction:column;max-width:772px;gap:var(--spacingHorizontalXL);}"
29
+ ]);
30
+ const useStyles = (0, _reactcomponents.__styles)({
31
+ gridWrapper: {
32
+ mc9l5x: "f13qh94s",
33
+ i8kkvl: 0,
34
+ Belr9w4: 0,
35
+ rmohyg: "f1p93rwu",
36
+ t4k1zu: "f4wu0r3",
37
+ Budl1dq: "fvo7o13",
38
+ Bxotwcr: "f1nkeedh"
39
+ },
40
+ expandButton: {
41
+ qb2dma: "f1locze1",
42
+ wrk2wx: "f11k2d1d",
43
+ dutsh0: "f1iwh30k",
44
+ B4u5nao: "fn63aq9",
45
+ Bbdnnc7: "fm7zj7h",
46
+ x3br3k: "fuzcl37"
47
+ },
48
+ expandButtonExpanded: {
49
+ Bs9jjb3: [
50
+ "f5l68jj",
51
+ "f1i29bk4"
52
+ ]
53
+ }
54
+ }, {
55
+ d: [
56
+ ".f13qh94s{display:grid;}",
57
+ [
58
+ ".f1p93rwu{gap:var(--spacingHorizontalL);}",
59
+ {
60
+ p: -1
61
+ }
62
+ ],
63
+ ".f4wu0r3{grid-auto-columns:max-content;}",
64
+ ".fvo7o13{grid-template-columns:repeat(auto-fit, minmax(214px, 1fr));}",
65
+ ".f1nkeedh{grid-auto-flow:unset;}",
66
+ ".f1locze1{align-self:end;}",
67
+ ".f11k2d1d .fui-Button__icon{font-size:12px;}",
68
+ ".f1iwh30k .fui-Button__icon{height:12px;}",
69
+ ".fn63aq9 .fui-Button__icon{width:12px;}",
70
+ ".f5l68jj>.fui-Button__icon{transform:rotate(180deg);}",
71
+ ".f1i29bk4>.fui-Button__icon{transform:rotate(-180deg);}"
72
+ ],
73
+ h: [
74
+ ".fm7zj7h:hover .fui-Button__icon{color:var(--colorNeutralForeground2Hover);}",
75
+ ".fuzcl37:hover:active .fui-Button__icon{color:var(--colorNeutralForeground2Pressed);}"
76
+ ]
77
+ });
78
+ const usePromptStarterListStyles_unstable = (state)=>{
79
+ 'use no memo';
80
+ const { isExpanded } = state;
81
+ const rootClassName = useRootClassName();
82
+ const styles = useStyles();
83
+ state.root.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.root, rootClassName, state.root.className);
84
+ state.gridWrapper.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
85
+ if (state.expandButton) {
86
+ state.expandButton.className = (0, _reactcomponents.mergeClasses)(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
87
+ }
88
+ return state;
89
+ }; //# sourceMappingURL=usePromptStarterListStyles.styles.js.map
@@ -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","expandButtonExpanded","root","gridWrapper","expandButton","display","__resetStyles","flexDirection","gap","tokens","i8kkvl","Belr9w4","useStyles","gridAutoColumns","gridAutoFlow","qb2dma","alignSelf","fontSize","height","state","isExpanded","rootClassName","useRootClassName","className","usePromptStarterListStyles_unstable","mergeClasses","styles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,2BAAAA;eAAAA;;IA6CXC,mCAAsB;eAAtBA;;;iCAlDkE;AAK7D,MAAMD,8BAAsE;UACjFE;iBACAC;kBACAC;AACF;AAEA;;CAEC,SAECC,mBAASC,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MACTC,YAAAA,IAAAA,yBAAe,EAAA;iBACL;QACVC,QAAKC;QACPC,QAAA;QAEAC,SAAMC;QACJT,QAAAA;gBACEE;iBACKI;iBACLI;;kBAGAC;QACFC,QAAA;QAEAX,QAAAA;gBACEY;iBACK;iBACHC;gBACAC;;0BAEF;iBACA;YAAA;YAAU;SAAA;;;;;QAGR;YAAA;YAAA;oBACF;;;;QACiB;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;;;QACkB;KAAA;;AAMrCjB,MAAAA,sCAAsBkB,CAAAA;;UAGpB,EACFC,UAAA,EACF,GAAAD;IAEA,MAAAE,gBAAAC;;IAECH,MACDjB,IAAO,CAAAqB,SAAMC,GAAAA,IAAAA,6BAAAA,EAAAA,4BAAuCL,IAAAA,EAAAA,eAAAA,MAAAA,IAAAA,CAAAA,SAAAA;UAClDhB,WAAA,CAAAoB,SAAA,GAAAE,IAAAA,6BAAA,EAAAzB,4BAAAG,WAAA,EAAAuB,OAAAvB,WAAA,EAAAgB,MAAAhB,WAAA,CAAAoB,SAAA;QAEAJ,MAAQC,YAAY,EAAA;QAEpBD,MAAME,YAAAA,CAAAA,SAAgBC,GAAAA,IAAAA,6BAAAA,EAAAA,4BAAAA,YAAAA,EAAAA,OAAAA,YAAAA,EAAAA,cAAAA,OAAAA,oBAAAA,EAAAA,MAAAA,YAAAA,CAAAA,SAAAA;;WAEtBH;gEAMwB"}
@@ -0,0 +1,28 @@
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
+ PromptStarterListContext: function() {
13
+ return PromptStarterListContext;
14
+ },
15
+ PromptStarterListProvider: function() {
16
+ return PromptStarterListProvider;
17
+ },
18
+ usePromptStarterListContext: function() {
19
+ return usePromptStarterListContext;
20
+ }
21
+ });
22
+ const _reactcontextselector = require("@fluentui/react-context-selector");
23
+ const PromptStarterListContext = (0, _reactcontextselector.createContext)(undefined);
24
+ const promptStarterListContextDefaultValue = {
25
+ numberOfColumns: 3
26
+ };
27
+ const usePromptStarterListContext = (selector)=>(0, _reactcontextselector.useContextSelector)(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue)=>selector(ctx));
28
+ const PromptStarterListProvider = PromptStarterListContext.Provider; //# sourceMappingURL=PromptStarterListContext.js.map
@@ -0,0 +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"}
@@ -12,18 +12,50 @@ _export(exports, {
12
12
  PromptStarter: function() {
13
13
  return _PromptStarter.PromptStarter;
14
14
  },
15
+ PromptStarterList: function() {
16
+ return _PromptStarterList.PromptStarterList;
17
+ },
18
+ PromptStarterV2: function() {
19
+ return _PromptStarterV2.PromptStarter;
20
+ },
15
21
  promptStarterClassNames: function() {
16
22
  return _PromptStarter.promptStarterClassNames;
17
23
  },
24
+ promptStarterListClassNames: function() {
25
+ return _PromptStarterList.promptStarterListClassNames;
26
+ },
27
+ promptStarterV2ClassNames: function() {
28
+ return _PromptStarterV2.promptStarterClassNames;
29
+ },
30
+ renderPromptStarterList_unstable: function() {
31
+ return _PromptStarterList.renderPromptStarterList_unstable;
32
+ },
33
+ renderPromptStarterV2_unstable: function() {
34
+ return _PromptStarterV2.renderPromptStarter_unstable;
35
+ },
18
36
  renderPromptStarter_unstable: function() {
19
37
  return _PromptStarter.renderPromptStarter_unstable;
20
38
  },
39
+ usePromptStarterListStyles_unstable: function() {
40
+ return _PromptStarterList.usePromptStarterListStyles_unstable;
41
+ },
42
+ usePromptStarterList_unstable: function() {
43
+ return _PromptStarterList.usePromptStarterList_unstable;
44
+ },
21
45
  usePromptStarterStyles_unstable: function() {
22
46
  return _PromptStarter.usePromptStarterStyles_unstable;
23
47
  },
48
+ usePromptStarterV2Styles_unstable: function() {
49
+ return _PromptStarterV2.usePromptStarterStyles_unstable;
50
+ },
51
+ usePromptStarterV2_unstable: function() {
52
+ return _PromptStarterV2.usePromptStarter_unstable;
53
+ },
24
54
  usePromptStarter_unstable: function() {
25
55
  return _PromptStarter.usePromptStarter_unstable;
26
56
  }
27
57
  });
28
58
  const _PromptStarter = require("./PromptStarter");
59
+ const _PromptStarterV2 = require("./PromptStarterV2");
60
+ const _PromptStarterList = require("./PromptStarterList");
29
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './PromptStarter';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,aAAa;eAAbA,4BAAa;;IACbC,uBAAuB;eAAvBA,sCAAuB;;IACvBC,4BAA4B;eAA5BA,2CAA4B;;IAC5BC,+BAA+B;eAA/BA,8CAA+B;;IAC/BC,yBAAyB;eAAzBA,wCAAyB;;;+BACpB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './PromptStarter';\n\nexport type {\n PromptStarterProps as PromptStarterV2Props,\n PromptStarterSlots as PromptStarterV2Slots,\n PromptStarterState as PromptStarterV2State,\n} from './PromptStarterV2';\nexport {\n PromptStarter as PromptStarterV2,\n promptStarterClassNames as promptStarterV2ClassNames,\n renderPromptStarter_unstable as renderPromptStarterV2_unstable,\n usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable,\n usePromptStarter_unstable as usePromptStarterV2_unstable,\n} from './PromptStarterV2';\n\nexport {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './PromptStarterList';\nexport type { PromptStarterListProps, PromptStarterListSlots, PromptStarterListState } from './PromptStarterList';"],"names":["PromptStarter","PromptStarterList","PromptStarterV2","promptStarterClassNames","promptStarterListClassNames","promptStarterV2ClassNames","renderPromptStarterList_unstable","renderPromptStarterV2_unstable","renderPromptStarter_unstable","usePromptStarterListStyles_unstable","usePromptStarterList_unstable","usePromptStarterStyles_unstable","usePromptStarterV2Styles_unstable","usePromptStarterV2_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,aAAa;eAAbA,4BAAa;;IAqBbC,iBAAiB;eAAjBA,oCAAiB;;IARAC,eAAe;eAAhCF,8BAAAA;;IAZAG,uBAAuB;eAAvBA,sCAAuB;;IAuBvBC,2BAA2B;eAA3BA,8CAA2B;;IAVAC,yBAAyB;eAApDF,wCAAAA;;IAQAG,gCAAgC;eAAhCA,mDAAgC;;IAPAC,8BAA8B;eAA9DC,6CAAAA;;IAbAA,4BAA4B;eAA5BA,2CAA4B;;IAuB5BC,mCAAmC;eAAnCA,sDAAmC;;IAFnCC,6BAA6B;eAA7BA,gDAA6B;;IApB7BC,+BAA+B;eAA/BA,8CAA+B;;IAaIC,iCAAiC;eAApED,gDAAAA;;IAC6BE,2BAA2B;eAAxDC,0CAAAA;;IAbAA,yBAAyB;eAAzBA,wCAAyB;;;+BACpB;iCAaA;mCAQA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-prompt-starter",
3
- "version": "0.9.4",
3
+ "version": "0.10.1",
4
4
  "description": "A Fluent AI package",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,13 +12,14 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/react-provider": "^0.11.3",
15
+ "@fluentui-copilot/react-provider": "^0.12.1",
16
16
  "@fluentui-copilot/tokens": "^0.3.11",
17
17
  "@swc/helpers": "^0.5.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@fluentui/react-components": ">=9.63.0 <10.0.0",
21
21
  "@fluentui/react-context-selector": ">=9.1.76 <10.0.0",
22
+ "@fluentui/react-icons": ">=2.0.260 <3.0.0",
22
23
  "@fluentui/react-jsx-runtime": ">=9.0.54 <10.0.0",
23
24
  "@fluentui/react-shared-contexts": ">=9.23.1 <10.0.0",
24
25
  "@fluentui/react-utilities": ">=9.19.0 <10.0.0",