@postxl/generators 1.1.1 → 1.2.0
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/frontend-core/frontend.generator.d.ts +0 -58
- package/dist/frontend-core/frontend.generator.js +6 -172
- package/dist/frontend-core/frontend.generator.js.map +1 -1
- package/dist/frontend-core/template/README.md +1 -1
- package/dist/frontend-core/template/src/components/admin/table-filter.tsx +1 -5
- package/dist/frontend-core/template/src/components/ui/color-mode-toggle/color-mode-toggle.tsx +10 -4
- package/dist/frontend-core/template/src/pages/dashboard/dashboard.page.tsx +2 -3
- package/dist/frontend-core/template/src/pages/error/default-error.page.tsx +1 -1
- package/dist/frontend-core/template/src/pages/error/not-found-error.page.tsx +1 -1
- package/dist/frontend-core/template/src/styles/styles.css +13 -1
- package/dist/frontend-core/template/tsconfig.json +2 -0
- package/dist/frontend-core/types/component.d.ts +1 -1
- package/dist/frontend-forms/generators/discriminated-union/fields.generator.js +4 -6
- package/dist/frontend-forms/generators/discriminated-union/fields.generator.js.map +1 -1
- package/dist/frontend-forms/generators/discriminated-union/inputs.generator.js +1 -1
- package/dist/frontend-forms/generators/discriminated-union/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/generators/enum/inputs.generator.js +1 -1
- package/dist/frontend-forms/generators/enum/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/generators/model/forms.generator.js +8 -12
- package/dist/frontend-forms/generators/model/forms.generator.js.map +1 -1
- package/dist/frontend-forms/generators/model/inputs.generator.js +2 -6
- package/dist/frontend-forms/generators/model/inputs.generator.js.map +1 -1
- package/dist/frontend-forms/template/src/components/ui/field/field.tsx +1 -4
- package/dist/frontend-tables/generators/model-table.generator.js +1 -5
- package/dist/frontend-tables/generators/model-table.generator.js.map +1 -1
- package/package.json +3 -2
- package/dist/frontend-core/template/src/components/ui/accordion/accordion.stories.tsx +0 -47
- package/dist/frontend-core/template/src/components/ui/accordion/accordion.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/admin-sidebar/admin-sidebar.tsx +0 -195
- package/dist/frontend-core/template/src/components/ui/alert/alert.stories.tsx +0 -61
- package/dist/frontend-core/template/src/components/ui/alert/alert.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/alert-dialog/alert-dialog.stories.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/alert-dialog/alert-dialog.tsx +0 -105
- package/dist/frontend-core/template/src/components/ui/avatar/avatar.stories.tsx +0 -30
- package/dist/frontend-core/template/src/components/ui/avatar/avatar.tsx +0 -39
- package/dist/frontend-core/template/src/components/ui/badge/badge.stories.tsx +0 -78
- package/dist/frontend-core/template/src/components/ui/badge/badge.tsx +0 -48
- package/dist/frontend-core/template/src/components/ui/breadcrumb/breadcrumb.stories.tsx +0 -67
- package/dist/frontend-core/template/src/components/ui/breadcrumb/breadcrumb.tsx +0 -85
- package/dist/frontend-core/template/src/components/ui/button/button.stories.tsx +0 -150
- package/dist/frontend-core/template/src/components/ui/button/button.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/calendar/calendar.stories.tsx +0 -160
- package/dist/frontend-core/template/src/components/ui/calendar/calendar.tsx +0 -293
- package/dist/frontend-core/template/src/components/ui/card/card.stories.tsx +0 -77
- package/dist/frontend-core/template/src/components/ui/card/card.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/card-hover/card-hover.stories.tsx +0 -29
- package/dist/frontend-core/template/src/components/ui/card-hover/card-hover.tsx +0 -28
- package/dist/frontend-core/template/src/components/ui/carousel/carousel.stories.tsx +0 -154
- package/dist/frontend-core/template/src/components/ui/carousel/carousel.tsx +0 -227
- package/dist/frontend-core/template/src/components/ui/checkbox/checkbox.stories.tsx +0 -106
- package/dist/frontend-core/template/src/components/ui/checkbox/checkbox.tsx +0 -88
- package/dist/frontend-core/template/src/components/ui/checkbox/shadcn-checkbox.stories.tsx +0 -90
- package/dist/frontend-core/template/src/components/ui/checkbox/shadcn-checkbox.tsx +0 -54
- package/dist/frontend-core/template/src/components/ui/collapse/collapse.stories.tsx +0 -52
- package/dist/frontend-core/template/src/components/ui/collapse/collapse.tsx +0 -9
- package/dist/frontend-core/template/src/components/ui/combobox/combobox.stories.tsx +0 -207
- package/dist/frontend-core/template/src/components/ui/combobox/combobox.tsx +0 -79
- package/dist/frontend-core/template/src/components/ui/command/command.stories.tsx +0 -186
- package/dist/frontend-core/template/src/components/ui/command/command.tsx +0 -165
- package/dist/frontend-core/template/src/components/ui/command-palette/command-palette.stories.tsx +0 -160
- package/dist/frontend-core/template/src/components/ui/command-palette/command-palette.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/content-frame/content-frame.stories.tsx +0 -198
- package/dist/frontend-core/template/src/components/ui/content-frame/content-frame.tsx +0 -100
- package/dist/frontend-core/template/src/components/ui/context-menu/context-menu.stories.tsx +0 -78
- package/dist/frontend-core/template/src/components/ui/context-menu/context-menu.tsx +0 -179
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/cell-variant-types.ts +0 -11
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/checkbox-cell.tsx +0 -116
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/date-cell.tsx +0 -157
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/gantt-cell.tsx +0 -82
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/long-text-cell.tsx +0 -180
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/multi-select-cell.tsx +0 -280
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/number-cell.tsx +0 -169
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/react-node-cell.tsx +0 -33
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/select-cell.tsx +0 -175
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/short-text-cell.tsx +0 -138
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/utils/gantt-timeline.tsx +0 -92
- package/dist/frontend-core/template/src/components/ui/data-grid/cell-variants/utils/gantt-timerange-picker.tsx +0 -330
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell-wrapper.tsx +0 -212
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-cell.tsx +0 -157
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-column-header.tsx +0 -340
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-context-menu.tsx +0 -271
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-row.tsx +0 -123
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-search.tsx +0 -211
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-types.ts +0 -159
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-utils.ts +0 -67
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid-view-menu.tsx +0 -360
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid.stories.tsx +0 -780
- package/dist/frontend-core/template/src/components/ui/data-grid/data-grid.tsx +0 -217
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-callback-ref.ts +0 -22
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-data-grid.tsx +0 -1892
- package/dist/frontend-core/template/src/components/ui/data-grid/hooks/use-debounced-callback.ts +0 -19
- package/dist/frontend-core/template/src/components/ui/data-grid/styles.css +0 -3
- package/dist/frontend-core/template/src/components/ui/data-table/context-menu-simple.tsx +0 -141
- package/dist/frontend-core/template/src/components/ui/data-table/data-table.stories.tsx +0 -146
- package/dist/frontend-core/template/src/components/ui/data-table/data-table.tsx +0 -447
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/country-array-cell-renderer.tsx +0 -77
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/country-cell-renderer.tsx +0 -56
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/favorite-cell-renderer.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/data-table/renderers/links-cell-renderer.tsx +0 -205
- package/dist/frontend-core/template/src/components/ui/data-table/utils/columns.ts +0 -351
- package/dist/frontend-core/template/src/components/ui/data-table/utils/data-table.utils.ts +0 -49
- package/dist/frontend-core/template/src/components/ui/date-picker/date-picker.stories.tsx +0 -149
- package/dist/frontend-core/template/src/components/ui/date-picker/date-picker.tsx +0 -30
- package/dist/frontend-core/template/src/components/ui/dialog/dialog.stories.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/dialog/dialog.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/drawer/drawer.stories.tsx +0 -104
- package/dist/frontend-core/template/src/components/ui/drawer/drawer.tsx +0 -87
- package/dist/frontend-core/template/src/components/ui/dropdown-menu/dropdown-menu.stories.tsx +0 -168
- package/dist/frontend-core/template/src/components/ui/dropdown-menu/dropdown-menu.tsx +0 -225
- package/dist/frontend-core/template/src/components/ui/input/input.stories.tsx +0 -141
- package/dist/frontend-core/template/src/components/ui/input/input.tsx +0 -47
- package/dist/frontend-core/template/src/components/ui/label/label.stories.tsx +0 -41
- package/dist/frontend-core/template/src/components/ui/label/label.tsx +0 -20
- package/dist/frontend-core/template/src/components/ui/loader/loader.stories.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/loader/loader.tsx +0 -17
- package/dist/frontend-core/template/src/components/ui/mark-value-renderer/mark-value-renderer.stories.tsx +0 -114
- package/dist/frontend-core/template/src/components/ui/mark-value-renderer/mark-value-renderer.tsx +0 -48
- package/dist/frontend-core/template/src/components/ui/menubar/menu.stories.tsx +0 -134
- package/dist/frontend-core/template/src/components/ui/menubar/menubar.tsx +0 -208
- package/dist/frontend-core/template/src/components/ui/modal/modal.stories.tsx +0 -297
- package/dist/frontend-core/template/src/components/ui/modal/modal.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/navigation-menu/navigation-menu.stories.tsx +0 -213
- package/dist/frontend-core/template/src/components/ui/navigation-menu/navigation-menu.tsx +0 -142
- package/dist/frontend-core/template/src/components/ui/pagination/pagination.stories.tsx +0 -49
- package/dist/frontend-core/template/src/components/ui/pagination/pagination.tsx +0 -84
- package/dist/frontend-core/template/src/components/ui/popover/popover.stories.tsx +0 -82
- package/dist/frontend-core/template/src/components/ui/popover/popover.tsx +0 -55
- package/dist/frontend-core/template/src/components/ui/progress/progress.stories.tsx +0 -80
- package/dist/frontend-core/template/src/components/ui/progress/progress.tsx +0 -17
- package/dist/frontend-core/template/src/components/ui/radio-group/radio-group.stories.tsx +0 -154
- package/dist/frontend-core/template/src/components/ui/radio-group/radio-group.tsx +0 -68
- package/dist/frontend-core/template/src/components/ui/resizable/resizable.stories.tsx +0 -73
- package/dist/frontend-core/template/src/components/ui/resizable/resizeable.tsx +0 -38
- package/dist/frontend-core/template/src/components/ui/scroll-area/scroll-area.stories.tsx +0 -55
- package/dist/frontend-core/template/src/components/ui/scroll-area/scroll-area.tsx +0 -39
- package/dist/frontend-core/template/src/components/ui/select/select.stories.tsx +0 -297
- package/dist/frontend-core/template/src/components/ui/select/select.tsx +0 -227
- package/dist/frontend-core/template/src/components/ui/separator/separator.tsx +0 -21
- package/dist/frontend-core/template/src/components/ui/separator/seperator.stories.tsx +0 -25
- package/dist/frontend-core/template/src/components/ui/sheet/sheet.stories.tsx +0 -45
- package/dist/frontend-core/template/src/components/ui/sheet/sheet.tsx +0 -107
- package/dist/frontend-core/template/src/components/ui/skeleton/skeleton.stories.tsx +0 -26
- package/dist/frontend-core/template/src/components/ui/skeleton/skeleton.tsx +0 -7
- package/dist/frontend-core/template/src/components/ui/slider/slider.stories.tsx +0 -101
- package/dist/frontend-core/template/src/components/ui/slider/slider.tsx +0 -98
- package/dist/frontend-core/template/src/components/ui/spinner/spinner.stories.tsx +0 -19
- package/dist/frontend-core/template/src/components/ui/spinner/spinner.tsx +0 -21
- package/dist/frontend-core/template/src/components/ui/switch/switch.stories.tsx +0 -33
- package/dist/frontend-core/template/src/components/ui/switch/switch.tsx +0 -28
- package/dist/frontend-core/template/src/components/ui/tabs/tabs.stories.tsx +0 -215
- package/dist/frontend-core/template/src/components/ui/tabs/tabs.tsx +0 -70
- package/dist/frontend-core/template/src/components/ui/textarea/textarea.stories.tsx +0 -138
- package/dist/frontend-core/template/src/components/ui/textarea/textarea.tsx +0 -40
- package/dist/frontend-core/template/src/components/ui/toast/toast.mdx +0 -31
- package/dist/frontend-core/template/src/components/ui/toast/toast.stories.tsx +0 -89
- package/dist/frontend-core/template/src/components/ui/toggle/toggle.stories.tsx +0 -65
- package/dist/frontend-core/template/src/components/ui/toggle/toggle.tsx +0 -38
- package/dist/frontend-core/template/src/components/ui/toggle-group/toggle-group.stories.tsx +0 -85
- package/dist/frontend-core/template/src/components/ui/toggle-group/toggle-group.tsx +0 -54
- package/dist/frontend-core/template/src/components/ui/tooltip/tooltip.stories.tsx +0 -29
- package/dist/frontend-core/template/src/components/ui/tooltip/tooltip.tsx +0 -29
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@lib/utils'
|
|
5
|
-
|
|
6
|
-
const alertVariants = cva(
|
|
7
|
-
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: 'bg-background text-foreground',
|
|
12
|
-
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
defaultVariants: {
|
|
16
|
-
variant: 'default',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const Alert = React.forwardRef<
|
|
22
|
-
HTMLDivElement,
|
|
23
|
-
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
24
|
-
>(({ className, variant, ...props }, ref) => (
|
|
25
|
-
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
|
|
26
|
-
))
|
|
27
|
-
Alert.displayName = 'Alert'
|
|
28
|
-
|
|
29
|
-
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
30
|
-
({ className, children, ...props }, ref) => (
|
|
31
|
-
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props}>
|
|
32
|
-
{children}
|
|
33
|
-
</h5>
|
|
34
|
-
),
|
|
35
|
-
)
|
|
36
|
-
AlertTitle.displayName = 'AlertTitle'
|
|
37
|
-
|
|
38
|
-
const AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
39
|
-
({ className, ...props }, ref) => (
|
|
40
|
-
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
41
|
-
),
|
|
42
|
-
)
|
|
43
|
-
AlertDescription.displayName = 'AlertDescription'
|
|
44
|
-
|
|
45
|
-
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AlertDialog,
|
|
5
|
-
AlertDialogAction,
|
|
6
|
-
AlertDialogCancel,
|
|
7
|
-
AlertDialogContent,
|
|
8
|
-
AlertDialogDescription,
|
|
9
|
-
AlertDialogFooter,
|
|
10
|
-
AlertDialogHeader,
|
|
11
|
-
AlertDialogTitle,
|
|
12
|
-
AlertDialogTrigger,
|
|
13
|
-
} from './alert-dialog'
|
|
14
|
-
|
|
15
|
-
const meta = {
|
|
16
|
-
title: 'AlertDialog',
|
|
17
|
-
component: AlertDialog,
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
} satisfies Meta<typeof AlertDialog>
|
|
20
|
-
|
|
21
|
-
export default meta
|
|
22
|
-
|
|
23
|
-
export const Default: StoryObj<typeof meta> = {
|
|
24
|
-
parameters: {
|
|
25
|
-
docs: {
|
|
26
|
-
description: {
|
|
27
|
-
story:
|
|
28
|
-
'The alert-dialog is a modal dialog that alerts the user of a situation that requires their attention and provides actions to address the situation.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
render: () => (
|
|
33
|
-
<div className="flex items-center justify-center">
|
|
34
|
-
<AlertDialog>
|
|
35
|
-
<AlertDialogTrigger>Open</AlertDialogTrigger>
|
|
36
|
-
<AlertDialogContent>
|
|
37
|
-
<AlertDialogHeader>
|
|
38
|
-
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
39
|
-
<AlertDialogDescription>
|
|
40
|
-
This action cannot be undone. This will permanently delete your account and remove your data from our
|
|
41
|
-
servers.
|
|
42
|
-
</AlertDialogDescription>
|
|
43
|
-
</AlertDialogHeader>
|
|
44
|
-
<AlertDialogFooter>
|
|
45
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
46
|
-
<AlertDialogAction>Continue</AlertDialogAction>
|
|
47
|
-
</AlertDialogFooter>
|
|
48
|
-
</AlertDialogContent>
|
|
49
|
-
</AlertDialog>
|
|
50
|
-
</div>
|
|
51
|
-
),
|
|
52
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
|
|
5
|
-
import { buttonVariants } from '@components/ui/button/button'
|
|
6
|
-
import { cn } from '@lib/utils'
|
|
7
|
-
|
|
8
|
-
const AlertDialog = AlertDialogPrimitive.Root
|
|
9
|
-
|
|
10
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
11
|
-
|
|
12
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
13
|
-
|
|
14
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
15
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
17
|
-
>(({ className, ...props }, ref) => (
|
|
18
|
-
<AlertDialogPrimitive.Overlay
|
|
19
|
-
className={cn(
|
|
20
|
-
'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',
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
ref={ref}
|
|
25
|
-
/>
|
|
26
|
-
))
|
|
27
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
28
|
-
|
|
29
|
-
const AlertDialogContent = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
33
|
-
<AlertDialogPortal>
|
|
34
|
-
<AlertDialogOverlay />
|
|
35
|
-
<AlertDialogPrimitive.Content
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(
|
|
38
|
-
'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=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',
|
|
39
|
-
className,
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
</AlertDialogPortal>
|
|
44
|
-
))
|
|
45
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
46
|
-
|
|
47
|
-
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
48
|
-
<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
|
|
49
|
-
)
|
|
50
|
-
AlertDialogHeader.displayName = 'AlertDialogHeader'
|
|
51
|
-
|
|
52
|
-
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
53
|
-
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
|
|
54
|
-
)
|
|
55
|
-
AlertDialogFooter.displayName = 'AlertDialogFooter'
|
|
56
|
-
|
|
57
|
-
const AlertDialogTitle = React.forwardRef<
|
|
58
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
59
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
60
|
-
>(({ className, ...props }, ref) => (
|
|
61
|
-
<AlertDialogPrimitive.Title ref={ref} className={cn('text-lg font-semibold', className)} {...props} />
|
|
62
|
-
))
|
|
63
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
64
|
-
|
|
65
|
-
const AlertDialogDescription = React.forwardRef<
|
|
66
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
67
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
68
|
-
>(({ className, ...props }, ref) => (
|
|
69
|
-
<AlertDialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
70
|
-
))
|
|
71
|
-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName
|
|
72
|
-
|
|
73
|
-
const AlertDialogAction = React.forwardRef<
|
|
74
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
75
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
76
|
-
>(({ className, ...props }, ref) => (
|
|
77
|
-
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
78
|
-
))
|
|
79
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
80
|
-
|
|
81
|
-
const AlertDialogCancel = React.forwardRef<
|
|
82
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
83
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
84
|
-
>(({ className, ...props }, ref) => (
|
|
85
|
-
<AlertDialogPrimitive.Cancel
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
))
|
|
91
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
AlertDialog,
|
|
95
|
-
AlertDialogPortal,
|
|
96
|
-
AlertDialogOverlay,
|
|
97
|
-
AlertDialogTrigger,
|
|
98
|
-
AlertDialogContent,
|
|
99
|
-
AlertDialogHeader,
|
|
100
|
-
AlertDialogFooter,
|
|
101
|
-
AlertDialogTitle,
|
|
102
|
-
AlertDialogDescription,
|
|
103
|
-
AlertDialogAction,
|
|
104
|
-
AlertDialogCancel,
|
|
105
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
|
|
3
|
-
import { Avatar, AvatarFallback, AvatarImage } from './avatar'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Avatar',
|
|
7
|
-
component: Avatar,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
} satisfies Meta<typeof Avatar>
|
|
10
|
-
|
|
11
|
-
export default meta
|
|
12
|
-
|
|
13
|
-
export const Default: StoryObj<typeof meta> = {
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
story:
|
|
18
|
-
'The Avatar component is used to represent a user or entity. It can contain an image or fallback to initials.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
render: () => (
|
|
23
|
-
<div className="flex items-center justify-center">
|
|
24
|
-
<Avatar>
|
|
25
|
-
<AvatarImage src="https://github.com/shadcn.png" />
|
|
26
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
27
|
-
</Avatar>
|
|
28
|
-
</div>
|
|
29
|
-
),
|
|
30
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@lib/utils'
|
|
6
|
-
|
|
7
|
-
const Avatar = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
11
|
-
<AvatarPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
))
|
|
17
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
18
|
-
|
|
19
|
-
const AvatarImage = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
22
|
-
>(({ className, ...props }, ref) => (
|
|
23
|
-
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square h-full w-full', className)} {...props} />
|
|
24
|
-
))
|
|
25
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
26
|
-
|
|
27
|
-
const AvatarFallback = React.forwardRef<
|
|
28
|
-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
29
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
30
|
-
>(({ className, ...props }, ref) => (
|
|
31
|
-
<AvatarPrimitive.Fallback
|
|
32
|
-
ref={ref}
|
|
33
|
-
className={cn('flex h-full w-full items-center justify-center rounded-full bg-muted', className)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
))
|
|
37
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
38
|
-
|
|
39
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
|
|
3
|
-
import { Badge } from './badge'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Badge',
|
|
7
|
-
component: Badge,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
variant: {
|
|
14
|
-
control: 'select',
|
|
15
|
-
options: ['default', 'secondary', 'destructive', 'outline', 'filter', 'info'],
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
control: 'select',
|
|
19
|
-
options: ['default', 'xs', 'sm', 'md', 'lg'],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
} satisfies Meta<typeof Badge>
|
|
23
|
-
export default meta
|
|
24
|
-
|
|
25
|
-
type Story = StoryObj<typeof meta>
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
args: { variant: 'default', size: 'default' },
|
|
29
|
-
render: (args) => <Badge {...args}>Badge</Badge>,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const Variants: Story = {
|
|
33
|
-
render: () => (
|
|
34
|
-
<div className="flex flex-wrap gap-2">
|
|
35
|
-
<Badge variant="default">Default</Badge>
|
|
36
|
-
<Badge variant="secondary">Secondary</Badge>
|
|
37
|
-
<Badge variant="destructive">Destructive</Badge>
|
|
38
|
-
<Badge variant="outline">Outline</Badge>
|
|
39
|
-
<Badge variant="filter">Filter</Badge>
|
|
40
|
-
<Badge variant="info">Info</Badge>
|
|
41
|
-
</div>
|
|
42
|
-
),
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const Sizes: Story = {
|
|
46
|
-
render: () => (
|
|
47
|
-
<div className="flex flex-wrap gap-2 items-center">
|
|
48
|
-
<Badge size="xs">Extra Small</Badge>
|
|
49
|
-
<Badge size="sm">Small</Badge>
|
|
50
|
-
<Badge size="default">Default</Badge>
|
|
51
|
-
<Badge size="md">Medium</Badge>
|
|
52
|
-
<Badge size="lg">Large</Badge>
|
|
53
|
-
</div>
|
|
54
|
-
),
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const WithIcon: Story = {
|
|
58
|
-
render: () => (
|
|
59
|
-
<Badge>
|
|
60
|
-
<svg
|
|
61
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
62
|
-
width="24"
|
|
63
|
-
height="24"
|
|
64
|
-
viewBox="0 0 24 24"
|
|
65
|
-
fill="none"
|
|
66
|
-
stroke="currentColor"
|
|
67
|
-
strokeWidth="2"
|
|
68
|
-
strokeLinecap="round"
|
|
69
|
-
strokeLinejoin="round"
|
|
70
|
-
>
|
|
71
|
-
<circle cx="12" cy="12" r="10" />
|
|
72
|
-
<path d="m15 9-6 6" />
|
|
73
|
-
<path d="m9 9 6 6" />
|
|
74
|
-
</svg>
|
|
75
|
-
With Icon
|
|
76
|
-
</Badge>
|
|
77
|
-
),
|
|
78
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
2
|
-
|
|
3
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
-
import * as React from 'react'
|
|
5
|
-
|
|
6
|
-
import { cn } from '@lib/utils'
|
|
7
|
-
|
|
8
|
-
const badgeVariants = cva(
|
|
9
|
-
'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-base font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
|
14
|
-
secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
|
15
|
-
destructive:
|
|
16
|
-
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
|
17
|
-
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
|
18
|
-
filter: 'bg-primary text-background border-0',
|
|
19
|
-
info: 'bg-yellow-500 text-foreground border-0',
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
default: '',
|
|
23
|
-
xs: 'h-3.5 text-sm',
|
|
24
|
-
sm: 'h-4.5 text-xs',
|
|
25
|
-
md: 'h-6 text-md',
|
|
26
|
-
lg: 'h-8 text-lg',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: 'default',
|
|
31
|
-
size: 'default',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
function Badge({
|
|
37
|
-
className,
|
|
38
|
-
variant,
|
|
39
|
-
size,
|
|
40
|
-
asChild = false,
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
43
|
-
const Comp = asChild ? Slot : 'span'
|
|
44
|
-
|
|
45
|
-
return <Comp data-slot="badge" className={cn(badgeVariants({ variant, size }), className)} {...props} />
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { Badge, badgeVariants }
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Breadcrumb,
|
|
5
|
-
BreadcrumbEllipsis,
|
|
6
|
-
BreadcrumbItem,
|
|
7
|
-
BreadcrumbLink,
|
|
8
|
-
BreadcrumbList,
|
|
9
|
-
BreadcrumbPage,
|
|
10
|
-
BreadcrumbSeparator,
|
|
11
|
-
} from './breadcrumb'
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Breadcrumb',
|
|
15
|
-
component: Breadcrumb,
|
|
16
|
-
tags: ['autodocs'],
|
|
17
|
-
} satisfies Meta<typeof Breadcrumb>
|
|
18
|
-
|
|
19
|
-
export default meta
|
|
20
|
-
|
|
21
|
-
export const Default: StoryObj<typeof meta> = {
|
|
22
|
-
render: () => (
|
|
23
|
-
<Breadcrumb>
|
|
24
|
-
<BreadcrumbList>
|
|
25
|
-
<BreadcrumbItem>
|
|
26
|
-
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
27
|
-
</BreadcrumbItem>
|
|
28
|
-
<BreadcrumbSeparator />
|
|
29
|
-
<BreadcrumbItem>
|
|
30
|
-
<BreadcrumbLink href="/docs">Docs</BreadcrumbLink>
|
|
31
|
-
</BreadcrumbItem>
|
|
32
|
-
<BreadcrumbSeparator />
|
|
33
|
-
<BreadcrumbItem>
|
|
34
|
-
<BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
|
|
35
|
-
</BreadcrumbItem>
|
|
36
|
-
<BreadcrumbSeparator />
|
|
37
|
-
<BreadcrumbItem>
|
|
38
|
-
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
39
|
-
</BreadcrumbItem>
|
|
40
|
-
</BreadcrumbList>
|
|
41
|
-
</Breadcrumb>
|
|
42
|
-
),
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const WithEllipsis: StoryObj<typeof meta> = {
|
|
46
|
-
render: () => (
|
|
47
|
-
<Breadcrumb>
|
|
48
|
-
<BreadcrumbList>
|
|
49
|
-
<BreadcrumbItem>
|
|
50
|
-
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
51
|
-
</BreadcrumbItem>
|
|
52
|
-
<BreadcrumbSeparator />
|
|
53
|
-
<BreadcrumbItem>
|
|
54
|
-
<BreadcrumbEllipsis />
|
|
55
|
-
</BreadcrumbItem>
|
|
56
|
-
<BreadcrumbSeparator />
|
|
57
|
-
<BreadcrumbItem>
|
|
58
|
-
<BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
|
|
59
|
-
</BreadcrumbItem>
|
|
60
|
-
<BreadcrumbSeparator />
|
|
61
|
-
<BreadcrumbItem>
|
|
62
|
-
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
63
|
-
</BreadcrumbItem>
|
|
64
|
-
</BreadcrumbList>
|
|
65
|
-
</Breadcrumb>
|
|
66
|
-
),
|
|
67
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ChevronRightIcon, DotsHorizontalIcon } from '@radix-ui/react-icons'
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
-
|
|
4
|
-
import * as React from 'react'
|
|
5
|
-
|
|
6
|
-
import { cn } from '@lib/utils'
|
|
7
|
-
|
|
8
|
-
const Breadcrumb = React.forwardRef<
|
|
9
|
-
HTMLElement,
|
|
10
|
-
React.ComponentPropsWithoutRef<'nav'> & {
|
|
11
|
-
separator?: React.ReactNode
|
|
12
|
-
}
|
|
13
|
-
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
14
|
-
Breadcrumb.displayName = 'Breadcrumb'
|
|
15
|
-
|
|
16
|
-
const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<'ol'>>(
|
|
17
|
-
({ className, ...props }, ref) => (
|
|
18
|
-
<ol
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(
|
|
21
|
-
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
),
|
|
27
|
-
)
|
|
28
|
-
BreadcrumbList.displayName = 'BreadcrumbList'
|
|
29
|
-
|
|
30
|
-
const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<'li'>>(
|
|
31
|
-
({ className, ...props }, ref) => (
|
|
32
|
-
<li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
|
|
33
|
-
),
|
|
34
|
-
)
|
|
35
|
-
BreadcrumbItem.displayName = 'BreadcrumbItem'
|
|
36
|
-
|
|
37
|
-
const BreadcrumbLink = React.forwardRef<
|
|
38
|
-
HTMLAnchorElement,
|
|
39
|
-
React.ComponentPropsWithoutRef<'a'> & {
|
|
40
|
-
asChild?: boolean
|
|
41
|
-
}
|
|
42
|
-
>(({ asChild, className, ...props }, ref) => {
|
|
43
|
-
const Comp = asChild ? Slot : 'a'
|
|
44
|
-
|
|
45
|
-
return <Comp ref={ref} className={cn('transition-colors hover:text-foreground', className)} {...props} />
|
|
46
|
-
})
|
|
47
|
-
BreadcrumbLink.displayName = 'BreadcrumbLink'
|
|
48
|
-
|
|
49
|
-
const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<'span'>>(
|
|
50
|
-
({ className, ...props }, ref) => (
|
|
51
|
-
<span
|
|
52
|
-
ref={ref}
|
|
53
|
-
aria-disabled="true"
|
|
54
|
-
aria-current="page"
|
|
55
|
-
className={cn('font-normal text-foreground', className)}
|
|
56
|
-
{...props}
|
|
57
|
-
/>
|
|
58
|
-
),
|
|
59
|
-
)
|
|
60
|
-
BreadcrumbPage.displayName = 'BreadcrumbPage'
|
|
61
|
-
|
|
62
|
-
const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => (
|
|
63
|
-
<li aria-hidden="true" className={cn('[&>svg]:size-3.5', className)} {...props}>
|
|
64
|
-
{children ?? <ChevronRightIcon />}
|
|
65
|
-
</li>
|
|
66
|
-
)
|
|
67
|
-
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator'
|
|
68
|
-
|
|
69
|
-
const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
|
|
70
|
-
<span aria-hidden="true" className={cn('flex h-9 w-9 items-center justify-center', className)} {...props}>
|
|
71
|
-
<DotsHorizontalIcon className="h-4 w-4" />
|
|
72
|
-
<span className="sr-only">More</span>
|
|
73
|
-
</span>
|
|
74
|
-
)
|
|
75
|
-
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis'
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
Breadcrumb,
|
|
79
|
-
BreadcrumbList,
|
|
80
|
-
BreadcrumbItem,
|
|
81
|
-
BreadcrumbLink,
|
|
82
|
-
BreadcrumbPage,
|
|
83
|
-
BreadcrumbSeparator,
|
|
84
|
-
BreadcrumbEllipsis,
|
|
85
|
-
}
|