Skip to content

Commit

Permalink
feat: add example dir to filter panel
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 15, 2024
1 parent 136017d commit 55ef138
Showing 10 changed files with 21 additions and 55 deletions.
11 changes: 11 additions & 0 deletions react/filterPanel/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 { FilterPanel } from './FilterPanel';
import './example.scss';

export const Example = () => (
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<FilterPanel />
</Column>
</Grid>
);
Original file line number Diff line number Diff line change
@@ -49,9 +49,8 @@ import { rankItem } from '@tanstack/match-sorter-utils';

import { makeData } from './makeData';
import { TagOverflow, pkg } from '@carbon/ibm-products';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons';
import * as packageJson from '../package.json';
import * as packageJson from '../../package.json';

pkg.component.TagOverflow = true;

@@ -297,24 +296,6 @@ export const FilterPanel = () => {
<TableContainer
title="Filter panel"
className="basic-table tanstack-example filter-flyout-example filter-panel-example"
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"
/>
</span>
}
style={{
width: table.getCenterTotalSize(),
}}>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -37,8 +37,6 @@
.flyout--label {
@include type.type-style('body-compact-01');
@include font-family.font-weight('semibold');

padding-bottom: 1rem;
}

.filter-flyout-example .cds--popover-content {
@@ -76,7 +74,6 @@
min-height: var(--table-height);
min-width: 320px;
border-right: 1px solid $border-subtle;
border-top: 1px solid $border-subtle;
position: absolute;
left: 0;
z-index: 1;
@@ -145,5 +142,10 @@
top: 0;
background-color: $layer-02;
border-bottom: 1px solid $border-subtle;
border-top: 1px solid $border-subtle;
z-index: 2;
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
}
1 change: 1 addition & 0 deletions react/filterPanel/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/filterPanel/src/ExampleLink.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions react/filterPanel/src/index.scss
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion react/filterPanel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { FilterPanel } from './FilterPanel';
import { FilterPanel } from './Example/FilterPanel';

export { FilterPanel };
11 changes: 2 additions & 9 deletions react/filterPanel/src/main.tsx
Original file line number Diff line number Diff line change
@@ -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 { FilterPanel } from './FilterPanel';
import { Example } from './Example';

import './index.scss';

@@ -32,10 +29,6 @@ const renderUIShellHeader = () => (
createRoot(document.getElementById('root')!).render(
<StrictMode>
{renderUIShellHeader()}
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<FilterPanel />
</Column>
</Grid>
<Example />
</StrictMode>
);

0 comments on commit 55ef138

Please sign in to comment.