@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.
Files changed (175) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/index.css +3 -0
  3. package/package.json +59 -0
  4. package/src/_old/_table/index.ts +5 -0
  5. package/src/_old/_table/table-advanced.constants.tsx +24 -0
  6. package/src/_old/_table/table-advanced.tsx +311 -0
  7. package/src/_old/_table/table-advanced.types.ts +272 -0
  8. package/src/_old/_table/table.constants.ts +2 -0
  9. package/src/_old/_table/table.hook.tsx +115 -0
  10. package/src/_old/_table/table.lib.ts +85 -0
  11. package/src/_old/_table/table.tsx +916 -0
  12. package/src/_old/_table/table.types.ts +118 -0
  13. package/src/_old/_table/todo.md +11 -0
  14. package/src/_old/_upload/index.ts +9 -0
  15. package/src/_old/_upload/todo.md +38 -0
  16. package/src/_old/_upload/upload-advanced-chunks.tsx +1624 -0
  17. package/src/_old/_upload/upload-advanced.tsx +507 -0
  18. package/src/_old/_upload/upload-sonner.tsx +58 -0
  19. package/src/_old/_upload/upload.assets.tsx +239 -0
  20. package/src/_old/_upload/upload.constants.tsx +75 -0
  21. package/src/_old/_upload/upload.dto.ts +19 -0
  22. package/src/_old/_upload/upload.lib.tsx +630 -0
  23. package/src/_old/_upload/upload.tsx +491 -0
  24. package/src/_old/_upload/upload.types.ts +436 -0
  25. package/src/accordion/accordion.tsx +247 -0
  26. package/src/accordion/index.ts +1 -0
  27. package/src/alert/alert.constants.ts +17 -0
  28. package/src/alert/alert.tsx +52 -0
  29. package/src/alert/index.ts +2 -0
  30. package/src/alert-dialog/alert-dialog.tsx +107 -0
  31. package/src/alert-dialog/index.ts +1 -0
  32. package/src/aspect-ratio/aspect-ratio.tsx +33 -0
  33. package/src/aspect-ratio/index.ts +1 -0
  34. package/src/audio/audio-record.tsx +776 -0
  35. package/src/audio/audio-visualizer.tsx +377 -0
  36. package/src/audio/audio.libs.ts +5 -0
  37. package/src/audio/audio.types.ts +50 -0
  38. package/src/audio/index.ts +2 -0
  39. package/src/avatar/avatar.tsx +78 -0
  40. package/src/avatar/index.ts +1 -0
  41. package/src/badge/badge.constants.ts +38 -0
  42. package/src/badge/badge.tsx +19 -0
  43. package/src/badge/index.ts +2 -0
  44. package/src/breadcrumb/breadcrumb.tsx +119 -0
  45. package/src/breadcrumb/index.ts +1 -0
  46. package/src/button/button.constants.ts +44 -0
  47. package/src/button/button.tsx +79 -0
  48. package/src/button/button.types.ts +38 -0
  49. package/src/button/index.ts +3 -0
  50. package/src/button-group/button-group.constants.ts +26 -0
  51. package/src/button-group/button-group.tsx +65 -0
  52. package/src/button-group/index.ts +2 -0
  53. package/src/calendar/calendar.tsx +191 -0
  54. package/src/calendar/index.ts +1 -0
  55. package/src/card/card.tsx +81 -0
  56. package/src/card/index.ts +1 -0
  57. package/src/carousel/carousel.tsx +211 -0
  58. package/src/carousel/carousel.types.ts +23 -0
  59. package/src/carousel/index.ts +2 -0
  60. package/src/chart/chart.libs.ts +27 -0
  61. package/src/chart/chart.tsx +260 -0
  62. package/src/chart/chart.types.ts +38 -0
  63. package/src/chart/index.ts +3 -0
  64. package/src/checkbox/checkbox.tsx +144 -0
  65. package/src/checkbox/checkbox.types.ts +24 -0
  66. package/src/checkbox/index.ts +2 -0
  67. package/src/collapsible/collapsible.tsx +151 -0
  68. package/src/collapsible/index.ts +1 -0
  69. package/src/combobox/combobox.tsx +132 -0
  70. package/src/combobox/index.ts +1 -0
  71. package/src/command/command.tsx +192 -0
  72. package/src/command/command.types.ts +11 -0
  73. package/src/command/index.ts +2 -0
  74. package/src/context-menu/context-menu.tsx +178 -0
  75. package/src/context-menu/index.ts +1 -0
  76. package/src/dialog/dialog-responsive.tsx +137 -0
  77. package/src/dialog/dialog.tsx +97 -0
  78. package/src/dialog/index.ts +2 -0
  79. package/src/direction/direction.tsx +13 -0
  80. package/src/direction/index.ts +1 -0
  81. package/src/drawer/drawer.tsx +185 -0
  82. package/src/drawer/index.ts +1 -0
  83. package/src/dropdown-menu/dropdown-menu.tsx +181 -0
  84. package/src/dropdown-menu/index.ts +1 -0
  85. package/src/empty/empty.constants.ts +15 -0
  86. package/src/empty/empty.tsx +73 -0
  87. package/src/empty/index.ts +2 -0
  88. package/src/field/field.constants.ts +22 -0
  89. package/src/field/field.tsx +203 -0
  90. package/src/field/index.ts +2 -0
  91. package/src/hover-card/hover-card.tsx +79 -0
  92. package/src/hover-card/index.ts +1 -0
  93. package/src/input/index.ts +1 -0
  94. package/src/input/input.tsx +45 -0
  95. package/src/input-group/index.ts +1 -0
  96. package/src/input-group/input-group.tsx +170 -0
  97. package/src/input-otp/index.ts +1 -0
  98. package/src/input-otp/input-otp.tsx +66 -0
  99. package/src/item/index.ts +2 -0
  100. package/src/item/item.constants.ts +22 -0
  101. package/src/item/item.tsx +185 -0
  102. package/src/json-editor/index.ts +4 -0
  103. package/src/json-editor/json-editor.hooks.ts +21 -0
  104. package/src/json-editor/json-editor.libs.ts +34 -0
  105. package/src/json-editor/json-editor.tsx +425 -0
  106. package/src/json-editor/json-editor.types.ts +80 -0
  107. package/src/json-editor/json-editor.view.tsx +110 -0
  108. package/src/json-editor/json-text-area.tsx +7 -0
  109. package/src/kbd/index.ts +1 -0
  110. package/src/kbd/kbd.tsx +39 -0
  111. package/src/label/index.ts +1 -0
  112. package/src/label/label.tsx +28 -0
  113. package/src/menubar/index.ts +1 -0
  114. package/src/menubar/menubar.tsx +213 -0
  115. package/src/navigation-menu/index.ts +1 -0
  116. package/src/navigation-menu/navigation-menu.tsx +152 -0
  117. package/src/pagination/index.ts +2 -0
  118. package/src/pagination/pagination.tsx +191 -0
  119. package/src/pagination/pagination.types.ts +17 -0
  120. package/src/popover/index.ts +1 -0
  121. package/src/popover/popover.tsx +35 -0
  122. package/src/preview-panel/index.ts +3 -0
  123. package/src/preview-panel/preview-panel-dialog.tsx +99 -0
  124. package/src/preview-panel/preview-panel.tsx +389 -0
  125. package/src/preview-panel/preview-panel.types.ts +49 -0
  126. package/src/progress/index.ts +1 -0
  127. package/src/progress/progress.tsx +32 -0
  128. package/src/radio-group/index.ts +1 -0
  129. package/src/radio-group/radio-group.tsx +92 -0
  130. package/src/resizable/index.ts +1 -0
  131. package/src/resizable/resizable.tsx +52 -0
  132. package/src/scroll-area/index.ts +1 -0
  133. package/src/scroll-area/scroll-area.tsx +30 -0
  134. package/src/select/index.ts +1 -0
  135. package/src/select/select.tsx +138 -0
  136. package/src/separator/index.ts +1 -0
  137. package/src/separator/separator.tsx +28 -0
  138. package/src/sheet/index.ts +2 -0
  139. package/src/sheet/sheet.constants.tsx +20 -0
  140. package/src/sheet/sheet.tsx +92 -0
  141. package/src/sidebar/index.ts +4 -0
  142. package/src/sidebar/sidebar.constants.ts +30 -0
  143. package/src/sidebar/sidebar.hooks.ts +13 -0
  144. package/src/sidebar/sidebar.tsx +676 -0
  145. package/src/sidebar/sidebar.types.ts +28 -0
  146. package/src/skeleton/index.ts +1 -0
  147. package/src/skeleton/skeleton.tsx +22 -0
  148. package/src/slider/index.ts +1 -0
  149. package/src/slider/slider.tsx +57 -0
  150. package/src/sonner/index.ts +4 -0
  151. package/src/sonner/sonner.chunks.tsx +80 -0
  152. package/src/sonner/sonner.libs.ts +13 -0
  153. package/src/sonner/sonner.tsx +31 -0
  154. package/src/sonner/sonner.types.ts +9 -0
  155. package/src/switch/index.ts +1 -0
  156. package/src/switch/switch.tsx +63 -0
  157. package/src/table/index.ts +1 -0
  158. package/src/table/table.tsx +95 -0
  159. package/src/tabs/index.ts +1 -0
  160. package/src/tabs/tabs.tsx +151 -0
  161. package/src/textarea/index.ts +1 -0
  162. package/src/textarea/textarea.tsx +24 -0
  163. package/src/toggle/index.ts +2 -0
  164. package/src/toggle/toggle.constants.ts +22 -0
  165. package/src/toggle/toggle.tsx +24 -0
  166. package/src/toggle-group/index.ts +1 -0
  167. package/src/toggle-group/toggle-group.tsx +69 -0
  168. package/src/tooltip/index.ts +1 -0
  169. package/src/tooltip/tooltip.tsx +32 -0
  170. package/src/upload/index.ts +1 -0
  171. package/src/upload/upload.constants.tsx +19 -0
  172. package/src/upload/upload.libs.ts +97 -0
  173. package/src/upload/upload.tsx +340 -0
  174. package/src/upload/upload.types.ts +44 -0
  175. 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.