@box/blueprint-web 12.16.0 → 12.17.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.
|
@@ -6,7 +6,7 @@ export interface TooltipConfig {
|
|
|
6
6
|
}
|
|
7
7
|
export interface IconBadgeProps extends BadgeProps {
|
|
8
8
|
/** The variant of the icon badge. */
|
|
9
|
-
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';
|
|
9
|
+
variant: 'file-audio' | 'file-bookmark' | 'file-box-app' | 'file-code' | 'file-default' | 'file-drawing' | 'file-excel' | 'file-hub' | 'file-illustrator' | 'file-indesign' | 'file-numbers' | 'file-photoshop' | 'file-powerpoint' | 'file-presentation' | 'file-slides' | 'file-spreadsheet' | 'file-text' | 'file-three-d' | 'file-vector' | 'file-word' | 'file-zip' | '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';
|
|
10
10
|
/** Whether to show the tooltip when hovering over the badge. */
|
|
11
11
|
showTooltipOnBadge?: boolean;
|
|
12
12
|
/** The configuration for the tooltip, required if showTooltipOnBadge is true. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FileAudio, FileBookmark, BoxApps, FileBoxNote, FileCanvas, Code, FileDefault, FileDocs, FileDrawing, FileExcel, Hubs, FileIllustrator, FileImage, FileIndesign, FileKeynote, FileNumbers, FilePages, FilePdf, FilePhotoshop, FilePowerpoint, FilePresentation, FileSheets, FileSlides, FileSpreadsheet, FileText, FileThreeD, FileVector, FileVideo, FileWord, FileZip, FolderExternal, FolderShared, Relay, EllipsisBubble, Task, ApprovalTask, Annotation, Checkmark, XMark, GlobeBadge, Star, Pin, Arrow, CheckmarkUnderline, Loader, Alert, ClockBadge } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
|
+
import { SurfaceBadgeAudioSurface, GrayWhite, SurfaceBadgeBookmarkSurface, SurfaceBadgeBoxappsSurface, SurfaceBadgeBoxnoteSurface, Gray100, SurfaceBadgeCanvasSurface, SurfaceBadgeCodeSurface, SurfaceBadgeDefaultSurface, SurfaceBadgeDocsSurface, SurfaceBadgeDrawingSurface, SurfaceBadgeExcelSurface, SurfaceBadgeHubsSurface, SurfaceBadgeIllustratorSurface, IconIconIllustrator, SurfaceBadgeImageSurface, SurfaceBadgeIndesignSurface, IconIconIndesign, SurfaceBadgeKeynoteSurface, SurfaceBadgeNumbersSurface, SurfaceBadgePagesSurface, SurfaceBadgePdfSurface, SurfaceBadgePhotoshopSurface, IconIconPhotoshop, SurfaceBadgePowerpointSurface, SurfaceBadgePresentationSurface, SurfaceBadgeSheetsSurface, SurfaceBadgeSlidesSurface, GrayBlack, SurfaceBadgeSpreadsheetSurface, SurfaceBadgeTextSurface, SurfaceBadgeThreeDSurface, SurfaceBadgeVectorSurface, SurfaceBadgeVideoSurface, SurfaceBadgeWordSurface, SurfaceBadgeZipSurface, SurfaceBadgeFolderexternalSurface, SurfaceBadgeFoldersharedSurface, SurfaceBadgeRelaySurface, SurfaceBadgeMentionSurface, SurfaceBadgeTaskSurface, SurfaceBadgeTaskapprovalSurface, SurfaceBadgeAnnotationSurface, SurfaceBadgeCompletedSurface, SurfaceBadgeRejectedSurface, SurfaceBadgeExternalSurface, SurfaceBadgeAdminSurface, SurfaceBadgeCoadminSurface, SurfaceBadgePinSurface, Gray80, SurfaceBadgeCollectionSurface, SurfaceBadgeOfflineSurface, SurfaceBadgeProgressSurface, SurfaceBadgeErrorSurface, Orange100 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import mapValues from 'lodash/mapValues';
|
|
6
6
|
import { createElement } from 'react';
|
|
@@ -10,9 +10,39 @@ import styles from './base-badge.module.js';
|
|
|
10
10
|
import { useSingleChildCheck } from './utils/useSingleChildCheck.js';
|
|
11
11
|
|
|
12
12
|
const badgeVariantToIconProps = {
|
|
13
|
-
'file-
|
|
14
|
-
backgroundColor:
|
|
15
|
-
icon:
|
|
13
|
+
'file-audio': {
|
|
14
|
+
backgroundColor: SurfaceBadgeAudioSurface,
|
|
15
|
+
icon: FileAudio,
|
|
16
|
+
iconColor: GrayWhite
|
|
17
|
+
},
|
|
18
|
+
'file-bookmark': {
|
|
19
|
+
backgroundColor: SurfaceBadgeBookmarkSurface,
|
|
20
|
+
icon: FileBookmark,
|
|
21
|
+
iconColor: GrayWhite
|
|
22
|
+
},
|
|
23
|
+
'file-box-app': {
|
|
24
|
+
backgroundColor: SurfaceBadgeBoxappsSurface,
|
|
25
|
+
icon: BoxApps,
|
|
26
|
+
iconColor: GrayWhite
|
|
27
|
+
},
|
|
28
|
+
'file-boxnote': {
|
|
29
|
+
backgroundColor: SurfaceBadgeBoxnoteSurface,
|
|
30
|
+
icon: FileBoxNote,
|
|
31
|
+
iconColor: Gray100
|
|
32
|
+
},
|
|
33
|
+
'file-canvas': {
|
|
34
|
+
backgroundColor: SurfaceBadgeCanvasSurface,
|
|
35
|
+
icon: FileCanvas,
|
|
36
|
+
iconColor: GrayWhite
|
|
37
|
+
},
|
|
38
|
+
'file-code': {
|
|
39
|
+
backgroundColor: SurfaceBadgeCodeSurface,
|
|
40
|
+
icon: Code,
|
|
41
|
+
iconColor: GrayWhite
|
|
42
|
+
},
|
|
43
|
+
'file-default': {
|
|
44
|
+
backgroundColor: SurfaceBadgeDefaultSurface,
|
|
45
|
+
icon: FileDefault,
|
|
16
46
|
iconColor: GrayWhite
|
|
17
47
|
},
|
|
18
48
|
'file-docs': {
|
|
@@ -20,19 +50,44 @@ const badgeVariantToIconProps = {
|
|
|
20
50
|
icon: FileDocs,
|
|
21
51
|
iconColor: GrayWhite
|
|
22
52
|
},
|
|
23
|
-
'file-
|
|
24
|
-
backgroundColor:
|
|
25
|
-
icon:
|
|
53
|
+
'file-drawing': {
|
|
54
|
+
backgroundColor: SurfaceBadgeDrawingSurface,
|
|
55
|
+
icon: FileDrawing,
|
|
56
|
+
iconColor: GrayWhite
|
|
57
|
+
},
|
|
58
|
+
'file-excel': {
|
|
59
|
+
backgroundColor: SurfaceBadgeExcelSurface,
|
|
60
|
+
icon: FileExcel,
|
|
26
61
|
iconColor: GrayWhite
|
|
27
62
|
},
|
|
63
|
+
'file-hub': {
|
|
64
|
+
backgroundColor: SurfaceBadgeHubsSurface,
|
|
65
|
+
icon: Hubs,
|
|
66
|
+
iconColor: GrayWhite
|
|
67
|
+
},
|
|
68
|
+
'file-illustrator': {
|
|
69
|
+
backgroundColor: SurfaceBadgeIllustratorSurface,
|
|
70
|
+
icon: FileIllustrator,
|
|
71
|
+
iconColor: IconIconIllustrator
|
|
72
|
+
},
|
|
28
73
|
'file-image': {
|
|
29
74
|
backgroundColor: SurfaceBadgeImageSurface,
|
|
30
75
|
icon: FileImage,
|
|
31
76
|
iconColor: GrayWhite
|
|
32
77
|
},
|
|
33
|
-
'file-
|
|
34
|
-
backgroundColor:
|
|
35
|
-
icon:
|
|
78
|
+
'file-indesign': {
|
|
79
|
+
backgroundColor: SurfaceBadgeIndesignSurface,
|
|
80
|
+
icon: FileIndesign,
|
|
81
|
+
iconColor: IconIconIndesign
|
|
82
|
+
},
|
|
83
|
+
'file-keynote': {
|
|
84
|
+
backgroundColor: SurfaceBadgeKeynoteSurface,
|
|
85
|
+
icon: FileKeynote,
|
|
86
|
+
iconColor: GrayWhite
|
|
87
|
+
},
|
|
88
|
+
'file-numbers': {
|
|
89
|
+
backgroundColor: SurfaceBadgeNumbersSurface,
|
|
90
|
+
icon: FileNumbers,
|
|
36
91
|
iconColor: GrayWhite
|
|
37
92
|
},
|
|
38
93
|
'file-pages': {
|
|
@@ -40,21 +95,71 @@ const badgeVariantToIconProps = {
|
|
|
40
95
|
icon: FilePages,
|
|
41
96
|
iconColor: GrayWhite
|
|
42
97
|
},
|
|
43
|
-
'file-
|
|
44
|
-
backgroundColor:
|
|
45
|
-
icon:
|
|
98
|
+
'file-pdf': {
|
|
99
|
+
backgroundColor: SurfaceBadgePdfSurface,
|
|
100
|
+
icon: FilePdf,
|
|
46
101
|
iconColor: GrayWhite
|
|
47
102
|
},
|
|
48
|
-
'file-
|
|
49
|
-
backgroundColor:
|
|
50
|
-
icon:
|
|
51
|
-
iconColor:
|
|
103
|
+
'file-photoshop': {
|
|
104
|
+
backgroundColor: SurfaceBadgePhotoshopSurface,
|
|
105
|
+
icon: FilePhotoshop,
|
|
106
|
+
iconColor: IconIconPhotoshop
|
|
107
|
+
},
|
|
108
|
+
'file-powerpoint': {
|
|
109
|
+
backgroundColor: SurfaceBadgePowerpointSurface,
|
|
110
|
+
icon: FilePowerpoint,
|
|
111
|
+
iconColor: GrayWhite
|
|
112
|
+
},
|
|
113
|
+
'file-presentation': {
|
|
114
|
+
backgroundColor: SurfaceBadgePresentationSurface,
|
|
115
|
+
icon: FilePresentation,
|
|
116
|
+
iconColor: GrayWhite
|
|
117
|
+
},
|
|
118
|
+
'file-sheets': {
|
|
119
|
+
backgroundColor: SurfaceBadgeSheetsSurface,
|
|
120
|
+
icon: FileSheets,
|
|
121
|
+
iconColor: GrayWhite
|
|
122
|
+
},
|
|
123
|
+
'file-slides': {
|
|
124
|
+
backgroundColor: SurfaceBadgeSlidesSurface,
|
|
125
|
+
icon: FileSlides,
|
|
126
|
+
iconColor: GrayBlack
|
|
127
|
+
},
|
|
128
|
+
'file-spreadsheet': {
|
|
129
|
+
backgroundColor: SurfaceBadgeSpreadsheetSurface,
|
|
130
|
+
icon: FileSpreadsheet,
|
|
131
|
+
iconColor: GrayWhite
|
|
132
|
+
},
|
|
133
|
+
'file-text': {
|
|
134
|
+
backgroundColor: SurfaceBadgeTextSurface,
|
|
135
|
+
icon: FileText,
|
|
136
|
+
iconColor: GrayWhite
|
|
137
|
+
},
|
|
138
|
+
'file-three-d': {
|
|
139
|
+
backgroundColor: SurfaceBadgeThreeDSurface,
|
|
140
|
+
icon: FileThreeD,
|
|
141
|
+
iconColor: GrayWhite
|
|
142
|
+
},
|
|
143
|
+
'file-vector': {
|
|
144
|
+
backgroundColor: SurfaceBadgeVectorSurface,
|
|
145
|
+
icon: FileVector,
|
|
146
|
+
iconColor: GrayWhite
|
|
52
147
|
},
|
|
53
148
|
'file-video': {
|
|
54
149
|
backgroundColor: SurfaceBadgeVideoSurface,
|
|
55
150
|
icon: FileVideo,
|
|
56
151
|
iconColor: GrayWhite
|
|
57
152
|
},
|
|
153
|
+
'file-word': {
|
|
154
|
+
backgroundColor: SurfaceBadgeWordSurface,
|
|
155
|
+
icon: FileWord,
|
|
156
|
+
iconColor: GrayWhite
|
|
157
|
+
},
|
|
158
|
+
'file-zip': {
|
|
159
|
+
backgroundColor: SurfaceBadgeZipSurface,
|
|
160
|
+
icon: FileZip,
|
|
161
|
+
iconColor: GrayWhite
|
|
162
|
+
},
|
|
58
163
|
'folder-external': {
|
|
59
164
|
backgroundColor: SurfaceBadgeFolderexternalSurface,
|
|
60
165
|
icon: FolderExternal,
|