@box/blueprint-web 7.29.3 → 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/combobox/chips-group.js +6 -1
- package/lib-esm/combobox/combobox.js +14 -5
- package/lib-esm/combobox/combobox.module.js +1 -1
- package/lib-esm/index.css +66 -56
- package/lib-esm/input-chip/input-chip.js +6 -4
- package/lib-esm/input-chip/input-chip.module.js +1 -1
- package/lib-esm/input-chip/types.d.ts +1 -1
- 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
|
@@ -59,6 +59,9 @@ const ChipsGroup = props => {
|
|
|
59
59
|
if (child.type !== InputChip) {
|
|
60
60
|
throw Error(`Component of type ${child.type} is not allowed. The ChildGroup component only accepts InputChip as children.`);
|
|
61
61
|
}
|
|
62
|
+
if (!child.props.onDelete) {
|
|
63
|
+
throw Error(`Input chip must have an onDelete prop.`);
|
|
64
|
+
}
|
|
62
65
|
const childElement = child;
|
|
63
66
|
return jsx("div", {
|
|
64
67
|
role: "row",
|
|
@@ -84,7 +87,9 @@ const ChipsGroup = props => {
|
|
|
84
87
|
'aria-describedby': undefined,
|
|
85
88
|
// Make sure to remove InputChip reference when removed + focus the next one
|
|
86
89
|
onDelete: () => {
|
|
87
|
-
childElement
|
|
90
|
+
// We know childElement will always have an onDelete function because of the error
|
|
91
|
+
// above. Optional chaining is to make typescript happy
|
|
92
|
+
childElement.props.onDelete?.();
|
|
88
93
|
handleDelete(index);
|
|
89
94
|
},
|
|
90
95
|
// Handle keyboard navigation
|
|
@@ -175,7 +175,7 @@ const RootInner = ({
|
|
|
175
175
|
const selectedValueMemoized = useMemo(() => selectedValue, [JSON.stringify(selectedValue)]);
|
|
176
176
|
// Reset input whenever an option is checked or unchecked
|
|
177
177
|
useEffect(() => {
|
|
178
|
-
if (Array.isArray(selectedValueMemoized)) {
|
|
178
|
+
if (Array.isArray(selectedValueMemoized) || showSingleSelectChip) {
|
|
179
179
|
setInputValue('');
|
|
180
180
|
} else if (selectedValueMemoized) {
|
|
181
181
|
setInputValue(getDisplayValueFromOptionValue(selectedValueMemoized, options, displayValue));
|
|
@@ -209,14 +209,14 @@ const RootInner = ({
|
|
|
209
209
|
if (!clearOnBlur || isOpen) {
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
setInputValue(Array.isArray(selectedValue) ? '' : getDisplayValueFromOptionValue(selectedValue, options, displayValue));
|
|
212
|
+
setInputValue(Array.isArray(selectedValue) || showSingleSelectChip ? '' : getDisplayValueFromOptionValue(selectedValue, options, displayValue));
|
|
213
213
|
},
|
|
214
214
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
215
215
|
[clearOnBlur, isOpen, selectedValue, setInputValue]);
|
|
216
216
|
const handleOnFocus = useCallback(event => {
|
|
217
217
|
onFocus?.(event);
|
|
218
218
|
}, [onFocus]);
|
|
219
|
-
const
|
|
219
|
+
const removeMultiSelectInputChip = id => {
|
|
220
220
|
// For multi-select variant only
|
|
221
221
|
selectStore.setValue(prev => {
|
|
222
222
|
if (Array.isArray(prev)) {
|
|
@@ -233,9 +233,14 @@ const RootInner = ({
|
|
|
233
233
|
return prev;
|
|
234
234
|
});
|
|
235
235
|
};
|
|
236
|
+
const removeSingleSelectInputChip = () => {
|
|
237
|
+
resetSelectedValue();
|
|
238
|
+
focusInput();
|
|
239
|
+
};
|
|
236
240
|
const reference = useForkRef(inputRef, ref);
|
|
237
241
|
const showChipsGroup = Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
238
242
|
const showComboboxCancelButton = clearButtonAriaLabel && (inputValue.length > 0 || (Array.isArray(selectedValue) ? selectedValue.length > 0 : !!selectedValue));
|
|
243
|
+
const showSingleSelectChip = showComboboxCancelButton && !Array.isArray(selectedValue) && !!selectedValue;
|
|
239
244
|
const Label = useLabelable(label, comboboxId);
|
|
240
245
|
const inputComponent = isInput ? jsxs(Fragment, {
|
|
241
246
|
children: [jsx(Label, {
|
|
@@ -248,16 +253,20 @@ const RootInner = ({
|
|
|
248
253
|
children: jsxs("div", {
|
|
249
254
|
className: clsx(styles.comboboxContainer, {
|
|
250
255
|
[styles.error]: hasError,
|
|
251
|
-
[styles.
|
|
256
|
+
[styles.withChips]: showChipsGroup || showSingleSelectChip,
|
|
252
257
|
[styles.withComboboxButtons]: showComboboxCancelButton || Boolean(endComboboxIcon)
|
|
253
258
|
}),
|
|
254
259
|
children: [showChipsGroup && jsx(ChipsGroup, {
|
|
255
260
|
children: selectedValue.map(selected => jsx(InputChip, {
|
|
256
261
|
avatar: getDisplayAvatarFromOptionValue(selected),
|
|
257
262
|
label: getDisplayValueFromOptionValue(selected, options, displayValue),
|
|
258
|
-
onDelete: () =>
|
|
263
|
+
onDelete: () => removeMultiSelectInputChip(selected),
|
|
259
264
|
tooltip: getTooltipValueFromOptionValue(selected, options, displayTooltip)
|
|
260
265
|
}, selected))
|
|
266
|
+
}), showSingleSelectChip && jsx(InputChip, {
|
|
267
|
+
label: getDisplayValueFromOptionValue(selectedValue, options, displayValue),
|
|
268
|
+
onDelete: showComboboxCancelButton ? undefined : removeSingleSelectInputChip,
|
|
269
|
+
tooltip: getTooltipValueFromOptionValue(selectedValue, options, displayTooltip)
|
|
261
270
|
}), jsxs("div", {
|
|
262
271
|
className: styles.textInputWrapper,
|
|
263
272
|
children: [jsx(Combobox$1, {
|
|
@@ -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--5f513","disabled":"bp_combobox_module_disabled--5f513","label":"bp_combobox_module_label--5f513","hiddenLabel":"bp_combobox_module_hiddenLabel--5f513","comboboxContainer":"bp_combobox_module_comboboxContainer--5f513","withComboboxButtons":"bp_combobox_module_withComboboxButtons--5f513","error":"bp_combobox_module_error--5f513","textInputWrapper":"bp_combobox_module_textInputWrapper--5f513","textInput":"bp_combobox_module_textInput--5f513","errorIcon":"bp_combobox_module_errorIcon--5f513","comboboxButtons":"bp_combobox_module_comboboxButtons--5f513","withChips":"bp_combobox_module_withChips--5f513","inlineError":"bp_combobox_module_inlineError--5f513","popover":"bp_combobox_module_popover--5f513","option":"bp_combobox_module_option--5f513","indicator":"bp_combobox_module_indicator--5f513","indicatorIcon":"bp_combobox_module_indicatorIcon--5f513","optionWithIndicator":"bp_combobox_module_optionWithIndicator--5f513","loadingIndicator":"bp_combobox_module_loadingIndicator--5f513","noResultOption":"bp_combobox_module_noResultOption--5f513"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/lib-esm/index.css
CHANGED
|
@@ -1348,7 +1348,7 @@
|
|
|
1348
1348
|
height:0;
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
|
-
.bp_input_chip_module_container--
|
|
1351
|
+
.bp_input_chip_module_container--482bc{
|
|
1352
1352
|
align-items:center;
|
|
1353
1353
|
background-color:var(--surface-inputchip-surface);
|
|
1354
1354
|
border:none;
|
|
@@ -1365,36 +1365,39 @@
|
|
|
1365
1365
|
max-width:100%;
|
|
1366
1366
|
outline:none;
|
|
1367
1367
|
padding-block:var(--space-05);
|
|
1368
|
-
padding-inline:var(--space-1) var(--space-
|
|
1368
|
+
padding-inline:var(--space-1) var(--space-1);
|
|
1369
1369
|
text-decoration:none;
|
|
1370
1370
|
text-transform:none;
|
|
1371
1371
|
-webkit-user-select:none;
|
|
1372
1372
|
user-select:none;
|
|
1373
1373
|
}
|
|
1374
|
-
.bp_input_chip_module_container--
|
|
1374
|
+
.bp_input_chip_module_container--482bc.bp_input_chip_module_avatarContainer--482bc{
|
|
1375
1375
|
padding-inline:var(--space-05);
|
|
1376
1376
|
}
|
|
1377
|
-
.bp_input_chip_module_container--
|
|
1377
|
+
.bp_input_chip_module_container--482bc:not(.bp_input_chip_module_avatarContainer--482bc).bp_input_chip_module_deleteButton--482bc{
|
|
1378
|
+
padding-inline:var(--space-1) var(--space-05);
|
|
1379
|
+
}
|
|
1380
|
+
.bp_input_chip_module_container--482bc:not(.bp_input_chip_module_error--482bc):focus{
|
|
1378
1381
|
background-color:var(--surface-inputchip-surface-hover);
|
|
1379
1382
|
box-shadow:0 0 0 var(--border-1) var(--outline-focus-on-dark), 0 0 0 calc(var(--border-2) + var(--border-1)) var(--outline-focus-on-light);
|
|
1380
1383
|
}
|
|
1381
|
-
.bp_input_chip_module_container--
|
|
1384
|
+
.bp_input_chip_module_container--482bc.bp_input_chip_module_error--482bc{
|
|
1382
1385
|
background-color:var(--surface-inputchip-surface-error);
|
|
1383
1386
|
outline:var(--border-1) solid var(--border-inputchip-border-error);
|
|
1384
1387
|
}
|
|
1385
|
-
.bp_input_chip_module_container--
|
|
1388
|
+
.bp_input_chip_module_container--482bc.bp_input_chip_module_error--482bc:focus{
|
|
1386
1389
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-dark), 0 0 0 calc(var(--border-2) + var(--border-2)) var(--outline-focus-on-light);
|
|
1387
1390
|
}
|
|
1388
|
-
.bp_input_chip_module_container--
|
|
1391
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_avatar--482bc{
|
|
1389
1392
|
flex-shrink:0;
|
|
1390
1393
|
}
|
|
1391
|
-
.bp_input_chip_module_container--
|
|
1394
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_label--482bc{
|
|
1392
1395
|
overflow:hidden;
|
|
1393
1396
|
padding-inline:var(--space-2);
|
|
1394
1397
|
text-overflow:ellipsis;
|
|
1395
1398
|
white-space:nowrap;
|
|
1396
1399
|
}
|
|
1397
|
-
.bp_input_chip_module_container--
|
|
1400
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc{
|
|
1398
1401
|
align-items:center;
|
|
1399
1402
|
background:var(--surface-cta-surface-icon);
|
|
1400
1403
|
border-radius:var(--radius-half);
|
|
@@ -1404,19 +1407,19 @@
|
|
|
1404
1407
|
padding-block:var(--space-1);
|
|
1405
1408
|
padding-inline:var(--space-1);
|
|
1406
1409
|
}
|
|
1407
|
-
.bp_input_chip_module_container--
|
|
1410
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc *{
|
|
1408
1411
|
fill:var(--icon-cta-icon);
|
|
1409
1412
|
}
|
|
1410
|
-
.bp_input_chip_module_container--
|
|
1413
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc:hover{
|
|
1411
1414
|
background:var(--surface-cta-surface-icon-hover);
|
|
1412
1415
|
}
|
|
1413
|
-
.bp_input_chip_module_container--
|
|
1416
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc:hover *{
|
|
1414
1417
|
fill:var(--icon-cta-icon-hover);
|
|
1415
1418
|
}
|
|
1416
|
-
.bp_input_chip_module_container--
|
|
1419
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc:active{
|
|
1417
1420
|
background:var(--surface-cta-surface-icon-pressed);
|
|
1418
1421
|
}
|
|
1419
|
-
.bp_input_chip_module_container--
|
|
1422
|
+
.bp_input_chip_module_container--482bc .bp_input_chip_module_deleteIcon--482bc:active *{
|
|
1420
1423
|
fill:var(--icon-cta-icon-pressed);
|
|
1421
1424
|
}
|
|
1422
1425
|
|
|
@@ -1552,7 +1555,7 @@
|
|
|
1552
1555
|
max-width:100%;
|
|
1553
1556
|
}
|
|
1554
1557
|
|
|
1555
|
-
.bp_combobox_module_container--
|
|
1558
|
+
.bp_combobox_module_container--5f513{
|
|
1556
1559
|
display:flex;
|
|
1557
1560
|
flex-direction:column;
|
|
1558
1561
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1563,10 +1566,10 @@
|
|
|
1563
1566
|
text-decoration:none;
|
|
1564
1567
|
text-transform:none;
|
|
1565
1568
|
}
|
|
1566
|
-
.bp_combobox_module_container--
|
|
1569
|
+
.bp_combobox_module_container--5f513.bp_combobox_module_disabled--5f513{
|
|
1567
1570
|
opacity:60%;
|
|
1568
1571
|
}
|
|
1569
|
-
.bp_combobox_module_container--
|
|
1572
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_label--5f513{
|
|
1570
1573
|
color:var(--text-text-on-light);
|
|
1571
1574
|
flex:0 0 fit-content;
|
|
1572
1575
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1578,10 +1581,10 @@
|
|
|
1578
1581
|
text-decoration:none;
|
|
1579
1582
|
text-transform:none;
|
|
1580
1583
|
}
|
|
1581
|
-
.bp_combobox_module_container--
|
|
1584
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_label--5f513:not(.bp_combobox_module_hiddenLabel--5f513){
|
|
1582
1585
|
margin-block-end:var(--space-2);
|
|
1583
1586
|
}
|
|
1584
|
-
.bp_combobox_module_container--
|
|
1587
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513{
|
|
1585
1588
|
background-color:var(--surface-dropdown-surface);
|
|
1586
1589
|
border:var(--border-1) solid var(--border-input-border);
|
|
1587
1590
|
border-radius:var(--blueprint-combobox-input-radius, var(--radius-2));
|
|
@@ -1594,25 +1597,25 @@
|
|
|
1594
1597
|
padding-inline:var(--space-3);
|
|
1595
1598
|
position:relative;
|
|
1596
1599
|
}
|
|
1597
|
-
.bp_combobox_module_container--
|
|
1600
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513.bp_combobox_module_withComboboxButtons--5f513{
|
|
1598
1601
|
padding-inline-end:var(--space-10);
|
|
1599
1602
|
}
|
|
1600
|
-
.bp_combobox_module_container--
|
|
1603
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513:not(.bp_combobox_module_error--5f513):has(input:focus),.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513:not(.bp_combobox_module_error--5f513):has(input[data-focus-visible]:focus){
|
|
1601
1604
|
border-color:#0000;
|
|
1602
1605
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
1603
1606
|
}
|
|
1604
|
-
.bp_combobox_module_container--
|
|
1607
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513:not(:disabled).bp_combobox_module_error--5f513{
|
|
1605
1608
|
background-color:var(--surface-dropdown-surface-error);
|
|
1606
1609
|
border:var(--border-2) solid var(--border-input-border-error);
|
|
1607
1610
|
padding-block:calc((2.5rem - var(--space-5))/2 - var(--border-2));
|
|
1608
1611
|
}
|
|
1609
|
-
.bp_combobox_module_container--
|
|
1612
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513 .bp_combobox_module_textInputWrapper--5f513{
|
|
1610
1613
|
align-items:center;
|
|
1611
1614
|
display:flex;
|
|
1612
1615
|
flex:content;
|
|
1613
1616
|
gap:var(--space-2);
|
|
1614
1617
|
}
|
|
1615
|
-
.bp_combobox_module_container--
|
|
1618
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513 .bp_combobox_module_textInputWrapper--5f513 .bp_combobox_module_textInput--5f513{
|
|
1616
1619
|
background-color:initial;
|
|
1617
1620
|
border:none;
|
|
1618
1621
|
color:var(--text-text-on-light);
|
|
@@ -1628,28 +1631,28 @@
|
|
|
1628
1631
|
text-transform:none;
|
|
1629
1632
|
width:100%;
|
|
1630
1633
|
}
|
|
1631
|
-
.bp_combobox_module_container--
|
|
1634
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513 .bp_combobox_module_textInputWrapper--5f513 .bp_combobox_module_errorIcon--5f513 path{
|
|
1632
1635
|
fill:var(--icon-icon-error-on-light);
|
|
1633
1636
|
}
|
|
1634
|
-
.bp_combobox_module_container--
|
|
1637
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513 .bp_combobox_module_textInputWrapper--5f513 .bp_combobox_module_comboboxButtons--5f513{
|
|
1635
1638
|
align-items:center;
|
|
1636
1639
|
display:flex;
|
|
1637
1640
|
position:absolute;
|
|
1638
1641
|
right:var(--space-2);
|
|
1639
1642
|
top:var(--space-2);
|
|
1640
1643
|
}
|
|
1641
|
-
.bp_combobox_module_container--
|
|
1644
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513.bp_combobox_module_withChips--5f513{
|
|
1642
1645
|
max-height:calc(var(--space-2)*2 + var(--space-6)*3);
|
|
1643
1646
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-1));
|
|
1644
1647
|
}
|
|
1645
|
-
.bp_combobox_module_container--
|
|
1648
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_comboboxContainer--5f513.bp_combobox_module_withChips--5f513:not(:disabled).bp_combobox_module_error--5f513{
|
|
1646
1649
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-2));
|
|
1647
1650
|
}
|
|
1648
|
-
.bp_combobox_module_container--
|
|
1651
|
+
.bp_combobox_module_container--5f513 .bp_combobox_module_inlineError--5f513{
|
|
1649
1652
|
margin-block-start:var(--space-2);
|
|
1650
1653
|
}
|
|
1651
1654
|
|
|
1652
|
-
.bp_combobox_module_popover--
|
|
1655
|
+
.bp_combobox_module_popover--5f513{
|
|
1653
1656
|
background-color:var(--surface-menu-surface);
|
|
1654
1657
|
border:var(--border-1) solid var(--border-card-border);
|
|
1655
1658
|
border-radius:var(--radius-3);
|
|
@@ -1667,7 +1670,7 @@
|
|
|
1667
1670
|
text-transform:none;
|
|
1668
1671
|
z-index:380;
|
|
1669
1672
|
}
|
|
1670
|
-
.bp_combobox_module_popover--
|
|
1673
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513{
|
|
1671
1674
|
border:var(--border-2) solid #0000;
|
|
1672
1675
|
border-radius:var(--radius-3);
|
|
1673
1676
|
box-sizing:border-box;
|
|
@@ -1681,17 +1684,17 @@
|
|
|
1681
1684
|
user-select:none;
|
|
1682
1685
|
width:100%;
|
|
1683
1686
|
}
|
|
1684
|
-
.bp_combobox_module_popover--
|
|
1687
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513[aria-disabled]{
|
|
1685
1688
|
opacity:60%;
|
|
1686
1689
|
}
|
|
1687
|
-
.bp_combobox_module_popover--
|
|
1690
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513[data-active-item]:not([aria-disabled]){
|
|
1688
1691
|
background-color:var(--surface-menu-surface-focus);
|
|
1689
1692
|
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
1690
1693
|
}
|
|
1691
|
-
.bp_combobox_module_popover--
|
|
1694
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513:hover{
|
|
1692
1695
|
background-color:var(--surface-menu-surface-hover);
|
|
1693
1696
|
}
|
|
1694
|
-
.bp_combobox_module_popover--
|
|
1697
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513 .bp_combobox_module_indicator--5f513{
|
|
1695
1698
|
align-items:center;
|
|
1696
1699
|
display:flex;
|
|
1697
1700
|
height:var(--size-9);
|
|
@@ -1700,16 +1703,16 @@
|
|
|
1700
1703
|
position:absolute;
|
|
1701
1704
|
top:0;
|
|
1702
1705
|
}
|
|
1703
|
-
.bp_combobox_module_popover--
|
|
1706
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_option--5f513 .bp_combobox_module_indicator--5f513 .bp_combobox_module_indicatorIcon--5f513 path{
|
|
1704
1707
|
fill:var(--icon-icon-on-light);
|
|
1705
1708
|
}
|
|
1706
|
-
.bp_combobox_module_popover--
|
|
1709
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_optionWithIndicator--5f513{
|
|
1707
1710
|
padding-inline:var(--space-10) var(--space-2);
|
|
1708
1711
|
}
|
|
1709
|
-
.bp_combobox_module_popover--
|
|
1712
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_loadingIndicator--5f513{
|
|
1710
1713
|
position:unset;
|
|
1711
1714
|
}
|
|
1712
|
-
.bp_combobox_module_popover--
|
|
1715
|
+
.bp_combobox_module_popover--5f513 .bp_combobox_module_noResultOption--5f513{
|
|
1713
1716
|
color:var(--text-text-on-light);
|
|
1714
1717
|
-webkit-user-select:none;
|
|
1715
1718
|
user-select:none;
|
|
@@ -5515,11 +5518,11 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5515
5518
|
padding-inline-end:1.875rem;
|
|
5516
5519
|
}
|
|
5517
5520
|
|
|
5518
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5521
|
+
.bp_text_toggle_button_module_textToggleButton--296a4{
|
|
5519
5522
|
background:var(--surface-toggle-surface);
|
|
5520
|
-
border:var(--border-1) solid var(--border-
|
|
5523
|
+
border:var(--border-1) solid var(--border-toggletext-border-off);
|
|
5521
5524
|
border-radius:var(--radius-2);
|
|
5522
|
-
color:var(--text-text
|
|
5525
|
+
color:var(--text-toggletext-text);
|
|
5523
5526
|
cursor:pointer;
|
|
5524
5527
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5525
5528
|
font-size:.875rem;
|
|
@@ -5535,28 +5538,35 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5535
5538
|
user-select:none;
|
|
5536
5539
|
white-space:nowrap;
|
|
5537
5540
|
}
|
|
5538
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5541
|
+
.bp_text_toggle_button_module_textToggleButton--296a4:disabled,.bp_text_toggle_button_module_textToggleButton--296a4[aria-disabled]{
|
|
5539
5542
|
opacity:.3;
|
|
5540
5543
|
pointer-events:none;
|
|
5541
5544
|
}
|
|
5542
|
-
.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]{
|
|
5543
5550
|
box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
|
|
5544
5551
|
}
|
|
5545
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5546
|
-
background:var(--surface-
|
|
5547
|
-
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);
|
|
5548
5555
|
}
|
|
5549
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5550
|
-
background:var(--surface-
|
|
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-
|
|
5554
|
-
border:var(--border-
|
|
5555
|
-
|
|
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);
|
|
5563
|
+
}
|
|
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;
|
|
5556
5566
|
}
|
|
5557
|
-
.bp_text_toggle_button_module_textToggleButton--
|
|
5558
|
-
background:var(--surface-
|
|
5559
|
-
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);
|
|
5560
5570
|
}
|
|
5561
5571
|
:root{
|
|
5562
5572
|
--notification-default-paragraph-indent:0rem;
|
|
@@ -23,7 +23,7 @@ const InputChip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23
23
|
'aria-hidden': 'true'
|
|
24
24
|
}) : null;
|
|
25
25
|
const handleKeyDown = event => {
|
|
26
|
-
if (DELETE_TRIGGER_KEYS.includes(event.code)) {
|
|
26
|
+
if (onDelete && DELETE_TRIGGER_KEYS.includes(event.code)) {
|
|
27
27
|
onDelete();
|
|
28
28
|
}
|
|
29
29
|
buttonProps.onKeyDown?.(event);
|
|
@@ -34,14 +34,16 @@ const InputChip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
34
34
|
...buttonProps,
|
|
35
35
|
ref: ref,
|
|
36
36
|
"aria-invalid": hasError,
|
|
37
|
-
className: clsx(styles.container, hasError && styles.error, avatar && styles.avatarContainer, className),
|
|
37
|
+
className: clsx(styles.container, hasError && styles.error, avatar && styles.avatarContainer, onDelete && styles.deleteButton, className),
|
|
38
38
|
onKeyDown: handleKeyDown,
|
|
39
39
|
type: "button",
|
|
40
40
|
children: [avatar, jsx(Text, {
|
|
41
41
|
as: "span",
|
|
42
42
|
className: styles.label,
|
|
43
43
|
children: label
|
|
44
|
-
}),
|
|
44
|
+
}), onDelete && ( /* Don't use `onClick` handler on icon due to BUIE's "pointer-events: none" style that would cause click event to not trigger */
|
|
45
|
+
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
|
46
|
+
jsx("span", {
|
|
45
47
|
className: styles.deleteIcon,
|
|
46
48
|
onClick: onDelete,
|
|
47
49
|
children: jsx(XMark, {
|
|
@@ -50,7 +52,7 @@ const InputChip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
50
52
|
height: Size4,
|
|
51
53
|
width: Size4
|
|
52
54
|
})
|
|
53
|
-
})]
|
|
55
|
+
}))]
|
|
54
56
|
})
|
|
55
57
|
);
|
|
56
58
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"container":"bp_input_chip_module_container--
|
|
2
|
+
var styles = {"container":"bp_input_chip_module_container--482bc","avatarContainer":"bp_input_chip_module_avatarContainer--482bc","deleteButton":"bp_input_chip_module_deleteButton--482bc","error":"bp_input_chip_module_error--482bc","avatar":"bp_input_chip_module_avatar--482bc","label":"bp_input_chip_module_label--482bc","deleteIcon":"bp_input_chip_module_deleteIcon--482bc"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -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.
|
|
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": {
|