Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Table goku/gohan colours [MDS-708] #2418

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ Object {
class="relative w-full max-w-xs"
>
<div
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-gohan gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-goku gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
tabindex="-1"
>
<input
Expand Down Expand Up @@ -1323,7 +1323,7 @@ Object {
class="relative w-full max-w-xs"
>
<div
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-gohan gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-goku gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
tabindex="-1"
>
<input
Expand Down Expand Up @@ -4245,7 +4245,7 @@ Object {
class="relative w-full max-w-xs"
>
<div
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-gohan gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-goku gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
tabindex="-1"
>
<input
Expand Down Expand Up @@ -4303,7 +4303,7 @@ Object {
class="relative w-full max-w-xs"
>
<div
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-gohan gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
class="relative flex flex-nowrap w-full align-middle items-center rounded-lg py-2 px-3 bg-goku gap-x-2 shadow-input hover:shadow-input-hov focus:shadow-input-focus focus:outline-none focus-visible::shadow-input-focus focus-visible::outline-none"
tabindex="-1"
>
<input
Expand Down
118 changes: 55 additions & 63 deletions next-docs/public/examples/table/Tooltips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,91 @@ import React from 'react';
import { Table } from '@heathmont/moon-table-tw';
import ClipProps from '@heathmont/moon-table-tw/lib/private/types/ClipProps';
import { Chip, Tooltip } from '@heathmont/moon-core-tw';
import { IconShare } from '@heathmont/moon-assets';
import { OtherFrame } from '@heathmont/moon-icons-tw';

const Example = () => {
const columnsInitial = [
{
'Header': 'Transactions',
'sticky': 'left',
Header: 'Transactions',
sticky: 'left',
columns: [
{
'Header': 'Transaction UUID',
'accessor': 'uuid',
'Footer': '',
Header: 'Transaction UUID',
accessor: 'uuid',
Footer: '',
},
{
'Header': 'User & Supplier user',
'accessor': 'user',
'Footer': '',
Header: 'User & Supplier user',
accessor: 'user',
Footer: '',
},
],
},
{
'Header': 'Info',
'columns': [
Header: 'Info',
columns: [
{
'Header': 'Process time',
'accessor': 'processTime',
'Footer': '',
Header: 'Process time',
accessor: 'processTime',
Footer: '',
},
{
'Header': 'Client',
'accessor': 'client',
'Footer': '',
Header: 'Client',
accessor: 'client',
Footer: '',
},
{
'Header': 'Game name & provider',
'accessor': 'gameNameAndProvider',
'Footer': '',
Header: 'Game name & provider',
accessor: 'gameNameAndProvider',
Footer: '',
},
{
'Header': 'Amount',
'accessor': 'amount',
'maxWidth': 100,
'Footer': '',
Header: 'Amount',
accessor: 'amount',
maxWidth: 100,
Footer: '',
},
{
'Header': 'Currency',
'accessor': 'currency',
'maxWidth': 100,
'Footer': '',
Header: 'Currency',
accessor: 'currency',
maxWidth: 100,
Footer: '',
},
{
'Header': 'Status',
'accessor': 'status',
'maxWidth': 200,
'Footer': '',
Header: 'Status',
accessor: 'status',
maxWidth: 200,
Footer: '',
},
],
},
{
'Header': 'Actions',
'sticky': 'right',
'columns': [
Header: 'Actions',
sticky: 'right',
columns: [
{
'Header': 'Actions',
'accessor': 'actions',
'Footer': '',
Header: 'Actions',
accessor: 'actions',
Footer: '',
},
]
}
],
},
];

const tooltip = (className: string) => {
return (
<Tooltip>
<Tooltip.Trigger>
<Chip
className='bg-transparent hover:bg-transparent'
>
<IconShare />
</Chip>
</Tooltip.Trigger>
<Tooltip.Content
position="top-start"
className={className}
>
Round details
<Tooltip.Arrow
className={className}
/>
</Tooltip.Content>
</Tooltip>
);
};
const tooltip = () => (
<Tooltip>
<Tooltip.Trigger>
<Chip
variant="ghost"
iconOnly={<OtherFrame className="text-moon-24" />}
/>
</Tooltip.Trigger>
<Tooltip.Content position="top-start">
Round details
<Tooltip.Arrow />
</Tooltip.Content>
</Tooltip>
);

const makeData = (length: number) => {
return Array.from('_'.repeat(length)).map((_, index) => {
Expand All @@ -111,7 +103,7 @@ const Example = () => {
/**
* The expression below sets a tooltip with transparent background in the second row only.
*/
actions: index === 1 ? tooltip('bg-transparent') : tooltip('bg-goku'),
actions: tooltip(),
};
});
};
Expand Down
Loading
Loading