diff --git a/.changeset/cold-worlds-notice.md b/.changeset/cold-worlds-notice.md new file mode 100644 index 00000000000..26319a386e3 --- /dev/null +++ b/.changeset/cold-worlds-notice.md @@ -0,0 +1,11 @@ +--- +"@hashicorp/design-system-components": major +--- + + + +`Dropdown` - Removed the deprecated `@text` argument from the `HdsDropdownListItemInteractive` component. + +To migrate run the codemod `v4/dropdown-list-item-interactive` (see [readme file](https://github.com/hashicorp/design-system/tree/main/packages/codemods/transforms/v4/dropdown-list-item-interactive)) + + diff --git a/packages/components/src/components/hds/dropdown/list-item/interactive.hbs b/packages/components/src/components/hds/dropdown/list-item/interactive.hbs index 53fc34e1b9f..f62914dc95f 100644 --- a/packages/components/src/components/hds/dropdown/list-item/interactive.hbs +++ b/packages/components/src/components/hds/dropdown/list-item/interactive.hbs @@ -9,11 +9,7 @@ - {{#if (has-block)}} - {{yield (hash Badge=(component "hds/badge" size="small"))}} - {{else}} - {{this.text}} - {{/if}} + {{yield (hash Badge=(component "hds/badge" size="small"))}} {{else}} @@ -34,11 +30,7 @@ {{/if}} - {{#if (has-block)}} - {{yield (hash Badge=(component "hds/badge" size="small"))}} - {{else}} - {{this.text}} - {{/if}} + {{yield (hash Badge=(component "hds/badge" size="small"))}} {{#if @trailingIcon}} diff --git a/packages/components/src/components/hds/dropdown/list-item/interactive.ts b/packages/components/src/components/hds/dropdown/list-item/interactive.ts index 323942938b0..722866f4bc0 100644 --- a/packages/components/src/components/hds/dropdown/list-item/interactive.ts +++ b/packages/components/src/components/hds/dropdown/list-item/interactive.ts @@ -4,7 +4,7 @@ */ import Component from '@glimmer/component'; -import { assert, deprecate } from '@ember/debug'; +import { assert } from '@ember/debug'; import { HdsDropdownListItemInteractiveColorValues } from './types.ts'; @@ -13,7 +13,6 @@ import type { HdsInteractiveSignature } from '../../interactive'; import type { HdsDropdownListItemInteractiveColors } from './types.ts'; import type { ComponentLike } from '@glint/template'; import type { HdsBadgeSignature } from '../../badge/index.ts'; -import type Owner from '@ember/owner'; export const DEFAULT_COLOR = HdsDropdownListItemInteractiveColorValues.Action; export const COLORS: HdsDropdownListItemInteractiveColors[] = Object.values( @@ -25,10 +24,6 @@ export interface HdsDropdownListItemInteractiveSignature { color?: HdsDropdownListItemInteractiveColors; icon?: HdsIconSignature['Args']['name']; isLoading?: boolean; - /** - * @deprecated The `@text` argument for "Hds::Dropdown::ListItem::Interactive" has been deprecated. Please put text in the yielded block. See: https://helios.hashicorp.design/components/dropdown?tab=version%20history#4100 - */ - text?: string; trailingIcon?: HdsIconSignature['Args']['name']; }; Blocks: { @@ -42,41 +37,6 @@ export interface HdsDropdownListItemInteractiveSignature { } export default class HdsDropdownListItemInteractive extends Component { - constructor( - owner: Owner, - args: HdsDropdownListItemInteractiveSignature['Args'] - ) { - super(owner, args); - - if (args.text !== undefined) { - deprecate( - 'The `@text` argument for "Hds::Dropdown::ListItem::Interactive" has been deprecated. Please put text in the yielded block.', - false, - { - id: 'hds.dropdown.list-item.interactive', - until: '5.0.0', - url: 'https://helios.hashicorp.design/components/dropdown?tab=version%20history#4100', - for: '@hashicorp/design-system-components', - since: { - available: '4.10.0', - enabled: '5.0.0', - }, - } - ); - } - } - - get text(): string { - const { text } = this.args; - - assert( - '@text for "Hds::Dropdown::ListItem::Interactive" must have a valid value', - text !== undefined - ); - - return text; - } - get color(): HdsDropdownListItemInteractiveColors { const { color = DEFAULT_COLOR } = this.args; diff --git a/showcase/app/components/mock/app/header/app-header.gts b/showcase/app/components/mock/app/header/app-header.gts index 8f9d9f66ad4..226e101691b 100644 --- a/showcase/app/components/mock/app/header/app-header.gts +++ b/showcase/app/components/mock/app/header/app-header.gts @@ -96,7 +96,9 @@ export default class MockAppHeaderAppHeader extends Component - + + Account Settings + diff --git a/showcase/app/components/page-components/dropdown/sub-sections/list-items/not-interactive.gts b/showcase/app/components/page-components/dropdown/sub-sections/list-items/not-interactive.gts index 9c1734f77e5..a2414a80a74 100644 --- a/showcase/app/components/page-components/dropdown/sub-sections/list-items/not-interactive.gts +++ b/showcase/app/components/page-components/dropdown/sub-sections/list-items/not-interactive.gts @@ -43,10 +43,10 @@ const SubSectionListItemNotInteractive: TemplateOnlyComponent =