@sproutsocial/seeds-react-menu 1.15.10 → 1.16.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/.turbo/turbo-build.log +12 -12
- package/CHANGELOG.md +23 -0
- package/dist/esm/v3/index.js +29 -10
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/v3/index.d.mts +2 -0
- package/dist/v3/index.d.ts +2 -0
- package/dist/v3/index.js +29 -10
- package/dist/v3/index.js.map +1 -1
- package/package.json +13 -13
- package/src/v3/Common/ComboboxStyles.tsx +6 -0
- package/src/v3/Common/VirtualizedComboboxList.tsx +3 -0
- package/src/v3/MultiCombobox.stories.tsx +22 -0
- package/src/v3/MultiCombobox.tsx +12 -1
- package/src/v3/__tests__/MultiCombobox.test.tsx +91 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -9,27 +9,27 @@ $ tsup --dts
|
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[32mCJS[39m [1mdist/index.js [22m[32m92.65 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/v3/index.js [22m[
|
|
12
|
+
[32mCJS[39m [1mdist/v3/index.js [22m[32m121.28 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/v2/index.js [22m[32m73.18 KB[39m
|
|
14
14
|
[32mCJS[39m [1mdist/index.js.map [22m[32m180.28 KB[39m
|
|
15
|
-
[32mCJS[39m [1mdist/v3/index.js.map [22m[
|
|
15
|
+
[32mCJS[39m [1mdist/v3/index.js.map [22m[32m212.15 KB[39m
|
|
16
16
|
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m152.19 KB[39m
|
|
17
|
-
[32mCJS[39m ⚡️ Build success in
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 112ms
|
|
18
18
|
[32mESM[39m [1mdist/esm/index.js [22m[32m73.60 KB[39m
|
|
19
|
-
[32mESM[39m [1mdist/esm/v3/index.js [22m[32m107.25 KB[39m
|
|
20
|
-
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
21
19
|
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m62.63 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
21
|
+
[32mESM[39m [1mdist/esm/v3/index.js [22m[32m107.78 KB[39m
|
|
22
22
|
[32mESM[39m [1mdist/esm/index.js.map [22m[32m156.29 KB[39m
|
|
23
|
-
[32mESM[39m [1mdist/esm/v3/index.js.map [22m[32m211.30 KB[39m
|
|
24
|
-
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js.map [22m[32m22.93 KB[39m
|
|
25
23
|
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m132.57 KB[39m
|
|
26
|
-
[32mESM[39m
|
|
24
|
+
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js.map [22m[32m22.93 KB[39m
|
|
25
|
+
[32mESM[39m [1mdist/esm/v3/index.js.map [22m[32m212.20 KB[39m
|
|
26
|
+
[32mESM[39m ⚡️ Build success in 111ms
|
|
27
27
|
[34mDTS[39m Build start
|
|
28
|
-
[32mDTS[39m ⚡️ Build success in
|
|
28
|
+
[32mDTS[39m ⚡️ Build success in 7496ms
|
|
29
29
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.12 KB[39m
|
|
30
30
|
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.55 KB[39m
|
|
31
|
-
[32mDTS[39m [1mdist/v3/index.d.ts [22m[32m23.
|
|
31
|
+
[32mDTS[39m [1mdist/v3/index.d.ts [22m[32m23.92 KB[39m
|
|
32
32
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m39.12 KB[39m
|
|
33
33
|
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.55 KB[39m
|
|
34
|
-
[32mDTS[39m [1mdist/v3/index.d.mts [22m[32m23.
|
|
35
|
-
Done in
|
|
34
|
+
[32mDTS[39m [1mdist/v3/index.d.mts [22m[32m23.92 KB[39m
|
|
35
|
+
Done in 8.30s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 1.16.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [a13a571]
|
|
8
|
+
- @sproutsocial/seeds-react-theme@4.1.1
|
|
9
|
+
- @sproutsocial/seeds-react-box@1.1.22
|
|
10
|
+
- @sproutsocial/seeds-react-icon@2.4.1
|
|
11
|
+
- @sproutsocial/seeds-react-label@1.0.23
|
|
12
|
+
- @sproutsocial/seeds-react-token-input@1.4.49
|
|
13
|
+
- @sproutsocial/seeds-react-checkbox@1.3.42
|
|
14
|
+
- @sproutsocial/seeds-react-input@1.5.27
|
|
15
|
+
- @sproutsocial/seeds-react-popout@2.5.10
|
|
16
|
+
- @sproutsocial/seeds-react-button@2.2.2
|
|
17
|
+
- @sproutsocial/seeds-react-switch@1.2.40
|
|
18
|
+
- @sproutsocial/seeds-react-radio@1.3.23
|
|
19
|
+
|
|
20
|
+
## 1.16.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- a6c9ca5: Add isGroupHeaderDisabled optional prop
|
|
25
|
+
|
|
3
26
|
## 1.15.10
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -857,6 +857,12 @@ var ComboboxGroupHeaderItem = styled6(Combobox.Item)`
|
|
|
857
857
|
background: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
858
858
|
color: ${({ theme }) => theme.colors.text.body};
|
|
859
859
|
}
|
|
860
|
+
|
|
861
|
+
&[data-disabled] {
|
|
862
|
+
opacity: 0.4;
|
|
863
|
+
cursor: not-allowed;
|
|
864
|
+
pointer-events: none;
|
|
865
|
+
}
|
|
860
866
|
`;
|
|
861
867
|
var ComboboxSelectAllItem = styled6(Combobox.Item)`
|
|
862
868
|
display: flex;
|
|
@@ -1183,6 +1189,7 @@ function VirtualizedComboboxList({
|
|
|
1183
1189
|
inputType,
|
|
1184
1190
|
renderItem,
|
|
1185
1191
|
renderGroupHeading,
|
|
1192
|
+
isGroupHeaderDisabled,
|
|
1186
1193
|
renderCreatableItem
|
|
1187
1194
|
}) {
|
|
1188
1195
|
const filteredItems = Combobox2.useFilteredItems();
|
|
@@ -1285,6 +1292,7 @@ function VirtualizedComboboxList({
|
|
|
1285
1292
|
index: virtualItem.index,
|
|
1286
1293
|
"data-index": virtualItem.index,
|
|
1287
1294
|
value: row,
|
|
1295
|
+
disabled: isGroupHeaderDisabled?.(row.groupName),
|
|
1288
1296
|
style: baseStyle,
|
|
1289
1297
|
ref: virtualizer.measureElement,
|
|
1290
1298
|
children: [
|
|
@@ -1551,6 +1559,7 @@ function MultiCombobox(props) {
|
|
|
1551
1559
|
const inputType = isChildrenMode ? "checkbox" : removeSelectedItems ? "none" : props.inputType ?? "checkbox";
|
|
1552
1560
|
const groupBy = isChildrenMode ? void 0 : props.groupBy;
|
|
1553
1561
|
const renderGroupHeading = isChildrenMode ? void 0 : props.renderGroupHeading;
|
|
1562
|
+
const isGroupHeaderDisabled = isChildrenMode ? void 0 : props.isGroupHeaderDisabled;
|
|
1554
1563
|
const selectHeadings = isChildrenMode ? false : props.selectHeadings ?? false;
|
|
1555
1564
|
const selectAllProp = isChildrenMode ? false : props.selectAll ?? false;
|
|
1556
1565
|
const selectAll = Boolean(selectAllProp);
|
|
@@ -1649,6 +1658,7 @@ function MultiCombobox(props) {
|
|
|
1649
1658
|
}
|
|
1650
1659
|
let updated = [...realItems];
|
|
1651
1660
|
for (const sentinel of groupSentinels) {
|
|
1661
|
+
if (isGroupHeaderDisabled?.(sentinel.groupName)) continue;
|
|
1652
1662
|
const group = groups?.find((g) => g.value === sentinel.groupName);
|
|
1653
1663
|
if (!group) continue;
|
|
1654
1664
|
const allSelected = group.items.every(
|
|
@@ -1703,16 +1713,24 @@ function MultiCombobox(props) {
|
|
|
1703
1713
|
(item2) => value.some((s) => s.id === item2.id)
|
|
1704
1714
|
).length;
|
|
1705
1715
|
const state = selectedCount === 0 ? "none" : selectedCount === groupItemsList.length ? "all" : "partial";
|
|
1706
|
-
return /* @__PURE__ */ jsxs7(
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
+
return /* @__PURE__ */ jsxs7(
|
|
1717
|
+
ComboboxGroupHeaderItem,
|
|
1718
|
+
{
|
|
1719
|
+
value: row,
|
|
1720
|
+
disabled: isGroupHeaderDisabled?.(row.groupName),
|
|
1721
|
+
children: [
|
|
1722
|
+
/* @__PURE__ */ jsx9(
|
|
1723
|
+
ComboboxGroupHeaderCheckbox,
|
|
1724
|
+
{
|
|
1725
|
+
$state: state,
|
|
1726
|
+
id: `__header-${row.groupName}`
|
|
1727
|
+
}
|
|
1728
|
+
),
|
|
1729
|
+
renderGroupHeading ? renderGroupHeading(row.groupName) : row.groupName
|
|
1730
|
+
]
|
|
1731
|
+
},
|
|
1732
|
+
`__header-${row.groupName}`
|
|
1733
|
+
);
|
|
1716
1734
|
}
|
|
1717
1735
|
if (isCreatableSentinel(row)) {
|
|
1718
1736
|
return renderCreatableItem(row);
|
|
@@ -1908,6 +1926,7 @@ function MultiCombobox(props) {
|
|
|
1908
1926
|
inputType,
|
|
1909
1927
|
renderItem,
|
|
1910
1928
|
renderGroupHeading,
|
|
1929
|
+
isGroupHeaderDisabled,
|
|
1911
1930
|
renderCreatableItem: creatableProp ? (sentinel, style, index, measureRef) => renderCreatableItem(
|
|
1912
1931
|
sentinel,
|
|
1913
1932
|
style,
|