From 48fe819d9e75df69d8351393ecb06236302417cd Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 20 Aug 2024 15:48:09 +0300 Subject: [PATCH] docs: redesign vertical tabs (#8673) --- .../modules/remote-query/page.mdx | 10 ++++----- .../modules/service-factory/page.mdx | 18 ++++++++-------- .../docs-ui/src/components/Tabs/index.tsx | 21 +++++++++++++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/www/apps/book/app/advanced-development/modules/remote-query/page.mdx b/www/apps/book/app/advanced-development/modules/remote-query/page.mdx index 0565017d0e..0daf58a54e 100644 --- a/www/apps/book/app/advanced-development/modules/remote-query/page.mdx +++ b/www/apps/book/app/advanced-development/modules/remote-query/page.mdx @@ -1,4 +1,4 @@ -import { TypeList, Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper } from "docs-ui" +import { TypeList, Tabs, TabsList, TabsTriggerVertical, TabsContent, TabsContentWrapper } from "docs-ui" export const metadata = { title: `${pageNumber} Remote Query`, @@ -242,10 +242,10 @@ The remote query function alternatively accepts a string with GraphQL syntax as - Basic Usage - Apply Filters - Sort Records - Apply Pagination + Basic Usage + Apply Filters + Sort Records + Apply Pagination diff --git a/www/apps/book/app/advanced-development/modules/service-factory/page.mdx b/www/apps/book/app/advanced-development/modules/service-factory/page.mdx index 3297e6ea35..cf478f4a41 100644 --- a/www/apps/book/app/advanced-development/modules/service-factory/page.mdx +++ b/www/apps/book/app/advanced-development/modules/service-factory/page.mdx @@ -1,4 +1,4 @@ -import { Tabs, TabsContent, TabsContentWrapper, TabsList, TabsTrigger } from "docs-ui" +import { Tabs, TabsContent, TabsContentWrapper, TabsList, TabsTriggerVertical } from "docs-ui" export const metadata = { title: `${pageNumber} Service Factory`, @@ -68,14 +68,14 @@ Find a complete reference of each of the methods in [this documentation](!resour - listMyCustoms - listAndCountMyCustoms - retrieveMyCustom - createMyCustoms - updateMyCustoms - deleteMyCustoms - softDeleteMyCustoms - restoreMyCustoms + listMyCustoms + listAndCount + retrieveMyCustom + createMyCustoms + updateMyCustoms + deleteMyCustoms + softDeleteMyCustoms + restoreMyCustoms diff --git a/www/packages/docs-ui/src/components/Tabs/index.tsx b/www/packages/docs-ui/src/components/Tabs/index.tsx index 217ec059cd..448405fb6b 100644 --- a/www/packages/docs-ui/src/components/Tabs/index.tsx +++ b/www/packages/docs-ui/src/components/Tabs/index.tsx @@ -4,6 +4,7 @@ import React from "react" import { Tabs as UiTabs } from "@medusajs/ui" import { ComponentProps } from "react" import clsx from "clsx" +import { EllipseMiniSolid } from "@medusajs/icons" type TabsProps = ComponentProps & { layoutType?: "horizontal" | "vertical" @@ -22,6 +23,7 @@ export const Tabs = ({ "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", ] )} /> @@ -48,6 +50,25 @@ export const TabsTrigger = ({ /> ) +export const TabsTriggerVertical = ({ + className, + children, + ...props +}: ComponentProps) => ( + + + {children} + +) + type TabsContentWrapperProps = { className?: string children: React.ReactNode