docs: design polish (#8696)

* polish

* finish polish

* change typography
This commit is contained in:
Shahed Nasser
2024-08-21 20:04:43 +02:00
committed by GitHub
parent a3c311126e
commit b6f990c017
25 changed files with 329 additions and 190 deletions
@@ -6,13 +6,11 @@ import { CheckMini, SquareTwoStack } from "@medusajs/icons"
export type CodeBlockCopyActionProps = { export type CodeBlockCopyActionProps = {
source: string source: string
inHeader: boolean inHeader: boolean
iconColor: string
} }
export const CodeBlockCopyAction = ({ export const CodeBlockCopyAction = ({
source, source,
inHeader, inHeader,
iconColor,
}: CodeBlockCopyActionProps) => { }: CodeBlockCopyActionProps) => {
const [copied, setCopied] = useState(false) const [copied, setCopied] = useState(false)
@@ -24,16 +22,27 @@ export const CodeBlockCopyAction = ({
} }
}, [copied]) }, [copied])
const iconClassName = [
"text-medusa-contrast-fg-secondary",
"group-hover:text-medusa-contrast-fg-primary",
"group-focus:text-medusa-contrast-fg-primary",
]
return ( return (
<CopyButton <CopyButton
text={source} text={source}
tooltipClassName="font-base" tooltipClassName="font-base"
className={clsx("h-fit", !inHeader && "p-[6px]", inHeader && "p-[4.5px]")} className={clsx("group")}
tooltipInnerClassName={clsx(inHeader && "flex")} buttonClassName={clsx(!inHeader && "p-[6px]", inHeader && "p-[4.5px]")}
tooltipInnerClassName={clsx(
inHeader && "flex",
"h-fit rounded-docs_sm",
"group-hover:bg-medusa-contrast-bg-base-hover group-focus:bg-medusa-contrast-bg-base-hover"
)}
onCopy={() => setCopied(true)} onCopy={() => setCopied(true)}
> >
{!copied && <SquareTwoStack className={clsx(iconColor)} />} {!copied && <SquareTwoStack className={clsx(iconClassName)} />}
{copied && <CheckMini className={clsx(iconColor)} />} {copied && <CheckMini className={clsx(iconClassName)} />}
</CopyButton> </CopyButton>
) )
} }
@@ -1,10 +1,9 @@
"use client" "use client"
import clsx from "clsx" import clsx from "clsx"
import React, { useMemo } from "react" import React from "react"
import { CodeBlockStyle, Link, Tooltip } from "@/components" import { Link, Tooltip } from "@/components"
import { ExclamationCircle, PlaySolid } from "@medusajs/icons" import { ExclamationCircle, PlaySolid } from "@medusajs/icons"
import { useColorMode } from "@/providers"
import { GITHUB_ISSUES_PREFIX } from "@/constants" import { GITHUB_ISSUES_PREFIX } from "@/constants"
import { CodeBlockCopyAction } from "./Copy" import { CodeBlockCopyAction } from "./Copy"
@@ -16,7 +15,6 @@ export type CodeBlockActionsProps = {
inInnerCode?: boolean inInnerCode?: boolean
isCollapsed: boolean isCollapsed: boolean
canShowApiTesting?: boolean canShowApiTesting?: boolean
blockStyle: CodeBlockStyle
onApiTesting: React.Dispatch<React.SetStateAction<boolean>> onApiTesting: React.Dispatch<React.SetStateAction<boolean>>
noReport?: boolean noReport?: boolean
noCopy?: boolean noCopy?: boolean
@@ -30,23 +28,15 @@ export const CodeBlockActions = ({
isCollapsed, isCollapsed,
isSingleLine = false, isSingleLine = false,
canShowApiTesting = false, canShowApiTesting = false,
blockStyle,
onApiTesting, onApiTesting,
noReport = false, noReport = false,
noCopy = false, noCopy = false,
}: CodeBlockActionsProps) => { }: CodeBlockActionsProps) => {
const { colorMode } = useColorMode() const iconClassName = [
const iconColor = useMemo( "text-medusa-contrast-fg-secondary",
() => "group-hover:text-medusa-contrast-fg-primary",
clsx( "group-focus:text-medusa-contrast-fg-primary",
blockStyle === "loud" && "text-medusa-contrast-fg-secondary", ]
blockStyle === "subtle" && [
colorMode === "light" && "text-medusa-fg-muted",
colorMode === "dark" && "text-medusa-fg-secondary",
]
),
[blockStyle, colorMode]
)
return ( return (
<div <div
@@ -88,29 +78,35 @@ export const CodeBlockActions = ({
<Tooltip <Tooltip
text="Test API" text="Test API"
tooltipClassName="font-base" tooltipClassName="font-base"
className={clsx( className={clsx("group")}
"h-fit", innerClassName={clsx(
!inHeader && "p-[6px]", inHeader && "flex",
inHeader && "p-[4.5px]" "h-fit rounded-docs_sm",
"group-hover:bg-medusa-contrast-bg-base-hover group-focus:bg-medusa-contrast-bg-base-hover"
)} )}
innerClassName={clsx(inHeader && "flex")}
> >
<PlaySolid <span
className={clsx("cursor-pointer", iconColor)} className={clsx(
!inHeader && "p-[6px]",
inHeader && "p-[4.5px]",
"cursor-pointer"
)}
onClick={() => onApiTesting(true)} onClick={() => onApiTesting(true)}
/> >
<PlaySolid className={clsx(iconClassName)} />
</span>
</Tooltip> </Tooltip>
)} )}
{!noReport && ( {!noReport && (
<Tooltip <Tooltip
text="Report Issue" text="Report Issue"
tooltipClassName="font-base" tooltipClassName="font-base"
className={clsx( className={clsx("group")}
"h-fit", innerClassName={clsx(
!inHeader && "p-[6px]", inHeader && "flex",
inHeader && "p-[4.5px]" "h-fit rounded-docs_sm",
"group-hover:bg-medusa-contrast-bg-base-hover group-focus:bg-medusa-contrast-bg-base-hover"
)} )}
innerClassName={clsx(inHeader && "flex")}
> >
<Link <Link
href={`${GITHUB_ISSUES_PREFIX}&title=${encodeURIComponent( href={`${GITHUB_ISSUES_PREFIX}&title=${encodeURIComponent(
@@ -120,21 +116,17 @@ export const CodeBlockActions = ({
className={clsx( className={clsx(
"bg-transparent border-none cursor-pointer rounded", "bg-transparent border-none cursor-pointer rounded",
"[&:not(:first-child)]:ml-docs_0.5", "[&:not(:first-child)]:ml-docs_0.5",
"inline-flex justify-center items-center invisible xs:visible" "inline-flex justify-center items-center invisible xs:visible",
!inHeader && "p-[6px]",
inHeader && "p-[4.5px]"
)} )}
rel="noreferrer" rel="noreferrer"
> >
<ExclamationCircle className={clsx(iconColor)} /> <ExclamationCircle className={clsx(iconClassName)} />
</Link> </Link>
</Tooltip> </Tooltip>
)} )}
{!noCopy && ( {!noCopy && <CodeBlockCopyAction source={source} inHeader={inHeader} />}
<CodeBlockCopyAction
source={source}
inHeader={inHeader}
iconColor={iconColor}
/>
)}
</div> </div>
</div> </div>
) )
@@ -262,7 +262,6 @@ export const CodeBlock = ({
source, source,
canShowApiTesting, canShowApiTesting,
setShowTesting, setShowTesting,
blockStyle,
noReport, noReport,
noCopy, noCopy,
collapsibleType, collapsibleType,
@@ -0,0 +1,45 @@
import React from "react"
import type { LinkProps as NextLinkProps } from "next/link"
import Link from "next/link"
import clsx from "clsx"
type LinkButtonProps = NextLinkProps & {
variant?: "base" | "interactive" | "subtle" | "muted"
className?: string
} & React.AllHTMLAttributes<HTMLAnchorElement>
export const LinkButton = ({
variant = "base",
className,
...linkProps
}: LinkButtonProps) => {
return (
<Link
{...linkProps}
className={clsx(
className,
"inline-flex justify-center items-center",
"gap-docs_0.25 rounded-docs_xs",
"text-compact-small-plus disabled:text-medusa-fg-disabled",
"focus:shadow-borders-focus no-underline",
variant === "base" && [
"text-medusa-fg-base hover:text-medusa-fg-subtle",
"focus:text-medusa-fg-base",
],
variant === "interactive" && [
"text-medusa-fg-interactive hover:text-medusa-interactive-hover",
"focus:text-medusa-fg-interactive",
],
variant === "subtle" && [
"text-medusa-fg-subtle hover:text-medusa-fg-base",
"focus:text-medusa-fg-subtle",
],
variant === "muted" && [
"text-medusa-fg-muted hover:text-medusa-fg-subtle",
"focus:text-medusa-fg-muted",
]
)}
/>
)
}
@@ -1,7 +1,7 @@
"use client" "use client"
import React, { useMemo } from "react" import React, { useMemo } from "react"
import { CurrentItemsState, useSidebar } from "../../.." import { Button, CurrentItemsState, useSidebar } from "../../.."
import clsx from "clsx" import clsx from "clsx"
import Link from "next/link" import Link from "next/link"
import { SidebarItemLink } from "types" import { SidebarItemLink } from "types"
@@ -61,22 +61,19 @@ export const MainNavBreadcrumbs = () => {
return ( return (
<div <div
className={clsx( className={clsx(
"flex items-center", "flex items-center gap-docs_0.25",
"text-medusa-fg-muted text-compact-small" "text-medusa-fg-muted text-compact-small"
)} )}
> >
{Array.from(breadcrumbItems).map(([link, title]) => ( {Array.from(breadcrumbItems).map(([link, title]) => (
<React.Fragment key={link}> <React.Fragment key={link}>
<span>/</span> <span>/</span>
<Link <Button
href={link} variant="transparent-clear"
className={clsx( className="px-docs_0.5 py-docs_0.25"
"hover:text-medusa-fg-base transition-colors",
"px-docs_0.5 py-docs_0.25"
)}
> >
{title} <Link href={link}>{title}</Link>
</Link> </Button>
</React.Fragment> </React.Fragment>
))} ))}
</div> </div>
@@ -2,7 +2,7 @@
import React from "react" import React from "react"
import { useColorMode } from "../../../providers" import { useColorMode } from "../../../providers"
import { Button } from "../../.." import { Button, Tooltip } from "../../.."
import { Moon, Sun } from "@medusajs/icons" import { Moon, Sun } from "@medusajs/icons"
import clsx from "clsx" import clsx from "clsx"
@@ -10,13 +10,15 @@ export const MainNavColorMode = () => {
const { colorMode, toggleColorMode } = useColorMode() const { colorMode, toggleColorMode } = useColorMode()
return ( return (
<Button <Tooltip place="bottom" tooltipChildren="Change Theme">
variant="transparent-clear" <Button
className={clsx("!p-[6.5px] text-medusa-fg-muted")} variant="transparent-clear"
onClick={toggleColorMode} className={clsx("!p-[6.5px] text-medusa-fg-muted")}
> onClick={toggleColorMode}
{colorMode === "light" && <Sun />} >
{colorMode === "dark" && <Moon />} {colorMode === "light" && <Sun />}
</Button> {colorMode === "dark" && <Moon />}
</Button>
</Tooltip>
) )
} }
@@ -46,9 +46,9 @@ export const MainNavHelpButton = () => {
<div className="relative" ref={ref}> <div className="relative" ref={ref}>
<Tooltip <Tooltip
tooltipChildren={ tooltipChildren={
<span className="flex gap-[6px]"> <span className="flex gap-[6px] items-center">
<span>Need help?</span> <span>Need help?</span>
<Kbd>?</Kbd> <Kbd className="w-docs_1 h-docs_1">?</Kbd>
</span> </span>
} }
place="bottom" place="bottom"
@@ -56,7 +56,7 @@ export const MainNavHelpButton = () => {
> >
<Button <Button
variant="transparent-clear" variant="transparent-clear"
className="text-medusa-fg-muted" className="text-medusa-fg-muted !px-[6.5px] !py-[6.5px]"
onClick={() => setShowMenu((prev) => !prev)} onClick={() => setShowMenu((prev) => !prev)}
> >
<QuestionMark /> <QuestionMark />
@@ -9,11 +9,13 @@ import { MainNavigationDropdownIcon } from "../Icon"
export type MainNavigationDropdownSelectedProps = { export type MainNavigationDropdownSelectedProps = {
item: NavigationDropdownItem item: NavigationDropdownItem
onClick: () => void onClick: () => void
isActive: boolean
} }
export const MainNavigationDropdownSelected = ({ export const MainNavigationDropdownSelected = ({
item, item,
onClick, onClick,
isActive,
}: MainNavigationDropdownSelectedProps) => { }: MainNavigationDropdownSelectedProps) => {
if (item.type === "divider") { if (item.type === "divider") {
return <></> return <></>
@@ -22,15 +24,22 @@ export const MainNavigationDropdownSelected = ({
return ( return (
<div <div
className={clsx( className={clsx(
"flex justify-between items-center", "flex justify-between items-center gap-docs_0.25",
"cursor-pointer rounded-docs_sm hover:bg-medusa-bg-hover" "cursor-pointer rounded-docs_sm group"
)} )}
tabIndex={-1} tabIndex={-1}
onClick={onClick} onClick={onClick}
> >
<MainNavigationDropdownIcon icon={item.icon} /> <MainNavigationDropdownIcon icon={item.icon} />
<div className="flex gap-[6px] py-docs_0.25 px-docs_0.5 items-center"> <div
<span className="text-medusa-fg-base whitespace-nowrap flex-1"> className={clsx(
"flex gap-[6px] py-docs_0.25 px-docs_0.5",
"items-center group-hover:bg-medusa-button-transparent-hover",
"rounded-docs_sm",
isActive && "bg-medusa-button-transparent-hover"
)}
>
<span className="text-medusa-fg-base whitespace-nowrap flex-1 text-compact-small-plus">
{item.title} {item.title}
</span> </span>
<TrianglesMini className="text-medusa-fg-muted" /> <TrianglesMini className="text-medusa-fg-muted" />
@@ -34,6 +34,7 @@ export const MainNavigationDropdown = () => {
<MainNavigationDropdownSelected <MainNavigationDropdownSelected
item={selectedItem} item={selectedItem}
onClick={() => setMenuOpen((prev) => !prev)} onClick={() => setMenuOpen((prev) => !prev)}
isActive={menuOpen}
/> />
)} )}
<MainNavigationDropdownMenu <MainNavigationDropdownMenu
@@ -4,9 +4,14 @@ import clsx from "clsx"
import React from "react" import React from "react"
import { MainNavigationDropdown } from "./NavigationDropdown" import { MainNavigationDropdown } from "./NavigationDropdown"
import { MainNavBreadcrumbs } from "./Breadcrumb" import { MainNavBreadcrumbs } from "./Breadcrumb"
import { Button, SearchModalOpener, useMainNav, useSidebar } from "../.." import {
Button,
LinkButton,
SearchModalOpener,
useMainNav,
useSidebar,
} from "../.."
import { MainNavColorMode } from "./ColorMode" import { MainNavColorMode } from "./ColorMode"
import Link from "next/link"
import { MainNavDivider } from "./Divider" import { MainNavDivider } from "./Divider"
import { MainNavSidebarOpener } from "./SidebarOpener" import { MainNavSidebarOpener } from "./SidebarOpener"
import { MainNavHelpButton } from "./HelpButton" import { MainNavHelpButton } from "./HelpButton"
@@ -39,7 +44,9 @@ export const MainNav = () => {
<div className="flex items-center gap-docs_0.75"> <div className="flex items-center gap-docs_0.75">
<div className="flex items-center gap-[6px] text-medusa-fg-muted"> <div className="flex items-center gap-[6px] text-medusa-fg-muted">
{editDate && <MainNavEditDate date={editDate} />} {editDate && <MainNavEditDate date={editDate} />}
<Link href={reportIssueLink}>Report Issue</Link> <LinkButton href={reportIssueLink} variant="muted" target="_blank">
Report Issue
</LinkButton>
</div> </div>
<MainNavDivider /> <MainNavDivider />
<div className="flex items-center gap-docs_0.25"> <div className="flex items-center gap-docs_0.25">
@@ -10,25 +10,27 @@ export type MenuActionProps = {
export const MenuAction = ({ item }: MenuActionProps) => { export const MenuAction = ({ item }: MenuActionProps) => {
return ( return (
<span <div className="px-docs_0.25">
className={clsx( <span
"flex py-docs_0.25 px-docs_0.5", className={clsx(
"gap-docs_0.5 rounded-docs_xs", "flex py-docs_0.25 px-docs_0.5",
"hover:bg-medusa-bg-component-hover", "gap-docs_0.5 rounded-docs_xs",
"text-medusa-fg-base cursor-pointer" "hover:bg-medusa-bg-component-hover",
)} "text-medusa-fg-base cursor-pointer"
tabIndex={-1} )}
onClick={item.action} tabIndex={-1}
> onClick={item.action}
<span className="text-medusa-fg-subtle mt-[2.5px] block"> >
{item.icon} <span className="text-medusa-fg-subtle mt-[2.5px] block">
</span> {item.icon}
<span className="text-compact-small flex-1">{item.title}</span>
{item.shortcut && (
<span className="text-medusa-fg-subtle text-compact-small">
{item.shortcut}
</span> </span>
)} <span className="text-compact-small flex-1">{item.title}</span>
</span> {item.shortcut && (
<span className="text-medusa-fg-subtle text-compact-small">
{item.shortcut}
</span>
)}
</span>
</div>
) )
} }
@@ -3,5 +3,34 @@
import React from "react" import React from "react"
export const MenuDivider = () => { export const MenuDivider = () => {
return <hr className="bg-medusa-border-menu-top mt-[3px] mb-[3px]" /> return (
<svg
width="100%"
height="100%"
viewBox="0 0 205 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect
width="197"
height="8"
transform="translate(4)"
fill="var(--docs-bg-component)"
/>
<rect
x="-4"
y="3"
width="213"
height="1"
fill="var(--docs-border-menu-top)"
/>
<rect
x="-4"
y="4"
width="213"
height="1"
fill="var(--docs-border-menu-bot)"
/>
</svg>
)
} }
@@ -11,19 +11,21 @@ export type MenuItemProps = {
export const MenuItem = ({ item }: MenuItemProps) => { export const MenuItem = ({ item }: MenuItemProps) => {
return ( return (
<Link <div className="px-docs_0.25">
className={clsx( <Link
"flex py-docs_0.25 px-docs_0.5", className={clsx(
"gap-docs_0.5 rounded-docs_xs", "flex py-docs_0.25 px-docs_0.5",
"hover:bg-medusa-bg-component-hover", "gap-docs_0.5 rounded-docs_xs",
"text-medusa-fg-base" "hover:bg-medusa-bg-component-hover",
)} "text-medusa-fg-base"
href={item.link} )}
> href={item.link}
<span className="text-medusa-fg-subtle mt-[2.5px] block"> >
{item.icon} <span className="text-medusa-fg-subtle mt-[2.5px] block">
</span> {item.icon}
<span className="text-compact-small">{item.title}</span> </span>
</Link> <span className="text-compact-small">{item.title}</span>
</Link>
</div>
) )
} }
@@ -14,7 +14,7 @@ export const Menu = ({ items, className }: MenuProps) => {
return ( return (
<div <div
className={clsx( className={clsx(
"bg-medusa-bg-component p-docs_0.25 rounded-docs_DEFAULT", "bg-medusa-bg-component py-docs_0.25 rounded-docs_DEFAULT",
"shadow-elevation-flyout dark:shadow-elevation-flyout-dark", "shadow-elevation-flyout dark:shadow-elevation-flyout-dark",
className className
)} )}
@@ -21,7 +21,7 @@ export const PaginationCard = ({
return ( return (
<div <div
className={clsx( className={clsx(
"relative flex flex-1 gap-docs_0.75 items-center", "relative flex-1",
"py-docs_0.5 px-docs_0.75 rounded", "py-docs_0.5 px-docs_0.75 rounded",
"bg-medusa-bg-component hover:bg-medusa-bg-component-hover", "bg-medusa-bg-component hover:bg-medusa-bg-component-hover",
"shadow-elevation-card-rest dark:shadow-elevation-card-rest-dark", "shadow-elevation-card-rest dark:shadow-elevation-card-rest-dark",
@@ -30,28 +30,30 @@ export const PaginationCard = ({
)} )}
> >
<Link href={link} className="absolute top-0 left-0 w-full h-full" /> <Link href={link} className="absolute top-0 left-0 w-full h-full" />
{type === "previous" && ( <div className={clsx("h-[40px] flex gap-docs_0.75 items-center")}>
<TriangleLeftMini className="text-medusa-fg-muted" /> {type === "previous" && (
)} <TriangleLeftMini className="text-medusa-fg-muted" />
<div
className={clsx(
"flex-1",
type === "previous" && "text-left",
type === "next" && "text-right"
)} )}
> <div
{parentTitle && ( className={clsx(
<span className="block text-compact-small text-medusa-fg-subtle"> "flex-1",
{parentTitle} type === "previous" && "text-left",
type === "next" && "text-right"
)}
>
{parentTitle && (
<span className="block text-compact-small text-medusa-fg-subtle">
{parentTitle}
</span>
)}
<span className="block text-compact-small-plus text-medusa-fg-base">
{title}
</span> </span>
</div>
{type === "next" && (
<TriangleRightMini className="text-medusa-fg-muted" />
)} )}
<span className="block text-compact-small-plus text-medusa-fg-base">
{title}
</span>
</div> </div>
{type === "next" && (
<TriangleRightMini className="text-medusa-fg-muted" />
)}
</div> </div>
) )
} }
@@ -3,7 +3,7 @@
import React, { MouseEvent, useMemo } from "react" import React, { MouseEvent, useMemo } from "react"
import clsx from "clsx" import clsx from "clsx"
import { useMobile, useSearch } from "@/providers" import { useMobile, useSearch } from "@/providers"
import { Button } from "@/components" import { Button, Tooltip } from "@/components"
import { MagnifyingGlass } from "@medusajs/icons" import { MagnifyingGlass } from "@medusajs/icons"
import { useKeyboardShortcut } from "@/hooks" import { useKeyboardShortcut } from "@/hooks"
@@ -53,19 +53,21 @@ export const SearchModalOpener = ({
</Button> </Button>
)} )}
{!isMobile && ( {!isMobile && (
<Button <Tooltip place="bottom" tooltipChildren="Ask or search">
className={clsx( <Button
"relative hover:cursor-pointer group", className={clsx(
"flex gap-[6px] !py-docs_0.25 !px-docs_0.5", "relative hover:cursor-pointer group",
"justify-between items-center text-medusa-fg-muted", "flex gap-[6px] !py-docs_0.25 !px-docs_0.5",
className "justify-between items-center text-medusa-fg-muted",
)} className
variant="transparent-clear" )}
onClick={handleOpen} variant="transparent-clear"
> onClick={handleOpen}
<MagnifyingGlass /> >
<span>{isApple ? "⌘" : "Ctrl"}K</span> <MagnifyingGlass />
</Button> <span>{isApple ? "⌘" : "Ctrl"}K</span>
</Button>
</Tooltip>
)} )}
</> </>
) )
@@ -69,7 +69,9 @@ export const SidebarItemCategory = ({
) )
return ( return (
<div className={clsx("my-docs_0.75 w-full relative", className)}> <div
className={clsx("my-docs_0.75 first:!mt-0 w-full relative", className)}
>
<div className="px-docs_0.75"> <div className="px-docs_0.75">
<div <div
className={clsx( className={clsx(
@@ -118,7 +118,12 @@ export const SidebarItemLink = ({
shallow={!item.isPathHref} shallow={!item.isPathHref}
{...item.linkProps} {...item.linkProps}
> >
<span className={clsx(isTitleOneWord && "truncate")}> <span
className={clsx(
isTitleOneWord && "truncate",
nested && "inline-block pl-docs_1.5"
)}
>
{item.title} {item.title}
</span> </span>
{item.additionalElms} {item.additionalElms}
@@ -129,7 +134,6 @@ export const SidebarItemLink = ({
className={clsx( className={clsx(
"ease-ease overflow-hidden", "ease-ease overflow-hidden",
"flex flex-col gap-docs_0.125", "flex flex-col gap-docs_0.125",
!item.childrenSameLevel && "pl-docs_1.5",
"pt-docs_0.125 pb-docs_0.5" "pt-docs_0.125 pb-docs_0.5"
)} )}
> >
@@ -116,7 +116,12 @@ export const SidebarItemSubCategory = ({
className className
)} )}
> >
<span className={clsx(isTitleOneWord && "truncate")}> <span
className={clsx(
isTitleOneWord && "truncate",
nested && "pl-docs_1.5"
)}
>
{item.title} {item.title}
</span> </span>
{item.additionalElms} {item.additionalElms}
@@ -127,7 +132,6 @@ export const SidebarItemSubCategory = ({
className={clsx( className={clsx(
"ease-ease overflow-hidden", "ease-ease overflow-hidden",
"flex flex-col gap-docs_0.125", "flex flex-col gap-docs_0.125",
!item.childrenSameLevel && "pl-docs_1.5",
"pb-docs_0.5 pt-docs_0.125" "pb-docs_0.5 pt-docs_0.125"
)} )}
> >
@@ -46,7 +46,7 @@ export const SidebarTopMedusaMenu = () => {
<span className="text-compact-small-plus text-medusa-fg-base flex-1"> <span className="text-compact-small-plus text-medusa-fg-base flex-1">
Medusa Docs Medusa Docs
</span> </span>
<EllipsisHorizontal className="text-medusa-fg-subtle" /> <EllipsisHorizontal className="text-medusa-fg-muted" />
</div> </div>
<div <div
className={clsx( className={clsx(
@@ -24,7 +24,7 @@ export const SidebarTop = React.forwardRef<HTMLDivElement, SidebarTopProps>(
<SidebarChild item={parentItem} /> <SidebarChild item={parentItem} />
</> </>
)} )}
<DottedSeparator className="!my-0" /> <DottedSeparator wrapperClassName="!my-0" />
</div> </div>
</div> </div>
) )
@@ -34,6 +34,7 @@ export * from "./Kbd"
export * from "./Label" export * from "./Label"
export * from "./LearningPath" export * from "./LearningPath"
export * from "./Link" export * from "./Link"
export * from "./LinkButton"
export * from "./Loading" export * from "./Loading"
export * from "./Loading/Dots" export * from "./Loading/Dots"
export * from "./Loading/Spinner" export * from "./Loading/Spinner"
@@ -48,7 +48,7 @@ export const MainContentLayout = ({
"flex-col items-center", "flex-col items-center",
"h-full w-full", "h-full w-full",
"overflow-y-scroll overflow-x-hidden", "overflow-y-scroll overflow-x-hidden",
"md:rounded shadow-elevation-card-rest", "md:rounded-t-docs_DEFAULT shadow-elevation-card-rest",
mainWrapperClasses mainWrapperClasses
)} )}
id="main" id="main"
+67 -39
View File
@@ -234,9 +234,9 @@ module.exports = {
"0px -1px 0px 0px rgba(255, 255, 255, 0.12), 0px 0px 0px 1px rgba(255, 255, 255, 0.12), 0px 0px 0px 1px rgba(82, 82, 91, 1), 0px 0px 0px 2px rgba(24, 24, 27, 1), 0px 0px 0px 4px rgba(96, 165, 250, 0.8)", "0px -1px 0px 0px rgba(255, 255, 255, 0.12), 0px 0px 0px 1px rgba(255, 255, 255, 0.12), 0px 0px 0px 1px rgba(82, 82, 91, 1), 0px 0px 0px 2px rgba(24, 24, 27, 1), 0px 0px 0px 4px rgba(96, 165, 250, 0.8)",
"elevation-code-block": "elevation-code-block":
"0px 0px 0px 1px rgba(24, 24, 27, 1) inset, 0px 0px 0px 1.5px rgba(255, 255, 255, 0.2) inset", "0px 0px 0px 1px #18181B, 0px 0px 0px 1.5px rgba(255, 255, 255, 0.20)",
"elevation-code-block-dark": "elevation-code-block-dark":
"0px -1px 0px 0px rgba(255, 255, 255, 0.06), 0px 0px 0px 1px rgba(255, 255, 255, 0.06), 0px 0px 0px 1px rgba(39, 39, 42, 1), 0px 1px 2px 0px rgba(0, 0, 0, 0.32), 0px 2px 4px 0px rgba(0, 0, 0, 0.32)", "0px -1px 0px 0px rgba(255, 255, 255, 0.06), 0px 0px 0px 1px rgba(255, 255, 255, 0.06), 0px 0px 0px 1px #27272A, 0px 1px 2px 0px rgba(0, 0, 0, 0.32), 0px 2px 4px 0px rgba(0, 0, 0, 0.32)",
active: "0px 0px 0px 3px #E1F0FF", active: "0px 0px 0px 3px #E1F0FF",
"active-dark": "0px 0px 0px 3px #2C2250", "active-dark": "0px 0px 0px 3px #2C2250",
"border-base": "border-base":
@@ -317,128 +317,142 @@ module.exports = {
}, },
fontSize: { fontSize: {
h1: [ h1: [
"2rem", "24px",
{ {
lineHeight: "2.75rem", lineHeight: "36px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
h2: [ h2: [
"1.5rem", "18px",
{ {
lineHeight: "2rem", lineHeight: "28px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
h3: [ h3: [
"1.125rem", "16px",
{ {
lineHeight: "1.75rem", lineHeight: "24px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
h4: [ h4: [
"1rem", "1rem",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"compact-large-plus": [ "compact-x-large-plus": [
"1rem", "18px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "500",
},
],
"compact-x-large": [
"18px",
{
lineHeight: "20px",
fontWeight: "400",
},
],
"compact-large-plus": [
"16px",
{
lineHeight: "20px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"compact-large": [ "compact-large": [
"1rem", "16px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"compact-medium-plus": [ "compact-medium-plus": [
"0.875rem", "14px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"compact-medium": [ "compact-medium": [
"0.875rem", "14px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"compact-small-plus": [ "compact-small-plus": [
"0.8125rem", "13px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"compact-small": [ "compact-small": [
"0.8125rem", "13px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"compact-x-small-plus": [ "compact-x-small-plus": [
"0.75rem", "12px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"compact-x-small": [ "compact-x-small": [
"0.75rem", "12px",
{ {
lineHeight: "1.25rem", lineHeight: "20px",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"x-large-plus": [ "x-large-plus": [
"1.125rem", "18px",
{ {
lineHeight: "1.6875rem", lineHeight: "150%",
fontWeight: "500", fontWeight: "500",
}, },
], ],
"x-large": [ "x-large": [
"1.125rem", "18px",
{ {
lineHeight: "1.6875rem", lineHeight: "150%",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"large-plus": [ "large-plus": [
"1rem", "16px",
{ {
lineHeight: "1.5rem", lineHeight: "150%",
fontWeight: "500", fontWeight: "500",
}, },
], ],
large: [ large: [
"1rem", "16px",
{ {
lineHeight: "1.5rem", lineHeight: "150%",
fontWeight: "400", fontWeight: "400",
}, },
], ],
"medium-plus": [ "medium-plus": [
"0.875rem", "14px",
{ {
lineHeight: "1.3125rem", lineHeight: "150%",
fontWeight: "500", fontWeight: "500",
}, },
], ],
medium: [ medium: [
"0.875rem", "14px",
{ {
lineHeight: "1.3125rem", lineHeight: "150%",
fontWeight: "400", fontWeight: "400",
}, },
], ],
@@ -456,6 +470,20 @@ module.exports = {
fontWeight: "500", fontWeight: "500",
}, },
], ],
"x-small": [
"12px",
{
lineHeight: "150%",
fontWeight: "400",
},
],
"x-small-plus": [
"12px",
{
lineHeight: "150%",
fontWeight: "500",
},
],
"code-label": [ "code-label": [
"12px", "12px",
{ {
@@ -466,7 +494,7 @@ module.exports = {
"code-body": [ "code-body": [
"12px", "12px",
{ {
lineHeight: "18px", lineHeight: "150%",
fontWeight: "400", fontWeight: "400",
}, },
], ],
+2
View File
@@ -37,6 +37,7 @@ const light = {
"--docs-border-danger": "rgba(190, 18, 60, 1)", "--docs-border-danger": "rgba(190, 18, 60, 1)",
"--docs-border-transparent": "rgba(255, 255, 255, 0)", "--docs-border-transparent": "rgba(255, 255, 255, 0)",
"--docs-border-menu-top": "rgba(228, 228, 231, 1)", "--docs-border-menu-top": "rgba(228, 228, 231, 1)",
"--docs-border-menu-bot": "rgba(255, 255, 255, 1)",
"--docs-button-inverted": "rgba(39, 39, 42, 1)", "--docs-button-inverted": "rgba(39, 39, 42, 1)",
"--docs-button-inverted-hover": "rgba(63, 63, 70, 1)", "--docs-button-inverted-hover": "rgba(63, 63, 70, 1)",
@@ -140,6 +141,7 @@ const dark = {
"--docs-border-danger": "rgba(190, 18, 60, 1)", "--docs-border-danger": "rgba(190, 18, 60, 1)",
"--docs-border-transparent": "rgba(255, 255, 255, 0)", "--docs-border-transparent": "rgba(255, 255, 255, 0)",
"--docs-border-menu-top": "rgba(255, 255, 255, 0.08)", "--docs-border-menu-top": "rgba(255, 255, 255, 0.08)",
"--docs-border-menu-bot": "rgba(255, 255, 255, 0.08)",
"--docs-button-inverted": "rgba(82, 82, 91, 1)", "--docs-button-inverted": "rgba(82, 82, 91, 1)",
"--docs-button-inverted-hover": "rgba(113, 113, 122, 1)", "--docs-button-inverted-hover": "rgba(113, 113, 122, 1)",