@overdoser/react-toolkit 0.0.10 → 0.0.11

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/AGENTS.md CHANGED
@@ -113,7 +113,7 @@ Full copy-paste-able files live alongside this doc. Each is one self-contained f
113
113
  - [recipes/interactive-pie-chart.tsx](./recipes/interactive-pie-chart.tsx) — Metric/period filter for `PieChart`: all slices stay visible, the selector picks which metric drives the pie. Three exports: `InteractivePieChartTiles`, `InteractivePieChartNavigator`, `InteractivePieChartDropdown`.
114
114
  - [recipes/trading-chart.tsx](./recipes/trading-chart.tsx) — Full-stack `TradingChart` with a resolution selector, in-memory datafeed adapter, and the SMA/EMA/Bollinger/RSI/Volume indicator stack. Swap `createMemoryDatafeed` for your own REST/WebSocket adapter; everything else carries over.
115
115
  - [recipes/tag-input.tsx](./recipes/tag-input.tsx) — Tag-input pattern via `<Select multiple allowCreate>`: pick from existing tags or type a new one + Enter to create. `onCreate` persists the new tag back into the options list. Wired through `<FormField>` for react-hook-form integration.
116
- - [recipes/multi-select-in-modal.tsx](./recipes/multi-select-in-modal.tsx) — `<Select multiple>` inside `<Modal size="sm">`. Default `portal={true}` lets the menu escape the modal's `overflow: hidden` and sit above the modal via `--crk-z-floating`, so the modal does NOT need to be sized to contain the menu.
116
+ - [recipes/multi-select-in-modal.tsx](./recipes/multi-select-in-modal.tsx) — `<Select multiple>` inside `<Modal size="sm">`. Default `portal={true}` lets the menu escape the modal's `overflow: hidden` and sit above the modal via `--crk-z-floating`, so the modal does NOT need to be sized to contain the menu. Pair with `closeOnBackdrop={false}` so a backdrop click closes the open menu only, not the modal.
117
117
 
118
118
  ## Anti-patterns to refuse
119
119
 
package/index.js CHANGED
@@ -1329,7 +1329,8 @@ const Jt = $e(
1329
1329
  position: "fixed",
1330
1330
  top: q.top + 4,
1331
1331
  left: q.left,
1332
- minWidth: q.width,
1332
+ right: "auto",
1333
+ width: q.width,
1333
1334
  zIndex: "var(--crk-z-floating)"
1334
1335
  } : void 0, y = /* @__PURE__ */ s(
1335
1336
  "div",
@@ -1555,7 +1556,8 @@ const en = $e(
1555
1556
  position: "fixed",
1556
1557
  top: Y.top + 4,
1557
1558
  left: Y.left,
1558
- minWidth: Y.width,
1559
+ right: "auto",
1560
+ width: Y.width,
1559
1561
  zIndex: "var(--crk-z-floating)"
1560
1562
  } : void 0, D = /* @__PURE__ */ s(
1561
1563
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overdoser/react-toolkit",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -21,6 +21,12 @@ const TAGS = [
21
21
  * does NOT need to be sized large enough** to contain the menu. The menu
22
22
  * uses `--crk-z-floating` (1060) which sits above `--crk-z-modal` (1050).
23
23
  *
24
+ * Pair this pattern with `closeOnBackdrop={false}`: clicking the modal
25
+ * backdrop while the menu is open is "outside" the menu (closes the menu)
26
+ * AND on the backdrop (would close the modal too). Disabling backdrop
27
+ * dismissal scopes the click to closing only the menu — users dismiss the
28
+ * modal explicitly via Cancel/Save/×.
29
+ *
24
30
  * If you have a reason to keep the menu inside the modal subtree (e.g.,
25
31
  * parent-scoped CSS theming), pass `portal={false}` and size the modal
26
32
  * generously.
@@ -32,7 +38,7 @@ export function MultiSelectInModalRecipe() {
32
38
  return (
33
39
  <>
34
40
  <Button onClick={() => setOpen(true)}>Edit tags</Button>
35
- <Modal open={open} onClose={() => setOpen(false)} size="sm">
41
+ <Modal open={open} onClose={() => setOpen(false)} size="sm" closeOnBackdrop={false}>
36
42
  <Modal.Header onClose={() => setOpen(false)}>Tags</Modal.Header>
37
43
  <Modal.Body>
38
44
  <label style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>