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