diff --git a/static/app/components/charts/chartWidgetLoader.stories.tsx b/static/app/components/charts/chartWidgetLoader.stories.tsx
index c0369ef9cbbfa5..128fb4ab7091b1 100644
--- a/static/app/components/charts/chartWidgetLoader.stories.tsx
+++ b/static/app/components/charts/chartWidgetLoader.stories.tsx
@@ -1,7 +1,7 @@
import {Fragment} from 'react';
import types from '!!type-loader!sentry/components/charts/chartWidgetLoader';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import * as Storybook from 'sentry/stories';
export default Storybook.story('ChartWidgetLoader', (story, APIReference) => {
@@ -30,7 +30,7 @@ export default Storybook.story('ChartWidgetLoader', (story, APIReference) => {
render these chart widgets).
- {``}
+ {``}
);
});
diff --git a/static/app/components/codeSnippet.stories.tsx b/static/app/components/codeSnippet.stories.tsx
deleted file mode 100644
index 8b91497acbc01a..00000000000000
--- a/static/app/components/codeSnippet.stories.tsx
+++ /dev/null
@@ -1,248 +0,0 @@
-import {Fragment, useState} from 'react';
-
-import {addSuccessMessage} from 'sentry/actionCreators/indicator';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
-import {IconStar} from 'sentry/icons';
-import * as Storybook from 'sentry/stories';
-
-export default Storybook.story('CodeSnippet', story => {
- story('Defaults', () => (
-
-
- The component is useful when you want to
- render code instructions in onboarding or other setup situations. By default, the
- code snippet is able to be copied, selected, and has rounded corners and shows in
- light mode. It'll also apply formatting automatically, if the language (passed in
- with the
- prop) is known.
-
-
-
JavaScript example:
- {`Sentry.init({
- // Note, Replay is NOT instantiated below:
- integrations: [],
-});
-
-// Sometime later
-const { replayIntegration } = await import("@sentry/browser");
-Sentry.addIntegration(replayIntegration());`}
-
-
- {`Sentry.init({
- // Note, Replay is NOT instantiated below:
- integrations: [],
-});
-
-// Sometime later
-const { replayIntegration } = await import("@sentry/browser");
-Sentry.addIntegration(replayIntegration());`}
-
- );
- });
-
- story('Callbacks', () => {
- const [tab, setTab] = useState('npm');
- const onCopy = () => addSuccessMessage('Copied!');
- const onSelectAndCopy = () =>
- addSuccessMessage(
- 'Copied...but you know you can just press the copy button to copy it all, right?'
- );
- const onTabClick = () => addSuccessMessage('Clicked a different tab');
-
- return (
-
-
- You can customize what happens when the user clicks the copy button, after the
- user highlights a part of the code snippet, after the user selects and manually
- copies the code snippet, or when a tab is clicked by specifying the callback.
-
-
-
-
-
Try pressing the copy button:
- {`Sentry.init({
- // Note, Replay is NOT instantiated below:
- integrations: [],
-});
-
-// Sometime later
-const { replayIntegration } = await import("@sentry/browser");
-Sentry.addIntegration(replayIntegration());`}
-
-
-
-
-
Try manually selecting and copying code:
- {`Sentry.init({
- // Note, Replay is NOT instantiated below:
- integrations: [],
-});
-
-// Sometime later
-const { replayIntegration } = await import("@sentry/browser");
-Sentry.addIntegration(replayIntegration());`}
-
-
-
-
-
Try switching tabs:
- {
- setTab(t);
- onTabClick();
- }}
- language="javascript"
- >
- {tab === 'npm'
- ? `npm install --save @sentry/browser`
- : 'yarn add @sentry/browser'}
- {' '}
-
- );
- });
-});
diff --git a/static/app/components/confirmDelete.tsx b/static/app/components/confirmDelete.tsx
index f46b6c9a5cb19d..3b2c2f6f9c938c 100644
--- a/static/app/components/confirmDelete.tsx
+++ b/static/app/components/confirmDelete.tsx
@@ -2,7 +2,7 @@ import {Fragment, useId} from 'react';
import Confirm from 'sentry/components/confirm';
import {Alert} from 'sentry/components/core/alert';
-import {InlineCode} from 'sentry/components/core/inlineCode';
+import {InlineCode} from 'sentry/components/core/code';
import {Input} from 'sentry/components/core/input';
import FieldGroup from 'sentry/components/forms/fieldGroup';
import {t} from 'sentry/locale';
diff --git a/static/app/components/core/code/codeBlock.mdx b/static/app/components/core/code/codeBlock.mdx
new file mode 100644
index 00000000000000..7a9355b4da952e
--- /dev/null
+++ b/static/app/components/core/code/codeBlock.mdx
@@ -0,0 +1,355 @@
+---
+title: CodeBlock
+description: CodeBlock displays multi-line code snippets with syntax highlighting, copy functionality, and support for tabs, filenames, and line highlighting.
+source: 'sentry/components/core/code'
+resources:
+ js: https://github.com/getsentry/sentry/blob/master/static/app/components/core/code/codeBlock.tsx
+ a11y:
+ WCAG 1.4.3: https://www.w3.org/TR/WCAG22/#contrast-minimum
+ WCAG 1.4.8: https://www.w3.org/TR/WCAG22/#visual-presentation
+---
+
+import {Fragment, useState} from 'react';
+
+import {addSuccessMessage} from 'sentry/actionCreators/indicator';
+import {CodeBlock} from 'sentry/components/core/code';
+import {IconStar} from 'sentry/icons';
+import * as Storybook from 'sentry/stories';
+
+import types from '!!type-loader!sentry/components/core/code/codeBlock';
+
+export {types};
+
+export const sampleJavaScript = `Sentry.init({
+ // Note, Replay is NOT instantiated below:
+ integrations: [],
+});
+
+// Sometime later
+const { replayIntegration } = await import("@sentry/browser");
+Sentry.addIntegration(replayIntegration());`;
+
+export const samplePython = `sentry_sdk.metrics.incr(
+ key="button_click",
+ value=1,
+ tags={
+ "browser": "Firefox",
+ "app_version": "1.0.0"
+ }
+)`;
+
+The `` component is useful when you want to render code instructions in onboarding or other setup situations. By default, code blocks can be copied, selected, have rounded corners, and display in light mode. They also apply syntax highlighting automatically if the language is specified.
+
+```jsx
+{sampleJavaScript}
+```
+
+## Basic Usage
+
+Use `` to display multi-line code snippets with syntax highlighting.
+
+
+
JavaScript example:
+ {sampleJavaScript}
+
+
Python example:
+ {samplePython}
+
+```jsx
+{sampleJavaScript}
+
+{samplePython}
+```
+
+## Dark Mode
+
+Use the `dark` prop to display the code block with a dark theme.
+
+
+
+ {sampleJavaScript}
+
+
+```jsx
+
+ {sampleJavaScript}
+
+```
+
+## With Filename
+
+Display a filename at the top of the code block using the `filename` prop.
+
+
+
+ {`const myVariable = 'testing';`}
+
+
+```jsx
+
+ {`const myVariable = 'testing';`}
+
+```
+
+### Dark Filename
+
+
+
+ {`const myVariable = 'testing';`}
+
+
+```jsx
+
+ {`const myVariable = 'testing';`}
+
+```
+
+## With Tabs
+
+Use the `tabs`, `selectedTab`, and `onTabClick` props to create tabbed code blocks for showing different installation methods or configurations.
+
+export function TabExample() {
+ const [tab, setTab] = useState('npm');
+ return (
+ setTab(t)}
+ language="bash"
+ >
+ {tab === 'npm' ? `npm install --save @sentry/browser` : 'yarn add @sentry/browser'}
+
+ );
+}
+
+
+
+
+```jsx const [tab, setTab] = useState('npm');
+
+ setTab(t)}
+ language="bash"
+>
+ {tab === 'npm' ? `npm install --save @sentry/browser` : 'yarn add @sentry/browser'}
+
+```
+
+## Without Rounded Corners
+
+Set `isRounded={false}` to remove rounded corners.
+
+
+
+ {sampleJavaScript}
+
+
+```jsx
+
+ {sampleJavaScript}
+
+```
+
+## Hide Copy Button
+
+Use `hideCopyButton` to hide the copy button in the top right.
+
+
+
+ {sampleJavaScript}
+
+
+```jsx
+
+ {sampleJavaScript}
+
+```
+
+## Disable User Selection
+
+Use `disableUserSelection` to prevent users from manually selecting and copying text. Useful when loading parts of a code snippet.
+
+
+
+ {sampleJavaScript}
+
+
+```jsx
+
+ {sampleJavaScript}
+
+```
+
+## With Icon
+
+Add a custom icon next to the copy button using the `icon` prop.
+
+
+ } language="javascript">
+ {sampleJavaScript}
+
+
+ } filename="yourModule.tsx" language="javascript">
+ {sampleJavaScript}
+
+
+```jsx
+} language="javascript">
+ {sampleJavaScript}
+
+
+} filename="yourModule.tsx" language="javascript">
+ {sampleJavaScript}
+
+```
+
+## Line Highlighting
+
+Use `linesToHighlight` to visually highlight specific line numbers.
+
+
+
+ {sampleJavaScript}
+
+
+```jsx
+
+ {sampleJavaScript}
+
+```
+
+## Callbacks
+
+Customize behavior with callback props.
+
+### onCopy Callback
+
+Fires when the user clicks the copy button.
+
+export function OnCopyExample() {
+ const onCopy = () => {
+ addSuccessMessage('Copied!');
+ };
+ return (
+
+ {sampleJavaScript}
+
+ );
+}
+
+
+
Try pressing the copy button:
+
+
+
+```jsx
+// track analytics, show toast, etc
+const onCopy = () => addSuccessMessage('Copied!');
+
+
+ {sampleJavaScript}
+;
+```
+
+### onSelectAndCopy Callback
+
+Fires when the user manually selects and copies code.
+
+export function OnSelectAndCopyExample() {
+ const onSelectAndCopy = () => {
+ addSuccessMessage(
+ 'Copied...but you know you can just press the copy button to copy it all, right?'
+ );
+ };
+ return (
+
+ {sampleJavaScript}
+
+ );
+}
+
+
+
Try manually selecting and copying code:
+
+
+
+```jsx
+const onSelectAndCopy = () => addSuccessMessage('Copied...but you know you can just
+press the copy button?');
+
+
+ {sampleJavaScript}
+
+```
+
+### onTabClick Callback
+
+Fires when the user switches tabs.
+
+export function OnTabClickExample() {
+ const [tab, setTab] = useState('npm');
+ function handleTabClick(t) {
+ setTab(t);
+ addSuccessMessage('Clicked a different tab');
+ };
+
+return (
+
+
+{tab === 'npm' ? `npm install --save @sentry/browser` : 'yarn add @sentry/browser'}
+
+
+);
+}
+
+
+
Try switching tabs:
+
+
+
+```jsx
+const [tab, setTab] = useState('npm');
+const onTabClick = () => addSuccessMessage('Clicked a different tab');
+
+ {
+ setTab(t);
+ onTabClick();
+ }}
+ language="bash"
+>
+ {tab === 'npm' ? `npm install --save @sentry/browser` : 'yarn add @sentry/browser'}
+;
+```
+
+## Related Components
+
+For different code display needs, consider these alternatives:
+
+- [**``**](/stories/core/inline-code): Use for short code snippets within text content
+- [**``**](/stories/typography/prose): Use for long-form content that may contain code elements
+- [**``**](/stories/typography/text#monospace): Use for monospace text that isn't necessarily code
+
+## Accessibility
+
+`` uses semantic HTML with proper `
` and `` elements for screen readers. The copy button includes proper ARIA labels and keyboard navigation support. The component maintains sufficient color contrast in both light and dark modes to meet WCAG 2.2 AA requirements.
diff --git a/static/app/components/codeSnippet.tsx b/static/app/components/core/code/codeBlock.tsx
similarity index 98%
rename from static/app/components/codeSnippet.tsx
rename to static/app/components/core/code/codeBlock.tsx
index fd854a09e77038..5d438e7f4da68c 100644
--- a/static/app/components/codeSnippet.tsx
+++ b/static/app/components/core/code/codeBlock.tsx
@@ -11,7 +11,7 @@ import {loadPrismLanguage} from 'sentry/utils/prism';
// eslint-disable-next-line no-restricted-imports -- @TODO(jonasbadalic): Remove theme import
import {darkTheme} from 'sentry/utils/theme';
-interface CodeSnippetProps {
+interface CodeBlockProps {
children: string;
className?: string;
dark?: boolean;
@@ -67,7 +67,7 @@ interface CodeSnippetProps {
}>;
}
-export function CodeSnippet({
+export function CodeBlock({
children,
className,
dark,
@@ -85,7 +85,7 @@ export function CodeSnippet({
onTabClick,
selectedTab,
tabs,
-}: CodeSnippetProps) {
+}: CodeBlockProps) {
const ref = useRef(null);
const theme = useTheme();
diff --git a/static/app/components/core/code/index.tsx b/static/app/components/core/code/index.tsx
new file mode 100644
index 00000000000000..62b28822695afc
--- /dev/null
+++ b/static/app/components/core/code/index.tsx
@@ -0,0 +1,2 @@
+export {InlineCode} from './inlineCode';
+export {CodeBlock} from './codeBlock';
diff --git a/static/app/components/core/inlineCode/index.mdx b/static/app/components/core/code/inlineCode.mdx
similarity index 91%
rename from static/app/components/core/inlineCode/index.mdx
rename to static/app/components/core/code/inlineCode.mdx
index a8bd9922df3f2d..4f7c9bfcd08dac 100644
--- a/static/app/components/core/inlineCode/index.mdx
+++ b/static/app/components/core/code/inlineCode.mdx
@@ -1,7 +1,7 @@
---
title: InlineCode
description: InlineCode provides styling for short snippets of code within text content, such as variable names, function names, or short commands.
-source: 'sentry/components/core/inlineCode'
+source: 'sentry/components/core/code'
status: stable
resources:
js: https://github.com/getsentry/sentry/blob/master/static/app/components/core/inlineCode/index.tsx
@@ -10,12 +10,12 @@ resources:
WCAG 1.4.4: https://www.w3.org/TR/WCAG22/#resize-text
---
-import {InlineCode} from 'sentry/components/core/inlineCode';
+import {InlineCode} from 'sentry/components/core/code/inlineCode';
import {Text} from 'sentry/components/core/text';
import {Prose} from 'sentry/components/core/text/prose';
import * as Storybook from 'sentry/stories';
-import types from '!!type-loader!sentry/components/core/inlineCode';
+import types from '!!type-loader!sentry/components/core/code/inlineCode';
export {types};
@@ -138,14 +138,6 @@ For long form content, `` elements are automatically styled within the [`<
```
-## Related Components
-
-For different code display needs, consider these alternatives:
-
-- **``**: Use for long-form content that may contain multiple `` elements with proper spacing and typography
-- **``**: Use for multi-line code blocks with syntax highlighting and copy functionality
-- **``**: Use for monospace text that isn't necessarily code (like IDs or timestamps)
-
@@ -175,6 +167,14 @@ For different code display needs, consider these alternatives:
```
+## Related Components
+
+For different code display needs, consider these alternatives:
+
+- [**``**](/stories/core/code-block): Use for multi-line code snippets with syntax highlighting
+- [**``**](/stories/typography/prose): Use for long-form content that may contain code elements
+- [**``**](/stories/typography/text#monospace): Use for monospace text that isn't necessarily code
+
## Accessibility
`` renders as a semantic `` element, which provides appropriate meaning to screen readers and other assistive technologies. The component maintains sufficient color contrast to meet WCAG 2.2 AA requirements.
diff --git a/static/app/components/core/inlineCode/index.tsx b/static/app/components/core/code/inlineCode.tsx
similarity index 100%
rename from static/app/components/core/inlineCode/index.tsx
rename to static/app/components/core/code/inlineCode.tsx
diff --git a/static/app/components/core/text/prose.tsx b/static/app/components/core/text/prose.tsx
index 8c431cac26e158..2603b4d9f07b12 100644
--- a/static/app/components/core/text/prose.tsx
+++ b/static/app/components/core/text/prose.tsx
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
-import {inlineCodeStyles} from 'sentry/components/core/inlineCode';
+import {inlineCodeStyles} from 'sentry/components/core/code/inlineCode';
type ProsePropsWithChildren = {
as?: T;
diff --git a/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx b/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx
index 855dacce38df94..19c1642e37ca40 100644
--- a/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx
+++ b/static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx
@@ -7,8 +7,8 @@ import kebabCase from 'lodash/kebabCase';
import mapValues from 'lodash/mapValues';
import ClippedBox from 'sentry/components/clippedBox';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {LinkButton} from 'sentry/components/core/button/linkButton';
+import {CodeBlock} from 'sentry/components/core/code';
import {Link} from 'sentry/components/core/link';
import {Tooltip} from 'sentry/components/core/tooltip';
import {getKeyValueListData as getRegressionIssueKeyValueList} from 'sentry/components/events/eventStatisticalDetector/eventRegressionSummary';
@@ -620,7 +620,7 @@ function getSpanEvidenceValue(span: Span | null) {
return `${span.op} - ${span.description}`;
}
-const StyledCodeSnippet = styled(CodeSnippet)`
+const StyledCodeSnippet = styled(CodeBlock)`
pre {
/* overflow is set to visible in global styles so need to enforce auto here */
overflow: auto !important;
diff --git a/static/app/components/events/interfaces/request/index.tsx b/static/app/components/events/interfaces/request/index.tsx
index c28bee499f09d8..5066c0a93a145f 100644
--- a/static/app/components/events/interfaces/request/index.tsx
+++ b/static/app/components/events/interfaces/request/index.tsx
@@ -2,7 +2,7 @@ import {Fragment, useState} from 'react';
import styled from '@emotion/styled';
import ClippedBox from 'sentry/components/clippedBox';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Flex} from 'sentry/components/core/layout';
import {ExternalLink} from 'sentry/components/core/link';
import {SegmentedControl} from 'sentry/components/core/segmentedControl';
@@ -141,7 +141,7 @@ export function Request({data, event}: RequestProps) {
>
{title}
{view === 'curl' ? (
- {getCurlCommand(data)}
+ {getCurlCommand(data)}
) : (
@@ -180,7 +180,7 @@ export function Request({data, event}: RequestProps) {
className="request"
>
{view === 'curl' ? (
- {getCurlCommand(data)}
+ {getCurlCommand(data)}
) : (
{defined(data.query) && (
diff --git a/static/app/components/events/interfaces/sourceMapsDebuggerModal.tsx b/static/app/components/events/interfaces/sourceMapsDebuggerModal.tsx
index f7cb7a74702db5..a1371634964ede 100644
--- a/static/app/components/events/interfaces/sourceMapsDebuggerModal.tsx
+++ b/static/app/components/events/interfaces/sourceMapsDebuggerModal.tsx
@@ -8,10 +8,10 @@ import GoodStackTraceExample from 'sentry-images/issue_details/good-stack-trace-
import type {ModalRenderProps} from 'sentry/actionCreators/modal';
import {openModal} from 'sentry/actionCreators/modal';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {ContentSliderDiff} from 'sentry/components/contentSliderDiff';
import {Alert} from 'sentry/components/core/alert';
import {LinkButton} from 'sentry/components/core/button/linkButton';
+import {CodeBlock} from 'sentry/components/core/code';
import {Flex} from 'sentry/components/core/layout';
import {ExternalLink, Link} from 'sentry/components/core/link';
import {TabList, TabPanels, Tabs} from 'sentry/components/core/tabs';
@@ -2077,7 +2077,7 @@ const WizardInstructionParagraph = styled('p')`
margin-bottom: ${space(1)};
`;
-const InstructionCodeSnippet = styled(CodeSnippet)`
+const InstructionCodeSnippet = styled(CodeBlock)`
margin: ${space(1)} 0 ${space(2)};
`;
diff --git a/static/app/components/globalDrawer/index.stories.tsx b/static/app/components/globalDrawer/index.stories.tsx
index 08b018ad3871eb..30abf94c046931 100644
--- a/static/app/components/globalDrawer/index.stories.tsx
+++ b/static/app/components/globalDrawer/index.stories.tsx
@@ -1,9 +1,9 @@
import {Fragment} from 'react';
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Alert} from 'sentry/components/core/alert';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import useDrawer from 'sentry/components/globalDrawer';
import {DrawerBody, DrawerHeader} from 'sentry/components/globalDrawer/components';
import * as Storybook from 'sentry/stories';
@@ -37,7 +37,7 @@ export default Storybook.story('GlobalDrawer', story => {
return (
-
+
{`import useDrawer from 'sentry/components/globalDrawer';
import {DrawerBody, DrawerHeader} from 'sentry/components/globalDrawer/components';
@@ -66,7 +66,7 @@ function MyDrawer({title}: {title: string}) {
);
}
`}
-
+
Open Drawer
@@ -97,7 +97,7 @@ function MyDrawer({title}: {title: string}) {
closeDrawer. The close button can be inside or outside the drawer.
-
+
{`function MyPage() {
const {openDrawer, closeDrawer} = useDrawer();
@@ -111,7 +111,7 @@ function MyDrawer({title}: {title: string}) {
return ;
}`}
-
+
@@ -138,7 +138,7 @@ function MyDrawer({title}: {title: string}) {
close.
-
+
{``}
-
+
@@ -207,7 +207,7 @@ function MyDrawer({title}: {title: string}) {
URL.
-
+
{`import {useEffect} from 'react';
import useDrawer from 'sentry/components/globalDrawer';
import {useLocation} from 'sentry/utils/useLocation';
@@ -236,7 +236,7 @@ function ModalContent() {
return
Ahoy there
;
}
`}
-
+
You don't need to worry about closing the drawer, since it'll close automatically
@@ -260,7 +260,7 @@ function ModalContent() {
padding, scrolling, and overflow.
-
+
{`import {DrawerBody, DrawerHeader} from 'sentry/components/globalDrawer/components';
`}
-
+
openDrawer(
diff --git a/static/app/components/keyValueData/index.stories.tsx b/static/app/components/keyValueData/index.stories.tsx
index 239475dd71d65a..a9ac9b2047d6e3 100644
--- a/static/app/components/keyValueData/index.stories.tsx
+++ b/static/app/components/keyValueData/index.stories.tsx
@@ -1,9 +1,9 @@
import {Fragment} from 'react';
import {useTheme, type Theme} from '@emotion/react';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Alert} from 'sentry/components/core/alert';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {
KeyValueData,
type KeyValueDataContentProps,
@@ -13,9 +13,9 @@ import * as Storybook from 'sentry/stories';
export default Storybook.story('KeyValueData', story => {
story('Usage', () => (
-
+
import KeyValueData from 'sentry/components/keyValueData';
-
+
));
story('', () => {
const theme = useTheme();
@@ -137,13 +137,13 @@ export default Storybook.story('KeyValueData', story => {
children.
-
+
{``}
-
+
It should be noted that the number of items per card, or content size is not
diff --git a/static/app/components/modals/importDashboardFromFileModal.tsx b/static/app/components/modals/importDashboardFromFileModal.tsx
index 9990e785677fab..c54c255e6bd0fd 100644
--- a/static/app/components/modals/importDashboardFromFileModal.tsx
+++ b/static/app/components/modals/importDashboardFromFileModal.tsx
@@ -6,8 +6,8 @@ import {createDashboard} from 'sentry/actionCreators/dashboards';
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
import type {ModalRenderProps} from 'sentry/actionCreators/modal';
import type {Client} from 'sentry/api';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {IconUpload} from 'sentry/icons';
import {t} from 'sentry/locale';
import type {Organization} from 'sentry/types/organization';
@@ -121,7 +121,7 @@ function ImportDashboardFromFileModal({
{t('Preview')}
- {dashboardData}
+ {dashboardData}
)}
diff --git a/static/app/components/onboarding/gettingStartedDoc/deprecatedPlatformInfo.tsx b/static/app/components/onboarding/gettingStartedDoc/deprecatedPlatformInfo.tsx
index 9779208ff7ae44..241db4a9c212bf 100644
--- a/static/app/components/onboarding/gettingStartedDoc/deprecatedPlatformInfo.tsx
+++ b/static/app/components/onboarding/gettingStartedDoc/deprecatedPlatformInfo.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Alert} from 'sentry/components/core/alert';
+import {CodeBlock} from 'sentry/components/core/code';
import {Stack} from 'sentry/components/core/layout';
import {ExternalLink} from 'sentry/components/core/link';
import {Text} from 'sentry/components/core/text';
@@ -26,9 +26,9 @@ export function DeprecatedPlatformInfo({platform, dsn}: DeprecatedPlatformInfoPr
)}
-
+
{dsn.public}
-
+
{tct(
diff --git a/static/app/components/onboarding/gettingStartedDoc/onboardingCodeSnippet.tsx b/static/app/components/onboarding/gettingStartedDoc/onboardingCodeSnippet.tsx
index fe02f1d41d7775..bb389a8f2974e2 100644
--- a/static/app/components/onboarding/gettingStartedDoc/onboardingCodeSnippet.tsx
+++ b/static/app/components/onboarding/gettingStartedDoc/onboardingCodeSnippet.tsx
@@ -2,12 +2,12 @@ import {Fragment, useCallback, useMemo, useState} from 'react';
import {createPortal} from 'react-dom';
import beautify from 'js-beautify';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {AuthTokenGenerator} from 'sentry/components/onboarding/gettingStartedDoc/authTokenGenerator';
import {PACKAGE_LOADING_PLACEHOLDER} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
interface OnboardingCodeSnippetProps
- extends Omit, 'onAfterHighlight'> {}
+ extends Omit, 'onAfterHighlight'> {}
/**
* Replaces tokens in a DOM element with a span element.
@@ -47,7 +47,7 @@ export function OnboardingCodeSnippet({
return (
-
+
{authTokenNodes.map(node => createPortal(, node))}
);
diff --git a/static/app/components/replays/breadcrumbs/breadcrumbCodeSnippet.tsx b/static/app/components/replays/breadcrumbs/breadcrumbCodeSnippet.tsx
index b6a81736084306..a38e39bb1e2107 100644
--- a/static/app/components/replays/breadcrumbs/breadcrumbCodeSnippet.tsx
+++ b/static/app/components/replays/breadcrumbs/breadcrumbCodeSnippet.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import beautify from 'js-beautify';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import Placeholder from 'sentry/components/placeholder';
import type {Extraction} from 'sentry/utils/replays/extractDomNodes';
import type {ReplayFrame} from 'sentry/utils/replays/types';
@@ -34,9 +34,9 @@ export function BreadcrumbCodeSnippet({
return extraction?.html?.map(html => (
-
+
{beautify.html(html, {indent_size: 2})}
-
+
));
}
diff --git a/static/app/components/searchQueryBuilder/index.stories.tsx b/static/app/components/searchQueryBuilder/index.stories.tsx
index eb4b4d97f62040..76fbe1af557210 100644
--- a/static/app/components/searchQueryBuilder/index.stories.tsx
+++ b/static/app/components/searchQueryBuilder/index.stories.tsx
@@ -1,7 +1,7 @@
import {Fragment, useState} from 'react';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import MultipleCheckbox from 'sentry/components/forms/controls/multipleCheckbox';
import {ItemType} from 'sentry/components/searchBar/types';
import {SearchQueryBuilder} from 'sentry/components/searchQueryBuilder';
@@ -851,7 +851,7 @@ export default Storybook.story('SearchQueryBuilder', story => {
implementation, clicking the button will open the dropdown for the first filter
with the focusOverride prop.
-
+
{`
function OpenDropdownButton() {
const {dispatch} = useSearchQueryBuilder();
@@ -884,7 +884,7 @@ function SearchQueryBuilderExample(queryBuilderProps: SearchQueryBuilderProps) {
)
}
`}
-
+
The following is the above code in action:
diff --git a/static/app/components/structuredEventData/index.stories.tsx b/static/app/components/structuredEventData/index.stories.tsx
index c2295a443dd770..d29f7c066505f0 100644
--- a/static/app/components/structuredEventData/index.stories.tsx
+++ b/static/app/components/structuredEventData/index.stories.tsx
@@ -1,7 +1,7 @@
import {Fragment, useState} from 'react';
import {addSuccessMessage} from 'sentry/actionCreators/indicator';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import StructuredEventData from 'sentry/components/structuredEventData';
import * as Storybook from 'sentry/stories';
@@ -143,14 +143,14 @@ export default Storybook.story('StructuredEventData', story => {
customize when and how certain data types are displayed.
-
+
{`const config = {
renderNull: () => 'nulllllll',
isBoolean: value => value === 'this_should_look_like_a_boolean',
}`}
-
+
Output:
{
any other custom formatting), you can set the isString with something like this:
-
+
{`const config = {
isString: (v: any) => {
return typeof v === 'string';
},
}; `}
-
+
);
});
diff --git a/static/app/components/timeline/index.stories.tsx b/static/app/components/timeline/index.stories.tsx
index 02685af464b12a..073d8a91ee2820 100644
--- a/static/app/components/timeline/index.stories.tsx
+++ b/static/app/components/timeline/index.stories.tsx
@@ -1,7 +1,7 @@
import {Fragment} from 'react';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {DateTime} from 'sentry/components/dateTime';
import {StructuredData} from 'sentry/components/structuredEventData';
import {Timeline} from 'sentry/components/timeline';
@@ -17,9 +17,9 @@ import * as Storybook from 'sentry/stories';
export default Storybook.story('Timeline', story => {
story('Usage', () => (
-
+
import Timeline from 'sentry/components/timeline';
-
+
));
story('', () => (
@@ -29,11 +29,11 @@ export default Storybook.story('Timeline', story => {
{''}. It generally contains descriptive text.
-
+
{`{someText}`}
-
+
Example
{
payloads.
-
+
{``}
-
+
Example
{
Create a usage hook to refine types.
Add a tour key to save the viewed/dismissed status.
-
+
{`import {createContext, useContext} from 'react';
import {TourElement, type TourElementProps} from 'sentry/components/tours/components';
@@ -123,7 +123,7 @@ function useMyTour(): TourContextType {
export const MY_TOUR_KEY = 'tour.my_tour';
`}
-
+
));
@@ -134,7 +134,7 @@ export const MY_TOUR_KEY = 'tour.my_tour';
and pass in the context, and
ordered steps you created earlier.
-
+
{`
orderedStepIds={ORDERED_MY_TOUR}
tourContext={MyTourContext}
@@ -142,13 +142,13 @@ export const MY_TOUR_KEY = 'tour.my_tour';
>
{/* All focused elements in the tour should be within this provider */}
`}
-
+
Now, you can use the component to wrap
the component you wish to highlight.
@@ -523,9 +523,9 @@ export default function TypographyStories() {
-
+
{FontFractionExampleStyles}
-
+
);
diff --git a/static/app/views/alerts/rules/uptime/detailsSidebar.tsx b/static/app/views/alerts/rules/uptime/detailsSidebar.tsx
index 07ebfa50e3a219..ddf7e6273976a0 100644
--- a/static/app/views/alerts/rules/uptime/detailsSidebar.tsx
+++ b/static/app/views/alerts/rules/uptime/detailsSidebar.tsx
@@ -2,8 +2,8 @@ import {Fragment} from 'react';
import styled from '@emotion/styled';
import {SectionHeading} from 'sentry/components/charts/styles';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {ActorAvatar} from 'sentry/components/core/avatar/actorAvatar';
+import {CodeBlock} from 'sentry/components/core/code';
import {Grid} from 'sentry/components/core/layout';
import {Text} from 'sentry/components/core/text';
import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable';
@@ -33,7 +33,7 @@ export function UptimeDetailsSidebar({
{t('Checked URL')}
- {`${uptimeSub.method} ${uptimeSub.url}`}
+ {`${uptimeSub.method} ${uptimeSub.url}`} {
TabularData. This is a mandatory prop. If the data{' '}
field is empty, such as
-
+
{`
${JSON.stringify(tableWithEmptyData)}
`}
-
+
To pass custom names for a column header, provide the prop aliases{' '}
which maps column key to the alias. In some cases you may have both field
@@ -105,11 +105,11 @@ ${JSON.stringify(customColumns)}
tableData={sampleHTTPRequestTableData}
aliases={aliases}
/>
-
+
{`
${JSON.stringify(aliases)}
`}
-
+
);
});
@@ -149,7 +149,7 @@ ${JSON.stringify(aliases)}
columns prop with the field sortable set to true.
e.g.,
-
+
{`
columns={[{
key: 'count(span.duration)',
@@ -163,7 +163,7 @@ columns={[{
type: 'string',
}]}
`}
-
+
This table does not sort entries. Almost all tables in Sentry rely on the{' '}
sort URL query parameter as a reference for sorting, which is why
@@ -229,7 +229,7 @@ columns={[{
sort={sort}
onChangeSort={(newSort: Sort) => onChangeSort(newSort)}
/>
-
+
{`
const [data, setData] = useState(...);
const [sort, setSort] = useState();
@@ -253,7 +253,7 @@ function onChangeSort(newSort: Sort) {
setData({data: sortedData, meta: data.meta});
}
`}
-
+
);
});
@@ -373,7 +373,7 @@ function onChangeSort(newSort: Sort) {
}
}}
/>
-
+
{`
const [filter, setFilter] = useState>([]);
@@ -390,7 +390,7 @@ function onTriggerCellAction(actions: Actions, value: string | number) {
}
}
`}
-
+
);
});
@@ -439,7 +439,7 @@ function onTriggerCellAction(actions: Actions, value: string | number) {
tableData={sampleHTTPRequestTableData}
getRenderer={getRenderer}
/>
-
+
{`
function getRenderer(fieldName: string) {
if (fieldName === 'http.request_method') {
@@ -455,7 +455,7 @@ function getRenderer(fieldName: string) {
);
}
`}
-
+
);
});
diff --git a/static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.stories.tsx b/static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.stories.tsx
index e32169e0993c7b..f0ac4d323e9951 100644
--- a/static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.stories.tsx
+++ b/static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.stories.tsx
@@ -5,8 +5,8 @@ import styled from '@emotion/styled';
import shuffle from 'lodash/shuffle';
import moment from 'moment-timezone';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import * as Storybook from 'sentry/stories';
import type {DateString} from 'sentry/types/core';
@@ -179,13 +179,13 @@ export default Storybook.story('TimeSeriesWidgetVisualization', (story, APIRefer
and Bars most of the time. Here's a simple example:
-
+
{`
`}
-
+
Line, Area, and Bars accept a{' '}
@@ -195,7 +195,7 @@ export default Storybook.story('TimeSeriesWidgetVisualization', (story, APIRefer
this format. Here's an example of a TimeSeries:
{t('Make sure to set monitor_beat_tasks=True in CeleryIntegration:')}
- {code}
+ {code}
);
}
@@ -483,8 +483,8 @@ $checkInId = \\Sentry\\captureCheckIn(
}
)}
- {scheduleCode}
- {upsertCode}
+ {scheduleCode}
+ {upsertCode}
);
}
@@ -528,13 +528,13 @@ export function LaravelUpsertPlatformGuide() {
'To set up, add the "sentryMonitor()" macro to your scheduled tasks defined in your "app/Console/Kernel.php" file:'
)}
- {basicConfigCode}
+ {basicConfigCode}
{t(
'By default, the Laravel SDK will infer various parameters of your scheduled task. For greater control, we expose some optional parameters on the sentryMonitor() macro.'
)}
{tct(
'For more examples see the [docsLink:Sentry Hangfire Cron Monitor documentation].',
diff --git a/static/app/views/issueDetails/streamline/foldSection.stories.tsx b/static/app/views/issueDetails/streamline/foldSection.stories.tsx
index 0718c331272778..9362c9a3756d0f 100644
--- a/static/app/views/issueDetails/streamline/foldSection.stories.tsx
+++ b/static/app/views/issueDetails/streamline/foldSection.stories.tsx
@@ -1,8 +1,8 @@
import {Fragment} from 'react';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
+import {CodeBlock} from 'sentry/components/core/code';
import {IconAdd, IconCopy, IconSubtract} from 'sentry/icons';
import * as Storybook from 'sentry/stories';
import {SectionKey} from 'sentry/views/issueDetails/streamline/context';
@@ -11,14 +11,14 @@ import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection';
export default Storybook.story('FoldSection', story => {
story('Usage', () => (
-
+
{`import {SectionKey} from 'sentry/views/issueDetails/streamline/context';
import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection';
`}
-
+
The SectionKey required in props is used to create a local storage
state key to remember the user's previous state for the fold section.
@@ -32,11 +32,11 @@ import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection';
-
+
{`
`}
-
+
);
});
diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiIOAlert.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiIOAlert.tsx
index fc90e839df53e9..4ad83c35f4e838 100644
--- a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiIOAlert.tsx
+++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiIOAlert.tsx
@@ -2,8 +2,8 @@ import {Fragment} from 'react';
import {css, useTheme} from '@emotion/react';
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Alert} from 'sentry/components/core/alert';
+import {CodeBlock} from 'sentry/components/core/code';
import {Stack} from 'sentry/components/core/layout';
import {ExternalLink} from 'sentry/components/core/link';
import {Heading, Prose} from 'sentry/components/core/text';
@@ -157,12 +157,12 @@ function PythonContent({
}
)}
-
+
{`sentry_sdk.init(
# ...
send_default_pii=True,
);`}
-
+
{tct('For more details, see the [link:integration docs].', {
link: ,
@@ -208,7 +208,7 @@ function JavaScriptContent({
}
)}
-
+
{tct('For more details, see the [link:integration docs].', {
link: (
diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/description.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/description.tsx
index f76b4b10e1e436..d07e3ed30ad8ce 100644
--- a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/description.tsx
+++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/description.tsx
@@ -3,8 +3,8 @@ import styled from '@emotion/styled';
import type {Location} from 'history';
import omit from 'lodash/omit';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {CopyToClipboardButton} from 'sentry/components/copyToClipboardButton';
+import {CodeBlock} from 'sentry/components/core/code';
import {Link} from 'sentry/components/core/link';
import LoadingIndicator from 'sentry/components/loadingIndicator';
import LinkHint from 'sentry/components/structuredEventData/linkHint';
@@ -383,7 +383,7 @@ const BodyContentWrapper = styled('div')<{padding: string}>`
padding: ${p => p.padding};
`;
-const StyledCodeSnippet = styled(CodeSnippet)`
+const StyledCodeSnippet = styled(CodeBlock)`
code {
text-wrap: wrap;
}
diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/description.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/description.tsx
index e85f58ddbb8dff..e73f4b212f9d97 100644
--- a/static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/description.tsx
+++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/description.tsx
@@ -2,8 +2,8 @@ import {Fragment, useMemo, useState} from 'react';
import styled from '@emotion/styled';
import type {Location} from 'history';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {CopyToClipboardButton} from 'sentry/components/copyToClipboardButton';
+import {CodeBlock} from 'sentry/components/core/code';
import {Link} from 'sentry/components/core/link';
import LoadingIndicator from 'sentry/components/loadingIndicator';
import LinkHint from 'sentry/components/structuredEventData/linkHint';
@@ -337,7 +337,7 @@ const BodyContentWrapper = styled('div')<{padding: string}>`
padding: ${p => p.padding};
`;
-const StyledCodeSnippet = styled(CodeSnippet)`
+const StyledCodeSnippet = styled(CodeBlock)`
code {
text-wrap: wrap;
}
diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/details/transaction/sections/request.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/details/transaction/sections/request.tsx
index c988a1c8ae5e8a..f707f15dd52cf1 100644
--- a/static/app/views/performance/newTraceDetails/traceDrawer/details/transaction/sections/request.tsx
+++ b/static/app/views/performance/newTraceDetails/traceDrawer/details/transaction/sections/request.tsx
@@ -1,7 +1,7 @@
import {Fragment, useState} from 'react';
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import {SegmentedControl} from 'sentry/components/core/segmentedControl';
import ErrorBoundary from 'sentry/components/errorBoundary';
@@ -94,7 +94,7 @@ export function Request({event}: {event: EventTransaction}) {
{
key: 'curl',
subject: t('Command'),
- value: {getCurlCommand(data)},
+ value: {getCurlCommand(data)},
},
];
diff --git a/static/app/views/preprod/buildDetails/sidebar/buildDetailsSidebarAppInfo.tsx b/static/app/views/preprod/buildDetails/sidebar/buildDetailsSidebarAppInfo.tsx
index 8c130645cc1e31..7a52ac701284dd 100644
--- a/static/app/views/preprod/buildDetails/sidebar/buildDetailsSidebarAppInfo.tsx
+++ b/static/app/views/preprod/buildDetails/sidebar/buildDetailsSidebarAppInfo.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import {PlatformIcon} from 'platformicons';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Flex} from 'sentry/components/core/layout';
import {Heading, Text} from 'sentry/components/core/text';
import {Tooltip} from 'sentry/components/core/tooltip';
@@ -228,6 +228,6 @@ const InstallableLink = styled('button')`
}
`;
-const InlineCodeSnippet = styled(CodeSnippet)`
+const InlineCodeSnippet = styled(CodeBlock)`
padding: ${p => p.theme.space['2xs']} ${p => p.theme.space.xs};
`;
diff --git a/static/app/views/prevent/tests/onboardingSteps/GHAWorkflowExpandable.tsx b/static/app/views/prevent/tests/onboardingSteps/GHAWorkflowExpandable.tsx
index 54be5c69af24d1..b895f6932f02cf 100644
--- a/static/app/views/prevent/tests/onboardingSteps/GHAWorkflowExpandable.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/GHAWorkflowExpandable.tsx
@@ -1,4 +1,4 @@
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {tct} from 'sentry/locale';
import {OnboardingStep} from 'sentry/views/prevent/tests/onboardingSteps/onboardingStep';
@@ -51,9 +51,9 @@ export function GHAWorkflowExpandable() {
}
>
-
+
{GHA_WORKFLOW_SNIPPET}
-
+
);
}
diff --git a/static/app/views/prevent/tests/onboardingSteps/addScriptToYamlStep.tsx b/static/app/views/prevent/tests/onboardingSteps/addScriptToYamlStep.tsx
index 366ad17bea3233..c542b99b603075 100644
--- a/static/app/views/prevent/tests/onboardingSteps/addScriptToYamlStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/addScriptToYamlStep.tsx
@@ -1,4 +1,4 @@
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Text} from 'sentry/components/core/text';
import {t, tct} from 'sentry/locale';
import {GHAWorkflowExpandable} from 'sentry/views/prevent/tests/onboardingSteps/GHAWorkflowExpandable';
@@ -33,9 +33,9 @@ export function AddScriptToYamlStep({step}: AddScriptToYamlStepProps) {
{t('In your CI YAML file, add below scripts to the end of your test run.')}
-
+
{SNIPPET}
-
+
{t(
'This action will download the Sentry Prevent CLI, and upload the junit.xml file generated in the previous step to Sentry.'
diff --git a/static/app/views/prevent/tests/onboardingSteps/addUploadTokenStep.tsx b/static/app/views/prevent/tests/onboardingSteps/addUploadTokenStep.tsx
index 6a04194812fc7c..2fc2b68cc46cc4 100644
--- a/static/app/views/prevent/tests/onboardingSteps/addUploadTokenStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/addUploadTokenStep.tsx
@@ -5,8 +5,8 @@ import styled from '@emotion/styled';
import testAnalyticsRepoSecretDark from 'sentry-images/features/test-analytics-repo-secret-dark.png';
import testAnalyticsRepoSecretLight from 'sentry-images/features/test-analytics-repo-secret-light.png';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Button} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {Flex} from 'sentry/components/core/layout';
import {ExternalLink} from 'sentry/components/core/link';
import {Text} from 'sentry/components/core/text';
@@ -113,6 +113,6 @@ export function AddUploadTokenStep({step}: AddUploadTokenStepProps) {
);
}
-const RightPaddedCodeSnippet = styled(CodeSnippet)`
+const RightPaddedCodeSnippet = styled(CodeBlock)`
padding-right: ${p => p.theme.space['2xl']};
`;
diff --git a/static/app/views/prevent/tests/onboardingSteps/editGHAWorkflowStep.tsx b/static/app/views/prevent/tests/onboardingSteps/editGHAWorkflowStep.tsx
index e5fd82e480073a..cc0493870d34ca 100644
--- a/static/app/views/prevent/tests/onboardingSteps/editGHAWorkflowStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/editGHAWorkflowStep.tsx
@@ -1,4 +1,4 @@
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import {Heading, Text} from 'sentry/components/core/text';
import {t, tct} from 'sentry/locale';
@@ -38,9 +38,9 @@ export function EditGHAWorkflowStep({step}: EditGHAWorkflowStepProps) {
}
)}
-
+
{PERMISSIONS_SNIPPET}
-
+
{tct(
'Set this permission at the workflow or job level. For better security, define it at the job level as it limits access to only the job that needs the OIDC token. Learn more about [link:permissions settings].',
@@ -62,9 +62,9 @@ export function EditGHAWorkflowStep({step}: EditGHAWorkflowStepProps) {
{t('In your CI YAML file, add below scripts to the end of your test run.')}
-
+
{ACTION_SNIPPET}
-
+
{t(
'This action will download the Sentry Prevent CLI, and upload the junit.xml file generated in the previous step to Sentry.'
diff --git a/static/app/views/prevent/tests/onboardingSteps/installPreventCLIStep.tsx b/static/app/views/prevent/tests/onboardingSteps/installPreventCLIStep.tsx
index b0045ea9768b6f..1aa5b263fc6a7f 100644
--- a/static/app/views/prevent/tests/onboardingSteps/installPreventCLIStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/installPreventCLIStep.tsx
@@ -1,7 +1,7 @@
import {Fragment, useState} from 'react';
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import {Select} from 'sentry/components/core/select';
import {Text} from 'sentry/components/core/text';
@@ -73,9 +73,9 @@ export function InstallPreventCLIStep({step}: InstallPreventCLIStepProps) {
'If you have Python installed already, you can run the script below to install the Sentry Prevent CLI.'
)}
-
+
{PIP_SNIPPET}
-
+
{CLILink}
)}
@@ -94,9 +94,9 @@ export function InstallPreventCLIStep({step}: InstallPreventCLIStepProps) {
setSelectedPlatform(option.value)
}
/>
-
+
{getBinarySnippet(selectedPlatform)}
-
+
{CLILink}
)}
diff --git a/static/app/views/prevent/tests/onboardingSteps/outputCoverageFileStep.tsx b/static/app/views/prevent/tests/onboardingSteps/outputCoverageFileStep.tsx
index 05a922cdeb7ca1..1a22094bce9909 100644
--- a/static/app/views/prevent/tests/onboardingSteps/outputCoverageFileStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/outputCoverageFileStep.tsx
@@ -1,7 +1,7 @@
import {Fragment, useState} from 'react';
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import {Select} from 'sentry/components/core/select';
import {Text} from 'sentry/components/core/text';
@@ -61,9 +61,9 @@ export function OutputCoverageFileStep({step}: OutputCoverageFileStepProps) {
onChange={(option: {value: Frameworks}) => setSelectedFramework(option.value)}
/>
{t('Install requirements in your terminal:')}
-
+
{INSTALL_REQUIREMENTS_SNIPPETS[selectedFramework]}
-
+
{GENERATE_FILE_SNIPPETS[selectedFramework] ? (
@@ -71,9 +71,9 @@ export function OutputCoverageFileStep({step}: OutputCoverageFileStepProps) {
'Generate a JUnit XML file that contains the results of your test run.'
)}
-
+
{GENERATE_FILE_SNIPPETS[selectedFramework]}
-
+
) : null}
diff --git a/static/app/views/prevent/tests/onboardingSteps/runTestSuiteStep.tsx b/static/app/views/prevent/tests/onboardingSteps/runTestSuiteStep.tsx
index e7984e2cf4c53b..2d7e15e7fbf86d 100644
--- a/static/app/views/prevent/tests/onboardingSteps/runTestSuiteStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/runTestSuiteStep.tsx
@@ -3,7 +3,7 @@ import {useTheme} from '@emotion/react';
import testAnalyticsPRCommentDark from 'sentry-images/features/test-analytics-pr-comment-dark.png';
import testAnalyticsPRCommentLight from 'sentry-images/features/test-analytics-pr-comment-light.png';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Text} from 'sentry/components/core/text';
import {t, tct} from 'sentry/locale';
import {OnboardingStep} from 'sentry/views/prevent/tests/onboardingSteps/onboardingStep';
@@ -36,9 +36,9 @@ export function RunTestSuiteStep({step}: RunTestSuiteStepProps) {
'You can inspect the workflow logs to see if the call to Sentry succeeded.'
)}
-
+
{WORKFLOW_LOGS_SNIPPET}
-
+
{t(
'Run your tests as usual. A failed test is needed to view the failed tests report.'
diff --git a/static/app/views/prevent/tests/onboardingSteps/uploadFileCLIStep.tsx b/static/app/views/prevent/tests/onboardingSteps/uploadFileCLIStep.tsx
index dd6a82bef3c720..f41f9a7c76e56f 100644
--- a/static/app/views/prevent/tests/onboardingSteps/uploadFileCLIStep.tsx
+++ b/static/app/views/prevent/tests/onboardingSteps/uploadFileCLIStep.tsx
@@ -1,4 +1,4 @@
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Text} from 'sentry/components/core/text';
import {t, tct} from 'sentry/locale';
import {OnboardingStep} from 'sentry/views/prevent/tests/onboardingSteps/onboardingStep';
@@ -32,9 +32,9 @@ export function UploadFileCLIStep({previousStep, step}: UploadFileCLIStepProps)
'The following snippet instructs the CLI to upload this report to Sentry Prevent.'
)}
-
+
{SNIPPET}
-
+
{tct(
'Be sure to specify [code:--report-type] as [code:test_results] and include the file you created in Step [previousStep]. This will not necessarily upload coverage reports to Sentry.',
diff --git a/static/app/views/projectInstall/otherPlatformsInfo.tsx b/static/app/views/projectInstall/otherPlatformsInfo.tsx
index 7b9dca20ea49f2..d74590a3feba7a 100644
--- a/static/app/views/projectInstall/otherPlatformsInfo.tsx
+++ b/static/app/views/projectInstall/otherPlatformsInfo.tsx
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import List from 'sentry/components/list';
import ListItem from 'sentry/components/list/listItem';
@@ -44,9 +44,9 @@ export function OtherPlatformsInfo({
"We cannot provide instructions for '%s' projects. However, please find below the DSN key for this project, which is required to instrument Sentry.",
platform
)}
-
+
{t('dsn: %s', data[0]!.dsn.public)}
-
+
{t(
'Since it can be a lot of work creating a Sentry SDK from scratch, we suggest you review the following SDKs which are applicable for a wide variety of applications:'
diff --git a/static/app/views/releases/list/releasesPromo.tsx b/static/app/views/releases/list/releasesPromo.tsx
index b1944e4415c441..7664fbf96ce997 100644
--- a/static/app/views/releases/list/releasesPromo.tsx
+++ b/static/app/views/releases/list/releasesPromo.tsx
@@ -6,10 +6,10 @@ import resolutionImage from 'sentry-images/spot/releases-tour-resolution.svg';
import statsImage from 'sentry-images/spot/releases-tour-stats.svg';
import {openCreateReleaseIntegration} from 'sentry/actionCreators/modal';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {SentryAppAvatar} from 'sentry/components/core/avatar/sentryAppAvatar';
import {Button} from 'sentry/components/core/button';
import {LinkButton} from 'sentry/components/core/button/linkButton';
+import {CodeBlock} from 'sentry/components/core/code';
import {CompactSelect, type SelectOption} from 'sentry/components/core/compactSelect';
import {Flex, Stack} from 'sentry/components/core/layout';
import {Heading, Text} from 'sentry/components/core/text';
@@ -257,14 +257,14 @@ sentry-cli releases finalize "$VERSION"`;
}}
/>
-
{setupExample}
-
+
);
diff --git a/static/app/views/relocation/encryptBackup.tsx b/static/app/views/relocation/encryptBackup.tsx
index 79971785edb01a..0d834edf815334 100644
--- a/static/app/views/relocation/encryptBackup.tsx
+++ b/static/app/views/relocation/encryptBackup.tsx
@@ -1,6 +1,6 @@
import {motion} from 'framer-motion';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {IconTerminal} from 'sentry/icons';
import {t} from 'sentry/locale';
import testableTransition from 'sentry/utils/testableTransition';
@@ -33,7 +33,7 @@ export function EncryptBackup(props: StepProps) {
self-hosted
{t('install when you execute it.')}
-
{code}
-
+
{t('Understanding the command:')}
diff --git a/static/app/views/relocation/publicKey.tsx b/static/app/views/relocation/publicKey.tsx
index 6f7e4490f60adb..724ed75d0d91b9 100644
--- a/static/app/views/relocation/publicKey.tsx
+++ b/static/app/views/relocation/publicKey.tsx
@@ -1,6 +1,6 @@
import {motion} from 'framer-motion';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import LoadingIndicator from 'sentry/components/loadingIndicator';
import {IconFile} from 'sentry/icons/iconFile';
import {t} from 'sentry/locale';
@@ -36,9 +36,9 @@ export function PublicKey({publicKeys, relocationState, onComplete}: StepProps)
"To do so, you'll need to save the following public key to a file accessible from wherever your self-hosted repository is currently installed. You'll need to have this public key file available for the next step."
)}
- } hideCopyButton={false}>
+ } hideCopyButton={false}>
{publicKey}
-
+
) : (
diff --git a/static/app/views/replays/detail/network/details/onboarding.tsx b/static/app/views/replays/detail/network/details/onboarding.tsx
index bf268cec07fd4f..cdab94b12bae7e 100644
--- a/static/app/views/replays/detail/network/details/onboarding.tsx
+++ b/static/app/views/replays/detail/network/details/onboarding.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Alert} from 'sentry/components/core/alert';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink} from 'sentry/components/core/link';
import TextCopyInput from 'sentry/components/textCopyInput';
import {t, tct} from 'sentry/locale';
@@ -204,9 +204,9 @@ function SetupInstructions({
{t('That’s it!')}
{url !== '[Filtered]' && (
-
+
{code}
-
+
)}
);
diff --git a/static/app/views/replays/selectors/selectorLink.tsx b/static/app/views/replays/selectors/selectorLink.tsx
index f0bffa5baef862..a777b4fd4babf9 100644
--- a/static/app/views/replays/selectors/selectorLink.tsx
+++ b/static/app/views/replays/selectors/selectorLink.tsx
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {Link} from 'sentry/components/core/link';
import TextOverflow from 'sentry/components/textOverflow';
import {t} from 'sentry/locale';
@@ -25,9 +25,9 @@ export function SelectorLink({
{t('Search for replays with clicks on the element')}
-
+
{value}
-
+
);
diff --git a/static/app/views/settings/organizationRelay/modals/add/terminal.tsx b/static/app/views/settings/organizationRelay/modals/add/terminal.tsx
index d663bcd361a553..10df0672e02c5d 100644
--- a/static/app/views/settings/organizationRelay/modals/add/terminal.tsx
+++ b/static/app/views/settings/organizationRelay/modals/add/terminal.tsx
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import {space} from 'sentry/styles/space';
type Props = {
@@ -13,7 +13,7 @@ function Terminal({command}: Props) {
export default Terminal;
-const StyledCodeSnippet = styled(CodeSnippet)`
+const StyledCodeSnippet = styled(CodeBlock)`
padding-left: ${space(2)};
&:before {
content: '\0024';
diff --git a/static/app/views/settings/projectSourceMaps/sourceMapsList.tsx b/static/app/views/settings/projectSourceMaps/sourceMapsList.tsx
index 969786d9e3cc2c..abc34b51907c4e 100644
--- a/static/app/views/settings/projectSourceMaps/sourceMapsList.tsx
+++ b/static/app/views/settings/projectSourceMaps/sourceMapsList.tsx
@@ -3,9 +3,9 @@ import {css} from '@emotion/react';
import styled from '@emotion/styled';
import Access from 'sentry/components/acl/access';
-import {CodeSnippet} from 'sentry/components/codeSnippet';
import Confirm from 'sentry/components/confirm';
import {Button, type ButtonProps} from 'sentry/components/core/button';
+import {CodeBlock} from 'sentry/components/core/code';
import {ExternalLink, Link} from 'sentry/components/core/link';
import {Tooltip} from 'sentry/components/core/tooltip';
import {DateTime} from 'sentry/components/dateTime';
@@ -258,7 +258,7 @@ function ReactNativeCallOut() {
{strong: }
)}
-
+
);
}
diff --git a/static/gsAdmin/views/relocationArtifactDetails.tsx b/static/gsAdmin/views/relocationArtifactDetails.tsx
index 22dabfabfe146e..598f3f47b5e67d 100644
--- a/static/gsAdmin/views/relocationArtifactDetails.tsx
+++ b/static/gsAdmin/views/relocationArtifactDetails.tsx
@@ -1,4 +1,4 @@
-import {CodeSnippet} from 'sentry/components/codeSnippet';
+import {CodeBlock} from 'sentry/components/core/code';
import LoadingError from 'sentry/components/loadingError';
import LoadingIndicator from 'sentry/components/loadingIndicator';
import {IconFile} from 'sentry/icons/iconFile';
@@ -49,9 +49,9 @@ export default function RelocationArtifactDetails() {
sections={[
{
content: (
- }>
+ }>
{data?.contents ?? ''}
-
+
),
},
]}