@oneplatformdev/ui 0.0.1-beta.5 → 0.0.1-beta.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.
@@ -1,99 +1,97 @@
1
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
- import { cloneElement as a, useId as y, Children as E } from "react";
3
- import { AlertDialogRoot as F, AlertDialogContent as h, AlertDialogTrigger as f, AlertDialogHeader as m, AlertDialogTitle as B, AlertDialogDescription as R, AlertDialogFooter as A, AlertDialogAction as C, AlertDialogCancel as k } from "./AlertDialogRoot.mjs";
4
- import { Button as x } from "../Button/Button.mjs";
5
- import "../Button/buttonVariants.mjs";
6
- import { isValidReactElement as l } from "@oneplatformdev/utils";
7
- const H = (n) => {
8
- const { slotProps: e = {}, children: r } = n, o = e.trigger ?? {};
9
- return l(r, f) ? a(
1
+ import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
+ import { cloneElement as a, useId as j, Children as y } from "react";
3
+ import { AlertDialogRoot as E, AlertDialogContent as u, AlertDialogTrigger as v, AlertDialogHeader as f, AlertDialogTitle as B, AlertDialogDescription as R, AlertDialogFooter as A, AlertDialogAction as D, AlertDialogCancel as k } from "./AlertDialogRoot.mjs";
4
+ import { isValidReactElement as s } from "@oneplatformdev/utils";
5
+ const F = (o) => {
6
+ const { slotProps: e = {}, children: r } = o, i = e.trigger ?? {};
7
+ return s(r, v) ? a(
10
8
  r,
11
9
  {
12
10
  ...r.props || {},
13
- ...o
11
+ ...i
14
12
  }
15
- ) : l(r, x) ? /* @__PURE__ */ t(f, { asChild: !0, ...o, children: r }) : /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(x, { variant: "outline", ...o, children: r }) });
16
- }, I = (n) => {
13
+ ) : /* @__PURE__ */ t(v, { asChild: !0, children: r });
14
+ }, H = (o) => {
17
15
  const {
18
16
  title: e = "",
19
17
  description: r = "",
20
- slotProps: o = {},
21
- children: c
22
- } = n, i = o.header ?? {}, d = o.title ?? {}, s = o.description ?? {};
23
- return c ? l(c, m) ? a(
24
- c,
25
- { ...c.props || {}, ...i }
26
- ) : /* @__PURE__ */ t(m, { ...i, children: c }) : /* @__PURE__ */ u(m, { children: [
27
- e && l(e, B) ? a(
18
+ slotProps: i = {},
19
+ children: l
20
+ } = o, n = i.header ?? {}, d = i.title ?? {}, c = i.description ?? {};
21
+ return l ? s(l, f) ? a(
22
+ l,
23
+ { ...l.props || {}, ...n }
24
+ ) : /* @__PURE__ */ t(f, { ...n, children: l }) : /* @__PURE__ */ g(f, { children: [
25
+ e && s(e, B) ? a(
28
26
  e,
29
27
  { ...e.props || {}, ...d }
30
28
  ) : /* @__PURE__ */ t(B, { ...d, children: e }),
31
- r && l(r, R) ? a(
29
+ r && s(r, R) ? a(
32
30
  r,
33
- { ...r.props || {}, ...s }
34
- ) : /* @__PURE__ */ t(R, { ...s, children: r })
31
+ { ...r.props || {}, ...c }
32
+ ) : /* @__PURE__ */ t(R, { ...c, children: r })
35
33
  ] });
36
- }, L = (n) => {
34
+ }, I = (o) => {
37
35
  const {
38
36
  slotProps: e = {},
39
37
  children: r,
40
- onCancel: o,
41
- onConfirm: c,
42
- cancelLabel: i = "Cancel",
38
+ onCancel: i,
39
+ onConfirm: l,
40
+ cancelLabel: n = "Cancel",
43
41
  actionLabel: d = "Continue",
44
- variant: s = "confirm"
45
- } = n, T = y(), D = e.footer ?? {}, b = e.cancelButton ?? {}, P = e.actionButton ?? {};
46
- return r ? l(r, A) ? a(
42
+ variant: c = "confirm"
43
+ } = o, x = j(), m = e.footer ?? {}, T = e.cancelButton ?? {}, C = e.actionButton ?? {};
44
+ return r ? s(r, A) ? a(
47
45
  r,
48
- { ...r.props || {}, ...D }
49
- ) : /* @__PURE__ */ t(A, { ...D, children: E.map(r, (p, j) => {
50
- if (!p || !l(p)) return;
51
- const g = p, v = a(g, { ...g.props || {}, key: g.key || `footer-${T}-action-${j}` });
52
- return l(p, C) || l(p, k) ? v : /* @__PURE__ */ t(C, { asChild: !0, children: v });
53
- }) }) : /* @__PURE__ */ u(A, { children: [
54
- s !== "alert" && /* @__PURE__ */ t(
46
+ { ...r.props || {}, ...m }
47
+ ) : /* @__PURE__ */ t(A, { ...m, children: y.map(r, (p, b) => {
48
+ if (!p || !s(p)) return;
49
+ const h = p, P = a(h, { ...h.props || {}, key: h.key || `footer-${x}-action-${b}` });
50
+ return s(p, D) || s(p, k) ? P : /* @__PURE__ */ t(D, { asChild: !0, children: P });
51
+ }) }) : /* @__PURE__ */ g(A, { children: [
52
+ c !== "alert" && /* @__PURE__ */ t(
55
53
  k,
56
54
  {
57
55
  variant: "ghost",
58
- onClick: o,
59
- ...b,
60
- children: i
56
+ onClick: i,
57
+ ...T,
58
+ children: n
61
59
  }
62
60
  ),
63
61
  /* @__PURE__ */ t(
64
- C,
62
+ D,
65
63
  {
66
- onClick: c,
67
- ...P,
68
- variant: P.variant || s === "destructive" ? "destructive" : "default",
64
+ onClick: l,
65
+ ...C,
66
+ variant: C.variant || c === "destructive" ? "destructive" : "default",
69
67
  children: d
70
68
  }
71
69
  )
72
70
  ] });
73
- }, J = (n) => {
71
+ }, w = (o) => {
74
72
  const {
75
73
  trigger: e,
76
74
  header: r,
77
- footer: o,
78
- slotProps: c = {},
79
- children: i,
75
+ footer: i,
76
+ slotProps: l = {},
77
+ children: n,
80
78
  ...d
81
- } = n, s = c.content ?? {};
82
- return /* @__PURE__ */ u(F, { ...d, children: [
83
- /* @__PURE__ */ t(H, { ...n, children: e }),
84
- i ? l(i, h) ? a(
85
- i,
79
+ } = o, c = l.content ?? {};
80
+ return /* @__PURE__ */ g(E, { ...d, children: [
81
+ /* @__PURE__ */ t(F, { ...o, children: e }),
82
+ n ? s(n, u) ? a(
83
+ n,
86
84
  {
87
- ...i.props || {},
88
- ...s
85
+ ...n.props || {},
86
+ ...c
89
87
  }
90
- ) : /* @__PURE__ */ t(h, { ...s, children: i }) : /* @__PURE__ */ u(h, { ...s, children: [
91
- /* @__PURE__ */ t(I, { ...n, children: r }),
92
- /* @__PURE__ */ t(L, { ...n, children: o })
88
+ ) : /* @__PURE__ */ t(u, { ...c, children: n }) : /* @__PURE__ */ g(u, { ...c, children: [
89
+ /* @__PURE__ */ t(H, { ...o, children: r }),
90
+ /* @__PURE__ */ t(I, { ...o, children: i })
93
91
  ] })
94
92
  ] });
95
93
  };
96
94
  export {
97
- J as AlertDialog,
98
- J as default
95
+ w as AlertDialog,
96
+ w as default
99
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.5",
3
+ "version": "0.0.1-beta.7",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [