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-1106,-1108: update navigator and button layout #3870

Merged
merged 1 commit into from
Oct 24, 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
6 changes: 3 additions & 3 deletions dev/storybook/stories/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta = {
},
kind: {
control: 'select',
options: ['accented', 'regular', 'no-border', 'ghost', 'link', 'link-bordered', 'dangerous', 'list', 'list-header'],
options: ['primary', 'regular', 'no-border', 'ghost', 'link', 'link-bordered', 'dangerous', 'list', 'list-header'],
description: 'kind description',
table: {
type: { summary: 'ButtonKind' },
Expand Down Expand Up @@ -109,7 +109,7 @@ type Story = StoryObj<typeof meta>;
export const Ok: Story = {
args: {
label: uiPlugin.string.Ok,
kind: 'accented',
kind: 'primary',
size: 'medium',
shape: undefined,
justify: 'left',
Expand All @@ -125,7 +125,7 @@ export const Ok: Story = {
export const Cancel: Story = {
args: {
label: uiPlugin.string.Cancel,
kind: 'accented',
kind: 'primary',
size: 'medium',
shape: undefined,
justify: 'left',
Expand Down
2 changes: 1 addition & 1 deletion packages/kanban/src/components/KanbanRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}
&.selection,
&.checked.selection {
box-shadow: 0 0 1px 1px var(--accented-button-default);
box-shadow: 0 0 1px 1px var(--primary-button-default);
animation: anim-border 1s ease-in-out;

&:hover {
Expand Down
2 changes: 1 addition & 1 deletion packages/presentation/src/components/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
focusIndex={10001}
disabled={!canSave}
label={okLabel}
kind={'accented'}
kind={'primary'}
size={'large'}
on:click={() => {
if (okProcessing) {
Expand Down
2 changes: 1 addition & 1 deletion packages/presentation/src/components/MessageBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
focusIndex={1}
label={okLabel ?? presentation.string.Ok}
size={'large'}
kind={'accented'}
kind={'primary'}
loading={processing}
on:click={() => {
processing = true
Expand Down
4 changes: 2 additions & 2 deletions packages/presentation/src/components/PDFViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
height: 2rem;
font-weight: 500;
font-size: 0.625rem;
color: var(--accented-button-color);
background-color: var(--accented-button-default);
color: var(--primary-button-color);
background-color: var(--primary-button-default);
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 0.5rem;
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Button
disabled={!canSave}
label={okLabel ?? presentation.string.Create}
kind={'accented'}
kind={'primary'}
on:click={() => {
okAction()
dispatch('close')
Expand Down
6 changes: 3 additions & 3 deletions packages/presentation/src/components/SpacesMultiPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@
}}
>
<div class="check pointer-events-none">
<CheckBox checked={isSelected(space)} kind={'accented'} />
<CheckBox checked={isSelected(space)} kind={'primary'} />
</div>
<SpaceInfo size={'medium'} value={space} {iconWithEmoji} {defaultIcon} />
{#if allowDeselect && space._id === selected}
<div class="check pointer-events-none">
{#if titleDeselect}
<div class="clear-mins" use:tooltip={{ label: titleDeselect ?? presentation.string.Deselect }}>
<CheckBox checked circle kind={'accented'} />
<CheckBox checked circle kind={'primary'} />
</div>
{:else}
<CheckBox checked circle kind={'accented'} />
<CheckBox checked circle kind={'primary'} />
{/if}
</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion packages/text-editor/src/components/StyleButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
&:focus {
color: var(--theme-caption-color);
box-shadow: 0 0 0 2px var(--accented-button-outline);
box-shadow: 0 0 0 2px var(--primary-button-outline);
}
&.selected {
background-color: var(--theme-button-pressed);
Expand Down
53 changes: 22 additions & 31 deletions packages/theme/styles/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@

/* Common Colors */
* {
--accented-button-color: #fff;
--accented-button-content-color: rgba(255, 255, 255, .8);
--accented-button-border: rgba(255, 255, 255, .09);
--accented-button-outline: #5190EC;
--accented-button-transparent: rgba(43, 81, 144, 0.2);

--accented-button-default: #2B5190;
--accented-button-hovered: #325FA9;
--accented-button-pressed: #284B86;
--accented-button-focused: #2B5190;
--brand-button-default: #4169E1;
--brand-button-hovered: #587BE5;
--brand-button-pressed: #2C58DE;
--brand-button-focused: #4169E1;
--primary-button-color: #fff;
--primary-button-content-color: rgba(255, 255, 255, .8);
--primary-button-border: rgba(255, 255, 255, .09);
--primary-button-outline: #5190EC;
--primary-button-transparent: rgba(43, 81, 144, 0.2);

--primary-button-default: #205DC2;
--primary-button-hovered: #3575DE;
--primary-button-pressed: #1C52AB;
--primary-button-focused: #205DC2;
--secondary-button-default: #D3E1F8;
--secondary-button-hovered: #BDD2F5;
--secondary-button-pressed: #A7C3F1;
--secondary-button-focused: #BDD2F5;
--positive-button-default: #26A869;
--positive-button-hovered: #2BBB75;
--positive-button-pressed: #21915B;
Expand All @@ -38,15 +38,6 @@
--negative-button-pressed: #BF3636;
--negative-button-focused: #CA4242;

--theme-primary-default: #205DC2;
--theme-primary-hovered: #3575DE;
--theme-primary-pressed: #1C52AB;
--theme-primary-disabled: #0000001F;
--theme-primary-accented-default: #D3E1F8;
--theme-primary-accented-hovered: #BDD2F5;
--theme-primary-accented-pressed: #A7C3F1;
--theme-primary-accented-focused: #BDD2F5;

--white-color: #fff;
--duotone-color: rgba(126, 134, 158, .25);

Expand Down Expand Up @@ -92,10 +83,10 @@
--theme-text-primary-color: rgba(255, 255, 255, .8);
--theme-text-placeholder-color: rgba(255, 255, 255, .4);

--accented-button-disabled: rgba(255, 255, 255, .12);
--accented-button-disabled-color: rgba(255, 255, 255, .4);
--brand-button-disabled: rgba(255, 255, 255, .12);
--brand-button-disabled-color: rgba(255, 255, 255, .4);
--primary-button-disabled: rgba(255, 255, 255, .12);
--primary-button-disabled-color: rgba(255, 255, 255, .4);
--secondary-button-disabled: rgba(255, 255, 255, .12);
--secondary-button-disabled-color: rgba(255, 255, 255, .4);
--positive-button-disabled: rgba(38, 168, 105, .2);
--positive-button-disabled-color: rgba(38, 168, 105, .6);
--negative-button-disabled: rgba(202, 66, 66, .2);
Expand Down Expand Up @@ -298,10 +289,10 @@
--theme-text-primary-color: rgba(0, 0, 0, .8);
--theme-text-placeholder-color: rgba(0, 0, 0, .4);

--accented-button-disabled: rgba(0, 0, 0, .12);
--accented-button-disabled-color: rgba(0, 0, 0, .4);
--brand-button-disabled: rgba(0, 0, 0, .12);
--brand-button-disabled-color: rgba(0, 0, 0, .4);
--primary-button-disabled: rgba(0, 0, 0, .12);
--primary-button-disabled-color: rgba(0, 0, 0, .4);
--secondary-button-disabled: rgba(0, 0, 0, .12);
--secondary-button-disabled-color: rgba(0, 0, 0, .4);
--positive-button-disabled: rgba(38, 168, 105, .2);
--positive-button-disabled-color: rgba(33, 145, 91, .6);
--negative-button-disabled: rgba(202, 66, 66, .2);
Expand Down
8 changes: 4 additions & 4 deletions packages/theme/styles/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ a.no-line {
}
&:focus {
border: 1px solid var(--theme-button-border);
box-shadow: 0 0 0 2px var(--accented-button-outline);
box-shadow: 0 0 0 2px var(--primary-button-outline);
& > .icon { color: var(--theme-caption-color); }
}

Expand Down Expand Up @@ -939,7 +939,7 @@ a.no-line {
.background-highlight-red { background-color: var(--highlight-red); }
.background-button-bg-color { background-color: var(--button-bg-color); }
.background-button-noborder-bg-hover { background-color: var(--noborder-bg-hover); }
.background-primary-color { background-color: var(--accented-button-default); }
.background-primary-color { background-color: var(--primary-button-default); }
.background-content-accent-color { background-color: var(--accent-color); }
.background-comp-header-color { background-color: var(--theme-comp-header-color); }

Expand All @@ -950,7 +950,7 @@ a.no-line {
.content-color { color: var(--theme-content-color); }
.caption-color { color: var(--theme-caption-color); }

.content-accented-color { color: var(--accented-button-color); }
.content-primary-color { color: var(--primary-button-color); }
.red-color { color: var(--highlight-red); }
.error-color { color: var(--theme-error-color); }

Expand All @@ -962,7 +962,7 @@ a.no-line {
.border-radius-right-1 { border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; }
.border-radius-top-1 { border-top-right-radius: 0.25rem; border-top-left-radius: 0.25rem; }
.border-divider-color {border: 1px solid var(--theme-divider-color);}
.border-primary-button { border-color: var(--accented-button-border); }
.border-primary-button { border-color: var(--primary-button-border); }

.border-top-none { border-top: none !important; }
.border-bottom-popup-divider { border-bottom: 1px solid var(--theme-popup-divider); }
Expand Down
57 changes: 29 additions & 28 deletions packages/theme/styles/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
}
&.small {
height: 1.75rem;
font-size: .8125rem;
&.only-icon { width: 1.75rem; }
}
&.medium:not(.stepper) {
Expand Down Expand Up @@ -75,14 +74,14 @@
&.sh-filter { border-radius: 0 0 .5rem .5rem; }

&.highlight {
box-shadow: inset 0 0 1px 1px var(--accented-button-outline);
&:hover { box-shadow: inset 0 0 1px 2px var(--accented-button-outline); }
box-shadow: inset 0 0 1px 1px var(--primary-button-outline);
&:hover { box-shadow: inset 0 0 1px 2px var(--primary-button-outline); }
}

&:hover .btn-icon { color: var(--theme-caption-color); }
&:not(.no-focus):focus {
&:not(.sh-filter) { box-shadow: 0 0 0 2px var(--accented-button-outline); }
&.sh-filter { border-color: var(--accented-button-outline); }
&:not(.sh-filter) { box-shadow: 0 0 0 2px var(--primary-button-outline); }
&.sh-filter { border-color: var(--primary-button-outline); }
}

&.bs-solid { border-style: solid; }
Expand Down Expand Up @@ -192,46 +191,48 @@
}
&:not(.no-focus):focus { box-shadow: none; }
}
&.accented, &.brand, &.positive, &.negative {
&.primary, &.secondary, &.positive, &.negative {
&:hover, &:active, &:focus {
color: var(--accented-button-color);
color: var(--primary-button-color);

.btn-icon,
.btn-right-icon { color: var(--accented-button-color); }
.btn-right-icon { color: var(--primary-button-color); }
}
}
&.regular, &.ghost {
&:hover, &:active, &:focus { color: var(--theme-caption-color); }
}
&.accented,
&.brand,
&.primary,
&.secondary,
&.positive,
&.negative {
padding: 0 1.5rem;
color: var(--accented-button-content-color);
border-color: var(--accented-button-border);
color: var(--primary-button-content-color);
border-color: var(--primary-button-border);

.btn-icon,
.btn-right-icon { color: var(--accented-button-content-color); }
.btn-right-icon { color: var(--primary-button-content-color); }
}
&.accented {
background-color: var(--accented-button-default);
&:hover { background-color: var(--accented-button-hovered); }
&:active { background-color: var(--accented-button-pressed); }
&:focus { background-color: var(--accented-button-focused); }
&.primary {
color: var(--primary-button-color);
background-color: var(--primary-button-default);

&:hover { background-color: var(--primary-button-hovered); }
&:active { background-color: var(--primary-button-pressed); }
&:focus { background-color: var(--primary-button-focused); }
&:disabled {
color: var(--accented-button-disabled-color);
background-color: var(--accented-button-disabled);
color: var(--primary-button-disabled-color);
background-color: var(--primary-button-disabled);
}
}
&.brand {
background-color: var(--brand-button-default);
&:hover { background-color: var(--brand-button-hovered); }
&:active { background-color: var(--brand-button-pressed); }
&:focus { background-color: var(--brand-button-focused); }
&.secondary {
background-color: var(--secondary-button-default);
&:hover { background-color: var(--secondary-button-hovered); }
&:active { background-color: var(--secondary-button-pressed); }
&:focus { background-color: var(--secondary-button-focused); }
&:disabled {
color: var(--brand-button-disabled-color);
background-color: var(--brand-button-disabled);
color: var(--secondary-button-disabled-color);
background-color: var(--secondary-button-disabled);
}
}
&.positive {
Expand Down Expand Up @@ -278,7 +279,7 @@
height: .8125rem;
min-width: 1rem;

&:focus { box-shadow: 0 0 0 1px var(--accented-button-outline); }
&:focus { box-shadow: 0 0 0 1px var(--primary-button-outline); }
}

&.notSelected {
Expand Down
7 changes: 4 additions & 3 deletions packages/theme/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
letter-spacing: 1px;
text-transform: uppercase;
}
&:not(.title) { font-size: .8125rem; }
&.bold {
font-weight: 600;
color: var(--theme-caption-color);
Expand Down Expand Up @@ -257,7 +258,7 @@
.antiNav-footer {
display: flex;
flex-direction: column;
padding: .5rem 0 .75rem;
padding: .5rem 0 1.25rem;
}

/* Basic */
Expand Down Expand Up @@ -642,8 +643,8 @@

&:hover,
&:focus-within { background-color: var(--theme-bg-color); }
// &:focus-within .caption { box-shadow: 0 0 2px 1px var(--accented-button-outline); }
&:focus-within .caption { border-color: var(--accented-button-outline); }
// &:focus-within .caption { box-shadow: 0 0 2px 1px var(--primary-button-outline); }
&:focus-within .caption { border-color: var(--primary-button-outline); }
}
}

Expand Down
Loading