Skip to content

Commit

Permalink
Move type in a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ju committed Jun 19, 2024
1 parent 211a212 commit c38a3b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/components/src/components/hds/accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import TemplateOnlyComponent from '@ember/component/template-only';
import type { ComponentLike } from '@glint/template';
import type { HdsAccordionItemSignature } from './item/index.ts';
import type { HdsAccordionForceStates } from './types.ts';

interface HdsAccordionSignature {
Args: {
forceState?: 'open' | 'close';
forceState?: HdsAccordionForceStates;
};
Blocks: {
default: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

import Component from '@glimmer/component';
import { guidFor } from '@ember/object/internals';
import type { HdsAccordionForceStates } from '../types.ts';

export interface HdsAccordionItemSignature {
Args: {
ariaLabel?: string;
containsInteractive?: boolean;
isOpen?: boolean;
forceState?: 'open' | 'close';
forceState?: HdsAccordionForceStates;
};
Blocks: {
toggle?: [];
Expand Down
10 changes: 10 additions & 0 deletions packages/components/src/components/hds/accordion/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export enum HdsAccordionForceStateValues {
Open = 'open',
Close = 'close',
}
export type HdsAccordionForceStates = `${HdsAccordionForceStateValues}`;

0 comments on commit c38a3b6

Please sign in to comment.