@databricks/appkit-ui 0.43.0 → 0.44.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 (52) hide show
  1. package/CLAUDE.md +0 -1
  2. package/NOTICE.md +1 -0
  3. package/dist/cli/commands/generate-types.js +5 -0
  4. package/dist/cli/commands/generate-types.js.map +1 -1
  5. package/dist/js/index.js +0 -2
  6. package/dist/react/charts/base.d.ts +11 -1
  7. package/dist/react/charts/base.d.ts.map +1 -1
  8. package/dist/react/charts/base.js +23 -2
  9. package/dist/react/charts/base.js.map +1 -1
  10. package/dist/react/charts/normalize.js +0 -1
  11. package/dist/react/charts/normalize.js.map +1 -1
  12. package/dist/react/genie/use-genie-chat.js +0 -1
  13. package/dist/react/genie/use-genie-chat.js.map +1 -1
  14. package/dist/react/hooks/use-agent-chat.js +0 -1
  15. package/dist/react/hooks/use-agent-chat.js.map +1 -1
  16. package/dist/react/hooks/use-analytics-query.js +0 -1
  17. package/dist/react/hooks/use-analytics-query.js.map +1 -1
  18. package/dist/react/hooks/use-plugin-config.js +0 -1
  19. package/dist/react/hooks/use-plugin-config.js.map +1 -1
  20. package/dist/react/hooks/use-serving-stream.js +0 -1
  21. package/dist/react/hooks/use-serving-stream.js.map +1 -1
  22. package/dist/react/index.d.ts +1 -2
  23. package/dist/react/index.js +1 -8
  24. package/dist/react/table/table-wrapper.js +0 -1
  25. package/dist/react/table/table-wrapper.js.map +1 -1
  26. package/dist/react/ui/index.d.ts +0 -1
  27. package/docs/api/appkit-ui/ui/ContextMenu.md +2 -2
  28. package/docs/api/appkit-ui/ui/Drawer.md +0 -56
  29. package/docs/api/appkit-ui/ui/DropdownMenu.md +3 -3
  30. package/docs/api/appkit-ui/ui/HoverCard.md +2 -2
  31. package/docs/api/appkit-ui/ui/Menubar.md +3 -3
  32. package/docs/api/appkit-ui/ui/Popover.md +2 -2
  33. package/docs/api/appkit-ui/ui/Select.md +2 -2
  34. package/docs/api/appkit-ui/ui/Tooltip.md +2 -2
  35. package/docs/development/type-generation.md +28 -2
  36. package/llms.txt +0 -1
  37. package/package.json +5 -4
  38. package/sbom.cdx.json +1 -1
  39. package/dist/js/arrow/index.js +0 -3
  40. package/dist/react/charts/index.js +0 -19
  41. package/dist/react/file-browser/index.js +0 -6
  42. package/dist/react/genie/index.js +0 -8
  43. package/dist/react/hooks/index.js +0 -9
  44. package/dist/react/table/index.js +0 -1
  45. package/dist/react/ui/chart.d.ts +0 -117
  46. package/dist/react/ui/chart.d.ts.map +0 -1
  47. package/dist/react/ui/chart.js +0 -160
  48. package/dist/react/ui/chart.js.map +0 -1
  49. package/dist/react/ui/index.js +0 -53
  50. package/dist/shared/src/index.js +0 -2
  51. package/dist/shared/src/sql/index.js +0 -1
  52. package/docs/api/appkit-ui/ui/ChartContainer.md +0 -343
@@ -6,7 +6,7 @@ AppKit can automatically generate TypeScript types for your SQL queries, providi
6
6
 
7
7
  Generate type-safe TypeScript declarations for query keys, parameters, and result rows.
8
8
 
9
- All generated files live in `shared/appkit-types/`, one per plugin (e.g. `analytics.d.ts`). They use [`declare module`](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) to augment existing interfaces, so the types apply globally — you never need to import them. TypeScript auto-discovers them through `"include": ["shared/appkit-types"]` in your tsconfig.
9
+ All generated files live in `shared/appkit-types/`, one per concern: `analytics.d.ts` (SQL query types), `serving.d.ts` (model-serving endpoint types), and `metric-views.d.ts`. A single command (and the Vite plugin) produces them all in one pass; see [Metric-view types](#metric-view-types). The `.d.ts` files use [`declare module`](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) to augment existing interfaces, so the types apply globally — you never need to import them. TypeScript auto-discovers them through `"include": ["shared/appkit-types"]` in your tsconfig.
10
10
 
11
11
  ## Vite plugin: `appKitTypesPlugin`[​](#vite-plugin-appkittypesplugin "Direct link to vite-plugin-appkittypesplugin")
12
12
 
@@ -86,6 +86,32 @@ npx @databricks/appkit generate-types --wait
86
86
 
87
87
  In blocking mode the generator starts a stopped warehouse, waits (bounded) for it to reach `RUNNING`, and then describes your queries. It fails only when the configured warehouse no longer exists (deleted/deleting), so a transient outage or a cold warehouse degrades gracefully rather than breaking the build. The app template wires this up for you: `postinstall` and `predev` run the non-blocking default, while `prebuild` runs `--wait`.
88
88
 
89
+ ## Metric-view types[​](#metric-view-types "Direct link to Metric-view types")
90
+
91
+ `generate-types` (and the Vite plugin) emit metric-view types **additively** — there is no separate command. When a `config/queries/metric-views.json` file is present, the same run that generates your query types also DESCRIBEs each declared [UC Metric View](./docs/plugins/analytics.md) and writes `metric-views.d.ts` into `shared/appkit-types/`:
92
+
93
+ * `metric-views.d.ts` — augments the `MetricRegistry` interface so `useMetricView('<key>', …)` is autocompleted and type-checked. Each view's measures, dimensions, and their semantic metadata (SQL type, display name, format, time grains) are encoded at the type level.
94
+
95
+ If `metric-views.json` is absent the metric path stays dormant (nothing is emitted). When present it follows the **same** warehouse-readiness contract as query types: in the default non-blocking run a view that can't be described yet — a cold warehouse, or a bad/unreachable source — is written with permissive types and a warning, while under `--wait` that same situation fails the build so CI never ships incomplete metric types. A malformed `metric-views.json` (invalid JSON, or a source that isn't a three-part UC FQN) fails fast in every mode.
96
+
97
+ `metric-views.json` is keyed by metric key; each entry names the three-part UC FQN of the view and, optionally, the executor it runs as (`app_service_principal`, the default, or `user`):
98
+
99
+ ```json
100
+ {
101
+ "$schema": "https://databricks.github.io/appkit/schemas/metric-source.schema.json",
102
+ "metricViews": {
103
+ "revenue": { "source": "catalog.schema.revenue_metrics" },
104
+ "customers": {
105
+ "source": "catalog.schema.customer_metrics",
106
+ "executor": "user"
107
+ }
108
+ }
109
+ }
110
+
111
+ ```
112
+
113
+ The optional `$schema` line enables editor autocomplete and validation against the published schema.
114
+
89
115
  ## How it works[​](#how-it-works "Direct link to How it works")
90
116
 
91
117
  The type generator:
@@ -116,7 +142,7 @@ const { data } = useAnalyticsQuery("users_list", {
116
142
  });
117
143
 
118
144
  // TypeScript knows the shape of the result rows
119
- data?.forEach(row => {
145
+ data?.forEach((row) => {
120
146
  console.log(row.email); // ✓ autocomplete works
121
147
  });
122
148
 
package/llms.txt CHANGED
@@ -211,7 +211,6 @@ npx @databricks/appkit docs <query>
211
211
  - [Calendar](./docs/api/appkit-ui/ui/Calendar.md): Date picker component for selecting single dates or date ranges
212
212
  - [Card](./docs/api/appkit-ui/ui/Card.md): Container for grouping related content with header, body, and footer sections
213
213
  - [Carousel](./docs/api/appkit-ui/ui/Carousel.md): Slideshow component for cycling through content with navigation controls
214
- - [ChartContainer](./docs/api/appkit-ui/ui/ChartContainer.md): Container for rendering data visualizations using Recharts
215
214
  - [Checkbox](./docs/api/appkit-ui/ui/Checkbox.md): Checkbox input for selecting multiple options
216
215
  - [Collapsible](./docs/api/appkit-ui/ui/Collapsible.md): Interactive component that expands and collapses content
217
216
  - [Command](./docs/api/appkit-ui/ui/Command.md): Command palette for keyboard-driven navigation and actions
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@databricks/appkit-ui",
3
3
  "type": "module",
4
- "version": "0.43.0",
4
+ "version": "0.44.0",
5
5
  "license": "Apache-2.0",
6
+ "sideEffects": [
7
+ "**/*.css"
8
+ ],
6
9
  "repository": {
7
10
  "type": "git",
8
11
  "url": "git+https://github.com/databricks/appkit.git"
@@ -95,15 +98,13 @@
95
98
  },
96
99
  "peerDependencies": {
97
100
  "react": "^18.0.0 || ^19.0.0",
98
- "react-dom": "^18.0.0 || ^19.0.0",
99
- "recharts": "^2.0.0 || ^3.0.0"
101
+ "react-dom": "^18.0.0 || ^19.0.0"
100
102
  },
101
103
  "devDependencies": {
102
104
  "@types/react": "19.2.2",
103
105
  "@types/react-dom": "19.2.2",
104
106
  "react": "19.2.0",
105
107
  "react-dom": "19.2.0",
106
- "recharts": "2.15.4",
107
108
  "tailwindcss": "4.1.17",
108
109
  "tw-animate-css": "1.4.0"
109
110
  },