@box/blueprint-web 11.5.2 → 11.7.0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BadgeProps } from './types';
|
|
2
2
|
export interface IconBadgeProps extends BadgeProps {
|
|
3
3
|
/** The variant of the icon badge. */
|
|
4
|
-
variant: 'file-pdf' | 'file-docs' | 'file-sheets' | 'file-image' | 'file-canvas' | 'file-pages' | 'file-keynote' | 'file-boxnote' | 'file-video' | 'folder-external' | 'folder-shared' | 'action-relay' | 'action-mention' | 'action-task' | 'action-taskapproval' | 'action-annotation' | 'action-performed-completed' | 'action-performed-rejected' | 'collaborator-external' | 'collaborator-admin' | 'collaborator-coadmin' | 'content-pin' | 'content-collection' | 'content-offline' | 'content-progress' | 'alert-error';
|
|
4
|
+
variant: 'file-pdf' | 'file-docs' | 'file-sheets' | 'file-image' | 'file-canvas' | 'file-pages' | 'file-keynote' | 'file-boxnote' | 'file-video' | 'folder-external' | 'folder-shared' | 'action-relay' | 'action-mention' | 'action-task' | 'action-taskapproval' | 'action-annotation' | 'action-performed-completed' | 'action-performed-rejected' | 'collaborator-external' | 'collaborator-admin' | 'collaborator-coadmin' | 'content-pin' | 'content-collection' | 'content-offline' | 'content-progress' | 'alert-error' | 'status-pending';
|
|
5
5
|
}
|
|
6
6
|
export declare const IconBadgeVariants: Array<IconBadgeProps["variant"]>;
|
|
7
7
|
export declare const IconBadge: (props: IconBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { FilePdf, FileDocs, FileSheets, FileImage, FileCanvas, FilePages, FileKeynote, FileBoxNote, FileVideo, FolderExternal, FolderShared, Relay, EllipsisBubble, Task, ApprovalTask, Annotation, Checkmark, XMark, GlobeBadge, Star, Pin, Arrow, CheckmarkUnderline, Loader, Alert } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
|
-
import {
|
|
3
|
+
import { ClockBadge } from '@box/blueprint-web-assets/icons/Line';
|
|
4
|
+
import { SurfaceBadgePdfSurface, GrayWhite, SurfaceBadgeDocsSurface, SurfaceBadgeSheetsSurface, SurfaceBadgeImageSurface, SurfaceBadgeCanvasSurface, SurfaceBadgePagesSurface, SurfaceBadgeKeynoteSurface, SurfaceBadgeBoxnoteSurface, Gray100, SurfaceBadgeVideoSurface, SurfaceBadgeFolderexternalSurface, SurfaceBadgeFoldersharedSurface, SurfaceBadgeRelaySurface, SurfaceBadgeMentionSurface, SurfaceBadgeTaskSurface, SurfaceBadgeTaskapprovalSurface, SurfaceBadgeAnnotationSurface, SurfaceBadgeCompletedSurface, SurfaceBadgeRejectedSurface, SurfaceBadgeExternalSurface, SurfaceBadgeAdminSurface, SurfaceBadgeCoadminSurface, SurfaceBadgePinSurface, Gray80, SurfaceBadgeCollectionSurface, SurfaceBadgeOfflineSurface, SurfaceBadgeProgressSurface, SurfaceBadgeErrorSurface, Yellorange50 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
4
5
|
import { createElement } from 'react';
|
|
5
6
|
import { BaseBadge } from './base-badge.js';
|
|
6
7
|
import styles from './base-badge.module.js';
|
|
@@ -139,6 +140,11 @@ const badgeVariantToIconProps = {
|
|
|
139
140
|
backgroundColor: SurfaceBadgeErrorSurface,
|
|
140
141
|
icon: Alert,
|
|
141
142
|
iconColor: GrayWhite
|
|
143
|
+
},
|
|
144
|
+
'status-pending': {
|
|
145
|
+
backgroundColor: Yellorange50,
|
|
146
|
+
icon: ClockBadge,
|
|
147
|
+
iconColor: Gray100
|
|
142
148
|
}
|
|
143
149
|
};
|
|
144
150
|
const badgeSizeToIconSize = {
|
|
@@ -32,7 +32,8 @@ const NotificationProvider = props => {
|
|
|
32
32
|
styledText,
|
|
33
33
|
sensitivity,
|
|
34
34
|
closeButtonAriaLabel,
|
|
35
|
-
typeIconAriaLabel
|
|
35
|
+
typeIconAriaLabel,
|
|
36
|
+
onClose: onCloseCb
|
|
36
37
|
} = args;
|
|
37
38
|
const notificationId = getUniqueId();
|
|
38
39
|
const onClose = id => () => {
|
|
@@ -41,6 +42,9 @@ const NotificationProvider = props => {
|
|
|
41
42
|
newValue.delete(id);
|
|
42
43
|
return newValue;
|
|
43
44
|
});
|
|
45
|
+
if (onCloseCb) {
|
|
46
|
+
onCloseCb();
|
|
47
|
+
}
|
|
44
48
|
};
|
|
45
49
|
const newNotificationProps = {
|
|
46
50
|
...args,
|