Skip to content

Commit

Permalink
chore: add example links
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Sep 9, 2024
1 parent b0eec94 commit fa48432
Show file tree
Hide file tree
Showing 71 changed files with 485 additions and 17 deletions.
2 changes: 2 additions & 0 deletions packages/batch-actions/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
7 changes: 7 additions & 0 deletions packages/batch-actions/src/BatchActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import {
} from '@tanstack/match-sorter-utils'

import { makeData } from './makeData';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons'
import * as packageJson from '../package.json'

type Resource = {
id: string
Expand Down Expand Up @@ -174,6 +177,10 @@ export const BatchActions = () => {
<TableContainer
title="Batch actions, global filter"
className="basic-table tanstack-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(),
}}
Expand Down
9 changes: 9 additions & 0 deletions packages/batch-actions/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
13 changes: 13 additions & 0 deletions packages/batch-actions/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 1 deletion packages/batch-actions/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ]
"types": [ "./src/customTypings.d.ts" ],
"resolveJsonModule": true
},
"include": ["./src"]
}
2 changes: 2 additions & 0 deletions packages/customizeColumns/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
7 changes: 7 additions & 0 deletions packages/customizeColumns/src/CustomizeColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import { TearsheetNarrow } from '@carbon/ibm-products';
import { Sortable } from './drag-drop/Sortable';
import { restrictToParentElement, restrictToVerticalAxis } from '@dnd-kit/modifiers';
import { verticalListSortingStrategy } from '@dnd-kit/sortable';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons'
import * as packageJson from '../package.json'

type Resource = {
id: string
Expand Down Expand Up @@ -91,6 +94,10 @@ export const CustomizeColumns = () => {
<TableContainer
title="Customize column order"
className="basic-table tanstack-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(),
}}
Expand Down
9 changes: 9 additions & 0 deletions packages/customizeColumns/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
13 changes: 13 additions & 0 deletions packages/customizeColumns/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 1 deletion packages/customizeColumns/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ]
"types": [ "./src/customTypings.d.ts" ],
"resolveJsonModule": true
},
"include": ["./src"]
}
2 changes: 2 additions & 0 deletions packages/editableCells/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
7 changes: 7 additions & 0 deletions packages/editableCells/src/EditableCells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ 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'

type Resource = {
id: string
Expand Down Expand Up @@ -233,6 +236,10 @@ export const EditableCells = () => {
<TableContainer
title="Editable cells"
className="basic-table tanstack-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(),
}}
Expand Down
9 changes: 9 additions & 0 deletions packages/editableCells/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
13 changes: 13 additions & 0 deletions packages/editableCells/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 1 deletion packages/editableCells/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ]
"types": [ "./src/customTypings.d.ts" ],
"resolveJsonModule": true
},
"include": ["./src"]
}
2 changes: 2 additions & 0 deletions packages/filterFlyout/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
9 changes: 9 additions & 0 deletions packages/filterFlyout/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
7 changes: 7 additions & 0 deletions packages/filterFlyout/src/FilterFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ import {

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'

pkg.component.TagOverflow = true;

Expand Down Expand Up @@ -211,6 +214,10 @@ export const FilterFlyout = () => {
<TableContainer
title="Filter flyout"
className="basic-table tanstack-example filter-flyout-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(),
}}
Expand Down
13 changes: 13 additions & 0 deletions packages/filterFlyout/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 1 deletion packages/filterFlyout/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ]
"types": [ "./src/customTypings.d.ts" ],
"resolveJsonModule": true
},
"include": ["./src"]
}
2 changes: 2 additions & 0 deletions packages/filterPanel/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
9 changes: 9 additions & 0 deletions packages/filterPanel/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
7 changes: 7 additions & 0 deletions packages/filterPanel/src/FilterPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import {

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'

pkg.component.TagOverflow = true;

Expand Down Expand Up @@ -267,6 +270,10 @@ 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(),
}}
Expand Down
13 changes: 13 additions & 0 deletions packages/filterPanel/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 1 deletion packages/filterPanel/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ]
"types": [ "./src/customTypings.d.ts" ],
"resolveJsonModule": true
},
"include": ["./src"]
}
13 changes: 13 additions & 0 deletions packages/gallery/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@use '@carbon/react' with ($font-path: '@ibm/plex');
@use '@carbon/styles/scss/type';
@use '@carbon/ibm-products/css/index';
@use './App.scss';

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: 2 additions & 0 deletions packages/globalFilter/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CODE_SANDBOX_URL_ROOT=https://codesandbox.io/s/github/matthewgallo/tanstack-carbon/tree/main/packages
VITE_STACK_BLITZ_URL_ROOT=https://stackblitz.com/github/matthewgallo/tanstack-carbon/tree/main/packages
9 changes: 9 additions & 0 deletions packages/globalFilter/src/ExampleLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export const ExampleLink = ({ icon, label, url }) => {
const Icon = icon;
return <a className='example--link' href={url} target='_blank'>
{icon && <Icon className="example--link__icon" />}
{label}
</a>
}
Loading

0 comments on commit fa48432

Please sign in to comment.