diff --git a/components/Figure/Figure.styled.ts b/components/Figure/Figure.styled.ts index 7c11f9fd..52b9c65f 100644 --- a/components/Figure/Figure.styled.ts +++ b/components/Figure/Figure.styled.ts @@ -88,7 +88,7 @@ const FigureSupplementalInfo = styled("span", { const FigureTitle = styled("span", { marginTop: "$gr3", - fontSize: "$gr3", + fontSize: "$gr4", fontFamily: "$northwesternSansRegular", color: "$purple", display: "flex", @@ -120,12 +120,11 @@ const FigureStyled = styled("figure", { paddingBottom: "$gr3", [`& ${FigureTitle}`]: { - fontSize: "$5", - fontFamily: "$northwesternDisplayBook", + fontFamily: "$northwesternSansBold", }, [`& ${FigureSupplementalInfo}`]: { - fontSize: "$2", + fontSize: "$gr2", }, }, }, diff --git a/components/Heading/Heading.styled.ts b/components/Heading/Heading.styled.ts index 123e4b7c..bdc37e2c 100644 --- a/components/Heading/Heading.styled.ts +++ b/components/Heading/Heading.styled.ts @@ -45,10 +45,11 @@ const StyledHeading = styled("h2", { "&[data-level=h3]": { color: "$black50", - fontFamily: "$northwesternSansLight", fontSize: "$gr6", fontWeight: "400", marginBottom: "$gr3", + fontFamily: "$northwesternDisplayRegular", + paddingTop: "0.2em", }, "&[data-level=h4]": { diff --git a/components/Shared/Card.styled.ts b/components/Shared/Card.styled.ts index 65cd2b05..3b1dbbfb 100644 --- a/components/Shared/Card.styled.ts +++ b/components/Shared/Card.styled.ts @@ -18,6 +18,7 @@ const CardStyled = styled("div", { fontFamily: "$northwesternSansRegular", fontSize: "$gr3", lineHeight: "1.47em", + color: "$black50", a: { cursor: "pointer", diff --git a/components/Shared/Card.tsx b/components/Shared/Card.tsx index 717d13d6..a711013f 100644 --- a/components/Shared/Card.tsx +++ b/components/Shared/Card.tsx @@ -1,4 +1,5 @@ import React, { ReactNode } from "react"; + import { CardStyled } from "@/components/Shared/Card.styled"; import Figure from "@/components/Figure/Figure"; import Link from "next/link"; diff --git a/components/Shared/Dialog.styled.ts b/components/Shared/Dialog.styled.ts index 69c30622..a54858ef 100644 --- a/components/Shared/Dialog.styled.ts +++ b/components/Shared/Dialog.styled.ts @@ -29,7 +29,7 @@ const DialogBody = styled("div", { maxHeight: "calc(100% - 3.5rem)", minHeight: "calc(100% - 3.5rem)", overflow: "scroll", - padding: "0 $gr3 $gr3", + padding: "$gr3 $gr4 $gr4", "&:before": { position: "absolute", @@ -44,7 +44,7 @@ const DialogBody = styled("div", { const DialogHeader = styled("header", { position: "absolute", top: "0", - padding: "1rem", + padding: "$gr4", display: "flex", width: "100%", justifyContent: "space-between", diff --git a/components/Shared/IIIF/ContentState.styled.tsx b/components/Shared/IIIF/ContentState.styled.tsx index 1ab2048f..a8f15919 100644 --- a/components/Shared/IIIF/ContentState.styled.tsx +++ b/components/Shared/IIIF/ContentState.styled.tsx @@ -64,21 +64,27 @@ const StyledIIIFContentStateOptions = styled("div", { display: "flex", flexDirection: "column", gap: "$gr1", - padding: "$gr1 $gr2", label: { - display: "inline-flex", - fontSize: "$gr2", + fontSize: "$gr3", gap: "$gr1", alignItems: "center", + whiteSpace: "nowrap", em: { color: "$black50", fontStyle: "normal", fontFamily: "$northwesternSansBold", + whiteSpace: "nowrap", + textOverflow: "ellipsis", + overflow: "hidden", }, }, + input: { + marginRight: "$gr1", + }, + textarea: { height: "$gr6 !important", border: "1px solid $black20", @@ -91,9 +97,35 @@ const StyledIIIFContentStateActiveFile = styled("div", { display: "flex", alignItems: "center", fontFamily: "$northwesternSansBold", + gap: "$gr2", + fontSize: "$gr3", + padding: "0 0 $gr2", - em: { - marginRight: "$gr1", + div: { + display: "flex", + flexDirection: "column", + overflow: "hidden", + gap: "$gr1", + + span: { + textOverflow: "ellipsis", + overflow: "hidden", + whiteSpace: "nowrap", + + "&:last-child": { + color: "$black50", + fontSize: "$gr2", + fontFamily: "$northwesternSansRegular", + }, + }, + }, + + img: { + objectFit: "cover", + borderRadius: "2px", + marginTop: "-2px", + color: "transparent", + backgroundColor: "rgba(0, 0, 0, 0.1)", }, }); diff --git a/components/Shared/IIIF/ContentState.tsx b/components/Shared/IIIF/ContentState.tsx index f17bab80..9abc5b4e 100644 --- a/components/Shared/IIIF/ContentState.tsx +++ b/components/Shared/IIIF/ContentState.tsx @@ -6,7 +6,7 @@ import { StyledIIIFContentStateOptions, StyledIIIFContentStateURI, } from "./ContentState.styled"; -import { useRef, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import ActionsDialogAside from "@/components/Work/ActionsDialog/Aside"; import { ActionsDialogStyled } from "@/components/Work/ActionsDialog/ActionsDialog.styled"; @@ -46,7 +46,7 @@ const IIIFContentState: React.FC = ({ ); const activeCanvasThumbnail = activeCanvas?.thumbnail?.[0]?.id; - const canvasCount = manifest?.items?.length; + const canvasCount = Number(manifest?.items?.length); const canvasIndex = Number(manifest?.items?.findIndex((item) => item.id === activeCanvasId)) + 1; @@ -56,6 +56,7 @@ const IIIFContentState: React.FC = ({ activeCanvas?.items?.[0]?.items?.[0]?.body?.type; const title = "Share"; + const currentFileLabel = `${canvasIndex} of ${canvasCount}`; function handleClick() { setIsOpen(true); @@ -66,7 +67,11 @@ const IIIFContentState: React.FC = ({ } const uri = new URL(window.location.href); - uri.searchParams.set("iiif-content", encodeContentState(contentState)); + + // set the iiif-content query param to the current content state + if (isCurrentFileset) + uri.searchParams.set("iiif-content", encodeContentState(contentState)); + const shareUrl = uri.toString(); function handleIsCurrentFileSetChange( @@ -77,8 +82,14 @@ const IIIFContentState: React.FC = ({ function handleIsNoteChange(event: React.ChangeEvent) { setIsNote(event.target.checked); + // focus on the note textarea + if (event.target.checked) noteRef.current?.focus(); } + useEffect(() => { + if (isNote) noteRef.current?.focus(); + }, [isNote]); + return ( @@ -94,20 +105,45 @@ const IIIFContentState: React.FC = ({ {work && ( - {work.title && work.thumbnail && ( - - )} +
+ + Currently viewing file {currentFileLabel} + + + +
+
+
+
- Current Item + Link @@ -119,44 +155,23 @@ const IIIFContentState: React.FC = ({ type="checkbox" onChange={handleIsCurrentFileSetChange} /> - Share active file - - - {canvasIndex} of {canvasCount} - - Thumbnail of the active canvas - + Jump to current file{" "} + ({currentFileLabel}) - {isCurrentFileset ? ( - ["Video", "Audio"].includes(activeCanvasResourceType) ? ( - - ) : ( - - ) - ) : null} - + {["Video", "Audio"].includes(activeCanvasResourceType) ? ( + + ) : ( + + )}