@box/blueprint-web 8.6.0 → 8.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/lib-esm/index.css +31 -40
- package/lib-esm/primitives/icon-button/icon-button.js +2 -1
- package/lib-esm/primitives/icon-button/types.d.ts +1 -1
- package/lib-esm/side-panel/side-panel-close.js +20 -10
- package/lib-esm/side-panel/side-panel-header.js +5 -5
- package/lib-esm/side-panel/side-panel.module.js +1 -1
- package/lib-esm/side-panel/types.d.ts +1 -1
- package/package.json +2 -2
- package/lib-esm/utils/useMobile.d.ts +0 -1
- package/lib-esm/utils/useMobile.js +0 -14
package/lib-esm/index.css
CHANGED
|
@@ -5333,7 +5333,7 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5333
5333
|
transform:translateY(-50%);
|
|
5334
5334
|
}
|
|
5335
5335
|
|
|
5336
|
-
.bp_side_panel_module_content--
|
|
5336
|
+
.bp_side_panel_module_content--16bae{
|
|
5337
5337
|
background-color:var(--gray-white);
|
|
5338
5338
|
border-inline-start:var(--border-1) solid var(--border-divider-border);
|
|
5339
5339
|
display:flex;
|
|
@@ -5346,87 +5346,78 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5346
5346
|
overflow:hidden;
|
|
5347
5347
|
}
|
|
5348
5348
|
@media only screen and (width > 374px){
|
|
5349
|
-
.bp_side_panel_module_content--
|
|
5349
|
+
.bp_side_panel_module_content--16bae{
|
|
5350
5350
|
min-width:320px;
|
|
5351
5351
|
}
|
|
5352
5352
|
}
|
|
5353
|
-
.bp_side_panel_module_content--
|
|
5353
|
+
.bp_side_panel_module_content--16bae .bp_side_panel_module_header--16bae{
|
|
5354
5354
|
align-items:center;
|
|
5355
5355
|
background-color:var(--surface-surface);
|
|
5356
5356
|
border-bottom:var(--border-1) solid var(--border-divider-border);
|
|
5357
|
-
color:var(--text-text-on-light);
|
|
5358
5357
|
display:flex;
|
|
5359
|
-
font-size:1.125rem;
|
|
5360
5358
|
justify-content:space-between;
|
|
5361
|
-
line-height:1.5rem;
|
|
5362
5359
|
padding:var(--space-5) var(--space-4);
|
|
5363
5360
|
transition-duration:.2s;
|
|
5364
5361
|
transition-property:box-shadow;
|
|
5365
5362
|
transition-timing-function:cubic-bezier(0, 0, .6, 1);
|
|
5366
5363
|
word-break:break-word;
|
|
5367
5364
|
}
|
|
5368
|
-
.bp_side_panel_module_content--
|
|
5369
|
-
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5370
|
-
font-weight:700;
|
|
5371
|
-
letter-spacing:.01875rem;
|
|
5372
|
-
text-decoration:none;
|
|
5373
|
-
text-transform:none;
|
|
5374
|
-
}
|
|
5375
|
-
.bp_side_panel_module_content--1a002 .bp_side_panel_module_header--1a002.bp_side_panel_module_headerMobile--1a002{
|
|
5376
|
-
font-size:.9375rem;
|
|
5377
|
-
line-height:1.25rem;
|
|
5378
|
-
}
|
|
5379
|
-
.bp_side_panel_module_content--1a002 .bp_side_panel_module_headerShadow--1a002{
|
|
5365
|
+
.bp_side_panel_module_content--16bae .bp_side_panel_module_headerShadow--16bae{
|
|
5380
5366
|
box-shadow:var(--dropshadow-3);
|
|
5381
5367
|
}
|
|
5382
5368
|
|
|
5383
|
-
.bp_side_panel_module_persistentContent--
|
|
5369
|
+
.bp_side_panel_module_persistentContent--16bae{
|
|
5384
5370
|
position:relative;
|
|
5385
5371
|
}
|
|
5386
5372
|
|
|
5387
|
-
.bp_side_panel_module_contentAnimatedSlideIn--
|
|
5373
|
+
.bp_side_panel_module_contentAnimatedSlideIn--16bae{
|
|
5388
5374
|
animation-duration:.2s;
|
|
5389
|
-
animation-name:bp_side_panel_module_slideIn--
|
|
5375
|
+
animation-name:bp_side_panel_module_slideIn--16bae;
|
|
5390
5376
|
animation-timing-function:cubic-bezier(0, 0, .6, 1);
|
|
5391
5377
|
}
|
|
5392
5378
|
|
|
5393
|
-
.bp_side_panel_module_contentAnimatedSlideOut--
|
|
5379
|
+
.bp_side_panel_module_contentAnimatedSlideOut--16bae[data-state=closed]{
|
|
5394
5380
|
animation-duration:.2s;
|
|
5395
|
-
animation-name:bp_side_panel_module_slideOut--
|
|
5381
|
+
animation-name:bp_side_panel_module_slideOut--16bae;
|
|
5396
5382
|
animation-timing-function:cubic-bezier(0, 0, .6, 1);
|
|
5397
5383
|
}
|
|
5398
5384
|
|
|
5399
|
-
.bp_side_panel_module_contentNormal--
|
|
5385
|
+
.bp_side_panel_module_contentNormal--16bae{
|
|
5400
5386
|
width:360px;
|
|
5401
5387
|
}
|
|
5402
5388
|
|
|
5403
|
-
.bp_side_panel_module_contentLarge--
|
|
5389
|
+
.bp_side_panel_module_contentLarge--16bae{
|
|
5404
5390
|
width:420px;
|
|
5405
5391
|
}
|
|
5406
5392
|
|
|
5407
|
-
.bp_side_panel_module_dropShadowContent--
|
|
5393
|
+
.bp_side_panel_module_dropShadowContent--16bae{
|
|
5408
5394
|
box-shadow:var(--dropshadow-3);
|
|
5409
5395
|
}
|
|
5410
5396
|
|
|
5411
|
-
.bp_side_panel_module_content--
|
|
5397
|
+
.bp_side_panel_module_content--16bae .bp_side_panel_module_close--16bae{
|
|
5412
5398
|
color:var(--gray-65);
|
|
5413
5399
|
position:absolute;
|
|
5414
5400
|
right:var(--space-4);
|
|
5415
5401
|
top:var(--space-5);
|
|
5416
5402
|
}
|
|
5403
|
+
@media only screen and (width < 374px){
|
|
5404
|
+
.bp_side_panel_module_content--16bae .bp_side_panel_module_close--16bae{
|
|
5405
|
+
top:var(--space-4);
|
|
5406
|
+
}
|
|
5407
|
+
}
|
|
5417
5408
|
|
|
5418
|
-
.bp_side_panel_module_overlayContent--
|
|
5409
|
+
.bp_side_panel_module_overlayContent--16bae{
|
|
5419
5410
|
box-shadow:var(--dropshadow-3);
|
|
5420
5411
|
position:fixed;
|
|
5421
5412
|
right:0;
|
|
5422
5413
|
top:0;
|
|
5423
5414
|
z-index:300;
|
|
5424
5415
|
}
|
|
5425
|
-
.bp_side_panel_module_overlayContent--
|
|
5426
|
-
padding:var(--space-
|
|
5416
|
+
.bp_side_panel_module_overlayContent--16bae .bp_side_panel_module_header--16bae{
|
|
5417
|
+
padding:var(--space-5) var(--space-14) var(--space-5) var(--space-4);
|
|
5427
5418
|
}
|
|
5428
5419
|
|
|
5429
|
-
.bp_side_panel_module_overlay--
|
|
5420
|
+
.bp_side_panel_module_overlay--16bae{
|
|
5430
5421
|
background-color:var(--black-opacity-80);
|
|
5431
5422
|
bottom:0;
|
|
5432
5423
|
display:flex;
|
|
@@ -5437,20 +5428,20 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5437
5428
|
top:0;
|
|
5438
5429
|
z-index:300;
|
|
5439
5430
|
}
|
|
5440
|
-
.bp_side_panel_module_overlay--
|
|
5431
|
+
.bp_side_panel_module_overlay--16bae .bp_side_panel_module_content--16bae .bp_side_panel_module_header--16bae{
|
|
5441
5432
|
padding:var(--space-6) var(--space-14) var(--space-6) var(--space-4);
|
|
5442
5433
|
}
|
|
5443
5434
|
|
|
5444
|
-
.bp_side_panel_module_dropShadowOverlay--
|
|
5435
|
+
.bp_side_panel_module_dropShadowOverlay--16bae{
|
|
5445
5436
|
background-color:initial;
|
|
5446
5437
|
}
|
|
5447
5438
|
|
|
5448
|
-
.bp_side_panel_module_scrollableContainer--
|
|
5439
|
+
.bp_side_panel_module_scrollableContainer--16bae{
|
|
5449
5440
|
flex-grow:1;
|
|
5450
5441
|
overflow-y:auto;
|
|
5451
5442
|
}
|
|
5452
5443
|
|
|
5453
|
-
.bp_side_panel_module_footer--
|
|
5444
|
+
.bp_side_panel_module_footer--16bae{
|
|
5454
5445
|
background-color:var(--surface-surface);
|
|
5455
5446
|
display:flex;
|
|
5456
5447
|
justify-content:flex-end;
|
|
@@ -5460,19 +5451,19 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5460
5451
|
transition-timing-function:cubic-bezier(0, 0, .6, 1);
|
|
5461
5452
|
}
|
|
5462
5453
|
|
|
5463
|
-
.bp_side_panel_module_footerShadow--
|
|
5454
|
+
.bp_side_panel_module_footerShadow--16bae{
|
|
5464
5455
|
box-shadow:var(--dropshadow-3-inverse);
|
|
5465
5456
|
}
|
|
5466
5457
|
|
|
5467
|
-
.bp_side_panel_module_footerButton--
|
|
5458
|
+
.bp_side_panel_module_footerButton--16bae{
|
|
5468
5459
|
margin-inline-start:var(--space-2);
|
|
5469
5460
|
}
|
|
5470
5461
|
|
|
5471
|
-
.bp_side_panel_module_footerButton--
|
|
5462
|
+
.bp_side_panel_module_footerButton--16bae + .bp_side_panel_module_footerButton--16bae{
|
|
5472
5463
|
margin-inline-start:var(--space-3);
|
|
5473
5464
|
}
|
|
5474
5465
|
|
|
5475
|
-
@keyframes bp_side_panel_module_slideIn--
|
|
5466
|
+
@keyframes bp_side_panel_module_slideIn--16bae{
|
|
5476
5467
|
from{
|
|
5477
5468
|
inset-inline-end:-100%;
|
|
5478
5469
|
}
|
|
@@ -5480,7 +5471,7 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5480
5471
|
inset-inline-end:0;
|
|
5481
5472
|
}
|
|
5482
5473
|
}
|
|
5483
|
-
@keyframes bp_side_panel_module_slideOut--
|
|
5474
|
+
@keyframes bp_side_panel_module_slideOut--16bae{
|
|
5484
5475
|
from{
|
|
5485
5476
|
inset-inline-end:0;
|
|
5486
5477
|
}
|
|
@@ -12,10 +12,11 @@ const IconButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
12
12
|
icon,
|
|
13
13
|
...rest
|
|
14
14
|
} = props;
|
|
15
|
+
const sizeStyles = variant === 'small-utility' ? styles.small : styles[size];
|
|
15
16
|
return jsx(Button, {
|
|
16
17
|
...rest,
|
|
17
18
|
ref: forwardedRef,
|
|
18
|
-
className: clsx(styles.iconButton, styles[variant],
|
|
19
|
+
className: clsx(styles.iconButton, styles[variant], sizeStyles, props.className),
|
|
19
20
|
children: /*#__PURE__*/createElement(icon, {
|
|
20
21
|
className: styles.icon,
|
|
21
22
|
height: iconSizeMap[size],
|
|
@@ -36,7 +36,7 @@ export interface IconButtonSmallUtilityVariantProps extends IconButtonCommonProp
|
|
|
36
36
|
/**
|
|
37
37
|
* The only acceptable size for the 'small-utility' variant is 'small'.
|
|
38
38
|
*/
|
|
39
|
-
size
|
|
39
|
+
size?: Extract<IconButtonSize, 'small'>;
|
|
40
40
|
}
|
|
41
41
|
export type IconButtonProps = IconButtonVariantsProps | IconButtonSmallUtilityVariantProps;
|
|
42
42
|
export {};
|
|
@@ -3,8 +3,12 @@ import { XMark } from '@box/blueprint-web-assets/icons/Fill';
|
|
|
3
3
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
6
|
+
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
6
7
|
import styles from './side-panel.module.js';
|
|
7
8
|
|
|
9
|
+
const smallViewportProps = {
|
|
10
|
+
variant: 'small-utility'
|
|
11
|
+
};
|
|
8
12
|
/**
|
|
9
13
|
* The button that closes the SidePanel.
|
|
10
14
|
*/
|
|
@@ -12,15 +16,21 @@ const SidePanelClose = /*#__PURE__*/forwardRef(({
|
|
|
12
16
|
'aria-label': ariaLabel,
|
|
13
17
|
icon,
|
|
14
18
|
...rest
|
|
15
|
-
}, forwardedRef) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
}, forwardedRef) => {
|
|
20
|
+
const breakpoint = useBreakpoint();
|
|
21
|
+
const smallBreakpointActive = breakpoint === Breakpoint.Small;
|
|
22
|
+
const finalProps = smallBreakpointActive ? smallViewportProps : {};
|
|
23
|
+
return jsx(RadixDialog.Close, {
|
|
24
|
+
ref: forwardedRef,
|
|
25
|
+
asChild: true,
|
|
26
|
+
children: jsx(IconButton, {
|
|
27
|
+
...rest,
|
|
28
|
+
"aria-label": ariaLabel,
|
|
29
|
+
className: styles.close,
|
|
30
|
+
icon: icon || XMark,
|
|
31
|
+
...finalProps
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
});
|
|
25
35
|
|
|
26
36
|
export { SidePanelClose };
|
|
@@ -4,7 +4,7 @@ import { clsx } from 'clsx';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { Text } from '../text/text.js';
|
|
6
6
|
import { useScrollContext } from '../utils/scroll-context.js';
|
|
7
|
-
import {
|
|
7
|
+
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
8
8
|
import styles from './side-panel.module.js';
|
|
9
9
|
import { useVariant } from './variant-context.js';
|
|
10
10
|
|
|
@@ -13,13 +13,15 @@ const BaseSidePanelHeader = /*#__PURE__*/forwardRef(({
|
|
|
13
13
|
className,
|
|
14
14
|
...rest
|
|
15
15
|
}, forwardedRef) => {
|
|
16
|
+
const breakpoint = useBreakpoint();
|
|
17
|
+
const smallBreakpointActive = breakpoint === Breakpoint.Small;
|
|
16
18
|
return jsx(Text, {
|
|
17
19
|
...rest,
|
|
18
20
|
ref: forwardedRef,
|
|
19
21
|
as: "h1",
|
|
20
22
|
className: clsx(styles.header, className),
|
|
21
23
|
color: "textOnLightDefault",
|
|
22
|
-
variant:
|
|
24
|
+
variant: smallBreakpointActive ? 'titleMedium' : 'titleLarge',
|
|
23
25
|
children: children
|
|
24
26
|
});
|
|
25
27
|
});
|
|
@@ -34,11 +36,9 @@ const SidePanelHeader = /*#__PURE__*/forwardRef(({
|
|
|
34
36
|
const {
|
|
35
37
|
isScrolledUnderHeader
|
|
36
38
|
} = useScrollContext();
|
|
37
|
-
const isMobile = useMobile();
|
|
38
39
|
const variant = useVariant();
|
|
39
40
|
const classes = clsx({
|
|
40
|
-
[styles.headerShadow]: isScrolledUnderHeader
|
|
41
|
-
[styles.headerMobile]: isMobile
|
|
41
|
+
[styles.headerShadow]: isScrolledUnderHeader
|
|
42
42
|
}, className);
|
|
43
43
|
if (variant === 'overlay' || variant === 'dropShadowOverlay' || variant === 'interactiveOverlay') {
|
|
44
44
|
return jsx(RadixDialog.Title, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"content":"bp_side_panel_module_content--
|
|
2
|
+
var styles = {"content":"bp_side_panel_module_content--16bae","header":"bp_side_panel_module_header--16bae","headerShadow":"bp_side_panel_module_headerShadow--16bae","persistentContent":"bp_side_panel_module_persistentContent--16bae","contentAnimatedSlideIn":"bp_side_panel_module_contentAnimatedSlideIn--16bae","slideIn":"bp_side_panel_module_slideIn--16bae","contentAnimatedSlideOut":"bp_side_panel_module_contentAnimatedSlideOut--16bae","slideOut":"bp_side_panel_module_slideOut--16bae","contentNormal":"bp_side_panel_module_contentNormal--16bae","contentLarge":"bp_side_panel_module_contentLarge--16bae","dropShadowContent":"bp_side_panel_module_dropShadowContent--16bae","close":"bp_side_panel_module_close--16bae","overlayContent":"bp_side_panel_module_overlayContent--16bae","overlay":"bp_side_panel_module_overlay--16bae","dropShadowOverlay":"bp_side_panel_module_dropShadowOverlay--16bae","scrollableContainer":"bp_side_panel_module_scrollableContainer--16bae","footer":"bp_side_panel_module_footer--16bae","footerShadow":"bp_side_panel_module_footerShadow--16bae","footerButton":"bp_side_panel_module_footerButton--16bae"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -43,7 +43,7 @@ export interface SidePanelFooterProps extends ComponentPropsWithRef<'div'> {
|
|
|
43
43
|
/** Content of the Footer element */
|
|
44
44
|
children: ReactNode;
|
|
45
45
|
}
|
|
46
|
-
export interface SidePanelHeaderProps extends ComponentPropsWithRef<'
|
|
46
|
+
export interface SidePanelHeaderProps extends ComponentPropsWithRef<'h1'> {
|
|
47
47
|
/** Content of the Header element */
|
|
48
48
|
children: ReactNode;
|
|
49
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-stately": "^3.31.1",
|
|
64
64
|
"tsx": "^4.16.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c6aecbdc9ecebff79bc52370ed1d612ff2eec44b",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useMobile(): boolean;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
function useMobile() {
|
|
4
|
-
const [isMobile, setMobile] = useState(false);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
const {
|
|
7
|
-
userAgent
|
|
8
|
-
} = globalThis.navigator;
|
|
9
|
-
setMobile(/iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(userAgent) || /Mobi/i.test(userAgent));
|
|
10
|
-
}, []);
|
|
11
|
-
return isMobile;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { useMobile };
|