Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typings for the popover attribute #229

Merged
merged 3 commits into from
Jun 6, 2024
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
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
Loading