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

UBER-795: replacing the Panel with a Dialog, fix circle button in Kanban. #3659

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/theme/styles/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ input.search {
.pl-8 { padding-left: 2rem; }
.pl-9 { padding-left: 2.25rem; }
.pl-10 { padding-left: 2.5rem; }
.pl-12 { padding-left: 3rem; }
.pr-1 { padding-right: .25rem; }
.pr-2 { padding-right: .5rem; }
.pr-3 { padding-right: .75rem; }
Expand Down Expand Up @@ -580,6 +581,7 @@ input.search {
.step-lr75 + .step-lr75 { margin-left: .75rem; }
.step-tb25 + .step-tb25 { margin-top: .25rem; }
.step-tb375 + .step-tb375 { margin-top: .375rem; }
.step-tb5 + .step-tb5 { margin-top: .5rem; }
.step-tb75 + .step-tb75 { margin-top: .75rem; }
.step-tb-6 + .step-tb-6 { margin-top: 1.5rem; }
.step-tb-12 + .step-tb-12 { margin-top: 3rem; }
Expand Down Expand Up @@ -686,6 +688,7 @@ input.search {
.min-h-8 { min-height: 2rem; }
.min-h-9 { min-height: 2.25rem; }
.min-h-11 { min-height: 2.75rem; }
.min-h-12 { min-height: 3rem; }
.min-h-30 { min-height: 7.5rem; }
.min-h-60 { min-height: 15rem; }
.max-w-2 { max-width: .5rem; }
Expand Down Expand Up @@ -919,6 +922,7 @@ a.no-line {
}

.background-body-color { background-color: var(--theme-bg-color); }
.background-bg-accent-color { background-color: var(--theme-bg-accent-color); }
.background-accent-bg-color { background-color: var(--accent-bg-color); }
.background-highlight-select { background-color: var(--highlight-select); }
.background-highlight-red { background-color: var(--highlight-red); }
Expand Down
8 changes: 4 additions & 4 deletions packages/theme/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,13 @@

.wrapped-icon, &.wrapped-icon {
margin-right: .75rem;
color: var(--content-color);
color: var(--theme-content-color);
}
.wrapped-title, &.wrapped-title {
min-width: 0;
font-weight: 500;
font-size: 1rem;
color: var(--caption-color);
color: var(--theme-caption-color);

overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -349,7 +349,7 @@
.wrapped-subtitle, &.wrapped-subtitle {
min-width: 0;
font-size: 0.75rem;
color: var(--dark-color);
color: var(--theme-dark-color);

overflow: hidden;
visibility: visible;
Expand All @@ -360,7 +360,7 @@
line-clamp: 2;
user-select: text;

b { color: var(--content-color); }
b { color: var(--theme-content-color); }
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/theme/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@
}

/* Kanban - global style */
.kanban-container .card-container .antiButton.link-bordered { padding: 0 .5rem; }
.kanban-container .card-container .antiButton.link-bordered { padding: 0 .5rem !important; }
.kanban-container .card-container .card-labels > *:not(.labels-container),
.kanban-container .card-container .card-labels.labels .labels-container > * {
margin: .25rem .25rem 0 0;
Expand Down
56 changes: 56 additions & 0 deletions packages/theme/styles/dialogs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,59 @@
}
}
}

/* Dialog */
.antiDialog {
display: flex;
flex-direction: column;
height: 100%;
min-width: 25rem;
min-height: 0;
background-color: var(--theme-popup-color);
border-radius: .5rem;

&:not(.fullsize) {
max-width: calc(100vw - 2rem);
border: 1px solid var(--theme-popup-divider);
box-shadow: var(--theme-popup-shadow);
}
&.fullsize {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
}

.header {
flex-shrink: 0;
padding: .25rem .5rem;
background-color: var(--theme-popup-header);
border-bottom: 1px solid var(--theme-popup-divider);
border-radius: .5rem .5rem 0 0;

.title {
flex-grow: 1;
font-size: 1rem;
color: var(--theme-caption-color);
}
}
.content {
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 0;
min-height: 0;

&.rounded { border-radius: 0 0 .5rem .5rem; }
}

.footer {
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
padding: .25rem .5rem;
border-top: 1px solid var(--theme-popup-divider);
border-radius: 0 0 .5rem .5rem;
}
}
71 changes: 7 additions & 64 deletions packages/ui/src/components/Dialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

export let label: IntlString | undefined = undefined
export let isFullSize: boolean = false
export let padding: string = '1rem'

const dispatch = createEventDispatcher()

let fullSize: boolean = false
</script>

<form
class="dialog-container"
class="antiDialog"
class:fullsize={fullSize}
on:submit|preventDefault={() => {}}
use:resizeObserver={() => {
Expand All @@ -37,10 +38,10 @@
<div class="flex-between header">
<div class="flex-row-center gap-1-5">
<Button icon={IconClose} kind={'ghost'} size={'medium'} on:click={() => dispatch('close')} />
<div class="title">
{#if label}<Label {label} />{/if}
{#if $$slots.title}<slot name="title" />{/if}
</div>
{#if label}
<span class="title"><Label {label} /></span>
{/if}
{#if $$slots.title}<slot name="title" />{/if}
</div>
<div class="flex-row-center gap-1-5">
{#if $$slots.utils}
Expand All @@ -64,7 +65,7 @@
{/if}
</div>
</div>
<div class="content" class:rounded={!($$slots.footerLeft || $$slots.footerRight)}>
<div class="content" class:rounded={!($$slots.footerLeft || $$slots.footerRight)} style:padding>
<slot />
</div>
{#if $$slots.footerLeft || $$slots.footerRight}
Expand All @@ -82,61 +83,3 @@
</div>
{/if}
</form>

<style lang="scss">
.dialog-container {
display: flex;
flex-direction: column;
min-width: 25rem;
max-width: calc(100vw - 2rem);
min-height: 0;
max-height: 80vh;
background-color: var(--theme-popup-color);
border-radius: 0.5rem;

&:not(.fullsize) {
border: 1px solid var(--theme-popup-divider);
box-shadow: var(--theme-popup-shadow);
}
&.fullsize {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
}

.header {
flex-shrink: 0;
padding: 0.5rem;
background-color: var(--theme-popup-header);
border-bottom: 1px solid var(--theme-popup-divider);
border-radius: 0.5rem 0.5rem 0 0;

.title {
flex-grow: 1;
font-size: 1rem;
color: var(--theme-caption-color);
}
}
.content {
display: flex;
flex-direction: column;
padding: 1rem;
min-width: 0;
min-height: 0;

&.rounded {
border-radius: 0 0 0.5rem 0.5rem;
}
}
.footer {
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
padding: 0.25rem 0.5rem;
border-top: 1px solid var(--theme-popup-divider);
border-radius: 0 0 0.5rem 0.5rem;
}
}
</style>
94 changes: 42 additions & 52 deletions plugins/gmail-resources/src/components/Chats.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -94,61 +94,51 @@
}
</script>

<div class="popupPanel-body__main-header bottom-divider p-2">
<div class="flex-between">
{#if selectable}
<span><b>{selected.size}</b> <Label label={gmail.string.MessagesSelected} /></span>
<div class="flex">
<div>
<Button label={gmail.string.Cancel} size={'small'} on:click={clear} />
</div>
<div class="ml-3">
<Button
label={gmail.string.PublishSelected}
size={'small'}
kind={'accented'}
disabled={!selected.size}
on:click={share}
/>
</div>
</div>
{:else}
{#if enabled}
<Button
label={gmail.string.CreateMessage}
size={'small'}
kind={'accented'}
on:click={() => {
newMessage = true
}}
/>
{/if}
<div class="flex-between bottom-divider min-h-12 px-2">
{#if selectable}
<span class="pl-2"><b>{selected.size}</b> <Label label={gmail.string.MessagesSelected} /></span>
<div class="flex-row-center gap-3">
<Button label={gmail.string.Cancel} on:click={clear} />
<Button label={gmail.string.PublishSelected} kind={'accented'} disabled={!selected.size} on:click={share} />
</div>
{:else}
{#if enabled}
<Button
icon={IconShare}
kind={'ghost'}
showTooltip={{ label: gmail.string.ShareMessages }}
on:click={async () => {
selectable = !selectable
label={gmail.string.CreateMessage}
kind={'accented'}
on:click={() => {
newMessage = true
}}
/>
{/if}
</div>
</div>
<Scroller>
<div class="popupPanel-body__main-content py-4 clear-mins flex-no-shrink">
{#if messages && messages.length > 0}
<Messages
messages={convertMessages(object, channel, messages, $personAccountByIdStore, $employeeByIdStore)}
{selectable}
bind:selected
on:select
/>
<div class="clear-mins h-4 flex-no-shrink" />
{:else}
<div class="flex-col-center justify-center h-full">
<Icon icon={IconInbox} size={'full'} />
<div class="mt-4 fs-bold content-dark-color"><Label label={plugin.string.Incoming} /></div>
</div>
<div />
{/if}
<Button
icon={IconShare}
kind={'ghost'}
showTooltip={{ label: gmail.string.ShareMessages }}
on:click={async () => {
selectable = !selectable
}}
/>
{/if}
</div>

{#if messages && messages.length > 0}
<div class="antiVSpacer x2" />
<Scroller padding={'.5rem 1rem'}>
<Messages
messages={convertMessages(object, channel, messages, $personAccountByIdStore, $employeeByIdStore)}
{selectable}
bind:selected
on:select
/>
<div class="antiVSpacer x2" />
</Scroller>
<div class="antiVSpacer x2" />
{:else}
<div class="flex-col-center justify-center h-full">
<Icon icon={IconInbox} size={'full'} />
<div class="mt-4 fs-bold content-dark-color"><Label label={plugin.string.Incoming} /></div>
</div>
</Scroller>
{/if}
Loading