Skip to content

Commit 0af779d

Browse files
authored
feat(design): allow individual button type imports (#3328)
1 parent 8656d7e commit 0af779d

File tree

85 files changed

+2199
-1534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2199
-1534
lines changed

apps/daffio/src/app/core/nav/header/header.component.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import {
1919
} from 'rxjs';
2020

2121
import { DaffLogoModule } from '@daffodil/branding';
22-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
22+
import {
23+
DaffButtonComponent,
24+
DaffIconButtonComponent,
25+
} from '@daffodil/design/button';
2326
import { DaffRouterDataService } from '@daffodil/router';
2427
import { DaffThemeSwitchButtonModule } from '@daffodil/theme-switch';
2528

@@ -42,7 +45,8 @@ import { DaffioNavLink } from '../link/type';
4245
DaffLogoModule,
4346
DaffThemeSwitchButtonModule,
4447
NgFor,
45-
DAFF_BUTTON_COMPONENTS,
48+
DaffButtonComponent,
49+
DaffIconButtonComponent,
4650
FaIconComponent,
4751
AsyncPipe,
4852
],

apps/daffio/src/app/docs/design/pages/overview/overview.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from '@angular/core';
55
import { RouterLink } from '@angular/router';
66

7-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
7+
import { DaffButtonComponent } from '@daffodil/design/button';
88
import { DAFF_CONTAINER_COMPONENTS } from '@daffodil/design/container';
99
import { DAFF_HERO_COMPONENTS } from '@daffodil/design/hero';
1010

@@ -16,7 +16,7 @@ import { DAFF_HERO_COMPONENTS } from '@daffodil/design/hero';
1616
standalone: true,
1717
imports: [
1818
DAFF_CONTAINER_COMPONENTS,
19-
DAFF_BUTTON_COMPONENTS,
19+
DaffButtonComponent,
2020
DAFF_HERO_COMPONENTS,
2121
RouterLink,
2222
],

apps/demo/src/app/checkout/components/payment/payment-form/payment-form.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
DaffInputModule,
1919
DaffNativeSelectModule,
2020
} from '@daffodil/design';
21-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
21+
import { DaffButtonComponent } from '@daffodil/design/button';
2222

2323
import { DemoGeographyAddressSummaryComponent } from '../../../../geography/components/address-summary/address-summary.component';
2424
import { DemoCheckoutAddressFormComponent } from '../../forms/address/components/address-form/address-form.component';
@@ -38,7 +38,7 @@ import { PaymentInfoFormFactory } from '../payment-info-form/factories/payment-i
3838
DaffInputModule,
3939
DaffNativeSelectModule,
4040
DemoCheckoutPaymentInfoFormComponent,
41-
DAFF_BUTTON_COMPONENTS,
41+
DaffButtonComponent,
4242
DaffCheckboxModule,
4343
DemoCheckoutAddressFormComponent,
4444
DemoGeographyAddressSummaryComponent,

apps/demo/src/app/checkout/components/shipping-address/form/shipping-address-form.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@angular/core';
88
import { ReactiveFormsModule } from '@angular/forms';
99

10-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
10+
import { DaffButtonComponent } from '@daffodil/design/button';
1111
import { DaffPersonalAddress } from '@daffodil/geography';
1212

1313
import { DemoCheckoutAddressFormComponent } from '../../forms/address/components/address-form/address-form.component';
@@ -25,7 +25,7 @@ import {
2525
imports: [
2626
DemoCheckoutAddressFormComponent,
2727
ReactiveFormsModule,
28-
DAFF_BUTTON_COMPONENTS,
28+
DaffButtonComponent,
2929
],
3030
})
3131
export class DemoCheckoutShippingAddressFormComponent implements OnInit {

apps/demo/src/app/checkout/components/shipping/shipping-form/shipping-form.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { ReactiveFormsModule } from '@angular/forms';
99

1010
import { DaffCartShippingRate } from '@daffodil/cart';
11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffButtonComponent } from '@daffodil/design/button';
1212

1313
import { DemoCheckoutAddressFormComponent } from '../../forms/address/components/address-form/address-form.component';
1414
import { DemoCheckoutShippingOptionsComponent } from '../shipping-options/components/shipping-options/shipping-options.component';
@@ -27,7 +27,7 @@ import {
2727
DemoCheckoutAddressFormComponent,
2828
DemoCheckoutShippingOptionsComponent,
2929
ReactiveFormsModule,
30-
DAFF_BUTTON_COMPONENTS,
30+
DaffButtonComponent,
3131
],
3232
})
3333
export class DemoCheckoutShippingFormComponent implements OnInit {

libs/design/button/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ Native `<button>` or `<a>` elements are always used in order to provide an easy,
3434
## Usage
3535

3636
### Within a standalone component
37-
To use button in a standalone component, import it directly into your custom component:
37+
To use button in a standalone component, import it directly into your custom component. Buttons can be imported individually or all together by using `DAFF_BUTTON_COMPONENTS`:
3838

3939
```ts
4040
@Component({
4141
selector: 'custom-component',
4242
templateUrl: './custom-component.component.html',
4343
standalone: true,
4444
imports: [
45-
DAFF_BUTTON_COMPONENTS,
45+
DaffButtonComponent,
4646
],
4747
})
4848
export class CustomComponent {}

libs/design/button/examples/src/basic-button/basic-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
faChevronRight,
99
} from '@fortawesome/free-solid-svg-icons';
1010

11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffButtonComponent } from '@daffodil/design/button';
1212

1313
@Component({
1414
// eslint-disable-next-line @angular-eslint/component-selector
@@ -24,7 +24,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
standalone: true,
2626
imports: [
27-
DAFF_BUTTON_COMPONENTS,
27+
DaffButtonComponent,
2828
FaIconComponent,
2929
],
3030
})

libs/design/button/examples/src/flat-button/flat-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
faChevronRight,
99
} from '@fortawesome/free-solid-svg-icons';
1010

11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffFlatButtonComponent } from '@daffodil/design/button';
1212

1313
@Component({
1414
// eslint-disable-next-line @angular-eslint/component-selector
@@ -24,7 +24,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
standalone: true,
2626
imports: [
27-
DAFF_BUTTON_COMPONENTS,
27+
DaffFlatButtonComponent,
2828
FaIconComponent,
2929
],
3030
})

libs/design/button/examples/src/icon-button/icon-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
66
import { faPlus } from '@fortawesome/free-solid-svg-icons';
77

8-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
8+
import { DaffIconButtonComponent } from '@daffodil/design/button';
99

1010
@Component({
1111
// eslint-disable-next-line @angular-eslint/component-selector
@@ -21,7 +21,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2121
changeDetection: ChangeDetectionStrategy.OnPush,
2222
standalone: true,
2323
imports: [
24-
DAFF_BUTTON_COMPONENTS,
24+
DaffIconButtonComponent,
2525
FaIconComponent,
2626
],
2727
})

libs/design/button/examples/src/raised-button/raised-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
faChevronRight,
99
} from '@fortawesome/free-solid-svg-icons';
1010

11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffRaisedButtonComponent } from '@daffodil/design/button';
1212

1313
@Component({
1414
// eslint-disable-next-line @angular-eslint/component-selector
@@ -24,7 +24,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
standalone: true,
2626
imports: [
27-
DAFF_BUTTON_COMPONENTS,
27+
DaffRaisedButtonComponent,
2828
FaIconComponent,
2929
],
3030
})

libs/design/button/examples/src/stroked-button/stroked-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
faChevronRight,
99
} from '@fortawesome/free-solid-svg-icons';
1010

11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffStrokedButtonComponent } from '@daffodil/design/button';
1212

1313
@Component({
1414
// eslint-disable-next-line @angular-eslint/component-selector
@@ -24,7 +24,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
standalone: true,
2626
imports: [
27-
DAFF_BUTTON_COMPONENTS,
27+
DaffStrokedButtonComponent,
2828
FaIconComponent,
2929
],
3030
})

libs/design/button/examples/src/underline-button/underline-button.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
faChevronRight,
99
} from '@fortawesome/free-solid-svg-icons';
1010

11-
import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
11+
import { DaffUnderlineButtonComponent } from '@daffodil/design/button';
1212

1313
@Component({
1414
// eslint-disable-next-line @angular-eslint/component-selector
@@ -24,7 +24,7 @@ import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
standalone: true,
2626
imports: [
27-
DAFF_BUTTON_COMPONENTS,
27+
DaffUnderlineButtonComponent,
2828
FaIconComponent,
2929
],
3030
})

libs/design/button/src/button-theme-variants/button.scss

-26
This file was deleted.

libs/design/button/src/button-theme-variants/flat.scss

-25
This file was deleted.

libs/design/button/src/button-theme-variants/icon.scss

-21
This file was deleted.

libs/design/button/src/button-theme-variants/raised.scss

-36
This file was deleted.

libs/design/button/src/button-theme-variants/stroked.scss

-28
This file was deleted.

libs/design/button/src/button-theme-variants/underline.scss

-9
This file was deleted.

0 commit comments

Comments
 (0)