Skip to content

Commit

Permalink
feat: add example dir to global filter
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 15, 2024
1 parent 55ef138 commit 35ce124
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 75 deletions.
2 changes: 1 addition & 1 deletion react/filterPanel/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ],
"types": ["./src/Example/customTypings.d.ts"],
"resolveJsonModule": true
},
"include": ["./src"]
Expand Down
11 changes: 11 additions & 0 deletions react/globalFilter/src/Example/Example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Grid, Column } from '@carbon/react';
import { GlobalFilter } from './GlobalFilter';
import './example.scss';

export const Example = () => (
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<GlobalFilter />
</Column>
</Grid>
);
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import {

// A TanStack fork of Kent C. Dodds' match-sorter library that provides ranking information
import { rankItem } from '@tanstack/match-sorter-utils';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons';
import * as packageJson from '../package.json';
import * as packageJson from '../../package.json';

import { makeData, Resource } from './makeData';

Expand Down Expand Up @@ -112,26 +111,6 @@ export const GlobalFilter = () => {
<TableContainer
title="Global filter"
className="basic-table"
description={
<span className="flex">
<ExampleLink
url={`${import.meta.env.VITE_CODE_SANDBOX_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="Code sandbox"
/>
<ExampleLink
url={`${import.meta.env.VITE_STACK_BLITZ_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="StackBlitz"
/>
excludes <CodeSnippet type="inline">Example</CodeSnippet> column
from global filtering
</span>
}
style={{
width: table.getCenterTotalSize(),
}}>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,20 @@
.tanstack-example {
padding-bottom: 2rem;
}

.cds--data-table.empty-table-wrapper td,
.cds--data-table.empty-table-wrapper tbody th,
.cds--data-table.empty-table-wrapper tbody tr:hover td {
border-block-end: 0;
}

.cds--data-table tbody.empty-table-body,
.cds--data-table tbody.empty-table-body tr:not([data-child-row]):hover,
.cds--data-table tbody.empty-table-body tr[data-child-row]:hover > td {
background-color: transparent;
}

.cds--data-table td .empty-table {
position: absolute;
max-width: 265px;
}
1 change: 1 addition & 0 deletions react/globalFilter/src/Example/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Example } from './Example';
File renamed without changes.
9 changes: 0 additions & 9 deletions react/globalFilter/src/ExampleLink.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions react/globalFilter/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +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;
}

.cds--data-table.empty-table-wrapper td,
.cds--data-table.empty-table-wrapper tbody th,
.cds--data-table.empty-table-wrapper tbody tr:hover td {
border-block-end: 0;
}

.cds--data-table tbody.empty-table-body,
.cds--data-table tbody.empty-table-body tr:not([data-child-row]):hover,
.cds--data-table tbody.empty-table-body tr[data-child-row]:hover > td {
background-color: transparent;
}

.cds--data-table td .empty-table {
position: absolute;
max-width: 265px;
}
3 changes: 0 additions & 3 deletions react/globalFilter/src/index.ts

This file was deleted.

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

import { GlobalFilter } from './GlobalFilter';
import { Example } from './Example';

import './index.scss';

Expand All @@ -32,10 +29,6 @@ const renderUIShellHeader = () => (
createRoot(document.getElementById('root')!).render(
<StrictMode>
{renderUIShellHeader()}
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<GlobalFilter />
</Column>
</Grid>
<Example />
</StrictMode>
);
2 changes: 1 addition & 1 deletion react/globalFilter/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 35ce124

Please sign in to comment.