@box/blueprint-web 7.30.0 → 7.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/lib-esm/index.css +24 -17
- package/lib-esm/text-toggle-button/text-toggle-button.module.js +1 -1
- package/lib-esm/util-components/base-grid-list-item/base-grid-list-item-header.js +10 -10
- package/lib-esm/util-components/base-grid-list-item/base-grid-list-item-subtitle.js +11 -12
- package/lib-esm/utils/useFullTextTooltip.d.ts +2 -1
- package/lib-esm/utils/useFullTextTooltip.js +4 -3
- package/package.json +2 -2
package/lib-esm/index.css
CHANGED
|
@@ -5518,11 +5518,11 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5518
5518
|
padding-inline-end:1.875rem;
|
|
5519
5519
|
}
|
|
5520
5520
|
|
|
5521
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5521
|
+
.bp_text_toggle_button_module_textToggleButton--296a4{
|
|
5522
5522
|
background:var(--surface-toggle-surface);
|
|
5523
|
-
border:var(--border-1) solid var(--border-
|
|
5523
|
+
border:var(--border-1) solid var(--border-toggletext-border-off);
|
|
5524
5524
|
border-radius:var(--radius-2);
|
|
5525
|
-
color:var(--text-text
|
|
5525
|
+
color:var(--text-toggletext-text);
|
|
5526
5526
|
cursor:pointer;
|
|
5527
5527
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5528
5528
|
font-size:.875rem;
|
|
@@ -5538,28 +5538,35 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5538
5538
|
user-select:none;
|
|
5539
5539
|
white-space:nowrap;
|
|
5540
5540
|
}
|
|
5541
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5541
|
+
.bp_text_toggle_button_module_textToggleButton--296a4:disabled,.bp_text_toggle_button_module_textToggleButton--296a4[aria-disabled]{
|
|
5542
5542
|
opacity:.3;
|
|
5543
5543
|
pointer-events:none;
|
|
5544
5544
|
}
|
|
5545
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5545
|
+
.bp_text_toggle_button_module_textToggleButton--296a4:hover{
|
|
5546
|
+
background:var(--surface-toggle-surface-off-hover);
|
|
5547
|
+
border-color:var(--border-toggletext-border-off-hover);
|
|
5548
|
+
}
|
|
5549
|
+
.bp_text_toggle_button_module_textToggleButton--296a4:focus,.bp_text_toggle_button_module_textToggleButton--296a4[data-focus-visible]{
|
|
5546
5550
|
box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
|
|
5547
5551
|
}
|
|
5548
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5549
|
-
background:var(--surface-
|
|
5550
|
-
border:var(--border-
|
|
5552
|
+
.bp_text_toggle_button_module_textToggleButton--296a4:active,.bp_text_toggle_button_module_textToggleButton--296a4[data-active]{
|
|
5553
|
+
background:var(--surface-toggle-surface-off-pressed);
|
|
5554
|
+
border-color:var(--border-toggletext-border-off-pressed);
|
|
5555
|
+
}
|
|
5556
|
+
.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true]{
|
|
5557
|
+
background:var(--surface-toggletext-surface-on);
|
|
5558
|
+
border:var(--border-1) solid var(--border-toggletext-border-on);
|
|
5551
5559
|
}
|
|
5552
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5553
|
-
background:var(--surface-
|
|
5560
|
+
.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true]:hover{
|
|
5561
|
+
background:var(--surface-toggletext-surface-on-hover);
|
|
5562
|
+
border-color:var(--border-toggletext-border-on-hover);
|
|
5554
5563
|
}
|
|
5555
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5556
|
-
|
|
5557
|
-
border:var(--border-1) solid var(--surface-toggle-surface-pressed);
|
|
5558
|
-
color:var(--text-text-on-dark);
|
|
5564
|
+
.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true]:focus,.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true][data-focus-visible]{
|
|
5565
|
+
box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
|
|
5559
5566
|
}
|
|
5560
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5561
|
-
background:var(--surface-
|
|
5562
|
-
border:var(--border-
|
|
5567
|
+
.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true]:active,.bp_text_toggle_button_module_textToggleButton--296a4[aria-pressed=true][data-active]{
|
|
5568
|
+
background:var(--surface-toggletext-surface-on-pressed);
|
|
5569
|
+
border-color:var(--border-toggletext-border-on-pressed);
|
|
5563
5570
|
}
|
|
5564
5571
|
:root{
|
|
5565
5572
|
--notification-default-paragraph-indent:0rem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { forwardRef, useRef
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
4
|
import { Ghost } from '../../ghost/ghost.js';
|
|
5
5
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
6
6
|
import { useFullTextTooltip } from '../../utils/useFullTextTooltip.js';
|
|
@@ -16,26 +16,26 @@ const BaseGridListHeader = /*#__PURE__*/forwardRef(function BaseGridListHeader(p
|
|
|
16
16
|
...rest
|
|
17
17
|
} = props;
|
|
18
18
|
const ref = useRef(null);
|
|
19
|
+
const {
|
|
20
|
+
loading
|
|
21
|
+
} = useBaseGridListItemContext();
|
|
22
|
+
const {
|
|
23
|
+
layout
|
|
24
|
+
} = useBaseGridListContext();
|
|
19
25
|
const {
|
|
20
26
|
Wrapper,
|
|
21
27
|
wrapperProps
|
|
22
28
|
} = useFullTextTooltip({
|
|
23
29
|
ref,
|
|
24
30
|
children,
|
|
25
|
-
textValue
|
|
31
|
+
textValue,
|
|
32
|
+
skipOverflowCheck: loading
|
|
26
33
|
});
|
|
27
|
-
const {
|
|
28
|
-
loading
|
|
29
|
-
} = useBaseGridListItemContext();
|
|
30
|
-
const {
|
|
31
|
-
layout
|
|
32
|
-
} = useBaseGridListContext();
|
|
33
34
|
const isLargeItem = layout === 'list';
|
|
34
35
|
const isSmallListItem = layout === 'small-list';
|
|
35
|
-
const LoadingWrapper = loading ? Fragment : Wrapper;
|
|
36
36
|
return (
|
|
37
37
|
// @ts-expect-error Fix this type error
|
|
38
|
-
jsx(
|
|
38
|
+
jsx(Wrapper, {
|
|
39
39
|
...wrapperProps,
|
|
40
40
|
children: jsx("span", {
|
|
41
41
|
...rest,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { forwardRef, useRef
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
4
|
import { Ghost } from '../../ghost/ghost.js';
|
|
5
5
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
6
6
|
import { useFullTextTooltip } from '../../utils/useFullTextTooltip.js';
|
|
@@ -15,21 +15,20 @@ const BaseGridListSubtitle = /*#__PURE__*/forwardRef(function BaseGridListSubtit
|
|
|
15
15
|
...rest
|
|
16
16
|
} = props;
|
|
17
17
|
const ref = useRef(null);
|
|
18
|
-
const {
|
|
19
|
-
Wrapper,
|
|
20
|
-
wrapperProps
|
|
21
|
-
} = useFullTextTooltip({
|
|
22
|
-
ref,
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
18
|
const {
|
|
26
19
|
loading
|
|
27
20
|
} = useBaseGridListItemContext();
|
|
28
21
|
const {
|
|
29
22
|
layout
|
|
30
23
|
} = useBaseGridListContext();
|
|
31
|
-
const
|
|
32
|
-
|
|
24
|
+
const {
|
|
25
|
+
Wrapper,
|
|
26
|
+
wrapperProps
|
|
27
|
+
} = useFullTextTooltip({
|
|
28
|
+
ref,
|
|
29
|
+
children,
|
|
30
|
+
skipOverflowCheck: loading
|
|
31
|
+
});
|
|
33
32
|
const isGridItem = layout === 'grid';
|
|
34
33
|
const isSmallListItem = layout === 'small-list';
|
|
35
34
|
const forkRef = useForkRef(ref, forwardedRef);
|
|
@@ -39,8 +38,8 @@ const BaseGridListSubtitle = /*#__PURE__*/forwardRef(function BaseGridListSubtit
|
|
|
39
38
|
}
|
|
40
39
|
return (
|
|
41
40
|
// @ts-expect-error Fix this type error
|
|
42
|
-
jsx(
|
|
43
|
-
...
|
|
41
|
+
jsx(Wrapper, {
|
|
42
|
+
...wrapperProps,
|
|
44
43
|
children: jsx("span", {
|
|
45
44
|
...rest,
|
|
46
45
|
ref: forkRef,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type MutableRefObject, type ReactNode } from 'react';
|
|
2
|
-
export declare const useFullTextTooltip: ({ ref, children, textValue, }: {
|
|
2
|
+
export declare const useFullTextTooltip: ({ ref, children, textValue, skipOverflowCheck, }: {
|
|
3
3
|
ref: MutableRefObject<null> | MutableRefObject<HTMLSpanElement>;
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
textValue?: string | undefined;
|
|
6
|
+
skipOverflowCheck?: boolean | undefined;
|
|
6
7
|
}) => {
|
|
7
8
|
Wrapper: ((props: import("../tooltip").TooltipProps) => import("react/jsx-runtime").JSX.Element) | import("react").ExoticComponent<{
|
|
8
9
|
children?: ReactNode;
|
|
@@ -4,17 +4,18 @@ import { Tooltip } from '../tooltip/tooltip.js';
|
|
|
4
4
|
const useFullTextTooltip = ({
|
|
5
5
|
ref,
|
|
6
6
|
children,
|
|
7
|
-
textValue
|
|
7
|
+
textValue,
|
|
8
|
+
skipOverflowCheck
|
|
8
9
|
}) => {
|
|
9
10
|
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
10
11
|
useEffect(() => {
|
|
11
|
-
if (!ref?.current) {
|
|
12
|
+
if (!ref?.current || skipOverflowCheck) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
if (ref.current.scrollHeight > ref.current.clientHeight || ref.current.scrollWidth > ref.current.clientWidth) {
|
|
15
16
|
setIsOverflowing(true);
|
|
16
17
|
}
|
|
17
|
-
}, [ref]);
|
|
18
|
+
}, [ref, skipOverflowCheck]);
|
|
18
19
|
const Wrapper = isOverflowing ? Tooltip : Fragment;
|
|
19
20
|
const wrapperProps = isOverflowing ? {
|
|
20
21
|
content: textValue ?? children
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "7.30.
|
|
3
|
+
"version": "7.30.1",
|
|
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": "c68217f7a7d9a18a9f6984a3c8582ece76195e66",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|