Skip to content

Commit

Permalink
feat(design)!: shard modal component (#2699)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `DaffModalModule` has moved to its own package. Update imports to `@daffodil/design/modal`
  • Loading branch information
xelaint committed Jan 2, 2024
1 parent ab2836b commit 8b355a1
Show file tree
Hide file tree
Showing 39 changed files with 30 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffModalModule } from '@daffodil/design';
import { DaffModalModule } from '@daffodil/design/modal';

import { DemoAddToCartNotificationStateModule } from './add-to-cart-notification-state.module';
import { AddToCartNotificationComponentModule } from './components/add-to-cart-notification/add-to-cart-notification.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import {
import { Observable } from 'rxjs';

import { DaffAddToCart } from '@daffodil/cart/state';
import { DaffModalModule } from '@daffodil/design';

import { DaffModalModule } from '@daffodil/design/modal';

import { AddToCartNotificationEffects } from './add-to-cart-notification.effects';
import { OpenAddToCartNotification } from '../actions/add-to-cart-notification.actions';


describe('AddToCartNotificationEffects', () => {
let actions$: Observable<any>;
let effects: AddToCartNotificationEffects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { DaffCartActionTypes } from '@daffodil/cart/state';
import {
DaffModalService,
DaffModal,
} from '@daffodil/design';
} from '@daffodil/design/modal';

import {
OpenAddToCartNotification,
Expand Down
2 changes: 1 addition & 1 deletion apps/design-land/src/app/modal/modal.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TestBed,
} from '@angular/core/testing';

import { DaffModalModule } from '@daffodil/design';
import { DaffModalModule } from '@daffodil/design/modal';

import { DesignLandModalComponent } from './modal.component';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Component,
} from '@angular/core';

import { DaffModalService } from '@daffodil/design';
import { DaffModalService } from '@daffodil/design/modal';

import { BasicModalContentComponent } from './modal-content.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';

import { DaffModalModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffModalModule } from '@daffodil/design/modal';

import { BasicModalComponent } from './basic-modal.component';
import { BasicModalContentComponent } from './modal-content.component';
Expand Down
9 changes: 9 additions & 0 deletions libs/design/modal/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/design/modal",
"deleteDestPath": false,
"lib": {
"entryFile": "src/index.ts",
"styleIncludePaths": ["../src/scss"]
}
}
1 change: 1 addition & 0 deletions libs/design/modal/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './public_api';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '../../../../scss/typography' as t;
@use '../../../../scss/layout';
@use '../../../scss/typography' as t;
@use '../../../scss/layout';

:host {
display: block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '../../../scss/core';
@use '../../scss/core';

@mixin daff-modal-theme($theme) {
$base: core.daff-map-deep-get($theme, 'core.base');
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '../../../../scss/layout';
@use '../../../scss/layout';

:host {
display: block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
Component,
Input,
Output,
EventEmitter,
DebugElement,
} from '@angular/core';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
AfterViewInit,
} from '@angular/core';

import { daffFocusableElementsSelector } from '../../../core/focus/public_api';
import { daffFocusableElementsSelector } from '@daffodil/design';

import { daffFadeAnimations } from '../animations/modal-animation';
import { getAnimationState } from '../animations/modal-animation-state';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OverlayRef } from '@angular/cdk/overlay';
import { ComponentRef } from '@angular/core';

import { DaffModalComponent } from './modal/modal.component';
import { DaffModalComponent } from './modal.component';

export interface DaffModal {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './modal/modal.component';
export { DaffModalModule } from './modal.module';
export { DaffModalService } from './service/modal.service';
export { DaffModal } from './modal';
export { DaffModal } from './modal/modal';
export { DaffModalHeaderComponent } from './modal-header/modal-header.component';
export { DaffModalTitleDirective } from './modal-title/modal-title.directive';
export { DaffModalContentComponent } from './modal-content/modal-content.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ComponentRef,
} from '@angular/core';

import { DaffModal } from '../modal';
import { DaffModal } from '../modal/modal';
import { DaffModalConfiguration } from '../modal/modal-config';
import { DaffModalComponent } from '../modal/modal.component';
import { DaffModalModule } from '../modal.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { OverlayContainer } from '@angular/cdk/overlay';
import {
Component,
NgModule,
DebugElement,
ViewContainerRef,
} from '@angular/core';
import {
Expand All @@ -14,8 +13,8 @@ import {
} from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { DaffModalService } from './modal.service';
import { DaffModalModule } from '../modal.module';
import { DaffModalModule } from '../../modal.module';
import { DaffModalService } from '../modal.service';

@Component({
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Component,
NgModule,
ViewContainerRef,
DebugElement,
} from '@angular/core';
import {
waitForAsync,
Expand All @@ -17,7 +16,6 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { DaffModalModule } from '../../modal.module';
import { DaffModalService } from '../modal.service';


@Component({
selector: 'daff-dynamic-component',
template: `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
Component,
Input,
Output,
EventEmitter,
DebugElement,
} from '@angular/core';
import {
Expand All @@ -13,7 +10,7 @@ import {
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { DaffModalComponent } from '../modal.component';
import { DaffModalComponent } from '../modal/modal.component';

@Component({ template: `
<div class="daff-modal-wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import {
} from '@angular/cdk/portal';
import {
Component,
Input,
Output,
EventEmitter,
DebugElement,
NgModule,
} from '@angular/core';
Expand All @@ -18,7 +15,7 @@ import {
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { DaffModalComponent } from '../modal.component';
import { DaffModalComponent } from '../modal/modal.component';

@Component({ template: `<daff-modal></daff-modal>` })
class WrapperComponent {}
Expand Down
2 changes: 1 addition & 1 deletion libs/design/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@use '../list/src/list-theme' as list;
@use '../media-gallery/src/media-gallery-theme' as media-gallery;
@use '../menu/src/menu-theme' as menu;
@use '../src/molecules/modal/modal-theme' as modal;
@use '../modal/src/modal-theme' as modal;
@use '../src/molecules/navbar/navbar-theme' as navbar;
@use '../notification/src/notification-theme' as notification;
@use '../src/molecules/paginator/paginator-theme' as paginator;
Expand Down
1 change: 0 additions & 1 deletion libs/design/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export * from './molecules/backdrop/public_api';
export * from './molecules/button-set/public_api';
export * from './molecules/image-gallery/public_api';
export * from './molecules/image-list/public_api';
export * from './molecules/modal/public_api';
export * from './molecules/navbar/public_api';
export * from './molecules/paginator/public_api';
export * from './molecules/qty-dropdown/public_api';
Expand Down

0 comments on commit 8b355a1

Please sign in to comment.