From ed41c424de75fcba8751a70b54a189957f979e97 Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Thu, 11 Jan 2024 13:25:58 -0600 Subject: [PATCH] feat: Improved preload variable handling (#1723) - Preload now always applies default preload values before applying cached ones. This ensures that cached preload values don't prevent new defaults from being applied if / when we add new variables to the preload list - Default preload variables can now be passed in to ThemeUtils + ThemeProvider. This will allow DHE to specify additional variables if needed resolves #1695 and part of #1679 --- .../src/styleguide/SpectrumComparison.tsx | 27 +++++-- packages/components/src/theme/ThemeModel.ts | 2 +- .../components/src/theme/ThemeProvider.tsx | 15 +++- .../components/src/theme/ThemeUtils.test.ts | 45 ++++++++--- packages/components/src/theme/ThemeUtils.ts | 79 ++++++++++++++----- 5 files changed, 126 insertions(+), 42 deletions(-) diff --git a/packages/code-studio/src/styleguide/SpectrumComparison.tsx b/packages/code-studio/src/styleguide/SpectrumComparison.tsx index 7d23701411..454e82e8b7 100644 --- a/packages/code-studio/src/styleguide/SpectrumComparison.tsx +++ b/packages/code-studio/src/styleguide/SpectrumComparison.tsx @@ -24,6 +24,7 @@ import { RadioItem, Select, } from '@deephaven/components'; +import { EMPTY_FUNCTION } from '@deephaven/utils'; import { SAMPLE_SECTION_E2E_IGNORE, SPECTRUM_COMPARISON_SAMPLES_ID, @@ -73,7 +74,9 @@ export function SpectrumComparison(): JSX.Element { {buttons.map(([level, variant]) => ( - Button + + Button + ))} - + Disabled