docs: second round of polishing (#8724)
* docs: second round of polishing * fix overflowing width
This commit is contained in:
1 parent
49353f8c3c
commit
c63a08fb03
11 files changed
+75
-4865
No files matched your search
@@ -43,10 +43,6 @@
|
|||||||
@apply bg-medusa-bg-highlight;
|
@apply bg-medusa-bg-highlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre *::selection {
|
|
||||||
@apply !bg-medusa-contrast-bg-highlight;
|
|
||||||
}
|
|
||||||
|
|
||||||
body[data-modal="opened"] {
|
body[data-modal="opened"] {
|
||||||
@apply !overflow-hidden;
|
@apply !overflow-hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -281,7 +281,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
title: "Currency",
|
title: "Currency Module",
|
||||||
initialOpen: false,
|
initialOpen: false,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@@ -348,7 +348,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
title: "Customer",
|
title: "Customer Module",
|
||||||
initialOpen: false,
|
initialOpen: false,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -150,7 +150,13 @@ export const MDXComponents: MDXComponentsType = {
|
|||||||
...props
|
...props
|
||||||
}: React.HTMLAttributes<HTMLElement>) => {
|
}: React.HTMLAttributes<HTMLElement>) => {
|
||||||
return (
|
return (
|
||||||
<li className={clsx("text-medusa-fg-subtle", className)} {...props}>
|
<li
|
||||||
|
className={clsx(
|
||||||
|
"text-medusa-fg-subtle [&:not(:last-child)]:mb-docs_0.5",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<Text as="span">{children}</Text>
|
<Text as="span">{children}</Text>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ export const MainNavEditDate = ({ date }: MainNavEditDateProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span>
|
<span className="text-compact-small">
|
||||||
Edited {dateMatch.groups.month} {dateObj.getDate()}
|
Edited {dateMatch.groups.month} {dateObj.getDate()}
|
||||||
{dateObj.getFullYear() !== today.getFullYear()
|
{dateObj.getFullYear() !== today.getFullYear()
|
||||||
? `, ${dateObj.getFullYear()}`
|
? `, ${dateObj.getFullYear()}`
|
||||||
: ""}
|
: ""}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-compact-small-plus">·</span>
|
<span className="text-compact-small">·</span>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ export const MobileNavigation = () => {
|
|||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"sm:hidden bg-medusa-bg-base",
|
"sm:hidden bg-medusa-bg-base",
|
||||||
"sticky top-0 w-full z-50 h-min",
|
"sticky top-0 w-full z-40 h-min",
|
||||||
"px-docs_0.75 py-docs_0.5",
|
"px-docs_0.75 py-docs_0.5",
|
||||||
"flex justify-between items-center",
|
"flex justify-between items-center",
|
||||||
"border-b border-medusa-border-base"
|
"border-b border-medusa-border-base"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export const Sidebar = ({
|
|||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"lg:hidden bg-medusa-bg-overlay opacity-70",
|
"lg:hidden bg-medusa-bg-overlay opacity-70",
|
||||||
"fixed top-0 left-0 w-full h-full z-10"
|
"fixed top-0 left-0 w-full h-full z-[45]"
|
||||||
)}
|
)}
|
||||||
></div>
|
></div>
|
||||||
)}
|
)}
|
||||||
@@ -76,6 +76,7 @@ export const Sidebar = ({
|
|||||||
"fixed -left-full top-0 h-[calc(100%-16px)] transition-[left] lg:relative lg:h-auto",
|
"fixed -left-full top-0 h-[calc(100%-16px)] transition-[left] lg:relative lg:h-auto",
|
||||||
"max-w-sidebar-xs sm:max-w-sidebar-sm md:max-w-sidebar-md lg:max-w-sidebar-lg",
|
"max-w-sidebar-xs sm:max-w-sidebar-sm md:max-w-sidebar-md lg:max-w-sidebar-lg",
|
||||||
"xl:max-w-sidebar-xl xxl:max-w-sidebar-xxl xxxl:max-w-sidebar-xxxl",
|
"xl:max-w-sidebar-xl xxl:max-w-sidebar-xxl xxxl:max-w-sidebar-xxxl",
|
||||||
|
"w-sidebar-xs sm:w-auto",
|
||||||
mobileSidebarOpen && [
|
mobileSidebarOpen && [
|
||||||
"!left-docs_0.5 !top-docs_0.5 z-50 shadow-elevation-modal dark:shadow-elevation-modal-dark",
|
"!left-docs_0.5 !top-docs_0.5 z-50 shadow-elevation-modal dark:shadow-elevation-modal-dark",
|
||||||
"rounded",
|
"rounded",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import React from "react"
|
import React, { useMemo } from "react"
|
||||||
import { Tabs as UiTabs } from "@medusajs/ui"
|
import { Tabs as UiTabs } from "@medusajs/ui"
|
||||||
import { ComponentProps } from "react"
|
import { ComponentProps } from "react"
|
||||||
import clsx from "clsx"
|
import clsx from "clsx"
|
||||||
import { EllipseMiniSolid } from "@medusajs/icons"
|
import { EllipseMiniSolid } from "@medusajs/icons"
|
||||||
|
import { useMobile } from "../.."
|
||||||
|
|
||||||
type TabsProps = ComponentProps<typeof UiTabs> & {
|
type TabsProps = ComponentProps<typeof UiTabs> & {
|
||||||
layoutType?: "horizontal" | "vertical"
|
layoutType?: "horizontal" | "vertical"
|
||||||
@@ -14,20 +15,28 @@ export const Tabs = ({
|
|||||||
layoutType = "horizontal",
|
layoutType = "horizontal",
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}: TabsProps) => (
|
}: TabsProps) => {
|
||||||
<UiTabs
|
const { isMobile } = useMobile()
|
||||||
{...props}
|
|
||||||
className={clsx(
|
const layout = useMemo(() => {
|
||||||
className,
|
return isMobile ? "horizontal" : layoutType
|
||||||
layoutType === "vertical" && [
|
}, [layoutType, isMobile])
|
||||||
"flex gap-docs_1",
|
|
||||||
"[&_[role=tablist]]:flex-col [&_[role=tablist]]:items-start",
|
return (
|
||||||
"[&_[role=tablist]+*]:flex-1 [&_[role=tablist]+*]:!mt-0",
|
<UiTabs
|
||||||
"[&_[role=tablist]+*]:w-3/4 [&_[role=tablist]]:w-1/4",
|
{...props}
|
||||||
]
|
className={clsx(
|
||||||
)}
|
className,
|
||||||
/>
|
layout === "vertical" && [
|
||||||
)
|
"flex gap-docs_1",
|
||||||
|
"[&_[role=tablist]]:flex-col [&_[role=tablist]]:items-start",
|
||||||
|
"[&_[role=tablist]+*]:flex-1 [&_[role=tablist]+*]:!mt-0",
|
||||||
|
"[&_[role=tablist]+*]:w-3/4 [&_[role=tablist]]:w-1/4",
|
||||||
|
]
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export const TabsList = ({
|
export const TabsList = ({
|
||||||
className,
|
className,
|
||||||
@@ -54,20 +63,32 @@ export const TabsTriggerVertical = ({
|
|||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: ComponentProps<typeof UiTabs.Trigger>) => (
|
}: ComponentProps<typeof UiTabs.Trigger>) => {
|
||||||
<UiTabs.Trigger
|
const { isMobile } = useMobile()
|
||||||
{...props}
|
|
||||||
className={clsx(
|
if (isMobile) {
|
||||||
className,
|
return (
|
||||||
"px-docs_0.5 py-docs_0.25 !text-medusa-fg-base text-compact-small data-[state=active]:!text-compact-small-plus",
|
<TabsTrigger className={className} {...props}>
|
||||||
"[&[data-state=active]_svg]:!visible hover:!bg-medusa-bg-base-hover rounded-docs_DEFAULT",
|
{children}
|
||||||
"!shadow-none"
|
</TabsTrigger>
|
||||||
)}
|
)
|
||||||
>
|
}
|
||||||
<EllipseMiniSolid className="invisible" />
|
|
||||||
{children}
|
return (
|
||||||
</UiTabs.Trigger>
|
<UiTabs.Trigger
|
||||||
)
|
{...props}
|
||||||
|
className={clsx(
|
||||||
|
className,
|
||||||
|
"px-docs_0.5 py-docs_0.25 !text-medusa-fg-base text-compact-small data-[state=active]:!text-compact-small-plus",
|
||||||
|
"[&[data-state=active]_svg]:!visible hover:!bg-medusa-bg-base-hover rounded-docs_DEFAULT",
|
||||||
|
"!shadow-none"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<EllipseMiniSolid className="invisible" />
|
||||||
|
{children}
|
||||||
|
</UiTabs.Trigger>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
type TabsContentWrapperProps = {
|
type TabsContentWrapperProps = {
|
||||||
className?: string
|
className?: string
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ export const MainContentLayout = ({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"relative",
|
"relative max-w-full",
|
||||||
"h-full flex-1",
|
"h-full flex-1",
|
||||||
"flex flex-col",
|
"flex flex-col",
|
||||||
"gap-docs_0.5 lg:pt-docs_0.5 lg:mr-docs_0.25",
|
"gap-docs_0.5 lg:pt-docs_0.25 lg:mr-docs_0.25",
|
||||||
!desktopSidebarOpen && "lg:ml-docs_0.25",
|
!desktopSidebarOpen && "lg:ml-docs_0.25",
|
||||||
mainWrapperClasses
|
mainWrapperClasses
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ export const TightLayout = ({
|
|||||||
"w-full h-fit",
|
"w-full h-fit",
|
||||||
"max-w-inner-content-xs sm:max-w-inner-content-sm md:max-w-inner-content-md",
|
"max-w-inner-content-xs sm:max-w-inner-content-sm md:max-w-inner-content-md",
|
||||||
"lg:max-w-inner-content-lg xl:max-w-inner-content-xl xxl:max-w-inner-content-xxl",
|
"lg:max-w-inner-content-lg xl:max-w-inner-content-xl xxl:max-w-inner-content-xxl",
|
||||||
"xxxl:max-w-inner-content-xxxl"
|
"xxxl:max-w-inner-content-xxxl",
|
||||||
|
"px-docs_1 md:px-docs_4 lg:px-0"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -282,10 +282,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
toc: "221px",
|
toc: "221px",
|
||||||
|
"sidebar-xs": "calc(100% - 20px)",
|
||||||
},
|
},
|
||||||
maxWidth: {
|
maxWidth: {
|
||||||
// sidebar
|
// sidebar
|
||||||
"sidebar-xs": "300px",
|
"sidebar-xs": "calc(100% - 20px)",
|
||||||
"sidebar-sm": "300px",
|
"sidebar-sm": "300px",
|
||||||
"sidebar-md": "300px",
|
"sidebar-md": "300px",
|
||||||
"sidebar-lg": "221px",
|
"sidebar-lg": "221px",
|
||||||
@@ -301,9 +302,9 @@ module.exports = {
|
|||||||
"main-content-xxl": "1263px",
|
"main-content-xxl": "1263px",
|
||||||
"main-content-xxxl": "3567px",
|
"main-content-xxxl": "3567px",
|
||||||
// inner content
|
// inner content
|
||||||
"inner-content-xs": "272px",
|
"inner-content-xs": "100%",
|
||||||
"inner-content-sm": "592px",
|
"inner-content-sm": "100%",
|
||||||
"inner-content-md": "640px",
|
"inner-content-md": "100%",
|
||||||
"inner-content-lg": "640px",
|
"inner-content-lg": "640px",
|
||||||
"inner-content-xl": "640px",
|
"inner-content-xl": "640px",
|
||||||
"inner-content-xxl": "640px",
|
"inner-content-xxl": "640px",
|
||||||
|
|||||||
Reference in new issue
Block a user