@oneplatformdev/ui 0.0.1-beta.46 → 0.0.1-beta.47

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.
@@ -13,8 +13,8 @@ const r = e(
13
13
  },
14
14
  size: {
15
15
  default: "h-9 px-4 py-2",
16
- sm: "h-8 rounded-md px-3 text-xs",
17
- lg: "h-10 rounded-md px-8",
16
+ sm: "h-8 rounded-md px-3 text-xs size-4",
17
+ lg: "h-10 rounded-md px-8 size-5 px-3 py-2",
18
18
  icon: "h-9 w-9"
19
19
  }
20
20
  },
@@ -1,5 +1,5 @@
1
1
  import { DialogProps } from '@radix-ui/react-dialog';
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
  declare const Command: React.ForwardRefExoticComponent<Omit<{
4
4
  children?: React.ReactNode;
5
5
  } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
@@ -3,7 +3,8 @@ import * as m from "react";
3
3
  import { Command as o } from "cmdk";
4
4
  import { Search as p } from "lucide-react";
5
5
  import { cn as r } from "@oneplatformdev/utils";
6
- import { Dialog as i, DialogContent as c } from "../Dialog/Dialog.mjs";
6
+ import { DialogRoot as i, DialogContent as c } from "../Dialog/DialogRoot.mjs";
7
+ import "../Dialog/Dialog.mjs";
7
8
  const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
8
9
  o,
9
10
  {
@@ -16,7 +17,7 @@ const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
16
17
  }
17
18
  ));
18
19
  n.displayName = o.displayName;
19
- const C = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @__PURE__ */ t(c, { className: "overflow-hidden p-0", children: /* @__PURE__ */ t(n, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), l = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ s("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
20
+ const b = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @__PURE__ */ t(c, { className: "overflow-hidden p-0", children: /* @__PURE__ */ t(n, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), l = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ s("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
20
21
  /* @__PURE__ */ t(p, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
21
22
  /* @__PURE__ */ t(
22
23
  o.Input,
@@ -98,7 +99,7 @@ const y = ({
98
99
  y.displayName = "CommandShortcut";
99
100
  export {
100
101
  n as Command,
101
- C as CommandDialog,
102
+ b as CommandDialog,
102
103
  f as CommandEmpty,
103
104
  g as CommandGroup,
104
105
  l as CommandInput,
@@ -1,19 +1,3 @@
1
- import * as React from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
3
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
- declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const DialogHeader: {
10
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- declare const DialogFooter: {
14
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
- displayName: string;
16
- };
17
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
- export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
1
+ import { IDialogProps } from './Dialog.types';
2
+
3
+ export declare const Dialog: import('react').ForwardRefExoticComponent<IDialogProps & import('react').RefAttributes<never>>;
package/Dialog/Dialog.mjs CHANGED
@@ -1,100 +1,19 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import * as e from "@radix-ui/react-dialog";
4
- import { X as c } from "lucide-react";
5
- import { cn as i } from "@oneplatformdev/utils";
6
- const b = e.Root, h = e.Trigger, m = e.Portal, v = e.Close, d = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
7
- e.Overlay,
8
- {
9
- ref: s,
10
- className: i(
11
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
12
- a
13
- ),
14
- ...t
15
- }
16
- ));
17
- d.displayName = e.Overlay.displayName;
18
- const f = l.forwardRef(({ className: a, children: t, ...s }, r) => /* @__PURE__ */ n(m, { children: [
19
- /* @__PURE__ */ o(d, {}),
20
- /* @__PURE__ */ n(
21
- e.Content,
22
- {
23
- ref: r,
24
- className: i(
25
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
26
- a
27
- ),
28
- ...s,
29
- children: [
30
- t,
31
- /* @__PURE__ */ n(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
32
- /* @__PURE__ */ o(c, { className: "h-4 w-4" }),
33
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
34
- ] })
35
- ]
36
- }
37
- )
38
- ] }));
39
- f.displayName = e.Content.displayName;
40
- const p = ({
41
- className: a,
42
- ...t
43
- }) => /* @__PURE__ */ o(
44
- "div",
45
- {
46
- className: i(
47
- "flex flex-col space-y-1.5 text-center sm:text-left",
48
- a
49
- ),
50
- ...t
51
- }
52
- );
53
- p.displayName = "DialogHeader";
54
- const g = ({
55
- className: a,
56
- ...t
57
- }) => /* @__PURE__ */ o(
58
- "div",
59
- {
60
- className: i(
61
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
62
- a
63
- ),
64
- ...t
1
+ import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
+ import { forwardRef as t } from "react";
3
+ import { DialogRoot as l, DialogContent as n, DialogHeader as a, DialogTitle as s, DialogDescription as c, DialogFooter as m } from "./DialogRoot.mjs";
4
+ const h = t(
5
+ (e, d) => {
6
+ const { ...i } = e;
7
+ return /* @__PURE__ */ o(l, { ...i, children: /* @__PURE__ */ r(n, { className: "sm:max-w-[600px]", children: [
8
+ /* @__PURE__ */ r(a, { children: [
9
+ /* @__PURE__ */ o(s, { children: "title" }),
10
+ /* @__PURE__ */ o(c, { children: "subtitle" })
11
+ ] }),
12
+ "Content",
13
+ /* @__PURE__ */ o(m, { children: "footer" })
14
+ ] }) });
65
15
  }
66
16
  );
67
- g.displayName = "DialogFooter";
68
- const u = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
69
- e.Title,
70
- {
71
- ref: s,
72
- className: i(
73
- "text-lg font-semibold leading-none tracking-tight",
74
- a
75
- ),
76
- ...t
77
- }
78
- ));
79
- u.displayName = e.Title.displayName;
80
- const y = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
81
- e.Description,
82
- {
83
- ref: s,
84
- className: i("text-sm text-muted-foreground", a),
85
- ...t
86
- }
87
- ));
88
- y.displayName = e.Description.displayName;
89
17
  export {
90
- b as Dialog,
91
- v as DialogClose,
92
- f as DialogContent,
93
- y as DialogDescription,
94
- g as DialogFooter,
95
- p as DialogHeader,
96
- d as DialogOverlay,
97
- m as DialogPortal,
98
- u as DialogTitle,
99
- h as DialogTrigger
18
+ h as Dialog
100
19
  };
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { DialogRoot } from './DialogRoot';
3
+
4
+ export interface IDialogProps extends ComponentPropsWithoutRef<typeof DialogRoot> {
5
+ children: ReactNode;
6
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ declare const DialogRoot: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DialogHeader: {
10
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ declare const DialogFooter: {
14
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
+ export { DialogRoot, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,100 @@
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import * as e from "@radix-ui/react-dialog";
4
+ import { X as c } from "lucide-react";
5
+ import { cn as i } from "@oneplatformdev/utils";
6
+ const b = e.Root, h = e.Trigger, m = e.Portal, v = e.Close, d = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
7
+ e.Overlay,
8
+ {
9
+ ref: s,
10
+ className: i(
11
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
12
+ a
13
+ ),
14
+ ...t
15
+ }
16
+ ));
17
+ d.displayName = e.Overlay.displayName;
18
+ const f = l.forwardRef(({ className: a, children: t, ...s }, r) => /* @__PURE__ */ n(m, { children: [
19
+ /* @__PURE__ */ o(d, {}),
20
+ /* @__PURE__ */ n(
21
+ e.Content,
22
+ {
23
+ ref: r,
24
+ className: i(
25
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
26
+ a
27
+ ),
28
+ ...s,
29
+ children: [
30
+ t,
31
+ /* @__PURE__ */ n(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
32
+ /* @__PURE__ */ o(c, { className: "h-4 w-4" }),
33
+ /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
34
+ ] })
35
+ ]
36
+ }
37
+ )
38
+ ] }));
39
+ f.displayName = e.Content.displayName;
40
+ const p = ({
41
+ className: a,
42
+ ...t
43
+ }) => /* @__PURE__ */ o(
44
+ "div",
45
+ {
46
+ className: i(
47
+ "flex flex-col space-y-1.5 text-center sm:text-left",
48
+ a
49
+ ),
50
+ ...t
51
+ }
52
+ );
53
+ p.displayName = "DialogHeader";
54
+ const g = ({
55
+ className: a,
56
+ ...t
57
+ }) => /* @__PURE__ */ o(
58
+ "div",
59
+ {
60
+ className: i(
61
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
62
+ a
63
+ ),
64
+ ...t
65
+ }
66
+ );
67
+ g.displayName = "DialogFooter";
68
+ const u = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
69
+ e.Title,
70
+ {
71
+ ref: s,
72
+ className: i(
73
+ "text-lg font-semibold leading-none tracking-tight",
74
+ a
75
+ ),
76
+ ...t
77
+ }
78
+ ));
79
+ u.displayName = e.Title.displayName;
80
+ const y = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
81
+ e.Description,
82
+ {
83
+ ref: s,
84
+ className: i("text-sm text-muted-foreground", a),
85
+ ...t
86
+ }
87
+ ));
88
+ y.displayName = e.Description.displayName;
89
+ export {
90
+ v as DialogClose,
91
+ f as DialogContent,
92
+ y as DialogDescription,
93
+ g as DialogFooter,
94
+ p as DialogHeader,
95
+ d as DialogOverlay,
96
+ m as DialogPortal,
97
+ b as DialogRoot,
98
+ u as DialogTitle,
99
+ h as DialogTrigger
100
+ };
package/Dialog/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from './DialogRoot';
1
2
  export * from './Dialog';
package/Dialog/index.mjs CHANGED
@@ -1,13 +1,15 @@
1
- import { Dialog as l, DialogClose as a, DialogContent as g, DialogDescription as D, DialogFooter as e, DialogHeader as r, DialogOverlay as t, DialogPortal as n, DialogTitle as p, DialogTrigger as s } from "./Dialog.mjs";
1
+ import { DialogClose as l, DialogContent as a, DialogDescription as g, DialogFooter as D, DialogHeader as e, DialogOverlay as r, DialogPortal as t, DialogRoot as n, DialogTitle as p, DialogTrigger as f } from "./DialogRoot.mjs";
2
+ import { Dialog as s } from "./Dialog.mjs";
2
3
  export {
3
- l as Dialog,
4
- a as DialogClose,
5
- g as DialogContent,
6
- D as DialogDescription,
7
- e as DialogFooter,
8
- r as DialogHeader,
9
- t as DialogOverlay,
10
- n as DialogPortal,
4
+ s as Dialog,
5
+ l as DialogClose,
6
+ a as DialogContent,
7
+ g as DialogDescription,
8
+ D as DialogFooter,
9
+ e as DialogHeader,
10
+ r as DialogOverlay,
11
+ t as DialogPortal,
12
+ n as DialogRoot,
11
13
  p as DialogTitle,
12
- s as DialogTrigger
14
+ f as DialogTrigger
13
15
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as u, Fragment as p, jsx as h } from "react/jsx-runtime";
1
+ import { jsxs as u, Fragment as h, jsx as p } from "react/jsx-runtime";
2
2
  import * as v from "react";
3
3
  import { useId as w, useRef as z, useState as A, useImperativeHandle as N, useEffect as y } from "react";
4
4
  import { cn as d } from "@oneplatformdev/utils";
@@ -31,8 +31,8 @@ const T = v.forwardRef(
31
31
  minHeight: o
32
32
  })), y(() => {
33
33
  b(r);
34
- }, [e == null ? void 0 : e.defaultValue, r]), /* @__PURE__ */ u(p, { children: [
35
- /* @__PURE__ */ h(
34
+ }, [e == null ? void 0 : e.defaultValue, r]), /* @__PURE__ */ u(h, { children: [
35
+ /* @__PURE__ */ p(
36
36
  "textarea",
37
37
  {
38
38
  id: n || a,
@@ -43,7 +43,7 @@ const T = v.forwardRef(
43
43
  "flex min-h-10 w-full px-3 py-2 text-base relative",
44
44
  "rounded-md border border-input bg-transparent shadow-sm",
45
45
  "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
46
- g ? "resize" : "resize-none",
46
+ g ? "resize" : "resize-none !overflow-hidden",
47
47
  s && "pb-2",
48
48
  f
49
49
  )