mobigrid-module 1.1.6 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/dist/components/CustomTable/CustomTable.d.ts +8 -0
  2. package/dist/components/CustomTable/Pagination.d.ts +8 -0
  3. package/dist/components/Icon.d.ts +6 -0
  4. package/dist/components/InvalidConfig.d.ts +2 -0
  5. package/dist/components/Layout/PageHeader.d.ts +13 -0
  6. package/dist/components/LoadingConfig.d.ts +2 -0
  7. package/dist/components/ui/alert.d.ts +8 -0
  8. package/dist/components/ui/button.d.ts +11 -0
  9. package/dist/components/ui/calendar.d.ts +8 -0
  10. package/dist/components/ui/date-picker-with-range.d.ts +7 -0
  11. package/dist/components/ui/dialog.d.ts +19 -0
  12. package/dist/components/ui/input.d.ts +3 -0
  13. package/dist/components/ui/pagination.d.ts +28 -0
  14. package/dist/components/ui/popover.d.ts +7 -0
  15. package/dist/components/ui/select.d.ts +13 -0
  16. package/dist/components/ui/sonner.d.ts +5 -0
  17. package/dist/components/ui/table.d.ts +10 -0
  18. package/dist/index.cjs +53 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.ts +9 -0
  21. package/dist/index.esm.js +70 -0
  22. package/dist/index.esm.js.map +1 -0
  23. package/dist/index.js +53 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/lib/utils.d.ts +2 -0
  26. package/dist/vite.config.d.ts +2 -0
  27. package/package.json +12 -9
  28. package/components/CustomTable/CustomTable.tsx +0 -182
  29. package/components/CustomTable/Pagination.tsx +0 -136
  30. package/components/Icon.tsx +0 -27
  31. package/components/InvalidConfig.tsx +0 -26
  32. package/components/Layout/PageHeader.tsx +0 -270
  33. package/components/LoadingConfig.tsx +0 -38
  34. package/components/ui/alert.tsx +0 -59
  35. package/components/ui/button.tsx +0 -57
  36. package/components/ui/calendar.tsx +0 -99
  37. package/components/ui/date-picker-with-range.tsx +0 -176
  38. package/components/ui/dialog.tsx +0 -132
  39. package/components/ui/input.tsx +0 -22
  40. package/components/ui/pagination.tsx +0 -142
  41. package/components/ui/popover.tsx +0 -31
  42. package/components/ui/select.tsx +0 -208
  43. package/components/ui/sonner.tsx +0 -30
  44. package/components/ui/table.tsx +0 -120
  45. package/index.d.ts +0 -55
  46. package/index.tsx +0 -209
  47. package/lib/utils.ts +0 -6
  48. package/tsconfig.json +0 -36
@@ -1,142 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../../lib/utils";
4
- import { ButtonProps, buttonVariants } from "./button";
5
-
6
- const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
7
- <nav
8
- role="navigation"
9
- aria-label="pagination"
10
- className={cn("mx-auto flex w-full justify-center", className)}
11
- {...props}
12
- />
13
- );
14
- Pagination.displayName = "Pagination";
15
-
16
- const PaginationContent = React.forwardRef<
17
- HTMLUListElement,
18
- React.ComponentProps<"ul">
19
- >(({ className, ...props }, ref) => (
20
- <ul
21
- ref={ref}
22
- className={cn("flex flex-row items-center gap-1", className)}
23
- {...props}
24
- />
25
- ));
26
- PaginationContent.displayName = "PaginationContent";
27
-
28
- const PaginationItem = React.forwardRef<
29
- HTMLLIElement,
30
- React.ComponentProps<"li">
31
- >(({ className, ...props }, ref) => (
32
- <li ref={ref} className={cn("", className)} {...props} />
33
- ));
34
- PaginationItem.displayName = "PaginationItem";
35
-
36
- type PaginationLinkProps = {
37
- isActive?: boolean;
38
- } & Pick<ButtonProps, "size"> &
39
- React.ComponentProps<"a">;
40
-
41
- const PaginationLink = ({
42
- className,
43
- isActive,
44
- size = "icon",
45
- ...props
46
- }: PaginationLinkProps) => (
47
- <a
48
- aria-current={isActive ? "page" : undefined}
49
- className={cn(
50
- buttonVariants({
51
- variant: isActive ? "outline" : "ghost",
52
- size,
53
- }),
54
- className
55
- )}
56
- {...props}
57
- />
58
- );
59
- PaginationLink.displayName = "PaginationLink";
60
-
61
- const PaginationPrevious = ({
62
- className,
63
- ...props
64
- }: React.ComponentProps<typeof PaginationLink>) => (
65
- <PaginationLink
66
- aria-label="Go to previous page"
67
- size="default"
68
- className={cn("gap-1 pl-2.5", className)}
69
- {...props}
70
- >
71
- <svg
72
- xmlns="http://www.w3.org/2000/svg"
73
- fill="none"
74
- viewBox="0 0 24 24"
75
- strokeWidth="1.5"
76
- stroke="currentColor"
77
- className="size-6"
78
- >
79
- <path
80
- strokeLinecap="round"
81
- strokeLinejoin="round"
82
- d="M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18"
83
- />
84
- </svg>
85
-
86
- <span>Previous</span>
87
- </PaginationLink>
88
- );
89
- PaginationPrevious.displayName = "PaginationPrevious";
90
-
91
- const PaginationNext = ({
92
- className,
93
- ...props
94
- }: React.ComponentProps<typeof PaginationLink>) => (
95
- <PaginationLink
96
- aria-label="Go to next page"
97
- size="default"
98
- className={cn("gap-1 pr-2.5", className)}
99
- {...props}
100
- >
101
- <span>Next</span>
102
- <svg
103
- xmlns="http://www.w3.org/2000/svg"
104
- fill="none"
105
- viewBox="0 0 24 24"
106
- strokeWidth="1.5"
107
- stroke="currentColor"
108
- className="size-6"
109
- >
110
- <path
111
- strokeLinecap="round"
112
- strokeLinejoin="round"
113
- d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"
114
- />
115
- </svg>
116
- </PaginationLink>
117
- );
118
- PaginationNext.displayName = "PaginationNext";
119
-
120
- const PaginationEllipsis = ({
121
- className,
122
- ...props
123
- }: React.ComponentProps<"span">) => (
124
- <span
125
- aria-hidden
126
- className={cn("flex h-9 w-9 items-center justify-center", className)}
127
- {...props}
128
- >
129
- <span className="sr-only">More pages</span>
130
- </span>
131
- );
132
- PaginationEllipsis.displayName = "PaginationEllipsis";
133
-
134
- export {
135
- Pagination,
136
- PaginationContent,
137
- PaginationLink,
138
- PaginationItem,
139
- PaginationPrevious,
140
- PaginationNext,
141
- PaginationEllipsis,
142
- };
@@ -1,31 +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
- const Popover = PopoverPrimitive.Root
7
-
8
- const PopoverTrigger = PopoverPrimitive.Trigger
9
-
10
- const PopoverAnchor = PopoverPrimitive.Anchor
11
-
12
- const PopoverContent = React.forwardRef<
13
- React.ElementRef<typeof PopoverPrimitive.Content>,
14
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
- <PopoverPrimitive.Portal>
17
- <PopoverPrimitive.Content
18
- ref={ref}
19
- align={align}
20
- sideOffset={sideOffset}
21
- className={cn(
22
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
23
- className
24
- )}
25
- {...props}
26
- />
27
- </PopoverPrimitive.Portal>
28
- ))
29
- PopoverContent.displayName = PopoverPrimitive.Content.displayName
30
-
31
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -1,208 +0,0 @@
1
- import * as React from "react";
2
- import * as SelectPrimitive from "@radix-ui/react-select";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const Select = SelectPrimitive.Root;
7
-
8
- const SelectGroup = SelectPrimitive.Group;
9
-
10
- const SelectValue = SelectPrimitive.Value;
11
-
12
- const SelectTrigger = React.forwardRef<
13
- React.ElementRef<typeof SelectPrimitive.Trigger>,
14
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
15
- >(({ className, children, ...props }, ref) => (
16
- <SelectPrimitive.Trigger
17
- ref={ref}
18
- className={cn(
19
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
20
- className
21
- )}
22
- {...props}
23
- >
24
- {children}
25
- <SelectPrimitive.Icon asChild>
26
- <svg
27
- xmlns="http://www.w3.org/2000/svg"
28
- fill="none"
29
- viewBox="0 0 24 24"
30
- strokeWidth="1.5"
31
- stroke="currentColor"
32
- className="size-6"
33
- >
34
- <path
35
- strokeLinecap="round"
36
- strokeLinejoin="round"
37
- d="M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"
38
- />
39
- </svg>
40
- </SelectPrimitive.Icon>
41
- </SelectPrimitive.Trigger>
42
- ));
43
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
44
-
45
- const SelectScrollUpButton = React.forwardRef<
46
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
47
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
48
- >(({ className, ...props }, ref) => (
49
- <SelectPrimitive.ScrollUpButton
50
- ref={ref}
51
- className={cn(
52
- "flex cursor-default items-center justify-center py-1",
53
- className
54
- )}
55
- {...props}
56
- >
57
- <svg
58
- xmlns="http://www.w3.org/2000/svg"
59
- fill="none"
60
- viewBox="0 0 24 24"
61
- strokeWidth="1.5"
62
- stroke="currentColor"
63
- className="size-6"
64
- >
65
- <path
66
- strokeLinecap="round"
67
- strokeLinejoin="round"
68
- d="M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"
69
- />
70
- </svg>
71
- </SelectPrimitive.ScrollUpButton>
72
- ));
73
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
74
-
75
- const SelectScrollDownButton = React.forwardRef<
76
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
77
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
78
- >(({ className, ...props }, ref) => (
79
- <SelectPrimitive.ScrollDownButton
80
- ref={ref}
81
- className={cn(
82
- "flex cursor-default items-center justify-center py-1",
83
- className
84
- )}
85
- {...props}
86
- >
87
- <svg
88
- xmlns="http://www.w3.org/2000/svg"
89
- fill="none"
90
- viewBox="0 0 24 24"
91
- strokeWidth="1.5"
92
- stroke="currentColor"
93
- className="size-6"
94
- >
95
- <path
96
- strokeLinecap="round"
97
- strokeLinejoin="round"
98
- d="M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"
99
- />
100
- </svg>
101
- </SelectPrimitive.ScrollDownButton>
102
- ));
103
- SelectScrollDownButton.displayName =
104
- SelectPrimitive.ScrollDownButton.displayName;
105
-
106
- const SelectContent = React.forwardRef<
107
- React.ElementRef<typeof SelectPrimitive.Content>,
108
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
109
- >(({ className, children, position = "popper", ...props }, ref) => (
110
- <SelectPrimitive.Portal>
111
- <SelectPrimitive.Content
112
- ref={ref}
113
- className={cn(
114
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
115
- position === "popper" &&
116
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
117
- className
118
- )}
119
- position={position}
120
- {...props}
121
- >
122
- <SelectScrollUpButton />
123
- <SelectPrimitive.Viewport
124
- className={cn(
125
- "p-1",
126
- position === "popper" &&
127
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
128
- )}
129
- >
130
- {children}
131
- </SelectPrimitive.Viewport>
132
- <SelectScrollDownButton />
133
- </SelectPrimitive.Content>
134
- </SelectPrimitive.Portal>
135
- ));
136
- SelectContent.displayName = SelectPrimitive.Content.displayName;
137
-
138
- const SelectLabel = React.forwardRef<
139
- React.ElementRef<typeof SelectPrimitive.Label>,
140
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
141
- >(({ className, ...props }, ref) => (
142
- <SelectPrimitive.Label
143
- ref={ref}
144
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
145
- {...props}
146
- />
147
- ));
148
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
149
-
150
- const SelectItem = React.forwardRef<
151
- React.ElementRef<typeof SelectPrimitive.Item>,
152
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
153
- >(({ className, children, ...props }, ref) => (
154
- <SelectPrimitive.Item
155
- ref={ref}
156
- className={cn(
157
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
158
- className
159
- )}
160
- {...props}
161
- >
162
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
163
- <SelectPrimitive.ItemIndicator>
164
- <svg
165
- xmlns="http://www.w3.org/2000/svg"
166
- fill="none"
167
- viewBox="0 0 24 24"
168
- strokeWidth="1.5"
169
- stroke="currentColor"
170
- className="size-6"
171
- >
172
- <path
173
- strokeLinecap="round"
174
- strokeLinejoin="round"
175
- d="m4.5 12.75 6 6 9-13.5"
176
- />
177
- </svg>
178
- </SelectPrimitive.ItemIndicator>
179
- </span>
180
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
181
- </SelectPrimitive.Item>
182
- ));
183
- SelectItem.displayName = SelectPrimitive.Item.displayName;
184
-
185
- const SelectSeparator = React.forwardRef<
186
- React.ElementRef<typeof SelectPrimitive.Separator>,
187
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
188
- >(({ className, ...props }, ref) => (
189
- <SelectPrimitive.Separator
190
- ref={ref}
191
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
192
- {...props}
193
- />
194
- ));
195
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
196
-
197
- export {
198
- Select,
199
- SelectGroup,
200
- SelectValue,
201
- SelectTrigger,
202
- SelectContent,
203
- SelectLabel,
204
- SelectItem,
205
- SelectSeparator,
206
- SelectScrollUpButton,
207
- SelectScrollDownButton,
208
- };
@@ -1,30 +0,0 @@
1
- import React from "react"
2
- import { useTheme } from "next-themes"
3
- import { Toaster as Sonner } from "sonner"
4
-
5
- type ToasterProps = React.ComponentProps<typeof Sonner>
6
-
7
- const Toaster = ({ ...props }: ToasterProps) => {
8
- const { theme = "system" } = useTheme()
9
-
10
- return (
11
- <Sonner
12
- theme={theme as ToasterProps["theme"]}
13
- className="toaster group"
14
- toastOptions={{
15
- classNames: {
16
- toast:
17
- "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
18
- description: "group-[.toast]:text-muted-foreground",
19
- actionButton:
20
- "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
21
- cancelButton:
22
- "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
23
- },
24
- }}
25
- {...props}
26
- />
27
- )
28
- }
29
-
30
- export { Toaster }
@@ -1,120 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../../lib/utils"
4
-
5
- const Table = React.forwardRef<
6
- HTMLTableElement,
7
- React.HTMLAttributes<HTMLTableElement>
8
- >(({ className, ...props }, ref) => (
9
- <div className="relative w-full overflow-auto">
10
- <table
11
- ref={ref}
12
- className={cn("w-full caption-bottom text-sm", className)}
13
- {...props}
14
- />
15
- </div>
16
- ))
17
- Table.displayName = "Table"
18
-
19
- const TableHeader = React.forwardRef<
20
- HTMLTableSectionElement,
21
- React.HTMLAttributes<HTMLTableSectionElement>
22
- >(({ className, ...props }, ref) => (
23
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
24
- ))
25
- TableHeader.displayName = "TableHeader"
26
-
27
- const TableBody = React.forwardRef<
28
- HTMLTableSectionElement,
29
- React.HTMLAttributes<HTMLTableSectionElement>
30
- >(({ className, ...props }, ref) => (
31
- <tbody
32
- ref={ref}
33
- className={cn("[&_tr:last-child]:border-0", className)}
34
- {...props}
35
- />
36
- ))
37
- TableBody.displayName = "TableBody"
38
-
39
- const TableFooter = React.forwardRef<
40
- HTMLTableSectionElement,
41
- React.HTMLAttributes<HTMLTableSectionElement>
42
- >(({ className, ...props }, ref) => (
43
- <tfoot
44
- ref={ref}
45
- className={cn(
46
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
47
- className
48
- )}
49
- {...props}
50
- />
51
- ))
52
- TableFooter.displayName = "TableFooter"
53
-
54
- const TableRow = React.forwardRef<
55
- HTMLTableRowElement,
56
- React.HTMLAttributes<HTMLTableRowElement>
57
- >(({ className, ...props }, ref) => (
58
- <tr
59
- ref={ref}
60
- className={cn(
61
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
62
- className
63
- )}
64
- {...props}
65
- />
66
- ))
67
- TableRow.displayName = "TableRow"
68
-
69
- const TableHead = React.forwardRef<
70
- HTMLTableCellElement,
71
- React.ThHTMLAttributes<HTMLTableCellElement>
72
- >(({ className, ...props }, ref) => (
73
- <th
74
- ref={ref}
75
- className={cn(
76
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
77
- className
78
- )}
79
- {...props}
80
- />
81
- ))
82
- TableHead.displayName = "TableHead"
83
-
84
- const TableCell = React.forwardRef<
85
- HTMLTableCellElement,
86
- React.TdHTMLAttributes<HTMLTableCellElement>
87
- >(({ className, ...props }, ref) => (
88
- <td
89
- ref={ref}
90
- className={cn(
91
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
92
- className
93
- )}
94
- {...props}
95
- />
96
- ))
97
- TableCell.displayName = "TableCell"
98
-
99
- const TableCaption = React.forwardRef<
100
- HTMLTableCaptionElement,
101
- React.HTMLAttributes<HTMLTableCaptionElement>
102
- >(({ className, ...props }, ref) => (
103
- <caption
104
- ref={ref}
105
- className={cn("mt-4 text-sm text-muted-foreground", className)}
106
- {...props}
107
- />
108
- ))
109
- TableCaption.displayName = "TableCaption"
110
-
111
- export {
112
- Table,
113
- TableHeader,
114
- TableBody,
115
- TableFooter,
116
- TableHead,
117
- TableRow,
118
- TableCell,
119
- TableCaption,
120
- }
package/index.d.ts DELETED
@@ -1,55 +0,0 @@
1
- declare module "mobigrid-module" {
2
- import { ReactNode } from "react";
3
-
4
- export interface FilterOption {
5
- name: string;
6
- type: string;
7
- urlSource?: string;
8
- options?: any[];
9
- label?: string;
10
- placeholder?: string;
11
- required?: boolean;
12
- }
13
-
14
- export interface Column {
15
- field: string;
16
- headerName: string;
17
- width?: number;
18
- sortable?: boolean;
19
- renderCell?: (params: any) => ReactNode;
20
- }
21
-
22
- export interface Config {
23
- title: string;
24
- data_url: string;
25
- colomns: Column[];
26
- Filters?: FilterOption[][];
27
- }
28
-
29
- export interface FilterState {
30
- fromDate: string;
31
- toDate: string;
32
- [key: string]: any;
33
- }
34
-
35
- export interface ApiResponse {
36
- DATA: any[];
37
- PAGESNUM: number;
38
- }
39
-
40
- export interface Error {
41
- title: string;
42
- message: string;
43
- }
44
-
45
- export interface MobigridModuleProps {
46
- configUrl: string;
47
- preJsUrl: string;
48
- itemsPerPage?: number;
49
- children?: ReactNode;
50
- }
51
-
52
- const MobigridModule: React.FC<MobigridModuleProps>;
53
-
54
- export default MobigridModule;
55
- }