Skip to content

Commit

Permalink
compact table mobile variant
Browse files Browse the repository at this point in the history
  • Loading branch information
sstraatemans committed Dec 5, 2024
1 parent a15d707 commit a505ee0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export const CompactTableMobile: FC<IProps> = ({
data,
fields,
isLoading = false,
variant,
}) => {
return data.map((item, idx) => (
<section key={idx} className={sectionClass}>
<section key={idx} className={sectionClass({ variant })}>
{fields.map((field, idx) => (
<div key={`${field.key.toString()}${idx}`} className={rowClass}>
<span className={headerClass}>{field.label}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
import { atoms, style, tokens } from './../../../styles';
import { atoms, recipe, style, tokens } from './../../../styles';

export const sectionClass = style([
atoms({
padding: 'n6',
backgroundColor: 'base.default',
marginBlockEnd: 'md',
}),
]);
export const sectionClass = recipe({
base: [
atoms({
marginBlockEnd: 'n2',
}),
],
variants: {
variant: {
default: [
atoms({
padding: 'n6',
backgroundColor: 'base.default',
}),
],
open: [
atoms({
paddingBlock: 'n3',
paddingInline: 'n4',
border: 'hairline',
borderRadius: 'sm',
backgroundColor: 'layer.default',
}),
],
},
},
});

export const headerClass = style([
atoms({
Expand Down

0 comments on commit a505ee0

Please sign in to comment.