h2o-library 1.3.0 → 1.3.2

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.
@@ -25,3 +25,4 @@ export * from "./src/logo";
25
25
  export * from "./src/calendar";
26
26
  export * from "./src/month-calendar";
27
27
  export * from "./src/loader";
28
+ export * from "./src/message";
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export type MessageVariant = "info" | "muted" | "error" | "warning";
3
+ interface MessageProps {
4
+ variant: MessageVariant;
5
+ className?: string;
6
+ message?: string | null;
7
+ }
8
+ export declare const Message: ({ variant, className, message }: MessageProps) => React.JSX.Element | null;
9
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export interface ModalProps {
3
3
  isOpen: boolean;
4
- onClose: () => void;
4
+ onClose?: () => void;
5
5
  title?: string;
6
6
  description?: string;
7
7
  children: React.ReactNode;
@@ -4,6 +4,9 @@ export interface TableColumn<T> {
4
4
  key: string;
5
5
  label: string;
6
6
  sortable?: boolean;
7
+ minWidth?: string;
8
+ maxWidth?: string;
9
+ width?: string;
7
10
  render?: (value: any, row: T) => React.ReactNode;
8
11
  }
9
12
  export interface TableProps<T extends Record<string, any>> {
@@ -11,6 +14,7 @@ export interface TableProps<T extends Record<string, any>> {
11
14
  data: T[];
12
15
  isLoading?: boolean;
13
16
  className?: string;
17
+ rowHeight?: string;
14
18
  sortKey?: string;
15
19
  sortDirection?: SortDirection;
16
20
  onSort?: (key: string, direction: SortDirection) => void;
@@ -24,4 +28,4 @@ export interface TableProps<T extends Record<string, any>> {
24
28
  onPageChange?: (page: number) => void;
25
29
  onPerPageChange?: (perPage: string) => void;
26
30
  }
27
- export declare function Table<T extends Record<string, any>>({ columns, data, isLoading, className, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, }: TableProps<T>): React.JSX.Element;
31
+ export declare function Table<T extends Record<string, any>>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, }: TableProps<T>): React.JSX.Element;
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";
@@ -56,3 +56,4 @@
56
56
  @import "./src/toast.css";
57
57
  @import "./src/month-calendar.css";
58
58
  @import "./src/loader.css";
59
+ @import "./src/message.css";
@@ -0,0 +1,34 @@
1
+ .message {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 0.5rem;
5
+ padding: 0.75rem;
6
+ border-radius: var(--radius-md);
7
+ font-size: 0.875rem;
8
+ line-height: 1.25rem;
9
+ }
10
+
11
+ /* Variant styles */
12
+ .message-info {
13
+ background-color: hsl(var(--primary-muted) / 0.7);
14
+ color: hsl(var(--primary-300));
15
+ border: 1px solid hsl(var(--primary) / 0.2);
16
+ }
17
+
18
+ .message-muted {
19
+ background-color: hsl(var(--muted-25) / 0.5);
20
+ color: hsl(var(--muted-200));
21
+ border: 1px solid hsl(var(--muted) / 0.2);
22
+ }
23
+
24
+ .message-error {
25
+ background-color: hsl(var(--destructive-bg) / 0.5);
26
+ color: hsl(var(--destructive));
27
+ border: 1px solid hsl(var(--destructive) / 0.2);
28
+ }
29
+
30
+ .message-warning {
31
+ background-color: hsl(var(--warning-bg) / 0.4);
32
+ color: hsl(var(--warning));
33
+ border: 1px solid hsl(var(--warning) / 0.3);
34
+ }
@@ -5,7 +5,7 @@
5
5
  display: flex;
6
6
  align-items: center;
7
7
  justify-content: center;
8
- z-index: 50;
8
+ z-index: 500;
9
9
  animation: overlayShow 0.15s ease-out;
10
10
  }
11
11
 
@@ -2,14 +2,14 @@
2
2
  width: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
5
- gap: 1rem;
5
+ border: 1px solid hsl(var(--muted) / 60%);
6
+ border-radius: var(--radius-md);
7
+ background-color: hsl(var(--background));
6
8
  }
7
9
 
8
10
  .table-wrapper {
9
11
  width: 100%;
10
12
  overflow-x: auto;
11
- border: 1px solid hsl(var(--muted) / 60%);
12
- border-radius: var(--radius-md);
13
13
  }
14
14
 
15
15
  .table {
@@ -32,7 +32,8 @@
32
32
  }
33
33
 
34
34
  .table th.sortable:hover {
35
- background-color: hsl(var(--muted-200));
35
+ transition: color 0.2s ease-in-out;
36
+ color: hsl(var(--primary));
36
37
  }
37
38
 
38
39
  .table-header-content {
@@ -76,28 +77,23 @@
76
77
  padding: 2rem !important;
77
78
  }
78
79
 
79
- .table-loading {
80
+ .table-loader {
81
+ height: 8rem;
82
+ justify-content: center;
83
+ align-items: center;
84
+ display: flex;
85
+ }
86
+
87
+ .table-empty-content {
80
88
  display: flex;
81
89
  align-items: center;
82
90
  justify-content: center;
83
91
  gap: 0.5rem;
84
- }
85
-
86
- .table-loader {
87
- width: 1rem;
88
- height: 1rem;
89
- border: 2px solid hsl(var(--muted-50));
90
- border-top-color: hsl(var(--primary));
91
- border-radius: 50%;
92
- animation: spin 1s linear infinite;
93
- }
94
-
95
- @keyframes spin {
96
- to {
97
- transform: rotate(360deg);
98
- }
92
+ font-size: 1.25rem;
93
+ color: hsl(var(--muted));
99
94
  }
100
95
 
101
96
  .table-pagination {
102
- padding: 0 0.5rem;
103
- }
97
+ padding: 0.8rem;
98
+ border-top: 1px solid hsl(var(--muted) / 60%);
99
+ }
@@ -25,3 +25,4 @@ export * from "./src/logo";
25
25
  export * from "./src/calendar";
26
26
  export * from "./src/month-calendar";
27
27
  export * from "./src/loader";
28
+ export * from "./src/message";
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export type MessageVariant = "info" | "muted" | "error" | "warning";
3
+ interface MessageProps {
4
+ variant: MessageVariant;
5
+ className?: string;
6
+ message?: string | null;
7
+ }
8
+ export declare const Message: ({ variant, className, message }: MessageProps) => React.JSX.Element | null;
9
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export interface ModalProps {
3
3
  isOpen: boolean;
4
- onClose: () => void;
4
+ onClose?: () => void;
5
5
  title?: string;
6
6
  description?: string;
7
7
  children: React.ReactNode;
@@ -4,6 +4,9 @@ export interface TableColumn<T> {
4
4
  key: string;
5
5
  label: string;
6
6
  sortable?: boolean;
7
+ minWidth?: string;
8
+ maxWidth?: string;
9
+ width?: string;
7
10
  render?: (value: any, row: T) => React.ReactNode;
8
11
  }
9
12
  export interface TableProps<T extends Record<string, any>> {
@@ -11,6 +14,7 @@ export interface TableProps<T extends Record<string, any>> {
11
14
  data: T[];
12
15
  isLoading?: boolean;
13
16
  className?: string;
17
+ rowHeight?: string;
14
18
  sortKey?: string;
15
19
  sortDirection?: SortDirection;
16
20
  onSort?: (key: string, direction: SortDirection) => void;
@@ -24,4 +28,4 @@ export interface TableProps<T extends Record<string, any>> {
24
28
  onPageChange?: (page: number) => void;
25
29
  onPerPageChange?: (perPage: string) => void;
26
30
  }
27
- export declare function Table<T extends Record<string, any>>({ columns, data, isLoading, className, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, }: TableProps<T>): React.JSX.Element;
31
+ export declare function Table<T extends Record<string, any>>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, }: TableProps<T>): React.JSX.Element;
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";