@fluentui-copilot/react-attachments 0.8.1 → 0.8.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 +37 -1
- package/CHANGELOG.md +21 -2
- package/dist/index.d.ts +112 -1
- package/lib/Attachment.js +2 -0
- package/lib/Attachment.js.map +1 -0
- package/lib/AttachmentList.js +2 -0
- package/lib/AttachmentList.js.map +1 -0
- package/lib/components/Attachment/Attachment.js +12 -0
- package/lib/components/Attachment/Attachment.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js +2 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -0
- package/lib/components/Attachment/index.js +6 -0
- package/lib/components/Attachment/index.js.map +1 -0
- package/lib/components/Attachment/renderAttachment.js +16 -0
- package/lib/components/Attachment/renderAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachment.js +71 -0
- package/lib/components/Attachment/useAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.js +82 -0
- package/lib/components/Attachment/useAttachmentStyles.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.js +13 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js +2 -0
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib/components/AttachmentList/index.js +6 -0
- package/lib/components/AttachmentList/index.js.map +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +14 -0
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentList.js +74 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +13 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js +14 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -1
- package/lib/contexts/attachmentListContext.js +8 -0
- package/lib/contexts/attachmentListContext.js.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Attachment.js +7 -0
- package/lib-commonjs/Attachment.js.map +1 -0
- package/lib-commonjs/AttachmentList.js +7 -0
- package/lib-commonjs/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.js +21 -0
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js +5 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -0
- package/lib-commonjs/components/Attachment/index.js +11 -0
- package/lib-commonjs/components/Attachment/index.js.map +1 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js +28 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachment.js +72 -0
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js +139 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +23 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +5 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +11 -0
- package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +20 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +68 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +20 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js +30 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib-commonjs/components/index.js +2 -0
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/attachmentListContext.js +28 -0
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
- package/lib-commonjs/index.js +42 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, slot, useArrowNavigationGroup, useEventCallback, useFocusFinders, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
4
|
+
import { useOverflowContext } from '@fluentui/react-overflow';
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render AttachmentList.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useAttachmentListStyles_unstable,
|
|
9
|
+
* before being passed to renderAttachmentList_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of AttachmentList
|
|
12
|
+
* @param ref - reference to root HTMLElement of AttachmentList
|
|
13
|
+
*/
|
|
14
|
+
export const useAttachmentList_unstable = (props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
onAttachmentDismiss
|
|
17
|
+
} = props;
|
|
18
|
+
const attachmentsVisibilityStatus = useOverflowContext(context => context.itemVisibility);
|
|
19
|
+
const innerRef = React.useRef(null);
|
|
20
|
+
const {
|
|
21
|
+
targetDocument
|
|
22
|
+
} = useFluent();
|
|
23
|
+
const {
|
|
24
|
+
findNextFocusable,
|
|
25
|
+
findPrevFocusable
|
|
26
|
+
} = useFocusFinders();
|
|
27
|
+
const handleAttachmentDismiss = useEventCallback((e, data) => {
|
|
28
|
+
var _innerRef_current;
|
|
29
|
+
if (!onAttachmentDismiss) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
onAttachmentDismiss(e, data);
|
|
33
|
+
// Remove attachment from overflow context
|
|
34
|
+
attachmentsVisibilityStatus === null || attachmentsVisibilityStatus === void 0 ? true : delete attachmentsVisibilityStatus[data.id];
|
|
35
|
+
// set focus after attachment dismiss
|
|
36
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
37
|
+
if ((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement)) {
|
|
38
|
+
// focus on next attachment only if the active element is within the current attachment list
|
|
39
|
+
const next = findNextFocusable(activeElement, {
|
|
40
|
+
container: innerRef.current
|
|
41
|
+
});
|
|
42
|
+
if (next) {
|
|
43
|
+
next.focus();
|
|
44
|
+
return;
|
|
45
|
+
} else {
|
|
46
|
+
const prev = findPrevFocusable(activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement, {
|
|
47
|
+
container: innerRef.current
|
|
48
|
+
});
|
|
49
|
+
prev === null || prev === void 0 ? void 0 : prev.focus();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const arrowNavigationProps = useArrowNavigationGroup({
|
|
54
|
+
circular: true,
|
|
55
|
+
axis: 'both',
|
|
56
|
+
memorizeCurrent: true
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
onAttachmentDismiss: handleAttachmentDismiss,
|
|
60
|
+
components: {
|
|
61
|
+
root: 'div'
|
|
62
|
+
},
|
|
63
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
64
|
+
'aria-label': 'Attachments',
|
|
65
|
+
ref: useMergedRefs(ref, innerRef),
|
|
66
|
+
role: 'toolbar',
|
|
67
|
+
...arrowNavigationProps,
|
|
68
|
+
...props
|
|
69
|
+
}), {
|
|
70
|
+
elementType: 'div'
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=useAttachmentList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useOverflowContext } from '@fluentui/react-overflow';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { onAttachmentDismiss } = props;\n\n const attachmentsVisibilityStatus: Record<string, boolean> = useOverflowContext(context => context.itemVisibility);\n\n const innerRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // Remove attachment from overflow context\n delete attachmentsVisibilityStatus?.[data.id];\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n\n if (next) {\n next.focus();\n return;\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n }\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n return {\n onAttachmentDismiss: handleAttachmentDismiss,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useArrowNavigationGroup","useEventCallback","useFocusFinders","useMergedRefs","useFluent_unstable","useFluent","useOverflowContext","useAttachmentList_unstable","props","ref","onAttachmentDismiss","attachmentsVisibilityStatus","context","itemVisibility","innerRef","useRef","targetDocument","findNextFocusable","findPrevFocusable","handleAttachmentDismiss","e","data","id","activeElement","current","contains","next","container","focus","prev","parentElement","arrowNavigationProps","circular","axis","memorizeCurrent","components","root","always","role","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,uBAAuB,EACvBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,QACR,6BAA6B;AACpC,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,2BAA2B;AAG9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,mBAAmB,EAAE,GAAGF;IAEhC,MAAMG,8BAAuDL,mBAAmBM,CAAAA,UAAWA,QAAQC,cAAc;IAEjH,MAAMC,WAAWjB,MAAMkB,MAAM,CAAiB;IAC9C,MAAM,EAAEC,cAAc,EAAE,GAAGX;IAC3B,MAAM,EAAEY,iBAAiB,EAAEC,iBAAiB,EAAE,GAAGhB;IAEjD,MAAMiB,0BAAsElB,iBAAiB,CAACmB,GAAGC;YAY3FP;QAXJ,IAAI,CAACJ,qBAAqB;YACxB;QACF;QAEAA,oBAAoBU,GAAGC;QAEvB,0CAA0C;QACnCV,wCAAAA,uDAAAA,2BAA6B,CAACU,KAAKC,EAAE,CAAC;QAE7C,qCAAqC;QACrC,MAAMC,gBAAgBP,2BAAAA,qCAAAA,eAAgBO,aAAa;QACnD,KAAIT,oBAAAA,SAASU,OAAO,cAAhBV,wCAAAA,kBAAkBW,QAAQ,CAACF,gBAA+B;YAC5D,4FAA4F;YAC5F,MAAMG,OAAOT,kBAAkBM,eAA8B;gBAAEI,WAAWb,SAASU,OAAO;YAAC;YAE3F,IAAIE,MAAM;gBACRA,KAAKE,KAAK;gBACV;YACF,OAAO;gBACL,MAAMC,OAAOX,kBAAkBK,0BAAAA,oCAAAA,cAAeO,aAAa,EAAiB;oBAAEH,WAAWb,SAASU,OAAO;gBAAC;gBAC1GK,iBAAAA,2BAAAA,KAAMD,KAAK;YACb;QACF;IACF;IAEA,MAAMG,uBAAuB/B,wBAAwB;QACnDgC,UAAU;QACVC,MAAM;QACNC,iBAAiB;IACnB;IAEA,OAAO;QACLxB,qBAAqBS;QACrBgB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMrC,KAAKsC,MAAM,CACfvC,yBAAyB,OAAO;YAC9B,cAAc;YACdW,KAAKN,cAAcM,KAAKK;YACxBwB,MAAM;YACN,GAAGP,oBAAoB;YACvB,GAAGvB,KAAK;QACV,IACA;YAAE+B,aAAa;QAAM;IAEzB;AACF,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function useAttachmentListContextValues_unstable(state) {
|
|
2
|
+
const {
|
|
3
|
+
onAttachmentDismiss
|
|
4
|
+
} = state;
|
|
5
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
6
|
+
const attachmentList = {
|
|
7
|
+
onAttachmentDismiss
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentList
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=useAttachmentListContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { onAttachmentDismiss } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n onAttachmentDismiss,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","onAttachmentDismiss","attachmentList"],"mappings":"AAEA,OAAO,SAASA,wCAAwCC,KAA0B;IAChF,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;IAEhC,mGAAmG;IACnG,MAAME,iBAAiB;QACrBD;IACF;IAEA,OAAO;QAAEC;IAAe;AAC1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __resetStyles, mergeClasses, tokens } from '@fluentui/react-components';
|
|
2
|
+
export const attachmentListClassNames = {
|
|
3
|
+
root: 'fai-AttachmentList'
|
|
4
|
+
};
|
|
5
|
+
const useRootBaseClassName = __resetStyles("r168fwfa", null, [".r168fwfa{column-gap:var(--spacingHorizontalSNudge);display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;row-gap:var(--spacingVerticalXS);}"]);
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
8
|
+
*/
|
|
9
|
+
export const useAttachmentListStyles_unstable = state => {
|
|
10
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
11
|
+
state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
12
|
+
return state;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useAttachmentListStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","attachmentListClassNames","root","useRootBaseClassName","columnGap","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useAttachmentListStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAInF,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBL,gBAAgB;IAC3CM,WAAWJ,OAAOK,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQV,OAAOW,iBAAiB;AAClC;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,oBAAoBX;IAE1BU,MAAMX,IAAI,CAACa,SAAS,GAAGhB,aAAaE,yBAAyBC,IAAI,EAAEY,mBAAmBD,MAAMX,IAAI,CAACa,SAAS;IAE1G,OAAOF;AACT,EAAE"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\nexport * from './AttachmentTagItem';\nexport * from './Attachment';\nexport * from './AttachmentList';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,eAAe;AAC7B,cAAc,mBAAmB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
+
export const AttachmentListContext = createContext(undefined);
|
|
3
|
+
const attachmentListContextDefaultValue = {
|
|
4
|
+
onAttachmentDismiss: () => null
|
|
5
|
+
};
|
|
6
|
+
export const AttachmentListProvider = AttachmentListContext.Provider;
|
|
7
|
+
export const useAttachmentListContext_unstable = selector => useContextSelector(AttachmentListContext, (ctx = attachmentListContextDefaultValue) => selector(ctx));
|
|
8
|
+
//# sourceMappingURL=attachmentListContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["attachmentListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { AttachmentListProps } from '../components/index';\n\nexport const AttachmentListContext: Context<AttachmentListContextValue> = createContext<\n AttachmentListContextValue | undefined\n>(undefined) as Context<AttachmentListContextValue>;\n\nconst attachmentListContextDefaultValue: AttachmentListContextValue = {\n onAttachmentDismiss: () => null,\n};\n\n/**\n * Context shared between AttachmentList and its children components\n */\nexport type AttachmentListContextValue = Pick<AttachmentListProps, 'onAttachmentDismiss'>;\n\nexport const AttachmentListProvider = AttachmentListContext.Provider;\n\nexport const useAttachmentListContext_unstable = <T>(selector: ContextSelector<AttachmentListContextValue, T>) =>\n useContextSelector(AttachmentListContext, (ctx = attachmentListContextDefaultValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","AttachmentListContext","undefined","attachmentListContextDefaultValue","onAttachmentDismiss","AttachmentListProvider","Provider","useAttachmentListContext_unstable","selector","ctx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,OAAO,MAAMC,wBAA6DF,cAExEG,WAAkD;AAEpD,MAAMC,oCAAgE;IACpEC,qBAAqB,IAAM;AAC7B;AAOA,OAAO,MAAMC,yBAAyBJ,sBAAsBK,QAAQ,CAAC;AAErE,OAAO,MAAMC,oCAAoC,CAAIC,WACnDR,mBAAmBC,uBAAuB,CAACQ,MAAMN,iCAAiC,GAAKK,SAASC,MAAM"}
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
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
3
|
export { AttachmentTagItem, attachmentTagItemClassNames, renderAttachmentTagItem_unstable, useAttachmentTagItemStyles_unstable, useAttachmentTagItem_unstable } from './AttachmentTagItem';
|
|
4
|
+
export { AttachmentList, attachmentListClassNames, renderAttachmentList_unstable, useAttachmentListStyles_unstable, useAttachmentList_unstable } from './AttachmentList';
|
|
5
|
+
export { AttachmentListContext, AttachmentListProvider, useAttachmentListContext_unstable } from './contexts/attachmentListContext';
|
|
6
|
+
export { Attachment, attachmentClassNames, renderAttachment_unstable, useAttachmentStyles_unstable, useAttachment_unstable } from './Attachment';
|
|
4
7
|
//# 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\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport { AttachmentTagItem,
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport {\n AttachmentTagItem,\n attachmentTagItemClassNames,\n renderAttachmentTagItem_unstable,\n useAttachmentTagItemStyles_unstable,\n useAttachmentTagItem_unstable,\n} from './AttachmentTagItem';\n\nexport type { AttachmentListProps, AttachmentListSlots, AttachmentListState } from './AttachmentList';\nexport {\n AttachmentList,\n attachmentListClassNames,\n renderAttachmentList_unstable,\n useAttachmentListStyles_unstable,\n useAttachmentList_unstable,\n} from './AttachmentList';\nexport type { AttachmentListContextValue } from './contexts/attachmentListContext';\nexport {\n AttachmentListContext,\n AttachmentListProvider,\n useAttachmentListContext_unstable,\n} from './contexts/attachmentListContext';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment';\nexport {\n Attachment,\n attachmentClassNames,\n renderAttachment_unstable,\n useAttachmentStyles_unstable,\n useAttachment_unstable,\n} from './Attachment';\n"],"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","AttachmentList","attachmentListClassNames","renderAttachmentList_unstable","useAttachmentListStyles_unstable","useAttachmentList_unstable","AttachmentListContext","AttachmentListProvider","useAttachmentListContext_unstable","Attachment","attachmentClassNames","renderAttachment_unstable","useAttachmentStyles_unstable","useAttachment_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,SACEC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,6BAA6B,QACxB,sBAAsB;AAG7B,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,iCAAiC,QAC5B,mCAAmC;AAE1C,SACEC,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Attachment.js"],"sourcesContent":["export * from './components/Attachment/index';\n//# sourceMappingURL=Attachment.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentList.js"],"sourcesContent":["export * from './components/AttachmentList/index';\n//# sourceMappingURL=AttachmentList.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,0CAA0C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Attachment", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Attachment;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAttachment = require("./useAttachment");
|
|
14
|
+
const _renderAttachment = require("./renderAttachment");
|
|
15
|
+
const _useAttachmentStyles = require("./useAttachmentStyles");
|
|
16
|
+
const Attachment = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useAttachment.useAttachment_unstable)(props, ref);
|
|
18
|
+
(0, _useAttachmentStyles.useAttachmentStyles_unstable)(state);
|
|
19
|
+
return (0, _renderAttachment.renderAttachment_unstable)(state);
|
|
20
|
+
});
|
|
21
|
+
Attachment.displayName = 'Attachment'; //# sourceMappingURL=Attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Attachment.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachment_unstable } from './useAttachment';\nimport { renderAttachment_unstable } from './renderAttachment';\nimport { useAttachmentStyles_unstable } from './useAttachmentStyles';\n// Attachment component - TODO: add more docs\nexport const Attachment = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useAttachment_unstable(props, ref);\n useAttachmentStyles_unstable(state);\n return renderAttachment_unstable(state);\n});\nAttachment.displayName = 'Attachment';\n//# sourceMappingURL=Attachment.js.map"],"names":["Attachment","React","forwardRef","props","ref","state","useAttachment_unstable","useAttachmentStyles_unstable","renderAttachment_unstable","displayName"],"mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;+BACgB;kCACG;qCACG;AAEtC,MAAMA,aAAa,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC9D,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5CG,IAAAA,iDAA4B,EAACF;IAC7B,OAAOG,IAAAA,2CAAyB,EAACH;AACnC;AACAL,WAAWS,WAAW,GAAG,cACzB,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Attachment.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Attachment.types.js.map"],"names":[],"mappings":";;;;CACA,4CAA4C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./Attachment"), exports);
|
|
7
|
+
_export_star._(require("./Attachment.types"), exports);
|
|
8
|
+
_export_star._(require("./renderAttachment"), exports);
|
|
9
|
+
_export_star._(require("./useAttachment"), exports);
|
|
10
|
+
_export_star._(require("./useAttachmentStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Attachment';\nexport * from './Attachment.types';\nexport * from './renderAttachment';\nexport * from './useAttachment';\nexport * from './useAttachmentStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAttachment_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAttachment_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderAttachment_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(state.primaryAction, {
|
|
18
|
+
children: [
|
|
19
|
+
state.media && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
|
|
20
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {})
|
|
21
|
+
]
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissButton, {
|
|
24
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissIcon, {})
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}; //# sourceMappingURL=renderAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachment.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 Attachment\n */\nexport const renderAttachment_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [/*#__PURE__*/_jsxs(state.primaryAction, {\n children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {})]\n }), /*#__PURE__*/_jsx(state.dismissButton, {\n children: /*#__PURE__*/_jsx(state.dismissIcon, {})\n })]\n });\n};\n//# sourceMappingURL=renderAttachment.js.map"],"names":["renderAttachment_unstable","state","assertSlots","_jsxs","root","children","primaryAction","media","_jsx","content","dismissButton","dismissIcon"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BAL8B;iCACf;AAIrB,MAAMA,4BAA4BC,CAAAA;IACvCC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACpCC,UAAU;YAAC,WAAW,GAAEF,IAAAA,gBAAK,EAACF,MAAMK,aAAa,EAAE;gBACjDD,UAAU;oBAACJ,MAAMM,KAAK,IAAI,WAAW,GAAEC,IAAAA,eAAI,EAACP,MAAMM,KAAK,EAAE,CAAC;oBAAI,WAAW,GAAEC,IAAAA,eAAI,EAACP,MAAMQ,OAAO,EAAE,CAAC;iBAAG;YACrG;YAAI,WAAW,GAAED,IAAAA,eAAI,EAACP,MAAMS,aAAa,EAAE;gBACzCL,UAAU,WAAW,GAAEG,IAAAA,eAAI,EAACP,MAAMU,WAAW,EAAE,CAAC;YAClD;SAAG;IACL;AACF,GACA,4CAA4C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachment_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachment_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
15
|
+
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
16
|
+
const useAttachment_unstable = (props, ref)=>{
|
|
17
|
+
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
18
|
+
const onAttachmentDismiss = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context.onAttachmentDismiss);
|
|
19
|
+
const root = _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
20
|
+
ref,
|
|
21
|
+
...props
|
|
22
|
+
}), {
|
|
23
|
+
elementType: 'div'
|
|
24
|
+
});
|
|
25
|
+
const primaryAction = _reactcomponents.slot.always(props.primaryAction, {
|
|
26
|
+
elementType: 'button'
|
|
27
|
+
});
|
|
28
|
+
const dismissButton = _reactcomponents.slot.always(props.dismissButton, {
|
|
29
|
+
defaultProps: {
|
|
30
|
+
'aria-label': 'Dismiss'
|
|
31
|
+
},
|
|
32
|
+
elementType: 'button'
|
|
33
|
+
});
|
|
34
|
+
dismissButton.onClick = (0, _reactcomponents.mergeCallbacks)(dismissButton.onClick, (ev)=>onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
35
|
+
id: props.id
|
|
36
|
+
}));
|
|
37
|
+
const media = _reactcomponents.slot.optional(props.media, {
|
|
38
|
+
elementType: 'span'
|
|
39
|
+
});
|
|
40
|
+
const content = _reactcomponents.slot.always(props.content, {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
children: props.children
|
|
43
|
+
},
|
|
44
|
+
elementType: 'span'
|
|
45
|
+
});
|
|
46
|
+
const dismissIcon = _reactcomponents.slot.always(props.dismissIcon, {
|
|
47
|
+
defaultProps: {
|
|
48
|
+
children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
|
|
49
|
+
},
|
|
50
|
+
elementType: 'span'
|
|
51
|
+
});
|
|
52
|
+
const state = {
|
|
53
|
+
components: {
|
|
54
|
+
root: 'div',
|
|
55
|
+
primaryAction: 'button',
|
|
56
|
+
dismissButton: 'button',
|
|
57
|
+
media: 'span',
|
|
58
|
+
content: 'span',
|
|
59
|
+
dismissIcon: 'span'
|
|
60
|
+
},
|
|
61
|
+
root,
|
|
62
|
+
primaryAction,
|
|
63
|
+
dismissButton,
|
|
64
|
+
media,
|
|
65
|
+
content,
|
|
66
|
+
dismissIcon
|
|
67
|
+
};
|
|
68
|
+
if (state.primaryAction.as === 'span') {
|
|
69
|
+
state.components.primaryAction = 'span';
|
|
70
|
+
}
|
|
71
|
+
return state;
|
|
72
|
+
}; //# sourceMappingURL=useAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachment.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\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, ref) => {\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);\n const root = slot.always(getIntrinsicElementProps('div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n });\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button'\n });\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: {\n 'aria-label': 'Dismiss'\n },\n elementType: 'button'\n });\n dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {\n id: props.id\n }));\n const media = slot.optional(props.media, {\n elementType: 'span'\n });\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children\n },\n elementType: 'span'\n });\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: /*#__PURE__*/React.createElement(DismissIcon, null)\n },\n elementType: 'span'\n });\n const state = {\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span'\n },\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon\n };\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n return state;\n};\n//# sourceMappingURL=useAttachment.js.map"],"names":["useAttachment_unstable","props","ref","DismissIcon","bundleIcon","Dismiss20Filled","Dismiss20Regular","onAttachmentDismiss","useAttachmentListContext_unstable","context","root","slot","always","getIntrinsicElementProps","elementType","primaryAction","dismissButton","defaultProps","onClick","mergeCallbacks","ev","id","media","optional","content","children","dismissIcon","React","createElement","state","components","as"],"mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;iCACwC;4BACD;uCACZ;AAU3C,MAAMA,yBAAyB,CAACC,OAAOC;IAC5C,MAAMC,cAAcC,IAAAA,sBAAU,EAACC,2BAAe,EAAEC,4BAAgB;IAChE,MAAMC,sBAAsBC,IAAAA,wDAAiC,EAACC,CAAAA,UAAWA,QAAQF,mBAAmB;IACpG,MAAMG,OAAOC,qBAAI,CAACC,MAAM,CAACC,IAAAA,yCAAwB,EAAC,OAAO;QACvDX;QACA,GAAGD,KAAK;IACV,IAAI;QACFa,aAAa;IACf;IACA,MAAMC,gBAAgBJ,qBAAI,CAACC,MAAM,CAACX,MAAMc,aAAa,EAAE;QACrDD,aAAa;IACf;IACA,MAAME,gBAAgBL,qBAAI,CAACC,MAAM,CAACX,MAAMe,aAAa,EAAE;QACrDC,cAAc;YACZ,cAAc;QAChB;QACAH,aAAa;IACf;IACAE,cAAcE,OAAO,GAAGC,IAAAA,+BAAc,EAACH,cAAcE,OAAO,EAAEE,CAAAA,KAAMb,wBAAwB,QAAQA,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBa,IAAI;YACpKC,IAAIpB,MAAMoB,EAAE;QACd;IACA,MAAMC,QAAQX,qBAAI,CAACY,QAAQ,CAACtB,MAAMqB,KAAK,EAAE;QACvCR,aAAa;IACf;IACA,MAAMU,UAAUb,qBAAI,CAACC,MAAM,CAACX,MAAMuB,OAAO,EAAE;QACzCP,cAAc;YACZQ,UAAUxB,MAAMwB,QAAQ;QAC1B;QACAX,aAAa;IACf;IACA,MAAMY,cAAcf,qBAAI,CAACC,MAAM,CAACX,MAAMyB,WAAW,EAAE;QACjDT,cAAc;YACZQ,UAAU,WAAW,GAAEE,OAAMC,aAAa,CAACzB,aAAa;QAC1D;QACAW,aAAa;IACf;IACA,MAAMe,QAAQ;QACZC,YAAY;YACVpB,MAAM;YACNK,eAAe;YACfC,eAAe;YACfM,OAAO;YACPE,SAAS;YACTE,aAAa;QACf;QACAhB;QACAK;QACAC;QACAM;QACAE;QACAE;IACF;IACA,IAAIG,MAAMd,aAAa,CAACgB,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACf,aAAa,GAAG;IACnC;IACA,OAAOc;AACT,GACA,yCAAyC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentClassNames: function() {
|
|
13
|
+
return attachmentClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentStyles_unstable: function() {
|
|
16
|
+
return useAttachmentStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const attachmentClassNames = {
|
|
21
|
+
root: 'fai-Attachment',
|
|
22
|
+
primaryAction: 'fai-Attachment__primaryAction',
|
|
23
|
+
dismissButton: 'fai-Attachment__dismissButton',
|
|
24
|
+
media: 'fai-Attachment__media',
|
|
25
|
+
content: 'fai-Attachment__content',
|
|
26
|
+
dismissIcon: 'fai-Attachment__dismissIcon'
|
|
27
|
+
};
|
|
28
|
+
const ATTACHMENT_MAXWIDTH = '180px';
|
|
29
|
+
const ATTACHMENT_SIZE = '20px';
|
|
30
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rj3sqpg", null, [
|
|
31
|
+
".rj3sqpg{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;}"
|
|
32
|
+
]);
|
|
33
|
+
const buttonBaseStyles = {
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
backgroundColor: _reactcomponents.tokens.colorNeutralBackground1,
|
|
36
|
+
border: `${_reactcomponents.tokens.strokeWidthThin} solid ${_reactcomponents.tokens.colorNeutralStroke1}`,
|
|
37
|
+
borderRadius: _reactcomponents.tokens.borderRadiusMedium,
|
|
38
|
+
boxSizing: 'border-box',
|
|
39
|
+
columnGap: _reactcomponents.tokens.spacingHorizontalSNudge,
|
|
40
|
+
color: _reactcomponents.tokens.colorNeutralForeground1,
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
display: 'inline-flex',
|
|
43
|
+
flexWrap: 'nowrap',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
...(0, _reactcomponents.createCustomFocusIndicatorStyle)({
|
|
46
|
+
..._reactcomponents.shorthands.outline(_reactcomponents.tokens.strokeWidthThick, 'solid', _reactcomponents.tokens.colorStrokeFocus2),
|
|
47
|
+
zIndex: 1
|
|
48
|
+
}),
|
|
49
|
+
verticalAlign: 'middle'
|
|
50
|
+
};
|
|
51
|
+
const usePrimaryActionBaseClassName = (0, _reactcomponents.__resetStyles)("rftb5h9", "rofiitm", [
|
|
52
|
+
".rftb5h9{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);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);}",
|
|
53
|
+
".rftb5h9[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
54
|
+
".rofiitm{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);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);}",
|
|
55
|
+
".rofiitm[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}"
|
|
56
|
+
]);
|
|
57
|
+
const usePrimaryActionStyles = (0, _reactcomponents.__styles)({
|
|
58
|
+
button: {
|
|
59
|
+
eoavqd: "f8491dx",
|
|
60
|
+
Jwef8y: "f1h648pw",
|
|
61
|
+
Bi91k9c: "fnwyq0v",
|
|
62
|
+
ecr2s2: "fwdzr64",
|
|
63
|
+
lj723h: "flvvhsy",
|
|
64
|
+
Bqrx1nm: "fq7113v",
|
|
65
|
+
kx9iu6: "fp3oj7s"
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
h: [
|
|
69
|
+
".f8491dx:hover{cursor:pointer;}",
|
|
70
|
+
".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}",
|
|
71
|
+
".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}"
|
|
72
|
+
],
|
|
73
|
+
a: [
|
|
74
|
+
".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}",
|
|
75
|
+
".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}"
|
|
76
|
+
],
|
|
77
|
+
m: [
|
|
78
|
+
[
|
|
79
|
+
"@media (forced-colors: active){.fq7113v:hover{background-color:HighlightText;}}",
|
|
80
|
+
{
|
|
81
|
+
m: "(forced-colors: active)"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"@media (forced-colors: active){.fp3oj7s:active{background-color:HighlightText;}}",
|
|
86
|
+
{
|
|
87
|
+
m: "(forced-colors: active)"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
const useDismissButtonBaseClassName = (0, _reactcomponents.__resetStyles)("r1cf2ehf", "rhq1520", {
|
|
93
|
+
r: [
|
|
94
|
+
".r1cf2ehf{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);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);}",
|
|
95
|
+
".r1cf2ehf[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
96
|
+
".r1cf2ehf:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
97
|
+
".r1cf2ehf:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
98
|
+
".r1cf2ehf:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
99
|
+
".r1cf2ehf:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}",
|
|
100
|
+
".rhq1520{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);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);}",
|
|
101
|
+
".rhq1520[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
102
|
+
".rhq1520:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
103
|
+
".rhq1520:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
104
|
+
".rhq1520:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
105
|
+
".rhq1520:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}"
|
|
106
|
+
],
|
|
107
|
+
s: [
|
|
108
|
+
"@media (forced-colors: active){.r1cf2ehf:hover{background-color:HighlightText;}.r1cf2ehf:active{background-color:HighlightText;}}",
|
|
109
|
+
"@media (forced-colors: active){.rhq1520:hover{background-color:HighlightText;}.rhq1520:active{background-color:HighlightText;}}"
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
const useMediaBaseClassName = (0, _reactcomponents.__resetStyles)("rz1lum2", null, [
|
|
113
|
+
".rz1lum2{display:inline-flex;font-size:20px;height:20px;line-height:20px;width:20px;}"
|
|
114
|
+
]);
|
|
115
|
+
const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("rmt99gk", null, [
|
|
116
|
+
".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);}"
|
|
117
|
+
]);
|
|
118
|
+
const useDismissIconBaseClassName = (0, _reactcomponents.__resetStyles)("r176grtk", null, [
|
|
119
|
+
".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);}"
|
|
120
|
+
]);
|
|
121
|
+
const useAttachmentStyles_unstable = (state)=>{
|
|
122
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
123
|
+
const primaryActionBaseClassName = usePrimaryActionBaseClassName();
|
|
124
|
+
const dismissButtonBaseClassName = useDismissButtonBaseClassName();
|
|
125
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
126
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
127
|
+
const dismissIconBaseClassName = useDismissIconBaseClassName();
|
|
128
|
+
const primaryActionStyles = usePrimaryActionStyles();
|
|
129
|
+
const { primaryAction } = state;
|
|
130
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
131
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, state.primaryAction.className);
|
|
132
|
+
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
133
|
+
if (state.media) {
|
|
134
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
135
|
+
}
|
|
136
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.content, contentBaseClassName, state.content.className);
|
|
137
|
+
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
138
|
+
return state;
|
|
139
|
+
}; //# sourceMappingURL=useAttachmentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.js"],"sourcesContent":["import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentClassNames = {\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};\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst ATTACHMENT_SIZE = '20px';\nconst useRootBaseClassName = __resetStyles(\"rj3sqpg\", null, [\".rj3sqpg{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;}\"]);\nconst buttonBaseStyles = {\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 ...shorthands.outline(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n zIndex: 1\n }),\n verticalAlign: 'middle'\n};\nconst usePrimaryActionBaseClassName = __resetStyles(\"rftb5h9\", \"rofiitm\", [\".rftb5h9{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);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);}\", \".rftb5h9[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}\", \".rofiitm{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);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);}\", \".rofiitm[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}\"]);\nconst usePrimaryActionStyles = __styles({\n button: {\n eoavqd: \"f8491dx\",\n Jwef8y: \"f1h648pw\",\n Bi91k9c: \"fnwyq0v\",\n ecr2s2: \"fwdzr64\",\n lj723h: \"flvvhsy\",\n Bqrx1nm: \"fq7113v\",\n kx9iu6: \"fp3oj7s\"\n }\n}, {\n h: [\".f8491dx:hover{cursor:pointer;}\", \".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}\", \".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}\"],\n a: [\".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}\", \".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}\"],\n m: [[\"@media (forced-colors: active){.fq7113v:hover{background-color:HighlightText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fp3oj7s:active{background-color:HighlightText;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\nconst useDismissButtonBaseClassName = __resetStyles(\"r1cf2ehf\", \"rhq1520\", {\n r: [\".r1cf2ehf{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);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);}\", \".r1cf2ehf[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}\", \".r1cf2ehf:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}\", \".r1cf2ehf:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}\", \".r1cf2ehf:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}\", \".r1cf2ehf:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}\", \".rhq1520{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);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);}\", \".rhq1520[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}\", \".rhq1520:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}\", \".rhq1520:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}\", \".rhq1520:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}\", \".rhq1520:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}\"],\n s: [\"@media (forced-colors: active){.r1cf2ehf:hover{background-color:HighlightText;}.r1cf2ehf:active{background-color:HighlightText;}}\", \"@media (forced-colors: active){.rhq1520:hover{background-color:HighlightText;}.rhq1520:active{background-color:HighlightText;}}\"]\n});\nconst useMediaBaseClassName = __resetStyles(\"rz1lum2\", null, [\".rz1lum2{display:inline-flex;font-size:20px;height:20px;line-height:20px;width:20px;}\"]);\nconst 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);}\"]);\nconst useDismissIconBaseClassName = __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 Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = state => {\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 primaryActionStyles = usePrimaryActionStyles();\n const {\n primaryAction\n } = state;\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, state.primaryAction.className);\n state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);\n if (state.media) {\n state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(attachmentClassNames.content, contentBaseClassName, state.content.className);\n state.dismissIcon.className = mergeClasses(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentStyles.js.map"],"names":["attachmentClassNames","useAttachmentStyles_unstable","root","primaryAction","dismissButton","media","content","dismissIcon","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","__resetStyles","buttonBaseStyles","alignItems","backgroundColor","tokens","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","display","flexWrap","justifyContent","createCustomFocusIndicatorStyle","shorthands","outline","strokeWidthThick","colorStrokeFocus2","zIndex","verticalAlign","usePrimaryActionBaseClassName","usePrimaryActionStyles","__styles","button","eoavqd","Jwef8y","Bi91k9c","ecr2s2","lj723h","Bqrx1nm","kx9iu6","h","a","m","useDismissButtonBaseClassName","r","s","useMediaBaseClassName","useContentBaseClassName","useDismissIconBaseClassName","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","primaryActionStyles","className","mergeClasses","as"],"mappings":";;;;;;;;;;;IACaA,oBAAoB;eAApBA;;IA2DAC,4BAA4B;eAA5BA;;;iCA5DgH;AACtH,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;AACf;AACA,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AACxB,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAgH;AAC7K,MAAMC,mBAAmB;IACvBC,YAAY;IACZC,iBAAiBC,uBAAM,CAACC,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEF,uBAAM,CAACG,eAAe,CAAC,OAAO,EAAEH,uBAAM,CAACI,mBAAmB,CAAC,CAAC;IACvEC,cAAcL,uBAAM,CAACM,kBAAkB;IACvCC,WAAW;IACXC,WAAWR,uBAAM,CAACS,uBAAuB;IACzCC,OAAOV,uBAAM,CAACW,uBAAuB;IACrCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,gBAAgB;IAChB,GAAGC,IAAAA,gDAA+B,EAAC;QACjC,GAAGC,2BAAU,CAACC,OAAO,CAAClB,uBAAM,CAACmB,gBAAgB,EAAE,SAASnB,uBAAM,CAACoB,iBAAiB,CAAC;QACjFC,QAAQ;IACV,EAAE;IACFC,eAAe;AACjB;AACA,MAAMC,gCAAgC3B,IAAAA,8BAAa,EAAC,WAAW,WAAW;IAAC;IAA4tB;IAAiJ;IAAytB;CAAgJ;AACjyD,MAAM4B,yBAAyBC,IAAAA,yBAAQ,EAAC;IACtCC,QAAQ;QACNC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAmC;QAA0E;KAA6D;IAC9KC,GAAG;QAAC;QAA4E;KAAgE;IAChJC,GAAG;QAAC;YAAC;YAAmF;gBACtFA,GAAG;YACL;SAAE;QAAE;YAAC;YAAoF;gBACvFA,GAAG;YACL;SAAE;KAAC;AACL;AACA,MAAMC,gCAAgCzC,IAAAA,8BAAa,EAAC,YAAY,WAAW;IACzE0C,GAAG;QAAC;QAA07B;QAAkJ;QAAwI;QAA6F;QAA8H;QAAiG;QAA07B;QAAiJ;QAAuI;QAA4F;QAA6H;KAA+F;IAC9hGC,GAAG;QAAC;QAAqI;KAAkI;AAC7Q;AACA,MAAMC,wBAAwB5C,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAwF;AACtJ,MAAM6C,0BAA0B7C,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAsN;AACtR,MAAM8C,8BAA8B9C,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAA+jB;AAI7nB,MAAMV,+BAA+ByD,CAAAA;IAC1C,MAAMC,oBAAoBjD;IAC1B,MAAMkD,6BAA6BtB;IACnC,MAAMuB,6BAA6BT;IACnC,MAAMU,qBAAqBP;IAC3B,MAAMQ,uBAAuBP;IAC7B,MAAMQ,2BAA2BP;IACjC,MAAMQ,sBAAsB1B;IAC5B,MAAM,EACJpC,aAAa,EACd,GAAGuD;IACJA,MAAMxD,IAAI,CAACgE,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBE,IAAI,EAAEyD,mBAAmBD,MAAMxD,IAAI,CAACgE,SAAS;IACtGR,MAAMvD,aAAa,CAAC+D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBG,aAAa,EAAEyD,4BAA4BzD,cAAciE,EAAE,KAAK,UAAUH,oBAAoBxB,MAAM,EAAEiB,MAAMvD,aAAa,CAAC+D,SAAS;IACrMR,MAAMtD,aAAa,CAAC8D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBI,aAAa,EAAEyD,4BAA4BH,MAAMtD,aAAa,CAAC8D,SAAS;IAC1I,IAAIR,MAAMrD,KAAK,EAAE;QACfqD,MAAMrD,KAAK,CAAC6D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBK,KAAK,EAAEyD,oBAAoBJ,MAAMrD,KAAK,CAAC6D,SAAS;IAC5G;IACAR,MAAMpD,OAAO,CAAC4D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBM,OAAO,EAAEyD,sBAAsBL,MAAMpD,OAAO,CAAC4D,SAAS;IAClHR,MAAMnD,WAAW,CAAC2D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBO,WAAW,EAAEyD,0BAA0BN,MAAMnD,WAAW,CAAC2D,SAAS;IAClI,OAAOR;AACT,GACA,+CAA+C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AttachmentList", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AttachmentList;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAttachmentList = require("./useAttachmentList");
|
|
14
|
+
const _renderAttachmentList = require("./renderAttachmentList");
|
|
15
|
+
const _useAttachmentListStyles = require("./useAttachmentListStyles");
|
|
16
|
+
const _useAttachmentListContextValues = require("./useAttachmentListContextValues");
|
|
17
|
+
const AttachmentList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useAttachmentList.useAttachmentList_unstable)(props, ref);
|
|
19
|
+
const contextValues = (0, _useAttachmentListContextValues.useAttachmentListContextValues_unstable)(state);
|
|
20
|
+
(0, _useAttachmentListStyles.useAttachmentListStyles_unstable)(state);
|
|
21
|
+
return (0, _renderAttachmentList.renderAttachmentList_unstable)(state, contextValues);
|
|
22
|
+
});
|
|
23
|
+
AttachmentList.displayName = 'AttachmentList'; //# sourceMappingURL=AttachmentList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentList.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentList_unstable } from './useAttachmentList';\nimport { renderAttachmentList_unstable } from './renderAttachmentList';\nimport { useAttachmentListStyles_unstable } from './useAttachmentListStyles';\nimport { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';\nexport const AttachmentList = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useAttachmentList_unstable(props, ref);\n const contextValues = useAttachmentListContextValues_unstable(state);\n useAttachmentListStyles_unstable(state);\n return renderAttachmentList_unstable(state, contextValues);\n});\nAttachmentList.displayName = 'AttachmentList';\n//# sourceMappingURL=AttachmentList.js.map"],"names":["AttachmentList","React","forwardRef","props","ref","state","useAttachmentList_unstable","contextValues","useAttachmentListContextValues_unstable","useAttachmentListStyles_unstable","renderAttachmentList_unstable","displayName"],"mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;mCACoB;sCACG;yCACG;gDACO;AACjD,MAAMA,iBAAiB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAClE,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChD,MAAMG,gBAAgBC,IAAAA,uEAAuC,EAACH;IAC9DI,IAAAA,yDAAgC,EAACJ;IACjC,OAAOK,IAAAA,mDAA6B,EAACL,OAAOE;AAC9C;AACAP,eAAeW,WAAW,GAAG,kBAC7B,0CAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentList.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=AttachmentList.types.js.map"],"names":[],"mappings":";;;;CACA,gDAAgD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./AttachmentList"), exports);
|
|
7
|
+
_export_star._(require("./AttachmentList.types"), exports);
|
|
8
|
+
_export_star._(require("./renderAttachmentList"), exports);
|
|
9
|
+
_export_star._(require("./useAttachmentList"), exports);
|
|
10
|
+
_export_star._(require("./useAttachmentListStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|