@rebasepro/ui 0.6.0 → 0.7.0
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/dist/icons/index.d.ts +1 -1
- package/dist/index.css +13 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +2119 -74
- package/dist/index.es.js.map +1 -1
- package/dist/src/index.css +13 -13
- package/dist/styles.d.ts +9 -9
- package/dist/views/CardView.d.ts +32 -0
- package/dist/views/CollectionView/CollectionCardView.d.ts +30 -0
- package/dist/views/CollectionView/CollectionKanbanView.d.ts +31 -0
- package/dist/views/CollectionView/CollectionListView.d.ts +30 -0
- package/dist/views/CollectionView/CollectionTableView.d.ts +37 -0
- package/dist/views/CollectionView/CollectionView.d.ts +121 -0
- package/dist/views/CollectionView/CollectionViewToolbar.d.ts +31 -0
- package/dist/views/CollectionView/CollectionViewTypes.d.ts +106 -0
- package/dist/views/CollectionView/DefaultCellRenderer.d.ts +9 -0
- package/dist/views/CollectionView/index.d.ts +24 -0
- package/dist/views/CollectionView/utils.d.ts +5 -0
- package/dist/views/Kanban/Board.d.ts +3 -0
- package/dist/views/Kanban/BoardColumn.d.ts +20 -0
- package/dist/views/Kanban/BoardColumnTitle.d.ts +8 -0
- package/dist/views/Kanban/BoardSortableList.d.ts +14 -0
- package/dist/views/Kanban/board_types.d.ts +61 -0
- package/dist/views/Kanban/index.d.ts +5 -0
- package/dist/views/KanbanView.d.ts +24 -0
- package/dist/views/ListView.d.ts +40 -0
- package/dist/views/TableView.d.ts +6 -0
- package/dist/views/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Alert.tsx +1 -1
- package/src/components/BooleanSwitchWithLabel.tsx +1 -1
- package/src/components/Button.tsx +5 -5
- package/src/components/Chip.tsx +39 -37
- package/src/components/DateTimeField.tsx +2 -2
- package/src/components/Dialog.tsx +1 -1
- package/src/components/ExpandablePanel.tsx +1 -1
- package/src/components/FileUpload.tsx +1 -1
- package/src/components/FilterChip.tsx +2 -2
- package/src/components/IconButton.tsx +1 -1
- package/src/components/MultiSelect.tsx +1 -1
- package/src/components/Select.tsx +2 -2
- package/src/components/Sheet.tsx +8 -4
- package/src/components/Table.tsx +2 -2
- package/src/components/TextField.tsx +3 -3
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/icons/index.ts +3 -0
- package/src/index.css +13 -13
- package/src/index.ts +2 -0
- package/src/styles.ts +9 -9
- package/src/views/CardView.tsx +281 -0
- package/src/views/CollectionView/CollectionCardView.tsx +270 -0
- package/src/views/CollectionView/CollectionKanbanView.tsx +251 -0
- package/src/views/CollectionView/CollectionListView.tsx +245 -0
- package/src/views/CollectionView/CollectionTableView.tsx +229 -0
- package/src/views/CollectionView/CollectionView.tsx +388 -0
- package/src/views/CollectionView/CollectionViewToolbar.tsx +229 -0
- package/src/views/CollectionView/CollectionViewTypes.ts +137 -0
- package/src/views/CollectionView/DefaultCellRenderer.tsx +404 -0
- package/src/views/CollectionView/index.ts +44 -0
- package/src/views/CollectionView/utils.ts +14 -0
- package/src/views/Kanban/Board.tsx +421 -0
- package/src/views/Kanban/BoardColumn.tsx +135 -0
- package/src/views/Kanban/BoardColumnTitle.tsx +47 -0
- package/src/views/Kanban/BoardSortableList.tsx +170 -0
- package/src/views/Kanban/board_types.ts +70 -0
- package/src/views/Kanban/index.tsx +5 -0
- package/src/views/KanbanView.tsx +32 -0
- package/src/views/ListView.tsx +281 -0
- package/src/views/TableView.tsx +7 -0
- package/src/views/index.ts +5 -0
- package/dist/index.umd.js +0 -6958
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
export type ChipColorKey = "primary" | "secondary" | "success" | "warning" | "error" | "info" | "neutral" | string;
|
|
3
|
+
export type ChipColorScheme = "filled" | "outlined" | "tinted" | string;
|
|
4
|
+
/**
|
|
5
|
+
* Item wrapper for elements in the Board component
|
|
6
|
+
*/
|
|
7
|
+
export interface BoardItem<T = any> {
|
|
8
|
+
id: string;
|
|
9
|
+
data: T;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Map of column keys to arrays of board items
|
|
13
|
+
*/
|
|
14
|
+
export interface BoardItemMap<T = any> {
|
|
15
|
+
[columnKey: string]: BoardItem<T>[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props passed to custom item render components
|
|
19
|
+
*/
|
|
20
|
+
export interface BoardItemViewProps<T = any> {
|
|
21
|
+
item: BoardItem<T>;
|
|
22
|
+
isDragging: boolean;
|
|
23
|
+
isClone?: boolean;
|
|
24
|
+
isGroupedOver?: boolean;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
index?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Per-column loading state
|
|
30
|
+
*/
|
|
31
|
+
export interface ColumnLoadingState {
|
|
32
|
+
[columnKey: string]: {
|
|
33
|
+
loading: boolean;
|
|
34
|
+
hasMore: boolean;
|
|
35
|
+
itemCount: number;
|
|
36
|
+
totalCount?: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props for the Board component
|
|
41
|
+
*/
|
|
42
|
+
export interface BoardProps<T, COLUMN extends string> {
|
|
43
|
+
data: BoardItem<T>[];
|
|
44
|
+
columns: COLUMN[];
|
|
45
|
+
columnLabels?: Record<COLUMN, string>;
|
|
46
|
+
columnColors?: Record<COLUMN, any>;
|
|
47
|
+
className?: string;
|
|
48
|
+
assignColumn: (item: BoardItem<T>) => COLUMN;
|
|
49
|
+
allowColumnReorder?: boolean;
|
|
50
|
+
onColumnReorder?: (columns: COLUMN[]) => void;
|
|
51
|
+
onItemsReorder?: (items: BoardItem<T>[], moveInfo?: {
|
|
52
|
+
itemId: string;
|
|
53
|
+
sourceColumn: COLUMN;
|
|
54
|
+
targetColumn: COLUMN;
|
|
55
|
+
}) => void;
|
|
56
|
+
ItemComponent: React.ComponentType<BoardItemViewProps<T>>;
|
|
57
|
+
columnLoadingState?: ColumnLoadingState;
|
|
58
|
+
onLoadMoreColumn?: (column: COLUMN) => void;
|
|
59
|
+
onAddItemToColumn?: (column: COLUMN) => void;
|
|
60
|
+
AddColumnComponent?: React.ReactNode;
|
|
61
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BoardItem, BoardItemViewProps, ColumnLoadingState } from "./Kanban/board_types";
|
|
3
|
+
export type KanbanViewProps<T, COLUMN extends string> = {
|
|
4
|
+
columns: COLUMN[];
|
|
5
|
+
columnLabels?: Record<COLUMN, string>;
|
|
6
|
+
columnColors?: Record<COLUMN, any>;
|
|
7
|
+
className?: string;
|
|
8
|
+
assignColumn: (item: BoardItem<T>) => COLUMN;
|
|
9
|
+
allowColumnReorder?: boolean;
|
|
10
|
+
onColumnReorder?: (columns: COLUMN[]) => void;
|
|
11
|
+
onItemsReorder?: (items: BoardItem<T>[], moveInfo?: {
|
|
12
|
+
itemId: string;
|
|
13
|
+
sourceColumn: COLUMN;
|
|
14
|
+
targetColumn: COLUMN;
|
|
15
|
+
}) => void;
|
|
16
|
+
ItemComponent: React.ComponentType<BoardItemViewProps<T>>;
|
|
17
|
+
columnLoadingState?: ColumnLoadingState;
|
|
18
|
+
onLoadMoreColumn?: (column: COLUMN) => void;
|
|
19
|
+
onAddItemToColumn?: (column: COLUMN) => void;
|
|
20
|
+
AddColumnComponent?: React.ReactNode;
|
|
21
|
+
data: BoardItem<T>[];
|
|
22
|
+
};
|
|
23
|
+
export declare function KanbanView<T, COLUMN extends string>(props: KanbanViewProps<T, COLUMN>): React.JSX.Element;
|
|
24
|
+
export type { BoardItem, BoardItemViewProps, ColumnLoadingState };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type CollectionSize = "xs" | "s" | "m" | "l" | "xl";
|
|
3
|
+
export type ListViewColumnDef<T> = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
align?: "left" | "center" | "right";
|
|
7
|
+
width?: string;
|
|
8
|
+
renderCell: (item: T) => React.ReactNode;
|
|
9
|
+
isTitle?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type ListViewProps<T> = {
|
|
12
|
+
data: T[];
|
|
13
|
+
dataLoading?: boolean;
|
|
14
|
+
noMoreToLoad?: boolean;
|
|
15
|
+
dataLoadingError?: Error;
|
|
16
|
+
itemCount?: number;
|
|
17
|
+
setItemCount?: (itemCount: number) => void;
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
paginationEnabled?: boolean;
|
|
20
|
+
onItemClick?: (item: T) => void;
|
|
21
|
+
selectedIds?: Set<string | number>;
|
|
22
|
+
highlightedIds?: Set<string | number>;
|
|
23
|
+
selectionEnabled?: boolean;
|
|
24
|
+
onSelectionChange?: (item: T, selected: boolean) => void;
|
|
25
|
+
emptyComponent?: React.ReactNode;
|
|
26
|
+
size?: CollectionSize;
|
|
27
|
+
selectedEntityId?: string | number;
|
|
28
|
+
renderRow: (params: {
|
|
29
|
+
item: T;
|
|
30
|
+
index: number;
|
|
31
|
+
style: React.CSSProperties;
|
|
32
|
+
className: string;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
highlighted: boolean;
|
|
35
|
+
isLast: boolean;
|
|
36
|
+
onClick: (e: React.MouseEvent) => void;
|
|
37
|
+
onSelectionChange: (selected: boolean) => void;
|
|
38
|
+
}) => React.ReactNode;
|
|
39
|
+
};
|
|
40
|
+
export declare function ListView<T>({ data, dataLoading, noMoreToLoad, dataLoadingError, itemCount, setItemCount, pageSize, paginationEnabled, onItemClick, selectedIds, highlightedIds, selectionEnabled, onSelectionChange, emptyComponent, size, selectedEntityId, renderRow }: ListViewProps<T>): React.JSX.Element;
|
package/package.json
CHANGED
package/src/components/Alert.tsx
CHANGED
|
@@ -58,7 +58,7 @@ export const Alert: React.FC<AlertProps> = ({
|
|
|
58
58
|
getSizeClasses(size),
|
|
59
59
|
"w-full",
|
|
60
60
|
"font-medium",
|
|
61
|
-
"rounded-
|
|
61
|
+
"rounded-lg flex items-center gap-2",
|
|
62
62
|
classes,
|
|
63
63
|
outerClassName)}>
|
|
64
64
|
<div className={cls("grow", className)}>{children}</div>
|
|
@@ -69,7 +69,7 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
|
|
|
69
69
|
!invisible && fieldBackgroundMixin,
|
|
70
70
|
!invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin),
|
|
71
71
|
disabled ? "cursor-default" : "cursor-pointer",
|
|
72
|
-
"rounded-
|
|
72
|
+
"rounded-lg max-w-full justify-between box-border relative inline-flex items-center",
|
|
73
73
|
!invisible && focus && !disabled ? focusedClasses : "",
|
|
74
74
|
error ? "text-red-500 dark:text-red-600" : (focus && !disabled ? "text-primary" : (!disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark")),
|
|
75
75
|
{
|
|
@@ -32,17 +32,17 @@ const ButtonInner = React.memo(React.forwardRef<
|
|
|
32
32
|
}: ButtonProps<React.ElementType>, ref) => {
|
|
33
33
|
|
|
34
34
|
const baseClasses =
|
|
35
|
-
"typography-button h-fit rounded-
|
|
35
|
+
"typography-button h-fit rounded-lg whitespace-nowrap inline-flex items-center justify-center p-2 px-4 focus:outline-none transition-colors ease-in-out duration-150 gap-2";
|
|
36
36
|
|
|
37
37
|
const buttonClasses = cls({
|
|
38
38
|
"w-full": fullWidth,
|
|
39
39
|
"w-fit": !fullWidth,
|
|
40
40
|
|
|
41
41
|
// Filled Variants
|
|
42
|
-
"border border-primary bg-primary focus:ring-primary
|
|
43
|
-
"border border-secondary bg-secondary focus:ring-secondary
|
|
44
|
-
"border border-red-500 bg-red-500 hover:bg-red-600 focus:ring-red-500
|
|
45
|
-
"border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400
|
|
42
|
+
"border border-primary bg-primary focus:ring-primary text-white hover:text-white hover:brightness-105": variant === "filled" && color === "primary" && !disabled,
|
|
43
|
+
"border border-secondary bg-secondary focus:ring-secondary text-white hover:text-white hover:brightness-105": variant === "filled" && color === "secondary" && !disabled,
|
|
44
|
+
"border border-red-500 bg-red-500 hover:bg-red-600 focus:ring-red-500 text-white hover:text-white": variant === "filled" && color === "error" && !disabled,
|
|
45
|
+
"border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 text-text-primary hover:text-text-primary dark:border-surface-accent-700 dark:bg-surface-accent-700 dark:hover:bg-surface-accent-600 dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "text" && !disabled,
|
|
46
46
|
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-700 dark:hover:bg-surface-accent-700 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "neutral" && !disabled,
|
|
47
47
|
|
|
48
48
|
// Text Variants
|
package/src/components/Chip.tsx
CHANGED
|
@@ -25,10 +25,10 @@ export interface ChipProps {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const sizeClassNames = {
|
|
28
|
-
smallest: "px-1.5 text-
|
|
29
|
-
small: "px-2 py-0.5 text-
|
|
30
|
-
medium: "px-
|
|
31
|
-
large: "px-
|
|
28
|
+
smallest: "px-1.5 py-px text-[10px]",
|
|
29
|
+
small: "px-2 py-0.5 text-xs",
|
|
30
|
+
medium: "px-2.5 py-0.5 text-xs",
|
|
31
|
+
large: "px-3 py-1 text-xs"
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -40,6 +40,21 @@ function isDarkMode(): boolean {
|
|
|
40
40
|
document.documentElement.classList.contains("dark");
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Helper to generate rgba from hex or standard colors.
|
|
45
|
+
*/
|
|
46
|
+
function getRgba(hex: string, alpha: number): string {
|
|
47
|
+
if (!hex || !hex.startsWith("#")) return hex;
|
|
48
|
+
let color = hex.slice(1);
|
|
49
|
+
if (color.length === 3) {
|
|
50
|
+
color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
|
|
51
|
+
}
|
|
52
|
+
const r = parseInt(color.slice(0, 2), 16);
|
|
53
|
+
const g = parseInt(color.slice(2, 4), 16);
|
|
54
|
+
const b = parseInt(color.slice(4, 6), 16);
|
|
55
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
/**
|
|
44
59
|
* @group Preview components
|
|
45
60
|
*/
|
|
@@ -50,28 +65,15 @@ export function Chip({
|
|
|
50
65
|
outlined,
|
|
51
66
|
onClick,
|
|
52
67
|
icon,
|
|
53
|
-
size = "
|
|
68
|
+
size = "medium",
|
|
54
69
|
className,
|
|
55
70
|
style
|
|
56
71
|
}: ChipProps) {
|
|
57
72
|
|
|
58
73
|
const usedColorScheme = typeof colorScheme === "string" ? getColorSchemeForKey(colorScheme) : colorScheme;
|
|
59
|
-
|
|
60
|
-
// Resolve theme-aware colors
|
|
61
74
|
const dark = isDarkMode();
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
const getRgba = (hex: string, alpha: number): string => {
|
|
65
|
-
if (!hex || !hex.startsWith("#")) return hex;
|
|
66
|
-
let color = hex.slice(1);
|
|
67
|
-
if (color.length === 3) {
|
|
68
|
-
color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
|
|
69
|
-
}
|
|
70
|
-
const r = parseInt(color.slice(0, 2), 16);
|
|
71
|
-
const g = parseInt(color.slice(2, 4), 16);
|
|
72
|
-
const b = parseInt(color.slice(4, 6), 16);
|
|
73
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
74
|
-
};
|
|
76
|
+
const hasScheme = error || usedColorScheme;
|
|
75
77
|
|
|
76
78
|
let textColor = "";
|
|
77
79
|
let bgColor = "";
|
|
@@ -81,44 +83,44 @@ export function Chip({
|
|
|
81
83
|
textColor = dark ? "#f87171" : "#dc2626";
|
|
82
84
|
} else if (usedColorScheme) {
|
|
83
85
|
textColor = dark && usedColorScheme.darkText ? usedColorScheme.darkText : usedColorScheme.text;
|
|
84
|
-
} else {
|
|
85
|
-
textColor = dark ? "#d4d4d4" : "#404040";
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (error) {
|
|
93
|
-
bgColor = dark ? "rgba(220, 38, 38, 0.
|
|
94
|
-
border = `1px solid ${dark ? "rgba(220, 38, 38, 0.
|
|
88
|
+
if (hasScheme) {
|
|
89
|
+
if (outlined) {
|
|
90
|
+
bgColor = getRgba(textColor, dark ? 0.1 : 0.06);
|
|
91
|
+
border = `1px solid ${getRgba(textColor, dark ? 0.2 : 0.14)}`;
|
|
92
|
+
} else if (error) {
|
|
93
|
+
bgColor = dark ? "rgba(220, 38, 38, 0.15)" : "rgba(239, 68, 68, 0.1)";
|
|
94
|
+
border = `1px solid ${dark ? "rgba(220, 38, 38, 0.3)" : "rgba(239, 68, 68, 0.2)"}`;
|
|
95
95
|
} else if (usedColorScheme) {
|
|
96
96
|
bgColor = dark && usedColorScheme.darkColor ? usedColorScheme.darkColor : usedColorScheme.color;
|
|
97
|
-
} else {
|
|
98
|
-
bgColor = dark ? "#1f1f1f" : "#f4f4f5";
|
|
99
|
-
border = `1px solid ${dark ? "#2e2e30" : "#e4e4e7"}`;
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
|
|
103
100
|
return (
|
|
104
101
|
<div
|
|
105
|
-
className={cls("rounded-lg max-w-full w-max h-fit font-
|
|
102
|
+
className={cls("rounded-lg max-w-full w-max h-fit font-medium inline-flex gap-1",
|
|
106
103
|
"text-ellipsis",
|
|
107
104
|
"items-center",
|
|
108
|
-
|
|
105
|
+
"transition-colors duration-150",
|
|
106
|
+
!hasScheme && "bg-surface-100 dark:bg-surface-800 text-text-secondary dark:text-text-secondary-dark border border-surface-200 dark:border-surface-700",
|
|
107
|
+
!hasScheme && outlined && "bg-transparent dark:bg-transparent",
|
|
108
|
+
onClick ? "cursor-pointer hover:bg-primary/5 dark:hover:bg-primary/5" : "",
|
|
109
109
|
sizeClassNames[size],
|
|
110
110
|
className)}
|
|
111
111
|
onClick={onClick}
|
|
112
112
|
style={{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
...(hasScheme ? {
|
|
114
|
+
backgroundColor: bgColor,
|
|
115
|
+
color: textColor,
|
|
116
|
+
border: border || undefined,
|
|
117
|
+
} : {}),
|
|
116
118
|
overflow: "hidden",
|
|
117
119
|
...style
|
|
118
120
|
}}
|
|
119
121
|
>
|
|
120
|
-
{children}
|
|
121
122
|
{icon}
|
|
123
|
+
{children}
|
|
122
124
|
</div>
|
|
123
125
|
);
|
|
124
126
|
}
|
|
@@ -225,7 +225,7 @@ hour12: false,
|
|
|
225
225
|
<style>{inputStyles}</style>
|
|
226
226
|
<div
|
|
227
227
|
className={cls(
|
|
228
|
-
"rounded-
|
|
228
|
+
"rounded-lg relative max-w-full",
|
|
229
229
|
!invisible && fieldBackgroundMixin,
|
|
230
230
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
231
231
|
{
|
|
@@ -272,7 +272,7 @@ hour12: false,
|
|
|
272
272
|
className={cls(
|
|
273
273
|
"w-full outline-hidden bg-transparent leading-normal text-base px-3",
|
|
274
274
|
clearable ? "pr-14" : "pr-12",
|
|
275
|
-
"rounded-
|
|
275
|
+
"rounded-lg",
|
|
276
276
|
{
|
|
277
277
|
"min-h-[28px]": size === "smallest",
|
|
278
278
|
"min-h-[32px]": size === "small",
|
|
@@ -127,7 +127,7 @@ export const Dialog = ({
|
|
|
127
127
|
fullHeight && !fullScreen ? "h-full" : undefined,
|
|
128
128
|
"text-surface-accent-900 dark:text-white",
|
|
129
129
|
"justify-center items-center",
|
|
130
|
-
fullScreen ? "h-screen w-screen" : "max-h-[90vh] shadow-
|
|
130
|
+
fullScreen ? "h-screen w-screen" : "max-h-[90vh] shadow-lg",
|
|
131
131
|
"ease-in-out duration-200",
|
|
132
132
|
scrollable && "overflow-y-auto",
|
|
133
133
|
displayed && open ? "opacity-100 scale-100" : "opacity-0 scale-[0.97]",
|
|
@@ -70,7 +70,7 @@ export function FileUpload({
|
|
|
70
70
|
className={cls(
|
|
71
71
|
fieldBackgroundMixin,
|
|
72
72
|
"flex gap-2",
|
|
73
|
-
"p-4 box-border relative items-center border-2 border-solid border-transparent outline-hidden rounded-
|
|
73
|
+
"p-4 box-border relative items-center border-2 border-solid border-transparent outline-hidden rounded-lg duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",
|
|
74
74
|
{
|
|
75
75
|
"h-44": size === "large",
|
|
76
76
|
"h-28": size === "medium",
|
|
@@ -58,14 +58,14 @@ export const FilterChip = React.forwardRef<HTMLButtonElement, FilterChipProps>(f
|
|
|
58
58
|
className={cls(
|
|
59
59
|
"inline-flex items-center gap-1 rounded-full",
|
|
60
60
|
"font-medium whitespace-nowrap select-none shrink-0",
|
|
61
|
-
"transition-
|
|
61
|
+
"transition-colors duration-150",
|
|
62
62
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
63
63
|
sizeClasses[size],
|
|
64
64
|
active
|
|
65
65
|
? "bg-primary/12 text-primary dark:bg-primary/20 dark:text-primary shadow-[inset_0_0_0_1.5px_var(--color-primary)]"
|
|
66
66
|
: cls(
|
|
67
67
|
"bg-surface-accent-100 text-text-secondary dark:bg-surface-accent-800 dark:text-text-secondary-dark",
|
|
68
|
-
!disabled && "cursor-pointer hover:bg-
|
|
68
|
+
!disabled && "cursor-pointer hover:bg-primary/5 dark:hover:bg-primary/5"
|
|
69
69
|
),
|
|
70
70
|
disabled && "opacity-50 cursor-not-allowed",
|
|
71
71
|
className
|
|
@@ -21,7 +21,7 @@ const colorClasses = "text-surface-accent-500 visited:text-surface-accent-500 da
|
|
|
21
21
|
const sizeClasses = {
|
|
22
22
|
medium: "w-10 !h-10 min-w-10 min-h-10",
|
|
23
23
|
small: "w-8 !h-8 min-w-8 min-h-8",
|
|
24
|
-
smallest: "w-
|
|
24
|
+
smallest: "w-7 !h-7 min-w-7 min-h-7",
|
|
25
25
|
large: "w-12 !h-12 min-w-12 min-h-12"
|
|
26
26
|
}
|
|
27
27
|
const shapeClasses = {
|
|
@@ -235,7 +235,7 @@ export const MultiSelect = React.forwardRef<
|
|
|
235
235
|
"px-2": size === "small" || size === "smallest",
|
|
236
236
|
"px-4": size === "medium" || size === "large"
|
|
237
237
|
},
|
|
238
|
-
"select-none rounded-
|
|
238
|
+
"select-none rounded-lg text-sm",
|
|
239
239
|
"focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none",
|
|
240
240
|
invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
|
|
241
241
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
@@ -139,7 +139,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
|
139
139
|
{...props}>
|
|
140
140
|
{typeof label === "string" ? <SelectInputLabel error={error}>{label}</SelectInputLabel> : label}
|
|
141
141
|
<div className={cls(
|
|
142
|
-
"select-none rounded-
|
|
142
|
+
"select-none rounded-lg text-sm",
|
|
143
143
|
invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
|
|
144
144
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
145
145
|
"relative flex items-center",
|
|
@@ -169,7 +169,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
|
169
169
|
} : "",
|
|
170
170
|
"outline-hidden focus:outline-hidden",
|
|
171
171
|
"outline-none focus:outline-none",
|
|
172
|
-
"select-none rounded-
|
|
172
|
+
"select-none rounded-lg text-sm",
|
|
173
173
|
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
|
|
174
174
|
error ? "border border-red-500 dark:border-red-600" : "",
|
|
175
175
|
disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white",
|
package/src/components/Sheet.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react";
|
|
|
3
3
|
import { cls } from "../util";
|
|
4
4
|
import { defaultBorderMixin } from "../styles";
|
|
5
5
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
6
|
-
import { usePortalContainer } from "../hooks/PortalContainerContext";
|
|
6
|
+
import { usePortalContainer, PortalContainerProvider } from "../hooks/PortalContainerContext";
|
|
7
7
|
|
|
8
8
|
interface SheetProps {
|
|
9
9
|
children: React.ReactNode;
|
|
@@ -45,6 +45,7 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
45
45
|
...props
|
|
46
46
|
}) => {
|
|
47
47
|
const [displayed, setDisplayed] = useState(false);
|
|
48
|
+
const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null);
|
|
48
49
|
|
|
49
50
|
// Get the portal container from context
|
|
50
51
|
const contextContainer = usePortalContainer();
|
|
@@ -90,7 +91,8 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
90
91
|
/>}
|
|
91
92
|
<DialogPrimitive.Content
|
|
92
93
|
{...props}
|
|
93
|
-
|
|
94
|
+
ref={setContentEl}
|
|
95
|
+
onOpenAutoFocus={(event) => event.preventDefault()}
|
|
94
96
|
onPointerDownOutside={onPointerDownOutside}
|
|
95
97
|
onInteractOutside={onInteractOutside}
|
|
96
98
|
className={cls(
|
|
@@ -112,10 +114,12 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
112
114
|
)}
|
|
113
115
|
style={style}
|
|
114
116
|
>
|
|
115
|
-
<DialogPrimitive.Title
|
|
117
|
+
<DialogPrimitive.Title className="sr-only outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 focus:ring-0">
|
|
116
118
|
{title ?? "Sheet"}
|
|
117
119
|
</DialogPrimitive.Title>
|
|
118
|
-
{
|
|
120
|
+
<PortalContainerProvider container={contentEl}>
|
|
121
|
+
{children}
|
|
122
|
+
</PortalContainerProvider>
|
|
119
123
|
</DialogPrimitive.Content>
|
|
120
124
|
</DialogPrimitive.Portal>
|
|
121
125
|
</DialogPrimitive.Root>
|
package/src/components/Table.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export const Table = React.memo(({
|
|
|
19
19
|
...rest
|
|
20
20
|
}: TableProps) => (
|
|
21
21
|
<table
|
|
22
|
-
className={cls("text-left text-surface-900 dark:text-white rounded-
|
|
22
|
+
className={cls("text-left text-surface-900 dark:text-white rounded-lg overflow-x-auto", className)}
|
|
23
23
|
style={style}
|
|
24
24
|
{...rest}
|
|
25
25
|
>
|
|
@@ -88,7 +88,7 @@ export const TableRow = React.memo(({
|
|
|
88
88
|
style={style}
|
|
89
89
|
className={cls(
|
|
90
90
|
"bg-white dark:bg-surface-900",
|
|
91
|
-
onClick ? "hover:bg-
|
|
91
|
+
onClick ? "hover:bg-primary/5 dark:hover:bg-primary/5 cursor-pointer" : "",
|
|
92
92
|
className
|
|
93
93
|
)}
|
|
94
94
|
{...rest}
|
|
@@ -131,7 +131,7 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
|
|
|
131
131
|
style={inputStyle}
|
|
132
132
|
className={cls(
|
|
133
133
|
invisible ? focusedInvisibleMixin : "",
|
|
134
|
-
"rounded-
|
|
134
|
+
"rounded-lg resize-none w-full outline-none text-base bg-transparent min-h-[64px] px-3",
|
|
135
135
|
label ? "pt-8 pb-2" : "py-2",
|
|
136
136
|
disabled && "outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500",
|
|
137
137
|
inputClassName
|
|
@@ -149,7 +149,7 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
|
|
|
149
149
|
style={inputStyle}
|
|
150
150
|
className={cls(
|
|
151
151
|
"w-full outline-none bg-transparent leading-normal px-3",
|
|
152
|
-
"rounded-
|
|
152
|
+
"rounded-lg",
|
|
153
153
|
"focused:text-text-primary focused:dark:text-text-primary-dark",
|
|
154
154
|
invisible ? focusedInvisibleMixin : "",
|
|
155
155
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
@@ -187,7 +187,7 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
|
|
|
187
187
|
<div
|
|
188
188
|
ref={ref}
|
|
189
189
|
className={cls(
|
|
190
|
-
"rounded-
|
|
190
|
+
"rounded-lg relative max-w-full",
|
|
191
191
|
invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
|
|
192
192
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
193
193
|
error ? "border border-red-500 dark:border-red-600" : "",
|
|
@@ -31,7 +31,7 @@ export const VirtualTableRow = React.memo<VirtualTableRowProps<Record<string, un
|
|
|
31
31
|
"flex min-w-full text-sm border-b border-surface-200/60 dark:border-surface-700/60 dark:bg-surface-800",
|
|
32
32
|
rowClassName ? rowClassName(rowData) : "",
|
|
33
33
|
{
|
|
34
|
-
"hover:!bg-
|
|
34
|
+
"hover:!bg-primary/[0.03] dark:hover:!bg-primary/5": hoverRow,
|
|
35
35
|
"cursor-pointer ": onRowClick
|
|
36
36
|
}
|
|
37
37
|
)}
|
package/src/icons/index.ts
CHANGED
|
@@ -74,7 +74,9 @@ export {
|
|
|
74
74
|
LanguagesIcon,
|
|
75
75
|
LayoutGridIcon,
|
|
76
76
|
LinkIcon,
|
|
77
|
+
Link2Icon,
|
|
77
78
|
ListIcon,
|
|
79
|
+
LockIcon,
|
|
78
80
|
ListOrderedIcon,
|
|
79
81
|
LoaderIcon,
|
|
80
82
|
LogOutIcon,
|
|
@@ -121,6 +123,7 @@ export {
|
|
|
121
123
|
UploadIcon,
|
|
122
124
|
UserCheckIcon,
|
|
123
125
|
UserIcon,
|
|
126
|
+
UserPlus,
|
|
124
127
|
VideoIcon,
|
|
125
128
|
VoteIcon,
|
|
126
129
|
Wand2Icon,
|
package/src/index.css
CHANGED
|
@@ -65,51 +65,51 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.typography-h1 {
|
|
68
|
-
@apply text-
|
|
68
|
+
@apply text-4xl font-headers font-semibold tracking-tight;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.typography-h2 {
|
|
72
|
-
@apply text-
|
|
72
|
+
@apply text-3xl font-headers font-semibold tracking-tight;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.typography-h3 {
|
|
76
|
-
@apply text-
|
|
76
|
+
@apply text-2xl font-headers font-semibold tracking-tight;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.typography-h4 {
|
|
80
|
-
@apply text-
|
|
80
|
+
@apply text-xl font-headers font-semibold tracking-[-0.01em];
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.typography-h5 {
|
|
84
|
-
@apply text-
|
|
84
|
+
@apply text-lg font-headers font-semibold tracking-[-0.01em];
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.typography-h6 {
|
|
88
|
-
@apply text-
|
|
88
|
+
@apply text-base font-headers font-semibold tracking-[-0.01em];
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.typography-subtitle1 {
|
|
92
|
-
@apply text-
|
|
92
|
+
@apply text-sm font-headers font-semibold tracking-[-0.01em];
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.typography-subtitle2 {
|
|
96
|
-
@apply text-
|
|
96
|
+
@apply text-sm font-headers font-medium;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.typography-body1 {
|
|
100
|
-
@apply text-
|
|
100
|
+
@apply text-sm;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.typography-body2 {
|
|
104
|
-
@apply text-
|
|
104
|
+
@apply text-xs;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.typography-caption {
|
|
108
|
-
@apply text-
|
|
108
|
+
@apply text-[11px] leading-[1.4];
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.typography-label {
|
|
112
|
-
@apply text-
|
|
112
|
+
@apply text-xs font-medium tracking-wide;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.typography-inherit {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.typography-button {
|
|
120
|
-
@apply text-sm font-semibold;
|
|
120
|
+
@apply text-sm font-semibold tracking-wide;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
:focus-visible {
|