-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1990 from hashicorp/hds-2427/convert-alert-ts
Typescript - `Hds::Alert`
- Loading branch information
Showing
14 changed files
with
127 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hashicorp/design-system-components": minor | ||
--- | ||
|
||
`Alert` - Converted components to TypeScript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{{! @glint-nocheck: not typesafe yet }} | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: MPL-2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Component from '@glimmer/component'; | ||
import type { HdsAlertDescriptionSignature } from './types.ts'; | ||
|
||
export default class HdsAlertDescriptionComponent extends Component<HdsAlertDescriptionSignature> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{{! @glint-nocheck: not typesafe yet }} | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: MPL-2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{{! @glint-nocheck: not typesafe yet }} | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: MPL-2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Component from '@glimmer/component'; | ||
import type { HdsAlertTitleSignature } from './types.ts'; | ||
|
||
export default class HdsAlertTitleComponent extends Component<HdsAlertTitleSignature> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import type { ComponentLike, WithBoundArgs } from '@glint/template'; | ||
import type HdsButtonIndexComponent from '../button'; | ||
import type HdsLinkStandaloneComponent from '../link/standalone'; | ||
import type { HdsYieldSignature } from '../yield/types'; | ||
|
||
export enum HdsAlertTypeValues { | ||
Page = 'page', | ||
Inlne = 'inline', | ||
Compact = 'compact', | ||
} | ||
export type HdsAlertTypes = `${HdsAlertTypeValues}`; | ||
|
||
export enum HdsAlertColorValues { | ||
Neutral = 'neutral', | ||
Highlight = 'highlight', | ||
Success = 'success', | ||
Warning = 'warning', | ||
Critical = 'critical', | ||
} | ||
export type HdsAlertColors = `${HdsAlertColorValues}`; | ||
|
||
export interface HdsAlertSignature { | ||
Args: { | ||
type: HdsAlertTypes; | ||
color?: HdsAlertColors; | ||
icon?: string | false; | ||
onDismiss?: () => void; | ||
}; | ||
Blocks: { | ||
default: [ | ||
{ | ||
Title?: ComponentLike<HdsAlertTitleSignature>; | ||
Description?: ComponentLike<HdsAlertDescriptionSignature>; | ||
Generic?: ComponentLike<HdsYieldSignature>; | ||
LinkStandalone?: WithBoundArgs< | ||
typeof HdsLinkStandaloneComponent, | ||
'size' | ||
>; | ||
Button?: WithBoundArgs<typeof HdsButtonIndexComponent, 'size'>; | ||
} | ||
]; | ||
}; | ||
Element: HTMLDivElement; | ||
} | ||
|
||
export interface HdsAlertDescriptionSignature { | ||
Blocks: { | ||
default: []; | ||
}; | ||
Element: HTMLDivElement; | ||
} | ||
|
||
export interface HdsAlertTitleSignature { | ||
Blocks: { | ||
default: []; | ||
}; | ||
Element: HTMLDivElement; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface HdsYieldSignature { | ||
Blocks: { | ||
default: []; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters