Skip to content

Commit

Permalink
feat(design)!: shard image component (#2656)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `DaffImageModule` has moved to its own package. Update imports to `@daffodil/design/image`
  • Loading branch information
xelaint committed Dec 14, 2023
1 parent b2f1e3e commit c8e376b
Show file tree
Hide file tree
Showing 27 changed files with 42 additions and 55 deletions.
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 { RouterModule } from '@angular/router';

import {
DaffCalloutModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCalloutModule } from '@daffodil/design';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffImageModule } from '@daffodil/design/image';

import { DaffioHomeCalloutPlatformsComponent } from './home-callout-platforms.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { RouterModule } from '@angular/router';

import {
DaffCalloutModule,
DaffImageModule,
DaffCardModule,
} from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffImageModule } from '@daffodil/design/image';

import { DaffioHomeCalloutPwaComponent } from './home-callout-pwa.component';

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 { RouterModule } from '@angular/router';

import {
DaffHeroModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffHeroModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffImageModule } from '@daffodil/design/image';

import { DaffioHomeHeroComponent } from './home-hero.component';

Expand Down
6 changes: 2 additions & 4 deletions libs/design/card/examples/src/basic-card/basic-card.module.ts
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 {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffImageModule } from '@daffodil/design/image';

import { BasicCardComponent } from './basic-card.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffImageModule } from '@daffodil/design/image';

import { CardOrientationComponent } from './card-orientation.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';

import {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { CardThemingComponent } from './card-theming.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffImageModule } from '@daffodil/design/image';

import { LinkableCardComponent } from './linkable-card.component';

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 { ReactiveFormsModule } from '@angular/forms';

import {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffImageModule } from '@daffodil/design/image';

import { RaisedCardComponent } from './raised-card.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import {
DaffCardModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffCardModule } from '@daffodil/design';
import { DaffButtonModule } from '@daffodil/design/button';
import { DaffImageModule } from '@daffodil/design/image';

import { StrokedCardComponent } from './stroked-card.component';

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

import { DaffImageModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { BasicImageComponent } from './basic-image.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 { DaffImageModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { LoadImageComponent } from './load-image.component';

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

import { DaffImageModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { SkeletonImageComponent } from './skeleton-image.component';

Expand Down
9 changes: 9 additions & 0 deletions libs/design/image/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/image",
"deleteDestPath": false,
"lib": {
"entryFile": "src/index.ts",
"styleIncludePaths": ["../src/scss"]
}
}
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 { DaffImageComponent } from './image.component';
import { DaffImageComponent } from './image/image.component';

@NgModule({
declarations: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use 'state';
@use '../../../scss/state';

:host {
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { DomSanitizer } from '@angular/platform-browser';
import {
daffSkeletonableMixin,
DaffSkeletonable,
} from '../../core/skeletonable/public_api';
import { daffThumbnailCompatToken } from '../../molecules/media-gallery/public_api';
daffThumbnailCompatToken,
} from '@daffodil/design';

const validateProperty = (object: Record<string, any>, prop: string) => {
if (object[prop] === null || object[prop] === undefined || object[prop] === '') {
Expand Down
1 change: 1 addition & 0 deletions libs/design/image/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './public_api';
2 changes: 2 additions & 0 deletions libs/design/image/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { DaffImageModule } from './image.module';
export { DaffImageComponent } from './image/image.component';
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { NgModule } from '@angular/core';

import {
DaffMediaGalleryModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffMediaGalleryModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { BasicMediaGalleryComponent } from './basic-media-gallery.component';

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

import {
DaffMediaGalleryModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffMediaGalleryModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { MismatchedSizesMediaGalleryComponent } from './mismatched-sizes-media-gallery.component';

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

import {
DaffMediaGalleryModule,
DaffImageModule,
} from '@daffodil/design';
import { DaffMediaGalleryModule } from '@daffodil/design';
import { DaffImageModule } from '@daffodil/design/image';

import { SkeletonMediaGalleryComponent } from './skeleton-media-gallery.component';

Expand Down
2 changes: 0 additions & 2 deletions libs/design/src/atoms/image/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 @@ -6,7 +6,6 @@
export * from './atoms/form/core/public_api';
export * from './atoms/form/form-field/public_api';
export * from './atoms/form/error-message/public_api';
export * from './atoms/image/public_api';
export * from './atoms/form/input/public_api';
export * from './atoms/form/native-select/public_api';
export * from './atoms/form/checkbox/public_api';
Expand Down

0 comments on commit c8e376b

Please sign in to comment.