From 9043097076d50c5113e673371630aa413cf0869f Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Fri, 15 Nov 2024 11:41:43 -0500 Subject: [PATCH] feat: add example structure for col alignment --- .../src/{ => Example}/ColumnAlignment.tsx | 21 +------------------ .../column-alignment/src/Example/Example.tsx | 13 ++++++++++++ .../src/{ => Example}/customTypings.d.ts | 0 .../src/{App.scss => Example/example.scss} | 0 react/column-alignment/src/Example/index.ts | 1 + .../src/{ => Example}/makeData.ts | 0 react/column-alignment/src/ExampleLink.tsx | 9 -------- react/column-alignment/src/index.scss | 13 ------------ react/column-alignment/src/index.ts | 3 --- react/column-alignment/src/main.tsx | 11 ++-------- react/column-alignment/tsconfig.app.json | 2 +- 11 files changed, 18 insertions(+), 55 deletions(-) rename react/column-alignment/src/{ => Example}/ColumnAlignment.tsx (86%) create mode 100644 react/column-alignment/src/Example/Example.tsx rename react/column-alignment/src/{ => Example}/customTypings.d.ts (100%) rename react/column-alignment/src/{App.scss => Example/example.scss} (100%) create mode 100644 react/column-alignment/src/Example/index.ts rename react/column-alignment/src/{ => Example}/makeData.ts (100%) delete mode 100644 react/column-alignment/src/ExampleLink.tsx delete mode 100644 react/column-alignment/src/index.ts diff --git a/react/column-alignment/src/ColumnAlignment.tsx b/react/column-alignment/src/Example/ColumnAlignment.tsx similarity index 86% rename from react/column-alignment/src/ColumnAlignment.tsx rename to react/column-alignment/src/Example/ColumnAlignment.tsx index 2271ceb..653d868 100644 --- a/react/column-alignment/src/ColumnAlignment.tsx +++ b/react/column-alignment/src/Example/ColumnAlignment.tsx @@ -17,9 +17,8 @@ import { useReactTable, } from '@tanstack/react-table'; import { makeData } from './makeData'; -import { ExampleLink } from './ExampleLink'; import { Launch } from '@carbon/react/icons'; -import * as packageJson from '../package.json'; +import * as packageJson from '../../package.json'; import { StatusIcon } from '@carbon/ibm-products'; type Resource = { @@ -104,24 +103,6 @@ export const ColumnAlignment = () => { - - - - } style={{ width: table.getCenterTotalSize(), }}> diff --git a/react/column-alignment/src/Example/Example.tsx b/react/column-alignment/src/Example/Example.tsx new file mode 100644 index 0000000..d629b29 --- /dev/null +++ b/react/column-alignment/src/Example/Example.tsx @@ -0,0 +1,13 @@ +import { Column, Grid } from '@carbon/react'; +import { ColumnAlignment } from './ColumnAlignment'; +import './example.scss'; + +export const Example = () => { + return ( + + + + + + ); +}; diff --git a/react/column-alignment/src/customTypings.d.ts b/react/column-alignment/src/Example/customTypings.d.ts similarity index 100% rename from react/column-alignment/src/customTypings.d.ts rename to react/column-alignment/src/Example/customTypings.d.ts diff --git a/react/column-alignment/src/App.scss b/react/column-alignment/src/Example/example.scss similarity index 100% rename from react/column-alignment/src/App.scss rename to react/column-alignment/src/Example/example.scss diff --git a/react/column-alignment/src/Example/index.ts b/react/column-alignment/src/Example/index.ts new file mode 100644 index 0000000..8765fbd --- /dev/null +++ b/react/column-alignment/src/Example/index.ts @@ -0,0 +1 @@ +export { Example } from './Example'; diff --git a/react/column-alignment/src/makeData.ts b/react/column-alignment/src/Example/makeData.ts similarity index 100% rename from react/column-alignment/src/makeData.ts rename to react/column-alignment/src/Example/makeData.ts diff --git a/react/column-alignment/src/ExampleLink.tsx b/react/column-alignment/src/ExampleLink.tsx deleted file mode 100644 index 7a03b61..0000000 --- a/react/column-alignment/src/ExampleLink.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export const ExampleLink = ({ icon, label, url }) => { - const Icon = icon; - return ( - - {icon && } - {label} - - ); -}; diff --git a/react/column-alignment/src/index.scss b/react/column-alignment/src/index.scss index 8965062..e3f9104 100644 --- a/react/column-alignment/src/index.scss +++ b/react/column-alignment/src/index.scss @@ -3,21 +3,8 @@ ); @use '@carbon/styles/scss/type'; @use '@carbon/ibm-products/css/index'; -@use './App'; body { margin: 0; padding: 0; } - -.example--link { - @include type.type-style('label-01'); - - display: flex; - align-items: center; - margin-right: 0.5rem; -} - -.example--link__icon { - margin-right: 0.25rem; -} diff --git a/react/column-alignment/src/index.ts b/react/column-alignment/src/index.ts deleted file mode 100644 index 5c9e25a..0000000 --- a/react/column-alignment/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ResizableCols } from './ColumnAlignment'; - -export { ResizableCols }; diff --git a/react/column-alignment/src/main.tsx b/react/column-alignment/src/main.tsx index ad43ac7..26b45da 100644 --- a/react/column-alignment/src/main.tsx +++ b/react/column-alignment/src/main.tsx @@ -2,16 +2,13 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { CodeSnippet, - Column, - Grid, Header, HeaderContainer, HeaderName, } from '@carbon/react'; -import { ColumnAlignment } from './ColumnAlignment'; - import './index.scss'; +import { Example } from './Example'; const renderUIShellHeader = () => ( ( createRoot(document.getElementById('root')!).render( {renderUIShellHeader()} - - - - - + ); diff --git a/react/column-alignment/tsconfig.app.json b/react/column-alignment/tsconfig.app.json index a68cf5e..a6e3949 100644 --- a/react/column-alignment/tsconfig.app.json +++ b/react/column-alignment/tsconfig.app.json @@ -21,7 +21,7 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "types": [ "./src/customTypings.d.ts" ], + "types": ["./src/Example/customTypings.d.ts"], "resolveJsonModule": true }, "include": ["./src"]