@rovula/ui 0.0.11 → 0.0.12

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 (31) hide show
  1. package/dist/cjs/bundle.css +55 -5
  2. package/dist/cjs/bundle.js +23 -1
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/DataTable/DataTable.d.ts +6 -11
  5. package/dist/cjs/types/components/DataTable/DataTable.stories.d.ts +3 -0
  6. package/dist/cjs/types/components/Table/Table.d.ts +3 -1
  7. package/dist/cjs/types/components/Table/Table.stories.d.ts +4 -1
  8. package/dist/cjs/types/index.d.ts +2 -1
  9. package/dist/components/DataTable/DataTable.js +62 -23
  10. package/dist/components/DataTable/DataTable.stories.js +16 -25
  11. package/dist/components/Table/Table.js +6 -6
  12. package/dist/esm/bundle.css +55 -5
  13. package/dist/esm/bundle.js +23 -1
  14. package/dist/esm/bundle.js.map +1 -1
  15. package/dist/esm/types/components/DataTable/DataTable.d.ts +6 -11
  16. package/dist/esm/types/components/DataTable/DataTable.stories.d.ts +3 -0
  17. package/dist/esm/types/components/Table/Table.d.ts +3 -1
  18. package/dist/esm/types/components/Table/Table.stories.d.ts +4 -1
  19. package/dist/esm/types/index.d.ts +2 -1
  20. package/dist/index.d.ts +14 -2
  21. package/dist/index.js +1 -0
  22. package/dist/src/theme/global.css +71 -6
  23. package/package.json +2 -1
  24. package/src/components/DataTable/DataTable.stories.tsx +26 -30
  25. package/src/components/DataTable/DataTable.tsx +111 -45
  26. package/src/components/Table/Table.tsx +17 -8
  27. package/src/index.ts +2 -1
  28. package/dist/cjs/types/components/ui/table.d.ts +0 -10
  29. package/dist/components/ui/table.js +0 -66
  30. package/dist/esm/types/components/ui/table.d.ts +0 -10
  31. package/src/components/ui/table.tsx +0 -117
@@ -4,12 +4,14 @@ import { cn } from "@/utils/cn";
4
4
 
5
5
  const Table = React.forwardRef<
6
6
  HTMLTableElement,
7
- React.HTMLAttributes<HTMLTableElement>
8
- >(({ className, ...props }, ref) => (
9
- <div className="relative w-full overflow-auto">
7
+ {
8
+ rootRef?: React.LegacyRef<HTMLDivElement>;
9
+ } & React.HTMLAttributes<HTMLTableElement>
10
+ >(({ className, rootRef, ...props }, ref) => (
11
+ <div className="relative h-full w-full overflow-auto" ref={rootRef}>
10
12
  <table
11
13
  ref={ref}
12
- className={cn("w-full caption-bottom text-sm", className)}
14
+ className={cn("w-full caption-bottom text-sm border-collapse", className)}
13
15
  {...props}
14
16
  />
15
17
  </div>
@@ -20,7 +22,11 @@ const TableHeader = React.forwardRef<
20
22
  HTMLTableSectionElement,
21
23
  React.HTMLAttributes<HTMLTableSectionElement>
22
24
  >(({ className, ...props }, ref) => (
23
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
25
+ <thead
26
+ ref={ref}
27
+ className={cn("[&_tr]:border-b bg-secondary-80", className)}
28
+ {...props}
29
+ />
24
30
  ));
25
31
  TableHeader.displayName = "TableHeader";
26
32
 
@@ -58,7 +64,7 @@ const TableRow = React.forwardRef<
58
64
  <tr
59
65
  ref={ref}
60
66
  className={cn(
61
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
67
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-grey-20",
62
68
  className
63
69
  )}
64
70
  {...props}
@@ -73,7 +79,7 @@ const TableHead = React.forwardRef<
73
79
  <th
74
80
  ref={ref}
75
81
  className={cn(
76
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
82
+ " h-12 py-3 px-6 text-left align-middle typography-body2 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",
77
83
  className
78
84
  )}
79
85
  {...props}
@@ -87,7 +93,10 @@ const TableCell = React.forwardRef<
87
93
  >(({ className, ...props }, ref) => (
88
94
  <td
89
95
  ref={ref}
90
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
96
+ className={cn(
97
+ " py-3 px-6 text-left align-middle typography-body3 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",
98
+ className
99
+ )}
91
100
  {...props}
92
101
  />
93
102
  ));
package/src/index.ts CHANGED
@@ -10,13 +10,14 @@ export { Checkbox } from "./components/Checkbox/Checkbox";
10
10
  export { Label } from "./components/Label/Label";
11
11
  export { Input } from "./components/Input/Input";
12
12
  export * from "./components/Table/Table";
13
+ export * from "./components/DataTable/DataTable";
13
14
  export * from "./components/Dialog/Dialog";
14
15
  export * from "./components/AlertDialog/AlertDialog";
15
16
 
16
17
  // Export component types
17
18
  export type { ButtonProps } from "./components/Button/Button";
18
19
  export type { InputProps } from "./components/TextInput/TextInput";
19
- export type { DropdownProps } from "./components/Dropdown/Dropdown";
20
+ export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
20
21
 
21
22
  // UTILS
22
23
  export {
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
3
- declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
4
- declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
5
- declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
6
- declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
7
- declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
8
- declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
9
- declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
10
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
@@ -1,66 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import * as React from "react";
25
- import { cn } from "@/utils/cn";
26
- var Table = React.forwardRef(function (_a, ref) {
27
- var className = _a.className, props = __rest(_a, ["className"]);
28
- return (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", __assign({ ref: ref, className: cn("w-full caption-bottom text-sm", className) }, props)) }));
29
- });
30
- Table.displayName = "Table";
31
- var TableHeader = React.forwardRef(function (_a, ref) {
32
- var className = _a.className, props = __rest(_a, ["className"]);
33
- return (_jsx("thead", __assign({ ref: ref, className: cn("[&_tr]:border-b", className) }, props)));
34
- });
35
- TableHeader.displayName = "TableHeader";
36
- var TableBody = React.forwardRef(function (_a, ref) {
37
- var className = _a.className, props = __rest(_a, ["className"]);
38
- return (_jsx("tbody", __assign({ ref: ref, className: cn("[&_tr:last-child]:border-0", className) }, props)));
39
- });
40
- TableBody.displayName = "TableBody";
41
- var TableFooter = React.forwardRef(function (_a, ref) {
42
- var className = _a.className, props = __rest(_a, ["className"]);
43
- return (_jsx("tfoot", __assign({ ref: ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className) }, props)));
44
- });
45
- TableFooter.displayName = "TableFooter";
46
- var TableRow = React.forwardRef(function (_a, ref) {
47
- var className = _a.className, props = __rest(_a, ["className"]);
48
- return (_jsx("tr", __assign({ ref: ref, className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className) }, props)));
49
- });
50
- TableRow.displayName = "TableRow";
51
- var TableHead = React.forwardRef(function (_a, ref) {
52
- var className = _a.className, props = __rest(_a, ["className"]);
53
- return (_jsx("th", __assign({ ref: ref, className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className) }, props)));
54
- });
55
- TableHead.displayName = "TableHead";
56
- var TableCell = React.forwardRef(function (_a, ref) {
57
- var className = _a.className, props = __rest(_a, ["className"]);
58
- return (_jsx("td", __assign({ ref: ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className) }, props)));
59
- });
60
- TableCell.displayName = "TableCell";
61
- var TableCaption = React.forwardRef(function (_a, ref) {
62
- var className = _a.className, props = __rest(_a, ["className"]);
63
- return (_jsx("caption", __assign({ ref: ref, className: cn("mt-4 text-sm text-muted-foreground", className) }, props)));
64
- });
65
- TableCaption.displayName = "TableCaption";
66
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
3
- declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
4
- declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
5
- declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
6
- declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
7
- declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
8
- declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
9
- declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
10
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
@@ -1,117 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/utils/cn"
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-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
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("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
91
- {...props}
92
- />
93
- ))
94
- TableCell.displayName = "TableCell"
95
-
96
- const TableCaption = React.forwardRef<
97
- HTMLTableCaptionElement,
98
- React.HTMLAttributes<HTMLTableCaptionElement>
99
- >(({ className, ...props }, ref) => (
100
- <caption
101
- ref={ref}
102
- className={cn("mt-4 text-sm text-muted-foreground", className)}
103
- {...props}
104
- />
105
- ))
106
- TableCaption.displayName = "TableCaption"
107
-
108
- export {
109
- Table,
110
- TableHeader,
111
- TableBody,
112
- TableFooter,
113
- TableHead,
114
- TableRow,
115
- TableCell,
116
- TableCaption,
117
- }