@brightspot/ui 6.8.0 → 6.8.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/dist/storybook/assets/{ActionBar.stories-CJBn-mku.js → ActionBar.stories-BOXYJYXy.js} +31 -28
- package/dist/storybook/assets/ActionItem-WoDvowFu.js +16 -0
- package/dist/storybook/assets/{ActionItem.stories-DXzC9C1u.js → ActionItem.stories-CVFoWP54.js} +2 -2
- package/dist/storybook/assets/AiSparkle.stories-Psv9jNpy.js +73 -0
- package/dist/storybook/assets/Avatar-CIQcHS8b.js +4 -0
- package/dist/storybook/assets/Avatar.stories-BE2Xn8fx.js +213 -0
- package/dist/storybook/assets/AvatarGroup-Chs0VKPg.js +1 -0
- package/dist/storybook/assets/AvatarGroup.stories-2ar6gCeX.js +225 -0
- package/dist/storybook/assets/Badge-AV20mCMJ.js +1 -0
- package/dist/storybook/assets/{Badge.stories-DEpoJpUZ.js → Badge.stories-w9LqNw0A.js} +4 -4
- package/dist/storybook/assets/Banner-FSFX1AIb.css +1 -0
- package/dist/storybook/assets/{Banner.stories--jeU6fKq.js → Banner.stories-Clhh1bBs.js} +14 -14
- package/dist/storybook/assets/Button-B7fn_wd5.js +10 -0
- package/dist/storybook/assets/Button.stories-5h4M8nd2.js +54 -0
- package/dist/storybook/assets/ButtonGroup-BmndBsBy.js +1 -0
- package/dist/storybook/assets/{ButtonGroup.stories-CerE_0AC.js → ButtonGroup.stories-CR1H4H7u.js} +7 -7
- package/dist/storybook/assets/Card-DyntwdY-.css +1 -0
- package/dist/storybook/assets/{Card.stories-5SxHtU3Y.js → Card.stories-Bz5vXq5y.js} +60 -29
- package/dist/storybook/assets/{Celebrate.stories-COS789GX.js → Celebrate.stories-Bu3CNw0k.js} +5 -5
- package/dist/storybook/assets/Checkbox-BALsanB1.js +30 -0
- package/dist/storybook/assets/{Checkbox.stories-DuQu38Gv.js → Checkbox.stories-BdvCht5c.js} +10 -10
- package/dist/storybook/assets/CircularProgress-BeE2fWON.js +42 -0
- package/dist/storybook/assets/{CircularProgress.stories-Lf2Ws46Y.js → CircularProgress.stories-CL8Lc6eU.js} +2 -2
- package/dist/storybook/assets/ClipboardMixin-C6wcbXIO.js +1 -0
- package/dist/storybook/assets/{ClipboardMixin.stories-BT5KfLZ_.js → ClipboardMixin.stories-BsjzC7wd.js} +6 -6
- package/dist/storybook/assets/{Color-6BZIO3FS-BNBxjqrS.js → Color-6BZIO3FS-Dsd6EVV9.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-Ck6bXbd0.js → Colors.stories-CkCdNN9Y.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-DLELdAMr.js → CombinedEffects.stories-QG78pIiG.js} +2 -2
- package/dist/storybook/assets/{ComponentStatesMixin-B6uJL_2c.js → ComponentStatesMixin-CG-Dx_Vk.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-fiyrALkY.js → ComponentStatesMixin.stories-B1yuAqua.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-2OfBH19_.js → CopyToClipboard.stories-CyKcumJ9.js} +18 -10
- package/dist/storybook/assets/{Debounce.stories-C9qo3lIN.js → Debounce.stories-BuNskQ33.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CBVYZYjR.js → DocsRenderer-LL677BLK-BrPyc8XX.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-15ZDMkRz.js → Dropdown.stories-DHXeP07z.js} +2 -2
- package/dist/storybook/assets/DropdownMenu-WoWnJiQk.js +42 -0
- package/dist/storybook/assets/EmptyState-h0A4Qpiu.css +1 -0
- package/dist/storybook/assets/{EmptyState.stories-Bjb8hzYj.js → EmptyState.stories-BRoVusey.js} +33 -21
- package/dist/storybook/assets/EscaAvatar.stories-CWAE-4Uz.js +140 -0
- package/dist/storybook/assets/{Events.stories-BV0vMF2I.js → Events.stories-D-npDwlx.js} +2 -2
- package/dist/storybook/assets/{Heading.stories-CEUJqUbQ.js → Heading.stories-D7hmvFEN.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CwvtcOM_.js → HueRipple.stories-Dx3ozdHi.js} +2 -2
- package/dist/storybook/assets/Icon-DPQKiWDz.js +34409 -0
- package/dist/storybook/assets/{Icon.stories-AB_v-61c.js → Icon.stories-CVsQvcwd.js} +10 -10
- package/dist/storybook/assets/IconButton-Dp4Z06bL.js +12 -0
- package/dist/storybook/assets/{IconButton.stories-BHuHsM3k.js → IconButton.stories-DTbfHfcQ.js} +2 -2
- package/dist/storybook/assets/LinearProgress-DG3tPlGH.js +25 -0
- package/dist/storybook/assets/{LinearProgress.stories-BNN5SXe3.js → LinearProgress.stories-VIU6OqYd.js} +2 -2
- package/dist/storybook/assets/Message-BzkpGg8z.js +28 -0
- package/dist/storybook/assets/Message-CM3eexdu.css +1 -0
- package/dist/storybook/assets/{Message.stories-DdLhMXnb.js → Message.stories-C9bzoQes.js} +2 -2
- package/dist/storybook/assets/OnFindMixin-CeeYfx9k.js +1 -0
- package/dist/storybook/assets/{OnFindMixin.stories-B-5TeBOF.js → OnFindMixin.stories-Dq06nuVf.js} +9 -9
- package/dist/storybook/assets/Pagination-CnWa6AX5.js +88 -0
- package/dist/storybook/assets/{Pagination.stories-C9zsOdb2.js → Pagination.stories-BsH2eN2W.js} +33 -33
- package/dist/storybook/assets/{Popover.stories-BiqIwebU.js → Popover.stories-CLnzpgEE.js} +16 -16
- package/dist/storybook/assets/ProgressMixin-D1atDw3n.js +1 -0
- package/dist/storybook/assets/Radio-B6Aq6K0V.js +25 -0
- package/dist/storybook/assets/{Radio.stories-BmrEdPkm.js → Radio.stories-BCVbISmb.js} +6 -6
- package/dist/storybook/assets/{RadioGroup.stories-ChARVXs3.js → RadioGroup.stories-B-TGP_-v.js} +22 -22
- package/dist/storybook/assets/{ReadyMixin-BbuzH3uO.js → ReadyMixin-C8HW2nGE.js} +1 -1
- package/dist/storybook/assets/RovingTabindexMixin-DI5rmyR7.js +1 -0
- package/dist/storybook/assets/{RovingTabindexMixin.stories-xm4b394_.js → RovingTabindexMixin.stories-DVKCC_R7.js} +5 -5
- package/dist/storybook/assets/{Rtc.stories-DdcMaELA.js → Rtc.stories-bBYHOszW.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CI67Ougx.js → ScrollShadow.stories-BIK8YINt.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-DOqrRkxc.js → Switch.stories-COEk74kM.js} +60 -27
- package/dist/storybook/assets/{Tab.stories-DN8o4cf_.js → Tab.stories-Dbt9JvSx.js} +7 -7
- package/dist/storybook/assets/Tabs-BIScOPS0.js +17 -0
- package/dist/storybook/assets/{Tabs.stories-BEowfCcl.js → Tabs.stories-CodKgVf2.js} +6 -6
- package/dist/storybook/assets/{Throttle.stories-BZ_nsuw1.js → Throttle.stories-BhIqWWrQ.js} +1 -1
- package/dist/storybook/assets/Tooltip.stories-DKD8nBM1.js +143 -0
- package/dist/storybook/assets/TooltipMixin-CRNNusJ7.js +1 -0
- package/dist/storybook/assets/{Upload.stories-sAEiabwq.js → Upload.stories-WTO15ST1.js} +102 -52
- package/dist/storybook/assets/UploadItem-DejgZ5A0.js +54 -0
- package/dist/storybook/assets/{UploadItem.stories-C19JMfmB.js → UploadItem.stories-Pk3ghOcI.js} +4 -4
- package/dist/storybook/assets/{Welcome.stories-C30jg0r1.js → Welcome.stories-DrNnxvt9.js} +9 -9
- package/dist/storybook/assets/Widget-elBzGg8w.css +1 -0
- package/dist/storybook/assets/Widget.stories-CYC5Qdac.js +279 -0
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-PFRy5maL.js → WithTooltip-65CFNBJE-DK6PZNaa.js} +1 -1
- package/dist/storybook/assets/ai-sparkle-BZMJJAxY.js +1 -0
- package/dist/storybook/assets/aria-D5THOgos.js +1 -0
- package/dist/storybook/assets/{blocks-DLjjvsFT.js → blocks-Dzcxb014.js} +5 -5
- package/dist/storybook/assets/esca-glow-BwdhBvIX.js +2 -0
- package/dist/storybook/assets/esca-idle-B-fumiIb.js +1 -0
- package/dist/storybook/assets/esca-search-rwNfo19I.js +1 -0
- package/dist/storybook/assets/esca-task-complete-BAJP2dY2.js +1 -0
- package/dist/storybook/assets/esca-wave-Bjs4CUR7.js +1 -0
- package/dist/storybook/assets/{formatter-EIJCOSYU-D39uscG_.js → formatter-EIJCOSYU-PioIuXjk.js} +1 -1
- package/dist/storybook/assets/i18n-BQ-Uj-0B.js +1 -0
- package/dist/storybook/assets/if-defined-DL7cQU7O.js +1 -0
- package/dist/storybook/assets/{iframe-B9buZjP7.js → iframe-Byo_x5o2.js} +24 -24
- package/dist/storybook/assets/{index-BdEHup-4.js → index-gox-Wle0.js} +1 -1
- package/dist/storybook/assets/lottie_svg-3t2UJxjZ.js +2 -0
- package/dist/storybook/assets/{onFind-CGzSFqNN.js → onFind-BWiaccUj.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-Dq71qO14.js → onFind.stories-CC_XTN2G.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-B1GqLH_U.js → onRemove.stories-CXxpL4ud.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-BNKxOfLw.js → onVisible.stories-DKA9cexx.js} +1 -1
- package/dist/storybook/assets/property-_few0Xe5.js +1 -0
- package/dist/storybook/assets/ref-BaIdO8Sk.js +1 -0
- package/dist/storybook/assets/state-BBcPmYaV.js +1 -0
- package/dist/storybook/assets/{style-map-qCiIYcp5.js → style-map-DxZm5Cj7.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CUM-CaRF.js → syntaxhighlighter-ED5Y7EFY-B0_bSGZz.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +2 -1
- package/dist/storybook/assets/AiSparkle.stories-BfjT5jrJ.js +0 -72
- package/dist/storybook/assets/Avatar.stories-D8lnIZaY.js +0 -213
- package/dist/storybook/assets/AvatarGroup.stories-Cz9oVah0.js +0 -225
- package/dist/storybook/assets/Button-2ucj5lUP.js +0 -10
- package/dist/storybook/assets/Button.stories-ndl1RJd7.js +0 -54
- package/dist/storybook/assets/EscaAvatar.stories-Rc2MSzCX.js +0 -139
- package/dist/storybook/assets/LucideDynamicLoader-BuoNL33C.js +0 -1
- package/dist/storybook/assets/Tooltip.stories-3bar43ZN.js +0 -143
- package/dist/storybook/assets/Widget.stories-9-1XpZNl.js +0 -233
- package/dist/storybook/assets/if-defined-BwWBCoAU.js +0 -1
|
@@ -1,4 +1,54 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as L,x as u,E as B,g as M}from"./iframe-Byo_x5o2.js";import{o as C}from"./if-defined-DL7cQU7O.js";import{o as E}from"./style-map-DxZm5Cj7.js";import{n as k}from"./property-_few0Xe5.js";import{r as j}from"./state-BBcPmYaV.js";import{a as m}from"./aria-D5THOgos.js";import{E as R,R as O}from"./ReadyMixin-C8HW2nGE.js";import{l as c}from"./i18n-BQ-Uj-0B.js";import{m as A,v as T,f as q}from"./UploadItem-DejgZ5A0.js";import"./Icon-DPQKiWDz.js";import"./preload-helper-PPVm8Dsz.js";import"./celebrate-KwPoF1K3.js";import"./position-CFNQy3J6.js";import"./IconButton-Dp4Z06bL.js";import"./TooltipMixin-CRNNusJ7.js";import"./LinearProgress-DG3tPlGH.js";import"./ProgressMixin-D1atDw3n.js";var N=Object.defineProperty,b=(t,e,r,o)=>{for(var s=void 0,i=t.length-1,n;i>=0;i--)(n=t[i])&&(s=n(e,r,s)||s);return s&&N(e,r,s),s};class f extends R(O(L)){constructor(){super(...arguments),this.accept="",this.maxFileSize=0,this.maxFiles=1/0,this.disabled=!1,this.noDrag=!1,this._files=new Map,this._items=new Map,this._milestones=new Map,this._dragOver=!1,this._dragCounter=0}get _inputEl(){return this.querySelector('input[type="file"]')}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("btu-upload")}disconnectedCallback(){super.disconnectedCallback();for(const e of this._files.values())e.status!=="complete"&&this.emit("btu-upload-file-removed",{id:e.id,file:e.file});this._files.clear(),this._items.clear(),this._milestones.clear(),this._dragCounter=0,this._dragOver=!1}firstUpdated(){this.addEventListener("btu-upload-item-remove",e=>{e.stopPropagation();const{id:r}=e.detail;this.removeFile(r)}),this.addEventListener("btu-upload-item-retry",e=>{e.stopPropagation();const{id:r}=e.detail,o=this._files.get(r);o&&this.emit("btu-upload-file-retry",{id:o.id,file:o.file})}),this.emit("btu-upload-ready")}_handleInputChange(e){const r=e.target;r.files&&(this._processFiles(Array.from(r.files)),r.value="")}_handleSelectClick(e){e.stopPropagation(),!this._interactionBlocked&&this._inputEl?.click()}_handleDropzoneClick(){this._interactionBlocked||this._inputEl?.click()}_handleDragEnter(e){this._interactionBlocked||this.noDrag||(e.preventDefault(),this._dragCounter++,this._dragOver=!0)}_handleDragOver(e){this._interactionBlocked||this.noDrag||e.preventDefault()}_handleDragLeave(e){this._interactionBlocked||this.noDrag||(this._dragCounter--,this._dragCounter<=0&&(this._dragCounter=0,this._dragOver=!1))}_handleDrop(e){this._interactionBlocked||this.noDrag||(e.preventDefault(),this._dragCounter=0,this._dragOver=!1,e.dataTransfer?.files&&this._processFiles(Array.from(e.dataTransfer.files)))}_processFiles(e){if(!this._interactionBlocked){if(this.maxFiles===1){const r=e[0];if(!r)return;if(this._validateFile(r)){if(this._files.size>0){const o=this._files.keys().next().value;this.removeFile(o)}this._addFile(r)}for(const o of e.slice(1))this._rejectCount(o);return}for(const r of e){if(this._files.size>=this.maxFiles){this._rejectCount(r);continue}this._validateFile(r)&&this._addFile(r)}}}_rejectCount(e){this.emit("btu-upload-file-rejected",{file:e,reason:"count"}),m(c("upload","announceRejectedCount","File rejected: ___. Maximum file count reached.",[e.name]))}_validateFile(e){return this.accept&&!A(e,this.accept)?(this.emit("btu-upload-file-rejected",{file:e,reason:"type"}),m(c("upload","announceRejectedType","File rejected: ___. File type not accepted.",[e.name])),!1):this.maxFileSize>0&&!T(e,this.maxFileSize)?(this.emit("btu-upload-file-rejected",{file:e,reason:"size"}),m(c("upload","announceRejectedSize","File rejected: ___. File exceeds size limit.",[e.name])),!1):!0}_addFile(e){const r=crypto.randomUUID(),o={id:r,file:e,status:"pending",progress:0};this._files.set(r,o),this._milestones.set(r,new Set),this._renderItem(o),this.requestUpdate(),this.emit("btu-upload-file-added",{id:r,file:e});const s=q(e.size);m(c("upload","announceAdded","File added: ___, ___",[e.name,s]))}_reportUnknownId(e,r){const o=`no file found with id "${r}"`;this.emit("btu-upload-api-error",{method:e,id:r,reason:"unknown-id",message:o}),console.warn(`[btu-upload] ${e}: ${o}`)}_getOrReport(e,r){const o=this._files.get(r);return o||(this._reportUnknownId(e,r),null)}_renderItem(e){const r=this.querySelector(".btu-upload-list");if(!r)return;const o=document.createElement("btu-upload-item");o.setAttribute("role","listitem"),o._configure(e),r.appendChild(o),this._items.set(e.id,o)}setFileProgress(e,r){const o=this._getOrReport("setFileProgress",e);if(!o||o.status==="complete")return;const s=Number.isFinite(r)?Math.round(r):0,i=Math.min(Math.max(s,0),100);if(o.status!=="pending"&&i===o.progress)return;const n=o.status==="error"?{...o,progress:i}:{id:o.id,file:o.file,symbol:o.symbol,status:"uploading",progress:i};this._files.set(e,n),this._items.get(e)?._configure(n);const a=this._milestones.get(e);if(a&&a.size<3)for(const p of[25,50,75])i>=p&&!a.has(p)&&(a.add(p),m(c("upload","announceProgress","___ ___% uploaded",[o.file.name,String(p)])))}setFileStatus(e,r,o){const s=this._getOrReport("setFileStatus",e);if(!s)return;if(s.status==="complete"&&r!=="complete"){const l=`cannot transition from 'complete' to '${r}' for id "${e}"`;this.emit("btu-upload-api-error",{method:"setFileStatus",id:e,reason:"invalid-transition",message:l}),console.warn(`[btu-upload] setFileStatus: ${l}`);return}const{id:i,file:n,symbol:a,progress:p}=s;let d;switch(r){case"uploading":d={id:i,file:n,symbol:a,status:"uploading",progress:p};break;case"complete":d={id:i,file:n,symbol:a,status:"complete",progress:100};break;case"error":d={id:i,file:n,symbol:a,status:"error",progress:p,errorMessage:o??""};break}if(this._files.set(e,d),this._items.get(e)?._configure(d),r==="complete")m(c("upload","announceComplete","___ upload complete",[n.name]));else if(r==="error"){const l=o?.trim();m(l?c("upload","announceErrorWithDetail","___ upload failed: ___",[n.name,l]):c("upload","announceError","___ upload failed",[n.name]))}s.status!=="complete"&&r==="complete"&&this.emit("btu-upload-file-completed",{id:d.id,file:d.file})}setFileSymbol(e,r){const o=this._getOrReport("setFileSymbol",e);if(!o||o.symbol===r)return;const s={...o,symbol:r};this._files.set(e,s),this._items.get(e)?._configure(s)}removeFile(e){const r=this._getOrReport("removeFile",e);r&&(this._files.delete(e),this._milestones.delete(e),this._items.get(e)?.remove(),this._items.delete(e),this.requestUpdate(),this.emit("btu-upload-file-removed",{id:e,file:r.file}),m(c("upload","announceRemoved","File removed: ___",[r.file.name])))}getFiles(){return Array.from(this._files.values())}get _dropzoneFull(){return this.maxFiles===1?!1:this._files.size>=this.maxFiles}get _interactionBlocked(){return this.disabled||this._dropzoneFull}get _showCountPill(){return Number.isFinite(this.maxFiles)&&this.maxFiles!==1}_renderSelectButton(e){return u`<button
|
|
2
|
+
type="button"
|
|
3
|
+
class="btu-upload-dropzone-action"
|
|
4
|
+
?disabled="${this._interactionBlocked}"
|
|
5
|
+
@click="${this._handleSelectClick}"
|
|
6
|
+
>
|
|
7
|
+
${e}
|
|
8
|
+
</button>`}render(){const e=this._dropzoneFull,r=this.disabled,o=["btu-upload-dropzone",this._dragOver?"btu-upload-dropzone-dragover":"",r||e?"btu-upload-dropzone-disabled":""].filter(Boolean).join(" "),s=!r&&e?c("upload","dropzoneLabelFull","File upload, maximum reached"):c("upload","dropzoneLabel","File upload");return u`
|
|
9
|
+
<input
|
|
10
|
+
type="file"
|
|
11
|
+
class="sr-only"
|
|
12
|
+
tabindex="-1"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
accept="${this.accept||B}"
|
|
15
|
+
?multiple="${this.maxFiles!==1}"
|
|
16
|
+
?disabled="${r}"
|
|
17
|
+
@change="${this._handleInputChange}"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
class="${o}"
|
|
22
|
+
aria-label="${s}"
|
|
23
|
+
aria-disabled="${r||e?"true":"false"}"
|
|
24
|
+
@click="${this._handleDropzoneClick}"
|
|
25
|
+
@dragenter="${this._handleDragEnter}"
|
|
26
|
+
@dragover="${this._handleDragOver}"
|
|
27
|
+
@dragleave="${this._handleDragLeave}"
|
|
28
|
+
@drop="${this._handleDrop}"
|
|
29
|
+
>
|
|
30
|
+
${this._showCountPill?u`<span
|
|
31
|
+
class="btu-upload-dropzone-count"
|
|
32
|
+
aria-label="${c("upload","countOfMaxLabel","___ of ___ files",[this._files.size,this.maxFiles])}"
|
|
33
|
+
>${c("upload","countOfMax","___ of ___",[this._files.size,this.maxFiles])}</span
|
|
34
|
+
>`:B}
|
|
35
|
+
<div class="btu-upload-dropzone-icon">
|
|
36
|
+
<btu-icon symbol="upload-cloud" size="md"></btu-icon>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="btu-upload-dropzone-prompt">
|
|
39
|
+
<span class="btu-upload-dropzone-text" aria-hidden="${this._dragOver?"true":"false"}">
|
|
40
|
+
${this.noDrag?this._renderSelectButton(c("upload","dropzoneActionNoDrag","Select files")):u`${c("upload","dropzonePrefix","Drag and drop or")}
|
|
41
|
+
${this._renderSelectButton(c("upload","dropzoneAction","select"))}
|
|
42
|
+
${c("upload","dropzoneSuffix","files")}`}
|
|
43
|
+
</span>
|
|
44
|
+
${this.noDrag?B:u`<span class="btu-upload-dropzone-drag-message" aria-hidden="${this._dragOver?"false":"true"}"
|
|
45
|
+
>${c("upload","dragOver","Drop Files Here")}</span
|
|
46
|
+
>`}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="btu-upload-list" role="list" aria-label="${c("upload","listLabel","Uploaded files")}"></div>
|
|
51
|
+
`}}b([k({type:String})],f.prototype,"accept");b([k({type:Number,attribute:"max-file-size"})],f.prototype,"maxFileSize");b([k({attribute:"max-files",converter:{fromAttribute:t=>{if(t===null||t==="")return 1/0;const e=Number(t);return Number.isFinite(e)?Math.max(0,Math.floor(e)):1/0},toAttribute:t=>typeof t!="number"||!Number.isFinite(t)?null:String(t)}})],f.prototype,"maxFiles");b([k({type:Boolean,reflect:!0})],f.prototype,"disabled");b([k({type:Boolean,attribute:"no-drag"})],f.prototype,"noDrag");b([j()],f.prototype,"_dragOver");customElements.get("btu-upload")||customElements.define("btu-upload",f);const{events:H,args:W,argTypes:g}=M("btu-upload"),I=t=>{const e={};return t.dropzoneBg&&(e["--upload-dropzone-bg"]=t.dropzoneBg),t.dropzoneBorderColor&&(e["--upload-dropzone-border-color"]=t.dropzoneBorderColor),t.dropzoneBorderRadius&&(e["--upload-dropzone-border-radius"]=t.dropzoneBorderRadius),t.dropzoneHoverBg&&(e["--upload-dropzone-hover-bg"]=t.dropzoneHoverBg),t.dropzoneHoverBorderColor&&(e["--upload-dropzone-hover-border-color"]=t.dropzoneHoverBorderColor),t.dropzoneFocusRingColor&&(e["--upload-dropzone-focus-ring-color"]=t.dropzoneFocusRingColor),t.itemBg&&(e["--upload-item-bg"]=t.itemBg),t.itemBorderColor&&(e["--upload-item-border-color"]=t.itemBorderColor),t.itemActiveBorderColor&&(e["--upload-item-active-border-color"]=t.itemActiveBorderColor),t.itemCompleteBorderColor&&(e["--upload-item-complete-border-color"]=t.itemCompleteBorderColor),t.itemErrorBg&&(e["--upload-item-error-bg"]=t.itemErrorBg),t.itemErrorBorderColor&&(e["--upload-item-error-border-color"]=t.itemErrorBorderColor),e},de={title:"Components/Upload",component:"btu-upload",tags:["autodocs"],parameters:{docs:{subtitle:"btu-upload",description:{component:`
|
|
2
52
|
A file upload component with drop zone and file list.
|
|
3
53
|
|
|
4
54
|
The component is **presentation + file-selection only**. It handles file browsing
|
|
@@ -25,61 +75,61 @@ via imperative methods.
|
|
|
25
75
|
<li><code>btu-upload-file-retry</code> — User clicked "Try again" on failed upload</li>
|
|
26
76
|
<li><code>btu-upload-file-rejected</code> — File failed client-side validation</li>
|
|
27
77
|
</ul>
|
|
28
|
-
`}},actions:{handles:
|
|
78
|
+
`}},actions:{handles:H},controls:{expanded:!0}},args:{...W,accept:"","max-file-size":void 0,"max-files":void 0,disabled:!1,"no-drag":!1},argTypes:{...g,accept:{...g.accept,control:{type:"text"},description:"Accepted file types (MIME types, extensions, or comma-separated list)"},"max-file-size":{...g["max-file-size"],control:{type:"number"},description:"Maximum file size in bytes. 0 means unlimited."},"max-files":{...g["max-files"],control:{type:"number"},description:"Maximum number of files allowed. Omit for unlimited. Set to 1 for single-file mode (new selection replaces the existing file)."},disabled:{...g.disabled,control:{type:"boolean"},description:"Disables all interaction"},"no-drag":{...g["no-drag"],control:{type:"boolean"},description:"Disables drag-and-drop. File selection via click still works."},"--upload-dropzone-bg":{table:{disable:!0}},"--upload-dropzone-border-color":{table:{disable:!0}},"--upload-dropzone-border-radius":{table:{disable:!0}},"--upload-dropzone-hover-bg":{table:{disable:!0}},"--upload-dropzone-hover-border-color":{table:{disable:!0}},"--upload-dropzone-focus-ring-color":{table:{disable:!0}},"--upload-item-bg":{table:{disable:!0}},"--upload-item-border-color":{table:{disable:!0}},"--upload-item-active-border-color":{table:{disable:!0}},"--upload-item-complete-border-color":{table:{disable:!0}},"--upload-item-error-bg":{table:{disable:!0}},"--upload-item-error-border-color":{table:{disable:!0}},dropzoneBg:{name:"--upload-dropzone-bg",control:{type:"color"},description:"Drop zone background color (default: gray-25)",table:{category:"CSS Properties"}},dropzoneBorderColor:{name:"--upload-dropzone-border-color",control:{type:"color"},description:"Drop zone border color (default: gray-200)",table:{category:"CSS Properties"}},dropzoneBorderRadius:{name:"--upload-dropzone-border-radius",control:{type:"text"},description:"Drop zone border radius (default: borderRadius.lg)",table:{category:"CSS Properties"}},dropzoneHoverBg:{name:"--upload-dropzone-hover-bg",control:{type:"color"},description:"Drop zone hover background (default: gray-50)",table:{category:"CSS Properties"}},itemBg:{name:"--upload-item-bg",control:{type:"color"},description:"Item background color (default: white)",table:{category:"CSS Properties"}},itemBorderColor:{name:"--upload-item-border-color",control:{type:"color"},description:"Item border color (default: gray-200)",table:{category:"CSS Properties"}},itemErrorBg:{name:"--upload-item-error-bg",control:{type:"color"},description:"Item error background (default: error-25)",table:{category:"CSS Properties"}},itemErrorBorderColor:{name:"--upload-item-error-border-color",control:{type:"color"},description:"Item error border color (default: error-300)",table:{category:"CSS Properties"}},dropzoneHoverBorderColor:{name:"--upload-dropzone-hover-border-color",control:{type:"color"},description:"Drop zone hover border color (default: primary-300)",table:{category:"CSS Properties"}},dropzoneFocusRingColor:{name:"--upload-dropzone-focus-ring-color",control:{type:"color"},description:"Drop zone focus ring color (default: primary-100)",table:{category:"CSS Properties"}},itemActiveBorderColor:{name:"--upload-item-active-border-color",control:{type:"color"},description:"Item active/in-progress border color (default: gray-300)",table:{category:"CSS Properties"}},itemCompleteBorderColor:{name:"--upload-item-complete-border-color",control:{type:"color"},description:"Item completed border color (default: primary-500)",table:{category:"CSS Properties"}}},render:t=>{const e=I(t);return u`
|
|
29
79
|
<btu-upload
|
|
30
|
-
style=${
|
|
31
|
-
accept="${
|
|
32
|
-
max-file-size="${
|
|
33
|
-
max-files="${
|
|
34
|
-
?disabled="${
|
|
35
|
-
?no-drag="${
|
|
80
|
+
style=${E(e)}
|
|
81
|
+
accept="${t.accept||""}"
|
|
82
|
+
max-file-size="${t["max-file-size"]||0}"
|
|
83
|
+
max-files="${C(t["max-files"])}"
|
|
84
|
+
?disabled="${t.disabled}"
|
|
85
|
+
?no-drag="${t["no-drag"]}"
|
|
36
86
|
></btu-upload>
|
|
37
|
-
`}},
|
|
38
|
-
<div id="${
|
|
87
|
+
`}},h={},y={args:{},render:t=>{const e=`upload-sim-${crypto.randomUUID().slice(0,8)}`,r=o=>{o.addEventListener("btu-upload-file-added",(s=>{const{id:i}=s.detail;let n=0;const a=Math.random()<.3;o.setFileStatus(i,"uploading");const p=setInterval(()=>{n+=Math.random()*15+5,n>=100?(n=100,clearInterval(p),a?o.setFileStatus(i,"error","Network error: connection timed out"):(o.setFileProgress(i,100),o.setFileStatus(i,"complete"))):o.setFileProgress(i,n)},300)})),o.addEventListener("btu-upload-file-retry",(s=>{const{id:i}=s.detail;let n=0;o.setFileStatus(i,"uploading"),o.setFileProgress(i,0);const a=setInterval(()=>{n+=Math.random()*20+10,n>=100?(n=100,clearInterval(a),o.setFileProgress(i,100),o.setFileStatus(i,"complete")):o.setFileProgress(i,n)},300)}))};return setTimeout(()=>{const s=document.getElementById(e)?.querySelector("btu-upload");s&&r(s)},100),u`
|
|
88
|
+
<div id="${e}">
|
|
39
89
|
<btu-upload
|
|
40
|
-
style=${
|
|
41
|
-
accept="${
|
|
42
|
-
max-file-size="${
|
|
43
|
-
max-files="${
|
|
44
|
-
?disabled="${
|
|
45
|
-
?no-drag="${
|
|
90
|
+
style=${E(I(t))}
|
|
91
|
+
accept="${t.accept||""}"
|
|
92
|
+
max-file-size="${t["max-file-size"]||0}"
|
|
93
|
+
max-files="${C(t["max-files"])}"
|
|
94
|
+
?disabled="${t.disabled}"
|
|
95
|
+
?no-drag="${t["no-drag"]}"
|
|
46
96
|
></btu-upload>
|
|
47
97
|
</div>
|
|
48
|
-
`}},
|
|
49
|
-
<span class="shrink-0 text-gray-400">${
|
|
50
|
-
<code class="shrink-0 font-semibold ${
|
|
51
|
-
<span class="truncate text-gray-700">${s(JSON.stringify(
|
|
52
|
-
`,
|
|
53
|
-
<div id="${
|
|
98
|
+
`}},v={args:{accept:"image/*,application/pdf","max-file-size":5242880},render:t=>{const e=`upload-log-${crypto.randomUUID().slice(0,8)}`,r=`log-${crypto.randomUUID().slice(0,8)}`,o={"btu-upload-file-added":"text-primary-600","btu-upload-file-removed":"text-gray-600","btu-upload-file-retry":"text-warning-600","btu-upload-file-rejected":"text-error-600","btu-upload-file-completed":"text-success-600"},s=n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),i=(n,a,p=1)=>{let d=0;const l=Math.random()<p;n.setFileStatus(a,"uploading");const w=setInterval(()=>{d+=Math.random()*15+5,d>=100?(clearInterval(w),l?n.setFileStatus(a,"error","Simulated network error"):(n.setFileProgress(a,100),n.setFileStatus(a,"complete"))):n.setFileProgress(a,d)},300)};return setTimeout(()=>{const a=document.getElementById(e)?.querySelector("btu-upload"),p=document.getElementById(r);if(!a||!p)return;const d=(l,w)=>{p.querySelector(".log-placeholder")?.remove();const D=document.createElement("div");D.className="flex gap-3 py-1 border-b border-gray-200 last:border-b-0";const P=new Date().toLocaleTimeString("en-US",{hour12:!1}),U=o[l]??"";D.innerHTML=`
|
|
99
|
+
<span class="shrink-0 text-gray-400">${P}</span>
|
|
100
|
+
<code class="shrink-0 font-semibold ${U}">${l}</code>
|
|
101
|
+
<span class="truncate text-gray-700">${s(JSON.stringify(w))}</span>
|
|
102
|
+
`,p.prepend(D)};a.addEventListener("btu-upload-file-added",(l=>{d("btu-upload-file-added",{id:l.detail.id,name:l.detail.file.name,size:l.detail.file.size}),i(a,l.detail.id)})),a.addEventListener("btu-upload-file-removed",(l=>{d("btu-upload-file-removed",{id:l.detail.id,name:l.detail.file.name})})),a.addEventListener("btu-upload-file-retry",(l=>{d("btu-upload-file-retry",{id:l.detail.id,name:l.detail.file.name}),i(a,l.detail.id,0)})),a.addEventListener("btu-upload-file-rejected",(l=>{d("btu-upload-file-rejected",{name:l.detail.file.name,reason:l.detail.reason,size:l.detail.file.size})})),a.addEventListener("btu-upload-file-completed",(l=>{d("btu-upload-file-completed",{id:l.detail.id,name:l.detail.file.name})}))},100),u`
|
|
103
|
+
<div id="${e}" class="flex flex-col gap-4">
|
|
54
104
|
<btu-upload
|
|
55
|
-
style=${
|
|
56
|
-
accept="${
|
|
57
|
-
max-file-size="${
|
|
58
|
-
max-files="${
|
|
59
|
-
?disabled="${
|
|
60
|
-
?no-drag="${
|
|
105
|
+
style=${E(I(t))}
|
|
106
|
+
accept="${t.accept||""}"
|
|
107
|
+
max-file-size="${t["max-file-size"]||0}"
|
|
108
|
+
max-files="${C(t["max-files"])}"
|
|
109
|
+
?disabled="${t.disabled}"
|
|
110
|
+
?no-drag="${t["no-drag"]}"
|
|
61
111
|
></btu-upload>
|
|
62
112
|
<div class="rounded-md border border-gray-200 bg-gray-25 p-4">
|
|
63
113
|
<div class="mb-2 text-xs font-semibold uppercase tracking-wider text-gray-500">Event Log</div>
|
|
64
|
-
<div id="${
|
|
114
|
+
<div id="${r}" class="max-h-64 overflow-y-auto font-mono text-xs">
|
|
65
115
|
<div class="log-placeholder italic text-gray-400">No events yet. Drop files or click to upload.</div>
|
|
66
116
|
</div>
|
|
67
117
|
</div>
|
|
68
118
|
</div>
|
|
69
|
-
`},parameters:{docs:{description:{story:'Live log of all five public events: `btu-upload-file-added`, `btu-upload-file-removed`, `btu-upload-file-retry`, `btu-upload-file-rejected`, `btu-upload-file-completed`. Accepts images and PDFs up to 5 MB — drop a `.txt` file or an oversized PDF to trigger `rejected`. Added files always fail on first attempt (surfacing the "Try again" retry UX), and the retry always succeeds — so every upload exercises the full lifecycle: added → error → retry → completed.'}}}},
|
|
70
|
-
<div id="${
|
|
71
|
-
<btu-upload style=${
|
|
119
|
+
`},parameters:{docs:{description:{story:'Live log of all five public events: `btu-upload-file-added`, `btu-upload-file-removed`, `btu-upload-file-retry`, `btu-upload-file-rejected`, `btu-upload-file-completed`. Accepts images and PDFs up to 5 MB — drop a `.txt` file or an oversized PDF to trigger `rejected`. Added files always fail on first attempt (surfacing the "Try again" retry UX), and the retry always succeeds — so every upload exercises the full lifecycle: added → error → retry → completed.'}}}},_={render:t=>{const e=`upload-files-${crypto.randomUUID().slice(0,8)}`;return setTimeout(()=>{const o=document.getElementById(e)?.querySelector("btu-upload");o&&requestAnimationFrame(()=>{const s=[{name:"photo-vacation.jpg",type:"image/jpeg",size:42e5,status:"complete"},{name:"quarterly-report.pdf",type:"application/pdf",size:16e6,status:"uploading",progress:40},{name:"intro-video.mp4",type:"video/mp4",size:208e6,status:"error",error:"Upload failed — server returned 503"}];for(const i of s){const n=new File([""],i.name,{type:i.type});Object.defineProperty(n,"size",{value:i.size});const a=crypto.randomUUID().slice(0,8),p={id:a,file:n,status:"pending",progress:0},d=o;d._files.set(a,p),d._milestones.set(a,new Set),d._renderItem(p),d.requestUpdate(),i.status==="complete"?o.setFileStatus(a,"complete"):i.status==="error"?o.setFileStatus(a,"error",i.error):i.status==="uploading"&&o.setFileProgress(a,i.progress??0)}})},200),u`
|
|
120
|
+
<div id="${e}">
|
|
121
|
+
<btu-upload style=${E(I(t))}></btu-upload>
|
|
72
122
|
</div>
|
|
73
|
-
`}},
|
|
123
|
+
`}},z={args:{"max-files":1},parameters:{docs:{description:{story:'With `max-files="1"`, selecting a new file silently replaces the existing one. Only one file can be present at a time.'}}}},F={args:{accept:"image/*","max-file-size":5242880,"max-files":3},parameters:{docs:{description:{story:"Demonstrates client-side validation. Only images are accepted, with a 5 MB size limit and a maximum of 3 files. The drop zone hides when the limit is reached. Rejected files fire `btu-upload-file-rejected` events."}}}},x={args:{disabled:!0},parameters:{docs:{description:{story:"A grayed-out drop zone with muted text. File selection, drag-and-drop, and all action buttons are blocked."}}}},S={args:{"no-drag":!0},parameters:{docs:{description:{story:'With `no-drag`, drag-and-drop is disabled. Users can still select files by clicking the drop zone or the "select" link.'}}}},$={args:{},render:t=>u`
|
|
74
124
|
<btu-upload
|
|
75
|
-
style=${
|
|
76
|
-
accept="${
|
|
77
|
-
max-file-size="${
|
|
78
|
-
max-files="${
|
|
79
|
-
?disabled="${
|
|
80
|
-
?no-drag="${
|
|
125
|
+
style=${E({"--upload-dropzone-bg":"oklch(96% 0.02 260)","--upload-dropzone-border-color":"oklch(80% 0.08 260)","--upload-dropzone-hover-bg":"oklch(93% 0.04 260)","--upload-dropzone-border-radius":"1rem","--upload-item-border-color":"oklch(80% 0.08 260)"})}
|
|
126
|
+
accept="${t.accept||""}"
|
|
127
|
+
max-file-size="${t["max-file-size"]||0}"
|
|
128
|
+
max-files="${C(t["max-files"])}"
|
|
129
|
+
?disabled="${t.disabled}"
|
|
130
|
+
?no-drag="${t["no-drag"]}"
|
|
81
131
|
></btu-upload>
|
|
82
|
-
`,parameters:{docs:{description:{story:"Demonstrates theming via CSS custom properties. The drop zone uses a purple-tinted background and rounded corners, and item borders match the custom palette."}}}};
|
|
132
|
+
`,parameters:{docs:{description:{story:"Demonstrates theming via CSS custom properties. The drop zone uses a purple-tinted background and rounded corners, and item borders match the custom palette."}}}};h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:"{}",...h.parameters?.docs?.source},description:{story:"Empty drop zone with all controls exposed.",...h.parameters?.docs?.description}}};y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`{
|
|
83
133
|
args: {},
|
|
84
134
|
render: (args: Record<string, unknown>) => {
|
|
85
135
|
const containerId = \`upload-sim-\${crypto.randomUUID().slice(0, 8)}\`;
|
|
@@ -151,10 +201,10 @@ via imperative methods.
|
|
|
151
201
|
</div>
|
|
152
202
|
\`;
|
|
153
203
|
}
|
|
154
|
-
}`,...
|
|
204
|
+
}`,...y.parameters?.docs?.source},description:{story:`Interactive demo that simulates file upload progress.
|
|
155
205
|
|
|
156
206
|
Select files to see them upload with simulated progress. Some files will randomly
|
|
157
|
-
fail to demonstrate the error state and retry flow.`,...
|
|
207
|
+
fail to demonstrate the error state and retry flow.`,...y.parameters?.docs?.description}}};v.parameters={...v.parameters,docs:{...v.parameters?.docs,source:{originalSource:`{
|
|
158
208
|
args: {
|
|
159
209
|
accept: 'image/*,application/pdf',
|
|
160
210
|
'max-file-size': 5_242_880 // 5 MB
|
|
@@ -285,11 +335,11 @@ fail to demonstrate the error state and retry flow.`,...m.parameters?.docs?.desc
|
|
|
285
335
|
}
|
|
286
336
|
}
|
|
287
337
|
}
|
|
288
|
-
}`,...
|
|
338
|
+
}`,...v.parameters?.docs?.source},description:{story:`Interactive demo with a live log of every public event fired by the component.
|
|
289
339
|
|
|
290
340
|
Drop unsupported types or oversized files to see \`btu-upload-file-rejected\` entries.
|
|
291
341
|
Add valid files to watch the full lifecycle: added → simulated upload → complete or
|
|
292
|
-
error → (optional) retry → (optional) remove.`,...
|
|
342
|
+
error → (optional) retry → (optional) remove.`,...v.parameters?.docs?.description}}};_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`{
|
|
293
343
|
render: (args: Record<string, unknown>) => {
|
|
294
344
|
const containerId = \`upload-files-\${crypto.randomUUID().slice(0, 8)}\`;
|
|
295
345
|
setTimeout(() => {
|
|
@@ -363,8 +413,8 @@ error → (optional) retry → (optional) remove.`,...f.parameters?.docs?.descri
|
|
|
363
413
|
</div>
|
|
364
414
|
\`;
|
|
365
415
|
}
|
|
366
|
-
}`,...
|
|
367
|
-
Shows all icon variants across diverse MIME types.`,...
|
|
416
|
+
}`,..._.parameters?.docs?.source},description:{story:`Pre-seeded with files in mixed states: complete, uploading, and error.
|
|
417
|
+
Shows all icon variants across diverse MIME types.`,..._.parameters?.docs?.description}}};z.parameters={...z.parameters,docs:{...z.parameters?.docs,source:{originalSource:`{
|
|
368
418
|
args: {
|
|
369
419
|
'max-files': 1
|
|
370
420
|
},
|
|
@@ -375,7 +425,7 @@ Shows all icon variants across diverse MIME types.`,...g.parameters?.docs?.descr
|
|
|
375
425
|
}
|
|
376
426
|
}
|
|
377
427
|
}
|
|
378
|
-
}`,...
|
|
428
|
+
}`,...z.parameters?.docs?.source},description:{story:"Single-file mode where selecting a new file replaces the existing one.",...z.parameters?.docs?.description}}};F.parameters={...F.parameters,docs:{...F.parameters?.docs,source:{originalSource:`{
|
|
379
429
|
args: {
|
|
380
430
|
accept: 'image/*',
|
|
381
431
|
'max-file-size': 5242880,
|
|
@@ -388,13 +438,13 @@ Shows all icon variants across diverse MIME types.`,...g.parameters?.docs?.descr
|
|
|
388
438
|
}
|
|
389
439
|
}
|
|
390
440
|
}
|
|
391
|
-
}`,...
|
|
441
|
+
}`,...F.parameters?.docs?.source},description:{story:`Validation demo with restricted file types, size limit, and file count limit.
|
|
392
442
|
|
|
393
443
|
- Accepts only images (\`image/*\`)
|
|
394
444
|
- Max file size: 5 MB
|
|
395
445
|
- Max files: 3
|
|
396
446
|
|
|
397
|
-
Rejected files fire \`btu-upload-file-rejected\` events (visible in the Actions panel).`,...
|
|
447
|
+
Rejected files fire \`btu-upload-file-rejected\` events (visible in the Actions panel).`,...F.parameters?.docs?.description}}};x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
|
|
398
448
|
args: {
|
|
399
449
|
disabled: true
|
|
400
450
|
},
|
|
@@ -405,7 +455,7 @@ Rejected files fire \`btu-upload-file-rejected\` events (visible in the Actions
|
|
|
405
455
|
}
|
|
406
456
|
}
|
|
407
457
|
}
|
|
408
|
-
}`,...
|
|
458
|
+
}`,...x.parameters?.docs?.source},description:{story:"Disabled state — all interaction is blocked.",...x.parameters?.docs?.description}}};S.parameters={...S.parameters,docs:{...S.parameters?.docs,source:{originalSource:`{
|
|
409
459
|
args: {
|
|
410
460
|
'no-drag': true
|
|
411
461
|
},
|
|
@@ -416,7 +466,7 @@ Rejected files fire \`btu-upload-file-rejected\` events (visible in the Actions
|
|
|
416
466
|
}
|
|
417
467
|
}
|
|
418
468
|
}
|
|
419
|
-
}`,...
|
|
469
|
+
}`,...S.parameters?.docs?.source},description:{story:"Drag-and-drop disabled — file selection via click still works.",...S.parameters?.docs?.description}}};$.parameters={...$.parameters,docs:{...$.parameters?.docs,source:{originalSource:`{
|
|
420
470
|
args: {},
|
|
421
471
|
render: (args: Record<string, unknown>) => {
|
|
422
472
|
const styles: Record<string, string> = {
|
|
@@ -444,4 +494,4 @@ Rejected files fire \`btu-upload-file-rejected\` events (visible in the Actions
|
|
|
444
494
|
}
|
|
445
495
|
}
|
|
446
496
|
}
|
|
447
|
-
}
|
|
497
|
+
}`,...$.parameters?.docs?.source},description:{story:"Themed upload component using CSS custom property overrides.",...$.parameters?.docs?.description}}};const ce=["Default","SimulatedUpload","EventLog","WithFiles","SingleFile","Validation","Disabled","NoDrag","CSSCustomProperties"];export{$ as CSSCustomProperties,h as Default,x as Disabled,v as EventLog,S as NoDrag,y as SimulatedUpload,z as SingleFile,F as Validation,_ as WithFiles,ce as __namedExportsOrder,de as default};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{i as v,E as $,x as l}from"./iframe-Byo_x5o2.js";import{b as C}from"./celebrate-KwPoF1K3.js";import{E as B,R as y}from"./ReadyMixin-C8HW2nGE.js";import{l as r}from"./i18n-BQ-Uj-0B.js";import"./IconButton-Dp4Z06bL.js";import"./Icon-DPQKiWDz.js";import"./LinearProgress-DG3tPlGH.js";function F(e,t){if(!t||!t.trim())return!0;const s=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean),a=e.type.toLowerCase(),n=e.name.toLowerCase();return s.some(o=>{if(o.startsWith("."))return n.endsWith(o);if(o.endsWith("/*")){const i=o.slice(0,o.indexOf("/"));return a.startsWith(i+"/")}return a===o})}function P(e,t){return t<=0?!0:e.size<=t}function S(e){if(!e)return"upload-cloud";const t=e.toLowerCase();return t.startsWith("image/")?"image":t.startsWith("video/")?"film":t.startsWith("audio/")?"music":t.startsWith("text/")||t==="application/pdf"||t==="application/msword"||t.startsWith("application/vnd.openxmlformats")?"file":"upload-cloud"}function x(e){if(e<1024)return r("upload","sizeSubKB","< 1 KB");if(e<1048576)return`${Math.round(e/1024)} ${r("upload","unitKB","KB")}`;if(e<1073741824){const i=e/1048576;return`${i>=10?Math.round(i).toString():i.toFixed(1)} ${r("upload","unitMB","MB")}`}const n=e/1073741824;return`${n>=10?Math.round(n).toString():n.toFixed(1)} ${r("upload","unitGB","GB")}`}const E={pending:"btu-upload-item-active",uploading:"btu-upload-item-active",complete:"btu-upload-item-complete",error:"btu-upload-item-error"};class M extends B(y(v)){constructor(){super(...arguments),this._state=null,this._baseClasses="",this._previousStatus=null,this._stopProgressComplete=t=>t.stopPropagation()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();const t=this.className?this.className.split(" ").filter(Boolean):[];this._baseClasses=[...t,"btu-upload-item"].join(" "),this.addEventListener("btu-linear-progress-complete",this._stopProgressComplete)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("btu-linear-progress-complete",this._stopProgressComplete)}_configure(t){this._state!==t&&(this._state=t,this.requestUpdate())}willUpdate(){if(!this._state)return;const t=this._state.status;this.className=`${this._baseClasses} ${E[t]}`,this._previousStatus!=="complete"&&t==="complete"&&this._scheduleCelebrate(),this._previousStatus=t}_scheduleCelebrate(){this.updateComplete.then(()=>{const t=this.querySelector("btu-linear-progress");if(!t)return;const s=t.getBoundingClientRect();s.width===0&&s.height===0||C({position:{x:s.right,y:s.top+s.height/2},size:120,duration:1200})})}_handleRemove(){this._state&&this.dispatchEvent(new CustomEvent("btu-upload-item-remove",{detail:{id:this._state.id},bubbles:!0,composed:!0}))}_handleRetry(){this._state&&this.dispatchEvent(new CustomEvent("btu-upload-item-retry",{detail:{id:this._state.id},bubbles:!0,composed:!0}))}render(){if(!this._state)return $;const t=this._state,{file:s,status:a,progress:n,symbol:o}=t,i=s.name,p=o||S(s.type),m=x(s.size),d=a==="error",u=a==="complete",c=u?100:n,h=u?"gray":"primary",b=a==="error"?t.errorMessage:"",f=r("upload","cancelFile","Cancel upload for ___",[i]),_=r("upload","itemCancelTooltip","Cancel"),g=r("upload","retryFile","Retry upload for ___",[i]);return l`
|
|
2
|
+
<btu-icon
|
|
3
|
+
class="${d?"btu-upload-item-icon-error":""} btu-upload-item-icon"
|
|
4
|
+
symbol="${p}"
|
|
5
|
+
size="md"
|
|
6
|
+
emphasize
|
|
7
|
+
></btu-icon>
|
|
8
|
+
<div class="btu-upload-item-info">
|
|
9
|
+
${d?l`
|
|
10
|
+
<span class="btu-upload-item-error-text"
|
|
11
|
+
>${b||r("upload","itemError","Upload failed")}</span
|
|
12
|
+
>
|
|
13
|
+
<span class="btu-upload-item-error-filename">${i}</span>
|
|
14
|
+
<button
|
|
15
|
+
type="button"
|
|
16
|
+
class="btu-upload-item-retry"
|
|
17
|
+
aria-label="${g}"
|
|
18
|
+
@click="${this._handleRetry}"
|
|
19
|
+
>
|
|
20
|
+
${r("upload","itemRetry","Try again")}
|
|
21
|
+
</button>
|
|
22
|
+
`:l`
|
|
23
|
+
<span class="btu-upload-item-name">${i}</span>
|
|
24
|
+
<span class="btu-upload-item-size">${m}</span>
|
|
25
|
+
<div class="btu-upload-item-progress">
|
|
26
|
+
<btu-linear-progress
|
|
27
|
+
progress="${c}"
|
|
28
|
+
color="primary"
|
|
29
|
+
thickness="${8}"
|
|
30
|
+
aria-label="${c}%"
|
|
31
|
+
.initialAnimation="${!1}"
|
|
32
|
+
style="--track-color: oklch(var(--btu-theme-${h}-100))"
|
|
33
|
+
></btu-linear-progress>
|
|
34
|
+
<span class="btu-upload-item-percent">${c}%</span>
|
|
35
|
+
</div>
|
|
36
|
+
`}
|
|
37
|
+
</div>
|
|
38
|
+
${u?l`<btu-icon
|
|
39
|
+
class="btu-upload-item-check"
|
|
40
|
+
symbol="check"
|
|
41
|
+
size="sm"
|
|
42
|
+
emphasize="pulse"
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
></btu-icon>`:l`<btu-icon-button
|
|
45
|
+
class="btu-upload-item-remove"
|
|
46
|
+
symbol="x-circle"
|
|
47
|
+
type="secondary-clear"
|
|
48
|
+
size="sm"
|
|
49
|
+
destructive
|
|
50
|
+
tooltip="${_}"
|
|
51
|
+
aria-label="${f}"
|
|
52
|
+
@btu-icon-button-click="${this._handleRemove}"
|
|
53
|
+
></btu-icon-button>`}
|
|
54
|
+
`}}customElements.get("btu-upload-item")||customElements.define("btu-upload-item",M);export{x as f,F as m,P as v};
|
package/dist/storybook/assets/{UploadItem.stories-C19JMfmB.js → UploadItem.stories-Pk3ghOcI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as y,x as
|
|
1
|
+
import{g as y,x as m}from"./iframe-Byo_x5o2.js";import"./UploadItem-DejgZ5A0.js";import"./preload-helper-PPVm8Dsz.js";import"./celebrate-KwPoF1K3.js";import"./position-CFNQy3J6.js";import"./ReadyMixin-C8HW2nGE.js";import"./i18n-BQ-Uj-0B.js";import"./aria-D5THOgos.js";import"./IconButton-Dp4Z06bL.js";import"./property-_few0Xe5.js";import"./if-defined-DL7cQU7O.js";import"./TooltipMixin-CRNNusJ7.js";import"./Icon-DPQKiWDz.js";import"./LinearProgress-DG3tPlGH.js";import"./ProgressMixin-D1atDw3n.js";const{events:b,args:f,argTypes:h}=y("btu-upload-item"),e=r=>{const c=`upload-item-${crypto.randomUUID().slice(0,8)}`;return setTimeout(()=>{const l=document.getElementById(c)?.querySelector("btu-upload-item");if(!l)return;const u=new File([""],r.name,{type:r.mimeType??""});Object.defineProperty(u,"size",{value:r.size??0});const d=r.status??"uploading",p={id:crypto.randomUUID().slice(0,8),file:u,symbol:r.symbol},g=d==="pending"?{...p,status:"pending",progress:0}:d==="complete"?{...p,status:"complete",progress:100}:d==="error"?{...p,status:"error",progress:r.progress??0,errorMessage:r.errorMessage??""}:{...p,status:"uploading",progress:r.progress??0};l._configure(g)},50),m`<div id="${c}" style="max-width: 480px;"><btu-upload-item></btu-upload-item></div>`},C={title:"Components/Upload/Upload Item",component:"btu-upload-item",tags:["autodocs"],parameters:{docs:{subtitle:"Individual file row rendered inside btu-upload",description:{component:`
|
|
2
2
|
\`btu-upload-item\` renders a single file's state inside a \`btu-upload\` file list. It is an **internal sub-component** — consumers should not create, query, or modify items directly. All interaction goes through \`btu-upload\` methods (\`setFileProgress\`, \`setFileStatus\`, \`setFileSymbol\`, \`removeFile\`).
|
|
3
3
|
|
|
4
4
|
These stories exist for design documentation and visual QA of each status state in isolation. In practice, items are always created, configured, and destroyed by their parent \`btu-upload\`.
|
|
@@ -18,13 +18,13 @@ These stories exist for design documentation and visual QA of each status state
|
|
|
18
18
|
<li><code>btu-upload-item-remove</code> — bubbles to parent \`btu-upload\`, which surfaces it as the public <code>btu-upload-file-removed</code> event</li>
|
|
19
19
|
<li><code>btu-upload-item-retry</code> — bubbles to parent \`btu-upload\`, which surfaces it as the public <code>btu-upload-file-retry</code> event</li>
|
|
20
20
|
</ul>
|
|
21
|
-
`}},actions:{handles:b},controls:{expanded:!0}},args:{...f},argTypes:{...h}},t={render:()=>e({name:"quarterly-report.pdf",mimeType:"application/pdf",size:16e6,status:"uploading",progress:40}),parameters:{docs:{description:{story:"The default in-progress state — gray border, linear progress bar with percentage label, and a trash button for cancelling."}}}},s={render:()=>e({name:"draft-notes.txt",mimeType:"text/plain",size:2400,status:"pending",progress:0}),parameters:{docs:{description:{story:"Rendered immediately after a file is added, before the consumer has started transferring. Visually identical to the uploading state at 0%."}}}},o={render:()=>e({name:"photo-vacation.jpg",mimeType:"image/jpeg",size:42e5,status:"complete",progress:100}),parameters:{docs:{description:{story:'Success state — primary-500 border, gray progress track, and a success-tinted emphasize icon with a one-shot pulse animation. Consumer triggers via `setFileStatus(id, "complete")`.'}}}},a={render:()=>e({name:"intro-video.mp4",mimeType:"video/mp4",size:208e6,status:"error",errorMessage:"Upload failed — server returned 503"}),parameters:{docs:{description:{story:'Error state — error-tinted background and border, error icon color, plus a "Try again" link that fires `btu-upload-item-retry` (surfaced as `btu-upload-file-retry` by the parent).'}}}},n={render:()=>
|
|
21
|
+
`}},actions:{handles:b},controls:{expanded:!0}},args:{...f},argTypes:{...h}},t={render:()=>e({name:"quarterly-report.pdf",mimeType:"application/pdf",size:16e6,status:"uploading",progress:40}),parameters:{docs:{description:{story:"The default in-progress state — gray border, linear progress bar with percentage label, and a trash button for cancelling."}}}},s={render:()=>e({name:"draft-notes.txt",mimeType:"text/plain",size:2400,status:"pending",progress:0}),parameters:{docs:{description:{story:"Rendered immediately after a file is added, before the consumer has started transferring. Visually identical to the uploading state at 0%."}}}},o={render:()=>e({name:"photo-vacation.jpg",mimeType:"image/jpeg",size:42e5,status:"complete",progress:100}),parameters:{docs:{description:{story:'Success state — primary-500 border, gray progress track, and a success-tinted emphasize icon with a one-shot pulse animation. Consumer triggers via `setFileStatus(id, "complete")`.'}}}},a={render:()=>e({name:"intro-video.mp4",mimeType:"video/mp4",size:208e6,status:"error",errorMessage:"Upload failed — server returned 503"}),parameters:{docs:{description:{story:'Error state — error-tinted background and border, error icon color, plus a "Try again" link that fires `btu-upload-item-retry` (surfaced as `btu-upload-file-retry` by the parent).'}}}},n={render:()=>m`
|
|
22
22
|
<div class="flex flex-col gap-4">
|
|
23
23
|
${e({name:"uploading.pdf",mimeType:"application/pdf",size:24e5,status:"uploading",progress:62})}
|
|
24
24
|
${e({name:"complete.jpg",mimeType:"image/jpeg",size:11e5,status:"complete",progress:100})}
|
|
25
25
|
${e({name:"failed.mp4",mimeType:"video/mp4",size:64e6,status:"error",errorMessage:"Upload failed — network unreachable"})}
|
|
26
26
|
</div>
|
|
27
|
-
`,parameters:{docs:{description:{story:"Side-by-side comparison of the three terminal states: uploading, complete, error."}}}},i={render:()=>
|
|
27
|
+
`,parameters:{docs:{description:{story:"Side-by-side comparison of the three terminal states: uploading, complete, error."}}}},i={render:()=>m`
|
|
28
28
|
<div class="flex flex-col gap-4">
|
|
29
29
|
${e({name:"photo.jpg",mimeType:"image/jpeg",size:84e4,status:"uploading",progress:30})}
|
|
30
30
|
${e({name:"clip.mp4",mimeType:"video/mp4",size:32e6,status:"uploading",progress:30})}
|
|
@@ -164,4 +164,4 @@ These stories exist for design documentation and visual QA of each status state
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
}`,...i.parameters?.docs?.source},description:{story:"One item per MIME-to-icon mapping to verify `resolveFileSymbol()` output.",...i.parameters?.docs?.description}}};const
|
|
167
|
+
}`,...i.parameters?.docs?.source},description:{story:"One item per MIME-to-icon mapping to verify `resolveFileSymbol()` output.",...i.parameters?.docs?.description}}};const P=["Uploading","Pending","Complete","Error","AllStates","IconVariants"];export{n as AllStates,o as Complete,a as Error,i as IconVariants,s as Pending,t as Uploading,P as __namedExportsOrder,C as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{S as
|
|
1
|
+
import{S as G}from"./blocks-Dzcxb014.js";import{r as T,x as j}from"./iframe-Byo_x5o2.js";import{e as M,n as w}from"./ref-BaIdO8Sk.js";import"./preload-helper-PPVm8Dsz.js";const K={title:"Welcome",tags:["autodocs","!dev"],parameters:{layout:"fullscreen",controls:{disable:!0},actions:{disable:!0},options:{showPanel:!1},docs:{page:()=>T.createElement("div",{className:"welcome-docs"},T.createElement(G))}}},k=[[13,52,158],[19,183,158],[99,43,176],[95,233,208],[240,67,62],[83,36,148]],d=(e,a)=>e+Math.random()*(a-e),$=e=>e[Math.floor(Math.random()*e.length)];function A(e,a){if(matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=e.getContext("2d"),l=Array.from({length:3},()=>({x:0,y:0,rgb:$(k),opacity:0,radius:d(250,350)}));let u=null;function O(){const i=5*devicePixelRatio,n=Object.assign(document.createElement("canvas"),{width:i,height:i}),r=n.getContext("2d");r.fillStyle="#000",r.arc(i/2,i/2,1.6*devicePixelRatio,0,Math.PI*2),r.fill(),u=t.createPattern(n,"repeat")}function R(){const{width:i,height:n}=e.getBoundingClientRect();e.width=i*devicePixelRatio,e.height=n*devicePixelRatio,t.setTransform(devicePixelRatio,0,0,devicePixelRatio,0,0),O()}R(),addEventListener("resize",R);const s=a?l[0]:null;s&&(s.rgb=$(k),s.radius=300),(function i(){if(!e.isConnected)return;const n=e.width/devicePixelRatio,r=e.height/devicePixelRatio;t.clearRect(0,0,n,r),s&&a&&(a.active?(s.x+=(a.tx-s.x)*.06,s.y+=(a.ty-s.y)*.06,s.opacity+=(.35-s.opacity)*.08):s.opacity+=(0-s.opacity)*.04);for(const o of l){if(o.opacity<=0)continue;const[h,p,b]=o.rgb,c=t.createRadialGradient(o.x,o.y,0,o.x,o.y,o.radius);c.addColorStop(0,`rgba(${h},${p},${b},${o.opacity})`),c.addColorStop(1,`rgba(${h},${p},${b},0)`),t.fillStyle=c,t.fillRect(o.x-o.radius,o.y-o.radius,o.radius*2,o.radius*2)}u&&(t.globalCompositeOperation="destination-in",t.fillStyle=u,t.fillRect(0,0,n,r),t.globalCompositeOperation="source-over"),requestAnimationFrame(i)})();function C(i){if(!e.isConnected)return;const{width:n,height:r}=e.getBoundingClientRect(),o=300,h=m=>m<2?{x:d(.15*n,.85*n),y:m===0?-o:r+o}:{x:m===2?-o:n+o,y:d(.15*r,.85*r)},p=Math.floor(Math.random()*4),b=(p+(Math.random()<.5?2:[1,3][Math.floor(Math.random()*2)]))%4,c=h(p),S=h(b),g=S.x-c.x,x=S.y-c.y,z=Math.hypot(g,x)||1,Y=Math.min(n,r)*d(.15,.35),D=d(1.2,2.2);i.rgb=$(k),i.radius=d(250,350);let P=null;const F=d(6e3,7500);(function m(E){if(!e.isConnected)return;P??=E;const f=Math.min((E-P)/F,1),L=.5-.5*Math.cos(f*Math.PI),B=Math.sin(f*D*Math.PI)*Y;i.x=c.x+g*L+-x/z*B,i.y=c.y+x*L+g/z*B,i.opacity=.35*Math.min(f/.2,1)*Math.min((1-f)/.2,1),f<1?requestAnimationFrame(m):i.opacity=0})(performance.now())}(a?l.slice(1):l).forEach((i,n)=>setTimeout(()=>{C(i),setInterval(()=>e.isConnected&&C(i),7500)},1e3+n*2500))}const I="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",q=M(),N=M(),H=M(),v={active:!1,tx:0,ty:0},y={render:()=>(queueMicrotask(()=>{const e=q.value;e&&!e.dataset.init&&(e.dataset.init="1",A(e));const a=N.value;a&&!a.dataset.init&&(a.dataset.init="1",A(a,v));const t=H.value;t&&!t.dataset.init&&(t.dataset.init="1",t.addEventListener("mousemove",l=>{const u=t.getBoundingClientRect();v.tx=l.clientX-u.left,v.ty=l.clientY-u.top,v.active=!0}),t.addEventListener("mouseleave",()=>{v.active=!1}))}),j`
|
|
2
2
|
<div
|
|
3
|
-
${
|
|
3
|
+
${w(H)}
|
|
4
4
|
style="
|
|
5
5
|
position: relative;
|
|
6
6
|
display: flex;
|
|
@@ -14,7 +14,7 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
14
14
|
background-color: var(--btu-theme-white);
|
|
15
15
|
"
|
|
16
16
|
>
|
|
17
|
-
<canvas ${
|
|
17
|
+
<canvas ${w(q)} aria-hidden="true" style="${I}z-index:0;"></canvas>
|
|
18
18
|
|
|
19
19
|
<img
|
|
20
20
|
src="WelcomeBG.svg"
|
|
@@ -32,7 +32,7 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
32
32
|
"
|
|
33
33
|
/>
|
|
34
34
|
|
|
35
|
-
<canvas ${
|
|
35
|
+
<canvas ${w(N)} aria-hidden="true" style="${I}z-index:2;"></canvas>
|
|
36
36
|
|
|
37
37
|
<div style="position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center;">
|
|
38
38
|
<div
|
|
@@ -44,7 +44,7 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
44
44
|
height: 100%;
|
|
45
45
|
"
|
|
46
46
|
>
|
|
47
|
-
${[{label:"Components",path:"?path=/docs/components-avatar--docs"},{label:"CSS Plugins",path:"?path=/docs/css-plugins-button--docs"},{label:"Design System",path:"?path=/docs/design-system-colors--docs"},{label:"Utilities",path:"?path=/docs/utilities-debounce--docs"}].map(e=>
|
|
47
|
+
${[{label:"Components",path:"?path=/docs/components-avatar--docs"},{label:"CSS Plugins",path:"?path=/docs/css-plugins-button--docs"},{label:"Design System",path:"?path=/docs/design-system-colors--docs"},{label:"Utilities",path:"?path=/docs/utilities-debounce--docs"}].map(e=>j`
|
|
48
48
|
<div
|
|
49
49
|
style="
|
|
50
50
|
padding: 20px 24px;
|
|
@@ -55,8 +55,8 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
57
57
|
"
|
|
58
|
-
@mouseenter=${
|
|
59
|
-
@mouseleave=${
|
|
58
|
+
@mouseenter=${a=>{const t=a.currentTarget;t.style.borderColor="oklch(var(--btu-theme-primary-700))",t.style.transform="translateY(-2px)",t.classList.add("shadow-md")}}
|
|
59
|
+
@mouseleave=${a=>{const t=a.currentTarget;t.style.borderColor="oklch(var(--btu-theme-gray-200))",t.style.transform="none",t.classList.remove("shadow-md")}}
|
|
60
60
|
@click=${()=>{window.top.location.search=e.path}}
|
|
61
61
|
>
|
|
62
62
|
<div
|
|
@@ -77,7 +77,7 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
77
77
|
</div>
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
80
|
-
`)};
|
|
80
|
+
`)};y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`{
|
|
81
81
|
render: () => {
|
|
82
82
|
queueMicrotask(() => {
|
|
83
83
|
// Init back canvas (auto-swoop only)
|
|
@@ -212,4 +212,4 @@ import{S as U}from"./blocks-DLjjvsFT.js";import{e as X,f as _,E as B,r as j,x as
|
|
|
212
212
|
</div>
|
|
213
213
|
\`;
|
|
214
214
|
}
|
|
215
|
-
}`,...
|
|
215
|
+
}`,...y.parameters?.docs?.source}}};const Q=["Page"];export{y as Page,Q as __namedExportsOrder,K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
btu-widget:not(:defined)>[slot]{display:none}btu-widget:not(:defined){pointer-events:none;opacity:.5;display:block}.btu-widget__collapsible{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .2s ease,opacity .15s ease}btu-widget:state(collapsed) .btu-widget__collapsible{grid-template-rows:0fr;opacity:0}btu-widget:state(collapsed) .btu-widget__header{border-bottom-color:transparent}.btu-widget__collapse-chevron{transition:transform .2s}btu-widget:state(collapsed) .btu-widget__collapse-chevron{transform:rotate(-180deg)}.btu-widget__collapsible-inner{min-height:0px;overflow:hidden}html::view-transition-group(widget){animation-duration:.6s;animation-timing-function:linear(0,.009,.035 2.1%,.141 4.4%,.723 12.9%,.938 16.7%,1.017,1.077,1.121,1.149 24.3%,1.159,1.163,1.161,1.154 29.9%,1.129 32.8%,1.051 39.6%,1.017 43.1%,.991,.977 51%,.974 53.8%,.975 57.1%,.997 69.8%,1.003 76.9%,1)}html::view-transition-old(widget){opacity:0}@keyframes fade-in{0%{opacity:0}}html::view-transition-new(widget){animation:fade-in .33s linear(0,.004,.012 1%,.035,.069,.116 4.3%,.217 6.5%,.466 11.3%,.578 13.6%,.685 16.1%,.774 18.4%,.814,.851,.884,.914,.94,.962,.982,.998 29%,1.008,1.016,1.023,1.028,1.032,1.035,1.037,1.038 38.7%,1.037 40.9%,1.034 43.4%,1.016 52.7%,1.01 57%,1.005,1.002 64.9%,1 69.8%,.999 75.7%,1) both}.btu-widget__dialog::backdrop{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);transition-property:all;transition-timing-function:linear(0,.0025 1.75%,.0099 3.55%,.0197 4.92%,.0341 6.4%,.0533 7.84%,.0738 9.06%,.1003 10.32%,.1281 11.41%,.194 13.37%,.2714 14.97%,.344 16.05%,.4768 17.47%,.5443 18.34%,.6069 19.39%,.6604 20.61%,.7167 22.4%,.7653 24.59%,.7876 25.87%,.8083 27.28%,.8272 28.79%,.8448 30.42%,.8649 32.63%,.8833 35.06%,.9002 37.72%,.9155 40.62%,.9295 43.79%,.9421 47.24%,.9533 50.97%,.9633 54.99%,.972 59.33%,.9795 64.01%,.9909 74.43%,.9977 86.37%,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1);background-color:light-dark(oklch(.04 .02 278.29 / .25),oklch(.78 .01 0 / .36))}@starting-style{.btu-widget__dialog[open]::backdrop{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}}@media(prefers-reduced-motion:reduce){html::view-transition-group(widget){animation-duration:.01ms}.btu-widget__collapsible{transition-property:none}.btu-widget__dialog::backdrop{transition-property:none}}
|