@fluentui-copilot/react-attachments 0.10.1 → 0.10.3
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 +42 -0
- package/CHANGELOG.md +21 -1
- package/dist/index.d.ts +7 -1
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +5 -3
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.styles.js +61 -15
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib/components/AttachmentList/renderAttachmentList.js +1 -1
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +3 -3
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +3 -2
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +99 -31
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +5 -5
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Tue, 10 Dec 2024 20:20:52 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.10.3",
|
|
7
|
+
"version": "0.10.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "jiangemma@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "1510db365b4c9fca25b3222343f7835dd94cd439",
|
|
14
|
+
"comment": "feat: Add small variant"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 31 Oct 2024 17:41:08 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-attachments_v0.10.2",
|
|
22
|
+
"version": "0.10.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "jiangemma@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
28
|
+
"commit": "2d4f0c3ab9fffdea3666fa50f2a16d9d7dbadddd",
|
|
29
|
+
"comment": "fix: Fix slots that are possibly null/undefined"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "tristan.watanabe@gmail.com",
|
|
33
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
34
|
+
"commit": "0f44a6fe967de02cbfcb54cce985e46a944b945e",
|
|
35
|
+
"comment": "fix: rest, hover, and pressed state color changes to better align with v9 Tag component."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "jiangemma@microsoft.com",
|
|
39
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
40
|
+
"commit": "81a90760f46654eacd8da2d67e867f5415c18db1",
|
|
41
|
+
"comment": "chore: bump @fluentui dependencies to latest 9.55.1."
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
4
46
|
{
|
|
5
47
|
"date": "Wed, 21 Aug 2024 00:26:06 GMT",
|
|
6
48
|
"tag": "@fluentui-copilot/react-attachments_v0.10.0",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 10 Dec 2024 20:20:52 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.10.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.10.3)
|
|
8
|
+
|
|
9
|
+
Tue, 10 Dec 2024 20:20:52 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.10.2..@fluentui-copilot/react-attachments_v0.10.3)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- feat: Add small variant ([PR #2447](https://github.com/microsoft/fluentai/pull/2447) by jiangemma@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [0.10.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.10.2)
|
|
17
|
+
|
|
18
|
+
Thu, 31 Oct 2024 17:41:08 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.10.0..@fluentui-copilot/react-attachments_v0.10.2)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix: Fix slots that are possibly null/undefined ([PR #2246](https://github.com/microsoft/fluentai/pull/2246) by jiangemma@microsoft.com)
|
|
24
|
+
- fix: rest, hover, and pressed state color changes to better align with v9 Tag component. ([PR #2200](https://github.com/microsoft/fluentai/pull/2200) by tristan.watanabe@gmail.com)
|
|
25
|
+
- chore: bump @fluentui dependencies to latest 9.55.1. ([PR #2243](https://github.com/microsoft/fluentai/pull/2243) by jiangemma@microsoft.com)
|
|
26
|
+
|
|
7
27
|
## [0.10.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.10.0)
|
|
8
28
|
|
|
9
29
|
Wed, 21 Aug 2024 00:26:06 GMT
|
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,12 @@ export declare type AttachmentOverflowMenuState = MenuState & {
|
|
|
157
157
|
*/
|
|
158
158
|
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {
|
|
159
159
|
imageOnly?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* An attachment supports different sizes.
|
|
162
|
+
*
|
|
163
|
+
* @default 'medium'
|
|
164
|
+
*/
|
|
165
|
+
size?: 'small' | 'medium';
|
|
160
166
|
};
|
|
161
167
|
|
|
162
168
|
export declare type AttachmentSlots = {
|
|
@@ -172,7 +178,7 @@ export declare type AttachmentSlots = {
|
|
|
172
178
|
/**
|
|
173
179
|
* State used in rendering Attachment
|
|
174
180
|
*/
|
|
175
|
-
export declare type AttachmentState = ComponentState<AttachmentSlots> & Required<Pick<AttachmentProps, 'id'>> & Pick<AttachmentProps, 'imageOnly'> & {
|
|
181
|
+
export declare type AttachmentState = ComponentState<AttachmentSlots> & Required<Pick<AttachmentProps, 'id' | 'size'>> & Pick<AttachmentProps, 'imageOnly'> & {
|
|
176
182
|
isLoading: boolean;
|
|
177
183
|
shouldUseOverflow: boolean;
|
|
178
184
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n imageOnly?: boolean;\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"
|
|
1
|
+
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n imageOnly?: boolean;\n\n /**\n * An attachment supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id' | 'size'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA0BA;;CAEC,GACD,WAKI"}
|
|
@@ -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 } from '@fluentui/react-icons';
|
|
3
|
+
import { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';
|
|
4
4
|
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
5
|
/**
|
|
6
6
|
* Create the state required to render Attachment.
|
|
@@ -14,7 +14,8 @@ import { useAttachmentListContext_unstable } from '../../contexts/attachmentList
|
|
|
14
14
|
export const useAttachment_unstable = (props, ref) => {
|
|
15
15
|
const {
|
|
16
16
|
children,
|
|
17
|
-
imageOnly
|
|
17
|
+
imageOnly,
|
|
18
|
+
size = 'medium'
|
|
18
19
|
} = props;
|
|
19
20
|
const {
|
|
20
21
|
onAttachmentDismiss,
|
|
@@ -56,7 +57,7 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
56
57
|
});
|
|
57
58
|
const dismissIcon = slot.always(props.dismissIcon, {
|
|
58
59
|
defaultProps: {
|
|
59
|
-
children: /*#__PURE__*/React.createElement(Dismiss20Regular, null)
|
|
60
|
+
children: size === 'small' ? /*#__PURE__*/React.createElement(Dismiss12Regular, null) : /*#__PURE__*/React.createElement(Dismiss20Regular, null)
|
|
60
61
|
},
|
|
61
62
|
elementType: 'span'
|
|
62
63
|
});
|
|
@@ -70,6 +71,7 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
70
71
|
});
|
|
71
72
|
const state = {
|
|
72
73
|
id: attachmentId,
|
|
74
|
+
size,
|
|
73
75
|
components: {
|
|
74
76
|
root: 'div',
|
|
75
77
|
primaryAction: 'button',
|
|
@@ -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 } 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":"
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, 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, size = 'medium' } = 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: size === 'small' ? <Dismiss12Regular /> : <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 size,\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","Dismiss12Regular","Dismiss20Regular","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","size","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,gBAAgB,QAAQ,wBAAwB;AAC3E,SAASC,iCAAiC,QAAQ,uCAAuC;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,EAAE,GAAGJ;IACjD,MAAM,EAAEK,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGR,kCAAkCS,CAAAA,UAAWA;IAChG,MAAMC,eAAeb,MAAM,eAAeK,MAAMS,EAAE;IAClD,MAAMC,YAAY,CAAC,CAACV,MAAMW,QAAQ;IAElC,MAAMC,OAAOlB,KAAKmB,MAAM,CACtBrB,yBAAyB,OAAO;QAC9BS;QACA,GAAGD,KAA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EA,OAAOW;AACT,EAAE"}
|
|
@@ -10,11 +10,12 @@ export const attachmentClassNames = {
|
|
|
10
10
|
progress: 'fai-Attachment__progress'
|
|
11
11
|
};
|
|
12
12
|
const ATTACHMENT_MAXWIDTH = '180px';
|
|
13
|
+
const SMALL_ATTACHMENT_SIZE = '16px';
|
|
13
14
|
const ATTACHMENT_SIZE = '20px';
|
|
14
15
|
const useRootBaseClassName = __resetStyles("r16wonf3", null, [".r16wonf3{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;align-self:end;position:relative;}"]);
|
|
15
16
|
const buttonBaseStyles = {
|
|
16
17
|
alignItems: 'center',
|
|
17
|
-
backgroundColor: tokens.
|
|
18
|
+
backgroundColor: tokens.colorSubtleBackground,
|
|
18
19
|
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
|
19
20
|
borderRadius: tokens.borderRadiusMedium,
|
|
20
21
|
boxSizing: 'border-box',
|
|
@@ -30,29 +31,29 @@ const buttonBaseStyles = {
|
|
|
30
31
|
}),
|
|
31
32
|
verticalAlign: 'middle'
|
|
32
33
|
};
|
|
33
|
-
const usePrimaryActionBaseClassName = __resetStyles("
|
|
34
|
+
const usePrimaryActionBaseClassName = __resetStyles("rjo71rc", "rsix9pn", [".rjo71rc{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-right-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}", ".rjo71rc[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}", ".rsix9pn{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-left-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}", ".rsix9pn[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}"]);
|
|
34
35
|
const usePrimaryActionStyles = __styles({
|
|
35
36
|
button: {
|
|
36
37
|
eoavqd: "f8491dx",
|
|
37
|
-
Jwef8y: "
|
|
38
|
+
Jwef8y: "f1t94bn6",
|
|
38
39
|
Bi91k9c: "fnwyq0v",
|
|
39
|
-
ecr2s2: "
|
|
40
|
+
ecr2s2: "f1wfn5kd",
|
|
40
41
|
lj723h: "flvvhsy",
|
|
41
42
|
Bbkh6qg: "fkiggi6",
|
|
42
43
|
Cnge2b: "f8zknr1"
|
|
43
44
|
}
|
|
44
45
|
}, {
|
|
45
|
-
h: [".f8491dx:hover{cursor:pointer;}", ".
|
|
46
|
-
a: [".
|
|
46
|
+
h: [".f8491dx:hover{cursor:pointer;}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}"],
|
|
47
|
+
a: [".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}", ".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}"],
|
|
47
48
|
m: [["@media (forced-colors: active){.fkiggi6:hover{background-color:HighlightText;}}", {
|
|
48
49
|
m: "(forced-colors: active)"
|
|
49
50
|
}], ["@media (forced-colors: active){.f8zknr1:active{background-color:HighlightText;}}", {
|
|
50
51
|
m: "(forced-colors: active)"
|
|
51
52
|
}]]
|
|
52
53
|
});
|
|
53
|
-
const useDismissButtonBaseClassName = __resetStyles("
|
|
54
|
-
r: [".
|
|
55
|
-
s: ["@media (forced-colors: active){.
|
|
54
|
+
const useDismissButtonBaseClassName = __resetStyles("r145yi8y", "r151el6p", {
|
|
55
|
+
r: [".r145yi8y{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-left-color:var(--colorNeutralStroke1);border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-top-right-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);}", ".r145yi8y[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}", ".r145yi8y:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2BrandHover);}", ".r145yi8y:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}", ".r145yi8y:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2BrandPressed);}", ".r145yi8y:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}", ".r151el6p{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-right-color:var(--colorNeutralStroke1);border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-top-left-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);}", ".r151el6p[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}", ".r151el6p:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2BrandHover);}", ".r151el6p:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}", ".r151el6p:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2BrandPressed);}", ".r151el6p:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}"],
|
|
56
|
+
s: ["@media (forced-colors: active){.r145yi8y:hover{background-color:HighlightText;}.r145yi8y:active{background-color:HighlightText;}}", "@media (forced-colors: active){.r151el6p:hover{background-color:HighlightText;}.r151el6p:active{background-color:HighlightText;}}"]
|
|
56
57
|
});
|
|
57
58
|
const useMediaBaseClassName = __resetStyles("r1a4a4my", null, [".r1a4a4my{align-items:center;display:inline-flex;font-size:20px;height:20px;line-height:20px;width:20px;}"]);
|
|
58
59
|
const useContentBaseClassName = __resetStyles("rmt99gk", null, [".rmt99gk{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}"]);
|
|
@@ -81,6 +82,49 @@ export const useOverflowStyles = __styles({
|
|
|
81
82
|
}, {
|
|
82
83
|
d: [".f6dzj5z{max-width:100%;}", ".fly5x3f{width:100%;}"]
|
|
83
84
|
});
|
|
85
|
+
const useSmallStyles = __styles({
|
|
86
|
+
primaryAction: {
|
|
87
|
+
B2u0y6b: "fyv37rf",
|
|
88
|
+
Byoj8tv: 0,
|
|
89
|
+
uwmqm3: 0,
|
|
90
|
+
z189sj: 0,
|
|
91
|
+
z8tnut: 0,
|
|
92
|
+
B0ocmuz: "f1o3rc9c"
|
|
93
|
+
},
|
|
94
|
+
media: {
|
|
95
|
+
Be2twd7: "f4ybsrx",
|
|
96
|
+
Bqenvij: "fd461yt",
|
|
97
|
+
Bg96gwp: "f104wqfl",
|
|
98
|
+
a9b677: "fjw5fx7"
|
|
99
|
+
},
|
|
100
|
+
content: {
|
|
101
|
+
Bahqtrf: "fk6fouc",
|
|
102
|
+
Be2twd7: "fy9rknc",
|
|
103
|
+
Bhrd7zp: "figsok6",
|
|
104
|
+
Bg96gwp: "fwrc4pm"
|
|
105
|
+
},
|
|
106
|
+
dismissButton: {
|
|
107
|
+
Byoj8tv: 0,
|
|
108
|
+
uwmqm3: 0,
|
|
109
|
+
z189sj: 0,
|
|
110
|
+
z8tnut: 0,
|
|
111
|
+
B0ocmuz: "fnsh2i4",
|
|
112
|
+
B2u0y6b: "fatynhj",
|
|
113
|
+
Bf4jedk: "fydhda"
|
|
114
|
+
},
|
|
115
|
+
dismissIcon: {
|
|
116
|
+
Be2twd7: "f4ybsrx",
|
|
117
|
+
Bqenvij: "fzi9ji0",
|
|
118
|
+
B2u0y6b: "f11qte0n",
|
|
119
|
+
Bf4jedk: "fy1a5sw"
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
d: [".fyv37rf{max-width:calc(180px - 16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));}", [".f1o3rc9c{padding:var(--spacingVerticalXXS) var(--spacingHorizontalSNudge) var(--spacingVerticalXXS) var(--spacingHorizontalSNudge);}", {
|
|
123
|
+
p: -1
|
|
124
|
+
}], ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".f104wqfl{line-height:16px;}", ".fjw5fx7{width:16px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", [".fnsh2i4{padding:var(--spacingVerticalXXS) var(--spacingHorizontalXXS);}", {
|
|
125
|
+
p: -1
|
|
126
|
+
}], ".fatynhj{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}", ".fydhda{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}", ".fzi9ji0{height:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));}", ".f11qte0n{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}", ".fy1a5sw{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}"]
|
|
127
|
+
});
|
|
84
128
|
/**
|
|
85
129
|
* Apply styling to the Attachment slots based on the state
|
|
86
130
|
*/
|
|
@@ -96,18 +140,20 @@ export const useAttachmentStyles_unstable = state => {
|
|
|
96
140
|
const progressBarStyles = useProgressBarStyles();
|
|
97
141
|
const primaryActionStyles = usePrimaryActionStyles();
|
|
98
142
|
const imageOnlyStyles = useImageOnlyStyles();
|
|
143
|
+
const smallStyles = useSmallStyles();
|
|
99
144
|
const {
|
|
100
145
|
imageOnly,
|
|
101
|
-
primaryAction
|
|
146
|
+
primaryAction,
|
|
147
|
+
size
|
|
102
148
|
} = state;
|
|
103
149
|
state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
104
|
-
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
105
|
-
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
150
|
+
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, size === 'small' && smallStyles.primaryAction, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
151
|
+
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, size === 'small' && smallStyles.dismissButton, state.dismissButton.className);
|
|
106
152
|
if (state.media) {
|
|
107
|
-
state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
153
|
+
state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, size === 'small' && smallStyles.media, state.media.className);
|
|
108
154
|
}
|
|
109
|
-
state.content.className = mergeClasses(attachmentClassNames.content, contentBaseClassName, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
110
|
-
state.dismissIcon.className = mergeClasses(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
155
|
+
state.content.className = mergeClasses(attachmentClassNames.content, contentBaseClassName, size === 'small' && smallStyles.content, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
156
|
+
state.dismissIcon.className = mergeClasses(attachmentClassNames.dismissIcon, dismissIconBaseClassName, size === 'small' && smallStyles.dismissIcon, state.dismissIcon.className);
|
|
111
157
|
if (state.progress) {
|
|
112
158
|
state.progress.className = mergeClasses(attachmentClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
113
159
|
const bar = slot.optional(state.progress.bar, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\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 color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\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\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const { imageOnly, primaryAction } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.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":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","slot","tokens","typographyStyles","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","button","colorNeutralBackground3Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorBrandForegroundLinkHover","colorNeutralForeground2BrandPressed","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useImageOnlyStyles","useOverflowStyles","overflow","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","progressBarStyles","primaryActionStyles","imageOnlyStyles","imageOnly","className","as","isLoading","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,o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sF,SAAS,GAAG/F,aAAaK,qBAAqBI,KAAK,EAAE+E,oBAAoBJ,MAAM3E,KAAK,CAACsF,SAAS;IAC5G;IACAX,MAAM1E,OAAO,CAACqF,SAAS,GAAG/F,aACxBK,qBAAqBK,OAAO,EAC5B+E,sBACAK,aAAaD,gBAAgBnF,OAAO,EACpC0E,MAAM1E,OAAO,CAACqF,SAAS;IAEzBX,MAAMzE,WAAW,CAACoF,SAAS,GAAG/F,aAC5BK,qBAAqBM,WAAW,EAChC+E,0BACAN,MAAMzE,WAAW,CAACoF,SAAS;IAG7B,IAAIX,MAAMxE,QAAQ,EAAE;QAClBwE,MAAMxE,QAAQ,CAACmF,SAAS,GAAG/F,aACzBK,qBAAqBO,QAAQ,EAC7B+E,kBAAkB/E,QAAQ,EAC1BwE,MAAMxE,QAAQ,CAACmF,SAAS;QAG1B,MAAMG,MAAMjG,KAAKkG,QAAQ,CAACf,MAAMxE,QAAQ,CAACsF,GAAG,EAAE;YAAEE,aAAa;YAAOC,iBAAiB;QAAK;QAC1F,IAAIH,KAAK;YACP,IAAId,MAAMxE,QAAQ,CAAC0F,KAAK,KAAKC,WAAW;gBACtCL,IAAIH,SAAS,GAAG/F,aAAa2F,kBAAkBa,wBAAwB,EAAEN,IAAIH,SAAS;YACxF,OAAO;gBACLG,IAAIH,SAAS,GAAG/F,aAAa2F,kBAAkBc,kBAAkB,EAAEP,IAAIH,SAAS;YAClF;YACAX,MAAMxE,QAAQ,CAACsF,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOd;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst SMALL_ATTACHMENT_SIZE = '16px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorSubtleBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\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\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useSmallStyles = makeStyles({\n primaryAction: {\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge} ${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge}`,\n },\n media: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: SMALL_ATTACHMENT_SIZE,\n lineHeight: SMALL_ATTACHMENT_SIZE,\n width: SMALL_ATTACHMENT_SIZE,\n },\n content: {\n ...typographyStyles.caption1,\n },\n dismissButton: {\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n },\n dismissIcon: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const smallStyles = useSmallStyles();\n const { imageOnly, primaryAction, size } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n size === 'small' && smallStyles.primaryAction,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n size === 'small' && smallStyles.dismissButton,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(\n attachmentClassNames.media,\n mediaBaseClassName,\n size === 'small' && smallStyles.media,\n state.media.className,\n );\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n size === 'small' && smallStyles.content,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n size === 'small' && smallStyles.dismissIcon,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.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":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","slot","tokens","typographyStyles","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","button","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorBrandForegroundLinkHover","colorNeutralForeground2BrandPressed","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useImageOnlyStyles","useOverflowStyles","overflow","useSmallStyles","caption1","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","progressBarStyles","primaryActionStyles","imageOnlyStyles","smallStyles","imageOnly","size","className","as","isLoading","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,oBAAoB,QAAQ,uCAAuC;AAI5E,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;IACbC,UAAU;AACZ,EAAE;AAEF,MAAMC,sBAAsB;AAC5B,MAAMC,wBAAwB;AAC9B,MAAMC,kB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|
18
18
|
return /*#__PURE__*/_jsx(AttachmentListProvider, {
|
|
19
19
|
value: contextValues.attachmentList,
|
|
20
|
-
children: shouldUseOverflow ? /*#__PURE__*/_jsx(Overflow, {
|
|
20
|
+
children: shouldUseOverflow && state.overflowMenuButton ? /*#__PURE__*/_jsx(Overflow, {
|
|
21
21
|
ref: root.ref,
|
|
22
22
|
children: /*#__PURE__*/_jsxs(state.root, {
|
|
23
23
|
children: [root.children, /*#__PURE__*/_jsxs(AttachmentOverflowMenu, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { attachments, overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <MenuPopover>\n <MenuList>\n {attachments.map(attachment => {\n return <AttachmentOverflowMenuItem {...attachment} key={attachment.id} />;\n })}\n </MenuList>\n </MenuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["MenuList","MenuPopover","Overflow","assertSlots","AttachmentListProvider","AttachmentOverflowMenu","AttachmentOverflowMenuItem","renderAttachmentList_unstable","state","contextValues","attachments","overflowMenuProps","root","shouldUseOverflow","value","attachmentList","ref","children","positioning","
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { attachments, overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow && state.overflowMenuButton ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <MenuPopover>\n <MenuList>\n {attachments.map(attachment => {\n return <AttachmentOverflowMenuItem {...attachment} key={attachment.id} />;\n })}\n </MenuList>\n </MenuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["MenuList","MenuPopover","Overflow","assertSlots","AttachmentListProvider","AttachmentOverflowMenu","AttachmentOverflowMenuItem","renderAttachmentList_unstable","state","contextValues","attachments","overflowMenuProps","root","shouldUseOverflow","value","attachmentList","overflowMenuButton","ref","children","positioning","map","attachment","key","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;;AAEjD,SAASA,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,6BAA6B;AAC1F,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,0BAA0B,QAAQ,gCAAgC;AAG3E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAN,YAAiCK;IACjC,MAAM,EAAEE,WAAW,EAAEC,iBAAiB,EAAEC,IAAI,EAAEC,iBAAiB,EAAE,GAAGL;IAEpE,qBACE,KAACJ;QAAuBU,OAAOL,cAAcM,cAAc;kBACxDF,qBAAqBL,MAAMQ,kBAAkB,iBAC5C,KAACd;YAASe,KAAKL,KAAKK,GAAG;sBACrB,cAAA,MAACT,MAAMI,IAAI;;oBACRA,KAAKM,QAAQ;kCACd,MAACb;wBAAuBc,aAAa;wBAAU,GAAGR,iBAAiB;;0CACjE,KAACH,MAAMQ,kBAAkB;0CACzB,KAACf;0CACC,cAAA,KAACD;8CACEU,YAAYU,GAAG,CAACC,CAAAA;wCACf,qBAAO,eAACf;4CAA4B,GAAGe,UAAU;4CAAEC,KAAKD,WAAWE,EAAE;;oCACvE;;;;;;;2BAOV,KAACf,MAAMI,IAAI;;AAInB,EAAE"}
|
package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js
CHANGED
|
@@ -4,9 +4,9 @@ export const attachmentOverflowMenuButtonClassNames = {
|
|
|
4
4
|
root: 'fai-AttachmentOverflowMenuButton',
|
|
5
5
|
progress: 'fai-AttachmentOverflowMenuButton__progress'
|
|
6
6
|
};
|
|
7
|
-
const useRootBaseClassName = __resetStyles("
|
|
8
|
-
r: [".
|
|
9
|
-
s: ["@media (forced-colors: active){.
|
|
7
|
+
const useRootBaseClassName = __resetStyles("r1o7ejxu", null, {
|
|
8
|
+
r: [".r1o7ejxu{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorSubtleBackground);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(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;position:relative;}", ".r1o7ejxu:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2Hover);}", ".r1o7ejxu:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2Pressed);}"],
|
|
9
|
+
s: ["@media (forced-colors: active){.r1o7ejxu:hover{background-color:HighlightText;}.r1o7ejxu:active{background-color:HighlightText;}}"]
|
|
10
10
|
});
|
|
11
11
|
/**
|
|
12
12
|
* Apply styling to the AttachmentOverflowMenuButton slots based on the state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, slot, tokens, typographyStyles } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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.
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, slot, tokens, typographyStyles } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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.colorSubtleBackground,\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.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n verticalAlign: 'middle',\n position: 'relative',\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\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 'use no memo';\n\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":["makeResetStyles","mergeClasses","slot","tokens","typographyStyles","useProgressBarStyles","attachmentOverflowMenuButtonClassNames","root","progress","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalXS","spacingHorizontalS","verticalAlign","position","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useAttachmentOverflowMenuButtonStyles_unstable","state","rootBaseClassName","progressBarStyles","className","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAC3G,SAASC,oBAAoB,QAAQ,uCAAuC;AAO5E,OAAO,MAAMC,yCAA4F;IACvGC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3CU,OAAOP,OAAOQ,uBAAuB;IACrCC,YAAY;IACZC,iBAAiBV,OAAOW,qBAAqB;IAC7CC,QAAQ,CAAC,EAAEZ,OAAOa,eAAe,CAAC,OAAO,EAAEb,OAAOc,mBAAmB,CAAC,CAAC;IACvEC,cAAcf,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AAID,SAAS,GAAG3C,aAAa0C,kBAAkBQ,wBAAwB,EAAEN,IAAID,SAAS;YACxF,OAAO;gBACLC,IAAID,SAAS,GAAG3C,aAAa0C,kBAAkBS,kBAAkB,EAAEP,IAAID,SAAS;YAClF;YACAH,MAAMjC,QAAQ,CAACqC,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOJ;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n imageOnly?: boolean;\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"
|
|
1
|
+
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n imageOnly?: boolean;\n\n /**\n * An attachment supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id' | 'size'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA0BA;;CAEC"}
|
|
@@ -14,7 +14,7 @@ const _reactcomponents = require("@fluentui/react-components");
|
|
|
14
14
|
const _reacticons = require("@fluentui/react-icons");
|
|
15
15
|
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
16
16
|
const useAttachment_unstable = (props, ref)=>{
|
|
17
|
-
const { children, imageOnly } = props;
|
|
17
|
+
const { children, imageOnly, size = 'medium' } = props;
|
|
18
18
|
const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
|
|
19
19
|
const attachmentId = (0, _reactcomponents.useId)('attachment-', props.id);
|
|
20
20
|
const isLoading = !!props.progress;
|
|
@@ -52,7 +52,7 @@ const useAttachment_unstable = (props, ref)=>{
|
|
|
52
52
|
});
|
|
53
53
|
const dismissIcon = _reactcomponents.slot.always(props.dismissIcon, {
|
|
54
54
|
defaultProps: {
|
|
55
|
-
children: /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null)
|
|
55
|
+
children: size === 'small' ? /*#__PURE__*/ _react.createElement(_reacticons.Dismiss12Regular, null) : /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null)
|
|
56
56
|
},
|
|
57
57
|
elementType: 'span'
|
|
58
58
|
});
|
|
@@ -66,6 +66,7 @@ const useAttachment_unstable = (props, ref)=>{
|
|
|
66
66
|
});
|
|
67
67
|
const state = {
|
|
68
68
|
id: attachmentId,
|
|
69
|
+
size,
|
|
69
70
|
components: {
|
|
70
71
|
root: 'div',
|
|
71
72
|
primaryAction: 'button',
|
|
@@ -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 } 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","
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, 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, size = 'medium' } = 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: size === 'small' ? <Dismiss12Regular /> : <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 size,\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","size","ref","attachmentId","imageOnly","isLoading","root","slot","shouldUseOverflow","context","useId","props","id","primaryAction","always","elementType","getIntrinsicElementProps","dismissButton","defaultProps","media","mergeCallbacks","onClick","ev","onAttachmentDismiss","content","optional","dismissIcon","progress","thickness","React","createElement","Dismiss12Regular","Dismiss20Regular","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBUA;;;eAAAA;;;;iEAhBa;iCAC4D;4BAChC;uCACD;AAahD,MAAQA,yBAAqBC,CAAAA,OAAOC;UACpC,EACAF,QAAMG,EACNC,SAAMC,EAENJ,OAAMK,QAAOC;UAGT,qBACIJ,EACNK,iBACA,iEAAe,EAAAC,CAAAA,UAAAA;UAAMN,eAAAO,IAAAA,sBAAA,EAAA,eAAAC,MAAAC,EAAA;UAGvBP,YAAMQ,CAAAA,CAAAA,MAAgBN,QAAKO;UACzBC,OAAAA,qBAAAA,CAAAA,MA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';
|
|
34
35
|
const ATTACHMENT_SIZE = '20px';
|
|
35
36
|
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r16wonf3", null, [
|
|
36
37
|
".r16wonf3{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;align-self:end;position:relative;}"
|
|
37
38
|
]);
|
|
38
39
|
const buttonBaseStyles = {
|
|
39
40
|
alignItems: 'center',
|
|
40
|
-
backgroundColor: _reactcomponents.tokens.
|
|
41
|
+
backgroundColor: _reactcomponents.tokens.colorSubtleBackground,
|
|
41
42
|
border: `${_reactcomponents.tokens.strokeWidthThin} solid ${_reactcomponents.tokens.colorNeutralStroke1}`,
|
|
42
43
|
borderRadius: _reactcomponents.tokens.borderRadiusMedium,
|
|
43
44
|
boxSizing: 'border-box',
|
|
@@ -53,18 +54,18 @@ const buttonBaseStyles = {
|
|
|
53
54
|
}),
|
|
54
55
|
verticalAlign: 'middle'
|
|
55
56
|
};
|
|
56
|
-
const usePrimaryActionBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
57
|
-
".
|
|
58
|
-
".
|
|
59
|
-
".
|
|
60
|
-
".
|
|
57
|
+
const usePrimaryActionBaseClassName = (0, _reactcomponents.__resetStyles)("rjo71rc", "rsix9pn", [
|
|
58
|
+
".rjo71rc{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-right-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}",
|
|
59
|
+
".rjo71rc[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}",
|
|
60
|
+
".rsix9pn{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-left-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}",
|
|
61
|
+
".rsix9pn[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}"
|
|
61
62
|
]);
|
|
62
63
|
const usePrimaryActionStyles = (0, _reactcomponents.__styles)({
|
|
63
64
|
button: {
|
|
64
65
|
eoavqd: "f8491dx",
|
|
65
|
-
Jwef8y: "
|
|
66
|
+
Jwef8y: "f1t94bn6",
|
|
66
67
|
Bi91k9c: "fnwyq0v",
|
|
67
|
-
ecr2s2: "
|
|
68
|
+
ecr2s2: "f1wfn5kd",
|
|
68
69
|
lj723h: "flvvhsy",
|
|
69
70
|
Bbkh6qg: "fkiggi6",
|
|
70
71
|
Cnge2b: "f8zknr1"
|
|
@@ -72,11 +73,11 @@ const usePrimaryActionStyles = (0, _reactcomponents.__styles)({
|
|
|
72
73
|
}, {
|
|
73
74
|
h: [
|
|
74
75
|
".f8491dx:hover{cursor:pointer;}",
|
|
75
|
-
".
|
|
76
|
+
".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}",
|
|
76
77
|
".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}"
|
|
77
78
|
],
|
|
78
79
|
a: [
|
|
79
|
-
".
|
|
80
|
+
".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}",
|
|
80
81
|
".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}"
|
|
81
82
|
],
|
|
82
83
|
m: [
|
|
@@ -94,24 +95,24 @@ const usePrimaryActionStyles = (0, _reactcomponents.__styles)({
|
|
|
94
95
|
]
|
|
95
96
|
]
|
|
96
97
|
});
|
|
97
|
-
const useDismissButtonBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
98
|
+
const useDismissButtonBaseClassName = (0, _reactcomponents.__resetStyles)("r145yi8y", "r151el6p", {
|
|
98
99
|
r: [
|
|
99
|
-
".
|
|
100
|
-
".
|
|
101
|
-
".
|
|
102
|
-
".
|
|
103
|
-
".
|
|
104
|
-
".
|
|
105
|
-
".
|
|
106
|
-
".
|
|
107
|
-
".
|
|
108
|
-
".
|
|
109
|
-
".
|
|
110
|
-
".
|
|
100
|
+
".r145yi8y{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-left-color:var(--colorNeutralStroke1);border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-top-right-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
101
|
+
".r145yi8y[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}",
|
|
102
|
+
".r145yi8y:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
103
|
+
".r145yi8y:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
104
|
+
".r145yi8y:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
105
|
+
".r145yi8y:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}",
|
|
106
|
+
".r151el6p{align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-right-color:var(--colorNeutralStroke1);border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-top-left-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
107
|
+
".r151el6p[data-fui-focus-visible]{outline:var(--strokeWidthThick) solid var(--colorStrokeFocus2);z-index:1;}",
|
|
108
|
+
".r151el6p:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
109
|
+
".r151el6p:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
110
|
+
".r151el6p:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
111
|
+
".r151el6p:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}"
|
|
111
112
|
],
|
|
112
113
|
s: [
|
|
113
|
-
"@media (forced-colors: active){.
|
|
114
|
-
"@media (forced-colors: active){.
|
|
114
|
+
"@media (forced-colors: active){.r145yi8y:hover{background-color:HighlightText;}.r145yi8y:active{background-color:HighlightText;}}",
|
|
115
|
+
"@media (forced-colors: active){.r151el6p:hover{background-color:HighlightText;}.r151el6p:active{background-color:HighlightText;}}"
|
|
115
116
|
]
|
|
116
117
|
});
|
|
117
118
|
const useMediaBaseClassName = (0, _reactcomponents.__resetStyles)("r1a4a4my", null, [
|
|
@@ -156,6 +157,72 @@ const useOverflowStyles = (0, _reactcomponents.__styles)({
|
|
|
156
157
|
".fly5x3f{width:100%;}"
|
|
157
158
|
]
|
|
158
159
|
});
|
|
160
|
+
const useSmallStyles = (0, _reactcomponents.__styles)({
|
|
161
|
+
primaryAction: {
|
|
162
|
+
B2u0y6b: "fyv37rf",
|
|
163
|
+
Byoj8tv: 0,
|
|
164
|
+
uwmqm3: 0,
|
|
165
|
+
z189sj: 0,
|
|
166
|
+
z8tnut: 0,
|
|
167
|
+
B0ocmuz: "f1o3rc9c"
|
|
168
|
+
},
|
|
169
|
+
media: {
|
|
170
|
+
Be2twd7: "f4ybsrx",
|
|
171
|
+
Bqenvij: "fd461yt",
|
|
172
|
+
Bg96gwp: "f104wqfl",
|
|
173
|
+
a9b677: "fjw5fx7"
|
|
174
|
+
},
|
|
175
|
+
content: {
|
|
176
|
+
Bahqtrf: "fk6fouc",
|
|
177
|
+
Be2twd7: "fy9rknc",
|
|
178
|
+
Bhrd7zp: "figsok6",
|
|
179
|
+
Bg96gwp: "fwrc4pm"
|
|
180
|
+
},
|
|
181
|
+
dismissButton: {
|
|
182
|
+
Byoj8tv: 0,
|
|
183
|
+
uwmqm3: 0,
|
|
184
|
+
z189sj: 0,
|
|
185
|
+
z8tnut: 0,
|
|
186
|
+
B0ocmuz: "fnsh2i4",
|
|
187
|
+
B2u0y6b: "fatynhj",
|
|
188
|
+
Bf4jedk: "fydhda"
|
|
189
|
+
},
|
|
190
|
+
dismissIcon: {
|
|
191
|
+
Be2twd7: "f4ybsrx",
|
|
192
|
+
Bqenvij: "fzi9ji0",
|
|
193
|
+
B2u0y6b: "f11qte0n",
|
|
194
|
+
Bf4jedk: "fy1a5sw"
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
d: [
|
|
198
|
+
".fyv37rf{max-width:calc(180px - 16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));}",
|
|
199
|
+
[
|
|
200
|
+
".f1o3rc9c{padding:var(--spacingVerticalXXS) var(--spacingHorizontalSNudge) var(--spacingVerticalXXS) var(--spacingHorizontalSNudge);}",
|
|
201
|
+
{
|
|
202
|
+
p: -1
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
".f4ybsrx{font-size:16px;}",
|
|
206
|
+
".fd461yt{height:16px;}",
|
|
207
|
+
".f104wqfl{line-height:16px;}",
|
|
208
|
+
".fjw5fx7{width:16px;}",
|
|
209
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
210
|
+
".fy9rknc{font-size:var(--fontSizeBase200);}",
|
|
211
|
+
".figsok6{font-weight:var(--fontWeightRegular);}",
|
|
212
|
+
".fwrc4pm{line-height:var(--lineHeightBase200);}",
|
|
213
|
+
[
|
|
214
|
+
".fnsh2i4{padding:var(--spacingVerticalXXS) var(--spacingHorizontalXXS);}",
|
|
215
|
+
{
|
|
216
|
+
p: -1
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
".fatynhj{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}",
|
|
220
|
+
".fydhda{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}",
|
|
221
|
+
".fzi9ji0{height:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));}",
|
|
222
|
+
".f11qte0n{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}",
|
|
223
|
+
".fy1a5sw{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}"
|
|
224
|
+
]
|
|
225
|
+
});
|
|
159
226
|
const useAttachmentStyles_unstable = (state)=>{
|
|
160
227
|
'use no memo';
|
|
161
228
|
const rootBaseClassName = useRootBaseClassName();
|
|
@@ -167,15 +234,16 @@ const useAttachmentStyles_unstable = (state)=>{
|
|
|
167
234
|
const progressBarStyles = (0, _useProgressBarStylesstyles.useProgressBarStyles)();
|
|
168
235
|
const primaryActionStyles = usePrimaryActionStyles();
|
|
169
236
|
const imageOnlyStyles = useImageOnlyStyles();
|
|
170
|
-
const
|
|
237
|
+
const smallStyles = useSmallStyles();
|
|
238
|
+
const { imageOnly, primaryAction, size } = state;
|
|
171
239
|
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
172
|
-
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
173
|
-
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
240
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.primaryAction, primaryActionBaseClassName, size === 'small' && smallStyles.primaryAction, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
241
|
+
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissButton, dismissButtonBaseClassName, size === 'small' && smallStyles.dismissButton, state.dismissButton.className);
|
|
174
242
|
if (state.media) {
|
|
175
|
-
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
243
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.media, mediaBaseClassName, size === 'small' && smallStyles.media, state.media.className);
|
|
176
244
|
}
|
|
177
|
-
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.content, contentBaseClassName, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
178
|
-
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
245
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.content, contentBaseClassName, size === 'small' && smallStyles.content, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
246
|
+
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissIcon, dismissIconBaseClassName, size === 'small' && smallStyles.dismissIcon, state.dismissIcon.className);
|
|
179
247
|
if (state.progress) {
|
|
180
248
|
state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
181
249
|
const bar = _reactcomponents.slot.optional(state.progress.bar, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\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 color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\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\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const { imageOnly, primaryAction } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.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":["attachmentClassNames","useAttachmentStyles_unstable","borderLeftColor","colorNeutralStroke1","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","makeResetStyles","display","tokens","colorNeutralBackground1","boxSizing","strokeWidthThin","borderRadiusMedium","alignSelf","position","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","buttonBaseStyles","alignItems","backgroundColor","borderRadius","strokeWidthThick","colorStrokeFocus2","columnGap","flexWrap","__resetStyles","justifyContent","__styles","createCustomFocusIndicatorStyle","outline","zIndex","Bi91k9c","verticalAlign","lj723h","Bbkh6qg","usePrimaryActionBaseClassName","Cnge2b","borderRightStyle","maxWidth","spacingHorizontalXS","padding","spacingVerticalXS","m","usePrimaryActionStyles","button","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","colorNeutralForeground2Pressed","Bg96gwp","minWidth","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","state","colorNeutralForeground2BrandPressed","dismissButtonBaseClassName","useDismissButtonBaseClassName","mediaBaseClassName","useMediaBaseClassName","contentBaseClassName","colorNeutralForeground2BrandHover","progressBarStyles","useProgressBarStyles","primaryActionStyles","imageOnlyStyles","useImageOnlyStyles","rootBaseClassName","className","mergeClasses","primaryActionBaseClassName","as","isLoading","imageOnly","fontSize","height","lineHeight","width","elementType","useContentBaseClassName","overflowX","textOverflow","whiteSpace","value","undefined","typographyStyles","body1","indeterminateProgressBar","bar","useDismissIconBaseClassName","regularProgressBar","borderRadiusCircular","border"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAaaA,oBAAAA;eAAAA;;IA8FTC,4BAAA;eAAAA;;IAbFC,iBAAwBC;eAAxBD;;;iCAvFgB;4CAEmB;AAI9B,MAAMF,uBAAwD;UACnEI;mBACAC;mBACAC;WACAC;aACAC;iBACAC;cACAC;AACF;AAEA,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AAExB,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;CAAA;MAC3CC,mBAAS;gBACC;qBACKC,uBAAA,CAAAC,uBAAA;YACfC,CAAAA,EAAAA,uBAAW,CAAAC,eAAA,CAAA,OAAA,EAAAH,uBAAA,CAAAb,mBAAA,CAAA,CAAA;kBACJa,uBAAA,CAAAI,kBAAA;eACPC;eACAC,uBAAU,CAAAC,uBAAA;IACZC,OAAAR,uBAAA,CAAAS,uBAAA;IAEAC,QAAMC;aACJC;cACAC;oBACWb;OACXc,IAAAA,gDAAqBV,EAAAA;QACrBF,SAAAA,CAAAA,EAAWF,uBAAA,CAAAe,gBAAA,CAAA,OAAA,EAAAf,uBAAA,CAAAgB,iBAAA,CAAA,CAAA;QACXC,QAAAA;MACAT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K,EAAAxB,kBAAAyB,wBAAA,EAAAC,IAAApB,SAAA;YAC3B,OAAA;gBAEMqB,IAAAA,SAAAA,GAAAA,IAAAA,6BAA8BpF,EAAAA,kBAAgBqF,kBAAA,EAAAF,IAAApB,SAAA;YAClDjD;YACAE,MAAAA,QAAcd,CAAAA,GAAAA,GAAOoF;QACrBC;;WAEA7E;yDAEUZ"}
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst SMALL_ATTACHMENT_SIZE = '16px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorSubtleBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\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\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useSmallStyles = makeStyles({\n primaryAction: {\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge} ${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge}`,\n },\n media: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: SMALL_ATTACHMENT_SIZE,\n lineHeight: SMALL_ATTACHMENT_SIZE,\n width: SMALL_ATTACHMENT_SIZE,\n },\n content: {\n ...typographyStyles.caption1,\n },\n dismissButton: {\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n },\n dismissIcon: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const smallStyles = useSmallStyles();\n const { imageOnly, primaryAction, size } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n size === 'small' && smallStyles.primaryAction,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n size === 'small' && smallStyles.dismissButton,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(\n attachmentClassNames.media,\n mediaBaseClassName,\n size === 'small' && smallStyles.media,\n state.media.className,\n );\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n size === 'small' && smallStyles.content,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n size === 'small' && smallStyles.dismissIcon,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.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":["attachmentClassNames","justifyContent","borderLeftColor","colorNeutralStroke1","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","makeResetStyles","display","tokens","colorSubtleBackground","boxSizing","strokeWidthThin","borderRadiusMedium","alignSelf","position","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","buttonBaseStyles","alignItems","backgroundColor","borderRadius","strokeWidthThick","colorStrokeFocus2","columnGap","flexWrap","__resetStyles","__styles","createCustomFocusIndicatorStyle","outline","zIndex","Bi91k9c","verticalAlign","lj723h","Bbkh6qg","usePrimaryActionBaseClassName","Cnge2b","borderRightStyle","maxWidth","spacingHorizontalXS","padding","spacingVerticalXS","m","usePrimaryActionStyles","button","colorSubtleBackgroundHover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","Bg96gwp","minWidth","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","colorNeutralForeground2BrandHover","uwmqm3","z189sj","a9b677","Byoj8tv","useMediaBaseClassName","fontSize","height","lineHeight","Be2twd7","useContentBaseClassName","overflowX","textOverflow","whiteSpace","d","useDismissIconBaseClassName","borderRadiusCircular","border","state","spacingVerticalXXS","primaryActionBaseClassName","useImageOnlyStyles","makeStyles","dismissIconBaseClassName","useProgressBarStyles","imageOnlyStyles","smallStyles","useSmallStyles","overflow","width","className","mergeClasses","rootBaseClassName","size","as","isLoading","primaryActionStyles","imageOnly","dismissButtonBaseClassName","contentBaseClassName","elementType","bar","value","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAAA,WAAAA,EAAAA,MAAAA,WAAAA,CAAAA,SAAAA;cACV0D,QAAQ1D,EAAAA;cACR2D,QAAAA,CAAAA,SAAY3D,GAAAA,IAAAA,6BAAAA,EAAAA,qBAAAA,QAAAA,EAAAA,kBAAAA,QAAAA,EAAAA,MAAAA,QAAAA,CAAAA,SAAAA;cACZgF,MAAOhF,qBAAAA,CAAAA,QAAAA,CAAAA,MAAAA,QAAAA,CAAAA,GAAAA,EAAAA;YACT2F,aAAA;YACA/F,iBAAS;;QAET,IAAAgG,KAAA;YACAlG,IAAAA,MAAAA,QAAe,CAAAmG,KAAA,KAAAC,WAAA;gBACbxD,IAAAA,SAAYjC,GAAAA,IAAAA,6BAAOiE,EAAAA,kBAAsBjE,wBAA6B,EAAAuF,IAAAX,SAAA;mBACtE7C;gBACAW,IAAAA,SAAW,GAAKmC,IAAAA,6BAAElF,EAAAA,kBAA2BK,kBAAOG,EAAeoF,IAACX,SAAS5E;YAC/E;YACAR,MAAAA,QAAa,CAAA+F,GAAA,GAAAA;;;WAGXxD;yDAEF"}
|
|
@@ -19,7 +19,7 @@ const renderAttachmentList_unstable = (state, contextValues)=>{
|
|
|
19
19
|
const { attachments, overflowMenuProps, root, shouldUseOverflow } = state;
|
|
20
20
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_attachmentListContext.AttachmentListProvider, {
|
|
21
21
|
value: contextValues.attachmentList,
|
|
22
|
-
children: shouldUseOverflow ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.Overflow, {
|
|
22
|
+
children: shouldUseOverflow && state.overflowMenuButton ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.Overflow, {
|
|
23
23
|
ref: root.ref,
|
|
24
24
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
25
25
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { attachments, overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <MenuPopover>\n <MenuList>\n {attachments.map(attachment => {\n return <AttachmentOverflowMenuItem {...attachment} key={attachment.id} />;\n })}\n </MenuList>\n </MenuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["assertSlots","state","attachments","contextValues","shouldUseOverflow","root","children","positioning","
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { attachments, overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow && state.overflowMenuButton ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <MenuPopover>\n <MenuList>\n {attachments.map(attachment => {\n return <AttachmentOverflowMenuItem {...attachment} key={attachment.id} />;\n })}\n </MenuList>\n </MenuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["assertSlots","state","attachments","contextValues","shouldUseOverflow","root","children","positioning","overflowMenuButton","_jsx","Overflow","attachment","MenuList"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBEA;;;eAAAA;;;4BAfF;;iCAE6D;uCACtB;wCACA;4CACI;AAUzCA,MAAAA,gCAAiCC,CAAAA,OAAAA;oCACzBC,EAAAA;UAER,aACiCC,mBAC5BC;sBAGMC,GAAAA,IAAAA,eAAKC,EAAAA,6CAAQ,EAAA;2CACd;uCAAwBC,MAAaC,kBAAA,GAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAC,yBAAA,EAAA;;;;;+BACnC,GAACT,IAAAA,gBAAAA,EAAMO,8CAAkB,EAAA;;;;uFAGJG,EAAAA,CAAAA;4BAAAA,WAAAA,GAAAA,IAAAA,eAAAA,EAAAA,4BAAAA,EAAAA;6EACfC,yBAAA,EAAA;;+FAAwDD,EAAAA,sDAAa,EAAA;;8DACvE;;;;;;;;;gDAOVV,MAACA,IAAAA,EAAMI,CAAAA;;AAIf"}
|
|
@@ -22,14 +22,14 @@ const attachmentOverflowMenuButtonClassNames = {
|
|
|
22
22
|
root: 'fai-AttachmentOverflowMenuButton',
|
|
23
23
|
progress: 'fai-AttachmentOverflowMenuButton__progress'
|
|
24
24
|
};
|
|
25
|
-
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
25
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r1o7ejxu", null, {
|
|
26
26
|
r: [
|
|
27
|
-
".
|
|
28
|
-
".
|
|
29
|
-
".
|
|
27
|
+
".r1o7ejxu{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorSubtleBackground);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(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;position:relative;}",
|
|
28
|
+
".r1o7ejxu:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2Hover);}",
|
|
29
|
+
".r1o7ejxu:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2Pressed);}"
|
|
30
30
|
],
|
|
31
31
|
s: [
|
|
32
|
-
"@media (forced-colors: active){.
|
|
32
|
+
"@media (forced-colors: active){.r1o7ejxu:hover{background-color:HighlightText;}.r1o7ejxu:active{background-color:HighlightText;}}"
|
|
33
33
|
]
|
|
34
34
|
});
|
|
35
35
|
const useAttachmentOverflowMenuButtonStyles_unstable = (state)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, slot, tokens, typographyStyles } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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.
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, slot, tokens, typographyStyles } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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.colorSubtleBackground,\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.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n verticalAlign: 'middle',\n position: 'relative',\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\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 'use no memo';\n\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","flexWrap","fontFamily","typographyStyles","fontSize","rootBaseClassName","className","fontWeight","justifyContent","mergeClasses","progressBarStyles","padding","tokens","spacingVerticalXS","verticalAlign","position","cursor","backgroundColor","colorSubtleBackgroundHover","colorNeutralForeground2Hover","indeterminateProgressBar","bar","regularProgressBar","colorNeutralForeground2Pressed"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQaA,sCAAAA;eAAAA;;IAYXC,8CAAyC;eAAzCA;;;iCApBoE;4CACjC;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;;UAGzCC,oBAAUL;UACVM,oBAAYC,IAAAA,gDAAuBD;UACnCE,IAAAA,CAAAA,SAAUD,GAAAA,IAAAA,6BAAuBC,EAAAA,uCAAQV,IAAA,EAAAW,mBAAAL,MAAAN,IAAA,CAAAY,SAAA;QACzCC,MAAAA,QAAYJ,EAAAA;QACZK,MAAAA,QAAAA,CAAAA,SAAgB,GAAAC,IAAAA,6BAAA,EAAAjB,uCAAAG,QAAA,EAAAe,kBAAAf,QAAA,EAAAK,MAAAL,QAAA,CAAAW,SAAA;QAChBK,MAAAA,MAAYC,qBAAAA,CAAAA,QAAOC,CAAAA,MAAAA,QAAqBD,CAAAA,GAAAA,EAAAA;YACxCE,aAAe;YACfC,iBAAU;QAEV;YACEC,KAAAA;gBACAC,MAAAA,QAAAA,CAAiBL,KAAAA,KAAOM,WAAAA;gBACxBpB,IAAAA,SAAOc,GAAOO,IAAAA,6BAAAA,EAAAA,kBAA4BC,wBAAA,EAAAC,IAAAf,SAAA;YAC5C,OAAA;gBACAe,IAAAf,SAAW,GAAAG,IAAAA,6BAAA,EAAAC,kBAAAY,kBAAA,EAAAD,IAAAf,SAAA;;kBAETR,QAAOc,CAAAA,GAAOW,GAAAA;QAChB;;WAEEvB;2EAEA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
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,19 +12,19 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/react-provider": "^0.9.
|
|
16
|
-
"@fluentui-copilot/react-utilities": "^0.0.
|
|
15
|
+
"@fluentui-copilot/react-provider": "^0.9.3",
|
|
16
|
+
"@fluentui-copilot/react-utilities": "^0.0.4",
|
|
17
17
|
"@fluentui-copilot/tokens": "^0.3.3",
|
|
18
18
|
"@swc/helpers": "^0.5.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@fluentui/keyboard-keys": ">=9.0.7 <10.0.0",
|
|
22
|
-
"@fluentui/react-components": ">=9.
|
|
23
|
-
"@fluentui/react-context-selector": ">=9.1.
|
|
24
|
-
"@fluentui/react-icons": ">=2.0.
|
|
25
|
-
"@fluentui/react-jsx-runtime": ">=9.0.
|
|
26
|
-
"@fluentui/react-shared-contexts": ">=9.20.
|
|
27
|
-
"@fluentui/react-utilities": ">=9.18.
|
|
22
|
+
"@fluentui/react-components": ">=9.55.1 <10.0.0",
|
|
23
|
+
"@fluentui/react-context-selector": ">=9.1.68 <10.0.0",
|
|
24
|
+
"@fluentui/react-icons": ">=2.0.260 <3.0.0",
|
|
25
|
+
"@fluentui/react-jsx-runtime": ">=9.0.45 <10.0.0",
|
|
26
|
+
"@fluentui/react-shared-contexts": ">=9.20.2 <10.0.0",
|
|
27
|
+
"@fluentui/react-utilities": ">=9.18.16 <10.0.0",
|
|
28
28
|
"@types/react": ">=16.14.0 <19.0.0",
|
|
29
29
|
"@types/react-dom": ">=16.9.8 <19.0.0",
|
|
30
30
|
"react": ">=16.14.0 <19.0.0",
|