File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22// SPDX-License-Identifier: Apache-2.0
33
4- import { SpaceBetween } from "@cloudscape-design/components" ;
4+ import { Button , SpaceBetween } from "@cloudscape-design/components" ;
55
66import { CodeView } from "../../lib/components" ;
77import { ScreenshotArea } from "../screenshot-area" ;
@@ -12,6 +12,11 @@ export default function CodeViewPage() {
1212 < SpaceBetween direction = "vertical" size = "l" >
1313 < CodeView lineNumbers = { true } content = { `# Hello World` } />
1414 < CodeView lineNumbers = { true } content = { `# Hello World\n\nThis is Cloudscape.` } />
15+ < CodeView
16+ lineNumbers = { true }
17+ content = { `# Hello World` }
18+ actions = { < Button ariaLabel = "Copy code" iconName = "copy" > </ Button > }
19+ />
1520 </ SpaceBetween >
1621 </ ScreenshotArea >
1722 ) ;
Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ export function InternalCodeView({
4949 < div className = { clsx ( lineNumbers && styles [ "root-with-numbers" ] , actions && styles [ "root-with-actions" ] ) } >
5050 < Box color = "text-status-inactive" fontSize = "body-m" >
5151 { lineNumbers && (
52- < div className = { styles [ "line-numbers" ] } aria-hidden = { true } >
52+ < div
53+ className = { clsx ( styles [ "line-numbers" ] , actions && styles [ "line-numbers-with-actions" ] ) }
54+ aria-hidden = { true }
55+ >
5356 { getLineNumbers ( content ) . map ( ( number ) => (
5457 < span key = { number } > { number } </ span >
5558 ) ) }
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ $color-background-code-view-dark: #282c34;
4949 :global (.awsui-polaris-dark-mode ) & {
5050 background-color : $color-background-code-view-dark ;
5151 }
52+ & -with-actions {
53+ min-block-size : cs .$space-scaled-xxl ;
54+ }
5255 border-start-start-radius: cs .$border-radius-tiles ;
5356 border-end-start-radius: cs .$border-radius-tiles ;
5457 background-color: $color-background-code-view-light ;
You can’t perform that action at this time.
0 commit comments