-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,633 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react' | ||
|
||
export const DataViewNoResultsRow = () => ( | ||
<div className={'p-4 text-lg rounded-md border'}> | ||
No results. | ||
</div> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
export * from './column-header' | ||
export * from './empty' | ||
export * from './loader' | ||
export * from './pagination' | ||
export * from './relation-filter' | ||
export * from './text-filter' |
23 changes: 23 additions & 0 deletions
23
packages/playground/admin/src/components/datagrid/layout-switcher.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { DataViewSelectionTrigger } from '@contember/react-dataview' | ||
import { Button } from '../ui/button' | ||
import { Grid2x2Icon, TableIcon } from 'lucide-react' | ||
import * as React from 'react' | ||
|
||
export const DataViewLayoutSwitcher = () => { | ||
return <> | ||
<DataViewSelectionTrigger name={'layout'} value={'grid'}> | ||
<Button variant={'outline'} size={'sm'} | ||
className={'data-[active]:text-blue-600 data-[active]:bg-gray-50 data-[active]:shadow-inner'}> | ||
<Grid2x2Icon className={'w-3 h-3'} /> | ||
<span className={'sr-only'}>Show grid</span> | ||
</Button> | ||
</DataViewSelectionTrigger> | ||
<DataViewSelectionTrigger name={'layout'} value={'table'}> | ||
<Button variant={'outline'} size={'sm'} | ||
className={'data-[active]:text-blue-600 data-[active]:bg-gray-50 data-[active]:shadow-inner'}> | ||
<TableIcon className={'w-3 h-3'} /> | ||
<span className={'sr-only'}>Show table</span> | ||
</Button> | ||
</DataViewSelectionTrigger> | ||
</> | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/playground/admin/src/components/datagrid/loader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from 'react' | ||
import { cn } from '../../utils/cn' | ||
|
||
export const DataViewLoaderOverlay = () => { | ||
const [show, setShow] = React.useState(false) | ||
React.useEffect(() => { | ||
requestAnimationFrame(() => { | ||
setShow(true) | ||
}) | ||
}, []) | ||
|
||
return ( | ||
<div className={cn('absolute inset-0 flex items-center justify-center bg-white bg-opacity-50 backdrop-blur-sm transition-all duration-500 delay-200', show ? 'opacity-100' : 'opacity-0')}> | ||
<div className="animate-spin rounded-full h-16 w-16 border-b-2 border-gray-900"> | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.