Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc36c9bd

Browse files
committed
chore: cleanup
1 parent07b9b57 commitc36c9bd

File tree

8 files changed

+50
-27
lines changed

8 files changed

+50
-27
lines changed

‎site/src/components/Alert/Alert.tsx‎

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import{cva,typeVariantProps}from"class-variance-authority";
22
import{Button}from"components/Button/Button";
3+
import{
4+
CircleAlertIcon,
5+
CircleCheckIcon,
6+
InfoIcon,
7+
TriangleAlertIcon,
8+
XIcon,
9+
}from"lucide-react";
310
import{
411
typeFC,
512
forwardRef,
@@ -14,27 +21,34 @@ const alertVariants = cva(
1421
{
1522
variants:{
1623
variant:{
17-
default:"border-border-default",
18-
info:"border-highlight-sky",
19-
success:"border-surface-green",
20-
warning:"border-border-warning",
21-
error:"border-border-destructive",
24+
default:"border-border-default bg-surface-secondary",
25+
info:"border-border-pending bg-surface-secondary",
26+
success:"border-border-green bg-surface-green",
27+
warning:"border-border-warning bg-surface-orange",
28+
error:"border-border-destructive bg-surface-red",
2229
},
2330
},
2431
defaultVariants:{
2532
variant:"default",
2633
},
27-
}
28-
)
34+
},
35+
);
2936

30-
// Map MUI severity to our variant
3137
constseverityToVariant={
3238
info:"info",
3339
success:"success",
3440
warning:"warning",
3541
error:"error",
3642
}asconst;
3743

44+
constvariantIcons={
45+
default:{icon:InfoIcon,className:"text-content-secondary"},
46+
info:{icon:InfoIcon,className:"text-highlight-sky"},
47+
success:{icon:CircleCheckIcon,className:"text-content-success"},
48+
warning:{icon:TriangleAlertIcon,className:"text-content-warning"},
49+
error:{icon:CircleAlertIcon,className:"text-content-destructive"},
50+
}asconst;
51+
3852
exporttypeAlertColor="info"|"success"|"warning"|"error";
3953

4054
exporttypeAlertProps={
@@ -67,29 +81,40 @@ export const Alert: FC<AlertProps> = ({
6781
variant||
6882
(severityinseverityToVariant ?severityToVariant[severity] :"default");
6983

84+
const{icon:Icon,className:iconClassName}=variantIcons[finalVariant];
85+
7086
return(
7187
<div
7288
role="alert"
7389
className={cn(alertVariants({variant:finalVariant}),className)}
7490
{...props}
7591
>
76-
<divclassName="flex items-start justify-between text-sm">
77-
<divclassName="flex-1">{children}</div>
78-
<divclassName="flex items-center gap-2 ml-4">
79-
{/* CTAs passed in by the consumer */}
92+
<divclassName="flex items-start justify-between gap-4 text-sm">
93+
<divclassName="flex flex-row items-start gap-3">
94+
<Icon
95+
className={cn(
96+
"size-icon-sm mt-1",
97+
iconClassName,
98+
)}
99+
/>
100+
<divclassName="flex-1">{children}</div>
101+
</div>
102+
<divclassName="flex items-start gap-2">
80103
{actions}
81104

82105
{dismissible&&(
83106
<Button
84107
variant="subtle"
85-
size="sm"
108+
size="icon"
109+
className="mt-px !size-auto !min-w-0 !p-0"
86110
onClick={()=>{
87111
setOpen(false);
88112
onDismiss?.();
89113
}}
90114
data-testid="dismiss-banner-btn"
115+
aria-label="Dismiss"
91116
>
92-
Dismiss
117+
<XIconclassName="!size-icon-sm !p-0"/>
93118
</Button>
94119
)}
95120
</div>
@@ -100,22 +125,22 @@ export const Alert: FC<AlertProps> = ({
100125

101126
exportconstAlertDetail:FC<PropsWithChildren>=({ children})=>{
102127
return(
103-
<spanclassName="text-sm opacity-75"data-chromatic="ignore">
128+
<spanclassName="m-0 text-sm"data-chromatic="ignore">
104129
{children}
105130
</span>
106131
);
107132
};
108133

109-
// Export AlertTitle and AlertDescription for compatibility
110134
exportconstAlertTitle=forwardRef<
111135
HTMLHeadingElement,
112136
React.HTMLAttributes<HTMLHeadingElement>
113137
>(({ className, ...props},ref)=>(
114-
<h5
138+
<h1
115139
ref={ref}
116-
className={cn("mb-1 font-medium leading-none tracking-tight",className)}
140+
className={cn(
141+
"m-0 mb-1 text-sm font-medium",
142+
className,
143+
)}
117144
{...props}
118145
/>
119146
));
120-
121-
AlertTitle.displayName="AlertTitle";

‎site/src/components/Badge/Badge.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const badgeVariants = cva(
2424
"border border-solid border-border-destructive bg-surface-red text-highlight-red shadow",
2525
green:
2626
"border border-solid border-border-green bg-surface-green text-highlight-green shadow",
27-
info:"border border-solid border-border-sky bg-surface-sky text-highlight-sky shadow",
27+
info:"border border-solid border-border-pending bg-surface-sky text-highlight-sky shadow",
2828
},
2929
size:{
3030
xs:"text-2xs font-regular h-5 [&_svg]:hidden rounded px-1.5",

‎site/src/components/GitDeviceAuth/GitDeviceAuth.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
importtype{Interpolation,Theme}from"@emotion/react";
2-
32
importCircularProgressfrom"@mui/material/CircularProgress";
43
importLinkfrom"@mui/material/Link";
54
importtype{ApiErrorResponse}from"api/errors";

‎site/src/modules/workspaces/WorkspaceMoreActions/ChangeWorkspaceVersionDialog.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{css}from"@emotion/css";
2-
32
importAutocompletefrom"@mui/material/Autocomplete";
43
importCircularProgressfrom"@mui/material/CircularProgress";
54
importTextFieldfrom"@mui/material/TextField";

‎site/src/pages/WorkspacePage/WorkspaceNotifications/Notifications.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const NotificationItem: FC<NotificationItemProps> = ({ notification }) => {
105105
};
106106

107107
exportconstNotificationActionButton:FC<ButtonProps>=(props)=>{
108-
return<Buttonvariant="outline"size="sm"{...props}/>;
108+
return<Buttonvariant="default"size="sm"{...props}/>;
109109
};
110110

111111
conststyles={

‎site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageViewExperimental.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const WorkspaceParametersPageViewExperimental: FC<
120120

121121
{hasIncompatibleParameters&&(
122122
<Alertseverity="error">
123-
<pclassName="text-lg leading-tight font-bold m-0">
123+
<pclassName="text-lg leading-normal font-bold m-0">
124124
Workspace update blocked
125125
</p>
126126
<pclassName="mb-0">

‎site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceSchedulePage.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const WorkspaceSchedulePage: FC = () => {
109109
>
110110
Prebuilt Workspaces Scheduling
111111
</Link>
112-
documentation page.
112+
{" "}documentation page.
113113
</Alert>
114114
) :(
115115
<WorkspaceScheduleForm

‎site/tailwind.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = {
5959
DEFAULT:"hsl(var(--border-default))",
6060
warning:"hsl(var(--border-warning))",
6161
green:"hsl(var(--border-green))",
62-
sky:"hsl(var(--border-sky))",
62+
pending:"hsl(var(--border-sky))",
6363
destructive:"hsl(var(--border-destructive))",
6464
success:"hsl(var(--border-success))",
6565
hover:"hsl(var(--border-hover))",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp