@rebasepro/ui 0.6.0 → 0.6.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.
- package/dist/index.css +13 -13
- package/dist/index.es.js +68 -65
- package/dist/index.es.js.map +1 -1
- package/dist/src/index.css +13 -13
- package/dist/styles.d.ts +9 -9
- 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/Table.tsx +2 -2
- package/src/components/TextField.tsx +3 -3
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/index.css +13 -13
- package/src/styles.ts +9 -9
- package/dist/index.umd.js +0 -6958
- package/dist/index.umd.js.map +0 -1
package/dist/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 {
|
package/dist/styles.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
2
2
|
export declare const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-900 focus:dark:bg-opacity-60 focus:bg-surface-accent-100/70 dark:focus:bg-surface-900/60";
|
|
3
|
-
export declare const focusedClasses = "z-30 outline-hidden outline-none ring-2 ring-primary ring-opacity-
|
|
4
|
-
export declare const fieldBackgroundMixin = "bg-
|
|
5
|
-
export declare const fieldBackgroundInvisibleMixin = "bg-
|
|
6
|
-
export declare const fieldBackgroundDisabledMixin = "
|
|
7
|
-
export declare const fieldBackgroundHoverMixin = "hover:bg-
|
|
8
|
-
export declare const defaultBorderMixin = "border-surface-200
|
|
9
|
-
export declare const paperMixin = "bg-white rounded-
|
|
10
|
-
export declare const cardMixin = "bg-white dark:bg-surface-900 rounded-
|
|
11
|
-
export declare const cardClickableMixin = "hover:bg-
|
|
3
|
+
export declare const focusedClasses = "z-30 outline-hidden outline-none ring-2 ring-primary ring-opacity-50 ring-primary/50 ring-offset-0 ring-offset-transparent ";
|
|
4
|
+
export declare const fieldBackgroundMixin = "bg-surface-accent-200/50 dark:bg-black/30";
|
|
5
|
+
export declare const fieldBackgroundInvisibleMixin = "bg-surface-accent-200/0 dark:bg-black/0";
|
|
6
|
+
export declare const fieldBackgroundDisabledMixin = "bg-surface-accent-200/50 dark:bg-black/20";
|
|
7
|
+
export declare const fieldBackgroundHoverMixin = "hover:bg-surface-accent-200/70 hover:dark:bg-black/50";
|
|
8
|
+
export declare const defaultBorderMixin = "border-surface-200 dark:border-surface-700 ";
|
|
9
|
+
export declare const paperMixin = "bg-white rounded-lg dark:bg-surface-900 border border-surface-200 dark:border-surface-700";
|
|
10
|
+
export declare const cardMixin = "bg-white dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700";
|
|
11
|
+
export declare const cardClickableMixin = "hover:bg-primary/5 dark:hover:bg-primary/5 cursor-pointer transition-colors duration-150";
|
|
12
12
|
export declare const cardSelectedMixin = "bg-primary-bg/30 dark:bg-primary-bg/10 ring-1 ring-primary/75";
|
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/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/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 {
|
package/src/styles.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
2
2
|
export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-900 focus:dark:bg-opacity-60 focus:bg-surface-accent-100/70 dark:focus:bg-surface-900/60";
|
|
3
|
-
export const focusedClasses = "z-30 outline-hidden outline-none ring-2 ring-primary ring-opacity-
|
|
4
|
-
export const fieldBackgroundMixin = "bg-
|
|
5
|
-
export const fieldBackgroundInvisibleMixin = "bg-
|
|
6
|
-
export const fieldBackgroundDisabledMixin = "
|
|
7
|
-
export const fieldBackgroundHoverMixin = "hover:bg-
|
|
8
|
-
export const defaultBorderMixin = "border-surface-200
|
|
9
|
-
export const paperMixin = "bg-white rounded-
|
|
10
|
-
export const cardMixin = "bg-white dark:bg-surface-900 rounded-
|
|
11
|
-
export const cardClickableMixin = "hover:bg-
|
|
3
|
+
export const focusedClasses = "z-30 outline-hidden outline-none ring-2 ring-primary ring-opacity-50 ring-primary/50 ring-offset-0 ring-offset-transparent ";
|
|
4
|
+
export const fieldBackgroundMixin = "bg-surface-accent-200/50 dark:bg-black/30";
|
|
5
|
+
export const fieldBackgroundInvisibleMixin = "bg-surface-accent-200/0 dark:bg-black/0";
|
|
6
|
+
export const fieldBackgroundDisabledMixin = "bg-surface-accent-200/50 dark:bg-black/20";
|
|
7
|
+
export const fieldBackgroundHoverMixin = "hover:bg-surface-accent-200/70 hover:dark:bg-black/50";
|
|
8
|
+
export const defaultBorderMixin = "border-surface-200 dark:border-surface-700 ";
|
|
9
|
+
export const paperMixin = "bg-white rounded-lg dark:bg-surface-900 border border-surface-200 dark:border-surface-700";
|
|
10
|
+
export const cardMixin = "bg-white dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700";
|
|
11
|
+
export const cardClickableMixin = "hover:bg-primary/5 dark:hover:bg-primary/5 cursor-pointer transition-colors duration-150";
|
|
12
12
|
export const cardSelectedMixin = "bg-primary-bg/30 dark:bg-primary-bg/10 ring-1 ring-primary/75";
|