Skip to content

Commit 5780b3d

Browse files
committed
Fix types of icon component passed to au-icon
1 parent 56069b1 commit 5780b3d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

addon/components/au-accordion.gts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { tracked } from '@glimmer/tracking';
55
import { modifier } from 'ember-modifier';
66
import AuButton from './au-button';
77
import AuContent from './au-content';
8-
import AuIcon from './au-icon';
8+
import AuIcon, { type AuIconSignature } from './au-icon';
99
import AuLoader from './au-loader';
1010
import AuToolbar from './au-toolbar';
1111

@@ -16,8 +16,8 @@ const autofocus = modifier(function autofocus(element: HTMLElement) {
1616
export interface AuAccordionSignature {
1717
Args: {
1818
buttonLabel?: string;
19-
iconClosed?: string;
20-
iconOpen?: string;
19+
iconClosed?: AuIconSignature['Args']['icon'];
20+
iconOpen?: AuIconSignature['Args']['icon'];
2121
isOpenInitially?: boolean;
2222
loading?: boolean;
2323
reverse?: boolean;

addon/components/au-icon.gts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export interface AuIconSignature {
77
alignment?: 'left' | 'right';
88
// TODO: We should deprecate the non-boolean versions since there is no reason to support them
99
ariaHidden?: boolean | 'true' | 'false';
10-
icon: string | ComponentLike<Record<string, never>>;
10+
icon: string | ComponentLike<{ Element: Element }>;
1111
size?: 'large';
1212
};
13-
Element: SVGSVGElement;
13+
Element: Element;
1414
}
1515

1616
export default class AuIcon extends Component<AuIconSignature> {
@@ -47,10 +47,10 @@ export default class AuIcon extends Component<AuIconSignature> {
4747
<template>
4848
{{#if this.iconComponent}}
4949
{{#let this.iconComponent as |Icon|}}
50-
{{! @glint-expect-error: glint doesn't like us setting attributes on the passed component }}
5150
<Icon
5251
class="au-c-icon {{this.alignment}} {{this.size}}"
5352
aria-hidden={{this.ariaHidden}}
53+
...attributes
5454
/>
5555
{{/let}}
5656
{{else}}

addon/components/au-link-external.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Component from '@glimmer/component';
2-
import AuIcon from './au-icon';
2+
import AuIcon, { type AuIconSignature } from './au-icon';
33

44
const SKIN_CLASSES = {
55
primary: 'au-c-link',
@@ -12,7 +12,7 @@ const SKIN_CLASSES = {
1212
export interface AuLinkExternalSignature {
1313
Args: {
1414
hideText?: boolean;
15-
icon?: string;
15+
icon?: AuIconSignature['Args']['icon'];
1616
iconAlignment?: 'left' | 'right';
1717
skin?:
1818
| 'primary'

0 commit comments

Comments
 (0)