@oneplatformdev/ui 0.1.99-beta.75 → 0.1.99-beta.77
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/CHANGELOG.md +16 -0
- package/Dialog/Dialog.d.ts +1 -1
- package/Dialog/Dialog.d.ts.map +1 -1
- package/Dialog/Dialog.js +58 -37
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +99 -0
- package/Dialog/Dialog.stories.js.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.1.99-beta.76 (2026-01-16)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- enhance Combobox with additional default node properties and improve type safety ([485b114](https://github.com/oneplatformdev/core-web/commit/485b114))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.76
|
|
10
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.76
|
|
11
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.76
|
|
12
|
+
|
|
13
|
+
### ❤️ Thank You
|
|
14
|
+
|
|
15
|
+
- Bohdan Radchenko
|
|
16
|
+
|
|
1
17
|
## 0.1.99-beta.75 (2026-01-16)
|
|
2
18
|
|
|
3
19
|
### 🧱 Updated Dependencies
|
package/Dialog/Dialog.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function DialogContent(props: React.ComponentProps<typeof DialogPrimitiv
|
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function DialogTitle(
|
|
13
|
+
declare function DialogTitle(props: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogPrimitive };
|
|
16
16
|
//# sourceMappingURL=Dialog.d.ts.map
|
package/Dialog/Dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,iBAAS,MAAM,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnE;AAED,iBAAS,aAAa,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAE7E;AAED,iBAAS,YAAY,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAE3E;AAED,iBAAS,WAAW,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEzE;AAED,iBAAS,aAAa,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAW7E;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACnF,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,2CAwDA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CA2B7E;AAED,iBAAS,iBAAiB,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,2CAYrF;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EAChB,CAAA"}
|
package/Dialog/Dialog.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "@radix-ui/react-dialog";
|
|
3
|
-
import { XIcon as
|
|
3
|
+
import { XIcon as d } from "lucide-react";
|
|
4
4
|
import { cn as n } from "@oneplatformdev/utils";
|
|
5
|
-
|
|
5
|
+
import { ButtonIcon as u } from "../ButtonIcon/ButtonIcon.js";
|
|
6
|
+
import "../ButtonIcon/buttonIconVariants.js";
|
|
7
|
+
function b({
|
|
6
8
|
...t
|
|
7
9
|
}) {
|
|
8
10
|
return /* @__PURE__ */ e(a.Root, { "data-slot": "dialog", ...t });
|
|
9
11
|
}
|
|
10
|
-
function
|
|
12
|
+
function y({
|
|
11
13
|
...t
|
|
12
14
|
}) {
|
|
13
15
|
return /* @__PURE__ */ e(a.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function f({
|
|
16
18
|
...t
|
|
17
19
|
}) {
|
|
18
20
|
return /* @__PURE__ */ e(a.Portal, { "data-slot": "dialog-portal", ...t });
|
|
19
21
|
}
|
|
20
|
-
function
|
|
22
|
+
function D({
|
|
21
23
|
...t
|
|
22
24
|
}) {
|
|
23
25
|
return /* @__PURE__ */ e(a.Close, { "data-slot": "dialog-close", ...t });
|
|
@@ -38,15 +40,15 @@ function g({
|
|
|
38
40
|
}
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function w(t) {
|
|
42
44
|
const {
|
|
43
45
|
className: o,
|
|
44
|
-
children:
|
|
46
|
+
children: s,
|
|
45
47
|
showCloseButton: i = !0,
|
|
46
48
|
style: r,
|
|
47
|
-
...
|
|
49
|
+
...c
|
|
48
50
|
} = t;
|
|
49
|
-
return /* @__PURE__ */ e(
|
|
51
|
+
return /* @__PURE__ */ e(f, { "data-slot": "dialog-portal", children: /* @__PURE__ */ e(g, { children: /* @__PURE__ */ l(
|
|
50
52
|
a.Content,
|
|
51
53
|
{
|
|
52
54
|
"data-slot": "dialog-content",
|
|
@@ -55,25 +57,25 @@ function h(t) {
|
|
|
55
57
|
"group group/content",
|
|
56
58
|
"fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]",
|
|
57
59
|
"flex flex-col w-full max-w-[calc(100%-2rem)] sm:max-w-2xl gap-3",
|
|
58
|
-
"bg-background rounded-lg border
|
|
60
|
+
"bg-background rounded-lg border shadow-lg duration-200 p-6",
|
|
59
61
|
"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",
|
|
60
62
|
"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-transparent",
|
|
61
63
|
"outline-none focus:outline-none focus-visible:outline-none",
|
|
62
64
|
o
|
|
63
65
|
),
|
|
64
|
-
...
|
|
66
|
+
...c,
|
|
65
67
|
style: {
|
|
66
68
|
pointerEvents: "auto",
|
|
67
69
|
...r || {}
|
|
68
70
|
},
|
|
69
71
|
children: [
|
|
70
|
-
|
|
71
|
-
i && /* @__PURE__ */
|
|
72
|
+
s,
|
|
73
|
+
i && /* @__PURE__ */ l(
|
|
72
74
|
a.Close,
|
|
73
75
|
{
|
|
74
76
|
"data-slot": "dialog-close",
|
|
75
77
|
className: n(
|
|
76
|
-
"absolute top-
|
|
78
|
+
"absolute top-6 right-6 rounded-2xl opacity-70 transition-opacity hover:opacity-100",
|
|
77
79
|
"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
78
80
|
"ring-offset-background focus:ring-transparent focus:ring-0 focus:ring-offset-0 focus:outline-hidden",
|
|
79
81
|
"focus:outline-none focus:ring-0",
|
|
@@ -82,7 +84,14 @@ function h(t) {
|
|
|
82
84
|
"cursor-pointer size-10 flex items-center justify-center"
|
|
83
85
|
),
|
|
84
86
|
children: [
|
|
85
|
-
/* @__PURE__ */ e(
|
|
87
|
+
/* @__PURE__ */ e(
|
|
88
|
+
u,
|
|
89
|
+
{
|
|
90
|
+
variant: "ghost",
|
|
91
|
+
color: "secondary",
|
|
92
|
+
icon: d
|
|
93
|
+
}
|
|
94
|
+
),
|
|
86
95
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
87
96
|
]
|
|
88
97
|
}
|
|
@@ -91,7 +100,7 @@ function h(t) {
|
|
|
91
100
|
}
|
|
92
101
|
) }) });
|
|
93
102
|
}
|
|
94
|
-
function
|
|
103
|
+
function N({ className: t, ...o }) {
|
|
95
104
|
return /* @__PURE__ */ e(
|
|
96
105
|
"div",
|
|
97
106
|
{
|
|
@@ -101,7 +110,7 @@ function D({ className: t, ...o }) {
|
|
|
101
110
|
}
|
|
102
111
|
);
|
|
103
112
|
}
|
|
104
|
-
function
|
|
113
|
+
function C({ className: t, ...o }) {
|
|
105
114
|
return /* @__PURE__ */ e(
|
|
106
115
|
"div",
|
|
107
116
|
{
|
|
@@ -114,25 +123,37 @@ function w({ className: t, ...o }) {
|
|
|
114
123
|
}
|
|
115
124
|
);
|
|
116
125
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
function z(t) {
|
|
127
|
+
const {
|
|
128
|
+
className: o,
|
|
129
|
+
children: s,
|
|
130
|
+
...i
|
|
131
|
+
} = t;
|
|
121
132
|
return /* @__PURE__ */ e(
|
|
122
133
|
a.Title,
|
|
123
134
|
{
|
|
135
|
+
asChild: !0,
|
|
124
136
|
"data-slot": "dialog-title",
|
|
125
137
|
className: n(
|
|
126
|
-
"
|
|
127
|
-
"group-data-[closable='true']/content:pr-
|
|
128
|
-
|
|
129
|
-
t
|
|
138
|
+
"flex! flex-col justify-center min-h-10",
|
|
139
|
+
"group-data-[closable='true']/content:pr-13",
|
|
140
|
+
o
|
|
130
141
|
),
|
|
131
|
-
...
|
|
142
|
+
...i,
|
|
143
|
+
children: /* @__PURE__ */ e(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
className: n(
|
|
147
|
+
"text-lg leading-[1.2] font-bold text-[#06080D]",
|
|
148
|
+
"whitespace-pre-wrap wrap-break-word line-clamp-10"
|
|
149
|
+
),
|
|
150
|
+
children: s
|
|
151
|
+
}
|
|
152
|
+
)
|
|
132
153
|
}
|
|
133
154
|
);
|
|
134
155
|
}
|
|
135
|
-
function
|
|
156
|
+
function j({
|
|
136
157
|
className: t,
|
|
137
158
|
...o
|
|
138
159
|
}) {
|
|
@@ -150,16 +171,16 @@ function N({
|
|
|
150
171
|
);
|
|
151
172
|
}
|
|
152
173
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
174
|
+
b as Dialog,
|
|
175
|
+
D as DialogClose,
|
|
176
|
+
w as DialogContent,
|
|
177
|
+
j as DialogDescription,
|
|
178
|
+
C as DialogFooter,
|
|
179
|
+
N as DialogHeader,
|
|
159
180
|
g as DialogOverlay,
|
|
160
|
-
|
|
181
|
+
f as DialogPortal,
|
|
161
182
|
a as DialogPrimitive,
|
|
162
|
-
|
|
163
|
-
|
|
183
|
+
z as DialogTitle,
|
|
184
|
+
y as DialogTrigger
|
|
164
185
|
};
|
|
165
186
|
//# sourceMappingURL=Dialog.js.map
|
package/Dialog/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction Dialog({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent(props: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n const {\n className,\n children,\n showCloseButton = true,\n style,\n ...rest\n } = props;\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay>\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-closable={JSON.stringify(showCloseButton)}\n className={cn(\n 'group group/content',\n 'fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'flex flex-col w-full max-w-[calc(100%-2rem)] sm:max-w-2xl gap-3',\n 'bg-background rounded-lg border
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { ButtonIcon } from \"../ButtonIcon\";\n\nfunction Dialog({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent(props: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n const {\n className,\n children,\n showCloseButton = true,\n style,\n ...rest\n } = props;\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay>\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-closable={JSON.stringify(showCloseButton)}\n className={cn(\n 'group group/content',\n 'fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'flex flex-col w-full max-w-[calc(100%-2rem)] sm:max-w-2xl gap-3',\n 'bg-background rounded-lg border shadow-lg duration-200 p-6',\n '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',\n \"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-transparent\",\n 'outline-none focus:outline-none focus-visible:outline-none',\n className\n )}\n {...rest}\n style={{\n pointerEvents: 'auto',\n ...(style || {}),\n }}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n 'absolute top-6 right-6 rounded-2xl opacity-70 transition-opacity hover:opacity-100',\n 'data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n 'ring-offset-background focus:ring-transparent focus:ring-0 focus:ring-offset-0 focus:outline-hidden',\n 'focus:outline-none focus:ring-0',\n 'disabled:pointer-events-none [&_svg]:pointer-events-none',\n '[&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-5',\n 'cursor-pointer size-10 flex items-center justify-center',\n )}\n >\n <ButtonIcon\n variant='ghost'\n color='secondary'\n icon={XIcon}\n />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogOverlay>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-4 justify-center text-center sm:text-left min-h-10\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end pt-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle(props: React.ComponentProps<typeof DialogPrimitive.Title>) {\n const {\n className,\n children,\n ...rest\n } = props;\n return (\n <DialogPrimitive.Title\n asChild\n data-slot=\"dialog-title\"\n className={cn(\n \"flex! flex-col justify-center min-h-10\",\n \"group-data-[closable='true']/content:pr-13\",\n className\n )}\n {...rest}\n >\n <span\n className={cn(\n \"text-lg leading-[1.2] font-bold text-[#06080D]\",\n 'whitespace-pre-wrap wrap-break-word line-clamp-10',\n )}\n >\n {children}\n </span>\n </DialogPrimitive.Title>\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n \"text-[#06080D] font-medium text-base\",\n 'whitespace-pre-wrap wrap-break-word line-clamp-10',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogPrimitive\n}\n"],"names":["Dialog","props","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","jsx","cn","DialogContent","children","showCloseButton","style","rest","jsxs","ButtonIcon","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;;AASA,SAASA,EAAO;AAAA,EACE,GAAGC;AACL,GAAsD;A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QAAC;AAAA,QAAA;AAAA,UACC,WAAWC;AAAA,YACT;AAAA,YACA;AAAA,UAAA;AAAA,UAGD,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;AAEA,SAASU,EAAkB;AAAA,EACE,WAAAd;AAAA,EACA,GAAGN;AACL,GAA6D;AACtF,SACE,gBAAAO;AAAA,IAACN,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWO;AAAA,QACT;AAAA,QACA;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as b, DialogTrigger as O, DialogContent as B, DialogHeader as v, DialogTitle as w, DialogDescription as T, DialogFooter as F, DialogClose as L } from "./Dialog.js";
|
|
3
|
+
import { Button as l } from "../Button/Button.js";
|
|
4
|
+
import "../Button/buttonVariants.js";
|
|
5
|
+
import { useState as N, useCallback as S } from "react";
|
|
6
|
+
function I(p) {
|
|
7
|
+
const {
|
|
8
|
+
open: i,
|
|
9
|
+
onOpenChange: r,
|
|
10
|
+
title: h,
|
|
11
|
+
description: a,
|
|
12
|
+
showCloseButton: u = !0,
|
|
13
|
+
withFooter: m = !0,
|
|
14
|
+
initialOpen: f = !1,
|
|
15
|
+
triggerLabel: C = "Open dialog",
|
|
16
|
+
bodyText: s = "Some content inside dialog…",
|
|
17
|
+
longBody: c = !1
|
|
18
|
+
} = p, [D, x] = N(f), t = i !== void 0, y = t ? i : D, d = S((n) => {
|
|
19
|
+
t || x(n), r?.(n);
|
|
20
|
+
}, [t, r]);
|
|
21
|
+
return /* @__PURE__ */ o("div", { className: "p-10", children: /* @__PURE__ */ e(b, { open: y, onOpenChange: d, children: [
|
|
22
|
+
/* @__PURE__ */ o(O, { asChild: !0, children: /* @__PURE__ */ o(l, { variant: "outlined", children: C }) }),
|
|
23
|
+
/* @__PURE__ */ e(B, { showCloseButton: u, children: [
|
|
24
|
+
/* @__PURE__ */ e(v, { children: [
|
|
25
|
+
/* @__PURE__ */ o(w, { children: h }),
|
|
26
|
+
a ? /* @__PURE__ */ o(T, { children: a }) : null
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ o("div", { className: c ? "max-h-[50vh] overflow-auto pr-1" : void 0, children: c ? /* @__PURE__ */ o("div", { className: "space-y-3 text-sm leading-6", children: Array.from({ length: 30 }).map((n, g) => /* @__PURE__ */ e("p", { children: [
|
|
29
|
+
"#",
|
|
30
|
+
g + 1,
|
|
31
|
+
". ",
|
|
32
|
+
s,
|
|
33
|
+
" Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
34
|
+
] }, g)) }) : /* @__PURE__ */ o("p", { className: "text-sm leading-6", children: s }) }),
|
|
35
|
+
m ? /* @__PURE__ */ e(F, { children: [
|
|
36
|
+
/* @__PURE__ */ o(L, { asChild: !0, children: /* @__PURE__ */ o(l, { color: "secondary", children: "Cancel" }) }),
|
|
37
|
+
/* @__PURE__ */ o(l, { onClick: () => d(!1), children: "Save" })
|
|
38
|
+
] }) : null
|
|
39
|
+
] })
|
|
40
|
+
] }) });
|
|
41
|
+
}
|
|
42
|
+
const W = {
|
|
43
|
+
title: "UI/Dialog",
|
|
44
|
+
component: I,
|
|
45
|
+
parameters: {
|
|
46
|
+
layout: "fullscreen"
|
|
47
|
+
},
|
|
48
|
+
argTypes: {
|
|
49
|
+
title: { control: "text" },
|
|
50
|
+
description: { control: "text" },
|
|
51
|
+
showCloseButton: { control: "boolean" },
|
|
52
|
+
withFooter: { control: "boolean" },
|
|
53
|
+
initialOpen: { control: "boolean" },
|
|
54
|
+
triggerLabel: { control: "text" },
|
|
55
|
+
bodyText: { control: "text" },
|
|
56
|
+
longBody: { control: "boolean" }
|
|
57
|
+
},
|
|
58
|
+
args: {
|
|
59
|
+
title: "Dialog title",
|
|
60
|
+
description: "Dialog description",
|
|
61
|
+
showCloseButton: !0,
|
|
62
|
+
withFooter: !0,
|
|
63
|
+
initialOpen: !1,
|
|
64
|
+
triggerLabel: "Open dialog",
|
|
65
|
+
bodyText: "Some content inside dialog…",
|
|
66
|
+
longBody: !1
|
|
67
|
+
}
|
|
68
|
+
}, _ = {}, q = {
|
|
69
|
+
args: {
|
|
70
|
+
description: ""
|
|
71
|
+
}
|
|
72
|
+
}, z = {
|
|
73
|
+
args: {
|
|
74
|
+
showCloseButton: !1
|
|
75
|
+
}
|
|
76
|
+
}, E = {
|
|
77
|
+
args: {
|
|
78
|
+
withFooter: !1
|
|
79
|
+
}
|
|
80
|
+
}, G = {
|
|
81
|
+
args: {
|
|
82
|
+
longBody: !0,
|
|
83
|
+
bodyText: "Long text line"
|
|
84
|
+
}
|
|
85
|
+
}, J = {
|
|
86
|
+
args: {
|
|
87
|
+
initialOpen: !0
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
_ as Default,
|
|
92
|
+
J as InitiallyOpen,
|
|
93
|
+
G as LongContentScrollable,
|
|
94
|
+
z as NoCloseButton,
|
|
95
|
+
E as NoFooter,
|
|
96
|
+
q as WithoutDescription,
|
|
97
|
+
W as default
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=Dialog.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.stories.js","sources":["../../src/Dialog/Dialog.stories.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\n\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n DialogClose,\n} from \"./Dialog\";\nimport { Button } from \"../Button\";\nimport { useCallback, useState } from \"react\";\nimport { DialogControlsProps } from \"./Dialog.types\";\n\ntype DialogDemoProps = DialogControlsProps & {\n title: string;\n description?: string;\n showCloseButton?: boolean;\n withFooter?: boolean;\n initialOpen?: boolean;\n triggerLabel?: string;\n bodyText?: string;\n longBody?: boolean;\n};\n\n// TODO: create cmp like alert\nfunction DialogDemo(props: DialogDemoProps) {\n const {\n open: controlledOpen,\n onOpenChange,\n title,\n description,\n showCloseButton = true,\n withFooter = true,\n initialOpen = false,\n triggerLabel = \"Open dialog\",\n bodyText = \"Some content inside dialog…\",\n longBody = false,\n } = props;\n\n const [ internalOpen, setInternalOpen ] = useState(initialOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n const setOpen = useCallback((next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n }, [ isControlled, onOpenChange ]);\n\n return (\n <div className=\"p-10\">\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant='outlined'>\n {triggerLabel}\n </Button>\n </DialogTrigger>\n\n <DialogContent showCloseButton={showCloseButton}>\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description ? <DialogDescription>{description}</DialogDescription> : null}\n </DialogHeader>\n\n <div className={longBody ? \"max-h-[50vh] overflow-auto pr-1\" : undefined}>\n {longBody ? (\n <div className=\"space-y-3 text-sm leading-6\">\n {Array.from({ length: 30 }).map((_, i) => (\n <p key={i}>\n #{i + 1}. {bodyText} Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </p>\n ))}\n </div>\n ) : (\n <p className=\"text-sm leading-6\">{bodyText}</p>\n )}\n </div>\n\n {withFooter ? (\n <DialogFooter>\n <DialogClose asChild>\n <Button color='secondary'>\n Cancel\n </Button>\n </DialogClose>\n\n <Button onClick={() => setOpen(false)}>\n Save\n </Button>\n </DialogFooter>\n ) : null}\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nconst meta: Meta<typeof DialogDemo> = {\n title: \"UI/Dialog\",\n component: DialogDemo,\n parameters: {\n layout: \"fullscreen\",\n },\n argTypes: {\n title: { control: \"text\" },\n description: { control: \"text\" },\n showCloseButton: { control: \"boolean\" },\n withFooter: { control: \"boolean\" },\n initialOpen: { control: \"boolean\" },\n triggerLabel: { control: \"text\" },\n bodyText: { control: \"text\" },\n longBody: { control: \"boolean\" },\n },\n args: {\n title: \"Dialog title\",\n description: \"Dialog description\",\n showCloseButton: true,\n withFooter: true,\n initialOpen: false,\n triggerLabel: \"Open dialog\",\n bodyText: \"Some content inside dialog…\",\n longBody: false,\n },\n};\nexport default meta;\n\ntype Story = StoryObj<typeof DialogDemo>;\n\nexport const Default: Story = {};\n\nexport const WithoutDescription: Story = {\n args: {\n description: \"\",\n },\n};\n\nexport const NoCloseButton: Story = {\n args: {\n showCloseButton: false,\n },\n};\n\nexport const NoFooter: Story = {\n args: {\n withFooter: false,\n },\n};\n\nexport const LongContentScrollable: Story = {\n args: {\n longBody: true,\n bodyText: \"Long text line\",\n },\n};\n\nexport const InitiallyOpen: Story = {\n args: {\n initialOpen: true,\n },\n};\n"],"names":["DialogDemo","props","controlledOpen","onOpenChange","title","description","showCloseButton","withFooter","initialOpen","triggerLabel","bodyText","longBody","internalOpen","setInternalOpen","useState","isControlled","open","setOpen","useCallback","next","jsx","Dialog","DialogTrigger","Button","jsxs","DialogContent","DialogHeader","DialogTitle","DialogDescription","_","i","DialogFooter","DialogClose","meta","Default","WithoutDescription","NoCloseButton","NoFooter","LongContentScrollable","InitiallyOpen"],"mappings":";;;;;AA6BA,SAASA,EAAWC,GAAwB;AAC1C,QAAM;AAAA,IACJ,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,EAAA,IACTV,GAEE,CAAEW,GAAcC,CAAgB,IAAIC,EAASN,CAAW,GACxDO,IAAeb,MAAmB,QAClCc,IAAOD,IAAeb,IAAiBU,GACvCK,IAAUC,EAAY,CAACC,MA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AAA,EAAA,CACF,EAAA,CACF;AAEJ;AAEA,MAAMgB,IAAgC;AAAA,EACpC,OAAO;AAAA,EACP,WAAWjC;AAAA,EACX,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACR,OAAO,EAAE,SAAS,OAAA;AAAA,IAClB,aAAa,EAAE,SAAS,OAAA;AAAA,IACxB,iBAAiB,EAAE,SAAS,UAAA;AAAA,IAC5B,YAAY,EAAE,SAAS,UAAA;AAAA,IACvB,aAAa,EAAE,SAAS,UAAA;AAAA,IACxB,cAAc,EAAE,SAAS,OAAA;AAAA,IACzB,UAAU,EAAE,SAAS,OAAA;AAAA,IACrB,UAAU,EAAE,SAAS,UAAA;AAAA,EAAU;AAAA,EAEjC,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,cAAc;AAAA,IACd,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAEd,GAKakC,IAAiB,CAAA,GAEjBC,IAA4B;AAAA,EACvC,MAAM;AAAA,IACJ,aAAa;AAAA,EAAA;AAEjB,GAEaC,IAAuB;AAAA,EAClC,MAAM;AAAA,IACJ,iBAAiB;AAAA,EAAA;AAErB,GAEaC,IAAkB;AAAA,EAC7B,MAAM;AAAA,IACJ,YAAY;AAAA,EAAA;AAEhB,GAEaC,IAA+B;AAAA,EAC1C,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAEd,GAEaC,IAAuB;AAAA,EAClC,MAAM;AAAA,IACJ,aAAa;AAAA,EAAA;AAEjB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.1.99-beta.
|
|
3
|
+
"version": "0.1.99-beta.77",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"recharts": "^3.2.0",
|
|
106
106
|
"sonner": "^2.0.7",
|
|
107
107
|
"vaul": "^1.1.2",
|
|
108
|
-
"@oneplatformdev/
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/tokens": "^0.1.99-beta.
|
|
108
|
+
"@oneplatformdev/hooks": "^0.1.99-beta.77",
|
|
109
|
+
"@oneplatformdev/utils": "^0.1.99-beta.77",
|
|
110
|
+
"@oneplatformdev/tokens": "^0.1.99-beta.77"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|
|
113
113
|
"chromatic": "chromatic"
|