diff --git a/package-lock.json b/package-lock.json index 2a5e29c1e..24a8dc8c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2560,6 +2560,11 @@ } } }, + "classlist.js": { + "version": "1.1.20150312", + "resolved": "https://registry.npmjs.org/classlist.js/-/classlist.js-1.1.20150312.tgz", + "integrity": "sha1-HXCEL3Ai8I2awIbOaeWyUPLFd4k=" + }, "clean-css": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", @@ -14038,6 +14043,11 @@ "minimalistic-assert": "^1.0.0" } }, + "web-animations-js": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.2.tgz", + "integrity": "sha512-TOMFWtQdxzjWp8qx4DAraTWTsdhxVSiWa6NkPFSaPtZ1diKUxTn4yTix73A1euG1WbSOMMPcY51cnjTIHrGtDA==" + }, "webdriver-js-extender": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", diff --git a/package.json b/package.json index a20871036..0d08ad261 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,11 @@ "@angular/platform-browser-dynamic": "~7.2.15", "@angular/router": "~7.2.15", "@tangoe/gosheets": "^1.0.0", + "classlist.js": "^1.1.20150312", "core-js": "^2.5.4", "npm": "^6.10.1", "rxjs": "~6.5.2", + "web-animations-js": "^2.3.2", "zone.js": "~0.8.26" }, "devDependencies": { diff --git a/projects/go-lib/src/lib/animations/_configs.ts b/projects/go-lib/src/lib/animations/_configs.ts new file mode 100644 index 000000000..641c60861 --- /dev/null +++ b/projects/go-lib/src/lib/animations/_configs.ts @@ -0,0 +1,2 @@ +export const timing = '.5s '; +export const easing = 'cubic-bezier(.25, .8, .25, 1)'; diff --git a/projects/go-lib/src/lib/animations/fade.animation.ts b/projects/go-lib/src/lib/animations/fade.animation.ts index f1b5cf997..861d341b0 100644 --- a/projects/go-lib/src/lib/animations/fade.animation.ts +++ b/projects/go-lib/src/lib/animations/fade.animation.ts @@ -6,7 +6,7 @@ import { trigger } from '@angular/animations'; -const timing = '.5s cubic-bezier(.25, .8, .25, 1)'; +import { easing, timing } from './_configs'; export const fadeAnimation = trigger('fade', [ state('in', style({ @@ -18,7 +18,7 @@ export const fadeAnimation = trigger('fade', [ visibility: 'hidden' })), transition('in <=> out', [ - animate(timing) + animate(timing + easing) ]) ]); @@ -27,13 +27,13 @@ export const fadeTemplateAnimation = trigger('fadeTemplate', [ style({ opacity: 0 }), - animate(timing, style({ + animate(timing + easing, style({ opacity: 1 })) ]), transition(':leave', [ - animate(timing, style({ + animate(timing + easing, style({ opacity: 0 })) ]) -]) \ No newline at end of file +]); diff --git a/projects/go-lib/src/lib/animations/off-canvas.animation.ts b/projects/go-lib/src/lib/animations/off-canvas.animation.ts index 599fbaada..5654395bc 100644 --- a/projects/go-lib/src/lib/animations/off-canvas.animation.ts +++ b/projects/go-lib/src/lib/animations/off-canvas.animation.ts @@ -6,6 +6,8 @@ import { trigger } from '@angular/animations'; +import { easing, timing } from './_configs'; + export const offCanvasAnimation = trigger('offCanvas', [ state('slideIn', style({ transform: 'translateX(-300px)' @@ -15,6 +17,6 @@ export const offCanvasAnimation = trigger('offCanvas', [ visibility: 'hidden' })), transition('slideIn <=> slideOut', [ - animate('.5s cubic-bezier(.25, .8, .25, 1)') + animate(timing + easing) ]) ]); diff --git a/projects/go-lib/src/lib/animations/route.animation.ts b/projects/go-lib/src/lib/animations/route.animation.ts new file mode 100644 index 000000000..1bc72bd5a --- /dev/null +++ b/projects/go-lib/src/lib/animations/route.animation.ts @@ -0,0 +1,37 @@ +import { + animate, + query, + style, + transition, + trigger +} from '@angular/animations'; + +import { easing, timing } from './_configs'; + +export const routerAnimation = + trigger('routerAnimation', [ + transition('* <=> *', [ + query(':enter', + [ + style({ opacity: 0 }) + ], + { optional: true } + ), + + query(':leave', + [ + style({ opacity: 1 }), + animate(timing + easing, style({ opacity: 0, transform: 'scale(0.95)' })) + ], + { optional: true } + ), + + query(':enter', + [ + style({ opacity: 0, transform: 'scale(0.95)' }), + animate(timing + easing, style({ opacity: 1, transform: 'scale(1)' })) + ], + { optional: true } + ) + ]) + ]); diff --git a/projects/go-lib/src/lib/animations/search.animation.ts b/projects/go-lib/src/lib/animations/search.animation.ts new file mode 100644 index 000000000..b87d56275 --- /dev/null +++ b/projects/go-lib/src/lib/animations/search.animation.ts @@ -0,0 +1,59 @@ +import { + animate, + style, + transition, + trigger +} from '@angular/animations'; + +import { easing, timing } from './_configs'; + +export const searchLoaderAnim = trigger('searchLoaderAnim', [ + transition(':enter', [ + style({ + height: 0, + opacity: 0, + padding: 0 + }), + animate(timing + ' ' + easing, style({ + height: '*', + opacity: 1, + padding: '2rem' + })) + ]), + transition(':leave', [ + style({ + padding: '2rem' + }), + animate(timing + ' ' + easing, style({ + height: 0, + opacity: 0, + padding: 0 + })) + ]) +]); + +export const searchResultsAnim = trigger('searchResultsAnim', [ + transition(':enter', [ + style({ + height: 0, + margin: 0, + opacity: 0 + }), + animate(timing + ' .25s ' + easing, style({ + height: '*', + margin: '1rem 0 0.5rem 0', + opacity: 1 + })) + ]), + transition(':leave', [ + style({ + overflowY: 'hidden', + margin: '1rem 0 0.5rem 0' + }), + animate(timing + ' ' + easing, style({ + height: 0, + margin: 0, + opacity: 0 + })) + ]) +]); diff --git a/projects/go-lib/src/lib/animations/toasts.ts b/projects/go-lib/src/lib/animations/toasts.ts index 8b6631a8a..ba4d0cf6b 100644 --- a/projects/go-lib/src/lib/animations/toasts.ts +++ b/projects/go-lib/src/lib/animations/toasts.ts @@ -5,7 +5,7 @@ import { trigger } from '@angular/animations'; -const timing = '.5s cubic-bezier(.25, .8, .25, 1)'; +import { easing, timing } from './_configs'; export const toastAnimation = trigger('toastAnimation', [ transition(':enter', [ @@ -13,16 +13,16 @@ export const toastAnimation = trigger('toastAnimation', [ height: 0, opacity: 0 }), - animate(timing, style({ + animate(timing + easing, style({ height: '*', opacity: 1 })) ]), transition(':leave', [ - animate(timing, style({ + animate(timing + easing, style({ paddingTop: 0, opacity: 0, height: 0 })) ]) -]); \ No newline at end of file +]); diff --git a/projects/go-lib/src/lib/components/go-accordion/go-accordion-panel.component.scss b/projects/go-lib/src/lib/components/go-accordion/go-accordion-panel.component.scss index f81ca96d7..546d8e4f6 100644 --- a/projects/go-lib/src/lib/components/go-accordion/go-accordion-panel.component.scss +++ b/projects/go-lib/src/lib/components/go-accordion/go-accordion-panel.component.scss @@ -121,6 +121,33 @@ } } +.go-action-sheet__go-accordion { + .go-accordion { + border: none; + } + + .go-accordion-panel__title-bar { + font-size: 1rem; + padding: 1rem 0; + } + + .go-accordion-panel__control-icon { + font-size: 1rem; + } + + go-accordion-panel:not(:first-of-type) .go-accordion-panel__title-bar, + go-accordion-panel:last-of-type .go-accordion-panel__title-bar { + border-top: none; + } + + .go-accordion-panel { + &:first-of-type::before, + .go-accordion-panel__title-bar { + border-radius: 0; + } + } +} + go-accordion-panel { &:last-of-type { .go-accordion-panel::before { @@ -201,7 +228,11 @@ go-accordion-panel { // ----- Utility Classes .go-accordion--slim { - .go-accordion-panel__title-bar { + .go-accordion-panel__title-icon { font-size: 1rem; } + + &:hover { + background: $theme-light-bg-hover; + } } diff --git a/projects/go-lib/src/lib/components/go-accordion/go-accordion.component.html b/projects/go-lib/src/lib/components/go-accordion/go-accordion.component.html index c0ecaf65f..58e6af4a4 100644 --- a/projects/go-lib/src/lib/components/go-accordion/go-accordion.component.html +++ b/projects/go-lib/src/lib/components/go-accordion/go-accordion.component.html @@ -1,3 +1,3 @@ -