Skip to content

Commit f619cdb

Browse files
committed
small bits of cleanup, rebrand as "preview"
1 parent 4f4e295 commit f619cdb

File tree

4 files changed

+54
-24
lines changed

4 files changed

+54
-24
lines changed

site/src/components/Badges/Badges.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
22
import {
33
Badges,
44
AlphaBadge,
5-
BetaBadge,
5+
PreviewBadge,
66
DisabledBadge,
77
EnabledBadge,
88
EntitledBadge,
@@ -55,9 +55,9 @@ export const Enterprise: Story = {
5555
children: <EnterpriseBadge />,
5656
},
5757
};
58-
export const Beta: Story = {
58+
export const Preview: Story = {
5959
args: {
60-
children: <BetaBadge />,
60+
children: <PreviewBadge />,
6161
},
6262
};
6363
export const Alpha: Story = {

site/src/components/Badges/Badges.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const EnterpriseBadge: FC = () => {
108108
);
109109
};
110110

111-
export const BetaBadge: FC = () => {
111+
export const PreviewBadge: FC = () => {
112112
return (
113113
<span
114114
css={[
@@ -120,7 +120,7 @@ export const BetaBadge: FC = () => {
120120
}),
121121
]}
122122
>
123-
Beta
123+
Preview
124124
</span>
125125
);
126126
};

site/src/pages/UserSettingsPage/AppearancePage/AppearanceForm.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { UpdateUserAppearanceSettingsRequest } from "api/typesGenerated";
55
import themes, { DEFAULT_THEME, type Theme } from "theme";
66
import { ErrorAlert } from "components/Alert/ErrorAlert";
77
import { Stack } from "components/Stack/Stack";
8-
import { BetaBadge } from "components/Badges/Badges";
8+
import { PreviewBadge } from "components/Badges/Badges";
99
import { ThemeOverride } from "contexts/ThemeProvider";
1010

1111
export interface AppearanceFormProps {
@@ -57,7 +57,7 @@ export const AppearanceForm: FC<AppearanceFormProps> = ({
5757
/>
5858
<ThemePreviewButton
5959
displayName="Light"
60-
beta
60+
preview
6161
active={currentTheme === "light"}
6262
theme={themes.light}
6363
onSelect={() => onChangeTheme("light")}
@@ -74,7 +74,7 @@ interface AutoThemePreviewButtonProps extends Omit<ThemePreviewProps, "theme"> {
7474

7575
const AutoThemePreviewButton: FC<AutoThemePreviewButtonProps> = ({
7676
active,
77-
beta,
77+
preview,
7878
className,
7979
displayName,
8080
themes,
@@ -102,13 +102,13 @@ const AutoThemePreviewButton: FC<AutoThemePreviewButtonProps> = ({
102102
clipPath: "polygon(-5% -5%, 50% -5%, 50% 105%, -5% 105%)",
103103
}}
104104
active={active}
105-
beta={beta}
105+
preview={preview}
106106
displayName={displayName}
107107
theme={leftTheme}
108108
/>
109109
<ThemePreview
110110
active={active}
111-
beta={beta}
111+
preview={preview}
112112
displayName={displayName}
113113
theme={rightTheme}
114114
/>
@@ -123,7 +123,7 @@ interface ThemePreviewButtonProps extends ThemePreviewProps {
123123

124124
const ThemePreviewButton: FC<ThemePreviewButtonProps> = ({
125125
active,
126-
beta,
126+
preview,
127127
className,
128128
displayName,
129129
theme,
@@ -143,7 +143,7 @@ const ThemePreviewButton: FC<ThemePreviewButtonProps> = ({
143143
<label htmlFor={displayName} className={className}>
144144
<ThemePreview
145145
active={active}
146-
beta={beta}
146+
preview={preview}
147147
displayName={displayName}
148148
theme={theme}
149149
/>
@@ -154,15 +154,15 @@ const ThemePreviewButton: FC<ThemePreviewButtonProps> = ({
154154

155155
interface ThemePreviewProps {
156156
active?: boolean;
157-
beta?: boolean;
157+
preview?: boolean;
158158
className?: string;
159159
displayName: string;
160160
theme: Theme;
161161
}
162162

163163
const ThemePreview: FC<ThemePreviewProps> = ({
164164
active,
165-
beta,
165+
preview,
166166
className,
167167
displayName,
168168
theme,
@@ -198,7 +198,7 @@ const ThemePreview: FC<ThemePreviewProps> = ({
198198
</div>
199199
<div css={styles.label}>
200200
<span>{displayName}</span>
201-
{beta && <BetaBadge />}
201+
{preview && <PreviewBadge />}
202202
</div>
203203
</div>
204204
</ThemeOverride>

site/src/theme/experimental.ts

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,56 @@ export interface NewTheme {
1111
l2: InteractiveRole; // sidebars, table headers, navigation
1212

1313
roles: {
14-
danger: InteractiveRole; // delete, immutable parameters, stuff that sucks to fix
15-
error: Role; // something went wrong
16-
warning: Role; // something is amiss
17-
notice: Role; // like info, but actionable. "this is fine, but you may want to..."
18-
info: Role; // just sharing :)
19-
success: InteractiveRole; // yay!! it's working!!
20-
active: InteractiveRole; // selected items, focused inputs, in progress
21-
preview: Role; // experiments, alpha/beta features
14+
/** Deletion, immutable parameters, and things that have long lasting or irreversible effects */
15+
danger: InteractiveRole;
16+
17+
/** Something went wrong; either unexpectedly, or in a meaningful way */
18+
error: Role;
19+
20+
/** Something isn't quite right, but without serious consequence */
21+
warning: Role;
22+
23+
/** A prompt for action, to correct or look into something */
24+
notice: Role;
25+
26+
/** Notable information; just so you know! */
27+
info: Role;
28+
29+
/** Confirmation, or affirming that things are as desired. */
30+
success: InteractiveRole;
31+
32+
/** Selected, in progress, of particular relevance right now */
33+
active: InteractiveRole;
34+
35+
/** This isn't quite ready for prime-time, but you're welcome to look around! preview features, experiments, unstable etc. */
36+
preview: Role;
2237
};
2338
}
2439

40+
/** A set of colors which work together to fill a desirable "communiation role"
41+
* ie. I wish to communicate an error, I wish to communicate that this is dangerous, etc.
42+
*/
2543
export interface Role {
44+
/** A background color */
2645
background: string;
46+
47+
/** A border, or a color for an outlined icon */
2748
outline: string;
49+
50+
/** A good color for icons, text on a neutral background, the background of a button which should stand out */
2851
fill: string;
29-
// contrastOutline?: string;
52+
53+
/** A color great for text on the corresponding `background` */
3054
text: string;
55+
56+
// contrastOutline?: string;
3157
}
3258

59+
/** Provides additional colors which can indicate different states for interactive elements */
3360
export interface InteractiveRole extends Role {
61+
/** A set of colors which can indicate a disabled state */
3462
disabled: Role;
63+
64+
/** A set of colors which can indicate mouse hover (or keyboard focus) */
3565
hover: Role;
3666
}

0 commit comments

Comments
 (0)