Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions modal and icon UI update #14856

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
11 changes: 8 additions & 3 deletions packages/bbui/src/InlineAlert/InlineAlert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
</svg>
<div class="spectrum-InLineAlert-header">{header}</div>
<slot>
{#each split as splitMsg}
<div class="spectrum-InLineAlert-content">{splitMsg}</div>
{/each}
{#if message}
{#each split as splitMsg}
<div class="spectrum-InLineAlert-content">{splitMsg}</div>
{/each}
{/if}
</slot>
{#if onConfirm}
<div class="spectrum-InLineAlert-footer button">
Expand All @@ -63,4 +65,7 @@
margin: 0;
border-width: 1px;
}
.spectrum-InLineAlert-header {
line-height: 1.2;
}
</style>
2 changes: 1 addition & 1 deletion packages/bbui/src/Layout/Page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
overflow-y: scroll !important;
overflow-y: auto;
flex: 1 1 auto;
overflow-x: hidden;
}
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Modal/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
--spectrum-global-dimension-size-100
);
max-width: 100%;
background-color: var(--background);
}
:global(.spectrum--lightest .spectrum-Modal.inline) {
border: var(--border-light);
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Modal/ModalContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
.spectrum-Dialog-heading {
font-family: var(--font-accent);
font-weight: 600;
font-size: 20px;
}
.spectrum-Dialog-heading.noDivider {
margin-bottom: 12px;
Expand Down
52 changes: 49 additions & 3 deletions packages/bbui/src/Tags/Tag.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,59 @@
{/if}
<span class="spectrum-Tags-itemLabel"><slot /></span>
{#if closable}
<ClearButton on:click />
<ClearButton small id="clear" on:click />
{/if}
</div>

<style>
.spectrum-Tags-item > .spectrum-Icon {
margin-right: 2px !important;
}
.spectrum-Tags-item {
margin-bottom: 0;
margin-top: 0;
position: relative;
display: inline-flex !important;
max-width: 100%;
align-items: center !important;
padding: 2px 8px !important;
background-color: var(--spectrum-global-color-gray-300);
border: none;
border-radius: 7px;
text-decoration: none;
color: var(--spectrum-global-color-gray-900);
}
/* Change the color of the tag to draw the eye */
.spectrum-Tags-item:has(.spectrum-Icon) {
position: relative;
display: inline-flex !important;
max-width: 100%;
align-items: center !important;
padding: 2px 8px !important;
background-color: var(--spectrum-global-color-indigo-700);
border: none;
border-radius: 7px;
text-decoration: none;
color: var(--spectrum-global-color-indigo-100);
}
/* Change the color of the tag to match the default tag when it has a close button */
.spectrum-Tags-item:has(.spectrum-Icon):has(button):has(svg) {
position: relative;
display: inline-flex !important;
max-width: 100%;
align-items: center !important;
padding: 2px 8px !important;
background-color: var(--spectrum-global-color-gray-300);
border: none;
border-radius: 7px;
text-decoration: none;
color: var(--spectrum-global-color-gray-900);
}

.spectrum-Tags-itemLabel {
font-size: 13px;
font-weight: 400;
pointer-events: auto;
margin: 0 !important;
line-height: 1 !important;
height: auto;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -126,40 +126,13 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<ModalContent
title="Add automation step"
size="L"
size="XL"
showConfirmButton={false}
showCancelButton={false}
disabled={!selectedAction}
>
<Layout noPadding gap="XS">
<Detail size="S">Apps</Detail>
<div class="item-list">
{#each Object.entries(external) as [idx, action]}
<div
class="item"
class:selected={selectedAction === action.name}
on:click={() => selectAction(action)}
>
<div class="item-body">
<img
width={20}
height={20}
src={externalActions[action.stepId].icon}
alt={externalActions[action.stepId].name}
/>
<span class="icon-spacing">
<Body size="XS">
{action.stepTitle || idx.charAt(0).toUpperCase() + idx.slice(1)}
</Body>
</span>
</div>
</div>
{/each}
</div>
</Layout>

<Layout noPadding gap="XS">
<Detail size="S">Actions</Detail>
<Detail size="L">Actions</Detail>
<div class="item-list">
{#each Object.entries(internal) as [idx, action]}
{@const isDisabled = disabled()[idx] && disabled()[idx].disabled}
Expand All @@ -170,14 +143,16 @@
on:click={isDisabled ? null : () => selectAction(action)}
>
<div class="item-body">
<Icon name={action.icon} />
<Body size="XS">{action.name}</Body>
<div class="icon-background">
<Icon size="M" name={action.icon} />
</div>
<p>
{action.name}
</p>
{#if isDisabled && !syncAutomationsEnabled && !triggerAutomationRunEnabled && lockedFeatures.includes(action.stepId)}
<div class="tag-color">
<Tags>
<Tag icon="LockClosed">Premium</Tag>
</Tags>
</div>
<Tags>
<Tag icon="LockClosed">Premium</Tag>
</Tags>
{:else if isDisabled}
<Icon name="Help" tooltip={disabled()[idx].message} />
{/if}
Expand All @@ -189,7 +164,7 @@

{#if Object.keys(plugins).length}
<Layout noPadding gap="XS">
<Detail size="S">Plugins</Detail>
<Detail size="L">Plugins</Detail>
<div class="item-list">
{#each Object.entries(plugins) as [_, action]}
<div
Expand All @@ -198,14 +173,44 @@
on:click={() => selectAction(action)}
>
<div class="item-body">
<Icon name={action.icon} />
<Body size="XS">{action.name}</Body>
<div class="icon-background">
<Icon size="M" name={action.icon} />
</div>
<p>
{action.name}
</p>
</div>
</div>
{/each}
</div>
</Layout>
{/if}
<Layout noPadding gap="XS">
<Detail size="L">Apps</Detail>
<div class="item-list">
{#each Object.entries(external) as [idx, action]}
<div
class="item"
class:selected={selectedAction === action.name}
on:click={() => selectAction(action)}
>
<div class="item-body">
<div class="icon-background-external">
<img
width={20}
height={20}
src={externalActions[action.stepId].icon}
alt={externalActions[action.stepId].name}
/>
</div>
<p>
{action.stepTitle || idx.charAt(0).toUpperCase() + idx.slice(1)}
</p>
</div>
</div>
{/each}
</div>
</Layout>
</ModalContent>

<style>
Expand All @@ -217,8 +222,8 @@
}
.item-list {
display: grid;
grid-template-columns: repeat(2, minmax(150px, 1fr));
grid-gap: var(--spectrum-alias-grid-baseline);
grid-template-columns: repeat(3, minmax(200px, 1fr));
grid-gap: 10px;
}

.item {
Expand All @@ -227,24 +232,52 @@
padding: var(--spectrum-alias-item-padding-s);
background: var(--spectrum-alias-background-color-secondary);
transition: 0.3s all;
border: solid var(--spectrum-alias-border-color);
border-radius: 5px;
border: solid var(--spectrum-global-color-gray-200);
border-radius: 6px;
box-sizing: border-box;
border-width: 2px;
border-width: 1px;
}
.item p {
font-size: 16px !important;
margin: 0;
color: var(--spectrum-global-color-gray-900);
}
:is(.disabled) p {
color: var(--spectrum-global-color-gray-600);
}

.item:not(.disabled):hover,
.selected {
background: var(--spectrum-alias-background-color-tertiary);
}
.disabled {
background: var(--spectrum-global-color-gray-200);
color: var(--spectrum-global-color-gray-500);
cursor: auto;
color: var(--spectrum-global-color-gray-300) !important;
}
.disabled :global(.spectrum-Body) {
color: var(--spectrum-global-color-gray-600);
.icon-background {
background-color: #5e12f7;
padding: 0;
border-radius: 6px;
min-height: 28px;
min-width: 28px;
display: inline-flex;
justify-content: center;
align-items: center;
color: white;
}

.tag-color :global(.spectrum-Tags-item) {
background: var(--spectrum-global-color-gray-200);
.icon-background-external {
background-color: var(--spectrum-global-color-gray-200);
padding: 0;
border-radius: 6px;
min-height: 28px;
min-width: 28px;
display: inline-flex;
justify-content: center;
align-items: center;
}
img {
border-radius: 6px;
padding: 2px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -111,40 +111,7 @@
await automationStore.actions.save(updatedAuto)
}}
on:toggle={() => (open = !open)}
>
<div slot="custom-actions" class="branch-actions">
<Icon
on:click={() => {
automationStore.actions.branchLeft(
branchBlockRef.pathTo,
$selectedAutomation.data,
step
)
}}
tooltip={"Move left"}
tooltipType={TooltipType.Info}
tooltipPosition={TooltipPosition.Top}
hoverable
disabled={branchIdx == 0}
name="ArrowLeft"
/>
<Icon
on:click={() => {
automationStore.actions.branchRight(
branchBlockRef.pathTo,
$selectedAutomation.data,
step
)
}}
tooltip={"Move right"}
tooltipType={TooltipType.Info}
tooltipPosition={TooltipPosition.Top}
hoverable
disabled={isLast}
name="ArrowRight"
/>
</div>
</FlowItemHeader>
/>
{#if open}
<Divider noMargin />
<div class="blockSection">
Expand Down Expand Up @@ -214,11 +181,11 @@
display: inline-block;
}
.block {
width: 480px;
width: 360px;
font-size: 16px;
background-color: var(--background);
border: 1px solid var(--spectrum-global-color-gray-300);
border-radius: 4px 4px 4px 4px;
border-radius: 12px;
}

.blockSection {
Expand Down
Loading