diff --git a/www/apps/api-reference/app/globals.css b/www/apps/api-reference/app/globals.css index 88cbdb7db1..197a81cac6 100644 --- a/www/apps/api-reference/app/globals.css +++ b/www/apps/api-reference/app/globals.css @@ -44,7 +44,7 @@ } pre *::selection { - @apply !bg-medusa-code-text-highlight; + @apply !bg-medusa-contrast-bg-highlight; } body[data-modal="opened"] { diff --git a/www/apps/api-reference/components/Tags/Operation/CodeSection/RequestSamples/index.tsx b/www/apps/api-reference/components/Tags/Operation/CodeSection/RequestSamples/index.tsx index becb39b0ba..58dbf7aa27 100644 --- a/www/apps/api-reference/components/Tags/Operation/CodeSection/RequestSamples/index.tsx +++ b/www/apps/api-reference/components/Tags/Operation/CodeSection/RequestSamples/index.tsx @@ -1,5 +1,5 @@ import type { Code } from "@/types/openapi" -import { LegacyCodeTabs } from "docs-ui" +import { CodeBlock, CodeTab, CodeTabs } from "docs-ui" import slugify from "slugify" export type TagOperationCodeSectionRequestSamplesProps = { @@ -12,18 +12,17 @@ const TagOperationCodeSectionRequestSamples = ({ return (

Request samples

- ({ - label: codeSample.label, - value: slugify(codeSample.label), - code: { - ...codeSample, - collapsed: true, - className: "!mb-0", - }, - }))} - className="mt-2 !mb-0" - /> + + {codeSamples.map((codeSample, index) => ( + + + + ))} +
) } diff --git a/www/apps/ui/src/components/package-install.tsx b/www/apps/ui/src/components/package-install.tsx index 345813e50e..3119572e9b 100644 --- a/www/apps/ui/src/components/package-install.tsx +++ b/www/apps/ui/src/components/package-install.tsx @@ -1,5 +1,5 @@ import { clx } from "@medusajs/ui" -import { LegacyCodeTabs } from "docs-ui" +import { CodeBlock, CodeTab, CodeTabs } from "docs-ui" type PackageInstallProps = { packageName: string @@ -20,15 +20,20 @@ const PackageInstall = ({ const npm = `npm install ${pkg} ${devDependency ? "--save-dev" : "--save"}` const pnpm = `pnpm add ${devDependency ? "-D " : ""}${pkg}` + const tabs = [ + { code: { lang: "bash", source: npm }, label: "npm", value: "npm" }, + { code: { lang: "bash", source: yarn }, label: "yarn", value: "yarn" }, + { code: { lang: "bash", source: pnpm }, label: "pnpm", value: "pnpm" }, + ] + return ( - + + {tabs.map((tab, index) => ( + + + + ))} + ) } diff --git a/www/apps/ui/src/providers/search.tsx b/www/apps/ui/src/providers/search.tsx index 95a6754f9a..dfc4ed6332 100644 --- a/www/apps/ui/src/providers/search.tsx +++ b/www/apps/ui/src/providers/search.tsx @@ -1,7 +1,7 @@ "use client" import { - AiAssistantCommandIcon, + AiAssistantIcon, AiAssistantProvider, SearchProvider as UiSearchProvider, searchFiltersV1, @@ -40,7 +40,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => { commands={[ { name: "ai-assistant", - icon: , + icon: , component: ( { ), title: "AI Assistant", badge: { - variant: "purple", + variant: "blue", + badgeType: "shaded", children: "Beta", }, }, diff --git a/www/apps/ui/src/styles/globals.css b/www/apps/ui/src/styles/globals.css index cda80045d0..b1170c9cdc 100644 --- a/www/apps/ui/src/styles/globals.css +++ b/www/apps/ui/src/styles/globals.css @@ -15,7 +15,7 @@ } pre *::selection { - @apply !bg-medusa-code-text-highlight; + @apply !bg-medusa-contrast-bg-highlight; } body { diff --git a/www/packages/docs-ui/src/components/AiAssistant/CommandIcon/index.tsx b/www/packages/docs-ui/src/components/AiAssistant/CommandIcon/index.tsx deleted file mode 100644 index 852142a610..0000000000 --- a/www/packages/docs-ui/src/components/AiAssistant/CommandIcon/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { SparklesSolid } from "@medusajs/icons" -import clsx from "clsx" -import React from "react" - -export type AiAssistantCommandIconProps = - React.AllHTMLAttributes - -export const AiAssistantCommandIcon = ({ - className, - ...props -}: AiAssistantCommandIconProps) => { - return ( - - - - ) -} diff --git a/www/packages/docs-ui/src/components/AiAssistant/ThreadItem/Actions/index.tsx b/www/packages/docs-ui/src/components/AiAssistant/ThreadItem/Actions/index.tsx index f02dd2a93a..5840f301d4 100644 --- a/www/packages/docs-ui/src/components/AiAssistant/ThreadItem/Actions/index.tsx +++ b/www/packages/docs-ui/src/components/AiAssistant/ThreadItem/Actions/index.tsx @@ -75,7 +75,7 @@ export const AiAssistantThreadItemActions = ({ const ActionButton = ({ children, className, ...props }: ButtonProps) => { return ( - - ))} - - - <> - {selectedTab?.code && ( - - )} - {selectedTab?.codeBlock && <>{selectedTab.codeBlock}} - - - ) -} diff --git a/www/packages/docs-ui/src/components/Modal/Header/index.tsx b/www/packages/docs-ui/src/components/Modal/Header/index.tsx index 325b8e27c7..bb224f4453 100644 --- a/www/packages/docs-ui/src/components/Modal/Header/index.tsx +++ b/www/packages/docs-ui/src/components/Modal/Header/index.tsx @@ -20,7 +20,7 @@ export const ModalHeader = ({ title }: ModalHeaderProps) => { > {title} )} diff --git a/www/packages/docs-ui/src/components/Search/Suggestions/index.tsx b/www/packages/docs-ui/src/components/Search/Suggestions/index.tsx index 9c91b9e895..57edec6e3e 100644 --- a/www/packages/docs-ui/src/components/Search/Suggestions/index.tsx +++ b/www/packages/docs-ui/src/components/Search/Suggestions/index.tsx @@ -30,13 +30,13 @@ export const SearchSuggestions = ({ suggestions }: SearchSuggestionsProps) => { onClick={() => setCommand(command)} key={index} tabIndex={index} - className="gap-docs_0.75" + className="justify-between" > - <> + {command.icon} {command.title} - {command.badge && } - + + {command.badge && } ))} diff --git a/www/packages/docs-ui/src/components/Search/index.tsx b/www/packages/docs-ui/src/components/Search/index.tsx index 03505afff6..821e67f308 100644 --- a/www/packages/docs-ui/src/components/Search/index.tsx +++ b/www/packages/docs-ui/src/components/Search/index.tsx @@ -122,7 +122,7 @@ export const Search = ({ formRef={searchBoxRef} />