Skip to content

Commit 4dd1398

Browse files
chore(kumo): update Base UI to 1.6.0 (#598)
1 parent ff935c4 commit 4dd1398

7 files changed

Lines changed: 39 additions & 15 deletions

File tree

.changeset/fresh-otters-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/kumo": patch
3+
---
4+
5+
Update Base UI to 1.6.0.

packages/kumo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469
}
470470
},
471471
"dependencies": {
472-
"@base-ui/react": "^1.5.0",
472+
"@base-ui/react": "^1.6.0",
473473
"@shikijs/langs": "^4.0.0",
474474
"@shikijs/themes": "^4.0.0",
475475
"clsx": "^2.1.1",

packages/kumo/scripts/generate-primitives.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const EXCLUDED_EXPORTS = new Set([
3333
"./use-render", // Internal hook
3434
]);
3535

36+
const COMPATIBILITY_EXPORTS: Record<string, string[]> = {
37+
"otp-field": [
38+
'export { OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";',
39+
],
40+
};
41+
3642
function main() {
3743
// Read base-ui package.json
3844
if (!existsSync(BASE_UI_PACKAGE)) {
@@ -97,6 +103,7 @@ function generateBarrelExport(subpaths: string[]) {
97103
for (const subpath of subpaths) {
98104
const modulePath = `@base-ui/react/${subpath.replace("./", "")}`;
99105
lines.push(`export * from "${modulePath}";`);
106+
lines.push(...(COMPATIBILITY_EXPORTS[subpath.replace("./", "")] ?? []));
100107
}
101108
lines.push("");
102109

@@ -109,6 +116,7 @@ function generateIndividualPrimitives(subpaths: string[]) {
109116
const primitiveFile = join(PRIMITIVES_DIR, `${primitiveName}.ts`);
110117
const modulePath = `@base-ui/react/${primitiveName}`;
111118

119+
const compatibilityExports = COMPATIBILITY_EXPORTS[primitiveName] ?? [];
112120
const content = [
113121
"/**",
114122
` * ${primitiveName} primitive`,
@@ -123,6 +131,7 @@ function generateIndividualPrimitives(subpaths: string[]) {
123131
" */",
124132
"",
125133
`export * from "${modulePath}";`,
134+
...compatibilityExports,
126135
"",
127136
].join("\n");
128137

packages/kumo/src/primitives/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export * from "@base-ui/react/meter";
3737
export * from "@base-ui/react/navigation-menu";
3838
export * from "@base-ui/react/number-field";
3939
export * from "@base-ui/react/otp-field";
40+
export { OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";
4041
export * from "@base-ui/react/popover";
4142
export * from "@base-ui/react/preview-card";
4243
export * from "@base-ui/react/progress";

packages/kumo/src/primitives/otp-field.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
*/
1212

1313
export * from "@base-ui/react/otp-field";
14+
export { OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";

packages/kumo/tests/imports/primitives.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ try {
2727
const EXPORT_NAME_OVERRIDES: Record<string, string> = {
2828
"csp-provider": "CSPProvider", // All caps CSP
2929
drawer: "Drawer", // Stable in base-ui 1.4.0
30-
"otp-field": "OTPFieldPreview", // Preview component with all caps OTP
30+
"otp-field": "OTPField", // Stable component with all caps OTP
3131
};
3232

3333
// Exports excluded by generate-primitives.ts
@@ -123,6 +123,14 @@ describe("Primitives Export", () => {
123123
expect(missingExports).toEqual([]);
124124
});
125125

126+
it("should keep OTPFieldPreview as a compatibility alias", async () => {
127+
const barrelPrimitives = await import("../../src/primitives/index.ts");
128+
const otpFieldPrimitives = await import("../../src/primitives/otp-field.ts");
129+
130+
expect(barrelPrimitives.OTPFieldPreview).toBe(barrelPrimitives.OTPField);
131+
expect(otpFieldPrimitives.OTPFieldPreview).toBe(otpFieldPrimitives.OTPField);
132+
});
133+
126134
it("should re-export all non-excluded base-ui exports", () => {
127135
const baseUiPackage = JSON.parse(
128136
readFileSync(baseUiPackagePath, "utf-8"),

pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)