@box/blueprint-web 14.7.0 → 14.8.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/breadcrumb/breadcrumb.js +13 -3
- package/dist/lib-esm/breadcrumb/breadcrumb.module.js +1 -1
- package/dist/lib-esm/breadcrumb/ellipsis-truncation-view.js +2 -1
- package/dist/lib-esm/breadcrumb/folder-tree-truncation-view.js +2 -1
- package/dist/lib-esm/breadcrumb/mobile-view.js +2 -1
- package/dist/lib-esm/breadcrumb/utils.d.ts +6 -2
- package/dist/lib-esm/breadcrumb/utils.js +84 -2
- package/dist/lib-esm/index.css +38 -32
- package/dist/lib-esm/text-button/text-button.js +6 -0
- package/dist/lib-esm/text-button/text-button.module.js +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ import { FolderTreeTruncationView } from './folder-tree-truncation-view.js';
|
|
|
9
9
|
import { FullView } from './full-view.js';
|
|
10
10
|
import { MobileView } from './mobile-view.js';
|
|
11
11
|
import { useFolderTreeTruncation } from './useFolderTreeTruncation.js';
|
|
12
|
-
import { getSeparatorSize } from './utils.js';
|
|
12
|
+
import { getSeparatorSize, getContainerHeight, getRootIconSize } from './utils.js';
|
|
13
13
|
import styles from './breadcrumb.module.js';
|
|
14
14
|
|
|
15
15
|
const ELLIPSIS_TRUNCATION_THRESHOLD = 7;
|
|
@@ -36,6 +36,9 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
36
36
|
isTruncationRequired,
|
|
37
37
|
visibleCrumbCount
|
|
38
38
|
} = useFolderTreeTruncation(breadcrumbListRef, crumbs, isMobile);
|
|
39
|
+
const hasTruncation = isMobile || truncationMethod === 'ellipsis' && crumbs.length > ELLIPSIS_TRUNCATION_THRESHOLD || truncationMethod === 'folder-tree' && isTruncationRequired;
|
|
40
|
+
const rootIconSize = getRootIconSize(size, hasTruncation);
|
|
41
|
+
const containerHeight = getContainerHeight(size, hasTruncation);
|
|
39
42
|
if (!crumbs || crumbs.length === 0) {
|
|
40
43
|
return null;
|
|
41
44
|
}
|
|
@@ -81,6 +84,9 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
81
84
|
ref: forwardedRef,
|
|
82
85
|
"aria-label": breadcrumbAriaLabel,
|
|
83
86
|
className: styles.container,
|
|
87
|
+
style: {
|
|
88
|
+
height: containerHeight
|
|
89
|
+
},
|
|
84
90
|
...rest,
|
|
85
91
|
children: jsxs("ol", {
|
|
86
92
|
ref: breadcrumbListRef,
|
|
@@ -88,9 +94,13 @@ const Breadcrumb = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
88
94
|
children: [!isMobile && rootIconVariant && jsxs("li", {
|
|
89
95
|
className: styles.pageLink,
|
|
90
96
|
children: [rootIconVariant === 'home' ? jsx(Home, {
|
|
91
|
-
"aria-label": rootIconAriaLabel
|
|
97
|
+
"aria-label": rootIconAriaLabel,
|
|
98
|
+
height: rootIconSize,
|
|
99
|
+
width: rootIconSize
|
|
92
100
|
}) : jsx(FolderTree, {
|
|
93
|
-
"aria-label": rootIconAriaLabel
|
|
101
|
+
"aria-label": rootIconAriaLabel,
|
|
102
|
+
height: rootIconSize,
|
|
103
|
+
width: rootIconSize
|
|
94
104
|
}), jsx(PointerRight, {
|
|
95
105
|
height: getSeparatorSize(size),
|
|
96
106
|
role: "presentation",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"container":"bp_breadcrumb_module_container--
|
|
2
|
+
var styles = {"container":"bp_breadcrumb_module_container--30dee","breadcrumb":"bp_breadcrumb_module_breadcrumb--30dee","pageLink":"bp_breadcrumb_module_pageLink--30dee","linkWithHover":"bp_breadcrumb_module_linkWithHover--30dee","dropdownContent":"bp_breadcrumb_module_dropdownContent--30dee"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -3,6 +3,7 @@ import { Ellipsis } from '@box/blueprint-web-assets/icons/Medium';
|
|
|
3
3
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
4
4
|
import { BreadcrumbDropdown } from './breadcrumb-dropdown.js';
|
|
5
5
|
import { PageLink } from './page-link.js';
|
|
6
|
+
import { getIconButtonSize } from './utils.js';
|
|
6
7
|
|
|
7
8
|
const EllipsisTruncationView = ({
|
|
8
9
|
crumbs,
|
|
@@ -25,7 +26,7 @@ const EllipsisTruncationView = ({
|
|
|
25
26
|
iconButton: jsx(IconButton, {
|
|
26
27
|
"aria-label": truncatedLinksIconAriaLabel,
|
|
27
28
|
icon: Ellipsis,
|
|
28
|
-
size:
|
|
29
|
+
size: getIconButtonSize(size)
|
|
29
30
|
}),
|
|
30
31
|
onPageLinkClick: onPageLinkClick,
|
|
31
32
|
size: size
|
|
@@ -3,6 +3,7 @@ import { FolderTree } from '@box/blueprint-web-assets/icons/Fill';
|
|
|
3
3
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
4
4
|
import { BreadcrumbDropdown } from './breadcrumb-dropdown.js';
|
|
5
5
|
import { PageLink } from './page-link.js';
|
|
6
|
+
import { getIconButtonSize } from './utils.js';
|
|
6
7
|
|
|
7
8
|
const FolderTreeTruncationView = ({
|
|
8
9
|
crumbs,
|
|
@@ -22,7 +23,7 @@ const FolderTreeTruncationView = ({
|
|
|
22
23
|
iconButton: jsx(IconButton, {
|
|
23
24
|
"aria-label": truncatedLinksIconAriaLabel,
|
|
24
25
|
icon: FolderTree,
|
|
25
|
-
size:
|
|
26
|
+
size: getIconButtonSize(size)
|
|
26
27
|
}),
|
|
27
28
|
listRef: iconButtonRef,
|
|
28
29
|
onPageLinkClick: onPageLinkClick,
|
|
@@ -3,6 +3,7 @@ import { FolderTree } from '@box/blueprint-web-assets/icons/Fill';
|
|
|
3
3
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
4
4
|
import { BreadcrumbDropdown } from './breadcrumb-dropdown.js';
|
|
5
5
|
import { PageLink } from './page-link.js';
|
|
6
|
+
import { getIconButtonSize } from './utils.js';
|
|
6
7
|
|
|
7
8
|
const MobileView = ({
|
|
8
9
|
crumbs,
|
|
@@ -19,7 +20,7 @@ const MobileView = ({
|
|
|
19
20
|
iconButton: jsx(IconButton, {
|
|
20
21
|
"aria-label": truncatedLinksIconAriaLabel,
|
|
21
22
|
icon: FolderTree,
|
|
22
|
-
size:
|
|
23
|
+
size: getIconButtonSize(size)
|
|
23
24
|
}),
|
|
24
25
|
onPageLinkClick: onPageLinkClick,
|
|
25
26
|
size: size
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type BreadcrumbProps } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
2
|
+
import { type TypographyVariant } from '../text/types';
|
|
3
|
+
export declare const getTextVariantFromSize: (size: BreadcrumbProps["size"]) => TypographyVariant;
|
|
4
|
+
export declare const getBoldTextVariantFromSize: (size: BreadcrumbProps["size"]) => TypographyVariant;
|
|
4
5
|
export declare const getSeparatorSize: (size: BreadcrumbProps["size"]) => string;
|
|
6
|
+
export declare const getRootIconSize: (size: BreadcrumbProps["size"], hasTruncation?: boolean) => string;
|
|
7
|
+
export declare const getContainerHeight: (size: BreadcrumbProps["size"], hasTruncation?: boolean) => string;
|
|
8
|
+
export declare const getIconButtonSize: (size: BreadcrumbProps["size"]) => "x-small" | "small" | "large";
|
|
@@ -1,34 +1,116 @@
|
|
|
1
|
-
import { bpSize030, bpSize020 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
1
|
+
import { bpSize030, bpSize040, bpSize020, bpSize060, bpSize080, bpSize050 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
2
2
|
|
|
3
3
|
const getTextVariantFromSize = size => {
|
|
4
4
|
switch (size) {
|
|
5
|
+
case 'xsmall':
|
|
6
|
+
return 'caption';
|
|
5
7
|
case 'small':
|
|
6
8
|
return 'bodyDefault';
|
|
7
9
|
case 'medium':
|
|
8
10
|
return 'bodyLarge';
|
|
11
|
+
case 'large':
|
|
12
|
+
return 'titleXLarge';
|
|
9
13
|
default:
|
|
10
14
|
return 'bodyLarge';
|
|
11
15
|
}
|
|
12
16
|
};
|
|
13
17
|
const getBoldTextVariantFromSize = size => {
|
|
14
18
|
switch (size) {
|
|
19
|
+
case 'xsmall':
|
|
20
|
+
return 'captionBold';
|
|
15
21
|
case 'small':
|
|
16
22
|
return 'bodyDefaultBold';
|
|
17
23
|
case 'medium':
|
|
18
24
|
return 'bodyLargeBold';
|
|
25
|
+
case 'large':
|
|
26
|
+
return 'titleXLarge';
|
|
19
27
|
default:
|
|
20
28
|
return 'bodyLargeBold';
|
|
21
29
|
}
|
|
22
30
|
};
|
|
23
31
|
const getSeparatorSize = size => {
|
|
24
32
|
switch (size) {
|
|
33
|
+
case 'xsmall':
|
|
34
|
+
return bpSize020;
|
|
25
35
|
case 'small':
|
|
26
36
|
return bpSize020;
|
|
27
37
|
case 'medium':
|
|
28
38
|
return bpSize030;
|
|
39
|
+
case 'large':
|
|
40
|
+
return bpSize040;
|
|
29
41
|
default:
|
|
30
42
|
return bpSize030;
|
|
31
43
|
}
|
|
32
44
|
};
|
|
45
|
+
const getRootIconSize = (size, hasTruncation = false) => {
|
|
46
|
+
if (hasTruncation) {
|
|
47
|
+
switch (size) {
|
|
48
|
+
case 'xsmall':
|
|
49
|
+
return bpSize060;
|
|
50
|
+
case 'small':
|
|
51
|
+
return bpSize060;
|
|
52
|
+
case 'medium':
|
|
53
|
+
return bpSize060;
|
|
54
|
+
case 'large':
|
|
55
|
+
return bpSize080;
|
|
56
|
+
default:
|
|
57
|
+
return bpSize060;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
switch (size) {
|
|
61
|
+
case 'xsmall':
|
|
62
|
+
return bpSize040;
|
|
63
|
+
case 'small':
|
|
64
|
+
return bpSize040;
|
|
65
|
+
case 'medium':
|
|
66
|
+
return bpSize050;
|
|
67
|
+
case 'large':
|
|
68
|
+
return bpSize060;
|
|
69
|
+
default:
|
|
70
|
+
return bpSize050;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const getContainerHeight = (size, hasTruncation = false) => {
|
|
74
|
+
if (hasTruncation) {
|
|
75
|
+
switch (size) {
|
|
76
|
+
case 'xsmall':
|
|
77
|
+
return bpSize060;
|
|
78
|
+
case 'small':
|
|
79
|
+
return bpSize060;
|
|
80
|
+
case 'medium':
|
|
81
|
+
return bpSize060;
|
|
82
|
+
case 'large':
|
|
83
|
+
return bpSize080;
|
|
84
|
+
default:
|
|
85
|
+
return bpSize060;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
switch (size) {
|
|
89
|
+
case 'xsmall':
|
|
90
|
+
return bpSize040;
|
|
91
|
+
case 'small':
|
|
92
|
+
return bpSize050;
|
|
93
|
+
case 'medium':
|
|
94
|
+
return bpSize060;
|
|
95
|
+
case 'large':
|
|
96
|
+
return bpSize080;
|
|
97
|
+
default:
|
|
98
|
+
return bpSize060;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const getIconButtonSize = size => {
|
|
102
|
+
switch (size) {
|
|
103
|
+
case 'xsmall':
|
|
104
|
+
return 'x-small';
|
|
105
|
+
case 'small':
|
|
106
|
+
return 'x-small';
|
|
107
|
+
case 'medium':
|
|
108
|
+
return 'x-small';
|
|
109
|
+
case 'large':
|
|
110
|
+
return 'small';
|
|
111
|
+
default:
|
|
112
|
+
return 'x-small';
|
|
113
|
+
}
|
|
114
|
+
};
|
|
33
115
|
|
|
34
|
-
export { getBoldTextVariantFromSize, getSeparatorSize, getTextVariantFromSize };
|
|
116
|
+
export { getBoldTextVariantFromSize, getContainerHeight, getIconButtonSize, getRootIconSize, getSeparatorSize, getTextVariantFromSize };
|
package/dist/lib-esm/index.css
CHANGED
|
@@ -3072,11 +3072,10 @@
|
|
|
3072
3072
|
.bp_menu_item_sections_module_menuItemSideContent--dd1ef.bp_menu_item_sections_module_textOnLightSecondary--dd1ef{
|
|
3073
3073
|
color:var(--menu-item-text-color);
|
|
3074
3074
|
}
|
|
3075
|
-
.bp_breadcrumb_module_container--
|
|
3076
|
-
height:var(--bp-size-060);
|
|
3075
|
+
.bp_breadcrumb_module_container--30dee{
|
|
3077
3076
|
width:100%;
|
|
3078
3077
|
}
|
|
3079
|
-
.bp_breadcrumb_module_container--
|
|
3078
|
+
.bp_breadcrumb_module_container--30dee .bp_breadcrumb_module_breadcrumb--30dee{
|
|
3080
3079
|
align-items:center;
|
|
3081
3080
|
display:flex;
|
|
3082
3081
|
flex-wrap:nowrap;
|
|
@@ -3086,7 +3085,7 @@
|
|
|
3086
3085
|
margin:0;
|
|
3087
3086
|
padding:0;
|
|
3088
3087
|
}
|
|
3089
|
-
.bp_breadcrumb_module_container--
|
|
3088
|
+
.bp_breadcrumb_module_container--30dee .bp_breadcrumb_module_pageLink--30dee{
|
|
3090
3089
|
align-items:center;
|
|
3091
3090
|
display:flex;
|
|
3092
3091
|
flex-shrink:0;
|
|
@@ -3095,15 +3094,16 @@
|
|
|
3095
3094
|
overflow:hidden;
|
|
3096
3095
|
white-space:nowrap;
|
|
3097
3096
|
}
|
|
3098
|
-
.bp_breadcrumb_module_container--
|
|
3097
|
+
.bp_breadcrumb_module_container--30dee .bp_breadcrumb_module_pageLink--30dee:last-child{
|
|
3099
3098
|
flex-shrink:1;
|
|
3100
3099
|
}
|
|
3101
3100
|
|
|
3102
|
-
.bp_breadcrumb_module_linkWithHover--
|
|
3101
|
+
.bp_breadcrumb_module_linkWithHover--30dee{
|
|
3103
3102
|
cursor:pointer;
|
|
3103
|
+
display:inline-flex;
|
|
3104
3104
|
position:relative;
|
|
3105
3105
|
}
|
|
3106
|
-
.bp_breadcrumb_module_linkWithHover--
|
|
3106
|
+
.bp_breadcrumb_module_linkWithHover--30dee::after{
|
|
3107
3107
|
background-color:var(--bp-text-text-on-light-secondary);
|
|
3108
3108
|
bottom:0;
|
|
3109
3109
|
content:"";
|
|
@@ -3115,11 +3115,11 @@
|
|
|
3115
3115
|
transition:transform var(--animation-duration-2) var(--animation-easing-ease-base);
|
|
3116
3116
|
width:100%;
|
|
3117
3117
|
}
|
|
3118
|
-
.bp_breadcrumb_module_linkWithHover--
|
|
3118
|
+
.bp_breadcrumb_module_linkWithHover--30dee:hover::after{
|
|
3119
3119
|
transform:scaleX(1);
|
|
3120
3120
|
}
|
|
3121
3121
|
|
|
3122
|
-
.bp_breadcrumb_module_dropdownContent--
|
|
3122
|
+
.bp_breadcrumb_module_dropdownContent--30dee{
|
|
3123
3123
|
--blueprint-web-dropdown-menu-max-height:calc(var(--bp-size-300)*2);
|
|
3124
3124
|
}
|
|
3125
3125
|
.bp_link_module_link--27104{
|
|
@@ -11669,12 +11669,12 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
11669
11669
|
background-color:var(--switch-bg-on-hover);
|
|
11670
11670
|
}
|
|
11671
11671
|
|
|
11672
|
-
.bp_text_button_module_textButton--
|
|
11672
|
+
.bp_text_button_module_textButton--997ae[data-modern=false]{
|
|
11673
11673
|
--text-button-text-color:var(--text-cta-link);
|
|
11674
11674
|
--text-button-radius:calc(var(--radius-1)/2);
|
|
11675
11675
|
--text-button-padding:0;
|
|
11676
11676
|
--text-button-scale-loader-width:var(--size-05);
|
|
11677
|
-
--text-button-scale-loader-height
|
|
11677
|
+
--text-button-scale-loader-height:0.625em;
|
|
11678
11678
|
--text-button-scale-loader-border-radius:var(--radius-2);
|
|
11679
11679
|
--text-button-text-color-hover:var(--text-cta-link-hover);
|
|
11680
11680
|
--text-button-focus-box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
@@ -11687,20 +11687,20 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
11687
11687
|
text-decoration:var(--body-default-bold-text-decoration);
|
|
11688
11688
|
text-transform:var(--body-default-bold-text-case);
|
|
11689
11689
|
}
|
|
11690
|
-
.bp_text_button_module_textButton--
|
|
11690
|
+
.bp_text_button_module_textButton--997ae[data-modern=false].bp_text_button_module_isFontInherited--997ae{
|
|
11691
11691
|
--text-button-radius-font-inherited:0.125em;
|
|
11692
11692
|
--text-button-outline:var(--outline-focus-on-light);
|
|
11693
11693
|
}
|
|
11694
|
-
.bp_text_button_module_textButton--
|
|
11694
|
+
.bp_text_button_module_textButton--997ae[data-modern=false].bp_text_button_module_isIconButton--997ae{
|
|
11695
11695
|
--text-button-gap:var(--space-1);
|
|
11696
11696
|
}
|
|
11697
11697
|
|
|
11698
|
-
.bp_text_button_module_textButton--
|
|
11698
|
+
.bp_text_button_module_textButton--997ae[data-modern=true]{
|
|
11699
11699
|
--text-button-text-color:var(--bp-text-cta-link);
|
|
11700
11700
|
--text-button-radius:var(--bp-radius-04);
|
|
11701
11701
|
--text-button-padding:0 var(--bp-space-010);
|
|
11702
11702
|
--text-button-scale-loader-width:var(--bp-size-005);
|
|
11703
|
-
--text-button-scale-loader-height
|
|
11703
|
+
--text-button-scale-loader-height:0.625em;
|
|
11704
11704
|
--text-button-scale-loader-border-radius:var(--bp-radius-03);
|
|
11705
11705
|
--text-button-text-color-hover:var(--bp-text-cta-link-hover);
|
|
11706
11706
|
--text-button-focus-box-shadow:0 0 0 var(--bp-border-02) var(--bp-outline-focus-on-light);
|
|
@@ -11712,15 +11712,15 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
11712
11712
|
letter-spacing:var(--bp-font-letter-spacing-01);
|
|
11713
11713
|
line-height:var(--bp-font-line-height-04);
|
|
11714
11714
|
}
|
|
11715
|
-
.bp_text_button_module_textButton--
|
|
11715
|
+
.bp_text_button_module_textButton--997ae[data-modern=true].bp_text_button_module_isFontInherited--997ae{
|
|
11716
11716
|
--text-button-radius-font-inherited:0.375em;
|
|
11717
11717
|
--text-button-outline:var(--bp-outline-focus-on-light);
|
|
11718
11718
|
}
|
|
11719
|
-
.bp_text_button_module_textButton--
|
|
11719
|
+
.bp_text_button_module_textButton--997ae[data-modern=true].bp_text_button_module_isIconButton--997ae{
|
|
11720
11720
|
--text-button-gap:var(--bp-space-010);
|
|
11721
11721
|
}
|
|
11722
11722
|
|
|
11723
|
-
.bp_text_button_module_textButton--
|
|
11723
|
+
.bp_text_button_module_textButton--997ae{
|
|
11724
11724
|
align-items:center;
|
|
11725
11725
|
background:#0000;
|
|
11726
11726
|
border:none;
|
|
@@ -11733,59 +11733,65 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
11733
11733
|
-webkit-user-select:text;
|
|
11734
11734
|
user-select:text;
|
|
11735
11735
|
}
|
|
11736
|
-
.bp_text_button_module_textButton--
|
|
11736
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isFontInherited--997ae{
|
|
11737
11737
|
border-radius:var(--text-button-radius-font-inherited);
|
|
11738
11738
|
font:inherit;
|
|
11739
11739
|
}
|
|
11740
|
-
.bp_text_button_module_textButton--
|
|
11740
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isFontInherited--997ae.bp_text_button_module_isIconButton--997ae{
|
|
11741
11741
|
gap:.25em;
|
|
11742
11742
|
}
|
|
11743
|
-
.bp_text_button_module_textButton--
|
|
11743
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isFontInherited--997ae:not(:disabled)[data-focus-visible]{
|
|
11744
11744
|
box-shadow:0 0 0 .125em var(--text-button-outline);
|
|
11745
11745
|
}
|
|
11746
|
-
.bp_text_button_module_textButton--
|
|
11746
|
+
.bp_text_button_module_textButton--997ae .bp_text_button_module_scaleLoader--997ae div{
|
|
11747
11747
|
border-radius:var(--text-button-scale-loader-border-radius);
|
|
11748
11748
|
height:var(--text-button-scale-loader-height);
|
|
11749
11749
|
width:var(--text-button-scale-loader-width);
|
|
11750
11750
|
}
|
|
11751
|
-
.bp_text_button_module_textButton--
|
|
11751
|
+
.bp_text_button_module_textButton--997ae .bp_text_button_module_icon--997ae{
|
|
11752
11752
|
align-items:center;
|
|
11753
11753
|
display:flex;
|
|
11754
11754
|
}
|
|
11755
|
-
.bp_text_button_module_textButton--
|
|
11755
|
+
.bp_text_button_module_textButton--997ae .bp_text_button_module_hideTextContent--997ae{
|
|
11756
11756
|
visibility:hidden;
|
|
11757
11757
|
}
|
|
11758
|
-
.bp_text_button_module_textButton--
|
|
11758
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isEllipsized--997ae{
|
|
11759
11759
|
max-width:100%;
|
|
11760
11760
|
}
|
|
11761
|
-
.bp_text_button_module_textButton--
|
|
11761
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isEllipsized--997ae .bp_text_button_module_text--997ae{
|
|
11762
11762
|
display:block;
|
|
11763
11763
|
min-width:0;
|
|
11764
11764
|
overflow:hidden;
|
|
11765
11765
|
text-overflow:ellipsis;
|
|
11766
11766
|
white-space:nowrap;
|
|
11767
11767
|
}
|
|
11768
|
-
.bp_text_button_module_textButton--
|
|
11768
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_isIconButton--997ae{
|
|
11769
11769
|
gap:var(--text-button-gap);
|
|
11770
11770
|
}
|
|
11771
|
-
.bp_text_button_module_textButton--
|
|
11771
|
+
.bp_text_button_module_textButton--997ae.bp_text_button_module_visuallyHidden--997ae{
|
|
11772
11772
|
color:#0000;
|
|
11773
11773
|
pointer-events:none;
|
|
11774
11774
|
position:relative;
|
|
11775
11775
|
}
|
|
11776
|
-
.bp_text_button_module_textButton--
|
|
11776
|
+
.bp_text_button_module_textButton--997ae:disabled{
|
|
11777
11777
|
opacity:.3;
|
|
11778
11778
|
}
|
|
11779
|
-
.bp_text_button_module_textButton--
|
|
11779
|
+
.bp_text_button_module_textButton--997ae:not(:disabled):hover,.bp_text_button_module_textButton--997ae:not(:disabled)[data-focus-visible]{
|
|
11780
11780
|
color:var(--text-button-text-color-hover);
|
|
11781
11781
|
}
|
|
11782
|
-
.bp_text_button_module_textButton--
|
|
11782
|
+
.bp_text_button_module_textButton--997ae:not(:disabled)[data-focus-visible]{
|
|
11783
11783
|
box-shadow:var(--text-button-focus-box-shadow);
|
|
11784
11784
|
}
|
|
11785
|
-
.bp_text_button_module_textButton--
|
|
11785
|
+
.bp_text_button_module_textButton--997ae:not(:disabled):active{
|
|
11786
11786
|
color:var(--text-button-text-color-active);
|
|
11787
11787
|
}
|
|
11788
11788
|
|
|
11789
|
+
.bp_text_button_module_textButton--997ae[data-bp-animated=true]{
|
|
11790
|
+
transition-duration:var(--bp-duration-short);
|
|
11791
|
+
transition-property:color;
|
|
11792
|
+
transition-timing-function:var(--bp-curve-small-on);
|
|
11793
|
+
}
|
|
11794
|
+
|
|
11789
11795
|
.bp_text_input_module_textInput--ede11.bp_text_input_module_textInput--ede11.bp_text_input_module_textInput--ede11 input:has(+ .bp_text_input_module_iconEnd--ede11){
|
|
11790
11796
|
padding-inline-end:1.875rem;
|
|
11791
11797
|
}
|
|
@@ -5,6 +5,7 @@ import { forwardRef, useRef, createElement } from 'react';
|
|
|
5
5
|
import { LoadingIndicator } from '../loading-indicator/loading-indicator.js';
|
|
6
6
|
import { Text } from '../text/text.js';
|
|
7
7
|
import { TooltipWrapper } from '../utils/TooltipWrapper.js';
|
|
8
|
+
import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
9
|
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
10
|
import { getButtonOptions } from '../utils/getButtonOptions.js';
|
|
10
11
|
import { useIsEllipsized } from '../utils/useIsEllipsized.js';
|
|
@@ -27,6 +28,10 @@ const TextButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27
28
|
const {
|
|
28
29
|
enableModernizedComponents
|
|
29
30
|
} = useBlueprintModernization();
|
|
31
|
+
const {
|
|
32
|
+
componentsWithAnimationEnabled
|
|
33
|
+
} = useBlueprintConfiguration();
|
|
34
|
+
const isAnimationEnabled = componentsWithAnimationEnabled.includes('TextButton');
|
|
30
35
|
const textRef = useRef(null);
|
|
31
36
|
const isEllipsized = useIsEllipsized(ellipsizable ? textRef : {
|
|
32
37
|
current: null
|
|
@@ -46,6 +51,7 @@ const TextButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
46
51
|
[styles.isFontInherited]: inheritFont,
|
|
47
52
|
[styles.isEllipsized]: ellipsizable
|
|
48
53
|
}, className),
|
|
54
|
+
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
49
55
|
"data-modern": dataModernValue,
|
|
50
56
|
children: [variant || color ? jsx(Text, {
|
|
51
57
|
ref: textRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"textButton":"bp_text_button_module_textButton--
|
|
2
|
+
var styles = {"textButton":"bp_text_button_module_textButton--997ae","isFontInherited":"bp_text_button_module_isFontInherited--997ae","isIconButton":"bp_text_button_module_isIconButton--997ae","scaleLoader":"bp_text_button_module_scaleLoader--997ae","icon":"bp_text_button_module_icon--997ae","hideTextContent":"bp_text_button_module_hideTextContent--997ae","isEllipsized":"bp_text_button_module_isEllipsized--997ae","text":"bp_text_button_module_text--997ae","visuallyHidden":"bp_text_button_module_visuallyHidden--997ae"};
|
|
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.8.0",
|
|
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.112.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.112.5",
|
|
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.17.
|
|
80
|
+
"@box/storybook-utils": "^0.17.32",
|
|
81
81
|
"@figma/code-connect": "1.3.12",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|