@fluentui-copilot/react-attachments 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/index.d.ts +43 -1
- package/lib/components/AttachmentTag/useAttachmentTag.js +5 -48
- package/lib/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib/components/AttachmentTag/useAttachmentTagStyles.js +16 -4
- package/lib/components/AttachmentTag/useAttachmentTagStyles.js.map +1 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js +0 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js +1 -2
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js.map +1 -1
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js +4 -3
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js +9 -17
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.js +17 -9
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.js.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/utils/useAttachmentTagSlots.js +62 -0
- package/lib/components/utils/useAttachmentTagSlots.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js +5 -45
- package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.js +12 -0
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js +0 -2
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js +7 -2
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js +9 -16
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.js +18 -8
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -0
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js +62 -0
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js.map +1 -0
- package/lib-commonjs/index.js +16 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 14 Mar 2024 18:24:04 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.8.1",
|
|
7
|
+
"version": "0.8.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "14ce40ddbee4d35f3f4bcf03521d60715b03d59c",
|
|
14
|
+
"comment": "feat: implement AttachmentTagItem component."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 13 Mar 2024 18:01:50 GMT",
|
|
6
21
|
"tag": "@fluentui-copilot/react-attachments_v0.8.0",
|
|
7
22
|
"version": "0.8.0",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 14 Mar 2024 18:24:04 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.8.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.1)
|
|
8
|
+
|
|
9
|
+
Thu, 14 Mar 2024 18:24:04 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.0..@fluentui-copilot/react-attachments_v0.8.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- feat: implement AttachmentTagItem component. ([PR #1435](https://github.com/microsoft/fluentai/pull/1435) by tristan.watanabe@gmail.com)
|
|
15
|
+
|
|
7
16
|
## [0.8.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.0)
|
|
8
17
|
|
|
9
|
-
Wed, 13 Mar 2024 18:
|
|
18
|
+
Wed, 13 Mar 2024 18:01:50 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentai/attachments_v0.7.1..@fluentui-copilot/react-attachments_v0.8.0)
|
|
11
20
|
|
|
12
21
|
### Minor changes
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-components';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-components';
|
|
5
5
|
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
6
|
-
import * as React_2 from 'react';
|
|
6
|
+
import type * as React_2 from 'react';
|
|
7
7
|
import type { Slot } from '@fluentui/react-components';
|
|
8
8
|
import type { SlotClassNames } from '@fluentui/react-components';
|
|
9
9
|
|
|
@@ -16,6 +16,27 @@ export declare type AttachmentTagDismissedData = {
|
|
|
16
16
|
media?: AttachmentTagProps['media'];
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
export declare const AttachmentTagItem: ForwardRefComponent<AttachmentTagItemProps>;
|
|
20
|
+
|
|
21
|
+
export declare const attachmentTagItemClassNames: SlotClassNames<AttachmentTagItemSlots>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* AttachmentTagItem Props
|
|
25
|
+
*/
|
|
26
|
+
export declare type AttachmentTagItemProps = ComponentProps<Partial<AttachmentTagItemSlots>>;
|
|
27
|
+
|
|
28
|
+
export declare type AttachmentTagItemSlots = {
|
|
29
|
+
root: NonNullable<Slot<'div'>>;
|
|
30
|
+
media?: Slot<'span'>;
|
|
31
|
+
content: NonNullable<Slot<'span'>>;
|
|
32
|
+
icon: NonNullable<Slot<'span'>>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* State used in rendering AttachmentTagItem
|
|
37
|
+
*/
|
|
38
|
+
export declare type AttachmentTagItemState = ComponentState<AttachmentTagItemSlots>;
|
|
39
|
+
|
|
19
40
|
export declare const AttachmentTagList: ForwardRefComponent<AttachmentTagListProps>;
|
|
20
41
|
|
|
21
42
|
export declare const attachmentTagListClassNames: SlotClassNames<AttachmentTagListSlots>;
|
|
@@ -67,6 +88,11 @@ export declare type AttachmentTagState = ComponentState<AttachmentTagSlots>;
|
|
|
67
88
|
*/
|
|
68
89
|
export declare const renderAttachmentTag_unstable: (state: AttachmentTagState) => JSX.Element;
|
|
69
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Render the final JSX of AttachmentTagItem
|
|
93
|
+
*/
|
|
94
|
+
export declare const renderAttachmentTagItem_unstable: (state: AttachmentTagItemState) => JSX.Element;
|
|
95
|
+
|
|
70
96
|
/**
|
|
71
97
|
* Render the final JSX of AttachmentTagList
|
|
72
98
|
*/
|
|
@@ -83,6 +109,22 @@ export declare const renderAttachmentTagList_unstable: (state: AttachmentTagList
|
|
|
83
109
|
*/
|
|
84
110
|
export declare const useAttachmentTag_unstable: (props: AttachmentTagProps, ref: React_2.Ref<HTMLElement>) => AttachmentTagState;
|
|
85
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Create the state required to render AttachmentTagItem.
|
|
114
|
+
*
|
|
115
|
+
* The returned state can be modified with hooks such as useAttachmentTagItemStyles_unstable,
|
|
116
|
+
* before being passed to renderAttachmentTagItem_unstable.
|
|
117
|
+
*
|
|
118
|
+
* @param props - props from this instance of AttachmentTagItem
|
|
119
|
+
* @param ref - reference to root HTMLElement of AttachmentTagItem
|
|
120
|
+
*/
|
|
121
|
+
export declare const useAttachmentTagItem_unstable: (props: AttachmentTagItemProps, ref: React_2.Ref<HTMLElement>) => AttachmentTagItemState;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Apply styling to the AttachmentTagItem slots based on the state
|
|
125
|
+
*/
|
|
126
|
+
export declare const useAttachmentTagItemStyles_unstable: (state: AttachmentTagItemState) => AttachmentTagItemState;
|
|
127
|
+
|
|
86
128
|
/**
|
|
87
129
|
* Create the state required to render AttachmentTagList.
|
|
88
130
|
*
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
-
import { useHasParentContext } from '@fluentui/react-context-selector';
|
|
4
|
-
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
5
|
-
import { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';
|
|
6
|
-
import { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';
|
|
1
|
+
import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';
|
|
7
2
|
/**
|
|
8
3
|
* Create the state required to render AttachmentTag.
|
|
9
4
|
*
|
|
@@ -14,51 +9,13 @@ import { AttachmentTagListContext } from '../../contexts/attachmentTagListContex
|
|
|
14
9
|
* @param ref - reference to root HTMLElement of AttachmentTag
|
|
15
10
|
*/
|
|
16
11
|
export const useAttachmentTag_unstable = (props, ref) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children,
|
|
20
|
-
role
|
|
21
|
-
} = props;
|
|
22
|
-
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
23
|
-
const hasParentContext = useHasParentContext(AttachmentTagListContext);
|
|
24
|
-
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
25
|
-
const root = slot.always(getNativeElementProps('button', {
|
|
26
|
-
ref,
|
|
27
|
-
...props,
|
|
28
|
-
role: rootRole
|
|
29
|
-
}), {
|
|
30
|
-
elementType: 'button'
|
|
31
|
-
});
|
|
32
|
-
root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
33
|
-
content: children,
|
|
34
|
-
media
|
|
35
|
-
}));
|
|
36
|
-
const media = slot.optional(props.media, {
|
|
37
|
-
elementType: 'span'
|
|
38
|
-
});
|
|
39
|
-
const content = slot.always(props.content, {
|
|
40
|
-
defaultProps: {
|
|
41
|
-
children
|
|
42
|
-
},
|
|
43
|
-
elementType: 'span'
|
|
44
|
-
});
|
|
45
|
-
const icon = slot.always(props.icon, {
|
|
46
|
-
defaultProps: {
|
|
47
|
-
children: /*#__PURE__*/React.createElement(DismissIcon, null)
|
|
48
|
-
},
|
|
49
|
-
elementType: 'span'
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
components: {
|
|
12
|
+
return useAttachmentTagSlots(props, ref, {
|
|
13
|
+
elementType: {
|
|
53
14
|
root: 'button',
|
|
54
15
|
media: 'span',
|
|
55
16
|
content: 'span',
|
|
56
17
|
icon: 'span'
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
media,
|
|
60
|
-
content,
|
|
61
|
-
icon
|
|
62
|
-
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
63
20
|
};
|
|
64
21
|
//# sourceMappingURL=useAttachmentTag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import * as React from 'react';\
|
|
1
|
+
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\nimport type { AttachmentTagProps, AttachmentTagState } from './AttachmentTag.types';\n\n/**\n * Create the state required to render AttachmentTag.\n *\n * The returned state can be modified with hooks such as useAttachmentTagStyles_unstable,\n * before being passed to renderAttachmentTag_unstable.\n *\n * @param props - props from this instance of AttachmentTag\n * @param ref - reference to root HTMLElement of AttachmentTag\n */\nexport const useAttachmentTag_unstable = (\n props: AttachmentTagProps,\n ref: React.Ref<HTMLElement>,\n): AttachmentTagState => {\n return useAttachmentTagSlots(props, ref, {\n elementType: { root: 'button', media: 'span', content: 'span', icon: 'span' },\n });\n};\n"],"names":["useAttachmentTagSlots","useAttachmentTag_unstable","props","ref","elementType","root","media","content","icon"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,iCAAiC;AAGvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,OAAOH,sBAAsBE,OAAOC,KAAK;QACvCC,aAAa;YAAEC,MAAM;YAAUC,OAAO;YAAQC,SAAS;YAAQC,MAAM;QAAO;IAC9E;AACF,EAAE"}
|
|
@@ -5,12 +5,24 @@ export const attachmentTagClassNames = {
|
|
|
5
5
|
content: 'fai-AttachmentTag__content',
|
|
6
6
|
icon: 'fai-AttachmentTag__icon'
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export const ATTACHMENTTAG_MAXWIDTH = '180px';
|
|
9
12
|
const ATTACHMENTTAG_SIZE = '20px';
|
|
10
13
|
const useRootBaseClassName = __resetStyles("r1km3emv", "r21ecva", [".r1km3emv{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;}", ".r1km3emv:hover{border-color:var(--colorNeutralStroke1Hover);}", ".r1km3emv:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}", ".r1km3emv:hover:active{border-color:var(--colorNeutralStroke1Pressed);}", ".r1km3emv:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r1km3emv:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}", ".r1km3emv:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r21ecva{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalXS);vertical-align:middle;}", ".r21ecva:hover{border-color:var(--colorNeutralStroke1Hover);}", ".r21ecva:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}", ".r21ecva:hover:active{border-color:var(--colorNeutralStroke1Pressed);}", ".r21ecva:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r21ecva:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}", ".r21ecva:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}"]);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export const useMediaBaseClassName = __resetStyles("r19jnv3a", null, [".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}"]);
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export 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);}"]);
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export const useIconBaseClassName = __resetStyles("r176grtk", null, [".r176grtk{align-items:center;border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);box-sizing:border-box;color:var(--colorNeutralForeground1);display:inline-flex;font-size:20px;height:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));justify-content:center;max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));padding:calc(var(--spacingVerticalXXS) / 2) calc(var(--spacingHorizontalXXS) / 2);}"]);
|
|
14
26
|
/**
|
|
15
27
|
* Apply styling to the AttachmentTag slots based on the state
|
|
16
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { AttachmentTagSlots, AttachmentTagState } from './AttachmentTag.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentTagClassNames: SlotClassNames<AttachmentTagSlots> = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon',\n};\
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { AttachmentTagSlots, AttachmentTagState } from './AttachmentTag.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentTagClassNames: SlotClassNames<AttachmentTagSlots> = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon',\n};\n\n/**\n * @internal\n */\nexport const ATTACHMENTTAG_MAXWIDTH = '180px';\nconst ATTACHMENTTAG_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n maxWidth: ATTACHMENTTAG_MAXWIDTH,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n verticalAlign: 'middle',\n\n ':hover': {\n borderColor: tokens.colorNeutralStroke1Hover,\n\n [`& .${attachmentTagClassNames.icon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n\n ':hover:active': {\n borderColor: tokens.colorNeutralStroke1Pressed,\n\n [`& .${attachmentTagClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n\n ':focus': {\n [`& .${attachmentTagClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':focus:active': {\n [`& .${attachmentTagClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\n/**\n * @internal\n */\nexport const useMediaBaseClassName = makeResetStyles({\n fontSize: ATTACHMENTTAG_SIZE,\n height: ATTACHMENTTAG_SIZE,\n lineHeight: ATTACHMENTTAG_SIZE,\n width: ATTACHMENTTAG_SIZE,\n});\n\n/**\n * @internal\n */\nexport const useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\n/**\n * @internal\n */\nexport const useIconBaseClassName = 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: ATTACHMENTTAG_SIZE,\n height: `calc(${ATTACHMENTTAG_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENTTAG_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENTTAG_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\n/**\n * Apply styling to the AttachmentTag slots based on the state\n */\nexport const useAttachmentTagStyles_unstable = (state: AttachmentTagState): AttachmentTagState => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n\n state.root.className = mergeClasses(attachmentTagClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagClassNames.media, mediaBaseClassName, state.media.className);\n }\n\n state.content.className = mergeClasses(\n attachmentTagClassNames.content,\n contentBaseClassName,\n state.content.className,\n );\n\n state.icon.className = mergeClasses(attachmentTagClassNames.icon, iconBaseClassName, state.icon.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","typographyStyles","attachmentTagClassNames","root","media","content","icon","ATTACHMENTTAG_MAXWIDTH","ATTACHMENTTAG_SIZE","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","justifyContent","maxWidth","padding","spacingVerticalXS","spacingHorizontalXS","spacingHorizontalS","verticalAlign","borderColor","colorNeutralStroke1Hover","colorBrandForegroundLinkHover","colorNeutralStroke1Pressed","colorNeutralForeground2BrandPressed","colorNeutralForeground2BrandHover","useMediaBaseClassName","fontSize","height","lineHeight","width","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","spacingHorizontalXXS","minWidth","useAttachmentTagStyles_unstable","state","rootBaseClassName","mediaBaseClassName","contentBaseClassName","iconBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIrG,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,yBAAyB,QAAQ;AAC9C,MAAMC,qBAAqB;AAE3B,MAAMC,uBAAuBX,gBAAgB;IAC3CY,OAAOV,OAAOW,uBAAuB;IACrCC,YAAY;IACZC,iBAAiBb,OAAOc,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEf,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOiB,mBAAmB,CAAC,CAAC;IACvEC,cAAclB,OAAOmB,kBAAkB;IACvCC,WAAW;IACXC,WAAWrB,OAAOsB,uBAAuB;IACzCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,gBAAgB;IAChBC,UAAUpB;IACVqB,SAAS,CAAC,EAAE5B,OAAO6B,iBAAiB,CAAC,CAAC,EAAE7B,OAAO8B,mBAAmB,CAAC,CAAC,EAAE9B,OAAO6B,iBAAiB,CAAC,CAAC,EAAE7B,OAAO+B,kBAAkB,CAAC,CAAC;IAC7HC,eAAe;IAEf,UAAU;QACRC,aAAajC,OAAOkC,wBAAwB;QAE5C,CAAC,CAAC,GAAG,EAAEhC,wBAAwBI,IAAI,CAAC,CAAC,CAAC,EAAE;YACtCI,OAAOV,OAAOmC,6BAA6B;QAC7C;IACF;IAEA,iBAAiB;QACfF,aAAajC,OAAOoC,0BAA0B;QAE9C,CAAC,CAAC,GAAG,EAAElC,wBAAwBI,IAAI,CAAC,CAAC,CAAC,EAAE;YACtCI,OAAOV,OAAOqC,mCAAmC;QACnD;IACF;IAEA,UAAU;QACR,CAAC,CAAC,GAAG,EAAEnC,wBAAwBI,IAAI,CAAC,CAAC,CAAC,EAAE;YACtCI,OAAOV,OAAOsC,iCAAiC;QACjD;IACF;IAEA,iBAAiB;QACf,CAAC,CAAC,GAAG,EAAEpC,wBAAwBI,IAAI,CAAC,CAAC,CAAC,EAAE;YACtCI,OAAOV,OAAOqC,mCAAmC;QACnD;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,wBAAwBzC,gBAAgB;IACnD0C,UAAUhC;IACViC,QAAQjC;IACRkC,YAAYlC;IACZmC,OAAOnC;AACT,GAAG;AAEH;;CAEC,GACD,OAAO,MAAMoC,0BAA0B9C,gBAAgB;IACrD+C,WAAW;IACXC,cAAc;IACdC,YAAY;IACZ,GAAG9C,iBAAiB+C,KAAK;AAC3B,GAAG;AAEH;;CAEC,GACD,OAAO,MAAMC,uBAAuBnD,gBAAgB;IAClDc,YAAY;IACZM,cAAclB,OAAOkD,oBAAoB;IACzCnC,QAAQ,CAAC,EAAEf,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOmD,sBAAsB,CAAC,CAAC;IAC1E/B,WAAW;IACXV,OAAOV,OAAOW,uBAAuB;IACrCa,SAAS;IACTgB,UAAUhC;IACViC,QAAQ,CAAC,KAAK,EAAEjC,mBAAmB,GAAG,EAAER,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOoD,kBAAkB,CAAC,CAAC,CAAC;IACpG1B,gBAAgB;IAChBC,UAAU,CAAC,KAAK,EAAEnB,mBAAmB,GAAG,EAAER,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOqD,oBAAoB,CAAC,CAAC,CAAC;IACxGC,UAAU,CAAC,KAAK,EAAE9C,mBAAmB,GAAG,EAAER,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOqD,oBAAoB,CAAC,CAAC,CAAC;IACxGzB,SAAS,CAAC,KAAK,EAAE5B,OAAOoD,kBAAkB,CAAC,WAAW,EAAEpD,OAAOqD,oBAAoB,CAAC,KAAK,CAAC;AAC5F,GAAG;AAEH;;CAEC,GACD,OAAO,MAAME,kCAAkC,CAACC;IAC9C,MAAMC,oBAAoBhD;IAC1B,MAAMiD,qBAAqBnB;IAC3B,MAAMoB,uBAAuBf;IAC7B,MAAMgB,oBAAoBX;IAE1BO,MAAMrD,IAAI,CAAC0D,SAAS,GAAG9D,aAAaG,wBAAwBC,IAAI,EAAEsD,mBAAmBD,MAAMrD,IAAI,CAAC0D,SAAS;IAEzG,IAAIL,MAAMpD,KAAK,EAAE;QACfoD,MAAMpD,KAAK,CAACyD,SAAS,GAAG9D,aAAaG,wBAAwBE,KAAK,EAAEsD,oBAAoBF,MAAMpD,KAAK,CAACyD,SAAS;IAC/G;IAEAL,MAAMnD,OAAO,CAACwD,SAAS,GAAG9D,aACxBG,wBAAwBG,OAAO,EAC/BsD,sBACAH,MAAMnD,OAAO,CAACwD,SAAS;IAGzBL,MAAMlD,IAAI,CAACuD,SAAS,GAAG9D,aAAaG,wBAAwBI,IAAI,EAAEsD,mBAAmBJ,MAAMlD,IAAI,CAACuD,SAAS;IAEzG,OAAOL;AACT,EAAE"}
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { useAttachmentTagItem_unstable } from './useAttachmentTagItem';
|
|
3
3
|
import { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';
|
|
4
4
|
import { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';
|
|
5
|
-
// AttachmentTagItem component - TODO: add more docs
|
|
6
5
|
export const AttachmentTagItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
6
|
const state = useAttachmentTagItem_unstable(props, ref);
|
|
8
7
|
useAttachmentTagItemStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\nimport type { AttachmentTagItemProps } from './AttachmentTagItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\nimport type { AttachmentTagItemProps } from './AttachmentTagItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const AttachmentTagItem: ForwardRefComponent<AttachmentTagItemProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentTagItem_unstable(props, ref);\n\n useAttachmentTagItemStyles_unstable(state);\n return renderAttachmentTagItem_unstable(state);\n});\n\nAttachmentTagItem.displayName = 'AttachmentTagItem';\n"],"names":["React","useAttachmentTagItem_unstable","renderAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","AttachmentTagItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,+BAA+B;AAInF,OAAO,MAAMC,kCAAiEJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQP,8BAA8BK,OAAOC;IAEnDJ,oCAAoCK;IACpC,OAAON,iCAAiCM;AAC1C,GAAG;AAEHJ,kBAAkBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type AttachmentTagItemSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * AttachmentTagItem Props\n */\nexport type AttachmentTagItemProps = ComponentProps<AttachmentTagItemSlots
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type AttachmentTagItemSlots = {\n root: NonNullable<Slot<'div'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n icon: NonNullable<Slot<'span'>>;\n};\n\n/**\n * AttachmentTagItem Props\n */\nexport type AttachmentTagItemProps = ComponentProps<Partial<AttachmentTagItemSlots>>;\n\n/**\n * State used in rendering AttachmentTagItem\n */\nexport type AttachmentTagItemState = ComponentState<AttachmentTagItemSlots>;\n"],"names":[],"mappings":"AAAA,WAiB4E"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-components';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of AttachmentTagItem
|
|
5
5
|
*/
|
|
6
6
|
export const renderAttachmentTagItem_unstable = state => {
|
|
7
7
|
assertSlots(state);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
return /*#__PURE__*/_jsxs(state.root, {
|
|
9
|
+
children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), /*#__PURE__*/_jsx(state.icon, {})]
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=renderAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentTagItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { AttachmentTagItemState, AttachmentTagItemSlots } from './AttachmentTagItem.types';\n\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = (state: AttachmentTagItemState) => {\n assertSlots<AttachmentTagItemSlots>(state);\n\n
|
|
1
|
+
{"version":3,"sources":["renderAttachmentTagItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { AttachmentTagItemState, AttachmentTagItemSlots } from './AttachmentTagItem.types';\n\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = (state: AttachmentTagItemState) => {\n assertSlots<AttachmentTagItemSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n <state.content />\n <state.icon />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAttachmentTagItem_unstable","state","root","media","content","icon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/CF,YAAoCE;IAEpC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,KAAK,kBAAI,KAACF,MAAME,KAAK;0BAC5B,KAACF,MAAMG,OAAO;0BACd,KAACH,MAAMI,IAAI;;;AAGjB,EAAE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// If you add JSX to this file, be sure to change the file type to .tsx
|
|
1
|
+
import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';
|
|
3
2
|
/**
|
|
4
3
|
* Create the state required to render AttachmentTagItem.
|
|
5
4
|
*
|
|
@@ -10,20 +9,13 @@ import { getNativeElementProps, slot } from '@fluentui/react-components';
|
|
|
10
9
|
* @param ref - reference to root HTMLElement of AttachmentTagItem
|
|
11
10
|
*/
|
|
12
11
|
export const useAttachmentTagItem_unstable = (props, ref) => {
|
|
13
|
-
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
root: slot.always(getNativeElementProps('div', {
|
|
22
|
-
ref,
|
|
23
|
-
...props
|
|
24
|
-
}), {
|
|
25
|
-
elementType: 'div'
|
|
26
|
-
})
|
|
27
|
-
};
|
|
12
|
+
return useAttachmentTagSlots(props, ref, {
|
|
13
|
+
elementType: {
|
|
14
|
+
root: 'div',
|
|
15
|
+
media: 'span',
|
|
16
|
+
content: 'span',
|
|
17
|
+
icon: 'span'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
28
20
|
};
|
|
29
21
|
//# sourceMappingURL=useAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItem.ts"],"sourcesContent":["import type * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItem.ts"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\nimport type { AttachmentTagItemProps, AttachmentTagItemState } from './AttachmentTagItem.types';\n\n/**\n * Create the state required to render AttachmentTagItem.\n *\n * The returned state can be modified with hooks such as useAttachmentTagItemStyles_unstable,\n * before being passed to renderAttachmentTagItem_unstable.\n *\n * @param props - props from this instance of AttachmentTagItem\n * @param ref - reference to root HTMLElement of AttachmentTagItem\n */\nexport const useAttachmentTagItem_unstable = (\n props: AttachmentTagItemProps,\n ref: React.Ref<HTMLElement>,\n): AttachmentTagItemState => {\n return useAttachmentTagSlots(props, ref, {\n elementType: { root: 'div', media: 'span', content: 'span', icon: 'span' },\n });\n};\n"],"names":["useAttachmentTagSlots","useAttachmentTagItem_unstable","props","ref","elementType","root","media","content","icon"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,iCAAiC;AAGvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,OAAOH,sBAAsBE,OAAOC,KAAK;QACvCC,aAAa;YAAEC,MAAM;YAAOC,OAAO;YAAQC,SAAS;YAAQC,MAAM;QAAO;IAC3E;AACF,EAAE"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __resetStyles, mergeClasses, tokens } from '@fluentui/react-components';
|
|
2
|
+
import { ATTACHMENTTAG_MAXWIDTH, useContentBaseClassName, useIconBaseClassName, useMediaBaseClassName } from '../AttachmentTag/useAttachmentTagStyles';
|
|
2
3
|
export const attachmentTagItemClassNames = {
|
|
3
|
-
root: 'fai-AttachmentTagItem'
|
|
4
|
+
root: 'fai-AttachmentTagItem',
|
|
5
|
+
media: 'fai-AttachmentTagItem__media',
|
|
6
|
+
content: 'fai-AttachmentTagItem__content',
|
|
7
|
+
icon: 'fai-AttachmentTagItem__icon'
|
|
4
8
|
};
|
|
5
9
|
/**
|
|
6
10
|
* Styles for the root slot
|
|
7
11
|
*/
|
|
8
|
-
const
|
|
9
|
-
root: {}
|
|
10
|
-
}, {});
|
|
12
|
+
const useRootBaseClassName = __resetStyles("rcbi0rb", null, [".rcbi0rb{display:inline-flex;flex-wrap:nowrap;column-gap:var(--spacingHorizontalSNudge);max-width:180px;align-items:center;}"]);
|
|
11
13
|
/**
|
|
12
14
|
* Apply styling to the AttachmentTagItem slots based on the state
|
|
13
15
|
*/
|
|
14
16
|
export const useAttachmentTagItemStyles_unstable = state => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
18
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
19
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
20
|
+
const iconBaseClassName = useIconBaseClassName();
|
|
21
|
+
state.root.className = mergeClasses(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);
|
|
22
|
+
if (state.media) {
|
|
23
|
+
state.media.className = mergeClasses(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);
|
|
24
|
+
}
|
|
25
|
+
state.content.className = mergeClasses(attachmentTagItemClassNames.content, contentBaseClassName, state.content.className);
|
|
26
|
+
state.icon.className = mergeClasses(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);
|
|
19
27
|
return state;
|
|
20
28
|
};
|
|
21
29
|
//# sourceMappingURL=useAttachmentTagItemStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItemStyles.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItemStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport {\n ATTACHMENTTAG_MAXWIDTH,\n useContentBaseClassName,\n useIconBaseClassName,\n useMediaBaseClassName,\n} from '../AttachmentTag/useAttachmentTagStyles';\nimport type { AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentTagItemClassNames: SlotClassNames<AttachmentTagItemSlots> = {\n root: 'fai-AttachmentTagItem',\n media: 'fai-AttachmentTagItem__media',\n content: 'fai-AttachmentTagItem__content',\n icon: 'fai-AttachmentTagItem__icon',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n columnGap: tokens.spacingHorizontalSNudge,\n maxWidth: ATTACHMENTTAG_MAXWIDTH,\n alignItems: 'center',\n});\n\n/**\n * Apply styling to the AttachmentTagItem slots based on the state\n */\nexport const useAttachmentTagItemStyles_unstable = (state: AttachmentTagItemState): AttachmentTagItemState => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n\n state.root.className = mergeClasses(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);\n }\n\n state.content.className = mergeClasses(\n attachmentTagItemClassNames.content,\n contentBaseClassName,\n state.content.className,\n );\n\n state.icon.className = mergeClasses(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","ATTACHMENTTAG_MAXWIDTH","useContentBaseClassName","useIconBaseClassName","useMediaBaseClassName","attachmentTagItemClassNames","root","media","content","icon","useRootBaseClassName","display","flexWrap","columnGap","spacingHorizontalSNudge","maxWidth","alignItems","useAttachmentTagItemStyles_unstable","state","rootBaseClassName","mediaBaseClassName","contentBaseClassName","iconBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AACnF,SACEC,sBAAsB,EACtBC,uBAAuB,EACvBC,oBAAoB,EACpBC,qBAAqB,QAChB,0CAA0C;AAIjD,OAAO,MAAMC,8BAAsE;IACjFC,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBZ,gBAAgB;IAC3Ca,SAAS;IACTC,UAAU;IACVC,WAAWb,OAAOc,uBAAuB;IACzCC,UAAUd;IACVe,YAAY;AACd;AAEA;;CAEC,GACD,OAAO,MAAMC,sCAAsC,CAACC;IAClD,MAAMC,oBAAoBT;IAC1B,MAAMU,qBAAqBhB;IAC3B,MAAMiB,uBAAuBnB;IAC7B,MAAMoB,oBAAoBnB;IAE1Be,MAAMZ,IAAI,CAACiB,SAAS,GAAGxB,aAAaM,4BAA4BC,IAAI,EAAEa,mBAAmBD,MAAMZ,IAAI,CAACiB,SAAS;IAE7G,IAAIL,MAAMX,KAAK,EAAE;QACfW,MAAMX,KAAK,CAACgB,SAAS,GAAGxB,aAAaM,4BAA4BE,KAAK,EAAEa,oBAAoBF,MAAMX,KAAK,CAACgB,SAAS;IACnH;IAEAL,MAAMV,OAAO,CAACe,SAAS,GAAGxB,aACxBM,4BAA4BG,OAAO,EACnCa,sBACAH,MAAMV,OAAO,CAACe,SAAS;IAGzBL,MAAMT,IAAI,CAACc,SAAS,GAAGxB,aAAaM,4BAA4BI,IAAI,EAAEa,mBAAmBJ,MAAMT,IAAI,CAACc,SAAS;IAE7G,OAAOL;AACT,EAAE"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,sBAAsB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\nexport * from './AttachmentTagItem';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
+
import { useHasParentContext } from '@fluentui/react-context-selector';
|
|
4
|
+
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
5
|
+
import { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';
|
|
6
|
+
import { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* Create the slots required to render AttachmentTag or AttachmentTagItem.
|
|
10
|
+
*/
|
|
11
|
+
export function useAttachmentTagSlots(props, ref, options) {
|
|
12
|
+
const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);
|
|
13
|
+
const {
|
|
14
|
+
children,
|
|
15
|
+
role
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
elementType
|
|
19
|
+
} = options;
|
|
20
|
+
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
21
|
+
const hasParentContext = useHasParentContext(AttachmentTagListContext);
|
|
22
|
+
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
23
|
+
const root = slot.always(getNativeElementProps(elementType.root, {
|
|
24
|
+
ref,
|
|
25
|
+
...props,
|
|
26
|
+
role: rootRole
|
|
27
|
+
}), {
|
|
28
|
+
elementType: elementType.root
|
|
29
|
+
});
|
|
30
|
+
root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
31
|
+
content: children,
|
|
32
|
+
media
|
|
33
|
+
}));
|
|
34
|
+
const media = slot.optional(props.media, {
|
|
35
|
+
elementType: elementType.media
|
|
36
|
+
});
|
|
37
|
+
const content = slot.always(props.content, {
|
|
38
|
+
defaultProps: {
|
|
39
|
+
children
|
|
40
|
+
},
|
|
41
|
+
elementType: elementType.content
|
|
42
|
+
});
|
|
43
|
+
const icon = slot.always(props.icon, {
|
|
44
|
+
defaultProps: {
|
|
45
|
+
children: /*#__PURE__*/React.createElement(DismissIcon, null)
|
|
46
|
+
},
|
|
47
|
+
elementType: elementType.icon
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
components: {
|
|
51
|
+
root: elementType.root,
|
|
52
|
+
media: elementType.media,
|
|
53
|
+
content: elementType.content,
|
|
54
|
+
icon: elementType.icon
|
|
55
|
+
},
|
|
56
|
+
root,
|
|
57
|
+
media,
|
|
58
|
+
content,
|
|
59
|
+
icon
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=useAttachmentTagSlots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagSlots.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\n\nimport { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';\n\nimport { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';\nimport type { AttachmentTagProps, AttachmentTagState } from './../AttachmentTag/AttachmentTag.types';\nimport type { AttachmentTagItemProps, AttachmentTagItemState } from './../AttachmentTagItem/AttachmentTagItem.types';\n\n/**\n * @internal\n * Create the slots required to render AttachmentTag or AttachmentTagItem.\n */\nexport function useAttachmentTagSlots<TAttachmentTagState extends AttachmentTagState | AttachmentTagItemState>(\n props: AttachmentTagProps | AttachmentTagItemProps,\n ref: React.Ref<HTMLElement>,\n options: {\n elementType: TAttachmentTagState['components'];\n },\n): TAttachmentTagState {\n const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);\n const { children, role } = props;\n const { elementType } = options;\n\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n\n const hasParentContext = useHasParentContext(AttachmentTagListContext);\n const rootRole = role ?? (hasParentContext ? 'menuitem' : undefined);\n\n const root: TAttachmentTagState['root'] = slot.always(\n getNativeElementProps(elementType.root as unknown as string, {\n ref,\n ...props,\n role: rootRole,\n }),\n { elementType: elementType.root },\n );\n root.onClick = mergeCallbacks(\n root.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n onAttachmentTagDismiss?.(ev, { content: children, media }),\n );\n\n const media: TAttachmentTagState['media'] = slot.optional(props.media, { elementType: elementType.media });\n\n const content: TAttachmentTagState['content'] = slot.always(props.content, {\n defaultProps: {\n children,\n },\n elementType: elementType.content,\n });\n\n const icon: TAttachmentTagState['icon'] = slot.always(props.icon, {\n defaultProps: {\n children: <DismissIcon />,\n },\n elementType: elementType.icon,\n });\n\n return {\n components: {\n root: elementType.root,\n media: elementType.media,\n content: elementType.content,\n icon: elementType.icon,\n },\n root,\n media,\n content,\n icon,\n } as TAttachmentTagState;\n}\n"],"names":["React","getNativeElementProps","mergeCallbacks","slot","useHasParentContext","Dismiss20Regular","Dismiss20Filled","bundleIcon","useAttachmentTagListContext_unstable","AttachmentTagListContext","useAttachmentTagSlots","props","ref","options","onAttachmentTagDismiss","context","children","role","elementType","DismissIcon","hasParentContext","rootRole","undefined","root","always","onClick","ev","content","media","optional","defaultProps","icon","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,IAAI,QAAQ,6BAA6B;AACzF,SAASC,mBAAmB,QAAQ,mCAAmC;AACvE,SAASC,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,QAAQ,wBAAwB;AAEtF,SAASC,oCAAoC,QAAQ,0CAA0C;AAE/F,SAASC,wBAAwB,QAAQ,0CAA0C;AAInF;;;CAGC,GACD,OAAO,SAASC,sBACdC,KAAkD,EAClDC,GAA2B,EAC3BC,OAEC;IAED,MAAMC,yBAAyBN,qCAAqCO,CAAAA,UAAWA,QAAQD,sBAAsB;IAC7G,MAAM,EAAEE,QAAQ,EAAEC,IAAI,EAAE,GAAGN;IAC3B,MAAM,EAAEO,WAAW,EAAE,GAAGL;IAExB,MAAMM,cAAcZ,WAAWD,iBAAiBD;IAEhD,MAAMe,mBAAmBhB,oBAAoBK;IAC7C,MAAMY,WAAWJ,iBAAAA,kBAAAA,OAASG,mBAAmB,aAAaE;IAE1D,MAAMC,OAAoCpB,KAAKqB,MAAM,CACnDvB,sBAAsBiB,YAAYK,IAAI,EAAuB;QAC3DX;QACA,GAAGD,KAAK;QACRM,MAAMI;IACR,IACA;QAAEH,aAAaA,YAAYK,IAAI;IAAC;IAElCA,KAAKE,OAAO,GAAGvB,eACbqB,KAAKE,OAAO,EACZ,CAACC,KACCZ,mCAAAA,6CAAAA,uBAAyBY,IAAI;YAAEC,SAASX;YAAUY;QAAM;IAG5D,MAAMA,QAAsCzB,KAAK0B,QAAQ,CAAClB,MAAMiB,KAAK,EAAE;QAAEV,aAAaA,YAAYU,KAAK;IAAC;IAExG,MAAMD,UAA0CxB,KAAKqB,MAAM,CAACb,MAAMgB,OAAO,EAAE;QACzEG,cAAc;YACZd;QACF;QACAE,aAAaA,YAAYS,OAAO;IAClC;IAEA,MAAMI,OAAoC5B,KAAKqB,MAAM,CAACb,MAAMoB,IAAI,EAAE;QAChED,cAAc;YACZd,wBAAU,oBAACG;QACb;QACAD,aAAaA,YAAYa,IAAI;IAC/B;IAEA,OAAO;QACLC,YAAY;YACVT,MAAML,YAAYK,IAAI;YACtBK,OAAOV,YAAYU,KAAK;YACxBD,SAAST,YAAYS,OAAO;YAC5BI,MAAMb,YAAYa,IAAI;QACxB;QACAR;QACAK;QACAD;QACAI;IACF;AACF"}
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AttachmentTag, attachmentTagClassNames, renderAttachmentTag_unstable, useAttachmentTagStyles_unstable, useAttachmentTag_unstable } from './AttachmentTag';
|
|
2
2
|
export { AttachmentTagList, attachmentTagListClassNames, renderAttachmentTagList_unstable, useAttachmentTagListStyles_unstable, useAttachmentTagList_unstable } from './AttachmentTagList';
|
|
3
|
+
export { AttachmentTagItem, attachmentTagItemClassNames, renderAttachmentTagItem_unstable, useAttachmentTagItemStyles_unstable, useAttachmentTagItem_unstable } from './AttachmentTagItem';
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable"],"mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,6BAA6B,QACxB,sBAAsB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport { AttachmentTagItem, attachmentTagItemClassNames, renderAttachmentTagItem_unstable, useAttachmentTagItemStyles_unstable, useAttachmentTagItem_unstable } from './AttachmentTagItem';\n"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable","AttachmentTagItem","attachmentTagItemClassNames","renderAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","useAttachmentTagItem_unstable"],"mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,6BAA6B,QACxB,sBAAsB;AAG7B,SAASC,iBAAiB,EAAEC,2BAA2B,EAAEC,gCAAgC,EAAEC,mCAAmC,EAAEC,6BAA6B,QAAQ,sBAAsB"}
|
|
@@ -8,54 +8,14 @@ Object.defineProperty(exports, "useAttachmentTag_unstable", {
|
|
|
8
8
|
return useAttachmentTag_unstable;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
-
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
15
|
-
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
-
const _attachmentTagListContext = require("../../contexts/attachmentTagListContext");
|
|
11
|
+
const _useAttachmentTagSlots = require("../utils/useAttachmentTagSlots");
|
|
17
12
|
const useAttachmentTag_unstable = (props, ref)=>{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
21
|
-
const hasParentContext = (0, _reactcontextselector.useHasParentContext)(_attachmentTagListContext.AttachmentTagListContext);
|
|
22
|
-
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
23
|
-
const root = _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('button', {
|
|
24
|
-
ref,
|
|
25
|
-
...props,
|
|
26
|
-
role: rootRole
|
|
27
|
-
}), {
|
|
28
|
-
elementType: 'button'
|
|
29
|
-
});
|
|
30
|
-
root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
31
|
-
content: children,
|
|
32
|
-
media
|
|
33
|
-
}));
|
|
34
|
-
const media = _reactcomponents.slot.optional(props.media, {
|
|
35
|
-
elementType: 'span'
|
|
36
|
-
});
|
|
37
|
-
const content = _reactcomponents.slot.always(props.content, {
|
|
38
|
-
defaultProps: {
|
|
39
|
-
children
|
|
40
|
-
},
|
|
41
|
-
elementType: 'span'
|
|
42
|
-
});
|
|
43
|
-
const icon = _reactcomponents.slot.always(props.icon, {
|
|
44
|
-
defaultProps: {
|
|
45
|
-
children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
|
|
46
|
-
},
|
|
47
|
-
elementType: 'span'
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
components: {
|
|
13
|
+
return (0, _useAttachmentTagSlots.useAttachmentTagSlots)(props, ref, {
|
|
14
|
+
elementType: {
|
|
51
15
|
root: 'button',
|
|
52
16
|
media: 'span',
|
|
53
17
|
content: 'span',
|
|
54
18
|
icon: 'span'
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
media,
|
|
58
|
-
content,
|
|
59
|
-
icon
|
|
60
|
-
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
61
21
|
}; //# sourceMappingURL=useAttachmentTag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTag.js"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["useAttachmentTag.js"],"sourcesContent":["import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\n/**\n * Create the state required to render AttachmentTag.\n *\n * The returned state can be modified with hooks such as useAttachmentTagStyles_unstable,\n * before being passed to renderAttachmentTag_unstable.\n *\n * @param props - props from this instance of AttachmentTag\n * @param ref - reference to root HTMLElement of AttachmentTag\n */\nexport const useAttachmentTag_unstable = (props, ref) => {\n return useAttachmentTagSlots(props, ref, {\n elementType: {\n root: 'button',\n media: 'span',\n content: 'span',\n icon: 'span'\n }\n });\n};\n//# sourceMappingURL=useAttachmentTag.js.map"],"names":["useAttachmentTag_unstable","props","ref","useAttachmentTagSlots","elementType","root","media","content","icon"],"mappings":";;;;+BAUaA;;;eAAAA;;;uCAVyB;AAU/B,MAAMA,4BAA4B,CAACC,OAAOC;IAC/C,OAAOC,IAAAA,4CAAqB,EAACF,OAAOC,KAAK;QACvCE,aAAa;YACXC,MAAM;YACNC,OAAO;YACPC,SAAS;YACTC,MAAM;QACR;IACF;AACF,GACA,4CAA4C"}
|
|
@@ -12,6 +12,18 @@ _export(exports, {
|
|
|
12
12
|
attachmentTagClassNames: function() {
|
|
13
13
|
return attachmentTagClassNames;
|
|
14
14
|
},
|
|
15
|
+
ATTACHMENTTAG_MAXWIDTH: function() {
|
|
16
|
+
return ATTACHMENTTAG_MAXWIDTH;
|
|
17
|
+
},
|
|
18
|
+
useMediaBaseClassName: function() {
|
|
19
|
+
return useMediaBaseClassName;
|
|
20
|
+
},
|
|
21
|
+
useContentBaseClassName: function() {
|
|
22
|
+
return useContentBaseClassName;
|
|
23
|
+
},
|
|
24
|
+
useIconBaseClassName: function() {
|
|
25
|
+
return useIconBaseClassName;
|
|
26
|
+
},
|
|
15
27
|
useAttachmentTagStyles_unstable: function() {
|
|
16
28
|
return useAttachmentTagStyles_unstable;
|
|
17
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentTagClassNames = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon'\n};\
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentTagClassNames = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon'\n};\n/**\n * @internal\n */\nexport const ATTACHMENTTAG_MAXWIDTH = '180px';\nconst ATTACHMENTTAG_SIZE = '20px';\nconst useRootBaseClassName = __resetStyles(\"r1km3emv\", \"r21ecva\", [\".r1km3emv{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;}\", \".r1km3emv:hover{border-color:var(--colorNeutralStroke1Hover);}\", \".r1km3emv:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}\", \".r1km3emv:hover:active{border-color:var(--colorNeutralStroke1Pressed);}\", \".r1km3emv:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}\", \".r1km3emv:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}\", \".r1km3emv:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}\", \".r21ecva{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalXS);vertical-align:middle;}\", \".r21ecva:hover{border-color:var(--colorNeutralStroke1Hover);}\", \".r21ecva:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}\", \".r21ecva:hover:active{border-color:var(--colorNeutralStroke1Pressed);}\", \".r21ecva:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}\", \".r21ecva:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}\", \".r21ecva:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}\"]);\n/**\n * @internal\n */\nexport const useMediaBaseClassName = __resetStyles(\"r19jnv3a\", null, [\".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}\"]);\n/**\n * @internal\n */\nexport 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);}\"]);\n/**\n * @internal\n */\nexport const useIconBaseClassName = __resetStyles(\"r176grtk\", null, [\".r176grtk{align-items:center;border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);box-sizing:border-box;color:var(--colorNeutralForeground1);display:inline-flex;font-size:20px;height:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));justify-content:center;max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));padding:calc(var(--spacingVerticalXXS) / 2) calc(var(--spacingHorizontalXXS) / 2);}\"]);\n/**\n * Apply styling to the AttachmentTag slots based on the state\n */\nexport const useAttachmentTagStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n state.root.className = mergeClasses(attachmentTagClassNames.root, rootBaseClassName, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(attachmentTagClassNames.content, contentBaseClassName, state.content.className);\n state.icon.className = mergeClasses(attachmentTagClassNames.icon, iconBaseClassName, state.icon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentTagStyles.js.map"],"names":["attachmentTagClassNames","ATTACHMENTTAG_MAXWIDTH","useMediaBaseClassName","useContentBaseClassName","useIconBaseClassName","useAttachmentTagStyles_unstable","root","media","content","icon","ATTACHMENTTAG_SIZE","useRootBaseClassName","__resetStyles","state","rootBaseClassName","mediaBaseClassName","contentBaseClassName","iconBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,uBAAuB;eAAvBA;;IASAC,sBAAsB;eAAtBA;;IAMAC,qBAAqB;eAArBA;;IAIAC,uBAAuB;eAAvBA;;IAIAC,oBAAoB;eAApBA;;IAIAC,+BAA+B;eAA/BA;;;iCA5ByD;AAC/D,MAAML,0BAA0B;IACrCM,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR;AAIO,MAAMR,yBAAyB;AACtC,MAAMS,qBAAqB;AAC3B,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,YAAY,WAAW;IAAC;IAA8f;IAAkE;IAAyF;IAA2E;IAAsG;IAA6F;IAAsG;IAA6f;IAAiE;IAAwF;IAA0E;IAAqG;IAA4F;CAAoG;AAI9kE,MAAMV,wBAAwBU,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAAqE;AAIpI,MAAMT,0BAA0BS,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAsN;AAItR,MAAMR,uBAAuBQ,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAA+jB;AAI7nB,MAAMP,kCAAkCQ,CAAAA;IAC7C,MAAMC,oBAAoBH;IAC1B,MAAMI,qBAAqBb;IAC3B,MAAMc,uBAAuBb;IAC7B,MAAMc,oBAAoBb;IAC1BS,MAAMP,IAAI,CAACY,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBM,IAAI,EAAEQ,mBAAmBD,MAAMP,IAAI,CAACY,SAAS;IACzG,IAAIL,MAAMN,KAAK,EAAE;QACfM,MAAMN,KAAK,CAACW,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBO,KAAK,EAAEQ,oBAAoBF,MAAMN,KAAK,CAACW,SAAS;IAC/G;IACAL,MAAML,OAAO,CAACU,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBQ,OAAO,EAAEQ,sBAAsBH,MAAML,OAAO,CAACU,SAAS;IACrHL,MAAMJ,IAAI,CAACS,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBS,IAAI,EAAEQ,mBAAmBJ,MAAMJ,IAAI,CAACS,SAAS;IACzG,OAAOL;AACT,GACA,kDAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\nexport const AttachmentTagItem = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useAttachmentTagItem_unstable(props, ref);\n useAttachmentTagItemStyles_unstable(state);\n return renderAttachmentTagItem_unstable(state);\n});\nAttachmentTagItem.displayName = 'AttachmentTagItem';\n//# sourceMappingURL=AttachmentTagItem.js.map"],"names":["AttachmentTagItem","React","forwardRef","props","ref","state","useAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","renderAttachmentTagItem_unstable","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;sCACuB;yCACG;4CACG;AAC7C,MAAMA,oBAAoB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrE,MAAMC,QAAQC,IAAAA,mDAA6B,EAACH,OAAOC;IACnDG,IAAAA,+DAAmC,EAACF;IACpC,OAAOG,IAAAA,yDAAgC,EAACH;AAC1C;AACAL,kBAAkBS,WAAW,GAAG,qBAChC,6CAA6C"}
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from AttachmentTagItemProps.
|
|
6
|
-
// & Required<Pick<AttachmentTagItemProps, 'propName'>>
|
|
7
5
|
//# sourceMappingURL=AttachmentTagItem.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.types.js"],"sourcesContent":["export {}
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=AttachmentTagItem.types.js.map"],"names":[],"mappings":";;;;CACA,mDAAmD"}
|
|
@@ -12,6 +12,11 @@ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
|
12
12
|
const _reactcomponents = require("@fluentui/react-components");
|
|
13
13
|
const renderAttachmentTagItem_unstable = (state)=>{
|
|
14
14
|
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
state.media && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
|
|
18
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
|
|
19
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
17
22
|
}; //# sourceMappingURL=renderAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentTagItem.js"],"sourcesContent":["import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = state => {\n assertSlots(state);\n
|
|
1
|
+
{"version":3,"sources":["renderAttachmentTagItem.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), /*#__PURE__*/_jsx(state.icon, {})]\n });\n};\n//# sourceMappingURL=renderAttachmentTagItem.js.map"],"names":["renderAttachmentTagItem_unstable","state","assertSlots","_jsxs","root","children","media","_jsx","content","icon"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BAL8B;iCACf;AAIrB,MAAMA,mCAAmCC,CAAAA;IAC9CC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACpCC,UAAU;YAACJ,MAAMK,KAAK,IAAI,WAAW,GAAEC,IAAAA,eAAI,EAACN,MAAMK,KAAK,EAAE,CAAC;YAAI,WAAW,GAAEC,IAAAA,eAAI,EAACN,MAAMO,OAAO,EAAE,CAAC;YAAI,WAAW,GAAED,IAAAA,eAAI,EAACN,MAAMQ,IAAI,EAAE,CAAC;SAAG;IACxI;AACF,GACA,mDAAmD"}
|
|
@@ -8,21 +8,14 @@ Object.defineProperty(exports, "useAttachmentTagItem_unstable", {
|
|
|
8
8
|
return useAttachmentTagItem_unstable;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
11
|
+
const _useAttachmentTagSlots = require("../utils/useAttachmentTagSlots");
|
|
12
12
|
const useAttachmentTagItem_unstable = (props, ref)=>{
|
|
13
|
-
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
root: _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('div', {
|
|
22
|
-
ref,
|
|
23
|
-
...props
|
|
24
|
-
}), {
|
|
25
|
-
elementType: 'div'
|
|
26
|
-
})
|
|
27
|
-
};
|
|
13
|
+
return (0, _useAttachmentTagSlots.useAttachmentTagSlots)(props, ref, {
|
|
14
|
+
elementType: {
|
|
15
|
+
root: 'div',
|
|
16
|
+
media: 'span',
|
|
17
|
+
content: 'span',
|
|
18
|
+
icon: 'span'
|
|
19
|
+
}
|
|
20
|
+
});
|
|
28
21
|
}; //# sourceMappingURL=useAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItem.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItem.js"],"sourcesContent":["import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\n/**\n * Create the state required to render AttachmentTagItem.\n *\n * The returned state can be modified with hooks such as useAttachmentTagItemStyles_unstable,\n * before being passed to renderAttachmentTagItem_unstable.\n *\n * @param props - props from this instance of AttachmentTagItem\n * @param ref - reference to root HTMLElement of AttachmentTagItem\n */\nexport const useAttachmentTagItem_unstable = (props, ref) => {\n return useAttachmentTagSlots(props, ref, {\n elementType: {\n root: 'div',\n media: 'span',\n content: 'span',\n icon: 'span'\n }\n });\n};\n//# sourceMappingURL=useAttachmentTagItem.js.map"],"names":["useAttachmentTagItem_unstable","props","ref","useAttachmentTagSlots","elementType","root","media","content","icon"],"mappings":";;;;+BAUaA;;;eAAAA;;;uCAVyB;AAU/B,MAAMA,gCAAgC,CAACC,OAAOC;IACnD,OAAOC,IAAAA,4CAAqB,EAACF,OAAOC,KAAK;QACvCE,aAAa;YACXC,MAAM;YACNC,OAAO;YACPC,SAAS;YACTC,MAAM;QACR;IACF;AACF,GACA,gDAAgD"}
|
|
@@ -17,18 +17,28 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _useAttachmentTagStyles = require("../AttachmentTag/useAttachmentTagStyles");
|
|
20
21
|
const attachmentTagItemClassNames = {
|
|
21
|
-
root: 'fai-AttachmentTagItem'
|
|
22
|
+
root: 'fai-AttachmentTagItem',
|
|
23
|
+
media: 'fai-AttachmentTagItem__media',
|
|
24
|
+
content: 'fai-AttachmentTagItem__content',
|
|
25
|
+
icon: 'fai-AttachmentTagItem__icon'
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* Styles for the root slot
|
|
25
|
-
*/ const
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
*/ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rcbi0rb", null, [
|
|
30
|
+
".rcbi0rb{display:inline-flex;flex-wrap:nowrap;column-gap:var(--spacingHorizontalSNudge);max-width:180px;align-items:center;}"
|
|
31
|
+
]);
|
|
28
32
|
const useAttachmentTagItemStyles_unstable = (state)=>{
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
34
|
+
const mediaBaseClassName = (0, _useAttachmentTagStyles.useMediaBaseClassName)();
|
|
35
|
+
const contentBaseClassName = (0, _useAttachmentTagStyles.useContentBaseClassName)();
|
|
36
|
+
const iconBaseClassName = (0, _useAttachmentTagStyles.useIconBaseClassName)();
|
|
37
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);
|
|
38
|
+
if (state.media) {
|
|
39
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);
|
|
40
|
+
}
|
|
41
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.content, contentBaseClassName, state.content.className);
|
|
42
|
+
state.icon.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);
|
|
33
43
|
return state;
|
|
34
44
|
}; //# sourceMappingURL=useAttachmentTagItemStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItemStyles.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItemStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport { ATTACHMENTTAG_MAXWIDTH, useContentBaseClassName, useIconBaseClassName, useMediaBaseClassName } from '../AttachmentTag/useAttachmentTagStyles';\nexport const attachmentTagItemClassNames = {\n root: 'fai-AttachmentTagItem',\n media: 'fai-AttachmentTagItem__media',\n content: 'fai-AttachmentTagItem__content',\n icon: 'fai-AttachmentTagItem__icon'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = __resetStyles(\"rcbi0rb\", null, [\".rcbi0rb{display:inline-flex;flex-wrap:nowrap;column-gap:var(--spacingHorizontalSNudge);max-width:180px;align-items:center;}\"]);\n/**\n * Apply styling to the AttachmentTagItem slots based on the state\n */\nexport const useAttachmentTagItemStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n state.root.className = mergeClasses(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(attachmentTagItemClassNames.content, contentBaseClassName, state.content.className);\n state.icon.className = mergeClasses(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentTagItemStyles.js.map"],"names":["attachmentTagItemClassNames","useAttachmentTagItemStyles_unstable","root","media","content","icon","useRootBaseClassName","__resetStyles","state","rootBaseClassName","mediaBaseClassName","useMediaBaseClassName","contentBaseClassName","useContentBaseClassName","iconBaseClassName","useIconBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,2BAA2B;eAA3BA;;IAaAC,mCAAmC;eAAnCA;;;iCAfuC;wCACyD;AACtG,MAAMD,8BAA8B;IACzCE,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAA+H;AAIrL,MAAMN,sCAAsCO,CAAAA;IACjD,MAAMC,oBAAoBH;IAC1B,MAAMI,qBAAqBC,IAAAA,6CAAqB;IAChD,MAAMC,uBAAuBC,IAAAA,+CAAuB;IACpD,MAAMC,oBAAoBC,IAAAA,4CAAoB;IAC9CP,MAAMN,IAAI,CAACc,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BE,IAAI,EAAEO,mBAAmBD,MAAMN,IAAI,CAACc,SAAS;IAC7G,IAAIR,MAAML,KAAK,EAAE;QACfK,MAAML,KAAK,CAACa,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BG,KAAK,EAAEO,oBAAoBF,MAAML,KAAK,CAACa,SAAS;IACnH;IACAR,MAAMJ,OAAO,CAACY,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BI,OAAO,EAAEQ,sBAAsBJ,MAAMJ,OAAO,CAACY,SAAS;IACzHR,MAAMH,IAAI,CAACW,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BK,IAAI,EAAES,mBAAmBN,MAAMH,IAAI,CAACW,SAAS;IAC7G,OAAOR;AACT,GACA,sDAAsD"}
|
|
@@ -5,4 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
6
|
_export_star._(require("./AttachmentTag"), exports);
|
|
7
7
|
_export_star._(require("./AttachmentTagList"), exports);
|
|
8
|
+
_export_star._(require("./AttachmentTagItem"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;CACd,iCAAiC"}
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\nexport * from './AttachmentTagItem';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentTagSlots", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentTagSlots;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
15
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
+
const _attachmentTagListContext = require("../../contexts/attachmentTagListContext");
|
|
17
|
+
function useAttachmentTagSlots(props, ref, options) {
|
|
18
|
+
const onAttachmentTagDismiss = (0, _attachmentTagListContext.useAttachmentTagListContext_unstable)((context)=>context.onAttachmentTagDismiss);
|
|
19
|
+
const { children, role } = props;
|
|
20
|
+
const { elementType } = options;
|
|
21
|
+
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
22
|
+
const hasParentContext = (0, _reactcontextselector.useHasParentContext)(_attachmentTagListContext.AttachmentTagListContext);
|
|
23
|
+
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
24
|
+
const root = _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)(elementType.root, {
|
|
25
|
+
ref,
|
|
26
|
+
...props,
|
|
27
|
+
role: rootRole
|
|
28
|
+
}), {
|
|
29
|
+
elementType: elementType.root
|
|
30
|
+
});
|
|
31
|
+
root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
32
|
+
content: children,
|
|
33
|
+
media
|
|
34
|
+
}));
|
|
35
|
+
const media = _reactcomponents.slot.optional(props.media, {
|
|
36
|
+
elementType: elementType.media
|
|
37
|
+
});
|
|
38
|
+
const content = _reactcomponents.slot.always(props.content, {
|
|
39
|
+
defaultProps: {
|
|
40
|
+
children
|
|
41
|
+
},
|
|
42
|
+
elementType: elementType.content
|
|
43
|
+
});
|
|
44
|
+
const icon = _reactcomponents.slot.always(props.icon, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
|
|
47
|
+
},
|
|
48
|
+
elementType: elementType.icon
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
components: {
|
|
52
|
+
root: elementType.root,
|
|
53
|
+
media: elementType.media,
|
|
54
|
+
content: elementType.content,
|
|
55
|
+
icon: elementType.icon
|
|
56
|
+
},
|
|
57
|
+
root,
|
|
58
|
+
media,
|
|
59
|
+
content,
|
|
60
|
+
icon
|
|
61
|
+
};
|
|
62
|
+
} //# sourceMappingURL=useAttachmentTagSlots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';\nimport { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';\n/**\n * @internal\n * Create the slots required to render AttachmentTag or AttachmentTagItem.\n */\nexport function useAttachmentTagSlots(props, ref, options) {\n const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);\n const {\n children,\n role\n } = props;\n const {\n elementType\n } = options;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const hasParentContext = useHasParentContext(AttachmentTagListContext);\n const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;\n const root = slot.always(getNativeElementProps(elementType.root, {\n ref,\n ...props,\n role: rootRole\n }), {\n elementType: elementType.root\n });\n root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {\n content: children,\n media\n }));\n const media = slot.optional(props.media, {\n elementType: elementType.media\n });\n const content = slot.always(props.content, {\n defaultProps: {\n children\n },\n elementType: elementType.content\n });\n const icon = slot.always(props.icon, {\n defaultProps: {\n children: /*#__PURE__*/React.createElement(DismissIcon, null)\n },\n elementType: elementType.icon\n });\n return {\n components: {\n root: elementType.root,\n media: elementType.media,\n content: elementType.content,\n icon: elementType.icon\n },\n root,\n media,\n content,\n icon\n };\n}\n//# sourceMappingURL=useAttachmentTagSlots.js.map"],"names":["useAttachmentTagSlots","props","ref","options","onAttachmentTagDismiss","useAttachmentTagListContext_unstable","context","children","role","elementType","DismissIcon","bundleIcon","Dismiss20Filled","Dismiss20Regular","hasParentContext","useHasParentContext","AttachmentTagListContext","rootRole","undefined","root","slot","always","getNativeElementProps","onClick","mergeCallbacks","ev","content","media","optional","defaultProps","icon","React","createElement","components"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;iEAVO;iCACqC;sCACxB;4BAC0B;0CACT;AAM9C,SAASA,sBAAsBC,KAAK,EAAEC,GAAG,EAAEC,OAAO;IACvD,MAAMC,yBAAyBC,IAAAA,8DAAoC,EAACC,CAAAA,UAAWA,QAAQF,sBAAsB;IAC7G,MAAM,EACJG,QAAQ,EACRC,IAAI,EACL,GAAGP;IACJ,MAAM,EACJQ,WAAW,EACZ,GAAGN;IACJ,MAAMO,cAAcC,IAAAA,sBAAU,EAACC,2BAAe,EAAEC,4BAAgB;IAChE,MAAMC,mBAAmBC,IAAAA,yCAAmB,EAACC,kDAAwB;IACrE,MAAMC,WAAWT,SAAS,QAAQA,SAAS,KAAK,IAAIA,OAAOM,mBAAmB,aAAaI;IAC3F,MAAMC,OAAOC,qBAAI,CAACC,MAAM,CAACC,IAAAA,sCAAqB,EAACb,YAAYU,IAAI,EAAE;QAC/DjB;QACA,GAAGD,KAAK;QACRO,MAAMS;IACR,IAAI;QACFR,aAAaA,YAAYU,IAAI;IAC/B;IACAA,KAAKI,OAAO,GAAGC,IAAAA,+BAAc,EAACL,KAAKI,OAAO,EAAEE,CAAAA,KAAMrB,2BAA2B,QAAQA,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBqB,IAAI;YAC3JC,SAASnB;YACToB;QACF;IACA,MAAMA,QAAQP,qBAAI,CAACQ,QAAQ,CAAC3B,MAAM0B,KAAK,EAAE;QACvClB,aAAaA,YAAYkB,KAAK;IAChC;IACA,MAAMD,UAAUN,qBAAI,CAACC,MAAM,CAACpB,MAAMyB,OAAO,EAAE;QACzCG,cAAc;YACZtB;QACF;QACAE,aAAaA,YAAYiB,OAAO;IAClC;IACA,MAAMI,OAAOV,qBAAI,CAACC,MAAM,CAACpB,MAAM6B,IAAI,EAAE;QACnCD,cAAc;YACZtB,UAAU,WAAW,GAAEwB,OAAMC,aAAa,CAACtB,aAAa;QAC1D;QACAD,aAAaA,YAAYqB,IAAI;IAC/B;IACA,OAAO;QACLG,YAAY;YACVd,MAAMV,YAAYU,IAAI;YACtBQ,OAAOlB,YAAYkB,KAAK;YACxBD,SAASjB,YAAYiB,OAAO;YAC5BI,MAAMrB,YAAYqB,IAAI;QACxB;QACAX;QACAQ;QACAD;QACAI;IACF;AACF,EACA,iDAAiD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -38,8 +38,24 @@ _export(exports, {
|
|
|
38
38
|
},
|
|
39
39
|
useAttachmentTagList_unstable: function() {
|
|
40
40
|
return _AttachmentTagList.useAttachmentTagList_unstable;
|
|
41
|
+
},
|
|
42
|
+
AttachmentTagItem: function() {
|
|
43
|
+
return _AttachmentTagItem.AttachmentTagItem;
|
|
44
|
+
},
|
|
45
|
+
attachmentTagItemClassNames: function() {
|
|
46
|
+
return _AttachmentTagItem.attachmentTagItemClassNames;
|
|
47
|
+
},
|
|
48
|
+
renderAttachmentTagItem_unstable: function() {
|
|
49
|
+
return _AttachmentTagItem.renderAttachmentTagItem_unstable;
|
|
50
|
+
},
|
|
51
|
+
useAttachmentTagItemStyles_unstable: function() {
|
|
52
|
+
return _AttachmentTagItem.useAttachmentTagItemStyles_unstable;
|
|
53
|
+
},
|
|
54
|
+
useAttachmentTagItem_unstable: function() {
|
|
55
|
+
return _AttachmentTagItem.useAttachmentTagItem_unstable;
|
|
41
56
|
}
|
|
42
57
|
});
|
|
43
58
|
const _AttachmentTag = require("./AttachmentTag");
|
|
44
59
|
const _AttachmentTagList = require("./AttachmentTagList");
|
|
60
|
+
const _AttachmentTagItem = require("./AttachmentTagItem");
|
|
45
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { AttachmentTag, attachmentTagClassNames, renderAttachmentTag_unstable, useAttachmentTagStyles_unstable, useAttachmentTag_unstable } from './AttachmentTag';\nexport { AttachmentTagList, attachmentTagListClassNames, renderAttachmentTagList_unstable, useAttachmentTagListStyles_unstable, useAttachmentTagList_unstable } from './AttachmentTagList';\n//# sourceMappingURL=index.js.map"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable"],"mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAChIC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;;+
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { AttachmentTag, attachmentTagClassNames, renderAttachmentTag_unstable, useAttachmentTagStyles_unstable, useAttachmentTag_unstable } from './AttachmentTag';\nexport { AttachmentTagList, attachmentTagListClassNames, renderAttachmentTagList_unstable, useAttachmentTagListStyles_unstable, useAttachmentTagList_unstable } from './AttachmentTagList';\nexport { AttachmentTagItem, attachmentTagItemClassNames, renderAttachmentTagItem_unstable, useAttachmentTagItemStyles_unstable, useAttachmentTagItem_unstable } from './AttachmentTagItem';\n//# sourceMappingURL=index.js.map"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable","AttachmentTagItem","attachmentTagItemClassNames","renderAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","useAttachmentTagItem_unstable"],"mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAChIC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;IACpJC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;;+BAFZ;mCACoB;mCACA;CACrK,iCAAiC"}
|
package/package.json
CHANGED