godown 2.7.7 → 3.0.0-canary.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 +44 -80
- package/alert.d.ts +2 -3
- package/alert.d.ts.map +1 -1
- package/alert.js +5 -4
- package/alert.js.map +1 -1
- package/avatar.d.ts +2 -3
- package/avatar.d.ts.map +1 -1
- package/avatar.js +5 -4
- package/avatar.js.map +1 -1
- package/breath.d.ts +9 -0
- package/breath.d.ts.map +1 -0
- package/breath.js +6 -0
- package/breath.js.map +1 -0
- package/button.d.ts +2 -3
- package/button.d.ts.map +1 -1
- package/button.js +5 -4
- package/button.js.map +1 -1
- package/card.d.ts +2 -3
- package/card.d.ts.map +1 -1
- package/card.js +5 -4
- package/card.js.map +1 -1
- package/carousel.d.ts +2 -3
- package/carousel.d.ts.map +1 -1
- package/carousel.js +5 -4
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +50 -0
- package/components/alert.d.ts.map +1 -0
- package/components/alert.js +167 -0
- package/components/alert.js.map +1 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.d.ts.map +1 -0
- package/components/avatar.js +62 -0
- package/components/avatar.js.map +1 -0
- package/components/breath.d.ts +34 -0
- package/components/breath.d.ts.map +1 -0
- package/components/breath.js +80 -0
- package/components/breath.js.map +1 -0
- package/{web-components/button → components}/button.d.ts +6 -5
- package/components/button.d.ts.map +1 -0
- package/components/button.js +167 -0
- package/components/button.js.map +1 -0
- package/components/card.d.ts +20 -0
- package/components/card.d.ts.map +1 -0
- package/components/card.js +55 -0
- package/components/card.js.map +1 -0
- package/components/carousel.d.ts +40 -0
- package/components/carousel.d.ts.map +1 -0
- package/components/carousel.js +113 -0
- package/components/carousel.js.map +1 -0
- package/{web-components/details → components}/details.d.ts +5 -3
- package/components/details.d.ts.map +1 -0
- package/components/details.js +50 -0
- package/components/details.js.map +1 -0
- package/components/dialog.d.ts +33 -0
- package/components/dialog.d.ts.map +1 -0
- package/components/dialog.js +92 -0
- package/components/dialog.js.map +1 -0
- package/components/divider.d.ts +17 -0
- package/components/divider.d.ts.map +1 -0
- package/components/divider.js +37 -0
- package/components/divider.js.map +1 -0
- package/{web-components/wrapper → components}/dragbox.d.ts +15 -5
- package/components/dragbox.d.ts.map +1 -0
- package/{web-components/wrapper → components}/dragbox.js +32 -27
- package/components/dragbox.js.map +1 -0
- package/components/flex.d.ts +31 -0
- package/components/flex.d.ts.map +1 -0
- package/components/flex.js +55 -0
- package/components/flex.js.map +1 -0
- package/{web-components/form → components}/form.d.ts +4 -2
- package/components/form.d.ts.map +1 -0
- package/{web-components/form → components}/form.js +16 -17
- package/components/form.js.map +1 -0
- package/components/grid.d.ts +31 -0
- package/components/grid.d.ts.map +1 -0
- package/components/grid.js +56 -0
- package/components/grid.js.map +1 -0
- package/components/input.d.ts +20 -0
- package/components/input.d.ts.map +1 -0
- package/components/input.js +54 -0
- package/components/input.js.map +1 -0
- package/components/layout.d.ts +29 -0
- package/components/layout.d.ts.map +1 -0
- package/components/layout.js +48 -0
- package/components/layout.js.map +1 -0
- package/components/link.d.ts +20 -0
- package/components/link.d.ts.map +1 -0
- package/components/link.js +43 -0
- package/components/link.js.map +1 -0
- package/{web-components/progress → components}/progress.d.ts +5 -3
- package/components/progress.d.ts.map +1 -0
- package/components/progress.js +68 -0
- package/components/progress.js.map +1 -0
- package/components/range.d.ts +60 -0
- package/components/range.d.ts.map +1 -0
- package/components/range.js +193 -0
- package/components/range.js.map +1 -0
- package/{web-components/wrapper → components}/rotate.d.ts +4 -8
- package/components/rotate.d.ts.map +1 -0
- package/components/rotate.js +57 -0
- package/components/rotate.js.map +1 -0
- package/components/router.d.ts +121 -0
- package/components/router.d.ts.map +1 -0
- package/components/router.js +251 -0
- package/components/router.js.map +1 -0
- package/components/select.d.ts +50 -0
- package/components/select.d.ts.map +1 -0
- package/components/select.js +211 -0
- package/components/select.js.map +1 -0
- package/{web-components/skeleton → components}/skeleton.d.ts +6 -6
- package/components/skeleton.d.ts.map +1 -0
- package/components/skeleton.js +56 -0
- package/components/skeleton.js.map +1 -0
- package/components/split.d.ts +32 -0
- package/components/split.d.ts.map +1 -0
- package/components/split.js +121 -0
- package/components/split.js.map +1 -0
- package/{web-components/input/switch-input.d.ts → components/switch.d.ts} +9 -10
- package/components/switch.d.ts.map +1 -0
- package/components/switch.js +93 -0
- package/components/switch.js.map +1 -0
- package/{web-components/text → components}/text.d.ts +5 -3
- package/components/text.d.ts.map +1 -0
- package/components/text.js +44 -0
- package/components/text.js.map +1 -0
- package/{web-components/text → components}/time.d.ts +5 -3
- package/components/time.d.ts.map +1 -0
- package/{web-components/text → components}/time.js +18 -21
- package/components/time.js.map +1 -0
- package/components/tooltip.d.ts +38 -0
- package/components/tooltip.d.ts.map +1 -0
- package/components/tooltip.js +67 -0
- package/components/tooltip.js.map +1 -0
- package/{web-components/text → components}/typewriter.d.ts +5 -3
- package/components/typewriter.d.ts.map +1 -0
- package/{web-components/text → components}/typewriter.js +24 -48
- package/components/typewriter.js.map +1 -0
- package/core/global-style.d.ts +21 -0
- package/core/global-style.d.ts.map +1 -0
- package/core/global-style.js +46 -0
- package/core/global-style.js.map +1 -0
- package/core/super-anchor.d.ts +15 -0
- package/core/super-anchor.d.ts.map +1 -0
- package/core/super-anchor.js +39 -0
- package/core/super-anchor.js.map +1 -0
- package/core/super-input.d.ts +39 -0
- package/core/super-input.d.ts.map +1 -0
- package/core/super-input.js +115 -0
- package/core/super-input.js.map +1 -0
- package/{proto → core}/super-openable.d.ts +4 -8
- package/core/super-openable.d.ts.map +1 -0
- package/{proto → core}/super-openable.js +10 -15
- package/core/super-openable.js.map +1 -0
- package/custom-elements.json +1 -0
- package/details.d.ts +2 -3
- package/details.d.ts.map +1 -1
- package/details.js +5 -4
- package/details.js.map +1 -1
- package/dialog.d.ts +2 -3
- package/dialog.d.ts.map +1 -1
- package/dialog.js +5 -4
- package/dialog.js.map +1 -1
- package/divider.d.ts +2 -3
- package/divider.d.ts.map +1 -1
- package/divider.js +5 -4
- package/divider.js.map +1 -1
- package/dragbox.d.ts +2 -3
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +5 -4
- package/dragbox.js.map +1 -1
- package/flex.d.ts +8 -0
- package/flex.d.ts.map +1 -0
- package/flex.js +6 -0
- package/flex.js.map +1 -0
- package/form.d.ts +2 -3
- package/form.d.ts.map +1 -1
- package/form.js +5 -4
- package/form.js.map +1 -1
- package/grid.d.ts +8 -0
- package/grid.d.ts.map +1 -0
- package/grid.js +6 -0
- package/grid.js.map +1 -0
- package/index.d.ts +28 -32
- package/index.d.ts.map +1 -1
- package/index.js +57 -33
- package/index.js.map +1 -1
- package/input.d.ts +3 -3
- package/input.d.ts.map +1 -1
- package/input.js +5 -4
- package/input.js.map +1 -1
- package/layout.d.ts +3 -3
- package/layout.d.ts.map +1 -1
- package/layout.js +5 -4
- package/layout.js.map +1 -1
- package/link.d.ts +3 -3
- package/link.d.ts.map +1 -1
- package/link.js +5 -4
- package/link.js.map +1 -1
- package/package.json +42 -81
- package/progress.d.ts +3 -3
- package/progress.d.ts.map +1 -1
- package/progress.js +5 -4
- package/progress.js.map +1 -1
- package/range.d.ts +9 -0
- package/range.d.ts.map +1 -0
- package/range.js +6 -0
- package/range.js.map +1 -0
- package/rotate.d.ts +3 -3
- package/rotate.d.ts.map +1 -1
- package/rotate.js +5 -4
- package/rotate.js.map +1 -1
- package/router.d.ts +3 -3
- package/router.d.ts.map +1 -1
- package/router.js +5 -4
- package/router.js.map +1 -1
- package/select.d.ts +9 -0
- package/select.d.ts.map +1 -0
- package/select.js +6 -0
- package/select.js.map +1 -0
- package/skeleton.d.ts +3 -3
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js +5 -4
- package/skeleton.js.map +1 -1
- package/split.d.ts +9 -0
- package/split.d.ts.map +1 -0
- package/split.js +6 -0
- package/split.js.map +1 -0
- package/switch.d.ts +9 -0
- package/switch.d.ts.map +1 -0
- package/switch.js +6 -0
- package/switch.js.map +1 -0
- package/text.d.ts +3 -3
- package/text.d.ts.map +1 -1
- package/text.js +5 -4
- package/text.js.map +1 -1
- package/time.d.ts +3 -3
- package/time.d.ts.map +1 -1
- package/time.js +5 -4
- package/time.js.map +1 -1
- package/tooltip.d.ts +3 -3
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js +5 -4
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +2 -3
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +5 -4
- package/typewriter.js.map +1 -1
- package/vscode.css-custom-data.json +1 -0
- package/vscode.html-custom-data.json +1 -0
- package/web-types.json +1 -0
- package/_deps.d.ts +0 -4
- package/_deps.d.ts.map +0 -1
- package/_deps.js +0 -4
- package/_deps.js.map +0 -1
- package/avatar-group.d.ts +0 -9
- package/avatar-group.d.ts.map +0 -1
- package/avatar-group.js +0 -5
- package/avatar-group.js.map +0 -1
- package/components.json +0 -194
- package/conf.d.ts +0 -12
- package/conf.d.ts.map +0 -1
- package/conf.js +0 -24
- package/conf.js.map +0 -1
- package/decorators/godown.d.ts +0 -4
- package/decorators/godown.d.ts.map +0 -1
- package/decorators/godown.js +0 -9
- package/decorators/godown.js.map +0 -1
- package/decorators/part.d.ts +0 -7
- package/decorators/part.d.ts.map +0 -1
- package/decorators/part.js +0 -8
- package/decorators/part.js.map +0 -1
- package/decorators/styles.d.ts +0 -3
- package/decorators/styles.d.ts.map +0 -1
- package/decorators/styles.js +0 -8
- package/decorators/styles.js.map +0 -1
- package/flex-flow.d.ts +0 -9
- package/flex-flow.d.ts.map +0 -1
- package/flex-flow.js +0 -5
- package/flex-flow.js.map +0 -1
- package/grid-flow.d.ts +0 -9
- package/grid-flow.d.ts.map +0 -1
- package/grid-flow.js +0 -5
- package/grid-flow.js.map +0 -1
- package/label-input.d.ts +0 -9
- package/label-input.d.ts.map +0 -1
- package/label-input.js +0 -5
- package/label-input.js.map +0 -1
- package/lib/css.d.ts +0 -13
- package/lib/css.d.ts.map +0 -1
- package/lib/css.js +0 -29
- package/lib/css.js.map +0 -1
- package/lib/directives.d.ts +0 -25
- package/lib/directives.d.ts.map +0 -1
- package/lib/directives.js +0 -40
- package/lib/directives.js.map +0 -1
- package/lib/event-coll.d.ts +0 -13
- package/lib/event-coll.d.ts.map +0 -1
- package/lib/event-coll.js +0 -45
- package/lib/event-coll.js.map +0 -1
- package/lib/icons.d.ts +0 -25
- package/lib/icons.d.ts.map +0 -1
- package/lib/icons.js +0 -73
- package/lib/icons.js.map +0 -1
- package/lib/jsx.d.ts +0 -4
- package/lib/jsx.d.ts.map +0 -1
- package/lib/jsx.js +0 -52
- package/lib/jsx.js.map +0 -1
- package/lib/route-tree.d.ts +0 -28
- package/lib/route-tree.d.ts.map +0 -1
- package/lib/route-tree.js +0 -141
- package/lib/route-tree.js.map +0 -1
- package/lib/utils.d.ts +0 -10
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -71
- package/lib/utils.js.map +0 -1
- package/overbreath.d.ts +0 -9
- package/overbreath.d.ts.map +0 -1
- package/overbreath.js +0 -5
- package/overbreath.js.map +0 -1
- package/proto/godown-config.d.ts +0 -41
- package/proto/godown-config.d.ts.map +0 -1
- package/proto/godown-config.js +0 -27
- package/proto/godown-config.js.map +0 -1
- package/proto/godown-element.d.ts +0 -125
- package/proto/godown-element.d.ts.map +0 -1
- package/proto/godown-element.js +0 -204
- package/proto/godown-element.js.map +0 -1
- package/proto/super-a.d.ts +0 -30
- package/proto/super-a.d.ts.map +0 -1
- package/proto/super-a.js +0 -141
- package/proto/super-a.js.map +0 -1
- package/proto/super-input.d.ts +0 -44
- package/proto/super-input.d.ts.map +0 -1
- package/proto/super-input.js +0 -119
- package/proto/super-input.js.map +0 -1
- package/proto/super-openable.d.ts.map +0 -1
- package/proto/super-openable.js.map +0 -1
- package/range-input.d.ts +0 -9
- package/range-input.d.ts.map +0 -1
- package/range-input.js +0 -5
- package/range-input.js.map +0 -1
- package/react/create.d.ts +0 -5
- package/react/create.d.ts.map +0 -1
- package/react/create.js +0 -16
- package/react/create.js.map +0 -1
- package/react/index.d.ts +0 -65
- package/react/index.d.ts.map +0 -1
- package/react/index.js +0 -132
- package/react/index.js.map +0 -1
- package/router-link.d.ts +0 -9
- package/router-link.d.ts.map +0 -1
- package/router-link.js +0 -5
- package/router-link.js.map +0 -1
- package/search-input.d.ts +0 -9
- package/search-input.d.ts.map +0 -1
- package/search-input.js +0 -5
- package/search-input.js.map +0 -1
- package/select-input.d.ts +0 -9
- package/select-input.d.ts.map +0 -1
- package/select-input.js +0 -5
- package/select-input.js.map +0 -1
- package/split-input.d.ts +0 -9
- package/split-input.d.ts.map +0 -1
- package/split-input.js +0 -5
- package/split-input.js.map +0 -1
- package/styles/colors/presets.d.ts +0 -13
- package/styles/colors/presets.d.ts.map +0 -1
- package/styles/colors/presets.js +0 -6
- package/styles/colors/presets.js.map +0 -1
- package/styles/colors/presetsRGB.d.ts +0 -16
- package/styles/colors/presetsRGB.d.ts.map +0 -1
- package/styles/colors/presetsRGB.js +0 -134
- package/styles/colors/presetsRGB.js.map +0 -1
- package/styles/global.d.ts +0 -18
- package/styles/global.d.ts.map +0 -1
- package/styles/global.js +0 -78
- package/styles/global.js.map +0 -1
- package/styles/inputStyle.d.ts +0 -3
- package/styles/inputStyle.d.ts.map +0 -1
- package/styles/inputStyle.js +0 -59
- package/styles/inputStyle.js.map +0 -1
- package/switch-input.d.ts +0 -9
- package/switch-input.d.ts.map +0 -1
- package/switch-input.js +0 -5
- package/switch-input.js.map +0 -1
- package/web-components/alert/alert.d.ts +0 -36
- package/web-components/alert/alert.d.ts.map +0 -1
- package/web-components/alert/alert.js +0 -161
- package/web-components/alert/alert.js.map +0 -1
- package/web-components/avatar/avatar-group.d.ts +0 -21
- package/web-components/avatar/avatar-group.d.ts.map +0 -1
- package/web-components/avatar/avatar-group.js +0 -86
- package/web-components/avatar/avatar-group.js.map +0 -1
- package/web-components/avatar/avatar.d.ts +0 -28
- package/web-components/avatar/avatar.d.ts.map +0 -1
- package/web-components/avatar/avatar.js +0 -120
- package/web-components/avatar/avatar.js.map +0 -1
- package/web-components/button/button.d.ts.map +0 -1
- package/web-components/button/button.js +0 -256
- package/web-components/button/button.js.map +0 -1
- package/web-components/card/card.d.ts +0 -9
- package/web-components/card/card.d.ts.map +0 -1
- package/web-components/card/card.js +0 -75
- package/web-components/card/card.js.map +0 -1
- package/web-components/carousel/carousel.d.ts +0 -29
- package/web-components/carousel/carousel.d.ts.map +0 -1
- package/web-components/carousel/carousel.js +0 -185
- package/web-components/carousel/carousel.js.map +0 -1
- package/web-components/details/details.d.ts.map +0 -1
- package/web-components/details/details.js +0 -124
- package/web-components/details/details.js.map +0 -1
- package/web-components/dialog/dialog.d.ts +0 -31
- package/web-components/dialog/dialog.d.ts.map +0 -1
- package/web-components/dialog/dialog.js +0 -143
- package/web-components/dialog/dialog.js.map +0 -1
- package/web-components/divider/divider.d.ts +0 -13
- package/web-components/divider/divider.d.ts.map +0 -1
- package/web-components/divider/divider.js +0 -95
- package/web-components/divider/divider.js.map +0 -1
- package/web-components/form/form.d.ts.map +0 -1
- package/web-components/form/form.js.map +0 -1
- package/web-components/input/input.d.ts +0 -37
- package/web-components/input/input.d.ts.map +0 -1
- package/web-components/input/input.js +0 -152
- package/web-components/input/input.js.map +0 -1
- package/web-components/input/label-input.d.ts +0 -15
- package/web-components/input/label-input.d.ts.map +0 -1
- package/web-components/input/label-input.js +0 -96
- package/web-components/input/label-input.js.map +0 -1
- package/web-components/input/range-input.d.ts +0 -53
- package/web-components/input/range-input.d.ts.map +0 -1
- package/web-components/input/range-input.js +0 -316
- package/web-components/input/range-input.js.map +0 -1
- package/web-components/input/search-input.d.ts +0 -42
- package/web-components/input/search-input.d.ts.map +0 -1
- package/web-components/input/search-input.js +0 -214
- package/web-components/input/search-input.js.map +0 -1
- package/web-components/input/select-input.d.ts +0 -36
- package/web-components/input/select-input.d.ts.map +0 -1
- package/web-components/input/select-input.js +0 -210
- package/web-components/input/select-input.js.map +0 -1
- package/web-components/input/split-input.d.ts +0 -29
- package/web-components/input/split-input.d.ts.map +0 -1
- package/web-components/input/split-input.js +0 -184
- package/web-components/input/split-input.js.map +0 -1
- package/web-components/input/switch-input.d.ts.map +0 -1
- package/web-components/input/switch-input.js +0 -189
- package/web-components/input/switch-input.js.map +0 -1
- package/web-components/layout/flex-flow.d.ts +0 -17
- package/web-components/layout/flex-flow.d.ts.map +0 -1
- package/web-components/layout/flex-flow.js +0 -73
- package/web-components/layout/flex-flow.js.map +0 -1
- package/web-components/layout/grid-flow.d.ts +0 -14
- package/web-components/layout/grid-flow.d.ts.map +0 -1
- package/web-components/layout/grid-flow.js +0 -56
- package/web-components/layout/grid-flow.js.map +0 -1
- package/web-components/layout/layout.d.ts +0 -18
- package/web-components/layout/layout.d.ts.map +0 -1
- package/web-components/layout/layout.js +0 -76
- package/web-components/layout/layout.js.map +0 -1
- package/web-components/link/link.d.ts +0 -10
- package/web-components/link/link.d.ts.map +0 -1
- package/web-components/link/link.js +0 -17
- package/web-components/link/link.js.map +0 -1
- package/web-components/link/router-link.d.ts +0 -19
- package/web-components/link/router-link.d.ts.map +0 -1
- package/web-components/link/router-link.js +0 -60
- package/web-components/link/router-link.js.map +0 -1
- package/web-components/progress/progress.d.ts.map +0 -1
- package/web-components/progress/progress.js +0 -107
- package/web-components/progress/progress.js.map +0 -1
- package/web-components/router/router.d.ts +0 -86
- package/web-components/router/router.d.ts.map +0 -1
- package/web-components/router/router.js +0 -246
- package/web-components/router/router.js.map +0 -1
- package/web-components/skeleton/skeleton.d.ts.map +0 -1
- package/web-components/skeleton/skeleton.js +0 -130
- package/web-components/skeleton/skeleton.js.map +0 -1
- package/web-components/text/overbreath.d.ts +0 -22
- package/web-components/text/overbreath.d.ts.map +0 -1
- package/web-components/text/overbreath.js +0 -132
- package/web-components/text/overbreath.js.map +0 -1
- package/web-components/text/text.d.ts.map +0 -1
- package/web-components/text/text.js +0 -94
- package/web-components/text/text.js.map +0 -1
- package/web-components/text/time.d.ts.map +0 -1
- package/web-components/text/time.js.map +0 -1
- package/web-components/text/typewriter.d.ts.map +0 -1
- package/web-components/text/typewriter.js.map +0 -1
- package/web-components/tooltip/tooltip.d.ts +0 -30
- package/web-components/tooltip/tooltip.d.ts.map +0 -1
- package/web-components/tooltip/tooltip.js +0 -123
- package/web-components/tooltip/tooltip.js.map +0 -1
- package/web-components/wrapper/dragbox.d.ts.map +0 -1
- package/web-components/wrapper/dragbox.js.map +0 -1
- package/web-components/wrapper/rotate.d.ts.map +0 -1
- package/web-components/wrapper/rotate.js +0 -92
- package/web-components/wrapper/rotate.js.map +0 -1
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# godown
|
2
2
|
|
3
3
|
Simple, stylized, semantic web components.
|
4
4
|
|
@@ -13,7 +13,7 @@ npm i godown
|
|
13
13
|
### HTML
|
14
14
|
|
15
15
|
```html
|
16
|
-
<
|
16
|
+
<godown-alert title="Alert"></godown-alert>
|
17
17
|
```
|
18
18
|
|
19
19
|
### JS
|
@@ -23,126 +23,90 @@ npm i godown
|
|
23
23
|
import { Alert } from "godown";
|
24
24
|
|
25
25
|
// import one
|
26
|
-
import Alert from "godown/alert";
|
26
|
+
import Alert from "godown/alert.js";
|
27
27
|
|
28
28
|
const alert = new Alert();
|
29
29
|
alert.title = "Alert";
|
30
|
-
|
31
|
-
const alert = new Alert({
|
32
|
-
title: "Alert"
|
33
|
-
});
|
34
|
-
*/
|
30
|
+
|
35
31
|
document.body.appendChild(alert);
|
36
32
|
```
|
37
33
|
|
38
|
-
|
34
|
+
### React
|
39
35
|
|
40
|
-
|
41
|
-
import { Alert } from "npm:godown";
|
42
|
-
```
|
43
|
-
|
44
|
-
#### React
|
36
|
+
react is now in the standalone package (@godown/react)
|
45
37
|
|
46
38
|
```jsx
|
47
|
-
import { Alert } from "godown/react"; // import all
|
39
|
+
import { Alert } from "@godown/react"; // import all
|
40
|
+
// import { Alert } from "@godown/react/alert.js"; // import one
|
48
41
|
|
49
42
|
export default function () {
|
50
|
-
return <Alert title="Alert"
|
43
|
+
return <Alert title="Alert" />;
|
51
44
|
}
|
52
45
|
```
|
53
46
|
|
54
|
-
##
|
47
|
+
## Tips
|
48
|
+
|
49
|
+
### Initial properties
|
55
50
|
|
56
|
-
|
51
|
+
The constructor parameter can accept an initial value record and assign it after **connected** to document.
|
52
|
+
|
53
|
+
Element will override the records of the superclass.
|
54
|
+
|
55
|
+
`GodownElement` (require @godown/element) will work for all elements.
|
57
56
|
|
58
57
|
```js
|
59
|
-
import
|
58
|
+
import GodownElement from "@godown/element";
|
60
59
|
|
61
|
-
|
62
|
-
|
60
|
+
GodownElement.godownConfig ||= new GodownConfig();
|
61
|
+
GodownElement.godownConfig.assign = {
|
62
|
+
classList: ["godown-element", "custom-element"],
|
63
63
|
};
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
defineConfig({
|
70
|
-
tag: getName,
|
71
|
-
prefix: "my-",
|
72
|
-
suffix: "",
|
73
|
-
});
|
65
|
+
import Input from "godown/input.js";
|
66
|
+
new Input({ id: "my-input" });
|
74
67
|
```
|
75
68
|
|
76
69
|
```html
|
77
|
-
<my-
|
70
|
+
<godown-input id="my-input" class="godown-element custom-element"></godown-input>
|
78
71
|
```
|
79
72
|
|
80
|
-
|
73
|
+
#### With CSS
|
81
74
|
|
82
|
-
|
75
|
+
This is useful when customizing styles.
|
83
76
|
|
84
77
|
```css
|
85
|
-
|
86
|
-
--godown--background
|
87
|
-
|
78
|
+
.godown-element {
|
79
|
+
--godown--background: rgb(0 0 0);
|
80
|
+
font-size: 20px;
|
88
81
|
}
|
89
82
|
```
|
90
83
|
|
91
|
-
###
|
92
|
-
|
93
|
-
```js
|
94
|
-
import { defineConfig } from "godown/conf";
|
84
|
+
### Tag naming
|
95
85
|
|
96
|
-
|
97
|
-
|
98
|
-
});
|
99
|
-
```
|
86
|
+
Modify the element prefix and suffix,
|
87
|
+
the tag name will be joined with `-`.
|
100
88
|
|
101
|
-
```
|
102
|
-
|
89
|
+
```js
|
90
|
+
GodownElement.godownConfig.prefix = "g";
|
91
|
+
GodownElement.godownConfig.suffix = "";
|
103
92
|
```
|
104
93
|
|
105
|
-
|
106
|
-
|
107
|
-
All element.
|
94
|
+
Modify the tag method to return the element name directly.
|
108
95
|
|
109
96
|
```js
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
classList: ["godown-element", "custom-element"],
|
114
|
-
color: "blue", // button property
|
115
|
-
},
|
116
|
-
});
|
97
|
+
GodownElement.godownConfig.tag = function (origin) {
|
98
|
+
return this.prefix + "-" + origin;
|
99
|
+
};
|
117
100
|
```
|
118
101
|
|
119
|
-
Assign when elements are **connected**.
|
120
|
-
|
121
102
|
```html
|
122
|
-
<g-button
|
123
|
-
|
124
|
-
<g-input class="godown-element custom-element" color="blue"></g-input>
|
103
|
+
<g-button></g-button>
|
125
104
|
```
|
126
105
|
|
127
|
-
|
106
|
+
### CSS variable prefix
|
128
107
|
|
129
|
-
|
130
|
-
const RedButton = new Button({
|
131
|
-
classList: ["godown-element", "custom-element"],
|
132
|
-
});
|
133
|
-
```
|
134
|
-
|
135
|
-
#### With CSS
|
108
|
+
Element-scoped css variables will start with `--${tagName}--`.
|
136
109
|
|
137
|
-
|
138
|
-
|
139
|
-
```css
|
140
|
-
.godown-element {
|
141
|
-
}
|
110
|
+
```html
|
111
|
+
<godown-button style="--godown-button--focus-scale: .95;"></godown-button>
|
142
112
|
```
|
143
|
-
|
144
|
-
## Compatibility
|
145
|
-
|
146
|
-
Legacy names is now unavailable.
|
147
|
-
|
148
|
-
Manually specify the legacy name at `tag`, return a legacy name, see[s](#custom-element-tag-name)
|
package/alert.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import Alert from "./
|
1
|
+
import Alert from "./components/alert.js";
|
2
2
|
export default Alert;
|
3
|
-
export * from "./web-components/alert/alert.js";
|
4
3
|
declare global {
|
5
4
|
interface HTMLElementTagNameMap {
|
6
|
-
"
|
5
|
+
"godown-alert": Alert;
|
7
6
|
}
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=alert.d.ts.map
|
package/alert.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["src/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAI1C,eAAe,KAAK,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,KAAK,CAAC;KACvB;CACF"}
|
package/alert.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import Alert from
|
1
|
+
import Alert from './components/alert.js';
|
2
|
+
|
2
3
|
Alert.define();
|
3
|
-
|
4
|
-
export
|
5
|
-
//# sourceMappingURL=alert.js.map
|
4
|
+
|
5
|
+
export { Alert as default };
|
6
|
+
//# sourceMappingURL=alert.js.map
|
package/alert.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"alert.js","
|
1
|
+
{"version":3,"file":"alert.js","sources":["src/alert.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,KAAK,CAAC,MAAM,EAAE;;;;"}
|
package/avatar.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import Avatar from "./
|
1
|
+
import Avatar from "./components/avatar.js";
|
2
2
|
export default Avatar;
|
3
|
-
export * from "./web-components/avatar/avatar.js";
|
4
3
|
declare global {
|
5
4
|
interface HTMLElementTagNameMap {
|
6
|
-
"
|
5
|
+
"godown-avatar": Avatar;
|
7
6
|
}
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=avatar.d.ts.map
|
package/avatar.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["src/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
package/avatar.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import Avatar from
|
1
|
+
import Avatar from './components/avatar.js';
|
2
|
+
|
2
3
|
Avatar.define();
|
3
|
-
|
4
|
-
export
|
5
|
-
//# sourceMappingURL=avatar.js.map
|
4
|
+
|
5
|
+
export { Avatar as default };
|
6
|
+
//# sourceMappingURL=avatar.js.map
|
package/avatar.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"avatar.js","
|
1
|
+
{"version":3,"file":"avatar.js","sources":["src/avatar.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,MAAM,CAAC,MAAM,EAAE;;;;"}
|
package/breath.d.ts
ADDED
package/breath.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"breath.d.ts","sourceRoot":"","sources":["src/breath.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
package/breath.js
ADDED
package/breath.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"breath.js","sources":["src/breath.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,MAAM,CAAC,MAAM,EAAE;;;;"}
|
package/button.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import Button from "./
|
1
|
+
import Button from "./components/button.js";
|
2
2
|
export default Button;
|
3
|
-
export * from "./web-components/button/button.js";
|
4
3
|
declare global {
|
5
4
|
interface HTMLElementTagNameMap {
|
6
|
-
"
|
5
|
+
"godown-button": Button;
|
7
6
|
}
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=button.d.ts.map
|
package/button.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["src/button.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
package/button.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import Button from
|
1
|
+
import Button from './components/button.js';
|
2
|
+
|
2
3
|
Button.define();
|
3
|
-
|
4
|
-
export
|
5
|
-
//# sourceMappingURL=button.js.map
|
4
|
+
|
5
|
+
export { Button as default };
|
6
|
+
//# sourceMappingURL=button.js.map
|
package/button.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button.js","
|
1
|
+
{"version":3,"file":"button.js","sources":["src/button.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,MAAM,CAAC,MAAM,EAAE;;;;"}
|
package/card.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import Card from "./
|
1
|
+
import Card from "./components/card.js";
|
2
2
|
export default Card;
|
3
|
-
export * from "./web-components/card/card.js";
|
4
3
|
declare global {
|
5
4
|
interface HTMLElementTagNameMap {
|
6
|
-
"
|
5
|
+
"godown-card": Card;
|
7
6
|
}
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=card.d.ts.map
|
package/card.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["src/card.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
|
package/card.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import Card from
|
1
|
+
import Card from './components/card.js';
|
2
|
+
|
2
3
|
Card.define();
|
3
|
-
|
4
|
-
export
|
5
|
-
//# sourceMappingURL=card.js.map
|
4
|
+
|
5
|
+
export { Card as default };
|
6
|
+
//# sourceMappingURL=card.js.map
|
package/card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card.js","
|
1
|
+
{"version":3,"file":"card.js","sources":["src/card.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,IAAI,CAAC,MAAM,EAAE;;;;"}
|
package/carousel.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import Carousel from "./
|
1
|
+
import Carousel from "./components/carousel.js";
|
2
2
|
export default Carousel;
|
3
|
-
export * from "./web-components/carousel/carousel.js";
|
4
3
|
declare global {
|
5
4
|
interface HTMLElementTagNameMap {
|
6
|
-
"
|
5
|
+
"godown-carousel": Carousel;
|
7
6
|
}
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=carousel.d.ts.map
|
package/carousel.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["src/carousel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAIhD,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;KAC7B;CACF"}
|
package/carousel.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import Carousel from
|
1
|
+
import Carousel from './components/carousel.js';
|
2
|
+
|
2
3
|
Carousel.define();
|
3
|
-
|
4
|
-
export
|
5
|
-
//# sourceMappingURL=carousel.js.map
|
4
|
+
|
5
|
+
export { Carousel as default };
|
6
|
+
//# sourceMappingURL=carousel.js.map
|
package/carousel.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"carousel.js","
|
1
|
+
{"version":3,"file":"carousel.js","sources":["src/carousel.ts"],"sourcesContent":null,"names":[],"mappings":";;AAEA,QAAQ,CAAC,MAAM,EAAE;;;;"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { GlobalStyle } from "../core/global-style.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Alert} renders a alert.
|
4
|
+
*
|
5
|
+
* @slot - Alert content.
|
6
|
+
* @slot title - Alert title.
|
7
|
+
* @slot icon - Alert icon.
|
8
|
+
* @category feedback
|
9
|
+
*/
|
10
|
+
declare class Alert extends GlobalStyle {
|
11
|
+
/**
|
12
|
+
* If it is a legal value, the icon and preset color will be rendered.
|
13
|
+
*/
|
14
|
+
call: "tip" | "success" | "info" | "warning" | "danger" | "error" | "help" | "deprecated";
|
15
|
+
/**
|
16
|
+
* The tone of the component.
|
17
|
+
* Overrides the color of the call.
|
18
|
+
*/
|
19
|
+
color: "white" | "black" | "gray" | "green" | "teal" | "blue" | "red" | "purple" | "orange" | "yellow" | "pink";
|
20
|
+
/**
|
21
|
+
* Close delay, if 0, it will not be closed automatically.
|
22
|
+
*/
|
23
|
+
autoclose: number;
|
24
|
+
/**
|
25
|
+
* The title is bold and the icon height is the same as it.
|
26
|
+
*/
|
27
|
+
title: string;
|
28
|
+
/**
|
29
|
+
* Content, if zero value, will be rendered as an unnamed slot.
|
30
|
+
*/
|
31
|
+
content: string;
|
32
|
+
/**
|
33
|
+
* Set true to hide the close button.
|
34
|
+
*
|
35
|
+
* The behavior may change due to the {@linkcode variant} property
|
36
|
+
*/
|
37
|
+
hideClose: boolean;
|
38
|
+
/**
|
39
|
+
* Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.
|
40
|
+
*
|
41
|
+
* If variant is `"blockquote"`, hide the close button.
|
42
|
+
*/
|
43
|
+
variant: "blockquote" | "dark" | "light";
|
44
|
+
protected render(): import("lit").TemplateResult<1>;
|
45
|
+
close(): void;
|
46
|
+
protected firstUpdated(): void;
|
47
|
+
static alert(root: HTMLElement, option: Partial<Alert>): Alert;
|
48
|
+
}
|
49
|
+
export default Alert;
|
50
|
+
//# sourceMappingURL=alert.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../src/components/alert.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAiB,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAwFlF;;;;;;;GAOG;AACH,cAMM,KAAM,SAAQ,WAAW;IAC7B;;OAEG;IAEH,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IAE1F;;;OAGG;IAEH,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IAEhH;;OAEG;IAEH,SAAS,SAAK;IAEd;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IAIH,SAAS,UAAS;IAElB;;;;OAIG;IAEH,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAU;IAElD,SAAS,CAAC,MAAM;IAWhB,KAAK;IAKL,SAAS,CAAC,YAAY;IAMtB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK;CAM/D;AAED,eAAe,KAAK,CAAC"}
|
@@ -0,0 +1,167 @@
|
|
1
|
+
import { __decorate } from 'tslib';
|
2
|
+
import { godown } from '@godown/element/decorators/godown.js';
|
3
|
+
import { styles } from '@godown/element/decorators/styles.js';
|
4
|
+
import { conditionIf } from '@godown/element/directives/condition-if.js';
|
5
|
+
import { htmlSlot } from '@godown/element/directives/html-slot.js';
|
6
|
+
import { constructCSS } from '@godown/element/tools/css.js';
|
7
|
+
import iconCheckAltCircle from '@godown/f7-icon/icons/checkmark-alt-circle.js';
|
8
|
+
import iconExclamationCircle from '@godown/f7-icon/icons/exclamationmark-circle.js';
|
9
|
+
import iconInfoCircle from '@godown/f7-icon/icons/info-circle.js';
|
10
|
+
import iconLightbulb from '@godown/f7-icon/icons/lightbulb.js';
|
11
|
+
import iconQuestionCircle from '@godown/f7-icon/icons/question-circle.js';
|
12
|
+
import iconSlashCircle from '@godown/f7-icon/icons/slash-circle.js';
|
13
|
+
import iconXmark from '@godown/f7-icon/icons/xmark.js';
|
14
|
+
import iconXmarkCircle from '@godown/f7-icon/icons/xmark-circle.js';
|
15
|
+
import { unsafeCSS, css, html } from 'lit';
|
16
|
+
import { property } from 'lit/decorators.js';
|
17
|
+
import { scopePrefix, cssGlobalVars, GlobalStyle } from '../core/global-style.js';
|
18
|
+
|
19
|
+
const protoName = "alert";
|
20
|
+
const cssScope = scopePrefix(protoName);
|
21
|
+
const vars = ["color", "background"].map((v) => `${cssScope}--${v}`);
|
22
|
+
const genDark = (key) => {
|
23
|
+
return [cssGlobalVars._colors[key][5], cssGlobalVars._colors[key][9]];
|
24
|
+
};
|
25
|
+
const darkStyles = constructCSS(vars, {
|
26
|
+
green: genDark("green"),
|
27
|
+
blue: genDark("blue"),
|
28
|
+
orange: genDark("orange"),
|
29
|
+
red: genDark("red"),
|
30
|
+
yellow: genDark("yellow"),
|
31
|
+
purple: genDark("purple"),
|
32
|
+
teal: genDark("teal"),
|
33
|
+
pink: genDark("pink"),
|
34
|
+
gray: [cssGlobalVars._colors.lightgray[5], cssGlobalVars._colors.darkgray[5]],
|
35
|
+
white: [cssGlobalVars._colors.lightgray[2], cssGlobalVars._colors.darkgray[7]],
|
36
|
+
black: [cssGlobalVars._colors.darkgray[8], cssGlobalVars._colors.lightgray[5]],
|
37
|
+
}, (color) => `[color=${color}]`, (prop) => `var(${prop})`);
|
38
|
+
const genLight = (key) => {
|
39
|
+
return [cssGlobalVars._colors[key][6], cssGlobalVars._colors[key][0]];
|
40
|
+
};
|
41
|
+
const lightStyles = constructCSS(vars, {
|
42
|
+
green: genLight("green"),
|
43
|
+
blue: genLight("blue"),
|
44
|
+
orange: genLight("orange"),
|
45
|
+
red: genLight("red"),
|
46
|
+
yellow: genLight("yellow"),
|
47
|
+
purple: genLight("purple"),
|
48
|
+
teal: genLight("teal"),
|
49
|
+
pink: genLight("pink"),
|
50
|
+
gray: [cssGlobalVars._colors.darkgray[5], cssGlobalVars._colors.lightgray[7]],
|
51
|
+
white: [cssGlobalVars._colors.lightgray[0], cssGlobalVars._colors.darkgray[0]],
|
52
|
+
black: [cssGlobalVars._colors.darkgray[7], cssGlobalVars._colors.lightgray[3]],
|
53
|
+
}, (color) => `[variant="light"][color=${color}]`, (prop) => `var(${prop})`);
|
54
|
+
const calls = {
|
55
|
+
tip: {
|
56
|
+
color: "teal",
|
57
|
+
icon: iconLightbulb,
|
58
|
+
},
|
59
|
+
success: {
|
60
|
+
color: "green",
|
61
|
+
icon: iconCheckAltCircle,
|
62
|
+
},
|
63
|
+
info: {
|
64
|
+
color: "blue",
|
65
|
+
icon: iconInfoCircle,
|
66
|
+
},
|
67
|
+
warning: {
|
68
|
+
color: "orange",
|
69
|
+
icon: iconExclamationCircle,
|
70
|
+
},
|
71
|
+
danger: {
|
72
|
+
color: "red",
|
73
|
+
icon: iconXmarkCircle,
|
74
|
+
},
|
75
|
+
error: {
|
76
|
+
color: "red",
|
77
|
+
icon: iconXmarkCircle,
|
78
|
+
},
|
79
|
+
help: {
|
80
|
+
color: "purple",
|
81
|
+
icon: iconQuestionCircle,
|
82
|
+
},
|
83
|
+
deprecated: {
|
84
|
+
color: "gray",
|
85
|
+
icon: iconSlashCircle,
|
86
|
+
},
|
87
|
+
};
|
88
|
+
/**
|
89
|
+
* {@linkcode Alert} renders a alert.
|
90
|
+
*
|
91
|
+
* @slot - Alert content.
|
92
|
+
* @slot title - Alert title.
|
93
|
+
* @slot icon - Alert icon.
|
94
|
+
* @category feedback
|
95
|
+
*/
|
96
|
+
let Alert = class Alert extends GlobalStyle {
|
97
|
+
constructor() {
|
98
|
+
super(...arguments);
|
99
|
+
/**
|
100
|
+
* Close delay, if 0, it will not be closed automatically.
|
101
|
+
*/
|
102
|
+
this.autoclose = 0;
|
103
|
+
/**
|
104
|
+
* Set true to hide the close button.
|
105
|
+
*
|
106
|
+
* The behavior may change due to the {@linkcode variant} property
|
107
|
+
*/
|
108
|
+
this.hideClose = false;
|
109
|
+
/**
|
110
|
+
* Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.
|
111
|
+
*
|
112
|
+
* If variant is `"blockquote"`, hide the close button.
|
113
|
+
*/
|
114
|
+
this.variant = "dark";
|
115
|
+
}
|
116
|
+
render() {
|
117
|
+
const color = this.call ? this.color || calls[this.call].color : this.color;
|
118
|
+
const icon = this.call ? calls[this.call].icon() : htmlSlot("icon");
|
119
|
+
return html `<div part="root" variant="${this.variant}" color="${color}"><div part="icon">${icon}</div><div part="content"><strong part="title">${this.title || htmlSlot("title")}</strong> ${this.content || htmlSlot()}</div>${conditionIf(!this.hideClose && this.variant !== "blockquote", html `<div part="close" @click="${this.close}">${iconXmark()}</div>`)}</div>`;
|
120
|
+
}
|
121
|
+
close() {
|
122
|
+
this.remove();
|
123
|
+
this.dispatchEvent(new CustomEvent("close", { bubbles: true, composed: true }));
|
124
|
+
}
|
125
|
+
firstUpdated() {
|
126
|
+
if (this.autoclose) {
|
127
|
+
setTimeout(() => this.close(), this.autoclose);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
static alert(root, option) {
|
131
|
+
const ai = new this();
|
132
|
+
Object.assign(ai, option);
|
133
|
+
root.appendChild(ai);
|
134
|
+
return ai;
|
135
|
+
}
|
136
|
+
};
|
137
|
+
__decorate([
|
138
|
+
property()
|
139
|
+
], Alert.prototype, "call", void 0);
|
140
|
+
__decorate([
|
141
|
+
property()
|
142
|
+
], Alert.prototype, "color", void 0);
|
143
|
+
__decorate([
|
144
|
+
property({ type: Number })
|
145
|
+
], Alert.prototype, "autoclose", void 0);
|
146
|
+
__decorate([
|
147
|
+
property()
|
148
|
+
], Alert.prototype, "title", void 0);
|
149
|
+
__decorate([
|
150
|
+
property()
|
151
|
+
], Alert.prototype, "content", void 0);
|
152
|
+
__decorate([
|
153
|
+
property({
|
154
|
+
type: Boolean,
|
155
|
+
})
|
156
|
+
], Alert.prototype, "hideClose", void 0);
|
157
|
+
__decorate([
|
158
|
+
property()
|
159
|
+
], Alert.prototype, "variant", void 0);
|
160
|
+
Alert = __decorate([
|
161
|
+
godown(protoName),
|
162
|
+
styles(unsafeCSS(darkStyles), unsafeCSS(lightStyles), css `:host{border-radius:var(${cssScope}--border-radius);${cssScope}--border-radius:.25em;${cssScope}--border-width:.075em;${cssScope}--blockquote-width:.2em;${cssScope}--padding:.5em;display:block;width:100%}[part=root]{--color:var(${cssScope}--color);color:var(--color);transition:.25s;display:flex;justify-content:space-between;padding:var(${cssScope}--padding);border-radius:inherit;border:var(${cssScope}--border-width) solid var(--color);background:var(${cssScope}--background)}[variant=blockquote]{border-radius:0;border-left:var(${cssScope}--blockquote-width) solid var(--color);border-bottom:none;border-right:none;border-top:none;background:0 0}[part=content]{color:var(--color)}[part=root]{display:grid;align-items:center;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr}[part=title]{line-height:2em}[part=icon]{display:inline-grid;align-items:center;height:2em}[part=icon] svg{margin-right:.5em;width:1.25em;height:1.25em}[part=content]{grid-row:span 2/span 2;line-height:1.5em}`)
|
163
|
+
], Alert);
|
164
|
+
var Alert$1 = Alert;
|
165
|
+
|
166
|
+
export { Alert$1 as default };
|
167
|
+
//# sour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