update templui components

This commit is contained in:
juancwu 2026-01-18 22:07:40 +00:00
commit 78047c7ee8
52 changed files with 162 additions and 123 deletions

File diff suppressed because one or more lines are too long

1
assets/js/checkbox.min.js vendored Normal file
View file

@ -0,0 +1 @@
(()=>{(function(){"use strict";function o(t){if(!t._tuiCheckbox){t._tuiCheckbox=!0;var e=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"checked");!e||!e.set||Object.defineProperty(t,"checked",{get:e.get,set:function(c){var n=e.get.call(this);e.set.call(this,c),n!==c&&this.dispatchEvent(new Event("change",{bubbles:!0}))},configurable:!0})}}function r(t){var e=document.querySelector('[data-tui-checkbox-group="'+t+'"][data-tui-checkbox-parent]'),c=document.querySelectorAll('[data-tui-checkbox-group="'+t+'"]:not([data-tui-checkbox-parent])');if(!(!e||!c.length)){var n=0;c.forEach(function(i){i.checked&&n++}),e.checked=n===c.length,e.indeterminate=n>0&&n<c.length}}function u(t,e){document.querySelectorAll('[data-tui-checkbox-group="'+t+'"]:not([data-tui-checkbox-parent])').forEach(function(c){c.checked=e})}document.addEventListener("change",function(t){var e=t.target;if(e.matches("[data-tui-checkbox-group]")){var c=e.getAttribute("data-tui-checkbox-group");e.hasAttribute("data-tui-checkbox-parent")?u(c,e.checked):r(c)}});function a(){var t=new Set;document.querySelectorAll("[data-tui-checkbox-group]").forEach(function(e){t.add(e.getAttribute("data-tui-checkbox-group")),o(e)}),t.forEach(r)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})();})();

View file

@ -1 +1 @@
(()=>{(function(){"use strict";function i(t){let e=t.closest('[data-tui-collapsible="root"]');if(!e)return;let a=e.getAttribute("data-tui-collapsible-state")==="open",n=a?"closed":"open";e.setAttribute("data-tui-collapsible-state",n),t.setAttribute("aria-expanded",!a)}document.addEventListener("click",t=>{let e=t.target.closest('[data-tui-collapsible="trigger"]');e&&(t.preventDefault(),i(e))}),document.addEventListener("keydown",t=>{if(t.key!==" "&&t.key!=="Enter")return;let e=t.target.closest('[data-tui-collapsible="trigger"]');e&&(t.preventDefault(),i(e))})})();})(); (()=>{(function(){"use strict";function l(t){let e=t.querySelectorAll('[data-tui-collapsible="content"]');for(let n of e)if(n.closest('[data-tui-collapsible="root"]')===t)return n;return null}function i(t){let e=t.closest('[data-tui-collapsible="root"]');if(!e)return;let n=l(e),o=e.getAttribute("data-tui-collapsible-state")==="open",s=o?"closed":"open";e.setAttribute("data-tui-collapsible-state",s),t.setAttribute("aria-expanded",!o),n&&n.classList.toggle("tui-collapsible-open",!o)}function a(){document.querySelectorAll('[data-tui-collapsible="root"]').forEach(t=>{let e=t.getAttribute("data-tui-collapsible-state")==="open",n=l(t);n&&n.classList.toggle("tui-collapsible-open",e)})}document.addEventListener("click",t=>{let e=t.target.closest('[data-tui-collapsible="trigger"]');e&&(t.preventDefault(),i(e))}),document.addEventListener("keydown",t=>{if(t.key!==" "&&t.key!=="Enter")return;let e=t.target.closest('[data-tui-collapsible="trigger"]');e&&(t.preventDefault(),i(e))}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})();})();

View file

@ -1 +1 @@
(()=>{(function(){"use strict";function s(t){if(!t)return null;let e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;let a=parseInt(e[1],10),n=parseInt(e[2],10)-1,d=parseInt(e[3],10),r=new Date(Date.UTC(a,n,d));return r.getUTCFullYear()===a&&r.getUTCMonth()===n&&r.getUTCDate()===d?r:null}function l(t,e,a){if(!t||isNaN(t.getTime()))return"";let n={timeZone:"UTC"},d={"locale-short":"short","locale-long":"long","locale-full":"full","locale-medium":"medium"};n.dateStyle=d[e]||"medium";try{return new Intl.DateTimeFormat(a,n).format(t)}catch{let i=t.getUTCFullYear(),c=(t.getUTCMonth()+1).toString().padStart(2,"0"),p=t.getUTCDate().toString().padStart(2,"0");return`${i}-${c}-${p}`}}function o(t){let e=t.id+"-calendar-instance",a=document.getElementById(e),n=document.getElementById(t.id+"-hidden")||t.parentElement?.querySelector("[data-tui-datepicker-hidden-input]"),d=t.querySelector("[data-tui-datepicker-display]");return{calendar:a,hiddenInput:n,display:d}}function u(t){let e=o(t);if(!e.display||!e.hiddenInput)return;let a=t.getAttribute("data-tui-datepicker-display-format")||"locale-medium",n=t.getAttribute("data-tui-datepicker-locale-tag")||"en-US",d=t.getAttribute("data-tui-datepicker-placeholder")||"Select a date";if(e.hiddenInput.value){let r=s(e.hiddenInput.value);if(r){e.display.textContent=l(r,a,n),e.display.classList.remove("text-muted-foreground");return}}e.display.textContent=d,e.display.classList.add("text-muted-foreground")}document.addEventListener("calendar-date-selected",t=>{let e=t.target;if(!e||!e.id.endsWith("-calendar-instance"))return;let a=e.id.replace("-calendar-instance",""),n=document.getElementById(a);if(!n||!n.hasAttribute("data-tui-datepicker"))return;let d=o(n);if(!d.display||!t.detail?.date)return;let r=n.getAttribute("data-tui-datepicker-display-format")||"locale-medium",i=n.getAttribute("data-tui-datepicker-locale-tag")||"en-US";if(d.display.textContent=l(t.detail.date,r,i),d.display.classList.remove("text-muted-foreground"),window.closePopover){let c=n.getAttribute("aria-controls")||n.id+"-content";window.closePopover(c)}}),document.addEventListener("reset",t=>{t.target.matches("form")&&t.target.querySelectorAll('[data-tui-datepicker="true"]').forEach(e=>{let a=o(e);a.hiddenInput&&(a.hiddenInput.value=""),u(e)})}),new MutationObserver(()=>{document.querySelectorAll('[data-tui-datepicker="true"]:not([data-rendered])').forEach(t=>{t.setAttribute("data-rendered","true"),u(t)})}).observe(document.body,{childList:!0,subtree:!0})})();})(); (()=>{(function(){"use strict";function p(t){if(t._tui)return;t._tui=!0;let e=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");e?.set&&Object.defineProperty(t,"value",{get:e.get,set(a){let n=this.value;e.set.call(this,a),n!==a&&this.dispatchEvent(new Event("input",{bubbles:!0}))},configurable:!0})}function m(t){if(!t)return null;let e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;let a=parseInt(e[1],10),n=parseInt(e[2],10)-1,d=parseInt(e[3],10),i=new Date(Date.UTC(a,n,d));return i.getUTCFullYear()===a&&i.getUTCMonth()===n&&i.getUTCDate()===d?i:null}function s(t,e,a){if(!t||isNaN(t.getTime()))return"";let n={timeZone:"UTC"},d={"locale-short":"short","locale-long":"long","locale-full":"full","locale-medium":"medium"};n.dateStyle=d[e]||"medium";try{return new Intl.DateTimeFormat(a,n).format(t)}catch{let u=t.getUTCFullYear(),l=(t.getUTCMonth()+1).toString().padStart(2,"0"),f=t.getUTCDate().toString().padStart(2,"0");return`${u}-${l}-${f}`}}function r(t){let e=t.id+"-calendar-instance",a=document.getElementById(e),n=document.getElementById(t.id+"-hidden")||t.parentElement?.querySelector("[data-tui-datepicker-hidden-input]"),d=t.querySelector("[data-tui-datepicker-display]");return{calendar:a,hiddenInput:n,display:d}}function o(t){let e=r(t);if(!e.display||!e.hiddenInput)return;let a=t.getAttribute("data-tui-datepicker-display-format")||"locale-medium",n=t.getAttribute("data-tui-datepicker-locale-tag")||"en-US",d=t.getAttribute("data-tui-datepicker-placeholder")||"Select a date";if(e.hiddenInput.value){let i=m(e.hiddenInput.value);if(i){e.display.textContent=s(i,a,n),e.display.classList.remove("text-muted-foreground");return}}e.display.textContent=d,e.display.classList.add("text-muted-foreground")}document.addEventListener("calendar-date-selected",t=>{let e=t.target;if(!e||!e.id.endsWith("-calendar-instance"))return;let a=e.id.replace("-calendar-instance",""),n=document.getElementById(a);if(!n||!n.hasAttribute("data-tui-datepicker"))return;let d=r(n);if(!d.display||!t.detail?.date)return;let i=n.getAttribute("data-tui-datepicker-display-format")||"locale-medium",u=n.getAttribute("data-tui-datepicker-locale-tag")||"en-US";if(d.display.textContent=s(t.detail.date,i,u),d.display.classList.remove("text-muted-foreground"),window.closePopover){let l=n.getAttribute("aria-controls")||n.id+"-content";window.closePopover(l)}}),document.addEventListener("input",t=>{if(!t.target.matches("[data-tui-datepicker-hidden-input]"))return;let e=document.getElementById(t.target.id.replace("-hidden",""));e&&o(e)}),document.addEventListener("reset",t=>{t.target.matches("form")&&t.target.querySelectorAll('[data-tui-datepicker="true"]').forEach(e=>{let a=r(e);a.hiddenInput&&(a.hiddenInput.value=""),o(e)})});function c(){document.querySelectorAll('[data-tui-datepicker="true"]').forEach(t=>{let e=r(t);!e.hiddenInput||e.hiddenInput._tui||(p(e.hiddenInput),o(t))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",c):c(),new MutationObserver(c).observe(document.body,{childList:!0,subtree:!0})})();})();

View file

@ -1 +1 @@
(()=>{(function(){"use strict";function u(t){return{value:parseFloat(t.getAttribute("data-tui-rating-initial-value"))||0,precision:parseFloat(t.getAttribute("data-tui-rating-precision"))||1,readonly:t.getAttribute("data-tui-rating-readonly")==="true",name:t.getAttribute("data-tui-rating-name")||"",onlyInteger:t.getAttribute("data-tui-rating-onlyinteger")==="true"}}function d(t){return parseFloat(t.getAttribute("data-tui-rating-current"))||parseFloat(t.getAttribute("data-tui-rating-initial-value"))||0}function l(t,a){t.setAttribute("data-tui-rating-current",a);let e=t.querySelector("[data-tui-rating-input]");e&&(e.value=a.toFixed(2),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}function c(t,a){let e=d(t),r=a>0?a:e;t.querySelectorAll("[data-tui-rating-item]").forEach(i=>{let o=parseInt(i.getAttribute("data-tui-rating-value"),10);if(isNaN(o))return;let s=i.querySelector("[data-tui-rating-item-foreground]");if(!s)return;let n=o<=Math.floor(r),f=!n&&o-1<r&&r<o,p=f?(r-Math.floor(r))*100:0;s.style.width=n?"100%":f?`${p}%`:"0%"})}function g(t){let a=0;return t.querySelectorAll("[data-tui-rating-item]").forEach(e=>{let r=parseInt(e.getAttribute("data-tui-rating-value"),10);!isNaN(r)&&r>a&&(a=r)}),Math.max(1,a)}document.addEventListener("click",t=>{let a=t.target.closest("[data-tui-rating-item]");if(!a)return;let e=a.closest("[data-tui-rating-component]");if(!e)return;let r=u(e);if(r.readonly)return;let i=parseInt(a.getAttribute("data-tui-rating-value"),10);if(isNaN(i))return;let o=d(e),s=g(e),n=i;r.onlyInteger?n=Math.round(n):o===n&&n%1===0?n=Math.max(0,n-r.precision):n=Math.round(n/r.precision)*r.precision,n=Math.max(0,Math.min(s,n)),l(e,n),c(e,0),e.dispatchEvent(new CustomEvent("rating-change",{bubbles:!0,detail:{name:r.name,value:n,maxValue:s}}))}),document.addEventListener("mouseover",t=>{let a=t.target.closest("[data-tui-rating-item]");if(!a)return;let e=a.closest("[data-tui-rating-component]");if(!e||u(e).readonly)return;let r=parseInt(a.getAttribute("data-tui-rating-value"),10);isNaN(r)||c(e,r)}),document.addEventListener("mouseout",t=>{let a=t.target.closest("[data-tui-rating-component]");!a||u(a).readonly||a.contains(t.relatedTarget)||c(a,0)}),document.addEventListener("reset",t=>{t.target.matches("form")&&t.target.querySelectorAll("[data-tui-rating-component]").forEach(a=>{let e=u(a);l(a,e.value),c(a,0)})}),new MutationObserver(()=>{document.querySelectorAll("[data-tui-rating-component]").forEach(t=>{if(!t.hasAttribute("data-tui-rating-current")){let e=u(t),r=g(t),i=Math.max(0,Math.min(r,e.value));l(t,Math.round(i/e.precision)*e.precision)}c(t,0),u(t).readonly&&(t.style.cursor="default",t.querySelectorAll("[data-tui-rating-item]").forEach(e=>{e.style.cursor="default"}))})}).observe(document.body,{childList:!0,subtree:!0})})();})(); (()=>{(function(){"use strict";function h(t){if(t._tui)return;t._tui=!0;let e=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");e?.set&&Object.defineProperty(t,"value",{get:e.get,set(a){let n=this.value;e.set.call(this,a),n!==a&&this.dispatchEvent(new Event("input",{bubbles:!0}))},configurable:!0})}function o(t){return{value:parseFloat(t.getAttribute("data-tui-rating-initial-value"))||0,precision:parseFloat(t.getAttribute("data-tui-rating-precision"))||1,readonly:t.getAttribute("data-tui-rating-readonly")==="true",name:t.getAttribute("data-tui-rating-name")||"",onlyInteger:t.getAttribute("data-tui-rating-onlyinteger")==="true"}}function f(t){return parseFloat(t.getAttribute("data-tui-rating-current"))||parseFloat(t.getAttribute("data-tui-rating-initial-value"))||0}function d(t,e){t.setAttribute("data-tui-rating-current",e);let a=t.querySelector("[data-tui-rating-hidden-input]");a&&(a.value=e.toFixed(2),a.dispatchEvent(new Event("input",{bubbles:!0})),a.dispatchEvent(new Event("change",{bubbles:!0})))}function c(t,e){let a=f(t),n=e>0?e:a;t.querySelectorAll("[data-tui-rating-item]").forEach(u=>{let r=parseInt(u.getAttribute("data-tui-rating-value"),10);if(isNaN(r))return;let s=u.querySelector("[data-tui-rating-item-foreground]");if(!s)return;let i=r<=Math.floor(n),p=!i&&r-1<n&&n<r,m=p?(n-Math.floor(n))*100:0;s.style.width=i?"100%":p?`${m}%`:"0%"})}function l(t){let e=0;return t.querySelectorAll("[data-tui-rating-item]").forEach(a=>{let n=parseInt(a.getAttribute("data-tui-rating-value"),10);!isNaN(n)&&n>e&&(e=n)}),Math.max(1,e)}document.addEventListener("click",t=>{let e=t.target.closest("[data-tui-rating-item]");if(!e)return;let a=e.closest("[data-tui-rating-component]");if(!a)return;let n=o(a);if(n.readonly)return;let u=parseInt(e.getAttribute("data-tui-rating-value"),10);if(isNaN(u))return;let r=f(a),s=l(a),i=u;n.onlyInteger?i=Math.round(i):r===i&&i%1===0?i=Math.max(0,i-n.precision):i=Math.round(i/n.precision)*n.precision,i=Math.max(0,Math.min(s,i)),d(a,i),c(a,0),a.dispatchEvent(new CustomEvent("rating-change",{bubbles:!0,detail:{name:n.name,value:i,maxValue:s}}))}),document.addEventListener("mouseover",t=>{let e=t.target.closest("[data-tui-rating-item]");if(!e)return;let a=e.closest("[data-tui-rating-component]");if(!a||o(a).readonly)return;let n=parseInt(e.getAttribute("data-tui-rating-value"),10);isNaN(n)||c(a,n)}),document.addEventListener("mouseout",t=>{let e=t.target.closest("[data-tui-rating-component]");!e||o(e).readonly||e.contains(t.relatedTarget)||c(e,0)}),document.addEventListener("input",t=>{if(!t.target.matches("[data-tui-rating-hidden-input]"))return;let e=t.target.closest("[data-tui-rating-component]");if(e){let a=parseFloat(t.target.value)||0,n=o(e),u=l(e),r=Math.max(0,Math.min(u,a));e.setAttribute("data-tui-rating-current",r),c(e,0)}}),document.addEventListener("reset",t=>{t.target.matches("form")&&t.target.querySelectorAll("[data-tui-rating-component]").forEach(e=>{let a=o(e);d(e,a.value),c(e,0)})});function g(){document.querySelectorAll("[data-tui-rating-component]").forEach(t=>{let e=t.querySelector("[data-tui-rating-hidden-input]");if(e&&!e._tui&&h(e),!t.hasAttribute("data-tui-rating-current")){let n=o(t),u=l(t),r=Math.max(0,Math.min(u,n.value));d(t,Math.round(r/n.precision)*n.precision)}c(t,0),o(t).readonly&&(t.style.cursor="default",t.querySelectorAll("[data-tui-rating-item]").forEach(n=>{n.style.cursor="default"}))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),new MutationObserver(g).observe(document.body,{childList:!0,subtree:!0})})();})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
// templui component accordion - version: v0.101.0 installed by templui v0.101.0 // templui component accordion - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/accordion // 📚 Documentation: https://templui.io/docs/components/accordion
package accordion package accordion

View file

@ -1,4 +1,4 @@
// templui component alert - version: v0.101.0 installed by templui v0.101.0 // templui component alert - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/alert // 📚 Documentation: https://templui.io/docs/components/alert
package alert package alert

View file

@ -1,4 +1,4 @@
// templui component aspectratio - version: v0.101.0 installed by templui v0.101.0 // templui component aspectratio - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/aspect-ratio // 📚 Documentation: https://templui.io/docs/components/aspect-ratio
package aspectratio package aspectratio

View file

@ -1,4 +1,4 @@
// templui component avatar - version: v0.101.0 installed by templui v0.101.0 // templui component avatar - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/avatar // 📚 Documentation: https://templui.io/docs/components/avatar
package avatar package avatar
@ -93,5 +93,5 @@ templ Fallback(props ...FallbackProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/avatar.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/avatar.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component badge - version: v0.101.0 installed by templui v0.101.0 // templui component badge - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/badge // 📚 Documentation: https://templui.io/docs/components/badge
package badge package badge

View file

@ -1,4 +1,4 @@
// templui component breadcrumb - version: v0.101.0 installed by templui v0.101.0 // templui component breadcrumb - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/breadcrumb // 📚 Documentation: https://templui.io/docs/components/breadcrumb
package breadcrumb package breadcrumb

View file

@ -1,4 +1,4 @@
// templui component button - version: v0.101.0 installed by templui v0.101.0 // templui component button - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/button // 📚 Documentation: https://templui.io/docs/components/button
package button package button
@ -116,7 +116,7 @@ templ Button(props ...Props) {
func (b Props) variantClasses() string { func (b Props) variantClasses() string {
switch b.Variant { switch b.Variant {
case VariantDestructive: case VariantDestructive:
return "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" return "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"
case VariantOutline: case VariantOutline:
return "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50" return "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
case VariantSecondary: case VariantSecondary:

View file

@ -1,4 +1,4 @@
// templui component calendar - version: v0.101.0 installed by templui v0.101.0 // templui component calendar - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/calendar // 📚 Documentation: https://templui.io/docs/components/calendar
package calendar package calendar
@ -136,11 +136,12 @@ templ Calendar(props ...Props) {
</button> </button>
<div class="flex gap-2 flex-1 min-w-0"> <div class="flex gap-2 flex-1 min-w-0">
<!-- Month Select --> <!-- Month Select -->
<!-- Add bg-card to fix rendering in dark mode Chrome -->
<div class="relative flex-1 has-[:focus]:border-ring border border-input shadow-xs has-[:focus]:ring-ring/50 has-[:focus]:ring-[3px] rounded-md"> <div class="relative flex-1 has-[:focus]:border-ring border border-input shadow-xs has-[:focus]:ring-ring/50 has-[:focus]:ring-[3px] rounded-md">
<select <select
id={ p.ID + "-month-select" } id={ p.ID + "-month-select" }
data-tui-calendar-month-select data-tui-calendar-month-select
class="absolute inset-0 opacity-0 cursor-pointer w-full" class="absolute inset-0 opacity-0 cursor-pointer w-full bg-card"
aria-label="Choose the Month" aria-label="Choose the Month"
> >
for i := 0; i < 12; i++ { for i := 0; i < 12; i++ {
@ -155,11 +156,12 @@ templ Calendar(props ...Props) {
</span> </span>
</div> </div>
<!-- Year Select --> <!-- Year Select -->
<!-- Add bg-card to fix rendering in dark mode Chrome -->
<div class="relative flex-1 has-[:focus]:border-ring border border-input shadow-xs has-[:focus]:ring-ring/50 has-[:focus]:ring-[3px] rounded-md"> <div class="relative flex-1 has-[:focus]:border-ring border border-input shadow-xs has-[:focus]:ring-ring/50 has-[:focus]:ring-[3px] rounded-md">
<select <select
id={ p.ID + "-year-select" } id={ p.ID + "-year-select" }
data-tui-calendar-year-select data-tui-calendar-year-select
class="absolute inset-0 opacity-0 cursor-pointer w-full" class="absolute inset-0 opacity-0 cursor-pointer w-full bg-card"
aria-label="Choose the Year" aria-label="Choose the Year"
> >
for year := 2100; year >= 1900; year-- { for year := 2100; year >= 1900; year-- {
@ -191,5 +193,5 @@ templ Calendar(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/calendar.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/calendar.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component card - version: v0.101.0 installed by templui v0.101.0 // templui component card - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/card // 📚 Documentation: https://templui.io/docs/components/card
package card package card

View file

@ -1,4 +1,4 @@
// templui component carousel - version: v0.101.0 installed by templui v0.101.0 // templui component carousel - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/carousel // 📚 Documentation: https://templui.io/docs/components/carousel
package carousel package carousel
@ -207,5 +207,5 @@ templ Indicators(props ...IndicatorsProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/carousel.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/carousel.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component chart - version: v0.101.0 installed by templui v0.101.0 // templui component chart - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/charts // 📚 Documentation: https://templui.io/docs/components/charts
package chart package chart
@ -36,18 +36,21 @@ type Data struct {
} }
type Config struct { type Config struct {
Type Variant `json:"type"` Type Variant `json:"type"`
Data Data `json:"data"` Data Data `json:"data"`
Options Options `json:"options,omitempty"` Options Options `json:"options,omitempty"`
ShowLegend bool `json:"showLegend,omitempty"` ShowLegend bool `json:"showLegend,omitempty"`
ShowXAxis bool `json:"showXAxis"` ShowXAxis bool `json:"showXAxis"`
ShowYAxis bool `json:"showYAxis"` ShowYAxis bool `json:"showYAxis"`
ShowXLabels bool `json:"showXLabels"` ShowXLabels bool `json:"showXLabels"`
ShowYLabels bool `json:"showYLabels"` ShowYLabels bool `json:"showYLabels"`
ShowXGrid bool `json:"showXGrid"` ShowXGrid bool `json:"showXGrid"`
ShowYGrid bool `json:"showYGrid"` ShowYGrid bool `json:"showYGrid"`
Horizontal bool `json:"horizontal"` Horizontal bool `json:"horizontal"`
Stacked bool `json:"stacked"` Stacked bool `json:"stacked"`
YMin *float64 `json:"yMin,omitempty"`
YMax *float64 `json:"yMax,omitempty"`
BeginAtZero *bool `json:"beginAtZero,omitempty"`
} }
type Props struct { type Props struct {
@ -64,6 +67,9 @@ type Props struct {
ShowYGrid bool ShowYGrid bool
Horizontal bool Horizontal bool
Stacked bool Stacked bool
YMin *float64
YMax *float64
BeginAtZero *bool
Class string Class string
Attributes templ.Attributes Attributes templ.Attributes
} }
@ -103,11 +109,14 @@ templ Chart(props ...Props) {
ShowYGrid: p.ShowYGrid, ShowYGrid: p.ShowYGrid,
Horizontal: p.Horizontal, Horizontal: p.Horizontal,
Stacked: p.Stacked, Stacked: p.Stacked,
YMin: p.YMin,
YMax: p.YMax,
BeginAtZero: p.BeginAtZero,
} }
}} }}
@templ.JSONScript(dataId, chartConfig) @templ.JSONScript(dataId, chartConfig)
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/chart.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/chart.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component checkbox - version: v0.101.0 installed by templui v0.101.0 // templui component checkbox - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/checkbox // 📚 Documentation: https://templui.io/docs/components/checkbox
package checkbox package checkbox
@ -8,15 +8,17 @@ import (
) )
type Props struct { type Props struct {
ID string ID string
Class string Class string
Attributes templ.Attributes Attributes templ.Attributes
Name string Name string
Value string Value string
Disabled bool Disabled bool
Checked bool Checked bool
Form string Group string
Icon templ.Component GroupParent bool
Form string
Icon templ.Component
} }
templ Checkbox(props ...Props) { templ Checkbox(props ...Props) {
@ -42,6 +44,12 @@ templ Checkbox(props ...Props) {
if p.Form != "" { if p.Form != "" {
form={ p.Form } form={ p.Form }
} }
if p.Group != "" {
data-tui-checkbox-group={ p.Group }
}
if p.GroupParent {
data-tui-checkbox-parent="true"
}
type="checkbox" type="checkbox"
class={ class={
utils.TwMerge( utils.TwMerge(
@ -49,6 +57,7 @@ templ Checkbox(props ...Props) {
"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:border-ring", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:border-ring",
"disabled:cursor-not-allowed disabled:opacity-50", "disabled:cursor-not-allowed disabled:opacity-50",
"checked:bg-primary checked:text-primary-foreground checked:border-primary", "checked:bg-primary checked:text-primary-foreground checked:border-primary",
"indeterminate:bg-primary indeterminate:text-primary-foreground indeterminate:border-primary",
"appearance-none cursor-pointer transition-shadow", "appearance-none cursor-pointer transition-shadow",
"relative", "relative",
p.Class, p.Class,
@ -57,7 +66,7 @@ templ Checkbox(props ...Props) {
{ p.Attributes... } { p.Attributes... }
/> />
<div <div
class="absolute left-0 top-0 h-4 w-4 pointer-events-none flex items-center justify-center text-primary-foreground opacity-0 peer-checked:opacity-100" class="absolute inset-0 pointer-events-none flex items-center justify-center text-primary-foreground opacity-0 peer-checked:opacity-100"
> >
if p.Icon != nil { if p.Icon != nil {
@p.Icon @p.Icon
@ -65,5 +74,14 @@ templ Checkbox(props ...Props) {
@icon.Check(icon.Props{Size: 14}) @icon.Check(icon.Props{Size: 14})
} }
</div> </div>
<div
class="absolute inset-0 pointer-events-none flex items-center justify-center text-primary-foreground opacity-0 peer-indeterminate:opacity-100"
>
@icon.Minus(icon.Props{Size: 14})
</div>
</div> </div>
} }
templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/checkbox.min.js") }></script>
}

View file

@ -1,4 +1,4 @@
// templui component code - version: v0.101.0 installed by templui v0.101.0 // templui component code - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/code // 📚 Documentation: https://templui.io/docs/components/code
package code package code
@ -52,5 +52,5 @@ templ Code(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/code.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/code.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component collapsible - version: v0.101.0 installed by templui v0.101.0 // templui component collapsible - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/collapsible // 📚 Documentation: https://templui.io/docs/components/collapsible
package collapsible package collapsible
@ -69,7 +69,7 @@ templ Content(props ...ContentProps) {
id={ p.ID } id={ p.ID }
} }
class={ utils.TwMerge( class={ utils.TwMerge(
"grid grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out [[data-tui-collapsible-state=open]_&]:grid-rows-[1fr]", "grid grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out [&.tui-collapsible-open]:grid-rows-[1fr]",
p.Class, p.Class,
) } ) }
data-tui-collapsible="content" data-tui-collapsible="content"
@ -82,5 +82,5 @@ templ Content(props ...ContentProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/collapsible.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/collapsible.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component copybutton - version: v0.101.0 installed by templui v0.101.0 // templui component copybutton - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/copy-button // 📚 Documentation: https://templui.io/docs/components/copy-button
package copybutton package copybutton
@ -44,5 +44,5 @@ templ CopyButton(props Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/copybutton.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/copybutton.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component datepicker - version: v0.101.0 installed by templui v0.101.0 // templui component datepicker - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/date-picker // 📚 Documentation: https://templui.io/docs/components/date-picker
package datepicker package datepicker
@ -154,5 +154,5 @@ templ DatePicker(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/datepicker.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/datepicker.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component dialog - version: v0.101.0 installed by templui v0.101.0 // templui component dialog - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/dialog // 📚 Documentation: https://templui.io/docs/components/dialog
package dialog package dialog
@ -328,5 +328,5 @@ templ Description(props ...DescriptionProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/dialog.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/dialog.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component dropdown - version: v0.101.0 installed by templui v0.101.0 // templui component dropdown - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/dropdown // 📚 Documentation: https://templui.io/docs/components/dropdown
package dropdown package dropdown
@ -387,5 +387,5 @@ templ SubContent(props ...SubContentProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/dropdown.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/dropdown.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component form - version: v0.101.0 installed by templui v0.101.0 // templui component form - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/form // 📚 Documentation: https://templui.io/docs/components/form
package form package form

View file

@ -1,4 +1,4 @@
// templui component icon - version: v0.101.0 installed by templui v0.101.0 // templui component icon - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/icon // 📚 Documentation: https://templui.io/docs/components/icon
package icon package icon

View file

@ -1,4 +1,4 @@
// templui component icon - version: v0.101.0 installed by templui v0.101.0 // templui component icon - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/icon // 📚 Documentation: https://templui.io/docs/components/icon
package icon package icon
@ -122,7 +122,7 @@ var internalSvgData = map[string]string{
<path d="M2 2v20" />`, <path d="M2 2v20" />`,
"chevron-down": `<path d="m6 9 6 6 6-6" />`, "chevron-down": `<path d="m6 9 6 6 6-6" />`,
"circle-small": `<circle cx="12" cy="12" r="6" />`, "circle-small": `<circle cx="12" cy="12" r="6" />`,
"command": `<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`, "command": `<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`,
"id-card": `<path d="M16 10h2" /> "id-card": `<path d="M16 10h2" />
<path d="M16 14h2" /> <path d="M16 14h2" />
<path d="M6.17 15a3 3 0 0 1 5.66 0" /> <path d="M6.17 15a3 3 0 0 1 5.66 0" />
@ -1761,7 +1761,7 @@ var internalSvgData = map[string]string{
"folder-closed": `<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" /> "folder-closed": `<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
<path d="M2 10h20" />`, <path d="M2 10h20" />`,
"flag-triangle-right": `<path d="M6 22V2.8a.8.8 0 0 1 1.17-.71l11.38 5.69a.8.8 0 0 1 0 1.44L6 15.5" />`, "flag-triangle-right": `<path d="M6 22V2.8a.8.8 0 0 1 1.17-.71l11.38 5.69a.8.8 0 0 1 0 1.44L6 15.5" />`,
"funnel": `<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />`, "funnel": `<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />`,
"phone-missed": `<path d="m16 2 6 6" /> "phone-missed": `<path d="m16 2 6 6" />
<path d="m22 2-6 6" /> <path d="m22 2-6 6" />
<path d="M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" />`, <path d="M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" />`,
@ -2466,7 +2466,7 @@ var internalSvgData = map[string]string{
<path d="M17.8 6.2 19 5" /> <path d="M17.8 6.2 19 5" />
<path d="m3 21 9-9" /> <path d="m3 21 9-9" />
<path d="M12.2 6.2 11 5" />`, <path d="M12.2 6.2 11 5" />`,
"wifi-zero": `<path d="M12 20h.01" />`, "wifi-zero": `<path d="M12 20h.01" />`,
"arrow-big-right": `<path d="M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H5a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z" />`, "arrow-big-right": `<path d="M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H5a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z" />`,
"bell-electric": `<path d="M18.518 17.347A7 7 0 0 1 14 19" /> "bell-electric": `<path d="M18.518 17.347A7 7 0 0 1 14 19" />
<path d="M18.8 4A11 11 0 0 1 20 9" /> <path d="M18.8 4A11 11 0 0 1 20 9" />
@ -3419,7 +3419,7 @@ var internalSvgData = map[string]string{
<path d="M7 17h.01" /> <path d="M7 17h.01" />
<path d="M17 17h.01" />`, <path d="M17 17h.01" />`,
"arrow-big-up": `<path d="M9 13a1 1 0 0 0-1-1H5.061a1 1 0 0 1-.75-1.811l6.836-6.835a1.207 1.207 0 0 1 1.707 0l6.835 6.835a1 1 0 0 1-.75 1.811H16a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1z" />`, "arrow-big-up": `<path d="M9 13a1 1 0 0 0-1-1H5.061a1 1 0 0 1-.75-1.811l6.836-6.835a1.207 1.207 0 0 1 1.707 0l6.835 6.835a1 1 0 0 1-.75 1.811H16a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1z" />`,
"headphones": `<path d="M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3" />`, "headphones": `<path d="M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3" />`,
"medal": `<path d="M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15" /> "medal": `<path d="M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15" />
<path d="M11 12 5.12 2.2" /> <path d="M11 12 5.12 2.2" />
<path d="m13 12 5.88-9.8" /> <path d="m13 12 5.88-9.8" />
@ -5173,7 +5173,7 @@ var internalSvgData = map[string]string{
"square-stop": `<rect width="18" height="18" x="3" y="3" rx="2" /> "square-stop": `<rect width="18" height="18" x="3" y="3" rx="2" />
<rect x="9" y="9" width="6" height="6" rx="1" />`, <rect x="9" y="9" width="6" height="6" rx="1" />`,
"triangle-right": `<path d="M22 18a2 2 0 0 1-2 2H3c-1.1 0-1.3-.6-.4-1.3L20.4 4.3c.9-.7 1.6-.4 1.6.7Z" />`, "triangle-right": `<path d="M22 18a2 2 0 0 1-2 2H3c-1.1 0-1.3-.6-.4-1.3L20.4 4.3c.9-.7 1.6-.4 1.6.7Z" />`,
"triangle": `<path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />`, "triangle": `<path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />`,
"wallet-minimal": `<path d="M17 14h.01" /> "wallet-minimal": `<path d="M17 14h.01" />
<path d="M7 7h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14" />`, <path d="M7 7h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14" />`,
"dessert": `<path d="M10.162 3.167A10 10 0 0 0 2 13a2 2 0 0 0 4 0v-1a2 2 0 0 1 4 0v4a2 2 0 0 0 4 0v-4a2 2 0 0 1 4 0v1a2 2 0 0 0 4-.006 10 10 0 0 0-8.161-9.826" /> "dessert": `<path d="M10.162 3.167A10 10 0 0 0 2 13a2 2 0 0 0 4 0v-1a2 2 0 0 1 4 0v4a2 2 0 0 0 4 0v-4a2 2 0 0 1 4 0v1a2 2 0 0 0 4-.006 10 10 0 0 0-8.161-9.826" />
@ -6160,7 +6160,7 @@ var internalSvgData = map[string]string{
"laptop": `<path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z" /> "laptop": `<path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z" />
<path d="M20.054 15.987H3.946" />`, <path d="M20.054 15.987H3.946" />`,
"navigation-2": `<polygon points="12 2 19 21 12 17 5 21 12 2" />`, "navigation-2": `<polygon points="12 2 19 21 12 17 5 21 12 2" />`,
"twitter": `<path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" />`, "twitter": `<path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" />`,
"wine": `<path d="M8 22h8" /> "wine": `<path d="M8 22h8" />
<path d="M7 10h10" /> <path d="M7 10h10" />
<path d="M12 15v7" /> <path d="M12 15v7" />

View file

@ -1,7 +1,6 @@
// templui component icon - version: v0.101.0 installed by templui v0.101.0 // templui component icon - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/icon // 📚 Documentation: https://templui.io/docs/components/icon
package icon package icon
// This file is auto generated // This file is auto generated
// Using Lucide icons version 0.544.0 // Using Lucide icons version 0.544.0
var AlarmClockOff = Icon("alarm-clock-off") var AlarmClockOff = Icon("alarm-clock-off")

View file

@ -1,4 +1,4 @@
// templui component input - version: v0.101.0 installed by templui v0.101.0 // templui component input - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/input // 📚 Documentation: https://templui.io/docs/components/input
package input package input
@ -126,5 +126,5 @@ templ Input(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/input.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/input.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component inputotp - version: v0.101.0 installed by templui v0.101.0 // templui component inputotp - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/input-otp // 📚 Documentation: https://templui.io/docs/components/input-otp
package inputotp package inputotp
@ -177,5 +177,5 @@ templ Separator(props ...SeparatorProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/inputotp.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/inputotp.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component label - version: v0.101.0 installed by templui v0.101.0 // templui component label - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/label // 📚 Documentation: https://templui.io/docs/components/label
package label package label
@ -39,5 +39,5 @@ templ Label(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/label.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/label.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component pagination - version: v0.101.0 installed by templui v0.101.0 // templui component pagination - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/pagination // 📚 Documentation: https://templui.io/docs/components/pagination
package pagination package pagination

View file

@ -1,4 +1,4 @@
// templui component popover - version: v0.101.0 installed by templui v0.101.0 // templui component popover - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/popover // 📚 Documentation: https://templui.io/docs/components/popover
package popover package popover
@ -131,5 +131,5 @@ templ Content(props ...ContentProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/popover.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/popover.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component progress - version: v0.101.0 installed by templui v0.101.0 // templui component progress - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/progress // 📚 Documentation: https://templui.io/docs/components/progress
package progress package progress
@ -123,5 +123,5 @@ func variantClasses(variant Variant) string {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/progress.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/progress.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component radio - version: v0.101.0 installed by templui v0.101.0 // templui component radio - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/radio // 📚 Documentation: https://templui.io/docs/components/radio
package radio package radio

View file

@ -1,4 +1,4 @@
// templui component rating - version: v0.101.0 installed by templui v0.101.0 // templui component rating - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/rating // 📚 Documentation: https://templui.io/docs/components/rating
package rating package rating
@ -78,7 +78,7 @@ templ Rating(props ...Props) {
if p.Form != "" { if p.Form != "" {
form={ p.Form } form={ p.Form }
} }
data-tui-rating-input data-tui-rating-hidden-input
/> />
} }
</div> </div>
@ -189,5 +189,5 @@ func (p *Props) setDefaults() {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/rating.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/rating.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component selectbox - version: v0.101.0 installed by templui v0.101.0 // templui component selectbox - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/select-box // 📚 Documentation: https://templui.io/docs/components/select-box
package selectbox package selectbox
@ -156,6 +156,7 @@ templ Trigger(props ...TriggerProps) {
if p.Form != "" { if p.Form != "" {
form={ p.Form } form={ p.Form }
} }
data-tui-selectbox-hidden-input
{ p.Attributes... } { p.Attributes... }
/> />
{ children... } { children... }
@ -321,5 +322,5 @@ templ Item(props ...ItemProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/selectbox.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/selectbox.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component separator - version: v0.101.0 installed by templui v0.101.0 // templui component separator - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/separator // 📚 Documentation: https://templui.io/docs/components/separator
package separator package separator

View file

@ -1,4 +1,4 @@
// templui component sheet - version: v0.101.0 installed by templui v0.101.0 // templui component sheet - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/sheet // 📚 Documentation: https://templui.io/docs/components/sheet
package sheet package sheet

View file

@ -1,4 +1,4 @@
// templui component sidebar - version: v0.101.0 installed by templui v0.101.0 // templui component sidebar - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/sidebar // 📚 Documentation: https://templui.io/docs/components/sidebar
package sidebar package sidebar
@ -749,5 +749,5 @@ templ Separator(props ...SeparatorProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/sidebar.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/sidebar.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component skeleton - version: v0.101.0 installed by templui v0.101.0 // templui component skeleton - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/skeleton // 📚 Documentation: https://templui.io/docs/components/skeleton
package skeleton package skeleton

View file

@ -1,4 +1,4 @@
// templui component slider - version: v0.101.0 installed by templui v0.101.0 // templui component slider - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/slider // 📚 Documentation: https://templui.io/docs/components/slider
package slider package slider
@ -117,5 +117,5 @@ templ Value(props ...ValueProps) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/slider.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/slider.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component switch - version: v0.101.0 installed by templui v0.101.0 // templui component switch - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/switch // 📚 Documentation: https://templui.io/docs/components/switch
package switchcomp package switchcomp

View file

@ -1,4 +1,4 @@
// templui component table - version: v0.101.0 installed by templui v0.101.0 // templui component table - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/table // 📚 Documentation: https://templui.io/docs/components/table
package table package table
@ -58,17 +58,15 @@ templ Table(props ...Props) {
if len(props) > 0 { if len(props) > 0 {
{{ p = props[0] }} {{ p = props[0] }}
} }
<div class="relative w-full overflow-auto"> <table
<table if p.ID != "" {
if p.ID != "" { id={ p.ID }
id={ p.ID } }
} class={ utils.TwMerge("w-full caption-bottom text-sm", p.Class) }
class={ utils.TwMerge("w-full caption-bottom text-sm", p.Class) } { p.Attributes... }
{ p.Attributes... } >
> { children... }
{ children... } </table>
</table>
</div>
} }
templ Header(props ...HeaderProps) { templ Header(props ...HeaderProps) {

View file

@ -1,4 +1,4 @@
// templui component tabs - version: v0.101.0 installed by templui v0.101.0 // templui component tabs - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/tabs // 📚 Documentation: https://templui.io/docs/components/tabs
package tabs package tabs
@ -159,5 +159,5 @@ func IDFromContext(ctx context.Context) string {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/tabs.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/tabs.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component tagsinput - version: v0.101.0 installed by templui v0.101.0 // templui component tagsinput - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/tags-input // 📚 Documentation: https://templui.io/docs/components/tags-input
package tagsinput package tagsinput
@ -26,9 +26,6 @@ templ TagsInput(props ...Props) {
if len(props) > 0 { if len(props) > 0 {
{{ p = props[0] }} {{ p = props[0] }}
} }
if p.ID == "" {
{{ p.ID = utils.RandomID() }}
}
<div <div
id={ p.ID + "-container" } id={ p.ID + "-container" }
class={ class={
@ -93,5 +90,5 @@ templ TagsInput(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/tagsinput.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/tagsinput.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component textarea - version: v0.101.0 installed by templui v0.101.0 // templui component textarea - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/textarea // 📚 Documentation: https://templui.io/docs/components/textarea
package textarea package textarea
@ -81,5 +81,5 @@ templ Textarea(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/textarea.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/textarea.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component timepicker - version: v0.101.0 installed by templui v0.101.0 // templui component timepicker - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/time-picker // 📚 Documentation: https://templui.io/docs/components/time-picker
package timepicker package timepicker
@ -246,5 +246,5 @@ templ TimePicker(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/timepicker.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/timepicker.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component toast - version: v0.101.0 installed by templui v0.101.0 // templui component toast - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/toast // 📚 Documentation: https://templui.io/docs/components/toast
package toast package toast
@ -149,5 +149,5 @@ templ Toast(props ...Props) {
} }
templ Script() { templ Script() {
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/toast.min.js?v=" + utils.ScriptVersion }></script> <script defer nonce={ templ.GetNonce(ctx) } src={ utils.ScriptURL("/assets/js/toast.min.js") }></script>
} }

View file

@ -1,4 +1,4 @@
// templui component tooltip - version: v0.101.0 installed by templui v0.101.0 // templui component tooltip - version: v1.2.0 installed by templui v1.2.0
// 📚 Documentation: https://templui.io/docs/components/tooltip // 📚 Documentation: https://templui.io/docs/components/tooltip
package tooltip package tooltip

View file

@ -58,3 +58,17 @@ func RandomID() string {
// ScriptVersion is a timestamp generated at app start for cache busting. // ScriptVersion is a timestamp generated at app start for cache busting.
// Used in Script() templates to append ?v=<timestamp> to script URLs. // Used in Script() templates to append ?v=<timestamp> to script URLs.
var ScriptVersion = fmt.Sprintf("%d", time.Now().Unix()) var ScriptVersion = fmt.Sprintf("%d", time.Now().Unix())
// ScriptURL generates cache-busted script URLs.
// Override this to use custom cache busting (CDN, content hashing, etc.)
//
// Example override in your app:
//
// func init() {
// utils.ScriptURL = func(path string) string {
// return myAssetManifest.GetURL(path)
// }
// }
var ScriptURL = func(path string) string {
return path + "?v=" + ScriptVersion
}