@algorithm-shift/design-system 1.2.12 → 1.2.13
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.css +2314 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/components/Basic/Image/Image.stories.tsx +0 -13
- package/src/components/Basic/Image/Image.tsx +0 -52
- package/src/components/Basic/Shape/Shape.tsx +0 -16
- package/src/components/Basic/Typography/Typography.stories.tsx +0 -18
- package/src/components/Basic/Typography/Typography.tsx +0 -31
- package/src/components/DataDisplay/Table/Table.stories.tsx +0 -35
- package/src/components/DataDisplay/Table/Table.tsx +0 -15
- package/src/components/DataDisplay/index.ts +0 -1
- package/src/components/Global/SelectDropdown.tsx +0 -61
- package/src/components/Global/TinyMceEditor.tsx +0 -81
- package/src/components/Inputs/Checkbox/Checkbox.tsx +0 -18
- package/src/components/Inputs/DatePicker/DatePicker.tsx +0 -81
- package/src/components/Inputs/DateRange/DateRange.tsx +0 -64
- package/src/components/Inputs/Dropdown/Dropdown.tsx +0 -62
- package/src/components/Inputs/EmailInput/EmailInput.tsx +0 -64
- package/src/components/Inputs/FileInput/FileInput.tsx +0 -24
- package/src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx +0 -24
- package/src/components/Inputs/NumberInput/NumberInput.tsx +0 -66
- package/src/components/Inputs/PasswordInput/PasswordInput.tsx +0 -66
- package/src/components/Inputs/PhoneInput/PhoneInput.tsx +0 -58
- package/src/components/Inputs/RadioInput/RadioInput.tsx +0 -24
- package/src/components/Inputs/RichText/RichText.tsx +0 -10
- package/src/components/Inputs/SearchInput/SearchInput.tsx +0 -64
- package/src/components/Inputs/SwitchToggle/SwitchToggle.tsx +0 -22
- package/src/components/Inputs/TextInput/TextInput.tsx +0 -59
- package/src/components/Inputs/Textarea/Textarea.tsx +0 -58
- package/src/components/Inputs/UrlInput/UrlInput.tsx +0 -66
- package/src/components/Layout/Flex.tsx +0 -13
- package/src/components/Layout/Grid.tsx +0 -13
- package/src/components/Navigation/Logo/Logo.stories.tsx +0 -25
- package/src/components/Navigation/Logo/Logo.tsx +0 -33
- package/src/components/Navigation/Notification/Notification.stories.tsx +0 -20
- package/src/components/Navigation/Notification/Notification.tsx +0 -20
- package/src/components/Navigation/Profile/Profile.stories.tsx +0 -20
- package/src/components/Navigation/Profile/Profile.tsx +0 -25
- package/src/components/Navigation/Spacer/Spacer.stories.tsx +0 -18
- package/src/components/Navigation/Spacer/Spacer.tsx +0 -11
- package/src/components/Navigation/Stages/Stages.stories.tsx +0 -24
- package/src/components/Navigation/Stages/Stages.tsx +0 -49
- package/src/components/Navigation/Tabs/Tabs.stories.tsx +0 -38
- package/src/components/Navigation/Tabs/Tabs.tsx +0 -72
- package/src/components/Navigation/index.ts +0 -6
- package/src/components/index.ts +0 -27
- package/src/components/ui/button.stories.tsx +0 -24
- package/src/components/ui/button.tsx +0 -59
- package/src/components/ui/calendar.tsx +0 -211
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/data-table.tsx +0 -138
- package/src/components/ui/dropdown-menu.tsx +0 -258
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -22
- package/src/components/ui/popover.tsx +0 -46
- package/src/components/ui/radio-group.tsx +0 -43
- package/src/components/ui/select.tsx +0 -183
- package/src/components/ui/switch.tsx +0 -29
- package/src/components/ui/table.tsx +0 -121
- package/src/components/ui/textarea.tsx +0 -18
- package/src/global.css +0 -6
- package/src/index.css +0 -119
- package/src/index.ts +0 -4
- package/src/lib/utils.ts +0 -6
- package/src/stories/Button.stories.ts +0 -54
- package/src/stories/Button.tsx +0 -35
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -34
- package/src/stories/Header.tsx +0 -54
- package/src/stories/Page.stories.ts +0 -33
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/src/types/global.d.ts +0 -85
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
ColumnDef,
|
|
4
|
-
flexRender,
|
|
5
|
-
getCoreRowModel,
|
|
6
|
-
useReactTable,
|
|
7
|
-
} from '@tanstack/react-table';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
Table,
|
|
11
|
-
TableBody,
|
|
12
|
-
TableCell,
|
|
13
|
-
TableHead,
|
|
14
|
-
TableHeader,
|
|
15
|
-
TableRow,
|
|
16
|
-
} from '@/components/ui/table';
|
|
17
|
-
|
|
18
|
-
interface DataTableProps<TData, TValue> {
|
|
19
|
-
columns: ColumnDef<TData, TValue>[]
|
|
20
|
-
data: TData[],
|
|
21
|
-
rowActions: { header: string; onClick: (row: TData) => void }[],
|
|
22
|
-
loading?: boolean,
|
|
23
|
-
getRowSelection?: (rowSelection: Record<string, boolean>) => void,
|
|
24
|
-
onCellClick?: (cellData: TData, columnId: string) => void;
|
|
25
|
-
cellClickEnabled?: (cellData: TData, columnId: string) => boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function DataTable<TData, TValue>({
|
|
29
|
-
columns,
|
|
30
|
-
rowActions,
|
|
31
|
-
data,
|
|
32
|
-
loading,
|
|
33
|
-
getRowSelection,
|
|
34
|
-
onCellClick,
|
|
35
|
-
cellClickEnabled = () => false,
|
|
36
|
-
}: DataTableProps<TData, TValue>) {
|
|
37
|
-
const table = useReactTable({
|
|
38
|
-
data,
|
|
39
|
-
columns,
|
|
40
|
-
enableRowSelection: true,
|
|
41
|
-
onRowSelectionChange: getRowSelection
|
|
42
|
-
? (updaterOrValue) => {
|
|
43
|
-
const value =
|
|
44
|
-
typeof updaterOrValue === 'function'
|
|
45
|
-
? updaterOrValue(table.getState().rowSelection)
|
|
46
|
-
: updaterOrValue;
|
|
47
|
-
getRowSelection(value);
|
|
48
|
-
}
|
|
49
|
-
: undefined,
|
|
50
|
-
getCoreRowModel: getCoreRowModel(),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const handleCellClick = (rowData: TData, columnId: string) => {
|
|
54
|
-
if (onCellClick) {
|
|
55
|
-
onCellClick(rowData, columnId);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div className="overflow-hidden rounded-md border w-full">
|
|
61
|
-
<Table>
|
|
62
|
-
<TableHeader>
|
|
63
|
-
{table.getHeaderGroups().map((headerGroup) => (
|
|
64
|
-
<TableRow key={headerGroup.id}>
|
|
65
|
-
{headerGroup.headers.map((header) => {
|
|
66
|
-
return (
|
|
67
|
-
<TableHead key={header.id}>
|
|
68
|
-
{header.isPlaceholder
|
|
69
|
-
? null
|
|
70
|
-
: flexRender(
|
|
71
|
-
header.column.columnDef.header,
|
|
72
|
-
header.getContext()
|
|
73
|
-
)}
|
|
74
|
-
</TableHead>
|
|
75
|
-
);
|
|
76
|
-
})}
|
|
77
|
-
</TableRow>
|
|
78
|
-
))}
|
|
79
|
-
</TableHeader>
|
|
80
|
-
<TableBody>
|
|
81
|
-
{loading ? (
|
|
82
|
-
<TableRow>
|
|
83
|
-
<TableCell colSpan={columns.length} className="h-24 text-center">
|
|
84
|
-
Loading...
|
|
85
|
-
</TableCell>
|
|
86
|
-
</TableRow>
|
|
87
|
-
) : (
|
|
88
|
-
<>
|
|
89
|
-
{table.getRowModel().rows?.length ? (
|
|
90
|
-
table.getRowModel().rows.map((row) => (
|
|
91
|
-
<TableRow
|
|
92
|
-
key={row.id}
|
|
93
|
-
data-state={row.getIsSelected() && 'selected'}
|
|
94
|
-
className='relative group'
|
|
95
|
-
>
|
|
96
|
-
{row.getVisibleCells().map((cell) => {
|
|
97
|
-
const isCellClickable = cellClickEnabled(row.original, cell.column.id);
|
|
98
|
-
const dynamicClass = (cell.column.columnDef.meta as any)?.cellClass || '';
|
|
99
|
-
const dynamicStyle = (cell.column.columnDef.meta as any)?.cellStyle || {};
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<TableCell
|
|
103
|
-
key={cell.id}
|
|
104
|
-
className={`${dynamicClass} ${isCellClickable ? 'underline cursor-pointer' : ''}`}
|
|
105
|
-
style={dynamicStyle}
|
|
106
|
-
onClick={() => {
|
|
107
|
-
if (isCellClickable) {
|
|
108
|
-
handleCellClick(row.original, cell.column.id);
|
|
109
|
-
}
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
113
|
-
</TableCell>
|
|
114
|
-
);
|
|
115
|
-
})}
|
|
116
|
-
{rowActions.length > 0 && (
|
|
117
|
-
<div className='absolute top-0 right-0 bg-white py-3 min-w-[100px] z-50 shadow-md flex items-center justify-center gap-3 p-2 opacity-0 group-hover:opacity-100 duration-300 h-full'>
|
|
118
|
-
{rowActions.map((action, index) => (
|
|
119
|
-
<p key={index} className='text-[#383838] text-[12px] cursor-pointer font-[400]'>{action.header}</p>
|
|
120
|
-
))}
|
|
121
|
-
</div>
|
|
122
|
-
)}
|
|
123
|
-
</TableRow>
|
|
124
|
-
))
|
|
125
|
-
) : (
|
|
126
|
-
<TableRow>
|
|
127
|
-
<TableCell colSpan={columns.length} className="h-24 text-center">
|
|
128
|
-
No results.
|
|
129
|
-
</TableCell>
|
|
130
|
-
</TableRow>
|
|
131
|
-
)}
|
|
132
|
-
</>
|
|
133
|
-
)}
|
|
134
|
-
</TableBody>
|
|
135
|
-
</Table>
|
|
136
|
-
</div>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
6
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
7
|
-
|
|
8
|
-
import { cn } from '@/lib/utils';
|
|
9
|
-
|
|
10
|
-
function DropdownMenu({
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
13
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function DropdownMenuPortal({
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
19
|
-
return (
|
|
20
|
-
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function DropdownMenuTrigger({
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
27
|
-
return (
|
|
28
|
-
<DropdownMenuPrimitive.Trigger
|
|
29
|
-
data-slot="dropdown-menu-trigger"
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function DropdownMenuContent({
|
|
36
|
-
className,
|
|
37
|
-
sideOffset = 4,
|
|
38
|
-
...props
|
|
39
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
40
|
-
return (
|
|
41
|
-
<DropdownMenuPrimitive.Portal>
|
|
42
|
-
<DropdownMenuPrimitive.Content
|
|
43
|
-
data-slot="dropdown-menu-content"
|
|
44
|
-
sideOffset={sideOffset}
|
|
45
|
-
className={cn(
|
|
46
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
|
47
|
-
className
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
</DropdownMenuPrimitive.Portal>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function DropdownMenuGroup({
|
|
56
|
-
...props
|
|
57
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
58
|
-
return (
|
|
59
|
-
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function DropdownMenuItem({
|
|
64
|
-
className,
|
|
65
|
-
inset,
|
|
66
|
-
variant = 'default',
|
|
67
|
-
...props
|
|
68
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
69
|
-
inset?: boolean
|
|
70
|
-
variant?: 'default' | 'destructive'
|
|
71
|
-
}) {
|
|
72
|
-
return (
|
|
73
|
-
<DropdownMenuPrimitive.Item
|
|
74
|
-
data-slot="dropdown-menu-item"
|
|
75
|
-
data-inset={inset}
|
|
76
|
-
data-variant={variant}
|
|
77
|
-
className={cn(
|
|
78
|
-
'focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=\'text-\'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
79
|
-
className
|
|
80
|
-
)}
|
|
81
|
-
{...props}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function DropdownMenuCheckboxItem({
|
|
87
|
-
className,
|
|
88
|
-
children,
|
|
89
|
-
checked,
|
|
90
|
-
...props
|
|
91
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
92
|
-
return (
|
|
93
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
94
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
95
|
-
className={cn(
|
|
96
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
97
|
-
className
|
|
98
|
-
)}
|
|
99
|
-
checked={checked}
|
|
100
|
-
{...props}
|
|
101
|
-
>
|
|
102
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
103
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
104
|
-
<CheckIcon className="size-4" />
|
|
105
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
106
|
-
</span>
|
|
107
|
-
{children}
|
|
108
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function DropdownMenuRadioGroup({
|
|
113
|
-
...props
|
|
114
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
115
|
-
return (
|
|
116
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
117
|
-
data-slot="dropdown-menu-radio-group"
|
|
118
|
-
{...props}
|
|
119
|
-
/>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function DropdownMenuRadioItem({
|
|
124
|
-
className,
|
|
125
|
-
children,
|
|
126
|
-
...props
|
|
127
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
128
|
-
return (
|
|
129
|
-
<DropdownMenuPrimitive.RadioItem
|
|
130
|
-
data-slot="dropdown-menu-radio-item"
|
|
131
|
-
className={cn(
|
|
132
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
133
|
-
className
|
|
134
|
-
)}
|
|
135
|
-
{...props}
|
|
136
|
-
>
|
|
137
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
138
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
139
|
-
<CircleIcon className="size-2 fill-current" />
|
|
140
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
141
|
-
</span>
|
|
142
|
-
{children}
|
|
143
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function DropdownMenuLabel({
|
|
148
|
-
className,
|
|
149
|
-
inset,
|
|
150
|
-
...props
|
|
151
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
152
|
-
inset?: boolean
|
|
153
|
-
}) {
|
|
154
|
-
return (
|
|
155
|
-
<DropdownMenuPrimitive.Label
|
|
156
|
-
data-slot="dropdown-menu-label"
|
|
157
|
-
data-inset={inset}
|
|
158
|
-
className={cn(
|
|
159
|
-
'px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
|
|
160
|
-
className
|
|
161
|
-
)}
|
|
162
|
-
{...props}
|
|
163
|
-
/>
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function DropdownMenuSeparator({
|
|
168
|
-
className,
|
|
169
|
-
...props
|
|
170
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
171
|
-
return (
|
|
172
|
-
<DropdownMenuPrimitive.Separator
|
|
173
|
-
data-slot="dropdown-menu-separator"
|
|
174
|
-
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
175
|
-
{...props}
|
|
176
|
-
/>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function DropdownMenuShortcut({
|
|
181
|
-
className,
|
|
182
|
-
...props
|
|
183
|
-
}: React.ComponentProps<'span'>) {
|
|
184
|
-
return (
|
|
185
|
-
<span
|
|
186
|
-
data-slot="dropdown-menu-shortcut"
|
|
187
|
-
className={cn(
|
|
188
|
-
'text-muted-foreground ml-auto text-xs tracking-widest',
|
|
189
|
-
className
|
|
190
|
-
)}
|
|
191
|
-
{...props}
|
|
192
|
-
/>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function DropdownMenuSub({
|
|
197
|
-
...props
|
|
198
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
199
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function DropdownMenuSubTrigger({
|
|
203
|
-
className,
|
|
204
|
-
inset,
|
|
205
|
-
children,
|
|
206
|
-
...props
|
|
207
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
208
|
-
inset?: boolean
|
|
209
|
-
}) {
|
|
210
|
-
return (
|
|
211
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
212
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
213
|
-
data-inset={inset}
|
|
214
|
-
className={cn(
|
|
215
|
-
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',
|
|
216
|
-
className
|
|
217
|
-
)}
|
|
218
|
-
{...props}
|
|
219
|
-
>
|
|
220
|
-
{children}
|
|
221
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
222
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function DropdownMenuSubContent({
|
|
227
|
-
className,
|
|
228
|
-
...props
|
|
229
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
230
|
-
return (
|
|
231
|
-
<DropdownMenuPrimitive.SubContent
|
|
232
|
-
data-slot="dropdown-menu-sub-content"
|
|
233
|
-
className={cn(
|
|
234
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
|
235
|
-
className
|
|
236
|
-
)}
|
|
237
|
-
{...props}
|
|
238
|
-
/>
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export {
|
|
243
|
-
DropdownMenu,
|
|
244
|
-
DropdownMenuPortal,
|
|
245
|
-
DropdownMenuTrigger,
|
|
246
|
-
DropdownMenuContent,
|
|
247
|
-
DropdownMenuGroup,
|
|
248
|
-
DropdownMenuLabel,
|
|
249
|
-
DropdownMenuItem,
|
|
250
|
-
DropdownMenuCheckboxItem,
|
|
251
|
-
DropdownMenuRadioGroup,
|
|
252
|
-
DropdownMenuRadioItem,
|
|
253
|
-
DropdownMenuSeparator,
|
|
254
|
-
DropdownMenuShortcut,
|
|
255
|
-
DropdownMenuSub,
|
|
256
|
-
DropdownMenuSubTrigger,
|
|
257
|
-
DropdownMenuSubContent,
|
|
258
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
-
return (
|
|
7
|
-
<input
|
|
8
|
-
type={type}
|
|
9
|
-
data-slot="input"
|
|
10
|
-
className={cn(
|
|
11
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
13
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
|
-
className
|
|
15
|
-
)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { Input }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
function Label({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
10
|
-
return (
|
|
11
|
-
<LabelPrimitive.Root
|
|
12
|
-
data-slot="label"
|
|
13
|
-
className={cn(
|
|
14
|
-
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
15
|
-
className
|
|
16
|
-
)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { Label }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
function Popover({
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
-
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function PopoverTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
15
|
-
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function PopoverContent({
|
|
19
|
-
className,
|
|
20
|
-
align = "center",
|
|
21
|
-
sideOffset = 4,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
24
|
-
return (
|
|
25
|
-
<PopoverPrimitive.Portal>
|
|
26
|
-
<PopoverPrimitive.Content
|
|
27
|
-
data-slot="popover-content"
|
|
28
|
-
align={align}
|
|
29
|
-
sideOffset={sideOffset}
|
|
30
|
-
className={cn(
|
|
31
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
</PopoverPrimitive.Portal>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function PopoverAnchor({
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
43
|
-
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
3
|
-
import { CircleIcon } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
function RadioGroup({
|
|
8
|
-
className,
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
11
|
-
return (
|
|
12
|
-
<RadioGroupPrimitive.Root
|
|
13
|
-
data-slot="radio-group"
|
|
14
|
-
className={cn("grid gap-3", className)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function RadioGroupItem({
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
24
|
-
return (
|
|
25
|
-
<RadioGroupPrimitive.Item
|
|
26
|
-
data-slot="radio-group-item"
|
|
27
|
-
className={cn(
|
|
28
|
-
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
29
|
-
className
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
>
|
|
33
|
-
<RadioGroupPrimitive.Indicator
|
|
34
|
-
data-slot="radio-group-indicator"
|
|
35
|
-
className="relative flex items-center justify-center"
|
|
36
|
-
>
|
|
37
|
-
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
38
|
-
</RadioGroupPrimitive.Indicator>
|
|
39
|
-
</RadioGroupPrimitive.Item>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { RadioGroup, RadioGroupItem }
|