godown 3.0.0-canary.9 → 3.0.0
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 +14 -16
- 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 +20 -23
- 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 +22 -10
- 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 +107 -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 +29 -26
- 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 +31 -17
- 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 +8 -11
- 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 +32 -26
- 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 +22 -27
- 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 +17 -16
- 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 +29 -17
- 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 +11 -4
- 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 +17 -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 +2 -3
- 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 +17 -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 +103 -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 +17 -17
- 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 +23 -22
- 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 +12 -2
- 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 +41 -38
- 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 +53 -51
- 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 +3 -5
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +14 -16
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +14 -27
- 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 +44 -31
- 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 +9 -9
- 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 +32 -24
- 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 +22 -25
- 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 +12 -15
- 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 +7 -5
- 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 +37 -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 +22 -36
- 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 +11 -6
- 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 +25 -23
- 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 +43 -36
- 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 +2 -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 +11 -6
- 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 +26 -29
- package/src/components/avatar.ts +26 -14
- package/src/components/badge.ts +107 -0
- package/src/components/breath.ts +36 -31
- package/src/components/button.ts +31 -32
- package/src/components/card.ts +9 -12
- package/src/components/carousel.ts +41 -34
- package/src/components/details.ts +24 -29
- package/src/components/dialog.ts +24 -25
- package/src/components/divider.ts +29 -17
- package/src/components/dragbox.ts +18 -13
- package/src/components/flex.ts +20 -10
- package/src/components/form.ts +6 -7
- package/src/components/grid.ts +20 -11
- package/src/components/heading.ts +105 -0
- package/src/components/input.ts +20 -20
- package/src/components/layout.ts +20 -23
- package/src/components/link.ts +12 -3
- package/src/components/progress.ts +46 -41
- package/src/components/range.ts +69 -76
- package/src/components/rotate.ts +11 -10
- package/src/components/router.ts +42 -40
- package/src/components/select.ts +57 -45
- package/src/components/skeleton.ts +11 -11
- package/src/components/split.ts +45 -35
- package/src/components/switch.ts +27 -30
- package/src/components/text.ts +14 -21
- package/src/components/time.ts +14 -12
- package/src/components/tooltip.ts +36 -32
- package/src/components/typewriter.ts +32 -45
- package/src/core/global-style.ts +25 -11
- package/src/core/super-anchor.ts +30 -26
- package/src/core/super-input.ts +53 -53
- package/src/core/super-openable.ts +7 -7
- 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/switch.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
4
3
|
import { property, query } from "lit/decorators.js";
|
5
4
|
|
6
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
@@ -15,11 +14,19 @@ const cssScope = scopePrefix(protoName);
|
|
15
14
|
* The switch is rectangular by default,
|
16
15
|
* set the round property to rounded switch.
|
17
16
|
*
|
17
|
+
* @fires change - Fires when the switch is switched.
|
18
18
|
* @category input
|
19
19
|
*/
|
20
20
|
@godown(protoName)
|
21
21
|
@styles(
|
22
22
|
css`
|
23
|
+
:host,
|
24
|
+
:host([contents]) [part=root] {
|
25
|
+
width: var(${cssScope}-width);
|
26
|
+
height: var(${cssScope}-height);
|
27
|
+
display: inline-block;
|
28
|
+
}
|
29
|
+
|
23
30
|
:host {
|
24
31
|
${cssScope}-width: 3em;
|
25
32
|
${cssScope}-height: calc(var(${cssScope}-width) / 2);
|
@@ -27,36 +34,29 @@ const cssScope = scopePrefix(protoName);
|
|
27
34
|
${cssScope}-handle-space: .125em;
|
28
35
|
${cssScope}-transition: .2s ease-in-out;
|
29
36
|
background: var(${cssGlobalVars.input}-background);
|
30
|
-
width: var(${cssScope}-width);
|
31
|
-
height: var(${cssScope}-height);
|
32
|
-
display: inline-block;
|
33
37
|
vertical-align: bottom;
|
34
38
|
border-radius: 0;
|
35
39
|
}
|
36
40
|
|
37
|
-
[part=
|
38
|
-
|
41
|
+
[part=root],
|
42
|
+
[part=handle] {
|
39
43
|
transition: var(${cssScope}-transition);
|
40
44
|
}
|
41
45
|
|
42
|
-
[part=
|
46
|
+
[part=root] {
|
43
47
|
border-radius: inherit;
|
44
48
|
position: relative;
|
45
49
|
height: inherit;
|
46
50
|
}
|
47
|
-
|
48
|
-
[part=
|
49
|
-
input {
|
50
|
-
width: 100%;
|
51
|
-
}
|
52
|
-
|
53
|
-
input {
|
51
|
+
|
52
|
+
[part=input] {
|
54
53
|
opacity: 0;
|
54
|
+
width: 100%;
|
55
55
|
height: 100%;
|
56
56
|
appearance: none;
|
57
57
|
}
|
58
58
|
|
59
|
-
|
59
|
+
[part=handle] {
|
60
60
|
height: 100%;
|
61
61
|
display: inline-flex;
|
62
62
|
align-items: center;
|
@@ -70,9 +70,10 @@ const cssScope = scopePrefix(protoName);
|
|
70
70
|
|
71
71
|
:host([round]) {
|
72
72
|
border-radius: calc(var(${cssScope}-height) / 2);
|
73
|
+
background: var(${cssGlobalVars.passive});
|
73
74
|
}
|
74
75
|
|
75
|
-
:host([checked])
|
76
|
+
:host([checked]) [part=handle] {
|
76
77
|
left: 50%;
|
77
78
|
}
|
78
79
|
|
@@ -84,7 +85,7 @@ const cssScope = scopePrefix(protoName);
|
|
84
85
|
background: var(${cssGlobalVars.passive});
|
85
86
|
}
|
86
87
|
|
87
|
-
.round
|
88
|
+
.round [part=handle] {
|
88
89
|
--size: var(${cssScope}-handle-size);
|
89
90
|
border-radius: 100%;
|
90
91
|
background: var(--godown--input-control);
|
@@ -93,10 +94,6 @@ const cssScope = scopePrefix(protoName);
|
|
93
94
|
margin: var(${cssScope}-handle-space);
|
94
95
|
}
|
95
96
|
|
96
|
-
.round {
|
97
|
-
background: var(${cssGlobalVars.passive});
|
98
|
-
}
|
99
|
-
|
100
97
|
:host([checked]) .round {
|
101
98
|
background: var(${cssGlobalVars.active});
|
102
99
|
}
|
@@ -104,7 +101,7 @@ const cssScope = scopePrefix(protoName);
|
|
104
101
|
)
|
105
102
|
class Switch extends SuperInput {
|
106
103
|
/**
|
107
|
-
*
|
104
|
+
* Display rounded.
|
108
105
|
*/
|
109
106
|
@property({ type: Boolean, reflect: true })
|
110
107
|
round = false;
|
@@ -136,8 +133,8 @@ class Switch extends SuperInput {
|
|
136
133
|
@query("input")
|
137
134
|
protected _input: HTMLInputElement;
|
138
135
|
|
139
|
-
protected render() {
|
140
|
-
return html`<div part="root" class="${this.round ? "round" : "rect"}">
|
136
|
+
protected render(): TemplateResult<1> {
|
137
|
+
return html`<div part="root" ${attr(this.observedRecord)} class="${this.round ? "round" : "rect"}">
|
141
138
|
<input
|
142
139
|
part="input"
|
143
140
|
@change="${this._handleChange}"
|
@@ -151,12 +148,12 @@ class Switch extends SuperInput {
|
|
151
148
|
</div>`;
|
152
149
|
}
|
153
150
|
|
154
|
-
reset() {
|
151
|
+
reset(): void {
|
155
152
|
this.checked = this.default === "true";
|
156
153
|
this._input.checked = this.checked;
|
157
154
|
}
|
158
155
|
|
159
|
-
connectedCallback() {
|
156
|
+
connectedCallback(): void {
|
160
157
|
super.connectedCallback();
|
161
158
|
if (this.checked) {
|
162
159
|
this.default = "true";
|
@@ -166,9 +163,8 @@ class Switch extends SuperInput {
|
|
166
163
|
}
|
167
164
|
}
|
168
165
|
|
169
|
-
protected _handleChange() {
|
166
|
+
protected _handleChange(): void {
|
170
167
|
this.checked = this._input.checked;
|
171
|
-
this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
|
172
168
|
this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
|
173
169
|
}
|
174
170
|
|
@@ -178,3 +174,4 @@ class Switch extends SuperInput {
|
|
178
174
|
}
|
179
175
|
|
180
176
|
export default Switch;
|
177
|
+
export { Switch };
|
package/src/components/text.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { classList } from "@godown/element/directives/class-list.js";
|
4
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, classList, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
6
3
|
import { property } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -17,7 +14,8 @@ const cssScope = scopePrefix(protoName);
|
|
17
14
|
* @category display
|
18
15
|
*/
|
19
16
|
@godown(protoName)
|
20
|
-
@styles(
|
17
|
+
@styles(
|
18
|
+
css`
|
21
19
|
:host {
|
22
20
|
${cssScope}--color: currentColor;
|
23
21
|
${cssScope}--color-hover: currentColor;
|
@@ -27,7 +25,7 @@ const cssScope = scopePrefix(protoName);
|
|
27
25
|
overflow-wrap: break-word;
|
28
26
|
}
|
29
27
|
|
30
|
-
[part=
|
28
|
+
[part=root] {
|
31
29
|
white-space: nowrap;
|
32
30
|
width: 100%;
|
33
31
|
vertical-align: bottom;
|
@@ -38,11 +36,11 @@ const cssScope = scopePrefix(protoName);
|
|
38
36
|
color: var(${cssScope}--color);
|
39
37
|
}
|
40
38
|
|
41
|
-
[part=
|
39
|
+
[part=root]:hover {
|
42
40
|
color: var(${cssScope}--color-hover, var(${cssScope}--color));
|
43
41
|
}
|
44
42
|
|
45
|
-
[part=
|
43
|
+
[part=root]:active {
|
46
44
|
color: var(${cssScope}--color-active, var(${cssScope}--color));
|
47
45
|
}
|
48
46
|
|
@@ -56,7 +54,7 @@ const cssScope = scopePrefix(protoName);
|
|
56
54
|
text-decoration: none;
|
57
55
|
}
|
58
56
|
|
59
|
-
|
57
|
+
[clip] {
|
60
58
|
background: var(${cssGlobalVars.clipBackground});
|
61
59
|
display: inline-block;
|
62
60
|
color: transparent;
|
@@ -64,7 +62,8 @@ const cssScope = scopePrefix(protoName);
|
|
64
62
|
background-clip: text;
|
65
63
|
-webkit-background-clip: text;
|
66
64
|
}
|
67
|
-
|
65
|
+
`,
|
66
|
+
)
|
68
67
|
class Text extends GlobalStyle {
|
69
68
|
/**
|
70
69
|
* Underline behavior.
|
@@ -76,20 +75,14 @@ class Text extends GlobalStyle {
|
|
76
75
|
* Set background-clip to text.
|
77
76
|
*/
|
78
77
|
@property({ type: Boolean })
|
79
|
-
clip
|
78
|
+
clip = false;
|
80
79
|
|
81
|
-
protected render() {
|
82
|
-
return html`<span
|
83
|
-
part="root"
|
84
|
-
class="${
|
85
|
-
classList(this.underline, {
|
86
|
-
clip: this.clip,
|
87
|
-
})
|
88
|
-
}"
|
89
|
-
>
|
80
|
+
protected render(): TemplateResult<1> {
|
81
|
+
return html`<span part="root" ${attr(this.observedRecord)} class="${classList(this.underline)}">
|
90
82
|
${htmlSlot()}
|
91
83
|
</span>`;
|
92
84
|
}
|
93
85
|
}
|
94
86
|
|
95
87
|
export default Text;
|
88
|
+
export { Text };
|
package/src/components/time.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import { styles } from "@godown/element/decorators/styles.js";
|
1
|
+
import { attr, godown, styles } from "@godown/element";
|
3
2
|
import fmtime from "fmtime";
|
4
|
-
import { css, type PropertyValues } from "lit";
|
3
|
+
import { css, html, type PropertyValues, type TemplateResult } from "lit";
|
5
4
|
import { property } from "lit/decorators.js";
|
6
5
|
|
7
6
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -11,6 +10,7 @@ const protoName = "time";
|
|
11
10
|
/**
|
12
11
|
* {@linkcode Time} renders a formatting time.
|
13
12
|
*
|
13
|
+
* @fires time - Fires when the time changes.
|
14
14
|
* @category display
|
15
15
|
*/
|
16
16
|
@godown(protoName)
|
@@ -32,27 +32,27 @@ class Time extends GlobalStyle {
|
|
32
32
|
* Time.
|
33
33
|
*/
|
34
34
|
@property({ type: Object })
|
35
|
-
time = new Date();
|
35
|
+
time: Date = new Date();
|
36
36
|
|
37
37
|
/**
|
38
38
|
* If there is a value, update every gap or timeout.
|
39
39
|
*/
|
40
40
|
@property({ type: Number })
|
41
|
-
timeout;
|
41
|
+
timeout: any;
|
42
42
|
|
43
43
|
/**
|
44
44
|
* The number of milliseconds that change with each update.
|
45
45
|
*/
|
46
46
|
@property({ type: Number })
|
47
|
-
gap;
|
47
|
+
gap: any;
|
48
48
|
|
49
49
|
protected timeoutId: number;
|
50
50
|
|
51
|
-
protected render():
|
52
|
-
return fmtime(this.format, this.time, this.escape)
|
51
|
+
protected render(): TemplateResult<1> {
|
52
|
+
return html`<span part="root" ${attr(this.observedRecord)}>${fmtime(this.format, this.time, this.escape)}</span>`;
|
53
53
|
}
|
54
54
|
|
55
|
-
protected firstUpdated() {
|
55
|
+
protected firstUpdated(): void {
|
56
56
|
if (this.timeout) {
|
57
57
|
this.timeoutId = this.startTimeout();
|
58
58
|
}
|
@@ -67,15 +67,17 @@ class Time extends GlobalStyle {
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|
70
|
-
disconnectedCallback() {
|
70
|
+
disconnectedCallback(): void {
|
71
71
|
clearInterval(this.timeoutId);
|
72
72
|
}
|
73
73
|
|
74
|
-
startTimeout() {
|
75
|
-
return
|
74
|
+
startTimeout(): number {
|
75
|
+
return setInterval(() => {
|
76
|
+
this.dispatchEvent(new CustomEvent("time", { detail: this.time, composed: true }));
|
76
77
|
this.time = new Date(this.time.getTime() + (this.gap || this.timeout));
|
77
78
|
}, Math.abs(this.timeout));
|
78
79
|
}
|
79
80
|
}
|
80
81
|
|
81
82
|
export default Time;
|
83
|
+
export { Time };
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
5
3
|
import { property } from "lit/decorators.js";
|
6
4
|
|
7
5
|
import { scopePrefix } from "../core/global-style.js";
|
@@ -15,7 +13,7 @@ const cssScope = scopePrefix(protoName);
|
|
15
13
|
*
|
16
14
|
* If it has the tip property, ignore the slot tip.
|
17
15
|
*
|
18
|
-
* @slot tip - Tip element if no `
|
16
|
+
* @slot tip - Tip element if no `tip` provided.
|
19
17
|
* @slot - Content.
|
20
18
|
* @category feedback
|
21
19
|
*/
|
@@ -24,18 +22,21 @@ const cssScope = scopePrefix(protoName);
|
|
24
22
|
css`
|
25
23
|
:host {
|
26
24
|
${cssScope}--tip-background: inherit;
|
27
|
-
display: inline-block;
|
28
25
|
width: fit-content;
|
29
26
|
}
|
27
|
+
|
28
|
+
:host,
|
29
|
+
[part=root] {
|
30
|
+
display: inline-flex;
|
31
|
+
}
|
30
32
|
|
31
|
-
[part=
|
32
|
-
display: flex;
|
33
|
+
[part=root] {
|
33
34
|
position: relative;
|
34
35
|
transition: inherit;
|
35
36
|
border-radius: inherit;
|
36
37
|
}
|
37
38
|
|
38
|
-
[part=
|
39
|
+
[part=tip] {
|
39
40
|
width: fit-content;
|
40
41
|
height: fit-content;
|
41
42
|
position: absolute;
|
@@ -44,26 +45,32 @@ const cssScope = scopePrefix(protoName);
|
|
44
45
|
user-select: none;
|
45
46
|
}
|
46
47
|
|
47
|
-
:host([open]) [part=
|
48
|
+
:host([open]) [part=tip] {
|
48
49
|
visibility: visible;
|
49
50
|
}
|
50
51
|
|
51
|
-
.passive{
|
52
|
+
.passive {
|
52
53
|
background: var(${cssScope}--tip-background);
|
53
|
-
|
54
|
+
}
|
55
|
+
|
56
|
+
[propagation] [part=tip] {
|
57
|
+
pointer-events: none;
|
54
58
|
}
|
55
59
|
`,
|
56
60
|
css`
|
57
|
-
[direction^=
|
61
|
+
[direction^=top] [part=tip] {
|
58
62
|
bottom: 100%;
|
59
63
|
}
|
60
|
-
|
64
|
+
|
65
|
+
[direction^=bottom] [part=tip] {
|
61
66
|
top: 100%;
|
62
67
|
}
|
63
|
-
|
68
|
+
|
69
|
+
[direction$=right] [part=tip] {
|
64
70
|
left: 100%;
|
65
71
|
}
|
66
|
-
|
72
|
+
|
73
|
+
[direction$=left] [part=tip] {
|
67
74
|
right: 100%;
|
68
75
|
}
|
69
76
|
`,
|
@@ -91,7 +98,7 @@ class Tooltip extends SuperOpenable {
|
|
91
98
|
* If true, allow penetration of the tip.
|
92
99
|
*/
|
93
100
|
@property({ type: Boolean })
|
94
|
-
propagation
|
101
|
+
propagation = false;
|
95
102
|
|
96
103
|
/**
|
97
104
|
* How can tips be triggered.
|
@@ -113,27 +120,24 @@ class Tooltip extends SuperOpenable {
|
|
113
120
|
"flex-end": "flex-end",
|
114
121
|
};
|
115
122
|
|
116
|
-
protected render() {
|
123
|
+
protected render(): TemplateResult<1> {
|
117
124
|
const align = Tooltip.aligns[this.align] || "inherit";
|
118
125
|
const isFocusable = this.type === "focus";
|
119
|
-
return html`<div
|
126
|
+
return html`<div
|
127
|
+
part="root"
|
128
|
+
${attr(this.observedRecord)}
|
120
129
|
tabindex="${isFocusable ? 0 : -1}"
|
121
|
-
@focus="${isFocusable ? () => this.open = true : null}"
|
122
|
-
@blur="${isFocusable ? () => this.open = false : null}"
|
123
|
-
@mouseenter="${isFocusable ? null : () => this.open = true}"
|
124
|
-
@mouseleave="${isFocusable ? null : () => this.open = false}"
|
125
|
-
style="justify-content:${align};align-items:${align}"
|
130
|
+
@focus="${isFocusable ? () => (this.open = true) : null}"
|
131
|
+
@blur="${isFocusable ? () => (this.open = false) : null}"
|
132
|
+
@mouseenter="${isFocusable ? null : () => (this.open = true)}"
|
133
|
+
@mouseleave="${isFocusable ? null : () => (this.open = false)}"
|
134
|
+
style="justify-content:${align};align-items:${align}"
|
135
|
+
>
|
126
136
|
${htmlSlot()}
|
127
|
-
<div part="tip"
|
128
|
-
direction="${this.direction}"
|
129
|
-
style="pointer-events:${this.propagation ? "none" : "all"}">
|
130
|
-
${
|
131
|
-
this.tip
|
132
|
-
? html`<span class="passive">${this.tip}</span>`
|
133
|
-
: htmlSlot("tip")
|
134
|
-
}</div>
|
137
|
+
<div part="tip">${this.tip ? html`<span class="passive">${this.tip}</span>` : htmlSlot("tip")}</div>
|
135
138
|
</div>`;
|
136
139
|
}
|
137
140
|
}
|
138
141
|
|
139
142
|
export default Tooltip;
|
143
|
+
export { Tooltip };
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { classList } from "@godown/element/directives/class-list.js";
|
4
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
-
import { random } from "@godown/element/tools/lib.js";
|
6
|
-
import { css, html, type PropertyValueMap } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, random, styles } from "@godown/element";
|
2
|
+
import { css, html, type PropertyValueMap, type TemplateResult } from "lit";
|
7
3
|
import { property, query, state } from "lit/decorators.js";
|
8
4
|
|
9
5
|
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -17,10 +13,15 @@ const cssScope = scopePrefix(protoName);
|
|
17
13
|
* @category effect
|
18
14
|
*/
|
19
15
|
@godown(protoName)
|
20
|
-
@styles(
|
16
|
+
@styles(
|
17
|
+
css`
|
21
18
|
:host {
|
22
19
|
${cssScope}--cursor-width: .05em;
|
23
|
-
|
20
|
+
}
|
21
|
+
|
22
|
+
:host,
|
23
|
+
:host([contents]) [part="root"] {
|
24
|
+
display: inline-block;
|
24
25
|
}
|
25
26
|
|
26
27
|
i {
|
@@ -41,23 +42,14 @@ const cssScope = scopePrefix(protoName);
|
|
41
42
|
slot {
|
42
43
|
display: none;
|
43
44
|
}
|
44
|
-
|
45
|
-
|
46
|
-
visibility: hidden;
|
47
|
-
}
|
48
|
-
`)
|
45
|
+
`,
|
46
|
+
)
|
49
47
|
class Typewriter extends GlobalStyle {
|
50
48
|
/**
|
51
49
|
* Raw text.
|
52
50
|
*/
|
53
51
|
@property()
|
54
|
-
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
58
|
-
*/
|
59
|
-
@property({ type: Boolean })
|
60
|
-
stopped = false;
|
52
|
+
content = "";
|
61
53
|
|
62
54
|
/**
|
63
55
|
* If true, hide the cursor
|
@@ -89,11 +81,8 @@ class Typewriter extends GlobalStyle {
|
|
89
81
|
@property({ type: Number })
|
90
82
|
index = 0;
|
91
83
|
|
92
|
-
/**
|
93
|
-
* Internal text.
|
94
|
-
*/
|
95
84
|
@state()
|
96
|
-
|
85
|
+
contentInternal = "";
|
97
86
|
|
98
87
|
protected timeoutID: number;
|
99
88
|
|
@@ -101,39 +90,36 @@ class Typewriter extends GlobalStyle {
|
|
101
90
|
protected _i: HTMLElement;
|
102
91
|
|
103
92
|
/**
|
104
|
-
* {@linkcode Typewriter.
|
93
|
+
* {@linkcode Typewriter.content} length.
|
105
94
|
*/
|
106
|
-
get len() {
|
107
|
-
return this.
|
95
|
+
get len(): number {
|
96
|
+
return this.content.length;
|
108
97
|
}
|
109
98
|
|
110
|
-
protected render() {
|
111
|
-
return html
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
}"></i>`;
|
99
|
+
protected render(): TemplateResult<1> {
|
100
|
+
return html`<div part="root" ${attr(this.observedRecord)}>
|
101
|
+
${htmlSlot()} ${this.contentInternal}
|
102
|
+
<i part="cursor" ?hidden="${this.ended}"></i>
|
103
|
+
</div>`;
|
116
104
|
}
|
117
105
|
|
118
|
-
protected firstUpdated() {
|
119
|
-
|
120
|
-
|
121
|
-
}
|
122
|
-
if (!this.stopped && this.len) {
|
106
|
+
protected firstUpdated(): void {
|
107
|
+
this.content ||= this._slot?.assignedNodes()[0]?.textContent.trim() || "";
|
108
|
+
if (!this.ended && this.len) {
|
123
109
|
this.write();
|
124
110
|
}
|
125
111
|
}
|
126
112
|
|
127
|
-
protected updated(changedProperties: PropertyValueMap<this>) {
|
113
|
+
protected updated(changedProperties: PropertyValueMap<this>): void {
|
128
114
|
if (changedProperties.has("index")) {
|
129
|
-
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.
|
115
|
+
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.contentInternal }));
|
130
116
|
}
|
131
117
|
}
|
132
118
|
|
133
|
-
write(at = this.index) {
|
134
|
-
this.
|
119
|
+
write(at: number = this.index): void {
|
120
|
+
this.contentInternal = this.content.slice(0, at + 1);
|
135
121
|
const timeout = this.delay || random(this.max, this.min);
|
136
|
-
this.timeoutID =
|
122
|
+
this.timeoutID = setTimeout(() => {
|
137
123
|
const nx = at + 1;
|
138
124
|
if (nx <= this.len) {
|
139
125
|
this.index = nx;
|
@@ -142,13 +128,14 @@ class Typewriter extends GlobalStyle {
|
|
142
128
|
}, timeout);
|
143
129
|
}
|
144
130
|
|
145
|
-
stop() {
|
131
|
+
stop(): void {
|
146
132
|
clearTimeout(this.timeoutID);
|
147
133
|
}
|
148
134
|
|
149
|
-
end() {
|
135
|
+
end(): void {
|
150
136
|
this.ended = true;
|
151
137
|
}
|
152
138
|
}
|
153
139
|
|
154
140
|
export default Typewriter;
|
141
|
+
export { Typewriter };
|
package/src/core/global-style.ts
CHANGED
@@ -1,27 +1,32 @@
|
|
1
1
|
import { type Gradients, presetsRGB } from "@godown/colors/presets-rgb.js";
|
2
2
|
import { travel } from "@godown/colors/travel.js";
|
3
|
-
import GodownElement from "@godown/element";
|
4
|
-
import
|
5
|
-
import { joinProperties } from "@godown/element/tools/css.js";
|
6
|
-
import { trim } from "@godown/element/tools/lib.js";
|
7
|
-
import { css, CSSResult, unsafeCSS } from "lit";
|
8
|
-
|
9
|
-
GodownElement.godownConfig ||= new GodownConfig();
|
3
|
+
import { GodownElement, joinProperties, trim } from "@godown/element";
|
4
|
+
import { css, type CSSResult, unsafeCSS } from "lit";
|
10
5
|
|
11
6
|
export class GlobalStyle extends GodownElement {
|
12
7
|
}
|
13
8
|
|
14
9
|
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
15
10
|
|
16
|
-
export function scopePrefix(scope: string, len = 1) {
|
11
|
+
export function scopePrefix(scope: string, len = 1): CSSResult {
|
17
12
|
return variablePrefix(cssvar + "-".repeat(len) + scope);
|
18
13
|
}
|
19
14
|
|
20
|
-
export function variablePrefix(variable: string) {
|
21
|
-
return unsafeCSS(
|
15
|
+
export function variablePrefix(variable: string): CSSResult {
|
16
|
+
return unsafeCSS(`--${variable}`);
|
22
17
|
}
|
23
18
|
|
24
|
-
export const cssGlobalVars
|
19
|
+
export const cssGlobalVars: {
|
20
|
+
foreground: CSSResult;
|
21
|
+
background: CSSResult;
|
22
|
+
clipBackground: CSSResult;
|
23
|
+
active: CSSResult;
|
24
|
+
passive: CSSResult;
|
25
|
+
_colors: PresetsGradientsCSSResult;
|
26
|
+
input: CSSResult;
|
27
|
+
white: CSSResult;
|
28
|
+
black: CSSResult;
|
29
|
+
} = {
|
25
30
|
foreground: scopePrefix("foreground", 2),
|
26
31
|
background: scopePrefix("background", 2),
|
27
32
|
clipBackground: scopePrefix("clip-background", 2),
|
@@ -82,5 +87,14 @@ GlobalStyle.styles = [
|
|
82
87
|
svg {
|
83
88
|
user-select: none;
|
84
89
|
}
|
90
|
+
|
91
|
+
:host([contents]) {
|
92
|
+
display: contents;
|
93
|
+
}
|
94
|
+
|
95
|
+
:where(:host([contents]) [part=root]) {
|
96
|
+
all: inherit;
|
97
|
+
display: revert;
|
98
|
+
}
|
85
99
|
`,
|
86
100
|
];
|