godown 3.13.0 → 3.13.2
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/alert.d.ts +0 -1
- package/alert.d.ts.map +1 -1
- package/alert.js.map +1 -1
- package/avatar.d.ts +0 -1
- package/avatar.d.ts.map +1 -1
- package/avatar.js.map +1 -1
- package/badge.d.ts +0 -1
- package/badge.d.ts.map +1 -1
- package/badge.js.map +1 -1
- package/breath.d.ts +0 -1
- package/breath.d.ts.map +1 -1
- package/breath.js.map +1 -1
- package/build/godown+lit.iife.js +16 -57
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +16 -57
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +16 -57
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +15 -47
- package/build/godown.iife.js.map +1 -1
- package/build/godown.js +15 -47
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +15 -47
- package/build/godown.umd.js.map +1 -1
- package/button.d.ts +0 -1
- package/button.d.ts.map +1 -1
- package/button.js.map +1 -1
- package/card.d.ts +0 -1
- package/card.d.ts.map +1 -1
- package/card.js.map +1 -1
- package/carousel.d.ts +0 -1
- package/carousel.d.ts.map +1 -1
- package/carousel.js.map +1 -1
- package/chip.d.ts +0 -1
- package/chip.d.ts.map +1 -1
- package/chip.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.d.ts +0 -1
- package/details.d.ts.map +1 -1
- package/details.js.map +1 -1
- package/dialog.d.ts +0 -1
- package/dialog.d.ts.map +1 -1
- package/dialog.js.map +1 -1
- package/divider.d.ts +0 -1
- package/divider.d.ts.map +1 -1
- package/divider.js.map +1 -1
- package/dragbox.d.ts +0 -1
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js.map +1 -1
- package/flex.d.ts +0 -1
- package/flex.d.ts.map +1 -1
- package/flex.js.map +1 -1
- package/form.d.ts +0 -1
- package/form.d.ts.map +1 -1
- package/form.js.map +1 -1
- package/grid.d.ts +0 -1
- package/grid.d.ts.map +1 -1
- package/grid.js.map +1 -1
- package/heading.d.ts +0 -1
- package/heading.d.ts.map +1 -1
- package/heading.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/input.d.ts +0 -1
- package/input.d.ts.map +1 -1
- package/input.js.map +1 -1
- package/internal/global-style.d.ts +13 -15
- package/internal/global-style.d.ts.map +1 -1
- package/internal/global-style.js +1 -1
- package/internal/global-style.js.map +1 -1
- package/internal/icons/caret-down.d.ts +0 -1
- package/internal/icons/caret-down.d.ts.map +1 -1
- package/internal/icons/caret-down.js +1 -1
- package/internal/icons/caret-down.js.map +1 -1
- package/internal/icons/caret-left.d.ts +0 -1
- package/internal/icons/caret-left.d.ts.map +1 -1
- package/internal/icons/caret-left.js +1 -1
- package/internal/icons/caret-left.js.map +1 -1
- package/internal/icons/caret-right.d.ts +0 -1
- package/internal/icons/caret-right.d.ts.map +1 -1
- package/internal/icons/caret-right.js +1 -1
- package/internal/icons/caret-right.js.map +1 -1
- package/internal/icons/eye-slash.d.ts +0 -1
- package/internal/icons/eye-slash.d.ts.map +1 -1
- package/internal/icons/eye-slash.js +1 -1
- package/internal/icons/eye-slash.js.map +1 -1
- package/internal/popover.d.ts +0 -1
- package/internal/popover.d.ts.map +1 -1
- package/internal/popover.js +1 -1
- package/internal/popover.js.map +1 -1
- package/internal/reset-style.d.ts +0 -1
- package/internal/reset-style.d.ts.map +1 -1
- package/internal/reset-style.js +2 -1
- package/internal/reset-style.js.map +1 -1
- package/internal/ring.d.ts +9 -10
- package/internal/ring.d.ts.map +1 -1
- package/internal/ring.js +1 -1
- package/internal/ring.js.map +1 -1
- package/internal/super-input.d.ts +32 -33
- package/internal/super-input.d.ts.map +1 -1
- package/internal/super-input.js +2 -1
- package/internal/super-input.js.map +1 -1
- package/internal/utils.d.ts +0 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.js +1 -1
- package/internal/utils.js.map +1 -1
- package/layout.d.ts +0 -1
- package/layout.d.ts.map +1 -1
- package/layout.js.map +1 -1
- package/link.d.ts +0 -1
- package/link.d.ts.map +1 -1
- package/link.js.map +1 -1
- package/package.json +5 -5
- package/popover.d.ts +0 -1
- package/popover.d.ts.map +1 -1
- package/popover.js.map +1 -1
- package/progress.d.ts +0 -1
- package/progress.d.ts.map +1 -1
- package/progress.js.map +1 -1
- package/range.d.ts +0 -1
- package/range.d.ts.map +1 -1
- package/range.js.map +1 -1
- package/rotate.d.ts +0 -1
- package/rotate.d.ts.map +1 -1
- package/rotate.js.map +1 -1
- package/router.d.ts +0 -1
- package/router.d.ts.map +1 -1
- package/router.js.map +1 -1
- package/select.d.ts +0 -1
- package/select.d.ts.map +1 -1
- package/select.js.map +1 -1
- package/skeleton.d.ts +0 -1
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js.map +1 -1
- package/split.d.ts +0 -1
- package/split.d.ts.map +1 -1
- package/split.js.map +1 -1
- package/src/internal/global-style.ts +2 -2
- package/src/internal/popover.ts +9 -9
- package/src/web-components/alert/component.ts +6 -14
- package/src/web-components/breath/component.ts +1 -1
- package/src/web-components/button/component.ts +6 -12
- package/src/web-components/card/component.ts +1 -2
- package/src/web-components/input/component.ts +4 -4
- package/src/web-components/router/component.ts +12 -12
- package/src/web-components/select/component.ts +1 -0
- package/src/web-components/skeleton/component.ts +2 -2
- package/src/web-components/tabs/component.ts +1 -1
- package/src/web-components/time/component.ts +1 -1
- package/switch.d.ts +0 -1
- package/switch.d.ts.map +1 -1
- package/switch.js.map +1 -1
- package/tabs.d.ts +0 -1
- package/tabs.d.ts.map +1 -1
- package/tabs.js.map +1 -1
- package/text.d.ts +0 -1
- package/text.d.ts.map +1 -1
- package/text.js.map +1 -1
- package/time.d.ts +0 -1
- package/time.d.ts.map +1 -1
- package/time.js.map +1 -1
- package/tooltip.d.ts +0 -1
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +0 -1
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js.map +1 -1
- package/web-components/alert/component.d.ts +20 -21
- package/web-components/alert/component.d.ts.map +1 -1
- package/web-components/alert/component.js +1 -1
- package/web-components/alert/component.js.map +1 -1
- package/web-components/alert/definition.d.ts +3 -4
- package/web-components/alert/definition.d.ts.map +1 -1
- package/web-components/alert/definition.js +1 -1
- package/web-components/alert/definition.js.map +1 -1
- package/web-components/avatar/component.d.ts +25 -26
- package/web-components/avatar/component.d.ts.map +1 -1
- package/web-components/avatar/component.js +1 -1
- package/web-components/avatar/component.js.map +1 -1
- package/web-components/avatar/definition.d.ts +3 -4
- package/web-components/avatar/definition.d.ts.map +1 -1
- package/web-components/avatar/definition.js +1 -1
- package/web-components/avatar/definition.js.map +1 -1
- package/web-components/badge/component.d.ts +7 -8
- package/web-components/badge/component.d.ts.map +1 -1
- package/web-components/badge/component.js +2 -1
- package/web-components/badge/component.js.map +1 -1
- package/web-components/badge/definition.d.ts +3 -4
- package/web-components/badge/definition.d.ts.map +1 -1
- package/web-components/badge/definition.js +1 -1
- package/web-components/badge/definition.js.map +1 -1
- package/web-components/breath/component.d.ts +28 -29
- package/web-components/breath/component.d.ts.map +1 -1
- package/web-components/breath/component.js +1 -1
- package/web-components/breath/component.js.map +1 -1
- package/web-components/breath/definition.d.ts +3 -4
- package/web-components/breath/definition.d.ts.map +1 -1
- package/web-components/breath/definition.js +1 -1
- package/web-components/breath/definition.js.map +1 -1
- package/web-components/button/component.d.ts +35 -36
- package/web-components/button/component.d.ts.map +1 -1
- package/web-components/button/component.js +1 -1
- package/web-components/button/component.js.map +1 -1
- package/web-components/button/definition.d.ts +3 -4
- package/web-components/button/definition.d.ts.map +1 -1
- package/web-components/button/definition.js +1 -1
- package/web-components/button/definition.js.map +1 -1
- package/web-components/card/component.d.ts +21 -22
- package/web-components/card/component.d.ts.map +1 -1
- package/web-components/card/component.js +1 -1
- package/web-components/card/component.js.map +1 -1
- package/web-components/card/definition.d.ts +3 -4
- package/web-components/card/definition.d.ts.map +1 -1
- package/web-components/card/definition.js +1 -1
- package/web-components/card/definition.js.map +1 -1
- package/web-components/carousel/component.d.ts +32 -33
- package/web-components/carousel/component.d.ts.map +1 -1
- package/web-components/carousel/component.js +2 -1
- package/web-components/carousel/component.js.map +1 -1
- package/web-components/carousel/definition.d.ts +3 -4
- package/web-components/carousel/definition.d.ts.map +1 -1
- package/web-components/carousel/definition.js +1 -1
- package/web-components/carousel/definition.js.map +1 -1
- package/web-components/chip/component.d.ts +21 -22
- package/web-components/chip/component.d.ts.map +1 -1
- package/web-components/chip/component.js +1 -1
- package/web-components/chip/component.js.map +1 -1
- package/web-components/chip/definition.d.ts +3 -4
- package/web-components/chip/definition.d.ts.map +1 -1
- package/web-components/chip/definition.js +1 -1
- package/web-components/chip/definition.js.map +1 -1
- package/web-components/details/component.d.ts +16 -17
- package/web-components/details/component.d.ts.map +1 -1
- package/web-components/details/component.js +1 -1
- package/web-components/details/component.js.map +1 -1
- package/web-components/details/definition.d.ts +3 -4
- package/web-components/details/definition.d.ts.map +1 -1
- package/web-components/details/definition.js +1 -1
- package/web-components/details/definition.js.map +1 -1
- package/web-components/dialog/component.d.ts +30 -31
- package/web-components/dialog/component.d.ts.map +1 -1
- package/web-components/dialog/component.js +1 -1
- package/web-components/dialog/component.js.map +1 -1
- package/web-components/dialog/definition.d.ts +3 -4
- package/web-components/dialog/definition.d.ts.map +1 -1
- package/web-components/dialog/definition.js +1 -1
- package/web-components/dialog/definition.js.map +1 -1
- package/web-components/divider/component.d.ts +9 -10
- package/web-components/divider/component.d.ts.map +1 -1
- package/web-components/divider/component.js +1 -1
- package/web-components/divider/component.js.map +1 -1
- package/web-components/divider/definition.d.ts +3 -4
- package/web-components/divider/definition.d.ts.map +1 -1
- package/web-components/divider/definition.js +1 -1
- package/web-components/divider/definition.js.map +1 -1
- package/web-components/dragbox/component.d.ts +31 -32
- package/web-components/dragbox/component.d.ts.map +1 -1
- package/web-components/dragbox/component.js +2 -1
- package/web-components/dragbox/component.js.map +1 -1
- package/web-components/dragbox/definition.d.ts +3 -4
- package/web-components/dragbox/definition.d.ts.map +1 -1
- package/web-components/dragbox/definition.js +1 -1
- package/web-components/dragbox/definition.js.map +1 -1
- package/web-components/flex/component.d.ts +26 -27
- package/web-components/flex/component.d.ts.map +1 -1
- package/web-components/flex/component.js +2 -1
- package/web-components/flex/component.js.map +1 -1
- package/web-components/flex/definition.d.ts +3 -4
- package/web-components/flex/definition.d.ts.map +1 -1
- package/web-components/flex/definition.js +1 -1
- package/web-components/flex/definition.js.map +1 -1
- package/web-components/form/component.d.ts +16 -17
- package/web-components/form/component.d.ts.map +1 -1
- package/web-components/form/component.js +2 -1
- package/web-components/form/component.js.map +1 -1
- package/web-components/form/definition.d.ts +3 -4
- package/web-components/form/definition.d.ts.map +1 -1
- package/web-components/form/definition.js +1 -1
- package/web-components/form/definition.js.map +1 -1
- package/web-components/grid/component.d.ts +30 -31
- package/web-components/grid/component.d.ts.map +1 -1
- package/web-components/grid/component.js +2 -1
- package/web-components/grid/component.js.map +1 -1
- package/web-components/grid/definition.d.ts +3 -4
- package/web-components/grid/definition.d.ts.map +1 -1
- package/web-components/grid/definition.js +1 -1
- package/web-components/grid/definition.js.map +1 -1
- package/web-components/heading/component.d.ts +23 -24
- package/web-components/heading/component.d.ts.map +1 -1
- package/web-components/heading/component.js +2 -1
- package/web-components/heading/component.js.map +1 -1
- package/web-components/heading/definition.d.ts +3 -4
- package/web-components/heading/definition.d.ts.map +1 -1
- package/web-components/heading/definition.js +1 -1
- package/web-components/heading/definition.js.map +1 -1
- package/web-components/input/component.d.ts +17 -18
- package/web-components/input/component.d.ts.map +1 -1
- package/web-components/input/component.js +1 -1
- package/web-components/input/component.js.map +1 -1
- package/web-components/input/definition.d.ts +3 -4
- package/web-components/input/definition.d.ts.map +1 -1
- package/web-components/input/definition.js +1 -1
- package/web-components/input/definition.js.map +1 -1
- package/web-components/layout/component.d.ts +18 -19
- package/web-components/layout/component.d.ts.map +1 -1
- package/web-components/layout/component.js +2 -1
- package/web-components/layout/component.js.map +1 -1
- package/web-components/layout/definition.d.ts +3 -4
- package/web-components/layout/definition.d.ts.map +1 -1
- package/web-components/layout/definition.js +1 -1
- package/web-components/layout/definition.js.map +1 -1
- package/web-components/link/component.d.ts +54 -55
- package/web-components/link/component.d.ts.map +1 -1
- package/web-components/link/component.js +2 -1
- package/web-components/link/component.js.map +1 -1
- package/web-components/link/definition.d.ts +3 -4
- package/web-components/link/definition.d.ts.map +1 -1
- package/web-components/link/definition.js +1 -1
- package/web-components/link/definition.js.map +1 -1
- package/web-components/popover/component.d.ts +28 -29
- package/web-components/popover/component.d.ts.map +1 -1
- package/web-components/popover/component.js +2 -1
- package/web-components/popover/component.js.map +1 -1
- package/web-components/popover/definition.d.ts +3 -4
- package/web-components/popover/definition.d.ts.map +1 -1
- package/web-components/popover/definition.js +1 -1
- package/web-components/popover/definition.js.map +1 -1
- package/web-components/progress/component.d.ts +8 -9
- package/web-components/progress/component.d.ts.map +1 -1
- package/web-components/progress/component.js +1 -1
- package/web-components/progress/component.js.map +1 -1
- package/web-components/progress/definition.d.ts +3 -4
- package/web-components/progress/definition.d.ts.map +1 -1
- package/web-components/progress/definition.js +1 -1
- package/web-components/progress/definition.js.map +1 -1
- package/web-components/range/component.d.ts +108 -109
- package/web-components/range/component.d.ts.map +1 -1
- package/web-components/range/component.js +1 -1
- package/web-components/range/component.js.map +1 -1
- package/web-components/range/definition.d.ts +3 -4
- package/web-components/range/definition.d.ts.map +1 -1
- package/web-components/range/definition.js +1 -1
- package/web-components/range/definition.js.map +1 -1
- package/web-components/rotate/component.d.ts +22 -23
- package/web-components/rotate/component.d.ts.map +1 -1
- package/web-components/rotate/component.js +1 -1
- package/web-components/rotate/component.js.map +1 -1
- package/web-components/rotate/definition.d.ts +3 -4
- package/web-components/rotate/definition.d.ts.map +1 -1
- package/web-components/rotate/definition.js +1 -1
- package/web-components/rotate/definition.js.map +1 -1
- package/web-components/router/component.d.ts +99 -100
- package/web-components/router/component.d.ts.map +1 -1
- package/web-components/router/component.js +2 -1
- package/web-components/router/component.js.map +1 -1
- package/web-components/router/definition.d.ts +3 -4
- package/web-components/router/definition.d.ts.map +1 -1
- package/web-components/router/definition.js +1 -1
- package/web-components/router/definition.js.map +1 -1
- package/web-components/select/component.d.ts +30 -31
- package/web-components/select/component.d.ts.map +1 -1
- package/web-components/select/component.js +2 -1
- package/web-components/select/component.js.map +1 -1
- package/web-components/select/definition.d.ts +3 -4
- package/web-components/select/definition.d.ts.map +1 -1
- package/web-components/select/definition.js +1 -1
- package/web-components/select/definition.js.map +1 -1
- package/web-components/skeleton/component.d.ts +11 -12
- package/web-components/skeleton/component.d.ts.map +1 -1
- package/web-components/skeleton/component.js +1 -1
- package/web-components/skeleton/component.js.map +1 -1
- package/web-components/skeleton/definition.d.ts +3 -4
- package/web-components/skeleton/definition.d.ts.map +1 -1
- package/web-components/skeleton/definition.js +1 -1
- package/web-components/skeleton/definition.js.map +1 -1
- package/web-components/split/component.d.ts +48 -49
- package/web-components/split/component.d.ts.map +1 -1
- package/web-components/split/component.js +1 -1
- package/web-components/split/component.js.map +1 -1
- package/web-components/split/definition.d.ts +3 -4
- package/web-components/split/definition.d.ts.map +1 -1
- package/web-components/split/definition.js +1 -1
- package/web-components/split/definition.js.map +1 -1
- package/web-components/switch/component.d.ts +20 -21
- package/web-components/switch/component.d.ts.map +1 -1
- package/web-components/switch/component.js +1 -1
- package/web-components/switch/component.js.map +1 -1
- package/web-components/switch/definition.d.ts +3 -4
- package/web-components/switch/definition.d.ts.map +1 -1
- package/web-components/switch/definition.js +1 -1
- package/web-components/switch/definition.js.map +1 -1
- package/web-components/tabs/component.d.ts +39 -40
- package/web-components/tabs/component.d.ts.map +1 -1
- package/web-components/tabs/component.js +1 -1
- package/web-components/tabs/component.js.map +1 -1
- package/web-components/tabs/definition.d.ts +3 -4
- package/web-components/tabs/definition.d.ts.map +1 -1
- package/web-components/tabs/definition.js +1 -1
- package/web-components/tabs/definition.js.map +1 -1
- package/web-components/text/component.d.ts +10 -11
- package/web-components/text/component.d.ts.map +1 -1
- package/web-components/text/component.js +1 -1
- package/web-components/text/component.js.map +1 -1
- package/web-components/text/definition.d.ts +3 -4
- package/web-components/text/definition.d.ts.map +1 -1
- package/web-components/text/definition.js +1 -1
- package/web-components/text/definition.js.map +1 -1
- package/web-components/time/component.d.ts +28 -29
- package/web-components/time/component.d.ts.map +1 -1
- package/web-components/time/component.js +1 -1
- package/web-components/time/component.js.map +1 -1
- package/web-components/time/definition.d.ts +3 -4
- package/web-components/time/definition.d.ts.map +1 -1
- package/web-components/time/definition.js +1 -1
- package/web-components/time/definition.js.map +1 -1
- package/web-components/tooltip/component.d.ts +19 -20
- package/web-components/tooltip/component.d.ts.map +1 -1
- package/web-components/tooltip/component.js +1 -1
- package/web-components/tooltip/component.js.map +1 -1
- package/web-components/tooltip/definition.d.ts +3 -4
- package/web-components/tooltip/definition.d.ts.map +1 -1
- package/web-components/tooltip/definition.js +1 -1
- package/web-components/tooltip/definition.js.map +1 -1
- package/web-components/typewriter/component.d.ts +43 -44
- package/web-components/typewriter/component.d.ts.map +1 -1
- package/web-components/typewriter/component.js +1 -1
- package/web-components/typewriter/component.js.map +1 -1
- package/web-components/typewriter/definition.d.ts +3 -4
- package/web-components/typewriter/definition.d.ts.map +1 -1
- package/web-components/typewriter/definition.js +1 -1
- package/web-components/typewriter/definition.js.map +1 -1
- package/web-types.json +1 -1
@@ -1,36 +1,35 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
4
|
+
* {@linkcode Breath} render the text with a breathing effect.
|
5
|
+
*
|
6
|
+
* Dynamically generate a breathing effect based on the length of the split text.
|
7
|
+
*
|
8
|
+
* If there is not enough CSS variable, overrun elements will use the.
|
9
|
+
*
|
10
|
+
* godown was a css library in its earliest days,
|
11
|
+
* and this is the component version of its first effect.
|
12
|
+
*
|
13
|
+
* Inspired by Vercel home page (2023).
|
14
|
+
*
|
15
|
+
* @slot - Breathing parts.
|
16
|
+
* @category effect
|
17
|
+
*/
|
18
18
|
declare class Breath extends GlobalStyle {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
19
|
+
/**
|
20
|
+
* Strings or array of strings,
|
21
|
+
* if array, divided each element into chunks,
|
22
|
+
* otherwise split strings by whitespace.
|
23
|
+
*/
|
24
|
+
content: string | string[];
|
25
|
+
/**
|
26
|
+
* Effect duration.
|
27
|
+
*/
|
28
|
+
duration: number;
|
29
|
+
protected render(): TemplateResult<1>;
|
30
|
+
protected _renderText(text: string): TemplateResult<1>;
|
31
|
+
protected getTexts(): string[];
|
32
|
+
protected _computeStyle(len: number): string;
|
33
33
|
}
|
34
34
|
export default Breath;
|
35
35
|
export { Breath };
|
36
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAA+C,gCAAiC;;;;;;;;;;;;;;;;AAsBzF,cAqEM,eAAe,YAAY;;;;;;CAM/B,AACA;;;;CAKA,AACA;CAEA,UAAU,UAAU,eAAe;CAYnC,UAAU,YAAYA,eAAe,eAAe;CASpD,UAAU;CAMV,UAAU,cAAcC;AAazB;AAED,eAAe;AACf,SAAS","names":["text: string","len: number"],"sources":["../../../src/web-components/breath/component.ts"],"sourcesContent":["import { attr, godown, htmlStyle, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst defineName = \"breath\";\nconst cssScope = scopePrefix(defineName);\n\nconst splitTextRegexp = /[\\s,]+/;\n\n/**\n * {@linkcode Breath} render the text with a breathing effect.\n *\n * Dynamically generate a breathing effect based on the length of the split text.\n *\n * If there is not enough CSS variable, overrun elements will use the.\n *\n * godown was a css library in its earliest days,\n * and this is the component version of its first effect.\n *\n * Inspired by Vercel home page (2023).\n *\n * @slot - Breathing parts.\n * @category effect\n */\n@godown(defineName)\n@styles(\n css`\n :host {\n ${cssScope}--deg: 60deg;\n ${cssScope}--1-1: hsl(0 70% 55%);\n ${cssScope}--1-2: hsl(30 90% 60%);\n ${cssScope}--2-1: hsl(130 70% 50%);\n ${cssScope}--2-2: hsl(180 60% 40%);\n ${cssScope}--3-1: hsl(270 80% 55%);\n ${cssScope}--3-2: hsl(210 90% 50%);\n ${cssScope}--1: linear-gradient(var(${cssScope}--deg), var(${cssScope}--1-1), var(${cssScope}--1-2));\n ${cssScope}--2: linear-gradient(var(${cssScope}--deg), var(${cssScope}--2-1), var(${cssScope}--2-2));\n ${cssScope}--3: linear-gradient(var(${cssScope}--deg), var(${cssScope}--3-1), var(${cssScope}--3-2));\n }\n `,\n css`\n :host {\n margin: auto;\n width: fit-content;\n font-size: 2em;\n align-items: center;\n direction: ltr;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n ::selection {\n background: none;\n }\n\n .rel {\n position: relative;\n font-weight: 800;\n font-size: inherit;\n letter-spacing: -0.05em;\n }\n `,\n css`\n .nocolor,\n .colorful {\n padding: 0 0.05em;\n box-sizing: border-box;\n display: inline-block;\n animation-iteration-count: infinite;\n color: transparent;\n -webkit-background-clip: text !important;\n background-clip: text !important;\n }\n\n .colorful {\n opacity: 0;\n animation-name: colorfulN;\n }\n\n .nocolor {\n position: absolute;\n top: 0;\n background: var(${cssGlobalVars.backgroundClip});\n }\n `,\n)\nclass Breath extends GlobalStyle {\n /**\n * Strings or array of strings,\n * if array, divided each element into chunks,\n * otherwise split strings by whitespace.\n */\n @property()\n content: string | string[];\n\n /**\n * Effect duration.\n */\n @property({ type: Number })\n duration: number;\n\n protected render(): TemplateResult<1> {\n const texts = this.getTexts();\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[texts.map(this._renderText), htmlStyle(this._computeStyle(texts.length))]}\n </div>\n `;\n }\n\n protected _renderText(text: string): TemplateResult<1> {\n return html`\n <span class=\"rel\">\n <span class=\"nocolor\">${text}</span>\n <span class=\"colorful\">${text}</span>\n </span>\n `;\n }\n\n protected getTexts(): string[] {\n return Array.isArray(this.content)\n ? this.content\n : (this.content || this.textContent).split(splitTextRegexp).filter((x) => x);\n }\n\n protected _computeStyle(len: number): string {\n const gap = 100 / 2 / len;\n const duration = this.duration || (len * 2 + 2) * 1000;\n let style1 = \"\";\n for (let number = 1; number <= len; number++) {\n const delay = (-duration / len) * (len - number + 1);\n const defaultNumber = ((number - 1) % 3) + 1;\n style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}ms;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;\n }\n return `.colorful{animation-duration:${duration}ms;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${\n gap * 2\n }%{opacity:1;}}${style1}`;\n }\n}\n\nexport default Breath;\nexport { Breath };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,attr,htmlStyle}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const defineName=`breath`,cssScope=scopePrefix(defineName),splitTextRegexp=/[\s,]+/;let Breath=class e extends GlobalStyle{render(){let e=this.getTexts();return html`<div part="root" ${attr(this.observedRecord)}> ${[e.map(this._renderText),htmlStyle(this._computeStyle(e.length))]} </div>`}_renderText(e){return html`<span class="rel"> <span class="nocolor">${e}</span> <span class="colorful">${e}</span> </span>`}getTexts(){return Array.isArray(this.content)?this.content:(this.content||this.textContent).split(splitTextRegexp).filter(e=>e)}_computeStyle(e){let d=100/2/e,f=this.duration||(e*2+2)*1e3,p=``;for(let d=1;d<=e;d++){let m=-f/e*(e-d+1),h=(d-1)%3+1;p+=`.rel:nth-child(${d}) .colorful{animation-delay:${m}ms;background:var(${cssScope}--${d},var(${cssScope}--${h}));}`}return`.colorful{animation-duration:${f}ms;}@keyframes colorfulN{0%,${d*3}%{opacity:0;}${d}%,${d*2}%{opacity:1;}}${p}`}};_decorate([property()],Breath.prototype,`content`,void 0),_decorate([property({type:Number})],Breath.prototype,`duration`,void 0),Breath=_decorate([godown(defineName),styles(css`:host{${cssScope}--deg:60deg;${cssScope}--1-1:hsl(0 70% 55%);${cssScope}--1-2:hsl(30 90% 60%);${cssScope}--2-1:hsl(130 70% 50%);${cssScope}--2-2:hsl(180 60% 40%);${cssScope}--3-1:hsl(270 80% 55%);${cssScope}--3-2:hsl(210 90% 50%);${cssScope}--1:linear-gradient(var(${cssScope}--deg),var(${cssScope}--1-1),var(${cssScope}--1-2));${cssScope}--2:linear-gradient(var(${cssScope}--deg),var(${cssScope}--2-1),var(${cssScope}--2-2));${cssScope}--3:linear-gradient(var(${cssScope}--deg),var(${cssScope}--3-1),var(${cssScope}--3-2))}`,css`:host{margin:auto;width:-moz-fit-content;width:fit-content;font-size:2em;align-items:center;direction:ltr}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}::selection{background:0 0}.rel{position:relative;font-weight:800;font-size:inherit;letter-spacing:-.05em} `,css`.nocolor,.colorful{padding:0 .05em;box-sizing:border-box;display:inline-block;animation-iteration-count:infinite;color:transparent;-webkit-background-clip:text!important;background-clip:text!important}.colorful{opacity:0;animation-name:colorfulN}.nocolor{position:absolute;top:0;background:var(${cssGlobalVars.backgroundClip})}`)],Breath);var Breath$1=Breath;export{Breath,Breath$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/breath/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/breath/component.ts"],"sourcesContent":["import { attr, godown, htmlStyle, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst defineName = \"breath\";\nconst cssScope = scopePrefix(defineName);\n\nconst splitTextRegexp = /[\\s,]+/;\n\n/**\n * {@linkcode Breath} render the text with a breathing effect.\n *\n * Dynamically generate a breathing effect based on the length of the split text.\n *\n * If there is not enough CSS variable, overrun elements will use the.\n *\n * godown was a css library in its earliest days,\n * and this is the component version of its first effect.\n *\n * Inspired by Vercel home page (2023).\n *\n * @slot - Breathing parts.\n * @category effect\n */\n@godown(defineName)\n@styles(\n css`\n :host {\n ${cssScope}--deg: 60deg;\n ${cssScope}--1-1: hsl(0 70% 55%);\n ${cssScope}--1-2: hsl(30 90% 60%);\n ${cssScope}--2-1: hsl(130 70% 50%);\n ${cssScope}--2-2: hsl(180 60% 40%);\n ${cssScope}--3-1: hsl(270 80% 55%);\n ${cssScope}--3-2: hsl(210 90% 50%);\n ${cssScope}--1: linear-gradient(var(${cssScope}--deg), var(${cssScope}--1-1), var(${cssScope}--1-2));\n ${cssScope}--2: linear-gradient(var(${cssScope}--deg), var(${cssScope}--2-1), var(${cssScope}--2-2));\n ${cssScope}--3: linear-gradient(var(${cssScope}--deg), var(${cssScope}--3-1), var(${cssScope}--3-2));\n }\n `,\n css`\n :host {\n margin: auto;\n width: fit-content;\n font-size: 2em;\n align-items: center;\n direction: ltr;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n ::selection {\n background: none;\n }\n\n .rel {\n position: relative;\n font-weight: 800;\n font-size: inherit;\n letter-spacing: -0.05em;\n }\n `,\n css`\n .nocolor,\n .colorful {\n padding: 0 0.05em;\n box-sizing: border-box;\n display: inline-block;\n animation-iteration-count: infinite;\n color: transparent;\n -webkit-background-clip: text !important;\n background-clip: text !important;\n }\n\n .colorful {\n opacity: 0;\n animation-name: colorfulN;\n }\n\n .nocolor {\n position: absolute;\n top: 0;\n background: var(${cssGlobalVars.backgroundClip});\n }\n `,\n)\nclass Breath extends GlobalStyle {\n /**\n * Strings or array of strings,\n * if array, divided each element into chunks,\n * otherwise split strings by whitespace.\n */\n @property()\n content: string | string[];\n\n /**\n * Effect duration.\n */\n @property({ type: Number })\n duration: number;\n\n protected render(): TemplateResult<1> {\n const texts = this.getTexts();\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[texts.map(this._renderText), htmlStyle(this._computeStyle(texts.length))]}\n </div>\n `;\n }\n\n protected _renderText(text: string): TemplateResult<1> {\n return html`\n <span class=\"rel\">\n <span class=\"nocolor\">${text}</span>\n <span class=\"colorful\">${text}</span>\n </span>\n `;\n }\n\n protected getTexts(): string[] {\n return Array.isArray(this.content)\n ? this.content\n : (this.content || this.textContent).split(splitTextRegexp).filter((x) => x);\n }\n\n protected _computeStyle(len: number): string {\n const gap = 100 / 2 / len;\n const duration = this.duration || (len * 2 + 2) * 1000;\n let style1 = \"\";\n for (let number = 1; number <= len; number++) {\n const delay = (-duration / len) * (len - number + 1);\n const defaultNumber = ((number - 1) % 3) + 1;\n style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}ms;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;\n }\n return `.colorful{animation-duration:${duration}ms;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${\n gap * 2\n }%{opacity:1;}}${style1}`;\n }\n}\n\nexport default Breath;\nexport { Breath };\n"],"names":["Breath","texts","text: string","text","x","len: number","gap","len","duration","style1","number","delay","defaultNumber"],"mappings":"2QAMA,MAAM,WAAa,SACb,SAAW,YAAY,WAAW,CAElC,gBAAkB,SAiBxB,IAAA,OAAA,MAqEMA,UAAe,WAAY,CAerB,QAA4B,CACpC,IAAMC,EAAQ,KAAK,UAAU,CAC7B,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,CAAC,EAAM,IAAI,KAAK,YAAY,CAAE,UAAU,KAAK,cAAcA,EAAM,OAAO,CAAC,AAAC,EAAA,OAEhF,CAAC,AACF,CAES,YAAYC,EAAiC,CACrD,MAAO,KAAI,CAAA,yCAEe,EAAEC,EAAK,+BACN,EAAEA,EAAK,eAElC,CAAC,AACF,CAES,UAAqB,CAC7B,MAAO,OAAM,QAAQ,KAAK,QAAQ,CAC9B,KAAK,QACL,CAAC,KAAK,SAAW,KAAK,aAAa,MAAM,gBAAgB,CAAC,OAAO,AAACC,GAAMA,EAAE,AAC/E,CAES,cAAcC,EAAqB,CAC3C,IAAMC,EAAM,IAAM,EAAIC,EAChBC,EAAW,KAAK,WAAaD,EAAM,EAAI,GAAK,IAC9CE,EAAS,GACb,IAAK,IAAIC,EAAS,EAAGA,GAAUH,EAAKG,IAAU,CAC5C,IAAMC,GAAUH,EAAWD,GAAQA,EAAMG,EAAS,GAC5CE,GAAkBF,EAAS,GAAK,EAAK,EAC3C,GAAU,CAAC,eAAe,EAAEA,EAAO,4BAA4B,EAAEC,EAAM,kBAAkB,EAAE,SAAS,EAAE,EAAED,EAAO,KAAK,EAAE,SAAS,EAAE,EAAEE,EAAc,IAAI,CAAC,AACvJ,CACD,MAAO,CAAC,6BAA6B,EAAEJ,EAAS,4BAA4B,EAAEF,EAAM,EAAE,aAAa,EAAEA,EAAI,EAAE,EACzGA,EAAM,EACP,cAAc,EAAEG,GAAQ,AAC1B,CACF,EA5HA,WA2EE,UAAU,AAAA,EAAA,OAAA,UAAA,iBAAA,YAMV,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,OAAA,UAAA,kBAAA,CAjF5B,OAAA,UAAA,CAAA,OAAO,WAAW,CAClB,OACC,GAAG,CAAC,MAEA,EAAE,SAAS,YACX,EAAE,SAAS,qBACX,EAAE,SAAS,sBACX,EAAE,SAAS,uBACX,EAAE,SAAS,uBACX,EAAE,SAAS,uBACX,EAAE,SAAS,uBACX,EAAE,SAAS,wBAAyB,EAAE,SAAS,WAAY,EAAE,SAAS,WAAY,EAAE,SAAS,QAC7F,EAAE,SAAS,wBAAyB,EAAE,SAAS,WAAY,EAAE,SAAS,WAAY,EAAE,SAAS,QAC7F,EAAE,SAAS,wBAAyB,EAAE,SAAS,WAAY,EAAE,SAAS,WAAY,EAAE,SAAS,QAEjG,CAAC,CACD,GAAG,CAAC,mSA4BJ,CAAC,CACD,GAAG,CAAC,sSAoBgB,EAAE,cAAc,eAAe,EAEnD,CAAC,CACF,AAAA,EAAA,OAAA,CA0DD,IAAA,SAAe"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import Breath from "./component.js";
|
2
2
|
export default Breath;
|
3
3
|
declare global {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
interface HTMLElementTagNameMap {
|
5
|
+
"godown-breath": Breath;
|
6
|
+
}
|
7
7
|
}
|
8
|
-
//# sourceMappingURL=definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../src/web-components/breath/definition.ts"],"sourcesContent":["import Breath from \"./component.js\";\n\nBreath.define();\n\nexport default Breath;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-breath\": Breath;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Breath from"./component.js";Breath.define();export{Breath as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/breath/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/breath/definition.ts"],"sourcesContent":["import Breath from \"./component.js\";\n\nBreath.define();\n\nexport default Breath;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-breath\": Breath;\n }\n}\n"],"names":[],"mappings":"mCAEA,OAAO,QAAQ"}
|
@@ -1,43 +1,42 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
* {@linkcode Button} renders a button.
|
5
|
+
*
|
6
|
+
* Create modal animation upon clicking.
|
7
|
+
*
|
8
|
+
* @slot - The content of the button.
|
9
|
+
* @category input
|
10
|
+
*/
|
11
11
|
declare class Button extends GlobalStyle {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
12
|
+
/**
|
13
|
+
* If true, remove gradient, modal animation, focus scale.
|
14
|
+
*/
|
15
|
+
plain: boolean;
|
16
|
+
/**
|
17
|
+
* Whether this element is disabled or not.
|
18
|
+
*/
|
19
|
+
disabled: boolean;
|
20
|
+
/**
|
21
|
+
* Whether this element is active or not.
|
22
|
+
*/
|
23
|
+
active: boolean;
|
24
|
+
/**
|
25
|
+
* Display rounded.
|
26
|
+
*/
|
27
|
+
round: boolean;
|
28
|
+
/**
|
29
|
+
* Content text.
|
30
|
+
*/
|
31
|
+
content: string;
|
32
|
+
protected _modalRoot: HTMLElement;
|
33
|
+
protected _root: HTMLElement;
|
34
|
+
protected render(): TemplateResult<1>;
|
35
|
+
focus(): void;
|
36
|
+
blur(): void;
|
37
|
+
connectedCallback(): void;
|
38
|
+
protected _handelClick(e: MouseEvent): void;
|
39
|
+
protected _handleModal(e: MouseEvent): void;
|
40
40
|
}
|
41
41
|
export default Button;
|
42
42
|
export { Button };
|
43
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAA+C,gCAAiC;;;;;;;;;AAazF,cA0DM,eAAe,YAAY;;;;CAI/B,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;CAEA,UACU,YAAY;CACtB,UACU,OAAO;CAEjB,UAAU,UAAU,eAAe;CAYnC;CAQA;CAKA;CAKA,UAAU,aAAaA,GAAG;CAW1B,UAAU,aAAaA,GAAG;AA6B3B;AAED,eAAe;AACf,SAAS","names":["e: MouseEvent"],"sources":["../../../src/web-components/button/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, queryPart, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst protoName = \"button\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Button} renders a button.\n *\n * Create modal animation upon clicking.\n *\n * @slot - The content of the button.\n * @category input\n */\n@godown(protoName)\n@styles(\n css`\n :host(:not([disabled]):active) {\n transform: scale(var(${cssScope}--focus-scale));\n }\n\n :host([round]) {\n border-radius: calc(infinity * 1px);\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n filter: brightness(0.85);\n }\n\n :host([plain]) {\n ${cssScope}--gradients: unset;\n ${cssScope}--focus-scale: unset;\n }\n `,\n css`\n :host {\n ${cssScope}--modal-animation-duration: 1.5s;\n ${cssScope}--focus-scale: .97;\n ${cssScope}--deg: 45deg;\n color: var(${cssGlobalVars.primaryForeground});\n background: var(${cssGlobalVars.primaryBackground});\n display: inline-block;\n overflow: hidden;\n text-align: center;\n cursor: pointer;\n }\n\n [part=\"root\"] {\n padding-block: 0.25em;\n padding-inline: 1em;\n position: relative;\n user-select: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n i {\n position: absolute;\n inset: 0;\n opacity: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n visibility: visible;\n pointer-events: none;\n transform-origin: 0 0;\n background: currentColor;\n }\n `,\n)\nclass Button extends GlobalStyle {\n /**\n * If true, remove gradient, modal animation, focus scale.\n */\n @property({ type: Boolean, reflect: true })\n plain = false;\n\n /**\n * Whether this element is disabled or not.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether this element is active or not.\n */\n @property({ type: Boolean, reflect: true })\n active = false;\n\n /**\n * Display rounded.\n */\n @property({ type: Boolean, reflect: true })\n round = false;\n\n /**\n * Content text.\n */\n @property()\n content: string;\n\n @queryPart(\"modal-root\")\n protected _modalRoot: HTMLElement;\n @queryPart(\"root\")\n protected _root: HTMLElement;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot(\"\", this.content)}\n <span part=\"modal-root\"></span>\n </div>\n `;\n }\n\n focus(): void {\n if (this.disabled) {\n return;\n }\n this.active = true;\n super.focus();\n }\n\n blur(): void {\n this.active = false;\n super.blur();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.events.add(this, \"click\", this._handelClick);\n }\n\n protected _handelClick(e: MouseEvent): void {\n if (this.disabled) {\n e.stopPropagation();\n e.preventDefault();\n return;\n }\n if (!this.plain) {\n this._handleModal(e);\n }\n }\n\n protected _handleModal(e: MouseEvent): void {\n const modal = document.createElement(\"i\");\n const { width, height } = this.getBoundingClientRect();\n const { x, y } = this._root.getBoundingClientRect();\n const size = `${Math.sqrt(height ** 2 + width ** 2) * 2}px`;\n modal.style.height = size;\n modal.style.width = size;\n modal.style.left = `${e.x - x}px`;\n modal.style.top = `${e.y - y}px`;\n this._modalRoot.appendChild(modal);\n const keyframes = [\n {\n transform: \"scale(0) translate(-50%, -50%)\",\n opacity: 0.1,\n },\n {\n transform: \"scale(1) translate(-50%, -50%)\",\n offset: 0.8,\n },\n {\n opacity: 0,\n },\n ];\n modal.animate(keyframes, {\n duration: 800,\n iterations: 1,\n });\n modal.addEventListener(\"animationend\", () => modal.remove(), { once: true });\n }\n}\n\nexport default Button;\nexport { Button };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{queryPart,godown,styles,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`button`,cssScope=scopePrefix(protoName);let Button=class e extends GlobalStyle{constructor(...e){super(...e),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return html`<div part="root" ${attr(this.observedRecord)}> ${htmlSlot(``,this.content)} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,`click`,this._handelClick)}_handelClick(e){if(this.disabled){e.stopPropagation(),e.preventDefault();return}this.plain||this._handleModal(e)}_handleModal(e){let l=document.createElement(`i`),{width:u,height:d}=this.getBoundingClientRect(),{x:f,y:p}=this._root.getBoundingClientRect(),m=`${Math.sqrt(d**2+u**2)*2}px`;l.style.height=m,l.style.width=m,l.style.left=`${e.x-f}px`,l.style.top=`${e.y-p}px`,this._modalRoot.appendChild(l);let h=[{transform:`scale(0) translate(-50%, -50%)`,opacity:.1},{transform:`scale(1) translate(-50%, -50%)`,offset:.8},{opacity:0}];l.animate(h,{duration:800,iterations:1}),l.addEventListener(`animationend`,()=>l.remove(),{once:!0})}};_decorate([property({type:Boolean,reflect:!0})],Button.prototype,`plain`,void 0),_decorate([property({type:Boolean,reflect:!0})],Button.prototype,`disabled`,void 0),_decorate([property({type:Boolean,reflect:!0})],Button.prototype,`active`,void 0),_decorate([property({type:Boolean,reflect:!0})],Button.prototype,`round`,void 0),_decorate([property()],Button.prototype,`content`,void 0),_decorate([queryPart(`modal-root`)],Button.prototype,`_modalRoot`,void 0),_decorate([queryPart(`root`)],Button.prototype,`_root`,void 0),Button=_decorate([godown(protoName),styles(css`:host(:not([disabled]):active){transform:scale(var(${cssScope}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${cssScope}--gradients:unset;${cssScope}--focus-scale:unset}`,css`:host{${cssScope}--modal-animation-duration:1.5s;${cssScope}--focus-scale:.97;${cssScope}--deg:45deg;color:var(${cssGlobalVars.primaryForeground});background:var(${cssGlobalVars.primaryBackground});display:inline-block;overflow:hidden;text-align:center;cursor:pointer}[part=root]{padding-block:.25em;padding-inline:1em;position:relative;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center}i{position:absolute;inset:0;opacity:0;width:100%;height:100%;border-radius:50%;visibility:visible;pointer-events:none;transform-origin:0 0;background:currentColor}`)],Button);var Button$1=Button;export{Button,Button$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/button/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/button/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, queryPart, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst protoName = \"button\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Button} renders a button.\n *\n * Create modal animation upon clicking.\n *\n * @slot - The content of the button.\n * @category input\n */\n@godown(protoName)\n@styles(\n css`\n :host(:not([disabled]):active) {\n transform: scale(var(${cssScope}--focus-scale));\n }\n\n :host([round]) {\n border-radius: calc(infinity * 1px);\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n filter: brightness(0.85);\n }\n\n :host([plain]) {\n ${cssScope}--gradients: unset;\n ${cssScope}--focus-scale: unset;\n }\n `,\n css`\n :host {\n ${cssScope}--modal-animation-duration: 1.5s;\n ${cssScope}--focus-scale: .97;\n ${cssScope}--deg: 45deg;\n color: var(${cssGlobalVars.primaryForeground});\n background: var(${cssGlobalVars.primaryBackground});\n display: inline-block;\n overflow: hidden;\n text-align: center;\n cursor: pointer;\n }\n\n [part=\"root\"] {\n padding-block: 0.25em;\n padding-inline: 1em;\n position: relative;\n user-select: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n i {\n position: absolute;\n inset: 0;\n opacity: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n visibility: visible;\n pointer-events: none;\n transform-origin: 0 0;\n background: currentColor;\n }\n `,\n)\nclass Button extends GlobalStyle {\n /**\n * If true, remove gradient, modal animation, focus scale.\n */\n @property({ type: Boolean, reflect: true })\n plain = false;\n\n /**\n * Whether this element is disabled or not.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether this element is active or not.\n */\n @property({ type: Boolean, reflect: true })\n active = false;\n\n /**\n * Display rounded.\n */\n @property({ type: Boolean, reflect: true })\n round = false;\n\n /**\n * Content text.\n */\n @property()\n content: string;\n\n @queryPart(\"modal-root\")\n protected _modalRoot: HTMLElement;\n @queryPart(\"root\")\n protected _root: HTMLElement;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot(\"\", this.content)}\n <span part=\"modal-root\"></span>\n </div>\n `;\n }\n\n focus(): void {\n if (this.disabled) {\n return;\n }\n this.active = true;\n super.focus();\n }\n\n blur(): void {\n this.active = false;\n super.blur();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.events.add(this, \"click\", this._handelClick);\n }\n\n protected _handelClick(e: MouseEvent): void {\n if (this.disabled) {\n e.stopPropagation();\n e.preventDefault();\n return;\n }\n if (!this.plain) {\n this._handleModal(e);\n }\n }\n\n protected _handleModal(e: MouseEvent): void {\n const modal = document.createElement(\"i\");\n const { width, height } = this.getBoundingClientRect();\n const { x, y } = this._root.getBoundingClientRect();\n const size = `${Math.sqrt(height ** 2 + width ** 2) * 2}px`;\n modal.style.height = size;\n modal.style.width = size;\n modal.style.left = `${e.x - x}px`;\n modal.style.top = `${e.y - y}px`;\n this._modalRoot.appendChild(modal);\n const keyframes = [\n {\n transform: \"scale(0) translate(-50%, -50%)\",\n opacity: 0.1,\n },\n {\n transform: \"scale(1) translate(-50%, -50%)\",\n offset: 0.8,\n },\n {\n opacity: 0,\n },\n ];\n modal.animate(keyframes, {\n duration: 800,\n iterations: 1,\n });\n modal.addEventListener(\"animationend\", () => modal.remove(), { once: true });\n }\n}\n\nexport default Button;\nexport { Button };\n"],"names":["Button","e: MouseEvent","modal","size","height","width","x","y","keyframes"],"mappings":"oRAMA,MAAM,UAAY,SACZ,SAAW,YAAY,UAAU,CAUvC,IAAA,OAAA,MA0DMA,UAAe,WAAY,oCAK/B,OAAQ,OAMR,UAAW,OAMX,QAAS,OAMT,OAAQ,EAaE,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,SAAS,GAAI,KAAK,QAAQ,CAAA,uCAGhC,CAAC,AACF,CAED,OAAc,CACR,KAAK,WAGT,KAAK,QAAS,EACd,MAAM,OAAO,CACd,CAED,MAAa,CAEX,AADA,KAAK,QAAS,EACd,MAAM,MAAM,AACb,CAED,mBAA0B,CAExB,AADA,MAAM,mBAAmB,CACzB,KAAK,OAAO,IAAI,KAAM,QAAS,KAAK,aAAa,AAClD,CAES,aAAaC,EAAqB,CAC1C,GAAI,KAAK,SAAU,CAEjB,AADA,EAAE,iBAAiB,CACnB,EAAE,gBAAgB,CAClB,MACD,CACD,AAAK,KAAK,OACR,KAAK,aAAa,EAAE,AAEvB,CAES,aAAaA,EAAqB,CAC1C,IAAMC,EAAQ,SAAS,cAAc,IAAI,CACnC,CAAE,QAAO,SAAQ,CAAG,KAAK,uBAAuB,CAChD,CAAE,IAAG,IAAG,CAAG,KAAK,MAAM,uBAAuB,CAC7CC,EAAO,GAAG,KAAK,KAAKC,GAAU,EAAIC,GAAS,EAAE,CAAG,EAAE,EAAE,CAAC,CAK3D,AAJAH,EAAM,MAAM,OAASC,EACrBD,EAAM,MAAM,MAAQC,EACpBD,EAAM,MAAM,KAAO,GAAG,EAAE,EAAII,EAAE,EAAE,CAAC,CACjCJ,EAAM,MAAM,IAAM,GAAG,EAAE,EAAIK,EAAE,EAAE,CAAC,CAChC,KAAK,WAAW,YAAYL,EAAM,CAClC,IAAMM,EAAY,CAChB,CACE,UAAW,iCACX,QAAS,EACV,EACD,CACE,UAAW,iCACX,OAAQ,EACT,EACD,CACE,QAAS,CAAA,CAEZ,EAKD,AAJA,EAAM,QAAQA,EAAW,CACvB,SAAU,IACV,WAAY,CACb,EAAC,CACF,EAAM,iBAAiB,eAAgB,IAAM,EAAM,QAAQ,CAAE,CAAE,MAAM,CAAM,EAAC,AAC7E,CACF,EApKA,WA8DE,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,OAAA,UAAA,YAAA,GAAA,YAM1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,OAAA,UAAA,eAAA,GAAA,YAM1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,OAAA,UAAA,aAAA,GAAA,YAM1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,OAAA,UAAA,YAAA,GAAA,YAM1C,UAAU,AAAA,EAAA,OAAA,UAAA,iBAAA,CAGV,UAAA,CAAA,UAAU,aAAa,AAAA,EAAA,OAAA,UAAA,oBAAA,CAEvB,UAAA,CAAA,UAAU,OAAO,AAAA,EAAA,OAAA,UAAA,eAAA,CA3FnB,OAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OACC,GAAG,CAAC,mDAEqB,EAAE,SAAS,2IAahC,EAAE,SAAS,kBACX,EAAE,SAAS,oBAEf,CAAC,CACD,GAAG,CAAC,MAEA,EAAE,SAAS,gCACX,EAAE,SAAS,kBACX,EAAE,SAAS,sBACA,EAAE,cAAc,kBAAkB,iBAC7B,EAAE,cAAc,kBAAkB,wZA6BtD,CAAC,CACF,AAAA,EAAA,OAAA,CA6GD,IAAA,SAAe"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import Button from "./component.js";
|
2
2
|
export default Button;
|
3
3
|
declare global {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
interface HTMLElementTagNameMap {
|
5
|
+
"godown-button": Button;
|
6
|
+
}
|
7
7
|
}
|
8
|
-
//# sourceMappingURL=definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../src/web-components/button/definition.ts"],"sourcesContent":["import Button from \"./component.js\";\n\nButton.define();\n\nexport default Button;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-button\": Button;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Button from"./component.js";Button.define();export{Button as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/button/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/button/definition.ts"],"sourcesContent":["import Button from \"./component.js\";\n\nButton.define();\n\nexport default Button;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-button\": Button;\n }\n}\n"],"names":[],"mappings":"mCAEA,OAAO,QAAQ"}
|
@@ -2,29 +2,28 @@ import { type TemplateResult } from "lit";
|
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
import { type RingType } from "../../internal/ring.js";
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
* {@linkcode Card} renders a card.
|
6
|
+
*
|
7
|
+
* This may be similar to {@linkcode Layout},
|
8
|
+
* but it needs to be specified to enable header and footer.
|
9
|
+
*
|
10
|
+
* @slot - The main content of the card.
|
11
|
+
* @slot header - The header of the card.
|
12
|
+
* @slot footer - The footer of the card.
|
13
|
+
* @category display
|
14
|
+
*/
|
15
15
|
declare class Card extends GlobalStyle {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
16
|
+
constructor();
|
17
|
+
ringType: RingType;
|
18
|
+
/**
|
19
|
+
* Whether to display the header.
|
20
|
+
*/
|
21
|
+
footer: boolean;
|
22
|
+
/**
|
23
|
+
* Whether to display the footer.
|
24
|
+
*/
|
25
|
+
header: boolean;
|
26
|
+
protected render(): TemplateResult<1>;
|
27
27
|
}
|
28
28
|
export default Card;
|
29
29
|
export { Card };
|
30
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAA+C,gCAAiC;AAEzF,cAA8C,gBAAgB,wBAAyB;;;;;;;;;;;;AAgBvF,cA0BM,aAAa,YAAY;CAC7B;CAKA,AACA,UAAU;;;;CAKV,AACA;;;;CAKA,AACA;CAEA,UAAU,UAAU,eAAe;AAUpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../src/web-components/card/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport type Layout from \"../layout/component.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"card\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Card} renders a card.\n *\n * This may be similar to {@linkcode Layout},\n * but it needs to be specified to enable header and footer.\n *\n * @slot - The main content of the card.\n * @slot header - The header of the card.\n * @slot footer - The footer of the card.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n background: var(${cssGlobalVars.background});\n color: var(${cssGlobalVars.foreground});\n display: block;\n flex-shrink: 0;\n }\n\n slot {\n display: block;\n padding: 1em;\n }\n\n [part=\"root\"] {\n border-radius: inherit;\n }\n\n [name=\"footer\"] {\n padding-top: 0;\n }\n\n [name=\"header\"] {\n padding-bottom: 0;\n }\n`)\nclass Card extends GlobalStyle {\n constructor() {\n super();\n new StyleController(this, () => new RingBuilder({ type: this.ringType }).css);\n }\n\n @property({ attribute: ringTypeAttribute })\n ringType: RingType = \"border\";\n\n /**\n * Whether to display the header.\n */\n @property({ type: Boolean })\n footer = false;\n\n /**\n * Whether to display the footer.\n */\n @property({ type: Boolean })\n header = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[this.header ? htmlSlot(\"header\") : \"\", htmlSlot(), this.footer ? htmlSlot(\"footer\") : \"\"]}\n </div>\n `;\n }\n}\n\nexport default Card;\nexport { Card };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,StyleController,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import{ringTypeAttribute,RingBuilder}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`card`;scopePrefix(protoName);let Card=class e extends GlobalStyle{constructor(){super(),this.ringType=`border`,this.footer=!1,this.header=!1,new StyleController(this,()=>new RingBuilder({type:this.ringType}).css)}render(){return html`<div part="root" ${attr(this.observedRecord)}> ${[this.header?htmlSlot(`header`):``,htmlSlot(),this.footer?htmlSlot(`footer`):``]} </div>`}};_decorate([property({attribute:ringTypeAttribute})],Card.prototype,`ringType`,void 0),_decorate([property({type:Boolean})],Card.prototype,`footer`,void 0),_decorate([property({type:Boolean})],Card.prototype,`header`,void 0),Card=_decorate([godown(protoName),styles(css`:host{background:var(${cssGlobalVars.background});color:var(${cssGlobalVars.foreground});display:block;flex-shrink:0}slot{display:block;padding:1em}[part=root]{border-radius:inherit}[name=footer]{padding-top:0}[name=header]{padding-bottom:0}`)],Card);var Card$1=Card;export{Card,Card$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/card/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/card/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport type Layout from \"../layout/component.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"card\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Card} renders a card.\n *\n * This may be similar to {@linkcode Layout},\n * but it needs to be specified to enable header and footer.\n *\n * @slot - The main content of the card.\n * @slot header - The header of the card.\n * @slot footer - The footer of the card.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n background: var(${cssGlobalVars.background});\n color: var(${cssGlobalVars.foreground});\n display: block;\n flex-shrink: 0;\n }\n\n slot {\n display: block;\n padding: 1em;\n }\n\n [part=\"root\"] {\n border-radius: inherit;\n }\n\n [name=\"footer\"] {\n padding-top: 0;\n }\n\n [name=\"header\"] {\n padding-bottom: 0;\n }\n`)\nclass Card extends GlobalStyle {\n constructor() {\n super();\n new StyleController(this, () => new RingBuilder({ type: this.ringType }).css);\n }\n\n @property({ attribute: ringTypeAttribute })\n ringType: RingType = \"border\";\n\n /**\n * Whether to display the header.\n */\n @property({ type: Boolean })\n footer = false;\n\n /**\n * Whether to display the footer.\n */\n @property({ type: Boolean })\n header = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[this.header ? htmlSlot(\"header\") : \"\", htmlSlot(), this.footer ? htmlSlot(\"footer\") : \"\"]}\n </div>\n `;\n }\n}\n\nexport default Card;\nexport { Card };\n"],"names":["Card"],"mappings":"4VAQA,MAAM,UAAY,OACD,YAAY,UAAA,CAa7B,IAAA,KAAA,MA0BMA,UAAa,WAAY,CAC7B,aAAc,CAEZ,AADA,OAAO,MAKT,SAAqB,cAMrB,QAAS,OAMT,QAAS,EAhBP,IAAI,gBAAgB,KAAM,IAAM,IAAI,YAAY,CAAE,KAAM,KAAK,QAAU,GAAE,IAC1E,CAiBS,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,CAAC,KAAK,OAAS,SAAS,SAAS,CAAG,GAAI,UAAU,CAAE,KAAK,OAAS,SAAS,SAAS,CAAG,EAAG,EAAA,OAEhG,CAAC,AACF,CACF,EAzDA,WAgCE,SAAS,CAAE,UAAW,iBAAmB,EAAC,AAAA,EAAA,KAAA,UAAA,kBAAA,YAM1C,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,gBAAA,YAM3B,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,gBAAA,CA5C7B,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,qBAEQ,EAAE,cAAc,WAAW,YAChC,EAAE,cAAc,WAAW,0JAqB1C,CAAC,CAAC,AAAA,EAAA,KAAA,CAkCF,IAAA,OAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../src/web-components/card/definition.ts"],"sourcesContent":["import Card from \"./component.js\";\n\nCard.define();\n\nexport default Card;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-card\": Card;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Card from"./component.js";Card.define();export{Card as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/card/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/card/definition.ts"],"sourcesContent":["import Card from \"./component.js\";\n\nCard.define();\n\nexport default Card;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-card\": Card;\n }\n}\n"],"names":[],"mappings":"iCAEA,KAAK,QAAQ"}
|
@@ -1,40 +1,39 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
* {@linkcode Carousel} make the content display as a carousel.
|
5
|
+
*
|
6
|
+
* When this component is `firstUpdated`,
|
7
|
+
* clone the first and last element and make the matching element visible when switching index.
|
8
|
+
*
|
9
|
+
* @slot - Carousel items, should maintain the same size.
|
10
|
+
* @fires change - Fires when the index changes.
|
11
|
+
* @category display
|
12
|
+
*/
|
13
13
|
declare class Carousel extends GlobalStyle {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
14
|
+
/**
|
15
|
+
* The index of the current item.
|
16
|
+
*/
|
17
|
+
index: number;
|
18
|
+
/**
|
19
|
+
* The duration of the transition.
|
20
|
+
*/
|
21
|
+
autoChange: number;
|
22
|
+
protected _moveRoot: HTMLElement;
|
23
|
+
intervalID: number;
|
24
|
+
private __cloneFirst;
|
25
|
+
private __cloneLast;
|
26
|
+
protected _offset: number;
|
27
|
+
protected render(): TemplateResult<1>;
|
28
|
+
connectedCallback(): void;
|
29
|
+
protected firstUpdated(): Promise<void>;
|
30
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
31
|
+
show(i: number, n?: boolean): void;
|
32
|
+
next(): void;
|
33
|
+
prev(): void;
|
34
|
+
protected _doTranslateX(xValue: string, noTransition?: boolean): void;
|
35
|
+
protected _computeOffset(): number;
|
36
|
+
normalizeIndex(i: number): number;
|
37
37
|
}
|
38
38
|
export default Carousel;
|
39
39
|
export { Carousel };
|
40
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAGA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAAmB,gCAAiC;;;;;;;;;;;AAkB7D,cA6CM,iBAAiB,YAAY;;;;CAIjC,AACA;;;;CAKA,AACA;CAEA,UACU,WAAW;CAErB;CAEA,QAAQ;CAER,QAAQ;CAER,UAAU;CAEV,UAAU,UAAU,eAAe;CAuBnC;CAgBA,UAAgB,gBAAgB;CAKhC,yBAAyBA,cAAcC,qBAAqBC;CAO5D,KAAKC,WAAWC;CAgBhB;CASA;CASA,UAAU,cAAcC,gBAAgBC;CAKxC,UAAU;CASV,eAAeH;AAShB;AAED,eAAe;AACf,SAAS","names":["name: string","_old: string | null","value: string | null","i: number","n?: boolean","xValue: string","noTransition?: boolean"],"sources":["../../../src/web-components/carousel/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, queryPart, styles } from \"@godown/element\";\nimport iconCaretLeft from \"../../internal/icons/caret-left.js\";\nimport iconCaretRight from \"../../internal/icons/caret-right.js\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"carousel\";\n\nfunction getWidth(e) {\n return e.getBoundingClientRect().width;\n}\n\n/**\n * {@linkcode Carousel} make the content display as a carousel.\n *\n * When this component is `firstUpdated`,\n * clone the first and last element and make the matching element visible when switching index.\n *\n * @slot - Carousel items, should maintain the same size.\n * @fires change - Fires when the index changes.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n transition: 0.3s;\n }\n\n [part=\"root\"] {\n direction: ltr;\n overflow: hidden;\n }\n\n [part=\"root\"],\n [part=\"move-root\"] {\n height: 100%;\n width: 100%;\n display: flex;\n position: relative;\n transition: inherit;\n }\n\n [part=\"prev\"],\n [part=\"next\"] {\n height: 100%;\n width: 1.5em;\n z-index: 1;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n }\n\n [part=\"prev\"] {\n left: 0;\n }\n\n [part=\"next\"] {\n right: 0;\n }\n\n slot::slotted(*) {\n flex-shrink: 0 !important;\n }\n`)\nclass Carousel extends GlobalStyle {\n /**\n * The index of the current item.\n */\n @property({ type: Number })\n index = 0;\n\n /**\n * The duration of the transition.\n */\n @property({ type: Number })\n autoChange = 0;\n\n @queryPart(\"move-root\")\n protected _moveRoot: HTMLElement;\n\n intervalID: number;\n\n private __cloneFirst: HTMLElement | undefined;\n\n private __cloneLast: HTMLElement | undefined;\n\n protected _offset: number;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <i\n part=\"prev\"\n @click=\"${this.prev}\"\n >\n ${iconCaretLeft()}\n </i>\n <div part=\"move-root\">${htmlSlot()}</div>\n <i\n part=\"next\"\n @click=\"${this.next}\"\n >\n ${iconCaretRight()}\n </i>\n </div>\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (this.children.length) {\n this.__cloneFirst?.remove();\n this.__cloneLast?.remove();\n this.__cloneLast = this.firstElementChild.cloneNode(true) as HTMLElement;\n this.__cloneFirst = this.lastElementChild.cloneNode(true) as HTMLElement;\n this.appendChild(this.__cloneLast);\n this.insertBefore(this.__cloneFirst, this.firstElementChild);\n }\n this.observers.add(this, ResizeObserver, () => {\n this._offset = this._computeOffset();\n this._doTranslateX(`${this._offset}px`, true);\n });\n }\n\n protected async firstUpdated(): Promise<void> {\n await this.updateComplete;\n this.show(this.index, true);\n }\n\n attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n super.attributeChangedCallback(name, _old, value);\n if (name === \"index\" && this.isConnected) {\n this.show(this.index);\n }\n }\n\n show(i: number, n?: boolean): void {\n i = this.normalizeIndex(i);\n this.index = i;\n this._offset = this._computeOffset();\n this._doTranslateX(`${this._offset}px`, n);\n this.dispatchCustomEvent(\"change\", i);\n this.timeouts.remove(this.intervalID);\n if (this.autoChange > 0) {\n this.intervalID = this.timeouts.add(\n setInterval(() => {\n this.next();\n }, this.autoChange),\n );\n }\n }\n\n next(): void {\n if (this.index === this.childElementCount - 3) {\n this._doTranslateX(\"0\", true);\n this.show(0);\n } else {\n this.show(this.index + 1);\n }\n }\n\n prev(): void {\n if (this.index === 0) {\n this._doTranslateX(`-${this.childElementCount - 1}00%`, true);\n this.show(this.children.length - 3);\n } else {\n this.show(this.index - 1);\n }\n }\n\n protected _doTranslateX(xValue: string, noTransition?: boolean): void {\n this._moveRoot.style.transform = `translateX(${xValue})`;\n this._moveRoot.style.transition = noTransition ? \"none\" : \"\";\n }\n\n protected _computeOffset(): number {\n let offset = 0;\n for (let childIndex = 0; childIndex <= this.index; childIndex++) {\n offset -= getWidth(this.children[childIndex]);\n }\n offset += (getWidth(this) - getWidth(this.children[this.index + 1])) / 2;\n return offset;\n }\n\n normalizeIndex(i: number): number {\n if (i < 0) {\n return 0;\n }\n if (i > this.children.length - 3) {\n return this.children.length - 3;\n }\n return i;\n }\n}\n\nexport default Carousel;\nexport { Carousel };\n"],"version":3,"file":"component.d.ts"}
|