@box/blueprint-web 14.27.0 → 14.30.1
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/breadcrumb/breadcrumb.js +28 -8
- package/dist/lib-esm/breadcrumb/folder-tree-truncation-view.d.ts +1 -1
- package/dist/lib-esm/breadcrumb/folder-tree-truncation-view.js +10 -1
- package/dist/lib-esm/breadcrumb/types.d.ts +2 -1
- package/dist/lib-esm/index.css +56 -55
- package/dist/lib-esm/inline-trigger-button/inline-trigger-button-types.d.ts +3 -10
- package/dist/lib-esm/inline-trigger-button/inline-trigger-button.d.ts +5 -3
- package/dist/lib-esm/inline-trigger-button/inline-trigger-button.js +28 -25
- package/dist/lib-esm/modal/modal-content.js +1 -0
- package/dist/lib-esm/modal/modal.module.js +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import noop from 'lodash/noop';
|
|
3
3
|
import { forwardRef, useRef } from 'react';
|
|
4
4
|
import { FolderTree } from '@box/blueprint-web-assets/icons/Fill';
|
|
5
|
+
import { Taxonomy } from '@box/blueprint-web-assets/icons/Medium';
|
|
5
6
|
import { Home } from '@box/blueprint-web-assets/icons/MediumFilled';
|
|
6
7
|
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
7
8
|
import { EllipsisTruncationView } from './ellipsis-truncation-view.js';
|
|
@@ -14,6 +15,26 @@ import { getContainerHeight, getRootIconSize } from './utils.js';
|
|
|
14
15
|
import styles from './breadcrumb.module.js';
|
|
15
16
|
|
|
16
17
|
const ELLIPSIS_TRUNCATION_THRESHOLD = 7;
|
|
18
|
+
const renderRootIcon = (variant, size) => {
|
|
19
|
+
switch (variant) {
|
|
20
|
+
case 'home':
|
|
21
|
+
return jsx(Home, {
|
|
22
|
+
height: size,
|
|
23
|
+
width: size
|
|
24
|
+
});
|
|
25
|
+
case 'taxonomy':
|
|
26
|
+
return jsx(Taxonomy, {
|
|
27
|
+
height: size,
|
|
28
|
+
width: size
|
|
29
|
+
});
|
|
30
|
+
case 'folder-tree':
|
|
31
|
+
default:
|
|
32
|
+
return jsx(FolderTree, {
|
|
33
|
+
height: size,
|
|
34
|
+
width: size
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
17
38
|
const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
18
39
|
const {
|
|
19
40
|
breadcrumbAriaLabel,
|
|
@@ -38,6 +59,10 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
38
59
|
visibleCrumbCount
|
|
39
60
|
} = useFolderTreeTruncation(breadcrumbListRef, crumbs, isMobile);
|
|
40
61
|
const hasTruncation = isMobile || truncationMethod === 'ellipsis' && crumbs.length > ELLIPSIS_TRUNCATION_THRESHOLD || truncationMethod === 'folder-tree' && isTruncationRequired;
|
|
62
|
+
// For the `taxonomy` variant the dropdown trigger IS the root icon, so suppress the
|
|
63
|
+
// decorative one to avoid two Taxonomy icons in a row. `home`/`folder-tree` keep both.
|
|
64
|
+
const isFolderTreeTruncationActive = !isMobile && truncationMethod === 'folder-tree' && isTruncationRequired;
|
|
65
|
+
const shouldHideRootIconForTaxonomyTrigger = rootIconVariant === 'taxonomy' && isFolderTreeTruncationActive;
|
|
41
66
|
const rootIconSize = getRootIconSize(size, hasTruncation);
|
|
42
67
|
const containerHeight = getContainerHeight(size, hasTruncation);
|
|
43
68
|
if (!crumbs || crumbs.length === 0) {
|
|
@@ -68,6 +93,7 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
68
93
|
iconButtonRef: iconButtonRef,
|
|
69
94
|
isInteractive: isInteractive,
|
|
70
95
|
onPageLinkClick: onPageLinkClick,
|
|
96
|
+
rootIconVariant: rootIconVariant,
|
|
71
97
|
size: size,
|
|
72
98
|
truncatedLinksIconAriaLabel: truncatedLinksIconAriaLabel,
|
|
73
99
|
visibleCrumbCount: visibleCrumbCount
|
|
@@ -92,16 +118,10 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
92
118
|
children: jsxs("ol", {
|
|
93
119
|
ref: breadcrumbListRef,
|
|
94
120
|
className: styles.breadcrumb,
|
|
95
|
-
children: [!isMobile && rootIconVariant && jsxs("li", {
|
|
121
|
+
children: [!isMobile && rootIconVariant && !shouldHideRootIconForTaxonomyTrigger && jsxs("li", {
|
|
96
122
|
"aria-hidden": "true",
|
|
97
123
|
className: styles.pageLink,
|
|
98
|
-
children: [rootIconVariant
|
|
99
|
-
height: rootIconSize,
|
|
100
|
-
width: rootIconSize
|
|
101
|
-
}) : jsx(FolderTree, {
|
|
102
|
-
height: rootIconSize,
|
|
103
|
-
width: rootIconSize
|
|
104
|
-
}), jsx(BreadcrumbItemSeparator, {
|
|
124
|
+
children: [renderRootIcon(rootIconVariant, rootIconSize), jsx(BreadcrumbItemSeparator, {
|
|
105
125
|
isInteractive: isInteractive,
|
|
106
126
|
size: size
|
|
107
127
|
})]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type FolderTreeTruncationViewProps } from './types';
|
|
2
|
-
export declare const FolderTreeTruncationView: ({ crumbs, ellipsizeLastCrumb, iconButtonRef, isInteractive, onPageLinkClick, size, truncatedLinksIconAriaLabel, visibleCrumbCount, }: FolderTreeTruncationViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const FolderTreeTruncationView: ({ crumbs, ellipsizeLastCrumb, iconButtonRef, isInteractive, onPageLinkClick, rootIconVariant, size, truncatedLinksIconAriaLabel, visibleCrumbCount, }: FolderTreeTruncationViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { FolderTree } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
|
+
import { Taxonomy } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
4
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
4
5
|
import { BreadcrumbDropdown } from './breadcrumb-dropdown.js';
|
|
5
6
|
import { PageLink } from './page-link.js';
|
|
6
7
|
import { getIconButtonSize } from './utils.js';
|
|
7
8
|
|
|
9
|
+
const getDropdownTriggerIcon = rootIconVariant => {
|
|
10
|
+
if (rootIconVariant === 'taxonomy') {
|
|
11
|
+
return Taxonomy;
|
|
12
|
+
}
|
|
13
|
+
return FolderTree;
|
|
14
|
+
};
|
|
8
15
|
const FolderTreeTruncationView = ({
|
|
9
16
|
crumbs,
|
|
10
17
|
ellipsizeLastCrumb,
|
|
11
18
|
iconButtonRef,
|
|
12
19
|
isInteractive,
|
|
13
20
|
onPageLinkClick,
|
|
21
|
+
rootIconVariant,
|
|
14
22
|
size,
|
|
15
23
|
truncatedLinksIconAriaLabel,
|
|
16
24
|
visibleCrumbCount
|
|
17
25
|
}) => {
|
|
18
26
|
const visibleCrumbs = crumbs.slice(-visibleCrumbCount);
|
|
19
27
|
const hiddenCrumbs = crumbs.slice(0, -visibleCrumbCount);
|
|
28
|
+
const TriggerIcon = getDropdownTriggerIcon(rootIconVariant);
|
|
20
29
|
return jsxs(Fragment, {
|
|
21
30
|
children: [jsx(BreadcrumbDropdown, {
|
|
22
31
|
crumbsToRender: hiddenCrumbs,
|
|
23
32
|
iconButton: jsx(IconButton, {
|
|
24
33
|
"aria-label": truncatedLinksIconAriaLabel,
|
|
25
|
-
icon:
|
|
34
|
+
icon: TriggerIcon,
|
|
26
35
|
size: getIconButtonSize(size)
|
|
27
36
|
}),
|
|
28
37
|
isInteractive: isInteractive,
|
|
@@ -44,7 +44,7 @@ type RootIconProps = {
|
|
|
44
44
|
*/
|
|
45
45
|
rootIconAriaLabel?: string;
|
|
46
46
|
/** Determines which icon is displayed at the root. */
|
|
47
|
-
rootIconVariant: 'home' | 'folder-tree';
|
|
47
|
+
rootIconVariant: 'home' | 'folder-tree' | 'taxonomy';
|
|
48
48
|
};
|
|
49
49
|
export interface BreadcrumbViewProps {
|
|
50
50
|
crumbs: Crumb[];
|
|
@@ -56,6 +56,7 @@ export interface BreadcrumbViewProps {
|
|
|
56
56
|
}
|
|
57
57
|
export interface FolderTreeTruncationViewProps extends BreadcrumbViewProps {
|
|
58
58
|
iconButtonRef: React.RefObject<HTMLLIElement>;
|
|
59
|
+
rootIconVariant?: BreadcrumbProps['rootIconVariant'];
|
|
59
60
|
visibleCrumbCount: number;
|
|
60
61
|
}
|
|
61
62
|
/**
|
package/dist/lib-esm/index.css
CHANGED
|
@@ -8747,7 +8747,7 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8747
8747
|
display:inline;
|
|
8748
8748
|
}
|
|
8749
8749
|
|
|
8750
|
-
.bp_modal_module_overlay--
|
|
8750
|
+
.bp_modal_module_overlay--178e7[data-modern=false]{
|
|
8751
8751
|
--modal-body-text-color:var(--text-text-on-light);
|
|
8752
8752
|
--modal-overlay-background:var(--overlay-modal-overlay);
|
|
8753
8753
|
--modal-content-background:var(--gray-white);
|
|
@@ -8788,7 +8788,7 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8788
8788
|
--modal-loading-animation:var(--animation-duration-2) cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
8789
8789
|
}
|
|
8790
8790
|
|
|
8791
|
-
.bp_modal_module_overlay--
|
|
8791
|
+
.bp_modal_module_overlay--178e7[data-modern=true]{
|
|
8792
8792
|
--modal-overlay-background:var(--bp-overlay-modal-overlay);
|
|
8793
8793
|
--modal-content-background:var(--bp-surface-modal-surface);
|
|
8794
8794
|
--modal-min-width-non-fullscreen:calc(460px - var(--bp-space-080)*2);
|
|
@@ -8829,7 +8829,7 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8829
8829
|
--modal-loading-animation:var(--animation-duration-2) cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
8830
8830
|
}
|
|
8831
8831
|
|
|
8832
|
-
.bp_modal_module_overlay--
|
|
8832
|
+
.bp_modal_module_overlay--178e7{
|
|
8833
8833
|
background-color:var(--modal-overlay-background);
|
|
8834
8834
|
display:grid;
|
|
8835
8835
|
inset:0;
|
|
@@ -8837,15 +8837,15 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8837
8837
|
z-index:370;
|
|
8838
8838
|
}
|
|
8839
8839
|
@media (width > 459px){
|
|
8840
|
-
.bp_modal_module_overlay--
|
|
8840
|
+
.bp_modal_module_overlay--178e7{
|
|
8841
8841
|
place-items:center;
|
|
8842
8842
|
}
|
|
8843
8843
|
}
|
|
8844
8844
|
|
|
8845
|
-
.bp_modal_module_headerDividerLine--
|
|
8845
|
+
.bp_modal_module_headerDividerLine--178e7{
|
|
8846
8846
|
position:relative;
|
|
8847
8847
|
}
|
|
8848
|
-
.bp_modal_module_headerDividerLine--
|
|
8848
|
+
.bp_modal_module_headerDividerLine--178e7::after{
|
|
8849
8849
|
border-bottom:var(--modal-divider-line-border);
|
|
8850
8850
|
bottom:0;
|
|
8851
8851
|
content:"";
|
|
@@ -8854,16 +8854,16 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8854
8854
|
right:var(--modal-divider-line-offset-right);
|
|
8855
8855
|
}
|
|
8856
8856
|
@media (width > 459px){
|
|
8857
|
-
.bp_modal_module_headerDividerLine--
|
|
8857
|
+
.bp_modal_module_headerDividerLine--178e7::after{
|
|
8858
8858
|
left:var(--modal-divider-line-offset-left-non-fullscreen);
|
|
8859
8859
|
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
8860
8860
|
}
|
|
8861
8861
|
}
|
|
8862
8862
|
|
|
8863
|
-
.bp_modal_module_footerDividerLine--
|
|
8863
|
+
.bp_modal_module_footerDividerLine--178e7{
|
|
8864
8864
|
position:relative;
|
|
8865
8865
|
}
|
|
8866
|
-
.bp_modal_module_footerDividerLine--
|
|
8866
|
+
.bp_modal_module_footerDividerLine--178e7::before{
|
|
8867
8867
|
border-bottom:var(--modal-divider-line-border);
|
|
8868
8868
|
content:"";
|
|
8869
8869
|
left:var(--modal-divider-line-offset-left);
|
|
@@ -8872,13 +8872,13 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8872
8872
|
top:0;
|
|
8873
8873
|
}
|
|
8874
8874
|
@media (width > 459px){
|
|
8875
|
-
.bp_modal_module_footerDividerLine--
|
|
8875
|
+
.bp_modal_module_footerDividerLine--178e7::before{
|
|
8876
8876
|
left:var(--modal-divider-line-offset-left-non-fullscreen);
|
|
8877
8877
|
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
8878
8878
|
}
|
|
8879
8879
|
}
|
|
8880
8880
|
|
|
8881
|
-
.bp_modal_module_content--
|
|
8881
|
+
.bp_modal_module_content--178e7{
|
|
8882
8882
|
display:flex;
|
|
8883
8883
|
flex-direction:column;
|
|
8884
8884
|
height:100vh;
|
|
@@ -8886,15 +8886,15 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8886
8886
|
position:relative;
|
|
8887
8887
|
}
|
|
8888
8888
|
@media (width > 374px){
|
|
8889
|
-
.bp_modal_module_content--
|
|
8889
|
+
.bp_modal_module_content--178e7{
|
|
8890
8890
|
overflow:hidden;
|
|
8891
8891
|
}
|
|
8892
8892
|
}
|
|
8893
|
-
.bp_modal_module_content--
|
|
8893
|
+
.bp_modal_module_content--178e7{
|
|
8894
8894
|
background-color:var(--modal-content-background);
|
|
8895
8895
|
}
|
|
8896
8896
|
@media (width > 459px){
|
|
8897
|
-
.bp_modal_module_content--
|
|
8897
|
+
.bp_modal_module_content--178e7{
|
|
8898
8898
|
border-radius:var(--modal-border-radius);
|
|
8899
8899
|
height:auto;
|
|
8900
8900
|
margin:var(--modal-margin);
|
|
@@ -8902,96 +8902,97 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8902
8902
|
min-width:var(--modal-min-width-non-fullscreen);
|
|
8903
8903
|
transition:max-width var(--modal-loading-animation), max-height var(--modal-loading-animation);
|
|
8904
8904
|
}
|
|
8905
|
-
.bp_modal_module_content--
|
|
8905
|
+
.bp_modal_module_content--178e7.bp_modal_module_smallSizeModal--178e7{
|
|
8906
8906
|
max-width:var(--modal-max-width-small);
|
|
8907
8907
|
}
|
|
8908
|
-
.bp_modal_module_content--
|
|
8908
|
+
.bp_modal_module_content--178e7.bp_modal_module_mediumSizeModal--178e7{
|
|
8909
8909
|
max-width:var(--modal-max-width-medium);
|
|
8910
8910
|
}
|
|
8911
|
-
.bp_modal_module_content--
|
|
8911
|
+
.bp_modal_module_content--178e7.bp_modal_module_largeSizeModal--178e7{
|
|
8912
8912
|
max-width:var(--modal-max-width-large);
|
|
8913
8913
|
}
|
|
8914
|
-
.bp_modal_module_content--
|
|
8914
|
+
.bp_modal_module_content--178e7.bp_modal_module_xlargeSizeModal--178e7{
|
|
8915
8915
|
max-width:var(--modal-max-width-xlarge);
|
|
8916
8916
|
}
|
|
8917
8917
|
}
|
|
8918
|
-
.bp_modal_module_content--
|
|
8918
|
+
.bp_modal_module_content--178e7:has(.bp_modal_module_loadingContainerActive--178e7) .bp_modal_module_footerDividerLine--178e7::before,.bp_modal_module_content--178e7:has(.bp_modal_module_loadingContainerActive--178e7) .bp_modal_module_headerDividerLine--178e7::after{
|
|
8919
8919
|
display:none;
|
|
8920
8920
|
}
|
|
8921
8921
|
@media (width > 459px){
|
|
8922
|
-
.bp_modal_module_content--
|
|
8922
|
+
.bp_modal_module_content--178e7:has(.bp_modal_module_loadingContainerActive--178e7){
|
|
8923
8923
|
max-height:var(--modal-max-height-loading);
|
|
8924
8924
|
max-width:var(--modal-max-width-loading);
|
|
8925
8925
|
}
|
|
8926
8926
|
}
|
|
8927
8927
|
|
|
8928
|
-
.bp_modal_module_overlay--
|
|
8929
|
-
animation:bp_modal_module_popup_bounce_in--
|
|
8928
|
+
.bp_modal_module_overlay--178e7[data-modern=false] .bp_modal_module_content--178e7,.bp_modal_module_overlay--178e7[data-modern=true] .bp_modal_module_content--178e7[data-bp-animated=false]{
|
|
8929
|
+
animation:bp_modal_module_popup_bounce_in--178e7 var(--animation-duration-3);
|
|
8930
8930
|
}
|
|
8931
8931
|
|
|
8932
|
-
.bp_modal_module_overlay--
|
|
8932
|
+
.bp_modal_module_overlay--178e7[data-modern=true] .bp_modal_module_content--178e7[data-bp-animated=true][data-state=open]{
|
|
8933
8933
|
animation-duration:var(--bp-duration-long);
|
|
8934
8934
|
animation-fill-mode:both;
|
|
8935
|
-
animation-name:bp_modal_module_bpModalEnter--
|
|
8935
|
+
animation-name:bp_modal_module_bpModalEnter--178e7;
|
|
8936
8936
|
animation-timing-function:var(--bp-curve-large-on);
|
|
8937
8937
|
}
|
|
8938
|
-
|
|
8938
|
+
|
|
8939
|
+
.bp_modal_module_overlay--178e7[data-modern=true] .bp_modal_module_content--178e7[data-bp-animated=true][data-state=closed],.bp_modal_module_overlay--178e7[data-modern=true][data-bp-animated=true][data-state=closed]{
|
|
8939
8940
|
animation-duration:var(--bp-duration-medium);
|
|
8940
8941
|
animation-fill-mode:forwards;
|
|
8941
|
-
animation-name:bp_modal_module_bpModalExit--
|
|
8942
|
+
animation-name:bp_modal_module_bpModalExit--178e7;
|
|
8942
8943
|
animation-timing-function:var(--bp-curve-large-off);
|
|
8943
8944
|
}
|
|
8944
8945
|
|
|
8945
|
-
.bp_modal_module_scrollableContainer--
|
|
8946
|
+
.bp_modal_module_scrollableContainer--178e7{
|
|
8946
8947
|
flex-grow:1;
|
|
8947
8948
|
}
|
|
8948
8949
|
@media (width > 374px){
|
|
8949
|
-
.bp_modal_module_scrollableContainer--
|
|
8950
|
+
.bp_modal_module_scrollableContainer--178e7{
|
|
8950
8951
|
overflow-y:auto;
|
|
8951
8952
|
}
|
|
8952
8953
|
}
|
|
8953
8954
|
|
|
8954
|
-
.bp_modal_module_content--
|
|
8955
|
+
.bp_modal_module_content--178e7 .bp_modal_module_close--178e7{
|
|
8955
8956
|
position:fixed;
|
|
8956
8957
|
}
|
|
8957
8958
|
@media (width > 374px){
|
|
8958
|
-
.bp_modal_module_content--
|
|
8959
|
+
.bp_modal_module_content--178e7 .bp_modal_module_close--178e7{
|
|
8959
8960
|
position:absolute;
|
|
8960
8961
|
}
|
|
8961
8962
|
}
|
|
8962
|
-
.bp_modal_module_content--
|
|
8963
|
+
.bp_modal_module_content--178e7 .bp_modal_module_close--178e7{
|
|
8963
8964
|
color:var(--modal-close-button-color);
|
|
8964
8965
|
right:var(--modal-close-button-offset-right);
|
|
8965
8966
|
top:var(--modal-close-button-offset-top);
|
|
8966
8967
|
}
|
|
8967
8968
|
|
|
8968
|
-
.bp_modal_module_close--
|
|
8969
|
+
.bp_modal_module_close--178e7.bp_modal_module_onColor--178e7{
|
|
8969
8970
|
background-color:var(--modal-close-button-on-color-background);
|
|
8970
8971
|
}
|
|
8971
|
-
.bp_modal_module_close--
|
|
8972
|
+
.bp_modal_module_close--178e7.bp_modal_module_onColor--178e7:hover{
|
|
8972
8973
|
background-color:var(--modal-close-button-on-color-background-hover);
|
|
8973
8974
|
}
|
|
8974
|
-
.bp_modal_module_close--
|
|
8975
|
+
.bp_modal_module_close--178e7.bp_modal_module_onColor--178e7:active{
|
|
8975
8976
|
background-color:var(--modal-close-button-on-color-background-pressed);
|
|
8976
8977
|
}
|
|
8977
8978
|
|
|
8978
|
-
.bp_modal_module_content--
|
|
8979
|
+
.bp_modal_module_content--178e7 .bp_modal_module_backButton--178e7{
|
|
8979
8980
|
color:var(--modal-back-button-color);
|
|
8980
8981
|
margin-block-start:var(--modal-back-button-margin-top-start);
|
|
8981
8982
|
margin-inline-start:var(--modal-back-button-margin-inline-start);
|
|
8982
8983
|
}
|
|
8983
8984
|
@media (width > 459px){
|
|
8984
|
-
.bp_modal_module_content--
|
|
8985
|
+
.bp_modal_module_content--178e7 .bp_modal_module_backButton--178e7{
|
|
8985
8986
|
height:var(--modal-back-button-size-non-fullscreen);
|
|
8986
8987
|
width:var(--modal-back-button-size-non-fullscreen);
|
|
8987
8988
|
}
|
|
8988
8989
|
}
|
|
8989
8990
|
|
|
8990
|
-
.bp_modal_module_modalHeader--
|
|
8991
|
+
.bp_modal_module_modalHeader--178e7{
|
|
8991
8992
|
display:flex;
|
|
8992
8993
|
}
|
|
8993
8994
|
|
|
8994
|
-
.bp_modal_module_modalTitle--
|
|
8995
|
+
.bp_modal_module_modalTitle--178e7{
|
|
8995
8996
|
display:flex;
|
|
8996
8997
|
flex-direction:column;
|
|
8997
8998
|
gap:var(--modal-title-gap);
|
|
@@ -8999,80 +9000,80 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
8999
9000
|
padding:var(--modal-title-padding);
|
|
9000
9001
|
}
|
|
9001
9002
|
@media (width > 459px){
|
|
9002
|
-
.bp_modal_module_modalTitle--
|
|
9003
|
+
.bp_modal_module_modalTitle--178e7{
|
|
9003
9004
|
padding:var(--modal-title-padding-non-fullscreen);
|
|
9004
9005
|
}
|
|
9005
9006
|
}
|
|
9006
9007
|
|
|
9007
|
-
.bp_modal_module_body--
|
|
9008
|
+
.bp_modal_module_body--178e7{
|
|
9008
9009
|
color:var(--modal-body-text-color);
|
|
9009
9010
|
padding:var(--modal-body-padding-fullscreen);
|
|
9010
9011
|
}
|
|
9011
9012
|
@media (width > 459px){
|
|
9012
|
-
.bp_modal_module_body--
|
|
9013
|
+
.bp_modal_module_body--178e7{
|
|
9013
9014
|
padding:var(--modal-body-padding-non-fullscreen);
|
|
9014
9015
|
}
|
|
9015
9016
|
}
|
|
9016
9017
|
|
|
9017
|
-
.bp_modal_module_footer--
|
|
9018
|
+
.bp_modal_module_footer--178e7{
|
|
9018
9019
|
display:flex;
|
|
9019
9020
|
justify-content:flex-end;
|
|
9020
9021
|
padding:var(--modal-footer-padding);
|
|
9021
9022
|
}
|
|
9022
9023
|
@media (width > 459px){
|
|
9023
|
-
.bp_modal_module_footer--
|
|
9024
|
+
.bp_modal_module_footer--178e7{
|
|
9024
9025
|
padding:var(--modal-footer-padding-non-fullscreen);
|
|
9025
9026
|
}
|
|
9026
9027
|
}
|
|
9027
9028
|
|
|
9028
|
-
.bp_modal_module_footerButton--
|
|
9029
|
+
.bp_modal_module_footerButton--178e7 + .bp_modal_module_footerButton--178e7{
|
|
9029
9030
|
margin-inline-start:var(--modal-footer-button-margin-inline-start);
|
|
9030
9031
|
}
|
|
9031
9032
|
|
|
9032
|
-
.bp_modal_module_loadingContainer--
|
|
9033
|
+
.bp_modal_module_loadingContainer--178e7{
|
|
9033
9034
|
display:flex;
|
|
9034
9035
|
flex-direction:column;
|
|
9035
9036
|
flex-grow:1;
|
|
9036
9037
|
position:relative;
|
|
9037
9038
|
}
|
|
9038
9039
|
@media (width > 374px){
|
|
9039
|
-
.bp_modal_module_loadingContainer--
|
|
9040
|
+
.bp_modal_module_loadingContainer--178e7{
|
|
9040
9041
|
min-height:0;
|
|
9041
9042
|
}
|
|
9042
9043
|
}
|
|
9043
9044
|
|
|
9044
|
-
.bp_modal_module_loadingContainerActive--
|
|
9045
|
+
.bp_modal_module_loadingContainerActive--178e7{
|
|
9045
9046
|
overflow:hidden;
|
|
9046
9047
|
}
|
|
9047
9048
|
|
|
9048
|
-
.bp_modal_module_loading--
|
|
9049
|
+
.bp_modal_module_loading--178e7{
|
|
9049
9050
|
align-items:center;
|
|
9050
9051
|
display:flex;
|
|
9051
9052
|
}
|
|
9052
9053
|
|
|
9053
|
-
.bp_modal_module_loadingOverlay--
|
|
9054
|
+
.bp_modal_module_loadingOverlay--178e7{
|
|
9054
9055
|
background-color:var(--modal-content-background);
|
|
9055
9056
|
inset:0;
|
|
9056
9057
|
position:absolute;
|
|
9057
9058
|
z-index:1;
|
|
9058
9059
|
}
|
|
9059
9060
|
|
|
9060
|
-
.bp_modal_module_loadingContent--
|
|
9061
|
+
.bp_modal_module_loadingContent--178e7{
|
|
9061
9062
|
display:flex;
|
|
9062
9063
|
flex-direction:column;
|
|
9063
9064
|
visibility:hidden;
|
|
9064
9065
|
}
|
|
9065
9066
|
@media (width > 374px){
|
|
9066
|
-
.bp_modal_module_loadingContent--
|
|
9067
|
+
.bp_modal_module_loadingContent--178e7{
|
|
9067
9068
|
min-height:0;
|
|
9068
9069
|
}
|
|
9069
9070
|
}
|
|
9070
9071
|
|
|
9071
|
-
.bp_modal_module_loadingContentVisible--
|
|
9072
|
+
.bp_modal_module_loadingContentVisible--178e7{
|
|
9072
9073
|
visibility:visible;
|
|
9073
9074
|
}
|
|
9074
9075
|
|
|
9075
|
-
@keyframes bp_modal_module_popup_bounce_in--
|
|
9076
|
+
@keyframes bp_modal_module_popup_bounce_in--178e7{
|
|
9076
9077
|
0%{
|
|
9077
9078
|
transform:scale3d(.1, .1, 1);
|
|
9078
9079
|
}
|
|
@@ -9080,7 +9081,7 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
9080
9081
|
transform:scaleX(1);
|
|
9081
9082
|
}
|
|
9082
9083
|
}
|
|
9083
|
-
@keyframes bp_modal_module_bpModalEnter--
|
|
9084
|
+
@keyframes bp_modal_module_bpModalEnter--178e7{
|
|
9084
9085
|
from{
|
|
9085
9086
|
opacity:var(--bp-opacity-hidden);
|
|
9086
9087
|
transform:translateY(var(--bp-space-040)) var(--bp-scale-small);
|
|
@@ -9090,7 +9091,7 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
|
|
|
9090
9091
|
transform:translateY(0) var(--bp-scale-default);
|
|
9091
9092
|
}
|
|
9092
9093
|
}
|
|
9093
|
-
@keyframes bp_modal_module_bpModalExit--
|
|
9094
|
+
@keyframes bp_modal_module_bpModalExit--178e7{
|
|
9094
9095
|
from{
|
|
9095
9096
|
opacity:var(--bp-opacity-visible);
|
|
9096
9097
|
}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type BaseButtonIconProps, type BaseButtonProps } from '../primitives/base-button';
|
|
3
|
-
/** Same
|
|
3
|
+
/** Same loading contract as {@link BaseButton} (`loading` + `loadingAriaLabel`). */
|
|
4
4
|
export type InlineTriggerButtonProps = Omit<BaseButtonProps, 'size' | 'variant' | 'children'> & {
|
|
5
|
-
/** Visual style; only secondary and tertiary are supported. */
|
|
6
5
|
variant?: 'secondary' | 'tertiary';
|
|
7
6
|
caretDirection: 'up' | 'down';
|
|
8
7
|
startIcon?: BaseButtonIconProps['icon'];
|
|
9
|
-
/**
|
|
10
|
-
* Extra props for `startIcon` (merged after default size/color on the SVG). Use for stroke icons (`strokeWidth`),
|
|
11
|
-
* filters, opacity, or `className`. For fill/path icons, visual weight is usually a different asset (e.g. Fill vs Medium).
|
|
12
|
-
*/
|
|
8
|
+
/** Merged after default icon size/color (stroke width, className, etc.). */
|
|
13
9
|
startIconProps?: BaseButtonIconProps['iconProps'];
|
|
14
|
-
/** Optional custom right icon; when omitted, caret direction icon is used. */
|
|
15
10
|
endIcon?: BaseButtonIconProps['icon'];
|
|
16
|
-
/** Same as `startIconProps` for the end/caret slot (default chevrons or `endIcon`). */
|
|
17
11
|
endIconProps?: BaseButtonIconProps['iconProps'];
|
|
18
|
-
/**
|
|
12
|
+
/** Keeps end icon visible when idle or disabled; hidden while `loading`. */
|
|
19
13
|
alwaysShowEndIcon?: boolean;
|
|
20
|
-
/** Custom row UI (chips, styled text, etc.). There is no separate string `label` API. */
|
|
21
14
|
children: ReactNode;
|
|
22
15
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type InlineTriggerButtonProps } from './inline-trigger-button-types';
|
|
2
2
|
/**
|
|
3
|
-
* Extra-small trigger for
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Extra-small trigger for arbitrary row content (`children`). Only `secondary` and `tertiary`.
|
|
4
|
+
* Optional `startIcon` / `endIcon`; otherwise shows chevrons from `caretDirection`.
|
|
5
|
+
* Prefer {@link TriggerButton} for a simple label + caret.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link BaseButton} for `loading` / `loadingAriaLabel` and focus behavior.
|
|
6
8
|
*/
|
|
7
9
|
export declare const InlineTriggerButton: import("react").ForwardRefExoticComponent<Omit<InlineTriggerButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ChevronUp, ChevronDown } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
|
+
import { bpSize040, bpSize030 } from '@box/blueprint-web-assets/tokens/px-tokens';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
5
|
+
import { forwardRef, useMemo } from 'react';
|
|
5
6
|
import { BaseButton } from '../primitives/base-button/index.js';
|
|
6
7
|
import styles from './inline-trigger-button.module.js';
|
|
7
8
|
|
|
8
9
|
const SECONDARY_ICON_COLOR = 'var(--bp-icon-icon-on-light-secondary)';
|
|
10
|
+
const TERTIARY_ICON_COLOR = 'var(--bp-text-cta-link)';
|
|
9
11
|
function caretIconForDirection(caretDirection) {
|
|
10
12
|
return caretDirection === 'up' ? ChevronUp : ChevronDown;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
* Extra-small trigger for
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Extra-small trigger for arbitrary row content (`children`). Only `secondary` and `tertiary`.
|
|
16
|
+
* Optional `startIcon` / `endIcon`; otherwise shows chevrons from `caretDirection`.
|
|
17
|
+
* Prefer {@link TriggerButton} for a simple label + caret.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link BaseButton} for `loading` / `loadingAriaLabel` and focus behavior.
|
|
16
20
|
*/
|
|
17
21
|
const InlineTriggerButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
18
22
|
const {
|
|
@@ -30,33 +34,39 @@ const InlineTriggerButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
30
34
|
...rest
|
|
31
35
|
} = props;
|
|
32
36
|
const RightIcon = endIcon ?? caretIconForDirection(caretDirection);
|
|
33
|
-
const iconColor = variant === 'secondary' ? SECONDARY_ICON_COLOR :
|
|
37
|
+
const iconColor = variant === 'secondary' ? SECONDARY_ICON_COLOR : TERTIARY_ICON_COLOR;
|
|
38
|
+
const resolvedClassName = clsx(styles.inlineTriggerButton, styles.extraSmall, styles[variant], styles.row, {
|
|
39
|
+
[styles.startIcon]: !!startIcon,
|
|
40
|
+
[styles.endIconAlwaysVisible]: alwaysShowEndIcon && !loading
|
|
41
|
+
}, className);
|
|
34
42
|
const baseButtonProps = {
|
|
35
43
|
...rest,
|
|
36
|
-
className:
|
|
37
|
-
[styles.startIcon]: !!startIcon,
|
|
38
|
-
[styles.endIconAlwaysVisible]: alwaysShowEndIcon && !loading
|
|
39
|
-
}, className),
|
|
44
|
+
className: resolvedClassName,
|
|
40
45
|
'data-inline-trigger-loading': loading ? 'true' : undefined,
|
|
41
46
|
loading,
|
|
42
47
|
size: 'small',
|
|
43
48
|
style,
|
|
44
49
|
variant
|
|
45
50
|
};
|
|
51
|
+
const resolvedStartIconProps = useMemo(() => ({
|
|
52
|
+
color: iconColor,
|
|
53
|
+
height: bpSize040,
|
|
54
|
+
width: bpSize040,
|
|
55
|
+
...startIconProps
|
|
56
|
+
}), [iconColor, startIconProps]);
|
|
57
|
+
const resolvedEndIconProps = useMemo(() => ({
|
|
58
|
+
color: iconColor,
|
|
59
|
+
height: bpSize030,
|
|
60
|
+
width: bpSize030,
|
|
61
|
+
...endIconProps
|
|
62
|
+
}), [endIconProps, iconColor]);
|
|
46
63
|
return jsxs(BaseButton, {
|
|
47
64
|
ref: forwardedRef,
|
|
48
65
|
...baseButtonProps,
|
|
49
66
|
children: [startIcon ? jsx(BaseButton.Icon, {
|
|
50
67
|
className: styles.startIcon,
|
|
51
68
|
icon: startIcon,
|
|
52
|
-
iconProps:
|
|
53
|
-
...(iconColor ? {
|
|
54
|
-
color: iconColor
|
|
55
|
-
} : {}),
|
|
56
|
-
height: 'var(--bp-size-040, 1rem)',
|
|
57
|
-
width: 'var(--bp-size-040, 1rem)',
|
|
58
|
-
...startIconProps
|
|
59
|
-
}
|
|
69
|
+
iconProps: resolvedStartIconProps
|
|
60
70
|
}) : null, jsx(BaseButton.Label, {
|
|
61
71
|
className: styles.contentSlot,
|
|
62
72
|
children: jsx("span", {
|
|
@@ -66,14 +76,7 @@ const InlineTriggerButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
66
76
|
}), jsx(BaseButton.Icon, {
|
|
67
77
|
className: styles.caretCorner,
|
|
68
78
|
icon: RightIcon,
|
|
69
|
-
iconProps:
|
|
70
|
-
...(iconColor ? {
|
|
71
|
-
color: iconColor
|
|
72
|
-
} : {}),
|
|
73
|
-
height: 'var(--bp-size-030, 0.75rem)',
|
|
74
|
-
width: 'var(--bp-size-030, 0.75rem)',
|
|
75
|
-
...endIconProps
|
|
76
|
-
}
|
|
79
|
+
iconProps: resolvedEndIconProps
|
|
77
80
|
})]
|
|
78
81
|
});
|
|
79
82
|
});
|
|
@@ -30,6 +30,7 @@ const ModalContent = /*#__PURE__*/forwardRef(({
|
|
|
30
30
|
container: container,
|
|
31
31
|
children: jsx(RadixDialog.Overlay, {
|
|
32
32
|
className: styles.overlay,
|
|
33
|
+
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
33
34
|
"data-modern": enableModernizedComponents ? 'true' : 'false',
|
|
34
35
|
children: jsx(RadixDialog.Content, {
|
|
35
36
|
...props,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"overlay":"bp_modal_module_overlay--
|
|
2
|
+
var styles = {"overlay":"bp_modal_module_overlay--178e7","headerDividerLine":"bp_modal_module_headerDividerLine--178e7","footerDividerLine":"bp_modal_module_footerDividerLine--178e7","content":"bp_modal_module_content--178e7","smallSizeModal":"bp_modal_module_smallSizeModal--178e7","mediumSizeModal":"bp_modal_module_mediumSizeModal--178e7","largeSizeModal":"bp_modal_module_largeSizeModal--178e7","xlargeSizeModal":"bp_modal_module_xlargeSizeModal--178e7","loadingContainerActive":"bp_modal_module_loadingContainerActive--178e7","popup_bounce_in":"bp_modal_module_popup_bounce_in--178e7","bpModalEnter":"bp_modal_module_bpModalEnter--178e7","bpModalExit":"bp_modal_module_bpModalExit--178e7","scrollableContainer":"bp_modal_module_scrollableContainer--178e7","close":"bp_modal_module_close--178e7","onColor":"bp_modal_module_onColor--178e7","backButton":"bp_modal_module_backButton--178e7","modalHeader":"bp_modal_module_modalHeader--178e7","modalTitle":"bp_modal_module_modalTitle--178e7","body":"bp_modal_module_body--178e7","footer":"bp_modal_module_footer--178e7","footerButton":"bp_modal_module_footerButton--178e7","loadingContainer":"bp_modal_module_loadingContainer--178e7","loading":"bp_modal_module_loading--178e7","loadingOverlay":"bp_modal_module_loadingOverlay--178e7","loadingContent":"bp_modal_module_loadingContent--178e7","loadingContentVisible":"bp_modal_module_loadingContentVisible--178e7"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.30.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@ariakit/react": "0.4.21",
|
|
49
49
|
"@ariakit/react-core": "0.4.21",
|
|
50
|
-
"@box/blueprint-web-assets": "^4.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.117.3",
|
|
51
51
|
"@internationalized/date": "^3.12.0",
|
|
52
52
|
"@radix-ui/react-accordion": "1.1.2",
|
|
53
53
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"type-fest": "^3.2.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@box/storybook-utils": "^0.
|
|
80
|
+
"@box/storybook-utils": "^0.19.3",
|
|
81
81
|
"@figma/code-connect": "1.4.4",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|