From c2e542786055d4cda85f507186eb85bf4c1d4a91 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 12 Jun 2023 15:54:08 +0100 Subject: [PATCH] Small refactor to move CSS variables inside fields rather fancy forms --- .../bbui/src/FancyForm/FancyCheckbox.svelte | 13 +++++---- .../src/FancyForm/FancyCheckboxGroup.svelte | 28 ++++++++++--------- packages/bbui/src/FancyForm/FancyField.svelte | 23 +++++++-------- packages/bbui/src/FancyForm/FancyForm.svelte | 11 +------- .../PlusConfigForm.svelte | 1 - 5 files changed, 34 insertions(+), 42 deletions(-) diff --git a/packages/bbui/src/FancyForm/FancyCheckbox.svelte b/packages/bbui/src/FancyForm/FancyCheckbox.svelte index 56290606f6..0a2e5ac159 100644 --- a/packages/bbui/src/FancyForm/FancyCheckbox.svelte +++ b/packages/bbui/src/FancyForm/FancyCheckbox.svelte @@ -8,9 +8,8 @@ export let disabled = false export let error = null export let validate = null - export let compress = false - export let lighter = false export let indeterminate = false + export let compact = false const dispatch = createEventDispatcher() @@ -29,15 +28,14 @@ {value} {validate} {disabled} - {compress} - {lighter} + {compact} clickable on:click={onChange} > -
+
{#if text} {text} {/if} @@ -51,6 +49,7 @@ } .text { font-size: 15px; + line-height: 17px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; @@ -58,6 +57,10 @@ line-clamp: 2; -webkit-box-orient: vertical; } + .text.compact { + font-size: 13px; + line-height: 15px; + } .text > :global(*) { font-size: inherit !important; } diff --git a/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte b/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte index c92c57388f..aaea388c36 100644 --- a/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte +++ b/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte @@ -40,27 +40,29 @@ {#if options && Array.isArray(options)} - - {#if showSelectAll} -
+
+ + {#if showSelectAll} -
- {/if} - {#each options as option, i} - - {/each} - + {/if} + {#each options as option, i} + + {/each} + +
{/if} diff --git a/packages/bbui/src/FancyForm/FancyField.svelte b/packages/bbui/src/FancyForm/FancyField.svelte index a4d453bb77..455f4b38fb 100644 --- a/packages/bbui/src/FancyForm/FancyField.svelte +++ b/packages/bbui/src/FancyForm/FancyField.svelte @@ -11,8 +11,7 @@ export let value export let ref export let autoHeight - export let compress - export let lighter + export let compact = false const formContext = getContext("fancy-form") const id = Math.random() @@ -40,12 +39,11 @@
@@ -65,7 +63,6 @@