Skip to content

Commit 9497583

Browse files
committed
chore: undo color roles name change
1 parent 9514f30 commit 9497583

File tree

14 files changed

+33
-68
lines changed

14 files changed

+33
-68
lines changed

site/src/components/InfoTooltip/InfoTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
HelpTooltipTrigger,
99
} from "components/HelpTooltip/HelpTooltip";
1010
import type { FC, ReactNode } from "react";
11-
import type { ThemeRole } from "theme/colorRoles";
11+
import type { ThemeRole } from "theme/roles";
1212

1313
interface InfoTooltipProps {
1414
type?: ThemeRole;

site/src/components/Pill/Pill.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
forwardRef,
1010
useMemo,
1111
} from "react";
12-
import type { ThemeRole } from "theme/colorRoles";
12+
import type { ThemeRole } from "theme/roles";
1313

1414
export type PillProps = HTMLAttributes<HTMLDivElement> & {
1515
icon?: ReactNode;

site/src/components/StatusIndicator/StatusIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useTheme } from "@emotion/react";
22
import type { FC } from "react";
3-
import type { ThemeRole } from "theme/colorRoles";
3+
import type { ThemeRole } from "theme/roles";
44

55
interface StatusIndicatorProps {
66
color: ThemeRole;

site/src/pages/AuditPage/AuditLogRow/AuditLogRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { TimelineEntry } from "components/Timeline/TimelineEntry";
1212
import { UserAvatar } from "components/UserAvatar/UserAvatar";
1313
import { type FC, useState } from "react";
1414
import { Link as RouterLink } from "react-router-dom";
15-
import type { ThemeRole } from "theme/colorRoles";
15+
import type { ThemeRole } from "theme/roles";
1616
import userAgentParser from "ua-parser-js";
1717
import { AuditLogDescription } from "./AuditLogDescription/AuditLogDescription";
1818
import { AuditLogDiff } from "./AuditLogDiff/AuditLogDiff";

site/src/pages/TemplateVersionEditorPage/TemplateVersionStatusBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import QueuedIcon from "@mui/icons-material/HourglassEmpty";
44
import type { TemplateVersion } from "api/typesGenerated";
55
import { Pill, PillSpinner } from "components/Pill/Pill";
66
import type { FC, ReactNode } from "react";
7-
import type { ThemeRole } from "theme/colorRoles";
7+
import type { ThemeRole } from "theme/roles";
88
import { getPendingStatusLabel } from "utils/provisionerJob";
99

1010
interface TemplateVersionStatusBadgeProps {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
usePopover,
1010
} from "components/Popover/Popover";
1111
import type { FC, ReactNode } from "react";
12-
import type { ThemeRole } from "theme/colorRoles";
12+
import type { ThemeRole } from "theme/roles";
1313

1414
export type NotificationItem = {
1515
title: string;

site/src/theme/dark/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { forDarkThemes } from "../externalImages";
2-
import roles from "./colorRoles";
2+
import roles from "./roles";
33
import experimental from "./experimental";
44
import monaco from "./monaco";
55
import muiTheme from "./mui";

site/src/theme/dark/colorRoles.ts renamed to site/src/theme/dark/roles.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
import type { ColorRoles } from "../colorRoles";
1+
import type { Roles } from "../roles";
22
import colors from "../tailwindColors";
33

44
export default {
5-
default: {
6-
background: colors.zinc[800],
7-
outline: colors.zinc[700],
8-
text: colors.zinc[200],
9-
fill: {
10-
solid: colors.zinc[700],
11-
outline: colors.zinc[600],
12-
text: colors.zinc[50],
13-
},
14-
},
155
danger: {
166
background: colors.orange[950],
177
outline: colors.orange[500],
@@ -162,4 +152,4 @@ export default {
162152
text: colors.white,
163153
},
164154
},
165-
} satisfies ColorRoles;
155+
} satisfies Roles;

site/src/theme/darkBlue/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { forDarkThemes } from "../externalImages";
2-
import roles from "./colorRoles";
2+
import roles from "./roles";
33
import experimental from "./experimental";
44
import monaco from "./monaco";
55
import muiTheme from "./mui";

site/src/theme/darkBlue/colorRoles.ts renamed to site/src/theme/darkBlue/roles.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
import type { ColorRoles } from "../colorRoles";
1+
import type { Roles } from "../roles";
22
import colors from "../tailwindColors";
33

44
export default {
5-
default: {
6-
background: colors.gray[800],
7-
outline: colors.gray[700],
8-
text: colors.gray[200],
9-
fill: {
10-
solid: colors.gray[700],
11-
outline: colors.gray[600],
12-
text: colors.gray[50],
13-
},
14-
},
155
danger: {
166
background: colors.orange[950],
177
outline: colors.orange[500],
@@ -162,4 +152,4 @@ export default {
162152
text: colors.white,
163153
},
164154
},
165-
} satisfies ColorRoles;
155+
} satisfies Roles;

site/src/theme/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// biome-ignore lint/nursery/noRestrictedImports: We still use `Theme` as a basis for our actual theme, for now.
22
import type { Theme as MuiTheme } from "@mui/material/styles";
33
import type * as monaco from "monaco-editor";
4-
import type { ColorRoles } from "./colorRoles";
4+
import type { Roles } from "./roles";
55
import dark from "./dark";
66
import darkBlue from "./darkBlue";
77
import type { NewTheme } from "./experimental";
@@ -16,7 +16,7 @@ export interface Theme extends Omit<MuiTheme, "palette"> {
1616
* for the user.
1717
* Does it signify an error? a warning? that something is currently running? etc.
1818
*/
19-
roles: ColorRoles;
19+
roles: Roles;
2020

2121
/** Theme properties that we're testing out but haven't committed to. */
2222
experimental: NewTheme;

site/src/theme/light/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { forLightThemes } from "../externalImages";
2-
import roles from "./colorRoles";
2+
import roles from "./roles";
33
import experimental from "./experimental";
44
import monaco from "./monaco";
55
import muiTheme from "./mui";

site/src/theme/light/colorRoles.ts renamed to site/src/theme/light/roles.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
import type { ColorRoles } from "../colorRoles";
1+
import type { Roles } from "../roles";
22
import colors from "../tailwindColors";
33

44
export default {
5-
default: {
6-
background: colors.zinc[200],
7-
outline: colors.zinc[300],
8-
text: colors.zinc[700],
9-
fill: {
10-
solid: colors.gray[300],
11-
outline: colors.gray[400],
12-
text: colors.gray[800],
13-
},
14-
},
155
danger: {
166
background: colors.orange[50],
177
outline: colors.orange[400],
@@ -162,4 +152,4 @@ export default {
162152
text: colors.white,
163153
},
164154
},
165-
} satisfies ColorRoles;
155+
} satisfies Roles;
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,49 @@
1-
export type ThemeRole = keyof ColorRoles;
1+
export type ThemeRole = keyof Roles;
22

33
export type InteractiveThemeRole = keyof {
4-
[K in keyof ColorRoles as ColorRoles[K] extends InteractiveColorRole
5-
? K
6-
: never]: unknown;
4+
[K in keyof Roles as Roles[K] extends InteractiveRole ? K : never]: unknown;
75
};
86

9-
export interface ColorRoles {
10-
/** The default color role for general use */
11-
default: ColorRole;
12-
7+
export interface Roles {
138
/** Something is wrong; either unexpectedly, or in a meaningful way. */
14-
error: ColorRole;
9+
error: Role;
1510

1611
/** Something isn't quite right, but without serious consequence. */
17-
warning: ColorRole;
12+
warning: Role;
1813

1914
/** A prompt for action, to correct or look into something. */
20-
notice: ColorRole;
15+
notice: Role;
2116

2217
/** Notable information; just so you know! */
23-
info: ColorRole;
18+
info: Role;
2419

2520
/** Confirmation, or affirming that things are as desired. */
26-
success: InteractiveColorRole;
21+
success: InteractiveRole;
2722

2823
/** Selected, in progress, of particular relevance right now. */
29-
active: InteractiveColorRole;
24+
active: InteractiveRole;
3025

3126
/** For things that can be made "active", but are not currently so.
3227
* Paused, stopped, off, etc.
3328
*/
34-
inactive: ColorRole;
29+
inactive: Role;
3530

3631
/** Actions that have long lasting or irreversible effects.
3732
* Deletion, immutable parameters, etc.
3833
*/
39-
danger: InteractiveColorRole;
34+
danger: InteractiveRole;
4035

4136
/** This isn't quite ready for prime-time, but you're welcome to look around!
4237
* Preview features, experiments, unstable, etc.
4338
*/
44-
preview: ColorRole;
39+
preview: Role;
4540
}
4641

4742
/**
4843
* A set of colors which work together to fill a desirable "communication role"
4944
* ie. I wish to communicate an error, I wish to communicate that this is dangerous, etc.
5045
*/
51-
export interface ColorRole {
46+
export interface Role {
5247
/** A background color that works best with the corresponding `outline` and `text` colors */
5348
background: string;
5449

@@ -72,10 +67,10 @@ export interface ColorRole {
7267
}
7368

7469
/** Provides additional colors which can indicate different states for interactive elements */
75-
export interface InteractiveColorRole extends ColorRole {
70+
export interface InteractiveRole extends Role {
7671
/** A set of colors which can indicate a disabled state */
77-
disabled: ColorRole;
72+
disabled: Role;
7873

7974
/** A set of colors which can indicate mouse hover (or keyboard focus) */
80-
hover: ColorRole;
75+
hover: Role;
8176
}

0 commit comments

Comments
 (0)