Skip to content

Commit

Permalink
feat: add table button
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmanNik committed Jan 15, 2025
1 parent 6c62401 commit e75670b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions v2/pink-sb/src/lib/table/Button.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import type { HTMLAnchorAttributes } from 'svelte/elements';
type $$Props = HTMLAnchorAttributes & { href: string };
</script>

<button type="button" role="row" on:click|preventDefault {...$$restProps}>
<slot />
</button>

<style lang="scss">
[role='row'] {
display: table-row;
width: 100%;
&:hover {
background: var(--color-overlay-neutral-hover);
}
&:last-child {
:global([role='cell']) {
border-bottom: 0;
}
}
}
</style>
2 changes: 2 additions & 0 deletions v2/pink-sb/src/lib/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import Root from './Table.svelte';
import Cell from './Cell.svelte';
import Row from './Row.svelte';
import Link from './Link.svelte';
import Button from './Button.svelte';
import Header from './header/index.js';

export default {
Root,
Cell,
Row,
Link,
Button,
Header
};

0 comments on commit e75670b

Please sign in to comment.