@fluentui-copilot/react-prompt-listbox 0.9.0 → 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 (102) hide show
  1. package/CHANGELOG.json +15 -0
  2. package/CHANGELOG.md +10 -1
  3. package/dist/index.d.ts +0 -252
  4. package/lib/components/utils/useListboxPositioning.js.map +1 -1
  5. package/lib/index.js +0 -3
  6. package/lib/index.js.map +1 -1
  7. package/lib-commonjs/components/utils/useListboxPositioning.js.map +1 -1
  8. package/lib-commonjs/index.js +0 -36
  9. package/lib-commonjs/index.js.map +1 -1
  10. package/package.json +6 -6
  11. package/lib/PromptListbox.js +0 -2
  12. package/lib/PromptListbox.js.map +0 -1
  13. package/lib/PromptOption.js +0 -2
  14. package/lib/PromptOption.js.map +0 -1
  15. package/lib/components/PromptListbox/PromptListbox.js +0 -14
  16. package/lib/components/PromptListbox/PromptListbox.js.map +0 -1
  17. package/lib/components/PromptListbox/PromptListbox.types.js +0 -2
  18. package/lib/components/PromptListbox/PromptListbox.types.js.map +0 -1
  19. package/lib/components/PromptListbox/index.js +0 -5
  20. package/lib/components/PromptListbox/index.js.map +0 -1
  21. package/lib/components/PromptListbox/renderPromptListbox.js +0 -26
  22. package/lib/components/PromptListbox/renderPromptListbox.js.map +0 -1
  23. package/lib/components/PromptListbox/usePromptListbox.js +0 -82
  24. package/lib/components/PromptListbox/usePromptListbox.js.map +0 -1
  25. package/lib/components/PromptListbox/usePromptListboxContextValues.js +0 -33
  26. package/lib/components/PromptListbox/usePromptListboxContextValues.js.map +0 -1
  27. package/lib/components/PromptListbox/usePromptListboxStyles.styles.js +0 -41
  28. package/lib/components/PromptListbox/usePromptListboxStyles.styles.js.map +0 -1
  29. package/lib/components/PromptOption/PromptOption.js +0 -12
  30. package/lib/components/PromptOption/PromptOption.js.map +0 -1
  31. package/lib/components/PromptOption/PromptOption.types.js +0 -4
  32. package/lib/components/PromptOption/PromptOption.types.js.map +0 -1
  33. package/lib/components/PromptOption/index.js +0 -5
  34. package/lib/components/PromptOption/index.js.map +0 -1
  35. package/lib/components/PromptOption/renderPromptOption.js +0 -10
  36. package/lib/components/PromptOption/renderPromptOption.js.map +0 -1
  37. package/lib/components/PromptOption/usePromptOption.js +0 -101
  38. package/lib/components/PromptOption/usePromptOption.js.map +0 -1
  39. package/lib/components/PromptOption/usePromptOptionStyles.styles.js +0 -98
  40. package/lib/components/PromptOption/usePromptOptionStyles.styles.js.map +0 -1
  41. package/lib/components/utils/OptionCollection.types.js +0 -3
  42. package/lib/components/utils/OptionCollection.types.js.map +0 -1
  43. package/lib/components/utils/PromptListboxFunctionality.types.js +0 -2
  44. package/lib/components/utils/PromptListboxFunctionality.types.js.map +0 -1
  45. package/lib/components/utils/Selection.types.js +0 -3
  46. package/lib/components/utils/Selection.types.js.map +0 -1
  47. package/lib/components/utils/dropdownKeyActions.js +0 -68
  48. package/lib/components/utils/dropdownKeyActions.js.map +0 -1
  49. package/lib/components/utils/useOptionCollection.js +0 -39
  50. package/lib/components/utils/useOptionCollection.js.map +0 -1
  51. package/lib/components/utils/usePromptListboxFunctionality.js +0 -143
  52. package/lib/components/utils/usePromptListboxFunctionality.js.map +0 -1
  53. package/lib/components/utils/useSelection.js +0 -54
  54. package/lib/components/utils/useSelection.js.map +0 -1
  55. package/lib/components/utils/useTriggerKeyDown.js +0 -149
  56. package/lib/components/utils/useTriggerKeyDown.js.map +0 -1
  57. package/lib-commonjs/PromptListbox.js +0 -29
  58. package/lib-commonjs/PromptListbox.js.map +0 -1
  59. package/lib-commonjs/PromptOption.js +0 -29
  60. package/lib-commonjs/PromptOption.js.map +0 -1
  61. package/lib-commonjs/components/PromptListbox/PromptListbox.js +0 -23
  62. package/lib-commonjs/components/PromptListbox/PromptListbox.js.map +0 -1
  63. package/lib-commonjs/components/PromptListbox/PromptListbox.types.js +0 -5
  64. package/lib-commonjs/components/PromptListbox/PromptListbox.types.js.map +0 -1
  65. package/lib-commonjs/components/PromptListbox/index.js +0 -32
  66. package/lib-commonjs/components/PromptListbox/index.js.map +0 -1
  67. package/lib-commonjs/components/PromptListbox/renderPromptListbox.js +0 -30
  68. package/lib-commonjs/components/PromptListbox/renderPromptListbox.js.map +0 -1
  69. package/lib-commonjs/components/PromptListbox/usePromptListbox.js +0 -69
  70. package/lib-commonjs/components/PromptListbox/usePromptListbox.js.map +0 -1
  71. package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js +0 -36
  72. package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js.map +0 -1
  73. package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.js +0 -62
  74. package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.js.map +0 -1
  75. package/lib-commonjs/components/PromptOption/PromptOption.js +0 -21
  76. package/lib-commonjs/components/PromptOption/PromptOption.js.map +0 -1
  77. package/lib-commonjs/components/PromptOption/PromptOption.types.js +0 -7
  78. package/lib-commonjs/components/PromptOption/PromptOption.types.js.map +0 -1
  79. package/lib-commonjs/components/PromptOption/index.js +0 -32
  80. package/lib-commonjs/components/PromptOption/index.js.map +0 -1
  81. package/lib-commonjs/components/PromptOption/renderPromptOption.js +0 -16
  82. package/lib-commonjs/components/PromptOption/renderPromptOption.js.map +0 -1
  83. package/lib-commonjs/components/PromptOption/usePromptOption.js +0 -103
  84. package/lib-commonjs/components/PromptOption/usePromptOption.js.map +0 -1
  85. package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js +0 -188
  86. package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js.map +0 -1
  87. package/lib-commonjs/components/utils/OptionCollection.types.js +0 -6
  88. package/lib-commonjs/components/utils/OptionCollection.types.js.map +0 -1
  89. package/lib-commonjs/components/utils/PromptListboxFunctionality.types.js +0 -5
  90. package/lib-commonjs/components/utils/PromptListboxFunctionality.types.js.map +0 -1
  91. package/lib-commonjs/components/utils/Selection.types.js +0 -6
  92. package/lib-commonjs/components/utils/Selection.types.js.map +0 -1
  93. package/lib-commonjs/components/utils/dropdownKeyActions.js +0 -66
  94. package/lib-commonjs/components/utils/dropdownKeyActions.js.map +0 -1
  95. package/lib-commonjs/components/utils/useOptionCollection.js +0 -46
  96. package/lib-commonjs/components/utils/useOptionCollection.js.map +0 -1
  97. package/lib-commonjs/components/utils/usePromptListboxFunctionality.js +0 -150
  98. package/lib-commonjs/components/utils/usePromptListboxFunctionality.js.map +0 -1
  99. package/lib-commonjs/components/utils/useSelection.js +0 -72
  100. package/lib-commonjs/components/utils/useSelection.js.map +0 -1
  101. package/lib-commonjs/components/utils/useTriggerKeyDown.js +0 -151
  102. package/lib-commonjs/components/utils/useTriggerKeyDown.js.map +0 -1
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "usePromptListbox_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return usePromptListbox_unstable;
9
- }
10
- });
11
- const _reactcomponents = require("@fluentui/react-components");
12
- const _reactutilities = require("@fluentui/react-utilities");
13
- const usePromptListbox_unstable = (props, ref)=>{
14
- const { id, onActiveOptionChange, inlinePopup = false, mountNode = undefined, open = true, activeDescendantController, getOptionById, getOptionsMatchingValue, selectedOptions, selectOption, registerOption } = props;
15
- const listboxId = (0, _reactutilities.useId)('prompt-listbox', id);
16
- const onActiveDescendantChange = (0, _reactutilities.useEventCallback)((event)=>{
17
- const previousOption = event.detail.previousId ? getOptionById(event.detail.previousId) : null;
18
- const nextOption = getOptionById(event.detail.id);
19
- onActiveOptionChange === null || onActiveOptionChange === void 0 ? void 0 : onActiveOptionChange(event, {
20
- event,
21
- type: 'change',
22
- previousOption,
23
- nextOption
24
- });
25
- });
26
- const state = {
27
- ...deprecatedPropsDefaults,
28
- open,
29
- getOptionById,
30
- getOptionsMatchingValue,
31
- selectedOptions,
32
- selectOption,
33
- registerOption,
34
- onActiveDescendantChange,
35
- activeDescendantController,
36
- inlinePopup,
37
- mountNode,
38
- components: {
39
- root: _reactcomponents.Listbox
40
- },
41
- root: _reactcomponents.slot.always({
42
- ...props,
43
- selectedOptions
44
- }, {
45
- defaultProps: {
46
- disableAutoFocus: true,
47
- id: listboxId,
48
- tabIndex: undefined,
49
- role: 'listbox'
50
- },
51
- elementType: _reactcomponents.Listbox
52
- })
53
- };
54
- state.root.ref = (0, _reactcomponents.useMergedRefs)(ref, state.root.ref);
55
- state.root.onMouseDown = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((event)=>{
56
- event.preventDefault();
57
- }, state.root.onMouseDown));
58
- state.root.onClick = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((event)=>{
59
- event.preventDefault();
60
- }, state.root.onClick));
61
- return state;
62
- };
63
- const noop = ()=>null;
64
- const deprecatedPropsDefaults = {
65
- activeOption: undefined,
66
- focusVisible: false,
67
- setActiveOption: noop,
68
- onOptionClick: noop
69
- }; //# sourceMappingURL=usePromptListbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["usePromptListbox.ts"],"sourcesContent":["import type * as React from 'react';\nimport { Listbox, slot, useMergedRefs } from '@fluentui/react-components';\nimport { mergeCallbacks, useEventCallback, useId } from '@fluentui/react-utilities';\nimport type { PromptListboxProps, PromptListboxState } from './PromptListbox.types';\nimport type { PromptListboxContextState } from './usePromptListboxContextValues';\nimport type { ActiveDescendantChangeEvent } from '@fluentui/react-aria';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PromptListbox.\n *\n * The returned state can be modified with hooks such as usePromptListboxStyles_unstable,\n * before being passed to renderPromptListbox_unstable.\n *\n * @param props - props from this instance of PromptListbox\n * @param ref - reference to root HTMLElement of PromptListbox\n */\nexport const usePromptListbox_unstable = (\n props: PromptListboxProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptListboxState => {\n const {\n id,\n onActiveOptionChange,\n inlinePopup = false,\n mountNode = undefined,\n open = true,\n activeDescendantController,\n getOptionById,\n getOptionsMatchingValue,\n selectedOptions,\n selectOption,\n registerOption,\n } = props;\n const listboxId = useId('prompt-listbox', id);\n\n const onActiveDescendantChange = useEventCallback((event: ActiveDescendantChangeEvent) => {\n const previousOption = event.detail.previousId ? getOptionById(event.detail.previousId) : null;\n const nextOption = getOptionById(event.detail.id);\n onActiveOptionChange?.(event, { event, type: 'change', previousOption, nextOption });\n });\n\n const state: PromptListboxState = {\n ...deprecatedPropsDefaults,\n open,\n getOptionById,\n getOptionsMatchingValue,\n selectedOptions,\n selectOption,\n registerOption,\n onActiveDescendantChange,\n activeDescendantController,\n inlinePopup,\n mountNode,\n\n components: {\n root: Listbox,\n },\n\n root: slot.always(\n { ...props, selectedOptions },\n {\n defaultProps: {\n disableAutoFocus: true,\n id: listboxId,\n tabIndex: undefined,\n role: 'listbox',\n },\n elementType: Listbox,\n },\n ),\n };\n\n state.root.ref = useMergedRefs(ref, state.root.ref);\n state.root.onMouseDown = useEventCallback(\n mergeCallbacks((event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n }, state.root.onMouseDown),\n );\n\n state.root.onClick = useEventCallback(\n mergeCallbacks((event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n }, state.root.onClick),\n );\n\n return state;\n};\n\nconst noop = () => null;\n\nconst deprecatedPropsDefaults: Pick<\n PromptListboxContextState,\n 'activeOption' | 'focusVisible' | 'setActiveOption' | 'onOptionClick'\n> = {\n activeOption: undefined,\n focusVisible: false,\n setActiveOption: noop,\n onOptionClick: noop,\n};\n"],"names":["id","inlinePopup","previousOption","nextOption","onActiveOptionChange","event","selectOption","registerOption","open","getOptionById","getOptionsMatchingValue","selectedOptions","onActiveDescendantChange","root","elementType","Listbox","state","ref","useMergedRefs","onClick","preventDefault","tabIndex","role","noop","deprecatedPropsDefaults","activeOption","setActiveOption","onOptionClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBIA;;;eAAAA;;;iCAtByC;gCACW;AAoBtD,MACEA,4BAEAC,CAAAA,OAAAA;UAUF,EAEAD,EAAA,sBACQE,gBACAC,KAAAA,cACNC,SAAAA,aAAgCC,4BAAa,eAAUH,yBAAgBC,iBAAW,EACpFG,YAAA,EAEAC,cAAkC;UAEhCC,YAAAA,IAAAA,qBAAAA,EAAAA,kBAAAA;UACAC,2BAAAA,IAAAA,gCAAAA,EAAAA,CAAAA;cACAC,iBAAAA,MAAAA,MAAAA,CAAAA,UAAAA,GAAAA,cAAAA,MAAAA,MAAAA,CAAAA,UAAAA,IAAAA;cACAC,aAAAA,cAAAA,MAAAA,MAAAA,CAAAA,EAAAA;iCACAL,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,OAAAA;;kBAEAM;;;;;kBAMEC;kCACF;;;;;;;;;;;oBAWIC;kBACFC,wBAAA;QAEJ;QAEAC,MAAMH,qBAAI,CAACI,MAAMC,CAAAA;YACjBF,GAAAA,KAAU;;QAGR,GAAGA;YAGLA,cAAWG;gBAEPd,kBAAMe;gBACLJ,IAAAA;gBAGLK,UAAOL;gBACPM,MAAA;YAEIC;YAEAC,aAAAA,wBAAAA;QAIJC;;UAEAC,IAAAA,CAAAA,GAAAA,GAAAA,IAAAA,8BAAiBH,EAAAA,KAAAA,MAAAA,IAAAA,CAAAA,GAAAA;UACjBI,IAAAA,CAAAA,WAAeJ,GAAAA,IAAAA,gCAAAA,EAAAA,IAAAA,8BAAAA,EAAAA,CAAAA;QACjBlB,MAAAe,cAAA"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "usePromptListboxContextValues", {
6
- enumerable: true,
7
- get: function() {
8
- return usePromptListboxContextValues;
9
- }
10
- });
11
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- function usePromptListboxContextValues(state) {
14
- const { getOptionById, getOptionsMatchingValue, registerOption, selectedOptions, selectOption, activeDescendantController, onOptionClick, onActiveDescendantChange } = state;
15
- const activeDescendant = _react.useMemo(()=>({
16
- controller: activeDescendantController
17
- }), [
18
- activeDescendantController
19
- ]);
20
- const listbox = {
21
- activeOption: undefined,
22
- focusVisible: false,
23
- getOptionById,
24
- getOptionsMatchingValue,
25
- registerOption,
26
- selectedOptions,
27
- selectOption,
28
- setActiveOption: ()=>null,
29
- onOptionClick,
30
- onActiveDescendantChange
31
- };
32
- return {
33
- activeDescendant,
34
- listbox
35
- };
36
- } //# sourceMappingURL=usePromptListboxContextValues.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["usePromptListboxContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComboboxBaseState, ComboboxState, ListboxContextValue } from '@fluentui/react-combobox';\nimport type { PromptListboxContextValues } from './PromptListbox.types';\n\nexport type PromptListboxContextState = Pick<ComboboxBaseState, keyof ListboxContextValue> &\n Pick<ComboboxState, 'activeDescendantController'>;\n\nexport function usePromptListboxContextValues(state: PromptListboxContextState): PromptListboxContextValues {\n const {\n getOptionById,\n getOptionsMatchingValue,\n registerOption,\n selectedOptions,\n selectOption,\n activeDescendantController,\n onOptionClick,\n onActiveDescendantChange,\n } = state;\n\n const activeDescendant = React.useMemo(\n () => ({\n controller: activeDescendantController,\n }),\n [activeDescendantController],\n );\n\n const listbox = {\n activeOption: undefined,\n focusVisible: false,\n getOptionById,\n getOptionsMatchingValue,\n registerOption,\n selectedOptions,\n selectOption,\n setActiveOption: () => null,\n onOptionClick,\n onActiveDescendantChange,\n };\n\n return {\n activeDescendant,\n listbox,\n };\n}\n"],"names":["usePromptListboxContextValues","state","getOptionById","activeDescendant","activeDescendantController","activeOption","getOptionsMatchingValue","registerOption","selectedOptions","selectOption","setActiveOption","onOptionClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOgBA;;;eAAAA;;;;iEAPO;AAOhB,SAASA,8BAA8BC,KAAgC;UAC5E,EAWAC,aAAMC,yBAEUC,gBAEd,iBAACA,cAA2B,EAG9BA,0BAAgB,eACdC,0BACc;UAEdC,mBAAAA,OAAAA,OAAAA,CAAAA,IAAAA,CAAAA;wBACAC;;;KACAC;UACAC,UAAAA;sBACAC;sBACAC;;QAEFL;QAEAC;;;QAGAG,iBAAA,IAAA;QACFC"}
@@ -1,62 +0,0 @@
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
- promptListboxClassNames: function() {
13
- return promptListboxClassNames;
14
- },
15
- usePromptListboxStyles_unstable: function() {
16
- return usePromptListboxStyles_unstable;
17
- }
18
- });
19
- const _reactcomponents = require("@fluentui/react-components");
20
- const promptListboxClassNames = {
21
- root: 'fai-PromptListbox'
22
- };
23
- /**
24
- * Styles for the root slot
25
- */ const useStyles = (0, _reactcomponents.__styles)({
26
- listbox: {
27
- E5pizo: "f1hg901r",
28
- Beyfa6y: 0,
29
- Bbmb7ep: 0,
30
- Btl43ni: 0,
31
- B7oj6ja: 0,
32
- Dimara: "ft85np5",
33
- Bxyxcbc: "fmmk62d",
34
- B7ck84d: "f1ewtqcl"
35
- },
36
- listboxCollapsed: {
37
- mc9l5x: "fjseox"
38
- },
39
- inlineListbox: {
40
- Bj3rh1h: "f19g0ac"
41
- }
42
- }, {
43
- d: [
44
- ".f1hg901r{box-shadow:var(--shadow16);}",
45
- [
46
- ".ft85np5{border-radius:var(--borderRadiusMedium);}",
47
- {
48
- p: -1
49
- }
50
- ],
51
- ".fmmk62d{max-height:80vh;}",
52
- ".f1ewtqcl{box-sizing:border-box;}",
53
- ".fjseox{display:none;}",
54
- ".f19g0ac{z-index:1;}"
55
- ]
56
- });
57
- const usePromptListboxStyles_unstable = (state)=>{
58
- 'use no memo';
59
- const styles = useStyles();
60
- state.root.className = (0, _reactcomponents.mergeClasses)(promptListboxClassNames.root, styles.listbox, state.inlinePopup && styles.inlineListbox, !state.open && styles.listboxCollapsed, state.root.className);
61
- return state;
62
- }; //# sourceMappingURL=usePromptListboxStyles.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["usePromptListboxStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptListboxSlots, PromptListboxState } from './PromptListbox.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptListboxClassNames: SlotClassNames<PromptListboxSlots> = {\n root: 'fai-PromptListbox',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n listbox: {\n boxShadow: tokens.shadow16,\n borderRadius: tokens.borderRadiusMedium,\n maxHeight: '80vh',\n boxSizing: 'border-box',\n },\n\n listboxCollapsed: {\n display: 'none',\n },\n\n // When rendering inline, the popupSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n inlineListbox: {\n zIndex: 1,\n },\n});\n\n/**\n * Apply styling to the PromptListbox slots based on the state\n */\nexport const usePromptListboxStyles_unstable = (state: PromptListboxState): PromptListboxState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(\n promptListboxClassNames.root,\n styles.listbox,\n state.inlinePopup && styles.inlineListbox,\n !state.open && styles.listboxCollapsed,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["promptListboxClassNames","root","listbox","__styles","boxShadow","borderRadius","maxHeight","boxSizing","Btl43ni","listboxCollapsed","display","Bxyxcbc","B7ck84d","zIndex","inlineListbox","Bj3rh1h","p","state","mergeClasses","styles","inlinePopup"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,uBAAAA;eAAAA;;;;;;iCALoB;AAK1B,MAAMA,0BAA8D;UACzEC;AACF;AAEA;;CAEC,SAECC,YAASC,IAAAA,yBAAA,EAAA;aACPC;gBACAC;iBACAC;iBACAC;QACFC,SAAA;QAEAC,SAAAA;gBACEC;QACFC,SAAA;QAEAC,SAAA;;sBAEe;gBACbC;;IAEJC,eAAA;QAEAC,SAAA;;GAEC;OAEC;QAAA;QAAA;YAAA;YAAA;gBAEAC,GAAA,CAAA;;SACAC;QAAAA;QAAuBC;QAErBC;QACMC;KAAsBN"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "PromptOption", {
6
- enumerable: true,
7
- get: function() {
8
- return PromptOption;
9
- }
10
- });
11
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- const _usePromptOption = require("./usePromptOption");
14
- const _renderPromptOption = require("./renderPromptOption");
15
- const _usePromptOptionStylesstyles = require("./usePromptOptionStyles.styles");
16
- const PromptOption = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
- const state = (0, _usePromptOption.usePromptOption_unstable)(props, ref);
18
- (0, _usePromptOptionStylesstyles.usePromptOptionStyles_unstable)(state);
19
- return (0, _renderPromptOption.renderPromptOption_unstable)(state);
20
- });
21
- PromptOption.displayName = 'PromptOption'; //# sourceMappingURL=PromptOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["PromptOption.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptOption_unstable } from './usePromptOption';\nimport { renderPromptOption_unstable } from './renderPromptOption';\nimport { usePromptOptionStyles_unstable } from './usePromptOptionStyles.styles';\nimport type { PromptOptionProps } from './PromptOption.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n/**@deprecated - use Option instead */\nexport const PromptOption: ForwardRefComponent<PromptOptionProps> = React.forwardRef((props, ref) => {\n const state = usePromptOption_unstable(props, ref);\n\n usePromptOptionStyles_unstable(state);\n return renderPromptOption_unstable(state);\n});\n\nPromptOption.displayName = 'PromptOption';\n"],"names":["state","usePromptOption_unstable","props","ref","usePromptOptionStyles_unstable","renderPromptOption_unstable","PromptOption"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASQA;;;eAAAA;;;;iEATe;iCACkB;oCACG;6CACG;AAM7C,MAAMA,eAAQC,WAAAA,GAAAA,OAAyBC,UAAOC,CAAAA,CAAAA,OAAAA;UAE9CC,QAAAA,IAAAA,yCAA+BJ,EAAAA,OAAAA;mEACxBK,EAAAA;IACT,OAAGA,IAAAA,+CAAA,EAAAL;AAEHM"}
@@ -1,7 +0,0 @@
1
- /**
2
- * State used in rendering PromptOption
3
- */ "use strict";
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- //# sourceMappingURL=PromptOption.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["PromptOption.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, OptionProps, OptionState, Slot } from '@fluentui/react-components';\n\nexport type PromptOptionSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * PromptOption Props\n */\nexport type PromptOptionProps = ComponentProps<PromptOptionSlots> &\n Pick<OptionProps, 'disabled' | 'value'> &\n (\n | {\n /**\n * An optional override the string value of the PromptOption's display text,\n * defaulting to the PromptOption's child content.\n * This is used as the PromptInput button's or PromptInput input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text?: string;\n children: string;\n }\n | {\n /**\n * The string value of the PromptOption's display text when the PromptOption's children are not a string.\n * This is used as the PromptInput button's or PromptInput input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text: string;\n children?: React.ReactNode;\n }\n );\n\n/**\n * State used in rendering PromptOption\n */\nexport type PromptOptionState = ComponentState<PromptOptionSlots> & Pick<OptionState, 'disabled' | 'selected'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAiCA;;CAEC"}
@@ -1,32 +0,0 @@
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
- PromptOption: function() {
13
- return _PromptOption.PromptOption;
14
- },
15
- promptOptionClassNames: function() {
16
- return _usePromptOptionStylesstyles.promptOptionClassNames;
17
- },
18
- renderPromptOption_unstable: function() {
19
- return _renderPromptOption.renderPromptOption_unstable;
20
- },
21
- usePromptOptionStyles_unstable: function() {
22
- return _usePromptOptionStylesstyles.usePromptOptionStyles_unstable;
23
- },
24
- usePromptOption_unstable: function() {
25
- return _usePromptOption.usePromptOption_unstable;
26
- }
27
- });
28
- const _PromptOption = require("./PromptOption");
29
- const _renderPromptOption = require("./renderPromptOption");
30
- const _usePromptOption = require("./usePromptOption");
31
- const _usePromptOptionStylesstyles = require("./usePromptOptionStyles.styles");
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptOption } from './PromptOption';\nexport type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './PromptOption.types';\nexport { renderPromptOption_unstable } from './renderPromptOption';\nexport { usePromptOption_unstable } from './usePromptOption';\nexport { promptOptionClassNames, usePromptOptionStyles_unstable } from './usePromptOptionStyles.styles';\n"],"names":["PromptOption","promptOptionClassNames","renderPromptOption_unstable","usePromptOptionStyles_unstable","usePromptOption_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,YAAY;eAAZA,0BAAY;;IAIZC,sBAAsB;eAAtBA,mDAAsB;;IAFtBC,2BAA2B;eAA3BA,+CAA2B;;IAEHC,8BAA8B;eAA9BA,2DAA8B;;IADtDC,wBAAwB;eAAxBA,yCAAwB;;;8BAHJ;oCAEe;iCACH;6CAC8B"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "renderPromptOption_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return renderPromptOption_unstable;
9
- }
10
- });
11
- const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
- const _reactcomponents = require("@fluentui/react-components");
13
- const renderPromptOption_unstable = (state)=>{
14
- (0, _reactcomponents.assertSlots)(state);
15
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
16
- }; //# sourceMappingURL=renderPromptOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["renderPromptOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PromptOptionSlots, PromptOptionState } from './PromptOption.types';\n\n/**\n * Render the final JSX of PromptOption\n */\nexport const renderPromptOption_unstable = (state: PromptOptionState) => {\n assertSlots<PromptOptionSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","state","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAUEA;;;eAAAA;;;4BAVwB;iCAGE;AAO1BA,MAAAA,8BAA+BC,CAAAA;oCAE/B,EAAAA;IACA,OAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAD,MAAAE,IAAA,EAAA,CAAA"}
@@ -1,103 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "usePromptOption_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return usePromptOption_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 _reactaria = require("@fluentui/react-aria");
15
- const _reactcombobox = require("@fluentui/react-combobox");
16
- const usePromptOption_unstable = (props, ref)=>{
17
- const { controller: activeDescendantController } = (0, _reactaria.useActiveDescendantContext)();
18
- const { children, disabled, text, value } = props;
19
- const optionRef = _react.useRef(null);
20
- const optionText = getTextString(text, children);
21
- const optionValue = value !== null && value !== void 0 ? value : optionText;
22
- // use the id if provided, otherwise use a generated id
23
- const id = (0, _reactcomponents.useId)('fluent-option', props.id);
24
- // data used for context registration & events
25
- const optionData = _react.useMemo(()=>({
26
- id,
27
- disabled,
28
- text: optionText,
29
- value: optionValue
30
- }), [
31
- id,
32
- disabled,
33
- optionText,
34
- optionValue
35
- ]);
36
- // context values
37
- const registerOption = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.registerOption);
38
- const selected = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>{
39
- const selectedOptions = ctx.selectedOptions;
40
- return optionValue !== undefined && selectedOptions.find((o)=>o === optionValue) !== undefined;
41
- });
42
- const selectOption = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.selectOption);
43
- const onOptionClick = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.onOptionClick);
44
- const onClick = (event)=>{
45
- var _props_onClick;
46
- if (disabled) {
47
- event.preventDefault();
48
- return;
49
- }
50
- activeDescendantController.focus(id);
51
- // handle selection change
52
- selectOption(event, optionData);
53
- onOptionClick(event);
54
- (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);
55
- };
56
- // register option data with context
57
- _react.useEffect(()=>{
58
- if (id && optionRef.current) {
59
- return registerOption(optionData, optionRef.current);
60
- }
61
- }, [
62
- id,
63
- optionData,
64
- registerOption
65
- ]);
66
- return {
67
- components: {
68
- root: 'div'
69
- },
70
- root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
71
- ref: (0, _reactcomponents.useMergedRefs)(ref, optionRef),
72
- 'aria-disabled': disabled ? true : undefined,
73
- id,
74
- role: 'option',
75
- ...props,
76
- onClick
77
- }), {
78
- elementType: 'div'
79
- }),
80
- disabled,
81
- selected
82
- };
83
- };
84
- function getTextString(text, children) {
85
- if (text !== undefined) {
86
- return text;
87
- }
88
- let textString = '';
89
- let hasNonStringChild = false;
90
- _react.Children.forEach(children, (child)=>{
91
- if (typeof child === 'string') {
92
- textString += child;
93
- } else {
94
- hasNonStringChild = true;
95
- }
96
- });
97
- // warn if an Option has non-string children and no text prop
98
- if (hasNonStringChild) {
99
- // eslint-disable-next-line no-console
100
- console.warn('Provide a `text` prop to Option components when they contain non-string children.');
101
- }
102
- return textString;
103
- } //# sourceMappingURL=usePromptOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["usePromptOption.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-components';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { useListboxContext_unstable } from '@fluentui/react-combobox';\nimport type { PromptOptionProps, PromptOptionState } from './PromptOption.types';\nimport type { OptionValue } from '../utils/OptionCollection.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PromptOption.\n *\n * The returned state can be modified with hooks such as usePromptOptionStyles_unstable,\n * before being passed to renderPromptOption_unstable.\n *\n * @param props - props from this instance of PromptOption\n * @param ref - reference to root HTMLElement of PromptOption\n */\nexport const usePromptOption_unstable = (\n props: PromptOptionProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptOptionState => {\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const { children, disabled, text, value } = props;\n const optionRef = React.useRef<HTMLDivElement>(null);\n const optionText = getTextString(text, children);\n const optionValue = value ?? optionText;\n\n // use the id if provided, otherwise use a generated id\n const id = useId('fluent-option', props.id);\n\n // data used for context registration & events\n const optionData = React.useMemo<OptionValue>(\n () => ({ id, disabled, text: optionText, value: optionValue }),\n [id, disabled, optionText, optionValue],\n );\n\n // context values\n const registerOption = useListboxContext_unstable(ctx => ctx.registerOption);\n const selected = useListboxContext_unstable(ctx => {\n const selectedOptions = ctx.selectedOptions;\n\n return optionValue !== undefined && selectedOptions.find(o => o === optionValue) !== undefined;\n });\n const selectOption = useListboxContext_unstable(ctx => ctx.selectOption);\n const onOptionClick = useListboxContext_unstable(ctx => ctx.onOptionClick);\n\n const onClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n activeDescendantController.focus(id);\n\n // handle selection change\n selectOption(event, optionData);\n\n onOptionClick(event);\n props.onClick?.(event);\n };\n\n // register option data with context\n React.useEffect(() => {\n if (id && optionRef.current) {\n return registerOption(optionData, optionRef.current);\n }\n }, [id, optionData, registerOption]);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, optionRef),\n 'aria-disabled': disabled ? true : undefined,\n id,\n role: 'option',\n ...props,\n onClick,\n }),\n { elementType: 'div' },\n ),\n disabled,\n selected,\n };\n};\n\nfunction getTextString(text: string | undefined, children: React.ReactNode) {\n if (text !== undefined) {\n return text;\n }\n\n let textString = '';\n let hasNonStringChild = false;\n React.Children.forEach(children, child => {\n if (typeof child === 'string') {\n textString += child;\n } else {\n hasNonStringChild = true;\n }\n });\n\n // warn if an Option has non-string children and no text prop\n if (hasNonStringChild) {\n // eslint-disable-next-line no-console\n console.warn('Provide a `text` prop to Option components when they contain non-string children.');\n }\n\n return textString;\n}\n"],"names":["controller","activeDescendantController","optionRef","useActiveDescendantContext","getTextString","children","disabled","id","text","value","optionText","optionValue","registerOption","selected","useListboxContext_unstable","selectedOptions","find","ctx","selectOption","onOptionClick","undefined","props","preventDefault","event","optionData","React","onClick","_props_onClick","call","useEffect","current","components","slot","always","getIntrinsicElementProps","root","ref","useMergedRefs","role","textString","hasNonStringChild","child","Children","forEach","warn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBUA;;;eAAAA;;;;iEAtBa;iCAC8C;2BAC1B;+BACA;AAmBzC,MAAQA,2BAAYC,CAAAA,OAAAA;UACpB,EACAD,YAAME,0BAAyC,KAC/CC,IAAAA,qCAAmBC;UACnB,EAEAC,QAAA,EACAC,QAAMC,EAENC,IAAA,EACAC,KAAA;sBACeH,OAAAA,MAAAA,CAAAA;uBAAgBI,cAAAA,MAAAA;wBAAmBC,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,QAAAA;2DAChD;UAACJ,KAAAA,IAAAA,sBAAAA,EAAAA,iBAAAA,MAAAA,EAAAA;kDAAID;UAAUI,aAAAA,OAAAA,OAAAA,CAAAA,IAAAA,CAAAA;;;YAGjBF,MAAAE;YACAD,OAAMG;YACN;QAAAL;QAAMM;QAAWC;QAAAA;KAAAA;qBACTC;UAENH,iBAAOD,IAAAA,yCAA6BI,EAAAA,CAAAA,MAAAA,IAAgBC,cAAgBL;UACtEE,WAAAC,IAAAA,yCAAA,EAAAG,CAAAA;QACA,MAAMC,kBAAeJ,IAAAA,eAAAA;QACrB,OAAMK,gBAAgBL,aAAAA,gBAA2BG,IAAOA,CAAAA,CAAAA,IAAIE,MAAAA,iBAAaC;;yBAcvEC,IAAAA,yCAAAA,EAAAA,CAAAA,MAAAA,IAAAA,YAAAA;UAXAF,gBAAcL,IAAAA,yCAAA,EAAAG,CAAAA,MAAAA,IAAAE,aAAA;oBACNG,CAAAA;;YAERhB,UAAA;kBAEAL,cAAAA;;;mCAKcsB,KAAAA,CAAAA;kCACdF;QACFH,aAAAK,OAAAC;QAEAL,cAAAI;QACAE,CAAAA,iBAAgBJ,MAAAK,OAAA,MAAA,QAAAC,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAC,IAAA,CAAAP,OAAAE;;wCAEUC;WACxBK,SAAA,CAAA;QACF,IAAGtB,MAAAL,UAAA4B,OAAA,EAAA;mBAACvB,eAAAA,YAAAA,UAAAA,OAAAA;;;;QAAgBK;QAAAA;KAAAA;WAAe;QAEnCmB,YAAO;kBACLA;;cAEAC,qBAAA,CAAAC,MAAA,CAAAC,IAAAA,yCAAA,EAAA,OAAA;iBACAC,IAAAA,8BAAWF,EAAMG,KACfF;6BACOG,WAAcD,OAAKlC;;kBAExBK;oBACA+B;;;yBAIF;;;;;;AAKN,SAAElC,cAAAI,IAAA,EAAAH,QAAA;IAEF,IAAAG,SAASJ,WAAcI;QACrB,OAAIA;;QAEJ+B,aAAA;QAEAC,oBAAiB;WACbA,QAAAA,CAAAA,OAAAA,CAAAA,UAAoBC,CAAAA;QACxBhB,IAAAA,OAAMiB,UAASC,UAAQtC;0BACVoC;;gCAEJ;;;iEAGT;QAEAD,mBAAA;QACA,sCAAuB;gBACrBI,IAAA,CAAA;;WAEFL;EAGF,2CAAA"}
@@ -1,188 +0,0 @@
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
- promptOptionClassNames: function() {
13
- return promptOptionClassNames;
14
- },
15
- usePromptOptionStyles_unstable: function() {
16
- return usePromptOptionStyles_unstable;
17
- }
18
- });
19
- const _reactcomponents = require("@fluentui/react-components");
20
- const promptOptionClassNames = {
21
- root: 'fai-PromptOption'
22
- };
23
- /**
24
- * Styles for the root slot
25
- */ const useStyles = (0, _reactcomponents.__styles)({
26
- root: {
27
- Bt984gj: "f122n59",
28
- Beyfa6y: 0,
29
- Bbmb7ep: 0,
30
- Btl43ni: 0,
31
- B7oj6ja: 0,
32
- Dimara: "ft85np5",
33
- sj55zd: "f19n0e5",
34
- i8kkvl: "f1ufnopg",
35
- Bceei9c: "f1k6fduh",
36
- mc9l5x: "f22iagw",
37
- Bahqtrf: "fk6fouc",
38
- Be2twd7: "fkhj508",
39
- Bg96gwp: "f1i3iumi",
40
- Byoj8tv: 0,
41
- uwmqm3: 0,
42
- z189sj: 0,
43
- z8tnut: 0,
44
- B0ocmuz: "fm5eomj",
45
- qhf8xq: "f10pi13n",
46
- Jwef8y: "f1knas48",
47
- Bi91k9c: "feu1g3u",
48
- ecr2s2: "fb40n2d",
49
- lj723h: "f1g4hkjv"
50
- },
51
- active: {
52
- Bowz1zl: "f11vrvdw",
53
- oxogb1: "f17hxjb7",
54
- Ix2sn8: "f1dha69c",
55
- q7v32p: "f1lm7500",
56
- Bqfxd14: "f1n5bo3l",
57
- B53xpsf: [
58
- "fp57yr3",
59
- "f48q4c"
60
- ],
61
- B1wzb3v: "fg547j0",
62
- f0sref: [
63
- "f48q4c",
64
- "fp57yr3"
65
- ],
66
- Btq9bd3: "fuyp35s",
67
- Bertapg: [
68
- "f1a9nstl",
69
- "fhk0hgg"
70
- ],
71
- b50fsz: "f1rdp6f1",
72
- avt0cx: [
73
- "fhk0hgg",
74
- "f1a9nstl"
75
- ],
76
- B39dzdd: "ffd7rjx",
77
- Be3o27t: [
78
- "fobu5kn",
79
- "f1dbet5w"
80
- ],
81
- Bewtojm: "f1ap9jj5",
82
- B37u8z8: [
83
- "f1dbet5w",
84
- "fobu5kn"
85
- ],
86
- Fffuxt: 0,
87
- Bttcd12: 0,
88
- Beitzug: 0,
89
- Bqougee: 0,
90
- B86i8pi: "f1kurthe",
91
- Bhijsxg: "fwq15dy",
92
- kktds4: "f1pb3wry",
93
- Bmau3bo: [
94
- "ftjv2f4",
95
- "f1flhb1f"
96
- ],
97
- npektv: [
98
- "f1flhb1f",
99
- "ftjv2f4"
100
- ]
101
- },
102
- disabled: {
103
- sj55zd: "f1s2aq7o",
104
- Jwef8y: "f9ql6rf",
105
- Bi91k9c: "fvgxktp",
106
- ecr2s2: "fgj9um3",
107
- lj723h: "f19wldhg",
108
- B7iucu3: "f1cyfu5x"
109
- }
110
- }, {
111
- d: [
112
- ".f122n59{align-items:center;}",
113
- [
114
- ".ft85np5{border-radius:var(--borderRadiusMedium);}",
115
- {
116
- p: -1
117
- }
118
- ],
119
- ".f19n0e5{color:var(--colorNeutralForeground1);}",
120
- ".f1ufnopg{column-gap:var(--spacingHorizontalXS);}",
121
- ".f1k6fduh{cursor:pointer;}",
122
- ".f22iagw{display:flex;}",
123
- ".fk6fouc{font-family:var(--fontFamilyBase);}",
124
- ".fkhj508{font-size:var(--fontSizeBase300);}",
125
- ".f1i3iumi{line-height:var(--lineHeightBase300);}",
126
- [
127
- ".fm5eomj{padding:var(--spacingVerticalSNudge) var(--spacingHorizontalS);}",
128
- {
129
- p: -1
130
- }
131
- ],
132
- ".f10pi13n{position:relative;}",
133
- ".f11vrvdw[data-activedescendant-focusvisible]::after{content:\"\";}",
134
- ".f17hxjb7[data-activedescendant-focusvisible]::after{position:absolute;}",
135
- ".f1dha69c[data-activedescendant-focusvisible]::after{pointer-events:none;}",
136
- ".f1lm7500[data-activedescendant-focusvisible]::after{z-index:1;}",
137
- ".f1n5bo3l[data-activedescendant-focusvisible]::after{border-top-width:var(--strokeWidthThick);}",
138
- ".fp57yr3[data-activedescendant-focusvisible]::after{border-right-width:var(--strokeWidthThick);}",
139
- ".f48q4c[data-activedescendant-focusvisible]::after{border-left-width:var(--strokeWidthThick);}",
140
- ".fg547j0[data-activedescendant-focusvisible]::after{border-bottom-width:var(--strokeWidthThick);}",
141
- ".fuyp35s[data-activedescendant-focusvisible]::after{border-top-style:solid;}",
142
- ".f1a9nstl[data-activedescendant-focusvisible]::after{border-right-style:solid;}",
143
- ".fhk0hgg[data-activedescendant-focusvisible]::after{border-left-style:solid;}",
144
- ".f1rdp6f1[data-activedescendant-focusvisible]::after{border-bottom-style:solid;}",
145
- ".ffd7rjx[data-activedescendant-focusvisible]::after{border-top-color:var(--colorStrokeFocus2);}",
146
- ".fobu5kn[data-activedescendant-focusvisible]::after{border-right-color:var(--colorStrokeFocus2);}",
147
- ".f1dbet5w[data-activedescendant-focusvisible]::after{border-left-color:var(--colorStrokeFocus2);}",
148
- ".f1ap9jj5[data-activedescendant-focusvisible]::after{border-bottom-color:var(--colorStrokeFocus2);}",
149
- [
150
- ".f1kurthe[data-activedescendant-focusvisible]::after{border-radius:var(--borderRadiusMedium);}",
151
- {
152
- p: -1
153
- }
154
- ],
155
- ".fwq15dy[data-activedescendant-focusvisible]::after{top:-2px;}",
156
- ".f1pb3wry[data-activedescendant-focusvisible]::after{bottom:-2px;}",
157
- ".ftjv2f4[data-activedescendant-focusvisible]::after{left:-2px;}",
158
- ".f1flhb1f[data-activedescendant-focusvisible]::after{right:-2px;}",
159
- ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"
160
- ],
161
- h: [
162
- ".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}",
163
- ".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}",
164
- ".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}",
165
- ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"
166
- ],
167
- a: [
168
- ".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}",
169
- ".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}",
170
- ".fgj9um3:active{background-color:var(--colorTransparentBackground);}",
171
- ".f19wldhg:active{color:var(--colorNeutralForegroundDisabled);}"
172
- ],
173
- m: [
174
- [
175
- "@media (forced-colors: active){.f1cyfu5x{color:GrayText;}}",
176
- {
177
- m: "(forced-colors: active)"
178
- }
179
- ]
180
- ]
181
- });
182
- const usePromptOptionStyles_unstable = (state)=>{
183
- 'use no memo';
184
- const { disabled } = state;
185
- const styles = useStyles();
186
- state.root.className = (0, _reactcomponents.mergeClasses)(promptOptionClassNames.root, styles.root, styles.active, disabled && styles.disabled, state.root.className);
187
- return state;
188
- }; //# sourceMappingURL=usePromptOptionStyles.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["usePromptOptionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport { ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from '@fluentui/react-aria';\nimport type { PromptOptionSlots, PromptOptionState } from './PromptOption.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptOptionClassNames: SlotClassNames<PromptOptionSlots> = {\n root: 'fai-PromptOption',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n alignItems: 'center',\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n columnGap: tokens.spacingHorizontalXS,\n cursor: 'pointer',\n display: 'flex',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n padding: `${tokens.spacingVerticalSNudge} ${tokens.spacingHorizontalS}`,\n position: 'relative',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n active: {\n [`[${ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE}]::after`]: {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n ...shorthands.border(tokens.strokeWidthThick, `solid`, tokens.colorStrokeFocus2),\n borderRadius: tokens.borderRadiusMedium,\n\n top: '-2px',\n bottom: '-2px',\n left: '-2px',\n right: '-2px',\n },\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\n/**\n * Apply styling to the PromptOption slots based on the state\n */\nexport const usePromptOptionStyles_unstable = (state: PromptOptionState): PromptOptionState => {\n 'use no memo';\n\n const { disabled } = state;\n const styles = useStyles();\n state.root.className = mergeClasses(\n promptOptionClassNames.root,\n styles.root,\n styles.active,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["promptOptionClassNames","root","__styles","alignItems","borderRadius","color","columnGap","cursor","display","fontFamily","fontSize","lineHeight","padding","position","backgroundColor","qhf8xq","active","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","content","top","bottom","left","right","f0sref","disabled","colorNeutralForegroundDisabled","tokens","colorTransparentBackground","Bhijsxg","kktds4","Bmau3bo","sj55zd","Jwef8y","styles","state","ecr2s2","lj723h"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,sBAAAA;eAAAA;;;;;;iCANgC;AAMtC,MAAMA,yBAA4D;UACvEC;AACF;AAEA;;CAEC,SAECA,YAAMC,IAAAA,yBAAA,EAAA;UACJC;iBACAC;iBACAC;iBACAC;iBACAC;iBACAC;gBACAC;gBACAC;gBACAC;iBACAC;gBACAC;iBAEA;iBACEC;iBACAT;iBACF;gBAEA;gBACES;gBACAT;iBACF;QACFU,QAAA;QAEAC,QAAQ;iBACDC;gBACHC;gBACAL;;;iBAIA;gBACAT;gBAEAe;gBACAC;iBACAC;iBACAC;YAAAA;YAAO;SAAA;iBACT;QACFC,QAAA;YAAA;YAAA;SAAA;QAEAC,SAAAA;iBACEnB;YAAAA;YAAcoB;SAAAA;gBAEd;gBACEX;YAAAA;YAAAA;SAAiBY;iBACjBrB;iBACF;YAAA;YAAA;SAAA;iBAEA;iBACES;YAAAA;YAAAA;SAAwBa;gBACxBtB;iBACF;iBAEA;iBACEA;iBACF;QACFuB,SAAA;QACFC,QAAA;QAEAC,SAAA;YAAA;YAAA;SAAA;;;;;IAEC;cAEC;QAEAC,QAAQP;QACRQ,QAAMC;QACNC,SAAMjC;QAQNkC,QAAOD;QACPE,QAAA"}
@@ -1,6 +0,0 @@
1
- // Brought from Fluent UI
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=OptionCollection.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["OptionCollection.types.ts"],"sourcesContent":["// Brought from Fluent UI\n\nexport type OptionValue = {\n /** The disabled state of the option. */\n disabled?: boolean;\n\n /** The `id` attribute of the option. */\n id: string;\n\n /** The `text` string for the option. */\n text: string;\n\n /** The value string of the option. */\n value: string;\n};\n\nexport type OptionCollectionState = {\n /** The total number of options in the collection. */\n getCount: () => number;\n\n /** Returns the option data by key. */\n getOptionById(id: string): OptionValue | undefined;\n\n /** Returns an array of options filtered by a value matching function against the option's value string. */\n getOptionsMatchingValue(matcher: (value: string) => boolean): OptionValue[];\n\n /** The unordered option data. */\n options: OptionValue[];\n\n /** A function that child options call to register their values. Returns a function to unregister the option. */\n registerOption: (option: OptionValue, element: HTMLElement) => () => void;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAAA,yBAAyB"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- //# sourceMappingURL=PromptListboxFunctionality.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["PromptListboxFunctionality.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PromptListboxProps } from '../../components/PromptListbox';\nimport type { PositioningShorthand } from '@fluentui/react-components';\nimport type { EventData, EventHandler } from '@fluentui/react-utilities';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\n\n// Note: While we are removing multiselect, we are keeping the logic and disabling it\n// in case it's needed in the future.\nexport type ProcessedPromptListboxProps = Partial<\n Omit<PromptListboxProps, 'activeDescendantController' | 'multiselect'>\n> & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref?: React.MutableRefObject<any>;\n};\n\nexport type UsePromptListboxFunctionality = {\n /**\n * Component to be rendered in the Input component. This should be passed to the listbox prop.\n */\n promptListbox: JSX.Element;\n /**\n * Props to be spread in the PromptInput, these props are needed for the keyboard behavior to\n * work correctly.\n */\n triggerProps: {\n ref: React.RefObject<HTMLSpanElement>;\n /**\n * Whether the listbox is being used to go through options or the user is currently typing.\n */\n isInSelectionMode: boolean;\n } & Required<Pick<EditorInputProps, 'onBlur' | 'onFocus' | 'onKeyDown'>>;\n /**\n * Ref used to point which element the listbox should be anchored to. Most use cases\n * will provide this prop to the PromptInput's EditorInput (since this is the root slot,\n * this is provided directly to the component and not the slot).\n *\n * Note: If the containerRef is the same as the trigger, the ref provided in triggerProps needs\n * to be merged with this one using `useMergedRefs(containerRef, triggerProps.ref);`\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n containerRef: React.MutableRefObject<any>;\n /**\n * Plugin used to tell where the cursor is in the EditorInput, this is important for the\n * keyboard behavior. This should be passed as children in the PromptInput.\n */\n cursorPositionPlugin: JSX.Element;\n};\n\nexport type UsePromptListboxFunctionalityParams = {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: EventHandler<OnOpenChangeData>;\n positioning?: PositioningShorthand;\n\n /**\n * Callback to call when the selection mode (selecting an action vs typing) changes.\n */\n onSelectionModeChange?: (isInSelectionMode: boolean) => void;\n\n /**\n * Props to be passed to the ListboxComponent\n */\n listboxProps?: ProcessedPromptListboxProps;\n\n /**\n * Whether the listbox's width should take all the available space or only\n * the required space.\n *\n * @default false\n */\n fluid?: boolean;\n\n /**\n * Whether to allow reaching the listbox options by arrowing up at the start of the input.\n * Note, this prop is meant to be used with the following positioning props:\n * ```ts\n * usePromptListboxFunctionality({\n * positioning: {\n * position: 'above',\n * fallbackPositions: ['above']\n * }\n * });\n * ```\n * This is useful when using PromptListbox with other components such as ChatInput since\n * the input will always stay at the bottom therefore the listbox would always get cut.\n *\n * @default false\n */\n allowArrowUpNavigation?: boolean;\n};\n\nexport type OnOpenChangeData = (\n | EventData<'click', React.MouseEvent<HTMLSpanElement>>\n | EventData<'focus', React.FocusEvent<HTMLSpanElement>>\n | EventData<'keyboard', React.KeyboardEvent<HTMLSpanElement>>\n) & {\n open: boolean;\n};\n"],"names":[],"rangeMappings":"","mappings":""}