diff --git a/packages/bbui/src/FancyForm/FancyCheckbox.svelte b/packages/bbui/src/FancyForm/FancyCheckbox.svelte index 363a827b1e..56290606f6 100644 --- a/packages/bbui/src/FancyForm/FancyCheckbox.svelte +++ b/packages/bbui/src/FancyForm/FancyCheckbox.svelte @@ -10,6 +10,7 @@ export let validate = null export let compress = false export let lighter = false + export let indeterminate = false const dispatch = createEventDispatcher() @@ -34,7 +35,7 @@ on:click={onChange} > - +
{#if text} diff --git a/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte b/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte index be37994616..c92c57388f 100644 --- a/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte +++ b/packages/bbui/src/FancyForm/FancyCheckboxGroup.svelte @@ -14,6 +14,7 @@ $: updateSelected(selectedBooleans) $: dispatch("change", selected) $: allSelected = selected?.length === options.length + $: noneSelected = !selected?.length function reset() { return Array(options.length).fill(true) @@ -48,6 +49,7 @@ text={selectAllText} compress lighter + indeterminate={!allSelected && !noneSelected} />
{/if} diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index 8384c8ca09..3efc737bfb 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -9,6 +9,7 @@ export let text = null export let disabled = false export let size + export let indeterminate = false const dispatch = createEventDispatcher() const onChange = event => { @@ -22,6 +23,7 @@ class="spectrum-Checkbox spectrum-Checkbox--emphasized {sizeClass}" class:is-invalid={!!error} class:checked={value} + class:is-indeterminate={indeterminate} >