|
7 | 7 |
|
8 | 8 | import React from 'react'; |
9 | 9 | import { CodeSnippet, CodeSnippetSkeleton } from 'carbon-components-react'; |
| 10 | +import { Layer } from '../Layer'; |
10 | 11 |
|
11 | 12 | export default { |
12 | 13 | title: 'Components/CodeSnippet', |
@@ -60,6 +61,153 @@ export const singleline = () => ( |
60 | 61 | </CodeSnippet> |
61 | 62 | ); |
62 | 63 |
|
| 64 | +export const inlineWithLayer = () => { |
| 65 | + return ( |
| 66 | + <> |
| 67 | + <CodeSnippet type="inline" feedback="Copied to clipboard"> |
| 68 | + {'node -v'} |
| 69 | + </CodeSnippet> |
| 70 | + <Layer> |
| 71 | + <CodeSnippet type="inline" feedback="Copied to clipboard"> |
| 72 | + {'node -v'} |
| 73 | + </CodeSnippet> |
| 74 | + <Layer> |
| 75 | + <CodeSnippet type="inline" feedback="Copied to clipboard"> |
| 76 | + {'node -v'} |
| 77 | + </CodeSnippet> |
| 78 | + </Layer> |
| 79 | + </Layer> |
| 80 | + </> |
| 81 | + ); |
| 82 | +}; |
| 83 | + |
| 84 | +export const multilineWithLayer = () => { |
| 85 | + return ( |
| 86 | + <> |
| 87 | + <CodeSnippet type="multi" feedback="Copied to clipboard"> |
| 88 | + {` "scripts": { |
| 89 | + "build": "lerna run build --stream --prefix --npm-client yarn", |
| 90 | + "ci-check": "carbon-cli ci-check", |
| 91 | + "clean": "lerna run clean && lerna clean --yes && rimraf node_modules", |
| 92 | + "doctoc": "doctoc --title '## Table of Contents'", |
| 93 | + "format": "prettier --write '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**'", |
| 94 | + "format:diff": "prettier --list-different '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'", |
| 95 | + "lint": "eslint actions config codemods packages", |
| 96 | + "lint:styles": "stylelint '**/*.{css,scss}' --report-needless-disables --report-invalid-scope-disables", |
| 97 | + "sync": "carbon-cli sync", |
| 98 | + "test": "cross-env BABEL_ENV=test jest", |
| 99 | + "test:e2e": "cross-env BABEL_ENV=test jest --testPathPattern=e2e --testPathIgnorePatterns='examples,/packages/components/,/packages/react/'" |
| 100 | + }, |
| 101 | + "resolutions": { |
| 102 | + "react": "~16.9.0", |
| 103 | + "react-dom": "~16.9.0", |
| 104 | + "react-is": "~16.9.0", |
| 105 | + "react-test-renderer": "~16.9.0" |
| 106 | + }, |
| 107 | + "devDependencies": { |
| 108 | + "@babel/core": "^7.10.0", |
| 109 | + "@babel/plugin-proposal-class-properties": "^7.7.4", |
| 110 | + "@babel/plugin-proposal-export-default-from": "^7.7.4", |
| 111 | + "@babel/plugin-proposal-export-namespace-from": "^7.7.4", |
| 112 | + "@babel/plugin-transform-runtime": "^7.10.0", |
| 113 | + "@babel/preset-env": "^7.10.0", |
| 114 | + "@babel/preset-react": "^7.10.0", |
| 115 | + "@babel/runtime": "^7.10.0", |
| 116 | + "@commitlint/cli": "^8.3.5",`} |
| 117 | + </CodeSnippet> |
| 118 | + <Layer> |
| 119 | + <CodeSnippet type="multi" feedback="Copied to clipboard"> |
| 120 | + {` "scripts": { |
| 121 | + "build": "lerna run build --stream --prefix --npm-client yarn", |
| 122 | + "ci-check": "carbon-cli ci-check", |
| 123 | + "clean": "lerna run clean && lerna clean --yes && rimraf node_modules", |
| 124 | + "doctoc": "doctoc --title '## Table of Contents'", |
| 125 | + "format": "prettier --write '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**'", |
| 126 | + "format:diff": "prettier --list-different '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'", |
| 127 | + "lint": "eslint actions config codemods packages", |
| 128 | + "lint:styles": "stylelint '**/*.{css,scss}' --report-needless-disables --report-invalid-scope-disables", |
| 129 | + "sync": "carbon-cli sync", |
| 130 | + "test": "cross-env BABEL_ENV=test jest", |
| 131 | + "test:e2e": "cross-env BABEL_ENV=test jest --testPathPattern=e2e --testPathIgnorePatterns='examples,/packages/components/,/packages/react/'" |
| 132 | + }, |
| 133 | + "resolutions": { |
| 134 | + "react": "~16.9.0", |
| 135 | + "react-dom": "~16.9.0", |
| 136 | + "react-is": "~16.9.0", |
| 137 | + "react-test-renderer": "~16.9.0" |
| 138 | + }, |
| 139 | + "devDependencies": { |
| 140 | + "@babel/core": "^7.10.0", |
| 141 | + "@babel/plugin-proposal-class-properties": "^7.7.4", |
| 142 | + "@babel/plugin-proposal-export-default-from": "^7.7.4", |
| 143 | + "@babel/plugin-proposal-export-namespace-from": "^7.7.4", |
| 144 | + "@babel/plugin-transform-runtime": "^7.10.0", |
| 145 | + "@babel/preset-env": "^7.10.0", |
| 146 | + "@babel/preset-react": "^7.10.0", |
| 147 | + "@babel/runtime": "^7.10.0", |
| 148 | + "@commitlint/cli": "^8.3.5",`} |
| 149 | + </CodeSnippet> |
| 150 | + <Layer> |
| 151 | + <CodeSnippet type="multi" feedback="Copied to clipboard"> |
| 152 | + {` "scripts": { |
| 153 | + "build": "lerna run build --stream --prefix --npm-client yarn", |
| 154 | + "ci-check": "carbon-cli ci-check", |
| 155 | + "clean": "lerna run clean && lerna clean --yes && rimraf node_modules", |
| 156 | + "doctoc": "doctoc --title '## Table of Contents'", |
| 157 | + "format": "prettier --write '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**'", |
| 158 | + "format:diff": "prettier --list-different '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'", |
| 159 | + "lint": "eslint actions config codemods packages", |
| 160 | + "lint:styles": "stylelint '**/*.{css,scss}' --report-needless-disables --report-invalid-scope-disables", |
| 161 | + "sync": "carbon-cli sync", |
| 162 | + "test": "cross-env BABEL_ENV=test jest", |
| 163 | + "test:e2e": "cross-env BABEL_ENV=test jest --testPathPattern=e2e --testPathIgnorePatterns='examples,/packages/components/,/packages/react/'" |
| 164 | + }, |
| 165 | + "resolutions": { |
| 166 | + "react": "~16.9.0", |
| 167 | + "react-dom": "~16.9.0", |
| 168 | + "react-is": "~16.9.0", |
| 169 | + "react-test-renderer": "~16.9.0" |
| 170 | + }, |
| 171 | + "devDependencies": { |
| 172 | + "@babel/core": "^7.10.0", |
| 173 | + "@babel/plugin-proposal-class-properties": "^7.7.4", |
| 174 | + "@babel/plugin-proposal-export-default-from": "^7.7.4", |
| 175 | + "@babel/plugin-proposal-export-namespace-from": "^7.7.4", |
| 176 | + "@babel/plugin-transform-runtime": "^7.10.0", |
| 177 | + "@babel/preset-env": "^7.10.0", |
| 178 | + "@babel/preset-react": "^7.10.0", |
| 179 | + "@babel/runtime": "^7.10.0", |
| 180 | + "@commitlint/cli": "^8.3.5",`} |
| 181 | + </CodeSnippet> |
| 182 | + </Layer> |
| 183 | + </Layer> |
| 184 | + </> |
| 185 | + ); |
| 186 | +}; |
| 187 | + |
| 188 | +export const singlelineWithLayer = () => { |
| 189 | + return ( |
| 190 | + <> |
| 191 | + <CodeSnippet type="single" feedback="Copied to clipboard"> |
| 192 | + yarn add carbon-components@latest carbon-components-react@latest |
| 193 | + @carbon/icons-react@latest carbon-icons@latest |
| 194 | + </CodeSnippet> |
| 195 | + <Layer> |
| 196 | + <CodeSnippet type="single" feedback="Copied to clipboard"> |
| 197 | + yarn add carbon-components@latest carbon-components-react@latest |
| 198 | + @carbon/icons-react@latest carbon-icons@latest |
| 199 | + </CodeSnippet> |
| 200 | + <Layer> |
| 201 | + <CodeSnippet type="single" feedback="Copied to clipboard"> |
| 202 | + yarn add carbon-components@latest carbon-components-react@latest |
| 203 | + @carbon/icons-react@latest carbon-icons@latest |
| 204 | + </CodeSnippet> |
| 205 | + </Layer> |
| 206 | + </Layer> |
| 207 | + </> |
| 208 | + ); |
| 209 | +}; |
| 210 | + |
63 | 211 | export const skeleton = () => ( |
64 | 212 | <div> |
65 | 213 | <CodeSnippetSkeleton type="single" style={{ marginBottom: 8 }} /> |
|
0 commit comments