godown 3.0.0-canary.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/alert.d.ts +1 -0
- package/alert.d.ts.map +1 -1
- package/alert.js +1 -5
- package/alert.js.map +1 -1
- package/avatar.d.ts +1 -0
- package/avatar.d.ts.map +1 -1
- package/avatar.js +1 -5
- package/avatar.js.map +1 -1
- package/badge.d.ts +9 -0
- package/badge.d.ts.map +1 -0
- package/badge.js +2 -0
- package/badge.js.map +1 -0
- package/breath.js +1 -5
- package/breath.js.map +1 -1
- package/build/godown+lit.iife.js +59 -0
- package/build/godown+lit.iife.js.map +1 -0
- package/build/godown+lit.js +59 -0
- package/build/godown+lit.js.map +1 -0
- package/build/godown+lit.umd.js +59 -0
- package/build/godown+lit.umd.js.map +1 -0
- package/build/godown.iife.js +47 -0
- package/build/godown.js +48 -0
- package/build/godown.js.map +1 -0
- package/build/godown.umd.js +48 -0
- package/build/godown.umd.js.map +1 -0
- package/button.d.ts +1 -0
- package/button.d.ts.map +1 -1
- package/button.js +1 -5
- package/button.js.map +1 -1
- package/card.d.ts +1 -0
- package/card.d.ts.map +1 -1
- package/card.js +1 -5
- package/card.js.map +1 -1
- package/carousel.d.ts +1 -0
- package/carousel.d.ts.map +1 -1
- package/carousel.js +1 -5
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +4 -1
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -176
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +7 -2
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -62
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +23 -0
- package/components/badge.d.ts.map +1 -0
- package/components/badge.js +2 -0
- package/components/badge.js.map +1 -0
- package/components/breath.d.ts +6 -4
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -80
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +8 -5
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -168
- package/components/button.js.map +1 -1
- package/components/card.d.ts +3 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -48
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +5 -1
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -113
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +4 -3
- package/components/details.d.ts.map +1 -1
- package/components/details.js +1 -52
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +4 -2
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -96
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +3 -3
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -36
- package/components/divider.js.map +1 -1
- package/components/dragbox.d.ts +4 -2
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -109
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts +3 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js +1 -62
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +3 -1
- package/components/form.d.ts.map +1 -1
- package/components/form.js +1 -75
- package/components/form.js.map +1 -1
- package/components/grid.d.ts +3 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -56
- package/components/grid.js.map +1 -1
- package/components/heading.d.ts +29 -0
- package/components/heading.d.ts.map +1 -0
- package/components/heading.js +2 -0
- package/components/heading.js.map +1 -0
- package/components/input.d.ts +5 -1
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -50
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +6 -4
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +1 -58
- package/components/layout.js.map +1 -1
- package/components/link.d.ts +5 -0
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -44
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +3 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -58
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +10 -4
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -266
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +3 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -56
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +27 -34
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -250
- package/components/router.js.map +1 -1
- package/components/select.d.ts +7 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -211
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts +3 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +1 -54
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +8 -2
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -153
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -2
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -92
- package/components/switch.js.map +1 -1
- package/components/text.d.ts +3 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js +1 -43
- package/components/text.js.map +1 -1
- package/components/time.d.ts +4 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -77
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +4 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -80
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +6 -12
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -129
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts +2 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -52
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.d.ts +2 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -38
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +4 -3
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -111
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +1 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -37
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.d.ts +1 -0
- package/details.d.ts.map +1 -1
- package/details.js +1 -5
- package/details.js.map +1 -1
- package/dev/alert.d.ts +1 -0
- package/dev/alert.d.ts.map +1 -1
- package/dev/alert.js +1 -0
- package/dev/alert.js.map +1 -1
- package/dev/avatar.d.ts +1 -0
- package/dev/avatar.d.ts.map +1 -1
- package/dev/avatar.js +1 -0
- package/dev/avatar.js.map +1 -1
- package/dev/badge.d.ts +9 -0
- package/dev/badge.d.ts.map +1 -0
- package/dev/badge.js +5 -0
- package/dev/badge.js.map +1 -0
- package/dev/button.d.ts +1 -0
- package/dev/button.d.ts.map +1 -1
- package/dev/button.js +1 -0
- package/dev/button.js.map +1 -1
- package/dev/card.d.ts +1 -0
- package/dev/card.d.ts.map +1 -1
- package/dev/card.js +1 -0
- package/dev/card.js.map +1 -1
- package/dev/carousel.d.ts +1 -0
- package/dev/carousel.d.ts.map +1 -1
- package/dev/carousel.js +1 -0
- package/dev/carousel.js.map +1 -1
- package/dev/components/alert.d.ts +4 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +87 -77
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +7 -2
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +60 -32
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +23 -0
- package/dev/components/badge.d.ts.map +1 -0
- package/dev/components/badge.js +114 -0
- package/dev/components/badge.js.map +1 -0
- package/dev/components/breath.d.ts +6 -4
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +40 -31
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +8 -5
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +38 -21
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +3 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +43 -41
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +5 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +81 -55
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +4 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +76 -70
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +4 -2
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +65 -60
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +3 -3
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +27 -10
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts +4 -2
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +22 -13
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts +3 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +22 -9
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts +3 -1
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js +6 -7
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts +3 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +22 -10
- package/dev/components/grid.js.map +1 -1
- package/dev/components/heading.d.ts +29 -0
- package/dev/components/heading.d.ts.map +1 -0
- package/dev/components/heading.js +125 -0
- package/dev/components/heading.js.map +1 -0
- package/dev/components/input.d.ts +5 -1
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +36 -28
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts +6 -4
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +53 -39
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.d.ts +5 -0
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +13 -3
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +3 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +20 -8
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +10 -4
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +69 -64
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +3 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +14 -9
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +27 -34
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +25 -38
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +7 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +79 -58
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts +3 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +67 -63
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts +8 -2
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +67 -51
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -2
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +91 -85
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts +3 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +56 -53
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +4 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +19 -6
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +4 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +45 -27
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +6 -12
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +48 -54
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts +2 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +19 -14
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts +2 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +15 -12
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +4 -3
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +64 -42
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +1 -1
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +1 -2
- package/dev/core/super-openable.js.map +1 -1
- package/dev/details.d.ts +1 -0
- package/dev/details.d.ts.map +1 -1
- package/dev/details.js +1 -0
- package/dev/details.js.map +1 -1
- package/dev/dialog.d.ts +1 -0
- package/dev/dialog.d.ts.map +1 -1
- package/dev/dialog.js +1 -0
- package/dev/dialog.js.map +1 -1
- package/dev/divider.d.ts +1 -0
- package/dev/divider.d.ts.map +1 -1
- package/dev/divider.js +1 -0
- package/dev/divider.js.map +1 -1
- package/dev/dragbox.d.ts +1 -0
- package/dev/dragbox.d.ts.map +1 -1
- package/dev/dragbox.js +1 -0
- package/dev/dragbox.js.map +1 -1
- package/dev/flex.d.ts +1 -0
- package/dev/flex.d.ts.map +1 -1
- package/dev/flex.js +1 -0
- package/dev/flex.js.map +1 -1
- package/dev/form.d.ts +1 -0
- package/dev/form.d.ts.map +1 -1
- package/dev/form.js +1 -0
- package/dev/form.js.map +1 -1
- package/dev/grid.d.ts +1 -0
- package/dev/grid.d.ts.map +1 -1
- package/dev/grid.js +1 -0
- package/dev/grid.js.map +1 -1
- package/dev/heading.d.ts +9 -0
- package/dev/heading.d.ts.map +1 -0
- package/dev/heading.js +5 -0
- package/dev/heading.js.map +1 -0
- package/dev/index.d.ts +2 -0
- package/dev/index.d.ts.map +1 -1
- package/dev/index.js +2 -0
- package/dev/index.js.map +1 -1
- package/dev/layout.d.ts.map +1 -1
- package/dev/progress.d.ts.map +1 -1
- package/dev/router.d.ts.map +1 -1
- package/dev/split.d.ts +1 -1
- package/dev/split.d.ts.map +1 -1
- package/dev/typewriter.d.ts +1 -0
- package/dev/typewriter.d.ts.map +1 -1
- package/dev/typewriter.js +1 -0
- package/dev/typewriter.js.map +1 -1
- package/dialog.d.ts +1 -0
- package/dialog.d.ts.map +1 -1
- package/dialog.js +1 -5
- package/dialog.js.map +1 -1
- package/divider.d.ts +1 -0
- package/divider.d.ts.map +1 -1
- package/divider.js +1 -5
- package/divider.js.map +1 -1
- package/dragbox.d.ts +1 -0
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +1 -5
- package/dragbox.js.map +1 -1
- package/flex.d.ts +1 -0
- package/flex.d.ts.map +1 -1
- package/flex.js +1 -5
- package/flex.js.map +1 -1
- package/form.d.ts +1 -0
- package/form.d.ts.map +1 -1
- package/form.js +1 -5
- package/form.js.map +1 -1
- package/grid.d.ts +1 -0
- package/grid.d.ts.map +1 -1
- package/grid.js +1 -5
- package/grid.js.map +1 -1
- package/heading.d.ts +9 -0
- package/heading.d.ts.map +1 -0
- package/heading.js +2 -0
- package/heading.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -56
- package/index.js.map +1 -1
- package/input.js +1 -5
- package/input.js.map +1 -1
- package/layout.d.ts.map +1 -1
- package/layout.js +1 -5
- package/layout.js.map +1 -1
- package/link.js +1 -5
- package/link.js.map +1 -1
- package/package.json +13 -8
- package/progress.d.ts.map +1 -1
- package/progress.js +1 -5
- package/progress.js.map +1 -1
- package/range.js +1 -5
- package/range.js.map +1 -1
- package/rotate.js +1 -5
- package/rotate.js.map +1 -1
- package/router.d.ts.map +1 -1
- package/router.js +1 -5
- package/router.js.map +1 -1
- package/select.js +1 -5
- package/select.js.map +1 -1
- package/skeleton.js +1 -5
- package/skeleton.js.map +1 -1
- package/split.d.ts +1 -1
- package/split.d.ts.map +1 -1
- package/split.js +1 -5
- package/split.js.map +1 -1
- package/src/alert.ts +2 -0
- package/src/avatar.ts +2 -0
- package/src/badge.ts +13 -0
- package/src/button.ts +2 -0
- package/src/card.ts +2 -0
- package/src/carousel.ts +2 -0
- package/src/components/alert.ts +92 -86
- package/src/components/avatar.ts +65 -39
- package/src/components/badge.ts +110 -0
- package/src/components/breath.ts +47 -38
- package/src/components/button.ts +38 -36
- package/src/components/card.ts +45 -46
- package/src/components/carousel.ts +91 -66
- package/src/components/details.ts +79 -75
- package/src/components/dialog.ts +74 -73
- package/src/components/divider.ts +28 -13
- package/src/components/dragbox.ts +30 -25
- package/src/components/flex.ts +35 -22
- package/src/components/form.ts +12 -15
- package/src/components/grid.ts +35 -23
- package/src/components/heading.ts +123 -0
- package/src/components/input.ts +43 -37
- package/src/components/layout.ts +52 -44
- package/src/components/link.ts +13 -4
- package/src/components/progress.ts +22 -10
- package/src/components/range.ts +107 -108
- package/src/components/rotate.ts +24 -18
- package/src/components/router.ts +64 -67
- package/src/components/select.ts +94 -78
- package/src/components/skeleton.ts +70 -68
- package/src/components/split.ts +81 -67
- package/src/components/switch.ts +97 -93
- package/src/components/text.ts +55 -58
- package/src/components/time.ts +26 -13
- package/src/components/tooltip.ts +44 -32
- package/src/components/typewriter.ts +54 -61
- package/src/core/global-style.ts +34 -21
- package/src/core/super-anchor.ts +17 -14
- package/src/core/super-input.ts +76 -63
- package/src/core/super-openable.ts +8 -14
- package/src/details.ts +2 -0
- package/src/dialog.ts +2 -0
- package/src/divider.ts +2 -0
- package/src/dragbox.ts +2 -0
- package/src/flex.ts +2 -0
- package/src/form.ts +2 -0
- package/src/grid.ts +2 -0
- package/src/heading.ts +13 -0
- package/src/index.ts +2 -0
- package/src/layout.ts +1 -0
- package/src/progress.ts +1 -0
- package/src/router.ts +1 -0
- package/src/split.ts +1 -1
- package/src/typewriter.ts +2 -0
- package/switch.js +1 -5
- package/switch.js.map +1 -1
- package/text.js +1 -5
- package/text.js.map +1 -1
- package/time.js +1 -5
- package/time.js.map +1 -1
- package/tooltip.js +1 -5
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +1 -0
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +1 -5
- package/typewriter.js.map +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
package/src/components/alert.ts
CHANGED
@@ -1,20 +1,16 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import { styles } from "@godown/element/decorators/styles.js";
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { htmlStyle } from "@godown/element/directives/html-style.js";
|
5
|
-
import { constructCSSObject, toVar } from "@godown/element/tools/css.js";
|
1
|
+
import { attr, constructCSSObject, godown, htmlSlot, htmlStyle, styles, toVar } from "@godown/element";
|
6
2
|
import iconCheckAltCircle from "@godown/f7-icon/icons/checkmark-alt-circle.js";
|
7
3
|
import iconExclamationCircle from "@godown/f7-icon/icons/exclamationmark-circle.js";
|
8
4
|
import iconInfoCircle from "@godown/f7-icon/icons/info-circle.js";
|
9
5
|
import iconLightbulb from "@godown/f7-icon/icons/lightbulb.js";
|
10
6
|
import iconQuestionCircle from "@godown/f7-icon/icons/question-circle.js";
|
11
7
|
import iconSlashCircle from "@godown/f7-icon/icons/slash-circle.js";
|
12
|
-
import iconXmark from "@godown/f7-icon/icons/xmark.js";
|
13
8
|
import iconXmarkCircle from "@godown/f7-icon/icons/xmark-circle.js";
|
14
|
-
import
|
9
|
+
import iconXmark from "@godown/f7-icon/icons/xmark.js";
|
10
|
+
import { type TemplateResult, css, html } from "lit";
|
15
11
|
import { property } from "lit/decorators.js";
|
16
12
|
|
17
|
-
import {
|
13
|
+
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
18
14
|
|
19
15
|
const protoName = "alert";
|
20
16
|
const cssScope = scopePrefix(protoName);
|
@@ -40,7 +36,7 @@ const darkStyles = constructCSSObject(
|
|
40
36
|
white: [cssGlobalVars._colors.lightgray[2], cssGlobalVars._colors.darkgray[7]],
|
41
37
|
black: [cssGlobalVars._colors.darkgray[8], cssGlobalVars._colors.lightgray[5]],
|
42
38
|
},
|
43
|
-
() =>
|
39
|
+
() => ":host",
|
44
40
|
(prop) => toVar(prop),
|
45
41
|
);
|
46
42
|
|
@@ -63,7 +59,7 @@ const lightStyles = constructCSSObject(
|
|
63
59
|
white: [cssGlobalVars._colors.lightgray[0], cssGlobalVars._colors.darkgray[0]],
|
64
60
|
black: [cssGlobalVars._colors.darkgray[7], cssGlobalVars._colors.lightgray[3]],
|
65
61
|
},
|
66
|
-
() =>
|
62
|
+
() => ":host",
|
67
63
|
(prop) => toVar(prop),
|
68
64
|
);
|
69
65
|
|
@@ -110,76 +106,76 @@ const calls = {
|
|
110
106
|
* @slot - Alert content.
|
111
107
|
* @slot title - Alert title.
|
112
108
|
* @slot icon - Alert icon.
|
109
|
+
* @fires close - Fires when the alert is closed.
|
113
110
|
* @category feedback
|
114
111
|
*/
|
115
112
|
@godown(protoName)
|
116
|
-
@styles(
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
113
|
+
@styles(css`
|
114
|
+
:host,
|
115
|
+
:where(:host([contents]) [part="root"]) {
|
116
|
+
border-radius: var(${cssScope}--border-radius);
|
117
|
+
${cssScope}--border-radius: .25em;
|
118
|
+
${cssScope}--border-width: .075em;
|
119
|
+
${cssScope}--blockquote-width: .2em;
|
120
|
+
${cssScope}--padding: .5em;
|
121
|
+
display: block;
|
122
|
+
width: 100%;
|
123
|
+
}
|
127
124
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
125
|
+
[part="root"] {
|
126
|
+
--color: var(${cssScope}--color);
|
127
|
+
color: var(--color);
|
128
|
+
width: 100%;
|
129
|
+
transition: 0.25s;
|
130
|
+
display: flex;
|
131
|
+
justify-content: space-between;
|
132
|
+
padding: var(${cssScope}--padding);
|
133
|
+
border-radius: inherit;
|
134
|
+
border: var(${cssScope}--border-width) solid var(--color);
|
135
|
+
background: var(${cssScope}--background);
|
136
|
+
}
|
140
137
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
138
|
+
[variant="blockquote"] {
|
139
|
+
border-radius: 0;
|
140
|
+
border-left: var(${cssScope}--blockquote-width) solid var(--color);
|
141
|
+
border-bottom: none;
|
142
|
+
border-right: none;
|
143
|
+
border-top: none;
|
144
|
+
background: transparent;
|
145
|
+
}
|
149
146
|
|
150
|
-
|
151
|
-
|
152
|
-
|
147
|
+
[part="content"] {
|
148
|
+
color: var(--color);
|
149
|
+
}
|
153
150
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
151
|
+
[part="root"] {
|
152
|
+
display: grid;
|
153
|
+
align-items: center;
|
154
|
+
grid-template-columns: auto 1fr auto;
|
155
|
+
grid-template-rows: auto 1fr;
|
156
|
+
}
|
160
157
|
|
161
|
-
|
162
|
-
|
163
|
-
|
158
|
+
[part="title"] {
|
159
|
+
line-height: 2em;
|
160
|
+
}
|
164
161
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
162
|
+
[part="icon"] {
|
163
|
+
display: inline-grid;
|
164
|
+
align-items: center;
|
165
|
+
height: 2em;
|
166
|
+
}
|
170
167
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
168
|
+
[part="icon"] svg {
|
169
|
+
margin-right: 0.5em;
|
170
|
+
width: 1.25em;
|
171
|
+
height: 1.25em;
|
172
|
+
}
|
176
173
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
)
|
174
|
+
[part="content"] {
|
175
|
+
grid-row: span 2 / span 2;
|
176
|
+
line-height: 1.5em;
|
177
|
+
}
|
178
|
+
`)
|
183
179
|
class Alert extends GlobalStyle {
|
184
180
|
/**
|
185
181
|
* If it is a legal value, the icon and preset color will be rendered.
|
@@ -240,32 +236,41 @@ class Alert extends GlobalStyle {
|
|
240
236
|
@property()
|
241
237
|
variant: "blockquote" | "dark" | "light" = "dark";
|
242
238
|
|
243
|
-
protected render() {
|
239
|
+
protected render(): TemplateResult<1> {
|
244
240
|
const color = calls[this.call]?.color || this.color;
|
245
241
|
const icon = this.call ? calls[this.call].icon() : htmlSlot("icon");
|
246
|
-
return
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
242
|
+
return html`
|
243
|
+
<div
|
244
|
+
part="root"
|
245
|
+
${attr(this.observedRecord)}
|
246
|
+
>
|
247
|
+
<div part="icon">${icon}</div>
|
248
|
+
<div part="content">
|
249
|
+
<strong part="title">${this.title || htmlSlot("title")}</strong>
|
250
|
+
${this.content || htmlSlot()}
|
251
|
+
</div>
|
252
|
+
${this.hideClose || this.variant === "blockquote"
|
253
|
+
? ""
|
254
|
+
: html`
|
255
|
+
<div
|
256
|
+
part="close"
|
257
|
+
tabindex="0"
|
258
|
+
@click="${this.close}"
|
259
|
+
>
|
260
|
+
${iconXmark()}
|
261
|
+
</div>
|
262
|
+
`}
|
263
|
+
${htmlStyle(this.variant === "dark" ? darkStyles[color] : lightStyles[color])}
|
252
264
|
</div>
|
253
|
-
|
254
|
-
!this.hideClose && this.variant !== "blockquote"
|
255
|
-
? html`<div part="close" tabindex=0 @click="${this.close}">${iconXmark()}</div>`
|
256
|
-
: ""
|
257
|
-
}
|
258
|
-
</div>`,
|
259
|
-
htmlStyle(this.variant === "light" ? lightStyles[color] : darkStyles[color]),
|
260
|
-
];
|
265
|
+
`;
|
261
266
|
}
|
262
267
|
|
263
|
-
close() {
|
268
|
+
close(): void {
|
264
269
|
this.remove();
|
265
270
|
this.dispatchEvent(new CustomEvent("close", { bubbles: true, composed: true }));
|
266
271
|
}
|
267
272
|
|
268
|
-
protected firstUpdated() {
|
273
|
+
protected firstUpdated(): void {
|
269
274
|
if (this.autoclose) {
|
270
275
|
setTimeout(() => this.close(), this.autoclose);
|
271
276
|
}
|
@@ -280,3 +285,4 @@ class Alert extends GlobalStyle {
|
|
280
285
|
}
|
281
286
|
|
282
287
|
export default Alert;
|
288
|
+
export { Alert };
|
package/src/components/avatar.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { godown, styles } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, omit, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
4
3
|
import { property } from "lit/decorators.js";
|
5
4
|
|
6
5
|
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -18,38 +17,45 @@ const cssScope = scopePrefix(protoName);
|
|
18
17
|
* @category display
|
19
18
|
*/
|
20
19
|
@godown(protoName)
|
21
|
-
@styles(
|
22
|
-
|
23
|
-
:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
vertical-align: bottom;
|
29
|
-
}
|
20
|
+
@styles(css`
|
21
|
+
:host {
|
22
|
+
${cssScope}--size: 2em;
|
23
|
+
width: var(${cssScope}--size);
|
24
|
+
height: var(${cssScope}--size);
|
25
|
+
vertical-align: bottom;
|
26
|
+
}
|
30
27
|
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
:host,
|
29
|
+
[part="root"] {
|
30
|
+
display: inline-flex;
|
31
|
+
}
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
:host([contents]) [part="root"] {
|
34
|
+
display: inline-flex;
|
35
|
+
width: inherit;
|
36
|
+
height: inherit;
|
37
|
+
}
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
39
|
+
:host([round]) {
|
40
|
+
border-radius: 50%;
|
41
|
+
}
|
42
|
+
|
43
|
+
[part="image"] {
|
44
|
+
width: 100%;
|
45
|
+
height: 100%;
|
46
|
+
object-fit: cover;
|
47
|
+
}
|
48
|
+
|
49
|
+
[part="root"] {
|
50
|
+
overflow: hidden;
|
51
|
+
position: relative;
|
52
|
+
border-radius: inherit;
|
53
|
+
width: 100%;
|
54
|
+
height: 100%;
|
55
|
+
align-items: center;
|
56
|
+
justify-content: center;
|
57
|
+
}
|
58
|
+
`)
|
53
59
|
class Avatar extends GlobalStyle {
|
54
60
|
/**
|
55
61
|
* Image src.
|
@@ -58,35 +64,55 @@ class Avatar extends GlobalStyle {
|
|
58
64
|
src: string | undefined | null;
|
59
65
|
|
60
66
|
/**
|
61
|
-
* If the image is not available,
|
67
|
+
* If the image is not available, display name (call {@linkcode Avatar.format}).
|
62
68
|
*/
|
63
69
|
@property()
|
64
70
|
name = "";
|
65
71
|
|
72
|
+
/**
|
73
|
+
* Display rounded.
|
74
|
+
*/
|
66
75
|
@property({ type: Boolean })
|
67
76
|
round = false;
|
68
77
|
|
69
|
-
protected render() {
|
70
|
-
return html
|
78
|
+
protected render(): TemplateResult<1> {
|
79
|
+
return html`
|
80
|
+
<div
|
81
|
+
part="root"
|
82
|
+
${attr(omit(this.observedRecord, "src"))}
|
83
|
+
>
|
84
|
+
${this._renderAvatar()}
|
85
|
+
</div>
|
86
|
+
`;
|
71
87
|
}
|
72
88
|
|
73
89
|
private _renderAvatar() {
|
74
90
|
if (this.src) {
|
75
|
-
return html
|
91
|
+
return html`
|
92
|
+
<img
|
93
|
+
part="image"
|
94
|
+
src="${this.src}"
|
95
|
+
alt="${this.name}"
|
96
|
+
@error=${this._handleError}
|
97
|
+
/>
|
98
|
+
`;
|
76
99
|
}
|
77
100
|
if (this.name) {
|
78
|
-
return html
|
101
|
+
return html`
|
102
|
+
<span part="name">${this.format()}</span>
|
103
|
+
`;
|
79
104
|
}
|
80
105
|
return htmlSlot();
|
81
106
|
}
|
82
107
|
|
83
|
-
format() {
|
108
|
+
format(): string {
|
84
109
|
return this.name;
|
85
110
|
}
|
86
111
|
|
87
|
-
_handleError() {
|
112
|
+
_handleError(): void {
|
88
113
|
this.src = undefined;
|
89
114
|
}
|
90
115
|
}
|
91
116
|
|
92
117
|
export default Avatar;
|
118
|
+
export { Avatar };
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
3
|
+
import { property } from "lit/decorators.js";
|
4
|
+
|
5
|
+
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
6
|
+
|
7
|
+
type Position = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
8
|
+
|
9
|
+
const protoName = "badge";
|
10
|
+
const cssScope = scopePrefix(protoName);
|
11
|
+
|
12
|
+
/**
|
13
|
+
* {@linkcode Badge} renders a badge.
|
14
|
+
*
|
15
|
+
* @slot - Badge content.
|
16
|
+
* @category display
|
17
|
+
*/
|
18
|
+
@godown(protoName)
|
19
|
+
@styles(css`
|
20
|
+
:host {
|
21
|
+
${cssScope}--background: var(${cssGlobalVars.active});
|
22
|
+
${cssScope}--offset: 0%;
|
23
|
+
${cssScope}--offset-x: var(${cssScope}--offset);
|
24
|
+
${cssScope}--offset-y: var(${cssScope}--offset);
|
25
|
+
}
|
26
|
+
|
27
|
+
:host,
|
28
|
+
:host([contents]) [part="root"] {
|
29
|
+
display: inline-block;
|
30
|
+
}
|
31
|
+
|
32
|
+
[part="root"] {
|
33
|
+
position: relative;
|
34
|
+
}
|
35
|
+
|
36
|
+
[part="badge"] {
|
37
|
+
position: absolute;
|
38
|
+
font-size: 75%;
|
39
|
+
padding: 0 0.5em;
|
40
|
+
user-select: none;
|
41
|
+
border-radius: calc(infinity * 1px);
|
42
|
+
transform: translate(-50%, -50%);
|
43
|
+
left: var(--left);
|
44
|
+
top: var(--top);
|
45
|
+
background: var(${cssScope}--background);
|
46
|
+
}
|
47
|
+
|
48
|
+
[part="badge"]:empty {
|
49
|
+
width: 0.5em;
|
50
|
+
height: 0.5em;
|
51
|
+
font-size: 100%;
|
52
|
+
padding: 0;
|
53
|
+
border-radius: 50%;
|
54
|
+
}
|
55
|
+
|
56
|
+
[position^="top"] {
|
57
|
+
--top: calc(0% + var(${cssScope}--offset-y));
|
58
|
+
}
|
59
|
+
|
60
|
+
[position$="right"] {
|
61
|
+
--left: calc(100% - var(${cssScope}--offset-x));
|
62
|
+
}
|
63
|
+
|
64
|
+
[position^="bottom"] {
|
65
|
+
--top: calc(100% - var(${cssScope}--offset-y));
|
66
|
+
}
|
67
|
+
|
68
|
+
[position$="left"] {
|
69
|
+
--left: calc(0% + var(${cssScope}--offset-x));
|
70
|
+
}
|
71
|
+
`)
|
72
|
+
class Badge extends GlobalStyle {
|
73
|
+
@property()
|
74
|
+
position: Position = "top-right";
|
75
|
+
|
76
|
+
@property({ type: Number })
|
77
|
+
value = 0;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* If `true`, render a dot badge.
|
81
|
+
*/
|
82
|
+
@property({ type: Boolean })
|
83
|
+
dot = false;
|
84
|
+
|
85
|
+
@property({ type: Number })
|
86
|
+
max = 99;
|
87
|
+
|
88
|
+
private formatValue(value: number): string {
|
89
|
+
return value > this.max ? this.max + "+" : value + "";
|
90
|
+
}
|
91
|
+
|
92
|
+
render(): TemplateResult<1> {
|
93
|
+
return html`
|
94
|
+
<div
|
95
|
+
part="root"
|
96
|
+
${attr(this.observedRecord)}
|
97
|
+
>
|
98
|
+
${htmlSlot()}
|
99
|
+
${this.value || this.dot
|
100
|
+
? html`
|
101
|
+
<div part="badge">${this.dot ? "" : this.formatValue(this.value)}</div>
|
102
|
+
`
|
103
|
+
: ""}
|
104
|
+
</div>
|
105
|
+
`;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
export default Badge;
|
110
|
+
export { Badge };
|
package/src/components/breath.ts
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { htmlStyle } from "@godown/element/directives/html-style.js";
|
4
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, htmlStyle, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
5
3
|
import { property } from "lit/decorators.js";
|
6
4
|
|
7
|
-
import {
|
5
|
+
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
8
6
|
|
9
7
|
const defineName = "breath";
|
10
8
|
const cssScope = scopePrefix(defineName);
|
@@ -42,15 +40,22 @@ const cssScope = scopePrefix(defineName);
|
|
42
40
|
`,
|
43
41
|
css`
|
44
42
|
:host {
|
45
|
-
display: flex;
|
46
43
|
margin: auto;
|
47
|
-
width: -moz-fit-content;
|
48
44
|
width: fit-content;
|
49
45
|
font-size: 2em;
|
50
46
|
align-items: center;
|
51
47
|
direction: ltr;
|
52
48
|
}
|
53
49
|
|
50
|
+
:host,
|
51
|
+
:host([contents]) [part="root"] {
|
52
|
+
display: flex;
|
53
|
+
}
|
54
|
+
|
55
|
+
[part="root"] {
|
56
|
+
display: contents;
|
57
|
+
}
|
58
|
+
|
54
59
|
::selection {
|
55
60
|
background: none;
|
56
61
|
}
|
@@ -69,14 +74,16 @@ const cssScope = scopePrefix(defineName);
|
|
69
74
|
box-sizing: border-box;
|
70
75
|
display: inline-block;
|
71
76
|
animation-iteration-count: infinite;
|
72
|
-
|
77
|
+
color: transparent;
|
73
78
|
-webkit-background-clip: text !important;
|
74
79
|
background-clip: text !important;
|
75
80
|
}
|
81
|
+
|
76
82
|
.colorful {
|
77
83
|
opacity: 0;
|
78
84
|
animation-name: colorfulN;
|
79
85
|
}
|
86
|
+
|
80
87
|
.nocolor {
|
81
88
|
position: absolute;
|
82
89
|
top: 0;
|
@@ -99,55 +106,57 @@ class Breath extends GlobalStyle {
|
|
99
106
|
@property()
|
100
107
|
duration: string;
|
101
108
|
|
102
|
-
protected render() {
|
109
|
+
protected render(): TemplateResult<1> {
|
103
110
|
const texts = this.getTexts();
|
104
|
-
return
|
105
|
-
|
106
|
-
|
107
|
-
|
111
|
+
return html`
|
112
|
+
<div
|
113
|
+
part="root"
|
114
|
+
${attr(this.observedRecord)}
|
115
|
+
>
|
116
|
+
${[texts.map(this.renderText), htmlStyle(this._computeStyle(texts.length))]}
|
117
|
+
</div>
|
118
|
+
`;
|
108
119
|
}
|
109
120
|
|
110
|
-
protected renderText(text: string) {
|
111
|
-
return html
|
112
|
-
<span class="
|
113
|
-
|
114
|
-
|
121
|
+
protected renderText(text: string): TemplateResult<1> {
|
122
|
+
return html`
|
123
|
+
<span class="rel">
|
124
|
+
<span class="nocolor">${text}</span>
|
125
|
+
<span class="colorful">${text}</span>
|
126
|
+
</span>
|
127
|
+
`;
|
115
128
|
}
|
116
129
|
|
117
130
|
protected getTexts(): string[] {
|
118
131
|
return Array.isArray(this.text) ? this.text : (this.text || this.textContent).split(/\s+/).filter((x) => x);
|
119
132
|
}
|
120
133
|
|
121
|
-
protected
|
134
|
+
protected _computeStyle(len: number): string {
|
122
135
|
const gap = 100 / 2 / len;
|
123
136
|
const duration = this.parseDuration() || len * 2 + 2;
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
style1 +=
|
134
|
-
`.rel:nth-child(${number}) .colorful{animation-delay:${delay}s;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
|
135
|
-
}
|
136
|
-
return style1;
|
137
|
-
})()
|
138
|
-
);
|
137
|
+
let style1 = "";
|
138
|
+
for (let number = 1; number <= len; number++) {
|
139
|
+
const delay = (-duration / len) * (len - number + 1);
|
140
|
+
const defaultNumber = ((number - 1) % 3) + 1;
|
141
|
+
style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}s;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
|
142
|
+
}
|
143
|
+
return `.colorful{animation-duration:${duration}s;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${
|
144
|
+
gap * 2
|
145
|
+
}%{opacity:1;}}${style1}`;
|
139
146
|
}
|
140
147
|
|
141
|
-
protected parseDuration() {
|
148
|
+
protected parseDuration(): number | undefined {
|
142
149
|
const { duration } = this;
|
143
150
|
if (duration) {
|
144
151
|
if (duration.endsWith("s")) {
|
145
|
-
return parseFloat(duration.slice(0, -1));
|
146
|
-
}
|
147
|
-
|
152
|
+
return Number.parseFloat(duration.slice(0, -1));
|
153
|
+
}
|
154
|
+
if (duration.endsWith("ms")) {
|
155
|
+
return Number.parseFloat(duration.slice(0, -2)) / 1000;
|
148
156
|
}
|
149
157
|
}
|
150
158
|
}
|
151
159
|
}
|
152
160
|
|
153
161
|
export default Breath;
|
162
|
+
export { Breath };
|