@fluentui-copilot/react-prompt-starter 0.9.4 → 0.10.0
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 +34 -1
- package/CHANGELOG.md +14 -2
- package/dist/index.d.ts +109 -0
- package/lib/PromptStarterList.js +2 -0
- package/lib/PromptStarterList.js.map +1 -0
- package/lib/PromptStarterV2.js +2 -0
- package/lib/PromptStarterV2.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +13 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +4 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js +5 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +43 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +11 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +204 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +114 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib/contexts/PromptStarterListContext.js +8 -0
- package/lib/contexts/PromptStarterListContext.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/PromptStarterList.js +29 -0
- package/lib-commonjs/PromptStarterList.js.map +1 -0
- package/lib-commonjs/PromptStarterV2.js +29 -0
- package/lib-commonjs/PromptStarterV2.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +7 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +32 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +60 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +27 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +381 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
- package/lib-commonjs/index.js +32 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
3
|
+
import { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
4
|
+
import { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
+
import { usePromptStarterListContextValues } from './usePromptStarterListContextValues';
|
|
6
|
+
export const PromptStarterList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = usePromptStarterList_unstable(props, ref);
|
|
8
|
+
const contextValues = usePromptStarterListContextValues(state);
|
|
9
|
+
usePromptStarterListStyles_unstable(state);
|
|
10
|
+
return renderPromptStarterList_unstable(state, contextValues);
|
|
11
|
+
});
|
|
12
|
+
PromptStarterList.displayName = 'PromptStarterList';
|
|
13
|
+
//# sourceMappingURL=PromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarterList_unstable } from './usePromptStarterList';\nimport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nimport { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\nimport type { PromptStarterListProps } from './PromptStarterList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { usePromptStarterListContextValues } from './usePromptStarterListContextValues';\n\nexport const PromptStarterList: ForwardRefComponent<PromptStarterListProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarterList_unstable(props, ref);\n const contextValues = usePromptStarterListContextValues(state);\n\n usePromptStarterListStyles_unstable(state);\n return renderPromptStarterList_unstable(state, contextValues);\n});\n\nPromptStarterList.displayName = 'PromptStarterList';\n"],"names":["React","usePromptStarterList_unstable","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterListContextValues","PromptStarterList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,sCAAsC;AAG1F,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQR,8BAA8BM,OAAOC;IACnD,MAAME,gBAAgBN,kCAAkCK;IAExDN,oCAAoCM;IACpC,OAAOP,iCAAiCO,OAAOC;AACjD,GAAG;AAEHL,kBAAkBM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type {\n ComponentProps,\n ComponentState,\n Slot,\n Button,\n UseArrowNavigationGroupOptions,\n} from '@fluentui/react-components';\n\nexport type PromptStarterListSlots = {\n root: NonNullable<Slot<'div'>>;\n gridWrapper: NonNullable<Slot<'div'>>;\n expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<PromptStarterListSlots> &\n DesignVersion & {\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n /**\n * Arrow navigation options. This can be used to customize Tabster's direction,\n * tab behavior, and memoization options.\n *\n * default: { axis: 'horizontal', memorizeCurrent: true }\n */\n arrowNavigationOptions?: UseArrowNavigationGroupOptions;\n };\n\n/**\n * State used in rendering PromptStarterList\n */\nexport type PromptStarterListState = ComponentState<PromptStarterListSlots> &\n Required<Pick<PromptStarterListProps, 'designVersion'>> & {\n numberOfColumns: number;\n isExpanded?: boolean;\n };\n\nexport type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;\n"],"names":[],"rangeMappings":"","mappings":"AAkDA,WAA2G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PromptStarterList } from './PromptStarterList';
|
|
2
|
+
export { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
3
|
+
export { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
4
|
+
export { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptStarterList } from './PromptStarterList';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\nexport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nexport { usePromptStarterList_unstable } from './usePromptStarterList';\nexport { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\n"],"names":["PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,sBAAsB;AAOxD,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,2BAA2B,EAAEC,mCAAmC,QAAQ,sCAAsC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots, PresenceGroup } from '@fluentui/react-components';
|
|
3
|
+
import { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of PromptStarterList
|
|
6
|
+
*/
|
|
7
|
+
export const renderPromptStarterList_unstable = (state, contextValue) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return /*#__PURE__*/_jsx(PromptStarterListProvider, {
|
|
10
|
+
value: contextValue,
|
|
11
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
12
|
+
children: [/*#__PURE__*/_jsx(PresenceGroup, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(state.gridWrapper, {
|
|
14
|
+
children: state.root.children
|
|
15
|
+
})
|
|
16
|
+
}), state.expandButton && /*#__PURE__*/_jsx(state.expandButton, {})]
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=renderPromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderPromptStarterList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, PresenceGroup } from '@fluentui/react-components';\nimport { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';\nimport type {\n PromptStarterListState,\n PromptStarterListSlots,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\n\n/**\n * Render the final JSX of PromptStarterList\n */\nexport const renderPromptStarterList_unstable = (\n state: PromptStarterListState,\n contextValue: PromptStarterListContextValue,\n) => {\n assertSlots<PromptStarterListSlots>(state);\n\n return (\n <PromptStarterListProvider value={contextValue}>\n <state.root>\n <PresenceGroup>\n <state.gridWrapper>{state.root.children}</state.gridWrapper>\n </PresenceGroup>\n {state.expandButton && <state.expandButton />}\n </state.root>\n </PromptStarterListProvider>\n );\n};\n"],"names":["assertSlots","PresenceGroup","PromptStarterListProvider","renderPromptStarterList_unstable","state","contextValue","value","root","gridWrapper","children","expandButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,aAAa,QAAQ,6BAA6B;AACxE,SAASC,yBAAyB,QAAQ,6CAA6C;AAOvF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAC9CC,OACAC;IAEAL,YAAoCI;IAEpC,qBACE,KAACF;QAA0BI,OAAOD;kBAChC,cAAA,MAACD,MAAMG,IAAI;;8BACT,KAACN;8BACC,cAAA,KAACG,MAAMI,WAAW;kCAAEJ,MAAMG,IAAI,CAACE,QAAQ;;;gBAExCL,MAAMM,YAAY,kBAAI,KAACN,MAAMM,YAAY;;;;AAIlD,EAAE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeCallbacks, useFluent, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
4
|
+
import { ChevronDown12Regular } from '@fluentui/react-icons';
|
|
5
|
+
import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
6
|
+
/**
|
|
7
|
+
* Create the state required to render PromptStarterList.
|
|
8
|
+
*
|
|
9
|
+
* The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,
|
|
10
|
+
* before being passed to renderPromptStarterList_unstable.
|
|
11
|
+
*
|
|
12
|
+
* @param props - props from this instance of PromptStarterList
|
|
13
|
+
* @param ref - reference to root HTMLElement of PromptStarterList
|
|
14
|
+
*/
|
|
15
|
+
export const usePromptStarterList_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
arrowNavigationOptions,
|
|
18
|
+
expandButtonLabel = 'Show more',
|
|
19
|
+
collapseButtonLabel = 'Show less'
|
|
20
|
+
} = props;
|
|
21
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
22
|
+
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
23
|
+
const focusAttrs = useArrowNavigationGroup({
|
|
24
|
+
...arrowNavigationOptions,
|
|
25
|
+
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'grid-linear',
|
|
26
|
+
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
27
|
+
});
|
|
28
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
29
|
+
const [numberOfColumns, setNumberOfColumns] = React.useState(3);
|
|
30
|
+
const gridWrapperRef = React.useRef(null);
|
|
31
|
+
const {
|
|
32
|
+
targetDocument
|
|
33
|
+
} = useFluent();
|
|
34
|
+
const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (!win || !gridWrapperRef.current) return;
|
|
37
|
+
const promptStarterGrid = gridWrapperRef.current;
|
|
38
|
+
const updateNumberOfColumns = () => {
|
|
39
|
+
const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
|
|
40
|
+
setNumberOfColumns(numColumns);
|
|
41
|
+
};
|
|
42
|
+
const ro = new win.ResizeObserver(updateNumberOfColumns);
|
|
43
|
+
ro.observe(promptStarterGrid);
|
|
44
|
+
return () => {
|
|
45
|
+
ro.unobserve(promptStarterGrid);
|
|
46
|
+
};
|
|
47
|
+
}, [win]);
|
|
48
|
+
const state = {
|
|
49
|
+
numberOfColumns: numberOfColumns,
|
|
50
|
+
isExpanded,
|
|
51
|
+
designVersion,
|
|
52
|
+
components: {
|
|
53
|
+
root: 'div',
|
|
54
|
+
gridWrapper: 'div',
|
|
55
|
+
expandButton: Button
|
|
56
|
+
},
|
|
57
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
58
|
+
ref,
|
|
59
|
+
...props
|
|
60
|
+
}), {
|
|
61
|
+
elementType: 'div'
|
|
62
|
+
}),
|
|
63
|
+
gridWrapper: slot.always(props.gridWrapper, {
|
|
64
|
+
defaultProps: {
|
|
65
|
+
role: 'group',
|
|
66
|
+
...focusAttrs
|
|
67
|
+
},
|
|
68
|
+
elementType: 'div'
|
|
69
|
+
}),
|
|
70
|
+
expandButton: slot.optional(props.expandButton, {
|
|
71
|
+
defaultProps: {
|
|
72
|
+
appearance: 'subtle',
|
|
73
|
+
size: 'small',
|
|
74
|
+
shape: 'rounded',
|
|
75
|
+
icon: /*#__PURE__*/React.createElement(ChevronDown12Regular, null),
|
|
76
|
+
iconPosition: 'after',
|
|
77
|
+
'aria-expanded': isExpanded,
|
|
78
|
+
children: isExpanded ? collapseButtonLabel : expandButtonLabel
|
|
79
|
+
},
|
|
80
|
+
renderByDefault: true,
|
|
81
|
+
elementType: Button
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);
|
|
85
|
+
// Get the array of children.
|
|
86
|
+
const childrenArray = React.useMemo(() => {
|
|
87
|
+
return React.Children.toArray(state.root.children);
|
|
88
|
+
}, [state.root.children]);
|
|
89
|
+
// Add motion to the children.
|
|
90
|
+
const childrenWithMotion = React.useMemo(() => childrenArray.map((child, index) => {
|
|
91
|
+
// Throw error if the child is not a valid React element or is a Fragment.
|
|
92
|
+
if (! /*#__PURE__*/React.isValidElement(child) || child.type === React.Fragment) {
|
|
93
|
+
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
94
|
+
}
|
|
95
|
+
return /*#__PURE__*/React.createElement(PromptStarterMotion, {
|
|
96
|
+
appear: true,
|
|
97
|
+
key: index,
|
|
98
|
+
index: index,
|
|
99
|
+
numberOfColumns: numberOfColumns
|
|
100
|
+
}, child);
|
|
101
|
+
}), [childrenArray, numberOfColumns]);
|
|
102
|
+
// In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.
|
|
103
|
+
if (!isExpanded) {
|
|
104
|
+
const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;
|
|
105
|
+
state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);
|
|
106
|
+
} else {
|
|
107
|
+
state.root.children = childrenWithMotion;
|
|
108
|
+
}
|
|
109
|
+
if (state.expandButton) {
|
|
110
|
+
state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, () => setIsExpanded(!isExpanded));
|
|
111
|
+
}
|
|
112
|
+
return state;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=usePromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less' } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'grid-linear',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = React.useState(false);\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'group',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<(React.ReactChild | React.ReactFragment | React.ReactPortal)[]>(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n return (\n <PromptStarterMotion appear key={index} index={index} numberOfColumns={numberOfColumns}>\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns],\n );\n\n // In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.\n if (!isExpanded) {\n const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;\n state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);\n } else {\n state.root.children = childrenWithMotion;\n }\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n () => setIsExpanded(!isExpanded),\n );\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","appear","key","collapsedVisibleItems","slice","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;","mappings":"AAEA,OAAO,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { buttonClassNames, __resetStyles, __styles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const promptStarterListClassNames = {
|
|
4
|
+
root: 'fai-PromptStarterList',
|
|
5
|
+
gridWrapper: 'fai-PromptStarterList__gridWrapper',
|
|
6
|
+
expandButton: 'fai-PromptStarterList__expandButton'
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the root slot
|
|
10
|
+
*/
|
|
11
|
+
const useRootClassName = __resetStyles("r1n85ojv", null, [".r1n85ojv{display:flex;flex-direction:column;max-width:772px;gap:var(--spacingHorizontalXL);}"]);
|
|
12
|
+
const useStyles = __styles({
|
|
13
|
+
gridWrapper: {
|
|
14
|
+
mc9l5x: "f13qh94s",
|
|
15
|
+
i8kkvl: 0,
|
|
16
|
+
Belr9w4: 0,
|
|
17
|
+
rmohyg: "f1p93rwu",
|
|
18
|
+
t4k1zu: "f4wu0r3",
|
|
19
|
+
Budl1dq: "fvo7o13",
|
|
20
|
+
Bxotwcr: "f1nkeedh"
|
|
21
|
+
},
|
|
22
|
+
expandButton: {
|
|
23
|
+
qb2dma: "f1locze1",
|
|
24
|
+
wrk2wx: "f11k2d1d",
|
|
25
|
+
dutsh0: "f1iwh30k",
|
|
26
|
+
B4u5nao: "fn63aq9",
|
|
27
|
+
Bbdnnc7: "fm7zj7h",
|
|
28
|
+
x3br3k: "fuzcl37"
|
|
29
|
+
},
|
|
30
|
+
expandButtonExpanded: {
|
|
31
|
+
Bs9jjb3: ["f5l68jj", "f1i29bk4"]
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
d: [".f13qh94s{display:grid;}", [".f1p93rwu{gap:var(--spacingHorizontalL);}", {
|
|
35
|
+
p: -1
|
|
36
|
+
}], ".f4wu0r3{grid-auto-columns:max-content;}", ".fvo7o13{grid-template-columns:repeat(auto-fit, minmax(214px, 1fr));}", ".f1nkeedh{grid-auto-flow:unset;}", ".f1locze1{align-self:end;}", ".f11k2d1d .fui-Button__icon{font-size:12px;}", ".f1iwh30k .fui-Button__icon{height:12px;}", ".fn63aq9 .fui-Button__icon{width:12px;}", ".f5l68jj>.fui-Button__icon{transform:rotate(180deg);}", ".f1i29bk4>.fui-Button__icon{transform:rotate(-180deg);}"],
|
|
37
|
+
h: [".fm7zj7h:hover .fui-Button__icon{color:var(--colorNeutralForeground2Hover);}", ".fuzcl37:hover:active .fui-Button__icon{color:var(--colorNeutralForeground2Pressed);}"]
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Apply styling to the PromptStarterList slots based on the state
|
|
41
|
+
*/
|
|
42
|
+
export const usePromptStarterListStyles_unstable = state => {
|
|
43
|
+
'use no memo';
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
isExpanded
|
|
47
|
+
} = state;
|
|
48
|
+
const rootClassName = useRootClassName();
|
|
49
|
+
const styles = useStyles();
|
|
50
|
+
state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);
|
|
51
|
+
state.gridWrapper.className = mergeClasses(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
|
|
52
|
+
if (state.expandButton) {
|
|
53
|
+
state.expandButton.className = mergeClasses(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
|
|
54
|
+
}
|
|
55
|
+
return state;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=usePromptStarterListStyles.styles.js.map
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map
ADDED
|
@@ -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":["buttonClassNames","makeResetStyles","makeStyles","mergeClasses","tokens","promptStarterListClassNames","root","gridWrapper","expandButton","useRootClassName","display","flexDirection","maxWidth","gap","spacingHorizontalXL","useStyles","spacingHorizontalL","gridAutoColumns","gridTemplateColumns","gridAutoFlow","alignSelf","icon","fontSize","height","width","color","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","expandButtonExpanded","transform","usePromptStarterListStyles_unstable","state","isExpanded","rootClassName","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AAGzG,SAASC,MAAM,QAAQ,2BAA2B;AAElD,OAAO,MAAMC,8BAAsE;IACjFC,MAAM;IACNC,aAAa;IACbC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBR,gBAAgB;IACvCS,SAAS;IACTC,eAAe;IACfC,UAAU;IACVC,KAAKT,OAAOU,mBAAmB;AACjC;AAEA,MAAMC,YAAYb,WAAW;IAC3BK,aAAa;QACXG,SAAS;QACTG,KAAKT,OAAOY,kBAAkB;QAC9BC,iBAAiB;QAEjBC,qBAAqB,CAAC,oCAAoC,CAAC;QAC3DC,cAAc;IAChB;IAEAX,cAAc;QACZY,WAAW;QACX,CAAC,CAAC,GAAG,EAAEpB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YAC/BC,UAAU;YACVC,QAAQ;YACRC,OAAO;QACT;QACA,UAAU;YACR,CAAC,CAAC,GAAG,EAAExB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOsB,4BAA4B;YAC5C;QACF;QACA,iBAAiB;YACf,CAAC,CAAC,GAAG,EAAE1B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOuB,8BAA8B;YAC9C;QACF;IACF;IAEAC,sBAAsB;QACpB,CAAC,CAAC,KAAK,EAAE5B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YACjCQ,WAAW;QACb;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,sCAAsC,CAACC;IAClD;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAGD;IAEvB,MAAME,gBAAgBxB;IACtB,MAAMyB,SAASnB;IACfgB,MAAMzB,IAAI,CAAC6B,SAAS,GAAGhC,aAAaE,4BAA4BC,IAAI,EAAE2B,eAAeF,MAAMzB,IAAI,CAAC6B,SAAS;IACzGJ,MAAMxB,WAAW,CAAC4B,SAAS,GAAGhC,aAC5BE,4BAA4BE,WAAW,EACvC2B,OAAO3B,WAAW,EAClBwB,MAAMxB,WAAW,CAAC4B,SAAS;IAE7B,IAAIJ,MAAMvB,YAAY,EAAE;QACtBuB,MAAMvB,YAAY,CAAC2B,SAAS,GAAGhC,aAC7BE,4BAA4BG,YAAY,EACxC0B,OAAO1B,YAAY,EACnBwB,cAAcE,OAAON,oBAAoB,EACzCG,MAAMvB,YAAY,CAAC2B,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
+
export const PromptStarterListContext = createContext(undefined);
|
|
3
|
+
const promptStarterListContextDefaultValue = {
|
|
4
|
+
numberOfColumns: 3
|
|
5
|
+
};
|
|
6
|
+
export const usePromptStarterListContext = selector => useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));
|
|
7
|
+
export const PromptStarterListProvider = PromptStarterListContext.Provider;
|
|
8
|
+
//# 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":["createContext","useContextSelector","PromptStarterListContext","undefined","promptStarterListContextDefaultValue","numberOfColumns","usePromptStarterListContext","selector","ctx","PromptStarterListProvider","Provider"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,OAAO,MAAMC,2BAA2BF,cAAyDG,WAAW;AAE5G,MAAMC,uCAAsE;IAC1EC,iBAAiB;AACnB;AAEA,OAAO,MAAMC,8BAA8B,CAAIC,WAC7CN,mBAAmBC,0BAA0B,CAACM,MAAMJ,oCAAoC,GAAKG,SAASC,MAAM;AAC9G,OAAO,MAAMC,4BAA4BP,yBAAyBQ,QAAQ,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { PromptStarter, promptStarterClassNames, renderPromptStarter_unstable, usePromptStarterStyles_unstable, usePromptStarter_unstable } from './PromptStarter';
|
|
2
|
+
export { PromptStarter as PromptStarterV2, promptStarterClassNames as promptStarterV2ClassNames, renderPromptStarter_unstable as renderPromptStarterV2_unstable, usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable, usePromptStarter_unstable as usePromptStarterV2_unstable } from './PromptStarterV2';
|
|
3
|
+
export { PromptStarterList, renderPromptStarterList_unstable, usePromptStarterList_unstable, promptStarterListClassNames, usePromptStarterListStyles_unstable } from './PromptStarterList';
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -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":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB"}
|
|
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","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable","PromptStarterV2","promptStarterV2ClassNames","renderPromptStarterV2_unstable","usePromptStarterV2Styles_unstable","usePromptStarterV2_unstable","PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEJ,iBAAiBK,eAAe,EAChCJ,2BAA2BK,yBAAyB,EACpDJ,gCAAgCK,8BAA8B,EAC9DJ,mCAAmCK,iCAAiC,EACpEJ,6BAA6BK,2BAA2B,QACnD,oBAAoB;AAE3B,SACEC,iBAAiB,EACjBC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mCAAmC,QAC9B,sBAAsB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
PromptStarterList: function() {
|
|
13
|
+
return _index.PromptStarterList;
|
|
14
|
+
},
|
|
15
|
+
promptStarterListClassNames: function() {
|
|
16
|
+
return _index.promptStarterListClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarterList_unstable: function() {
|
|
19
|
+
return _index.renderPromptStarterList_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterListStyles_unstable: function() {
|
|
22
|
+
return _index.usePromptStarterListStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarterList_unstable: function() {
|
|
25
|
+
return _index.usePromptStarterList_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/PromptStarterV2/PromptStarterList/index");
|
|
29
|
+
//# sourceMappingURL=PromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.ts"],"sourcesContent":["export {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './components/PromptStarterV2/PromptStarterList/index';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './components/PromptStarterV2/PromptStarterList/index';\n"],"names":["PromptStarterList","promptStarterListClassNames","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,iBAAiB;eAAjBA,wBAAiB;;IAGjBC,2BAA2B;eAA3BA,kCAA2B;;IAF3BC,gCAAgC;eAAhCA,uCAAgC;;IAGhCC,mCAAmC;eAAnCA,0CAAmC;;IAFnCC,6BAA6B;eAA7BA,oCAA6B;;;uBAGxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
PromptStarter: function() {
|
|
13
|
+
return _index.PromptStarter;
|
|
14
|
+
},
|
|
15
|
+
promptStarterClassNames: function() {
|
|
16
|
+
return _index.promptStarterClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarter_unstable: function() {
|
|
19
|
+
return _index.renderPromptStarter_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterStyles_unstable: function() {
|
|
22
|
+
return _index.usePromptStarterStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarter_unstable: function() {
|
|
25
|
+
return _index.usePromptStarter_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/PromptStarterV2/PromptStarter/index");
|
|
29
|
+
//# sourceMappingURL=PromptStarterV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterV2.ts"],"sourcesContent":["export type {\n PromptStarterProps,\n PromptStarterSlots,\n PromptStarterState,\n} from './components/PromptStarterV2/PromptStarter/index';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './components/PromptStarterV2/PromptStarter/index';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMEA,aAAa;eAAbA,oBAAa;;IACbC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,4BAA4B;eAA5BA,mCAA4B;;IAC5BC,+BAA+B;eAA/BA,sCAA+B;;IAC/BC,yBAAyB;eAAzBA,gCAAyB;;;uBACpB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PromptStarter", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PromptStarter;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _usePromptStarter = require("./usePromptStarter");
|
|
14
|
+
const _renderPromptStarter = require("./renderPromptStarter");
|
|
15
|
+
const _usePromptStarterStylesstyles = require("./usePromptStarterStyles.styles");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const PromptStarter = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _usePromptStarter.usePromptStarter_unstable)(props, ref);
|
|
19
|
+
(0, _usePromptStarterStylesstyles.usePromptStarterStyles_unstable)(state);
|
|
20
|
+
(0, _reactprovider.useCustomStyleHook)('usePromptStarterStyles')(state);
|
|
21
|
+
return (0, _renderPromptStarter.renderPromptStarter_unstable)(state);
|
|
22
|
+
});
|
|
23
|
+
PromptStarter.displayName = 'PromptStarter'; //# sourceMappingURL=PromptStarter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarter_unstable } from './usePromptStarter';\nimport { renderPromptStarter_unstable } from './renderPromptStarter';\nimport { usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\nimport type { PromptStarterProps } from './PromptStarter.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const PromptStarter: ForwardRefComponent<PromptStarterProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarter_unstable(props, ref);\n\n usePromptStarterStyles_unstable(state);\n useCustomStyleHook('usePromptStarterStyles')(state);\n\n return renderPromptStarter_unstable(state);\n});\n\nPromptStarter.displayName = 'PromptStarter';\n"],"names":["PromptStarter","React","forwardRef","props","state","usePromptStarter_unstable","usePromptStarterStyles_unstable","useCustomStyleHook","renderPromptStarter_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;kCACmB;qCACG;8CACG;+BACb;AAI5B,MAAMA,gBAAAA,WAAAA,GAAAA,OAAyDC,UAAMC,CAAU,CAACC,OAACA;UACtFC,QAAMA,IAAAA,2CAAQC,EAAAA,OAA0BF;qEAExCG,EAAAA;yCACAC,EAAAA,0BAAmBH;WAEnBI,IAAAA,iDAAOA,EAAAA;AACT;AAEAR,cAAcS,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarter.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PromptStarterSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button'>>;\n icon: NonNullable<Slot<'span'>>;\n prompt: NonNullable<Slot<'span'>>;\n reasonMarker?: Slot<'span'>;\n actions?: Slot<'span'>;\n};\n\n/**\n * PromptStarter Props\n */\nexport type PromptStarterProps = Omit<ComponentProps<PromptStarterSlots>, 'disabled'>;\n\n/**\n * State used in rendering PromptStarter\n */\nexport type PromptStarterState = ComponentState<PromptStarterSlots> & {\n isSingleColumn?: boolean;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAgBA;;CAEC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
PromptStarter: function() {
|
|
13
|
+
return _PromptStarter.PromptStarter;
|
|
14
|
+
},
|
|
15
|
+
promptStarterClassNames: function() {
|
|
16
|
+
return _usePromptStarterStylesstyles.promptStarterClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarter_unstable: function() {
|
|
19
|
+
return _renderPromptStarter.renderPromptStarter_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterStyles_unstable: function() {
|
|
22
|
+
return _usePromptStarterStylesstyles.usePromptStarterStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarter_unstable: function() {
|
|
25
|
+
return _usePromptStarter.usePromptStarter_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _PromptStarter = require("./PromptStarter");
|
|
29
|
+
const _renderPromptStarter = require("./renderPromptStarter");
|
|
30
|
+
const _usePromptStarter = require("./usePromptStarter");
|
|
31
|
+
const _usePromptStarterStylesstyles = require("./usePromptStarterStyles.styles");
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptStarter } from './PromptStarter';\nexport type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nexport { renderPromptStarter_unstable } from './renderPromptStarter';\nexport { usePromptStarter_unstable } from './usePromptStarter';\nexport { promptStarterClassNames, usePromptStarterStyles_unstable } from './usePromptStarterStyles.styles';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAIbC,uBAAuB;eAAvBA,qDAAuB;;IAFvBC,4BAA4B;eAA5BA,iDAA4B;;IAEHC,+BAA+B;eAA/BA,6DAA+B;;IADxDC,yBAAyB;eAAzBA,2CAAyB;;;+BAHJ;qCAEe;kCACH;8CAC+B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PromptStarterMotion", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PromptStarterMotion;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
12
|
+
const PromptStarterMotion = (0, _reactcomponents.createPresenceComponent)(({ index, numberOfColumns })=>{
|
|
13
|
+
const isFirstRow = index < numberOfColumns;
|
|
14
|
+
const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;
|
|
15
|
+
const opacityDuration = 100;
|
|
16
|
+
const opacityOffset = delay / (delay + 100);
|
|
17
|
+
const opacityEasing = 'linear';
|
|
18
|
+
const scaleDuration = 500;
|
|
19
|
+
const scaleOffset = delay / (delay + scaleDuration);
|
|
20
|
+
const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;
|
|
21
|
+
return {
|
|
22
|
+
enter: [
|
|
23
|
+
{
|
|
24
|
+
keyframes: [
|
|
25
|
+
{
|
|
26
|
+
opacity: 0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
opacity: 0,
|
|
30
|
+
offset: opacityOffset
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
opacity: 1
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
easing: opacityEasing,
|
|
37
|
+
duration: opacityDuration + delay
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
keyframes: [
|
|
41
|
+
{
|
|
42
|
+
transform: 'scale(0.9)'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
transform: 'scale(0.9)',
|
|
46
|
+
offset: scaleOffset
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
transform: 'scale(1)'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
easing: scaleEasing,
|
|
53
|
+
duration: scaleDuration + delay
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
exit: {
|
|
57
|
+
keyframes: []
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}); //# sourceMappingURL=promptStarterMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["promptStarterMotion.ts"],"sourcesContent":["import { createPresenceComponent } from '@fluentui/react-components';\n\nexport type PromptStarterMotionParams = { index: number; numberOfColumns: number };\n\nexport const PromptStarterMotion = createPresenceComponent<PromptStarterMotionParams>(({ index, numberOfColumns }) => {\n const isFirstRow = index < numberOfColumns;\n const delay = isFirstRow ? index * 50 : (index - numberOfColumns) * 50;\n\n const opacityDuration = 100;\n const opacityOffset = delay / (delay + 100);\n const opacityEasing = 'linear';\n\n const scaleDuration = 500;\n const scaleOffset = delay / (delay + scaleDuration);\n const scaleEasing = `cubic-bezier(0.22, 1.59, 0.46, 1)`;\n\n return {\n enter: [\n {\n keyframes: [{ opacity: 0 }, { opacity: 0, offset: opacityOffset }, { opacity: 1 }],\n easing: opacityEasing,\n duration: opacityDuration + delay,\n },\n {\n keyframes: [\n { transform: 'scale(0.9)' },\n { transform: 'scale(0.9)', offset: scaleOffset },\n { transform: 'scale(1)' },\n ],\n easing: scaleEasing,\n duration: scaleDuration + delay,\n },\n ],\n exit: {\n keyframes: [],\n },\n };\n});\n"],"names":["PromptStarterMotion","createPresenceComponent","delay","isFirstRow","opacityOffset","opacityEasing","index","numberOfColumns","opacityDuration","scaleDuration","enter","duration","keyframes","scaleOffset"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;iCAJ2B;AAIjC,MAAMA,sBAAsBC,IAAAA,wCAAAA,EAAmD,CAAC,OACrF,iBACMC;UAGNC,aAAMC,QAAgBF;UACtBA,QAAMG,aAAgBC,QAAA,KAAA,AAAAA,CAAAA,QAAAC,eAAA,IAAA;UAEtBC,kBAAsB;UACtBJ,gBAAoBF,QAASA,CAAAA,QAAQO,GAAAA;UACrCJ,gBAAoB;UAEpBI,gBAAO;UACLC,cAAOR,QAAAA,CAAAA,QAAAO,aAAA;wBACL,CAAA,iCAAA,CAAA;;;;;;;;;;;;;;;;;4CACoFP;;;2BAElFS;oBAAAA;mCACF;;;mCAEEC;;;;;;;;0CAEqCC;;;;;;;mDAIXX"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderPromptStarter_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderPromptStarter_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderPromptStarter_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(state.primaryAction, {
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
|
|
20
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.prompt, {}),
|
|
21
|
+
state.reasonMarker && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.reasonMarker, {})
|
|
22
|
+
]
|
|
23
|
+
}),
|
|
24
|
+
state.actions && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.actions, {})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}; //# sourceMappingURL=renderPromptStarter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderPromptStarter.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PromptStarterState, PromptStarterSlots } from './PromptStarter.types';\n\nexport const renderPromptStarter_unstable = (state: PromptStarterState) => {\n assertSlots<PromptStarterSlots>(state);\n\n return (\n <state.root>\n <state.primaryAction>\n <state.icon />\n <state.prompt />\n {state.reasonMarker && <state.reasonMarker />}\n </state.primaryAction>\n {state.actions && <state.actions />}\n </state.root>\n );\n};\n"],"names":["renderPromptStarter_unstable","state","assertSlots","_jsxs","root","_jsx","primaryAction","prompt","reasonMarker"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;4BALb;iCAE4B;AAGrB,MAAMA,+BAA+BC,CAAAA;oCAC1CC,EAAAA;WAEA,WAAA,GAAAC,IAAAA,gBACE,EAAAF,MAACA,IAAMG,EAAAA;;;;+BACL,GAAAC,IAAAA,eAACJ,EAAAA,MAAMK,IAAAA,EAAAA,CAAAA;oBAAa,WAAA,GAAAD,IAAAA,eAAA,EAAAJ,MAAAM,MAAA,EAAA,CAAA;oBAAAN,MAAAO,YAAA,IAAA,WAAA,GAAAH,IAAAA,eAAA,EAAAJ,MAAAO,YAAA,EAAA,CAAA;iBAAA;;;;;kDAGC"}
|