-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2823 from tvdeyen/shoelace-confirm-dialog
Use Shoelace Dialog for ConfirmDialog
- Loading branch information
Showing
10 changed files
with
441 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { registerIconLibrary, setDefaultAnimation } from "shoelace" | ||
|
||
// Change the default animation for all tooltips | ||
setDefaultAnimation("tooltip.show", { | ||
keyframes: [ | ||
{ transform: "translateY(10px)", opacity: "0" }, | ||
{ transform: "translateY(0)", opacity: "1" } | ||
], | ||
options: { | ||
duration: 100 | ||
} | ||
}) | ||
|
||
setDefaultAnimation("tooltip.hide", { | ||
keyframes: [ | ||
{ transform: "translateY(0)", opacity: "1" }, | ||
{ transform: "translateY(10px)", opacity: "0" } | ||
], | ||
options: { | ||
duration: 100 | ||
} | ||
}) | ||
|
||
// Change the default animation for all dialogs | ||
setDefaultAnimation("dialog.show", { | ||
keyframes: [ | ||
{ transform: "scale(0.98)", opacity: "0" }, | ||
{ transform: "scale(1)", opacity: "1" } | ||
], | ||
options: { | ||
duration: 150 | ||
} | ||
}) | ||
|
||
setDefaultAnimation("dialog.hide", { | ||
keyframes: [ | ||
{ transform: "scale(1)", opacity: "1" }, | ||
{ transform: "scale(0.98)", opacity: "0" } | ||
], | ||
options: { | ||
duration: 150 | ||
} | ||
}) | ||
|
||
const spriteUrl = document | ||
.querySelector('meta[name="alchemy-icon-sprite"]') | ||
.getAttribute("content") | ||
|
||
const iconMap = { | ||
"x-lg": "close" | ||
} | ||
|
||
const options = { | ||
resolver: (name) => `${spriteUrl}#ri-${iconMap[name] || name}-line`, | ||
mutator: (svg) => svg.setAttribute("fill", "currentColor"), | ||
spriteSheet: true | ||
} | ||
|
||
registerIconLibrary("default", options) | ||
registerIconLibrary("system", options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.