@sproutsocial/seeds-react-menu 1.11.3 → 1.11.5

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.
@@ -9,27 +9,27 @@ $ tsup --dts
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  CJS dist/index.js 92.62 KB
12
- CJS dist/v3/index.js 92.22 KB
13
12
  CJS dist/v2/index.js 73.18 KB
13
+ CJS dist/v3/index.js 93.61 KB
14
14
  CJS dist/index.js.map 180.20 KB
15
- CJS dist/v3/index.js.map 158.32 KB
16
15
  CJS dist/v2/index.js.map 152.19 KB
17
- CJS ⚡️ Build success in 94ms
16
+ CJS dist/v3/index.js.map 161.54 KB
17
+ CJS ⚡️ Build success in 72ms
18
+ ESM dist/esm/v2/index.js 62.63 KB
18
19
  ESM dist/esm/index.js 73.57 KB
19
20
  ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
20
- ESM dist/esm/v2/index.js 62.63 KB
21
- ESM dist/esm/v3/index.js 81.09 KB
21
+ ESM dist/esm/v3/index.js 82.46 KB
22
+ ESM dist/esm/v2/index.js.map 132.57 KB
22
23
  ESM dist/esm/index.js.map 156.22 KB
23
24
  ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
24
- ESM dist/esm/v2/index.js.map 132.57 KB
25
- ESM dist/esm/v3/index.js.map 158.35 KB
26
- ESM ⚡️ Build success in 94ms
25
+ ESM dist/esm/v3/index.js.map 161.58 KB
26
+ ESM ⚡️ Build success in 74ms
27
27
  DTS Build start
28
- DTS ⚡️ Build success in 6872ms
28
+ DTS ⚡️ Build success in 7371ms
29
29
  DTS dist/index.d.ts 39.08 KB
30
30
  DTS dist/v2/index.d.ts 5.55 KB
31
31
  DTS dist/v3/index.d.ts 17.65 KB
32
32
  DTS dist/index.d.mts 39.08 KB
33
33
  DTS dist/v2/index.d.mts 5.55 KB
34
34
  DTS dist/v3/index.d.mts 17.65 KB
35
- Done in 7.67s.
35
+ Done in 8.16s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.11.5
4
+
5
+ ### Patch Changes
6
+
7
+ - @sproutsocial/seeds-react-icon@2.3.4
8
+ - @sproutsocial/seeds-react-button@2.0.2
9
+ - @sproutsocial/seeds-react-checkbox@1.3.30
10
+ - @sproutsocial/seeds-react-input@1.5.13
11
+ - @sproutsocial/seeds-react-switch@1.2.29
12
+ - @sproutsocial/seeds-react-token-input@1.4.35
13
+ - @sproutsocial/seeds-react-popout@2.4.35
14
+
15
+ ## 1.11.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 1094671: ADd placeholder for single searchable select
20
+
3
21
  ## 1.11.3
4
22
 
5
23
  ### Patch Changes
@@ -140,6 +140,7 @@ var Field = styled2.div`
140
140
  display: flex;
141
141
  flex-direction: column;
142
142
  gap: ${({ theme }) => theme.space[200]};
143
+ width: 100%;
143
144
  `;
144
145
  var SelectLabel = styled2(Select2.Label)`
145
146
  font-size: ${({ theme }) => theme.typography[200].fontSize};
@@ -1078,6 +1079,16 @@ var ComboboxItem_default = ComboboxItem2;
1078
1079
  import * as React7 from "react";
1079
1080
  import { Combobox as Combobox2 } from "@base-ui/react/combobox";
1080
1081
  import { useVirtualizer } from "@tanstack/react-virtual";
1082
+
1083
+ // src/v3/Common/sentinels.ts
1084
+ function makePlaceholderSentinel(label) {
1085
+ return { __placeholder: true, label };
1086
+ }
1087
+ function isPlaceholderSentinel(v) {
1088
+ return typeof v === "object" && v !== null && "__placeholder" in v;
1089
+ }
1090
+
1091
+ // src/v3/Common/VirtualizedComboboxList.tsx
1081
1092
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1082
1093
  var ITEM_HEIGHT = 32;
1083
1094
  function isGroupHeaderSentinel(v) {
@@ -1139,7 +1150,7 @@ function VirtualizedComboboxList({
1139
1150
  style: { position: "relative", width: "100%", height: totalSize },
1140
1151
  children: virtualizer.getVirtualItems().map((virtualItem) => {
1141
1152
  const row = filteredItems[virtualItem.index];
1142
- if (!row) return null;
1153
+ if (row == null) return null;
1143
1154
  const baseStyle = {
1144
1155
  position: "absolute",
1145
1156
  top: 0,
@@ -1148,6 +1159,22 @@ function VirtualizedComboboxList({
1148
1159
  transform: `translateY(${virtualItem.start}px)`,
1149
1160
  boxSizing: "border-box"
1150
1161
  };
1162
+ if (isPlaceholderSentinel(row)) {
1163
+ return /* @__PURE__ */ jsx7(
1164
+ ComboboxItem_default,
1165
+ {
1166
+ index: virtualItem.index,
1167
+ "data-index": virtualItem.index,
1168
+ value: row,
1169
+ itemId: "placeholder",
1170
+ label: row.label,
1171
+ inputType,
1172
+ style: baseStyle,
1173
+ ref: virtualizer.measureElement
1174
+ },
1175
+ "placeholder"
1176
+ );
1177
+ }
1151
1178
  if (isSelectAllSentinel(row)) {
1152
1179
  const selectedCount = selectedArray.length;
1153
1180
  const totalCount = data.length;
@@ -1206,6 +1233,7 @@ function VirtualizedComboboxList({
1206
1233
  value: item,
1207
1234
  itemId: String(item.id),
1208
1235
  label: itemToString(item),
1236
+ disabled: item.disabled,
1209
1237
  inputType,
1210
1238
  renderItem: renderItem ? () => renderItem(item) : () => itemToString(item),
1211
1239
  style: baseStyle,
@@ -1733,9 +1761,10 @@ function SingleSearchableSelect(props) {
1733
1761
  );
1734
1762
  const value = isControlled ? idToItem(selectedItemId) : internalValue;
1735
1763
  function handleValueChange(newItem) {
1736
- if (!isControlled) setInternalValue(newItem);
1764
+ const realItem = newItem == null || isPlaceholderSentinel(newItem) ? null : newItem;
1765
+ if (!isControlled) setInternalValue(realItem);
1737
1766
  if (onSelectedItemIdChange) {
1738
- onSelectedItemIdChange(newItem ? newItem.id : null);
1767
+ onSelectedItemIdChange(realItem ? realItem.id : null);
1739
1768
  }
1740
1769
  }
1741
1770
  const groups = React10.useMemo(
@@ -1751,9 +1780,14 @@ function SingleSearchableSelect(props) {
1751
1780
  value,
1752
1781
  disabled: props.disabled,
1753
1782
  onValueChange: handleValueChange,
1754
- itemToStringLabel: itemToString,
1755
- isItemEqualToValue: (a, b) => a != null && b != null && a.id === b.id,
1756
- items: isVirtualized ? data : groups ?? (isChildrenMode ? void 0 : data),
1783
+ itemToStringLabel: (item) => isPlaceholderSentinel(item) ? item.label : itemToString(item),
1784
+ isItemEqualToValue: (a, b) => {
1785
+ if (isPlaceholderSentinel(a) && isPlaceholderSentinel(b)) return true;
1786
+ if (isPlaceholderSentinel(a)) return b == null;
1787
+ if (isPlaceholderSentinel(b)) return a == null;
1788
+ return a != null && b != null && a.id === b.id;
1789
+ },
1790
+ items: isVirtualized ? includePlaceholderItem ? [makePlaceholderSentinel(placeholder), ...data] : data : groups ?? (isChildrenMode ? void 0 : data),
1757
1791
  virtualized: isVirtualized,
1758
1792
  open,
1759
1793
  onOpenChange: setOpen,
@@ -1772,7 +1806,7 @@ function SingleSearchableSelect(props) {
1772
1806
  } : void 0,
1773
1807
  children: [
1774
1808
  /* @__PURE__ */ jsxs8(SearchableSelectTrigger, { id, children: [
1775
- /* @__PURE__ */ jsx10(SearchableSelectPlaceholder, { children: /* @__PURE__ */ jsx10(Combobox5.Value, { placeholder, children: value ? renderSelection ? renderSelection(value) : itemToString(value) : null }) }),
1809
+ /* @__PURE__ */ jsx10(SearchableSelectPlaceholder, { children: /* @__PURE__ */ jsx10(Combobox5.Value, { placeholder, children: value ? renderSelection ? renderSelection(value) : itemToString(value) : placeholder }) }),
1776
1810
  /* @__PURE__ */ jsx10(SearchableSelectTriggerIcon, { children: /* @__PURE__ */ jsx10(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ jsx10(ChevronIcon, {}) }) })
1777
1811
  ] }),
1778
1812
  /* @__PURE__ */ jsx10(Combobox5.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx10(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ jsxs8(
@@ -1833,9 +1867,10 @@ function SingleSearchableSelect(props) {
1833
1867
  includePlaceholderItem && /* @__PURE__ */ jsx10(
1834
1868
  ComboboxItem_default,
1835
1869
  {
1836
- value: null,
1870
+ value: makePlaceholderSentinel(placeholder),
1837
1871
  itemId: "placeholder",
1838
- label: placeholder
1872
+ label: placeholder,
1873
+ inputType
1839
1874
  },
1840
1875
  "placeholder"
1841
1876
  ),