@neoptocom/neopto-ui 1.4.4 → 1.5.1

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,270 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { useState } from "react";
3
- import { Breadcrumb } from "../components/Breadcrumb";
4
-
5
- const meta: Meta<typeof Breadcrumb> = {
6
- title: "Components/Breadcrumb",
7
- component: Breadcrumb,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- tags: ["autodocs"],
12
- argTypes: {
13
- items: {
14
- description: "Array of breadcrumb items to display",
15
- control: { type: "object" },
16
- },
17
- showHomeIcon: {
18
- description: "Show home icon on first item",
19
- control: { type: "boolean" },
20
- },
21
- className: {
22
- description: "Additional CSS classes",
23
- control: { type: "text" },
24
- },
25
- },
26
- };
27
-
28
- export default meta;
29
- type Story = StoryObj<typeof Breadcrumb>;
30
-
31
- // Basic Examples
32
- export const Default: Story = {
33
- args: {
34
- items: [
35
- { label: "Home", href: "/" },
36
- { label: "Products", href: "/products" },
37
- { label: "Electronics", href: "/products/electronics" },
38
- { label: "Laptops" },
39
- ],
40
- },
41
- };
42
-
43
- export const WithHomeIcon: Story = {
44
- args: {
45
- items: [
46
- { label: "Home", href: "/" },
47
- { label: "Products", href: "/products" },
48
- { label: "Electronics" },
49
- ],
50
- showHomeIcon: true,
51
- },
52
- };
53
-
54
- export const TwoLevels: Story = {
55
- args: {
56
- items: [
57
- { label: "Home", href: "/" },
58
- { label: "Current Page" },
59
- ],
60
- },
61
- };
62
-
63
- export const SingleItem: Story = {
64
- args: {
65
- items: [{ label: "Home" }],
66
- },
67
- };
68
-
69
-
70
- // With Icons
71
- export const WithIcons: Story = {
72
- args: {
73
- items: [
74
- { label: "Home", href: "/", icon: "home" },
75
- { label: "Settings", href: "/settings", icon: "settings" },
76
- { label: "Profile", icon: "person" },
77
- ],
78
- },
79
- };
80
-
81
- export const MixedIcons: Story = {
82
- args: {
83
- items: [
84
- { label: "Dashboard", href: "/", icon: "dashboard" },
85
- { label: "Projects", href: "/projects", icon: "folder" },
86
- { label: "Documents", href: "/documents", icon: "description" },
87
- { label: "Report.pdf" },
88
- ],
89
- },
90
- };
91
-
92
- // With Click Handlers
93
- export const WithClickHandlers: Story = {
94
- args: {
95
- items: [
96
- {
97
- label: "Home",
98
- onClick: () => alert("Navigating to Home"),
99
- },
100
- {
101
- label: "Products",
102
- onClick: () => alert("Navigating to Products"),
103
- },
104
- {
105
- label: "Category",
106
- onClick: () => alert("Navigating to Category"),
107
- },
108
- { label: "Item" },
109
- ],
110
- },
111
- };
112
-
113
- // Interactive Component Navigation (no URL changes)
114
- export const ComponentNavigation = () => {
115
- const sections = [
116
- { id: "account", label: "Account", icon: "person" },
117
- { id: "security", label: "Security", icon: "lock" },
118
- { id: "notifications", label: "Notifications", icon: "notifications" },
119
- { id: "billing", label: "Billing", icon: "payment" },
120
- ];
121
-
122
- const [activeSection, setActiveSection] = useState("account");
123
-
124
- const sectionContent: Record<string, { title: string; description: string }> = {
125
- account: {
126
- title: "Account Settings",
127
- description: "Manage your account information, profile details, and preferences.",
128
- },
129
- security: {
130
- title: "Security Settings",
131
- description: "Configure password, two-factor authentication, and security preferences.",
132
- },
133
- notifications: {
134
- title: "Notification Preferences",
135
- description: "Control how and when you receive notifications from our platform.",
136
- },
137
- billing: {
138
- title: "Billing & Subscription",
139
- description: "View invoices, update payment methods, and manage your subscription.",
140
- },
141
- };
142
-
143
- const breadcrumbItems = [
144
- {
145
- label: "Settings",
146
- icon: "settings",
147
- onClick: () => setActiveSection("account"),
148
- },
149
- ...sections
150
- .slice(0, sections.findIndex((s) => s.id === activeSection) + 1)
151
- .map((section, index, arr) => ({
152
- label: section.label,
153
- icon: section.icon,
154
- onClick: index < arr.length - 1 ? () => setActiveSection(section.id) : undefined,
155
- })),
156
- ];
157
-
158
- return (
159
- <div className="w-full max-w-4xl p-6 space-y-6">
160
- {/* Breadcrumb Navigation */}
161
- <Breadcrumb items={breadcrumbItems} />
162
-
163
- {/* Content Area */}
164
- <div className="border rounded-lg p-6 space-y-4">
165
- <h2 className="text-2xl font-semibold">{sectionContent[activeSection].title}</h2>
166
- <p className="text-gray-600">{sectionContent[activeSection].description}</p>
167
-
168
- {/* Navigation Buttons */}
169
- <div className="flex gap-2 pt-4">
170
- {sections.map((section) => (
171
- <button
172
- key={section.id}
173
- onClick={() => setActiveSection(section.id)}
174
- className={`px-4 py-2 rounded transition ${
175
- activeSection === section.id
176
- ? "bg-blue-500 text-white"
177
- : "bg-gray-100 hover:bg-gray-200"
178
- }`}
179
- >
180
- {section.label}
181
- </button>
182
- ))}
183
- </div>
184
- </div>
185
-
186
- {/* Usage Example Code */}
187
- <div className="bg-gray-50 p-4 rounded text-sm">
188
- <p className="font-mono text-xs text-gray-600">
189
- Current section: <strong>{activeSection}</strong>
190
- </p>
191
- <p className="text-xs text-gray-500 mt-2">
192
- Click any breadcrumb item or button to navigate between sections without changing the URL.
193
- </p>
194
- </div>
195
- </div>
196
- );
197
- };
198
-
199
- // Long Breadcrumb
200
- export const LongBreadcrumb: Story = {
201
- args: {
202
- items: [
203
- { label: "Home", href: "/" },
204
- { label: "Products", href: "/products" },
205
- { label: "Electronics", href: "/products/electronics" },
206
- { label: "Computers", href: "/products/electronics/computers" },
207
- { label: "Laptops", href: "/products/electronics/computers/laptops" },
208
- { label: "Gaming Laptops", href: "/products/electronics/computers/laptops/gaming" },
209
- { label: "ASUS ROG" },
210
- ],
211
- },
212
- };
213
-
214
- // Navigation Patterns
215
- export const FileSystem: Story = {
216
- args: {
217
- items: [
218
- { label: "Root", href: "/", icon: "folder" },
219
- { label: "Documents", href: "/documents", icon: "folder" },
220
- { label: "Projects", href: "/documents/projects", icon: "folder" },
221
- { label: "2024", href: "/documents/projects/2024", icon: "folder" },
222
- { label: "report.pdf", icon: "description" },
223
- ],
224
- },
225
- };
226
-
227
- export const AdminPanel: Story = {
228
- args: {
229
- items: [
230
- { label: "Dashboard", href: "/", icon: "dashboard" },
231
- { label: "Users", href: "/users", icon: "group" },
232
- { label: "Edit User", icon: "edit" },
233
- ],
234
- },
235
- };
236
-
237
- export const ECommerce: Story = {
238
- args: {
239
- items: [
240
- { label: "Home", href: "/" },
241
- { label: "Electronics", href: "/electronics" },
242
- { label: "Smartphones", href: "/electronics/smartphones" },
243
- { label: "iPhone 15 Pro" },
244
- ],
245
- showHomeIcon: true,
246
- },
247
- };
248
-
249
- // Edge Cases
250
- export const VeryLongLabels: Story = {
251
- args: {
252
- items: [
253
- { label: "Home", href: "/" },
254
- { label: "This is a very long breadcrumb label that might wrap", href: "/long" },
255
- { label: "Another extremely long label for testing purposes" },
256
- ],
257
- },
258
- };
259
-
260
- export const WithCustomClassName: Story = {
261
- args: {
262
- items: [
263
- { label: "Home", href: "/" },
264
- { label: "Products", href: "/products" },
265
- { label: "Category" },
266
- ],
267
- className: "text-blue-600",
268
- },
269
- };
270
-
@@ -1,350 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Card } from "../components/Card";
3
- import Typo from "../components/Typo";
4
- import { Button } from "../components/Button";
5
-
6
- const meta: Meta<typeof Card> = {
7
- title: "Components/Card",
8
- component: Card,
9
- parameters: {
10
- layout: "padded",
11
- },
12
- };
13
- export default meta;
14
- type Story = StoryObj<typeof Card>;
15
-
16
- export const Default: Story = {
17
- render: () => (
18
- <div className="max-w-md">
19
- <Card>
20
- <Typo variant="headline-sm" bold="semibold">Default Card</Typo>
21
- <Typo variant="body-md" className="mt-2">
22
- This is a default card with glassmorphic styling.
23
- </Typo>
24
- </Card>
25
- </div>
26
- ),
27
- };
28
-
29
- export const WithDecorations: Story = {
30
- render: () => (
31
- <div className="max-w-md">
32
- <Card showDecorations={true}>
33
- <Typo variant="headline-sm" bold="semibold">Card With Decorations</Typo>
34
- <Typo variant="body-md" className="mt-2">
35
- This card has the decorative SVG gradient borders enabled.
36
- </Typo>
37
- </Card>
38
- </div>
39
- ),
40
- };
41
-
42
- export const AppBackgroundVariant: Story = {
43
- render: () => (
44
- <div className="max-w-md">
45
- <Card variant="app-background">
46
- <Typo variant="headline-sm" bold="semibold">App Background Card</Typo>
47
- <Typo variant="body-md" className="mt-2">
48
- This card uses the same background images as AppBackground component. It automatically switches between light and dark mode backgrounds.
49
- </Typo>
50
- <div className="mt-4">
51
- <Button variant="primary">Learn More</Button>
52
- </div>
53
- </Card>
54
- </div>
55
- ),
56
- };
57
-
58
- export const AppBackgroundWithDecorations: Story = {
59
- render: () => (
60
- <div className="max-w-md">
61
- <Card variant="app-background" showDecorations={true}>
62
- <Typo variant="headline-sm" bold="semibold">App Background + Decorations</Typo>
63
- <Typo variant="body-md" className="mt-2">
64
- This card combines the app-background variant with decorative SVG gradient borders. The decorations render above the background image.
65
- </Typo>
66
- <div className="mt-4">
67
- <Button variant="primary">Explore</Button>
68
- </div>
69
- </Card>
70
- </div>
71
- ),
72
- };
73
-
74
- export const AppBackgroundLarge: Story = {
75
- render: () => (
76
- <div className="max-w-2xl">
77
- <Card variant="app-background" className="p-8" style={{ minHeight: "400px" }}>
78
- <Typo variant="headline-lg" bold="bold">Large App Background Card</Typo>
79
- <Typo variant="body-lg" className="mt-4">
80
- The app-background variant looks great with larger cards. The background image scales to fill the entire card.
81
- </Typo>
82
- <div className="mt-8 grid grid-cols-2 gap-6">
83
- <div>
84
- <Typo variant="title-md" bold="semibold">Feature One</Typo>
85
- <Typo variant="body-sm" className="mt-2 text-[var(--muted-fg)]">
86
- Description of the first feature goes here.
87
- </Typo>
88
- </div>
89
- <div>
90
- <Typo variant="title-md" bold="semibold">Feature Two</Typo>
91
- <Typo variant="body-sm" className="mt-2 text-[var(--muted-fg)]">
92
- Description of the second feature goes here.
93
- </Typo>
94
- </div>
95
- </div>
96
- </Card>
97
- </div>
98
- ),
99
- };
100
-
101
- export const Elevated: Story = {
102
- render: () => (
103
- <div className="max-w-md">
104
- <Card elevated>
105
- <Typo variant="headline-sm" bold="semibold">Elevated Card</Typo>
106
- <Typo variant="body-md" className="mt-2">
107
- This card uses the elevated shadow effect for a floating appearance.
108
- </Typo>
109
- <div className="mt-4">
110
- <Button variant="primary">Take Action</Button>
111
- </div>
112
- </Card>
113
- </div>
114
- ),
115
- };
116
-
117
- export const ElevatedComparison: Story = {
118
- render: () => (
119
- <div className="grid grid-cols-2 gap-6 max-w-4xl">
120
- <div>
121
- <Typo variant="label-lg" bold="semibold" className="mb-3">Default</Typo>
122
- <Card>
123
- <Typo variant="title-md" bold="semibold">Regular Card</Typo>
124
- <Typo variant="body-sm" className="mt-2">
125
- Standard card with glassmorphic effect, no shadow.
126
- </Typo>
127
- </Card>
128
- </div>
129
- <div>
130
- <Typo variant="label-lg" bold="semibold" className="mb-3">Elevated</Typo>
131
- <Card elevated>
132
- <Typo variant="title-md" bold="semibold">Elevated Card</Typo>
133
- <Typo variant="body-sm" className="mt-2">
134
- Enhanced with elevated shadow for emphasis.
135
- </Typo>
136
- </Card>
137
- </div>
138
- </div>
139
- ),
140
- };
141
-
142
- export const ElevatedAppBackground: Story = {
143
- render: () => (
144
- <div className="max-w-md">
145
- <Card variant="app-background" elevated className="p-8">
146
- <Typo variant="headline-sm" bold="semibold">Elevated + App Background</Typo>
147
- <Typo variant="body-md" className="mt-3">
148
- Combining the app-background variant with elevated shadow creates a stunning effect.
149
- </Typo>
150
- <div className="mt-6 flex gap-3">
151
- <Button variant="primary">Primary</Button>
152
- <Button variant="secondary">Secondary</Button>
153
- </div>
154
- </Card>
155
- </div>
156
- ),
157
- };
158
-
159
- export const CustomPadding: Story = {
160
- render: () => (
161
- <div className="max-w-md space-y-4">
162
- <Card className="p-8">
163
- <Typo variant="label-lg" bold="semibold">Large Padding (p-8)</Typo>
164
- <Typo variant="body-sm" className="mt-1">More breathing room inside the card.</Typo>
165
- </Card>
166
- <Card className="p-4">
167
- <Typo variant="label-lg" bold="semibold">Small Padding (p-4)</Typo>
168
- <Typo variant="body-sm" className="mt-1">Compact card layout.</Typo>
169
- </Card>
170
- <Card className="p-0">
171
- <div className="p-6 border-b border-[var(--border)]">
172
- <Typo variant="label-lg" bold="semibold">No Default Padding (p-0)</Typo>
173
- </div>
174
- <div className="p-6">
175
- <Typo variant="body-sm">Custom padding applied to inner elements.</Typo>
176
- </div>
177
- </Card>
178
- </div>
179
- ),
180
- };
181
-
182
- export const WithContent: Story = {
183
- render: () => (
184
- <div className="max-w-md">
185
- <Card>
186
- <Typo variant="title-lg" bold="semibold">Product Feature</Typo>
187
- <Typo variant="body-md" className="mt-3">
188
- This card showcases how rich content looks with the glassmorphic background.
189
- </Typo>
190
- <div className="mt-4 space-y-2">
191
- <div className="flex items-start gap-2">
192
- <span className="text-[var(--success)]">✓</span>
193
- <Typo variant="body-sm">Fast performance</Typo>
194
- </div>
195
- <div className="flex items-start gap-2">
196
- <span className="text-[var(--success)]">✓</span>
197
- <Typo variant="body-sm">Easy to customize</Typo>
198
- </div>
199
- <div className="flex items-start gap-2">
200
- <span className="text-[var(--success)]">✓</span>
201
- <Typo variant="body-sm">Beautiful design</Typo>
202
- </div>
203
- </div>
204
- <div className="mt-6">
205
- <Button variant="primary">Learn More</Button>
206
- </div>
207
- </Card>
208
- </div>
209
- ),
210
- };
211
-
212
- export const MultipleCards: Story = {
213
- render: () => (
214
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
215
- <Card>
216
- <Typo variant="title-md" bold="semibold">Analytics</Typo>
217
- <Typo variant="display-md" bold="bold" className="mt-4">1,234</Typo>
218
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">Total Users</Typo>
219
- </Card>
220
- <Card>
221
- <Typo variant="title-md" bold="semibold">Revenue</Typo>
222
- <Typo variant="display-md" bold="bold" className="mt-4">$45.2K</Typo>
223
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">This Month</Typo>
224
- </Card>
225
- <Card>
226
- <Typo variant="title-md" bold="semibold">Growth</Typo>
227
- <Typo variant="display-md" bold="bold" className="mt-4">+24%</Typo>
228
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">vs Last Month</Typo>
229
- </Card>
230
- </div>
231
- ),
232
- };
233
-
234
- export const LargeCard: Story = {
235
- render: () => (
236
- <div className="max-w-3xl">
237
- <Card className="p-8">
238
- <div className="flex items-start justify-between">
239
- <div>
240
- <Typo variant="headline-md" bold="semibold">Welcome to NeoPTO UI</Typo>
241
- <Typo variant="body-lg" className="mt-2 text-[var(--muted-fg)]">
242
- A modern React component library
243
- </Typo>
244
- </div>
245
- <Button variant="primary">Get Started</Button>
246
- </div>
247
- <div className="mt-6 grid grid-cols-2 gap-6">
248
- <div>
249
- <Typo variant="label-lg" bold="semibold" className="text-[var(--color-brand)]">
250
- Modern Design
251
- </Typo>
252
- <Typo variant="body-md" className="mt-2">
253
- Built with the latest design trends and best practices for creating beautiful user interfaces.
254
- </Typo>
255
- </div>
256
- <div>
257
- <Typo variant="label-lg" bold="semibold" className="text-[var(--color-brand)]">
258
- Developer Friendly
259
- </Typo>
260
- <Typo variant="body-md" className="mt-2">
261
- Fully typed with TypeScript and documented with Storybook for the best developer experience.
262
- </Typo>
263
- </div>
264
- </div>
265
- </Card>
266
- </div>
267
- ),
268
- };
269
-
270
- export const CardList: Story = {
271
- render: () => (
272
- <div className="max-w-2xl space-y-3">
273
- {[1, 2, 3, 4].map((item) => (
274
- <Card key={item} className="p-4">
275
- <div className="flex items-center justify-between">
276
- <div className="flex items-center gap-4">
277
- <div className="w-12 h-12 rounded-full bg-[var(--muted)] flex items-center justify-center">
278
- <Typo variant="title-md" bold="semibold">{item}</Typo>
279
- </div>
280
- <div>
281
- <Typo variant="title-sm" bold="semibold">List Item {item}</Typo>
282
- <Typo variant="body-sm" className="text-[var(--muted-fg)]">
283
- Description for item {item}
284
- </Typo>
285
- </div>
286
- </div>
287
- <Button variant="ghost" size="sm">View</Button>
288
- </div>
289
- </Card>
290
- ))}
291
- </div>
292
- ),
293
- };
294
-
295
- export const NestedContent: Story = {
296
- render: () => (
297
- <div className="max-w-2xl">
298
- <Card>
299
- <Typo variant="headline-sm" bold="semibold">Project Dashboard</Typo>
300
- <div className="mt-4 space-y-3">
301
- <Card className="p-4 bg-[var(--muted)]">
302
- <Typo variant="title-sm" bold="medium">In Progress</Typo>
303
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">3 tasks remaining</Typo>
304
- </Card>
305
- <Card className="p-4 bg-[var(--muted)]">
306
- <Typo variant="title-sm" bold="medium">Completed</Typo>
307
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">15 tasks done</Typo>
308
- </Card>
309
- </div>
310
- </Card>
311
- </div>
312
- ),
313
- };
314
-
315
- export const FormCard: Story = {
316
- render: () => (
317
- <div className="max-w-md">
318
- <Card>
319
- <Typo variant="headline-sm" bold="semibold">Sign In</Typo>
320
- <Typo variant="body-sm" className="mt-1 text-[var(--muted-fg)]">
321
- Enter your credentials to continue
322
- </Typo>
323
- <form className="mt-6 space-y-4">
324
- <div>
325
- <label className="block mb-2">
326
- <Typo variant="label-md" bold="medium">Email</Typo>
327
- </label>
328
- <input
329
- type="email"
330
- placeholder="you@example.com"
331
- className="w-full px-4 py-3 rounded-2xl bg-[var(--muted)] border-none outline-none focus:ring-2 focus:ring-[var(--color-brand)]"
332
- />
333
- </div>
334
- <div>
335
- <label className="block mb-2">
336
- <Typo variant="label-md" bold="medium">Password</Typo>
337
- </label>
338
- <input
339
- type="password"
340
- placeholder="••••••••"
341
- className="w-full px-4 py-3 rounded-2xl bg-[var(--muted)] border-none outline-none focus:ring-2 focus:ring-[var(--color-brand)]"
342
- />
343
- </div>
344
- <Button variant="primary" className="w-full">Sign In</Button>
345
- </form>
346
- </Card>
347
- </div>
348
- ),
349
- };
350
-