@fluentui-copilot/react-attachments 0.9.2 → 0.9.4

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 (74) hide show
  1. package/CHANGELOG.json +31 -1
  2. package/CHANGELOG.md +20 -2
  3. package/dist/index.d.ts +37 -8
  4. package/lib/components/Attachment/Attachment.types.js.map +1 -1
  5. package/lib/components/Attachment/renderAttachment.js +11 -3
  6. package/lib/components/Attachment/renderAttachment.js.map +1 -1
  7. package/lib/components/Attachment/useAttachment.js +32 -8
  8. package/lib/components/Attachment/useAttachment.js.map +1 -1
  9. package/lib/components/Attachment/useAttachmentStyles.js +29 -4
  10. package/lib/components/Attachment/useAttachmentStyles.js.map +1 -1
  11. package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -1
  12. package/lib/components/AttachmentList/renderAttachmentList.js +30 -3
  13. package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -1
  14. package/lib/components/AttachmentList/useAttachmentList.js +79 -11
  15. package/lib/components/AttachmentList/useAttachmentList.js.map +1 -1
  16. package/lib/components/AttachmentList/useAttachmentListContextValues.js +4 -2
  17. package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
  18. package/lib/components/AttachmentList/useAttachmentListStyles.js +9 -1
  19. package/lib/components/AttachmentList/useAttachmentListStyles.js.map +1 -1
  20. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
  21. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
  22. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
  23. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +23 -3
  24. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
  25. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +23 -5
  26. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
  27. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
  28. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +4 -2
  29. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
  30. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +32 -9
  31. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
  32. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +21 -5
  33. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
  34. package/lib/components/utils/useProgressBarStyles.js +54 -0
  35. package/lib/components/utils/useProgressBarStyles.js.map +1 -0
  36. package/lib/contexts/attachmentListContext.js +2 -1
  37. package/lib/contexts/attachmentListContext.js.map +1 -1
  38. package/lib/index.js.map +1 -1
  39. package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
  40. package/lib-commonjs/components/Attachment/renderAttachment.js +8 -2
  41. package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
  42. package/lib-commonjs/components/Attachment/useAttachment.js +28 -8
  43. package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
  44. package/lib-commonjs/components/Attachment/useAttachmentStyles.js +34 -4
  45. package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -1
  46. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -1
  47. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +29 -1
  48. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
  49. package/lib-commonjs/components/AttachmentList/useAttachmentList.js +80 -10
  50. package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
  51. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +3 -2
  52. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
  53. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js +9 -1
  54. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js.map +1 -1
  55. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
  56. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +2 -3
  57. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
  58. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +19 -2
  59. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
  60. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +24 -6
  61. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
  62. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
  63. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +6 -1
  64. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
  65. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +29 -8
  66. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
  67. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +20 -4
  68. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
  69. package/lib-commonjs/components/utils/useProgressBarStyles.js +103 -0
  70. package/lib-commonjs/components/utils/useProgressBarStyles.js.map +1 -0
  71. package/lib-commonjs/contexts/attachmentListContext.js +2 -1
  72. package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
  73. package/lib-commonjs/index.js.map +1 -1
  74. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useOverflowContext } from '@fluentui/react-overflow';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { onAttachmentDismiss } = props;\n\n const attachmentsVisibilityStatus: Record<string, boolean> = useOverflowContext(context => context.itemVisibility);\n\n const innerRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // Remove attachment from overflow context\n delete attachmentsVisibilityStatus?.[data.id];\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n\n if (next) {\n next.focus();\n return;\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n }\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n return {\n onAttachmentDismiss: handleAttachmentDismiss,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["onAttachmentDismiss","props","React","attachmentsVisibilityStatus","findPrevFocusable","useFocusFinders","innerRef","handleAttachmentDismiss","useEventCallback","e","data","_innerRef_current","container","id","targetDocument","activeElement","current","contains","next","focus","arrowNavigationProps","circular","parentElement","axis","memorizeCurrent","prev","useArrowNavigationGroup","root","slot","always","getIntrinsicElementProps","ref","useMergedRefs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BUA;;;eAAAA;;;;iEA1Ba;iCAQhB;qCACyC;+BACb;AAgBjC,MAAQA,6BAAwBC,CAAAA,OAAAA;UAEhC,EAEAD,mBAAiBE,KACjBD;UACAE,8BAA2BC,IAAAA,iCAAsBC,EAAAA,CAAAA,UAAAA,QAAAA,cAAAA;UAEjDC,WAAMC,OAAAA,MAAAA,CAAAA;0BACCP,gDACH;UACF,mBAEAA,mBAEA,yCACOG;UAEPI,0BAAAC,IAAAA,iCAAqC,EAAA,CAAAC,GAAAC;YACrCC;YACA,CAAAX,qBAAIM;;;4BAE6DM,GAAWN;kDAAiB;wCAEjF,QAAAH,gCAAA,KAAA,IAAA,OAAA,OAAAA,2BAAA,CAAAO,KAAAG,EAAA,CAAA;6CACE;8BACVC,mBAAA,QAAAA,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAC,aAAA;iCACKT,SAAAU,OAAA,MAAA,QAAAL,sBAAA,KAAA,IAAA,KAAA,IAAAA,kBAAAM,QAAA,CAAAF,gBAAA;wGAC0BA;2CAA0DT,eAAgB;2BAACA,SAAAU,OAAA;;sBAE5G;gBACFE,KAAAC,KAAA;gBACF;YAEA,OAAMC;gBACJC,MAAAA,OAAUjB,kBAAAW,kBAAA,QAAAA,kBAAA,KAAA,IAAA,KAAA,IAAAA,cAAAO,aAAA,EAAA;oBACVC,WAAMjB,SAAAU,OAAA;gBACNQ;gBACFC,SAAA,QAAAA,SAAA,KAAA,IAAA,KAAA,IAAAA,KAAAN,KAAA;YAEA;;;iCAGUO,IAAAA,wCAAA,EAAA;kBACR;cACAC;yBAEI;;;6BAGGP;oBACAnB;kBAEL;;cAAqB2B,qBAAA,CAAAC,MAAA,CAAAC,IAAAA,yCAAA,EAAA,OAAA;YAEzB,cAAA;YACAC,KAAAC,IAAAA,8BAAA,EAAAD,KAAAzB"}
1
+ {"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n mergeClasses,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useOverflowStyles as useAttachmentOverflowStyles } from '../Attachment';\nimport { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\nimport type { AttachmentProps } from '../Attachment';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;\n const innerRef = React.useRef<HTMLDivElement>(null);\n const [setTimeout] = useTimeout();\n const { targetDocument } = useFluent();\n const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();\n const [attachments, setAttachments] = React.useState<AttachmentProps[]>([]);\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n if (next) {\n // focus on the overflow button if the next focusable element is the overflow button.\n // if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.\n if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n } else {\n next.focus();\n }\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n } else {\n // Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n }\n });\n\n const attachmentOverflowClassName = useAttachmentOverflowStyles().overflow;\n const resolvedChildren = React.useMemo(() => {\n if (maxVisibleAttachments !== undefined) {\n const results = [];\n const childrenArray = React.Children.toArray(children);\n for (let index = 0; index < childrenArray.length; index++) {\n const child = childrenArray[index] as React.ReactElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (index >= maxVisibleAttachments && React.isValidElement<any>(child)) {\n results.push(\n React.cloneElement(child, {\n ...child.props,\n className: mergeClasses(child.props.className, attachmentOverflowClassName),\n }),\n );\n } else {\n results.push(child);\n }\n }\n\n return results;\n }\n return children;\n }, [attachmentOverflowClassName, children, maxVisibleAttachments]);\n\n React.useEffect(() => {\n if (resolvedChildren && Array.isArray(resolvedChildren)) {\n setAttachments(resolvedChildren.map(child => child.props));\n }\n }, [resolvedChildren]);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const shouldUseOverflow = maxVisibleAttachments !== undefined;\n\n return {\n attachments,\n onAttachmentDismiss: handleAttachmentDismiss,\n shouldUseOverflow,\n overflowMenuProps,\n components: {\n root: 'div',\n overflowMenuButton: 'span',\n overflowMenuItem: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n overflowMenuButton: slot.optional(props.overflowMenuButton, {\n defaultProps: { children: <AttachmentOverflowMenuButton /> },\n elementType: 'span',\n renderByDefault: true,\n }),\n overflowMenuItem: slot.optional(props.overflowMenuItem, {\n defaultProps: { children: <AttachmentOverflowMenuItem /> },\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["children","maxVisibleAttachments","props","onAttachmentDismiss","setTimeout","targetDocument","findNextFocusable","overflowMenuProps","attachments","innerRef","activeElement","next","container","current","useState","useEventCallback","e","data","findLastFocusable","_innerRef_current","contains","prev","root","_findLastFocusable","focus","findPrevFocusable","parentElement","attachmentOverflowClassName","undefined","React","isValidElement","useAttachmentOverflowStyles","overflow","useMemo","child","childrenArray","Children","toArray","index","results","useEffect","resolvedChildren","useArrowNavigationGroup","circular","axis","Array","isArray","memorizeCurrent","map","shouldUseOverflow","arrowNavigationProps","components","overflowMenuItem","ref","elementType","overflowMenuButton","slot","defaultProps","optional","createElement","AttachmentOverflowMenuButton","AttachmentOverflowMenuItem"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgCUA;;;eAAAA;;;;iEAhCa;iCAShB;qCACyC;gCACrB;4BACsC;8CACpB;4CACF;uDACY;AAiBrD,MAAQA,6BAAUC,CAAqBC,OAAEC;UACzC,EACAH,QAAOI,EACPH,qBAAQI,EACRF,mBAAQG,EACRC,iBAAOC,KACPN;qBASMO,OAAAA,MAAAA,CAAAA;UARJ,CAAAL,WAAKD,GAAAA,IAAAA,0BAAAA;0BAEL,gDAEAA;UAEA,mBACMO,mBACFD,mBACF,yCACME;wBAAyDC,eAAoBC,GAAAA,OAAOC,QAAA,CAAA,EAAA;oCAACC,IAAAA,iCAAA,EAAA,CAAAC,GAAAC;;kCAEzF;;;4BAGEb,GAAAA;6CACEc;8BAAAA,mBAAAA,QAAAA,mBAAkBT,KAASI,IAAO,KAAA,IAAAR,eAAlCa,aAAAA;iCACCT,SAAAI,OAAA,MAAA,QAAAM,sBAAA,KAAA,IAAA,KAAA,IAAAA,kBAAAC,QAAA,CAAAV,gBAAA;wGACE;2CACKA,eAAA;2BACZD,SAAAI,OAAA;;sBAEA;qGAAyG;0HAAC;yBAC1GQ,SAAAA,CAAAA,QAAAA,CAAAA,6EAAW,CAAAC,IAAA,GAAA;+BACb;wBACF,IAAOC;wBACLA,CAAAA,qBAAAL,kBAAAT,SAAAI,OAAA,CAAA,MAAA,QAAAU,uBAAA,KAAA,IAAA,KAAA,IAAAA,mBAAAC,KAAA;uBACApB;;8BACEc;;mBAEJ;gBACF,MAAAG,OAAAI,kBAAAf,kBAAA,QAAAA,kBAAA,KAAA,IAAA,KAAA,IAAAA,cAAAgB,aAAA,EAAA;oBAEMC,WAAAA,SAAAA,OAAAA;gBACN;gBACEN,SAAIpB,QAAAA,SAAAA,KAA0B2B,IAAAA,KAAAA,IAAWP,KAAAG,KAAA;;;2JAGoB;uBACzD;;sCAEavB,kBAAAA,SAAAA,OAAAA,CAAAA,MAAyB4B,QAAMC,uBAA4B,KAAA,IAAA,KAAA,IAAAP,mBAAAC,KAAA;;;;wCAKpEO,IAAAA,6BAAA,IAAAC,QAAA;6BAEGH,OAAAI,OAAA,CAAA;sCACQC,WAAAA;4BACf,EAAA;kBACFC,gBAAAN,OAAAO,QAAA,CAAAC,OAAA,CAAArC;oBAEAsC,QAAOC,GAAAA,QAAAA,cAAAA,MAAAA,EAAAA,QAAAA;gBACT,MAAAL,QAAAC,aAAA,CAAAG,MAAA;gBACA,8DAAOtC;gBACN,IAAAsC,SAAArC,yBAAA,WAAA,GAAA4B,OAAAC,cAAA,CAAAI,QAAA;oBAACP,QAAAA,IAAAA,CAAAA,WAAAA,GAAAA,OAAAA,YAAAA,CAAAA,OAAAA;wBAA6B3B,GAAAA,MAAAA,KAAAA;wBAAUC,WAAAA,IAAAA,6BAAAA,EAAAA,MAAAA,KAAAA,CAAAA,SAAAA,EAAAA;oBAAsB;gBAEjE4B,OAAMW;oBACJD,QAAIE,IAAAA,CAAAA;;;YAGN,OAAGF;;eAAkBvC;OAErB;QAAA2B;QAA6Be;QAAAA;KAAwB;WACnDC,SAAAA,CAAU;YACVC,oBAAMC,MAAAC,OAAA,CAAAL,mBAAA;2BACNM,iBAAiBC,GAAA,CAAAd,CAAAA,QAAAA,MAAAhC,KAAA;QACnB;OAEA;QAAAuC;KAAMQ;UAENC,uBAAOR,IAAAA,wCAAA,EAAA;kBACLlC;cACAL;yBACA8C;;UAEAE,oBAAYlD,0BAAA2B;;;6BAGVwB;;;oBAIE;kBACAC;gCACM;8BACHH;;mCAEHlD,CAAAA,MAAAA,CAAUyC,IAAAA,yCAAAA,EAAAA,OAAAA;0BAEZ;mDAAEa,EAAaD,KAAA5C;kBAAM;eAEvB8C,oBAAoBC;oBAClBC;sBAAgBzD;;yBAChBsD;;4BAEFE,qBAAA,CAAAE,QAAA,CAAAxD,MAAAqD,kBAAA,EAAA;0BACAH;0BACEK,WAAc,GAAA5B,OAAA8B,aAAA,CAAAC,0DAAA,EAAA;;yBAA2C;6BACzDN;;0BAEFE,qBAAA,CAAAE,QAAA,CAAAxD,MAAAkD,gBAAA,EAAA;YACFK,cAAA;gBACAzD,UAAA,WAAA,GAAA6B,OAAA8B,aAAA,CAAAE,sDAAA,EAAA"}
@@ -9,10 +9,11 @@ Object.defineProperty(exports, "useAttachmentListContextValues_unstable", {
9
9
  }
10
10
  });
11
11
  function useAttachmentListContextValues_unstable(state) {
12
- const { onAttachmentDismiss } = state;
12
+ const { onAttachmentDismiss, shouldUseOverflow } = state;
13
13
  // This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
14
14
  const attachmentList = {
15
- onAttachmentDismiss
15
+ onAttachmentDismiss,
16
+ shouldUseOverflow
16
17
  };
17
18
  return {
18
19
  attachmentList
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { onAttachmentDismiss } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n onAttachmentDismiss,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","onAttachmentDismiss","attachmentList"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,wCAAwCC,KAA0B;UAChF,EAEAC,mBAAA,KACAD;uGACEC;UACFC,iBAAA;QAEAD;;WAAwB;QAC1BC"}
1
+ {"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { onAttachmentDismiss, shouldUseOverflow } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n onAttachmentDismiss,\n shouldUseOverflow,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","onAttachmentDismiss","shouldUseOverflow","attachmentList"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,wCAAwCC,KAA0B;UAChF,EAEAC,mBAAA,EACAC,iBAAMC;uGAEJD;UACFC,iBAAA;QAEAF;;;IACF,OAAA"}
@@ -18,7 +18,9 @@ _export(exports, {
18
18
  });
19
19
  const _reactcomponents = require("@fluentui/react-components");
20
20
  const attachmentListClassNames = {
21
- root: 'fai-AttachmentList'
21
+ root: 'fai-AttachmentList',
22
+ overflowMenuButton: 'fai-AttachmentList__overflowMenuButton',
23
+ overflowMenuItem: 'fai-AttachmentList__overflowMenuItem'
22
24
  };
23
25
  const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r168fwfa", null, [
24
26
  ".r168fwfa{column-gap:var(--spacingHorizontalSNudge);display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;row-gap:var(--spacingVerticalXS);}"
@@ -26,5 +28,11 @@ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r168fwfa", nul
26
28
  const useAttachmentListStyles_unstable = (state)=>{
27
29
  const rootBaseClassName = useRootBaseClassName();
28
30
  state.root.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.root, rootBaseClassName, state.root.className);
31
+ if (state.overflowMenuButton) {
32
+ state.overflowMenuButton.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.overflowMenuButton, state.overflowMenuButton.className);
33
+ }
34
+ if (state.overflowMenuItem) {
35
+ state.overflowMenuItem.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.overflowMenuItem, state.overflowMenuItem.className);
36
+ }
29
37
  return state;
30
38
  }; //# sourceMappingURL=useAttachmentListStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentListStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["attachmentListClassNames","flexShrink","root","useRootBaseClassName","makeResetStyles","state","flexWrap","rowGap","tokens","spacingVerticalXS","rootBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,wBAAAA;eAAAA;;IAQXC,gCAAY;eAAZA;;;iCAZ4C;AAIvC,MAAMD,2BAAgE;UAC3EE;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;CAAA;AAI3CH,MAAAA,mCAAYI,CAAAA;UACZC,oBAAUH;UACVI,IAAQC,CAAAA,SAAOC,GAAAA,IAAAA,6BAAiB,EAAAT,yBAAAE,IAAA,EAAAQ,mBAAAL,MAAAH,IAAA,CAAAS,SAAA;IAClC,OAAAN;AAEA"}
1
+ {"version":3,"sources":["useAttachmentListStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n overflowMenuButton: 'fai-AttachmentList__overflowMenuButton',\n overflowMenuItem: 'fai-AttachmentList__overflowMenuItem',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n const rootBaseClassName = useRootBaseClassName();\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.overflowMenuButton) {\n state.overflowMenuButton.className = mergeClasses(\n attachmentListClassNames.overflowMenuButton,\n state.overflowMenuButton.className,\n );\n }\n\n if (state.overflowMenuItem) {\n state.overflowMenuItem.className = mergeClasses(\n attachmentListClassNames.overflowMenuItem,\n state.overflowMenuItem.className,\n );\n }\n return state;\n};\n"],"names":["attachmentListClassNames","flexShrink","root","overflowMenuButton","overflowMenuItem","useRootBaseClassName","makeResetStyles","state","flexWrap","rowGap","tokens","spacingVerticalXS","rootBaseClassName","className","mergeClasses","useAttachmentListStyles_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,wBAAAA;eAAAA;;IAUXC,gCAAY;eAAZA;;;iCAd4C;AAIvC,MAAMD,2BAAgE;UAC3EE;wBACAC;sBACAC;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;CAAA;AAI3CL,MAAAA,mCAAYM,CAAAA;UACZC,oBAAUH;UACVI,IAAQC,CAAAA,SAAOC,GAAAA,IAAAA,6BAAiB,EAAAX,yBAAAE,IAAA,EAAAU,mBAAAL,MAAAL,IAAA,CAAAW,SAAA;IAClC,IAAAN,MAAAJ,kBAAA,EAAA;QAEAI,MAAAJ,kBAAA,CAAAU,SAAA,GAAAC,IAAAA,6BAAA,EAAAd,yBAAAG,kBAAA,EAAAI,MAAAJ,kBAAA,CAAAU,SAAA;;IAEC,IACDN,MAAOH,gBAAMW,EAAAA;QACXR,MAAMK,gBAAAA,CAAAA,SAAoBP,GAAAA,IAAAA,6BAAAA,EAAAA,yBAAAA,gBAAAA,EAAAA,MAAAA,gBAAAA,CAAAA,SAAAA;;WAGtBE;sDAKJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["AttachmentOverflowMenuButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuState } from '../AttachmentOverflowMenu';\n\nexport type AttachmentOverflowMenuButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n};\n\n/**\n * AttachmentOverflowMenuButton Props\n */\nexport type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>>;\n\n/**\n * State used in rendering AttachmentOverflowMenuButton\n */\nexport type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> &\n Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAYA;;CAEC"}
1
+ {"version":3,"sources":["AttachmentOverflowMenuButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuState } from '../AttachmentOverflowMenu';\n\nexport type AttachmentOverflowMenuButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n progress: NonNullable<Slot<typeof ProgressBar>>;\n};\n\n/**\n * AttachmentOverflowMenuButton Props\n */\nexport type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>> & {\n /**\n * Toggle prop to indicate that there are Attachments in the overflow menu that's currently loading.\n * Setting this to true will show an indeterminate progress bar on the button.\n * @default false\n */\n isLoading?: boolean;\n text?: string | ((overflowCount: number) => React.ReactNode);\n};\n\n/**\n * State used in rendering AttachmentOverflowMenuButton\n */\nexport type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> &\n Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'> &\n Pick<AttachmentOverflowMenuButtonProps, 'isLoading'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAqBA;;CAEC"}
@@ -15,9 +15,8 @@ const renderAttachmentOverflowMenuButton_unstable = (state)=>{
15
15
  return state.isOverflowing ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.MenuTrigger, {
16
16
  children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
17
17
  children: [
18
- " +",
19
- state.overflowCount,
20
- " "
18
+ state.root.children,
19
+ state.isLoading && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {})
21
20
  ]
22
21
  })
23
22
  }) : null;
@@ -1 +1 @@
1
- {"version":3,"sources":["renderAttachmentOverflowMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuTrigger, assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonState,\n AttachmentOverflowMenuButtonSlots,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuButton\n */\nexport const renderAttachmentOverflowMenuButton_unstable = (state: AttachmentOverflowMenuButtonState) => {\n assertSlots<AttachmentOverflowMenuButtonSlots>(state);\n\n return state.isOverflowing ? (\n <MenuTrigger>\n <state.root> +{state.overflowCount} </state.root>\n </MenuTrigger>\n ) : null;\n};\n"],"names":["assertSlots","state","root","MenuTrigger","overflowCount"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaEA;;;eAAAA;;;4BAZF;iCAEyC;AAUvCA,MAAAA,8CAA+CC,CAAAA;oCAExCA,EAAAA;8BAEH,GAAA,WAACA,GAAMC,IAAAA,eAAI,EAAAC,4BAAA,EAAA;;sBAAC;gBAAA;gBAAAF,MAAAG,aAAA;gBAAA;aAAA"}
1
+ {"version":3,"sources":["renderAttachmentOverflowMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuTrigger, assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonState,\n AttachmentOverflowMenuButtonSlots,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuButton\n */\nexport const renderAttachmentOverflowMenuButton_unstable = (state: AttachmentOverflowMenuButtonState) => {\n assertSlots<AttachmentOverflowMenuButtonSlots>(state);\n\n return state.isOverflowing ? (\n <MenuTrigger>\n <state.root>\n {state.root.children}\n {state.isLoading && <state.progress />}\n </state.root>\n </MenuTrigger>\n ) : null;\n};\n"],"names":["assertSlots","state","root","MenuTrigger","children","isLoading","_jsx","progress"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaEA;;;eAAAA;;;4BAZF;iCAEyC;AAUvCA,MAAAA,8CAA+CC,CAAAA;oCAExCA,EAAAA;8BAEH,GAAA,WAACA,GAAMC,IAAAA,eAAI,EAAAC,4BAAA,EAAA;;sBACRF;gBAAAA,MAAMC,IAAKE,CAAAA,QAAQ;gBAAAH,MAAAI,SAAA,IAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAL,MAAAM,QAAA,EAAA,CAAA;aAAA;;;iEAItB"}
@@ -11,18 +11,35 @@ Object.defineProperty(exports, "useAttachmentOverflowMenuButton_unstable", {
11
11
  const _reactcomponents = require("@fluentui/react-components");
12
12
  const _attachmentOverflowMenuContext = require("../../contexts/attachmentOverflowMenuContext");
13
13
  const useAttachmentOverflowMenuButton_unstable = (props, ref)=>{
14
+ const { children, text } = props;
14
15
  const { isOverflowing, overflowCount, overflowButtonRef } = (0, _attachmentOverflowMenuContext.useAttachmentOverflowMenuContext_unstable)((context)=>context);
16
+ const isLoading = !!props.isLoading;
17
+ const processedText = children !== null && children !== void 0 ? children : typeof text === 'function' ? text(overflowCount) : text;
15
18
  return {
16
19
  components: {
17
- root: 'button'
20
+ root: 'button',
21
+ progress: _reactcomponents.ProgressBar
18
22
  },
19
23
  root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('button', {
20
24
  ref: (0, _reactcomponents.useMergedRefs)(ref, overflowButtonRef),
21
25
  ...props
22
26
  }), {
27
+ defaultProps: {
28
+ children: processedText !== null && processedText !== void 0 ? processedText : `+${overflowCount}`
29
+ },
23
30
  elementType: 'button'
24
31
  }),
32
+ progress: _reactcomponents.slot.always(props.progress, {
33
+ defaultProps: {
34
+ value: undefined,
35
+ shape: 'square',
36
+ thickness: 'large',
37
+ 'aria-label': 'Loading'
38
+ },
39
+ elementType: _reactcomponents.ProgressBar
40
+ }),
25
41
  isOverflowing,
26
- overflowCount
42
+ overflowCount,
43
+ isLoading
27
44
  };
28
45
  }; //# sourceMappingURL=useAttachmentOverflowMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuButton.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuButton.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuButton_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuButton\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton\n */\nexport const useAttachmentOverflowMenuButton_unstable = (\n props: AttachmentOverflowMenuButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentOverflowMenuButtonState => {\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(ref, overflowButtonRef),\n ...props,\n }),\n { elementType: 'button' },\n ),\n isOverflowing,\n overflowCount,\n };\n};\n"],"names":["isOverflowing","overflowButtonRef","useAttachmentOverflowMenuContext_unstable","components","root","getIntrinsicElementProps","context","props","slot","always","overflowCount","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAoBUA;;;eAAAA;;;iCApBoD;+CACJ;AAmBxD,MAAQA,2CAA8BC,CAAAA,OAAsBC;UAI5D,eACEC,eACEC,mBACF,iFAEEC,EAAAA,CAAAA,UAAyBC;;oBAEpBC;kBAEL;;cAAwBC,qBAAA,CAAAC,MAAA,CAAAJ,IAAAA,yCAAA,EAAA,UAAA;iBAE1BL,IAAAA,8BAAAA,EAAAA,KAAAA;eACAU,KAAAA;QACF,IAAA;YACAC,aAAA"}
1
+ {"version":3,"sources":["useAttachmentOverflowMenuButton.ts"],"sourcesContent":["import { ProgressBar, getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuButton.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuButton_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuButton\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton\n */\nexport const useAttachmentOverflowMenuButton_unstable = (\n props: AttachmentOverflowMenuButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentOverflowMenuButtonState => {\n const { children, text } = props;\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n const isLoading = !!props.isLoading;\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\n return {\n components: {\n root: 'button',\n progress: ProgressBar,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(ref, overflowButtonRef),\n ...props,\n }),\n { defaultProps: { children: processedText ?? `+${overflowCount}` }, elementType: 'button' },\n ),\n progress: slot.always(props.progress, {\n defaultProps: { value: undefined, shape: 'square', thickness: 'large', 'aria-label': 'Loading' },\n elementType: ProgressBar,\n }),\n isOverflowing,\n overflowCount,\n isLoading,\n };\n};\n"],"names":["children","props","isLoading","text","components","root","progress","getIntrinsicElementProps","context","useMergedRefs","overflowButtonRef","overflowCount","defaultProps","ProgressBar","slot","always","shape","thickness","processedText","isOverflowing"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAoBUA;;;eAAAA;;;iCApBiE;+CACjB;AAmBxD,MAAQA,2CAAmBC,CAAAA,OAAAA;UAC3B,EAGAD,QAAME,EAENC,IAAA,KACAF;UACEG,eACEC,eACAC,mBACF,iFAEEC,EAAAA,CAAAA,UAAyBC;sBAClBC,CAAAA,CAAAA,MAAAA,SAAmBC;0BAChBV,aAAA,QAAAA,aAAA,KAAA,IAAAA,WAAA,OAAAG,SAAA,aAAAA,KAAAQ,iBAAAR;WACV;oBACES;;sBAA+DC,4BAAA;;cAAyBC,qBAAA,CAAAC,MAAA,CAAAR,IAAAA,yCAAA,EAAA,UAAA;iBAE5FD,IAAAA,8BAAeS,EAAAA,KAAOd;oBACpBW;;0BAAkCI;0BAAiBC,kBAAW,QAAAC,kBAAA,KAAA,IAAAA,gBAAA,CAAA,CAAA,EAAAP,cAAA,CAAA;;yBAAiC;;kBAEjGG,qBAAA,CAAAC,MAAA,CAAAd,MAAAK,QAAA,EAAA;0BACAa;gBACAR,OAAAA;gBACAT,OAAAA;gBACFe,WAAA;gBACA,cAAA"}
@@ -17,21 +17,39 @@ _export(exports, {
17
17
  }
18
18
  });
19
19
  const _reactcomponents = require("@fluentui/react-components");
20
+ const _useProgressBarStyles = require("../utils/useProgressBarStyles");
20
21
  const attachmentOverflowMenuButtonClassNames = {
21
- root: 'fai-AttachmentOverflowMenuButton'
22
+ root: 'fai-AttachmentOverflowMenuButton',
23
+ progress: 'fai-AttachmentOverflowMenuButton__progress'
22
24
  };
23
- const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rkv09vy", null, {
25
+ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r1opa2g9", null, {
24
26
  r: [
25
- ".rkv09vy{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);justify-content:center;padding:var(--spacingVerticalS);vertical-align:middle;align-self:end;}",
26
- ".rkv09vy:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2Hover);}",
27
- ".rkv09vy:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2Pressed);}"
27
+ ".r1opa2g9{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);justify-content:center;padding:var(--spacingVerticalS);vertical-align:middle;align-self:end;position:relative;}",
28
+ ".r1opa2g9:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2Hover);}",
29
+ ".r1opa2g9:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2Pressed);}"
28
30
  ],
29
31
  s: [
30
- "@media (forced-colors: active){.rkv09vy:hover{background-color:HighlightText;}.rkv09vy:active{background-color:HighlightText;}}"
32
+ "@media (forced-colors: active){.r1opa2g9:hover{background-color:HighlightText;}.r1opa2g9:active{background-color:HighlightText;}}"
31
33
  ]
32
34
  });
33
35
  const useAttachmentOverflowMenuButtonStyles_unstable = (state)=>{
34
36
  const rootBaseClassName = useRootBaseClassName();
37
+ const progressBarStyles = (0, _useProgressBarStyles.useProgressBarStyles)();
35
38
  state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, state.root.className);
39
+ if (state.progress) {
40
+ state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
41
+ const bar = _reactcomponents.slot.optional(state.progress.bar, {
42
+ elementType: 'div',
43
+ renderByDefault: true
44
+ });
45
+ if (bar) {
46
+ if (state.progress.value === undefined) {
47
+ bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
48
+ } else {
49
+ bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
50
+ }
51
+ state.progress.bar = bar;
52
+ }
53
+ }
36
54
  return state;
37
55
  }; //# sourceMappingURL=useAttachmentOverflowMenuButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuButtonClassNames: SlotClassNames<AttachmentOverflowMenuButtonSlots> = {\n root: 'fai-AttachmentOverflowMenuButton',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n fontFamily: typographyStyles.body1.fontFamily,\n fontSize: typographyStyles.body1.fontSize,\n fontWeight: typographyStyles.body1.fontWeight,\n justifyContent: 'center',\n padding: tokens.spacingVerticalS,\n verticalAlign: 'middle',\n alignSelf: 'end',\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n/**\n * Apply styling to the AttachmentOverflowMenuButton slots based on the state\n */\nexport const useAttachmentOverflowMenuButtonStyles_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): AttachmentOverflowMenuButtonState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.root,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["attachmentOverflowMenuButtonClassNames","columnGap","root","useRootBaseClassName","makeResetStyles","color","alignItems","state","cursor","display","className","mergeClasses","rootBaseClassName","flexWrap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,sCAAAA;eAAAA;;IAWXC,8CAAyC;eAAzCA;;;iCAlB8D;AAOzD,MAAMD,yCAA4F;UACvGE;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,WAAgB,MAAA;OAC3CC;QAAAA;QAAqC;QAAA;KAAA;OACrCC;QAAAA;KAAY;;AAKZL,MAAAA,iDAAyCM,CAAAA;UACzCC,oBAAQL;UACRM,IAAAA,CAASC,SAAA,GAAAC,IAAAA,6BAAA,EAAAX,uCAAAE,IAAA,EAAAU,mBAAAL,MAAAL,IAAA,CAAAQ,SAAA;WACTG;oEAEyC"}
1
+ {"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, slot, tokens, typographyStyles } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles';\nimport type {\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuButtonClassNames: SlotClassNames<AttachmentOverflowMenuButtonSlots> = {\n root: 'fai-AttachmentOverflowMenuButton',\n progress: 'fai-AttachmentOverflowMenuButton__progress',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n fontFamily: typographyStyles.body1.fontFamily,\n fontSize: typographyStyles.body1.fontSize,\n fontWeight: typographyStyles.body1.fontWeight,\n justifyContent: 'center',\n padding: tokens.spacingVerticalS,\n verticalAlign: 'middle',\n alignSelf: 'end',\n position: 'relative',\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\n/**\n * Apply styling to the AttachmentOverflowMenuButton slots based on the state\n */\nexport const useAttachmentOverflowMenuButtonStyles_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): AttachmentOverflowMenuButtonState => {\n const rootBaseClassName = useRootBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.root,\n rootBaseClassName,\n state.root.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["attachmentOverflowMenuButtonClassNames","columnGap","root","progress","useRootBaseClassName","makeResetStyles","color","alignItems","state","cursor","display","useProgressBarStyles","flexWrap","mergeClasses","rootBaseClassName","className","fontFamily","typographyStyles","fontSize","body1","progressBarStyles","fontWeight","justifyContent","padding","spacingVerticalS","verticalAlign","alignSelf","position","value","undefined","bar","indeterminateProgressBar","backgroundColor","colorNeutralBackground3Hover"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQaA,sCAAAA;eAAAA;;IAYXC,8CAAyC;eAAzCA;;;iCApBoE;sCACjC;AAO9B,MAAMD,yCAA4F;UACvGE;cACAC;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;OAC3CC;QAAAA;QAAqC;QAAA;KAAA;OACrCC;QAAAA;KAAY;;AAKZN,MAAAA,iDAAyCO,CAAAA;UACzCC,oBAAQL;UACRM,oBAASC,IAAAA,0CAAA;UACTC,IAAAA,CAAAA,SAAU,GAAAC,IAAAA,6BAAA,EAAAb,uCAAAE,IAAA,EAAAY,mBAAAN,MAAAN,IAAA,CAAAa,SAAA;QACVC,MAAAA,QAAYC,EAAAA;QACZC,MAAAA,QAAUD,CAAAA,SAAAA,GAAiBE,IAAAA,6BAAMD,EAAAA,uCAAQf,QAAA,EAAAiB,kBAAAjB,QAAA,EAAAK,MAAAL,QAAA,CAAAY,SAAA;QACzCM,MAAAA,MAAYJ,qBAAAA,CAAAA,QAAAA,CAAAA,MAAiBE,QAAME,CAAAA,GAAAA,EAAU;YAC7CC,aAAAA;YACAC,iBAAgBC;QAChBC;QACAC,IAAAA,KAAAA;YACAC,IAAAA,MAAUxB,QAAA,CAAAyB,KAAA,KAAAC,WAAA;gBAEVC,IAAAf,SAAU,GAAAF,IAAAA,6BAAA,EAAAO,kBAAAW,wBAAA,EAAAD,IAAAf,SAAA;mBACRN;gBACAuB,IAAAA,SAAAA,GAAAA,IAAAA,6BAAwBC,EAAAA,kBAAAA,kBAA4B,EAAAH,IAAAf,SAAA;;YAEtDP,MAAAL,QAAA,CAAA2B,GAAA,GAAAA;QACA;;WAEExB;oEAEgC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["AttachmentOverflowMenuItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, MenuItem, Slot } from '@fluentui/react-components';\nimport type { AttachmentProps } from '../Attachment';\n\nexport type AttachmentOverflowMenuItemSlots = {\n root: NonNullable<Slot<typeof MenuItem>>;\n};\n\n/**\n * AttachmentOverflowMenuItem Props\n */\nexport type AttachmentOverflowMenuItemProps = ComponentProps<Partial<AttachmentOverflowMenuItemSlots>> &\n Pick<AttachmentProps, 'id' | 'media' | 'imageOnly'>;\n\n/**\n * State used in rendering AttachmentOverflowMenuItem\n */\nexport type AttachmentOverflowMenuItemState = ComponentState<AttachmentOverflowMenuItemSlots> &\n Pick<AttachmentOverflowMenuItemProps, 'imageOnly'> & {\n isVisible: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAaA;;CAEC"}
1
+ {"version":3,"sources":["AttachmentOverflowMenuItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, MenuItem, ProgressBar, Slot } from '@fluentui/react-components';\nimport type { AttachmentProps } from '../Attachment';\n\nexport type AttachmentOverflowMenuItemSlots = {\n root: NonNullable<Slot<typeof MenuItem>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * AttachmentOverflowMenuItem Props\n */\nexport type AttachmentOverflowMenuItemProps = ComponentProps<Partial<AttachmentOverflowMenuItemSlots>> &\n Pick<AttachmentProps, 'id' | 'media' | 'imageOnly'>;\n\n/**\n * State used in rendering AttachmentOverflowMenuItem\n */\nexport type AttachmentOverflowMenuItemState = ComponentState<AttachmentOverflowMenuItemSlots> &\n Pick<AttachmentOverflowMenuItemProps, 'imageOnly'> & {\n isVisible: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAcA;;CAEC"}
@@ -12,5 +12,10 @@ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
12
  const _reactcomponents = require("@fluentui/react-components");
13
13
  const renderAttachmentOverflowMenuItem_unstable = (state)=>{
14
14
  (0, _reactcomponents.assertSlots)(state);
15
- return !state.isVisible ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {}) : null;
15
+ return !state.isVisible ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
16
+ children: [
17
+ state.root.children,
18
+ state.progress && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {})
19
+ ]
20
+ }) : null;
16
21
  }; //# sourceMappingURL=renderAttachmentOverflowMenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["renderAttachmentOverflowMenuItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuItemState,\n AttachmentOverflowMenuItemSlots,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuItem\n */\nexport const renderAttachmentOverflowMenuItem_unstable = (state: AttachmentOverflowMenuItemState) => {\n assertSlots<AttachmentOverflowMenuItemSlots>(state);\n\n return !state.isVisible ? <state.root /> : null;\n};\n"],"names":["assertSlots","state","isVisible","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAaEA;;;eAAAA;;;4BAbwB;iCAGE;AAU1BA,MAAAA,4CAA6CC,CAAAA;oCAErCA,EAAAA;IACR,OAAA,CAAAA,MAAAC,SAAA,GAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAF,MAAAG,IAAA,EAAA,CAAA,KAAA"}
1
+ {"version":3,"sources":["renderAttachmentOverflowMenuItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuItemState,\n AttachmentOverflowMenuItemSlots,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuItem\n */\nexport const renderAttachmentOverflowMenuItem_unstable = (state: AttachmentOverflowMenuItemState) => {\n assertSlots<AttachmentOverflowMenuItemSlots>(state);\n\n return !state.isVisible ? (\n <state.root>\n {state.root.children}\n {state.progress && <state.progress />}\n </state.root>\n ) : null;\n};\n"],"names":["assertSlots","state","root","children","progress","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaEA;;;eAAAA;;;4BAZF;iCAE4B;AAU1BA,MAAAA,4CAA6CC,CAAAA;oCAErCA,EAAAA;;kBAEHA;YAAAA,MAAMC,IAAKC,CAAAA,QAAQ;YAAAF,MAAAG,QAAA,IAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAJ,MAAAG,QAAA,EAAA,CAAA;SAAA;;+DAGpB"}
@@ -12,28 +12,49 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactcomponents = require("@fluentui/react-components");
14
14
  const _reacticons = require("@fluentui/react-icons");
15
+ const _reactoverflow = require("@fluentui/react-overflow");
15
16
  const _attachmentListContext = require("../../contexts/attachmentListContext");
16
17
  const useAttachmentOverflowMenuItem_unstable = (props, ref)=>{
17
- const { id, imageOnly, media } = props;
18
+ const { imageOnly, media } = props;
18
19
  const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
19
- const isVisible = (0, _reactcomponents.useIsOverflowItemVisible)(id);
20
- const onAttachmentDismiss = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context.onAttachmentDismiss);
20
+ const menuItemId = (0, _reactcomponents.useId)('attachment-', props.id);
21
+ const isVisible = (0, _reactcomponents.useIsOverflowItemVisible)(menuItemId);
22
+ const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
23
+ const attachmentsVisibilityStatus = (0, _reactoverflow.useOverflowContext)((context)=>context.itemVisibility);
21
24
  const root = _reactcomponents.slot.always({
22
25
  ref,
23
26
  icon: media,
24
27
  secondaryContent: /*#__PURE__*/ _react.createElement(DismissIcon, null),
25
- ...props
28
+ ...props,
29
+ id: menuItemId
26
30
  }, {
27
31
  elementType: _reactcomponents.MenuItem
28
32
  });
29
- root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
30
- id
31
- }));
33
+ root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>{
34
+ onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
35
+ content: props.children,
36
+ media,
37
+ id: menuItemId
38
+ });
39
+ if (shouldUseOverflow) {
40
+ delete attachmentsVisibilityStatus[menuItemId];
41
+ }
42
+ });
43
+ const progress = _reactcomponents.slot.optional(props.progress, {
44
+ defaultProps: {
45
+ shape: 'square',
46
+ thickness: 'large',
47
+ 'aria-labelledby': props.id
48
+ },
49
+ elementType: _reactcomponents.ProgressBar
50
+ });
32
51
  return {
33
52
  components: {
34
- root: _reactcomponents.MenuItem
53
+ root: _reactcomponents.MenuItem,
54
+ progress: _reactcomponents.ProgressBar
35
55
  },
36
56
  root,
57
+ progress,
37
58
  isVisible,
38
59
  imageOnly
39
60
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MenuItem, mergeCallbacks, slot, useIsOverflowItemVisible } from '@fluentui/react-components';\nimport { Dismiss20Filled, Dismiss20Regular, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuItem.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuItemStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuItem_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuItem\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem\n */\nexport const useAttachmentOverflowMenuItem_unstable = (\n props: AttachmentOverflowMenuItemProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentOverflowMenuItemState => {\n const { id, imageOnly, media } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const isVisible = useIsOverflowItemVisible(id);\n\n const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);\n\n const root = slot.always(\n { ref, icon: media, secondaryContent: <DismissIcon />, ...props },\n { elementType: MenuItem },\n );\n root.onClick = mergeCallbacks(root.onClick, ev =>\n onAttachmentDismiss?.(ev, {\n id,\n }),\n );\n\n return {\n components: {\n root: MenuItem,\n },\n root,\n isVisible,\n imageOnly,\n };\n};\n"],"names":["id","props","imageOnly","onAttachmentDismiss","media","icon","secondaryContent","useAttachmentListContext_unstable","context","root","slot","always","mergeCallbacks","onClick","elementType","MenuItem","isVisible"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBUA;;;eAAAA;;;;iEAtBa;iCACkD;4BACX;uCACZ;AAmBhD,MAAQA,yCAAyBC,CAAAA,OAAAA;UACjC,EACAD,EAAA,EAEAE,SAAMC,EAENC,KAAA;UACSC,cAAMD,IAAAA,sBAAAA,EAAAA,2BAAAA,EAAAA,4BAAAA;UAAOE,YAAAA,IAAAA,yCAAkB,EAAAN;UAAiBG,sBAAQI,IAAAA,wDAAA,EAAAC,CAAAA,UAAAA,QAAAL,mBAAA;UAC/DM,OAAAC,qBAAA,CAAAC,MAAA,CAAA;;QAAwBN,MAAAD;QAE1BK,kBAAeG,WAAAA,GAAeH,OAAKI,aACjCV,CAAAA,aAAAA;gBACEH;;QAIJc,aAAOC,yBAAA;;gBAEHN,GAAAA,IAAAA,+BAAMM,EAAAA,KAAAA,OAAAA,EAAAA,CAAAA,KAAAA,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAAA,IAAAA;;;WAGRC;oBACAd;YACFO,MAAAM,yBAAA;QACA"}
1
+ {"version":3,"sources":["useAttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MenuItem,\n ProgressBar,\n mergeCallbacks,\n slot,\n useId,\n useIsOverflowItemVisible,\n} from '@fluentui/react-components';\nimport { Dismiss20Filled, Dismiss20Regular, bundleIcon } from '@fluentui/react-icons';\nimport { useOverflowContext } from '@fluentui/react-overflow';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuItem.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuItemStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuItem_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuItem\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem\n */\nexport const useAttachmentOverflowMenuItem_unstable = (\n props: AttachmentOverflowMenuItemProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentOverflowMenuItemState => {\n const { imageOnly, media } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const menuItemId = useId('attachment-', props.id);\n const isVisible = useIsOverflowItemVisible(menuItemId);\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n\n const attachmentsVisibilityStatus: Record<string, boolean> = useOverflowContext(context => context.itemVisibility);\n\n const root = slot.always(\n { ref, icon: media, secondaryContent: <DismissIcon />, ...props, id: menuItemId },\n { elementType: MenuItem },\n );\n root.onClick = mergeCallbacks(root.onClick, ev => {\n onAttachmentDismiss?.(ev, { content: props.children, media, id: menuItemId });\n if (shouldUseOverflow) {\n delete attachmentsVisibilityStatus[menuItemId];\n }\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n return {\n components: {\n root: MenuItem,\n progress: ProgressBar,\n },\n root,\n progress,\n isVisible,\n imageOnly,\n };\n};\n"],"names":["imageOnly","props","menuItemId","media","DismissIcon","attachmentsVisibilityStatus","useOverflowContext","context","slot","always","id","ref","icon","secondaryContent","itemVisibility","elementType","MenuItem","root","onClick","onAttachmentDismiss","content","mergeCallbacks","ev","children","defaultProps","progress","optional","components","ProgressBar","isVisible"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA8BUA;;;eAAAA;;;;iEA9Ba;iCAQhB;4BACuD;+BAC3B;uCACe;AAmBhD,MAAQA,yCAAqBC,CAAAA,OAAAA;UAC7B,EACAD,SAAME,EACNC,KAAA,KACAF;UAEAG,cAAMC,IAAAA,sBAAAA,EAAAA,2BAAuDC,EAAAA,4BAAmBC;UAEhFL,aAAaM,IAAAA,sBAAKC,EAAAA,eAChBR,MAAAS,EAAA;UAAEC,YAAAA,IAAAA,yCAAAA,EAAAA;UAAKC,qBAAaC,mBAA2C,iEAAMX,EAAAA,CAAAA,UAAAA;UACrEG,8BAAAC,IAAAA,iCAAA,EAAAC,CAAAA,UAAAA,QAAAO,cAAA;UAAEC,OAAAA,qBAAAA,CAAAA,MAAaC,CAAAA;QAASL;QAE1BM,MAAKC;0BACHC,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,aAAAA;gBAA4BC;;;qBAA+CJ,yBAAA;;gBAEzE,GAAAK,IAAAA,+BAAOhB,EAAAA,KAAAA,OAAAA,EAA2BiB,CAAAA;gCACpC,QAAAH,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAG,IAAA;YACFF,SAAAnB,MAAAsB,QAAA;YAEApB;gBACEqB;;+BAEa;mBACXnB,2BAA2B,CAAAH,WAAA;;;UAG/BuB,WAAAjB,qBAAA,CAAAkB,QAAA,CAAAzB,MAAAwB,QAAA,EAAA;QAEAD,cAAO;mBACLG;uBACEV;+BACUW,MAAAA,EAAAA;;qBAEZX,4BAAAA;;WAEAY;oBACA7B;YACFiB,MAAAD,yBAAA;YACAS,UAAAG,4BAAA"}
@@ -17,10 +17,11 @@ _export(exports, {
17
17
  }
18
18
  });
19
19
  const _reactcomponents = require("@fluentui/react-components");
20
+ const _useProgressBarStyles = require("../utils/useProgressBarStyles");
20
21
  const attachmentOverflowMenuItemClassNames = {
21
- root: 'fai-AttachmentOverflowMenuItem'
22
+ root: 'fai-AttachmentOverflowMenuItem',
23
+ progress: 'fai-AttachmentOverflowMenuItem__progress'
22
24
  };
23
- const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r0", null, []);
24
25
  const useStyles = (0, _reactcomponents.__styles)({
25
26
  imageOnly: {
26
27
  Bt984gj: "f122n59"
@@ -32,8 +33,23 @@ const useStyles = (0, _reactcomponents.__styles)({
32
33
  });
33
34
  const useAttachmentOverflowMenuItemStyles_unstable = (state)=>{
34
35
  const { imageOnly } = state;
35
- const rootBaseClassName = useRootBaseClassName();
36
36
  const styles = useStyles();
37
- state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuItemClassNames.root, rootBaseClassName, imageOnly && styles.imageOnly, state.root.className);
37
+ const progressBarStyles = (0, _useProgressBarStyles.useProgressBarStyles)();
38
+ state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, state.root.className);
39
+ if (state.progress) {
40
+ state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuItemClassNames.progress, progressBarStyles.progress, state.progress.className);
41
+ const bar = _reactcomponents.slot.optional(state.progress.bar, {
42
+ elementType: 'div',
43
+ renderByDefault: true
44
+ });
45
+ if (bar) {
46
+ if (state.progress.value === undefined) {
47
+ bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
48
+ } else {
49
+ bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
50
+ }
51
+ state.progress.bar = bar;
52
+ }
53
+ }
38
54
  return state;
39
55
  }; //# sourceMappingURL=useAttachmentOverflowMenuItemStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuItemStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuItemClassNames: SlotClassNames<AttachmentOverflowMenuItemSlots> = {\n root: 'fai-AttachmentOverflowMenuItem',\n};\n\nconst useRootBaseClassName = makeResetStyles({});\nconst useStyles = makeStyles({\n imageOnly: {\n alignItems: 'center',\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentOverflowMenuItemStyles_unstable = (\n state: AttachmentOverflowMenuItemState,\n): AttachmentOverflowMenuItemState => {\n const { imageOnly } = state;\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.root,\n rootBaseClassName,\n imageOnly && styles.imageOnly,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["attachmentOverflowMenuItemClassNames","styles","useStyles","root","useRootBaseClassName","makeResetStyles","makeStyles","imageOnly","alignItems","d","state"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,oCAAAA;eAAAA;;IAmBLC,4CAASC;eAATD;;;iCA1B0C;AAO3C,MAAMD,uCAAwF;UACnGG;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,MAAiB,MAAA,EAAA;AAC9C,MAAMH,YAAYI,IAAAA,yBAAAA,EAAAA;eAChBC;iBACEC;;AAEJ,GAAA;IAEAC,GAAA;QAAA;KAAA;;AAQE,MAAMR,+CAASC,CAAAA;UAEfQ,EAOAH,SAAOG,EACP,GAAAA"}
1
+ {"version":3,"sources":["useAttachmentOverflowMenuItemStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, slot } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles';\nimport type {\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuItemClassNames: SlotClassNames<AttachmentOverflowMenuItemSlots> = {\n root: 'fai-AttachmentOverflowMenuItem',\n progress: 'fai-AttachmentOverflowMenuItem__progress',\n};\n\nconst useStyles = makeStyles({\n imageOnly: {\n alignItems: 'center',\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentOverflowMenuItemStyles_unstable = (\n state: AttachmentOverflowMenuItemState,\n): AttachmentOverflowMenuItemState => {\n const { imageOnly } = state;\n const styles = useStyles();\n const progressBarStyles = useProgressBarStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.root,\n imageOnly && styles.imageOnly,\n state.root.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["attachmentOverflowMenuItemClassNames","progressBarStyles","useProgressBarStyles","root","progress","useStyles","makeStyles","imageOnly","alignItems","d","state","styles","bar","renderByDefault","className","mergeClasses","undefined","indeterminateProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQaA,oCAAAA;eAAAA;;IAmBLC,4CAAoBC;eAApBD;;;iCA3B+B;sCACF;AAO9B,MAAMD,uCAAwF;UACnGG;cACAC;AACF;AAEA,MAAMC,YAAYC,IAAAA,yBAAAA,EAAAA;eAChBC;iBACEC;;AAEJ,GAAA;IAEAC,GAAA;QAAA;KAAA;;AAQE,MAAMR,+CAAoBC,CAAAA;UAE1BQ,EAMAH,SAAIG;UAOFC,SAAMC;8BAAuDV,IAAAA,0CAAA;cAAOW,CAAAA,SAAAA,GAAAA,IAAAA,6BAAiB,EAAAb,qCAAAG,IAAA,EAAAI,aAAAI,OAAAJ,SAAA,EAAAG,MAAAP,IAAA,CAAAW,SAAA;cAAKV,QAAA,EAAA;cAC1FA,QAAS,CAAAU,SAAA,GAAAC,IAAAA,6BAAA,EAAAf,qCAAAI,QAAA,EAAAH,kBAAAG,QAAA,EAAAM,MAAAN,QAAA,CAAAU,SAAA;oBACHJ,qBAAAA,CAAAA,QAAMN,CAAQM,MAAMN,QAAKY,CAAAA,GAAAA,EAAAA;yBAC3BJ;6BACK;;iBAEP;sBACAF,QAAMN,CAAAA,KAAY,KAAGQ,WAAAA;gBACvBA,IAAAE,SAAA,GAAAC,IAAAA,6BAAA,EAAAd,kBAAAgB,wBAAA,EAAAL,IAAAE,SAAA;YACF,OAAA;gBAEAF,IAAOF,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,kBAAAA,kBAAAA,EAAAA,IAAAA,SAAAA;YACP"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useProgressBarStyles", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useProgressBarStyles;
9
+ }
10
+ });
11
+ const _reactcomponents = require("@fluentui/react-components");
12
+ const indeterminateProgressBarReducedMotion = {
13
+ '0%': {
14
+ opacity: '.2'
15
+ },
16
+ '50%': {
17
+ opacity: '1'
18
+ },
19
+ '100%': {
20
+ opacity: '.2'
21
+ }
22
+ };
23
+ const useProgressBarStyles = (0, _reactcomponents.__styles)({
24
+ progress: {
25
+ a9b677: "fly5x3f",
26
+ qhf8xq: "f1euv43f",
27
+ B5kzvoi: "f1yab3r1",
28
+ oyh7mz: [
29
+ "f1vgc2s3",
30
+ "f1e31b4d"
31
+ ],
32
+ j35jbq: [
33
+ "f1e31b4d",
34
+ "f1vgc2s3"
35
+ ],
36
+ Bqenvij: "f6ywr7j",
37
+ Beyfa6y: [
38
+ "f16jpd5f",
39
+ "f1aa9q02"
40
+ ],
41
+ Bbmb7ep: [
42
+ "f1aa9q02",
43
+ "f16jpd5f"
44
+ ]
45
+ },
46
+ regularProgressBar: {
47
+ Bqenvij: "f1l02sjl",
48
+ Bcmaq0h: "fx7worf"
49
+ },
50
+ indeterminateProgressBar: {
51
+ Bqenvij: "f1l02sjl",
52
+ De3pzq: "f1c21dwh",
53
+ Bcmaq0h: "f1hxqsn5",
54
+ B3ks32h: "f2xo07b",
55
+ B3vm3ge: "f1f2ih6z",
56
+ Gqtpxc: "f7h4d4t",
57
+ vr3tzx: "f32r5lb"
58
+ }
59
+ }, {
60
+ d: [
61
+ ".fly5x3f{width:100%;}",
62
+ ".f1euv43f{position:absolute;}",
63
+ ".f1yab3r1{bottom:0;}",
64
+ ".f1vgc2s3{left:0;}",
65
+ ".f1e31b4d{right:0;}",
66
+ ".f6ywr7j{height:4px;}",
67
+ ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
68
+ ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
69
+ ".f1l02sjl{height:100%;}",
70
+ ".fx7worf{background-image:linear-gradient(90deg, var(--fai-colorBrandFlair1) 35%, var(--fai-colorBrandFlair2) 70%, var(--fai-colorBrandFlair3) 92%);}",
71
+ ".f1c21dwh{background-color:var(--colorTransparentBackground);}",
72
+ ".f1hxqsn5{background-image:linear-gradient(90deg, rgba(0,0,0,0) 0%, var(--fai-colorBrandFlair1) 35%, var(--fai-colorBrandFlair2) 70%, var(--fai-colorBrandFlair3) 92%, rgba(0,0,0,0));}"
73
+ ],
74
+ m: [
75
+ [
76
+ "@media screen and (prefers-reduced-motion: reduce){.f2xo07b{max-width:100%;}}",
77
+ {
78
+ m: "screen and (prefers-reduced-motion: reduce)"
79
+ }
80
+ ],
81
+ [
82
+ "@media screen and (prefers-reduced-motion: reduce){.f1f2ih6z{animation-iteration-count:infinite;}}",
83
+ {
84
+ m: "screen and (prefers-reduced-motion: reduce)"
85
+ }
86
+ ],
87
+ [
88
+ "@media screen and (prefers-reduced-motion: reduce){.f7h4d4t{animation-duration:3s;}}",
89
+ {
90
+ m: "screen and (prefers-reduced-motion: reduce)"
91
+ }
92
+ ],
93
+ [
94
+ "@media screen and (prefers-reduced-motion: reduce){.f32r5lb{animation-name:ftc26vs;}}",
95
+ {
96
+ m: "screen and (prefers-reduced-motion: reduce)"
97
+ }
98
+ ]
99
+ ],
100
+ k: [
101
+ "@keyframes ftc26vs{0%{opacity:.2;}50%{opacity:1;}100%{opacity:.2;}}"
102
+ ]
103
+ }); //# sourceMappingURL=useProgressBarStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useProgressBarStyles.ts"],"sourcesContent":["import { makeStyles, tokens } from '@fluentui/react-components';\nimport { tokens as copilotTokens } from '@fluentui-copilot/tokens';\n\nconst indeterminateProgressBarReducedMotion = {\n '0%': {\n opacity: '.2', // matches indeterminate bar width\n },\n '50%': {\n opacity: '1',\n },\n '100%': {\n opacity: '.2',\n },\n};\n\n/**\n * @internal\n */\nexport const useProgressBarStyles = makeStyles({\n progress: {\n width: '100%',\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n height: '4px',\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n },\n regularProgressBar: {\n height: '100%',\n backgroundImage: `linear-gradient(90deg, ${copilotTokens.colorBrandFlair1} 35%, ${copilotTokens.colorBrandFlair2} 70%, ${copilotTokens.colorBrandFlair3} 92%)`,\n },\n indeterminateProgressBar: {\n height: '100%',\n backgroundColor: tokens.colorTransparentBackground,\n backgroundImage: `linear-gradient(90deg, rgba(0,0,0,0) 0%, ${copilotTokens.colorBrandFlair1} 35%, ${copilotTokens.colorBrandFlair2} 70%, ${copilotTokens.colorBrandFlair3} 92%, rgba(0,0,0,0))`,\n '@media screen and (prefers-reduced-motion: reduce)': {\n maxWidth: '100%',\n animationIterationCount: 'infinite',\n animationDuration: '3s',\n animationName: indeterminateProgressBarReducedMotion,\n },\n },\n});\n"],"names":["progress","indeterminateProgressBarReducedMotion","opacity","__styles","width","position","bottom","left","right","height","borderBottomLeftRadius","borderBottomRightRadius","tokens","Bbmb7ep","backgroundImage","Bcmaq0h","backgroundColor","maxWidth","animationIterationCount","animationDuration","animationName","d"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBEA;;;eAAAA;;;iCAnByB;AAG3B,MAAMC,wCAAwC;UAC5C;iBACEC;;WAEF;iBACEA;;YAEF;iBACEA;;AAEJ;AAMEF,MAAAA,uBAAUG,IAAAA,yBAAA,EAAA;cACRC;gBACAC;gBACAC;iBACAC;gBACAC;YAAAA;YAAO;SAAA;gBACPC;YAAAA;YAAQ;SAAA;iBACRC;iBACAC;YAAAA;YAAAA;SAAyBC;QAC3BC,SAAA;YAAA;YAAA;SAAA;;wBAEU;iBACRC;QACFC,SAAA;;8BAEU;iBACRC;gBACAF;iBACA;iBACEG;iBACAC;gBACAC;gBACAC;;;IAGNC,GAAG;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA"}
@@ -22,7 +22,8 @@ _export(exports, {
22
22
  const _reactcontextselector = require("@fluentui/react-context-selector");
23
23
  const AttachmentListContext = (0, _reactcontextselector.createContext)(undefined);
24
24
  const attachmentListContextDefaultValue = {
25
- onAttachmentDismiss: ()=>null
25
+ onAttachmentDismiss: ()=>null,
26
+ shouldUseOverflow: false
26
27
  };
27
28
  const AttachmentListProvider = AttachmentListContext.Provider;
28
29
  const useAttachmentListContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(AttachmentListContext, (ctx = attachmentListContextDefaultValue)=>selector(ctx)); //# sourceMappingURL=attachmentListContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["attachmentListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { AttachmentListProps } from '../components/index';\n\nexport const AttachmentListContext: Context<AttachmentListContextValue> = createContext<\n AttachmentListContextValue | undefined\n>(undefined) as Context<AttachmentListContextValue>;\n\nconst attachmentListContextDefaultValue: AttachmentListContextValue = {\n onAttachmentDismiss: () => null,\n};\n\n/**\n * Context shared between AttachmentList and its children components\n */\nexport type AttachmentListContextValue = Pick<AttachmentListProps, 'onAttachmentDismiss'>;\n\nexport const AttachmentListProvider = AttachmentListContext.Provider;\n\nexport const useAttachmentListContext_unstable = <T>(selector: ContextSelector<AttachmentListContextValue, T>) =>\n useContextSelector(AttachmentListContext, (ctx = attachmentListContextDefaultValue) => selector(ctx));\n"],"names":["AttachmentListContext","AttachmentListProvider","useAttachmentListContext_unstable","createContext","undefined","attachmentListContextDefaultValue","onAttachmentDismiss","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,qBAAAA;eAAAA;;IAaAC,sBAAAA;eAAAA;;IAEAC,iCAAAA;eAAAA;;;sCAnBqC;AAI3C,MAAMF,wBAA6DG,IAAAA,mCAAAA,EAExEC;AAEF,MAAMC,oCAAgE;yBACpEC,IAA2B;AAC7B;AAOO,MAAML,yBAAyBD,sBAAsBO,QAAQ;AAE7D,MAAML,oCAAoCM,CAAAA,WAC/CC,IAAAA,wCAAAA,EAAmBT,uBAAuB,CAACU,MAAML,iCAAiC,GAAKG,SAASE"}
1
+ {"version":3,"sources":["attachmentListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { AttachmentListState } from '../components/index';\n\nexport const AttachmentListContext: Context<AttachmentListContextValue> = createContext<\n AttachmentListContextValue | undefined\n>(undefined) as Context<AttachmentListContextValue>;\n\nconst attachmentListContextDefaultValue: AttachmentListContextValue = {\n onAttachmentDismiss: () => null,\n shouldUseOverflow: false,\n};\n\n/**\n * Context shared between AttachmentList and its children components\n */\nexport type AttachmentListContextValue = Pick<AttachmentListState, 'onAttachmentDismiss' | 'shouldUseOverflow'>;\n\nexport const AttachmentListProvider = AttachmentListContext.Provider;\n\nexport const useAttachmentListContext_unstable = <T>(selector: ContextSelector<AttachmentListContextValue, T>) =>\n useContextSelector(AttachmentListContext, (ctx = attachmentListContextDefaultValue) => selector(ctx));\n"],"names":["AttachmentListContext","AttachmentListProvider","useAttachmentListContext_unstable","createContext","undefined","attachmentListContextDefaultValue","onAttachmentDismiss","shouldUseOverflow","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,qBAAAA;eAAAA;;IAcAC,sBAAAA;eAAAA;;IAEAC,iCAAAA;eAAAA;;;sCApBqC;AAI3C,MAAMF,wBAA6DG,IAAAA,mCAAAA,EAExEC;AAEF,MAAMC,oCAAgE;yBACpEC,IAA2B;uBAC3BC;AACF;AAOO,MAAMN,yBAAyBD,sBAAsBQ,QAAQ;AAE7D,MAAMN,oCAAoCO,CAAAA,WAC/CC,IAAAA,wCAAAA,EAAmBV,uBAAuB,CAACW,MAAMN,iCAAiC,GAAKI,SAASE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport {\n AttachmentTagItem,\n attachmentTagItemClassNames,\n renderAttachmentTagItem_unstable,\n useAttachmentTagItemStyles_unstable,\n useAttachmentTagItem_unstable,\n} from './AttachmentTagItem';\n\nexport type { AttachmentListProps, AttachmentListSlots, AttachmentListState } from './AttachmentList';\nexport {\n AttachmentList,\n attachmentListClassNames,\n renderAttachmentList_unstable,\n useAttachmentListStyles_unstable,\n useAttachmentList_unstable,\n} from './AttachmentList';\nexport type { AttachmentListContextValue } from './contexts/attachmentListContext';\nexport {\n AttachmentListContext,\n AttachmentListProvider,\n useAttachmentListContext_unstable,\n} from './contexts/attachmentListContext';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment';\nexport {\n Attachment,\n attachmentClassNames,\n renderAttachment_unstable,\n useAttachmentStyles_unstable,\n useAttachment_unstable,\n} from './Attachment';\n\nexport type {\n AttachmentOverflowMenuProps,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuState,\n} from './AttachmentOverflowMenu';\nexport {\n AttachmentOverflowMenu,\n renderAttachmentOverflowMenu_unstable,\n useAttachmentOverflowMenu_unstable,\n} from './AttachmentOverflowMenu';\n\nexport type { AttachmentOverflowMenuContextValue } from './contexts/attachmentOverflowMenuContext';\nexport {\n AttachmentOverflowMenuContext,\n AttachmentOverflowMenuProvider,\n useAttachmentOverflowMenuContext_unstable,\n} from './contexts/attachmentOverflowMenuContext';\n\nexport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton';\nexport {\n AttachmentOverflowMenuButton,\n attachmentOverflowMenuButtonClassNames,\n renderAttachmentOverflowMenuButton_unstable,\n useAttachmentOverflowMenuButtonStyles_unstable,\n useAttachmentOverflowMenuButton_unstable,\n} from './AttachmentOverflowMenuButton';\n\nexport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem';\nexport {\n AttachmentOverflowMenuItem,\n attachmentOverflowMenuItemClassNames,\n renderAttachmentOverflowMenuItem_unstable,\n useAttachmentOverflowMenuItemStyles_unstable,\n useAttachmentOverflowMenuItem_unstable,\n} from './AttachmentOverflowMenuItem';\n"],"names":["Attachment","AttachmentList","AttachmentListContext","AttachmentListProvider","AttachmentOverflowMenu","AttachmentOverflowMenuButton","AttachmentOverflowMenuContext","AttachmentOverflowMenuItem","AttachmentOverflowMenuProvider","AttachmentTag","AttachmentTagItem","AttachmentTagList","attachmentClassNames","attachmentListClassNames","attachmentOverflowMenuButtonClassNames","attachmentOverflowMenuItemClassNames","attachmentTagClassNames","attachmentTagItemClassNames","attachmentTagListClassNames","renderAttachmentList_unstable","renderAttachmentOverflowMenuButton_unstable","renderAttachmentOverflowMenuItem_unstable","renderAttachmentOverflowMenu_unstable","renderAttachmentTagItem_unstable","renderAttachmentTagList_unstable","renderAttachmentTag_unstable","renderAttachment_unstable","useAttachmentListContext_unstable","useAttachmentListStyles_unstable","useAttachmentList_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuContext_unstable","useAttachmentOverflowMenuItemStyles_unstable","useAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenu_unstable","useAttachmentStyles_unstable","useAttachmentTagItemStyles_unstable","useAttachmentTagItem_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","useAttachment_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA+CEA,UAAU;eAAVA,sBAAU;;IAdVC,cAAc;eAAdA,8BAAc;;IAQdC,qBAAqB;eAArBA,4CAAqB;;IACrBC,sBAAsB;eAAtBA,6CAAsB;;IAkBtBC,sBAAsB;eAAtBA,8CAAsB;;IAkBtBC,4BAA4B;eAA5BA,0DAA4B;;IAX5BC,6BAA6B;eAA7BA,4DAA6B;;IAwB7BC,0BAA0B;eAA1BA,sDAA0B;;IAvB1BC,8BAA8B;eAA9BA,6DAA8B;;IAlE9BC,aAAa;eAAbA,4BAAa;;IAsBbC,iBAAiB;eAAjBA,oCAAiB;;IATjBC,iBAAiB;eAAjBA,oCAAiB;;IAiCjBC,oBAAoB;eAApBA,gCAAoB;;IAdpBC,wBAAwB;eAAxBA,wCAAwB;;IA6CxBC,sCAAsC;eAAtCA,oEAAsC;;IAatCC,oCAAoC;eAApCA,gEAAoC;;IAzFpCC,uBAAuB;eAAvBA,sCAAuB;;IAsBvBC,2BAA2B;eAA3BA,8CAA2B;;IAT3BC,2BAA2B;eAA3BA,8CAA2B;;IAmB3BC,6BAA6B;eAA7BA,6CAA6B;;IA6C7BC,2CAA2C;eAA3CA,yEAA2C;;IAa3CC,yCAAyC;eAAzCA,qEAAyC;;IAhCzCC,qCAAqC;eAArCA,6DAAqC;;IAnCrCC,gCAAgC;eAAhCA,mDAAgC;;IAThCC,gCAAgC;eAAhCA,mDAAgC;;IAbhCC,4BAA4B;eAA5BA,2CAA4B;;IA6C5BC,yBAAyB;eAAzBA,qCAAyB;;IANzBC,iCAAiC;eAAjCA,wDAAiC;;IAPjCC,gCAAgC;eAAhCA,gDAAgC;;IAChCC,0BAA0B;eAA1BA,0CAA0B;;IA4C1BC,8CAA8C;eAA9CA,4EAA8C;;IAC9CC,wCAAwC;eAAxCA,sEAAwC;;IAbxCC,yCAAyC;eAAzCA,wEAAyC;;IAyBzCC,4CAA4C;eAA5CA,wEAA4C;;IAC5CC,sCAAsC;eAAtCA,kEAAsC;;IAjCtCC,kCAAkC;eAAlCA,0DAAkC;;IAZlCC,4BAA4B;eAA5BA,wCAA4B;;IAvB5BC,mCAAmC;eAAnCA,sDAAmC;;IACnCC,6BAA6B;eAA7BA,gDAA6B;;IAV7BC,mCAAmC;eAAnCA,sDAAmC;;IACnCC,6BAA6B;eAA7BA,gDAA6B;;IAd7BC,+BAA+B;eAA/BA,8CAA+B;;IAC/BC,yBAAyB;eAAzBA,wCAAyB;;IA6CzBC,sBAAsB;eAAtBA,kCAAsB;;;+BA5CjB;mCAaA;mCASA;gCASA;uCAMA;4BAQA;wCAWA;+CAOA;8CAaA;4CAaA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport {\n AttachmentTagItem,\n attachmentTagItemClassNames,\n renderAttachmentTagItem_unstable,\n useAttachmentTagItemStyles_unstable,\n useAttachmentTagItem_unstable,\n} from './AttachmentTagItem';\n\nexport type {\n AttachmentListProps,\n AttachmentListSlots,\n AttachmentListState,\n AttachmentDismissedData,\n} from './AttachmentList';\nexport {\n AttachmentList,\n attachmentListClassNames,\n renderAttachmentList_unstable,\n useAttachmentListStyles_unstable,\n useAttachmentList_unstable,\n} from './AttachmentList';\nexport type { AttachmentListContextValue } from './contexts/attachmentListContext';\nexport {\n AttachmentListContext,\n AttachmentListProvider,\n useAttachmentListContext_unstable,\n} from './contexts/attachmentListContext';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment';\nexport {\n Attachment,\n attachmentClassNames,\n renderAttachment_unstable,\n useAttachmentStyles_unstable,\n useAttachment_unstable,\n} from './Attachment';\n\nexport type {\n AttachmentOverflowMenuProps,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuState,\n} from './AttachmentOverflowMenu';\nexport {\n AttachmentOverflowMenu,\n renderAttachmentOverflowMenu_unstable,\n useAttachmentOverflowMenu_unstable,\n} from './AttachmentOverflowMenu';\n\nexport type { AttachmentOverflowMenuContextValue } from './contexts/attachmentOverflowMenuContext';\nexport {\n AttachmentOverflowMenuContext,\n AttachmentOverflowMenuProvider,\n useAttachmentOverflowMenuContext_unstable,\n} from './contexts/attachmentOverflowMenuContext';\n\nexport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton';\nexport {\n AttachmentOverflowMenuButton,\n attachmentOverflowMenuButtonClassNames,\n renderAttachmentOverflowMenuButton_unstable,\n useAttachmentOverflowMenuButtonStyles_unstable,\n useAttachmentOverflowMenuButton_unstable,\n} from './AttachmentOverflowMenuButton';\n\nexport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem';\nexport {\n AttachmentOverflowMenuItem,\n attachmentOverflowMenuItemClassNames,\n renderAttachmentOverflowMenuItem_unstable,\n useAttachmentOverflowMenuItemStyles_unstable,\n useAttachmentOverflowMenuItem_unstable,\n} from './AttachmentOverflowMenuItem';\n"],"names":["Attachment","AttachmentList","AttachmentListContext","AttachmentListProvider","AttachmentOverflowMenu","AttachmentOverflowMenuButton","AttachmentOverflowMenuContext","AttachmentOverflowMenuItem","AttachmentOverflowMenuProvider","AttachmentTag","AttachmentTagItem","AttachmentTagList","attachmentClassNames","attachmentListClassNames","attachmentOverflowMenuButtonClassNames","attachmentOverflowMenuItemClassNames","attachmentTagClassNames","attachmentTagItemClassNames","attachmentTagListClassNames","renderAttachmentList_unstable","renderAttachmentOverflowMenuButton_unstable","renderAttachmentOverflowMenuItem_unstable","renderAttachmentOverflowMenu_unstable","renderAttachmentTagItem_unstable","renderAttachmentTagList_unstable","renderAttachmentTag_unstable","renderAttachment_unstable","useAttachmentListContext_unstable","useAttachmentListStyles_unstable","useAttachmentList_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuContext_unstable","useAttachmentOverflowMenuItemStyles_unstable","useAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenu_unstable","useAttachmentStyles_unstable","useAttachmentTagItemStyles_unstable","useAttachmentTagItem_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","useAttachment_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAoDEA,UAAU;eAAVA,sBAAU;;IAdVC,cAAc;eAAdA,8BAAc;;IAQdC,qBAAqB;eAArBA,4CAAqB;;IACrBC,sBAAsB;eAAtBA,6CAAsB;;IAkBtBC,sBAAsB;eAAtBA,8CAAsB;;IAkBtBC,4BAA4B;eAA5BA,0DAA4B;;IAX5BC,6BAA6B;eAA7BA,4DAA6B;;IAwB7BC,0BAA0B;eAA1BA,sDAA0B;;IAvB1BC,8BAA8B;eAA9BA,6DAA8B;;IAvE9BC,aAAa;eAAbA,4BAAa;;IAsBbC,iBAAiB;eAAjBA,oCAAiB;;IATjBC,iBAAiB;eAAjBA,oCAAiB;;IAsCjBC,oBAAoB;eAApBA,gCAAoB;;IAdpBC,wBAAwB;eAAxBA,wCAAwB;;IA6CxBC,sCAAsC;eAAtCA,oEAAsC;;IAatCC,oCAAoC;eAApCA,gEAAoC;;IA9FpCC,uBAAuB;eAAvBA,sCAAuB;;IAsBvBC,2BAA2B;eAA3BA,8CAA2B;;IAT3BC,2BAA2B;eAA3BA,8CAA2B;;IAwB3BC,6BAA6B;eAA7BA,6CAA6B;;IA6C7BC,2CAA2C;eAA3CA,yEAA2C;;IAa3CC,yCAAyC;eAAzCA,qEAAyC;;IAhCzCC,qCAAqC;eAArCA,6DAAqC;;IAxCrCC,gCAAgC;eAAhCA,mDAAgC;;IAThCC,gCAAgC;eAAhCA,mDAAgC;;IAbhCC,4BAA4B;eAA5BA,2CAA4B;;IAkD5BC,yBAAyB;eAAzBA,qCAAyB;;IANzBC,iCAAiC;eAAjCA,wDAAiC;;IAPjCC,gCAAgC;eAAhCA,gDAAgC;;IAChCC,0BAA0B;eAA1BA,0CAA0B;;IA4C1BC,8CAA8C;eAA9CA,4EAA8C;;IAC9CC,wCAAwC;eAAxCA,sEAAwC;;IAbxCC,yCAAyC;eAAzCA,wEAAyC;;IAyBzCC,4CAA4C;eAA5CA,wEAA4C;;IAC5CC,sCAAsC;eAAtCA,kEAAsC;;IAjCtCC,kCAAkC;eAAlCA,0DAAkC;;IAZlCC,4BAA4B;eAA5BA,wCAA4B;;IA5B5BC,mCAAmC;eAAnCA,sDAAmC;;IACnCC,6BAA6B;eAA7BA,gDAA6B;;IAV7BC,mCAAmC;eAAnCA,sDAAmC;;IACnCC,6BAA6B;eAA7BA,gDAA6B;;IAd7BC,+BAA+B;eAA/BA,8CAA+B;;IAC/BC,yBAAyB;eAAzBA,wCAAyB;;IAkDzBC,sBAAsB;eAAtBA,kCAAsB;;;+BAjDjB;mCAaA;mCASA;gCAcA;uCAMA;4BAQA;wCAWA;+CAOA;8CAaA;4CAaA"}