@box/blueprint-web 9.16.3 → 9.16.4
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.
|
@@ -84,6 +84,7 @@ const RootInner = ({
|
|
|
84
84
|
const inputRef = useRef(null);
|
|
85
85
|
const comboboxId = useUniqueId('combobox-', !idForLabel) || idForLabel || 'default-combobox-id';
|
|
86
86
|
const popoverRef = useRef(null);
|
|
87
|
+
const comboboxContainerRef = useRef(null);
|
|
87
88
|
const popoverRefCallback = useCallback(node => {
|
|
88
89
|
popoverRef.current = node;
|
|
89
90
|
getPopoverRef?.(node);
|
|
@@ -238,6 +239,13 @@ const RootInner = ({
|
|
|
238
239
|
return prev;
|
|
239
240
|
});
|
|
240
241
|
};
|
|
242
|
+
const handleFocusInputOnEvent = useCallback(event => {
|
|
243
|
+
// don't focus if child element event was triggered
|
|
244
|
+
if (event.target !== event.currentTarget) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
focusInput();
|
|
248
|
+
}, [focusInput]);
|
|
241
249
|
const removeSingleSelectInputChip = () => {
|
|
242
250
|
resetSelectedValue();
|
|
243
251
|
focusInput();
|
|
@@ -260,12 +268,16 @@ const RootInner = ({
|
|
|
260
268
|
}), jsx(PopoverAnchor, {
|
|
261
269
|
store: comboboxStore,
|
|
262
270
|
children: jsxs("div", {
|
|
271
|
+
ref: comboboxContainerRef,
|
|
263
272
|
className: clsx(styles.comboboxContainer, {
|
|
264
273
|
[styles.error]: hasError,
|
|
265
274
|
[styles.withChips]: showChipsGroup || showSingleSelectChip,
|
|
266
275
|
[styles.withComboboxButtons]: showComboboxCancelButton || Boolean(endComboboxIcon)
|
|
267
276
|
}),
|
|
277
|
+
"data-testid": "combobox-container",
|
|
278
|
+
onClick: handleFocusInputOnEvent,
|
|
268
279
|
children: [showChipsGroup && jsx(ChipsGroup, {
|
|
280
|
+
onClick: handleFocusInputOnEvent,
|
|
269
281
|
children: selectedValue.map(selected => jsx(InputChip, {
|
|
270
282
|
avatar: getDisplayAvatarFromOptionValue(selected, options, displayAvatar),
|
|
271
283
|
label: getDisplayValueFromOptionValue(selected, options, displayValue),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"container":"bp_combobox_module_container--
|
|
2
|
+
var styles = {"container":"bp_combobox_module_container--fbb28","disabled":"bp_combobox_module_disabled--fbb28","label":"bp_combobox_module_label--fbb28","hiddenLabel":"bp_combobox_module_hiddenLabel--fbb28","comboboxContainer":"bp_combobox_module_comboboxContainer--fbb28","withComboboxButtons":"bp_combobox_module_withComboboxButtons--fbb28","error":"bp_combobox_module_error--fbb28","textInputWrapper":"bp_combobox_module_textInputWrapper--fbb28","textInput":"bp_combobox_module_textInput--fbb28","errorIcon":"bp_combobox_module_errorIcon--fbb28","comboboxButtons":"bp_combobox_module_comboboxButtons--fbb28","withChips":"bp_combobox_module_withChips--fbb28","inlineError":"bp_combobox_module_inlineError--fbb28","popover":"bp_combobox_module_popover--fbb28","option":"bp_combobox_module_option--fbb28","indicator":"bp_combobox_module_indicator--fbb28","indicatorIcon":"bp_combobox_module_indicatorIcon--fbb28","optionWithIndicator":"bp_combobox_module_optionWithIndicator--fbb28","loadingIndicator":"bp_combobox_module_loadingIndicator--fbb28","noResultOption":"bp_combobox_module_noResultOption--fbb28"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/lib-esm/index.css
CHANGED
|
@@ -1632,7 +1632,7 @@
|
|
|
1632
1632
|
max-width:100%;
|
|
1633
1633
|
}
|
|
1634
1634
|
|
|
1635
|
-
.bp_combobox_module_container--
|
|
1635
|
+
.bp_combobox_module_container--fbb28{
|
|
1636
1636
|
display:flex;
|
|
1637
1637
|
flex-direction:column;
|
|
1638
1638
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1643,10 +1643,10 @@
|
|
|
1643
1643
|
text-decoration:none;
|
|
1644
1644
|
text-transform:none;
|
|
1645
1645
|
}
|
|
1646
|
-
.bp_combobox_module_container--
|
|
1646
|
+
.bp_combobox_module_container--fbb28.bp_combobox_module_disabled--fbb28{
|
|
1647
1647
|
opacity:60%;
|
|
1648
1648
|
}
|
|
1649
|
-
.bp_combobox_module_container--
|
|
1649
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_label--fbb28{
|
|
1650
1650
|
color:var(--text-text-on-light);
|
|
1651
1651
|
flex:0 0 fit-content;
|
|
1652
1652
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1658,10 +1658,10 @@
|
|
|
1658
1658
|
text-decoration:none;
|
|
1659
1659
|
text-transform:none;
|
|
1660
1660
|
}
|
|
1661
|
-
.bp_combobox_module_container--
|
|
1661
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_label--fbb28:not(.bp_combobox_module_hiddenLabel--fbb28){
|
|
1662
1662
|
margin-block-end:var(--space-2);
|
|
1663
1663
|
}
|
|
1664
|
-
.bp_combobox_module_container--
|
|
1664
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28{
|
|
1665
1665
|
background-color:var(--surface-dropdown-surface);
|
|
1666
1666
|
border-bottom:var(--blueprint-combobox-border-bottom-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1667
1667
|
border-left:var(--blueprint-combobox-border-left-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
@@ -1669,6 +1669,7 @@
|
|
|
1669
1669
|
border-right:var(--blueprint-combobox-border-right-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1670
1670
|
border-top:var(--blueprint-combobox-border-top-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1671
1671
|
box-shadow:var(--innershadow-1);
|
|
1672
|
+
cursor:text;
|
|
1672
1673
|
display:flex;
|
|
1673
1674
|
flex-wrap:wrap;
|
|
1674
1675
|
gap:var(--space-2);
|
|
@@ -1677,15 +1678,15 @@
|
|
|
1677
1678
|
padding-inline:var(--space-3);
|
|
1678
1679
|
position:relative;
|
|
1679
1680
|
}
|
|
1680
|
-
.bp_combobox_module_container--
|
|
1681
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28.bp_combobox_module_withComboboxButtons--fbb28{
|
|
1681
1682
|
padding-inline-end:var(--space-10);
|
|
1682
1683
|
}
|
|
1683
|
-
.bp_combobox_module_container--
|
|
1684
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28:not(:disabled):has(input:focus){
|
|
1684
1685
|
background-color:var(--surface-dropdown-surface-focus);
|
|
1685
1686
|
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
1686
1687
|
padding-block:calc((2.5rem - var(--space-5))/2 - var(--border-2));
|
|
1687
1688
|
}
|
|
1688
|
-
.bp_combobox_module_container--
|
|
1689
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28:not(:disabled).bp_combobox_module_error--fbb28,.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28:not(:disabled):has([aria-invalid=true]){
|
|
1689
1690
|
background-color:var(--surface-dropdown-surface-error);
|
|
1690
1691
|
border-bottom:var(--blueprint-combobox-border-error-bottom-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1691
1692
|
border-left:var(--blueprint-combobox-border-error-left-width, var(--border-2)) solid var(--border-input-border-error);
|
|
@@ -1693,13 +1694,13 @@
|
|
|
1693
1694
|
border-top:var(--blueprint-combobox-border-error-top-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1694
1695
|
padding-block:calc((2.5rem - var(--space-5))/2 - var(--border-2));
|
|
1695
1696
|
}
|
|
1696
|
-
.bp_combobox_module_container--
|
|
1697
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28 .bp_combobox_module_textInputWrapper--fbb28{
|
|
1697
1698
|
align-items:center;
|
|
1698
1699
|
display:flex;
|
|
1699
1700
|
flex:content;
|
|
1700
1701
|
gap:var(--space-2);
|
|
1701
1702
|
}
|
|
1702
|
-
.bp_combobox_module_container--
|
|
1703
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28 .bp_combobox_module_textInputWrapper--fbb28 .bp_combobox_module_textInput--fbb28{
|
|
1703
1704
|
background-color:initial;
|
|
1704
1705
|
border:none;
|
|
1705
1706
|
color:var(--text-text-on-light);
|
|
@@ -1715,28 +1716,28 @@
|
|
|
1715
1716
|
text-transform:none;
|
|
1716
1717
|
width:100%;
|
|
1717
1718
|
}
|
|
1718
|
-
.bp_combobox_module_container--
|
|
1719
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28 .bp_combobox_module_textInputWrapper--fbb28 .bp_combobox_module_errorIcon--fbb28 path{
|
|
1719
1720
|
fill:var(--icon-icon-error-on-light);
|
|
1720
1721
|
}
|
|
1721
|
-
.bp_combobox_module_container--
|
|
1722
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28 .bp_combobox_module_textInputWrapper--fbb28 .bp_combobox_module_comboboxButtons--fbb28{
|
|
1722
1723
|
align-items:center;
|
|
1723
1724
|
display:flex;
|
|
1724
1725
|
position:absolute;
|
|
1725
1726
|
right:var(--space-2);
|
|
1726
1727
|
top:var(--space-2);
|
|
1727
1728
|
}
|
|
1728
|
-
.bp_combobox_module_container--
|
|
1729
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28.bp_combobox_module_withChips--fbb28{
|
|
1729
1730
|
max-height:calc(var(--space-2)*2 + var(--space-6)*3);
|
|
1730
1731
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-1));
|
|
1731
1732
|
}
|
|
1732
|
-
.bp_combobox_module_container--
|
|
1733
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28.bp_combobox_module_withChips--fbb28:not(:disabled).bp_combobox_module_error--fbb28,.bp_combobox_module_container--fbb28 .bp_combobox_module_comboboxContainer--fbb28.bp_combobox_module_withChips--fbb28:not(:disabled):has(input:focus){
|
|
1733
1734
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-2));
|
|
1734
1735
|
}
|
|
1735
|
-
.bp_combobox_module_container--
|
|
1736
|
+
.bp_combobox_module_container--fbb28 .bp_combobox_module_inlineError--fbb28{
|
|
1736
1737
|
margin-block-start:var(--space-2);
|
|
1737
1738
|
}
|
|
1738
1739
|
|
|
1739
|
-
.bp_combobox_module_popover--
|
|
1740
|
+
.bp_combobox_module_popover--fbb28{
|
|
1740
1741
|
background-color:var(--surface-menu-surface);
|
|
1741
1742
|
border:var(--border-1) solid var(--border-card-border);
|
|
1742
1743
|
border-radius:var(--radius-3);
|
|
@@ -1754,7 +1755,7 @@
|
|
|
1754
1755
|
text-transform:none;
|
|
1755
1756
|
z-index:380;
|
|
1756
1757
|
}
|
|
1757
|
-
.bp_combobox_module_popover--
|
|
1758
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28{
|
|
1758
1759
|
border:var(--border-2) solid #0000;
|
|
1759
1760
|
border-radius:var(--radius-3);
|
|
1760
1761
|
box-sizing:border-box;
|
|
@@ -1768,17 +1769,17 @@
|
|
|
1768
1769
|
user-select:none;
|
|
1769
1770
|
width:100%;
|
|
1770
1771
|
}
|
|
1771
|
-
.bp_combobox_module_popover--
|
|
1772
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28[aria-disabled]{
|
|
1772
1773
|
opacity:60%;
|
|
1773
1774
|
}
|
|
1774
|
-
.bp_combobox_module_popover--
|
|
1775
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28[data-active-item]:not([aria-disabled]){
|
|
1775
1776
|
background-color:var(--surface-menu-surface-focus);
|
|
1776
1777
|
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
1777
1778
|
}
|
|
1778
|
-
.bp_combobox_module_popover--
|
|
1779
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28:hover{
|
|
1779
1780
|
background-color:var(--surface-menu-surface-hover);
|
|
1780
1781
|
}
|
|
1781
|
-
.bp_combobox_module_popover--
|
|
1782
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28 .bp_combobox_module_indicator--fbb28{
|
|
1782
1783
|
align-items:center;
|
|
1783
1784
|
display:flex;
|
|
1784
1785
|
height:var(--size-9);
|
|
@@ -1787,16 +1788,16 @@
|
|
|
1787
1788
|
position:absolute;
|
|
1788
1789
|
top:0;
|
|
1789
1790
|
}
|
|
1790
|
-
.bp_combobox_module_popover--
|
|
1791
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_option--fbb28 .bp_combobox_module_indicator--fbb28 .bp_combobox_module_indicatorIcon--fbb28 path{
|
|
1791
1792
|
fill:var(--icon-icon-on-light);
|
|
1792
1793
|
}
|
|
1793
|
-
.bp_combobox_module_popover--
|
|
1794
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_optionWithIndicator--fbb28{
|
|
1794
1795
|
padding-inline:var(--space-10) var(--space-2);
|
|
1795
1796
|
}
|
|
1796
|
-
.bp_combobox_module_popover--
|
|
1797
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_loadingIndicator--fbb28{
|
|
1797
1798
|
position:unset;
|
|
1798
1799
|
}
|
|
1799
|
-
.bp_combobox_module_popover--
|
|
1800
|
+
.bp_combobox_module_popover--fbb28 .bp_combobox_module_noResultOption--fbb28{
|
|
1800
1801
|
color:var(--text-text-on-light);
|
|
1801
1802
|
-webkit-user-select:none;
|
|
1802
1803
|
user-select:none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "9.16.
|
|
3
|
+
"version": "9.16.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react-stately": "^3.31.1",
|
|
63
63
|
"tsx": "^4.16.5"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "f58cf1277072f105b17749d2507552fdd1fd2d3f",
|
|
66
66
|
"module": "lib-esm/index.js",
|
|
67
67
|
"main": "lib-esm/index.js",
|
|
68
68
|
"types": "lib-esm/index.d.ts",
|