@neoptocom/neopto-ui 0.9.6 → 0.9.8
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/dist/index.cjs +3 -8
- package/dist/index.d.cts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +3 -8
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Modal.tsx +1 -10
- package/src/stories/Modal.stories.tsx +6 -18
package/dist/index.cjs
CHANGED
|
@@ -260,7 +260,6 @@ function useIsomorphicLayoutEffect(effect, deps) {
|
|
|
260
260
|
function Modal({
|
|
261
261
|
open,
|
|
262
262
|
onClose,
|
|
263
|
-
title,
|
|
264
263
|
closeOnBackdrop = true,
|
|
265
264
|
children,
|
|
266
265
|
className = "",
|
|
@@ -309,18 +308,14 @@ function Modal({
|
|
|
309
308
|
open,
|
|
310
309
|
onClose: closeOnBackdrop ? onClose : void 0,
|
|
311
310
|
zIndex,
|
|
312
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
311
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
313
312
|
Card,
|
|
314
313
|
{
|
|
315
314
|
className: modalClasses,
|
|
316
315
|
role: "dialog",
|
|
317
316
|
"aria-modal": "true",
|
|
318
|
-
"aria-labelledby": title ? "modal-title" : void 0,
|
|
319
317
|
showDecorations,
|
|
320
|
-
children
|
|
321
|
-
title && /* @__PURE__ */ jsxRuntime.jsx("h2", { id: "modal-title", className: "mb-4 text-xl font-semibold", children: title }),
|
|
322
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children })
|
|
323
|
-
]
|
|
318
|
+
children
|
|
324
319
|
}
|
|
325
320
|
)
|
|
326
321
|
}
|
|
@@ -996,7 +991,7 @@ function getButtonClasses(variant = "primary", size = "md", fullWidth, className
|
|
|
996
991
|
const variants = {
|
|
997
992
|
primary: "bg-cyan-500 text-white hover:bg-cyan-400 active:bg-cyan-600 disabled:bg-neutral-400",
|
|
998
993
|
secondary: "border border-cyan-500 text-cyan-500 bg-transparent hover:bg-cyan-50 active:bg-cyan-100 disabled:border-neutral-400 disabled:text-neutral-400",
|
|
999
|
-
ghost: "bg-transparent text-
|
|
994
|
+
ghost: "bg-transparent text-[var(--fg)] hover:bg-[var(--muted)] active:bg-[var(--muted)] disabled:opacity-50"
|
|
1000
995
|
};
|
|
1001
996
|
const sizes = {
|
|
1002
997
|
sm: "h-9 px-3",
|
package/dist/index.d.cts
CHANGED
|
@@ -60,8 +60,6 @@ type ModalProps = {
|
|
|
60
60
|
onClose?: () => void;
|
|
61
61
|
/** Modal content */
|
|
62
62
|
children?: React.ReactNode;
|
|
63
|
-
/** Optional title (rendered as heading) */
|
|
64
|
-
title?: string;
|
|
65
63
|
/** When true, closes when the backdrop is clicked (default: true) */
|
|
66
64
|
closeOnBackdrop?: boolean;
|
|
67
65
|
/** Custom className for the Card */
|
|
@@ -71,7 +69,7 @@ type ModalProps = {
|
|
|
71
69
|
/** Show decorative elements on the Card (default: true) */
|
|
72
70
|
showDecorations?: boolean;
|
|
73
71
|
};
|
|
74
|
-
declare function Modal({ open, onClose,
|
|
72
|
+
declare function Modal({ open, onClose, closeOnBackdrop, children, className, zIndex, showDecorations, }: ModalProps): React.ReactPortal | null;
|
|
75
73
|
|
|
76
74
|
type TypoVariant = "display-lg" | "display-md" | "display-sm" | "headline-lg" | "headline-md" | "headline-sm" | "title-lg" | "title-md" | "title-sm" | "label-lg" | "label-md" | "label-sm" | "body-lg" | "body-md" | "body-sm" | "button";
|
|
77
75
|
type TypoWeight = "normal" | "medium" | "semibold" | "bold";
|
package/dist/index.d.ts
CHANGED
|
@@ -60,8 +60,6 @@ type ModalProps = {
|
|
|
60
60
|
onClose?: () => void;
|
|
61
61
|
/** Modal content */
|
|
62
62
|
children?: React.ReactNode;
|
|
63
|
-
/** Optional title (rendered as heading) */
|
|
64
|
-
title?: string;
|
|
65
63
|
/** When true, closes when the backdrop is clicked (default: true) */
|
|
66
64
|
closeOnBackdrop?: boolean;
|
|
67
65
|
/** Custom className for the Card */
|
|
@@ -71,7 +69,7 @@ type ModalProps = {
|
|
|
71
69
|
/** Show decorative elements on the Card (default: true) */
|
|
72
70
|
showDecorations?: boolean;
|
|
73
71
|
};
|
|
74
|
-
declare function Modal({ open, onClose,
|
|
72
|
+
declare function Modal({ open, onClose, closeOnBackdrop, children, className, zIndex, showDecorations, }: ModalProps): React.ReactPortal | null;
|
|
75
73
|
|
|
76
74
|
type TypoVariant = "display-lg" | "display-md" | "display-sm" | "headline-lg" | "headline-md" | "headline-sm" | "title-lg" | "title-md" | "title-sm" | "label-lg" | "label-md" | "label-sm" | "body-lg" | "body-md" | "body-sm" | "button";
|
|
77
75
|
type TypoWeight = "normal" | "medium" | "semibold" | "bold";
|
package/dist/index.js
CHANGED
|
@@ -239,7 +239,6 @@ function useIsomorphicLayoutEffect(effect, deps) {
|
|
|
239
239
|
function Modal({
|
|
240
240
|
open,
|
|
241
241
|
onClose,
|
|
242
|
-
title,
|
|
243
242
|
closeOnBackdrop = true,
|
|
244
243
|
children,
|
|
245
244
|
className = "",
|
|
@@ -288,18 +287,14 @@ function Modal({
|
|
|
288
287
|
open,
|
|
289
288
|
onClose: closeOnBackdrop ? onClose : void 0,
|
|
290
289
|
zIndex,
|
|
291
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ jsx(
|
|
292
291
|
Card,
|
|
293
292
|
{
|
|
294
293
|
className: modalClasses,
|
|
295
294
|
role: "dialog",
|
|
296
295
|
"aria-modal": "true",
|
|
297
|
-
"aria-labelledby": title ? "modal-title" : void 0,
|
|
298
296
|
showDecorations,
|
|
299
|
-
children
|
|
300
|
-
title && /* @__PURE__ */ jsx("h2", { id: "modal-title", className: "mb-4 text-xl font-semibold", children: title }),
|
|
301
|
-
/* @__PURE__ */ jsx("div", { children })
|
|
302
|
-
]
|
|
297
|
+
children
|
|
303
298
|
}
|
|
304
299
|
)
|
|
305
300
|
}
|
|
@@ -975,7 +970,7 @@ function getButtonClasses(variant = "primary", size = "md", fullWidth, className
|
|
|
975
970
|
const variants = {
|
|
976
971
|
primary: "bg-cyan-500 text-white hover:bg-cyan-400 active:bg-cyan-600 disabled:bg-neutral-400",
|
|
977
972
|
secondary: "border border-cyan-500 text-cyan-500 bg-transparent hover:bg-cyan-50 active:bg-cyan-100 disabled:border-neutral-400 disabled:text-neutral-400",
|
|
978
|
-
ghost: "bg-transparent text-
|
|
973
|
+
ghost: "bg-transparent text-[var(--fg)] hover:bg-[var(--muted)] active:bg-[var(--muted)] disabled:opacity-50"
|
|
979
974
|
};
|
|
980
975
|
const sizes = {
|
|
981
976
|
sm: "h-9 px-3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neoptocom/neopto-ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A modern React component library built with Tailwind CSS v4 and TypeScript. Features dark mode, design tokens, and comprehensive Storybook documentation. Requires Tailwind v4+.",
|
|
6
6
|
"keywords": [
|
|
@@ -25,7 +25,7 @@ function getButtonClasses(
|
|
|
25
25
|
const variants = {
|
|
26
26
|
primary: "bg-cyan-500 text-white hover:bg-cyan-400 active:bg-cyan-600 disabled:bg-neutral-400",
|
|
27
27
|
secondary: "border border-cyan-500 text-cyan-500 bg-transparent hover:bg-cyan-50 active:bg-cyan-100 disabled:border-neutral-400 disabled:text-neutral-400",
|
|
28
|
-
ghost: "bg-transparent text-
|
|
28
|
+
ghost: "bg-transparent text-[var(--fg)] hover:bg-[var(--muted)] active:bg-[var(--muted)] disabled:opacity-50"
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const sizes = {
|
package/src/components/Modal.tsx
CHANGED
|
@@ -10,8 +10,6 @@ export type ModalProps = {
|
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
/** Modal content */
|
|
12
12
|
children?: React.ReactNode;
|
|
13
|
-
/** Optional title (rendered as heading) */
|
|
14
|
-
title?: string;
|
|
15
13
|
/** When true, closes when the backdrop is clicked (default: true) */
|
|
16
14
|
closeOnBackdrop?: boolean;
|
|
17
15
|
/** Custom className for the Card */
|
|
@@ -30,7 +28,6 @@ function useIsomorphicLayoutEffect(effect: React.EffectCallback, deps?: React.De
|
|
|
30
28
|
export function Modal({
|
|
31
29
|
open,
|
|
32
30
|
onClose,
|
|
33
|
-
title,
|
|
34
31
|
closeOnBackdrop = true,
|
|
35
32
|
children,
|
|
36
33
|
className = "",
|
|
@@ -100,15 +97,9 @@ export function Modal({
|
|
|
100
97
|
className={modalClasses}
|
|
101
98
|
role="dialog"
|
|
102
99
|
aria-modal="true"
|
|
103
|
-
aria-labelledby={title ? "modal-title" : undefined}
|
|
104
100
|
showDecorations={showDecorations}
|
|
105
101
|
>
|
|
106
|
-
{
|
|
107
|
-
<h2 id="modal-title" className="mb-4 text-xl font-semibold">
|
|
108
|
-
{title}
|
|
109
|
-
</h2>
|
|
110
|
-
)}
|
|
111
|
-
<div>{children}</div>
|
|
102
|
+
{children}
|
|
112
103
|
</Card>
|
|
113
104
|
</BackgroundBlur>
|
|
114
105
|
</div>
|
|
@@ -42,27 +42,14 @@ export const Default: Story = {
|
|
|
42
42
|
),
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export const WithTitle: Story = {
|
|
46
|
-
args: { open: false },
|
|
47
|
-
render: () => (
|
|
48
|
-
<ModalDemo title="Modal Title">
|
|
49
|
-
<Typo variant="body-md">
|
|
50
|
-
This modal includes a title heading. You can still add any content you want below it.
|
|
51
|
-
</Typo>
|
|
52
|
-
<Typo variant="body-sm" className="mt-4 text-[var(--muted-fg)]">
|
|
53
|
-
Try clicking the backdrop to close, or press ESC.
|
|
54
|
-
</Typo>
|
|
55
|
-
</ModalDemo>
|
|
56
|
-
),
|
|
57
|
-
};
|
|
58
45
|
|
|
59
46
|
export const NoBackdropClose: Story = {
|
|
60
47
|
args: { open: false },
|
|
61
48
|
render: () => (
|
|
62
49
|
<ModalDemo
|
|
63
|
-
title="Important Notice"
|
|
64
50
|
closeOnBackdrop={false}
|
|
65
51
|
>
|
|
52
|
+
<Typo variant="headline-md" bold="semibold" className="mb-4">Important Notice</Typo>
|
|
66
53
|
<Typo variant="body-md">
|
|
67
54
|
This modal cannot be closed by clicking the backdrop.
|
|
68
55
|
</Typo>
|
|
@@ -80,9 +67,9 @@ export const CustomStyling: Story = {
|
|
|
80
67
|
args: { open: false },
|
|
81
68
|
render: () => (
|
|
82
69
|
<ModalDemo
|
|
83
|
-
title="Large Modal"
|
|
84
70
|
className="max-w-2xl p-12"
|
|
85
71
|
>
|
|
72
|
+
<Typo variant="headline-md" bold="semibold" className="mb-4">Large Modal</Typo>
|
|
86
73
|
<Typo variant="body-md">
|
|
87
74
|
This modal has custom styling with a larger max-width and more padding.
|
|
88
75
|
</Typo>
|
|
@@ -119,9 +106,9 @@ export const FormModal: Story = {
|
|
|
119
106
|
<Modal
|
|
120
107
|
open={open}
|
|
121
108
|
onClose={() => setOpen(false)}
|
|
122
|
-
title="Contact Form"
|
|
123
109
|
>
|
|
124
110
|
<form onSubmit={handleSubmit}>
|
|
111
|
+
<Typo variant="headline-md" bold="semibold" className="mb-4">Contact Form</Typo>
|
|
125
112
|
<div className="space-y-4">
|
|
126
113
|
<div>
|
|
127
114
|
<label className="block mb-2 text-sm font-medium">Name</label>
|
|
@@ -181,9 +168,9 @@ export const ConfirmationDialog: Story = {
|
|
|
181
168
|
<Modal
|
|
182
169
|
open={open}
|
|
183
170
|
onClose={() => setOpen(false)}
|
|
184
|
-
title="Confirm Deletion"
|
|
185
171
|
closeOnBackdrop={false}
|
|
186
172
|
>
|
|
173
|
+
<Typo variant="headline-md" bold="semibold" className="mb-4">Confirm Deletion</Typo>
|
|
187
174
|
<Typo variant="body-md">
|
|
188
175
|
Are you sure you want to delete this item? This action cannot be undone.
|
|
189
176
|
</Typo>
|
|
@@ -242,7 +229,8 @@ export const WithCardDecorations: Story = {
|
|
|
242
229
|
);
|
|
243
230
|
|
|
244
231
|
return (
|
|
245
|
-
<ModalDemo
|
|
232
|
+
<ModalDemo>
|
|
233
|
+
<Typo variant="headline-md" bold="semibold" className="mb-4">Card with Decorative Elements</Typo>
|
|
246
234
|
<div className="space-y-4">
|
|
247
235
|
<Typo variant="body-md">
|
|
248
236
|
The Card component now includes decorative SVG elements from your Figma design:
|