@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "mHome UI Component Library",
6
6
  "main": "dist/index.cjs.js",
@@ -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
- const dayjs = dayjsModule.default || dayjsModule;
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
  (