Skip to content

Commit

Permalink
feat(design)!: shard accordion component (#2664)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `DaffAccordionModule` has moved to its own package. Update imports to `@daffodil/design/accordion`
  • Loading branch information
xelaint committed Dec 18, 2023
1 parent c8e376b commit f5836a1
Show file tree
Hide file tree
Showing 44 changed files with 90 additions and 614 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { RouterModule } from '@angular/router';
import {
DaffListModule,
DaffLinkSetModule,
DaffAccordionModule,
} from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';

import { DaffioDocsTableOfContentsComponent } from './table-of-contents.component';


@NgModule({
declarations: [
DaffioDocsTableOfContentsComponent,
Expand Down
6 changes: 2 additions & 4 deletions apps/demo/src/app/checkout/checkout.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { NgModule } from '@angular/core';

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

import { CheckoutRoutingModule } from './checkout-routing.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ 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,
DaffLoadingIconModule,
} from '@daffodil/design';
} from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';

import { CheckoutViewComponent } from './checkout-view.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

import {
DaffAccordionModule,
DaffQtyDropdownModule,
DaffQtyDropdownComponent,
} from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';
import { DaffProduct } from '@daffodil/product';
import { DaffProductFactory } from '@daffodil/product/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { NgModule } from '@angular/core';

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

import { ProductComponent } from './product.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import {
DaffCartFactory,
DaffCartItemFactory,
} from '@daffodil/cart/testing';
import { DaffLoadingIconModule } from '@daffodil/design';
import {
DaffAccordionModule,
DaffAccordionItemComponent,
DaffLoadingIconModule,
} from '@daffodil/design';
} from '@daffodil/design/accordion';
import {
DaffContainerComponent,
DaffContainerModule,
Expand Down
6 changes: 2 additions & 4 deletions apps/demo/src/app/thank-you/thank-you.module.ts
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 { StateCheckoutModule } from '@daffodil/checkout';
import {
DaffAccordionModule,
DaffLoadingIconModule,
} from '@daffodil/design';
import { DaffLoadingIconModule } from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';
import { DaffContainerModule } from '@daffodil/design/container';

import { ThankYouComponentModule } from './components/thank-you/thank-you.module';
Expand Down
5 changes: 0 additions & 5 deletions apps/design-land/src/app/accordion/accordion.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ <h1 daffArticleTitle>Accordion</h1>

<h3>Types</h3>
<p><code>daff-accordion-item</code> - An accordion that typically holds content.</p>
<p><code>daff-nav-accordion-item</code> — An accordion that is used for navigation whose content is nested daff-nav-accordion-items.</p>

<h3>Content Accordion Item</h3>
<design-land-example-viewer-container example="basic-accordion"></design-land-example-viewer-container>

<h3>(DEPRECATED) Navigation Accordion Item</h3>
<p>Use the <code>DaffTreeComponent</code> instead.</p>
<design-land-example-viewer-container example="nav-accordion"></design-land-example-viewer-container>
File renamed without changes.
17 changes: 17 additions & 0 deletions libs/design/accordion/examples/src/accordion-examples.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffAccordionModule } from '@daffodil/design/accordion';

import { ACCORDION_EXAMPLES } from './examples';

@NgModule({
declarations: [
...ACCORDION_EXAMPLES,
],
imports: [
CommonModule,
DaffAccordionModule,
],
})
export class AccordionExamplesModule { }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';

import { DaffAccordionModule } from '@daffodil/design';
import { DaffAccordionModule } from '@daffodil/design/accordion';

import { BasicAccordionComponent } from './basic-accordion.component';

Expand Down
5 changes: 5 additions & 0 deletions libs/design/accordion/examples/src/examples.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BasicAccordionComponent } from './basic-accordion/basic-accordion.component';

export const ACCORDION_EXAMPLES = [
BasicAccordionComponent,
];

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 3 additions & 15 deletions libs/design/accordion/examples/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
import { BasicAccordionComponent } from './basic-accordion/basic-accordion.component';
import { NavAccordionComponent } from './nav-accordion/nav-accordion.component';

export { BasicAccordionModule } from './basic-accordion/basic-accordion.module';
export { NavAccordionModule } from './nav-accordion/nav-accordion.module';

export const ACCORDION_EXAMPLES = [
BasicAccordionComponent,
NavAccordionComponent,
];

export {
BasicAccordionComponent,
NavAccordionComponent,
};
export { BasicAccordionComponent } from './basic-accordion/basic-accordion.component';
export { AccordionExamplesModule } from './accordion-examples.module';
export { ACCORDION_EXAMPLES } from './examples';
9 changes: 9 additions & 0 deletions libs/design/accordion/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/accordion",
"deleteDestPath": false,
"lib": {
"entryFile": "src/index.ts",
"styleIncludePaths": ["../src/scss"]
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@use 'sass:map';
@use '../../../../scss/core';
@use '../../../../scss/theming';
@use '../../scss/core';
@use '../../scss/theming';

@mixin daff-accordion-item-theme($theme) {
@mixin daff-accordion-theme($theme) {
$gray: core.daff-map-deep-get($theme, 'core.gray');
$base: core.daff-map-deep-get($theme, 'core.base');

Expand Down
32 changes: 32 additions & 0 deletions libs/design/accordion/src/accordion.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

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

import { DaffAccordionComponent } from './accordion/accordion/accordion.component';
import { DaffAccordionItemComponent } from './accordion/accordion-item/accordion-item.component';
import { DaffAccordionItemContentDirective } from './accordion/accordion-item-content/accordion-item-content.directive';
import { DaffAccordionItemTitleDirective } from './accordion/accordion-item-title/accordion-item-title.directive';

@NgModule({
imports: [
CommonModule,

FontAwesomeModule,
DaffPrefixSuffixModule,
],
declarations: [
DaffAccordionComponent,
DaffAccordionItemComponent,
DaffAccordionItemTitleDirective,
DaffAccordionItemContentDirective,
],
exports: [
DaffAccordionComponent,
DaffAccordionItemComponent,
DaffAccordionItemTitleDirective,
DaffAccordionItemContentDirective,
],
})
export class DaffAccordionModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Renderer2,
} from '@angular/core';

import { daffArticleEncapsulatedMixin } from '../../../core/article-encapsulated/public_api';
import { daffArticleEncapsulatedMixin } from '@daffodil/design';

/**
* An _elementRef and an instance of renderer2 are needed for the link set mixins
Expand Down
1 change: 1 addition & 0 deletions libs/design/accordion/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './public_api';
5 changes: 5 additions & 0 deletions libs/design/accordion/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { DaffAccordionModule } from './accordion.module';
export * from './accordion/accordion/accordion.component';
export * from './accordion/accordion-item/accordion-item.component';
export * from './accordion/accordion-item-title/accordion-item-title.directive';
export * from './accordion/accordion-item-content/accordion-item-content.directive';
4 changes: 2 additions & 2 deletions libs/design/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@use '../src/atoms/form/native-select/native-select-theme' as native-select;
@use '../src/atoms/loading-icon/loading-icon-theme' as loading-icon;
@use '../src/atoms/progress-indicator/progress-indicator-theme' as progress-indicator;
@use '../src/molecules/accordion/accordion-item/accordion-item-theme' as accordion-item;
@use '../accordion/src/accordion-theme' as accordion;
@use '../src/molecules/callout/callout-theme' as callout;
@use '../src/molecules/card/card/card-theme' as card;
@use '../src/molecules/hero/hero-theme' as hero;
Expand Down Expand Up @@ -68,7 +68,7 @@
@include progress-indicator.daff-progress-indicator-theme($theme);

// Molecules
@include accordion-item.daff-accordion-item-theme($theme);
@include accordion.daff-accordion-theme($theme);
@include article.daff-article-theme($theme);
@include callout.daff-callout-theme($theme);
@include card.daff-card-theme($theme);
Expand Down
34 changes: 0 additions & 34 deletions libs/design/src/molecules/accordion/accordion.module.ts

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f5836a1

Please sign in to comment.