Skip to content

Commit

Permalink
feat(design)!: shard loading icon component (#2668)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `DaffLoadingIconModule` has moved to its own package. Update imports to `@daffodil/design/loading-icon`
  • Loading branch information
xelaint authored Dec 18, 2023
1 parent 0aa35b0 commit 7434000
Show file tree
Hide file tree
Showing 39 changed files with 55 additions and 58 deletions.
2 changes: 1 addition & 1 deletion apps/demo/src/app/cart/cart.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { DemoCartRoutingModule } from './cart-routing.module';
import { CartModule } from './components/cart/cart.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
daffComposeReducers,
daffIdentityReducer,
} from '@daffodil/core/state';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProduct } from '@daffodil/product';
import {
DaffProductLoadSuccess,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import {
DaffButtonSetModule,
DaffLoadingIconModule,
} from '@daffodil/design';
import { DaffButtonSetModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { AddToCartNotificationComponent } from './add-to-cart-notification.component';
import { ProceedToCheckoutModule } from '../../../proceed-to-checkout/proceed-to-checkout.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

import { DaffCart } from '@daffodil/cart';
import { DaffCartFactory } from '@daffodil/cart/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { CartSummaryWrapperComponent } from './cart-summary-wrapper.component';
import { CartSummaryComponent } from '../cart-summary/cart-summary.component';
Expand Down
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 { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { CartSummaryWrapperComponent } from './cart-summary-wrapper.component';
import { HelpBoxModule } from '../../../misc/help-box/help-box.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
MockDaffCartFacade,
} from '@daffodil/cart/state/testing';
import { DaffCartFactory } from '@daffodil/cart/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { DemoCartViewComponent } from './cart-view.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
MockDaffCategoryFacade,
} from '@daffodil/category/state/testing';
import { DaffCategoryFactory } from '@daffodil/category/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProduct } from '@daffodil/product';
import {
DaffProductFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffCategoryStateModule } from '@daffodil/category/state';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProductStateModule } from '@daffodil/product/state';

import { CategoryViewComponent } from './category-view.component';
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/checkout/checkout.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { NgModule } from '@angular/core';

import { DaffCartStateModule } from '@daffodil/cart/state';
import { StateCheckoutModule } from '@daffodil/checkout';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { CheckoutRoutingModule } from './checkout-routing.module';
import { DemoCheckoutStateModule } from './checkout-state.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ import {
import { DaffPaymentFactory } from '@daffodil/checkout/testing';
import { DaffAddress } from '@daffodil/core';
import { DaffAddressFactory } from '@daffodil/core/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import {
DaffAccordionModule,
DaffAccordionItemComponent,
} from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { CheckoutViewComponent } from './checkout-view.component';
import { ShowPaymentView } from '../../actions/payment.actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@ import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { provideMockStore } from '@ngrx/store/testing';
import {
hot,
cold,
} from 'jasmine-marbles';
import { of } from 'rxjs';

import {
DaffSidebarModule,
DaffSidebarComponent,
DaffLoadingIconModule,
DaffLinkSetModule,
} from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffNavigationTree } from '@daffodil/navigation';
import {
DaffNavigationFacade,
DaffNavigationLoad,
} from '@daffodil/navigation/state';
import { DaffNavigationLoad } from '@daffodil/navigation/state';
import {
DaffNavigationStateTestingModule,
MockDaffNavigationFacade,
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/core/sidebar/sidebar.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import {
DaffSidebarModule,
DaffLoadingIconModule,
DaffLinkSetModule,
} from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffNavigationStateModule } from '@daffodil/navigation/state';

import { SidebarListComponent } from './components/sidebar-list/sidebar-list.component';
Expand Down
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 { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { ProductGridComponent } from './product-grid.component';
import { ProductCardModule } from '../product-card/product-card.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';


import {
DaffQtyDropdownModule,
DaffLoadingIconModule,
} from '@daffodil/design';
import { DaffQtyDropdownModule } from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { ProductComponent } from './product.component';
import { ImageGalleryModule } from '../../../core/image-gallery/image-gallery.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProduct } from '@daffodil/product';
import {
DaffProductStateTestingModule,
Expand Down
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 { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProductStateModule } from '@daffodil/product/state';

import { BestSellersComponent } from './best-sellers.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import {
DaffProductStateTestingModule,
MockDaffProductGridFacade,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProductStateModule } from '@daffodil/product/state';

import { ProductGridViewComponent } from './product-grid-view.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
DaffCartStateTestingModule,
MockDaffCartFacade,
} from '@daffodil/cart/state/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProduct } from '@daffodil/product';
import { DaffProductLoad } from '@daffodil/product/state';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffCartStateModule } from '@daffodil/cart/state';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
import { DaffProductStateModule } from '@daffodil/product/state';

import { ProductViewComponent } from './product-view.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
DaffCartFactory,
DaffCartItemFactory,
} from '@daffodil/cart/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import {
DaffAccordionModule,
DaffAccordionItemComponent,
Expand All @@ -29,6 +28,7 @@ import {
DaffContainerComponent,
DaffContainerModule,
} from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { ThankYouViewComponent } from './thank-you-view.component';

Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/thank-you/thank-you.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { StateCheckoutModule } from '@daffodil/checkout';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { ThankYouComponentModule } from './components/thank-you/thank-you.module';
import { ThankYouViewComponent } from './pages/thank-you-view.component';
Expand Down
6 changes: 2 additions & 4 deletions libs/design/button/src/button.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import {
DaffLoadingIconModule,
DaffPrefixSuffixModule,
} from '@daffodil/design';
import { DaffPrefixSuffixModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { DaffButtonComponent } from './button/button.component';

Expand Down
6 changes: 4 additions & 2 deletions libs/design/button/src/button/button.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import { By } from '@angular/platform-browser';
import {
DaffPalette,
DaffStatus,
DaffLoadingIconComponent,
DaffLoadingIconModule,
} from '@daffodil/design';
import {
DaffLoadingIconModule,
DaffLoadingIconComponent,
} from '@daffodil/design/loading-icon';

import {
DaffButtonComponent,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';

import {
DaffLoadingIconModule,
DaffRadioModule,
} from '@daffodil/design';
import { DaffRadioModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { LoadingIconColorComponent } from './loading-icon-color.component';

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

import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';

import { LoadingIconDiameterComponent } from './loading-icon-diameter.component';

Expand Down
9 changes: 9 additions & 0 deletions libs/design/loading-icon/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/loading-icon",
"deleteDestPath": false,
"lib": {
"entryFile": "src/index.ts",
"styleIncludePaths": ["../src/scss"]
}
}
1 change: 1 addition & 0 deletions libs/design/loading-icon/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,6 +1,6 @@
@use 'sass:map';
@use '../../../scss/core';
@use '../../../scss/theming';
@use '../../scss/core';
@use '../../scss/theming';

@mixin daff-loading-icon-theme($theme) {
$primary: map.get($theme, primary);
Expand Down
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 { DaffLoadingIconComponent } from './loading-icon.component';
import { DaffLoadingIconComponent } from './loading-icon/loading-icon.component';

@NgModule({
imports: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<svg focusable="false" preserveAspectRatio="xMidYMid meet" viewBox="0 0 100 100">
<circle cx="50%" cy="50%" r="46"></circle>
<circle cx="50%" cy="50%" r="46"></circle>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ circle {
transform: rotate(0deg);
}

50.5% { /* stylelint-disable-line scss/selector-nest-combinators */
50.1% { /* stylelint-disable-line scss/selector-nest-combinators */
transform: rotate(0deg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import {
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { DaffPalette } from '@daffodil/design';

import { DaffLoadingIconComponent } from './loading-icon.component';
import { DaffPalette } from '../../core/colorable/public_api';

@Component({ template: '<daff-loading-icon [color]="color" [diameter]="diameter"></daff-loading-icon>' })
class WrapperComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import {
daffColorMixin,
DaffColorable,
} from '../../core/colorable/public_api';
} from '@daffodil/design';

/**
* An _elementRef and an instance of renderer2 are needed for the Colorable mixin
Expand Down
2 changes: 2 additions & 0 deletions libs/design/loading-icon/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { DaffLoadingIconModule } from './loading-icon.module';
export { DaffLoadingIconComponent } from './loading-icon/loading-icon.component';
2 changes: 1 addition & 1 deletion libs/design/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@use '../src/atoms/form/form-field/form-field/form-field-theme' as form-field;
@use '../src/atoms/form/input/input-theme' as input;
@use '../src/atoms/form/native-select/native-select-theme' as native-select;
@use '../src/atoms/loading-icon/loading-icon-theme' as loading-icon;
@use '../loading-icon/src/loading-icon-theme' as loading-icon;
@use '../src/atoms/progress-indicator/progress-indicator-theme' as progress-indicator;
@use '../accordion/src/accordion-theme' as accordion;
@use '../src/molecules/callout/callout-theme' as callout;
Expand Down
2 changes: 0 additions & 2 deletions libs/design/src/atoms/loading-icon/public_api.ts

This file was deleted.

1 change: 0 additions & 1 deletion libs/design/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export * from './atoms/form/input/public_api';
export * from './atoms/form/native-select/public_api';
export * from './atoms/form/checkbox/public_api';
export * from './atoms/form/quantity-field/public_api';
export * from './atoms/loading-icon/public_api';
export * from './atoms/progress-indicator/public_api';
export * from './atoms/form/radio/public_api';
export * from './atoms/form/form-label/public_api';
Expand Down

0 comments on commit 7434000

Please sign in to comment.