@djangocfg/ui-core 2.1.382 → 2.1.384

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.
Files changed (61) hide show
  1. package/package.json +5 -12
  2. package/src/components/boundary/boundary.story.tsx +0 -191
  3. package/src/components/data/avatar/avatar.story.tsx +0 -115
  4. package/src/components/data/badge/badge.story.tsx +0 -56
  5. package/src/components/data/calendar/calendar.story.tsx +0 -127
  6. package/src/components/data/carousel/carousel.story.tsx +0 -122
  7. package/src/components/data/progress/progress.story.tsx +0 -97
  8. package/src/components/data/table/table.story.tsx +0 -148
  9. package/src/components/data/toggle/toggle.story.tsx +0 -104
  10. package/src/components/data/toggle-group/toggle-group.story.tsx +0 -118
  11. package/src/components/feedback/alert/alert.story.tsx +0 -77
  12. package/src/components/feedback/empty/empty.story.tsx +0 -115
  13. package/src/components/feedback/preloader/preloader.story.tsx +0 -86
  14. package/src/components/feedback/spinner/spinner.story.tsx +0 -66
  15. package/src/components/forms/button/button.story.tsx +0 -116
  16. package/src/components/forms/button-download/button-download.story.tsx +0 -112
  17. package/src/components/forms/button-group/button-group.story.tsx +0 -79
  18. package/src/components/forms/checkbox/checkbox.story.tsx +0 -89
  19. package/src/components/forms/input/input.story.tsx +0 -77
  20. package/src/components/forms/input-group/input-group.story.tsx +0 -119
  21. package/src/components/forms/input-otp/input-otp.story.tsx +0 -105
  22. package/src/components/forms/label/label.story.tsx +0 -52
  23. package/src/components/forms/radio-group/radio-group.story.tsx +0 -113
  24. package/src/components/forms/slider/slider.story.tsx +0 -134
  25. package/src/components/forms/switch/switch.story.tsx +0 -98
  26. package/src/components/forms/textarea/textarea.story.tsx +0 -94
  27. package/src/components/layout/aspect-ratio/aspect-ratio.story.tsx +0 -94
  28. package/src/components/layout/card/card.story.tsx +0 -105
  29. package/src/components/layout/resizable/resizable.story.tsx +0 -119
  30. package/src/components/layout/scroll-area/scroll-area.story.tsx +0 -172
  31. package/src/components/layout/separator/separator.story.tsx +0 -69
  32. package/src/components/layout/skeleton/skeleton.story.tsx +0 -101
  33. package/src/components/navigation/accordion/accordion.story.tsx +0 -110
  34. package/src/components/navigation/collapsible/collapsible.story.tsx +0 -133
  35. package/src/components/navigation/command/command.story.tsx +0 -121
  36. package/src/components/navigation/context-menu/context-menu.story.tsx +0 -125
  37. package/src/components/navigation/dropdown-menu/dropdown-menu.story.tsx +0 -208
  38. package/src/components/navigation/menubar/menubar.story.tsx +0 -152
  39. package/src/components/navigation/navigation-menu/navigation-menu.story.tsx +0 -154
  40. package/src/components/navigation/tabs/tabs.story.tsx +0 -98
  41. package/src/components/overlay/alert-dialog/alert-dialog.story.tsx +0 -104
  42. package/src/components/overlay/dialog/dialog.story.tsx +0 -212
  43. package/src/components/overlay/drawer/drawer.story.tsx +0 -359
  44. package/src/components/overlay/hover-card/hover-card.story.tsx +0 -102
  45. package/src/components/overlay/popover/popover.story.tsx +0 -127
  46. package/src/components/overlay/responsive-sheet/responsive-sheet.story.tsx +0 -117
  47. package/src/components/overlay/sheet/sheet.story.tsx +0 -148
  48. package/src/components/overlay/tooltip/tooltip.story.tsx +0 -139
  49. package/src/components/select/combobox-async.story.tsx +0 -215
  50. package/src/components/select/combobox.story.tsx +0 -226
  51. package/src/components/select/country-select.story.tsx +0 -261
  52. package/src/components/select/language-select.story.tsx +0 -264
  53. package/src/components/select/multi-select.story.tsx +0 -122
  54. package/src/components/select/select.story.tsx +0 -112
  55. package/src/components/specialized/copy/copy.story.tsx +0 -77
  56. package/src/components/specialized/flag/flag.story.tsx +0 -82
  57. package/src/components/specialized/image-with-fallback/image-with-fallback.story.tsx +0 -105
  58. package/src/components/specialized/kbd/kbd.story.tsx +0 -113
  59. package/src/lib/dialog-service/dialog-service.story.tsx +0 -263
  60. package/src/stories/index.ts +0 -28
  61. package/src/styles/theme/theme-tokens.story.tsx +0 -157
@@ -1,97 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
- import { defineStory, useNumber } from '@djangocfg/playground';
3
- import { Progress } from '.';
4
-
5
- export default defineStory({
6
- title: 'Core/Progress',
7
- component: Progress,
8
- description: 'Progress bar for showing completion status.',
9
- });
10
-
11
- export const Interactive = () => {
12
- const [value] = useNumber('value', {
13
- defaultValue: 60,
14
- min: 0,
15
- max: 100,
16
- label: 'Progress',
17
- description: 'Progress percentage',
18
- });
19
-
20
- return (
21
- <div className="max-w-md">
22
- <Progress value={value} />
23
- </div>
24
- );
25
- };
26
-
27
- export const Default = () => (
28
- <div className="max-w-md">
29
- <Progress value={60} />
30
- </div>
31
- );
32
-
33
- export const Values = () => (
34
- <div className="max-w-md space-y-4">
35
- <div className="space-y-1">
36
- <span className="text-sm">0%</span>
37
- <Progress value={0} />
38
- </div>
39
- <div className="space-y-1">
40
- <span className="text-sm">25%</span>
41
- <Progress value={25} />
42
- </div>
43
- <div className="space-y-1">
44
- <span className="text-sm">50%</span>
45
- <Progress value={50} />
46
- </div>
47
- <div className="space-y-1">
48
- <span className="text-sm">75%</span>
49
- <Progress value={75} />
50
- </div>
51
- <div className="space-y-1">
52
- <span className="text-sm">100%</span>
53
- <Progress value={100} />
54
- </div>
55
- </div>
56
- );
57
-
58
- export const Animated = () => {
59
- const [progress, setProgress] = useState(0);
60
-
61
- useEffect(() => {
62
- const timer = setInterval(() => {
63
- setProgress((prev) => {
64
- if (prev >= 100) return 0;
65
- return prev + 10;
66
- });
67
- }, 500);
68
-
69
- return () => clearInterval(timer);
70
- }, []);
71
-
72
- return (
73
- <div className="max-w-md space-y-2">
74
- <div className="flex justify-between text-sm">
75
- <span>Loading...</span>
76
- <span>{progress}%</span>
77
- </div>
78
- <Progress value={progress} />
79
- </div>
80
- );
81
- };
82
-
83
- export const WithLabel = () => (
84
- <div className="max-w-md space-y-2">
85
- <div className="flex justify-between text-sm">
86
- <span>Upload progress</span>
87
- <span>75%</span>
88
- </div>
89
- <Progress value={75} />
90
- </div>
91
- );
92
-
93
- export const Indeterminate = () => (
94
- <div className="max-w-md">
95
- <Progress className="[&>div]:animate-pulse" />
96
- </div>
97
- );
@@ -1,148 +0,0 @@
1
- import { defineStory } from '@djangocfg/playground';
2
- import {
3
- Table,
4
- TableBody,
5
- TableCaption,
6
- TableCell,
7
- TableHead,
8
- TableHeader,
9
- TableRow,
10
- } from '.';
11
- import { Badge } from '../../data/badge';
12
-
13
- export default defineStory({
14
- title: 'Core/Table',
15
- component: Table,
16
- description: 'Table for displaying tabular data.',
17
- });
18
-
19
- const invoices = [
20
- { id: 'INV001', status: 'Paid', method: 'Credit Card', amount: '$250.00' },
21
- { id: 'INV002', status: 'Pending', method: 'PayPal', amount: '$150.00' },
22
- { id: 'INV003', status: 'Unpaid', method: 'Bank Transfer', amount: '$350.00' },
23
- { id: 'INV004', status: 'Paid', method: 'Credit Card', amount: '$450.00' },
24
- { id: 'INV005', status: 'Paid', method: 'PayPal', amount: '$550.00' },
25
- ];
26
-
27
- const users = [
28
- { id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin', status: 'Active' },
29
- { id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User', status: 'Active' },
30
- { id: 3, name: 'Bob Johnson', email: 'bob@example.com', role: 'User', status: 'Inactive' },
31
- { id: 4, name: 'Alice Brown', email: 'alice@example.com', role: 'Editor', status: 'Active' },
32
- ];
33
-
34
- export const Default = () => (
35
- <Table>
36
- <TableCaption>A list of your recent invoices.</TableCaption>
37
- <TableHeader>
38
- <TableRow>
39
- <TableHead className="w-[100px]">Invoice</TableHead>
40
- <TableHead>Status</TableHead>
41
- <TableHead>Method</TableHead>
42
- <TableHead className="text-right">Amount</TableHead>
43
- </TableRow>
44
- </TableHeader>
45
- <TableBody>
46
- {invoices.map((invoice) => (
47
- <TableRow key={invoice.id}>
48
- <TableCell className="font-medium">{invoice.id}</TableCell>
49
- <TableCell>{invoice.status}</TableCell>
50
- <TableCell>{invoice.method}</TableCell>
51
- <TableCell className="text-right">{invoice.amount}</TableCell>
52
- </TableRow>
53
- ))}
54
- </TableBody>
55
- </Table>
56
- );
57
-
58
- export const WithBadges = () => (
59
- <Table>
60
- <TableHeader>
61
- <TableRow>
62
- <TableHead>Name</TableHead>
63
- <TableHead>Email</TableHead>
64
- <TableHead>Role</TableHead>
65
- <TableHead>Status</TableHead>
66
- </TableRow>
67
- </TableHeader>
68
- <TableBody>
69
- {users.map((user) => (
70
- <TableRow key={user.id}>
71
- <TableCell className="font-medium">{user.name}</TableCell>
72
- <TableCell>{user.email}</TableCell>
73
- <TableCell>
74
- <Badge variant="secondary">{user.role}</Badge>
75
- </TableCell>
76
- <TableCell>
77
- <Badge variant={user.status === 'Active' ? 'default' : 'outline'}>
78
- {user.status}
79
- </Badge>
80
- </TableCell>
81
- </TableRow>
82
- ))}
83
- </TableBody>
84
- </Table>
85
- );
86
-
87
- export const Striped = () => (
88
- <Table>
89
- <TableHeader>
90
- <TableRow>
91
- <TableHead>Invoice</TableHead>
92
- <TableHead>Status</TableHead>
93
- <TableHead>Method</TableHead>
94
- <TableHead className="text-right">Amount</TableHead>
95
- </TableRow>
96
- </TableHeader>
97
- <TableBody>
98
- {invoices.map((invoice, i) => (
99
- <TableRow key={invoice.id} className={i % 2 === 0 ? 'bg-muted/50' : ''}>
100
- <TableCell className="font-medium">{invoice.id}</TableCell>
101
- <TableCell>{invoice.status}</TableCell>
102
- <TableCell>{invoice.method}</TableCell>
103
- <TableCell className="text-right">{invoice.amount}</TableCell>
104
- </TableRow>
105
- ))}
106
- </TableBody>
107
- </Table>
108
- );
109
-
110
- export const Compact = () => (
111
- <Table>
112
- <TableHeader>
113
- <TableRow>
114
- <TableHead className="h-8">Invoice</TableHead>
115
- <TableHead className="h-8">Status</TableHead>
116
- <TableHead className="h-8">Amount</TableHead>
117
- </TableRow>
118
- </TableHeader>
119
- <TableBody>
120
- {invoices.slice(0, 3).map((invoice) => (
121
- <TableRow key={invoice.id}>
122
- <TableCell className="py-2">{invoice.id}</TableCell>
123
- <TableCell className="py-2">{invoice.status}</TableCell>
124
- <TableCell className="py-2">{invoice.amount}</TableCell>
125
- </TableRow>
126
- ))}
127
- </TableBody>
128
- </Table>
129
- );
130
-
131
- export const Empty = () => (
132
- <Table>
133
- <TableHeader>
134
- <TableRow>
135
- <TableHead>Invoice</TableHead>
136
- <TableHead>Status</TableHead>
137
- <TableHead>Amount</TableHead>
138
- </TableRow>
139
- </TableHeader>
140
- <TableBody>
141
- <TableRow>
142
- <TableCell colSpan={3} className="h-24 text-center text-muted-foreground">
143
- No results.
144
- </TableCell>
145
- </TableRow>
146
- </TableBody>
147
- </Table>
148
- );
@@ -1,104 +0,0 @@
1
- import { defineStory, useSelect, useBoolean } from '@djangocfg/playground';
2
- import { Toggle } from '.';
3
- import { Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight } from 'lucide-react';
4
-
5
- export default defineStory({
6
- title: 'Core/Toggle',
7
- component: Toggle,
8
- description: 'Toggle button for binary states.',
9
- });
10
-
11
- export const Interactive = () => {
12
- const [variant] = useSelect('variant', {
13
- options: ['default', 'outline'] as const,
14
- defaultValue: 'default',
15
- label: 'Variant',
16
- description: 'Toggle style',
17
- });
18
-
19
- const [size] = useSelect('size', {
20
- options: ['default', 'sm', 'lg'] as const,
21
- defaultValue: 'default',
22
- label: 'Size',
23
- description: 'Toggle size',
24
- });
25
-
26
- const [disabled] = useBoolean('disabled', {
27
- defaultValue: false,
28
- label: 'Disabled',
29
- description: 'Disable toggle',
30
- });
31
-
32
- return (
33
- <Toggle variant={variant} size={size} disabled={disabled}>
34
- <Bold className="h-4 w-4" />
35
- </Toggle>
36
- );
37
- };
38
-
39
- export const Default = () => (
40
- <Toggle aria-label="Toggle bold">
41
- <Bold className="h-4 w-4" />
42
- </Toggle>
43
- );
44
-
45
- export const Outline = () => (
46
- <Toggle variant="outline" aria-label="Toggle italic">
47
- <Italic className="h-4 w-4" />
48
- </Toggle>
49
- );
50
-
51
- export const WithText = () => (
52
- <Toggle aria-label="Toggle bold">
53
- <Bold className="h-4 w-4" />
54
- Bold
55
- </Toggle>
56
- );
57
-
58
- export const Sizes = () => (
59
- <div className="flex items-center gap-2">
60
- <Toggle size="sm" aria-label="Toggle bold">
61
- <Bold className="h-4 w-4" />
62
- </Toggle>
63
- <Toggle size="default" aria-label="Toggle bold">
64
- <Bold className="h-4 w-4" />
65
- </Toggle>
66
- <Toggle size="lg" aria-label="Toggle bold">
67
- <Bold className="h-4 w-4" />
68
- </Toggle>
69
- </div>
70
- );
71
-
72
- export const Disabled = () => (
73
- <Toggle disabled aria-label="Toggle bold">
74
- <Bold className="h-4 w-4" />
75
- </Toggle>
76
- );
77
-
78
- export const Formatting = () => (
79
- <div className="flex gap-1">
80
- <Toggle aria-label="Toggle bold">
81
- <Bold className="h-4 w-4" />
82
- </Toggle>
83
- <Toggle aria-label="Toggle italic">
84
- <Italic className="h-4 w-4" />
85
- </Toggle>
86
- <Toggle aria-label="Toggle underline">
87
- <Underline className="h-4 w-4" />
88
- </Toggle>
89
- </div>
90
- );
91
-
92
- export const Alignment = () => (
93
- <div className="flex gap-1">
94
- <Toggle aria-label="Align left" defaultPressed>
95
- <AlignLeft className="h-4 w-4" />
96
- </Toggle>
97
- <Toggle aria-label="Align center">
98
- <AlignCenter className="h-4 w-4" />
99
- </Toggle>
100
- <Toggle aria-label="Align right">
101
- <AlignRight className="h-4 w-4" />
102
- </Toggle>
103
- </div>
104
- );
@@ -1,118 +0,0 @@
1
- import { defineStory, useSelect, useBoolean } from '@djangocfg/playground';
2
- import { ToggleGroup, ToggleGroupItem } from '.';
3
- import { Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight, AlignJustify } from 'lucide-react';
4
-
5
- export default defineStory({
6
- title: 'Core/Toggle Group',
7
- component: ToggleGroup,
8
- description: 'Group of toggle buttons for multiple or single selection.',
9
- });
10
-
11
- export const Interactive = () => {
12
- const [type] = useSelect('type', {
13
- options: ['single', 'multiple'] as const,
14
- defaultValue: 'single',
15
- label: 'Type',
16
- description: 'Selection type',
17
- });
18
-
19
- const [variant] = useSelect('variant', {
20
- options: ['default', 'outline'] as const,
21
- defaultValue: 'default',
22
- label: 'Variant',
23
- description: 'Toggle style',
24
- });
25
-
26
- const [disabled] = useBoolean('disabled', {
27
- defaultValue: false,
28
- label: 'Disabled',
29
- description: 'Disable group',
30
- });
31
-
32
- return (
33
- <ToggleGroup type={type} variant={variant} disabled={disabled}>
34
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
35
- <Bold className="h-4 w-4" />
36
- </ToggleGroupItem>
37
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
38
- <Italic className="h-4 w-4" />
39
- </ToggleGroupItem>
40
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
41
- <Underline className="h-4 w-4" />
42
- </ToggleGroupItem>
43
- </ToggleGroup>
44
- );
45
- };
46
-
47
- export const Single = () => (
48
- <ToggleGroup type="single" defaultValue="center">
49
- <ToggleGroupItem value="left" aria-label="Align left">
50
- <AlignLeft className="h-4 w-4" />
51
- </ToggleGroupItem>
52
- <ToggleGroupItem value="center" aria-label="Align center">
53
- <AlignCenter className="h-4 w-4" />
54
- </ToggleGroupItem>
55
- <ToggleGroupItem value="right" aria-label="Align right">
56
- <AlignRight className="h-4 w-4" />
57
- </ToggleGroupItem>
58
- <ToggleGroupItem value="justify" aria-label="Justify">
59
- <AlignJustify className="h-4 w-4" />
60
- </ToggleGroupItem>
61
- </ToggleGroup>
62
- );
63
-
64
- export const Multiple = () => (
65
- <ToggleGroup type="multiple" defaultValue={['bold']}>
66
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
67
- <Bold className="h-4 w-4" />
68
- </ToggleGroupItem>
69
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
70
- <Italic className="h-4 w-4" />
71
- </ToggleGroupItem>
72
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
73
- <Underline className="h-4 w-4" />
74
- </ToggleGroupItem>
75
- </ToggleGroup>
76
- );
77
-
78
- export const Outline = () => (
79
- <ToggleGroup type="single" variant="outline" defaultValue="left">
80
- <ToggleGroupItem value="left" aria-label="Align left">
81
- <AlignLeft className="h-4 w-4" />
82
- </ToggleGroupItem>
83
- <ToggleGroupItem value="center" aria-label="Align center">
84
- <AlignCenter className="h-4 w-4" />
85
- </ToggleGroupItem>
86
- <ToggleGroupItem value="right" aria-label="Align right">
87
- <AlignRight className="h-4 w-4" />
88
- </ToggleGroupItem>
89
- </ToggleGroup>
90
- );
91
-
92
- export const Sizes = () => (
93
- <div className="flex flex-col gap-4">
94
- <ToggleGroup type="single" size="sm">
95
- <ToggleGroupItem value="left"><AlignLeft className="h-3 w-3" /></ToggleGroupItem>
96
- <ToggleGroupItem value="center"><AlignCenter className="h-3 w-3" /></ToggleGroupItem>
97
- <ToggleGroupItem value="right"><AlignRight className="h-3 w-3" /></ToggleGroupItem>
98
- </ToggleGroup>
99
- <ToggleGroup type="single" size="default">
100
- <ToggleGroupItem value="left"><AlignLeft className="h-4 w-4" /></ToggleGroupItem>
101
- <ToggleGroupItem value="center"><AlignCenter className="h-4 w-4" /></ToggleGroupItem>
102
- <ToggleGroupItem value="right"><AlignRight className="h-4 w-4" /></ToggleGroupItem>
103
- </ToggleGroup>
104
- <ToggleGroup type="single" size="lg">
105
- <ToggleGroupItem value="left"><AlignLeft className="h-5 w-5" /></ToggleGroupItem>
106
- <ToggleGroupItem value="center"><AlignCenter className="h-5 w-5" /></ToggleGroupItem>
107
- <ToggleGroupItem value="right"><AlignRight className="h-5 w-5" /></ToggleGroupItem>
108
- </ToggleGroup>
109
- </div>
110
- );
111
-
112
- export const Disabled = () => (
113
- <ToggleGroup type="single" disabled>
114
- <ToggleGroupItem value="left"><AlignLeft className="h-4 w-4" /></ToggleGroupItem>
115
- <ToggleGroupItem value="center"><AlignCenter className="h-4 w-4" /></ToggleGroupItem>
116
- <ToggleGroupItem value="right"><AlignRight className="h-4 w-4" /></ToggleGroupItem>
117
- </ToggleGroup>
118
- );
@@ -1,77 +0,0 @@
1
- import { defineStory, useSelect } from '@djangocfg/playground';
2
- import { Alert, AlertTitle, AlertDescription } from '.';
3
- import { AlertCircle, CheckCircle2, Info, AlertTriangle } from 'lucide-react';
4
-
5
- export default defineStory({
6
- title: 'Core/Alert',
7
- component: Alert,
8
- description: 'Alert messages for important information.',
9
- });
10
-
11
- export const Interactive = () => {
12
- const [variant] = useSelect('variant', {
13
- options: ['default', 'destructive'] as const,
14
- defaultValue: 'default',
15
- label: 'Variant',
16
- description: 'Alert style variant',
17
- });
18
-
19
- return (
20
- <Alert variant={variant} className="max-w-lg">
21
- <AlertCircle className="h-4 w-4" />
22
- <AlertTitle>Heads up!</AlertTitle>
23
- <AlertDescription>
24
- You can add components to your app using the CLI.
25
- </AlertDescription>
26
- </Alert>
27
- );
28
- };
29
-
30
- export const Default = () => (
31
- <Alert className="max-w-lg">
32
- <Info className="h-4 w-4" />
33
- <AlertTitle>Information</AlertTitle>
34
- <AlertDescription>
35
- This is an informational alert message.
36
- </AlertDescription>
37
- </Alert>
38
- );
39
-
40
- export const Destructive = () => (
41
- <Alert variant="destructive" className="max-w-lg">
42
- <AlertCircle className="h-4 w-4" />
43
- <AlertTitle>Error</AlertTitle>
44
- <AlertDescription>
45
- Your session has expired. Please log in again.
46
- </AlertDescription>
47
- </Alert>
48
- );
49
-
50
- export const Success = () => (
51
- <Alert className="max-w-lg border-green-500/50 text-green-600 [&>svg]:text-green-600">
52
- <CheckCircle2 className="h-4 w-4" />
53
- <AlertTitle>Success</AlertTitle>
54
- <AlertDescription>
55
- Your changes have been saved successfully.
56
- </AlertDescription>
57
- </Alert>
58
- );
59
-
60
- export const Warning = () => (
61
- <Alert className="max-w-lg border-yellow-500/50 text-yellow-600 [&>svg]:text-yellow-600">
62
- <AlertTriangle className="h-4 w-4" />
63
- <AlertTitle>Warning</AlertTitle>
64
- <AlertDescription>
65
- Your subscription will expire in 3 days.
66
- </AlertDescription>
67
- </Alert>
68
- );
69
-
70
- export const WithoutIcon = () => (
71
- <Alert className="max-w-lg">
72
- <AlertTitle>Note</AlertTitle>
73
- <AlertDescription>
74
- You can also use alerts without icons.
75
- </AlertDescription>
76
- </Alert>
77
- );
@@ -1,115 +0,0 @@
1
- import { defineStory } from '@djangocfg/playground';
2
- import {
3
- Empty,
4
- EmptyHeader,
5
- EmptyTitle,
6
- EmptyDescription,
7
- EmptyContent,
8
- EmptyMedia,
9
- } from '.';
10
- import { Button } from '../../forms/button';
11
- import { Inbox, Search, FileQuestion, Plus, RefreshCw } from 'lucide-react';
12
-
13
- export default defineStory({
14
- title: 'Core/Empty',
15
- component: Empty,
16
- description: 'Empty state placeholder for no content.',
17
- });
18
-
19
- export const Default = () => (
20
- <Empty className="max-w-md mx-auto py-10">
21
- <EmptyMedia>
22
- <Inbox className="h-12 w-12 text-muted-foreground" />
23
- </EmptyMedia>
24
- <EmptyHeader>
25
- <EmptyTitle>No items</EmptyTitle>
26
- <EmptyDescription>
27
- You don't have any items yet. Create your first one to get started.
28
- </EmptyDescription>
29
- </EmptyHeader>
30
- <EmptyContent>
31
- <Button>
32
- <Plus className="mr-2 h-4 w-4" />
33
- Create Item
34
- </Button>
35
- </EmptyContent>
36
- </Empty>
37
- );
38
-
39
- export const SearchNoResults = () => (
40
- <Empty className="max-w-md mx-auto py-10">
41
- <EmptyMedia>
42
- <Search className="h-12 w-12 text-muted-foreground" />
43
- </EmptyMedia>
44
- <EmptyHeader>
45
- <EmptyTitle>No results found</EmptyTitle>
46
- <EmptyDescription>
47
- We couldn't find anything matching your search. Try adjusting your filters.
48
- </EmptyDescription>
49
- </EmptyHeader>
50
- <EmptyContent>
51
- <Button variant="outline">Clear filters</Button>
52
- </EmptyContent>
53
- </Empty>
54
- );
55
-
56
- export const Error = () => (
57
- <Empty className="max-w-md mx-auto py-10">
58
- <EmptyMedia>
59
- <FileQuestion className="h-12 w-12 text-muted-foreground" />
60
- </EmptyMedia>
61
- <EmptyHeader>
62
- <EmptyTitle>Something went wrong</EmptyTitle>
63
- <EmptyDescription>
64
- We encountered an error while loading the data. Please try again.
65
- </EmptyDescription>
66
- </EmptyHeader>
67
- <EmptyContent>
68
- <Button variant="outline">
69
- <RefreshCw className="mr-2 h-4 w-4" />
70
- Retry
71
- </Button>
72
- </EmptyContent>
73
- </Empty>
74
- );
75
-
76
- export const NoNotifications = () => (
77
- <Empty className="max-w-sm mx-auto py-8">
78
- <EmptyMedia>
79
- <Inbox className="h-10 w-10 text-muted-foreground" />
80
- </EmptyMedia>
81
- <EmptyHeader>
82
- <EmptyTitle>All caught up!</EmptyTitle>
83
- <EmptyDescription>
84
- You have no new notifications.
85
- </EmptyDescription>
86
- </EmptyHeader>
87
- </Empty>
88
- );
89
-
90
- export const Simple = () => (
91
- <Empty className="max-w-xs mx-auto py-6">
92
- <EmptyHeader>
93
- <EmptyTitle>No data</EmptyTitle>
94
- <EmptyDescription>
95
- Start by adding some data.
96
- </EmptyDescription>
97
- </EmptyHeader>
98
- </Empty>
99
- );
100
-
101
- export const InCard = () => (
102
- <div className="rounded-lg border p-6">
103
- <Empty>
104
- <EmptyMedia>
105
- <Inbox className="h-8 w-8 text-muted-foreground" />
106
- </EmptyMedia>
107
- <EmptyHeader>
108
- <EmptyTitle className="text-base">Empty inbox</EmptyTitle>
109
- <EmptyDescription className="text-sm">
110
- No messages to display
111
- </EmptyDescription>
112
- </EmptyHeader>
113
- </Empty>
114
- </div>
115
- );