Skip to content

Commit

Permalink
feat(react, ai-label): update structure to scope all example code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 14, 2024
1 parent bdf0cb2 commit af85222
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 43 deletions.
19 changes: 19 additions & 0 deletions react/ai-label/src/Example/AiExamples.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Column, Grid } from '@carbon/react';
import { SortableWithAiLabel } from './SortableWithAiLabel';
import { ColumnWithAiLabel } from './ColumnWithAiLabel';
import { WithSelection } from './WithSelection';
import './example.scss';

export const AiExamples = () => (
<Grid className="page-grid">
<Column sm={4} md={8} lg={8}>
<ColumnWithAiLabel />
</Column>
<Column sm={4} md={8} lg={8}>
<SortableWithAiLabel />
</Column>
<Column sm={4} md={8} lg={8}>
<WithSelection />
</Column>
</Grid>
);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions react/ai-label/src/ExampleLink.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions react/ai-label/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 0 additions & 3 deletions react/ai-label/src/index.ts

This file was deleted.

19 changes: 2 additions & 17 deletions react/ai-label/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import {
CodeSnippet,
Column,
Grid,
Header,
HeaderContainer,
HeaderName,
} from '@carbon/react';

import { SortableWithAiLabel } from './SortableWithAiLabel';
import { ColumnWithAiLabel } from './ColumnWithAiLabel';

import './index.scss';
import { WithSelection } from './WithSelection';
import { AiExamples } from './Example/AiExamples';

const renderUIShellHeader = () => (
<HeaderContainer
Expand All @@ -34,16 +29,6 @@ const renderUIShellHeader = () => (
createRoot(document.getElementById('root')!).render(
<StrictMode>
{renderUIShellHeader()}
<Grid className="page-grid">
<Column sm={4} md={8} lg={8}>
<ColumnWithAiLabel />
</Column>
<Column sm={4} md={8} lg={8}>
<SortableWithAiLabel />
</Column>
<Column sm={4} md={8} lg={8}>
<WithSelection />
</Column>
</Grid>
<AiExamples />
</StrictMode>
);
2 changes: 1 addition & 1 deletion react/ai-label/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": ["./src/customTypings.d.ts"],
"types": ["./src/Example/customTypings.d.ts"],
"resolveJsonModule": true
},
"include": ["./src"]
Expand Down

0 comments on commit af85222

Please sign in to comment.