Skip to content

Commit

Permalink
Fixing signatures in Hds::Flyout & Hds::Modal subcomponents (#2511)
Browse files Browse the repository at this point in the history
Co-authored-by: Cristiano Rastelli <cristiano.rastelli@hashicorp.com>
Co-authored-by: Alex <alex-ju@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 24, 2024
1 parent 13b11c6 commit bb81285
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .changeset/dull-lamps-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@hashicorp/design-system-components": patch
---

`Hds::Flyout`
- Fixed error in `Description` and `Body` subcomponents, caused by not passing the `args` argument from the constructor to `super`

`Hds::Modal`
- Fixed error in `Body` subcomponent, caused by not passing the `args` argument from the constructor to `super`
7 changes: 5 additions & 2 deletions packages/components/src/components/hds/flyout/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import Component from '@glimmer/component';
import { deprecate } from '@ember/debug';

export interface HdsFlyoutBodySignature {
// when component has no args, but constructor still needs to be defined, use `never`
// see: https://github.com/hashicorp/design-system/pull/2511/files/f2146e5243d0431892a62d2fbf2889f1cbd3e525#r1815255004
Args: never;
Blocks: {
default: [];
};
Element: HTMLDivElement;
}

export default class HdsFlyoutBody extends Component<HdsFlyoutBodySignature> {
constructor(owner: unknown) {
super(owner, {});
constructor(owner: unknown, args: HdsFlyoutBodySignature['Args']) {
super(owner, args);

deprecate(
'The `Hds::Flyout::Body` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Body` as one-to-one replacement.',
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/components/hds/flyout/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import { deprecate } from '@ember/debug';
import type { HdsTextBodySignature } from '../text/body';

export interface HdsFlyoutDescriptionSignature {
Args: never;
Blocks: {
default: [];
};
Element: HdsTextBodySignature['Element'];
}

export default class HdsFlyoutDescription extends Component<HdsFlyoutDescriptionSignature> {
constructor(owner: unknown) {
super(owner, {});
constructor(owner: unknown, args: HdsFlyoutDescriptionSignature['Args']) {
super(owner, args);

deprecate(
'The `Hds::Flyout::Description` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Description` as one-to-one replacement.',
Expand Down
7 changes: 5 additions & 2 deletions packages/components/src/components/hds/modal/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import Component from '@glimmer/component';
import { deprecate } from '@ember/debug';

export interface HdsModalBodySignature {
// when component has no args, but constructor still needs to be defined, use `never`
// see: https://github.com/hashicorp/design-system/pull/2511/files/f2146e5243d0431892a62d2fbf2889f1cbd3e525#r1815255004
Args: never;
Blocks: {
default: [];
};
Element: HTMLDivElement;
}

export default class HdsModalBody extends Component<HdsModalBodySignature> {
constructor(owner: unknown) {
super(owner, {});
constructor(owner: unknown, args: HdsModalBodySignature['Args']) {
super(owner, args);

deprecate(
'The `Hds::Modal::Body` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Body` as one-to-one replacement.',
Expand Down

0 comments on commit bb81285

Please sign in to comment.