@databricks/appkit 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.
- package/CLAUDE.md +0 -1
- package/NOTICE.md +1 -0
- package/dist/appkit/package.js +1 -1
- package/dist/cli/commands/generate-types.js +5 -0
- package/dist/cli/commands/generate-types.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/plugins/analytics/query.js +0 -1
- package/dist/plugins/analytics/query.js.map +1 -1
- package/dist/type-generator/cache.js +1 -6
- package/dist/type-generator/cache.js.map +1 -1
- package/dist/type-generator/index.js +162 -146
- package/dist/type-generator/index.js.map +1 -1
- package/dist/type-generator/mv-registry/config.js +5 -5
- package/dist/type-generator/mv-registry/config.js.map +1 -1
- package/dist/type-generator/mv-registry/render-types.js.map +1 -1
- package/dist/type-generator/vite-plugin.d.ts +0 -7
- package/dist/type-generator/vite-plugin.d.ts.map +1 -1
- package/dist/type-generator/vite-plugin.js +1 -4
- package/dist/type-generator/vite-plugin.js.map +1 -1
- package/docs/api/appkit-ui/ui/ContextMenu.md +2 -2
- package/docs/api/appkit-ui/ui/Drawer.md +0 -56
- package/docs/api/appkit-ui/ui/DropdownMenu.md +3 -3
- package/docs/api/appkit-ui/ui/HoverCard.md +2 -2
- package/docs/api/appkit-ui/ui/Menubar.md +3 -3
- package/docs/api/appkit-ui/ui/Popover.md +2 -2
- package/docs/api/appkit-ui/ui/Select.md +2 -2
- package/docs/api/appkit-ui/ui/Tooltip.md +2 -2
- package/docs/development/type-generation.md +28 -2
- package/llms.txt +0 -1
- package/package.json +3 -2
- package/sbom.cdx.json +1 -1
- package/dist/shared/src/index.js +0 -4
- package/dist/shared/src/sql/index.js +0 -3
- package/dist/type-generator/mv-registry/metadata.js +0 -40
- package/dist/type-generator/mv-registry/metadata.js.map +0 -1
- package/docs/api/appkit-ui/ui/ChartContainer.md +0 -343
|
@@ -90,14 +90,14 @@ import { HoverCard } from '@databricks/appkit-ui';
|
|
|
90
90
|
| `onFocusOutside` | `((event: FocusOutsideEvent) => void)` | | - | Event handler called when the focus moves outside of the `HoverCard`. Can be prevented. |
|
|
91
91
|
| `onInteractOutside` | `((event: FocusOutsideEvent \| PointerDownOutsideEvent) => void)` | | - | Event handler called when an interaction happens outside the `HoverCard`. Specifically, when a `pointerdown` event happens outside or focus moves outside of it. Can be prevented. |
|
|
92
92
|
| `asChild` | `boolean` | | - | - |
|
|
93
|
-
| `align` | `enum` | | - | - |
|
|
94
93
|
| `side` | `enum` | | - | - |
|
|
95
94
|
| `sideOffset` | `number` | | - | - |
|
|
95
|
+
| `align` | `enum` | | - | - |
|
|
96
96
|
| `alignOffset` | `number` | | - | - |
|
|
97
97
|
| `arrowPadding` | `number` | | - | - |
|
|
98
98
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
99
99
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
100
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
100
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
101
101
|
| `sticky` | `enum` | | - | - |
|
|
102
102
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
103
103
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -183,14 +183,14 @@ import { MenubarCheckboxItem } from '@databricks/appkit-ui';
|
|
|
183
183
|
| `onInteractOutside` | `((event: FocusOutsideEvent \| PointerDownOutsideEvent) => void)` | | - | - |
|
|
184
184
|
| `onCloseAutoFocus` | `((event: Event) => void)` | | - | Event handler called when auto-focusing on close. Can be prevented. |
|
|
185
185
|
| `loop` | `boolean` | | - | Whether keyboard navigation should loop around @defaultValue false |
|
|
186
|
-
| `align` | `enum` | | - | - |
|
|
187
186
|
| `side` | `enum` | | - | - |
|
|
188
187
|
| `sideOffset` | `number` | | - | - |
|
|
188
|
+
| `align` | `enum` | | - | - |
|
|
189
189
|
| `alignOffset` | `number` | | - | - |
|
|
190
190
|
| `arrowPadding` | `number` | | - | - |
|
|
191
191
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
192
192
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
193
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
193
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
194
194
|
| `sticky` | `enum` | | - | - |
|
|
195
195
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
196
196
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -428,7 +428,7 @@ import { MenubarSub } from '@databricks/appkit-ui';
|
|
|
428
428
|
| `arrowPadding` | `number` | | - | - |
|
|
429
429
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
430
430
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
431
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
431
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
432
432
|
| `sticky` | `enum` | | - | - |
|
|
433
433
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
434
434
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -132,14 +132,14 @@ import { PopoverAnchor } from '@databricks/appkit-ui';
|
|
|
132
132
|
| `onInteractOutside` | `((event: FocusOutsideEvent \| PointerDownOutsideEvent) => void)` | | - | Event handler called when an interaction happens outside the `DismissableLayer`. Specifically, when a `pointerdown` event happens outside or focus moves outside of it. Can be prevented. |
|
|
133
133
|
| `onOpenAutoFocus` | `((event: Event) => void)` | | - | Event handler called when auto-focusing on open. Can be prevented. |
|
|
134
134
|
| `onCloseAutoFocus` | `((event: Event) => void)` | | - | Event handler called when auto-focusing on close. Can be prevented. |
|
|
135
|
-
| `align` | `enum` | | - | - |
|
|
136
135
|
| `side` | `enum` | | - | - |
|
|
137
136
|
| `sideOffset` | `number` | | - | - |
|
|
137
|
+
| `align` | `enum` | | - | - |
|
|
138
138
|
| `alignOffset` | `number` | | - | - |
|
|
139
139
|
| `arrowPadding` | `number` | | - | - |
|
|
140
140
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
141
141
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
142
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
142
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
143
143
|
| `sticky` | `enum` | | - | - |
|
|
144
144
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
145
145
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -86,14 +86,14 @@ import { Select } from '@databricks/appkit-ui';
|
|
|
86
86
|
| `onPointerDownOutside` | `((event: PointerDownOutsideEvent) => void)` | | - | Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented. |
|
|
87
87
|
| `position` | `enum` | | `popper` | - |
|
|
88
88
|
| `asChild` | `boolean` | | - | - |
|
|
89
|
-
| `align` | `enum` | | - | - |
|
|
90
89
|
| `side` | `enum` | | - | - |
|
|
91
90
|
| `sideOffset` | `number` | | - | - |
|
|
91
|
+
| `align` | `enum` | | - | - |
|
|
92
92
|
| `alignOffset` | `number` | | - | - |
|
|
93
93
|
| `arrowPadding` | `number` | | - | - |
|
|
94
94
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
95
95
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
96
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
96
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
97
97
|
| `sticky` | `enum` | | - | - |
|
|
98
98
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
99
99
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -70,14 +70,14 @@ import { Tooltip } from '@databricks/appkit-ui';
|
|
|
70
70
|
| `onEscapeKeyDown` | `((event: KeyboardEvent) => void)` | | - | Event handler called when the escape key is down. Can be prevented. |
|
|
71
71
|
| `onPointerDownOutside` | `((event: PointerDownOutsideEvent) => void)` | | - | Event handler called when the a `pointerdown` event happens outside of the `Tooltip`. Can be prevented. |
|
|
72
72
|
| `asChild` | `boolean` | | - | - |
|
|
73
|
-
| `align` | `enum` | | - | - |
|
|
74
73
|
| `side` | `enum` | | - | - |
|
|
75
74
|
| `sideOffset` | `number` | | - | - |
|
|
75
|
+
| `align` | `enum` | | - | - |
|
|
76
76
|
| `alignOffset` | `number` | | - | - |
|
|
77
77
|
| `arrowPadding` | `number` | | - | - |
|
|
78
78
|
| `avoidCollisions` | `boolean` | | - | - |
|
|
79
79
|
| `collisionBoundary` | `Boundary \| Boundary[]` | | - | - |
|
|
80
|
-
| `collisionPadding` | `number \| Partial<Record<"
|
|
80
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "right" \| "bottom" \| "left", number>>` | | - | - |
|
|
81
81
|
| `sticky` | `enum` | | - | - |
|
|
82
82
|
| `hideWhenDetached` | `boolean` | | - | - |
|
|
83
83
|
| `updatePositionStrategy` | `enum` | | - | - |
|
|
@@ -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
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/appkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@ast-grep/napi": "0.37.0",
|
|
50
|
-
"@databricks/lakebase": "0.
|
|
50
|
+
"@databricks/lakebase": "0.5.0",
|
|
51
51
|
"@databricks/sdk-experimental": "0.17.0",
|
|
52
52
|
"@opentelemetry/api": "1.9.0",
|
|
53
53
|
"@opentelemetry/api-logs": "0.219.0",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@types/semver": "7.7.1",
|
|
68
68
|
"apache-arrow": "21.1.0",
|
|
69
69
|
"dotenv": "16.6.1",
|
|
70
|
+
"drizzle-orm": "0.45.1",
|
|
70
71
|
"express": "4.22.2",
|
|
71
72
|
"get-port": "7.2.0",
|
|
72
73
|
"js-yaml": "4.2.0",
|