Skip to content

Commit

Permalink
Add typings for the popover attribute (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc authored Jun 6, 2024
1 parent 8ea9d05 commit e575ef8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-plants-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kitajs/html': patch
---

Add `popover` attribute typings
1 change: 1 addition & 0 deletions packages/html/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ declare namespace JSX {
dir?: undefined | string;
hidden?: undefined | string | boolean;
id?: undefined | number | string;
popover?: undefined | boolean | 'auto' | 'manual';
role?: undefined | string;
lang?: undefined | string;
draggable?: undefined | string | boolean;
Expand Down
7 changes: 7 additions & 0 deletions packages/html/test/attributes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ describe('Attributes', () => {
assert.equal(<div test={{}}></div>, '<div test="[object Object]"></div>');
});

test('Popover', () => {
assert.equal('<div popover="auto"></div>', <div popover="auto"></div>);
assert.equal('<div popover="manual"></div>', <div popover="manual"></div>);

assert.equal('<div popover></div>', <div popover></div>);
});

test('class arrays', () => {
assert.equal(<div class="name" />, '<div class="name"></div>');
assert.equal(<div class={['name']} />, '<div class="name"></div>');
Expand Down

0 comments on commit e575ef8

Please sign in to comment.