@mhome/ui 0.1.8 → 0.1.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/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/date-picker.jsx +20 -1
package/package.json
CHANGED
|
@@ -2,7 +2,26 @@ import * as React from "react";
|
|
|
2
2
|
import { cn } from "../lib/utils";
|
|
3
3
|
import { TextField } from "./text-field";
|
|
4
4
|
import * as dayjsModule from "dayjs";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
// Ensure dayjs is a function at runtime
|
|
7
|
+
// Handle both ESM and CJS dayjs exports
|
|
8
|
+
let dayjs;
|
|
9
|
+
if (typeof dayjsModule === "function") {
|
|
10
|
+
dayjs = dayjsModule;
|
|
11
|
+
} else if (dayjsModule.default && typeof dayjsModule.default === "function") {
|
|
12
|
+
dayjs = dayjsModule.default;
|
|
13
|
+
} else {
|
|
14
|
+
// Fallback: try to get the function from the module
|
|
15
|
+
dayjs = dayjsModule.default || dayjsModule;
|
|
16
|
+
// If still not a function, this is an error
|
|
17
|
+
if (typeof dayjs !== "function") {
|
|
18
|
+
console.error("dayjs is not a function. Module:", dayjsModule);
|
|
19
|
+
// Create a fallback that throws an error
|
|
20
|
+
dayjs = function() {
|
|
21
|
+
throw new Error("dayjs is not properly initialized");
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
6
25
|
|
|
7
26
|
const DatePicker = React.forwardRef(
|
|
8
27
|
(
|