diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte index 4ccd390619..aeba2eae76 100644 --- a/packages/bbui/src/ColorPicker/ColorPicker.svelte +++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte @@ -5,7 +5,7 @@ import { fly } from "svelte/transition" import Icon from "../Icon/Icon.svelte" import Input from "../Form/Input.svelte" - import { capitalise } from "helpers" + import { capitalise } from "../utils/helpers" export let value @@ -108,55 +108,65 @@ } -
(open = true)} -/> -{#if open} +
(open = false)} - transition:fly={{ y: -20, duration: 200 }} - class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" - > - {#each categories as category} -
-
{category.label}
-
- {#each category.colors as color} -
{ - onChange(`var(--spectrum-global-color-static-${color})`) - }} - class="color" - style="background: var(--spectrum-global-color-static-{color}); color: {checkColor};" - title={prettyPrint(color)} - > - {#if value === `var(--spectrum-global-color-static-${color})`} - - {/if} -
- {/each} + class="preview" + style="background: {color};" + on:click={() => (open = true)} + /> + {#if open} +
(open = false)} + transition:fly={{ y: -20, duration: 200 }} + class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" + > + {#each categories as category} +
+
{category.label}
+
+ {#each category.colors as color} +
{ + onChange(`var(--spectrum-global-color-static-${color})`) + }} + class="color" + style="background: var(--spectrum-global-color-static-{color}); color: {checkColor};" + title={prettyPrint(color)} + > + {#if value === `var(--spectrum-global-color-static-${color})`} + + {/if} +
+ {/each} +
+
+ {/each} +
+
Custom
+
+ + onChange(null)} + />
- {/each} -
-
Custom
-
- - onChange(null)} /> -
-
-{/if} + {/if} +