Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Theming - Bootstrap #1603

Merged
merged 74 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
883bb70
Moved getThemeDataFromPlugins
bmingles Nov 29, 2023
1120f3e
Added theme picker to styleguide
bmingles Nov 29, 2023
5629c4a
Added ThemePicker to SettingsMenu
bmingles Nov 29, 2023
7bd6ade
Support local vite config
bmingles Nov 29, 2023
0773b57
Refresh irisgrid and monaco on theme change
bmingles Nov 29, 2023
a6eb952
Removed unnecessary providers
bmingles Nov 29, 2023
b74a4f5
Fixed failing tests
bmingles Nov 30, 2023
3f9897a
Env config for local plugin dev
bmingles Nov 30, 2023
14a1b92
Merge branch 'main' into 1660-theme-selector
bmingles Nov 30, 2023
a8b3a4a
Updated package lock
bmingles Nov 30, 2023
2fd804c
Initialize Monaco theme as part of init
bmingles Nov 30, 2023
1aaff96
Copied bootstrap function + mixins to override
bmingles Nov 30, 2023
bb96a51
Mapping Bootstrap variables
bmingles Nov 30, 2023
ae6a597
Fixed sass deprecation warning
bmingles Oct 25, 2023
9693aa6
Updated bootstrap colors in styleguide
bmingles Nov 30, 2023
5e62161
Cleaned up maps a bit
bmingles Nov 3, 2023
f7393a1
Button mixins and more color refinements
bmingles Nov 30, 2023
33f93da
Removed unused green-dark color
bmingles Oct 31, 2023
7d36bb2
Color category
bmingles Oct 31, 2023
ef2e7be
Added misconfiguration identifiers
bmingles Nov 30, 2023
39a4d18
Fixed colors
bmingles Nov 30, 2023
8f4d82d
Left a few fallback colors for when server down
bmingles Nov 7, 2023
33cf738
Updated hue based colors to hsl based
bmingles Nov 30, 2023
7dcb780
Fixed margin in spinner sample
bmingles Nov 8, 2023
8f08329
Display gray-8xx as N/A
bmingles Nov 8, 2023
3b9a488
Comment
bmingles Nov 8, 2023
67b3d52
Comments and split out const
bmingles Nov 8, 2023
6ec992c
Removed stray comment
bmingles Nov 8, 2023
38a0df0
Cleaned up yiq (contrast) colors
bmingles Nov 30, 2023
45feb01
Contrast color fallback
bmingles Nov 9, 2023
32ffe6d
Fixed accent, rgba, and spinner colors
bmingles Nov 30, 2023
110e060
Fixing alpha colors
bmingles Nov 9, 2023
8a43d6a
Color fixes
bmingles Nov 30, 2023
a3586ac
Temporarily hard coding select indicator
bmingles Nov 9, 2023
c4d6c52
Removed light + dark Bootstrap $theme-colors
bmingles Nov 10, 2023
378f9dc
Fixed ts errors
bmingles Nov 30, 2023
e6616f2
Fixing merge
bmingles Nov 30, 2023
6da6970
Fixed import and removed commented out imports
bmingles Nov 30, 2023
63b195f
Removed duplicate palette
bmingles Nov 30, 2023
d37167c
Removed unused alerts from styleguide
bmingles Nov 30, 2023
64587b7
Fixed mixin
bmingles Nov 30, 2023
9db527e
Updated hcm select indicator
bmingles Nov 30, 2023
794c0ba
Fixed colors
bmingles Nov 30, 2023
55b9a75
Color fixes
bmingles Dec 1, 2023
d44671e
Styleguide update + var tweaks
bmingles Dec 1, 2023
d8bdab9
Tweaked some semantic vars
bmingles Dec 4, 2023
e63d5ce
action / inline buttons
bmingles Dec 4, 2023
7d23373
Ts errors
bmingles Dec 4, 2023
e2efae5
List + menu item variables
bmingles Dec 5, 2023
2405792
rgba -> hsla
bmingles Dec 5, 2023
974a3c4
Fixed styleguide color categories
bmingles Dec 5, 2023
511e2f7
Ts / eslint errors
bmingles Dec 6, 2023
d5f1455
Merge branch 'main' into 1540-theming-bootstrap
bmingles Dec 6, 2023
951899b
Fixed bad merge
bmingles Dec 6, 2023
8677303
Updated snapshots
bmingles Dec 6, 2023
45283ce
Categorized colors
bmingles Dec 6, 2023
04b3f85
Updated comments
bmingles Dec 6, 2023
acf5d7a
Updated snapshots
bmingles Dec 6, 2023
9ae535a
Renamed -default variables
bmingles Dec 6, 2023
6363a52
Updated snapshots
bmingles Dec 6, 2023
44f6421
Updated snapshots
bmingles Dec 6, 2023
22ec79a
Theme variables for login and inputs
bmingles Dec 6, 2023
823b0dd
Updated snapshot
bmingles Dec 6, 2023
5afcf3f
Updated snapshots
bmingles Dec 7, 2023
871f510
Code review comments
bmingles Dec 7, 2023
f7f4c7f
Animation colors respond to theme changes
bmingles Dec 7, 2023
acc5f24
Updated legacy colors text
bmingles Dec 7, 2023
0753d8e
Fixed a misplaced color and cleaned up styleguide
bmingles Dec 7, 2023
81cb00e
Snapshots
bmingles Dec 7, 2023
a87a581
Fixed tests and removed unnecessary trim
bmingles Dec 7, 2023
273622f
Check for tooltip
bmingles Dec 7, 2023
ea60f02
Addressed review comments
bmingles Dec 8, 2023
89e9ab6
Added comment
bmingles Dec 8, 2023
79f46a6
Updated snapshots
bmingles Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 8 additions & 5 deletions packages/auth-plugins/src/AuthPluginPsk.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import Cookies from 'js-cookie';
import { act, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider } from '@deephaven/components';
import { ApiContext, ClientContext } from '@deephaven/jsapi-bootstrap';
import { dh } from '@deephaven/jsapi-shim';
import type { CoreClient } from '@deephaven/jsapi-types';
Expand Down Expand Up @@ -47,11 +48,13 @@ function renderComponent(
) {
return render(
<ApiContext.Provider value={dh}>
<ClientContext.Provider value={client}>
<AuthPluginPsk.Component authConfigValues={authConfigValues}>
{mockChild}
</AuthPluginPsk.Component>
</ClientContext.Provider>
<ThemeProvider themes={[]}>
<ClientContext.Provider value={client}>
<AuthPluginPsk.Component authConfigValues={authConfigValues}>
{mockChild}
</AuthPluginPsk.Component>
</ClientContext.Provider>
</ThemeProvider>
</ApiContext.Provider>
);
}
Expand Down
6 changes: 2 additions & 4 deletions packages/auth-plugins/src/Login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

$login-box-width: 605px;
$login-box-min-height: 310px;
$logo-background-color: $gray-100;
$footer-color: $gray-300;
$login-box-animation-scale: 0.8;

.login-container {
Expand All @@ -25,7 +23,7 @@ $login-box-animation-scale: 0.8;
animation: $transition-long ease-out 0s 1 forwards animateLoginBox;

.logo {
background-color: $logo-background-color;
background-color: var(--dh-color-login-logo-bg);
border-radius: $border-radius 0 0 $border-radius;
display: flex;
justify-content: center;
Expand All @@ -48,7 +46,7 @@ $login-box-animation-scale: 0.8;
margin: 0;
transform: translateY(100%);
text-align: center;
color: $footer-color;
color: var(--dh-color-login-footer-fg);
font-size: 12px;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/auth-plugins/src/LoginForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $login-box-min-height: 310px;
.login-form {
max-width: $login-box-width * 0.5;
min-height: $login-box-min-height;
background: $gray-700;
background: var(--dh-color-login-form-bg);
border-radius: 0 $border-radius $border-radius 0;
display: flex;
flex-grow: 1;
Expand Down Expand Up @@ -37,7 +37,7 @@ $login-box-min-height: 310px;
}

.status-message {
color: $gray-400;
color: var(--dh-color-login-status-message);
}

.error-message {
Expand Down
29 changes: 13 additions & 16 deletions packages/chart/src/Chart.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
@import '@deephaven/components/scss/custom.scss';

$chart-bg: $content-bg;
$plotly-notifier-margin-right: 15px;
$plotly-notifier-note-bg: $gray-600;
$plotly-notifier-note-border-radius: 2px;
$plotly-color-btn-active: rgba(255, 255, 255, 70%);

.plotly-notifier {
margin-right: $plotly-notifier-margin-right;
Expand All @@ -17,7 +14,7 @@ $plotly-color-btn-active: rgba(255, 255, 255, 70%);
color: $foreground !important;
border: 0 !important;
border-radius: $plotly-notifier-note-border-radius !important;
background: $plotly-notifier-note-bg !important;
background: var(--dh-color-plotly-notifier-note-bg) !important;
overflow-wrap: normal !important;
hyphens: unset !important;
margin-bottom: $spacer-2 !important;
Expand All @@ -33,7 +30,7 @@ $plotly-color-btn-active: rgba(255, 255, 255, 70%);
}

.chart-wrapper {
background: $chart-bg;
background: var(--dh-color-chart-bg);

.plot-container {
.cartesianlayer text {
Expand All @@ -46,34 +43,34 @@ $plotly-color-btn-active: rgba(255, 255, 255, 70%);
}

.axistext path {
fill: $gray-600 !important;
box-shadow: 4px 4px $black;
fill: var(--dh-color-plotly-axis-text) !important;
box-shadow: 4px 4px var(--dh-color-black);
}

.zoomlayer .zoombox {
fill: rgba(0, 0, 0, 50%) !important;
fill: var(--dh-color-plotly-zoombox) !important;
}

.zoomlayer .zoombox-corners {
fill: $white;
stroke: $gray-900;
fill: var(--dh-color-plotly-zoombox-corners-fill);
stroke: var(--dh-color-plotly-zoombox-corners-stroke);
}
}

// Tooltip arrow
.js-plotly-plot .plotly [data-title]::before {
border-color: transparent transparent $tooltip-bg;
border-color: transparent transparent var(--dh-color-tooltip-bg);

// Make the arrow appear above the box shadow of the body
z-index: 1002;
}
// Tooltip body
.js-plotly-plot .plotly [data-title]::after {
border-radius: $border-radius;
background: $tooltip-bg;
color: $tooltip-color;
background: var(--dh-color-tooltip-bg);
color: var(--dh-color-tooltip-fg);
padding: $tooltip-padding-y $tooltip-padding-x;
box-shadow: $tooltip-box-shadow;
box-shadow: var(--dh-color-tooltip-box-shadow);

// Already set by plotly, just setting again in case it changes in the future so body shadow appears under arrow tip
z-index: 1001;
Expand All @@ -93,15 +90,15 @@ $plotly-color-btn-active: rgba(255, 255, 255, 70%);
&[data-attr='fill-active'] {
svg {
path {
fill: $plotly-color-btn-active !important;
fill: var(--dh-color-plotly-modebar-btn-active) !important;
}
}
}

&[data-attr='fill-warning'] {
svg {
path {
fill: $warning !important;
fill: var(--dh-color-plotly-modebar-btn-warning) !important;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/code-studio/src/main/AppMainContainer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ $nav-space: 4px; // give a gap around some buttons for focus area that are in na
flex-shrink: 0;
background-image: linear-gradient(
270deg,
rgba($background, 0) 0%,
hsla(var(--dh-color-bg-hsl), 0) 0%,
bmingles marked this conversation as resolved.
Show resolved Hide resolved
$background $tab-control-gradient-width
);
background-clip: content-box;
Expand All @@ -199,7 +199,7 @@ $nav-space: 4px; // give a gap around some buttons for focus area that are in na
.tab-controls-forward {
background-image: linear-gradient(
90deg,
rgba($background, 0) 0%,
hsla(var(--dh-color-bg-hsl), 0) 0%,
$background $tab-control-gradient-width
);
background-clip: content-box;
Expand Down
26 changes: 13 additions & 13 deletions packages/code-studio/src/settings/SettingsMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ $settings-menu-width: 400px;
$settings-menu-header-min-height: 60px;
$settings-menu-padding: $spacer-3;
$settings-menu-header-user-image-size: 40px;
$settings-menu-header-color: $foreground;
$settings-menu-header-color: var(--dh-color-fg);

$settings-menu-collapse-trigger-color: $foreground;
$settings-menu-collapse-trigger-color: var(--dh-color-fg);

$settings-menu-rule-bg: $gray-600;
$settings-menu-rule-button-color: $gray-300;
$settings-menu-rule-border: $gray-400;
$settings-menu-rule-focused-border: $primary;
bmingles marked this conversation as resolved.
Show resolved Hide resolved

$focus-over-primary-color: $foreground;
$focus-over-primary-color: var(--dh-color-fg);
$input-btn-focus-box-shadow-over-primary: 0 0 0 0.2rem
rgba($focus-over-primary-color, 0.35);
hsla(var(--dh-color-fg-hsl), 0.35);

$settings-menu-z-index: $zindex-modal;

Expand Down Expand Up @@ -64,7 +64,7 @@ $settings-menu-z-index: $zindex-modal;
color: $settings-menu-header-color;

.btn-close-settings-menu {
color: $foreground;
color: var(--dh-color-fg);
font-size: 18px;
// we want the close button to occupy at least
// as much space as the triggering button below
Expand All @@ -74,22 +74,22 @@ $settings-menu-z-index: $zindex-modal;

&:focus {
&::after {
background: rgba($focus-over-primary-color, $focus-bg-transparency);
border: 1px solid $focus-over-primary-color;
background: hsla(var(--dh-color-fg-hsl), $focus-bg-transparency);
border: 1px solid var(--dh-color-fg);
box-shadow: $input-btn-focus-box-shadow-over-primary;
}
}

&:hover {
&::after {
background: rgba($focus-over-primary-color, $hover-bg-transparency);
background: hsla(var(--dh-color-fg-hsl), $hover-bg-transparency);
}
}

&:active {
&::after {
content: '';
background: rgba($focus-over-primary-color, $active-bg-transparency);
background: hsla(var(--dh-color-fg-hsl), $active-bg-transparency);
}
}
}
Expand Down Expand Up @@ -136,18 +136,18 @@ $settings-menu-z-index: $zindex-modal;
padding: 0 $spacer-1;

&:focus {
background: rgba($focus-over-primary-color, $focus-bg-transparency);
border: 1px solid $focus-over-primary-color;
background: hsla(var(--dh-color-fg-hsl), $focus-bg-transparency);
border: 1px solid var(--dh-color-fg);
box-shadow: $input-btn-focus-box-shadow-over-primary;
}

&:hover {
background: rgba($focus-over-primary-color, $hover-bg-transparency);
background: hsla(var(--dh-color-fg-hsl), $hover-bg-transparency);
}

&:active {
content: '';
background: rgba($focus-over-primary-color, $active-bg-transparency);
background: hsla(var(--dh-color-fg-hsl), $active-bg-transparency);
}
}
}
Expand Down
29 changes: 0 additions & 29 deletions packages/code-studio/src/styleguide/Alerts.tsx

This file was deleted.

14 changes: 11 additions & 3 deletions packages/code-studio/src/styleguide/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ class Buttons extends Component<Record<string, never>, ButtonsState> {
}

static renderButtons(type: string): ReactElement {
const brands = ['primary', 'secondary', 'success', 'info', 'danger'].map(
(brand: string) => Buttons.renderButtonBrand(type, brand)
);
const brands = [
'primary',
'secondary',
'success',
'warning',
'danger',
// Temporarily putting this at end of list for easier regression comparison.
// Once the colors are finalized, this should semantically go between
// success and warning
'info',
].map((brand: string) => Buttons.renderButtonBrand(type, brand));

return (
<div
Expand Down
Loading
Loading