@gentleduck/registry-ui 0.2.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.
- package/CHANGELOG.md +62 -0
- package/index.css +3 -0
- package/package.json +59 -0
- package/src/_old/_table/index.ts +5 -0
- package/src/_old/_table/table-advanced.constants.tsx +24 -0
- package/src/_old/_table/table-advanced.tsx +311 -0
- package/src/_old/_table/table-advanced.types.ts +272 -0
- package/src/_old/_table/table.constants.ts +2 -0
- package/src/_old/_table/table.hook.tsx +115 -0
- package/src/_old/_table/table.lib.ts +85 -0
- package/src/_old/_table/table.tsx +916 -0
- package/src/_old/_table/table.types.ts +118 -0
- package/src/_old/_table/todo.md +11 -0
- package/src/_old/_upload/index.ts +9 -0
- package/src/_old/_upload/todo.md +38 -0
- package/src/_old/_upload/upload-advanced-chunks.tsx +1624 -0
- package/src/_old/_upload/upload-advanced.tsx +507 -0
- package/src/_old/_upload/upload-sonner.tsx +58 -0
- package/src/_old/_upload/upload.assets.tsx +239 -0
- package/src/_old/_upload/upload.constants.tsx +75 -0
- package/src/_old/_upload/upload.dto.ts +19 -0
- package/src/_old/_upload/upload.lib.tsx +630 -0
- package/src/_old/_upload/upload.tsx +491 -0
- package/src/_old/_upload/upload.types.ts +436 -0
- package/src/accordion/accordion.tsx +247 -0
- package/src/accordion/index.ts +1 -0
- package/src/alert/alert.constants.ts +17 -0
- package/src/alert/alert.tsx +52 -0
- package/src/alert/index.ts +2 -0
- package/src/alert-dialog/alert-dialog.tsx +107 -0
- package/src/alert-dialog/index.ts +1 -0
- package/src/aspect-ratio/aspect-ratio.tsx +33 -0
- package/src/aspect-ratio/index.ts +1 -0
- package/src/audio/audio-record.tsx +776 -0
- package/src/audio/audio-visualizer.tsx +377 -0
- package/src/audio/audio.libs.ts +5 -0
- package/src/audio/audio.types.ts +50 -0
- package/src/audio/index.ts +2 -0
- package/src/avatar/avatar.tsx +78 -0
- package/src/avatar/index.ts +1 -0
- package/src/badge/badge.constants.ts +38 -0
- package/src/badge/badge.tsx +19 -0
- package/src/badge/index.ts +2 -0
- package/src/breadcrumb/breadcrumb.tsx +119 -0
- package/src/breadcrumb/index.ts +1 -0
- package/src/button/button.constants.ts +44 -0
- package/src/button/button.tsx +79 -0
- package/src/button/button.types.ts +38 -0
- package/src/button/index.ts +3 -0
- package/src/button-group/button-group.constants.ts +26 -0
- package/src/button-group/button-group.tsx +65 -0
- package/src/button-group/index.ts +2 -0
- package/src/calendar/calendar.tsx +191 -0
- package/src/calendar/index.ts +1 -0
- package/src/card/card.tsx +81 -0
- package/src/card/index.ts +1 -0
- package/src/carousel/carousel.tsx +211 -0
- package/src/carousel/carousel.types.ts +23 -0
- package/src/carousel/index.ts +2 -0
- package/src/chart/chart.libs.ts +27 -0
- package/src/chart/chart.tsx +260 -0
- package/src/chart/chart.types.ts +38 -0
- package/src/chart/index.ts +3 -0
- package/src/checkbox/checkbox.tsx +144 -0
- package/src/checkbox/checkbox.types.ts +24 -0
- package/src/checkbox/index.ts +2 -0
- package/src/collapsible/collapsible.tsx +151 -0
- package/src/collapsible/index.ts +1 -0
- package/src/combobox/combobox.tsx +132 -0
- package/src/combobox/index.ts +1 -0
- package/src/command/command.tsx +192 -0
- package/src/command/command.types.ts +11 -0
- package/src/command/index.ts +2 -0
- package/src/context-menu/context-menu.tsx +178 -0
- package/src/context-menu/index.ts +1 -0
- package/src/dialog/dialog-responsive.tsx +137 -0
- package/src/dialog/dialog.tsx +97 -0
- package/src/dialog/index.ts +2 -0
- package/src/direction/direction.tsx +13 -0
- package/src/direction/index.ts +1 -0
- package/src/drawer/drawer.tsx +185 -0
- package/src/drawer/index.ts +1 -0
- package/src/dropdown-menu/dropdown-menu.tsx +181 -0
- package/src/dropdown-menu/index.ts +1 -0
- package/src/empty/empty.constants.ts +15 -0
- package/src/empty/empty.tsx +73 -0
- package/src/empty/index.ts +2 -0
- package/src/field/field.constants.ts +22 -0
- package/src/field/field.tsx +203 -0
- package/src/field/index.ts +2 -0
- package/src/hover-card/hover-card.tsx +79 -0
- package/src/hover-card/index.ts +1 -0
- package/src/input/index.ts +1 -0
- package/src/input/input.tsx +45 -0
- package/src/input-group/index.ts +1 -0
- package/src/input-group/input-group.tsx +170 -0
- package/src/input-otp/index.ts +1 -0
- package/src/input-otp/input-otp.tsx +66 -0
- package/src/item/index.ts +2 -0
- package/src/item/item.constants.ts +22 -0
- package/src/item/item.tsx +185 -0
- package/src/json-editor/index.ts +4 -0
- package/src/json-editor/json-editor.hooks.ts +21 -0
- package/src/json-editor/json-editor.libs.ts +34 -0
- package/src/json-editor/json-editor.tsx +425 -0
- package/src/json-editor/json-editor.types.ts +80 -0
- package/src/json-editor/json-editor.view.tsx +110 -0
- package/src/json-editor/json-text-area.tsx +7 -0
- package/src/kbd/index.ts +1 -0
- package/src/kbd/kbd.tsx +39 -0
- package/src/label/index.ts +1 -0
- package/src/label/label.tsx +28 -0
- package/src/menubar/index.ts +1 -0
- package/src/menubar/menubar.tsx +213 -0
- package/src/navigation-menu/index.ts +1 -0
- package/src/navigation-menu/navigation-menu.tsx +152 -0
- package/src/pagination/index.ts +2 -0
- package/src/pagination/pagination.tsx +191 -0
- package/src/pagination/pagination.types.ts +17 -0
- package/src/popover/index.ts +1 -0
- package/src/popover/popover.tsx +35 -0
- package/src/preview-panel/index.ts +3 -0
- package/src/preview-panel/preview-panel-dialog.tsx +99 -0
- package/src/preview-panel/preview-panel.tsx +389 -0
- package/src/preview-panel/preview-panel.types.ts +49 -0
- package/src/progress/index.ts +1 -0
- package/src/progress/progress.tsx +32 -0
- package/src/radio-group/index.ts +1 -0
- package/src/radio-group/radio-group.tsx +92 -0
- package/src/resizable/index.ts +1 -0
- package/src/resizable/resizable.tsx +52 -0
- package/src/scroll-area/index.ts +1 -0
- package/src/scroll-area/scroll-area.tsx +30 -0
- package/src/select/index.ts +1 -0
- package/src/select/select.tsx +138 -0
- package/src/separator/index.ts +1 -0
- package/src/separator/separator.tsx +28 -0
- package/src/sheet/index.ts +2 -0
- package/src/sheet/sheet.constants.tsx +20 -0
- package/src/sheet/sheet.tsx +92 -0
- package/src/sidebar/index.ts +4 -0
- package/src/sidebar/sidebar.constants.ts +30 -0
- package/src/sidebar/sidebar.hooks.ts +13 -0
- package/src/sidebar/sidebar.tsx +676 -0
- package/src/sidebar/sidebar.types.ts +28 -0
- package/src/skeleton/index.ts +1 -0
- package/src/skeleton/skeleton.tsx +22 -0
- package/src/slider/index.ts +1 -0
- package/src/slider/slider.tsx +57 -0
- package/src/sonner/index.ts +4 -0
- package/src/sonner/sonner.chunks.tsx +80 -0
- package/src/sonner/sonner.libs.ts +13 -0
- package/src/sonner/sonner.tsx +31 -0
- package/src/sonner/sonner.types.ts +9 -0
- package/src/switch/index.ts +1 -0
- package/src/switch/switch.tsx +63 -0
- package/src/table/index.ts +1 -0
- package/src/table/table.tsx +95 -0
- package/src/tabs/index.ts +1 -0
- package/src/tabs/tabs.tsx +151 -0
- package/src/textarea/index.ts +1 -0
- package/src/textarea/textarea.tsx +24 -0
- package/src/toggle/index.ts +2 -0
- package/src/toggle/toggle.constants.ts +22 -0
- package/src/toggle/toggle.tsx +24 -0
- package/src/toggle-group/index.ts +1 -0
- package/src/toggle-group/toggle-group.tsx +69 -0
- package/src/tooltip/index.ts +1 -0
- package/src/tooltip/tooltip.tsx +32 -0
- package/src/upload/index.ts +1 -0
- package/src/upload/upload.constants.tsx +19 -0
- package/src/upload/upload.libs.ts +97 -0
- package/src/upload/upload.tsx +340 -0
- package/src/upload/upload.types.ts +44 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
//@ts-noCheck
|
|
2
|
+
|
|
3
|
+
import { ComboboxType } from '@/registry/default/ui/combobox'
|
|
4
|
+
import { ContextMenuOptionsType } from '@/registry/default/ui/context-menu'
|
|
5
|
+
import { DropdownMenuOptionsDataType, DropdownMenuOptionsType } from '@/registry/default/ui/dropdown-menu'
|
|
6
|
+
import { ScrollArea } from '@/registry/default/ui/scroll-area'
|
|
7
|
+
import { IconType, LabelType } from '../button'
|
|
8
|
+
import { TableCell, TableFooter, TablePaginationStateType } from './table'
|
|
9
|
+
import { sortArray } from './table.lib'
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
//
|
|
26
|
+
export type Order = 'asc' | 'desc' | 'not sorted'
|
|
27
|
+
|
|
28
|
+
export interface TableDropdownMenuOptionsType<T extends Record<string, any>, C extends boolean> {
|
|
29
|
+
sortArray: typeof sortArray
|
|
30
|
+
setHeaders: React.Dispatch<React.SetStateAction<TableHeaderType<T, C>[]>>
|
|
31
|
+
headers: TableHeaderType<T, C>[]
|
|
32
|
+
tableData: TableContentDataType<T>[]
|
|
33
|
+
setTableData: React.Dispatch<React.SetStateAction<TableContentDataType<T>[]>>
|
|
34
|
+
data: TableContentDataType<T>[]
|
|
35
|
+
idx: number
|
|
36
|
+
column: TableHeaderType<T, C>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TableHeaderType<C extends boolean = true> extends Partial<React.HTMLProps<HTMLTableCellElement>> {
|
|
40
|
+
label: string
|
|
41
|
+
sortable?: boolean
|
|
42
|
+
showLabel?: boolean
|
|
43
|
+
currentSort?: C extends true ? 'asc' | 'desc' | 'not sorted' : never
|
|
44
|
+
// dropdownMenuOptions?: C extends true
|
|
45
|
+
// ? DropdownMenuOptionsDataType<TableDropdownMenuOptionsType<T, C>>[]
|
|
46
|
+
// : never
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface TableHeaderActionsProps<T extends Record<string, unknown>, K extends boolean> {
|
|
50
|
+
header: TableHeaderType<T, K>[]
|
|
51
|
+
headers: TableHeaderType<T, K>[]
|
|
52
|
+
setHeaders: React.Dispatch<React.SetStateAction<TableHeaderType<T, K>[]>>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// TableHeaderOptions
|
|
56
|
+
export interface TableHeaderOptionsType<T extends Record<string, any>, C extends boolean> {
|
|
57
|
+
sortArray: typeof sortArray
|
|
58
|
+
setHeaders: React.Dispatch<React.SetStateAction<TableHeaderType<T, C>[]>>
|
|
59
|
+
headers: TableHeaderType<T, C>[]
|
|
60
|
+
tableData: TableContentDataType<T>[]
|
|
61
|
+
setTableData: React.Dispatch<React.SetStateAction<TableContentDataType<T>[]>>
|
|
62
|
+
data: TableContentDataType<T>[]
|
|
63
|
+
idx: number
|
|
64
|
+
column: TableHeaderType<T, C>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// TableCustomBody
|
|
68
|
+
export interface TableCustomBodyProps<
|
|
69
|
+
T extends Record<string, unknown>,
|
|
70
|
+
Y extends keyof Record<string, unknown>,
|
|
71
|
+
C extends boolean,
|
|
72
|
+
> {
|
|
73
|
+
headers: TableHeaderType<T, C>[]
|
|
74
|
+
resultArrays: TableContentDataType<T>[][]
|
|
75
|
+
paginationState: PaginationState
|
|
76
|
+
selection: boolean
|
|
77
|
+
selected: TableContentDataType<T>[]
|
|
78
|
+
setSelected: React.Dispatch<React.SetStateAction<TableContentDataType<T>[]>>
|
|
79
|
+
dropdownMenu: DropdownMenuOptionsType<TableHeaderOptionsType<T, C>>
|
|
80
|
+
contextMenu: ContextMenuOptionsType<TableHeaderOptionsType<T, C>>
|
|
81
|
+
filtersData: ComboboxType<Extract<keyof C, string>, Y>[] | undefined
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// TableCustomFooter
|
|
85
|
+
|
|
86
|
+
// TablePagination
|
|
87
|
+
|
|
88
|
+
export interface TableDataKey extends React.HTMLProps<HTMLTableCellElement> {
|
|
89
|
+
withLabel?: Omit<LabelType, 'showCommand' | 'showLabel'>
|
|
90
|
+
withIcon?: React.ReactNode
|
|
91
|
+
}
|
|
92
|
+
export interface TableCaptionType extends React.HTMLProps<HTMLTableCaptionElement> {}
|
|
93
|
+
export interface TablePaginationsType extends React.HTMLProps<HTMLDivElement> {
|
|
94
|
+
groupSize: number
|
|
95
|
+
activePage?: number
|
|
96
|
+
showPageCount?: boolean
|
|
97
|
+
showSelectCount?: boolean
|
|
98
|
+
showNavigation?: boolean
|
|
99
|
+
showGroup?: boolean
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface PaginationState {
|
|
103
|
+
activePage: number
|
|
104
|
+
groupSize: number
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface TablePaginationType<C extends Record<string, any> = Record<string, string>> {
|
|
108
|
+
selected: TableContentDataType<C>[]
|
|
109
|
+
setValue: React.Dispatch<React.SetStateAction<string[]>>
|
|
110
|
+
value: string[]
|
|
111
|
+
tableData: TableContentDataType<C>[]
|
|
112
|
+
paginations?: TablePaginationsType
|
|
113
|
+
resultArrays: TableContentDataType<C>[][]
|
|
114
|
+
paginationState: PaginationState
|
|
115
|
+
setPaginationState: React.Dispatch<React.SetStateAction<PaginationState>>
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// TableCustomView
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# TODOs for the table advanced:
|
|
2
|
+
|
|
3
|
+
- [*] get the type of the header to be the same as the type of the data.
|
|
4
|
+
- [*] assign the header label type to the data type and extend it with the rest of the props and get
|
|
5
|
+
more type safety.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
- [*] make the dropdown-menu wrapper compantable with the sheet wrappers.
|
|
10
|
+
- [ ] add edit functionality to the table.
|
|
11
|
+
- [ ] add delete functionality to the table.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './upload'
|
|
2
|
+
export * from './upload.assets'
|
|
3
|
+
export * from './upload.constants'
|
|
4
|
+
export * from './upload.dto'
|
|
5
|
+
export * from './upload.lib'
|
|
6
|
+
export * from './upload.types'
|
|
7
|
+
export * from './upload-advanced'
|
|
8
|
+
export * from './upload-advanced-chunks'
|
|
9
|
+
export * from './upload-sonner'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: todo
|
|
3
|
+
aliases:
|
|
4
|
+
- Upload component TODOs:
|
|
5
|
+
tags: ['upload']
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Upload component TODOs:
|
|
9
|
+
|
|
10
|
+
- [*] CLICK OF THE FOLDER IT SHOULD COLABS IT WITH IT'S NESTED.
|
|
11
|
+
- [*] UPLOAD IT SHOULD UPLOAD IN THE FOLDER OPENED IF NOW IN THE ROOT.
|
|
12
|
+
- [*] CLICK OF THE FILE IT HAS TO SHOW SHEET WITH THE PREVIEW DEPENDING ON IT'S TYPE.
|
|
13
|
+
- [*] ADD NEW FOLDER SHOULD WORK ON THE CURRENT FOLDER.
|
|
14
|
+
- [*] SOME ACTIONS TO THE FILE.
|
|
15
|
+
- [*] SOME ACTIONS TO THE FOLDER.
|
|
16
|
+
- [*] ATTACHMENT VIEW STYLES.
|
|
17
|
+
- [*] UPLOAD SONNER FOR UPLOADING WITH SOME STYLES.
|
|
18
|
+
- [*] THE DELETE BUTTON ACTIONS.
|
|
19
|
+
- [*] MULTIPLE SELECT ON THE ATTACHMENTS.
|
|
20
|
+
- [*] MULTIPLE SELECT MENU.
|
|
21
|
+
- [*] SEARCH ON THE ATTACHMENTS.
|
|
22
|
+
- [*] RELOAD THE ATTACHMENTS.
|
|
23
|
+
- [ ] THERE SHOULD BE SORTING FOR THE ATTACHMENTS.
|
|
24
|
+
- [*] ADD NEW FOLDER SHOULD OPEN A SHEET OR DIALOG WITH THE STEPS TO GEN ONE.
|
|
25
|
+
- [ ] THE BLOCK SHOULD HAVE A PAGE BACK BUTTON AND THE NAME OF THE CURRENT FOLDER.
|
|
26
|
+
- [*] THE MOVE BUTTON ACTIONS.
|
|
27
|
+
- [*] THE DELETE MULTIPLE BUTTON ACTIONS.
|
|
28
|
+
- [*] THE MOVE MULTIPLE BUTTON ACTIONS.
|
|
29
|
+
- [*] MAKE ANY ACTION WITH INPUT TO BE A FORM WITH MORE OPTIONS.
|
|
30
|
+
- [*] INTEGRATE ZOD WITH ALL THE FORMS.
|
|
31
|
+
- [ ] FIX THE DROPDOWN MENU TO BE UNIFIED.
|
|
32
|
+
- [ ] REFACTOR THE CODE TO BE CLEANER.
|
|
33
|
+
- [ ] DOCUMENT THE CODE.
|
|
34
|
+
- [ ] RFACTOR THE SERVER CODE TO INCLUDE THE STATUS.
|
|
35
|
+
- [ ] ADD CACHING TO THE DATA.
|
|
36
|
+
- [ ] DO SOME BENCHMARK ON THIS COMPONENT.
|
|
37
|
+
- [ ] DO SOME BENCHMARK ON THIS UPLOAD API.
|
|
38
|
+
- [ ] WHEN I SPAM FOLDER CLICKING SHOULD CANCEL ALL THE PREVIOUS FOLDER CLICKS.
|