diff --git a/.changeset/four-toys-think.md b/.changeset/four-toys-think.md new file mode 100644 index 00000000000..a72e15a1288 --- /dev/null +++ b/.changeset/four-toys-think.md @@ -0,0 +1,12 @@ +--- +"@itwin/appui-react": minor +--- + +Deprecated toolbar and widget opacity APIs. + +- `toolbarOpacity` and `widgetOpacity` props of `ConfigurableUiContent` component. +- `snapWidgetOpacity` property of `FrameworkVisibility` interface. +- `TOOLBAR_OPACITY_DEFAULT` and `WIDGET_OPACITY_DEFAULT` constants. +- `toolbarOpacitySetting` prop of `Toolbar` and `ToolbarWithOverflow` components. + +Use the default configuration instead. diff --git a/.changeset/full-cloths-wait.md b/.changeset/full-cloths-wait.md new file mode 100644 index 00000000000..2a388a3fe1e --- /dev/null +++ b/.changeset/full-cloths-wait.md @@ -0,0 +1,5 @@ +--- +"@itwin/appui-react": minor +--- + +Removed the glass styling effect from `Toolbar` component. diff --git a/.changeset/humble-loops-brake.md b/.changeset/humble-loops-brake.md new file mode 100644 index 00000000000..2ea8cd48b16 --- /dev/null +++ b/.changeset/humble-loops-brake.md @@ -0,0 +1,5 @@ +--- +"@itwin/appui-react": minor +--- + +Invalidated the settings stored via the deprecated `AppUiSettings` class. diff --git a/.changeset/khaki-candles-grab.md b/.changeset/khaki-candles-grab.md new file mode 100644 index 00000000000..a70949c6c69 --- /dev/null +++ b/.changeset/khaki-candles-grab.md @@ -0,0 +1,5 @@ +--- +"@itwin/components-react": minor +--- + +Deprecated `ToolbarOpacitySetting` enum. Use the default configuration instead. diff --git a/.changeset/young-roses-try.md b/.changeset/young-roses-try.md new file mode 100644 index 00000000000..4b004948718 --- /dev/null +++ b/.changeset/young-roses-try.md @@ -0,0 +1,6 @@ +--- +"@itwin/appui-react": minor +"@itwin/core-react": minor +--- + +Changed the default widget opacity to `1`. diff --git a/apps/test-app/src/frontend/AppInitializer.tsx b/apps/test-app/src/frontend/AppInitializer.tsx index 13292832fd3..867414ddc72 100644 --- a/apps/test-app/src/frontend/AppInitializer.tsx +++ b/apps/test-app/src/frontend/AppInitializer.tsx @@ -161,10 +161,8 @@ function createInitializer() { new AppUiSettings({ colorTheme: lastTheme ?? SYSTEM_PREFERRED_COLOR_THEME, dragInteraction: false, - widgetOpacity: 0.8, showWidgetIcon: true, autoCollapseUnpinnedPanels: false, - toolbarOpacity: 0.5, }) ); diff --git a/common/api/appui-react.api.md b/common/api/appui-react.api.md index fcf576dfc80..5b2930a88be 100644 --- a/common/api/appui-react.api.md +++ b/common/api/appui-react.api.md @@ -994,10 +994,12 @@ export interface ConfigurableUiContentProps extends CommonProps { }) => React_2.ReactNode; showActiveWidgetLabel?: boolean; toolAsToolSettingsLabel?: boolean; + // @deprecated toolbarOpacity?: number; // @deprecated viewOverlay?: boolean; widgetIcon?: boolean; + // @deprecated widgetOpacity?: number; } @@ -2259,6 +2261,7 @@ export interface FrameworkVisibility { showHidePanels: boolean; showUiAndCancelTimer(): void; showUiAndResetTimer(): void; + // @deprecated snapWidgetOpacity: boolean; // @deprecated useProximityOpacity: boolean; @@ -2683,11 +2686,11 @@ export interface InitialAppUiSettings { dragInteraction: boolean; // (undocumented) showWidgetIcon?: boolean; - // (undocumented) + // @deprecated (undocumented) toolbarOpacity: number; // (undocumented) useToolAsToolSettingsLabel?: boolean; - // (undocumented) + // @deprecated (undocumented) widgetOpacity: number; } @@ -4736,7 +4739,7 @@ export interface ToolAssistanceFieldProps extends CommonProps { // @beta export function Toolbar(props: ToolbarProps): React_2.JSX.Element; -// @public +// @public @deprecated export const TOOLBAR_OPACITY_DEFAULT = 0.5; // @public @@ -4944,6 +4947,7 @@ export interface ToolbarProps extends CommonProps, NoChildrenProps { onItemExecuted?: OnItemExecutedFunc; onKeyDown?: (e: React_2.KeyboardEvent) => void; panelAlignment?: ToolbarPanelAlignment; + // @deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; useDragInteraction?: boolean; } @@ -4965,6 +4969,7 @@ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps { onKeyDown?: (e: React_2.KeyboardEvent) => void; overflowExpandsTo?: Direction; panelAlignment?: ToolbarPanelAlignment; + // @deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; useDragInteraction?: boolean; } @@ -5613,8 +5618,8 @@ export interface Widget { readonly useSavedState?: boolean; } -// @public -export const WIDGET_OPACITY_DEFAULT = 0.9; +// @public @deprecated +export const WIDGET_OPACITY_DEFAULT = 1; // @alpha export function WidgetAction(props: WidgetActionProps): React_2.JSX.Element; diff --git a/common/api/components-react.api.md b/common/api/components-react.api.md index a8c302fbc09..71dbcd30f9d 100644 --- a/common/api/components-react.api.md +++ b/common/api/components-react.api.md @@ -2780,7 +2780,7 @@ export interface ToolbarButtonItemProps extends CommonProps { // @public @deprecated export type ToolbarItem = ActionButton | GroupButton | CustomToolbarItem; -// @public +// @public @deprecated export enum ToolbarOpacitySetting { Defaults = 0, Proximity = 1, diff --git a/common/api/summary/appui-react.exports.csv b/common/api/summary/appui-react.exports.csv index 1eac4df3279..f45b91d4083 100644 --- a/common/api/summary/appui-react.exports.csv +++ b/common/api/summary/appui-react.exports.csv @@ -682,6 +682,7 @@ public;function;ToolAssistanceField public;interface;ToolAssistanceFieldProps beta;function;Toolbar public;const;TOOLBAR_OPACITY_DEFAULT +deprecated;const;TOOLBAR_OPACITY_DEFAULT public;interface;ToolbarActionItem public;class;ToolbarButtonHelper public;function;ToolbarComposer @@ -800,6 +801,7 @@ deprecated;interface;ViewToolWidgetComposerProps public;class;ViewUtilities public;interface;Widget public;const;WIDGET_OPACITY_DEFAULT +deprecated;const;WIDGET_OPACITY_DEFAULT alpha;function;WidgetAction alpha;function;WidgetActions public;interface;WidgetConfig diff --git a/common/api/summary/components-react.exports.csv b/common/api/summary/components-react.exports.csv index df937977086..12b89d63191 100644 --- a/common/api/summary/components-react.exports.csv +++ b/common/api/summary/components-react.exports.csv @@ -417,6 +417,7 @@ public;interface;ToolbarButtonItemProps public;type;ToolbarItem deprecated;type;ToolbarItem public;enum;ToolbarOpacitySetting +deprecated;enum;ToolbarOpacitySetting public;enum;ToolbarPanelAlignment public;const;ToolbarPopupAutoHideContext public;const;ToolbarPopupContext diff --git a/docs/storybook/src/frontstage/ConfigurableUiContent.stories.tsx b/docs/storybook/src/frontstage/ConfigurableUiContent.stories.tsx index 8ea9128049d..4c4d5d4c30b 100644 --- a/docs/storybook/src/frontstage/ConfigurableUiContent.stories.tsx +++ b/docs/storybook/src/frontstage/ConfigurableUiContent.stories.tsx @@ -91,7 +91,8 @@ export const Default: Story = { }, }; -export const SemiTransparentWidgets: Story = { +export const TransparentWidgets: Story = { + name: "Transparent Widgets (deprecated)", args: { widgetOpacity: 0.5, }, diff --git a/e2e-tests/tests/widget/basic-navigation-widget.test.ts-snapshots/basic-navigation-widget-test-1-chromium-linux.png b/e2e-tests/tests/widget/basic-navigation-widget.test.ts-snapshots/basic-navigation-widget-test-1-chromium-linux.png index 97bc5e64a22..9c362865e26 100644 Binary files a/e2e-tests/tests/widget/basic-navigation-widget.test.ts-snapshots/basic-navigation-widget-test-1-chromium-linux.png and b/e2e-tests/tests/widget/basic-navigation-widget.test.ts-snapshots/basic-navigation-widget-test-1-chromium-linux.png differ diff --git a/ui/appui-react/src/appui-react/configurableui/ConfigurableUiContent.tsx b/ui/appui-react/src/appui-react/configurableui/ConfigurableUiContent.tsx index 525be2440aa..878079f4721 100644 --- a/ui/appui-react/src/appui-react/configurableui/ConfigurableUiContent.tsx +++ b/ui/appui-react/src/appui-react/configurableui/ConfigurableUiContent.tsx @@ -73,7 +73,9 @@ export interface ConfigurableUiContentProps extends CommonProps { * @deprecated in 4.16.0. View overlay visibility should be controlled by the components used in {@link ContentProps.content}. */ viewOverlay?: boolean; - /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */ + /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. + * @deprecated in 5.35.0. Use the default configuration. + */ widgetOpacity?: number; /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */ widgetIcon?: boolean; @@ -85,7 +87,9 @@ export interface ConfigurableUiContentProps extends CommonProps { animateToolSettings?: boolean; /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */ toolAsToolSettingsLabel?: boolean; - /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */ + /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. + * @deprecated in 5.35.0. Use the default configuration. + */ toolbarOpacity?: number; /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */ childWindow?: React.ComponentType; @@ -169,7 +173,9 @@ export function StandardLayout(props: StandardLayoutProps) { const context = React.useContext(ConfigurableUiContext); const { appBackstage, + // eslint-disable-next-line @typescript-eslint/no-deprecated widgetOpacity, + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacity, idleTimeout, intervalTimeout, @@ -266,6 +272,7 @@ function useWidgetOpacity( // eslint-disable-next-line @typescript-eslint/no-deprecated return state?.configurableUiState.widgetOpacity; }); + // eslint-disable-next-line @typescript-eslint/no-deprecated const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT; React.useEffect(() => { @@ -292,6 +299,7 @@ function useToolbarOpacity( }); const opacity = + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT; React.useEffect(() => { diff --git a/ui/appui-react/src/appui-react/framework/FrameworkVisibility.ts b/ui/appui-react/src/appui-react/framework/FrameworkVisibility.ts index f797e2d5672..a30f4ca1e3e 100644 --- a/ui/appui-react/src/appui-react/framework/FrameworkVisibility.ts +++ b/ui/appui-react/src/appui-react/framework/FrameworkVisibility.ts @@ -30,7 +30,9 @@ export interface FrameworkVisibility { */ useProximityOpacity: boolean; - /** Determines whether the opacity of a toolbar should change immediately when the mouse gets close. Defaults to `false`. */ + /** Determines whether the opacity of a toolbar should change immediately when the mouse gets close. Defaults to `false`. + * @deprecated in 5.35.0. Use the default configuration. + */ snapWidgetOpacity: boolean; /** Handler for when a Frontstage is ready */ diff --git a/ui/appui-react/src/appui-react/layout/_widgetopacity.scss b/ui/appui-react/src/appui-react/layout/_widgetopacity.scss index e6bc9fc3496..dab9408acf9 100644 --- a/ui/appui-react/src/appui-react/layout/_widgetopacity.scss +++ b/ui/appui-react/src/appui-react/layout/_widgetopacity.scss @@ -5,7 +5,7 @@ @forward "~@itwin/core-react/lib/core-react/style/themecolors"; @mixin nz-widget-opacity { - opacity: var(--buic-widget-opacity, 0.9); + opacity: var(--buic-widget-opacity, 1); transition: opacity var(--iui-duration-1) ease; &:hover, diff --git a/ui/appui-react/src/appui-react/popup/CardPopup.tsx b/ui/appui-react/src/appui-react/popup/CardPopup.tsx index ac15afb261f..71927a16812 100644 --- a/ui/appui-react/src/appui-react/popup/CardPopup.tsx +++ b/ui/appui-react/src/appui-react/popup/CardPopup.tsx @@ -184,6 +184,7 @@ export function Card(props: CardProps) { panelAlignment={ToolbarPanelAlignment.Start} items={props.items} useDragInteraction={true} + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting={ToolbarOpacitySetting.Transparent} onItemExecuted={props.onItemExecuted} /> diff --git a/ui/appui-react/src/appui-react/popup/ToolbarPopup.tsx b/ui/appui-react/src/appui-react/popup/ToolbarPopup.tsx index 5354c8d174d..7132dd575c4 100644 --- a/ui/appui-react/src/appui-react/popup/ToolbarPopup.tsx +++ b/ui/appui-react/src/appui-react/popup/ToolbarPopup.tsx @@ -121,6 +121,7 @@ export class ToolbarPopup extends React.PureComponent< panelAlignment={ToolbarPanelAlignment.Start} items={this.props.items} useDragInteraction={true} + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting={ToolbarOpacitySetting.Defaults} onItemExecuted={this.props.onItemExecuted} /> diff --git a/ui/appui-react/src/appui-react/theme/ThemeId.ts b/ui/appui-react/src/appui-react/theme/ThemeId.ts index ff836c5cc4c..76f4e7f3e7b 100644 --- a/ui/appui-react/src/appui-react/theme/ThemeId.ts +++ b/ui/appui-react/src/appui-react/theme/ThemeId.ts @@ -38,11 +38,13 @@ export enum ColorTheme { export type ThemeId = `${ColorTheme}` | (string & {}); /** The default widget opacity. + * @deprecated in 5.35.0. Use the default configuration. * @public */ -export const WIDGET_OPACITY_DEFAULT = 0.9; +export const WIDGET_OPACITY_DEFAULT = 1; /** The default widget opacity. + * @deprecated in 5.35.0. Use the default configuration. * @public */ export const TOOLBAR_OPACITY_DEFAULT = 0.5; diff --git a/ui/appui-react/src/appui-react/toolbar/Toolbar.tsx b/ui/appui-react/src/appui-react/toolbar/Toolbar.tsx index b8d993299fe..021aa4b8d66 100644 --- a/ui/appui-react/src/appui-react/toolbar/Toolbar.tsx +++ b/ui/appui-react/src/appui-react/toolbar/Toolbar.tsx @@ -38,7 +38,10 @@ export interface ToolbarProps extends CommonProps, NoChildrenProps { panelAlignment?: ToolbarPanelAlignment; /** Use drag interaction to open popups with nested toolbar buttons. */ useDragInteraction?: boolean; - /** Determines whether to use mouse proximity to alter the opacity of the toolbar */ + /** Determines whether to use mouse proximity to alter the opacity of the toolbar. + * @deprecated in 5.35.0. Use the default configuration. + */ + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution */ onItemExecuted?: OnItemExecutedFunc; diff --git a/ui/appui-react/src/appui-react/toolbar/ToolbarComposer.tsx b/ui/appui-react/src/appui-react/toolbar/ToolbarComposer.tsx index 568b72ad53a..fda3ad7e277 100644 --- a/ui/appui-react/src/appui-react/toolbar/ToolbarComposer.tsx +++ b/ui/appui-react/src/appui-react/toolbar/ToolbarComposer.tsx @@ -173,11 +173,13 @@ const useProximityOpacitySetting = () => { const useSnapWidgetOpacitySetting = () => { const [snapWidgetOpacity, setSnapWidgetOpacity] = React.useState( + // eslint-disable-next-line @typescript-eslint/no-deprecated UiFramework.visibility.snapWidgetOpacity ); React.useEffect(() => { UiFramework.onUiVisibilityChanged.addListener(() => + // eslint-disable-next-line @typescript-eslint/no-deprecated setSnapWidgetOpacity(UiFramework.visibility.snapWidgetOpacity) ); }, []); @@ -245,11 +247,14 @@ export function ToolbarComposer(props: ExtensibleToolbarProps) { panelAlignment={panelAlignment} items={items} useDragInteraction={isDragEnabled} + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting={ (useProximityOpacity || snapWidgetOpacity) && !ProcessDetector.isMobileBrowser - ? ToolbarOpacitySetting.Proximity - : ToolbarOpacitySetting.Defaults + ? // eslint-disable-next-line @typescript-eslint/no-deprecated + ToolbarOpacitySetting.Proximity + : // eslint-disable-next-line @typescript-eslint/no-deprecated + ToolbarOpacitySetting.Defaults } /> ); diff --git a/ui/appui-react/src/appui-react/toolbar/ToolbarWithOverflow.tsx b/ui/appui-react/src/appui-react/toolbar/ToolbarWithOverflow.tsx index e40940a339e..64c57789853 100644 --- a/ui/appui-react/src/appui-react/toolbar/ToolbarWithOverflow.tsx +++ b/ui/appui-react/src/appui-react/toolbar/ToolbarWithOverflow.tsx @@ -32,7 +32,10 @@ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps { panelAlignment?: ToolbarPanelAlignment; /** Use Drag Interaction to open popups with nest action buttons */ useDragInteraction?: boolean; - /** Determines whether to use mouse proximity to alter the opacity of the toolbar */ + /** Determines whether to use mouse proximity to alter the opacity of the toolbar. + * @deprecated in 5.35.0. Use the default configuration. + */ + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution */ onItemExecuted?: OnItemExecutedFunc; diff --git a/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.scss b/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.scss index 6622ccfc06b..65b7f654aad 100644 --- a/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.scss +++ b/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.scss @@ -15,12 +15,7 @@ // TODO: fixes an issues on Safari where borders and backgrounds are overlapped by the viewport. position: relative; - @supports (backdrop-filter: blur(5px)) { - background-color: hsl( - var(--iui-color-background-hsl) / var(--iui-opacity-2) - ); - backdrop-filter: blur(5px); - } + background-color: var(--iui-color-background); &.uifw-vertical { flex-direction: column; diff --git a/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.tsx b/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.tsx index 0a8d4ba0cb2..aaa36a1cca5 100644 --- a/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.tsx +++ b/ui/appui-react/src/appui-react/toolbar/new-toolbars/Surface.tsx @@ -38,6 +38,7 @@ export const Surface = React.forwardRef( const calculateOpacity = useConditionalValue(() => { if (ProcessDetector.isMobileBrowser) return false; + // eslint-disable-next-line @typescript-eslint/no-deprecated if (UiFramework.visibility.snapWidgetOpacity) return true; return false; }, [SyncUiEventId.ShowHideManagerSettingChange]); diff --git a/ui/appui-react/src/appui-react/uistate/AppUiSettings.ts b/ui/appui-react/src/appui-react/uistate/AppUiSettings.ts index 7c1773af12e..6b3b36af8f5 100644 --- a/ui/appui-react/src/appui-react/uistate/AppUiSettings.ts +++ b/ui/appui-react/src/appui-react/uistate/AppUiSettings.ts @@ -24,12 +24,14 @@ import { ConfigurableUiActionId } from "../redux/ConfigurableUiState.js"; export interface InitialAppUiSettings { colorTheme: ThemeId; dragInteraction: boolean; + /** @deprecated in 5.35.0. Use the default configuration. */ widgetOpacity: number; showWidgetIcon?: boolean; /** @alpha */ autoCollapseUnpinnedPanels?: boolean; animateToolSettings?: boolean; useToolAsToolSettingsLabel?: boolean; + /** @deprecated in 5.35.0. Use the default configuration. */ toolbarOpacity: number; } @@ -51,6 +53,11 @@ export class AppUiSettings implements UserSettingsProvider { private _settings: Array> = []; private _applyingLocalSettings = false; + /** Bump this to invalidate stored settings. */ + private static _currentVersion = 1; + private _storedVersion = 0; + private _version: UiStateEntry; + public colorTheme: UiStateEntry; public dragInteraction: UiStateEntry; public widgetOpacity: UiStateEntry; @@ -67,6 +74,16 @@ export class AppUiSettings implements UserSettingsProvider { }; constructor(defaults: Partial) { + this._version = new UiStateEntry( + AppUiSettings._settingNamespace, + "_version", + () => AppUiSettings._currentVersion, + (value: number) => { + this._storedVersion = value; + }, + 0 + ); + this._settings = []; this.colorTheme = new UiStateEntry( @@ -186,6 +203,16 @@ export class AppUiSettings implements UserSettingsProvider { public async apply(storage: UiStateStorage): Promise { this._applyingLocalSettings = true; + + // Invalidate previously stored settings if the persisted version is outdated. + await this._version.getSettingAndApplyValue(storage); + if (this._storedVersion !== AppUiSettings._currentVersion) { + for (const setting of this._settings) { + await setting.deleteSetting(storage); + } + await this._version.saveSetting(storage); + } + for (const setting of this._settings) { await setting.getSettingAndApplyValue(storage); } diff --git a/ui/appui-react/src/appui-react/widgets/NavigationWidgetComposer.tsx b/ui/appui-react/src/appui-react/widgets/NavigationWidgetComposer.tsx index a7cfcb18513..1d990c2cb76 100644 --- a/ui/appui-react/src/appui-react/widgets/NavigationWidgetComposer.tsx +++ b/ui/appui-react/src/appui-react/widgets/NavigationWidgetComposer.tsx @@ -152,6 +152,7 @@ export function NavigationAidHost(props: NavigationAidHostProps) { if ( (UiFramework.visibility.useProximityOpacity || // eslint-disable-line @typescript-eslint/no-deprecated + // eslint-disable-next-line @typescript-eslint/no-deprecated UiFramework.visibility.snapWidgetOpacity) && !ProcessDetector.isMobileBrowser ) { @@ -232,6 +233,7 @@ export function NavigationWidgetComposer(props: NavigationWidgetComposerProps) { const [elementSet] = React.useState(new WidgetElementSet()); const proximityScale = useProximityToMouse( elementSet, + // eslint-disable-next-line @typescript-eslint/no-deprecated UiFramework.visibility.snapWidgetOpacity ); const uiIsVisible = useUiVisibility(); diff --git a/ui/appui-react/src/appui-react/widgets/ToolWidgetComposer.tsx b/ui/appui-react/src/appui-react/widgets/ToolWidgetComposer.tsx index 72d694883b5..47bd1845b1f 100644 --- a/ui/appui-react/src/appui-react/widgets/ToolWidgetComposer.tsx +++ b/ui/appui-react/src/appui-react/widgets/ToolWidgetComposer.tsx @@ -44,6 +44,7 @@ export function ToolWidgetComposer(props: ToolWidgetComposerProps) { const [elementSet] = React.useState(new WidgetElementSet()); const proximityScale = useProximityToMouse( elementSet, + // eslint-disable-next-line @typescript-eslint/no-deprecated UiFramework.visibility.snapWidgetOpacity ); const uiIsVisible = useUiVisibility(); diff --git a/ui/appui-react/src/test/settings/UiSettingsPage.test.tsx b/ui/appui-react/src/test/settings/UiSettingsPage.test.tsx index 60bb2d45cb4..4d0c197d130 100644 --- a/ui/appui-react/src/test/settings/UiSettingsPage.test.tsx +++ b/ui/appui-react/src/test/settings/UiSettingsPage.test.tsx @@ -86,8 +86,8 @@ describe("UiSettingsPage", () => { const wrapper = render(); const thumb = wrapper.getAllByRole("slider")[1]; - expect(UiFramework.getWidgetOpacity()).toEqual(0.9); - expect(thumb.getAttribute("aria-valuenow")).toEqual("0.9"); + expect(UiFramework.getWidgetOpacity()).toEqual(1); + expect(thumb.getAttribute("aria-valuenow")).toEqual("1"); act(() => { UiFramework.setWidgetOpacity(0.5); diff --git a/ui/components-react/src/components-react/toolbar/InternalToolbarComponent.tsx b/ui/components-react/src/components-react/toolbar/InternalToolbarComponent.tsx index 9a470bb48d3..94a2373430b 100644 --- a/ui/components-react/src/components-react/toolbar/InternalToolbarComponent.tsx +++ b/ui/components-react/src/components-react/toolbar/InternalToolbarComponent.tsx @@ -109,6 +109,7 @@ export enum ToolbarPanelAlignment { } /** Enumeration of Toolbar Opacity setting. + * @deprecated in 5.35.0. Use the default configuration. * @public */ export enum ToolbarOpacitySetting { @@ -148,6 +149,7 @@ export interface ToolbarOverflowContextProps { readonly overflowDirection: OrthogonalDirection; readonly panelAlignment: ToolbarPanelAlignment; readonly useDragInteraction: boolean; + // eslint-disable-next-line @typescript-eslint/no-deprecated readonly toolbarOpacitySetting: ToolbarOpacitySetting; readonly openPopupCount: number; readonly onPopupPanelOpenClose: (isOpening: boolean) => void; @@ -168,6 +170,7 @@ export const ToolbarWithOverflowDirectionContext = overflowDirection: OrthogonalDirection.Vertical, panelAlignment: ToolbarPanelAlignment.Start, useDragInteraction: false, + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting: ToolbarOpacitySetting.Proximity, openPopupCount: 0, onPopupPanelOpenClose: (_isOpening: boolean) => {}, @@ -426,6 +429,7 @@ export interface InternalToolbarComponentProps /** Use Drag Interaction to open popups with nest action buttons. */ useDragInteraction?: boolean; /** Determines whether to use mouse proximity to alter the opacity of the toolbar. */ + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution. */ onItemExecuted?: OnItemExecutedFunc; @@ -622,6 +626,7 @@ export function InternalToolbarComponent(props: InternalToolbarComponentProps) { panelAlignment, useDragInteraction, toolbarOpacitySetting: + // eslint-disable-next-line @typescript-eslint/no-deprecated props.toolbarOpacitySetting ?? ToolbarOpacitySetting.Proximity, overflowDirection: direction === OrthogonalDirection.Horizontal diff --git a/ui/components-react/src/components-react/toolbar/Items.tsx b/ui/components-react/src/components-react/toolbar/Items.tsx index 587f52dc673..3be50c7c12c 100644 --- a/ui/components-react/src/components-react/toolbar/Items.tsx +++ b/ui/components-react/src/components-react/toolbar/Items.tsx @@ -46,6 +46,7 @@ export function ToolbarItems(props: ToolbarItemsProps) { const { toolbarOpacitySetting, openPopupCount, overflowDisplayActive } = useToolbarWithOverflowDirectionContext(); const useTransparentBackground = + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Transparent; let toolbarOpacity = useTransparentBackground @@ -62,11 +63,13 @@ export function ToolbarItems(props: ToolbarItemsProps) { ? 0 : TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT; let showSeparators = + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Transparent ? false : true; const { ref, proximityScale } = useWidgetOpacityContext(); if ( + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Proximity && openPopupCount < 1 && !overflowDisplayActive diff --git a/ui/components-react/src/components-react/toolbar/OverflowPanel.tsx b/ui/components-react/src/components-react/toolbar/OverflowPanel.tsx index 3e7f987ed93..44d69ced24f 100644 --- a/ui/components-react/src/components-react/toolbar/OverflowPanel.tsx +++ b/ui/components-react/src/components-react/toolbar/OverflowPanel.tsx @@ -56,6 +56,7 @@ export function ToolbarOverflowPanel(props: ToolbarOverflowPanelProps) { const { proximityScale } = useWidgetOpacityContext(); const useTransparentBackground = + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Transparent; let toolbarOpacity = useTransparentBackground ? 0 : TOOLBAR_OPACITY_DEFAULT; let boxShadowOpacity = useTransparentBackground @@ -65,9 +66,11 @@ export function ToolbarOverflowPanel(props: ToolbarOverflowPanelProps) { ? 0 : TOOLBAR_BACKDROP_FILTER_BLUR_DEFAULT; let showSeparators = + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Transparent ? false : true; if ( + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting === ToolbarOpacitySetting.Proximity && openPopupCount < 1 && !overflowDisplayActive diff --git a/ui/components-react/src/components-react/toolbar/Toolbar.tsx b/ui/components-react/src/components-react/toolbar/Toolbar.tsx index 034a43ccef7..d1d40368c80 100644 --- a/ui/components-react/src/components-react/toolbar/Toolbar.tsx +++ b/ui/components-react/src/components-react/toolbar/Toolbar.tsx @@ -35,6 +35,7 @@ export interface ToolbarProps extends CommonProps, NoChildrenProps { /** Use Drag Interaction to open popups with nest action buttons */ useDragInteraction?: boolean; /** Determines whether to use mouse proximity to alter the opacity of the toolbar */ + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution */ onItemExecuted?: OnItemExecutedFunc; diff --git a/ui/components-react/src/components-react/toolbar/ToolbarWithOverflow.tsx b/ui/components-react/src/components-react/toolbar/ToolbarWithOverflow.tsx index c28bca3a03a..a1203d2753a 100644 --- a/ui/components-react/src/components-react/toolbar/ToolbarWithOverflow.tsx +++ b/ui/components-react/src/components-react/toolbar/ToolbarWithOverflow.tsx @@ -37,6 +37,7 @@ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps { /** Use Drag Interaction to open popups with nest action buttons */ useDragInteraction?: boolean; /** Determines whether to use mouse proximity to alter the opacity of the toolbar */ + // eslint-disable-next-line @typescript-eslint/no-deprecated toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution */ onItemExecuted?: OnItemExecutedFunc; diff --git a/ui/core-react/src/core-react/layout-variables.scss b/ui/core-react/src/core-react/layout-variables.scss index 7859201434b..b83b15efb1f 100644 --- a/ui/core-react/src/core-react/layout-variables.scss +++ b/ui/core-react/src/core-react/layout-variables.scss @@ -6,7 +6,7 @@ :root { /** Default Widget Opacity */ - --buic-widget-opacity: 0.9; + --buic-widget-opacity: 1; /** Default Toolbar Opacity */ --buic-toolbar-opacity: 0.5;