@jsudc/react 0.1.1 → 0.2.0

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 (262) hide show
  1. package/README.md +400 -73
  2. package/dist/all.d.ts +9 -0
  3. package/dist/all.js +14 -0
  4. package/dist/all.js.map +1 -0
  5. package/dist/calendar/CalendarRenderer.d.ts +1 -3
  6. package/dist/calendar/CalendarRenderer.js +17 -46
  7. package/dist/calendar/CalendarRenderer.js.map +1 -1
  8. package/dist/calendar/EventBlock.d.ts +1 -1
  9. package/dist/calendar/EventBlock.js +6 -6
  10. package/dist/calendar/EventBlock.js.map +1 -1
  11. package/dist/calendar/EventDetail.d.ts +1 -1
  12. package/dist/calendar/EventDetail.js +19 -19
  13. package/dist/calendar/EventDetail.js.map +1 -1
  14. package/dist/calendar/MonthGrid.d.ts +2 -2
  15. package/dist/calendar/MonthGrid.js +15 -14
  16. package/dist/calendar/MonthGrid.js.map +1 -1
  17. package/dist/calendar/TimeGrid.d.ts +2 -2
  18. package/dist/calendar/TimeGrid.js +27 -26
  19. package/dist/calendar/TimeGrid.js.map +1 -1
  20. package/dist/calendar/index.d.ts +4 -0
  21. package/dist/calendar/model.d.ts +1 -1
  22. package/dist/calendar/model.js.map +1 -1
  23. package/dist/calendar/useCalendarUrl.d.ts +13 -0
  24. package/dist/calendar/useCalendarUrl.js +35 -0
  25. package/dist/calendar/useCalendarUrl.js.map +1 -0
  26. package/dist/calendar.d.ts +1 -0
  27. package/dist/calendar.js +22 -0
  28. package/dist/calendar.js.map +1 -0
  29. package/dist/cards/CardRenderer.d.ts +3 -3
  30. package/dist/cards/CardRenderer.js +59 -56
  31. package/dist/cards/CardRenderer.js.map +1 -1
  32. package/dist/cards/index.d.ts +4 -0
  33. package/dist/cards.d.ts +1 -0
  34. package/dist/cards.js +15 -0
  35. package/dist/cards.js.map +1 -0
  36. package/dist/chart/ChartRenderer.d.ts +1 -1
  37. package/dist/chart/ChartRenderer.js +33 -31
  38. package/dist/chart/ChartRenderer.js.map +1 -1
  39. package/dist/chart/ChartWindowControl.d.ts +2 -2
  40. package/dist/chart/ChartWindowControl.js +17 -13
  41. package/dist/chart/ChartWindowControl.js.map +1 -1
  42. package/dist/chart/index.d.ts +7 -0
  43. package/dist/chart/model.js +7 -2
  44. package/dist/chart/model.js.map +1 -1
  45. package/dist/chart/useChartWindow.d.ts +1 -1
  46. package/dist/chart/useChartWindow.js +2 -2
  47. package/dist/chart/useChartWindow.js.map +1 -1
  48. package/dist/chart/window.d.ts +1 -1
  49. package/dist/chart/window.js +4 -1
  50. package/dist/chart/window.js.map +1 -1
  51. package/dist/chart.d.ts +1 -0
  52. package/dist/chart.js +18 -0
  53. package/dist/chart.js.map +1 -0
  54. package/dist/components/ui/button.d.ts +9 -9
  55. package/dist/components/ui/button.js +11 -11
  56. package/dist/components/ui/button.js.map +1 -1
  57. package/dist/components/ui/checkbox.js +5 -5
  58. package/dist/components/ui/checkbox.js.map +1 -1
  59. package/dist/components/ui/dialog.d.ts +1 -1
  60. package/dist/components/ui/dialog.js +12 -12
  61. package/dist/components/ui/dialog.js.map +1 -1
  62. package/dist/components/ui/dropdown-menu.js +5 -5
  63. package/dist/components/ui/dropdown-menu.js.map +1 -1
  64. package/dist/components/ui/input.js +2 -2
  65. package/dist/components/ui/input.js.map +1 -1
  66. package/dist/components/ui/misc.js +3 -3
  67. package/dist/components/ui/misc.js.map +1 -1
  68. package/dist/components/ui/popover.js +2 -2
  69. package/dist/components/ui/popover.js.map +1 -1
  70. package/dist/components/ui/segmented.d.ts +2 -9
  71. package/dist/components/ui/segmented.js +4 -4
  72. package/dist/components/ui/segmented.js.map +1 -1
  73. package/dist/components/ui/select.d.ts +2 -4
  74. package/dist/components/ui/select.js +10 -10
  75. package/dist/components/ui/select.js.map +1 -1
  76. package/dist/components/ui/toast.d.ts +2 -6
  77. package/dist/components/ui/toast.js +14 -14
  78. package/dist/components/ui/toast.js.map +1 -1
  79. package/dist/components/ui/tooltip.js +2 -2
  80. package/dist/components/ui/tooltip.js.map +1 -1
  81. package/dist/data-view/DocTab.js +2 -2
  82. package/dist/data-view/DocTab.js.map +1 -1
  83. package/dist/data-view/FilePreview.js +9 -9
  84. package/dist/data-view/FilePreview.js.map +1 -1
  85. package/dist/data-view/FilterBuilder.js +30 -31
  86. package/dist/data-view/FilterBuilder.js.map +1 -1
  87. package/dist/data-view/FilterChips.d.ts +1 -1
  88. package/dist/data-view/FilterChips.js +30 -29
  89. package/dist/data-view/FilterChips.js.map +1 -1
  90. package/dist/data-view/FolderBar.js +8 -8
  91. package/dist/data-view/FolderBar.js.map +1 -1
  92. package/dist/data-view/FolderEntry.d.ts +1 -1
  93. package/dist/data-view/FolderEntry.js +4 -4
  94. package/dist/data-view/FolderEntry.js.map +1 -1
  95. package/dist/data-view/Freshness.js +9 -8
  96. package/dist/data-view/Freshness.js.map +1 -1
  97. package/dist/data-view/SearchBox.js +9 -9
  98. package/dist/data-view/SearchBox.js.map +1 -1
  99. package/dist/data-view/SourceTab.js +26 -25
  100. package/dist/data-view/SourceTab.js.map +1 -1
  101. package/dist/data-view/UdcDataView.d.ts +6 -2
  102. package/dist/data-view/UdcDataView.js +36 -37
  103. package/dist/data-view/UdcDataView.js.map +1 -1
  104. package/dist/data-view/compose.d.ts +1 -1
  105. package/dist/data-view/compose.js.map +1 -1
  106. package/dist/data-view/urlState.d.ts +1 -1
  107. package/dist/data-view/urlState.js.map +1 -1
  108. package/dist/data-view/useDataViewState.d.ts +5 -2
  109. package/dist/data-view/useDataViewState.js +15 -5
  110. package/dist/data-view/useDataViewState.js.map +1 -1
  111. package/dist/headless.d.ts +31 -0
  112. package/dist/headless.js +31 -0
  113. package/dist/i18n/i18n.d.ts +1 -1
  114. package/dist/i18n/i18n.js +1 -1
  115. package/dist/i18n/i18n.js.map +1 -1
  116. package/dist/i18n/translations.js +8 -0
  117. package/dist/i18n/translations.js.map +1 -1
  118. package/dist/icons/resolve.js.map +1 -1
  119. package/dist/index.d.ts +19 -27
  120. package/dist/index.js +11 -16
  121. package/dist/kanban/CardDetailDialog.js +8 -7
  122. package/dist/kanban/CardDetailDialog.js.map +1 -1
  123. package/dist/kanban/KanbanBoardSwitcher.js +4 -4
  124. package/dist/kanban/KanbanBoardSwitcher.js.map +1 -1
  125. package/dist/kanban/KanbanCard.js +46 -45
  126. package/dist/kanban/KanbanCard.js.map +1 -1
  127. package/dist/kanban/KanbanColumn.d.ts +1 -1
  128. package/dist/kanban/KanbanColumn.js +22 -21
  129. package/dist/kanban/KanbanColumn.js.map +1 -1
  130. package/dist/kanban/KanbanRenderer.d.ts +1 -1
  131. package/dist/kanban/KanbanRenderer.js +14 -14
  132. package/dist/kanban/KanbanRenderer.js.map +1 -1
  133. package/dist/kanban/index.d.ts +5 -0
  134. package/dist/kanban/persist.d.ts +2 -2
  135. package/dist/kanban/persist.js.map +1 -1
  136. package/dist/kanban/useKanbanBoard.js +2 -2
  137. package/dist/kanban/useKanbanBoard.js.map +1 -1
  138. package/dist/kanban.d.ts +1 -0
  139. package/dist/kanban.js +17 -0
  140. package/dist/kanban.js.map +1 -0
  141. package/dist/lib/storage.d.ts +7 -0
  142. package/dist/lib/storage.js +24 -0
  143. package/dist/lib/storage.js.map +1 -0
  144. package/dist/lib/theme.js +1 -1
  145. package/dist/lib/theme.js.map +1 -1
  146. package/dist/lib/utils.d.ts +2 -7
  147. package/dist/lib/utils.js +4 -21
  148. package/dist/lib/utils.js.map +1 -1
  149. package/dist/map/MapRenderer.d.ts +1 -1
  150. package/dist/map/MapRenderer.js +19 -19
  151. package/dist/map/MapRenderer.js.map +1 -1
  152. package/dist/map/index.d.ts +4 -0
  153. package/dist/map/model.js +4 -1
  154. package/dist/map/model.js.map +1 -1
  155. package/dist/map.d.ts +1 -0
  156. package/dist/map.js +15 -0
  157. package/dist/map.js.map +1 -0
  158. package/dist/react-router/UdcReactRouterUrlState.d.ts +10 -0
  159. package/dist/react-router/UdcReactRouterUrlState.js +35 -0
  160. package/dist/react-router/UdcReactRouterUrlState.js.map +1 -0
  161. package/dist/react-router/index.d.ts +1 -0
  162. package/dist/react-router.d.ts +1 -0
  163. package/dist/react-router.js +1 -0
  164. package/dist/renderers/AllRowsStatus.d.ts +1 -1
  165. package/dist/renderers/AllRowsStatus.js +5 -5
  166. package/dist/renderers/AllRowsStatus.js.map +1 -1
  167. package/dist/renderers/context.d.ts +11 -0
  168. package/dist/renderers/context.js +15 -0
  169. package/dist/renderers/context.js.map +1 -0
  170. package/dist/renderers/registry.d.ts +16 -12
  171. package/dist/renderers/registry.js +24 -87
  172. package/dist/renderers/registry.js.map +1 -1
  173. package/dist/renderers/types.d.ts +11 -4
  174. package/dist/renderers/types.js.map +1 -1
  175. package/dist/schema-editor/ColumnHeaderMenu.d.ts +1 -1
  176. package/dist/schema-editor/ColumnHeaderMenu.js +6 -5
  177. package/dist/schema-editor/ColumnHeaderMenu.js.map +1 -1
  178. package/dist/schema-editor/DeleteFieldDialog.js +13 -13
  179. package/dist/schema-editor/DeleteFieldDialog.js.map +1 -1
  180. package/dist/schema-editor/FieldFormDialog.js +32 -33
  181. package/dist/schema-editor/FieldFormDialog.js.map +1 -1
  182. package/dist/schema-editor/TagInput.js +6 -6
  183. package/dist/schema-editor/TagInput.js.map +1 -1
  184. package/dist/schema-editor/fieldForm.js +2 -1
  185. package/dist/schema-editor/fieldForm.js.map +1 -1
  186. package/dist/schema-editor/index.d.ts +6 -0
  187. package/dist/schema-editor/useSchemaEditor.d.ts +1 -1
  188. package/dist/schema-editor/useSchemaEditor.js +2 -2
  189. package/dist/schema-editor/useSchemaEditor.js.map +1 -1
  190. package/dist/schema-editor.d.ts +1 -0
  191. package/dist/schema-editor.js +7 -0
  192. package/dist/styles.css +1 -1
  193. package/dist/table/CellEditor.js +10 -9
  194. package/dist/table/CellEditor.js.map +1 -1
  195. package/dist/table/Pager.js +10 -10
  196. package/dist/table/Pager.js.map +1 -1
  197. package/dist/table/TableRenderer.d.ts +4 -4
  198. package/dist/table/TableRenderer.js +40 -40
  199. package/dist/table/TableRenderer.js.map +1 -1
  200. package/dist/table/cells.d.ts +2 -24
  201. package/dist/table/cells.js +20 -132
  202. package/dist/table/cells.js.map +1 -1
  203. package/dist/table/format.d.ts +24 -0
  204. package/dist/table/format.js +117 -0
  205. package/dist/table/format.js.map +1 -0
  206. package/dist/table/index.d.ts +6 -0
  207. package/dist/table/sparkline.js +6 -6
  208. package/dist/table/sparkline.js.map +1 -1
  209. package/dist/table/states.d.ts +7 -0
  210. package/dist/table/states.js +28 -13
  211. package/dist/table/states.js.map +1 -1
  212. package/dist/table/style.js +13 -13
  213. package/dist/table/style.js.map +1 -1
  214. package/dist/table/transforms.js.map +1 -1
  215. package/dist/table/useInfiniteSentinel.d.ts +1 -1
  216. package/dist/table/useInfiniteSentinel.js.map +1 -1
  217. package/dist/table.d.ts +1 -0
  218. package/dist/table.js +18 -0
  219. package/dist/table.js.map +1 -0
  220. package/dist/time/timezone.d.ts +1 -1
  221. package/dist/time/timezone.js +4 -8
  222. package/dist/time/timezone.js.map +1 -1
  223. package/dist/tokens.css +23 -20
  224. package/dist/tree/TreeNode.js +26 -25
  225. package/dist/tree/TreeNode.js.map +1 -1
  226. package/dist/tree/TreeRenderer.d.ts +1 -1
  227. package/dist/tree/TreeRenderer.js +16 -16
  228. package/dist/tree/TreeRenderer.js.map +1 -1
  229. package/dist/tree/expand.js +1 -1
  230. package/dist/tree/expand.js.map +1 -1
  231. package/dist/tree/index.d.ts +4 -0
  232. package/dist/tree.d.ts +1 -0
  233. package/dist/tree.js +15 -0
  234. package/dist/tree.js.map +1 -0
  235. package/dist/udc/client.d.ts +11 -0
  236. package/dist/udc/client.js +30 -0
  237. package/dist/udc/client.js.map +1 -0
  238. package/dist/udc/hooks.d.ts +3 -3
  239. package/dist/udc/hooks.js +1 -1
  240. package/dist/udc/hooks.js.map +1 -1
  241. package/dist/udc/provider.d.ts +15 -10
  242. package/dist/udc/provider.js +20 -27
  243. package/dist/udc/provider.js.map +1 -1
  244. package/dist/ui-kit/context.d.ts +11 -0
  245. package/dist/ui-kit/context.js +19 -0
  246. package/dist/ui-kit/context.js.map +1 -0
  247. package/dist/ui-kit/default.d.ts +3 -0
  248. package/dist/ui-kit/default.js +45 -0
  249. package/dist/ui-kit/default.js.map +1 -0
  250. package/dist/ui-kit/index.d.ts +2 -0
  251. package/dist/ui-kit/types.d.ts +227 -0
  252. package/dist/ui-kit/ui.d.ts +12 -0
  253. package/dist/ui.d.ts +1 -0
  254. package/dist/ui.js +13 -0
  255. package/dist/url-state/UrlState.d.ts +20 -0
  256. package/dist/url-state/UrlState.js +27 -0
  257. package/dist/url-state/UrlState.js.map +1 -0
  258. package/dist/url-state/adapter.d.ts +24 -0
  259. package/dist/url-state/adapter.js +33 -0
  260. package/dist/url-state/adapter.js.map +1 -0
  261. package/dist/url-state/index.d.ts +2 -0
  262. package/package.json +77 -5
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @jsudc/react
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@jsudc/react)](https://www.npmjs.com/package/@jsudc/react)
4
+
3
5
  React components for UDC (Universal Data Collection) collections. Give it a
4
6
  collection name and `<UdcDataView>` asks a UDC server what the collection is
5
7
  (`describe`) and draws it: search, filter chips and a filter builder, paging,
@@ -13,7 +15,13 @@ What is in the package:
13
15
  the transport client of [`@jsudc/core`](https://github.com/digital-cube/jsudc-core)
14
16
  (`useUdcCollections`, `useUdcDescribe`, `useUdcCollection`, `useUdcAllRows`,
15
17
  `useUdcMutate`, `useUdcSchema`, `useUdcSource`);
16
- - **`UdcDataView`** and the renderer registry **`RENDERERS`** with its types;
18
+ - **`UdcDataView`** and **`createRendererRegistry`**; each renderer is a
19
+ subpath of its own (`@jsudc/react/table`, `/cards`, `/kanban`, `/calendar`,
20
+ `/tree`, `/map`, `/chart`), so a page bundles, and a host installs the peers
21
+ of, only the renderers it registers; `@jsudc/react/all` has them all
22
+ (see [Renderers](#renderers));
23
+ - **`@jsudc/react/headless`**: the hooks and every renderer's model without any
24
+ markup, for a host that draws its own (see [Headless](#headless));
17
25
  - **`UdcI18nProvider`** + **`useI18n`**: the library's strings in English and
18
26
  Serbian, with your own sections, overrides and locales layered over them;
19
27
  - **`ThemeProvider`** + **`useTheme`** (light / dark), **`TimezoneProvider`**
@@ -22,14 +30,17 @@ What is in the package:
22
30
  pattern): `Button`, `Input`, `Checkbox`, `Select`, `Dialog`, `DropdownMenu`,
23
31
  `Popover`, `Tip`, `Segmented`, `Spinner`, `Skeleton`, and the `Toaster` and
24
32
  `TooltipProvider` the data view needs;
25
- - **`styles.css`**, compiled at build time, and **`tokens.css`**, its raw source.
33
+ - **`styles.css`**, compiled at build time with every utility `udc:`-prefixed, so
34
+ it cannot collide with a host's own Tailwind, and **`tokens.css`**, its design
35
+ tokens (see [Styling](#styling)).
26
36
 
27
37
  ```sh
28
38
  npm install @jsudc/react @jsudc/core \
29
- react react-dom react-router @tanstack/react-query @tanstack/react-table \
30
- radix-ui lucide-react leaflet recharts @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities
39
+ react react-dom @tanstack/react-query radix-ui lucide-react
40
+ # then the peers of the renderers you register (see Renderers), all of them:
41
+ npm install @tanstack/react-table leaflet recharts @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities
31
42
  # or straight from a GitHub tag:
32
- npm install github:digital-cube/jsudc-core#v0.1.1 github:digital-cube/jsudc-react#v0.1.1
43
+ npm install github:digital-cube/jsudc-core#v0.2.0 github:digital-cube/jsudc-react#v0.2.0
33
44
  ```
34
45
 
35
46
  ## Quick start
@@ -37,31 +48,23 @@ npm install github:digital-cube/jsudc-core#v0.1.1 github:digital-cube/jsudc-reac
37
48
  ```tsx
38
49
  import "@jsudc/react/styles.css";
39
50
  import { UdcClient } from "@jsudc/core/client";
40
- import {
41
- createUdcQueryClient,
42
- Toaster,
43
- TooltipProvider,
44
- UdcDataView,
45
- UdcI18nProvider,
46
- UdcProvider,
47
- } from "@jsudc/react";
51
+ import { createUdcQueryClient, UdcDataView, UdcI18nProvider, UdcProvider } from "@jsudc/react";
52
+ import { RENDERERS } from "@jsudc/react/all"; // every renderer; or a registry of a few, see Renderers
53
+ import { Toaster, TooltipProvider } from "@jsudc/react/ui";
48
54
  import { QueryClientProvider } from "@tanstack/react-query";
49
55
  import { createRoot } from "react-dom/client";
50
- import { BrowserRouter } from "react-router";
51
56
 
52
57
  const client = new UdcClient({ httpUrl: "" }); // same origin; or "https://api.example.com"
53
58
 
54
59
  createRoot(document.getElementById("root") as HTMLElement).render(
55
- <UdcProvider client={client}>
60
+ <UdcProvider client={client} renderers={RENDERERS}>
56
61
  <QueryClientProvider client={createUdcQueryClient()}>
57
62
  <UdcI18nProvider>
58
63
  <TooltipProvider>
59
64
  <Toaster>
60
- <BrowserRouter>
61
- <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
62
- <UdcDataView collection="companies" />
63
- </div>
64
- </BrowserRouter>
65
+ <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
66
+ <UdcDataView collection="companies" />
67
+ </div>
65
68
  </Toaster>
66
69
  </TooltipProvider>
67
70
  </UdcI18nProvider>
@@ -82,66 +85,322 @@ collections, so each one starts from a fresh view.
82
85
 
83
86
  ### The providers a host wraps
84
87
 
85
- | Provider | Needed | Why |
86
- | ----------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
87
- | `UdcProvider client={new UdcClient(...)}` | yes | every hook reads the client from it |
88
- | `QueryClientProvider client={createUdcQueryClient()}` | yes | the hooks are TanStack Query; `createUdcQueryClient` retries transport failures only, never a protocol error |
89
- | `UdcI18nProvider` | yes | every string goes through `useI18n()` |
90
- | `TooltipProvider` | yes | Radix tooltips on headers, chips and buttons |
91
- | `Toaster` | yes | save, conflict and schema-edit toasts (`useToast`) |
92
- | a react-router router (`BrowserRouter`, `createBrowserRouter`, …) | yes | search, filters, sort, paging and the tab live in the URL (`useSearchParams`) |
93
- | `TimezoneProvider` | no | without it instants are shown in the browser's zone; with it the user's pick, kept in `localStorage` (`udc-tz`) |
94
- | `ThemeProvider` | no | `useTheme()` toggles the `dark` class on `<html>` and keeps the choice (`udc-theme`); any other way of setting that class works too |
88
+ | Provider | Needed | Why |
89
+ | ----------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
90
+ | `UdcProvider client={new UdcClient(...)}` | yes | every hook reads the client from it; `renderers={…}` is what the data view draws its tabs with (none given: every tab says no renderer is registered) |
91
+ | `QueryClientProvider client={createUdcQueryClient()}` | yes | the hooks are TanStack Query; `createUdcQueryClient` retries transport failures only, never a protocol error |
92
+ | `UdcI18nProvider` | yes | every string goes through `useI18n()` |
93
+ | `TooltipProvider` | yes | Radix tooltips on headers, chips and buttons; with your own kit, `kit.TooltipProvider` (see [Bring your own primitives](#bring-your-own-primitives)) |
94
+ | `Toaster` | yes | save, conflict and schema-edit toasts (`useToast`); with your own kit, `kit.Toaster` |
95
+ | `UdcUrlStateProvider` / `UdcReactRouterUrlState` | no | where search, filters, sort, paging and the tab live; without it `window.location` (see [URL state](#url-state)) |
96
+ | `TimezoneProvider` | no | without it instants are shown in the browser's zone; with it the user's pick, kept in `localStorage` (`udc-tz`) |
97
+ | `ThemeProvider` | no | `useTheme()` toggles the `dark` class on `<html>` and keeps the choice (`udc-theme`); any other way of setting that class works too |
98
+
99
+ ## Renderers
100
+
101
+ The package root imports no renderer. A host registers the ones it shows, each
102
+ from its own subpath, and only those (with their peers) end up in its bundle:
103
+
104
+ ```tsx
105
+ import { createRendererRegistry, UdcProvider } from "@jsudc/react";
106
+ import { cardsRenderer } from "@jsudc/react/cards";
107
+ import { tableRenderer } from "@jsudc/react/table";
108
+
109
+ // A module constant: the registry should not change between renders.
110
+ const renderers = createRendererRegistry(tableRenderer, cardsRenderer);
111
+
112
+ <UdcProvider client={client} renderers={renderers}>
113
+ …
114
+ </UdcProvider>;
115
+ ```
116
+
117
+ `RENDERERS` from `@jsudc/react/all` is the registry of all seven. A view's tab
118
+ whose renderer is not registered is drawn disabled; `UdcDataView renderers={…}`
119
+ overrides the provider's registry for one view. A renderer of your own is one
120
+ more definition: `{ name: "gantt", component, icon, labelKey, paging, editMode }`
121
+ (`component` takes `RendererProps`), and a later definition of a name replaces
122
+ an earlier one, so `createRendererRegistry(tableRenderer, myTable)` swaps the
123
+ table.
124
+
125
+ | Subpath | Exports | Peers it needs (optional peers of the package) |
126
+ | ---------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------- |
127
+ | `@jsudc/react/table` | `tableRenderer`, `TableRenderer`, `CellValue`, `Pager` | `@tanstack/react-table` |
128
+ | `@jsudc/react/cards` | `cardsRenderer`, `CardRenderer` | — |
129
+ | `@jsudc/react/kanban` | `kanbanRenderer`, `KanbanRenderer`, `KanbanBoardSwitcher` | `@dnd-kit/core`, `@dnd-kit/sortable`, `@dnd-kit/utilities` |
130
+ | `@jsudc/react/calendar` | `calendarRenderer`, `CalendarRenderer` | — |
131
+ | `@jsudc/react/tree` | `treeRenderer`, `TreeRenderer` | `@dnd-kit/core` |
132
+ | `@jsudc/react/map` | `mapRenderer`, `MapRenderer` | `leaflet` |
133
+ | `@jsudc/react/chart` | `chartRenderer`, `ChartRenderer` | `recharts` |
134
+ | `@jsudc/react/schema-editor` | `useSchemaEditor`, the field dialogs, the `fieldForm` helpers | — |
135
+ | `@jsudc/react/all` | `RENDERERS` and every `…Renderer` definition | all of the above |
136
+ | `@jsudc/react/headless` | hooks and models, no markup (below) | none: `react`, `@tanstack/react-query`, `@jsudc/core` only |
137
+
138
+ A subpath whose peer is not installed fails at that import and nowhere else:
139
+ Node stops with `ERR_MODULE_NOT_FOUND` for `leaflet`; Vite, which knows the
140
+ peer is optional, builds and the import throws
141
+ `Could not resolve "leaflet/dist/leaflet.css" imported by "@jsudc/react". Is it installed?`
142
+ when the module loads. The root, `/table`, `/cards`, `/calendar` and
143
+ `/headless` load without it.
144
+
145
+ ## Headless
146
+
147
+ `@jsudc/react/headless` is the data layer under the renderers, with no JSX, no
148
+ CSS and no renderer peer (a test walks its imports): a host on Material, Ant or
149
+ plain HTML builds its own renderer on it and gets the same queries, filters and
150
+ URL state.
151
+
152
+ - the client context and the hooks: `useUdcClient`, `useUdcDescribe`,
153
+ `useUdcCollection`, `useUdcAllRows`, `useUdcMutate`, `useUdcSchema`, `udcKeys`;
154
+ - the data view's state: `useDataViewState` (tab, search, chips, filter tree,
155
+ sort, paging in the URL), `composeFilter`, the URL codecs of `urlState.ts`,
156
+ `liveDescribe` / `liveSort`, the folder helpers;
157
+ - each renderer's model and state hook: `useKanbanBoard` and the drop planner,
158
+ `useChartWindow` and the chart series model, `useCalendarUrl` and the
159
+ calendar window model, the card, map and tree models (`planTreeDrop`,
160
+ `TreeDropPlan`: the tree's names, prefixed), `useTreeExpand`;
161
+ - `applyTransforms`, `displayText`, `renderKind` and the cell formatters;
162
+ the zone helpers and `useTimezone`;
163
+ - the registry functions (`createRendererRegistry`, `resolveTab`) and the URL
164
+ state adapter, so its hooks behave exactly as inside `UdcDataView`.
165
+
166
+ ## URL state
167
+
168
+ The data view keeps what the user chose in the query string, so a link or a
169
+ reload opens the same view: the tab (`?tab=`), the search (`?q=`), the chips
170
+ and the filter tree, the sort, the paging mode and the page, the kanban board
171
+ (`?board=`), the chart window (`?win=`, `?from=&to=`) and the calendar
172
+ (`?preset=&date=`). Filters, sort and windows **replace** the current history
173
+ entry; they are not a step the Back button walks through.
174
+
175
+ It reaches the address bar through a `UrlStateAdapter`:
176
+
177
+ ```ts
178
+ interface UrlStateAdapter {
179
+ get(): URLSearchParams;
180
+ set(next: URLSearchParams, opts?: { replace?: boolean }): void;
181
+ subscribe(listener: () => void): () => void; // back / forward
182
+ }
183
+ ```
184
+
185
+ **Default: no router needed.** Without a provider the view uses
186
+ `windowLocationAdapter`: `window.location.search`, written with
187
+ `history.pushState` / `replaceState`, the path and the hash left alone, read
188
+ again on `popstate`. That is all a plain React page needs.
189
+
190
+ **On react-router** (^7), mount the adapter from the subpath inside your
191
+ router, around the views. It is the only module of the package that imports
192
+ react-router, and react-router is an optional peer for it:
193
+
194
+ ```tsx
195
+ import { UdcReactRouterUrlState } from "@jsudc/react/react-router";
196
+
197
+ <BrowserRouter>
198
+ <UdcReactRouterUrlState>
199
+ <App />
200
+ </UdcReactRouterUrlState>
201
+ </BrowserRouter>;
202
+ ```
203
+
204
+ With a data router, put it in the root route's element. Use it whenever the
205
+ host navigates with react-router: the default adapter writes the History API
206
+ behind the router's back, so the router would not see the change.
207
+
208
+ **Any other router**: write the three calls and mount them with
209
+ `UdcUrlStateProvider`. `get` is called during render, so return the current
210
+ query string cheaply; `subscribe` only has to report changes the view did not
211
+ make itself, or none at all when a new adapter object is passed on every
212
+ location change (that re-renders the view's hooks too). Two sketches, to adapt
213
+ to your router's version. TanStack Router:
214
+
215
+ ```tsx
216
+ import { UdcUrlStateProvider, type UrlStateAdapter } from "@jsudc/react";
217
+ import { useLocation, useRouter } from "@tanstack/react-router";
218
+ import { useMemo } from "react";
219
+
220
+ function TanStackUrlState({ children }: { children: React.ReactNode }) {
221
+ const router = useRouter();
222
+ const searchStr = useLocation({ select: (l) => l.searchStr });
223
+ const adapter = useMemo<UrlStateAdapter>(
224
+ () => ({
225
+ get: () => new URLSearchParams(router.state.location.searchStr),
226
+ set: (next, opts) => {
227
+ const qs = next.toString();
228
+ router.history[opts?.replace ? "replace" : "push"](
229
+ `${router.state.location.pathname}${qs ? `?${qs}` : ""}`,
230
+ );
231
+ },
232
+ subscribe: () => () => {},
233
+ }),
234
+ // biome-ignore lint/correctness/useExhaustiveDependencies: a new adapter per query string
235
+ [router, searchStr],
236
+ );
237
+ return <UdcUrlStateProvider adapter={adapter}>{children}</UdcUrlStateProvider>;
238
+ }
239
+ ```
240
+
241
+ Next.js (App Router, a client component):
242
+
243
+ ```tsx
244
+ "use client";
245
+ import { UdcUrlStateProvider, type UrlStateAdapter } from "@jsudc/react";
246
+ import { usePathname, useRouter, useSearchParams } from "next/navigation";
247
+ import { useMemo } from "react";
248
+
249
+ export function NextUrlState({ children }: { children: React.ReactNode }) {
250
+ const router = useRouter();
251
+ const pathname = usePathname();
252
+ const search = useSearchParams().toString();
253
+ const adapter = useMemo<UrlStateAdapter>(
254
+ () => ({
255
+ get: () => new URLSearchParams(search),
256
+ set: (next, opts) => {
257
+ const qs = next.toString();
258
+ const url = `${pathname}${qs ? `?${qs}` : ""}`;
259
+ if (opts?.replace) router.replace(url, { scroll: false });
260
+ else router.push(url, { scroll: false });
261
+ },
262
+ subscribe: () => () => {},
263
+ }),
264
+ [router, pathname, search],
265
+ );
266
+ return <UdcUrlStateProvider adapter={adapter}>{children}</UdcUrlStateProvider>;
267
+ }
268
+ ```
269
+
270
+ `useUrlSearchParams()` gives your own components the same
271
+ `[params, setParams]` pair the view uses, over whichever adapter is in effect;
272
+ a function passed to `setParams` receives the query string as it is now.
273
+
274
+ ## Bring your own primitives
275
+
276
+ The renderers never import a button, a dialog or a menu. They take every
277
+ primitive from a **UI kit** in context: `const { Button, Popover } = useUiKit()`.
278
+ The kit the package ships, Radix primitives styled with Tailwind, is
279
+ `defaultUiKit` from `@jsudc/react/ui`, and it is what the view uses when you
280
+ pass nothing. Hand another kit to `UdcProvider` (or mount `UdcUiProvider`
281
+ yourself) to draw the same view with MUI, Ant Design, or your own shadcn
282
+ components:
283
+
284
+ ```tsx
285
+ import { UdcProvider } from "@jsudc/react";
286
+ import { myKit } from "./myKit"; // a module constant: `const myKit: UiKit = {...}`
287
+
288
+ <UdcProvider client={client} kit={myKit}>
289
+ <myKit.TooltipProvider>
290
+ <myKit.Toaster>
291
+ <UdcDataView collection="companies" />
292
+ </myKit.Toaster>
293
+ </myKit.TooltipProvider>
294
+ </UdcProvider>;
295
+ ```
296
+
297
+ `UdcProvider` without `kit` leaves the kit alone: an outer `UdcUiProvider`'s
298
+ wins, else the default. `useUiKit()` returns the kit in effect, so your own
299
+ components can draw with the same primitives.
300
+
301
+ **The contract** is the `UiKit` interface (exported from the package root
302
+ with one props type per primitive, `UiButtonProps`, `UiDialogContentProps` and
303
+ so on). It lists exactly the props the renderers pass, no more:
304
+
305
+ | Family | Members |
306
+ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
307
+ | Fields | `Button` (`variant`, `size`), `Input`, `NativeSelect`, `Checkbox`, `Select` (an options list), `Segmented` |
308
+ | Small | `Spinner`, `Skeleton`, `Kbd` |
309
+ | Dialog | `Dialog` (controlled), `DialogContent` (`title`, `description`, a close button), `DialogBody`, `DialogFooter` |
310
+ | Menu | `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem` (`onSelect`, `tone`), `DropdownMenuLabel`, `DropdownMenuSeparator` |
311
+ | Popover | `Popover` (controlled or not), `PopoverTrigger`, `PopoverContent`, `PopoverAnchor` (a `virtualRef`) |
312
+ | Tooltip | `TooltipProvider`, `Tip` (`label` on its single child) |
313
+ | Toast | `Toaster` (the stack and its viewport), `useToast()` → `{ toast({ title, description?, variant? }) }` |
314
+
315
+ Three things a kit must honour: a trigger with `asChild` merges into its single
316
+ child instead of drawing a button; `DialogContent`'s `onEscapeKeyDown` /
317
+ `onInteractOutside` and `PopoverContent`'s `onOpenAutoFocus` get an event whose
318
+ `preventDefault()` keeps the dialog open or the focus in place; `useToast` is
319
+ called as a hook. Keep the kit object stable (a module constant): it is read on
320
+ every render.
321
+
322
+ **The smallest kit** is plain HTML. The package's own test suite has one,
323
+ [`test/stubKit.tsx`](test/stubKit.tsx), and renders every renderer with it;
324
+ a few of its members:
325
+
326
+ ```tsx
327
+ import type { UiKit } from "@jsudc/react";
328
+
329
+ export const stubKit: UiKit = {
330
+ Button: ({ variant, size, type, ...props }) => (
331
+ <button data-variant={variant} data-size={size} type={type ?? "button"} {...props} />
332
+ ),
333
+ Input: (props) => <input {...props} />,
334
+ Checkbox: ({ onCheckedChange, ...props }) => (
335
+ <input type="checkbox" {...props} onChange={(e) => onCheckedChange(e.target.checked)} />
336
+ ),
337
+ Spinner: ({ className }) => <span aria-hidden className={className} />,
338
+ Tip: ({ label, children }) => (
339
+ <span title={typeof label === "string" ? label : undefined}>{children}</span>
340
+ ),
341
+ // … Dialog, DropdownMenu and Popover keep their open state in a small context;
342
+ // see test/stubKit.tsx for all of it.
343
+ };
344
+ ```
345
+
346
+ **The default kit's primitives** are exported one by one from
347
+ `@jsudc/react/ui` too (`Button`, `Dialog`, `DialogContent`, `Popover`,
348
+ `Select`, `Segmented`, `Toaster`, `useToast`, `Tip`, …), for a host page that
349
+ wants the same look outside the view. Radix (`radix-ui`) is still a required
350
+ peer while the default kit is the fallback.
95
351
 
96
352
  ## Peer dependencies
97
353
 
98
354
  Everything the components import that a host is likely to have too is a peer,
99
355
  so there is one copy of it in the bundle:
100
356
 
101
- - `@jsudc/core` ^0.1.1 — one copy of the protocol, shared with the host's
357
+ - `@jsudc/core` ^0.2.0 — one copy of the protocol, shared with the host's
102
358
  own `UdcClient`;
103
359
  - `react`, `react-dom` ^19 — one React, or hooks break;
104
360
  - `@tanstack/react-query` ^5 — one `QueryClient` context, shared with the
105
361
  host's own queries;
106
- - `react-router` ^7 — the view keeps its state in the host's router;
107
- - `@tanstack/react-table`, `radix-ui`, `lucide-react` — the table and the
108
- primitives;
109
- - `leaflet` (map), `recharts` (chart), `@dnd-kit/core`, `@dnd-kit/sortable`,
110
- `@dnd-kit/utilities` (kanban, tree) — the renderers.
111
-
112
- All of them are required in 0.1: the registry imports every renderer. Optional
113
- renderer subpaths (`@jsudc/react/map`, `@jsudc/react/chart`) that let a host
114
- skip Leaflet or Recharts are planned. The regular dependencies are
115
- `clsx`, `tailwind-merge` and `marked` (the Doc tab).
362
+ - `lucide-react` — the icons;
363
+ - `radix-ui` — the default UI kit (`@jsudc/react/ui`), the fallback when no
364
+ other kit is given (see [Bring your own primitives](#bring-your-own-primitives));
365
+ - **optional**, each needed only by its subpath (see [Renderers](#renderers)):
366
+ `@tanstack/react-table` (table), `@dnd-kit/core` (kanban, tree),
367
+ `@dnd-kit/sortable` and `@dnd-kit/utilities` (kanban), `leaflet` (map),
368
+ `recharts` (chart), `react-router` (`@jsudc/react/react-router`, see
369
+ [URL state](#url-state)). The package root imports none of them.
370
+
371
+ The regular dependencies are `clsx`, `tailwind-merge` and `marked` (the Doc
372
+ tab).
116
373
 
117
374
  The map renderer imports `leaflet/dist/leaflet.css` itself; your bundler picks
118
375
  it up from the `leaflet` you installed.
119
376
 
120
- ## Styles
377
+ ## Styling
121
378
 
122
- A host **without Tailwind** imports the compiled stylesheet once and is done:
379
+ Import the compiled stylesheet once, with or without Tailwind of your own:
123
380
 
124
381
  ```ts
125
382
  import "@jsudc/react/styles.css";
126
383
  ```
127
384
 
128
385
  It holds Tailwind's preflight, every utility the components use, the design
129
- tokens of both themes and the library's few rules of its own.
130
-
131
- A host that **runs Tailwind v4 itself** imports the raw tokens into its own
132
- build instead, and lets Tailwind scan the package, so there is one preflight and
133
- one utilities layer:
134
-
135
- ```css
136
- @import "tailwindcss";
137
- @import "@jsudc/react/tokens.css";
138
- @source "../node_modules/@jsudc/react/dist";
139
- ```
386
+ tokens of both themes and the library's few rules of its own. Every utility is
387
+ **`udc:`-prefixed** (Tailwind v4's `prefix(udc)`: `udc:flex`,
388
+ `udc:hover:bg-hover`), so it cannot collide with a host's own Tailwind: a
389
+ host's `.flex` and `.p-4` are its own, and the library's are `.udc\:flex`,
390
+ `.udc\:p-4`. A host that runs Tailwind v4 keeps its build as it is and
391
+ imports `styles.css` beside it; it does not `@source` the package (its
392
+ classes are already compiled, and a host's unprefixed Tailwind would not
393
+ generate them anyway). The build fails if the stylesheet ever carries an
394
+ unprefixed class (`scripts/check-css.mjs`).
395
+
396
+ The stylesheet also carries the library's base rules (`border-color` on `*`,
397
+ `body` font and colours, pointer cursor on buttons) in `@layer base`; any
398
+ unlayered CSS of the host wins over them.
140
399
 
141
400
  ### Theming
142
401
 
143
- Every colour comes from a CSS variable on `:root` and
144
- `.dark`. Restyling is redefining them after the stylesheet — no code:
402
+ Every colour comes from a CSS variable on `:root` and `.dark`. Restyling is
403
+ redefining them after the stylesheet, no code:
145
404
 
146
405
  ```css
147
406
  :root {
@@ -153,14 +412,68 @@ Every colour comes from a CSS variable on `:root` and
153
412
  }
154
413
  ```
155
414
 
156
- The variables are `--background`, `--foreground`, `--surface`,
157
- `--surface-raised`, `--muted`, `--muted-foreground`, `--border`,
158
- `--border-strong`, `--input`, `--ring`, `--primary`, `--primary-foreground`,
159
- `--hover`, `--selected`, the semantic tones `--sem-{accent,success,warning,danger,info,muted}`
160
- and their `-bg` pairs, and `--chart-1` … `--chart-8` (see `dist/tokens.css`). Dark mode is
161
- the `dark` class on any ancestor, usually `<html>`. The font is `Inter
162
- Variable` when the host loads it (`@fontsource-variable/inter`), else the
163
- system UI font.
415
+ The variables (`dist/tokens.css`, both themes):
416
+
417
+ | Variable | What it paints |
418
+ | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
419
+ | `--background`, `--foreground` | the page behind the view, the text |
420
+ | `--surface`, `--surface-raised` | panels, cards, cells; popovers and dialogs |
421
+ | `--muted`, `--muted-foreground` | quiet fills (skeletons, column backgrounds), secondary text |
422
+ | `--border`, `--border-strong`, `--input`, `--ring` | hairlines, emphasised borders, inputs, focus rings |
423
+ | `--primary`, `--primary-foreground` | the accent: primary buttons, active chips, links |
424
+ | `--hover`, `--selected` | row and item hover, selection |
425
+ | `--shadow-pin` | the shadow beside a pinned table column |
426
+ | `--sem-accent`, `--sem-success`, `--sem-warning`, `--sem-danger`, `--sem-info`, `--sem-muted` | the semantic tones (badges, row colours, kanban columns, map markers) |
427
+ | `--sem-accent-bg`, `--sem-success-bg`, `--sem-warning-bg`, `--sem-danger-bg`, `--sem-info-bg`, `--sem-muted-bg` | their background pairs |
428
+ | `--chart-1` … `--chart-8` | the chart's series |
429
+
430
+ Dark mode is the `dark` class on any ancestor, usually `<html>`. The font is
431
+ `Inter Variable` when the host loads it (`@fontsource-variable/inter`), else
432
+ the system UI font.
433
+
434
+ ### Stable classes
435
+
436
+ Next to its utilities every structural element carries a class that does not
437
+ change with them, for plain-CSS overrides:
438
+
439
+ | Class | Element |
440
+ | -------------------- | ------------------------------------------------- |
441
+ | `udc-data-view` | the whole view (header, toolbar, the renderer) |
442
+ | `udc-toolbar` | the toolbar: search, chips, filter builder, count |
443
+ | `udc-search` | the search box |
444
+ | `udc-filter-chip` | one filter chip |
445
+ | `udc-table` | the table's `<table>` |
446
+ | `udc-row` | a table row (`<tr>`) |
447
+ | `udc-cell` | a table cell (`<td>`) |
448
+ | `udc-pager` | the pager under the table or the cards |
449
+ | `udc-card` | one card of the card grid |
450
+ | `udc-kanban` | the kanban board |
451
+ | `udc-kanban-column` | a kanban column |
452
+ | `udc-kanban-card` | a kanban card |
453
+ | `udc-calendar` | the calendar |
454
+ | `udc-calendar-event` | an event (time grid block, month chip) |
455
+ | `udc-tree` | the tree |
456
+ | `udc-tree-node` | one node of the tree (with its children) |
457
+ | `udc-map` | the map's Leaflet container |
458
+ | `udc-chart` | the chart tab |
459
+ | `udc-schema-editor` | the field form and the delete-field dialog |
460
+
461
+ ```css
462
+ /* Denser table rows, a bolder first column, square cards. */
463
+ .udc-table .udc-row {
464
+ height: 28px !important; /* the row height is an inline style */
465
+ }
466
+ .udc-table .udc-row .udc-cell:first-child {
467
+ font-weight: 600;
468
+ }
469
+ .udc-card {
470
+ border-radius: 0;
471
+ }
472
+ ```
473
+
474
+ A rule of the host's own (unlayered) CSS wins over the library's utilities,
475
+ which sit in Tailwind's `@layer utilities`, without `!important`; only inline
476
+ styles (row height, column widths, pinned offsets) need it.
164
477
 
165
478
  ## i18n
166
479
 
@@ -202,16 +515,30 @@ const messages: Messages = {
202
515
 
203
516
  ## API
204
517
 
205
- Everything is exported from the package root; see `dist/index.d.ts`. Beyond
206
- the above: `RENDERERS`, `rendererTabs`, `resolveTab` and the `RendererProps` /
207
- `RendererEntry` types; `EmptyState` / `ErrorState`; `mergeMessages`, `makeT`,
518
+ The package root (`dist/index.d.ts`) has the data view, the providers, the
519
+ registry and everything not tied to one renderer. Beyond the above:
520
+ `createRendererRegistry`, `rendererEntry`, `rendererTabs`, `resolveTab`,
521
+ `UdcRenderersProvider`, `useRendererRegistry` and the `RendererProps` /
522
+ `RendererEntry` / `RendererDefinition` / `RendererRegistry` types;
523
+ `EmptyState` / `ErrorState` / `NoRendererState`; `mergeMessages`, `makeT`,
208
524
  `lookup`, `schemaLabelTerms`, `tableSection`, `TRANSLATIONS`, `LOCALES`;
209
- `cn`, `storage`, `humanize`; `resolveIcon` with the `lucide:<name>` icons the
210
- package bundles (`LUCIDE_ICONS`); and the zone helpers `allZones`,
211
- `offsetLabel`, `zoneCity`.
212
-
213
- The build is ESM only, one file per source module (tree-shakeable), with
214
- `.d.ts` files next to them; every dependency and peer stays an import.
525
+ `cn` (tailwind-merge set up for the `udc:` prefix), `storage`, `humanize`;
526
+ `UdcUrlStateProvider`, `useUrlSearchParams`, `windowLocationAdapter` and the
527
+ `UrlStateAdapter` type; `UdcUiProvider`, `useUiKit` and the `UiKit` type with
528
+ its props types; `resolveIcon` with the `lucide:<name>` icons the package
529
+ bundles (`LUCIDE_ICONS`); and the zone helpers `allZones`, `offsetLabel`,
530
+ `zoneCity`.
531
+
532
+ The subpaths: one per renderer and `@jsudc/react/all` (see
533
+ [Renderers](#renderers)), `@jsudc/react/headless` (see [Headless](#headless)),
534
+ `@jsudc/react/ui` (`defaultUiKit` and its primitives: `Button`, `Dialog`,
535
+ `Toaster`, `TooltipProvider`, …), `@jsudc/react/react-router`
536
+ (`UdcReactRouterUrlState`), `@jsudc/react/styles.css` and
537
+ `@jsudc/react/tokens.css`.
538
+
539
+ The build is ESM only, one file per source module (tree-shakeable), one
540
+ `dist/<subpath>.js` with its `dist/<subpath>.d.ts` per entry; every dependency
541
+ and peer stays an import.
215
542
 
216
543
  ## Develop
217
544
 
package/dist/all.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { calendarRenderer } from "./calendar/index.js";
2
+ export { cardsRenderer } from "./cards/index.js";
3
+ export { chartRenderer } from "./chart/index.js";
4
+ export { kanbanRenderer } from "./kanban/index.js";
5
+ export { mapRenderer } from "./map/index.js";
6
+ export { tableRenderer } from "./table/index.js";
7
+ export { treeRenderer } from "./tree/index.js";
8
+ /** Every renderer the package ships: `<UdcProvider renderers={RENDERERS}>`. */
9
+ export declare const RENDERERS: Readonly<Record<string, import("./headless.js").RendererEntry>>;
package/dist/all.js ADDED
@@ -0,0 +1,14 @@
1
+ import { calendarRenderer } from "./calendar.js";
2
+ import { cardsRenderer } from "./cards.js";
3
+ import { chartRenderer } from "./chart.js";
4
+ import { kanbanRenderer } from "./kanban.js";
5
+ import { mapRenderer } from "./map.js";
6
+ import { createRendererRegistry } from "./renderers/registry.js";
7
+ import { tableRenderer } from "./table.js";
8
+ import { treeRenderer } from "./tree.js";
9
+ // src/all.ts
10
+ /** Every renderer the package ships: `<UdcProvider renderers={RENDERERS}>`. */
11
+ var RENDERERS = createRendererRegistry(tableRenderer, cardsRenderer, kanbanRenderer, calendarRenderer, treeRenderer, mapRenderer, chartRenderer);
12
+ export { RENDERERS, calendarRenderer, cardsRenderer, chartRenderer, kanbanRenderer, mapRenderer, tableRenderer, treeRenderer };
13
+
14
+ //# sourceMappingURL=all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all.js","names":[],"sources":["../src/all.ts"],"sourcesContent":["// @jsudc/react/all: every renderer, and `RENDERERS`, the registry of all of them (what the\n// package root exported before the renderers became subpaths). Needs every optional peer:\n// `@tanstack/react-table`, `@dnd-kit/*`, `leaflet`, `recharts`.\nimport { calendarRenderer } from \"./calendar/index.js\";\nimport { cardsRenderer } from \"./cards/index.js\";\nimport { chartRenderer } from \"./chart/index.js\";\nimport { kanbanRenderer } from \"./kanban/index.js\";\nimport { mapRenderer } from \"./map/index.js\";\nimport { createRendererRegistry } from \"./renderers/registry.js\";\nimport { tableRenderer } from \"./table/index.js\";\nimport { treeRenderer } from \"./tree/index.js\";\n\nexport { calendarRenderer } from \"./calendar/index.js\";\nexport { cardsRenderer } from \"./cards/index.js\";\nexport { chartRenderer } from \"./chart/index.js\";\nexport { kanbanRenderer } from \"./kanban/index.js\";\nexport { mapRenderer } from \"./map/index.js\";\nexport { tableRenderer } from \"./table/index.js\";\nexport { treeRenderer } from \"./tree/index.js\";\n\n/** Every renderer the package ships: `<UdcProvider renderers={RENDERERS}>`. */\nexport const RENDERERS = createRendererRegistry(\n tableRenderer,\n cardsRenderer,\n kanbanRenderer,\n calendarRenderer,\n treeRenderer,\n mapRenderer,\n chartRenderer,\n);\n"],"mappings":";;;;;;;;;;AAqBA,IAAa,YAAY,uBACvB,eACA,eACA,gBACA,kBACA,cACA,aACA,aACF"}
@@ -1,7 +1,5 @@
1
1
  import { type FilterNode, type SchemaDoc } from "@jsudc/core";
2
- import type { RendererProps } from "../renderers/types";
3
- export declare const PRESET_PARAM = "preset";
4
- export declare const DATE_PARAM = "date";
2
+ import type { RendererProps } from "../renderers/types.js";
5
3
  /**
6
4
  * Enum values the filter pins (a chip with values picked): what a new event
7
5
  * gets, so an appointment added under the "Ana" chip is Ana's.