@fluentui-copilot/react-attachments 0.0.0-nightly-20240723-0406-13a39b27.1 → 0.0.0-nightly-20240725-0409-8e4df801.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui-copilot/react-attachments",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 23 Jul 2024 04:12:38 GMT",
6
- "tag": "@fluentui-copilot/react-attachments_v0.0.0-nightly-20240723-0406-13a39b27.1",
7
- "version": "0.0.0-nightly-20240723-0406-13a39b27.1",
5
+ "date": "Thu, 25 Jul 2024 04:15:52 GMT",
6
+ "tag": "@fluentui-copilot/react-attachments_v0.0.0-nightly-20240725-0409-8e4df801.1",
7
+ "version": "0.0.0-nightly-20240725-0409-8e4df801.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,20 +16,20 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui-copilot/react-attachments",
19
- "comment": "Bump @fluentui-copilot/react-provider to v0.0.0-nightly-20240723-0406-13a39b27.1",
20
- "commit": "c0e6ca096348e34a80e11a390c53a557d9a00f86"
19
+ "comment": "Bump @fluentui-copilot/react-provider to v0.0.0-nightly-20240725-0409-8e4df801.1",
20
+ "commit": "5142a000ea6c61ae4506bb5329e022852f3341e6"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui-copilot/react-attachments",
25
- "comment": "Bump @fluentui-copilot/react-utilities to v0.0.0-nightly-20240723-0406-13a39b27.1",
26
- "commit": "c0e6ca096348e34a80e11a390c53a557d9a00f86"
25
+ "comment": "Bump @fluentui-copilot/react-utilities to v0.0.0-nightly-20240725-0409-8e4df801.1",
26
+ "commit": "5142a000ea6c61ae4506bb5329e022852f3341e6"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui-copilot/react-attachments",
31
- "comment": "Bump @fluentui-copilot/tokens to v0.0.0-nightly-20240723-0406-13a39b27.1",
32
- "commit": "c0e6ca096348e34a80e11a390c53a557d9a00f86"
31
+ "comment": "Bump @fluentui-copilot/tokens to v0.0.0-nightly-20240725-0409-8e4df801.1",
32
+ "commit": "5142a000ea6c61ae4506bb5329e022852f3341e6"
33
33
  }
34
34
  ]
35
35
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # Change Log - @fluentui-copilot/react-attachments
2
2
 
3
- This log was last generated on Tue, 23 Jul 2024 04:12:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 25 Jul 2024 04:15:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20240723-0406-13a39b27.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.0.0-nightly-20240723-0406-13a39b27.1)
7
+ ## [0.0.0-nightly-20240725-0409-8e4df801.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.0.0-nightly-20240725-0409-8e4df801.1)
8
8
 
9
- Tue, 23 Jul 2024 04:12:38 GMT
10
- [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.6..@fluentui-copilot/react-attachments_v0.0.0-nightly-20240723-0406-13a39b27.1)
9
+ Thu, 25 Jul 2024 04:15:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.6..@fluentui-copilot/react-attachments_v0.0.0-nightly-20240725-0409-8e4df801.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly ([commit](https://github.com/microsoft/fluentai/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui-copilot/react-provider to v0.0.0-nightly-20240723-0406-13a39b27.1 ([commit](https://github.com/microsoft/fluentai/commit/c0e6ca096348e34a80e11a390c53a557d9a00f86) by beachball)
16
- - Bump @fluentui-copilot/react-utilities to v0.0.0-nightly-20240723-0406-13a39b27.1 ([commit](https://github.com/microsoft/fluentai/commit/c0e6ca096348e34a80e11a390c53a557d9a00f86) by beachball)
17
- - Bump @fluentui-copilot/tokens to v0.0.0-nightly-20240723-0406-13a39b27.1 ([commit](https://github.com/microsoft/fluentai/commit/c0e6ca096348e34a80e11a390c53a557d9a00f86) by beachball)
15
+ - Bump @fluentui-copilot/react-provider to v0.0.0-nightly-20240725-0409-8e4df801.1 ([commit](https://github.com/microsoft/fluentai/commit/5142a000ea6c61ae4506bb5329e022852f3341e6) by beachball)
16
+ - Bump @fluentui-copilot/react-utilities to v0.0.0-nightly-20240725-0409-8e4df801.1 ([commit](https://github.com/microsoft/fluentai/commit/5142a000ea6c61ae4506bb5329e022852f3341e6) by beachball)
17
+ - Bump @fluentui-copilot/tokens to v0.0.0-nightly-20240725-0409-8e4df801.1 ([commit](https://github.com/microsoft/fluentai/commit/5142a000ea6c61ae4506bb5329e022852f3341e6) by beachball)
18
18
 
19
19
  ## [0.9.6](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.6)
20
20
 
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';
3
- import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
3
+ import { Dismiss20Regular } from '@fluentui/react-icons';
4
4
  import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
5
5
  /**
6
6
  * Create the state required to render Attachment.
@@ -16,7 +16,6 @@ export const useAttachment_unstable = (props, ref) => {
16
16
  children,
17
17
  imageOnly
18
18
  } = props;
19
- const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
20
19
  const {
21
20
  onAttachmentDismiss,
22
21
  shouldUseOverflow
@@ -57,7 +56,7 @@ export const useAttachment_unstable = (props, ref) => {
57
56
  });
58
57
  const dismissIcon = slot.always(props.dismissIcon, {
59
58
  defaultProps: {
60
- children: /*#__PURE__*/React.createElement(DismissIcon, null)
59
+ children: /*#__PURE__*/React.createElement(Dismiss20Regular, null)
61
60
  },
62
61
  elementType: 'span'
63
62
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <DismissIcon />,\n },\n elementType: 'span',\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 const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","ProgressBar","getIntrinsicElementProps","mergeCallbacks","slot","useId","Dismiss20Regular","Dismiss20Filled","bundleIcon","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","DismissIcon","onAttachmentDismiss","shouldUseOverflow","context","attachmentId","id","isLoading","progress","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","media","optional","dismissIcon","shape","thickness","state","components","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAChH,SAASC,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,QAAQ,wBAAwB;AACtF,SAASC,iCAAiC,QAAQ,uCAAuC;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGH;IAChC,MAAMI,cAAcP,WAAWD,iBAAiBD;IAChD,MAAM,EAAEU,mBAAmB,EAAEC,iBAAiB,EAAE,GA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sB;QACAG;QACAC;QACAK;QACAD;QACAG;QACAZ;QACAR;QACAO;QACAJ;IACF;IAEA,IAAIoB,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
1
+ {"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <Dismiss20Regular />,\n },\n elementType: 'span',\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 const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","ProgressBar","getIntrinsicElementProps","mergeCallbacks","slot","useId","Dismiss20Regular","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","onAttachmentDismiss","shouldUseOverflow","context","attachmentId","id","isLoading","progress","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","media","optional","dismissIcon","shape","thickness","state","components","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAChH,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,iCAAiC,QAAQ,uCAAuC;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGH;IAChC,MAAM,EAAEI,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGP,kCAAkCQ,CAAAA,UAAWA;IAChG,MAAMC,eAAeX,MAAM,eAAeI,MAAMQ,EAAE;IAClD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IoB,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
@@ -15,7 +15,6 @@ const _reacticons = require("@fluentui/react-icons");
15
15
  const _attachmentListContext = require("../../contexts/attachmentListContext");
16
16
  const useAttachment_unstable = (props, ref)=>{
17
17
  const { children, imageOnly } = props;
18
- const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
19
18
  const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
20
19
  const attachmentId = (0, _reactcomponents.useId)('attachment-', props.id);
21
20
  const isLoading = !!props.progress;
@@ -53,7 +52,7 @@ const useAttachment_unstable = (props, ref)=>{
53
52
  });
54
53
  const dismissIcon = _reactcomponents.slot.always(props.dismissIcon, {
55
54
  defaultProps: {
56
- children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
55
+ children: /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null)
57
56
  },
58
57
  elementType: 'span'
59
58
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <DismissIcon />,\n },\n elementType: 'span',\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 const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["children","props","onAttachmentDismiss","imageOnly","attachmentId","DismissIcon","always","getIntrinsicElementProps","ref","useAttachmentListContext_unstable","context","elementType","useId","id","isLoading","progress","root","primaryAction","slot","content","media","optional","onClick","ev","defaultProps","dismissIcon","shape","thickness","React","createElement","components","dismissButton"],"rangeMappings":";;;;;;;;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AA;;qBAEb;;UAEFU,WAAAG,qBAAA,CAAAG,QAAA,CAAApB,MAAAc,QAAA,EAAA;QAEAS,cAA+B;mBACzBpB;uBACJ0B;+BACQ7B,MAAAY,EAAA;;qBAENkB,4BAAe;;kBAEfZ;;oBAEAJ;kBACF;2BAEAC;2BACAC;mBACAc;qBACAX;yBACAD;sBACAM,4BAAAA;;;;;QAKFL;QAEAD;;QAEAJ;QAEAZ;QACAW"}
1
+ {"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <Dismiss20Regular />,\n },\n elementType: 'span',\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 const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["children","props","attachmentId","imageOnly","isLoading","ref","useAttachmentListContext_unstable","context","elementType","useId","id","progress","root","primaryAction","slot","always","onAttachmentDismiss","content","media","optional","onClick","ev","defaultProps","dismissIcon","shape","thickness","React","createElement","Dismiss20Regular","components","dismissButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBUA;;;eAAAA;;;;iEAhBa;iCAC4D;4BAClD;uCACiB;AAahD,MAAQA,yBAAwBC,CAAAA,OAAAA;UAChC,EACAD,QAAME,EACNC,SAAMC,KAENH;UAEII,qBACQ,mBACJH,KACNI,IAAAA,wDACA,EAAAC,CAAAA,UAAAA;UAAEC,eAAaC,IAAAA,sBAAA,EAAA,eAAAR,MAAAS,EAAA;UAAMN,YAAA,CAAA,CAAAH,MAAAU,QAAA;UAGvBC,OAAMC,qBAAAA,CAAAA,MAAgBC,CAAAA,IAAAA,yCAAkBD,EAAAA,OAAe;;QAEvD,GAAAZ,KAAA;QAEAS,IAAAR;;qBACkB;;UAChBM,gBAAaM,qBAAA,CAAAC,MAAA,CAAAd,MAAAY,aAAA,EAAA;QACfL,aAAA;;UAKIQ,gBAAAA,qBAAAA,CAAAA,MAAAA,CAAAA,MAAAA,aAAAA,EAAAA;sBAA4BC;0BAAmBC;;qBAAwB;;kBAIrEA,OAAaC,GAAAA,IAAAA,+BAAeD,EAAAA,cAAOE,OAAA,EAAAC,CAAAA;gCAAe,QAAAL,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAK,IAAA;YAAOJ,SAAAjB;YAE/DkB;gBACEI;;;UAGAd,QAAAA,qBAAAA,CAAaW,QAAA,CAAAlB,MAAAiB,KAAA,EAAA;QACfV,aAAA;;UAGEc,UAAAA,qBAAc,CAAAP,MAAA,CAAAd,MAAAgB,OAAA,EAAA;sBACZjB;sBACFC,MAAAD,QAAA;;QAEFQ,aAAA;;UAGEc,cAAcR,qBAAA,CAAAC,MAAA,CAAAd,MAAAsB,WAAA,EAAA;sBACZC;sBACAC,WAAW,GAAAC,OAAAC,aAAA,CAAAC,4BAAA,EAAA;;qBAEb;;UAEFjB,WAAAG,qBAAA,CAAAK,QAAA,CAAAlB,MAAAU,QAAA,EAAA;QAEAW,cAA+B;mBACzBpB;uBACJ2B;+BACQ5B,MAAAS,EAAA;;qBAENoB,4BAAe;;kBAEfb;;oBAEAN;kBACF;2BAEAC;2BACAC;mBACAiB;qBACAZ;yBACAD;sBACAM,4BAAAA;;;;;QAKFL;QAEAD;;QAEAN;QAEAR;QACAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-attachments",
3
- "version": "0.0.0-nightly-20240723-0406-13a39b27.1",
3
+ "version": "0.0.0-nightly-20240725-0409-8e4df801.1",
4
4
  "description": "A set of components related to attaching files in Copilot experiences.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,9 +12,9 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/react-provider": "0.0.0-nightly-20240723-0406-13a39b27.1",
16
- "@fluentui-copilot/react-utilities": "0.0.0-nightly-20240723-0406-13a39b27.1",
17
- "@fluentui-copilot/tokens": "0.0.0-nightly-20240723-0406-13a39b27.1",
15
+ "@fluentui-copilot/react-provider": "0.0.0-nightly-20240725-0409-8e4df801.1",
16
+ "@fluentui-copilot/react-utilities": "0.0.0-nightly-20240725-0409-8e4df801.1",
17
+ "@fluentui-copilot/tokens": "0.0.0-nightly-20240725-0409-8e4df801.1",
18
18
  "@swc/helpers": "^0.5.1"
19
19
  },
20
20
  "peerDependencies": {