Skip to content

Commit

Permalink
Merge branch 'main' into chore/plop-create-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrantz authored Oct 16, 2024
2 parents e72fc18 + 7425ece commit bdc60d5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/spicy-badgers-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/inline-code": patch
"@twilio-paste/core": patch
---

[Inline Code]: Update children prop to accept `React.ReactNode` instead of `string`
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as React from "react";
type InlineCodeVariants = "default" | "minimal";

export interface InlineCodeProps extends Partial<Omit<HTMLPasteProps<"div">, "children">> {
children: string;
children: React.ReactNode;
/**
* Overrides the default element name to apply unique styles with the Customization Provider.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Heading } from "@twilio-paste/heading";
import { Stack } from "@twilio-paste/stack";
import { Text } from "@twilio-paste/text";
import { useTheme } from "@twilio-paste/theme";
import { Truncate } from "@twilio-paste/truncate";
import * as React from "react";

import { InlineCode } from "../src";
Expand Down Expand Up @@ -94,6 +95,16 @@ export const DisplayingAPIKey: StoryFn = () => {
);
};

export const WithTruncate: StoryFn = () => {
return (
<Box maxWidth="size20">
<InlineCode>
<Truncate title="Some very long text to truncate">Some very long text to truncate</Truncate>
</InlineCode>
</Box>
);
};

export const Customization: StoryFn = (_args, { parameters: { isTestEnvironment } }) => {
const currentTheme = useTheme();
return (
Expand Down

0 comments on commit bdc60d5

Please sign in to comment.