godown 3.14.0 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/alert.js +1 -1
- package/build/avatar.js +1 -1
- package/build/badge.js +1 -1
- package/build/breath.js +1 -1
- package/build/button.js +1 -1
- package/build/card.js +1 -1
- package/build/carousel.js +1 -1
- package/build/chip.js +1 -1
- package/build/details.js +1 -1
- package/build/dialog.js +1 -1
- package/build/divider.js +1 -1
- package/build/dragbox.js +1 -1
- package/build/flex.js +1 -1
- package/build/form.js +1 -1
- package/build/godown.iife.js +16 -16
- package/build/godown.iife.js.map +1 -1
- package/build/godown.umd.js +16 -16
- package/build/godown.umd.js.map +1 -1
- package/build/grid.js +1 -1
- package/build/heading.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/input.js +1 -1
- package/build/internal/global-style.d.ts.map +1 -1
- package/build/internal/global-style.js +1 -1
- package/build/internal/global-style.js.map +1 -1
- package/build/internal/icons/caret-down.d.ts.map +1 -1
- package/build/internal/icons/caret-down.js +1 -1
- package/build/internal/icons/caret-down.js.map +1 -1
- package/build/internal/icons/caret-left.d.ts.map +1 -1
- package/build/internal/icons/caret-left.js +1 -1
- package/build/internal/icons/caret-left.js.map +1 -1
- package/build/internal/icons/caret-right.d.ts.map +1 -1
- package/build/internal/icons/caret-right.js +1 -1
- package/build/internal/icons/caret-right.js.map +1 -1
- package/build/internal/icons/eye-slash.d.ts.map +1 -1
- package/build/internal/icons/eye-slash.js +1 -1
- package/build/internal/icons/eye-slash.js.map +1 -1
- package/build/internal/popover.d.ts +1 -1
- package/build/internal/popover.d.ts.map +1 -1
- package/build/internal/popover.js +1 -1
- package/build/internal/popover.js.map +1 -1
- package/build/internal/reset-style.d.ts.map +1 -1
- package/build/internal/reset-style.js +2 -2
- package/build/internal/reset-style.js.map +1 -1
- package/build/internal/ring.d.ts.map +1 -1
- package/build/internal/ring.js +1 -1
- package/build/internal/ring.js.map +1 -1
- package/build/internal/super-input.d.ts.map +1 -1
- package/build/internal/super-input.js +2 -2
- package/build/internal/super-input.js.map +1 -1
- package/build/internal/utils.d.ts.map +1 -1
- package/build/internal/utils.js +1 -1
- package/build/internal/utils.js.map +1 -1
- package/build/layout.js +1 -1
- package/build/link.js +1 -1
- package/build/popover.js +1 -1
- package/build/progress.js +1 -1
- package/build/range.js +1 -1
- package/build/rotate.js +1 -1
- package/build/router.js +1 -1
- package/build/select.js +1 -1
- package/build/skeleton.js +1 -1
- package/build/split.js +1 -1
- package/build/switch.js +1 -1
- package/build/tabs.js +1 -1
- package/build/text.js +1 -1
- package/build/time.js +1 -1
- package/build/tooltip.js +1 -1
- package/build/typewriter.js +1 -1
- package/build/web-components/alert/component.d.ts.map +1 -1
- package/build/web-components/alert/component.js +1 -1
- package/build/web-components/alert/component.js.map +1 -1
- package/build/web-components/alert/definition.d.ts.map +1 -1
- package/build/web-components/alert/definition.js +1 -1
- package/build/web-components/alert/definition.js.map +1 -1
- package/build/web-components/avatar/component.d.ts.map +1 -1
- package/build/web-components/avatar/component.js +1 -1
- package/build/web-components/avatar/component.js.map +1 -1
- package/build/web-components/avatar/definition.d.ts.map +1 -1
- package/build/web-components/avatar/definition.js +1 -1
- package/build/web-components/avatar/definition.js.map +1 -1
- package/build/web-components/badge/component.d.ts.map +1 -1
- package/build/web-components/badge/component.js +2 -2
- package/build/web-components/badge/component.js.map +1 -1
- package/build/web-components/badge/definition.d.ts.map +1 -1
- package/build/web-components/badge/definition.js +1 -1
- package/build/web-components/badge/definition.js.map +1 -1
- package/build/web-components/breath/component.d.ts.map +1 -1
- package/build/web-components/breath/component.js +1 -1
- package/build/web-components/breath/component.js.map +1 -1
- package/build/web-components/breath/definition.d.ts.map +1 -1
- package/build/web-components/breath/definition.js +1 -1
- package/build/web-components/breath/definition.js.map +1 -1
- package/build/web-components/button/component.d.ts.map +1 -1
- package/build/web-components/button/component.js +1 -1
- package/build/web-components/button/component.js.map +1 -1
- package/build/web-components/button/definition.d.ts.map +1 -1
- package/build/web-components/button/definition.js +1 -1
- package/build/web-components/button/definition.js.map +1 -1
- package/build/web-components/card/component.d.ts.map +1 -1
- package/build/web-components/card/component.js +1 -1
- package/build/web-components/card/component.js.map +1 -1
- package/build/web-components/card/definition.d.ts.map +1 -1
- package/build/web-components/card/definition.js +1 -1
- package/build/web-components/card/definition.js.map +1 -1
- package/build/web-components/carousel/component.d.ts.map +1 -1
- package/build/web-components/carousel/component.js +2 -2
- package/build/web-components/carousel/component.js.map +1 -1
- package/build/web-components/carousel/definition.d.ts.map +1 -1
- package/build/web-components/carousel/definition.js +1 -1
- package/build/web-components/carousel/definition.js.map +1 -1
- package/build/web-components/chip/component.d.ts.map +1 -1
- package/build/web-components/chip/component.js +1 -1
- package/build/web-components/chip/component.js.map +1 -1
- package/build/web-components/chip/definition.d.ts.map +1 -1
- package/build/web-components/chip/definition.js +1 -1
- package/build/web-components/chip/definition.js.map +1 -1
- package/build/web-components/details/component.d.ts.map +1 -1
- package/build/web-components/details/component.js +1 -1
- package/build/web-components/details/component.js.map +1 -1
- package/build/web-components/details/definition.d.ts.map +1 -1
- package/build/web-components/details/definition.js +1 -1
- package/build/web-components/details/definition.js.map +1 -1
- package/build/web-components/dialog/component.d.ts.map +1 -1
- package/build/web-components/dialog/component.js +1 -1
- package/build/web-components/dialog/component.js.map +1 -1
- package/build/web-components/dialog/definition.d.ts.map +1 -1
- package/build/web-components/dialog/definition.js +1 -1
- package/build/web-components/dialog/definition.js.map +1 -1
- package/build/web-components/divider/component.d.ts.map +1 -1
- package/build/web-components/divider/component.js +1 -1
- package/build/web-components/divider/component.js.map +1 -1
- package/build/web-components/divider/definition.d.ts.map +1 -1
- package/build/web-components/divider/definition.js +1 -1
- package/build/web-components/divider/definition.js.map +1 -1
- package/build/web-components/dragbox/component.d.ts.map +1 -1
- package/build/web-components/dragbox/component.js +2 -2
- package/build/web-components/dragbox/component.js.map +1 -1
- package/build/web-components/dragbox/definition.d.ts.map +1 -1
- package/build/web-components/dragbox/definition.js +1 -1
- package/build/web-components/dragbox/definition.js.map +1 -1
- package/build/web-components/flex/component.d.ts.map +1 -1
- package/build/web-components/flex/component.js +2 -2
- package/build/web-components/flex/component.js.map +1 -1
- package/build/web-components/flex/definition.d.ts.map +1 -1
- package/build/web-components/flex/definition.js +1 -1
- package/build/web-components/flex/definition.js.map +1 -1
- package/build/web-components/form/component.d.ts.map +1 -1
- package/build/web-components/form/component.js +2 -2
- package/build/web-components/form/component.js.map +1 -1
- package/build/web-components/form/definition.d.ts.map +1 -1
- package/build/web-components/form/definition.js +1 -1
- package/build/web-components/form/definition.js.map +1 -1
- package/build/web-components/grid/component.d.ts.map +1 -1
- package/build/web-components/grid/component.js +2 -2
- package/build/web-components/grid/component.js.map +1 -1
- package/build/web-components/grid/definition.d.ts.map +1 -1
- package/build/web-components/grid/definition.js +1 -1
- package/build/web-components/grid/definition.js.map +1 -1
- package/build/web-components/heading/component.d.ts.map +1 -1
- package/build/web-components/heading/component.js +2 -2
- package/build/web-components/heading/component.js.map +1 -1
- package/build/web-components/heading/definition.d.ts.map +1 -1
- package/build/web-components/heading/definition.js +1 -1
- package/build/web-components/heading/definition.js.map +1 -1
- package/build/web-components/input/component.d.ts.map +1 -1
- package/build/web-components/input/component.js +1 -1
- package/build/web-components/input/component.js.map +1 -1
- package/build/web-components/input/definition.d.ts.map +1 -1
- package/build/web-components/input/definition.js +1 -1
- package/build/web-components/input/definition.js.map +1 -1
- package/build/web-components/layout/component.d.ts.map +1 -1
- package/build/web-components/layout/component.js +2 -2
- package/build/web-components/layout/component.js.map +1 -1
- package/build/web-components/layout/definition.d.ts.map +1 -1
- package/build/web-components/layout/definition.js +1 -1
- package/build/web-components/layout/definition.js.map +1 -1
- package/build/web-components/link/component.d.ts.map +1 -1
- package/build/web-components/link/component.js +2 -2
- package/build/web-components/link/component.js.map +1 -1
- package/build/web-components/link/definition.d.ts.map +1 -1
- package/build/web-components/link/definition.js +1 -1
- package/build/web-components/link/definition.js.map +1 -1
- package/build/web-components/popover/component.d.ts.map +1 -1
- package/build/web-components/popover/component.js +2 -2
- package/build/web-components/popover/component.js.map +1 -1
- package/build/web-components/popover/definition.d.ts.map +1 -1
- package/build/web-components/popover/definition.js +1 -1
- package/build/web-components/popover/definition.js.map +1 -1
- package/build/web-components/progress/component.d.ts.map +1 -1
- package/build/web-components/progress/component.js +1 -1
- package/build/web-components/progress/component.js.map +1 -1
- package/build/web-components/progress/definition.d.ts.map +1 -1
- package/build/web-components/progress/definition.js +1 -1
- package/build/web-components/progress/definition.js.map +1 -1
- package/build/web-components/range/component.d.ts.map +1 -1
- package/build/web-components/range/component.js +1 -1
- package/build/web-components/range/component.js.map +1 -1
- package/build/web-components/range/definition.d.ts.map +1 -1
- package/build/web-components/range/definition.js +1 -1
- package/build/web-components/range/definition.js.map +1 -1
- package/build/web-components/rotate/component.d.ts.map +1 -1
- package/build/web-components/rotate/component.js +1 -1
- package/build/web-components/rotate/component.js.map +1 -1
- package/build/web-components/rotate/definition.d.ts.map +1 -1
- package/build/web-components/rotate/definition.js +1 -1
- package/build/web-components/rotate/definition.js.map +1 -1
- package/build/web-components/router/component.d.ts.map +1 -1
- package/build/web-components/router/component.js +2 -2
- package/build/web-components/router/component.js.map +1 -1
- package/build/web-components/router/definition.d.ts.map +1 -1
- package/build/web-components/router/definition.js +1 -1
- package/build/web-components/router/definition.js.map +1 -1
- package/build/web-components/select/component.d.ts.map +1 -1
- package/build/web-components/select/component.js +2 -2
- package/build/web-components/select/component.js.map +1 -1
- package/build/web-components/select/definition.d.ts.map +1 -1
- package/build/web-components/select/definition.js +1 -1
- package/build/web-components/select/definition.js.map +1 -1
- package/build/web-components/skeleton/component.d.ts.map +1 -1
- package/build/web-components/skeleton/component.js +1 -1
- package/build/web-components/skeleton/component.js.map +1 -1
- package/build/web-components/skeleton/definition.d.ts.map +1 -1
- package/build/web-components/skeleton/definition.js +1 -1
- package/build/web-components/skeleton/definition.js.map +1 -1
- package/build/web-components/split/component.d.ts.map +1 -1
- package/build/web-components/split/component.js +1 -1
- package/build/web-components/split/component.js.map +1 -1
- package/build/web-components/split/definition.d.ts.map +1 -1
- package/build/web-components/split/definition.js +1 -1
- package/build/web-components/split/definition.js.map +1 -1
- package/build/web-components/switch/component.d.ts.map +1 -1
- package/build/web-components/switch/component.js +1 -1
- package/build/web-components/switch/component.js.map +1 -1
- package/build/web-components/switch/definition.d.ts.map +1 -1
- package/build/web-components/switch/definition.js +1 -1
- package/build/web-components/switch/definition.js.map +1 -1
- package/build/web-components/tabs/component.d.ts +1 -1
- package/build/web-components/tabs/component.d.ts.map +1 -1
- package/build/web-components/tabs/component.js +1 -1
- package/build/web-components/tabs/component.js.map +1 -1
- package/build/web-components/tabs/definition.d.ts.map +1 -1
- package/build/web-components/tabs/definition.js +1 -1
- package/build/web-components/tabs/definition.js.map +1 -1
- package/build/web-components/text/component.d.ts.map +1 -1
- package/build/web-components/text/component.js +1 -1
- package/build/web-components/text/component.js.map +1 -1
- package/build/web-components/text/definition.d.ts.map +1 -1
- package/build/web-components/text/definition.js +1 -1
- package/build/web-components/text/definition.js.map +1 -1
- package/build/web-components/time/component.d.ts.map +1 -1
- package/build/web-components/time/component.js +1 -1
- package/build/web-components/time/component.js.map +1 -1
- package/build/web-components/time/definition.d.ts.map +1 -1
- package/build/web-components/time/definition.js +1 -1
- package/build/web-components/time/definition.js.map +1 -1
- package/build/web-components/tooltip/component.d.ts.map +1 -1
- package/build/web-components/tooltip/component.js +1 -1
- package/build/web-components/tooltip/component.js.map +1 -1
- package/build/web-components/tooltip/definition.d.ts.map +1 -1
- package/build/web-components/tooltip/definition.js +1 -1
- package/build/web-components/tooltip/definition.js.map +1 -1
- package/build/web-components/typewriter/component.d.ts.map +1 -1
- package/build/web-components/typewriter/component.js +1 -1
- package/build/web-components/typewriter/component.js.map +1 -1
- package/build/web-components/typewriter/definition.d.ts.map +1 -1
- package/build/web-components/typewriter/definition.js +1 -1
- package/build/web-components/typewriter/definition.js.map +1 -1
- package/custom-elements.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/internal/popover.ts +8 -12
- package/src/internal/ring.ts +3 -1
- package/src/web-components/breath/component.ts +3 -1
- package/src/web-components/tabs/component.ts +1 -1
- package/web-types.json +1 -1
package/build/time.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import"./web-components/time/definition.js";export{default}from"./web-components/time/component.js";
|
1
|
+
import"./web-components/time/definition.js";export{default}from"./web-components/time/component.js";
|
2
2
|
//# sourceMappingURL=time.js.map
|
package/build/tooltip.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import"./web-components/tooltip/definition.js";export{default}from"./web-components/tooltip/component.js";
|
1
|
+
import"./web-components/tooltip/definition.js";export{default}from"./web-components/tooltip/component.js";
|
2
2
|
//# sourceMappingURL=tooltip.js.map
|
package/build/typewriter.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import"./web-components/typewriter/definition.js";export{default}from"./web-components/typewriter/component.js";
|
1
|
+
import"./web-components/typewriter/definition.js";export{default}from"./web-components/typewriter/component.js";
|
2
2
|
//# sourceMappingURL=typewriter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AACA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC;AAG/C,SAAwB,mBAAmB;AAC3C,cAA8C,gBAAgB;;;;;;;;;;AAa9D,cAmBM,cAAc,YAAY;CAC9B;CAKA,AACA,UAAU;;;;CAKV,AACA;;;;CAKA,AACA;CAEA,UAAU,UAAU,eAAe;CAanC,OAAO,MAAM,MAAM,aAAa,QAAQ,QAAQ,SAAS;;AAQ3D,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/alert/component.ts"],"sourcesContent":["import { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, GlobalStyle } from \"../../internal/global-style.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"alert\";\n\n/**\n * {@linkcode Alert} renders a alert.\n *\n * @slot - Alert content.\n * @slot title - Alert title.\n * @slot prefix - Alert prefix.\n * @slot suffix - Alert suffix.\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n background: var(${cssGlobalVars.background});\n color: var(${cssGlobalVars.foreground});\n }\n\n :host,\n :where(:host([contents]) [part=\"root\"]),\n b {\n display: block;\n }\n\n [part=\"root\"] {\n padding: 1em;\n display: grid;\n grid-template-columns: auto 1fr auto;\n }\n`)\nclass Alert 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 * The title is bold and the icon height is the same as it.\n */\n @property()\n title: string;\n\n /**\n * Content, if zero value, will be rendered as an unnamed slot.\n */\n @property()\n content: string;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div>${htmlSlot(\"prefix\")}</div>\n <div part=\"content\">\n <b part=\"title\">${htmlSlot(\"title\", this.title)}</b>\n ${htmlSlot(\"\", this.content)}\n </div>\n <div>${htmlSlot(\"suffix\")}</div>\n </div>\n `;\n }\n\n static alert(root: HTMLElement, option: Partial<Alert>): Alert {\n const ai = new this();\n Object.assign(ai, option);\n root.appendChild(ai);\n return ai;\n }\n}\n\nexport default Alert;\nexport { Alert };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{godown,styles,StyleController,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import{ringTypeAttribute,RingBuilder}from"../../internal/ring.js";import
|
1
|
+
import{godown as e,styles as t,StyleController as n,htmlSlot as r}from"@godown/element";import{css as i,html as a}from"lit";import{property as o}from"lit/decorators.js";import{cssGlobalVars as s,GlobalStyle as c}from"../../internal/global-style.js";import{ringTypeAttribute as l,RingBuilder as u}from"../../internal/ring.js";import d from"@oxc-project/runtime/helpers/decorate";const f=`alert`;let p=class e extends c{constructor(){super(),this.ringType=`border`,new n(this,()=>new u({type:this.ringType}).css)}render(){return a`<div part="root"> <div>${r(`prefix`)}</div> <div part="content"> <b part="title">${r(`title`,this.title)}</b> ${r(``,this.content)} </div> <div>${r(`suffix`)}</div> </div>`}static alert(e,t){let n=new this;return Object.assign(n,t),e.appendChild(n),n}};d([o({attribute:l})],p.prototype,`ringType`,void 0),d([o()],p.prototype,`title`,void 0),d([o()],p.prototype,`content`,void 0),p=d([e(`alert`),t(i`:host{background:var(${s.background});color:var(${s.foreground})}:host,:where(:host([contents]) [part=root]),b{display:block}[part=root]{padding:1em;display:grid;grid-template-columns:auto 1fr auto}`)],p);var m=p;export{p as Alert,m as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/web-components/alert/component.ts"],"sourcesContent":["import { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, GlobalStyle } from \"../../internal/global-style.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"alert\";\n\n/**\n * {@linkcode Alert} renders a alert.\n *\n * @slot - Alert content.\n * @slot title - Alert title.\n * @slot prefix - Alert prefix.\n * @slot suffix - Alert suffix.\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n background: var(${cssGlobalVars.background});\n color: var(${cssGlobalVars.foreground});\n }\n\n :host,\n :where(:host([contents]) [part=\"root\"]),\n b {\n display: block;\n }\n\n [part=\"root\"] {\n padding: 1em;\n display: grid;\n grid-template-columns: auto 1fr auto;\n }\n`)\nclass Alert 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 * The title is bold and the icon height is the same as it.\n */\n @property()\n title: string;\n\n /**\n * Content, if zero value, will be rendered as an unnamed slot.\n */\n @property()\n content: string;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div>${htmlSlot(\"prefix\")}</div>\n <div part=\"content\">\n <b part=\"title\">${htmlSlot(\"title\", this.title)}</b>\n ${htmlSlot(\"\", this.content)}\n </div>\n <div>${htmlSlot(\"suffix\")}</div>\n </div>\n `;\n }\n\n static alert(root: HTMLElement, option: Partial<Alert>): Alert {\n const ai = new this();\n Object.assign(ai, option);\n root.appendChild(ai);\n return ai;\n }\n}\n\nexport default Alert;\nexport { Alert };\n"],"names":["Alert","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/web-components/alert/component.ts"],"sourcesContent":["import { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, GlobalStyle } from \"../../internal/global-style.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"alert\";\n\n/**\n * {@linkcode Alert} renders a alert.\n *\n * @slot - Alert content.\n * @slot title - Alert title.\n * @slot prefix - Alert prefix.\n * @slot suffix - Alert suffix.\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n background: var(${cssGlobalVars.background});\n color: var(${cssGlobalVars.foreground});\n }\n\n :host,\n :where(:host([contents]) [part=\"root\"]),\n b {\n display: block;\n }\n\n [part=\"root\"] {\n padding: 1em;\n display: grid;\n grid-template-columns: auto 1fr auto;\n }\n`)\nclass Alert 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 * The title is bold and the icon height is the same as it.\n */\n @property()\n title: string;\n\n /**\n * Content, if zero value, will be rendered as an unnamed slot.\n */\n @property()\n content: string;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div>${htmlSlot(\"prefix\")}</div>\n <div part=\"content\">\n <b part=\"title\">${htmlSlot(\"title\", this.title)}</b>\n ${htmlSlot(\"\", this.content)}\n </div>\n <div>${htmlSlot(\"suffix\")}</div>\n </div>\n `;\n }\n\n static alert(root: HTMLElement, option: Partial<Alert>): Alert {\n const ai = new this();\n Object.assign(ai, option);\n root.appendChild(ai);\n return ai;\n }\n}\n\nexport default Alert;\nexport { Alert };\n"],"names":["protoName","Alert","GlobalStyle","StyleController","RingBuilder","htmlSlot","ai","option","root","_decorate","property","ringTypeAttribute","godown","styles","cssGlobalVars","Alert$1"],"mappings":"0XAOA,MAAMA,EAAY,QAWlB,IAAAC,EAAA,MAmBMA,UAAcC,CAAY,CAC9B,aAAc,CACZ,aAKF,SAAqB,SAJnB,IAAIC,EAAgB,SAAY,IAAIC,EAAY,CAAE,KAAM,KAAK,WAAY,KAkBjE,QAA4B,CACpC,MAAO,EAAI,0BAEAC,EAAS,UAAU,8CAENA,EAAS,QAAS,KAAK,OAAO,OAC9CA,EAAS,GAAI,KAAK,SAAA,eAEfA,EAAS,UAAU,eAKhC,OAAO,MAAM,EAAmB,EAA+B,CAC7D,IAAMC,EAAK,IAAI,KAGf,OAFA,OAAO,OAAOA,EAAIC,GAClBC,EAAK,YAAYF,GACVA,IAhCRG,EAAA,CAAAC,EAAS,CAAE,UAAWC,KAAAV,EAAA,UAAA,WAAA,QAMtBQ,EAAA,CAAAC,KAAAT,EAAA,UAAA,QAAA,QAMAQ,EAAA,CAAAC,KAAAT,EAAA,UAAA,UAAA,aArCFW,EAAO,SACPC,EAAO,CAAG,wBAEWC,EAAc,WAAW,cAC9BA,EAAc,WAAW,8IAyD1C,IAAAC,EAAed"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,WAAW
|
1
|
+
{"mappings":"AAAA,OAAO,WAAW;AAIlB,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB","names":[],"sources":["../../../../src/web-components/alert/definition.ts"],"sourcesContent":["import Alert from \"./component.js\";\n\nAlert.define();\n\nexport default Alert;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-alert\": Alert;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../../src/web-components/alert/definition.ts"],"sourcesContent":["import Alert from \"./component.js\";\n\nAlert.define();\n\nexport default Alert;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-alert\": Alert;\n }\n}\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../../src/web-components/alert/definition.ts"],"sourcesContent":["import Alert from \"./component.js\";\n\nAlert.define();\n\nexport default Alert;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-alert\": Alert;\n }\n}\n"],"names":["Alert"],"mappings":"8BAEAA,EAAM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AACA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC;AAI/C,SAAS,mBAAkC;;;;;;;;;;AAa3C,cAuCM,eAAe,YAAY;;;;;CAK/B,AACA;;;;CAKA,AACA;;;;CAKA,AACA;CAEA,UAAU,UAAU,eAAe;CAWnC,UAAU,iBAAiB,eAAe;CAmB1C;CAIA,UAAU;;AAKZ,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/avatar/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { omit } from \"sharekit\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"avatar\";\n\n/**\n * {@linkcode Avatar} renders a avatar.\n *\n * Renders as an image if it has a src property,\n * otherwise falls back to name or nameless slot.\n *\n * @slot - Display content if no `src` or `name` provided.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n color: var(${cssGlobalVars.foreground});\n background: var(${cssGlobalVars.passive});\n vertical-align: bottom;\n overflow: hidden;\n width: 2em;\n height: 2em;\n }\n\n :host,\n [part=\"root\"] {\n display: inline-flex;\n }\n\n :host([contents]) [part=\"root\"] {\n display: inline-flex;\n width: inherit;\n height: inherit;\n }\n\n :host([round]) {\n border-radius: 50%;\n }\n\n [part=\"image\"] {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n [part=\"root\"] {\n position: relative;\n border-radius: inherit;\n align-items: center;\n justify-content: center;\n }\n`)\nclass Avatar extends GlobalStyle {\n /**\n * The `src` property specifies the URL of the avatar image.\n * If `src` is not provided, the component will display the `name` property instead.\n */\n @property()\n src: string | undefined | null;\n\n /**\n * Specifies the name or initials to display if no `src` is provided\n */\n @property()\n name = \"\";\n\n /**\n * If `true`, will make the avatar display as a circle.\n */\n @property({ type: Boolean })\n round = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(omit(this.observedRecord, \"src\"))}\n >\n ${this._renderAvatar()}\n </div>\n `;\n }\n\n protected _renderAvatar(): TemplateResult<1> {\n if (this.src) {\n return html`\n <img\n part=\"image\"\n src=\"${this.src}\"\n alt=\"${this.name}\"\n @error=${this._handleError}\n />\n `;\n }\n if (this.name) {\n return html`\n <span part=\"name\">${this.formatName()}</span>\n `;\n }\n return htmlSlot();\n }\n\n formatName(): string {\n return this.name;\n }\n\n protected _handleError(): void {\n this.src = undefined;\n }\n}\n\nexport default Avatar;\nexport { Avatar };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{godown,styles,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{omit}from"sharekit";import{cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import
|
1
|
+
import{godown as e,styles as t,attr as n,htmlSlot as r}from"@godown/element";import{css as i,html as a}from"lit";import{property as o}from"lit/decorators.js";import{omit as s}from"sharekit";import{cssGlobalVars as c,GlobalStyle as l}from"../../internal/global-style.js";import u from"@oxc-project/runtime/helpers/decorate";const d=`avatar`;let f=class e extends l{constructor(...e){super(...e),this.name=``,this.round=!1}render(){return a`<div part="root" ${n(s(this.observedRecord,`src`))}> ${this._renderAvatar()} </div>`}_renderAvatar(){return this.src?a`<img part="image" src="${this.src}" alt="${this.name}" @error=${this._handleError}/>`:this.name?a`<span part="name">${this.formatName()}</span>`:r()}formatName(){return this.name}_handleError(){this.src=void 0}};u([o()],f.prototype,`src`,void 0),u([o()],f.prototype,`name`,void 0),u([o({type:Boolean})],f.prototype,`round`,void 0),f=u([e(`avatar`),t(i`:host{color:var(${c.foreground});background:var(${c.passive});vertical-align:bottom;overflow:hidden;width:2em;height:2em}:host,[part=root]{display:inline-flex}:host([contents]) [part=root]{display:inline-flex;width:inherit;height:inherit}:host([round]){border-radius:50%}[part=image]{width:100%;height:100%;object-fit:cover}[part=root]{position:relative;border-radius:inherit;align-items:center;justify-content:center}`)],f);var p=f;export{f as Avatar,p as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/web-components/avatar/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { omit } from \"sharekit\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"avatar\";\n\n/**\n * {@linkcode Avatar} renders a avatar.\n *\n * Renders as an image if it has a src property,\n * otherwise falls back to name or nameless slot.\n *\n * @slot - Display content if no `src` or `name` provided.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n color: var(${cssGlobalVars.foreground});\n background: var(${cssGlobalVars.passive});\n vertical-align: bottom;\n overflow: hidden;\n width: 2em;\n height: 2em;\n }\n\n :host,\n [part=\"root\"] {\n display: inline-flex;\n }\n\n :host([contents]) [part=\"root\"] {\n display: inline-flex;\n width: inherit;\n height: inherit;\n }\n\n :host([round]) {\n border-radius: 50%;\n }\n\n [part=\"image\"] {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n [part=\"root\"] {\n position: relative;\n border-radius: inherit;\n align-items: center;\n justify-content: center;\n }\n`)\nclass Avatar extends GlobalStyle {\n /**\n * The `src` property specifies the URL of the avatar image.\n * If `src` is not provided, the component will display the `name` property instead.\n */\n @property()\n src: string | undefined | null;\n\n /**\n * Specifies the name or initials to display if no `src` is provided\n */\n @property()\n name = \"\";\n\n /**\n * If `true`, will make the avatar display as a circle.\n */\n @property({ type: Boolean })\n round = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(omit(this.observedRecord, \"src\"))}\n >\n ${this._renderAvatar()}\n </div>\n `;\n }\n\n protected _renderAvatar(): TemplateResult<1> {\n if (this.src) {\n return html`\n <img\n part=\"image\"\n src=\"${this.src}\"\n alt=\"${this.name}\"\n @error=${this._handleError}\n />\n `;\n }\n if (this.name) {\n return html`\n <span part=\"name\">${this.formatName()}</span>\n `;\n }\n return htmlSlot();\n }\n\n formatName(): string {\n return this.name;\n }\n\n protected _handleError(): void {\n this.src = undefined;\n }\n}\n\nexport default Avatar;\nexport { Avatar };\n"],"names":["Avatar"],"mappings":"
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/web-components/avatar/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { omit } from \"sharekit\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"avatar\";\n\n/**\n * {@linkcode Avatar} renders a avatar.\n *\n * Renders as an image if it has a src property,\n * otherwise falls back to name or nameless slot.\n *\n * @slot - Display content if no `src` or `name` provided.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n color: var(${cssGlobalVars.foreground});\n background: var(${cssGlobalVars.passive});\n vertical-align: bottom;\n overflow: hidden;\n width: 2em;\n height: 2em;\n }\n\n :host,\n [part=\"root\"] {\n display: inline-flex;\n }\n\n :host([contents]) [part=\"root\"] {\n display: inline-flex;\n width: inherit;\n height: inherit;\n }\n\n :host([round]) {\n border-radius: 50%;\n }\n\n [part=\"image\"] {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n [part=\"root\"] {\n position: relative;\n border-radius: inherit;\n align-items: center;\n justify-content: center;\n }\n`)\nclass Avatar extends GlobalStyle {\n /**\n * The `src` property specifies the URL of the avatar image.\n * If `src` is not provided, the component will display the `name` property instead.\n */\n @property()\n src: string | undefined | null;\n\n /**\n * Specifies the name or initials to display if no `src` is provided\n */\n @property()\n name = \"\";\n\n /**\n * If `true`, will make the avatar display as a circle.\n */\n @property({ type: Boolean })\n round = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(omit(this.observedRecord, \"src\"))}\n >\n ${this._renderAvatar()}\n </div>\n `;\n }\n\n protected _renderAvatar(): TemplateResult<1> {\n if (this.src) {\n return html`\n <img\n part=\"image\"\n src=\"${this.src}\"\n alt=\"${this.name}\"\n @error=${this._handleError}\n />\n `;\n }\n if (this.name) {\n return html`\n <span part=\"name\">${this.formatName()}</span>\n `;\n }\n return htmlSlot();\n }\n\n formatName(): string {\n return this.name;\n }\n\n protected _handleError(): void {\n this.src = undefined;\n }\n}\n\nexport default Avatar;\nexport { Avatar };\n"],"names":["protoName","Avatar","GlobalStyle","attr","omit","htmlSlot","_decorate","property","godown","styles","cssGlobalVars","Avatar$1"],"mappings":"mUAOA,MAAMA,EAAY,SAWlB,IAAAC,EAAA,MAuCMA,UAAeC,CAAY,oCAY/B,KAAO,QAMP,MAAQ,GAEE,QAA4B,CACpC,MAAO,EAAI,oBAGLC,EAAKC,EAAK,KAAK,eAAgB,QAAA,IAE/B,KAAK,gBAAA,SAKH,eAAmC,CAgB3C,OAfI,KAAK,IACA,CAAI,0BAGA,KAAK,IAAI,SACT,KAAK,KAAK,WACR,KAAK,aAAA,IAIhB,KAAK,KACA,CAAI,qBACW,KAAK,aAAa,SAGnCC,IAGT,YAAqB,CACnB,OAAO,KAAK,KAGJ,cAAqB,CAC7B,KAAK,IAAM,SAlDZC,EAAA,CAAAC,KAAAN,EAAA,UAAA,MAAA,QAMAK,EAAA,CAAAC,KAAAN,EAAA,UAAA,OAAA,QAMAK,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAN,EAAA,UAAA,QAAA,aAxDnBO,EAAO,UACPC,EAAO,CAAG,mBAEMC,EAAc,WAAW,mBACpBA,EAAc,QAAQ,6WA8F5C,IAAAC,EAAeV"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,YAAY
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY;AAInB,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB","names":[],"sources":["../../../../src/web-components/avatar/definition.ts"],"sourcesContent":["import Avatar from \"./component.js\";\n\nAvatar.define();\n\nexport default Avatar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-avatar\": Avatar;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../../src/web-components/avatar/definition.ts"],"sourcesContent":["import Avatar from \"./component.js\";\n\nAvatar.define();\n\nexport default Avatar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-avatar\": Avatar;\n }\n}\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../../src/web-components/avatar/definition.ts"],"sourcesContent":["import Avatar from \"./component.js\";\n\nAvatar.define();\n\nexport default Avatar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-avatar\": Avatar;\n }\n}\n"],"names":["Avatar"],"mappings":"8BAEAA,EAAO"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAEA,OAAO,YAAY
|
1
|
+
{"mappings":"AAEA,OAAO,YAAY;;;;;;;AAWnB,cAUM,cAAc,OAAO;CACzB;CACA,OAAO,OAAO;;AAGhB,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/badge/component.ts"],"sourcesContent":["import { godown, styles } from \"@godown/element\";\n\nimport Button from \"../button/component.js\";\nimport { css } from \"lit\";\n\nconst protoName = \"badge\";\n\n/**\n * {@linkcode Badge} renders a badge.\n *\n * @slot - Badge content.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n font-size: 0.75em;\n }\n\n [part=\"root\"] {\n padding: 0 0.5em;\n }\n`)\nclass Badge extends Button {\n plain: never = true as never;\n round: Button[\"round\"] = true;\n}\n\nexport default Badge;\nexport { Badge };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{godown,styles}from"@godown/element";import
|
2
|
-
`)],
|
1
|
+
import{godown as e,styles as t}from"@godown/element";import n from"../button/component.js";import{css as r}from"lit";import i from"@oxc-project/runtime/helpers/decorate";const a=`badge`;let o=class e extends n{constructor(...e){super(...e),this.plain=!0,this.round=!0}};o=i([e(`badge`),t(r`:host{font-size:.75em}[part=root]{padding:0 .5em}
|
2
|
+
`)],o);var s=o;export{o as Badge,s as default};
|
3
3
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/web-components/badge/component.ts"],"sourcesContent":["import { godown, styles } from \"@godown/element\";\n\nimport Button from \"../button/component.js\";\nimport { css } from \"lit\";\n\nconst protoName = \"badge\";\n\n/**\n * {@linkcode Badge} renders a badge.\n *\n * @slot - Badge content.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n font-size: 0.75em;\n }\n\n [part=\"root\"] {\n padding: 0 0.5em;\n }\n`)\nclass Badge extends Button {\n plain: never = true as never;\n round: Button[\"round\"] = true;\n}\n\nexport default Badge;\nexport { Badge };\n"],"names":["Badge"],"mappings":"
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/web-components/badge/component.ts"],"sourcesContent":["import { godown, styles } from \"@godown/element\";\n\nimport Button from \"../button/component.js\";\nimport { css } from \"lit\";\n\nconst protoName = \"badge\";\n\n/**\n * {@linkcode Badge} renders a badge.\n *\n * @slot - Badge content.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n font-size: 0.75em;\n }\n\n [part=\"root\"] {\n padding: 0 0.5em;\n }\n`)\nclass Badge extends Button {\n plain: never = true as never;\n round: Button[\"round\"] = true;\n}\n\nexport default Badge;\nexport { Badge };\n"],"names":["protoName","Badge","Button","godown","styles","Badge$1"],"mappings":"0KAKA,MAAMA,EAAY,QAQlB,IAAAC,EAAA,MAUMA,UAAcC,CAAO,oCACzB,MAAe,QACf,MAAyB,UAZ1BC,EAAO,SACPC,EAAO,CAAG;OAcX,IAAAC,EAAeJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,WAAW
|
1
|
+
{"mappings":"AAAA,OAAO,WAAW;AAIlB,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB","names":[],"sources":["../../../../src/web-components/badge/definition.ts"],"sourcesContent":["import Badge from \"./component.js\";\n\nBadge.define();\n\nexport default Badge;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-badge\": Badge;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../../src/web-components/badge/definition.ts"],"sourcesContent":["import Badge from \"./component.js\";\n\nBadge.define();\n\nexport default Badge;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-badge\": Badge;\n }\n}\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../../src/web-components/badge/definition.ts"],"sourcesContent":["import Badge from \"./component.js\";\n\nBadge.define();\n\nexport default Badge;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-badge\": Badge;\n }\n}\n"],"names":["Badge"],"mappings":"8BAEAA,EAAM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AACA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC;AAG/C,SAAS,mBAA+C;;;;;;;;;;;;;;;;AAsBxD,cAqEM,eAAe,YAAY;;;;;;CAM/B,AACA;;;;CAKA,AACA;CAEA;CAKA,UAAU,UAAU,eAAe;CAYnC,UAAU,YAAY,eAAe,eAAe;CASpD,UAAU;CAMV,UAAU,cAAc;;AAe1B,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/breath/component.ts"],"sourcesContent":["import { attr, godown, 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\";\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 constructor() {\n super();\n new StyleController(this, () => this._computeStyle(this.getTexts().length));\n }\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)}\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{godown,styles,StyleController,attr}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import
|
1
|
+
import{godown as e,styles as t,StyleController as n,attr as r}from"@godown/element";import{css as i,html as a}from"lit";import{property as o}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as c,GlobalStyle as l}from"../../internal/global-style.js";import u from"@oxc-project/runtime/helpers/decorate";const d=`breath`,f=s(d),p=/[\s,]+/;let m=class e extends l{constructor(){super(),new n(this,()=>this._computeStyle(this.getTexts().length))}render(){let e=this.getTexts();return a`<div part="root" ${r(this.observedRecord)}> ${e.map(this._renderText)} </div>`}_renderText(e){return a`<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(p).filter(e=>e)}_computeStyle(e){let t=100/2/e,n=this.duration||(e*2+2)*1e3,r=``;for(let t=1;t<=e;t++){let i=-n/e*(e-t+1),a=(t-1)%3+1;r+=`.rel:nth-child(${t}) .colorful{animation-delay:${i}ms;background:var(${f}--${t},var(${f}--${a}));}`}return`.colorful{animation-duration:${n}ms;}@keyframes colorfulN{0%,${t*3}%{opacity:0;}${t}%,${t*2}%{opacity:1;}}${r}`}};u([o()],m.prototype,`content`,void 0),u([o({type:Number})],m.prototype,`duration`,void 0),m=u([e(d),t(i`:host{${f}--deg:60deg;${f}--1-1:hsl(0 70% 55%);${f}--1-2:hsl(30 90% 60%);${f}--2-1:hsl(130 70% 50%);${f}--2-2:hsl(180 60% 40%);${f}--3-1:hsl(270 80% 55%);${f}--3-2:hsl(210 90% 50%);${f}--1:linear-gradient(var(${f}--deg),var(${f}--1-1),var(${f}--1-2));${f}--2:linear-gradient(var(${f}--deg),var(${f}--2-1),var(${f}--2-2));${f}--3:linear-gradient(var(${f}--deg),var(${f}--3-1),var(${f}--3-2))}`,i`: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} `,i`.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(${c.backgroundClip})}`)],m);var h=m;export{m as Breath,h as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/web-components/breath/component.ts"],"sourcesContent":["import { attr, godown, 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\";\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 constructor() {\n super();\n new StyleController(this, () => this._computeStyle(this.getTexts().length));\n }\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)}\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}%,${gap * 2}%{opacity:1;}}${style1}`;\n }\n}\n\nexport default Breath;\nexport { Breath };\n"],"names":["Breath","texts","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/web-components/breath/component.ts"],"sourcesContent":["import { attr, godown, 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\";\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 constructor() {\n super();\n new StyleController(this, () => this._computeStyle(this.getTexts().length));\n }\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)}\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":["defineName","cssScope","scopePrefix","splitTextRegexp","Breath","GlobalStyle","StyleController","texts","attr","text","x","gap","len","duration","style1","number","delay","defaultNumber","_decorate","property","godown","styles","cssGlobalVars","Breath$1"],"mappings":"2TAMA,MAAMA,EAAa,SACbC,EAAWC,EAAYF,GAEvBG,EAAkB,SAiBxB,IAAAC,EAAA,MAqEMA,UAAeC,CAAY,CAe/B,aAAc,CACZ,QACA,IAAIC,EAAgB,SAAY,KAAK,cAAc,KAAK,WAAW,SAG3D,QAA4B,CACpC,IAAMC,EAAQ,KAAK,WACnB,MAAO,EAAI,oBAGLC,EAAK,KAAK,gBAAA,IAEVD,EAAM,IAAI,KAAK,aAAA,SAKb,YAAY,EAAiC,CACrD,MAAO,EAAI,4CAEiBE,EAAK,iCACJA,EAAK,iBAK1B,UAAqB,CAC7B,OAAO,MAAM,QAAQ,KAAK,SACtB,KAAK,SACJ,KAAK,SAAW,KAAK,aAAa,MAAMN,GAAiB,OAAQ,GAAMO,GAGpE,cAAc,EAAqB,CAC3C,IAAMC,EAAM,IAAM,EAAIC,EAChBC,EAAW,KAAK,WAAaD,EAAM,EAAI,GAAK,IAC9CE,EAAS,GACb,IAAK,IAAIC,EAAS,EAAGA,GAAUH,EAAK,IAAU,CAC5C,IAAMI,EAAS,CAACH,EAAWD,GAAQA,EAAMG,EAAS,GAC5CE,GAAkBF,EAAS,GAAK,EAAK,EAC3C,GAAU,kBAAkBA,EAAO,8BAA8BC,EAAM,oBAAoBf,EAAS,IAAIc,EAAO,OAAOd,EAAS,IAAIgB,EAAc,MAEnJ,MAAO,gCAAgCJ,EAAS,8BAA8BF,EAAM,EAAE,eAAeA,EAAI,IACvGA,EAAM,EACP,gBAAgBG,MApDlBI,EAAA,CAAAC,KAAAf,EAAA,UAAA,UAAA,QAMAc,EAAA,CAAAC,EAAS,CAAE,KAAM,UAAAf,EAAA,UAAA,WAAA,aAjFnBgB,EAAOpB,GACPqB,EACC,CAAG,SAEGpB,EAAS,cACTA,EAAS,uBACTA,EAAS,wBACTA,EAAS,yBACTA,EAAS,yBACTA,EAAS,yBACTA,EAAS,yBACTA,EAAS,0BAA2BA,EAAS,aAAcA,EAAS,aAAcA,EAAS,UAC3FA,EAAS,0BAA2BA,EAAS,aAAcA,EAAS,aAAcA,EAAS,UAC3FA,EAAS,0BAA2BA,EAAS,aAAcA,EAAS,aAAcA,EAAS,UAGjG,CAAG,sSA6BH,CAAG,ySAoBmBqB,EAAc,eAAe,SAkErD,IAAAC,EAAenB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,YAAY
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY;AAInB,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB","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 e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
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":"
|
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":["Breath"],"mappings":"8BAEAA,EAAO"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AACA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC;AAG/C,SAAS,mBAA+C;;;;;;;;;AAaxD,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,aAAa,GAAG;CAW1B,UAAU,aAAa,GAAG;;AA+B5B,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/button/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, query } 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 @query(\"[part=modal-root]\")\n protected _modalRoot: HTMLElement;\n @query(\"[part=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{godown,styles,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property,query}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import
|
1
|
+
import{godown as e,styles as t,attr as n,htmlSlot as r}from"@godown/element";import{css as i,html as a}from"lit";import{property as o,query as s}from"lit/decorators.js";import{scopePrefix as c,cssGlobalVars as l,GlobalStyle as u}from"../../internal/global-style.js";import d from"@oxc-project/runtime/helpers/decorate";const f=`button`,p=c(f);let m=class e extends u{constructor(...e){super(...e),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return a`<div part="root" ${n(this.observedRecord)}> ${r(``,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 t=document.createElement(`i`),{width:n,height:r}=this.getBoundingClientRect(),{x:i,y:a}=this._root.getBoundingClientRect(),o=`${Math.sqrt(r**2+n**2)*2}px`;t.style.height=o,t.style.width=o,t.style.left=`${e.x-i}px`,t.style.top=`${e.y-a}px`,this._modalRoot.appendChild(t);let s=[{transform:`scale(0) translate(-50%, -50%)`,opacity:.1},{transform:`scale(1) translate(-50%, -50%)`,offset:.8},{opacity:0}];t.animate(s,{duration:800,iterations:1}),t.addEventListener(`animationend`,()=>t.remove(),{once:!0})}};d([o({type:Boolean,reflect:!0})],m.prototype,`plain`,void 0),d([o({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),d([o({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),d([o({type:Boolean,reflect:!0})],m.prototype,`round`,void 0),d([o()],m.prototype,`content`,void 0),d([s(`[part=modal-root]`)],m.prototype,`_modalRoot`,void 0),d([s(`[part=root]`)],m.prototype,`_root`,void 0),m=d([e(f),t(i`:host(:not([disabled]):active){transform:scale(var(${p}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${p}--gradients:unset;${p}--focus-scale:unset}`,i`:host{${p}--modal-animation-duration:1.5s;${p}--focus-scale:.97;${p}--deg:45deg;color:var(${l.primaryForeground});background:var(${l.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}`)],m);var h=m;export{m as Button,h as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/web-components/button/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, query } 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 @query(\"[part=modal-root]\")\n protected _modalRoot: HTMLElement;\n @query(\"[part=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","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/web-components/button/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, query } 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 @query(\"[part=modal-root]\")\n protected _modalRoot: HTMLElement;\n @query(\"[part=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":["protoName","cssScope","scopePrefix","Button","GlobalStyle","attr","htmlSlot","modal","size","height","width","x","y","keyframes","property","_decorate","query","godown","styles","cssGlobalVars","Button$1"],"mappings":"+TAMA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAU7B,IAAAG,EAAA,MA0DMA,UAAeC,CAAY,oCAK/B,MAAQ,QAMR,SAAW,QAMX,OAAS,QAMT,MAAQ,GAaE,QAA4B,CACpC,MAAO,EAAI,oBAGLC,EAAK,KAAK,gBAAA,IAEVC,EAAS,GAAI,KAAK,SAAA,yCAM1B,OAAc,CACR,KAAK,WAGT,KAAK,OAAS,GACd,MAAM,SAGR,MAAa,CACX,KAAK,OAAS,GACd,MAAM,OAGR,mBAA0B,CACxB,MAAM,oBACN,KAAK,OAAO,IAAI,KAAM,QAAS,KAAK,cAG5B,aAAa,EAAqB,CAC1C,GAAI,KAAK,SAAU,CACjB,EAAE,kBACF,EAAE,iBACF,OAEG,KAAK,OACR,KAAK,aAAa,GAIZ,aAAa,EAAqB,CAC1C,IAAMC,EAAQ,SAAS,cAAc,KAC/B,CAAE,QAAO,UAAW,KAAK,wBACzB,CAAE,IAAG,KAAM,KAAK,MAAM,wBACtBC,EAAO,GAAG,KAAK,KAAKC,GAAU,EAAIC,GAAS,GAAK,EAAE,IACxD,EAAM,MAAM,OAASF,EACrB,EAAM,MAAM,MAAQA,EACpB,EAAM,MAAM,KAAO,GAAG,EAAE,EAAIG,EAAE,IAC9B,EAAM,MAAM,IAAM,GAAG,EAAE,EAAIC,EAAE,IAC7B,KAAK,WAAW,YAAYL,GAC5B,IAAMM,EAAY,CAChB,CACE,UAAW,iCACX,QAAS,IAEX,CACE,UAAW,iCACX,OAAQ,IAEV,CACE,QAAS,IAGbN,EAAM,QAAQM,EAAW,CACvB,SAAU,IACV,WAAY,IAEdN,EAAM,iBAAiB,mBAAsBA,EAAM,SAAU,CAAE,KAAM,UApGtEO,EAAS,CAAE,KAAM,QAAS,QAAS,qCAMnCA,EAAS,CAAE,KAAM,QAAS,QAAS,wCAMnCA,EAAS,CAAE,KAAM,QAAS,QAAS,sCAMnCA,EAAS,CAAE,KAAM,QAAS,QAAS,kCAMnCC,EAAA,CAAAD,KAAAX,EAAA,UAAA,UAAA,WAGAa,EAAM,sBAAAb,EAAA,UAAA,aAAA,WAENa,EAAM,gBAAAb,EAAA,UAAA,QAAA,aA3FRc,EAAOjB,GACPkB,EACC,CAAG,sDAEwBjB,EAAS,6IAa9BA,EAAS,oBACTA,EAAS,sBAGf,CAAG,SAEGA,EAAS,kCACTA,EAAS,oBACTA,EAAS,wBACEkB,EAAc,kBAAkB,mBAC3BA,EAAc,kBAAkB,+ZA2IxD,IAAAC,EAAejB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,YAAY
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY;AAInB,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB","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 e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
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":"
|
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":["Button"],"mappings":"8BAEAA,EAAO"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AACA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC;AAG/C,SAAS,mBAA+C;AAExD,cAA8C,gBAAgB;;;;;;;;;;;;AAgB9D,cA0BM,aAAa,YAAY;CAC7B;CAKA,AACA,UAAU;;;;CAKV,AACA;;;;CAKA,AACA;CAEA,UAAU,UAAU,eAAe;;AAYrC,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{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
|
1
|
+
import{godown as e,styles as t,StyleController as n,attr as r,htmlSlot as i}from"@godown/element";import{css as a,html as o}from"lit";import{property as s}from"lit/decorators.js";import{scopePrefix as c,cssGlobalVars as l,GlobalStyle as u}from"../../internal/global-style.js";import{ringTypeAttribute as d,RingBuilder as f}from"../../internal/ring.js";import p from"@oxc-project/runtime/helpers/decorate";const m=`card`;c(m);let h=class e extends u{constructor(){super(),this.ringType=`border`,this.footer=!1,this.header=!1,new n(this,()=>new f({type:this.ringType}).css)}render(){return o`<div part="root" ${r(this.observedRecord)}> ${[this.header?i(`header`):``,i(),this.footer?i(`footer`):``]} </div>`}};p([s({attribute:d})],h.prototype,`ringType`,void 0),p([s({type:Boolean})],h.prototype,`footer`,void 0),p([s({type:Boolean})],h.prototype,`header`,void 0),h=p([e(m),t(a`:host{background:var(${l.background});color:var(${l.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}`)],h);var g=h;export{h as Card,g as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
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":"
|
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":["protoName","scopePrefix","Card","GlobalStyle","StyleController","RingBuilder","attr","htmlSlot","_decorate","property","ringTypeAttribute","godown","styles","cssGlobalVars","Card$1"],"mappings":"qZAQA,MAAMA,EAAY,OACDC,EAAYD,GAa7B,IAAAE,EAAA,MA0BMA,UAAaC,CAAY,CAC7B,aAAc,CACZ,aAKF,SAAqB,cAMrB,OAAS,QAMT,OAAS,GAhBP,IAAIC,EAAgB,SAAY,IAAIC,EAAY,CAAE,KAAM,KAAK,WAAY,KAkBjE,QAA4B,CACpC,MAAO,EAAI,oBAGLC,EAAK,KAAK,gBAAA,IAEV,CAAC,KAAK,OAASC,EAAS,UAAY,GAAIA,IAAY,KAAK,OAASA,EAAS,UAAY,IAAI,WArBlGC,EAAA,CAAAC,EAAS,CAAE,UAAWC,KAAAR,EAAA,UAAA,WAAA,QAMtBM,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAP,EAAA,UAAA,SAAA,QAMjBM,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAP,EAAA,UAAA,SAAA,aA5CnBS,EAAOX,GACPY,EAAO,CAAG,wBAEWC,EAAc,WAAW,cAC9BA,EAAc,WAAW,iKAuD1C,IAAAC,EAAeZ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAAA,OAAO,UAAU
|
1
|
+
{"mappings":"AAAA,OAAO,UAAU;AAIjB,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe","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 e from"./component.js";e.define();export{e as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
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":"
|
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":["Card"],"mappings":"8BAEAA,EAAK"}
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AAGA,cAAc,sBAAiC
|
1
|
+
{"mappings":"AAGA,cAAc,sBAAiC;AAG/C,SAAS,mBAAmB;;;;;;;;;;;AAkB5B,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,yBAAyB,cAAc,qBAAqB;CAO5D,KAAK,WAAW;CAgBhB;CASA;CASA,UAAU,cAAc,gBAAgB;CAKxC,UAAU;CASV,eAAe;;AAWjB,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/carousel/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, 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, query } 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 @query(\"[part=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"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{godown,styles,attr,htmlSlot}from"@godown/element";import
|
2
|
-
`)],
|
1
|
+
import{godown as e,styles as t,attr as n,htmlSlot as r}from"@godown/element";import i from"../../internal/icons/caret-left.js";import a from"../../internal/icons/caret-right.js";import{css as o,html as s}from"lit";import{property as c,query as l}from"lit/decorators.js";import{GlobalStyle as u}from"../../internal/global-style.js";import d from"@oxc-project/runtime/helpers/decorate";const f=`carousel`;function p(e){return e.getBoundingClientRect().width}let m=class e extends u{constructor(...e){super(...e),this.index=0,this.autoChange=0}render(){return s`<div part="root" ${n(this.observedRecord)}> <i part="prev" @click="${this.prev}"> ${i()} </i> <div part="move-root">${r()}</div> <i part="next" @click="${this.next}"> ${a()} </i> </div>`}connectedCallback(){super.connectedCallback(),this.children.length&&(this.__cloneFirst?.remove(),this.__cloneLast?.remove(),this.__cloneLast=this.firstElementChild.cloneNode(!0),this.__cloneFirst=this.lastElementChild.cloneNode(!0),this.appendChild(this.__cloneLast),this.insertBefore(this.__cloneFirst,this.firstElementChild)),this.observers.add(this,ResizeObserver,()=>{this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,!0)})}async firstUpdated(){await this.updateComplete,this.show(this.index,!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`index`&&this.isConnected&&this.show(this.index)}show(e,t){e=this.normalizeIndex(e),this.index=e,this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,t),this.dispatchCustomEvent(`change`,e),this.timeouts.remove(this.intervalID),this.autoChange>0&&(this.intervalID=this.timeouts.add(setInterval(()=>{this.next()},this.autoChange)))}next(){this.index===this.childElementCount-3?(this._doTranslateX(`0`,!0),this.show(0)):this.show(this.index+1)}prev(){this.index===0?(this._doTranslateX(`-${this.childElementCount-1}00%`,!0),this.show(this.children.length-3)):this.show(this.index-1)}_doTranslateX(e,t){this._moveRoot.style.transform=`translateX(${e})`,this._moveRoot.style.transition=t?`none`:``}_computeOffset(){let e=0;for(let t=0;t<=this.index;t++)e-=p(this.children[t]);return e+=(p(this)-p(this.children[this.index+1]))/2,e}normalizeIndex(e){return e<0?0:e>this.children.length-3?this.children.length-3:e}};d([c({type:Number})],m.prototype,`index`,void 0),d([c({type:Number})],m.prototype,`autoChange`,void 0),d([l(`[part=move-root]`)],m.prototype,`_moveRoot`,void 0),m=d([e(`carousel`),t(o`:host{display:block;transition:.3s}[part=root]{direction:ltr;overflow:hidden}[part=root],[part=move-root]{height:100%;width:100%;display:flex;position:relative;transition:inherit}[part=prev],[part=next]{height:100%;width:1.5em;z-index:1;position:absolute;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none}[part=prev]{left:0}[part=next]{right:0}slot::slotted(*){flex-shrink:0!important}
|
2
|
+
`)],m);var h=m;export{m as Carousel,h as default};
|
3
3
|
//# sourceMappingURL=component.js.map
|