diff --git a/www/packages/docs-ui/src/components/CodeBlock/Actions/Copy/index.tsx b/www/packages/docs-ui/src/components/CodeBlock/Actions/Copy/index.tsx index f94a8efc78..792ea70d5c 100644 --- a/www/packages/docs-ui/src/components/CodeBlock/Actions/Copy/index.tsx +++ b/www/packages/docs-ui/src/components/CodeBlock/Actions/Copy/index.tsx @@ -6,13 +6,11 @@ import { CheckMini, SquareTwoStack } from "@medusajs/icons" export type CodeBlockCopyActionProps = { source: string inHeader: boolean - iconColor: string } export const CodeBlockCopyAction = ({ source, inHeader, - iconColor, }: CodeBlockCopyActionProps) => { const [copied, setCopied] = useState(false) @@ -24,16 +22,27 @@ export const CodeBlockCopyAction = ({ } }, [copied]) + const iconClassName = [ + "text-medusa-contrast-fg-secondary", + "group-hover:text-medusa-contrast-fg-primary", + "group-focus:text-medusa-contrast-fg-primary", + ] + return ( setCopied(true)} > - {!copied && } - {copied && } + {!copied && } + {copied && } ) } diff --git a/www/packages/docs-ui/src/components/CodeBlock/Actions/index.tsx b/www/packages/docs-ui/src/components/CodeBlock/Actions/index.tsx index 81ea65e7bf..7544ac1685 100644 --- a/www/packages/docs-ui/src/components/CodeBlock/Actions/index.tsx +++ b/www/packages/docs-ui/src/components/CodeBlock/Actions/index.tsx @@ -1,10 +1,9 @@ "use client" import clsx from "clsx" -import React, { useMemo } from "react" -import { CodeBlockStyle, Link, Tooltip } from "@/components" +import React from "react" +import { Link, Tooltip } from "@/components" import { ExclamationCircle, PlaySolid } from "@medusajs/icons" -import { useColorMode } from "@/providers" import { GITHUB_ISSUES_PREFIX } from "@/constants" import { CodeBlockCopyAction } from "./Copy" @@ -16,7 +15,6 @@ export type CodeBlockActionsProps = { inInnerCode?: boolean isCollapsed: boolean canShowApiTesting?: boolean - blockStyle: CodeBlockStyle onApiTesting: React.Dispatch> noReport?: boolean noCopy?: boolean @@ -30,23 +28,15 @@ export const CodeBlockActions = ({ isCollapsed, isSingleLine = false, canShowApiTesting = false, - blockStyle, onApiTesting, noReport = false, noCopy = false, }: CodeBlockActionsProps) => { - const { colorMode } = useColorMode() - const iconColor = useMemo( - () => - clsx( - blockStyle === "loud" && "text-medusa-contrast-fg-secondary", - blockStyle === "subtle" && [ - colorMode === "light" && "text-medusa-fg-muted", - colorMode === "dark" && "text-medusa-fg-secondary", - ] - ), - [blockStyle, colorMode] - ) + const iconClassName = [ + "text-medusa-contrast-fg-secondary", + "group-hover:text-medusa-contrast-fg-primary", + "group-focus:text-medusa-contrast-fg-primary", + ] return (
- onApiTesting(true)} - /> + > + + )} {!noReport && ( - + )} - {!noCopy && ( - - )} + {!noCopy && }
) diff --git a/www/packages/docs-ui/src/components/CodeBlock/index.tsx b/www/packages/docs-ui/src/components/CodeBlock/index.tsx index 1c882a2f76..541215447e 100644 --- a/www/packages/docs-ui/src/components/CodeBlock/index.tsx +++ b/www/packages/docs-ui/src/components/CodeBlock/index.tsx @@ -262,7 +262,6 @@ export const CodeBlock = ({ source, canShowApiTesting, setShowTesting, - blockStyle, noReport, noCopy, collapsibleType, diff --git a/www/packages/docs-ui/src/components/LinkButton/index.tsx b/www/packages/docs-ui/src/components/LinkButton/index.tsx new file mode 100644 index 0000000000..d06f43e8a7 --- /dev/null +++ b/www/packages/docs-ui/src/components/LinkButton/index.tsx @@ -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 + +export const LinkButton = ({ + variant = "base", + className, + ...linkProps +}: LinkButtonProps) => { + return ( + + ) +} diff --git a/www/packages/docs-ui/src/components/MainNav/Breadcrumb/index.tsx b/www/packages/docs-ui/src/components/MainNav/Breadcrumb/index.tsx index af6a014a47..4af5df4be4 100644 --- a/www/packages/docs-ui/src/components/MainNav/Breadcrumb/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/Breadcrumb/index.tsx @@ -1,7 +1,7 @@ "use client" import React, { useMemo } from "react" -import { CurrentItemsState, useSidebar } from "../../.." +import { Button, CurrentItemsState, useSidebar } from "../../.." import clsx from "clsx" import Link from "next/link" import { SidebarItemLink } from "types" @@ -61,22 +61,19 @@ export const MainNavBreadcrumbs = () => { return (
{Array.from(breadcrumbItems).map(([link, title]) => ( / - - {title} - + {title} + ))}
diff --git a/www/packages/docs-ui/src/components/MainNav/ColorMode/index.tsx b/www/packages/docs-ui/src/components/MainNav/ColorMode/index.tsx index 1f84c42cf5..bcdeba74ba 100644 --- a/www/packages/docs-ui/src/components/MainNav/ColorMode/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/ColorMode/index.tsx @@ -2,7 +2,7 @@ import React from "react" import { useColorMode } from "../../../providers" -import { Button } from "../../.." +import { Button, Tooltip } from "../../.." import { Moon, Sun } from "@medusajs/icons" import clsx from "clsx" @@ -10,13 +10,15 @@ export const MainNavColorMode = () => { const { colorMode, toggleColorMode } = useColorMode() return ( - + + + ) } diff --git a/www/packages/docs-ui/src/components/MainNav/HelpButton/index.tsx b/www/packages/docs-ui/src/components/MainNav/HelpButton/index.tsx index 289fcfd045..e2988a7d1b 100644 --- a/www/packages/docs-ui/src/components/MainNav/HelpButton/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/HelpButton/index.tsx @@ -46,9 +46,9 @@ export const MainNavHelpButton = () => {
+ Need help? - ? + ? } place="bottom" @@ -56,7 +56,7 @@ export const MainNavHelpButton = () => { > )} {!isMobile && ( - + + + )} ) diff --git a/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx b/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx index fd283b9abf..62b02946ba 100644 --- a/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx @@ -69,7 +69,9 @@ export const SidebarItemCategory = ({ ) return ( -
+
- + {item.title} {item.additionalElms} @@ -129,7 +134,6 @@ export const SidebarItemLink = ({ className={clsx( "ease-ease overflow-hidden", "flex flex-col gap-docs_0.125", - !item.childrenSameLevel && "pl-docs_1.5", "pt-docs_0.125 pb-docs_0.5" )} > diff --git a/www/packages/docs-ui/src/components/Sidebar/Item/SubCategory/index.tsx b/www/packages/docs-ui/src/components/Sidebar/Item/SubCategory/index.tsx index 8b997bb77d..e1a124bf8d 100644 --- a/www/packages/docs-ui/src/components/Sidebar/Item/SubCategory/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/Item/SubCategory/index.tsx @@ -116,7 +116,12 @@ export const SidebarItemSubCategory = ({ className )} > - + {item.title} {item.additionalElms} @@ -127,7 +132,6 @@ export const SidebarItemSubCategory = ({ className={clsx( "ease-ease overflow-hidden", "flex flex-col gap-docs_0.125", - !item.childrenSameLevel && "pl-docs_1.5", "pb-docs_0.5 pt-docs_0.125" )} > diff --git a/www/packages/docs-ui/src/components/Sidebar/Top/MedusaMenu/index.tsx b/www/packages/docs-ui/src/components/Sidebar/Top/MedusaMenu/index.tsx index 42e24273b1..431c5b24d1 100644 --- a/www/packages/docs-ui/src/components/Sidebar/Top/MedusaMenu/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/Top/MedusaMenu/index.tsx @@ -46,7 +46,7 @@ export const SidebarTopMedusaMenu = () => { Medusa Docs - +
( )} - +
) diff --git a/www/packages/docs-ui/src/components/index.ts b/www/packages/docs-ui/src/components/index.ts index 7e97501834..35c582d5b0 100644 --- a/www/packages/docs-ui/src/components/index.ts +++ b/www/packages/docs-ui/src/components/index.ts @@ -34,6 +34,7 @@ export * from "./Kbd" export * from "./Label" export * from "./LearningPath" export * from "./Link" +export * from "./LinkButton" export * from "./Loading" export * from "./Loading/Dots" export * from "./Loading/Spinner" diff --git a/www/packages/docs-ui/src/layouts/main-content.tsx b/www/packages/docs-ui/src/layouts/main-content.tsx index d3b78eeacd..836bcd03e9 100644 --- a/www/packages/docs-ui/src/layouts/main-content.tsx +++ b/www/packages/docs-ui/src/layouts/main-content.tsx @@ -48,7 +48,7 @@ export const MainContentLayout = ({ "flex-col items-center", "h-full w-full", "overflow-y-scroll overflow-x-hidden", - "md:rounded shadow-elevation-card-rest", + "md:rounded-t-docs_DEFAULT shadow-elevation-card-rest", mainWrapperClasses )} id="main" diff --git a/www/packages/tailwind/base.tailwind.config.js b/www/packages/tailwind/base.tailwind.config.js index f43e7c03d0..4275837bb1 100644 --- a/www/packages/tailwind/base.tailwind.config.js +++ b/www/packages/tailwind/base.tailwind.config.js @@ -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)", "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": - "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-dark": "0px 0px 0px 3px #2C2250", "border-base": @@ -317,128 +317,142 @@ module.exports = { }, fontSize: { h1: [ - "2rem", + "24px", { - lineHeight: "2.75rem", + lineHeight: "36px", fontWeight: "500", }, ], h2: [ - "1.5rem", + "18px", { - lineHeight: "2rem", + lineHeight: "28px", fontWeight: "500", }, ], h3: [ - "1.125rem", + "16px", { - lineHeight: "1.75rem", + lineHeight: "24px", fontWeight: "500", }, ], h4: [ "1rem", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "500", }, ], - "compact-large-plus": [ - "1rem", + "compact-x-large-plus": [ + "18px", { - lineHeight: "1.25rem", + lineHeight: "20px", + fontWeight: "500", + }, + ], + "compact-x-large": [ + "18px", + { + lineHeight: "20px", + fontWeight: "400", + }, + ], + "compact-large-plus": [ + "16px", + { + lineHeight: "20px", fontWeight: "500", }, ], "compact-large": [ - "1rem", + "16px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "400", }, ], "compact-medium-plus": [ - "0.875rem", + "14px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "500", }, ], "compact-medium": [ - "0.875rem", + "14px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "400", }, ], "compact-small-plus": [ - "0.8125rem", + "13px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "500", }, ], "compact-small": [ - "0.8125rem", + "13px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "400", }, ], "compact-x-small-plus": [ - "0.75rem", + "12px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "500", }, ], "compact-x-small": [ - "0.75rem", + "12px", { - lineHeight: "1.25rem", + lineHeight: "20px", fontWeight: "400", }, ], "x-large-plus": [ - "1.125rem", + "18px", { - lineHeight: "1.6875rem", + lineHeight: "150%", fontWeight: "500", }, ], "x-large": [ - "1.125rem", + "18px", { - lineHeight: "1.6875rem", + lineHeight: "150%", fontWeight: "400", }, ], "large-plus": [ - "1rem", + "16px", { - lineHeight: "1.5rem", + lineHeight: "150%", fontWeight: "500", }, ], large: [ - "1rem", + "16px", { - lineHeight: "1.5rem", + lineHeight: "150%", fontWeight: "400", }, ], "medium-plus": [ - "0.875rem", + "14px", { - lineHeight: "1.3125rem", + lineHeight: "150%", fontWeight: "500", }, ], medium: [ - "0.875rem", + "14px", { - lineHeight: "1.3125rem", + lineHeight: "150%", fontWeight: "400", }, ], @@ -456,6 +470,20 @@ module.exports = { fontWeight: "500", }, ], + "x-small": [ + "12px", + { + lineHeight: "150%", + fontWeight: "400", + }, + ], + "x-small-plus": [ + "12px", + { + lineHeight: "150%", + fontWeight: "500", + }, + ], "code-label": [ "12px", { @@ -466,7 +494,7 @@ module.exports = { "code-body": [ "12px", { - lineHeight: "18px", + lineHeight: "150%", fontWeight: "400", }, ], diff --git a/www/packages/tailwind/theme-presets.js b/www/packages/tailwind/theme-presets.js index 8d1167aa07..7ea1366eb0 100644 --- a/www/packages/tailwind/theme-presets.js +++ b/www/packages/tailwind/theme-presets.js @@ -37,6 +37,7 @@ const light = { "--docs-border-danger": "rgba(190, 18, 60, 1)", "--docs-border-transparent": "rgba(255, 255, 255, 0)", "--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-hover": "rgba(63, 63, 70, 1)", @@ -140,6 +141,7 @@ const dark = { "--docs-border-danger": "rgba(190, 18, 60, 1)", "--docs-border-transparent": "rgba(255, 255, 255, 0)", "--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-hover": "rgba(113, 113, 122, 1)",