@box/blueprint-web 12.5.1 → 12.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.
- package/dist/lib-esm/badge/base-badge.module.js +1 -1
- package/dist/lib-esm/badge/icon-badge.d.ts +9 -0
- package/dist/lib-esm/badge/icon-badge.js +45 -15
- package/dist/lib-esm/branding-styles/branding-styles.d.ts +1 -1
- package/dist/lib-esm/branding-styles/branding-styles.js +3 -2
- package/dist/lib-esm/branding-styles/types.d.ts +2 -0
- package/dist/lib-esm/branding-styles/useCustomBranding.d.ts +3 -1
- package/dist/lib-esm/branding-styles/useCustomBranding.js +34 -30
- package/dist/lib-esm/ellipsizable-text/ellipsizable-text.js +2 -20
- package/dist/lib-esm/index.css +97 -65
- package/dist/lib-esm/index.js +1 -1
- package/dist/lib-esm/utils/TooltipWrapper.d.ts +7 -0
- package/dist/lib-esm/utils/TooltipWrapper.js +23 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"badgeContainer":"bp_base_badge_module_badgeContainer--
|
|
2
|
+
var styles = {"badgeContainer":"bp_base_badge_module_badgeContainer--0697a","badge":"bp_base_badge_module_badge--0697a","smallSizeBadge":"bp_base_badge_module_smallSizeBadge--0697a","mediumSizeBadge":"bp_base_badge_module_mediumSizeBadge--0697a","largeSizeBadge":"bp_base_badge_module_largeSizeBadge--0697a","xlargeSizeBadge":"bp_base_badge_module_xlargeSizeBadge--0697a","xxlargeSizeBadge":"bp_base_badge_module_xxlargeSizeBadge--0697a","iconBadge":"bp_base_badge_module_iconBadge--0697a","interactiveWrapper":"bp_base_badge_module_interactiveWrapper--0697a","statusBadge":"bp_base_badge_module_statusBadge--0697a","numericBadge":"bp_base_badge_module_numericBadge--0697a","numericBadgeSingleDigit":"bp_base_badge_module_numericBadgeSingleDigit--0697a","numericBadgeMoreDigits":"bp_base_badge_module_numericBadgeMoreDigits--0697a"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { type BadgeProps } from './types';
|
|
2
|
+
export interface TooltipConfig {
|
|
3
|
+
tooltipContent: string | number;
|
|
4
|
+
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
tooltipAriaLabel?: string;
|
|
6
|
+
}
|
|
2
7
|
export interface IconBadgeProps extends BadgeProps {
|
|
3
8
|
/** The variant of the icon badge. */
|
|
4
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';
|
|
10
|
+
/** Whether to show the tooltip when hovering over the badge. */
|
|
11
|
+
showTooltipOnBadge?: boolean;
|
|
12
|
+
/** The configuration for the tooltip, required if showTooltipOnBadge is true. */
|
|
13
|
+
tooltipConfig?: TooltipConfig;
|
|
5
14
|
}
|
|
6
15
|
export declare const IconBadgeVariants: Array<IconBadgeProps["variant"]>;
|
|
7
16
|
export declare const IconBadge: (props: IconBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } 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
3
|
import { ClockBadge } from '@box/blueprint-web-assets/icons/Line';
|
|
4
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';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import mapValues from 'lodash/mapValues';
|
|
5
7
|
import { createElement } from 'react';
|
|
8
|
+
import { TooltipWrapper } from '../utils/TooltipWrapper.js';
|
|
6
9
|
import { BaseBadge } from './base-badge.js';
|
|
7
10
|
import styles from './base-badge.module.js';
|
|
8
11
|
import { useSingleChildCheck } from './utils/useSingleChildCheck.js';
|
|
@@ -159,7 +162,9 @@ const IconBadge = props => {
|
|
|
159
162
|
size,
|
|
160
163
|
variant,
|
|
161
164
|
children,
|
|
162
|
-
offset
|
|
165
|
+
offset,
|
|
166
|
+
showTooltipOnBadge,
|
|
167
|
+
tooltipConfig
|
|
163
168
|
} = props;
|
|
164
169
|
const {
|
|
165
170
|
backgroundColor,
|
|
@@ -169,21 +174,46 @@ const IconBadge = props => {
|
|
|
169
174
|
} = badgeVariantToIconProps[variant];
|
|
170
175
|
const iconSize = badgeSizeToIconSize[size];
|
|
171
176
|
useSingleChildCheck(children);
|
|
177
|
+
const offsetStyle = mapValues(offset, value => {
|
|
178
|
+
const num = Number(value);
|
|
179
|
+
return Number.isInteger(num) ? `${num - 1}px` : '0';
|
|
180
|
+
});
|
|
181
|
+
const badge = jsx(BaseBadge, {
|
|
182
|
+
backgroundColor: backgroundColor,
|
|
183
|
+
className: styles.iconBadge,
|
|
184
|
+
offset: showTooltipOnBadge ? undefined : offset,
|
|
185
|
+
size: size,
|
|
186
|
+
children: /*#__PURE__*/createElement(icon, {
|
|
187
|
+
color: iconColor,
|
|
188
|
+
height: iconSize,
|
|
189
|
+
width: iconSize,
|
|
190
|
+
role: 'presentation',
|
|
191
|
+
style: iconStyle || {}
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
if (showTooltipOnBadge && tooltipConfig) {
|
|
195
|
+
return jsxs("div", {
|
|
196
|
+
className: styles.badgeContainer,
|
|
197
|
+
children: [children, jsx(TooltipWrapper, {
|
|
198
|
+
tooltipContent: tooltipConfig.tooltipContent,
|
|
199
|
+
tooltipSide: tooltipConfig.tooltipSide,
|
|
200
|
+
withTooltip: showTooltipOnBadge,
|
|
201
|
+
children: jsx("div", {
|
|
202
|
+
"aria-label": tooltipConfig.tooltipAriaLabel,
|
|
203
|
+
className: clsx(styles.interactiveWrapper, styles[`${size}SizeBadge`]),
|
|
204
|
+
role: "button",
|
|
205
|
+
style: {
|
|
206
|
+
...offsetStyle
|
|
207
|
+
},
|
|
208
|
+
tabIndex: 0,
|
|
209
|
+
children: badge
|
|
210
|
+
})
|
|
211
|
+
})]
|
|
212
|
+
});
|
|
213
|
+
}
|
|
172
214
|
return jsxs("div", {
|
|
173
215
|
className: styles.badgeContainer,
|
|
174
|
-
children: [children,
|
|
175
|
-
backgroundColor: backgroundColor,
|
|
176
|
-
className: styles.iconBadge,
|
|
177
|
-
offset: offset,
|
|
178
|
-
size: size,
|
|
179
|
-
children: /*#__PURE__*/createElement(icon, {
|
|
180
|
-
color: iconColor,
|
|
181
|
-
height: iconSize,
|
|
182
|
-
width: iconSize,
|
|
183
|
-
role: 'presentation',
|
|
184
|
-
style: iconStyle || {}
|
|
185
|
-
})
|
|
186
|
-
})]
|
|
216
|
+
children: [children, badge]
|
|
187
217
|
});
|
|
188
218
|
};
|
|
189
219
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type BrandingStylesProps } from './types';
|
|
2
|
-
export declare const BrandingStyles: ({ brandColor }: BrandingStylesProps) => null;
|
|
2
|
+
export declare const BrandingStyles: ({ brandColor, containerSelector }: BrandingStylesProps) => null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useCustomBranding } from './useCustomBranding.js';
|
|
2
2
|
|
|
3
3
|
const BrandingStyles = ({
|
|
4
|
-
brandColor
|
|
4
|
+
brandColor,
|
|
5
|
+
containerSelector = ':root[lang]'
|
|
5
6
|
}) => {
|
|
6
|
-
useCustomBranding(brandColor);
|
|
7
|
+
useCustomBranding(brandColor, containerSelector);
|
|
7
8
|
return null;
|
|
8
9
|
};
|
|
9
10
|
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { createTheme } from './utils/createTheme';
|
|
2
|
+
export declare const getBrandingTokensCssRule: (buieTheme: ReturnType<typeof createTheme>, isBrandingEnabled: boolean, containerSelector: string, tokenPrefix?: string) => string;
|
|
3
|
+
export declare const useCustomBranding: (brandColor: string, containerSelector?: string) => void;
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gray65, BoxBlue100 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
2
2
|
import { useEnhancedEffect } from '../utils/useEnhancedEffect.js';
|
|
3
3
|
import { createTheme } from './utils/createTheme.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const getBrandingTokensCssRule = (buieTheme, isBrandingEnabled, containerSelector, tokenPrefix = '--') => {
|
|
6
|
+
return `
|
|
7
|
+
${containerSelector} {
|
|
8
|
+
/* Button branding tokens */
|
|
9
|
+
${tokenPrefix}text-text-brand-on-color: ${buieTheme.primary.buttonForeground};
|
|
10
|
+
${tokenPrefix}surface-surface-brand: ${buieTheme.primary.buttonBackground};
|
|
11
|
+
${tokenPrefix}surface-surface-brand-hover: ${buieTheme.primary.buttonBackgroundHover};
|
|
12
|
+
${tokenPrefix}surface-surface-brand-pressed: ${buieTheme.primary.buttonBackgroundActive};
|
|
13
|
+
/* BUIE Theme has no token for disabled and busy button. Setting to default TODO: Confirm with designers */
|
|
14
|
+
${tokenPrefix}surface-surface-brand-disabled: ${buieTheme.primary.buttonBackground};
|
|
15
|
+
${tokenPrefix}surface-surface-brand-busy: ${buieTheme.primary.buttonBackground};
|
|
16
|
+
|
|
17
|
+
/* Nav branding tokens */
|
|
18
|
+
${tokenPrefix}surface-nav-surface-brand-selected-focus: ${buieTheme.primary.backgroundActive};
|
|
19
|
+
${tokenPrefix}surface-nav-surface-brand-selected: ${buieTheme.primary.backgroundActive};
|
|
20
|
+
${tokenPrefix}surface-nav-surface-brand-focus: ${buieTheme.primary.backgroundActive};
|
|
21
|
+
${tokenPrefix}surface-nav-surface-brand-hover: ${buieTheme.primary.backgroundHover};
|
|
22
|
+
${tokenPrefix}surface-nav-surface-brand: ${buieTheme.primary.background};
|
|
23
|
+
${tokenPrefix}surface-nav-surface-brand-foreground: ${buieTheme.primary.foreground};
|
|
24
|
+
${tokenPrefix}surface-nav-surface-brand-divider: ${buieTheme.primary.dividerBackground};
|
|
25
|
+
|
|
26
|
+
/* Illustrations branding tokens */
|
|
27
|
+
${tokenPrefix}surface-illustration-surface-box-neutral: ${isBrandingEnabled ? Gray65 : BoxBlue100};
|
|
28
|
+
|
|
29
|
+
/* Progress bar branding tokens */
|
|
30
|
+
${tokenPrefix}surface-progress-bar-surface-brand-background: ${buieTheme.primary.progressBarBackground};
|
|
31
|
+
}`;
|
|
32
|
+
};
|
|
33
|
+
const useCustomBranding = (brandColor, containerSelector = ':root[lang]') => {
|
|
6
34
|
useEnhancedEffect(() => {
|
|
7
35
|
const buieTheme = createTheme(brandColor);
|
|
8
36
|
const isBrandingEnabled = brandColor.toLowerCase() !== BoxBlue100.toLowerCase();
|
|
@@ -11,37 +39,13 @@ const useCustomBranding = brandColor => {
|
|
|
11
39
|
// add data-blueprint property for debugging
|
|
12
40
|
stylesheet.dataset.blueprint = '';
|
|
13
41
|
document.head.appendChild(stylesheet);
|
|
14
|
-
stylesheet.sheet?.insertRule(
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
/* Button branding tokens */
|
|
18
|
-
--text-text-brand-on-color: ${buieTheme.primary.buttonForeground};
|
|
19
|
-
--surface-surface-brand: ${buieTheme.primary.buttonBackground};
|
|
20
|
-
--surface-surface-brand-hover: ${buieTheme.primary.buttonBackgroundHover};
|
|
21
|
-
--surface-surface-brand-pressed: ${buieTheme.primary.buttonBackgroundActive};
|
|
22
|
-
/* BUIE Theme has no token for disabled and busy button. Setting to default TODO: Confirm with designers */
|
|
23
|
-
--surface-surface-brand-disabled: ${buieTheme.primary.buttonBackground};
|
|
24
|
-
--surface-surface-brand-busy: ${buieTheme.primary.buttonBackground};
|
|
25
|
-
|
|
26
|
-
/* Nav branding tokens */
|
|
27
|
-
--surface-nav-surface-brand-selected-focus: ${buieTheme.primary.backgroundActive};
|
|
28
|
-
--surface-nav-surface-brand-selected: ${buieTheme.primary.backgroundActive};
|
|
29
|
-
--surface-nav-surface-brand-focus: ${buieTheme.primary.backgroundActive};
|
|
30
|
-
--surface-nav-surface-brand-hover: ${buieTheme.primary.backgroundHover};
|
|
31
|
-
--surface-nav-surface-brand: ${buieTheme.primary.background};
|
|
32
|
-
--surface-nav-surface-brand-foreground: ${buieTheme.primary.foreground};
|
|
33
|
-
--surface-nav-surface-brand-divider: ${buieTheme.primary.dividerBackground};
|
|
34
|
-
|
|
35
|
-
/* Illustrations branding tokens */
|
|
36
|
-
--surface-illustration-surface-box-neutral: ${isBrandingEnabled ? Gray65 : BoxBlue100};
|
|
37
|
-
|
|
38
|
-
/* Progress bar branding tokens */
|
|
39
|
-
--surface-progress-bar-surface-brand-background: ${buieTheme.primary.progressBarBackground};
|
|
40
|
-
}`, 0);
|
|
42
|
+
stylesheet.sheet?.insertRule(getBrandingTokensCssRule(buieTheme, isBrandingEnabled, containerSelector), 0);
|
|
43
|
+
// Blueprint 2.0 tokens
|
|
44
|
+
stylesheet.sheet?.insertRule(getBrandingTokensCssRule(buieTheme, isBrandingEnabled, containerSelector, '--bp-'), 0);
|
|
41
45
|
return () => {
|
|
42
46
|
document.head.removeChild(stylesheet);
|
|
43
47
|
};
|
|
44
48
|
}, [brandColor]);
|
|
45
49
|
};
|
|
46
50
|
|
|
47
|
-
export { useCustomBranding };
|
|
51
|
+
export { getBrandingTokensCssRule, useCustomBranding };
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, createRef } from 'react';
|
|
3
|
-
import { Focusable } from '../focusable/focusable.js';
|
|
4
3
|
import { Text } from '../text/text.js';
|
|
5
|
-
import {
|
|
4
|
+
import { TooltipWrapper } from '../utils/TooltipWrapper.js';
|
|
6
5
|
import { useForkRef } from '../utils/useForkRef.js';
|
|
7
6
|
import { useIsEllipsized } from '../utils/useIsEllipsized.js';
|
|
8
7
|
|
|
9
|
-
const Wrapper = ({
|
|
10
|
-
children,
|
|
11
|
-
withTooltip,
|
|
12
|
-
tooltipContent,
|
|
13
|
-
tooltipSide
|
|
14
|
-
}) => {
|
|
15
|
-
if (withTooltip) {
|
|
16
|
-
return jsx(Tooltip, {
|
|
17
|
-
content: tooltipContent,
|
|
18
|
-
side: tooltipSide,
|
|
19
|
-
children: jsx(Focusable, {
|
|
20
|
-
children: children
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return children;
|
|
25
|
-
};
|
|
26
8
|
const EllipsizableText = /*#__PURE__*/forwardRef(({
|
|
27
9
|
children,
|
|
28
10
|
lineClamp,
|
|
@@ -32,7 +14,7 @@ const EllipsizableText = /*#__PURE__*/forwardRef(({
|
|
|
32
14
|
}, forwardedRef) => {
|
|
33
15
|
const textRef = /*#__PURE__*/createRef();
|
|
34
16
|
const isEllipsized = useIsEllipsized(textRef);
|
|
35
|
-
return jsx(
|
|
17
|
+
return jsx(TooltipWrapper, {
|
|
36
18
|
tooltipContent: children,
|
|
37
19
|
tooltipSide: tooltipSide,
|
|
38
20
|
withTooltip: isEllipsized,
|
package/dist/lib-esm/index.css
CHANGED
|
@@ -895,13 +895,63 @@
|
|
|
895
895
|
[data-button-wrapper][data-focus-visible] .bp_avatar_module_avatar--e0424{
|
|
896
896
|
box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--outline-focus-on-light);
|
|
897
897
|
}
|
|
898
|
+
.bp_tooltip_module_content--db0b5{
|
|
899
|
+
border-radius:var(--radius-1);
|
|
900
|
+
box-sizing:border-box;
|
|
901
|
+
font-family:var(--body-default-font-family);
|
|
902
|
+
font-size:var(--body-default-font-size);
|
|
903
|
+
font-weight:var(--body-default-font-weight);
|
|
904
|
+
letter-spacing:var(--body-default-letter-spacing);
|
|
905
|
+
line-height:var(--body-default-line-height);
|
|
906
|
+
max-width:200px;
|
|
907
|
+
padding:var(--space-2) var(--space-3);
|
|
908
|
+
position:relative;
|
|
909
|
+
-webkit-text-decoration:var(--body-default-text-decoration);
|
|
910
|
+
text-decoration:var(--body-default-text-decoration);
|
|
911
|
+
text-transform:var(--body-default-text-case);
|
|
912
|
+
word-break:break-word;
|
|
913
|
+
z-index:2147483647;
|
|
914
|
+
}
|
|
915
|
+
.bp_tooltip_module_content--db0b5.bp_tooltip_module_standard--db0b5{
|
|
916
|
+
background-color:var(--surface-tooltip-surface);
|
|
917
|
+
border:var(--border-1) solid var(--surface-tooltip-surface);
|
|
918
|
+
color:var(--text-text-on-dark);
|
|
919
|
+
}
|
|
920
|
+
.bp_tooltip_module_content--db0b5.bp_tooltip_module_error--db0b5{
|
|
921
|
+
background-color:var(--surface-tooltip-surface-error);
|
|
922
|
+
border:var(--border-1) solid var(--border-tooltip-border-error);
|
|
923
|
+
color:var(--text-text-on-light);
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.bp_tooltip_module_arrow--db0b5{
|
|
927
|
+
border-left:8.7px solid #0000;
|
|
928
|
+
border-right:8.7px solid #0000;
|
|
929
|
+
border-top:8.7px solid var(--surface-tooltip-surface);
|
|
930
|
+
display:block;
|
|
931
|
+
height:0;
|
|
932
|
+
width:0;
|
|
933
|
+
}
|
|
934
|
+
.bp_tooltip_module_arrow--db0b5.bp_tooltip_module_error--db0b5{
|
|
935
|
+
border-top-color:var(--border-tooltip-border-error);
|
|
936
|
+
}
|
|
937
|
+
.bp_tooltip_module_arrow--db0b5.bp_tooltip_module_error--db0b5::after{
|
|
938
|
+
border-left:7.7px solid #0000;
|
|
939
|
+
border-right:7.7px solid #0000;
|
|
940
|
+
border-top:7.7px solid var(--surface-tooltip-surface-error);
|
|
941
|
+
content:"";
|
|
942
|
+
height:0;
|
|
943
|
+
left:1px;
|
|
944
|
+
position:absolute;
|
|
945
|
+
top:-.7px;
|
|
946
|
+
width:0;
|
|
947
|
+
}
|
|
898
948
|
|
|
899
|
-
.bp_base_badge_module_badgeContainer--
|
|
949
|
+
.bp_base_badge_module_badgeContainer--0697a{
|
|
900
950
|
display:inline-flex;
|
|
901
951
|
position:relative;
|
|
902
952
|
}
|
|
903
953
|
|
|
904
|
-
.bp_base_badge_module_badge--
|
|
954
|
+
.bp_base_badge_module_badge--0697a{
|
|
905
955
|
align-items:center;
|
|
906
956
|
border:var(--border-2) solid var(--border-badge-border);
|
|
907
957
|
border-radius:var(--radius-half);
|
|
@@ -913,66 +963,98 @@
|
|
|
913
963
|
user-select:none;
|
|
914
964
|
}
|
|
915
965
|
|
|
916
|
-
.bp_base_badge_module_smallSizeBadge--
|
|
966
|
+
.bp_base_badge_module_smallSizeBadge--0697a{
|
|
917
967
|
height:var(--size-2);
|
|
918
968
|
min-width:var(--size-2);
|
|
919
969
|
}
|
|
920
970
|
|
|
921
|
-
.bp_base_badge_module_mediumSizeBadge--
|
|
971
|
+
.bp_base_badge_module_mediumSizeBadge--0697a{
|
|
922
972
|
height:var(--size-3);
|
|
923
973
|
min-width:var(--size-3);
|
|
924
974
|
}
|
|
925
975
|
|
|
926
|
-
.bp_base_badge_module_largeSizeBadge--
|
|
976
|
+
.bp_base_badge_module_largeSizeBadge--0697a{
|
|
927
977
|
height:var(--size-4);
|
|
928
978
|
min-width:var(--size-4);
|
|
929
979
|
}
|
|
930
980
|
|
|
931
|
-
.bp_base_badge_module_xlargeSizeBadge--
|
|
981
|
+
.bp_base_badge_module_xlargeSizeBadge--0697a{
|
|
932
982
|
height:var(--size-5);
|
|
933
983
|
min-width:var(--size-5);
|
|
934
984
|
}
|
|
935
985
|
|
|
936
|
-
.bp_base_badge_module_xxlargeSizeBadge--
|
|
986
|
+
.bp_base_badge_module_xxlargeSizeBadge--0697a{
|
|
937
987
|
height:var(--size-6);
|
|
938
988
|
min-width:var(--size-6);
|
|
939
989
|
}
|
|
940
990
|
|
|
941
|
-
.bp_base_badge_module_iconBadge--
|
|
991
|
+
.bp_base_badge_module_iconBadge--0697a{
|
|
942
992
|
bottom:-5%;
|
|
943
993
|
right:-5%;
|
|
944
994
|
}
|
|
945
995
|
|
|
946
|
-
.
|
|
996
|
+
.bp_base_badge_module_interactiveWrapper--0697a{
|
|
997
|
+
border:var(--border-2) solid #0000;
|
|
998
|
+
border-radius:50%;
|
|
999
|
+
bottom:calc(-5% - var(--border-2)/2);
|
|
1000
|
+
outline-offset:var(--size-05);
|
|
1001
|
+
position:absolute;
|
|
1002
|
+
right:calc(-5% - var(--border-2)/2);
|
|
1003
|
+
}
|
|
1004
|
+
.bp_base_badge_module_interactiveWrapper--0697a.bp_base_badge_module_smallSizeBadge--0697a{
|
|
1005
|
+
width:var(--size-2);
|
|
1006
|
+
}
|
|
1007
|
+
.bp_base_badge_module_interactiveWrapper--0697a.bp_base_badge_module_mediumSizeBadge--0697a{
|
|
1008
|
+
width:var(--size-3);
|
|
1009
|
+
}
|
|
1010
|
+
.bp_base_badge_module_interactiveWrapper--0697a.bp_base_badge_module_largeSizeBadge--0697a{
|
|
1011
|
+
width:var(--size-4);
|
|
1012
|
+
}
|
|
1013
|
+
.bp_base_badge_module_interactiveWrapper--0697a.bp_base_badge_module_xlargeSizeBadge--0697a{
|
|
1014
|
+
width:var(--size-5);
|
|
1015
|
+
}
|
|
1016
|
+
.bp_base_badge_module_interactiveWrapper--0697a.bp_base_badge_module_xxlargeSizeBadge--0697a{
|
|
1017
|
+
width:var(--size-6);
|
|
1018
|
+
}
|
|
1019
|
+
.bp_base_badge_module_interactiveWrapper--0697a::before{
|
|
1020
|
+
content:"";
|
|
1021
|
+
left:calc(var(--size-6)*-1/4);
|
|
1022
|
+
min-height:var(--size-6);
|
|
1023
|
+
min-width:var(--size-6);
|
|
1024
|
+
position:absolute;
|
|
1025
|
+
top:calc(var(--size-6)*-1/4);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.bp_base_badge_module_statusBadge--0697a{
|
|
947
1029
|
bottom:-20%;
|
|
948
1030
|
right:-20%;
|
|
949
1031
|
}
|
|
950
1032
|
|
|
951
|
-
.bp_base_badge_module_statusBadge--
|
|
1033
|
+
.bp_base_badge_module_statusBadge--0697a.bp_base_badge_module_largeSizeBadge--0697a{
|
|
952
1034
|
bottom:-22%;
|
|
953
1035
|
right:-22%;
|
|
954
1036
|
}
|
|
955
1037
|
|
|
956
|
-
.bp_base_badge_module_statusBadge--
|
|
1038
|
+
.bp_base_badge_module_statusBadge--0697a.bp_base_badge_module_xlargeSizeBadge--0697a{
|
|
957
1039
|
bottom:-15%;
|
|
958
1040
|
right:-15%;
|
|
959
1041
|
}
|
|
960
1042
|
|
|
961
|
-
.bp_base_badge_module_statusBadge--
|
|
1043
|
+
.bp_base_badge_module_statusBadge--0697a.bp_base_badge_module_xxlargeSizeBadge--0697a{
|
|
962
1044
|
bottom:-4%;
|
|
963
1045
|
right:-4%;
|
|
964
1046
|
}
|
|
965
1047
|
|
|
966
|
-
.bp_base_badge_module_numericBadge--
|
|
1048
|
+
.bp_base_badge_module_numericBadge--0697a{
|
|
967
1049
|
left:60%;
|
|
968
1050
|
top:0;
|
|
969
1051
|
}
|
|
970
1052
|
|
|
971
|
-
.bp_base_badge_module_numericBadgeSingleDigit--
|
|
1053
|
+
.bp_base_badge_module_numericBadgeSingleDigit--0697a{
|
|
972
1054
|
padding:1px;
|
|
973
1055
|
}
|
|
974
1056
|
|
|
975
|
-
.bp_base_badge_module_numericBadgeMoreDigits--
|
|
1057
|
+
.bp_base_badge_module_numericBadgeMoreDigits--0697a{
|
|
976
1058
|
padding:1px 3px;
|
|
977
1059
|
}
|
|
978
1060
|
.bp_button_wrapper_module_buttonWrapper--b0897{
|
|
@@ -990,56 +1072,6 @@
|
|
|
990
1072
|
.bp_card_module_card--558da.bp_card_module_dropshadow-3--558da{
|
|
991
1073
|
box-shadow:var(--dropshadow-3);
|
|
992
1074
|
}
|
|
993
|
-
.bp_tooltip_module_content--db0b5{
|
|
994
|
-
border-radius:var(--radius-1);
|
|
995
|
-
box-sizing:border-box;
|
|
996
|
-
font-family:var(--body-default-font-family);
|
|
997
|
-
font-size:var(--body-default-font-size);
|
|
998
|
-
font-weight:var(--body-default-font-weight);
|
|
999
|
-
letter-spacing:var(--body-default-letter-spacing);
|
|
1000
|
-
line-height:var(--body-default-line-height);
|
|
1001
|
-
max-width:200px;
|
|
1002
|
-
padding:var(--space-2) var(--space-3);
|
|
1003
|
-
position:relative;
|
|
1004
|
-
-webkit-text-decoration:var(--body-default-text-decoration);
|
|
1005
|
-
text-decoration:var(--body-default-text-decoration);
|
|
1006
|
-
text-transform:var(--body-default-text-case);
|
|
1007
|
-
word-break:break-word;
|
|
1008
|
-
z-index:2147483647;
|
|
1009
|
-
}
|
|
1010
|
-
.bp_tooltip_module_content--db0b5.bp_tooltip_module_standard--db0b5{
|
|
1011
|
-
background-color:var(--surface-tooltip-surface);
|
|
1012
|
-
border:var(--border-1) solid var(--surface-tooltip-surface);
|
|
1013
|
-
color:var(--text-text-on-dark);
|
|
1014
|
-
}
|
|
1015
|
-
.bp_tooltip_module_content--db0b5.bp_tooltip_module_error--db0b5{
|
|
1016
|
-
background-color:var(--surface-tooltip-surface-error);
|
|
1017
|
-
border:var(--border-1) solid var(--border-tooltip-border-error);
|
|
1018
|
-
color:var(--text-text-on-light);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
.bp_tooltip_module_arrow--db0b5{
|
|
1022
|
-
border-left:8.7px solid #0000;
|
|
1023
|
-
border-right:8.7px solid #0000;
|
|
1024
|
-
border-top:8.7px solid var(--surface-tooltip-surface);
|
|
1025
|
-
display:block;
|
|
1026
|
-
height:0;
|
|
1027
|
-
width:0;
|
|
1028
|
-
}
|
|
1029
|
-
.bp_tooltip_module_arrow--db0b5.bp_tooltip_module_error--db0b5{
|
|
1030
|
-
border-top-color:var(--border-tooltip-border-error);
|
|
1031
|
-
}
|
|
1032
|
-
.bp_tooltip_module_arrow--db0b5.bp_tooltip_module_error--db0b5::after{
|
|
1033
|
-
border-left:7.7px solid #0000;
|
|
1034
|
-
border-right:7.7px solid #0000;
|
|
1035
|
-
border-top:7.7px solid var(--surface-tooltip-surface-error);
|
|
1036
|
-
content:"";
|
|
1037
|
-
height:0;
|
|
1038
|
-
left:1px;
|
|
1039
|
-
position:absolute;
|
|
1040
|
-
top:-.7px;
|
|
1041
|
-
width:0;
|
|
1042
|
-
}
|
|
1043
1075
|
|
|
1044
1076
|
.bp_card_tooltip_module_content--065eb{
|
|
1045
1077
|
animation-duration:.4s;
|
package/dist/lib-esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { StatusBadge } from './badge/status-badge.js';
|
|
|
7
7
|
export { BlueprintModernizationProvider } from './blueprint-modernization-context/blueprint-modernization-context.js';
|
|
8
8
|
export { useBlueprintModernization } from './blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
9
|
export { BrandingStyles } from './branding-styles/branding-styles.js';
|
|
10
|
-
export { useCustomBranding } from './branding-styles/useCustomBranding.js';
|
|
10
|
+
export { getBrandingTokensCssRule, useCustomBranding } from './branding-styles/useCustomBranding.js';
|
|
11
11
|
export { Button } from './button/button.js';
|
|
12
12
|
export { ButtonWrapper } from './button-wrapper/button-wrapper.js';
|
|
13
13
|
export { Card } from './card/card.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TooltipProps } from '../tooltip';
|
|
2
|
+
export declare const TooltipWrapper: ({ children, withTooltip, tooltipContent, tooltipSide, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
withTooltip: boolean;
|
|
5
|
+
tooltipContent: TooltipProps["content"];
|
|
6
|
+
tooltipSide?: TooltipProps["side"];
|
|
7
|
+
}) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Focusable } from '../focusable/focusable.js';
|
|
3
|
+
import { Tooltip } from '../tooltip/tooltip.js';
|
|
4
|
+
|
|
5
|
+
const TooltipWrapper = ({
|
|
6
|
+
children,
|
|
7
|
+
withTooltip,
|
|
8
|
+
tooltipContent,
|
|
9
|
+
tooltipSide
|
|
10
|
+
}) => {
|
|
11
|
+
if (withTooltip) {
|
|
12
|
+
return jsx(Tooltip, {
|
|
13
|
+
content: tooltipContent,
|
|
14
|
+
side: tooltipSide,
|
|
15
|
+
children: jsx(Focusable, {
|
|
16
|
+
children: children
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return children;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { TooltipWrapper };
|