@rebasepro/ui 0.10.0 → 0.10.1-canary.0a881d4
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.es.js +4567 -4494
- package/dist/index.es.js.map +1 -1
- package/dist/styles.d.ts +5 -5
- package/dist/views/CollectionView/resolveTitleProperty.d.ts +11 -0
- package/package.json +1 -1
- package/src/components/Alert.tsx +57 -14
- package/src/components/Autocomplete.tsx +1 -1
- package/src/components/Avatar.tsx +2 -2
- package/src/components/BooleanSwitch.tsx +1 -1
- package/src/components/Checkbox.tsx +5 -4
- package/src/components/ColorPicker.tsx +3 -3
- package/src/components/Container.tsx +1 -1
- package/src/components/Dialog.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +3 -3
- package/src/components/ExpandablePanel.tsx +1 -1
- package/src/components/IconButton.tsx +2 -2
- package/src/components/InfoLabel.tsx +3 -3
- package/src/components/Menu.tsx +1 -1
- package/src/components/Menubar.tsx +6 -6
- package/src/components/MultiSelect.tsx +5 -5
- package/src/components/Popover.tsx +1 -1
- package/src/components/RadioGroup.tsx +2 -2
- package/src/components/Slider.tsx +1 -1
- package/src/components/Table.tsx +2 -2
- package/src/components/Tabs.tsx +6 -6
- package/src/components/ToggleButtonGroup.tsx +3 -3
- package/src/components/Tooltip.tsx +1 -1
- package/src/components/common/SelectInputLabel.tsx +2 -2
- package/src/icons/index.ts +17 -0
- package/src/styles.ts +5 -5
- package/src/views/CollectionView/CollectionCardView.tsx +5 -10
- package/src/views/CollectionView/CollectionKanbanView.tsx +5 -10
- package/src/views/CollectionView/CollectionListView.tsx +5 -10
- package/src/views/CollectionView/resolveTitleProperty.ts +52 -0
- package/src/views/ListView.tsx +1 -1
package/dist/styles.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
2
|
-
export declare const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-
|
|
2
|
+
export declare const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-white/[0.07] focus:bg-surface-accent-100/70";
|
|
3
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-
|
|
5
|
-
export declare const fieldBackgroundInvisibleMixin = "bg-surface-accent-200/0 dark:bg-
|
|
6
|
-
export declare const fieldBackgroundDisabledMixin = "bg-surface-accent-200/50 dark:bg-
|
|
7
|
-
export declare const fieldBackgroundHoverMixin = "hover:bg-surface-accent-200/70 hover:dark:bg-
|
|
4
|
+
export declare const fieldBackgroundMixin = "bg-surface-accent-200/50 dark:bg-white/[0.055]";
|
|
5
|
+
export declare const fieldBackgroundInvisibleMixin = "bg-surface-accent-200/0 dark:bg-white/0";
|
|
6
|
+
export declare const fieldBackgroundDisabledMixin = "bg-surface-accent-200/50 dark:bg-white/[0.03]";
|
|
7
|
+
export declare const fieldBackgroundHoverMixin = "hover:bg-surface-accent-200/70 hover:dark:bg-white/[0.09]";
|
|
8
8
|
export declare const defaultBorderMixin = "border-surface-200 dark:border-surface-700/60 ";
|
|
9
9
|
export declare const paperMixin = "bg-white rounded-lg dark:bg-surface-900 border border-surface-200 dark:border-surface-700";
|
|
10
10
|
export declare const cardMixin = "bg-white dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CollectionPropertyConfig } from "./CollectionViewTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Pick the property that acts as a row's title.
|
|
4
|
+
*
|
|
5
|
+
* Headless mirror of the ranking in `@rebasepro/common`: identifiers are kept
|
|
6
|
+
* out of the title slot structurally (the id property, images, hidden fields),
|
|
7
|
+
* and among what is left a plain text field beats a description, an enum or a
|
|
8
|
+
* relation. Falls back to the id property only when a collection has nothing
|
|
9
|
+
* else to show.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveTitlePropertyKey(order: string[], properties: Record<string, CollectionPropertyConfig>, idProperty: string, titleProperty?: string): string;
|
package/package.json
CHANGED
package/src/components/Alert.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cls } from "../util";
|
|
3
|
+
import { AlertCircleIcon, AlertTriangleIcon, CheckCircleIcon, InfoIcon, XIcon } from "../icons";
|
|
3
4
|
|
|
4
5
|
export interface AlertProps {
|
|
5
6
|
children: React.ReactNode;
|
|
@@ -15,27 +16,61 @@ export interface AlertProps {
|
|
|
15
16
|
const getSizeClasses = (size: "small" | "medium" | "large") => {
|
|
16
17
|
switch (size) {
|
|
17
18
|
case "small":
|
|
18
|
-
return "px-
|
|
19
|
+
return "px-3 py-1.5 text-xs gap-2 rounded-md";
|
|
19
20
|
case "large":
|
|
20
|
-
return "px-4 py-
|
|
21
|
+
return "px-4 py-3.5 text-sm gap-3 rounded-lg";
|
|
21
22
|
case "medium":
|
|
22
23
|
default:
|
|
23
|
-
return "px-
|
|
24
|
+
return "px-3.5 py-2.5 text-sm gap-2.5 rounded-lg";
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
const getIconSize = (size: "small" | "medium" | "large") => size === "small" ? 16 : 18;
|
|
29
|
+
|
|
26
30
|
const getColorClasses = (severity: string) => {
|
|
27
31
|
switch (severity) {
|
|
28
32
|
case "error":
|
|
29
|
-
return "bg-red-
|
|
33
|
+
return "bg-red-500/8 dark:bg-red-500/12 text-red-800 dark:text-red-200 border border-red-500/20 dark:border-red-500/25";
|
|
34
|
+
case "warning":
|
|
35
|
+
return "bg-amber-500/8 dark:bg-amber-500/12 text-amber-800 dark:text-amber-200 border border-amber-500/20 dark:border-amber-500/25";
|
|
36
|
+
case "info":
|
|
37
|
+
return "bg-blue-500/8 dark:bg-blue-500/12 text-blue-800 dark:text-blue-200 border border-blue-500/20 dark:border-blue-500/25";
|
|
38
|
+
case "success":
|
|
39
|
+
return "bg-emerald-500/8 dark:bg-emerald-500/12 text-emerald-800 dark:text-emerald-200 border border-emerald-500/20 dark:border-emerald-500/25";
|
|
40
|
+
case "base":
|
|
41
|
+
default:
|
|
42
|
+
return "bg-surface-accent-500/8 dark:bg-surface-accent-400/10 text-surface-accent-800 dark:text-surface-accent-100 border border-surface-accent-500/15 dark:border-surface-accent-400/20";
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const getIconColor = (severity: string) => {
|
|
47
|
+
switch (severity) {
|
|
48
|
+
case "error":
|
|
49
|
+
return "text-red-500 dark:text-red-400";
|
|
30
50
|
case "warning":
|
|
31
|
-
return "
|
|
51
|
+
return "text-amber-500 dark:text-amber-400";
|
|
32
52
|
case "info":
|
|
33
|
-
return "
|
|
53
|
+
return "text-blue-500 dark:text-blue-400";
|
|
34
54
|
case "success":
|
|
35
|
-
return "
|
|
55
|
+
return "text-emerald-500 dark:text-emerald-400";
|
|
36
56
|
case "base":
|
|
37
57
|
default:
|
|
38
|
-
return "
|
|
58
|
+
return "text-surface-accent-500 dark:text-surface-accent-400";
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const getIcon = (severity: string, size: number, className: string) => {
|
|
63
|
+
switch (severity) {
|
|
64
|
+
case "error":
|
|
65
|
+
return <AlertCircleIcon size={size} className={className}/>;
|
|
66
|
+
case "warning":
|
|
67
|
+
return <AlertTriangleIcon size={size} className={className}/>;
|
|
68
|
+
case "success":
|
|
69
|
+
return <CheckCircleIcon size={size} className={className}/>;
|
|
70
|
+
case "info":
|
|
71
|
+
case "base":
|
|
72
|
+
default:
|
|
73
|
+
return <InfoIcon size={size} className={className}/>;
|
|
39
74
|
}
|
|
40
75
|
};
|
|
41
76
|
|
|
@@ -50,6 +85,7 @@ export const Alert: React.FC<AlertProps> = ({
|
|
|
50
85
|
style
|
|
51
86
|
}) => {
|
|
52
87
|
const classes = getColorClasses(color);
|
|
88
|
+
const iconSize = getIconSize(size);
|
|
53
89
|
|
|
54
90
|
return (
|
|
55
91
|
<div
|
|
@@ -57,19 +93,26 @@ export const Alert: React.FC<AlertProps> = ({
|
|
|
57
93
|
className={cls(
|
|
58
94
|
getSizeClasses(size),
|
|
59
95
|
"w-full",
|
|
60
|
-
"font-medium",
|
|
61
|
-
"
|
|
96
|
+
"font-medium leading-snug",
|
|
97
|
+
"flex items-start",
|
|
62
98
|
classes,
|
|
63
99
|
outerClassName)}>
|
|
64
|
-
<
|
|
100
|
+
<span className={cls("shrink-0 mt-px", getIconColor(color))}>
|
|
101
|
+
{getIcon(color, iconSize, "")}
|
|
102
|
+
</span>
|
|
103
|
+
<div className={cls("grow min-w-0 self-center", className)}>{children}</div>
|
|
104
|
+
{action}
|
|
65
105
|
{onDismiss && (
|
|
66
106
|
<button
|
|
67
|
-
|
|
107
|
+
type="button"
|
|
108
|
+
aria-label="Dismiss"
|
|
109
|
+
className={cls(
|
|
110
|
+
"shrink-0 rounded p-0.5 opacity-60 transition-opacity hover:opacity-100",
|
|
111
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-current/40")}
|
|
68
112
|
onClick={onDismiss}>
|
|
69
|
-
|
|
113
|
+
<XIcon size={iconSize - 2}/>
|
|
70
114
|
</button>
|
|
71
115
|
)}
|
|
72
|
-
{action}
|
|
73
116
|
</div>
|
|
74
117
|
);
|
|
75
118
|
};
|
|
@@ -85,7 +85,7 @@ export const AutocompleteItem = React.memo(function AutocompleteItem({
|
|
|
85
85
|
|
|
86
86
|
return (
|
|
87
87
|
<div
|
|
88
|
-
className={cls("flex w-full items-center h-[48px] cursor-pointer hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800", className)}
|
|
88
|
+
className={cls("flex w-full items-center h-[48px] cursor-pointer transition-colors duration-150 hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800", className)}
|
|
89
89
|
onClick={onClick}>
|
|
90
90
|
{children}
|
|
91
91
|
</div>
|
|
@@ -39,7 +39,7 @@ const AvatarInner: React.ForwardRefRenderFunction<HTMLButtonElement, AvatarProps
|
|
|
39
39
|
className={cls(
|
|
40
40
|
"rounded-full flex items-center justify-center overflow-hidden",
|
|
41
41
|
"p-1 w-12 h-12 min-w-12 min-h-12",
|
|
42
|
-
hover && "hover:bg-surface-accent-200 dark:hover:bg-surface-accent-700",
|
|
42
|
+
hover && "transition-colors duration-150 hover:bg-surface-accent-200 dark:hover:bg-surface-accent-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
43
43
|
outerClassName
|
|
44
44
|
)}
|
|
45
45
|
>
|
|
@@ -59,7 +59,7 @@ const AvatarInner: React.ForwardRefRenderFunction<HTMLButtonElement, AvatarProps
|
|
|
59
59
|
className={cls(
|
|
60
60
|
"bg-surface-accent-100 dark:bg-surface-accent-800",
|
|
61
61
|
"flex items-center justify-center",
|
|
62
|
-
"w-full h-full py-1.5 text-lg font-medium text-surface-accent-900 dark:text-
|
|
62
|
+
"w-full h-full py-1.5 text-lg font-medium text-surface-accent-900 dark:text-text-primary-dark rounded-full",
|
|
63
63
|
className
|
|
64
64
|
)}
|
|
65
65
|
>
|
|
@@ -73,7 +73,7 @@ export const BooleanSwitch = React.forwardRef(function BooleanSwitch({
|
|
|
73
73
|
key={"knob"}
|
|
74
74
|
className={cls(
|
|
75
75
|
"block rounded-full transition-transform duration-100 ease-out transform will-change-auto shadow-sm",
|
|
76
|
-
disabled ? "bg-surface-accent-300 dark:bg-surface-700" : (value ? "bg-white shadow" : "bg-surface-accent-600 dark:bg-surface-accent-400"),
|
|
76
|
+
disabled ? "bg-surface-accent-300 dark:bg-surface-accent-700" : (value ? "bg-white shadow" : "bg-surface-accent-600 dark:bg-surface-accent-400"),
|
|
77
77
|
{
|
|
78
78
|
"w-[21px] h-[21px]": size === "medium" || size === "large",
|
|
79
79
|
"w-[19px] h-[19px]": size === "small",
|
|
@@ -18,10 +18,10 @@ export interface CheckboxProps {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const sizeClasses = {
|
|
21
|
-
large: "w-6 h-6 rounded flex items-center justify-center",
|
|
22
|
-
medium: "w-5 h-5 rounded flex items-center justify-center",
|
|
23
|
-
small: "w-4 h-4 rounded flex items-center justify-center",
|
|
24
|
-
smallest: "w-4 h-4 rounded flex items-center justify-center"
|
|
21
|
+
large: "w-6 h-6 rounded-md flex items-center justify-center",
|
|
22
|
+
medium: "w-5 h-5 rounded-md flex items-center justify-center",
|
|
23
|
+
small: "w-4 h-4 rounded-md flex items-center justify-center",
|
|
24
|
+
smallest: "w-4 h-4 rounded-md flex items-center justify-center"
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const outerSizeClasses = {
|
|
@@ -70,6 +70,7 @@ export const Checkbox = React.memo(({
|
|
|
70
70
|
disabled={disabled}
|
|
71
71
|
aria-label={ariaLabel}
|
|
72
72
|
aria-checked={indeterminate ? "mixed" : isChecked}
|
|
73
|
+
className="rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
|
|
73
74
|
onCheckedChange={disabled ? undefined : onCheckedChange}>
|
|
74
75
|
|
|
75
76
|
<div className={cls(
|
|
@@ -61,8 +61,8 @@ export function ColorPicker({
|
|
|
61
61
|
disabled={disabled}
|
|
62
62
|
onClick={() => onChange(undefined)}
|
|
63
63
|
className={cls(
|
|
64
|
-
"flex items-center gap-2 px-2 py-1 rounded text-sm transition-colors",
|
|
65
|
-
"hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800",
|
|
64
|
+
"flex items-center gap-2 px-2 py-1 rounded-lg text-sm transition-colors duration-150",
|
|
65
|
+
"hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
66
66
|
disabled && "opacity-50 cursor-not-allowed",
|
|
67
67
|
!value && "bg-surface-accent-100 dark:bg-surface-accent-800 font-medium"
|
|
68
68
|
)}
|
|
@@ -101,7 +101,7 @@ export function ColorPicker({
|
|
|
101
101
|
swatchSize,
|
|
102
102
|
"rounded-full transition-all flex items-center justify-center",
|
|
103
103
|
"hover:scale-110 hover:shadow-md",
|
|
104
|
-
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1",
|
|
104
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",
|
|
105
105
|
disabled && "opacity-50 cursor-not-allowed hover:scale-100",
|
|
106
106
|
isSelected && "ring-2 ring-primary ring-offset-1"
|
|
107
107
|
)}
|
|
@@ -38,7 +38,7 @@ const ContainerInner: ForwardRefRenderFunction<HTMLDivElement, ContainerProps> =
|
|
|
38
38
|
return (
|
|
39
39
|
<div
|
|
40
40
|
ref={ref}
|
|
41
|
-
className={cls("mx-auto px-3 md:px-4 lg
|
|
41
|
+
className={cls("mx-auto px-3 md:px-4 lg:px-6",
|
|
42
42
|
classForMaxWidth,
|
|
43
43
|
className)}
|
|
44
44
|
style={style}>
|
|
@@ -125,7 +125,7 @@ export const Dialog = ({
|
|
|
125
125
|
"outline-none focus:outline-none",
|
|
126
126
|
fullWidth && !fullScreen ? "w-11/12" : undefined,
|
|
127
127
|
fullHeight && !fullScreen ? "h-full" : undefined,
|
|
128
|
-
"text-
|
|
128
|
+
"text-text-primary dark:text-text-primary-dark",
|
|
129
129
|
"justify-center items-center",
|
|
130
130
|
fullScreen ? "h-screen w-screen" : "max-h-[90vh] shadow-lg",
|
|
131
131
|
"ease-in-out duration-200",
|
|
@@ -89,7 +89,7 @@ showDetails: false });
|
|
|
89
89
|
return (
|
|
90
90
|
<div className="flex flex-col m-2">
|
|
91
91
|
<div className="flex items-center m-2">
|
|
92
|
-
<AlertCircleIcon className={"text-red-500"} size={iconSize.small}/>
|
|
92
|
+
<AlertCircleIcon className={"text-red-500 dark:text-red-400"} size={iconSize.small}/>
|
|
93
93
|
<div className="ml-4">Error</div>
|
|
94
94
|
</div>
|
|
95
95
|
<Typography variant={"caption"}>
|
|
@@ -118,7 +118,7 @@ showDetails: false });
|
|
|
118
118
|
)}>
|
|
119
119
|
<div className="flex flex-col items-center max-w-md px-6 py-10 text-center">
|
|
120
120
|
<div className={cls(
|
|
121
|
-
"flex items-center justify-center w-14 h-14 rounded-
|
|
121
|
+
"flex items-center justify-center w-14 h-14 rounded-xl mb-6",
|
|
122
122
|
isPermission
|
|
123
123
|
? "bg-amber-100 dark:bg-amber-900/30"
|
|
124
124
|
: "bg-red-100 dark:bg-red-900/30"
|
|
@@ -181,7 +181,7 @@ showDetails: false });
|
|
|
181
181
|
{showDetails && (
|
|
182
182
|
<div className={cls(
|
|
183
183
|
"mt-3 p-3 rounded-lg text-left text-xs",
|
|
184
|
-
"bg-surface-100 dark:bg-surface-800",
|
|
184
|
+
"bg-surface-100 dark:bg-surface-800/50",
|
|
185
185
|
"text-text-secondary dark:text-text-secondary-dark",
|
|
186
186
|
"font-mono break-all"
|
|
187
187
|
)}>
|
|
@@ -95,7 +95,7 @@ export function ExpandablePanel({
|
|
|
95
95
|
<Collapsible.Trigger asChild>
|
|
96
96
|
<div
|
|
97
97
|
className={cls(
|
|
98
|
-
"rounded-t flex items-center justify-between w-full min-h-[52px]",
|
|
98
|
+
"rounded-t-lg flex items-center justify-between w-full min-h-[52px]",
|
|
99
99
|
"hover:bg-surface-accent-200 hover:bg-opacity-40 hover:bg-surface-accent-200/40 dark:hover:bg-surface-800 dark:hover:bg-opacity-40 dark:hover:bg-surface-800/40 active:bg-surface-accent-300/50 dark:active:bg-surface-700/50",
|
|
100
100
|
invisible ? "border-b px-2" : "p-4",
|
|
101
101
|
open ? "py-6" : "py-4",
|
|
@@ -16,8 +16,8 @@ export type IconButtonProps<C extends React.ElementType> =
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const buttonClasses = "hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800 hover:scale-[1.04] active:scale-95 transition-transform";
|
|
19
|
-
const baseClasses = "inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150";
|
|
20
|
-
const colorClasses = "text-surface-accent-500 visited:text-surface-accent-500 dark:text-surface-accent-300 dark:visited:text-surface-300";
|
|
19
|
+
const baseClasses = "inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 transition-colors ease-in-out duration-150";
|
|
20
|
+
const colorClasses = "text-surface-accent-500 visited:text-surface-accent-500 dark:text-surface-accent-300 dark:visited:text-surface-accent-300";
|
|
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",
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { cls } from "../util";
|
|
3
3
|
|
|
4
4
|
const colorClasses = {
|
|
5
|
-
info: "bg-
|
|
6
|
-
warn: "bg-
|
|
5
|
+
info: "bg-blue-500/8 dark:bg-blue-500/12 text-blue-800 dark:text-blue-200 border border-blue-500/20 dark:border-blue-500/25",
|
|
6
|
+
warn: "bg-amber-500/8 dark:bg-amber-500/12 text-amber-800 dark:text-amber-200 border border-amber-500/20 dark:border-amber-500/25"
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function InfoLabel({
|
|
@@ -16,7 +16,7 @@ export function InfoLabel({
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<div
|
|
19
|
-
className={cls("my-3 py-2 px-4 rounded-
|
|
19
|
+
className={cls("my-3 py-2 px-4 rounded-lg text-sm font-medium leading-snug", colorClasses[mode])}>
|
|
20
20
|
{children}
|
|
21
21
|
</div>
|
|
22
22
|
)
|
package/src/components/Menu.tsx
CHANGED
|
@@ -87,7 +87,7 @@ export const MenuItem = React.memo(({
|
|
|
87
87
|
const classNames = cls(
|
|
88
88
|
onClick && !disabled && "cursor-pointer",
|
|
89
89
|
disabled && "opacity-50 cursor-not-allowed",
|
|
90
|
-
"rounded-md text-sm font-medium text-surface-accent-700 dark:text-surface-accent-300 flex items-center gap-4",
|
|
90
|
+
"rounded-md text-sm font-medium text-surface-accent-700 dark:text-surface-accent-300 flex items-center gap-4 transition-colors duration-150",
|
|
91
91
|
!disabled && "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-900",
|
|
92
92
|
dense ? "px-4 py-1.5" : "px-4 py-2",
|
|
93
93
|
className
|
|
@@ -19,7 +19,7 @@ export function Menubar({
|
|
|
19
19
|
return (
|
|
20
20
|
<MenubarPrimitive.Root
|
|
21
21
|
onSelect={onSelect}
|
|
22
|
-
className={cls("z-10 flex bg-white dark:bg-surface-900 p-[3px] rounded-
|
|
22
|
+
className={cls("z-10 flex bg-white dark:bg-surface-900 p-[3px] rounded-lg shadow-sm", className)}>
|
|
23
23
|
{children}
|
|
24
24
|
</MenubarPrimitive.Root>
|
|
25
25
|
)
|
|
@@ -47,7 +47,7 @@ export function MenubarTrigger({
|
|
|
47
47
|
return (
|
|
48
48
|
<MenubarPrimitive.Trigger
|
|
49
49
|
onSelect={onSelect}
|
|
50
|
-
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-
|
|
50
|
+
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded-md text-text-primary dark:text-text-primary-dark text-sm transition-colors duration-150 flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-900 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-900 hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800",
|
|
51
51
|
className)}>
|
|
52
52
|
{children}
|
|
53
53
|
</MenubarPrimitive.Trigger>
|
|
@@ -121,7 +121,7 @@ export function MenubarItem({
|
|
|
121
121
|
return (
|
|
122
122
|
<MenubarPrimitive.Item
|
|
123
123
|
onSelect={onSelect}
|
|
124
|
-
className={cls("group text-
|
|
124
|
+
className={cls("group text-sm leading-none rounded-md flex items-center h-[32px] px-[10px] py-[2px] relative select-none transition-colors duration-150 outline-none data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-900 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-900 data-[disabled]:text-text-disabled data-[disabled]:dark:text-text-disabled-dark data-[disabled]:pointer-events-none",
|
|
125
125
|
leftPadding ? "pl-5" : "",
|
|
126
126
|
disabled ? "pointer-events-none text-text-secondary dark:text-text-secondary-dark" : "text-text-primary dark:text-text-primary-dark",
|
|
127
127
|
className)}
|
|
@@ -179,7 +179,7 @@ export function MenubarSubTrigger({
|
|
|
179
179
|
return (
|
|
180
180
|
<MenubarPrimitive.SubTrigger
|
|
181
181
|
onSelect={onSelect}
|
|
182
|
-
className={cls("group text-
|
|
182
|
+
className={cls("group text-sm leading-none text-text-primary dark:text-text-primary-dark rounded-md flex items-center h-[32px] px-[10px] py-[2px] relative select-none transition-colors duration-150 outline-none data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-900 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-900 data-[disabled]:text-text-disabled data-[disabled]:dark:text-text-disabled-dark data-[disabled]:pointer-events-none",
|
|
183
183
|
className)}
|
|
184
184
|
{...rest}
|
|
185
185
|
>
|
|
@@ -230,7 +230,7 @@ export function MenubarCheckboxItem({
|
|
|
230
230
|
return (
|
|
231
231
|
<MenubarPrimitive.CheckboxItem
|
|
232
232
|
onSelect={onSelect}
|
|
233
|
-
className={cls("text-
|
|
233
|
+
className={cls("text-sm leading-none text-text-primary dark:text-text-primary-dark rounded-md flex items-center h-[32px] px-[10px] py-[2px] relative select-none transition-colors duration-150 pl-5 outline-none data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-900 data-[disabled]:text-text-disabled data-[disabled]:dark:text-text-disabled-dark data-[disabled]:pointer-events-none",
|
|
234
234
|
className)}
|
|
235
235
|
checked={checked}
|
|
236
236
|
onCheckedChange={onCheckedChange}
|
|
@@ -299,7 +299,7 @@ export function MenubarRadioItem({
|
|
|
299
299
|
return (
|
|
300
300
|
<MenubarPrimitive.RadioItem
|
|
301
301
|
onSelect={onSelect}
|
|
302
|
-
className={cls("text-
|
|
302
|
+
className={cls("text-sm leading-none text-text-primary dark:text-text-primary-dark rounded-md flex items-center h-[32px] px-[10px] py-[2px] relative select-none transition-colors duration-150 pl-5 outline-none data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-900 data-[disabled]:text-text-disabled data-[disabled]:dark:text-text-disabled-dark data-[disabled]:pointer-events-none",
|
|
303
303
|
className)}
|
|
304
304
|
value={value}
|
|
305
305
|
{...rest}>
|
|
@@ -337,9 +337,9 @@ export const MultiSelect = React.forwardRef<
|
|
|
337
337
|
"cursor-pointer",
|
|
338
338
|
"m-1",
|
|
339
339
|
"ring-offset-transparent",
|
|
340
|
-
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-primary/75 aria-[selected=true]:ring-offset-2",
|
|
340
|
+
"p-1 rounded-md aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-primary/75 aria-[selected=true]:ring-offset-2",
|
|
341
341
|
"aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
342
|
-
"cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900"
|
|
342
|
+
"cursor-pointer p-2 rounded-md aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900"
|
|
343
343
|
)
|
|
344
344
|
}
|
|
345
345
|
>
|
|
@@ -394,9 +394,9 @@ export const MultiSelectItem = React.memo(function MultiSelectItem<T extends Mul
|
|
|
394
394
|
"cursor-pointer",
|
|
395
395
|
"m-1",
|
|
396
396
|
"ring-offset-transparent",
|
|
397
|
-
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-primary/75 aria-[selected=true]:ring-offset-2",
|
|
397
|
+
"p-1 rounded-md aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-primary/75 aria-[selected=true]:ring-offset-2",
|
|
398
398
|
"aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
399
|
-
"cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
399
|
+
"cursor-pointer p-2 rounded-md aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
400
400
|
"text-surface-accent-700 dark:text-surface-accent-300",
|
|
401
401
|
className
|
|
402
402
|
)}
|
|
@@ -415,7 +415,7 @@ const InnerCheckBox = React.memo(function InnerCheckBox({ checked }: { checked:
|
|
|
415
415
|
<div
|
|
416
416
|
className={cls(
|
|
417
417
|
"border-2 relative transition-colors ease-in-out duration-150",
|
|
418
|
-
"w-4 h-4 rounded flex items-center justify-center",
|
|
418
|
+
"w-4 h-4 rounded-sm flex items-center justify-center",
|
|
419
419
|
(checked ? "bg-primary" : "bg-white dark:bg-surface-accent-900"),
|
|
420
420
|
(checked) ? "text-surface-accent-100 dark:text-surface-accent-900" : "",
|
|
421
421
|
(checked ? "border-transparent" : "border-surface-accent-800 dark:border-surface-accent-200")
|
|
@@ -87,7 +87,7 @@ export function Popover({
|
|
|
87
87
|
onMouseLeave={onMouseLeave}>
|
|
88
88
|
|
|
89
89
|
{children}
|
|
90
|
-
<PopoverPrimitive.Arrow className="fill-white dark:fill-surface-
|
|
90
|
+
<PopoverPrimitive.Arrow className="fill-white dark:fill-surface-900"/>
|
|
91
91
|
</PopoverPrimitive.Content>
|
|
92
92
|
</PopoverPrimitive.Portal>
|
|
93
93
|
</PopoverPrimitive.Root>;
|
|
@@ -58,13 +58,13 @@ const RadioGroupItem = React.forwardRef<
|
|
|
58
58
|
<RadioGroupPrimitive.Item
|
|
59
59
|
ref={ref}
|
|
60
60
|
className={cls(
|
|
61
|
-
"aspect-square h-4 w-4 rounded-full border border-primary text-primary
|
|
61
|
+
"aspect-square h-4 w-4 rounded-full border border-primary text-primary focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
62
62
|
className
|
|
63
63
|
)}
|
|
64
64
|
{...props}
|
|
65
65
|
>
|
|
66
66
|
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
67
|
-
<div className="h-2.5 w-2.5 fill-current text-current bg-primary rounded-
|
|
67
|
+
<div className="h-2.5 w-2.5 fill-current text-current bg-primary rounded-full"/>
|
|
68
68
|
</RadioGroupPrimitive.Indicator>
|
|
69
69
|
</RadioGroupPrimitive.Item>
|
|
70
70
|
)
|
|
@@ -48,7 +48,7 @@ function SliderThumb(props: {
|
|
|
48
48
|
className={cls(
|
|
49
49
|
"TooltipContent",
|
|
50
50
|
"max-w-lg leading-relaxed",
|
|
51
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100"
|
|
51
|
+
"z-50 rounded-md px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100"
|
|
52
52
|
)}>
|
|
53
53
|
{props.props.value?.[props.index]}
|
|
54
54
|
</TooltipPrimitive.Content>
|
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-
|
|
22
|
+
className={cls("text-left text-text-primary dark:text-text-primary-dark 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 ? "
|
|
91
|
+
onClick ? "transition-colors duration-150 hover:bg-primary/5 cursor-pointer" : "",
|
|
92
92
|
className
|
|
93
93
|
)}
|
|
94
94
|
{...rest}
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -92,7 +92,7 @@ export function Tabs({
|
|
|
92
92
|
className={cls(
|
|
93
93
|
"absolute left-0 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center rounded-md transition-all h-8 w-6",
|
|
94
94
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-surface-400",
|
|
95
|
-
!showLeftScroll ? "pointer-events-none opacity-0" : "text-surface-600 dark:text-surface-400 hover:bg-surface-200 dark:hover:bg-surface-800",
|
|
95
|
+
!showLeftScroll ? "pointer-events-none opacity-0" : "text-surface-600 dark:text-surface-400 hover:bg-surface-accent-200 dark:hover:bg-surface-accent-800",
|
|
96
96
|
"bg-surface-50 dark:bg-surface-900 border shadow-sm", defaultBorderMixin
|
|
97
97
|
)}
|
|
98
98
|
>
|
|
@@ -125,7 +125,7 @@ msOverflowStyle: "none" }}
|
|
|
125
125
|
className={cls(
|
|
126
126
|
"absolute right-0 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center rounded-md transition-all h-8 w-6",
|
|
127
127
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-surface-400",
|
|
128
|
-
!showRightScroll ? "pointer-events-none opacity-0" : "text-surface-600 dark:text-surface-400 hover:bg-surface-200 dark:hover:bg-surface-800",
|
|
128
|
+
!showRightScroll ? "pointer-events-none opacity-0" : "text-surface-600 dark:text-surface-400 hover:bg-surface-accent-200 dark:hover:bg-surface-accent-800",
|
|
129
129
|
"bg-surface-50 dark:bg-surface-900 border shadow-sm", defaultBorderMixin
|
|
130
130
|
)}
|
|
131
131
|
>
|
|
@@ -161,9 +161,9 @@ export function Tab({
|
|
|
161
161
|
"inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-white transition-all",
|
|
162
162
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-surface-400 focus-visible:ring-offset-2",
|
|
163
163
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
164
|
-
variant === "standard" && "rounded-
|
|
164
|
+
variant === "standard" && "rounded-md px-3 py-1 data-[state=active]:bg-white data-[state=active]:text-surface-900 data-[state=active]:shadow-sm dark:data-[state=active]:bg-surface-900 dark:data-[state=active]:text-surface-50",
|
|
165
165
|
variant === "boxy" && cls(
|
|
166
|
-
"flex-shrink-0 flex items-center gap-1.5 px-3.5 h-9 border-r border-surface-200 dark:border-surface-800 cursor-pointer text-
|
|
166
|
+
"flex-shrink-0 flex items-center gap-1.5 px-3.5 h-9 border-r border-surface-200 dark:border-surface-800 cursor-pointer text-xs font-medium transition-colors group relative box-border overflow-hidden",
|
|
167
167
|
"border-b-2 border-b-transparent",
|
|
168
168
|
"data-[state=active]:bg-surface-50 dark:data-[state=active]:bg-surface-900",
|
|
169
169
|
"data-[state=active]:text-text-primary dark:data-[state=active]:text-text-primary-dark",
|
|
@@ -171,8 +171,8 @@ export function Tab({
|
|
|
171
171
|
"text-text-secondary dark:text-text-secondary-dark hover:bg-surface-100 dark:hover:bg-surface-800"
|
|
172
172
|
),
|
|
173
173
|
variant === "pill" && cls(
|
|
174
|
-
"px-2 py-0.5 rounded text-[10px] font-medium transition-colors",
|
|
175
|
-
"data-[state=active]:bg-primary/10 data-[state=active]:text-primary dark:data-[state=active]:bg-primary/20 dark:data-[state=active]:text-
|
|
174
|
+
"px-2 py-0.5 rounded-md text-[10px] font-medium transition-colors",
|
|
175
|
+
"data-[state=active]:bg-primary/10 data-[state=active]:text-primary dark:data-[state=active]:bg-primary/20 dark:data-[state=active]:text-primary",
|
|
176
176
|
"text-text-disabled dark:text-text-disabled-dark hover:text-text-secondary dark:hover:text-text-secondary-dark"
|
|
177
177
|
),
|
|
178
178
|
className,
|
|
@@ -53,10 +53,10 @@ export function ToggleButtonGroup<T extends string = string>({
|
|
|
53
53
|
aria-pressed={value === option.value}
|
|
54
54
|
aria-disabled={option.disabled || undefined}
|
|
55
55
|
className={cls(
|
|
56
|
-
"flex flex-row items-center justify-center gap-2 py-3 px-4 rounded-md transition-colors",
|
|
56
|
+
"flex flex-row items-center justify-center gap-2 py-3 px-4 rounded-md transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
57
57
|
value === option.value
|
|
58
|
-
? "bg-white dark:bg-surface-
|
|
59
|
-
: "text-
|
|
58
|
+
? "bg-white dark:bg-surface-700 text-primary dark:text-primary-300 shadow-sm"
|
|
59
|
+
: "text-text-secondary dark:text-text-secondary-dark hover:bg-surface-200 dark:hover:bg-surface-800",
|
|
60
60
|
option.disabled && "opacity-50 cursor-not-allowed"
|
|
61
61
|
)}
|
|
62
62
|
>
|
|
@@ -72,7 +72,7 @@ onOpenChange } : {})} defaultOpen={defaultOpen}>
|
|
|
72
72
|
<TooltipPrimitive.Content
|
|
73
73
|
className={cls("TooltipContent",
|
|
74
74
|
"max-w-lg leading-relaxed",
|
|
75
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
|
75
|
+
"z-50 rounded-md px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
|
76
76
|
tooltipClassName)}
|
|
77
77
|
style={tooltipStyle}
|
|
78
78
|
sideOffset={sideOffset === undefined ? 4 : sideOffset}
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { cls } from "../../util";
|
|
3
3
|
|
|
4
4
|
export function SelectInputLabel({ children, error }: { children: React.ReactNode, error?: boolean }) {
|
|
5
|
-
return <div className={cls("text-sm
|
|
6
|
-
error ? "text-red-
|
|
5
|
+
return <div className={cls("text-sm font-medium ml-3.5 mb-1",
|
|
6
|
+
error ? "text-red-600 dark:text-red-500" : "text-surface-accent-500 dark:text-surface-accent-300")}>
|
|
7
7
|
{children}
|
|
8
8
|
</div>;
|
|
9
9
|
}
|