@mhome/ui 0.1.6 → 0.1.7
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 +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/date-picker.jsx +18 -1
package/package.json
CHANGED
|
@@ -2,7 +2,24 @@ 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
|
+
// Handle dayjs import - it may be a function or an object with default
|
|
6
|
+
// Ensure dayjs is a function at runtime
|
|
7
|
+
const getDayjs = () => {
|
|
8
|
+
if (typeof dayjsModule === "function") {
|
|
9
|
+
return dayjsModule;
|
|
10
|
+
}
|
|
11
|
+
if (dayjsModule.default && typeof dayjsModule.default === "function") {
|
|
12
|
+
return dayjsModule.default;
|
|
13
|
+
}
|
|
14
|
+
// Fallback: try to get the function from the module
|
|
15
|
+
const dayjsFn = dayjsModule.default || dayjsModule;
|
|
16
|
+
if (typeof dayjsFn === "function") {
|
|
17
|
+
return dayjsFn;
|
|
18
|
+
}
|
|
19
|
+
// Last resort: if it's an object, try to access the function
|
|
20
|
+
return dayjsFn;
|
|
21
|
+
};
|
|
22
|
+
const dayjs = getDayjs();
|
|
6
23
|
|
|
7
24
|
const DatePicker = React.forwardRef(
|
|
8
25
|
(
|