@overdoser/react-toolkit 0.0.8 → 0.0.9

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
@@ -112,6 +112,7 @@ Full copy-paste-able files live alongside this doc. Each is one self-contained f
112
112
  - [recipes/interactive-area-chart.tsx](./recipes/interactive-area-chart.tsx) — Data-range filter (not series toggle): all series stay visible, the selector picks the time window. Three selector UIs exported: `InteractiveAreaChartTiles`, `InteractiveAreaChartNavigator`, `InteractiveAreaChartDropdown`.
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
+ - [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.
115
116
 
116
117
  ## Anti-patterns to refuse
117
118
 
@@ -46,6 +46,24 @@ export interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, 'onCh
46
46
  onValuesChange?: (values: string[]) => void;
47
47
  /** Clear the search query after each toggle in multi mode. @default true */
48
48
  clearSearchOnSelect?: boolean;
49
+ /**
50
+ * Multi-mode only. When `true`, an extra "Create '<query>'" row appears
51
+ * in the menu whenever the search query doesn't match an existing option.
52
+ * Pressing Enter (or clicking the row) adds the trimmed query as a new
53
+ * selected value and fires `onCreate`. @default false
54
+ */
55
+ allowCreate?: boolean;
56
+ /**
57
+ * Multi-mode only. Called with the newly-created value when `allowCreate`
58
+ * is true and the user creates a new tag. Consumers typically persist the
59
+ * new value (e.g. push it into their options list).
60
+ */
61
+ onCreate?: (value: string) => void;
62
+ /**
63
+ * Multi-mode only. Custom render function for the "Create" row body.
64
+ * @default (q) => `Create "${q}"`
65
+ */
66
+ createLabel?: (query: string) => React.ReactNode;
49
67
  }
50
68
  /**
51
69
  * Three internal modes, picked automatically: