@bigtablet/design-system 3.19.2 → 3.19.3

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -3
  2. package/package.json +7 -6
package/dist/index.js CHANGED
@@ -333,11 +333,14 @@ function useAnchoredPosition({
333
333
  maxWidth: 0,
334
334
  maxHeight: 0,
335
335
  ready: false,
336
- anchorWidth: 0
336
+ anchorWidth: 0,
337
+ anchorHidden: false
337
338
  });
338
339
  useSafeLayoutEffect(() => {
339
340
  if (!open) {
340
- setState((prev) => prev.ready ? { ...prev, ready: false } : prev);
341
+ setState(
342
+ (prev) => prev.ready || prev.anchorHidden ? { ...prev, ready: false, anchorHidden: false } : prev
343
+ );
341
344
  return;
342
345
  }
343
346
  const anchor = anchorRef.current;
@@ -352,10 +355,12 @@ function useAnchoredPosition({
352
355
  { width: window.innerWidth, height: window.innerHeight },
353
356
  { placement, align, gap, padding }
354
357
  );
358
+ const anchorHidden = a.width > 0 && a.height > 0 && (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth);
355
359
  setState({
356
360
  ...result,
357
361
  ready: true,
358
- anchorWidth: Math.min(a.width, result.maxWidth)
362
+ anchorWidth: Math.min(a.width, result.maxWidth),
363
+ anchorHidden
359
364
  });
360
365
  };
361
366
  let frame = 0;
@@ -685,6 +690,12 @@ function useListboxPopup({
685
690
  gap: LIST_GAP,
686
691
  padding: LIST_PADDING
687
692
  });
693
+ useEffect(() => {
694
+ if (!isOpen || !anchored.ready || !anchored.anchorHidden) return;
695
+ const focusInPanel = !!panelRef.current?.contains(document.activeElement);
696
+ setIsOpen(false);
697
+ if (focusInPanel && returnFocusOnClose) triggerRef.current?.focus({ preventScroll: true });
698
+ }, [isOpen, anchored.ready, anchored.anchorHidden, returnFocusOnClose]);
688
699
  return {
689
700
  isOpen,
690
701
  setIsOpen,
@@ -1280,6 +1291,14 @@ var Menu = ({ items, trigger, align = "start" }) => {
1280
1291
  gap: MENU_GAP,
1281
1292
  padding: 8
1282
1293
  });
1294
+ React11.useEffect(() => {
1295
+ if (!open || !pos.ready || !pos.anchorHidden) return;
1296
+ const focusInMenu = !!menuRef.current?.contains(document.activeElement);
1297
+ setOpen(false);
1298
+ if (focusInMenu) {
1299
+ wrapperRef.current?.querySelector("[aria-haspopup]")?.focus({ preventScroll: true });
1300
+ }
1301
+ }, [open, pos.ready, pos.anchorHidden]);
1283
1302
  const style = useSpringPresence({
1284
1303
  visible: open,
1285
1304
  from: pos.placement === "top" ? `translateY(${MENU_GAP}px)` : `translateY(-${MENU_GAP}px)`
@@ -2101,6 +2120,9 @@ var Tooltip = ({
2101
2120
  gap: TOOLTIP_GAP,
2102
2121
  padding: 8
2103
2122
  });
2123
+ React11.useEffect(() => {
2124
+ if (open && pos.ready && pos.anchorHidden) hideNow();
2125
+ }, [open, pos.ready, pos.anchorHidden, hideNow]);
2104
2126
  const fromTransform = (() => {
2105
2127
  switch (pos.placement) {
2106
2128
  case "top":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "3.19.2",
3
+ "version": "3.19.3",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -125,17 +125,18 @@
125
125
  "size-limit": [
126
126
  {
127
127
  "path": "dist/index.js",
128
- "limit": "60 kB",
129
- "message": "Raised 50 kB -> 60 kB on 2026-08-05: baseline was 49.34 kB, leaving 0.66 kB (1.3%) under the old 50 kB limit. The current limit leaves 10.66 kB. Re-measure before raising again."
128
+ "limit": "70 kB",
129
+ "message": "Raised 60 kB -> 70 kB on 2026-09-10: baseline was 59.82 kB on develop (59.91 kB with PR #625), leaving 0.09-0.18 kB (0.3%) under the old 60 kB limit. Of that baseline, 18.48 kB is @react-spring/web (a runtime dependency, so size-limit bundles it) and 40.55 kB is this package - measure `dist/index.js` alone before blaming the dependency. The current limit leaves 10.09 kB. Re-measure before raising again."
130
130
  },
131
131
  {
132
132
  "path": "dist/vanilla/bigtablet.min.js",
133
- "limit": "7 kB",
134
- "message": "Raised 5 kB -> 7 kB on 2026-08-06: Dropdown multiple/searchable pushed the baseline from 4.13 kB to 5.6 kB, 0.6 kB over the old limit. The current limit leaves 1.4 kB. Re-measure before raising again."
133
+ "limit": "8 kB",
134
+ "message": "Raised 7 kB -> 8 kB on 2026-09-10: baseline was 6.83 kB, leaving 0.17 kB (2.4%) under the old 7 kB limit. The current limit leaves 1.17 kB. Re-measure before raising again."
135
135
  },
136
136
  {
137
137
  "path": "dist/index.css",
138
- "limit": "130 kB"
138
+ "limit": "18 kB",
139
+ "message": "Lowered 130 kB -> 18 kB on 2026-09-10: baseline is 14.56 kB brotlied, so the old limit sat 9x above reality and could never fire. The current limit leaves 3.44 kB. Raise it with a measurement, not to make a build pass."
139
140
  }
140
141
  ],
141
142
  "dependencies": {