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

feat: ✨ add sd-flipcard #1121

Merged
merged 40 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0941288
feat: set-up flipcard
Vahid1919 May 17, 2024
c6ba0b3
feat: setup flipcard
Vahid1919 May 24, 2024
81b1bc1
feat: add flipcard and include stories
Vahid1919 May 30, 2024
5742117
fix: move some styles to tailwind
Vahid1919 May 30, 2024
c1399f1
docs: add Slots story
Vahid1919 May 30, 2024
0e2c8ba
docs: add Sample
Vahid1919 May 30, 2024
b211a37
docs: add documentation to parts story
Vahid1919 May 30, 2024
b115f63
fix: remove flip on spacebar click
Vahid1919 Jun 6, 2024
24ade74
fix: focus on currently flipped side
Vahid1919 Jun 6, 2024
46e2e74
fix: update ratio story width and parts story
Vahid1919 Jun 6, 2024
0576772
docs: prevent immediate flip on mouseless story
Vahid1919 Jun 6, 2024
8c59a26
fix: add default slots, update padding and more
Vahid1919 Jun 6, 2024
5df757f
fix: remove default behavior for space and enter
Vahid1919 Jun 6, 2024
f46464f
docs: remove manual width setting
Vahid1919 Jun 6, 2024
e922157
feat: add activation
Vahid1919 Jun 7, 2024
9ae7da9
feat: add tests
Vahid1919 Jun 7, 2024
2764798
feat: add aspect ratio, update stories and format test
Vahid1919 Jun 7, 2024
2aa514d
feat: add flip direction attrubute
Vahid1919 Jun 10, 2024
e6d72ac
feat: add migration guide
Vahid1919 Jun 10, 2024
3e51452
fix: remove shadow and link
Vahid1919 Jun 11, 2024
a3b3d6b
fix: decrease gradient size
Vahid1919 Jun 13, 2024
e70a1f9
Merge remote-tracking branch 'origin' into feat/flipcard
Vahid1919 Jun 13, 2024
0a0bd53
feat: fix gradient sizing and focus beahvior in other browers(wip)
Vahid1919 Jun 14, 2024
dad4314
fix: formatting
Vahid1919 Jun 14, 2024
172224f
fix: event target handling
Vahid1919 Jun 17, 2024
6a425fb
fix: remove comments
Vahid1919 Jun 18, 2024
bd320e4
feat: create click and keydown handlers
Vahid1919 Jun 18, 2024
d6e2854
feat: update version number
Vahid1919 Jun 18, 2024
a55efb4
Merge remote-tracking branch 'origin' into feat/flipcard
Vahid1919 Jun 19, 2024
71d873b
Merge remote-tracking branch 'origin' into feat/flipcard
Vahid1919 Jun 19, 2024
ca9bc47
ci: update test
Vahid1919 Jun 19, 2024
2e5f1db
Merge remote-tracking branch 'origin' into feat/flipcard
Vahid1919 Jun 24, 2024
2f84d01
Merge remote-tracking branch 'origin' into feat/flipcard
Vahid1919 Jun 25, 2024
6d29422
feat: add empty attribute
Vahid1919 Jun 28, 2024
bc2ccbb
feat: adjsut stories to new empty component
Vahid1919 Jun 28, 2024
4c33322
update props
mariohamann Jun 28, 2024
0d67486
improve namings
mariohamann Jun 28, 2024
5f3a3d4
feat: include media slots
Vahid1919 Jun 28, 2024
0e7c7bb
feat: include media slots
Vahid1919 Jun 28, 2024
7744873
feat: add hover related tests
Vahid1919 Jul 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export const Sample = {
Lorem ipsum dolor sit amet per niente da faremmasds nonnummy dolore lorem ipsum dolor sit amet consectuer
</p>

<sd-link size="inherit" href="#">Link</sd-link>
<sd-link size="inherit" href="#" target="_blank">Link</sd-link>
</div>
</sd-flipcard>
`;
Expand Down Expand Up @@ -322,7 +322,7 @@ export const AspectRatio = {
Lorem ipsum dolor sit amet per niente da faremmasds nonnummy dolore lorem ipsum dolor sit amet consectuer
</p>

<sd-link size="inherit" href="#" tabindex="0">Link</sd-link>
<sd-link size="inherit" href="#" target="_blank">Link</sd-link>
</div>
</sd-flipcard>
`;
Expand Down
10 changes: 6 additions & 4 deletions packages/components/src/components/flipcard/flipcard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,20 @@ export default class SdFlipcard extends SolidElement {
}

private handleFrontKeydown(event: KeyboardEvent) {
if (event.code === 'Enter' || event.code === 'Space') {
console.log(event.target, this.front, this.front === event.target);
console.log('handleFrontKeydown');
console.log(this.back === event.target, event.type, event.view, event.ctrlKey);
Vahid1919 marked this conversation as resolved.
Show resolved Hide resolved

if (event.code === 'Enter' && this.front === event.target) {
event.preventDefault();
console.log('front keydown', event.code);

this.flipFront();
}
}

private handleBackKeydown(event: KeyboardEvent) {
if (event.code === 'Enter' || event.code === 'Space') {
if (event.code === 'Enter' && this.back === event.target) {
event.preventDefault();
console.log('back keydown', event.code);

this.flipBack();
}
Expand Down
Loading