diff --git a/src/components/component-view/component-view.js b/src/components/component-view/component-view.js index aab091685c..9de781d47f 100644 --- a/src/components/component-view/component-view.js +++ b/src/components/component-view/component-view.js @@ -40,28 +40,28 @@ function ComponentView({ const { viewer, accordionLabel, accordionSrLabel } = viewerData; - const ICON_EXTERNAL = { - icon: "sprites.svg#it-external-link", + const ICON_INFO = { + icon: "sprites.svg#it-info-circle", size: "sm", - color: "primary", - addonClasses: "align-middle me-4 mb-1", + color: "white", + addonClasses: "align-middle", ariaLabel: " (Link esterno)", }; const ICON_COPY_CODE = { icon: "sprites.svg#it-copy", size: "sm", - color: "primary", - addonClasses: "align-middle me-4 mb-1 mt-1", + color: "white", + addonClasses: "align-middle", ariaLabel: " Copia il codice negli appunti", }; const ICON_FULLSCREEN = { - icon: "sprites.svg#it-fullscreen", + icon: "sprites.svg#it-external-link", size: "sm", - color: "primary", - addonClasses: "align-middle me-4 mb-1", - ariaLabel: " Mostra in una finestra dedicata", + color: "white", + addonClasses: "align-middle", + ariaLabel: " Apri l'anteprima in una nuova finestra", }; const ICON_SUCCESS = { @@ -129,10 +129,10 @@ function ComponentView({ const collId = `${uuid}-collapse`; const [wrappedCode, setWrappedCode] = useState(false); - const [previewWidth, setPreviewWidth] = useState(" viewer-desktop"); + const [previewWidth, setPreviewWidth] = useState(" viewer-full"); const changeResolution = (e) => { e.preventDefault(); - const res = e.target.textContent; // mobile, tablet, desktop + const res = e.target.textContent; // mobile, tablet, full setPreviewWidth(` viewer-${res}`); }; @@ -147,9 +147,18 @@ function ComponentView({ )); } - const componentStyles = classNames( - "border-bottom d-flex flex-column align-items-center", - { "pb-4": responsiveButtonsItems }, + const componentStyles = classNames("d-flex flex-column align-items-center", { + "me-lg-4 me-xl-5": componentViewerData?.variants, + }); + + const accordionHeadingStyle = + "d-flex justify-content-between align-items-center"; + + const accordionContainerStyle = classNames( + "accordion accordion-left-icon py-2 border-bottom-0", + { + "me-lg-4 me-xl-5": componentViewerData?.variants, + }, ); const accordionStyle = classNames("accordion-collapse collapse", { @@ -159,7 +168,9 @@ function ComponentView({ const accordionButtonStyle = classNames( "accordion-button border-top-0 collapsed", - { collapsed: accordionOpen }, + { + collapsed: accordionOpen, + }, ); const BSIExampleUrl = `/examples/${source}/${slugify( @@ -170,35 +181,46 @@ function ComponentView({
{contentTrimmed && (
- Inizio componente: +
+ {responsiveButtonsItems && ( +
+ {viewer.responsiveLabel && ( + {viewer.responsiveLabel} + )} +
+ {responsiveButtonsItems} +
+
+ )} +
+ + + +
+
+ Inizio anteprima: