@arcadeai/design-system 7.9.2 → 7.9.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/date-time-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/date-time-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAS1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAE5E,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,aAAa,EACjB,EAAE,mBAAmB,+BAuErB;yBA5Ee,cAAc"}
|
|
@@ -3,70 +3,70 @@ import { n as t, o as n, t as r } from "../../../popover-CpLkQtT5.js";
|
|
|
3
3
|
import { r as i, t as a } from "../../../calendar-Ctzadwv-.js";
|
|
4
4
|
import { t as o } from "../../../input-DZTqcpe-.js";
|
|
5
5
|
import { Label as s } from "../atoms/label.js";
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { ChevronDownIcon as
|
|
6
|
+
import { useId as c, useState as l } from "react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { ChevronDownIcon as f } from "lucide-react";
|
|
9
9
|
//#region lib/components/ui/molecules/date-time-picker.tsx
|
|
10
|
-
function
|
|
11
|
-
let [
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
className:
|
|
14
|
-
children: /* @__PURE__ */
|
|
10
|
+
function p({ value: p, onChange: m, className: h, ...g }) {
|
|
11
|
+
let [_, v] = l(!1), y = c(), b = c(), x = p ? i(p, "HH:mm:ss") : "";
|
|
12
|
+
return /* @__PURE__ */ u("div", {
|
|
13
|
+
className: h,
|
|
14
|
+
children: /* @__PURE__ */ d("div", {
|
|
15
15
|
className: "flex gap-4",
|
|
16
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ d("div", {
|
|
17
17
|
className: "flex flex-col gap-3",
|
|
18
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ d(s, {
|
|
19
19
|
className: "px-1",
|
|
20
|
-
htmlFor:
|
|
20
|
+
htmlFor: y,
|
|
21
21
|
children: ["Date:", " "]
|
|
22
|
-
}), /* @__PURE__ */
|
|
23
|
-
onOpenChange:
|
|
24
|
-
open:
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
render: /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ d(r, {
|
|
23
|
+
onOpenChange: v,
|
|
24
|
+
open: _,
|
|
25
|
+
children: [/* @__PURE__ */ d(n, {
|
|
26
|
+
render: /* @__PURE__ */ u(e, {
|
|
27
27
|
className: "w-32 justify-between font-normal",
|
|
28
|
-
id:
|
|
28
|
+
id: y,
|
|
29
29
|
size: "lg",
|
|
30
30
|
variant: "outline"
|
|
31
31
|
}),
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
-
}), /* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ u("span", { children: p ? p.toLocaleDateString() : "Select date" }), /* @__PURE__ */ u(f, {})]
|
|
33
|
+
}), /* @__PURE__ */ u(t, {
|
|
34
34
|
align: "start",
|
|
35
35
|
className: "w-auto overflow-hidden p-0",
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ u(a, {
|
|
37
37
|
captionLayout: "dropdown",
|
|
38
38
|
mode: "single",
|
|
39
39
|
onSelect: (e) => {
|
|
40
|
-
|
|
40
|
+
m?.(e), v(!1);
|
|
41
41
|
},
|
|
42
|
-
selected:
|
|
43
|
-
...
|
|
42
|
+
selected: p,
|
|
43
|
+
...g
|
|
44
44
|
})
|
|
45
45
|
})]
|
|
46
46
|
})]
|
|
47
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ d("div", {
|
|
48
48
|
className: "flex flex-col gap-3",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ d(s, {
|
|
50
50
|
className: "px-1",
|
|
51
|
-
htmlFor:
|
|
51
|
+
htmlFor: b,
|
|
52
52
|
children: ["Time:", " "]
|
|
53
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ u(o, {
|
|
54
54
|
className: "appearance-none bg-background [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
|
|
55
|
-
id:
|
|
55
|
+
id: b,
|
|
56
56
|
onChange: (e) => {
|
|
57
57
|
let t = e.target.value;
|
|
58
|
-
if (!(t &&
|
|
59
|
-
let [n, r, i] = t.split(":").map(Number), a = new Date(
|
|
60
|
-
a.setHours(n, r, i || 0),
|
|
58
|
+
if (!(t && p)) return;
|
|
59
|
+
let [n, r, i] = t.split(":").map(Number), a = new Date(p);
|
|
60
|
+
a.setHours(n, r, i || 0), m?.(a);
|
|
61
61
|
},
|
|
62
62
|
step: "1",
|
|
63
63
|
type: "time",
|
|
64
|
-
value:
|
|
64
|
+
value: x
|
|
65
65
|
})]
|
|
66
66
|
})]
|
|
67
67
|
})
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
p.displayName = "DateTimePicker";
|
|
71
71
|
//#endregion
|
|
72
|
-
export {
|
|
72
|
+
export { p as DateTimePicker };
|