diff --git a/www/apps/ui/src/components/hook-table.tsx b/www/apps/ui/src/components/hook-table.tsx index e005c54d56..65bc1bcf11 100644 --- a/www/apps/ui/src/components/hook-table.tsx +++ b/www/apps/ui/src/components/hook-table.tsx @@ -67,6 +67,7 @@ const Row = ({ value, type, description }: HookData) => { {type.shape}} className="font-mono max-w-[500px]" + tooltipClassName="!text-left" >
{type.name} diff --git a/www/apps/ui/src/components/props-table.tsx b/www/apps/ui/src/components/props-table.tsx index 005c5942fd..cdb04db79c 100644 --- a/www/apps/ui/src/components/props-table.tsx +++ b/www/apps/ui/src/components/props-table.tsx @@ -165,6 +165,7 @@ const Row = ({ {typeNode.tooltipContent}} className="font-mono !max-w-none" + tooltipClassName="!text-left" >
{typeNode.text} diff --git a/www/apps/ui/src/content/docs/components/code-block.mdx b/www/apps/ui/src/content/docs/components/code-block.mdx index c605223c0f..897e288e4b 100644 --- a/www/apps/ui/src/content/docs/components/code-block.mdx +++ b/www/apps/ui/src/content/docs/components/code-block.mdx @@ -83,3 +83,7 @@ You could also choose to omit the header entirely: ### No Line Numbers + +### No Copy Button + + diff --git a/www/apps/ui/src/examples/code-block-no-copy.tsx b/www/apps/ui/src/examples/code-block-no-copy.tsx new file mode 100644 index 0000000000..1f57c15600 --- /dev/null +++ b/www/apps/ui/src/examples/code-block-no-copy.tsx @@ -0,0 +1,25 @@ +import { CodeBlock, Label } from "@medusajs/ui" + +const snippets = [ + { + label: "Medusa JS SDK", + language: "jsx", + code: `// Install the JS SDK in your storefront project: @medusajs/js-sdk\n\nimport Medusa from "@medusajs/js-sdk"\n\nconst medusa = new Medusa({\n baseUrl: import.meta.env.NEXT_PUBLIC_BACKEND_URL || "/",\n publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PAK\n})\nconst { product } = await medusa.store.products.retrieve("prod_123")\nconsole.log(product.id)`, + hideCopy: true, + }, +] + +export default function CodeBlockNoCopy() { + return ( +
+ + + + + + + + +
+ ) +} diff --git a/www/apps/ui/src/examples/code-block-no-lines.tsx b/www/apps/ui/src/examples/code-block-no-lines.tsx index 3348f2af8f..428b9c8003 100644 --- a/www/apps/ui/src/examples/code-block-no-lines.tsx +++ b/www/apps/ui/src/examples/code-block-no-lines.tsx @@ -5,6 +5,7 @@ const snippets = [ label: "Medusa JS SDK", language: "jsx", code: `// Install the JS SDK in your storefront project: @medusajs/js-sdk\n\nimport Medusa from "@medusajs/js-sdk"\n\nconst medusa = new Medusa({\n baseUrl: import.meta.env.NEXT_PUBLIC_BACKEND_URL || "/",\n publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PAK\n})\nconst { product } = await medusa.store.products.retrieve("prod_123")\nconsole.log(product.id)`, + hideLineNumbers: true, }, ] diff --git a/www/apps/ui/src/registries/example-registry.tsx b/www/apps/ui/src/registries/example-registry.tsx index ac453c3558..dcbfe579c4 100644 --- a/www/apps/ui/src/registries/example-registry.tsx +++ b/www/apps/ui/src/registries/example-registry.tsx @@ -735,6 +735,11 @@ export const ExampleRegistry: ExampleRegistryType = { ), file: "src/examples/code-block-no-header.tsx", }, + "code-block-no-copy": { + name: "code-block-no-copy", + component: React.lazy(async () => import("@/examples/code-block-no-copy")), + file: "src/examples/code-block-no-copy.tsx", + }, "container-layout": { name: "container-layout", component: React.lazy(async () => import("@/examples/container-layout")),