Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Use Catalyst for component behaviors:
```typescript
import {controller, target} from '@github/catalyst';

@controller
@controller('my-component')
class MyComponentElement extends HTMLElement {
@target button: HTMLElement

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/components/primer/open_project/avatar_fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {controller} from '@github/catalyst'
* due to a Catalyst bug where @attr accessors aren't properly initialized
* when elements have pre-existing attribute values.
*/
@controller
@controller('avatar-fallback')
export class AvatarFallbackElement extends HTMLElement {
private img: HTMLImageElement | null = null
private testImage: HTMLImageElement | null = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {controller} from '@github/catalyst'
import {CollapsibleElement} from '../collapsible'

@controller
@controller('collapsible-header')
class CollapsibleHeaderElement extends CollapsibleElement {

Check failure on line 5 in app/components/primer/open_project/border_box/collapsible_header.ts

View workflow job for this annotation

GitHub Actions / eslint

'CollapsibleHeaderElement' is defined but only used as a type
connectedCallback() {
if (!this.closest('.Box')) {
throw new Error('No surrounding BorderBox found')
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/open_project/collapsible_section.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {controller} from '@github/catalyst'
import {CollapsibleElement} from './collapsible'

@controller
@controller('collapsible-section')
class CollapsibleSectionElement extends CollapsibleElement {

Check failure on line 5 in app/components/primer/open_project/collapsible_section.ts

View workflow job for this annotation

GitHub Actions / eslint

'CollapsibleSectionElement' is defined but only used as a type
get baseClass(): string {
return 'CollapsibleSection'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {LiveRegionElement} from '@primer/live-region-element'

const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[data-submit-dialog-id]'

@controller
@controller('danger-dialog-form-helper')
class DangerDialogFormHelperElement extends HTMLElement {
@target checkbox: HTMLInputElement | undefined
@target liveRegion: LiveRegionElement
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/open_project/filterable_tree_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type NodeState = {

const ASYNC_DEBOUNCE_MS = 300

@controller
@controller('filterable-tree-view')
export class FilterableTreeViewElement extends HTMLElement {
@target filterInput: HTMLInputElement
@target filterModeControlList: HTMLElement
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/open_project/page_header_element.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {controller} from '@github/catalyst'

@controller
@controller('page-header')
class PageHeaderElement extends HTMLElement {
menuItemClick(event: Event) {
const currentTarget = event.currentTarget as HTMLButtonElement
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/open_project/sub_header_element.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {controller, target, targets} from '@github/catalyst'

@controller
@controller('sub-header')
class SubHeaderElement extends HTMLElement {
@target filterInput: HTMLInputElement
@targets shownItemsOnExpandedFilter: HTMLElement[]
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/open_project/zen_mode_button.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {controller, target} from '@github/catalyst'

@controller
@controller('zen-mode-button')
class ZenModeButtonElement extends HTMLElement {
@target button: HTMLElement
inZenMode = false

// eslint-disable-next-line custom-elements/no-constructor

Check failure on line 8 in app/components/primer/open_project/zen_mode_button.ts

View workflow job for this annotation

GitHub Actions / eslint

Definition for rule 'custom-elements/no-constructor' was not found
constructor() {
super()
document.addEventListener('fullscreenchange', this.fullscreenChangeEventHandler.bind(this))
Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/adding-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Catalyst has `controller` and `target` decorators which you have to import from
```ts
import {controller, target} from '@github/catalyst';

@controller
@controller('my-component')
class MyComponentNameElement extends HTMLElement {
@target button: HTMLElement
}
Expand Down
Loading