diff --git a/packages/bbui/src/List/ListItem.svelte b/packages/bbui/src/List/ListItem.svelte index 5b6152781a..ee6e325921 100644 --- a/packages/bbui/src/List/ListItem.svelte +++ b/packages/bbui/src/List/ListItem.svelte @@ -8,17 +8,22 @@ export let url = null export let hoverable = false export let showArrow = false + export let selected = false -
+
{#if icon} - +
+ +
{/if}
{#if title} @@ -33,7 +38,7 @@ {/if}
-
+
{#if showArrow} @@ -49,9 +54,12 @@ flex-direction: row; justify-content: space-between; border: 1px solid var(--spectrum-global-color-gray-300); - transition: background 130ms ease-out; + transition: background 130ms ease-out, border-color 130ms ease-out; gap: var(--spacing-m); color: var(--spectrum-global-color-gray-800); + cursor: pointer; + position: relative; + box-sizing: border-box; } .list-item:not(:first-child) { border-top: none; @@ -64,27 +72,71 @@ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; } - .hoverable:hover { - cursor: pointer; + .list-item.hoverable:not(.selected):hover { background: var(--spectrum-global-color-gray-200); + border-color: var(--spectrum-global-color-gray-400); } - .left, - .right { + /* Selection is only meant for standalone list items (non stacked) so we just set a fixed border radius */ + .list-item.selected { + background-color: var(--spectrum-global-color-blue-100); + border-color: var(--spectrum-global-color-blue-100); + } + .list-item.selected:after { + content: ""; + position: absolute; + height: 100%; + width: 100%; + border: 1px solid var(--spectrum-global-color-blue-400); + pointer-events: none; + top: 0; + left: 0; + border-radius: 4px; + box-sizing: border-box; + z-index: 1; + opacity: 0.5; + } + + /* Large icons */ + .list-item.large .list-item__icon { + background-color: var(--spectrum-global-color-gray-200); + padding: 4px; + border-radius: 4px; + border: 1px solid var(--spectrum-global-color-gray-300); + transition: background-color 130ms ease-out, border-color 130ms ease-out, + color 130ms ease-out; + } + .list-item.large.hoverable:not(.selected):hover .list-item__icon { + background-color: var(--spectrum-global-color-gray-300); + } + .list-item.large.selected .list-item__icon { + background-color: var(--spectrum-global-color-blue-400); + color: white; + border-color: var(--spectrum-global-color-blue-100); + } + + /* Internal layout */ + .list-item__left, + .list-item__right { display: flex; flex-direction: row; align-items: center; gap: var(--spacing-s); } - .left { + .list-item.large .list-item__left, + .list-item.large .list-item__right { + gap: var(--spacing-m); + } + .list-item__left { width: 0; flex: 1 1 auto; } - .right { + .list-item__right { flex: 0 0 auto; color: var(--spectrum-global-color-gray-600); } + /* Text */ .list-item__text { flex: 1 1 auto; width: 0; @@ -96,6 +148,7 @@ text-overflow: ellipsis; } .list-item__subtitle { - color: var(--spectrum-global-color-gray-600); + color: var(--spectrum-global-color-gray-700); + font-size: 12px; } diff --git a/packages/builder/src/components/common/DetailPopover.svelte b/packages/builder/src/components/common/DetailPopover.svelte index bc891bfe42..c437804b33 100644 --- a/packages/builder/src/components/common/DetailPopover.svelte +++ b/packages/builder/src/components/common/DetailPopover.svelte @@ -4,6 +4,7 @@ export let title export let align = "left" export let showPopover + export let width let popover let anchor @@ -22,8 +23,8 @@ import DetailPopover from "components/common/DetailPopover.svelte" - import { Input, notifications, Button, Icon } from "@budibase/bbui" + import { Input, notifications, Button, Icon, ListItem } from "@budibase/bbui" import { goto } from "@roxi/routify" import { viewsV2 } from "stores/builder" export let table export let firstView = false + let calculation = false let name let popover @@ -39,6 +40,7 @@ tableId: table._id, schema: enrichSchema(table.schema), primaryDisplay: table.primaryDisplay, + calculation, }) notifications.success(`View ${name} created`) $goto(`./${newView.id}`) @@ -52,6 +54,7 @@ title="Create view" bind:this={popover} on:open={() => (name = null)} + width={540} > {#if firstView} @@ -66,6 +69,28 @@
{/if} +
+
+ (calculation = false)} + selected={!calculation} + icon="Rail" + /> +
+
+ (calculation = true)} + selected={calculation} + icon="123" + /> +
+