Add quiet reverse button variant for collapsed button groups in grids

This commit is contained in:
Andrew Kingston 2024-09-06 09:20:00 +01:00
parent 7121a0f157
commit 61b82b8817
No known key found for this signature in database
3 changed files with 20 additions and 6 deletions

View File

@ -18,6 +18,7 @@
export let newStyles = true
export let id
export let ref
export let reverse = false
const dispatch = createEventDispatcher()
</script>
@ -43,6 +44,9 @@
}
}}
>
{#if $$slots && reverse}
<span class="spectrum-Button-label"><slot /></span>
{/if}
{#if icon}
<svg
class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
@ -53,7 +57,7 @@
<use xlink:href="#spectrum-icon-18-{icon}" />
</svg>
{/if}
{#if $$slots}
{#if $$slots && !reverse}
<span class="spectrum-Button-label"><slot /></span>
{/if}
</button>
@ -93,4 +97,11 @@
.spectrum-Button--secondary.new-styles.is-disabled {
color: var(--spectrum-global-color-gray-500);
}
.spectrum-Button .spectrum-Button-label + .spectrum-Icon {
margin-left: var(--spectrum-button-primary-icon-gap);
margin-right: calc(
-1 * (var(--spectrum-button-primary-textonly-padding-left-adjusted) -
var(--spectrum-button-primary-padding-left-adjusted))
);
}
</style>

View File

@ -10,7 +10,7 @@
export let align = "left"
export let offset
export let animate
export let secondary = false
export let quiet = false
let anchor
let popover
@ -25,10 +25,13 @@
bind:ref={anchor}
{size}
icon="ChevronDown"
cta={!secondary}
{secondary}
{quiet}
primary={quiet}
cta={!quiet}
newStyles={!quiet}
on:click={() => popover?.show()}
on:click
reverse
>
{text || "Action"}
</Button>

View File

@ -1,6 +1,6 @@
<script>
import { getContext, onMount } from "svelte"
import { Button, CollapsedButtonGroup } from "@budibase/bbui"
import { Button, CollapsedButtonGroup, Select } from "@budibase/bbui"
import GridCell from "../cells/GridCell.svelte"
import GridScrollWrapper from "./GridScrollWrapper.svelte"
import { BlankRowID } from "../lib/constants"
@ -98,7 +98,7 @@
align="right"
offset={5}
size="S"
secondary
quiet
animate={false}
on:mouseenter={() => ($hoveredRowId = row._id)}
/>