From 733fe9fef28963c3d3b707edf3a3c0ae2b8faf8f Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Wed, 16 Oct 2024 13:09:44 +0530 Subject: [PATCH 1/3] feat(inline-code): update children prop --- .../components/inline-code/src/InlineCode.tsx | 2 +- .../components/inline-code/stories/index.stories.tsx | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/paste-core/components/inline-code/src/InlineCode.tsx b/packages/paste-core/components/inline-code/src/InlineCode.tsx index 02d8c7cbd3..69ab5a341c 100644 --- a/packages/paste-core/components/inline-code/src/InlineCode.tsx +++ b/packages/paste-core/components/inline-code/src/InlineCode.tsx @@ -10,7 +10,7 @@ import * as React from "react"; type InlineCodeVariants = "default" | "minimal"; export interface InlineCodeProps extends Partial, "children">> { - children: string; + children: React.ReactNode; /** * Overrides the default element name to apply unique styles with the Customization Provider. * diff --git a/packages/paste-core/components/inline-code/stories/index.stories.tsx b/packages/paste-core/components/inline-code/stories/index.stories.tsx index 6ea2fe35e5..a50842338c 100644 --- a/packages/paste-core/components/inline-code/stories/index.stories.tsx +++ b/packages/paste-core/components/inline-code/stories/index.stories.tsx @@ -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"; @@ -94,6 +95,16 @@ export const DisplayingAPIKey: StoryFn = () => { ); }; +export const WithTruncate: StoryFn = () => { + return ( + + + Some very long text to truncate + + + ); +}; + export const Customization: StoryFn = (_args, { parameters: { isTestEnvironment } }) => { const currentTheme = useTheme(); return ( From 0a76d9c538e1a7adc44502c43d140b92e32db456 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Wed, 16 Oct 2024 13:12:30 +0530 Subject: [PATCH 2/3] feat(inline-code): add changeset --- .changeset/spicy-badgers-double.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/spicy-badgers-double.md diff --git a/.changeset/spicy-badgers-double.md b/.changeset/spicy-badgers-double.md new file mode 100644 index 0000000000..cf4338640f --- /dev/null +++ b/.changeset/spicy-badgers-double.md @@ -0,0 +1,6 @@ +--- +"@twilio-paste/inline-code": minor +"@twilio-paste/core": minor +--- + +[Inline Code]: Update children prop to accept `React.ReactNode` instead of `string` From 9355ae182fdab0e3ff6b0aa66c77748300520047 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Wed, 16 Oct 2024 20:45:05 +0530 Subject: [PATCH 3/3] feat(inline-code): update changeset --- .changeset/spicy-badgers-double.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/spicy-badgers-double.md b/.changeset/spicy-badgers-double.md index cf4338640f..1b3447870f 100644 --- a/.changeset/spicy-badgers-double.md +++ b/.changeset/spicy-badgers-double.md @@ -1,6 +1,6 @@ --- -"@twilio-paste/inline-code": minor -"@twilio-paste/core": minor +"@twilio-paste/inline-code": patch +"@twilio-paste/core": patch --- [Inline Code]: Update children prop to accept `React.ReactNode` instead of `string`