Skip to content

Commit

Permalink
chore(isct-97): add colors v4 scss and base story
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyKIron committed Nov 6, 2023
1 parent b7ebf78 commit 5f73cdb
Show file tree
Hide file tree
Showing 13 changed files with 483 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"allowSyntheticDefaultImports": true
},
"exclude": ["../projects/**/*.spec.ts"],
"include": ["../projects/fusion-ui/components/**/*"],
"include": ["../projects/fusion-ui/components/**/*", "../projects/fusion-ui/storybook-foundations/**/*"],
"files": ["./typings.d.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const actionsData = {
};

const meta: Meta<LayoutHeaderComponent> = {
title: 'V3/Components/Layout/Header',
title: 'V4/Components/Layout/Header',
component: LayoutHeaderComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {TopFilterIncludeExcludeComponent} from '@ironsource/fusion-ui/components/top-filter-include-exclude';

const meta: Meta<LayoutStoryWrapperComponent> = {
title: 'V3/Components/Layout/One Main Parent',
title: 'V4/Components/Layout/One Main Parent',
component: LayoutComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {MOK_APPLICATIONS_ONE_LINE_OPTIONS} from '@ironsource/fusion-ui/component
import {DropdownOption} from '@ironsource/fusion-ui/components/dropdown-option/entities';

const meta: Meta<LayoutStoryWrapperComponent> = {
title: 'V3/Components/Layout',
title: 'V4/Components/Layout',
component: LayoutComponent,
decorators: [
moduleMetadata({
Expand Down
106 changes: 106 additions & 0 deletions projects/fusion-ui/src/style/scss/v4/colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@import './vars/colors';

/* region css variables */
.fusion-v4 {
--background-default: #{$color-v4-background-default};
--background-paper: #{$color-v4-background-paper};
--background-model-elevation: #{$color-v4-background-model-elevation};
--background-backdrop: #{$color-v4-background-backdrop};
--background-paper-elevation-0: #{$color-v4-background-paper-elevation-0};
--background-paper-elevation-1: #{$color-v4-background-paper-elevation-1};
--background-paper-elevation-2: #{$color-v4-background-paper-elevation-2};
--background-paper-elevation-3: #{$color-v4-background-paper-elevation-3};
--background-paper-elevation-4: #{$color-v4-background-paper-elevation-4};
--background-paper-elevation-5: #{$color-v4-background-paper-elevation-5};
--background-paper-elevation-6: #{$color-v4-background-paper-elevation-6};
--background-paper-elevation-7: #{$color-v4-background-paper-elevation-7};
--background-paper-elevation-8: #{$color-v4-background-paper-elevation-8};
--background-paper-elevation-9: #{$color-v4-background-paper-elevation-9};

--action-primary: #{$color-v4-action-primary};
--action-active: #{$color-v4-action-active};
--action-hover: #{$color-v4-action-hover};
--action-selected: #{$color-v4-action-selected};
--action-disabled: #{$color-v4-action-disabled};
--action-disabled-background: #{$color-v4-action-disabled-background};
--action-focus: #{$color-v4-action-focus};
--action-outlined-border: #{$color-v4-action-outlined-border};

--default-light: #{$color-v4-default-light};
--default-main: #{$color-v4-default-main};
--default-dark: #{$color-v4-default-dark};
--default-outlined-border: #{$color-v4-default-outlined-border};
--default-contrast-text: #{$color-v4-default-contrast-text};
--default-button-contrast-text: #{$color-v4-default-button-contrast-text};

--common-white: #{$color-v4-common-white};
--common-black: #{$color-v4-common-black};
--common-inverse-white: #{$color-v4-common-inverse-white};
--common-inverse-black: #{$color-v4-common-inverse-black};
--common-divider: #{$color-v4-common-divider};
--common-divider-elevation-0: #{$color-v4-common-divider-elevation-0};

--text-primary: #{$color-v4-text-primary};
--text-secondary: #{$color-v4-text-secondary};
--text-disabled: #{$color-v4-text-disabled};

--primary-lighter: #{$color-v4-primary-lighter};
--primary-light: #{$color-v4-primary-light};
--primary-main: #{$color-v4-primary-main};
--primary-main-8-p: #{$color-v4-primary-main-8-p};
--primary-main-50-p: #{$color-v4-primary-main-50-p};
--primary-dark: #{$color-v4-primary-dark};
--primary-darker: #{$color-v4-primary-darker};
--primary-outlined-border: #{$color-v4-primary-outlined-border};
--primary-contrast-text: #{$color-v4-primary-contrast-text};
--primary-button-contrast-text: #{$color-v4-primary-button-contrast-text};

--info-lighter: #{$color-v4-info-lighter};
--info-light: #{$color-v4-info-light};
--info-main: #{$color-v4-info-main};
--info-main-8-p: #{$color-v4-info-main-8-p};
--info-main-50-p: #{$color-v4-info-main-50-p};
--info-dark: #{$color-v4-info-dark};
--info-darker: #{$color-v4-info-darker};
--info-outlined-border: #{$color-v4-info-outlined-border};
--info-contrast-text: #{$color-v4-info-contrast-text};
--info-button-contrast-text: #{$color-v4-info-button-contrast-text};

--success-lighter: #{$color-v4-success-lighter};
--success-light: #{$color-v4-success-light};
--success-main: #{$color-v4-success-main};
--success-main-8-p: #{$color-v4-success-main-8-p};
--success-main-50-p: #{$color-v4-success-main-50-p};
--success-dark: #{$color-v4-success-dark};
--success-darker: #{$color-v4-success-darker};
--success-outlined-border: #{$color-v4-success-outlined-border};
--success-contrast-text: #{$color-v4-success-contrast-text};
--success-button-contrast-text: #{$color-v4-success-button-contrast-text};

--warning-lighter: #{$color-v4-warning-lighter};
--warning-light: #{$color-v4-warning-light};
--warning-main: #{$color-v4-warning-main};
--warning-main-8-p: #{$color-v4-warning-main-8-p};
--warning-main-50-p: #{$color-v4-warning-main-50-p};
--warning-dark: #{$color-v4-warning-dark};
--warning-darker: #{$color-v4-warning-darker};
--warning-outlined-border: #{$color-v4-warning-outlined-border};
--warning-contrast-text: #{$color-v4-warning-contrast-text};
--warning-button-contrast-text: #{$color-v4-warning-button-contrast-text};

--error-lighter: #{$color-v4-error-lighter};
--error-light: #{$color-v4-error-light};
--error-main: #{$color-v4-error-main};
--error-main-8-p: #{$color-v4-error-main-8-p};
--error-main-50-p: #{$color-v4-error-main-50-p};
--error-dark: #{$color-v4-error-dark};
--error-darker: #{$color-v4-error-darker};
--error-outlined-border: #{$color-v4-error-outlined-border};
--error-contrast-text: #{$color-v4-error-contrast-text};
--error-button-contrast-text: #{$color-v4-error-button-contrast-text};

--aba: #{$color-v4-aba};
--abb: #{$color-v4-abb};
}
/* endregion css variables */

1 change: 1 addition & 0 deletions projects/fusion-ui/src/style/scss/v4/style-guide.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import './fonts';
@import './colors';
@import './shadows';
@import './grid';
111 changes: 107 additions & 4 deletions projects/fusion-ui/src/style/scss/v4/vars/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Colors V4 */
// region Colors V4 (started, used in for layout v4)
$White: #ffffff;

// todo: check and sync it with colors v4 palette (Unity)
// region colors before Unity palette arrived
// region colors Navigation
// background
$fu-nav-primary-ironsource: #0D148C;
Expand All @@ -18,12 +20,113 @@ $fu-nav-menu-white-12: rgba(255, 255, 255, 0.12);
//black - transparent
$fu-nav-menu-black-8: rgba(0, 0, 0, 0.08);
$fu-nav-menu-black-5: rgba(0, 0, 0, 0.05);
// end region

// endregion
// region Misc
$fu-divider: #E0E0E0;
$fu-icon-drop: rgba(0, 0, 0, 0.3);
// endregion

// todo: update colors with Moran
$fu-light-100: #F5F5F5;
// endregion

// region Colors V4 - light palette
$color-v4-background-default: #FFFFFF;
$color-v4-background-paper: hsl(0, 0%, 99.0%);
$color-v4-background-model-elevation: #FFFFFF;
$color-v4-background-backdrop: hsla(0, 0%, 0%, 0.11);
$color-v4-background-paper-elevation-0: hsl(0, 0%, 97.5%);
$color-v4-background-paper-elevation-1: hsl(0, 0%, 94.6%);
$color-v4-background-paper-elevation-2: hsl(0, 0%, 92.0%);
$color-v4-background-paper-elevation-3: hsl(0, 0%, 89.5%);
$color-v4-background-paper-elevation-4: hsl(0, 0%, 86.8%);
$color-v4-background-paper-elevation-5: hsl(0, 0%, 83.0%);
$color-v4-background-paper-elevation-6: hsl(0, 0%, 73.2%);
$color-v4-background-paper-elevation-7: hsl(0, 0%, 55.2%);
$color-v4-background-paper-elevation-8: hsl(0, 0%, 50.3%);
$color-v4-background-paper-elevation-9: hsl(0, 0%, 39.3%);

$color-v4-action-primary: hsl(0, 0%, 12.5%);
$color-v4-action-active: hsl(0, 0%, 50.3%);
$color-v4-action-hover: hsla(0, 0%, 0%, 0.05);
$color-v4-action-selected: hsla(0, 0%, 92%, 1);
$color-v4-action-disabled: hsla(0, 0%, 87%, 1);
$color-v4-action-disabled-background: hsla(0, 0%, 95%, 1);
$color-v4-action-focus: hsl(0, 0%, 92.0%);
$color-v4-action-outlined-border : hsla(0, 0%, 73%, 1);

$color-v4-default-light: hsl(0, 0%, 89.5%);
$color-v4-default-main: hsl(0 0% 94.51%);
$color-v4-default-dark: hsl(0, 0%, 92.0%);
$color-v4-default-outlined-border: hsl(0, 0%, 73.2%);
$color-v4-default-contrast-text: hsl(0, 0%, 12.5%);
$color-v4-default-button-contrast-text: hsla(0, 0%, 0%, 1);

$color-v4-common-white: #FFFFFF;
$color-v4-common-black: #000000;
$color-v4-common-inverse-white: #FFFFFF;
$color-v4-common-inverse-black: #000000;
$color-v4-common-divider: hsl(0, 0%, 86.8%);
$color-v4-common-divider-elevation-0: hsla(0, 0%, 89%, 1);

$color-v4-text-primary: hsl(0, 0%, 12.5%);
$color-v4-text-secondary: hsl(0, 0%, 39.3%);
$color-v4-text-disabled: hsl(0 0% 73.33%);

$color-v4-primary-lighter: hsl(209, 100%, 96.5%);
$color-v4-primary-light: hsl(209, 95.0%, 90.1%);
$color-v4-primary-main: hsl(206, 100%, 50.0%);
$color-v4-primary-main-8-p: hsla(206, 100%, 50%, 0.08);
$color-v4-primary-main-50-p: hsla(206, 100%, 50%, 0.5);
$color-v4-primary-dark: hsl(208, 93.5%, 47.4%);
$color-v4-primary-darker: hsl(211, 90.0%, 42.0%);
$color-v4-primary-outlined-border: hsl(206, 100%, 50.0%);
$color-v4-primary-contrast-text: hsl(216, 71.0%, 23.0%);
$color-v4-primary-button-contrast-text: hsla(0, 0%, 100%, 1);

$color-v4-info-lighter: hsl(223, 98.4%, 97.1%);
$color-v4-info-light: hsl(224, 87.1%, 92.0%);
$color-v4-info-main: hsl(226, 70.0%, 55.5%);
$color-v4-info-main-8-p: hsla(226, 70%, 55.5%, 0.08);
$color-v4-info-main-50-p: hsla(226, 70%, 55.5%, 0.5);
$color-v4-info-dark: hsl(226, 58.6%, 51.3%);
$color-v4-info-darker: hsl(226, 55.0%, 45.0%);
$color-v4-info-outlined-border: hsl(226, 70.0%, 55.5%);
$color-v4-info-contrast-text: hsl(226, 50.0%, 24.0%);
$color-v4-info-button-contrast-text: hsla(0, 0%, 100%, 1);

$color-v4-success-lighter: hsl(139, 55.2%, 94.5%);
$color-v4-success-light: hsl(141, 43.7%, 86.0%);
$color-v4-success-main: hsl(151, 55.0%, 41.5%);
$color-v4-success-main-8-p: hsla(151, 55%, 41.5%, 0.08);
$color-v4-success-main-50-p: hsla(151, 55%, 41.5%, 0.5);
$color-v4-success-dark: hsl(152, 57.5%, 37.6%);
$color-v4-success-darker: hsl(153, 67.0%, 28.5%);
$color-v4-success-outlined-border: hsl(151, 55.0%, 41.5%);
$color-v4-success-contrast-text: hsl(155, 40.0%, 16.5%);
$color-v4-success-button-contrast-text: hsla(0, 0%, 100%, 1);

$color-v4-warning-lighter: hsl(45, 100%, 90.8%);
$color-v4-warning-light: hsl(40, 100%, 81.5%);
$color-v4-warning-main: hsl(42, 100%, 62.0%);
$color-v4-warning-main-8-p: hsla(42, 100%, 62%, 0.08);
$color-v4-warning-main-50-p: hsla(42, 100%, 62%, 0.5);
$color-v4-warning-dark: hsl(42, 100%, 55.0%);
$color-v4-warning-darker: hsl(25, 50.0%, 38.0%);
$color-v4-warning-outlined-border: hsl(42, 100%, 62.0%);
$color-v4-warning-contrast-text: hsl(25, 40.0%, 22.0%);
$color-v4-warning-button-contrast-text: hsla(24, 40%, 22%, 1);

$color-v4-error-lighter: hsl(360, 100%, 96.8%);
$color-v4-error-light: hsl(360, 90.2%, 91.9%);
$color-v4-error-main: hsl(358, 75.0%, 59.0%);
$color-v4-error-main-8-p: hsla(358, 75%, 59%, 0.08);
$color-v4-error-main-50-p: hsla(358, 75%, 59%, 0.5);
$color-v4-error-dark: hsl(358, 67.4%, 54.6%);
$color-v4-error-darker: hsl(358, 65.0%, 47.0%);
$color-v4-error-outlined-border: hsl(358, 75.0%, 59.0%);
$color-v4-error-contrast-text: hsl(350, 63.0%, 24.0%);
$color-v4-error-button-contrast-text: hsla(0, 0%, 100%, 1);

$color-v4-aba: #FFC134;
$color-v4-abb: #4F4FF5;
// endregion
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="colors-wrapper fusion-v4">
<div *ngFor="let colorGroup of colorPalette | keyvalue: keepOrder" class="color-block">
<div class="color-label">{{ colorGroup.key }}</div>
<div class="colors-holder">
<div class="color-title">
<div>Name</div>
<div>Value</div>
</div>
<div *ngFor="let token of colorGroup.value | keyvalue: keepOrder" class="color-row">
<div>
<div class="icon-holder"></div>
{{ token.key }}
</div>
<div>
<div class="color-example" [style.background-color]="token.value"></div>
{{ token.value }}
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@import '../../../src/style/scss/v4/fonts';
@import '../../../src/style/scss/v4/colors';

.colors-wrapper {
display: flex;
flex-wrap: wrap;
gap: 32px;
margin: 32px;
padding-bottom: 32px;
.color-block {
width: 425px;
background-color: var(--background-default);

.color-label {
padding: 1.5rem 1rem 0.75rem 1rem;
color: var(--text-primary);
border: solid 1px var(--common-divider);
@extend %font-v4-heading-1;
&:first-letter {
text-transform: uppercase;
}
}
.color-title {
display: flex;
color: var(--text-primary);
border: solid 1px var(--common-divider);
border-top: 0px;
div {
@extend %font-v4-table-label;
padding: 0.25rem 1rem;
width: 50%;
height: 2.5rem;
display: flex;
align-items: center;
}
}
.color-row {
display: flex;
color: var(--text-primary);
div {
border: solid 1px var(--common-divider);
border-top: 0px;
display: flex;
align-items: center;
height: 2.5rem;
padding: 0.25rem 1rem;
width: 50%;
@extend %font-v4-caption;
&:first-of-type {
display: flex;
gap: 0.5rem;
.icon-holder {
padding: 0;
margin: 0;
width: 16px;
height: 16px;
border: none;

background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='gray' d='M12.548 3.368A6.454 6.454 0 0 0 8 1.5h-.067A6.5 6.5 0 0 0 1.5 8c0 2.688 1.661 4.941 4.335 5.886A2 2 0 0 0 8.5 12a1 1 0 0 1 1-1h2.888a1.988 1.988 0 0 0 1.95-1.555c.112-.492.166-.995.162-1.5a6.457 6.457 0 0 0-1.952-4.577Zm.813 5.857a.993.993 0 0 1-.973.775H9.5a2 2 0 0 0-2 2 1 1 0 0 1-1.332.942C3.906 12.144 2.5 10.25 2.5 8a5.5 5.5 0 0 1 5.443-5.5H8a5.522 5.522 0 0 1 5.5 5.453c.004.428-.042.855-.136 1.272h-.002ZM8.75 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM6 6.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 3.5a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm5.5-3.5a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
}
}
&:last-of-type {
border-left: 0px;
display: flex;
gap: 0.5rem;
}
.color-example {
padding: 0;
margin: 0;
width: 16px;
height: 16px;
border: solid 1px var(--common-divider);
border-radius: 0.1875rem;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
import {CommonModule} from '@angular/common';
import {colorPaletteLight} from './colorsData';

@Component({
selector: 'fusion-colors-palette',
standalone: true,
imports: [CommonModule],
templateUrl: './colors-palette.component.html',
styleUrls: ['./colors-palette.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ColorsPaletteComponent {
colorPalette = colorPaletteLight;

keepOrder = (a, b) => {
return a;
};
}
Loading

0 comments on commit 5f73cdb

Please sign in to comment.