@fluentui-copilot/react-prompt-starter 0.9.3 → 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.
Files changed (80) hide show
  1. package/CHANGELOG.json +57 -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/PromptStarter/usePromptStarter.js +10 -1
  9. package/lib/components/PromptStarter/usePromptStarter.js.map +1 -1
  10. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +13 -0
  11. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  12. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +4 -0
  13. package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  14. package/lib/components/PromptStarterV2/PromptStarter/index.js +5 -0
  15. package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  16. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +43 -0
  17. package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  18. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +11 -0
  19. package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  20. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  21. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  22. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +204 -0
  23. package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  24. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
  25. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  26. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
  27. package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  28. package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
  29. package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  30. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
  31. package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  32. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +114 -0
  33. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  34. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
  35. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  36. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
  37. package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  38. package/lib/contexts/PromptStarterListContext.js +8 -0
  39. package/lib/contexts/PromptStarterListContext.js.map +1 -0
  40. package/lib/index.js +2 -0
  41. package/lib/index.js.map +1 -1
  42. package/lib-commonjs/PromptStarterList.js +29 -0
  43. package/lib-commonjs/PromptStarterList.js.map +1 -0
  44. package/lib-commonjs/PromptStarterV2.js +29 -0
  45. package/lib-commonjs/PromptStarterV2.js.map +1 -0
  46. package/lib-commonjs/components/PromptStarter/usePromptStarter.js +9 -0
  47. package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
  48. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +23 -0
  49. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
  50. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +7 -0
  51. package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
  52. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +32 -0
  53. package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
  54. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +60 -0
  55. package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
  56. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +27 -0
  57. package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
  58. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
  59. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
  60. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +381 -0
  61. package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
  62. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
  63. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
  64. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
  65. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
  66. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
  67. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
  68. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
  69. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
  70. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
  71. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
  72. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
  73. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
  74. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
  75. package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
  76. package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
  77. package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
  78. package/lib-commonjs/index.js +32 -0
  79. package/lib-commonjs/index.js.map +1 -1
  80. package/package.json +3 -2
@@ -12,6 +12,7 @@ const _reactprovider = require("@fluentui-copilot/react-provider");
12
12
  const _reactcomponents = require("@fluentui/react-components");
13
13
  const usePromptStarter_unstable = (props, ref)=>{
14
14
  const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
15
+ const idPrefix = (0, _reactcomponents.useId)('prompt-starter');
15
16
  return {
16
17
  components: {
17
18
  root: 'button',
@@ -22,6 +23,8 @@ const usePromptStarter_unstable = (props, ref)=>{
22
23
  },
23
24
  root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('button', {
24
25
  ref,
26
+ 'aria-labelledby': `${idPrefix}-category`,
27
+ 'aria-describedby': `${idPrefix}-prompt`,
25
28
  ...props
26
29
  }), {
27
30
  elementType: 'button'
@@ -30,9 +33,15 @@ const usePromptStarter_unstable = (props, ref)=>{
30
33
  elementType: 'span'
31
34
  }),
32
35
  category: _reactcomponents.slot.always(props.category, {
36
+ defaultProps: {
37
+ id: `${idPrefix}-category`
38
+ },
33
39
  elementType: 'span'
34
40
  }),
35
41
  prompt: _reactcomponents.slot.optional(props.prompt, {
42
+ defaultProps: {
43
+ id: `${idPrefix}-prompt`
44
+ },
36
45
  elementType: 'span'
37
46
  }),
38
47
  badge: _reactcomponents.slot.optional(props.badge, {
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { Badge, getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLButtonElement>,\n): PromptStarterState => {\n const designVersion = useDesignVersion(props.designVersion);\n return {\n components: {\n root: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n badge: Badge,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n ...props,\n }),\n { elementType: 'button' },\n ),\n icon: slot.always(props.icon, { elementType: 'span' }),\n category: slot.always(props.category, { elementType: 'span' }),\n prompt: slot.optional(props.prompt, { elementType: 'span' }),\n badge: slot.optional(props.badge, { defaultProps: { appearance: 'tint' }, elementType: Badge }),\n designVersion,\n };\n};\n"],"names":["designVersion","useDesignVersion","props","components","root","icon","category","prompt","badge","Badge","ref","elementType","defaultProps","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBQA;;;eAAAA;;;+BAjByB;iCACqB;AAgBpD,MAAMA,4BAAgBC,CAAAA,OAAuBD;UAC7CA,gBAAOC,IAAAA,+BAAA,EAAAC,MAAAF,aAAA;WACLG;oBACEC;kBACAC;kBACAC;sBACAC;oBACAC;mBACFC,sBAAA;;mCAGIC,CAAAA,MAAAA,CAAAA,IAAAA,yCAAAA,EAAAA,UAAAA;;eAEFR,KACA;;yBAAwB;;mCAEMS,CAAAA,MAAAA,CAAAA,MAAaN,IAAA,EAAA;yBAAO;;kBACZM,qBAAAA,CAAAA,MAAa,CAAAT,MAAAI,QAAA,EAAA;yBAAO;;gBACtBK,qBAAAA,CAAAA,QAAa,CAAAT,MAAAK,MAAA,EAAA;yBAAO;;oCACtBK,CAAAA,QAAAA,CAAAA,MAAcJ,KAAA,EAAA;0BAAEK;4BAAmB;;yBAAsBJ,sBAAA;;QAE/FT;IACA"}
1
+ {"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { Badge, getIntrinsicElementProps, slot, useId } from '@fluentui/react-components';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLButtonElement>,\n): PromptStarterState => {\n const designVersion = useDesignVersion(props.designVersion);\n const idPrefix = useId('prompt-starter');\n\n return {\n components: {\n root: 'button',\n icon: 'span',\n category: 'span',\n prompt: 'span',\n badge: Badge,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n 'aria-labelledby': `${idPrefix}-category`,\n 'aria-describedby': `${idPrefix}-prompt`,\n ...props,\n }),\n { elementType: 'button' },\n ),\n icon: slot.always(props.icon, { elementType: 'span' }),\n category: slot.always(props.category, { defaultProps: { id: `${idPrefix}-category` }, elementType: 'span' }),\n prompt: slot.optional(props.prompt, { defaultProps: { id: `${idPrefix}-prompt` }, elementType: 'span' }),\n badge: slot.optional(props.badge, { defaultProps: { appearance: 'tint' }, elementType: Badge }),\n designVersion,\n };\n};\n"],"names":["designVersion","useDesignVersion","useId","props","idPrefix","components","root","icon","category","prompt","badge","Badge","ref","elementType","defaultProps","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBQA;;;eAAAA;;;+BAjByB;iCAC4B;AAgB3D,MAAMA,4BAAgBC,CAAAA,OAAuBD;UAC7CA,gBAAiBE,IAAAA,+BAAM,EAAAC,MAAAH,aAAA;UAEvBI,WAAOF,IAAAA,sBAAA,EAAA;WACLG;oBACEC;kBACAC;kBACAC;sBACAC;oBACAC;mBACFC,sBAAA;;mCAGIC,CAAAA,MAAAA,CAAAA,IAAAA,yCAAAA,EAAAA,UAAAA;;+BAEA,CAAA,EAAAR,SAAuBA,SAAS,CAAA;gCACxB,CAAA,EAAAA,SAAA,OAAA,CAAA;eACVD,KACA;;yBAAwB;;mCAEMU,CAAAA,MAAAA,CAAAA,MAAaN,IAAA,EAAA;yBAAO;;kBACZO,qBAAAA,CAAAA,MAAAA,CAAcX,MAAAK,QAAA,EAAA;0BAAM;oBAAuB,CAAA,EAAAJ,SAAA,SAAA,CAAA;;yBAAuB;;gBACpEU,qBAAAA,CAAAA,QAAAA,CAAcX,MAAAM,MAAA,EAAA;0BAAM;oBAAqB,CAAA,EAAAL,SAAA,OAAA,CAAA;;yBAAuB;;oCAClEU,CAAAA,QAAAA,CAAAA,MAAcJ,KAAA,EAAA;0BAAEK;4BAAmB;;yBAAsBJ,sBAAA;;QAE/FX;IACA"}
@@ -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,7 @@
1
+ /**
2
+ * State used in rendering PromptStarter
3
+ */ "use strict";
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ //# sourceMappingURL=PromptStarter.types.js.map
@@ -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"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "usePromptStarter_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return usePromptStarter_unstable;
9
+ }
10
+ });
11
+ const _reactcomponents = require("@fluentui/react-components");
12
+ const _PromptStarterListContext = require("../../../contexts/PromptStarterListContext");
13
+ const usePromptStarter_unstable = (props, ref)=>{
14
+ const id = (0, _reactcomponents.useId)('prompt-starter');
15
+ const focusAttrs = (0, _reactcomponents.useFocusableGroup)();
16
+ const numberOfColumns = (0, _PromptStarterListContext.usePromptStarterListContext)((ctx)=>ctx.numberOfColumns);
17
+ const state = {
18
+ isSingleColumn: numberOfColumns === 1,
19
+ components: {
20
+ root: 'div',
21
+ primaryAction: 'button',
22
+ icon: 'span',
23
+ prompt: 'span',
24
+ reasonMarker: 'span',
25
+ actions: 'span'
26
+ },
27
+ root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
28
+ ref,
29
+ 'aria-labelledby': `${id}-prompt`,
30
+ 'aria-describedby': `${id}-icon, ${id}-reasonMarker`,
31
+ ...focusAttrs,
32
+ ...props
33
+ }), {
34
+ elementType: 'div'
35
+ }),
36
+ primaryAction: _reactcomponents.slot.always(props.primaryAction, {
37
+ elementType: 'button'
38
+ }),
39
+ icon: _reactcomponents.slot.always(props.icon, {
40
+ defaultProps: {
41
+ id: `${id}-icon`
42
+ },
43
+ elementType: 'span'
44
+ }),
45
+ prompt: _reactcomponents.slot.always(props.prompt, {
46
+ defaultProps: {
47
+ id: `${id}-prompt`
48
+ },
49
+ elementType: 'span'
50
+ }),
51
+ reasonMarker: _reactcomponents.slot.optional(props.reasonMarker, {
52
+ defaultProps: {
53
+ id: `${id}-reasonMarker`
54
+ },
55
+ elementType: 'span'
56
+ }),
57
+ actions: _reactcomponents.slot.optional(props.actions, {
58
+ elementType: 'span'
59
+ })
60
+ };
61
+ return state;
62
+ }; //# sourceMappingURL=usePromptStarter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["usePromptStarter.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useFocusableGroup, useId } from '@fluentui/react-components';\nimport { usePromptStarterListContext } from '../../../contexts/PromptStarterListContext';\nimport type { PromptStarterProps, PromptStarterState } from './PromptStarter.types';\n\n/**\n * Create the state required to render PromptStarter.\n *\n * The returned state can be modified with hooks such as usePromptStarterStyles_unstable,\n * before being passed to renderPromptStarter_unstable.\n *\n * @param props - props from this instance of PromptStarter\n * @param ref - reference to root HTMLElement of PromptStarter\n */\nexport const usePromptStarter_unstable = (\n props: PromptStarterProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterState => {\n const id = useId('prompt-starter');\n const focusAttrs = useFocusableGroup();\n\n const numberOfColumns = usePromptStarterListContext(ctx => ctx.numberOfColumns);\n\n const state: PromptStarterState = {\n isSingleColumn: numberOfColumns === 1,\n components: {\n root: 'div',\n primaryAction: 'button',\n icon: 'span',\n prompt: 'span',\n reasonMarker: 'span',\n actions: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n 'aria-labelledby': `${id}-prompt`,\n 'aria-describedby': `${id}-icon, ${id}-reasonMarker`,\n ...focusAttrs,\n ...props,\n }),\n { elementType: 'div' },\n ),\n primaryAction: slot.always(props.primaryAction, {\n elementType: 'button',\n }),\n icon: slot.always(props.icon, {\n defaultProps: { id: `${id}-icon` },\n elementType: 'span',\n }),\n prompt: slot.always(props.prompt, {\n defaultProps: { id: `${id}-prompt` },\n elementType: 'span',\n }),\n reasonMarker: slot.optional(props.reasonMarker, {\n defaultProps: { id: `${id}-reasonMarker` },\n elementType: 'span',\n }),\n actions: slot.optional(props.actions, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["id","props","ref","focusAttrs","numberOfColumns","usePromptStarterListContext","ctx","isSingleColumn","root","primaryAction","prompt","reasonMarker","actions","elementType","defaultProps","icon","state"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBQA;;;eAAAA;;;iCAjBiE;0CAC7B;AAgB1C,MAAMA,4BAAW,CAAAC,OAAAC;UACjBF,KAAMG,IAAAA,sBAAAA,EAAAA;UAENA,aAAMC,IAAAA,kCAAkBC;UAExBD,kBAAkCC,IAAAA,qDAAA,EAAAC,CAAAA,MAAAA,IAAAF,eAAA;UAChCG,QAAAA;wBACYH,oBAAA;oBACVI;kBACAC;2BACM;kBACNC;oBACAC;0BACAC;qBACF;;mCAGIV,CAAAA,MAAAA,CAAAA,IAAAA,yCAAAA,EAAAA,OAAAA;;+BAEA,CAAA,EAAAF,GAAA,OAA0B,CAAA;gCACb,CAAA,EAAAA,GAAA,OAAA,EAAAA,GAAA,aAAA,CAAA;yBACVC;eACLA,KACA;;yBAAqB;;uBAGrBY,qBAAAA,CAAAA,MAAa,CAAAZ,MAAAQ,aAAA,EAAA;yBACf;;mCAEEK,CAAAA,MAAAA,CAAAA,MAAcC,IAAA,EAAA;0BAAM;oBAAa,CAAA,EAAAf,GAAA,KAAA,CAAA;;yBAEnC;;gBAEEc,qBAAAA,CAAAA,MAAAA,CAAAA,MAAcJ,MAAA,EAAA;0BAAM;oBAAe,CAAA,EAAAV,GAAA,OAAA,CAAA;;yBAErC;;sBAEEc,qBAAAA,CAAAA,QAAc,CAAAb,MAAAU,YAAA,EAAA;0BAAM;oBAAqB,CAAA,EAAAX,GAAA,aAAA,CAAA;;yBAE3C;;iBACwCa,qBAAAA,CAAAA,QAAa,CAAAZ,MAAAW,OAAA,EAAA;yBAAO;QAC9D;;IAGA,OAAAI"}