From f49c89c99b961425ef12302edbe6b884b151d760 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Thu, 14 Nov 2024 15:55:53 +0100 Subject: [PATCH] [web] Changes to recompile button in Bootstrap 5 (#21586) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Story for `PdfCompileButton` * Set the CompileButton height so it's similar to BS3 * Add the CompileButton animations * Remove `sm` from CompileButton: makes font size bigger * Use MaterialIcon in compile-button dropdown-toggle * Use MaterialIcon in LayoutDropdown * Fix stripe alignment on Recompile button * Set padding around dropdown caret Per Alexandru's instructions * Prevent border from disappearing on hover * Set the padding of the compile button even on both sides Before: left 12px, right 16px; After: left 16px, right 16px; * Change px values to spacing var * Add some button classes for BS5 only * Don't render the hidden "Compiling…" in BS5, it changes the button width * Prevent `loading="[object Object]"` in the DOM Co-authored-by: Rebeka --------- Co-authored-by: Rebeka GitOrigin-RevId: 34f1eed03e63f3459243a37c878612a623f321f8 --- .../components/layout-dropdown-button.tsx | 3 +- .../components/detach-compile-button.tsx | 13 +++-- .../components/pdf-compile-button.tsx | 24 +++++--- .../components/bootstrap-5/dropdown-menu.tsx | 16 ++++++ .../editor/pdf-compile-button.stories.tsx | 56 +++++++++++++++++++ .../bootstrap-5/components/dropdown-menu.scss | 15 +++++ .../pages/editor/compile-button.scss | 40 +++++++++++++ .../bootstrap-5/pages/editor/pdf.scss | 11 ++++ 8 files changed, 164 insertions(+), 14 deletions(-) create mode 100644 services/web/frontend/stories/editor/pdf-compile-button.stories.tsx diff --git a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx index b580fa5cf8..2a41641df4 100644 --- a/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx +++ b/services/web/frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button.tsx @@ -10,6 +10,7 @@ import { DropdownItem, DropdownMenu, DropdownToggle, + DropdownToggleCustom, } from '@/features/ui/components/bootstrap-5/dropdown-menu' import { Trans, useTranslation } from 'react-i18next' import Tooltip from '../../../shared/components/tooltip' @@ -136,7 +137,7 @@ const LayoutDropdownToggleButton = forwardRef< onClick(e) } - return