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

ISCT-97: Add UI style v4 #251

Merged
merged 42 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aed1ed1
chore(isct-97): update typography v4 sass and mdx
AndyKIron Nov 5, 2023
44a4d6e
Merge branch 'release/6.x.x' into feature/isct-97-ui-style-v4
AndyKIron Nov 5, 2023
9a0e2cc
chore(isct-97): update storybook left menu
AndyKIron Nov 5, 2023
5c40640
chore(release): 6.2.2-rc.0
Nov 5, 2023
1a70cab
chore(isct-97): update link to fonts.css in storybook
AndyKIron Nov 5, 2023
d73af50
chore(isct-97): add evaluations (shadows) storybook page
AndyKIron Nov 5, 2023
cdb51b2
chore(isct-97): add style-guide.scss
AndyKIron Nov 5, 2023
960acb4
chore(release): 6.2.2-rc.1
Nov 5, 2023
b7021c1
chore(isct-97): update link to v4 style-guide in storybook
AndyKIron Nov 5, 2023
4f95f17
Merge remote-tracking branch 'origin/feature/isct-97-ui-style-v4' int…
AndyKIron Nov 5, 2023
2c8ff05
chore(isct-97): move storybook foundation related .mdx files to story…
AndyKIron Nov 6, 2023
b7ebf78
chore(isct-97): move storybook foundation v4 suffix removed from mdx …
AndyKIron Nov 6, 2023
5f73cdb
chore(isct-97): add colors v4 scss and base story
AndyKIron Nov 6, 2023
74b9a6d
chore(isct-97): typoi fix
AndyKIron Nov 6, 2023
88f5b57
chore(isct-97): added color.mdx
AndyKIron Nov 7, 2023
9435e34
chore(isct-97): added border-radius, changes in scss v4 vars names
AndyKIron Nov 7, 2023
517f9ce
chore(release): 6.2.2-rc.2
Nov 7, 2023
8e4af21
chore(isct-97): fixes in scss v4 vars names
AndyKIron Nov 7, 2023
a240994
chore(isct-97): changes in colors values
AndyKIron Nov 7, 2023
971f98e
chore(release): 6.2.2-rc.3
Nov 7, 2023
70a24bf
chore(isct-97): added border-radius and spacing, some changes in colo…
AndyKIron Nov 7, 2023
5e6a8f1
chore(isct-97): added breakpoints and grid-layout
AndyKIron Nov 7, 2023
688af91
chore(isct-97): refactor colors mdx story
AndyKIron Nov 8, 2023
72678ab
chore(isct-97): changes in spacing page
AndyKIron Nov 8, 2023
0c529c8
chore(isct-97): added icons storybook page
AndyKIron Nov 8, 2023
58c2f3a
chore(isct-97): update icons storybook page
AndyKIron Nov 9, 2023
192ba81
chore(isct-97): add support for colored icons and use path in icon na…
AndyKIron Nov 9, 2023
67d0360
chore(isct-97): fixed unit test
AndyKIron Nov 9, 2023
d1bdafd
chore(release): 6.2.2-rc.4
Nov 9, 2023
bf27d0e
chore(isct-97): up link to v4 styleguide in storybook
AndyKIron Nov 9, 2023
21a4c78
Merge remote-tracking branch 'origin/feature/isct-97-ui-style-v4' int…
AndyKIron Nov 9, 2023
5c501a3
chore(isct-97): added support for phosphor regular icons prefix in ic…
AndyKIron Nov 9, 2023
d081785
chore(isct-97): update v4 icons story
AndyKIron Nov 9, 2023
89fae61
chore(isct-97): update v4 icons story
AndyKIron Nov 9, 2023
6fbf4eb
chore(isct-97): fix for double svg load call
AndyKIron Nov 9, 2023
66ef48e
chore(isct-97): fix for double svg load call unit test
AndyKIron Nov 9, 2023
bb32a64
chore(isct-97): fix for svg http request cashing
AndyKIron Nov 15, 2023
ab8e791
chore(isct-97): added type
AndyKIron Nov 15, 2023
5873718
chore(release): 6.2.2-rc.5
Nov 16, 2023
426f354
chore(isct-97): code-review changes
AndyKIron Nov 16, 2023
3aafbe7
chore(isct-97): fixed unit test
AndyKIron Nov 16, 2023
be3a8a2
feat(isct-97): add support for ui style v4
AndyKIron Nov 16, 2023
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
33 changes: 17 additions & 16 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<link rel="stylesheet" href="https://fusion.ironsrc.net/Angular_14/v26/styles.5859cbb869f0ab3e.css">
<link rel="stylesheet" href="https://fusion-ui.s3.eu-west-1.amazonaws.com/release/6.0.1/style/v4/fonts.css">
<link rel="stylesheet" href="https://fusion-ui.s3.eu-west-1.amazonaws.com/release/6.2.2-rc.4/style/v4/style-guide.css">

<style>
body {
Expand Down Expand Up @@ -61,31 +61,32 @@
/* endregion */

/* region shadows */
.fu-shadow-xs{box-shadow:0px 1px 2px 0px rgba(16,24,40,.05)}.fu-shadow-sm{box-shadow:0px 1px 3px 0px rgba(16,24,40,.1),0px 1px 2px 0px rgba(16,24,40,.06)}.fu-shadow-md{box-shadow:0px 4px 8px -2px rgba(16,24,40,.1),0px 2px 4px -2px rgba(16,24,40,.06)}.fu-shadow-lg{box-shadow:0px 12px 16px -4px rgba(16,24,40,.08),0px 4px 6px -2px rgba(16,24,40,.03)}.fu-shadow-xl{box-shadow:0px 20px 24px -6px rgba(16,24,40,.08),0px 8px 8px -4px rgba(16,24,40,.03)}.fu-shadow-xxl{box-shadow:0px 24px 48px -12px rgba(16,24,40,.18)}.fu-shadow-xxxl{box-shadow:0px 19px 32px 2px rgba(44,45,45,.14)}.fu-shadow-slg{box-shadow:0px 27px 27px 2px rgba(44,45,45,.14)}

.fu-shadow-examples{
width: 675px;
margin: 32px auto;
display: flex;
padding: 40px;
justify-content: space-between;
align-items: center;
align-content: center;
row-gap: 48px;
align-self: stretch;
flex-wrap: wrap;
border-radius: 8px;
background: #F1F1F1;
}
.fu-shadow-example-holder {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-between;
gap: 38px;
padding: 80px;
background-color: #EDEDED;
gap: 16px;
}
.fu-shadow-example {
width: 124px;
height: 124px;
background-color: #fff;
border-radius: 16px;
display: flex;
gap: 8px;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 12px;
}
.fu-shadow-hr{
flex-basis: 100%;
}
/* endregion */

Expand Down
34 changes: 33 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,39 @@ const preview = {
docs: {inlineStories: true},
options: {
storySort: {
order: ['Introduction', 'Styleguide', ['Colors', 'Typography', 'Iconography', 'Grid system', '*'], 'Components'],
order: [
'Introduction',
'V4',
[
'Foundation',
[
'Typography',
'Palette colors',
'Elevations',
'Border radius',
'Spacing',
'Grid',
'Breakpoints',
],
'Components',
'*',
],
'V3',
[
'Foundation',
[
'Typography',
'Palette color',
'Elevations',
'Border radius',
'Spacing',
'Grid',
'Breakpoints',
],
'Components',
'*',
],
],
method: 'alphabetical',
locales: 'en-Us'
},
Expand Down
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"]
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

### [6.2.2-rc.5](https://github.com/ironSource/fusion-ui/compare/v6.2.2-rc.4...v6.2.2-rc.5) (2023-11-16)

### [6.2.2-rc.4](https://github.com/ironSource/fusion-ui/compare/v6.2.2-rc.3...v6.2.2-rc.4) (2023-11-09)

### [6.2.2-rc.3](https://github.com/ironSource/fusion-ui/compare/v6.2.2-rc.2...v6.2.2-rc.3) (2023-11-07)

### [6.2.2-rc.2](https://github.com/ironSource/fusion-ui/compare/v6.2.2-rc.1...v6.2.2-rc.2) (2023-11-07)

### [6.2.2-rc.1](https://github.com/ironSource/fusion-ui/compare/v6.2.2-rc.0...v6.2.2-rc.1) (2023-11-05)

### [6.2.2-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.2.1...v6.2.2-rc.0) (2023-11-05)

### [6.2.1](https://github.com/ironSource/fusion-ui/compare/v6.2.1-rc.1...v6.2.1) (2023-11-05)

### [6.2.1-rc.1](https://github.com/ironSource/fusion-ui/compare/v6.2.1-rc.0...v6.2.1-rc.1) (2023-11-02)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fusion-ui",
"version": "6.2.1",
"version": "6.2.2-rc.5",
"description": "UI library created by ironSource",
"license": "MIT",
"repository": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const sizes = [null, 'small', 'large'];
const themes = ['primary', 'secondary', 'third', 'danger'];

export default {
title: 'Components/Button',
title: 'V3/Components/Button',
component: ButtonComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const START_DATE = new Date(TODAY.getFullYear(), TODAY.getMonth(), 2);
const END_DATE = new Date(TODAY.getFullYear(), TODAY.getMonth() + 1, -3);

export default {
title: 'Components/Dates/Calendar',
title: 'V3/Components/Dates/Calendar',
component: CalendarComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const formControlChecked = new FormControl(true);
const formControlUnchecked = new FormControl(false);

export default {
title: 'Components/Inputs/Checkbox',
title: 'V3/Components/Inputs/Checkbox',
component: CheckboxComponent,
decorators: [
moduleMetadata({
Expand Down
2 changes: 1 addition & 1 deletion projects/fusion-ui/components/checkbox/v3/checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta, Story, Source, ArgsTable} from '@storybook/blocks';
import * as ComponentStories from './checkbox.component.stories';
import {CheckboxComponent} from "./checkbox.component";

<Meta title="Components/Inputs/Checkbox/All"/>
<Meta title="V3/Components/Inputs/Checkbox/All"/>

# Checkbox
Switches are the preferred way to adjust settings on mobile. The option that the switch controls, as well as the state it's in, should be made clear from the corresponding inline label.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {DropdownDualMultiSelectModule} from '@ironsource/fusion-ui/components/dr
import {ChipFilterComponentConfigurations} from '@ironsource/fusion-ui/components/chip-filter/common/base';

export default {
title: 'Components/Filters/Filter (Chip)',
title: 'V3/Components/Filters/Filter (Chip)',
component: ChipFilterComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {DaterangeModule, DaterangeOptions} from '@ironsource/fusion-ui/component
import {DropdownDualMultiSelectModule} from '@ironsource/fusion-ui/components/dropdown-dual-multi-select';

export default {
title: 'Components/Filters/Filter Panel',
title: 'V3/Components/Filters/Filter Panel',
component: ChipFiltersComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import {ChipFilterComponentConfigurations} from '@ironsource/fusion-ui/components/chip-filter/common/base';

export default {
title: 'Components/Filters/Filter Panel Dynamic',
title: 'V3/Components/Filters/Filter Panel Dynamic',
component: ChipFiltersComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IconModule} from '@ironsource/fusion-ui/components/icon/v1';
import {DaterangeComponent, DaterangeModule, DaterangeOptions, DaterangeSelection} from './';

export default {
title: 'Components/Dates/DatePicker',
title: 'V3/Components/Dates/DatePicker',
component: DaterangeComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const CUSTOM_PRESET_LAST_3_DAYS: DaterangeCustomPreset = {
};

export default {
title: 'Components/Dates/Date range',
title: 'V3/Components/Dates/Date range',
component: DaterangeComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@ironsource/fusion-ui/components/dropdown/v3/stories/dropdown.mock';

export default {
title: 'Components/Dropdown/Include-Exclude',
title: 'V3/Components/Dropdown/Include-Exclude',
component: DropdownDualMultiSelectComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import {ApiBase} from '@ironsource/fusion-ui/components/api-base';

export default {
title: 'Components/Dropdown',
title: 'V3/Components/Dropdown',
component: DropdownComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {FileDragAndDropState} from '@ironsource/fusion-ui/components/file-drag-a
const defaultFileState: FileDragAndDropState = {name: ''};

const meta: Meta<FileCsvUploadComponent> = {
title: 'Components/CSV File Uploader',
title: 'V3/Components/CSV File Uploader',
component: FileCsvUploadComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {FloatingToolbarComponent} from '@ironsource/fusion-ui/components/floatin
import {ButtonModule} from '@ironsource/fusion-ui/components/button';

export default {
title: 'Components/Floating toolbar',
title: 'V3/Components/Floating toolbar',
component: FloatingToolbarComponent,
decorators: [
moduleMetadata({
Expand Down
10 changes: 7 additions & 3 deletions projects/fusion-ui/components/icon/v1/icon.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ fusion-icon {
max-height: 100%;
width: inherit;
height: inherit;
* {
fill: currentColor;
}
}
&.loading {
svg{
Expand All @@ -16,4 +13,11 @@ fusion-icon {
}
}
}
&:not(.fu-colored) {
svg {
* {
fill: currentColor;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('IconComponent', () => {

it('Must call ngAfterViewInit method', () => {
const spyAfterInit = spyOn(component, 'loadSvg');
component.requestedToLoad = false
fixture.detectChanges();
expect(spyAfterInit.calls.any()).toBe(true);
});
Expand Down
17 changes: 15 additions & 2 deletions projects/fusion-ui/components/icon/v1/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {SvgComponent} from '@ironsource/fusion-ui/components/svg';
export class IconComponent extends SvgComponent {
@Input() set name(val: IconData) {
if (typeof val === 'string') {
this.onNameChanged(val);
this.setLibPath(val);
this.onNameChanged(this.iconName ?? val);
} else {
this.libVersion = val.iconVersion;
this.onNameChanged(val.iconName);
Expand All @@ -25,7 +26,7 @@ export class IconComponent extends SvgComponent {
if (!this.iconName) {
throw new Error(`Asset path-name '${this.svgPath}' not set`);
} else {
if (this.svgOptions && this.svgOptions.assetsPath) {
if (this.svgOptions?.assetsPath) {
this.svgPath =
this.svgOptions.assetsPath === 'https://fusion.ironsrc.net/assets'
? `${this.libVersion}/${this.iconName}`
Expand All @@ -35,6 +36,18 @@ export class IconComponent extends SvgComponent {
return super.getUrlPath();
}

private setLibPath(value: string): void {
if (typeof value === 'string' && value.includes('/')) {
const lastIndex = value.lastIndexOf('/');
this.libVersion = value.substring(0, lastIndex);
this.iconName = value.substring(lastIndex + 1);
// for phosphor regular icons
if (this.libVersion === 'ph') {
this.libVersion += '/regular';
}
}
}

private onNameChanged(value: string): void {
this.renderer.removeClass(
this.elementRef.nativeElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {dedent} from 'ts-dedent';
import {InputOptions} from '@ironsource/fusion-ui/components/input';

export default {
title: 'Components/Inputs/Input-Inline',
title: 'V3/Components/Inputs/Input-Inline',
component: InputInlineComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const inputFormControlPassword = new FormControl('qwerty');
// endregion

export default {
title: 'Components/Inputs/Input',
title: 'V3/Components/Inputs/Input',
component: InputComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const actionsData = {
};

const meta: Meta<LayoutHeaderComponent> = {
title: '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: '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: 'Components/Layout',
title: 'V4/Components/Layout',
component: LayoutComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MOCK_MENU_ITEMS: MenuDropItem[] = [
];

export default {
title: 'Components/Dropped Menu',
title: 'V3/Components/Dropped Menu',
component: MenuDropComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ButtonModule} from '@ironsource/fusion-ui/components/button/v3';
import {ModalContentComponent} from '@ironsource/fusion-ui/components/modal';

export default {
title: 'Components/Dialog/Content',
title: 'V3/Components/Dialog/Content',
component: ModalContentComponent,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const actionsData = {
};

export default {
title: 'Components/Dialog/Footer',
title: 'V3/Components/Dialog/Footer',
component: ModalFooterComponent,
decorators: [
moduleMetadata({
Expand Down
Loading